Imported Upstream version 1.4.19 upstream upstream/1.4.19
authorJinWang An <jinwang.an@samsung.com>
Tue, 28 Dec 2021 03:58:57 +0000 (12:58 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 28 Dec 2021 03:58:57 +0000 (12:58 +0900)
1618 files changed:
.prev-version
.tarball-version
.version
ABOUT-NLS [new file with mode: 0644]
AUTHORS
BACKLOG
COPYING
ChangeLog
ChangeLog-2014
GNUmakefile
INSTALL
Makefile.am
Makefile.in
NEWS
README
THANKS
TODO
acinclude.m4
aclocal.m4
bootstrap
build-aux/announce-gen
build-aux/ar-lib [deleted file]
build-aux/compile
build-aux/config.guess
build-aux/config.rpath
build-aux/config.sub
build-aux/depcomp
build-aux/do-release-commit-and-tag
build-aux/gendocs.sh
build-aux/git-version-gen
build-aux/gitlog-to-changelog
build-aux/gnu-web-doc-update
build-aux/gnupload
build-aux/install-sh
build-aux/mdate-sh
build-aux/missing
build-aux/snippet/_Noreturn.h [deleted file]
build-aux/snippet/warn-on-use.h [deleted file]
build-aux/test-driver
build-aux/texinfo.tex
build-aux/update-copyright
build-aux/useless-if-before-free
build-aux/vc-list-files
c-boxes.el
cfg.mk
checks/001.preprocess
checks/002.debugging_
checks/003.command_li
checks/004.command_li
checks/005.command_li
checks/006.command_li
checks/007.command_li
checks/008.comments
checks/009.comments
checks/010.input_proc
checks/011.input_proc
checks/012.inhibiting
checks/013.inhibiting
checks/014.inhibiting
checks/015.inhibiting
checks/016.inhibiting
checks/017.inhibiting
checks/018.inhibiting
checks/019.inhibiting
checks/020.macro_argu
checks/021.macro_argu
checks/022.macro_argu
checks/023.macro_argu
checks/024.macro_argu
checks/025.quoting_ar
checks/026.macro_expa
checks/027.macro_expa
checks/028.define
checks/029.define
checks/030.define
checks/031.arguments
checks/032.arguments
checks/033.arguments
checks/034.arguments
checks/035.arguments
checks/036.arguments
checks/037.pseudo_arg
checks/038.pseudo_arg
checks/039.pseudo_arg
checks/040.pseudo_arg
checks/041.pseudo_arg
checks/042.pseudo_arg
checks/043.pseudo_arg
checks/044.pseudo_arg
checks/045.pseudo_arg
checks/046.undefine
checks/047.undefine
checks/048.defn
checks/049.defn
checks/050.defn
checks/051.defn
checks/052.defn
checks/053.defn
checks/054.defn
checks/055.pushdef
checks/056.pushdef
checks/057.indir
checks/058.indir
checks/059.indir
checks/060.builtin
checks/061.builtin
checks/062.builtin
checks/063.builtin
checks/064.builtin
checks/065.ifdef
checks/066.ifelse
checks/067.ifelse
checks/068.ifelse
checks/069.ifelse
checks/070.ifelse
checks/071.shift
checks/072.shift
checks/073.shift
checks/074.shift
checks/075.shift
checks/076.shift
checks/077.shift
checks/078.shift
checks/079.forloop
checks/080.forloop
checks/081.forloop
checks/082.foreach
checks/083.foreach
checks/084.foreach
checks/085.foreach
checks/086.foreach
checks/087.foreach
checks/088.stacks
checks/089.stacks
checks/090.compositio
checks/091.compositio
checks/092.compositio
checks/093.compositio
checks/094.dumpdef
checks/095.dumpdef
checks/096.trace
checks/097.trace
checks/098.trace
checks/099.trace
checks/100.trace
checks/101.debug_leve
checks/102.debug_leve
checks/103.debug_leve
checks/104.debug_outp
checks/105.dnl
checks/106.dnl
checks/107.dnl
checks/108.changequot
checks/109.changequot
checks/121.changecom
checks/122.changecom
checks/123.changecom
checks/124.changecom
checks/125.changeword
checks/126.changeword
checks/127.changeword
checks/128.changeword
checks/129.changeword
checks/130.changeword
checks/131.m4wrap
checks/132.m4wrap
checks/133.m4wrap
checks/134.m4wrap
checks/135.m4wrap
checks/136.m4wrap
checks/137.include
checks/138.include
checks/139.include
checks/140.include
checks/141.include
checks/142.include
checks/143.diversions
checks/144.diversions
checks/145.diversions
checks/146.diversions
checks/147.divert
checks/148.divert
checks/149.divert
checks/150.divert
checks/151.divert
checks/152.undivert
checks/153.undivert
checks/154.undivert
checks/155.undivert
checks/156.undivert
checks/157.undivert
checks/158.divnum
checks/159.cleardiver
checks/160.cleardiver
checks/161.len
checks/162.index_macr
checks/163.index_macr
checks/164.index_macr
checks/165.index_macr
checks/166.regexp
checks/167.regexp
checks/168.regexp
checks/169.substr
checks/170.substr
checks/171.translit
checks/172.translit
checks/173.translit
checks/174.translit
checks/175.patsubst
checks/176.patsubst
checks/177.patsubst
checks/178.patsubst
checks/179.patsubst
checks/180.format
checks/181.format
checks/182.format
checks/183.format
checks/184.incr
checks/185.eval
checks/186.eval
checks/187.eval
checks/188.eval
checks/189.eval
checks/190.eval
checks/191.platform_m
checks/192.platform_m
checks/193.platform_m
checks/194.syscmd
checks/195.syscmd
checks/196.esyscmd
checks/197.sysval
checks/198.sysval
checks/199.mkstemp
checks/200.mkstemp
checks/201.mkstemp
checks/202.errprint
checks/203.location
checks/204.location
checks/205.location
checks/206.m4exit
checks/207.m4exit
checks/208.using_froz
checks/209.using_froz
checks/210.using_froz
checks/211.extensions
checks/212.other_inco
checks/213.other_inco
checks/214.improved_e
checks/215.improved_f
checks/216.improved_f
checks/217.improved_f
checks/218.improved_f
checks/219.improved_f
checks/220.improved_f
checks/221.improved_f
checks/222.improved_f
checks/223.improved_f
checks/224.improved_f
checks/225.improved_f
checks/226.improved_f
checks/227.improved_f
checks/228.improved_f
checks/229.improved_c
checks/230.improved_c
checks/231.improved_m
checks/232.improved_m
checks/233.improved_c
checks/234.improved_c
checks/235.improved_c
checks/236.improved_f
checks/Makefile.am
checks/Makefile.in
checks/check-them
checks/get-them
checks/stackovf.test
configure
configure.ac
doc/Makefile.am
doc/Makefile.in
doc/fdl-1.3.texi
doc/gendocs_template
doc/gpl-3.0.texi
doc/m4.1
doc/m4.info
doc/m4.info-1
doc/m4.info-2
doc/m4.texi
doc/stamp-vti
doc/version.texi
examples/Makefile.am
examples/Makefile.in
lib/Makefile.am
lib/Makefile.in
lib/_Noreturn.h [new file with mode: 0644]
lib/access.c [new file with mode: 0644]
lib/alignof.h
lib/alloca.in.h
lib/arg-nonnull.h [moved from build-aux/snippet/arg-nonnull.h with 82% similarity]
lib/asnprintf.c
lib/asprintf.c
lib/assure.h [new file with mode: 0644]
lib/asyncsafe-spin.c [new file with mode: 0644]
lib/asyncsafe-spin.h [new file with mode: 0644]
lib/at-func.c [new file with mode: 0644]
lib/attribute.h [new file with mode: 0644]
lib/basename-lgpl.c
lib/basename-lgpl.h [new file with mode: 0644]
lib/basename.c
lib/binary-io.c
lib/binary-io.h
lib/bitrotate.c [new file with mode: 0644]
lib/bitrotate.h [new file with mode: 0644]
lib/btowc.c
lib/c++defs.h [moved from build-aux/snippet/c++defs.h with 91% similarity]
lib/c-ctype.h
lib/c-stack.c
lib/c-stack.h
lib/c-strcase.h
lib/c-strcasecmp.c
lib/c-strcaseeq.h
lib/c-strncasecmp.c
lib/calloc.c [new file with mode: 0644]
lib/canonicalize-lgpl.c
lib/canonicalize.c [new file with mode: 0644]
lib/canonicalize.h [new file with mode: 0644]
lib/cdefs.h [new file with mode: 0644]
lib/chdir-long.c [new file with mode: 0644]
lib/chdir-long.h [new file with mode: 0644]
lib/clean-temp-private.h [new file with mode: 0644]
lib/clean-temp-simple.c [new file with mode: 0644]
lib/clean-temp-simple.h [new file with mode: 0644]
lib/clean-temp.c
lib/clean-temp.h
lib/cloexec.c
lib/cloexec.h
lib/close-stream.c
lib/close.c
lib/closedir.c [moved from tests/closedir.c with 91% similarity]
lib/closein.c
lib/closein.h
lib/closeout.c
lib/closeout.h
lib/concat-filename.c [new file with mode: 0644]
lib/concat-filename.h [new file with mode: 0644]
lib/config.charset [deleted file]
lib/config.hin
lib/dirent-private.h [moved from tests/dirent-private.h with 84% similarity]
lib/dirent.in.h [moved from tests/dirent.in.h with 94% similarity]
lib/dirfd.c [moved from tests/dirfd.c with 93% similarity]
lib/dirname-lgpl.c
lib/dirname.c
lib/dirname.h
lib/dosname.h [deleted file]
lib/dup-safer-flag.c
lib/dup-safer.c
lib/dup.c [moved from tests/dup.c with 83% similarity]
lib/dup2.c
lib/dynarray.h [new file with mode: 0644]
lib/eloop-threshold.h [new file with mode: 0644]
lib/errno.in.h
lib/error.c
lib/error.h
lib/execute.c
lib/execute.h
lib/exitfail.c
lib/exitfail.h
lib/fatal-signal.c
lib/fatal-signal.h
lib/fchdir.c [new file with mode: 0644]
lib/fclose.c
lib/fcntl.c
lib/fcntl.in.h
lib/fd-hook.c
lib/fd-hook.h
lib/fd-safer-flag.c
lib/fd-safer.c
lib/fdopendir.c [new file with mode: 0644]
lib/fflush.c
lib/file-set.c [new file with mode: 0644]
lib/file-set.h [new file with mode: 0644]
lib/filename.h [new file with mode: 0644]
lib/filenamecat-lgpl.c
lib/filenamecat.c
lib/filenamecat.h
lib/findprog-in.c [new file with mode: 0644]
lib/findprog.h [new file with mode: 0644]
lib/flexmember.h [new file with mode: 0644]
lib/float+.h
lib/float.c
lib/float.in.h
lib/fopen-safer.c
lib/fopen.c
lib/fpending.c
lib/fpending.h
lib/fpucw.h
lib/fpurge.c
lib/freadahead.c
lib/freadahead.h
lib/freading.c
lib/freading.h
lib/free.c [new file with mode: 0644]
lib/frexp.c
lib/frexpl.c
lib/fseek.c
lib/fseeko.c
lib/fstat.c
lib/fstatat.c [new file with mode: 0644]
lib/ftell.c
lib/ftello.c
lib/getcwd-lgpl.c [moved from tests/getcwd-lgpl.c with 83% similarity]
lib/getcwd.c [new file with mode: 0644]
lib/getdtablesize.c
lib/getopt-cdefs.in.h [new file with mode: 0644]
lib/getopt-core.h [new file with mode: 0644]
lib/getopt-ext.h [new file with mode: 0644]
lib/getopt-pfx-core.h [new file with mode: 0644]
lib/getopt-pfx-ext.h [new file with mode: 0644]
lib/getopt.c
lib/getopt.in.h
lib/getopt1.c
lib/getopt_int.h
lib/getpagesize.c [moved from tests/getpagesize.c with 82% similarity]
lib/getprogname.c
lib/getprogname.h
lib/getrandom.c [new file with mode: 0644]
lib/gettext.h
lib/gettimeofday.c [deleted file]
lib/gl_anyhash1.h [moved from lib/gl_anyhash_list1.h with 63% similarity]
lib/gl_anyhash2.h [new file with mode: 0644]
lib/gl_anyhash_primes.h [moved from lib/gl_anyhash_list2.h with 74% similarity]
lib/gl_anylinked_list1.h
lib/gl_anylinked_list2.h
lib/gl_anytree_oset.h
lib/gl_avltree_ordered.h [new file with mode: 0644]
lib/gl_avltree_oset.c
lib/gl_avltree_oset.h
lib/gl_linked_list.c [new file with mode: 0644]
lib/gl_linked_list.h [new file with mode: 0644]
lib/gl_linkedhash_list.c
lib/gl_linkedhash_list.h
lib/gl_list.h
lib/gl_oset.h
lib/gl_xlist.h
lib/gl_xoset.h
lib/glthread/lock.c
lib/glthread/lock.h
lib/glthread/threadlib.c
lib/glthread/tls.c
lib/glthread/tls.h
lib/gnulib.mk
lib/hard-locale.c
lib/hard-locale.h
lib/hash-pjw.c [new file with mode: 0644]
lib/hash-pjw.h [new file with mode: 0644]
lib/hash-triple-simple.c [new file with mode: 0644]
lib/hash-triple.h [new file with mode: 0644]
lib/hash.c [new file with mode: 0644]
lib/hash.h [new file with mode: 0644]
lib/iconv.c [new file with mode: 0644]
lib/iconv.in.h [new file with mode: 0644]
lib/iconv_close.c [new file with mode: 0644]
lib/iconv_open-aix.gperf [new file with mode: 0644]
lib/iconv_open-aix.h [new file with mode: 0644]
lib/iconv_open-hpux.gperf [new file with mode: 0644]
lib/iconv_open-hpux.h [new file with mode: 0644]
lib/iconv_open-irix.gperf [new file with mode: 0644]
lib/iconv_open-irix.h [new file with mode: 0644]
lib/iconv_open-osf.gperf [new file with mode: 0644]
lib/iconv_open-osf.h [new file with mode: 0644]
lib/iconv_open-solaris.gperf [new file with mode: 0644]
lib/iconv_open-solaris.h [new file with mode: 0644]
lib/iconv_open-zos.gperf [new file with mode: 0644]
lib/iconv_open-zos.h [new file with mode: 0644]
lib/iconv_open.c [new file with mode: 0644]
lib/idx.h [new file with mode: 0644]
lib/ignore-value.h
lib/intprops.h
lib/inttypes.in.h [moved from tests/inttypes.in.h with 59% similarity]
lib/isnan.c
lib/isnand-nolibm.h
lib/isnand.c
lib/isnanf-nolibm.h
lib/isnanf.c
lib/isnanl-nolibm.h
lib/isnanl.c
lib/iswblank.c [new file with mode: 0644]
lib/iswdigit.c [new file with mode: 0644]
lib/iswxdigit.c [new file with mode: 0644]
lib/itold.c
lib/langinfo.in.h
lib/lc-charset-dispatch.c [new file with mode: 0644]
lib/lc-charset-dispatch.h [new file with mode: 0644]
lib/libc-config.h [new file with mode: 0644]
lib/limits.in.h
lib/localcharset.c
lib/localcharset.h
lib/locale.in.h
lib/localeconv.c
lib/localename-table.c [new file with mode: 0644]
lib/localename-table.h [new file with mode: 0644]
lib/localename.c [moved from tests/localename.c with 79% similarity]
lib/localename.h [moved from tests/localename.h with 94% similarity]
lib/lseek.c
lib/lstat.c
lib/malloc.c
lib/malloc/dynarray-skeleton.c [new file with mode: 0644]
lib/malloc/dynarray.h [new file with mode: 0644]
lib/malloc/dynarray_at_failure.c [new file with mode: 0644]
lib/malloc/dynarray_emplace_enlarge.c [new file with mode: 0644]
lib/malloc/dynarray_finalize.c [new file with mode: 0644]
lib/malloc/dynarray_resize.c [new file with mode: 0644]
lib/malloc/dynarray_resize_clear.c [new file with mode: 0644]
lib/malloc/scratch_buffer.h [new file with mode: 0644]
lib/malloc/scratch_buffer_dupfree.c [new file with mode: 0644]
lib/malloc/scratch_buffer_grow.c [new file with mode: 0644]
lib/malloc/scratch_buffer_grow_preserve.c [new file with mode: 0644]
lib/malloc/scratch_buffer_set_array_size.c [new file with mode: 0644]
lib/malloca.c
lib/malloca.h
lib/malloca.valgrind [deleted file]
lib/math.in.h
lib/mbchar.c [new file with mode: 0644]
lib/mbchar.h [new file with mode: 0644]
lib/mbiter.c [new file with mode: 0644]
lib/mbiter.h [new file with mode: 0644]
lib/mbrtowc-impl-utf8.h [new file with mode: 0644]
lib/mbrtowc-impl.h [new file with mode: 0644]
lib/mbrtowc.c
lib/mbsinit.c
lib/mbslen.c [new file with mode: 0644]
lib/mbsstr.c [new file with mode: 0644]
lib/mbtowc-impl.h
lib/mbtowc-lock.c [new file with mode: 0644]
lib/mbtowc-lock.h [new file with mode: 0644]
lib/mbtowc.c
lib/mbuiter.c [new file with mode: 0644]
lib/mbuiter.h [new file with mode: 0644]
lib/memchr.c
lib/memchr.valgrind
lib/memchr2.c
lib/memchr2.h
lib/memchr2.valgrind
lib/mempcpy.c [new file with mode: 0644]
lib/memrchr.c [new file with mode: 0644]
lib/minmax.h
lib/mkdir.c [new file with mode: 0644]
lib/mkdtemp.c
lib/mkstemp-safer.c
lib/mkstemp.c
lib/msvc-inval.c
lib/msvc-inval.h
lib/msvc-nothrow.c
lib/msvc-nothrow.h
lib/nl_langinfo-lock.c [new file with mode: 0644]
lib/nl_langinfo.c
lib/obstack.c
lib/obstack.h
lib/open.c
lib/openat-die.c [new file with mode: 0644]
lib/openat-priv.h [new file with mode: 0644]
lib/openat-proc.c [new file with mode: 0644]
lib/openat.c [new file with mode: 0644]
lib/openat.h [new file with mode: 0644]
lib/opendir.c [moved from tests/opendir.c with 89% similarity]
lib/os2-spawn.c [new file with mode: 0644]
lib/os2-spawn.h [new file with mode: 0644]
lib/pathmax.h
lib/pipe-safer.c
lib/pipe.c [new file with mode: 0644]
lib/pipe2-safer.c
lib/pipe2.c
lib/printf-args.c
lib/printf-args.h
lib/printf-frexp.c
lib/printf-frexp.h
lib/printf-frexpl.c
lib/printf-frexpl.h
lib/printf-parse.c
lib/printf-parse.h
lib/progname.c
lib/progname.h
lib/propername.c [new file with mode: 0644]
lib/propername.h [new file with mode: 0644]
lib/quote.h
lib/quotearg.c
lib/quotearg.h
lib/raise.c
lib/rawmemchr.c
lib/rawmemchr.valgrind
lib/readdir.c [moved from tests/readdir.c with 89% similarity]
lib/readlink.c
lib/realloc.c [new file with mode: 0644]
lib/reallocarray.c [new file with mode: 0644]
lib/ref-add.sin [deleted file]
lib/ref-del.sin [deleted file]
lib/regcomp.c
lib/regex.c
lib/regex.h
lib/regex_internal.c
lib/regex_internal.h
lib/regexec.c
lib/rename.c
lib/rewinddir.c [new file with mode: 0644]
lib/rmdir.c
lib/same-inode.h
lib/save-cwd.c [new file with mode: 0644]
lib/save-cwd.h [new file with mode: 0644]
lib/sched.in.h
lib/scratch_buffer.h [new file with mode: 0644]
lib/secure_getenv.c
lib/setlocale-lock.c [new file with mode: 0644]
lib/setlocale.c [new file with mode: 0644]
lib/setlocale_null.c [new file with mode: 0644]
lib/setlocale_null.h [new file with mode: 0644]
lib/sig-handler.h
lib/sigaction.c
lib/siglist.h
lib/signal.in.h
lib/signbitd.c
lib/signbitf.c
lib/signbitl.c
lib/sigprocmask.c
lib/sigsegv.c [new file with mode: 0644]
lib/sigsegv.in.h [new file with mode: 0644]
lib/size_max.h
lib/snprintf.c
lib/spawn-pipe.c
lib/spawn-pipe.h
lib/spawn.c [new file with mode: 0644]
lib/spawn.in.h
lib/spawn_faction_addchdir.c [new file with mode: 0644]
lib/spawn_faction_addclose.c
lib/spawn_faction_adddup2.c
lib/spawn_faction_addopen.c
lib/spawn_faction_destroy.c
lib/spawn_faction_init.c
lib/spawn_int.h
lib/spawnattr_destroy.c
lib/spawnattr_init.c
lib/spawnattr_setflags.c
lib/spawnattr_setpgroup.c [new file with mode: 0644]
lib/spawnattr_setsigmask.c
lib/spawni.c
lib/spawnp.c
lib/stackvma.c [new file with mode: 0644]
lib/stackvma.h [new file with mode: 0644]
lib/stat-time.c [new file with mode: 0644]
lib/stat-time.h [new file with mode: 0644]
lib/stat-w32.c [new file with mode: 0644]
lib/stat-w32.h [new file with mode: 0644]
lib/stat.c
lib/stdalign.in.h [moved from tests/stdalign.in.h with 78% similarity]
lib/stdarg.in.h
lib/stdbool.in.h
lib/stddef.in.h
lib/stdint.in.h
lib/stdio--.h
lib/stdio-impl.h
lib/stdio-safer.h
lib/stdio-write.c
lib/stdio.in.h
lib/stdlib--.h
lib/stdlib-safer.h
lib/stdlib.in.h
lib/stpcpy.c [new file with mode: 0644]
lib/str-kmp.h [new file with mode: 0644]
lib/str-two-way.h
lib/strchrnul.c
lib/strchrnul.valgrind
lib/strdup.c [moved from tests/strdup.c with 88% similarity]
lib/streq.h
lib/strerror-override.c
lib/strerror-override.h
lib/strerror.c
lib/striconv.c [new file with mode: 0644]
lib/striconv.h [new file with mode: 0644]
lib/string.in.h
lib/stripslash.c
lib/strndup.c
lib/strnlen.c
lib/strnlen1.c [new file with mode: 0644]
lib/strnlen1.h [new file with mode: 0644]
lib/strsignal.c
lib/strstr.c
lib/strtod.c
lib/sys_random.in.h [new file with mode: 0644]
lib/sys_stat.in.h
lib/sys_types.in.h
lib/sys_wait.in.h
lib/tempname.c
lib/tempname.h
lib/thread-optim.h [new file with mode: 0644]
lib/time.in.h
lib/tmpdir.c
lib/tmpdir.h
lib/trim.c [new file with mode: 0644]
lib/trim.h [new file with mode: 0644]
lib/unistd--.h
lib/unistd-safer.h
lib/unistd.in.h
lib/unistr.in.h [new file with mode: 0644]
lib/unistr/u8-mbtoucr.c [new file with mode: 0644]
lib/unistr/u8-uctomb-aux.c [new file with mode: 0644]
lib/unistr/u8-uctomb.c [new file with mode: 0644]
lib/unitypes.in.h [new file with mode: 0644]
lib/uniwidth.in.h [new file with mode: 0644]
lib/uniwidth/cjk.h [new file with mode: 0644]
lib/uniwidth/width.c [new file with mode: 0644]
lib/unlocked-io.h
lib/unused-parameter.h [moved from build-aux/snippet/unused-parameter.h with 80% similarity]
lib/vasnprintf.c
lib/vasnprintf.h
lib/vasprintf.c
lib/verify.h
lib/verror.c
lib/verror.h
lib/version-etc-fsf.c
lib/version-etc.c
lib/version-etc.h
lib/w32spawn.h [deleted file]
lib/wait-process.c
lib/wait-process.h
lib/waitpid.c
lib/warn-on-use.h [new file with mode: 0644]
lib/wchar.in.h
lib/wcrtomb.c
lib/wctype.in.h
lib/wcwidth.c [new file with mode: 0644]
lib/windows-initguard.h [new file with mode: 0644]
lib/windows-mutex.c [new file with mode: 0644]
lib/windows-mutex.h [new file with mode: 0644]
lib/windows-once.c [new file with mode: 0644]
lib/windows-once.h [new file with mode: 0644]
lib/windows-recmutex.c [new file with mode: 0644]
lib/windows-recmutex.h [new file with mode: 0644]
lib/windows-rwlock.c [new file with mode: 0644]
lib/windows-rwlock.h [new file with mode: 0644]
lib/windows-spawn.c [new file with mode: 0644]
lib/windows-spawn.h [new file with mode: 0644]
lib/windows-spin.c [new file with mode: 0644]
lib/windows-spin.h [new file with mode: 0644]
lib/windows-tls.c [new file with mode: 0644]
lib/windows-tls.h [new file with mode: 0644]
lib/xalloc-die.c
lib/xalloc-oversized.h
lib/xalloc.h
lib/xasprintf.c
lib/xmalloc.c
lib/xmalloca.c
lib/xmalloca.h
lib/xprintf.c
lib/xprintf.h
lib/xsize.h
lib/xstriconv.c [new file with mode: 0644]
lib/xstriconv.h [new file with mode: 0644]
lib/xstrndup.c
lib/xstrndup.h
lib/xvasprintf.c
lib/xvasprintf.h
m4/00gnulib.m4
m4/__inline.m4 [new file with mode: 0644]
m4/absolute-header.m4
m4/access.m4 [new file with mode: 0644]
m4/alloca.m4
m4/ansi-c++.m4
m4/arpa_inet_h.m4 [new file with mode: 0644]
m4/asm-underscore.m4
m4/assert.m4
m4/autobuild.m4
m4/btowc.m4
m4/builtin-expect.m4
m4/c-stack.m4
m4/calloc.m4 [new file with mode: 0644]
m4/canonicalize.m4
m4/chdir-long.m4 [new file with mode: 0644]
m4/clock_time.m4 [new file with mode: 0644]
m4/close.m4
m4/closedir.m4
m4/codeset.m4
m4/config-h.m4
m4/configmake.m4
m4/creat.m4 [new file with mode: 0644]
m4/ctype.m4 [deleted file]
m4/ctype_h.m4 [new file with mode: 0644]
m4/d-ino.m4 [new file with mode: 0644]
m4/dirent_h.m4
m4/dirfd.m4
m4/dirname.m4 [deleted file]
m4/double-slash-root.m4
m4/dup.m4
m4/dup2.m4
m4/eaccess.m4 [new file with mode: 0644]
m4/eealloc.m4
m4/environ.m4
m4/errno_h.m4
m4/error.m4
m4/execute.m4
m4/explicit_bzero.m4 [new file with mode: 0644]
m4/exponentd.m4
m4/exponentf.m4
m4/exponentl.m4
m4/extensions.m4
m4/extern-inline.m4
m4/fatal-signal.m4
m4/fchdir.m4 [new file with mode: 0644]
m4/fclose.m4
m4/fcntl-o.m4
m4/fcntl.m4
m4/fcntl_h.m4
m4/fdopen.m4
m4/fdopendir.m4 [new file with mode: 0644]
m4/fflush.m4
m4/filenamecat.m4
m4/findprog-in.m4 [moved from m4/closeout.m4 with 51% similarity]
m4/findprog.m4 [moved from m4/closein.m4 with 52% similarity]
m4/flexmember.m4
m4/float_h.m4
m4/fopen.m4
m4/fpending.m4
m4/fpieee.m4
m4/fpurge.m4
m4/freadahead.m4
m4/freading.m4
m4/free.m4 [new file with mode: 0644]
m4/freopen.m4 [new file with mode: 0644]
m4/frexp.m4
m4/frexpl.m4
m4/fseek.m4
m4/fseeko.m4
m4/fstat.m4
m4/fstatat.m4 [new file with mode: 0644]
m4/ftell.m4
m4/ftello.m4
m4/ftruncate.m4 [new file with mode: 0644]
m4/getcwd-abort-bug.m4 [new file with mode: 0644]
m4/getcwd-path-max.m4 [new file with mode: 0644]
m4/getcwd.m4
m4/getdtablesize.m4
m4/getopt.m4
m4/getpagesize.m4
m4/getprogname.m4
m4/getrandom.m4 [new file with mode: 0644]
m4/gettext.m4 [new file with mode: 0644]
m4/gettimeofday.m4
m4/glibc21.m4 [deleted file]
m4/gnulib-cache.m4
m4/gnulib-common.m4
m4/gnulib-comp.m4
m4/host-cpu-c-abi.m4 [new file with mode: 0644]
m4/iconv.m4 [new file with mode: 0644]
m4/iconv_h.m4 [new file with mode: 0644]
m4/iconv_open.m4 [new file with mode: 0644]
m4/include_next.m4
m4/inet_pton.m4 [new file with mode: 0644]
m4/inline.m4 [new file with mode: 0644]
m4/intl-thread-locale.m4 [new file with mode: 0644]
m4/intlmacosx.m4
m4/intmax_t.m4
m4/inttostr.m4 [new file with mode: 0644]
m4/inttypes-pri.m4 [deleted file]
m4/inttypes.m4
m4/inttypes_h.m4
m4/ioctl.m4 [new file with mode: 0644]
m4/isblank.m4
m4/isnand.m4
m4/isnanf.m4
m4/isnanl.m4
m4/iswblank.m4 [new file with mode: 0644]
m4/iswdigit.m4 [new file with mode: 0644]
m4/iswxdigit.m4 [new file with mode: 0644]
m4/langinfo_h.m4
m4/largefile.m4
m4/lcmessage.m4
m4/ldexp.m4
m4/ldexpl.m4
m4/lib-ld.m4
m4/lib-link.m4
m4/lib-prefix.m4
m4/libsigsegv.m4
m4/libunistring-base.m4 [new file with mode: 0644]
m4/limits-h.m4
m4/link.m4
m4/localcharset.m4
m4/locale-fr.m4
m4/locale-ja.m4
m4/locale-tr.m4
m4/locale-zh.m4
m4/locale_h.m4
m4/localeconv.m4
m4/localename.m4
m4/lock.m4
m4/longlong.m4
m4/lseek.m4
m4/lstat.m4
m4/malloc.m4
m4/malloca.m4
m4/manywarnings.m4
m4/math_h.m4
m4/mbchar.m4 [new file with mode: 0644]
m4/mbiter.m4 [new file with mode: 0644]
m4/mbrtowc.m4
m4/mbsinit.m4
m4/mbslen.m4 [new file with mode: 0644]
m4/mbstate_t.m4
m4/mbtowc.m4
m4/memchr.m4
m4/mempcpy.m4 [new file with mode: 0644]
m4/memrchr.m4 [new file with mode: 0644]
m4/minmax.m4
m4/mkdir.m4 [new file with mode: 0644]
m4/mkdtemp.m4
m4/mkstemp.m4
m4/mmap-anon.m4
m4/mode_t.m4
m4/msvc-inval.m4
m4/msvc-nothrow.m4
m4/multiarch.m4
m4/musl.m4 [new file with mode: 0644]
m4/nanosleep.m4 [new file with mode: 0644]
m4/netinet_in_h.m4 [new file with mode: 0644]
m4/nl_langinfo.m4
m4/nls.m4 [new file with mode: 0644]
m4/nocrash.m4
m4/obstack.m4
m4/off_t.m4
m4/open-cloexec.m4 [new file with mode: 0644]
m4/open-slash.m4 [new file with mode: 0644]
m4/open.m4
m4/openat.m4 [new file with mode: 0644]
m4/opendir.m4
m4/pathmax.m4
m4/perror.m4 [new file with mode: 0644]
m4/pipe.m4 [new file with mode: 0644]
m4/pipe2.m4
m4/po.m4 [new file with mode: 0644]
m4/posix_spawn.m4
m4/posix_spawn_faction_addchdir.m4 [new file with mode: 0644]
m4/printf-frexp.m4
m4/printf-frexpl.m4
m4/printf.m4
m4/progtest.m4 [new file with mode: 0644]
m4/pthread-thread.m4 [new file with mode: 0644]
m4/pthread_h.m4 [new file with mode: 0644]
m4/pthread_rwlock_rdlock.m4 [new file with mode: 0644]
m4/pthread_sigmask.m4 [new file with mode: 0644]
m4/putenv.m4
m4/quotearg.m4
m4/raise.m4
m4/rawmemchr.m4
m4/read-file.m4 [moved from m4/close-stream.m4 with 55% similarity]
m4/readdir.m4
m4/readlink.m4
m4/realloc.m4 [new file with mode: 0644]
m4/reallocarray.m4 [new file with mode: 0644]
m4/regex.m4
m4/rename.m4
m4/rewinddir.m4 [new file with mode: 0644]
m4/rmdir.m4
m4/save-cwd.m4 [moved from m4/hard-locale.m4 with 54% similarity]
m4/sched_h.m4
m4/sched_yield.m4 [new file with mode: 0644]
m4/secure_getenv.m4
m4/select.m4 [new file with mode: 0644]
m4/semaphore.m4 [new file with mode: 0644]
m4/setenv.m4
m4/setlocale.m4
m4/setlocale_null.m4 [new file with mode: 0644]
m4/sh-filename.m4 [new file with mode: 0644]
m4/sig_atomic_t.m4
m4/sigaction.m4
m4/sigaltstack.m4 [new file with mode: 0644]
m4/signal_h.m4
m4/signalblocking.m4
m4/signbit.m4
m4/sigpipe.m4
m4/size_max.m4
m4/sleep.m4
m4/snprintf.m4
m4/socketlib.m4 [new file with mode: 0644]
m4/sockets.m4 [new file with mode: 0644]
m4/socklen.m4 [new file with mode: 0644]
m4/sockpfaf.m4 [new file with mode: 0644]
m4/sparcv8+.m4 [new file with mode: 0644]
m4/spawn-pipe.m4
m4/spawn_h.m4
m4/ssize_t.m4
m4/stack-direction.m4 [new file with mode: 0644]
m4/stat-time.m4 [new file with mode: 0644]
m4/stat.m4
m4/stdalign.m4
m4/stdarg.m4
m4/stdbool.m4
m4/stddef_h.m4
m4/stdint.m4
m4/stdint_h.m4
m4/stdio_h.m4
m4/stdlib_h.m4
m4/stpcpy.m4 [new file with mode: 0644]
m4/strchrnul.m4
m4/strdup.m4
m4/strerror.m4
m4/strerror_r.m4 [new file with mode: 0644]
m4/string_h.m4
m4/strndup.m4
m4/strnlen.m4
m4/strsignal.m4
m4/strstr.m4
m4/strtod.m4
m4/symlink.m4
m4/sys_ioctl_h.m4 [new file with mode: 0644]
m4/sys_random_h.m4 [new file with mode: 0644]
m4/sys_select_h.m4 [new file with mode: 0644]
m4/sys_socket_h.m4
m4/sys_stat_h.m4
m4/sys_time_h.m4
m4/sys_types_h.m4
m4/sys_uio_h.m4 [new file with mode: 0644]
m4/sys_wait_h.m4
m4/tempname.m4
m4/thread.m4 [new file with mode: 0644]
m4/threadlib.m4
m4/time_h.m4
m4/tls.m4
m4/tmpdir.m4
m4/ungetc.m4
m4/unistd-safer.m4
m4/unistd_h.m4
m4/unlocked-io.m4
m4/vasnprintf.m4
m4/vasprintf-posix.m4
m4/vasprintf.m4
m4/version-etc.m4
m4/visibility.m4 [new file with mode: 0644]
m4/wait-process.m4
m4/waitpid.m4
m4/warnings.m4
m4/wchar_h.m4
m4/wchar_t.m4
m4/wcrtomb.m4
m4/wctob.m4
m4/wctomb.m4
m4/wctype_h.m4
m4/wcwidth.m4 [new file with mode: 0644]
m4/wint_t.m4
m4/write.m4
m4/xalloc.m4
m4/xsize.m4
m4/xstrndup.m4
m4/xvasprintf.m4
m4/yield.m4 [new file with mode: 0644]
m4/zzgnulib.m4 [new file with mode: 0644]
maint.mk
po/LINGUAS [new file with mode: 0644]
po/Makefile.in.in [new file with mode: 0644]
po/Makevars [new file with mode: 0644]
po/POTFILES.in [new file with mode: 0644]
po/Rules-quot [new file with mode: 0644]
po/bg.gmo [new file with mode: 0644]
po/bg.po [new file with mode: 0644]
po/boldquot.sed [new file with mode: 0644]
po/cs.gmo [new file with mode: 0644]
po/cs.po [new file with mode: 0644]
po/da.gmo [new file with mode: 0644]
po/da.po [new file with mode: 0644]
po/de.gmo [new file with mode: 0644]
po/de.po [new file with mode: 0644]
po/el.gmo [new file with mode: 0644]
po/el.po [new file with mode: 0644]
po/en@boldquot.header [new file with mode: 0644]
po/en@quot.header [new file with mode: 0644]
po/eo.gmo [new file with mode: 0644]
po/eo.po [new file with mode: 0644]
po/es.gmo [new file with mode: 0644]
po/es.po [new file with mode: 0644]
po/fi.gmo [new file with mode: 0644]
po/fi.po [new file with mode: 0644]
po/fr.gmo [new file with mode: 0644]
po/fr.po [new file with mode: 0644]
po/ga.gmo [new file with mode: 0644]
po/ga.po [new file with mode: 0644]
po/gl.gmo [new file with mode: 0644]
po/gl.po [new file with mode: 0644]
po/hr.gmo [new file with mode: 0644]
po/hr.po [new file with mode: 0644]
po/id.gmo [new file with mode: 0644]
po/id.po [new file with mode: 0644]
po/insert-header.sin [new file with mode: 0644]
po/ja.gmo [new file with mode: 0644]
po/ja.po [new file with mode: 0644]
po/ko.gmo [new file with mode: 0644]
po/ko.po [new file with mode: 0644]
po/m4.pot [new file with mode: 0644]
po/nl.gmo [new file with mode: 0644]
po/nl.po [new file with mode: 0644]
po/pl.gmo [new file with mode: 0644]
po/pl.po [new file with mode: 0644]
po/pt_BR.gmo [new file with mode: 0644]
po/pt_BR.po [new file with mode: 0644]
po/quot.sed [new file with mode: 0644]
po/remove-potcdate.sin [new file with mode: 0644]
po/ro.gmo [new file with mode: 0644]
po/ro.po [new file with mode: 0644]
po/ru.gmo [new file with mode: 0644]
po/ru.po [new file with mode: 0644]
po/sr.gmo [new file with mode: 0644]
po/sr.po [new file with mode: 0644]
po/stamp-po [new file with mode: 0644]
po/sv.gmo [new file with mode: 0644]
po/sv.po [new file with mode: 0644]
po/uk.gmo [new file with mode: 0644]
po/uk.po [new file with mode: 0644]
po/vi.gmo [new file with mode: 0644]
po/vi.po [new file with mode: 0644]
po/zh_CN.gmo [new file with mode: 0644]
po/zh_CN.po [new file with mode: 0644]
po/zh_TW.gmo [new file with mode: 0644]
po/zh_TW.po [new file with mode: 0644]
src/Makefile.am
src/Makefile.in
src/builtin.c
src/debug.c
src/eval.c
src/format.c
src/freeze.c
src/input.c
src/m4.c
src/m4.h
src/macro.c
src/output.c
src/path.c
src/symtab.c
tests/Makefile.am
tests/Makefile.in
tests/_Noreturn.h [new file with mode: 0644]
tests/accept.c [new file with mode: 0644]
tests/alloca.c [new file with mode: 0644]
tests/altstack-util.h [new file with mode: 0644]
tests/anytostr.c [new file with mode: 0644]
tests/arg-nonnull.h [new file with mode: 0644]
tests/arpa_inet.in.h [new file with mode: 0644]
tests/atomic-int-gnulib.h [new file with mode: 0644]
tests/bind.c [new file with mode: 0644]
tests/c++defs.h [new file with mode: 0644]
tests/concat-filename.h [new file with mode: 0644]
tests/connect.c [new file with mode: 0644]
tests/creat.c [new file with mode: 0644]
tests/ctype.in.h
tests/executable-script [new file with mode: 0755]
tests/executable-script.sh [new file with mode: 0755]
tests/executable-shell-script [new file with mode: 0755]
tests/explicit_bzero.c [new file with mode: 0644]
tests/fdopen.c
tests/filename.h [deleted file]
tests/findprog.c [new file with mode: 0644]
tests/findprog.h [new file with mode: 0644]
tests/flexmember.h [deleted file]
tests/freopen.c [new file with mode: 0644]
tests/ftruncate.c [new file with mode: 0644]
tests/gettimeofday.c [new file with mode: 0644]
tests/gl_array_list.c
tests/gl_array_list.h
tests/gl_array_oset.c
tests/gl_array_oset.h
tests/glthread/thread.c [new file with mode: 0644]
tests/glthread/thread.h [new file with mode: 0644]
tests/glthread/yield.h [new file with mode: 0644]
tests/gnulib.mk
tests/imaxtostr.c [new file with mode: 0644]
tests/inet_pton.c [new file with mode: 0644]
tests/infinity.h
tests/init.sh
tests/inttostr.c [new file with mode: 0644]
tests/inttostr.h [new file with mode: 0644]
tests/ioctl.c [new file with mode: 0644]
tests/isblank.c
tests/link.c
tests/listen.c [new file with mode: 0644]
tests/locale.c [new file with mode: 0644]
tests/macros.h
tests/minus-zero.h
tests/mmap-anon-util.h [new file with mode: 0644]
tests/nan.h
tests/nanosleep.c [new file with mode: 0644]
tests/nap.h [new file with mode: 0644]
tests/netinet_in.in.h [new file with mode: 0644]
tests/null-ptr.h [new file with mode: 0644]
tests/offtostr.c [new file with mode: 0644]
tests/perror.c [new file with mode: 0644]
tests/pthread-thread.c [new file with mode: 0644]
tests/pthread.in.h [new file with mode: 0644]
tests/pthread_sigmask.c [new file with mode: 0644]
tests/putenv.c
tests/randomd.c
tests/randoml.c
tests/read-file.c [new file with mode: 0644]
tests/read-file.h [new file with mode: 0644]
tests/root-uid.h [new file with mode: 0644]
tests/sched_yield.c [new file with mode: 0644]
tests/select.c [new file with mode: 0644]
tests/setenv.c
tests/setlocale.c [deleted file]
tests/setsockopt.c [new file with mode: 0644]
tests/signature.h
tests/sleep.c
tests/socket.c [new file with mode: 0644]
tests/sockets.c [new file with mode: 0644]
tests/sockets.h [new file with mode: 0644]
tests/strerror_r.c [new file with mode: 0644]
tests/symlink.c
tests/sys_ioctl.in.h [new file with mode: 0644]
tests/sys_select.in.h [new file with mode: 0644]
tests/sys_socket.c [new file with mode: 0644]
tests/sys_socket.in.h [new file with mode: 0644]
tests/sys_time.in.h [moved from lib/sys_time.in.h with 96% similarity]
tests/sys_uio.in.h [new file with mode: 0644]
tests/test-accept.c [new file with mode: 0644]
tests/test-access.c [new file with mode: 0644]
tests/test-alignof.c
tests/test-alloca-opt.c
tests/test-arpa_inet-c++.cc [new file with mode: 0644]
tests/test-arpa_inet.c [new file with mode: 0644]
tests/test-array_list.c
tests/test-array_oset.c
tests/test-asyncsafe-spin1.c [new file with mode: 0644]
tests/test-asyncsafe-spin2.c [new file with mode: 0644]
tests/test-avltree_oset.c
tests/test-binary-io.c
tests/test-binary-io.sh
tests/test-bind.c [new file with mode: 0644]
tests/test-bitrotate.c [new file with mode: 0644]
tests/test-btowc.c
tests/test-btowc1.sh
tests/test-btowc2.sh
tests/test-c-ctype.c
tests/test-c-stack.c
tests/test-c-stack.sh
tests/test-c-stack2.sh
tests/test-c-strcase.sh
tests/test-c-strcasecmp.c
tests/test-c-strncasecmp.c
tests/test-calloc-gnu.c [new file with mode: 0644]
tests/test-canonicalize-lgpl.c
tests/test-canonicalize.c [new file with mode: 0644]
tests/test-chdir.c
tests/test-cloexec.c
tests/test-close.c
tests/test-closein.c
tests/test-closein.sh
tests/test-connect.c [new file with mode: 0644]
tests/test-creat.c [new file with mode: 0644]
tests/test-ctype-c++.cc [new file with mode: 0644]
tests/test-ctype-c++2.cc [new file with mode: 0644]
tests/test-ctype.c
tests/test-dirent-c++.cc
tests/test-dirent.c
tests/test-dirname.c
tests/test-dup-safer.c
tests/test-dup.c
tests/test-dup2.c
tests/test-dynarray.c [new file with mode: 0644]
tests/test-environ.c
tests/test-errno-c++.cc [new file with mode: 0644]
tests/test-errno-c++2.cc [new file with mode: 0644]
tests/test-errno.c
tests/test-execute-child.c [new file with mode: 0644]
tests/test-execute-main.c [new file with mode: 0644]
tests/test-execute-script.c [new file with mode: 0644]
tests/test-execute.sh [new file with mode: 0755]
tests/test-explicit_bzero.c [new file with mode: 0644]
tests/test-fchdir.c [new file with mode: 0644]
tests/test-fclose.c
tests/test-fcntl-h-c++.cc
tests/test-fcntl-h.c
tests/test-fcntl.c
tests/test-fdopen.c
tests/test-fdopendir.c [new file with mode: 0644]
tests/test-fflush.c
tests/test-fflush2.c
tests/test-fflush2.sh
tests/test-fgetc.c
tests/test-filenamecat.c
tests/test-float-c++.cc [new file with mode: 0644]
tests/test-float-c++2.cc [new file with mode: 0644]
tests/test-float.c
tests/test-fopen-gnu.c [new file with mode: 0644]
tests/test-fopen-safer.c
tests/test-fopen.c
tests/test-fopen.h
tests/test-fpending.c
tests/test-fpending.sh
tests/test-fpurge.c
tests/test-fputc.c
tests/test-fread.c
tests/test-freadahead.c
tests/test-freadahead.sh
tests/test-freading.c
tests/test-free.c [new file with mode: 0644]
tests/test-freopen.c [new file with mode: 0644]
tests/test-frexp.c
tests/test-frexp.h
tests/test-frexpl.c
tests/test-fseek.c
tests/test-fseek.sh
tests/test-fseek2.sh
tests/test-fseeko.c
tests/test-fseeko.sh
tests/test-fseeko2.sh
tests/test-fseeko3.c
tests/test-fseeko3.sh
tests/test-fseeko4.c
tests/test-fseeko4.sh
tests/test-fstat.c
tests/test-fstatat.c [new file with mode: 0644]
tests/test-ftell.c
tests/test-ftell.sh
tests/test-ftell2.sh
tests/test-ftell3.c
tests/test-ftello.c
tests/test-ftello.sh
tests/test-ftello2.sh
tests/test-ftello3.c
tests/test-ftello4.c
tests/test-ftello4.sh
tests/test-ftruncate.c [new file with mode: 0644]
tests/test-ftruncate.sh [new file with mode: 0755]
tests/test-fwrite.c
tests/test-getcwd-lgpl.c
tests/test-getcwd.c [new file with mode: 0644]
tests/test-getcwd.sh [new file with mode: 0755]
tests/test-getdtablesize.c
tests/test-getopt-gnu.c
tests/test-getopt-main.h
tests/test-getopt-posix.c [deleted file]
tests/test-getopt.h
tests/test-getopt_long.h
tests/test-getprogname.c
tests/test-getrandom.c [new file with mode: 0644]
tests/test-gettimeofday.c
tests/test-hard-locale.c [new file with mode: 0644]
tests/test-hash.c [new file with mode: 0644]
tests/test-iconv-h-c++.cc [new file with mode: 0644]
tests/test-iconv-h.c [new file with mode: 0644]
tests/test-iconv.c [new file with mode: 0644]
tests/test-ignore-value.c
tests/test-inet_pton.c [new file with mode: 0644]
tests/test-init.sh
tests/test-intprops.c
tests/test-inttostr.c [new file with mode: 0644]
tests/test-inttypes-c++.cc [new file with mode: 0644]
tests/test-inttypes-c++2.cc [new file with mode: 0644]
tests/test-inttypes.c
tests/test-ioctl.c [new file with mode: 0644]
tests/test-isblank.c
tests/test-isnand-nolibm.c
tests/test-isnand.h
tests/test-isnanf-nolibm.c
tests/test-isnanf.h
tests/test-isnanl-nolibm.c
tests/test-isnanl.h
tests/test-iswblank.c [new file with mode: 0644]
tests/test-iswdigit.c [new file with mode: 0644]
tests/test-iswdigit.sh [new file with mode: 0755]
tests/test-iswxdigit.c [new file with mode: 0644]
tests/test-iswxdigit.sh [new file with mode: 0755]
tests/test-langinfo-c++.cc
tests/test-langinfo.c
tests/test-limits-h-c++.cc [new file with mode: 0644]
tests/test-limits-h-c++2.cc [new file with mode: 0644]
tests/test-limits-h.c
tests/test-link.c
tests/test-link.h
tests/test-linked_list.c [new file with mode: 0644]
tests/test-linkedhash_list.c
tests/test-listen.c [new file with mode: 0644]
tests/test-localcharset.c [new file with mode: 0644]
tests/test-locale-c++.cc
tests/test-locale-c++2.cc
tests/test-locale.c
tests/test-localeconv.c
tests/test-localename.c
tests/test-lseek.c
tests/test-lseek.sh
tests/test-lstat.c
tests/test-lstat.h
tests/test-malloc-gnu.c [new file with mode: 0644]
tests/test-malloca.c
tests/test-math-c++.cc
tests/test-math-c++2.cc
tests/test-math.c
tests/test-mbrtowc-w32-1.sh
tests/test-mbrtowc-w32-2.sh
tests/test-mbrtowc-w32-3.sh
tests/test-mbrtowc-w32-4.sh
tests/test-mbrtowc-w32-5.sh
tests/test-mbrtowc-w32-6.sh [new file with mode: 0755]
tests/test-mbrtowc-w32-7.sh [new file with mode: 0755]
tests/test-mbrtowc-w32.c
tests/test-mbrtowc.c
tests/test-mbrtowc1.sh
tests/test-mbrtowc2.sh
tests/test-mbrtowc3.sh
tests/test-mbrtowc4.sh
tests/test-mbrtowc5.sh
tests/test-mbsinit.c
tests/test-mbsinit.sh
tests/test-mbsstr1.c [new file with mode: 0644]
tests/test-mbsstr2.c [new file with mode: 0644]
tests/test-mbsstr2.sh [new file with mode: 0755]
tests/test-mbsstr3.c [new file with mode: 0644]
tests/test-mbsstr3.sh [new file with mode: 0755]
tests/test-memchr.c
tests/test-memchr2.c
tests/test-memrchr.c [new file with mode: 0644]
tests/test-mkdir.c [new file with mode: 0644]
tests/test-mkdir.h [new file with mode: 0644]
tests/test-nanosleep.c [new file with mode: 0644]
tests/test-netinet_in.c [new file with mode: 0644]
tests/test-nl_langinfo-mt.c [new file with mode: 0644]
tests/test-nl_langinfo.c
tests/test-nl_langinfo.sh
tests/test-open.c
tests/test-open.h
tests/test-openat.c [new file with mode: 0644]
tests/test-oset-update.h [new file with mode: 0644]
tests/test-pathmax.c
tests/test-perror.c [new file with mode: 0644]
tests/test-perror.sh [new file with mode: 0755]
tests/test-perror2.c [new file with mode: 0644]
tests/test-pipe.c [new file with mode: 0644]
tests/test-pipe2.c
tests/test-posix_spawn-chdir.c [new file with mode: 0644]
tests/test-posix_spawn-dup2-stdin.c [moved from tests/test-posix_spawn2.c with 84% similarity]
tests/test-posix_spawn-dup2-stdin.in.sh [moved from tests/test-posix_spawn2.in.sh with 100% similarity]
tests/test-posix_spawn-dup2-stdout.c [moved from tests/test-posix_spawn1.c with 87% similarity]
tests/test-posix_spawn-dup2-stdout.in.sh [moved from tests/test-posix_spawn1.in.sh with 100% similarity]
tests/test-posix_spawn-inherit0.c [new file with mode: 0644]
tests/test-posix_spawn-inherit1.c [new file with mode: 0644]
tests/test-posix_spawn-open1.c [new file with mode: 0644]
tests/test-posix_spawn-open2.c [new file with mode: 0644]
tests/test-posix_spawn-script.c [new file with mode: 0644]
tests/test-posix_spawn_file_actions_addchdir.c [new file with mode: 0644]
tests/test-posix_spawn_file_actions_addclose.c
tests/test-posix_spawn_file_actions_adddup2.c
tests/test-posix_spawn_file_actions_addopen.c
tests/test-posix_spawnp-script.c [new file with mode: 0644]
tests/test-printf-frexp.c
tests/test-printf-frexpl.c
tests/test-pthread-c++.cc [new file with mode: 0644]
tests/test-pthread-thread.c [new file with mode: 0644]
tests/test-pthread.c [new file with mode: 0644]
tests/test-pthread_sigmask1.c [new file with mode: 0644]
tests/test-pthread_sigmask2.c [new file with mode: 0644]
tests/test-quotearg-simple.c
tests/test-quotearg.h
tests/test-raise.c
tests/test-rawmemchr.c
tests/test-read-file.c [new file with mode: 0644]
tests/test-readlink.c
tests/test-readlink.h
tests/test-realloc-gnu.c [new file with mode: 0644]
tests/test-reallocarray.c [new file with mode: 0644]
tests/test-regex.c
tests/test-rename.c
tests/test-rename.h
tests/test-rmdir.c
tests/test-rmdir.h
tests/test-sched.c
tests/test-scratch-buffer.c [new file with mode: 0644]
tests/test-select-fd.c [new file with mode: 0644]
tests/test-select-in.sh [new file with mode: 0755]
tests/test-select-out.sh [new file with mode: 0755]
tests/test-select-stdin.c [new file with mode: 0644]
tests/test-select.c [new file with mode: 0644]
tests/test-select.h [new file with mode: 0644]
tests/test-setenv.c
tests/test-setlocale1.c
tests/test-setlocale1.sh
tests/test-setlocale2.c
tests/test-setlocale2.sh
tests/test-setlocale_null-mt-all.c [new file with mode: 0644]
tests/test-setlocale_null-mt-one.c [new file with mode: 0644]
tests/test-setlocale_null.c [new file with mode: 0644]
tests/test-setsockopt.c [new file with mode: 0644]
tests/test-sigaction.c
tests/test-signal-h-c++.cc
tests/test-signal-h-c++2.cc
tests/test-signal-h.c
tests/test-signbit.c
tests/test-sigpipe.c
tests/test-sigpipe.sh
tests/test-sigprocmask.c
tests/test-sigsegv-catch-segv1.c [new file with mode: 0644]
tests/test-sigsegv-catch-segv2.c [new file with mode: 0644]
tests/test-sigsegv-catch-stackoverflow1.c [new file with mode: 0644]
tests/test-sigsegv-catch-stackoverflow2.c [new file with mode: 0644]
tests/test-sleep.c
tests/test-snprintf.c
tests/test-sockets.c [new file with mode: 0644]
tests/test-spawn-c++.cc
tests/test-spawn-pipe-child.c
tests/test-spawn-pipe-main.c
tests/test-spawn-pipe-script.c [new file with mode: 0644]
tests/test-spawn-pipe.sh
tests/test-spawn.c
tests/test-stat-time.c [new file with mode: 0644]
tests/test-stat.c
tests/test-stat.h
tests/test-stdalign.c
tests/test-stdbool-c++.cc [new file with mode: 0644]
tests/test-stdbool-c++2.cc [new file with mode: 0644]
tests/test-stdbool.c
tests/test-stddef-c++.cc [new file with mode: 0644]
tests/test-stddef-c++2.cc [new file with mode: 0644]
tests/test-stddef.c
tests/test-stdint-c++.cc [new file with mode: 0644]
tests/test-stdint-c++2.cc [new file with mode: 0644]
tests/test-stdint.c
tests/test-stdio-c++.cc
tests/test-stdio-c++2.cc
tests/test-stdio.c
tests/test-stdlib-c++.cc
tests/test-stdlib-c++2.cc
tests/test-stdlib.c
tests/test-strchrnul.c
tests/test-strerror.c
tests/test-strerror_r.c [new file with mode: 0644]
tests/test-striconv.c [new file with mode: 0644]
tests/test-string-c++.cc
tests/test-string-c++2.cc
tests/test-string.c
tests/test-strnlen.c
tests/test-strsignal.c
tests/test-strstr.c
tests/test-strtod.c
tests/test-strtod1.c [new file with mode: 0644]
tests/test-strtod1.sh [new file with mode: 0755]
tests/test-symlink.c
tests/test-symlink.h
tests/test-sys_ioctl-c++.cc [new file with mode: 0644]
tests/test-sys_ioctl.c [new file with mode: 0644]
tests/test-sys_random-c++.cc [new file with mode: 0644]
tests/test-sys_random.c [new file with mode: 0644]
tests/test-sys_select-c++.cc [new file with mode: 0644]
tests/test-sys_select.c [new file with mode: 0644]
tests/test-sys_socket-c++.cc [new file with mode: 0644]
tests/test-sys_socket.c [new file with mode: 0644]
tests/test-sys_stat-c++.cc
tests/test-sys_stat.c
tests/test-sys_time-c++.cc
tests/test-sys_time.c
tests/test-sys_types-c++.cc
tests/test-sys_types.c
tests/test-sys_uio.c [new file with mode: 0644]
tests/test-sys_wait-c++.cc
tests/test-sys_wait.c
tests/test-sys_wait.h
tests/test-thread_create.c [new file with mode: 0644]
tests/test-thread_self.c [new file with mode: 0644]
tests/test-time-c++.cc
tests/test-time-c++2.cc
tests/test-time.c
tests/test-unistd-c++.cc
tests/test-unistd.c
tests/test-unsetenv.c
tests/test-update-copyright.sh
tests/test-vasnprintf.c
tests/test-vasprintf-posix.c
tests/test-vasprintf.c
tests/test-vc-list-files-cvs.sh
tests/test-vc-list-files-git.sh
tests/test-verify-try.c [new file with mode: 0644]
tests/test-verify.c
tests/test-verify.sh
tests/test-version-etc.c
tests/test-version-etc.sh
tests/test-wchar-c++.cc
tests/test-wchar-c++2.cc [new file with mode: 0644]
tests/test-wchar-c++3.cc [new file with mode: 0644]
tests/test-wchar.c
tests/test-wcrtomb-w32-1.sh
tests/test-wcrtomb-w32-2.sh
tests/test-wcrtomb-w32-3.sh
tests/test-wcrtomb-w32-4.sh
tests/test-wcrtomb-w32-5.sh
tests/test-wcrtomb-w32-6.sh [new file with mode: 0755]
tests/test-wcrtomb-w32-7.sh [new file with mode: 0755]
tests/test-wcrtomb-w32.c
tests/test-wcrtomb.c
tests/test-wcrtomb.sh
tests/test-wctype-h-c++.cc
tests/test-wctype-h-c++2.cc [new file with mode: 0644]
tests/test-wctype-h.c
tests/test-wcwidth.c [new file with mode: 0644]
tests/test-write.c
tests/test-xalloc-die.c
tests/test-xalloc-die.sh
tests/test-xvasprintf.c
tests/uinttostr.c [new file with mode: 0644]
tests/umaxtostr.c [new file with mode: 0644]
tests/unistr/test-u8-mbtoucr.c [new file with mode: 0644]
tests/unistr/test-u8-uctomb.c [new file with mode: 0644]
tests/uniwidth/test-uc_width.c [new file with mode: 0644]
tests/uniwidth/test-uc_width2.c [new file with mode: 0644]
tests/uniwidth/test-uc_width2.sh [new file with mode: 0755]
tests/unsetenv.c
tests/unused-parameter.h [new file with mode: 0644]
tests/vma-iter.c [new file with mode: 0644]
tests/vma-iter.h [new file with mode: 0644]
tests/w32sock.h [new file with mode: 0644]
tests/warn-on-use.h [new file with mode: 0644]
tests/wctob.c
tests/wctomb-impl.h
tests/wctomb.c
tests/windows-thread.c [new file with mode: 0644]
tests/windows-thread.h [new file with mode: 0644]
tests/write.c
tests/xconcat-filename.c [new file with mode: 0644]
tests/zerosize-ptr.h

index 04e0d3f..a566ec8 100644 (file)
@@ -1 +1 @@
-1.4.17
+1.4.18d
index f689e8c..fd4ca57 100644 (file)
@@ -1 +1 @@
-1.4.18
+1.4.19
index f689e8c..fd4ca57 100644 (file)
--- a/.version
+++ b/.version
@@ -1 +1 @@
-1.4.18
+1.4.19
diff --git a/ABOUT-NLS b/ABOUT-NLS
new file mode 100644 (file)
index 0000000..b1de1b6
--- /dev/null
+++ b/ABOUT-NLS
@@ -0,0 +1,1282 @@
+1 Notes on the Free Translation Project
+***************************************
+
+Free software is going international!  The Free Translation Project is
+a way to get maintainers of free software, translators, and users all
+together, so that free software will gradually become able to speak many
+languages.  A few packages already provide translations for their
+messages.
+
+   If you found this `ABOUT-NLS' file inside a distribution, you may
+assume that the distributed package does use GNU `gettext' internally,
+itself available at your nearest GNU archive site.  But you do _not_
+need to install GNU `gettext' prior to configuring, installing or using
+this package with messages translated.
+
+   Installers will find here some useful hints.  These notes also
+explain how users should proceed for getting the programs to use the
+available translations.  They tell how people wanting to contribute and
+work on translations can contact the appropriate team.
+
+1.1 INSTALL Matters
+===================
+
+Some packages are "localizable" when properly installed; the programs
+they contain can be made to speak your own native language.  Most such
+packages use GNU `gettext'.  Other packages have their own ways to
+internationalization, predating GNU `gettext'.
+
+   By default, this package will be installed to allow translation of
+messages.  It will automatically detect whether the system already
+provides the GNU `gettext' functions.  Installers may use special
+options at configuration time for changing the default behaviour.  The
+command:
+
+     ./configure --disable-nls
+
+will _totally_ disable translation of messages.
+
+   When you already have GNU `gettext' installed on your system and run
+configure without an option for your new package, `configure' will
+probably detect the previously built and installed `libintl' library
+and will decide to use it.  If not, you may have to to use the
+`--with-libintl-prefix' option to tell `configure' where to look for it.
+
+   Internationalized packages usually have many `po/LL.po' files, where
+LL gives an ISO 639 two-letter code identifying the language.  Unless
+translations have been forbidden at `configure' time by using the
+`--disable-nls' switch, all available translations are installed
+together with the package.  However, the environment variable `LINGUAS'
+may be set, prior to configuration, to limit the installed set.
+`LINGUAS' should then contain a space separated list of two-letter
+codes, stating which languages are allowed.
+
+1.2 Using This Package
+======================
+
+As a user, if your language has been installed for this package, you
+only have to set the `LANG' environment variable to the appropriate
+`LL_CC' combination.  If you happen to have the `LC_ALL' or some other
+`LC_xxx' environment variables set, you should unset them before
+setting `LANG', otherwise the setting of `LANG' will not have the
+desired effect.  Here `LL' is an ISO 639 two-letter language code, and
+`CC' is an ISO 3166 two-letter country code.  For example, let's
+suppose that you speak German and live in Germany.  At the shell
+prompt, merely execute `setenv LANG de_DE' (in `csh'),
+`export LANG; LANG=de_DE' (in `sh') or `export LANG=de_DE' (in `bash').
+This can be done from your `.login' or `.profile' file, once and for
+all.
+
+   You might think that the country code specification is redundant.
+But in fact, some languages have dialects in different countries.  For
+example, `de_AT' is used for Austria, and `pt_BR' for Brazil.  The
+country code serves to distinguish the dialects.
+
+   The locale naming convention of `LL_CC', with `LL' denoting the
+language and `CC' denoting the country, is the one use on systems based
+on GNU libc.  On other systems, some variations of this scheme are
+used, such as `LL' or `LL_CC.ENCODING'.  You can get the list of
+locales supported by your system for your language by running the
+command `locale -a | grep '^LL''.
+
+   Not all programs have translations for all languages.  By default, an
+English message is shown in place of a nonexistent translation.  If you
+understand other languages, you can set up a priority list of languages.
+This is done through a different environment variable, called
+`LANGUAGE'.  GNU `gettext' gives preference to `LANGUAGE' over `LANG'
+for the purpose of message handling, but you still need to have `LANG'
+set to the primary language; this is required by other parts of the
+system libraries.  For example, some Swedish users who would rather
+read translations in German than English for when Swedish is not
+available, set `LANGUAGE' to `sv:de' while leaving `LANG' to `sv_SE'.
+
+   Special advice for Norwegian users: The language code for Norwegian
+bokma*l changed from `no' to `nb' recently (in 2003).  During the
+transition period, while some message catalogs for this language are
+installed under `nb' and some older ones under `no', it's recommended
+for Norwegian users to set `LANGUAGE' to `nb:no' so that both newer and
+older translations are used.
+
+   In the `LANGUAGE' environment variable, but not in the `LANG'
+environment variable, `LL_CC' combinations can be abbreviated as `LL'
+to denote the language's main dialect.  For example, `de' is equivalent
+to `de_DE' (German as spoken in Germany), and `pt' to `pt_PT'
+(Portuguese as spoken in Portugal) in this context.
+
+1.3 Translating Teams
+=====================
+
+For the Free Translation Project to be a success, we need interested
+people who like their own language and write it well, and who are also
+able to synergize with other translators speaking the same language.
+Each translation team has its own mailing list.  The up-to-date list of
+teams can be found at the Free Translation Project's homepage,
+`http://translationproject.org/', in the "Teams" area.
+
+   If you'd like to volunteer to _work_ at translating messages, you
+should become a member of the translating team for your own language.
+The subscribing address is _not_ the same as the list itself, it has
+`-request' appended.  For example, speakers of Swedish can send a
+message to `sv-request@li.org', having this message body:
+
+     subscribe
+
+   Keep in mind that team members are expected to participate
+_actively_ in translations, or at solving translational difficulties,
+rather than merely lurking around.  If your team does not exist yet and
+you want to start one, or if you are unsure about what to do or how to
+get started, please write to `coordinator@translationproject.org' to
+reach the coordinator for all translator teams.
+
+   The English team is special.  It works at improving and uniformizing
+the terminology in use.  Proven linguistic skills are praised more than
+programming skills, here.
+
+1.4 Available Packages
+======================
+
+Languages are not equally supported in all packages.  The following
+matrix shows the current state of internationalization, as of June
+2010.  The matrix shows, in regard of each package, for which languages
+PO files have been submitted to translation coordination, with a
+translation percentage of at least 50%.
+
+     Ready PO files       af am an ar as ast az be be@latin bg bn_IN bs ca
+                        +--------------------------------------------------+
+     a2ps               |                       []                      [] |
+     aegis              |                                                  |
+     ant-phone          |                                                  |
+     anubis             |                                                  |
+     aspell             |                []                             [] |
+     bash               |                                                  |
+     bfd                |                                                  |
+     bibshelf           |                []                                |
+     binutils           |                                                  |
+     bison              |                                                  |
+     bison-runtime      |                []                                |
+     bluez-pin          | []             []                                |
+     bombono-dvd        |                                                  |
+     buzztard           |                                                  |
+     cflow              |                                                  |
+     clisp              |                                                  |
+     coreutils          |                                   []          [] |
+     cpio               |                                                  |
+     cppi               |                                                  |
+     cpplib             |                                               [] |
+     cryptsetup         |                                                  |
+     dfarc              |                                                  |
+     dialog             |                             []                [] |
+     dico               |                                                  |
+     diffutils          |                                               [] |
+     dink               |                                                  |
+     doodle             |                                                  |
+     e2fsprogs          |                                               [] |
+     enscript           |                                               [] |
+     exif               |                                                  |
+     fetchmail          |                                               [] |
+     findutils          |                                   []             |
+     flex               |                                               [] |
+     freedink           |                                                  |
+     gas                |                                                  |
+     gawk               |                []                             [] |
+     gcal               |                                               [] |
+     gcc                |                                                  |
+     gettext-examples   | []             []                 []          [] |
+     gettext-runtime    |                                   []          [] |
+     gettext-tools      |                                   []          [] |
+     gip                |                                   []             |
+     gjay               |                                                  |
+     gliv               |                                   []             |
+     glunarclock        |                []                 []             |
+     gnubiff            |                                                  |
+     gnucash            |                                               [] |
+     gnuedu             |                                                  |
+     gnulib             |                                                  |
+     gnunet             |                                                  |
+     gnunet-gtk         |                                                  |
+     gnutls             |                                                  |
+     gold               |                                                  |
+     gpe-aerial         |                                                  |
+     gpe-beam           |                                                  |
+     gpe-bluetooth      |                                                  |
+     gpe-calendar       |                                                  |
+     gpe-clock          |                []                                |
+     gpe-conf           |                                                  |
+     gpe-contacts       |                                                  |
+     gpe-edit           |                                                  |
+     gpe-filemanager    |                                                  |
+     gpe-go             |                                                  |
+     gpe-login          |                                                  |
+     gpe-ownerinfo      |                []                                |
+     gpe-package        |                                                  |
+     gpe-sketchbook     |                                                  |
+     gpe-su             |                []                                |
+     gpe-taskmanager    |                []                                |
+     gpe-timesheet      |                []                                |
+     gpe-today          |                []                                |
+     gpe-todo           |                                                  |
+     gphoto2            |                                                  |
+     gprof              |                                   []             |
+     gpsdrive           |                                                  |
+     gramadoir          |                                                  |
+     grep               |                                                  |
+     grub               |                []                             [] |
+     gsasl              |                                                  |
+     gss                |                                                  |
+     gst-plugins-bad    |                                   []             |
+     gst-plugins-base   |                                   []             |
+     gst-plugins-good   |                                   []             |
+     gst-plugins-ugly   |                                   []             |
+     gstreamer          | []                                []          [] |
+     gtick              |                                                  |
+     gtkam              |                       []                         |
+     gtkorphan          |                                   []             |
+     gtkspell           | []             []     []                         |
+     gutenprint         |                                                  |
+     hello              |                                   []             |
+     help2man           |                                                  |
+     hylafax            |                                                  |
+     idutils            |                                                  |
+     indent             |                                   []          [] |
+     iso_15924          |                                                  |
+     iso_3166           | []          []        []          []  []   [] [] |
+     iso_3166_2         |                                                  |
+     iso_4217           |                                                  |
+     iso_639            |             [] []     []              []         |
+     iso_639_3          |                                                  |
+     jwhois             |                                                  |
+     kbd                |                                                  |
+     keytouch           |                                               [] |
+     keytouch-editor    |                                                  |
+     keytouch-keyboa... |                                               [] |
+     klavaro            |          []                                      |
+     latrine            |                                                  |
+     ld                 |                                   []             |
+     leafpad            |                                   []          [] |
+     libc               |                                   []          [] |
+     libexif            |                       ()                         |
+     libextractor       |                                                  |
+     libgnutls          |                                                  |
+     libgpewidget       |                                                  |
+     libgpg-error       |                                                  |
+     libgphoto2         |                                                  |
+     libgphoto2_port    |                                                  |
+     libgsasl           |                                                  |
+     libiconv           |                                   []             |
+     libidn             |                                                  |
+     lifelines          |                                                  |
+     liferea            |                             []                [] |
+     lilypond           |                                                  |
+     linkdr             |          []                                      |
+     lordsawar          |                                                  |
+     lprng              |                                                  |
+     lynx               |                                               [] |
+     m4                 |                                                  |
+     mailfromd          |                                                  |
+     mailutils          |                                                  |
+     make               |                                                  |
+     man-db             |                                                  |
+     man-db-manpages    |                                                  |
+     minicom            |                                                  |
+     mkisofs            |                                                  |
+     myserver           |                                                  |
+     nano               |                                   []          [] |
+     opcodes            |                                                  |
+     parted             |                                                  |
+     pies               |                                                  |
+     popt               |                                                  |
+     psmisc             |                                                  |
+     pspp               |                                               [] |
+     pwdutils           |                                                  |
+     radius             |                                               [] |
+     recode             |                       []                      [] |
+     rosegarden         |                                                  |
+     rpm                |                                                  |
+     rush               |                                                  |
+     sarg               |                                                  |
+     screem             |                                                  |
+     scrollkeeper       |                    [] []                      [] |
+     sed                |                []                             [] |
+     sharutils          |                                   []          [] |
+     shishi             |                                                  |
+     skencil            |                                                  |
+     solfege            |                                                  |
+     solfege-manual     |                                                  |
+     soundtracker       |                                                  |
+     sp                 |                                                  |
+     sysstat            |                                                  |
+     tar                |                                   []             |
+     texinfo            |                                                  |
+     tin                |                                                  |
+     unicode-han-tra... |                                                  |
+     unicode-transla... |                                                  |
+     util-linux-ng      |                                               [] |
+     vice               |                                                  |
+     vmm                |                                                  |
+     vorbis-tools       |                                                  |
+     wastesedge         |                                                  |
+     wdiff              |                                                  |
+     wget               |                       []                      [] |
+     wyslij-po          |                                                  |
+     xchat              |                []     []          []          [] |
+     xdg-user-dirs      | []    []    [] []     []    []    []  []      [] |
+     xkeyboard-config   |                                   []          [] |
+                        +--------------------------------------------------+
+                          af am an ar as ast az be be@latin bg bn_IN bs ca
+                           6  0  1  2  3 19   1 10     3    28   3    1 38
+
+                          crh cs da  de  el en en_GB en_ZA eo es et eu fa
+                        +-------------------------------------------------+
+     a2ps               |     [] []  []  []     []            [] []       |
+     aegis              |        []  []                       []          |
+     ant-phone          |        []  ()                                   |
+     anubis             |        []  []                                   |
+     aspell             |     [] []  []         []            []          |
+     bash               |     []                           [] []          |
+     bfd                |                                     []          |
+     bibshelf           |        []  []                       []          |
+     binutils           |                                     []          |
+     bison              |            []  []                               |
+     bison-runtime      |        []  []  []                      []       |
+     bluez-pin          |     [] []  []  []                [] []          |
+     bombono-dvd        |        []                                       |
+     buzztard           |     [] []  []                                   |
+     cflow              |        []  []                                   |
+     clisp              |        []  []     []                []          |
+     coreutils          |     [] []  []                          []       |
+     cpio               |                                                 |
+     cppi               |                                                 |
+     cpplib             |        []  []                       []          |
+     cryptsetup         |            []                                   |
+     dfarc              |        []  []                       []          |
+     dialog             |        []  []                    [] []    []    |
+     dico               |                                                 |
+     diffutils          |     [] []  []  []                [] []          |
+     dink               |        []  []                       []          |
+     doodle             |            []                                   |
+     e2fsprogs          |     []     []                       []          |
+     enscript           |        []  []         []                        |
+     exif               |     () []  []                                   |
+     fetchmail          |     [] []  ()  []     []            []          |
+     findutils          |     [] []  []                                   |
+     flex               |            []                       []          |
+     freedink           |        []  []                       []          |
+     gas                |                                     []          |
+     gawk               |        []  []                       []          |
+     gcal               |                                     []          |
+     gcc                |            []                       []          |
+     gettext-examples   |            []  []                [] []          |
+     gettext-runtime    |        []  []                    [] []          |
+     gettext-tools      |            []                       []    []    |
+     gip                |        []  []                       []    []    |
+     gjay               |            []                                   |
+     gliv               |     [] []  []                                   |
+     glunarclock        |        []  []                                   |
+     gnubiff            |            ()                                   |
+     gnucash            |     []     ()  ()     ()            ()          |
+     gnuedu             |        []                           []          |
+     gnulib             |            []                       []          |
+     gnunet             |                                                 |
+     gnunet-gtk         |        []                                       |
+     gnutls             |     []     []                                   |
+     gold               |                                     []          |
+     gpe-aerial         |     [] []  []                       []          |
+     gpe-beam           |     [] []  []                       []          |
+     gpe-bluetooth      |        []  []                                   |
+     gpe-calendar       |        []                                       |
+     gpe-clock          |     [] []  []                       []          |
+     gpe-conf           |     [] []  []                                   |
+     gpe-contacts       |        []  []                       []          |
+     gpe-edit           |        []  []                                   |
+     gpe-filemanager    |        []  []                       []          |
+     gpe-go             |     [] []  []                       []          |
+     gpe-login          |        []  []                                   |
+     gpe-ownerinfo      |     [] []  []                       []          |
+     gpe-package        |        []  []                       []          |
+     gpe-sketchbook     |     [] []  []                       []          |
+     gpe-su             |     [] []  []                       []          |
+     gpe-taskmanager    |     [] []  []                       []          |
+     gpe-timesheet      |     [] []  []                       []          |
+     gpe-today          |     [] []  []                       []          |
+     gpe-todo           |        []  []                       []          |
+     gphoto2            |     [] []  ()         []            []    []    |
+     gprof              |        []  []                       []          |
+     gpsdrive           |        []                           [] []       |
+     gramadoir          |        []  []                    []             |
+     grep               |     []                                          |
+     grub               |        []  []                                   |
+     gsasl              |            []                                   |
+     gss                |                                                 |
+     gst-plugins-bad    |     [] []  []                       []    []    |
+     gst-plugins-base   |     [] []  []                       []    []    |
+     gst-plugins-good   |     [] []  []  []                   []    []    |
+     gst-plugins-ugly   |     [] []  []  []                   []    []    |
+     gstreamer          |     [] []  []                       []    []    |
+     gtick              |        []  ()                    []             |
+     gtkam              |     [] []  ()                    [] []          |
+     gtkorphan          |     [] []  []                    []             |
+     gtkspell           |     [] []  []  []                [] []    []    |
+     gutenprint         |        []  []         []                        |
+     hello              |        []  []                    [] []          |
+     help2man           |            []                                   |
+     hylafax            |            []                       []          |
+     idutils            |        []  []                                   |
+     indent             |     [] []  []                    [] [] [] []    |
+     iso_15924          |        []      ()                [] []          |
+     iso_3166           | []  [] []  []  ()                [] [] [] ()    |
+     iso_3166_2         |                ()                               |
+     iso_4217           |     [] []  []  ()                   [] []       |
+     iso_639            | []  [] []  []  ()                [] []          |
+     iso_639_3          | []                                              |
+     jwhois             |                                     []          |
+     kbd                |     [] []  []  []                   []          |
+     keytouch           |        []  []                                   |
+     keytouch-editor    |        []  []                                   |
+     keytouch-keyboa... |        []                                       |
+     klavaro            |     [] []  []                    []             |
+     latrine            |        []  ()                                   |
+     ld                 |        []                           []          |
+     leafpad            |     [] []  []  []                   []    []    |
+     libc               |     [] []  []                       []          |
+     libexif            |        []  []         ()                        |
+     libextractor       |                                                 |
+     libgnutls          |     []                                          |
+     libgpewidget       |        []  []                                   |
+     libgpg-error       |     []     []                                   |
+     libgphoto2         |        []  ()                                   |
+     libgphoto2_port    |        []  ()                             []    |
+     libgsasl           |                                                 |
+     libiconv           |     [] []  []                    []    []       |
+     libidn             |     []     []                    []             |
+     lifelines          |        []  ()                                   |
+     liferea            |     []     []  []                   []    []    |
+     lilypond           |     []     []                       []          |
+     linkdr             |        []  []                       []          |
+     lordsawar          |        []                                       |
+     lprng              |                                                 |
+     lynx               |     [] []  []                          []       |
+     m4                 |     [] []  []  []                               |
+     mailfromd          |                                                 |
+     mailutils          |                                     []          |
+     make               |        []  []                       []          |
+     man-db             |                                                 |
+     man-db-manpages    |                                                 |
+     minicom            |     [] []  []                       []          |
+     mkisofs            |                                                 |
+     myserver           |                                                 |
+     nano               |            []                       []    []    |
+     opcodes            |            []                       []          |
+     parted             |     []     []                                   |
+     pies               |                                                 |
+     popt               |     [] []  []                    [] []          |
+     psmisc             |     []     []                             []    |
+     pspp               |                                     []          |
+     pwdutils           |        []                                       |
+     radius             |                                     []          |
+     recode             |     [] []  []  []                [] []          |
+     rosegarden         |     ()     ()                       ()          |
+     rpm                |        []  []                       []          |
+     rush               |                                                 |
+     sarg               |                                                 |
+     screem             |                                                 |
+     scrollkeeper       |     [] []  []         []            []          |
+     sed                |     []     []  []                [] [] []       |
+     sharutils          |        []  []                       [] []       |
+     shishi             |                                                 |
+     skencil            |        []  ()                       []          |
+     solfege            |            []                    []    []       |
+     solfege-manual     |                                  []    []       |
+     soundtracker       |        []  []                       []          |
+     sp                 |            []                                   |
+     sysstat            |        []  []                             []    |
+     tar                |     []     []                          [] []    |
+     texinfo            |            []                    [] []          |
+     tin                |            []                          []       |
+     unicode-han-tra... |                                                 |
+     unicode-transla... |                                                 |
+     util-linux-ng      |     [] []  []                       []          |
+     vice               |        ()  ()                                   |
+     vmm                |            []                                   |
+     vorbis-tools       |     []                           []             |
+     wastesedge         |        []                                       |
+     wdiff              |            []                       []          |
+     wget               |     []     []                          []       |
+     wyslij-po          |                                                 |
+     xchat              |     []     []  []                   [] []       |
+     xdg-user-dirs      | []  [] []  []  []                [] [] [] []    |
+     xkeyboard-config   | []  [] []  []                    [] []          |
+                        +-------------------------------------------------+
+                          crh cs da  de  el en en_GB en_ZA eo es et eu fa
+                           5  64 105 117 18  1   8     0   28 89 18 19  0
+
+                          fi  fr  ga gl gu he hi hr hu hy id  is it ja ka kn
+                        +----------------------------------------------------+
+     a2ps               | []  []                          []        []       |
+     aegis              |     []                                 []          |
+     ant-phone          |     []                                 []          |
+     anubis             | []  []                          []     []          |
+     aspell             |     []  []                      []     []          |
+     bash               | []  []                          []        []       |
+     bfd                | []  []                          []                 |
+     bibshelf           | []  []  []                      []     []          |
+     binutils           | []  []                          []                 |
+     bison              | []  []  []                      []                 |
+     bison-runtime      | []  []  []                      []     [] []       |
+     bluez-pin          | []  []  []                [] [] []  []    []       |
+     bombono-dvd        | []                                                 |
+     buzztard           |                                 []                 |
+     cflow              | []      []                      []                 |
+     clisp              |     []                                             |
+     coreutils          |     []  []                []    []     []          |
+     cpio               | []  []  []                      []                 |
+     cppi               | []  []                                             |
+     cpplib             | []  []                          []                 |
+     cryptsetup         |     []                          []     []          |
+     dfarc              | []  []                                 []          |
+     dialog             |     []  [] []                   []  [] [] []       |
+     dico               |                                                    |
+     diffutils          | []  []  [] []    []       []    []     [] []       |
+     dink               |     []                                             |
+     doodle             |         []                             []          |
+     e2fsprogs          |     []                          []                 |
+     enscript           |     []  []             []       []                 |
+     exif               | []  []                          []  [] [] []       |
+     fetchmail          |     []                          []     [] []       |
+     findutils          | []  []  []                []    []     []          |
+     flex               | []  []  []                                         |
+     freedink           | []  []                          []                 |
+     gas                |     []                          []                 |
+     gawk               |     []  []       []             []     () []       |
+     gcal               |     []                                             |
+     gcc                |                                 []                 |
+     gettext-examples   | []  []  []                []    []     [] []       |
+     gettext-runtime    | []  []  []                      []     [] []       |
+     gettext-tools      |     []                          []     [] []       |
+     gip                | []  []  [] []                   []        []       |
+     gjay               | []                                                 |
+     gliv               | []  ()                                             |
+     glunarclock        | []      []                []    []                 |
+     gnubiff            |     ()                          []     ()          |
+     gnucash            | ()  ()           ()       ()           () []       |
+     gnuedu             |     []                                 []          |
+     gnulib             | []  []  []                []           [] []       |
+     gnunet             |                                                    |
+     gnunet-gtk         |     []                                             |
+     gnutls             |     []                                 []          |
+     gold               | []                              []                 |
+     gpe-aerial         | []  []                          []                 |
+     gpe-beam           | []  []                          []        []       |
+     gpe-bluetooth      | []                              []     [] []       |
+     gpe-calendar       | []                                        []       |
+     gpe-clock          | []  []                    []    []        []       |
+     gpe-conf           | []  []                          []        []       |
+     gpe-contacts       | []  []                          []        []       |
+     gpe-edit           | []                              []        []       |
+     gpe-filemanager    | []                        []    []        []       |
+     gpe-go             | []  []                    []    []        []       |
+     gpe-login          | []                              []        []       |
+     gpe-ownerinfo      | []  []                    []    []        []       |
+     gpe-package        | []                              []        []       |
+     gpe-sketchbook     | []  []                          []        []       |
+     gpe-su             | []  []     []             []    []        []       |
+     gpe-taskmanager    | []  []                    []    []        []       |
+     gpe-timesheet      | []  []  []                      []        []       |
+     gpe-today          | []  []  [] []             []    []        []       |
+     gpe-todo           | []                              []        []       |
+     gphoto2            | []  []                    []    []     [] []       |
+     gprof              | []  []  []                      []                 |
+     gpsdrive           |            []                   []     []          |
+     gramadoir          |     []  []                      []                 |
+     grep               | []                                     []          |
+     grub               | []                        []    []     []          |
+     gsasl              | []  []  []                      []     []          |
+     gss                | []  []  []                      []     []          |
+     gst-plugins-bad    | []  []                    []    []     [] []       |
+     gst-plugins-base   | []  []                    []    []     [] []       |
+     gst-plugins-good   | []  []                    []    []     [] []       |
+     gst-plugins-ugly   | []  []                    []    []     [] []       |
+     gstreamer          | []  []                    []    []     []          |
+     gtick              | []  []  []                      []     []          |
+     gtkam              |     []                    []    []     [] []       |
+     gtkorphan          |     []                          []     []          |
+     gtkspell           | []  []  [] []             [] [] []     [] []       |
+     gutenprint         | []  []                    []           []          |
+     hello              | []      []                      []                 |
+     help2man           | []  []                                             |
+     hylafax            |                                 []                 |
+     idutils            | []  []  []                []    []     []          |
+     indent             | []  []  [] []             []    []     [] []       |
+     iso_15924          | []  ()                          []     []          |
+     iso_3166           | []  ()  [] [] [] [] [] [] []    []     [] []       |
+     iso_3166_2         |     ()                    []    []     []          |
+     iso_4217           | []  ()                    []    []     [] []       |
+     iso_639            | []  ()  []    []          []    []     [] []    [] |
+     iso_639_3          |     ()                                 []       [] |
+     jwhois             | []  []                    []    []     []          |
+     kbd                |     []                          []                 |
+     keytouch           | []  []  []                []    []     []          |
+     keytouch-editor    | []      []                []    []     []          |
+     keytouch-keyboa... | []      []                []    []     []          |
+     klavaro            |            []             []                       |
+     latrine            | []                              []     []          |
+     ld                 | []  []  []                      []                 |
+     leafpad            | []  []  []       []       []    []     [] ()       |
+     libc               | []  []     []                   []        []       |
+     libexif            |                                        []          |
+     libextractor       |                                                    |
+     libgnutls          |     []                                 []          |
+     libgpewidget       | []      []                      []        []       |
+     libgpg-error       |     []                                 []          |
+     libgphoto2         |     []                                 [] []       |
+     libgphoto2_port    |     []                                 [] []       |
+     libgsasl           | []  []  []                      []     []          |
+     libiconv           | []  []  []                      []     [] []       |
+     libidn             | []  []                          []     []          |
+     lifelines          |     ()                                             |
+     liferea            |     []                    []           [] []       |
+     lilypond           | []  []                                             |
+     linkdr             | []               []    [] []           []          |
+     lordsawar          |                                                    |
+     lprng              |                                 []                 |
+     lynx               |     []                    []    []     [] []       |
+     m4                 | []  []  [] []                   []        []       |
+     mailfromd          |                                                    |
+     mailutils          |     []                          []                 |
+     make               | []  []  [] []    []    []       []     [] []       |
+     man-db             |                                 []     []          |
+     man-db-manpages    |                                 []                 |
+     minicom            | []  []                    []    []        []       |
+     mkisofs            | []  []                          []     []          |
+     myserver           |                                                    |
+     nano               | []  []  [] []             []           []          |
+     opcodes            | []  []  []                      []                 |
+     parted             |     []                          []     [] []       |
+     pies               |                                                    |
+     popt               | []  []  [] []             []    []  [] [] []       |
+     psmisc             | []  []                          []                 |
+     pspp               |                                                    |
+     pwdutils           |     []                          []                 |
+     radius             |     []                          []                 |
+     recode             | []  []  [] []    []       []    []     []          |
+     rosegarden         | ()  ()                          ()     () ()       |
+     rpm                |                                 []        []       |
+     rush               |                                                    |
+     sarg               |     []                                             |
+     screem             |                                        [] []       |
+     scrollkeeper       | []                        []    []     []          |
+     sed                | []  []  [] []             []    []     [] []       |
+     sharutils          | []  []  []                []    []     [] []       |
+     shishi             |     []                                             |
+     skencil            |     []                                             |
+     solfege            | []  []     []                          []          |
+     solfege-manual     |     []     []                                      |
+     soundtracker       |     []                                 []          |
+     sp                 |     []                                    ()       |
+     sysstat            | []  []                          []     [] []       |
+     tar                | []  []  []                []    []     [] []       |
+     texinfo            |     []                          []     [] []       |
+     tin                |     []                                             |
+     unicode-han-tra... |                                                    |
+     unicode-transla... |     []  []                                         |
+     util-linux-ng      | []  []                    []    []     [] []       |
+     vice               |     ()                    ()           ()          |
+     vmm                |     []                                             |
+     vorbis-tools       |                                 []                 |
+     wastesedge         |     ()                                 ()          |
+     wdiff              | []                                                 |
+     wget               | []  []  []             [] []    []     [] []       |
+     wyslij-po          | []  []                          []                 |
+     xchat              | []  []        []    []    []    []     [] []    [] |
+     xdg-user-dirs      | []  []  [] [] [] [] []    []    []  [] [] []    [] |
+     xkeyboard-config   | []  []                    []    []     []          |
+                        +----------------------------------------------------+
+                          fi  fr  ga gl gu he hi hr hu hy id  is it ja ka kn
+                          105 121 53 20  4  8  3  5 53  2 120  5 84 67  0  4
+
+                          ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+                        +-----------------------------------------------+
+     a2ps               |                               []              |
+     aegis              |                                               |
+     ant-phone          |                                               |
+     anubis             |                               []    []        |
+     aspell             |                         []                    |
+     bash               |                                               |
+     bfd                |                                               |
+     bibshelf           |                []             []              |
+     binutils           |                                               |
+     bison              |                               []              |
+     bison-runtime      |       []    [] []             []    []        |
+     bluez-pin          |    [] []    [] []             []              |
+     bombono-dvd        |                                               |
+     buzztard           |                                               |
+     cflow              |                                               |
+     clisp              |                                               |
+     coreutils          |          []                                   |
+     cpio               |                                               |
+     cppi               |                                               |
+     cpplib             |                                               |
+     cryptsetup         |                                               |
+     dfarc              |                   []                          |
+     dialog             |    []       [] []             []    []        |
+     dico               |                                               |
+     diffutils          |                []             []              |
+     dink               |                                               |
+     doodle             |                                               |
+     e2fsprogs          |                                               |
+     enscript           |                                               |
+     exif               |                []                             |
+     fetchmail          |                                               |
+     findutils          |                                               |
+     flex               |                                               |
+     freedink           |                                     []        |
+     gas                |                                               |
+     gawk               |                                               |
+     gcal               |                                               |
+     gcc                |                                               |
+     gettext-examples   |       []       []             [] []           |
+     gettext-runtime    | []                                            |
+     gettext-tools      | []                                            |
+     gip                |                []             []              |
+     gjay               |                                               |
+     gliv               |                                               |
+     glunarclock        |                []                             |
+     gnubiff            |                                               |
+     gnucash            | ()          ()                      ()     () |
+     gnuedu             |                                               |
+     gnulib             |                                               |
+     gnunet             |                                               |
+     gnunet-gtk         |                                               |
+     gnutls             |                               []              |
+     gold               |                                               |
+     gpe-aerial         |                []                             |
+     gpe-beam           |                []                             |
+     gpe-bluetooth      |                []                []           |
+     gpe-calendar       |                []                             |
+     gpe-clock          | []    []       []             [] []           |
+     gpe-conf           | []             []                             |
+     gpe-contacts       | []             []                             |
+     gpe-edit           |                []                             |
+     gpe-filemanager    | []             []                             |
+     gpe-go             | []             []                []           |
+     gpe-login          |                []                             |
+     gpe-ownerinfo      |                []             []              |
+     gpe-package        | []             []                             |
+     gpe-sketchbook     | []             []                             |
+     gpe-su             | []    []       []             [] [] []        |
+     gpe-taskmanager    | [] [] []       []             [] []           |
+     gpe-timesheet      |                []             []              |
+     gpe-today          |       []       []             [] []           |
+     gpe-todo           |                []                   []        |
+     gphoto2            |                                               |
+     gprof              |                               []              |
+     gpsdrive           |                                               |
+     gramadoir          |                                               |
+     grep               |                                               |
+     grub               |                                               |
+     gsasl              |                                               |
+     gss                |                                               |
+     gst-plugins-bad    |             [] []                [] []        |
+     gst-plugins-base   |             [] []                             |
+     gst-plugins-good   |                []                []           |
+     gst-plugins-ugly   |             [] []             [] [] []        |
+     gstreamer          |                                               |
+     gtick              |                                               |
+     gtkam              |                                     []        |
+     gtkorphan          |                []                      []     |
+     gtkspell           |       []    [] []       []    []    [] []     |
+     gutenprint         |                                               |
+     hello              | []             []             []              |
+     help2man           |                                               |
+     hylafax            |                                               |
+     idutils            |                                               |
+     indent             |                                               |
+     iso_15924          |             [] []                             |
+     iso_3166           | [] []       () [] [] []    []       []        |
+     iso_3166_2         |                                               |
+     iso_4217           |             []                      []        |
+     iso_639            |                      []    []                 |
+     iso_639_3          |                            []                 |
+     jwhois             |                []                             |
+     kbd                |                                               |
+     keytouch           |                []                             |
+     keytouch-editor    |                []                             |
+     keytouch-keyboa... |                []                             |
+     klavaro            |                                     []        |
+     latrine            |                []                             |
+     ld                 |                                               |
+     leafpad            | []          [] []                             |
+     libc               | []                                            |
+     libexif            |                                               |
+     libextractor       |                                               |
+     libgnutls          |                               []              |
+     libgpewidget       |                []             []              |
+     libgpg-error       |                                               |
+     libgphoto2         |                                               |
+     libgphoto2_port    |                                               |
+     libgsasl           |                                               |
+     libiconv           |                                               |
+     libidn             |                                               |
+     lifelines          |                                               |
+     liferea            |                                               |
+     lilypond           |                                               |
+     linkdr             |                                               |
+     lordsawar          |                                               |
+     lprng              |                                               |
+     lynx               |                                               |
+     m4                 |                                               |
+     mailfromd          |                                               |
+     mailutils          |                                               |
+     make               | []                                            |
+     man-db             |                                               |
+     man-db-manpages    |                                               |
+     minicom            |                                     []        |
+     mkisofs            |                                               |
+     myserver           |                                               |
+     nano               |                               []    []        |
+     opcodes            |                                               |
+     parted             |                                               |
+     pies               |                                               |
+     popt               | []             []                   []        |
+     psmisc             |                                               |
+     pspp               |                                               |
+     pwdutils           |                                               |
+     radius             |                                               |
+     recode             |                                               |
+     rosegarden         |                                               |
+     rpm                |                                               |
+     rush               |                                               |
+     sarg               |                                               |
+     screem             |                                               |
+     scrollkeeper       |                                     []     [] |
+     sed                |                                               |
+     sharutils          |                                               |
+     shishi             |                                               |
+     skencil            |                                               |
+     solfege            |                                     []        |
+     solfege-manual     |                                               |
+     soundtracker       |                                               |
+     sp                 |                                               |
+     sysstat            |                []                             |
+     tar                |       []                                      |
+     texinfo            |                                     []        |
+     tin                |                                               |
+     unicode-han-tra... |                                               |
+     unicode-transla... |                                               |
+     util-linux-ng      |                                               |
+     vice               |                                               |
+     vmm                |                                               |
+     vorbis-tools       |                                               |
+     wastesedge         |                                               |
+     wdiff              |                                               |
+     wget               |             []                                |
+     wyslij-po          |                                               |
+     xchat              | []             [] []                          |
+     xdg-user-dirs      | [] []       [] [] []       []       [] []     |
+     xkeyboard-config   | []    []    []                                |
+                        +-----------------------------------------------+
+                          ko ku ky lg lt lv mk ml mn mr ms mt nb nds ne
+                          20  5 10  1 13 48  4  2  2  4 24 10 20  3   1
+
+                          nl  nn or pa pl  ps pt pt_BR ro ru rw sk sl sq sr
+                        +---------------------------------------------------+
+     a2ps               | []           []     []  []   [] []       []    [] |
+     aegis              | []                      []      []                |
+     ant-phone          |                         []   []                   |
+     anubis             | []           []                 []                |
+     aspell             | []                           [] []    [] []       |
+     bash               | []                                    []          |
+     bfd                |                                 []                |
+     bibshelf           | []  []                                            |
+     binutils           |                                 []    []          |
+     bison              | []           []                 []                |
+     bison-runtime      | []           []     []  []   [] []       []       |
+     bluez-pin          | []           []         []   [] []    [] []    [] |
+     bombono-dvd        |     []                          ()                |
+     buzztard           | []  []                                            |
+     cflow              |              []                                   |
+     clisp              | []                              []                |
+     coreutils          | []           []     []  []      []       []       |
+     cpio               | []           []                 []                |
+     cppi               |              []                                   |
+     cpplib             | []                                                |
+     cryptsetup         | []                                                |
+     dfarc              |              []                                   |
+     dialog             | []           []         []      []                |
+     dico               |              []                                   |
+     diffutils          | []           []         []   [] []             [] |
+     dink               | ()                                                |
+     doodle             | []                                          []    |
+     e2fsprogs          | []           []                                   |
+     enscript           | []                      []   [] []       []       |
+     exif               | []           []              [] ()    []          |
+     fetchmail          | []           []                 []          []    |
+     findutils          | []           []     []          []       []       |
+     flex               | []           []         []   [] []                |
+     freedink           | []           []                                   |
+     gas                |                                                   |
+     gawk               | []           []         []   []                   |
+     gcal               |                                                   |
+     gcc                |                                                [] |
+     gettext-examples   | []           []     []       [] []    [] []    [] |
+     gettext-runtime    | []  []       []     []       [] []    [] []    [] |
+     gettext-tools      |              []              [] []    [] []    [] |
+     gip                | []           []                 []    []       [] |
+     gjay               |                                                   |
+     gliv               | []           []         []   [] []    []          |
+     glunarclock        | []                      []   []       []       [] |
+     gnubiff            | []                           ()                   |
+     gnucash            | []           ()         ()      ()                |
+     gnuedu             | []                                                |
+     gnulib             | []           []                 []       []       |
+     gnunet             |                                                   |
+     gnunet-gtk         |                                                   |
+     gnutls             | []           []                                   |
+     gold               |                                                   |
+     gpe-aerial         | []                  []  []   [] []       []    [] |
+     gpe-beam           | []                  []  []   [] []       []    [] |
+     gpe-bluetooth      | []                      []                        |
+     gpe-calendar       |                         []      []       []    [] |
+     gpe-clock          | []                  []  []   [] []    [] []    [] |
+     gpe-conf           | []                  []  []   [] []    [] []       |
+     gpe-contacts       |                         []   [] []       []    [] |
+     gpe-edit           | []           []                          []       |
+     gpe-filemanager    | []                              []       []       |
+     gpe-go             | []           []         []   [] []    [] []    [] |
+     gpe-login          | []                      []                        |
+     gpe-ownerinfo      | []                  []  []   [] []    [] []    [] |
+     gpe-package        | []                                       []       |
+     gpe-sketchbook     | []                  []  []   [] []       []    [] |
+     gpe-su             | []                  []  []   [] []    [] []    [] |
+     gpe-taskmanager    | []                  []  []   [] []    [] []    [] |
+     gpe-timesheet      | []                  []  []   [] []    [] []    [] |
+     gpe-today          | []                  []  []   [] []    [] []    [] |
+     gpe-todo           | []                      []      []       []    [] |
+     gphoto2            | []        [] []         []   [] []    []       [] |
+     gprof              | []                      []   []                   |
+     gpsdrive           | []                              []                |
+     gramadoir          | []                                    []          |
+     grep               | []           []                 []    []          |
+     grub               | []           []                 []                |
+     gsasl              | []           []                       []       [] |
+     gss                |              []              []       []          |
+     gst-plugins-bad    | []           []         []      []    []    []    |
+     gst-plugins-base   | []           []         []      []    []          |
+     gst-plugins-good   | []           []         []      []    []          |
+     gst-plugins-ugly   | []           []         []      []    [] []       |
+     gstreamer          | []           []         []      []    []          |
+     gtick              | []                              []    []          |
+     gtkam              | []        [] []         []      []    []          |
+     gtkorphan          | []                                                |
+     gtkspell           | []           []     []  []   [] []    [] [] [] [] |
+     gutenprint         | []                              []                |
+     hello              | []           []                       [] []       |
+     help2man           |              []                 []                |
+     hylafax            | []                                                |
+     idutils            | []           []         []   [] []                |
+     indent             | []           []         []   [] []    []       [] |
+     iso_15924          | []           []                 []       []       |
+     iso_3166           | []  [] [] [] []     ()  []   [] [] [] [] [] [] [] |
+     iso_3166_2         | []           []                          []       |
+     iso_4217           | []  []       []     []          [] []    []    [] |
+     iso_639            | []     [] [] []                 [] [] [] []    [] |
+     iso_639_3          |        [] []                                      |
+     jwhois             | []           []         []   []                   |
+     kbd                | []           []              []                   |
+     keytouch           | []           []                       []          |
+     keytouch-editor    | []           []                       []          |
+     keytouch-keyboa... | []           []                       []          |
+     klavaro            | []                      []                        |
+     latrine            |              []                 []                |
+     ld                 |                                                   |
+     leafpad            | []  []       []     []  []      []    [] []    [] |
+     libc               | []           []                 []    []          |
+     libexif            | []           []         ()            []          |
+     libextractor       |                                                   |
+     libgnutls          | []           []                                   |
+     libgpewidget       | []           []                          []       |
+     libgpg-error       |              []              []                   |
+     libgphoto2         | []           []                                   |
+     libgphoto2_port    | []           []         []      []    []          |
+     libgsasl           | []           []              []       []       [] |
+     libiconv           | []           []                       [] []    [] |
+     libidn             | []           []                                   |
+     lifelines          | []           []                                   |
+     liferea            | []           []     []  []   [] ()    ()    []    |
+     lilypond           | []                                                |
+     linkdr             | []                  []          []                |
+     lordsawar          |                                                   |
+     lprng              |              []                                   |
+     lynx               | []                      []      []                |
+     m4                 | []           []         []   [] []                |
+     mailfromd          |              []                                   |
+     mailutils          |              []                                   |
+     make               | []           []         []      []                |
+     man-db             | []           []                 []                |
+     man-db-manpages    | []           []                 []                |
+     minicom            |              []         []   [] []                |
+     mkisofs            | []           []                 []                |
+     myserver           |                                                   |
+     nano               | []           []         []      []                |
+     opcodes            | []                           []                   |
+     parted             | []           []                 []    []          |
+     pies               |              []                                   |
+     popt               | []           []     []          []                |
+     psmisc             | []           []                 []                |
+     pspp               | []                      []                        |
+     pwdutils           |              []                                   |
+     radius             | []           []                 []                |
+     recode             | []           []     []  []   [] []    [] []       |
+     rosegarden         |              ()                 ()                |
+     rpm                | []           []     []                            |
+     rush               | []           []                                   |
+     sarg               |                                                   |
+     screem             |                                                   |
+     scrollkeeper       | []  []       []              [] []    []    [] [] |
+     sed                | []           []     []  []   [] []    [] []    [] |
+     sharutils          | []           []                 []             [] |
+     shishi             |              []                                   |
+     skencil            |                     []  []                        |
+     solfege            | []           []         []      []                |
+     solfege-manual     | []           []         []                        |
+     soundtracker       |                                       []          |
+     sp                 |                                                   |
+     sysstat            | []           []         []      []                |
+     tar                | []           []                 []       []       |
+     texinfo            | []           []              [] []                |
+     tin                |                                 []                |
+     unicode-han-tra... |                                                   |
+     unicode-transla... |                                                   |
+     util-linux-ng      | []           []         []      []       []       |
+     vice               | []                                                |
+     vmm                | []                                                |
+     vorbis-tools       | []           []                                   |
+     wastesedge         | []                                                |
+     wdiff              | []           []                                   |
+     wget               | []           []     []  []      []    [] []       |
+     wyslij-po          | []  []       []                                   |
+     xchat              | []        [] []     []          []    [] [] [] [] |
+     xdg-user-dirs      | []  [] [] [] []  [] []  []   [] []    [] [] [] [] |
+     xkeyboard-config   | []           []                 []                |
+                        +---------------------------------------------------+
+                          nl  nn or pa pl  ps pt pt_BR ro ru rw sk sl sq sr
+                          135 10  4  7 105  1 29  62   47 91  3 54 46  9 37
+
+                          sv  sw ta te tg th tr uk vi  wa zh_CN zh_HK zh_TW
+                        +---------------------------------------------------+
+     a2ps               | []              [] [] [] []                       | 27
+     aegis              |                          []                       |  9
+     ant-phone          | []                 []    []      []               |  9
+     anubis             | []                 [] [] []                       | 15
+     aspell             |                       [] []  []                   | 20
+     bash               | []                    [] []                       | 12
+     bfd                |                          []                       |  6
+     bibshelf           | []                       []      []               | 16
+     binutils           |                       [] []                       |  8
+     bison              | []                       []                       | 12
+     bison-runtime      | []              []    [] []      []          []   | 29
+     bluez-pin          | []              [] [] [] []  []  []          []   | 37
+     bombono-dvd        |                          []                       |  4
+     buzztard           |                          []                       |  7
+     cflow              |                       [] []      []               |  9
+     clisp              |                                                   | 10
+     coreutils          | []                    [] []      []               | 22
+     cpio               | []                 [] [] []      []          []   | 13
+     cppi               |                       [] []                       |  5
+     cpplib             | []                 [] [] []      []          []   | 14
+     cryptsetup         | []                       []                       |  7
+     dfarc              |                          []                       |  9
+     dialog             | []  []          []       []  []  []          []   | 30
+     dico               |                       []                          |  2
+     diffutils          | []                 [] [] []      []          []   | 30
+     dink               |                                                   |  4
+     doodle             | []                       []                       |  7
+     e2fsprogs          | []                 []    []                       | 11
+     enscript           | []                 [] [] []                       | 17
+     exif               | []                       []      []               | 16
+     fetchmail          |                    []    []      []               | 17
+     findutils          | []                 [] [] []      []               | 20
+     flex               | []                 []    []                  []   | 15
+     freedink           |                          []                       | 10
+     gas                |                    []                             |  4
+     gawk               | []                 []    []      []               | 18
+     gcal               | []                 []                             |  5
+     gcc                | []                 []            []               |  7
+     gettext-examples   | []                 [] [] []      []    []    []   | 34
+     gettext-runtime    | []                 [] [] []      []    []    []   | 29
+     gettext-tools      | []                 [] [] []      []          []   | 22
+     gip                | []                       []      []          []   | 22
+     gjay               |                          []                       |  3
+     gliv               | []                 []    []                       | 14
+     glunarclock        | []                       []  []  []          []   | 19
+     gnubiff            | []                       []                       |  4
+     gnucash            |                    () [] ()      []          ()   | 10
+     gnuedu             |                          []                  []   |  7
+     gnulib             | []                    [] []      []               | 16
+     gnunet             |                          []                       |  1
+     gnunet-gtk         | []                 []    []                       |  5
+     gnutls             | []                       []      []               | 10
+     gold               |                          []                       |  4
+     gpe-aerial         | []                       []      []               | 18
+     gpe-beam           | []                       []      []               | 19
+     gpe-bluetooth      | []                       []      []               | 13
+     gpe-calendar       | []                       []  []  []               | 12
+     gpe-clock          | []                 []    []  []  []               | 28
+     gpe-conf           | []                       []  []  []               | 20
+     gpe-contacts       | []                       []      []               | 17
+     gpe-edit           | []                       []      []               | 12
+     gpe-filemanager    | []                       []  []  []               | 16
+     gpe-go             | []                 []    []  []  []               | 25
+     gpe-login          | []                       []      []               | 11
+     gpe-ownerinfo      | []                 []    []      []          []   | 25
+     gpe-package        | []                       []      []               | 13
+     gpe-sketchbook     | []                       []      []               | 20
+     gpe-su             | []                 []    []  []  []               | 30
+     gpe-taskmanager    | []                 []    []  []  []               | 29
+     gpe-timesheet      | []                 []    []      []          []   | 25
+     gpe-today          | []                 []    []  []  []          []   | 30
+     gpe-todo           | []                       []  []  []               | 17
+     gphoto2            | []                    [] []      []          []   | 24
+     gprof              | []                 []    []                       | 15
+     gpsdrive           | []                       []      []               | 11
+     gramadoir          | []                       []      []               | 11
+     grep               |                 []       []      []               | 10
+     grub               | []                       []      []               | 14
+     gsasl              | []                       []      []          []   | 14
+     gss                | []                       []      []               | 11
+     gst-plugins-bad    | []                 []    []      []               | 26
+     gst-plugins-base   | []                 [] [] []      []               | 24
+     gst-plugins-good   | []                 []    []      []               | 24
+     gst-plugins-ugly   | []                 [] [] []      []               | 29
+     gstreamer          | []                    [] []      []               | 22
+     gtick              |                       [] []      []               | 13
+     gtkam              | []                       []      []               | 20
+     gtkorphan          | []                       []      []               | 14
+     gtkspell           | []              [] [] [] []  []  []    []    []   | 45
+     gutenprint         | []                                                | 10
+     hello              | []              [] []    []      []          []   | 21
+     help2man           | []                       []                       |  7
+     hylafax            |                          []                       |  5
+     idutils            | []                 []    []      []               | 17
+     indent             | []                 [] [] []      []          []   | 30
+     iso_15924          |                 ()    [] ()      []          []   | 16
+     iso_3166           | []        []    () [] [] ()  []  []    []    ()   | 53
+     iso_3166_2         |                 ()    [] ()      []               |  9
+     iso_4217           | []              () [] [] ()      []    []         | 26
+     iso_639            | []     [] []    ()    [] ()  []  []    []    []   | 38
+     iso_639_3          |        []                ()                       |  8
+     jwhois             | []                 []    []      []          []   | 16
+     kbd                | []                 [] [] []      []               | 15
+     keytouch           | []                       []      []               | 16
+     keytouch-editor    | []                       []      []               | 14
+     keytouch-keyboa... | []                       []      []               | 14
+     klavaro            |                          []                       | 11
+     latrine            |                    []    []      []               | 10
+     ld                 | []                 []    []                  []   | 11
+     leafpad            | []                 [] [] []      []          []   | 33
+     libc               | []                 []    []      []          []   | 21
+     libexif            |                          []      ()               |  7
+     libextractor       |                          []                       |  1
+     libgnutls          | []                       []      []               |  9
+     libgpewidget       | []                       []      []               | 14
+     libgpg-error       | []                       []      []               |  9
+     libgphoto2         |                       [] []                       |  8
+     libgphoto2_port    | []                    [] []                  []   | 14
+     libgsasl           | []                       []      []               | 13
+     libiconv           | []                       []  []  []               | 21
+     libidn             | ()                       []      []               | 11
+     lifelines          | []                                                |  4
+     liferea            | []                 []            []               | 21
+     lilypond           |                          []                       |  7
+     linkdr             | []                 []    []      []          []   | 17
+     lordsawar          |                                                   |  1
+     lprng              |                          []                       |  3
+     lynx               | []                 [] [] []                       | 17
+     m4                 | []                       []      []          []   | 19
+     mailfromd          |                       [] []                       |  3
+     mailutils          |                          []                       |  5
+     make               | []                 []    []      []               | 21
+     man-db             | []                       []      []               |  8
+     man-db-manpages    |                                                   |  4
+     minicom            | []                       []                       | 16
+     mkisofs            |                          []      []               |  9
+     myserver           |                                                   |  0
+     nano               | []                       []      []          []   | 21
+     opcodes            | []                 []    []                       | 11
+     parted             | []                 [] [] []                  []   | 15
+     pies               |                       [] []                       |  3
+     popt               | []              [] []    []      []          []   | 27
+     psmisc             | []                       []                       | 11
+     pspp               |                                                   |  4
+     pwdutils           | []                       []                       |  6
+     radius             |                       [] []                       |  9
+     recode             | []                 []    []      []               | 28
+     rosegarden         | ()                                                |  0
+     rpm                | []                       []                  []   | 11
+     rush               |                       [] []                       |  4
+     sarg               |                                                   |  1
+     screem             |                          []                       |  3
+     scrollkeeper       | []                 [] [] []                  []   | 27
+     sed                | []                 []    []      []          []   | 30
+     sharutils          | []                 []    []      []          []   | 22
+     shishi             |                          []                       |  3
+     skencil            | []                       []                       |  7
+     solfege            | []                 []    []      []               | 16
+     solfege-manual     |                    []                             |  8
+     soundtracker       | []                 []    []                       |  9
+     sp                 |                    []                             |  3
+     sysstat            |                          []      []               | 15
+     tar                | []                 [] [] []      []          []   | 23
+     texinfo            | []                 [] [] []      []               | 17
+     tin                |                                                   |  4
+     unicode-han-tra... |                                                   |  0
+     unicode-transla... |                                                   |  2
+     util-linux-ng      | []                 [] [] []                       | 20
+     vice               | ()                 ()                             |  1
+     vmm                |                          []                       |  4
+     vorbis-tools       |                          []                       |  6
+     wastesedge         |                                                   |  2
+     wdiff              | []                       []                       |  7
+     wget               | []                 []    []      []          []   | 26
+     wyslij-po          |                       [] []                       |  8
+     xchat              | []              []    [] []      []          []   | 36
+     xdg-user-dirs      | []     [] []    [] [] [] []      []    []    []   | 63
+     xkeyboard-config   | []                    [] []                       | 22
+                        +---------------------------------------------------+
+       85 teams           sv  sw ta te tg th tr uk vi  wa zh_CN zh_HK zh_TW
+      178 domains         119  1  3  3  0 10 65 51 155 17  98     7    41    2618
+
+   Some counters in the preceding matrix are higher than the number of
+visible blocks let us expect.  This is because a few extra PO files are
+used for implementing regional variants of languages, or language
+dialects.
+
+   For a PO file in the matrix above to be effective, the package to
+which it applies should also have been internationalized and
+distributed as such by its maintainer.  There might be an observable
+lag between the mere existence a PO file and its wide availability in a
+distribution.
+
+   If June 2010 seems to be old, you may fetch a more recent copy of
+this `ABOUT-NLS' file on most GNU archive sites.  The most up-to-date
+matrix with full percentage details can be found at
+`http://translationproject.org/extra/matrix.html'.
+
+1.5 Using `gettext' in new packages
+===================================
+
+If you are writing a freely available program and want to
+internationalize it you are welcome to use GNU `gettext' in your
+package.  Of course you have to respect the GNU Library General Public
+License which covers the use of the GNU `gettext' library.  This means
+in particular that even non-free programs can use `libintl' as a shared
+library, whereas only free software can use `libintl' as a static
+library or use modified versions of `libintl'.
+
+   Once the sources are changed appropriately and the setup can handle
+the use of `gettext' the only thing missing are the translations.  The
+Free Translation Project is also available for packages which are not
+developed inside the GNU project.  Therefore the information given above
+applies also for every other Free Software Project.  Contact
+`coordinator@translationproject.org' to make the `.pot' files available
+to the translation teams.
+
diff --git a/AUTHORS b/AUTHORS
index 44b959b..bea08f7 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,11 +6,11 @@ see the files ChangeLog and THANKS.  This list results from searching
 for /\bM4\b/ in the file /gd/gnuorg/copyright.list on the
 fencepost.gnu.org machine.
 
-Rene' Seindal               seindal@diku.dk               1990-03-28
+René Seindal                seindal@diku.dk               1990-03-28
 James L. Avera              jima@netcom.com               1993-10-04
 Pete Chown                  pete.chown@dale.dircon.co.uk  1994-06-28
 John Gerard Makecki         johnm@vlibs.com               1995-04-24
-Francois Pinard             pinard@iro.umontreal.ca       1996-02-01
+François Pinard             pinard@iro.umontreal.ca       1996-02-01
 Thomas Tanner               tanner@ffii.org               1999-06-23
 Gary V. Vaughan             gary@gnu.org                  2000-10-02
 Yuji Minejima               ?                             2001-05-09
@@ -32,8 +32,8 @@ Tim Rice                    tim@multitalents.net          2011-01-24
 
 ========================================================================
 
-Copyright (C) 2000, 2006-2007, 2009-2014, 2016 Free Software Foundation,
-Inc.
+Copyright (C) 2000, 2006-2007, 2009-2014, 2016-2017, 2020-2021 Free
+Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
diff --git a/BACKLOG b/BACKLOG
index eeb59e2..27f3e9e 100644 (file)
--- a/BACKLOG
+++ b/BACKLOG
@@ -50,7 +50,8 @@ rmail/speed
  2. 05 Sep 94 <djm@va.pubnix.com> slowness
  3. 04 Oct 94 <pinard> Autoconf, m4, and dnl's.
 
-Copyright (C) 2000, 2006, 2009-2014, 2016 Free Software Foundation, Inc.
+Copyright (C) 2000, 2006, 2009-2014, 2016-2017, 2020-2021 Free Software
+Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
diff --git a/COPYING b/COPYING
index 94a9ed0..f288702 100644 (file)
--- a/COPYING
+++ b/COPYING
@@ -1,7 +1,7 @@
                     GNU GENERAL PUBLIC LICENSE
                        Version 3, 29 June 2007
 
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
  Everyone is permitted to copy and distribute verbatim copies
  of this license document, but changing it is not allowed.
 
@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 Also add information on how to contact you by electronic and paper mail.
 
@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
   You should also get your employer (if you work as a programmer) or school,
 if any, to sign a "copyright disclaimer" for the program, if necessary.
 For more information on this, and how to apply and follow the GNU GPL, see
-<http://www.gnu.org/licenses/>.
+<https://www.gnu.org/licenses/>.
 
   The GNU General Public License does not permit incorporating your program
 into proprietary programs.  If your program is a subroutine library, you
 may consider it more useful to permit linking proprietary applications with
 the library.  If this is what you want to do, use the GNU Lesser General
 Public License instead of this License.  But first, please read
-<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+<https://www.gnu.org/licenses/why-not-lgpl.html>.
index 20e0271..e698bce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,467 @@
+2021-05-28  Eric Blake  <eblake@redhat.com>
+
+       version 1.4.19
+       * NEWS: Record release date.
+
+2021-05-28  Eric Blake  <eblake@redhat.com>
+
+       tests: Skip signal detection on Haiku
+       On Haiku, using 'kill -9' fromm /bin/shactually causes a process to
+       die with the non-standard SIGKILLTHR 15, which causes 198.sysval to
+       fail from the unexpected value.
+
+       * doc/m4.texi (Sysval): Skip test on Haiku.
+       Reported by Bruno Haible,
+       https://lists.gnu.org/archive/html/bug-m4/2021-05/msg00004.html
+
+2021-05-26  Bruno Haible  <bruno@clisp.org>
+
+       Enable more single-thread optimizations in gnulib code
+       On many systems (esp. BSD ones), building a recent m4 snapshot produces these
+       warnings:
+
+       --------------------------------------------------------------------------------
+         CC       regex.o
+       In file included from ../../lib/regex_internal.h:57:0,
+                        from ../../lib/regex.c:70:
+       ../../lib/regcomp.c: In function 'rpl_regfree':
+       ../../lib/glthread/lock.h:640:38: warning: statement with no effect [-Wunused-value]
+        # define glthread_lock_destroy(NAME) 0
+                                             ^
+       ../../lib/regex_internal.h:60:26: note: in expansion of macro 'glthread_lock_destroy'
+        # define lock_fini(lock) glthread_lock_destroy (&(lock))
+                                 ^
+       ...
+       --------------------------------------------------------------------------------
+       According to the Gnulib documentation section "Optimizations of multithreaded
+       code" several more optimizations can be enabled. This patch
+         - enables these single-threading optimizations,
+         - by doing so, gets rid of the warnings in regex.c,
+         - causes no test failures.
+
+       * configure.ac (GNULIB_REGEX_SINGLE_THREAD, GNULIB_MBRTOWC_SINGLE_THREAD,
+       GNULIB_WCHAR_SINGLE_LOCALE): Define as C macros.
+       Message-Id: <3311608.oHEOCP8NKg@omega>
+
+2021-05-26  Eric Blake  <eblake@redhat.com>
+
+       maint: Update to newer gnulib
+       Gnulib has improved stack overflow detection (the c-stack module now
+       uses gnulib's stripped-down libsigsegv on more platforms, without
+       having to install GNU libsigsegv); with this update, GNU Linux systems
+       get stack overflow protection without an external library dependency.
+       * gnulib: Update to latest.
+       * NEWS: Mention the impact.
+
+2021-05-12  Eric Blake  <eblake@redhat.com>
+
+       maint: translation string tweak
+       * src/m4.c (usage): Tweak translation of a newline.
+       Reported by Benno Schulenberg,
+       https://lists.gnu.org/archive/html/m4-discuss/2021-05/msg00011.html
+
+2021-05-11  Eric Blake  <eblake@redhat.com>
+
+       maint: post-release administrivia
+       * NEWS: Add header line for next release.
+       * .prev-version: Record previous version.
+       * cfg.mk (old_NEWS_hash): Auto-update.
+
+       version 1.4.18d
+       * NEWS: Recored release date.
+
+2021-05-10  Eric Blake  <eblake@redhat.com>
+
+       po: fix syntax-check
+       * po/POTFILES.in: Update list to match previous patch.
+
+       m4: translate more strings
+       * src/m4.c (usage): Split large paragraphs, and mark for translation.
+       (main): Translate more strings.
+       * src/builtin.c: Likewise.
+       * src/eval.c (evaluate): Likewise.
+       * src/format.c (expand_format): Likewise.
+       * src/freeze.c: Likewise.
+       * src/input.c: Likewise.
+       * src/macro.c: Likewise.
+       * src/output.c: Likewise.
+       Reported by Benno Schulenberg:
+       https://lists.gnu.org/archive/html/m4-discuss/2021-05/msg00005.html
+
+2021-05-10  Eric Blake  <eblake@redhat.com>
+
+       maint: update gnulib
+       Fix several issues reported by Bruno Haible while testing 1.4.18b:
+       https://lists.gnu.org/archive/html/bug-m4/2021-05/msg00002.html
+       https://lists.gnu.org/archive/html/bug-m4/2021-05/msg00003.html
+
+       * gnulib: Bump to latest, for various fixes.
+       * NEWS: Mention this.
+
+2021-05-10  Eric Blake  <eblake@redhat.com>
+
+       maint: update m4-latest* symlinks during upload
+       Avoid the situation we had for several years where m4-latest.tar.xz
+       pointed to m4-1.4.17.tar.xz in spite of m4-1.4.18.tar.xz existing.
+       https://lists.gnu.org/archive/html/m4-discuss/2021-05/msg00003.html
+
+       * cfg.mk (GNUPLOADFLAGS): Update *-latest symlinks during gnupload.
+
+2021-05-10  Eric Blake  <eblake@redhat.com>
+
+       maint: mention ci project
+       Bruno Haible has added a continuous integration environment:
+       https://lists.gnu.org/archive/html/bug-m4/2020-03/msg00000.html
+
+       * HACKING (Continuous Integration): New section.
+
+2021-05-10  Bruno Haible  <bruno@clisp.org>
+
+       eval: avoid undefined behaviour when parsing -2147483648
+       * src/eval.c (eval_lex): Use an unsigned variable for accumulating the
+       value.
+       https://lists.gnu.org/archive/html/bug-m4/2021-05/msg00001.html
+
+2021-05-07  Eric Blake  <eblake@redhat.com>
+
+       maint: post-release administrivia
+       * NEWS: Add header line for next release.
+       * .prev-version: Record previous version.
+       * cfg.mk (old_NEWS_hash): Auto-update.
+
+       version 1.4.18b
+       * NEWS: Record release date.
+
+       maint: prepare for beta release
+       * all: Prefer https over http in URLs.
+       * doc/m4.texi (History): Update URLs to follow redirects.
+       * NEWS: Prepare for release.
+       * cfg.mk (old_NEWS_hash): Regenerate via 'make update-NEWS-hash'
+       * HACKING: Update URL to gnulib, drop reference to CVS.
+
+       maint: update gnulib to latest
+       * gnulib: Pick up latest in preparation for release.
+
+2021-05-07  Eric Blake  <eblake@redhat.com>
+
+       maint: update bootstrap, (re-)enable po file generation
+       In commit 4694c4e67, I disabled bootstrap pulling in po files, because
+       I got an error while attempting to get them, and remembered that while
+       the experimental 2.0 has a .pot file, branch-1.4 (and the 1.4.18
+       release) historically did not.  Basically, since the translation
+       project does not have any m4.pot corresponding to a released m4 that
+       needs it, they deleted tp/latest/m4, and with nothing to pull from,
+       rsync fails.  I did not, however, realize that commit 610290de had
+       intentionally added translation support, such that m4 1.4.19 WILL have
+       translations; so until I get that directory reinstated by releasing
+       1.4.18b, I'll just use './bootstrap --skip-po'.
+
+       Meanwhile, Gary's upstream bootstrap has had some commits
+       (https://github.com/gnulib-modules/bootstrap.git)
+       Regenerate them via:
+       for f in gl/build-aux/*; do cp ~/bootstrap/build-aux/$(basename $f) $f; done
+       gl/build-aux/inline-source gl/build-aux/bootstrap.in > bootstrap
+
+       * gl/build-aux/*: Sync from upstream.
+       * bootstrap: Regenerate.
+       * bootstrap.conf (m4_bootstrap_options_prep): Re-enable po.
+       * NEWS: Document this as intentional.
+       Fixes: 4694c4e67
+
+2021-05-07  Eric Blake  <eblake@redhat.com>
+
+       maint: fix syntax-check issues
+       * src/Makefile.am (m4_LDADD): Rename...
+       (LDADD): ...to this, and use spelling that satisfies syntax-check.
+       * po/POTFILES.in: Update to satisfy syntax-check.
+       * cfg.mk (old_NEWS_hash): Update with 'make update-NEWS-hash'.
+
+       maint: bump copyright year
+       * all: Use 'make update-copyright' to add 2021.
+
+       README: add GNU Project notice
+       * README: Add section to attract more people towards the GNU project.
+       Inspired by a suggestion from Jose E. Marchesi <jemarch@gnu.org> on
+       the gnu-prog-discuss mailing list.
+
+2021-04-22  Eric Blake  <eblake@redhat.com>
+
+       m4: change command-line -H default
+       * src/m4.h (HASHMAX): Bump to ~64k.
+       * doc/m4.texi (Limits control): Document it.
+       * NEWS: Likewise.
+
+       maint: another gnulib update
+       * gnulib: Update to latest, to fix build on rawhide.
+
+2021-04-21  Eric Blake  <eblake@redhat.com>
+
+       symtab: use less memory in pushdef stacks
+       No need to xstrdup identical names when we can share the same name
+       across the pushdef stack.
+
+       * src/symtab.c (free_symbol): Don't free shared name.
+       (lookup_symbol): Share name across pushdef stack.
+
+2021-04-21  Eric Blake  <eblake@redhat.com>
+
+       symtab: make symtab private
+       No need for a leaky abstraction of freezing to have to duplicate how
+       our symbol hash table is organized; use the public function
+       hack_all_symbols instead.  This will make it easier to refactor the
+       symbol table (such as automatic resizing, or switching to a trie).
+
+       * src/m4.h (symtab, SYMBOL_NEXT): Make private.
+       * src/freeze.c (produce_frozen_state): Split out...
+       (freeze_symbol): ...new helper, for use by hack_all_symbols.
+       * src/symtab.c (lookup_symbol, symtab_print_list): Update to treat
+       next as internal-only code.
+
+2021-04-21  Eric Blake  <eblake@redhat.com>
+
+       symtab: sort by hash before name
+       It is faster to do an integer compare than a string compare when
+       managing hash table collisions (reserving a string compare for ties).
+       Testing with CFLAGS=-DDEBUG_SYM=1 and 'time M4=src/m4 autoconf -f',
+       the results are noticeable; on my machine, execution speeds up from
+       2.3s to 2.2s, and the debug trace that used to report:
+
+       m4: lookup mode 0 called 1243301 times, 7859589 compares, 6734330 misses, 23941043 bytes
+
+       now reports
+
+       m4: lookup mode 0 called 1243301 times, 1125259 compares, 0 misses, 12433237 bytes
+
+       * src/m4.h (struct symbol): Add hash member.
+       * src/symtab.c (lookup_symbol): Sort by hash first, then name.
+       (symtab_print_list): Add hash debug.
+
+2021-04-21  Eric Blake  <eblake@redhat.com>
+
+       maint: switch from git:// to https:// for gnulib submodule
+       https:// is nicer than git:// for a transport for avoiding
+       man-in-the-middle attacks, provided that the server is using a
+       new-enough version of git to make https:// efficient (which
+       savannah does).
+       * .gitmodules: Prefer better URL.
+
+2021-04-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       maint: port to Solaris 10
+       Add libraries needed by current Gnulib.
+       * src/Makefile.am (m4_LDADD): Add LIB_CLOCK_GETTIME,
+       LIB_GETRANDOM, LIB_HARD_LOCALE, LIB_POSIX_SPAWN,
+       LIB_SETLOCALE_NULL, LIBUNISTRING, INTL_MACOSX_LIBS.
+       These are all needed by current Gnulib, according to gnulib-tool.
+       LIB_CLOCK_GETTIME is certainly needed for Solaris 10; otherwise
+       the m4 link fails with clock_gettime not found.
+
+       maint: port to macOS 11.2.3 (arm64)
+       * m4/gnulib-cache.m4: Add fopen-gnu, replacing cloexec and fopen.
+       Avoid getopt-posix-tests, since they are not needed for m4
+       and currently fail on macOS 11.2.3 (arm64).
+       * src/builtin.c (m4_incr, m4_decr): Avoid undefined behavior
+       on integer overflow that causes tests to fail on macOS.
+       * src/debug.c (debug_set_output):
+       * src/output.c (m4_tmpfile, m4_tmpopen):
+       * src/path.c (m4_fopen):
+       Use GNU fopen with "e" rather than set_cloexec_flag.  This is
+       simpler, and works around a Gnulib bug on macOS with fopen
+       being replaced by rpl_fopen sometimes but not other times.
+       * src/freeze.c (produce_frozen_state): Use GNU fopen with "e";
+       no need to expose the fd to subprocesses.
+
+       build: update gnulib submodule to latest
+
+2021-04-17  Eric Blake  <eblake@redhat.com>
+
+       symtab: drop redundant symbol flag
+       In writing the previous patch, I noticed that the shadow flag is only
+       ever set when a pushdef stack is present, which makes it redundant now
+       that the pushdef stack is separate from the hash collision stack.
+
+       * src/m4.h (SYMBOL_SHADOWED): Delete.
+       * src/builtin.c (dump_symbol): Simplify, now that hack_all_symbols
+       no longer visits shadowed macros.
+       * src/symtab.c (lookup_symbol, symtab_print_list): Simplify.
+
+2021-04-17  Eric Blake  <eblake@redhat.com>
+
+       symtab: better handling of macro stacks
+       I ran into a scenario where running a program took 22s with the
+       default -H509, but less than a second with -H517 [1].  The culprit?  A
+       collision between 'stack' and 'substr' in the default hash table size
+       caused lookups for substr to get progressively slower as pushdef stack
+       got deeper.  This is easy enough to fix, and may also make it easier
+       to dynamically grow the hashtable.
+
+       [1] https://lists.gnu.org/archive/html/bug-m4/2021-04/msg00000.html
+
+       * src/m4.h (struct symbol): Add stack member.
+       * src/symtab.c (lookup_symbol): Separate stack from bucket list.
+       (symtab_print_list): Update traversal to match.
+       * src/freeze.c (produce_frozen_state): Likewise.
+       (reverse_symbol_list): Reverse stack, not bucket.
+
+2021-04-17  Eric Blake  <eblake@redhat.com>
+
+       input: optimize macro tail-call memory usage
+       I encountered an m4 program that performed over 20 million iterations
+       of a tail-call recursion paradigm.  Without this patch, memory usage
+       grew to over 6 gigabytes, pausing the program for several seconds when
+       the recursion finally ended just to reclaim the memory.  But with the
+       patch, m4 never needed more than 3 megabytes of resident memory.
+
+       * src/input.c (push_string_init): Prune empty string blocks before
+       starting another one.
+
+2021-04-17  Eric Blake  <eblake@redhat.com>
+
+       maint: update gnulib and fix build failures
+       I got failures when trying to bootstrap:
+
+       bootstrap: getting translations into po/.reference for m4...
+       receiving incremental file list
+       rsync: change_dir "/latest/m4" (in tp) failed: No such file or directory (2)
+
+       since m4-1.4 has no translation files, and the translation project
+       dropped the stale .po files for the unreleased 1.9 development branch.
+
+       Once that was fixed, I also got compilation failures, from an
+       incomplete update to the gnulib execute module:
+
+       builtin.c: In function 'm4_syscmd':
+       builtin.c:968:44: error: passing argument 3 of 'execute' from incompatible pointer type [-Werror=incompatible-pointer-types]
+         968 |   status = execute (ARG (0), SYSCMD_SHELL, prog_args, NULL, false,
+             |                                            ^~~~~~~~~
+             |                                            |
+             |                                            const char **
+
+       Fixes: 4e5c2c0157
+
+       * gnulib: Update to latest.
+       * bootstrap.conf (copyright_holder): Silence bootstrap warning.
+       (m4_bootstrap_options_prep): Turn off po update.
+
+2020-12-12  Bruno Haible  <bruno@clisp.org>
+
+       Update after gnulib changed.
+       * src/builtin.c (m4_syscmd): Update 'execute' invocation.
+       (m4_esyscmd): Update 'create_pipe_in' invocation.
+       * po/POTFILES.in: Remove lib/w32spawn.h. Add lib/openat-die.c, lib/os2-spawn.c.
+
+2020-08-23  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * HACKING: Autoconf 2.64 required now.
+
+2020-08-23  Bruno Haible  <bruno@clisp.org>
+
+       build: Fix bootstrap failure with the newest gnulib.
+       * configure.ac: Require Autoconf 2.64 at least.
+
+2020-07-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port recent changes to AIX 7.1
+       * src/Makefile.am (m4_LDADD): Add LIB_MBRTOWC, LIB_SETLOCALE.
+       AIX 7.1 needs these to get the pthread support linked in.
+
+2020-07-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Support gettext and proper names
+       This way, ‘m4 --version’ outputs “Written by René Seindal”
+       instead of “Written by Rene' Seindal” when in a UTF-8 locale.
+       As the Translation project adds translations, NLS should
+       get better.
+       * .gitignore: Add translation-related file names.
+       * AUTHORS, ChangeLog-2014, NEWS, README, acinclude.m4, c-boxes.el:
+       Spell “François” and “René” without ASCIIfying.
+       * HACKING: Add Gettext as a prereq.
+       * Makefile.am (SUBDIRS): Add po.
+       * configure.ac: Do not use -Wvla.  Add AM_GNU_GETTEXT
+       and AM_GNU_GETTEXT_VERSION calls.
+       * lib/Makefile.am (MAINTAINERCLEANFILES): Define to empty.
+       * m4/gnulib-cache.m4: Add configmake, gettext-h, propername,
+       and setlocale modules.
+       * po/POTFILES.in: New file.
+       * src/Makefile.am (m4_LDADD): Add $(LIBICONV), $(LIBINTL).
+       * src/m4.c: Include configmake.h, propername.h.
+       (main): Set the locale.
+       * src/m4.h: Include locale.h, gettext.h.
+       (textdomain, bindtextdomain) [!ENABLE_NLS]: Provide defaults.
+       (_): Now an alias for gettext, instead of a no-op.
+
+       Use c-ctype.h instead of ctype.h
+       This simplifies the code a bit, and prepares for setlocale.
+       * m4/gnulib-cache.m4: Add c-ctype module.
+       * src/builtin.c (numeric_arg, m4_undivert, expand_user_macro):
+       * src/eval.c (eval_lex):
+       * src/format.c (arg_int, arg_long, arg_double, expand_format):
+       * src/freeze.c (GET_NUMBER): m
+       * src/input.c (next_token, peek_token):
+       * src/macro.c (expand_argument):
+       Prefer c-ctype macros to ctype macros.
+       Omit now-unnecessary calls to to_uchar.
+       * src/m4.h: Include c-ctype.h instead of ctype.h.
+
+2020-07-11  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Regenerate bootstrap
+
+       Convert m4.texi from Latin-1 to UTF-8
+       * HACKING: Texinfo 4.11 and Autoconf 2.63 are now prereqs.
+       * doc/m4.texi: Convert to UTF-8.
+
+2020-07-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port to recent GCC with --enable-gcc-warnings
+       * m4/gnulib-cache.m4: Add attribute, verify.
+       * src/m4.c (m4_failure, m4_failure_at_line): New functions.
+       These replace all uses of M4ERROR ((EXIT_FAILURE, ...)) and
+       M4ERROR_WITH_LINE ((EXIT_FAILURE, ...), so that the compiler can
+       deduce they do not return.
+       * src/m4.h: Include attribute.h, verify.h.
+       (M4_GNUC_ATTRIBUTE, M4_GNUC_UNUSED, M4_GNUC_PRINTF)
+       (M4_GNUC_NORETURN, M4_GNUC_PURE): Remove.
+       All uses replaced by corresponding attributes from attribute.h.
+       Also, use attribute.h’s FALLTHROUGH macro as needed in all files.
+       * src/macro.c (expand_macro): Cast to uintptr_t instead of to char *
+       to pacify GCC alignment warning.
+
+       maint: update copyright date
+       Arrived at via:
+       make update-copyright
+       gl/build-aux/inline-source gl/build-aux/bootstrap.in > bootstrap
+
+       build: adjust to gnulib changes
+       * configure.ac: Require Autoconf 2.63; needed by Gnulib.
+       * m4/gnulib-cache.m4: Regenerate.
+
+2020-07-05  Bruno Haible  <bruno@clisp.org>
+
+       Update after gnulib changed
+       * src/output.c (m4_tmpfile, m4_tmpopen): Update fopen_temp invocations.
+       * gl/lib/clean-temp.c.diff: Remove file, no longer needed.
+
+2020-07-05  Paul Eggert  <eggert@cs.ucla.edu>
+
+       build: update gnulib submodule to latest
+
+2017-01-02  Eric Blake  <eblake@redhat.com>
+
+       maint: bump copyright year
+       Needed to keep 'make syntax-check' passing.
+
+       * gnulib: Update to latest.
+       * bootstrap: Regenerate.
+       * all files: Use 'make update-copyright' to bump year.
+
 2016-12-31  Eric Blake  <eblake@redhat.com>
 
+       maint: post-release administrivia
+       * NEWS: Add header line for next release.
+       * .prev-version: Record previous version.
+       * cfg.mk (old_NEWS_hash): Auto-update.
+
        version 1.4.18
        * NEWS: Record release date.
 
index 0555e18..40ef1cb 100644 (file)
        * src/builtin.c (expand_ranges): Added break after trailing dash.
        This caused misbehaviors on some systems.
 
-Sat Nov  5 15:52:47 1994  Francois Pinard  (pinard@icule)
+Sat Nov  5 15:52:47 1994  François Pinard  (pinard@icule)
 
        Release 1.4.
        * doc/Makefile.in (realclean): Also remove stamp-vti.
        Reported by Eric Backus.
 
-Wed Nov  2 00:47:53 1994  Francois Pinard  (pinard@icule)
+Wed Nov  2 00:47:53 1994  François Pinard  (pinard@icule)
 
        * src/freeze.c (produce_frozen_state): If the frozen file cannot
        be opened, return immediately after producing the error message.
@@ -4062,7 +4062,7 @@ Wed Nov  2 00:47:53 1994  Francois Pinard  (pinard@icule)
        ANSIfying compiler flags, this is of no use to check it before.
        Reported by Alexander Lehmann.
 
-Tue Nov  1 22:02:37 1994  Francois Pinard  (pinard@icule)
+Tue Nov  1 22:02:37 1994  François Pinard  (pinard@icule)
 
        * src/macro.c (collect_arguments): Cast obstack arguments to
        (voidstar), so avoiding compiler warnings.
@@ -4076,7 +4076,7 @@ Tue Nov  1 22:02:37 1994  Francois Pinard  (pinard@icule)
        * src/symtab.c (free_symbol): Idem.
        Reported by Karl Vogel.
 
-Mon Oct 31 02:11:19 1994  Francois Pinard  (pinard@icule)
+Mon Oct 31 02:11:19 1994  François Pinard  (pinard@icule)
 
        * Makefile.in (DISTFILES): Distribute BACKLOG.
 
@@ -4085,7 +4085,7 @@ Mon Oct 31 02:11:19 1994  Francois Pinard  (pinard@icule)
        * src/m4.c, src/freeze.c: Use PRODUCT and VERSION instead of the
        constant string m4 and variable or parameter named version.
 
-Sun Oct 30 08:13:03 1994  Francois Pinard  (pinard@icule)
+Sun Oct 30 08:13:03 1994  François Pinard  (pinard@icule)
 
        * src/m4.h, src/debug.c: Replace all #ifdef __STDC__ by #if
        __STDC__.  Alliant FX/2800 Concentrix 2.2 (i860-BSD4.3) compiler
@@ -4099,7 +4099,7 @@ Sun Oct 30 08:13:03 1994  Francois Pinard  (pinard@icule)
        Reported by Eric Backus, Jim Meyering, John David Anglin and
        Joseph E. Sacco.
 
-Sat Oct 29 05:10:03 1994  Francois Pinard  (pinard@icule)
+Sat Oct 29 05:10:03 1994  François Pinard  (pinard@icule)
 
        * aclocal.m4 (fp_C_PROTOTYPES): Force -D_HPUX_SOURCE with -Aa.
        Reported by John David Anglin.
@@ -4124,7 +4124,7 @@ Sat Oct 29 05:10:03 1994  Francois Pinard  (pinard@icule)
        * doc/Makefile.in: Create version.texi, use it, clean it.
        Reported by Jim Meyering.
 
-Fri Oct 28 20:33:55 1994  Francois Pinard  (pinard@icule)
+Fri Oct 28 20:33:55 1994  François Pinard  (pinard@icule)
 
        * Makefile.in (all, install, uninstall): Depend on Makefile.
 
@@ -4141,29 +4141,29 @@ Fri Oct 28 20:33:55 1994  Francois Pinard  (pinard@icule)
 
        * {,*/}Makefile.in (dist): Always try a hard link before a copy.
 
-Thu Oct 27 22:32:58 1994  Francois Pinard  (pinard@icule)
+Thu Oct 27 22:32:58 1994  François Pinard  (pinard@icule)
 
        * Makefile.in (mostlyclean-local): Do not remove *~.
        * */Makefile.in (mostlyclean): Idem.
        Reported by Robert E. Brown and Richard Stallman.
 
-Sun Oct  9 08:30:13 1994  Francois Pinard  (pinard@icule)
+Sun Oct  9 08:30:13 1994  François Pinard  (pinard@icule)
 
        * src/m4.h: Get rid of CONFIG_BROKETS.
 
-Sun Oct  2 16:48:10 1994  Francois Pinard  (pinard@icule)
+Sun Oct  2 16:48:10 1994  François Pinard  (pinard@icule)
 
        * configure.in: Use AC_ARG_PROGRAM.
        * aclocal.m4 (fp_C_PROTOTYPES): Substitute @kr@ by kr or empty.
        Reported by David MacKenzie.
 
-Sat Oct  1 11:22:42 1994  Francois Pinard  (pinard@icule)
+Sat Oct  1 11:22:42 1994  François Pinard  (pinard@icule)
 
        * configure.in: Do not add -O to CFLAGS for GNU C, now that
        configure does it automatically.
        Reported by Jim Meyering.
 
-Fri Sep 23 08:16:58 1994  Francois Pinard  (pinard@icule)
+Fri Sep 23 08:16:58 1994  François Pinard  (pinard@icule)
 
        * src/stackovf.c: Declare the handler_t typedef earlier in the
        code, use it for stackovf_handler.
@@ -4175,12 +4175,12 @@ Fri Sep 23 08:16:58 1994  Francois Pinard  (pinard@icule)
        basename'ing it.
        Reported by Karl Berry.
 
-Sun Sep 18 11:42:50 1994  Francois Pinard  (pinard@icule)
+Sun Sep 18 11:42:50 1994  François Pinard  (pinard@icule)
 
        * src/Makefile.in (TAGS): Include a ../lib/TAGS reference.
        Reported by Karl Berry.
 
-Wed Sep 14 10:00:22 1994  Francois Pinard  (pinard@icule)
+Wed Sep 14 10:00:22 1994  François Pinard  (pinard@icule)
 
        * lib/Makefile.in (mostlyclean): Added.
        (TAGS): Make in $(srcdir).
@@ -4203,7 +4203,7 @@ Wed Sep 14 10:00:22 1994  Francois Pinard  (pinard@icule)
        -recursive and -local, only delay the removal of config.status,
        which is repeated in both goals.
 \f
-Tue Sep 13 19:21:05 1994  Francois Pinard  (pinard@icule)
+Tue Sep 13 19:21:05 1994  François Pinard  (pinard@icule)
 
        Release 1.3.
        * Makefile.in: Group all *clean-recursive goals in one, using sed
@@ -4230,12 +4230,12 @@ Tue Sep 13 19:21:05 1994  Francois Pinard  (pinard@icule)
        (realclean): Remove it.
        Reported by Karl Berry.
 
-Sat Sep 10 12:34:04 1994  Francois Pinard  (pinard@icule)
+Sat Sep 10 12:34:04 1994  François Pinard  (pinard@icule)
 
        * configure.in: Use fp_ to match aclocal.m4.  Revert _OS_ macros
        to old names, for following Autoconf.
 
-Thu Sep  8 15:07:27 1994  Francois Pinard  (pinard@icule)
+Thu Sep  8 15:07:27 1994  François Pinard  (pinard@icule)
 
        * Makefile.in (MDEFINES): Remove INSTALL substitutions, for
        ./install.sh will not be correctly referred to in sub-Makefiles.
@@ -4251,7 +4251,7 @@ Thu Sep  8 15:07:27 1994  Francois Pinard  (pinard@icule)
        * configure.in (AC_OUTPUT): Touch stamp-h if CONFIG_HEADERS.
        Reported by Jim Meyering.
 
-Tue Sep  6 12:07:33 1994  Francois Pinard  (pinard@icule)
+Tue Sep  6 12:07:33 1994  François Pinard  (pinard@icule)
 
        * configure.in: Correct stack overflow detection logic, taking
        care of systems having only incomplete implementations (like for
@@ -4260,11 +4260,11 @@ Tue Sep  6 12:07:33 1994  Francois Pinard  (pinard@icule)
 
        * src/Makefile.in (TAGS): Remote -t from etags call.
 
-Fri Sep  2 10:37:10 1994  Francois Pinard  (pinard@icule)
+Fri Sep  2 10:37:10 1994  François Pinard  (pinard@icule)
 
        * lib/Makefile.in (install): Depend on all.
 
-Wed Aug 31 11:17:21 1994  Francois Pinard  (pinard@icule)
+Wed Aug 31 11:17:21 1994  François Pinard  (pinard@icule)
 
        * examples/Makefile.in (mostlyclean): Do not depend on texclean.
        Reported by Jim Meyering and John David Anglin.
@@ -4301,7 +4301,7 @@ Wed Aug 31 11:17:21 1994  Francois Pinard  (pinard@icule)
        * src/output.c (output_text): New function, for optimizing the
        output of strings of characters.  Use it.
 
-Tue Aug 30 01:44:29 1994  Francois Pinard  (pinard@icule)
+Tue Aug 30 01:44:29 1994  François Pinard  (pinard@icule)
 
        * doc, src: New directories reorganizing the distribution.
        * doc/Makefile.in, src/Makefile.in, examples/Makefile.in: New
@@ -4315,7 +4315,7 @@ Tue Aug 30 01:44:29 1994  Francois Pinard  (pinard@icule)
        * output.c (shipout_text): Accept a length parameter, and use it.
        All callers adjusted.
 
-Mon Aug 29 12:27:19 1994  Francois Pinard  (pinard@icule)
+Mon Aug 29 12:27:19 1994  François Pinard  (pinard@icule)
 
        * m4.h: Include <unistd.h> if it exists.
        * stackovf.c: Don't.
@@ -4355,12 +4355,12 @@ Mon Aug 29 12:27:19 1994  Francois Pinard  (pinard@icule)
        (insert_file): Use better buffering.
        Reported by David MacKenzie.
 
-Sun Aug 28 05:20:02 1994  Francois Pinard  (pinard@icule)
+Sun Aug 28 05:20:02 1994  François Pinard  (pinard@icule)
 
        * Makefile.in, lib/Makefile.in, checks/Makefile.in: Arrange so
        dist works from another build directory.
 
-Sat Aug 27 14:32:45 1994  Francois Pinard  (pinard@icule)
+Sat Aug 27 14:32:45 1994  François Pinard  (pinard@icule)
 
        * symtab.c (hack_all_symbols): Use hash_table_size instead of
        constant HASHMAX, for -H option to work better.
@@ -4377,7 +4377,7 @@ Sat Aug 27 14:32:45 1994  Francois Pinard  (pinard@icule)
        (builtin_init): Accept and obey a flag argument.
        * m4.h: Add declarations for freeze.c, changes for builtin.c.
 
-Wed Aug 24 16:14:19 1994  Francois Pinard  (pinard@icule)
+Wed Aug 24 16:14:19 1994  François Pinard  (pinard@icule)
 
        * builtin.c (dumpdef_cmp): Rewrite so the cast protect the const
        specifier.
@@ -4386,12 +4386,12 @@ Wed Aug 24 16:14:19 1994  Francois Pinard  (pinard@icule)
        * acconfig.h: Document WITH_DMALLOC.
        * m4.h: Add code for when WITH_DMALLOC.
 
-Mon Aug 15 12:38:05 1994  Francois Pinard  (pinard@icule)
+Mon Aug 15 12:38:05 1994  François Pinard  (pinard@icule)
 
        * m4.c (long_options): Use "error-output", the dash was missing.
        Reported by Akiko Matsushita.
 
-Fri Aug 12 16:38:01 1994  Francois Pinard  (pinard@icule)
+Fri Aug 12 16:38:01 1994  François Pinard  (pinard@icule)
 
        * m4.h: Include <sys/types.h>.
        * builtin.c, debug.c, m4.c, output.c, stackovf.c: Don't.
@@ -4420,7 +4420,7 @@ Fri Aug 12 16:38:01 1994  Francois Pinard  (pinard@icule)
        * m4.c (usage): Reorganize the --help output by topic.  Include a
        description for debugging flags.
 
-Fri Jul 29 10:15:52 1994  Francois Pinard  (pinard@icule)
+Fri Jul 29 10:15:52 1994  François Pinard  (pinard@icule)
 
        * configure.in: If sigaction is available and SA_ONSTACK defined,
        use sigaction.  Otherwise, if sigvec is available and SV_ONSTACK
@@ -4429,15 +4429,15 @@ Fri Jul 29 10:15:52 1994  Francois Pinard  (pinard@icule)
        Reported by Jim Avera, Karl Berry, Kaveh R. Ghazi, Matthias Rabe
        and Simon Leinen.
 
-Thu Jul 21 22:43:17 1994  Francois Pinard  (pinard@icule)
+Thu Jul 21 22:43:17 1994  François Pinard  (pinard@icule)
 
        * m4.c (usage): Replace printf par fputs.
 \f
-Mon Jul 18 23:48:23 1994  Francois Pinard  (pinard@icule)
+Mon Jul 18 23:48:23 1994  François Pinard  (pinard@icule)
 
        * Release 1.2
 
-Sun Jul 17 08:08:25 1994  Francois Pinard  (pinard@icule)
+Sun Jul 17 08:08:25 1994  François Pinard  (pinard@icule)
 
        * configure.in: Check for sigaction and sigvec.  Add a new delayed
        check for RLIMIT_STACK, combine in the checking for getrlimit.
@@ -4447,17 +4447,17 @@ Sun Jul 17 08:08:25 1994  Francois Pinard  (pinard@icule)
        * examples/stackovf.sh: Correct a typo.
        Reported by Eric Backus, Jim Avera and Jim Meyering.
 
-Sat Jul 16 20:36:19 1994  Francois Pinard  (pinard@icule)
+Sat Jul 16 20:36:19 1994  François Pinard  (pinard@icule)
 
        * ansi2knr.c: New version sent by its author, Peter Deutsch.
 
-Fri Jul 15 14:36:21 1994  Francois Pinard  (pinard@icule)
+Fri Jul 15 14:36:21 1994  François Pinard  (pinard@icule)
 
        * Makefile.in: Modify so parallel make will not try making
        lib/libm4.a twice simultaneously.
        Reported by Jim Meyering.
 
-Thu Jul 14 17:23:17 1994  Francois Pinard  (pinard@icule)
+Thu Jul 14 17:23:17 1994  François Pinard  (pinard@icule)
 
        * stackovf.c (setup_stackovf_trap): Replace "Don't" by "Do not" in
        error message, for when no code possibility exists.  Even if this
@@ -4471,7 +4471,7 @@ Thu Jul 14 17:23:17 1994  Francois Pinard  (pinard@icule)
        providing ulimit, instead of using only ksh.
        Reported by Jim Avera and Joseph E. Sacco.
 
-Tue Jul 12 06:54:31 1994  Francois Pinard  (pinard@icule)
+Tue Jul 12 06:54:31 1994  François Pinard  (pinard@icule)
 
        * Makefile.in (check): Have it depend on all instead of m4.  In
        this way, a change in lib will be detected and processed.
@@ -4487,7 +4487,7 @@ Tue Jul 12 06:54:31 1994  Francois Pinard  (pinard@icule)
        * lib/strtol.c: New file, from elsewhere.
        Reported by Andreas Schwab.
 
-Thu Jul  7 22:38:10 1994  Francois Pinard  (pinard@icule)
+Thu Jul  7 22:38:10 1994  François Pinard  (pinard@icule)
 
        * macro.c (expand_macro): Cast value to (boolean) prior to
        assigning it to traced.
@@ -4508,7 +4508,7 @@ Wed Jul  6 13:16:31 1994  Jim Avera (jima@netcom.com)
        * examples/stackovf.sh: Run m4 -L99999999 to allow stack overflow.
        * ansi2knr.c: Fix for func-ptr args; convert "..." to varargs syntax.
 
-Tue Jul  5 19:13:54 1994  Francois Pinard  (pinard@icule)
+Tue Jul  5 19:13:54 1994  François Pinard  (pinard@icule)
 
        * configure.in: Use AC_SET_MAKE.
        * Makefile.in: Use @SET_MAKE@.
@@ -4517,7 +4517,7 @@ Tue Jul  5 19:13:54 1994  Francois Pinard  (pinard@icule)
        * checks/check-them: Do not trap on SIGQUIT or SIGALRM.
        Reported by Ian Taylor.
 
-Sat Jul  2 00:58:47 1994  Francois Pinard  (pinard@icule)
+Sat Jul  2 00:58:47 1994  François Pinard  (pinard@icule)
 
        * configure.in: Remove dependency of USE_STACKOVF on STDC_HEADERS,
        because siginfo.h is unrelated to standard headers, and siginfo.h
@@ -4529,14 +4529,14 @@ Sat Jul  2 00:58:47 1994  Francois Pinard  (pinard@icule)
        * aclocal.m4, configure.in: Replace AC_HAVE_PROTOTYPES by
        AC_PROTOTYPES.
 
-Wed Jun 29 22:41:53 1994  Francois Pinard  (pinard@icule)
+Wed Jun 29 22:41:53 1994  François Pinard  (pinard@icule)
 
        * builtin.c (substitute): Use \& to represent this part of the
        string which was matched by the whole regexp, instead of
        representing the whole string.  Any usage of \0 issues a warning
        and acts like \&, it will disappear in some subsequent release.
 
-Mon Jun 27 14:24:23 1994  Francois Pinard  (pinard@icule)
+Mon Jun 27 14:24:23 1994  François Pinard  (pinard@icule)
 
        * m4.c: Complete prototype for forwarded declaration of usage.
 
@@ -4582,7 +4582,7 @@ Mon Jun 27 14:24:23 1994  Francois Pinard  (pinard@icule)
        (int) to most references, when used in expressions.
        Reported by Tom McConnell.
 
-Sat Jun 25 00:10:05 1994  Francois Pinard  (pinard@icule)
+Sat Jun 25 00:10:05 1994  François Pinard  (pinard@icule)
 
        * aclocal.m4: Replace FP_PROTOTYPES by AC_HAVE_PROTOTYPES,
        following an idea from Brook G. Milligan.  AC_HAVE_PROTOTYPES
@@ -4621,13 +4621,13 @@ Sat Jun 25 00:10:05 1994  Francois Pinard  (pinard@icule)
        * checks/Makefile.in (clean): Depends on mostlyclean.
        (mostlyclean): New goal.
 
-Fri Jun 24 23:30:31 1994  Francois Pinard  (pinard@icule)
+Fri Jun 24 23:30:31 1994  François Pinard  (pinard@icule)
 
        * Makefile.in (DISTFILES): Distribute install.sh.
        * install.sh: New file, copied from elsewhere.
        Reported by Assar Westerlund and Kaveh R. Ghazi.
 
-Thu Jun 23 00:00:30 1994  Francois Pinard  (pinard@icule)
+Thu Jun 23 00:00:30 1994  François Pinard  (pinard@icule)
 
        * configure.in: Define ENABLE_CHANGEWORD if --enable-changeword.
        * acconfig.h: Explain ENABLE_CHANGEWORD.
@@ -4692,7 +4692,7 @@ Thu Jun 23 00:00:30 1994  Francois Pinard  (pinard@icule)
        incl_test.m4.
        * examples/multiquotes.m4: Renamed from multi-quotes.m.
 
-Wed Jun 22 21:58:54 1994  Francois Pinard  (pinard@icule)
+Wed Jun 22 21:58:54 1994  François Pinard  (pinard@icule)
 
        * configure.in: Avoid USE_STACKOVF if <siginfo.h> not found.  Note
        that Jim developped stackovf.c on a 486 running SVR4.0 (ESIX), and
@@ -4714,17 +4714,17 @@ Wed Jun 22 21:58:54 1994  Francois Pinard  (pinard@icule)
        problem about an incorrect cpp seting on NeXT 3.1.
        Reported by Alexander Lehmann.
 
-Sun Jun  5 16:25:19 1994  Francois Pinard  (pinard@icule)
+Sun Jun  5 16:25:19 1994  François Pinard  (pinard@icule)
 
        * m4.h (_): Change argument from `x' to `Args'.
 
-Wed May  4 23:59:39 1994  Francois Pinard  (pinard@icule)
+Wed May  4 23:59:39 1994  François Pinard  (pinard@icule)
 
        * Makefile.in: Remove all occurrences of $(MFLAGS), which were
        bringing more evil than good on a few systems.
        Reported by Greg A. Woods.
 
-Fri Apr 22 15:59:35 1994  Francois Pinard  (pinard@icule)
+Fri Apr 22 15:59:35 1994  François Pinard  (pinard@icule)
 
        * m4.h: Rename Args() to _().
        * m4.h: Remove extern specifier from all function declarations.
@@ -4741,7 +4741,7 @@ Fri Apr 22 15:51:21 1994  Jim Avera (jima@netcom.com)
        * m4.c: Call setup_stackovf_trap().
        * tests/stackovf_test.sh: New file.
 
-Wed Apr 13 14:10:30 1994  Francois Pinard  (pinard@icule)
+Wed Apr 13 14:10:30 1994  François Pinard  (pinard@icule)
 
        * checks/Makefile.in: Rename .all-stamp to stamp-checks.
 
@@ -4763,36 +4763,36 @@ Sun Jan 30 14:24:19 1994    (pinard at icule)
        * m4.h: Avoid a pre-ANSI <memory.h> together with <string.h>.
        Reported by Jim Meyering.
 
-Tue Jan 25 18:39:37 1994  Francois Pinard  (pinard at icule)
+Tue Jan 25 18:39:37 1994  François Pinard  (pinard at icule)
 
        * m4.h: Move the conditional definition of volatile after the
        inclusion of system files, because they may define it first.
 
-Tue Jan  4 19:46:50 1994  Francois Pinard  (pinard@icule)
+Tue Jan  4 19:46:50 1994  François Pinard  (pinard@icule)
 
        * checks/Makefile.in (CHECKS): Add a useless `*' before `[', to
        get around a problem with Alpha make seeing a syntax error, there.
        Reported by Vern Paxson.
 
-Mon Jan  3 00:21:45 1994  Francois Pinard  (pinard@icule)
+Mon Jan  3 00:21:45 1994  François Pinard  (pinard@icule)
 
        * Makefile.in: Do not define LDFLAGS, use CFLAGS on link calls.
        Reported by Richard Stallman.
 
-Sat Dec 25 08:06:05 1993  Francois Pinard  (pinard@icule)
+Sat Dec 25 08:06:05 1993  François Pinard  (pinard@icule)
 
        * configure.in: Correct test for strerror, AC_FUNC_CHECK was used
        instead of AC_HAVE_FUNCS.
        Reported by Noah Friedman.
 
-Wed Dec  1 09:37:53 1993  Francois Pinard  (pinard@icule)
+Wed Dec  1 09:37:53 1993  François Pinard  (pinard@icule)
 
        * m4.c: Initialize show_help and show_version to zero.
 
        * m4.c: Ensure EXIT_SUCCESS and EXIT_FAILURE are defined.
        Use them in exit() and usage() calls.
 
-Sat Nov 27 10:43:24 1993  Francois Pinard  (pinard@icule)
+Sat Nov 27 10:43:24 1993  François Pinard  (pinard@icule)
 
        * m4.h: Delete extern sys_nerr, sys_errlist declarations, and
        syserr() macro.  Delete errref, add reference_error and M4ERROR.
@@ -4804,13 +4804,13 @@ Sat Nov 27 10:43:24 1993  Francois Pinard  (pinard@icule)
        Doing so, the program name appears after the input reference
        instead of before, which eases M-x next-error processing.
 
-Wed Nov 24 22:16:15 1993  Francois Pinard  (pinard@icule)
+Wed Nov 24 22:16:15 1993  François Pinard  (pinard@icule)
 
        * checks/get-them: Escape braces with backslashes in patterns,
        because HPUX-9.01 awk needs this.
        Reported by Jim Meyering.
 
-Mon Nov 22 10:55:52 1993  Francois Pinard  (pinard@icule)
+Mon Nov 22 10:55:52 1993  François Pinard  (pinard@icule)
 
        * builtin.c: Declare "FILE *popen ();".
 
@@ -4825,7 +4825,7 @@ Mon Nov 22 10:55:52 1993  Francois Pinard  (pinard@icule)
        conflicts on SGI and Alpha.
        Reported by Kaveh R. Ghazi.
 
-Sat Nov 20 08:26:15 1993  Francois Pinard  (pinard@icule)
+Sat Nov 20 08:26:15 1993  François Pinard  (pinard@icule)
 
        * m4.c: Include <getopt.h> instead of "getopt.h".
 
@@ -4839,7 +4839,7 @@ Sat Nov 20 08:26:15 1993  Francois Pinard  (pinard@icule)
        * m4.h: Test for HAVE_MEMORY_H instead of NEED_MEMORY_H.
        * configure.in: Use AC_HAVE_HEADERS(memory.h), delete AC_MEMORY_H.
 
-Wed Nov 17 09:34:55 1993  Francois Pinard  (pinard@icule)
+Wed Nov 17 09:34:55 1993  François Pinard  (pinard@icule)
 
        * builtin.c (m4_eval): Cast strlen to (int) before comparing.
 
@@ -4897,7 +4897,7 @@ Wed Nov 17 09:34:55 1993  Francois Pinard  (pinard@icule)
        * builtin.c (m4_syscmd, m4_esyscmd): Use it.
        Reported by Nicolas Pioch.
 
-Fri Nov 12 10:02:26 1993  Francois Pinard  (pinard@icule)
+Fri Nov 12 10:02:26 1993  François Pinard  (pinard@icule)
 
        * Makefile.in (m4.dvi): Use m4.texinfo instead of m4.texi.
        Reported by Joel Sherrill.
@@ -4912,17 +4912,17 @@ Fri Nov 12 10:02:26 1993  Francois Pinard  (pinard@icule)
        * macro.c (call_macro): Add * in (*SYMBOL_FUNC (sym)) (...).
        Reported by Karl Vogel.
 
-Tue Nov  9 09:31:47 1993  Francois Pinard  (pinard@icule)
+Tue Nov  9 09:31:47 1993  François Pinard  (pinard@icule)
 
        * m4.h: Do not define volatile if already defined.
-       Reported by Rene' Seindal.
+       Reported by René Seindal.
 
        * lib/Makefile.in: Add a forgotten ALLOCA=@ALLOCA@.  Grrr!
 
        Reported by Bernhard Daeubler, Eric Backus, Hal Peterson, Hoang
        Uong, Ian Taylor, Kaveh R. Ghazi, Tom McConnell and Walter Wong.
 
-Mon Nov  8 21:11:44 1993  Francois Pinard  (pinard@icule)
+Mon Nov  8 21:11:44 1993  François Pinard  (pinard@icule)
 
        * m4.h: Define strchr and strrchr in terms of index and rindex,
        instead of the other way around.
@@ -4931,7 +4931,7 @@ Mon Nov  8 21:11:44 1993  Francois Pinard  (pinard@icule)
        * input.c (next_char): Remove a "break;" after a "return ...;".
        Reported by Tom McConnell.
 \f
-Mon Nov  8 12:45:34 1993  Francois Pinard  (pinard@icule)
+Mon Nov  8 12:45:34 1993  François Pinard  (pinard@icule)
 
        * Release 1.1
 
@@ -4950,7 +4950,7 @@ Mon Nov  8 12:45:34 1993  Francois Pinard  (pinard@icule)
        instead of "configure --no-create", which is obsolete.
        Reported by Tom McConnell.
 
-Fri Nov  5 09:49:30 1993  Francois Pinard  (pinard@compy.IRO.UMontreal.CA)
+Fri Nov  5 09:49:30 1993  François Pinard  (pinard@compy.IRO.UMontreal.CA)
 
        * m4.c (usage): Use "%s" instead of "m4" in format string.
        Reported by Jim Meyering.
@@ -4967,13 +4967,13 @@ Fri Nov  5 09:49:30 1993  Francois Pinard  (pinard@compy.IRO.UMontreal.CA)
        * checks/Makefile.in: Changed accordingly.
        Reported by Jim Meyering.
 
-Thu Nov  4 13:50:52 1993  Francois Pinard  (pinard@lagrande.IRO.UMontreal.CA)
+Thu Nov  4 13:50:52 1993  François Pinard  (pinard@lagrande.IRO.UMontreal.CA)
 
        * lib/Makefile.in (dist): Correct permissions on files.
 
        * output.c: Declare tmpfile, some systems don't.
 
-Wed Nov  3 09:09:16 1993  Francois Pinard  (pinard@icule)
+Wed Nov  3 09:09:16 1993  François Pinard  (pinard@icule)
 
        * checks/Makefile.in (dist): Correct permissions on files.
 
@@ -4993,7 +4993,7 @@ Wed Nov  3 09:09:16 1993  Francois Pinard  (pinard@icule)
        diagnose missing arguments and return the empty string.
        Reported by Nick S. Kanakakorn.
 
-Tue Nov  2 00:55:41 1993  Francois Pinard  (pinard@icule)
+Tue Nov  2 00:55:41 1993  François Pinard  (pinard@icule)
 
        * m4.c (main): At end of all input, ensure all undiverted text
        goes to the main output stream.
@@ -5017,7 +5017,7 @@ Tue Nov  2 00:55:41 1993  Francois Pinard  (pinard@icule)
        which case it is implied empty.  Affects define and pushdef.
        Reported by Eric Allman.
 
-Mon Nov  1 07:45:24 1993  Francois Pinard  (pinard@icule)
+Mon Nov  1 07:45:24 1993  François Pinard  (pinard@icule)
 
        * m4.h: Add blind_if_no_args in struct builtin, blind_no_args in
        struct symbol adn SYMBOL_BLIND_NO_ARGS macro.
@@ -5080,33 +5080,33 @@ Mon Nov  1 07:45:24 1993  Francois Pinard  (pinard@icule)
        Reported by Kristine Lund.
        Reported by Marion Hakanson.
 
-Sat Oct 30 12:51:47 1993  Francois Pinard  (pinard@icule)
+Sat Oct 30 12:51:47 1993  François Pinard  (pinard@icule)
 
        * Makefile.in (m4.info): Use -I$(srcdir) on $(MAKEINFO).
        Reported by Noah Friedman.
 
-Mon Oct 25 14:58:48 1993  Francois Pinard  (pinard@icule)
+Mon Oct 25 14:58:48 1993  François Pinard  (pinard@icule)
 
        * Makefile.in: Remove MDEFINES and cleanup.
 
-Wed Jun  9 14:59:46 1993  Francois Pinard  (pinard@icule)
+Wed Jun  9 14:59:46 1993  François Pinard  (pinard@icule)
 
        * Makefile.in (dist): Replace "echo `pwd`" by a mere "pwd".
        Create a gzip file.
 
-Sat Feb  6 14:59:22 1993  Francois Pinard  (pinard@icule)
+Sat Feb  6 14:59:22 1993  François Pinard  (pinard@icule)
 
        * Makefile.in, lib/Makefile.in, check/Makefile.in: In dist goals,
        ensure 777 mode for directories, so older tar's will restore file
        modes properly.
 
-Sun Jan 17 15:38:05 1993  Francois Pinard  (pinard@icule)
+Sun Jan 17 15:38:05 1993  François Pinard  (pinard@icule)
 
        * Makefile.in, lib/Makefile.in: Put $(CFLAGS) after $(CPPFLAGS),
        so the installer can override automatically configured choices.
        Reported by Karl Berry.
 
-Fri Jan 15 16:07:00 1993  Francois Pinard  (pinard@icule)
+Fri Jan 15 16:07:00 1993  François Pinard  (pinard@icule)
 
        * lib/vfprintf.c: Stolen from Oleo distribution and adapted.  The
        previous version was not working properly on m68k-hp-bsd4.3.
@@ -5117,19 +5117,19 @@ Fri Jan 15 16:07:00 1993  Francois Pinard  (pinard@icule)
        * lib/Makefile.in: Distribute _doprnt.c.
        Do not distribute regex.[ch].old anymore.
 
-Fri Jan  1 19:42:23 1993  Francois Pinard  (pinard at icule)
+Fri Jan  1 19:42:23 1993  François Pinard  (pinard at icule)
 
        * Makefile.in, lib/Makefile.in: Reinstate $(CPPFLAGS), use it.
        Richard wants it there.
 
-Sun Dec 27 07:01:54 1992  Francois Pinard  (pinard at icule)
+Sun Dec 27 07:01:54 1992  François Pinard  (pinard at icule)
 
        * Makefile.in: Add DEFS to MDEFINES.
        * lib/Makefile.in (.c.o): Remove $(CPPFLAGS).
        (libm4.a): Remove the library before creating it.
        (distclean): Remove tags and TAGS too.
 
-Wed Dec 23 12:46:55 1992  Francois Pinard  (pinard at icule)
+Wed Dec 23 12:46:55 1992  François Pinard  (pinard at icule)
 
        * Makefile.in (dvi, m4.dvi): New goals.
 
@@ -5145,7 +5145,7 @@ Wed Dec 23 12:46:55 1992  Francois Pinard  (pinard at icule)
        Reported by Pierre Gaumond.
        Reported by Greg A. Woods.
 
-Sun Dec 20 10:40:20 1992  Francois Pinard  (pinard at icule)
+Sun Dec 20 10:40:20 1992  François Pinard  (pinard at icule)
 
        * Makefile.in: Remove $(CPPFLAGS) from the .c.o rule.  The user
        might well use CFLAGS is s/he needs it.
@@ -5158,7 +5158,7 @@ Sun Dec 20 10:40:20 1992  Francois Pinard  (pinard at icule)
        Reported by Erez Zadok.
        Reported by Assar Westerlund.
 \f
-Sat Dec 19 08:21:34 1992  Francois Pinard  (pinard at icule)
+Sat Dec 19 08:21:34 1992  François Pinard  (pinard at icule)
 
        * Release 1.0.3
        This is still a beta release for the future GNU m4 version 1.1.
@@ -5219,7 +5219,7 @@ Sat Dec 19 08:21:34 1992  Francois Pinard  (pinard at icule)
        mysteriously stopped aborting with this one.  Insecure feeling...
        * lib/Makefile.in: Distribute regex.[ch].old, just in case!
 
-Fri Dec 18 11:08:03 1992  Francois Pinard  (pinard at icule)
+Fri Dec 18 11:08:03 1992  François Pinard  (pinard at icule)
 
        * m4.c: Change `--no-warnings' to `--silent'.
        Reported by David MacKenzie.
@@ -5246,7 +5246,7 @@ Wed Nov 18 07:57:19 1992  Jim Meyering  (meyering@idefix)
        macro_definition.
        * symtab.c: Use typedef symbol instead of struct symbol.
 
-Tue Nov 17 01:58:40 1992  Francois Pinard  (pinard at icule)
+Tue Nov 17 01:58:40 1992  François Pinard  (pinard at icule)
 
        * *.[ch]: Remove all trailing whitespace, in code and comments.
 
@@ -5257,7 +5257,7 @@ Tue Nov 17 01:58:40 1992  Francois Pinard  (pinard at icule)
        awk script when switching files, because without this, mawk runs
        out of file descriptors.
 
-Mon Nov 16 20:42:56 1992  Francois Pinard  (pinard at icule)
+Mon Nov 16 20:42:56 1992  François Pinard  (pinard at icule)
 
        * Makefile.in (realclean): Delete m4.info*.
        Reported by Jim Meyering.
@@ -5291,7 +5291,7 @@ Mon Nov 16 07:48:52 1992  Jim Meyering  (meyering@idefix)
        * builtin.c, debug.c, format.c, m4.c, m4.h, macro.c, symtab.c
        (many functions and arrays): Declare `const'.
 
-Sun Nov 15 09:42:09 1992  Francois Pinard  (pinard at icule)
+Sun Nov 15 09:42:09 1992  François Pinard  (pinard at icule)
 
        * *.[ch]: Rename nil to NULL, using the declaration from <stdio.h>,
        removing the declaration from m4.h.  Also rename false to FALSE
@@ -5307,13 +5307,13 @@ Sun Nov 15 09:42:09 1992  Francois Pinard  (pinard at icule)
        instead of from version.h.  I need updating many files manually,
        when the version changes, version.h is just one of them.
 
-Sat Nov 14 11:01:20 1992  Francois Pinard  (pinard at icule)
+Sat Nov 14 11:01:20 1992  François Pinard  (pinard at icule)
 
        * m4.h: Remove the tag `boolean' on the enum introducing typedef
        `boolean'.  This tag conflicts with <sys/types.h> on SVR4.
        Reported by Tom McConnell.
 
-Fri Nov 13 00:12:50 1992  Francois Pinard  (pinard at icule)
+Fri Nov 13 00:12:50 1992  François Pinard  (pinard at icule)
 
        * m4.texinfo: Correct the examples for 33.divert, 38.divnum,
        39.cleardiv, which were describing missing or spurious newlines.
@@ -5329,7 +5329,7 @@ Fri Nov 13 00:12:50 1992  Francois Pinard  (pinard at icule)
 
        * Makefile.in (dist): chmod a+r before making the tar file.
 
-Thu Nov 12 14:42:57 1992  Francois Pinard  (pinard at icule)
+Thu Nov 12 14:42:57 1992  François Pinard  (pinard at icule)
 
        * builtin.c (m4_dnl): Diagnose any parameter to `dnl'.
 
@@ -5343,7 +5343,7 @@ Thu Nov 12 14:42:57 1992  Francois Pinard  (pinard at icule)
        ensure that it does not define errno.
        Reported by Richard Stallman.
 
-Wed Nov 11 17:40:35 1992  Francois Pinard  (pinard at icule)
+Wed Nov 11 17:40:35 1992  François Pinard  (pinard at icule)
 
        * builtin.c: Define and use DECLARE macro for builtins.
 
@@ -5355,7 +5355,7 @@ Wed Nov 11 17:40:35 1992  Francois Pinard  (pinard at icule)
 
        * m4.c (cmd_error): Add a missing semicolon before va_end().
 
-Tue Nov 10 08:57:05 1992  Francois Pinard  (pinard at icule)
+Tue Nov 10 08:57:05 1992  François Pinard  (pinard at icule)
 
        * Makefile.in: Now handle protoized sources.  Define and use U.
        Compile and use ansi2knr with old compilers.  Update DISTFILES.
@@ -5384,7 +5384,7 @@ Tue Nov 10 08:57:05 1992  Francois Pinard  (pinard at icule)
        * path.c: Protoized.  Then cast some (char *) over xmalloc's.
        * symtab.c: Protoized.
 
-Fri Nov  6 02:05:21 1992  Francois Pinard  (pinard at icule)
+Fri Nov  6 02:05:21 1992  François Pinard  (pinard at icule)
 
        * m4.texinfo: Remove directory from diagnostics in 30.include,
        51.eval, 56.errprint and 57.m4exit tests.
@@ -5397,7 +5397,7 @@ Fri Nov  6 02:05:21 1992  Francois Pinard  (pinard at icule)
        * Makefile.in, lib/Makefile.in: Implement Autoconf interface.
        Then, rewritten for better compliance with GNU standards.
 
-Thu Nov  5 12:37:13 1992  Francois Pinard  (pinard at icule)
+Thu Nov  5 12:37:13 1992  François Pinard  (pinard at icule)
 
        * format.c (format): Avoid syntax error if not HAVE_EFGCVT,
        because of a misplaced #endif.
@@ -5429,7 +5429,7 @@ Thu Nov  5 12:37:13 1992  Francois Pinard  (pinard at icule)
        * Delete empty etc/.
        * examples/: New name for test/.
 
-Tue Mar 10 00:29:46 1992  Francois Pinard  (pinard at icule)
+Tue Mar 10 00:29:46 1992  François Pinard  (pinard at icule)
 
        * Makefile.in (check): Add m4 as dependency.
 
@@ -5438,7 +5438,7 @@ Tue Mar 10 00:29:46 1992  Francois Pinard  (pinard at icule)
        usage message more informative.
        Reported by David MacKenzie.
 
-Mon Mar  9 14:53:40 1992  Francois Pinard  (pinard at icule)
+Mon Mar  9 14:53:40 1992  François Pinard  (pinard at icule)
 
        * etc/check_examples: New name for check_examples.sh.
        * etc/get_examples: New name for get_examples.sh.
@@ -5449,7 +5449,7 @@ Mon Mar  9 14:53:40 1992  Francois Pinard  (pinard at icule)
        * Many *.[hc] files: GNU indent'ed, with further fine tuning of
        code disposition by hand.
 
-Sun Mar  8 11:01:55 1992  Francois Pinard  (pinard at icule)
+Sun Mar  8 11:01:55 1992  François Pinard  (pinard at icule)
 
        * m4.h: Delete definitions for abort() and exit().
        Reported by Richard Stallman.
@@ -5465,7 +5465,7 @@ Sun Mar  8 11:01:55 1992  Francois Pinard  (pinard at icule)
 
        * Transfer of maintenance duties from Rene' to Franc,ois.
 \f
-Thu Oct 24 15:18:46 1991  Rene' Seindal (seindal at diku.dk)
+Thu Oct 24 15:18:46 1991  René Seindal (seindal at diku.dk)
 
        * Release 1.0.  Many thanks to those, who provided me with bug
        reports and feedback.
@@ -5487,10 +5487,10 @@ Thu Oct 24 15:18:46 1991  Rene' Seindal (seindal at diku.dk)
 
        * Several minor bugs have been fixed.
 \f
-Fri Jul 26 15:28:42 1991  Rene' Seindal (seindal at diku.dk)
+Fri Jul 26 15:28:42 1991  René Seindal (seindal at diku.dk)
 
        * Fixed various bugs.  Release 0.99, manual 0.09.  Many thanks to
-       Francois Pinard and Roland H. Pesch for providing me with reports.
+       François Pinard and Roland H. Pesch for providing me with reports.
 
        * The builtins incr and decr are now implemented without use of
        eval.
@@ -5526,7 +5526,7 @@ Fri Jul 26 15:28:42 1991  Rene' Seindal (seindal at diku.dk)
 
        * The m4.info file is now installed along with the program.
 \f
-Thu Nov 15 21:51:06 1990  Rene' Seindal (seindal at diku.dk)
+Thu Nov 15 21:51:06 1990  René Seindal (seindal at diku.dk)
 
        * Updated and enhanced version.  Release 0.75, manual 0.07.
 
@@ -5567,7 +5567,7 @@ Thu Nov 15 21:51:06 1990  Rene' Seindal (seindal at diku.dk)
 
        * Fixed two missing null bytes bugs.
 \f
-Mon Jan 22 21:08:52 1990  Rene' Seindal (seindal at diku.dk)
+Mon Jan 22 21:08:52 1990  René Seindal (seindal at diku.dk)
 
        * Initial beta release.  Release 0.50, manual 0.05.
 
@@ -5577,8 +5577,8 @@ Mon Jan 22 21:08:52 1990  Rene' Seindal (seindal at diku.dk)
        coding: utf-8
        End:
 
-       Copyright (C) 1990-1994, 2000-2001, 2003, 2005-2014, 2016 Free
-       Software Foundation, Inc.
+       Copyright (C) 1990-1994, 2000-2001, 2003, 2005-2014, 2016-2017,
+       2020-2021 Free Software Foundation, Inc.
 
        Copying and distribution of this file, with or without
        modification, are permitted provided the copyright notice
index a869da5..0c99d58 100644 (file)
@@ -5,7 +5,7 @@
 # It is necessary if you want to build targets usually of interest
 # only to the maintainer.
 
-# Copyright (C) 2001, 2003, 2006-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2006-2021 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # If the user runs GNU make but has not yet run ./configure,
 # give them a diagnostic.
@@ -104,7 +104,7 @@ endif
 
 abort-due-to-no-makefile:
        @echo There seems to be no Makefile in this directory.   1>&2
-       @echo "You must run ./configure before running 'make'." 1>&2
+       @echo "You must run ./configure before running '$(MAKE)'." 1>&2
        @exit 1
 
 endif
diff --git a/INSTALL b/INSTALL
index 8865734..e82fd21 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -1,8 +1,8 @@
 Installation Instructions
 *************************
 
-   Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
-Foundation, Inc.
+   Copyright (C) 1994-1996, 1999-2002, 2004-2017, 2020-2021 Free
+Software Foundation, Inc.
 
    Copying and distribution of this file, with or without modification,
 are permitted in any medium without royalty provided the copyright
@@ -225,7 +225,7 @@ order to use an ANSI C compiler:
 
 and if that doesn't work, install pre-built binaries of GCC for HP-UX.
 
-   HP-UX 'make' updates targets which have the same time stamps as their
+   HP-UX 'make' updates targets which have the same timestamps as their
 prerequisites, which makes it generally unusable when shipped generated
 files such as 'configure' are involved.  Use GNU 'make' instead.
 
index 9d294c2..d54ace4 100644 (file)
@@ -1,7 +1,7 @@
 ## Makefile.am - template for generating Makefile via Automake
 ##
-## Copyright (C) 2000-2001, 2003-2014, 2016 Free Software Foundation,
-## Inc.
+## Copyright (C) 2000-2001, 2003-2014, 2016-2017, 2020-2021 Free
+## Software Foundation, Inc.
 ##
 ## This file is part of GNU M4.
 ##
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 ##
 ## Written by Gary V. Vaughan <gary@gnu.org>
 
-SUBDIRS = . examples lib src doc checks tests
+SUBDIRS = . examples lib src doc checks po tests
 
 EXTRA_DIST = bootstrap c-boxes.el cfg.mk maint.mk \
        .prev-version .version m4/gnulib-cache.m4 ChangeLog-2014
index da287ce..746b38c 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -89,54 +89,69 @@ host_triplet = @host@
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
-       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
-       $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/__inline.m4 \
+       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/access.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/arpa_inet_h.m4 \
        $(top_srcdir)/m4/asm-underscore.m4 $(top_srcdir)/m4/assert.m4 \
        $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \
        $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \
-       $(top_srcdir)/m4/canonicalize.m4 \
-       $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
-       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
-       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
-       $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
-       $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirent_h.m4 \
-       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/canonicalize.m4 \
+       $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/clock_time.m4 \
+       $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closedir.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \
+       $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/creat.m4 \
+       $(top_srcdir)/m4/ctype_h.m4 $(top_srcdir)/m4/d-ino.m4 \
+       $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
        $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
-       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
-       $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \
-       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/execute.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eaccess.m4 \
+       $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+       $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+       $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/explicit_bzero.m4 \
        $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \
        $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \
        $(top_srcdir)/m4/extern-inline.m4 \
-       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fclose.m4 \
-       $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl.m4 \
-       $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopen.m4 \
+       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fchdir.m4 \
+       $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+       $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+       $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/fdopendir.m4 \
        $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/findprog-in.m4 $(top_srcdir)/m4/findprog.m4 \
        $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
        $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \
        $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fpurge.m4 \
        $(top_srcdir)/m4/freadahead.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/freopen.m4 \
        $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
        $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
-       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
-       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \
+       $(top_srcdir)/m4/ftell.m4 $(top_srcdir)/m4/ftello.m4 \
+       $(top_srcdir)/m4/ftruncate.m4 \
+       $(top_srcdir)/m4/getcwd-abort-bug.m4 \
+       $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
        $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
        $(top_srcdir)/m4/getpagesize.m4 \
-       $(top_srcdir)/m4/getprogname.m4 \
-       $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
+       $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/getrandom.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
        $(top_srcdir)/m4/gnulib-common.m4 \
        $(top_srcdir)/m4/gnulib-comp.m4 \
-       $(top_srcdir)/m4/hard-locale.m4 \
-       $(top_srcdir)/m4/include_next.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+       $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+       $(top_srcdir)/m4/inline.m4 \
+       $(top_srcdir)/m4/intl-thread-locale.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \
-       $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
-       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isblank.m4 \
-       $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
-       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/langinfo_h.m4 \
+       $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes.m4 \
+       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+       $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/isnand.m4 \
+       $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
+       $(top_srcdir)/m4/iswblank.m4 $(top_srcdir)/m4/iswdigit.m4 \
+       $(top_srcdir)/m4/iswxdigit.m4 $(top_srcdir)/m4/langinfo_h.m4 \
        $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lcmessage.m4 \
        $(top_srcdir)/m4/ldexp.m4 $(top_srcdir)/m4/ldexpl.m4 \
        $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
        $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+       $(top_srcdir)/m4/libunistring-base.m4 \
        $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/link.m4 \
        $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
        $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
@@ -146,61 +161,93 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
        $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
        $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \
+       $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
        $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
-       $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
-       $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/minmax.m4 \
+       $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+       $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
+       $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
+       $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkdir.m4 \
        $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \
        $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
        $(top_srcdir)/m4/msvc-inval.m4 \
        $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
-       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nocrash.m4 \
-       $(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/off_t.m4 \
-       $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/opendir.m4 \
-       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/pipe2.m4 \
-       $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/musl.m4 $(top_srcdir)/m4/nanosleep.m4 \
+       $(top_srcdir)/m4/netinet_in_h.m4 \
+       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/obstack.m4 \
+       $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/open-cloexec.m4 \
+       $(top_srcdir)/m4/open-slash.m4 $(top_srcdir)/m4/open.m4 \
+       $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/opendir.m4 \
+       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perror.m4 \
+       $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/pipe2.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/posix_spawn_faction_addchdir.m4 \
        $(top_srcdir)/m4/printf-frexp.m4 \
        $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \
-       $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quotearg.m4 \
-       $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+       $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/pthread-thread.m4 \
+       $(top_srcdir)/m4/pthread_h.m4 \
+       $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
+       $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \
+       $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/raise.m4 \
+       $(top_srcdir)/m4/rawmemchr.m4 $(top_srcdir)/m4/read-file.m4 \
        $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/readlink.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/reallocarray.m4 \
        $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
-       $(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/sched_h.m4 \
-       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/setenv.m4 \
-       $(top_srcdir)/m4/setlocale.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \
-       $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/rewinddir.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/sched_h.m4 \
+       $(top_srcdir)/m4/sched_yield.m4 \
+       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+       $(top_srcdir)/m4/semaphore.m4 $(top_srcdir)/m4/setenv.m4 \
+       $(top_srcdir)/m4/setlocale.m4 \
+       $(top_srcdir)/m4/setlocale_null.m4 \
+       $(top_srcdir)/m4/sh-filename.m4 \
+       $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/sigaltstack.m4 $(top_srcdir)/m4/signal_h.m4 \
        $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \
        $(top_srcdir)/m4/sigpipe.m4 $(top_srcdir)/m4/size_max.m4 \
        $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/snprintf.m4 \
-       $(top_srcdir)/m4/spawn-pipe.m4 $(top_srcdir)/m4/spawn_h.m4 \
-       $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \
+       $(top_srcdir)/m4/socketlib.m4 $(top_srcdir)/m4/sockets.m4 \
+       $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \
+       $(top_srcdir)/m4/sparcv8+.m4 $(top_srcdir)/m4/spawn-pipe.m4 \
+       $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/ssize_t.m4 \
+       $(top_srcdir)/m4/stack-direction.m4 \
+       $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
        $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
        $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
        $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
        $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
-       $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \
-       $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \
+       $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
        $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
        $(top_srcdir)/m4/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \
        $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/symlink.m4 \
+       $(top_srcdir)/m4/sys_ioctl_h.m4 \
+       $(top_srcdir)/m4/sys_random_h.m4 \
+       $(top_srcdir)/m4/sys_select_h.m4 \
        $(top_srcdir)/m4/sys_socket_h.m4 \
        $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
-       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \
-       $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+       $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+       $(top_srcdir)/m4/thread.m4 $(top_srcdir)/m4/threadlib.m4 \
        $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/tls.m4 \
        $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/ungetc.m4 \
        $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
        $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \
        $(top_srcdir)/m4/vasprintf-posix.m4 \
        $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+       $(top_srcdir)/m4/visibility.m4 \
        $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \
        $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/m4/wchar_h.m4 \
        $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wcrtomb.m4 \
        $(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
-       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
-       $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \
-       $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \
-       $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \
+       $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \
+       $(top_srcdir)/m4/yield.m4 $(top_srcdir)/m4/zzgnulib.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
@@ -245,7 +292,7 @@ am__recursive_targets = \
   $(RECURSIVE_CLEAN_TARGETS) \
   $(am__extra_recursive_targets)
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-       cscope distdir dist dist-all distcheck
+       cscope distdir distdir-am dist dist-all distcheck
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -267,14 +314,14 @@ ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/build-aux/ar-lib \
+am__DIST_COMMON = $(srcdir)/Makefile.in \
        $(top_srcdir)/build-aux/compile \
        $(top_srcdir)/build-aux/config.guess \
        $(top_srcdir)/build-aux/config.rpath \
        $(top_srcdir)/build-aux/config.sub \
        $(top_srcdir)/build-aux/install-sh \
-       $(top_srcdir)/build-aux/missing AUTHORS BACKLOG COPYING \
-       ChangeLog INSTALL NEWS README THANKS TODO build-aux/ar-lib \
+       $(top_srcdir)/build-aux/missing ABOUT-NLS AUTHORS BACKLOG \
+       COPYING ChangeLog INSTALL NEWS README THANKS TODO \
        build-aux/compile build-aux/config.guess \
        build-aux/config.rpath build-aux/config.sub build-aux/depcomp \
        build-aux/install-sh build-aux/mdate-sh build-aux/missing \
@@ -317,6 +364,8 @@ am__relativize = \
 DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 $(distdir).tar.xz
 GZIP_ENV = --best
 DIST_TARGETS = dist-xz dist-bzip2 dist-gzip
+# Exists only to be overridden by the user if desired.
+AM_DISTCHECK_DVI_TARGET = dvi
 distuninstallcheck_listfiles = find . -type f -print
 am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
   | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
@@ -343,6 +392,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CONFIG_INCLUDE = @CONFIG_INCLUDE@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
@@ -366,392 +416,519 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
 ERRNO_H = @ERRNO_H@
 EXEEXT = @EXEEXT@
 FLOAT_H = @FLOAT_H@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
 GETOPT_H = @GETOPT_H@
-GLIBC21 = @GLIBC21@
-GNULIB_ACOSF = @GNULIB_ACOSF@
-GNULIB_ACOSL = @GNULIB_ACOSL@
-GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
-GNULIB_ASINF = @GNULIB_ASINF@
-GNULIB_ASINL = @GNULIB_ASINL@
-GNULIB_ATAN2F = @GNULIB_ATAN2F@
-GNULIB_ATANF = @GNULIB_ATANF@
-GNULIB_ATANL = @GNULIB_ATANL@
-GNULIB_ATOLL = @GNULIB_ATOLL@
-GNULIB_BTOWC = @GNULIB_BTOWC@
-GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
-GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
-GNULIB_CBRT = @GNULIB_CBRT@
-GNULIB_CBRTF = @GNULIB_CBRTF@
-GNULIB_CBRTL = @GNULIB_CBRTL@
-GNULIB_CEIL = @GNULIB_CEIL@
-GNULIB_CEILF = @GNULIB_CEILF@
-GNULIB_CEILL = @GNULIB_CEILL@
-GNULIB_CHDIR = @GNULIB_CHDIR@
-GNULIB_CHOWN = @GNULIB_CHOWN@
-GNULIB_CLOSE = @GNULIB_CLOSE@
-GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
-GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
-GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
-GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
-GNULIB_COSF = @GNULIB_COSF@
-GNULIB_COSHF = @GNULIB_COSHF@
-GNULIB_COSL = @GNULIB_COSL@
-GNULIB_DIRFD = @GNULIB_DIRFD@
-GNULIB_DPRINTF = @GNULIB_DPRINTF@
-GNULIB_DUP = @GNULIB_DUP@
-GNULIB_DUP2 = @GNULIB_DUP2@
-GNULIB_DUP3 = @GNULIB_DUP3@
-GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
-GNULIB_ENVIRON = @GNULIB_ENVIRON@
-GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
-GNULIB_EXP2 = @GNULIB_EXP2@
-GNULIB_EXP2F = @GNULIB_EXP2F@
-GNULIB_EXP2L = @GNULIB_EXP2L@
-GNULIB_EXPF = @GNULIB_EXPF@
-GNULIB_EXPL = @GNULIB_EXPL@
-GNULIB_EXPM1 = @GNULIB_EXPM1@
-GNULIB_EXPM1F = @GNULIB_EXPM1F@
-GNULIB_EXPM1L = @GNULIB_EXPM1L@
-GNULIB_FABSF = @GNULIB_FABSF@
-GNULIB_FABSL = @GNULIB_FABSL@
-GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
-GNULIB_FCHDIR = @GNULIB_FCHDIR@
-GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
-GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
-GNULIB_FCLOSE = @GNULIB_FCLOSE@
-GNULIB_FCNTL = @GNULIB_FCNTL@
-GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
-GNULIB_FDOPEN = @GNULIB_FDOPEN@
-GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
-GNULIB_FFLUSH = @GNULIB_FFLUSH@
-GNULIB_FFSL = @GNULIB_FFSL@
-GNULIB_FFSLL = @GNULIB_FFSLL@
-GNULIB_FGETC = @GNULIB_FGETC@
-GNULIB_FGETS = @GNULIB_FGETS@
-GNULIB_FLOOR = @GNULIB_FLOOR@
-GNULIB_FLOORF = @GNULIB_FLOORF@
-GNULIB_FLOORL = @GNULIB_FLOORL@
-GNULIB_FMA = @GNULIB_FMA@
-GNULIB_FMAF = @GNULIB_FMAF@
-GNULIB_FMAL = @GNULIB_FMAL@
-GNULIB_FMOD = @GNULIB_FMOD@
-GNULIB_FMODF = @GNULIB_FMODF@
-GNULIB_FMODL = @GNULIB_FMODL@
-GNULIB_FOPEN = @GNULIB_FOPEN@
-GNULIB_FPRINTF = @GNULIB_FPRINTF@
-GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
-GNULIB_FPURGE = @GNULIB_FPURGE@
-GNULIB_FPUTC = @GNULIB_FPUTC@
-GNULIB_FPUTS = @GNULIB_FPUTS@
-GNULIB_FREAD = @GNULIB_FREAD@
-GNULIB_FREOPEN = @GNULIB_FREOPEN@
-GNULIB_FREXP = @GNULIB_FREXP@
-GNULIB_FREXPF = @GNULIB_FREXPF@
-GNULIB_FREXPL = @GNULIB_FREXPL@
-GNULIB_FSCANF = @GNULIB_FSCANF@
-GNULIB_FSEEK = @GNULIB_FSEEK@
-GNULIB_FSEEKO = @GNULIB_FSEEKO@
-GNULIB_FSTAT = @GNULIB_FSTAT@
-GNULIB_FSTATAT = @GNULIB_FSTATAT@
-GNULIB_FSYNC = @GNULIB_FSYNC@
-GNULIB_FTELL = @GNULIB_FTELL@
-GNULIB_FTELLO = @GNULIB_FTELLO@
-GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
-GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
-GNULIB_FWRITE = @GNULIB_FWRITE@
-GNULIB_GETC = @GNULIB_GETC@
-GNULIB_GETCHAR = @GNULIB_GETCHAR@
-GNULIB_GETCWD = @GNULIB_GETCWD@
-GNULIB_GETDELIM = @GNULIB_GETDELIM@
-GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
-GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
-GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
-GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
-GNULIB_GETLINE = @GNULIB_GETLINE@
-GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
-GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
-GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
-GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
-GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_M4_GNULIB_ACCEPT = @GL_M4_GNULIB_ACCEPT@
+GL_M4_GNULIB_ACCEPT4 = @GL_M4_GNULIB_ACCEPT4@
+GL_M4_GNULIB_ACCESS = @GL_M4_GNULIB_ACCESS@
+GL_M4_GNULIB_ACOSF = @GL_M4_GNULIB_ACOSF@
+GL_M4_GNULIB_ACOSL = @GL_M4_GNULIB_ACOSL@
+GL_M4_GNULIB_ALIGNED_ALLOC = @GL_M4_GNULIB_ALIGNED_ALLOC@
+GL_M4_GNULIB_ALPHASORT = @GL_M4_GNULIB_ALPHASORT@
+GL_M4_GNULIB_ASINF = @GL_M4_GNULIB_ASINF@
+GL_M4_GNULIB_ASINL = @GL_M4_GNULIB_ASINL@
+GL_M4_GNULIB_ATAN2F = @GL_M4_GNULIB_ATAN2F@
+GL_M4_GNULIB_ATANF = @GL_M4_GNULIB_ATANF@
+GL_M4_GNULIB_ATANL = @GL_M4_GNULIB_ATANL@
+GL_M4_GNULIB_ATOLL = @GL_M4_GNULIB_ATOLL@
+GL_M4_GNULIB_BIND = @GL_M4_GNULIB_BIND@
+GL_M4_GNULIB_BTOWC = @GL_M4_GNULIB_BTOWC@
+GL_M4_GNULIB_CALLOC_POSIX = @GL_M4_GNULIB_CALLOC_POSIX@
+GL_M4_GNULIB_CANONICALIZE_FILE_NAME = @GL_M4_GNULIB_CANONICALIZE_FILE_NAME@
+GL_M4_GNULIB_CBRT = @GL_M4_GNULIB_CBRT@
+GL_M4_GNULIB_CBRTF = @GL_M4_GNULIB_CBRTF@
+GL_M4_GNULIB_CBRTL = @GL_M4_GNULIB_CBRTL@
+GL_M4_GNULIB_CEIL = @GL_M4_GNULIB_CEIL@
+GL_M4_GNULIB_CEILF = @GL_M4_GNULIB_CEILF@
+GL_M4_GNULIB_CEILL = @GL_M4_GNULIB_CEILL@
+GL_M4_GNULIB_CHDIR = @GL_M4_GNULIB_CHDIR@
+GL_M4_GNULIB_CHOWN = @GL_M4_GNULIB_CHOWN@
+GL_M4_GNULIB_CLOSE = @GL_M4_GNULIB_CLOSE@
+GL_M4_GNULIB_CLOSEDIR = @GL_M4_GNULIB_CLOSEDIR@
+GL_M4_GNULIB_CONNECT = @GL_M4_GNULIB_CONNECT@
+GL_M4_GNULIB_COPYSIGN = @GL_M4_GNULIB_COPYSIGN@
+GL_M4_GNULIB_COPYSIGNF = @GL_M4_GNULIB_COPYSIGNF@
+GL_M4_GNULIB_COPYSIGNL = @GL_M4_GNULIB_COPYSIGNL@
+GL_M4_GNULIB_COPY_FILE_RANGE = @GL_M4_GNULIB_COPY_FILE_RANGE@
+GL_M4_GNULIB_COSF = @GL_M4_GNULIB_COSF@
+GL_M4_GNULIB_COSHF = @GL_M4_GNULIB_COSHF@
+GL_M4_GNULIB_COSL = @GL_M4_GNULIB_COSL@
+GL_M4_GNULIB_CREAT = @GL_M4_GNULIB_CREAT@
+GL_M4_GNULIB_CTIME = @GL_M4_GNULIB_CTIME@
+GL_M4_GNULIB_DIRFD = @GL_M4_GNULIB_DIRFD@
+GL_M4_GNULIB_DPRINTF = @GL_M4_GNULIB_DPRINTF@
+GL_M4_GNULIB_DUP = @GL_M4_GNULIB_DUP@
+GL_M4_GNULIB_DUP2 = @GL_M4_GNULIB_DUP2@
+GL_M4_GNULIB_DUP3 = @GL_M4_GNULIB_DUP3@
+GL_M4_GNULIB_DUPLOCALE = @GL_M4_GNULIB_DUPLOCALE@
+GL_M4_GNULIB_ENVIRON = @GL_M4_GNULIB_ENVIRON@
+GL_M4_GNULIB_EUIDACCESS = @GL_M4_GNULIB_EUIDACCESS@
+GL_M4_GNULIB_EXECL = @GL_M4_GNULIB_EXECL@
+GL_M4_GNULIB_EXECLE = @GL_M4_GNULIB_EXECLE@
+GL_M4_GNULIB_EXECLP = @GL_M4_GNULIB_EXECLP@
+GL_M4_GNULIB_EXECV = @GL_M4_GNULIB_EXECV@
+GL_M4_GNULIB_EXECVE = @GL_M4_GNULIB_EXECVE@
+GL_M4_GNULIB_EXECVP = @GL_M4_GNULIB_EXECVP@
+GL_M4_GNULIB_EXECVPE = @GL_M4_GNULIB_EXECVPE@
+GL_M4_GNULIB_EXP2 = @GL_M4_GNULIB_EXP2@
+GL_M4_GNULIB_EXP2F = @GL_M4_GNULIB_EXP2F@
+GL_M4_GNULIB_EXP2L = @GL_M4_GNULIB_EXP2L@
+GL_M4_GNULIB_EXPF = @GL_M4_GNULIB_EXPF@
+GL_M4_GNULIB_EXPL = @GL_M4_GNULIB_EXPL@
+GL_M4_GNULIB_EXPLICIT_BZERO = @GL_M4_GNULIB_EXPLICIT_BZERO@
+GL_M4_GNULIB_EXPM1 = @GL_M4_GNULIB_EXPM1@
+GL_M4_GNULIB_EXPM1F = @GL_M4_GNULIB_EXPM1F@
+GL_M4_GNULIB_EXPM1L = @GL_M4_GNULIB_EXPM1L@
+GL_M4_GNULIB_FABSF = @GL_M4_GNULIB_FABSF@
+GL_M4_GNULIB_FABSL = @GL_M4_GNULIB_FABSL@
+GL_M4_GNULIB_FACCESSAT = @GL_M4_GNULIB_FACCESSAT@
+GL_M4_GNULIB_FCHDIR = @GL_M4_GNULIB_FCHDIR@
+GL_M4_GNULIB_FCHMODAT = @GL_M4_GNULIB_FCHMODAT@
+GL_M4_GNULIB_FCHOWNAT = @GL_M4_GNULIB_FCHOWNAT@
+GL_M4_GNULIB_FCLOSE = @GL_M4_GNULIB_FCLOSE@
+GL_M4_GNULIB_FCNTL = @GL_M4_GNULIB_FCNTL@
+GL_M4_GNULIB_FDATASYNC = @GL_M4_GNULIB_FDATASYNC@
+GL_M4_GNULIB_FDOPEN = @GL_M4_GNULIB_FDOPEN@
+GL_M4_GNULIB_FDOPENDIR = @GL_M4_GNULIB_FDOPENDIR@
+GL_M4_GNULIB_FFLUSH = @GL_M4_GNULIB_FFLUSH@
+GL_M4_GNULIB_FFSL = @GL_M4_GNULIB_FFSL@
+GL_M4_GNULIB_FFSLL = @GL_M4_GNULIB_FFSLL@
+GL_M4_GNULIB_FGETC = @GL_M4_GNULIB_FGETC@
+GL_M4_GNULIB_FGETS = @GL_M4_GNULIB_FGETS@
+GL_M4_GNULIB_FLOOR = @GL_M4_GNULIB_FLOOR@
+GL_M4_GNULIB_FLOORF = @GL_M4_GNULIB_FLOORF@
+GL_M4_GNULIB_FLOORL = @GL_M4_GNULIB_FLOORL@
+GL_M4_GNULIB_FMA = @GL_M4_GNULIB_FMA@
+GL_M4_GNULIB_FMAF = @GL_M4_GNULIB_FMAF@
+GL_M4_GNULIB_FMAL = @GL_M4_GNULIB_FMAL@
+GL_M4_GNULIB_FMOD = @GL_M4_GNULIB_FMOD@
+GL_M4_GNULIB_FMODF = @GL_M4_GNULIB_FMODF@
+GL_M4_GNULIB_FMODL = @GL_M4_GNULIB_FMODL@
+GL_M4_GNULIB_FOPEN = @GL_M4_GNULIB_FOPEN@
+GL_M4_GNULIB_FPRINTF = @GL_M4_GNULIB_FPRINTF@
+GL_M4_GNULIB_FPRINTF_POSIX = @GL_M4_GNULIB_FPRINTF_POSIX@
+GL_M4_GNULIB_FPURGE = @GL_M4_GNULIB_FPURGE@
+GL_M4_GNULIB_FPUTC = @GL_M4_GNULIB_FPUTC@
+GL_M4_GNULIB_FPUTS = @GL_M4_GNULIB_FPUTS@
+GL_M4_GNULIB_FREAD = @GL_M4_GNULIB_FREAD@
+GL_M4_GNULIB_FREE_POSIX = @GL_M4_GNULIB_FREE_POSIX@
+GL_M4_GNULIB_FREOPEN = @GL_M4_GNULIB_FREOPEN@
+GL_M4_GNULIB_FREXP = @GL_M4_GNULIB_FREXP@
+GL_M4_GNULIB_FREXPF = @GL_M4_GNULIB_FREXPF@
+GL_M4_GNULIB_FREXPL = @GL_M4_GNULIB_FREXPL@
+GL_M4_GNULIB_FSCANF = @GL_M4_GNULIB_FSCANF@
+GL_M4_GNULIB_FSEEK = @GL_M4_GNULIB_FSEEK@
+GL_M4_GNULIB_FSEEKO = @GL_M4_GNULIB_FSEEKO@
+GL_M4_GNULIB_FSTAT = @GL_M4_GNULIB_FSTAT@
+GL_M4_GNULIB_FSTATAT = @GL_M4_GNULIB_FSTATAT@
+GL_M4_GNULIB_FSYNC = @GL_M4_GNULIB_FSYNC@
+GL_M4_GNULIB_FTELL = @GL_M4_GNULIB_FTELL@
+GL_M4_GNULIB_FTELLO = @GL_M4_GNULIB_FTELLO@
+GL_M4_GNULIB_FTRUNCATE = @GL_M4_GNULIB_FTRUNCATE@
+GL_M4_GNULIB_FUTIMENS = @GL_M4_GNULIB_FUTIMENS@
+GL_M4_GNULIB_FWRITE = @GL_M4_GNULIB_FWRITE@
+GL_M4_GNULIB_GETC = @GL_M4_GNULIB_GETC@
+GL_M4_GNULIB_GETCHAR = @GL_M4_GNULIB_GETCHAR@
+GL_M4_GNULIB_GETCWD = @GL_M4_GNULIB_GETCWD@
+GL_M4_GNULIB_GETDELIM = @GL_M4_GNULIB_GETDELIM@
+GL_M4_GNULIB_GETDOMAINNAME = @GL_M4_GNULIB_GETDOMAINNAME@
+GL_M4_GNULIB_GETDTABLESIZE = @GL_M4_GNULIB_GETDTABLESIZE@
+GL_M4_GNULIB_GETENTROPY = @GL_M4_GNULIB_GETENTROPY@
+GL_M4_GNULIB_GETGROUPS = @GL_M4_GNULIB_GETGROUPS@
+GL_M4_GNULIB_GETHOSTNAME = @GL_M4_GNULIB_GETHOSTNAME@
+GL_M4_GNULIB_GETLINE = @GL_M4_GNULIB_GETLINE@
+GL_M4_GNULIB_GETLOADAVG = @GL_M4_GNULIB_GETLOADAVG@
+GL_M4_GNULIB_GETLOGIN = @GL_M4_GNULIB_GETLOGIN@
+GL_M4_GNULIB_GETLOGIN_R = @GL_M4_GNULIB_GETLOGIN_R@
+GL_M4_GNULIB_GETOPT_POSIX = @GL_M4_GNULIB_GETOPT_POSIX@
+GL_M4_GNULIB_GETPAGESIZE = @GL_M4_GNULIB_GETPAGESIZE@
+GL_M4_GNULIB_GETPASS = @GL_M4_GNULIB_GETPASS@
+GL_M4_GNULIB_GETPEERNAME = @GL_M4_GNULIB_GETPEERNAME@
+GL_M4_GNULIB_GETRANDOM = @GL_M4_GNULIB_GETRANDOM@
+GL_M4_GNULIB_GETSOCKNAME = @GL_M4_GNULIB_GETSOCKNAME@
+GL_M4_GNULIB_GETSOCKOPT = @GL_M4_GNULIB_GETSOCKOPT@
+GL_M4_GNULIB_GETSUBOPT = @GL_M4_GNULIB_GETSUBOPT@
+GL_M4_GNULIB_GETTIMEOFDAY = @GL_M4_GNULIB_GETTIMEOFDAY@
+GL_M4_GNULIB_GETUMASK = @GL_M4_GNULIB_GETUMASK@
+GL_M4_GNULIB_GETUSERSHELL = @GL_M4_GNULIB_GETUSERSHELL@
+GL_M4_GNULIB_GRANTPT = @GL_M4_GNULIB_GRANTPT@
+GL_M4_GNULIB_GROUP_MEMBER = @GL_M4_GNULIB_GROUP_MEMBER@
+GL_M4_GNULIB_HYPOT = @GL_M4_GNULIB_HYPOT@
+GL_M4_GNULIB_HYPOTF = @GL_M4_GNULIB_HYPOTF@
+GL_M4_GNULIB_HYPOTL = @GL_M4_GNULIB_HYPOTL@
+GL_M4_GNULIB_ICONV = @GL_M4_GNULIB_ICONV@
+GL_M4_GNULIB_ILOGB = @GL_M4_GNULIB_ILOGB@
+GL_M4_GNULIB_ILOGBF = @GL_M4_GNULIB_ILOGBF@
+GL_M4_GNULIB_ILOGBL = @GL_M4_GNULIB_ILOGBL@
+GL_M4_GNULIB_IMAXABS = @GL_M4_GNULIB_IMAXABS@
+GL_M4_GNULIB_IMAXDIV = @GL_M4_GNULIB_IMAXDIV@
+GL_M4_GNULIB_INET_NTOP = @GL_M4_GNULIB_INET_NTOP@
+GL_M4_GNULIB_INET_PTON = @GL_M4_GNULIB_INET_PTON@
+GL_M4_GNULIB_IOCTL = @GL_M4_GNULIB_IOCTL@
+GL_M4_GNULIB_ISATTY = @GL_M4_GNULIB_ISATTY@
+GL_M4_GNULIB_ISBLANK = @GL_M4_GNULIB_ISBLANK@
+GL_M4_GNULIB_ISFINITE = @GL_M4_GNULIB_ISFINITE@
+GL_M4_GNULIB_ISINF = @GL_M4_GNULIB_ISINF@
+GL_M4_GNULIB_ISNAN = @GL_M4_GNULIB_ISNAN@
+GL_M4_GNULIB_ISNAND = @GL_M4_GNULIB_ISNAND@
+GL_M4_GNULIB_ISNANF = @GL_M4_GNULIB_ISNANF@
+GL_M4_GNULIB_ISNANL = @GL_M4_GNULIB_ISNANL@
+GL_M4_GNULIB_ISWBLANK = @GL_M4_GNULIB_ISWBLANK@
+GL_M4_GNULIB_ISWCTYPE = @GL_M4_GNULIB_ISWCTYPE@
+GL_M4_GNULIB_ISWDIGIT = @GL_M4_GNULIB_ISWDIGIT@
+GL_M4_GNULIB_ISWXDIGIT = @GL_M4_GNULIB_ISWXDIGIT@
+GL_M4_GNULIB_LCHMOD = @GL_M4_GNULIB_LCHMOD@
+GL_M4_GNULIB_LCHOWN = @GL_M4_GNULIB_LCHOWN@
+GL_M4_GNULIB_LDEXPF = @GL_M4_GNULIB_LDEXPF@
+GL_M4_GNULIB_LDEXPL = @GL_M4_GNULIB_LDEXPL@
+GL_M4_GNULIB_LINK = @GL_M4_GNULIB_LINK@
+GL_M4_GNULIB_LINKAT = @GL_M4_GNULIB_LINKAT@
+GL_M4_GNULIB_LISTEN = @GL_M4_GNULIB_LISTEN@
+GL_M4_GNULIB_LOCALECONV = @GL_M4_GNULIB_LOCALECONV@
+GL_M4_GNULIB_LOCALENAME = @GL_M4_GNULIB_LOCALENAME@
+GL_M4_GNULIB_LOCALTIME = @GL_M4_GNULIB_LOCALTIME@
+GL_M4_GNULIB_LOG = @GL_M4_GNULIB_LOG@
+GL_M4_GNULIB_LOG10 = @GL_M4_GNULIB_LOG10@
+GL_M4_GNULIB_LOG10F = @GL_M4_GNULIB_LOG10F@
+GL_M4_GNULIB_LOG10L = @GL_M4_GNULIB_LOG10L@
+GL_M4_GNULIB_LOG1P = @GL_M4_GNULIB_LOG1P@
+GL_M4_GNULIB_LOG1PF = @GL_M4_GNULIB_LOG1PF@
+GL_M4_GNULIB_LOG1PL = @GL_M4_GNULIB_LOG1PL@
+GL_M4_GNULIB_LOG2 = @GL_M4_GNULIB_LOG2@
+GL_M4_GNULIB_LOG2F = @GL_M4_GNULIB_LOG2F@
+GL_M4_GNULIB_LOG2L = @GL_M4_GNULIB_LOG2L@
+GL_M4_GNULIB_LOGB = @GL_M4_GNULIB_LOGB@
+GL_M4_GNULIB_LOGBF = @GL_M4_GNULIB_LOGBF@
+GL_M4_GNULIB_LOGBL = @GL_M4_GNULIB_LOGBL@
+GL_M4_GNULIB_LOGF = @GL_M4_GNULIB_LOGF@
+GL_M4_GNULIB_LOGL = @GL_M4_GNULIB_LOGL@
+GL_M4_GNULIB_LSEEK = @GL_M4_GNULIB_LSEEK@
+GL_M4_GNULIB_LSTAT = @GL_M4_GNULIB_LSTAT@
+GL_M4_GNULIB_MALLOC_POSIX = @GL_M4_GNULIB_MALLOC_POSIX@
+GL_M4_GNULIB_MBRLEN = @GL_M4_GNULIB_MBRLEN@
+GL_M4_GNULIB_MBRTOWC = @GL_M4_GNULIB_MBRTOWC@
+GL_M4_GNULIB_MBSCASECMP = @GL_M4_GNULIB_MBSCASECMP@
+GL_M4_GNULIB_MBSCASESTR = @GL_M4_GNULIB_MBSCASESTR@
+GL_M4_GNULIB_MBSCHR = @GL_M4_GNULIB_MBSCHR@
+GL_M4_GNULIB_MBSCSPN = @GL_M4_GNULIB_MBSCSPN@
+GL_M4_GNULIB_MBSINIT = @GL_M4_GNULIB_MBSINIT@
+GL_M4_GNULIB_MBSLEN = @GL_M4_GNULIB_MBSLEN@
+GL_M4_GNULIB_MBSNCASECMP = @GL_M4_GNULIB_MBSNCASECMP@
+GL_M4_GNULIB_MBSNLEN = @GL_M4_GNULIB_MBSNLEN@
+GL_M4_GNULIB_MBSNRTOWCS = @GL_M4_GNULIB_MBSNRTOWCS@
+GL_M4_GNULIB_MBSPBRK = @GL_M4_GNULIB_MBSPBRK@
+GL_M4_GNULIB_MBSPCASECMP = @GL_M4_GNULIB_MBSPCASECMP@
+GL_M4_GNULIB_MBSRCHR = @GL_M4_GNULIB_MBSRCHR@
+GL_M4_GNULIB_MBSRTOWCS = @GL_M4_GNULIB_MBSRTOWCS@
+GL_M4_GNULIB_MBSSEP = @GL_M4_GNULIB_MBSSEP@
+GL_M4_GNULIB_MBSSPN = @GL_M4_GNULIB_MBSSPN@
+GL_M4_GNULIB_MBSSTR = @GL_M4_GNULIB_MBSSTR@
+GL_M4_GNULIB_MBSTOK_R = @GL_M4_GNULIB_MBSTOK_R@
+GL_M4_GNULIB_MBTOWC = @GL_M4_GNULIB_MBTOWC@
+GL_M4_GNULIB_MDA_ACCESS = @GL_M4_GNULIB_MDA_ACCESS@
+GL_M4_GNULIB_MDA_CHDIR = @GL_M4_GNULIB_MDA_CHDIR@
+GL_M4_GNULIB_MDA_CHMOD = @GL_M4_GNULIB_MDA_CHMOD@
+GL_M4_GNULIB_MDA_CLOSE = @GL_M4_GNULIB_MDA_CLOSE@
+GL_M4_GNULIB_MDA_CREAT = @GL_M4_GNULIB_MDA_CREAT@
+GL_M4_GNULIB_MDA_DUP = @GL_M4_GNULIB_MDA_DUP@
+GL_M4_GNULIB_MDA_DUP2 = @GL_M4_GNULIB_MDA_DUP2@
+GL_M4_GNULIB_MDA_ECVT = @GL_M4_GNULIB_MDA_ECVT@
+GL_M4_GNULIB_MDA_EXECL = @GL_M4_GNULIB_MDA_EXECL@
+GL_M4_GNULIB_MDA_EXECLE = @GL_M4_GNULIB_MDA_EXECLE@
+GL_M4_GNULIB_MDA_EXECLP = @GL_M4_GNULIB_MDA_EXECLP@
+GL_M4_GNULIB_MDA_EXECV = @GL_M4_GNULIB_MDA_EXECV@
+GL_M4_GNULIB_MDA_EXECVE = @GL_M4_GNULIB_MDA_EXECVE@
+GL_M4_GNULIB_MDA_EXECVP = @GL_M4_GNULIB_MDA_EXECVP@
+GL_M4_GNULIB_MDA_EXECVPE = @GL_M4_GNULIB_MDA_EXECVPE@
+GL_M4_GNULIB_MDA_FCLOSEALL = @GL_M4_GNULIB_MDA_FCLOSEALL@
+GL_M4_GNULIB_MDA_FCVT = @GL_M4_GNULIB_MDA_FCVT@
+GL_M4_GNULIB_MDA_FDOPEN = @GL_M4_GNULIB_MDA_FDOPEN@
+GL_M4_GNULIB_MDA_FILENO = @GL_M4_GNULIB_MDA_FILENO@
+GL_M4_GNULIB_MDA_GCVT = @GL_M4_GNULIB_MDA_GCVT@
+GL_M4_GNULIB_MDA_GETCWD = @GL_M4_GNULIB_MDA_GETCWD@
+GL_M4_GNULIB_MDA_GETPID = @GL_M4_GNULIB_MDA_GETPID@
+GL_M4_GNULIB_MDA_GETW = @GL_M4_GNULIB_MDA_GETW@
+GL_M4_GNULIB_MDA_ISATTY = @GL_M4_GNULIB_MDA_ISATTY@
+GL_M4_GNULIB_MDA_J0 = @GL_M4_GNULIB_MDA_J0@
+GL_M4_GNULIB_MDA_J1 = @GL_M4_GNULIB_MDA_J1@
+GL_M4_GNULIB_MDA_JN = @GL_M4_GNULIB_MDA_JN@
+GL_M4_GNULIB_MDA_LSEEK = @GL_M4_GNULIB_MDA_LSEEK@
+GL_M4_GNULIB_MDA_MEMCCPY = @GL_M4_GNULIB_MDA_MEMCCPY@
+GL_M4_GNULIB_MDA_MKDIR = @GL_M4_GNULIB_MDA_MKDIR@
+GL_M4_GNULIB_MDA_MKTEMP = @GL_M4_GNULIB_MDA_MKTEMP@
+GL_M4_GNULIB_MDA_OPEN = @GL_M4_GNULIB_MDA_OPEN@
+GL_M4_GNULIB_MDA_PUTENV = @GL_M4_GNULIB_MDA_PUTENV@
+GL_M4_GNULIB_MDA_PUTW = @GL_M4_GNULIB_MDA_PUTW@
+GL_M4_GNULIB_MDA_READ = @GL_M4_GNULIB_MDA_READ@
+GL_M4_GNULIB_MDA_RMDIR = @GL_M4_GNULIB_MDA_RMDIR@
+GL_M4_GNULIB_MDA_STRDUP = @GL_M4_GNULIB_MDA_STRDUP@
+GL_M4_GNULIB_MDA_SWAB = @GL_M4_GNULIB_MDA_SWAB@
+GL_M4_GNULIB_MDA_TEMPNAM = @GL_M4_GNULIB_MDA_TEMPNAM@
+GL_M4_GNULIB_MDA_TZSET = @GL_M4_GNULIB_MDA_TZSET@
+GL_M4_GNULIB_MDA_UMASK = @GL_M4_GNULIB_MDA_UMASK@
+GL_M4_GNULIB_MDA_UNLINK = @GL_M4_GNULIB_MDA_UNLINK@
+GL_M4_GNULIB_MDA_WCSDUP = @GL_M4_GNULIB_MDA_WCSDUP@
+GL_M4_GNULIB_MDA_WRITE = @GL_M4_GNULIB_MDA_WRITE@
+GL_M4_GNULIB_MDA_Y0 = @GL_M4_GNULIB_MDA_Y0@
+GL_M4_GNULIB_MDA_Y1 = @GL_M4_GNULIB_MDA_Y1@
+GL_M4_GNULIB_MDA_YN = @GL_M4_GNULIB_MDA_YN@
+GL_M4_GNULIB_MEMCHR = @GL_M4_GNULIB_MEMCHR@
+GL_M4_GNULIB_MEMMEM = @GL_M4_GNULIB_MEMMEM@
+GL_M4_GNULIB_MEMPCPY = @GL_M4_GNULIB_MEMPCPY@
+GL_M4_GNULIB_MEMRCHR = @GL_M4_GNULIB_MEMRCHR@
+GL_M4_GNULIB_MKDIR = @GL_M4_GNULIB_MKDIR@
+GL_M4_GNULIB_MKDIRAT = @GL_M4_GNULIB_MKDIRAT@
+GL_M4_GNULIB_MKDTEMP = @GL_M4_GNULIB_MKDTEMP@
+GL_M4_GNULIB_MKFIFO = @GL_M4_GNULIB_MKFIFO@
+GL_M4_GNULIB_MKFIFOAT = @GL_M4_GNULIB_MKFIFOAT@
+GL_M4_GNULIB_MKNOD = @GL_M4_GNULIB_MKNOD@
+GL_M4_GNULIB_MKNODAT = @GL_M4_GNULIB_MKNODAT@
+GL_M4_GNULIB_MKOSTEMP = @GL_M4_GNULIB_MKOSTEMP@
+GL_M4_GNULIB_MKOSTEMPS = @GL_M4_GNULIB_MKOSTEMPS@
+GL_M4_GNULIB_MKSTEMP = @GL_M4_GNULIB_MKSTEMP@
+GL_M4_GNULIB_MKSTEMPS = @GL_M4_GNULIB_MKSTEMPS@
+GL_M4_GNULIB_MKTIME = @GL_M4_GNULIB_MKTIME@
+GL_M4_GNULIB_MODF = @GL_M4_GNULIB_MODF@
+GL_M4_GNULIB_MODFF = @GL_M4_GNULIB_MODFF@
+GL_M4_GNULIB_MODFL = @GL_M4_GNULIB_MODFL@
+GL_M4_GNULIB_NANOSLEEP = @GL_M4_GNULIB_NANOSLEEP@
+GL_M4_GNULIB_NL_LANGINFO = @GL_M4_GNULIB_NL_LANGINFO@
+GL_M4_GNULIB_NONBLOCKING = @GL_M4_GNULIB_NONBLOCKING@
+GL_M4_GNULIB_OBSTACK_PRINTF = @GL_M4_GNULIB_OBSTACK_PRINTF@
+GL_M4_GNULIB_OBSTACK_PRINTF_POSIX = @GL_M4_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_M4_GNULIB_OPEN = @GL_M4_GNULIB_OPEN@
+GL_M4_GNULIB_OPENAT = @GL_M4_GNULIB_OPENAT@
+GL_M4_GNULIB_OPENDIR = @GL_M4_GNULIB_OPENDIR@
+GL_M4_GNULIB_OVERRIDES_STRUCT_STAT = @GL_M4_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_M4_GNULIB_PCLOSE = @GL_M4_GNULIB_PCLOSE@
+GL_M4_GNULIB_PERROR = @GL_M4_GNULIB_PERROR@
+GL_M4_GNULIB_PIPE = @GL_M4_GNULIB_PIPE@
+GL_M4_GNULIB_PIPE2 = @GL_M4_GNULIB_PIPE2@
+GL_M4_GNULIB_POPEN = @GL_M4_GNULIB_POPEN@
+GL_M4_GNULIB_POSIX_MEMALIGN = @GL_M4_GNULIB_POSIX_MEMALIGN@
+GL_M4_GNULIB_POSIX_OPENPT = @GL_M4_GNULIB_POSIX_OPENPT@
+GL_M4_GNULIB_POSIX_SPAWN = @GL_M4_GNULIB_POSIX_SPAWN@
+GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY = @GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNATTR_INIT = @GL_M4_GNULIB_POSIX_SPAWNATTR_INIT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNP = @GL_M4_GNULIB_POSIX_SPAWNP@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
+GL_M4_GNULIB_POWF = @GL_M4_GNULIB_POWF@
+GL_M4_GNULIB_PREAD = @GL_M4_GNULIB_PREAD@
+GL_M4_GNULIB_PRINTF = @GL_M4_GNULIB_PRINTF@
+GL_M4_GNULIB_PRINTF_POSIX = @GL_M4_GNULIB_PRINTF_POSIX@
+GL_M4_GNULIB_PSELECT = @GL_M4_GNULIB_PSELECT@
+GL_M4_GNULIB_PTHREAD_COND = @GL_M4_GNULIB_PTHREAD_COND@
+GL_M4_GNULIB_PTHREAD_MUTEX = @GL_M4_GNULIB_PTHREAD_MUTEX@
+GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK = @GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK@
+GL_M4_GNULIB_PTHREAD_ONCE = @GL_M4_GNULIB_PTHREAD_ONCE@
+GL_M4_GNULIB_PTHREAD_RWLOCK = @GL_M4_GNULIB_PTHREAD_RWLOCK@
+GL_M4_GNULIB_PTHREAD_SIGMASK = @GL_M4_GNULIB_PTHREAD_SIGMASK@
+GL_M4_GNULIB_PTHREAD_SPIN = @GL_M4_GNULIB_PTHREAD_SPIN@
+GL_M4_GNULIB_PTHREAD_THREAD = @GL_M4_GNULIB_PTHREAD_THREAD@
+GL_M4_GNULIB_PTHREAD_TSS = @GL_M4_GNULIB_PTHREAD_TSS@
+GL_M4_GNULIB_PTSNAME = @GL_M4_GNULIB_PTSNAME@
+GL_M4_GNULIB_PTSNAME_R = @GL_M4_GNULIB_PTSNAME_R@
+GL_M4_GNULIB_PUTC = @GL_M4_GNULIB_PUTC@
+GL_M4_GNULIB_PUTCHAR = @GL_M4_GNULIB_PUTCHAR@
+GL_M4_GNULIB_PUTENV = @GL_M4_GNULIB_PUTENV@
+GL_M4_GNULIB_PUTS = @GL_M4_GNULIB_PUTS@
+GL_M4_GNULIB_PWRITE = @GL_M4_GNULIB_PWRITE@
+GL_M4_GNULIB_QSORT_R = @GL_M4_GNULIB_QSORT_R@
+GL_M4_GNULIB_RAISE = @GL_M4_GNULIB_RAISE@
+GL_M4_GNULIB_RANDOM = @GL_M4_GNULIB_RANDOM@
+GL_M4_GNULIB_RANDOM_R = @GL_M4_GNULIB_RANDOM_R@
+GL_M4_GNULIB_RAWMEMCHR = @GL_M4_GNULIB_RAWMEMCHR@
+GL_M4_GNULIB_READ = @GL_M4_GNULIB_READ@
+GL_M4_GNULIB_READDIR = @GL_M4_GNULIB_READDIR@
+GL_M4_GNULIB_READLINK = @GL_M4_GNULIB_READLINK@
+GL_M4_GNULIB_READLINKAT = @GL_M4_GNULIB_READLINKAT@
+GL_M4_GNULIB_REALLOCARRAY = @GL_M4_GNULIB_REALLOCARRAY@
+GL_M4_GNULIB_REALLOC_POSIX = @GL_M4_GNULIB_REALLOC_POSIX@
+GL_M4_GNULIB_REALPATH = @GL_M4_GNULIB_REALPATH@
+GL_M4_GNULIB_RECV = @GL_M4_GNULIB_RECV@
+GL_M4_GNULIB_RECVFROM = @GL_M4_GNULIB_RECVFROM@
+GL_M4_GNULIB_REMAINDER = @GL_M4_GNULIB_REMAINDER@
+GL_M4_GNULIB_REMAINDERF = @GL_M4_GNULIB_REMAINDERF@
+GL_M4_GNULIB_REMAINDERL = @GL_M4_GNULIB_REMAINDERL@
+GL_M4_GNULIB_REMOVE = @GL_M4_GNULIB_REMOVE@
+GL_M4_GNULIB_RENAME = @GL_M4_GNULIB_RENAME@
+GL_M4_GNULIB_RENAMEAT = @GL_M4_GNULIB_RENAMEAT@
+GL_M4_GNULIB_REWINDDIR = @GL_M4_GNULIB_REWINDDIR@
+GL_M4_GNULIB_RINT = @GL_M4_GNULIB_RINT@
+GL_M4_GNULIB_RINTF = @GL_M4_GNULIB_RINTF@
+GL_M4_GNULIB_RINTL = @GL_M4_GNULIB_RINTL@
+GL_M4_GNULIB_RMDIR = @GL_M4_GNULIB_RMDIR@
+GL_M4_GNULIB_ROUND = @GL_M4_GNULIB_ROUND@
+GL_M4_GNULIB_ROUNDF = @GL_M4_GNULIB_ROUNDF@
+GL_M4_GNULIB_ROUNDL = @GL_M4_GNULIB_ROUNDL@
+GL_M4_GNULIB_RPMATCH = @GL_M4_GNULIB_RPMATCH@
+GL_M4_GNULIB_SCANDIR = @GL_M4_GNULIB_SCANDIR@
+GL_M4_GNULIB_SCANF = @GL_M4_GNULIB_SCANF@
+GL_M4_GNULIB_SCHED_YIELD = @GL_M4_GNULIB_SCHED_YIELD@
+GL_M4_GNULIB_SECURE_GETENV = @GL_M4_GNULIB_SECURE_GETENV@
+GL_M4_GNULIB_SELECT = @GL_M4_GNULIB_SELECT@
+GL_M4_GNULIB_SEND = @GL_M4_GNULIB_SEND@
+GL_M4_GNULIB_SENDTO = @GL_M4_GNULIB_SENDTO@
+GL_M4_GNULIB_SETENV = @GL_M4_GNULIB_SETENV@
+GL_M4_GNULIB_SETHOSTNAME = @GL_M4_GNULIB_SETHOSTNAME@
+GL_M4_GNULIB_SETLOCALE = @GL_M4_GNULIB_SETLOCALE@
+GL_M4_GNULIB_SETLOCALE_NULL = @GL_M4_GNULIB_SETLOCALE_NULL@
+GL_M4_GNULIB_SETSOCKOPT = @GL_M4_GNULIB_SETSOCKOPT@
+GL_M4_GNULIB_SHUTDOWN = @GL_M4_GNULIB_SHUTDOWN@
+GL_M4_GNULIB_SIGABBREV_NP = @GL_M4_GNULIB_SIGABBREV_NP@
+GL_M4_GNULIB_SIGACTION = @GL_M4_GNULIB_SIGACTION@
+GL_M4_GNULIB_SIGDESCR_NP = @GL_M4_GNULIB_SIGDESCR_NP@
+GL_M4_GNULIB_SIGNAL_H_SIGPIPE = @GL_M4_GNULIB_SIGNAL_H_SIGPIPE@
+GL_M4_GNULIB_SIGNBIT = @GL_M4_GNULIB_SIGNBIT@
+GL_M4_GNULIB_SIGPROCMASK = @GL_M4_GNULIB_SIGPROCMASK@
+GL_M4_GNULIB_SINF = @GL_M4_GNULIB_SINF@
+GL_M4_GNULIB_SINHF = @GL_M4_GNULIB_SINHF@
+GL_M4_GNULIB_SINL = @GL_M4_GNULIB_SINL@
+GL_M4_GNULIB_SLEEP = @GL_M4_GNULIB_SLEEP@
+GL_M4_GNULIB_SNPRINTF = @GL_M4_GNULIB_SNPRINTF@
+GL_M4_GNULIB_SOCKET = @GL_M4_GNULIB_SOCKET@
+GL_M4_GNULIB_SPRINTF_POSIX = @GL_M4_GNULIB_SPRINTF_POSIX@
+GL_M4_GNULIB_SQRTF = @GL_M4_GNULIB_SQRTF@
+GL_M4_GNULIB_SQRTL = @GL_M4_GNULIB_SQRTL@
+GL_M4_GNULIB_STAT = @GL_M4_GNULIB_STAT@
+GL_M4_GNULIB_STDIO_H_NONBLOCKING = @GL_M4_GNULIB_STDIO_H_NONBLOCKING@
+GL_M4_GNULIB_STDIO_H_SIGPIPE = @GL_M4_GNULIB_STDIO_H_SIGPIPE@
+GL_M4_GNULIB_STPCPY = @GL_M4_GNULIB_STPCPY@
+GL_M4_GNULIB_STPNCPY = @GL_M4_GNULIB_STPNCPY@
+GL_M4_GNULIB_STRCASESTR = @GL_M4_GNULIB_STRCASESTR@
+GL_M4_GNULIB_STRCHRNUL = @GL_M4_GNULIB_STRCHRNUL@
+GL_M4_GNULIB_STRDUP = @GL_M4_GNULIB_STRDUP@
+GL_M4_GNULIB_STRERROR = @GL_M4_GNULIB_STRERROR@
+GL_M4_GNULIB_STRERRORNAME_NP = @GL_M4_GNULIB_STRERRORNAME_NP@
+GL_M4_GNULIB_STRERROR_R = @GL_M4_GNULIB_STRERROR_R@
+GL_M4_GNULIB_STRFTIME = @GL_M4_GNULIB_STRFTIME@
+GL_M4_GNULIB_STRNCAT = @GL_M4_GNULIB_STRNCAT@
+GL_M4_GNULIB_STRNDUP = @GL_M4_GNULIB_STRNDUP@
+GL_M4_GNULIB_STRNLEN = @GL_M4_GNULIB_STRNLEN@
+GL_M4_GNULIB_STRPBRK = @GL_M4_GNULIB_STRPBRK@
+GL_M4_GNULIB_STRPTIME = @GL_M4_GNULIB_STRPTIME@
+GL_M4_GNULIB_STRSEP = @GL_M4_GNULIB_STRSEP@
+GL_M4_GNULIB_STRSIGNAL = @GL_M4_GNULIB_STRSIGNAL@
+GL_M4_GNULIB_STRSTR = @GL_M4_GNULIB_STRSTR@
+GL_M4_GNULIB_STRTOD = @GL_M4_GNULIB_STRTOD@
+GL_M4_GNULIB_STRTOIMAX = @GL_M4_GNULIB_STRTOIMAX@
+GL_M4_GNULIB_STRTOK_R = @GL_M4_GNULIB_STRTOK_R@
+GL_M4_GNULIB_STRTOL = @GL_M4_GNULIB_STRTOL@
+GL_M4_GNULIB_STRTOLD = @GL_M4_GNULIB_STRTOLD@
+GL_M4_GNULIB_STRTOLL = @GL_M4_GNULIB_STRTOLL@
+GL_M4_GNULIB_STRTOUL = @GL_M4_GNULIB_STRTOUL@
+GL_M4_GNULIB_STRTOULL = @GL_M4_GNULIB_STRTOULL@
+GL_M4_GNULIB_STRTOUMAX = @GL_M4_GNULIB_STRTOUMAX@
+GL_M4_GNULIB_STRVERSCMP = @GL_M4_GNULIB_STRVERSCMP@
+GL_M4_GNULIB_SYMLINK = @GL_M4_GNULIB_SYMLINK@
+GL_M4_GNULIB_SYMLINKAT = @GL_M4_GNULIB_SYMLINKAT@
+GL_M4_GNULIB_SYSTEM_POSIX = @GL_M4_GNULIB_SYSTEM_POSIX@
+GL_M4_GNULIB_TANF = @GL_M4_GNULIB_TANF@
+GL_M4_GNULIB_TANHF = @GL_M4_GNULIB_TANHF@
+GL_M4_GNULIB_TANL = @GL_M4_GNULIB_TANL@
+GL_M4_GNULIB_TIMEGM = @GL_M4_GNULIB_TIMEGM@
+GL_M4_GNULIB_TIMESPEC_GET = @GL_M4_GNULIB_TIMESPEC_GET@
+GL_M4_GNULIB_TIME_R = @GL_M4_GNULIB_TIME_R@
+GL_M4_GNULIB_TIME_RZ = @GL_M4_GNULIB_TIME_RZ@
+GL_M4_GNULIB_TMPFILE = @GL_M4_GNULIB_TMPFILE@
+GL_M4_GNULIB_TOWCTRANS = @GL_M4_GNULIB_TOWCTRANS@
+GL_M4_GNULIB_TRUNC = @GL_M4_GNULIB_TRUNC@
+GL_M4_GNULIB_TRUNCATE = @GL_M4_GNULIB_TRUNCATE@
+GL_M4_GNULIB_TRUNCF = @GL_M4_GNULIB_TRUNCF@
+GL_M4_GNULIB_TRUNCL = @GL_M4_GNULIB_TRUNCL@
+GL_M4_GNULIB_TTYNAME_R = @GL_M4_GNULIB_TTYNAME_R@
+GL_M4_GNULIB_TZSET = @GL_M4_GNULIB_TZSET@
+GL_M4_GNULIB_UNISTD_H_NONBLOCKING = @GL_M4_GNULIB_UNISTD_H_NONBLOCKING@
+GL_M4_GNULIB_UNISTD_H_SIGPIPE = @GL_M4_GNULIB_UNISTD_H_SIGPIPE@
+GL_M4_GNULIB_UNLINK = @GL_M4_GNULIB_UNLINK@
+GL_M4_GNULIB_UNLINKAT = @GL_M4_GNULIB_UNLINKAT@
+GL_M4_GNULIB_UNLOCKPT = @GL_M4_GNULIB_UNLOCKPT@
+GL_M4_GNULIB_UNSETENV = @GL_M4_GNULIB_UNSETENV@
+GL_M4_GNULIB_USLEEP = @GL_M4_GNULIB_USLEEP@
+GL_M4_GNULIB_UTIMENSAT = @GL_M4_GNULIB_UTIMENSAT@
+GL_M4_GNULIB_VASPRINTF = @GL_M4_GNULIB_VASPRINTF@
+GL_M4_GNULIB_VDPRINTF = @GL_M4_GNULIB_VDPRINTF@
+GL_M4_GNULIB_VFPRINTF = @GL_M4_GNULIB_VFPRINTF@
+GL_M4_GNULIB_VFPRINTF_POSIX = @GL_M4_GNULIB_VFPRINTF_POSIX@
+GL_M4_GNULIB_VFSCANF = @GL_M4_GNULIB_VFSCANF@
+GL_M4_GNULIB_VPRINTF = @GL_M4_GNULIB_VPRINTF@
+GL_M4_GNULIB_VPRINTF_POSIX = @GL_M4_GNULIB_VPRINTF_POSIX@
+GL_M4_GNULIB_VSCANF = @GL_M4_GNULIB_VSCANF@
+GL_M4_GNULIB_VSNPRINTF = @GL_M4_GNULIB_VSNPRINTF@
+GL_M4_GNULIB_VSPRINTF_POSIX = @GL_M4_GNULIB_VSPRINTF_POSIX@
+GL_M4_GNULIB_WAITPID = @GL_M4_GNULIB_WAITPID@
+GL_M4_GNULIB_WCPCPY = @GL_M4_GNULIB_WCPCPY@
+GL_M4_GNULIB_WCPNCPY = @GL_M4_GNULIB_WCPNCPY@
+GL_M4_GNULIB_WCRTOMB = @GL_M4_GNULIB_WCRTOMB@
+GL_M4_GNULIB_WCSCASECMP = @GL_M4_GNULIB_WCSCASECMP@
+GL_M4_GNULIB_WCSCAT = @GL_M4_GNULIB_WCSCAT@
+GL_M4_GNULIB_WCSCHR = @GL_M4_GNULIB_WCSCHR@
+GL_M4_GNULIB_WCSCMP = @GL_M4_GNULIB_WCSCMP@
+GL_M4_GNULIB_WCSCOLL = @GL_M4_GNULIB_WCSCOLL@
+GL_M4_GNULIB_WCSCPY = @GL_M4_GNULIB_WCSCPY@
+GL_M4_GNULIB_WCSCSPN = @GL_M4_GNULIB_WCSCSPN@
+GL_M4_GNULIB_WCSDUP = @GL_M4_GNULIB_WCSDUP@
+GL_M4_GNULIB_WCSFTIME = @GL_M4_GNULIB_WCSFTIME@
+GL_M4_GNULIB_WCSLEN = @GL_M4_GNULIB_WCSLEN@
+GL_M4_GNULIB_WCSNCASECMP = @GL_M4_GNULIB_WCSNCASECMP@
+GL_M4_GNULIB_WCSNCAT = @GL_M4_GNULIB_WCSNCAT@
+GL_M4_GNULIB_WCSNCMP = @GL_M4_GNULIB_WCSNCMP@
+GL_M4_GNULIB_WCSNCPY = @GL_M4_GNULIB_WCSNCPY@
+GL_M4_GNULIB_WCSNLEN = @GL_M4_GNULIB_WCSNLEN@
+GL_M4_GNULIB_WCSNRTOMBS = @GL_M4_GNULIB_WCSNRTOMBS@
+GL_M4_GNULIB_WCSPBRK = @GL_M4_GNULIB_WCSPBRK@
+GL_M4_GNULIB_WCSRCHR = @GL_M4_GNULIB_WCSRCHR@
+GL_M4_GNULIB_WCSRTOMBS = @GL_M4_GNULIB_WCSRTOMBS@
+GL_M4_GNULIB_WCSSPN = @GL_M4_GNULIB_WCSSPN@
+GL_M4_GNULIB_WCSSTR = @GL_M4_GNULIB_WCSSTR@
+GL_M4_GNULIB_WCSTOK = @GL_M4_GNULIB_WCSTOK@
+GL_M4_GNULIB_WCSWIDTH = @GL_M4_GNULIB_WCSWIDTH@
+GL_M4_GNULIB_WCSXFRM = @GL_M4_GNULIB_WCSXFRM@
+GL_M4_GNULIB_WCTOB = @GL_M4_GNULIB_WCTOB@
+GL_M4_GNULIB_WCTOMB = @GL_M4_GNULIB_WCTOMB@
+GL_M4_GNULIB_WCTRANS = @GL_M4_GNULIB_WCTRANS@
+GL_M4_GNULIB_WCTYPE = @GL_M4_GNULIB_WCTYPE@
+GL_M4_GNULIB_WCWIDTH = @GL_M4_GNULIB_WCWIDTH@
+GL_M4_GNULIB_WMEMCHR = @GL_M4_GNULIB_WMEMCHR@
+GL_M4_GNULIB_WMEMCMP = @GL_M4_GNULIB_WMEMCMP@
+GL_M4_GNULIB_WMEMCPY = @GL_M4_GNULIB_WMEMCPY@
+GL_M4_GNULIB_WMEMMOVE = @GL_M4_GNULIB_WMEMMOVE@
+GL_M4_GNULIB_WMEMPCPY = @GL_M4_GNULIB_WMEMPCPY@
+GL_M4_GNULIB_WMEMSET = @GL_M4_GNULIB_WMEMSET@
+GL_M4_GNULIB_WRITE = @GL_M4_GNULIB_WRITE@
+GL_M4_GNULIB__EXIT = @GL_M4_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
-GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
 GNULIB_GL_M4_UNISTD_H_GETOPT = @GNULIB_GL_M4_UNISTD_H_GETOPT@
-GNULIB_GRANTPT = @GNULIB_GRANTPT@
-GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
-GNULIB_HYPOT = @GNULIB_HYPOT@
-GNULIB_HYPOTF = @GNULIB_HYPOTF@
-GNULIB_HYPOTL = @GNULIB_HYPOTL@
-GNULIB_ILOGB = @GNULIB_ILOGB@
-GNULIB_ILOGBF = @GNULIB_ILOGBF@
-GNULIB_ILOGBL = @GNULIB_ILOGBL@
-GNULIB_IMAXABS = @GNULIB_IMAXABS@
-GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
-GNULIB_ISATTY = @GNULIB_ISATTY@
-GNULIB_ISBLANK = @GNULIB_ISBLANK@
-GNULIB_ISFINITE = @GNULIB_ISFINITE@
-GNULIB_ISINF = @GNULIB_ISINF@
-GNULIB_ISNAN = @GNULIB_ISNAN@
-GNULIB_ISNAND = @GNULIB_ISNAND@
-GNULIB_ISNANF = @GNULIB_ISNANF@
-GNULIB_ISNANL = @GNULIB_ISNANL@
-GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
-GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
-GNULIB_LCHMOD = @GNULIB_LCHMOD@
-GNULIB_LCHOWN = @GNULIB_LCHOWN@
-GNULIB_LDEXPF = @GNULIB_LDEXPF@
-GNULIB_LDEXPL = @GNULIB_LDEXPL@
-GNULIB_LINK = @GNULIB_LINK@
-GNULIB_LINKAT = @GNULIB_LINKAT@
-GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
-GNULIB_LOG = @GNULIB_LOG@
-GNULIB_LOG10 = @GNULIB_LOG10@
-GNULIB_LOG10F = @GNULIB_LOG10F@
-GNULIB_LOG10L = @GNULIB_LOG10L@
-GNULIB_LOG1P = @GNULIB_LOG1P@
-GNULIB_LOG1PF = @GNULIB_LOG1PF@
-GNULIB_LOG1PL = @GNULIB_LOG1PL@
-GNULIB_LOG2 = @GNULIB_LOG2@
-GNULIB_LOG2F = @GNULIB_LOG2F@
-GNULIB_LOG2L = @GNULIB_LOG2L@
-GNULIB_LOGB = @GNULIB_LOGB@
-GNULIB_LOGBF = @GNULIB_LOGBF@
-GNULIB_LOGBL = @GNULIB_LOGBL@
-GNULIB_LOGF = @GNULIB_LOGF@
-GNULIB_LOGL = @GNULIB_LOGL@
-GNULIB_LSEEK = @GNULIB_LSEEK@
-GNULIB_LSTAT = @GNULIB_LSTAT@
-GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
-GNULIB_MBRLEN = @GNULIB_MBRLEN@
-GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
-GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
-GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
-GNULIB_MBSCHR = @GNULIB_MBSCHR@
-GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
-GNULIB_MBSINIT = @GNULIB_MBSINIT@
-GNULIB_MBSLEN = @GNULIB_MBSLEN@
-GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
-GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
-GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
-GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
-GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
-GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
-GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
-GNULIB_MBSSEP = @GNULIB_MBSSEP@
-GNULIB_MBSSPN = @GNULIB_MBSSPN@
-GNULIB_MBSSTR = @GNULIB_MBSSTR@
-GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
-GNULIB_MBTOWC = @GNULIB_MBTOWC@
-GNULIB_MEMCHR = @GNULIB_MEMCHR@
-GNULIB_MEMMEM = @GNULIB_MEMMEM@
-GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
-GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
-GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
-GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
-GNULIB_MKFIFO = @GNULIB_MKFIFO@
-GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
-GNULIB_MKNOD = @GNULIB_MKNOD@
-GNULIB_MKNODAT = @GNULIB_MKNODAT@
-GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
-GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
-GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
-GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
-GNULIB_MKTIME = @GNULIB_MKTIME@
-GNULIB_MODF = @GNULIB_MODF@
-GNULIB_MODFF = @GNULIB_MODFF@
-GNULIB_MODFL = @GNULIB_MODFL@
-GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
-GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
-GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
-GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
-GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
-GNULIB_OPEN = @GNULIB_OPEN@
-GNULIB_OPENAT = @GNULIB_OPENAT@
-GNULIB_OPENDIR = @GNULIB_OPENDIR@
-GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@
-GNULIB_PCLOSE = @GNULIB_PCLOSE@
-GNULIB_PERROR = @GNULIB_PERROR@
-GNULIB_PIPE = @GNULIB_PIPE@
-GNULIB_PIPE2 = @GNULIB_PIPE2@
-GNULIB_POPEN = @GNULIB_POPEN@
-GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
-GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@
-GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@
-GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
-GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
-GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@
-GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
-GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
-GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
-GNULIB_POWF = @GNULIB_POWF@
-GNULIB_PREAD = @GNULIB_PREAD@
-GNULIB_PRINTF = @GNULIB_PRINTF@
-GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
-GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
-GNULIB_PTSNAME = @GNULIB_PTSNAME@
-GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
-GNULIB_PUTC = @GNULIB_PUTC@
-GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
-GNULIB_PUTENV = @GNULIB_PUTENV@
-GNULIB_PUTS = @GNULIB_PUTS@
-GNULIB_PWRITE = @GNULIB_PWRITE@
-GNULIB_QSORT_R = @GNULIB_QSORT_R@
-GNULIB_RAISE = @GNULIB_RAISE@
-GNULIB_RANDOM = @GNULIB_RANDOM@
-GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
-GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
-GNULIB_READ = @GNULIB_READ@
-GNULIB_READDIR = @GNULIB_READDIR@
-GNULIB_READLINK = @GNULIB_READLINK@
-GNULIB_READLINKAT = @GNULIB_READLINKAT@
-GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
-GNULIB_REALPATH = @GNULIB_REALPATH@
-GNULIB_REMAINDER = @GNULIB_REMAINDER@
-GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
-GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
-GNULIB_REMOVE = @GNULIB_REMOVE@
-GNULIB_RENAME = @GNULIB_RENAME@
-GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
-GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
-GNULIB_RINT = @GNULIB_RINT@
-GNULIB_RINTF = @GNULIB_RINTF@
-GNULIB_RINTL = @GNULIB_RINTL@
-GNULIB_RMDIR = @GNULIB_RMDIR@
-GNULIB_ROUND = @GNULIB_ROUND@
-GNULIB_ROUNDF = @GNULIB_ROUNDF@
-GNULIB_ROUNDL = @GNULIB_ROUNDL@
-GNULIB_RPMATCH = @GNULIB_RPMATCH@
-GNULIB_SCANDIR = @GNULIB_SCANDIR@
-GNULIB_SCANF = @GNULIB_SCANF@
-GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
-GNULIB_SETENV = @GNULIB_SETENV@
-GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
-GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
-GNULIB_SIGACTION = @GNULIB_SIGACTION@
-GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
-GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
-GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
-GNULIB_SINF = @GNULIB_SINF@
-GNULIB_SINHF = @GNULIB_SINHF@
-GNULIB_SINL = @GNULIB_SINL@
-GNULIB_SLEEP = @GNULIB_SLEEP@
-GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
-GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
-GNULIB_SQRTF = @GNULIB_SQRTF@
-GNULIB_SQRTL = @GNULIB_SQRTL@
-GNULIB_STAT = @GNULIB_STAT@
-GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
-GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
-GNULIB_STPCPY = @GNULIB_STPCPY@
-GNULIB_STPNCPY = @GNULIB_STPNCPY@
-GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
-GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
-GNULIB_STRDUP = @GNULIB_STRDUP@
-GNULIB_STRERROR = @GNULIB_STRERROR@
-GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
-GNULIB_STRNCAT = @GNULIB_STRNCAT@
-GNULIB_STRNDUP = @GNULIB_STRNDUP@
-GNULIB_STRNLEN = @GNULIB_STRNLEN@
-GNULIB_STRPBRK = @GNULIB_STRPBRK@
-GNULIB_STRPTIME = @GNULIB_STRPTIME@
-GNULIB_STRSEP = @GNULIB_STRSEP@
-GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
-GNULIB_STRSTR = @GNULIB_STRSTR@
-GNULIB_STRTOD = @GNULIB_STRTOD@
-GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
-GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
-GNULIB_STRTOLL = @GNULIB_STRTOLL@
-GNULIB_STRTOULL = @GNULIB_STRTOULL@
-GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
-GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
-GNULIB_SYMLINK = @GNULIB_SYMLINK@
-GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
-GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
-GNULIB_TANF = @GNULIB_TANF@
-GNULIB_TANHF = @GNULIB_TANHF@
-GNULIB_TANL = @GNULIB_TANL@
-GNULIB_TIMEGM = @GNULIB_TIMEGM@
-GNULIB_TIME_R = @GNULIB_TIME_R@
-GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
-GNULIB_TMPFILE = @GNULIB_TMPFILE@
-GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
-GNULIB_TRUNC = @GNULIB_TRUNC@
-GNULIB_TRUNCF = @GNULIB_TRUNCF@
-GNULIB_TRUNCL = @GNULIB_TRUNCL@
-GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
-GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
-GNULIB_UNLINK = @GNULIB_UNLINK@
-GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
-GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
-GNULIB_UNSETENV = @GNULIB_UNSETENV@
-GNULIB_USLEEP = @GNULIB_USLEEP@
-GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
-GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
-GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
-GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
-GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
-GNULIB_VFSCANF = @GNULIB_VFSCANF@
-GNULIB_VPRINTF = @GNULIB_VPRINTF@
-GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
-GNULIB_VSCANF = @GNULIB_VSCANF@
-GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
-GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
-GNULIB_WAITPID = @GNULIB_WAITPID@
-GNULIB_WCPCPY = @GNULIB_WCPCPY@
-GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
-GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
-GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
-GNULIB_WCSCAT = @GNULIB_WCSCAT@
-GNULIB_WCSCHR = @GNULIB_WCSCHR@
-GNULIB_WCSCMP = @GNULIB_WCSCMP@
-GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
-GNULIB_WCSCPY = @GNULIB_WCSCPY@
-GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
-GNULIB_WCSDUP = @GNULIB_WCSDUP@
-GNULIB_WCSLEN = @GNULIB_WCSLEN@
-GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
-GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
-GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
-GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
-GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
-GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
-GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
-GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
-GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
-GNULIB_WCSSPN = @GNULIB_WCSSPN@
-GNULIB_WCSSTR = @GNULIB_WCSSTR@
-GNULIB_WCSTOK = @GNULIB_WCSTOK@
-GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
-GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
-GNULIB_WCTOB = @GNULIB_WCTOB@
-GNULIB_WCTOMB = @GNULIB_WCTOMB@
-GNULIB_WCTRANS = @GNULIB_WCTRANS@
-GNULIB_WCTYPE = @GNULIB_WCTYPE@
-GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
-GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
-GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
-GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
-GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
-GNULIB_WMEMSET = @GNULIB_WMEMSET@
-GNULIB_WRITE = @GNULIB_WRITE@
-GNULIB__EXIT = @GNULIB__EXIT@
 GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ACOSF = @HAVE_ACOSF@
 HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ASINF = @HAVE_ASINF@
 HAVE_ASINL = @HAVE_ASINL@
 HAVE_ATAN2F = @HAVE_ATAN2F@
@@ -768,9 +945,11 @@ HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
 HAVE_COPYSIGN = @HAVE_COPYSIGN@
 HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
 HAVE_COSF = @HAVE_COSF@
 HAVE_COSHF = @HAVE_COSHF@
 HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
 HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
 HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
 HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
@@ -781,13 +960,17 @@ HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
 HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
 HAVE_DECL_COSL = @HAVE_DECL_COSL@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
 HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
 HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
 HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
 HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
 HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
 HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
 HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
@@ -796,6 +979,7 @@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
 HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
@@ -806,6 +990,9 @@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
 HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
 HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
 HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
 HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
@@ -825,6 +1012,7 @@ HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
 HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
 HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
 HAVE_DECL_SINL = @HAVE_DECL_SINL@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
@@ -838,21 +1026,24 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TANL = @HAVE_DECL_TANL@
 HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
-HAVE_DUP2 = @HAVE_DUP2@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
 HAVE_EXPF = @HAVE_EXPF@
 HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
 HAVE_EXPM1 = @HAVE_EXPM1@
 HAVE_EXPM1F = @HAVE_EXPM1F@
 HAVE_FABSF = @HAVE_FABSF@
@@ -872,6 +1063,7 @@ HAVE_FMAF = @HAVE_FMAF@
 HAVE_FMAL = @HAVE_FMAL@
 HAVE_FMODF = @HAVE_FMODF@
 HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
 HAVE_FREXPF = @HAVE_FREXPF@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
@@ -880,13 +1072,17 @@ HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
 HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
 HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETRANDOM = @HAVE_GETRANDOM@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GETUMASK = @HAVE_GETUMASK@
 HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_HYPOTF = @HAVE_HYPOTF@
@@ -894,6 +1090,8 @@ HAVE_HYPOTL = @HAVE_HYPOTL@
 HAVE_ILOGB = @HAVE_ILOGB@
 HAVE_ILOGBF = @HAVE_ILOGBF@
 HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISNAND = @HAVE_ISNAND@
@@ -901,6 +1099,7 @@ HAVE_ISNANF = @HAVE_ISNANF@
 HAVE_ISNANL = @HAVE_ISNANL@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
 HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
 HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
 HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
@@ -921,7 +1120,6 @@ HAVE_LOGBF = @HAVE_LOGBF@
 HAVE_LOGBL = @HAVE_LOGBL@
 HAVE_LOGF = @HAVE_LOGF@
 HAVE_LOGL = @HAVE_LOGL@
-HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
 HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
 HAVE_MBRLEN = @HAVE_MBRLEN@
@@ -930,7 +1128,7 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
 HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
-HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MBTOWC = @HAVE_MBTOWC@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
 HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
@@ -946,6 +1144,8 @@ HAVE_MODFF = @HAVE_MODFF@
 HAVE_MODFL = @HAVE_MODFL@
 HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OPENDIR = @HAVE_OPENDIR@
@@ -954,14 +1154,76 @@ HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@
 HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PSELECT = @HAVE_PSELECT@
+HAVE_PTHREAD_ATTR_DESTROY = @HAVE_PTHREAD_ATTR_DESTROY@
+HAVE_PTHREAD_ATTR_GETDETACHSTATE = @HAVE_PTHREAD_ATTR_GETDETACHSTATE@
+HAVE_PTHREAD_ATTR_INIT = @HAVE_PTHREAD_ATTR_INIT@
+HAVE_PTHREAD_ATTR_SETDETACHSTATE = @HAVE_PTHREAD_ATTR_SETDETACHSTATE@
+HAVE_PTHREAD_CONDATTR_DESTROY = @HAVE_PTHREAD_CONDATTR_DESTROY@
+HAVE_PTHREAD_CONDATTR_INIT = @HAVE_PTHREAD_CONDATTR_INIT@
+HAVE_PTHREAD_COND_BROADCAST = @HAVE_PTHREAD_COND_BROADCAST@
+HAVE_PTHREAD_COND_DESTROY = @HAVE_PTHREAD_COND_DESTROY@
+HAVE_PTHREAD_COND_INIT = @HAVE_PTHREAD_COND_INIT@
+HAVE_PTHREAD_COND_SIGNAL = @HAVE_PTHREAD_COND_SIGNAL@
+HAVE_PTHREAD_COND_TIMEDWAIT = @HAVE_PTHREAD_COND_TIMEDWAIT@
+HAVE_PTHREAD_COND_WAIT = @HAVE_PTHREAD_COND_WAIT@
+HAVE_PTHREAD_CREATE = @HAVE_PTHREAD_CREATE@
+HAVE_PTHREAD_CREATE_DETACHED = @HAVE_PTHREAD_CREATE_DETACHED@
+HAVE_PTHREAD_DETACH = @HAVE_PTHREAD_DETACH@
+HAVE_PTHREAD_EQUAL = @HAVE_PTHREAD_EQUAL@
+HAVE_PTHREAD_EXIT = @HAVE_PTHREAD_EXIT@
+HAVE_PTHREAD_GETSPECIFIC = @HAVE_PTHREAD_GETSPECIFIC@
+HAVE_PTHREAD_H = @HAVE_PTHREAD_H@
+HAVE_PTHREAD_JOIN = @HAVE_PTHREAD_JOIN@
+HAVE_PTHREAD_KEY_CREATE = @HAVE_PTHREAD_KEY_CREATE@
+HAVE_PTHREAD_KEY_DELETE = @HAVE_PTHREAD_KEY_DELETE@
+HAVE_PTHREAD_MUTEXATTR_DESTROY = @HAVE_PTHREAD_MUTEXATTR_DESTROY@
+HAVE_PTHREAD_MUTEXATTR_GETROBUST = @HAVE_PTHREAD_MUTEXATTR_GETROBUST@
+HAVE_PTHREAD_MUTEXATTR_GETTYPE = @HAVE_PTHREAD_MUTEXATTR_GETTYPE@
+HAVE_PTHREAD_MUTEXATTR_INIT = @HAVE_PTHREAD_MUTEXATTR_INIT@
+HAVE_PTHREAD_MUTEXATTR_SETROBUST = @HAVE_PTHREAD_MUTEXATTR_SETROBUST@
+HAVE_PTHREAD_MUTEXATTR_SETTYPE = @HAVE_PTHREAD_MUTEXATTR_SETTYPE@
+HAVE_PTHREAD_MUTEX_DESTROY = @HAVE_PTHREAD_MUTEX_DESTROY@
+HAVE_PTHREAD_MUTEX_INIT = @HAVE_PTHREAD_MUTEX_INIT@
+HAVE_PTHREAD_MUTEX_LOCK = @HAVE_PTHREAD_MUTEX_LOCK@
+HAVE_PTHREAD_MUTEX_RECURSIVE = @HAVE_PTHREAD_MUTEX_RECURSIVE@
+HAVE_PTHREAD_MUTEX_ROBUST = @HAVE_PTHREAD_MUTEX_ROBUST@
+HAVE_PTHREAD_MUTEX_TIMEDLOCK = @HAVE_PTHREAD_MUTEX_TIMEDLOCK@
+HAVE_PTHREAD_MUTEX_TRYLOCK = @HAVE_PTHREAD_MUTEX_TRYLOCK@
+HAVE_PTHREAD_MUTEX_UNLOCK = @HAVE_PTHREAD_MUTEX_UNLOCK@
+HAVE_PTHREAD_ONCE = @HAVE_PTHREAD_ONCE@
+HAVE_PTHREAD_PROCESS_SHARED = @HAVE_PTHREAD_PROCESS_SHARED@
+HAVE_PTHREAD_RWLOCKATTR_DESTROY = @HAVE_PTHREAD_RWLOCKATTR_DESTROY@
+HAVE_PTHREAD_RWLOCKATTR_INIT = @HAVE_PTHREAD_RWLOCKATTR_INIT@
+HAVE_PTHREAD_RWLOCK_DESTROY = @HAVE_PTHREAD_RWLOCK_DESTROY@
+HAVE_PTHREAD_RWLOCK_INIT = @HAVE_PTHREAD_RWLOCK_INIT@
+HAVE_PTHREAD_RWLOCK_RDLOCK = @HAVE_PTHREAD_RWLOCK_RDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+HAVE_PTHREAD_RWLOCK_TRYRDLOCK = @HAVE_PTHREAD_RWLOCK_TRYRDLOCK@
+HAVE_PTHREAD_RWLOCK_TRYWRLOCK = @HAVE_PTHREAD_RWLOCK_TRYWRLOCK@
+HAVE_PTHREAD_RWLOCK_UNLOCK = @HAVE_PTHREAD_RWLOCK_UNLOCK@
+HAVE_PTHREAD_RWLOCK_WRLOCK = @HAVE_PTHREAD_RWLOCK_WRLOCK@
+HAVE_PTHREAD_SELF = @HAVE_PTHREAD_SELF@
+HAVE_PTHREAD_SETSPECIFIC = @HAVE_PTHREAD_SETSPECIFIC@
 HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
+HAVE_PTHREAD_SPINLOCK_T = @HAVE_PTHREAD_SPINLOCK_T@
+HAVE_PTHREAD_SPIN_DESTROY = @HAVE_PTHREAD_SPIN_DESTROY@
+HAVE_PTHREAD_SPIN_INIT = @HAVE_PTHREAD_SPIN_INIT@
+HAVE_PTHREAD_SPIN_LOCK = @HAVE_PTHREAD_SPIN_LOCK@
+HAVE_PTHREAD_SPIN_TRYLOCK = @HAVE_PTHREAD_SPIN_TRYLOCK@
+HAVE_PTHREAD_SPIN_UNLOCK = @HAVE_PTHREAD_SPIN_UNLOCK@
+HAVE_PTHREAD_T = @HAVE_PTHREAD_T@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
@@ -974,6 +1236,7 @@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READDIR = @HAVE_READDIR@
 HAVE_READLINK = @HAVE_READLINK@
 HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
 HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_REMAINDER = @HAVE_REMAINDER@
 HAVE_REMAINDERF = @HAVE_REMAINDERF@
@@ -983,12 +1246,17 @@ HAVE_RINT = @HAVE_RINT@
 HAVE_RINTL = @HAVE_RINTL@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SCHED_H = @HAVE_SCHED_H@
+HAVE_SCHED_YIELD = @HAVE_SCHED_YIELD@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
 HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
 HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
 HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
@@ -1007,15 +1275,21 @@ HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
 HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRPTIME = @HAVE_STRPTIME@
 HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
 HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@
 HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -1023,24 +1297,30 @@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@
+HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
 HAVE_TANF = @HAVE_TANF@
 HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
 HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
-HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
 HAVE_USLEEP = @HAVE_USLEEP@
 HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
 HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCPCPY = @HAVE_WCPCPY@
@@ -1054,6 +1334,7 @@ HAVE_WCSCOLL = @HAVE_WCSCOLL@
 HAVE_WCSCPY = @HAVE_WCSCPY@
 HAVE_WCSCSPN = @HAVE_WCSCSPN@
 HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
 HAVE_WCSLEN = @HAVE_WCSLEN@
 HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
 HAVE_WCSNCAT = @HAVE_WCSNCAT@
@@ -1078,12 +1359,19 @@ HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
 HAVE_WMEMCPY = @HAVE_WMEMCPY@
 HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
 HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
+HOST_CPU = @HOST_CPU@
+HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -1091,34 +1379,55 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
 INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LIBCSTACK = @LIBCSTACK@
+LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM4_LIBDEPS = @LIBM4_LIBDEPS@
 LIBM4_LTLIBDEPS = @LIBM4_LTLIBDEPS@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
-LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBSIGSEGV = @LIBSIGSEGV@
 LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
 LIBTHREAD = @LIBTHREAD@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_GETRANDOM = @LIB_GETRANDOM@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
 LIB_POSIX_SPAWN = @LIB_POSIX_SPAWN@
+LIB_PTHREAD = @LIB_PTHREAD@
+LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SELECT = @LIB_SELECT@
+LIB_SEMAPHORE = @LIB_SEMAPHORE@
+LIB_SETLOCALE = @LIB_SETLOCALE@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
 LIMITS_H = @LIMITS_H@
 LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
 LOCALE_FR = @LOCALE_FR@
 LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
 LOCALE_JA = @LOCALE_JA@
 LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
 LOCALE_ZH_CN = @LOCALE_ZH_CN@
 LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
-LTLIBPTH = @LTLIBPTH@
 LTLIBSIGSEGV = @LTLIBSIGSEGV@
 LTLIBTHREAD = @LTLIBTHREAD@
 M4_LIBOBJS = @M4_LIBOBJS@
@@ -1128,17 +1437,26 @@ M4tests_LTLIBOBJS = @M4tests_LTLIBOBJS@
 M4tests_WITNESS = @M4tests_WITNESS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
 NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@
 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H = @NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H@
 NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@
 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
 NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@
@@ -1148,9 +1466,14 @@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
 NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
@@ -1162,11 +1485,14 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FCNTL_H = @NEXT_FCNTL_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
 NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_PTHREAD_H = @NEXT_PTHREAD_H@
 NEXT_SCHED_H = @NEXT_SCHED_H@
 NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_SPAWN_H = @NEXT_SPAWN_H@
@@ -1176,9 +1502,14 @@ NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@
+NEXT_SYS_RANDOM_H = @NEXT_SYS_RANDOM_H@
+NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
 NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
 NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -1194,14 +1525,16 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
 PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
 PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PRIPTR_PREFIX = @PRIPTR_PREFIX@
-PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
 PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
+REPLACE_ACCESS = @REPLACE_ACCESS@
 REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
 REPLACE_ASINF = @REPLACE_ASINF@
 REPLACE_ATAN2F = @REPLACE_ATAN2F@
 REPLACE_ATANF = @REPLACE_ATANF@
@@ -1218,23 +1551,37 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
 REPLACE_COSF = @REPLACE_COSF@
 REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
 REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
 REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
 REPLACE_EXP2 = @REPLACE_EXP2@
 REPLACE_EXP2L = @REPLACE_EXP2L@
 REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
 REPLACE_EXPM1 = @REPLACE_EXPM1@
 REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
 REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
 REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
 REPLACE_FLOOR = @REPLACE_FLOOR@
 REPLACE_FLOORF = @REPLACE_FLOORF@
 REPLACE_FLOORL = @REPLACE_FLOORL@
@@ -1247,6 +1594,8 @@ REPLACE_FMODL = @REPLACE_FMODL@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FREXP = @REPLACE_FREXP@
 REPLACE_FREXPF = @REPLACE_FREXPF@
@@ -1267,20 +1616,32 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
 REPLACE_HYPOT = @REPLACE_HYPOT@
 REPLACE_HYPOTF = @REPLACE_HYPOTF@
 REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
 REPLACE_ILOGB = @REPLACE_ILOGB@
 REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_IOCTL = @REPLACE_IOCTL@
 REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISFINITE = @REPLACE_ISFINITE@
 REPLACE_ISINF = @REPLACE_ISINF@
 REPLACE_ISNAN = @REPLACE_ISNAN@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
 REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LDEXPL = @REPLACE_LDEXPL@
@@ -1318,7 +1679,9 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@
 REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
 REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
 REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
 REPLACE_MKTIME = @REPLACE_MKTIME@
 REPLACE_MODF = @REPLACE_MODF@
@@ -1326,6 +1689,7 @@ REPLACE_MODFF = @REPLACE_MODFF@
 REPLACE_MODFL = @REPLACE_MODFL@
 REPLACE_NAN = @REPLACE_NAN@
 REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
 REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
 REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
@@ -1334,24 +1698,81 @@ REPLACE_OPENAT = @REPLACE_OPENAT@
 REPLACE_OPENDIR = @REPLACE_OPENDIR@
 REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
 REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PSELECT = @REPLACE_PSELECT@
+REPLACE_PTHREAD_ATTR_DESTROY = @REPLACE_PTHREAD_ATTR_DESTROY@
+REPLACE_PTHREAD_ATTR_GETDETACHSTATE = @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@
+REPLACE_PTHREAD_ATTR_INIT = @REPLACE_PTHREAD_ATTR_INIT@
+REPLACE_PTHREAD_ATTR_SETDETACHSTATE = @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@
+REPLACE_PTHREAD_CONDATTR_DESTROY = @REPLACE_PTHREAD_CONDATTR_DESTROY@
+REPLACE_PTHREAD_CONDATTR_INIT = @REPLACE_PTHREAD_CONDATTR_INIT@
+REPLACE_PTHREAD_COND_BROADCAST = @REPLACE_PTHREAD_COND_BROADCAST@
+REPLACE_PTHREAD_COND_DESTROY = @REPLACE_PTHREAD_COND_DESTROY@
+REPLACE_PTHREAD_COND_INIT = @REPLACE_PTHREAD_COND_INIT@
+REPLACE_PTHREAD_COND_SIGNAL = @REPLACE_PTHREAD_COND_SIGNAL@
+REPLACE_PTHREAD_COND_TIMEDWAIT = @REPLACE_PTHREAD_COND_TIMEDWAIT@
+REPLACE_PTHREAD_COND_WAIT = @REPLACE_PTHREAD_COND_WAIT@
+REPLACE_PTHREAD_CREATE = @REPLACE_PTHREAD_CREATE@
+REPLACE_PTHREAD_DETACH = @REPLACE_PTHREAD_DETACH@
+REPLACE_PTHREAD_EQUAL = @REPLACE_PTHREAD_EQUAL@
+REPLACE_PTHREAD_EXIT = @REPLACE_PTHREAD_EXIT@
+REPLACE_PTHREAD_GETSPECIFIC = @REPLACE_PTHREAD_GETSPECIFIC@
+REPLACE_PTHREAD_JOIN = @REPLACE_PTHREAD_JOIN@
+REPLACE_PTHREAD_KEY_CREATE = @REPLACE_PTHREAD_KEY_CREATE@
+REPLACE_PTHREAD_KEY_DELETE = @REPLACE_PTHREAD_KEY_DELETE@
+REPLACE_PTHREAD_MUTEXATTR_DESTROY = @REPLACE_PTHREAD_MUTEXATTR_DESTROY@
+REPLACE_PTHREAD_MUTEXATTR_GETROBUST = @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_GETTYPE = @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@
+REPLACE_PTHREAD_MUTEXATTR_INIT = @REPLACE_PTHREAD_MUTEXATTR_INIT@
+REPLACE_PTHREAD_MUTEXATTR_SETROBUST = @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_SETTYPE = @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@
+REPLACE_PTHREAD_MUTEX_DESTROY = @REPLACE_PTHREAD_MUTEX_DESTROY@
+REPLACE_PTHREAD_MUTEX_INIT = @REPLACE_PTHREAD_MUTEX_INIT@
+REPLACE_PTHREAD_MUTEX_LOCK = @REPLACE_PTHREAD_MUTEX_LOCK@
+REPLACE_PTHREAD_MUTEX_TIMEDLOCK = @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@
+REPLACE_PTHREAD_MUTEX_TRYLOCK = @REPLACE_PTHREAD_MUTEX_TRYLOCK@
+REPLACE_PTHREAD_MUTEX_UNLOCK = @REPLACE_PTHREAD_MUTEX_UNLOCK@
+REPLACE_PTHREAD_ONCE = @REPLACE_PTHREAD_ONCE@
+REPLACE_PTHREAD_RWLOCKATTR_DESTROY = @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@
+REPLACE_PTHREAD_RWLOCKATTR_INIT = @REPLACE_PTHREAD_RWLOCKATTR_INIT@
+REPLACE_PTHREAD_RWLOCK_DESTROY = @REPLACE_PTHREAD_RWLOCK_DESTROY@
+REPLACE_PTHREAD_RWLOCK_INIT = @REPLACE_PTHREAD_RWLOCK_INIT@
+REPLACE_PTHREAD_RWLOCK_RDLOCK = @REPLACE_PTHREAD_RWLOCK_RDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYRDLOCK = @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYWRLOCK = @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@
+REPLACE_PTHREAD_RWLOCK_UNLOCK = @REPLACE_PTHREAD_RWLOCK_UNLOCK@
+REPLACE_PTHREAD_RWLOCK_WRLOCK = @REPLACE_PTHREAD_RWLOCK_WRLOCK@
+REPLACE_PTHREAD_SELF = @REPLACE_PTHREAD_SELF@
+REPLACE_PTHREAD_SETSPECIFIC = @REPLACE_PTHREAD_SETSPECIFIC@
 REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
+REPLACE_PTHREAD_SPIN_DESTROY = @REPLACE_PTHREAD_SPIN_DESTROY@
+REPLACE_PTHREAD_SPIN_INIT = @REPLACE_PTHREAD_SPIN_INIT@
+REPLACE_PTHREAD_SPIN_LOCK = @REPLACE_PTHREAD_SPIN_LOCK@
+REPLACE_PTHREAD_SPIN_TRYLOCK = @REPLACE_PTHREAD_SPIN_TRYLOCK@
+REPLACE_PTHREAD_SPIN_UNLOCK = @REPLACE_PTHREAD_SPIN_UNLOCK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
 REPLACE_RAISE = @REPLACE_RAISE@
+REPLACE_RANDOM = @REPLACE_RANDOM@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_READLINKAT = @REPLACE_READLINKAT@
 REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
 REPLACE_REALPATH = @REPLACE_REALPATH@
 REPLACE_REMAINDER = @REPLACE_REMAINDER@
 REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
@@ -1359,14 +1780,18 @@ REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
 REPLACE_REMOVE = @REPLACE_REMOVE@
 REPLACE_RENAME = @REPLACE_RENAME@
 REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
 REPLACE_RMDIR = @REPLACE_RMDIR@
 REPLACE_ROUND = @REPLACE_ROUND@
 REPLACE_ROUNDF = @REPLACE_ROUNDF@
 REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SCHED_YIELD = @REPLACE_SCHED_YIELD@
+REPLACE_SELECT = @REPLACE_SELECT@
 REPLACE_SETENV = @REPLACE_SETENV@
 REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
 REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
-REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
 REPLACE_SINF = @REPLACE_SINF@
 REPLACE_SINHF = @REPLACE_SINHF@
 REPLACE_SLEEP = @REPLACE_SLEEP@
@@ -1382,7 +1807,9 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
 REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
 REPLACE_STRNCAT = @REPLACE_STRNCAT@
 REPLACE_STRNDUP = @REPLACE_STRNDUP@
 REPLACE_STRNLEN = @REPLACE_STRNLEN@
@@ -1391,6 +1818,11 @@ REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
 REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
 REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
 REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
 REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
@@ -1402,9 +1834,11 @@ REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
 REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
 REPLACE_TRUNCF = @REPLACE_TRUNCF@
 REPLACE_TRUNCL = @REPLACE_TRUNCL@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
 REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -1417,17 +1851,19 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
 REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
 REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCTOMB = @REPLACE_WCTOMB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 REPLACE_WRITE = @REPLACE_WRITE@
-SCHED_H = @SCHED_H@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIGSEGV_H = @SIGSEGV_H@
 SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
 SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 STDALIGN_H = @STDALIGN_H@
@@ -1436,27 +1872,37 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
 UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
 UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
 WERROR_CFLAGS = @WERROR_CFLAGS@
 WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
 WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+YIELD_LIB = @YIELD_LIB@
 abs_aux_dir = @abs_aux_dir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 am__include = @am__include@
@@ -1506,7 +1952,7 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-SUBDIRS = . examples lib src doc checks tests
+SUBDIRS = . examples lib src doc checks po tests
 EXTRA_DIST = bootstrap c-boxes.el cfg.mk maint.mk \
        .prev-version .version m4/gnulib-cache.m4 ChangeLog-2014
 
@@ -1549,8 +1995,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
            echo ' $(SHELL) ./config.status'; \
            $(SHELL) ./config.status;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -1668,7 +2114,10 @@ distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
        -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        $(am__remove_distdir)
        test -d "$(distdir)" || mkdir "$(distdir)"
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -1749,6 +2198,10 @@ dist-xz: distdir
        tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
        $(am__post_remove_distdir)
 
+dist-zstd: distdir
+       tardir=$(distdir) && $(am__tar) | zstd -c $${ZSTD_CLEVEL-$${ZSTD_OPT--19}} >$(distdir).tar.zst
+       $(am__post_remove_distdir)
+
 dist-tarZ: distdir
        @echo WARNING: "Support for distribution archives compressed with" \
                       "legacy program 'compress' is deprecated." >&2
@@ -1791,6 +2244,8 @@ distcheck: dist
          eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
        *.zip*) \
          unzip $(distdir).zip ;;\
+       *.tar.zst*) \
+         zstd -dc $(distdir).tar.zst | $(am__untar) ;;\
        esac
        chmod -R a-w $(distdir)
        chmod u+w $(distdir)
@@ -1806,7 +2261,7 @@ distcheck: dist
            $(DISTCHECK_CONFIGURE_FLAGS) \
            --srcdir=../.. --prefix="$$dc_install_base" \
          && $(MAKE) $(AM_MAKEFLAGS) \
-         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) $(AM_DISTCHECK_DVI_TARGET) \
          && $(MAKE) $(AM_MAKEFLAGS) check \
          && $(MAKE) $(AM_MAKEFLAGS) install \
          && $(MAKE) $(AM_MAKEFLAGS) installcheck \
@@ -1865,7 +2320,8 @@ installdirs: installdirs-recursive
 installdirs-am:
 install: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) install-recursive
-install-exec: install-exec-recursive
+install-exec: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive
 install-data: install-data-recursive
 uninstall: uninstall-recursive
 
@@ -1967,22 +2423,23 @@ ps-am:
 uninstall-am:
 
 .MAKE: $(am__recursive_targets) all check install install-am \
-       install-strip
+       install-exec install-strip
 
 .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
        am--refresh check check-am clean clean-cscope clean-generic \
        cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
        dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \
-       dist-zip distcheck distclean distclean-generic distclean-tags \
-       distcleancheck distdir distuninstallcheck dvi dvi-am html \
-       html-am info info-am install install-am install-data \
-       install-data-am install-dvi install-dvi-am install-exec \
-       install-exec-am install-html install-html-am install-info \
-       install-info-am install-man install-pdf install-pdf-am \
-       install-ps install-ps-am install-strip installcheck \
-       installcheck-am installdirs installdirs-am maintainer-clean \
-       maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-       pdf-am ps ps-am tags tags-am uninstall uninstall-am
+       dist-zip dist-zstd distcheck distclean distclean-generic \
+       distclean-tags distcleancheck distdir distuninstallcheck dvi \
+       dvi-am html html-am info info-am install install-am \
+       install-data install-data-am install-dvi install-dvi-am \
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs installdirs-am \
+       maintainer-clean maintainer-clean-generic mostlyclean \
+       mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
+       uninstall-am
 
 .PRECIOUS: Makefile
 
diff --git a/NEWS b/NEWS
index 356b6bc..99aa4aa 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,29 @@
 GNU M4 NEWS - User visible changes.
 
+* Noteworthy changes in release 1.4.19 (2021-05-28) [stable]
+
+** A number of portability improvements inherited from gnulib, including
+   the ability to perform stack overflow detection on more platforms
+   without linking to GNU libsigsegv.
+
+* Noteworthy changes in release 1.4.18d (2021-05-11) [beta]
+
+** A number of portability improvements inherited from gnulib.
+
+
+* Noteworthy changes in release 1.4.18b (2021-05-07) [beta]
+
+** The symbol hash table now defaults to 65537 buckets instead of 509, as
+   modern systems have enough memory to benefit from fewer hash collisions
+   by default.
+
+** Introduce the use of gettext, with the immediate benefit of nicer
+   UTF-8 author names.  Over time, more translations of program messages
+   will become available.
+
+** A number of portability improvements inherited from gnulib.
+
+
 * Noteworthy changes in release 1.4.18 (2016-12-31) [stable]
 
 ** Diagnose --word-regexp as unsupported if it was not configured.
@@ -112,7 +136,7 @@ GNU M4 NEWS - User visible changes.
    overflow from other exceptions, such as Linux, you can optionally
    install the libsigsegv library (version 2.6 or newer recommended) to
    enhance m4's ability to accurately report stack overflow:
-   http://www.gnu.org/software/libsigsegv/
+   https://www.gnu.org/software/libsigsegv/
 
 ** A number of portability improvements inherited from gnulib.
 
@@ -635,7 +659,7 @@ detected, then sources are unprotoized on the fly before compilation.
 
 * GNU m4 uses newer versions of obstack, regex, getopt, etc.
 \f
-Version 1.0 - October 1991, by Rene' Seindal
+Version 1.0 - October 1991, by René Seindal
 
 * Uses GNU configure, taken from the gdb distribution.
 
@@ -648,7 +672,7 @@ or superflous arguments to built-in macros.
 
 * Several minor bugs have been fixed.
 \f
-Version 0.99 - July 1991, by Rene' Seindal
+Version 0.99 - July 1991, by René Seindal
 
 * The builtins `incr' and `decr' are now implemented without use of
 `eval'.
@@ -677,7 +701,7 @@ available.
 
 * Several typos in the manual has been corrected.  More probably persist.
 \f
-Version 0.75 - November 1990, by Rene' Seindal
+Version 0.75 - November 1990, by René Seindal
 
 * Implemented search path for include files (-I option and M4PATH
 environment variable).
@@ -710,7 +734,7 @@ not used.  With -G, `unix' is still defined.
 
 * Fixed two missing null bytes bugs.
 \f
-Version 0.50 - January 1990, by Rene' Seindal
+Version 0.50 - January 1990, by René Seindal
 
 * Initial beta release.
 
@@ -721,7 +745,8 @@ mode: outline
 fill-column: 75
 End:
 
-Copyright (C) 1992-1994, 2004-2014, 2016 Free Software Foundation, Inc.
+Copyright (C) 1992-1994, 2004-2014, 2016-2017, 2020-2021 Free Software
+Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
diff --git a/README b/README
index d4ef916..93d1072 100644 (file)
--- a/README
+++ b/README
@@ -5,7 +5,7 @@ to macros).  `m4' also has built-in functions for including files,
 running shell commands, doing arithmetic, etc.  Autoconf needs GNU
 `m4' for generating `configure' scripts, but not for running them.
 
-GNU `m4' was originally written by Rene' Seindal, from Denmark.
+GNU `m4' was originally written by René Seindal, from Denmark.
 This release is considered stable.
 
 If GNU `m4' is meant to serve GNU `autoconf', beware that `m4'
@@ -20,7 +20,7 @@ from git, more information can be found in the version-control-only
 file HACKING.
 
 M4 has an optional dependency on the libsigsegv library:
-  http://www.gnu.org/software/libsigsegv/
+  https://www.gnu.org/software/libsigsegv/
 If the library has not been installed in the standard location, you
 can use `./configure --with-libsigsegv-prefix=/path/to/dir', to make
 the build of `m4' use /path/to/dir/include/sigsegv.h as appropriate.
@@ -64,9 +64,29 @@ solution, from which the problem might be uneasy to infer.
 For any copyright year range specified as YYYY-ZZZZ in this package
 note that the range specifies every single year in that closed interval.
 
+GNU Project notice
+==================
+GNU M4 is part of the GNU Operating System, developed by the GNU Project.
+
+If you are the author of an awesome program and want to join us in
+writing Free (libre) Software, please consider making it an official
+GNU program and become a GNU Maintainer.  Instructions on how to do
+this are here:
+  https://www.gnu.org/help/evaluation
+
+Don't have a program to contribute?  Look at all the other ways to help:
+  https://www.gnu.org/help/help.html
+
+And to learn more about Free (libre) Software in general, please read
+and share this page:
+  https://gnu.org/philosophy/free-sw.html
+
+We are looking forward to hacking with you!
+
 ========================================================================
 
-Copyright (C) 2000, 2005-2014, 2016 Free Software Foundation, Inc.
+Copyright (C) 2000, 2005-2014, 2016-2017, 2020-2021 Free Software
+Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
diff --git a/THANKS b/THANKS
index bcd99a1..86eab32 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -140,7 +140,8 @@ Local Variables:
 coding: utf-8
 End:
 
-Copyright (C) 2000, 2006-2014, 2016 Free Software Foundation, Inc.
+Copyright (C) 2000, 2006-2014, 2016-2017, 2020-2021 Free Software
+Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
diff --git a/TODO b/TODO
index 55b5d1c..b6c9e54 100644 (file)
--- a/TODO
+++ b/TODO
@@ -37,8 +37,8 @@ mode: outline
 outline-regexp: " *[-+*.] \\|\f"
 End:
 
-Copyright (C) 2000, 2006-2007, 2009-2014, 2016 Free Software Foundation,
-Inc.
+Copyright (C) 2000, 2006-2007, 2009-2014, 2016-2017, 2020-2021 Free
+Software Foundation, Inc.
 
 Permission is granted to copy, distribute and/or modify this document
 under the terms of the GNU Free Documentation License, Version 1.3 or
index a465b1c..047cafb 100644 (file)
@@ -1,7 +1,7 @@
 # Local additions to Autoconf macros.
-# Copyright (C) 1992, 1994, 2004, 2006, 2008-2014, 2016 Free Software
-# Foundation, Inc.
-# Francois Pinard <pinard@iro.umontreal.ca>, 1992.
+# Copyright (C) 1992, 1994, 2004, 2006, 2008-2014, 2016-2017, 2020-2021
+# Free Software Foundation, Inc.
+# François Pinard <pinard@iro.umontreal.ca>, 1992.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 5afbfdd..6d248d6 100644 (file)
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.15 -*- Autoconf -*-
+# generated automatically by aclocal 1.16.3 -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
-[m4_warning([this file was generated for autoconf 2.69.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.71],,
+[m4_warning([this file was generated for autoconf 2.71.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
-# po.m4 serial 24 (gettext-0.19)
-dnl Copyright (C) 1995-2014, 2016 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-dnl
-dnl This file can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
-dnl License but which still want to provide support for the GNU gettext
-dnl functionality.
-dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package is covered by the GNU General Public License.
-dnl They are *not* in the public domain.
-
-dnl Authors:
-dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
-dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
-
-AC_PREREQ([2.60])
-
-dnl Checks for all prerequisites of the po subdirectory.
-AC_DEFUN([AM_PO_SUBDIRS],
-[
-  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
-  AC_REQUIRE([AC_PROG_INSTALL])dnl
-  AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-  AC_REQUIRE([AC_PROG_SED])dnl
-  AC_REQUIRE([AM_NLS])dnl
-
-  dnl Release version of the gettext macros. This is used to ensure that
-  dnl the gettext macros and po/Makefile.in.in are in sync.
-  AC_SUBST([GETTEXT_MACRO_VERSION], [0.19])
-
-  dnl Perform the following tests also if --disable-nls has been given,
-  dnl because they are needed for "make dist" to work.
-
-  dnl Search for GNU msgfmt in the PATH.
-  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
-  dnl The second test excludes FreeBSD msgfmt.
-  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
-    [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
-     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
-    :)
-  AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
-
-  dnl Test whether it is GNU msgfmt >= 0.15.
-changequote(,)dnl
-  case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
-    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
-    *) MSGFMT_015=$MSGFMT ;;
-  esac
-changequote([,])dnl
-  AC_SUBST([MSGFMT_015])
-changequote(,)dnl
-  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
-    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
-    *) GMSGFMT_015=$GMSGFMT ;;
-  esac
-changequote([,])dnl
-  AC_SUBST([GMSGFMT_015])
-
-  dnl Search for GNU xgettext 0.12 or newer in the PATH.
-  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
-  dnl The second test excludes FreeBSD xgettext.
-  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
-    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
-     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
-    :)
-  dnl Remove leftover from FreeBSD xgettext call.
-  rm -f messages.po
-
-  dnl Test whether it is GNU xgettext >= 0.15.
-changequote(,)dnl
-  case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
-    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
-    *) XGETTEXT_015=$XGETTEXT ;;
-  esac
-changequote([,])dnl
-  AC_SUBST([XGETTEXT_015])
-
-  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
-  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
-    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
-
-  dnl Installation directories.
-  dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
-  dnl have to define it here, so that it can be used in po/Makefile.
-  test -n "$localedir" || localedir='${datadir}/locale'
-  AC_SUBST([localedir])
-
-  dnl Support for AM_XGETTEXT_OPTION.
-  test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
-  AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
-
-  AC_CONFIG_COMMANDS([po-directories], [[
-    for ac_file in $CONFIG_FILES; do
-      # Support "outfile[:infile[:infile...]]"
-      case "$ac_file" in
-        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
-      esac
-      # PO directories have a Makefile.in generated from Makefile.in.in.
-      case "$ac_file" in */Makefile.in)
-        # Adjust a relative srcdir.
-        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
-        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
-        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
-        # In autoconf-2.13 it is called $ac_given_srcdir.
-        # In autoconf-2.50 it is called $srcdir.
-        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
-        case "$ac_given_srcdir" in
-          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
-          /*) top_srcdir="$ac_given_srcdir" ;;
-          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
-        esac
-        # Treat a directory as a PO directory if and only if it has a
-        # POTFILES.in file. This allows packages to have multiple PO
-        # directories under different names or in different locations.
-        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
-          rm -f "$ac_dir/POTFILES"
-          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
-          gt_tab=`printf '\t'`
-          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
-          POMAKEFILEDEPS="POTFILES.in"
-          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
-          # on $ac_dir but don't depend on user-specified configuration
-          # parameters.
-          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
-            # The LINGUAS file contains the set of available languages.
-            if test -n "$OBSOLETE_ALL_LINGUAS"; then
-              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
-            fi
-            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
-            # Hide the ALL_LINGUAS assignment from automake < 1.5.
-            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
-            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
-          else
-            # The set of available languages was given in configure.in.
-            # Hide the ALL_LINGUAS assignment from automake < 1.5.
-            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
-          fi
-          # Compute POFILES
-          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
-          # Compute UPDATEPOFILES
-          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
-          # Compute DUMMYPOFILES
-          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
-          # Compute GMOFILES
-          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
-          case "$ac_given_srcdir" in
-            .) srcdirpre= ;;
-            *) srcdirpre='$(srcdir)/' ;;
-          esac
-          POFILES=
-          UPDATEPOFILES=
-          DUMMYPOFILES=
-          GMOFILES=
-          for lang in $ALL_LINGUAS; do
-            POFILES="$POFILES $srcdirpre$lang.po"
-            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
-            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
-            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
-          done
-          # CATALOGS depends on both $ac_dir and the user's LINGUAS
-          # environment variable.
-          INST_LINGUAS=
-          if test -n "$ALL_LINGUAS"; then
-            for presentlang in $ALL_LINGUAS; do
-              useit=no
-              if test "%UNSET%" != "$LINGUAS"; then
-                desiredlanguages="$LINGUAS"
-              else
-                desiredlanguages="$ALL_LINGUAS"
-              fi
-              for desiredlang in $desiredlanguages; do
-                # Use the presentlang catalog if desiredlang is
-                #   a. equal to presentlang, or
-                #   b. a variant of presentlang (because in this case,
-                #      presentlang can be used as a fallback for messages
-                #      which are not translated in the desiredlang catalog).
-                case "$desiredlang" in
-                  "$presentlang"*) useit=yes;;
-                esac
-              done
-              if test $useit = yes; then
-                INST_LINGUAS="$INST_LINGUAS $presentlang"
-              fi
-            done
-          fi
-          CATALOGS=
-          if test -n "$INST_LINGUAS"; then
-            for lang in $INST_LINGUAS; do
-              CATALOGS="$CATALOGS $lang.gmo"
-            done
-          fi
-          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
-          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
-          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
-            if test -f "$f"; then
-              case "$f" in
-                *.orig | *.bak | *~) ;;
-                *) cat "$f" >> "$ac_dir/Makefile" ;;
-              esac
-            fi
-          done
-        fi
-        ;;
-      esac
-    done]],
-   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
-    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
-    # from automake < 1.5.
-    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
-    # Capture the value of LINGUAS because we need it to compute CATALOGS.
-    LINGUAS="${LINGUAS-%UNSET%}"
-   ])
-])
-
-dnl Postprocesses a Makefile in a directory containing PO files.
-AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
-[
-  # When this code is run, in config.status, two variables have already been
-  # set:
-  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
-  # - LINGUAS is the value of the environment variable LINGUAS at configure
-  #   time.
-
-changequote(,)dnl
-  # Adjust a relative srcdir.
-  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
-  ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
-  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
-  # In autoconf-2.13 it is called $ac_given_srcdir.
-  # In autoconf-2.50 it is called $srcdir.
-  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
-  case "$ac_given_srcdir" in
-    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
-    /*) top_srcdir="$ac_given_srcdir" ;;
-    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
-  esac
-
-  # Find a way to echo strings without interpreting backslash.
-  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
-    gt_echo='echo'
-  else
-    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
-      gt_echo='printf %s\n'
-    else
-      echo_func () {
-        cat <<EOT
-$*
-EOT
-      }
-      gt_echo='echo_func'
-    fi
-  fi
-
-  # A sed script that extracts the value of VARIABLE from a Makefile.
-  tab=`printf '\t'`
-  sed_x_variable='
-# Test if the hold space is empty.
-x
-s/P/P/
-x
-ta
-# Yes it was empty. Look if we have the expected variable definition.
-/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
-  # Seen the first line of the variable definition.
-  s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
-  ba
-}
-bd
-:a
-# Here we are processing a line from the variable definition.
-# Remove comment, more precisely replace it with a space.
-s/#.*$/ /
-# See if the line ends in a backslash.
-tb
-:b
-s/\\$//
-# Print the line, without the trailing backslash.
-p
-tc
-# There was no trailing backslash. The end of the variable definition is
-# reached. Clear the hold space.
-s/^.*$//
-x
-bd
-:c
-# A trailing backslash means that the variable definition continues in the
-# next line. Put a nonempty string into the hold space to indicate this.
-s/^.*$/P/
-x
-:d
-'
-changequote([,])dnl
-
-  # Set POTFILES to the value of the Makefile variable POTFILES.
-  sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
-  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
-  # Compute POTFILES_DEPS as
-  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
-  POTFILES_DEPS=
-  for file in $POTFILES; do
-    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
-  done
-  POMAKEFILEDEPS=""
-
-  if test -n "$OBSOLETE_ALL_LINGUAS"; then
-    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
-  fi
-  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
-    # The LINGUAS file contains the set of available languages.
-    ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
-    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
-  else
-    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
-    sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
-    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
-  fi
-  # Hide the ALL_LINGUAS assignment from automake < 1.5.
-  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
-  # Compute POFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
-  # Compute UPDATEPOFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
-  # Compute DUMMYPOFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
-  # Compute GMOFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
-  # Compute PROPERTIESFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
-  # Compute CLASSFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
-  # Compute QMFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
-  # Compute MSGFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
-  # Compute RESOURCESDLLFILES
-  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
-  case "$ac_given_srcdir" in
-    .) srcdirpre= ;;
-    *) srcdirpre='$(srcdir)/' ;;
-  esac
-  POFILES=
-  UPDATEPOFILES=
-  DUMMYPOFILES=
-  GMOFILES=
-  PROPERTIESFILES=
-  CLASSFILES=
-  QMFILES=
-  MSGFILES=
-  RESOURCESDLLFILES=
-  for lang in $ALL_LINGUAS; do
-    POFILES="$POFILES $srcdirpre$lang.po"
-    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
-    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
-    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
-    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
-    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
-    QMFILES="$QMFILES $srcdirpre$lang.qm"
-    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
-    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
-    frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
-    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
-  done
-  # CATALOGS depends on both $ac_dir and the user's LINGUAS
-  # environment variable.
-  INST_LINGUAS=
-  if test -n "$ALL_LINGUAS"; then
-    for presentlang in $ALL_LINGUAS; do
-      useit=no
-      if test "%UNSET%" != "$LINGUAS"; then
-        desiredlanguages="$LINGUAS"
-      else
-        desiredlanguages="$ALL_LINGUAS"
-      fi
-      for desiredlang in $desiredlanguages; do
-        # Use the presentlang catalog if desiredlang is
-        #   a. equal to presentlang, or
-        #   b. a variant of presentlang (because in this case,
-        #      presentlang can be used as a fallback for messages
-        #      which are not translated in the desiredlang catalog).
-        case "$desiredlang" in
-          "$presentlang"*) useit=yes;;
-        esac
-      done
-      if test $useit = yes; then
-        INST_LINGUAS="$INST_LINGUAS $presentlang"
-      fi
-    done
-  fi
-  CATALOGS=
-  JAVACATALOGS=
-  QTCATALOGS=
-  TCLCATALOGS=
-  CSHARPCATALOGS=
-  if test -n "$INST_LINGUAS"; then
-    for lang in $INST_LINGUAS; do
-      CATALOGS="$CATALOGS $lang.gmo"
-      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
-      QTCATALOGS="$QTCATALOGS $lang.qm"
-      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
-      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
-      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
-      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
-    done
-  fi
-
-  sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
-  tab=`printf '\t'`
-  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
-    # Add dependencies that cannot be formulated as a simple suffix rule.
-    for lang in $ALL_LINGUAS; do
-      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
-      cat >> "$ac_file.tmp" <<EOF
-$frobbedlang.msg: $lang.po
-${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
-${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
-EOF
-    done
-  fi
-  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
-    # Add dependencies that cannot be formulated as a simple suffix rule.
-    for lang in $ALL_LINGUAS; do
-      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
-      cat >> "$ac_file.tmp" <<EOF
-$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
-${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
-${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
-EOF
-    done
-  fi
-  if test -n "$POMAKEFILEDEPS"; then
-    cat >> "$ac_file.tmp" <<EOF
-Makefile: $POMAKEFILEDEPS
-EOF
-  fi
-  mv "$ac_file.tmp" "$ac_file"
-])
-
-dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
-AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
-[
-  XGETTEXT_EXTRA_OPTIONS=
-])
-
-dnl Registers an option to be passed to xgettext in the po subdirectory.
-AC_DEFUN([AM_XGETTEXT_OPTION],
-[
-  AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
-])
-
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -486,10 +32,10 @@ AC_DEFUN([AM_XGETTEXT_OPTION],
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.15'
+[am__api_version='1.16'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.16.3], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -505,74 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.16.3])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
-# Copyright (C) 2011-2014 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_AR([ACT-IF-FAIL])
-# -------------------------
-# Try to determine the archiver interface, and trigger the ar-lib wrapper
-# if it is needed.  If the detection of archiver interface fails, run
-# ACT-IF-FAIL (default is to abort configure with a proper error message).
-AC_DEFUN([AM_PROG_AR],
-[AC_BEFORE([$0], [LT_INIT])dnl
-AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([ar-lib])dnl
-AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false])
-: ${AR=ar}
-
-AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface],
-  [AC_LANG_PUSH([C])
-   am_cv_ar_interface=ar
-   AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])],
-     [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
-      AC_TRY_EVAL([am_ar_try])
-      if test "$ac_status" -eq 0; then
-        am_cv_ar_interface=ar
-      else
-        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD'
-        AC_TRY_EVAL([am_ar_try])
-        if test "$ac_status" -eq 0; then
-          am_cv_ar_interface=lib
-        else
-          am_cv_ar_interface=unknown
-        fi
-      fi
-      rm -f conftest.lib libconftest.a
-     ])
-   AC_LANG_POP([C])])
-
-case $am_cv_ar_interface in
-ar)
-  ;;
-lib)
-  # Microsoft lib, so override with the ar-lib wrapper script.
-  # FIXME: It is wrong to rewrite AR.
-  # But if we don't then we get into trouble of one sort or another.
-  # A longer-term fix would be to have automake use am__AR in this case,
-  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
-  # similar.
-  AR="$am_aux_dir/ar-lib $AR"
-  ;;
-unknown)
-  m4_default([$1],
-             [AC_MSG_ERROR([could not determine $AR interface])])
-  ;;
-esac
-AC_SUBST([AR])dnl
-])
-
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -624,7 +110,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -655,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -846,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
 AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
@@ -860,49 +345,43 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  AS_CASE([$CONFIG_FILES],
+          [*\'*], [eval set x "$CONFIG_FILES"],
+          [*], [set x $CONFIG_FILES])
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`AS_DIRNAME("$mf")`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`AS_DIRNAME(["$file"])`
-      AS_MKDIR_P([$dirpart/$fdir])
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`AS_DIRNAME(["$am_mf"])`
+    am_filepart=`AS_BASENAME(["$am_mf"])`
+    AM_RUN_LOG([cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles]) || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  If GNU make was not used, consider
+    re-running the configure script with MAKE="gmake" (or whatever is
+    necessary).  You can also try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).])
+  fi
+  AS_UNSET([am_dirpart])
+  AS_UNSET([am_filepart])
+  AS_UNSET([am_mf])
+  AS_UNSET([am_rc])
+  rm -f conftest-deps.mk
 }
 ])# _AM_OUTPUT_DEPENDENCY_COMMANDS
 
@@ -911,18 +390,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
 # -----------------------------
 # This macro should only be invoked once -- use via AC_REQUIRE.
 #
-# This code is only required when automatic dependency tracking
-# is enabled.  FIXME.  This creates each '.P' file that we will
-# need in order to bootstrap the dependency handling code.
+# This code is only required when automatic dependency tracking is enabled.
+# This creates each '.Po' and '.Plo' makefile fragment that we'll need in
+# order to bootstrap the dependency handling code.
 AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 [AC_CONFIG_COMMANDS([depfiles],
      [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
-     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
-])
+     [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])])
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1009,8 +487,8 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
 AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
 # We need awk for the "check" target (and possibly the TAP driver).  The
 # system "awk" is bad on some platforms.
@@ -1077,7 +555,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -1119,7 +597,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1140,7 +618,7 @@ if test x"${install_sh+set}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1161,7 +639,7 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1169,49 +647,42 @@ AC_SUBST([am__leading_dot])])
 
 # AM_MAKE_INCLUDE()
 # -----------------
-# Check to see how make treats includes.
+# Check whether make has an 'include' directive that can support all
+# the idioms we need for our automatic dependency tracking code.
 AC_DEFUN([AM_MAKE_INCLUDE],
-[am_make=${MAKE-make}
-cat > confinc << 'END'
+[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive])
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-AC_MSG_CHECKING([for style of include used by $am_make])
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
-fi
-AC_SUBST([am__include])
-AC_SUBST([am__quote])
-AC_MSG_RESULT([$_am_result])
-rm -f confinc confmf
-])
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out])
+  AS_CASE([$?:`cat confinc.out 2>/dev/null`],
+      ['0:this is the am__doit target'],
+      [AS_CASE([$s],
+          [BSD], [am__include='.include' am__quote='"'],
+          [am__include='include' am__quote=''])])
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+AC_MSG_RESULT([${_am_result}])
+AC_SUBST([am__include])])
+AC_SUBST([am__quote])])
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+# Copyright (C) 1997-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1232,12 +703,7 @@ AC_DEFUN([AM_MISSING_HAS_RUN],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 AC_REQUIRE_AUX_FILE([missing])dnl
 if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\    *)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
+  MISSING="\${SHELL} '$am_aux_dir/missing'"
 fi
 # Use eval to expand $SHELL
 if eval "$MISSING --is-lightweight"; then
@@ -1250,7 +716,7 @@ fi
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1279,7 +745,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1326,7 +792,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1345,7 +811,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1426,7 +892,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2014 Free Software Foundation, Inc.
+# Copyright (C) 2009-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1486,7 +952,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+# Copyright (C) 2001-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1514,7 +980,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2014 Free Software Foundation, Inc.
+# Copyright (C) 2006-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1533,7 +999,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2014 Free Software Foundation, Inc.
+# Copyright (C) 2004-2020 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -1665,49 +1131,59 @@ AC_SUBST([am__untar])
 ]) # _AM_PROG_TAR
 
 m4_include([m4/00gnulib.m4])
+m4_include([m4/__inline.m4])
 m4_include([m4/absolute-header.m4])
+m4_include([m4/access.m4])
 m4_include([m4/alloca.m4])
 m4_include([m4/ansi-c++.m4])
+m4_include([m4/arpa_inet_h.m4])
 m4_include([m4/asm-underscore.m4])
 m4_include([m4/assert.m4])
 m4_include([m4/autobuild.m4])
 m4_include([m4/btowc.m4])
 m4_include([m4/builtin-expect.m4])
 m4_include([m4/c-stack.m4])
+m4_include([m4/calloc.m4])
 m4_include([m4/canonicalize.m4])
-m4_include([m4/close-stream.m4])
+m4_include([m4/chdir-long.m4])
+m4_include([m4/clock_time.m4])
 m4_include([m4/close.m4])
 m4_include([m4/closedir.m4])
-m4_include([m4/closein.m4])
-m4_include([m4/closeout.m4])
 m4_include([m4/codeset.m4])
 m4_include([m4/config-h.m4])
 m4_include([m4/configmake.m4])
-m4_include([m4/ctype.m4])
+m4_include([m4/creat.m4])
+m4_include([m4/ctype_h.m4])
+m4_include([m4/d-ino.m4])
 m4_include([m4/dirent_h.m4])
 m4_include([m4/dirfd.m4])
-m4_include([m4/dirname.m4])
 m4_include([m4/double-slash-root.m4])
 m4_include([m4/dup.m4])
 m4_include([m4/dup2.m4])
+m4_include([m4/eaccess.m4])
 m4_include([m4/eealloc.m4])
 m4_include([m4/environ.m4])
 m4_include([m4/errno_h.m4])
 m4_include([m4/error.m4])
 m4_include([m4/execute.m4])
+m4_include([m4/explicit_bzero.m4])
 m4_include([m4/exponentd.m4])
 m4_include([m4/exponentf.m4])
 m4_include([m4/exponentl.m4])
 m4_include([m4/extensions.m4])
 m4_include([m4/extern-inline.m4])
 m4_include([m4/fatal-signal.m4])
+m4_include([m4/fchdir.m4])
 m4_include([m4/fclose.m4])
 m4_include([m4/fcntl-o.m4])
 m4_include([m4/fcntl.m4])
 m4_include([m4/fcntl_h.m4])
 m4_include([m4/fdopen.m4])
+m4_include([m4/fdopendir.m4])
 m4_include([m4/fflush.m4])
 m4_include([m4/filenamecat.m4])
+m4_include([m4/findprog-in.m4])
+m4_include([m4/findprog.m4])
 m4_include([m4/flexmember.m4])
 m4_include([m4/float_h.m4])
 m4_include([m4/fopen.m4])
@@ -1716,33 +1192,50 @@ m4_include([m4/fpieee.m4])
 m4_include([m4/fpurge.m4])
 m4_include([m4/freadahead.m4])
 m4_include([m4/freading.m4])
+m4_include([m4/free.m4])
+m4_include([m4/freopen.m4])
 m4_include([m4/frexp.m4])
 m4_include([m4/frexpl.m4])
 m4_include([m4/fseek.m4])
 m4_include([m4/fseeko.m4])
 m4_include([m4/fstat.m4])
+m4_include([m4/fstatat.m4])
 m4_include([m4/ftell.m4])
 m4_include([m4/ftello.m4])
+m4_include([m4/ftruncate.m4])
+m4_include([m4/getcwd-abort-bug.m4])
+m4_include([m4/getcwd-path-max.m4])
 m4_include([m4/getcwd.m4])
 m4_include([m4/getdtablesize.m4])
 m4_include([m4/getopt.m4])
 m4_include([m4/getpagesize.m4])
 m4_include([m4/getprogname.m4])
+m4_include([m4/getrandom.m4])
+m4_include([m4/gettext.m4])
 m4_include([m4/gettimeofday.m4])
-m4_include([m4/glibc21.m4])
 m4_include([m4/gnulib-common.m4])
 m4_include([m4/gnulib-comp.m4])
-m4_include([m4/hard-locale.m4])
+m4_include([m4/host-cpu-c-abi.m4])
+m4_include([m4/iconv.m4])
+m4_include([m4/iconv_h.m4])
+m4_include([m4/iconv_open.m4])
 m4_include([m4/include_next.m4])
+m4_include([m4/inet_pton.m4])
+m4_include([m4/inline.m4])
+m4_include([m4/intl-thread-locale.m4])
 m4_include([m4/intlmacosx.m4])
 m4_include([m4/intmax_t.m4])
-m4_include([m4/inttypes-pri.m4])
+m4_include([m4/inttostr.m4])
 m4_include([m4/inttypes.m4])
 m4_include([m4/inttypes_h.m4])
+m4_include([m4/ioctl.m4])
 m4_include([m4/isblank.m4])
 m4_include([m4/isnand.m4])
 m4_include([m4/isnanf.m4])
 m4_include([m4/isnanl.m4])
+m4_include([m4/iswblank.m4])
+m4_include([m4/iswdigit.m4])
+m4_include([m4/iswxdigit.m4])
 m4_include([m4/langinfo_h.m4])
 m4_include([m4/largefile.m4])
 m4_include([m4/lcmessage.m4])
@@ -1752,6 +1245,7 @@ m4_include([m4/lib-ld.m4])
 m4_include([m4/lib-link.m4])
 m4_include([m4/lib-prefix.m4])
 m4_include([m4/libsigsegv.m4])
+m4_include([m4/libunistring-base.m4])
 m4_include([m4/limits-h.m4])
 m4_include([m4/link.m4])
 m4_include([m4/localcharset.m4])
@@ -1770,12 +1264,18 @@ m4_include([m4/malloc.m4])
 m4_include([m4/malloca.m4])
 m4_include([m4/manywarnings.m4])
 m4_include([m4/math_h.m4])
+m4_include([m4/mbchar.m4])
+m4_include([m4/mbiter.m4])
 m4_include([m4/mbrtowc.m4])
 m4_include([m4/mbsinit.m4])
+m4_include([m4/mbslen.m4])
 m4_include([m4/mbstate_t.m4])
 m4_include([m4/mbtowc.m4])
 m4_include([m4/memchr.m4])
+m4_include([m4/mempcpy.m4])
+m4_include([m4/memrchr.m4])
 m4_include([m4/minmax.m4])
+m4_include([m4/mkdir.m4])
 m4_include([m4/mkdtemp.m4])
 m4_include([m4/mkstemp.m4])
 m4_include([m4/mmap-anon.m4])
@@ -1783,33 +1283,60 @@ m4_include([m4/mode_t.m4])
 m4_include([m4/msvc-inval.m4])
 m4_include([m4/msvc-nothrow.m4])
 m4_include([m4/multiarch.m4])
+m4_include([m4/musl.m4])
+m4_include([m4/nanosleep.m4])
+m4_include([m4/netinet_in_h.m4])
 m4_include([m4/nl_langinfo.m4])
+m4_include([m4/nls.m4])
 m4_include([m4/nocrash.m4])
 m4_include([m4/obstack.m4])
 m4_include([m4/off_t.m4])
+m4_include([m4/open-cloexec.m4])
+m4_include([m4/open-slash.m4])
 m4_include([m4/open.m4])
+m4_include([m4/openat.m4])
 m4_include([m4/opendir.m4])
 m4_include([m4/pathmax.m4])
+m4_include([m4/perror.m4])
+m4_include([m4/pipe.m4])
 m4_include([m4/pipe2.m4])
+m4_include([m4/po.m4])
 m4_include([m4/posix_spawn.m4])
+m4_include([m4/posix_spawn_faction_addchdir.m4])
 m4_include([m4/printf-frexp.m4])
 m4_include([m4/printf-frexpl.m4])
 m4_include([m4/printf.m4])
+m4_include([m4/progtest.m4])
+m4_include([m4/pthread-thread.m4])
+m4_include([m4/pthread_h.m4])
+m4_include([m4/pthread_rwlock_rdlock.m4])
+m4_include([m4/pthread_sigmask.m4])
 m4_include([m4/putenv.m4])
 m4_include([m4/quotearg.m4])
 m4_include([m4/raise.m4])
 m4_include([m4/rawmemchr.m4])
+m4_include([m4/read-file.m4])
 m4_include([m4/readdir.m4])
 m4_include([m4/readlink.m4])
+m4_include([m4/realloc.m4])
+m4_include([m4/reallocarray.m4])
 m4_include([m4/regex.m4])
 m4_include([m4/rename.m4])
+m4_include([m4/rewinddir.m4])
 m4_include([m4/rmdir.m4])
+m4_include([m4/save-cwd.m4])
 m4_include([m4/sched_h.m4])
+m4_include([m4/sched_yield.m4])
 m4_include([m4/secure_getenv.m4])
+m4_include([m4/select.m4])
+m4_include([m4/semaphore.m4])
 m4_include([m4/setenv.m4])
 m4_include([m4/setlocale.m4])
+m4_include([m4/setlocale_null.m4])
+m4_include([m4/sh-filename.m4])
 m4_include([m4/sig_atomic_t.m4])
 m4_include([m4/sigaction.m4])
+m4_include([m4/sigaltstack.m4])
 m4_include([m4/signal_h.m4])
 m4_include([m4/signalblocking.m4])
 m4_include([m4/signbit.m4])
@@ -1817,9 +1344,16 @@ m4_include([m4/sigpipe.m4])
 m4_include([m4/size_max.m4])
 m4_include([m4/sleep.m4])
 m4_include([m4/snprintf.m4])
+m4_include([m4/socketlib.m4])
+m4_include([m4/sockets.m4])
+m4_include([m4/socklen.m4])
+m4_include([m4/sockpfaf.m4])
+m4_include([m4/sparcv8+.m4])
 m4_include([m4/spawn-pipe.m4])
 m4_include([m4/spawn_h.m4])
 m4_include([m4/ssize_t.m4])
+m4_include([m4/stack-direction.m4])
+m4_include([m4/stat-time.m4])
 m4_include([m4/stat.m4])
 m4_include([m4/stdalign.m4])
 m4_include([m4/stdarg.m4])
@@ -1829,9 +1363,11 @@ m4_include([m4/stdint.m4])
 m4_include([m4/stdint_h.m4])
 m4_include([m4/stdio_h.m4])
 m4_include([m4/stdlib_h.m4])
+m4_include([m4/stpcpy.m4])
 m4_include([m4/strchrnul.m4])
 m4_include([m4/strdup.m4])
 m4_include([m4/strerror.m4])
+m4_include([m4/strerror_r.m4])
 m4_include([m4/string_h.m4])
 m4_include([m4/strndup.m4])
 m4_include([m4/strnlen.m4])
@@ -1839,12 +1375,17 @@ m4_include([m4/strsignal.m4])
 m4_include([m4/strstr.m4])
 m4_include([m4/strtod.m4])
 m4_include([m4/symlink.m4])
+m4_include([m4/sys_ioctl_h.m4])
+m4_include([m4/sys_random_h.m4])
+m4_include([m4/sys_select_h.m4])
 m4_include([m4/sys_socket_h.m4])
 m4_include([m4/sys_stat_h.m4])
 m4_include([m4/sys_time_h.m4])
 m4_include([m4/sys_types_h.m4])
+m4_include([m4/sys_uio_h.m4])
 m4_include([m4/sys_wait_h.m4])
 m4_include([m4/tempname.m4])
+m4_include([m4/thread.m4])
 m4_include([m4/threadlib.m4])
 m4_include([m4/time_h.m4])
 m4_include([m4/tls.m4])
@@ -1857,6 +1398,7 @@ m4_include([m4/vasnprintf.m4])
 m4_include([m4/vasprintf-posix.m4])
 m4_include([m4/vasprintf.m4])
 m4_include([m4/version-etc.m4])
+m4_include([m4/visibility.m4])
 m4_include([m4/wait-process.m4])
 m4_include([m4/waitpid.m4])
 m4_include([m4/warnings.m4])
@@ -1866,10 +1408,13 @@ m4_include([m4/wcrtomb.m4])
 m4_include([m4/wctob.m4])
 m4_include([m4/wctomb.m4])
 m4_include([m4/wctype_h.m4])
+m4_include([m4/wcwidth.m4])
 m4_include([m4/wint_t.m4])
 m4_include([m4/write.m4])
 m4_include([m4/xalloc.m4])
 m4_include([m4/xsize.m4])
 m4_include([m4/xstrndup.m4])
 m4_include([m4/xvasprintf.m4])
+m4_include([m4/yield.m4])
+m4_include([m4/zzgnulib.m4])
 m4_include([acinclude.m4])
index 4b57abd..b9326ba 100755 (executable)
--- a/bootstrap
+++ b/bootstrap
@@ -1,36 +1,30 @@
 #! /bin/sh
 ## DO NOT EDIT - This file generated from build-aux/bootstrap.in
-##               by inline-source v2014-01-03.01
+##               by inline-source v2019-02-19.15
 
 # Bootstrap an Autotooled package from checked-out sources.
 # Written by Gary V. Vaughan, 2010
+# Inspired by a script written by Paul Eggert.
 
-# Copyright (C) 2010-2014, 2016 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# This is free software.  There is NO warranty; not even for
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copyright (C) 2010-2019 Bootstrap Authors
+#
+# This file is dual licensed under the terms of the MIT license
+# <https://opensource.org/license/MIT>, and GPL version 2 or later
+# <http://www.gnu.org/licenses/gpl-2.0.html>.  You must apply one of
+# these licenses when using or redistributing this software or any of
+# the files within it.  See the URLs above, or the file `LICENSE`
+# included in the Bootstrap distribution for the full license texts.
 
-# Originally written by Paul Eggert.  The canonical version of this
-# script is maintained as build-aux/bootstrap in gnulib, however, to
-# be useful to your project, you should place a copy of it under
-# version control in the top-level directory of your project.  The
-# intent is that all customization can be done with a bootstrap.conf
-# file also maintained in your version control; gnulib comes with a
-# template build-aux/bootstrap.conf to get you started.
+# You should place a copy of this script under version control in the
+# top-level directory of your project.  The intent is that all
+# customization can be done with a `bootstrap.conf` file also maintained
+# in your version control.
 
-# Please report bugs or propose patches to bug-gnulib@gnu.org.
+# Please report bugs or propose patches to:
+# <https://github.com/gnulib-modules/bootstrap/issues>
 
 
 ## ------ ##
@@ -138,7 +132,7 @@ package_bugreport=
 doc_base=
 gnulib_mk=
 gnulib_name=
-local_gl_dir=
+local_gl_path=
 source_base=
 tests_base=
 
@@ -166,6 +160,9 @@ gnulib_non_module_files="
 gnulib_path=
 gnulib_url=
 
+# Date from which to clone github, to avoid a full clone.
+gnulib_clone_since=
+
 # Additional gnulib-tool options to use.
 gnulib_tool_options="
         --no-changelog
@@ -230,34 +227,25 @@ vc_ignore=
 
 # Source required external libraries:
 # Set a version string for this script.
-scriptversion=2014-01-03.01; # UTC
+scriptversion=2019-02-19.15; # UTC
 
 # General shell script boiler plate, and helper functions.
 # Written by Gary V. Vaughan, 2004
 
-# Copyright (C) 2004-2014, 2016 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-
-# As a special exception to the GNU General Public License, if you distribute
-# this file as part of a program or library that is built using GNU Libtool,
-# you may include this file under the same distribution terms that you use
-# for the rest of that program.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# This is free software.  There is NO warranty; not even for
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copyright (C) 2004-2019 Bootstrap Authors
+#
+# This file is dual licensed under the terms of the MIT license
+# <https://opensource.org/license/MIT>, and GPL version 2 or later
+# <http://www.gnu.org/licenses/gpl-2.0.html>.  You must apply one of
+# these licenses when using or redistributing this software or any of
+# the files within it.  See the URLs above, or the file `LICENSE`
+# included in the Bootstrap distribution for the full license texts.
 
-# Please report bugs or propose patches to gary@gnu.org.
+# Please report bugs or propose patches to:
+# <https://github.com/gnulib-modules/bootstrap/issues>
 
 
 ## ------ ##
@@ -306,9 +294,6 @@ do
        fi"
 done
 
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
-
 # Make sure IFS has a sensible default
 sp=' '
 nl='
@@ -325,6 +310,26 @@ if test "${PATH_SEPARATOR+set}" != set; then
 fi
 
 
+# func_unset VAR
+# --------------
+# Portably unset VAR.
+# In some shells, an 'unset VAR' statement leaves a non-zero return
+# status if VAR is already unset, which might be problematic if the
+# statement is used at the end of a function (thus poisoning its return
+# value) or when 'set -e' is active (causing even a spurious abort of
+# the script in this case).
+func_unset ()
+{
+    { eval $1=; (eval unset $1) >/dev/null 2>&1 && eval unset $1 || : ; }
+}
+
+
+# Make sure CDPATH doesn't cause `cd` commands to output the target dir.
+func_unset CDPATH
+
+# Make sure ${,E,F}GREP behave sanely.
+func_unset GREP_OPTIONS
+
 
 ## ------------------------- ##
 ## Locate command utilities. ##
@@ -358,7 +363,7 @@ func_path_progs ()
 
     _G_path_prog_max=0
     _G_path_prog_found=false
-    _G_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+    _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
     for _G_dir in $_G_PATH; do
       IFS=$_G_save_IFS
       test -z "$_G_dir" && _G_dir=.
@@ -425,7 +430,7 @@ test -z "$SED" && {
     rm -f conftest.in conftest.tmp conftest.nl conftest.out
   }
 
-  func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+  func_path_progs "sed gsed" func_check_prog_sed "$PATH:/usr/xpg4/bin"
   rm -f conftest.sed
   SED=$func_path_progs_result
 }
@@ -461,7 +466,7 @@ test -z "$GREP" && {
     rm -f conftest.in conftest.tmp conftest.nl conftest.out
   }
 
-  func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+  func_path_progs "grep ggrep" func_check_prog_grep "$PATH:/usr/xpg4/bin"
   GREP=$func_path_progs_result
 }
 
@@ -746,16 +751,16 @@ if test yes = "$_G_HAVE_PLUSEQ_OP"; then
   {
     $debug_cmd
 
-    func_quote_for_eval "$2"
-    eval "$1+=\\ \$func_quote_for_eval_result"
+    func_quote_arg pretty "$2"
+    eval "$1+=\\ \$func_quote_arg_result"
   }'
 else
   func_append_quoted ()
   {
     $debug_cmd
 
-    func_quote_for_eval "$2"
-    eval "$1=\$$1\\ \$func_quote_for_eval_result"
+    func_quote_arg pretty "$2"
+    eval "$1=\$$1\\ \$func_quote_arg_result"
   }
 fi
 
@@ -1257,85 +1262,199 @@ func_relative_path ()
 }
 
 
-# func_quote_for_eval ARG...
-# --------------------------
-# Aesthetically quote ARGs to be evaled later.
-# This function returns two values:
-#   i) func_quote_for_eval_result
-#      double-quoted, suitable for a subsequent eval
-#  ii) func_quote_for_eval_unquoted_result
-#      has all characters that are still active within double
-#      quotes backslashified.
-func_quote_for_eval ()
+# func_quote_portable EVAL ARG
+# ----------------------------
+# Internal function to portably implement func_quote_arg.  Note that we still
+# keep attention to performance here so we as much as possible try to avoid
+# calling sed binary (so far O(N) complexity as long as func_append is O(1)).
+func_quote_portable ()
 {
     $debug_cmd
 
-    func_quote_for_eval_unquoted_result=
-    func_quote_for_eval_result=
-    while test 0 -lt $#; do
-      case $1 in
-        *[\\\`\"\$]*)
-         _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
-        *)
-          _G_unquoted_arg=$1 ;;
-      esac
-      if test -n "$func_quote_for_eval_unquoted_result"; then
-       func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
-      else
-        func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+    func_quote_portable_result=$2
+
+    # one-time-loop (easy break)
+    while true
+    do
+      if $1; then
+        func_quote_portable_result=`$ECHO "$2" | $SED \
+          -e "$sed_double_quote_subst" -e "$sed_double_backslash"`
+        break
       fi
 
-      case $_G_unquoted_arg in
-        # Double-quote args containing shell metacharacters to delay
-        # word splitting, command substitution and variable expansion
-        # for a subsequent eval.
-        # Many Bourne shells cannot handle close brackets correctly
-        # in scan sets, so we specify it separately.
-        *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \  ]*|*]*|"")
-          _G_quoted_arg=\"$_G_unquoted_arg\"
+      # Quote for eval.
+      case $func_quote_portable_result in
+        *[\\\`\"\$]*)
+          case $func_quote_portable_result in
+            *[\[\*\?]*)
+              func_quote_portable_result=`$ECHO "$func_quote_portable_result" \
+                  | $SED "$sed_quote_subst"`
+              break
+              ;;
+          esac
+
+          func_quote_portable_old_IFS=$IFS
+          for _G_char in '\' '`' '"' '$'
+          do
+            # STATE($1) PREV($2) SEPARATOR($3)
+            set start "" ""
+            func_quote_portable_result=dummy"$_G_char$func_quote_portable_result$_G_char"dummy
+            IFS=$_G_char
+            for _G_part in $func_quote_portable_result
+            do
+              case $1 in
+              quote)
+                func_append func_quote_portable_result "$3$2"
+                set quote "$_G_part" "\\$_G_char"
+                ;;
+              start)
+                set first "" ""
+                func_quote_portable_result=
+                ;;
+              first)
+                set quote "$_G_part" ""
+                ;;
+              esac
+            done
+          done
+          IFS=$func_quote_portable_old_IFS
           ;;
-        *)
-          _G_quoted_arg=$_G_unquoted_arg
-         ;;
+        *) ;;
       esac
-
-      if test -n "$func_quote_for_eval_result"; then
-       func_append func_quote_for_eval_result " $_G_quoted_arg"
-      else
-        func_append func_quote_for_eval_result "$_G_quoted_arg"
-      fi
-      shift
+      break
     done
+
+    func_quote_portable_unquoted_result=$func_quote_portable_result
+    case $func_quote_portable_result in
+      # double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and variable expansion
+      # for a subsequent eval.
+      # many bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+        func_quote_portable_result=\"$func_quote_portable_result\"
+        ;;
+    esac
 }
 
 
-# func_quote_for_expand ARG
-# -------------------------
-# Aesthetically quote ARG to be evaled later; same as above,
-# but do not quote variable references.
-func_quote_for_expand ()
-{
-    $debug_cmd
+# func_quotefast_eval ARG
+# -----------------------
+# Quote one ARG (internal).  This is equivalent to 'func_quote_arg eval ARG',
+# but optimized for speed.  Result is stored in $func_quotefast_eval.
+if test xyes = `(x=; printf -v x %q yes; echo x"$x") 2>/dev/null`; then
+  printf -v _GL_test_printf_tilde %q '~'
+  if test '\~' = "$_GL_test_printf_tilde"; then
+    func_quotefast_eval ()
+    {
+      printf -v func_quotefast_eval_result %q "$1"
+    }
+  else
+    # Broken older Bash implementations.  Make those faster too if possible.
+    func_quotefast_eval ()
+    {
+      case $1 in
+        '~'*)
+          func_quote_portable false "$1"
+          func_quotefast_eval_result=$func_quote_portable_result
+          ;;
+        *)
+          printf -v func_quotefast_eval_result %q "$1"
+          ;;
+      esac
+    }
+  fi
+else
+  func_quotefast_eval ()
+  {
+    func_quote_portable false "$1"
+    func_quotefast_eval_result=$func_quote_portable_result
+  }
+fi
 
-    case $1 in
-      *[\\\`\"]*)
-       _G_arg=`$ECHO "$1" | $SED \
-           -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
-      *)
-        _G_arg=$1 ;;
+
+# func_quote_arg MODEs ARG
+# ------------------------
+# Quote one ARG to be evaled later.  MODEs argument may contain zero or more
+# specifiers listed below separated by ',' character.  This function returns two
+# values:
+#   i) func_quote_arg_result
+#      double-quoted (when needed), suitable for a subsequent eval
+#  ii) func_quote_arg_unquoted_result
+#      has all characters that are still active within double
+#      quotes backslashified.  Available only if 'unquoted' is specified.
+#
+# Available modes:
+# ----------------
+# 'eval' (default)
+#       - escape shell special characters
+# 'expand'
+#       - the same as 'eval';  but do not quote variable references
+# 'pretty'
+#       - request aesthetic output, i.e. '"a b"' instead of 'a\ b'.  This might
+#         be used later in func_quote to get output like: 'echo "a b"' instead
+#         of 'echo a\ b'.  This is slower than default on some shells.
+# 'unquoted'
+#       - produce also $func_quote_arg_unquoted_result which does not contain
+#         wrapping double-quotes.
+#
+# Examples for 'func_quote_arg pretty,unquoted string':
+#
+#   string      | *_result              | *_unquoted_result
+#   ------------+-----------------------+-------------------
+#   "           | \"                    | \"
+#   a b         | "a b"                 | a b
+#   "a b"       | "\"a b\""             | \"a b\"
+#   *           | "*"                   | *
+#   z="${x-$y}" | "z=\"\${x-\$y}\""     | z=\"\${x-\$y}\"
+#
+# Examples for 'func_quote_arg pretty,unquoted,expand string':
+#
+#   string        |   *_result          |  *_unquoted_result
+#   --------------+---------------------+--------------------
+#   z="${x-$y}"   | "z=\"${x-$y}\""     | z=\"${x-$y}\"
+func_quote_arg ()
+{
+    _G_quote_expand=false
+    case ,$1, in
+      *,expand,*)
+        _G_quote_expand=:
+        ;;
     esac
 
-    case $_G_arg in
-      # Double-quote args containing shell metacharacters to delay
-      # word splitting and command substitution for a subsequent eval.
-      # Many Bourne shells cannot handle close brackets correctly
-      # in scan sets, so we specify it separately.
-      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
-        _G_arg=\"$_G_arg\"
+    case ,$1, in
+      *,pretty,*|*,expand,*|*,unquoted,*)
+        func_quote_portable $_G_quote_expand "$2"
+        func_quote_arg_result=$func_quote_portable_result
+        func_quote_arg_unquoted_result=$func_quote_portable_unquoted_result
+        ;;
+      *)
+        # Faster quote-for-eval for some shells.
+        func_quotefast_eval "$2"
+        func_quote_arg_result=$func_quotefast_eval_result
         ;;
     esac
+}
+
 
-    func_quote_for_expand_result=$_G_arg
+# func_quote MODEs ARGs...
+# ------------------------
+# Quote all ARGs to be evaled later and join them into single command.  See
+# func_quote_arg's description for more info.
+func_quote ()
+{
+    $debug_cmd
+    _G_func_quote_mode=$1 ; shift
+    func_quote_result=
+    while test 0 -lt $#; do
+      func_quote_arg "$_G_func_quote_mode" "$1"
+      if test -n "$func_quote_result"; then
+        func_append func_quote_result " $func_quote_arg_result"
+      else
+        func_append func_quote_result "$func_quote_arg_result"
+      fi
+      shift
+    done
 }
 
 
@@ -1381,8 +1500,8 @@ func_show_eval ()
     _G_cmd=$1
     _G_fail_exp=${2-':'}
 
-    func_quote_for_expand "$_G_cmd"
-    eval "func_notquiet $func_quote_for_expand_result"
+    func_quote_arg pretty,expand "$_G_cmd"
+    eval "func_notquiet $func_quote_arg_result"
 
     $opt_dry_run || {
       eval "$_G_cmd"
@@ -1407,8 +1526,8 @@ func_show_eval_locale ()
     _G_fail_exp=${2-':'}
 
     $opt_quiet || {
-      func_quote_for_expand "$_G_cmd"
-      eval "func_echo $func_quote_for_expand_result"
+      func_quote_arg expand,pretty "$_G_cmd"
+      eval "func_echo $func_quote_arg_result"
     }
 
     $opt_dry_run || {
@@ -1535,30 +1654,26 @@ func_lt_ver ()
 # End:
 #! /bin/sh
 
-# Set a version string for this script.
-scriptversion=2014-01-07.03; # UTC
-
 # A portable, pluggable option parser for Bourne shell.
 # Written by Gary V. Vaughan, 2010
 
-# Copyright (C) 2010-2014, 2016 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# This is free software.  There is NO warranty; not even for
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copyright (C) 2010-2019 Bootstrap Authors
+#
+# This file is dual licensed under the terms of the MIT license
+# <https://opensource.org/license/MIT>, and GPL version 2 or later
+# <http://www.gnu.org/licenses/gpl-2.0.html>.  You must apply one of
+# these licenses when using or redistributing this software or any of
+# the files within it.  See the URLs above, or the file `LICENSE`
+# included in the Bootstrap distribution for the full license texts.
 
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# Please report bugs or propose patches to:
+# <https://github.com/gnulib-modules/bootstrap/issues>
 
-# Please report bugs or propose patches to gary@gnu.org.
+# Set a version string for this script.
+scriptversion=2019-02-19.15; # UTC
 
 
 ## ------ ##
@@ -1581,7 +1696,7 @@ scriptversion=2014-01-07.03; # UTC
 #
 # In order for the '--version' option to work, you will need to have a
 # suitably formatted comment like the one at the top of this file
-# starting with '# Written by ' and ending with '# warranty; '.
+# starting with '# Written by ' and ending with '# Copyright'.
 #
 # For '-h' and '--help' to work, you will also need a one line
 # description of your script's purpose in a comment directly above the
@@ -1593,7 +1708,7 @@ scriptversion=2014-01-07.03; # UTC
 # to display verbose messages only when your user has specified
 # '--verbose'.
 #
-# After sourcing this file, you can plug processing for additional
+# After sourcing this file, you can plug in processing for additional
 # options by amending the variables from the 'Configuration' section
 # below, and following the instructions in the 'Option parsing'
 # section further down.
@@ -1642,8 +1757,8 @@ fatal_help="Try '\$progname --help' for more information."
 ## ------------------------- ##
 
 # This section contains functions for adding, removing, and running hooks
-# to the main code.  A hook is just a named list of of function, that can
-# be run in order later on.
+# in the main code.  A hook is just a list of function names that can be
+# run in order later on.
 
 # func_hookable FUNC_NAME
 # -----------------------
@@ -1676,7 +1791,8 @@ func_add_hook ()
 
 # func_remove_hook FUNC_NAME HOOK_FUNC
 # ------------------------------------
-# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+# Remove HOOK_FUNC from the list of hook functions to be called by
+# FUNC_NAME.
 func_remove_hook ()
 {
     $debug_cmd
@@ -1685,10 +1801,28 @@ func_remove_hook ()
 }
 
 
+# func_propagate_result FUNC_NAME_A FUNC_NAME_B
+# ---------------------------------------------
+# If the *_result variable of FUNC_NAME_A _is set_, assign its value to
+# *_result variable of FUNC_NAME_B.
+func_propagate_result ()
+{
+    $debug_cmd
+
+    func_propagate_result_result=:
+    if eval "test \"\${${1}_result+set}\" = set"
+    then
+      eval "${2}_result=\$${1}_result"
+    else
+      func_propagate_result_result=false
+    fi
+}
+
+
 # func_run_hooks FUNC_NAME [ARG]...
 # ---------------------------------
 # Run all hook functions registered to FUNC_NAME.
-# It is assumed that the list of hook functions contains nothing more
+# It's assumed that the list of hook functions contains nothing more
 # than a whitespace-delimited list of legal shell function names, and
 # no effort is wasted trying to catch shell meta-characters or preserve
 # whitespace.
@@ -1698,22 +1832,19 @@ func_run_hooks ()
 
     case " $hookable_fns " in
       *" $1 "*) ;;
-      *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+      *) func_fatal_error "'$1' does not support hook functions." ;;
     esac
 
     eval _G_hook_fns=\$$1_hooks; shift
 
     for _G_hook in $_G_hook_fns; do
-      eval $_G_hook '"$@"'
-
-      # store returned options list back into positional
-      # parameters for next 'cmd' execution.
-      eval _G_hook_result=\$${_G_hook}_result
-      eval set dummy "$_G_hook_result"; shift
+      func_unset "${_G_hook}_result"
+      eval $_G_hook '${1+"$@"}'
+      func_propagate_result $_G_hook func_run_hooks
+      if $func_propagate_result_result; then
+        eval set dummy "$func_run_hooks_result"; shift
+      fi
     done
-
-    func_quote_for_eval ${1+"$@"}
-    func_run_hooks_result=$func_quote_for_eval_result
 }
 
 
@@ -1723,10 +1854,18 @@ func_run_hooks ()
 ## --------------- ##
 
 # In order to add your own option parsing hooks, you must accept the
-# full positional parameter list in your hook function, remove any
-# options that you action, and then pass back the remaining unprocessed
-# options in '<hooked_function_name>_result', escaped suitably for
-# 'eval'.  Like this:
+# full positional parameter list from your hook function.  You may remove
+# or edit any options that you action, and then pass back the remaining
+# unprocessed options in '<hooked_function_name>_result', escaped
+# suitably for 'eval'.
+#
+# The '<hooked_function_name>_result' variable is automatically unset
+# before your hook gets called; for best performance, only set the
+# *_result variable when necessary (i.e. don't call the 'func_quote'
+# function unnecessarily because it can be an expensive operation on some
+# machines).
+#
+# Like this:
 #
 #    my_options_prep ()
 #    {
@@ -1736,9 +1875,8 @@ func_run_hooks ()
 #        usage_message=$usage_message'
 #      -s, --silent       don'\''t print informational messages
 #    '
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_options_prep_result=$func_quote_for_eval_result
+#        # No change in '$@' (ignored completely by this hook).  Leave
+#        # my_options_prep_result variable intact.
 #    }
 #    func_add_hook func_options_prep my_options_prep
 #
@@ -1747,25 +1885,36 @@ func_run_hooks ()
 #    {
 #        $debug_cmd
 #
-#        # Note that for efficiency, we parse as many options as we can
+#        args_changed=false
+#
+#        # Note that, for efficiency, we parse as many options as we can
 #        # recognise in a loop before passing the remainder back to the
 #        # caller on the first unrecognised argument we encounter.
 #        while test $# -gt 0; do
 #          opt=$1; shift
 #          case $opt in
-#            --silent|-s) opt_silent=: ;;
+#            --silent|-s) opt_silent=:
+#                         args_changed=:
+#                         ;;
 #            # Separate non-argument short options:
 #            -s*)         func_split_short_opt "$_G_opt"
 #                         set dummy "$func_split_short_opt_name" \
 #                             "-$func_split_short_opt_arg" ${1+"$@"}
 #                         shift
+#                         args_changed=:
 #                         ;;
-#            *)            set dummy "$_G_opt" "$*"; shift; break ;;
+#            *)           # Make sure the first unrecognised option "$_G_opt"
+#                         # is added back to "$@" in case we need it later,
+#                         # if $args_changed was set to 'true'.
+#                         set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
 #          esac
 #        done
 #
-#        func_quote_for_eval ${1+"$@"}
-#        my_silent_option_result=$func_quote_for_eval_result
+#        # Only call 'func_quote' here if we processed at least one argument.
+#        if $args_changed; then
+#          func_quote eval ${1+"$@"}
+#          my_silent_option_result=$func_quote_result
+#        fi
 #    }
 #    func_add_hook func_parse_options my_silent_option
 #
@@ -1776,17 +1925,26 @@ func_run_hooks ()
 #
 #        $opt_silent && $opt_verbose && func_fatal_help "\
 #    '--silent' and '--verbose' options are mutually exclusive."
-#
-#        func_quote_for_eval ${1+"$@"}
-#        my_option_validation_result=$func_quote_for_eval_result
 #    }
 #    func_add_hook func_validate_options my_option_validation
 #
-# You'll alse need to manually amend $usage_message to reflect the extra
+# You'll also need to manually amend $usage_message to reflect the extra
 # options you parse.  It's preferable to append if you can, so that
 # multiple option parsing hooks can be added safely.
 
 
+# func_options_finish [ARG]...
+# ----------------------------
+# Finishing the option parse loop (call 'func_options' hooks ATM).
+func_options_finish ()
+{
+    $debug_cmd
+
+    func_run_hooks func_options ${1+"$@"}
+    func_propagate_result func_run_hooks func_options_finish
+}
+
+
 # func_options [ARG]...
 # ---------------------
 # All the functions called inside func_options are hookable. See the
@@ -1796,17 +1954,27 @@ func_options ()
 {
     $debug_cmd
 
-    func_options_prep ${1+"$@"}
-    eval func_parse_options \
-        ${func_options_prep_result+"$func_options_prep_result"}
-    eval func_validate_options \
-        ${func_parse_options_result+"$func_parse_options_result"}
+    _G_options_quoted=false
 
-    eval func_run_hooks func_options \
-        ${func_validate_options_result+"$func_validate_options_result"}
+    for my_func in options_prep parse_options validate_options options_finish
+    do
+      func_unset func_${my_func}_result
+      func_unset func_run_hooks_result
+      eval func_$my_func '${1+"$@"}'
+      func_propagate_result func_$my_func func_options
+      if $func_propagate_result_result; then
+        eval set dummy "$func_options_result"; shift
+        _G_options_quoted=:
+      fi
+    done
 
-    # save modified positional parameters for caller
-    func_options_result=$func_run_hooks_result
+    $_G_options_quoted || {
+      # As we (func_options) are top-level options-parser function and
+      # nobody quoted "$@" for us yet, we need to do it explicitly for
+      # caller.
+      func_quote eval ${1+"$@"}
+      func_options_result=$func_quote_result
+    }
 }
 
 
@@ -1815,9 +1983,8 @@ func_options ()
 # All initialisations required before starting the option parse loop.
 # Note that when calling hook functions, we pass through the list of
 # positional parameters.  If a hook function modifies that list, and
-# needs to propogate that back to rest of this script, then the complete
-# modified list must be put in 'func_run_hooks_result' before
-# returning.
+# needs to propagate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before returning.
 func_hookable func_options_prep
 func_options_prep ()
 {
@@ -1828,9 +1995,7 @@ func_options_prep ()
     opt_warning_types=
 
     func_run_hooks func_options_prep ${1+"$@"}
-
-    # save modified positional parameters for caller
-    func_options_prep_result=$func_run_hooks_result
+    func_propagate_result func_run_hooks func_options_prep
 }
 
 
@@ -1842,25 +2007,32 @@ func_parse_options ()
 {
     $debug_cmd
 
-    func_parse_options_result=
-
+    _G_parse_options_requote=false
     # this just eases exit handling
     while test $# -gt 0; do
       # Defer to hook functions for initial option parsing, so they
       # get priority in the event of reusing an option name.
       func_run_hooks func_parse_options ${1+"$@"}
-
-      # Adjust func_parse_options positional parameters to match
-      eval set dummy "$func_run_hooks_result"; shift
+      func_propagate_result func_run_hooks func_parse_options
+      if $func_propagate_result_result; then
+        eval set dummy "$func_parse_options_result"; shift
+        # Even though we may have changed "$@", we passed the "$@" array
+        # down into the hook and it quoted it for us (because we are in
+        # this if-branch).  No need to quote it again.
+        _G_parse_options_requote=false
+      fi
 
       # Break out of the loop if we already parsed every option.
       test $# -gt 0 || break
 
+      # We expect that one of the options parsed in this function matches
+      # and thus we remove _G_opt from "$@" and need to re-quote.
+      _G_match_parse_options=:
       _G_opt=$1
       shift
       case $_G_opt in
         --debug|-x)   debug_cmd='set -x'
-                      func_echo "enabling shell trace mode"
+                      func_echo "enabling shell trace mode" >&2
                       $debug_cmd
                       ;;
 
@@ -1870,7 +2042,10 @@ func_parse_options ()
                      ;;
 
         --warnings|--warning|-W)
-                      test $# = 0 && func_missing_arg $_G_opt && break
+                      if test $# = 0 && func_missing_arg $_G_opt; then
+                        _G_parse_options_requote=:
+                        break
+                      fi
                       case " $warning_categories $1" in
                         *" $1 "*)
                           # trailing space prevents matching last $1 above
@@ -1923,15 +2098,24 @@ func_parse_options ()
                       shift
                       ;;
 
-        --)           break ;;
+        --)           _G_parse_options_requote=: ; break ;;
         -*)           func_fatal_help "unrecognised option: '$_G_opt'" ;;
-        *)            set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+        *)            set dummy "$_G_opt" ${1+"$@"}; shift
+                      _G_match_parse_options=false
+                      break
+                      ;;
       esac
+
+      if $_G_match_parse_options; then
+        _G_parse_options_requote=:
+      fi
     done
 
-    # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    func_parse_options_result=$func_quote_for_eval_result
+    if $_G_parse_options_requote; then
+      # save modified positional parameters for caller
+      func_quote eval ${1+"$@"}
+      func_parse_options_result=$func_quote_result
+    fi
 }
 
 
@@ -1948,12 +2132,10 @@ func_validate_options ()
     test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
 
     func_run_hooks func_validate_options ${1+"$@"}
+    func_propagate_result func_run_hooks func_validate_options
 
     # Bail if the options were screwed!
     $exit_cmd $EXIT_FAILURE
-
-    # save modified positional parameters for caller
-    func_validate_options_result=$func_run_hooks_result
 }
 
 
@@ -2009,8 +2191,8 @@ func_missing_arg ()
 
 # func_split_equals STRING
 # ------------------------
-# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
-# splitting STRING at the '=' sign.
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables
+# after splitting STRING at the '=' sign.
 test -z "$_G_HAVE_XSI_OPS" \
     && (eval 'x=a/b/c;
       test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
@@ -2025,8 +2207,9 @@ then
 
       func_split_equals_lhs=${1%%=*}
       func_split_equals_rhs=${1#*=}
-      test "x$func_split_equals_lhs" = "x$1" \
-        && func_split_equals_rhs=
+      if test "x$func_split_equals_lhs" = "x$1"; then
+        func_split_equals_rhs=
+      fi
   }'
 else
   # ...otherwise fall back to using expr, which is often a shell builtin.
@@ -2104,31 +2287,44 @@ func_usage_message ()
 # func_version
 # ------------
 # Echo version message to standard output and exit.
+# The version message is extracted from the calling file's header
+# comments, with leading '# ' stripped:
+#   1. First display the progname and version
+#   2. Followed by the header comment line matching  /^# Written by /
+#   3. Then a blank line followed by the first following line matching
+#      /^# Copyright /
+#   4. Immediately followed by any lines between the previous matches,
+#      except lines preceding the intervening completely blank line.
+# For example, see the header comments of this file.
 func_version ()
 {
     $debug_cmd
 
     printf '%s\n' "$progname $scriptversion"
     $SED -n '
-        /(C)/!b go
-        :more
-        /\./!{
-          N
-          s|\n# | |
-          b more
-        }
-        :go
-        /^# Written by /,/# warranty; / {
-          s|^# ||
-          s|^# *$||
-          s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
-          p
+        /^# Written by /!b
+        s|^# ||; p; n
+
+        :fwd2blnk
+        /./ {
+          n
+          b fwd2blnk
         }
-        /^# Written by / {
-          s|^# ||
-          p
+        p; n
+
+        :holdwrnt
+        s|^# ||
+        s|^# *$||
+        /^Copyright /!{
+          /./H
+          n
+          b holdwrnt
         }
-        /^warranty; /q' < "$progpath"
+
+        s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+        G
+        s|\(\n\)\n*|\1|g
+        p; q' < "$progpath"
 
     exit $?
 }
@@ -2138,7 +2334,7 @@ func_version ()
 # mode: shell-script
 # sh-indentation: 2
 # eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-pattern: "30/scriptversion=%:y-%02m-%02d.%02H; # UTC"
 # time-stamp-time-zone: "UTC"
 # End:
 #! /bin/sh
@@ -2146,31 +2342,27 @@ func_version ()
 # Extract macro arguments from autotools input with GNU M4.
 # Written by Gary V. Vaughan, 2010
 #
-# Copyright (C) 2010-2014, 2016 Free Software Foundation, Inc.
-# This is free software; see the source for copying conditions.  There is NO
-# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# This is free software.  There is NO warranty; not even for
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# Copyright (C) 2010-2019 Bootstrap Authors
+#
+# This file is dual licensed under the terms of the MIT license
+# <https://opensource.org/license/MIT>, and GPL version 2 or later
+# <http://www.gnu.org/licenses/gpl-2.0.html>.  You must apply one of
+# these licenses when using or redistributing this software or any of
+# the files within it.  See the URLs above, or the file `LICENSE`
+# included in the Bootstrap distribution for the full license texts.
+
+# Please report bugs or propose patches to:
+# <https://github.com/gnulib-modules/bootstrap/issues>
 
 # Make sure we've evaluated scripts we depend on.
 test -z "$progpath" && . `echo "$0" |${SED-sed} 's|[^/]*$||'`/funclib.sh
 test extract-trace = "$progname" && . `echo "$0" |${SED-sed} 's|[^/]*$||'`/options-parser
 
 # Set a version string.
-scriptversion=2014-01-04.01; # UTC
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Please report bugs or propose patches to gary@gnu.org.
+scriptversion=2019-02-19.15; # UTC
 
 
 ## ------ ##
@@ -2224,6 +2416,69 @@ func_autoconf_configure ()
 }
 
 
+# func_tool_version_output CMD [FATAL-ERROR-MSG]
+# ----------------------------------------------
+# Attempt to run 'CMD --version', discarding errors.  The output can be
+# ignored by redirecting stdout, and this function used simply to test
+# whether the command exists and exits normally when passed a
+# '--version' argument.
+# When FATAL-ERROR-MSG is given, then this function will display the
+# message and exit if running 'CMD --version' returns a non-zero exit
+# status.
+func_tool_version_output ()
+{
+    $debug_cmd
+
+    _G_cmd=$1
+    _G_fatal_error_msg=$2
+
+    # Some tools, like 'git2cl' produce thousands of lines of output
+    # unless stdin is /dev/null - in that case we want to return
+    # successfully without saving all of that output.  Other tools,
+    # such as 'help2man' exit with a non-zero status when stdin comes
+    # from /dev/null, so we re-execute without /dev/null if that
+    # happens.  This means that occasionally, the output from both calls
+    # ends up in the result, but the alternative would be to discard the
+    # output from one call, and hope the other produces something useful.
+    { $_G_cmd --version </dev/null || $_G_cmd --version; } 2>/dev/null
+    _G_status=$?
+
+    test 0 -ne "$_G_status" && test -n "$_G_fatal_error_msg" \
+        && func_fatal_error "$_G_fatal_error_msg"
+
+    (exit $_G_status)
+}
+
+
+# func_tool_version_number CMD [FATAL-ERROR-MSG]
+# ----------------------------------------------
+# Pass arguments to func_tool_version_output, but set
+# $func_tool_version_number_result to the last dot delimited digit string
+# on the first line of output.
+func_tool_version_number ()
+{
+    $debug_cmd
+
+    _G_verout=`func_tool_version_output "$@"`
+    _G_status=$?
+
+    # A version number starts with a digit following a space on the first
+    # line of output from `--version`.
+    _G_verout=`echo "$_G_verout" |sed 1q`
+    if test -n "$_G_verout"; then
+      _G_vernum=`expr "$_G_verout" : '.* \([0-9][^ ]*\)'`
+    fi
+
+    if test -n "$_G_vernum"; then
+      printf '%s\n' "$_G_vernum"
+    else
+      printf '%s\n' "$_G_verout"
+    fi
+
+    (exit $_G_status)
+}
+
+
 # func_find_tool ENVVAR NAMES...
 # ------------------------------
 # Search for a required program.  Use the value of ENVVAR, if set,
@@ -2241,16 +2496,44 @@ func_find_tool ()
     if test -n "$_G_find_tool_res"; then
       _G_find_tool_error_prefix="\$$find_tool_envvar: "
     else
+      _G_find_tool_res=
+      _G_bestver=
       for _G_prog
       do
-        if func_tool_version_output $_G_prog >/dev/null; then
-          _G_find_tool_res=$_G_prog
-          break
-        fi
+        _G_find_tool_save_IFS=$IFS
+        IFS=${PATH_SEPARATOR-:}
+       for _G_dir in $PATH; do
+         IFS=$_G_find_tool_save_IFS
+         _G_progpath=$_G_dir/$_G_prog
+          test -r "$_G_progpath" && {
+            _G_curver=`func_tool_version_number $_G_progpath`
+           case $_G_bestver,$_G_curver in
+           ,)
+             # first non--version responsive prog sticks!
+              test -n "$_G_progpath" || _G_find_tool_res=$_G_progpath
+              ;;
+            ,*)
+             # first --version responsive prog beats non--version responsive!
+             _G_find_tool_res=$_G_progpath
+             _G_bestver=$_G_curver
+             ;;
+           *,*)
+             # another --version responsive prog must be newer to beat previous one!
+             test "x$_G_curver" = "x$_G_bestver" \
+               || func_lt_ver "$_G_curver" "$_G_bestver" \
+               || {
+                    _G_find_tool_res=$_G_progpath
+                    _G_bestver=$_G_curver
+                  }
+             ;;
+           esac
+          }
+       done
+       IFS=$_G_find_tool_save_IFS
       done
     fi
     if test -n "$_G_find_tool_res"; then
-      func_tool_version_output >/dev/null $_G_find_tool_res "\
+      func_tool_version_number >/dev/null $_G_find_tool_res "\
 ${_G_find_tool_error_prefix}Cannot run '$_G_find_tool_res --version'"
 
       # Make sure the result is exported to the environment for children
@@ -2265,39 +2548,6 @@ One of these is required:
 }
 
 
-# func_tool_version_output CMD [FATAL-ERROR-MSG]
-# ----------------------------------------------
-# Attempt to run 'CMD --version', discarding errors.  The output can be
-# ignored by redirecting stdout, and this function used simply to test
-# whether the command exists and exits normally when passed a
-# '--version' argument.
-# When FATAL-ERROR-MSG is given, then this function will display the
-# message and exit if running 'CMD --version' returns a non-zero exit
-# status.
-func_tool_version_output ()
-{
-    $debug_cmd
-
-    _G_cmd=$1
-    _G_fatal_error_msg=$2
-
-    # Some tools, like 'git2cl' produce thousands of lines of output
-    # unless stdin is /dev/null - in that case we want to return
-    # successfully without saving all of that output.  Other tools,
-    # such as 'help2man' exit with a non-zero status when stdin comes
-    # from /dev/null, so we re-execute without /dev/null if that
-    # happens.  This means that occasionally, the output from both calls
-    # ends up in the result, but the alternative would be to discard the
-    # output from one call, and hope the other produces something useful.
-    { $_G_cmd --version </dev/null || $_G_cmd --version; } 2>/dev/null
-    _G_status=$?
-
-    test 0 -ne "$_G_status" && test -n "$_G_fatal_error_msg" \
-        && func_fatal_error "$_G_fatal_error_msg"
-
-    (exit $_G_status)
-}
-
 
 ## -------------------- ##
 ## Resource management. ##
@@ -2414,29 +2664,41 @@ func_extract_trace ()
     # arguments to Autocof functions, but without following
     # 'm4_s?include' files.
     _G_mini='
-        # Initialisation.
+        dnl  Initialisation.
         m4_changequote([,])
         m4_define([m4_copy],   [m4_define([$2], m4_defn([$1]))])
         m4_define([m4_rename], [m4_copy([$1], [$2])m4_undefine([$1])])
 
-        # Disable these macros.
-        m4_undefine([m4_dnl])
-        m4_undefine([m4_include])
-        m4_undefine([m4_m4exit])
-        m4_undefine([m4_m4wrap])
-        m4_undefine([m4_maketemp])
+        dnl  Replace macros which may abort m4 with a no-op variant.
+        m4_pushdef([m4_assert])
+        m4_pushdef([m4_exit])
+        m4_pushdef([m4_fatal])
+        m4_pushdef([m4_m4exit])
+
+        dnl  Replace macros that might break stderr of m4.
+        m4_pushdef([m4_errprint])
+        m4_pushdef([m4_errprintn])
+        m4_pushdef([m4_include])
+        m4_pushdef([m4_warn])
+
+        dnl  Avoid side-effects of tracing by extract-trace.
+        m4_pushdef([m4_maketemp])
+        m4_pushdef([m4_mkstemp])
 
-        # Copy and rename macros not handled by "m4 --prefix".
+        dnl  TODO: reasons for this
+        m4_pushdef([m4_dnl])
+        m4_pushdef([m4_m4wrap])
+
+        dnl  Copy and rename macros not handled by "m4 --prefix".
         m4_define([dnl],         [m4_builtin([dnl])])
         m4_copy([m4_define],     [m4_defun])
         m4_rename([m4_ifelse],   [m4_if])
-        m4_ifdef([m4_mkstemp],   [m4_undefine([m4_mkstemp])])
         m4_rename([m4_patsubst], [m4_bpatsubst])
         m4_rename([m4_regexp],   [m4_bregexp])
 
-        # "m4sugar.mini" - useful m4-time macros for dynamic arguments.
-        # If we discover packages that need more m4 macros defined in
-        # order to bootstrap correctly, add them here:
+        dnl  "m4sugar.mini" - useful m4-time macros for dynamic arguments.
+        dnl  If we discover packages that need more m4 macros defined in
+        dnl  order to bootstrap correctly, add them here:
         m4_define([m4_bmatch],
             [m4_if([$#], 0, [], [$#], 1, [], [$#], 2, [$2],
                    [m4_if(m4_bregexp([$1], [$2]), -1,
@@ -2447,11 +2709,11 @@ func_extract_trace ()
         m4_define([m4_require], [$1])
         m4_define([m4_shift3], [m4_shift(m4shift(m4shift($@)))])
 
-        # "autoconf.mini" - things from autoconf macros we care about.
+        dnl  "autoconf.mini" - things from autoconf macros we care about.
         m4_copy([m4_defun], [AC_DEFUN])
 
-        # Dummy definitions for the macros we want to trace.
-        # AM_INIT_AUTOMAKE at least produces no trace without this.
+        dnl  Dummy definitions for the macros we want to trace.
+        dnl  AM_INIT_AUTOMAKE at least produces no trace without this.
     '
 
     _G_save=$IFS
@@ -2558,12 +2820,12 @@ test extract-trace = "$progname" && func_main "$@"
 # mode: shell-script
 # sh-indentation: 2
 # eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-pattern: "20/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-pattern: "50/scriptversion=%:y-%02m-%02d.%02H; # UTC"
 # time-stamp-time-zone: "UTC"
 # End:
 
 # Set a version string for *this* script.
-scriptversion=2014-11-04.13; # UTC
+scriptversion=2019-03-22.11; # UTC
 
 
 ## ------------------- ##
@@ -2591,8 +2853,8 @@ func_bootstrap ()
 
     # Save the current positional parameters to prevent them being
     # corrupted by calls to 'set' in 'func_init'.
-    func_quote_for_eval ${1+"$@"}
-    _G_saved_positional_parameters=$func_quote_for_eval_result
+    func_quote eval ${1+"$@"}
+    _G_saved_positional_parameters=$func_quote_result
 
     # Initialisation.
     func_init
@@ -2689,10 +2951,13 @@ func_reconfigure ()
 
     $require_automake_options
 
-    # Automake (without 'foreign' option) requires that README exists.
+    # Automake (without 'foreign' option) requires that NEWS & README exist.
     case " $automake_options " in
       " foreign ") ;;
-      *) func_ensure_README ;;
+      *)
+        func_ensure_NEWS
+        func_ensure_README
+        ;;
     esac
 
     # Ensure ChangeLog presence.
@@ -2749,6 +3014,8 @@ func_gnulib_tool ()
     $require_libtoolize
 
     test true = "$gnulib_tool" || {
+      $require_gnulib_git_submodules
+
       # bootstrap.conf written for gnulib bootstrap expects
       # gnulib_tool_option_extras to which --no-changelog is appended,
       # but libtool bootstrap expects you to append to gnulib_tool_options
@@ -2870,6 +3137,7 @@ func_gettext_configuration ()
              '"$_G_xgettext_options"' \\\
              $${end_of_xgettext_options+}
         }
+        s/ *$//
       ' po/Makevars.template >po/Makevars || exit 1
     }
 
@@ -2924,7 +3192,7 @@ func_libtoolize ()
 # -----------------------------------
 # Copy SRC, a path relative to the gnulib sub-tree, to DEST, a path
 # relative to the top-level source directory using gnulib-tool so that
-# any patches or replacements in $local_gl_dir are applied.
+# any patches or replacements in $local_gl_path are applied.
 func_gnulib_tool_copy_file ()
 {
     $debug_cmd
@@ -3021,6 +3289,29 @@ EOT
 }
 
 
+# func_ensure_NEWS
+# ----------------
+# Without AM_INIT_AUTOMAKE([foreign]), automake will not run to
+# completion with no NEWS file, even though NEWS.md or NEWS.txt
+# is often preferable.
+func_ensure_NEWS ()
+{
+    $debug_cmd
+
+    test -f NEWS || {
+      _G_NEWS=
+      for _G_news in NEWS.txt NEWS.md NEWS.rst; do
+        test -f "$_G_news" && break
+      done
+
+      test -f "$_G_news" && $LN_S $_G_news NEWS
+      func_verbose "$LN_S $_G_news NEWS"
+    }
+
+    return 0
+}
+
+
 # func_ensure_README
 # ------------------
 # Without AM_INIT_AUTOMAKE([foreign]), automake will not run to
@@ -3226,6 +3517,26 @@ func_update_dotversion ()
 # most, once.
 
 
+# require_gnulib_git_submodules
+# -----------------------------
+# Initialize all git modules from $gnulib_git_submodules before we
+# run 'gnulib-tool'.
+require_gnulib_git_submodules=func_require_gnulib_git_submodules
+func_require_gnulib_git_submodules ()
+{
+    test -n "$gnulib_git_submodules" && {
+      for _G_submodule in $gnulib_git_submodules
+      do
+        func_show_eval "git submodule init -- $_G_submodule" \
+            && func_show_eval "git submodule update -- $_G_submodule" \
+            || func_fatal_error "Unable to init git module '$_G_submodule'."
+      done
+    }
+
+    require_gnulib_git_submodules=:
+}
+
+
 # require_checkout_only_file
 # --------------------------
 # Bail out  if this package only bootstraps properly from a repository
@@ -3529,13 +3840,13 @@ func_require_buildreq_automake ()
 # require_buildreq_patch
 # ----------------------
 # Automatically add a patch build-requirement if there are diff files
-# in $local_gl_dir.
+# in $local_gl_path.
 require_buildreq_patch=func_require_buildreq_patch
 func_require_buildreq_patch ()
 {
     $debug_cmd
 
-    $require_local_gl_dir
+    $require_local_gl_path
 
     # This ensures PATCH is set appropriately by the time
     # func_check_versions enforces $buildreq.
@@ -3543,14 +3854,19 @@ func_require_buildreq_patch ()
 
     # If patch is not already listed in $buildreq...
     printf '%s\n' "$buildreq" |func_grep_q '^[  ]*patch' || {
-      # The ugly find invocation is necessary to exit with non-zero
-      # status for old find binaries that don't support -exec fully.
-      if test ! -d "$local_gl_dir" \
-          || find "$local_gl_dir" -name "*.diff" -exec false {} \; ; then :
-      else
-          func_append buildreq 'patch - http://www.gnu.org/s/patch
-'
-      fi
+      eval "set dummy $local_gl_path_quoted" ; shift
+
+      for _G_dir
+      do
+        # The ugly find invocation is necessary to exit with non-zero
+        # status for old find binaries that don't support -exec fully.
+        if test ! -d "$_G_dir" \
+            || find "$_G_dir" -name "*.diff" -exec false {} \; ; then :
+        else
+          func_append buildreq "patch - http://www.gnu.org/s/patch$nl"
+          break
+        fi
+      done
     }
 
     require_buildreq_patch=:
@@ -3904,8 +4220,9 @@ func_require_gnulib_submodule ()
         trap func_cleanup_gnulib 1 2 13 15
 
         shallow=
-        $GIT clone -h 2>&1 |func_grep_q -- --depth \
-            && shallow='--depth 365'
+        test -n "$gnulib_clone_since" && \
+            $GIT clone -h 2>&1 |func_grep_q -- --shallow-since \
+            && shallow="--shallow-since=$gnulib_clone_since"
 
         func_show_eval "$GIT clone $shallow '$gnulib_url' '$gnulib_path'" \
           func_cleanup_gnulib
@@ -3984,9 +4301,14 @@ func_require_gnulib_tool_base_options ()
       $require_gnulib_name
       test -n "$gnulib_name" \
           && func_append_uniq gnulib_tool_base_options " --lib=$gnulib_name"
-      $require_local_gl_dir
-      test -n "$local_gl_dir" \
-          && func_append_uniq gnulib_tool_base_options " --local-dir=$local_gl_dir"
+      $require_local_gl_path
+      test -n "$local_gl_path" && {
+        eval "set dummy $local_gl_path_quoted" ; shift
+        for _G_dir
+        do
+          func_append_uniq gnulib_tool_base_options " --local-dir=$_G_dir"
+        done
+      }
       $require_source_base
       test -n "$source_base" \
           && func_append_uniq gnulib_tool_base_options " --source-base=$source_base"
@@ -4033,25 +4355,49 @@ Please install GNU Libtool, or 'export LIBTOOLIZE=/path/to/libtoolize'."
 }
 
 
-# require_local_gl_dir
-# --------------------
-# Ensure local_gl_dir has a sensible value, extracted from 'gnulib-cache.m4'
-# if possible, otherwise letting 'gnulib-tool' pick a default.
-require_local_gl_dir=func_require_local_gl_dir
-func_require_local_gl_dir ()
+# require_local_gl_path
+# ---------------------
+# Ensure local_gl_path has a sensible value, extracted from 'gnulib-cache.m4' if
+# possible, otherwise letting 'gnulib-tool' pick a default.
+require_local_gl_path=func_require_local_gl_path
+func_require_local_gl_path ()
 {
     $debug_cmd
 
     $require_gnulib_cache
 
-    test -f "$gnulib_cache" && test -z "$local_gl_dir" && {
+    # Compat with older bootstrap versions.
+    test -n "$local_gl_dir" && {
+      func_warning settings "\
+Please use 'local_gl_path' instead of 'local_gl_dir' in your
+'bootstrap.conf' file."
+      local_gl_path=$local_gl_dir
+      local_gl_dir=
+    }
+
+    test -f "$gnulib_cache" && test -z "$local_gl_path" && {
       func_extract_trace_first "gl_LOCAL_DIR" "$gnulib_cache"
-      local_gl_dir=$func_extract_trace_first_result
+      local_gl_path=$func_extract_trace_first_result
+      test -n "$local_gl_path" && func_verbose "local_gl_path='$local_gl_path'"
+    }
 
-      test -n "$local_gl_dir" && func_verbose "local_gl_dir='$local_gl_dir'"
+    test -z "$local_gl_path_quoted" && test -n "$local_gl_path" && {
+      save_IFS=$IFS
+      set dummy
+      # Don't use PATH_SEPARATOR here, gnulib must be fixed to store only ':' as
+      # path separator into gnulib-cache.m4 (consistency reasons among systems).
+      IFS=:
+      for _G_dir in $local_gl_path
+      do
+        set "$@" "$_G_dir"
+      done
+      shift
+      IFS=$save_IFS
+      func_quote eval "$@"
+      local_gl_path_quoted=$func_quote_result
     }
 
-    require_local_gl_dir=:
+    require_local_gl_path=:
 }
 
 
@@ -4350,21 +4696,6 @@ else
 fi
 
 
-# func_unset VAR
-# --------------
-# Portably unset VAR.
-# In some shells, an 'unset VAR' statement leaves a non-zero return
-# status if VAR is already unset, which might be problematic if the
-# statement is used at the end of a function (thus poisoning its return
-# value) or when 'set -e' is active (causing even a spurious abort of
-# the script in this case).
-func_unset ()
-{
-    { eval $1=; unset $1; }
-}
-unset=func_unset
-
-
 # func_cmp_s FILE1 FILE2
 # ----------------------
 # Return non-zero exit status unless FILE1 and FILE2 are identical, without
@@ -4605,8 +4936,8 @@ func_show_eval ()
     _G_fail_exp=${2-':'}
 
     ${opt_silent-'false'} || {
-      func_quote_for_eval $_G_cmd
-      eval func_truncate_cmd $func_quote_for_eval_result
+      func_quote eval $_G_cmd
+      eval func_truncate_cmd $func_quote_result
       func_echo "running: $tc_bold$func_truncate_cmd_result$tc_reset"
     }
 
@@ -4993,8 +5324,8 @@ bootstrap_options_prep ()
     opt_skip_po=false
 
     # Pass back the list of options we consumed.
-    func_quote_for_eval ${1+"$@"}
-    bootstrap_options_prep_result=$func_quote_for_eval_result
+    func_quote eval ${1+"$@"}
+    bootstrap_options_prep_result=$func_quote_result
 }
 func_add_hook func_options_prep bootstrap_options_prep
 
@@ -5044,8 +5375,8 @@ bootstrap_parse_options ()
     done
 
     # save modified positional parameters for caller
-    func_quote_for_eval ${1+"$@"}
-    bootstrap_parse_options_result=$func_quote_for_eval_result
+    func_quote eval ${1+"$@"}
+    bootstrap_parse_options_result=$func_quote_result
 }
 func_add_hook func_parse_options bootstrap_parse_options
 
@@ -5063,8 +5394,8 @@ bootstrap_validate_options ()
         && func_fatal_help "too many arguments"
 
     # Pass back the (empty) list of unconsumed options.
-    func_quote_for_eval ${1+"$@"}
-    bootstrap_validate_options_result=$func_quote_for_eval_result
+    func_quote eval ${1+"$@"}
+    bootstrap_validate_options_result=$func_quote_result
 }
 func_add_hook func_validate_options bootstrap_validate_options
 
index b461174..daa478c 100755 (executable)
@@ -1,40 +1,56 @@
-eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
-  & eval 'exec perl -wS "$0" $argv:q'
-    if 0;
-# Generate a release announcement message.
+#!/bin/sh
+#! -*-perl-*-
 
-my $VERSION = '2016-01-12 23:09'; # UTC
-# The definition above must lie within the first 8 lines in order
-# for the Emacs time-stamp write hook (at end) to update it.
-# If you change this file with Emacs, please let the write hook
-# do its job.  Otherwise, update this string manually.
-
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Generate a release announcement message.
 
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
+#
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-
+#
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+#
 # Written by Jim Meyering
 
-use strict;
+# This is a prologue that allows to run a perl script as an executable
+# on systems that are compliant to a POSIX version before POSIX:2017.
+# On such systems, the usual invocation of an executable through execlp()
+# or execvp() fails with ENOEXEC if it is a script that does not start
+# with a #! line.  The script interpreter mentioned in the #! line has
+# to be /bin/sh, because on GuixSD systems that is the only program that
+# has a fixed file name.  The second line is essential for perl and is
+# also useful for editing this file in Emacs.  The next two lines below
+# are valid code in both sh and perl.  When executed by sh, they re-execute
+# the script through the perl program found in $PATH.  The '-x' option
+# is essential as well; without it, perl would re-execute the script
+# through /bin/sh.  When executed by perl, the next two lines are a no-op.
+eval 'exec perl -wSx "$0" "$@"'
+     if 0;
+
+my $VERSION = '2021-04-11 8:42'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job.  Otherwise, update this string manually.
 
+my $copyright_year = '2021';
+
+use strict;
 use Getopt::Long;
 use POSIX qw(strftime);
 
 (my $ME = $0) =~ s|.*/||;
 
 my %valid_release_types = map {$_ => 1} qw (alpha beta stable);
-my @archive_suffixes = ('tar.gz', 'tar.bz2', 'tar.lzma', 'tar.xz');
+my @archive_suffixes = qw (tar.gz tar.bz2 tar.lz tar.lzma tar.xz);
 my %digest_classes =
   (
    'md5' => (eval { require Digest::MD5; } and 'Digest::MD5'),
@@ -357,8 +373,8 @@ sub get_tool_versions ($$)
 }
 
 {
-  # Neutralize the locale, so that, for instance, "du" does not
-  # issue "1,2" instead of "1.2", what confuses our regexps.
+  # Use the C locale so that, for instance, "du" does not
+  # print "1,2" instead of "1.2", which would confuse our regexps.
   $ENV{LC_ALL} = "C";
 
   my $mail_headers;
@@ -399,7 +415,19 @@ sub get_tool_versions ($$)
      'archive-suffix=s'   => \@archive_suffixes,
 
      help => sub { usage 0 },
-     version => sub { print "$ME version $VERSION\n"; exit },
+     version =>
+       sub
+       {
+         print "$ME version $VERSION\n";
+         print "Copyright (C) $copyright_year Free Software Foundation, Inc.\n";
+         print "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\n"
+             . "This is free software: you are free to change and redistribute it.\n"
+             . "There is NO WARRANTY, to the extent permitted by law.\n";
+         print "\n";
+         my $author = "Jim Meyering";
+         print "Written by $author.\n";
+         exit
+       },
     ) or usage 1;
 
   my $fail = 0;
@@ -492,17 +520,17 @@ EOF
   if ($url_dir_list[0] =~ "gnu\.org")
     {
       print "Use a mirror for higher download bandwidth:\n";
-      if (@tarballs == 1 && $url_dir_list[0] =~ m!http://ftp\.gnu\.org/gnu/!)
+      if (@tarballs == 1 && $url_dir_list[0] =~ m!https://ftp\.gnu\.org/gnu/!)
         {
           (my $m = "$url_dir_list[0]/$tarballs[0]")
-            =~ s!http://ftp\.gnu\.org/gnu/!http://ftpmirror\.gnu\.org/!;
+            =~ s!https://ftp\.gnu\.org/gnu/!https://ftpmirror\.gnu\.org/!;
           print "  $m\n"
               . "  $m.sig\n\n";
 
         }
       else
         {
-          print "  http://www.gnu.org/order/ftp.html\n\n";
+          print "  https://www.gnu.org/order/ftp.html\n\n";
         }
     }
 
@@ -549,7 +577,8 @@ EOF
 ## perl-label-offset: -2
 ## perl-extra-newline-before-brace: t
 ## perl-merge-trailing-else: nil
-## eval: (add-hook 'write-file-hooks 'time-stamp)
+## eval: (add-hook 'before-save-hook 'time-stamp)
+## time-stamp-line-limit: 50
 ## time-stamp-start: "my $VERSION = '"
 ## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
 ## time-stamp-time-zone: "UTC0"
diff --git a/build-aux/ar-lib b/build-aux/ar-lib
deleted file mode 100755 (executable)
index 463b9ec..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-#! /bin/sh
-# Wrapper for Microsoft lib.exe
-
-me=ar-lib
-scriptversion=2012-03-01.08; # UTC
-
-# Copyright (C) 2010-2014 Free Software Foundation, Inc.
-# Written by Peter Rosin <peda@lysator.liu.se>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# This file is maintained in Automake, please report
-# bugs to <bug-automake@gnu.org> or send patches to
-# <automake-patches@gnu.org>.
-
-
-# func_error message
-func_error ()
-{
-  echo "$me: $1" 1>&2
-  exit 1
-}
-
-file_conv=
-
-# func_file_conv build_file
-# Convert a $build file to $host form and store it in $file
-# Currently only supports Windows hosts.
-func_file_conv ()
-{
-  file=$1
-  case $file in
-    / | /[!/]*) # absolute file, and not a UNC file
-      if test -z "$file_conv"; then
-       # lazily determine how to convert abs files
-       case `uname -s` in
-         MINGW*)
-           file_conv=mingw
-           ;;
-         CYGWIN*)
-           file_conv=cygwin
-           ;;
-         *)
-           file_conv=wine
-           ;;
-       esac
-      fi
-      case $file_conv in
-       mingw)
-         file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
-         ;;
-       cygwin)
-         file=`cygpath -m "$file" || echo "$file"`
-         ;;
-       wine)
-         file=`winepath -w "$file" || echo "$file"`
-         ;;
-      esac
-      ;;
-  esac
-}
-
-# func_at_file at_file operation archive
-# Iterate over all members in AT_FILE performing OPERATION on ARCHIVE
-# for each of them.
-# When interpreting the content of the @FILE, do NOT use func_file_conv,
-# since the user would need to supply preconverted file names to
-# binutils ar, at least for MinGW.
-func_at_file ()
-{
-  operation=$2
-  archive=$3
-  at_file_contents=`cat "$1"`
-  eval set x "$at_file_contents"
-  shift
-
-  for member
-  do
-    $AR -NOLOGO $operation:"$member" "$archive" || exit $?
-  done
-}
-
-case $1 in
-  '')
-     func_error "no command.  Try '$0 --help' for more information."
-     ;;
-  -h | --h*)
-    cat <<EOF
-Usage: $me [--help] [--version] PROGRAM ACTION ARCHIVE [MEMBER...]
-
-Members may be specified in a file named with @FILE.
-EOF
-    exit $?
-    ;;
-  -v | --v*)
-    echo "$me, version $scriptversion"
-    exit $?
-    ;;
-esac
-
-if test $# -lt 3; then
-  func_error "you must specify a program, an action and an archive"
-fi
-
-AR=$1
-shift
-while :
-do
-  if test $# -lt 2; then
-    func_error "you must specify a program, an action and an archive"
-  fi
-  case $1 in
-    -lib | -LIB \
-    | -ltcg | -LTCG \
-    | -machine* | -MACHINE* \
-    | -subsystem* | -SUBSYSTEM* \
-    | -verbose | -VERBOSE \
-    | -wx* | -WX* )
-      AR="$AR $1"
-      shift
-      ;;
-    *)
-      action=$1
-      shift
-      break
-      ;;
-  esac
-done
-orig_archive=$1
-shift
-func_file_conv "$orig_archive"
-archive=$file
-
-# strip leading dash in $action
-action=${action#-}
-
-delete=
-extract=
-list=
-quick=
-replace=
-index=
-create=
-
-while test -n "$action"
-do
-  case $action in
-    d*) delete=yes  ;;
-    x*) extract=yes ;;
-    t*) list=yes    ;;
-    q*) quick=yes   ;;
-    r*) replace=yes ;;
-    s*) index=yes   ;;
-    S*)             ;; # the index is always updated implicitly
-    c*) create=yes  ;;
-    u*)             ;; # TODO: don't ignore the update modifier
-    v*)             ;; # TODO: don't ignore the verbose modifier
-    *)
-      func_error "unknown action specified"
-      ;;
-  esac
-  action=${action#?}
-done
-
-case $delete$extract$list$quick$replace,$index in
-  yes,* | ,yes)
-    ;;
-  yesyes*)
-    func_error "more than one action specified"
-    ;;
-  *)
-    func_error "no action specified"
-    ;;
-esac
-
-if test -n "$delete"; then
-  if test ! -f "$orig_archive"; then
-    func_error "archive not found"
-  fi
-  for member
-  do
-    case $1 in
-      @*)
-        func_at_file "${1#@}" -REMOVE "$archive"
-        ;;
-      *)
-        func_file_conv "$1"
-        $AR -NOLOGO -REMOVE:"$file" "$archive" || exit $?
-        ;;
-    esac
-  done
-
-elif test -n "$extract"; then
-  if test ! -f "$orig_archive"; then
-    func_error "archive not found"
-  fi
-  if test $# -gt 0; then
-    for member
-    do
-      case $1 in
-        @*)
-          func_at_file "${1#@}" -EXTRACT "$archive"
-          ;;
-        *)
-          func_file_conv "$1"
-          $AR -NOLOGO -EXTRACT:"$file" "$archive" || exit $?
-          ;;
-      esac
-    done
-  else
-    $AR -NOLOGO -LIST "$archive" | sed -e 's/\\/\\\\/g' | while read member
-    do
-      $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
-    done
-  fi
-
-elif test -n "$quick$replace"; then
-  if test ! -f "$orig_archive"; then
-    if test -z "$create"; then
-      echo "$me: creating $orig_archive"
-    fi
-    orig_archive=
-  else
-    orig_archive=$archive
-  fi
-
-  for member
-  do
-    case $1 in
-    @*)
-      func_file_conv "${1#@}"
-      set x "$@" "@$file"
-      ;;
-    *)
-      func_file_conv "$1"
-      set x "$@" "$file"
-      ;;
-    esac
-    shift
-    shift
-  done
-
-  if test -n "$orig_archive"; then
-    $AR -NOLOGO -OUT:"$archive" "$orig_archive" "$@" || exit $?
-  else
-    $AR -NOLOGO -OUT:"$archive" "$@" || exit $?
-  fi
-
-elif test -n "$list"; then
-  if test ! -f "$orig_archive"; then
-    func_error "archive not found"
-  fi
-  $AR -NOLOGO -LIST "$archive" || exit $?
-fi
index 4bfd30c..23fcba0 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Wrapper for compilers which do not understand '-c -o'.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2015 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 # Written by Tom Tromey <tromey@cygnus.com>.
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -53,7 +53,7 @@ func_file_conv ()
          MINGW*)
            file_conv=mingw
            ;;
-         CYGWIN*)
+         CYGWIN* | MSYS*)
            file_conv=cygwin
            ;;
          *)
@@ -67,7 +67,7 @@ func_file_conv ()
        mingw/*)
          file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
          ;;
-       cygwin/*)
+       cygwin/* | msys/*)
          file=`cygpath -m "$file" || echo "$file"`
          ;;
        wine/*)
@@ -340,7 +340,7 @@ exit $ret
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 2e9ad7f..dc0a6b2 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright 1992-2016 Free Software Foundation, Inc.
+#   Copyright 1992-2021 Free Software Foundation, Inc.
 
-timestamp='2016-10-02'
+timestamp='2021-05-24'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2016-10-02'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -27,19 +27,19 @@ timestamp='2016-10-02'
 # Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
 #
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
 #
 # Please send patches to <config-patches@gnu.org>.
 
 
-me=`echo "$0" | sed -e 's,.*/,,'`
+me=$(echo "$0" | sed -e 's,.*/,,')
 
 usage="\
 Usage: $0 [OPTION]
 
 Output the configuration name of the system \`$me' is run on.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -50,7 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright 1992-2016 Free Software Foundation, Inc.
+Copyright 1992-2021 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -84,8 +84,6 @@ if test $# != 0; then
   exit 1
 fi
 
-trap 'exit 1' 1 2 15
-
 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a
 # compiler to aid in system detection is discouraged as it requires
 # temporary files to be created and, as you can see below, it is a
@@ -96,66 +94,89 @@ trap 'exit 1' 1 2 15
 
 # Portable tmp directory creation inspired by the Autoconf team.
 
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,)    echo "int x;" > $dummy.c ;
-       for c in cc gcc c89 c99 ; do
-         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
-            CC_FOR_BUILD="$c"; break ;
-         fi ;
-       done ;
-       if test x"$CC_FOR_BUILD" = x ; then
-         CC_FOR_BUILD=no_compiler_found ;
-       fi
-       ;;
- ,,*)   CC_FOR_BUILD=$CC ;;
- ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+    # prevent multiple calls if $tmp is already set
+    test "$tmp" && return 0
+    : "${TMPDIR=/tmp}"
+    # shellcheck disable=SC2039
+    { tmp=$( (umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null) && test -n "$tmp" && test -d "$tmp" ; } ||
+       { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+       { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+       { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+    dummy=$tmp/dummy
+    case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+       ,,)    echo "int x;" > "$dummy.c"
+              for driver in cc gcc c89 c99 ; do
+                  if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+                      CC_FOR_BUILD="$driver"
+                      break
+                  fi
+              done
+              if test x"$CC_FOR_BUILD" = x ; then
+                  CC_FOR_BUILD=no_compiler_found
+              fi
+              ;;
+       ,,*)   CC_FOR_BUILD=$CC ;;
+       ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+    esac
+}
 
 # This is needed to find uname on a Pyramid OSx when run in the BSD universe.
 # (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
        PATH=$PATH:/.attbin ; export PATH
 fi
 
-UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
-UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
-UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+UNAME_MACHINE=$( (uname -m) 2>/dev/null) || UNAME_MACHINE=unknown
+UNAME_RELEASE=$( (uname -r) 2>/dev/null) || UNAME_RELEASE=unknown
+UNAME_SYSTEM=$( (uname -s) 2>/dev/null) || UNAME_SYSTEM=unknown
+UNAME_VERSION=$( (uname -v) 2>/dev/null) || UNAME_VERSION=unknown
 
-case "${UNAME_SYSTEM}" in
+case $UNAME_SYSTEM in
 Linux|GNU|GNU/*)
-       # If the system lacks a compiler, then just pick glibc.
-       # We could probably try harder.
-       LIBC=gnu
+       LIBC=unknown
 
-       eval $set_cc_for_build
-       cat <<-EOF > $dummy.c
+       set_cc_for_build
+       cat <<-EOF > "$dummy.c"
        #include <features.h>
        #if defined(__UCLIBC__)
        LIBC=uclibc
        #elif defined(__dietlibc__)
        LIBC=dietlibc
-       #else
+       #elif defined(__GLIBC__)
        LIBC=gnu
+       #else
+       #include <stdarg.h>
+       /* First heuristic to detect musl libc.  */
+       #ifdef __DEFINED_va_list
+       LIBC=musl
+       #endif
        #endif
        EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+       eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g')"
+
+       # Second heuristic to detect musl libc.
+       if [ "$LIBC" = unknown ] &&
+          command -v ldd >/dev/null &&
+          ldd --version 2>&1 | grep -q ^musl; then
+               LIBC=musl
+       fi
+
+       # If the system lacks a compiler, then just pick glibc.
+       # We could probably try harder.
+       if [ "$LIBC" = unknown ]; then
+               LIBC=gnu
+       fi
        ;;
 esac
 
 # Note: order is significant - the case branches are not exclusive.
 
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
     *:NetBSD:*:*)
        # NetBSD (nbsd) targets should (where applicable) match one or
        # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -167,32 +188,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        #
        # Note: NetBSD doesn't particularly care about the vendor
        # portion of the name.  We always set it to "unknown".
-       sysctl="sysctl -n hw.machine_arch"
-       UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
-           /sbin/$sysctl 2>/dev/null || \
-           /usr/sbin/$sysctl 2>/dev/null || \
-           echo unknown)`
-       case "${UNAME_MACHINE_ARCH}" in
+       UNAME_MACHINE_ARCH=$( (uname -p 2>/dev/null || \
+           /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+           /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+           echo unknown))
+       case $UNAME_MACHINE_ARCH in
+           aarch64eb) machine=aarch64_be-unknown ;;
            armeb) machine=armeb-unknown ;;
            arm*) machine=arm-unknown ;;
            sh3el) machine=shl-unknown ;;
            sh3eb) machine=sh-unknown ;;
            sh5el) machine=sh5le-unknown ;;
            earmv*)
-               arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
-               endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
-               machine=${arch}${endian}-unknown
+               arch=$(echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,')
+               endian=$(echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p')
+               machine="${arch}${endian}"-unknown
                ;;
-           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+           *) machine="$UNAME_MACHINE_ARCH"-unknown ;;
        esac
        # The Operating System including object format, if it has switched
        # to ELF recently (or will in the future) and ABI.
-       case "${UNAME_MACHINE_ARCH}" in
+       case $UNAME_MACHINE_ARCH in
            earm*)
                os=netbsdelf
                ;;
            arm*|i386|m68k|ns32k|sh3*|sparc|vax)
-               eval $set_cc_for_build
+               set_cc_for_build
                if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
                        | grep -q __ELF__
                then
@@ -208,10 +229,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                ;;
        esac
        # Determine ABI tags.
-       case "${UNAME_MACHINE_ARCH}" in
+       case $UNAME_MACHINE_ARCH in
            earm*)
                expr='s/^earmv[0-9]/-eabi/;s/eb$//'
-               abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+               abi=$(echo "$UNAME_MACHINE_ARCH" | sed -e "$expr")
                ;;
        esac
        # The OS release
@@ -219,61 +240,82 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # thus, need a distinct triplet. However, they do not need
        # kernel version information, so it can be replaced with a
        # suitable tag, in the style of linux-gnu.
-       case "${UNAME_VERSION}" in
+       case $UNAME_VERSION in
            Debian*)
                release='-gnu'
                ;;
            *)
-               release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+               release=$(echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2)
                ;;
        esac
        # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
        # contains redundant information, the shorter form:
        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
-       echo "${machine}-${os}${release}${abi}"
+       echo "$machine-${os}${release}${abi-}"
        exit ;;
     *:Bitrig:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       UNAME_MACHINE_ARCH=$(arch | sed 's/Bitrig.//')
+       echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
        exit ;;
     *:OpenBSD:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       UNAME_MACHINE_ARCH=$(arch | sed 's/OpenBSD.//')
+       echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
+       exit ;;
+    *:SecBSD:*:*)
+       UNAME_MACHINE_ARCH=$(arch | sed 's/SecBSD.//')
+       echo "$UNAME_MACHINE_ARCH"-unknown-secbsd"$UNAME_RELEASE"
        exit ;;
     *:LibertyBSD:*:*)
-       UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
-       echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+       UNAME_MACHINE_ARCH=$(arch | sed 's/^.*BSD\.//')
+       echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
+       exit ;;
+    *:MidnightBSD:*:*)
+       echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
        exit ;;
     *:ekkoBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
        exit ;;
     *:SolidBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
+       exit ;;
+    *:OS108:*:*)
+       echo "$UNAME_MACHINE"-unknown-os108_"$UNAME_RELEASE"
        exit ;;
     macppc:MirBSD:*:*)
-       echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+       echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
        exit ;;
     *:MirBSD:*:*)
-       echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
        exit ;;
     *:Sortix:*:*)
-       echo ${UNAME_MACHINE}-unknown-sortix
+       echo "$UNAME_MACHINE"-unknown-sortix
+       exit ;;
+    *:Twizzler:*:*)
+       echo "$UNAME_MACHINE"-unknown-twizzler
+       exit ;;
+    *:Redox:*:*)
+       echo "$UNAME_MACHINE"-unknown-redox
+       exit ;;
+    mips:OSF1:*.*)
+       echo mips-dec-osf1
        exit ;;
     alpha:OSF1:*:*)
+       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+       trap '' 0
        case $UNAME_RELEASE in
        *4.0)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+               UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $3}')
                ;;
        *5.*)
-               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+               UNAME_RELEASE=$(/usr/sbin/sizer -v | awk '{print $4}')
                ;;
        esac
        # According to Compaq, /usr/sbin/psrinfo has been available on
        # OSF/1 and Tru64 systems produced since 1995.  I hope that
        # covers most systems running today.  This code pipes the CPU
        # types through head -n 1, so we only detect the type of CPU 0.
-       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
-       case "$ALPHA_CPU_TYPE" in
+       ALPHA_CPU_TYPE=$(/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1)
+       case $ALPHA_CPU_TYPE in
            "EV4 (21064)")
                UNAME_MACHINE=alpha ;;
            "EV4.5 (21064)")
@@ -310,28 +352,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        # A Tn.n version is a released field test version.
        # A Xn.n version is an unreleased experimental baselevel.
        # 1.2 uses "1.2" for uname -r.
-       echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
-       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
-       exitcode=$?
-       trap '' 0
-       exit $exitcode ;;
-    Alpha\ *:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # Should we change UNAME_MACHINE based on the output of uname instead
-       # of the specific Alpha model?
-       echo alpha-pc-interix
-       exit ;;
-    21064:Windows_NT:50:3)
-       echo alpha-dec-winnt3.5
+       echo "$UNAME_MACHINE"-dec-osf"$(echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)"
        exit ;;
     Amiga*:UNIX_System_V:4.0:*)
        echo m68k-unknown-sysv4
        exit ;;
     *:[Aa]miga[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-amigaos
+       echo "$UNAME_MACHINE"-unknown-amigaos
        exit ;;
     *:[Mm]orph[Oo][Ss]:*:*)
-       echo ${UNAME_MACHINE}-unknown-morphos
+       echo "$UNAME_MACHINE"-unknown-morphos
        exit ;;
     *:OS/390:*:*)
        echo i370-ibm-openedition
@@ -343,7 +373,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo powerpc-ibm-os400
        exit ;;
     arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
-       echo arm-acorn-riscix${UNAME_RELEASE}
+       echo arm-acorn-riscix"$UNAME_RELEASE"
        exit ;;
     arm*:riscos:*:*|arm*:RISCOS:*:*)
        echo arm-unknown-riscos
@@ -353,7 +383,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        exit ;;
     Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
-       if test "`(/bin/universe) 2>/dev/null`" = att ; then
+       if test "$( (/bin/universe) 2>/dev/null)" = att ; then
                echo pyramid-pyramid-sysv3
        else
                echo pyramid-pyramid-bsd
@@ -366,28 +396,28 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
        echo sparc-icl-nx6
        exit ;;
     DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
-       case `/usr/bin/uname -p` in
+       case $(/usr/bin/uname -p) in
            sparc) echo sparc-icl-nx7; exit ;;
        esac ;;
     s390x:SunOS:*:*)
-       echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo "$UNAME_MACHINE"-ibm-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
        exit ;;
     sun4H:SunOS:5.*:*)
-       echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-hal-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
        exit ;;
     sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
-       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-sun-solaris2"$(echo "$UNAME_RELEASE" | sed -e 's/[^.]*//')"
        exit ;;
     i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
-       echo i386-pc-auroraux${UNAME_RELEASE}
+       echo i386-pc-auroraux"$UNAME_RELEASE"
        exit ;;
     i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
-       eval $set_cc_for_build
+       set_cc_for_build
        SUN_ARCH=i386
        # If there is a compiler, see if it is configured for 64-bit objects.
        # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
        # This test works for both compilers.
-       if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+       if test "$CC_FOR_BUILD" != no_compiler_found; then
            if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
                (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
                grep IS_64BIT_ARCH >/dev/null
@@ -395,40 +425,40 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
                SUN_ARCH=x86_64
            fi
        fi
-       echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo "$SUN_ARCH"-pc-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
        exit ;;
     sun4*:SunOS:6*:*)
        # According to config.sub, this is the proper way to canonicalize
        # SunOS6.  Hard to guess exactly what SunOS6 will be like, but
        # it's likely to be more like Solaris than SunOS4.
-       echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo sparc-sun-solaris3"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
        exit ;;
     sun4*:SunOS:*:*)
-       case "`/usr/bin/arch -k`" in
+       case $(/usr/bin/arch -k) in
            Series*|S4*)
-               UNAME_RELEASE=`uname -v`
+               UNAME_RELEASE=$(uname -v)
                ;;
        esac
        # Japanese Language versions have a version number like `4.1.3-JL'.
-       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       echo sparc-sun-sunos"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/')"
        exit ;;
     sun3*:SunOS:*:*)
-       echo m68k-sun-sunos${UNAME_RELEASE}
+       echo m68k-sun-sunos"$UNAME_RELEASE"
        exit ;;
     sun*:*:4.2BSD:*)
-       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
-       test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
-       case "`/bin/arch`" in
+       UNAME_RELEASE=$( (sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null)
+       test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
+       case $(/bin/arch) in
            sun3)
-               echo m68k-sun-sunos${UNAME_RELEASE}
+               echo m68k-sun-sunos"$UNAME_RELEASE"
                ;;
            sun4)
-               echo sparc-sun-sunos${UNAME_RELEASE}
+               echo sparc-sun-sunos"$UNAME_RELEASE"
                ;;
        esac
        exit ;;
     aushp:SunOS:*:*)
-       echo sparc-auspex-sunos${UNAME_RELEASE}
+       echo sparc-auspex-sunos"$UNAME_RELEASE"
        exit ;;
     # The situation for MiNT is a little confusing.  The machine name
     # can be virtually everything (everything which is not
@@ -439,44 +469,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
     # MiNT.  But MiNT is downward compatible to TOS, so this should
     # be no problem.
     atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
-       echo m68k-atari-mint${UNAME_RELEASE}
+       echo m68k-atari-mint"$UNAME_RELEASE"
        exit ;;
     milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
-       echo m68k-milan-mint${UNAME_RELEASE}
+       echo m68k-milan-mint"$UNAME_RELEASE"
        exit ;;
     hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
-       echo m68k-hades-mint${UNAME_RELEASE}
+       echo m68k-hades-mint"$UNAME_RELEASE"
        exit ;;
     *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
-       echo m68k-unknown-mint${UNAME_RELEASE}
+       echo m68k-unknown-mint"$UNAME_RELEASE"
        exit ;;
     m68k:machten:*:*)
-       echo m68k-apple-machten${UNAME_RELEASE}
+       echo m68k-apple-machten"$UNAME_RELEASE"
        exit ;;
     powerpc:machten:*:*)
-       echo powerpc-apple-machten${UNAME_RELEASE}
+       echo powerpc-apple-machten"$UNAME_RELEASE"
        exit ;;
     RISC*:Mach:*:*)
        echo mips-dec-mach_bsd4.3
        exit ;;
     RISC*:ULTRIX:*:*)
-       echo mips-dec-ultrix${UNAME_RELEASE}
+       echo mips-dec-ultrix"$UNAME_RELEASE"
        exit ;;
     VAX*:ULTRIX*:*:*)
-       echo vax-dec-ultrix${UNAME_RELEASE}
+       echo vax-dec-ultrix"$UNAME_RELEASE"
        exit ;;
     2020:CLIX:*:* | 2430:CLIX:*:*)
-       echo clipper-intergraph-clix${UNAME_RELEASE}
+       echo clipper-intergraph-clix"$UNAME_RELEASE"
        exit ;;
     mips:*:*:UMIPS | mips:*:*:RISCos)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
 #ifdef __cplusplus
 #include <stdio.h>  /* for printf() prototype */
        int main (int argc, char *argv[]) {
@@ -485,23 +515,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
 #endif
        #if defined (host_mips) && defined (MIPSEB)
        #if defined (SYSTYPE_SYSV)
-         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+         printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
        #endif
        #if defined (SYSTYPE_SVR4)
-         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+         printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
        #endif
        #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
-         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+         printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
        #endif
        #endif
          exit (-1);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c &&
-         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
-         SYSTEM_NAME=`$dummy $dummyarg` &&
+       $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+         dummyarg=$(echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p') &&
+         SYSTEM_NAME=$("$dummy" "$dummyarg") &&
            { echo "$SYSTEM_NAME"; exit; }
-       echo mips-mips-riscos${UNAME_RELEASE}
+       echo mips-mips-riscos"$UNAME_RELEASE"
        exit ;;
     Motorola:PowerMAX_OS:*:*)
        echo powerpc-motorola-powermax
@@ -526,18 +556,18 @@ EOF
        exit ;;
     AViiON:dgux:*:*)
        # DG/UX returns AViiON for all architectures
-       UNAME_PROCESSOR=`/usr/bin/uname -p`
-       if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+       UNAME_PROCESSOR=$(/usr/bin/uname -p)
+       if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
        then
-           if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
-              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
+              test "$TARGET_BINARY_INTERFACE"x = x
            then
-               echo m88k-dg-dgux${UNAME_RELEASE}
+               echo m88k-dg-dgux"$UNAME_RELEASE"
            else
-               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+               echo m88k-dg-dguxbcs"$UNAME_RELEASE"
            fi
        else
-           echo i586-dg-dgux${UNAME_RELEASE}
+           echo i586-dg-dgux"$UNAME_RELEASE"
        fi
        exit ;;
     M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
@@ -554,26 +584,26 @@ EOF
        echo m68k-tektronix-bsd
        exit ;;
     *:IRIX*:*:*)
-       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       echo mips-sgi-irix"$(echo "$UNAME_RELEASE"|sed -e 's/-/_/g')"
        exit ;;
     ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
        echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
-       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+       exit ;;               # Note that: echo "'$(uname -s)'" gives 'AIX '
     i*86:AIX:*:*)
        echo i386-ibm-aix
        exit ;;
     ia64:AIX:*:*)
-       if [ -x /usr/bin/oslevel ] ; then
-               IBM_REV=`/usr/bin/oslevel`
+       if test -x /usr/bin/oslevel ; then
+               IBM_REV=$(/usr/bin/oslevel)
        else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
-       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+       echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
        exit ;;
     *:AIX:2:3)
        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
-               eval $set_cc_for_build
-               sed 's/^                //' << EOF >$dummy.c
+               set_cc_for_build
+               sed 's/^                //' << EOF > "$dummy.c"
                #include <sys/systemcfg.h>
 
                main()
@@ -584,7 +614,7 @@ EOF
                        exit(0);
                        }
 EOF
-               if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+               if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy")
                then
                        echo "$SYSTEM_NAME"
                else
@@ -597,28 +627,28 @@ EOF
        fi
        exit ;;
     *:AIX:*:[4567])
-       IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
-       if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+       IBM_CPU_ID=$(/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }')
+       if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
                IBM_ARCH=rs6000
        else
                IBM_ARCH=powerpc
        fi
-       if [ -x /usr/bin/lslpp ] ; then
-               IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
-                          awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+       if test -x /usr/bin/lslpp ; then
+               IBM_REV=$(/usr/bin/lslpp -Lqc bos.rte.libc |
+                          awk -F: '{ print $3 }' | sed s/[0-9]*$/0/)
        else
-               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+               IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
        fi
-       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
        exit ;;
     *:AIX:*:*)
        echo rs6000-ibm-aix
        exit ;;
-    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+    ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
        echo romp-ibm-bsd4.4
        exit ;;
     ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
-       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       echo romp-ibm-bsd"$UNAME_RELEASE"   # 4.3 with uname added to
        exit ;;                             # report: romp-ibm BSD 4.3
     *:BOSX:*:*)
        echo rs6000-bull-bosx
@@ -633,28 +663,28 @@ EOF
        echo m68k-hp-bsd4.4
        exit ;;
     9000/[34678]??:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       case "${UNAME_MACHINE}" in
-           9000/31? )            HP_ARCH=m68000 ;;
-           9000/[34]?? )         HP_ARCH=m68k ;;
+       HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
+       case $UNAME_MACHINE in
+           9000/31?)            HP_ARCH=m68000 ;;
+           9000/[34]??)         HP_ARCH=m68k ;;
            9000/[678][0-9][0-9])
-               if [ -x /usr/bin/getconf ]; then
-                   sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
-                   sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
-                   case "${sc_cpu_version}" in
+               if test -x /usr/bin/getconf; then
+                   sc_cpu_version=$(/usr/bin/getconf SC_CPU_VERSION 2>/dev/null)
+                   sc_kernel_bits=$(/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null)
+                   case $sc_cpu_version in
                      523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
                      528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
                      532)                      # CPU_PA_RISC2_0
-                       case "${sc_kernel_bits}" in
+                       case $sc_kernel_bits in
                          32) HP_ARCH=hppa2.0n ;;
                          64) HP_ARCH=hppa2.0w ;;
                          '') HP_ARCH=hppa2.0 ;;   # HP-UX 10.20
                        esac ;;
                    esac
                fi
-               if [ "${HP_ARCH}" = "" ]; then
-                   eval $set_cc_for_build
-                   sed 's/^            //' << EOF >$dummy.c
+               if test "$HP_ARCH" = ""; then
+                   set_cc_for_build
+                   sed 's/^            //' << EOF > "$dummy.c"
 
                #define _HPUX_SOURCE
                #include <stdlib.h>
@@ -687,13 +717,13 @@ EOF
                    exit (0);
                }
 EOF
-                   (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+                   (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=$("$dummy")
                    test -z "$HP_ARCH" && HP_ARCH=hppa
                fi ;;
        esac
-       if [ ${HP_ARCH} = hppa2.0w ]
+       if test "$HP_ARCH" = hppa2.0w
        then
-           eval $set_cc_for_build
+           set_cc_for_build
 
            # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
            # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
@@ -712,15 +742,15 @@ EOF
                HP_ARCH=hppa64
            fi
        fi
-       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
        exit ;;
     ia64:HP-UX:*:*)
-       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
-       echo ia64-hp-hpux${HPUX_REV}
+       HPUX_REV=$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//')
+       echo ia64-hp-hpux"$HPUX_REV"
        exit ;;
     3050*:HI-UX:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       sed 's/^        //' << EOF > "$dummy.c"
        #include <unistd.h>
        int
        main ()
@@ -745,11 +775,11 @@ EOF
          exit (0);
        }
 EOF
-       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+       $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=$("$dummy") &&
                { echo "$SYSTEM_NAME"; exit; }
        echo unknown-hitachi-hiuxwe2
        exit ;;
-    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
        echo hppa1.1-hp-bsd
        exit ;;
     9000/8??:4.3bsd:*:*)
@@ -758,17 +788,17 @@ EOF
     *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
        echo hppa1.0-hp-mpeix
        exit ;;
-    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
        echo hppa1.1-hp-osf
        exit ;;
     hp8??:OSF1:*:*)
        echo hppa1.0-hp-osf
        exit ;;
     i*86:OSF1:*:*)
-       if [ -x /usr/sbin/sysversion ] ; then
-           echo ${UNAME_MACHINE}-unknown-osf1mk
+       if test -x /usr/sbin/sysversion ; then
+           echo "$UNAME_MACHINE"-unknown-osf1mk
        else
-           echo ${UNAME_MACHINE}-unknown-osf1
+           echo "$UNAME_MACHINE"-unknown-osf1
        fi
        exit ;;
     parisc*:Lites*:*:*)
@@ -793,130 +823,123 @@ EOF
        echo c4-convex-bsd
        exit ;;
     CRAY*Y-MP:*:*:*)
-       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*[A-Z]90:*:*:*)
-       echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+       echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
        | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
              -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*TS:*:*:*)
-       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*T3E:*:*:*)
-       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     CRAY*SV1:*:*:*)
-       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     *:UNICOS/mp:*:*)
-       echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
        exit ;;
     F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
-       FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
-       FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-       FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+       FUJITSU_PROC=$(uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz)
+       FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
+       FUJITSU_REL=$(echo "$UNAME_RELEASE" | sed -e 's/ /_/')
        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     5000:UNIX_System_V:4.*:*)
-       FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
-       FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+       FUJITSU_SYS=$(uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///')
+       FUJITSU_REL=$(echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/')
        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
        exit ;;
     i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
-       echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
        exit ;;
     sparc*:BSD/OS:*:*)
-       echo sparc-unknown-bsdi${UNAME_RELEASE}
+       echo sparc-unknown-bsdi"$UNAME_RELEASE"
        exit ;;
     *:BSD/OS:*:*)
-       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
+       exit ;;
+    arm:FreeBSD:*:*)
+       UNAME_PROCESSOR=$(uname -p)
+       set_cc_for_build
+       if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+           | grep -q __ARM_PCS_VFP
+       then
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabi
+       else
+           echo "${UNAME_PROCESSOR}"-unknown-freebsd"$(echo ${UNAME_RELEASE}|sed -e 's/[-(].*//')"-gnueabihf
+       fi
        exit ;;
     *:FreeBSD:*:*)
-       UNAME_PROCESSOR=`/usr/bin/uname -p`
-       case ${UNAME_PROCESSOR} in
+       UNAME_PROCESSOR=$(/usr/bin/uname -p)
+       case $UNAME_PROCESSOR in
            amd64)
-               echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
-           *)
-               echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+               UNAME_PROCESSOR=x86_64 ;;
+           i386)
+               UNAME_PROCESSOR=i586 ;;
        esac
+       echo "$UNAME_PROCESSOR"-unknown-freebsd"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
        exit ;;
     i*:CYGWIN*:*)
-       echo ${UNAME_MACHINE}-pc-cygwin
+       echo "$UNAME_MACHINE"-pc-cygwin
        exit ;;
     *:MINGW64*:*)
-       echo ${UNAME_MACHINE}-pc-mingw64
+       echo "$UNAME_MACHINE"-pc-mingw64
        exit ;;
     *:MINGW*:*)
-       echo ${UNAME_MACHINE}-pc-mingw32
+       echo "$UNAME_MACHINE"-pc-mingw32
        exit ;;
     *:MSYS*:*)
-       echo ${UNAME_MACHINE}-pc-msys
-       exit ;;
-    i*:windows32*:*)
-       # uname -m includes "-pc" on this system.
-       echo ${UNAME_MACHINE}-mingw32
+       echo "$UNAME_MACHINE"-pc-msys
        exit ;;
     i*:PW*:*)
-       echo ${UNAME_MACHINE}-pc-pw32
+       echo "$UNAME_MACHINE"-pc-pw32
        exit ;;
     *:Interix*:*)
-       case ${UNAME_MACHINE} in
+       case $UNAME_MACHINE in
            x86)
-               echo i586-pc-interix${UNAME_RELEASE}
+               echo i586-pc-interix"$UNAME_RELEASE"
                exit ;;
            authenticamd | genuineintel | EM64T)
-               echo x86_64-unknown-interix${UNAME_RELEASE}
+               echo x86_64-unknown-interix"$UNAME_RELEASE"
                exit ;;
            IA64)
-               echo ia64-unknown-interix${UNAME_RELEASE}
+               echo ia64-unknown-interix"$UNAME_RELEASE"
                exit ;;
        esac ;;
-    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
-       echo i${UNAME_MACHINE}-pc-mks
-       exit ;;
-    8664:Windows_NT:*)
-       echo x86_64-pc-mks
-       exit ;;
-    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
-       # How do we know it's Interix rather than the generic POSIX subsystem?
-       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
-       # UNAME_MACHINE based on the output of uname instead of i386?
-       echo i586-pc-interix
-       exit ;;
     i*:UWIN*:*)
-       echo ${UNAME_MACHINE}-pc-uwin
+       echo "$UNAME_MACHINE"-pc-uwin
        exit ;;
     amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
-       echo x86_64-unknown-cygwin
-       exit ;;
-    p*:CYGWIN*:*)
-       echo powerpcle-unknown-cygwin
+       echo x86_64-pc-cygwin
        exit ;;
     prep*:SunOS:5.*:*)
-       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
        exit ;;
     *:GNU:*:*)
        # the GNU system
-       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       echo "$(echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,')-unknown-$LIBC$(echo "$UNAME_RELEASE"|sed -e 's,/.*$,,')"
        exit ;;
     *:GNU/*:*:*)
        # other systems with GNU libc and userland
-       echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+       echo "$UNAME_MACHINE-unknown-$(echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]")$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')-$LIBC"
        exit ;;
-    i*86:Minix:*:*)
-       echo ${UNAME_MACHINE}-pc-minix
+    *:Minix:*:*)
+       echo "$UNAME_MACHINE"-unknown-minix
        exit ;;
     aarch64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     aarch64_be:Linux:*:*)
        UNAME_MACHINE=aarch64_be
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     alpha:Linux:*:*)
-       case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+       case $(sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null) in
          EV5)   UNAME_MACHINE=alphaev5 ;;
          EV56)  UNAME_MACHINE=alphaev56 ;;
          PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -927,140 +950,181 @@ EOF
        esac
        objdump --private-headers /bin/sh | grep -q ld.so.1
        if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
-    arc:Linux:*:* | arceb:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+    arc:Linux:*:* | arceb:Linux:*:* | arc64:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     arm*:Linux:*:*)
-       eval $set_cc_for_build
+       set_cc_for_build
        if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
            | grep -q __ARM_EABI__
        then
-           echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+           echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        else
            if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
                | grep -q __ARM_PCS_VFP
            then
-               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
            else
-               echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
+               echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
            fi
        fi
        exit ;;
     avr32*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     cris:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
        exit ;;
     crisv32:Linux:*:*)
-       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
        exit ;;
     e2k:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     frv:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     hexagon:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     i*86:Linux:*:*)
-       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
        exit ;;
     ia64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     k1om:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
+       exit ;;
+    loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     m32r*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     m68*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
-       eval $set_cc_for_build
-       sed 's/^        //' << EOF >$dummy.c
+       set_cc_for_build
+       IS_GLIBC=0
+       test x"${LIBC}" = xgnu && IS_GLIBC=1
+       sed 's/^        //' << EOF > "$dummy.c"
        #undef CPU
-       #undef ${UNAME_MACHINE}
-       #undef ${UNAME_MACHINE}el
+       #undef mips
+       #undef mipsel
+       #undef mips64
+       #undef mips64el
+       #if ${IS_GLIBC} && defined(_ABI64)
+       LIBCABI=gnuabi64
+       #else
+       #if ${IS_GLIBC} && defined(_ABIN32)
+       LIBCABI=gnuabin32
+       #else
+       LIBCABI=${LIBC}
+       #endif
+       #endif
+
+       #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+       CPU=mipsisa64r6
+       #else
+       #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+       CPU=mipsisa32r6
+       #else
+       #if defined(__mips64)
+       CPU=mips64
+       #else
+       CPU=mips
+       #endif
+       #endif
+       #endif
+
        #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
-       CPU=${UNAME_MACHINE}el
+       MIPS_ENDIAN=el
        #else
        #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
-       CPU=${UNAME_MACHINE}
+       MIPS_ENDIAN=
        #else
-       CPU=
+       MIPS_ENDIAN=
        #endif
        #endif
 EOF
-       eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-       test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
+       eval "$($CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI')"
+       test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
        ;;
     mips64el:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     openrisc*:Linux:*:*)
-       echo or1k-unknown-linux-${LIBC}
+       echo or1k-unknown-linux-"$LIBC"
        exit ;;
     or32:Linux:*:* | or1k*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     padre:Linux:*:*)
-       echo sparc-unknown-linux-${LIBC}
+       echo sparc-unknown-linux-"$LIBC"
        exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-       echo hppa64-unknown-linux-${LIBC}
+       echo hppa64-unknown-linux-"$LIBC"
        exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
        # Look for CPU level
-       case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-         PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
-         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
-         *)    echo hppa-unknown-linux-${LIBC} ;;
+       case $(grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2) in
+         PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
+         PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
+         *)    echo hppa-unknown-linux-"$LIBC" ;;
        esac
        exit ;;
     ppc64:Linux:*:*)
-       echo powerpc64-unknown-linux-${LIBC}
+       echo powerpc64-unknown-linux-"$LIBC"
        exit ;;
     ppc:Linux:*:*)
-       echo powerpc-unknown-linux-${LIBC}
+       echo powerpc-unknown-linux-"$LIBC"
        exit ;;
     ppc64le:Linux:*:*)
-       echo powerpc64le-unknown-linux-${LIBC}
+       echo powerpc64le-unknown-linux-"$LIBC"
        exit ;;
     ppcle:Linux:*:*)
-       echo powerpcle-unknown-linux-${LIBC}
+       echo powerpcle-unknown-linux-"$LIBC"
        exit ;;
-    riscv32:Linux:*:* | riscv64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+    riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-       echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
+       echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
        exit ;;
     sh64*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     sh*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     tile*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     vax:Linux:*:*)
-       echo ${UNAME_MACHINE}-dec-linux-${LIBC}
+       echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
        exit ;;
     x86_64:Linux:*:*)
-       echo ${UNAME_MACHINE}-pc-linux-${LIBC}
+       set_cc_for_build
+       LIBCABI=$LIBC
+       if test "$CC_FOR_BUILD" != no_compiler_found; then
+           if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \
+               (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+               grep IS_X32 >/dev/null
+           then
+               LIBCABI="$LIBC"x32
+           fi
+       fi
+       echo "$UNAME_MACHINE"-pc-linux-"$LIBCABI"
        exit ;;
     xtensa*:Linux:*:*)
-       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
        exit ;;
     i*86:DYNIX/ptx:4*:*)
        # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1074,51 +1138,51 @@ EOF
        # I am not positive that other SVR4 systems won't match this,
        # I just have to hope.  -- rms.
        # Use sysv4.2uw... so that sysv4* matches it.
-       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+       echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
        exit ;;
     i*86:OS/2:*:*)
        # If we were able to find `uname', then EMX Unix compatibility
        # is probably installed.
-       echo ${UNAME_MACHINE}-pc-os2-emx
+       echo "$UNAME_MACHINE"-pc-os2-emx
        exit ;;
     i*86:XTS-300:*:STOP)
-       echo ${UNAME_MACHINE}-unknown-stop
+       echo "$UNAME_MACHINE"-unknown-stop
        exit ;;
     i*86:atheos:*:*)
-       echo ${UNAME_MACHINE}-unknown-atheos
+       echo "$UNAME_MACHINE"-unknown-atheos
        exit ;;
     i*86:syllable:*:*)
-       echo ${UNAME_MACHINE}-pc-syllable
+       echo "$UNAME_MACHINE"-pc-syllable
        exit ;;
     i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
-       echo i386-unknown-lynxos${UNAME_RELEASE}
+       echo i386-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     i*86:*DOS:*:*)
-       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       echo "$UNAME_MACHINE"-pc-msdosdjgpp
        exit ;;
-    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
-       UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+    i*86:*:4.*:*)
+       UNAME_REL=$(echo "$UNAME_RELEASE" | sed 's/\/MP$//')
        if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
-               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+               echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
        else
-               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+               echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
        fi
        exit ;;
     i*86:*:5:[678]*)
        # UnixWare 7.x, OpenUNIX and OpenServer 6.
-       case `/bin/uname -X | grep "^Machine"` in
+       case $(/bin/uname -X | grep "^Machine") in
            *486*)           UNAME_MACHINE=i486 ;;
            *Pentium)        UNAME_MACHINE=i586 ;;
            *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
        esac
-       echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+       echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}"
        exit ;;
     i*86:*:3.2:*)
        if test -f /usr/options/cb.name; then
-               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
-               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+               UNAME_REL=$(sed -n 's/.*Version //p' </usr/options/cb.name)
+               echo "$UNAME_MACHINE"-pc-isc"$UNAME_REL"
        elif /bin/uname -X 2>/dev/null >/dev/null ; then
-               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               UNAME_REL=$( (/bin/uname -X|grep Release|sed -e 's/.*= //'))
                (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
                (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
                        && UNAME_MACHINE=i586
@@ -1126,9 +1190,9 @@ EOF
                        && UNAME_MACHINE=i686
                (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
                        && UNAME_MACHINE=i686
-               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+               echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
        else
-               echo ${UNAME_MACHINE}-pc-sysv32
+               echo "$UNAME_MACHINE"-pc-sysv32
        fi
        exit ;;
     pc:*:*:*)
@@ -1148,9 +1212,9 @@ EOF
        exit ;;
     i860:*:4.*:*) # i860-SVR4
        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
-         echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+         echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
        else # Add other i860-SVR4 vendors below as they are discovered.
-         echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+         echo i860-unknown-sysv"$UNAME_RELEASE"  # Unknown i860-SVR4
        fi
        exit ;;
     mini*:CTIX:SYS*5:*)
@@ -1168,41 +1232,41 @@ EOF
     3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
        OS_REL=''
        test -r /etc/.relid \
-       && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-         && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+         && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+         && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
          && { echo i486-ncr-sysv4; exit; } ;;
     NCR*:*:4.2:* | MPRAS*:*:4.2:*)
        OS_REL='.3'
        test -r /etc/.relid \
-           && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+           && OS_REL=.$(sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid)
        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
-           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+           && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
        /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
-           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+           && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
     m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
-       echo m68k-unknown-lynxos${UNAME_RELEASE}
+       echo m68k-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     mc68030:UNIX_System_V:4.*:*)
        echo m68k-atari-sysv4
        exit ;;
     TSUNAMI:LynxOS:2.*:*)
-       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       echo sparc-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     rs6000:LynxOS:2.*:*)
-       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       echo rs6000-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
-       echo powerpc-unknown-lynxos${UNAME_RELEASE}
+       echo powerpc-unknown-lynxos"$UNAME_RELEASE"
        exit ;;
     SM[BE]S:UNIX_SV:*:*)
-       echo mips-dde-sysv${UNAME_RELEASE}
+       echo mips-dde-sysv"$UNAME_RELEASE"
        exit ;;
     RM*:ReliantUNIX-*:*:*)
        echo mips-sni-sysv4
@@ -1212,8 +1276,8 @@ EOF
        exit ;;
     *:SINIX-*:*:*)
        if uname -p 2>/dev/null >/dev/null ; then
-               UNAME_MACHINE=`(uname -p) 2>/dev/null`
-               echo ${UNAME_MACHINE}-sni-sysv4
+               UNAME_MACHINE=$( (uname -p) 2>/dev/null)
+               echo "$UNAME_MACHINE"-sni-sysv4
        else
                echo ns32k-sni-sysv
        fi
@@ -1233,23 +1297,23 @@ EOF
        exit ;;
     i*86:VOS:*:*)
        # From Paul.Green@stratus.com.
-       echo ${UNAME_MACHINE}-stratus-vos
+       echo "$UNAME_MACHINE"-stratus-vos
        exit ;;
     *:VOS:*:*)
        # From Paul.Green@stratus.com.
        echo hppa1.1-stratus-vos
        exit ;;
     mc68*:A/UX:*:*)
-       echo m68k-apple-aux${UNAME_RELEASE}
+       echo m68k-apple-aux"$UNAME_RELEASE"
        exit ;;
     news*:NEWS-OS:6*:*)
        echo mips-sony-newsos6
        exit ;;
     R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
-       if [ -d /usr/nec ]; then
-               echo mips-nec-sysv${UNAME_RELEASE}
+       if test -d /usr/nec; then
+               echo mips-nec-sysv"$UNAME_RELEASE"
        else
-               echo mips-unknown-sysv${UNAME_RELEASE}
+               echo mips-unknown-sysv"$UNAME_RELEASE"
        fi
        exit ;;
     BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
@@ -1268,80 +1332,97 @@ EOF
        echo x86_64-unknown-haiku
        exit ;;
     SX-4:SUPER-UX:*:*)
-       echo sx4-nec-superux${UNAME_RELEASE}
+       echo sx4-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-5:SUPER-UX:*:*)
-       echo sx5-nec-superux${UNAME_RELEASE}
+       echo sx5-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-6:SUPER-UX:*:*)
-       echo sx6-nec-superux${UNAME_RELEASE}
+       echo sx6-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-7:SUPER-UX:*:*)
-       echo sx7-nec-superux${UNAME_RELEASE}
+       echo sx7-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-8:SUPER-UX:*:*)
-       echo sx8-nec-superux${UNAME_RELEASE}
+       echo sx8-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-8R:SUPER-UX:*:*)
-       echo sx8r-nec-superux${UNAME_RELEASE}
+       echo sx8r-nec-superux"$UNAME_RELEASE"
        exit ;;
     SX-ACE:SUPER-UX:*:*)
-       echo sxace-nec-superux${UNAME_RELEASE}
+       echo sxace-nec-superux"$UNAME_RELEASE"
        exit ;;
     Power*:Rhapsody:*:*)
-       echo powerpc-apple-rhapsody${UNAME_RELEASE}
+       echo powerpc-apple-rhapsody"$UNAME_RELEASE"
        exit ;;
     *:Rhapsody:*:*)
-       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
+       exit ;;
+    arm64:Darwin:*:*)
+       echo aarch64-apple-darwin"$UNAME_RELEASE"
        exit ;;
     *:Darwin:*:*)
-       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-       eval $set_cc_for_build
-       if test "$UNAME_PROCESSOR" = unknown ; then
-           UNAME_PROCESSOR=powerpc
+       UNAME_PROCESSOR=$(uname -p)
+       case $UNAME_PROCESSOR in
+           unknown) UNAME_PROCESSOR=powerpc ;;
+       esac
+       if command -v xcode-select > /dev/null 2> /dev/null && \
+               ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+           # Avoid executing cc if there is no toolchain installed as
+           # cc will be a stub that puts up a graphical alert
+           # prompting the user to install developer tools.
+           CC_FOR_BUILD=no_compiler_found
+       else
+           set_cc_for_build
        fi
-       if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
-           if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
-               if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-                   (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
-                   grep IS_64BIT_ARCH >/dev/null
-               then
-                   case $UNAME_PROCESSOR in
-                       i386) UNAME_PROCESSOR=x86_64 ;;
-                       powerpc) UNAME_PROCESSOR=powerpc64 ;;
-                   esac
-               fi
+       if test "$CC_FOR_BUILD" != no_compiler_found; then
+           if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+                  (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                  grep IS_64BIT_ARCH >/dev/null
+           then
+               case $UNAME_PROCESSOR in
+                   i386) UNAME_PROCESSOR=x86_64 ;;
+                   powerpc) UNAME_PROCESSOR=powerpc64 ;;
+               esac
+           fi
+           # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+           if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+                  (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+                  grep IS_PPC >/dev/null
+           then
+               UNAME_PROCESSOR=powerpc
            fi
        elif test "$UNAME_PROCESSOR" = i386 ; then
-           # Avoid executing cc on OS X 10.9, as it ships with a stub
-           # that puts up a graphical alert prompting to install
-           # developer tools.  Any system running Mac OS X 10.7 or
-           # later (Darwin 11 and later) is required to have a 64-bit
-           # processor. This is not true of the ARM version of Darwin
-           # that Apple uses in portable devices.
-           UNAME_PROCESSOR=x86_64
+           # uname -m returns i386 or x86_64
+           UNAME_PROCESSOR=$UNAME_MACHINE
        fi
-       echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+       echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
        exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
-       UNAME_PROCESSOR=`uname -p`
+       UNAME_PROCESSOR=$(uname -p)
        if test "$UNAME_PROCESSOR" = x86; then
                UNAME_PROCESSOR=i386
                UNAME_MACHINE=pc
        fi
-       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
        exit ;;
     *:QNX:*:4*)
        echo i386-pc-qnx
        exit ;;
-    NEO-?:NONSTOP_KERNEL:*:*)
-       echo neo-tandem-nsk${UNAME_RELEASE}
+    NEO-*:NONSTOP_KERNEL:*:*)
+       echo neo-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     NSE-*:NONSTOP_KERNEL:*:*)
-       echo nse-tandem-nsk${UNAME_RELEASE}
+       echo nse-tandem-nsk"$UNAME_RELEASE"
        exit ;;
-    NSR-?:NONSTOP_KERNEL:*:*)
-       echo nsr-tandem-nsk${UNAME_RELEASE}
+    NSR-*:NONSTOP_KERNEL:*:*)
+       echo nsr-tandem-nsk"$UNAME_RELEASE"
+       exit ;;
+    NSV-*:NONSTOP_KERNEL:*:*)
+       echo nsv-tandem-nsk"$UNAME_RELEASE"
+       exit ;;
+    NSX-*:NONSTOP_KERNEL:*:*)
+       echo nsx-tandem-nsk"$UNAME_RELEASE"
        exit ;;
     *:NonStop-UX:*:*)
        echo mips-compaq-nonstopux
@@ -1350,18 +1431,18 @@ EOF
        echo bs2000-siemens-sysv
        exit ;;
     DS/*:UNIX_System_V:*:*)
-       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+       echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
        exit ;;
     *:Plan9:*:*)
        # "uname -m" is not consistent, so use $cputype instead. 386
        # is converted to i386 for consistency with other x86
        # operating systems.
-       if test "$cputype" = 386; then
+       if test "${cputype-}" = 386; then
            UNAME_MACHINE=i386
-       else
+       elif test "x${cputype-}" != x; then
            UNAME_MACHINE="$cputype"
        fi
-       echo ${UNAME_MACHINE}-unknown-plan9
+       echo "$UNAME_MACHINE"-unknown-plan9
        exit ;;
     *:TOPS-10:*:*)
        echo pdp10-unknown-tops10
@@ -1382,14 +1463,14 @@ EOF
        echo pdp10-unknown-its
        exit ;;
     SEI:*:*:SEIUX)
-       echo mips-sei-seiux${UNAME_RELEASE}
+       echo mips-sei-seiux"$UNAME_RELEASE"
        exit ;;
     *:DragonFly:*:*)
-       echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+       echo "$UNAME_MACHINE"-unknown-dragonfly"$(echo "$UNAME_RELEASE"|sed -e 's/[-(].*//')"
        exit ;;
     *:*VMS:*:*)
-       UNAME_MACHINE=`(uname -p) 2>/dev/null`
-       case "${UNAME_MACHINE}" in
+       UNAME_MACHINE=$( (uname -p) 2>/dev/null)
+       case $UNAME_MACHINE in
            A*) echo alpha-dec-vms ; exit ;;
            I*) echo ia64-dec-vms ; exit ;;
            V*) echo vax-dec-vms ; exit ;;
@@ -1398,32 +1479,190 @@ EOF
        echo i386-pc-xenix
        exit ;;
     i*86:skyos:*:*)
-       echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
+       echo "$UNAME_MACHINE"-pc-skyos"$(echo "$UNAME_RELEASE" | sed -e 's/ .*$//')"
        exit ;;
     i*86:rdos:*:*)
-       echo ${UNAME_MACHINE}-pc-rdos
+       echo "$UNAME_MACHINE"-pc-rdos
        exit ;;
-    i*86:AROS:*:*)
-       echo ${UNAME_MACHINE}-pc-aros
+    *:AROS:*:*)
+       echo "$UNAME_MACHINE"-unknown-aros
        exit ;;
     x86_64:VMkernel:*:*)
-       echo ${UNAME_MACHINE}-unknown-esx
+       echo "$UNAME_MACHINE"-unknown-esx
        exit ;;
     amd64:Isilon\ OneFS:*:*)
        echo x86_64-unknown-onefs
        exit ;;
+    *:Unleashed:*:*)
+       echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE"
+       exit ;;
+esac
+
+# No uname command or uname output not recognized.
+set_cc_for_build
+cat > "$dummy.c" <<EOF
+#ifdef _SEQUENT_
+#include <sys/types.h>
+#include <sys/utsname.h>
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include <signal.h>
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include <sys/utsname.h>
+#endif
+#endif
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+  "4"
+#else
+  ""
+#endif
+  ); exit (0);
+#endif
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=$( (hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null);
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+  struct utsname un;
+
+  uname(&un);
+  if (strncmp(un.version, "V2", 2) == 0) {
+    printf ("i386-sequent-ptx2\n"); exit (0);
+  }
+  if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+    printf ("i386-sequent-ptx1\n"); exit (0);
+  }
+  printf ("i386-sequent-ptx\n"); exit (0);
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+#include <sys/param.h>
+#if defined (BSD)
+#if BSD == 43
+  printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+  printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+  printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+  printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+  struct utsname un;
+  uname (&un);
+  printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+  printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+  struct utsname *un;
+  uname (&un);
+  printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+  printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=$($dummy) &&
+       { echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
+
+echo "$0: unable to guess system type" >&2
+
+case $UNAME_MACHINE:$UNAME_SYSTEM in
+    mips:Linux | mips64:Linux)
+       # If we got here on MIPS GNU/Linux, output extra information.
+       cat >&2 <<EOF
+
+NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize
+the system type. Please install a C compiler and try again.
+EOF
+       ;;
 esac
 
 cat >&2 <<EOF
-$0: unable to guess system type
 
 This script (version $timestamp), has failed to recognize the
-operating system you are using. If your script is old, overwrite
-config.guess and config.sub with the latest versions from:
+operating system you are using. If your script is old, overwrite *all*
+copies of config.guess and config.sub with the latest versions from:
 
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
+  https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
 and
-  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+  https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
+EOF
+
+year=$(echo $timestamp | sed 's,-.*,,')
+# shellcheck disable=SC2003
+if test "$(expr "$(date +%Y)" - "$year")" -lt 3 ; then
+   cat >&2 <<EOF
 
 If $0 has already been updated, send the following data and any
 information you think might be pertinent to config-patches@gnu.org to
@@ -1431,31 +1670,32 @@ provide the necessary information to handle your system.
 
 config.guess timestamp = $timestamp
 
-uname -m = `(uname -m) 2>/dev/null || echo unknown`
-uname -r = `(uname -r) 2>/dev/null || echo unknown`
-uname -s = `(uname -s) 2>/dev/null || echo unknown`
-uname -v = `(uname -v) 2>/dev/null || echo unknown`
+uname -m = $( (uname -m) 2>/dev/null || echo unknown)
+uname -r = $( (uname -r) 2>/dev/null || echo unknown)
+uname -s = $( (uname -s) 2>/dev/null || echo unknown)
+uname -v = $( (uname -v) 2>/dev/null || echo unknown)
 
-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
-/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+/usr/bin/uname -p = $( (/usr/bin/uname -p) 2>/dev/null)
+/bin/uname -X     = $( (/bin/uname -X) 2>/dev/null)
 
-hostinfo               = `(hostinfo) 2>/dev/null`
-/bin/universe          = `(/bin/universe) 2>/dev/null`
-/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
-/bin/arch              = `(/bin/arch) 2>/dev/null`
-/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+hostinfo               = $( (hostinfo) 2>/dev/null)
+/bin/universe          = $( (/bin/universe) 2>/dev/null)
+/usr/bin/arch -k       = $( (/usr/bin/arch -k) 2>/dev/null)
+/bin/arch              = $( (/bin/arch) 2>/dev/null)
+/usr/bin/oslevel       = $( (/usr/bin/oslevel) 2>/dev/null)
+/usr/convex/getsysinfo = $( (/usr/convex/getsysinfo) 2>/dev/null)
 
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM  = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM  = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
 EOF
+fi
 
 exit 1
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
index 98183ff..4b7dc49 100755 (executable)
@@ -2,7 +2,7 @@
 # Output a system dependent set of variables, describing how to set the
 # run time search path of shared libraries in an executable.
 #
-#   Copyright 1996-2016 Free Software Foundation, Inc.
+#   Copyright 1996-2021 Free Software Foundation, Inc.
 #   Taken from GNU libtool, 2001
 #   Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
 #
@@ -371,7 +371,7 @@ else
       hardcode_direct=yes
       hardcode_minus_L=yes
       ;;
-    freebsd* | dragonfly*)
+    freebsd* | dragonfly* | midnightbsd*)
       hardcode_libdir_flag_spec='-R$libdir'
       hardcode_direct=yes
       ;;
@@ -547,7 +547,7 @@ case "$host_os" in
   freebsd[23].*)
     library_names_spec='$libname$shrext$versuffix'
     ;;
-  freebsd* | dragonfly*)
+  freebsd* | dragonfly* | midnightbsd*)
     library_names_spec='$libname$shrext'
     ;;
   gnu*)
index 62b8259..7384e91 100755 (executable)
@@ -1,8 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright 1992-2016 Free Software Foundation, Inc.
+#   Copyright 1992-2021 Free Software Foundation, Inc.
 
-timestamp='2016-12-24'
+timestamp='2021-04-30'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -15,7 +15,7 @@ timestamp='2016-12-24'
 # General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program; if not, see <http://www.gnu.org/licenses/>.
+# along with this program; if not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -33,7 +33,7 @@ timestamp='2016-12-24'
 # Otherwise, we print the canonical config type on stdout and succeed.
 
 # You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
 
 # This file is supposed to be the same for all GNU packages
 # and recognize all the CPU types, system types and aliases
@@ -50,14 +50,14 @@ timestamp='2016-12-24'
 #      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
 # It is wrong to echo any other type of specification.
 
-me=`echo "$0" | sed -e 's,.*/,,'`
+me=$(echo "$0" | sed -e 's,.*/,,')
 
 usage="\
 Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
 
 Canonicalize a configuration name.
 
-Operation modes:
+Options:
   -h, --help         print this help, then exit
   -t, --time-stamp   print date of last modification, then exit
   -v, --version      print version number, then exit
@@ -67,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright 1992-2016 Free Software Foundation, Inc.
+Copyright 1992-2021 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -89,12 +89,12 @@ while test $# -gt 0 ; do
     - )        # Use stdin as input.
        break ;;
     -* )
-       echo "$me: invalid option $1$help"
+       echo "$me: invalid option $1$help" >&2
        exit 1 ;;
 
     *local*)
        # First pass through any local machine types.
-       echo $1
+       echo "$1"
        exit ;;
 
     * )
@@ -110,1244 +110,1173 @@ case $# in
     exit 1;;
 esac
 
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
-  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
-  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
-  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
-  kopensolaris*-gnu* | cloudabi*-eabi* | \
-  storm-chaos* | os2-emx* | rtmk-nova*)
-    os=-$maybe_os
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
-    ;;
-  android-linux)
-    os=-linux-android
-    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
-    ;;
-  *)
-    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
-    if [ $basic_machine != $1 ]
-    then os=`echo $1 | sed 's/.*-/-/'`
-    else os=; fi
-    ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+IFS="-" read field1 field2 field3 field4 <<EOF
+$1
+EOF
 
-### Let's recognize common machines as not being operating systems so
-### that things like config.sub decstation-3100 work.  We also
-### recognize some manufacturers as not being operating systems, so we
-### can provide default operating systems below.
-case $os in
-       -sun*os*)
-               # Prevent following clause from handling this invalid input.
-               ;;
-       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-       -apple | -axis | -knuth | -cray | -microblaze*)
-               os=
-               basic_machine=$1
-               ;;
-       -bluegene*)
-               os=-cnk
-               ;;
-       -sim | -cisco | -oki | -wec | -winbond)
-               os=
-               basic_machine=$1
-               ;;
-       -scout)
-               ;;
-       -wrs)
-               os=-vxworks
-               basic_machine=$1
-               ;;
-       -chorusos*)
-               os=-chorusos
-               basic_machine=$1
-               ;;
-       -chorusrdb)
-               os=-chorusrdb
-               basic_machine=$1
-               ;;
-       -hiux*)
-               os=-hiuxwe2
-               ;;
-       -sco6)
-               os=-sco5v6
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco5)
-               os=-sco3.2v5
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco4)
-               os=-sco3.2v4
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2.[4-9]*)
-               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco3.2v[4-9]*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco5v6*)
-               # Don't forget version if it is 3.2v4 or newer.
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -sco*)
-               os=-sco3.2v2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -udk*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -isc)
-               os=-isc2.2
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -clix*)
-               basic_machine=clipper-intergraph
-               ;;
-       -isc*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
-               ;;
-       -lynx*178)
-               os=-lynxos178
-               ;;
-       -lynx*5)
-               os=-lynxos5
-               ;;
-       -lynx*)
-               os=-lynxos
+# Separate into logical components for further validation
+case $1 in
+       *-*-*-*-*)
+               echo Invalid configuration \`"$1"\': more than four components >&2
+               exit 1
                ;;
-       -ptx*)
-               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+       *-*-*-*)
+               basic_machine=$field1-$field2
+               basic_os=$field3-$field4
                ;;
-       -windowsnt*)
-               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+       *-*-*)
+               # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+               # parts
+               maybe_os=$field2-$field3
+               case $maybe_os in
+                       nto-qnx* | linux-* | uclinux-uclibc* \
+                       | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+                       | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+                       | storm-chaos* | os2-emx* | rtmk-nova*)
+                               basic_machine=$field1
+                               basic_os=$maybe_os
+                               ;;
+                       android-linux)
+                               basic_machine=$field1-unknown
+                               basic_os=linux-android
+                               ;;
+                       *)
+                               basic_machine=$field1-$field2
+                               basic_os=$field3
+                               ;;
+               esac
                ;;
-       -psos*)
-               os=-psos
+       *-*)
+               # A lone config we happen to match not fitting any pattern
+               case $field1-$field2 in
+                       decstation-3100)
+                               basic_machine=mips-dec
+                               basic_os=
+                               ;;
+                       *-*)
+                               # Second component is usually, but not always the OS
+                               case $field2 in
+                                       # Prevent following clause from handling this valid os
+                                       sun*os*)
+                                               basic_machine=$field1
+                                               basic_os=$field2
+                                               ;;
+                                       # Manufacturers
+                                       dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+                                       | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+                                       | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+                                       | convergent* | ncr* | news | 32* | 3600* | 3100* \
+                                       | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+                                       | ultra | tti* | harris | dolphin | highlevel | gould \
+                                       | cbm | ns | masscomp | apple | axis | knuth | cray \
+                                       | microblaze* | sim | cisco \
+                                       | oki | wec | wrs | winbond)
+                                               basic_machine=$field1-$field2
+                                               basic_os=
+                                               ;;
+                                       *)
+                                               basic_machine=$field1
+                                               basic_os=$field2
+                                               ;;
+                               esac
+                       ;;
+               esac
                ;;
-       -mint | -mint[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
+       *)
+               # Convert single-component short-hands not valid as part of
+               # multi-component configurations.
+               case $field1 in
+                       386bsd)
+                               basic_machine=i386-pc
+                               basic_os=bsd
+                               ;;
+                       a29khif)
+                               basic_machine=a29k-amd
+                               basic_os=udi
+                               ;;
+                       adobe68k)
+                               basic_machine=m68010-adobe
+                               basic_os=scout
+                               ;;
+                       alliant)
+                               basic_machine=fx80-alliant
+                               basic_os=
+                               ;;
+                       altos | altos3068)
+                               basic_machine=m68k-altos
+                               basic_os=
+                               ;;
+                       am29k)
+                               basic_machine=a29k-none
+                               basic_os=bsd
+                               ;;
+                       amdahl)
+                               basic_machine=580-amdahl
+                               basic_os=sysv
+                               ;;
+                       amiga)
+                               basic_machine=m68k-unknown
+                               basic_os=
+                               ;;
+                       amigaos | amigados)
+                               basic_machine=m68k-unknown
+                               basic_os=amigaos
+                               ;;
+                       amigaunix | amix)
+                               basic_machine=m68k-unknown
+                               basic_os=sysv4
+                               ;;
+                       apollo68)
+                               basic_machine=m68k-apollo
+                               basic_os=sysv
+                               ;;
+                       apollo68bsd)
+                               basic_machine=m68k-apollo
+                               basic_os=bsd
+                               ;;
+                       aros)
+                               basic_machine=i386-pc
+                               basic_os=aros
+                               ;;
+                       aux)
+                               basic_machine=m68k-apple
+                               basic_os=aux
+                               ;;
+                       balance)
+                               basic_machine=ns32k-sequent
+                               basic_os=dynix
+                               ;;
+                       blackfin)
+                               basic_machine=bfin-unknown
+                               basic_os=linux
+                               ;;
+                       cegcc)
+                               basic_machine=arm-unknown
+                               basic_os=cegcc
+                               ;;
+                       convex-c1)
+                               basic_machine=c1-convex
+                               basic_os=bsd
+                               ;;
+                       convex-c2)
+                               basic_machine=c2-convex
+                               basic_os=bsd
+                               ;;
+                       convex-c32)
+                               basic_machine=c32-convex
+                               basic_os=bsd
+                               ;;
+                       convex-c34)
+                               basic_machine=c34-convex
+                               basic_os=bsd
+                               ;;
+                       convex-c38)
+                               basic_machine=c38-convex
+                               basic_os=bsd
+                               ;;
+                       cray)
+                               basic_machine=j90-cray
+                               basic_os=unicos
+                               ;;
+                       crds | unos)
+                               basic_machine=m68k-crds
+                               basic_os=
+                               ;;
+                       da30)
+                               basic_machine=m68k-da30
+                               basic_os=
+                               ;;
+                       decstation | pmax | pmin | dec3100 | decstatn)
+                               basic_machine=mips-dec
+                               basic_os=
+                               ;;
+                       delta88)
+                               basic_machine=m88k-motorola
+                               basic_os=sysv3
+                               ;;
+                       dicos)
+                               basic_machine=i686-pc
+                               basic_os=dicos
+                               ;;
+                       djgpp)
+                               basic_machine=i586-pc
+                               basic_os=msdosdjgpp
+                               ;;
+                       ebmon29k)
+                               basic_machine=a29k-amd
+                               basic_os=ebmon
+                               ;;
+                       es1800 | OSE68k | ose68k | ose | OSE)
+                               basic_machine=m68k-ericsson
+                               basic_os=ose
+                               ;;
+                       gmicro)
+                               basic_machine=tron-gmicro
+                               basic_os=sysv
+                               ;;
+                       go32)
+                               basic_machine=i386-pc
+                               basic_os=go32
+                               ;;
+                       h8300hms)
+                               basic_machine=h8300-hitachi
+                               basic_os=hms
+                               ;;
+                       h8300xray)
+                               basic_machine=h8300-hitachi
+                               basic_os=xray
+                               ;;
+                       h8500hms)
+                               basic_machine=h8500-hitachi
+                               basic_os=hms
+                               ;;
+                       harris)
+                               basic_machine=m88k-harris
+                               basic_os=sysv3
+                               ;;
+                       hp300 | hp300hpux)
+                               basic_machine=m68k-hp
+                               basic_os=hpux
+                               ;;
+                       hp300bsd)
+                               basic_machine=m68k-hp
+                               basic_os=bsd
+                               ;;
+                       hppaosf)
+                               basic_machine=hppa1.1-hp
+                               basic_os=osf
+                               ;;
+                       hppro)
+                               basic_machine=hppa1.1-hp
+                               basic_os=proelf
+                               ;;
+                       i386mach)
+                               basic_machine=i386-mach
+                               basic_os=mach
+                               ;;
+                       isi68 | isi)
+                               basic_machine=m68k-isi
+                               basic_os=sysv
+                               ;;
+                       m68knommu)
+                               basic_machine=m68k-unknown
+                               basic_os=linux
+                               ;;
+                       magnum | m3230)
+                               basic_machine=mips-mips
+                               basic_os=sysv
+                               ;;
+                       merlin)
+                               basic_machine=ns32k-utek
+                               basic_os=sysv
+                               ;;
+                       mingw64)
+                               basic_machine=x86_64-pc
+                               basic_os=mingw64
+                               ;;
+                       mingw32)
+                               basic_machine=i686-pc
+                               basic_os=mingw32
+                               ;;
+                       mingw32ce)
+                               basic_machine=arm-unknown
+                               basic_os=mingw32ce
+                               ;;
+                       monitor)
+                               basic_machine=m68k-rom68k
+                               basic_os=coff
+                               ;;
+                       morphos)
+                               basic_machine=powerpc-unknown
+                               basic_os=morphos
+                               ;;
+                       moxiebox)
+                               basic_machine=moxie-unknown
+                               basic_os=moxiebox
+                               ;;
+                       msdos)
+                               basic_machine=i386-pc
+                               basic_os=msdos
+                               ;;
+                       msys)
+                               basic_machine=i686-pc
+                               basic_os=msys
+                               ;;
+                       mvs)
+                               basic_machine=i370-ibm
+                               basic_os=mvs
+                               ;;
+                       nacl)
+                               basic_machine=le32-unknown
+                               basic_os=nacl
+                               ;;
+                       ncr3000)
+                               basic_machine=i486-ncr
+                               basic_os=sysv4
+                               ;;
+                       netbsd386)
+                               basic_machine=i386-pc
+                               basic_os=netbsd
+                               ;;
+                       netwinder)
+                               basic_machine=armv4l-rebel
+                               basic_os=linux
+                               ;;
+                       news | news700 | news800 | news900)
+                               basic_machine=m68k-sony
+                               basic_os=newsos
+                               ;;
+                       news1000)
+                               basic_machine=m68030-sony
+                               basic_os=newsos
+                               ;;
+                       necv70)
+                               basic_machine=v70-nec
+                               basic_os=sysv
+                               ;;
+                       nh3000)
+                               basic_machine=m68k-harris
+                               basic_os=cxux
+                               ;;
+                       nh[45]000)
+                               basic_machine=m88k-harris
+                               basic_os=cxux
+                               ;;
+                       nindy960)
+                               basic_machine=i960-intel
+                               basic_os=nindy
+                               ;;
+                       mon960)
+                               basic_machine=i960-intel
+                               basic_os=mon960
+                               ;;
+                       nonstopux)
+                               basic_machine=mips-compaq
+                               basic_os=nonstopux
+                               ;;
+                       os400)
+                               basic_machine=powerpc-ibm
+                               basic_os=os400
+                               ;;
+                       OSE68000 | ose68000)
+                               basic_machine=m68000-ericsson
+                               basic_os=ose
+                               ;;
+                       os68k)
+                               basic_machine=m68k-none
+                               basic_os=os68k
+                               ;;
+                       paragon)
+                               basic_machine=i860-intel
+                               basic_os=osf
+                               ;;
+                       parisc)
+                               basic_machine=hppa-unknown
+                               basic_os=linux
+                               ;;
+                       psp)
+                               basic_machine=mipsallegrexel-sony
+                               basic_os=psp
+                               ;;
+                       pw32)
+                               basic_machine=i586-unknown
+                               basic_os=pw32
+                               ;;
+                       rdos | rdos64)
+                               basic_machine=x86_64-pc
+                               basic_os=rdos
+                               ;;
+                       rdos32)
+                               basic_machine=i386-pc
+                               basic_os=rdos
+                               ;;
+                       rom68k)
+                               basic_machine=m68k-rom68k
+                               basic_os=coff
+                               ;;
+                       sa29200)
+                               basic_machine=a29k-amd
+                               basic_os=udi
+                               ;;
+                       sei)
+                               basic_machine=mips-sei
+                               basic_os=seiux
+                               ;;
+                       sequent)
+                               basic_machine=i386-sequent
+                               basic_os=
+                               ;;
+                       sps7)
+                               basic_machine=m68k-bull
+                               basic_os=sysv2
+                               ;;
+                       st2000)
+                               basic_machine=m68k-tandem
+                               basic_os=
+                               ;;
+                       stratus)
+                               basic_machine=i860-stratus
+                               basic_os=sysv4
+                               ;;
+                       sun2)
+                               basic_machine=m68000-sun
+                               basic_os=
+                               ;;
+                       sun2os3)
+                               basic_machine=m68000-sun
+                               basic_os=sunos3
+                               ;;
+                       sun2os4)
+                               basic_machine=m68000-sun
+                               basic_os=sunos4
+                               ;;
+                       sun3)
+                               basic_machine=m68k-sun
+                               basic_os=
+                               ;;
+                       sun3os3)
+                               basic_machine=m68k-sun
+                               basic_os=sunos3
+                               ;;
+                       sun3os4)
+                               basic_machine=m68k-sun
+                               basic_os=sunos4
+                               ;;
+                       sun4)
+                               basic_machine=sparc-sun
+                               basic_os=
+                               ;;
+                       sun4os3)
+                               basic_machine=sparc-sun
+                               basic_os=sunos3
+                               ;;
+                       sun4os4)
+                               basic_machine=sparc-sun
+                               basic_os=sunos4
+                               ;;
+                       sun4sol2)
+                               basic_machine=sparc-sun
+                               basic_os=solaris2
+                               ;;
+                       sun386 | sun386i | roadrunner)
+                               basic_machine=i386-sun
+                               basic_os=
+                               ;;
+                       sv1)
+                               basic_machine=sv1-cray
+                               basic_os=unicos
+                               ;;
+                       symmetry)
+                               basic_machine=i386-sequent
+                               basic_os=dynix
+                               ;;
+                       t3e)
+                               basic_machine=alphaev5-cray
+                               basic_os=unicos
+                               ;;
+                       t90)
+                               basic_machine=t90-cray
+                               basic_os=unicos
+                               ;;
+                       toad1)
+                               basic_machine=pdp10-xkl
+                               basic_os=tops20
+                               ;;
+                       tpf)
+                               basic_machine=s390x-ibm
+                               basic_os=tpf
+                               ;;
+                       udi29k)
+                               basic_machine=a29k-amd
+                               basic_os=udi
+                               ;;
+                       ultra3)
+                               basic_machine=a29k-nyu
+                               basic_os=sym1
+                               ;;
+                       v810 | necv810)
+                               basic_machine=v810-nec
+                               basic_os=none
+                               ;;
+                       vaxv)
+                               basic_machine=vax-dec
+                               basic_os=sysv
+                               ;;
+                       vms)
+                               basic_machine=vax-dec
+                               basic_os=vms
+                               ;;
+                       vsta)
+                               basic_machine=i386-pc
+                               basic_os=vsta
+                               ;;
+                       vxworks960)
+                               basic_machine=i960-wrs
+                               basic_os=vxworks
+                               ;;
+                       vxworks68)
+                               basic_machine=m68k-wrs
+                               basic_os=vxworks
+                               ;;
+                       vxworks29k)
+                               basic_machine=a29k-wrs
+                               basic_os=vxworks
+                               ;;
+                       xbox)
+                               basic_machine=i686-pc
+                               basic_os=mingw32
+                               ;;
+                       ymp)
+                               basic_machine=ymp-cray
+                               basic_os=unicos
+                               ;;
+                       *)
+                               basic_machine=$1
+                               basic_os=
+                               ;;
+               esac
                ;;
 esac
 
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
 case $basic_machine in
-       # Recognize the basic CPU types without company name.
-       # Some are omitted here because they have special meanings below.
-       1750a | 580 \
-       | a29k \
-       | aarch64 | aarch64_be \
-       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
-       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
-       | am33_2.0 \
-       | arc | arceb \
-       | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
-       | avr | avr32 \
-       | ba \
-       | be32 | be64 \
-       | bfin \
-       | c4x | c8051 | clipper \
-       | d10v | d30v | dlx | dsp16xx \
-       | e2k | epiphany \
-       | fido | fr30 | frv | ft32 \
-       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
-       | hexagon \
-       | i370 | i860 | i960 | ia64 \
-       | ip2k | iq2000 \
-       | k1om \
-       | le32 | le64 \
-       | lm32 \
-       | m32c | m32r | m32rle | m68000 | m68k | m88k \
-       | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
-       | mips | mipsbe | mipseb | mipsel | mipsle \
-       | mips16 \
-       | mips64 | mips64el \
-       | mips64octeon | mips64octeonel \
-       | mips64orion | mips64orionel \
-       | mips64r5900 | mips64r5900el \
-       | mips64vr | mips64vrel \
-       | mips64vr4100 | mips64vr4100el \
-       | mips64vr4300 | mips64vr4300el \
-       | mips64vr5000 | mips64vr5000el \
-       | mips64vr5900 | mips64vr5900el \
-       | mipsisa32 | mipsisa32el \
-       | mipsisa32r2 | mipsisa32r2el \
-       | mipsisa32r6 | mipsisa32r6el \
-       | mipsisa64 | mipsisa64el \
-       | mipsisa64r2 | mipsisa64r2el \
-       | mipsisa64r6 | mipsisa64r6el \
-       | mipsisa64sb1 | mipsisa64sb1el \
-       | mipsisa64sr71k | mipsisa64sr71kel \
-       | mipsr5900 | mipsr5900el \
-       | mipstx39 | mipstx39el \
-       | mn10200 | mn10300 \
-       | moxie \
-       | mt \
-       | msp430 \
-       | nds32 | nds32le | nds32be \
-       | nios | nios2 | nios2eb | nios2el \
-       | ns16k | ns32k \
-       | open8 | or1k | or1knd | or32 \
-       | pdp10 | pdp11 | pj | pjl \
-       | powerpc | powerpc64 | powerpc64le | powerpcle \
-       | pru \
-       | pyramid \
-       | riscv32 | riscv64 \
-       | rl78 | rx \
-       | score \
-       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
-       | sh64 | sh64le \
-       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
-       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
-       | spu \
-       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
-       | ubicom32 \
-       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
-       | visium \
-       | we32k \
-       | x86 | xc16x | xstormy16 | xtensa \
-       | z8k | z80)
-               basic_machine=$basic_machine-unknown
-               ;;
-       c54x)
-               basic_machine=tic54x-unknown
-               ;;
-       c55x)
-               basic_machine=tic55x-unknown
-               ;;
-       c6x)
-               basic_machine=tic6x-unknown
-               ;;
-       leon|leon[3-9])
-               basic_machine=sparc-$basic_machine
-               ;;
-       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
-               basic_machine=$basic_machine-unknown
-               os=-none
+       # Here we handle the default manufacturer of certain CPU types.  It is in
+       # some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               cpu=hppa1.1
+               vendor=winbond
                ;;
-       m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+       op50n)
+               cpu=hppa1.1
+               vendor=oki
                ;;
-       ms1)
-               basic_machine=mt-unknown
+       op60c)
+               cpu=hppa1.1
+               vendor=oki
                ;;
-
-       strongarm | thumb | xscale)
-               basic_machine=arm-unknown
+       ibm*)
+               cpu=i370
+               vendor=ibm
                ;;
-       xgate)
-               basic_machine=$basic_machine-unknown
-               os=-none
+       orion105)
+               cpu=clipper
+               vendor=highlevel
                ;;
-       xscaleeb)
-               basic_machine=armeb-unknown
+       mac | mpw | mac-mpw)
+               cpu=m68k
+               vendor=apple
                ;;
-
-       xscaleel)
-               basic_machine=armel-unknown
+       pmac | pmac-mpw)
+               cpu=powerpc
+               vendor=apple
                ;;
 
-       # We use `pc' rather than `unknown'
-       # because (1) that's what they normally are, and
-       # (2) the word "unknown" tends to confuse beginning users.
-       i*86 | x86_64)
-         basic_machine=$basic_machine-pc
-         ;;
-       # Object if more than one company name word.
-       *-*-*)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
-               ;;
-       # Recognize the basic CPU types with company name.
-       580-* \
-       | a29k-* \
-       | aarch64-* | aarch64_be-* \
-       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
-       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
-       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
-       | avr-* | avr32-* \
-       | ba-* \
-       | be32-* | be64-* \
-       | bfin-* | bs2000-* \
-       | c[123]* | c30-* | [cjt]90-* | c4x-* \
-       | c8051-* | clipper-* | craynv-* | cydra-* \
-       | d10v-* | d30v-* | dlx-* \
-       | e2k-* | elxsi-* \
-       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
-       | h8300-* | h8500-* \
-       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
-       | hexagon-* \
-       | i*86-* | i860-* | i960-* | ia64-* \
-       | ip2k-* | iq2000-* \
-       | k1om-* \
-       | le32-* | le64-* \
-       | lm32-* \
-       | m32c-* | m32r-* | m32rle-* \
-       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
-       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
-       | microblaze-* | microblazeel-* \
-       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
-       | mips16-* \
-       | mips64-* | mips64el-* \
-       | mips64octeon-* | mips64octeonel-* \
-       | mips64orion-* | mips64orionel-* \
-       | mips64r5900-* | mips64r5900el-* \
-       | mips64vr-* | mips64vrel-* \
-       | mips64vr4100-* | mips64vr4100el-* \
-       | mips64vr4300-* | mips64vr4300el-* \
-       | mips64vr5000-* | mips64vr5000el-* \
-       | mips64vr5900-* | mips64vr5900el-* \
-       | mipsisa32-* | mipsisa32el-* \
-       | mipsisa32r2-* | mipsisa32r2el-* \
-       | mipsisa32r6-* | mipsisa32r6el-* \
-       | mipsisa64-* | mipsisa64el-* \
-       | mipsisa64r2-* | mipsisa64r2el-* \
-       | mipsisa64r6-* | mipsisa64r6el-* \
-       | mipsisa64sb1-* | mipsisa64sb1el-* \
-       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
-       | mipsr5900-* | mipsr5900el-* \
-       | mipstx39-* | mipstx39el-* \
-       | mmix-* \
-       | mt-* \
-       | msp430-* \
-       | nds32-* | nds32le-* | nds32be-* \
-       | nios-* | nios2-* | nios2eb-* | nios2el-* \
-       | none-* | np1-* | ns16k-* | ns32k-* \
-       | open8-* \
-       | or1k*-* \
-       | orion-* \
-       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
-       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
-       | pru-* \
-       | pyramid-* \
-       | riscv32-* | riscv64-* \
-       | rl78-* | romp-* | rs6000-* | rx-* \
-       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
-       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
-       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
-       | sparclite-* \
-       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
-       | tahoe-* \
-       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
-       | tile*-* \
-       | tron-* \
-       | ubicom32-* \
-       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
-       | vax-* \
-       | visium-* \
-       | we32k-* \
-       | x86-* | x86_64-* | xc16x-* | xps100-* \
-       | xstormy16-* | xtensa*-* \
-       | ymp-* \
-       | z8k-* | z80-*)
-               ;;
-       # Recognize the basic CPU types without company name, with glob match.
-       xtensa*)
-               basic_machine=$basic_machine-unknown
-               ;;
        # Recognize the various machine names and aliases which stand
        # for a CPU type and a company and sometimes even an OS.
-       386bsd)
-               basic_machine=i386-unknown
-               os=-bsd
-               ;;
        3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
-               basic_machine=m68000-att
+               cpu=m68000
+               vendor=att
                ;;
        3b*)
-               basic_machine=we32k-att
-               ;;
-       a29khif)
-               basic_machine=a29k-amd
-               os=-udi
-               ;;
-       abacus)
-               basic_machine=abacus-unknown
-               ;;
-       adobe68k)
-               basic_machine=m68010-adobe
-               os=-scout
-               ;;
-       alliant | fx80)
-               basic_machine=fx80-alliant
-               ;;
-       altos | altos3068)
-               basic_machine=m68k-altos
-               ;;
-       am29k)
-               basic_machine=a29k-none
-               os=-bsd
-               ;;
-       amd64)
-               basic_machine=x86_64-pc
-               ;;
-       amd64-*)
-               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       amdahl)
-               basic_machine=580-amdahl
-               os=-sysv
-               ;;
-       amiga | amiga-*)
-               basic_machine=m68k-unknown
-               ;;
-       amigaos | amigados)
-               basic_machine=m68k-unknown
-               os=-amigaos
-               ;;
-       amigaunix | amix)
-               basic_machine=m68k-unknown
-               os=-sysv4
-               ;;
-       apollo68)
-               basic_machine=m68k-apollo
-               os=-sysv
-               ;;
-       apollo68bsd)
-               basic_machine=m68k-apollo
-               os=-bsd
-               ;;
-       aros)
-               basic_machine=i386-pc
-               os=-aros
-               ;;
-       asmjs)
-               basic_machine=asmjs-unknown
-               ;;
-       aux)
-               basic_machine=m68k-apple
-               os=-aux
-               ;;
-       balance)
-               basic_machine=ns32k-sequent
-               os=-dynix
-               ;;
-       blackfin)
-               basic_machine=bfin-unknown
-               os=-linux
-               ;;
-       blackfin-*)
-               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=-linux
+               cpu=we32k
+               vendor=att
                ;;
        bluegene*)
-               basic_machine=powerpc-ibm
-               os=-cnk
-               ;;
-       c54x-*)
-               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       c55x-*)
-               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       c6x-*)
-               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       c90)
-               basic_machine=c90-cray
-               os=-unicos
-               ;;
-       cegcc)
-               basic_machine=arm-unknown
-               os=-cegcc
-               ;;
-       convex-c1)
-               basic_machine=c1-convex
-               os=-bsd
-               ;;
-       convex-c2)
-               basic_machine=c2-convex
-               os=-bsd
-               ;;
-       convex-c32)
-               basic_machine=c32-convex
-               os=-bsd
-               ;;
-       convex-c34)
-               basic_machine=c34-convex
-               os=-bsd
-               ;;
-       convex-c38)
-               basic_machine=c38-convex
-               os=-bsd
-               ;;
-       cray | j90)
-               basic_machine=j90-cray
-               os=-unicos
-               ;;
-       craynv)
-               basic_machine=craynv-cray
-               os=-unicosmp
-               ;;
-       cr16 | cr16-*)
-               basic_machine=cr16-unknown
-               os=-elf
-               ;;
-       crds | unos)
-               basic_machine=m68k-crds
-               ;;
-       crisv32 | crisv32-* | etraxfs*)
-               basic_machine=crisv32-axis
-               ;;
-       cris | cris-* | etrax*)
-               basic_machine=cris-axis
-               ;;
-       crx)
-               basic_machine=crx-unknown
-               os=-elf
-               ;;
-       da30 | da30-*)
-               basic_machine=m68k-da30
-               ;;
-       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
-               basic_machine=mips-dec
+               cpu=powerpc
+               vendor=ibm
+               basic_os=cnk
                ;;
        decsystem10* | dec10*)
-               basic_machine=pdp10-dec
-               os=-tops10
+               cpu=pdp10
+               vendor=dec
+               basic_os=tops10
                ;;
        decsystem20* | dec20*)
-               basic_machine=pdp10-dec
-               os=-tops20
+               cpu=pdp10
+               vendor=dec
+               basic_os=tops20
                ;;
        delta | 3300 | motorola-3300 | motorola-delta \
              | 3300-motorola | delta-motorola)
-               basic_machine=m68k-motorola
-               ;;
-       delta88)
-               basic_machine=m88k-motorola
-               os=-sysv3
-               ;;
-       dicos)
-               basic_machine=i686-pc
-               os=-dicos
-               ;;
-       djgpp)
-               basic_machine=i586-pc
-               os=-msdosdjgpp
-               ;;
-       dpx20 | dpx20-*)
-               basic_machine=rs6000-bull
-               os=-bosx
+               cpu=m68k
+               vendor=motorola
                ;;
-       dpx2* | dpx2*-bull)
-               basic_machine=m68k-bull
-               os=-sysv3
-               ;;
-       e500v[12])
-               basic_machine=powerpc-unknown
-               os=$os"spe"
-               ;;
-       e500v[12]-*)
-               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=$os"spe"
-               ;;
-       ebmon29k)
-               basic_machine=a29k-amd
-               os=-ebmon
-               ;;
-       elxsi)
-               basic_machine=elxsi-elxsi
-               os=-bsd
+       dpx2*)
+               cpu=m68k
+               vendor=bull
+               basic_os=sysv3
                ;;
        encore | umax | mmax)
-               basic_machine=ns32k-encore
+               cpu=ns32k
+               vendor=encore
                ;;
-       es1800 | OSE68k | ose68k | ose | OSE)
-               basic_machine=m68k-ericsson
-               os=-ose
+       elxsi)
+               cpu=elxsi
+               vendor=elxsi
+               basic_os=${basic_os:-bsd}
                ;;
        fx2800)
-               basic_machine=i860-alliant
+               cpu=i860
+               vendor=alliant
                ;;
        genix)
-               basic_machine=ns32k-ns
-               ;;
-       gmicro)
-               basic_machine=tron-gmicro
-               os=-sysv
-               ;;
-       go32)
-               basic_machine=i386-pc
-               os=-go32
+               cpu=ns32k
+               vendor=ns
                ;;
        h3050r* | hiux*)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       h8300hms)
-               basic_machine=h8300-hitachi
-               os=-hms
-               ;;
-       h8300xray)
-               basic_machine=h8300-hitachi
-               os=-xray
-               ;;
-       h8500hms)
-               basic_machine=h8500-hitachi
-               os=-hms
-               ;;
-       harris)
-               basic_machine=m88k-harris
-               os=-sysv3
-               ;;
-       hp300-*)
-               basic_machine=m68k-hp
-               ;;
-       hp300bsd)
-               basic_machine=m68k-hp
-               os=-bsd
-               ;;
-       hp300hpux)
-               basic_machine=m68k-hp
-               os=-hpux
+               cpu=hppa1.1
+               vendor=hitachi
+               basic_os=hiuxwe2
                ;;
        hp3k9[0-9][0-9] | hp9[0-9][0-9])
-               basic_machine=hppa1.0-hp
+               cpu=hppa1.0
+               vendor=hp
                ;;
        hp9k2[0-9][0-9] | hp9k31[0-9])
-               basic_machine=m68000-hp
+               cpu=m68000
+               vendor=hp
                ;;
        hp9k3[2-9][0-9])
-               basic_machine=m68k-hp
+               cpu=m68k
+               vendor=hp
                ;;
        hp9k6[0-9][0-9] | hp6[0-9][0-9])
-               basic_machine=hppa1.0-hp
+               cpu=hppa1.0
+               vendor=hp
                ;;
        hp9k7[0-79][0-9] | hp7[0-79][0-9])
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k78[0-9] | hp78[0-9])
                # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
                # FIXME: really hppa2.0-hp
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[0-9][13679] | hp8[0-9][13679])
-               basic_machine=hppa1.1-hp
+               cpu=hppa1.1
+               vendor=hp
                ;;
        hp9k8[0-9][0-9] | hp8[0-9][0-9])
-               basic_machine=hppa1.0-hp
-               ;;
-       hppa-next)
-               os=-nextstep3
-               ;;
-       hppaosf)
-               basic_machine=hppa1.1-hp
-               os=-osf
-               ;;
-       hppro)
-               basic_machine=hppa1.1-hp
-               os=-proelf
-               ;;
-       i370-ibm* | ibm*)
-               basic_machine=i370-ibm
+               cpu=hppa1.0
+               vendor=hp
                ;;
        i*86v32)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv32
+               cpu=$(echo "$1" | sed -e 's/86.*/86/')
+               vendor=pc
+               basic_os=sysv32
                ;;
        i*86v4*)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv4
+               cpu=$(echo "$1" | sed -e 's/86.*/86/')
+               vendor=pc
+               basic_os=sysv4
                ;;
        i*86v)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-sysv
+               cpu=$(echo "$1" | sed -e 's/86.*/86/')
+               vendor=pc
+               basic_os=sysv
                ;;
        i*86sol2)
-               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
-               os=-solaris2
-               ;;
-       i386mach)
-               basic_machine=i386-mach
-               os=-mach
+               cpu=$(echo "$1" | sed -e 's/86.*/86/')
+               vendor=pc
+               basic_os=solaris2
                ;;
-       i386-vsta | vsta)
-               basic_machine=i386-unknown
-               os=-vsta
+       j90 | j90-cray)
+               cpu=j90
+               vendor=cray
+               basic_os=${basic_os:-unicos}
                ;;
        iris | iris4d)
-               basic_machine=mips-sgi
-               case $os in
-                   -irix*)
+               cpu=mips
+               vendor=sgi
+               case $basic_os in
+                   irix*)
                        ;;
                    *)
-                       os=-irix4
+                       basic_os=irix4
                        ;;
                esac
                ;;
-       isi68 | isi)
-               basic_machine=m68k-isi
-               os=-sysv
-               ;;
-       leon-*|leon[3-9]-*)
-               basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
-               ;;
-       m68knommu)
-               basic_machine=m68k-unknown
-               os=-linux
-               ;;
-       m68knommu-*)
-               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=-linux
-               ;;
-       m88k-omron*)
-               basic_machine=m88k-omron
-               ;;
-       magnum | m3230)
-               basic_machine=mips-mips
-               os=-sysv
-               ;;
-       merlin)
-               basic_machine=ns32k-utek
-               os=-sysv
-               ;;
-       microblaze*)
-               basic_machine=microblaze-xilinx
-               ;;
-       mingw64)
-               basic_machine=x86_64-pc
-               os=-mingw64
-               ;;
-       mingw32)
-               basic_machine=i686-pc
-               os=-mingw32
-               ;;
-       mingw32ce)
-               basic_machine=arm-unknown
-               os=-mingw32ce
-               ;;
        miniframe)
-               basic_machine=m68000-convergent
+               cpu=m68000
+               vendor=convergent
                ;;
-       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
-               basic_machine=m68k-atari
-               os=-mint
-               ;;
-       mips3*-*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
-               ;;
-       mips3*)
-               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
-               ;;
-       monitor)
-               basic_machine=m68k-rom68k
-               os=-coff
-               ;;
-       morphos)
-               basic_machine=powerpc-unknown
-               os=-morphos
-               ;;
-       moxiebox)
-               basic_machine=moxie-unknown
-               os=-moxiebox
-               ;;
-       msdos)
-               basic_machine=i386-pc
-               os=-msdos
-               ;;
-       ms1-*)
-               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
-               ;;
-       msys)
-               basic_machine=i686-pc
-               os=-msys
-               ;;
-       mvs)
-               basic_machine=i370-ibm
-               os=-mvs
-               ;;
-       nacl)
-               basic_machine=le32-unknown
-               os=-nacl
-               ;;
-       ncr3000)
-               basic_machine=i486-ncr
-               os=-sysv4
-               ;;
-       netbsd386)
-               basic_machine=i386-unknown
-               os=-netbsd
-               ;;
-       netwinder)
-               basic_machine=armv4l-rebel
-               os=-linux
-               ;;
-       news | news700 | news800 | news900)
-               basic_machine=m68k-sony
-               os=-newsos
-               ;;
-       news1000)
-               basic_machine=m68030-sony
-               os=-newsos
+       *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               cpu=m68k
+               vendor=atari
+               basic_os=mint
                ;;
        news-3600 | risc-news)
-               basic_machine=mips-sony
-               os=-newsos
-               ;;
-       necv70)
-               basic_machine=v70-nec
-               os=-sysv
-               ;;
-       next | m*-next )
-               basic_machine=m68k-next
-               case $os in
-                   -nextstep* )
+               cpu=mips
+               vendor=sony
+               basic_os=newsos
+               ;;
+       next | m*-next)
+               cpu=m68k
+               vendor=next
+               case $basic_os in
+                   openstep*)
+                       ;;
+                   nextstep*)
                        ;;
-                   -ns2*)
-                     os=-nextstep2
+                   ns2*)
+                     basic_os=nextstep2
                        ;;
                    *)
-                     os=-nextstep3
+                     basic_os=nextstep3
                        ;;
                esac
                ;;
-       nh3000)
-               basic_machine=m68k-harris
-               os=-cxux
-               ;;
-       nh[45]000)
-               basic_machine=m88k-harris
-               os=-cxux
-               ;;
-       nindy960)
-               basic_machine=i960-intel
-               os=-nindy
-               ;;
-       mon960)
-               basic_machine=i960-intel
-               os=-mon960
-               ;;
-       nonstopux)
-               basic_machine=mips-compaq
-               os=-nonstopux
-               ;;
        np1)
-               basic_machine=np1-gould
-               ;;
-       neo-tandem)
-               basic_machine=neo-tandem
-               ;;
-       nse-tandem)
-               basic_machine=nse-tandem
-               ;;
-       nsr-tandem)
-               basic_machine=nsr-tandem
+               cpu=np1
+               vendor=gould
                ;;
        op50n-* | op60c-*)
-               basic_machine=hppa1.1-oki
-               os=-proelf
-               ;;
-       openrisc | openrisc-*)
-               basic_machine=or32-unknown
-               ;;
-       os400)
-               basic_machine=powerpc-ibm
-               os=-os400
-               ;;
-       OSE68000 | ose68000)
-               basic_machine=m68000-ericsson
-               os=-ose
-               ;;
-       os68k)
-               basic_machine=m68k-none
-               os=-os68k
+               cpu=hppa1.1
+               vendor=oki
+               basic_os=proelf
                ;;
        pa-hitachi)
-               basic_machine=hppa1.1-hitachi
-               os=-hiuxwe2
-               ;;
-       paragon)
-               basic_machine=i860-intel
-               os=-osf
-               ;;
-       parisc)
-               basic_machine=hppa-unknown
-               os=-linux
-               ;;
-       parisc-*)
-               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
-               os=-linux
+               cpu=hppa1.1
+               vendor=hitachi
+               basic_os=hiuxwe2
                ;;
        pbd)
-               basic_machine=sparc-tti
+               cpu=sparc
+               vendor=tti
                ;;
        pbb)
-               basic_machine=m68k-tti
-               ;;
-       pc532 | pc532-*)
-               basic_machine=ns32k-pc532
-               ;;
-       pc98)
-               basic_machine=i386-pc
-               ;;
-       pc98-*)
-               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               cpu=m68k
+               vendor=tti
                ;;
-       pentium | p5 | k5 | k6 | nexgen | viac3)
-               basic_machine=i586-pc
-               ;;
-       pentiumpro | p6 | 6x86 | athlon | athlon_*)
-               basic_machine=i686-pc
-               ;;
-       pentiumii | pentium2 | pentiumiii | pentium3)
-               basic_machine=i686-pc
-               ;;
-       pentium4)
-               basic_machine=i786-pc
-               ;;
-       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
-               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentiumpro-* | p6-* | 6x86-* | athlon-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
-               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       pentium4-*)
-               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+       pc532)
+               cpu=ns32k
+               vendor=pc532
                ;;
        pn)
-               basic_machine=pn-gould
-               ;;
-       power)  basic_machine=power-ibm
-               ;;
-       ppc | ppcbe)    basic_machine=powerpc-unknown
-               ;;
-       ppc-* | ppcbe-*)
-               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               cpu=pn
+               vendor=gould
                ;;
-       ppcle | powerpclittle)
-               basic_machine=powerpcle-unknown
-               ;;
-       ppcle-* | powerpclittle-*)
-               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64)  basic_machine=powerpc64-unknown
-               ;;
-       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
-               ;;
-       ppc64le | powerpc64little)
-               basic_machine=powerpc64le-unknown
-               ;;
-       ppc64le-* | powerpc64little-*)
-               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+       power)
+               cpu=power
+               vendor=ibm
                ;;
        ps2)
-               basic_machine=i386-ibm
-               ;;
-       pw32)
-               basic_machine=i586-unknown
-               os=-pw32
-               ;;
-       rdos | rdos64)
-               basic_machine=x86_64-pc
-               os=-rdos
-               ;;
-       rdos32)
-               basic_machine=i386-pc
-               os=-rdos
-               ;;
-       rom68k)
-               basic_machine=m68k-rom68k
-               os=-coff
+               cpu=i386
+               vendor=ibm
                ;;
        rm[46]00)
-               basic_machine=mips-siemens
+               cpu=mips
+               vendor=siemens
                ;;
        rtpc | rtpc-*)
-               basic_machine=romp-ibm
-               ;;
-       s390 | s390-*)
-               basic_machine=s390-ibm
-               ;;
-       s390x | s390x-*)
-               basic_machine=s390x-ibm
-               ;;
-       sa29200)
-               basic_machine=a29k-amd
-               os=-udi
+               cpu=romp
+               vendor=ibm
                ;;
-       sb1)
-               basic_machine=mipsisa64sb1-unknown
+       sde)
+               cpu=mipsisa32
+               vendor=sde
+               basic_os=${basic_os:-elf}
                ;;
-       sb1el)
-               basic_machine=mipsisa64sb1el-unknown
+       simso-wrs)
+               cpu=sparclite
+               vendor=wrs
+               basic_os=vxworks
                ;;
-       sde)
-               basic_machine=mipsisa32-sde
-               os=-elf
+       tower | tower-32)
+               cpu=m68k
+               vendor=ncr
                ;;
-       sei)
-               basic_machine=mips-sei
-               os=-seiux
+       vpp*|vx|vx-*)
+               cpu=f301
+               vendor=fujitsu
                ;;
-       sequent)
-               basic_machine=i386-sequent
+       w65)
+               cpu=w65
+               vendor=wdc
                ;;
-       sh)
-               basic_machine=sh-hitachi
-               os=-hms
+       w89k-*)
+               cpu=hppa1.1
+               vendor=winbond
+               basic_os=proelf
                ;;
-       sh5el)
-               basic_machine=sh5le-unknown
+       none)
+               cpu=none
+               vendor=none
                ;;
-       sh64)
-               basic_machine=sh64-unknown
+       leon|leon[3-9])
+               cpu=sparc
+               vendor=$basic_machine
                ;;
-       sparclite-wrs | simso-wrs)
-               basic_machine=sparclite-wrs
-               os=-vxworks
+       leon-*|leon[3-9]-*)
+               cpu=sparc
+               vendor=$(echo "$basic_machine" | sed 's/-.*//')
                ;;
-       sps7)
-               basic_machine=m68k-bull
-               os=-sysv2
+
+       *-*)
+               # shellcheck disable=SC2162
+               IFS="-" read cpu vendor <<EOF
+$basic_machine
+EOF
                ;;
-       spur)
-               basic_machine=spur-unknown
+       # We use `pc' rather than `unknown'
+       # because (1) that's what they normally are, and
+       # (2) the word "unknown" tends to confuse beginning users.
+       i*86 | x86_64)
+               cpu=$basic_machine
+               vendor=pc
                ;;
-       st2000)
-               basic_machine=m68k-tandem
+       # These rules are duplicated from below for sake of the special case above;
+       # i.e. things that normalized to x86 arches should also default to "pc"
+       pc98)
+               cpu=i386
+               vendor=pc
                ;;
-       stratus)
-               basic_machine=i860-stratus
-               os=-sysv4
+       x64 | amd64)
+               cpu=x86_64
+               vendor=pc
                ;;
-       strongarm-* | thumb-*)
-               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+       # Recognize the basic CPU types without company name.
+       *)
+               cpu=$basic_machine
+               vendor=unknown
                ;;
-       sun2)
-               basic_machine=m68000-sun
+esac
+
+unset -v basic_machine
+
+# Decode basic machines in the full and proper CPU-Company form.
+case $cpu-$vendor in
+       # Here we handle the default manufacturer of certain CPU types in canonical form. It is in
+       # some cases the only manufacturer, in others, it is the most popular.
+       craynv-unknown)
+               vendor=cray
+               basic_os=${basic_os:-unicosmp}
                ;;
-       sun2os3)
-               basic_machine=m68000-sun
-               os=-sunos3
+       c90-unknown | c90-cray)
+               vendor=cray
+               basic_os=${Basic_os:-unicos}
                ;;
-       sun2os4)
-               basic_machine=m68000-sun
-               os=-sunos4
+       fx80-unknown)
+               vendor=alliant
                ;;
-       sun3os3)
-               basic_machine=m68k-sun
-               os=-sunos3
+       romp-unknown)
+               vendor=ibm
                ;;
-       sun3os4)
-               basic_machine=m68k-sun
-               os=-sunos4
+       mmix-unknown)
+               vendor=knuth
                ;;
-       sun4os3)
-               basic_machine=sparc-sun
-               os=-sunos3
+       microblaze-unknown | microblazeel-unknown)
+               vendor=xilinx
                ;;
-       sun4os4)
-               basic_machine=sparc-sun
-               os=-sunos4
+       rs6000-unknown)
+               vendor=ibm
                ;;
-       sun4sol2)
-               basic_machine=sparc-sun
-               os=-solaris2
+       vax-unknown)
+               vendor=dec
                ;;
-       sun3 | sun3-*)
-               basic_machine=m68k-sun
+       pdp11-unknown)
+               vendor=dec
                ;;
-       sun4)
-               basic_machine=sparc-sun
+       we32k-unknown)
+               vendor=att
                ;;
-       sun386 | sun386i | roadrunner)
-               basic_machine=i386-sun
+       cydra-unknown)
+               vendor=cydrome
                ;;
-       sv1)
-               basic_machine=sv1-cray
-               os=-unicos
+       i370-ibm*)
+               vendor=ibm
                ;;
-       symmetry)
-               basic_machine=i386-sequent
-               os=-dynix
+       orion-unknown)
+               vendor=highlevel
                ;;
-       t3e)
-               basic_machine=alphaev5-cray
-               os=-unicos
+       xps-unknown | xps100-unknown)
+               cpu=xps100
+               vendor=honeywell
                ;;
-       t90)
-               basic_machine=t90-cray
-               os=-unicos
+
+       # Here we normalize CPU types with a missing or matching vendor
+       dpx20-unknown | dpx20-bull)
+               cpu=rs6000
+               vendor=bull
+               basic_os=${basic_os:-bosx}
                ;;
-       tile*)
-               basic_machine=$basic_machine-unknown
-               os=-linux-gnu
+
+       # Here we normalize CPU types irrespective of the vendor
+       amd64-*)
+               cpu=x86_64
                ;;
-       tx39)
-               basic_machine=mipstx39-unknown
+       blackfin-*)
+               cpu=bfin
+               basic_os=linux
                ;;
-       tx39el)
-               basic_machine=mipstx39el-unknown
+       c54x-*)
+               cpu=tic54x
                ;;
-       toad1)
-               basic_machine=pdp10-xkl
-               os=-tops20
+       c55x-*)
+               cpu=tic55x
                ;;
-       tower | tower-32)
-               basic_machine=m68k-ncr
+       c6x-*)
+               cpu=tic6x
                ;;
-       tpf)
-               basic_machine=s390x-ibm
-               os=-tpf
+       e500v[12]-*)
+               cpu=powerpc
+               basic_os=${basic_os}"spe"
                ;;
-       udi29k)
-               basic_machine=a29k-amd
-               os=-udi
+       mips3*-*)
+               cpu=mips64
                ;;
-       ultra3)
-               basic_machine=a29k-nyu
-               os=-sym1
+       ms1-*)
+               cpu=mt
                ;;
-       v810 | necv810)
-               basic_machine=v810-nec
-               os=-none
+       m68knommu-*)
+               cpu=m68k
+               basic_os=linux
                ;;
-       vaxv)
-               basic_machine=vax-dec
-               os=-sysv
+       m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
+               cpu=s12z
                ;;
-       vms)
-               basic_machine=vax-dec
-               os=-vms
+       openrisc-*)
+               cpu=or32
                ;;
-       vpp*|vx|vx-*)
-               basic_machine=f301-fujitsu
+       parisc-*)
+               cpu=hppa
+               basic_os=linux
                ;;
-       vxworks960)
-               basic_machine=i960-wrs
-               os=-vxworks
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               cpu=i586
                ;;
-       vxworks68)
-               basic_machine=m68k-wrs
-               os=-vxworks
+       pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+               cpu=i686
                ;;
-       vxworks29k)
-               basic_machine=a29k-wrs
-               os=-vxworks
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               cpu=i686
                ;;
-       w65*)
-               basic_machine=w65-wdc
-               os=-none
+       pentium4-*)
+               cpu=i786
                ;;
-       w89k-*)
-               basic_machine=hppa1.1-winbond
-               os=-proelf
+       pc98-*)
+               cpu=i386
                ;;
-       xbox)
-               basic_machine=i686-pc
-               os=-mingw32
+       ppc-* | ppcbe-*)
+               cpu=powerpc
                ;;
-       xps | xps100)
-               basic_machine=xps100-honeywell
+       ppcle-* | powerpclittle-*)
+               cpu=powerpcle
                ;;
-       xscale-* | xscalee[bl]-*)
-               basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
+       ppc64-*)
+               cpu=powerpc64
                ;;
-       ymp)
-               basic_machine=ymp-cray
-               os=-unicos
+       ppc64le-* | powerpc64little-*)
+               cpu=powerpc64le
                ;;
-       z8k-*-coff)
-               basic_machine=z8k-unknown
-               os=-sim
+       sb1-*)
+               cpu=mipsisa64sb1
                ;;
-       z80-*-coff)
-               basic_machine=z80-unknown
-               os=-sim
+       sb1el-*)
+               cpu=mipsisa64sb1el
                ;;
-       none)
-               basic_machine=none-none
-               os=-none
+       sh5e[lb]-*)
+               cpu=$(echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/')
                ;;
-
-# Here we handle the default manufacturer of certain CPU types.  It is in
-# some cases the only manufacturer, in others, it is the most popular.
-       w89k)
-               basic_machine=hppa1.1-winbond
+       spur-*)
+               cpu=spur
                ;;
-       op50n)
-               basic_machine=hppa1.1-oki
+       strongarm-* | thumb-*)
+               cpu=arm
                ;;
-       op60c)
-               basic_machine=hppa1.1-oki
+       tx39-*)
+               cpu=mipstx39
                ;;
-       romp)
-               basic_machine=romp-ibm
+       tx39el-*)
+               cpu=mipstx39el
                ;;
-       mmix)
-               basic_machine=mmix-knuth
+       x64-*)
+               cpu=x86_64
                ;;
-       rs6000)
-               basic_machine=rs6000-ibm
+       xscale-* | xscalee[bl]-*)
+               cpu=$(echo "$cpu" | sed 's/^xscale/arm/')
                ;;
-       vax)
-               basic_machine=vax-dec
+       arm64-*)
+               cpu=aarch64
                ;;
-       pdp10)
-               # there are many clones, so DEC is not a safe bet
-               basic_machine=pdp10-unknown
+
+       # Recognize the canonical CPU Types that limit and/or modify the
+       # company names they are paired with.
+       cr16-*)
+               basic_os=${basic_os:-elf}
                ;;
-       pdp11)
-               basic_machine=pdp11-dec
+       crisv32-* | etraxfs*-*)
+               cpu=crisv32
+               vendor=axis
                ;;
-       we32k)
-               basic_machine=we32k-att
+       cris-* | etrax*-*)
+               cpu=cris
+               vendor=axis
                ;;
-       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
-               basic_machine=sh-unknown
+       crx-*)
+               basic_os=${basic_os:-elf}
                ;;
-       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
-               basic_machine=sparc-sun
+       neo-tandem)
+               cpu=neo
+               vendor=tandem
                ;;
-       cydra)
-               basic_machine=cydra-cydrome
+       nse-tandem)
+               cpu=nse
+               vendor=tandem
                ;;
-       orion)
-               basic_machine=orion-highlevel
+       nsr-tandem)
+               cpu=nsr
+               vendor=tandem
                ;;
-       orion105)
-               basic_machine=clipper-highlevel
+       nsv-tandem)
+               cpu=nsv
+               vendor=tandem
                ;;
-       mac | mpw | mac-mpw)
-               basic_machine=m68k-apple
+       nsx-tandem)
+               cpu=nsx
+               vendor=tandem
                ;;
-       pmac | pmac-mpw)
-               basic_machine=powerpc-apple
+       mipsallegrexel-sony)
+               cpu=mipsallegrexel
+               vendor=sony
                ;;
-       *-unknown)
-               # Make sure to match an already-canonicalized machine name.
+       tile*-*)
+               basic_os=${basic_os:-linux-gnu}
                ;;
+
        *)
-               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
-               exit 1
+               # Recognize the canonical CPU types that are allowed with any
+               # company name.
+               case $cpu in
+                       1750a | 580 \
+                       | a29k \
+                       | aarch64 | aarch64_be \
+                       | abacus \
+                       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+                       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+                       | alphapca5[67] | alpha64pca5[67] \
+                       | am33_2.0 \
+                       | amdgcn \
+                       | arc | arceb | arc64 \
+                       | arm | arm[lb]e | arme[lb] | armv* \
+                       | avr | avr32 \
+                       | asmjs \
+                       | ba \
+                       | be32 | be64 \
+                       | bfin | bpf | bs2000 \
+                       | c[123]* | c30 | [cjt]90 | c4x \
+                       | c8051 | clipper | craynv | csky | cydra \
+                       | d10v | d30v | dlx | dsp16xx \
+                       | e2k | elxsi | epiphany \
+                       | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+                       | h8300 | h8500 \
+                       | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+                       | hexagon \
+                       | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+                       | ip2k | iq2000 \
+                       | k1om \
+                       | le32 | le64 \
+                       | lm32 \
+                       | loongarch32 | loongarch64 | loongarchx32 \
+                       | m32c | m32r | m32rle \
+                       | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+                       | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+                       | m88110 | m88k | maxq | mb | mcore | mep | metag \
+                       | microblaze | microblazeel \
+                       | mips | mipsbe | mipseb | mipsel | mipsle \
+                       | mips16 \
+                       | mips64 | mips64eb | mips64el \
+                       | mips64octeon | mips64octeonel \
+                       | mips64orion | mips64orionel \
+                       | mips64r5900 | mips64r5900el \
+                       | mips64vr | mips64vrel \
+                       | mips64vr4100 | mips64vr4100el \
+                       | mips64vr4300 | mips64vr4300el \
+                       | mips64vr5000 | mips64vr5000el \
+                       | mips64vr5900 | mips64vr5900el \
+                       | mipsisa32 | mipsisa32el \
+                       | mipsisa32r2 | mipsisa32r2el \
+                       | mipsisa32r3 | mipsisa32r3el \
+                       | mipsisa32r5 | mipsisa32r5el \
+                       | mipsisa32r6 | mipsisa32r6el \
+                       | mipsisa64 | mipsisa64el \
+                       | mipsisa64r2 | mipsisa64r2el \
+                       | mipsisa64r3 | mipsisa64r3el \
+                       | mipsisa64r5 | mipsisa64r5el \
+                       | mipsisa64r6 | mipsisa64r6el \
+                       | mipsisa64sb1 | mipsisa64sb1el \
+                       | mipsisa64sr71k | mipsisa64sr71kel \
+                       | mipsr5900 | mipsr5900el \
+                       | mipstx39 | mipstx39el \
+                       | mmix \
+                       | mn10200 | mn10300 \
+                       | moxie \
+                       | mt \
+                       | msp430 \
+                       | nds32 | nds32le | nds32be \
+                       | nfp \
+                       | nios | nios2 | nios2eb | nios2el \
+                       | none | np1 | ns16k | ns32k | nvptx \
+                       | open8 \
+                       | or1k* \
+                       | or32 \
+                       | orion \
+                       | picochip \
+                       | pdp10 | pdp11 | pj | pjl | pn | power \
+                       | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+                       | pru \
+                       | pyramid \
+                       | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
+                       | rl78 | romp | rs6000 | rx \
+                       | s390 | s390x \
+                       | score \
+                       | sh | shl \
+                       | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+                       | sh[1234]e[lb] |  sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+                       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+                       | sparclite \
+                       | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+                       | spu \
+                       | tahoe \
+                       | thumbv7* \
+                       | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+                       | tron \
+                       | ubicom32 \
+                       | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+                       | vax \
+                       | visium \
+                       | w65 \
+                       | wasm32 | wasm64 \
+                       | we32k \
+                       | x86 | x86_64 | xc16x | xgate | xps100 \
+                       | xstormy16 | xtensa* \
+                       | ymp \
+                       | z8k | z80)
+                               ;;
+
+                       *)
+                               echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+                               exit 1
+                               ;;
+               esac
                ;;
 esac
 
 # Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
-       *-digital*)
-               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+       digital*)
+               vendor=dec
                ;;
-       *-commodore*)
-               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+       commodore*)
+               vendor=cbm
                ;;
        *)
                ;;
@@ -1355,203 +1284,213 @@ esac
 
 # Decode manufacturer-specific aliases for certain operating systems.
 
-if [ x"$os" != x"" ]
+if test x$basic_os != x
 then
-case $os in
-       # First match some system type aliases
-       # that might get confused with valid system types.
-       # -solaris* is a basic system type, with this one exception.
-       -auroraux)
-               os=-auroraux
+
+# First recognize some ad-hoc caes, or perhaps split kernel-os, or else just
+# set os.
+case $basic_os in
+       gnu/linux*)
+               kernel=linux
+               os=$(echo $basic_os | sed -e 's|gnu/linux|gnu|')
+               ;;
+       os2-emx)
+               kernel=os2
+               os=$(echo $basic_os | sed -e 's|os2-emx|emx|')
+               ;;
+       nto-qnx*)
+               kernel=nto
+               os=$(echo $basic_os | sed -e 's|nto-qnx|qnx|')
+               ;;
+       *-*)
+               # shellcheck disable=SC2162
+               IFS="-" read kernel os <<EOF
+$basic_os
+EOF
+               ;;
+       # Default OS when just kernel was specified
+       nto*)
+               kernel=nto
+               os=$(echo $basic_os | sed -e 's|nto|qnx|')
+               ;;
+       linux*)
+               kernel=linux
+               os=$(echo $basic_os | sed -e 's|linux|gnu|')
                ;;
-       -solaris1 | -solaris1.*)
-               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+       *)
+               kernel=
+               os=$basic_os
+               ;;
+esac
+
+# Now, normalize the OS (knowing we just have one component, it's not a kernel,
+# etc.)
+case $os in
+       # First match some system type aliases that might get confused
+       # with valid system types.
+       # solaris* is a basic system type, with this one exception.
+       auroraux)
+               os=auroraux
                ;;
-       -solaris)
-               os=-solaris2
+       bluegene*)
+               os=cnk
                ;;
-       -svr4*)
-               os=-sysv4
+       solaris1 | solaris1.*)
+               os=$(echo $os | sed -e 's|solaris1|sunos4|')
                ;;
-       -unixware*)
-               os=-sysv4.2uw
+       solaris)
+               os=solaris2
                ;;
-       -gnu/linux*)
-               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+       unixware*)
+               os=sysv4.2uw
                ;;
-       # First accept the basic system types.
-       # The portable systems comes first.
-       # Each alternative MUST END IN A *, to match a version number.
-       # -sysv* is not here because it comes later, after sysvr4.
-       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
-             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
-             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-             | -sym* | -kopensolaris* | -plan9* \
-             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
-             | -aos* | -aros* | -cloudabi* | -sortix* \
-             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
-             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
-             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
-             | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
-             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
-             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
-             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
-             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
-             | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
-             | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
-             | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
-             | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-             | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
-             | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
-             | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
-             | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
-             | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
-             | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
-             | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
-             | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
-       # Remember, each alternative MUST END IN *, to match a version number.
-               ;;
-       -qnx*)
-               case $basic_machine in
-                   x86-* | i*86-*)
-                       ;;
-                   *)
-                       os=-nto$os
-                       ;;
-               esac
+       # es1800 is here to avoid being matched by es* (a different OS)
+       es1800*)
+               os=ose
                ;;
-       -nto-qnx*)
+       # Some version numbers need modification
+       chorusos*)
+               os=chorusos
                ;;
-       -nto*)
-               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+       isc)
+               os=isc2.2
                ;;
-       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
-             | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
-             | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+       sco6)
+               os=sco5v6
                ;;
-       -mac*)
-               os=`echo $os | sed -e 's|mac|macos|'`
+       sco5)
+               os=sco3.2v5
                ;;
-       -linux-dietlibc)
-               os=-linux-dietlibc
+       sco4)
+               os=sco3.2v4
                ;;
-       -linux*)
-               os=`echo $os | sed -e 's|linux|linux-gnu|'`
+       sco3.2.[4-9]*)
+               os=$(echo $os | sed -e 's/sco3.2./sco3.2v/')
                ;;
-       -sunos5*)
-               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+       sco*v* | scout)
+               # Don't match below
                ;;
-       -sunos6*)
-               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+       sco*)
+               os=sco3.2v2
                ;;
-       -opened*)
-               os=-openedition
+       psos*)
+               os=psos
                ;;
-       -os400*)
-               os=-os400
+       qnx*)
+               os=qnx
                ;;
-       -wince*)
-               os=-wince
+       hiux*)
+               os=hiuxwe2
                ;;
-       -osfrose*)
-               os=-osfrose
+       lynx*178)
+               os=lynxos178
                ;;
-       -osf*)
-               os=-osf
+       lynx*5)
+               os=lynxos5
                ;;
-       -utek*)
-               os=-bsd
+       lynxos*)
+               # don't get caught up in next wildcard
                ;;
-       -dynix*)
-               os=-bsd
+       lynx*)
+               os=lynxos
                ;;
-       -acis*)
-               os=-aos
+       mac[0-9]*)
+               os=$(echo "$os" | sed -e 's|mac|macos|')
                ;;
-       -atheos*)
-               os=-atheos
+       opened*)
+               os=openedition
                ;;
-       -syllable*)
-               os=-syllable
+       os400*)
+               os=os400
                ;;
-       -386bsd)
-               os=-bsd
+       sunos5*)
+               os=$(echo "$os" | sed -e 's|sunos5|solaris2|')
                ;;
-       -ctix* | -uts*)
-               os=-sysv
+       sunos6*)
+               os=$(echo "$os" | sed -e 's|sunos6|solaris3|')
                ;;
-       -nova*)
-               os=-rtmk-nova
+       wince*)
+               os=wince
                ;;
-       -ns2 )
-               os=-nextstep2
+       utek*)
+               os=bsd
                ;;
-       -nsk*)
-               os=-nsk
+       dynix*)
+               os=bsd
                ;;
-       # Preserve the version number of sinix5.
-       -sinix5.*)
-               os=`echo $os | sed -e 's|sinix|sysv|'`
+       acis*)
+               os=aos
                ;;
-       -sinix*)
-               os=-sysv4
+       atheos*)
+               os=atheos
                ;;
-       -tpf*)
-               os=-tpf
+       syllable*)
+               os=syllable
                ;;
-       -triton*)
-               os=-sysv3
+       386bsd)
+               os=bsd
                ;;
-       -oss*)
-               os=-sysv3
+       ctix* | uts*)
+               os=sysv
                ;;
-       -svr4)
-               os=-sysv4
+       nova*)
+               os=rtmk-nova
                ;;
-       -svr3)
-               os=-sysv3
+       ns2)
+               os=nextstep2
                ;;
-       -sysvr4)
-               os=-sysv4
+       # Preserve the version number of sinix5.
+       sinix5.*)
+               os=$(echo $os | sed -e 's|sinix|sysv|')
                ;;
-       # This must come after -sysvr4.
-       -sysv*)
+       sinix*)
+               os=sysv4
                ;;
-       -ose*)
-               os=-ose
+       tpf*)
+               os=tpf
                ;;
-       -es1800*)
-               os=-ose
+       triton*)
+               os=sysv3
                ;;
-       -xenix)
-               os=-xenix
+       oss*)
+               os=sysv3
                ;;
-       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
-               os=-mint
+       svr4*)
+               os=sysv4
                ;;
-       -aros*)
-               os=-aros
+       svr3)
+               os=sysv3
                ;;
-       -zvmoe)
-               os=-zvmoe
+       sysvr4)
+               os=sysv4
                ;;
-       -dicos*)
-               os=-dicos
+       ose*)
+               os=ose
                ;;
-       -nacl*)
+       *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+               os=mint
                ;;
-       -ios)
+       dicos*)
+               os=dicos
                ;;
-       -none)
+       pikeos*)
+               # Until real need of OS specific support for
+               # particular features comes up, bare metal
+               # configurations are quite functional.
+               case $cpu in
+                   arm*)
+                       os=eabi
+                       ;;
+                   *)
+                       os=elf
+                       ;;
+               esac
                ;;
        *)
-               # Get rid of the `-' at the beginning of $os.
-               os=`echo $os | sed 's/[^-]*-//'`
-               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
-               exit 1
+               # No normalization, but not necessarily accepted, that comes below.
                ;;
 esac
+
 else
 
 # Here we handle the default operating systems that come with various machines.
@@ -1564,264 +1503,361 @@ else
 # will signal an error saying that MANUFACTURER isn't an operating
 # system, and we'll never get to this point.
 
-case $basic_machine in
+kernel=
+case $cpu-$vendor in
        score-*)
-               os=-elf
+               os=elf
                ;;
        spu-*)
-               os=-elf
+               os=elf
                ;;
        *-acorn)
-               os=-riscix1.2
+               os=riscix1.2
                ;;
        arm*-rebel)
-               os=-linux
+               kernel=linux
+               os=gnu
                ;;
        arm*-semi)
-               os=-aout
+               os=aout
                ;;
        c4x-* | tic4x-*)
-               os=-coff
+               os=coff
                ;;
        c8051-*)
-               os=-elf
+               os=elf
+               ;;
+       clipper-intergraph)
+               os=clix
                ;;
        hexagon-*)
-               os=-elf
+               os=elf
                ;;
        tic54x-*)
-               os=-coff
+               os=coff
                ;;
        tic55x-*)
-               os=-coff
+               os=coff
                ;;
        tic6x-*)
-               os=-coff
+               os=coff
                ;;
        # This must come before the *-dec entry.
        pdp10-*)
-               os=-tops20
+               os=tops20
                ;;
        pdp11-*)
-               os=-none
+               os=none
                ;;
        *-dec | vax-*)
-               os=-ultrix4.2
+               os=ultrix4.2
                ;;
        m68*-apollo)
-               os=-domain
+               os=domain
                ;;
        i386-sun)
-               os=-sunos4.0.2
+               os=sunos4.0.2
                ;;
        m68000-sun)
-               os=-sunos3
+               os=sunos3
                ;;
        m68*-cisco)
-               os=-aout
+               os=aout
                ;;
        mep-*)
-               os=-elf
+               os=elf
                ;;
        mips*-cisco)
-               os=-elf
+               os=elf
                ;;
        mips*-*)
-               os=-elf
+               os=elf
                ;;
        or32-*)
-               os=-coff
+               os=coff
                ;;
        *-tti)  # must be before sparc entry or we get the wrong os.
-               os=-sysv3
+               os=sysv3
                ;;
        sparc-* | *-sun)
-               os=-sunos4.1.1
+               os=sunos4.1.1
                ;;
        pru-*)
-               os=-elf
+               os=elf
                ;;
        *-be)
-               os=-beos
-               ;;
-       *-haiku)
-               os=-haiku
+               os=beos
                ;;
        *-ibm)
-               os=-aix
+               os=aix
                ;;
        *-knuth)
-               os=-mmixware
+               os=mmixware
                ;;
        *-wec)
-               os=-proelf
+               os=proelf
                ;;
        *-winbond)
-               os=-proelf
+               os=proelf
                ;;
        *-oki)
-               os=-proelf
+               os=proelf
                ;;
        *-hp)
-               os=-hpux
+               os=hpux
                ;;
        *-hitachi)
-               os=-hiux
+               os=hiux
                ;;
        i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
-               os=-sysv
+               os=sysv
                ;;
        *-cbm)
-               os=-amigaos
+               os=amigaos
                ;;
        *-dg)
-               os=-dgux
+               os=dgux
                ;;
        *-dolphin)
-               os=-sysv3
+               os=sysv3
                ;;
        m68k-ccur)
-               os=-rtu
+               os=rtu
                ;;
        m88k-omron*)
-               os=-luna
+               os=luna
                ;;
-       *-next )
-               os=-nextstep
+       *-next)
+               os=nextstep
                ;;
        *-sequent)
-               os=-ptx
+               os=ptx
                ;;
        *-crds)
-               os=-unos
+               os=unos
                ;;
        *-ns)
-               os=-genix
+               os=genix
                ;;
        i370-*)
-               os=-mvs
-               ;;
-       *-next)
-               os=-nextstep3
+               os=mvs
                ;;
        *-gould)
-               os=-sysv
+               os=sysv
                ;;
        *-highlevel)
-               os=-bsd
+               os=bsd
                ;;
        *-encore)
-               os=-bsd
+               os=bsd
                ;;
        *-sgi)
-               os=-irix
+               os=irix
                ;;
        *-siemens)
-               os=-sysv4
+               os=sysv4
                ;;
        *-masscomp)
-               os=-rtu
+               os=rtu
                ;;
        f30[01]-fujitsu | f700-fujitsu)
-               os=-uxpv
+               os=uxpv
                ;;
        *-rom68k)
-               os=-coff
+               os=coff
                ;;
        *-*bug)
-               os=-coff
+               os=coff
                ;;
        *-apple)
-               os=-macos
+               os=macos
                ;;
        *-atari*)
-               os=-mint
+               os=mint
+               ;;
+       *-wrs)
+               os=vxworks
                ;;
        *)
-               os=-none
+               os=none
                ;;
 esac
+
 fi
 
+# Now, validate our (potentially fixed-up) OS.
+case $os in
+       # Sometimes we do "kernel-libc", so those need to count as OSes.
+       musl* | newlib* | uclibc*)
+               ;;
+       # Likewise for "kernel-abi"
+       eabi* | gnueabi*)
+               ;;
+       # VxWorks passes extra cpu info in the 4th filed.
+       simlinux | simwindows | spe)
+               ;;
+       # Now accept the basic system types.
+       # The portable systems comes first.
+       # Each alternative MUST end in a * to match a version number.
+       gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+            | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
+            | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+            | sym* |  plan9* | psp* | sim* | xray* | os68k* | v88r* \
+            | hiux* | abug | nacl* | netware* | windows* \
+            | os9* | macos* | osx* | ios* \
+            | mpw* | magic* | mmixware* | mon960* | lnews* \
+            | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+            | aos* | aros* | cloudabi* | sortix* | twizzler* \
+            | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+            | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+            | mirbsd* | netbsd* | dicos* | openedition* | ose* \
+            | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
+            | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
+            | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
+            | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
+            | udi* | lites* | ieee* | go32* | aux* | hcos* \
+            | chorusrdb* | cegcc* | glidix* | serenity* \
+            | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
+            | midipix* | mingw32* | mingw64* | mint* \
+            | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+            | interix* | uwin* | mks* | rhapsody* | darwin* \
+            | openstep* | oskit* | conix* | pw32* | nonstopux* \
+            | storm-chaos* | tops10* | tenex* | tops20* | its* \
+            | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
+            | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
+            | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+            | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+            | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+            | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+            | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx*)
+               ;;
+       # This one is extra strict with allowed versions
+       sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               ;;
+       none)
+               ;;
+       *)
+               echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+
+# As a final step for OS-related things, validate the OS-kernel combination
+# (given a valid OS), if there is a kernel.
+case $kernel-$os in
+       linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* | linux-musl* | linux-uclibc* )
+               ;;
+       uclinux-uclibc* )
+               ;;
+       -dietlibc* | -newlib* | -musl* | -uclibc* )
+               # These are just libc implementations, not actual OSes, and thus
+               # require a kernel.
+               echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2
+               exit 1
+               ;;
+       kfreebsd*-gnu* | kopensolaris*-gnu*)
+               ;;
+       vxworks-simlinux | vxworks-simwindows | vxworks-spe)
+               ;;
+       nto-qnx*)
+               ;;
+       os2-emx)
+               ;;
+       *-eabi* | *-gnueabi*)
+               ;;
+       -*)
+               # Blank kernel with real OS is always fine.
+               ;;
+       *-*)
+               echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2
+               exit 1
+               ;;
+esac
+
 # Here we handle the case where we know the os, and the CPU type, but not the
 # manufacturer.  We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
-       *-unknown)
-               case $os in
-                       -riscix*)
+case $vendor in
+       unknown)
+               case $cpu-$os in
+                       *-riscix*)
                                vendor=acorn
                                ;;
-                       -sunos*)
+                       *-sunos*)
                                vendor=sun
                                ;;
-                       -cnk*|-aix*)
+                       *-cnk* | *-aix*)
                                vendor=ibm
                                ;;
-                       -beos*)
+                       *-beos*)
                                vendor=be
                                ;;
-                       -hpux*)
+                       *-hpux*)
                                vendor=hp
                                ;;
-                       -mpeix*)
+                       *-mpeix*)
                                vendor=hp
                                ;;
-                       -hiux*)
+                       *-hiux*)
                                vendor=hitachi
                                ;;
-                       -unos*)
+                       *-unos*)
                                vendor=crds
                                ;;
-                       -dgux*)
+                       *-dgux*)
                                vendor=dg
                                ;;
-                       -luna*)
+                       *-luna*)
                                vendor=omron
                                ;;
-                       -genix*)
+                       *-genix*)
                                vendor=ns
                                ;;
-                       -mvs* | -opened*)
+                       *-clix*)
+                               vendor=intergraph
+                               ;;
+                       *-mvs* | *-opened*)
+                               vendor=ibm
+                               ;;
+                       *-os400*)
                                vendor=ibm
                                ;;
-                       -os400*)
+                       s390-* | s390x-*)
                                vendor=ibm
                                ;;
-                       -ptx*)
+                       *-ptx*)
                                vendor=sequent
                                ;;
-                       -tpf*)
+                       *-tpf*)
                                vendor=ibm
                                ;;
-                       -vxsim* | -vxworks* | -windiss*)
+                       *-vxsim* | *-vxworks* | *-windiss*)
                                vendor=wrs
                                ;;
-                       -aux*)
+                       *-aux*)
                                vendor=apple
                                ;;
-                       -hms*)
+                       *-hms*)
                                vendor=hitachi
                                ;;
-                       -mpw* | -macos*)
+                       *-mpw* | *-macos*)
                                vendor=apple
                                ;;
-                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                       *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
                                vendor=atari
                                ;;
-                       -vos*)
+                       *-vos*)
                                vendor=stratus
                                ;;
                esac
-               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
                ;;
 esac
 
-echo $basic_machine$os
+echo "$cpu-$vendor-${kernel:+$kernel-}$os"
 exit
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "timestamp='"
 # time-stamp-format: "%:y-%02m-%02d"
 # time-stamp-end: "'"
index 28ce42a..6b39162 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # depcomp - compile a program generating dependencies as side-effects
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1999-2015 Free Software Foundation, Inc.
+# Copyright (C) 1999-2020 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -251,6 +251,41 @@ hp)
   exit 1
   ;;
 
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like '#:fec' to the end of the
+    # dependency line.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
 xlc)
   # This case exists only to let depend.m4 do its work.  It works by
   # looking at the text of this script.  This case will never be run,
@@ -748,7 +783,7 @@ exit 0
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 02e5f52..5605f42 100755 (executable)
@@ -3,11 +3,11 @@
 # controlled .prev-version file, automate the procedure by which we record
 # the date, release-type and version string in the NEWS file.  That commit
 # will serve to identify the release, so apply a signed tag to it as well.
-VERSION=2016-12-31.14 # UTC
+VERSION=2018-03-07.03 # UTC
 
 # Note: this is a bash script (could be zsh or dash)
 
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@ VERSION=2016-12-31.14 # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # Written by Jim Meyering
 
@@ -67,7 +67,7 @@ version()
   cat <<EOF
 $ME $VERSION
 Copyright (C) $year Free Software Foundation, Inc,
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 EOF
@@ -171,7 +171,7 @@ git tag -s -m "$pkg $ver" v$ver HEAD || die 'git tag failed'
 
 # Local variables:
 # indent-tabs-mode: nil
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "VERSION="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index fef6280..1872de9 100755 (executable)
@@ -2,9 +2,9 @@
 # gendocs.sh -- generate a GNU manual in many formats.  This script is
 #   mentioned in maintain.texi.  See the help message below for usage details.
 
-scriptversion=2016-05-20.09
+scriptversion=2021-01-01.00
 
-# Copyright 2003-2016 Free Software Foundation, Inc.
+# Copyright 2003-2021 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@ scriptversion=2016-05-20.09
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 #
 # Original author: Mohit Agarwal.
 # Send bug reports and any other correspondence to bug-gnulib@gnu.org.
@@ -25,8 +25,8 @@ scriptversion=2016-05-20.09
 # The latest version of this script, and the companion template, is
 # available from the Gnulib repository:
 #
-# http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh
-# http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template
+# https://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh
+# https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template
 
 # TODO:
 # - image importing was only implemented for HTML generated by
@@ -37,8 +37,8 @@ scriptversion=2016-05-20.09
 prog=`basename "$0"`
 srcdir=`pwd`
 
-scripturl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh"
-templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template"
+scripturl="https://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh"
+templateurl="https://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template"
 
 : ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="}
 : ${MAKEINFO="makeinfo"}
@@ -59,6 +59,7 @@ commonarg= # passed to all makeinfo/texi2html invcations.
 dirargs=   # passed to all tools (-I dir).
 dirs=      # -I directories.
 htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
+default_htmlarg=true
 infoarg=--no-split
 generate_ascii=true
 generate_html=true
@@ -72,7 +73,7 @@ texarg="-t @finalout"
 
 version="gendocs.sh $scriptversion
 
-Copyright 2016 Free Software Foundation, Inc.
+Copyright 2021 Free Software Foundation, Inc.
 There is NO warranty.  You may redistribute this software
 under the terms of the GNU General Public License.
 For more information about these matters, see the files named COPYING."
@@ -82,7 +83,7 @@ usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE
 Generate output in various formats from PACKAGE.texinfo (or .texi or
 .txi) source.  See the GNU Maintainers document for a more extensive
 discussion:
-  http://www.gnu.org/prep/maintain_toc.html
+  https://www.gnu.org/prep/maintain_toc.html
 
 Options:
   --email ADR use ADR as contact in generated web pages; always give this.
@@ -163,7 +164,7 @@ while test $# -gt 0; do
     --common)    shift; commonarg=$1;;
     --docbook)   docbook=yes;;
     --email)     shift; EMAIL=$1;;
-    --html)      shift; htmlarg=$1;;
+    --html)      shift; default_htmlarg=false; htmlarg=$1;;
     --info)      shift; infoarg=$1;;
     --no-ascii)  generate_ascii=false;;
     --no-html)   generate_ascii=false;;
@@ -199,6 +200,11 @@ commonarg=" $dirargs $commonarg"
 # For most of the following, the base name is just $PACKAGE
 base=$PACKAGE
 
+if $default_htmlarg && test -n "$use_texi2html"; then
+  # The legacy texi2html doesn't support TOP_NODE_UP_URL
+  htmlarg="--css-ref=/software/gnulib/manual.css"
+fi
+
 if test -n "$srcfile"; then
   # but here, we use the basename of $srcfile
   base=`basename "$srcfile"`
@@ -497,7 +503,7 @@ $GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html"
 echo "Done, see $outdir/ subdirectory for new files."
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-end: "$"
index bd2c4b6..da525aa 100755 (executable)
@@ -1,8 +1,8 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2016-05-08.18; # UTC
+scriptversion=2019-10-13.15; # UTC
 
-# Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# Copyright (C) 2007-2021 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -15,9 +15,9 @@ scriptversion=2016-05-08.18; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
-# This script is derived from GIT-VERSION-GEN from GIT: http://git.or.cz/.
+# This script is derived from GIT-VERSION-GEN from GIT: https://git-scm.com/.
 # It may be run two ways:
 # - from a git repository in which the "git describe" command below
 #   produces useful output (thus requiring at least one signed tag)
@@ -72,12 +72,13 @@ scriptversion=2016-05-08.18; # UTC
 
 me=$0
 
+year=`expr "$scriptversion" : '\([^-]*\)'`
 version="git-version-gen $scriptversion
 
-Copyright 2011 Free Software Foundation, Inc.
-There is NO warranty.  You may redistribute this software
-under the terms of the GNU General Public License.
-For more information about these matters, see the files named COPYING."
+Copyright (C) ${year} Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law."
 
 usage="\
 Usage: $me [OPTION]... \$srcdir/.tarball-version [TAG-NORMALIZATION-SED-SCRIPT]
@@ -141,11 +142,9 @@ then
     v=`cat $tarball_version_file` || v=
     case $v in
         *$nl*) v= ;; # reject multi-line output
-        [0-9]*) ;;
-        *) v= ;;
     esac
     test "x$v" = x \
-        && echo "$0: WARNING: $tarball_version_file is missing or damaged" 1>&2
+        && echo "$0: WARNING: $tarball_version_file is damaged" 1>&2
 fi
 
 if test "x$v" != x
@@ -167,9 +166,10 @@ then
     # tag or the previous older version that did not?
     #   Newer: v6.10-77-g0f8faeb
     #   Older: v6.10-g0f8faeb
-    case $v in
-        *-*-*) : git describe is okay three part flavor ;;
-        *-*)
+    vprefix=`expr "X$v" : 'X\(.*\)-g[^-]*$'` || vprefix=$v
+    case $vprefix in
+        *-*) : git describe is probably okay three part flavor ;;
+        *)
             : git describe is older two part flavor
             # Recreate the number of commits and rewrite such that the
             # result is the same as if we were using the newer version
@@ -184,9 +184,9 @@ then
             ;;
     esac
 
-    # Change the first '-' to a '.', so version-comparing tools work properly.
-    # Remove the "g" in git describe's output string, to save a byte.
-    v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
+    # Change the penultimate "-" to ".", for version-comparing tools.
+    # Remove the "g" to save a byte.
+    v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
     v_from_git=1
 elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
     v=UNKNOWN
@@ -200,7 +200,7 @@ v=`echo "$v" |sed "s/^$prefix//"`
 # string we're using came from git.  I.e., skip the test if it's "UNKNOWN"
 # or if it came from .tarball-version.
 if test "x$v_from_git" != x; then
-  # Don't declare a version "dirty" merely because a time stamp has changed.
+  # Don't declare a version "dirty" merely because a timestamp has changed.
   git update-index --refresh > /dev/null 2>&1
 
   dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
@@ -218,7 +218,7 @@ fi
 printf %s "$v"
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 83bafdf..9ff15f6 100755 (executable)
@@ -1,31 +1,46 @@
-eval '(exit $?0)' && eval 'exec perl -wS "$0" "$@"'
-  & eval 'exec perl -wS "$0" $argv:q'
-    if 0;
-# Convert git log output to ChangeLog format.
-
-my $VERSION = '2016-03-22 21:49'; # UTC
-# The definition above must lie within the first 8 lines in order
-# for the Emacs time-stamp write hook (at end) to update it.
-# If you change this file with Emacs, please let the write hook
-# do its job.  Otherwise, update this string manually.
+#!/bin/sh
+#! -*-perl-*-
 
-# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# Convert git log output to ChangeLog format.
 
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
+#
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-
+#
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+#
 # Written by Jim Meyering
 
+# This is a prologue that allows to run a perl script as an executable
+# on systems that are compliant to a POSIX version before POSIX:2017.
+# On such systems, the usual invocation of an executable through execlp()
+# or execvp() fails with ENOEXEC if it is a script that does not start
+# with a #! line.  The script interpreter mentioned in the #! line has
+# to be /bin/sh, because on GuixSD systems that is the only program that
+# has a fixed file name.  The second line is essential for perl and is
+# also useful for editing this file in Emacs.  The next two lines below
+# are valid code in both sh and perl.  When executed by sh, they re-execute
+# the script through the perl program found in $PATH.  The '-x' option
+# is essential as well; without it, perl would re-execute the script
+# through /bin/sh.  When executed by perl, the next two lines are a no-op.
+eval 'exec perl -wSx "$0" "$@"'
+     if 0;
+
+my $VERSION = '2021-02-24 23:42'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job.  Otherwise, update this string manually.
+
 use strict;
 use warnings;
 use Getopt::Long;
@@ -33,7 +48,7 @@ use POSIX qw(strftime);
 
 (my $ME = $0) =~ s|.*/||;
 
-# use File::Coda; # http://meyering.net/code/Coda/
+# use File::Coda; # https://meyering.net/code/Coda/
 END {
   defined fileno STDOUT or return;
   close STDOUT and return;
@@ -174,7 +189,7 @@ sub parse_amend_file($)
 
       if (!$in_code)
         {
-          $line =~ /^([0-9a-fA-F]{40})$/
+          $line =~ /^([[:xdigit:]]{40})$/
             or (warn "$ME: $f:$.: invalid line; expected an SHA1\n"),
               $fail = 1, next;
           $sha = lc $1;
@@ -288,7 +303,7 @@ sub git_dir_option($)
       my ($sha, $rest) = split ':', $log, 2;
       defined $sha
         or die "$ME:$.: malformed log entry\n";
-      $sha =~ /^[0-9a-fA-F]{40}$/
+      $sha =~ /^[[:xdigit:]]{40}$/
         or die "$ME:$.: invalid SHA1: $sha\n";
 
       my $skipflag = 0;
@@ -376,7 +391,7 @@ sub git_dir_option($)
                   @skipshas = ();
                   next;
               }
-              if ($found && $_ =~ /^([0-9a-fA-F]{7,}) [^ ]/)
+              if ($found && $_ =~ /^([[:xdigit:]]{7,}) [^ ]/)
               {
                   push ( @skipshas, $1 );
               }
@@ -440,7 +455,8 @@ sub git_dir_option($)
           # If there were any lines
           if (@line == 0)
             {
-              warn "$ME: warning: empty commit message:\n  $date_line\n";
+              warn "$ME: warning: empty commit message:\n"
+                   . "  commit $sha\n  $date_line\n";
             }
           else
             {
@@ -491,7 +507,8 @@ sub git_dir_option($)
 # Local Variables:
 # mode: perl
 # indent-tabs-mode: nil
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-line-limit: 50
 # time-stamp-start: "my $VERSION = '"
 # time-stamp-format: "%:y-%02m-%02d %02H:%02M"
 # time-stamp-time-zone: "UTC0"
index 271e693..cc553f9 100755 (executable)
@@ -1,10 +1,10 @@
 #!/bin/sh
 # Run this after each non-alpha release, to update the web documentation at
-# http://www.gnu.org/software/$pkg/manual/
+# https://www.gnu.org/software/$pkg/manual/
 
-VERSION=2016-01-12.23; # UTC
+VERSION=2021-01-09.09; # UTC
 
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@ VERSION=2016-01-12.23; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 ME=$(basename "$0")
 warn() { printf '%s: %s\n' "$ME" "$*" >&2; }
@@ -30,7 +30,7 @@ Usage: $ME
 
 Run this script from top_srcdir (no arguments) after each non-alpha
 release, to update the web documentation at
-http://www.gnu.org/software/\$pkg/manual/
+https://www.gnu.org/software/\$pkg/manual/
 
 This script assumes you're using git for revision control, and
 requires a .prev-version file as well as a Makefile, from which it
@@ -41,6 +41,7 @@ Options:
   -C, --builddir=DIR  location of (configured) Makefile (default: .)
   -n, --dry-run       don't actually commit anything
   -m, --mirror        remove out of date files from document server
+  -u, --user          the name of the CVS user on Savannah
   --help              print this help, then exit
   --version           print version number, then exit
 
@@ -55,7 +56,7 @@ version()
   cat <<EOF
 $ME $VERSION
 Copyright (C) $year Free Software Foundation, Inc,
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 EOF
@@ -109,6 +110,7 @@ find_tool XARGS gxargs xargs
 builddir=.
 dryrun=
 rm_stale='echo'
+cvs_user="$USER"
 while test $# != 0
 do
   # Handle --option=value by splitting apart and putting back on argv.
@@ -126,6 +128,7 @@ do
     -C|--builddir) shift; builddir=$1; shift ;;
     -n|--dry-run) dryrun=echo; shift;;
     -m|--mirror) rm_stale=''; shift;;
+    -u|--user) shift; cvs_user=$1; shift ;;
     --*) die "unrecognized option: $1";;
     *) break;;
   esac
@@ -172,7 +175,7 @@ set +e
 
 tmp=$(mktemp -d web-doc-update.XXXXXX) || exit 1
 ( cd $tmp \
-    && $CVS -d $USER@cvs.sv.gnu.org:/webcvs/$pkg co $pkg )
+    && $CVS -d $cvs_user@cvs.sv.gnu.org:/webcvs/$pkg co $pkg )
 $RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
 
 (
@@ -202,7 +205,7 @@ $RSYNC -avP "$builddir"/doc/manual/ $tmp/$pkg/manual
 )
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "VERSION="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 8d0299d..6283aa7 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/sh
 # Sign files and upload them.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2021-04-11.09; # UTC
 
-# Copyright (C) 2004-2016 Free Software Foundation, Inc.
+# Copyright (C) 2004-2021 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # Originally written by Alexandre Duret-Lutz <adl@gnu.org>.
 # The master copy of this file is maintained in the gnulib Git repository.
@@ -24,7 +24,30 @@ scriptversion=2016-01-11.22; # UTC
 
 set -e
 
-GPG='gpg --batch --no-tty'
+GPG=gpg
+# Choose the proper version of gpg, so as to avoid a
+# "gpg-agent is not available in this session" error
+# when gpg-agent is version 3 but gpg is still version 1.
+# FIXME-2020: remove, once all major distros ship gpg version 3 as /usr/bin/gpg
+gpg_agent_version=`(gpg-agent --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
+case "$gpg_agent_version" in
+  2.*)
+    gpg_version=`(gpg --version) 2>/dev/null | sed -e '2,$d' -e 's/^[^0-9]*//'`
+    case "$gpg_version" in
+      1.*)
+        if (type gpg2) >/dev/null 2>/dev/null; then
+          # gpg2 is present.
+          GPG=gpg2
+        else
+          # gpg2 is missing. Ubuntu users should install the package 'gnupg2'.
+          echo "WARNING: Using 'gpg', which is too old. You should install 'gpg2'." 1>&2
+        fi
+        ;;
+    esac
+    ;;
+esac
+
+GPG="${GPG} --batch --no-tty"
 conffile=.gnuploadrc
 to=
 dry_run=false
@@ -54,10 +77,10 @@ Options:
   --user NAME              sign with key NAME
   --replace                allow replacements of existing files
   --symlink-regex[=EXPR]   use sed script EXPR to compute symbolic link names
-  --dry-run                do nothing, show what would have been done
+  -n, --dry-run            do nothing, show what would have been done
                            (including the constructed directive file)
   --version                output version information and exit
-  --help                   print this help text and exit
+  -h, --help               print this help text and exit
 
 If --symlink-regex is given without EXPR, then the link target name
 is created by replacing the version information with '-latest', e.g.:
@@ -78,7 +101,7 @@ in the current working directory, its contents are prepended to the
 actual command line options.  Use this to keep your defaults.  Comments
 (#) and empty lines in $conffile are allowed.
 
-<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
+<https://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
 gives some further background.
 
 Examples:
@@ -93,12 +116,22 @@ Examples:
            --symlink-regex \\
            foobar-1.0.tar.gz foobar-1.0.tar.xz
 
-4. Upload foobar-0.9.90.tar.gz to two sites:
+4. Create a symbolic link foobar-latest.tar.gz -> foobar-1.0.tar.gz
+   and likewise for the corresponding .sig file:
+  gnupload --to ftp.gnu.org:foobar \\
+           --symlink foobar-1.0.tar.gz     foobar-latest.tar.gz \\
+                     foobar-1.0.tar.gz.sig foobar-latest.tar.gz.sig
+  or (equivalent):
+  gnupload --to ftp.gnu.org:foobar \\
+           --symlink foobar-1.0.tar.gz     foobar-latest.tar.gz \\
+           --symlink foobar-1.0.tar.gz.sig foobar-latest.tar.gz.sig
+
+5. Upload foobar-0.9.90.tar.gz to two sites:
   gnupload --to alpha.gnu.org:foobar \\
            --to sources.redhat.com:~ftp/pub/foobar \\
            foobar-0.9.90.tar.gz
 
-5. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz
+6. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz
    (the -- terminates the list of files to delete):
   gnupload --to alpha.gnu.org:foobar \\
            --to sources.redhat.com:~ftp/pub/foobar \\
@@ -108,10 +141,16 @@ Examples:
 gnupload executes a program ncftpput to do the transfers; if you don't
 happen to have an ncftp package installed, the ncftpput-ftp script in
 the build-aux/ directory of the gnulib package
-(http://savannah.gnu.org/projects/gnulib) may serve as a replacement.
+(https://savannah.gnu.org/projects/gnulib) may serve as a replacement.
 
 Send patches and bug reports to <bug-gnulib@gnu.org>."
 
+copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
+copyright="Copyright (C) ${copyright_year} Free Software Foundation, Inc.
+License GPLv2+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law."
+
 # Read local configuration file
 if test -r "$conffile"; then
   echo "$0: Reading configuration file $conffile"
@@ -125,7 +164,7 @@ while test -n "$1"; do
   -*)
     collect_var=
     case $1 in
-    --help)
+    -h | --help)
       echo "$usage"
       exit $?
       ;;
@@ -171,12 +210,13 @@ while test -n "$1"; do
     --symlink)
       collect_var=symlink_files
       ;;
-    --dry-run|-n)
+    -n | --dry-run)
       dry_run=:
       ;;
     --version)
       echo "gnupload $scriptversion"
-      exit $?
+      echo "$copyright"
+      exit 0
       ;;
     --)
       shift
@@ -432,7 +472,7 @@ done
 exit 0
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 0360b79..ec298b5 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # install - install a program, script, or datafile
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2020-11-14.01; # UTC
 
 # This originates from X11R5 (mit/util/scripts/install.sh), which was
 # later released in X11R6 (xc/config/util/install.sh) with the
@@ -69,6 +69,11 @@ posix_mkdir=
 # Desired mode of installed file.
 mode=0755
 
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
 chgrpcmd=
 chmodcmd=$chmodprog
 chowncmd=
@@ -99,18 +104,28 @@ Options:
      --version  display version info and exit.
 
   -c            (ignored)
-  -C            install only if different (preserve the last data modification time)
+  -C            install only if different (preserve data modification time)
   -d            create directories instead of installing files.
   -g GROUP      $chgrpprog installed files to GROUP.
   -m MODE       $chmodprog installed files to MODE.
   -o USER       $chownprog installed files to USER.
+  -p            pass -p to $cpprog.
   -s            $stripprog installed files.
+  -S SUFFIX     attempt to back up existing files, with suffix SUFFIX.
   -t DIRECTORY  install into DIRECTORY.
   -T            report an error if DSTFILE is a directory.
 
 Environment variables override the default commands:
   CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
   RMPROG STRIPPROG
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Email bug reports to bug-automake@gnu.org.
+Automake home page: https://www.gnu.org/software/automake/
 "
 
 while test $# -ne 0; do
@@ -137,8 +152,13 @@ while test $# -ne 0; do
     -o) chowncmd="$chownprog $2"
         shift;;
 
+    -p) cpprog="$cpprog -p";;
+
     -s) stripcmd=$stripprog;;
 
+    -S) backupsuffix="$2"
+        shift;;
+
     -t)
         is_target_a_directory=always
         dst_arg=$2
@@ -255,6 +275,10 @@ do
     dstdir=$dst
     test -d "$dstdir"
     dstdir_status=$?
+    # Don't chown directories that already exist.
+    if test $dstdir_status = 0; then
+      chowncmd=""
+    fi
   else
 
     # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -271,15 +295,18 @@ do
     fi
     dst=$dst_arg
 
-    # If destination is a directory, append the input filename; won't work
-    # if double slashes aren't ignored.
+    # If destination is a directory, append the input filename.
     if test -d "$dst"; then
       if test "$is_target_a_directory" = never; then
         echo "$0: $dst_arg: Is a directory" >&2
         exit 1
       fi
       dstdir=$dst
-      dst=$dstdir/`basename "$src"`
+      dstbase=`basename "$src"`
+      case $dst in
+       */) dst=$dst$dstbase;;
+       *)  dst=$dst/$dstbase;;
+      esac
       dstdir_status=0
     else
       dstdir=`dirname "$dst"`
@@ -288,27 +315,16 @@ do
     fi
   fi
 
+  case $dstdir in
+    */) dstdirslash=$dstdir;;
+    *)  dstdirslash=$dstdir/;;
+  esac
+
   obsolete_mkdir_used=false
 
   if test $dstdir_status != 0; then
     case $posix_mkdir in
       '')
-        # Create intermediate dirs using mode 755 as modified by the umask.
-        # This is like FreeBSD 'install' as of 1997-10-28.
-        umask=`umask`
-        case $stripcmd.$umask in
-          # Optimize common cases.
-          *[2367][2367]) mkdir_umask=$umask;;
-          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
-          *[0-7])
-            mkdir_umask=`expr $umask + 22 \
-              - $umask % 100 % 40 + $umask % 20 \
-              - $umask % 10 % 4 + $umask % 2
-            `;;
-          *) mkdir_umask=$umask,go-w;;
-        esac
-
         # With -d, create the new directory with the user-specified mode.
         # Otherwise, rely on $mkdir_umask.
         if test -n "$dir_arg"; then
@@ -318,43 +334,49 @@ do
         fi
 
         posix_mkdir=false
-        case $umask in
-          *[123567][0-7][0-7])
-            # POSIX mkdir -p sets u+wx bits regardless of umask, which
-            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
-            ;;
-          *)
-            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
-            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
-            if (umask $mkdir_umask &&
-                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
-            then
-              if test -z "$dir_arg" || {
-                   # Check for POSIX incompatibilities with -m.
-                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
-                   # other-writable bit of parent directory when it shouldn't.
-                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
-                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
-                   case $ls_ld_tmpdir in
-                     d????-?r-*) different_mode=700;;
-                     d????-?--*) different_mode=755;;
-                     *) false;;
-                   esac &&
-                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
-                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
-                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
-                   }
-                 }
-              then posix_mkdir=:
-              fi
-              rmdir "$tmpdir/d" "$tmpdir"
-            else
-              # Remove any dirs left behind by ancient mkdir implementations.
-              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
-            fi
-            trap '' 0;;
-        esac;;
+       # The $RANDOM variable is not portable (e.g., dash).  Use it
+       # here however when possible just to lower collision chance.
+       tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+       trap '
+         ret=$?
+         rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+         exit $ret
+       ' 0
+
+       # Because "mkdir -p" follows existing symlinks and we likely work
+       # directly in world-writeable /tmp, make sure that the '$tmpdir'
+       # directory is successfully created first before we actually test
+       # 'mkdir -p'.
+       if (umask $mkdir_umask &&
+           $mkdirprog $mkdir_mode "$tmpdir" &&
+           exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+       then
+         if test -z "$dir_arg" || {
+              # Check for POSIX incompatibilities with -m.
+              # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+              # other-writable bit of parent directory when it shouldn't.
+              # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+              test_tmpdir="$tmpdir/a"
+              ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+              case $ls_ld_tmpdir in
+                d????-?r-*) different_mode=700;;
+                d????-?--*) different_mode=755;;
+                *) false;;
+              esac &&
+              $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+                ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+                test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+              }
+            }
+         then posix_mkdir=:
+         fi
+         rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
+       else
+         # Remove any dirs left behind by ancient mkdir implementations.
+         rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
+       fi
+       trap '' 0;;
     esac
 
     if
@@ -365,7 +387,7 @@ do
     then :
     else
 
-      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # mkdir does not conform to POSIX,
       # or it failed possibly due to a race condition.  Create the
       # directory the slow way, step by step, checking for races as we go.
 
@@ -394,7 +416,7 @@ do
           prefixes=
         else
           if $posix_mkdir; then
-            (umask=$mkdir_umask &&
+            (umask $mkdir_umask &&
              $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
             # Don't fail if two instances are running concurrently.
             test -d "$prefix" || exit 1
@@ -427,14 +449,25 @@ do
   else
 
     # Make a couple of temp file names in the proper directory.
-    dsttmp=$dstdir/_inst.$$_
-    rmtmp=$dstdir/_rm.$$_
+    dsttmp=${dstdirslash}_inst.$$_
+    rmtmp=${dstdirslash}_rm.$$_
 
     # Trap to clean up those temp files at exit.
     trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
 
     # Copy the file name to the temp name.
-    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+    (umask $cp_umask &&
+     { test -z "$stripcmd" || {
+        # Create $dsttmp read-write so that cp doesn't create it read-only,
+        # which would cause strip to fail.
+        if test -z "$doit"; then
+          : >"$dsttmp" # No need to fork-exec 'touch'.
+        else
+          $doit touch "$dsttmp"
+        fi
+       }
+     } &&
+     $doit_exec $cpprog "$src" "$dsttmp") &&
 
     # and set any options; do chmod last to preserve setuid bits.
     #
@@ -460,6 +493,13 @@ do
     then
       rm -f "$dsttmp"
     else
+      # If $backupsuffix is set, and the file being installed
+      # already exists, attempt a backup.  Don't worry if it fails,
+      # e.g., if mv doesn't support -f.
+      if test -n "$backupsuffix" && test -f "$dst"; then
+        $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+      fi
+
       # Rename the file to the real destination.
       $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
 
@@ -474,9 +514,9 @@ do
         # file should still install successfully.
         {
           test ! -f "$dst" ||
-          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          $doit $rmcmd "$dst" 2>/dev/null ||
           { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
-            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+            { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
           } ||
           { echo "$0: cannot unlink or rename $dst" >&2
             (exit 1); exit 1
@@ -493,7 +533,7 @@ do
 done
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index 6022eff..6a6a4bc 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/sh
 # Get modification time of a file or directory and pretty-print it.
 
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1995-2015 Free Software Foundation, Inc.
+# Copyright (C) 1995-2020 Free Software Foundation, Inc.
 # written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, June 1995
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -74,6 +74,10 @@ export LC_ALL
 LC_TIME=C
 export LC_TIME
 
+# Use UTC to get reproducible result.
+TZ=UTC0
+export TZ
+
 # GNU ls changes its time format in response to the TIME_STYLE
 # variable.  Since we cannot assume 'unset' works, revert this
 # variable to its documented default.
@@ -216,7 +220,7 @@ echo $day $month $year
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index f62bbae..8d0eaad 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # Common wrapper for a few potentially missing GNU programs.
 
-scriptversion=2013-10-28.13; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+# Copyright (C) 1996-2020 Free Software Foundation, Inc.
 # Originally written by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
 
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -101,9 +101,9 @@ else
   exit $st
 fi
 
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
 
 program_details ()
 {
@@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \
 exit $st
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
diff --git a/build-aux/snippet/_Noreturn.h b/build-aux/snippet/_Noreturn.h
deleted file mode 100644 (file)
index c44ad89..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#if !defined _Noreturn && __STDC_VERSION__ < 201112
-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
-      || 0x5110 <= __SUNPRO_C)
-#  define _Noreturn __attribute__ ((__noreturn__))
-# elif 1200 <= _MSC_VER
-#  define _Noreturn __declspec (noreturn)
-# else
-#  define _Noreturn
-# endif
-#endif
diff --git a/build-aux/snippet/warn-on-use.h b/build-aux/snippet/warn-on-use.h
deleted file mode 100644 (file)
index 2948b47..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-/* A C macro for emitting warnings if a function is used.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published
-   by the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
-   for FUNCTION which will then trigger a compiler warning containing
-   the text of "literal string" anywhere that function is called, if
-   supported by the compiler.  If the compiler does not support this
-   feature, the macro expands to an unused extern declaration.
-
-   This macro is useful for marking a function as a potential
-   portability trap, with the intent that "literal string" include
-   instructions on the replacement function that should be used
-   instead.  However, one of the reasons that a function is a
-   portability trap is if it has the wrong signature.  Declaring
-   FUNCTION with a different signature in C is a compilation error, so
-   this macro must use the same type as any existing declaration so
-   that programs that avoid the problematic FUNCTION do not fail to
-   compile merely because they included a header that poisoned the
-   function.  But this implies that _GL_WARN_ON_USE is only safe to
-   use if FUNCTION is known to already have a declaration.  Use of
-   this macro implies that there must not be any other macro hiding
-   the declaration of FUNCTION; but undefining FUNCTION first is part
-   of the poisoning process anyway (although for symbols that are
-   provided only via a macro, the result is a compilation error rather
-   than a warning containing "literal string").  Also note that in
-   C++, it is only safe to use if FUNCTION has no overloads.
-
-   For an example, it is possible to poison 'getline' by:
-   - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
-     [getline]) in configure.ac, which potentially defines
-     HAVE_RAW_DECL_GETLINE
-   - adding this code to a header that wraps the system <stdio.h>:
-     #undef getline
-     #if HAVE_RAW_DECL_GETLINE
-     _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
-       "not universally present; use the gnulib module getline");
-     #endif
-
-   It is not possible to directly poison global variables.  But it is
-   possible to write a wrapper accessor function, and poison that
-   (less common usage, like &environ, will cause a compilation error
-   rather than issue the nice warning, but the end result of informing
-   the developer about their portability problem is still achieved):
-   #if HAVE_RAW_DECL_ENVIRON
-   static char ***rpl_environ (void) { return &environ; }
-   _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
-   # undef environ
-   # define environ (*rpl_environ ())
-   #endif
-   */
-#ifndef _GL_WARN_ON_USE
-
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
-/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
-#  define _GL_WARN_ON_USE(function, message) \
-extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
-/* Verify the existence of the function.  */
-#  define _GL_WARN_ON_USE(function, message) \
-extern __typeof__ (function) function
-# else /* Unsupported.  */
-#  define _GL_WARN_ON_USE(function, message) \
-_GL_WARN_EXTERN_C int _gl_warn_on_use
-# endif
-#endif
-
-/* _GL_WARN_ON_USE_CXX (function, rettype, parameters_and_attributes, "string")
-   is like _GL_WARN_ON_USE (function, "string"), except that the function is
-   declared with the given prototype, consisting of return type, parameters,
-   and attributes.
-   This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
-   not work in this case.  */
-#ifndef _GL_WARN_ON_USE_CXX
-# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
-#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
-extern rettype function parameters_and_attributes \
-     __attribute__ ((__warning__ (msg)))
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
-/* Verify the existence of the function.  */
-#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
-extern rettype function parameters_and_attributes
-# else /* Unsupported.  */
-#  define _GL_WARN_ON_USE_CXX(function,rettype,parameters_and_attributes,msg) \
-_GL_WARN_EXTERN_C int _gl_warn_on_use
-# endif
-#endif
-
-/* _GL_WARN_EXTERN_C declaration;
-   performs the declaration with C linkage.  */
-#ifndef _GL_WARN_EXTERN_C
-# if defined __cplusplus
-#  define _GL_WARN_EXTERN_C extern "C"
-# else
-#  define _GL_WARN_EXTERN_C extern
-# endif
-#endif
index 8e575b0..9759384 100755 (executable)
@@ -1,9 +1,9 @@
 #! /bin/sh
 # test-driver - basic testsuite driver script.
 
-scriptversion=2013-07-13.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 2011-2014 Free Software Foundation, Inc.
+# Copyright (C) 2011-2020 Free Software Foundation, Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@ scriptversion=2013-07-13.22; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # As a special exception to the GNU General Public License, if you
 # distribute this file as part of a program that contains a
@@ -42,11 +42,13 @@ print_usage ()
 {
   cat <<END
 Usage:
-  test-driver --test-name=NAME --log-file=PATH --trs-file=PATH
-              [--expect-failure={yes|no}] [--color-tests={yes|no}]
-              [--enable-hard-errors={yes|no}] [--]
+  test-driver --test-name NAME --log-file PATH --trs-file PATH
+              [--expect-failure {yes|no}] [--color-tests {yes|no}]
+              [--enable-hard-errors {yes|no}] [--]
               TEST-SCRIPT [TEST-SCRIPT-ARGUMENTS]
+
 The '--test-name', '--log-file' and '--trs-file' options are mandatory.
+See the GNU Automake documentation for information.
 END
 }
 
@@ -140,9 +142,9 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file
 # Local Variables:
 # mode: shell-script
 # sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
 # time-stamp-end: "; # UTC"
 # End:
index c8913ab..2bab634 100644 (file)
@@ -1,14 +1,11 @@
 % texinfo.tex -- TeX macros to handle Texinfo files.
-% 
+%
 % Load plain if necessary, i.e., if running under initex.
 \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi
 %
-\def\texinfoversion{2016-09-18.18}
+\def\texinfoversion{2021-02-20.11}
 %
-% Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995,
-% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-% 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
-% Free Software Foundation, Inc.
+% Copyright 1985, 1986, 1988, 1990-2021 Free Software Foundation, Inc.
 %
 % This texinfo.tex file is free software: you can redistribute it and/or
 % modify it under the terms of the GNU General Public License as
@@ -21,7 +18,7 @@
 % General Public License for more details.
 %
 % You should have received a copy of the GNU General Public License
-% along with this program.  If not, see <http://www.gnu.org/licenses/>.
+% along with this program.  If not, see <https://www.gnu.org/licenses/>.
 %
 % As a special exception, when this file is read by TeX when processing
 % a Texinfo source document, you may use the result without
 %
 % Please try the latest version of texinfo.tex before submitting bug
 % reports; you can get the latest version from:
-%   http://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
-%   http://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
-%   http://www.gnu.org/software/texinfo/ (the Texinfo home page)
+%   https://ftp.gnu.org/gnu/texinfo/ (the Texinfo release area), or
+%   https://ftpmirror.gnu.org/texinfo/ (same, via a mirror), or
+%   https://www.gnu.org/software/texinfo/ (the Texinfo home page)
 % The texinfo.tex in any given distribution could well be out
 % of date, so if that's what you're using, please check.
 %
-% Send bug reports to bug-texinfo@gnu.org.  Please include including a
+% Send bug reports to bug-texinfo@gnu.org.  Please include a
 % complete document in each bug report with which we can reproduce the
 % problem.  Patches are, of course, greatly appreciated.
 %
@@ -56,7 +53,7 @@
 % extent.  You can get the existing language-specific files from the
 % full Texinfo distribution.
 %
-% The GNU Texinfo home page is http://www.gnu.org/software/texinfo.
+% The GNU Texinfo home page is https://www.gnu.org/software/texinfo.
 
 
 \message{Loading texinfo [version \texinfoversion]:}
 % Give the space character the catcode for a space.
 \def\spaceisspace{\catcode`\ =10\relax}
 
+% Likewise for ^^M, the end of line character.
+\def\endlineisspace{\catcode13=10\relax}
+
 \chardef\dashChar  = `\-
 \chardef\slashChar = `\/
 \chardef\underChar = `\_
 % @errormsg{MSG}.  Do the index-like expansions on MSG, but if things
 % aren't perfect, it's not the end of the world, being an error message,
 % after all.
-% 
+%
 \def\errormsg{\begingroup \indexnofonts \doerrormsg}
 \def\doerrormsg#1{\errmessage{#1}}
 
 %
 \def\finalout{\overfullrule=0pt }
 
-% Do @cropmarks to get crop marks.
-%
-\newif\ifcropmarks
-\let\cropmarks = \cropmarkstrue
-%
-% Dimensions to add cropmarks at corners.
-% Added by P. A. MacKay, 12 Nov. 1986
-%
 \newdimen\outerhsize \newdimen\outervsize % set by the paper size routines
-\newdimen\cornerlong  \cornerlong=1pc
-\newdimen\cornerthick \cornerthick=.3pt
 \newdimen\topandbottommargin \topandbottommargin=.75in
 
 % Output a mark which sets \thischapter, \thissection and \thiscolor.
 
 % \domark is called twice inside \chapmacro, to add one
 % mark before the section break, and one after.
-%   In the second call \prevchapterdefs is the same as \lastchapterdefs,
-% and \prevsectiondefs is the same as \lastsectiondefs.
+%   In the second call \prevchapterdefs is the same as \currentchapterdefs,
+% and \prevsectiondefs is the same as \currentsectiondefs.
 %   Then if the page is not broken at the mark, some of the previous
 % section appears on the page, and we can get the name of this section
 % from \firstmark for @everyheadingmarks top.
 %
 % See page 260 of The TeXbook.
 \def\domark{%
-  \toks0=\expandafter{\lastchapterdefs}%
-  \toks2=\expandafter{\lastsectiondefs}%
+  \toks0=\expandafter{\currentchapterdefs}%
+  \toks2=\expandafter{\currentsectiondefs}%
   \toks4=\expandafter{\prevchapterdefs}%
   \toks6=\expandafter{\prevsectiondefs}%
-  \toks8=\expandafter{\lastcolordefs}%
+  \toks8=\expandafter{\currentcolordefs}%
   \mark{%
                    \the\toks0 \the\toks2  % 0: marks for @everyheadingmarks top
       \noexpand\or \the\toks4 \the\toks6  % 1: for @everyheadingmarks bottom
 % @setcolor (or @url, or @link, etc.) between @contents and the very
 % first @chapter.
 \def\gettopheadingmarks{%
-  \ifcase0\topmark\fi
+  \ifcase0\the\savedtopmark\fi
   \ifx\thischapter\empty \ifcase0\firstmark\fi \fi
 }
 \def\getbottomheadingmarks{\ifcase1\botmark\fi}
-\def\getcolormarks{\ifcase2\topmark\fi}
+\def\getcolormarks{\ifcase2\the\savedtopmark\fi}
 
 % Avoid "undefined control sequence" errors.
-\def\lastchapterdefs{}
-\def\lastsectiondefs{}
-\def\lastsection{}
+\def\currentchapterdefs{}
+\def\currentsectiondefs{}
+\def\currentsection{}
 \def\prevchapterdefs{}
 \def\prevsectiondefs{}
-\def\lastcolordefs{}
+\def\currentcolordefs{}
 
 % Margin to add to right of even pages, to left of odd pages.
 \newdimen\bindingoffset
 % Main output routine.
 %
 \chardef\PAGE = 255
-\output = {\onepageout{\pagecontents\PAGE}}
+\newtoks\defaultoutput
+\defaultoutput = {\savetopmark\onepageout{\pagecontents\PAGE}}
+\output=\expandafter{\the\defaultoutput}
 
 \newbox\headlinebox
 \newbox\footlinebox
 
+% When outputting the double column layout for indices, an output routine
+% is run several times, which hides the original value of \topmark.  This
+% can lead to a page heading being output and duplicating the chapter heading
+% of the index.  Hence, save the contents of \topmark at the beginning of
+% the output routine.  The saved contents are valid until we actually
+% \shipout a page.
+%
+% (We used to run a short output routine to actually set \topmark and
+% \firstmark to the right values, but if this was called with an empty page
+% containing whatsits for writing index entries, the whatsits would be thrown
+% away and the index auxiliary file would remain empty.)
+%
+\newtoks\savedtopmark
+\newif\iftopmarksaved
+\topmarksavedtrue
+\def\savetopmark{%
+  \iftopmarksaved\else
+    \global\savedtopmark=\expandafter{\topmark}%
+    \global\topmarksavedtrue
+  \fi
+}
+
 % \onepageout takes a vbox as an argument.
-% \shipout a vbox for a single page, adding an optional header, footer,
-% cropmarks, and footnote.  This also causes index entries for this page
-% to be written to the auxiliary files.
+% \shipout a vbox for a single page, adding an optional header, footer
+% and footnote.  This also causes index entries for this page to be written
+% to the auxiliary files.
 %
 \def\onepageout#1{%
-  \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi
+  \hoffset=\normaloffset
   %
   \ifodd\pageno  \advance\hoffset by \bindingoffset
   \else \advance\hoffset by -\bindingoffset\fi
   %
-  % Common context changes for both heading and footing.
-  % Do this outside of the \shipout so @code etc. will be expanded in
-  % the headline as they should be, not taken literally (outputting ''code).
-  \def\commmonheadfootline{\let\hsize=\txipagewidth \texinfochars}
+  \checkchapterpage
   %
   % Retrieve the information for the headings from the marks in the page,
   % and call Plain TeX's \makeheadline and \makefootline, which use the
   % values in \headline and \footline.
   %
-  % This is used to check if we are on the first page of a chapter.
-  \ifcase1\topmark\fi
-  \let\prevchaptername\thischaptername
-  \ifcase0\firstmark\fi
-  \let\curchaptername\thischaptername
+  % Common context changes for both heading and footing.
+  % Do this outside of the \shipout so @code etc. will be expanded in
+  % the headline as they should be, not taken literally (outputting ''code).
+  \def\commonheadfootline{\let\hsize=\txipagewidth \texinfochars}
   %
   \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
+  \global\setbox\headlinebox = \vbox{\commonheadfootline \makeheadline}%
   \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi
-  %
-  \ifx\curchaptername\prevchaptername
-    \let\thischapterheading\thischapter
-  \else
-    % \thischapterheading is the same as \thischapter except it is blank
-    % for the first page of a chapter.  This is to prevent the chapter name 
-    % being shown twice.
-    \def\thischapterheading{}%
-  \fi
-  %
-  \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}%
-  \global\setbox\footlinebox = \vbox{\commmonheadfootline \makefootline}%
+  \global\setbox\footlinebox = \vbox{\commonheadfootline \makefootline}%
   %
   {%
     % Set context for writing to auxiliary files like index files.
     % take effect in \write's, yet the group defined by the \vbox ends
     % before the \shipout runs.
     %
-    \indexdummies         % don't expand commands in the output.
-    \normalturnoffactive  % \ in index entries must not stay \, e.g., if
-               % the page break happens to be in the middle of an example.
-               % We don't want .vr (or whatever) entries like this:
-               % \entry{{\indexbackslash }acronym}{32}{\code {\acronym}}
-               % "\acronym" won't work when it's read back in;
-               % it needs to be
-               % {\code {{\backslashcurfont }acronym}
+    \atdummies         % don't expand commands in the output.
+    \turnoffactive
     \shipout\vbox{%
       % Do this early so pdf references go to the beginning of the page.
       \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi
       %
-      \ifcropmarks \vbox to \outervsize\bgroup
-        \hsize = \outerhsize
-        \vskip-\topandbottommargin
-        \vtop to0pt{%
-          \line{\ewtop\hfil\ewtop}%
-          \nointerlineskip
-          \line{%
-            \vbox{\moveleft\cornerthick\nstop}%
-            \hfill
-            \vbox{\moveright\cornerthick\nstop}%
-          }%
-          \vss}%
-        \vskip\topandbottommargin
-        \line\bgroup
-          \hfil % center the page within the outer (page) hsize.
-          \ifodd\pageno\hskip\bindingoffset\fi
-          \vbox\bgroup
-      \fi
-      %
       \unvbox\headlinebox
       \pagebody{#1}%
       \ifdim\ht\footlinebox > 0pt
         \unvbox\footlinebox
       \fi
       %
-      \ifcropmarks
-          \egroup % end of \vbox\bgroup
-        \hfil\egroup % end of (centering) \line\bgroup
-        \vskip\topandbottommargin plus1fill minus1fill
-        \boxmaxdepth = \cornerthick
-        \vbox to0pt{\vss
-          \line{%
-            \vbox{\moveleft\cornerthick\nsbot}%
-            \hfill
-            \vbox{\moveright\cornerthick\nsbot}%
-          }%
-          \nointerlineskip
-          \line{\ewbot\hfil\ewbot}%
-        }%
-      \egroup % \vbox from first cropmarks clause
-      \fi
-    }% end of \shipout\vbox
-  }% end of group with \indexdummies
+    }%
+  }%
+  \global\topmarksavedfalse
   \advancepageno
   \ifnum\outputpenalty>-20000 \else\dosupereject\fi
 }
 \ifr@ggedbottom \kern-\dimen@ \vfil \fi}
 }
 
-% Here are the rules for the cropmarks.  Note that they are
-% offset so that the space between them is truly \outerhsize or \outervsize
-% (P. A. MacKay, 12 November, 1986)
-%
-\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong}
-\def\nstop{\vbox
-  {\hrule height\cornerthick depth\cornerlong width\cornerthick}}
-\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong}
-\def\nsbot{\vbox
-  {\hrule height\cornerlong depth\cornerthick width\cornerthick}}
-
+% Check if we are on the first page of a chapter.  Used for printing headings.
+\newif\ifchapterpage
+\def\checkchapterpage{%
+  % Get the chapter that was current at the end of the last page
+  \ifcase1\the\savedtopmark\fi
+  \let\prevchaptername\thischaptername
+  %
+  \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi
+  \let\curchaptername\thischaptername
+  %
+  \ifx\curchaptername\prevchaptername
+    \chapterpagefalse
+  \else
+    \chapterpagetrue
+  \fi
+}
 
 % Argument parsing
 
   }%
 }
 
-% First remove any @comment, then any @c comment.  Also remove a @texinfoc
-% comment (see \scanmacro for details).  Pass the result on to \argcheckspaces.
+% First remove any @comment, then any @c comment.  Pass the result on to
+% \argcheckspaces.
 \def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm}
-\def\argremovec#1\c#2\ArgTerm{\argremovetexinfoc #1\texinfoc\ArgTerm}
-\def\argremovetexinfoc#1\texinfoc#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
+\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm}
 
 % Each occurrence of `\^^M' or `<space>\^^M' is replaced by a single space.
 %
   \fi
 }
 
-% @end foo executes the definition of \Efoo.
-% But first, it executes a specialized version of \checkenv
-%
-\parseargdef\end{%
+
+% @end foo calls \checkenv and executes the definition of \Efoo.
+\parseargdef\end{
   \if 1\csname iscond.#1\endcsname
   \else
     % The general wording of \badenverr may not be ideal.
@@ -950,21 +913,14 @@ where each line of input produces a line of output.}
 % @comment ...line which is ignored...
 % @c is the same as @comment
 % @ignore ... @end ignore  is another way to write a comment
-%
-\def\comment{\begingroup \catcode`\^^M=\active%
-\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other\commentxxx}%
 
-{\catcode`\^^M=\active%
-\gdef\commentxxx#1^^M{\endgroup%
-\futurelet\nexttoken\commentxxxx}%
-\gdef\commentxxxx{\ifx\nexttoken\aftermacro\expandafter\comment\fi}%
-}
 
 \def\c{\begingroup \catcode`\^^M=\active%
 \catcode`\@=\other \catcode`\{=\other \catcode`\}=\other%
 \cxxx}
 {\catcode`\^^M=\active \gdef\cxxx#1^^M{\endgroup}}
-% See comment in \scanmacro about why the definitions of @c and @comment differ
+%
+\let\comment\c
 
 % @paragraphindent NCHARS
 % We'll use ems for NCHARS, close enough.
@@ -1054,7 +1010,7 @@ where each line of input produces a line of output.}
 \let\setfilename=\comment
 
 % @bye.
-\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend}
+\outer\def\bye{\chappager\pagelabels\tracingstats=1\ptexend}
 
 
 \message{pdf,}
@@ -1096,7 +1052,7 @@ where each line of input produces a line of output.}
             tex.sprint(
               string.format(string.char(0x5c) .. string.char(0x25) .. '03o' ..
                             string.char(0x5c) .. string.char(0x25) .. '03o',
-                            (c / 256), (c % 256)))
+                            math.floor(c / 256), math.floor(c % 256)))
           else
             c = c - 0x10000
             local c_hi = c / 1024 + 0xd800
@@ -1106,8 +1062,8 @@ where each line of input produces a line of output.}
                             string.char(0x5c) .. string.char(0x25) .. '03o' ..
                             string.char(0x5c) .. string.char(0x25) .. '03o' ..
                             string.char(0x5c) .. string.char(0x25) .. '03o',
-                            (c_hi / 256), (c_hi % 256),
-                            (c_lo / 256), (c_lo % 256)))
+                            math.floor(c_hi / 256), math.floor(c_hi % 256),
+                            math.floor(c_lo / 256), math.floor(c_lo % 256)))
           end
         end
       end
@@ -1120,15 +1076,19 @@ where each line of input produces a line of output.}
       function PDFescstr(str)
         for c in string.bytes(str) do
           if c <= 0x20 or c >= 0x80 or c == 0x28 or c == 0x29 or c == 0x5c then
-            tex.sprint(
+            tex.sprint(-2,
               string.format(string.char(0x5c) .. string.char(0x25) .. '03o',
                             c))
           else
-            tex.sprint(string.char(c))
+            tex.sprint(-2, string.char(c))
           end
         end
       end
     }
+    % The -2 in the arguments here gives all the input to TeX catcode 12
+    % (other) or 10 (space), preventing undefined control sequence errors. See
+    % https://lists.gnu.org/archive/html/bug-texinfo/2019-08/msg00031.html
+    %
   \endgroup
   \def\pdfescapestring#1{\directlua{PDFescstr('\luaescapestring{#1}')}}
   \ifnum\luatexversion>84
@@ -1167,11 +1127,60 @@ where each line of input produces a line of output.}
   \fi
 \fi
 
+\newif\ifpdforxetex
+\pdforxetexfalse
+\ifpdf
+  \pdforxetextrue
+\fi
+\ifx\XeTeXrevision\thisisundefined\else
+  \pdforxetextrue
+\fi
+
+
+% Output page labels information.
+% See PDF reference v.1.7 p.594, section 8.3.1.
+\ifpdf
+\def\pagelabels{%
+  \def\title{0 << /P (T-) /S /D >>}%
+  \edef\roman{\the\romancount << /S /r >>}%
+  \edef\arabic{\the\arabiccount << /S /D >>}%
+  %
+  % Page label ranges must be increasing.  Remove any duplicates.
+  % (There is a slight chance of this being wrong if e.g. there is
+  % a @contents but no @titlepage, etc.)
+  %
+  \ifnum\romancount=0 \def\roman{}\fi
+  \ifnum\arabiccount=0 \def\title{}%
+  \else
+    \ifnum\romancount=\arabiccount \def\roman{}\fi
+  \fi
+  %
+  \ifnum\romancount<\arabiccount
+    \pdfcatalog{/PageLabels << /Nums [\title \roman \arabic ] >> }\relax
+  \else
+    \pdfcatalog{/PageLabels << /Nums [\title \arabic \roman ] >> }\relax
+  \fi
+}
+\else
+  \let\pagelabels\relax
+\fi
+
+\newcount\pagecount \pagecount=0
+\newcount\romancount \romancount=0
+\newcount\arabiccount \arabiccount=0
+\ifpdf
+  \let\ptxadvancepageno\advancepageno
+  \def\advancepageno{%
+    \ptxadvancepageno\global\advance\pagecount by 1
+  }
+\fi
+
+
 % PDF uses PostScript string constants for the names of xref targets,
 % for display in the outlines, and in other places.  Thus, we have to
 % double any backslashes.  Otherwise, a name like "\node" will be
 % interpreted as a newline (\n), followed by o, d, e.  Not good.
-% 
+%
 % See http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html and
 % related messages.  The final outcome is that it is up to the TeX user
 % to double the backslashes and otherwise make the string valid, so
@@ -1223,7 +1232,7 @@ output) for that.)}
   % Set color, and create a mark which defines \thiscolor accordingly,
   % so that \makeheadline knows which color to restore.
   \def\setcolor#1{%
-    \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+    \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
     \domark
     \pdfsetcolor{#1}%
   }
@@ -1231,7 +1240,7 @@ output) for that.)}
   \def\maincolor{\rgbBlack}
   \pdfsetcolor{\maincolor}
   \edef\thiscolor{\maincolor}
-  \def\lastcolordefs{}
+  \def\currentcolordefs{}
   %
   \def\makefootline{%
     \baselineskip24pt
@@ -1457,7 +1466,13 @@ output) for that.)}
       % subentries, which we calculated on our first read of the .toc above.
       %
       % We use the node names as the destinations.
+      %
+      % Currently we prefix the section name with the section number
+      % for chapter and appendix headings only in order to avoid too much
+      % horizontal space being required in the PDF viewer.
       \def\numchapentry##1##2##3##4{%
+        \dopdfoutline{##2 ##1}{count-\expnumber{chap##2}}{##3}{##4}}%
+      \def\unnchapentry##1##2##3##4{%
         \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}%
       \def\numsecentry##1##2##3##4{%
         \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}%
@@ -1476,7 +1491,7 @@ output) for that.)}
       % their "best" equivalent, based on the @documentencoding.  Too
       % much work for too little return.  Just use the ASCII equivalents
       % we use for the index sort strings.
-      % 
+      %
       \indexnofonts
       \setupdatafile
       % We can have normal brace characters in the PDF outlines, unlike
@@ -1532,6 +1547,9 @@ output) for that.)}
       \startlink attr{/Border [0 0 0]}%
         user{/Subtype /Link /A << /S /URI /URI (#1) >>}%
     \endgroup}
+  % \pdfgettoks - Surround page numbers in #1 with @pdflink.  #1 may
+  % be a simple number, or a list of numbers in the case of an index
+  % entry.
   \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}}
   \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks}
   \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks}
@@ -1606,7 +1624,7 @@ output) for that.)}
   % Set color, and create a mark which defines \thiscolor accordingly,
   % so that \makeheadline knows which color to restore.
   \def\setcolor#1{%
-    \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}%
+    \xdef\currentcolordefs{\gdef\noexpand\thiscolor{#1}}%
     \domark
     \pdfsetcolor{#1}%
   }
@@ -1614,7 +1632,7 @@ output) for that.)}
   \def\maincolor{\rgbBlack}
   \pdfsetcolor{\maincolor}
   \edef\thiscolor{\maincolor}
-  \def\lastcolordefs{}
+  \def\currentcolordefs{}
   %
   \def\makefootline{%
     \baselineskip24pt
@@ -1696,9 +1714,13 @@ output) for that.)}
       % Therefore, we read toc only once.
       %
       % We use node names as destinations.
+      %
+      % Currently we prefix the section name with the section number
+      % for chapter and appendix headings only in order to avoid too much
+      % horizontal space being required in the PDF viewer.
       \def\partentry##1##2##3##4{}% ignore parts in the outlines
       \def\numchapentry##1##2##3##4{%
-        \dopdfoutline{##1}{1}{##3}{##4}}%
+        \dopdfoutline{##2 ##1}{1}{##3}{##4}}%
       \def\numsecentry##1##2##3##4{%
         \dopdfoutline{##1}{2}{##3}{##4}}%
       \def\numsubsecentry##1##2##3##4{%
@@ -1710,7 +1732,8 @@ output) for that.)}
       \let\appsecentry\numsecentry%
       \let\appsubsecentry\numsubsecentry%
       \let\appsubsubsecentry\numsubsubsecentry%
-      \let\unnchapentry\numchapentry%
+      \def\unnchapentry##1##2##3##4{%
+        \dopdfoutline{##1}{1}{##3}{##4}}%
       \let\unnsecentry\numsecentry%
       \let\unnsubsecentry\numsubsecentry%
       \let\unnsubsubsecentry\numsubsubsecentry%
@@ -2206,7 +2229,7 @@ end
 % A few fonts for @defun names and args.
 \setfont\defbf\bfshape{10}{\magstep1}{OT1}
 \setfont\deftt\ttshape{10}{\magstep1}{OT1TT}
-\setfont\defsl\slshape{10}{\magstep1}{OT1TT}
+\setfont\defsl\slshape{10}{\magstep1}{OT1}
 \setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT}
 \def\df{\let\ttfont=\deftt \let\bffont = \defbf
 \let\ttslfont=\defttsl \let\slfont=\defsl \bf}
@@ -2239,6 +2262,20 @@ end
 \font\smallersy=cmsy8
 \def\smallerecsize{0800}
 
+% Fonts for math mode superscripts (7pt).
+\def\sevennominalsize{7pt}
+\setfont\sevenrm\rmshape{7}{1000}{OT1}
+\setfont\seventt\ttshape{10}{700}{OT1TT}
+\setfont\sevenbf\bfshape{10}{700}{OT1}
+\setfont\sevenit\itshape{7}{1000}{OT1IT}
+\setfont\sevensl\slshape{10}{700}{OT1}
+\setfont\sevensf\sfshape{10}{700}{OT1}
+\setfont\sevensc\scshape{10}{700}{OT1}
+\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
+\font\seveni=cmmi7
+\font\sevensy=cmsy7
+\def\sevenecsize{0700}
+
 % Fonts for title page (20.4pt):
 \def\titlenominalsize{20pt}
 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
@@ -2340,7 +2377,7 @@ end
 % A few fonts for @defun names and args.
 \setfont\defbf\bfshape{10}{\magstephalf}{OT1}
 \setfont\deftt\ttshape{10}{\magstephalf}{OT1TT}
-\setfont\defsl\slshape{10}{\magstephalf}{OT1TT}
+\setfont\defsl\slshape{10}{\magstephalf}{OT1}
 \setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT}
 \def\df{\let\ttfont=\deftt \let\bffont = \defbf
 \let\slfont=\defsl \let\ttslfont=\defttsl \bf}
@@ -2373,6 +2410,20 @@ end
 \font\smallersy=cmsy8
 \def\smallerecsize{0800}
 
+% Fonts for math mode superscripts (7pt).
+\def\sevennominalsize{7pt}
+\setfont\sevenrm\rmshape{7}{1000}{OT1}
+\setfont\seventt\ttshape{10}{700}{OT1TT}
+\setfont\sevenbf\bfshape{10}{700}{OT1}
+\setfont\sevenit\itshape{7}{1000}{OT1IT}
+\setfont\sevensl\slshape{10}{700}{OT1}
+\setfont\sevensf\sfshape{10}{700}{OT1}
+\setfont\sevensc\scshape{10}{700}{OT1}
+\setfont\seventtsl\ttslshape{10}{700}{OT1TT}
+\font\seveni=cmmi7
+\font\sevensy=cmsy7
+\def\sevenecsize{0700}
+
 % Fonts for title page (20.4pt):
 \def\titlenominalsize{20pt}
 \setfont\titlerm\rmbshape{12}{\magstep3}{OT1}
@@ -2495,7 +2546,7 @@ end
 \def\it{\fam=\itfam \setfontstyle{it}}
 \def\sl{\fam=\slfam \setfontstyle{sl}}
 \def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf}
-\def\tt{\fam=\ttfam \setfontstyle{tt}}
+\def\tt{\fam=\ttfam \setfontstyle{tt}}\def\ttstylename{tt}
 
 % Texinfo sort of supports the sans serif font style, which plain TeX does not.
 % So we set up a \sf.
@@ -2507,13 +2558,20 @@ end
 
 
 % In order for the font changes to affect most math symbols and letters,
-% we have to define the \textfont of the standard families.  We don't
-% bother to reset \scriptfont and \scriptscriptfont; awaiting user need.
+% we have to define the \textfont of the standard families.
+% We don't bother to reset \scriptscriptfont; awaiting user need.
 %
 \def\resetmathfonts{%
   \textfont0=\rmfont \textfont1=\ifont \textfont2=\syfont
   \textfont\itfam=\itfont \textfont\slfam=\slfont \textfont\bffam=\bffont
   \textfont\ttfam=\ttfont \textfont\sffam=\sffont
+  %
+  % Fonts for superscript.  Note that the 7pt fonts are used regardless
+  % of the current font size.
+  \scriptfont0=\sevenrm \scriptfont1=\seveni \scriptfont2=\sevensy
+  \scriptfont\itfam=\sevenit \scriptfont\slfam=\sevensl
+  \scriptfont\bffam=\sevenbf \scriptfont\ttfam=\seventt
+  \scriptfont\sffam=\sevensf
 }
 
 %
@@ -2523,6 +2581,9 @@ end
 % to also set the current \fam for math mode.  Our \STYLE (e.g., \rm)
 % commands hardwire \STYLEfont to set the current font.
 %
+% The fonts used for \ifont are for "math italics"  (\itfont is for italics
+% in regular text).  \syfont is also used in math mode only.
+%
 % Each font-changing command also sets the names \lsize (one size lower)
 % and \lllsize (three sizes lower).  These relative commands are used
 % in, e.g., the LaTeX logo and acronyms.
@@ -2611,8 +2672,6 @@ end
 \definetextfontsizexi
 
 
-\message{markup,}
-
 % Check if we are currently using a typewriter font.  Since all the
 % Computer Modern typewriter fonts have zero interword stretch (and
 % shrink), and it is reasonable to expect all typewriter fonts to have
@@ -2620,83 +2679,14 @@ end
 %
 \def\ifmonospace{\ifdim\fontdimen3\font=0pt }
 
-% Markup style infrastructure.  \defmarkupstylesetup\INITMACRO will
-% define and register \INITMACRO to be called on markup style changes.
-% \INITMACRO can check \currentmarkupstyle for the innermost
-% style and the set of \ifmarkupSTYLE switches for all styles
-% currently in effect.
-\newif\ifmarkupvar
-\newif\ifmarkupsamp
-\newif\ifmarkupkey
-%\newif\ifmarkupfile % @file == @samp.
-%\newif\ifmarkupoption % @option == @samp.
-\newif\ifmarkupcode
-\newif\ifmarkupkbd
-%\newif\ifmarkupenv % @env == @code.
-%\newif\ifmarkupcommand % @command == @code.
-\newif\ifmarkuptex % @tex (and part of @math, for now).
-\newif\ifmarkupexample
-\newif\ifmarkupverb
-\newif\ifmarkupverbatim
-
-\let\currentmarkupstyle\empty
-
-\def\setupmarkupstyle#1{%
-  \csname markup#1true\endcsname
-  \def\currentmarkupstyle{#1}%
-  \markupstylesetup
-}
-
-\let\markupstylesetup\empty
-
-\def\defmarkupstylesetup#1{%
-  \expandafter\def\expandafter\markupstylesetup
-    \expandafter{\markupstylesetup #1}%
-  \def#1%
-}
-
-% Markup style setup for left and right quotes.
-\defmarkupstylesetup\markupsetuplq{%
-  \expandafter\let\expandafter \temp
-    \csname markupsetuplq\currentmarkupstyle\endcsname
-  \ifx\temp\relax \markupsetuplqdefault \else \temp \fi
-}
-
-\defmarkupstylesetup\markupsetuprq{%
-  \expandafter\let\expandafter \temp
-    \csname markupsetuprq\currentmarkupstyle\endcsname
-  \ifx\temp\relax \markupsetuprqdefault \else \temp \fi
-}
-
 {
 \catcode`\'=\active
 \catcode`\`=\active
 
-\gdef\markupsetuplqdefault{\let`\lq}
-\gdef\markupsetuprqdefault{\let'\rq}
-
-\gdef\markupsetcodequoteleft{\let`\codequoteleft}
-\gdef\markupsetcodequoteright{\let'\codequoteright}
+\gdef\setcodequotes{\let`\codequoteleft \let'\codequoteright}
+\gdef\setregularquotes{\let`\lq \let'\rq}
 }
 
-\let\markupsetuplqcode \markupsetcodequoteleft
-\let\markupsetuprqcode \markupsetcodequoteright
-%
-\let\markupsetuplqexample \markupsetcodequoteleft
-\let\markupsetuprqexample \markupsetcodequoteright
-%
-\let\markupsetuplqkbd     \markupsetcodequoteleft
-\let\markupsetuprqkbd     \markupsetcodequoteright
-%
-\let\markupsetuplqsamp \markupsetcodequoteleft
-\let\markupsetuprqsamp \markupsetcodequoteright
-%
-\let\markupsetuplqverb \markupsetcodequoteleft
-\let\markupsetuprqverb \markupsetcodequoteright
-%
-\let\markupsetuplqverbatim \markupsetcodequoteleft
-\let\markupsetuprqverbatim \markupsetcodequoteright
-
 % Allow an option to not use regular directed right quote/apostrophe
 % (char 0x27), but instead the undirected quote from cmtt (char 0x0d).
 % The undirected quote is ugly, so don't make it the default, but it
@@ -2704,11 +2694,15 @@ end
 % lilypond developers report.  xpdf does work with the regular 0x27.
 %
 \def\codequoteright{%
-  \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
-    \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
-      '%
+  \ifmonospace
+    \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax
+      \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax
+        '%
+      \else \char'15 \fi
     \else \char'15 \fi
-  \else \char'15 \fi
+   \else
+     '%
+   \fi
 }
 %
 % and a similar option for the left quote char vs. a grave accent.
@@ -2716,17 +2710,21 @@ end
 % the code environments to do likewise.
 %
 \def\codequoteleft{%
-  \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
-    \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
-      % [Knuth] pp. 380,381,391
-      % \relax disables Spanish ligatures ?` and !` of \tt font.
-      \relax`%
+  \ifmonospace
+    \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax
+      \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax
+        % [Knuth] pp. 380,381,391
+        % \relax disables Spanish ligatures ?` and !` of \tt font.
+        \relax`%
+      \else \char'22 \fi
     \else \char'22 \fi
-  \else \char'22 \fi
+   \else
+     \relax`%
+   \fi
 }
 
 % Commands to set the quote options.
-% 
+%
 \parseargdef\codequoteundirected{%
   \def\temp{#1}%
   \ifx\temp\onword
@@ -2767,7 +2765,7 @@ end
 % If we are in a monospaced environment, however, 1) always use \ttsl,
 % and 2) do not add an italic correction.
 \def\dosmartslant#1#2{%
-  \ifusingtt 
+  \ifusingtt
     {{\ttsl #2}\let\next=\relax}%
     {\def\next{{#1#2}\futurelet\next\smartitaliccorrection}}%
   \next
@@ -2846,12 +2844,12 @@ end
 
 % @t, explicit typewriter.
 \def\t#1{%
-  {\tt \rawbackslash \plainfrenchspacing #1}%
+  {\tt \plainfrenchspacing #1}%
   \null
 }
 
 % @samp.
-\def\samp#1{{\setupmarkupstyle{samp}\lq\tclose{#1}\rq\null}}
+\def\samp#1{{\setcodequotes\lq\tclose{#1}\rq\null}}
 
 % @indicateurl is \samp, that is, with quotes.
 \let\indicateurl=\samp
@@ -2873,7 +2871,6 @@ end
     % Turn off hyphenation.
     \nohyphenation
     %
-    \rawbackslash
     \plainfrenchspacing
     #1%
   }%
@@ -2895,8 +2892,7 @@ end
   \global\let'=\rq \global\let`=\lq  % default definitions
   %
   \global\def\code{\begingroup
-    \setupmarkupstyle{code}%
-    % The following should really be moved into \setupmarkupstyle handlers.
+    \setcodequotes
     \catcode\dashChar=\active  \catcode\underChar=\active
     \ifallowcodebreaks
      \let-\codedash
@@ -2915,14 +2911,14 @@ end
   \gdef\codedash{\futurelet\next\codedashfinish}
   \gdef\codedashfinish{%
     \normaldash % always output the dash character itself.
-    % 
+    %
     % Now, output a discretionary to allow a line break, unless
     % (a) the next character is a -, or
     % (b) the preceding character is a -.
     % E.g., given --posix, we do not want to allow a break after either -.
     % Given --foo-bar, we do want to allow a break between the - and the b.
     \ifx\next\codedash \else
-      \ifx\codedashprev\codedash 
+      \ifx\codedashprev\codedash
       \else \discretionary{}{}{}\fi
     \fi
     % we need the space after the = for the case when \next itself is a
@@ -2984,10 +2980,18 @@ end
 % arg (if given), and not the url (which is then just the link target).
 \newif\ifurefurlonlylink
 
+% The default \pretolerance setting stops the penalty inserted in
+% \urefallowbreak being a discouragement to line breaking.  Set it to
+% a negative value for this paragraph only.  Hopefully this does not
+% conflict with redefinitions of \par done elsewhere.
+\def\nopretolerance{%
+\pretolerance=-1
+\def\par{\endgraf\pretolerance=100 \let\par\endgraf}%
+}
+
 % The main macro is \urefbreak, which allows breaking at expected
-% places within the url.  (There used to be another version, which
-% didn't support automatic breaking.)
-\def\urefbreak{\begingroup \urefcatcodes \dourefbreak}
+% places within the url.
+\def\urefbreak{\nopretolerance \begingroup \urefcatcodes \dourefbreak}
 \let\uref=\urefbreak
 %
 \def\dourefbreak#1{\urefbreakfinish #1,,,\finish}
@@ -3004,7 +3008,7 @@ end
         % For pdfTeX and LuaTeX
         \ifurefurlonlylink
           % PDF plus option to not display url, show just arg
-          \unhbox0             
+          \unhbox0
         \else
           % PDF, normally display both arg and url for consistency,
           % visibility, if the pdf is eventually used to print, etc.
@@ -3017,7 +3021,7 @@ end
           % For XeTeX
           \ifurefurlonlylink
             % PDF plus option to not display url, show just arg
-            \unhbox0             
+            \unhbox0
           \else
             % PDF, normally display both arg and url for consistency,
             % visibility, if the pdf is eventually used to print, etc.
@@ -3042,7 +3046,7 @@ end
   \urefcatcodes
   %
   \global\def\urefcode{\begingroup
-    \setupmarkupstyle{code}%
+    \setcodequotes
     \urefcatcodes
     \let&\urefcodeamp
     \let.\urefcodedot
@@ -3060,41 +3064,33 @@ end
   \global\def/{\normalslash}
 }
 
-% we put a little stretch before and after the breakable chars, to help
-% line breaking of long url's.  The unequal skips make look better in
-% cmtt at least, especially for dots.
-\def\urefprestretchamount{.13em}
-\def\urefpoststretchamount{.1em}
-\def\urefprestretch{\urefprebreak \hskip0pt plus\urefprestretchamount\relax}
-\def\urefpoststretch{\urefpostbreak \hskip0pt plus\urefprestretchamount\relax}
-%
-\def\urefcodeamp{\urefprestretch \&\urefpoststretch}
-\def\urefcodedot{\urefprestretch .\urefpoststretch}
-\def\urefcodehash{\urefprestretch \#\urefpoststretch}
-\def\urefcodequest{\urefprestretch ?\urefpoststretch}
+\def\urefcodeamp{\urefprebreak \&\urefpostbreak}
+\def\urefcodedot{\urefprebreak .\urefpostbreak}
+\def\urefcodehash{\urefprebreak \#\urefpostbreak}
+\def\urefcodequest{\urefprebreak ?\urefpostbreak}
 \def\urefcodeslash{\futurelet\next\urefcodeslashfinish}
 {
   \catcode`\/=\active
   \global\def\urefcodeslashfinish{%
-    \urefprestretch \slashChar
+    \urefprebreak \slashChar
     % Allow line break only after the final / in a sequence of
     % slashes, to avoid line break between the slashes in http://.
-    \ifx\next/\else \urefpoststretch \fi
+    \ifx\next/\else \urefpostbreak \fi
   }
 }
 
-% One more complication: by default we'll break after the special
-% characters, but some people like to break before the special chars, so
-% allow that.  Also allow no breaking at all, for manual control.
-% 
+% By default we'll break after the special characters, but some people like to
+% break before the special chars, so allow that.  Also allow no breaking at
+% all, for manual control.
+%
 \parseargdef\urefbreakstyle{%
   \def\txiarg{#1}%
   \ifx\txiarg\wordnone
     \def\urefprebreak{\nobreak}\def\urefpostbreak{\nobreak}
   \else\ifx\txiarg\wordbefore
-    \def\urefprebreak{\allowbreak}\def\urefpostbreak{\nobreak}
+    \def\urefprebreak{\urefallowbreak}\def\urefpostbreak{\nobreak}
   \else\ifx\txiarg\wordafter
-    \def\urefprebreak{\nobreak}\def\urefpostbreak{\allowbreak}
+    \def\urefprebreak{\nobreak}\def\urefpostbreak{\urefallowbreak}
   \else
     \errhelp = \EMsimple
     \errmessage{Unknown @urefbreakstyle setting `\txiarg'}%
@@ -3104,6 +3100,19 @@ end
 \def\wordbefore{before}
 \def\wordnone{none}
 
+% Allow a ragged right output to aid breaking long URL's.  There can
+% be a break at the \allowbreak with no extra glue (if the existing stretch in
+% the line is sufficient), a break at the \penalty with extra glue added
+% at the end of the line, or no break at all here.
+%   Changing the value of the penalty and/or the amount of stretch affects how
+% preferable one choice is over the other.
+\def\urefallowbreak{%
+  \penalty0\relax
+  \hskip 0pt plus 2 em\relax
+  \penalty1000\relax
+  \hskip 0pt plus -2 em\relax
+}
+
 \urefbreakstyle after
 
 % @url synonym for @uref, since that's how everyone uses it.
@@ -3114,7 +3123,7 @@ end
 % So now @email is just like @uref, unless we are pdf.
 %
 %\def\email#1{\angleleft{\tt #1}\angleright}
-\ifpdf
+\ifpdforxetex
   \def\email#1{\doemail#1,,\finish}
   \def\doemail#1,#2,#3\finish{\begingroup
     \unsepspaces
@@ -3124,18 +3133,7 @@ end
     \endlink
   \endgroup}
 \else
-  \ifx\XeTeXrevision\thisisundefined
-    \let\email=\uref
-  \else
-    \def\email#1{\doemail#1,,\finish}
-    \def\doemail#1,#2,#3\finish{\begingroup
-      \unsepspaces
-      \pdfurl{mailto:#1}%
-      \setbox0 = \hbox{\ignorespaces #2}%
-      \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi
-      \endlink
-    \endgroup}
-  \fi
+  \let\email=\uref
 \fi
 
 % @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always),
@@ -3169,8 +3167,8 @@ end
 \def\kbdsub#1#2#3\par{%
   \def\one{#1}\def\three{#3}\def\threex{??}%
   \ifx\one\xkey\ifx\threex\three \key{#2}%
-  \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
-  \else{\tclose{\kbdfont\setupmarkupstyle{kbd}\look}}\fi
+  \else{\tclose{\kbdfont\setcodequotes\look}}\fi
+  \else{\tclose{\kbdfont\setcodequotes\look}}\fi
 }
 
 % definition of @key that produces a lozenge.  Doesn't adjust to text size.
@@ -3187,7 +3185,7 @@ end
 % monospace, don't change it; that way, we respect @kbdinputstyle.  But
 % if it isn't monospace, then use \tt.
 %
-\def\key#1{{\setupmarkupstyle{key}%
+\def\key#1{{\setregularquotes
   \nohyphenation
   \ifmonospace\else\tt\fi
   #1}\null}
@@ -3308,10 +3306,33 @@ end
 \def\sup{\ifmmode \expandafter\ptexsp \else \expandafter\finishsup\fi}
 \def\finishsup#1{$\ptexsp{\hbox{\switchtolllsize #1}}$}%
 
+% provide this command from LaTeX as it is very common
+\def\frac#1#2{{{#1}\over{#2}}}
+
+% @displaymath.
+% \globaldefs is needed to recognize the end lines in \tex and
+% \end tex.  Set \thisenv as @end displaymath is seen before @end tex.
+{\obeylines
+\globaldefs=1
+\envdef\displaymath{%
+\tex%
+\def\thisenv{\displaymath}%
+\begingroup\let\end\displaymathend%
+$$%
+}
+
+\def\displaymathend{$$\endgroup\end}%
+
+\def\Edisplaymath{%
+\def\thisenv{\tex}%
+\end tex
+}}
+
+
 % @inlinefmt{FMTNAME,PROCESSED-TEXT} and @inlineraw{FMTNAME,RAW-TEXT}.
 % Ignore unless FMTNAME == tex; then it is like @iftex and @tex,
 % except specified as a normal braced arg, so no newlines to worry about.
-% 
+%
 \def\outfmtnametex{tex}
 %
 \long\def\inlinefmt#1{\doinlinefmt #1,\finish}
@@ -3319,7 +3340,7 @@ end
   \def\inlinefmtname{#1}%
   \ifx\inlinefmtname\outfmtnametex \ignorespaces #2\fi
 }
-% 
+%
 % @inlinefmtifelse{FMTNAME,THEN-TEXT,ELSE-TEXT} expands THEN-TEXT if
 % FMTNAME is tex, else ELSE-TEXT.
 \long\def\inlinefmtifelse#1{\doinlinefmtifelse #1,,,\finish}
@@ -3335,7 +3356,7 @@ end
 % *right* brace they would have to use a command anyway, so they may as
 % well use a command to get a left brace too.  We could re-use the
 % delimiter character idea from \verb, but it seems like overkill.
-% 
+%
 \long\def\inlineraw{\tex \doinlineraw}
 \long\def\doinlineraw#1{\doinlinerawtwo #1,\finish}
 \def\doinlinerawtwo#1,#2,\finish{%
@@ -3512,7 +3533,7 @@ end
 
 % @pounds{} is a sterling sign, which Knuth put in the CM italic font.
 %
-\def\pounds{{\it\$}}
+\def\pounds{\ifmonospace{\ecfont\char"BF}\else{\it\$}\fi}
 
 % @euro{} comes from a separate font, depending on the current style.
 % We use the free feym* fonts from the eurosym package by Henrik
@@ -3612,7 +3633,7 @@ end
 % for non-CM glyphs.  That is ec* for regular text and tc* for the text
 % companion symbols (LaTeX TS1 encoding).  Both are part of the ec
 % package and follow the same conventions.
-% 
+%
 \def\ecfont{\etcfont{e}}
 \def\tcfont{\etcfont{t}}
 %
@@ -3661,11 +3682,19 @@ end
 \fi
 
 % Quotes.
-\chardef\quotedblleft="5C
-\chardef\quotedblright=`\"
 \chardef\quoteleft=`\`
 \chardef\quoteright=`\'
 
+% only change font for tt for correct kerning and to avoid using
+% \ecfont unless necessary.
+\def\quotedblleft{%
+  \ifmonospace{\ecfont\char"10}\else{\char"5C}\fi
+}
+
+\def\quotedblright{%
+  \ifmonospace{\ecfont\char"11}\else{\char`\"}\fi
+}
+
 
 \message{page headings,}
 
@@ -3684,7 +3713,7 @@ end
               after the title page.}}%
 \def\setshortcontentsaftertitlepage{%
   \errmessage{@setshortcontentsaftertitlepage has been removed as a Texinfo
-              command; move your @shortcontents and @contents commands if you 
+              command; move your @shortcontents and @contents commands if you
               want the contents after the title page.}}%
 
 \parseargdef\shorttitlepage{%
@@ -3739,7 +3768,7 @@ end
 % don't worry much about spacing, ragged right.  This should be used
 % inside a \vbox, and fonts need to be set appropriately first. \par should
 % be specified before the end of the \vbox, since a vbox is a group.
-% 
+%
 \def\raggedtitlesettings{%
   \rm
   \hyphenpenalty=10000
@@ -3787,12 +3816,19 @@ end
 
 \newtoks\evenheadline    % headline on even pages
 \newtoks\oddheadline     % headline on odd pages
+\newtoks\evenchapheadline% headline on even pages with a new chapter
+\newtoks\oddchapheadline % headline on odd pages with a new chapter
 \newtoks\evenfootline    % footline on even pages
 \newtoks\oddfootline     % footline on odd pages
 
 % Now make \makeheadline and \makefootline in Plain TeX use those variables
-\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline
-                            \else \the\evenheadline \fi}}
+\headline={{\textfonts\rm
+            \ifchapterpage
+              \ifodd\pageno\the\oddchapheadline\else\the\evenchapheadline\fi
+            \else
+              \ifodd\pageno\the\oddheadline\else\the\evenheadline\fi
+            \fi}}
+
 \footline={{\textfonts\rm \ifodd\pageno \the\oddfootline
                             \else \the\evenfootline \fi}\HEADINGShook}
 \let\HEADINGShook=\relax
@@ -3808,12 +3844,14 @@ end
 \def\evenheading{\parsearg\evenheadingxxx}
 \def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish}
 \def\evenheadingyyy #1\|#2\|#3\|#4\finish{%
-\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+  \global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}
+  \global\evenchapheadline=\evenheadline}
 
 \def\oddheading{\parsearg\oddheadingxxx}
 \def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish}
 \def\oddheadingyyy #1\|#2\|#3\|#4\finish{%
-\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}}
+  \global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}%
+  \global\oddchapheadline=\oddheadline}
 
 \parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}%
 
@@ -3880,37 +3918,34 @@ end
 \parseargdef\headings{\csname HEADINGS#1\endcsname}
 
 \def\headingsoff{% non-global headings elimination
-  \evenheadline={\hfil}\evenfootline={\hfil}%
-   \oddheadline={\hfil}\oddfootline={\hfil}%
+  \evenheadline={\hfil}\evenfootline={\hfil}\evenchapheadline={\hfil}%
+   \oddheadline={\hfil}\oddfootline={\hfil}\oddchapheadline={\hfil}%
 }
 
 \def\HEADINGSoff{{\globaldefs=1 \headingsoff}} % global setting
 \HEADINGSoff  % it's the default
 
 % When we turn headings on, set the page number to 1.
+\def\pageone{
+  \global\pageno=1
+  \global\arabiccount = \pagecount
+}
+
 % For double-sided printing, put current file name in lower left corner,
 % chapter name on inside top of right hand pages, document
 % title on inside top of left hand pages, and page numbers on outside top
 % edge of all pages.
 \def\HEADINGSdouble{%
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapterheading\hfil\folio}}
-\global\let\contentsalignmacro = \chapoddpage
+\pageone
+\HEADINGSdoublex
 }
 \let\contentsalignmacro = \chappager
 
 % For single-sided printing, chapter title goes across top left of page,
 % page number on top right.
 \def\HEADINGSsingle{%
-\global\pageno=1
-\global\evenfootline={\hfil}
-\global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapterheading\hfil\folio}}
-\global\oddheadline={\line{\thischapterheading\hfil\folio}}
-\global\let\contentsalignmacro = \chappager
+\pageone
+\HEADINGSsinglex
 }
 \def\HEADINGSon{\HEADINGSdouble}
 
@@ -3920,7 +3955,9 @@ end
 \global\evenfootline={\hfil}
 \global\oddfootline={\hfil}
 \global\evenheadline={\line{\folio\hfil\thistitle}}
-\global\oddheadline={\line{\thischapterheading\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\evenchapheadline={\line{\folio\hfil}}
+\global\oddchapheadline={\line{\hfil\folio}}
 \global\let\contentsalignmacro = \chapoddpage
 }
 
@@ -3928,8 +3965,22 @@ end
 \def\HEADINGSsinglex{%
 \global\evenfootline={\hfil}
 \global\oddfootline={\hfil}
-\global\evenheadline={\line{\thischapterheading\hfil\folio}}
-\global\oddheadline={\line{\thischapterheading\hfil\folio}}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\evenchapheadline={\line{\hfil\folio}}
+\global\oddchapheadline={\line{\hfil\folio}}
+\global\let\contentsalignmacro = \chappager
+}
+
+% for @setchapternewpage off
+\def\HEADINGSsinglechapoff{%
+\pageone
+\global\evenfootline={\hfil}
+\global\oddfootline={\hfil}
+\global\evenheadline={\line{\thischapter\hfil\folio}}
+\global\oddheadline={\line{\thischapter\hfil\folio}}
+\global\evenchapheadline=\evenheadline
+\global\oddchapheadline=\oddheadline
 \global\let\contentsalignmacro = \chappager
 }
 
@@ -4362,7 +4413,7 @@ end
 }
 
 % multitable-only commands.
-% 
+%
 % @headitem starts a heading row, which we typeset in bold.  Assignments
 % have to be global since we are inside the implicit group of an
 % alignment entry.  \everycr below resets \everytab so we don't have to
@@ -4669,19 +4720,6 @@ end
   }
 }
 
-% We have this subroutine so that we can handle at least some @value's
-% properly in indexes (we call \makevalueexpandable in \indexdummies).
-% The command has to be fully expandable (if the variable is set), since
-% the result winds up in the index file.  This means that if the
-% variable's value contains other Texinfo commands, it's almost certain
-% it will fail (although perhaps we could fix that with sufficient work
-% to do a one-level expansion on the result, instead of complete).
-% 
-% Unfortunately, this has the consequence that when _ is in the *value*
-% of an @set, it does not print properly in the roman fonts (get the cmr
-% dot accent at position 126 instead).  No fix comes to mind, and it's
-% been this way since 2003 or earlier, so just ignore it.
-% 
 \def\expandablevalue#1{%
   \expandafter\ifx\csname SET#1\endcsname\relax
     {[No value for ``#1'']}%
@@ -4694,13 +4732,13 @@ end
 % Like \expandablevalue, but completely expandable (the \message in the
 % definition above operates at the execution level of TeX).  Used when
 % writing to auxiliary files, due to the expansion that \write does.
-% If flag is undefined, pass through an unexpanded @value command: maybe it 
+% If flag is undefined, pass through an unexpanded @value command: maybe it
 % will be set by the time it is read back in.
 %
 % NB flag names containing - or _ may not work here.
 \def\dummyvalue#1{%
   \expandafter\ifx\csname SET#1\endcsname\relax
-    \noexpand\value{#1}%
+    \string\value{#1}%
   \else
     \csname SET#1\endcsname
   \fi
@@ -4710,7 +4748,7 @@ end
 % if possible, otherwise sort late.
 \def\indexnofontsvalue#1{%
   \expandafter\ifx\csname SET#1\endcsname\relax
-    ZZZZZZZ
+    ZZZZZZZ%
   \else
     \csname SET#1\endcsname
   \fi
@@ -4718,7 +4756,7 @@ end
 
 % @ifset VAR ... @end ifset reads the `...' iff VAR has been defined
 % with @set.
-% 
+%
 % To get the special treatment we need for `@end ifset,' we call
 % \makecond and then redefine.
 %
@@ -4751,7 +4789,7 @@ end
 % without the @) is in fact defined.  We can only feasibly check at the
 % TeX level, so something like `mathcode' is going to considered
 % defined even though it is not a Texinfo command.
-% 
+%
 \makecond{ifcommanddefined}
 \def\ifcommanddefined{\parsearg{\doifcmddefined{\let\next=\ifcmddefinedfail}}}
 %
@@ -4857,32 +4895,18 @@ end
 
 % like the previous two, but they put @code around the argument.
 \def\docodeindex#1{\edef\indexname{#1}\parsearg\docodeindexxxx}
-\def\docodeindexxxx #1{\doind{\indexname}{\code{#1}}}
+\def\docodeindexxxx #1{\docind{\indexname}{#1}}
 
-\f
-% Used when writing an index entry out to an index file to prevent
-% expansion of Texinfo commands that can appear in an index entry.
-%
-\def\indexdummies{%
-  \escapechar = `\\     % use backslash in output files.
-  \definedummyletter\@%
-  \definedummyletter\ %
-  %
-  % For texindex which always views { and } as separators.
-  \def\{{\lbracechar{}}%
-  \def\}{\rbracechar{}}%
-  %
-  % Do the redefinitions.
-  \definedummies
-}
 
-% Used for the aux and toc files, where @ is the escape character.
+% Used for the aux, toc and index files to prevent expansion of Texinfo
+% commands.
 %
 \def\atdummies{%
   \definedummyletter\@%
   \definedummyletter\ %
   \definedummyletter\{%
   \definedummyletter\}%
+  \definedummyletter\&%
   %
   % Do the redefinitions.
   \definedummies
@@ -4906,8 +4930,7 @@ end
 \def\definedummyletter#1{\def#1{\string#1}}%
 \let\definedummyaccent\definedummyletter
 
-% Called from \indexdummies and \atdummies, to effectively prevent
-% the expansion of commands.
+% Called from \atdummies to prevent the expansion of commands.
 %
 \def\definedummies{%
   %
@@ -4954,8 +4977,10 @@ end
   \definedummyword\TeX
   %
   % Assorted special characters.
+  \definedummyword\ampchar
   \definedummyword\atchar
   \definedummyword\arrow
+  \definedummyword\backslashchar
   \definedummyword\bullet
   \definedummyword\comma
   \definedummyword\copyright
@@ -4992,6 +5017,8 @@ end
   \definedummyword\sup
   \definedummyword\textdegree
   %
+  \definedummyword\subentry
+  %
   % We want to disable all macros so that they are not expanded by \write.
   \macrolist
   \let\value\dummyvalue
@@ -5072,11 +5099,10 @@ end
   \commondummyword\xref
 }
 
-% For testing: output @{ and @} in index sort strings as \{ and \}.
-\newif\ifusebracesinindexes
-
 \let\indexlbrace\relax
 \let\indexrbrace\relax
+\let\indexatchar\relax
+\let\indexbackslash\relax
 
 {\catcode`\@=0
 \catcode`\\=13
@@ -5110,10 +5136,8 @@ end
   }
 
   \gdef\indexnonalnumreappear{%
-    \useindexbackslash
     \let-\normaldash
     \let<\normalless
-    \def\@{@}%
   }
 }
 
@@ -5147,64 +5171,66 @@ end
   \let\lbracechar\{%
   \let\rbracechar\}%
   %
+  %
+  \let\do\indexnofontsdef
+  %
   % Non-English letters.
-  \def\AA{AA}%
-  \def\AE{AE}%
-  \def\DH{DZZ}%
-  \def\L{L}%
-  \def\OE{OE}%
-  \def\O{O}%
-  \def\TH{TH}%
-  \def\aa{aa}%
-  \def\ae{ae}%
-  \def\dh{dzz}%
-  \def\exclamdown{!}%
-  \def\l{l}%
-  \def\oe{oe}%
-  \def\ordf{a}%
-  \def\ordm{o}%
-  \def\o{o}%
-  \def\questiondown{?}%
-  \def\ss{ss}%
-  \def\th{th}%
-  %
-  \def\LaTeX{LaTeX}%
-  \def\TeX{TeX}%
-  %
-  % Assorted special characters.  \defglyph gives the control sequence a
-  % definition that removes the {} that follows its use.
-  \defglyph\atchar{@}%
-  \defglyph\arrow{->}%
-  \defglyph\bullet{bullet}%
-  \defglyph\comma{,}%
-  \defglyph\copyright{copyright}%
-  \defglyph\dots{...}%
-  \defglyph\enddots{...}%
-  \defglyph\equiv{==}%
-  \defglyph\error{error}%
-  \defglyph\euro{euro}%
-  \defglyph\expansion{==>}%
-  \defglyph\geq{>=}%
-  \defglyph\guillemetleft{<<}%
-  \defglyph\guillemetright{>>}%
-  \defglyph\guilsinglleft{<}%
-  \defglyph\guilsinglright{>}%
-  \defglyph\leq{<=}%
-  \defglyph\lbracechar{\{}%
-  \defglyph\minus{-}%
-  \defglyph\point{.}%
-  \defglyph\pounds{pounds}%
-  \defglyph\print{-|}%
-  \defglyph\quotedblbase{"}%
-  \defglyph\quotedblleft{"}%
-  \defglyph\quotedblright{"}%
-  \defglyph\quoteleft{`}%
-  \defglyph\quoteright{'}%
-  \defglyph\quotesinglbase{,}%
-  \defglyph\rbracechar{\}}%
-  \defglyph\registeredsymbol{R}%
-  \defglyph\result{=>}%
-  \defglyph\textdegree{o}%
+  \do\AA{AA}%
+  \do\AE{AE}%
+  \do\DH{DZZ}%
+  \do\L{L}%
+  \do\OE{OE}%
+  \do\O{O}%
+  \do\TH{TH}%
+  \do\aa{aa}%
+  \do\ae{ae}%
+  \do\dh{dzz}%
+  \do\exclamdown{!}%
+  \do\l{l}%
+  \do\oe{oe}%
+  \do\ordf{a}%
+  \do\ordm{o}%
+  \do\o{o}%
+  \do\questiondown{?}%
+  \do\ss{ss}%
+  \do\th{th}%
+  %
+  \do\LaTeX{LaTeX}%
+  \do\TeX{TeX}%
+  %
+  % Assorted special characters.
+  \do\atchar{@}%
+  \do\arrow{->}%
+  \do\bullet{bullet}%
+  \do\comma{,}%
+  \do\copyright{copyright}%
+  \do\dots{...}%
+  \do\enddots{...}%
+  \do\equiv{==}%
+  \do\error{error}%
+  \do\euro{euro}%
+  \do\expansion{==>}%
+  \do\geq{>=}%
+  \do\guillemetleft{<<}%
+  \do\guillemetright{>>}%
+  \do\guilsinglleft{<}%
+  \do\guilsinglright{>}%
+  \do\leq{<=}%
+  \do\lbracechar{\{}%
+  \do\minus{-}%
+  \do\point{.}%
+  \do\pounds{pounds}%
+  \do\print{-|}%
+  \do\quotedblbase{"}%
+  \do\quotedblleft{"}%
+  \do\quotedblright{"}%
+  \do\quoteleft{`}%
+  \do\quoteright{'}%
+  \do\quotesinglbase{,}%
+  \do\rbracechar{\}}%
+  \do\registeredsymbol{R}%
+  \do\result{=>}%
+  \do\textdegree{o}%
   %
   % We need to get rid of all macros, leaving only the arguments (if present).
   % Of course this is not nearly correct, but it is the best we can do for now.
@@ -5219,41 +5245,38 @@ end
   \macrolist
   \let\value\indexnofontsvalue
 }
-\def\defglyph#1#2{\def#1##1{#2}} % see above
 
-\f
+% Give the control sequence a definition that removes the {} that follows
+% its use, e.g. @AA{} -> AA
+\def\indexnofontsdef#1#2{\def#1##1{#2}}%
 
 
-\let\SETmarginindex=\relax % put index entries in margin (undocumented)?
 
-% Most index entries go through here, but \dosubind is the general case.
-% #1 is the index name, #2 is the entry text.
-\def\doind#1#2{\dosubind{#1}{#2}{}}
 
-% There is also \dosubind {index}{topic}{subtopic}
-% which makes an entry in a two-level index such as the operation index.
-% TODO: Two-level index?  Operation index?
-
-% Workhorse for all indexes.
-% #1 is name of index, #2 is stuff to put there, #3 is subentry --
-% empty if called from \doind, as we usually are (the main exception
-% is with most defuns, which call us directly).
-%
-\def\dosubind#1#2#3{%
+% #1 is the index name, #2 is the entry text.
+\def\doind#1#2{%
   \iflinks
   {%
+    %
     \requireopenindexfile{#1}%
-    % Store the main index entry text (including the third arg).
-    \toks0 = {#2}%
-    % If third arg is present, precede it with a space.
-    \def\thirdarg{#3}%
-    \ifx\thirdarg\empty \else
-      \toks0 = \expandafter{\the\toks0 \space #3}%
-    \fi
+    \edef\writeto{\csname#1indfile\endcsname}%
     %
+    \def\indextext{#2}%
+    \safewhatsit\doindwrite
+  }%
+  \fi
+}
+
+% Same as \doind, but for code indices
+\def\docind#1#2{%
+  \iflinks
+  {%
+    %
+    \requireopenindexfile{#1}%
     \edef\writeto{\csname#1indfile\endcsname}%
     %
-    \safewhatsit\dosubindwrite
+    \def\indextext{#2}%
+    \safewhatsit\docindwrite
   }%
   \fi
 }
@@ -5268,28 +5291,14 @@ end
   \ifx\suffix\indexisfl\def\suffix{f1}\fi
   % Open the file
   \immediate\openout\csname#1indfile\endcsname \jobname.\suffix
-  % Using \immediate above here prevents an object entering into the current 
+  % Using \immediate above here prevents an object entering into the current
   % box, which could confound checks such as those in \safewhatsit for
   % preceding skips.
   \typeout{Writing index file \jobname.\suffix}%
 \fi}
 \def\indexisfl{fl}
 
-% Output \ as {\indexbackslash}, because \ is an escape character in
-% the index files.
-\let\indexbackslash=\relax
-{\catcode`\@=0 \catcode`\\=\active
-  @gdef@useindexbackslash{@def\{{@indexbackslash}}}
-}
-
-% Definition for writing index entry text.
-\def\sortas#1{\ignorespaces}%
-
-% Definition for writing index entry sort key.  Should occur at the at
-% the beginning of the index entry, like
-%     @cindex @sortas{september} \september
-% The \ignorespaces takes care of following space, but there's no way
-% to remove space before it.
+% Definition for writing index entry sort key.
 {
 \catcode`\-=13
 \gdef\indexwritesortas{%
@@ -5300,51 +5309,158 @@ end
   \xdef\indexsortkey{#1}\endgroup}
 }
 
+\def\indexwriteseealso#1{
+  \gdef\pagenumbertext{\string\seealso{#1}}%
+}
+\def\indexwriteseeentry#1{
+  \gdef\pagenumbertext{\string\seeentry{#1}}%
+}
 
-% Write the entry in \toks0 to the index file.
+% The default definitions
+\def\sortas#1{}%
+\def\seealso#1{\i{\putwordSeeAlso}\ #1}% for sorted index file only
+\def\putwordSeeAlso{See also}
+\def\seeentry#1{\i{\putwordSee}\ #1}% for sorted index file only
+
+
+% Given index entry text like "aaa @subentry bbb @sortas{ZZZ}":
+%   * Set \bracedtext to "{aaa}{bbb}"
+%   * Set \fullindexsortkey to "aaa @subentry ZZZ"
+%   * If @seealso occurs, set \pagenumbertext
 %
-\def\dosubindwrite{%
-  % Put the index entry in the margin if desired.
-  \ifx\SETmarginindex\relax\else
-    \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}%
+\def\splitindexentry#1{%
+  \gdef\fullindexsortkey{}%
+  \xdef\bracedtext{}%
+  \def\sep{}%
+  \def\seealso##1{}%
+  \def\seeentry##1{}%
+  \expandafter\doindexsegment#1\subentry\finish\subentry
+}
+
+% append the results from the next segment
+\def\doindexsegment#1\subentry{%
+  \def\segment{#1}%
+  \ifx\segment\isfinish
+  \else
+    %
+    % Fully expand the segment, throwing away any @sortas directives, and
+    % trim spaces.
+    \edef\trimmed{\segment}%
+    \edef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
+    \ifincodeindex
+      \edef\trimmed{\noexpand\code{\trimmed}}%
+    \fi
+    %
+    \xdef\bracedtext{\bracedtext{\trimmed}}%
+    %
+    % Get the string to sort by.  Process the segment with all
+    % font commands turned off.
+    \bgroup
+      \let\sortas\indexwritesortas
+      \let\seealso\indexwriteseealso
+      \let\seeentry\indexwriteseeentry
+      \indexnofonts
+      % The braces around the commands are recognized by texindex.
+      \def\lbracechar{{\string\indexlbrace}}%
+      \def\rbracechar{{\string\indexrbrace}}%
+      \let\{=\lbracechar
+      \let\}=\rbracechar
+      \def\@{{\string\indexatchar}}%
+      \def\atchar##1{\@}%
+      \def\backslashchar{{\string\indexbackslash}}%
+      \uccode`\~=`\\ \uppercase{\let~\backslashchar}%
+      %
+      \let\indexsortkey\empty
+      \global\let\pagenumbertext\empty
+      % Execute the segment and throw away the typeset output.  This executes
+      % any @sortas or @seealso commands in this segment.
+      \setbox\dummybox = \hbox{\segment}%
+      \ifx\indexsortkey\empty{%
+        \indexnonalnumdisappear
+        \xdef\trimmed{\segment}%
+        \xdef\trimmed{\expandafter\eatspaces\expandafter{\trimmed}}%
+        \xdef\indexsortkey{\trimmed}%
+        \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
+      }\fi
+      %
+      % Append to \fullindexsortkey.
+      \edef\tmp{\gdef\noexpand\fullindexsortkey{%
+                  \fullindexsortkey\sep\indexsortkey}}%
+      \tmp
+    \egroup
+    \def\sep{\subentry}%
+    %
+    \expandafter\doindexsegment
   \fi
+}
+\def\isfinish{\finish}%
+\newbox\dummybox % used above
+
+\let\subentry\relax
+
+% Use \ instead of @ in index files.  To support old texi2dvi and texindex.
+% This works without changing the escape character used in the toc or aux
+% files because the index entries are fully expanded here, and \string uses
+% the current value of \escapechar.
+\def\escapeisbackslash{\escapechar=`\\}
+
+% Use \ in index files by default.  texi2dvi didn't support @ as the escape
+% character (as it checked for "\entry" in the files, and not "@entry").  When
+% the new version of texi2dvi has had a chance to become more prevalent, then
+% the escape character can change back to @ again.  This should be an easy
+% change to make now because both @ and \ are only used as escape characters in
+% index files, never standing for themselves.
+%
+\set txiindexescapeisbackslash
+
+% Write the entry in \indextext to the index file.
+%
+
+\newif\ifincodeindex
+\def\doindwrite{\incodeindexfalse\doindwritex}
+\def\docindwrite{\incodeindextrue\doindwritex}
+
+\def\doindwritex{%
+  \maybemarginindex
   %
-  % Remember, we are within a group.
-  \indexdummies % Must do this here, since \bf, etc expand at this stage
-  \useindexbackslash % \indexbackslash isn't defined now so it will be output 
-                     % as is; and it will print as backslash.
-  % The braces around \indexbrace are recognized by texindex.
-  %
-  % Get the string to sort by, by processing the index entry with all
-  % font commands turned off.
-  {\indexnofonts
-   \def\lbracechar{{\indexlbrace}}%
-   \def\rbracechar{{\indexrbrace}}%
-   \let\{=\lbracechar
-   \let\}=\rbracechar
-   \indexnonalnumdisappear
-   \xdef\indexsortkey{}%
-   \let\sortas=\indexwritesortas
-   \edef\temp{\the\toks0}%
-   \setbox\dummybox = \hbox{\temp}% Make sure to execute any \sortas
-   \ifx\indexsortkey\empty
-     \xdef\indexsortkey{\temp}%
-     \ifx\indexsortkey\empty\xdef\indexsortkey{ }\fi
-   \fi
-  }%
+  \atdummies
+  %
+  \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax\else
+    \escapeisbackslash
+  \fi
+  %
+  % For texindex which always views { and } as separators.
+  \def\{{\lbracechar{}}%
+  \def\}{\rbracechar{}}%
+  \uccode`\~=`\\ \uppercase{\def~{\backslashchar{}}}%
+  %
+  % Split the entry into primary entry and any subentries, and get the index
+  % sort key.
+  \splitindexentry\indextext
   %
   % Set up the complete index entry, with both the sort key and
   % the original text, including any font commands.  We write
   % three arguments to \entry to the .?? file (four in the
   % subentry case), texindex reduces to two when writing the .??s
   % sorted result.
+  %
   \edef\temp{%
     \write\writeto{%
-      \string\entry{\indexsortkey}{\noexpand\folio}{\the\toks0}}%
+      \string\entry{\fullindexsortkey}%
+        {\ifx\pagenumbertext\empty\noexpand\folio\else\pagenumbertext\fi}%
+        \bracedtext}%
   }%
   \temp
 }
-\newbox\dummybox % used above
+
+% Put the index entry in the margin if desired (undocumented).
+\def\maybemarginindex{%
+  \ifx\SETmarginindex\relax\else
+    \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \relax\indextext}}%
+  \fi
+}
+\let\SETmarginindex=\relax
+
 
 % Take care of unwanted page breaks/skips around a whatsit:
 %
@@ -5432,9 +5548,14 @@ end
 %  \entry {topic}{pagelist}
 %     for a topic that is used without subtopics
 %  \primary {topic}
+%  \entry {topic}{}
 %     for the beginning of a topic that is used with subtopics
 %  \secondary {subtopic}{pagelist}
 %     for each subtopic.
+%  \secondary {subtopic}{}
+%     for a subtopic with sub-subtopics
+%  \tertiary {subtopic}{subsubtopic}{pagelist}
+%     for each sub-subtopic.
 
 % Define the user-accessible indexing commands
 % @findex, @vindex, @kindex, @cindex.
@@ -5446,11 +5567,6 @@ end
 \def\tindex {\tpindex}
 \def\pindex {\pgindex}
 
-\def\cindexsub {\begingroup\obeylines\cindexsub}
-{\obeylines %
-\gdef\cindexsub "#1" #2^^M{\endgroup %
-\dosubind{cp}{#2}{#1}}}
-
 % Define the macros used in formatting output of the sorted index material.
 
 % @printindex causes a particular index (the ??s file) to get printed.
@@ -5464,14 +5580,10 @@ end
   \plainfrenchspacing
   \everypar = {}% don't want the \kern\-parindent from indentation suppression.
   %
-  % See if the index file exists and is nonempty.
-  % Change catcode of @ here so that if the index file contains
-  % \initial {@}
-  % as its first line, TeX doesn't complain about mismatched braces
-  % (because it thinks @} is a control sequence).
-  \catcode`\@ = 12
   % See comment in \requireopenindexfile.
   \def\indexname{#1}\ifx\indexname\indexisfl\def\indexname{f1}\fi
+  %
+  % See if the index file exists and is nonempty.
   \openin 1 \jobname.\indexname s
   \ifeof 1
     % \enddoublecolumns gets confused if there is no text in the index,
@@ -5481,8 +5593,6 @@ end
     \putwordIndexNonexistent
     \typeout{No file \jobname.\indexname s.}%
   \else
-    \catcode`\\ = 0
-    %
     % If the index file exists but is empty, then \openin leaves \ifeof
     % false.  We have to make TeX try to read something from the file, so
     % it can discover if there is anything in it.
@@ -5490,41 +5600,55 @@ end
     \ifeof 1
       \putwordIndexIsEmpty
     \else
-      % Index files are almost Texinfo source, but we use \ as the escape
-      % character.  It would be better to use @, but that's too big a change
-      % to make right now.
-      \def\indexbackslash{\ttbackslash}%
-      \let\indexlbrace\{   % Likewise, set these sequences for braces
-      \let\indexrbrace\}   % used in the sort key.
-      \begindoublecolumns
-      \let\entrywidowpenalty=\indexwidowpenalty
-      %
-      % Read input from the index file line by line.
-      \loopdo
-        \ifeof1
-          \let\firsttoken\relax
-        \else
-          \read 1 to \nextline
-          \edef\act{\gdef\noexpand\firsttoken{\getfirsttoken\nextline}}%
-          \act
-        \fi
-        \thisline
-        %
-        \ifeof1\else
-        \let\thisline\nextline
-      \repeat
-      %%
-      \enddoublecolumns
+      \expandafter\printindexzz\thisline\relax\relax\finish%
     \fi
   \fi
   \closein 1
 \endgroup}
 
-\def\getfirsttoken#1{\expandafter\getfirsttokenx#1\endfirsttoken}
-\long\def\getfirsttokenx#1#2\endfirsttoken{\noexpand#1}
-
-\def\loopdo#1\repeat{\def\body{#1}\loopdoxxx}
-\def\loopdoxxx{\let\next=\relax\body\let\next=\loopdoxxx\fi\next}
+% If the index file starts with a backslash, forgo reading the index
+% file altogether.  If somebody upgrades texinfo.tex they may still have
+% old index files using \ as the escape character.  Reading this would
+% at best lead to typesetting garbage, at worst a TeX syntax error.
+\def\printindexzz#1#2\finish{%
+  \expandafter\ifx\csname SETtxiindexescapeisbackslash\endcsname\relax
+    \uccode`\~=`\\ \uppercase{\if\noexpand~}\noexpand#1
+      \expandafter\ifx\csname SETtxiskipindexfileswithbackslash\endcsname\relax
+\errmessage{%
+ERROR: A sorted index file in an obsolete format was skipped.
+To fix this problem, please upgrade your version of 'texi2dvi'
+or 'texi2pdf' to that at <https://ftp.gnu.org/gnu/texinfo>.
+If you are using an old version of 'texindex' (part of the Texinfo
+distribution), you may also need to upgrade to a newer version (at least 6.0).
+You may be able to typeset the index if you run
+'texindex \jobname.\indexname' yourself.
+You could also try setting the 'txiindexescapeisbackslash' flag by
+running a command like
+'texi2dvi -t "@set txiindexescapeisbackslash" \jobname.texi'.  If you do
+this, Texinfo will try to use index files in the old format.
+If you continue to have problems, deleting the index files and starting again
+might help (with 'rm \jobname.?? \jobname.??s')%
+}%
+      \else
+        (Skipped sorted index file in obsolete format)
+      \fi
+    \else
+      \begindoublecolumns
+      \input \jobname.\indexname s
+      \enddoublecolumns
+    \fi
+  \else
+    \begindoublecolumns
+    \catcode`\\=0\relax
+    %
+    % Make @ an escape character to give macros a chance to work.  This
+    % should work because we (hopefully) don't otherwise use @ in index files.
+    %\catcode`\@=12\relax
+    \catcode`\@=0\relax
+    \input \jobname.\indexname s
+    \enddoublecolumns
+  \fi
+}
 
 % These macros are used by the sorted index file itself.
 % Change them to control the appearance of the index.
@@ -5533,12 +5657,19 @@ end
 \catcode`\|=13 \catcode`\<=13 \catcode`\>=13 \catcode`\+=13 \catcode`\"=13
 \catcode`\$=3
 \gdef\initialglyphs{%
+  % special control sequences used in the index sort key
+  \let\indexlbrace\{%
+  \let\indexrbrace\}%
+  \let\indexatchar\@%
+  \def\indexbackslash{\math{\backslash}}%
+  %
   % Some changes for non-alphabetic characters.  Using the glyphs from the
   % math fonts looks more consistent than the typewriter font used elsewhere
   % for these characters.
-  \def\indexbackslash{\math{\backslash}}%
-  \let\\=\indexbackslash
+  \uccode`\~=`\\ \uppercase{\def~{\math{\backslash}}}
   %
+  % In case @\ is used for backslash
+  \uppercase{\let\\=~}
   % Can't get bold backslash so don't use bold forward slash
   \catcode`\/=13
   \def/{{\secrmnotbold \normalslash}}%
@@ -5568,7 +5699,7 @@ end
   % bottom of a column to reduce an increase in inter-line spacing.
   \nobreak
   \vskip 0pt plus 5\baselineskip
-  \penalty -300 
+  \penalty -300
   \vskip 0pt plus -5\baselineskip
   %
   % Typeset the initial.  Making this add up to a whole number of
@@ -5598,12 +5729,6 @@ end
 \def\entry{%
   \begingroup
     %
-    % For pdfTeX and XeTeX.
-    % The redefinition of \domark stops marks being added in \pdflink to 
-    % preserve coloured links across page boundaries.  Otherwise the marks
-    % would get in the way of \lastbox in \insertindexentrybox.
-    \let\domark\relax
-    %
     % Start a new paragraph if necessary, so our assignments below can't
     % affect previous text.
     \par
@@ -5636,35 +5761,31 @@ end
 \gdef\finishentry#1{%
     \egroup % end box A
     \dimen@ = \wd\boxA % Length of text of entry
-    \global\setbox\boxA=\hbox\bgroup\unhbox\boxA
-    % #1 is the page number.
-    %
-    % Get the width of the page numbers, and only use
-    % leaders if they are present.
-    \global\setbox\boxB = \hbox{#1}%
-    \ifdim\wd\boxB = 0pt
-      \null\nobreak\hfill\ %
-    \else
-      %
-      \null\nobreak\indexdotfill % Have leaders before the page number.
+    \global\setbox\boxA=\hbox\bgroup
+      \unhbox\boxA
+      % #1 is the page number.
       %
-      \ifpdf
-        \pdfgettoks#1.%
-        \hskip\skip\thinshrinkable\the\toksA
+      % Get the width of the page numbers, and only use
+      % leaders if they are present.
+      \global\setbox\boxB = \hbox{#1}%
+      \ifdim\wd\boxB = 0pt
+        \null\nobreak\hfill\ %
       \else
-        \ifx\XeTeXrevision\thisisundefined
-          \hskip\skip\thinshrinkable #1%
-        \else
+        %
+        \null\nobreak\indexdotfill % Have leaders before the page number.
+        %
+        \ifpdforxetex
           \pdfgettoks#1.%
           \hskip\skip\thinshrinkable\the\toksA
+        \else
+          \hskip\skip\thinshrinkable #1%
         \fi
       \fi
-    \fi
     \egroup % end \boxA
     \ifdim\wd\boxB = 0pt
-      \global\setbox\entryindexbox=\vbox{\unhbox\boxA}%
-    \else
-    \global\setbox\entryindexbox=\vbox\bgroup
+      \noindent\unhbox\boxA\par
+      \nobreak
+    \else\bgroup
       % We want the text of the entries to be aligned to the left, and the
       % page numbers to be aligned to the right.
       %
@@ -5694,10 +5815,13 @@ end
       \advance\dimen@ii by 1\dimen@i
       \ifdim\wd\boxA > \dimen@ii % If the entry doesn't fit in one line
       \ifdim\dimen@ > 0.8\dimen@ii   % due to long index text
-        \dimen@ = 0.7\dimen@ % Try to split the text roughly evenly
+        % Try to split the text roughly evenly.  \dimen@ will be the length of
+        % the first line.
+        \dimen@ = 0.7\dimen@
         \dimen@ii = \hsize
         \ifnum\dimen@>\dimen@ii
-          % If the entry is too long, use the whole line
+          % If the entry is too long (for example, if it needs more than
+          % two lines), use all the space in the first line.
           \dimen@ = \dimen@ii
         \fi
         \advance\leftskip by 0pt plus 1fill % ragged right
@@ -5707,8 +5831,9 @@ end
         % instead of using \parshape with explicit line lengths, but TeX
         % doesn't seem to provide a way to do such a thing.
         %
-        \leftskip = 1em
-        \parindent = -1em
+        % Indent all lines but the first one.
+        \advance\leftskip by 1em
+        \advance\parindent by -1em
       \fi\fi
       \indent % start paragraph
       \unhbox\boxA
@@ -5726,57 +5851,11 @@ end
     \egroup % The \vbox
     \fi
   \endgroup
-  % delay text of entry until after penalty
-  \bgroup\aftergroup\insertindexentrybox
-  \entrywidowpenalty
 }}
 
 \newskip\thinshrinkable
 \skip\thinshrinkable=.15em minus .15em
 
-\newbox\entryindexbox
-\def\insertindexentrybox{%
-  \ourunvbox\entryindexbox
-}
-
-% Use \lastbox to take apart vbox box by box, and add each sub-box
-% to the current vertical list.
-\def\ourunvbox#1{%
-\bgroup % for local binding of \delayedbox
-  % Remove the last box from box #1
-  \global\setbox#1=\vbox{%
-    \unvbox#1%
-    \unskip % remove any glue
-    \unpenalty
-    \global\setbox\interbox=\lastbox
-  }%
-  \setbox\delayedbox=\box\interbox
-  \ifdim\ht#1=0pt\else
-    \ourunvbox#1 % Repeat on what's left of the box
-    \nobreak
-  \fi
-  \box\delayedbox
-\egroup
-}
-\newbox\delayedbox
-\newbox\interbox
-
-% Default is no penalty
-\let\entrywidowpenalty\egroup
-
-% Used from \printindex.  \firsttoken should be the first token
-% after the \entry.  If it's not another \entry, we are at the last
-% line of a group of index entries, so insert a penalty to discourage
-% widowed index entries.
-\long\def\indexwidowpenalty{%
-  \def\isentry{\entry}%
-  \ifx\firsttoken\isentry
-  \else
-    \penalty 9000
-  \fi
-  \egroup % now comes the box added with \aftergroup
-}
-
 % Like plain.tex's \dotfill, except uses up at least 1 em.
 % The filll stretch here overpowers both the fil and fill stretch to push
 % the page number to the right.
@@ -5786,24 +5865,15 @@ end
 
 \def\primary #1{\line{#1\hfil}}
 
-\newskip\secondaryindent \secondaryindent=0.5cm
-\def\secondary#1#2{{%
-  \parfillskip=0in
-  \parskip=0in
-  \hangindent=1in
-  \hangafter=1
-  \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill
-  \ifpdf
-    \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
-  \else
-    \ifx\XeTeXrevision\thisisundefined
-      #2
-    \else
-      \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph.
-    \fi
-  \fi
-  \par
-}}
+\def\secondary{\indententry{0.5cm}}
+\def\tertiary{\indententry{1cm}}
+
+\def\indententry#1#2#3{%
+  \bgroup
+  \leftskip=#1
+  \entry{#2}{#3}%
+  \egroup
+}
 
 % Define two-column mode, which we use to typeset indexes.
 % Adapted from the TeXbook, page 416, which is to say,
@@ -5813,60 +5883,21 @@ end
 \newbox\partialpage
 \newdimen\doublecolumnhsize
 
-% Use inside an output routine to save \topmark and \firstmark
-\def\savemarks{%
-  \global\savedtopmark=\expandafter{\topmark }%
-  \global\savedfirstmark=\expandafter{\firstmark }%
-}
-\newtoks\savedtopmark
-\newtoks\savedfirstmark
-
-% Set \topmark and \firstmark for next time \output runs.
-% Can't be run from withinside \output (because any material
-% added while an output routine is active, including 
-% penalties, is saved for after it finishes).  The page so far
-% should be empty, otherwise what's on it will be thrown away.
-\def\restoremarks{%
-  \mark{\the\savedtopmark}%
-  \bgroup\output = {%
-    \setbox\dummybox=\box\PAGE
-  }abc\eject\egroup
-  % "abc" because output routine doesn't fire for a completely empty page.
-  \mark{\the\savedfirstmark}%
-}
-
 \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns
   % If not much space left on page, start a new page.
   \ifdim\pagetotal>0.8\vsize\vfill\eject\fi
   %
   % Grab any single-column material above us.
   \output = {%
-    %
-    % Here is a possibility not foreseen in manmac: if we accumulate a
-    % whole lot of material, we might end up calling this \output
-    % routine twice in a row (see the doublecol-lose test, which is
-    % essentially a couple of indexes with @setchapternewpage off).  In
-    % that case we just ship out what is in \partialpage with the normal
-    % output routine.  Generally, \partialpage will be empty when this
-    % runs and this will be a no-op.  See the indexspread.tex test case.
-    \ifvoid\partialpage \else
-      \onepageout{\pagecontents\partialpage}%
-    \fi
+    \savetopmark
     %
     \global\setbox\partialpage = \vbox{%
       % Unvbox the main output page.
       \unvbox\PAGE
       \kern-\topskip \kern\baselineskip
     }%
-    \savemarks
   }%
   \eject % run that output routine to set \partialpage
-  \restoremarks
-  %
-  % We recover the two marks that the last output routine saved in order
-  % to propagate the information in marks added around a chapter heading,
-  % which could be otherwise be lost by the time the final page is output.
-  %
   %
   % Use the double-column output routine for subsequent pages.
   \output = {\doublecolumnout}%
@@ -5892,8 +5923,10 @@ end
     \divide\doublecolumnhsize by 2
   \hsize = \doublecolumnhsize
   %
-  % Double the \vsize as well.  (We don't need a separate register here,
-  % since nobody clobbers \vsize.)
+  % Get the available space for the double columns -- the normal
+  % (undoubled) page height minus any material left over from the
+  % previous page.
+  \advance\vsize by -\ht\partialpage
   \vsize = 2\vsize
   %
   % For the benefit of balancing columns
@@ -5905,18 +5938,16 @@ end
 %
 \def\doublecolumnout{%
   %
+  \savetopmark
   \splittopskip=\topskip \splitmaxdepth=\maxdepth
-  % Get the available space for the double columns -- the normal
-  % (undoubled) page height minus any material left over from the
-  % previous page.
   \dimen@ = \vsize
   \divide\dimen@ by 2
-  \advance\dimen@ by -\ht\partialpage
   %
   % box0 will be the left-hand column, box2 the right.
-  \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@
-  \onepageout\pagesofar
-  \unvbox255
+  \setbox0=\vsplit\PAGE to\dimen@ \setbox2=\vsplit\PAGE to\dimen@
+  \global\advance\vsize by 2\ht\partialpage
+  \onepageout\pagesofar % empty except for the first time we are called
+  \unvbox\PAGE
   \penalty\outputpenalty
 }
 %
@@ -5931,7 +5962,7 @@ end
 }
 
 
-% Finished with with double columns.
+% Finished with double columns.
 \def\enddoublecolumns{%
   % The following penalty ensures that the page builder is exercised
   % _before_ we change the output routine.  This is necessary in the
@@ -5963,41 +5994,48 @@ end
   %
   \output = {%
     % Split the last of the double-column material.
-    \savemarks
+    \savetopmark
     \balancecolumns
-    %
+  }%
+  \eject % call the \output just set
+  \ifdim\pagetotal=0pt
     % Having called \balancecolumns once, we do not
     % want to call it again.  Therefore, reset \output to its normal
     % definition right away.
-    \global\output = {\onepageout{\pagecontents\PAGE}}%
-  }%
-  \eject
-  \endgroup % started in \begindoublecolumns
-  \restoremarks
-  % Leave the double-column material on the current page, no automatic
-  % page break.
-  \box\balancedcolumns
-  %
-  % \pagegoal was set to the doubled \vsize above, since we restarted
-  % the current page.  We're now back to normal single-column
-  % typesetting, so reset \pagegoal to the normal \vsize (after the
-  % \endgroup where \vsize got restored).
-  \pagegoal = \vsize
+    \global\output=\expandafter{\the\defaultoutput}
+    %
+    \endgroup % started in \begindoublecolumns
+    % Leave the double-column material on the current page, no automatic
+    % page break.
+    \box\balancedcolumns
+    %
+    % \pagegoal was set to the doubled \vsize above, since we restarted
+    % the current page.  We're now back to normal single-column
+    % typesetting, so reset \pagegoal to the normal \vsize.
+    \global\vsize = \txipageheight %
+    \pagegoal = \txipageheight %
+  \else
+    % We had some left-over material.  This might happen when \doublecolumnout
+    % is called in \balancecolumns.  Try again.
+    \expandafter\enddoublecolumns
+  \fi
 }
 \newbox\balancedcolumns
 \setbox\balancedcolumns=\vbox{shouldnt see this}%
 %
-% Only called for the last of the double column material.  \doublecolumnout 
+% Only called for the last of the double column material.  \doublecolumnout
 % does the others.
 \def\balancecolumns{%
-  \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120.
+  \setbox0 = \vbox{\unvbox\PAGE}% like \box255 but more efficient, see p.120.
   \dimen@ = \ht0
-  \advance\dimen@ by \topskip
-  \advance\dimen@ by-\baselineskip
-  \ifdim\dimen@<5\baselineskip
+  \ifdim\dimen@<7\baselineskip
     % Don't split a short final column in two.
     \setbox2=\vbox{}%
+    \global\setbox\balancedcolumns=\vbox{\pagesofar}%
   \else
+    % double the leading vertical space
+    \advance\dimen@ by \topskip
+    \advance\dimen@ by-\baselineskip
     \divide\dimen@ by 2 % target to split to
     \dimen@ii = \dimen@
     \splittopskip = \topskip
@@ -6012,15 +6050,15 @@ end
       \repeat
     }%
     % Now the left column is in box 1, and the right column in box 3.
-    % Check whether the left column has come out higher than the page itself.  
+    %
+    % Check whether the left column has come out higher than the page itself.
     % (Note that we have doubled \vsize for the double columns, so
     % the actual height of the page is 0.5\vsize).
     \ifdim2\ht1>\vsize
-      % Just split the last of the double column material roughly in half.
-      \setbox2=\box0
-      \setbox0 = \vsplit2 to \dimen@ii
-      \setbox0=\vbox to \dimen@ii {\unvbox0\vfill}%
-      \setbox2=\vbox to \dimen@ii {\unvbox2\vfill}%
+      % It appears that we have been called upon to balance too much material.
+      % Output some of it with \doublecolumnout, leaving the rest on the page.
+      \setbox\PAGE=\box0
+      \doublecolumnout
     \else
       % Compare the heights of the two columns.
       \ifdim4\ht1>5\ht3
@@ -6033,10 +6071,10 @@ end
         \setbox2=\vbox to\ht1{\unvbox3\unskip}%
         \setbox0=\vbox to\ht1{\unvbox1\unskip}%
       \fi
+      \global\setbox\balancedcolumns=\vbox{\pagesofar}%
     \fi
   \fi
   %
-  \global\setbox\balancedcolumns=\vbox{\pagesofar}%
 }
 \catcode`\@ = \other
 
@@ -6132,11 +6170,9 @@ end
 
 % @raisesections: treat @section as chapter, @subsection as section, etc.
 \def\raisesections{\global\advance\secbase by -1}
-\let\up=\raisesections % original BFox name
 
 % @lowersections: treat @chapter as section, @section as subsection, etc.
 \def\lowersections{\global\advance\secbase by 1}
-\let\down=\lowersections % original BFox name
 
 % we only have subsub.
 \chardef\maxseclevel = 3
@@ -6312,7 +6348,7 @@ end
 \let\top\unnumbered
 
 % Sections.
-% 
+%
 \outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz
 \def\seczzz#1{%
   \global\subsecno=0 \global\subsubsecno=0  \global\advance\secno by 1
@@ -6335,7 +6371,7 @@ end
 }
 
 % Subsections.
-% 
+%
 % normally calls numberedsubseczzz:
 \outer\parseargdef\numberedsubsec{\numhead2{#1}}
 \def\numberedsubseczzz#1{%
@@ -6360,7 +6396,7 @@ end
 }
 
 % Subsubsections.
-% 
+%
 % normally numberedsubsubseczzz:
 \outer\parseargdef\numberedsubsubsec{\numhead3{#1}}
 \def\numberedsubsubseczzz#1{%
@@ -6450,18 +6486,16 @@ end
 \def\CHAPPAGoff{%
 \global\let\contentsalignmacro = \chappager
 \global\let\pchapsepmacro=\chapbreak
-\global\let\pagealignmacro=\chappager}
+\global\def\HEADINGSon{\HEADINGSsinglechapoff}}
 
 \def\CHAPPAGon{%
 \global\let\contentsalignmacro = \chappager
 \global\let\pchapsepmacro=\chappager
-\global\let\pagealignmacro=\chappager
 \global\def\HEADINGSon{\HEADINGSsingle}}
 
 \def\CHAPPAGodd{%
 \global\let\contentsalignmacro = \chapoddpage
 \global\let\pchapsepmacro=\chapoddpage
-\global\let\pagealignmacro=\chapoddpage
 \global\def\HEADINGSon{\HEADINGSdouble}}
 
 \CHAPPAGon
@@ -6481,27 +6515,22 @@ end
   \expandafter\ifx\thisenv\titlepage\else
     \checkenv{}% chapters, etc., should not start inside an environment.
   \fi
-  % FIXME: \chapmacro is currently called from inside \titlepage when
-  % \setcontentsaftertitlepage to print the "Table of Contents" heading, but
-  % this should probably be done by \sectionheading with an option to print
-  % in chapter size.
-  %
   % Insert the first mark before the heading break (see notes for \domark).
-  \let\prevchapterdefs=\lastchapterdefs
-  \let\prevsectiondefs=\lastsectiondefs
-  \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
+  \let\prevchapterdefs=\currentchapterdefs
+  \let\prevsectiondefs=\currentsectiondefs
+  \gdef\currentsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}%
                         \gdef\thissection{}}%
   %
   \def\temptype{#2}%
   \ifx\temptype\Ynothingkeyword
-    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+    \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
                           \gdef\thischapter{\thischaptername}}%
   \else\ifx\temptype\Yomitfromtockeyword
-    \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
+    \gdef\currentchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}%
                           \gdef\thischapter{}}%
   \else\ifx\temptype\Yappendixkeyword
     \toks0={#1}%
-    \xdef\lastchapterdefs{%
+    \xdef\currentchapterdefs{%
       \gdef\noexpand\thischaptername{\the\toks0}%
       \gdef\noexpand\thischapternum{\appendixletter}%
       % \noexpand\putwordAppendix avoids expanding indigestible
@@ -6512,7 +6541,7 @@ end
     }%
   \else
     \toks0={#1}%
-    \xdef\lastchapterdefs{%
+    \xdef\currentchapterdefs{%
       \gdef\noexpand\thischaptername{\the\toks0}%
       \gdef\noexpand\thischapternum{\the\chapno}%
       % \noexpand\putwordChapter avoids expanding indigestible
@@ -6532,18 +6561,18 @@ end
   %
   % Now the second mark, after the heading break.  No break points
   % between here and the heading.
-  \let\prevchapterdefs=\lastchapterdefs
-  \let\prevsectiondefs=\lastsectiondefs
+  \let\prevchapterdefs=\currentchapterdefs
+  \let\prevsectiondefs=\currentsectiondefs
   \domark
   %
   {%
     \chapfonts \rm
     \let\footnote=\errfootnoteheading % give better error message
     %
-    % Have to define \lastsection before calling \donoderef, because the
+    % Have to define \currentsection before calling \donoderef, because the
     % xref code eventually uses it.  On the other hand, it has to be called
     % after \pchapsepmacro, or the headline will change too soon.
-    \gdef\lastsection{#1}%
+    \gdef\currentsection{#1}%
     %
     % Only insert the separating space if we have a chapter/appendix
     % number, and don't print the unnumbered ``number''.
@@ -6632,10 +6661,10 @@ end
     \csname #2fonts\endcsname \rm
     %
     % Insert first mark before the heading break (see notes for \domark).
-    \let\prevsectiondefs=\lastsectiondefs
+    \let\prevsectiondefs=\currentsectiondefs
     \ifx\temptype\Ynothingkeyword
       \ifx\sectionlevel\seckeyword
-        \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
+        \gdef\currentsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}%
                               \gdef\thissection{\thissectionname}}%
       \fi
     \else\ifx\temptype\Yomitfromtockeyword
@@ -6643,7 +6672,7 @@ end
     \else\ifx\temptype\Yappendixkeyword
       \ifx\sectionlevel\seckeyword
         \toks0={#1}%
-        \xdef\lastsectiondefs{%
+        \xdef\currentsectiondefs{%
           \gdef\noexpand\thissectionname{\the\toks0}%
           \gdef\noexpand\thissectionnum{#4}%
           % \noexpand\putwordSection avoids expanding indigestible
@@ -6656,7 +6685,7 @@ end
     \else
       \ifx\sectionlevel\seckeyword
         \toks0={#1}%
-        \xdef\lastsectiondefs{%
+        \xdef\currentsectiondefs{%
           \gdef\noexpand\thissectionname{\the\toks0}%
           \gdef\noexpand\thissectionnum{#4}%
           % \noexpand\putwordSection avoids expanding indigestible
@@ -6682,28 +6711,28 @@ end
     %
     % Now the second mark, after the heading break.  No break points
     % between here and the heading.
-    \global\let\prevsectiondefs=\lastsectiondefs
+    \global\let\prevsectiondefs=\currentsectiondefs
     \domark
     %
     % Only insert the space after the number if we have a section number.
     \ifx\temptype\Ynothingkeyword
       \setbox0 = \hbox{}%
       \def\toctype{unn}%
-      \gdef\lastsection{#1}%
+      \gdef\currentsection{#1}%
     \else\ifx\temptype\Yomitfromtockeyword
       % for @headings -- no section number, don't include in toc,
-      % and don't redefine \lastsection.
+      % and don't redefine \currentsection.
       \setbox0 = \hbox{}%
       \def\toctype{omit}%
       \let\sectionlevel=\empty
     \else\ifx\temptype\Yappendixkeyword
       \setbox0 = \hbox{#4\enspace}%
       \def\toctype{app}%
-      \gdef\lastsection{#1}%
+      \gdef\currentsection{#1}%
     \else
       \setbox0 = \hbox{#4\enspace}%
       \def\toctype{num}%
-      \gdef\lastsection{#1}%
+      \gdef\currentsection{#1}%
     \fi\fi\fi
     %
     % Write the toc entry (before \donoderef).  See comments in \chapmacro.
@@ -6793,13 +6822,8 @@ end
   % 1 and 2 (the page numbers aren't printed), and so are the first
   % two pages of the document.  Thus, we'd have two destinations named
   % `1', and two named `2'.
-  \ifpdf
+  \ifpdforxetex
     \global\pdfmakepagedesttrue
-  \else
-    \ifx\XeTeXrevision\thisisundefined
-    \else
-      \global\pdfmakepagedesttrue
-    \fi
   \fi
 }
 
@@ -6836,9 +6860,7 @@ end
 %
 \def\startcontents#1{%
   % If @setchapternewpage on, and @headings double, the contents should
-  % start on an odd page, unlike chapters.  Thus, we maintain
-  % \contentsalignmacro in parallel with \pagealignmacro.
-  % From: Torbjorn Granlund <tege@matematik.su.se>
+  % start on an odd page, unlike chapters.
   \contentsalignmacro
   \immediate\closeout\tocfile
   %
@@ -6853,6 +6875,9 @@ end
     %
     % Roman numerals for page numbers.
     \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi
+    \def\thistitle{}% no title in double-sided headings
+    % Record where the Roman numerals started.
+    \ifnum\romancount=0 \global\romancount=\pagecount \fi
 }
 
 % redefined for the two-volume lispref.  We always output on
@@ -6875,8 +6900,7 @@ end
     \fi
     \closein 1
   \endgroup
-  \lastnegativepageno = \pageno
-  \global\pageno = \savepageno
+  \contentsendroman
 }
 
 % And just the chapters.
@@ -6911,10 +6935,20 @@ end
     \vfill \eject
     \contentsalignmacro % in case @setchapternewpage odd is in effect
   \endgroup
+  \contentsendroman
+}
+\let\shortcontents = \summarycontents
+
+% Get ready to use Arabic numerals again
+\def\contentsendroman{%
   \lastnegativepageno = \pageno
   \global\pageno = \savepageno
+  %
+  % If \romancount > \arabiccount, the contents are at the end of the
+  % document.  Otherwise, advance where the Arabic numerals start for
+  % the page numbers.
+  \ifnum\romancount>\arabiccount\else\global\arabiccount=\pagecount\fi
 }
-\let\shortcontents = \summarycontents
 
 % Typeset the label for a chapter or appendix for the short contents.
 % The arg is, e.g., `A' for an appendix, or `3' for a chapter.
@@ -6943,7 +6977,15 @@ end
 % exist, with an empty box.  Let's hope all the numbers have the same width.
 % Also ignore the page number, which is conventionally not printed.
 \def\numeralbox{\setbox0=\hbox{8}\hbox to \wd0{\hfil}}
-\def\partentry#1#2#3#4{\dochapentry{\numeralbox\labelspace#1}{}}
+\def\partentry#1#2#3#4{%
+  % Add stretch and a bonus for breaking the page before the part heading.
+  % This reduces the chance of the page being broken immediately after the
+  % part heading, before a following chapter heading.
+  \vskip 0pt plus 5\baselineskip
+  \penalty-300
+  \vskip 0pt plus -5\baselineskip
+  \dochapentry{\numeralbox\labelspace#1}{}%
+}
 %
 % Parts, in the short toc.
 \def\shortpartentry#1#2#3#4{%
@@ -7048,7 +7090,7 @@ end
 % But \@ or @@ will get a plain @ character.
 
 \envdef\tex{%
-  \setupmarkupstyle{tex}%
+  \setregularquotes
   \catcode `\\=0 \catcode `\{=1 \catcode `\}=2
   \catcode `\$=3 \catcode `\&=4 \catcode `\#=6
   \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie
@@ -7154,11 +7196,7 @@ end
 
 % @cartouche ... @end cartouche: draw rectangle w/rounded corners around
 % environment contents.
-\font\circle=lcircle10
-\newdimen\circthick
-\newdimen\cartouter\newdimen\cartinner
-\newskip\normbskip\newskip\normpskip\newskip\normlskip
-\circthick=\fontdimen8\circle
+
 %
 \def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth
 \def\ctr{{\hskip 6pt\circle\char'010}}
@@ -7173,7 +7211,18 @@ end
 %
 \newskip\lskip\newskip\rskip
 
+% only require the font if @cartouche is actually used
+\def\cartouchefontdefs{%
+  \font\circle=lcircle10\relax
+  \circthick=\fontdimen8\circle
+}
+\newdimen\circthick
+\newdimen\cartouter\newdimen\cartinner
+\newskip\normbskip\newskip\normpskip\newskip\normlskip
+
+
 \envdef\cartouche{%
+  \cartouchefontdefs
   \ifhmode\par\fi  % can't be in the midst of a paragraph.
   \startsavinginserts
   \lskip=\leftskip \rskip=\rightskip
@@ -7267,7 +7316,7 @@ end
 % If you want all examples etc. small: @set dispenvsize small.
 % If you want even small examples the full size: @set dispenvsize nosmall.
 % This affects the following displayed environments:
-%    @example, @display, @format, @lisp
+%    @example, @display, @format, @lisp, @verbatim
 %
 \def\smallword{small}
 \def\nosmallword{nosmall}
@@ -7313,9 +7362,9 @@ end
 %
 \maketwodispenvdef{lisp}{example}{%
   \nonfillstart
-  \tt\setupmarkupstyle{example}%
+  \tt\setcodequotes
   \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special.
-  \gobble % eat return
+  \parsearg\gobble
 }
 % @display/@smalldisplay: same as @lisp except keep current font.
 %
@@ -7352,13 +7401,9 @@ end
 
 
 % @raggedright does more-or-less normal line breaking but no right
-% justification.  From plain.tex.  Don't stretch around special
-% characters in urls in this environment, since the stretch at the right
-% should be enough.
+% justification.  From plain.tex.
 \envdef\raggedright{%
   \rightskip0pt plus2.4em \spaceskip.3333em \xspaceskip.5em\relax
-  \def\urefprestretchamount{0pt}%
-  \def\urefpoststretchamount{0pt}%
 }
 \let\Eraggedright\par
 
@@ -7417,7 +7462,7 @@ end
 
 % @indentedblock is like @quotation, but indents only on the left and
 % has no optional argument.
-% 
+%
 \makedispenvdef{indentedblock}{\indentedblockstart}
 %
 \def\indentedblockstart{%
@@ -7477,7 +7522,7 @@ end
 \def\setupverb{%
   \tt  % easiest (and conventionally used) font for verbatim
   \def\par{\leavevmode\endgraf}%
-  \setupmarkupstyle{verb}%
+  \setcodequotes
   \tabeightspaces
   % Respect line breaks,
   % print special symbols as themselves, and
@@ -7492,13 +7537,9 @@ end
 \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount
 %
 % We typeset each line of the verbatim in an \hbox, so we can handle
-% tabs.  The \global is in case the verbatim line starts with an accent,
-% or some other command that starts with a begin-group.  Otherwise, the
-% entire \verbbox would disappear at the corresponding end-group, before
-% it is typeset.  Meanwhile, we can't have nested verbatim commands
-% (can we?), so the \global won't be overwriting itself.
+% tabs.
 \newbox\verbbox
-\def\starttabbox{\global\setbox\verbbox=\hbox\bgroup}
+\def\starttabbox{\setbox\verbbox=\hbox\bgroup}
 %
 \begingroup
   \catcode`\^^I=\active
@@ -7509,7 +7550,8 @@ end
       \divide\dimen\verbbox by\tabw
       \multiply\dimen\verbbox by\tabw % compute previous multiple of \tabw
       \advance\dimen\verbbox by\tabw  % advance to next multiple of \tabw
-      \wd\verbbox=\dimen\verbbox \box\verbbox \starttabbox
+      \wd\verbbox=\dimen\verbbox
+      \leavevmode\box\verbbox \starttabbox
     }%
   }
 \endgroup
@@ -7519,17 +7561,14 @@ end
   \let\nonarrowing = t%
   \nonfillstart
   \tt % easiest (and conventionally used) font for verbatim
-  % The \leavevmode here is for blank lines.  Otherwise, we would
-  % never \starttabox and the \egroup would end verbatim mode.
-  \def\par{\leavevmode\egroup\box\verbbox\endgraf}%
+  \def\par{\egroup\leavevmode\box\verbbox\endgraf\starttabbox}%
   \tabexpand
-  \setupmarkupstyle{verbatim}%
+  \setcodequotes
   % Respect line breaks,
   % print special symbols as themselves, and
   % make each space count.
   % Must do in this order:
   \obeylines \uncatcodespecials \sepspaces
-  \everypar{\starttabbox}%
 }
 
 % Do the @verb magic: verbatim text is quoted by unique
@@ -7564,13 +7603,16 @@ end
   % ignore everything up to the first ^^M, that's the newline at the end
   % of the @verbatim input line itself.  Otherwise we get an extra blank
   % line in the output.
-  \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}%
+  \xdef\doverbatim#1^^M#2@end verbatim{%
+    \starttabbox#2\egroup\noexpand\end\gobble verbatim}%
   % We really want {...\end verbatim} in the body of the macro, but
   % without the active space; thus we have to use \xdef and \gobble.
+  % The \egroup ends the \verbbox started at the end of the last line in
+  % the block.
 \endgroup
 %
 \envdef\verbatim{%
-    \setupverbatim\doverbatim
+    \setnormaldispenv\setupverbatim\doverbatim
 }
 \let\Everbatim = \afterenvbreak
 
@@ -7583,9 +7625,12 @@ end
   {%
     \makevalueexpandable
     \setupverbatim
-    \indexnofonts       % Allow `@@' and other weird things in file names.
-    \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
-    \input #1
+    {%
+      \indexnofonts       % Allow `@@' and other weird things in file names.
+      \wlog{texinfo.tex: doing @verbatiminclude of #1^^J}%
+      \edef\tmp{\noexpand\input #1 }
+      \expandafter
+    }\expandafter\starttabbox\tmp\egroup
     \afterenvbreak
   }%
 }
@@ -7714,7 +7759,7 @@ end
 % @deftypefnnewline on|off says whether the return type of typed functions
 % are printed on their own line.  This affects @deftypefn, @deftypefun,
 % @deftypeop, and @deftypemethod.
-% 
+%
 \parseargdef\deftypefnnewline{%
   \def\temp{#1}%
   \ifx\temp\onword
@@ -7730,6 +7775,21 @@ end
   \fi\fi
 }
 
+% \dosubind {index}{topic}{subtopic}
+%
+% If SUBTOPIC is present, precede it with a space, and call \doind.
+% (At some time during the 20th century, this made a two-level entry in an
+% index such as the operation index.  Nobody seemed to notice the change in
+% behaviour though.)
+\def\dosubind#1#2#3{%
+  \def\thirdarg{#3}%
+  \ifx\thirdarg\empty
+    \doind{#1}{#2}%
+  \else
+    \doind{#1}{#2\space#3}%
+  \fi
+}
+
 % Untyped functions:
 
 % @deffn category name args
@@ -7744,7 +7804,6 @@ end
 % \deffngeneral {subind}category name args
 %
 \def\deffngeneral#1#2 #3 #4\endheader{%
-  % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}.
   \dosubind{fn}{\code{#3}}{#1}%
   \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}%
 }
@@ -7895,7 +7954,7 @@ end
       \tclose{\temp}% typeset the return type
       \ifrettypeownline
         % put return type on its own line; prohibit line break following:
-        \hfil\vadjust{\nobreak}\break  
+        \hfil\vadjust{\nobreak}\break
       \else
         \space  % type on same line, so just followed by a space
       \fi
@@ -7923,7 +7982,7 @@ end
   % leave the code in, but it's strange for @var to lead to typewriter.
   % Nowadays we recommend @code, since the difference between a ttsl hyphen
   % and a tt hyphen is pretty tiny.  @code also disables ?` !`.
-  \def\var##1{{\setupmarkupstyle{var}\ttslanted{##1}}}%
+  \def\var##1{{\setregularquotes\ttslanted{##1}}}%
   #1%
   \sl\hyphenchar\font=45
 }
@@ -7951,6 +8010,7 @@ end
   \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb}
   \gdef\magicamp{\let&=\amprm}
 }
+\let\ampchar\&
 
 \newcount\parencount
 
@@ -8031,44 +8091,25 @@ end
   }
 \fi
 
-\let\aftermacroxxx\relax
-\def\aftermacro{\aftermacroxxx}
-
-% alias because \c means cedilla in @tex or @math
-\let\texinfoc=\c
-
-\newcount\savedcatcodeone
-\newcount\savedcatcodetwo
+\let\E=\expandafter
 
 % Used at the time of macro expansion.
 % Argument is macro body with arguments substituted
 \def\scanmacro#1{%
   \newlinechar`\^^M
-  \def\xeatspaces{\eatspaces}%
-  %
-  % Temporarily undo catcode changes of \printindex.  Set catcode of @ to
-  % 0 so that @-commands in macro expansions aren't printed literally when 
-  % formatting an index file, where \ is used as the escape character.
-  \savedcatcodeone=\catcode`\@
-  \savedcatcodetwo=\catcode`\\
-  \catcode`\@=0
-  \catcode`\\=\active
+  % expand the expansion of \eatleadingcr twice to maybe remove a leading
+  % newline (and \else and \fi tokens), then call \eatspaces on the result.
+  \def\xeatspaces##1{%
+    \E\E\E\E\E\E\E\eatspaces\E\E\E\E\E\E\E{\eatleadingcr##1%
+  }}%
+  \def\xempty##1{}%
   %
   % Process the macro body under the current catcode regime.
-  \scantokens{#1@texinfoc}\aftermacro%
-  %
-  \catcode`\@=\savedcatcodeone
-  \catcode`\\=\savedcatcodetwo
+  \scantokens{#1@comment}%
   %
-  % The \texinfoc is to remove the \newlinechar added by \scantokens, and
-  % can be noticed by \parsearg.
-  %   The \aftermacro allows a \comment at the end of the macro definition
-  % to duplicate itself past the final \newlinechar added by \scantokens:
-  % this is used in the definition of \group to comment out a newline.  We
-  % don't do the same for \c to support Texinfo files with macros that ended
-  % with a @c, which should no longer be necessary.
-  %   We avoid surrounding the call to \scantokens with \bgroup and \egroup
-  % to allow macros to open or close groups themselves.
+  % The \comment is to remove the \newlinechar added by \scantokens, and
+  % can be noticed by \parsearg.  Note \c isn't used because this means cedilla
+  % in math mode.
 }
 
 % Used for copying and captions
@@ -8114,6 +8155,11 @@ end
 \unbrace{\gdef\trim@@@ #1 } #2@{#1}
 }
 
+{\catcode`\^^M=\other%
+\gdef\eatleadingcr#1{\if\noexpand#1\noexpand^^M\else\E#1\fi}}%
+% Warning: this won't work for a delimited argument
+% or for an empty argument
+
 % Trim a single trailing ^^M off a string.
 {\catcode`\^^M=\other \catcode`\Q=3%
 \gdef\eatcr #1{\eatcra #1Q^^MQ}%
@@ -8169,12 +8215,14 @@ end
 \def\macroargctxt{%
   \scanctxt
   \catcode`\ =\active
+  \catcode`\@=\other
   \catcode`\^^M=\other
   \catcode`\\=\active
 }
 
 \def\macrolineargctxt{% used for whole-line arguments without braces
   \scanctxt
+  \catcode`\@=\other
   \catcode`\{=\other
   \catcode`\}=\other
 }
@@ -8266,7 +8314,7 @@ end
 % list to some hook where the argument is to be expanded.  If there are
 % less than 10 arguments that hook is to be replaced by ##N where N
 % is the position in that list, that is to say the macro arguments are to be
-% defined `a la TeX in the macro body.  
+% defined `a la TeX in the macro body.
 %
 % That gets used by \mbodybackslash (above).
 %
@@ -8278,6 +8326,7 @@ end
   \let\hash\relax
   % \hash is redefined to `#' later to get it into definitions
   \let\xeatspaces\relax
+  \let\xempty\relax
   \parsemargdefxxx#1,;,%
   \ifnum\paramno<10\relax\else
     \paramno0\relax
@@ -8289,16 +8338,18 @@ end
   \else \let\next=\parsemargdefxxx
     \advance\paramno by 1
     \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname
-        {\xeatspaces{\hash\the\paramno}}%
+        {\xeatspaces{\hash\the\paramno\noexpand\xempty{}}}%
     \edef\paramlist{\paramlist\hash\the\paramno,}%
   \fi\next}
+% the \xempty{} is to give \eatleadingcr an argument in the case of an
+% empty macro argument.
 
 % \parsemacbody, \parsermacbody
 %
 % Read recursive and nonrecursive macro bodies. (They're different since
 % rec and nonrec macros end differently.)
-% 
-% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro 
+%
+% We are in \macrobodyctxt, and the \xdef causes backslashshes in the macro
 % body to be transformed.
 % Set \macrobody to the body of the macro, and call \defmacro.
 %
@@ -8332,7 +8383,7 @@ end
 % twice the \macarg.BLAH macros does not cost too much processing power.
 \def\parsemmanyargdef@@#1,{%
   \if#1;\let\next=\relax
-  \else 
+  \else
     \let\next=\parsemmanyargdef@@
     \edef\tempb{\eatspaces{#1}}%
     \expandafter\def\expandafter\tempa
@@ -8417,7 +8468,7 @@ end
 
 % Replace arguments by their values in the macro body, and place the result
 % in macro \@tempa.
-% 
+%
 \def\macvalstoargs@{%
   %  To do this we use the property that token registers that are \the'ed
   % within an \edef  expand only once. So we are going to place all argument
@@ -8441,9 +8492,9 @@ end
   \expandafter\def\expandafter\@tempa\expandafter{\@tempc}%
   }
 
-% Define the named-macro outside of this group and then close this group. 
-% 
-\def\macargexpandinbody@{% 
+% Define the named-macro outside of this group and then close this group.
+%
+\def\macargexpandinbody@{%
   \expandafter
   \endgroup
   \macargdeflist@
@@ -8481,7 +8532,7 @@ end
 }
 
 % Trailing missing arguments are set to empty.
-% 
+%
 \def\setemptyargvalues@{%
   \ifx\paramlist\nilm@
     \let\next\macargexpandinbody@
@@ -8538,6 +8589,13 @@ end
   \ifcase\paramno
   % 0
     \expandafter\xdef\csname\the\macname\endcsname{%
+      \bgroup
+        \noexpand\spaceisspace
+        \noexpand\endlineisspace
+        \noexpand\expandafter % skip any whitespace after the macro name.
+        \expandafter\noexpand\csname\the\macname @@@\endcsname}%
+    \expandafter\xdef\csname\the\macname @@@\endcsname{%
+      \egroup
       \noexpand\scanmacro{\macrobody}}%
   \or % 1
     \expandafter\xdef\csname\the\macname\endcsname{%
@@ -8551,7 +8609,7 @@ end
   \else % at most 9
     \ifnum\paramno<10\relax
       % @MACNAME sets the context for reading the macro argument
-      % @MACNAME@@ gets the argument, processes backslashes and appends a 
+      % @MACNAME@@ gets the argument, processes backslashes and appends a
       % comma.
       % @MACNAME@@@ removes braces surrounding the argument list.
       % @MACNAME@@@@ scans the macro body with arguments substituted.
@@ -8595,11 +8653,11 @@ end
 % Call #1 with a list of tokens #2, with any doubled backslashes in #2
 % compressed to one.
 %
-% This implementation works by expansion, and not execution (so we cannot use 
-% \def or similar).  This reduces the risk of this failing in contexts where 
-% complete expansion is done with no execution (for example, in writing out to 
+% This implementation works by expansion, and not execution (so we cannot use
+% \def or similar).  This reduces the risk of this failing in contexts where
+% complete expansion is done with no execution (for example, in writing out to
 % an auxiliary file for an index entry).
-% 
+%
 % State is kept in the input stream: the argument passed to
 % @look_ahead, @gobble_and_check_finish and @add_segment is
 %
@@ -8621,11 +8679,11 @@ end
 % #3 - NEXT_TOKEN
 % #4 used to look ahead
 %
-% If the next token is not a backslash, process the rest of the argument; 
+% If the next token is not a backslash, process the rest of the argument;
 % otherwise, remove the next token.
 @gdef@look_ahead#1!#2#3#4{%
   @ifx#4\%
-   @expandafter@gobble_and_check_finish 
+   @expandafter@gobble_and_check_finish
   @else
    @expandafter@add_segment
   @fi#1!{#2}#4#4%
@@ -8649,9 +8707,9 @@ end
 % #3 - NEXT_TOKEN
 % #4 is input stream until next backslash
 %
-% Input stream is either at the start of the argument, or just after a 
-% backslash sequence, either a lone backslash, or a doubled backslash.  
-% NEXT_TOKEN contains the first token in the input stream: if it is \finish, 
+% Input stream is either at the start of the argument, or just after a
+% backslash sequence, either a lone backslash, or a doubled backslash.
+% NEXT_TOKEN contains the first token in the input stream: if it is \finish,
 % finish; otherwise, append to ARG_RESULT the segment of the argument up until
 % the next backslash.  PENDING_BACKSLASH contains a backslash to represent
 % a backslash just before the start of the input stream that has not been
@@ -8663,13 +8721,13 @@ end
   % append the pending backslash to the result, followed by the next segment
   @expandafter@is_fi@look_ahead#1#2#4!{\}@fi
   % this @fi is discarded by @look_ahead.
-  % we can't get rid of it with \expandafter because we don't know how 
+  % we can't get rid of it with \expandafter because we don't know how
   % long #4 is.
 }
 
 % #1 - THE_MACRO
 % #2 - ARG_RESULT
-% #3 discards the res of the conditional in @add_segment, and @is_fi ends the 
+% #3 discards the res of the conditional in @add_segment, and @is_fi ends the
 % conditional.
 @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}}
 
@@ -8681,7 +8739,7 @@ end
 % for reading the argument (slightly different in the two cases).  Then,
 % to read the argument, in the whole-line case, it then calls the regular
 % \parsearg MAC; in the lbrace case, it calls \passargtomacro MAC.
-% 
+%
 \def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx}
 \def\braceorlinexxx{%
   \ifx\nchar\bgroup
@@ -8731,9 +8789,29 @@ end
 % also remove a trailing comma, in case of something like this:
 % @node Help-Cross,  ,  , Cross-refs
 \def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse}
-\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}}
+\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}\omittopnode}
+
+% Used so that the @top node doesn't have to be wrapped in an @ifnottex
+% conditional.
+% \doignore goes to more effort to skip nested conditionals but we don't need
+% that here.
+\def\omittopnode{%
+   \ifx\lastnode\wordTop
+   \expandafter\ignorenode\fi
+}
+\def\wordTop{Top}
+
+% Until the next @node or @bye command, divert output to a box that is not
+% output.
+\def\ignorenode{\setbox\dummybox\vbox\bgroup\def\node{\egroup\node}%
+\ignorenodebye
+}
+
+{\let\bye\relax
+\gdef\ignorenodebye{\let\bye\ignorenodebyedef}
+\gdef\ignorenodebyedef{\egroup(`Top' node ignored)\bye}}
+% The redefinition of \bye here is because it is declared \outer
 
-\let\nwnode=\node
 \let\lastnode=\empty
 
 % Write a cross-reference definition for the current node.  #1 is the
@@ -8756,7 +8834,7 @@ end
 
 % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an
 % anchor), which consists of three parts:
-% 1) NAME-title - the current sectioning name taken from \lastsection,
+% 1) NAME-title - the current sectioning name taken from \currentsection,
 %                 or the anchor name.
 % 2) NAME-snt   - section number and type, passed as the SNT arg, or
 %                 empty for anchors.
@@ -8778,7 +8856,7 @@ end
        \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef
          ##1}{##2}}% these are parameters of \writexrdef
       }%
-      \toks0 = \expandafter{\lastsection}%
+      \toks0 = \expandafter{\currentsection}%
       \immediate \writexrdef{title}{\the\toks0 }%
       \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc.
       \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, at \shipout
@@ -8790,7 +8868,7 @@ end
 % automatically in xrefs, if the third arg is not explicitly specified.
 % This was provided as a "secret" @set xref-automatic-section-title
 % variable, now it's official.
-% 
+%
 \parseargdef\xrefautomaticsectiontitle{%
   \def\temp{#1}%
   \ifx\temp\onword
@@ -8806,7 +8884,7 @@ end
   \fi\fi
 }
 
-% \f
+%
 % @xref, @pxref, and @ref generate cross-references.  For \xrefX, #1 is
 % the node name, #2 the name of the Info cross-reference, #3 the printed
 % node name, #4 the name of the Info file, #5 the name of the printed
@@ -8853,7 +8931,7 @@ end
       \else
         \ifhavexrefs
           % We (should) know the real title if we have the xref values.
-          \def\printedrefname{\refx{#1-title}{}}%
+          \def\printedrefname{\refx{#1-title}}%
         \else
           % Otherwise just copy the Info node name.
           \def\printedrefname{\ignorespaces #1}%
@@ -8947,7 +9025,7 @@ end
     % If the user specified the print name (third arg) to the ref,
     % print it instead of our usual "Figure 1.2".
     \ifdim\wd\printedrefnamebox = 0pt
-      \refx{#1-snt}{}%
+      \refx{#1-snt}%
     \else
       \printedrefname
     \fi
@@ -8959,77 +9037,73 @@ end
     \fi
   \else
     % node/anchor (non-float) references.
-    % 
+    %
     % If we use \unhbox to print the node names, TeX does not insert
     % empty discretionaries after hyphens, which means that it will not
     % find a line break at a hyphen in a node names.  Since some manuals
     % are best written with fairly long node names, containing hyphens,
     % this is a loss.  Therefore, we give the text of the node name
     % again, so it is as if TeX is seeing it for the first time.
-    % 
+    %
     \ifdim \wd\printedmanualbox > 0pt
       % Cross-manual reference with a printed manual name.
-      % 
+      %
       \crossmanualxref{\cite{\printedmanual\unskip}}%
     %
     \else\ifdim \wd\infofilenamebox > 0pt
       % Cross-manual reference with only an info filename (arg 4), no
       % printed manual name (arg 5).  This is essentially the same as
       % the case above; we output the filename, since we have nothing else.
-      % 
+      %
       \crossmanualxref{\code{\infofilename\unskip}}%
     %
     \else
       % Reference within this manual.
       %
-      % _ (for example) has to be the character _ for the purposes of the
-      % control sequence corresponding to the node, but it has to expand
-      % into the usual \leavevmode...\vrule stuff for purposes of
-      % printing. So we \turnoffactive for the \refx-snt, back on for the
-      % printing, back off for the \refx-pg.
-      {\turnoffactive
-       % Only output a following space if the -snt ref is nonempty; for
-       % @unnumbered and @anchor, it won't be.
-       \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}%
-       \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
-      }%
+      % Only output a following space if the -snt ref is nonempty, as the ref
+      % will be empty for @unnumbered and @anchor.
+      \setbox2 = \hbox{\ignorespaces \refx{#1-snt}}%
+      \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi
+      %
       % output the `[mynode]' via the macro below so it can be overridden.
       \xrefprintnodename\printedrefname
       %
-      % But we always want a comma and a space:
-      ,\space
-      %
-      % output the `page 3'.
-      \turnoffactive \putwordpage\tie\refx{#1-pg}{}%
-      % Add a , if xref followed by a space
-      \if\space\noexpand\tokenafterxref ,%
-      \else\ifx\       \tokenafterxref ,% @TAB
-      \else\ifx\*\tokenafterxref ,%   @*
-      \else\ifx\ \tokenafterxref ,%   @SPACE
-      \else\ifx\
-                \tokenafterxref ,%    @NL
-      \else\ifx\tie\tokenafterxref ,% @tie
-      \fi\fi\fi\fi\fi\fi
+      \expandafter\ifx\csname SETtxiomitxrefpg\endcsname\relax
+        % But we always want a comma and a space:
+        ,\space
+        %
+        % output the `page 3'.
+        \turnoffactive \putwordpage\tie\refx{#1-pg}%
+        % Add a , if xref followed by a space
+        \if\space\noexpand\tokenafterxref ,%
+        \else\ifx\     \tokenafterxref ,% @TAB
+        \else\ifx\*\tokenafterxref ,%   @*
+        \else\ifx\ \tokenafterxref ,%   @SPACE
+        \else\ifx\
+                  \tokenafterxref ,%    @NL
+        \else\ifx\tie\tokenafterxref ,% @tie
+        \fi\fi\fi\fi\fi\fi
+      \fi
     \fi\fi
   \fi
   \endlink
 \endgroup}
 
 % Output a cross-manual xref to #1.  Used just above (twice).
-% 
+%
 % Only include the text "Section ``foo'' in" if the foo is neither
 % missing or Top.  Thus, @xref{,,,foo,The Foo Manual} outputs simply
 % "see The Foo Manual", the idea being to refer to the whole manual.
-% 
+%
 % But, this being TeX, we can't easily compare our node name against the
 % string "Top" while ignoring the possible spaces before and after in
 % the input.  By adding the arbitrary 7sp below, we make it much less
 % likely that a real node name would have the same width as "Top" (e.g.,
 % in a monospaced font).  Hopefully it will never happen in practice.
-% 
+%
 % For the same basic reason, we retypeset the "Top" at every
 % reference, since the current font is indeterminate.
-% 
+%
 \def\crossmanualxref#1{%
   \setbox\toprefbox = \hbox{Top\kern7sp}%
   \setbox2 = \hbox{\ignorespaces \printedrefname \unskip \kern7sp}%
@@ -9076,13 +9150,12 @@ end
   \fi\fi\fi
 }
 
-% \refx{NAME}{SUFFIX} - reference a cross-reference string named NAME.  SUFFIX 
-% is output afterwards if non-empty.
-\def\refx#1#2{%
+% \refx{NAME} - reference a cross-reference string named NAME.
+\def\refx#1{%
   \requireauxfile
   {%
     \indexnofonts
-    \otherbackslash
+    \turnoffactive
     \def\value##1{##1}%
     \expandafter\global\expandafter\let\expandafter\thisrefX
       \csname XR#1\endcsname
@@ -9105,12 +9178,11 @@ end
     % It's defined, so just use it.
     \thisrefX
   \fi
-  #2% Output the suffix in any case.
 }
 
-% This is the macro invoked by entries in the aux file.  Define a control 
-% sequence for a cross-reference target (we prepend XR to the control sequence 
-% name to avoid collisions).  The value is the page number.  If this is a float 
+% This is the macro invoked by entries in the aux file.  Define a control
+% sequence for a cross-reference target (we prepend XR to the control sequence
+% name to avoid collisions).  The value is the page number.  If this is a float
 % type, we have more work to do.
 %
 \def\xrdef#1#2{%
@@ -9123,7 +9195,13 @@ end
     \xdef\safexrefname{#1}%
   }%
   %
-  \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref
+  \bgroup
+    \expandafter\gdef\csname XR\safexrefname\endcsname{#2}%
+  \egroup
+  % We put the \gdef inside a group to avoid the definitions building up on
+  % TeX's save stack, which can cause it to run out of space for aux files with
+  % thousands of lines.  \gdef doesn't use the save stack, but \csname does
+  % when it defines an unknown control sequence as \relax.
   %
   % Was that xref control sequence that we just defined for a float?
   \expandafter\iffloat\csname XR\safexrefname\endcsname
@@ -9202,19 +9280,6 @@ end
   \catcode`\^^]=\other
   \catcode`\^^^=\other
   \catcode`\^^_=\other
-  % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc.
-  % in xref tags, i.e., node names.  But since ^^e4 notation isn't
-  % supported in the main text, it doesn't seem desirable.  Furthermore,
-  % that is not enough: for node names that actually contain a ^
-  % character, we would end up writing a line like this: 'xrdef {'hat
-  % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first
-  % argument, and \hat is not an expandable control sequence.  It could
-  % all be worked out, but why?  Either we support ^^ or we don't.
-  %
-  % The other change necessary for this was to define \auxhat:
-  % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter
-  % and then to call \auxhat in \setq.
-  %
   \catcode`\^=\other
   %
   % Special characters.  Should be turned off anyway, but...
@@ -9222,24 +9287,17 @@ end
   \catcode`\[=\other
   \catcode`\]=\other
   \catcode`\"=\other
-  \catcode`\_=\other
-  \catcode`\|=\other
-  \catcode`\<=\other
-  \catcode`\>=\other
+  \catcode`\_=\active
+  \catcode`\|=\active
+  \catcode`\<=\active
+  \catcode`\>=\active
   \catcode`\$=\other
   \catcode`\#=\other
   \catcode`\&=\other
   \catcode`\%=\other
   \catcode`+=\other % avoid \+ for paranoia even though we've turned it off
   %
-  % This is to support \ in node names and titles, since the \
-  % characters end up in a \csname.  It's easier than
-  % leaving it active and making its active definition an actual \
-  % character.  What I don't understand is why it works in the *value*
-  % of the xrdef.  Seems like it should be a catcode12 \, and that
-  % should not typeset properly.  But it works, so I'm moving on for
-  % now.  --karl, 15jan04.
-  \catcode`\\=\other
+  \catcode`\\=\active
   %
   % @ is our escape character in .aux files, and we need braces.
   \catcode`\{=1
@@ -9429,7 +9487,7 @@ end
 \newif\ifwarnednoepsf
 \newhelp\noepsfhelp{epsf.tex must be installed for images to
   work.  It is also included in the Texinfo distribution, or you can get
-  it from ftp://tug.org/tex/epsf.tex.}
+  it from https://ctan.org/texarchive/macros/texinfo/texinfo/doc/epsf.tex.}
 %
 \def\image#1{%
   \ifx\epsfbox\thisisundefined
@@ -9453,7 +9511,7 @@ end
 \def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup
   \catcode`\^^M = 5     % in case we're inside an example
   \normalturnoffactive  % allow _ et al. in names
-  \def\xprocessmacroarg{\eatspaces}% in case we are being used via a macro
+  \makevalueexpandable
   % If the image is by itself, center it.
   \ifvmode
     \imagevmodetrue
@@ -9502,7 +9560,7 @@ end
   %
   \ifimagevmode
     \medskip  % space after a standalone image
-  \fi  
+  \fi
   \ifx\centersub\centerV \egroup \fi
 \endgroup}
 
@@ -9570,13 +9628,13 @@ end
       \global\advance\floatno by 1
       %
       {%
-        % This magic value for \lastsection is output by \setref as the
+        % This magic value for \currentsection is output by \setref as the
         % XREFLABEL-title value.  \xrefX uses it to distinguish float
         % labels (which have a completely different output format) from
         % node and anchor labels.  And \xrdef uses it to construct the
         % lists of floats.
         %
-        \edef\lastsection{\floatmagic=\safefloattype}%
+        \edef\currentsection{\floatmagic=\safefloattype}%
         \setref{\floatlabel}{Yfloat}%
       }%
     \fi
@@ -9699,7 +9757,7 @@ end
 
 % #1 is the control sequence we are passed; we expand into a conditional
 % which is true if #1 represents a float ref.  That is, the magic
-% \lastsection value which we \setref above.
+% \currentsection value which we \setref above.
 %
 \def\iffloat#1{\expandafter\doiffloat#1==\finish}
 %
@@ -10333,7 +10391,7 @@ directory should work if nowhere else does.}
         \uppercase{.}
       \endgroup
     \else
-      \errhelp = \EMsimple     
+      \errhelp = \EMsimple
       \errmessage{Unicode character U+#1 not supported, sorry}%
     \fi
   \else
@@ -10366,7 +10424,7 @@ directory should work if nowhere else does.}
     \countUTFz = "#1\relax
     \begingroup
       \parseXMLCharref
-    
+
       % Give \u8:... its definition.  The sequence of seven \expandafter's
       % expands after the \gdef three times, e.g.
       %
@@ -10378,7 +10436,7 @@ directory should work if nowhere else does.}
       \expandafter\expandafter
       \expandafter\expandafter
       \expandafter\gdef       \UTFviiiTmp{#2}%
-      % 
+      %
       \expandafter\ifx\csname uni:#1\endcsname \relax \else
        \message{Internal error, already defined: #1}%
       \fi
@@ -10417,7 +10475,7 @@ directory should work if nowhere else does.}
     \divide\countUTFz by 64
     \countUTFy = \countUTFz  % Save to be the future value of \countUTFz.
     \multiply\countUTFz by 64
-    
+
     % \countUTFz is now \countUTFx with the last 5 bits cleared.  Subtract
     % in order to get the last five bits.
     \advance\countUTFx by -\countUTFz
@@ -10452,7 +10510,7 @@ directory should work if nowhere else does.}
 % U+0080..U+00FF = https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)
 % U+0100..U+017F = https://en.wikipedia.org/wiki/Latin_Extended-A
 % U+0180..U+024F = https://en.wikipedia.org/wiki/Latin_Extended-B
-% 
+%
 % Many of our renditions are less than wonderful, and all the missing
 % characters are available somewhere.  Loading the necessary fonts
 % awaits user request.  We can't truly support Unicode without
@@ -10753,6 +10811,8 @@ directory should work if nowhere else does.}
   \DeclareUnicodeCharacter{0233}{\=y}%
   \DeclareUnicodeCharacter{0237}{\dotless{j}}%
   %
+  \DeclareUnicodeCharacter{02BC}{'}%
+  %
   \DeclareUnicodeCharacter{02DB}{\ogonek{ }}%
   %
   % Greek letters upper case
@@ -11004,7 +11064,6 @@ directory should work if nowhere else does.}
   \DeclareUnicodeCharacter{2113}{\ensuremath\ell}%
   \DeclareUnicodeCharacter{2118}{\ensuremath\wp}%
   \DeclareUnicodeCharacter{211C}{\ensuremath\Re}%
-  \DeclareUnicodeCharacter{2127}{\ensuremath\mho}%
   \DeclareUnicodeCharacter{2135}{\ensuremath\aleph}%
   \DeclareUnicodeCharacter{2190}{\ensuremath\leftarrow}%
   \DeclareUnicodeCharacter{2191}{\ensuremath\uparrow}%
@@ -11020,7 +11079,6 @@ directory should work if nowhere else does.}
   \DeclareUnicodeCharacter{21AA}{\ensuremath\hookrightarrow}%
   \DeclareUnicodeCharacter{21BC}{\ensuremath\leftharpoonup}%
   \DeclareUnicodeCharacter{21BD}{\ensuremath\leftharpoondown}%
-  \DeclareUnicodeCharacter{21BE}{\ensuremath\upharpoonright}%
   \DeclareUnicodeCharacter{21C0}{\ensuremath\rightharpoonup}%
   \DeclareUnicodeCharacter{21C1}{\ensuremath\rightharpoondown}%
   \DeclareUnicodeCharacter{21CC}{\ensuremath\rightleftharpoons}%
@@ -11029,8 +11087,6 @@ directory should work if nowhere else does.}
   \DeclareUnicodeCharacter{21D3}{\ensuremath\Downarrow}%
   \DeclareUnicodeCharacter{21D4}{\ensuremath\Leftrightarrow}%
   \DeclareUnicodeCharacter{21D5}{\ensuremath\Updownarrow}%
-  \DeclareUnicodeCharacter{21DD}{\ensuremath\leadsto}%
-  \DeclareUnicodeCharacter{2201}{\ensuremath\complement}%
   \DeclareUnicodeCharacter{2202}{\ensuremath\partial}%
   \DeclareUnicodeCharacter{2205}{\ensuremath\emptyset}%
   \DeclareUnicodeCharacter{2207}{\ensuremath\nabla}%
@@ -11064,8 +11120,6 @@ directory should work if nowhere else does.}
   \DeclareUnicodeCharacter{2283}{\ensuremath\supset}%
   \DeclareUnicodeCharacter{2286}{\ensuremath\subseteq}%
   \DeclareUnicodeCharacter{228E}{\ensuremath\uplus}%
-  \DeclareUnicodeCharacter{228F}{\ensuremath\sqsubset}%
-  \DeclareUnicodeCharacter{2290}{\ensuremath\sqsupset}%
   \DeclareUnicodeCharacter{2291}{\ensuremath\sqsubseteq}%
   \DeclareUnicodeCharacter{2292}{\ensuremath\sqsupseteq}%
   \DeclareUnicodeCharacter{2293}{\ensuremath\sqcap}%
@@ -11080,8 +11134,6 @@ directory should work if nowhere else does.}
   \DeclareUnicodeCharacter{22A4}{\ensuremath\ptextop}%
   \DeclareUnicodeCharacter{22A5}{\ensuremath\bot}%
   \DeclareUnicodeCharacter{22A8}{\ensuremath\models}%
-  \DeclareUnicodeCharacter{22B4}{\ensuremath\unlhd}%
-  \DeclareUnicodeCharacter{22B5}{\ensuremath\unrhd}%
   \DeclareUnicodeCharacter{22C0}{\ensuremath\bigwedge}%
   \DeclareUnicodeCharacter{22C1}{\ensuremath\bigvee}%
   \DeclareUnicodeCharacter{22C2}{\ensuremath\bigcap}%
@@ -11097,12 +11149,11 @@ directory should work if nowhere else does.}
   \DeclareUnicodeCharacter{2322}{\ensuremath\frown}%
   \DeclareUnicodeCharacter{2323}{\ensuremath\smile}%
   %
-  \DeclareUnicodeCharacter{25A1}{\ensuremath\Box}%
   \DeclareUnicodeCharacter{25B3}{\ensuremath\triangle}%
   \DeclareUnicodeCharacter{25B7}{\ensuremath\triangleright}%
   \DeclareUnicodeCharacter{25BD}{\ensuremath\bigtriangledown}%
   \DeclareUnicodeCharacter{25C1}{\ensuremath\triangleleft}%
-  \DeclareUnicodeCharacter{25C7}{\ensuremath\Diamond}%
+  \DeclareUnicodeCharacter{25C7}{\ensuremath\diamond}%
   \DeclareUnicodeCharacter{2660}{\ensuremath\spadesuit}%
   \DeclareUnicodeCharacter{2661}{\ensuremath\heartsuit}%
   \DeclareUnicodeCharacter{2662}{\ensuremath\diamondsuit}%
@@ -11124,7 +11175,6 @@ directory should work if nowhere else does.}
   \DeclareUnicodeCharacter{2A02}{\ensuremath\bigotimes}%
   \DeclareUnicodeCharacter{2A04}{\ensuremath\biguplus}%
   \DeclareUnicodeCharacter{2A06}{\ensuremath\bigsqcup}%
-  \DeclareUnicodeCharacter{2A1D}{\ensuremath\Join}%
   \DeclareUnicodeCharacter{2A3F}{\ensuremath\amalg}%
   \DeclareUnicodeCharacter{2AAF}{\ensuremath\preceq}%
   \DeclareUnicodeCharacter{2AB0}{\ensuremath\succeq}%
@@ -11197,21 +11247,14 @@ directory should work if nowhere else does.}
    \relax
 }
 
-% define all Unicode characters we know about, for the sake of @U.
+% Define all Unicode characters we know about.  This makes UTF-8 the default
+% input encoding and allows @U to work.
 \iftxinativeunicodecapable
   \nativeunicodechardefsatu
 \else
   \utfeightchardefs
 \fi
 
-
-% Make non-ASCII characters printable again for compatibility with
-% existing Texinfo documents that may use them, even without declaring a
-% document encoding.
-%
-\setnonasciicharscatcode \other
-
-
 \message{formatting,}
 
 \newdimen\defaultparindent \defaultparindent = 15pt
@@ -11279,6 +11322,7 @@ directory should work if nowhere else does.}
     \pdfvorigin = 1 true in
   \else
     \ifx\XeTeXrevision\thisisundefined
+      \special{papersize=#8,#7}%
     \else
       \pdfpageheight #7\relax
       \pdfpagewidth #8\relax
@@ -11316,7 +11360,6 @@ directory should work if nowhere else does.}
   %
   \lispnarrowing = 0.3in
   \tolerance = 700
-  \hfuzz = 1pt
   \contentsrightmargin = 0pt
   \defbodyindent = .5cm
 }}
@@ -11334,7 +11377,6 @@ directory should work if nowhere else does.}
   %
   \lispnarrowing = 0.25in
   \tolerance = 700
-  \hfuzz = 1pt
   \contentsrightmargin = 0pt
   \defbodyindent = .4cm
 }}
@@ -11360,7 +11402,6 @@ directory should work if nowhere else does.}
                     {297mm}{210mm}%
   %
   \tolerance = 700
-  \hfuzz = 1pt
   \contentsrightmargin = 0pt
   \defbodyindent = 5mm
 }}
@@ -11379,7 +11420,6 @@ directory should work if nowhere else does.}
   %
   \lispnarrowing = 0.2in
   \tolerance = 800
-  \hfuzz = 1.2pt
   \contentsrightmargin = 0pt
   \defbodyindent = 2mm
   \tableindent = 12mm
@@ -11407,6 +11447,18 @@ directory should work if nowhere else does.}
   \globaldefs = 0
 }}
 
+\def\bsixpaper{{\globaldefs = 1
+  \afourpaper
+  \internalpagesizes{140mm}{100mm}%
+                    {-6.35mm}{-12.7mm}%
+                    {\bindingoffset}{14pt}%
+                    {176mm}{125mm}%
+  \let\SETdispenvsize=\smallword
+  \lispnarrowing = 0.2in
+  \globaldefs = 0
+}}
+
+
 % @pagesizes TEXTHEIGHT[,TEXTWIDTH]
 % Perhaps we should allow setting the margins, \topskip, \parskip,
 % and/or leading, also. Or perhaps we should compute them somehow.
@@ -11420,10 +11472,12 @@ directory should work if nowhere else does.}
   \setleading{\textleading}%
   %
   \dimen0 = #1\relax
-  \advance\dimen0 by \voffset
+  \advance\dimen0 by 2.5in % default 1in margin above heading line
+                           % and 1.5in to include heading, footing and
+                           % bottom margin
   %
   \dimen2 = \hsize
-  \advance\dimen2 by \normaloffset
+  \advance\dimen2 by 2in % default to 1 inch margin on each side
   %
   \internalpagesizes{#1}{\hsize}%
                     {\voffset}{\normaloffset}%
@@ -11435,6 +11489,9 @@ directory should work if nowhere else does.}
 %
 \letterpaper
 
+% Default value of \hfuzz, for suppressing warnings about overfull hboxes.
+\hfuzz = 1pt
+
 
 \message{and turning on texinfo input format.}
 
@@ -11505,9 +11562,9 @@ directory should work if nowhere else does.}
 \def\texinfochars{%
   \let< = \activeless
   \let> = \activegtr
-  \let~ = \activetilde 
+  \let~ = \activetilde
   \let^ = \activehat
-  \markupsetuplqdefault \markupsetuprqdefault 
+  \setregularquotes
   \let\b = \strong
   \let\i = \smartitalic
   % in principle, all other definitions in \tex have to be undone too.
@@ -11525,11 +11582,9 @@ directory should work if nowhere else does.}
 % \backslashcurfont outputs one backslash character in current font,
 % as in \char`\\.
 \global\chardef\backslashcurfont=`\\
-\global\let\rawbackslashxx=\backslashcurfont  % let existing .??s files work
 
-% \realbackslash is an actual character `\' with catcode other, and
-% \doublebackslash is two of them (for the pdf outlines).
-{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}}
+% \realbackslash is an actual character `\' with catcode other.
+{\catcode`\\=\other @gdef@realbackslash{\}}
 
 % In Texinfo, backslash is an active character; it prints the backslash
 % in fixed width font.
@@ -11547,10 +11602,8 @@ directory should work if nowhere else does.}
 @def@ttbackslash{{@tt @ifmmode @mathchar29020 @else @backslashcurfont @fi}}
 @let@backslashchar = @ttbackslash % @backslashchar{} is for user documents.
 
-% \rawbackslash defines an active \ to do \backslashcurfont.
 % \otherbackslash defines an active \ to be a literal `\' character with
-% catcode other.  We switch back and forth between these.
-@gdef@rawbackslash{@let\=@backslashcurfont}
+% catcode other.
 @gdef@otherbackslash{@let\=@realbackslash}
 
 % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of
@@ -11570,8 +11623,7 @@ directory should work if nowhere else does.}
    @let|=@normalverticalbar
    @let~=@normaltilde
    @let\=@ttbackslash
-   @markupsetuplqdefault
-   @markupsetuprqdefault
+   @setregularquotes
    @unsepspaces
  }
 }
@@ -11600,6 +11652,9 @@ directory should work if nowhere else does.}
   @def ^^M{@let^^M@secondlinenl}%
   % Definition for a newline in the main Texinfo file.
   @gdef @secondlinenl{@fixbackslash}%
+  % In case the first line has a whole-line command on it
+  @let@originalparsearg@parsearg
+  @def@parsearg{@fixbackslash@originalparsearg}
 }}
 
 {@catcode`@^=7 @catcode`@^^M=13%
@@ -11619,7 +11674,8 @@ directory should work if nowhere else does.}
   @ifx\@eatinput @let\ = @ttbackslash @fi
   @catcode13=5 % regular end of line
   @enableemergencynewline
-  @let@c=@texinfoc
+  @let@c=@comment
+  @let@parsearg@originalparsearg
   % Also turn back on active characters that might appear in the input
   % file name, in case not using a pre-dumped format.
   @catcode`+=@active
@@ -11660,11 +11716,10 @@ directory should work if nowhere else does.}
 @c Do this last of all since we use ` in the previous @catcode assignments.
 @catcode`@'=@active
 @catcode`@`=@active
-@markupsetuplqdefault
-@markupsetuprqdefault
+@setregularquotes
 
 @c Local variables:
-@c eval: (add-hook 'write-file-hooks 'time-stamp)
+@c eval: (add-hook 'before-save-hook 'time-stamp)
 @c page-delimiter: "^\\\\message\\|emacs-page"
 @c time-stamp-start: "def\\\\texinfoversion{"
 @c time-stamp-format: "%:y-%02m-%02d.%02H"
index 17ee6b1..fae3a5f 100755 (executable)
@@ -1,11 +1,9 @@
-eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"'
-  & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
-    if 0;
-# Update an FSF copyright year list to include the current year.
+#!/bin/sh
+#! -*-perl-*-
 
-my $VERSION = '2016-01-12.23:13'; # UTC
+# Update an FSF copyright year list to include the current year.
 
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
 #
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -18,10 +16,13 @@ my $VERSION = '2016-01-12.23:13'; # UTC
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+#
 # Written by Jim Meyering and Joel E. Denny
 
+# This script updates an FSF copyright year list to include the current year.
+# Usage: update-copyright [FILE...]
+#
 # The arguments to this script should be names of files that contain
 # copyright statements to be updated.  The copyright holder's name
 # defaults to "Free Software Foundation, Inc." but may be changed to
@@ -81,6 +82,7 @@ my $VERSION = '2016-01-12.23:13'; # UTC
 #        B. (c)
 #        C. @copyright{}
 #        D. &copy;
+#        E. ©
 #
 #   4. The "Copyright" appears at the beginning of a line, except that it
 #      may be prefixed by any sequence (e.g., a comment) of no more than
@@ -96,7 +98,7 @@ my $VERSION = '2016-01-12.23:13'; # UTC
 #   6. Blank lines, even if preceded by the prefix, do not appear
 #      within the FSF copyright statement.
 #   7. Each copyright year is 2 or 4 digits, and years are separated by
-#      commas or dashes.  Whitespace may appear after commas.
+#      commas, "-", or "--".  Whitespace may appear after commas.
 #
 # Environment variables:
 #
@@ -120,11 +122,32 @@ my $VERSION = '2016-01-12.23:13'; # UTC
 #   5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other
 #      than "Free Software Foundation, Inc.".
 
+# This is a prologue that allows to run a perl script as an executable
+# on systems that are compliant to a POSIX version before POSIX:2017.
+# On such systems, the usual invocation of an executable through execlp()
+# or execvp() fails with ENOEXEC if it is a script that does not start
+# with a #! line.  The script interpreter mentioned in the #! line has
+# to be /bin/sh, because on GuixSD systems that is the only program that
+# has a fixed file name.  The second line is essential for perl and is
+# also useful for editing this file in Emacs.  The next two lines below
+# are valid code in both sh and perl.  When executed by sh, they re-execute
+# the script through the perl program found in $PATH.  The '-x' option
+# is essential as well; without it, perl would re-execute the script
+# through /bin/sh.  When executed by perl, the next two lines are a no-op.
+eval 'exec perl -wSx -0777 -pi "$0" "$@"'
+     if 0;
+
+my $VERSION = '2020-04-04.15:07'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job.  Otherwise, update this string manually.
+
 use strict;
 use warnings;
 
 my $copyright_re = 'Copyright';
-my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|&copy;)';
+my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|&copy;)';
 my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
 $holder ||= 'Free Software Foundation, Inc.';
 my $prefix_max = 5;
@@ -169,7 +192,7 @@ while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
     $holder_re =~ s/\s/$ws_re/g;
     my $stmt_remainder_re =
       "(?:$ws_re$circle_c_re)?"
-      . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*"
+      . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|--?))*"
       . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
     if (/\G$stmt_remainder_re/)
       {
@@ -208,26 +231,28 @@ if (defined $stmt_re)
         # Make the use of intervals consistent.
         if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
           {
-            $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
+            $stmt =~ s/(\d{4})--?(\d{4})/join(', ', $1..$2)/eg;
           }
         else
           {
+            my $ndash = $ARGV =~ /\.tex(i(nfo)?)?$/ ? "--" : "-";
+
             $stmt =~
               s/
                 (\d{4})
                 (?:
-                  (,\ |-)
+                  (,\ |--?)
                   ((??{
-                    if    ($2 eq '-') { '\d{4}'; }
+                    if   ($2 ne ', ') { '\d{4}'; }
                     elsif (!$3)       { $1 + 1;  }
                     else              { $3 + 1;  }
                   }))
                 )+
-              /$1-$3/gx;
+              /$1$ndash$3/gx;
 
             # When it's 2, emit a single range encompassing all year numbers.
             $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
-              and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
+              and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1$ndash$2/;
           }
 
         # Format within margin.
@@ -263,10 +288,13 @@ else
     print STDERR "$ARGV: warning: copyright statement not found\n";
   }
 
+# Hey Emacs!
 # Local variables:
+# coding: utf-8
 # mode: perl
 # indent-tabs-mode: nil
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-line-limit: 200
 # time-stamp-start: "my $VERSION = '"
 # time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
 # time-stamp-time-zone: "UTC0"
index d7a8c0d..5bbbc44 100755 (executable)
@@ -1,39 +1,56 @@
-eval '(exit $?0)' && eval 'exec perl -wST "$0" "$@"'
-  & eval 'exec perl -wST "$0" $argv:q'
-    if 0;
+#!/bin/sh
+#! -*-perl-*-
+
 # Detect instances of "if (p) free (p);".
 # Likewise "if (p != 0)", "if (0 != p)", or with NULL; and with braces.
 
-my $VERSION = '2016-08-01 17:47'; # UTC
-# The definition above must lie within the first 8 lines in order
-# for the Emacs time-stamp write hook (at end) to update it.
-# If you change this file with Emacs, please let the write hook
-# do its job.  Otherwise, update this string manually.
-
-# Copyright (C) 2008-2016 Free Software Foundation, Inc.
-
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
+#
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, either version 3 of the License, or
 # (at your option) any later version.
-
+#
 # This program is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-
+#
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+#
 # Written by Jim Meyering
 
+# This is a prologue that allows to run a perl script as an executable
+# on systems that are compliant to a POSIX version before POSIX:2017.
+# On such systems, the usual invocation of an executable through execlp()
+# or execvp() fails with ENOEXEC if it is a script that does not start
+# with a #! line.  The script interpreter mentioned in the #! line has
+# to be /bin/sh, because on GuixSD systems that is the only program that
+# has a fixed file name.  The second line is essential for perl and is
+# also useful for editing this file in Emacs.  The next two lines below
+# are valid code in both sh and perl.  When executed by sh, they re-execute
+# the script through the perl program found in $PATH.  The '-x' option
+# is essential as well; without it, perl would re-execute the script
+# through /bin/sh.  When executed by perl, the next two lines are a no-op.
+eval 'exec perl -wSx "$0" "$@"'
+     if 0;
+
+my $VERSION = '2021-04-11 10:11'; # UTC
+# The definition above must lie within the first 8 lines in order
+# for the Emacs time-stamp write hook (at end) to update it.
+# If you change this file with Emacs, please let the write hook
+# do its job.  Otherwise, update this string manually.
+
+my $copyright_year = '2021';
+
 use strict;
 use warnings;
 use Getopt::Long;
 
 (my $ME = $0) =~ s|.*/||;
 
-# use File::Coda; # http://meyering.net/code/Coda/
+# use File::Coda; # https://meyering.net/code/Coda/
 END {
   defined fileno STDOUT or return;
   close STDOUT and return;
@@ -103,7 +120,19 @@ sub is_NULL ($)
   GetOptions
     (
      help => sub { usage 0 },
-     version => sub { print "$ME version $VERSION\n"; exit },
+     version =>
+       sub
+       {
+         print "$ME version $VERSION\n";
+         print "Copyright (C) $copyright_year Free Software Foundation, Inc.\n";
+         print "License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.\n"
+             . "This is free software: you are free to change and redistribute it.\n"
+             . "There is NO WARRANTY, to the extent permitted by law.\n";
+         print "\n";
+         my $author = "Jim Meyering";
+         print "Written by $author.\n";
+         exit
+       },
      list => \$list,
      'name=s@' => \@name,
     ) or usage 1;
@@ -202,7 +231,8 @@ EOF
 ## Local Variables:
 ## mode: perl
 ## indent-tabs-mode: nil
-## eval: (add-hook 'write-file-hooks 'time-stamp)
+## eval: (add-hook 'before-save-hook 'time-stamp)
+## time-stamp-line-limit: 50
 ## time-stamp-start: "my $VERSION = '"
 ## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
 ## time-stamp-time-zone: "UTC0"
index c5c420a..cf168ea 100755 (executable)
@@ -2,9 +2,9 @@
 # List version-controlled file names.
 
 # Print a version string.
-scriptversion=2016-01-11.22; # UTC
+scriptversion=2018-03-07.03; # UTC
 
-# Copyright (C) 2006-2016 Free Software Foundation, Inc.
+# Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -17,7 +17,7 @@ scriptversion=2016-01-11.22; # UTC
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 
 # List the specified version-controlled files.
@@ -25,7 +25,7 @@ scriptversion=2016-01-11.22; # UTC
 # list the version-controlled files in that directory.
 
 # If there's an argument, it must be a single, "."-relative directory name.
-# cvsu is part of the cvsutils package: http://www.red-bean.com/cvsutils/
+# cvsu is part of the cvsutils package: https://www.red-bean.com/cvsutils/
 
 postprocess=
 case $1 in
@@ -49,7 +49,7 @@ EOF
     cat <<EOF
 vc-list-files $scriptversion
 Copyright (C) $year Free Software Foundation, Inc,
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 EOF
@@ -65,7 +65,7 @@ test $# = 0 && set .
 
 for dir
 do
-  if test -d .git; then
+  if test -d .git || test -f .git; then
     test "x$dir" = x. \
       && dir= sed_esc= \
       || { dir="$dir/"; sed_esc=`echo "$dir"|env sed 's,\([\\/]\),\\\\\1,g'`; }
@@ -105,7 +105,7 @@ do
 done
 
 # Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
 # time-stamp-start: "scriptversion="
 # time-stamp-format: "%:y-%02m-%02d.%02H"
 # time-stamp-time-zone: "UTC0"
index d60484b..2663197 100644 (file)
@@ -1,7 +1,7 @@
 ;;; Boxed comments for C mode.
-;;; Copyright (C) 1991-1994, 2008-2014, 2016 Free Software Foundation,
-;;; Inc.
-;;; Francois Pinard <pinard@iro.umontreal.ca>, April 1991.
+;;; Copyright (C) 1991-1994, 2008-2014, 2016-2017, 2020-2021 Free
+;;; Software Foundation, Inc.
+;;; François Pinard <pinard@iro.umontreal.ca>, April 1991.
 ;;;
 ;;; This file is part of GNU M4.
 ;;;
@@ -16,7 +16,7 @@
 ;;; GNU General Public License for more details.
 ;;;
 ;;; You should have received a copy of the GNU General Public License
-;;; along with this program.  If not, see <http://www.gnu.org/licenses/>.
+;;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 ;;; I often refill paragraphs inside C comments, while stretching or
 ;;; shrinking the surrounding box as needed.  This is a real pain to
diff --git a/cfg.mk b/cfg.mk
index e72cc46..809947b 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -1,5 +1,6 @@
 # Customize maint.mk.                           -*- makefile -*-
-# Copyright (C) 2003-2014, 2016 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014, 2016-2017, 2020-2021 Free Software
+# Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -12,7 +13,7 @@
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # Used in maint.mk's web-manual rule
 manual_title = GNU macro processor
@@ -33,7 +34,10 @@ local-checks-to-skip += sc_cast_of_x_alloc_return_value
 config_h_header = "m4\.h"
 
 # Hash of NEWS contents, to ensure we don't add entries to wrong section.
-old_NEWS_hash = ef92e5b599b23d9dfe915db5ce4194c5
+old_NEWS_hash = 9f7b57774172e11c4a0a9ea4d2e2effe
+
+# Update m4-latest.tar.* symlinks during 'make stable/beta'.
+GNUPLOADFLAGS = --symlink-regex
 
 # Indent only with spaces.
 sc_prohibit_tab_based_indentation:
index babd667..c72d935 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:713: Origin of test
+dnl @ ../doc/m4.texi:717: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -s
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 33d60ea..35daae8 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:896: Origin of test
+dnl @ ../doc/m4.texi:900: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -Dbar=hello -tbar --debugfile= foo --debugfile -
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index bd2d83c..7f0e51e 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:955: Origin of test
+dnl @ ../doc/m4.texi:959: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -Dbar=hello foo -Dbar=world foo
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 8131f7a..502c09b 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:978: Origin of test
+dnl @ ../doc/m4.texi:982: Origin of test
 dnl @ expected status: 1
 dnl @ extra options:  Makefile/
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 5f9e690..79adad1 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:986: Origin of test
+dnl @ ../doc/m4.texi:990: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index ffe1251..63626c2 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1000: Origin of test
+dnl @ ../doc/m4.texi:1004: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index ab767ef..731c9f5 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1021: Origin of test
+dnl @ ../doc/m4.texi:1025: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index bee94c8..060cb0a 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1114: Origin of test
+dnl @ ../doc/m4.texi:1118: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 452110d..d56cf57 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1129: Origin of test
+dnl @ ../doc/m4.texi:1133: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index ea2c342..0dafd38 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1221: Origin of test
+dnl @ ../doc/m4.texi:1225: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index dbb0231..76bd285 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1299: Origin of test
+dnl @ ../doc/m4.texi:1303: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 87459e5..4099b44 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1425: Origin of test
+dnl @ ../doc/m4.texi:1429: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 425a18e..f4eaa9a 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1441: Origin of test
+dnl @ ../doc/m4.texi:1445: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -P
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c74bfde..deb1385 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1472: Origin of test
+dnl @ ../doc/m4.texi:1476: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index ea0ce55..d5b5f5b 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1486: Origin of test
+dnl @ ../doc/m4.texi:1490: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 765f754..be3714c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1503: Origin of test
+dnl @ ../doc/m4.texi:1507: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 253efd0..95f3150 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1517: Origin of test
+dnl @ ../doc/m4.texi:1521: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 4c1e246..6018902 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1531: Origin of test
+dnl @ ../doc/m4.texi:1535: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 5cb3997..f25c149 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1543: Origin of test
+dnl @ ../doc/m4.texi:1547: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 51cf16a..78b8eb8 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1575: Origin of test
+dnl @ ../doc/m4.texi:1579: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 224972d..6fb2505 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1603: Origin of test
+dnl @ ../doc/m4.texi:1607: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 673b7ef..c37cf0c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1616: Origin of test
+dnl @ ../doc/m4.texi:1620: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -Q
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 6c0dd9b..75d7cb4 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1646: Origin of test
+dnl @ ../doc/m4.texi:1650: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 8108028..18a8962 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1658: Origin of test
+dnl @ ../doc/m4.texi:1662: Origin of test
 dnl @ expected status: 1
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 5a5352f..c81117d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1717: Origin of test
+dnl @ ../doc/m4.texi:1721: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c44cfab..4a44f19 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1745: Origin of test
+dnl @ ../doc/m4.texi:1749: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -Dbar=Hello -Dfoo=bar
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 27cd614..28ab67b 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1760: Origin of test
+dnl @ ../doc/m4.texi:1764: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -Dfoo -Decho=$@
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 1cdc55b..dc586a7 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1809: Origin of test
+dnl @ ../doc/m4.texi:1813: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 6130217..8e3b5a5 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1826: Origin of test
+dnl @ ../doc/m4.texi:1830: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index df24135..71556e2 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1860: Origin of test
+dnl @ ../doc/m4.texi:1864: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 5513894..2699f56 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1894: Origin of test
+dnl @ ../doc/m4.texi:1898: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index cc0d571..e75a392 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1904: Origin of test
+dnl @ ../doc/m4.texi:1908: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index b1f86b1..685bbae 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1920: Origin of test
+dnl @ ../doc/m4.texi:1924: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 0e0c794..46dc140 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1930: Origin of test
+dnl @ ../doc/m4.texi:1934: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 20873c8..f413c72 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1965: Origin of test
+dnl @ ../doc/m4.texi:1969: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index fe47ecb..9027161 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:1987: Origin of test
+dnl @ ../doc/m4.texi:1991: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  --warn-macro-sequence
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 9cedbc3..58eb478 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2013: Origin of test
+dnl @ ../doc/m4.texi:2017: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 071c699..3842e52 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2035: Origin of test
+dnl @ ../doc/m4.texi:2039: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 454232c..51fab67 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2048: Origin of test
+dnl @ ../doc/m4.texi:2052: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 65e3e63..81f5ae1 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2059: Origin of test
+dnl @ ../doc/m4.texi:2063: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 3257fcd..d0d9e80 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2069: Origin of test
+dnl @ ../doc/m4.texi:2073: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 2c937e1..2fcc315 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2091: Origin of test
+dnl @ ../doc/m4.texi:2095: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 2f06065..e5ab3be 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2113: Origin of test
+dnl @ ../doc/m4.texi:2117: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 756685c..c337d0e 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2141: Origin of test
+dnl @ ../doc/m4.texi:2145: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 81a0e86..a035946 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2157: Origin of test
+dnl @ ../doc/m4.texi:2161: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 92c84b1..e3e777f 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2196: Origin of test
+dnl @ ../doc/m4.texi:2200: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 817cabc..92f9b0c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2216: Origin of test
+dnl @ ../doc/m4.texi:2220: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 9e81a16..32023c6 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2259: Origin of test
+dnl @ ../doc/m4.texi:2263: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 766aa45..834a79b 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2276: Origin of test
+dnl @ ../doc/m4.texi:2280: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 219f1b3..cc73155 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2288: Origin of test
+dnl @ ../doc/m4.texi:2292: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 1c0c9cd..411e341 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2307: Origin of test
+dnl @ ../doc/m4.texi:2311: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 7c4c6d7..12c0062 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2331: Origin of test
+dnl @ ../doc/m4.texi:2335: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 8571fad..7c2d1a6 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2350: Origin of test
+dnl @ ../doc/m4.texi:2354: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 733927c..f728c73 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2367: Origin of test
+dnl @ ../doc/m4.texi:2371: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 7da5f38..0ba0727 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2419: Origin of test
+dnl @ ../doc/m4.texi:2423: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 907cdcd..6635fd6 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2456: Origin of test
+dnl @ ../doc/m4.texi:2460: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index b13a49b..599ffef 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2505: Origin of test
+dnl @ ../doc/m4.texi:2509: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 72e35b1..8b827f8 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2525: Origin of test
+dnl @ ../doc/m4.texi:2529: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c1450a5..4aca86a 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2543: Origin of test
+dnl @ ../doc/m4.texi:2547: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 92b079f..86e14b6 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2581: Origin of test
+dnl @ ../doc/m4.texi:2585: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 7470246..11b703e 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2614: Origin of test
+dnl @ ../doc/m4.texi:2618: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -P
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 1ce4167..2227c81 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2632: Origin of test
+dnl @ ../doc/m4.texi:2636: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index a2e9fcd..1bfa506 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2659: Origin of test
+dnl @ ../doc/m4.texi:2663: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index b451580..3b873c8 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2666: Origin of test
+dnl @ ../doc/m4.texi:2670: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 1b78189..c91aaa7 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2717: Origin of test
+dnl @ ../doc/m4.texi:2721: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 8e0bfb8..c1cdd03 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2765: Origin of test
+dnl @ ../doc/m4.texi:2769: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 6a2aa8b..46e8fe8 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2775: Origin of test
+dnl @ ../doc/m4.texi:2779: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index e29cee0..6aa292a 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2795: Origin of test
+dnl @ ../doc/m4.texi:2799: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 7bde247..00823d2 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2819: Origin of test
+dnl @ ../doc/m4.texi:2823: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index be7a308..d3bdc94 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2837: Origin of test
+dnl @ ../doc/m4.texi:2841: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index d51fa66..8f1d158 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2918: Origin of test
+dnl @ ../doc/m4.texi:2922: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 7e058eb..efe6146 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2937: Origin of test
+dnl @ ../doc/m4.texi:2941: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index db4364a..0f44e65 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:2972: Origin of test
+dnl @ ../doc/m4.texi:2976: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 2186259..abc29bc 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3027: Origin of test
+dnl @ ../doc/m4.texi:3031: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index fcd45d6..9892108 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3056: Origin of test
+dnl @ ../doc/m4.texi:3060: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 80491f9..7baced0 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3134: Origin of test
+dnl @ ../doc/m4.texi:3138: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 6f32fc7..f460f37 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3167: Origin of test
+dnl @ ../doc/m4.texi:3171: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 5893ea0..e81f02d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3200: Origin of test
+dnl @ ../doc/m4.texi:3204: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 53f93cd..f0430d1 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3232: Origin of test
+dnl @ ../doc/m4.texi:3236: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index f210446..e42ed8d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3243: Origin of test
+dnl @ ../doc/m4.texi:3247: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 64ddec2..eb9b565 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3271: Origin of test
+dnl @ ../doc/m4.texi:3275: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 05a4b5f..a5ad562 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3318: Origin of test
+dnl @ ../doc/m4.texi:3322: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 92c52b2..7b5253a 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3341: Origin of test
+dnl @ ../doc/m4.texi:3345: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 3ab3cf8..d876a10 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3371: Origin of test
+dnl @ ../doc/m4.texi:3375: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 11f94a9..ecffb04 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3398: Origin of test
+dnl @ ../doc/m4.texi:3402: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index b1554f4..05fdf98 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3423: Origin of test
+dnl @ ../doc/m4.texi:3427: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 8d3c6c0..42f4ce9 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3450: Origin of test
+dnl @ ../doc/m4.texi:3454: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 052bf0a..dbee13c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3491: Origin of test
+dnl @ ../doc/m4.texi:3495: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index ab42127..4b709de 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3527: Origin of test
+dnl @ ../doc/m4.texi:3531: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 657d63d..61d3464 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3590: Origin of test
+dnl @ ../doc/m4.texi:3594: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 24f9b4c..b921235 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3637: Origin of test
+dnl @ ../doc/m4.texi:3641: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index cc3c537..ef69b68 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3662: Origin of test
+dnl @ ../doc/m4.texi:3666: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index fa5b000..d95994d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3701: Origin of test
+dnl @ ../doc/m4.texi:3705: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index bf1dfcc..65685aa 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3759: Origin of test
+dnl @ ../doc/m4.texi:3763: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 28f5551..3d48e03 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3776: Origin of test
+dnl @ ../doc/m4.texi:3780: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 1f92116..0df6a13 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3819: Origin of test
+dnl @ ../doc/m4.texi:3823: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c9ad5be..dfb63a7 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3847: Origin of test
+dnl @ ../doc/m4.texi:3851: Origin of test
 dnl @ expected status: 1
 dnl @ extra options:  -dp -L3 -tifelse
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 396e6f1..2ae4367 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3865: Origin of test
+dnl @ ../doc/m4.texi:3869: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index f8b2454..c47daa6 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3901: Origin of test
+dnl @ ../doc/m4.texi:3905: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index da172b2..4213548 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:3935: Origin of test
+dnl @ ../doc/m4.texi:3939: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -de --trace ifelse
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 8aca4a5..7fb8788 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4041: Origin of test
+dnl @ ../doc/m4.texi:4045: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -dp
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 05884d3..0655cde 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4070: Origin of test
+dnl @ ../doc/m4.texi:4074: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -l6
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 3be83b7..6d41515 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4088: Origin of test
+dnl @ ../doc/m4.texi:4092: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -dip
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 6dd576d..47d8a53 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4123: Origin of test
+dnl @ ../doc/m4.texi:4127: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 8a77a05..70ad05d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4176: Origin of test
+dnl @ ../doc/m4.texi:4180: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index a287f92..2f3b68f 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4194: Origin of test
+dnl @ ../doc/m4.texi:4198: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index f0707c0..8befdee 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4205: Origin of test
+dnl @ ../doc/m4.texi:4209: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index e9c781e..c38c543 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4236: Origin of test
+dnl @ ../doc/m4.texi:4240: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 7736241..7dae549 100644 (file)
@@ -9,9 +9,9 @@ dnl @ with or without modifications, as long as this notice
 dnl @ is preserved.
 define(`a', `b')
 dnl @result{}
-«a»
-dnl @result{}«b»
-changequote(`«', `»')
+«a»
+dnl @result{}«b»
+changequote(`«', `»')
 dnl @result{}
-«a»
+«a»
 dnl @result{}a
index 231ca28..dfd717e 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4530: Origin of test
+dnl @ ../doc/m4.texi:4526: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
@@ -9,9 +9,9 @@ dnl @ with or without modifications, as long as this notice
 dnl @ is preserved.
 define(`a', `b')
 dnl @result{}
-«a»
-dnl @result{}«b»
-changecom(`«', `»')
+«a»
+dnl @result{}«b»
+changecom(`«', `»')
 dnl @result{}
-«a»
-dnl @result{}«a»
+«a»
+dnl @result{}«a»
index 7ef04d0..c66142d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4553: Origin of test
+dnl @ ../doc/m4.texi:4549: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 8e89c09..1e65d2e 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4576: Origin of test
+dnl @ ../doc/m4.texi:4572: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 218231b..27c120f 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4608: Origin of test
+dnl @ ../doc/m4.texi:4604: Origin of test
 dnl @ expected status: 1
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index f12c391..401c2b8 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4662: Origin of test
+dnl @ ../doc/m4.texi:4658: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index d71b3ce..a8147b6 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4675: Origin of test
+dnl @ ../doc/m4.texi:4671: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c871657..5c20aa6 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4694: Origin of test
+dnl @ ../doc/m4.texi:4690: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 978bde6..dbcbfa3 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4736: Origin of test
+dnl @ ../doc/m4.texi:4732: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 4b01a0a..1fb341f 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4774: Origin of test
+dnl @ ../doc/m4.texi:4770: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 84be7e6..d2bd20c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4811: Origin of test
+dnl @ ../doc/m4.texi:4807: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c72fa05..ea19b0a 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4864: Origin of test
+dnl @ ../doc/m4.texi:4860: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index e96d34c..616c513 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4896: Origin of test
+dnl @ ../doc/m4.texi:4892: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 700564e..942d07d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4926: Origin of test
+dnl @ ../doc/m4.texi:4922: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index d740457..8325e1a 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4951: Origin of test
+dnl @ ../doc/m4.texi:4947: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 55e500a..fceda5c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4965: Origin of test
+dnl @ ../doc/m4.texi:4961: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index ea06975..adcdbe7 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:4980: Origin of test
+dnl @ ../doc/m4.texi:4976: Origin of test
 dnl @ expected status: 1
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 4c54297..608c7fa 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5023: Origin of test
+dnl @ ../doc/m4.texi:5019: Origin of test
 dnl @ expected status: 1
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 27bf3a3..6f45fda 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5056: Origin of test
+dnl @ ../doc/m4.texi:5052: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 93faf4b..68e6760 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5073: Origin of test
+dnl @ ../doc/m4.texi:5069: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 76e9978..87b9eda 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5102: Origin of test
+dnl @ ../doc/m4.texi:5098: Origin of test
 dnl @ expected status: 1
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index caaf6b1..708f995 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5115: Origin of test
+dnl @ ../doc/m4.texi:5111: Origin of test
 dnl @ expected status: 1
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 4c15f8a..9967732 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5123: Origin of test
+dnl @ ../doc/m4.texi:5119: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 82f26ab..057f397 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5180: Origin of test
+dnl @ ../doc/m4.texi:5176: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 2d87dfe..813f1ed 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5217: Origin of test
+dnl @ ../doc/m4.texi:5213: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 6b5f8f7..b167c98 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5249: Origin of test
+dnl @ ../doc/m4.texi:5245: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index beb15cf..ec13b19 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5265: Origin of test
+dnl @ ../doc/m4.texi:5261: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 7d11742..0a12da0 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5312: Origin of test
+dnl @ ../doc/m4.texi:5308: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index a23d535..21b98f3 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5328: Origin of test
+dnl @ ../doc/m4.texi:5324: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index e2fb4ce..abcb955 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5347: Origin of test
+dnl @ ../doc/m4.texi:5343: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 1397231..652b556 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5361: Origin of test
+dnl @ ../doc/m4.texi:5357: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 20f3b43..5b7aa14 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5376: Origin of test
+dnl @ ../doc/m4.texi:5372: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index a89af91..1192a03 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5410: Origin of test
+dnl @ ../doc/m4.texi:5406: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 93eb62f..17557a3 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5433: Origin of test
+dnl @ ../doc/m4.texi:5429: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 287602e..99c9ba1 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5457: Origin of test
+dnl @ ../doc/m4.texi:5453: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index dce1c29..28ea2c7 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5476: Origin of test
+dnl @ ../doc/m4.texi:5472: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 81ce0d7..33bf77d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5505: Origin of test
+dnl @ ../doc/m4.texi:5501: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 4d1d57d..f6fe2b8 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5520: Origin of test
+dnl @ ../doc/m4.texi:5516: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 9eff3fc..2668637 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5542: Origin of test
+dnl @ ../doc/m4.texi:5538: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 6177395..05c5cea 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5568: Origin of test
+dnl @ ../doc/m4.texi:5564: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index ab4a4f0..65f2f75 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5587: Origin of test
+dnl @ ../doc/m4.texi:5583: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index d88d358..2618d8d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5627: Origin of test
+dnl @ ../doc/m4.texi:5623: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 24c1bea..66e1aab 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5649: Origin of test
+dnl @ ../doc/m4.texi:5645: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 63942db..f0dd912 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5659: Origin of test
+dnl @ ../doc/m4.texi:5655: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 09c53a9..1a3a723 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5673: Origin of test
+dnl @ ../doc/m4.texi:5669: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index a4f7fd2..3d1d683 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5682: Origin of test
+dnl @ ../doc/m4.texi:5678: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 63ca6b4..e1074de 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5731: Origin of test
+dnl @ ../doc/m4.texi:5727: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index d36c065..fd4326a 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5744: Origin of test
+dnl @ ../doc/m4.texi:5740: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c6f1b35..40d603b 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5761: Origin of test
+dnl @ ../doc/m4.texi:5757: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 938a2b9..cdc365e 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5789: Origin of test
+dnl @ ../doc/m4.texi:5785: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c0d1f92..6e8d2b5 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5798: Origin of test
+dnl @ ../doc/m4.texi:5794: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 5864f44..a4c233a 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5843: Origin of test
+dnl @ ../doc/m4.texi:5839: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 27d8535..024f6c9 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5870: Origin of test
+dnl @ ../doc/m4.texi:5867: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
@@ -7,5 +7,5 @@ dnl @ This file is free software; the Free Software Foundation
 dnl @ gives unlimited permission to copy and/or distribute it
 dnl @ with or without modifications, as long as this notice
 dnl @ is preserved.
-translit(`«abc~', `~-»')
+translit(`«abc~', `~-»')
 dnl @result{}abc
index 68bb498..0ded851 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5877: Origin of test
+dnl @ ../doc/m4.texi:5874: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 64ca2ef..82f9c98 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5905: Origin of test
+dnl @ ../doc/m4.texi:5902: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 7a6dd9c..f72864f 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5949: Origin of test
+dnl @ ../doc/m4.texi:5946: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index f028cce..c0fb29b 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:5982: Origin of test
+dnl @ ../doc/m4.texi:5979: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 46e49b3..a69b5be 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6002: Origin of test
+dnl @ ../doc/m4.texi:5999: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c5d4bc5..767bf52 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6023: Origin of test
+dnl @ ../doc/m4.texi:6020: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 244d5d2..5b5a811 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6038: Origin of test
+dnl @ ../doc/m4.texi:6035: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index eda009e..1c5c906 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6069: Origin of test
+dnl @ ../doc/m4.texi:6066: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 0ce199f..6ab42e9 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6096: Origin of test
+dnl @ ../doc/m4.texi:6093: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 2d047ab..b688aec 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6137: Origin of test
+dnl @ ../doc/m4.texi:6134: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index e728310..ec7bc9d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6149: Origin of test
+dnl @ ../doc/m4.texi:6146: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index b9eed79..cb9906e 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6187: Origin of test
+dnl @ ../doc/m4.texi:6184: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 2e5c05a..b0d6963 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6264: Origin of test
+dnl @ ../doc/m4.texi:6261: Origin of test
 dnl @ expected status: 1
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index d423098..659dc89 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6297: Origin of test
+dnl @ ../doc/m4.texi:6294: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index ea6051a..2fcc927 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6330: Origin of test
+dnl @ ../doc/m4.texi:6327: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index b15ab82..a78e514 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6366: Origin of test
+dnl @ ../doc/m4.texi:6363: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c059a90..ff3a1a6 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6405: Origin of test
+dnl @ ../doc/m4.texi:6402: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index e943577..34c758f 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6438: Origin of test
+dnl @ ../doc/m4.texi:6435: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index e5067e4..3ba792c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6519: Origin of test
+dnl @ ../doc/m4.texi:6516: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index f8ca0a3..99894c9 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6530: Origin of test
+dnl @ ../doc/m4.texi:6527: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -G
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index b7a777f..c5d6ed4 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6553: Origin of test
+dnl @ ../doc/m4.texi:6550: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 021e416..ac4e58c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6595: Origin of test
+dnl @ ../doc/m4.texi:6592: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 1f80eaa..5b1cd50 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6624: Origin of test
+dnl @ ../doc/m4.texi:6621: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 2b51ac6..a1b8393 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6672: Origin of test
+dnl @ ../doc/m4.texi:6669: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 23c71ca..9106627 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6702: Origin of test
+dnl @ ../doc/m4.texi:6699: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 68ffc9a..9be8381 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6752: Origin of test
+dnl @ ../doc/m4.texi:6751: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
@@ -12,7 +12,13 @@ dnl recognizable.
 ifdef(`__unix__', ,
       `errprint(` skipping: syscmd does not have unix semantics
 ')m4exit(`77')')dnl
-syscmd(`kill -9 $$')
+changequote(`[', `]')
+dnl @result{}
+syscmd([/bin/sh -c 'kill -9 $$'; st=$?; test $st = 137 || test $st = 265])
+dnl @result{}
+ifelse(sysval, [0], , [errprint([ skipping: shell does not send signal 9
+])m4exit([77])])dnl
+syscmd([kill -9 $$])
 dnl @result{}
 sysval
 dnl @result{}2304
@@ -20,7 +26,7 @@ syscmd()
 dnl @result{}
 sysval
 dnl @result{}0
-esyscmd(`kill -9 $$')
+esyscmd([kill -9 $$])
 dnl @result{}
 sysval
 dnl @result{}2304
index 3324422..3c1b135 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6846: Origin of test
+dnl @ ../doc/m4.texi:6851: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index ccd86f3..e01fa60 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6877: Origin of test
+dnl @ ../doc/m4.texi:6882: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 18bbaa5..1e5fa95 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6892: Origin of test
+dnl @ ../doc/m4.texi:6897: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -G
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c8eaa90..55e8760 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6938: Origin of test
+dnl @ ../doc/m4.texi:6943: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index e2cdc7d..6c02988 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6975: Origin of test
+dnl @ ../doc/m4.texi:6980: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index fb5edd6..e877d9e 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:6995: Origin of test
+dnl @ ../doc/m4.texi:7000: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index a9ba258..bbc71ad 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7016: Origin of test
+dnl @ ../doc/m4.texi:7021: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 0a92514..4aa8602 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7073: Origin of test
+dnl @ ../doc/m4.texi:7078: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 3b3f097..8817824 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7091: Origin of test
+dnl @ ../doc/m4.texi:7096: Origin of test
 dnl @ expected status: 1
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 5753519..c4830a9 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7227: Origin of test
+dnl @ ../doc/m4.texi:7232: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -F /dev/null
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 564d152..1863995 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7233: Origin of test
+dnl @ ../doc/m4.texi:7238: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c28b071..a975051 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7253: Origin of test
+dnl @ ../doc/m4.texi:7258: Origin of test
 dnl @ expected status: 1
 dnl @ extra options:  -F /none/such
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 0319cea..fff999e 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7389: Origin of test
+dnl @ ../doc/m4.texi:7394: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 3f4d59a..bcbebfc 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7683: Origin of test
+dnl @ ../doc/m4.texi:7688: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -s
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 513940c..617657c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7708: Origin of test
+dnl @ ../doc/m4.texi:7713: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 22c290a..fd0232d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7762: Origin of test
+dnl @ ../doc/m4.texi:7767: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 2542398..1d7882f 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7784: Origin of test
+dnl @ ../doc/m4.texi:7789: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 8bc2146..d82f8bd 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7825: Origin of test
+dnl @ ../doc/m4.texi:7830: Origin of test
 dnl @ expected status: 1
 dnl @ extra options:  -L9
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index e9f40d5..7187b4a 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7868: Origin of test
+dnl @ ../doc/m4.texi:7873: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 118cc6a..1b3da26 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7919: Origin of test
+dnl @ ../doc/m4.texi:7924: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index f8747d9..24068ee 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:7961: Origin of test
+dnl @ ../doc/m4.texi:7966: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 656b77d..a018e78 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8014: Origin of test
+dnl @ ../doc/m4.texi:8019: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index e4f6798..bfa57bc 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8101: Origin of test
+dnl @ ../doc/m4.texi:8106: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index d0a9d3b..ff2f7dc 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8137: Origin of test
+dnl @ ../doc/m4.texi:8142: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index bc64574..cacd476 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8191: Origin of test
+dnl @ ../doc/m4.texi:8196: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c8d1db5..8542b5b 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8272: Origin of test
+dnl @ ../doc/m4.texi:8277: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -Dlimit=10 -Dverbose
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index c7f7b1a..ec5f85c 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8282: Origin of test
+dnl @ ../doc/m4.texi:8287: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -Dlimit=10 -Dverbose -Dalt
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index fdc8212..ef9ca4b 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8292: Origin of test
+dnl @ ../doc/m4.texi:8297: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -Dlimit=10 -Dverbose -Dalt=4
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 1d33e3b..f1cee0f 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8300: Origin of test
+dnl @ ../doc/m4.texi:8305: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -Dlimit=2500 -Dalt=4
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index a708380..ba7bc32 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8307: Origin of test
+dnl @ ../doc/m4.texi:8312: Origin of test
 dnl @ expected status: 0
 dnl @ extra options:  -Dlimit=10000 -Dalt=4
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 16eccb9..2ef10bc 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8370: Origin of test
+dnl @ ../doc/m4.texi:8375: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index b2ecd1c..a1e7137 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8416: Origin of test
+dnl @ ../doc/m4.texi:8421: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 1980a44..41075b8 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8439: Origin of test
+dnl @ ../doc/m4.texi:8444: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 52ab1a3..975b32d 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8472: Origin of test
+dnl @ ../doc/m4.texi:8477: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 009d93c..0a09f65 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8508: Origin of test
+dnl @ ../doc/m4.texi:8513: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 7dd105b..2a5ebd6 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8544: Origin of test
+dnl @ ../doc/m4.texi:8549: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 97bbb08..291c6f6 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8621: Origin of test
+dnl @ ../doc/m4.texi:8626: Origin of test
 dnl @ expected status: 0
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 11a2b99..fc68473 100644 (file)
@@ -1,4 +1,4 @@
-dnl @ ../doc/m4.texi:8665: Origin of test
+dnl @ ../doc/m4.texi:8670: Origin of test
 dnl @ expected status: 1
 dnl @ extra options: 
 dnl @ Copyright (C) 2006, 2007, 2008, 2009 Free Software
index 0fb5a63..71d0f7d 100644 (file)
@@ -1,7 +1,7 @@
 ## Makefile.am - template for generating Makefile via Automake.
 ##
-## Copyright (C) 1992-1994, 2006-2014, 2016 Free Software Foundation,
-## Inc.
+## Copyright (C) 1992-1994, 2006-2014, 2016-2017, 2020-2021 Free
+## Software Foundation, Inc.
 ##
 ## This file is part of GNU M4.
 ##
@@ -16,7 +16,7 @@
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # Vern says that the first star is required around an Alpha make bug.
 DOC_CHECKS = $(srcdir)/*[0-9][0-9][0-9].*
index ce025af..f88bd5f 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -89,54 +89,69 @@ host_triplet = @host@
 subdir = checks
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
-       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
-       $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/__inline.m4 \
+       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/access.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/arpa_inet_h.m4 \
        $(top_srcdir)/m4/asm-underscore.m4 $(top_srcdir)/m4/assert.m4 \
        $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \
        $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \
-       $(top_srcdir)/m4/canonicalize.m4 \
-       $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
-       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
-       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
-       $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
-       $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirent_h.m4 \
-       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/canonicalize.m4 \
+       $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/clock_time.m4 \
+       $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closedir.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \
+       $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/creat.m4 \
+       $(top_srcdir)/m4/ctype_h.m4 $(top_srcdir)/m4/d-ino.m4 \
+       $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
        $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
-       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
-       $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \
-       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/execute.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eaccess.m4 \
+       $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+       $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+       $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/explicit_bzero.m4 \
        $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \
        $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \
        $(top_srcdir)/m4/extern-inline.m4 \
-       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fclose.m4 \
-       $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl.m4 \
-       $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopen.m4 \
+       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fchdir.m4 \
+       $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+       $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+       $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/fdopendir.m4 \
        $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/findprog-in.m4 $(top_srcdir)/m4/findprog.m4 \
        $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
        $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \
        $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fpurge.m4 \
        $(top_srcdir)/m4/freadahead.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/freopen.m4 \
        $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
        $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
-       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
-       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \
+       $(top_srcdir)/m4/ftell.m4 $(top_srcdir)/m4/ftello.m4 \
+       $(top_srcdir)/m4/ftruncate.m4 \
+       $(top_srcdir)/m4/getcwd-abort-bug.m4 \
+       $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
        $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
        $(top_srcdir)/m4/getpagesize.m4 \
-       $(top_srcdir)/m4/getprogname.m4 \
-       $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
+       $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/getrandom.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
        $(top_srcdir)/m4/gnulib-common.m4 \
        $(top_srcdir)/m4/gnulib-comp.m4 \
-       $(top_srcdir)/m4/hard-locale.m4 \
-       $(top_srcdir)/m4/include_next.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+       $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+       $(top_srcdir)/m4/inline.m4 \
+       $(top_srcdir)/m4/intl-thread-locale.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \
-       $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
-       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isblank.m4 \
-       $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
-       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/langinfo_h.m4 \
+       $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes.m4 \
+       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+       $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/isnand.m4 \
+       $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
+       $(top_srcdir)/m4/iswblank.m4 $(top_srcdir)/m4/iswdigit.m4 \
+       $(top_srcdir)/m4/iswxdigit.m4 $(top_srcdir)/m4/langinfo_h.m4 \
        $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lcmessage.m4 \
        $(top_srcdir)/m4/ldexp.m4 $(top_srcdir)/m4/ldexpl.m4 \
        $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
        $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+       $(top_srcdir)/m4/libunistring-base.m4 \
        $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/link.m4 \
        $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
        $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
@@ -146,61 +161,93 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
        $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
        $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \
+       $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
        $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
-       $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
-       $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/minmax.m4 \
+       $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+       $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
+       $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
+       $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkdir.m4 \
        $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \
        $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
        $(top_srcdir)/m4/msvc-inval.m4 \
        $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
-       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nocrash.m4 \
-       $(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/off_t.m4 \
-       $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/opendir.m4 \
-       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/pipe2.m4 \
-       $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/musl.m4 $(top_srcdir)/m4/nanosleep.m4 \
+       $(top_srcdir)/m4/netinet_in_h.m4 \
+       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/obstack.m4 \
+       $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/open-cloexec.m4 \
+       $(top_srcdir)/m4/open-slash.m4 $(top_srcdir)/m4/open.m4 \
+       $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/opendir.m4 \
+       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perror.m4 \
+       $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/pipe2.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/posix_spawn_faction_addchdir.m4 \
        $(top_srcdir)/m4/printf-frexp.m4 \
        $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \
-       $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quotearg.m4 \
-       $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+       $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/pthread-thread.m4 \
+       $(top_srcdir)/m4/pthread_h.m4 \
+       $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
+       $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \
+       $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/raise.m4 \
+       $(top_srcdir)/m4/rawmemchr.m4 $(top_srcdir)/m4/read-file.m4 \
        $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/readlink.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/reallocarray.m4 \
        $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
-       $(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/sched_h.m4 \
-       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/setenv.m4 \
-       $(top_srcdir)/m4/setlocale.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \
-       $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/rewinddir.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/sched_h.m4 \
+       $(top_srcdir)/m4/sched_yield.m4 \
+       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+       $(top_srcdir)/m4/semaphore.m4 $(top_srcdir)/m4/setenv.m4 \
+       $(top_srcdir)/m4/setlocale.m4 \
+       $(top_srcdir)/m4/setlocale_null.m4 \
+       $(top_srcdir)/m4/sh-filename.m4 \
+       $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/sigaltstack.m4 $(top_srcdir)/m4/signal_h.m4 \
        $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \
        $(top_srcdir)/m4/sigpipe.m4 $(top_srcdir)/m4/size_max.m4 \
        $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/snprintf.m4 \
-       $(top_srcdir)/m4/spawn-pipe.m4 $(top_srcdir)/m4/spawn_h.m4 \
-       $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \
+       $(top_srcdir)/m4/socketlib.m4 $(top_srcdir)/m4/sockets.m4 \
+       $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \
+       $(top_srcdir)/m4/sparcv8+.m4 $(top_srcdir)/m4/spawn-pipe.m4 \
+       $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/ssize_t.m4 \
+       $(top_srcdir)/m4/stack-direction.m4 \
+       $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
        $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
        $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
        $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
        $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
-       $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \
-       $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \
+       $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
        $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
        $(top_srcdir)/m4/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \
        $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/symlink.m4 \
+       $(top_srcdir)/m4/sys_ioctl_h.m4 \
+       $(top_srcdir)/m4/sys_random_h.m4 \
+       $(top_srcdir)/m4/sys_select_h.m4 \
        $(top_srcdir)/m4/sys_socket_h.m4 \
        $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
-       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \
-       $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+       $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+       $(top_srcdir)/m4/thread.m4 $(top_srcdir)/m4/threadlib.m4 \
        $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/tls.m4 \
        $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/ungetc.m4 \
        $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
        $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \
        $(top_srcdir)/m4/vasprintf-posix.m4 \
        $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+       $(top_srcdir)/m4/visibility.m4 \
        $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \
        $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/m4/wchar_h.m4 \
        $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wcrtomb.m4 \
        $(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
-       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
-       $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \
-       $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \
-       $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \
+       $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \
+       $(top_srcdir)/m4/yield.m4 $(top_srcdir)/m4/zzgnulib.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
@@ -252,6 +299,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CONFIG_INCLUDE = @CONFIG_INCLUDE@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
@@ -275,392 +323,519 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
 ERRNO_H = @ERRNO_H@
 EXEEXT = @EXEEXT@
 FLOAT_H = @FLOAT_H@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
 GETOPT_H = @GETOPT_H@
-GLIBC21 = @GLIBC21@
-GNULIB_ACOSF = @GNULIB_ACOSF@
-GNULIB_ACOSL = @GNULIB_ACOSL@
-GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
-GNULIB_ASINF = @GNULIB_ASINF@
-GNULIB_ASINL = @GNULIB_ASINL@
-GNULIB_ATAN2F = @GNULIB_ATAN2F@
-GNULIB_ATANF = @GNULIB_ATANF@
-GNULIB_ATANL = @GNULIB_ATANL@
-GNULIB_ATOLL = @GNULIB_ATOLL@
-GNULIB_BTOWC = @GNULIB_BTOWC@
-GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
-GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
-GNULIB_CBRT = @GNULIB_CBRT@
-GNULIB_CBRTF = @GNULIB_CBRTF@
-GNULIB_CBRTL = @GNULIB_CBRTL@
-GNULIB_CEIL = @GNULIB_CEIL@
-GNULIB_CEILF = @GNULIB_CEILF@
-GNULIB_CEILL = @GNULIB_CEILL@
-GNULIB_CHDIR = @GNULIB_CHDIR@
-GNULIB_CHOWN = @GNULIB_CHOWN@
-GNULIB_CLOSE = @GNULIB_CLOSE@
-GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
-GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
-GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
-GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
-GNULIB_COSF = @GNULIB_COSF@
-GNULIB_COSHF = @GNULIB_COSHF@
-GNULIB_COSL = @GNULIB_COSL@
-GNULIB_DIRFD = @GNULIB_DIRFD@
-GNULIB_DPRINTF = @GNULIB_DPRINTF@
-GNULIB_DUP = @GNULIB_DUP@
-GNULIB_DUP2 = @GNULIB_DUP2@
-GNULIB_DUP3 = @GNULIB_DUP3@
-GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
-GNULIB_ENVIRON = @GNULIB_ENVIRON@
-GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
-GNULIB_EXP2 = @GNULIB_EXP2@
-GNULIB_EXP2F = @GNULIB_EXP2F@
-GNULIB_EXP2L = @GNULIB_EXP2L@
-GNULIB_EXPF = @GNULIB_EXPF@
-GNULIB_EXPL = @GNULIB_EXPL@
-GNULIB_EXPM1 = @GNULIB_EXPM1@
-GNULIB_EXPM1F = @GNULIB_EXPM1F@
-GNULIB_EXPM1L = @GNULIB_EXPM1L@
-GNULIB_FABSF = @GNULIB_FABSF@
-GNULIB_FABSL = @GNULIB_FABSL@
-GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
-GNULIB_FCHDIR = @GNULIB_FCHDIR@
-GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
-GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
-GNULIB_FCLOSE = @GNULIB_FCLOSE@
-GNULIB_FCNTL = @GNULIB_FCNTL@
-GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
-GNULIB_FDOPEN = @GNULIB_FDOPEN@
-GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
-GNULIB_FFLUSH = @GNULIB_FFLUSH@
-GNULIB_FFSL = @GNULIB_FFSL@
-GNULIB_FFSLL = @GNULIB_FFSLL@
-GNULIB_FGETC = @GNULIB_FGETC@
-GNULIB_FGETS = @GNULIB_FGETS@
-GNULIB_FLOOR = @GNULIB_FLOOR@
-GNULIB_FLOORF = @GNULIB_FLOORF@
-GNULIB_FLOORL = @GNULIB_FLOORL@
-GNULIB_FMA = @GNULIB_FMA@
-GNULIB_FMAF = @GNULIB_FMAF@
-GNULIB_FMAL = @GNULIB_FMAL@
-GNULIB_FMOD = @GNULIB_FMOD@
-GNULIB_FMODF = @GNULIB_FMODF@
-GNULIB_FMODL = @GNULIB_FMODL@
-GNULIB_FOPEN = @GNULIB_FOPEN@
-GNULIB_FPRINTF = @GNULIB_FPRINTF@
-GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
-GNULIB_FPURGE = @GNULIB_FPURGE@
-GNULIB_FPUTC = @GNULIB_FPUTC@
-GNULIB_FPUTS = @GNULIB_FPUTS@
-GNULIB_FREAD = @GNULIB_FREAD@
-GNULIB_FREOPEN = @GNULIB_FREOPEN@
-GNULIB_FREXP = @GNULIB_FREXP@
-GNULIB_FREXPF = @GNULIB_FREXPF@
-GNULIB_FREXPL = @GNULIB_FREXPL@
-GNULIB_FSCANF = @GNULIB_FSCANF@
-GNULIB_FSEEK = @GNULIB_FSEEK@
-GNULIB_FSEEKO = @GNULIB_FSEEKO@
-GNULIB_FSTAT = @GNULIB_FSTAT@
-GNULIB_FSTATAT = @GNULIB_FSTATAT@
-GNULIB_FSYNC = @GNULIB_FSYNC@
-GNULIB_FTELL = @GNULIB_FTELL@
-GNULIB_FTELLO = @GNULIB_FTELLO@
-GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
-GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
-GNULIB_FWRITE = @GNULIB_FWRITE@
-GNULIB_GETC = @GNULIB_GETC@
-GNULIB_GETCHAR = @GNULIB_GETCHAR@
-GNULIB_GETCWD = @GNULIB_GETCWD@
-GNULIB_GETDELIM = @GNULIB_GETDELIM@
-GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
-GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
-GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
-GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
-GNULIB_GETLINE = @GNULIB_GETLINE@
-GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
-GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
-GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
-GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
-GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_M4_GNULIB_ACCEPT = @GL_M4_GNULIB_ACCEPT@
+GL_M4_GNULIB_ACCEPT4 = @GL_M4_GNULIB_ACCEPT4@
+GL_M4_GNULIB_ACCESS = @GL_M4_GNULIB_ACCESS@
+GL_M4_GNULIB_ACOSF = @GL_M4_GNULIB_ACOSF@
+GL_M4_GNULIB_ACOSL = @GL_M4_GNULIB_ACOSL@
+GL_M4_GNULIB_ALIGNED_ALLOC = @GL_M4_GNULIB_ALIGNED_ALLOC@
+GL_M4_GNULIB_ALPHASORT = @GL_M4_GNULIB_ALPHASORT@
+GL_M4_GNULIB_ASINF = @GL_M4_GNULIB_ASINF@
+GL_M4_GNULIB_ASINL = @GL_M4_GNULIB_ASINL@
+GL_M4_GNULIB_ATAN2F = @GL_M4_GNULIB_ATAN2F@
+GL_M4_GNULIB_ATANF = @GL_M4_GNULIB_ATANF@
+GL_M4_GNULIB_ATANL = @GL_M4_GNULIB_ATANL@
+GL_M4_GNULIB_ATOLL = @GL_M4_GNULIB_ATOLL@
+GL_M4_GNULIB_BIND = @GL_M4_GNULIB_BIND@
+GL_M4_GNULIB_BTOWC = @GL_M4_GNULIB_BTOWC@
+GL_M4_GNULIB_CALLOC_POSIX = @GL_M4_GNULIB_CALLOC_POSIX@
+GL_M4_GNULIB_CANONICALIZE_FILE_NAME = @GL_M4_GNULIB_CANONICALIZE_FILE_NAME@
+GL_M4_GNULIB_CBRT = @GL_M4_GNULIB_CBRT@
+GL_M4_GNULIB_CBRTF = @GL_M4_GNULIB_CBRTF@
+GL_M4_GNULIB_CBRTL = @GL_M4_GNULIB_CBRTL@
+GL_M4_GNULIB_CEIL = @GL_M4_GNULIB_CEIL@
+GL_M4_GNULIB_CEILF = @GL_M4_GNULIB_CEILF@
+GL_M4_GNULIB_CEILL = @GL_M4_GNULIB_CEILL@
+GL_M4_GNULIB_CHDIR = @GL_M4_GNULIB_CHDIR@
+GL_M4_GNULIB_CHOWN = @GL_M4_GNULIB_CHOWN@
+GL_M4_GNULIB_CLOSE = @GL_M4_GNULIB_CLOSE@
+GL_M4_GNULIB_CLOSEDIR = @GL_M4_GNULIB_CLOSEDIR@
+GL_M4_GNULIB_CONNECT = @GL_M4_GNULIB_CONNECT@
+GL_M4_GNULIB_COPYSIGN = @GL_M4_GNULIB_COPYSIGN@
+GL_M4_GNULIB_COPYSIGNF = @GL_M4_GNULIB_COPYSIGNF@
+GL_M4_GNULIB_COPYSIGNL = @GL_M4_GNULIB_COPYSIGNL@
+GL_M4_GNULIB_COPY_FILE_RANGE = @GL_M4_GNULIB_COPY_FILE_RANGE@
+GL_M4_GNULIB_COSF = @GL_M4_GNULIB_COSF@
+GL_M4_GNULIB_COSHF = @GL_M4_GNULIB_COSHF@
+GL_M4_GNULIB_COSL = @GL_M4_GNULIB_COSL@
+GL_M4_GNULIB_CREAT = @GL_M4_GNULIB_CREAT@
+GL_M4_GNULIB_CTIME = @GL_M4_GNULIB_CTIME@
+GL_M4_GNULIB_DIRFD = @GL_M4_GNULIB_DIRFD@
+GL_M4_GNULIB_DPRINTF = @GL_M4_GNULIB_DPRINTF@
+GL_M4_GNULIB_DUP = @GL_M4_GNULIB_DUP@
+GL_M4_GNULIB_DUP2 = @GL_M4_GNULIB_DUP2@
+GL_M4_GNULIB_DUP3 = @GL_M4_GNULIB_DUP3@
+GL_M4_GNULIB_DUPLOCALE = @GL_M4_GNULIB_DUPLOCALE@
+GL_M4_GNULIB_ENVIRON = @GL_M4_GNULIB_ENVIRON@
+GL_M4_GNULIB_EUIDACCESS = @GL_M4_GNULIB_EUIDACCESS@
+GL_M4_GNULIB_EXECL = @GL_M4_GNULIB_EXECL@
+GL_M4_GNULIB_EXECLE = @GL_M4_GNULIB_EXECLE@
+GL_M4_GNULIB_EXECLP = @GL_M4_GNULIB_EXECLP@
+GL_M4_GNULIB_EXECV = @GL_M4_GNULIB_EXECV@
+GL_M4_GNULIB_EXECVE = @GL_M4_GNULIB_EXECVE@
+GL_M4_GNULIB_EXECVP = @GL_M4_GNULIB_EXECVP@
+GL_M4_GNULIB_EXECVPE = @GL_M4_GNULIB_EXECVPE@
+GL_M4_GNULIB_EXP2 = @GL_M4_GNULIB_EXP2@
+GL_M4_GNULIB_EXP2F = @GL_M4_GNULIB_EXP2F@
+GL_M4_GNULIB_EXP2L = @GL_M4_GNULIB_EXP2L@
+GL_M4_GNULIB_EXPF = @GL_M4_GNULIB_EXPF@
+GL_M4_GNULIB_EXPL = @GL_M4_GNULIB_EXPL@
+GL_M4_GNULIB_EXPLICIT_BZERO = @GL_M4_GNULIB_EXPLICIT_BZERO@
+GL_M4_GNULIB_EXPM1 = @GL_M4_GNULIB_EXPM1@
+GL_M4_GNULIB_EXPM1F = @GL_M4_GNULIB_EXPM1F@
+GL_M4_GNULIB_EXPM1L = @GL_M4_GNULIB_EXPM1L@
+GL_M4_GNULIB_FABSF = @GL_M4_GNULIB_FABSF@
+GL_M4_GNULIB_FABSL = @GL_M4_GNULIB_FABSL@
+GL_M4_GNULIB_FACCESSAT = @GL_M4_GNULIB_FACCESSAT@
+GL_M4_GNULIB_FCHDIR = @GL_M4_GNULIB_FCHDIR@
+GL_M4_GNULIB_FCHMODAT = @GL_M4_GNULIB_FCHMODAT@
+GL_M4_GNULIB_FCHOWNAT = @GL_M4_GNULIB_FCHOWNAT@
+GL_M4_GNULIB_FCLOSE = @GL_M4_GNULIB_FCLOSE@
+GL_M4_GNULIB_FCNTL = @GL_M4_GNULIB_FCNTL@
+GL_M4_GNULIB_FDATASYNC = @GL_M4_GNULIB_FDATASYNC@
+GL_M4_GNULIB_FDOPEN = @GL_M4_GNULIB_FDOPEN@
+GL_M4_GNULIB_FDOPENDIR = @GL_M4_GNULIB_FDOPENDIR@
+GL_M4_GNULIB_FFLUSH = @GL_M4_GNULIB_FFLUSH@
+GL_M4_GNULIB_FFSL = @GL_M4_GNULIB_FFSL@
+GL_M4_GNULIB_FFSLL = @GL_M4_GNULIB_FFSLL@
+GL_M4_GNULIB_FGETC = @GL_M4_GNULIB_FGETC@
+GL_M4_GNULIB_FGETS = @GL_M4_GNULIB_FGETS@
+GL_M4_GNULIB_FLOOR = @GL_M4_GNULIB_FLOOR@
+GL_M4_GNULIB_FLOORF = @GL_M4_GNULIB_FLOORF@
+GL_M4_GNULIB_FLOORL = @GL_M4_GNULIB_FLOORL@
+GL_M4_GNULIB_FMA = @GL_M4_GNULIB_FMA@
+GL_M4_GNULIB_FMAF = @GL_M4_GNULIB_FMAF@
+GL_M4_GNULIB_FMAL = @GL_M4_GNULIB_FMAL@
+GL_M4_GNULIB_FMOD = @GL_M4_GNULIB_FMOD@
+GL_M4_GNULIB_FMODF = @GL_M4_GNULIB_FMODF@
+GL_M4_GNULIB_FMODL = @GL_M4_GNULIB_FMODL@
+GL_M4_GNULIB_FOPEN = @GL_M4_GNULIB_FOPEN@
+GL_M4_GNULIB_FPRINTF = @GL_M4_GNULIB_FPRINTF@
+GL_M4_GNULIB_FPRINTF_POSIX = @GL_M4_GNULIB_FPRINTF_POSIX@
+GL_M4_GNULIB_FPURGE = @GL_M4_GNULIB_FPURGE@
+GL_M4_GNULIB_FPUTC = @GL_M4_GNULIB_FPUTC@
+GL_M4_GNULIB_FPUTS = @GL_M4_GNULIB_FPUTS@
+GL_M4_GNULIB_FREAD = @GL_M4_GNULIB_FREAD@
+GL_M4_GNULIB_FREE_POSIX = @GL_M4_GNULIB_FREE_POSIX@
+GL_M4_GNULIB_FREOPEN = @GL_M4_GNULIB_FREOPEN@
+GL_M4_GNULIB_FREXP = @GL_M4_GNULIB_FREXP@
+GL_M4_GNULIB_FREXPF = @GL_M4_GNULIB_FREXPF@
+GL_M4_GNULIB_FREXPL = @GL_M4_GNULIB_FREXPL@
+GL_M4_GNULIB_FSCANF = @GL_M4_GNULIB_FSCANF@
+GL_M4_GNULIB_FSEEK = @GL_M4_GNULIB_FSEEK@
+GL_M4_GNULIB_FSEEKO = @GL_M4_GNULIB_FSEEKO@
+GL_M4_GNULIB_FSTAT = @GL_M4_GNULIB_FSTAT@
+GL_M4_GNULIB_FSTATAT = @GL_M4_GNULIB_FSTATAT@
+GL_M4_GNULIB_FSYNC = @GL_M4_GNULIB_FSYNC@
+GL_M4_GNULIB_FTELL = @GL_M4_GNULIB_FTELL@
+GL_M4_GNULIB_FTELLO = @GL_M4_GNULIB_FTELLO@
+GL_M4_GNULIB_FTRUNCATE = @GL_M4_GNULIB_FTRUNCATE@
+GL_M4_GNULIB_FUTIMENS = @GL_M4_GNULIB_FUTIMENS@
+GL_M4_GNULIB_FWRITE = @GL_M4_GNULIB_FWRITE@
+GL_M4_GNULIB_GETC = @GL_M4_GNULIB_GETC@
+GL_M4_GNULIB_GETCHAR = @GL_M4_GNULIB_GETCHAR@
+GL_M4_GNULIB_GETCWD = @GL_M4_GNULIB_GETCWD@
+GL_M4_GNULIB_GETDELIM = @GL_M4_GNULIB_GETDELIM@
+GL_M4_GNULIB_GETDOMAINNAME = @GL_M4_GNULIB_GETDOMAINNAME@
+GL_M4_GNULIB_GETDTABLESIZE = @GL_M4_GNULIB_GETDTABLESIZE@
+GL_M4_GNULIB_GETENTROPY = @GL_M4_GNULIB_GETENTROPY@
+GL_M4_GNULIB_GETGROUPS = @GL_M4_GNULIB_GETGROUPS@
+GL_M4_GNULIB_GETHOSTNAME = @GL_M4_GNULIB_GETHOSTNAME@
+GL_M4_GNULIB_GETLINE = @GL_M4_GNULIB_GETLINE@
+GL_M4_GNULIB_GETLOADAVG = @GL_M4_GNULIB_GETLOADAVG@
+GL_M4_GNULIB_GETLOGIN = @GL_M4_GNULIB_GETLOGIN@
+GL_M4_GNULIB_GETLOGIN_R = @GL_M4_GNULIB_GETLOGIN_R@
+GL_M4_GNULIB_GETOPT_POSIX = @GL_M4_GNULIB_GETOPT_POSIX@
+GL_M4_GNULIB_GETPAGESIZE = @GL_M4_GNULIB_GETPAGESIZE@
+GL_M4_GNULIB_GETPASS = @GL_M4_GNULIB_GETPASS@
+GL_M4_GNULIB_GETPEERNAME = @GL_M4_GNULIB_GETPEERNAME@
+GL_M4_GNULIB_GETRANDOM = @GL_M4_GNULIB_GETRANDOM@
+GL_M4_GNULIB_GETSOCKNAME = @GL_M4_GNULIB_GETSOCKNAME@
+GL_M4_GNULIB_GETSOCKOPT = @GL_M4_GNULIB_GETSOCKOPT@
+GL_M4_GNULIB_GETSUBOPT = @GL_M4_GNULIB_GETSUBOPT@
+GL_M4_GNULIB_GETTIMEOFDAY = @GL_M4_GNULIB_GETTIMEOFDAY@
+GL_M4_GNULIB_GETUMASK = @GL_M4_GNULIB_GETUMASK@
+GL_M4_GNULIB_GETUSERSHELL = @GL_M4_GNULIB_GETUSERSHELL@
+GL_M4_GNULIB_GRANTPT = @GL_M4_GNULIB_GRANTPT@
+GL_M4_GNULIB_GROUP_MEMBER = @GL_M4_GNULIB_GROUP_MEMBER@
+GL_M4_GNULIB_HYPOT = @GL_M4_GNULIB_HYPOT@
+GL_M4_GNULIB_HYPOTF = @GL_M4_GNULIB_HYPOTF@
+GL_M4_GNULIB_HYPOTL = @GL_M4_GNULIB_HYPOTL@
+GL_M4_GNULIB_ICONV = @GL_M4_GNULIB_ICONV@
+GL_M4_GNULIB_ILOGB = @GL_M4_GNULIB_ILOGB@
+GL_M4_GNULIB_ILOGBF = @GL_M4_GNULIB_ILOGBF@
+GL_M4_GNULIB_ILOGBL = @GL_M4_GNULIB_ILOGBL@
+GL_M4_GNULIB_IMAXABS = @GL_M4_GNULIB_IMAXABS@
+GL_M4_GNULIB_IMAXDIV = @GL_M4_GNULIB_IMAXDIV@
+GL_M4_GNULIB_INET_NTOP = @GL_M4_GNULIB_INET_NTOP@
+GL_M4_GNULIB_INET_PTON = @GL_M4_GNULIB_INET_PTON@
+GL_M4_GNULIB_IOCTL = @GL_M4_GNULIB_IOCTL@
+GL_M4_GNULIB_ISATTY = @GL_M4_GNULIB_ISATTY@
+GL_M4_GNULIB_ISBLANK = @GL_M4_GNULIB_ISBLANK@
+GL_M4_GNULIB_ISFINITE = @GL_M4_GNULIB_ISFINITE@
+GL_M4_GNULIB_ISINF = @GL_M4_GNULIB_ISINF@
+GL_M4_GNULIB_ISNAN = @GL_M4_GNULIB_ISNAN@
+GL_M4_GNULIB_ISNAND = @GL_M4_GNULIB_ISNAND@
+GL_M4_GNULIB_ISNANF = @GL_M4_GNULIB_ISNANF@
+GL_M4_GNULIB_ISNANL = @GL_M4_GNULIB_ISNANL@
+GL_M4_GNULIB_ISWBLANK = @GL_M4_GNULIB_ISWBLANK@
+GL_M4_GNULIB_ISWCTYPE = @GL_M4_GNULIB_ISWCTYPE@
+GL_M4_GNULIB_ISWDIGIT = @GL_M4_GNULIB_ISWDIGIT@
+GL_M4_GNULIB_ISWXDIGIT = @GL_M4_GNULIB_ISWXDIGIT@
+GL_M4_GNULIB_LCHMOD = @GL_M4_GNULIB_LCHMOD@
+GL_M4_GNULIB_LCHOWN = @GL_M4_GNULIB_LCHOWN@
+GL_M4_GNULIB_LDEXPF = @GL_M4_GNULIB_LDEXPF@
+GL_M4_GNULIB_LDEXPL = @GL_M4_GNULIB_LDEXPL@
+GL_M4_GNULIB_LINK = @GL_M4_GNULIB_LINK@
+GL_M4_GNULIB_LINKAT = @GL_M4_GNULIB_LINKAT@
+GL_M4_GNULIB_LISTEN = @GL_M4_GNULIB_LISTEN@
+GL_M4_GNULIB_LOCALECONV = @GL_M4_GNULIB_LOCALECONV@
+GL_M4_GNULIB_LOCALENAME = @GL_M4_GNULIB_LOCALENAME@
+GL_M4_GNULIB_LOCALTIME = @GL_M4_GNULIB_LOCALTIME@
+GL_M4_GNULIB_LOG = @GL_M4_GNULIB_LOG@
+GL_M4_GNULIB_LOG10 = @GL_M4_GNULIB_LOG10@
+GL_M4_GNULIB_LOG10F = @GL_M4_GNULIB_LOG10F@
+GL_M4_GNULIB_LOG10L = @GL_M4_GNULIB_LOG10L@
+GL_M4_GNULIB_LOG1P = @GL_M4_GNULIB_LOG1P@
+GL_M4_GNULIB_LOG1PF = @GL_M4_GNULIB_LOG1PF@
+GL_M4_GNULIB_LOG1PL = @GL_M4_GNULIB_LOG1PL@
+GL_M4_GNULIB_LOG2 = @GL_M4_GNULIB_LOG2@
+GL_M4_GNULIB_LOG2F = @GL_M4_GNULIB_LOG2F@
+GL_M4_GNULIB_LOG2L = @GL_M4_GNULIB_LOG2L@
+GL_M4_GNULIB_LOGB = @GL_M4_GNULIB_LOGB@
+GL_M4_GNULIB_LOGBF = @GL_M4_GNULIB_LOGBF@
+GL_M4_GNULIB_LOGBL = @GL_M4_GNULIB_LOGBL@
+GL_M4_GNULIB_LOGF = @GL_M4_GNULIB_LOGF@
+GL_M4_GNULIB_LOGL = @GL_M4_GNULIB_LOGL@
+GL_M4_GNULIB_LSEEK = @GL_M4_GNULIB_LSEEK@
+GL_M4_GNULIB_LSTAT = @GL_M4_GNULIB_LSTAT@
+GL_M4_GNULIB_MALLOC_POSIX = @GL_M4_GNULIB_MALLOC_POSIX@
+GL_M4_GNULIB_MBRLEN = @GL_M4_GNULIB_MBRLEN@
+GL_M4_GNULIB_MBRTOWC = @GL_M4_GNULIB_MBRTOWC@
+GL_M4_GNULIB_MBSCASECMP = @GL_M4_GNULIB_MBSCASECMP@
+GL_M4_GNULIB_MBSCASESTR = @GL_M4_GNULIB_MBSCASESTR@
+GL_M4_GNULIB_MBSCHR = @GL_M4_GNULIB_MBSCHR@
+GL_M4_GNULIB_MBSCSPN = @GL_M4_GNULIB_MBSCSPN@
+GL_M4_GNULIB_MBSINIT = @GL_M4_GNULIB_MBSINIT@
+GL_M4_GNULIB_MBSLEN = @GL_M4_GNULIB_MBSLEN@
+GL_M4_GNULIB_MBSNCASECMP = @GL_M4_GNULIB_MBSNCASECMP@
+GL_M4_GNULIB_MBSNLEN = @GL_M4_GNULIB_MBSNLEN@
+GL_M4_GNULIB_MBSNRTOWCS = @GL_M4_GNULIB_MBSNRTOWCS@
+GL_M4_GNULIB_MBSPBRK = @GL_M4_GNULIB_MBSPBRK@
+GL_M4_GNULIB_MBSPCASECMP = @GL_M4_GNULIB_MBSPCASECMP@
+GL_M4_GNULIB_MBSRCHR = @GL_M4_GNULIB_MBSRCHR@
+GL_M4_GNULIB_MBSRTOWCS = @GL_M4_GNULIB_MBSRTOWCS@
+GL_M4_GNULIB_MBSSEP = @GL_M4_GNULIB_MBSSEP@
+GL_M4_GNULIB_MBSSPN = @GL_M4_GNULIB_MBSSPN@
+GL_M4_GNULIB_MBSSTR = @GL_M4_GNULIB_MBSSTR@
+GL_M4_GNULIB_MBSTOK_R = @GL_M4_GNULIB_MBSTOK_R@
+GL_M4_GNULIB_MBTOWC = @GL_M4_GNULIB_MBTOWC@
+GL_M4_GNULIB_MDA_ACCESS = @GL_M4_GNULIB_MDA_ACCESS@
+GL_M4_GNULIB_MDA_CHDIR = @GL_M4_GNULIB_MDA_CHDIR@
+GL_M4_GNULIB_MDA_CHMOD = @GL_M4_GNULIB_MDA_CHMOD@
+GL_M4_GNULIB_MDA_CLOSE = @GL_M4_GNULIB_MDA_CLOSE@
+GL_M4_GNULIB_MDA_CREAT = @GL_M4_GNULIB_MDA_CREAT@
+GL_M4_GNULIB_MDA_DUP = @GL_M4_GNULIB_MDA_DUP@
+GL_M4_GNULIB_MDA_DUP2 = @GL_M4_GNULIB_MDA_DUP2@
+GL_M4_GNULIB_MDA_ECVT = @GL_M4_GNULIB_MDA_ECVT@
+GL_M4_GNULIB_MDA_EXECL = @GL_M4_GNULIB_MDA_EXECL@
+GL_M4_GNULIB_MDA_EXECLE = @GL_M4_GNULIB_MDA_EXECLE@
+GL_M4_GNULIB_MDA_EXECLP = @GL_M4_GNULIB_MDA_EXECLP@
+GL_M4_GNULIB_MDA_EXECV = @GL_M4_GNULIB_MDA_EXECV@
+GL_M4_GNULIB_MDA_EXECVE = @GL_M4_GNULIB_MDA_EXECVE@
+GL_M4_GNULIB_MDA_EXECVP = @GL_M4_GNULIB_MDA_EXECVP@
+GL_M4_GNULIB_MDA_EXECVPE = @GL_M4_GNULIB_MDA_EXECVPE@
+GL_M4_GNULIB_MDA_FCLOSEALL = @GL_M4_GNULIB_MDA_FCLOSEALL@
+GL_M4_GNULIB_MDA_FCVT = @GL_M4_GNULIB_MDA_FCVT@
+GL_M4_GNULIB_MDA_FDOPEN = @GL_M4_GNULIB_MDA_FDOPEN@
+GL_M4_GNULIB_MDA_FILENO = @GL_M4_GNULIB_MDA_FILENO@
+GL_M4_GNULIB_MDA_GCVT = @GL_M4_GNULIB_MDA_GCVT@
+GL_M4_GNULIB_MDA_GETCWD = @GL_M4_GNULIB_MDA_GETCWD@
+GL_M4_GNULIB_MDA_GETPID = @GL_M4_GNULIB_MDA_GETPID@
+GL_M4_GNULIB_MDA_GETW = @GL_M4_GNULIB_MDA_GETW@
+GL_M4_GNULIB_MDA_ISATTY = @GL_M4_GNULIB_MDA_ISATTY@
+GL_M4_GNULIB_MDA_J0 = @GL_M4_GNULIB_MDA_J0@
+GL_M4_GNULIB_MDA_J1 = @GL_M4_GNULIB_MDA_J1@
+GL_M4_GNULIB_MDA_JN = @GL_M4_GNULIB_MDA_JN@
+GL_M4_GNULIB_MDA_LSEEK = @GL_M4_GNULIB_MDA_LSEEK@
+GL_M4_GNULIB_MDA_MEMCCPY = @GL_M4_GNULIB_MDA_MEMCCPY@
+GL_M4_GNULIB_MDA_MKDIR = @GL_M4_GNULIB_MDA_MKDIR@
+GL_M4_GNULIB_MDA_MKTEMP = @GL_M4_GNULIB_MDA_MKTEMP@
+GL_M4_GNULIB_MDA_OPEN = @GL_M4_GNULIB_MDA_OPEN@
+GL_M4_GNULIB_MDA_PUTENV = @GL_M4_GNULIB_MDA_PUTENV@
+GL_M4_GNULIB_MDA_PUTW = @GL_M4_GNULIB_MDA_PUTW@
+GL_M4_GNULIB_MDA_READ = @GL_M4_GNULIB_MDA_READ@
+GL_M4_GNULIB_MDA_RMDIR = @GL_M4_GNULIB_MDA_RMDIR@
+GL_M4_GNULIB_MDA_STRDUP = @GL_M4_GNULIB_MDA_STRDUP@
+GL_M4_GNULIB_MDA_SWAB = @GL_M4_GNULIB_MDA_SWAB@
+GL_M4_GNULIB_MDA_TEMPNAM = @GL_M4_GNULIB_MDA_TEMPNAM@
+GL_M4_GNULIB_MDA_TZSET = @GL_M4_GNULIB_MDA_TZSET@
+GL_M4_GNULIB_MDA_UMASK = @GL_M4_GNULIB_MDA_UMASK@
+GL_M4_GNULIB_MDA_UNLINK = @GL_M4_GNULIB_MDA_UNLINK@
+GL_M4_GNULIB_MDA_WCSDUP = @GL_M4_GNULIB_MDA_WCSDUP@
+GL_M4_GNULIB_MDA_WRITE = @GL_M4_GNULIB_MDA_WRITE@
+GL_M4_GNULIB_MDA_Y0 = @GL_M4_GNULIB_MDA_Y0@
+GL_M4_GNULIB_MDA_Y1 = @GL_M4_GNULIB_MDA_Y1@
+GL_M4_GNULIB_MDA_YN = @GL_M4_GNULIB_MDA_YN@
+GL_M4_GNULIB_MEMCHR = @GL_M4_GNULIB_MEMCHR@
+GL_M4_GNULIB_MEMMEM = @GL_M4_GNULIB_MEMMEM@
+GL_M4_GNULIB_MEMPCPY = @GL_M4_GNULIB_MEMPCPY@
+GL_M4_GNULIB_MEMRCHR = @GL_M4_GNULIB_MEMRCHR@
+GL_M4_GNULIB_MKDIR = @GL_M4_GNULIB_MKDIR@
+GL_M4_GNULIB_MKDIRAT = @GL_M4_GNULIB_MKDIRAT@
+GL_M4_GNULIB_MKDTEMP = @GL_M4_GNULIB_MKDTEMP@
+GL_M4_GNULIB_MKFIFO = @GL_M4_GNULIB_MKFIFO@
+GL_M4_GNULIB_MKFIFOAT = @GL_M4_GNULIB_MKFIFOAT@
+GL_M4_GNULIB_MKNOD = @GL_M4_GNULIB_MKNOD@
+GL_M4_GNULIB_MKNODAT = @GL_M4_GNULIB_MKNODAT@
+GL_M4_GNULIB_MKOSTEMP = @GL_M4_GNULIB_MKOSTEMP@
+GL_M4_GNULIB_MKOSTEMPS = @GL_M4_GNULIB_MKOSTEMPS@
+GL_M4_GNULIB_MKSTEMP = @GL_M4_GNULIB_MKSTEMP@
+GL_M4_GNULIB_MKSTEMPS = @GL_M4_GNULIB_MKSTEMPS@
+GL_M4_GNULIB_MKTIME = @GL_M4_GNULIB_MKTIME@
+GL_M4_GNULIB_MODF = @GL_M4_GNULIB_MODF@
+GL_M4_GNULIB_MODFF = @GL_M4_GNULIB_MODFF@
+GL_M4_GNULIB_MODFL = @GL_M4_GNULIB_MODFL@
+GL_M4_GNULIB_NANOSLEEP = @GL_M4_GNULIB_NANOSLEEP@
+GL_M4_GNULIB_NL_LANGINFO = @GL_M4_GNULIB_NL_LANGINFO@
+GL_M4_GNULIB_NONBLOCKING = @GL_M4_GNULIB_NONBLOCKING@
+GL_M4_GNULIB_OBSTACK_PRINTF = @GL_M4_GNULIB_OBSTACK_PRINTF@
+GL_M4_GNULIB_OBSTACK_PRINTF_POSIX = @GL_M4_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_M4_GNULIB_OPEN = @GL_M4_GNULIB_OPEN@
+GL_M4_GNULIB_OPENAT = @GL_M4_GNULIB_OPENAT@
+GL_M4_GNULIB_OPENDIR = @GL_M4_GNULIB_OPENDIR@
+GL_M4_GNULIB_OVERRIDES_STRUCT_STAT = @GL_M4_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_M4_GNULIB_PCLOSE = @GL_M4_GNULIB_PCLOSE@
+GL_M4_GNULIB_PERROR = @GL_M4_GNULIB_PERROR@
+GL_M4_GNULIB_PIPE = @GL_M4_GNULIB_PIPE@
+GL_M4_GNULIB_PIPE2 = @GL_M4_GNULIB_PIPE2@
+GL_M4_GNULIB_POPEN = @GL_M4_GNULIB_POPEN@
+GL_M4_GNULIB_POSIX_MEMALIGN = @GL_M4_GNULIB_POSIX_MEMALIGN@
+GL_M4_GNULIB_POSIX_OPENPT = @GL_M4_GNULIB_POSIX_OPENPT@
+GL_M4_GNULIB_POSIX_SPAWN = @GL_M4_GNULIB_POSIX_SPAWN@
+GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY = @GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNATTR_INIT = @GL_M4_GNULIB_POSIX_SPAWNATTR_INIT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNP = @GL_M4_GNULIB_POSIX_SPAWNP@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
+GL_M4_GNULIB_POWF = @GL_M4_GNULIB_POWF@
+GL_M4_GNULIB_PREAD = @GL_M4_GNULIB_PREAD@
+GL_M4_GNULIB_PRINTF = @GL_M4_GNULIB_PRINTF@
+GL_M4_GNULIB_PRINTF_POSIX = @GL_M4_GNULIB_PRINTF_POSIX@
+GL_M4_GNULIB_PSELECT = @GL_M4_GNULIB_PSELECT@
+GL_M4_GNULIB_PTHREAD_COND = @GL_M4_GNULIB_PTHREAD_COND@
+GL_M4_GNULIB_PTHREAD_MUTEX = @GL_M4_GNULIB_PTHREAD_MUTEX@
+GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK = @GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK@
+GL_M4_GNULIB_PTHREAD_ONCE = @GL_M4_GNULIB_PTHREAD_ONCE@
+GL_M4_GNULIB_PTHREAD_RWLOCK = @GL_M4_GNULIB_PTHREAD_RWLOCK@
+GL_M4_GNULIB_PTHREAD_SIGMASK = @GL_M4_GNULIB_PTHREAD_SIGMASK@
+GL_M4_GNULIB_PTHREAD_SPIN = @GL_M4_GNULIB_PTHREAD_SPIN@
+GL_M4_GNULIB_PTHREAD_THREAD = @GL_M4_GNULIB_PTHREAD_THREAD@
+GL_M4_GNULIB_PTHREAD_TSS = @GL_M4_GNULIB_PTHREAD_TSS@
+GL_M4_GNULIB_PTSNAME = @GL_M4_GNULIB_PTSNAME@
+GL_M4_GNULIB_PTSNAME_R = @GL_M4_GNULIB_PTSNAME_R@
+GL_M4_GNULIB_PUTC = @GL_M4_GNULIB_PUTC@
+GL_M4_GNULIB_PUTCHAR = @GL_M4_GNULIB_PUTCHAR@
+GL_M4_GNULIB_PUTENV = @GL_M4_GNULIB_PUTENV@
+GL_M4_GNULIB_PUTS = @GL_M4_GNULIB_PUTS@
+GL_M4_GNULIB_PWRITE = @GL_M4_GNULIB_PWRITE@
+GL_M4_GNULIB_QSORT_R = @GL_M4_GNULIB_QSORT_R@
+GL_M4_GNULIB_RAISE = @GL_M4_GNULIB_RAISE@
+GL_M4_GNULIB_RANDOM = @GL_M4_GNULIB_RANDOM@
+GL_M4_GNULIB_RANDOM_R = @GL_M4_GNULIB_RANDOM_R@
+GL_M4_GNULIB_RAWMEMCHR = @GL_M4_GNULIB_RAWMEMCHR@
+GL_M4_GNULIB_READ = @GL_M4_GNULIB_READ@
+GL_M4_GNULIB_READDIR = @GL_M4_GNULIB_READDIR@
+GL_M4_GNULIB_READLINK = @GL_M4_GNULIB_READLINK@
+GL_M4_GNULIB_READLINKAT = @GL_M4_GNULIB_READLINKAT@
+GL_M4_GNULIB_REALLOCARRAY = @GL_M4_GNULIB_REALLOCARRAY@
+GL_M4_GNULIB_REALLOC_POSIX = @GL_M4_GNULIB_REALLOC_POSIX@
+GL_M4_GNULIB_REALPATH = @GL_M4_GNULIB_REALPATH@
+GL_M4_GNULIB_RECV = @GL_M4_GNULIB_RECV@
+GL_M4_GNULIB_RECVFROM = @GL_M4_GNULIB_RECVFROM@
+GL_M4_GNULIB_REMAINDER = @GL_M4_GNULIB_REMAINDER@
+GL_M4_GNULIB_REMAINDERF = @GL_M4_GNULIB_REMAINDERF@
+GL_M4_GNULIB_REMAINDERL = @GL_M4_GNULIB_REMAINDERL@
+GL_M4_GNULIB_REMOVE = @GL_M4_GNULIB_REMOVE@
+GL_M4_GNULIB_RENAME = @GL_M4_GNULIB_RENAME@
+GL_M4_GNULIB_RENAMEAT = @GL_M4_GNULIB_RENAMEAT@
+GL_M4_GNULIB_REWINDDIR = @GL_M4_GNULIB_REWINDDIR@
+GL_M4_GNULIB_RINT = @GL_M4_GNULIB_RINT@
+GL_M4_GNULIB_RINTF = @GL_M4_GNULIB_RINTF@
+GL_M4_GNULIB_RINTL = @GL_M4_GNULIB_RINTL@
+GL_M4_GNULIB_RMDIR = @GL_M4_GNULIB_RMDIR@
+GL_M4_GNULIB_ROUND = @GL_M4_GNULIB_ROUND@
+GL_M4_GNULIB_ROUNDF = @GL_M4_GNULIB_ROUNDF@
+GL_M4_GNULIB_ROUNDL = @GL_M4_GNULIB_ROUNDL@
+GL_M4_GNULIB_RPMATCH = @GL_M4_GNULIB_RPMATCH@
+GL_M4_GNULIB_SCANDIR = @GL_M4_GNULIB_SCANDIR@
+GL_M4_GNULIB_SCANF = @GL_M4_GNULIB_SCANF@
+GL_M4_GNULIB_SCHED_YIELD = @GL_M4_GNULIB_SCHED_YIELD@
+GL_M4_GNULIB_SECURE_GETENV = @GL_M4_GNULIB_SECURE_GETENV@
+GL_M4_GNULIB_SELECT = @GL_M4_GNULIB_SELECT@
+GL_M4_GNULIB_SEND = @GL_M4_GNULIB_SEND@
+GL_M4_GNULIB_SENDTO = @GL_M4_GNULIB_SENDTO@
+GL_M4_GNULIB_SETENV = @GL_M4_GNULIB_SETENV@
+GL_M4_GNULIB_SETHOSTNAME = @GL_M4_GNULIB_SETHOSTNAME@
+GL_M4_GNULIB_SETLOCALE = @GL_M4_GNULIB_SETLOCALE@
+GL_M4_GNULIB_SETLOCALE_NULL = @GL_M4_GNULIB_SETLOCALE_NULL@
+GL_M4_GNULIB_SETSOCKOPT = @GL_M4_GNULIB_SETSOCKOPT@
+GL_M4_GNULIB_SHUTDOWN = @GL_M4_GNULIB_SHUTDOWN@
+GL_M4_GNULIB_SIGABBREV_NP = @GL_M4_GNULIB_SIGABBREV_NP@
+GL_M4_GNULIB_SIGACTION = @GL_M4_GNULIB_SIGACTION@
+GL_M4_GNULIB_SIGDESCR_NP = @GL_M4_GNULIB_SIGDESCR_NP@
+GL_M4_GNULIB_SIGNAL_H_SIGPIPE = @GL_M4_GNULIB_SIGNAL_H_SIGPIPE@
+GL_M4_GNULIB_SIGNBIT = @GL_M4_GNULIB_SIGNBIT@
+GL_M4_GNULIB_SIGPROCMASK = @GL_M4_GNULIB_SIGPROCMASK@
+GL_M4_GNULIB_SINF = @GL_M4_GNULIB_SINF@
+GL_M4_GNULIB_SINHF = @GL_M4_GNULIB_SINHF@
+GL_M4_GNULIB_SINL = @GL_M4_GNULIB_SINL@
+GL_M4_GNULIB_SLEEP = @GL_M4_GNULIB_SLEEP@
+GL_M4_GNULIB_SNPRINTF = @GL_M4_GNULIB_SNPRINTF@
+GL_M4_GNULIB_SOCKET = @GL_M4_GNULIB_SOCKET@
+GL_M4_GNULIB_SPRINTF_POSIX = @GL_M4_GNULIB_SPRINTF_POSIX@
+GL_M4_GNULIB_SQRTF = @GL_M4_GNULIB_SQRTF@
+GL_M4_GNULIB_SQRTL = @GL_M4_GNULIB_SQRTL@
+GL_M4_GNULIB_STAT = @GL_M4_GNULIB_STAT@
+GL_M4_GNULIB_STDIO_H_NONBLOCKING = @GL_M4_GNULIB_STDIO_H_NONBLOCKING@
+GL_M4_GNULIB_STDIO_H_SIGPIPE = @GL_M4_GNULIB_STDIO_H_SIGPIPE@
+GL_M4_GNULIB_STPCPY = @GL_M4_GNULIB_STPCPY@
+GL_M4_GNULIB_STPNCPY = @GL_M4_GNULIB_STPNCPY@
+GL_M4_GNULIB_STRCASESTR = @GL_M4_GNULIB_STRCASESTR@
+GL_M4_GNULIB_STRCHRNUL = @GL_M4_GNULIB_STRCHRNUL@
+GL_M4_GNULIB_STRDUP = @GL_M4_GNULIB_STRDUP@
+GL_M4_GNULIB_STRERROR = @GL_M4_GNULIB_STRERROR@
+GL_M4_GNULIB_STRERRORNAME_NP = @GL_M4_GNULIB_STRERRORNAME_NP@
+GL_M4_GNULIB_STRERROR_R = @GL_M4_GNULIB_STRERROR_R@
+GL_M4_GNULIB_STRFTIME = @GL_M4_GNULIB_STRFTIME@
+GL_M4_GNULIB_STRNCAT = @GL_M4_GNULIB_STRNCAT@
+GL_M4_GNULIB_STRNDUP = @GL_M4_GNULIB_STRNDUP@
+GL_M4_GNULIB_STRNLEN = @GL_M4_GNULIB_STRNLEN@
+GL_M4_GNULIB_STRPBRK = @GL_M4_GNULIB_STRPBRK@
+GL_M4_GNULIB_STRPTIME = @GL_M4_GNULIB_STRPTIME@
+GL_M4_GNULIB_STRSEP = @GL_M4_GNULIB_STRSEP@
+GL_M4_GNULIB_STRSIGNAL = @GL_M4_GNULIB_STRSIGNAL@
+GL_M4_GNULIB_STRSTR = @GL_M4_GNULIB_STRSTR@
+GL_M4_GNULIB_STRTOD = @GL_M4_GNULIB_STRTOD@
+GL_M4_GNULIB_STRTOIMAX = @GL_M4_GNULIB_STRTOIMAX@
+GL_M4_GNULIB_STRTOK_R = @GL_M4_GNULIB_STRTOK_R@
+GL_M4_GNULIB_STRTOL = @GL_M4_GNULIB_STRTOL@
+GL_M4_GNULIB_STRTOLD = @GL_M4_GNULIB_STRTOLD@
+GL_M4_GNULIB_STRTOLL = @GL_M4_GNULIB_STRTOLL@
+GL_M4_GNULIB_STRTOUL = @GL_M4_GNULIB_STRTOUL@
+GL_M4_GNULIB_STRTOULL = @GL_M4_GNULIB_STRTOULL@
+GL_M4_GNULIB_STRTOUMAX = @GL_M4_GNULIB_STRTOUMAX@
+GL_M4_GNULIB_STRVERSCMP = @GL_M4_GNULIB_STRVERSCMP@
+GL_M4_GNULIB_SYMLINK = @GL_M4_GNULIB_SYMLINK@
+GL_M4_GNULIB_SYMLINKAT = @GL_M4_GNULIB_SYMLINKAT@
+GL_M4_GNULIB_SYSTEM_POSIX = @GL_M4_GNULIB_SYSTEM_POSIX@
+GL_M4_GNULIB_TANF = @GL_M4_GNULIB_TANF@
+GL_M4_GNULIB_TANHF = @GL_M4_GNULIB_TANHF@
+GL_M4_GNULIB_TANL = @GL_M4_GNULIB_TANL@
+GL_M4_GNULIB_TIMEGM = @GL_M4_GNULIB_TIMEGM@
+GL_M4_GNULIB_TIMESPEC_GET = @GL_M4_GNULIB_TIMESPEC_GET@
+GL_M4_GNULIB_TIME_R = @GL_M4_GNULIB_TIME_R@
+GL_M4_GNULIB_TIME_RZ = @GL_M4_GNULIB_TIME_RZ@
+GL_M4_GNULIB_TMPFILE = @GL_M4_GNULIB_TMPFILE@
+GL_M4_GNULIB_TOWCTRANS = @GL_M4_GNULIB_TOWCTRANS@
+GL_M4_GNULIB_TRUNC = @GL_M4_GNULIB_TRUNC@
+GL_M4_GNULIB_TRUNCATE = @GL_M4_GNULIB_TRUNCATE@
+GL_M4_GNULIB_TRUNCF = @GL_M4_GNULIB_TRUNCF@
+GL_M4_GNULIB_TRUNCL = @GL_M4_GNULIB_TRUNCL@
+GL_M4_GNULIB_TTYNAME_R = @GL_M4_GNULIB_TTYNAME_R@
+GL_M4_GNULIB_TZSET = @GL_M4_GNULIB_TZSET@
+GL_M4_GNULIB_UNISTD_H_NONBLOCKING = @GL_M4_GNULIB_UNISTD_H_NONBLOCKING@
+GL_M4_GNULIB_UNISTD_H_SIGPIPE = @GL_M4_GNULIB_UNISTD_H_SIGPIPE@
+GL_M4_GNULIB_UNLINK = @GL_M4_GNULIB_UNLINK@
+GL_M4_GNULIB_UNLINKAT = @GL_M4_GNULIB_UNLINKAT@
+GL_M4_GNULIB_UNLOCKPT = @GL_M4_GNULIB_UNLOCKPT@
+GL_M4_GNULIB_UNSETENV = @GL_M4_GNULIB_UNSETENV@
+GL_M4_GNULIB_USLEEP = @GL_M4_GNULIB_USLEEP@
+GL_M4_GNULIB_UTIMENSAT = @GL_M4_GNULIB_UTIMENSAT@
+GL_M4_GNULIB_VASPRINTF = @GL_M4_GNULIB_VASPRINTF@
+GL_M4_GNULIB_VDPRINTF = @GL_M4_GNULIB_VDPRINTF@
+GL_M4_GNULIB_VFPRINTF = @GL_M4_GNULIB_VFPRINTF@
+GL_M4_GNULIB_VFPRINTF_POSIX = @GL_M4_GNULIB_VFPRINTF_POSIX@
+GL_M4_GNULIB_VFSCANF = @GL_M4_GNULIB_VFSCANF@
+GL_M4_GNULIB_VPRINTF = @GL_M4_GNULIB_VPRINTF@
+GL_M4_GNULIB_VPRINTF_POSIX = @GL_M4_GNULIB_VPRINTF_POSIX@
+GL_M4_GNULIB_VSCANF = @GL_M4_GNULIB_VSCANF@
+GL_M4_GNULIB_VSNPRINTF = @GL_M4_GNULIB_VSNPRINTF@
+GL_M4_GNULIB_VSPRINTF_POSIX = @GL_M4_GNULIB_VSPRINTF_POSIX@
+GL_M4_GNULIB_WAITPID = @GL_M4_GNULIB_WAITPID@
+GL_M4_GNULIB_WCPCPY = @GL_M4_GNULIB_WCPCPY@
+GL_M4_GNULIB_WCPNCPY = @GL_M4_GNULIB_WCPNCPY@
+GL_M4_GNULIB_WCRTOMB = @GL_M4_GNULIB_WCRTOMB@
+GL_M4_GNULIB_WCSCASECMP = @GL_M4_GNULIB_WCSCASECMP@
+GL_M4_GNULIB_WCSCAT = @GL_M4_GNULIB_WCSCAT@
+GL_M4_GNULIB_WCSCHR = @GL_M4_GNULIB_WCSCHR@
+GL_M4_GNULIB_WCSCMP = @GL_M4_GNULIB_WCSCMP@
+GL_M4_GNULIB_WCSCOLL = @GL_M4_GNULIB_WCSCOLL@
+GL_M4_GNULIB_WCSCPY = @GL_M4_GNULIB_WCSCPY@
+GL_M4_GNULIB_WCSCSPN = @GL_M4_GNULIB_WCSCSPN@
+GL_M4_GNULIB_WCSDUP = @GL_M4_GNULIB_WCSDUP@
+GL_M4_GNULIB_WCSFTIME = @GL_M4_GNULIB_WCSFTIME@
+GL_M4_GNULIB_WCSLEN = @GL_M4_GNULIB_WCSLEN@
+GL_M4_GNULIB_WCSNCASECMP = @GL_M4_GNULIB_WCSNCASECMP@
+GL_M4_GNULIB_WCSNCAT = @GL_M4_GNULIB_WCSNCAT@
+GL_M4_GNULIB_WCSNCMP = @GL_M4_GNULIB_WCSNCMP@
+GL_M4_GNULIB_WCSNCPY = @GL_M4_GNULIB_WCSNCPY@
+GL_M4_GNULIB_WCSNLEN = @GL_M4_GNULIB_WCSNLEN@
+GL_M4_GNULIB_WCSNRTOMBS = @GL_M4_GNULIB_WCSNRTOMBS@
+GL_M4_GNULIB_WCSPBRK = @GL_M4_GNULIB_WCSPBRK@
+GL_M4_GNULIB_WCSRCHR = @GL_M4_GNULIB_WCSRCHR@
+GL_M4_GNULIB_WCSRTOMBS = @GL_M4_GNULIB_WCSRTOMBS@
+GL_M4_GNULIB_WCSSPN = @GL_M4_GNULIB_WCSSPN@
+GL_M4_GNULIB_WCSSTR = @GL_M4_GNULIB_WCSSTR@
+GL_M4_GNULIB_WCSTOK = @GL_M4_GNULIB_WCSTOK@
+GL_M4_GNULIB_WCSWIDTH = @GL_M4_GNULIB_WCSWIDTH@
+GL_M4_GNULIB_WCSXFRM = @GL_M4_GNULIB_WCSXFRM@
+GL_M4_GNULIB_WCTOB = @GL_M4_GNULIB_WCTOB@
+GL_M4_GNULIB_WCTOMB = @GL_M4_GNULIB_WCTOMB@
+GL_M4_GNULIB_WCTRANS = @GL_M4_GNULIB_WCTRANS@
+GL_M4_GNULIB_WCTYPE = @GL_M4_GNULIB_WCTYPE@
+GL_M4_GNULIB_WCWIDTH = @GL_M4_GNULIB_WCWIDTH@
+GL_M4_GNULIB_WMEMCHR = @GL_M4_GNULIB_WMEMCHR@
+GL_M4_GNULIB_WMEMCMP = @GL_M4_GNULIB_WMEMCMP@
+GL_M4_GNULIB_WMEMCPY = @GL_M4_GNULIB_WMEMCPY@
+GL_M4_GNULIB_WMEMMOVE = @GL_M4_GNULIB_WMEMMOVE@
+GL_M4_GNULIB_WMEMPCPY = @GL_M4_GNULIB_WMEMPCPY@
+GL_M4_GNULIB_WMEMSET = @GL_M4_GNULIB_WMEMSET@
+GL_M4_GNULIB_WRITE = @GL_M4_GNULIB_WRITE@
+GL_M4_GNULIB__EXIT = @GL_M4_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
-GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
 GNULIB_GL_M4_UNISTD_H_GETOPT = @GNULIB_GL_M4_UNISTD_H_GETOPT@
-GNULIB_GRANTPT = @GNULIB_GRANTPT@
-GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
-GNULIB_HYPOT = @GNULIB_HYPOT@
-GNULIB_HYPOTF = @GNULIB_HYPOTF@
-GNULIB_HYPOTL = @GNULIB_HYPOTL@
-GNULIB_ILOGB = @GNULIB_ILOGB@
-GNULIB_ILOGBF = @GNULIB_ILOGBF@
-GNULIB_ILOGBL = @GNULIB_ILOGBL@
-GNULIB_IMAXABS = @GNULIB_IMAXABS@
-GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
-GNULIB_ISATTY = @GNULIB_ISATTY@
-GNULIB_ISBLANK = @GNULIB_ISBLANK@
-GNULIB_ISFINITE = @GNULIB_ISFINITE@
-GNULIB_ISINF = @GNULIB_ISINF@
-GNULIB_ISNAN = @GNULIB_ISNAN@
-GNULIB_ISNAND = @GNULIB_ISNAND@
-GNULIB_ISNANF = @GNULIB_ISNANF@
-GNULIB_ISNANL = @GNULIB_ISNANL@
-GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
-GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
-GNULIB_LCHMOD = @GNULIB_LCHMOD@
-GNULIB_LCHOWN = @GNULIB_LCHOWN@
-GNULIB_LDEXPF = @GNULIB_LDEXPF@
-GNULIB_LDEXPL = @GNULIB_LDEXPL@
-GNULIB_LINK = @GNULIB_LINK@
-GNULIB_LINKAT = @GNULIB_LINKAT@
-GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
-GNULIB_LOG = @GNULIB_LOG@
-GNULIB_LOG10 = @GNULIB_LOG10@
-GNULIB_LOG10F = @GNULIB_LOG10F@
-GNULIB_LOG10L = @GNULIB_LOG10L@
-GNULIB_LOG1P = @GNULIB_LOG1P@
-GNULIB_LOG1PF = @GNULIB_LOG1PF@
-GNULIB_LOG1PL = @GNULIB_LOG1PL@
-GNULIB_LOG2 = @GNULIB_LOG2@
-GNULIB_LOG2F = @GNULIB_LOG2F@
-GNULIB_LOG2L = @GNULIB_LOG2L@
-GNULIB_LOGB = @GNULIB_LOGB@
-GNULIB_LOGBF = @GNULIB_LOGBF@
-GNULIB_LOGBL = @GNULIB_LOGBL@
-GNULIB_LOGF = @GNULIB_LOGF@
-GNULIB_LOGL = @GNULIB_LOGL@
-GNULIB_LSEEK = @GNULIB_LSEEK@
-GNULIB_LSTAT = @GNULIB_LSTAT@
-GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
-GNULIB_MBRLEN = @GNULIB_MBRLEN@
-GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
-GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
-GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
-GNULIB_MBSCHR = @GNULIB_MBSCHR@
-GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
-GNULIB_MBSINIT = @GNULIB_MBSINIT@
-GNULIB_MBSLEN = @GNULIB_MBSLEN@
-GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
-GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
-GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
-GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
-GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
-GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
-GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
-GNULIB_MBSSEP = @GNULIB_MBSSEP@
-GNULIB_MBSSPN = @GNULIB_MBSSPN@
-GNULIB_MBSSTR = @GNULIB_MBSSTR@
-GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
-GNULIB_MBTOWC = @GNULIB_MBTOWC@
-GNULIB_MEMCHR = @GNULIB_MEMCHR@
-GNULIB_MEMMEM = @GNULIB_MEMMEM@
-GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
-GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
-GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
-GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
-GNULIB_MKFIFO = @GNULIB_MKFIFO@
-GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
-GNULIB_MKNOD = @GNULIB_MKNOD@
-GNULIB_MKNODAT = @GNULIB_MKNODAT@
-GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
-GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
-GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
-GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
-GNULIB_MKTIME = @GNULIB_MKTIME@
-GNULIB_MODF = @GNULIB_MODF@
-GNULIB_MODFF = @GNULIB_MODFF@
-GNULIB_MODFL = @GNULIB_MODFL@
-GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
-GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
-GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
-GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
-GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
-GNULIB_OPEN = @GNULIB_OPEN@
-GNULIB_OPENAT = @GNULIB_OPENAT@
-GNULIB_OPENDIR = @GNULIB_OPENDIR@
-GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@
-GNULIB_PCLOSE = @GNULIB_PCLOSE@
-GNULIB_PERROR = @GNULIB_PERROR@
-GNULIB_PIPE = @GNULIB_PIPE@
-GNULIB_PIPE2 = @GNULIB_PIPE2@
-GNULIB_POPEN = @GNULIB_POPEN@
-GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
-GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@
-GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@
-GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
-GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
-GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@
-GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
-GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
-GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
-GNULIB_POWF = @GNULIB_POWF@
-GNULIB_PREAD = @GNULIB_PREAD@
-GNULIB_PRINTF = @GNULIB_PRINTF@
-GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
-GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
-GNULIB_PTSNAME = @GNULIB_PTSNAME@
-GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
-GNULIB_PUTC = @GNULIB_PUTC@
-GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
-GNULIB_PUTENV = @GNULIB_PUTENV@
-GNULIB_PUTS = @GNULIB_PUTS@
-GNULIB_PWRITE = @GNULIB_PWRITE@
-GNULIB_QSORT_R = @GNULIB_QSORT_R@
-GNULIB_RAISE = @GNULIB_RAISE@
-GNULIB_RANDOM = @GNULIB_RANDOM@
-GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
-GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
-GNULIB_READ = @GNULIB_READ@
-GNULIB_READDIR = @GNULIB_READDIR@
-GNULIB_READLINK = @GNULIB_READLINK@
-GNULIB_READLINKAT = @GNULIB_READLINKAT@
-GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
-GNULIB_REALPATH = @GNULIB_REALPATH@
-GNULIB_REMAINDER = @GNULIB_REMAINDER@
-GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
-GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
-GNULIB_REMOVE = @GNULIB_REMOVE@
-GNULIB_RENAME = @GNULIB_RENAME@
-GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
-GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
-GNULIB_RINT = @GNULIB_RINT@
-GNULIB_RINTF = @GNULIB_RINTF@
-GNULIB_RINTL = @GNULIB_RINTL@
-GNULIB_RMDIR = @GNULIB_RMDIR@
-GNULIB_ROUND = @GNULIB_ROUND@
-GNULIB_ROUNDF = @GNULIB_ROUNDF@
-GNULIB_ROUNDL = @GNULIB_ROUNDL@
-GNULIB_RPMATCH = @GNULIB_RPMATCH@
-GNULIB_SCANDIR = @GNULIB_SCANDIR@
-GNULIB_SCANF = @GNULIB_SCANF@
-GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
-GNULIB_SETENV = @GNULIB_SETENV@
-GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
-GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
-GNULIB_SIGACTION = @GNULIB_SIGACTION@
-GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
-GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
-GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
-GNULIB_SINF = @GNULIB_SINF@
-GNULIB_SINHF = @GNULIB_SINHF@
-GNULIB_SINL = @GNULIB_SINL@
-GNULIB_SLEEP = @GNULIB_SLEEP@
-GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
-GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
-GNULIB_SQRTF = @GNULIB_SQRTF@
-GNULIB_SQRTL = @GNULIB_SQRTL@
-GNULIB_STAT = @GNULIB_STAT@
-GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
-GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
-GNULIB_STPCPY = @GNULIB_STPCPY@
-GNULIB_STPNCPY = @GNULIB_STPNCPY@
-GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
-GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
-GNULIB_STRDUP = @GNULIB_STRDUP@
-GNULIB_STRERROR = @GNULIB_STRERROR@
-GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
-GNULIB_STRNCAT = @GNULIB_STRNCAT@
-GNULIB_STRNDUP = @GNULIB_STRNDUP@
-GNULIB_STRNLEN = @GNULIB_STRNLEN@
-GNULIB_STRPBRK = @GNULIB_STRPBRK@
-GNULIB_STRPTIME = @GNULIB_STRPTIME@
-GNULIB_STRSEP = @GNULIB_STRSEP@
-GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
-GNULIB_STRSTR = @GNULIB_STRSTR@
-GNULIB_STRTOD = @GNULIB_STRTOD@
-GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
-GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
-GNULIB_STRTOLL = @GNULIB_STRTOLL@
-GNULIB_STRTOULL = @GNULIB_STRTOULL@
-GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
-GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
-GNULIB_SYMLINK = @GNULIB_SYMLINK@
-GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
-GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
-GNULIB_TANF = @GNULIB_TANF@
-GNULIB_TANHF = @GNULIB_TANHF@
-GNULIB_TANL = @GNULIB_TANL@
-GNULIB_TIMEGM = @GNULIB_TIMEGM@
-GNULIB_TIME_R = @GNULIB_TIME_R@
-GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
-GNULIB_TMPFILE = @GNULIB_TMPFILE@
-GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
-GNULIB_TRUNC = @GNULIB_TRUNC@
-GNULIB_TRUNCF = @GNULIB_TRUNCF@
-GNULIB_TRUNCL = @GNULIB_TRUNCL@
-GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
-GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
-GNULIB_UNLINK = @GNULIB_UNLINK@
-GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
-GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
-GNULIB_UNSETENV = @GNULIB_UNSETENV@
-GNULIB_USLEEP = @GNULIB_USLEEP@
-GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
-GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
-GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
-GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
-GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
-GNULIB_VFSCANF = @GNULIB_VFSCANF@
-GNULIB_VPRINTF = @GNULIB_VPRINTF@
-GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
-GNULIB_VSCANF = @GNULIB_VSCANF@
-GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
-GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
-GNULIB_WAITPID = @GNULIB_WAITPID@
-GNULIB_WCPCPY = @GNULIB_WCPCPY@
-GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
-GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
-GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
-GNULIB_WCSCAT = @GNULIB_WCSCAT@
-GNULIB_WCSCHR = @GNULIB_WCSCHR@
-GNULIB_WCSCMP = @GNULIB_WCSCMP@
-GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
-GNULIB_WCSCPY = @GNULIB_WCSCPY@
-GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
-GNULIB_WCSDUP = @GNULIB_WCSDUP@
-GNULIB_WCSLEN = @GNULIB_WCSLEN@
-GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
-GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
-GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
-GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
-GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
-GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
-GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
-GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
-GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
-GNULIB_WCSSPN = @GNULIB_WCSSPN@
-GNULIB_WCSSTR = @GNULIB_WCSSTR@
-GNULIB_WCSTOK = @GNULIB_WCSTOK@
-GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
-GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
-GNULIB_WCTOB = @GNULIB_WCTOB@
-GNULIB_WCTOMB = @GNULIB_WCTOMB@
-GNULIB_WCTRANS = @GNULIB_WCTRANS@
-GNULIB_WCTYPE = @GNULIB_WCTYPE@
-GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
-GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
-GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
-GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
-GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
-GNULIB_WMEMSET = @GNULIB_WMEMSET@
-GNULIB_WRITE = @GNULIB_WRITE@
-GNULIB__EXIT = @GNULIB__EXIT@
 GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ACOSF = @HAVE_ACOSF@
 HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ASINF = @HAVE_ASINF@
 HAVE_ASINL = @HAVE_ASINL@
 HAVE_ATAN2F = @HAVE_ATAN2F@
@@ -677,9 +852,11 @@ HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
 HAVE_COPYSIGN = @HAVE_COPYSIGN@
 HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
 HAVE_COSF = @HAVE_COSF@
 HAVE_COSHF = @HAVE_COSHF@
 HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
 HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
 HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
 HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
@@ -690,13 +867,17 @@ HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
 HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
 HAVE_DECL_COSL = @HAVE_DECL_COSL@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
 HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
 HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
 HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
 HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
 HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
 HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
 HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
@@ -705,6 +886,7 @@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
 HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
@@ -715,6 +897,9 @@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
 HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
 HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
 HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
 HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
@@ -734,6 +919,7 @@ HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
 HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
 HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
 HAVE_DECL_SINL = @HAVE_DECL_SINL@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
@@ -747,21 +933,24 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TANL = @HAVE_DECL_TANL@
 HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
-HAVE_DUP2 = @HAVE_DUP2@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
 HAVE_EXPF = @HAVE_EXPF@
 HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
 HAVE_EXPM1 = @HAVE_EXPM1@
 HAVE_EXPM1F = @HAVE_EXPM1F@
 HAVE_FABSF = @HAVE_FABSF@
@@ -781,6 +970,7 @@ HAVE_FMAF = @HAVE_FMAF@
 HAVE_FMAL = @HAVE_FMAL@
 HAVE_FMODF = @HAVE_FMODF@
 HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
 HAVE_FREXPF = @HAVE_FREXPF@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
@@ -789,13 +979,17 @@ HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
 HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
 HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETRANDOM = @HAVE_GETRANDOM@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GETUMASK = @HAVE_GETUMASK@
 HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_HYPOTF = @HAVE_HYPOTF@
@@ -803,6 +997,8 @@ HAVE_HYPOTL = @HAVE_HYPOTL@
 HAVE_ILOGB = @HAVE_ILOGB@
 HAVE_ILOGBF = @HAVE_ILOGBF@
 HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISNAND = @HAVE_ISNAND@
@@ -810,6 +1006,7 @@ HAVE_ISNANF = @HAVE_ISNANF@
 HAVE_ISNANL = @HAVE_ISNANL@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
 HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
 HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
 HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
@@ -830,7 +1027,6 @@ HAVE_LOGBF = @HAVE_LOGBF@
 HAVE_LOGBL = @HAVE_LOGBL@
 HAVE_LOGF = @HAVE_LOGF@
 HAVE_LOGL = @HAVE_LOGL@
-HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
 HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
 HAVE_MBRLEN = @HAVE_MBRLEN@
@@ -839,7 +1035,7 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
 HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
-HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MBTOWC = @HAVE_MBTOWC@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
 HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
@@ -855,6 +1051,8 @@ HAVE_MODFF = @HAVE_MODFF@
 HAVE_MODFL = @HAVE_MODFL@
 HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OPENDIR = @HAVE_OPENDIR@
@@ -863,14 +1061,76 @@ HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@
 HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PSELECT = @HAVE_PSELECT@
+HAVE_PTHREAD_ATTR_DESTROY = @HAVE_PTHREAD_ATTR_DESTROY@
+HAVE_PTHREAD_ATTR_GETDETACHSTATE = @HAVE_PTHREAD_ATTR_GETDETACHSTATE@
+HAVE_PTHREAD_ATTR_INIT = @HAVE_PTHREAD_ATTR_INIT@
+HAVE_PTHREAD_ATTR_SETDETACHSTATE = @HAVE_PTHREAD_ATTR_SETDETACHSTATE@
+HAVE_PTHREAD_CONDATTR_DESTROY = @HAVE_PTHREAD_CONDATTR_DESTROY@
+HAVE_PTHREAD_CONDATTR_INIT = @HAVE_PTHREAD_CONDATTR_INIT@
+HAVE_PTHREAD_COND_BROADCAST = @HAVE_PTHREAD_COND_BROADCAST@
+HAVE_PTHREAD_COND_DESTROY = @HAVE_PTHREAD_COND_DESTROY@
+HAVE_PTHREAD_COND_INIT = @HAVE_PTHREAD_COND_INIT@
+HAVE_PTHREAD_COND_SIGNAL = @HAVE_PTHREAD_COND_SIGNAL@
+HAVE_PTHREAD_COND_TIMEDWAIT = @HAVE_PTHREAD_COND_TIMEDWAIT@
+HAVE_PTHREAD_COND_WAIT = @HAVE_PTHREAD_COND_WAIT@
+HAVE_PTHREAD_CREATE = @HAVE_PTHREAD_CREATE@
+HAVE_PTHREAD_CREATE_DETACHED = @HAVE_PTHREAD_CREATE_DETACHED@
+HAVE_PTHREAD_DETACH = @HAVE_PTHREAD_DETACH@
+HAVE_PTHREAD_EQUAL = @HAVE_PTHREAD_EQUAL@
+HAVE_PTHREAD_EXIT = @HAVE_PTHREAD_EXIT@
+HAVE_PTHREAD_GETSPECIFIC = @HAVE_PTHREAD_GETSPECIFIC@
+HAVE_PTHREAD_H = @HAVE_PTHREAD_H@
+HAVE_PTHREAD_JOIN = @HAVE_PTHREAD_JOIN@
+HAVE_PTHREAD_KEY_CREATE = @HAVE_PTHREAD_KEY_CREATE@
+HAVE_PTHREAD_KEY_DELETE = @HAVE_PTHREAD_KEY_DELETE@
+HAVE_PTHREAD_MUTEXATTR_DESTROY = @HAVE_PTHREAD_MUTEXATTR_DESTROY@
+HAVE_PTHREAD_MUTEXATTR_GETROBUST = @HAVE_PTHREAD_MUTEXATTR_GETROBUST@
+HAVE_PTHREAD_MUTEXATTR_GETTYPE = @HAVE_PTHREAD_MUTEXATTR_GETTYPE@
+HAVE_PTHREAD_MUTEXATTR_INIT = @HAVE_PTHREAD_MUTEXATTR_INIT@
+HAVE_PTHREAD_MUTEXATTR_SETROBUST = @HAVE_PTHREAD_MUTEXATTR_SETROBUST@
+HAVE_PTHREAD_MUTEXATTR_SETTYPE = @HAVE_PTHREAD_MUTEXATTR_SETTYPE@
+HAVE_PTHREAD_MUTEX_DESTROY = @HAVE_PTHREAD_MUTEX_DESTROY@
+HAVE_PTHREAD_MUTEX_INIT = @HAVE_PTHREAD_MUTEX_INIT@
+HAVE_PTHREAD_MUTEX_LOCK = @HAVE_PTHREAD_MUTEX_LOCK@
+HAVE_PTHREAD_MUTEX_RECURSIVE = @HAVE_PTHREAD_MUTEX_RECURSIVE@
+HAVE_PTHREAD_MUTEX_ROBUST = @HAVE_PTHREAD_MUTEX_ROBUST@
+HAVE_PTHREAD_MUTEX_TIMEDLOCK = @HAVE_PTHREAD_MUTEX_TIMEDLOCK@
+HAVE_PTHREAD_MUTEX_TRYLOCK = @HAVE_PTHREAD_MUTEX_TRYLOCK@
+HAVE_PTHREAD_MUTEX_UNLOCK = @HAVE_PTHREAD_MUTEX_UNLOCK@
+HAVE_PTHREAD_ONCE = @HAVE_PTHREAD_ONCE@
+HAVE_PTHREAD_PROCESS_SHARED = @HAVE_PTHREAD_PROCESS_SHARED@
+HAVE_PTHREAD_RWLOCKATTR_DESTROY = @HAVE_PTHREAD_RWLOCKATTR_DESTROY@
+HAVE_PTHREAD_RWLOCKATTR_INIT = @HAVE_PTHREAD_RWLOCKATTR_INIT@
+HAVE_PTHREAD_RWLOCK_DESTROY = @HAVE_PTHREAD_RWLOCK_DESTROY@
+HAVE_PTHREAD_RWLOCK_INIT = @HAVE_PTHREAD_RWLOCK_INIT@
+HAVE_PTHREAD_RWLOCK_RDLOCK = @HAVE_PTHREAD_RWLOCK_RDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+HAVE_PTHREAD_RWLOCK_TRYRDLOCK = @HAVE_PTHREAD_RWLOCK_TRYRDLOCK@
+HAVE_PTHREAD_RWLOCK_TRYWRLOCK = @HAVE_PTHREAD_RWLOCK_TRYWRLOCK@
+HAVE_PTHREAD_RWLOCK_UNLOCK = @HAVE_PTHREAD_RWLOCK_UNLOCK@
+HAVE_PTHREAD_RWLOCK_WRLOCK = @HAVE_PTHREAD_RWLOCK_WRLOCK@
+HAVE_PTHREAD_SELF = @HAVE_PTHREAD_SELF@
+HAVE_PTHREAD_SETSPECIFIC = @HAVE_PTHREAD_SETSPECIFIC@
 HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
+HAVE_PTHREAD_SPINLOCK_T = @HAVE_PTHREAD_SPINLOCK_T@
+HAVE_PTHREAD_SPIN_DESTROY = @HAVE_PTHREAD_SPIN_DESTROY@
+HAVE_PTHREAD_SPIN_INIT = @HAVE_PTHREAD_SPIN_INIT@
+HAVE_PTHREAD_SPIN_LOCK = @HAVE_PTHREAD_SPIN_LOCK@
+HAVE_PTHREAD_SPIN_TRYLOCK = @HAVE_PTHREAD_SPIN_TRYLOCK@
+HAVE_PTHREAD_SPIN_UNLOCK = @HAVE_PTHREAD_SPIN_UNLOCK@
+HAVE_PTHREAD_T = @HAVE_PTHREAD_T@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
@@ -883,6 +1143,7 @@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READDIR = @HAVE_READDIR@
 HAVE_READLINK = @HAVE_READLINK@
 HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
 HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_REMAINDER = @HAVE_REMAINDER@
 HAVE_REMAINDERF = @HAVE_REMAINDERF@
@@ -892,12 +1153,17 @@ HAVE_RINT = @HAVE_RINT@
 HAVE_RINTL = @HAVE_RINTL@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SCHED_H = @HAVE_SCHED_H@
+HAVE_SCHED_YIELD = @HAVE_SCHED_YIELD@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
 HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
 HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
 HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
@@ -916,15 +1182,21 @@ HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
 HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRPTIME = @HAVE_STRPTIME@
 HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
 HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@
 HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -932,24 +1204,30 @@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@
+HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
 HAVE_TANF = @HAVE_TANF@
 HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
 HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
-HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
 HAVE_USLEEP = @HAVE_USLEEP@
 HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
 HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCPCPY = @HAVE_WCPCPY@
@@ -963,6 +1241,7 @@ HAVE_WCSCOLL = @HAVE_WCSCOLL@
 HAVE_WCSCPY = @HAVE_WCSCPY@
 HAVE_WCSCSPN = @HAVE_WCSCSPN@
 HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
 HAVE_WCSLEN = @HAVE_WCSLEN@
 HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
 HAVE_WCSNCAT = @HAVE_WCSNCAT@
@@ -987,12 +1266,19 @@ HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
 HAVE_WMEMCPY = @HAVE_WMEMCPY@
 HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
 HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
+HOST_CPU = @HOST_CPU@
+HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -1000,34 +1286,55 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
 INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LIBCSTACK = @LIBCSTACK@
+LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM4_LIBDEPS = @LIBM4_LIBDEPS@
 LIBM4_LTLIBDEPS = @LIBM4_LTLIBDEPS@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
-LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBSIGSEGV = @LIBSIGSEGV@
 LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
 LIBTHREAD = @LIBTHREAD@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_GETRANDOM = @LIB_GETRANDOM@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
 LIB_POSIX_SPAWN = @LIB_POSIX_SPAWN@
+LIB_PTHREAD = @LIB_PTHREAD@
+LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SELECT = @LIB_SELECT@
+LIB_SEMAPHORE = @LIB_SEMAPHORE@
+LIB_SETLOCALE = @LIB_SETLOCALE@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
 LIMITS_H = @LIMITS_H@
 LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
 LOCALE_FR = @LOCALE_FR@
 LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
 LOCALE_JA = @LOCALE_JA@
 LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
 LOCALE_ZH_CN = @LOCALE_ZH_CN@
 LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
-LTLIBPTH = @LTLIBPTH@
 LTLIBSIGSEGV = @LTLIBSIGSEGV@
 LTLIBTHREAD = @LTLIBTHREAD@
 M4_LIBOBJS = @M4_LIBOBJS@
@@ -1037,17 +1344,26 @@ M4tests_LTLIBOBJS = @M4tests_LTLIBOBJS@
 M4tests_WITNESS = @M4tests_WITNESS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
 NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@
 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H = @NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H@
 NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@
 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
 NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@
@@ -1057,9 +1373,14 @@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
 NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
@@ -1071,11 +1392,14 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FCNTL_H = @NEXT_FCNTL_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
 NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_PTHREAD_H = @NEXT_PTHREAD_H@
 NEXT_SCHED_H = @NEXT_SCHED_H@
 NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_SPAWN_H = @NEXT_SPAWN_H@
@@ -1085,9 +1409,14 @@ NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@
+NEXT_SYS_RANDOM_H = @NEXT_SYS_RANDOM_H@
+NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
 NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
 NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -1103,14 +1432,16 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
 PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
 PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PRIPTR_PREFIX = @PRIPTR_PREFIX@
-PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
 PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
+REPLACE_ACCESS = @REPLACE_ACCESS@
 REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
 REPLACE_ASINF = @REPLACE_ASINF@
 REPLACE_ATAN2F = @REPLACE_ATAN2F@
 REPLACE_ATANF = @REPLACE_ATANF@
@@ -1127,23 +1458,37 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
 REPLACE_COSF = @REPLACE_COSF@
 REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
 REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
 REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
 REPLACE_EXP2 = @REPLACE_EXP2@
 REPLACE_EXP2L = @REPLACE_EXP2L@
 REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
 REPLACE_EXPM1 = @REPLACE_EXPM1@
 REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
 REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
 REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
 REPLACE_FLOOR = @REPLACE_FLOOR@
 REPLACE_FLOORF = @REPLACE_FLOORF@
 REPLACE_FLOORL = @REPLACE_FLOORL@
@@ -1156,6 +1501,8 @@ REPLACE_FMODL = @REPLACE_FMODL@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FREXP = @REPLACE_FREXP@
 REPLACE_FREXPF = @REPLACE_FREXPF@
@@ -1176,20 +1523,32 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
 REPLACE_HYPOT = @REPLACE_HYPOT@
 REPLACE_HYPOTF = @REPLACE_HYPOTF@
 REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
 REPLACE_ILOGB = @REPLACE_ILOGB@
 REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_IOCTL = @REPLACE_IOCTL@
 REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISFINITE = @REPLACE_ISFINITE@
 REPLACE_ISINF = @REPLACE_ISINF@
 REPLACE_ISNAN = @REPLACE_ISNAN@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
 REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LDEXPL = @REPLACE_LDEXPL@
@@ -1227,7 +1586,9 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@
 REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
 REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
 REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
 REPLACE_MKTIME = @REPLACE_MKTIME@
 REPLACE_MODF = @REPLACE_MODF@
@@ -1235,6 +1596,7 @@ REPLACE_MODFF = @REPLACE_MODFF@
 REPLACE_MODFL = @REPLACE_MODFL@
 REPLACE_NAN = @REPLACE_NAN@
 REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
 REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
 REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
@@ -1243,24 +1605,81 @@ REPLACE_OPENAT = @REPLACE_OPENAT@
 REPLACE_OPENDIR = @REPLACE_OPENDIR@
 REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
 REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PSELECT = @REPLACE_PSELECT@
+REPLACE_PTHREAD_ATTR_DESTROY = @REPLACE_PTHREAD_ATTR_DESTROY@
+REPLACE_PTHREAD_ATTR_GETDETACHSTATE = @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@
+REPLACE_PTHREAD_ATTR_INIT = @REPLACE_PTHREAD_ATTR_INIT@
+REPLACE_PTHREAD_ATTR_SETDETACHSTATE = @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@
+REPLACE_PTHREAD_CONDATTR_DESTROY = @REPLACE_PTHREAD_CONDATTR_DESTROY@
+REPLACE_PTHREAD_CONDATTR_INIT = @REPLACE_PTHREAD_CONDATTR_INIT@
+REPLACE_PTHREAD_COND_BROADCAST = @REPLACE_PTHREAD_COND_BROADCAST@
+REPLACE_PTHREAD_COND_DESTROY = @REPLACE_PTHREAD_COND_DESTROY@
+REPLACE_PTHREAD_COND_INIT = @REPLACE_PTHREAD_COND_INIT@
+REPLACE_PTHREAD_COND_SIGNAL = @REPLACE_PTHREAD_COND_SIGNAL@
+REPLACE_PTHREAD_COND_TIMEDWAIT = @REPLACE_PTHREAD_COND_TIMEDWAIT@
+REPLACE_PTHREAD_COND_WAIT = @REPLACE_PTHREAD_COND_WAIT@
+REPLACE_PTHREAD_CREATE = @REPLACE_PTHREAD_CREATE@
+REPLACE_PTHREAD_DETACH = @REPLACE_PTHREAD_DETACH@
+REPLACE_PTHREAD_EQUAL = @REPLACE_PTHREAD_EQUAL@
+REPLACE_PTHREAD_EXIT = @REPLACE_PTHREAD_EXIT@
+REPLACE_PTHREAD_GETSPECIFIC = @REPLACE_PTHREAD_GETSPECIFIC@
+REPLACE_PTHREAD_JOIN = @REPLACE_PTHREAD_JOIN@
+REPLACE_PTHREAD_KEY_CREATE = @REPLACE_PTHREAD_KEY_CREATE@
+REPLACE_PTHREAD_KEY_DELETE = @REPLACE_PTHREAD_KEY_DELETE@
+REPLACE_PTHREAD_MUTEXATTR_DESTROY = @REPLACE_PTHREAD_MUTEXATTR_DESTROY@
+REPLACE_PTHREAD_MUTEXATTR_GETROBUST = @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_GETTYPE = @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@
+REPLACE_PTHREAD_MUTEXATTR_INIT = @REPLACE_PTHREAD_MUTEXATTR_INIT@
+REPLACE_PTHREAD_MUTEXATTR_SETROBUST = @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_SETTYPE = @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@
+REPLACE_PTHREAD_MUTEX_DESTROY = @REPLACE_PTHREAD_MUTEX_DESTROY@
+REPLACE_PTHREAD_MUTEX_INIT = @REPLACE_PTHREAD_MUTEX_INIT@
+REPLACE_PTHREAD_MUTEX_LOCK = @REPLACE_PTHREAD_MUTEX_LOCK@
+REPLACE_PTHREAD_MUTEX_TIMEDLOCK = @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@
+REPLACE_PTHREAD_MUTEX_TRYLOCK = @REPLACE_PTHREAD_MUTEX_TRYLOCK@
+REPLACE_PTHREAD_MUTEX_UNLOCK = @REPLACE_PTHREAD_MUTEX_UNLOCK@
+REPLACE_PTHREAD_ONCE = @REPLACE_PTHREAD_ONCE@
+REPLACE_PTHREAD_RWLOCKATTR_DESTROY = @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@
+REPLACE_PTHREAD_RWLOCKATTR_INIT = @REPLACE_PTHREAD_RWLOCKATTR_INIT@
+REPLACE_PTHREAD_RWLOCK_DESTROY = @REPLACE_PTHREAD_RWLOCK_DESTROY@
+REPLACE_PTHREAD_RWLOCK_INIT = @REPLACE_PTHREAD_RWLOCK_INIT@
+REPLACE_PTHREAD_RWLOCK_RDLOCK = @REPLACE_PTHREAD_RWLOCK_RDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYRDLOCK = @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYWRLOCK = @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@
+REPLACE_PTHREAD_RWLOCK_UNLOCK = @REPLACE_PTHREAD_RWLOCK_UNLOCK@
+REPLACE_PTHREAD_RWLOCK_WRLOCK = @REPLACE_PTHREAD_RWLOCK_WRLOCK@
+REPLACE_PTHREAD_SELF = @REPLACE_PTHREAD_SELF@
+REPLACE_PTHREAD_SETSPECIFIC = @REPLACE_PTHREAD_SETSPECIFIC@
 REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
+REPLACE_PTHREAD_SPIN_DESTROY = @REPLACE_PTHREAD_SPIN_DESTROY@
+REPLACE_PTHREAD_SPIN_INIT = @REPLACE_PTHREAD_SPIN_INIT@
+REPLACE_PTHREAD_SPIN_LOCK = @REPLACE_PTHREAD_SPIN_LOCK@
+REPLACE_PTHREAD_SPIN_TRYLOCK = @REPLACE_PTHREAD_SPIN_TRYLOCK@
+REPLACE_PTHREAD_SPIN_UNLOCK = @REPLACE_PTHREAD_SPIN_UNLOCK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
 REPLACE_RAISE = @REPLACE_RAISE@
+REPLACE_RANDOM = @REPLACE_RANDOM@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_READLINKAT = @REPLACE_READLINKAT@
 REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
 REPLACE_REALPATH = @REPLACE_REALPATH@
 REPLACE_REMAINDER = @REPLACE_REMAINDER@
 REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
@@ -1268,14 +1687,18 @@ REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
 REPLACE_REMOVE = @REPLACE_REMOVE@
 REPLACE_RENAME = @REPLACE_RENAME@
 REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
 REPLACE_RMDIR = @REPLACE_RMDIR@
 REPLACE_ROUND = @REPLACE_ROUND@
 REPLACE_ROUNDF = @REPLACE_ROUNDF@
 REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SCHED_YIELD = @REPLACE_SCHED_YIELD@
+REPLACE_SELECT = @REPLACE_SELECT@
 REPLACE_SETENV = @REPLACE_SETENV@
 REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
 REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
-REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
 REPLACE_SINF = @REPLACE_SINF@
 REPLACE_SINHF = @REPLACE_SINHF@
 REPLACE_SLEEP = @REPLACE_SLEEP@
@@ -1291,7 +1714,9 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
 REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
 REPLACE_STRNCAT = @REPLACE_STRNCAT@
 REPLACE_STRNDUP = @REPLACE_STRNDUP@
 REPLACE_STRNLEN = @REPLACE_STRNLEN@
@@ -1300,6 +1725,11 @@ REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
 REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
 REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
 REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
 REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
@@ -1311,9 +1741,11 @@ REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
 REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
 REPLACE_TRUNCF = @REPLACE_TRUNCF@
 REPLACE_TRUNCL = @REPLACE_TRUNCL@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
 REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -1326,17 +1758,19 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
 REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
 REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCTOMB = @REPLACE_WCTOMB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 REPLACE_WRITE = @REPLACE_WRITE@
-SCHED_H = @SCHED_H@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIGSEGV_H = @SIGSEGV_H@
 SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
 SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 STDALIGN_H = @STDALIGN_H@
@@ -1345,27 +1779,37 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
 UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
 UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
 WERROR_CFLAGS = @WERROR_CFLAGS@
 WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
 WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+YIELD_LIB = @YIELD_LIB@
 abs_aux_dir = @abs_aux_dir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 am__include = @am__include@
@@ -1441,8 +1885,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -1460,7 +1904,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index a47b267..58518b8 100755 (executable)
@@ -1,6 +1,7 @@
 #!/bin/sh
 # Check GNU m4 against examples from the manual source.
-# Copyright (C) 1992, 2006-2014, 2016 Free Software Foundation, Inc.
+# Copyright (C) 1992, 2006-2014, 2016-2017, 2020-2021 Free Software
+# Foundation, Inc.
 #
 # This file is part of GNU M4.
 #
@@ -15,7 +16,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # Clean up temp files on exit
 pwd=`pwd`
index cfe8a9d..45db014 100755 (executable)
@@ -1,7 +1,8 @@
 #!/bin/sh
 # -*- AWK -*-
 # Extract all examples from the manual source.
-# Copyright (C) 1992, 2005-2014, 2016 Free Software Foundation, Inc.
+# Copyright (C) 1992, 2005-2014, 2016-2017, 2020-2021 Free Software
+# Foundation, Inc.
 #
 # This file is part of GNU M4.
 #
@@ -16,7 +17,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # This script was designed under GNU awk, but hopefully portable to
 # other implementations.
index 3924f1e..16b9753 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 # This file is part of the GNU m4 testsuite
-# Copyright (C) 2000, 2003, 2007-2014, 2016 Free Software Foundation,
-# Inc.
+# Copyright (C) 2000, 2003, 2007-2014, 2016-2017, 2020-2021 Free
+# Software Foundation, Inc.
 #
 # This file is part of GNU M4.
 #
@@ -16,7 +16,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # Script to verify that stack overflow is diagnosed properly when
 # there is infinite macro call nesting, provided the OS supports it.
index 480b45a..883336a 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,11 +1,12 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GNU M4 1.4.18.
+# Generated by GNU Autoconf 2.71 for GNU M4 1.4.19.
 #
 # Report bugs to <bug-m4@gnu.org>.
 #
 #
-# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
+# Inc.
 #
 #
 # This configure script is free software; the Free Software Foundation
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+as_nop=:
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
-else
+else $as_nop
   case `(set -o) 2>/dev/null` in #(
   *posix*) :
     set -o posix ;; #(
@@ -33,46 +36,46 @@ esac
 fi
 
 
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
 as_nl='
 '
 export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-       expr "X$arg" : "X\\(.*\\)$as_nl";
-       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" ""       $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh).  This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2)            ; then :; else exec 2>/dev/null; fi
 
 # The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
   PATH_SEPARATOR=:
   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -81,13 +84,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
 fi
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""       $as_nl"
-
 # Find who we are.  Look in the path if we contain no directory separator.
 as_myself=
 case $0 in #((
@@ -96,8 +92,12 @@ case $0 in #((
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    test -r "$as_dir$0" && as_myself=$as_dir$0 && break
   done
 IFS=$as_save_IFS
 
@@ -109,30 +109,10 @@ if test "x$as_myself" = x; then
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
   exit 1
 fi
 
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 # Use a proper internal environment variable to ensure we don't fall
   # into an infinite loop, continuously re-executing ourselves.
@@ -154,20 +134,22 @@ esac
 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
 # Admittedly, this is quite paranoid, since all the known shells bail
 # out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
-as_fn_exit 255
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
   fi
   # We don't want this to propagate to other subprocesses.
           { _as_can_reexec=; unset _as_can_reexec;}
 if test "x$CONFIG_SHELL" = x; then
-  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  as_bourne_compatible="as_nop=:
+if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '\${1+\"\$@\"}'='\"\$@\"'
   setopt NO_GLOB_SUBST
-else
+else \$as_nop
   case \`(set -o) 2>/dev/null\` in #(
   *posix*) :
     set -o posix ;; #(
@@ -187,42 +169,53 @@ as_fn_success || { exitcode=1; echo as_fn_success failed.; }
 as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
 as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
 as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
-if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+if ( set x; as_fn_ret_success y && test x = \"\$1\" )
+then :
 
-else
+else \$as_nop
   exitcode=1; echo positional parameters were not saved.
 fi
 test x\$exitcode = x0 || exit 1
+blah=\$(echo \$(echo blah))
+test x\"\$blah\" = xblah || exit 1
 test -x / || exit 1"
   as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
   as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
   eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
   test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
 test \$(( 1 + 1 )) = 2 || exit 1"
-  if (eval "$as_required") 2>/dev/null; then :
+  if (eval "$as_required") 2>/dev/null
+then :
   as_have_required=yes
-else
+else $as_nop
   as_have_required=no
 fi
-  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
+then :
 
-else
+else $as_nop
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 as_found=false
 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
   as_found=:
   case $as_dir in #(
         /*)
           for as_base in sh bash ksh sh5; do
             # Try only shells that exist, to save several forks.
-            as_shell=$as_dir/$as_base
+            as_shell=$as_dir$as_base
             if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
-                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+                   as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
   CONFIG_SHELL=$as_shell as_have_required=yes
-                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+                  if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
+then :
   break 2
 fi
 fi
@@ -230,14 +223,21 @@ fi
        esac
   as_found=false
 done
-$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
-             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
-  CONFIG_SHELL=$SHELL as_have_required=yes
-fi; }
 IFS=$as_save_IFS
+if $as_found
+then :
+
+else $as_nop
+  if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
+then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi
+fi
 
 
-      if test "x$CONFIG_SHELL" != x; then :
+      if test "x$CONFIG_SHELL" != x
+then :
   export CONFIG_SHELL
              # We cannot yet assume a decent shell, so we have to provide a
 # neutralization value for shells without unset; and this also
@@ -255,18 +255,19 @@ esac
 exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
 # Admittedly, this is quite paranoid, since all the known shells bail
 # out after a failed `exec'.
-$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
 exit 255
 fi
 
-    if test x$as_have_required = xno; then :
-  $as_echo "$0: This script requires a shell more modern than all"
-  $as_echo "$0: the shells that I found on your system."
-  if test x${ZSH_VERSION+set} = xset ; then
-    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
-    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+    if test x$as_have_required = xno
+then :
+  printf "%s\n" "$0: This script requires a shell more modern than all"
+  printf "%s\n" "$0: the shells that I found on your system."
+  if test ${ZSH_VERSION+y} ; then
+    printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
   else
-    $as_echo "$0: Please tell bug-autoconf@gnu.org and bug-m4@gnu.org
+    printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and bug-m4@gnu.org
 $0: about your system, including any error possibly output
 $0: before this message. Then install a modern shell, or
 $0: manually run the script under such a shell if you do
@@ -294,6 +295,7 @@ as_fn_unset ()
 }
 as_unset=as_fn_unset
 
+
 # as_fn_set_status STATUS
 # -----------------------
 # Set $? to STATUS, without forking.
@@ -311,6 +313,14 @@ as_fn_exit ()
   as_fn_set_status $1
   exit $1
 } # as_fn_exit
+# as_fn_nop
+# ---------
+# Do nothing but, unlike ":", preserve the value of $?.
+as_fn_nop ()
+{
+  return $?
+}
+as_nop=as_fn_nop
 
 # as_fn_mkdir_p
 # -------------
@@ -325,7 +335,7 @@ as_fn_mkdir_p ()
     as_dirs=
     while :; do
       case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
       *) as_qdir=$as_dir;;
       esac
       as_dirs="'$as_qdir' $as_dirs"
@@ -334,7 +344,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$as_dir" : 'X\(//\)[^/]' \| \
         X"$as_dir" : 'X\(//\)$' \| \
         X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -373,12 +383,13 @@ as_fn_executable_p ()
 # advantage of any shell optimizations that allow amortized linear growth over
 # repeated appends, instead of the typical quadratic growth present in naive
 # implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
   eval 'as_fn_append ()
   {
     eval $1+=\$2
   }'
-else
+else $as_nop
   as_fn_append ()
   {
     eval $1=\$$1\$2
@@ -390,18 +401,27 @@ fi # as_fn_append
 # Perform arithmetic evaluation on the ARGs, and store the result in the
 # global $as_val. Take advantage of shells that can avoid forks. The arguments
 # must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
   eval 'as_fn_arith ()
   {
     as_val=$(( $* ))
   }'
-else
+else $as_nop
   as_fn_arith ()
   {
     as_val=`expr "$@" || test $? -eq 1`
   }
 fi # as_fn_arith
 
+# as_fn_nop
+# ---------
+# Do nothing but, unlike ":", preserve the value of $?.
+as_fn_nop ()
+{
+  return $?
+}
+as_nop=as_fn_nop
 
 # as_fn_error STATUS ERROR [LINENO LOG_FD]
 # ----------------------------------------
@@ -413,9 +433,9 @@ as_fn_error ()
   as_status=$1; test $as_status -eq 0 && as_status=1
   if test "$4"; then
     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-  $as_echo "$as_me: error: $2" >&2
+  printf "%s\n" "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
@@ -442,7 +462,7 @@ as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
         X"$0" : 'X\(//\)$' \| \
         X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
            s//\1/
            q
@@ -486,7 +506,7 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
       s/-\n.*//
     ' >$as_me.lineno &&
   chmod +x "$as_me.lineno" ||
-    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+    { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
 
   # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
   # already done that, so ensure we don't try to do so again and fall
@@ -500,6 +520,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
   exit
 }
 
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
 ECHO_C= ECHO_N= ECHO_T=
 case `echo -n x` in #(((((
 -n*)
@@ -513,6 +537,13 @@ case `echo -n x` in #(((((
   ECHO_N='-n';;
 esac
 
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n.  New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
+
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
   rm -f conf$$.dir/conf$$.file
@@ -580,53 +611,49 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='GNU M4'
 PACKAGE_TARNAME='m4'
-PACKAGE_VERSION='1.4.18'
-PACKAGE_STRING='GNU M4 1.4.18'
+PACKAGE_VERSION='1.4.19'
+PACKAGE_STRING='GNU M4 1.4.19'
 PACKAGE_BUGREPORT='bug-m4@gnu.org'
-PACKAGE_URL='http://www.gnu.org/software/m4/'
+PACKAGE_URL='https://www.gnu.org/software/m4/'
 
 ac_unique_file="src/m4.h"
 # Factoring default headers for most tests.
 ac_includes_default="\
-#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
+#include <stddef.h>
+#ifdef HAVE_STDIO_H
+# include <stdio.h>
 #endif
-#ifdef STDC_HEADERS
+#ifdef HAVE_STDLIB_H
 # include <stdlib.h>
-# include <stddef.h>
-#else
-# ifdef HAVE_STDLIB_H
-#  include <stdlib.h>
-# endif
 #endif
 #ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
-#  include <memory.h>
-# endif
 # include <string.h>
 #endif
-#ifdef HAVE_STRINGS_H
-# include <strings.h>
-#endif
 #ifdef HAVE_INTTYPES_H
 # include <inttypes.h>
 #endif
 #ifdef HAVE_STDINT_H
 # include <stdint.h>
 #endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
 #ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif"
 
+ac_header_c_list=
 gl_use_threads_default=
-ac_func_list=
-ac_header_list=
-gl_getopt_required=POSIX
+gl_use_winpthreads_default=
+ac_func_c_list=
 gl_getopt_required=POSIX
+gt_needs=
 ac_subst_vars='M4tests_LTLIBOBJS
 M4tests_LIBOBJS
 M4_LTLIBOBJS
@@ -636,96 +663,245 @@ am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
+POSUB
+INTLLIBS
+XGETTEXT_EXTRA_OPTIONS
+MSGMERGE
+XGETTEXT_015
+XGETTEXT
+GMSGFMT_015
+MSGFMT_015
+GMSGFMT
+MSGFMT
+GETTEXT_MACRO_VERSION
+USE_NLS
 OS2_LDFLAGS
 LIBTESTS_LIBDEPS
 LIBM4_LTLIBDEPS
 LIBM4_LIBDEPS
+YIELD_LIB
 abs_aux_dir
-GL_GENERATE_STDALIGN_H_FALSE
-GL_GENERATE_STDALIGN_H_TRUE
-STDALIGN_H
-POSIX_SPAWN_PORTED_FALSE
-POSIX_SPAWN_PORTED_TRUE
-INTL_MACOSX_LIBS
-NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
-NEXT_INTTYPES_H
-UINT64_MAX_EQ_ULONG_MAX
-UINT32_MAX_LT_UINTMAX_MAX
-PRIPTR_PREFIX
-PRI_MACROS_BROKEN
-INT64_MAX_EQ_LONG_MAX
-INT32_MAX_LT_INTMAX_MAX
-REPLACE_STRTOUMAX
-REPLACE_STRTOIMAX
-HAVE_DECL_STRTOUMAX
-HAVE_DECL_STRTOIMAX
-HAVE_DECL_IMAXDIV
-HAVE_DECL_IMAXABS
-GNULIB_STRTOUMAX
-GNULIB_STRTOIMAX
-GNULIB_IMAXDIV
-GNULIB_IMAXABS
-HAVE_DIRENT_H
-NEXT_AS_FIRST_DIRECTIVE_DIRENT_H
-NEXT_DIRENT_H
+HAVE_SYS_UIO_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H
+NEXT_SYS_UIO_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H
+NEXT_SYS_IOCTL_H
+HAVE_SYS_IOCTL_H
+GL_M4_GNULIB_SELECT
+GL_M4_GNULIB_PSELECT
+LIB_PTHREAD_SIGMASK
+GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK
+GL_M4_GNULIB_PTHREAD_SPIN
+GL_M4_GNULIB_PTHREAD_TSS
+GL_M4_GNULIB_PTHREAD_COND
+GL_M4_GNULIB_PTHREAD_RWLOCK
+GL_M4_GNULIB_PTHREAD_MUTEX
+GL_M4_GNULIB_PTHREAD_ONCE
+GL_M4_GNULIB_PTHREAD_THREAD
+LIB_PTHREAD
+HAVE_PTHREAD_H
+NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H
+NEXT_PTHREAD_H
+REPLACE_PTHREAD_SPIN_DESTROY
+REPLACE_PTHREAD_SPIN_UNLOCK
+REPLACE_PTHREAD_SPIN_TRYLOCK
+REPLACE_PTHREAD_SPIN_LOCK
+REPLACE_PTHREAD_SPIN_INIT
+REPLACE_PTHREAD_KEY_DELETE
+REPLACE_PTHREAD_GETSPECIFIC
+REPLACE_PTHREAD_SETSPECIFIC
+REPLACE_PTHREAD_KEY_CREATE
+REPLACE_PTHREAD_COND_DESTROY
+REPLACE_PTHREAD_COND_BROADCAST
+REPLACE_PTHREAD_COND_SIGNAL
+REPLACE_PTHREAD_COND_TIMEDWAIT
+REPLACE_PTHREAD_COND_WAIT
+REPLACE_PTHREAD_CONDATTR_DESTROY
+REPLACE_PTHREAD_CONDATTR_INIT
+REPLACE_PTHREAD_COND_INIT
+REPLACE_PTHREAD_RWLOCK_DESTROY
+REPLACE_PTHREAD_RWLOCK_UNLOCK
+REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK
+REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK
+REPLACE_PTHREAD_RWLOCK_TRYWRLOCK
+REPLACE_PTHREAD_RWLOCK_TRYRDLOCK
+REPLACE_PTHREAD_RWLOCK_WRLOCK
+REPLACE_PTHREAD_RWLOCK_RDLOCK
+REPLACE_PTHREAD_RWLOCKATTR_DESTROY
+REPLACE_PTHREAD_RWLOCKATTR_INIT
+REPLACE_PTHREAD_RWLOCK_INIT
+REPLACE_PTHREAD_MUTEX_DESTROY
+REPLACE_PTHREAD_MUTEX_UNLOCK
+REPLACE_PTHREAD_MUTEX_TIMEDLOCK
+REPLACE_PTHREAD_MUTEX_TRYLOCK
+REPLACE_PTHREAD_MUTEX_LOCK
+REPLACE_PTHREAD_MUTEXATTR_DESTROY
+REPLACE_PTHREAD_MUTEXATTR_SETROBUST
+REPLACE_PTHREAD_MUTEXATTR_GETROBUST
+REPLACE_PTHREAD_MUTEXATTR_SETTYPE
+REPLACE_PTHREAD_MUTEXATTR_GETTYPE
+REPLACE_PTHREAD_MUTEXATTR_INIT
+REPLACE_PTHREAD_MUTEX_INIT
+REPLACE_PTHREAD_ONCE
+REPLACE_PTHREAD_EXIT
+REPLACE_PTHREAD_JOIN
+REPLACE_PTHREAD_DETACH
+REPLACE_PTHREAD_EQUAL
+REPLACE_PTHREAD_SELF
+REPLACE_PTHREAD_ATTR_DESTROY
+REPLACE_PTHREAD_ATTR_SETDETACHSTATE
+REPLACE_PTHREAD_ATTR_GETDETACHSTATE
+REPLACE_PTHREAD_ATTR_INIT
+REPLACE_PTHREAD_CREATE
+HAVE_PTHREAD_SPIN_DESTROY
+HAVE_PTHREAD_SPIN_UNLOCK
+HAVE_PTHREAD_SPIN_TRYLOCK
+HAVE_PTHREAD_SPIN_LOCK
+HAVE_PTHREAD_SPIN_INIT
+HAVE_PTHREAD_KEY_DELETE
+HAVE_PTHREAD_GETSPECIFIC
+HAVE_PTHREAD_SETSPECIFIC
+HAVE_PTHREAD_KEY_CREATE
+HAVE_PTHREAD_COND_DESTROY
+HAVE_PTHREAD_COND_BROADCAST
+HAVE_PTHREAD_COND_SIGNAL
+HAVE_PTHREAD_COND_TIMEDWAIT
+HAVE_PTHREAD_COND_WAIT
+HAVE_PTHREAD_CONDATTR_DESTROY
+HAVE_PTHREAD_CONDATTR_INIT
+HAVE_PTHREAD_COND_INIT
+HAVE_PTHREAD_RWLOCK_DESTROY
+HAVE_PTHREAD_RWLOCK_UNLOCK
+HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK
+HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK
+HAVE_PTHREAD_RWLOCK_TRYWRLOCK
+HAVE_PTHREAD_RWLOCK_TRYRDLOCK
+HAVE_PTHREAD_RWLOCK_WRLOCK
+HAVE_PTHREAD_RWLOCK_RDLOCK
+HAVE_PTHREAD_RWLOCKATTR_DESTROY
+HAVE_PTHREAD_RWLOCKATTR_INIT
+HAVE_PTHREAD_RWLOCK_INIT
+HAVE_PTHREAD_MUTEX_DESTROY
+HAVE_PTHREAD_MUTEX_UNLOCK
+HAVE_PTHREAD_MUTEX_TIMEDLOCK
+HAVE_PTHREAD_MUTEX_TRYLOCK
+HAVE_PTHREAD_MUTEX_LOCK
+HAVE_PTHREAD_MUTEXATTR_DESTROY
+HAVE_PTHREAD_MUTEXATTR_SETROBUST
+HAVE_PTHREAD_MUTEXATTR_GETROBUST
+HAVE_PTHREAD_MUTEXATTR_SETTYPE
+HAVE_PTHREAD_MUTEXATTR_GETTYPE
+HAVE_PTHREAD_MUTEXATTR_INIT
+HAVE_PTHREAD_MUTEX_INIT
+HAVE_PTHREAD_ONCE
+HAVE_PTHREAD_EXIT
+HAVE_PTHREAD_JOIN
+HAVE_PTHREAD_DETACH
+HAVE_PTHREAD_EQUAL
+HAVE_PTHREAD_SELF
+HAVE_PTHREAD_ATTR_DESTROY
+HAVE_PTHREAD_ATTR_SETDETACHSTATE
+HAVE_PTHREAD_ATTR_GETDETACHSTATE
+HAVE_PTHREAD_ATTR_INIT
+HAVE_PTHREAD_CREATE
+HAVE_PTHREAD_PROCESS_SHARED
+HAVE_PTHREAD_MUTEX_ROBUST
+HAVE_PTHREAD_MUTEX_RECURSIVE
+HAVE_PTHREAD_CREATE_DETACHED
+HAVE_PTHREAD_SPINLOCK_T
+HAVE_PTHREAD_T
+GL_GENERATE_NETINET_IN_H_FALSE
+GL_GENERATE_NETINET_IN_H_TRUE
+NETINET_IN_H
+HAVE_NETINET_IN_H
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H
+NEXT_NETINET_IN_H
+LIB_NANOSLEEP
+LIB_SELECT
+LIBSOCKET
+HAVE_SYS_SELECT_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H
+NEXT_SYS_SELECT_H
+REPLACE_SELECT
+REPLACE_PSELECT
+HAVE_PSELECT
+GL_M4_GNULIB_IOCTL
+INET_PTON_LIB
+GL_M4_GNULIB_GETTIMEOFDAY
+NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
+NEXT_SYS_TIME_H
+REPLACE_STRUCT_TIMEVAL
+REPLACE_GETTIMEOFDAY
+HAVE_SYS_TIME_H
+HAVE_STRUCT_TIMEVAL
+HAVE_GETTIMEOFDAY
+GL_M4_GNULIB_ISBLANK
 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H
 NEXT_CTYPE_H
 HAVE_ISBLANK
-GNULIB_ISBLANK
-REPLACE_FDOPENDIR
-REPLACE_DIRFD
-REPLACE_CLOSEDIR
-REPLACE_OPENDIR
-HAVE_ALPHASORT
-HAVE_SCANDIR
-HAVE_FDOPENDIR
-HAVE_DECL_FDOPENDIR
-HAVE_DECL_DIRFD
-HAVE_CLOSEDIR
-HAVE_REWINDDIR
-HAVE_READDIR
-HAVE_OPENDIR
-GNULIB_ALPHASORT
-GNULIB_SCANDIR
-GNULIB_FDOPENDIR
-GNULIB_DIRFD
-GNULIB_CLOSEDIR
-GNULIB_REWINDDIR
-GNULIB_READDIR
-GNULIB_OPENDIR
 LOCALE_TR_UTF8
-am__fastdepCXX_FALSE
-am__fastdepCXX_TRUE
-CXXDEPMODE
-ANSICXX_FALSE
-ANSICXX_TRUE
-CXXFLAGS
-ac_ct_CXX
-CXX
-CXX_CHOICE
+LIB_SEMAPHORE
+GL_M4_GNULIB_INET_PTON
+GL_M4_GNULIB_INET_NTOP
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H
+NEXT_ARPA_INET_H
+HAVE_ARPA_INET_H
+REPLACE_INET_PTON
+REPLACE_INET_NTOP
+HAVE_DECL_INET_PTON
+HAVE_DECL_INET_NTOP
+GL_M4_GNULIB_ACCEPT4
+GL_M4_GNULIB_SHUTDOWN
+GL_M4_GNULIB_SETSOCKOPT
+GL_M4_GNULIB_SENDTO
+GL_M4_GNULIB_RECVFROM
+GL_M4_GNULIB_SEND
+GL_M4_GNULIB_RECV
+GL_M4_GNULIB_LISTEN
+GL_M4_GNULIB_GETSOCKOPT
+GL_M4_GNULIB_GETSOCKNAME
+GL_M4_GNULIB_GETPEERNAME
+GL_M4_GNULIB_BIND
+GL_M4_GNULIB_ACCEPT
+GL_M4_GNULIB_CONNECT
+GL_M4_GNULIB_SOCKET
+HAVE_WS2TCPIP_H
+HAVE_SYS_SOCKET_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H
+NEXT_SYS_SOCKET_H
+HAVE_ACCEPT4
+HAVE_SA_FAMILY_T
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+HAVE_STRUCT_SOCKADDR_STORAGE
 M4tests_WITNESS
-REPLACE_TOWLOWER
-REPLACE_ISWCNTRL
-HAVE_WCTYPE_H
-NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
-NEXT_WCTYPE_H
-HAVE_ISWCNTRL
-REPLACE_ISWBLANK
-HAVE_WCTRANS_T
-HAVE_WCTYPE_T
-HAVE_ISWBLANK
-GNULIB_TOWCTRANS
-GNULIB_WCTRANS
-GNULIB_ISWCTYPE
-GNULIB_WCTYPE
-GNULIB_ISWBLANK
-HAVE_WINT_T
 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
+LIBUNISTRING_UNITYPES_H
+LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE
+LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE
+LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE
+LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE
+LIBUNISTRING_UNISTR_H
 HAVE_UNISTD_H
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H
 NEXT_UNISTD_H
+GL_M4_GNULIB_MDA_TZSET
+GL_M4_GNULIB_TZSET
+GL_M4_GNULIB_TIME_RZ
+GL_M4_GNULIB_TIME_R
+GL_M4_GNULIB_TIMESPEC_GET
+GL_M4_GNULIB_TIMEGM
+GL_M4_GNULIB_STRPTIME
+GL_M4_GNULIB_STRFTIME
+GL_M4_GNULIB_NANOSLEEP
+GL_M4_GNULIB_LOCALTIME
+GL_M4_GNULIB_MKTIME
+GL_M4_GNULIB_CTIME
+TIME_H_DEFINES_TIME_UTC
 UNISTD_H_DEFINES_STRUCT_TIMESPEC
 PTHREAD_H_DEFINES_STRUCT_TIMESPEC
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
@@ -734,57 +910,32 @@ NEXT_AS_FIRST_DIRECTIVE_TIME_H
 NEXT_TIME_H
 REPLACE_LOCALTIME
 REPLACE_GMTIME
+GNULIB_GETTIMEOFDAY
+REPLACE_TZSET
 REPLACE_TIMEGM
+REPLACE_STRFTIME
 REPLACE_NANOSLEEP
 REPLACE_MKTIME
 REPLACE_LOCALTIME_R
+REPLACE_CTIME
+HAVE_TIMEZONE_T
+HAVE_TIMESPEC_GET
 HAVE_TIMEGM
 HAVE_STRPTIME
 HAVE_NANOSLEEP
 HAVE_DECL_LOCALTIME_R
-GNULIB_TIME_RZ
-GNULIB_TIME_R
-GNULIB_TIMEGM
-GNULIB_STRPTIME
-GNULIB_NANOSLEEP
-GNULIB_MKTIME
+GL_M4_GNULIB_WAITPID
 NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H
 NEXT_SYS_WAIT_H
-GNULIB_WAITPID
+HAVE_SYS_RANDOM_H
+NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H
+NEXT_SYS_RANDOM_H
 NEXT_AS_FIRST_DIRECTIVE_STRING_H
 NEXT_STRING_H
 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H
 NEXT_STDLIB_H
 NEXT_AS_FIRST_DIRECTIVE_STDIO_H
 NEXT_STDIO_H
-GL_GENERATE_STDINT_H_FALSE
-GL_GENERATE_STDINT_H_TRUE
-STDINT_H
-HAVE_SYS_INTTYPES_H
-HAVE_SYS_BITYPES_H
-HAVE_C99_STDINT_H
-WINT_T_SUFFIX
-WCHAR_T_SUFFIX
-SIG_ATOMIC_T_SUFFIX
-SIZE_T_SUFFIX
-PTRDIFF_T_SUFFIX
-HAVE_SIGNED_WINT_T
-HAVE_SIGNED_WCHAR_T
-HAVE_SIGNED_SIG_ATOMIC_T
-BITSIZEOF_WINT_T
-BITSIZEOF_WCHAR_T
-BITSIZEOF_SIG_ATOMIC_T
-BITSIZEOF_SIZE_T
-BITSIZEOF_PTRDIFF_T
-HAVE_STDINT_H
-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
-GNULIB_OVERRIDES_WINT_T
 HAVE__BOOL
 GL_GENERATE_STDBOOL_H_FALSE
 GL_GENERATE_STDBOOL_H_TRUE
@@ -794,20 +945,35 @@ GL_GENERATE_STDARG_H_TRUE
 STDARG_H
 NEXT_AS_FIRST_DIRECTIVE_STDARG_H
 NEXT_STDARG_H
+GL_GENERATE_STDALIGN_H_FALSE
+GL_GENERATE_STDALIGN_H_TRUE
+STDALIGN_H
 HAVE_SPAWN_H
 NEXT_AS_FIRST_DIRECTIVE_SPAWN_H
 NEXT_SPAWN_H
+GL_GENERATE_SIGSEGV_H_FALSE
+GL_GENERATE_SIGSEGV_H_TRUE
+SIGSEGV_H
+LIBSIGSEGV_PREFIX
+LTLIBSIGSEGV
+LIBSIGSEGV
+HAVE_LIBSIGSEGV
 ASM_SYMBOL_PREFIX
 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H
 NEXT_SIGNAL_H
-GL_GENERATE_SCHED_H_FALSE
-GL_GENERATE_SCHED_H_TRUE
-SCHED_H
-HAVE_SYS_CDEFS_H
+LIB_SETLOCALE
+GL_M4_GNULIB_SCHED_YIELD
 HAVE_STRUCT_SCHED_PARAM
 HAVE_SCHED_H
 NEXT_AS_FIRST_DIRECTIVE_SCHED_H
 NEXT_SCHED_H
+REPLACE_SCHED_YIELD
+HAVE_SCHED_YIELD
+GL_M4_GNULIB_SIGACTION
+GL_M4_GNULIB_SIGPROCMASK
+GL_M4_GNULIB_SIGNAL_H_SIGPIPE
+GL_M4_GNULIB_RAISE
+GL_M4_GNULIB_PTHREAD_SIGMASK
 REPLACE_RAISE
 REPLACE_PTHREAD_SIGMASK
 HAVE_SIGHANDLER_T
@@ -819,58 +985,107 @@ HAVE_SIGSET_T
 HAVE_RAISE
 HAVE_PTHREAD_SIGMASK
 HAVE_POSIX_SIGNALBLOCKING
-GNULIB_SIGACTION
-GNULIB_SIGPROCMASK
-GNULIB_SIGNAL_H_SIGPIPE
-GNULIB_RAISE
-GNULIB_PTHREAD_SIGMASK
+GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS
+GL_M4_GNULIB_POSIX_SPAWNATTR_INIT
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT
+GL_M4_GNULIB_POSIX_SPAWNP
+GL_M4_GNULIB_POSIX_SPAWN
 LIB_POSIX_SPAWN
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
 REPLACE_POSIX_SPAWN
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
 HAVE_POSIX_SPAWN_FILE_ACTIONS_T
 HAVE_POSIX_SPAWNATTR_T
 HAVE_POSIX_SPAWN
-GNULIB_POSIX_SPAWNATTR_DESTROY
-GNULIB_POSIX_SPAWNATTR_SETSIGMASK
-GNULIB_POSIX_SPAWNATTR_GETSIGMASK
-GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT
-GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM
-GNULIB_POSIX_SPAWNATTR_SETPGROUP
-GNULIB_POSIX_SPAWNATTR_GETPGROUP
-GNULIB_POSIX_SPAWNATTR_SETFLAGS
-GNULIB_POSIX_SPAWNATTR_GETFLAGS
-GNULIB_POSIX_SPAWNATTR_INIT
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT
-GNULIB_POSIX_SPAWNP
-GNULIB_POSIX_SPAWN
-APPLE_UNIVERSAL_BUILD
+LIB_NL_LANGINFO
+GL_M4_GNULIB_MDA_STRDUP
+GL_M4_GNULIB_MDA_MEMCCPY
+GL_M4_GNULIB_STRVERSCMP
+GL_M4_GNULIB_STRSIGNAL
+GL_M4_GNULIB_SIGDESCR_NP
+GL_M4_GNULIB_SIGABBREV_NP
+GL_M4_GNULIB_STRERRORNAME_NP
+GL_M4_GNULIB_STRERROR_R
+GL_M4_GNULIB_STRERROR
+GL_M4_GNULIB_MBSTOK_R
+GL_M4_GNULIB_MBSSEP
+GL_M4_GNULIB_MBSSPN
+GL_M4_GNULIB_MBSPBRK
+GL_M4_GNULIB_MBSCSPN
+GL_M4_GNULIB_MBSCASESTR
+GL_M4_GNULIB_MBSPCASECMP
+GL_M4_GNULIB_MBSNCASECMP
+GL_M4_GNULIB_MBSCASECMP
+GL_M4_GNULIB_MBSSTR
+GL_M4_GNULIB_MBSRCHR
+GL_M4_GNULIB_MBSCHR
+GL_M4_GNULIB_MBSNLEN
+GL_M4_GNULIB_MBSLEN
+GL_M4_GNULIB_STRTOK_R
+GL_M4_GNULIB_STRCASESTR
+GL_M4_GNULIB_STRSTR
+GL_M4_GNULIB_STRSEP
+GL_M4_GNULIB_STRPBRK
+GL_M4_GNULIB_STRNLEN
+GL_M4_GNULIB_STRNDUP
+GL_M4_GNULIB_STRNCAT
+GL_M4_GNULIB_STRDUP
+GL_M4_GNULIB_STRCHRNUL
+GL_M4_GNULIB_STPNCPY
+GL_M4_GNULIB_STPCPY
+GL_M4_GNULIB_RAWMEMCHR
+GL_M4_GNULIB_MEMRCHR
+GL_M4_GNULIB_MEMPCPY
+GL_M4_GNULIB_MEMMEM
+GL_M4_GNULIB_MEMCHR
+GL_M4_GNULIB_FFSLL
+GL_M4_GNULIB_FFSL
+GL_M4_GNULIB_EXPLICIT_BZERO
 UNDEFINE_STRTOK_R
-REPLACE_STRTOK_R
 REPLACE_STRSIGNAL
-REPLACE_STRNLEN
-REPLACE_STRNDUP
-REPLACE_STRNCAT
+REPLACE_STRERRORNAME_NP
 REPLACE_STRERROR_R
 REPLACE_STRERROR
-REPLACE_STRCHRNUL
+REPLACE_STRTOK_R
 REPLACE_STRCASESTR
 REPLACE_STRSTR
+REPLACE_STRNLEN
+REPLACE_STRNDUP
+REPLACE_STRNCAT
 REPLACE_STRDUP
+REPLACE_STRCHRNUL
 REPLACE_STPNCPY
 REPLACE_MEMMEM
 REPLACE_MEMCHR
+REPLACE_FFSLL
 HAVE_STRVERSCMP
 HAVE_DECL_STRSIGNAL
+HAVE_SIGDESCR_NP
+HAVE_SIGABBREV_NP
+HAVE_STRERRORNAME_NP
 HAVE_DECL_STRERROR_R
 HAVE_DECL_STRTOK_R
 HAVE_STRCASESTR
@@ -886,50 +1101,13 @@ HAVE_RAWMEMCHR
 HAVE_DECL_MEMRCHR
 HAVE_MEMPCPY
 HAVE_DECL_MEMMEM
-HAVE_MEMCHR
 HAVE_FFSLL
 HAVE_FFSL
+HAVE_EXPLICIT_BZERO
 HAVE_MBSLEN
-GNULIB_STRVERSCMP
-GNULIB_STRSIGNAL
-GNULIB_STRERROR_R
-GNULIB_STRERROR
-GNULIB_MBSTOK_R
-GNULIB_MBSSEP
-GNULIB_MBSSPN
-GNULIB_MBSPBRK
-GNULIB_MBSCSPN
-GNULIB_MBSCASESTR
-GNULIB_MBSPCASECMP
-GNULIB_MBSNCASECMP
-GNULIB_MBSCASECMP
-GNULIB_MBSSTR
-GNULIB_MBSRCHR
-GNULIB_MBSCHR
-GNULIB_MBSNLEN
-GNULIB_MBSLEN
-GNULIB_STRTOK_R
-GNULIB_STRCASESTR
-GNULIB_STRSTR
-GNULIB_STRSEP
-GNULIB_STRPBRK
-GNULIB_STRNLEN
-GNULIB_STRNDUP
-GNULIB_STRNCAT
-GNULIB_STRDUP
-GNULIB_STRCHRNUL
-GNULIB_STPNCPY
-GNULIB_STPCPY
-GNULIB_RAWMEMCHR
-GNULIB_MEMRCHR
-GNULIB_MEMPCPY
-GNULIB_MEMMEM
-GNULIB_MEMCHR
-GNULIB_FFSLL
-GNULIB_FFSL
-LOCALE_FR_UTF8
-LOCALE_ZH_CN
-LOCALE_JA
+HAVE_VISIBILITY
+CFLAG_VISIBILITY
+LIB_MBRTOWC
 NEXT_AS_FIRST_DIRECTIVE_MATH_H
 NEXT_MATH_H
 SED
@@ -937,9 +1115,13 @@ LTLIBMULTITHREAD
 LIBMULTITHREAD
 LTLIBTHREAD
 LIBTHREAD
-LIBPTH_PREFIX
-LTLIBPTH
-LIBPTH
+LIBSTDTHREAD
+INTL_MACOSX_LIBS
+GL_M4_GNULIB_LOCALENAME
+GL_M4_GNULIB_DUPLOCALE
+GL_M4_GNULIB_SETLOCALE_NULL
+GL_M4_GNULIB_SETLOCALE
+GL_M4_GNULIB_LOCALECONV
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H
 NEXT_LOCALE_H
 HAVE_XLOCALE_H
@@ -951,23 +1133,21 @@ STDDEF_H
 HAVE_WCHAR_T
 HAVE_MAX_ALIGN_T
 REPLACE_NULL
+LOCALENAME_ENHANCE_LOCALE_FUNCS
 REPLACE_STRUCT_LCONV
+REPLACE_FREELOCALE
 REPLACE_DUPLOCALE
+REPLACE_NEWLOCALE
 REPLACE_SETLOCALE
 REPLACE_LOCALECONV
+HAVE_FREELOCALE
 HAVE_DUPLOCALE
-GNULIB_DUPLOCALE
-GNULIB_SETLOCALE
-GNULIB_LOCALECONV
+HAVE_NEWLOCALE
 LOCALCHARSET_TESTS_ENVIRONMENT
-GLIBC21
-GL_GENERATE_LIMITS_H_FALSE
-GL_GENERATE_LIMITS_H_TRUE
-LIMITS_H
-NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
-NEXT_LIMITS_H
+GL_M4_GNULIB_NL_LANGINFO
 HAVE_LANGINFO_YESEXPR
 HAVE_LANGINFO_ERA
+HAVE_LANGINFO_ALTMON
 HAVE_LANGINFO_T_FMT_AMPM
 HAVE_LANGINFO_CODESET
 HAVE_LANGINFO_H
@@ -975,35 +1155,147 @@ NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H
 NEXT_LANGINFO_H
 REPLACE_NL_LANGINFO
 HAVE_NL_LANGINFO
-GNULIB_NL_LANGINFO
-NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H
-NEXT_SYS_TIME_H
-REPLACE_STRUCT_TIMEVAL
-REPLACE_GETTIMEOFDAY
-HAVE_TIMEZONE_T
-HAVE_SYS_TIME_H
-HAVE_STRUCT_TIMEVAL
-HAVE_GETTIMEOFDAY
-GNULIB_GETTIMEOFDAY
+LOCALE_ZH_CN
+LOCALE_FR_UTF8
+LOCALE_JA
+GL_M4_GNULIB_TOWCTRANS
+GL_M4_GNULIB_WCTRANS
+GL_M4_GNULIB_ISWCTYPE
+GL_M4_GNULIB_WCTYPE
+GL_M4_GNULIB_ISWXDIGIT
+GL_M4_GNULIB_ISWDIGIT
+GL_M4_GNULIB_ISWBLANK
+REPLACE_TOWLOWER
+REPLACE_ISWCNTRL
+HAVE_WCTYPE_H
+NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H
+NEXT_WCTYPE_H
+HAVE_CRTDEFS_H
+HAVE_WINT_T
+HAVE_ISWCNTRL
+REPLACE_ISWXDIGIT
+REPLACE_ISWDIGIT
+REPLACE_ISWBLANK
+HAVE_WCTRANS_T
+HAVE_WCTYPE_T
+HAVE_ISWBLANK
+GL_M4_GNULIB_STRTOUMAX
+GL_M4_GNULIB_STRTOIMAX
+GL_M4_GNULIB_IMAXDIV
+GL_M4_GNULIB_IMAXABS
+NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H
+NEXT_INTTYPES_H
+UINT64_MAX_EQ_ULONG_MAX
+UINT32_MAX_LT_UINTMAX_MAX
+PRIPTR_PREFIX
+INT64_MAX_EQ_LONG_MAX
+INT32_MAX_LT_INTMAX_MAX
+REPLACE_STRTOUMAX
+REPLACE_STRTOIMAX
+HAVE_IMAXDIV_T
+HAVE_DECL_STRTOUMAX
+HAVE_DECL_STRTOIMAX
+HAVE_DECL_IMAXDIV
+HAVE_DECL_IMAXABS
+GL_GENERATE_STDINT_H_FALSE
+GL_GENERATE_STDINT_H_TRUE
+STDINT_H
+HAVE_SYS_INTTYPES_H
+HAVE_SYS_BITYPES_H
+HAVE_C99_STDINT_H
+WINT_T_SUFFIX
+WCHAR_T_SUFFIX
+SIG_ATOMIC_T_SUFFIX
+SIZE_T_SUFFIX
+PTRDIFF_T_SUFFIX
+HAVE_SIGNED_WINT_T
+HAVE_SIGNED_WCHAR_T
+HAVE_SIGNED_SIG_ATOMIC_T
+BITSIZEOF_WINT_T
+BITSIZEOF_WCHAR_T
+BITSIZEOF_SIG_ATOMIC_T
+BITSIZEOF_SIZE_T
+BITSIZEOF_PTRDIFF_T
+APPLE_UNIVERSAL_BUILD
+HAVE_STDINT_H
+NEXT_AS_FIRST_DIRECTIVE_STDINT_H
+NEXT_STDINT_H
+HAVE_SYS_TYPES_H
+HAVE_INTTYPES_H
+HAVE_WCHAR_H
+GNULIBHEADERS_OVERRIDE_WINT_T
+GL_GENERATE_LIMITS_H_FALSE
+GL_GENERATE_LIMITS_H_TRUE
+LIMITS_H
+NEXT_AS_FIRST_DIRECTIVE_LIMITS_H
+NEXT_LIMITS_H
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H
+NEXT_ICONV_H
+GL_M4_GNULIB_ICONV
+GL_GENERATE_ICONV_H_FALSE
+GL_GENERATE_ICONV_H_TRUE
+ICONV_H
+REPLACE_ICONV_UTF
+REPLACE_ICONV_OPEN
+REPLACE_ICONV
+ICONV_CONST
+LTLIBICONV
+LIBICONV
+HOST_CPU_C_ABI
+HOST_CPU
+LIB_HARD_LOCALE
+LIB_SETLOCALE_NULL
+LIB_SCHED_YIELD
+LIBPMULTITHREAD
+LIBPTHREAD
 LTLIBINTL
 LIBINTL
+GL_M4_GNULIB_GETRANDOM
+LIB_GETRANDOM
+REPLACE_GETRANDOM
+HAVE_GETRANDOM
 GNULIB_GL_M4_UNISTD_H_GETOPT
+GETOPT_CDEFS_H
 GETOPT_H
+HAVE_SYS_CDEFS_H
 HAVE_GETOPT_H
 NEXT_AS_FIRST_DIRECTIVE_GETOPT_H
 NEXT_GETOPT_H
+GL_M4_GNULIB_MDA_UMASK
+GL_M4_GNULIB_MDA_MKDIR
+GL_M4_GNULIB_MDA_CHMOD
+GL_M4_GNULIB_OVERRIDES_STRUCT_STAT
+GL_M4_GNULIB_UTIMENSAT
+GL_M4_GNULIB_STAT
+GL_M4_GNULIB_MKNODAT
+GL_M4_GNULIB_MKNOD
+GL_M4_GNULIB_MKFIFOAT
+GL_M4_GNULIB_MKFIFO
+GL_M4_GNULIB_MKDIRAT
+GL_M4_GNULIB_MKDIR
+GL_M4_GNULIB_LSTAT
+GL_M4_GNULIB_LCHMOD
+GL_M4_GNULIB_GETUMASK
+GL_M4_GNULIB_FUTIMENS
+GL_M4_GNULIB_FSTATAT
+GL_M4_GNULIB_FSTAT
+GL_M4_GNULIB_FCHMODAT
 WINDOWS_64_BIT_ST_SIZE
+WINDOWS_STAT_TIMESPEC
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H
 NEXT_SYS_STAT_H
 REPLACE_UTIMENSAT
 REPLACE_STAT
+REPLACE_MKNODAT
 REPLACE_MKNOD
+REPLACE_MKFIFOAT
 REPLACE_MKFIFO
 REPLACE_MKDIR
 REPLACE_LSTAT
 REPLACE_FUTIMENS
 REPLACE_FSTATAT
 REPLACE_FSTAT
+REPLACE_FCHMODAT
 HAVE_UTIMENSAT
 HAVE_MKNODAT
 HAVE_MKNOD
@@ -1012,26 +1304,116 @@ HAVE_MKFIFO
 HAVE_MKDIRAT
 HAVE_LSTAT
 HAVE_LCHMOD
+HAVE_GETUMASK
 HAVE_FUTIMENS
 HAVE_FSTATAT
 HAVE_FCHMODAT
-GNULIB_UTIMENSAT
-GNULIB_STAT
-GNULIB_MKNODAT
-GNULIB_MKNOD
-GNULIB_MKFIFOAT
-GNULIB_MKFIFO
-GNULIB_MKDIRAT
-GNULIB_LSTAT
-GNULIB_LCHMOD
-GNULIB_FUTIMENS
-GNULIB_FSTATAT
-GNULIB_FSTAT
-GNULIB_FCHMODAT
+WINDOWS_STAT_INODES
 WINDOWS_64_BIT_OFF_T
 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H
 NEXT_SYS_TYPES_H
 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+GL_M4_GNULIB_MDA_YN
+GL_M4_GNULIB_MDA_Y1
+GL_M4_GNULIB_MDA_Y0
+GL_M4_GNULIB_MDA_JN
+GL_M4_GNULIB_MDA_J1
+GL_M4_GNULIB_MDA_J0
+GL_M4_GNULIB_TRUNCL
+GL_M4_GNULIB_TRUNCF
+GL_M4_GNULIB_TRUNC
+GL_M4_GNULIB_TANHF
+GL_M4_GNULIB_TANL
+GL_M4_GNULIB_TANF
+GL_M4_GNULIB_SQRTL
+GL_M4_GNULIB_SQRTF
+GL_M4_GNULIB_SINHF
+GL_M4_GNULIB_SINL
+GL_M4_GNULIB_SINF
+GL_M4_GNULIB_SIGNBIT
+GL_M4_GNULIB_ROUNDL
+GL_M4_GNULIB_ROUNDF
+GL_M4_GNULIB_ROUND
+GL_M4_GNULIB_RINTL
+GL_M4_GNULIB_RINTF
+GL_M4_GNULIB_RINT
+GL_M4_GNULIB_REMAINDERL
+GL_M4_GNULIB_REMAINDERF
+GL_M4_GNULIB_REMAINDER
+GL_M4_GNULIB_POWF
+GL_M4_GNULIB_MODFL
+GL_M4_GNULIB_MODFF
+GL_M4_GNULIB_MODF
+GL_M4_GNULIB_LOGBL
+GL_M4_GNULIB_LOGBF
+GL_M4_GNULIB_LOGB
+GL_M4_GNULIB_LOG2L
+GL_M4_GNULIB_LOG2F
+GL_M4_GNULIB_LOG2
+GL_M4_GNULIB_LOG1PL
+GL_M4_GNULIB_LOG1PF
+GL_M4_GNULIB_LOG1P
+GL_M4_GNULIB_LOG10L
+GL_M4_GNULIB_LOG10F
+GL_M4_GNULIB_LOG10
+GL_M4_GNULIB_LOGL
+GL_M4_GNULIB_LOGF
+GL_M4_GNULIB_LOG
+GL_M4_GNULIB_LDEXPL
+GL_M4_GNULIB_LDEXPF
+GL_M4_GNULIB_ISNANL
+GL_M4_GNULIB_ISNAND
+GL_M4_GNULIB_ISNANF
+GL_M4_GNULIB_ISNAN
+GL_M4_GNULIB_ISINF
+GL_M4_GNULIB_ISFINITE
+GL_M4_GNULIB_ILOGBL
+GL_M4_GNULIB_ILOGBF
+GL_M4_GNULIB_ILOGB
+GL_M4_GNULIB_HYPOTL
+GL_M4_GNULIB_HYPOTF
+GL_M4_GNULIB_HYPOT
+GL_M4_GNULIB_FREXPL
+GL_M4_GNULIB_FREXP
+GL_M4_GNULIB_FREXPF
+GL_M4_GNULIB_FMODL
+GL_M4_GNULIB_FMODF
+GL_M4_GNULIB_FMOD
+GL_M4_GNULIB_FMAL
+GL_M4_GNULIB_FMAF
+GL_M4_GNULIB_FMA
+GL_M4_GNULIB_FLOORL
+GL_M4_GNULIB_FLOORF
+GL_M4_GNULIB_FLOOR
+GL_M4_GNULIB_FABSL
+GL_M4_GNULIB_FABSF
+GL_M4_GNULIB_EXPM1L
+GL_M4_GNULIB_EXPM1F
+GL_M4_GNULIB_EXPM1
+GL_M4_GNULIB_EXP2L
+GL_M4_GNULIB_EXP2F
+GL_M4_GNULIB_EXP2
+GL_M4_GNULIB_EXPL
+GL_M4_GNULIB_EXPF
+GL_M4_GNULIB_COSHF
+GL_M4_GNULIB_COSL
+GL_M4_GNULIB_COSF
+GL_M4_GNULIB_COPYSIGNL
+GL_M4_GNULIB_COPYSIGNF
+GL_M4_GNULIB_COPYSIGN
+GL_M4_GNULIB_CEILL
+GL_M4_GNULIB_CEILF
+GL_M4_GNULIB_CEIL
+GL_M4_GNULIB_CBRTL
+GL_M4_GNULIB_CBRTF
+GL_M4_GNULIB_CBRT
+GL_M4_GNULIB_ATAN2F
+GL_M4_GNULIB_ATANL
+GL_M4_GNULIB_ATANF
+GL_M4_GNULIB_ASINL
+GL_M4_GNULIB_ASINF
+GL_M4_GNULIB_ACOSL
+GL_M4_GNULIB_ACOSF
 REPLACE_TRUNCL
 REPLACE_TRUNCF
 REPLACE_TRUNC
@@ -1041,11 +1423,12 @@ REPLACE_SQRTL
 REPLACE_SQRTF
 REPLACE_SINHF
 REPLACE_SINF
-REPLACE_SIGNBIT_USING_GCC
+REPLACE_SIGNBIT_USING_BUILTINS
 REPLACE_SIGNBIT
 REPLACE_ROUNDL
 REPLACE_ROUNDF
 REPLACE_ROUND
+REPLACE_RINTL
 REPLACE_REMAINDERL
 REPLACE_REMAINDERF
 REPLACE_REMAINDER
@@ -1072,6 +1455,7 @@ REPLACE_LDEXPL
 REPLACE_ISNAN
 REPLACE_ISINF
 REPLACE_ISFINITE
+REPLACE_ILOGBL
 REPLACE_ILOGBF
 REPLACE_ILOGB
 REPLACE_HYPOTL
@@ -1093,8 +1477,10 @@ REPLACE_FLOOR
 REPLACE_FABSL
 REPLACE_EXP2L
 REPLACE_EXP2
+REPLACE_EXPM1L
 REPLACE_EXPM1F
 REPLACE_EXPM1
+REPLACE_EXPL
 REPLACE_EXPF
 REPLACE_COSHF
 REPLACE_COSF
@@ -1203,101 +1589,6 @@ HAVE_ASINL
 HAVE_ASINF
 HAVE_ACOSL
 HAVE_ACOSF
-GNULIB_TRUNCL
-GNULIB_TRUNCF
-GNULIB_TRUNC
-GNULIB_TANHF
-GNULIB_TANL
-GNULIB_TANF
-GNULIB_SQRTL
-GNULIB_SQRTF
-GNULIB_SINHF
-GNULIB_SINL
-GNULIB_SINF
-GNULIB_SIGNBIT
-GNULIB_ROUNDL
-GNULIB_ROUNDF
-GNULIB_ROUND
-GNULIB_RINTL
-GNULIB_RINTF
-GNULIB_RINT
-GNULIB_REMAINDERL
-GNULIB_REMAINDERF
-GNULIB_REMAINDER
-GNULIB_POWF
-GNULIB_MODFL
-GNULIB_MODFF
-GNULIB_MODF
-GNULIB_LOGBL
-GNULIB_LOGBF
-GNULIB_LOGB
-GNULIB_LOG2L
-GNULIB_LOG2F
-GNULIB_LOG2
-GNULIB_LOG1PL
-GNULIB_LOG1PF
-GNULIB_LOG1P
-GNULIB_LOG10L
-GNULIB_LOG10F
-GNULIB_LOG10
-GNULIB_LOGL
-GNULIB_LOGF
-GNULIB_LOG
-GNULIB_LDEXPL
-GNULIB_LDEXPF
-GNULIB_ISNANL
-GNULIB_ISNAND
-GNULIB_ISNANF
-GNULIB_ISNAN
-GNULIB_ISINF
-GNULIB_ISFINITE
-GNULIB_ILOGBL
-GNULIB_ILOGBF
-GNULIB_ILOGB
-GNULIB_HYPOTL
-GNULIB_HYPOTF
-GNULIB_HYPOT
-GNULIB_FREXPL
-GNULIB_FREXP
-GNULIB_FREXPF
-GNULIB_FMODL
-GNULIB_FMODF
-GNULIB_FMOD
-GNULIB_FMAL
-GNULIB_FMAF
-GNULIB_FMA
-GNULIB_FLOORL
-GNULIB_FLOORF
-GNULIB_FLOOR
-GNULIB_FABSL
-GNULIB_FABSF
-GNULIB_EXPM1L
-GNULIB_EXPM1F
-GNULIB_EXPM1
-GNULIB_EXP2L
-GNULIB_EXP2F
-GNULIB_EXP2
-GNULIB_EXPL
-GNULIB_EXPF
-GNULIB_COSHF
-GNULIB_COSL
-GNULIB_COSF
-GNULIB_COPYSIGNL
-GNULIB_COPYSIGNF
-GNULIB_COPYSIGN
-GNULIB_CEILL
-GNULIB_CEILF
-GNULIB_CEIL
-GNULIB_CBRTL
-GNULIB_CBRTF
-GNULIB_CBRT
-GNULIB_ATAN2F
-GNULIB_ATANL
-GNULIB_ATANF
-GNULIB_ASINL
-GNULIB_ASINF
-GNULIB_ACOSL
-GNULIB_ACOSF
 REPLACE_ITOLD
 GL_GENERATE_FLOAT_H_FALSE
 GL_GENERATE_FLOAT_H_TRUE
@@ -1306,15 +1597,78 @@ NEXT_AS_FIRST_DIRECTIVE_FLOAT_H
 NEXT_FLOAT_H
 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H
 NEXT_FCNTL_H
+GL_M4_GNULIB_MDA_OPEN
+GL_M4_GNULIB_MDA_CREAT
+GL_M4_GNULIB_OPENAT
+GL_M4_GNULIB_OPEN
+GL_M4_GNULIB_NONBLOCKING
+GL_M4_GNULIB_FCNTL
+GL_M4_GNULIB_CREAT
 REPLACE_OPENAT
 REPLACE_OPEN
 REPLACE_FCNTL
+REPLACE_CREAT
 HAVE_OPENAT
 HAVE_FCNTL
-GNULIB_OPENAT
-GNULIB_OPEN
-GNULIB_NONBLOCKING
-GNULIB_FCNTL
+GL_M4_GNULIB_MDA_TEMPNAM
+GL_M4_GNULIB_MDA_PUTW
+GL_M4_GNULIB_MDA_GETW
+GL_M4_GNULIB_MDA_FILENO
+GL_M4_GNULIB_MDA_FDOPEN
+GL_M4_GNULIB_MDA_FCLOSEALL
+GL_M4_GNULIB_VSPRINTF_POSIX
+GL_M4_GNULIB_VSNPRINTF
+GL_M4_GNULIB_VPRINTF_POSIX
+GL_M4_GNULIB_VPRINTF
+GL_M4_GNULIB_VFPRINTF_POSIX
+GL_M4_GNULIB_VFPRINTF
+GL_M4_GNULIB_VDPRINTF
+GL_M4_GNULIB_VSCANF
+GL_M4_GNULIB_VFSCANF
+GL_M4_GNULIB_VASPRINTF
+GL_M4_GNULIB_TMPFILE
+GL_M4_GNULIB_STDIO_H_SIGPIPE
+GL_M4_GNULIB_STDIO_H_NONBLOCKING
+GL_M4_GNULIB_SPRINTF_POSIX
+GL_M4_GNULIB_SNPRINTF
+GL_M4_GNULIB_SCANF
+GL_M4_GNULIB_RENAMEAT
+GL_M4_GNULIB_RENAME
+GL_M4_GNULIB_REMOVE
+GL_M4_GNULIB_PUTS
+GL_M4_GNULIB_PUTCHAR
+GL_M4_GNULIB_PUTC
+GL_M4_GNULIB_PRINTF_POSIX
+GL_M4_GNULIB_PRINTF
+GL_M4_GNULIB_POPEN
+GL_M4_GNULIB_PERROR
+GL_M4_GNULIB_PCLOSE
+GL_M4_GNULIB_OBSTACK_PRINTF_POSIX
+GL_M4_GNULIB_OBSTACK_PRINTF
+GL_M4_GNULIB_GETLINE
+GL_M4_GNULIB_GETDELIM
+GL_M4_GNULIB_GETCHAR
+GL_M4_GNULIB_GETC
+GL_M4_GNULIB_FWRITE
+GL_M4_GNULIB_FTELLO
+GL_M4_GNULIB_FTELL
+GL_M4_GNULIB_FSEEKO
+GL_M4_GNULIB_FSEEK
+GL_M4_GNULIB_FSCANF
+GL_M4_GNULIB_FREOPEN
+GL_M4_GNULIB_FREAD
+GL_M4_GNULIB_FPUTS
+GL_M4_GNULIB_FPUTC
+GL_M4_GNULIB_FPURGE
+GL_M4_GNULIB_FPRINTF_POSIX
+GL_M4_GNULIB_FPRINTF
+GL_M4_GNULIB_FOPEN
+GL_M4_GNULIB_FGETS
+GL_M4_GNULIB_FGETC
+GL_M4_GNULIB_FFLUSH
+GL_M4_GNULIB_FDOPEN
+GL_M4_GNULIB_FCLOSE
+GL_M4_GNULIB_DPRINTF
 REPLACE_VSPRINTF
 REPLACE_VSNPRINTF
 REPLACE_VPRINTF
@@ -1363,59 +1717,7 @@ HAVE_DECL_GETDELIM
 HAVE_DECL_FTELLO
 HAVE_DECL_FSEEKO
 HAVE_DECL_FPURGE
-GNULIB_VSPRINTF_POSIX
-GNULIB_VSNPRINTF
-GNULIB_VPRINTF_POSIX
-GNULIB_VPRINTF
-GNULIB_VFPRINTF_POSIX
-GNULIB_VFPRINTF
-GNULIB_VDPRINTF
-GNULIB_VSCANF
-GNULIB_VFSCANF
-GNULIB_VASPRINTF
-GNULIB_TMPFILE
-GNULIB_STDIO_H_SIGPIPE
-GNULIB_STDIO_H_NONBLOCKING
-GNULIB_SPRINTF_POSIX
-GNULIB_SNPRINTF
-GNULIB_SCANF
-GNULIB_RENAMEAT
-GNULIB_RENAME
-GNULIB_REMOVE
-GNULIB_PUTS
-GNULIB_PUTCHAR
-GNULIB_PUTC
-GNULIB_PRINTF_POSIX
-GNULIB_PRINTF
-GNULIB_POPEN
-GNULIB_PERROR
-GNULIB_PCLOSE
-GNULIB_OBSTACK_PRINTF_POSIX
-GNULIB_OBSTACK_PRINTF
-GNULIB_GETLINE
-GNULIB_GETDELIM
-GNULIB_GETCHAR
-GNULIB_GETC
-GNULIB_FWRITE
-GNULIB_FTELLO
-GNULIB_FTELL
-GNULIB_FSEEKO
-GNULIB_FSEEK
-GNULIB_FSCANF
-GNULIB_FREOPEN
-GNULIB_FREAD
-GNULIB_FPUTS
-GNULIB_FPUTC
-GNULIB_FPURGE
-GNULIB_FPRINTF_POSIX
-GNULIB_FPRINTF
-GNULIB_FOPEN
-GNULIB_FGETS
-GNULIB_FGETC
-GNULIB_FFLUSH
-GNULIB_FDOPEN
-GNULIB_FCLOSE
-GNULIB_DPRINTF
+HAVE_DECL_FCLOSEALL
 EOVERFLOW_VALUE
 EOVERFLOW_HIDDEN
 ENOLINK_VALUE
@@ -1427,167 +1729,133 @@ GL_GENERATE_ERRNO_H_TRUE
 ERRNO_H
 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H
 NEXT_ERRNO_H
+HAVE_DIRENT_H
+NEXT_AS_FIRST_DIRECTIVE_DIRENT_H
+NEXT_DIRENT_H
 PRAGMA_COLUMNS
 PRAGMA_SYSTEM_HEADER
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE
 INCLUDE_NEXT
 pkglibexecdir
-runstatedir
 lispdir
+GL_M4_GNULIB_ALPHASORT
+GL_M4_GNULIB_SCANDIR
+GL_M4_GNULIB_FDOPENDIR
+GL_M4_GNULIB_DIRFD
+GL_M4_GNULIB_CLOSEDIR
+GL_M4_GNULIB_REWINDDIR
+GL_M4_GNULIB_READDIR
+GL_M4_GNULIB_OPENDIR
+REPLACE_FDOPENDIR
+REPLACE_DIRFD
+REPLACE_CLOSEDIR
+REPLACE_OPENDIR
+HAVE_ALPHASORT
+HAVE_SCANDIR
+HAVE_FDOPENDIR
+HAVE_DECL_FDOPENDIR
+HAVE_DECL_DIRFD
+HAVE_CLOSEDIR
+HAVE_REWINDDIR
+HAVE_READDIR
+HAVE_OPENDIR
 HAVE_WINSOCK2_H
+REPLACE_IOCTL
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
+SYS_IOCTL_H_HAVE_WINSOCK2_H
 HAVE_MSVC_INVALID_PARAMETER_HANDLER
-UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
-UNISTD_H_HAVE_WINSOCK2_H
-REPLACE_WRITE
-REPLACE_USLEEP
-REPLACE_UNLINKAT
-REPLACE_UNLINK
-REPLACE_TTYNAME_R
-REPLACE_SYMLINKAT
-REPLACE_SYMLINK
-REPLACE_SLEEP
-REPLACE_RMDIR
-REPLACE_READLINKAT
-REPLACE_READLINK
-REPLACE_READ
-REPLACE_PWRITE
-REPLACE_PREAD
-REPLACE_LSEEK
-REPLACE_LINKAT
-REPLACE_LINK
-REPLACE_LCHOWN
-REPLACE_ISATTY
-REPLACE_GETPAGESIZE
-REPLACE_GETGROUPS
-REPLACE_GETLOGIN_R
-REPLACE_GETDTABLESIZE
-REPLACE_GETDOMAINNAME
-REPLACE_GETCWD
-REPLACE_FTRUNCATE
-REPLACE_FCHOWNAT
-REPLACE_DUP2
-REPLACE_DUP
-REPLACE_CLOSE
-REPLACE_CHOWN
-HAVE_SYS_PARAM_H
-HAVE_OS_H
-HAVE_DECL_TTYNAME_R
-HAVE_DECL_SETHOSTNAME
-HAVE_DECL_GETUSERSHELL
-HAVE_DECL_GETPAGESIZE
-HAVE_DECL_GETLOGIN_R
-HAVE_DECL_GETLOGIN
-HAVE_DECL_GETDOMAINNAME
-HAVE_DECL_FDATASYNC
-HAVE_DECL_FCHDIR
-HAVE_DECL_ENVIRON
-HAVE_USLEEP
-HAVE_UNLINKAT
-HAVE_SYMLINKAT
-HAVE_SYMLINK
-HAVE_SLEEP
-HAVE_SETHOSTNAME
-HAVE_READLINKAT
-HAVE_READLINK
-HAVE_PWRITE
-HAVE_PREAD
-HAVE_PIPE2
-HAVE_PIPE
-HAVE_LINKAT
-HAVE_LINK
-HAVE_LCHOWN
-HAVE_GROUP_MEMBER
-HAVE_GETPAGESIZE
-HAVE_GETLOGIN
-HAVE_GETHOSTNAME
-HAVE_GETGROUPS
-HAVE_GETDTABLESIZE
-HAVE_FTRUNCATE
-HAVE_FSYNC
-HAVE_FDATASYNC
-HAVE_FCHOWNAT
-HAVE_FCHDIR
-HAVE_FACCESSAT
-HAVE_EUIDACCESS
-HAVE_DUP3
-HAVE_DUP2
-HAVE_CHOWN
-GNULIB_WRITE
-GNULIB_USLEEP
-GNULIB_UNLINKAT
-GNULIB_UNLINK
-GNULIB_UNISTD_H_SIGPIPE
-GNULIB_UNISTD_H_NONBLOCKING
-GNULIB_TTYNAME_R
-GNULIB_SYMLINKAT
-GNULIB_SYMLINK
-GNULIB_SLEEP
-GNULIB_SETHOSTNAME
-GNULIB_RMDIR
-GNULIB_READLINKAT
-GNULIB_READLINK
-GNULIB_READ
-GNULIB_PWRITE
-GNULIB_PREAD
-GNULIB_PIPE2
-GNULIB_PIPE
-GNULIB_LSEEK
-GNULIB_LINKAT
-GNULIB_LINK
-GNULIB_LCHOWN
-GNULIB_ISATTY
-GNULIB_GROUP_MEMBER
-GNULIB_GETUSERSHELL
-GNULIB_GETPAGESIZE
-GNULIB_GETLOGIN_R
-GNULIB_GETLOGIN
-GNULIB_GETHOSTNAME
-GNULIB_GETGROUPS
-GNULIB_GETDTABLESIZE
-GNULIB_GETDOMAINNAME
-GNULIB_GETCWD
-GNULIB_FTRUNCATE
-GNULIB_FSYNC
-GNULIB_FDATASYNC
-GNULIB_FCHOWNAT
-GNULIB_FCHDIR
-GNULIB_FACCESSAT
-GNULIB_EUIDACCESS
-GNULIB_ENVIRON
-GNULIB_DUP3
-GNULIB_DUP2
-GNULIB_DUP
-GNULIB_CLOSE
-GNULIB_CHOWN
-GNULIB_CHDIR
+LIB_CLOCK_GETTIME
+GL_M4_GNULIB_MDA_PUTENV
+GL_M4_GNULIB_MDA_MKTEMP
+GL_M4_GNULIB_MDA_GCVT
+GL_M4_GNULIB_MDA_FCVT
+GL_M4_GNULIB_MDA_ECVT
+GL_M4_GNULIB_WCTOMB
+GL_M4_GNULIB_UNSETENV
+GL_M4_GNULIB_UNLOCKPT
+GL_M4_GNULIB_SYSTEM_POSIX
+GL_M4_GNULIB_STRTOULL
+GL_M4_GNULIB_STRTOUL
+GL_M4_GNULIB_STRTOLL
+GL_M4_GNULIB_STRTOLD
+GL_M4_GNULIB_STRTOL
+GL_M4_GNULIB_STRTOD
+GL_M4_GNULIB_SETENV
+GL_M4_GNULIB_SECURE_GETENV
+GL_M4_GNULIB_RPMATCH
+GL_M4_GNULIB_REALPATH
+GL_M4_GNULIB_REALLOC_POSIX
+GL_M4_GNULIB_REALLOCARRAY
+GL_M4_GNULIB_RANDOM_R
+GL_M4_GNULIB_RANDOM
+GL_M4_GNULIB_QSORT_R
+GL_M4_GNULIB_PUTENV
+GL_M4_GNULIB_PTSNAME_R
+GL_M4_GNULIB_PTSNAME
+GL_M4_GNULIB_POSIX_OPENPT
+GL_M4_GNULIB_POSIX_MEMALIGN
+GL_M4_GNULIB_MKSTEMPS
+GL_M4_GNULIB_MKSTEMP
+GL_M4_GNULIB_MKOSTEMPS
+GL_M4_GNULIB_MKOSTEMP
+GL_M4_GNULIB_MKDTEMP
+GL_M4_GNULIB_MBTOWC
+GL_M4_GNULIB_MALLOC_POSIX
+GL_M4_GNULIB_GRANTPT
+GL_M4_GNULIB_GETSUBOPT
+GL_M4_GNULIB_GETLOADAVG
+GL_M4_GNULIB_FREE_POSIX
+GL_M4_GNULIB_CANONICALIZE_FILE_NAME
+GL_M4_GNULIB_CALLOC_POSIX
+GL_M4_GNULIB_ATOLL
+GL_M4_GNULIB_ALIGNED_ALLOC
+GL_M4_GNULIB__EXIT
 REPLACE_WCTOMB
 REPLACE_UNSETENV
+REPLACE_STRTOULL
+REPLACE_STRTOUL
+REPLACE_STRTOLL
+REPLACE_STRTOLD
+REPLACE_STRTOL
 REPLACE_STRTOD
+REPLACE_SETSTATE
 REPLACE_SETENV
 REPLACE_REALPATH
+REPLACE_REALLOCARRAY
 REPLACE_REALLOC
 REPLACE_RANDOM_R
+REPLACE_RANDOM
 REPLACE_QSORT_R
 REPLACE_PUTENV
 REPLACE_PTSNAME_R
 REPLACE_PTSNAME
+REPLACE_POSIX_MEMALIGN
 REPLACE_MKSTEMP
 REPLACE_MBTOWC
 REPLACE_MALLOC
+REPLACE_INITSTATE
+REPLACE_FREE
 REPLACE_CANONICALIZE_FILE_NAME
 REPLACE_CALLOC
+REPLACE_ALIGNED_ALLOC
 HAVE_DECL_UNSETENV
 HAVE_UNLOCKPT
 HAVE_SYS_LOADAVG_H
 HAVE_STRUCT_RANDOM_DATA
 HAVE_STRTOULL
+HAVE_STRTOUL
 HAVE_STRTOLL
+HAVE_STRTOLD
+HAVE_STRTOL
 HAVE_STRTOD
+HAVE_DECL_SETSTATE
+HAVE_SETSTATE
 HAVE_DECL_SETENV
 HAVE_SETENV
 HAVE_SECURE_GETENV
 HAVE_RPMATCH
 HAVE_REALPATH
+HAVE_REALLOCARRAY
 HAVE_RANDOM_R
 HAVE_RANDOM_H
 HAVE_RANDOM
@@ -1595,57 +1863,72 @@ HAVE_QSORT_R
 HAVE_PTSNAME_R
 HAVE_PTSNAME
 HAVE_POSIX_OPENPT
+HAVE_POSIX_MEMALIGN
 HAVE_MKSTEMPS
 HAVE_MKSTEMP
 HAVE_MKOSTEMPS
 HAVE_MKOSTEMP
 HAVE_MKDTEMP
+HAVE_MBTOWC
+HAVE_DECL_INITSTATE
+HAVE_INITSTATE
 HAVE_GRANTPT
 HAVE_GETSUBOPT
 HAVE_DECL_GETLOADAVG
+HAVE_DECL_GCVT
+HAVE_DECL_FCVT
+HAVE_DECL_ECVT
 HAVE_CANONICALIZE_FILE_NAME
 HAVE_ATOLL
+HAVE_ALIGNED_ALLOC
 HAVE__EXIT
-GNULIB_WCTOMB
-GNULIB_UNSETENV
-GNULIB_UNLOCKPT
-GNULIB_SYSTEM_POSIX
-GNULIB_STRTOULL
-GNULIB_STRTOLL
-GNULIB_STRTOD
-GNULIB_SETENV
-GNULIB_SECURE_GETENV
-GNULIB_RPMATCH
-GNULIB_REALPATH
-GNULIB_REALLOC_POSIX
-GNULIB_RANDOM_R
-GNULIB_RANDOM
-GNULIB_QSORT_R
-GNULIB_PUTENV
-GNULIB_PTSNAME_R
-GNULIB_PTSNAME
-GNULIB_POSIX_OPENPT
-GNULIB_MKSTEMPS
-GNULIB_MKSTEMP
-GNULIB_MKOSTEMPS
-GNULIB_MKOSTEMP
-GNULIB_MKDTEMP
-GNULIB_MBTOWC
-GNULIB_MALLOC_POSIX
-GNULIB_GRANTPT
-GNULIB_GETSUBOPT
-GNULIB_GETLOADAVG
-GNULIB_CANONICALIZE_FILE_NAME
-GNULIB_CALLOC_POSIX
-GNULIB_ATOLL
-GNULIB__EXIT
 LTLIBCSTACK
 LIBCSTACK
-LIBSIGSEGV_PREFIX
-LTLIBSIGSEGV
-LIBSIGSEGV
-HAVE_LIBSIGSEGV
+GL_M4_GNULIB_MDA_WCSDUP
+GL_M4_GNULIB_WCSFTIME
+GL_M4_GNULIB_WCSWIDTH
+GL_M4_GNULIB_WCSTOK
+GL_M4_GNULIB_WCSSTR
+GL_M4_GNULIB_WCSPBRK
+GL_M4_GNULIB_WCSSPN
+GL_M4_GNULIB_WCSCSPN
+GL_M4_GNULIB_WCSRCHR
+GL_M4_GNULIB_WCSCHR
+GL_M4_GNULIB_WCSDUP
+GL_M4_GNULIB_WCSXFRM
+GL_M4_GNULIB_WCSCOLL
+GL_M4_GNULIB_WCSNCASECMP
+GL_M4_GNULIB_WCSCASECMP
+GL_M4_GNULIB_WCSNCMP
+GL_M4_GNULIB_WCSCMP
+GL_M4_GNULIB_WCSNCAT
+GL_M4_GNULIB_WCSCAT
+GL_M4_GNULIB_WCPNCPY
+GL_M4_GNULIB_WCSNCPY
+GL_M4_GNULIB_WCPCPY
+GL_M4_GNULIB_WCSCPY
+GL_M4_GNULIB_WCSNLEN
+GL_M4_GNULIB_WCSLEN
+GL_M4_GNULIB_WMEMSET
+GL_M4_GNULIB_WMEMPCPY
+GL_M4_GNULIB_WMEMMOVE
+GL_M4_GNULIB_WMEMCPY
+GL_M4_GNULIB_WMEMCMP
+GL_M4_GNULIB_WMEMCHR
+GL_M4_GNULIB_WCWIDTH
+GL_M4_GNULIB_WCSNRTOMBS
+GL_M4_GNULIB_WCSRTOMBS
+GL_M4_GNULIB_WCRTOMB
+GL_M4_GNULIB_MBSNRTOWCS
+GL_M4_GNULIB_MBSRTOWCS
+GL_M4_GNULIB_MBRLEN
+GL_M4_GNULIB_MBRTOWC
+GL_M4_GNULIB_MBSINIT
+GL_M4_GNULIB_WCTOB
+GL_M4_GNULIB_BTOWC
 LOCALE_FR
+REPLACE_WCSTOK
+REPLACE_WCSFTIME
 REPLACE_WCSWIDTH
 REPLACE_WCWIDTH
 REPLACE_WCSNRTOMBS
@@ -1660,7 +1943,9 @@ REPLACE_WCTOB
 REPLACE_BTOWC
 REPLACE_MBSTATE_T
 HAVE_DECL_WCWIDTH
+HAVE_DECL_WCSDUP
 HAVE_DECL_WCTOB
+HAVE_WCSFTIME
 HAVE_WCSWIDTH
 HAVE_WCSTOK
 HAVE_WCSSTR
@@ -1685,6 +1970,7 @@ HAVE_WCSCPY
 HAVE_WCSNLEN
 HAVE_WCSLEN
 HAVE_WMEMSET
+HAVE_WMEMPCPY
 HAVE_WMEMMOVE
 HAVE_WMEMCPY
 HAVE_WMEMCMP
@@ -1698,53 +1984,205 @@ 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
-GNULIB_WCRTOMB
-GNULIB_MBSNRTOWCS
-GNULIB_MBSRTOWCS
-GNULIB_MBRLEN
-GNULIB_MBRTOWC
-GNULIB_MBSINIT
-GNULIB_WCTOB
-GNULIB_BTOWC
+HAVE_ALLOCA_H
 GL_GENERATE_ALLOCA_H_FALSE
 GL_GENERATE_ALLOCA_H_TRUE
 ALLOCA_H
 ALLOCA
+GL_M4_GNULIB_MDA_WRITE
+GL_M4_GNULIB_MDA_UNLINK
+GL_M4_GNULIB_MDA_SWAB
+GL_M4_GNULIB_MDA_RMDIR
+GL_M4_GNULIB_MDA_READ
+GL_M4_GNULIB_MDA_LSEEK
+GL_M4_GNULIB_MDA_ISATTY
+GL_M4_GNULIB_MDA_GETPID
+GL_M4_GNULIB_MDA_GETCWD
+GL_M4_GNULIB_MDA_EXECVPE
+GL_M4_GNULIB_MDA_EXECVP
+GL_M4_GNULIB_MDA_EXECVE
+GL_M4_GNULIB_MDA_EXECV
+GL_M4_GNULIB_MDA_EXECLP
+GL_M4_GNULIB_MDA_EXECLE
+GL_M4_GNULIB_MDA_EXECL
+GL_M4_GNULIB_MDA_DUP2
+GL_M4_GNULIB_MDA_DUP
+GL_M4_GNULIB_MDA_CLOSE
+GL_M4_GNULIB_MDA_CHDIR
+GL_M4_GNULIB_MDA_ACCESS
+GL_M4_GNULIB_WRITE
+GL_M4_GNULIB_USLEEP
+GL_M4_GNULIB_UNLINKAT
+GL_M4_GNULIB_UNLINK
+GL_M4_GNULIB_UNISTD_H_SIGPIPE
+GL_M4_GNULIB_UNISTD_H_NONBLOCKING
+GL_M4_GNULIB_TTYNAME_R
+GL_M4_GNULIB_TRUNCATE
+GL_M4_GNULIB_SYMLINKAT
+GL_M4_GNULIB_SYMLINK
+GL_M4_GNULIB_SLEEP
+GL_M4_GNULIB_SETHOSTNAME
+GL_M4_GNULIB_RMDIR
+GL_M4_GNULIB_READLINKAT
+GL_M4_GNULIB_READLINK
+GL_M4_GNULIB_READ
+GL_M4_GNULIB_PWRITE
+GL_M4_GNULIB_PREAD
+GL_M4_GNULIB_PIPE2
+GL_M4_GNULIB_PIPE
+GL_M4_GNULIB_LSEEK
+GL_M4_GNULIB_LINKAT
+GL_M4_GNULIB_LINK
+GL_M4_GNULIB_LCHOWN
+GL_M4_GNULIB_ISATTY
+GL_M4_GNULIB_GROUP_MEMBER
+GL_M4_GNULIB_GETUSERSHELL
+GL_M4_GNULIB_GETPASS
+GL_M4_GNULIB_GETPAGESIZE
+GL_M4_GNULIB_GETOPT_POSIX
+GL_M4_GNULIB_GETLOGIN_R
+GL_M4_GNULIB_GETLOGIN
+GL_M4_GNULIB_GETHOSTNAME
+GL_M4_GNULIB_GETGROUPS
+GL_M4_GNULIB_GETENTROPY
+GL_M4_GNULIB_GETDTABLESIZE
+GL_M4_GNULIB_GETDOMAINNAME
+GL_M4_GNULIB_GETCWD
+GL_M4_GNULIB_FTRUNCATE
+GL_M4_GNULIB_FSYNC
+GL_M4_GNULIB_FDATASYNC
+GL_M4_GNULIB_FCHOWNAT
+GL_M4_GNULIB_FCHDIR
+GL_M4_GNULIB_FACCESSAT
+GL_M4_GNULIB_EXECVPE
+GL_M4_GNULIB_EXECVP
+GL_M4_GNULIB_EXECVE
+GL_M4_GNULIB_EXECV
+GL_M4_GNULIB_EXECLP
+GL_M4_GNULIB_EXECLE
+GL_M4_GNULIB_EXECL
+GL_M4_GNULIB_EUIDACCESS
+GL_M4_GNULIB_ENVIRON
+GL_M4_GNULIB_DUP3
+GL_M4_GNULIB_DUP2
+GL_M4_GNULIB_DUP
+GL_M4_GNULIB_COPY_FILE_RANGE
+GL_M4_GNULIB_CLOSE
+GL_M4_GNULIB_CHOWN
+GL_M4_GNULIB_CHDIR
+GL_M4_GNULIB_ACCESS
+UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS
+UNISTD_H_HAVE_WINSOCK2_H
+UNISTD_H_HAVE_SYS_RANDOM_H
+REPLACE_WRITE
+REPLACE_USLEEP
+REPLACE_UNLINKAT
+REPLACE_UNLINK
+REPLACE_TTYNAME_R
+REPLACE_TRUNCATE
+REPLACE_SYMLINKAT
+REPLACE_SYMLINK
+REPLACE_SLEEP
+REPLACE_RMDIR
+REPLACE_READLINKAT
+REPLACE_READLINK
+REPLACE_READ
+REPLACE_PWRITE
+REPLACE_PREAD
+REPLACE_LSEEK
+REPLACE_LINKAT
+REPLACE_LINK
+REPLACE_LCHOWN
+REPLACE_ISATTY
+REPLACE_GETPASS
+REPLACE_GETPAGESIZE
+REPLACE_GETGROUPS
+REPLACE_GETLOGIN_R
+REPLACE_GETDTABLESIZE
+REPLACE_GETDOMAINNAME
+REPLACE_GETCWD
+REPLACE_FTRUNCATE
+REPLACE_FCHOWNAT
+REPLACE_FACCESSAT
+REPLACE_EXECVPE
+REPLACE_EXECVP
+REPLACE_EXECVE
+REPLACE_EXECV
+REPLACE_EXECLP
+REPLACE_EXECLE
+REPLACE_EXECL
+REPLACE_DUP2
+REPLACE_DUP
+REPLACE_CLOSE
+REPLACE_CHOWN
+REPLACE_ACCESS
+HAVE_SYS_PARAM_H
+HAVE_OS_H
+HAVE_DECL_TTYNAME_R
+HAVE_DECL_TRUNCATE
+HAVE_DECL_SETHOSTNAME
+HAVE_DECL_GETUSERSHELL
+HAVE_DECL_GETPAGESIZE
+HAVE_DECL_GETLOGIN_R
+HAVE_DECL_GETLOGIN
+HAVE_DECL_GETDOMAINNAME
+HAVE_DECL_FDATASYNC
+HAVE_DECL_FCHDIR
+HAVE_DECL_EXECVPE
+HAVE_DECL_ENVIRON
+HAVE_USLEEP
+HAVE_UNLINKAT
+HAVE_SYMLINKAT
+HAVE_SYMLINK
+HAVE_SLEEP
+HAVE_SETHOSTNAME
+HAVE_READLINKAT
+HAVE_READLINK
+HAVE_PWRITE
+HAVE_PREAD
+HAVE_PIPE2
+HAVE_PIPE
+HAVE_LINKAT
+HAVE_LINK
+HAVE_LCHOWN
+HAVE_GROUP_MEMBER
+HAVE_GETPASS
+HAVE_GETPAGESIZE
+HAVE_GETLOGIN
+HAVE_GETHOSTNAME
+HAVE_GETGROUPS
+HAVE_GETENTROPY
+HAVE_GETDTABLESIZE
+HAVE_FTRUNCATE
+HAVE_FSYNC
+HAVE_FDATASYNC
+HAVE_FCHOWNAT
+HAVE_FCHDIR
+HAVE_FACCESSAT
+HAVE_EXECVPE
+HAVE_EUIDACCESS
+HAVE_DUP3
+HAVE_COPY_FILE_RANGE
+HAVE_CHOWN
 GL_COND_LIBTOOL_FALSE
 GL_COND_LIBTOOL_TRUE
 WARN_CFLAGS
 WERROR_CFLAGS
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ANSICXX_FALSE
+ANSICXX_TRUE
+CXXFLAGS
+ac_ct_CXX
+CXX
+CXX_CHOICE
+RANLIB
+ARFLAGS
+AR
+EGREP
+GREP
+CPP
 host_os
 host_vendor
 host_cpu
@@ -1753,13 +2191,6 @@ build_os
 build_vendor
 build_cpu
 build
-RANLIB
-ARFLAGS
-ac_ct_AR
-AR
-EGREP
-GREP
-CPP
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
@@ -1767,7 +2198,6 @@ am__nodep
 AMDEPBACKSLASH
 AMDEP_FALSE
 AMDEP_TRUE
-am__quote
 am__include
 DEPDIR
 OBJEXT
@@ -1823,6 +2253,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -1841,28 +2272,33 @@ PACKAGE_VERSION
 PACKAGE_TARNAME
 PACKAGE_NAME
 PATH_SEPARATOR
-SHELL'
+SHELL
+am__quote'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
 enable_silent_rules
 enable_dependency_tracking
+enable_c__
 enable_largefile
 enable_threads
 enable_gcc_warnings
+enable_cross_guesses
 enable_assert
 with_gnu_ld
 enable_rpath
-with_libsigsegv_prefix
-with_libpth_prefix
+with_libiconv_prefix
 with_included_regex
+with_libsigsegv
+with_libsigsegv_prefix
 with_packager
 with_packager_version
 with_packager_bug_reports
-enable_c__
 enable_changeword
 with_syscmd_shell
 with_dmalloc
+enable_nls
+with_libintl_prefix
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1913,6 +2349,7 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1942,8 +2379,6 @@ do
   *)    ac_optarg=yes ;;
   esac
 
-  # Accept the important Cygnus configure options, so we can diagnose typos.
-
   case $ac_dashdash$ac_option in
   --)
     ac_dashdash=yes ;;
@@ -1984,9 +2419,9 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: \`$ac_useropt'"
     ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
       *"
 "enable_$ac_useropt"
@@ -2010,9 +2445,9 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid feature name: $ac_useropt"
+      as_fn_error $? "invalid feature name: \`$ac_useropt'"
     ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
       *"
 "enable_$ac_useropt"
@@ -2165,6 +2600,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -2214,9 +2658,9 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: \`$ac_useropt'"
     ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
       *"
 "with_$ac_useropt"
@@ -2230,9 +2674,9 @@ do
     ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
     # Reject names that are not valid shell variable names.
     expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
-      as_fn_error $? "invalid package name: $ac_useropt"
+      as_fn_error $? "invalid package name: \`$ac_useropt'"
     ac_useropt_orig=$ac_useropt
-    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
     case $ac_user_opts in
       *"
 "with_$ac_useropt"
@@ -2276,9 +2720,9 @@ Try \`$0 --help' for more information"
 
   *)
     # FIXME: should be removed in autoconf 3.0.
-    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
-      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+      printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
     : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
     ;;
 
@@ -2294,7 +2738,7 @@ if test -n "$ac_unrecognized_opts"; then
   case $enable_option_checking in
     no) ;;
     fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
-    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+    *)     printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
   esac
 fi
 
@@ -2302,7 +2746,7 @@ fi
 for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
                datadir sysconfdir sharedstatedir localstatedir includedir \
                oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-               libdir localedir mandir
+               libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -2358,7 +2802,7 @@ $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$as_myself" : 'X\(//\)[^/]' \| \
         X"$as_myself" : 'X\(//\)$' \| \
         X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_myself" |
+printf "%s\n" X"$as_myself" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -2415,7 +2859,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 M4 1.4.18 to adapt to many kinds of systems.
+\`configure' configures GNU M4 1.4.19 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -2455,6 +2899,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -2485,7 +2930,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of GNU M4 1.4.18:";;
+     short | recursive ) echo "Configuration of GNU M4 1.4.19:";;
    esac
   cat <<\_ACEOF
 
@@ -2499,28 +2944,33 @@ Optional Features:
                           do not reject slow dependency extractors
   --disable-dependency-tracking
                           speeds up one-time build
+  --enable-c++            also build C++ sources
   --disable-largefile     omit support for large files
-  --enable-threads={posix|solaris|pth|windows}
+  --enable-threads={isoc|posix|isoc+posix|windows}
                           specify multithreading API
   --disable-threads       build without multithread safety
   --enable-gcc-warnings   turn on lots of GCC warnings (for developers)
+  --enable-cross-guesses={conservative|risky}
+                          specify policy for cross-compilation guesses
   --disable-assert        turn off assertions
   --disable-rpath         do not hardcode runtime library paths
-  --enable-c++            also build C++ sources
   --enable-changeword     enable -W and changeword() builtin
+  --disable-nls           do not use Native Language Support
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
-  --with-libsigsegv-prefix[=DIR]  search for libsigsegv in DIR/include and DIR/lib
-  --without-libsigsegv-prefix     don't search for libsigsegv in includedir and libdir
-  --with-libpth-prefix[=DIR]  search for libpth in DIR/include and DIR/lib
-  --without-libpth-prefix     don't search for libpth in includedir and libdir
+  --with-libiconv-prefix[=DIR]  search for libiconv in DIR/include and DIR/lib
+  --without-libiconv-prefix     don't search for libiconv in includedir and libdir
   --without-included-regex
                           don't compile regex; this is the default on systems
                           with recent-enough versions of the GNU C Library
                           (use with caution on other systems).
+  --with-libsigsegv       use the GNU libsigsegv library, when present,
+                          instead of the gnulib module 'sigsegv'
+  --with-libsigsegv-prefix[=DIR]  search for libsigsegv in DIR/include and DIR/lib
+  --without-libsigsegv-prefix     don't search for libsigsegv in includedir and libdir
   --with-packager         String identifying the packager of this software
   --with-packager-version Packager-specific version information
   --with-packager-bug-reports
@@ -2528,6 +2978,8 @@ Optional Packages:
   --with-syscmd-shell     shell used by syscmd [/bin/sh]
   --with-dmalloc          use dmalloc, as in dmalloc.tar.gz from
                           @/ftp.antaire.com:antaire/src/dmalloc.
+  --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
+  --without-libintl-prefix     don't search for libintl in includedir and libdir
 
 Some influential environment variables:
   CC          C compiler command
@@ -2545,8 +2997,8 @@ Use these variables to override the choices made by `configure' or to help
 it to find libraries and programs with nonstandard names/locations.
 
 Report bugs to <bug-m4@gnu.org>.
-GNU M4 home page: <http://www.gnu.org/software/m4/>.
-General help using GNU software: <http://www.gnu.org/gethelp/>.
+GNU M4 home page: <https://www.gnu.org/software/m4/>.
+General help using GNU software: <https://www.gnu.org/gethelp/>.
 _ACEOF
 ac_status=$?
 fi
@@ -2562,9 +3014,9 @@ if test "$ac_init_help" = "recursive"; then
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -2592,7 +3044,8 @@ esac
 ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
 
     cd "$ac_dir" || { ac_status=$?; continue; }
-    # Check for guested configure.
+    # Check for configure.gnu first; this name is used for a wrapper for
+    # Metaconfig's "Configure" on case-insensitive file systems.
     if test -f "$ac_srcdir/configure.gnu"; then
       echo &&
       $SHELL "$ac_srcdir/configure.gnu" --help=recursive
@@ -2600,7 +3053,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
       echo &&
       $SHELL "$ac_srcdir/configure" --help=recursive
     else
-      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+      printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
     fi || ac_status=$?
     cd "$ac_pwd" || { ac_status=$?; break; }
   done
@@ -2609,10 +3062,10 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-GNU M4 configure 1.4.18
-generated by GNU Autoconf 2.69
+GNU M4 configure 1.4.19
+generated by GNU Autoconf 2.71
 
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2021 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 _ACEOF
@@ -2629,14 +3082,14 @@ fi
 ac_fn_c_try_compile ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  rm -f conftest.$ac_objext
+  rm -f conftest.$ac_objext conftest.beam
   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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
   (eval "$ac_compile") 2>conftest.err
   ac_status=$?
   if test -s conftest.err; then
@@ -2644,14 +3097,15 @@ $as_echo "$ac_try_echo"; } >&5
     cat conftest.er1 >&5
     mv -f conftest.er1 conftest.err
   fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && {
         test -z "$ac_c_werror_flag" ||
         test ! -s conftest.err
-       } && test -s conftest.$ac_objext; then :
+       } && test -s conftest.$ac_objext
+then :
   ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+  printf "%s\n" "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
        ac_retval=1
@@ -2661,6 +3115,39 @@ fi
 
 } # ac_fn_c_try_compile
 
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  eval "$3=yes"
+else $as_nop
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
 # ac_fn_c_try_cpp LINENO
 # ----------------------
 # Try to preprocess conftest.$ac_ext, and return whether this succeeded.
@@ -2673,7 +3160,7 @@ case "(($ac_try" in
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
   (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
   ac_status=$?
   if test -s conftest.err; then
@@ -2681,14 +3168,15 @@ $as_echo "$ac_try_echo"; } >&5
     cat conftest.er1 >&5
     mv -f conftest.er1 conftest.err
   fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } > conftest.i && {
         test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
         test ! -s conftest.err
-       }; then :
+       }
+then :
   ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+  printf "%s\n" "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
     ac_retval=1
 
 } # ac_fn_c_try_cpp
 
-# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists, giving a warning if it cannot be compiled using
-# the include files in INCLUDES and setting the cache variable VAR
-# accordingly.
-ac_fn_c_check_header_mongrel ()
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  if eval \${$3+:} false; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-else
-  # Is the header compilable?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
-$as_echo_n "checking $2 usability... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_header_compiler=yes
-else
-  ac_header_compiler=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
-$as_echo "$ac_header_compiler" >&6; }
+  rm -f conftest.$ac_objext conftest.beam
+  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:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_cxx_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext
+then :
+  ac_retval=0
+else $as_nop
+  printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
-# Is the header present?
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
-$as_echo_n "checking $2 presence... " >&6; }
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <$2>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  ac_header_preproc=yes
-else
-  ac_header_preproc=no
+       ac_retval=1
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
-$as_echo "$ac_header_preproc" >&6; }
-
-# So?  What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
-  yes:no: )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
-$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-    ;;
-  no:yes:* )
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
-$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
-$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
-$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
-$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
-$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
-( $as_echo "## ----------------------------- ##
-## Report this to bug-m4@gnu.org ##
-## ----------------------------- ##"
-     ) | sed "s/^/$as_me: WARNING:     /" >&2
-    ;;
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval "$3=\$ac_header_compiler"
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        test -x conftest$ac_exeext
+       }
+then :
+  ac_retval=0
+else $as_nop
+  printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
 fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
 
-} # ac_fn_c_check_header_mongrel
+} # ac_fn_c_try_link
 
 # ac_fn_c_try_run LINENO
 # ----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
-# that executables *can* be run.
+# Try to run conftest.$ac_ext, and return whether this succeeded. Assumes that
+# executables *can* be run.
 ac_fn_c_try_run ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
@@ -2802,25 +3285,26 @@ case "(($ac_try" in
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && { 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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then :
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }
+then :
   ac_retval=0
-else
-  $as_echo "$as_me: program exited with status $ac_status" >&5
-       $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+  printf "%s\n" "$as_me: program exited with status $ac_status" >&5
+       printf "%s\n" "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
        ac_retval=$ac_status
@@ -2831,83 +3315,6 @@ fi
 
 } # ac_fn_c_try_run
 
-# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
-# -------------------------------------------------------
-# Tests whether HEADER exists and can be compiled using the include files in
-# INCLUDES, setting the cache variable VAR accordingly.
-ac_fn_c_check_header_compile ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$4
-#include <$2>
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval "$3=yes"
-else
-  eval "$3=no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-
-} # ac_fn_c_check_header_compile
-
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
-  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    grep -v '^ *+' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-    mv -f conftest.er1 conftest.err
-  fi
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && {
-        test -z "$ac_c_werror_flag" ||
-        test ! -s conftest.err
-       } && test -s conftest$ac_exeext && {
-        test "$cross_compiling" = yes ||
-        test -x conftest$ac_exeext
-       }; then :
-  ac_retval=0
-else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-       ac_retval=1
-fi
-  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
-  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
-  # interfere with the next link command; also delete a directory that is
-  # left behind by Apple's compiler.  We do this before executing the actions.
-  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
-  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
-  as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
 # ac_fn_c_check_type LINENO TYPE VAR INCLUDES
 # -------------------------------------------
 # Tests whether TYPE exists after having included INCLUDES, setting cache
@@ -2915,17 +3322,18 @@ fi
 ac_fn_c_check_type ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   eval "$3=no"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $4
 int
-main ()
+main (void)
 {
 if (sizeof ($2))
         return 0;
@@ -2933,12 +3341,13 @@ if (sizeof ($2))
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $4
 int
-main ()
+main (void)
 {
 if (sizeof (($2)))
            return 0;
@@ -2946,18 +3355,19 @@ if (sizeof (($2)))
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
 
-else
+else $as_nop
   eval "$3=yes"
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_type
@@ -2968,11 +3378,12 @@ $as_echo "$ac_res" >&6; }
 ac_fn_c_check_func ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
-$as_echo_n "checking for $2... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+printf %s "checking for $2... " >&6; }
+if eval test \${$3+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 /* Define $2 to an innocuous variant, in case <limits.h> declares $2.
@@ -2980,16 +3391,9 @@ else
 #define $2 innocuous_$2
 
 /* System header to define __stub macros and hopefully few prototypes,
-    which can conflict with char $2 (); below.
-    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-    <limits.h> exists even on freestanding compilers.  */
-
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+   which can conflict with char $2 (); below.  */
 
+#include <limits.h>
 #undef $2
 
 /* Override any GCC internal prototype to avoid an error.
@@ -3007,47 +3411,55 @@ choke me
 #endif
 
 int
-main ()
+main (void)
 {
 return $2 ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   eval "$3=yes"
-else
+else $as_nop
   eval "$3=no"
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
 fi
 eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_func
 
-# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
-# ---------------------------------------------
+# ac_fn_check_decl LINENO SYMBOL VAR INCLUDES EXTRA-OPTIONS FLAG-VAR
+# ------------------------------------------------------------------
 # Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
-# accordingly.
-ac_fn_c_check_decl ()
+# accordingly. Pass EXTRA-OPTIONS to the compiler, using FLAG-VAR.
+ac_fn_check_decl ()
 {
+  ac_save_ac_compile="$ac_compile"
+  if test -n "$ac_compile_for_check_decl"; then
+    ac_compile="$ac_compile_for_check_decl"
+  fi
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
   as_decl_name=`echo $2|sed 's/ *(.*//'`
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+printf %s "checking whether $as_decl_name is declared... " >&6; }
+if eval test \${$3+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
-$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
-if eval \${$3+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  eval ac_save_FLAGS=\$$6
+  as_fn_append $6 " $5"
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $4
 int
-main ()
+main (void)
 {
 #ifndef $as_decl_name
 #ifdef __cplusplus
@@ -3061,19 +3473,23 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   eval "$3=yes"
-else
+else $as_nop
   eval "$3=no"
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+  eval $6=\$ac_save_FLAGS
+
 fi
 eval ac_res=\$$3
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  ac_compile="$ac_save_ac_compile"
 
-} # ac_fn_c_check_decl
+} # ac_fn_check_decl
 
 # ac_fn_c_compute_int LINENO EXPR VAR INCLUDES
 # --------------------------------------------
@@ -3089,7 +3505,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $4
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(($2) >= 0)];
 test_array [0] = 0;
@@ -3099,14 +3515,15 @@ return test_array [0];
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_lo=0 ac_mid=0
   while :; do
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $4
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
 test_array [0] = 0;
@@ -3116,9 +3533,10 @@ return test_array [0];
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_hi=$ac_mid; break
-else
+else $as_nop
   as_fn_arith $ac_mid + 1 && ac_lo=$as_val
                        if test $ac_lo -le $ac_mid; then
                          ac_lo= ac_hi=
@@ -3126,14 +3544,14 @@ else
                        fi
                        as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
   done
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $4
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(($2) < 0)];
 test_array [0] = 0;
@@ -3143,14 +3561,15 @@ return test_array [0];
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_hi=-1 ac_mid=-1
   while :; do
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $4
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(($2) >= $ac_mid)];
 test_array [0] = 0;
@@ -3160,9 +3579,10 @@ return test_array [0];
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_lo=$ac_mid; break
-else
+else $as_nop
   as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val
                        if test $ac_mid -le $ac_hi; then
                          ac_lo= ac_hi=
@@ -3170,14 +3590,14 @@ else
                        fi
                        as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
   done
-else
+else $as_nop
   ac_lo= ac_hi=
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 # Binary search between lo and hi bounds.
 while test "x$ac_lo" != "x$ac_hi"; do
   as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val
@@ -3185,7 +3605,7 @@ while test "x$ac_lo" != "x$ac_hi"; do
 /* end confdefs.h.  */
 $4
 int
-main ()
+main (void)
 {
 static int test_array [1 - 2 * !(($2) <= $ac_mid)];
 test_array [0] = 0;
@@ -3195,12 +3615,13 @@ return test_array [0];
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_hi=$ac_mid
-else
+else $as_nop
   as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 done
 case $ac_lo in #((
 ?*) eval "$3=\$ac_lo"; ac_retval=0 ;;
@@ -3210,12 +3631,12 @@ esac
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $4
-static long int longval () { return $2; }
-static unsigned long int ulongval () { return $2; }
+static long int longval (void) { return $2; }
+static unsigned long int ulongval (void) { return $2; }
 #include <stdio.h>
 #include <stdlib.h>
 int
-main ()
+main (void)
 {
 
   FILE *f = fopen ("conftest.val", "w");
@@ -3243,9 +3664,10 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
   echo >>conftest.val; read $3 <conftest.val; ac_retval=0
-else
+else $as_nop
   ac_retval=1
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
@@ -3265,16 +3687,17 @@ rm -f conftest.val
 ac_fn_c_check_member ()
 {
   as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
-$as_echo_n "checking for $2.$3... " >&6; }
-if eval \${$4+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+printf %s "checking for $2.$3... " >&6; }
+if eval test \${$4+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $5
 int
-main ()
+main (void)
 {
 static $2 ac_aggr;
 if (ac_aggr.$3)
@@ -3283,14 +3706,15 @@ return 0;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   eval "$4=yes"
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $5
 int
-main ()
+main (void)
 {
 static $2 ac_aggr;
 if (sizeof ac_aggr.$3)
@@ -3299,29 +3723,50 @@ return 0;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   eval "$4=yes"
-else
+else $as_nop
   eval "$4=no"
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 eval ac_res=\$$4
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
   eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
 
 } # ac_fn_c_check_member
+ac_configure_args_raw=
+for ac_arg
+do
+  case $ac_arg in
+  *\'*)
+    ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  esac
+  as_fn_append ac_configure_args_raw " '$ac_arg'"
+done
+
+case $ac_configure_args_raw in
+  *$as_nl*)
+    ac_safe_unquote= ;;
+  *)
+    ac_unsafe_z='|&;<>()$`\\"*?[ ''    ' # This string ends in space, tab.
+    ac_unsafe_a="$ac_unsafe_z#~"
+    ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
+    ac_configure_args_raw=`      printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
+esac
+
 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 M4 $as_me 1.4.18, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
+It was created by GNU M4 $as_me 1.4.19, which was
+generated by GNU Autoconf 2.71.  Invocation command line was
 
-  $ $0 $@
+  $ $0$ac_configure_args_raw
 
 _ACEOF
 exec 5>>config.log
@@ -3354,8 +3799,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    $as_echo "PATH: $as_dir"
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    printf "%s\n" "PATH: $as_dir"
   done
 IFS=$as_save_IFS
 
@@ -3390,7 +3839,7 @@ do
     | -silent | --silent | --silen | --sile | --sil)
       continue ;;
     *\'*)
-      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     case $ac_pass in
     1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
@@ -3425,11 +3874,13 @@ done
 # WARNING: Use '\'' to represent an apostrophe within the trap.
 # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
 trap 'exit_status=$?
+  # Sanitize IFS.
+  IFS=" ""     $as_nl"
   # Save into config.log some information that might help in debugging.
   {
     echo
 
-    $as_echo "## ---------------- ##
+    printf "%s\n" "## ---------------- ##
 ## Cache variables. ##
 ## ---------------- ##"
     echo
@@ -3440,8 +3891,8 @@ trap 'exit_status=$?
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
@@ -3465,7 +3916,7 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
 )
     echo
 
-    $as_echo "## ----------------- ##
+    printf "%s\n" "## ----------------- ##
 ## Output variables. ##
 ## ----------------- ##"
     echo
@@ -3473,14 +3924,14 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
     do
       eval ac_val=\$$ac_var
       case $ac_val in
-      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
       esac
-      $as_echo "$ac_var='\''$ac_val'\''"
+      printf "%s\n" "$ac_var='\''$ac_val'\''"
     done | sort
     echo
 
     if test -n "$ac_subst_files"; then
-      $as_echo "## ------------------- ##
+      printf "%s\n" "## ------------------- ##
 ## File substitutions. ##
 ## ------------------- ##"
       echo
@@ -3488,15 +3939,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       do
        eval ac_val=\$$ac_var
        case $ac_val in
-       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
        esac
-       $as_echo "$ac_var='\''$ac_val'\''"
+       printf "%s\n" "$ac_var='\''$ac_val'\''"
       done | sort
       echo
     fi
 
     if test -s confdefs.h; then
-      $as_echo "## ----------- ##
+      printf "%s\n" "## ----------- ##
 ## confdefs.h. ##
 ## ----------- ##"
       echo
@@ -3504,8 +3955,8 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       echo
     fi
     test "$ac_signal" != 0 &&
-      $as_echo "$as_me: caught signal $ac_signal"
-    $as_echo "$as_me: exit $exit_status"
+      printf "%s\n" "$as_me: caught signal $ac_signal"
+    printf "%s\n" "$as_me: exit $exit_status"
   } >&5
   rm -f core *.core core.conftest.* &&
     rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
@@ -3519,63 +3970,48 @@ ac_signal=0
 # confdefs.h avoids OS command line length limits that DEFS can exceed.
 rm -f -r conftest* confdefs.h
 
-$as_echo "/* confdefs.h */" > confdefs.h
+printf "%s\n" "/* confdefs.h */" > confdefs.h
 
 # Predefined preprocessor variables.
 
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_NAME "$PACKAGE_NAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
-_ACEOF
+printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_VERSION "$PACKAGE_VERSION"
-_ACEOF
+printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_STRING "$PACKAGE_STRING"
-_ACEOF
+printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
-_ACEOF
+printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_URL "$PACKAGE_URL"
-_ACEOF
+printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
 
 
 # Let the site file select an alternate cache file if it wants to.
 # Prefer an explicitly selected file to automatically selected ones.
-ac_site_file1=NONE
-ac_site_file2=NONE
 if test -n "$CONFIG_SITE"; then
-  # We do not want a PATH search for config.site.
-  case $CONFIG_SITE in #((
-    -*)  ac_site_file1=./$CONFIG_SITE;;
-    */*) ac_site_file1=$CONFIG_SITE;;
-    *)   ac_site_file1=./$CONFIG_SITE;;
-  esac
+  ac_site_files="$CONFIG_SITE"
 elif test "x$prefix" != xNONE; then
-  ac_site_file1=$prefix/share/config.site
-  ac_site_file2=$prefix/etc/config.site
+  ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
 else
-  ac_site_file1=$ac_default_prefix/share/config.site
-  ac_site_file2=$ac_default_prefix/etc/config.site
+  ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
 fi
-for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+
+for ac_site_file in $ac_site_files
 do
-  test "x$ac_site_file" = xNONE && continue
-  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
-$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+  case $ac_site_file in #(
+  */*) :
+     ;; #(
+  *) :
+    ac_site_file=./$ac_site_file ;;
+esac
+  if test -f "$ac_site_file" && test -r "$ac_site_file"; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
     sed 's/^/| /' "$ac_site_file" >&5
     . "$ac_site_file" \
-      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+      || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "failed to load site script $ac_site_file
 See \`config.log' for more details" "$LINENO" 5; }
   fi
@@ -3585,92 +4021,539 @@ if test -r "$cache_file"; then
   # Some versions of bash will fail to source /dev/null (special files
   # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
   if test /dev/null != "$cache_file" && test -f "$cache_file"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
-$as_echo "$as_me: loading cache $cache_file" >&6;}
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
     case $cache_file in
       [\\/]* | ?:[\\/]* ) . "$cache_file";;
       *)                      . "./$cache_file";;
     esac
   fi
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
-$as_echo "$as_me: creating cache $cache_file" >&6;}
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
   >$cache_file
 fi
 
+# Test code for whether the C compiler supports C89 (global declarations)
+ac_c_conftest_c89_globals='
+/* Does the compiler advertise C89 conformance?
+   Do not test the value of __STDC__, because some compilers set it to 0
+   while being otherwise adequately conformant. */
+#if !defined __STDC__
+# error "Compiler does not advertise C89 conformance"
+#endif
+
+#include <stddef.h>
+#include <stdarg.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7 src/conf.sh.  */
+struct buf { int x; };
+struct buf * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not \xHH hex character constants.
+   These do not provoke an error unfortunately, instead are silently treated
+   as an "x".  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously \x00 != x always comes out true, for an
+   array size at least.  It is necessary to write \x00 == 0 to get something
+   that is true only with -std.  */
+int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) '\''x'\''
+int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
+               int, int);'
+
+# Test code for whether the C compiler supports C89 (body of main).
+ac_c_conftest_c89_main='
+ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
+'
+
+# Test code for whether the C compiler supports C99 (global declarations)
+ac_c_conftest_c99_globals='
+// Does the compiler advertise C99 conformance?
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
+# error "Compiler does not advertise C99 conformance"
+#endif
+
+#include <stdbool.h>
+extern int puts (const char *);
+extern int printf (const char *, ...);
+extern int dprintf (int, const char *, ...);
+extern void *malloc (size_t);
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+// dprintf is used instead of fprintf to avoid needing to declare
+// FILE and stderr.
+#define debug(...) dprintf (2, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  #error "your preprocessor is broken"
+#endif
+#if BIG_OK
+#else
+  #error "your preprocessor is broken"
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static bool
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str = "";
+  int number = 0;
+  float fnumber = 0;
+
+  while (*format)
+    {
+      switch (*format++)
+       {
+       case '\''s'\'': // string
+         str = va_arg (args_copy, const char *);
+         break;
+       case '\''d'\'': // int
+         number = va_arg (args_copy, int);
+         break;
+       case '\''f'\'': // float
+         fnumber = va_arg (args_copy, double);
+         break;
+       default:
+         break;
+       }
+    }
+  va_end (args_copy);
+  va_end (args);
+
+  return *str && number && fnumber;
+}
+'
+
+# Test code for whether the C compiler supports C99 (body of main).
+ac_c_conftest_c99_main='
+  // Check bool.
+  _Bool success = false;
+  success |= (argc != 0);
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[0] = argv[0][0];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\''
+        || dynamic_array[ni.number - 1] != 543);
+'
+
+# Test code for whether the C compiler supports C11 (global declarations)
+ac_c_conftest_c11_globals='
+// Does the compiler advertise C11 conformance?
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
+# error "Compiler does not advertise C11 conformance"
+#endif
+
+// Check _Alignas.
+char _Alignas (double) aligned_as_double;
+char _Alignas (0) no_special_alignment;
+extern char aligned_as_int;
+char _Alignas (0) _Alignas (int) aligned_as_int;
+
+// Check _Alignof.
+enum
+{
+  int_alignment = _Alignof (int),
+  int_array_alignment = _Alignof (int[100]),
+  char_alignment = _Alignof (char)
+};
+_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
+
+// Check _Noreturn.
+int _Noreturn does_not_return (void) { for (;;) continue; }
+
+// Check _Static_assert.
+struct test_static_assert
+{
+  int x;
+  _Static_assert (sizeof (int) <= sizeof (long int),
+                  "_Static_assert does not work in struct");
+  long int y;
+};
+
+// Check UTF-8 literals.
+#define u8 syntax error!
+char const utf8_literal[] = u8"happens to be ASCII" "another string";
+
+// Check duplicate typedefs.
+typedef long *long_ptr;
+typedef long int *long_ptr;
+typedef long_ptr long_ptr;
+
+// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
+struct anonymous
+{
+  union {
+    struct { int i; int j; };
+    struct { int k; long int l; } w;
+  };
+  int m;
+} v1;
+'
+
+# Test code for whether the C compiler supports C11 (body of main).
+ac_c_conftest_c11_main='
+  _Static_assert ((offsetof (struct anonymous, i)
+                  == offsetof (struct anonymous, w.k)),
+                 "Anonymous union alignment botch");
+  v1.i = 2;
+  v1.w.k = 5;
+  ok |= v1.i != 5;
+'
+
+# Test code for whether the C compiler supports C11 (complete).
+ac_c_conftest_c11_program="${ac_c_conftest_c89_globals}
+${ac_c_conftest_c99_globals}
+${ac_c_conftest_c11_globals}
+
+int
+main (int argc, char **argv)
+{
+  int ok = 0;
+  ${ac_c_conftest_c89_main}
+  ${ac_c_conftest_c99_main}
+  ${ac_c_conftest_c11_main}
+  return ok;
+}
+"
+
+# Test code for whether the C compiler supports C99 (complete).
+ac_c_conftest_c99_program="${ac_c_conftest_c89_globals}
+${ac_c_conftest_c99_globals}
+
+int
+main (int argc, char **argv)
+{
+  int ok = 0;
+  ${ac_c_conftest_c89_main}
+  ${ac_c_conftest_c99_main}
+  return ok;
+}
+"
+
+# Test code for whether the C compiler supports C89 (complete).
+ac_c_conftest_c89_program="${ac_c_conftest_c89_globals}
+
+int
+main (int argc, char **argv)
+{
+  int ok = 0;
+  ${ac_c_conftest_c89_main}
+  return ok;
+}
+"
+
+as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H"
+as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H"
+as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H"
+as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H"
+as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H"
+as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H"
+as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
+as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
+as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
+as_fn_append ac_header_c_list " wchar.h wchar_h HAVE_WCHAR_H"
+as_fn_append ac_header_c_list " minix/config.h minix_config_h HAVE_MINIX_CONFIG_H"
 gl_use_threads_default=no
-as_fn_append ac_func_list " btowc"
-as_fn_append ac_func_list " setrlimit"
-as_fn_append ac_header_list " ucontext.h"
-as_fn_append ac_func_list " sigaltstack"
-as_fn_append ac_header_list " unistd.h"
-as_fn_append ac_func_list " canonicalize_file_name"
-as_fn_append ac_func_list " getcwd"
-as_fn_append ac_func_list " readlink"
-as_fn_append ac_func_list " realpath"
-as_fn_append ac_header_list " sys/param.h"
-as_fn_append ac_func_list " _set_invalid_parameter_handler"
-as_fn_append ac_header_list " sys/socket.h"
-as_fn_append ac_func_list " fcntl"
-as_fn_append ac_func_list " symlink"
-as_fn_append ac_func_list " mempcpy"
-as_fn_append ac_header_list " stdio_ext.h"
-as_fn_append ac_func_list " fpurge"
-as_fn_append ac_func_list " __fpurge"
-as_fn_append ac_func_list " __freadahead"
-as_fn_append ac_func_list " __freading"
-as_fn_append ac_header_list " sys/stat.h"
-as_fn_append ac_func_list " getdtablesize"
+as_fn_append ac_header_c_list " pthread.h pthread_h HAVE_PTHREAD_H"
+as_fn_append ac_func_c_list " btowc HAVE_BTOWC"
+as_fn_append ac_func_c_list " canonicalize_file_name HAVE_CANONICALIZE_FILE_NAME"
+as_fn_append ac_func_c_list " faccessat HAVE_FACCESSAT"
+as_fn_append ac_func_c_list " realpath HAVE_REALPATH"
+as_fn_append ac_func_c_list " lstat HAVE_LSTAT"
+as_fn_append ac_header_c_list " sys/param.h sys_param_h HAVE_SYS_PARAM_H"
+as_fn_append ac_func_c_list " _set_invalid_parameter_handler HAVE__SET_INVALID_PARAMETER_HANDLER"
+as_fn_append ac_header_c_list " sys/socket.h sys_socket_h HAVE_SYS_SOCKET_H"
+as_fn_append ac_func_c_list " fchdir HAVE_FCHDIR"
+as_fn_append ac_header_c_list " dirent.h dirent_h HAVE_DIRENT_H"
+as_fn_append ac_func_c_list " fcntl HAVE_FCNTL"
+as_fn_append ac_func_c_list " symlink HAVE_SYMLINK"
+as_fn_append ac_func_c_list " fdopendir HAVE_FDOPENDIR"
+as_fn_append ac_func_c_list " mempcpy HAVE_MEMPCPY"
+as_fn_append ac_header_c_list " stdio_ext.h stdio_ext_h HAVE_STDIO_EXT_H"
+as_fn_append ac_func_c_list " fpurge HAVE_FPURGE"
+as_fn_append ac_func_c_list " __fpurge HAVE___FPURGE"
+as_fn_append ac_func_c_list " __freadahead HAVE___FREADAHEAD"
+as_fn_append ac_func_c_list " __freading HAVE___FREADING"
+as_fn_append ac_func_c_list " fstatat HAVE_FSTATAT"
+as_fn_append ac_func_c_list " getdtablesize HAVE_GETDTABLESIZE"
 gl_getopt_required=GNU
-as_fn_append ac_header_list " getopt.h"
-as_fn_append ac_func_list " getprogname"
-as_fn_append ac_func_list " getexecname"
-as_fn_append ac_header_list " sys/time.h"
-as_fn_append ac_func_list " gettimeofday"
-as_fn_append ac_header_list " langinfo.h"
-as_fn_append ac_header_list " limits.h"
-as_fn_append ac_header_list " xlocale.h"
-as_fn_append ac_func_list " lstat"
-as_fn_append ac_header_list " math.h"
-as_fn_append ac_func_list " mbsinit"
-as_fn_append ac_func_list " mbrtowc"
-as_fn_append ac_header_list " sys/mman.h"
-as_fn_append ac_func_list " mprotect"
-as_fn_append ac_func_list " mkstemp"
-as_fn_append ac_func_list " nl_langinfo"
-as_fn_append ac_func_list " pipe2"
+as_fn_append ac_header_c_list " getopt.h getopt_h HAVE_GETOPT_H"
+as_fn_append ac_header_c_list " sys/cdefs.h sys_cdefs_h HAVE_SYS_CDEFS_H"
+as_fn_append ac_func_c_list " getprogname HAVE_GETPROGNAME"
+as_fn_append ac_func_c_list " getexecname HAVE_GETEXECNAME"
+as_fn_append ac_func_c_list " getrandom HAVE_GETRANDOM"
+as_fn_append ac_header_c_list " threads.h threads_h HAVE_THREADS_H"
+as_fn_append ac_header_c_list " iconv.h iconv_h HAVE_ICONV_H"
+as_fn_append ac_header_c_list " limits.h limits_h HAVE_LIMITS_H"
+as_fn_append ac_func_c_list " iswcntrl HAVE_ISWCNTRL"
+as_fn_append ac_header_c_list " crtdefs.h crtdefs_h HAVE_CRTDEFS_H"
+as_fn_append ac_header_c_list " wctype.h wctype_h HAVE_WCTYPE_H"
+as_fn_append ac_func_c_list " iswblank HAVE_ISWBLANK"
+as_fn_append ac_header_c_list " langinfo.h langinfo_h HAVE_LANGINFO_H"
+as_fn_append ac_header_c_list " xlocale.h xlocale_h HAVE_XLOCALE_H"
+as_fn_append ac_func_c_list " uselocale HAVE_USELOCALE"
+as_fn_append ac_func_c_list " newlocale HAVE_NEWLOCALE"
+as_fn_append ac_func_c_list " duplocale HAVE_DUPLOCALE"
+as_fn_append ac_func_c_list " freelocale HAVE_FREELOCALE"
+as_fn_append ac_header_c_list " math.h math_h HAVE_MATH_H"
+as_fn_append ac_func_c_list " mbsinit HAVE_MBSINIT"
+as_fn_append ac_func_c_list " mbrtowc HAVE_MBRTOWC"
+as_fn_append ac_func_c_list " mbslen HAVE_MBSLEN"
+as_fn_append ac_header_c_list " sys/mman.h sys_mman_h HAVE_SYS_MMAN_H"
+as_fn_append ac_func_c_list " mprotect HAVE_MPROTECT"
+as_fn_append ac_func_c_list " mkstemp HAVE_MKSTEMP"
+as_fn_append ac_func_c_list " nl_langinfo HAVE_NL_LANGINFO"
+as_fn_append ac_func_c_list " openat HAVE_OPENAT"
+as_fn_append ac_func_c_list " pipe HAVE_PIPE"
+as_fn_append ac_func_c_list " pipe2 HAVE_PIPE2"
+as_fn_append ac_func_c_list " posix_spawn_file_actions_addchdir_np HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP"
+as_fn_append ac_func_c_list " posix_spawn_file_actions_addchdir HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR"
 gl_printf_safe=yes
-as_fn_append ac_header_list " malloc.h"
-as_fn_append ac_func_list " isblank"
-as_fn_append ac_func_list " iswctype"
-as_fn_append ac_func_list " link"
-as_fn_append ac_header_list " sys/cdefs.h"
-as_fn_append ac_func_list " secure_getenv"
-as_fn_append ac_func_list " getuid"
-as_fn_append ac_func_list " geteuid"
-as_fn_append ac_func_list " getgid"
-as_fn_append ac_func_list " getegid"
-as_fn_append ac_func_list " sigaction"
-as_fn_append ac_func_list " siginterrupt"
-as_fn_append ac_func_list " snprintf"
-as_fn_append ac_header_list " spawn.h"
-as_fn_append ac_header_list " wchar.h"
-as_fn_append ac_header_list " stdint.h"
-as_fn_append ac_func_list " strndup"
-as_fn_append ac_header_list " sys/wait.h"
-as_fn_append ac_func_list " pipe"
-as_fn_append ac_func_list " vasnprintf"
-as_fn_append ac_header_list " features.h"
-as_fn_append ac_func_list " wcrtomb"
-as_fn_append ac_func_list " iswcntrl"
-as_fn_append ac_header_list " wctype.h"
-as_fn_append ac_header_list " dirent.h"
-as_fn_append ac_header_list " inttypes.h"
-as_fn_append ac_func_list " newlocale"
-as_fn_append ac_func_list " setenv"
-as_fn_append ac_func_list " sleep"
-as_fn_append ac_func_list " strdup"
-as_fn_append ac_func_list " wctob"
+as_fn_append ac_func_c_list " readlink HAVE_READLINK"
+as_fn_append ac_header_c_list " malloc.h malloc_h HAVE_MALLOC_H"
+as_fn_append ac_func_c_list " isblank HAVE_ISBLANK"
+as_fn_append ac_func_c_list " iswctype HAVE_ISWCTYPE"
+as_fn_append ac_func_c_list " link HAVE_LINK"
+as_fn_append ac_func_c_list " secure_getenv HAVE_SECURE_GETENV"
+as_fn_append ac_func_c_list " getuid HAVE_GETUID"
+as_fn_append ac_func_c_list " geteuid HAVE_GETEUID"
+as_fn_append ac_func_c_list " getgid HAVE_GETGID"
+as_fn_append ac_func_c_list " getegid HAVE_GETEGID"
+as_fn_append ac_func_c_list " sigaction HAVE_SIGACTION"
+as_fn_append ac_func_c_list " sigaltstack HAVE_SIGALTSTACK"
+as_fn_append ac_func_c_list " siginterrupt HAVE_SIGINTERRUPT"
+as_fn_append ac_func_c_list " setrlimit HAVE_SETRLIMIT"
+as_fn_append ac_func_c_list " getrlimit HAVE_GETRLIMIT"
+as_fn_append ac_func_c_list " snprintf HAVE_SNPRINTF"
+as_fn_append ac_header_c_list " spawn.h spawn_h HAVE_SPAWN_H"
+as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H"
+as_fn_append ac_func_c_list " strerror_r HAVE_STRERROR_R"
+as_fn_append ac_func_c_list " __xpg_strerror_r HAVE___XPG_STRERROR_R"
+as_fn_append ac_func_c_list " strndup HAVE_STRNDUP"
+as_fn_append ac_header_c_list " sys/random.h sys_random_h HAVE_SYS_RANDOM_H"
+as_fn_append ac_header_c_list " sys/wait.h sys_wait_h HAVE_SYS_WAIT_H"
+as_fn_append ac_func_c_list " vasnprintf HAVE_VASNPRINTF"
+as_fn_append ac_header_c_list " features.h features_h HAVE_FEATURES_H"
+as_fn_append ac_func_c_list " wcrtomb HAVE_WCRTOMB"
+as_fn_append ac_func_c_list " wcwidth HAVE_WCWIDTH"
+as_fn_append ac_header_c_list " arpa/inet.h arpa_inet_h HAVE_ARPA_INET_H"
+as_fn_append ac_header_c_list " semaphore.h semaphore_h HAVE_SEMAPHORE_H"
+as_fn_append ac_func_c_list " explicit_bzero HAVE_EXPLICIT_BZERO"
+as_fn_append ac_func_c_list " memset_s HAVE_MEMSET_S"
+as_fn_append ac_func_c_list " ftruncate HAVE_FTRUNCATE"
+as_fn_append ac_func_c_list " gettimeofday HAVE_GETTIMEOFDAY"
+as_fn_append ac_header_c_list " netdb.h netdb_h HAVE_NETDB_H"
+as_fn_append ac_header_c_list " netinet/in.h netinet_in_h HAVE_NETINET_IN_H"
+as_fn_append ac_header_c_list " sys/select.h sys_select_h HAVE_SYS_SELECT_H"
+as_fn_append ac_func_c_list " pthread_sigmask HAVE_PTHREAD_SIGMASK"
+as_fn_append ac_func_c_list " setenv HAVE_SETENV"
+as_fn_append ac_func_c_list " sleep HAVE_SLEEP"
+as_fn_append ac_func_c_list " catgets HAVE_CATGETS"
+as_fn_append ac_header_c_list " sys/ioctl.h sys_ioctl_h HAVE_SYS_IOCTL_H"
+as_fn_append ac_func_c_list " shutdown HAVE_SHUTDOWN"
+as_fn_append ac_header_c_list " sys/uio.h sys_uio_h HAVE_SYS_UIO_H"
+as_fn_append ac_func_c_list " mquery HAVE_MQUERY"
+as_fn_append ac_func_c_list " pstat_getprocvm HAVE_PSTAT_GETPROCVM"
+as_fn_append ac_func_c_list " wctob HAVE_WCTOB"
+gt_needs="$gt_needs need-formatstring-macros"
+
+# Auxiliary files required by this configure script.
+ac_aux_files="config.rpath config.guess config.sub compile missing install-sh"
+
+# Locations in which to look for auxiliary files.
+ac_aux_dir_candidates="${srcdir}/build-aux"
+
+# Search for a directory containing all of the required auxiliary files,
+# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.
+# If we don't find one directory that contains all the files we need,
+# we report the set of missing files from the *first* directory in
+# $ac_aux_dir_candidates and give up.
+ac_missing_aux_files=""
+ac_first_candidate=:
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in $ac_aux_dir_candidates
+do
+  IFS=$as_save_IFS
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+  as_found=:
+
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}:  trying $as_dir" >&5
+  ac_aux_dir_found=yes
+  ac_install_sh=
+  for ac_aux in $ac_aux_files
+  do
+    # As a special case, if "install-sh" is required, that requirement
+    # can be satisfied by any of "install-sh", "install.sh", or "shtool",
+    # and $ac_install_sh is set appropriately for whichever one is found.
+    if test x"$ac_aux" = x"install-sh"
+    then
+      if test -f "${as_dir}install-sh"; then
+        printf "%s\n" "$as_me:${as_lineno-$LINENO}:   ${as_dir}install-sh found" >&5
+        ac_install_sh="${as_dir}install-sh -c"
+      elif test -f "${as_dir}install.sh"; then
+        printf "%s\n" "$as_me:${as_lineno-$LINENO}:   ${as_dir}install.sh found" >&5
+        ac_install_sh="${as_dir}install.sh -c"
+      elif test -f "${as_dir}shtool"; then
+        printf "%s\n" "$as_me:${as_lineno-$LINENO}:   ${as_dir}shtool found" >&5
+        ac_install_sh="${as_dir}shtool install -c"
+      else
+        ac_aux_dir_found=no
+        if $ac_first_candidate; then
+          ac_missing_aux_files="${ac_missing_aux_files} install-sh"
+        else
+          break
+        fi
+      fi
+    else
+      if test -f "${as_dir}${ac_aux}"; then
+        printf "%s\n" "$as_me:${as_lineno-$LINENO}:   ${as_dir}${ac_aux} found" >&5
+      else
+        ac_aux_dir_found=no
+        if $ac_first_candidate; then
+          ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}"
+        else
+          break
+        fi
+      fi
+    fi
+  done
+  if test "$ac_aux_dir_found" = yes; then
+    ac_aux_dir="$as_dir"
+    break
+  fi
+  ac_first_candidate=false
+
+  as_found=false
+done
+IFS=$as_save_IFS
+if $as_found
+then :
+
+else $as_nop
+  as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5
+fi
+
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+if test -f "${ac_aux_dir}config.guess"; then
+  ac_config_guess="$SHELL ${ac_aux_dir}config.guess"
+fi
+if test -f "${ac_aux_dir}config.sub"; then
+  ac_config_sub="$SHELL ${ac_aux_dir}config.sub"
+fi
+if test -f "$ac_aux_dir/configure"; then
+  ac_configure="$SHELL ${ac_aux_dir}configure"
+fi
+
 # Check that the precious variables saved in the cache have kept the same
 # value.
 ac_cache_corrupted=false
@@ -3681,12 +4564,12 @@ for ac_var in $ac_precious_vars; do
   eval ac_new_val=\$ac_env_${ac_var}_value
   case $ac_old_set,$ac_new_set in
     set,)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,set)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
-$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
       ac_cache_corrupted=: ;;
     ,);;
     *)
@@ -3695,24 +4578,24 @@ $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
        ac_old_val_w=`echo x $ac_old_val`
        ac_new_val_w=`echo x $ac_new_val`
        if test "$ac_old_val_w" != "$ac_new_val_w"; then
-         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
-$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
          ac_cache_corrupted=:
        else
-         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
-$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
          eval $ac_var=\$ac_old_val
        fi
-       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
-$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
-       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
-$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+printf "%s\n" "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+printf "%s\n" "$as_me:   current value: \`$ac_new_val'" >&2;}
       fi;;
   esac
   # Pass precious variables to config.status.
   if test "$ac_new_set" = set; then
     case $ac_new_val in
-    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
     *) ac_arg=$ac_var=$ac_new_val ;;
     esac
     case " $ac_configure_args " in
@@ -3722,11 +4605,12 @@ $as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
   fi
 done
 if $ac_cache_corrupted; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
-$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
-  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'
+           and start over" "$LINENO" 5
 fi
 ## -------------------- ##
 ## Main body of script. ##
@@ -3739,39 +4623,13 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-ac_aux_dir=
-for ac_dir in build-aux "$srcdir"/build-aux; do
-  if test -f "$ac_dir/install-sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install-sh -c"
-    break
-  elif test -f "$ac_dir/install.sh"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/install.sh -c"
-    break
-  elif test -f "$ac_dir/shtool"; then
-    ac_aux_dir=$ac_dir
-    ac_install_sh="$ac_aux_dir/shtool install -c"
-    break
-  fi
-done
-if test -z "$ac_aux_dir"; then
-  as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5
-fi
 
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
+am__api_version='1.16'
 
 
-am__api_version='1.15'
 
-# Find a good install program.  We prefer a C program (faster),
+  # Find a good install program.  We prefer a C program (faster),
 # so one script is as good as another.  But avoid the broken or
 # incompatible versions:
 # SysV /etc/install, /usr/sbin/install
@@ -3785,20 +4643,25 @@ am__api_version='1.15'
 # OS/2's system install, which has a completely different semantic
 # ./install, which can be erroneously created by make from ./install.sh.
 # Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+printf %s "checking for a BSD-compatible install... " >&6; }
 if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+if test ${ac_cv_path_install+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
-  ./ | .// | /[cC]/* | \
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    # Account for fact that we put trailing slashes in our PATH walk.
+case $as_dir in #((
+  ./ | /[cC]/* | \
   /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
   ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
   /usr/ucb/* ) ;;
@@ -3808,13 +4671,13 @@ case $as_dir/ in #((
     # by default.
     for ac_prog in ginstall scoinst install; do
       for ac_exec_ext in '' $ac_executable_extensions; do
-       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+       if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then
          if test $ac_prog = install &&
-           grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # AIX install.  It has an incompatible calling convention.
            :
          elif test $ac_prog = install &&
-           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
            # program-specific install script used by HP pwplus--don't use.
            :
          else
@@ -3822,12 +4685,12 @@ case $as_dir/ in #((
            echo one > conftest.one
            echo two > conftest.two
            mkdir conftest.dir
-           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+           if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" &&
              test -s conftest.one && test -s conftest.two &&
              test -s conftest.dir/conftest.one &&
              test -s conftest.dir/conftest.two
            then
-             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c"
              break 3
            fi
          fi
@@ -3843,7 +4706,7 @@ IFS=$as_save_IFS
 rm -rf conftest.one conftest.two conftest.dir
 
 fi
-  if test "${ac_cv_path_install+set}" = set; then
+  if test ${ac_cv_path_install+y}; then
     INSTALL=$ac_cv_path_install
   else
     # As a last resort, use the slow shell script.  Don't cache a
@@ -3853,8 +4716,8 @@ fi
     INSTALL=$ac_install_sh
   fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+printf "%s\n" "$INSTALL" >&6; }
 
 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
 # It thinks the first close brace ends the variable substitution.
@@ -3864,8 +4727,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+printf %s "checking whether build environment is sane... " >&6; }
 # Reject unsafe characters in $srcdir or the absolute working directory
 # name.  Accept space and tab only in the latter.
 am_lf='
@@ -3919,8 +4782,8 @@ else
    as_fn_error $? "newly created file is older than distributed files!
 Check your system clock" "$LINENO" 5
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
 # If we didn't sleep, we still need to ensure time stamps of config.status and
 # generated files are strictly newer.
 am_sleep_pid=
@@ -3939,26 +4802,23 @@ test "$program_suffix" != NONE &&
 # Double any \ or $.
 # By default was `s,x,x', remove it if useless.
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+program_transform_name=`printf "%s\n" "$program_transform_name" | sed "$ac_script"`
+
 
 # Expand $ac_aux_dir to an absolute path.
 am_aux_dir=`cd "$ac_aux_dir" && pwd`
 
-if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\    *)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
+
+  if test x"${MISSING+set}" != xset; then
+  MISSING="\${SHELL} '$am_aux_dir/missing'"
 fi
 # Use eval to expand $SHELL
 if eval "$MISSING --is-lightweight"; then
   am_missing_run="$MISSING "
 else
   am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+printf "%s\n" "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
 fi
 
 if test x"${install_sh+set}" != xset; then
@@ -3978,11 +4838,12 @@ if test "$cross_compiling" != no; then
   if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_STRIP+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$STRIP"; then
   ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
 else
@@ -3990,11 +4851,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4005,11 +4870,11 @@ fi
 fi
 STRIP=$ac_cv_prog_STRIP
 if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+printf "%s\n" "$STRIP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
 
@@ -4018,11 +4883,12 @@ if test -z "$ac_cv_prog_STRIP"; then
   ac_ct_STRIP=$STRIP
   # Extract the first word of "strip", so it can be a program name with args.
 set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_STRIP+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$ac_ct_STRIP"; then
   ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
 else
@@ -4030,11 +4896,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4045,11 +4915,11 @@ fi
 fi
 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
 if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+printf "%s\n" "$ac_ct_STRIP" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
   if test "x$ac_ct_STRIP" = x; then
@@ -4057,8 +4927,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     STRIP=$ac_ct_STRIP
@@ -4070,25 +4940,31 @@ fi
 fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a race-free mkdir -p" >&5
+printf %s "checking for a race-free mkdir -p... " >&6; }
 if test -z "$MKDIR_P"; then
-  if ${ac_cv_path_mkdir+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  if test ${ac_cv_path_mkdir+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_prog in mkdir gmkdir; do
         for ac_exec_ext in '' $ac_executable_extensions; do
-          as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
-          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
-            'mkdir (GNU coreutils) '* | \
-            'mkdir (coreutils) '* | \
+          as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext" || continue
+          case `"$as_dir$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir ('*'coreutils) '* | \
+            'BusyBox '* | \
             'mkdir (fileutils) '4.1*)
-              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              ac_cv_path_mkdir=$as_dir$ac_prog$ac_exec_ext
               break 3;;
           esac
         done
@@ -4099,7 +4975,7 @@ IFS=$as_save_IFS
 fi
 
   test -d ./--version && rmdir ./--version
-  if test "${ac_cv_path_mkdir+set}" = set; then
+  if test ${ac_cv_path_mkdir+y}; then
     MKDIR_P="$ac_cv_path_mkdir -p"
   else
     # As a last resort, use the slow shell script.  Don't cache a
@@ -4109,18 +4985,19 @@ fi
     MKDIR_P="$ac_install_sh -d"
   fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+printf "%s\n" "$MKDIR_P" >&6; }
 
 for ac_prog in gawk mawk nawk awk
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AWK+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$AWK"; then
   ac_cv_prog_AWK="$AWK" # Let the user override the test.
 else
@@ -4128,11 +5005,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4143,24 +5024,25 @@ fi
 fi
 AWK=$ac_cv_prog_AWK
 if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+printf "%s\n" "$AWK" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
 
   test -n "$AWK" && break
 done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+printf %s "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
 set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval test \${ac_cv_prog_make_${ac_make}_set+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat >conftest.make <<\_ACEOF
 SHELL = /bin/sh
 all:
@@ -4176,12 +5058,12 @@ esac
 rm -f conftest.make
 fi
 if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
   SET_MAKE=
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
   SET_MAKE="MAKE=${MAKE-make}"
 fi
 
@@ -4195,7 +5077,8 @@ fi
 rmdir .tst 2>/dev/null
 
 # Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
+if test ${enable_silent_rules+y}
+then :
   enableval=$enable_silent_rules;
 fi
 
@@ -4205,12 +5088,13 @@ case $enable_silent_rules in # (((
     *) AM_DEFAULT_VERBOSITY=1;;
 esac
 am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if $as_echo 'TRUE=$(BAR$(V))
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+printf %s "checking whether $am_make supports nested variables... " >&6; }
+if test ${am_cv_make_support_nested_variables+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if printf "%s\n" 'TRUE=$(BAR$(V))
 BAR0=false
 BAR1=true
 V=1
@@ -4222,8 +5106,8 @@ else
   am_cv_make_support_nested_variables=no
 fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
 if test $am_cv_make_support_nested_variables = yes; then
     AM_V='$(V)'
   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
@@ -4255,17 +5139,13 @@ fi
 
 # Define the identity of the package.
  PACKAGE='m4'
- VERSION='1.4.18'
+ VERSION='1.4.19'
 
 
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
+printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
 
 
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
+printf "%s\n" "#define VERSION \"$VERSION\"" >>confdefs.h
 
 # Some tools Automake needs.
 
@@ -4285,8 +5165,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
 
 # For better backward compatibility.  To be removed once Automake 1.9.x
 # dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <https://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 mkdir_p='$(MKDIR_P)'
 
 # We need awk for the "check" target (and possibly the TAP driver).  The
@@ -4337,7 +5217,7 @@ END
 Aborting the configuration process, to ensure you take notice of the issue.
 
 You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+that behaves properly: <https://www.gnu.org/software/coreutils/>.
 
 If you want to complete the configuration process using your problematic
 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
@@ -4349,7 +5229,8 @@ END
 fi
 
 # Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
+if test ${enable_silent_rules+y}
+then :
   enableval=$enable_silent_rules;
 fi
 
@@ -4359,12 +5240,13 @@ case $enable_silent_rules in # (((
     *) AM_DEFAULT_VERBOSITY=0;;
 esac
 am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if $as_echo 'TRUE=$(BAR$(V))
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+printf %s "checking whether $am_make supports nested variables... " >&6; }
+if test ${am_cv_make_support_nested_variables+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if printf "%s\n" 'TRUE=$(BAR$(V))
 BAR0=false
 BAR1=true
 V=1
@@ -4376,8 +5258,8 @@ else
   am_cv_make_support_nested_variables=no
 fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+printf "%s\n" "$am_cv_make_support_nested_variables" >&6; }
 if test $am_cv_make_support_nested_variables = yes; then
     AM_V='$(V)'
   AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
@@ -4394,6 +5276,15 @@ AM_BACKSLASH='\'
 ac_config_headers="$ac_config_headers lib/config.h:lib/config.hin"
 
 
+
+
+
+
+
+
+
+
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4402,11 +5293,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
@@ -4414,11 +5306,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4429,11 +5325,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
 
@@ -4442,11 +5338,12 @@ if test -z "$ac_cv_prog_CC"; then
   ac_ct_CC=$CC
   # Extract the first word of "gcc", so it can be a program name with args.
 set dummy gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
@@ -4454,11 +5351,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="gcc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4469,11 +5370,11 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
   if test "x$ac_ct_CC" = x; then
@@ -4481,8 +5382,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -4495,11 +5396,12 @@ if test -z "$CC"; then
           if test -n "$ac_tool_prefix"; then
     # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
@@ -4507,11 +5409,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4522,11 +5428,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
 
@@ -4535,11 +5441,12 @@ fi
 if test -z "$CC"; then
   # Extract the first word of "cc", so it can be a program name with args.
 set dummy cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
@@ -4548,15 +5455,19 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+    if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
        ac_prog_rejected=yes
        continue
      fi
     ac_cv_prog_CC="cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4572,18 +5483,18 @@ if test $ac_prog_rejected = yes; then
     # However, it has the same basename, so the bogon will be chosen
     # first if we set CC to just the basename; use the full file name.
     shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+    ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
   fi
 fi
 fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
 
@@ -4594,11 +5505,12 @@ if test -z "$CC"; then
   do
     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$CC"; then
   ac_cv_prog_CC="$CC" # Let the user override the test.
 else
@@ -4606,11 +5518,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4621,11 +5537,11 @@ fi
 fi
 CC=$ac_cv_prog_CC
 if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
 
@@ -4638,11 +5554,12 @@ if test -z "$CC"; then
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$ac_ct_CC"; then
   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
 else
@@ -4650,11 +5567,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -4665,11 +5586,11 @@ fi
 fi
 ac_ct_CC=$ac_cv_prog_ac_ct_CC
 if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
 
@@ -4681,8 +5602,8 @@ done
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     CC=$ac_ct_CC
@@ -4690,25 +5611,129 @@ esac
 fi
 
 fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
+set dummy ${ac_tool_prefix}clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}clang"
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+printf "%s\n" "$CC" >&6; }
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "clang", so it can be a program name with args.
+set dummy clang; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="clang"
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+printf "%s\n" "$ac_ct_CC" >&6; }
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+fi
+
+
+test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "no acceptable C compiler found in \$PATH
 See \`config.log' for more details" "$LINENO" 5; }
 
 # Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
 set X $ac_compile
 ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
+for ac_option in --version -v -V -qversion -version; do
   { { ac_try="$ac_compiler $ac_option >&5"
 case "(($ac_try" in
   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
   (eval "$ac_compiler $ac_option >&5") 2>conftest.err
   ac_status=$?
   if test -s conftest.err; then
@@ -4718,7 +5743,7 @@ $as_echo "$ac_try_echo"; } >&5
     cat conftest.er1 >&5
   fi
   rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
 done
 
@@ -4726,7 +5751,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -4738,9 +5763,9 @@ ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
 # Try to create an executable without -o first, disregard a.out.
 # It will help us diagnose broken compilers, and finding out an intuition
 # of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+printf %s "checking whether the C compiler works... " >&6; }
+ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
 # The possible output files:
 ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
@@ -4761,11 +5786,12 @@ case "(($ac_try" in
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
   (eval "$ac_link_default") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+then :
   # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
 # So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
 # in a Makefile.  We should not override ac_cv_exeext if it was cached,
@@ -4782,7 +5808,7 @@ do
        # certainly right.
        break;;
     *.* )
-       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
        then :; else
           ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
        fi
@@ -4798,44 +5824,46 @@ do
 done
 test "$ac_cv_exeext" = no && ac_cv_exeext=
 
-else
+else $as_nop
   ac_file=''
 fi
-if test -z "$ac_file"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
+if test -z "$ac_file"
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+printf "%s\n" "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error 77 "C compiler cannot create executables
 See \`config.log' for more details" "$LINENO" 5; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
+else $as_nop
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+printf %s "checking for C compiler default output file name... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+printf "%s\n" "$ac_file" >&6; }
 ac_exeext=$ac_cv_exeext
 
 rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
 ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+printf %s "checking for suffix of executables... " >&6; }
 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:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+then :
   # If both `conftest.exe' and `conftest' are `present' (well, observable)
 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
 # work properly (i.e., refer to `conftest.exe'), while it won't with
@@ -4849,15 +5877,15 @@ for ac_file in conftest.exe conftest conftest.*; do
     * ) break;;
   esac
 done
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+else $as_nop
+  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of executables: cannot compile and link
 See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+printf "%s\n" "$ac_cv_exeext" >&6; }
 
 rm -f conftest.$ac_ext
 EXEEXT=$ac_cv_exeext
@@ -4866,7 +5894,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
 int
-main ()
+main (void)
 {
 FILE *f = fopen ("conftest.out", "w");
  return ferror (f) || fclose (f) != 0;
@@ -4878,8 +5906,8 @@ _ACEOF
 ac_clean_files="$ac_clean_files conftest.out"
 # Check that the compiler produces executables we can run.  If not, either
 # the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+printf %s "checking whether we are cross compiling... " >&6; }
 if test "$cross_compiling" != yes; then
   { { ac_try="$ac_link"
 case "(($ac_try" in
@@ -4887,10 +5915,10 @@ case "(($ac_try" in
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
   (eval "$ac_link") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }
   if { ac_try='./conftest$ac_cv_exeext'
   { { case "(($ac_try" in
@@ -4898,39 +5926,40 @@ $as_echo "$ac_try_echo"; } >&5
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
   (eval "$ac_try") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }; then
     cross_compiling=no
   else
     if test "$cross_compiling" = maybe; then
        cross_compiling=yes
     else
-       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
+       { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "cannot run C compiled programs.
 If you meant to cross compile, use \`--host'.
 See \`config.log' for more details" "$LINENO" 5; }
     fi
   fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+printf "%s\n" "$cross_compiling" >&6; }
 
 rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
 ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+printf %s "checking for suffix of object files... " >&6; }
+if test ${ac_cv_objext+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -4944,11 +5973,12 @@ case "(($ac_try" in
   *) ac_try_echo=$ac_try;;
 esac
 eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
+printf "%s\n" "$ac_try_echo"; } >&5
   (eval "$ac_compile") 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+then :
   for ac_file in conftest.o conftest.obj conftest.*; do
   test -f "$ac_file" || continue;
   case $ac_file in
@@ -4957,31 +5987,32 @@ $as_echo "$ac_try_echo"; } >&5
        break;;
   esac
 done
-else
-  $as_echo "$as_me: failed program was:" >&5
+else $as_nop
+  printf "%s\n" "$as_me: failed program was:" >&5
 sed 's/^/| /' conftest.$ac_ext >&5
 
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot compute suffix of object files: cannot compile
 See \`config.log' for more details" "$LINENO" 5; }
 fi
 rm -f conftest.$ac_cv_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+printf "%s\n" "$ac_cv_objext" >&6; }
 OBJEXT=$ac_cv_objext
 ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
+printf %s "checking whether the compiler supports GNU C... " >&6; }
+if test ${ac_cv_c_compiler_gnu+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 #ifndef __GNUC__
        choke me
@@ -4991,29 +6022,33 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_compiler_gnu=yes
-else
+else $as_nop
   ac_compiler_gnu=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
 if test $ac_compiler_gnu = yes; then
   GCC=yes
 else
   GCC=
 fi
-ac_test_CFLAGS=${CFLAGS+set}
+ac_test_CFLAGS=${CFLAGS+y}
 ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+printf %s "checking whether $CC accepts -g... " >&6; }
+if test ${ac_cv_prog_cc_g+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   ac_save_c_werror_flag=$ac_c_werror_flag
    ac_c_werror_flag=yes
    ac_cv_prog_cc_g=no
@@ -5022,57 +6057,60 @@ else
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_cv_prog_cc_g=yes
-else
+else $as_nop
   CFLAGS=""
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
 
-else
+else $as_nop
   ac_c_werror_flag=$ac_save_c_werror_flag
         CFLAGS="-g"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_cv_prog_cc_g=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
    ac_c_werror_flag=$ac_save_c_werror_flag
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
+if test $ac_test_CFLAGS; then
   CFLAGS=$ac_save_CFLAGS
 elif test $ac_cv_prog_cc_g = yes; then
   if test "$GCC" = yes; then
@@ -5087,94 +6125,144 @@ else
     CFLAGS=
   fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
+ac_prog_cc_stdc=no
+if test x$ac_prog_cc_stdc = xno
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
+printf %s "checking for $CC option to enable C11 features... " >&6; }
+if test ${ac_cv_prog_cc_c11+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_cv_prog_cc_c11=no
 ac_save_CC=$CC
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+$ac_c_conftest_c11_program
+_ACEOF
+for ac_arg in '' -std=gnu11
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_prog_cc_c11=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+  test "x$ac_cv_prog_cc_c11" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+fi
 
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+if test "x$ac_cv_prog_cc_c11" = xno
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+  if test "x$ac_cv_prog_cc_c11" = x
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
+printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
+     CC="$CC $ac_cv_prog_cc_c11"
+fi
+  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
+  ac_prog_cc_stdc=c11
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
+printf %s "checking for $CC option to enable C99 features... " >&6; }
+if test ${ac_cv_prog_cc_c99+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_c_conftest_c99_program
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+fi
 
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
+if test "x$ac_cv_prog_cc_c99" = xno
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+  if test "x$ac_cv_prog_cc_c99" = x
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
+     CC="$CC $ac_cv_prog_cc_c99"
+fi
+  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
+  ac_prog_cc_stdc=c99
+fi
+fi
+if test x$ac_prog_cc_stdc = xno
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
+printf %s "checking for $CC option to enable C89 features... " >&6; }
+if test ${ac_cv_prog_cc_c89+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_c_conftest_c89_program
 _ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
 do
   CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
+  if ac_fn_c_try_compile "$LINENO"
+then :
   ac_cv_prog_cc_c89=$ac_arg
 fi
-rm -f core conftest.err conftest.$ac_objext
+rm -f core conftest.err conftest.$ac_objext conftest.beam
   test "x$ac_cv_prog_cc_c89" != "xno" && break
 done
 rm -f conftest.$ac_ext
 CC=$ac_save_CC
-
 fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
 
+if test "x$ac_cv_prog_cc_c89" = xno
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+printf "%s\n" "unsupported" >&6; }
+else $as_nop
+  if test "x$ac_cv_prog_cc_c89" = x
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+printf "%s\n" "none needed" >&6; }
+else $as_nop
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
+     CC="$CC $ac_cv_prog_cc_c89"
+fi
+  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
+  ac_prog_cc_stdc=c89
+fi
 fi
 
 ac_ext=c
@@ -5183,21 +6271,23 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
-ac_ext=c
+
+  ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+printf %s "checking whether $CC understands -c and -o together... " >&6; }
+if test ${am_cv_prog_cc_c_o+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
@@ -5225,8 +6315,8 @@ _ACEOF
   rm -f core conftest*
   unset am_i
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+printf "%s\n" "$am_cv_prog_cc_c_o" >&6; }
 if test "$am_cv_prog_cc_c_o" != yes; then
    # Losing compiler, so override with the script.
    # FIXME: It is wrong to rewrite CC.
@@ -5241,52 +6331,131 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler is clang" >&5
+printf %s "checking whether the compiler is clang... " >&6; }
+if test ${gl_cv_compiler_clang+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+                 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+           #ifdef __clang__
+           barfbarf
+           #endif
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_compiler_clang=no
+else $as_nop
+  gl_cv_compiler_clang=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_clang" >&5
+printf "%s\n" "$gl_cv_compiler_clang" >&6; }
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for compiler option needed when checking for declarations" >&5
+printf %s "checking for compiler option needed when checking for declarations... " >&6; }
+if test ${gl_cv_compiler_check_decl_option+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test $gl_cv_compiler_clang = yes; then
+                     save_ac_compile="$ac_compile"
+       ac_compile="$ac_compile -Werror=implicit-function-declaration"
+                     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'
+else $as_nop
+  gl_cv_compiler_check_decl_option=none
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+       ac_compile="$save_ac_compile"
+     else
+       gl_cv_compiler_check_decl_option=none
+     fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_compiler_check_decl_option" >&5
+printf "%s\n" "$gl_cv_compiler_check_decl_option" >&6; }
+  if test "x$gl_cv_compiler_check_decl_option" != xnone; then
+    ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
+  else
+    ac_compile_for_check_decl="$ac_compile"
+  fi
+
 DEPDIR="${am__leading_dot}deps"
 
 ac_config_commands="$ac_config_commands depfiles"
 
-
-am_make=${MAKE-make}
-cat > confinc << 'END'
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5
+printf %s "checking whether ${MAKE-make} supports the include directive... " >&6; }
+cat > confinc.mk << 'END'
 am__doit:
-       @echo this is the am__doit target
+       @echo this is the am__doit target >confinc.out
 .PHONY: am__doit
 END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
 am__include="#"
 am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
+# BSD make does it like this.
+echo '.include "confinc.mk" # ignored' > confmf.BSD
+# Other make implementations (GNU, Solaris 10, AIX) do it like this.
+echo 'include confinc.mk # ignored' > confmf.GNU
+_am_result=no
+for s in GNU BSD; do
+  { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5
+   (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); }
+  case $?:`cat confinc.out 2>/dev/null` in #(
+  '0:this is the am__doit target') :
+    case $s in #(
+  BSD) :
+    am__include='.include' am__quote='"' ;; #(
+  *) :
+    am__include='include' am__quote='' ;;
+esac ;; #(
+  *) :
      ;;
-   esac
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+esac
+  if test "$am__include" != "#"; then
+    _am_result="yes ($s style)"
+    break
+  fi
+done
+rm -f confinc.* confmf.*
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5
+printf "%s\n" "${_am_result}" >&6; }
 
 # Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
+if test ${enable_dependency_tracking+y}
+then :
   enableval=$enable_dependency_tracking;
 fi
 
@@ -5307,11 +6476,12 @@ fi
 
 depcc="$CC"   am_compiler_list=
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CC_dependencies_compiler_type+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
   # We make a subdir and do the tests there.  Otherwise we can end up
   # making bogus files that we don't know about and never remove.  For
@@ -5418,8 +6588,8 @@ else
 fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CC_dependencies_compiler_type" >&6; }
 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
  if
 
 
 
+ac_header= ac_cache=
+for ac_item in $ac_header_c_list
+do
+  if test $ac_cache; then
+    ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
+    if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
+      printf "%s\n" "#define $ac_item 1" >> confdefs.h
+    fi
+    ac_header= ac_cache=
+  elif test $ac_header; then
+    ac_cache=$ac_item
+  else
+    ac_header=$ac_item
+  fi
+done
+
+
+
+
+
+
+
+
+if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
+then :
+
+printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if test ${ac_cv_safe_to_define___extensions__+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#         define __EXTENSIONS__ 1
+          $ac_includes_default
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_safe_to_define___extensions__=yes
+else $as_nop
+  ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; }
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
+printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; }
+if test ${ac_cv_should_define__xopen_source+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_cv_should_define__xopen_source=no
+    if test $ac_cv_header_wchar_h = yes
+then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+          #include <wchar.h>
+          mbstate_t x;
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+            #define _XOPEN_SOURCE 500
+            #include <wchar.h>
+            mbstate_t x;
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_should_define__xopen_source=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
+printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; }
+
+  printf "%s\n" "#define _ALL_SOURCE 1" >>confdefs.h
+
+  printf "%s\n" "#define _DARWIN_C_SOURCE 1" >>confdefs.h
+
+  printf "%s\n" "#define _GNU_SOURCE 1" >>confdefs.h
+
+  printf "%s\n" "#define _HPUX_ALT_XOPEN_SOCKET_API 1" >>confdefs.h
+
+  printf "%s\n" "#define _NETBSD_SOURCE 1" >>confdefs.h
+
+  printf "%s\n" "#define _OPENBSD_SOURCE 1" >>confdefs.h
+
+  printf "%s\n" "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+  printf "%s\n" "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h
+
+  printf "%s\n" "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h
+
+  printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h
+
+  printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h
+
+  printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h
+
+  printf "%s\n" "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h
+
+  printf "%s\n" "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h
+
+  printf "%s\n" "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+  if test $ac_cv_header_minix_config_h = yes
+then :
+  MINIX=yes
+    printf "%s\n" "#define _MINIX 1" >>confdefs.h
+
+    printf "%s\n" "#define _POSIX_SOURCE 1" >>confdefs.h
+
+    printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h
+
+else $as_nop
+  MINIX=
+fi
+  if test $ac_cv_safe_to_define___extensions__ = yes
+then :
+  printf "%s\n" "#define __EXTENSIONS__ 1" >>confdefs.h
+
+fi
+  if test $ac_cv_should_define__xopen_source = yes
+then :
+  printf "%s\n" "#define _XOPEN_SOURCE 500" >>confdefs.h
+
+fi
+
+
+
+  # Make sure we can run config.sub.
+$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+printf %s "checking build system type... " >&6; }
+if test ${ac_cv_build+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+printf "%s\n" "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+printf %s "checking host system type... " >&6; }
+if test ${ac_cv_host+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+printf "%s\n" "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+
+
+  case "$host_os" in
+    openbsd*)
+
+printf "%s\n" "#define _ISOC11_SOURCE 1" >>confdefs.h
+
+      ;;
+  esac
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+printf %s "checking how to run the C preprocessor... " >&6; }
 # On Suns, sometimes $CPP names a directory.
 if test -n "$CPP" && test -d "$CPP"; then
   CPP=
 fi
 if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+  if test ${ac_cv_prog_CPP+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+      # Double quotes because $CC needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp
     do
       ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
   # Use a header file that comes with gcc, so configuring glibc
   # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+#include <limits.h>
                     Syntax error
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
 
-else
+else $as_nop
   # Broken: fails on valid input.
 continue
 fi
@@ -5485,10 +6908,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
   # Broken: success on invalid input.
 continue
-else
+else $as_nop
   # Passes both tests.
 ac_preproc_ok=:
 break
@@ -5498,7 +6922,8 @@ rm -f conftest.err conftest.i conftest.$ac_ext
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
 rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+if $ac_preproc_ok
+then :
   break
 fi
 
@@ -5510,29 +6935,24 @@ fi
 else
   ac_cv_prog_CPP=$CPP
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+printf "%s\n" "$CPP" >&6; }
 ac_preproc_ok=false
 for ac_c_preproc_warn_flag in '' yes
 do
   # Use a header file that comes with gcc, so configuring glibc
   # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
   # On the NeXT, cc -E runs the code through the compiler's parser,
   # not just through cpp. "Syntax error" is here to catch this case.
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
+#include <limits.h>
                     Syntax error
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
 
-else
+else $as_nop
   # Broken: fails on valid input.
 continue
 fi
@@ -5544,10 +6964,11 @@ rm -f conftest.err conftest.i conftest.$ac_ext
 /* end confdefs.h.  */
 #include <ac_nonexistent.h>
 _ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+if ac_fn_c_try_cpp "$LINENO"
+then :
   # Broken: success on invalid input.
 continue
-else
+else $as_nop
   # Passes both tests.
 ac_preproc_ok=:
 break
@@ -5557,11 +6978,12 @@ rm -f conftest.err conftest.i conftest.$ac_ext
 done
 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
 rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
+if $ac_preproc_ok
+then :
 
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+else $as_nop
+  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
 See \`config.log' for more details" "$LINENO" 5; }
 fi
@@ -5573,11 +6995,12 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+printf %s "checking for grep that handles long lines and -e... " >&6; }
+if test ${ac_cv_path_GREP+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -z "$GREP"; then
   ac_path_GREP_found=false
   # Loop through the user's path and test for each of PROGNAME-LIST
@@ -5585,10 +7008,15 @@ else
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in grep ggrep; do
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    for ac_prog in grep ggrep
+   do
     for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
       as_fn_executable_p "$ac_path_GREP" || continue
 # Check for GNU ac_path_GREP and select it if it is found.
   # Check for GNU $ac_path_GREP
@@ -5597,13 +7025,13 @@ case `"$ac_path_GREP" --version 2>&1` in
   ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
 *)
   ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
+  printf %s 0123456789 >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    $as_echo 'GREP' >> "conftest.nl"
+    printf "%s\n" 'GREP' >> "conftest.nl"
     "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
     as_fn_arith $ac_count + 1 && ac_count=$as_val
@@ -5631,16 +7059,17 @@ else
 fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+printf "%s\n" "$ac_cv_path_GREP" >&6; }
  GREP="$ac_cv_path_GREP"
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+printf %s "checking for egrep... " >&6; }
+if test ${ac_cv_path_EGREP+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
    then ac_cv_path_EGREP="$GREP -E"
    else
@@ -5651,10 +7080,15 @@ else
 for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in egrep; do
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    for ac_prog in egrep
+   do
     for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
       as_fn_executable_p "$ac_path_EGREP" || continue
 # Check for GNU ac_path_EGREP and select it if it is found.
   # Check for GNU $ac_path_EGREP
@@ -5663,13 +7097,13 @@ case `"$ac_path_EGREP" --version 2>&1` in
   ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
 *)
   ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
+  printf %s 0123456789 >"conftest.in"
   while :
   do
     cat "conftest.in" "conftest.in" >"conftest.tmp"
     mv "conftest.tmp" "conftest.in"
     cp "conftest.in" "conftest.nl"
-    $as_echo 'EGREP' >> "conftest.nl"
+    printf "%s\n" 'EGREP' >> "conftest.nl"
     "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
     diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
     as_fn_arith $ac_count + 1 && ac_count=$as_val
 
    fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+printf "%s\n" "$ac_cv_path_EGREP" >&6; }
  EGREP="$ac_cv_path_EGREP"
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-                  (('a' <= (c) && (c) <= 'i') \
-                    || ('j' <= (c) && (c) <= 'r') \
-                    || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
-
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int
-main ()
-{
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-       || toupper (i) != TOUPPER (i))
-      return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
-else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
-
-fi
-
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-                 inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
-
-
-  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = xyes; then :
-  MINIX=yes
-else
-  MINIX=
-fi
-
-
-  if test "$MINIX" = yes; then
-
-$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
-
-
-$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
-
-
-$as_echo "#define _MINIX 1" >>confdefs.h
-
-
-$as_echo "#define _NETBSD_SOURCE 1" >>confdefs.h
-
-  fi
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
-$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if ${ac_cv_safe_to_define___extensions__+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#         define __EXTENSIONS__ 1
-          $ac_includes_default
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_safe_to_define___extensions__=yes
-else
-  ac_cv_safe_to_define___extensions__=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
-$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
-  test $ac_cv_safe_to_define___extensions__ = yes &&
-    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
-
-  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
-
-  $as_echo "#define _DARWIN_C_SOURCE 1" >>confdefs.h
-
-  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
-
-  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
-
-  $as_echo "#define __STDC_WANT_IEC_60559_ATTRIBS_EXT__ 1" >>confdefs.h
-
-  $as_echo "#define __STDC_WANT_IEC_60559_BFP_EXT__ 1" >>confdefs.h
-
-  $as_echo "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h
-
-  $as_echo "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h
-
-  $as_echo "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h
-
-  $as_echo "#define __STDC_WANT_LIB_EXT2__ 1" >>confdefs.h
-
-  $as_echo "#define __STDC_WANT_MATH_SPEC_FUNCS__ 1" >>confdefs.h
-
-  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether _XOPEN_SOURCE should be defined" >&5
-$as_echo_n "checking whether _XOPEN_SOURCE should be defined... " >&6; }
-if ${ac_cv_should_define__xopen_source+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_should_define__xopen_source=no
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-          #include <wchar.h>
-          mbstate_t x;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-             #define _XOPEN_SOURCE 500
-             #include <wchar.h>
-             mbstate_t x;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_should_define__xopen_source=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5
-$as_echo "$ac_cv_should_define__xopen_source" >&6; }
-  test $ac_cv_should_define__xopen_source = yes &&
-    $as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h
-
-
 
 
 
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
-$as_echo_n "checking for Minix Amsterdam compiler... " >&6; }
-if ${gl_cv_c_amsterdam_compiler+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Minix Amsterdam compiler" >&5
+printf %s "checking for Minix Amsterdam compiler... " >&6; }
+if test ${gl_cv_c_amsterdam_compiler+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -5984,17 +7156,18 @@ Amsterdam
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Amsterdam" >/dev/null 2>&1; then :
+  $EGREP "Amsterdam" >/dev/null 2>&1
+then :
   gl_cv_c_amsterdam_compiler=yes
-else
+else $as_nop
   gl_cv_c_amsterdam_compiler=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
-$as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_amsterdam_compiler" >&5
+printf "%s\n" "$gl_cv_c_amsterdam_compiler" >&6; }
 
       if test $gl_cv_c_amsterdam_compiler = yes; then
     if test -z "$AR"; then
@@ -6004,187 +7177,18 @@ $as_echo "$gl_cv_c_amsterdam_compiler" >&6; }
       ARFLAGS='-o'
     fi
   else
-                                        if test -n "$ac_tool_prefix"; then
-  for ac_prog in ar lib "link -lib"
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AR"; then
-  ac_cv_prog_AR="$AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-AR=$ac_cv_prog_AR
-if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-    test -n "$AR" && break
-  done
-fi
-if test -z "$AR"; then
-  ac_ct_AR=$AR
-  for ac_prog in ar lib "link -lib"
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_AR"; then
-  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_AR="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_AR=$ac_cv_prog_ac_ct_AR
-if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$ac_ct_AR" && break
-done
-
-  if test "x$ac_ct_AR" = x; then
-    AR="false"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    AR=$ac_ct_AR
-  fi
-fi
-
-: ${AR=ar}
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5
-$as_echo_n "checking the archiver ($AR) interface... " >&6; }
-if ${am_cv_ar_interface+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-   am_cv_ar_interface=ar
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-int some_variable = 0;
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5'
-      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
-  (eval $am_ar_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-      if test "$ac_status" -eq 0; then
-        am_cv_ar_interface=ar
-      else
-        am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5'
-        { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5
-  (eval $am_ar_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-        if test "$ac_status" -eq 0; then
-          am_cv_ar_interface=lib
-        else
-          am_cv_ar_interface=unknown
-        fi
-      fi
-      rm -f conftest.lib libconftest.a
-
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5
-$as_echo "$am_cv_ar_interface" >&6; }
-
-case $am_cv_ar_interface in
-ar)
-  ;;
-lib)
-  # Microsoft lib, so override with the ar-lib wrapper script.
-  # FIXME: It is wrong to rewrite AR.
-  # But if we don't then we get into trouble of one sort or another.
-  # A longer-term fix would be to have automake use am__AR in this case,
-  # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something
-  # similar.
-  AR="$am_aux_dir/ar-lib $AR"
-  ;;
-unknown)
-  as_fn_error $? "could not determine $AR interface" "$LINENO" 5
-  ;;
-esac
-
+                                                :
   fi
 
         if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_AR+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$AR"; then
   ac_cv_prog_AR="$AR" # Let the user override the test.
 else
@@ -6192,11 +7196,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_AR="${ac_tool_prefix}ar"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -6207,11 +7215,11 @@ fi
 fi
 AR=$ac_cv_prog_AR
 if test -n "$AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
-$as_echo "$AR" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+printf "%s\n" "$AR" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
 
@@ -6220,11 +7228,12 @@ if test -z "$ac_cv_prog_AR"; then
   ac_ct_AR=$AR
   # Extract the first word of "ar", so it can be a program name with args.
 set dummy ar; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_AR+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_AR+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$ac_ct_AR"; then
   ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
 else
@@ -6232,11 +7241,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_AR="ar"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -6247,11 +7260,11 @@ fi
 fi
 ac_ct_AR=$ac_cv_prog_ac_ct_AR
 if test -n "$ac_ct_AR"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
-$as_echo "$ac_ct_AR" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+printf "%s\n" "$ac_ct_AR" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
   if test "x$ac_ct_AR" = x; then
@@ -6259,8 +7272,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     AR=$ac_ct_AR
@@ -6282,11 +7295,12 @@ fi
             if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_RANLIB+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$RANLIB"; then
   ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
 else
@@ -6294,11 +7308,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -6309,11 +7327,11 @@ fi
 fi
 RANLIB=$ac_cv_prog_RANLIB
 if test -n "$RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
-$as_echo "$RANLIB" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+printf "%s\n" "$RANLIB" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
 
@@ -6322,11 +7340,12 @@ if test -z "$ac_cv_prog_RANLIB"; then
   ac_ct_RANLIB=$RANLIB
   # Extract the first word of "ranlib", so it can be a program name with args.
 set dummy ranlib; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_RANLIB+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   if test -n "$ac_ct_RANLIB"; then
   ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
 else
@@ -6334,11 +7353,15 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
     for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
     ac_cv_prog_ac_ct_RANLIB="ranlib"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
     break 2
   fi
 done
@@ -6349,11 +7372,11 @@ fi
 fi
 ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
 if test -n "$ac_ct_RANLIB"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
-$as_echo "$ac_ct_RANLIB" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+printf "%s\n" "$ac_ct_RANLIB" >&6; }
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
 fi
 
   if test "x$ac_ct_RANLIB" = x; then
@@ -6361,8 +7384,8 @@ fi
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
     RANLIB=$ac_ct_RANLIB
 
 
 
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
-  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use C++" >&5
+printf %s "checking whether to use C++... " >&6; }
+    # Check whether --enable-c++ was given.
+if test ${enable_c__+y}
+then :
+  enableval=$enable_c__; CXX_CHOICE="$enableval"
+else $as_nop
+  CXX_CHOICE=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
-esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX_CHOICE" >&5
+printf "%s\n" "$CXX_CHOICE" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$host_alias" = x; then
-  ac_cv_host=$ac_cv_build
-else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
-$as_echo_n "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_source+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  while :; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+
+
+  if test "$CXX_CHOICE" = no; then
+    CXX=no
+  fi
+  if test -z "$CXX"; then
+    if test -n "$CCC"; then
+      CXX="$CCC"
+    else
+      if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_CXX+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+printf "%s\n" "$CXX" >&6; }
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_ac_ct_CXX+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+printf "%s\n" "$ac_ct_CXX" >&6; }
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+    fi
+  fi
+  if test "$CXX" != no; then
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+printf %s "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works... " >&6; }
+    ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+    echo 'int main () { return 0; }' > conftest.$ac_ext
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      gl_cv_prog_ansicxx_works=yes
+      if (./conftest; exit) 2>/dev/null; then
+        gl_cv_prog_ansicxx_cross=no
+      else
+        gl_cv_prog_ansicxx_cross=yes
+      fi
+    else
+      gl_cv_prog_ansicxx_works=no
+    fi
+    rm -fr conftest*
+    ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_prog_ansicxx_works" >&5
+printf "%s\n" "$gl_cv_prog_ansicxx_works" >&6; }
+    if test $gl_cv_prog_ansicxx_works = no; then
+      CXX=no
+    else
+                  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler supports namespaces" >&5
+printf %s "checking whether the C++ compiler supports namespaces... " >&6; }
+      ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+      cat <<EOF > conftest.$ac_ext
+#include <iostream>
+namespace test { using namespace std; }
+std::ostream* ptr;
+int main () { return 0; }
+EOF
+      if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+        gl_cv_prog_ansicxx_namespaces=yes
+      else
+        gl_cv_prog_ansicxx_namespaces=no
+      fi
+      rm -fr conftest*
+      ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_prog_ansicxx_namespaces" >&5
+printf "%s\n" "$gl_cv_prog_ansicxx_namespaces" >&6; }
+      if test $gl_cv_prog_ansicxx_namespaces = no; then
+        CXX=no
+      fi
+    fi
+  fi
+
+
+
+   if test "$CXX" != no; then
+  ANSICXX_TRUE=
+  ANSICXX_FALSE='#'
+else
+  ANSICXX_TRUE='#'
+  ANSICXX_FALSE=
+fi
+
+
+  if test "$CXX" != no; then
+
+depcc="$CXX"  am_compiler_list=
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+printf %s "checking dependency style of $depcc... " >&6; }
+if test ${am_cv_CXX_dependencies_compiler_type+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+printf "%s\n" "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+        ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5
+printf %s "checking whether the compiler supports GNU C++... " >&6; }
+if test ${ac_cv_cxx_compiler_gnu+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+  ac_compiler_gnu=yes
+else $as_nop
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; }
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+    if test $ac_compiler_gnu = yes; then
+      GXX=yes
+    else
+      GXX=
+    fi
+    ac_test_CXXFLAGS=${CXXFLAGS+y}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+printf %s "checking whether $CXX accepts -g... " >&6; }
+if test ${ac_cv_prog_cxx_g+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+  ac_cv_prog_cxx_g=yes
+else $as_nop
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+
+else $as_nop
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+        CXXFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+  ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+printf "%s\n" "$ac_cv_prog_cxx_g" >&6; }
+if test $ac_test_CXXFLAGS; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+    ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+  else
+     if false; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+  fi
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5
+printf %s "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; }
+if test ${ac_cv_sys_largefile_source+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 #include <sys/types.h> /* for off_t */
      #include <stdio.h>
 int
-main ()
+main (void)
 {
 int (*fp) (FILE *, off_t, int) = fseeko;
      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
@@ -6466,10 +7925,11 @@ int (*fp) (FILE *, off_t, int) = fseeko;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   ac_cv_sys_largefile_source=no; break
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -6477,7 +7937,7 @@ rm -f core conftest.err conftest.$ac_objext \
 #include <sys/types.h> /* for off_t */
      #include <stdio.h>
 int
-main ()
+main (void)
 {
 int (*fp) (FILE *, off_t, int) = fseeko;
      return fseeko (stdin, 0, 0) && fp (stdin, 0, 0);
@@ -6485,23 +7945,22 @@ int (*fp) (FILE *, off_t, int) = fseeko;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   ac_cv_sys_largefile_source=1; break
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
   ac_cv_sys_largefile_source=unknown
   break
 done
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
-$as_echo "$ac_cv_sys_largefile_source" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5
+printf "%s\n" "$ac_cv_sys_largefile_source" >&6; }
 case $ac_cv_sys_largefile_source in #(
   no | unknown) ;;
   *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source
-_ACEOF
+printf "%s\n" "#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source" >>confdefs.h
 ;;
 esac
 rm -rf conftest*
@@ -6511,10 +7970,18 @@ rm -rf conftest*
 # If you want fseeko and ftello with glibc, upgrade to a fixed glibc.
 if test $ac_cv_sys_largefile_source != unknown; then
 
-$as_echo "#define HAVE_FSEEKO 1" >>confdefs.h
+printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h
 
 fi
 
+  case "$host_os" in
+    hpux*)
+
+printf "%s\n" "#define _LARGEFILE_SOURCE 1" >>confdefs.h
+
+      ;;
+  esac
+
 
 
 
@@ -6525,7 +7992,7 @@ fi
     alpha*)
       # On Alpha systems, a compiler option provides the behaviour.
       # See the ieee(3) manual page, also available at
-      # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM>
+      # <https://backdrift.org/man/tru64/man3/ieee.3.html>
       if test -n "$GCC"; then
         # GCC has the option -mieee.
         # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
@@ -6545,68 +8012,73 @@ fi
   esac
 
 # Check whether --enable-largefile was given.
-if test "${enable_largefile+set}" = set; then :
+if test ${enable_largefile+y}
+then :
   enableval=$enable_largefile;
 fi
 
 if test "$enable_largefile" != no; then
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
-$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
-if ${ac_cv_sys_largefile_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+printf %s "checking for special C compiler options needed for large files... " >&6; }
+if test ${ac_cv_sys_largefile_CC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   ac_cv_sys_largefile_CC=no
      if test "$GCC" != yes; then
        ac_save_CC=$CC
        while :; do
-         # IRIX 6.2 and later do not support large files by default,
-         # so use the C compiler's -n32 option if that helps.
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        # IRIX 6.2 and later do not support large files by default,
+        # so use the C compiler's -n32 option if that helps.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                       && LARGE_OFF_T % 2147483647 == 1)
-                      ? 1 : -1];
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-         if ac_fn_c_try_compile "$LINENO"; then :
+        if ac_fn_c_try_compile "$LINENO"
+then :
   break
 fi
-rm -f core conftest.err conftest.$ac_objext
-         CC="$CC -n32"
-         if ac_fn_c_try_compile "$LINENO"; then :
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+        CC="$CC -n32"
+        if ac_fn_c_try_compile "$LINENO"
+then :
   ac_cv_sys_largefile_CC=' -n32'; break
 fi
-rm -f core conftest.err conftest.$ac_objext
-         break
+rm -f core conftest.err conftest.$ac_objext conftest.beam
+        break
        done
        CC=$ac_save_CC
        rm -f conftest.$ac_ext
     fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
-$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; }
   if test "$ac_cv_sys_largefile_CC" != no; then
     CC=$CC$ac_cv_sys_largefile_CC
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
-$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
-if ${ac_cv_sys_file_offset_bits+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if test ${ac_cv_sys_file_offset_bits+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   while :; do
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -6615,22 +8087,23 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                       && LARGE_OFF_T % 2147483647 == 1)
-                      ? 1 : -1];
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_cv_sys_file_offset_bits=no; break
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #define _FILE_OFFSET_BITS 64
@@ -6639,43 +8112,43 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                       && LARGE_OFF_T % 2147483647 == 1)
-                      ? 1 : -1];
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_cv_sys_file_offset_bits=64; break
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
   ac_cv_sys_file_offset_bits=unknown
   break
 done
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
-$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; }
 case $ac_cv_sys_file_offset_bits in #(
   no | unknown) ;;
   *)
-cat >>confdefs.h <<_ACEOF
-#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
-_ACEOF
+printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h
 ;;
 esac
 rm -rf conftest*
   if test $ac_cv_sys_file_offset_bits = unknown; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
-$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
-if ${ac_cv_sys_large_files+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+printf %s "checking for _LARGE_FILES value needed for large files... " >&6; }
+if test ${ac_cv_sys_large_files+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   while :; do
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -6684,22 +8157,23 @@ else
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                       && LARGE_OFF_T % 2147483647 == 1)
-                      ? 1 : -1];
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_cv_sys_large_files=no; break
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #define _LARGE_FILES 1
@@ -6708,364 +8182,82 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
   int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
-                       && LARGE_OFF_T % 2147483647 == 1)
-                      ? 1 : -1];
+                      && LARGE_OFF_T % 2147483647 == 1)
+                     ? 1 : -1];
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_cv_sys_large_files=1; break
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
   ac_cv_sys_large_files=unknown
   break
 done
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
-$as_echo "$ac_cv_sys_large_files" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+printf "%s\n" "$ac_cv_sys_large_files" >&6; }
 case $ac_cv_sys_large_files in #(
   no | unknown) ;;
   *)
-cat >>confdefs.h <<_ACEOF
-#define _LARGE_FILES $ac_cv_sys_large_files
-_ACEOF
+printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h
 ;;
 esac
 rm -rf conftest*
   fi
-
-
-$as_echo "#define _DARWIN_USE_64_BIT_INODE 1" >>confdefs.h
-
 fi
 
-   case $ac_cv_prog_cc_stdc in #(
-  no) :
-    ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(
-  *) :
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
-$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
-if ${ac_cv_prog_cc_c99+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c99=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <wchar.h>
-#include <stdio.h>
 
-// Check varargs macros.  These examples are taken from C99 6.10.3.5.
-#define debug(...) fprintf (stderr, __VA_ARGS__)
-#define showlist(...) puts (#__VA_ARGS__)
-#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
-static void
-test_varargs_macros (void)
-{
-  int x = 1234;
-  int y = 5678;
-  debug ("Flag");
-  debug ("X = %d\n", x);
-  showlist (The first, second, and third items.);
-  report (x>y, "x is %d but y is %d", x, y);
-}
 
-// Check long long types.
-#define BIG64 18446744073709551615ull
-#define BIG32 4294967295ul
-#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
-#if !BIG_OK
-  your preprocessor is broken;
-#endif
-#if BIG_OK
-#else
-  your preprocessor is broken;
-#endif
-static long long int bignum = -9223372036854775807LL;
-static unsigned long long int ubignum = BIG64;
 
-struct incomplete_array
-{
-  int datasize;
-  double data[];
-};
 
-struct named_init {
-  int number;
-  const wchar_t *name;
-  double average;
-};
 
-typedef const char *ccp;
 
-static inline int
-test_restrict (ccp restrict text)
-{
-  // See if C++-style comments work.
-  // Iterate through items via the restricted pointer.
-  // Also check for declarations in for loops.
-  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
-    continue;
-  return 0;
-}
+  # Check whether --enable-threads was given.
+if test ${enable_threads+y}
+then :
+  enableval=$enable_threads; gl_use_threads=$enableval
+else $as_nop
+  if test -n "$gl_use_threads_default"; then
+       gl_use_threads="$gl_use_threads_default"
+     else
+       case "$host_os" in
+                                    osf*) gl_use_threads=no ;;
+                                    cygwin*)
+               case `uname -r` in
+                 1.[0-5].*) gl_use_threads=no ;;
+                 *)         gl_use_threads=yes ;;
+               esac
+               ;;
+                  mingw*)
+               case "$gl_use_winpthreads_default" in
+                 yes) gl_use_threads=posix ;;
+                 no)  gl_use_threads=windows ;;
+                 *)   gl_use_threads=yes ;;
+               esac
+               ;;
+         *)    gl_use_threads=yes ;;
+       esac
+     fi
 
-// Check varargs and va_copy.
-static void
-test_varargs (const char *format, ...)
-{
-  va_list args;
-  va_start (args, format);
-  va_list args_copy;
-  va_copy (args_copy, args);
+fi
 
-  const char *str;
-  int number;
-  float fnumber;
+  if test "$gl_use_threads" = yes \
+     || test "$gl_use_threads" = isoc \
+     || test "$gl_use_threads" = posix \
+     || test "$gl_use_threads" = isoc+posix; then
+    # For using <threads.h> or <pthread.h>:
 
-  while (*format)
-    {
-      switch (*format++)
-       {
-       case 's': // string
-         str = va_arg (args_copy, const char *);
-         break;
-       case 'd': // int
-         number = va_arg (args_copy, int);
-         break;
-       case 'f': // float
-         fnumber = va_arg (args_copy, double);
-         break;
-       default:
-         break;
-       }
-    }
-  va_end (args_copy);
-  va_end (args);
-}
 
-int
-main ()
-{
-
-  // Check bool.
-  _Bool success = false;
-
-  // Check restrict.
-  if (test_restrict ("String literal") == 0)
-    success = true;
-  char *restrict newvar = "Another string";
-
-  // Check varargs.
-  test_varargs ("s, d' f .", "string", 65, 34.234);
-  test_varargs_macros ();
-
-  // Check flexible array members.
-  struct incomplete_array *ia =
-    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
-  ia->datasize = 10;
-  for (int i = 0; i < ia->datasize; ++i)
-    ia->data[i] = i * 1.234;
-
-  // Check named initializers.
-  struct named_init ni = {
-    .number = 34,
-    .name = L"Test wide string",
-    .average = 543.34343,
-  };
-
-  ni.number = 58;
-
-  int dynamic_array[ni.number];
-  dynamic_array[ni.number - 1] = 543;
-
-  // work around unused variable warnings
-  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
-         || dynamic_array[ni.number - 1] != 543);
-
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c99=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c99" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c99" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c99"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
-$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c99" != xno; then :
-  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
-fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
-
-fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
-else
-  ac_cv_prog_cc_stdc=no
-fi
-
-fi
- ;;
-esac
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
-$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
-  if ${ac_cv_prog_cc_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-fi
-
-  case $ac_cv_prog_cc_stdc in #(
-  no) :
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;; #(
-  '') :
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;; #(
-  *) :
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5
-$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;;
-esac
-
-
-
-
-
-
-  # Check whether --enable-threads was given.
-if test "${enable_threads+set}" = set; then :
-  enableval=$enable_threads; gl_use_threads=$enableval
-else
-  if test -n "$gl_use_threads_default"; then
-       gl_use_threads="$gl_use_threads_default"
-     else
-       case "$host_os" in
-                                                               osf*) gl_use_threads=no ;;
-         cygwin*)
-               case `uname -r` in
-                 1.[0-5].*) gl_use_threads=no ;;
-                 *)         gl_use_threads=yes ;;
-               esac
-               ;;
-         *)    gl_use_threads=yes ;;
-       esac
-     fi
-
-fi
-
-  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
-    # For using <pthread.h>:
+  if test -z "$gl_anythreadlib_early_done"; then
     case "$host_os" in
       osf*)
         # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
@@ -7084,6 +8276,9 @@ fi
       aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
       solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
     esac
+    gl_anythreadlib_early_done=done
+  fi
+
   fi
 
 
@@ -7094,17 +8289,31 @@ fi
 
 
   # Code from module absolute-header:
+  # Code from module accept:
+  # Code from module accept-tests:
+  # Code from module access:
+  # Code from module access-tests:
   # Code from module alignof:
   # Code from module alignof-tests:
+  # Code from module alloca:
   # Code from module alloca-opt:
   # Code from module alloca-opt-tests:
   # Code from module announce-gen:
   # Code from module ansi-c++-opt:
+
+  # Code from module arpa_inet:
+  # Code from module arpa_inet-c++-tests:
+  # Code from module arpa_inet-tests:
   # Code from module array-list:
   # Code from module array-list-tests:
   # Code from module array-oset:
   # Code from module array-oset-tests:
   # Code from module assert:
+  # Code from module assure:
+  # Code from module asyncsafe-spin:
+  # Code from module asyncsafe-spin-tests:
+  # Code from module at-internal:
+  # Code from module attribute:
   # Code from module autobuild:
 
 
@@ -7113,19 +8322,19 @@ fi
   if test -z "$AB_PACKAGE"; then
     AB_PACKAGE=${PACKAGE_NAME:-$PACKAGE}
   fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild project... $AB_PACKAGE" >&5
-$as_echo "$as_me: autobuild project... $AB_PACKAGE" >&6;}
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild project... $AB_PACKAGE" >&5
+printf "%s\n" "$as_me: autobuild project... $AB_PACKAGE" >&6;}
 
   if test -z "$AB_VERSION"; then
     AB_VERSION=${PACKAGE_VERSION:-$VERSION}
   fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild revision... $AB_VERSION" >&5
-$as_echo "$as_me: autobuild revision... $AB_VERSION" >&6;}
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild revision... $AB_VERSION" >&5
+printf "%s\n" "$as_me: autobuild revision... $AB_VERSION" >&6;}
 
   hostname=`hostname`
   if test "$hostname"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild hostname... $hostname" >&5
-$as_echo "$as_me: autobuild hostname... $hostname" >&6;}
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild hostname... $hostname" >&5
+printf "%s\n" "$as_me: autobuild hostname... $hostname" >&6;}
   fi
 
 
@@ -7135,14 +8344,19 @@ $as_echo "$as_me: autobuild hostname... $hostname" >&6;}
     date=`date`
   fi
   if test "$date"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: autobuild timestamp... $date" >&5
-$as_echo "$as_me: autobuild timestamp... $date" >&6;}
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: autobuild timestamp... $date" >&5
+printf "%s\n" "$as_me: autobuild timestamp... $date" >&6;}
   fi
 
   # Code from module avltree-oset:
   # Code from module avltree-oset-tests:
+  # Code from module basename-lgpl:
   # Code from module binary-io:
   # Code from module binary-io-tests:
+  # Code from module bind:
+  # Code from module bind-tests:
+  # Code from module bitrotate:
+  # Code from module bitrotate-tests:
   # Code from module btowc:
   # Code from module btowc-tests:
   # Code from module builtin-expect:
@@ -7153,11 +8367,20 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module c-strcase:
   # Code from module c-strcase-tests:
   # Code from module c-strcaseeq:
+  # Code from module c99:
+  # Code from module calloc-gnu:
+  # Code from module calloc-gnu-tests:
+  # Code from module calloc-posix:
+  # Code from module canonicalize:
   # Code from module canonicalize-lgpl:
   # Code from module canonicalize-lgpl-tests:
+  # Code from module canonicalize-tests:
   # Code from module chdir:
+  # Code from module chdir-long:
   # Code from module chdir-tests:
   # Code from module clean-temp:
+  # Code from module clean-temp-simple:
+  # Code from module clock-time:
   # Code from module cloexec:
   # Code from module cloexec-tests:
   # Code from module close:
@@ -7167,10 +8390,17 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module closein:
   # Code from module closein-tests:
   # Code from module closeout:
+  # Code from module concat-filename:
   # Code from module config-h:
   # Code from module configmake:
+  # Code from module connect:
+  # Code from module connect-tests:
+  # Code from module creat:
+  # Code from module creat-tests:
   # Code from module ctype:
+  # Code from module ctype-c++-tests:
   # Code from module ctype-tests:
+  # Code from module d-ino:
   # Code from module dirent:
   # Code from module dirent-c++-tests:
   # Code from module dirent-tests:
@@ -7179,22 +8409,30 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module dirname-lgpl:
   # Code from module dirname-tests:
   # Code from module do-release-commit-and-tag:
-  # Code from module dosname:
   # Code from module double-slash-root:
   # Code from module dup:
   # Code from module dup-tests:
   # Code from module dup2:
   # Code from module dup2-tests:
+  # Code from module dynarray:
+  # Code from module dynarray-tests:
+  # Code from module eloop-threshold:
   # Code from module environ:
   # Code from module environ-tests:
   # Code from module errno:
+  # Code from module errno-c++-tests:
   # Code from module errno-tests:
   # Code from module error:
   # Code from module execute:
+  # Code from module execute-tests:
   # Code from module exitfail:
+  # Code from module explicit_bzero:
+  # Code from module explicit_bzero-tests:
   # Code from module extensions:
   # Code from module extern-inline:
   # Code from module fatal-signal:
+  # Code from module fchdir:
+  # Code from module fchdir-tests:
   # Code from module fclose:
   # Code from module fclose-tests:
   # Code from module fcntl:
@@ -7207,18 +8445,26 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module fdl-1.3:
   # Code from module fdopen:
   # Code from module fdopen-tests:
+  # Code from module fdopendir:
+  # Code from module fdopendir-tests:
   # Code from module fflush:
 
   # Code from module fflush-tests:
   # Code from module fgetc-tests:
+  # Code from module file-set:
   # Code from module filename:
   # Code from module filenamecat:
   # Code from module filenamecat-lgpl:
   # Code from module filenamecat-tests:
+  # Code from module findprog:
+  # Code from module findprog-in:
   # Code from module flexmember:
   # Code from module float:
+  # Code from module float-c++-tests:
   # Code from module float-tests:
   # Code from module fopen:
+  # Code from module fopen-gnu:
+  # Code from module fopen-gnu-tests:
   # Code from module fopen-safer:
   # Code from module fopen-safer-tests:
   # Code from module fopen-tests:
@@ -7235,6 +8481,10 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module freadahead-tests:
   # Code from module freading:
   # Code from module freading-tests:
+  # Code from module free-posix:
+  # Code from module free-posix-tests:
+  # Code from module freopen:
+  # Code from module freopen-tests:
   # Code from module frexp-nolibm:
   # Code from module frexp-nolibm-tests:
   # Code from module frexpl-nolibm:
@@ -7246,24 +8496,31 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module fseeko-tests:
   # Code from module fstat:
   # Code from module fstat-tests:
+  # Code from module fstatat:
+  # Code from module fstatat-tests:
   # Code from module ftell:
   # Code from module ftell-tests:
   # Code from module ftello:
 
   # Code from module ftello-tests:
+  # Code from module ftruncate:
+  # Code from module ftruncate-tests:
   # Code from module fwrite-tests:
   # Code from module gendocs:
+  # Code from module getcwd:
   # Code from module getcwd-lgpl:
   # Code from module getcwd-lgpl-tests:
+  # Code from module getcwd-tests:
   # Code from module getdtablesize:
   # Code from module getdtablesize-tests:
   # Code from module getopt-gnu:
   # Code from module getopt-gnu-tests:
   # Code from module getopt-posix:
-  # Code from module getopt-posix-tests:
   # Code from module getpagesize:
   # Code from module getprogname:
   # Code from module getprogname-tests:
+  # Code from module getrandom:
+  # Code from module getrandom-tests:
   # Code from module gettext-h:
   # Code from module gettimeofday:
   # Code from module gettimeofday-tests:
@@ -7272,17 +8529,39 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module gnu-web-doc-update:
   # Code from module gnumakefile:
   # Code from module gnupload:
+  # Code from module gperf:
   # Code from module gpl-3.0:
   # Code from module hard-locale:
+  # Code from module hard-locale-tests:
+  # Code from module hash:
+  # Code from module hash-pjw:
+  # Code from module hash-tests:
+  # Code from module hash-triple-simple:
   # Code from module havelib:
+  # Code from module host-cpu-c-abi:
+  # Code from module iconv:
+  # Code from module iconv-h:
+  # Code from module iconv-h-c++-tests:
+  # Code from module iconv-h-tests:
+  # Code from module iconv-tests:
+  # Code from module iconv_open:
+  # Code from module idx:
   # Code from module ignore-value:
   # Code from module ignore-value-tests:
   # Code from module include_next:
+  # Code from module inet_pton:
+  # Code from module inet_pton-tests:
+  # Code from module inline:
   # Code from module intprops:
   # Code from module intprops-tests:
+  # Code from module inttostr:
+  # Code from module inttostr-tests:
   # Code from module inttypes:
+  # Code from module inttypes-c++-tests:
   # Code from module inttypes-incomplete:
   # Code from module inttypes-tests:
+  # Code from module ioctl:
+  # Code from module ioctl-tests:
   # Code from module isblank:
   # Code from module isblank-tests:
   # Code from module isnand-nolibm:
@@ -7291,20 +8570,32 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module isnanf-nolibm-tests:
   # Code from module isnanl-nolibm:
   # Code from module isnanl-nolibm-tests:
+  # Code from module iswblank:
+  # Code from module iswblank-tests:
+  # Code from module iswdigit:
+  # Code from module iswdigit-tests:
+  # Code from module iswxdigit:
+  # Code from module iswxdigit-tests:
   # Code from module langinfo:
   # Code from module langinfo-c++-tests:
   # Code from module langinfo-tests:
   # Code from module largefile:
 
-  # Code from module libsigsegv:
+  # Code from module libc-config:
   # Code from module limits-h:
+  # Code from module limits-h-c++-tests:
   # Code from module limits-h-tests:
   # Code from module link:
   # Code from module link-tests:
+  # Code from module linked-list:
+  # Code from module linked-list-tests:
   # Code from module linkedhash-list:
   # Code from module linkedhash-list-tests:
   # Code from module list:
+  # Code from module listen:
+  # Code from module listen-tests:
   # Code from module localcharset:
+  # Code from module localcharset-tests:
   # Code from module locale:
   # Code from module locale-c++-tests:
   # Code from module locale-tests:
@@ -7318,6 +8609,8 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module lstat:
   # Code from module lstat-tests:
   # Code from module maintainer-makefile:
+  # Code from module malloc-gnu:
+  # Code from module malloc-gnu-tests:
   # Code from module malloc-posix:
   # Code from module malloca:
   # Code from module malloca-tests:
@@ -7325,35 +8618,62 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module math:
   # Code from module math-c++-tests:
   # Code from module math-tests:
+  # Code from module mbchar:
+  # Code from module mbiter:
   # Code from module mbrtowc:
   # Code from module mbrtowc-tests:
   # Code from module mbsinit:
   # Code from module mbsinit-tests:
+  # Code from module mbslen:
+  # Code from module mbsstr:
+  # Code from module mbsstr-tests:
   # Code from module mbtowc:
+  # Code from module mbuiter:
   # Code from module memchr:
   # Code from module memchr-tests:
   # Code from module memchr2:
   # Code from module memchr2-tests:
+  # Code from module mempcpy:
+  # Code from module memrchr:
+  # Code from module memrchr-tests:
   # Code from module minmax:
+  # Code from module mkdir:
+  # Code from module mkdir-tests:
   # Code from module mkdtemp:
   # Code from module mkstemp:
   # Code from module msvc-inval:
   # Code from module msvc-nothrow:
   # Code from module multiarch:
+  # Code from module nanosleep:
+  # Code from module nanosleep-tests:
+  # Code from module netinet_in:
+  # Code from module netinet_in-tests:
   # Code from module nl_langinfo:
   # Code from module nl_langinfo-tests:
   # Code from module nocrash:
   # Code from module obstack:
   # Code from module open:
   # Code from module open-tests:
+  # Code from module openat:
+  # Code from module openat-die:
+  # Code from module openat-h:
+  # Code from module openat-tests:
   # Code from module opendir:
   # Code from module oset:
   # Code from module pathmax:
   # Code from module pathmax-tests:
+  # Code from module perror:
+  # Code from module perror-tests:
+  # Code from module pipe-posix:
+  # Code from module pipe-posix-tests:
   # Code from module pipe2:
   # Code from module pipe2-safer:
   # Code from module pipe2-tests:
+  # Code from module posix_spawn:
   # Code from module posix_spawn-internal:
+  # Code from module posix_spawn-tests:
+  # Code from module posix_spawn_file_actions_addchdir:
+  # Code from module posix_spawn_file_actions_addchdir-tests:
   # Code from module posix_spawn_file_actions_addclose:
   # Code from module posix_spawn_file_actions_addclose-tests:
   # Code from module posix_spawn_file_actions_adddup2:
@@ -7365,6 +8685,7 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module posix_spawnattr_destroy:
   # Code from module posix_spawnattr_init:
   # Code from module posix_spawnattr_setflags:
+  # Code from module posix_spawnattr_setpgroup:
   # Code from module posix_spawnattr_setsigmask:
   # Code from module posix_spawnp:
   # Code from module posix_spawnp-tests:
@@ -7374,6 +8695,38 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module printf-frexpl-tests:
   # Code from module printf-safe:
   # Code from module progname:
+  # Code from module propername:
+  # Code from module pthread-h:
+
+
+  if test -z "$gl_anythreadlib_early_done"; then
+    case "$host_os" in
+      osf*)
+        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+        # groks <pthread.h>. cc also understands the flag -pthread, but
+        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+        # 2. putting a flag into CPPFLAGS that has an effect on the linker
+        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+        ;;
+    esac
+    # Some systems optimize for single-threaded programs by default, and
+    # need special flags to disable these optimizations. For example, the
+    # definition of 'errno' in <errno.h>.
+    case "$host_os" in
+      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+    esac
+    gl_anythreadlib_early_done=done
+  fi
+
+  # Code from module pthread-h-c++-tests:
+  # Code from module pthread-h-tests:
+  # Code from module pthread-thread:
+  # Code from module pthread-thread-tests:
+  # Code from module pthread_sigmask:
+  # Code from module pthread_sigmask-tests:
   # Code from module putenv:
   # Code from module quotearg:
   # Code from module quotearg-simple:
@@ -7382,23 +8735,43 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module raise-tests:
   # Code from module rawmemchr:
   # Code from module rawmemchr-tests:
+  # Code from module read-file:
+  # Code from module read-file-tests:
   # Code from module readdir:
   # Code from module readlink:
   # Code from module readlink-tests:
+  # Code from module realloc-gnu:
+  # Code from module realloc-gnu-tests:
+  # Code from module realloc-posix:
+  # Code from module reallocarray:
+  # Code from module reallocarray-tests:
   # Code from module regex:
   # Code from module regex-tests:
   # Code from module rename:
   # Code from module rename-tests:
+  # Code from module rewinddir:
   # Code from module rmdir:
   # Code from module rmdir-tests:
+  # Code from module root-uid:
   # Code from module same-inode:
+  # Code from module save-cwd:
   # Code from module sched:
   # Code from module sched-tests:
+  # Code from module sched_yield:
+  # Code from module scratch_buffer:
+  # Code from module scratch_buffer-tests:
   # Code from module secure_getenv:
+  # Code from module select:
+  # Code from module select-tests:
   # Code from module setenv:
   # Code from module setenv-tests:
   # Code from module setlocale:
+  # Code from module setlocale-null:
+  # Code from module setlocale-null-tests:
   # Code from module setlocale-tests:
+  # Code from module setsockopt:
+  # Code from module setsockopt-tests:
+  # Code from module sh-filename:
   # Code from module sigaction:
   # Code from module sigaction-tests:
   # Code from module signal-h:
@@ -7410,6 +8783,8 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module sigpipe-tests:
   # Code from module sigprocmask:
   # Code from module sigprocmask-tests:
+  # Code from module sigsegv:
+  # Code from module sigsegv-tests:
   # Code from module size_max:
   # Code from module sleep:
   # Code from module sleep-tests:
@@ -7420,6 +8795,54 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module snippet/warn-on-use:
   # Code from module snprintf:
   # Code from module snprintf-tests:
+  # Code from module socket:
+  # Code from module socketlib:
+  # Code from module sockets:
+  # Code from module sockets-tests:
+  # Code from module socklen:
+  # Code from module sparcv8+:
+
+
+
+  case "$host_cpu" in
+    sparc*)
+      if test -n "$GCC"; then
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether SPARC v8+ instructions are supported" >&5
+printf %s "checking whether SPARC v8+ instructions are supported... " >&6; }
+if test ${gl_cv_sparc_v8plus+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+asm volatile ("membar 2");
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_sparc_v8plus=yes
+else $as_nop
+  gl_cv_sparc_v8plus=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sparc_v8plus" >&5
+printf "%s\n" "$gl_cv_sparc_v8plus" >&6; }
+        if test $gl_cv_sparc_v8plus = no; then
+                              CC="$CC -mcpu=v9"
+          CXX="$CXX -mcpu=v9"
+        fi
+      fi
+      ;;
+  esac
+
   # Code from module spawn:
   # Code from module spawn-c++-tests:
   # Code from module spawn-pipe:
@@ -7428,17 +8851,24 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module ssize_t:
   # Code from module stat:
   # Code from module stat-tests:
+  # Code from module stat-time:
+  # Code from module stat-time-tests:
+  # Code from module std-gnu11:
   # Code from module stdalign:
   # Code from module stdalign-tests:
   # Code from module stdarg:
 
 
 
+  # Code from module stdarg-tests:
   # Code from module stdbool:
+  # Code from module stdbool-c++-tests:
   # Code from module stdbool-tests:
   # Code from module stddef:
+  # Code from module stddef-c++-tests:
   # Code from module stddef-tests:
   # Code from module stdint:
+  # Code from module stdint-c++-tests:
   # Code from module stdint-tests:
   # Code from module stdio:
   # Code from module stdio-c++-tests:
@@ -7447,6 +8877,7 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module stdlib-c++-tests:
   # Code from module stdlib-safer:
   # Code from module stdlib-tests:
+  # Code from module stpcpy:
   # Code from module strchrnul:
   # Code from module strchrnul-tests:
   # Code from module strdup-posix:
@@ -7454,12 +8885,17 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module strerror:
   # Code from module strerror-override:
   # Code from module strerror-tests:
+  # Code from module strerror_r-posix:
+  # Code from module strerror_r-posix-tests:
+  # Code from module striconv:
+  # Code from module striconv-tests:
   # Code from module string:
   # Code from module string-c++-tests:
   # Code from module string-tests:
   # Code from module strndup:
   # Code from module strnlen:
   # Code from module strnlen-tests:
+  # Code from module strnlen1:
   # Code from module strsignal:
   # Code from module strsignal-tests:
   # Code from module strstr:
@@ -7469,6 +8905,18 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module strtod-tests:
   # Code from module symlink:
   # Code from module symlink-tests:
+  # Code from module sys_ioctl:
+  # Code from module sys_ioctl-c++-tests:
+  # Code from module sys_ioctl-tests:
+  # Code from module sys_random:
+  # Code from module sys_random-c++-tests:
+  # Code from module sys_random-tests:
+  # Code from module sys_select:
+  # Code from module sys_select-c++-tests:
+  # Code from module sys_select-tests:
+  # Code from module sys_socket:
+  # Code from module sys_socket-c++-tests:
+  # Code from module sys_socket-tests:
   # Code from module sys_stat:
   # Code from module sys_stat-c++-tests:
   # Code from module sys_stat-tests:
@@ -7478,12 +8926,17 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module sys_types:
   # Code from module sys_types-c++-tests:
   # Code from module sys_types-tests:
+  # Code from module sys_uio:
+  # Code from module sys_uio-tests:
   # Code from module sys_wait:
   # Code from module sys_wait-c++-tests:
   # Code from module sys_wait-tests:
   # Code from module tempname:
   # Code from module test-framework-sh:
   # Code from module test-framework-sh-tests:
+  # Code from module thread:
+  # Code from module thread-optim:
+  # Code from module thread-tests:
   # Code from module threadlib:
 
 
@@ -7493,12 +8946,23 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module time-tests:
   # Code from module tls:
   # Code from module tmpdir:
+  # Code from module trim:
   # Code from module unistd:
   # Code from module unistd-c++-tests:
   # Code from module unistd-safer:
   # Code from module unistd-safer-tests:
   # Code from module unistd-tests:
+  # Code from module unistr/base:
+  # Code from module unistr/u8-mbtoucr:
+  # Code from module unistr/u8-mbtoucr-tests:
+  # Code from module unistr/u8-uctomb:
+  # Code from module unistr/u8-uctomb-tests:
+  # Code from module unitypes:
+  # Code from module uniwidth/base:
+  # Code from module uniwidth/width:
+  # Code from module uniwidth/width-tests:
   # Code from module unlocked-io:
+  # Code from module unlocked-io-internal:
   # Code from module unsetenv:
   # Code from module unsetenv-tests:
   # Code from module update-copyright:
@@ -7518,6 +8982,7 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module version-etc:
   # Code from module version-etc-fsf:
   # Code from module version-etc-tests:
+  # Code from module vma-iter:
   # Code from module wait-process:
   # Code from module waitpid:
   # Code from module warnings:
@@ -7531,21 +8996,34 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
   # Code from module wctype-h:
   # Code from module wctype-h-c++-tests:
   # Code from module wctype-h-tests:
+  # Code from module wcwidth:
+  # Code from module wcwidth-tests:
+  # Code from module windows-mutex:
+  # Code from module windows-once:
+  # Code from module windows-recmutex:
+  # Code from module windows-rwlock:
+  # Code from module windows-spawn:
+  # Code from module windows-spin:
+  # Code from module windows-thread:
+  # Code from module windows-tls:
   # Code from module write:
   # Code from module write-tests:
   # Code from module xalloc:
   # Code from module xalloc-die:
   # Code from module xalloc-die-tests:
   # Code from module xalloc-oversized:
+  # Code from module xconcat-filename:
   # Code from module xlist:
   # Code from module xmalloca:
   # Code from module xoset:
   # Code from module xprintf:
   # Code from module xsize:
+  # Code from module xstriconv:
   # Code from module xstrndup:
   # Code from module xvasprintf:
   # Code from module xvasprintf-posix:
   # Code from module xvasprintf-tests:
+  # Code from module yield:
 
 
 # Maintainer note - comment this line out if you plan to rerun
@@ -7560,14 +9038,24 @@ $as_echo "$as_me: autobuild timestamp... $date" >&6;}
 
 
 
+printf "%s\n" "#define GNULIB_REGEX_SINGLE_THREAD 1" >>confdefs.h
+
+
+printf "%s\n" "#define GNULIB_MBRTOWC_SINGLE_THREAD 1" >>confdefs.h
+
+
+printf "%s\n" "#define GNULIB_WCHAR_SINGLE_LOCALE 1" >>confdefs.h
+
+
 # Check whether --enable-gcc-warnings was given.
-if test "${enable_gcc_warnings+set}" = set; then :
+if test ${enable_gcc_warnings+y}
+then :
   enableval=$enable_gcc_warnings; case $enableval in
      yes|no) ;;
      *)      as_fn_error $? "bad value $enableval for gcc-warnings option" "$LINENO" 5 ;;
    esac
    gl_gcc_warnings=$enableval
-else
+else $as_nop
   if test -f "$srcdir"/.tarball-version; then
      gl_gcc_warnings=no
    else
@@ -7578,11 +9066,20 @@ fi
 
 
 if test "$gl_gcc_warnings" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5
-$as_echo_n "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; }
-if ${gl_cv_warn_c__Werror__Wunknown_warning_option+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror -Wunknown-warning-option" >&5
+printf %s "checking whether C compiler handles -Werror -Wunknown-warning-option... " >&6; }
+if test ${gl_cv_warn_c__Werror__Wunknown_warning_option+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
   gl_save_compiler_FLAGS="$CFLAGS"
   as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option"
@@ -7590,37 +9087,48 @@ else
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   gl_cv_warn_c__Werror__Wunknown_warning_option=yes
-else
+else $as_nop
   gl_cv_warn_c__Werror__Wunknown_warning_option=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5
-$as_echo "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; }
-if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror__Wunknown_warning_option" >&5
+printf "%s\n" "$gl_cv_warn_c__Werror__Wunknown_warning_option" >&6; }
+if test "x$gl_cv_warn_c__Werror__Wunknown_warning_option" = xyes
+then :
   gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'
-else
+else $as_nop
   gl_unknown_warnings_are_errors=
 fi
 
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5
-$as_echo_n "checking whether C compiler handles -Werror... " >&6; }
-if ${gl_cv_warn_c__Werror+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Werror" >&5
+printf %s "checking whether C compiler handles -Werror... " >&6; }
+if test ${gl_cv_warn_c__Werror+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
   gl_save_compiler_FLAGS="$CFLAGS"
   as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror"
@@ -7628,26 +9136,28 @@ else
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   gl_cv_warn_c__Werror=yes
-else
+else $as_nop
   gl_cv_warn_c__Werror=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5
-$as_echo "$gl_cv_warn_c__Werror" >&6; }
-if test "x$gl_cv_warn_c__Werror" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Werror" >&5
+printf "%s\n" "$gl_cv_warn_c__Werror" >&6; }
+if test "x$gl_cv_warn_c__Werror" = xyes
+then :
   as_fn_append WERROR_CFLAGS " -Werror"
 fi
 
@@ -7656,11 +9166,12 @@ fi
 
   # We use '#pragma GCC diagnostic push' to silence some
   # warnings, but older gcc doesn't support this.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pragma GCC diagnostic push works" >&5
-$as_echo_n "checking whether pragma GCC diagnostic push works... " >&6; }
-if ${M4_cv_gcc_pragma_push_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pragma GCC diagnostic push works" >&5
+printf %s "checking whether pragma GCC diagnostic push works... " >&6; }
+if test ${M4_cv_gcc_pragma_push_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
     save_CFLAGS=$CFLAGS
     CFLAGS='-Wunknown-pragmas -Werror'
@@ -7671,23 +9182,24 @@ else
       #pragma GCC diagnostic pop
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   M4_cv_gcc_pragma_push_works=yes
-else
+else $as_nop
   M4_cv_gcc_pragma_push_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
     CFLAGS=$save_CFLAGS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $M4_cv_gcc_pragma_push_works" >&5
-$as_echo "$M4_cv_gcc_pragma_push_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $M4_cv_gcc_pragma_push_works" >&5
+printf "%s\n" "$M4_cv_gcc_pragma_push_works" >&6; }
 
   # This, $nw, is the list of warnings we disable.
   nw=
@@ -7696,6 +9208,7 @@ $as_echo "$M4_cv_gcc_pragma_push_works" >&6; }
   nw="$nw -Wundef"                  # K&R is anachronistic
   nw="$nw -Wtraditional"            # K&R is anachronistic
   nw="$nw -Wlong-long"              # C90 is anachronistic
+  nw="$nw -Wvla"                   # gettext's use of VLAs is safe
   nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
   nw="$nw -Wpadded"                 # Our structs are not packed
   nw="$nw -Wconversion"             # Too many warnings for now
@@ -7707,11 +9220,12 @@ $as_echo "$M4_cv_gcc_pragma_push_works" >&6; }
 
   # Gnulib uses '#pragma GCC diagnostic push' to silence some
   # warnings, but older gcc doesn't support this.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pragma GCC diagnostic push works" >&5
-$as_echo_n "checking whether pragma GCC diagnostic push works... " >&6; }
-if ${M4_cv_gcc_pragma_push_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pragma GCC diagnostic push works" >&5
+printf %s "checking whether pragma GCC diagnostic push works... " >&6; }
+if test ${M4_cv_gcc_pragma_push_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
     save_CFLAGS=$CFLAGS
     CFLAGS='-Wunknown-pragmas -Werror'
@@ -7722,23 +9236,24 @@ else
       #pragma GCC diagnostic pop
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   M4_cv_gcc_pragma_push_works=yes
-else
+else $as_nop
   M4_cv_gcc_pragma_push_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
     CFLAGS=$save_CFLAGS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $M4_cv_gcc_pragma_push_works" >&5
-$as_echo "$M4_cv_gcc_pragma_push_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $M4_cv_gcc_pragma_push_works" >&5
+printf "%s\n" "$M4_cv_gcc_pragma_push_works" >&6; }
   if test $M4_cv_gcc_pragma_push_works = no; then
     nw="$nw -Wmissing-prototypes"
     nw="$nw -Wmissing-declarations"
@@ -7746,110 +9261,119 @@ $as_echo "$M4_cv_gcc_pragma_push_works" >&6; }
   fi
 
 
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
 
   if test -n "$GCC"; then
 
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5
-$as_echo_n "checking whether -Wno-missing-field-initializers is supported... " >&6; }
-    if ${gl_cv_cc_nomfi_supported+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is supported" >&5
+printf %s "checking whether -Wno-missing-field-initializers is supported... " >&6; }
+if test ${gl_cv_cc_nomfi_supported+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Wextra -Werror -Wno-missing-field-initializers"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   gl_cv_cc_nomfi_supported=yes
-else
+else $as_nop
   gl_cv_cc_nomfi_supported=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-      CFLAGS="$gl_save_CFLAGS"
-fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+       CFLAGS="$gl_save_CFLAGS"
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5
-$as_echo "$gl_cv_cc_nomfi_supported" >&6; }
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_supported" >&5
+printf "%s\n" "$gl_cv_cc_nomfi_supported" >&6; }
 
     if test "$gl_cv_cc_nomfi_supported" = yes; then
-                  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5
-$as_echo_n "checking whether -Wno-missing-field-initializers is needed... " >&6; }
-      if ${gl_cv_cc_nomfi_needed+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-        gl_save_CFLAGS="$CFLAGS"
-        CFLAGS="$CFLAGS -W -Werror"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wno-missing-field-initializers is needed" >&5
+printf %s "checking whether -Wno-missing-field-initializers is needed... " >&6; }
+if test ${gl_cv_cc_nomfi_needed+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_save_CFLAGS="$CFLAGS"
+         CFLAGS="$CFLAGS -Wextra -Werror"
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 int f (void)
-               {
-                 typedef struct { int a; int b; } s_t;
-                 s_t s1 = { 0, };
-                 return s1.b;
-               }
+                {
+                  typedef struct { int a; int b; } s_t;
+                  s_t s1 = { 0, };
+                  return s1.b;
+                }
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   gl_cv_cc_nomfi_needed=no
-else
+else $as_nop
   gl_cv_cc_nomfi_needed=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        CFLAGS="$gl_save_CFLAGS"
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         CFLAGS="$gl_save_CFLAGS"
 
 fi
-
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5
-$as_echo "$gl_cv_cc_nomfi_needed" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_nomfi_needed" >&5
+printf "%s\n" "$gl_cv_cc_nomfi_needed" >&6; }
     fi
 
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5
-$as_echo_n "checking whether -Wuninitialized is supported... " >&6; }
-    if ${gl_cv_cc_uninitialized_supported+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -Werror -Wuninitialized"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether -Wuninitialized is supported" >&5
+printf %s "checking whether -Wuninitialized is supported... " >&6; }
+if test ${gl_cv_cc_uninitialized_supported+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Werror -Wuninitialized"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   gl_cv_cc_uninitialized_supported=yes
-else
+else $as_nop
   gl_cv_cc_uninitialized_supported=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-      CFLAGS="$gl_save_CFLAGS"
-fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+       CFLAGS="$gl_save_CFLAGS"
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5
-$as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_uninitialized_supported" >&5
+printf "%s\n" "$gl_cv_cc_uninitialized_supported" >&6; }
 
   fi
 
@@ -7857,182 +9381,113 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
   # To compare this list to your installed GCC's, run this Bash command:
   #
   # comm -3 \
-  #  <(sed -n 's/^  *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
-  #  <(gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort |
-  #      grep -v -x -f <(
-  #         awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec))
-
-  gl_manywarn_set=
-  for gl_manywarn_item in \
-    -fno-common \
-    -W \
-    -Wabi \
-    -Waddress \
-    -Waggressive-loop-optimizations \
+  #  <((sed -n 's/^  *\(-[^ 0-9][^ ]*\).*/\1/p' manywarnings.m4; \
+  #     awk '/^[^#]/ {print ws}' ../build-aux/gcc-warning.spec) | sort) \
+  #  <(LC_ALL=C gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort)
+
+  ws=
+  for gl_manywarn_item in -fanalyzer -fno-common \
     -Wall \
-    -Wattributes \
+    -Warith-conversion \
     -Wbad-function-cast \
-    -Wbool-compare \
-    -Wbuiltin-macro-redefined \
-    -Wcast-align \
-    -Wchar-subscripts \
-    -Wchkp \
-    -Wclobbered \
-    -Wcomment \
-    -Wcomments \
-    -Wcoverage-mismatch \
-    -Wcpp \
+    -Wcast-align=strict \
     -Wdate-time \
-    -Wdeprecated \
-    -Wdeprecated-declarations \
-    -Wdesignated-init \
     -Wdisabled-optimization \
-    -Wdiscarded-array-qualifiers \
-    -Wdiscarded-qualifiers \
-    -Wdiv-by-zero \
     -Wdouble-promotion \
+    -Wduplicated-branches \
     -Wduplicated-cond \
-    -Wempty-body \
-    -Wendif-labels \
-    -Wenum-compare \
     -Wextra \
-    -Wformat-contains-nul \
-    -Wformat-extra-args \
-    -Wformat-nonliteral \
-    -Wformat-security \
     -Wformat-signedness \
-    -Wformat-y2k \
-    -Wformat-zero-length \
-    -Wframe-address \
-    -Wfree-nonheap-object \
-    -Whsa \
-    -Wignored-attributes \
-    -Wignored-qualifiers \
-    -Wimplicit \
-    -Wimplicit-function-declaration \
-    -Wimplicit-int \
-    -Wincompatible-pointer-types \
     -Winit-self \
     -Winline \
-    -Wint-conversion \
-    -Wint-to-pointer-cast \
-    -Winvalid-memory-model \
     -Winvalid-pch \
-    -Wjump-misses-init \
-    -Wlogical-not-parentheses \
     -Wlogical-op \
-    -Wmain \
-    -Wmaybe-uninitialized \
-    -Wmemset-transposed-args \
-    -Wmisleading-indentation \
-    -Wmissing-braces \
     -Wmissing-declarations \
-    -Wmissing-field-initializers \
     -Wmissing-include-dirs \
-    -Wmissing-parameter-type \
     -Wmissing-prototypes \
-    -Wmultichar \
-    -Wnarrowing \
     -Wnested-externs \
-    -Wnonnull \
-    -Wnonnull-compare \
     -Wnull-dereference \
-    -Wodr \
-    -Wold-style-declaration \
     -Wold-style-definition \
     -Wopenmp-simd \
-    -Woverflow \
     -Woverlength-strings \
-    -Woverride-init \
     -Wpacked \
-    -Wpacked-bitfield-compat \
-    -Wparentheses \
     -Wpointer-arith \
-    -Wpointer-sign \
-    -Wpointer-to-int-cast \
-    -Wpragmas \
-    -Wreturn-local-addr \
-    -Wreturn-type \
-    -Wscalar-storage-order \
-    -Wsequence-point \
     -Wshadow \
-    -Wshift-count-negative \
-    -Wshift-count-overflow \
-    -Wshift-negative-value \
-    -Wsizeof-array-argument \
-    -Wsizeof-pointer-memaccess \
     -Wstack-protector \
-    -Wstrict-aliasing \
     -Wstrict-overflow \
     -Wstrict-prototypes \
+    -Wsuggest-attribute=cold \
     -Wsuggest-attribute=const \
     -Wsuggest-attribute=format \
+    -Wsuggest-attribute=malloc \
     -Wsuggest-attribute=noreturn \
     -Wsuggest-attribute=pure \
     -Wsuggest-final-methods \
     -Wsuggest-final-types \
-    -Wswitch \
-    -Wswitch-bool \
-    -Wswitch-default \
     -Wsync-nand \
     -Wsystem-headers \
-    -Wtautological-compare \
     -Wtrampolines \
-    -Wtrigraphs \
-    -Wtype-limits \
     -Wuninitialized \
     -Wunknown-pragmas \
     -Wunsafe-loop-optimizations \
-    -Wunused \
-    -Wunused-but-set-parameter \
-    -Wunused-but-set-variable \
-    -Wunused-function \
-    -Wunused-label \
-    -Wunused-local-typedefs \
     -Wunused-macros \
-    -Wunused-parameter \
-    -Wunused-result \
-    -Wunused-value \
-    -Wunused-variable \
-    -Wvarargs \
     -Wvariadic-macros \
     -Wvector-operation-performance \
     -Wvla \
-    -Wvolatile-register-var \
     -Wwrite-strings \
     \
     ; do
-    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
+    as_fn_append ws " $gl_manywarn_item"
   done
 
   # gcc --help=warnings outputs an unusual form for these options; list
   # them here so that the above 'comm' command doesn't report a false match.
-  gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
-  gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
-  gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2"
-  gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2"
+  as_fn_append ws ' -Warray-bounds=2'
+  as_fn_append ws ' -Wattribute-alias=2'
+  as_fn_append ws ' -Wformat-overflow=2'
+  as_fn_append ws ' -Wformat=2'
+  as_fn_append ws ' -Wformat-truncation=2'
+  as_fn_append ws ' -Wimplicit-fallthrough=5'
+  as_fn_append ws ' -Wshift-overflow=2'
+  as_fn_append ws ' -Wunused-const-variable=2'
+  as_fn_append ws ' -Wvla-larger-than=4031'
 
   # These are needed for older GCC versions.
   if test -n "$GCC"; then
     case `($CC --version) 2>/dev/null` in
       'gcc (GCC) '[0-3].* | \
       'gcc (GCC) '4.[0-7].*)
-        gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option"
-        gl_manywarn_set="$gl_manywarn_set -funit-at-a-time"
+        as_fn_append ws ' -fdiagnostics-show-option'
+        as_fn_append ws ' -funit-at-a-time'
           ;;
     esac
   fi
 
   # Disable specific options as needed.
   if test "$gl_cv_cc_nomfi_needed" = yes; then
-    gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
+    as_fn_append ws ' -Wno-missing-field-initializers'
   fi
 
   if test "$gl_cv_cc_uninitialized_supported" = no; then
-    gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized"
+    as_fn_append ws ' -Wno-uninitialized'
   fi
 
-  ws=$gl_manywarn_set
+  # Some warnings have too many false alarms in GCC 10.1.
+  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93695
+  as_fn_append ws ' -Wno-analyzer-double-free'
+  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94458
+  as_fn_append ws ' -Wno-analyzer-malloc-leak'
+  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94851
+  as_fn_append ws ' -Wno-analyzer-null-dereference'
+  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95758
+  as_fn_append ws ' -Wno-analyzer-use-after-free'
+
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
 
 
   gl_warn_set=
@@ -8043,7 +9498,7 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
       *" $gl_warn_item "*)
         ;;
       *)
-        gl_warn_set="$gl_warn_set $gl_warn_item"
+        as_fn_append gl_warn_set " $gl_warn_item"
         ;;
     esac
   done
@@ -8051,16 +9506,18 @@ $as_echo "$gl_cv_cc_uninitialized_supported" >&6; }
 
   for w in $ws; do
 
-as_gl_Warn=`$as_echo "gl_cv_warn_c_$w" | $as_tr_sh`
+
+as_gl_Warn=`printf "%s\n" "gl_cv_warn_c_$w" | $as_tr_sh`
 gl_positive="$w"
 case $gl_positive in
   -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
 esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5
-$as_echo_n "checking whether C compiler handles $w... " >&6; }
-if eval \${$as_gl_Warn+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles $w" >&5
+printf %s "checking whether C compiler handles $w... " >&6; }
+if eval test \${$as_gl_Warn+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
   gl_save_compiler_FLAGS="$CFLAGS"
   as_fn_append CFLAGS " $gl_unknown_warnings_are_errors $gl_positive"
@@ -8068,27 +9525,29 @@ else
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   eval "$as_gl_Warn=yes"
-else
+else $as_nop
   eval "$as_gl_Warn=no"
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
 eval ac_res=\$$as_gl_Warn
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_gl_Warn"\" = x"yes"; then :
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_gl_Warn"\" = x"yes"
+then :
   as_fn_append WARN_CFLAGS " $w"
 fi
 
@@ -8099,11 +9558,13 @@ fi
   # we temporarily override it in format.c if possible.
   if test $M4_cv_gcc_pragma_push_works = no; then
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5
-$as_echo_n "checking whether C compiler handles -Wno-format-nonliteral... " >&6; }
-if ${gl_cv_warn_c__Wno_format_nonliteral+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler handles -Wno-format-nonliteral" >&5
+printf %s "checking whether C compiler handles -Wno-format-nonliteral... " >&6; }
+if test ${gl_cv_warn_c__Wno_format_nonliteral+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
   gl_save_compiler_FLAGS="$CFLAGS"
   as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wformat-nonliteral"
@@ -8111,26 +9572,28 @@ else
 /* end confdefs.h.  */
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   gl_cv_warn_c__Wno_format_nonliteral=yes
-else
+else $as_nop
   gl_cv_warn_c__Wno_format_nonliteral=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
   CFLAGS="$gl_save_compiler_FLAGS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5
-$as_echo "$gl_cv_warn_c__Wno_format_nonliteral" >&6; }
-if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_c__Wno_format_nonliteral" >&5
+printf "%s\n" "$gl_cv_warn_c__Wno_format_nonliteral" >&6; }
+if test "x$gl_cv_warn_c__Wno_format_nonliteral" = xyes
+then :
   as_fn_append WARN_CFLAGS " -Wno-format-nonliteral"
 fi
 
@@ -8146,11 +9609,12 @@ fi
 # 'unsigned long long int', which confuses assumptions made by gnulib.
 # Simply pretend that neither type exists if both do not work.
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
-$as_echo_n "checking for unsigned long long int... " >&6; }
-if ${ac_cv_type_unsigned_long_long_int+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+printf %s "checking for unsigned long long int... " >&6; }
+if test ${ac_cv_type_unsigned_long_long_int+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   ac_cv_type_unsigned_long_long_int=yes
      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8171,7 +9635,7 @@ else
                      ? 1 : -1)];
       int i = 63;
 int
-main ()
+main (void)
 {
 /* Test availability of runtime routines for shift and division.  */
       long long int llmax = 9223372036854775807ll;
@@ -8185,37 +9649,40 @@ main ()
 }
 
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
 
-else
+else $as_nop
   ac_cv_type_unsigned_long_long_int=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
      fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
-$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; }
   if test $ac_cv_type_unsigned_long_long_int = yes; then
 
-$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
 
   fi
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
-$as_echo_n "checking for long long int... " >&6; }
-if ${ac_cv_type_long_long_int+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for long long int" >&5
+printf %s "checking for long long int... " >&6; }
+if test ${ac_cv_type_long_long_int+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   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 :
+                                        if test "$cross_compiling" = yes
+then :
   :
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <limits.h>
@@ -8225,7 +9692,7 @@ else
                  # define LLONG_MAX (HALF - 1 + HALF)
                  #endif
 int
-main ()
+main (void)
 {
 long long int n = 1;
                  int i;
@@ -8242,9 +9709,10 @@ long long int n = 1;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
 
-else
+else $as_nop
   ac_cv_type_long_long_int=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
@@ -8254,20 +9722,21 @@ fi
         fi
       fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
-$as_echo "$ac_cv_type_long_long_int" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5
+printf "%s\n" "$ac_cv_type_long_long_int" >&6; }
   if test $ac_cv_type_long_long_int = yes; then
 
-$as_echo "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
+printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
 
   fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
-$as_echo_n "checking for unsigned long long int... " >&6; }
-if ${ac_cv_type_unsigned_long_long_int+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsigned long long int" >&5
+printf %s "checking for unsigned long long int... " >&6; }
+if test ${ac_cv_type_unsigned_long_long_int+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   ac_cv_type_unsigned_long_long_int=yes
      if test "x${ac_cv_prog_cc_c99-no}" = xno; then
        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8288,7 +9757,7 @@ else
                      ? 1 : -1)];
       int i = 63;
 int
-main ()
+main (void)
 {
 /* Test availability of runtime routines for shift and division.  */
       long long int llmax = 9223372036854775807ll;
@@ -8302,20 +9771,21 @@ main ()
 }
 
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
 
-else
+else $as_nop
   ac_cv_type_unsigned_long_long_int=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
      fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
-$as_echo "$ac_cv_type_unsigned_long_long_int" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5
+printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; }
   if test $ac_cv_type_unsigned_long_long_int = yes; then
 
-$as_echo "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
+printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
 
   fi
 
@@ -8323,7 +9793,7 @@ if test $ac_cv_type_long_long_int:$ac_cv_type_unsigned_long_long_int = yes:no
 then
   ac_cv_type_long_long_int=no
 
-$as_echo "#define HAVE_LONG_LONG_INT 0" >>confdefs.h
+printf "%s\n" "#define HAVE_LONG_LONG_INT 0" >>confdefs.h
 
 fi
 
 
 
 
+
+
+
+                        # Check whether --enable-cross-guesses was given.
+if test ${enable_cross_guesses+y}
+then :
+  enableval=$enable_cross_guesses; if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-cross-guesses" >&5
+printf "%s\n" "$as_me: WARNING: invalid argument supplied to --enable-cross-guesses" >&2;}
+       enableval=conservative
+     fi
+     gl_cross_guesses="$enableval"
+else $as_nop
+  gl_cross_guesses=conservative
+fi
+
+  if test $gl_cross_guesses = risky; then
+    gl_cross_guess_normal="guessing yes"
+    gl_cross_guess_inverted="guessing no"
+  else
+    gl_cross_guess_normal="guessing no"
+    gl_cross_guess_inverted="guessing yes"
+  fi
           LIBC_FATAL_STDERR_=1
   export LIBC_FATAL_STDERR_
 
+
+
+    HAVE_CHOWN=1;
+  HAVE_COPY_FILE_RANGE=1;
+  HAVE_DUP3=1;
+  HAVE_EUIDACCESS=1;
+  HAVE_EXECVPE=1;
+  HAVE_FACCESSAT=1;
+  HAVE_FCHDIR=1;
+  HAVE_FCHOWNAT=1;
+  HAVE_FDATASYNC=1;
+  HAVE_FSYNC=1;
+  HAVE_FTRUNCATE=1;
+  HAVE_GETDTABLESIZE=1;
+  HAVE_GETENTROPY=1;
+  HAVE_GETGROUPS=1;
+  HAVE_GETHOSTNAME=1;
+  HAVE_GETLOGIN=1;
+  HAVE_GETPAGESIZE=1;
+  HAVE_GETPASS=1;
+  HAVE_GROUP_MEMBER=1;
+  HAVE_LCHOWN=1;
+  HAVE_LINK=1;
+  HAVE_LINKAT=1;
+  HAVE_PIPE=1;
+  HAVE_PIPE2=1;
+  HAVE_PREAD=1;
+  HAVE_PWRITE=1;
+  HAVE_READLINK=1;
+  HAVE_READLINKAT=1;
+  HAVE_SETHOSTNAME=1;
+  HAVE_SLEEP=1;
+  HAVE_SYMLINK=1;
+  HAVE_SYMLINKAT=1;
+  HAVE_UNLINKAT=1;
+  HAVE_USLEEP=1;
+  HAVE_DECL_ENVIRON=1;
+  HAVE_DECL_EXECVPE=1;
+  HAVE_DECL_FCHDIR=1;
+  HAVE_DECL_FDATASYNC=1;
+  HAVE_DECL_GETDOMAINNAME=1;
+  HAVE_DECL_GETLOGIN=1;
+  HAVE_DECL_GETLOGIN_R=1;
+  HAVE_DECL_GETPAGESIZE=1;
+  HAVE_DECL_GETUSERSHELL=1;
+  HAVE_DECL_SETHOSTNAME=1;
+  HAVE_DECL_TRUNCATE=1;
+  HAVE_DECL_TTYNAME_R=1;
+  HAVE_OS_H=0;
+  HAVE_SYS_PARAM_H=0;
+  REPLACE_ACCESS=0;
+  REPLACE_CHOWN=0;
+  REPLACE_CLOSE=0;
+  REPLACE_DUP=0;
+  REPLACE_DUP2=0;
+  REPLACE_EXECL=0;
+  REPLACE_EXECLE=0;
+  REPLACE_EXECLP=0;
+  REPLACE_EXECV=0;
+  REPLACE_EXECVE=0;
+  REPLACE_EXECVP=0;
+  REPLACE_EXECVPE=0;
+  REPLACE_FACCESSAT=0;
+  REPLACE_FCHOWNAT=0;
+  REPLACE_FTRUNCATE=0;
+  REPLACE_GETCWD=0;
+  REPLACE_GETDOMAINNAME=0;
+  REPLACE_GETDTABLESIZE=0;
+  REPLACE_GETLOGIN_R=0;
+  REPLACE_GETGROUPS=0;
+  REPLACE_GETPAGESIZE=0;
+  REPLACE_GETPASS=0;
+  REPLACE_ISATTY=0;
+  REPLACE_LCHOWN=0;
+  REPLACE_LINK=0;
+  REPLACE_LINKAT=0;
+  REPLACE_LSEEK=0;
+  REPLACE_PREAD=0;
+  REPLACE_PWRITE=0;
+  REPLACE_READ=0;
+  REPLACE_READLINK=0;
+  REPLACE_READLINKAT=0;
+  REPLACE_RMDIR=0;
+  REPLACE_SLEEP=0;
+  REPLACE_SYMLINK=0;
+  REPLACE_SYMLINKAT=0;
+  REPLACE_TRUNCATE=0;
+  REPLACE_TTYNAME_R=0;
+  REPLACE_UNLINK=0;
+  REPLACE_UNLINKAT=0;
+  REPLACE_USLEEP=0;
+  REPLACE_WRITE=0;
+  UNISTD_H_HAVE_SYS_RANDOM_H=0;
+  UNISTD_H_HAVE_WINSOCK2_H=0;
+  UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+
+
+
+
+  GL_M4_GNULIB_ACCESS=0
+
+
+
+  GL_M4_GNULIB_CHDIR=0
+
+
+
+  GL_M4_GNULIB_CHOWN=0
+
+
+
+  GL_M4_GNULIB_CLOSE=0
+
+
+
+  GL_M4_GNULIB_COPY_FILE_RANGE=0
+
+
+
+  GL_M4_GNULIB_DUP=0
+
+
+
+  GL_M4_GNULIB_DUP2=0
+
+
+
+  GL_M4_GNULIB_DUP3=0
+
+
+
+  GL_M4_GNULIB_ENVIRON=0
+
+
+
+  GL_M4_GNULIB_EUIDACCESS=0
+
+
+
+  GL_M4_GNULIB_EXECL=0
+
+
+
+  GL_M4_GNULIB_EXECLE=0
+
+
+
+  GL_M4_GNULIB_EXECLP=0
+
+
+
+  GL_M4_GNULIB_EXECV=0
+
+
+
+  GL_M4_GNULIB_EXECVE=0
+
+
+
+  GL_M4_GNULIB_EXECVP=0
+
+
+
+  GL_M4_GNULIB_EXECVPE=0
+
+
+
+  GL_M4_GNULIB_FACCESSAT=0
+
+
+
+  GL_M4_GNULIB_FCHDIR=0
+
+
+
+  GL_M4_GNULIB_FCHOWNAT=0
+
+
+
+  GL_M4_GNULIB_FDATASYNC=0
+
+
+
+  GL_M4_GNULIB_FSYNC=0
+
+
+
+  GL_M4_GNULIB_FTRUNCATE=0
+
+
+
+  GL_M4_GNULIB_GETCWD=0
+
+
+
+  GL_M4_GNULIB_GETDOMAINNAME=0
+
+
+
+  GL_M4_GNULIB_GETDTABLESIZE=0
+
+
+
+  GL_M4_GNULIB_GETENTROPY=0
+
+
+
+  GL_M4_GNULIB_GETGROUPS=0
+
+
+
+  GL_M4_GNULIB_GETHOSTNAME=0
+
+
+
+  GL_M4_GNULIB_GETLOGIN=0
+
+
+
+  GL_M4_GNULIB_GETLOGIN_R=0
+
+
+
+  GL_M4_GNULIB_GETOPT_POSIX=0
+
+
+
+  GL_M4_GNULIB_GETPAGESIZE=0
+
+
+
+  GL_M4_GNULIB_GETPASS=0
+
+
+
+  GL_M4_GNULIB_GETUSERSHELL=0
+
+
+
+  GL_M4_GNULIB_GROUP_MEMBER=0
+
+
+
+  GL_M4_GNULIB_ISATTY=0
+
+
+
+  GL_M4_GNULIB_LCHOWN=0
+
+
+
+  GL_M4_GNULIB_LINK=0
+
+
+
+  GL_M4_GNULIB_LINKAT=0
+
+
+
+  GL_M4_GNULIB_LSEEK=0
+
+
+
+  GL_M4_GNULIB_PIPE=0
+
+
+
+  GL_M4_GNULIB_PIPE2=0
+
+
+
+  GL_M4_GNULIB_PREAD=0
+
+
+
+  GL_M4_GNULIB_PWRITE=0
+
+
+
+  GL_M4_GNULIB_READ=0
+
+
+
+  GL_M4_GNULIB_READLINK=0
+
+
+
+  GL_M4_GNULIB_READLINKAT=0
+
+
+
+  GL_M4_GNULIB_RMDIR=0
+
+
+
+  GL_M4_GNULIB_SETHOSTNAME=0
+
+
+
+  GL_M4_GNULIB_SLEEP=0
+
+
+
+  GL_M4_GNULIB_SYMLINK=0
+
+
+
+  GL_M4_GNULIB_SYMLINKAT=0
+
+
+
+  GL_M4_GNULIB_TRUNCATE=0
+
+
+
+  GL_M4_GNULIB_TTYNAME_R=0
+
+
+
+  GL_M4_GNULIB_UNISTD_H_NONBLOCKING=0
+
+
+
+  GL_M4_GNULIB_UNISTD_H_SIGPIPE=0
+
+
+
+  GL_M4_GNULIB_UNLINK=0
+
+
+
+  GL_M4_GNULIB_UNLINKAT=0
+
+
+
+  GL_M4_GNULIB_USLEEP=0
+
+
+
+  GL_M4_GNULIB_WRITE=0
+
+
+
+  GL_M4_GNULIB_MDA_ACCESS=1
+
+
+
+  GL_M4_GNULIB_MDA_CHDIR=1
+
+
+
+  GL_M4_GNULIB_MDA_CLOSE=1
+
+
+
+  GL_M4_GNULIB_MDA_DUP=1
+
+
+
+  GL_M4_GNULIB_MDA_DUP2=1
+
+
+
+  GL_M4_GNULIB_MDA_EXECL=1
+
+
+
+  GL_M4_GNULIB_MDA_EXECLE=1
+
+
+
+  GL_M4_GNULIB_MDA_EXECLP=1
+
+
+
+  GL_M4_GNULIB_MDA_EXECV=1
+
+
+
+  GL_M4_GNULIB_MDA_EXECVE=1
+
+
+
+  GL_M4_GNULIB_MDA_EXECVP=1
+
+
+
+  GL_M4_GNULIB_MDA_EXECVPE=1
+
+
+
+  GL_M4_GNULIB_MDA_GETCWD=1
+
+
+
+  GL_M4_GNULIB_MDA_GETPID=1
+
+
+
+  GL_M4_GNULIB_MDA_ISATTY=1
+
+
+
+  GL_M4_GNULIB_MDA_LSEEK=1
+
+
+
+  GL_M4_GNULIB_MDA_READ=1
+
+
+
+  GL_M4_GNULIB_MDA_RMDIR=1
+
+
+
+  GL_M4_GNULIB_MDA_SWAB=1
+
+
+
+  GL_M4_GNULIB_MDA_UNLINK=1
+
+
+
+  GL_M4_GNULIB_MDA_WRITE=1
+
+
+
 ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default"
-if test "x$ac_cv_type_size_t" = xyes; then :
+if test "x$ac_cv_type_size_t" = xyes
+then :
 
-else
+else $as_nop
 
-cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
-_ACEOF
+printf "%s\n" "#define size_t unsigned int" >>confdefs.h
 
 fi
 
 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
 # for constant arguments.  Useless!
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
-$as_echo_n "checking for working alloca.h... " >&6; }
-if ${ac_cv_working_alloca_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working alloca.h" >&5
+printf %s "checking for working alloca.h... " >&6; }
+if test ${ac_cv_working_alloca_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <alloca.h>
 int
-main ()
+main (void)
 {
 char *p = (char *) alloca (2 * sizeof (int));
                          if (p) return 0;
@@ -8365,52 +10285,52 @@ char *p = (char *) alloca (2 * sizeof (int));
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   ac_cv_working_alloca_h=yes
-else
+else $as_nop
   ac_cv_working_alloca_h=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
-$as_echo "$ac_cv_working_alloca_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_alloca_h" >&5
+printf "%s\n" "$ac_cv_working_alloca_h" >&6; }
 if test $ac_cv_working_alloca_h = yes; then
 
-$as_echo "#define HAVE_ALLOCA_H 1" >>confdefs.h
+printf "%s\n" "#define HAVE_ALLOCA_H 1" >>confdefs.h
 
 fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
-$as_echo_n "checking for alloca... " >&6; }
-if ${ac_cv_func_alloca_works+:} false; then :
-  $as_echo_n "(cached) " >&6
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca" >&5
+printf %s "checking for alloca... " >&6; }
+if test ${ac_cv_func_alloca_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test $ac_cv_working_alloca_h = yes; then
+  ac_cv_func_alloca_works=yes
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#ifdef __GNUC__
-# define alloca __builtin_alloca
-#else
-# ifdef _MSC_VER
+#include <stdlib.h>
+#include <stddef.h>
+#ifndef alloca
+# ifdef __GNUC__
+#  define alloca __builtin_alloca
+# elif defined _MSC_VER
 #  include <malloc.h>
 #  define alloca _alloca
 # else
-#  ifdef HAVE_ALLOCA_H
-#   include <alloca.h>
-#  else
-#   ifdef _AIX
- #pragma alloca
-#   else
-#    ifndef alloca /* predefined by HP cc +Olibcalls */
-void *alloca (size_t);
-#    endif
-#   endif
+#  ifdef  __cplusplus
+extern "C"
 #  endif
+void *alloca (size_t);
 # endif
 #endif
 
 int
-main ()
+main (void)
 {
 char *p = (char *) alloca (1);
                                    if (p) return 0;
@@ -8418,20 +10338,22 @@ char *p = (char *) alloca (1);
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   ac_cv_func_alloca_works=yes
-else
+else $as_nop
   ac_cv_func_alloca_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
-$as_echo "$ac_cv_func_alloca_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_alloca_works" >&5
+printf "%s\n" "$ac_cv_func_alloca_works" >&6; }
+fi
 
 if test $ac_cv_func_alloca_works = yes; then
 
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
+printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h
 
 else
   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
@@ -8445,58 +10367,19 @@ else
 
 ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
 
-$as_echo "#define C_ALLOCA 1" >>confdefs.h
-
+printf "%s\n" "#define C_ALLOCA 1" >>confdefs.h
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether \`alloca.c' needs Cray hooks" >&5
-$as_echo_n "checking whether \`alloca.c' needs Cray hooks... " >&6; }
-if ${ac_cv_os_cray+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "webecray" >/dev/null 2>&1; then :
-  ac_cv_os_cray=yes
-else
-  ac_cv_os_cray=no
-fi
-rm -f conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_os_cray" >&5
-$as_echo "$ac_cv_os_cray" >&6; }
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-
-cat >>confdefs.h <<_ACEOF
-#define CRAY_STACKSEG_END $ac_func
-_ACEOF
-
-    break
-fi
-
-  done
-fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
-$as_echo_n "checking stack direction for C alloca... " >&6; }
-if ${ac_cv_c_stack_direction+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking stack direction for C alloca" >&5
+printf %s "checking stack direction for C alloca... " >&6; }
+if test ${ac_cv_c_stack_direction+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
   ac_cv_c_stack_direction=0
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 $ac_includes_default
@@ -8517,9 +10400,10 @@ main (int argc, char **argv)
   return find_stack_direction (0, argc + !argv + 20) < 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
   ac_cv_c_stack_direction=1
-else
+else $as_nop
   ac_cv_c_stack_direction=-1
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
@@ -8527,55 +10411,59 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
 fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
-$as_echo "$ac_cv_c_stack_direction" >&6; }
-cat >>confdefs.h <<_ACEOF
-#define STACK_DIRECTION $ac_cv_c_stack_direction
-_ACEOF
-
-
-fi
-
-
-  GNULIB_BTOWC=0;
-  GNULIB_WCTOB=0;
-  GNULIB_MBSINIT=0;
-  GNULIB_MBRTOWC=0;
-  GNULIB_MBRLEN=0;
-  GNULIB_MBSRTOWCS=0;
-  GNULIB_MBSNRTOWCS=0;
-  GNULIB_WCRTOMB=0;
-  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;
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_stack_direction" >&5
+printf "%s\n" "$ac_cv_c_stack_direction" >&6; }
+printf "%s\n" "#define STACK_DIRECTION $ac_cv_c_stack_direction" >>confdefs.h
+
+
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
+printf %s "checking for inline... " >&6; }
+if test ${ac_cv_c_inline+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_cv_c_inline=no
+for ac_kw in inline __inline__ __inline; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo (void) {return 0; }
+$ac_kw foo_t foo (void) {return 0; }
+#endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_inline=$ac_kw
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+  test "$ac_cv_c_inline" != no && break
+done
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
+printf "%s\n" "$ac_cv_c_inline" >&6; }
+
+case $ac_cv_c_inline in
+  inline | yes) ;;
+  *)
+    case $ac_cv_c_inline in
+      no) ac_val=;;
+      *) ac_val=$ac_cv_c_inline;;
+    esac
+    cat >>confdefs.h <<_ACEOF
+#ifndef __cplusplus
+#define inline $ac_val
+#endif
+_ACEOF
+    ;;
+esac
+
+
+
     HAVE_BTOWC=1;
   HAVE_MBSINIT=1;
   HAVE_MBRTOWC=1;
@@ -8589,6 +10477,7 @@ fi
   HAVE_WMEMCMP=1;
   HAVE_WMEMCPY=1;
   HAVE_WMEMMOVE=1;
+  HAVE_WMEMPCPY=1;
   HAVE_WMEMSET=1;
   HAVE_WCSLEN=1;
   HAVE_WCSNLEN=1;
@@ -8613,7 +10502,9 @@ fi
   HAVE_WCSSTR=1;
   HAVE_WCSTOK=1;
   HAVE_WCSWIDTH=1;
+  HAVE_WCSFTIME=1;
   HAVE_DECL_WCTOB=1;
+  HAVE_DECL_WCSDUP=1;
   HAVE_DECL_WCWIDTH=1;
   REPLACE_MBSTATE_T=0;
   REPLACE_BTOWC=0;
   REPLACE_WCSNRTOMBS=0;
   REPLACE_WCWIDTH=0;
   REPLACE_WCSWIDTH=0;
+  REPLACE_WCSFTIME=0;
+  REPLACE_WCSTOK=0;
 
 
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
-$as_echo_n "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
-if ${gl_cv_header_wchar_h_correct_inline+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <wchar.h> uses 'inline' correctly" >&5
+printf %s "checking whether <wchar.h> uses 'inline' correctly... " >&6; }
+if test ${gl_cv_header_wchar_h_correct_inline+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   gl_cv_header_wchar_h_correct_inline=yes
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+     case "$host_os" in
+       *-gnu* | gnu*)
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* 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(); }
+
+             #define wcstod renamed_wcstod
+             #include <wchar.h>
+             extern int zero (void);
+             int main () { return zero(); }
 
 _ACEOF
-                              save_ac_compile="$ac_compile"
-     ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
-     if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+                                                      save_ac_compile="$ac_compile"
+         ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
+         if echo '#include "conftest.c"' >conftest1.c \
+            && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* 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; }
+
+               #define wcstod renamed_wcstod
+               #include <wchar.h>
+               int zero (void) { return 0; }
 
 _ACEOF
-              ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
-       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+                      ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
+           if echo '#include "conftest.c"' >conftest2.c \
+              && { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-         if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
-           :
-         else
-           gl_cv_header_wchar_h_correct_inline=no
+             if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&5 2>&1; then
+               :
+             else
+               gl_cv_header_wchar_h_correct_inline=no
+             fi
+           fi
          fi
-       fi
-     fi
-     ac_compile="$save_ac_compile"
-     rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+         ac_compile="$save_ac_compile"
+         rm -f conftest12.c conftest12.$ac_objext conftest$ac_exeext
+         ;;
+     esac
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
-$as_echo "$gl_cv_header_wchar_h_correct_inline" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_wchar_h_correct_inline" >&5
+printf "%s\n" "$gl_cv_header_wchar_h_correct_inline" >&6; }
   if test $gl_cv_header_wchar_h_correct_inline = no; then
     as_fn_error $? "<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
 This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
 C99 mode. You have four options:
   - Add the flag -fgnu89-inline to CC and reconfigure, or
   - Fix your include files, using parts of
-    <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
+    <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
   - Use a gcc version older than 4.3, or
   - Don't use the flags -std=c99 or -std=gnu99.
 Configuration aborted." "$LINENO" 5
   fi
 
-
-
-
-  for ac_func in $ac_func_list
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
+ac_func=
+for ac_item in $ac_func_c_list
+do
+  if test $ac_func; then
+    ac_fn_c_check_func "$LINENO" $ac_func ac_cv_func_$ac_func
+    if eval test \"x\$ac_cv_func_$ac_func\" = xyes; then
+      echo "#define $ac_item 1" >> confdefs.h
+    fi
+    ac_func=
+  else
+    ac_func=$ac_item
+  fi
 done
 
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
-$as_echo_n "checking for nl_langinfo and CODESET... " >&6; }
-if ${am_cv_langinfo_codeset+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for nl_langinfo and CODESET" >&5
+printf %s "checking for nl_langinfo and CODESET... " >&6; }
+if test ${am_cv_langinfo_codeset+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <langinfo.h>
 int
-main ()
+main (void)
 {
 char* cs = nl_langinfo(CODESET); return !cs;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   am_cv_langinfo_codeset=yes
-else
+else $as_nop
   am_cv_langinfo_codeset=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
-$as_echo "$am_cv_langinfo_codeset" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5
+printf "%s\n" "$am_cv_langinfo_codeset" >&6; }
   if test $am_cv_langinfo_codeset = yes; then
 
-$as_echo "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
+printf "%s\n" "#define HAVE_LANGINFO_CODESET 1" >>confdefs.h
 
   fi
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
-$as_echo_n "checking for a traditional french locale... " >&6; }
-if ${gt_cv_locale_fr+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -8778,8 +10666,14 @@ else
 struct tm t;
 char buf[16];
 int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
   /* Check whether the given locale name is recognized by the system.  */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
   /* On native Windows, setlocale(category, "") looks at the system settings,
      not at the environment variables.  Also, when an encoding suffix such
      as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -8787,9 +10681,9 @@ int main () {
   if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
       || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
     return 1;
-#else
+# else
   if (setlocale (LC_ALL, "") == NULL) return 1;
-#endif
+# endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On Mac OS 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.
@@ -8798,39 +10692,40 @@ int main () {
      some unit tests fail.
      On MirBSD 10, when an unsupported locale is specified, setlocale()
      succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
+# if HAVE_LANGINFO_CODESET
   {
     const char *cs = nl_langinfo (CODESET);
     if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
         || strcmp (cs, "UTF-8") == 0)
       return 1;
   }
-#endif
-#ifdef __CYGWIN__
+# endif
+# ifdef __CYGWIN__
   /* On Cygwin, avoid locale names without encoding suffix, because the
      locale_charset() function relies on the encoding suffix.  Note that
      LC_ALL is set on the command line.  */
   if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
+# endif
   /* Check whether in the abbreviation of the second month, the second
      character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
      one byte long. This excludes the UTF-8 encoding.  */
   t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
   if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
   /* Check whether the decimal separator is a comma.
      On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
      are nl_langinfo(RADIXCHAR) are both ".".  */
   if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
+# endif
   return 0;
+#endif
 }
 
 _ACEOF
     if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
   (eval $ac_link) 2>&5
   ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; } && test -s conftest$ac_exeext; then
       case "$host_os" in
         # Handle native Windows specially, because there setlocale() interprets
@@ -8886,1276 +10781,612 @@ _ACEOF
     rm -fr conftest*
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
-$as_echo "$gt_cv_locale_fr" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
   LOCALE_FR=$gt_cv_locale_fr
 
 
 
 
+  GL_M4_GNULIB_BTOWC=0
 
 
 
-  for ac_header in $ac_header_list
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+  GL_M4_GNULIB_WCTOB=0
 
-fi
 
-done
 
+  GL_M4_GNULIB_MBSINIT=0
 
 
 
+  GL_M4_GNULIB_MBRTOWC=0
 
 
 
+  GL_M4_GNULIB_MBRLEN=0
 
-            case "$host_os" in
-     sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems
-       FAULT_YIELDS_SIGBUS=1 ;;
-     hpux*) # HP-UX
-       FAULT_YIELDS_SIGBUS=1 ;;
-     macos* | darwin*) # Mac OS X
-       FAULT_YIELDS_SIGBUS=1 ;;
-     gnu*) # Hurd
-       FAULT_YIELDS_SIGBUS=1 ;;
-     *)
-       FAULT_YIELDS_SIGBUS=0 ;;
-   esac
 
-cat >>confdefs.h <<_ACEOF
-#define FAULT_YIELDS_SIGBUS $FAULT_YIELDS_SIGBUS
-_ACEOF
 
+  GL_M4_GNULIB_MBSRTOWCS=0
 
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working C stack overflow detection" >&5
-$as_echo_n "checking for working C stack overflow detection... " >&6; }
-if ${ac_cv_sys_stack_overflow_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_sys_stack_overflow_works=cross-compiling
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-            #include <unistd.h>
-            #include <signal.h>
-            #if HAVE_SETRLIMIT
-            # include <sys/types.h>
-            # include <sys/time.h>
-            # include <sys/resource.h>
-            #endif
-            #ifndef SIGSTKSZ
-            # define SIGSTKSZ 16384
-            #endif
 
-            static union
-            {
-              char buffer[2 * SIGSTKSZ];
-              long double ld;
-              long u;
-              void *p;
-            } alternate_signal_stack;
-
-            static void
-            segv_handler (int signo)
-            {
-              _exit (0);
-            }
+  GL_M4_GNULIB_MBSNRTOWCS=0
 
-            static int
-            c_stack_action ()
-            {
-              stack_t st;
-              struct sigaction act;
-              int r;
-
-              st.ss_flags = 0;
-              /* Use the midpoint to avoid Irix sigaltstack bug.  */
-              st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
-              st.ss_size = SIGSTKSZ;
-              r = sigaltstack (&st, 0);
-              if (r != 0)
-                return 1;
 
-              sigemptyset (&act.sa_mask);
-              act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND;
-              act.sa_handler = segv_handler;
-              #if FAULT_YIELDS_SIGBUS
-              if (sigaction (SIGBUS, &act, 0) < 0)
-                return 2;
-              #endif
-              if (sigaction (SIGSEGV, &act, 0) < 0)
-                return 3;
-              return 0;
-            }
-            static volatile int *
-            recurse_1 (volatile int n, volatile int *p)
-            {
-              if (n >= 0)
-                *recurse_1 (n + 1, p) += n;
-              return p;
-            }
-            static int
-            recurse (volatile int n)
-            {
-              int sum = 0;
-              return *recurse_1 (n, &sum);
-            }
-            int
-            main ()
-            {
-              int result;
-              #if HAVE_SETRLIMIT && defined RLIMIT_STACK
-              /* Before starting the endless recursion, try to be friendly
-                 to the user's machine.  On some Linux 2.2.x systems, there
-                 is no stack limit for user processes at all.  We don't want
-                 to kill such systems.  */
-              struct rlimit rl;
-              rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
-              setrlimit (RLIMIT_STACK, &rl);
-              #endif
 
-              result = c_stack_action ();
-              if (result != 0)
-                return result;
-              return recurse (0);
-            }
+  GL_M4_GNULIB_WCRTOMB=0
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_sys_stack_overflow_works=yes
-else
-  ac_cv_sys_stack_overflow_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_stack_overflow_works" >&5
-$as_echo "$ac_cv_sys_stack_overflow_works" >&6; }
 
-  if test $ac_cv_sys_stack_overflow_works = yes; then
+  GL_M4_GNULIB_WCSRTOMBS=0
 
-$as_echo "#define HAVE_STACK_OVERFLOW_HANDLING 1" >>confdefs.h
 
 
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for correct stack_t interpretation" >&5
-$as_echo_n "checking for correct stack_t interpretation... " >&6; }
-if ${gl_cv_sigaltstack_low_base+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  GL_M4_GNULIB_WCSNRTOMBS=0
 
-      if test "$cross_compiling" = yes; then :
-  gl_cv_sigaltstack_low_base=cross-compiling
-else
+
+
+  GL_M4_GNULIB_WCWIDTH=0
+
+
+
+  GL_M4_GNULIB_WMEMCHR=0
+
+
+
+  GL_M4_GNULIB_WMEMCMP=0
+
+
+
+  GL_M4_GNULIB_WMEMCPY=0
+
+
+
+  GL_M4_GNULIB_WMEMMOVE=0
+
+
+
+  GL_M4_GNULIB_WMEMPCPY=0
+
+
+
+  GL_M4_GNULIB_WMEMSET=0
+
+
+
+  GL_M4_GNULIB_WCSLEN=0
+
+
+
+  GL_M4_GNULIB_WCSNLEN=0
+
+
+
+  GL_M4_GNULIB_WCSCPY=0
+
+
+
+  GL_M4_GNULIB_WCPCPY=0
+
+
+
+  GL_M4_GNULIB_WCSNCPY=0
+
+
+
+  GL_M4_GNULIB_WCPNCPY=0
+
+
+
+  GL_M4_GNULIB_WCSCAT=0
+
+
+
+  GL_M4_GNULIB_WCSNCAT=0
+
+
+
+  GL_M4_GNULIB_WCSCMP=0
+
+
+
+  GL_M4_GNULIB_WCSNCMP=0
+
+
+
+  GL_M4_GNULIB_WCSCASECMP=0
+
+
+
+  GL_M4_GNULIB_WCSNCASECMP=0
+
+
+
+  GL_M4_GNULIB_WCSCOLL=0
+
+
+
+  GL_M4_GNULIB_WCSXFRM=0
+
+
+
+  GL_M4_GNULIB_WCSDUP=0
+
+
+
+  GL_M4_GNULIB_WCSCHR=0
+
+
+
+  GL_M4_GNULIB_WCSRCHR=0
+
+
+
+  GL_M4_GNULIB_WCSCSPN=0
+
+
+
+  GL_M4_GNULIB_WCSSPN=0
+
+
+
+  GL_M4_GNULIB_WCSPBRK=0
+
+
+
+  GL_M4_GNULIB_WCSSTR=0
+
+
+
+  GL_M4_GNULIB_WCSTOK=0
+
+
+
+  GL_M4_GNULIB_WCSWIDTH=0
+
+
+
+  GL_M4_GNULIB_WCSFTIME=0
+
+
+
+  GL_M4_GNULIB_MDA_WCSDUP=1
+
+
+
+
+    HAVE__EXIT=1;
+  HAVE_ALIGNED_ALLOC=1;
+  HAVE_ATOLL=1;
+  HAVE_CANONICALIZE_FILE_NAME=1;
+  HAVE_DECL_ECVT=1;
+  HAVE_DECL_FCVT=1;
+  HAVE_DECL_GCVT=1;
+  HAVE_DECL_GETLOADAVG=1;
+  HAVE_GETSUBOPT=1;
+  HAVE_GRANTPT=1;
+  HAVE_INITSTATE=1;
+  HAVE_DECL_INITSTATE=1;
+  HAVE_MBTOWC=1;
+  HAVE_MKDTEMP=1;
+  HAVE_MKOSTEMP=1;
+  HAVE_MKOSTEMPS=1;
+  HAVE_MKSTEMP=1;
+  HAVE_MKSTEMPS=1;
+  HAVE_POSIX_MEMALIGN=1;
+  HAVE_POSIX_OPENPT=1;
+  HAVE_PTSNAME=1;
+  HAVE_PTSNAME_R=1;
+  HAVE_QSORT_R=1;
+  HAVE_RANDOM=1;
+  HAVE_RANDOM_H=1;
+  HAVE_RANDOM_R=1;
+  HAVE_REALLOCARRAY=1;
+  HAVE_REALPATH=1;
+  HAVE_RPMATCH=1;
+  HAVE_SECURE_GETENV=1;
+  HAVE_SETENV=1;
+  HAVE_DECL_SETENV=1;
+  HAVE_SETSTATE=1;
+  HAVE_DECL_SETSTATE=1;
+  HAVE_STRTOD=1;
+  HAVE_STRTOL=1;
+  HAVE_STRTOLD=1;
+  HAVE_STRTOLL=1;
+  HAVE_STRTOUL=1;
+  HAVE_STRTOULL=1;
+  HAVE_STRUCT_RANDOM_DATA=1;
+  HAVE_SYS_LOADAVG_H=0;
+  HAVE_UNLOCKPT=1;
+  HAVE_DECL_UNSETENV=1;
+  REPLACE_ALIGNED_ALLOC=0;
+  REPLACE_CALLOC=0;
+  REPLACE_CANONICALIZE_FILE_NAME=0;
+  REPLACE_FREE=0;
+  REPLACE_INITSTATE=0;
+  REPLACE_MALLOC=0;
+  REPLACE_MBTOWC=0;
+  REPLACE_MKSTEMP=0;
+  REPLACE_POSIX_MEMALIGN=0;
+  REPLACE_PTSNAME=0;
+  REPLACE_PTSNAME_R=0;
+  REPLACE_PUTENV=0;
+  REPLACE_QSORT_R=0;
+  REPLACE_RANDOM=0;
+  REPLACE_RANDOM_R=0;
+  REPLACE_REALLOC=0;
+  REPLACE_REALLOCARRAY=0;
+  REPLACE_REALPATH=0;
+  REPLACE_SETENV=0;
+  REPLACE_SETSTATE=0;
+  REPLACE_STRTOD=0;
+  REPLACE_STRTOL=0;
+  REPLACE_STRTOLD=0;
+  REPLACE_STRTOLL=0;
+  REPLACE_STRTOUL=0;
+  REPLACE_STRTOULL=0;
+  REPLACE_UNSETENV=0;
+  REPLACE_WCTOMB=0;
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc is ptrdiff_t safe" >&5
+printf %s "checking whether malloc is ptrdiff_t safe... " >&6; }
+if test ${gl_cv_malloc_ptrdiff+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <stdint.h>
 
-
-#include <stdlib.h>
-#include <signal.h>
-#if HAVE_SYS_SIGNAL_H
-# include <sys/signal.h>
-#endif
-#ifndef SIGSTKSZ
-# define SIGSTKSZ 16384
-#endif
-volatile char *stack_lower_bound;
-volatile char *stack_upper_bound;
-static void check_stack_location (volatile char *addr)
-{
-  if (addr >= stack_lower_bound && addr <= stack_upper_bound)
-    exit (0);
-  else
-    exit (1);
-}
-static void stackoverflow_handler (int sig)
-{
-  char dummy;
-  check_stack_location (&dummy);
-}
-int main ()
+int
+main (void)
 {
-  char mystack[2 * SIGSTKSZ];
-  stack_t altstack;
-  struct sigaction action;
-  /* Install the alternate stack.  */
-  altstack.ss_sp = mystack + SIGSTKSZ;
-  altstack.ss_size = SIGSTKSZ;
-  stack_lower_bound = (char *) altstack.ss_sp;
-  stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1;
-  altstack.ss_flags = 0; /* no SS_DISABLE */
-  if (sigaltstack (&altstack, NULL) < 0)
-    exit (2);
-  /* Install the SIGSEGV handler.  */
-  sigemptyset (&action.sa_mask);
-  action.sa_handler = &stackoverflow_handler;
-  action.sa_flags = SA_ONSTACK;
-  if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0)
-    exit(3);
-  /* Provoke a SIGSEGV.  */
-  raise (SIGSEGV);
-  exit (4);
+/* 64-bit ptrdiff_t is so wide that no practical platform
+               can exceed it.  */
+            #define WIDE_PTRDIFF (PTRDIFF_MAX >> 31 >> 31 != 0)
+
+            /* On rare machines where size_t fits in ptrdiff_t there
+               is no problem.  */
+            #define NARROW_SIZE (SIZE_MAX <= PTRDIFF_MAX)
+
+            /* glibc 2.30 and later malloc refuses to exceed ptrdiff_t
+               bounds even on 32-bit platforms.  We don't know which
+               non-glibc systems are safe.  */
+            #define KNOWN_SAFE (2 < __GLIBC__ + (30 <= __GLIBC_MINOR__))
+
+            #if WIDE_PTRDIFF || NARROW_SIZE || KNOWN_SAFE
+              return 0;
+            #else
+              #error "malloc might not be ptrdiff_t safe"
+              syntax error
+            #endif
+
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_sigaltstack_low_base=yes
-else
-  gl_cv_sigaltstack_low_base=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_malloc_ptrdiff=yes
+else $as_nop
+  gl_cv_malloc_ptrdiff=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sigaltstack_low_base" >&5
-$as_echo "$gl_cv_sigaltstack_low_base" >&6; }
-   if test "$gl_cv_sigaltstack_low_base" = no; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_malloc_ptrdiff" >&5
+printf "%s\n" "$gl_cv_malloc_ptrdiff" >&6; }
 
-$as_echo "#define SIGALTSTACK_SS_REVERSED 1" >>confdefs.h
 
-    fi
 
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for precise C stack overflow detection" >&5
-$as_echo_n "checking for precise C stack overflow detection... " >&6; }
-if ${ac_cv_sys_xsi_stack_overflow_heuristic+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-            #include <unistd.h>
-            #include <signal.h>
-            #if HAVE_UCONTEXT_H
-            # include <ucontext.h>
-            #endif
-            #if HAVE_SETRLIMIT
-            # include <sys/types.h>
-            # include <sys/time.h>
-            # include <sys/resource.h>
-            #endif
-            #ifndef SIGSTKSZ
-            # define SIGSTKSZ 16384
-            #endif
+  test "$gl_cv_malloc_ptrdiff" = yes || REPLACE_MALLOC=1
 
-            static union
-            {
-              char buffer[2 * SIGSTKSZ];
-              long double ld;
-              long u;
-              void *p;
-            } alternate_signal_stack;
-
-            #if STACK_DIRECTION
-            # define find_stack_direction(ptr) STACK_DIRECTION
-            #else
-            static int
-            find_stack_direction (char const *addr)
-            {
-              char dummy;
-              return (! addr ? find_stack_direction (&dummy)
-                      : addr < &dummy ? 1 : -1);
-            }
-            #endif
 
-            static void
-            segv_handler (int signo, siginfo_t *info, void *context)
-            {
-              if (0 < info->si_code)
-                {
-                  /* For XSI heuristics to work, we need uc_stack to describe
-                     the interrupted stack (as on Solaris), and not the
-                     currently executing stack (as on Linux).  */
-                  ucontext_t const *user_context = context;
-                  char const *stack_min = user_context->uc_stack.ss_sp;
-                  size_t stack_size = user_context->uc_stack.ss_size;
-                  char const *faulting_address = info->si_addr;
-                  size_t s = faulting_address - stack_min;
-                  size_t page_size = sysconf (_SC_PAGESIZE);
-                  if (find_stack_direction (0) < 0)
-                    s += page_size;
-                  if (s < stack_size + page_size)
-                    _exit (0);
-                  _exit (4);
-                }
-              _exit (5);
-            }
 
-            static int
-            c_stack_action ()
-            {
-              stack_t st;
-              struct sigaction act;
-              int r;
-
-              st.ss_flags = 0;
-              /* Use the midpoint to avoid Irix sigaltstack bug.  */
-              st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
-              st.ss_size = SIGSTKSZ;
-              r = sigaltstack (&st, 0);
-              if (r != 0)
-                return 1;
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc set errno on failure" >&5
+printf %s "checking whether malloc, realloc, calloc set errno on failure... " >&6; }
+if test ${gl_cv_func_malloc_posix+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-              sigemptyset (&act.sa_mask);
-              act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
-              act.sa_sigaction = segv_handler;
-              #if FAULT_YIELDS_SIGBUS
-              if (sigaction (SIGBUS, &act, 0) < 0)
-                return 2;
-              #endif
-              if (sigaction (SIGSEGV, &act, 0) < 0)
-                return 3;
-              return 0;
-            }
-            static volatile int *
-            recurse_1 (volatile int n, volatile int *p)
-            {
-              if (n >= 0)
-                *recurse_1 (n + 1, p) += n;
-              return p;
-            }
-            static int
-            recurse (volatile int n)
-            {
-              int sum = 0;
-              return *recurse_1 (n, &sum);
-            }
-            int
-            main ()
-            {
-              int result;
-              #if HAVE_SETRLIMIT && defined RLIMIT_STACK
-              /* Before starting the endless recursion, try to be friendly
-                 to the user's machine.  On some Linux 2.2.x systems, there
-                 is no stack limit for user processes at all.  We don't want
-                 to kill such systems.  */
-              struct rlimit rl;
-              rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
-              setrlimit (RLIMIT_STACK, &rl);
-              #endif
+                                    case "$host_os" in
+        mingw*)
+          gl_cv_func_malloc_posix=no ;;
+        irix* | solaris*)
 
-              result = c_stack_action ();
-              if (result != 0)
-                return result;
-              return recurse (0);
-            }
+          gl_cv_func_malloc_posix=no ;;
+        *)
+          gl_cv_func_malloc_posix=yes ;;
+      esac
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_sys_xsi_stack_overflow_heuristic=yes
-else
-  ac_cv_sys_xsi_stack_overflow_heuristic=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
+printf "%s\n" "$gl_cv_func_malloc_posix" >&6; }
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_xsi_stack_overflow_heuristic" >&5
-$as_echo "$ac_cv_sys_xsi_stack_overflow_heuristic" >&6; }
 
-   if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then
 
-$as_echo "#define HAVE_XSI_STACK_OVERFLOW_HEURISTIC 1" >>confdefs.h
 
-   fi
-  fi
 
-      if test "X$prefix" = "XNONE"; then
-    acl_final_prefix="$ac_default_prefix"
+  if test "$gl_cv_func_malloc_posix" = yes; then
+
+printf "%s\n" "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
+
   else
-    acl_final_prefix="$prefix"
+    REPLACE_MALLOC=1
   fi
-  if test "X$exec_prefix" = "XNONE"; then
-    acl_final_exec_prefix='${prefix}'
-  else
-    acl_final_exec_prefix="$exec_prefix"
+
+
+
+
+  if test $REPLACE_MALLOC = 1; then
+    REPLACE_CALLOC=1
   fi
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
-  prefix="$acl_save_prefix"
 
 
 
-# Check whether --with-gnu-ld was given.
-if test "${with_gnu_ld+set}" = set; then :
-  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
-else
-  with_gnu_ld=no
-fi
+  GL_M4_GNULIB__EXIT=0
 
-# Prepare PATH_SEPARATOR.
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
-  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
-  # contains only /bin. Note that ksh looks also at the FPATH variable,
-  # so we have to set that as well for the test.
-  PATH_SEPARATOR=:
-  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
-    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
-           || PATH_SEPARATOR=';'
-       }
-fi
 
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
-$as_echo_n "checking for ld used by $CC... " >&6; }
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [\\/]* | ?:[\\/]*)
-      re_direlt='/[^/][^/]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
-      while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
-        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
-elif test "$with_gnu_ld" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
-$as_echo_n "checking for GNU ld... " >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
-$as_echo_n "checking for non-GNU ld... " >&6; }
-fi
-if ${acl_cv_path_LD+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$LD"; then
-  acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$acl_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-        test "$with_gnu_ld" != no && break
-        ;;
-      *)
-        test "$with_gnu_ld" != yes && break
-        ;;
-      esac
-    fi
-  done
-  IFS="$acl_save_ifs"
-else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi
-fi
 
-LD="$acl_cv_path_LD"
-if test -n "$LD"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
-$as_echo "$LD" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
-$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
-if ${acl_cv_prog_gnu_ld+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # I'd rather use --version here, but apparently some GNU lds only accept -v.
-case `$LD -v 2>&1 </dev/null` in
-*GNU* | *'with BFD'*)
-  acl_cv_prog_gnu_ld=yes
-  ;;
-*)
-  acl_cv_prog_gnu_ld=no
-  ;;
-esac
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
-$as_echo "$acl_cv_prog_gnu_ld" >&6; }
-with_gnu_ld=$acl_cv_prog_gnu_ld
+  GL_M4_GNULIB_ALIGNED_ALLOC=0
 
 
 
+  GL_M4_GNULIB_ATOLL=0
 
-                                                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
-$as_echo_n "checking for shared library run path origin... " >&6; }
-if ${acl_cv_rpath+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
-    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
-    . ./conftest.sh
-    rm -f ./conftest.sh
-    acl_cv_rpath=done
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
-$as_echo "$acl_cv_rpath" >&6; }
-  wl="$acl_cv_wl"
-  acl_libext="$acl_cv_libext"
-  acl_shlibext="$acl_cv_shlibext"
-  acl_libname_spec="$acl_cv_libname_spec"
-  acl_library_names_spec="$acl_cv_library_names_spec"
-  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
-  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
-  acl_hardcode_direct="$acl_cv_hardcode_direct"
-  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
-    # Check whether --enable-rpath was given.
-if test "${enable_rpath+set}" = set; then :
-  enableval=$enable_rpath; :
-else
-  enable_rpath=yes
-fi
+  GL_M4_GNULIB_CALLOC_POSIX=0
 
 
 
+  GL_M4_GNULIB_CANONICALIZE_FILE_NAME=0
 
-  acl_libdirstem=lib
-  acl_libdirstem2=
-  case "$host_os" in
-    solaris*)
-                                    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit host" >&5
-$as_echo_n "checking for 64-bit host... " >&6; }
-if ${gl_cv_solaris_64bit+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#ifdef _LP64
-sixtyfour bits
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "sixtyfour bits" >/dev/null 2>&1; then :
-  gl_cv_solaris_64bit=yes
-else
-  gl_cv_solaris_64bit=no
-fi
-rm -f conftest*
+  GL_M4_GNULIB_FREE_POSIX=0
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_solaris_64bit" >&5
-$as_echo "$gl_cv_solaris_64bit" >&6; }
-      if test $gl_cv_solaris_64bit = yes; then
-        acl_libdirstem=lib/64
-        case "$host_cpu" in
-          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
-          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
-        esac
-      fi
-      ;;
-    *)
-      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
-      if test -n "$searchpath"; then
-        acl_save_IFS="${IFS=   }"; IFS=":"
-        for searchdir in $searchpath; do
-          if test -d "$searchdir"; then
-            case "$searchdir" in
-              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
-              */../ | */.. )
-                # Better ignore directories of this form. They are misleading.
-                ;;
-              *) searchdir=`cd "$searchdir" && pwd`
-                 case "$searchdir" in
-                   */lib64 ) acl_libdirstem=lib64 ;;
-                 esac ;;
-            esac
-          fi
-        done
-        IFS="$acl_save_IFS"
-      fi
-      ;;
-  esac
-  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
 
+  GL_M4_GNULIB_GETLOADAVG=0
 
 
 
+  GL_M4_GNULIB_GETSUBOPT=0
 
 
 
+  GL_M4_GNULIB_GRANTPT=0
 
 
 
+  GL_M4_GNULIB_MALLOC_POSIX=0
 
 
 
+  GL_M4_GNULIB_MBTOWC=0
 
 
-    use_additional=yes
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
+  GL_M4_GNULIB_MKDTEMP=0
 
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
 
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
+  GL_M4_GNULIB_MKOSTEMP=0
 
-# Check whether --with-libsigsegv-prefix was given.
-if test "${with_libsigsegv_prefix+set}" = set; then :
-  withval=$with_libsigsegv_prefix;
-    if test "X$withval" = "Xno"; then
-      use_additional=no
-    else
-      if test "X$withval" = "X"; then
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
 
-          eval additional_includedir=\"$includedir\"
-          eval additional_libdir=\"$libdir\"
+  GL_M4_GNULIB_MKOSTEMPS=0
 
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/$acl_libdirstem"
-        if test "$acl_libdirstem2" != "$acl_libdirstem" \
-           && ! test -d "$withval/$acl_libdirstem"; then
-          additional_libdir="$withval/$acl_libdirstem2"
-        fi
-      fi
-    fi
 
-fi
+  GL_M4_GNULIB_MKSTEMP=0
 
-      LIBSIGSEGV=
-  LTLIBSIGSEGV=
-  INCSIGSEGV=
-  LIBSIGSEGV_PREFIX=
-      HAVE_LIBSIGSEGV=
-  rpathdirs=
-  ltrpathdirs=
-  names_already_handled=
-  names_next_round='sigsegv '
-  while test -n "$names_next_round"; do
-    names_this_round="$names_next_round"
-    names_next_round=
-    for name in $names_this_round; do
-      already_handled=
-      for n in $names_already_handled; do
-        if test "$n" = "$name"; then
-          already_handled=yes
-          break
-        fi
-      done
-      if test -z "$already_handled"; then
-        names_already_handled="$names_already_handled $name"
-                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
-        eval value=\"\$HAVE_LIB$uppername\"
-        if test -n "$value"; then
-          if test "$value" = yes; then
-            eval value=\"\$LIB$uppername\"
-            test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value"
-            eval value=\"\$LTLIB$uppername\"
-            test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value"
-          else
-                                    :
-          fi
-        else
-                              found_dir=
-          found_la=
-          found_so=
-          found_a=
-          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
-          if test -n "$acl_shlibext"; then
-            shrext=".$acl_shlibext"             # typically: shrext=.so
-          else
-            shrext=
-          fi
-          if test $use_additional = yes; then
-            dir="$additional_libdir"
-                                    if test -n "$acl_shlibext"; then
-              if test -f "$dir/$libname$shrext"; then
-                found_dir="$dir"
-                found_so="$dir/$libname$shrext"
-              else
-                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                  ver=`(cd "$dir" && \
-                        for f in "$libname$shrext".*; do echo "$f"; done \
-                        | sed -e "s,^$libname$shrext\\\\.,," \
-                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                        | sed 1q ) 2>/dev/null`
-                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                    found_dir="$dir"
-                    found_so="$dir/$libname$shrext.$ver"
-                  fi
-                else
-                  eval library_names=\"$acl_library_names_spec\"
-                  for f in $library_names; do
-                    if test -f "$dir/$f"; then
-                      found_dir="$dir"
-                      found_so="$dir/$f"
-                      break
-                    fi
-                  done
-                fi
-              fi
-            fi
-                        if test "X$found_dir" = "X"; then
-              if test -f "$dir/$libname.$acl_libext"; then
-                found_dir="$dir"
-                found_a="$dir/$libname.$acl_libext"
-              fi
-            fi
-            if test "X$found_dir" != "X"; then
-              if test -f "$dir/$libname.la"; then
-                found_la="$dir/$libname.la"
-              fi
-            fi
-          fi
-          if test "X$found_dir" = "X"; then
-            for x in $LDFLAGS $LTLIBSIGSEGV; do
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-              case "$x" in
-                -L*)
-                  dir=`echo "X$x" | sed -e 's/^X-L//'`
-                                    if test -n "$acl_shlibext"; then
-                    if test -f "$dir/$libname$shrext"; then
-                      found_dir="$dir"
-                      found_so="$dir/$libname$shrext"
-                    else
-                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                        ver=`(cd "$dir" && \
-                              for f in "$libname$shrext".*; do echo "$f"; done \
-                              | sed -e "s,^$libname$shrext\\\\.,," \
-                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                              | sed 1q ) 2>/dev/null`
-                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                          found_dir="$dir"
-                          found_so="$dir/$libname$shrext.$ver"
-                        fi
-                      else
-                        eval library_names=\"$acl_library_names_spec\"
-                        for f in $library_names; do
-                          if test -f "$dir/$f"; then
-                            found_dir="$dir"
-                            found_so="$dir/$f"
-                            break
-                          fi
-                        done
-                      fi
-                    fi
-                  fi
-                                    if test "X$found_dir" = "X"; then
-                    if test -f "$dir/$libname.$acl_libext"; then
-                      found_dir="$dir"
-                      found_a="$dir/$libname.$acl_libext"
-                    fi
-                  fi
-                  if test "X$found_dir" != "X"; then
-                    if test -f "$dir/$libname.la"; then
-                      found_la="$dir/$libname.la"
-                    fi
-                  fi
-                  ;;
-              esac
-              if test "X$found_dir" != "X"; then
-                break
-              fi
-            done
-          fi
-          if test "X$found_dir" != "X"; then
-                        LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name"
-            if test "X$found_so" != "X"; then
-                                                        if test "$enable_rpath" = no \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
-                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
-              else
-                                                                                haveit=
-                for x in $ltrpathdirs; do
-                  if test "X$x" = "X$found_dir"; then
-                    haveit=yes
-                    break
-                  fi
-                done
-                if test -z "$haveit"; then
-                  ltrpathdirs="$ltrpathdirs $found_dir"
-                fi
-                                if test "$acl_hardcode_direct" = yes; then
-                                                      LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
-                else
-                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
-                                                            LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
-                                                            haveit=
-                    for x in $rpathdirs; do
-                      if test "X$x" = "X$found_dir"; then
-                        haveit=yes
-                        break
-                      fi
-                    done
-                    if test -z "$haveit"; then
-                      rpathdirs="$rpathdirs $found_dir"
-                    fi
-                  else
-                                                                                haveit=
-                    for x in $LDFLAGS $LIBSIGSEGV; do
+  GL_M4_GNULIB_MKSTEMPS=0
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-                      if test "X$x" = "X-L$found_dir"; then
-                        haveit=yes
-                        break
-                      fi
-                    done
-                    if test -z "$haveit"; then
-                      LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir"
-                    fi
-                    if test "$acl_hardcode_minus_L" != no; then
-                                                                                        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
-                    else
-                                                                                                                                                                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name"
-                    fi
-                  fi
-                fi
-              fi
-            else
-              if test "X$found_a" != "X"; then
-                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a"
-              else
-                                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name"
-              fi
-            fi
-                        additional_includedir=
-            case "$found_dir" in
-              */$acl_libdirstem | */$acl_libdirstem/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
-                if test "$name" = 'sigsegv'; then
-                  LIBSIGSEGV_PREFIX="$basedir"
-                fi
-                additional_includedir="$basedir/include"
-                ;;
-              */$acl_libdirstem2 | */$acl_libdirstem2/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
-                if test "$name" = 'sigsegv'; then
-                  LIBSIGSEGV_PREFIX="$basedir"
-                fi
-                additional_includedir="$basedir/include"
-                ;;
-            esac
-            if test "X$additional_includedir" != "X"; then
-                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
-                haveit=
-                if test "X$additional_includedir" = "X/usr/local/include"; then
-                  if test -n "$GCC"; then
-                    case $host_os in
-                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
-                    esac
-                  fi
-                fi
-                if test -z "$haveit"; then
-                  for x in $CPPFLAGS $INCSIGSEGV; do
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
+  GL_M4_GNULIB_POSIX_MEMALIGN=0
 
-                    if test "X$x" = "X-I$additional_includedir"; then
-                      haveit=yes
-                      break
-                    fi
-                  done
-                  if test -z "$haveit"; then
-                    if test -d "$additional_includedir"; then
-                                            INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir"
-                    fi
-                  fi
-                fi
-              fi
-            fi
-                        if test -n "$found_la"; then
-                                                        save_libdir="$libdir"
-              case "$found_la" in
-                */* | *\\*) . "$found_la" ;;
-                *) . "./$found_la" ;;
-              esac
-              libdir="$save_libdir"
-                            for dep in $dependency_libs; do
-                case "$dep" in
-                  -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
-                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
-                      haveit=
-                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
-                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
-                        if test -n "$GCC"; then
-                          case $host_os in
-                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
-                          esac
-                        fi
-                      fi
-                      if test -z "$haveit"; then
-                        haveit=
-                        for x in $LDFLAGS $LIBSIGSEGV; do
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
-                            haveit=yes
-                            break
-                          fi
-                        done
-                        if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir"
-                          fi
-                        fi
-                        haveit=
-                        for x in $LDFLAGS $LTLIBSIGSEGV; do
+  GL_M4_GNULIB_POSIX_OPENPT=0
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
-                            haveit=yes
-                            break
-                          fi
-                        done
-                        if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir"
-                          fi
-                        fi
-                      fi
-                    fi
-                    ;;
-                  -R*)
-                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
-                    if test "$enable_rpath" != no; then
-                                                                  haveit=
-                      for x in $rpathdirs; do
-                        if test "X$x" = "X$dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        rpathdirs="$rpathdirs $dir"
-                      fi
-                                                                  haveit=
-                      for x in $ltrpathdirs; do
-                        if test "X$x" = "X$dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        ltrpathdirs="$ltrpathdirs $dir"
-                      fi
-                    fi
-                    ;;
-                  -l*)
-                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
-                    ;;
-                  *.la)
-                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
-                    ;;
-                  *)
-                                        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep"
-                    LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep"
-                    ;;
-                esac
-              done
-            fi
-          else
-                                                            LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name"
-            LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name"
-          fi
-        fi
-      fi
-    done
-  done
-  if test "X$rpathdirs" != "X"; then
-    if test -n "$acl_hardcode_libdir_separator"; then
-                        alldirs=
-      for found_dir in $rpathdirs; do
-        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
-      done
-            acl_save_libdir="$libdir"
-      libdir="$alldirs"
-      eval flag=\"$acl_hardcode_libdir_flag_spec\"
-      libdir="$acl_save_libdir"
-      LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag"
-    else
-            for found_dir in $rpathdirs; do
-        acl_save_libdir="$libdir"
-        libdir="$found_dir"
-        eval flag=\"$acl_hardcode_libdir_flag_spec\"
-        libdir="$acl_save_libdir"
-        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag"
-      done
-    fi
-  fi
-  if test "X$ltrpathdirs" != "X"; then
-            for found_dir in $ltrpathdirs; do
-      LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir"
-    done
-  fi
 
+  GL_M4_GNULIB_PTSNAME=0
 
 
 
+  GL_M4_GNULIB_PTSNAME_R=0
 
 
 
-        ac_save_CPPFLAGS="$CPPFLAGS"
+  GL_M4_GNULIB_PUTENV=0
 
-  for element in $INCSIGSEGV; do
-    haveit=
-    for x in $CPPFLAGS; do
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-      if test "X$x" = "X$element"; then
-        haveit=yes
-        break
-      fi
-    done
-    if test -z "$haveit"; then
-      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
-    fi
-  done
+  GL_M4_GNULIB_QSORT_R=0
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5
-$as_echo_n "checking for libsigsegv... " >&6; }
-if ${ac_cv_libsigsegv+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    ac_save_LIBS="$LIBS"
-                                case " $LIBSIGSEGV" in
-      *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;;
-      *)       LIBS="$LIBSIGSEGV $LIBS" ;;
-    esac
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sigsegv.h>
-int
-main ()
-{
-sigsegv_deinstall_handler();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_libsigsegv=yes
-else
-  ac_cv_libsigsegv='no, consider installing GNU libsigsegv'
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LIBS="$ac_save_LIBS"
+  GL_M4_GNULIB_RANDOM=0
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5
-$as_echo "$ac_cv_libsigsegv" >&6; }
-  if test "$ac_cv_libsigsegv" = yes; then
-    HAVE_LIBSIGSEGV=yes
 
-$as_echo "#define HAVE_LIBSIGSEGV 1" >>confdefs.h
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5
-$as_echo_n "checking how to link with libsigsegv... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5
-$as_echo "$LIBSIGSEGV" >&6; }
-  else
-    HAVE_LIBSIGSEGV=no
-            CPPFLAGS="$ac_save_CPPFLAGS"
-    LIBSIGSEGV=
-    LTLIBSIGSEGV=
-    LIBSIGSEGV_PREFIX=
-  fi
+  GL_M4_GNULIB_RANDOM_R=0
 
 
 
+  GL_M4_GNULIB_REALLOCARRAY=0
 
 
 
+  GL_M4_GNULIB_REALLOC_POSIX=0
 
-    gl_cv_lib_sigsegv="$ac_cv_libsigsegv"
 
 
+  GL_M4_GNULIB_REALPATH=0
 
 
 
+  GL_M4_GNULIB_RPMATCH=0
 
-  GNULIB__EXIT=0;
-  GNULIB_ATOLL=0;
-  GNULIB_CALLOC_POSIX=0;
-  GNULIB_CANONICALIZE_FILE_NAME=0;
-  GNULIB_GETLOADAVG=0;
-  GNULIB_GETSUBOPT=0;
-  GNULIB_GRANTPT=0;
-  GNULIB_MALLOC_POSIX=0;
-  GNULIB_MBTOWC=0;
-  GNULIB_MKDTEMP=0;
-  GNULIB_MKOSTEMP=0;
-  GNULIB_MKOSTEMPS=0;
-  GNULIB_MKSTEMP=0;
-  GNULIB_MKSTEMPS=0;
-  GNULIB_POSIX_OPENPT=0;
-  GNULIB_PTSNAME=0;
-  GNULIB_PTSNAME_R=0;
-  GNULIB_PUTENV=0;
-  GNULIB_QSORT_R=0;
-  GNULIB_RANDOM=0;
-  GNULIB_RANDOM_R=0;
-  GNULIB_REALLOC_POSIX=0;
-  GNULIB_REALPATH=0;
-  GNULIB_RPMATCH=0;
-  GNULIB_SECURE_GETENV=0;
-  GNULIB_SETENV=0;
-  GNULIB_STRTOD=0;
-  GNULIB_STRTOLL=0;
-  GNULIB_STRTOULL=0;
-  GNULIB_SYSTEM_POSIX=0;
-  GNULIB_UNLOCKPT=0;
-  GNULIB_UNSETENV=0;
-  GNULIB_WCTOMB=0;
-    HAVE__EXIT=1;
-  HAVE_ATOLL=1;
-  HAVE_CANONICALIZE_FILE_NAME=1;
-  HAVE_DECL_GETLOADAVG=1;
-  HAVE_GETSUBOPT=1;
-  HAVE_GRANTPT=1;
-  HAVE_MKDTEMP=1;
-  HAVE_MKOSTEMP=1;
-  HAVE_MKOSTEMPS=1;
-  HAVE_MKSTEMP=1;
-  HAVE_MKSTEMPS=1;
-  HAVE_POSIX_OPENPT=1;
-  HAVE_PTSNAME=1;
-  HAVE_PTSNAME_R=1;
-  HAVE_QSORT_R=1;
-  HAVE_RANDOM=1;
-  HAVE_RANDOM_H=1;
-  HAVE_RANDOM_R=1;
-  HAVE_REALPATH=1;
-  HAVE_RPMATCH=1;
-  HAVE_SECURE_GETENV=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_DECL_UNSETENV=1;
-  REPLACE_CALLOC=0;
-  REPLACE_CANONICALIZE_FILE_NAME=0;
-  REPLACE_MALLOC=0;
-  REPLACE_MBTOWC=0;
-  REPLACE_MKSTEMP=0;
-  REPLACE_PTSNAME=0;
-  REPLACE_PTSNAME_R=0;
-  REPLACE_PUTENV=0;
-  REPLACE_QSORT_R=0;
-  REPLACE_RANDOM_R=0;
-  REPLACE_REALLOC=0;
-  REPLACE_REALPATH=0;
-  REPLACE_SETENV=0;
-  REPLACE_STRTOD=0;
-  REPLACE_UNSETENV=0;
-  REPLACE_WCTOMB=0;
 
 
+  GL_M4_GNULIB_SECURE_GETENV=0
 
 
 
+  GL_M4_GNULIB_SETENV=0
 
 
 
+  GL_M4_GNULIB_STRTOD=0
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
-$as_echo_n "checking whether // is distinct from /... " >&6; }
-if ${gl_cv_double_slash_root+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+
+  GL_M4_GNULIB_STRTOL=0
+
+
+
+  GL_M4_GNULIB_STRTOLD=0
+
+
+
+  GL_M4_GNULIB_STRTOLL=0
+
+
+
+  GL_M4_GNULIB_STRTOUL=0
+
+
+
+  GL_M4_GNULIB_STRTOULL=0
+
+
+
+  GL_M4_GNULIB_SYSTEM_POSIX=0
+
+
+
+  GL_M4_GNULIB_UNLOCKPT=0
+
+
+
+  GL_M4_GNULIB_UNSETENV=0
+
+
+
+  GL_M4_GNULIB_WCTOMB=0
+
+
+
+  GL_M4_GNULIB_MDA_ECVT=1
+
+
+
+  GL_M4_GNULIB_MDA_FCVT=1
+
+
+
+  GL_M4_GNULIB_MDA_GCVT=1
+
+
+
+  GL_M4_GNULIB_MDA_MKTEMP=1
+
+
+
+  GL_M4_GNULIB_MDA_PUTENV=1
+
+
+
+
+         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
+printf %s "checking whether lstat correctly handles trailing slash... " >&6; }
+if test ${gl_cv_func_lstat_dereferences_slashed_symlink+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  rm -f conftest.sym conftest.file
+     echo >conftest.file
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+          linux-* | linux)
+            # Guess yes on Linux systems.
+            gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+          *-gnu* | gnu*)
+            # Guess yes on glibc systems.
+            gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+          mingw*)
+            # Guess no on native Windows.
+            gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
+          *)
+            # If we don't know, obey --enable-cross-guesses.
+            gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
+        esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main (void)
+{
+struct stat sbuf;
+            if (symlink ("conftest.file", "conftest.sym") != 0)
+              return 1;
+            /* 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
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_lstat_dereferences_slashed_symlink=yes
+else $as_nop
+  gl_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+     rm -f conftest.sym conftest.file
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
+printf "%s\n" "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
+  case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
+    *yes)
+
+printf "%s\n" "#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
+printf %s "checking whether // is distinct from /... " >&6; }
+if test ${gl_cv_double_slash_root+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
    if test x"$cross_compiling" = xyes ; then
         # When cross-compiling, there is no way to tell whether // is special
         # short of a list of hosts.  However, the only known hosts to date
@@ -10180,11 +11411,11 @@ else
         fi
       fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
-$as_echo "$gl_cv_double_slash_root" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
+printf "%s\n" "$gl_cv_double_slash_root" >&6; }
   if test "$gl_cv_double_slash_root" = yes; then
 
-$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
+printf "%s\n" "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
 
   fi
 
@@ -10192,23 +11423,36 @@ $as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5
-$as_echo_n "checking whether realpath works... " >&6; }
-if ${gl_cv_func_realpath_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether realpath works" >&5
+printf %s "checking whether realpath works... " >&6; }
+if test ${gl_cv_func_realpath_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+    rm -rf conftest.a conftest.d
     touch conftest.a
+    # Assume that if we have lstat, we can also check symlinks.
+    if test $ac_cv_func_lstat = yes; then
+      ln -s conftest.a conftest.l
+    fi
     mkdir conftest.d
-    if test "$cross_compiling" = yes; then :
+    if test "$cross_compiling" = yes
+then :
   case "$host_os" in
                        # Guess yes on glibc systems.
         *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
-                       # If we don't know, assume the worst.
-        *)             gl_cv_func_realpath_works="guessing no" ;;
+                       # Guess 'nearly' on musl systems.
+        *-musl*)       gl_cv_func_realpath_works="guessing nearly" ;;
+                       # Guess no on Cygwin.
+        cygwin*)       gl_cv_func_realpath_works="guessing no" ;;
+                       # Guess no on native Windows.
+        mingw*)        gl_cv_func_realpath_works="guessing no" ;;
+                       # If we don't know, obey --enable-cross-guesses.
+        *)             gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
       esac
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -10251,7 +11495,7 @@ nocrash_init (void)
   /* Allocate a port on which the thread shall listen for exceptions.  */
   if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
       == KERN_SUCCESS) {
-    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
+    /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
     if (mach_port_insert_right (self, our_exception_port, our_exception_port,
                                 MACH_MSG_TYPE_MAKE_SEND)
         == KERN_SUCCESS) {
@@ -10270,14 +11514,14 @@ nocrash_init (void)
            for a particular thread.  This has the effect that when our exception
            port gets the message, the thread specific exception port has already
            been asked, and we don't need to bother about it.
-           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
+           See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
         task_set_exception_ports (self, mask, our_exception_port,
                                   EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
       }
     }
   }
 }
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
 /* Avoid a crash on native Windows.  */
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
@@ -10327,40 +11571,65 @@ nocrash_init (void)
 }
 #endif
 
+        #include <errno.h>
         #include <stdlib.h>
         #include <string.h>
 
 int
-main ()
+main (void)
 {
 
         int result = 0;
+        /* This test fails on Solaris 10.  */
         {
           char *name = realpath ("conftest.a", NULL);
           if (!(name && *name == '/'))
             result |= 1;
           free (name);
         }
+        /* This test fails on older versions of Cygwin.  */
         {
           char *name = realpath ("conftest.b/../conftest.a", NULL);
           if (name != NULL)
             result |= 2;
           free (name);
         }
+        /* This test fails on Cygwin 2.9.  */
+        #if HAVE_LSTAT
+        {
+          char *name = realpath ("conftest.l/../conftest.a", NULL);
+          if (name != NULL || errno != ENOTDIR)
+            result |= 4;
+          free (name);
+        }
+        #endif
+        /* This test fails on Mac OS X 10.13, OpenBSD 6.0.  */
         {
           char *name = realpath ("conftest.a/", NULL);
           if (name != NULL)
-            result |= 4;
+            result |= 8;
           free (name);
         }
+        /* This test fails on AIX 7, Solaris 10.  */
         {
           char *name1 = realpath (".", NULL);
           char *name2 = realpath ("conftest.d//./..", NULL);
           if (! name1 || ! name2 || strcmp (name1, name2))
-            result |= 8;
+            result |= 16;
           free (name1);
           free (name2);
         }
+        #ifdef __linux__
+        /* On Linux, // is the same as /. See also double-slash-root.m4.
+           realpath() should respect this.
+           This test fails on musl libc 1.2.2.  */
+        {
+          char *name = realpath ("//", NULL);
+          if (! name || strcmp (name, "/"))
+            result |= 32;
+          free (name);
+        }
+        #endif
         return result;
 
   ;
@@ -10368,24 +11637,34 @@ main ()
 }
 
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
   gl_cv_func_realpath_works=yes
-else
-  gl_cv_func_realpath_works=no
+else $as_nop
+  case $? in
+        32) gl_cv_func_realpath_works=nearly ;;
+        *)  gl_cv_func_realpath_works=no ;;
+      esac
+
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-    rm -rf conftest.a conftest.d
+    rm -rf conftest.a conftest.l conftest.d
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
-$as_echo "$gl_cv_func_realpath_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_realpath_works" >&5
+printf "%s\n" "$gl_cv_func_realpath_works" >&6; }
   case "$gl_cv_func_realpath_works" in
     *yes)
 
-$as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
+printf "%s\n" "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
+
+      ;;
+    *nearly)
+
+printf "%s\n" "#define FUNC_REALPATH_NEARLY_WORKS 1" >>confdefs.h
 
       ;;
   esac
@@ -10397,133 +11676,21 @@ $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
 
 
 
+  case "$host_os" in
+    mingw*) ;;
+    *)      ac_fn_c_check_func "$LINENO" "getcwd" "ac_cv_func_getcwd"
+if test "x$ac_cv_func_getcwd" = xyes
+then :
+  printf "%s\n" "#define HAVE_GETCWD 1" >>confdefs.h
+
+fi
+ ;;
+  esac
+
+
 
 
 
-  GNULIB_CHDIR=0;
-  GNULIB_CHOWN=0;
-  GNULIB_CLOSE=0;
-  GNULIB_DUP=0;
-  GNULIB_DUP2=0;
-  GNULIB_DUP3=0;
-  GNULIB_ENVIRON=0;
-  GNULIB_EUIDACCESS=0;
-  GNULIB_FACCESSAT=0;
-  GNULIB_FCHDIR=0;
-  GNULIB_FCHOWNAT=0;
-  GNULIB_FDATASYNC=0;
-  GNULIB_FSYNC=0;
-  GNULIB_FTRUNCATE=0;
-  GNULIB_GETCWD=0;
-  GNULIB_GETDOMAINNAME=0;
-  GNULIB_GETDTABLESIZE=0;
-  GNULIB_GETGROUPS=0;
-  GNULIB_GETHOSTNAME=0;
-  GNULIB_GETLOGIN=0;
-  GNULIB_GETLOGIN_R=0;
-  GNULIB_GETPAGESIZE=0;
-  GNULIB_GETUSERSHELL=0;
-  GNULIB_GROUP_MEMBER=0;
-  GNULIB_ISATTY=0;
-  GNULIB_LCHOWN=0;
-  GNULIB_LINK=0;
-  GNULIB_LINKAT=0;
-  GNULIB_LSEEK=0;
-  GNULIB_PIPE=0;
-  GNULIB_PIPE2=0;
-  GNULIB_PREAD=0;
-  GNULIB_PWRITE=0;
-  GNULIB_READ=0;
-  GNULIB_READLINK=0;
-  GNULIB_READLINKAT=0;
-  GNULIB_RMDIR=0;
-  GNULIB_SETHOSTNAME=0;
-  GNULIB_SLEEP=0;
-  GNULIB_SYMLINK=0;
-  GNULIB_SYMLINKAT=0;
-  GNULIB_TTYNAME_R=0;
-  GNULIB_UNISTD_H_NONBLOCKING=0;
-  GNULIB_UNISTD_H_SIGPIPE=0;
-  GNULIB_UNLINK=0;
-  GNULIB_UNLINKAT=0;
-  GNULIB_USLEEP=0;
-  GNULIB_WRITE=0;
-    HAVE_CHOWN=1;
-  HAVE_DUP2=1;
-  HAVE_DUP3=1;
-  HAVE_EUIDACCESS=1;
-  HAVE_FACCESSAT=1;
-  HAVE_FCHDIR=1;
-  HAVE_FCHOWNAT=1;
-  HAVE_FDATASYNC=1;
-  HAVE_FSYNC=1;
-  HAVE_FTRUNCATE=1;
-  HAVE_GETDTABLESIZE=1;
-  HAVE_GETGROUPS=1;
-  HAVE_GETHOSTNAME=1;
-  HAVE_GETLOGIN=1;
-  HAVE_GETPAGESIZE=1;
-  HAVE_GROUP_MEMBER=1;
-  HAVE_LCHOWN=1;
-  HAVE_LINK=1;
-  HAVE_LINKAT=1;
-  HAVE_PIPE=1;
-  HAVE_PIPE2=1;
-  HAVE_PREAD=1;
-  HAVE_PWRITE=1;
-  HAVE_READLINK=1;
-  HAVE_READLINKAT=1;
-  HAVE_SETHOSTNAME=1;
-  HAVE_SLEEP=1;
-  HAVE_SYMLINK=1;
-  HAVE_SYMLINKAT=1;
-  HAVE_UNLINKAT=1;
-  HAVE_USLEEP=1;
-  HAVE_DECL_ENVIRON=1;
-  HAVE_DECL_FCHDIR=1;
-  HAVE_DECL_FDATASYNC=1;
-  HAVE_DECL_GETDOMAINNAME=1;
-  HAVE_DECL_GETLOGIN=1;
-  HAVE_DECL_GETLOGIN_R=1;
-  HAVE_DECL_GETPAGESIZE=1;
-  HAVE_DECL_GETUSERSHELL=1;
-  HAVE_DECL_SETHOSTNAME=1;
-  HAVE_DECL_TTYNAME_R=1;
-  HAVE_OS_H=0;
-  HAVE_SYS_PARAM_H=0;
-  REPLACE_CHOWN=0;
-  REPLACE_CLOSE=0;
-  REPLACE_DUP=0;
-  REPLACE_DUP2=0;
-  REPLACE_FCHOWNAT=0;
-  REPLACE_FTRUNCATE=0;
-  REPLACE_GETCWD=0;
-  REPLACE_GETDOMAINNAME=0;
-  REPLACE_GETDTABLESIZE=0;
-  REPLACE_GETLOGIN_R=0;
-  REPLACE_GETGROUPS=0;
-  REPLACE_GETPAGESIZE=0;
-  REPLACE_ISATTY=0;
-  REPLACE_LCHOWN=0;
-  REPLACE_LINK=0;
-  REPLACE_LINKAT=0;
-  REPLACE_LSEEK=0;
-  REPLACE_PREAD=0;
-  REPLACE_PWRITE=0;
-  REPLACE_READ=0;
-  REPLACE_READLINK=0;
-  REPLACE_READLINKAT=0;
-  REPLACE_RMDIR=0;
-  REPLACE_SLEEP=0;
-  REPLACE_SYMLINK=0;
-  REPLACE_SYMLINKAT=0;
-  REPLACE_TTYNAME_R=0;
-  REPLACE_UNLINK=0;
-  REPLACE_UNLINKAT=0;
-  REPLACE_USLEEP=0;
-  REPLACE_WRITE=0;
-  UNISTD_H_HAVE_WINSOCK2_H=0;
-  UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
 
 
 
@@ -10533,7 +11700,7 @@ $as_echo "#define FUNC_REALPATH_WORKS 1" >>confdefs.h
   if test $ac_cv_func__set_invalid_parameter_handler = yes; then
     HAVE_MSVC_INVALID_PARAMETER_HANDLER=1
 
-$as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
+printf "%s\n" "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
 
   else
     HAVE_MSVC_INVALID_PARAMETER_HANDLER=0
@@ -10541,10 +11708,27 @@ $as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
 
 
 
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=0;
+  SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+
+  REPLACE_IOCTL=0;
 
 
 
 
+    HAVE_OPENDIR=1;
+  HAVE_READDIR=1;
+  HAVE_REWINDDIR=1;
+  HAVE_CLOSEDIR=1;
+  HAVE_DECL_DIRFD=1;
+  HAVE_DECL_FDOPENDIR=1;
+  HAVE_FDOPENDIR=1;
+  HAVE_SCANDIR=1;
+  HAVE_ALPHASORT=1;
+  REPLACE_OPENDIR=0;
+  REPLACE_CLOSEDIR=0;
+  REPLACE_DIRFD=0;
+  REPLACE_FDOPENDIR=0;
 
 
 
@@ -10552,58 +11736,46 @@ $as_echo "#define HAVE_MSVC_INVALID_PARAMETER_HANDLER 1" >>confdefs.h
 
 
 
+  GL_M4_GNULIB_OPENDIR=0
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
-$as_echo_n "checking if environ is properly declared... " >&6; }
-  if ${gt_cv_var_environ_declaration+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if HAVE_UNISTD_H
-     #include <unistd.h>
-     #endif
-     /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
-     #include <stdlib.h>
 
-           extern struct { int foo; } environ;
-int
-main ()
-{
-environ.foo = 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_var_environ_declaration=no
-else
-  gt_cv_var_environ_declaration=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+  GL_M4_GNULIB_READDIR=0
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
-$as_echo "$gt_cv_var_environ_declaration" >&6; }
-  if test $gt_cv_var_environ_declaration = yes; then
 
-$as_echo "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
 
-  fi
+  GL_M4_GNULIB_REWINDDIR=0
 
 
-  if test $gt_cv_var_environ_declaration != yes; then
-    HAVE_DECL_ENVIRON=0
-  fi
 
+  GL_M4_GNULIB_CLOSEDIR=0
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
-$as_echo_n "checking whether the preprocessor supports include_next... " >&6; }
-if ${gl_cv_have_include_next+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+  GL_M4_GNULIB_DIRFD=0
+
+
+
+  GL_M4_GNULIB_FDOPENDIR=0
+
+
+
+  GL_M4_GNULIB_SCANDIR=0
+
+
+
+  GL_M4_GNULIB_ALPHASORT=0
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the preprocessor supports include_next" >&5
+printf %s "checking whether the preprocessor supports include_next... " >&6; }
+if test ${gl_cv_have_include_next+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   rm -rf conftestd1a conftestd1b conftestd2
      mkdir conftestd1a conftestd1b conftestd2
                                                   cat <<EOF > conftestd1a/conftest.h
@@ -10637,29 +11809,31 @@ EOF
 /* end confdefs.h.  */
 #include <conftest.h>
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   gl_cv_have_include_next=yes
-else
+else $as_nop
   CPPFLAGS="$gl_save_CPPFLAGS -Iconftestd1a -Iconftestd2"
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <conftest.h>
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   gl_cv_have_include_next=buggy
-else
+else $as_nop
   gl_cv_have_include_next=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
      CPPFLAGS="$gl_save_CPPFLAGS"
      rm -rf conftestd1a conftestd1b conftestd2
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
-$as_echo "$gl_cv_have_include_next" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_include_next" >&5
+printf "%s\n" "$gl_cv_have_include_next" >&6; }
   PRAGMA_SYSTEM_HEADER=
   if test $gl_cv_have_include_next = yes; then
     INCLUDE_NEXT=include_next
@@ -10679,12 +11853,14 @@ $as_echo "$gl_cv_have_include_next" >&6; }
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether system header files limit the line length" >&5
-$as_echo_n "checking whether system header files limit the line length... " >&6; }
-if ${gl_cv_pragma_columns+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether source code line length is unlimited" >&5
+printf %s "checking whether source code line length is unlimited... " >&6; }
+if test ${gl_cv_source_line_length_unlimited+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #ifdef __TANDEM
@@ -10693,18 +11869,19 @@ choke me
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "choke me" >/dev/null 2>&1; then :
-  gl_cv_pragma_columns=yes
-else
-  gl_cv_pragma_columns=no
+  $EGREP "choke me" >/dev/null 2>&1
+then :
+  gl_cv_source_line_length_unlimited=no
+else $as_nop
+  gl_cv_source_line_length_unlimited=yes
 fi
-rm -f conftest*
+rm -rf conftest*
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pragma_columns" >&5
-$as_echo "$gl_cv_pragma_columns" >&6; }
-  if test $gl_cv_pragma_columns = yes; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_source_line_length_unlimited" >&5
+printf "%s\n" "$gl_cv_source_line_length_unlimited" >&6; }
+  if test $gl_cv_source_line_length_unlimited = no; then
     PRAGMA_COLUMNS="#pragma COLUMNS 10000"
   else
     PRAGMA_COLUMNS=
@@ -10713,11 +11890,290 @@ $as_echo "$gl_cv_pragma_columns" >&6; }
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
-$as_echo_n "checking for complete errno.h... " >&6; }
-if ${gl_cv_header_errno_h_complete+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_dirent_h='<'dirent.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
+printf %s "checking absolute name of <dirent.h>... " >&6; }
+if test ${gl_cv_next_dirent_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_dirent_h = yes; then
+
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <dirent.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'dirent.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_dirent_h
+           gl_cv_next_dirent_h='"'$gl_header'"'
+          else
+               gl_cv_next_dirent_h='<'dirent.h'>'
+             fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
+printf "%s\n" "$gl_cv_next_dirent_h" >&6; }
+     fi
+     NEXT_DIRENT_H=$gl_cv_next_dirent_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='<'dirent.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_dirent_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
+
+
+
+
+  if test $ac_cv_header_dirent_h = yes; then
+    HAVE_DIRENT_H=1
+  else
+    HAVE_DIRENT_H=0
+  fi
+
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC options needed to detect all undeclared functions" >&5
+printf %s "checking for $CC options needed to detect all undeclared functions... " >&6; }
+if test ${ac_cv_c_undeclared_builtin_options+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_save_CFLAGS=$CFLAGS
+   ac_cv_c_undeclared_builtin_options='cannot detect'
+   for ac_arg in '' -fno-builtin; do
+     CFLAGS="$ac_save_CFLAGS $ac_arg"
+     # This test program should *not* compile successfully.
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+(void) strchr;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+
+else $as_nop
+  # This test program should compile successfully.
+        # No library function is consistently available on
+        # freestanding implementations, so test against a dummy
+        # declaration.  Include always-available headers on the
+        # off chance that they somehow elicit warnings.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <float.h>
+#include <limits.h>
+#include <stdarg.h>
+#include <stddef.h>
+extern void ac_decl (int, char *);
+
+int
+main (void)
+{
+(void) ac_decl (0, (char *) 0);
+  (void) ac_decl;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  if test x"$ac_arg" = x
+then :
+  ac_cv_c_undeclared_builtin_options='none needed'
+else $as_nop
+  ac_cv_c_undeclared_builtin_options=$ac_arg
+fi
+          break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    done
+    CFLAGS=$ac_save_CFLAGS
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5
+printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; }
+  case $ac_cv_c_undeclared_builtin_options in #(
+  'cannot detect') :
+    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot make $CC report undeclared builtins
+See \`config.log' for more details" "$LINENO" 5; } ;; #(
+  'none needed') :
+    ac_c_undeclared_builtin_options='' ;; #(
+  *) :
+    ac_c_undeclared_builtin_options=$ac_cv_c_undeclared_builtin_options ;;
+esac
+
+gl_mda_defines='
+#if defined _WIN32 && !defined __CYGWIN__
+#define access    _access
+#define chdir     _chdir
+#define chmod     _chmod
+#define close     _close
+#define creat     _creat
+#define dup       _dup
+#define dup2      _dup2
+#define ecvt      _ecvt
+#define execl     _execl
+#define execle    _execle
+#define execlp    _execlp
+#define execv     _execv
+#define execve    _execve
+#define execvp    _execvp
+#define execvpe   _execvpe
+#define fcloseall _fcloseall
+#define fcvt      _fcvt
+#define fdopen    _fdopen
+#define fileno    _fileno
+#define gcvt      _gcvt
+#define getcwd    _getcwd
+#define getpid    _getpid
+#define getw      _getw
+#define isatty    _isatty
+#define j0        _j0
+#define j1        _j1
+#define jn        _jn
+#define lfind     _lfind
+#define lsearch   _lsearch
+#define lseek     _lseek
+#define memccpy   _memccpy
+#define mkdir     _mkdir
+#define mktemp    _mktemp
+#define open      _open
+#define putenv    _putenv
+#define putw      _putw
+#define read      _read
+#define rmdir     _rmdir
+#define strdup    _strdup
+#define swab      _swab
+#define tempnam   _tempnam
+#define tzset     _tzset
+#define umask     _umask
+#define unlink    _unlink
+#define utime     _utime
+#define wcsdup    _wcsdup
+#define write     _write
+#define y0        _y0
+#define y1        _y1
+#define yn        _yn
+#endif
+'
+
+
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if environ is properly declared" >&5
+printf %s "checking if environ is properly declared... " >&6; }
+if test ${gt_cv_var_environ_declaration+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if HAVE_UNISTD_H
+     #include <unistd.h>
+     #endif
+     /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
+     #include <stdlib.h>
+
+            extern struct { int foo; } environ;
+int
+main (void)
+{
+environ.foo = 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gt_cv_var_environ_declaration=no
+else $as_nop
+  gt_cv_var_environ_declaration=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_var_environ_declaration" >&5
+printf "%s\n" "$gt_cv_var_environ_declaration" >&6; }
+  if test $gt_cv_var_environ_declaration = yes; then
+
+printf "%s\n" "#define HAVE_ENVIRON_DECL 1" >>confdefs.h
+
+  fi
+
+
+  if test $gt_cv_var_environ_declaration != yes; then
+    HAVE_DECL_ENVIRON=0
+  fi
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for complete errno.h" >&5
+printf %s "checking for complete errno.h... " >&6; }
+if test ${gl_cv_header_errno_h_complete+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -10777,17 +12233,18 @@ booboo
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "booboo" >/dev/null 2>&1; then :
+  $EGREP "booboo" >/dev/null 2>&1
+then :
   gl_cv_header_errno_h_complete=no
-else
+else $as_nop
   gl_cv_header_errno_h_complete=yes
 fi
-rm -f conftest*
+rm -rf conftest*
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
-$as_echo "$gl_cv_header_errno_h_complete" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_complete" >&5
+printf "%s\n" "$gl_cv_header_errno_h_complete" >&6; }
   if test $gl_cv_header_errno_h_complete = yes; then
     ERRNO_H=''
   else
@@ -10802,11 +12259,12 @@ $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
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
-$as_echo_n "checking absolute name of <errno.h>... " >&6; }
-if ${gl_cv_next_errno_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <errno.h>" >&5
+printf %s "checking absolute name of <errno.h>... " >&6; }
+if test ${gl_cv_next_errno_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
 
 
@@ -10845,8 +12303,8 @@ _ACEOF
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
-$as_echo "$gl_cv_next_errno_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_errno_h" >&5
+printf "%s\n" "$gl_cv_next_errno_h" >&6; }
      fi
      NEXT_ERRNO_H=$gl_cv_next_errno_h
 
 
 
   if test -n "$ERRNO_H"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
-$as_echo_n "checking for EMULTIHOP value... " >&6; }
-if ${gl_cv_header_errno_h_EMULTIHOP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EMULTIHOP value" >&5
+printf %s "checking for EMULTIHOP value... " >&6; }
+if test ${gl_cv_header_errno_h_EMULTIHOP+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -10891,12 +12350,13 @@ yes
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
+  $EGREP "yes" >/dev/null 2>&1
+then :
   gl_cv_header_errno_h_EMULTIHOP=yes
-else
+else $as_nop
   gl_cv_header_errno_h_EMULTIHOP=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
       if test $gl_cv_header_errno_h_EMULTIHOP = no; then
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -10910,10 +12370,11 @@ yes
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
+  $EGREP "yes" >/dev/null 2>&1
+then :
   gl_cv_header_errno_h_EMULTIHOP=hidden
 fi
-rm -f conftest*
+rm -rf conftest*
 
         if test $gl_cv_header_errno_h_EMULTIHOP = hidden; then
                               if ac_fn_c_compute_int "$LINENO" "EMULTIHOP" "gl_cv_header_errno_h_EMULTIHOP"        "
@@ -10922,7 +12383,8 @@ rm -f conftest*
 /* The following two lines are a workaround against an autoconf-2.52 bug.  */
 #include <stdio.h>
 #include <stdlib.h>
-"; then :
+"
+then :
 
 fi
 
@@ -10930,8 +12392,8 @@ fi
       fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
-$as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EMULTIHOP" >&5
+printf "%s\n" "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
     case $gl_cv_header_errno_h_EMULTIHOP in
       yes | no)
         EMULTIHOP_HIDDEN=0; EMULTIHOP_VALUE=
@@ -10946,11 +12408,12 @@ $as_echo "$gl_cv_header_errno_h_EMULTIHOP" >&6; }
 
 
   if test -n "$ERRNO_H"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
-$as_echo_n "checking for ENOLINK value... " >&6; }
-if ${gl_cv_header_errno_h_ENOLINK+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ENOLINK value" >&5
+printf %s "checking for ENOLINK value... " >&6; }
+if test ${gl_cv_header_errno_h_ENOLINK+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -10962,12 +12425,13 @@ yes
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
+  $EGREP "yes" >/dev/null 2>&1
+then :
   gl_cv_header_errno_h_ENOLINK=yes
-else
+else $as_nop
   gl_cv_header_errno_h_ENOLINK=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
       if test $gl_cv_header_errno_h_ENOLINK = no; then
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -10981,10 +12445,11 @@ yes
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
+  $EGREP "yes" >/dev/null 2>&1
+then :
   gl_cv_header_errno_h_ENOLINK=hidden
 fi
-rm -f conftest*
+rm -rf conftest*
 
         if test $gl_cv_header_errno_h_ENOLINK = hidden; then
                               if ac_fn_c_compute_int "$LINENO" "ENOLINK" "gl_cv_header_errno_h_ENOLINK"        "
@@ -10993,7 +12458,8 @@ rm -f conftest*
 /* The following two lines are a workaround against an autoconf-2.52 bug.  */
 #include <stdio.h>
 #include <stdlib.h>
-"; then :
+"
+then :
 
 fi
 
@@ -11001,8 +12467,8 @@ fi
       fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
-$as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_ENOLINK" >&5
+printf "%s\n" "$gl_cv_header_errno_h_ENOLINK" >&6; }
     case $gl_cv_header_errno_h_ENOLINK in
       yes | no)
         ENOLINK_HIDDEN=0; ENOLINK_VALUE=
@@ -11017,11 +12483,12 @@ $as_echo "$gl_cv_header_errno_h_ENOLINK" >&6; }
 
 
   if test -n "$ERRNO_H"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
-$as_echo_n "checking for EOVERFLOW value... " >&6; }
-if ${gl_cv_header_errno_h_EOVERFLOW+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for EOVERFLOW value" >&5
+printf %s "checking for EOVERFLOW value... " >&6; }
+if test ${gl_cv_header_errno_h_EOVERFLOW+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
@@ -11033,12 +12500,13 @@ yes
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
+  $EGREP "yes" >/dev/null 2>&1
+then :
   gl_cv_header_errno_h_EOVERFLOW=yes
-else
+else $as_nop
   gl_cv_header_errno_h_EOVERFLOW=no
 fi
-rm -f conftest*
+rm -rf conftest*
 
       if test $gl_cv_header_errno_h_EOVERFLOW = no; then
         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -11052,10 +12520,11 @@ yes
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
+  $EGREP "yes" >/dev/null 2>&1
+then :
   gl_cv_header_errno_h_EOVERFLOW=hidden
 fi
-rm -f conftest*
+rm -rf conftest*
 
         if test $gl_cv_header_errno_h_EOVERFLOW = hidden; then
                               if ac_fn_c_compute_int "$LINENO" "EOVERFLOW" "gl_cv_header_errno_h_EOVERFLOW"        "
@@ -11064,7 +12533,8 @@ rm -f conftest*
 /* The following two lines are a workaround against an autoconf-2.52 bug.  */
 #include <stdio.h>
 #include <stdlib.h>
-"; then :
+"
+then :
 
 fi
 
@@ -11072,8 +12542,8 @@ fi
       fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
-$as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_errno_h_EOVERFLOW" >&5
+printf "%s\n" "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
     case $gl_cv_header_errno_h_EOVERFLOW in
       yes | no)
         EOVERFLOW_HIDDEN=0; EOVERFLOW_VALUE=
@@ -11087,41 +12557,39 @@ $as_echo "$gl_cv_header_errno_h_EOVERFLOW" >&6; }
   fi
 
 
-ac_fn_c_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strerror_r" = xyes; then :
+ac_fn_check_decl "$LINENO" "strerror_r" "ac_cv_have_decl_strerror_r" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_strerror_r" = xyes
+then :
   ac_have_decl=1
-else
+else $as_nop
   ac_have_decl=0
 fi
+printf "%s\n" "#define HAVE_DECL_STRERROR_R $ac_have_decl" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRERROR_R $ac_have_decl
-_ACEOF
 
-for ac_func in strerror_r
-do :
-  ac_fn_c_check_func "$LINENO" "strerror_r" "ac_cv_func_strerror_r"
-if test "x$ac_cv_func_strerror_r" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STRERROR_R 1
-_ACEOF
+if test $ac_cv_have_decl_strerror_r = yes; then
+  # For backward compatibility's sake, define HAVE_STRERROR_R.
+  # (We used to run AC_CHECK_FUNCS_ONCE for strerror_r, as well
+  # as AC_CHECK_DECLS_ONCE.)
+
+printf "%s\n" "#define HAVE_STRERROR_R 1" >>confdefs.h
 
 fi
-done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
-$as_echo_n "checking whether strerror_r returns char *... " >&6; }
-if ${ac_cv_func_strerror_r_char_p+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r returns char *" >&5
+printf %s "checking whether strerror_r returns char *... " >&6; }
+if test ${ac_cv_func_strerror_r_char_p+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
     ac_cv_func_strerror_r_char_p=no
     if test $ac_cv_have_decl_strerror_r = yes; then
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+#include <string.h>
 int
-main ()
+main (void)
 {
 
          char buf[100];
@@ -11133,49 +12601,20 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_func_strerror_r_char_p=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    else
-      # strerror_r is not declared.  Choose between
-      # systems that have relatively inaccessible declarations for the
-      # function.  BeOS and DEC UNIX 4.0 fall in this category, but the
-      # former has a strerror_r that returns char*, while the latter
-      # has a strerror_r that returns `int'.
-      # This test should segfault on the DEC system.
-      if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-       extern char *strerror_r ();
-int
-main ()
-{
-char buf[100];
-         char x = *strerror_r (0, buf, sizeof buf);
-         return ! isalpha (x);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_cv_func_strerror_r_char_p=yes
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
     fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
-$as_echo "$ac_cv_func_strerror_r_char_p" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strerror_r_char_p" >&5
+printf "%s\n" "$ac_cv_func_strerror_r_char_p" >&6; }
 if test $ac_cv_func_strerror_r_char_p = yes; then
 
-$as_echo "#define STRERROR_R_CHAR_P 1" >>confdefs.h
+printf "%s\n" "#define STRERROR_R_CHAR_P 1" >>confdefs.h
 
 fi
 
   XGETTEXT_EXTRA_OPTIONS=
 
 ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default"
-if test "x$ac_cv_type_mode_t" = xyes; then :
+if test "x$ac_cv_type_mode_t" = xyes
+then :
 
-else
+else $as_nop
 
-cat >>confdefs.h <<_ACEOF
-#define mode_t int
-_ACEOF
+printf "%s\n" "#define mode_t int" >>confdefs.h
 
 fi
 
 
   ac_fn_c_check_type "$LINENO" "sig_atomic_t" "ac_cv_type_sig_atomic_t" "#include <signal.h>
 "
-if test "x$ac_cv_type_sig_atomic_t" = xyes; then :
+if test "x$ac_cv_type_sig_atomic_t" = xyes
+then :
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SIG_ATOMIC_T 1
-_ACEOF
+printf "%s\n" "#define HAVE_SIG_ATOMIC_T 1" >>confdefs.h
 
 
-else
+else $as_nop
+
+printf "%s\n" "#define sig_atomic_t int" >>confdefs.h
+
+fi
+
+
+ac_fn_check_decl "$LINENO" "fchdir" "ac_cv_have_decl_fchdir" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fchdir" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FCHDIR $ac_have_decl" >>confdefs.h
 
-$as_echo "#define sig_atomic_t int" >>confdefs.h
-
-fi
-
-
-
-  GNULIB_DPRINTF=0;
-  GNULIB_FCLOSE=0;
-  GNULIB_FDOPEN=0;
-  GNULIB_FFLUSH=0;
-  GNULIB_FGETC=0;
-  GNULIB_FGETS=0;
-  GNULIB_FOPEN=0;
-  GNULIB_FPRINTF=0;
-  GNULIB_FPRINTF_POSIX=0;
-  GNULIB_FPURGE=0;
-  GNULIB_FPUTC=0;
-  GNULIB_FPUTS=0;
-  GNULIB_FREAD=0;
-  GNULIB_FREOPEN=0;
-  GNULIB_FSCANF=0;
-  GNULIB_FSEEK=0;
-  GNULIB_FSEEKO=0;
-  GNULIB_FTELL=0;
-  GNULIB_FTELLO=0;
-  GNULIB_FWRITE=0;
-  GNULIB_GETC=0;
-  GNULIB_GETCHAR=0;
-  GNULIB_GETDELIM=0;
-  GNULIB_GETLINE=0;
-  GNULIB_OBSTACK_PRINTF=0;
-  GNULIB_OBSTACK_PRINTF_POSIX=0;
-  GNULIB_PCLOSE=0;
-  GNULIB_PERROR=0;
-  GNULIB_POPEN=0;
-  GNULIB_PRINTF=0;
-  GNULIB_PRINTF_POSIX=0;
-  GNULIB_PUTC=0;
-  GNULIB_PUTCHAR=0;
-  GNULIB_PUTS=0;
-  GNULIB_REMOVE=0;
-  GNULIB_RENAME=0;
-  GNULIB_RENAMEAT=0;
-  GNULIB_SCANF=0;
-  GNULIB_SNPRINTF=0;
-  GNULIB_SPRINTF_POSIX=0;
-  GNULIB_STDIO_H_NONBLOCKING=0;
-  GNULIB_STDIO_H_SIGPIPE=0;
-  GNULIB_TMPFILE=0;
-  GNULIB_VASPRINTF=0;
-  GNULIB_VFSCANF=0;
-  GNULIB_VSCANF=0;
-  GNULIB_VDPRINTF=0;
-  GNULIB_VFPRINTF=0;
-  GNULIB_VFPRINTF_POSIX=0;
-  GNULIB_VPRINTF=0;
-  GNULIB_VPRINTF_POSIX=0;
-  GNULIB_VSNPRINTF=0;
-  GNULIB_VSPRINTF_POSIX=0;
-    HAVE_DECL_FPURGE=1;
+
+    HAVE_DECL_FCLOSEALL=1;
+  HAVE_DECL_FPURGE=1;
   HAVE_DECL_FSEEKO=1;
   HAVE_DECL_FTELLO=1;
   HAVE_DECL_GETDELIM=1;
   REPLACE_VSPRINTF=0;
 
 
-  GNULIB_FCNTL=0;
-  GNULIB_NONBLOCKING=0;
-  GNULIB_OPEN=0;
-  GNULIB_OPENAT=0;
-    HAVE_FCNTL=1;
-  HAVE_OPENAT=1;
-  REPLACE_FCNTL=0;
-  REPLACE_OPEN=0;
-  REPLACE_OPENAT=0;
 
+  GL_M4_GNULIB_DPRINTF=0
 
 
 
+  GL_M4_GNULIB_FCLOSE=0
 
 
 
+  GL_M4_GNULIB_FDOPEN=0
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
-$as_echo_n "checking for working fcntl.h... " >&6; }
-if ${gl_cv_header_working_fcntl_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  gl_cv_header_working_fcntl_h=cross-compiling
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-           #include <sys/stat.h>
-           #if HAVE_UNISTD_H
-           # include <unistd.h>
-           #else /* on Windows with MSVC */
-           # include <io.h>
-           # include <stdlib.h>
-           # defined sleep(n) _sleep ((n) * 1000)
-           #endif
-           #include <fcntl.h>
-           #ifndef O_NOATIME
-            #define O_NOATIME 0
-           #endif
-           #ifndef O_NOFOLLOW
-            #define O_NOFOLLOW 0
-           #endif
-           static int const constants[] =
-            {
-              O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
-              O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
-            };
+  GL_M4_GNULIB_FFLUSH=0
 
-int
-main ()
-{
 
-            int result = !constants;
-            #if HAVE_SYMLINK
-            {
-              static char const sym[] = "conftest.sym";
-              if (symlink ("/dev/null", sym) != 0)
-                result |= 2;
-              else
-                {
-                  int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
-                  if (fd >= 0)
-                    {
-                      close (fd);
-                      result |= 4;
-                    }
-                }
-              if (unlink (sym) != 0 || symlink (".", sym) != 0)
-                result |= 2;
-              else
-                {
-                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
-                  if (fd >= 0)
-                    {
-                      close (fd);
-                      result |= 4;
-                    }
-                }
-              unlink (sym);
-            }
-            #endif
-            {
-              static char const file[] = "confdefs.h";
-              int fd = open (file, O_RDONLY | O_NOATIME);
-              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 result;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_header_working_fcntl_h=yes
-else
-  case $? in #(
-        4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
-        64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
-        68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
-         *) gl_cv_header_working_fcntl_h='no';;
-        esac
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
-$as_echo "$gl_cv_header_working_fcntl_h" >&6; }
+  GL_M4_GNULIB_FGETC=0
 
-  case $gl_cv_header_working_fcntl_h in #(
-  *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
-  *) ac_val=1;;
-  esac
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_WORKING_O_NOATIME $ac_val
-_ACEOF
 
+  GL_M4_GNULIB_FGETS=0
 
-  case $gl_cv_header_working_fcntl_h in #(
-  *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
-  *) ac_val=1;;
-  esac
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_WORKING_O_NOFOLLOW $ac_val
-_ACEOF
 
+  GL_M4_GNULIB_FOPEN=0
 
-ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default"
-if test "x$ac_cv_type_pid_t" = xyes; then :
 
-else
 
-cat >>confdefs.h <<_ACEOF
-#define pid_t int
-_ACEOF
-
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  GNULIB_ACOSF=0;
-  GNULIB_ACOSL=0;
-  GNULIB_ASINF=0;
-  GNULIB_ASINL=0;
-  GNULIB_ATANF=0;
-  GNULIB_ATANL=0;
-  GNULIB_ATAN2F=0;
-  GNULIB_CBRT=0;
-  GNULIB_CBRTF=0;
-  GNULIB_CBRTL=0;
-  GNULIB_CEIL=0;
-  GNULIB_CEILF=0;
-  GNULIB_CEILL=0;
-  GNULIB_COPYSIGN=0;
-  GNULIB_COPYSIGNF=0;
-  GNULIB_COPYSIGNL=0;
-  GNULIB_COSF=0;
-  GNULIB_COSL=0;
-  GNULIB_COSHF=0;
-  GNULIB_EXPF=0;
-  GNULIB_EXPL=0;
-  GNULIB_EXP2=0;
-  GNULIB_EXP2F=0;
-  GNULIB_EXP2L=0;
-  GNULIB_EXPM1=0;
-  GNULIB_EXPM1F=0;
-  GNULIB_EXPM1L=0;
-  GNULIB_FABSF=0;
-  GNULIB_FABSL=0;
-  GNULIB_FLOOR=0;
-  GNULIB_FLOORF=0;
-  GNULIB_FLOORL=0;
-  GNULIB_FMA=0;
-  GNULIB_FMAF=0;
-  GNULIB_FMAL=0;
-  GNULIB_FMOD=0;
-  GNULIB_FMODF=0;
-  GNULIB_FMODL=0;
-  GNULIB_FREXPF=0;
-  GNULIB_FREXP=0;
-  GNULIB_FREXPL=0;
-  GNULIB_HYPOT=0;
-  GNULIB_HYPOTF=0;
-  GNULIB_HYPOTL=0;
-  GNULIB_ILOGB=0;
-  GNULIB_ILOGBF=0;
-  GNULIB_ILOGBL=0;
-  GNULIB_ISFINITE=0;
-  GNULIB_ISINF=0;
-  GNULIB_ISNAN=0;
-  GNULIB_ISNANF=0;
-  GNULIB_ISNAND=0;
-  GNULIB_ISNANL=0;
-  GNULIB_LDEXPF=0;
-  GNULIB_LDEXPL=0;
-  GNULIB_LOG=0;
-  GNULIB_LOGF=0;
-  GNULIB_LOGL=0;
-  GNULIB_LOG10=0;
-  GNULIB_LOG10F=0;
-  GNULIB_LOG10L=0;
-  GNULIB_LOG1P=0;
-  GNULIB_LOG1PF=0;
-  GNULIB_LOG1PL=0;
-  GNULIB_LOG2=0;
-  GNULIB_LOG2F=0;
-  GNULIB_LOG2L=0;
-  GNULIB_LOGB=0;
-  GNULIB_LOGBF=0;
-  GNULIB_LOGBL=0;
-  GNULIB_MODF=0;
-  GNULIB_MODFF=0;
-  GNULIB_MODFL=0;
-  GNULIB_POWF=0;
-  GNULIB_REMAINDER=0;
-  GNULIB_REMAINDERF=0;
-  GNULIB_REMAINDERL=0;
-  GNULIB_RINT=0;
-  GNULIB_RINTF=0;
-  GNULIB_RINTL=0;
-  GNULIB_ROUND=0;
-  GNULIB_ROUNDF=0;
-  GNULIB_ROUNDL=0;
-  GNULIB_SIGNBIT=0;
-  GNULIB_SINF=0;
-  GNULIB_SINL=0;
-  GNULIB_SINHF=0;
-  GNULIB_SQRTF=0;
-  GNULIB_SQRTL=0;
-  GNULIB_TANF=0;
-  GNULIB_TANL=0;
-  GNULIB_TANHF=0;
-  GNULIB_TRUNC=0;
-  GNULIB_TRUNCF=0;
-  GNULIB_TRUNCL=0;
-    HAVE_ACOSF=1;
-  HAVE_ACOSL=1;
-  HAVE_ASINF=1;
-  HAVE_ASINL=1;
-  HAVE_ATANF=1;
-  HAVE_ATANL=1;
-  HAVE_ATAN2F=1;
-  HAVE_CBRT=1;
-  HAVE_CBRTF=1;
-  HAVE_CBRTL=1;
-  HAVE_COPYSIGN=1;
-  HAVE_COPYSIGNL=1;
-  HAVE_COSF=1;
-  HAVE_COSL=1;
-  HAVE_COSHF=1;
-  HAVE_EXPF=1;
-  HAVE_EXPL=1;
-  HAVE_EXPM1=1;
-  HAVE_EXPM1F=1;
-  HAVE_FABSF=1;
-  HAVE_FABSL=1;
-  HAVE_FMA=1;
-  HAVE_FMAF=1;
-  HAVE_FMAL=1;
-  HAVE_FMODF=1;
-  HAVE_FMODL=1;
-  HAVE_FREXPF=1;
-  HAVE_HYPOTF=1;
-  HAVE_HYPOTL=1;
-  HAVE_ILOGB=1;
-  HAVE_ILOGBF=1;
-  HAVE_ILOGBL=1;
-  HAVE_ISNANF=1;
-  HAVE_ISNAND=1;
-  HAVE_ISNANL=1;
-  HAVE_LDEXPF=1;
-  HAVE_LOGF=1;
-  HAVE_LOGL=1;
-  HAVE_LOG10F=1;
-  HAVE_LOG10L=1;
-  HAVE_LOG1P=1;
+  GL_M4_GNULIB_FPRINTF=0
+
+
+
+  GL_M4_GNULIB_FPRINTF_POSIX=0
+
+
+
+  GL_M4_GNULIB_FPURGE=0
+
+
+
+  GL_M4_GNULIB_FPUTC=0
+
+
+
+  GL_M4_GNULIB_FPUTS=0
+
+
+
+  GL_M4_GNULIB_FREAD=0
+
+
+
+  GL_M4_GNULIB_FREOPEN=0
+
+
+
+  GL_M4_GNULIB_FSCANF=0
+
+
+
+  GL_M4_GNULIB_FSEEK=0
+
+
+
+  GL_M4_GNULIB_FSEEKO=0
+
+
+
+  GL_M4_GNULIB_FTELL=0
+
+
+
+  GL_M4_GNULIB_FTELLO=0
+
+
+
+  GL_M4_GNULIB_FWRITE=0
+
+
+
+  GL_M4_GNULIB_GETC=0
+
+
+
+  GL_M4_GNULIB_GETCHAR=0
+
+
+
+  GL_M4_GNULIB_GETDELIM=0
+
+
+
+  GL_M4_GNULIB_GETLINE=0
+
+
+
+  GL_M4_GNULIB_OBSTACK_PRINTF=0
+
+
+
+  GL_M4_GNULIB_OBSTACK_PRINTF_POSIX=0
+
+
+
+  GL_M4_GNULIB_PCLOSE=0
+
+
+
+  GL_M4_GNULIB_PERROR=0
+
+
+
+  GL_M4_GNULIB_POPEN=0
+
+
+
+  GL_M4_GNULIB_PRINTF=0
+
+
+
+  GL_M4_GNULIB_PRINTF_POSIX=0
+
+
+
+  GL_M4_GNULIB_PUTC=0
+
+
+
+  GL_M4_GNULIB_PUTCHAR=0
+
+
+
+  GL_M4_GNULIB_PUTS=0
+
+
+
+  GL_M4_GNULIB_REMOVE=0
+
+
+
+  GL_M4_GNULIB_RENAME=0
+
+
+
+  GL_M4_GNULIB_RENAMEAT=0
+
+
+
+  GL_M4_GNULIB_SCANF=0
+
+
+
+  GL_M4_GNULIB_SNPRINTF=0
+
+
+
+  GL_M4_GNULIB_SPRINTF_POSIX=0
+
+
+
+  GL_M4_GNULIB_STDIO_H_NONBLOCKING=0
+
+
+
+  GL_M4_GNULIB_STDIO_H_SIGPIPE=0
+
+
+
+  GL_M4_GNULIB_TMPFILE=0
+
+
+
+  GL_M4_GNULIB_VASPRINTF=0
+
+
+
+  GL_M4_GNULIB_VFSCANF=0
+
+
+
+  GL_M4_GNULIB_VSCANF=0
+
+
+
+  GL_M4_GNULIB_VDPRINTF=0
+
+
+
+  GL_M4_GNULIB_VFPRINTF=0
+
+
+
+  GL_M4_GNULIB_VFPRINTF_POSIX=0
+
+
+
+  GL_M4_GNULIB_VPRINTF=0
+
+
+
+  GL_M4_GNULIB_VPRINTF_POSIX=0
+
+
+
+  GL_M4_GNULIB_VSNPRINTF=0
+
+
+
+  GL_M4_GNULIB_VSPRINTF_POSIX=0
+
+
+
+  GL_M4_GNULIB_MDA_FCLOSEALL=1
+
+
+
+  GL_M4_GNULIB_MDA_FDOPEN=1
+
+
+
+  GL_M4_GNULIB_MDA_FILENO=1
+
+
+
+  GL_M4_GNULIB_MDA_GETW=1
+
+
+
+  GL_M4_GNULIB_MDA_PUTW=1
+
+
+
+  GL_M4_GNULIB_MDA_TEMPNAM=1
+
+
+
+
+    HAVE_FCNTL=1;
+  HAVE_OPENAT=1;
+  REPLACE_CREAT=0;
+  REPLACE_FCNTL=0;
+  REPLACE_OPEN=0;
+  REPLACE_OPENAT=0;
+
+
+
+
+  GL_M4_GNULIB_CREAT=0
+
+
+
+  GL_M4_GNULIB_FCNTL=0
+
+
+
+  GL_M4_GNULIB_NONBLOCKING=0
+
+
+
+  GL_M4_GNULIB_OPEN=0
+
+
+
+  GL_M4_GNULIB_OPENAT=0
+
+
+
+  GL_M4_GNULIB_MDA_CREAT=1
+
+
+
+  GL_M4_GNULIB_MDA_OPEN=1
+
+
+
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working fcntl.h" >&5
+printf %s "checking for working fcntl.h... " >&6; }
+if test ${gl_cv_header_working_fcntl_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                  # Guess 'no' on native Windows.
+          mingw*) gl_cv_header_working_fcntl_h='no' ;;
+          *)      gl_cv_header_working_fcntl_h=cross-compiling ;;
+        esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+           #include <sys/stat.h>
+           #if HAVE_UNISTD_H
+           # include <unistd.h>
+           #else /* on Windows with MSVC */
+           # include <io.h>
+           # include <stdlib.h>
+           # defined sleep(n) _sleep ((n) * 1000)
+           #endif
+           #include <fcntl.h>
+
+
+$gl_mda_defines
+
+           #ifndef O_NOATIME
+            #define O_NOATIME 0
+           #endif
+           #ifndef O_NOFOLLOW
+            #define O_NOFOLLOW 0
+           #endif
+           static int const constants[] =
+            {
+              O_CREAT, O_EXCL, O_NOCTTY, O_TRUNC, O_APPEND,
+              O_NONBLOCK, O_SYNC, O_ACCMODE, O_RDONLY, O_RDWR, O_WRONLY
+            };
+
+int
+main (void)
+{
+
+            int result = !constants;
+            #if HAVE_SYMLINK
+            {
+              static char const sym[] = "conftest.sym";
+              if (symlink ("/dev/null", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_WRONLY | O_NOFOLLOW | O_CREAT, 0);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
+              if (unlink (sym) != 0 || symlink (".", sym) != 0)
+                result |= 2;
+              else
+                {
+                  int fd = open (sym, O_RDONLY | O_NOFOLLOW);
+                  if (fd >= 0)
+                    {
+                      close (fd);
+                      result |= 4;
+                    }
+                }
+              unlink (sym);
+            }
+            #endif
+            {
+              static char const file[] = "confdefs.h";
+              int fd = open (file, O_RDONLY | O_NOATIME);
+              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 result;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_header_working_fcntl_h=yes
+else $as_nop
+  case $? in #(
+        4) gl_cv_header_working_fcntl_h='no (bad O_NOFOLLOW)';; #(
+        64) gl_cv_header_working_fcntl_h='no (bad O_NOATIME)';; #(
+        68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
+         *) gl_cv_header_working_fcntl_h='no';;
+        esac
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_fcntl_h" >&5
+printf "%s\n" "$gl_cv_header_working_fcntl_h" >&6; }
+
+  case $gl_cv_header_working_fcntl_h in #(
+  *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
+  *) ac_val=1;;
+  esac
+
+printf "%s\n" "#define HAVE_WORKING_O_NOATIME $ac_val" >>confdefs.h
+
+
+  case $gl_cv_header_working_fcntl_h in #(
+  *O_NOFOLLOW* | no | cross-compiling) ac_val=0;; #(
+  *) ac_val=1;;
+  esac
+
+printf "%s\n" "#define HAVE_WORKING_O_NOFOLLOW $ac_val" >>confdefs.h
+
+
+
+  ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default
+"
+if test "x$ac_cv_type_pid_t" = xyes
+then :
+
+else $as_nop
+                                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+          #if defined _WIN64 && !defined __CYGWIN__
+          LLP64
+          #endif
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_pid_type='int'
+else $as_nop
+  ac_pid_type='__int64'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_fcntl_h='<'fcntl.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
+printf %s "checking absolute name of <fcntl.h>... " >&6; }
+if test ${gl_cv_next_fcntl_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <fcntl.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'fcntl.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_fcntl_h
+           gl_cv_next_fcntl_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
+printf "%s\n" "$gl_cv_next_fcntl_h" >&6; }
+     fi
+     NEXT_FCNTL_H=$gl_cv_next_fcntl_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='<'fcntl.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_fcntl_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  ac_fn_c_check_func "$LINENO" "eaccess" "ac_cv_func_eaccess"
+if test "x$ac_cv_func_eaccess" = xyes
+then :
+
+else $as_nop
+
+printf "%s\n" "#define eaccess access" >>confdefs.h
+
+fi
+
+
+
+
+
+
+
+
+    HAVE_ACOSF=1;
+  HAVE_ACOSL=1;
+  HAVE_ASINF=1;
+  HAVE_ASINL=1;
+  HAVE_ATANF=1;
+  HAVE_ATANL=1;
+  HAVE_ATAN2F=1;
+  HAVE_CBRT=1;
+  HAVE_CBRTF=1;
+  HAVE_CBRTL=1;
+  HAVE_COPYSIGN=1;
+  HAVE_COPYSIGNL=1;
+  HAVE_COSF=1;
+  HAVE_COSL=1;
+  HAVE_COSHF=1;
+  HAVE_EXPF=1;
+  HAVE_EXPL=1;
+  HAVE_EXPM1=1;
+  HAVE_EXPM1F=1;
+  HAVE_FABSF=1;
+  HAVE_FABSL=1;
+  HAVE_FMA=1;
+  HAVE_FMAF=1;
+  HAVE_FMAL=1;
+  HAVE_FMODF=1;
+  HAVE_FMODL=1;
+  HAVE_FREXPF=1;
+  HAVE_HYPOTF=1;
+  HAVE_HYPOTL=1;
+  HAVE_ILOGB=1;
+  HAVE_ILOGBF=1;
+  HAVE_ILOGBL=1;
+  HAVE_ISNANF=1;
+  HAVE_ISNAND=1;
+  HAVE_ISNANL=1;
+  HAVE_LDEXPF=1;
+  HAVE_LOGF=1;
+  HAVE_LOGL=1;
+  HAVE_LOG10F=1;
+  HAVE_LOG10L=1;
+  HAVE_LOG1P=1;
   HAVE_LOG1PF=1;
   HAVE_LOG1PL=1;
   HAVE_LOGBF=1;
   REPLACE_COSF=0;
   REPLACE_COSHF=0;
   REPLACE_EXPF=0;
+  REPLACE_EXPL=0;
   REPLACE_EXPM1=0;
   REPLACE_EXPM1F=0;
+  REPLACE_EXPM1L=0;
   REPLACE_EXP2=0;
   REPLACE_EXP2L=0;
   REPLACE_FABSL=0;
@@ -11730,6 +13418,7 @@ fi
   REPLACE_HYPOTL=0;
   REPLACE_ILOGB=0;
   REPLACE_ILOGBF=0;
+  REPLACE_ILOGBL=0;
   REPLACE_ISFINITE=0;
   REPLACE_ISINF=0;
   REPLACE_ISNAN=0;
   REPLACE_REMAINDER=0;
   REPLACE_REMAINDERF=0;
   REPLACE_REMAINDERL=0;
+  REPLACE_RINTL=0;
   REPLACE_ROUND=0;
   REPLACE_ROUNDF=0;
   REPLACE_ROUNDL=0;
   REPLACE_SIGNBIT=0;
-  REPLACE_SIGNBIT_USING_GCC=0;
+  REPLACE_SIGNBIT_USING_BUILTINS=0;
   REPLACE_SINF=0;
   REPLACE_SINHF=0;
   REPLACE_SQRTF=0;
   REPLACE_TRUNCL=0;
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
-$as_echo_n "checking whether frexp() can be used without linking with libm... " >&6; }
-if ${gl_cv_func_frexp_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether frexp() can be used without linking with libm" >&5
+printf %s "checking whether frexp() can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_frexp_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <math.h>
              double x;
 int
-main ()
+main (void)
 {
 int e; return frexp (x, &e) > 0;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   gl_cv_func_frexp_no_libm=yes
-else
+else $as_nop
   gl_cv_func_frexp_no_libm=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
-$as_echo "$gl_cv_func_frexp_no_libm" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_no_libm" >&5
+printf "%s\n" "$gl_cv_func_frexp_no_libm" >&6; }
 
-ac_fn_c_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default"
-if test "x$ac_cv_have_decl_alarm" = xyes; then :
+ac_fn_check_decl "$LINENO" "alarm" "ac_cv_have_decl_alarm" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_alarm" = xyes
+then :
   ac_have_decl=1
-else
+else $as_nop
   ac_have_decl=0
 fi
+printf "%s\n" "#define HAVE_DECL_ALARM $ac_have_decl" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ALARM $ac_have_decl
-_ACEOF
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
-$as_echo_n "checking whether long double and double are the same... " >&6; }
-if ${gl_cv_long_double_equals_double+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <float.h>
-int
-main ()
-{
-typedef int check[sizeof (long double) == sizeof (double)
-                              && LDBL_MANT_DIG == DBL_MANT_DIG
-                              && LDBL_MAX_EXP == DBL_MAX_EXP
-                              && LDBL_MIN_EXP == DBL_MIN_EXP
-                              ? 1 : -1];
+  GL_M4_GNULIB_ACOSF=0
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_long_double_equals_double=yes
-else
-  gl_cv_long_double_equals_double=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
-$as_echo "$gl_cv_long_double_equals_double" >&6; }
-  if test $gl_cv_long_double_equals_double = yes; then
 
-$as_echo "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
+  GL_M4_GNULIB_ACOSL=0
 
-    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
-  else
-    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
-  fi
 
 
+  GL_M4_GNULIB_ASINF=0
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdin defaults to large file offsets" >&5
-$as_echo_n "checking whether stdin defaults to large file offsets... " >&6; }
-if ${gl_cv_var_stdin_large_offset+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+
+  GL_M4_GNULIB_ASINL=0
+
+
+
+  GL_M4_GNULIB_ATANF=0
+
+
+
+  GL_M4_GNULIB_ATANL=0
+
+
+
+  GL_M4_GNULIB_ATAN2F=0
+
+
+
+  GL_M4_GNULIB_CBRT=0
+
+
+
+  GL_M4_GNULIB_CBRTF=0
+
+
+
+  GL_M4_GNULIB_CBRTL=0
+
+
+
+  GL_M4_GNULIB_CEIL=0
+
+
+
+  GL_M4_GNULIB_CEILF=0
+
+
+
+  GL_M4_GNULIB_CEILL=0
+
+
+
+  GL_M4_GNULIB_COPYSIGN=0
+
+
+
+  GL_M4_GNULIB_COPYSIGNF=0
+
+
+
+  GL_M4_GNULIB_COPYSIGNL=0
+
+
+
+  GL_M4_GNULIB_COSF=0
+
+
+
+  GL_M4_GNULIB_COSL=0
+
+
+
+  GL_M4_GNULIB_COSHF=0
+
+
+
+  GL_M4_GNULIB_EXPF=0
+
+
+
+  GL_M4_GNULIB_EXPL=0
+
+
+
+  GL_M4_GNULIB_EXP2=0
+
+
+
+  GL_M4_GNULIB_EXP2F=0
+
+
+
+  GL_M4_GNULIB_EXP2L=0
+
+
+
+  GL_M4_GNULIB_EXPM1=0
+
+
+
+  GL_M4_GNULIB_EXPM1F=0
+
+
+
+  GL_M4_GNULIB_EXPM1L=0
+
+
+
+  GL_M4_GNULIB_FABSF=0
+
+
+
+  GL_M4_GNULIB_FABSL=0
+
+
+
+  GL_M4_GNULIB_FLOOR=0
+
+
+
+  GL_M4_GNULIB_FLOORF=0
+
+
+
+  GL_M4_GNULIB_FLOORL=0
+
+
+
+  GL_M4_GNULIB_FMA=0
+
+
+
+  GL_M4_GNULIB_FMAF=0
+
+
+
+  GL_M4_GNULIB_FMAL=0
+
+
+
+  GL_M4_GNULIB_FMOD=0
+
+
+
+  GL_M4_GNULIB_FMODF=0
+
+
+
+  GL_M4_GNULIB_FMODL=0
+
+
+
+  GL_M4_GNULIB_FREXPF=0
+
+
+
+  GL_M4_GNULIB_FREXP=0
+
+
+
+  GL_M4_GNULIB_FREXPL=0
+
+
+
+  GL_M4_GNULIB_HYPOT=0
+
+
+
+  GL_M4_GNULIB_HYPOTF=0
+
+
+
+  GL_M4_GNULIB_HYPOTL=0
+
+
+
+  GL_M4_GNULIB_ILOGB=0
+
+
+
+  GL_M4_GNULIB_ILOGBF=0
+
+
+
+  GL_M4_GNULIB_ILOGBL=0
+
+
+
+  GL_M4_GNULIB_ISFINITE=0
+
+
+
+  GL_M4_GNULIB_ISINF=0
+
+
+
+  GL_M4_GNULIB_ISNAN=0
+
+
+
+  GL_M4_GNULIB_ISNANF=0
+
+
+
+  GL_M4_GNULIB_ISNAND=0
+
+
+
+  GL_M4_GNULIB_ISNANL=0
+
+
+
+  GL_M4_GNULIB_LDEXPF=0
+
+
+
+  GL_M4_GNULIB_LDEXPL=0
+
+
+
+  GL_M4_GNULIB_LOG=0
+
+
+
+  GL_M4_GNULIB_LOGF=0
+
+
+
+  GL_M4_GNULIB_LOGL=0
+
+
+
+  GL_M4_GNULIB_LOG10=0
+
+
+
+  GL_M4_GNULIB_LOG10F=0
+
+
+
+  GL_M4_GNULIB_LOG10L=0
+
+
+
+  GL_M4_GNULIB_LOG1P=0
+
+
+
+  GL_M4_GNULIB_LOG1PF=0
+
+
+
+  GL_M4_GNULIB_LOG1PL=0
+
+
+
+  GL_M4_GNULIB_LOG2=0
+
+
+
+  GL_M4_GNULIB_LOG2F=0
+
+
+
+  GL_M4_GNULIB_LOG2L=0
+
+
+
+  GL_M4_GNULIB_LOGB=0
+
+
+
+  GL_M4_GNULIB_LOGBF=0
+
+
+
+  GL_M4_GNULIB_LOGBL=0
+
+
+
+  GL_M4_GNULIB_MODF=0
+
+
+
+  GL_M4_GNULIB_MODFF=0
+
+
+
+  GL_M4_GNULIB_MODFL=0
+
+
+
+  GL_M4_GNULIB_POWF=0
+
+
+
+  GL_M4_GNULIB_REMAINDER=0
+
+
+
+  GL_M4_GNULIB_REMAINDERF=0
+
+
+
+  GL_M4_GNULIB_REMAINDERL=0
+
+
+
+  GL_M4_GNULIB_RINT=0
+
+
+
+  GL_M4_GNULIB_RINTF=0
+
+
+
+  GL_M4_GNULIB_RINTL=0
+
+
+
+  GL_M4_GNULIB_ROUND=0
+
+
+
+  GL_M4_GNULIB_ROUNDF=0
+
+
+
+  GL_M4_GNULIB_ROUNDL=0
+
+
+
+  GL_M4_GNULIB_SIGNBIT=0
+
+
+
+  GL_M4_GNULIB_SINF=0
+
+
+
+  GL_M4_GNULIB_SINL=0
+
+
+
+  GL_M4_GNULIB_SINHF=0
+
+
+
+  GL_M4_GNULIB_SQRTF=0
+
+
+
+  GL_M4_GNULIB_SQRTL=0
+
+
+
+  GL_M4_GNULIB_TANF=0
+
+
+
+  GL_M4_GNULIB_TANL=0
+
+
+
+  GL_M4_GNULIB_TANHF=0
+
+
+
+  GL_M4_GNULIB_TRUNC=0
+
+
+
+  GL_M4_GNULIB_TRUNCF=0
+
+
+
+  GL_M4_GNULIB_TRUNCL=0
+
+
+
+  GL_M4_GNULIB_MDA_J0=1
+
+
+
+  GL_M4_GNULIB_MDA_J1=1
+
+
+
+  GL_M4_GNULIB_MDA_JN=1
+
+
+
+  GL_M4_GNULIB_MDA_Y0=1
+
+
+
+  GL_M4_GNULIB_MDA_Y1=1
+
+
+
+  GL_M4_GNULIB_MDA_YN=1
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether long double and double are the same" >&5
+printf %s "checking whether long double and double are the same... " >&6; }
+if test ${gl_cv_long_double_equals_double+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <float.h>
+int
+main (void)
+{
+typedef int check[sizeof (long double) == sizeof (double)
+                              && LDBL_MANT_DIG == DBL_MANT_DIG
+                              && LDBL_MAX_EXP == DBL_MAX_EXP
+                              && LDBL_MIN_EXP == DBL_MIN_EXP
+                              ? 1 : -1];
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_long_double_equals_double=yes
+else $as_nop
+  gl_cv_long_double_equals_double=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_long_double_equals_double" >&5
+printf "%s\n" "$gl_cv_long_double_equals_double" >&6; }
+  if test $gl_cv_long_double_equals_double = yes; then
+
+printf "%s\n" "#define HAVE_SAME_LONG_DOUBLE_AS_DOUBLE 1" >>confdefs.h
+
+    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=1
+  else
+    HAVE_SAME_LONG_DOUBLE_AS_DOUBLE=0
+  fi
+
+
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdin defaults to large file offsets" >&5
+printf %s "checking whether stdin defaults to large file offsets... " >&6; }
+if test ${gl_cv_var_stdin_large_offset+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
 int
-main ()
+main (void)
 {
 #if defined __SL64 && defined __SCLE /* cygwin */
   /* Cygwin 1.5.24 and earlier fail to put stdin in 64-bit mode, making
@@ -11880,16 +13979,17 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   gl_cv_var_stdin_large_offset=yes
-else
+else $as_nop
   gl_cv_var_stdin_large_offset=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var_stdin_large_offset" >&5
-$as_echo "$gl_cv_var_stdin_large_offset" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var_stdin_large_offset" >&5
+printf "%s\n" "$gl_cv_var_stdin_large_offset" >&6; }
 
 
 
@@ -11897,40 +13997,77 @@ $as_echo "$gl_cv_var_stdin_large_offset" >&6; }
 
   case "$host_os" in
     mingw*)
-                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
-$as_echo_n "checking for 64-bit off_t... " >&6; }
-if ${gl_cv_type_off_t_64+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+                        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit off_t" >&5
+printf %s "checking for 64-bit off_t... " >&6; }
+if test ${gl_cv_type_off_t_64+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
                 int verify_off_t_size[sizeof (off_t) >= 8 ? 1 : -1];
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   gl_cv_type_off_t_64=yes
-else
+else $as_nop
   gl_cv_type_off_t_64=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
-$as_echo "$gl_cv_type_off_t_64" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_off_t_64" >&5
+printf "%s\n" "$gl_cv_type_off_t_64" >&6; }
       if test $gl_cv_type_off_t_64 = no; then
         WINDOWS_64_BIT_OFF_T=1
       else
         WINDOWS_64_BIT_OFF_T=0
       fi
-                  WINDOWS_64_BIT_ST_SIZE=1
+                        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for 64-bit st_size" >&5
+printf %s "checking for 64-bit st_size... " >&6; }
+if test ${gl_cv_member_st_size_64+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+                struct stat buf;
+                int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_member_st_size_64=yes
+else $as_nop
+  gl_cv_member_st_size_64=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_member_st_size_64" >&5
+printf "%s\n" "$gl_cv_member_st_size_64" >&6; }
+      if test $gl_cv_member_st_size_64 = no; then
+        WINDOWS_64_BIT_ST_SIZE=1
+      else
+        WINDOWS_64_BIT_ST_SIZE=0
+      fi
       ;;
     *)
                                                       WINDOWS_64_BIT_OFF_T=0
@@ -11948,6 +14085,11 @@ $as_echo "$gl_cv_type_off_t_64" >&6; }
 
 
 
+printf "%s\n" "#define _USE_STD_STAT 1" >>confdefs.h
+
+
+
+
 
 
 
@@ -11957,11 +14099,12 @@ $as_echo "$gl_cv_type_off_t_64" >&6; }
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_sys_types_h='<'sys/types.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
-$as_echo_n "checking absolute name of <sys/types.h>... " >&6; }
-if ${gl_cv_next_sys_types_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/types.h>" >&5
+printf %s "checking absolute name of <sys/types.h>... " >&6; }
+if test ${gl_cv_next_sys_types_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
 
 
@@ -12000,8 +14143,8 @@ _ACEOF
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
-$as_echo "$gl_cv_next_sys_types_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_types_h" >&5
+printf "%s\n" "$gl_cv_next_sys_types_h" >&6; }
      fi
      NEXT_SYS_TYPES_H=$gl_cv_next_sys_types_h
 
@@ -12024,16 +14167,19 @@ $as_echo "$gl_cv_next_sys_types_h" >&6; }
 
 
 
-ac_fn_c_check_decl "$LINENO" "fseeko" "ac_cv_have_decl_fseeko" "$ac_includes_default"
-if test "x$ac_cv_have_decl_fseeko" = xyes; then :
+
+    WINDOWS_STAT_INODES=0
+
+
+
+ac_fn_check_decl "$LINENO" "fseeko" "ac_cv_have_decl_fseeko" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fseeko" = xyes
+then :
   ac_have_decl=1
-else
+else $as_nop
   ac_have_decl=0
 fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FSEEKO $ac_have_decl
-_ACEOF
+printf "%s\n" "#define HAVE_DECL_FSEEKO $ac_have_decl" >>confdefs.h
 
 
 
@@ -12043,35 +14189,37 @@ _ACEOF
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5
-$as_echo_n "checking for fseeko... " >&6; }
-if ${gl_cv_func_fseeko+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5
+printf %s "checking for fseeko... " >&6; }
+if test ${gl_cv_func_fseeko+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <stdio.h>
 
 int
-main ()
+main (void)
 {
 fseeko (stdin, 0, 0);
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"
+then :
   gl_cv_func_fseeko=yes
-else
+else $as_nop
   gl_cv_func_fseeko=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5
-$as_echo "$gl_cv_func_fseeko" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5
+printf "%s\n" "$gl_cv_func_fseeko" >&6; }
 
 
   if test $ac_cv_have_decl_fseeko = no; then
@@ -12090,15 +14238,22 @@ $as_echo "$gl_cv_func_fseeko" >&6; }
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
-$as_echo_n "checking whether fflush works on input streams... " >&6; }
-if ${gl_cv_func_fflush_stdin+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
+printf %s "checking whether fflush works on input streams... " >&6; }
+if test ${gl_cv_func_fflush_stdin+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   echo hello world > conftest.txt
-     if test "$cross_compiling" = yes; then :
-  gl_cv_func_fflush_stdin=cross
-else
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                  # Guess no on native Windows.
+          mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
+          *)      gl_cv_func_fflush_stdin=cross ;;
+        esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -12109,8 +14264,11 @@ else
 # include <io.h>
 #endif
 
+
+$gl_mda_defines
+
 int
-main ()
+main (void)
 {
 FILE *f = fopen ("conftest.txt", "r");
          char buffer[10];
@@ -12120,41 +14278,43 @@ FILE *f = fopen ("conftest.txt", "r");
            return 1;
          fd = fileno (f);
          if (fd < 0 || fread (buffer, 1, 5, f) != 5)
-           return 2;
+           { fclose (f); return 2; }
          /* For deterministic results, ensure f read a bigger buffer.  */
          if (lseek (fd, 0, SEEK_CUR) == 5)
-           return 3;
+           { fclose (f); return 3; }
          /* POSIX requires fflush-fseek to set file offset of fd.  This fails
             on BSD systems and on mingw.  */
          if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
-           return 4;
+           { fclose (f); return 4; }
          if (lseek (fd, 0, SEEK_CUR) != 5)
-           return 5;
+           { fclose (f); return 5; }
          /* Verify behaviour of fflush after ungetc. See
-            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
+            <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
          /* Verify behaviour of fflush after a backup ungetc.  This fails on
             mingw.  */
          c = fgetc (f);
          ungetc (c, f);
          fflush (f);
          if (fgetc (f) != c)
-           return 6;
+           { fclose (f); return 6; }
          /* Verify behaviour of fflush after a non-backup ungetc.  This fails
             on glibc 2.8 and on BSD systems.  */
          c = fgetc (f);
          ungetc ('@', f);
          fflush (f);
          if (fgetc (f) != c)
-           return 7;
+           { fclose (f); return 7; }
+         fclose (f);
          return 0;
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
   gl_cv_func_fflush_stdin=yes
-else
+else $as_nop
   gl_cv_func_fflush_stdin=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
      rm conftest.txt
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
-$as_echo "$gl_cv_func_fflush_stdin" >&6; }
-  case $gl_cv_func_fflush_stdin in
-    yes) gl_func_fflush_stdin=1 ;;
-    no)  gl_func_fflush_stdin=0 ;;
-    *)   gl_func_fflush_stdin='(-1)' ;;
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
+printf "%s\n" "$gl_cv_func_fflush_stdin" >&6; }
+  case "$gl_cv_func_fflush_stdin" in
+    *yes) gl_func_fflush_stdin=1 ;;
+    *no)  gl_func_fflush_stdin=0 ;;
+    *)    gl_func_fflush_stdin='(-1)' ;;
   esac
 
-cat >>confdefs.h <<_ACEOF
-#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
-_ACEOF
+printf "%s\n" "#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin" >>confdefs.h
 
 
-      if test $gl_cv_func_fflush_stdin != yes; then
-        REPLACE_FSEEKO=1
-      fi
+      case "$gl_cv_func_fflush_stdin" in
+        *yes) ;;
+        *) REPLACE_FSEEKO=1 ;;
+      esac
 
   fi
 
 
-     GNULIB_FCHMODAT=0;
-  GNULIB_FSTAT=0;
-  GNULIB_FSTATAT=0;
-  GNULIB_FUTIMENS=0;
-  GNULIB_LCHMOD=0;
-  GNULIB_LSTAT=0;
-  GNULIB_MKDIRAT=0;
-  GNULIB_MKFIFO=0;
-  GNULIB_MKFIFOAT=0;
-  GNULIB_MKNOD=0;
-  GNULIB_MKNODAT=0;
-  GNULIB_STAT=0;
-  GNULIB_UTIMENSAT=0;
     HAVE_FCHMODAT=1;
   HAVE_FSTATAT=1;
   HAVE_FUTIMENS=1;
+  HAVE_GETUMASK=1;
   HAVE_LCHMOD=1;
   HAVE_LSTAT=1;
   HAVE_MKDIRAT=1;
@@ -12208,21 +14355,25 @@ _ACEOF
   HAVE_MKNOD=1;
   HAVE_MKNODAT=1;
   HAVE_UTIMENSAT=1;
+  REPLACE_FCHMODAT=0;
   REPLACE_FSTAT=0;
   REPLACE_FSTATAT=0;
   REPLACE_FUTIMENS=0;
   REPLACE_LSTAT=0;
   REPLACE_MKDIR=0;
   REPLACE_MKFIFO=0;
+  REPLACE_MKFIFOAT=0;
   REPLACE_MKNOD=0;
+  REPLACE_MKNODAT=0;
   REPLACE_STAT=0;
   REPLACE_UTIMENSAT=0;
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
-$as_echo_n "checking whether stat file-mode macros are broken... " >&6; }
-if ${ac_cv_header_stat_broken+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat file-mode macros are broken" >&5
+printf %s "checking whether stat file-mode macros are broken... " >&6; }
+if test ${ac_cv_header_stat_broken+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <sys/types.h>
@@ -12245,22 +14396,71 @@ extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
 #endif
 
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"
+then :
   ac_cv_header_stat_broken=no
-else
+else $as_nop
   ac_cv_header_stat_broken=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
-$as_echo "$ac_cv_header_stat_broken" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5
+printf "%s\n" "$ac_cv_header_stat_broken" >&6; }
 if test $ac_cv_header_stat_broken = yes; then
 
-$as_echo "#define STAT_MACROS_BROKEN 1" >>confdefs.h
+printf "%s\n" "#define STAT_MACROS_BROKEN 1" >>confdefs.h
+
+fi
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
+printf %s "checking for C/C++ restrict keyword... " >&6; }
+if test ${ac_cv_c_restrict+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_cv_c_restrict=no
+   # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
+   # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
+   # Put 'restrict' last, because C++ lacks it.
+   for ac_kw in __restrict__ __restrict _Restrict restrict; do
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+typedef int *int_ptr;
+          int foo (int_ptr $ac_kw ip) { return ip[0]; }
+          int bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
+          int bar (int ip[$ac_kw]) { return ip[0]; }
+
+int
+main (void)
+{
+int s[1];
+          int *$ac_kw t = s;
+          t[0] = 0;
+          return foo (t) + bar (t);
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_restrict=$ac_kw
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+     test "$ac_cv_c_restrict" != no && break
+   done
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
+printf "%s\n" "$ac_cv_c_restrict" >&6; }
 
+ case $ac_cv_c_restrict in
+   restrict) ;;
+   no) printf "%s\n" "#define restrict /**/" >>confdefs.h
+ ;;
+   *)  printf "%s\n" "#define restrict $ac_cv_c_restrict" >>confdefs.h
+ ;;
+ esac
 
 
 
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_sys_stat_h='<'sys/stat.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
-$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
-if ${gl_cv_next_sys_stat_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
+printf %s "checking absolute name of <sys/stat.h>... " >&6; }
+if test ${gl_cv_next_sys_stat_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
              if test $ac_cv_header_sys_stat_h = yes; then
 
@@ -12328,8 +14529,8 @@ _ACEOF
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
-$as_echo "$gl_cv_next_sys_stat_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
+printf "%s\n" "$gl_cv_next_sys_stat_h" >&6; }
      fi
      NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_h
 
@@ -12349,39 +14550,45 @@ $as_echo "$gl_cv_next_sys_stat_h" >&6; }
 
 
 
+    WINDOWS_STAT_TIMESPEC=0
+
+
 
 
 
-  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
 
-$as_echo "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h
 
-  fi
 
       ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
      #include <sys/stat.h>
 "
-if test "x$ac_cv_type_nlink_t" = xyes; then :
+if test "x$ac_cv_type_nlink_t" = xyes
+then :
 
-else
+else $as_nop
 
-$as_echo "#define nlink_t int" >>confdefs.h
+printf "%s\n" "#define nlink_t int" >>confdefs.h
 
 fi
 
 
 
 
-ac_fn_c_check_decl "$LINENO" "ftello" "ac_cv_have_decl_ftello" "$ac_includes_default"
-if test "x$ac_cv_have_decl_ftello" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
+
+
+
+
+  case "$host_os" in
+    mingw*)
+      ac_fn_c_check_header_compile "$LINENO" "sdkddkver.h" "ac_cv_header_sdkddkver_h" "$ac_includes_default"
+if test "x$ac_cv_header_sdkddkver_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_SDKDDKVER_H 1" >>confdefs.h
+
 fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FTELLO $ac_have_decl
-_ACEOF
+      ;;
+  esac
 
 
 
@@ -12389,41 +14596,228 @@ _ACEOF
 
 
 
+  GL_M4_GNULIB_FCHMODAT=0
 
 
 
-  if test $ac_cv_have_decl_ftello = no; then
-    HAVE_DECL_FTELLO=0
-  fi
+  GL_M4_GNULIB_FSTAT=0
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
-$as_echo_n "checking for ftello... " >&6; }
-if ${gl_cv_func_ftello+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+  GL_M4_GNULIB_FSTATAT=0
+
+
+
+  GL_M4_GNULIB_FUTIMENS=0
+
+
+
+  GL_M4_GNULIB_GETUMASK=0
+
+
+
+  GL_M4_GNULIB_LCHMOD=0
+
+
+
+  GL_M4_GNULIB_LSTAT=0
+
+
+
+  GL_M4_GNULIB_MKDIR=0
+
+
+
+  GL_M4_GNULIB_MKDIRAT=0
+
+
+
+  GL_M4_GNULIB_MKFIFO=0
+
+
+
+  GL_M4_GNULIB_MKFIFOAT=0
+
+
+
+  GL_M4_GNULIB_MKNOD=0
+
+
+
+  GL_M4_GNULIB_MKNODAT=0
+
+
+
+  GL_M4_GNULIB_STAT=0
+
+
+
+  GL_M4_GNULIB_UTIMENSAT=0
+
+
+
+  GL_M4_GNULIB_OVERRIDES_STRUCT_STAT=0
+
+
+
+  GL_M4_GNULIB_MDA_CHMOD=1
+
+
+
+  GL_M4_GNULIB_MDA_MKDIR=1
+
+
+
+  GL_M4_GNULIB_MDA_UMASK=1
+
+
+
+
+ac_fn_check_decl "$LINENO" "ftello" "ac_cv_have_decl_ftello" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_ftello" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FTELLO $ac_have_decl" >>confdefs.h
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ungetc works on arbitrary bytes" >&5
+printf %s "checking whether ungetc works on arbitrary bytes... " >&6; }
+if test ${gl_cv_func_ungetc_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                          # Guess yes on glibc systems.
+           *-gnu* | gnu*) gl_cv_func_ungetc_works="guessing yes" ;;
+                          # Guess yes on musl systems.
+           *-musl*)       gl_cv_func_ungetc_works="guessing yes" ;;
+                          # Guess yes on bionic systems.
+           *-android*)    gl_cv_func_ungetc_works="guessing yes" ;;
+                          # Guess yes on native Windows.
+           mingw*)        gl_cv_func_ungetc_works="guessing yes" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+           *)             gl_cv_func_ungetc_works="$gl_cross_guess_normal" ;;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+
 #include <stdio.h>
+
 int
-main ()
+main (void)
 {
-ftello (stdin);
+FILE *f;
+            if (!(f = fopen ("conftest.tmp", "w+")))
+              return 1;
+            if (fputs ("abc", f) < 0)
+              { fclose (f); return 2; }
+            rewind (f);
+            if (fgetc (f) != 'a')
+              { fclose (f); return 3; }
+            if (fgetc (f) != 'b')
+              { fclose (f); return 4; }
+            if (ungetc ('d', f) != 'd')
+              { fclose (f); return 5; }
+            if (ftell (f) != 1)
+              { fclose (f); return 6; }
+            if (fgetc (f) != 'd')
+              { fclose (f); return 7; }
+            if (ftell (f) != 2)
+              { fclose (f); return 8; }
+            if (fseek (f, 0, SEEK_CUR) != 0)
+              { fclose (f); return 9; }
+            if (ftell (f) != 2)
+              { fclose (f); return 10; }
+            if (fgetc (f) != 'c')
+              { fclose (f); return 11; }
+            fclose (f);
+            remove ("conftest.tmp");
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_ungetc_works=yes
+else $as_nop
+  gl_cv_func_ungetc_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ungetc_works" >&5
+printf "%s\n" "$gl_cv_func_ungetc_works" >&6; }
+  gl_ftello_broken_after_ungetc=no
+  case "$gl_cv_func_ungetc_works" in
+    *yes) ;;
+    *)
+                  case "$host_os" in
+        darwin*) gl_ftello_broken_after_ungetc=yes ;;
+        *)
+
+printf "%s\n" "#define FUNC_UNGETC_BROKEN 1" >>confdefs.h
+
+          ;;
+      esac
+      ;;
+  esac
+
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_have_decl_ftello = no; then
+    HAVE_DECL_FTELLO=0
+  fi
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
+printf %s "checking for ftello... " >&6; }
+if test ${gl_cv_func_ftello+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main (void)
+{
+ftello (stdin);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
   gl_cv_func_ftello=yes
-else
+else $as_nop
   gl_cv_func_ftello=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
-$as_echo "$gl_cv_func_ftello" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
+printf "%s\n" "$gl_cv_func_ftello" >&6; }
   if test $gl_cv_func_ftello = no; then
     HAVE_FTELLO=0
   else
@@ -12435,21 +14829,25 @@ $as_echo "$gl_cv_func_ftello" >&6; }
     fi
     if test $REPLACE_FTELLO = 0; then
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ftello works" >&5
-$as_echo_n "checking whether ftello works... " >&6; }
-if ${gl_cv_func_ftello_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ftello works" >&5
+printf %s "checking whether ftello works... " >&6; }
+if test ${gl_cv_func_ftello_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
                               case "$host_os" in
                       # Guess no on Solaris.
             solaris*) gl_cv_func_ftello_works="guessing no" ;;
+                      # Guess yes on native Windows.
+            mingw*)   gl_cv_func_ftello_works="guessing yes" ;;
                       # Guess yes otherwise.
             *)        gl_cv_func_ftello_works="guessing yes" ;;
           esac
-          if test "$cross_compiling" = yes; then :
+          if test "$cross_compiling" = yes
+then :
   :
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -12467,7 +14865,7 @@ main (void)
   if (fp == NULL)
     return 70;
   if (fwrite ("foogarsh", 1, 8, fp) < 8)
-    return 71;
+    { fclose (fp); return 71; }
   if (fclose (fp))
     return 72;
 
@@ -12478,19 +14876,19 @@ main (void)
   if (fp == NULL)
     return 73;
   if (fseek (fp, -1, SEEK_END))
-    return 74;
+    { fclose (fp); return 74; }
   if (!(getc (fp) == 'h'))
-    return 1;
+    { fclose (fp); return 1; }
   if (!(getc (fp) == EOF))
-    return 2;
+    { fclose (fp); return 2; }
   if (!(ftell (fp) == 8))
-    return 3;
+    { fclose (fp); return 3; }
   if (!(ftell (fp) == 8))
-    return 4;
+    { fclose (fp); return 4; }
   if (!(putc ('!', fp) == '!'))
-    return 5;
+    { fclose (fp); return 5; }
   if (!(ftell (fp) == 9))
-    return 6;
+    { fclose (fp); return 6; }
   if (!(fclose (fp) == 0))
     return 7;
   fp = fopen (TESTFILE, "r");
@@ -12499,9 +14897,9 @@ main (void)
   {
     char buf[10];
     if (!(fread (buf, 1, 10, fp) == 9))
-      return 10;
+      { fclose (fp); return 10; }
     if (!(memcmp (buf, "foogarsh!", 9) == 0))
-      return 11;
+      { fclose (fp); return 11; }
   }
   if (!(fclose (fp) == 0))
     return 12;
@@ -12511,9 +14909,10 @@ main (void)
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
   gl_cv_func_ftello_works=yes
-else
+else $as_nop
   gl_cv_func_ftello_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello_works" >&5
-$as_echo "$gl_cv_func_ftello_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello_works" >&5
+printf "%s\n" "$gl_cv_func_ftello_works" >&6; }
       case "$gl_cv_func_ftello_works" in
         *yes) ;;
         *)
           REPLACE_FTELLO=1
 
-$as_echo "#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1" >>confdefs.h
+printf "%s\n" "#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1" >>confdefs.h
 
           ;;
       esac
     fi
+    if test $REPLACE_FTELLO = 0; then
+
+      if test $gl_ftello_broken_after_ungetc = yes; then
+        REPLACE_FTELLO=1
+
+printf "%s\n" "#define FTELLO_BROKEN_AFTER_UNGETC 1" >>confdefs.h
+
+      fi
+    fi
   fi
 
 
 
-ac_fn_c_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getdtablesize" = xyes; then :
+   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
+printf %s "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
+if test ${gl_cv_func_getcwd_null+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                           # Guess yes on glibc systems.
+            *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
+                           # Guess yes on musl systems.
+            *-musl*)       gl_cv_func_getcwd_null="guessing yes";;
+                           # Guess yes on Cygwin.
+            cygwin*)       gl_cv_func_getcwd_null="guessing yes";;
+                           # If we don't know, obey --enable-cross-guesses.
+            *)             gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
+          esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#       include <stdlib.h>
+#        if HAVE_UNISTD_H
+#         include <unistd.h>
+#        else /* on Windows with MSVC */
+#         include <direct.h>
+#        endif
+
+
+$gl_mda_defines
+
+#        ifndef getcwd
+         char *getcwd ();
+#        endif
+
+int
+main (void)
+{
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* mingw cwd does not start with '/', but _getcwd does allocate.
+   However, mingw fails to honor non-zero size.  */
+#else
+           if (chdir ("/") != 0)
+             return 1;
+           else
+             {
+               char *f = getcwd (NULL, 0);
+               if (! f)
+                 return 2;
+               if (f[0] != '/')
+                 { free (f); return 3; }
+               if (f[1] != '\0')
+                 { free (f); return 4; }
+               free (f);
+               return 0;
+             }
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_getcwd_null=yes
+else $as_nop
+  gl_cv_func_getcwd_null=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
+printf "%s\n" "$gl_cv_func_getcwd_null" >&6; }
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
+printf %s "checking for getcwd with POSIX signature... " >&6; }
+if test ${gl_cv_func_getcwd_posix_signature+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+
+
+$gl_mda_defines
+
+int
+main (void)
+{
+extern
+           #ifdef __cplusplus
+           "C"
+           #endif
+           char *getcwd (char *, size_t);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_getcwd_posix_signature=yes
+else $as_nop
+  gl_cv_func_getcwd_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
+printf "%s\n" "$gl_cv_func_getcwd_posix_signature" >&6; }
+
+ac_fn_check_decl "$LINENO" "getcwd" "ac_cv_have_decl_getcwd" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_getcwd" = xyes
+then :
   ac_have_decl=1
-else
+else $as_nop
   ac_have_decl=0
 fi
+printf "%s\n" "#define HAVE_DECL_GETCWD $ac_have_decl" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETDTABLESIZE $ac_have_decl
-_ACEOF
 
+ac_fn_check_decl "$LINENO" "getdtablesize" "ac_cv_have_decl_getdtablesize" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_getdtablesize" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_GETDTABLESIZE $ac_have_decl" >>confdefs.h
 
 
 
@@ -12567,11 +15101,12 @@ _ACEOF
      if test $gl_cv_have_include_next = yes; then
        gl_cv_next_getopt_h='<'getopt.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5
-$as_echo_n "checking absolute name of <getopt.h>... " >&6; }
-if ${gl_cv_next_getopt_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <getopt.h>" >&5
+printf %s "checking absolute name of <getopt.h>... " >&6; }
+if test ${gl_cv_next_getopt_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
              if test $ac_cv_header_getopt_h = yes; then
 
@@ -12616,8 +15151,8 @@ _ACEOF
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5
-$as_echo "$gl_cv_next_getopt_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_getopt_h" >&5
+printf "%s\n" "$gl_cv_next_getopt_h" >&6; }
      fi
      NEXT_GETOPT_H=$gl_cv_next_getopt_h
 
@@ -12643,52 +15178,52 @@ $as_echo "$gl_cv_next_getopt_h" >&6; }
   gl_replace_getopt=
 
     if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
-    for ac_header in getopt.h
+           for ac_header in getopt.h
 do :
-  ac_fn_c_check_header_mongrel "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
-if test "x$ac_cv_header_getopt_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETOPT_H 1
-_ACEOF
+  ac_fn_c_check_header_compile "$LINENO" "getopt.h" "ac_cv_header_getopt_h" "$ac_includes_default"
+if test "x$ac_cv_header_getopt_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_GETOPT_H 1" >>confdefs.h
 
-else
+else $as_nop
   gl_replace_getopt=yes
 fi
 
 done
-
   fi
 
     if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
-    for ac_func in getopt_long_only
+
+  for ac_func in getopt_long_only
 do :
   ac_fn_c_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
-if test "x$ac_cv_func_getopt_long_only" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETOPT_LONG_ONLY 1
-_ACEOF
+if test "x$ac_cv_func_getopt_long_only" = xyes
+then :
+  printf "%s\n" "#define HAVE_GETOPT_LONG_ONLY 1" >>confdefs.h
 
-else
+else $as_nop
   gl_replace_getopt=yes
 fi
-done
 
+done
   fi
 
           if test -z "$gl_replace_getopt"; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5
-$as_echo_n "checking whether getopt is POSIX compatible... " >&6; }
-if ${gl_cv_func_getopt_posix+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getopt is POSIX compatible" >&5
+printf %s "checking whether getopt is POSIX compatible... " >&6; }
+if test ${gl_cv_func_getopt_posix+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
                                                 if test $cross_compiling = no; then
-                              if test "$cross_compiling" = yes; then :
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+                              if test "$cross_compiling" = yes
+then :
+  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run test program while cross compiling
 See \`config.log' for more details" "$LINENO" 5; }
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -12718,9 +15253,10 @@ main ()
 }
 
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
   gl_cv_func_getopt_posix=maybe
-else
+else $as_nop
   gl_cv_func_getopt_posix=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
@@ -12728,12 +15264,13 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
 fi
 
           if test $gl_cv_func_getopt_posix = maybe; then
-                                    if test "$cross_compiling" = yes; then :
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+                                    if test "$cross_compiling" = yes
+then :
+  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run test program while cross compiling
 See \`config.log' for more details" "$LINENO" 5; }
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -12777,9 +15314,10 @@ main ()
 }
 
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
   gl_cv_func_getopt_posix=maybe
-else
+else $as_nop
   gl_cv_func_getopt_posix=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
 
           fi
           if test $gl_cv_func_getopt_posix = maybe; then
-                        if test "$cross_compiling" = yes; then :
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+                        if test "$cross_compiling" = yes
+then :
+  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
 as_fn_error $? "cannot run test program while cross compiling
 See \`config.log' for more details" "$LINENO" 5; }
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
@@ -12819,9 +15358,10 @@ main ()
 }
 
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
   gl_cv_func_getopt_posix=yes
-else
+else $as_nop
   gl_cv_func_getopt_posix=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
         fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5
-$as_echo "$gl_cv_func_getopt_posix" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_posix" >&5
+printf "%s\n" "$gl_cv_func_getopt_posix" >&6; }
     case "$gl_cv_func_getopt_posix" in
       *no) gl_replace_getopt=yes ;;
     esac
   fi
 
   if test -z "$gl_replace_getopt" && test $gl_getopt_required = GNU; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5
-$as_echo_n "checking for working GNU getopt function... " >&6; }
-if ${gl_cv_func_getopt_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt function" >&5
+printf %s "checking for working GNU getopt function... " >&6; }
+if test ${gl_cv_func_getopt_gnu+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   # Even with POSIXLY_CORRECT, the GNU extension of leading '-' in the
        # optstring is necessary for programs like m4 that have POSIX-mandated
        # semantics for supporting options interspersed with files.
@@ -12864,10 +15405,11 @@ else
        esac
        POSIXLY_CORRECT=1
        export POSIXLY_CORRECT
-       if test "$cross_compiling" = yes; then :
-           gl_cv_func_getopt_gnu="guessing no"
+       if test "$cross_compiling" = yes
+then :
+                             gl_cv_func_getopt_gnu="$gl_cross_guess_normal"
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <getopt.h>
@@ -12911,7 +15453,7 @@ nocrash_init (void)
   /* Allocate a port on which the thread shall listen for exceptions.  */
   if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
       == KERN_SUCCESS) {
-    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
+    /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
     if (mach_port_insert_right (self, our_exception_port, our_exception_port,
                                 MACH_MSG_TYPE_MAKE_SEND)
         == KERN_SUCCESS) {
@@ -12930,14 +15472,14 @@ nocrash_init (void)
            for a particular thread.  This has the effect that when our exception
            port gets the message, the thread specific exception port has already
            been asked, and we don't need to bother about it.
-           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
+           See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
         task_set_exception_ports (self, mask, our_exception_port,
                                   EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
       }
     }
   }
 }
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
 /* Avoid a crash on native Windows.  */
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
@@ -12989,7 +15531,7 @@ nocrash_init (void)
 
 
 int
-main ()
+main (void)
 {
 
              int result = 0;
@@ -13067,9 +15609,10 @@ main ()
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
   gl_cv_func_getopt_gnu=yes
-else
+else $as_nop
   gl_cv_func_getopt_gnu=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
        esac
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5
-$as_echo "$gl_cv_func_getopt_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_gnu" >&5
+printf "%s\n" "$gl_cv_func_getopt_gnu" >&6; }
     if test "$gl_cv_func_getopt_gnu" != yes; then
       gl_replace_getopt=yes
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5
-$as_echo_n "checking for working GNU getopt_long function... " >&6; }
-if ${gl_cv_func_getopt_long_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working GNU getopt_long function" >&5
+printf %s "checking for working GNU getopt_long function... " >&6; }
+if test ${gl_cv_func_getopt_long_gnu+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
               case "$host_os" in
               openbsd*) gl_cv_func_getopt_long_gnu="guessing no";;
               *)        gl_cv_func_getopt_long_gnu="guessing yes";;
             esac
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <getopt.h>
@@ -13107,7 +15652,7 @@ else
                 #include <string.h>
 
 int
-main ()
+main (void)
 {
 static const struct option long_options[] =
                   {
@@ -13133,9 +15678,10 @@ static const struct option long_options[] =
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
   gl_cv_func_getopt_long_gnu=yes
-else
+else $as_nop
   gl_cv_func_getopt_long_gnu=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
@@ -13144,8 +15690,8 @@ fi
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5
-$as_echo "$gl_cv_func_getopt_long_gnu" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getopt_long_gnu" >&5
+printf "%s\n" "$gl_cv_func_getopt_long_gnu" >&6; }
       case "$gl_cv_func_getopt_long_gnu" in
         *yes) ;;
         *) gl_replace_getopt=yes ;;
@@ -13157,1747 +15703,1718 @@ $as_echo "$gl_cv_func_getopt_long_gnu" >&6; }
 
 
 
+    HAVE_GETRANDOM=1;
+  REPLACE_GETRANDOM=0;
 
-    REPLACE_GETOPT=0
-    if test -n "$gl_replace_getopt"; then
-      REPLACE_GETOPT=1
-    fi
 
-  if test $REPLACE_GETOPT = 1; then
 
-  GETOPT_H=getopt.h
 
-$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
+  GL_M4_GNULIB_GETRANDOM=0
 
 
 
-  fi
 
-ac_fn_c_check_decl "$LINENO" "getenv" "ac_cv_have_decl_getenv" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getenv" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETENV $ac_have_decl
-_ACEOF
 
 
+  if test -z "$gl_pthreadlib_body_done"; then
+    gl_pthread_api=no
+    LIBPTHREAD=
+    LIBPMULTITHREAD=
+    # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+    # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+    ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes
+then :
+  gl_have_pthread_h=yes
+else $as_nop
+  gl_have_pthread_h=no
+fi
 
+    if test "$gl_have_pthread_h" = yes; then
+      # Other possible tests:
+      #   -lpthreads (FSU threads, PCthreads)
+      #   -lgthreads
+      # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+      # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+      # the second one only in libpthread, and lock.c needs it.
+      #
+      # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+      # needs -pthread for some reason.  See:
+      # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+      save_LIBS=$LIBS
+      for gl_pthread in '' '-pthread'; do
+        LIBS="$LIBS $gl_pthread"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+               pthread_mutex_t m;
+               pthread_mutexattr_t ma;
 
+int
+main (void)
+{
+pthread_mutex_lock (&m);
+               pthread_mutexattr_init (&ma);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_pthread_api=yes
+           LIBPTHREAD=$gl_pthread
+           LIBPMULTITHREAD=$gl_pthread
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+        LIBS=$save_LIBS
+        test $gl_pthread_api = yes && break
+      done
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C/C++ restrict keyword" >&5
-$as_echo_n "checking for C/C++ restrict keyword... " >&6; }
-if ${ac_cv_c_restrict+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_restrict=no
-   # The order here caters to the fact that C++ does not require restrict.
-   for ac_kw in __restrict __restrict__ _Restrict restrict; do
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+      # since it is defined as a macro on OSF/1.)
+      if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+        # The program links fine without libpthread. But it may actually
+        # need to link with libpthread in order to create multiple threads.
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+printf %s "checking for pthread_kill in -lpthread... " >&6; }
+if test ${ac_cv_lib_pthread_pthread_kill+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-typedef int *int_ptr;
-          int foo (int_ptr $ac_kw ip) { return ip[0]; }
-          int bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
-          int bar (int ip[$ac_kw]) { return ip[0]; }
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
 int
-main ()
+main (void)
 {
-int s[1];
-          int *$ac_kw t = s;
-          t[0] = 0;
-          return foo (t) + bar (t);
-
+return pthread_kill ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_restrict=$ac_kw
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_pthread_pthread_kill=yes
+else $as_nop
+  ac_cv_lib_pthread_pthread_kill=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-     test "$ac_cv_c_restrict" != no && break
-   done
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+printf "%s\n" "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes
+then :
+  LIBPMULTITHREAD=-lpthread
+           # On Solaris and HP-UX, most pthread functions exist also in libc.
+           # Therefore pthread_in_use() needs to actually try to create a
+           # thread: pthread_create from libc will fail, whereas
+           # pthread_create will actually create a thread.
+           # On Solaris 10 or newer, this test is no longer needed, because
+           # libc contains the fully functional pthread functions.
+           case "$host_os" in
+             solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
+
+printf "%s\n" "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
+
+           esac
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_restrict" >&5
-$as_echo "$ac_cv_c_restrict" >&6; }
 
- case $ac_cv_c_restrict in
-   restrict) ;;
-   no) $as_echo "#define restrict /**/" >>confdefs.h
- ;;
-   *)  cat >>confdefs.h <<_ACEOF
-#define restrict $ac_cv_c_restrict
-_ACEOF
- ;;
- esac
+      elif test $gl_pthread_api != yes; then
+        # Some library is needed. Try libpthread and libc_r.
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+printf %s "checking for pthread_kill in -lpthread... " >&6; }
+if test ${ac_cv_lib_pthread_pthread_kill+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main (void)
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_pthread_pthread_kill=yes
+else $as_nop
+  ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+printf "%s\n" "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes
+then :
+  gl_pthread_api=yes
+           LIBPTHREAD=-lpthread
+           LIBPMULTITHREAD=-lpthread
+fi
+
+        if test $gl_pthread_api != yes; then
+          # For FreeBSD 4.
+          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
+printf %s "checking for pthread_kill in -lc_r... " >&6; }
+if test ${ac_cv_lib_c_r_pthread_kill+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  GNULIB_GETTIMEOFDAY=0;
-    HAVE_GETTIMEOFDAY=1;
-  HAVE_STRUCT_TIMEVAL=1;
-  HAVE_SYS_TIME_H=1;
-  HAVE_TIMEZONE_T=0;
-  REPLACE_GETTIMEOFDAY=0;
-  REPLACE_STRUCT_TIMEVAL=0;
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main (void)
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_c_r_pthread_kill=yes
+else $as_nop
+  ac_cv_lib_c_r_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
+printf "%s\n" "$ac_cv_lib_c_r_pthread_kill" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_kill" = xyes
+then :
+  gl_pthread_api=yes
+             LIBPTHREAD=-lc_r
+             LIBPMULTITHREAD=-lc_r
+fi
 
+        fi
+      fi
+    fi
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
+printf %s "checking whether POSIX threads API is available... " >&6; }
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
+printf "%s\n" "$gl_pthread_api" >&6; }
 
 
+    if test $gl_pthread_api = yes; then
 
+printf "%s\n" "#define HAVE_PTHREAD_API 1" >>confdefs.h
 
+    fi
 
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sched.h>
+int
+main (void)
+{
+sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  LIB_SCHED_YIELD=
 
+else $as_nop
+         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+printf %s "checking for sched_yield in -lrt... " >&6; }
+if test ${ac_cv_lib_rt_sched_yield+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char sched_yield ();
+int
+main (void)
+{
+return sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_rt_sched_yield=yes
+else $as_nop
+  ac_cv_lib_rt_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+printf "%s\n" "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes
+then :
+  LIB_SCHED_YIELD=-lrt
+else $as_nop
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
+printf %s "checking for sched_yield in -lposix4... " >&6; }
+if test ${ac_cv_lib_posix4_sched_yield+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix4  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char sched_yield ();
+int
+main (void)
+{
+return sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_posix4_sched_yield=yes
+else $as_nop
+  ac_cv_lib_posix4_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
+printf "%s\n" "$ac_cv_lib_posix4_sched_yield" >&6; }
+if test "x$ac_cv_lib_posix4_sched_yield" = xyes
+then :
+  LIB_SCHED_YIELD=-lposix4
+fi
 
+fi
 
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
 
+    gl_pthreadlib_body_done=done
+  fi
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_sys_time_h='<'sys/time.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
-$as_echo_n "checking absolute name of <sys/time.h>... " >&6; }
-if ${gl_cv_next_sys_time_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-             if test $ac_cv_header_sys_time_h = yes; then
 
 
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/time.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
+printf %s "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
+if test ${gl_cv_func_setlocale_null_all_mtsafe+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
+       # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
+       *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
+         gl_cv_func_setlocale_null_all_mtsafe=no ;;
+       # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
+       *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
+         gl_cv_func_setlocale_null_all_mtsafe=yes ;;
+       # If we don't know, obey --enable-cross-guesses.
+       *)
+         gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
+     esac
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
+printf "%s\n" "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
+    case "$host_os" in
+    mingw*) ;;
     *)
-      gl_dirsep_regex='\/'
+      if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+        gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
+      fi
       ;;
   esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'sys/time.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
+  case "$gl_cv_func_setlocale_null_all_mtsafe" in
+    *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
+    *)    SETLOCALE_NULL_ALL_MTSAFE=0 ;;
+  esac
 
-        gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
+printf "%s\n" "#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE" >>confdefs.h
 
-           gl_header=$gl_cv_absolute_sys_time_h
-           gl_cv_next_sys_time_h='"'$gl_header'"'
-          else
-               gl_cv_next_sys_time_h='<'sys/time.h'>'
-             fi
 
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
+printf %s "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
+if test ${gl_cv_func_setlocale_null_one_mtsafe+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  case "$host_os" in
+       # Guess no on OpenBSD, AIX.
+       openbsd* | aix*)
+         gl_cv_func_setlocale_null_one_mtsafe=no ;;
+       # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
+       *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
+         gl_cv_func_setlocale_null_one_mtsafe=yes ;;
+       # If we don't know, obey --enable-cross-guesses.
+       *)
+         gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
+     esac
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
-$as_echo "$gl_cv_next_sys_time_h" >&6; }
-     fi
-     NEXT_SYS_TIME_H=$gl_cv_next_sys_time_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='<'sys/time.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_sys_time_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
-
-
-
-
-
-  if test $ac_cv_header_sys_time_h != yes; then
-    HAVE_SYS_TIME_H=0
-  fi
-
-
-
-
-
-  if test $ac_cv_header_sys_socket_h != yes; then
-                    for ac_header in winsock2.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
-if test "x$ac_cv_header_winsock2_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_WINSOCK2_H 1
-_ACEOF
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
+printf "%s\n" "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
+    case "$host_os" in
+    mingw*) ;;
+    *)
+      if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+        gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
+      fi
+      ;;
+  esac
+  case "$gl_cv_func_setlocale_null_one_mtsafe" in
+    *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
+    *)    SETLOCALE_NULL_ONE_MTSAFE=0 ;;
+  esac
 
-fi
+printf "%s\n" "#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE" >>confdefs.h
 
-done
 
-  fi
-  if test "$ac_cv_header_winsock2_h" = yes; then
-    HAVE_WINSOCK2_H=1
-    UNISTD_H_HAVE_WINSOCK2_H=1
-    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
-  else
-    HAVE_WINSOCK2_H=0
-  fi
+    if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+    case "$host_os" in
+      mingw*) LIB_SETLOCALE_NULL= ;;
+      *)
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
-$as_echo_n "checking for struct timeval... " >&6; }
-if ${gl_cv_sys_struct_timeval+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
+printf %s "checking whether imported symbols can be declared weak... " >&6; }
+if test ${gl_cv_have_weak+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_cv_have_weak=no
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#if HAVE_SYS_TIME_H
-             #include <sys/time.h>
-            #endif
-            #include <time.h>
-            #if HAVE_WINSOCK2_H
-            # include <winsock2.h>
-            #endif
-
+extern void xyzzy ();
+#pragma weak xyzzy
 int
-main ()
+main (void)
 {
-static struct timeval x; x.tv_sec = x.tv_usec;
+xyzzy();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_sys_struct_timeval=yes
-else
-  gl_cv_sys_struct_timeval=no
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_have_weak=maybe
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+     if test $gl_cv_have_weak = maybe; then
+                     if test "$cross_compiling" = yes
+then :
+                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __ELF__
+             Extensible Linking Format
+             #endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Extensible Linking Format" >/dev/null 2>&1
+then :
+  gl_cv_have_weak="guessing yes"
+else $as_nop
+  gl_cv_have_weak="guessing no"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
-$as_echo "$gl_cv_sys_struct_timeval" >&6; }
-  if test $gl_cv_sys_struct_timeval != yes; then
-    HAVE_STRUCT_TIMEVAL=0
-  else
-                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
-$as_echo_n "checking for wide-enough struct timeval.tv_sec member... " >&6; }
-if ${gl_cv_sys_struct_timeval_tv_sec+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+rm -rf conftest*
+
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#if HAVE_SYS_TIME_H
-               #include <sys/time.h>
-              #endif
-              #include <time.h>
-              #if HAVE_WINSOCK2_H
-              # include <winsock2.h>
-              #endif
 
-int
-main ()
+#include <stdio.h>
+#pragma weak fputs
+int main ()
 {
-static struct timeval x;
-              typedef int verify_tv_sec_type[
-                sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
-              ];
-
-  ;
-  return 0;
+  return (fputs == NULL);
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_sys_struct_timeval_tv_sec=yes
-else
-  gl_cv_sys_struct_timeval_tv_sec=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_have_weak=yes
+else $as_nop
+  gl_cv_have_weak=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
-$as_echo "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
-    if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
-      REPLACE_STRUCT_TIMEVAL=1
-    fi
-  fi
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
-$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
-if ${gl_cv_cc_double_expbit0+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      if test "$cross_compiling" = yes; then :
 
-                                                                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+     fi
+          case " $LDFLAGS " in
+       *" -static "*) gl_cv_have_weak=no ;;
+     esac
+                    case "$gl_cv_have_weak" in
+       *yes)
+         case "$host_os" in
+           freebsd* | dragonfly* | midnightbsd*)
+             : > conftest1.c
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
+             cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+  return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
+               || gl_cv_have_weak=no
+             rm -f conftest1.c libempty.so conftest2.c conftest
+             ;;
+         esac
+         ;;
+     esac
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
+printf "%s\n" "$gl_cv_have_weak" >&6; }
+  case "$gl_cv_have_weak" in
+    *yes)
+
+printf "%s\n" "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
+
+      ;;
+  esac
+
+        case "$gl_cv_have_weak" in
+          *yes) LIB_SETLOCALE_NULL= ;;
+          *)    LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
+        esac
+        ;;
+    esac
+  else
+    LIB_SETLOCALE_NULL=
+  fi
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#if defined arm || defined __arm || defined __arm__
-  mixed_endianness
+#ifdef _MSC_VER
+MicrosoftCompiler
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "mixed_endianness" >/dev/null 2>&1; then :
-  gl_cv_cc_double_expbit0="unknown"
-else
-
-                                                         :
-if ${ac_cv_c_bigendian+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_bigendian=unknown
-    # See if we're dealing with a universal compiler.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-              not a universal capable compiler
-            #endif
-            typedef int dummy;
+  $EGREP "MicrosoftCompiler" >/dev/null 2>&1
+then :
+            rm -f conftest*
+     echo 'int dummy;' > conftest.c
+     { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null 2>&1
+     if test -f conftest.o; then
+       gl_asmext='s'
+       gl_c_asm_opt='-S'
+     else
+       gl_asmext='asm'
+       gl_c_asm_opt='-c -Fa'
+     fi
+     rm -f conftest*
 
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+else $as_nop
+  gl_asmext='s'
+     gl_c_asm_opt='-S'
 
-       # Check for potential -arch flags.  It is not universal unless
-       # there are at least two -arch flags with different values.
-       ac_arch=
-       ac_prev=
-       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
-        if test -n "$ac_prev"; then
-          case $ac_word in
-            i?86 | x86_64 | ppc | ppc64)
-              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
-                ac_arch=$ac_word
-              else
-                ac_cv_c_bigendian=universal
-                break
-              fi
-              ;;
-          esac
-          ac_prev=
-        elif test "x$ac_word" = "x-arch"; then
-          ac_prev=arch
-        fi
-       done
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if sys/param.h defines the BYTE_ORDER macro.
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-            #include <sys/param.h>
+rm -rf conftest*
 
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
-                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
-                    && LITTLE_ENDIAN)
-             bogus endian macros
-            #endif
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-               #include <sys/param.h>
 
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
-                not big endian
-               #endif
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
 
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
-             bogus endian macros
-            #endif
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host CPU and C ABI" >&5
+printf %s "checking host CPU and C ABI... " >&6; }
+if test ${gl_cv_host_cpu_c_abi+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  case "$host_cpu" in
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to _BIG_ENDIAN or not.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+       i[34567]86 )
+         gl_cv_host_cpu_c_abi=i386
+         ;;
+
+       x86_64 )
+         # On x86_64 systems, the C compiler may be generating code in one of
+         # these ABIs:
+         # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+         # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+         #   with native Windows (mingw, MSVC).
+         # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <limits.h>
+#if (defined __x86_64__ || defined __amd64__ \
+                     || defined _M_X64 || defined _M_AMD64)
+                 int ok;
+                #else
+                 error fail
+                #endif
 
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
-                not big endian
-               #endif
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __ILP32__ || defined _ILP32
+                    int ok;
+                   #else
+                    error fail
+                   #endif
 
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi=x86_64-x32
+else $as_nop
+  gl_cv_host_cpu_c_abi=x86_64
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+else $as_nop
+  gl_cv_host_cpu_c_abi=i386
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # Compile a test program.
-      if test "$cross_compiling" = yes; then :
-  # Try to guess by grepping values from an object file.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         ;;
+
+       alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
+         gl_cv_host_cpu_c_abi=alpha
+         ;;
+
+       arm* | aarch64 )
+         # Assume arm with EABI.
+         # On arm64 systems, the C compiler may be generating code in one of
+         # these ABIs:
+         # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+         # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-short int ascii_mm[] =
-                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-               short int ascii_ii[] =
-                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-               int use_ascii (int i) {
-                 return ascii_mm[i] + ascii_ii[i];
-               }
-               short int ebcdic_ii[] =
-                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-               short int ebcdic_mm[] =
-                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-               int use_ebcdic (int i) {
-                 return ebcdic_mm[i] + ebcdic_ii[i];
-               }
-               extern int foo;
+#ifdef __aarch64__
+                 int ok;
+                #else
+                 error fail
+                #endif
 
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
-             ac_cv_c_bigendian=yes
-           fi
-           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-             if test "$ac_cv_c_bigendian" = unknown; then
-               ac_cv_c_bigendian=no
-             else
-               # finding both strings is unlikely to happen, but who knows?
-               ac_cv_c_bigendian=unknown
-             fi
-           fi
+if ac_fn_c_try_compile "$LINENO"
+then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __ILP32__ || defined _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi=arm64-ilp32
+else $as_nop
+  gl_cv_host_cpu_c_abi=arm64
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+else $as_nop
+  # Don't distinguish little-endian and big-endian arm, since they
+            # don't require different machine code for simple operations and
+            # since the user can distinguish them through the preprocessor
+            # defines __ARMEL__ vs. __ARMEB__.
+            # But distinguish arm which passes floating-point arguments and
+            # return values in integer registers (r0, r1, ...) - this is
+            # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
+            # passes them in float registers (s0, s1, ...) and double registers
+            # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
+            # sets the preprocessor defines __ARM_PCS (for the first case) and
+            # __ARM_PCS_VFP (for the second case), but older GCC does not.
+            echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
+            # Look for a reference to the register d0 in the .s file.
+            { ac_try='${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null 2>&1
+            if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
+              gl_cv_host_cpu_c_abi=armhf
+            else
+              gl_cv_host_cpu_c_abi=arm
+            fi
+            rm -f conftest*
+
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         ;;
 
-            /* Are we little or big endian?  From Harbison&Steele.  */
-            union
-            {
-              long int l;
-              char c[sizeof (long int)];
-            } u;
-            u.l = 1;
-            return u.c[sizeof (long int) - 1] == 1;
+       hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+         # On hppa, the C compiler may be generating 32-bit code or 64-bit
+         # code. In the latter case, it defines _LP64 and __LP64__.
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __LP64__
+                 int ok;
+                #else
+                 error fail
+                #endif
 
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_bigendian=no
-else
-  ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi=hppa64
+else $as_nop
+  gl_cv_host_cpu_c_abi=hppa
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         ;;
 
-    fi
-fi
-:
- case $ac_cv_c_bigendian in #(
-   yes)
-     gl_cv_cc_double_expbit0="word 0 bit 20";; #(
-   no)
-     gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
-   universal)
+       ia64* )
+         # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+         # 32-bit code. In the latter case, it defines _ILP32.
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef _ILP32
+                 int ok;
+                #else
+                 error fail
+                #endif
 
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi=ia64-ilp32
+else $as_nop
+  gl_cv_host_cpu_c_abi=ia64
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         ;;
 
-     ;; #(
-   *)
-     gl_cv_cc_double_expbit0="unknown" ;;
- esac
+       mips* )
+         # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+         # at 32.
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                 int ok;
+                #else
+                 error fail
+                #endif
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi=mips64
+else $as_nop
+  # In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
+            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
+            # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
+            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if (_MIPS_SIM == _ABIN32)
+                    int ok;
+                   #else
+                    error fail
+                   #endif
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi=mipsn32
+else $as_nop
+  gl_cv_host_cpu_c_abi=mips
 fi
-rm -f conftest*
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         ;;
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+       powerpc* )
+         # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+         # No need to distinguish them here; the caller may distinguish
+         # them based on the OS.
+         # On powerpc64 systems, the C compiler may still be generating
+         # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+         # be generating 64-bit code.
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#if defined __powerpc64__ || defined __LP64__
+                 int ok;
+                #else
+                 error fail
+                #endif
 
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
-  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { double value; unsigned int word[NWORDS]; } memory_double;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (double x)
-{
-  memory_double m;
-  size_t i;
-  /* Clear it first, in case sizeof (double) < sizeof (memory_double).  */
-  memset (&m, 0, sizeof (memory_double));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
-int main ()
-{
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25);
-  add_to_ored_words (0.5);
-  add_to_ored_words (1.0);
-  add_to_ored_words (2.0);
-  add_to_ored_words (4.0);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
-}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  # On powerpc64, there are two ABIs on Linux: The AIX compatible
+            # one and the ELFv2 one. The latter defines _CALL_ELF=2.
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined _CALL_ELF && _CALL_ELF == 2
+                    int ok;
+                   #else
+                    error fail
+                   #endif
 
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_double_expbit0=`cat conftest.out`
-else
-  gl_cv_cc_double_expbit0="unknown"
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi=powerpc64-elfv2
+else $as_nop
+  gl_cv_host_cpu_c_abi=powerpc64
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+else $as_nop
+  gl_cv_host_cpu_c_abi=powerpc
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         ;;
 
-      rm -f conftest.out
+       rs6000 )
+         gl_cv_host_cpu_c_abi=powerpc
+         ;;
+
+       riscv32 | riscv64 )
+         # There are 2 architectures (with variants): rv32* and rv64*.
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if __riscv_xlen == 64
+                  int ok;
+                #else
+                  error fail
+                #endif
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  cpu=riscv64
+else $as_nop
+  cpu=riscv32
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
-$as_echo "$gl_cv_cc_double_expbit0" >&6; }
-  case "$gl_cv_cc_double_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+         # Size of 'long' and 'void *':
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__
+                  int ok;
+                #else
+                  error fail
+                #endif
 
-cat >>confdefs.h <<_ACEOF
-#define DBL_EXPBIT0_WORD $word
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  main_abi=lp64
+else $as_nop
+  main_abi=ilp32
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         # Float ABIs:
+         # __riscv_float_abi_double:
+         #   'float' and 'double' are passed in floating-point registers.
+         # __riscv_float_abi_single:
+         #   'float' are passed in floating-point registers.
+         # __riscv_float_abi_soft:
+         #   No values are passed in floating-point registers.
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __riscv_float_abi_double
+                  int ok;
+                #else
+                  error fail
+                #endif
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  float_abi=d
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __riscv_float_abi_single
+                     int ok;
+                   #else
+                     error fail
+                   #endif
 
-cat >>confdefs.h <<_ACEOF
-#define DBL_EXPBIT0_BIT $bit
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  float_abi=f
+else $as_nop
+  float_abi=''
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
-      ;;
-  esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
+         ;;
 
+       s390* )
+         # On s390x, the C compiler may be generating 64-bit (= s390x) code
+         # or 31-bit (= s390) code.
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__ || defined __s390x__
+                  int ok;
+                #else
+                  error fail
+                #endif
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
-$as_echo_n "checking where to find the exponent in a 'float'... " >&6; }
-if ${gl_cv_cc_float_expbit0+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi=s390x
+else $as_nop
+  gl_cv_host_cpu_c_abi=s390
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         ;;
 
-      if test "$cross_compiling" = yes; then :
-  gl_cv_cc_float_expbit0="word 0 bit 23"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+       sparc | sparc64 )
+         # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+         # C compiler still generates 32-bit code.
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
-  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { float value; unsigned int word[NWORDS]; } memory_float;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (float x)
-{
-  memory_float m;
-  size_t i;
-  /* Clear it first, in case
-     sizeof (float) < sizeof (memory_float).  */
-  memset (&m, 0, sizeof (memory_float));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
-int main ()
-{
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25f);
-  add_to_ored_words (0.5f);
-  add_to_ored_words (1.0f);
-  add_to_ored_words (2.0f);
-  add_to_ored_words (4.0f);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
-}
+#if defined __sparcv9 || defined __arch64__
+                 int ok;
+                #else
+                 error fail
+                #endif
 
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_float_expbit0=`cat conftest.out`
-else
-  gl_cv_cc_float_expbit0="unknown"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi=sparc64
+else $as_nop
+  gl_cv_host_cpu_c_abi=sparc
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         ;;
 
-      rm -f conftest.out
+       *)
+         gl_cv_host_cpu_c_abi="$host_cpu"
+         ;;
+     esac
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
-$as_echo "$gl_cv_cc_float_expbit0" >&6; }
-  case "$gl_cv_cc_float_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi" >&5
+printf "%s\n" "$gl_cv_host_cpu_c_abi" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define FLT_EXPBIT0_WORD $word
-_ACEOF
+    HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
+  HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
 
 
-cat >>confdefs.h <<_ACEOF
-#define FLT_EXPBIT0_BIT $bit
-_ACEOF
 
-      ;;
-  esac
+  # This was
+  #   AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
+  #   AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
+  # earlier, but KAI C++ 3.2d doesn't like this.
+  sed -e 's/-/_/g' >> confdefs.h <<EOF
+#ifndef __${HOST_CPU}__
+#define __${HOST_CPU}__ 1
+#endif
+#ifndef __${HOST_CPU_C_ABI}__
+#define __${HOST_CPU_C_ABI}__ 1
+#endif
+EOF
 
 
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
-$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
-if ${ac_cv_c_bigendian+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_bigendian=unknown
-    # See if we're dealing with a universal compiler.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-              not a universal capable compiler
-            #endif
-            typedef int dummy;
 
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
 
-       # Check for potential -arch flags.  It is not universal unless
-       # there are at least two -arch flags with different values.
-       ac_arch=
-       ac_prev=
-       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
-        if test -n "$ac_prev"; then
-          case $ac_word in
-            i?86 | x86_64 | ppc | ppc64)
-              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
-                ac_arch=$ac_word
-              else
-                ac_cv_c_bigendian=universal
-                break
-              fi
-              ;;
-          esac
-          ac_prev=
-        elif test "x$ac_word" = "x-arch"; then
-          ac_prev=arch
-        fi
-       done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if sys/param.h defines the BYTE_ORDER macro.
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-            #include <sys/param.h>
+      if test "X$prefix" = "XNONE"; then
+    acl_final_prefix="$ac_default_prefix"
+  else
+    acl_final_prefix="$prefix"
+  fi
+  if test "X$exec_prefix" = "XNONE"; then
+    acl_final_exec_prefix='${prefix}'
+  else
+    acl_final_exec_prefix="$exec_prefix"
+  fi
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  eval acl_final_exec_prefix=\"$acl_final_exec_prefix\"
+  prefix="$acl_save_prefix"
 
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
-                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
-                    && LITTLE_ENDIAN)
-             bogus endian macros
-            #endif
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-               #include <sys/param.h>
 
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
-                not big endian
-               #endif
+# Check whether --with-gnu-ld was given.
+if test ${with_gnu_ld+y}
+then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else $as_nop
+  with_gnu_ld=no
+fi
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test -n "$LD"; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld" >&5
+printf %s "checking for ld... " >&6; }
+elif test "$GCC" = yes; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+printf %s "checking for ld used by $CC... " >&6; }
+elif test "$with_gnu_ld" = yes; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+printf %s "checking for GNU ld... " >&6; }
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+printf %s "checking for non-GNU ld... " >&6; }
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test -n "$LD"; then
+  # Let the user override the test with a path.
+  :
+else
+  if test ${acl_cv_path_LD+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    acl_cv_path_LD= # Final result of this test
+    ac_prog=ld # Program to search in $PATH
+    if test "$GCC" = yes; then
+      # Check if gcc -print-prog-name=ld gives a path.
+      case $host in
+        *-*-mingw*)
+          # gcc leaves a trailing carriage return which upsets mingw
+          acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+        *)
+          acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+      esac
+      case $acl_output in
+        # Accept absolute paths.
+        [\\/]* | ?:[\\/]*)
+          re_direlt='/[^/][^/]*/\.\./'
+          # Canonicalize the pathname of ld
+          acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+          while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+            acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+          done
+          # Got the pathname. No search in PATH is needed.
+          acl_cv_path_LD="$acl_output"
+          ac_prog=
+          ;;
+        "")
+          # If it fails, then pretend we aren't using GCC.
+          ;;
+        *)
+          # If it is relative, then search for the first ld in PATH.
+          with_gnu_ld=unknown
+          ;;
+      esac
     fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    if test -n "$ac_prog"; then
+      # Search for $ac_prog in $PATH.
+      acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+      for ac_dir in $PATH; do
+        IFS="$acl_save_ifs"
+        test -z "$ac_dir" && ac_dir=.
+        if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+          acl_cv_path_LD="$ac_dir/$ac_prog"
+          # Check to see if the program is GNU ld.  I'd rather use --version,
+          # but apparently some variants of GNU ld only accept -v.
+          # Break only if it was the GNU/non-GNU ld that we prefer.
+          case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+            *GNU* | *'with BFD'*)
+              test "$with_gnu_ld" != no && break
+              ;;
+            *)
+              test "$with_gnu_ld" != yes && break
+              ;;
+          esac
+        fi
+      done
+      IFS="$acl_save_ifs"
+    fi
+    case $host in
+      *-*-aix*)
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <limits.h>
-
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
-             bogus endian macros
-            #endif
+#if defined __powerpc64__ || defined __LP64__
+                int ok;
+               #else
+                error fail
+               #endif
 
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to _BIG_ENDIAN or not.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-
-int
-main ()
-{
-#ifndef _BIG_ENDIAN
-                not big endian
-               #endif
+if ac_fn_c_try_compile "$LINENO"
+then :
+  # The compiler produces 64-bit code. Add option '-b64' so that the
+           # linker groks 64-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -b64 "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+           esac
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # Compile a test program.
-      if test "$cross_compiling" = yes; then :
-  # Try to guess by grepping values from an object file.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+        ;;
+      sparc64-*-netbsd*)
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-short int ascii_mm[] =
-                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-               short int ascii_ii[] =
-                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-               int use_ascii (int i) {
-                 return ascii_mm[i] + ascii_ii[i];
-               }
-               short int ebcdic_ii[] =
-                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-               short int ebcdic_mm[] =
-                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-               int use_ebcdic (int i) {
-                 return ebcdic_mm[i] + ebcdic_ii[i];
-               }
-               extern int foo;
+#if defined __sparcv9 || defined __arch64__
+                int ok;
+               #else
+                error fail
+               #endif
 
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
-             ac_cv_c_bigendian=yes
-           fi
-           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-             if test "$ac_cv_c_bigendian" = unknown; then
-               ac_cv_c_bigendian=no
-             else
-               # finding both strings is unlikely to happen, but who knows?
-               ac_cv_c_bigendian=unknown
-             fi
-           fi
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
+if ac_fn_c_try_compile "$LINENO"
+then :
 
-            /* Are we little or big endian?  From Harbison&Steele.  */
-            union
-            {
-              long int l;
-              char c[sizeof (long int)];
-            } u;
-            u.l = 1;
-            return u.c[sizeof (long int) - 1] == 1;
+else $as_nop
+  # The compiler produces 32-bit code. Add option '-m elf32_sparc'
+           # so that the linker groks 32-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -m elf32_sparc "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+           esac
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_bigendian=no
-else
-  ac_cv_c_bigendian=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+        ;;
+    esac
 
-    fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
-$as_echo "$ac_cv_c_bigendian" >&6; }
- case $ac_cv_c_bigendian in #(
-   yes)
-     $as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
-;; #(
-   no)
-      ;; #(
-   universal)
-
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
-
-     ;; #(
-   *)
-     as_fn_error $? "unknown endianness
- presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
- esac
-
-
-
-  GNULIB_NL_LANGINFO=0;
-    HAVE_NL_LANGINFO=1;
-  REPLACE_NL_LANGINFO=0;
-
-
-
 
+  LD="$acl_cv_path_LD"
+fi
+if test -n "$LD"; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+printf "%s\n" "$LD" >&6; }
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+  as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+printf %s "checking if the linker ($LD) is GNU ld... " >&6; }
+if test ${acl_cv_prog_gnu_ld+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  acl_cv_prog_gnu_ld=yes
+  ;;
+*)
+  acl_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_prog_gnu_ld" >&5
+printf "%s\n" "$acl_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$acl_cv_prog_gnu_ld
 
 
 
 
 
+                                                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shared library run path origin" >&5
+printf %s "checking for shared library run path origin... " >&6; }
+if test ${acl_cv_rpath+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+    CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \
+    ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh
+    . ./conftest.sh
+    rm -f ./conftest.sh
+    acl_cv_rpath=done
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_rpath" >&5
+printf "%s\n" "$acl_cv_rpath" >&6; }
+  wl="$acl_cv_wl"
+  acl_libext="$acl_cv_libext"
+  acl_shlibext="$acl_cv_shlibext"
+  acl_libname_spec="$acl_cv_libname_spec"
+  acl_library_names_spec="$acl_cv_library_names_spec"
+  acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec"
+  acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator"
+  acl_hardcode_direct="$acl_cv_hardcode_direct"
+  acl_hardcode_minus_L="$acl_cv_hardcode_minus_L"
+    # Check whether --enable-rpath was given.
+if test ${enable_rpath+y}
+then :
+  enableval=$enable_rpath; :
+else $as_nop
+  enable_rpath=yes
+fi
 
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_limits_h='<'limits.h'>'
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking 32-bit host C ABI" >&5
+printf %s "checking 32-bit host C ABI... " >&6; }
+if test ${gl_cv_host_cpu_c_abi_32bit+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test -n "$gl_cv_host_cpu_c_abi"; then
+       case "$gl_cv_host_cpu_c_abi" in
+         i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+           gl_cv_host_cpu_c_abi_32bit=yes ;;
+         x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+           gl_cv_host_cpu_c_abi_32bit=no ;;
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown ;;
+       esac
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
-$as_echo_n "checking absolute name of <limits.h>... " >&6; }
-if ${gl_cv_next_limits_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-             if test $ac_cv_header_limits_h = yes; then
-
+       case "$host_cpu" in
+
+         # CPUs that only support a 32-bit ABI.
+         arc \
+         | bfin \
+         | cris* \
+         | csky \
+         | epiphany \
+         | ft32 \
+         | h8300 \
+         | m68k \
+         | microblaze | microblazeel \
+         | nds32 | nds32le | nds32be \
+         | nios2 | nios2eb | nios2el \
+         | or1k* \
+         | or32 \
+         | sh | sh1234 | sh1234elb \
+         | tic6x \
+         | xtensa* )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
 
+         # CPUs that only support a 64-bit ABI.
+         alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+         | mmix )
+           gl_cv_host_cpu_c_abi_32bit=no
+           ;;
 
+         i[34567]86 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+         x86_64 )
+           # On x86_64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+           # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+           #   with native Windows (mingw, MSVC).
+           # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <limits.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
-
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'limits.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
-
-        gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
+#if (defined __x86_64__ || defined __amd64__ \
+                       || defined _M_X64 || defined _M_AMD64) \
+                      && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
 
-           gl_header=$gl_cv_absolute_limits_h
-           gl_cv_next_limits_h='"'$gl_header'"'
-          else
-               gl_cv_next_limits_h='<'limits.h'>'
-             fi
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else $as_nop
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+           ;;
 
+         arm* | aarch64 )
+           # Assume arm with EABI.
+           # On arm64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+           # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else $as_nop
+  gl_cv_host_cpu_c_abi_32bit=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
-$as_echo "$gl_cv_next_limits_h" >&6; }
-     fi
-     NEXT_LIMITS_H=$gl_cv_next_limits_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='<'limits.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_limits_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+           ;;
 
+         hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+           # On hppa, the C compiler may be generating 32-bit code or 64-bit
+           # code. In the latter case, it defines _LP64 and __LP64__.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __LP64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else $as_nop
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+           ;;
 
+         ia64* )
+           # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+           # 32-bit code. In the latter case, it defines _ILP32.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=yes
+else $as_nop
+  gl_cv_host_cpu_c_abi_32bit=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+           ;;
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether limits.h has ULLONG_WIDTH etc." >&5
-$as_echo_n "checking whether limits.h has ULLONG_WIDTH etc.... " >&6; }
-if ${gl_cv_header_limits_width+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+         mips* )
+           # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+           # at 32.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
-                           #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
-                          #endif
-                          #include <limits.h>
-                          int ullw = ULLONG_WIDTH;
-int
-main ()
-{
+#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
 
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_limits_width=yes
-else
-  gl_cv_header_limits_width=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else $as_nop
+  gl_cv_host_cpu_c_abi_32bit=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
-$as_echo "$gl_cv_header_limits_width" >&6; }
-  if test "$gl_cv_header_limits_width" = yes; then
-    LIMITS_H=
-  else
-    LIMITS_H=limits.h
-  fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+           ;;
 
-   if test -n "$LIMITS_H"; then
-  GL_GENERATE_LIMITS_H_TRUE=
-  GL_GENERATE_LIMITS_H_FALSE='#'
-else
-  GL_GENERATE_LIMITS_H_TRUE='#'
-  GL_GENERATE_LIMITS_H_FALSE=
+         powerpc* )
+           # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+           # No need to distinguish them here; the caller may distinguish
+           # them based on the OS.
+           # On powerpc64 systems, the C compiler may still be generating
+           # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+           # be generating 64-bit code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __powerpc64__ || defined __LP64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else $as_nop
+  gl_cv_host_cpu_c_abi_32bit=yes
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+           ;;
 
+         rs6000 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
 
-ac_fn_c_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getc_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+         riscv32 | riscv64 )
+           # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+           # Size of 'long' and 'void *':
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else $as_nop
+  gl_cv_host_cpu_c_abi_32bit=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+           ;;
 
-
-    { $as_echo "$as_me:${as_lineno-$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 ${ac_cv_gnu_library_2_1+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+         s390* )
+           # On s390x, the C compiler may be generating 64-bit (= s390x) code
+           # or 31-bit (= s390) code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-  Lucky GNU user
- #endif
-#endif
-#ifdef __UCLIBC__
- Lucky user
-#endif
+#if defined __LP64__ || defined __s390x__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
 
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky" >/dev/null 2>&1; then :
-  ac_cv_gnu_library_2_1=yes
-else
-  ac_cv_gnu_library_2_1=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else $as_nop
+  gl_cv_host_cpu_c_abi_32bit=yes
 fi
-rm -f conftest*
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+           ;;
 
+         sparc | sparc64 )
+           # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+           # C compiler still generates 32-bit code.
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __sparcv9 || defined __arch64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_host_cpu_c_abi_32bit=no
+else $as_nop
+  gl_cv_host_cpu_c_abi_32bit=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_gnu_library_2_1" >&5
-$as_echo "$ac_cv_gnu_library_2_1" >&6; }
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+           ;;
 
-    GLIBC21="$ac_cv_gnu_library_2_1"
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown
+           ;;
+       esac
+     fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_host_cpu_c_abi_32bit" >&5
+printf "%s\n" "$gl_cv_host_cpu_c_abi_32bit" >&6; }
 
+  HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
 
-  GNULIB_LOCALECONV=0;
-  GNULIB_SETLOCALE=0;
-  GNULIB_DUPLOCALE=0;
-    HAVE_DUPLOCALE=1;
-  REPLACE_LOCALECONV=0;
-  REPLACE_SETLOCALE=0;
-  REPLACE_DUPLOCALE=0;
-  REPLACE_STRUCT_LCONV=0;
 
 
-    REPLACE_NULL=0;
-  HAVE_MAX_ALIGN_T=1;
-  HAVE_WCHAR_T=1;
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
-$as_echo_n "checking for wchar_t... " >&6; }
-if ${gt_cv_c_wchar_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ELF binary format" >&5
+printf %s "checking for ELF binary format... " >&6; }
+if test ${gl_cv_elf+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stddef.h>
-            wchar_t foo = (wchar_t)'\0';
-int
-main ()
-{
+#ifdef __ELF__
+        Extensible Linking Format
+        #endif
 
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_c_wchar_t=yes
-else
-  gt_cv_c_wchar_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Extensible Linking Format" >/dev/null 2>&1
+then :
+  gl_cv_elf=yes
+else $as_nop
+  gl_cv_elf=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
-$as_echo "$gt_cv_c_wchar_t" >&6; }
-  if test $gt_cv_c_wchar_t = yes; then
+rm -rf conftest*
 
-$as_echo "#define HAVE_WCHAR_T 1" >>confdefs.h
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_elf" >&5
+printf "%s\n" "$gl_cv_elf" >&6; }
+  if test $gl_cv_elf = yes; then
+    # Extract the ELF class of a file (5th byte) in decimal.
+    # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+    if od -A x < /dev/null >/dev/null 2>/dev/null; then
+      # Use POSIX od.
+      func_elfclass ()
+      {
+        od -A n -t d1 -j 4 -N 1
+      }
+    else
+      # Use BSD hexdump.
+      func_elfclass ()
+      {
+        dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+        echo
+      }
+    fi
+    # Use 'expr', not 'test', to compare the values of func_elfclass, because on
+    # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002,
+    # not 1 or 2.
+    case $HOST_CPU_C_ABI_32BIT in
+      yes)
+        # 32-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          expr "`func_elfclass | sed -e 's/[   ]//g'`" = 1 > /dev/null
+        }
+        ;;
+      no)
+        # 64-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          expr "`func_elfclass | sed -e 's/[   ]//g'`" = 2 > /dev/null
+        }
+        ;;
+      *)
+        # Unknown.
+        acl_is_expected_elfclass ()
+        {
+          :
+        }
+        ;;
+    esac
+  else
+    acl_is_expected_elfclass ()
+    {
+      :
+    }
   fi
 
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the common suffixes of directories in the library search path" >&5
+printf %s "checking for the common suffixes of directories in the library search path... " >&6; }
+if test ${acl_cv_libdirstems+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+            acl_libdirstem=lib
+     acl_libdirstem2=
+     acl_libdirstem3=
+     case "$host_os" in
+       solaris*)
+                                                      if test $HOST_CPU_C_ABI_32BIT = no; then
+           acl_libdirstem2=lib/64
+           case "$host_cpu" in
+             sparc*)        acl_libdirstem3=lib/sparcv9 ;;
+             i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
+           esac
+         fi
+         ;;
+       *)
+                                                                                 searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+                     | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+         if test $HOST_CPU_C_ABI_32BIT != no; then
+           # 32-bit or unknown ABI.
+           if test -d /usr/lib32; then
+             acl_libdirstem2=lib32
+           fi
+         fi
+         if test $HOST_CPU_C_ABI_32BIT != yes; then
+           # 64-bit or unknown ABI.
+           if test -d /usr/lib64; then
+             acl_libdirstem3=lib64
+           fi
+         fi
+         if test -n "$searchpath"; then
+           acl_save_IFS="${IFS=        }"; IFS=":"
+           for searchdir in $searchpath; do
+             if test -d "$searchdir"; then
+               case "$searchdir" in
+                 */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+                 */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+                 */../ | */.. )
+                   # Better ignore directories of this form. They are misleading.
+                   ;;
+                 *) searchdir=`cd "$searchdir" && pwd`
+                    case "$searchdir" in
+                      */lib32 ) acl_libdirstem2=lib32 ;;
+                      */lib64 ) acl_libdirstem3=lib64 ;;
+                    esac ;;
+               esac
+             fi
+           done
+           IFS="$acl_save_IFS"
+           if test $HOST_CPU_C_ABI_32BIT = yes; then
+             # 32-bit ABI.
+             acl_libdirstem3=
+           fi
+           if test $HOST_CPU_C_ABI_32BIT = no; then
+             # 64-bit ABI.
+             acl_libdirstem2=
+           fi
+         fi
+         ;;
+     esac
+     test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+     test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+     acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $acl_cv_libdirstems" >&5
+printf "%s\n" "$acl_cv_libdirstems" >&6; }
+      acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+  acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+  acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
 
 
-  STDDEF_H=
-  ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h>
 
-"
-if test "x$ac_cv_type_max_align_t" = xyes; then :
 
-else
-  HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h
-fi
 
-  if test $gt_cv_c_wchar_t = no; then
-    HAVE_WCHAR_T=0
-    STDDEF_H=stddef.h
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
-$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
-if ${gl_cv_decl_null_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stddef.h>
-      int test[2 * (sizeof NULL == sizeof (void *)) -1];
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_decl_null_works=yes
-else
-  gl_cv_decl_null_works=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
-$as_echo "$gl_cv_decl_null_works" >&6; }
-  if test $gl_cv_decl_null_works = no; then
-    REPLACE_NULL=1
-    STDDEF_H=stddef.h
-  fi
 
-   if test -n "$STDDEF_H"; then
-  GL_GENERATE_STDDEF_H_TRUE=
-  GL_GENERATE_STDDEF_H_FALSE='#'
-else
-  GL_GENERATE_STDDEF_H_TRUE='#'
-  GL_GENERATE_STDDEF_H_FALSE=
-fi
 
-  if test -n "$STDDEF_H"; then
 
 
+    use_additional=yes
 
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
 
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+    eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+    eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
 
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
 
+# Check whether --with-libiconv-prefix was given.
+if test ${with_libiconv_prefix+y}
+then :
+  withval=$with_libiconv_prefix;
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_stddef_h='<'stddef.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
-$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
-if ${gl_cv_next_stddef_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
 
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+          eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+          eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
 
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stddef.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
-
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'stddef.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
-
-        gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
-
-           gl_header=$gl_cv_absolute_stddef_h
-           gl_cv_next_stddef_h='"'$gl_header'"'
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
-$as_echo "$gl_cv_next_stddef_h" >&6; }
-     fi
-     NEXT_STDDEF_H=$gl_cv_next_stddef_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='<'stddef.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_stddef_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
-
-
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+        additional_libdir2="$withval/$acl_libdirstem2"
+        additional_libdir3="$withval/$acl_libdirstem3"
+      fi
+    fi
 
+fi
 
+  if test "X$additional_libdir2" = "X$additional_libdir"; then
+    additional_libdir2=
   fi
-
-
-
-
-
-  gl_threads_api=none
-  LIBTHREAD=
-  LTLIBTHREAD=
-  LIBMULTITHREAD=
-  LTLIBMULTITHREAD=
-  if test "$gl_use_threads" != no; then
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
-$as_echo_n "checking whether imported symbols can be declared weak... " >&6; }
-if ${gl_cv_have_weak+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  gl_cv_have_weak=no
-              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-extern void xyzzy ();
-#pragma weak xyzzy
-int
-main ()
-{
-xyzzy();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_have_weak=maybe
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-       if test $gl_cv_have_weak = maybe; then
-                           if test "$cross_compiling" = yes; then :
-                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __ELF__
-               Extensible Linking Format
-               #endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Extensible Linking Format" >/dev/null 2>&1; then :
-  gl_cv_have_weak="guessing yes"
-else
-  gl_cv_have_weak="guessing no"
-fi
-rm -f conftest*
-
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <stdio.h>
-#pragma weak fputs
-int main ()
-{
-  return (fputs == NULL);
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_have_weak=yes
-else
-  gl_cv_have_weak=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-       fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
-$as_echo "$gl_cv_have_weak" >&6; }
-    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
-      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
-      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
-      ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
-if test "x$ac_cv_header_pthread_h" = xyes; then :
-  gl_have_pthread_h=yes
-else
-  gl_have_pthread_h=no
-fi
-
-
-      if test "$gl_have_pthread_h" = yes; then
-        # Other possible tests:
-        #   -lpthreads (FSU threads, PCthreads)
-        #   -lgthreads
-        gl_have_pthread=
-        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
-        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
-        # the second one only in libpthread, and lock.c needs it.
-        #
-        # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
-        # needs -pthread for some reason.  See:
-        # http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html
-        save_LIBS=$LIBS
-        for gl_pthread in '' '-pthread'; do
-          LIBS="$LIBS $gl_pthread"
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pthread.h>
-                 pthread_mutex_t m;
-                 pthread_mutexattr_t ma;
-
-int
-main ()
-{
-pthread_mutex_lock (&m);
-                 pthread_mutexattr_init (&ma);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_have_pthread=yes
-             LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread
-             LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-          LIBS=$save_LIBS
-          test -n "$gl_have_pthread" && break
-        done
-
-        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
-        # since it is defined as a macro on OSF/1.)
-        if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then
-          # The program links fine without libpthread. But it may actually
-          # need to link with libpthread in order to create multiple threads.
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
-$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
-if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_kill ();
-int
-main ()
-{
-return pthread_kill ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_pthread_pthread_kill=yes
-else
-  ac_cv_lib_pthread_pthread_kill=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
-$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
-  LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
-             # On Solaris and HP-UX, most pthread functions exist also in libc.
-             # Therefore pthread_in_use() needs to actually try to create a
-             # thread: pthread_create from libc will fail, whereas
-             # pthread_create will actually create a thread.
-             # On Solaris 10 or newer, this test is no longer needed, because
-             # libc contains the fully functional pthread functions.
-             case "$host_os" in
-               solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
-
-$as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
-
-             esac
-
-fi
-
-        elif test -z "$gl_have_pthread"; then
-          # Some library is needed. Try libpthread and libc_r.
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
-$as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
-if ${ac_cv_lib_pthread_pthread_kill+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lpthread  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_kill ();
-int
-main ()
-{
-return pthread_kill ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_pthread_pthread_kill=yes
-else
-  ac_cv_lib_pthread_pthread_kill=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
-$as_echo "$ac_cv_lib_pthread_pthread_kill" >&6; }
-if test "x$ac_cv_lib_pthread_pthread_kill" = xyes; then :
-  gl_have_pthread=yes
-             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
-             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
-fi
-
-          if test -z "$gl_have_pthread"; then
-            # For FreeBSD 4.
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
-$as_echo_n "checking for pthread_kill in -lc_r... " >&6; }
-if ${ac_cv_lib_c_r_pthread_kill+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_check_lib_save_LIBS=$LIBS
-LIBS="-lc_r  $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char pthread_kill ();
-int
-main ()
-{
-return pthread_kill ();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_c_r_pthread_kill=yes
-else
-  ac_cv_lib_c_r_pthread_kill=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
-$as_echo "$ac_cv_lib_c_r_pthread_kill" >&6; }
-if test "x$ac_cv_lib_c_r_pthread_kill" = xyes; then :
-  gl_have_pthread=yes
-               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
-               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r
-fi
-
-          fi
-        fi
-        if test -n "$gl_have_pthread"; then
-          gl_threads_api=posix
-
-$as_echo "#define USE_POSIX_THREADS 1" >>confdefs.h
-
-          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
-            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
-
-$as_echo "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
-
-              LIBTHREAD=
-              LTLIBTHREAD=
-            fi
-          fi
-        fi
-      fi
-    fi
-    if test -z "$gl_have_pthread"; then
-      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
-        gl_have_solaristhread=
-        gl_save_LIBS="$LIBS"
-        LIBS="$LIBS -lthread"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <thread.h>
-#include <synch.h>
-
-int
-main ()
-{
-thr_self();
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_have_solaristhread=yes
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-        LIBS="$gl_save_LIBS"
-        if test -n "$gl_have_solaristhread"; then
-          gl_threads_api=solaris
-          LIBTHREAD=-lthread
-          LTLIBTHREAD=-lthread
-          LIBMULTITHREAD="$LIBTHREAD"
-          LTLIBMULTITHREAD="$LTLIBTHREAD"
-
-$as_echo "#define USE_SOLARIS_THREADS 1" >>confdefs.h
-
-          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
-
-$as_echo "#define USE_SOLARIS_THREADS_WEAK 1" >>confdefs.h
-
-            LIBTHREAD=
-            LTLIBTHREAD=
-          fi
-        fi
-      fi
-    fi
-    if test "$gl_use_threads" = pth; then
-      gl_save_CPPFLAGS="$CPPFLAGS"
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libpth" >&5
-$as_echo_n "checking how to link with libpth... " >&6; }
-if ${ac_cv_libpth_libs+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-
-
-
-
-
-
-
-    use_additional=yes
-
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
-
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
-
-
-# Check whether --with-libpth-prefix was given.
-if test "${with_libpth_prefix+set}" = set; then :
-  withval=$with_libpth_prefix;
-    if test "X$withval" = "Xno"; then
-      use_additional=no
-    else
-      if test "X$withval" = "X"; then
-
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-
-          eval additional_includedir=\"$includedir\"
-          eval additional_libdir=\"$libdir\"
-
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
-
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/$acl_libdirstem"
-        if test "$acl_libdirstem2" != "$acl_libdirstem" \
-           && ! test -d "$withval/$acl_libdirstem"; then
-          additional_libdir="$withval/$acl_libdirstem2"
-        fi
-      fi
-    fi
-
-fi
-
-      LIBPTH=
-  LTLIBPTH=
-  INCPTH=
-  LIBPTH_PREFIX=
-      HAVE_LIBPTH=
+  if test "X$additional_libdir3" = "X$additional_libdir"; then
+    additional_libdir3=
+  fi
+      LIBICONV=
+  LTLIBICONV=
+  INCICONV=
+  LIBICONV_PREFIX=
+      HAVE_LIBICONV=
   rpathdirs=
   ltrpathdirs=
   names_already_handled=
-  names_next_round='pth '
+  names_next_round='iconv '
   while test -n "$names_next_round"; do
     names_this_round="$names_next_round"
     names_next_round=
@@ -14916,9 +17433,9 @@ fi
         if test -n "$value"; then
           if test "$value" = yes; then
             eval value=\"\$LIB$uppername\"
-            test -z "$value" || LIBPTH="${LIBPTH}${LIBPTH:+ }$value"
+            test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value"
             eval value=\"\$LTLIB$uppername\"
-            test -z "$value" || LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$value"
+            test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value"
           else
                                     :
           fi
             shrext=
           fi
           if test $use_additional = yes; then
-            dir="$additional_libdir"
-                                    if test -n "$acl_shlibext"; then
-              if test -f "$dir/$libname$shrext"; then
-                found_dir="$dir"
-                found_so="$dir/$libname$shrext"
-              else
-                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                  ver=`(cd "$dir" && \
-                        for f in "$libname$shrext".*; do echo "$f"; done \
-                        | sed -e "s,^$libname$shrext\\\\.,," \
-                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                        | sed 1q ) 2>/dev/null`
-                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                    found_dir="$dir"
-                    found_so="$dir/$libname$shrext.$ver"
+            for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+              if test "X$found_dir" = "X"; then
+                eval dir=\$$additional_libdir_variable
+                if test -n "$dir"; then
+                                                      if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
                   fi
-                else
-                  eval library_names=\"$acl_library_names_spec\"
-                  for f in $library_names; do
-                    if test -f "$dir/$f"; then
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
                       found_dir="$dir"
-                      found_so="$dir/$f"
-                      break
+                      found_a="$dir/$libname.$acl_libext"
                     fi
-                  done
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                 fi
               fi
-            fi
-                        if test "X$found_dir" = "X"; then
-              if test -f "$dir/$libname.$acl_libext"; then
-                found_dir="$dir"
-                found_a="$dir/$libname.$acl_libext"
-              fi
-            fi
-            if test "X$found_dir" != "X"; then
-              if test -f "$dir/$libname.la"; then
-                found_la="$dir/$libname.la"
-              fi
-            fi
+            done
           fi
           if test "X$found_dir" = "X"; then
-            for x in $LDFLAGS $LTLIBPTH; do
+            for x in $LDFLAGS $LTLIBICONV; do
 
   acl_save_prefix="$prefix"
   prefix="$acl_final_prefix"
@@ -14989,7 +17512,7 @@ fi
                 -L*)
                   dir=`echo "X$x" | sed -e 's/^X-L//'`
                                     if test -n "$acl_shlibext"; then
-                    if test -f "$dir/$libname$shrext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
                       found_dir="$dir"
                       found_so="$dir/$libname$shrext"
                     else
                               | sed -e "s,^$libname$shrext\\\\.,," \
                               | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
                               | sed 1q ) 2>/dev/null`
-                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
                           found_dir="$dir"
                           found_so="$dir/$libname$shrext.$ver"
                         fi
                       else
                         eval library_names=\"$acl_library_names_spec\"
                         for f in $library_names; do
-                          if test -f "$dir/$f"; then
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
                             found_dir="$dir"
                             found_so="$dir/$f"
                             break
@@ -15016,7 +17539,7 @@ fi
                     fi
                   fi
                                     if test "X$found_dir" = "X"; then
-                    if test -f "$dir/$libname.$acl_libext"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
                       found_dir="$dir"
                       found_a="$dir/$libname.$acl_libext"
                     fi
             done
           fi
           if test "X$found_dir" != "X"; then
-                        LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$found_dir -l$name"
+                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name"
             if test "X$found_so" != "X"; then
                                                         if test "$enable_rpath" = no \
                  || test "X$found_dir" = "X/usr/$acl_libdirstem" \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
-                                LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
+                                LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
               else
                                                                                 haveit=
                 for x in $ltrpathdirs; do
                   ltrpathdirs="$ltrpathdirs $found_dir"
                 fi
                                 if test "$acl_hardcode_direct" = yes; then
-                                                      LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+                                                      LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
                 else
                   if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
-                                                            LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+                                                            LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
                                                             haveit=
                     for x in $rpathdirs; do
                       if test "X$x" = "X$found_dir"; then
@@ -15068,7 +17592,7 @@ fi
                     fi
                   else
                                                                                 haveit=
-                    for x in $LDFLAGS $LIBPTH; do
+                    for x in $LDFLAGS $LIBICONV; do
 
   acl_save_prefix="$prefix"
   prefix="$acl_final_prefix"
                       fi
                     done
                     if test -z "$haveit"; then
-                      LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir"
+                      LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir"
                     fi
                     if test "$acl_hardcode_minus_L" != no; then
-                                                                                        LIBPTH="${LIBPTH}${LIBPTH:+ }$found_so"
+                                                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so"
                     else
-                                                                                                                                                                                LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name"
+                                                                                                                                                                                LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
                     fi
                   fi
                 fi
               fi
             else
               if test "X$found_a" != "X"; then
-                                LIBPTH="${LIBPTH}${LIBPTH:+ }$found_a"
+                                LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a"
               else
-                                                LIBPTH="${LIBPTH}${LIBPTH:+ }-L$found_dir -l$name"
+                                                LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name"
               fi
             fi
                         additional_includedir=
             case "$found_dir" in
               */$acl_libdirstem | */$acl_libdirstem/)
                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
-                if test "$name" = 'pth'; then
-                  LIBPTH_PREFIX="$basedir"
+                if test "$name" = 'iconv'; then
+                  LIBICONV_PREFIX="$basedir"
                 fi
                 additional_includedir="$basedir/include"
                 ;;
               */$acl_libdirstem2 | */$acl_libdirstem2/)
                 basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
-                if test "$name" = 'pth'; then
-                  LIBPTH_PREFIX="$basedir"
+                if test "$name" = 'iconv'; then
+                  LIBICONV_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem3 | */$acl_libdirstem3/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+                if test "$name" = 'iconv'; then
+                  LIBICONV_PREFIX="$basedir"
                 fi
                 additional_includedir="$basedir/include"
                 ;;
@@ -15129,7 +17660,7 @@ fi
                   fi
                 fi
                 if test -z "$haveit"; then
-                  for x in $CPPFLAGS $INCPTH; do
+                  for x in $CPPFLAGS $INCICONV; do
 
   acl_save_prefix="$prefix"
   prefix="$acl_final_prefix"
@@ -15146,7 +17677,7 @@ fi
                   done
                   if test -z "$haveit"; then
                     if test -d "$additional_includedir"; then
-                                            INCPTH="${INCPTH}${INCPTH:+ }-I$additional_includedir"
+                                            INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir"
                     fi
                   fi
                 fi
                             for dep in $dependency_libs; do
                 case "$dep" in
                   -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
-                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+                    dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
                       haveit=
-                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
-                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+                      if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
                         if test -n "$GCC"; then
                           case $host_os in
                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -15176,7 +17709,7 @@ fi
                       fi
                       if test -z "$haveit"; then
                         haveit=
-                        for x in $LDFLAGS $LIBPTH; do
+                        for x in $LDFLAGS $LIBICONV; do
 
   acl_save_prefix="$prefix"
   prefix="$acl_final_prefix"
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LIBPTH="${LIBPTH}${LIBPTH:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                                                        LIBICONV="${LIBICONV}${LIBICONV:+ }-L$dependency_libdir"
                           fi
                         fi
                         haveit=
-                        for x in $LDFLAGS $LTLIBPTH; do
+                        for x in $LDFLAGS $LTLIBICONV; do
 
   acl_save_prefix="$prefix"
   prefix="$acl_final_prefix"
   exec_prefix="$acl_save_exec_prefix"
   prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                                                        LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$dependency_libdir"
                           fi
                         fi
                       fi
                     fi
                     ;;
                   -l*)
-                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                                                                                                                                                                dep=`echo "X$dep" | sed -e 's/^X-l//'`
+                    if test "X$dep" != Xc \
+                       || case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) false ;;
+                            *)                          true ;;
+                          esac; then
+                      names_next_round="$names_next_round $dep"
+                    fi
                     ;;
                   *.la)
                                                                                 names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
                     ;;
                   *)
-                                        LIBPTH="${LIBPTH}${LIBPTH:+ }$dep"
-                    LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }$dep"
+                                        LIBICONV="${LIBICONV}${LIBICONV:+ }$dep"
+                    LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep"
                     ;;
                 esac
               done
             fi
           else
-                                                            LIBPTH="${LIBPTH}${LIBPTH:+ }-l$name"
-            LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-l$name"
+                                                            LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name"
+            LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name"
           fi
         fi
       fi
       libdir="$alldirs"
       eval flag=\"$acl_hardcode_libdir_flag_spec\"
       libdir="$acl_save_libdir"
-      LIBPTH="${LIBPTH}${LIBPTH:+ }$flag"
+      LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
     else
             for found_dir in $rpathdirs; do
         acl_save_libdir="$libdir"
         libdir="$found_dir"
         eval flag=\"$acl_hardcode_libdir_flag_spec\"
         libdir="$acl_save_libdir"
-        LIBPTH="${LIBPTH}${LIBPTH:+ }$flag"
+        LIBICONV="${LIBICONV}${LIBICONV:+ }$flag"
       done
     fi
   fi
   if test "X$ltrpathdirs" != "X"; then
             for found_dir in $ltrpathdirs; do
-      LTLIBPTH="${LTLIBPTH}${LTLIBPTH:+ }-R$found_dir"
+      LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir"
     done
   fi
 
 
 
 
-    ac_cv_libpth_libs="$LIBPTH"
-    ac_cv_libpth_ltlibs="$LTLIBPTH"
-    ac_cv_libpth_cppflags="$INCPTH"
-    ac_cv_libpth_prefix="$LIBPTH_PREFIX"
 
+
+    ICONV_CONST=;
+  REPLACE_ICONV=0;
+  REPLACE_ICONV_OPEN=0;
+  REPLACE_ICONV_UTF=0;
+  ICONV_H='';
+  if test "$CXX" != no; then
+              ICONV_H='iconv.h'
+     fi
+
+   if test -n "$ICONV_H"; then
+  GL_GENERATE_ICONV_H_TRUE=
+  GL_GENERATE_ICONV_H_FALSE='#'
+else
+  GL_GENERATE_ICONV_H_TRUE='#'
+  GL_GENERATE_ICONV_H_FALSE=
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libpth_libs" >&5
-$as_echo "$ac_cv_libpth_libs" >&6; }
-  LIBPTH="$ac_cv_libpth_libs"
-  LTLIBPTH="$ac_cv_libpth_ltlibs"
-  INCPTH="$ac_cv_libpth_cppflags"
-  LIBPTH_PREFIX="$ac_cv_libpth_prefix"
 
-  for element in $INCPTH; do
+
+
+
+
+
+
+          am_save_CPPFLAGS="$CPPFLAGS"
+
+  for element in $INCICONV; do
     haveit=
     for x in $CPPFLAGS; do
 
@@ -15334,2253 +17888,2350 @@ $as_echo "$ac_cv_libpth_libs" >&6; }
   done
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
+printf %s "checking for iconv... " >&6; }
+if test ${am_cv_func_iconv+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+    am_cv_func_iconv="no, consider installing GNU libiconv"
+    am_cv_lib_iconv=no
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-      HAVE_LIBPTH=yes
-
-
+#include <stdlib.h>
+#include <iconv.h>
 
-      gl_have_pth=
-      gl_save_LIBS="$LIBS"
-      LIBS="$LIBS $LIBPTH"
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <pth.h>
 int
-main ()
+main (void)
 {
-pth_self();
+iconv_t cd = iconv_open("","");
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_have_pth=yes
+if ac_fn_c_try_link "$LINENO"
+then :
+  am_cv_func_iconv=yes
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
-      LIBS="$gl_save_LIBS"
-      if test -n "$gl_have_pth"; then
-        gl_threads_api=pth
-        LIBTHREAD="$LIBPTH"
-        LTLIBTHREAD="$LTLIBPTH"
-        LIBMULTITHREAD="$LIBTHREAD"
-        LTLIBMULTITHREAD="$LTLIBTHREAD"
-
-$as_echo "#define USE_PTH_THREADS 1" >>confdefs.h
-
-        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
-          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
-
-$as_echo "#define USE_PTH_THREADS_WEAK 1" >>confdefs.h
-
-            LIBTHREAD=
-            LTLIBTHREAD=
-          fi
-        fi
-      else
-        CPPFLAGS="$gl_save_CPPFLAGS"
-      fi
-    fi
-    if test -z "$gl_have_pthread"; then
-      case "$gl_use_threads" in
-        yes | windows | win32) # The 'win32' is for backward compatibility.
-          if { case "$host_os" in
-                 mingw*) true;;
-                 *) false;;
-               esac
-             }; then
-            gl_threads_api=windows
+    if test "$am_cv_func_iconv" != yes; then
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS $LIBICONV"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-$as_echo "#define USE_WINDOWS_THREADS 1" >>confdefs.h
+#include <stdlib.h>
+#include <iconv.h>
 
-          fi
-          ;;
-      esac
+int
+main (void)
+{
+iconv_t cd = iconv_open("","");
+             iconv(cd,NULL,NULL,NULL,NULL);
+             iconv_close(cd);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  am_cv_lib_iconv=yes
+        am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+      LIBS="$am_save_LIBS"
     fi
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
-$as_echo_n "checking for multithread API to use... " >&6; }
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
-$as_echo "$gl_threads_api" >&6; }
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
+printf "%s\n" "$am_cv_func_iconv" >&6; }
+  if test "$am_cv_func_iconv" = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
+printf %s "checking for working iconv... " >&6; }
+if test ${am_cv_func_iconv_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+                  am_save_LIBS="$LIBS"
+      if test $am_cv_lib_iconv = yes; then
+        LIBS="$LIBS $LIBICONV"
+      fi
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <iconv.h>
+#include <string.h>
 
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
 
+int
+main (void)
+{
+int result = 0;
+  /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from
+     successful returns.  This is even documented in
+     <https://www.ibm.com/support/knowledgecenter/ssw_aix_72/i_bostechref/iconv.html> */
+  {
+    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+    if (cd_utf8_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_utf8_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
+      }
+  }
+  /* Test against Solaris 10 bug: Failures are not distinguishable from
+     successful returns.  */
+  {
+    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+    if (cd_ascii_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\263";
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_ascii_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
+      }
+  }
+  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304";
+        static char buf[2] = { (char)0xDE, (char)0xAD };
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = 1;
+        char *outptr = buf;
+        size_t outbytesleft = 1;
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#if 0 /* This bug could be worked around by the caller.  */
+  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        char buf[50];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if ((int)res > 0)
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#endif
+  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+     provided.  */
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
+  return result;
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  am_cv_func_iconv_works=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+        test "$am_cv_func_iconv_works" = no || break
+      done
+      LIBS="$am_save_LIBS"
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
+printf "%s\n" "$am_cv_func_iconv_works" >&6; }
+    case "$am_cv_func_iconv_works" in
+      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+      *)   am_func_iconv=yes ;;
+    esac
+  else
+    am_func_iconv=no am_cv_lib_iconv=no
+  fi
+  if test "$am_func_iconv" = yes; then
 
+printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h
 
+  fi
+  if test "$am_cv_lib_iconv" = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
+printf %s "checking how to link with libiconv... " >&6; }
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
+printf "%s\n" "$LIBICONV" >&6; }
+  else
+            CPPFLAGS="$am_save_CPPFLAGS"
+    LIBICONV=
+    LTLIBICONV=
+  fi
 
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lstat correctly handles trailing slash" >&5
-$as_echo_n "checking whether lstat correctly handles trailing slash... " >&6; }
-if ${gl_cv_func_lstat_dereferences_slashed_symlink+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -f conftest.sym conftest.file
-     echo >conftest.file
-     if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-          *-gnu*)
-            # Guess yes on glibc systems.
-            gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
-          *)
-            # If we don't know, assume the worst.
-            gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
-        esac
 
-else
+  if test "$am_cv_func_iconv" = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iconv is compatible with its POSIX signature" >&5
+printf %s "checking whether iconv is compatible with its POSIX signature... " >&6; }
+if test ${gl_cv_iconv_nonconst+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+
 int
-main ()
+main (void)
 {
-struct stat sbuf;
-            if (symlink ("conftest.file", "conftest.sym") != 0)
-              return 1;
-            /* 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
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_lstat_dereferences_slashed_symlink=yes
-else
-  gl_cv_func_lstat_dereferences_slashed_symlink=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_iconv_nonconst=yes
+else $as_nop
+  gl_cv_iconv_nonconst=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_iconv_nonconst" >&5
+printf "%s\n" "$gl_cv_iconv_nonconst" >&6; }
+  else
+            gl_cv_iconv_nonconst=yes
+  fi
+  if test $gl_cv_iconv_nonconst = yes; then
+    iconv_arg1=""
+  else
+    iconv_arg1="const"
+  fi
 
-     rm -f conftest.sym conftest.file
+printf "%s\n" "#define ICONV_CONST $iconv_arg1" >>confdefs.h
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lstat_dereferences_slashed_symlink" >&5
-$as_echo "$gl_cv_func_lstat_dereferences_slashed_symlink" >&6; }
-  case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
-    *yes)
 
-cat >>confdefs.h <<_ACEOF
-#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
-_ACEOF
+     if test $gl_cv_iconv_nonconst != yes; then
+       ICONV_CONST="const"
+     fi
 
-      ;;
-  esac
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
-$as_echo_n "checking for a sed that does not truncate output... " >&6; }
-if ${ac_cv_path_SED+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-     for ac_i in 1 2 3 4 5 6 7; do
-       ac_script="$ac_script$as_nl$ac_script"
-     done
-     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     { ac_script=; unset ac_script;}
-     if test -z "$SED"; then
-  ac_path_SED_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in sed gsed; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_SED" || continue
-# Check for GNU ac_path_SED and select it if it is found.
-  # Check for GNU $ac_path_SED
-case `"$ac_path_SED" --version 2>&1` in
-*GNU*)
-  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo '' >> "conftest.nl"
-    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_SED_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_SED="$ac_path_SED"
-      ac_path_SED_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
 
-      $ac_path_SED_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_SED"; then
-    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
-  fi
-else
-  ac_cv_path_SED=$SED
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
-$as_echo "$ac_cv_path_SED" >&6; }
- SED="$ac_cv_path_SED"
-  rm -f conftest.sed
+  GL_M4_GNULIB_ICONV=0
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether malloc, realloc, calloc are POSIX compliant" >&5
-$as_echo_n "checking whether malloc, realloc, calloc are POSIX compliant... " >&6; }
-if ${gl_cv_func_malloc_posix+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-int
-main ()
-{
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-             choke me
-             #endif
 
-  ;
-  return 0;
-}
+
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_iconv_h='<'iconv.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <iconv.h>" >&5
+printf %s "checking absolute name of <iconv.h>... " >&6; }
+if test ${gl_cv_next_iconv_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_iconv_h = yes; then
+
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <iconv.h>
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_malloc_posix=yes
-else
-  gl_cv_func_malloc_posix=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'iconv.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_iconv_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_iconv_h
+           gl_cv_next_iconv_h='"'$gl_header'"'
+          else
+               gl_cv_next_iconv_h='<'iconv.h'>'
+             fi
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_malloc_posix" >&5
-$as_echo "$gl_cv_func_malloc_posix" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_iconv_h" >&5
+printf "%s\n" "$gl_cv_next_iconv_h" >&6; }
+     fi
+     NEXT_ICONV_H=$gl_cv_next_iconv_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='<'iconv.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_iconv_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_ICONV_H=$gl_next_as_first_directive
 
 
 
-      for ac_header in stdlib.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdlib.h" "ac_cv_header_stdlib_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdlib_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDLIB_H 1
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_limits_h='<'limits.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <limits.h>" >&5
+printf %s "checking absolute name of <limits.h>... " >&6; }
+if test ${gl_cv_next_limits_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_limits_h = yes; then
+
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
 _ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'limits.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_limits_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_limits_h
+           gl_cv_next_limits_h='"'$gl_header'"'
+          else
+               gl_cv_next_limits_h='<'limits.h'>'
+             fi
+
 
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_limits_h" >&5
+printf "%s\n" "$gl_cv_next_limits_h" >&6; }
+     fi
+     NEXT_LIMITS_H=$gl_cv_next_limits_h
 
-done
+     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='<'limits.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_limits_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_LIMITS_H=$gl_next_as_first_directive
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU libc compatible malloc" >&5
-$as_echo_n "checking for GNU libc compatible malloc... " >&6; }
-if ${ac_cv_func_malloc_0_nonnull+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-          # Guess yes on platforms where we know the result.
-          *-gnu* | freebsd* | netbsd* | openbsd* \
-          | hpux* | solaris* | cygwin* | mingw*)
-            ac_cv_func_malloc_0_nonnull=yes ;;
-          # If we don't know, assume the worst.
-          *) ac_cv_func_malloc_0_nonnull=no ;;
-        esac
 
-else
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc." >&5
+printf %s "checking whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.... " >&6; }
+if test ${gl_cv_header_limits_width+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-            # include <stdlib.h>
-            #else
-            char *malloc ();
+#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+             #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
             #endif
+            #include <limits.h>
+            long long llm = LLONG_MAX;
+            int wb = WORD_BIT;
+            int ullw = ULLONG_WIDTH;
 
 int
-main ()
+main (void)
 {
-char *p = malloc (0);
-            int result = !p;
-            free (p);
-            return result;
+
   ;
   return 0;
 }
-
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_malloc_0_nonnull=yes
-else
-  ac_cv_func_malloc_0_nonnull=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_limits_width=yes
+else $as_nop
+  gl_cv_header_limits_width=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_limits_width" >&5
+printf "%s\n" "$gl_cv_header_limits_width" >&6; }
+  if test "$gl_cv_header_limits_width" = yes; then
+    LIMITS_H=
+  else
+    LIMITS_H=limits.h
+  fi
 
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
-$as_echo "$ac_cv_func_malloc_0_nonnull" >&6; }
-  if test $ac_cv_func_malloc_0_nonnull = yes; then :
-  gl_cv_func_malloc_0_nonnull=1
+   if test -n "$LIMITS_H"; then
+  GL_GENERATE_LIMITS_H_TRUE=
+  GL_GENERATE_LIMITS_H_FALSE='#'
 else
-  gl_cv_func_malloc_0_nonnull=0
+  GL_GENERATE_LIMITS_H_TRUE='#'
+  GL_GENERATE_LIMITS_H_FALSE=
 fi
 
 
-cat >>confdefs.h <<_ACEOF
-#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull
-_ACEOF
-
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
+printf %s "checking for wint_t... " >&6; }
+if test ${gt_cv_c_wint_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <wchar.h>
+            wint_t foo = (wchar_t)'\0';
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gt_cv_c_wint_t=yes
+else $as_nop
+  gt_cv_c_wint_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wint_t" >&5
+printf "%s\n" "$gt_cv_c_wint_t" >&6; }
+  if test $gt_cv_c_wint_t = yes; then
 
+printf "%s\n" "#define HAVE_WINT_T 1" >>confdefs.h
 
 
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
-$as_echo_n "checking for mbstate_t... " >&6; }
-if ${ac_cv_type_mbstate_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wint_t is large enough" >&5
+printf %s "checking whether wint_t is large enough... " >&6; }
+if test ${gl_cv_type_wint_t_large_enough+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* 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>
+              int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
+
 int
-main ()
+main (void)
 {
-mbstate_t x; return sizeof x;
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_type_mbstate_t=yes
-else
-  ac_cv_type_mbstate_t=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_type_wint_t_large_enough=yes
+else $as_nop
+  gl_cv_type_wint_t_large_enough=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
-$as_echo "$ac_cv_type_mbstate_t" >&6; }
-   if test $ac_cv_type_mbstate_t = yes; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_large_enough" >&5
+printf "%s\n" "$gl_cv_type_wint_t_large_enough" >&6; }
+    if test $gl_cv_type_wint_t_large_enough = no; then
+      GNULIBHEADERS_OVERRIDE_WINT_T=1
+    else
+      GNULIBHEADERS_OVERRIDE_WINT_T=0
+    fi
+  else
+    GNULIBHEADERS_OVERRIDE_WINT_T=0
+  fi
 
-$as_echo "#define HAVE_MBSTATE_T 1" >>confdefs.h
 
-   else
 
-$as_echo "#define mbstate_t int" >>confdefs.h
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler produces multi-arch binaries" >&5
+printf %s "checking whether the compiler produces multi-arch binaries... " >&6; }
+if test ${gl_cv_c_multiarch+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_cv_c_multiarch=no
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+            not a universal capable compiler
+           #endif
+           typedef int dummy;
 
-   fi
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
 
+                        arch=
+        prev=
+        for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+          if test -n "$prev"; then
+            case $word in
+              i?86 | x86_64 | ppc | ppc64 | arm | arm64)
+                if test -z "$arch" || test "$arch" = "$word"; then
+                  arch="$word"
+                else
+                  gl_cv_c_multiarch=yes
+                fi
+                ;;
+            esac
+            prev=
+          else
+            if test "x$word" = "x-arch"; then
+              prev=arch
+            fi
+          fi
+        done
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_multiarch" >&5
+printf "%s\n" "$gl_cv_c_multiarch" >&6; }
+  if test $gl_cv_c_multiarch = yes; then
+    APPLE_UNIVERSAL_BUILD=1
+  else
+    APPLE_UNIVERSAL_BUILD=0
+  fi
 
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
-$as_echo_n "checking for a traditional japanese locale... " >&6; }
-if ${gt_cv_locale_ja+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
-     on Cygwin 1.5.x.  */
-  if (MB_CUR_MAX == 1)
-    return 1;
-  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
-  return 0;
-}
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows, 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 Mac OS 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
-              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
-                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
-                  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
-          ;;
-      esac
-    fi
-    rm -fr conftest*
+printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
-$as_echo "$gt_cv_locale_ja" >&6; }
-  LOCALE_JA=$gt_cv_locale_ja
 
+printf "%s\n" "#define HAVE_UNSIGNED_LONG_LONG_INT 1" >>confdefs.h
 
 
 
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
+  else
+    HAVE_WCHAR_H=0
+  fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
-$as_echo_n "checking for a transitional chinese locale... " >&6; }
-if ${gt_cv_locale_zh_CN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <stdlib.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
-  /* Check whether a typical GB18030 multibyte sequence is recognized as a
-     single wide character.  This excludes the GB2312 and GBK encodings.  */
-  if (mblen ("\203\062\332\066", 5) != 4)
-    return 1;
-  return 0;
-}
+  if test $ac_cv_header_inttypes_h = yes; then
+    HAVE_INTTYPES_H=1
+  else
+    HAVE_INTTYPES_H=0
+  fi
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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
-          ;;
-        solaris2.8)
-          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
-          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
-          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
-          gt_cv_locale_zh_CN=none
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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.
-      gt_cv_locale_zh_CN=none
-    fi
-    rm -fr conftest*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
-$as_echo "$gt_cv_locale_zh_CN" >&6; }
-  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
 
+  if test $ac_cv_header_sys_types_h = yes; then
+    HAVE_SYS_TYPES_H=1
+  else
+    HAVE_SYS_TYPES_H=0
+  fi
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
-$as_echo_n "checking for a french Unicode locale... " >&6; }
-if ${gt_cv_locale_fr_utf8+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main () {
-  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
-     imitates locale dependent behaviour by looking at the environment
-     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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
-# if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
-      return 1;
-  }
-# endif
-# ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-# endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
-     two bytes long, with UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 4
-      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
-    return 1;
-#endif
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
-$as_echo "$gt_cv_locale_fr_utf8" >&6; }
-  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
 
 
 
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_stdint_h='<'stdint.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
+printf %s "checking absolute name of <stdint.h>... " >&6; }
+if test ${gl_cv_next_stdint_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+             if test $ac_cv_header_stdint_h = yes; then
 
 
-  GNULIB_FFSL=0;
-  GNULIB_FFSLL=0;
-  GNULIB_MEMCHR=0;
-  GNULIB_MEMMEM=0;
-  GNULIB_MEMPCPY=0;
-  GNULIB_MEMRCHR=0;
-  GNULIB_RAWMEMCHR=0;
-  GNULIB_STPCPY=0;
-  GNULIB_STPNCPY=0;
-  GNULIB_STRCHRNUL=0;
-  GNULIB_STRDUP=0;
-  GNULIB_STRNCAT=0;
-  GNULIB_STRNDUP=0;
-  GNULIB_STRNLEN=0;
-  GNULIB_STRPBRK=0;
-  GNULIB_STRSEP=0;
-  GNULIB_STRSTR=0;
-  GNULIB_STRCASESTR=0;
-  GNULIB_STRTOK_R=0;
-  GNULIB_MBSLEN=0;
-  GNULIB_MBSNLEN=0;
-  GNULIB_MBSCHR=0;
-  GNULIB_MBSRCHR=0;
-  GNULIB_MBSSTR=0;
-  GNULIB_MBSCASECMP=0;
-  GNULIB_MBSNCASECMP=0;
-  GNULIB_MBSPCASECMP=0;
-  GNULIB_MBSCASESTR=0;
-  GNULIB_MBSCSPN=0;
-  GNULIB_MBSPBRK=0;
-  GNULIB_MBSSPN=0;
-  GNULIB_MBSSEP=0;
-  GNULIB_MBSTOK_R=0;
-  GNULIB_STRERROR=0;
-  GNULIB_STRERROR_R=0;
-  GNULIB_STRSIGNAL=0;
-  GNULIB_STRVERSCMP=0;
-  HAVE_MBSLEN=0;
-    HAVE_FFSL=1;
-  HAVE_FFSLL=1;
-  HAVE_MEMCHR=1;
-  HAVE_DECL_MEMMEM=1;
-  HAVE_MEMPCPY=1;
-  HAVE_DECL_MEMRCHR=1;
-  HAVE_RAWMEMCHR=1;
-  HAVE_STPCPY=1;
-  HAVE_STPNCPY=1;
-  HAVE_STRCHRNUL=1;
-  HAVE_DECL_STRDUP=1;
-  HAVE_DECL_STRNDUP=1;
-  HAVE_DECL_STRNLEN=1;
-  HAVE_STRPBRK=1;
-  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;
-  REPLACE_MEMMEM=0;
-  REPLACE_STPNCPY=0;
-  REPLACE_STRDUP=0;
-  REPLACE_STRSTR=0;
-  REPLACE_STRCASESTR=0;
-  REPLACE_STRCHRNUL=0;
-  REPLACE_STRERROR=0;
-  REPLACE_STRERROR_R=0;
-  REPLACE_STRNCAT=0;
-  REPLACE_STRNDUP=0;
-  REPLACE_STRNLEN=0;
-  REPLACE_STRSIGNAL=0;
-  REPLACE_STRTOK_R=0;
-  UNDEFINE_STRTOK_R=0;
 
 
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdint.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'stdint.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
+           gl_header=$gl_cv_absolute_stdint_h
+           gl_cv_next_stdint_h='"'$gl_header'"'
+          else
+               gl_cv_next_stdint_h='<'stdint.h'>'
+             fi
 
 
-  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
-  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
-  # irrelevant for anonymous mappings.
-  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = xyes; then :
-  gl_have_mmap=yes
-else
-  gl_have_mmap=no
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
+printf "%s\n" "$gl_cv_next_stdint_h" >&6; }
+     fi
+     NEXT_STDINT_H=$gl_cv_next_stdint_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='<'stdint.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_stdint_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
 
 
-  # Try to allow MAP_ANONYMOUS.
-  gl_have_mmap_anonymous=no
-  if test $gl_have_mmap = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
-$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <sys/mman.h>
-#ifdef MAP_ANONYMOUS
-    I cannot identify this map
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
-  gl_have_mmap_anonymous=yes
-fi
-rm -f conftest*
+  if test $ac_cv_header_stdint_h = yes; then
+    HAVE_STDINT_H=1
+  else
+    HAVE_STDINT_H=0
+  fi
 
-    if test $gl_have_mmap_anonymous != yes; then
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+    if test $ac_cv_header_stdint_h = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
+printf %s "checking whether stdint.h conforms to C99... " >&6; }
+if test ${gl_cv_header_working_stdint_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_cv_header_working_stdint_h=no
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <sys/mman.h>
-#ifdef MAP_ANON
-    I cannot identify this map
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+#include <stdint.h>
+/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
+#if !(defined WCHAR_MIN && defined WCHAR_MAX)
+#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
+#endif
 
-$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
-         gl_have_mmap_anonymous=yes
-fi
-rm -f conftest*
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <wchar.h>
+  #endif
 
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
-$as_echo "$gl_have_mmap_anonymous" >&6; }
-    if test $gl_have_mmap_anonymous = yes; then
 
-$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
+#ifdef INT8_MAX
+int8_t a1 = INT8_MAX;
+int8_t a1min = INT8_MIN;
+#endif
+#ifdef INT16_MAX
+int16_t a2 = INT16_MAX;
+int16_t a2min = INT16_MIN;
+#endif
+#ifdef INT32_MAX
+int32_t a3 = INT32_MAX;
+int32_t a3min = INT32_MIN;
+#endif
+#ifdef INT64_MAX
+int64_t a4 = INT64_MAX;
+int64_t a4min = INT64_MIN;
+#endif
+#ifdef UINT8_MAX
+uint8_t b1 = UINT8_MAX;
+#else
+typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
+#endif
+#ifdef UINT16_MAX
+uint16_t b2 = UINT16_MAX;
+#endif
+#ifdef UINT32_MAX
+uint32_t b3 = UINT32_MAX;
+#endif
+#ifdef UINT64_MAX
+uint64_t b4 = UINT64_MAX;
+#endif
+int_least8_t c1 = INT8_C (0x7f);
+int_least8_t c1max = INT_LEAST8_MAX;
+int_least8_t c1min = INT_LEAST8_MIN;
+int_least16_t c2 = INT16_C (0x7fff);
+int_least16_t c2max = INT_LEAST16_MAX;
+int_least16_t c2min = INT_LEAST16_MIN;
+int_least32_t c3 = INT32_C (0x7fffffff);
+int_least32_t c3max = INT_LEAST32_MAX;
+int_least32_t c3min = INT_LEAST32_MIN;
+int_least64_t c4 = INT64_C (0x7fffffffffffffff);
+int_least64_t c4max = INT_LEAST64_MAX;
+int_least64_t c4min = INT_LEAST64_MIN;
+uint_least8_t d1 = UINT8_C (0xff);
+uint_least8_t d1max = UINT_LEAST8_MAX;
+uint_least16_t d2 = UINT16_C (0xffff);
+uint_least16_t d2max = UINT_LEAST16_MAX;
+uint_least32_t d3 = UINT32_C (0xffffffff);
+uint_least32_t d3max = UINT_LEAST32_MAX;
+uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
+uint_least64_t d4max = UINT_LEAST64_MAX;
+int_fast8_t e1 = INT_FAST8_MAX;
+int_fast8_t e1min = INT_FAST8_MIN;
+int_fast16_t e2 = INT_FAST16_MAX;
+int_fast16_t e2min = INT_FAST16_MIN;
+int_fast32_t e3 = INT_FAST32_MAX;
+int_fast32_t e3min = INT_FAST32_MIN;
+int_fast64_t e4 = INT_FAST64_MAX;
+int_fast64_t e4min = INT_FAST64_MIN;
+uint_fast8_t f1 = UINT_FAST8_MAX;
+uint_fast16_t f2 = UINT_FAST16_MAX;
+uint_fast32_t f3 = UINT_FAST32_MAX;
+uint_fast64_t f4 = UINT_FAST64_MAX;
+#ifdef INTPTR_MAX
+intptr_t g = INTPTR_MAX;
+intptr_t gmin = INTPTR_MIN;
+#endif
+#ifdef UINTPTR_MAX
+uintptr_t h = UINTPTR_MAX;
+#endif
+intmax_t i = INTMAX_MAX;
+uintmax_t j = UINTMAX_MAX;
 
-    fi
-  fi
+/* Check that SIZE_MAX has the correct type, if possible.  */
+#if 201112 <= __STDC_VERSION__
+int k = _Generic (SIZE_MAX, size_t: 0);
+#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
+       || (0x5110 <= __SUNPRO_C && !__STDC__))
+extern size_t k;
+extern __typeof__ (SIZE_MAX) k;
+#endif
 
+#include <limits.h> /* for CHAR_BIT */
+#define TYPE_MINIMUM(t) \
+  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
+#define TYPE_MAXIMUM(t) \
+  ((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)
+      && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
+      ? 1 : -1;
+  /* Detect bug in FreeBSD 6.0/ia64 and FreeBSD 13.0/arm64.  */
+  int check_SIG_ATOMIC:
+      SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
+      && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
+      ? 1 : -1;
+  int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
+  int check_WCHAR:
+      WCHAR_MIN == TYPE_MINIMUM (wchar_t)
+      && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
+      ? 1 : -1;
+  /* Detect bug in mingw.  */
+  int check_WINT:
+      WINT_MIN == TYPE_MINIMUM (wint_t)
+      && WINT_MAX == TYPE_MAXIMUM (wint_t)
+      ? 1 : -1;
 
+  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
+  int check_UINT8_C:
+        (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
+  int check_UINT16_C:
+        (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
 
+  /* Detect bugs in OpenBSD 3.9 stdint.h.  */
+#ifdef UINT8_MAX
+  int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
+#endif
+#ifdef UINT16_MAX
+  int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
+#endif
+#ifdef UINT32_MAX
+  int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
+#endif
+#ifdef UINT64_MAX
+  int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
+#endif
+  int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
+  int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
+  int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
+  int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
+  int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
+  int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
+  int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
+  int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
+  int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
+  int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
+  int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
+};
 
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+                                                    if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                         # Guess yes on native Windows.
+                 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
+                         # In general, assume it works.
+                 *)      gl_cv_header_working_stdint_h="guessing yes" ;;
+               esac
 
-  if test $HAVE_MEMCHR = 1; then
-    # Detect platform-specific bugs in some versions of glibc:
-    # memchr should not dereference anything with length 0
-    #   http://bugzilla.redhat.com/499689
-    # memchr should not dereference overestimated length after a match
-    #   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
-    #   http://sourceware.org/bugzilla/show_bug.cgi?id=10162
-    # Assume that memchr works on platforms that lack mprotect.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
-$as_echo_n "checking whether memchr works... " >&6; }
-if ${gl_cv_func_memchr_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-         gl_cv_func_memchr_works="guessing no"
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
+
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#define __STDC_CONSTANT_MACROS 1
+#define __STDC_LIMIT_MACROS 1
+#include <stdint.h>
+
+
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <wchar.h>
+  #endif
+
+
+#include <stdio.h>
 #include <string.h>
-#if HAVE_SYS_MMAN_H
-# include <fcntl.h>
-# include <unistd.h>
-# include <sys/types.h>
-# include <sys/mman.h>
-# ifndef MAP_FILE
-#  define MAP_FILE 0
-# endif
+#define MVAL(macro) MVAL1(macro)
+#define MVAL1(expression) #expression
+static const char *macro_values[] =
+  {
+#ifdef INT8_MAX
+    MVAL (INT8_MAX),
+#endif
+#ifdef INT16_MAX
+    MVAL (INT16_MAX),
+#endif
+#ifdef INT32_MAX
+    MVAL (INT32_MAX),
+#endif
+#ifdef INT64_MAX
+    MVAL (INT64_MAX),
+#endif
+#ifdef UINT8_MAX
+    MVAL (UINT8_MAX),
+#endif
+#ifdef UINT16_MAX
+    MVAL (UINT16_MAX),
+#endif
+#ifdef UINT32_MAX
+    MVAL (UINT32_MAX),
 #endif
+#ifdef UINT64_MAX
+    MVAL (UINT64_MAX),
+#endif
+    NULL
+  };
 
 int
-main ()
+main (void)
 {
 
-  int result = 0;
-  char *fence = NULL;
-#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
-# if HAVE_MAP_ANONYMOUS
-  const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
-  const int fd = -1;
-# else /* !HAVE_MAP_ANONYMOUS */
-  const int flags = MAP_FILE | MAP_PRIVATE;
-  int fd = open ("/dev/zero", O_RDONLY, 0666);
-  if (fd >= 0)
-# endif
-    {
-      int pagesize = getpagesize ();
-      char *two_pages =
-        (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
-                       flags, fd, 0);
-      if (two_pages != (char *)(-1)
-          && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
-        fence = two_pages + pagesize;
-    }
-#endif
-  if (fence)
+  const char **mv;
+  for (mv = macro_values; *mv != NULL; mv++)
     {
-      if (memchr (fence, 0, 0))
-        result |= 1;
-      strcpy (fence - 9, "12345678");
-      if (memchr (fence - 9, 0, 79) != fence - 1)
-        result |= 2;
-      if (memchr (fence - 1, 0, 3) != fence - 1)
-        result |= 4;
+      const char *value = *mv;
+      /* Test whether it looks like a cast expression.  */
+      if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
+          || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
+          || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
+          || strncmp (value, "((int)"/*)*/, 6) == 0
+          || strncmp (value, "((signed short)"/*)*/, 15) == 0
+          || strncmp (value, "((signed char)"/*)*/, 14) == 0)
+        return mv - macro_values + 1;
     }
-  return result;
+  return 0;
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_memchr_works=yes
-else
-  gl_cv_func_memchr_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_header_working_stdint_h=yes
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
-$as_echo "$gl_cv_func_memchr_works" >&6; }
-    if test "$gl_cv_func_memchr_works" != yes; then
-      REPLACE_MEMCHR=1
-    fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
+printf "%s\n" "$gl_cv_header_working_stdint_h" >&6; }
   fi
 
+  HAVE_C99_STDINT_H=0
+  HAVE_SYS_BITYPES_H=0
+  HAVE_SYS_INTTYPES_H=0
+  STDINT_H=stdint.h
+  case "$gl_cv_header_working_stdint_h" in
+    *yes)
+      HAVE_C99_STDINT_H=1
+                        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h works without ISO C predefines" >&5
+printf %s "checking whether stdint.h works without ISO C predefines... " >&6; }
+if test ${gl_cv_header_stdint_without_STDC_macros+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_cv_header_stdint_without_STDC_macros=no
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
 
+#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
+#include <stdint.h>
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5
-$as_echo_n "checking whether <limits.h> defines MIN and MAX... " >&6; }
-if ${gl_cv_minmax_in_limits_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
-            int x = MIN (42, 17);
-int
-main ()
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <wchar.h>
+  #endif
+
+
+intmax_t im = INTMAX_MAX;
+int32_t i32 = INT32_C (0x7fffffff);
+
+int
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_minmax_in_limits_h=yes
-else
-  gl_cv_minmax_in_limits_h=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_stdint_without_STDC_macros=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5
-$as_echo "$gl_cv_minmax_in_limits_h" >&6; }
-  if test $gl_cv_minmax_in_limits_h = yes; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_without_STDC_macros" >&5
+printf "%s\n" "$gl_cv_header_stdint_without_STDC_macros" >&6; }
 
-$as_echo "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h
+      if test $gl_cv_header_stdint_without_STDC_macros = no; then
 
-  fi
+printf "%s\n" "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
 
 
+printf "%s\n" "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
 
+      fi
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
+printf %s "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
+if test ${gl_cv_header_stdint_width+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_cv_header_stdint_width=no
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+              /* Work if build is not clean.  */
+              #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
+              #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+               #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+              #endif
+              #include <stdint.h>
 
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <wchar.h>
+  #endif
+
+              int iw = UINTMAX_WIDTH;
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5
-$as_echo_n "checking whether <sys/param.h> defines MIN and MAX... " >&6; }
-if ${gl_cv_minmax_in_sys_param_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/param.h>
-            int x = MIN (42, 17);
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_minmax_in_sys_param_h=yes
-else
-  gl_cv_minmax_in_sys_param_h=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_stdint_width=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5
-$as_echo "$gl_cv_minmax_in_sys_param_h" >&6; }
-  if test $gl_cv_minmax_in_sys_param_h = yes; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
+printf "%s\n" "$gl_cv_header_stdint_width" >&6; }
+      if test "$gl_cv_header_stdint_width" = yes; then
+        STDINT_H=
+      fi
+      ;;
+    *)
+                  ac_fn_c_check_header_compile "$LINENO" "sys/inttypes.h" "ac_cv_header_sys_inttypes_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_inttypes_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_SYS_INTTYPES_H 1" >>confdefs.h
 
-$as_echo "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h
+fi
+ac_fn_c_check_header_compile "$LINENO" "sys/bitypes.h" "ac_cv_header_sys_bitypes_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_bitypes_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_SYS_BITYPES_H 1" >>confdefs.h
 
-  fi
+fi
+
+      if test $ac_cv_header_sys_inttypes_h = yes; then
+        HAVE_SYS_INTTYPES_H=1
+      fi
+      if test $ac_cv_header_sys_bitypes_h = yes; then
+        HAVE_SYS_BITYPES_H=1
+      fi
+
+
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
 
+  for gltype in ptrdiff_t size_t ; do
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
+printf %s "checking for bit size of $gltype... " >&6; }
+if eval test \${gl_cv_bitsizeof_${gltype}+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <wchar.h>
+  #endif
 
+#include <limits.h>"
+then :
 
+else $as_nop
+  result=unknown
+fi
 
+       eval gl_cv_bitsizeof_${gltype}=\$result
 
+fi
+eval ac_res=\$gl_cv_bitsizeof_${gltype}
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+    eval result=\$gl_cv_bitsizeof_${gltype}
+    if test $result = unknown; then
+                                                result=0
+    fi
+    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    printf "%s\n" "#define BITSIZEOF_${GLTYPE} $result" >>confdefs.h
 
+    eval BITSIZEOF_${GLTYPE}=\$result
+  done
 
 
+  fi
 
-    gl_cv_c_multiarch=no
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-         not a universal capable compiler
-        #endif
-        typedef int dummy;
 
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+  for gltype in sig_atomic_t wchar_t wint_t ; do
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
+printf %s "checking for bit size of $gltype... " >&6; }
+if eval test \${gl_cv_bitsizeof_${gltype}+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <wchar.h>
+  #endif
 
-               arch=
-     prev=
-     for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
-       if test -n "$prev"; then
-         case $word in
-           i?86 | x86_64 | ppc | ppc64)
-             if test -z "$arch" || test "$arch" = "$word"; then
-               arch="$word"
-             else
-               gl_cv_c_multiarch=yes
-             fi
-             ;;
-         esac
-         prev=
-       else
-         if test "x$word" = "x-arch"; then
-           prev=arch
-         fi
-       fi
-     done
+#include <limits.h>"
+then :
 
+else $as_nop
+  result=unknown
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  if test $gl_cv_c_multiarch = yes; then
-    APPLE_UNIVERSAL_BUILD=1
-  else
-    APPLE_UNIVERSAL_BUILD=0
-  fi
 
+       eval gl_cv_bitsizeof_${gltype}=\$result
 
+fi
+eval ac_res=\$gl_cv_bitsizeof_${gltype}
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+    eval result=\$gl_cv_bitsizeof_${gltype}
+    if test $result = unknown; then
+                                                result=0
+    fi
+    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    printf "%s\n" "#define BITSIZEOF_${GLTYPE} $result" >>confdefs.h
 
+    eval BITSIZEOF_${GLTYPE}=\$result
+  done
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
-$as_echo_n "checking for promoted mode_t type... " >&6; }
-if ${gl_cv_promoted_mode_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  for gltype in sig_atomic_t wchar_t wint_t ; do
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
+printf %s "checking whether $gltype is signed... " >&6; }
+if eval test \${gl_cv_type_${gltype}_signed+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
+
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <wchar.h>
+  #endif
+
+            int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
 int
-main ()
+main (void)
 {
-typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_promoted_mode_t='int'
-else
-  gl_cv_promoted_mode_t='mode_t'
+if ac_fn_c_try_compile "$LINENO"
+then :
+  result=yes
+else $as_nop
+  result=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+       eval gl_cv_type_${gltype}_signed=\$result
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
-$as_echo "$gl_cv_promoted_mode_t" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define PROMOTED_MODE_T $gl_cv_promoted_mode_t
-_ACEOF
-
+eval ac_res=\$gl_cv_type_${gltype}_signed
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+    eval result=\$gl_cv_type_${gltype}_signed
+    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    if test "$result" = yes; then
+      printf "%s\n" "#define HAVE_SIGNED_${GLTYPE} 1" >>confdefs.h
 
+      eval HAVE_SIGNED_${GLTYPE}=1
+    else
+      eval HAVE_SIGNED_${GLTYPE}=0
+    fi
+  done
 
 
+  gl_cv_type_ptrdiff_t_signed=yes
+  gl_cv_type_size_t_signed=no
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
-  GNULIB_POSIX_SPAWN=0;
-  GNULIB_POSIX_SPAWNP=0;
-  GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=0;
-  GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0;
-  GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0;
-  GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0;
-  GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=0;
-  GNULIB_POSIX_SPAWNATTR_INIT=0;
-  GNULIB_POSIX_SPAWNATTR_GETFLAGS=0;
-  GNULIB_POSIX_SPAWNATTR_SETFLAGS=0;
-  GNULIB_POSIX_SPAWNATTR_GETPGROUP=0;
-  GNULIB_POSIX_SPAWNATTR_SETPGROUP=0;
-  GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM=0;
-  GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM=0;
-  GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY=0;
-  GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY=0;
-  GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT=0;
-  GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT=0;
-  GNULIB_POSIX_SPAWNATTR_GETSIGMASK=0;
-  GNULIB_POSIX_SPAWNATTR_SETSIGMASK=0;
-  GNULIB_POSIX_SPAWNATTR_DESTROY=0;
-    HAVE_POSIX_SPAWN=1;
-  HAVE_POSIX_SPAWNATTR_T=1;
-  HAVE_POSIX_SPAWN_FILE_ACTIONS_T=1;
 
-  REPLACE_POSIX_SPAWN=0;
-  REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0;
+  for gltype in ptrdiff_t size_t ; do
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
+printf %s "checking for $gltype integer literal suffix... " >&6; }
+if eval test \${gl_cv_type_${gltype}_suffix+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  eval gl_cv_type_${gltype}_suffix=no
+       eval result=\$gl_cv_type_${gltype}_signed
+       if test "$result" = yes; then
+         glsufu=
+       else
+         glsufu=u
+       fi
+       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+         case $glsuf in
+           '')  gltype1='int';;
+           l)   gltype1='long int';;
+           ll)  gltype1='long long int';;
+           i64) gltype1='__int64';;
+           u)   gltype1='unsigned int';;
+           ul)  gltype1='unsigned long int';;
+           ull) gltype1='unsigned long long int';;
+           ui64)gltype1='unsigned __int64';;
+         esac
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0;
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <wchar.h>
+  #endif
 
-  REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0;
+              extern $gltype foo;
+              extern $gltype1 foo;
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  eval gl_cv_type_${gltype}_suffix=\$glsuf
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         eval result=\$gl_cv_type_${gltype}_suffix
+         test "$result" != no && break
+       done
+fi
+eval ac_res=\$gl_cv_type_${gltype}_suffix
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    eval result=\$gl_cv_type_${gltype}_suffix
+    test "$result" = no && result=
+    eval ${GLTYPE}_SUFFIX=\$result
+    printf "%s\n" "#define ${GLTYPE}_SUFFIX $result" >>confdefs.h
 
+  done
 
 
+  fi
 
-  LIB_POSIX_SPAWN=
 
-  gl_saved_libs=$LIBS
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing posix_spawn" >&5
-$as_echo_n "checking for library containing posix_spawn... " >&6; }
-if ${ac_cv_search_posix_spawn+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_func_search_save_LIBS=$LIBS
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  for gltype in sig_atomic_t wchar_t wint_t ; do
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
+printf %s "checking for $gltype integer literal suffix... " >&6; }
+if eval test \${gl_cv_type_${gltype}_suffix+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  eval gl_cv_type_${gltype}_suffix=no
+       eval result=\$gl_cv_type_${gltype}_signed
+       if test "$result" = yes; then
+         glsufu=
+       else
+         glsufu=u
+       fi
+       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
+         case $glsuf in
+           '')  gltype1='int';;
+           l)   gltype1='long int';;
+           ll)  gltype1='long long int';;
+           i64) gltype1='__int64';;
+           u)   gltype1='unsigned int';;
+           ul)  gltype1='unsigned long int';;
+           ull) gltype1='unsigned long long int';;
+           ui64)gltype1='unsigned __int64';;
+         esac
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-/* Override any GCC internal prototype to avoid an error.
-   Use char because int might match the return type of a GCC
-   builtin and then its argument prototype would still apply.  */
-#ifdef __cplusplus
-extern "C"
-#endif
-char posix_spawn ();
+  #include <stddef.h>
+  #include <signal.h>
+  #if HAVE_WCHAR_H
+  # include <wchar.h>
+  #endif
+
+              extern $gltype foo;
+              extern $gltype1 foo;
 int
-main ()
+main (void)
 {
-return posix_spawn ();
+
   ;
   return 0;
 }
 _ACEOF
-for ac_lib in '' rt; do
-  if test -z "$ac_lib"; then
-    ac_res="none required"
-  else
-    ac_res=-l$ac_lib
-    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
-  fi
-  if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_search_posix_spawn=$ac_res
+if ac_fn_c_try_compile "$LINENO"
+then :
+  eval gl_cv_type_${gltype}_suffix=\$glsuf
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext
-  if ${ac_cv_search_posix_spawn+:} false; then :
-  break
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         eval result=\$gl_cv_type_${gltype}_suffix
+         test "$result" != no && break
+       done
 fi
-done
-if ${ac_cv_search_posix_spawn+:} false; then :
+eval ac_res=\$gl_cv_type_${gltype}_suffix
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
+    eval result=\$gl_cv_type_${gltype}_suffix
+    test "$result" = no && result=
+    eval ${GLTYPE}_SUFFIX=\$result
+    printf "%s\n" "#define ${GLTYPE}_SUFFIX $result" >>confdefs.h
+
+  done
+
+
+
+          if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
+    BITSIZEOF_WINT_T=32
+  fi
+
+      ;;
+  esac
 
+
+
+  LIMITS_H='limits.h'
+   if test -n "$LIMITS_H"; then
+  GL_GENERATE_LIMITS_H_TRUE=
+  GL_GENERATE_LIMITS_H_FALSE='#'
 else
-  ac_cv_search_posix_spawn=no
-fi
-rm conftest.$ac_ext
-LIBS=$ac_func_search_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_posix_spawn" >&5
-$as_echo "$ac_cv_search_posix_spawn" >&6; }
-ac_res=$ac_cv_search_posix_spawn
-if test "$ac_res" != no; then :
-  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
-  test "$ac_cv_search_posix_spawn" = "none required" ||
-                    LIB_POSIX_SPAWN=$ac_cv_search_posix_spawn
+  GL_GENERATE_LIMITS_H_TRUE='#'
+  GL_GENERATE_LIMITS_H_FALSE=
 fi
 
-    for ac_func in posix_spawn
-do :
-  ac_fn_c_check_func "$LINENO" "posix_spawn" "ac_cv_func_posix_spawn"
-if test "x$ac_cv_func_posix_spawn" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_POSIX_SPAWN 1
-_ACEOF
 
-fi
-done
 
-  LIBS=$gl_saved_libs
 
-  if test $ac_cv_func_posix_spawn != yes; then
-    HAVE_POSIX_SPAWN=0
-  fi
 
 
 
+   if test -n "$STDINT_H"; then
+  GL_GENERATE_STDINT_H_TRUE=
+  GL_GENERATE_STDINT_H_FALSE='#'
+else
+  GL_GENERATE_STDINT_H_TRUE='#'
+  GL_GENERATE_STDINT_H_FALSE=
+fi
 
-                                      if test $ac_cv_func_posix_spawn = yes; then
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn works" >&5
-$as_echo_n "checking whether posix_spawn works... " >&6; }
-if ${gl_cv_func_posix_spawn_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test $cross_compiling = no; then
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+    HAVE_DECL_IMAXABS=1;
+  HAVE_DECL_IMAXDIV=1;
+  HAVE_DECL_STRTOIMAX=1;
+  HAVE_DECL_STRTOUMAX=1;
+  HAVE_IMAXDIV_T=1;
+  REPLACE_STRTOIMAX=0;
+  REPLACE_STRTOUMAX=0;
+  INT32_MAX_LT_INTMAX_MAX=1;
+  INT64_MAX_EQ_LONG_MAX='defined _LP64';
+  PRIPTR_PREFIX=__PRIPTR_PREFIX;
+  UINT32_MAX_LT_UINTMAX_MAX=1;
+  UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
 
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <spawn.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
 
-extern char **environ;
 
-#ifndef STDIN_FILENO
-# define STDIN_FILENO 0
-#endif
-#ifndef STDOUT_FILENO
-# define STDOUT_FILENO 1
-#endif
-#ifndef STDERR_FILENO
-# define STDERR_FILENO 2
-#endif
 
-#ifndef WTERMSIG
-# define WTERMSIG(x) ((x) & 0x7f)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(x) (WTERMSIG (x) == 0)
-#endif
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
-#endif
 
-#define CHILD_PROGRAM_FILENAME "/non/exist/ent"
 
-static int
-fd_safer (int fd)
-{
-  if (0 <= fd && fd <= 2)
-    {
-      int f = fd_safer (dup (fd));
-      int e = errno;
-      close (fd);
-      errno = e;
-      fd = f;
-    }
 
-  return fd;
-}
 
-int
-main ()
-{
-  char *argv[2] = { CHILD_PROGRAM_FILENAME, NULL };
-  int ofd[2];
-  sigset_t blocked_signals;
-  sigset_t fatal_signal_set;
-  posix_spawn_file_actions_t actions;
-  bool actions_allocated;
-  posix_spawnattr_t attrs;
-  bool attrs_allocated;
-  int err;
-  pid_t child;
-  int status;
-  int exitstatus;
 
-  setvbuf (stdout, NULL, _IOFBF, 0);
-  puts ("This should be seen only once.");
-  if (pipe (ofd) < 0 || (ofd[1] = fd_safer (ofd[1])) < 0)
-    {
-      perror ("cannot create pipe");
-      exit (1);
-    }
-  sigprocmask (SIG_SETMASK, NULL, &blocked_signals);
-  sigemptyset (&fatal_signal_set);
-  sigaddset (&fatal_signal_set, SIGINT);
-  sigaddset (&fatal_signal_set, SIGTERM);
-  sigaddset (&fatal_signal_set, SIGHUP);
-  sigaddset (&fatal_signal_set, SIGPIPE);
-  sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL);
-  actions_allocated = false;
-  attrs_allocated = false;
-  if ((err = posix_spawn_file_actions_init (&actions)) != 0
-      || (actions_allocated = true,
-          (err = posix_spawn_file_actions_adddup2 (&actions, ofd[0], STDIN_FILENO)) != 0
-          || (err = posix_spawn_file_actions_addclose (&actions, ofd[0])) != 0
-          || (err = posix_spawn_file_actions_addclose (&actions, ofd[1])) != 0
-          || (err = posix_spawnattr_init (&attrs)) != 0
-          || (attrs_allocated = true,
-              (err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0
-              || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0)
-          || (err = posix_spawnp (&child, CHILD_PROGRAM_FILENAME, &actions, &attrs, argv, environ)) != 0))
-    {
-      if (actions_allocated)
-        posix_spawn_file_actions_destroy (&actions);
-      if (attrs_allocated)
-        posix_spawnattr_destroy (&attrs);
-      sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
-      if (err == ENOENT)
-        return 0;
-      else
-        {
-          errno = err;
-          perror ("subprocess failed");
-          exit (1);
-        }
-    }
-  posix_spawn_file_actions_destroy (&actions);
-  posix_spawnattr_destroy (&attrs);
-  sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
-  close (ofd[0]);
-  close (ofd[1]);
-  status = 0;
-  while (waitpid (child, &status, 0) != child)
-    ;
-  if (!WIFEXITED (status))
-    {
-      fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
-      exit (1);
-    }
-  exitstatus = WEXITSTATUS (status);
-  if (exitstatus != 127)
-    {
-      fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
-      exit (1);
-    }
-  return 0;
-}
 
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  if test -s conftest$ac_exeext \
-             && ./conftest$ac_exeext > conftest.out \
-             && echo 'This should be seen only once.' > conftest.ok \
-             && cmp conftest.out conftest.ok > /dev/null; then
-            gl_cv_func_posix_spawn_works=yes
-          else
-            gl_cv_func_posix_spawn_works=no
-          fi
-else
-  gl_cv_func_posix_spawn_works=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-       if test $gl_cv_func_posix_spawn_works = yes; then
-         if test "$cross_compiling" = yes; then :
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run test program while cross compiling
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-/* Test whether posix_spawn_file_actions_addopen supports filename arguments
-   that contain special characters such as '*'.  */
 
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <spawn.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
 
-extern char **environ;
 
-#ifndef STDIN_FILENO
-# define STDIN_FILENO 0
-#endif
-#ifndef STDOUT_FILENO
-# define STDOUT_FILENO 1
-#endif
-#ifndef STDERR_FILENO
-# define STDERR_FILENO 2
-#endif
 
-#ifndef WTERMSIG
-# define WTERMSIG(x) ((x) & 0x7f)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(x) (WTERMSIG (x) == 0)
-#endif
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
-#endif
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_inttypes_h='<'inttypes.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
+printf %s "checking absolute name of <inttypes.h>... " >&6; }
+if test ${gl_cv_next_inttypes_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-#define CHILD_PROGRAM_FILENAME "conftest"
-#define DATA_FILENAME "conftest%=*#?"
+             if test $ac_cv_header_inttypes_h = yes; then
 
-static int
-parent_main (void)
-{
-  FILE *fp;
-  char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
-  posix_spawn_file_actions_t actions;
-  bool actions_allocated;
-  int err;
-  pid_t child;
-  int status;
-  int exitstatus;
 
-  /* Create a data file with specific contents.  */
-  fp = fopen (DATA_FILENAME, "wb");
-  if (fp == NULL)
-    {
-      perror ("cannot create data file");
-      return 1;
-    }
-  fwrite ("Halle Potta", 1, 11, fp);
-  if (fflush (fp) || fclose (fp))
-    {
-      perror ("cannot prepare data file");
-      return 2;
-    }
-
-  /* Avoid reading from our stdin, as it could block.  */
-  freopen ("/dev/null", "rb", stdin);
-
-  /* Test whether posix_spawn_file_actions_addopen with this file name
-     actually works, but spawning a child that reads from this file.  */
-  actions_allocated = false;
-  if ((err = posix_spawn_file_actions_init (&actions)) != 0
-      || (actions_allocated = true,
-          (err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, DATA_FILENAME, O_RDONLY, 0600)) != 0
-          || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0))
-    {
-      if (actions_allocated)
-        posix_spawn_file_actions_destroy (&actions);
-      errno = err;
-      perror ("subprocess failed");
-      return 3;
-    }
-  posix_spawn_file_actions_destroy (&actions);
-  status = 0;
-  while (waitpid (child, &status, 0) != child)
-    ;
-  if (!WIFEXITED (status))
-    {
-      fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
-      return 4;
-    }
-  exitstatus = WEXITSTATUS (status);
-  if (exitstatus != 0)
-    {
-      fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
-      return 5;
-    }
-  return 0;
-}
-
-static int
-child_main (void)
-{
-  char buf[1024];
-
-  /* See if reading from STDIN_FILENO yields the expected contents.  */
-  if (fread (buf, 1, sizeof (buf), stdin) == 11
-      && memcmp (buf, "Halle Potta", 11) == 0)
-    return 0;
-  else
-    return 8;
-}
-
-static void
-cleanup_then_die (int sig)
-{
-  /* Clean up data file.  */
-  unlink (DATA_FILENAME);
 
-  /* Re-raise the signal and die from it.  */
-  signal (sig, SIG_DFL);
-  raise (sig);
-}
 
-int
-main (int argc, char *argv[])
-{
-  int exitstatus;
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <inttypes.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
-  if (!(argc > 1 && strcmp (argv[1], "-child") == 0))
-    {
-      /* This is the parent process.  */
-      signal (SIGINT, cleanup_then_die);
-      signal (SIGTERM, cleanup_then_die);
-      #ifdef SIGHUP
-      signal (SIGHUP, cleanup_then_die);
-      #endif
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'inttypes.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
-      exitstatus = parent_main ();
-    }
-  else
-    {
-      /* This is the child process.  */
+        gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
-      exitstatus = child_main ();
-    }
-  unlink (DATA_FILENAME);
-  return exitstatus;
-}
+           gl_header=$gl_cv_absolute_inttypes_h
+           gl_cv_next_inttypes_h='"'$gl_header'"'
+          else
+               gl_cv_next_inttypes_h='<'inttypes.h'>'
+             fi
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
 
-else
-  gl_cv_func_posix_spawn_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
+printf "%s\n" "$gl_cv_next_inttypes_h" >&6; }
+     fi
+     NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
 
-       fi
+     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='<'inttypes.h'>'
      else
-       case "$host_os" in
-         aix*) gl_cv_func_posix_spawn_works="guessing no";;
-         *)    gl_cv_func_posix_spawn_works="guessing yes";;
-       esac
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_inttypes_h
      fi
+     NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_works" >&5
-$as_echo "$gl_cv_func_posix_spawn_works" >&6; }
 
-    case "$gl_cv_func_posix_spawn_works" in
-      *yes)
 
-$as_echo "#define HAVE_WORKING_POSIX_SPAWN 1" >>confdefs.h
 
-                                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawnattr_setschedpolicy is supported" >&5
-$as_echo_n "checking whether posix_spawnattr_setschedpolicy is supported... " >&6; }
-if ${gl_cv_func_spawnattr_setschedpolicy+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <spawn.h>
-#if POSIX_SPAWN_SETSCHEDULER
- POSIX scheduling supported
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "POSIX scheduling supported" >/dev/null 2>&1; then :
-  gl_cv_func_spawnattr_setschedpolicy=yes
-else
-  gl_cv_func_spawnattr_setschedpolicy=no
-fi
-rm -f conftest*
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_spawnattr_setschedpolicy" >&5
-$as_echo "$gl_cv_func_spawnattr_setschedpolicy" >&6; }
-                                        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawnattr_setschedparam is supported" >&5
-$as_echo_n "checking whether posix_spawnattr_setschedparam is supported... " >&6; }
-if ${gl_cv_func_spawnattr_setschedparam+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <spawn.h>
-#if POSIX_SPAWN_SETSCHEDPARAM
- POSIX scheduling supported
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "POSIX scheduling supported" >/dev/null 2>&1; then :
-  gl_cv_func_spawnattr_setschedparam=yes
-else
-  gl_cv_func_spawnattr_setschedparam=no
-fi
-rm -f conftest*
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_spawnattr_setschedparam" >&5
-$as_echo "$gl_cv_func_spawnattr_setschedparam" >&6; }
-        ;;
-      *) REPLACE_POSIX_SPAWN=1 ;;
-    esac
-  fi
 
+  GL_M4_GNULIB_IMAXABS=0
 
-  GNULIB_PTHREAD_SIGMASK=0;
-  GNULIB_RAISE=0;
-  GNULIB_SIGNAL_H_SIGPIPE=0;
-  GNULIB_SIGPROCMASK=0;
-  GNULIB_SIGACTION=0;
-    HAVE_POSIX_SIGNALBLOCKING=1;
-  HAVE_PTHREAD_SIGMASK=1;
-  HAVE_RAISE=1;
-  HAVE_SIGSET_T=1;
-  HAVE_SIGINFO_T=1;
-  HAVE_SIGACTION=1;
-  HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
 
-  HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
 
-  HAVE_SIGHANDLER_T=1;
-  REPLACE_PTHREAD_SIGMASK=0;
-  REPLACE_RAISE=0;
+  GL_M4_GNULIB_IMAXDIV=0
 
 
-  ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
-      #include <signal.h>
-      /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.  */
-      #include <sys/types.h>
 
-"
-if test "x$ac_cv_type_sigset_t" = xyes; then :
+  GL_M4_GNULIB_STRTOIMAX=0
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SIGSET_T 1
-_ACEOF
 
-gl_cv_type_sigset_t=yes
-else
-  gl_cv_type_sigset_t=no
-fi
 
-  if test $gl_cv_type_sigset_t != yes; then
-    HAVE_SIGSET_T=0
-  fi
+  GL_M4_GNULIB_STRTOUMAX=0
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGPIPE" >&5
-$as_echo_n "checking for SIGPIPE... " >&6; }
-if ${gl_cv_header_signal_h_SIGPIPE+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
+printf %s "checking where to find the exponent in a 'double'... " >&6; }
+if test ${gl_cv_cc_double_expbit0+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+                                                                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <signal.h>
-#if !defined SIGPIPE
-booboo
+#if defined arm || defined __arm || defined __arm__
+  mixed_endianness
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "booboo" >/dev/null 2>&1; then :
-  gl_cv_header_signal_h_SIGPIPE=no
-else
-  gl_cv_header_signal_h_SIGPIPE=yes
-fi
-rm -f conftest*
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_signal_h_SIGPIPE" >&5
-$as_echo "$gl_cv_header_signal_h_SIGPIPE" >&6; }
-
-
+  $EGREP "mixed_endianness" >/dev/null 2>&1
+then :
+  gl_cv_cc_double_expbit0="unknown"
+else $as_nop
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
-$as_echo_n "checking for inline... " >&6; }
-if ${ac_cv_c_inline+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_inline=no
-for ac_kw in inline __inline__ __inline; do
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                                                         :
+if test ${ac_cv_c_bigendian+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#ifndef __cplusplus
-typedef int foo_t;
-static $ac_kw foo_t static_foo () {return 0; }
-$ac_kw foo_t foo () {return 0; }
-#endif
+#ifndef __APPLE_CC__
+              not a universal capable compiler
+            #endif
+            typedef int dummy;
 
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_inline=$ac_kw
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  test "$ac_cv_c_inline" != no && break
-done
+if ac_fn_c_try_compile "$LINENO"
+then :
 
+       # Check for potential -arch flags.  It is not universal unless
+       # there are at least two -arch flags with different values.
+       ac_arch=
+       ac_prev=
+       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+        if test -n "$ac_prev"; then
+          case $ac_word in
+            i?86 | x86_64 | ppc | ppc64)
+              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+                ac_arch=$ac_word
+              else
+                ac_cv_c_bigendian=universal
+                break
+              fi
+              ;;
+          esac
+          ac_prev=
+        elif test "x$ac_word" = "x-arch"; then
+          ac_prev=arch
+        fi
+       done
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
-$as_echo "$ac_cv_c_inline" >&6; }
-
-case $ac_cv_c_inline in
-  inline | yes) ;;
-  *)
-    case $ac_cv_c_inline in
-      no) ac_val=;;
-      *) ac_val=$ac_cv_c_inline;;
-    esac
-    cat >>confdefs.h <<_ACEOF
-#ifndef __cplusplus
-#define inline $ac_val
-#endif
-_ACEOF
-    ;;
-esac
-
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+            #include <sys/param.h>
 
+int
+main (void)
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+                    && LITTLE_ENDIAN)
+             bogus endian macros
+            #endif
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+               #include <sys/param.h>
 
+int
+main (void)
+{
+#if BYTE_ORDER != BIG_ENDIAN
+                not big endian
+               #endif
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_bigendian=yes
+else $as_nop
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
 
+int
+main (void)
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+             bogus endian macros
+            #endif
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
 
+int
+main (void)
+{
+#ifndef _BIG_ENDIAN
+                not big endian
+               #endif
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_bigendian=yes
+else $as_nop
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes
+then :
+  # Try to guess by grepping values from an object file.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+unsigned short int ascii_mm[] =
+                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+               unsigned short int ascii_ii[] =
+                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+               int use_ascii (int i) {
+                 return ascii_mm[i] + ascii_ii[i];
+               }
+               unsigned short int ebcdic_ii[] =
+                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+               unsigned short int ebcdic_mm[] =
+                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+               int use_ebcdic (int i) {
+                 return ebcdic_mm[i] + ebcdic_ii[i];
+               }
+               extern int foo;
 
+int
+main (void)
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+             ac_cv_c_bigendian=yes
+           fi
+           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+             if test "$ac_cv_c_bigendian" = unknown; then
+               ac_cv_c_bigendian=no
+             else
+               # finding both strings is unlikely to happen, but who knows?
+               ac_cv_c_bigendian=unknown
+             fi
+           fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main (void)
+{
 
+            /* Are we little or big endian?  From Harbison&Steele.  */
+            union
+            {
+              long int l;
+              char c[sizeof (long int)];
+            } u;
+            u.l = 1;
+            return u.c[sizeof (long int) - 1] == 1;
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  ac_cv_c_bigendian=no
+else $as_nop
+  ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+    fi
+fi
+:
+ case $ac_cv_c_bigendian in #(
+   yes)
+     gl_cv_cc_double_expbit0="word 0 bit 20";; #(
+   no)
+     gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
+   universal)
 
+printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
 
+     ;; #(
+   *)
+     gl_cv_cc_double_expbit0="unknown" ;;
+ esac
 
 
+fi
+rm -rf conftest*
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
-$as_echo_n "checking for uid_t in sys/types.h... " >&6; }
-if ${ac_cv_type_uid_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
+
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { double value; unsigned int word[NWORDS]; } memory_double;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (double x)
+{
+  memory_double m;
+  size_t i;
+  /* Clear it first, in case sizeof (double) < sizeof (memory_double).  */
+  memset (&m, 0, sizeof (memory_double));
+  m.value = x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  add_to_ored_words (0.25);
+  add_to_ored_words (0.5);
+  add_to_ored_words (1.0);
+  add_to_ored_words (2.0);
+  add_to_ored_words (4.0);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
+}
 
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "uid_t" >/dev/null 2>&1; then :
-  ac_cv_type_uid_t=yes
-else
-  ac_cv_type_uid_t=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_cc_double_expbit0=`cat conftest.out`
+else $as_nop
+  gl_cv_cc_double_expbit0="unknown"
 fi
-rm -f conftest*
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
-$as_echo "$ac_cv_type_uid_t" >&6; }
-if test $ac_cv_type_uid_t = no; then
 
-$as_echo "#define uid_t int" >>confdefs.h
+      rm -f conftest.out
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
+printf "%s\n" "$gl_cv_cc_double_expbit0" >&6; }
+  case "$gl_cv_cc_double_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
 
+printf "%s\n" "#define DBL_EXPBIT0_WORD $word" >>confdefs.h
 
-$as_echo "#define gid_t int" >>confdefs.h
 
-fi
+printf "%s\n" "#define DBL_EXPBIT0_BIT $bit" >>confdefs.h
 
+      ;;
+  esac
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
+printf %s "checking where to find the exponent in a 'float'... " >&6; }
+if test ${gl_cv_cc_float_expbit0+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
+  gl_cv_cc_float_expbit0="word 0 bit 23"
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#ifdef _MSC_VER
-MicrosoftCompiler
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "MicrosoftCompiler" >/dev/null 2>&1; then :
-  gl_asmext='asm'
-     gl_c_asm_opt='-c -Fa'
-
-else
-  gl_asmext='s'
-     gl_c_asm_opt='-S'
-
-fi
-rm -f conftest*
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$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 ${gl_cv_prog_as_underscore+:} false; 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 $gl_c_asm_opt conftest.c'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; } >/dev/null 2>&1
-     if LC_ALL=C grep -E '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' conftest.$gl_asmext >/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:${as_lineno-$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}'"'
-
-
-
-
-
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$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 ${gl_cv_func_snprintf_retval_c99+:} false; 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 Mac OS 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
+#include <float.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#if HAVE_SNPRINTF
-# define my_snprintf snprintf
-#else
-# include <stdarg.h>
-static int my_snprintf (char *buf, int size, const char *format, ...)
+#define NWORDS \
+  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { float value; unsigned int word[NWORDS]; } memory_float;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (float x)
 {
-  va_list args;
-  int ret;
-  va_start (args, format);
-  ret = vsnprintf (buf, size, format, args);
-  va_end (args);
-  return ret;
+  memory_float m;
+  size_t i;
+  /* Clear it first, in case
+     sizeof (float) < sizeof (memory_float).  */
+  memset (&m, 0, sizeof (memory_float));
+  m.value = x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
 }
-#endif
-static char buf[100];
 int main ()
 {
-  strcpy (buf, "ABCDEF");
-  if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
     return 1;
-  if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
-    return 2;
-  if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
-    return 3;
-  return 0;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  add_to_ored_words (0.25f);
+  add_to_ored_words (0.5f);
+  add_to_ored_words (1.0f);
+  add_to_ored_words (2.0f);
+  add_to_ored_words (4.0f);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
 }
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_snprintf_retval_c99=yes
-else
-  gl_cv_func_snprintf_retval_c99=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_cc_float_expbit0=`cat conftest.out`
+else $as_nop
+  gl_cv_cc_float_expbit0="unknown"
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+      rm -f conftest.out
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5
-$as_echo "$gl_cv_func_snprintf_retval_c99" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
+printf "%s\n" "$gl_cv_cc_float_expbit0" >&6; }
+  case "$gl_cv_cc_float_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
 
-ac_fn_c_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default"
-if test "x$ac_cv_have_decl_snprintf" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+printf "%s\n" "#define FLT_EXPBIT0_WORD $word" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SNPRINTF $ac_have_decl
-_ACEOF
 
+printf "%s\n" "#define FLT_EXPBIT0_BIT $bit" >>confdefs.h
 
+      ;;
+  esac
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
-$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
-if ${ac_cv_header_stdbool_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-             #include <stdbool.h>
+   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+printf %s "checking whether byte ordering is bigendian... " >&6; }
+if test ${ac_cv_c_bigendian+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+              not a universal capable compiler
+            #endif
+            typedef int dummy;
 
-             #ifdef __cplusplus
-              typedef bool Bool;
-             #else
-              typedef _Bool Bool;
-              #ifndef bool
-               "error: bool is not defined"
-              #endif
-              #ifndef false
-               "error: false is not defined"
-              #endif
-              #if false
-               "error: false is not 0"
-              #endif
-              #ifndef true
-               "error: true is not defined"
-              #endif
-              #if true != 1
-               "error: true is not 1"
-              #endif
-             #endif
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
 
-             #ifndef __bool_true_false_are_defined
-              "error: __bool_true_false_are_defined is not defined"
-             #endif
+       # Check for potential -arch flags.  It is not universal unless
+       # there are at least two -arch flags with different values.
+       ac_arch=
+       ac_prev=
+       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+        if test -n "$ac_prev"; then
+          case $ac_word in
+            i?86 | x86_64 | ppc | ppc64)
+              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+                ac_arch=$ac_word
+              else
+                ac_cv_c_bigendian=universal
+                break
+              fi
+              ;;
+          esac
+          ac_prev=
+        elif test "x$ac_word" = "x-arch"; then
+          ac_prev=arch
+        fi
+       done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+            #include <sys/param.h>
 
-             struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
+int
+main (void)
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+                    && LITTLE_ENDIAN)
+             bogus endian macros
+            #endif
 
-             char a[true == 1 ? 1 : -1];
-             char b[false == 0 ? 1 : -1];
-             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-             char d[(bool) 0.5 == true ? 1 : -1];
-             /* See body of main program for 'e'.  */
-             char f[(Bool) 0.0 == false ? 1 : -1];
-             char g[true];
-             char h[sizeof (Bool)];
-             char i[sizeof s.t];
-             enum { j = false, k = true, l = false * true, m = true * 256 };
-             /* The following fails for
-                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
-             Bool n[m];
-             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
-             char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
-             /* Catch a bug in an HP-UX C compiler.  See
-                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-              */
-             Bool q = true;
-             Bool *pq = &q;
-             bool *qq = &q;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+               #include <sys/param.h>
 
 int
-main ()
+main (void)
 {
-
-             bool e = &s;
-             *pq |= q; *pq |= ! q;
-             *qq |= q; *qq |= ! q;
-             /* Refer to every declared value, to avoid compiler optimizations.  */
-             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
-                     + !m + !n + !o + !p + !q + !pq + !qq);
+#if BYTE_ORDER != BIG_ENDIAN
+                not big endian
+               #endif
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdbool_h=yes
-else
-  ac_cv_header_stdbool_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_bigendian=yes
+else $as_nop
+  ac_cv_c_bigendian=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
-$as_echo "$ac_cv_header_stdbool_h" >&6; }
-   ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
-if test "x$ac_cv_type__Bool" = xyes; then :
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE__BOOL 1
-_ACEOF
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
 
+int
+main (void)
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+             bogus endian macros
+            #endif
 
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wint_t" >&5
-$as_echo_n "checking for wint_t... " >&6; }
-if ${gt_cv_c_wint_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <limits.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 ()
+main (void)
 {
+#ifndef _BIG_ENDIAN
+                not big endian
+               #endif
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_c_wint_t=yes
-else
-  gt_cv_c_wint_t=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_bigendian=yes
+else $as_nop
+  ac_cv_c_bigendian=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$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
-
-$as_echo "#define HAVE_WINT_T 1" >>confdefs.h
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes
+then :
+  # Try to guess by grepping values from an object file.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+unsigned short int ascii_mm[] =
+                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+               unsigned short int ascii_ii[] =
+                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+               int use_ascii (int i) {
+                 return ascii_mm[i] + ascii_ii[i];
+               }
+               unsigned short int ebcdic_ii[] =
+                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+               unsigned short int ebcdic_mm[] =
+                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+               int use_ebcdic (int i) {
+                 return ebcdic_mm[i] + ebcdic_ii[i];
+               }
+               extern int foo;
 
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wint_t is too small" >&5
-$as_echo_n "checking whether wint_t is too small... " >&6; }
-if ${gl_cv_type_wint_t_too_small+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+int
+main (void)
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+             ac_cv_c_bigendian=yes
+           fi
+           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+             if test "$ac_cv_c_bigendian" = unknown; then
+               ac_cv_c_bigendian=no
+             else
+               # finding both strings is unlikely to happen, but who knows?
+               ac_cv_c_bigendian=unknown
+             fi
+           fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* 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>
-#endif
-#include <wchar.h>
-              int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
-
+$ac_includes_default
 int
-main ()
+main (void)
 {
 
+            /* Are we little or big endian?  From Harbison&Steele.  */
+            union
+            {
+              long int l;
+              char c[sizeof (long int)];
+            } u;
+            u.l = 1;
+            return u.c[sizeof (long int) - 1] == 1;
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_type_wint_t_too_small=no
-else
-  gl_cv_type_wint_t_too_small=yes
+if ac_fn_c_try_run "$LINENO"
+then :
+  ac_cv_c_bigendian=no
+else $as_nop
+  ac_cv_c_bigendian=yes
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wint_t_too_small" >&5
-$as_echo "$gl_cv_type_wint_t_too_small" >&6; }
-    if test $gl_cv_type_wint_t_too_small = yes; then
-      GNULIB_OVERRIDES_WINT_T=1
-    else
-      GNULIB_OVERRIDES_WINT_T=0
-    fi
-  else
-    GNULIB_OVERRIDES_WINT_T=0
-  fi
-
 
+    fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+printf "%s\n" "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+   no)
+      ;; #(
+   universal)
 
+printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
 
+     ;; #(
+   *)
+     as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
 
 
 
+    HAVE_ISWBLANK=1;
+  HAVE_WCTYPE_T=1;
+  HAVE_WCTRANS_T=1;
+  REPLACE_ISWBLANK=0;
+  REPLACE_ISWDIGIT=0;
+  REPLACE_ISWXDIGIT=0;
 
 
 
 
 
-  if test $ac_cv_type_long_long_int = yes; then
-    HAVE_LONG_LONG_INT=1
+  if test $ac_cv_header_crtdefs_h = yes; then
+    HAVE_CRTDEFS_H=1
   else
-    HAVE_LONG_LONG_INT=0
+    HAVE_CRTDEFS_H=0
   fi
 
 
-  if test $ac_cv_type_unsigned_long_long_int = yes; then
-    HAVE_UNSIGNED_LONG_LONG_INT=1
-  else
-    HAVE_UNSIGNED_LONG_LONG_INT=0
-  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
+
+  if test $ac_cv_func_iswcntrl = yes; then
+    HAVE_ISWCNTRL=1
   else
-    HAVE_INTTYPES_H=0
+    HAVE_ISWCNTRL=0
   fi
 
 
-      if test $ac_cv_header_sys_types_h = yes; then
-    HAVE_SYS_TYPES_H=1
+
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
   else
-    HAVE_SYS_TYPES_H=0
+    HAVE_WINT_T=0
   fi
 
 
@@ -17593,23 +20244,26 @@ $as_echo "$gl_cv_type_wint_t_too_small" >&6; }
 
 
 
+
+
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_stdint_h='<'stdint.h'>'
+       gl_cv_next_wctype_h='<'wctype.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdint.h>" >&5
-$as_echo_n "checking absolute name of <stdint.h>... " >&6; }
-if ${gl_cv_next_stdint_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
+printf %s "checking absolute name of <wctype.h>... " >&6; }
+if test ${gl_cv_next_wctype_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-             if test $ac_cv_header_stdint_h = yes; then
+             if test $ac_cv_header_wctype_h = yes; then
 
 
 
 
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdint.h>
+#include <wctype.h>
 _ACEOF
                 case "$host_os" in
     aix*) gl_absname_cpp="$ac_cpp -C" ;;
@@ -17625,7 +20279,7 @@ _ACEOF
       ;;
   esac
       gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'stdint.h' \
+  gl_header_literal_regex=`echo 'wctype.h' \
                            | sed -e "$gl_make_literal_regex_sed"`
   gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
       s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
@@ -17634,827 +20288,684 @@ _ACEOF
       q
     }'
 
-        gl_cv_absolute_stdint_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+        gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
   sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_stdint_h
-           gl_cv_next_stdint_h='"'$gl_header'"'
+           gl_header=$gl_cv_absolute_wctype_h
+           gl_cv_next_wctype_h='"'$gl_header'"'
           else
-               gl_cv_next_stdint_h='<'stdint.h'>'
+               gl_cv_next_wctype_h='<'wctype.h'>'
              fi
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdint_h" >&5
-$as_echo "$gl_cv_next_stdint_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wctype_h" >&5
+printf "%s\n" "$gl_cv_next_wctype_h" >&6; }
      fi
-     NEXT_STDINT_H=$gl_cv_next_stdint_h
+     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='<'stdint.h'>'
+       gl_next_as_first_directive='<'wctype.h'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_stdint_h
+       gl_next_as_first_directive=$gl_cv_next_wctype_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_STDINT_H=$gl_next_as_first_directive
-
+     NEXT_AS_FIRST_DIRECTIVE_WCTYPE_H=$gl_next_as_first_directive
 
 
 
-  if test $ac_cv_header_stdint_h = yes; then
-    HAVE_STDINT_H=1
-  else
-    HAVE_STDINT_H=0
-  fi
 
+  if test $ac_cv_header_wctype_h = yes; then
+    if test $ac_cv_func_iswcntrl = yes; then
+                  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
+printf %s "checking whether iswcntrl works... " >&6; }
+if test ${gl_cv_func_iswcntrl_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-    if test $ac_cv_header_stdint_h = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h conforms to C99" >&5
-$as_echo_n "checking whether stdint.h conforms to C99... " >&6; }
-if ${gl_cv_header_working_stdint_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  gl_cv_header_working_stdint_h=no
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+          if test "$cross_compiling" = yes
+then :
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <stdlib.h>
+                          #if __GNU_LIBRARY__ == 1
+                          Linux libc5 i18n is broken.
+                          #endif
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_iswcntrl_works="guessing yes"
+else $as_nop
+  gl_cv_func_iswcntrl_works="guessing no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
-#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
-#define __STDC_CONSTANT_MACROS 1
-#define __STDC_LIMIT_MACROS 1
-#include <stdint.h>
-/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
-#if !(defined WCHAR_MIN && defined WCHAR_MAX)
-#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
-#endif
-
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.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 <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
+               #include <wchar.h>
+               #include <wctype.h>
+               int main () { return iswprint ('x') == 0; }
 
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_iswcntrl_works=yes
+else $as_nop
+  gl_cv_func_iswcntrl_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-#ifdef INT8_MAX
-int8_t a1 = INT8_MAX;
-int8_t a1min = INT8_MIN;
-#endif
-#ifdef INT16_MAX
-int16_t a2 = INT16_MAX;
-int16_t a2min = INT16_MIN;
-#endif
-#ifdef INT32_MAX
-int32_t a3 = INT32_MAX;
-int32_t a3min = INT32_MIN;
-#endif
-#ifdef INT64_MAX
-int64_t a4 = INT64_MAX;
-int64_t a4min = INT64_MIN;
-#endif
-#ifdef UINT8_MAX
-uint8_t b1 = UINT8_MAX;
-#else
-typedef int b1[(unsigned char) -1 != 255 ? 1 : -1];
-#endif
-#ifdef UINT16_MAX
-uint16_t b2 = UINT16_MAX;
-#endif
-#ifdef UINT32_MAX
-uint32_t b3 = UINT32_MAX;
-#endif
-#ifdef UINT64_MAX
-uint64_t b4 = UINT64_MAX;
-#endif
-int_least8_t c1 = INT8_C (0x7f);
-int_least8_t c1max = INT_LEAST8_MAX;
-int_least8_t c1min = INT_LEAST8_MIN;
-int_least16_t c2 = INT16_C (0x7fff);
-int_least16_t c2max = INT_LEAST16_MAX;
-int_least16_t c2min = INT_LEAST16_MIN;
-int_least32_t c3 = INT32_C (0x7fffffff);
-int_least32_t c3max = INT_LEAST32_MAX;
-int_least32_t c3min = INT_LEAST32_MIN;
-int_least64_t c4 = INT64_C (0x7fffffffffffffff);
-int_least64_t c4max = INT_LEAST64_MAX;
-int_least64_t c4min = INT_LEAST64_MIN;
-uint_least8_t d1 = UINT8_C (0xff);
-uint_least8_t d1max = UINT_LEAST8_MAX;
-uint_least16_t d2 = UINT16_C (0xffff);
-uint_least16_t d2max = UINT_LEAST16_MAX;
-uint_least32_t d3 = UINT32_C (0xffffffff);
-uint_least32_t d3max = UINT_LEAST32_MAX;
-uint_least64_t d4 = UINT64_C (0xffffffffffffffff);
-uint_least64_t d4max = UINT_LEAST64_MAX;
-int_fast8_t e1 = INT_FAST8_MAX;
-int_fast8_t e1min = INT_FAST8_MIN;
-int_fast16_t e2 = INT_FAST16_MAX;
-int_fast16_t e2min = INT_FAST16_MIN;
-int_fast32_t e3 = INT_FAST32_MAX;
-int_fast32_t e3min = INT_FAST32_MIN;
-int_fast64_t e4 = INT_FAST64_MAX;
-int_fast64_t e4min = INT_FAST64_MIN;
-uint_fast8_t f1 = UINT_FAST8_MAX;
-uint_fast16_t f2 = UINT_FAST16_MAX;
-uint_fast32_t f3 = UINT_FAST32_MAX;
-uint_fast64_t f4 = UINT_FAST64_MAX;
-#ifdef INTPTR_MAX
-intptr_t g = INTPTR_MAX;
-intptr_t gmin = INTPTR_MIN;
-#endif
-#ifdef UINTPTR_MAX
-uintptr_t h = UINTPTR_MAX;
-#endif
-intmax_t i = INTMAX_MAX;
-uintmax_t j = UINTMAX_MAX;
 
-/* Check that SIZE_MAX has the correct type, if possible.  */
-#if 201112 <= __STDC_VERSION__
-int k = _Generic (SIZE_MAX, size_t: 0);
-#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
-       || (0x5110 <= __SUNPRO_C && !__STDC__))
-extern size_t k;
-extern __typeof__ (SIZE_MAX) k;
-#endif
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
+printf "%s\n" "$gl_cv_func_iswcntrl_works" >&6; }
+    fi
+    HAVE_WCTYPE_H=1
+  else
+    HAVE_WCTYPE_H=0
+  fi
 
-#include <limits.h> /* for CHAR_BIT */
-#define TYPE_MINIMUM(t) \
-  ((t) ((t) 0 < (t) -1 ? (t) 0 : ~ TYPE_MAXIMUM (t)))
-#define TYPE_MAXIMUM(t) \
-  ((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)
-      && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
-      ? 1 : -1;
-  /* Detect bug in FreeBSD 6.0 / ia64.  */
-  int check_SIG_ATOMIC:
-      SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
-      && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
-      ? 1 : -1;
-  int check_SIZE: SIZE_MAX == TYPE_MAXIMUM (size_t) ? 1 : -1;
-  int check_WCHAR:
-      WCHAR_MIN == TYPE_MINIMUM (wchar_t)
-      && WCHAR_MAX == TYPE_MAXIMUM (wchar_t)
-      ? 1 : -1;
-  /* Detect bug in mingw.  */
-  int check_WINT:
-      WINT_MIN == TYPE_MINIMUM (wint_t)
-      && WINT_MAX == TYPE_MAXIMUM (wint_t)
-      ? 1 : -1;
 
-  /* Detect bugs in glibc 2.4 and Solaris 10 stdint.h, among others.  */
-  int check_UINT8_C:
-        (-1 < UINT8_C (0)) == (-1 < (uint_least8_t) 0) ? 1 : -1;
-  int check_UINT16_C:
-        (-1 < UINT16_C (0)) == (-1 < (uint_least16_t) 0) ? 1 : -1;
+  if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
+    REPLACE_ISWCNTRL=1
+  else
+    case "$gl_cv_func_iswcntrl_works" in
+      *yes) REPLACE_ISWCNTRL=0 ;;
+      *)    REPLACE_ISWCNTRL=1 ;;
+    esac
+  fi
 
-  /* Detect bugs in OpenBSD 3.9 stdint.h.  */
-#ifdef UINT8_MAX
-  int check_uint8: (uint8_t) -1 == UINT8_MAX ? 1 : -1;
-#endif
-#ifdef UINT16_MAX
-  int check_uint16: (uint16_t) -1 == UINT16_MAX ? 1 : -1;
-#endif
-#ifdef UINT32_MAX
-  int check_uint32: (uint32_t) -1 == UINT32_MAX ? 1 : -1;
-#endif
-#ifdef UINT64_MAX
-  int check_uint64: (uint64_t) -1 == UINT64_MAX ? 1 : -1;
-#endif
-  int check_uint_least8: (uint_least8_t) -1 == UINT_LEAST8_MAX ? 1 : -1;
-  int check_uint_least16: (uint_least16_t) -1 == UINT_LEAST16_MAX ? 1 : -1;
-  int check_uint_least32: (uint_least32_t) -1 == UINT_LEAST32_MAX ? 1 : -1;
-  int check_uint_least64: (uint_least64_t) -1 == UINT_LEAST64_MAX ? 1 : -1;
-  int check_uint_fast8: (uint_fast8_t) -1 == UINT_FAST8_MAX ? 1 : -1;
-  int check_uint_fast16: (uint_fast16_t) -1 == UINT_FAST16_MAX ? 1 : -1;
-  int check_uint_fast32: (uint_fast32_t) -1 == UINT_FAST32_MAX ? 1 : -1;
-  int check_uint_fast64: (uint_fast64_t) -1 == UINT_FAST64_MAX ? 1 : -1;
-  int check_uintptr: (uintptr_t) -1 == UINTPTR_MAX ? 1 : -1;
-  int check_uintmax: (uintmax_t) -1 == UINTMAX_MAX ? 1 : -1;
-  int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
-};
 
-int
-main ()
-{
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+        :
+  fi
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-                                                    if test "$cross_compiling" = yes; then :
-                 gl_cv_header_working_stdint_h=yes
+  if test $REPLACE_ISWCNTRL = 1; then
+    REPLACE_TOWLOWER=1
+  else
+    ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
+if test "x$ac_cv_func_towlower" = xyes
+then :
+  printf "%s\n" "#define HAVE_TOWLOWER 1" >>confdefs.h
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+fi
 
+    if test $ac_cv_func_towlower = yes; then
+      REPLACE_TOWLOWER=0
+    else
+      ac_fn_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "#include <wchar.h>
+          #if HAVE_WCTYPE_H
+          # include <wctype.h>
+          #endif
 
-#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
-#define __STDC_CONSTANT_MACROS 1
-#define __STDC_LIMIT_MACROS 1
-#include <stdint.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_towlower" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_TOWLOWER $ac_have_decl" >>confdefs.h
 
+      if test $ac_cv_have_decl_towlower = yes; then
+                                REPLACE_TOWLOWER=1
+      else
+        REPLACE_TOWLOWER=0
+      fi
+    fi
+  fi
 
-  /* 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 <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
 
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
+        :
+  fi
 
-#include <stdio.h>
-#include <string.h>
-#define MVAL(macro) MVAL1(macro)
-#define MVAL1(expression) #expression
-static const char *macro_values[] =
-  {
-#ifdef INT8_MAX
-    MVAL (INT8_MAX),
-#endif
-#ifdef INT16_MAX
-    MVAL (INT16_MAX),
-#endif
-#ifdef INT32_MAX
-    MVAL (INT32_MAX),
-#endif
-#ifdef INT64_MAX
-    MVAL (INT64_MAX),
-#endif
-#ifdef UINT8_MAX
-    MVAL (UINT8_MAX),
-#endif
-#ifdef UINT16_MAX
-    MVAL (UINT16_MAX),
-#endif
-#ifdef UINT32_MAX
-    MVAL (UINT32_MAX),
-#endif
-#ifdef UINT64_MAX
-    MVAL (UINT64_MAX),
-#endif
-    NULL
-  };
+          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
+printf %s "checking for wctype_t... " >&6; }
+if test ${gl_cv_type_wctype_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <wchar.h>
+            #if HAVE_WCTYPE_H
+            # include <wctype.h>
+            #endif
+            wctype_t a;
 
 int
-main ()
+main (void)
 {
 
-  const char **mv;
-  for (mv = macro_values; *mv != NULL; mv++)
-    {
-      const char *value = *mv;
-      /* Test whether it looks like a cast expression.  */
-      if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
-          || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
-          || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
-          || strncmp (value, "((int)"/*)*/, 6) == 0
-          || strncmp (value, "((signed short)"/*)*/, 15) == 0
-          || strncmp (value, "((signed char)"/*)*/, 14) == 0)
-        return mv - macro_values + 1;
-    }
-  return 0;
-
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_header_working_stdint_h=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_type_wctype_t=yes
+else $as_nop
+  gl_cv_type_wctype_t=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdint_h" >&5
-$as_echo "$gl_cv_header_working_stdint_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctype_t" >&5
+printf "%s\n" "$gl_cv_type_wctype_t" >&6; }
+  if test $gl_cv_type_wctype_t = no; then
+    HAVE_WCTYPE_T=0
   fi
 
-  HAVE_C99_STDINT_H=0
-  HAVE_SYS_BITYPES_H=0
-  HAVE_SYS_INTTYPES_H=0
-  STDINT_H=stdint.h
-  if test "$gl_cv_header_working_stdint_h" = yes; then
-    HAVE_C99_STDINT_H=1
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h predates C++11" >&5
-$as_echo_n "checking whether stdint.h predates C++11... " >&6; }
-if ${gl_cv_header_stdint_predates_cxx11_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  gl_cv_header_stdint_predates_cxx11_h=yes
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
+printf %s "checking for wctrans_t... " >&6; }
+if test ${gl_cv_type_wctrans_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-
-#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
-#include <stdint.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 <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
-
-
-intmax_t im = INTMAX_MAX;
-int32_t i32 = INT32_C (0x7fffffff);
+#include <wchar.h>
+            #include <wctype.h>
+            wctrans_t a;
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_stdint_predates_cxx11_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_type_wctrans_t=yes
+else $as_nop
+  gl_cv_type_wctrans_t=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_predates_cxx11_h" >&5
-$as_echo "$gl_cv_header_stdint_predates_cxx11_h" >&6; }
-
-    if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
-$as_echo "#define __STDC_CONSTANT_MACROS 1" >>confdefs.h
-
-
-$as_echo "#define __STDC_LIMIT_MACROS 1" >>confdefs.h
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_wctrans_t" >&5
+printf "%s\n" "$gl_cv_type_wctrans_t" >&6; }
+  if test $gl_cv_type_wctrans_t = no; then
+    HAVE_WCTRANS_T=0
+  fi
 
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stdint.h has UINTMAX_WIDTH etc." >&5
-$as_echo_n "checking whether stdint.h has UINTMAX_WIDTH etc.... " >&6; }
-if ${gl_cv_header_stdint_width+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  gl_cv_header_stdint_width=no
-       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-            /* Work if build is not clean.  */
-            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
-            #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
-             #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
-            #endif
-            #include <stdint.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 <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
 
-            int iw = UINTMAX_WIDTH;
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_stdint_width=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_width" >&5
-$as_echo "$gl_cv_header_stdint_width" >&6; }
-    if test "$gl_cv_header_stdint_width" = yes; then
-      STDINT_H=
-    fi
-  else
-            for ac_header in sys/inttypes.h sys/bitypes.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
+  GL_M4_GNULIB_ISWBLANK=0
 
-fi
 
-done
 
-    if test $ac_cv_header_sys_inttypes_h = yes; then
-      HAVE_SYS_INTTYPES_H=1
-    fi
-    if test $ac_cv_header_sys_bitypes_h = yes; then
-      HAVE_SYS_BITYPES_H=1
-    fi
+  GL_M4_GNULIB_ISWDIGIT=0
 
 
-  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
+  GL_M4_GNULIB_ISWXDIGIT=0
 
-  for gltype in ptrdiff_t size_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
-$as_echo_n "checking for bit size of $gltype... " >&6; }
-if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
-  /* 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 <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
 
-#include <limits.h>"; then :
 
-else
-  result=unknown
-fi
+  GL_M4_GNULIB_WCTYPE=0
 
-       eval gl_cv_bitsizeof_${gltype}=\$result
 
-fi
-eval ac_res=\$gl_cv_bitsizeof_${gltype}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    eval result=\$gl_cv_bitsizeof_${gltype}
-    if test $result = unknown; then
-                                                result=0
-    fi
-    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    cat >>confdefs.h <<_ACEOF
-#define BITSIZEOF_${GLTYPE} $result
-_ACEOF
 
-    eval BITSIZEOF_${GLTYPE}=\$result
-  done
+  GL_M4_GNULIB_ISWCTYPE=0
 
 
-  fi
 
+  GL_M4_GNULIB_WCTRANS=0
 
-  for gltype in sig_atomic_t wchar_t wint_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for bit size of $gltype" >&5
-$as_echo_n "checking for bit size of $gltype... " >&6; }
-if eval \${gl_cv_bitsizeof_${gltype}+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if ac_fn_c_compute_int "$LINENO" "sizeof ($gltype) * CHAR_BIT" "result"        "
-  /* 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 <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
 
-#include <limits.h>"; then :
 
-else
-  result=unknown
-fi
+  GL_M4_GNULIB_TOWCTRANS=0
 
-       eval gl_cv_bitsizeof_${gltype}=\$result
 
-fi
-eval ac_res=\$gl_cv_bitsizeof_${gltype}
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    eval result=\$gl_cv_bitsizeof_${gltype}
-    if test $result = unknown; then
-                                                result=0
-    fi
-    GLTYPE=`echo "$gltype" | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    cat >>confdefs.h <<_ACEOF
-#define BITSIZEOF_${GLTYPE} $result
-_ACEOF
 
-    eval BITSIZEOF_${GLTYPE}=\$result
-  done
 
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  for gltype in sig_atomic_t wchar_t wint_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $gltype is signed" >&5
-$as_echo_n "checking whether $gltype is signed... " >&6; }
-if eval \${gl_cv_type_${gltype}_signed+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.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 <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
-
-            int verify[2 * (($gltype) -1 < ($gltype) 0) - 1];
-int
-main ()
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
 {
-
-  ;
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
+     on Cygwin 1.5.x.  */
+  if (MB_CUR_MAX == 1)
+    return 1;
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
   return 0;
+#endif
 }
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  result=yes
-else
-  result=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-       eval gl_cv_type_${gltype}_signed=\$result
 
-fi
-eval ac_res=\$gl_cv_type_${gltype}_signed
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    eval result=\$gl_cv_type_${gltype}_signed
-    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    if test "$result" = yes; then
-      cat >>confdefs.h <<_ACEOF
-#define HAVE_SIGNED_${GLTYPE} 1
 _ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows, 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 Mac OS 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
+              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
+                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
+                  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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
 
-      eval HAVE_SIGNED_${GLTYPE}=1
-    else
-      eval HAVE_SIGNED_${GLTYPE}=0
-    fi
-  done
-
-
-  gl_cv_type_ptrdiff_t_signed=yes
-  gl_cv_type_size_t_signed=no
-  if test $APPLE_UNIVERSAL_BUILD = 0; then
-
-
-  for gltype in ptrdiff_t size_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
-$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
-if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval gl_cv_type_${gltype}_suffix=no
-       eval result=\$gl_cv_type_${gltype}_signed
-       if test "$result" = yes; then
-         glsufu=
-       else
-         glsufu=u
-       fi
-       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
-         case $glsuf in
-           '')  gltype1='int';;
-           l)   gltype1='long int';;
-           ll)  gltype1='long long int';;
-           i64) gltype1='__int64';;
-           u)   gltype1='unsigned int';;
-           ul)  gltype1='unsigned long int';;
-           ull) gltype1='unsigned long long int';;
-           ui64)gltype1='unsigned __int64';;
-         esac
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.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 <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
-
-              extern $gltype foo;
-              extern $gltype1 foo;
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval gl_cv_type_${gltype}_suffix=\$glsuf
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         eval result=\$gl_cv_type_${gltype}_suffix
-         test "$result" != no && break
-       done
 fi
-eval ac_res=\$gl_cv_type_${gltype}_suffix
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    eval result=\$gl_cv_type_${gltype}_suffix
-    test "$result" = no && result=
-    eval ${GLTYPE}_SUFFIX=\$result
-    cat >>confdefs.h <<_ACEOF
-#define ${GLTYPE}_SUFFIX $result
-_ACEOF
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+  LOCALE_JA=$gt_cv_locale_ja
 
-  done
 
 
-  fi
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  for gltype in sig_atomic_t wchar_t wint_t ; do
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $gltype integer literal suffix" >&5
-$as_echo_n "checking for $gltype integer literal suffix... " >&6; }
-if eval \${gl_cv_type_${gltype}_suffix+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  eval gl_cv_type_${gltype}_suffix=no
-       eval result=\$gl_cv_type_${gltype}_signed
-       if test "$result" = yes; then
-         glsufu=
-       else
-         glsufu=u
-       fi
-       for glsuf in "$glsufu" ${glsufu}l ${glsufu}ll ${glsufu}i64; do
-         case $glsuf in
-           '')  gltype1='int';;
-           l)   gltype1='long int';;
-           ll)  gltype1='long long int';;
-           i64) gltype1='__int64';;
-           u)   gltype1='unsigned int';;
-           ul)  gltype1='unsigned long int';;
-           ull) gltype1='unsigned long long int';;
-           ui64)gltype1='unsigned __int64';;
-         esac
-         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.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 <signal.h>
-  #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
-  # include <wchar.h>
-  #endif
-
-              extern $gltype foo;
-              extern $gltype1 foo;
-int
-main ()
-{
-
-  ;
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
   return 0;
 }
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  eval gl_cv_type_${gltype}_suffix=\$glsuf
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         eval result=\$gl_cv_type_${gltype}_suffix
-         test "$result" != no && break
-       done
-fi
-eval ac_res=\$gl_cv_type_${gltype}_suffix
-              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
-    eval result=\$gl_cv_type_${gltype}_suffix
-    test "$result" = no && result=
-    eval ${GLTYPE}_SUFFIX=\$result
-    cat >>confdefs.h <<_ACEOF
-#define ${GLTYPE}_SUFFIX $result
-_ACEOF
-
-  done
-
 
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
 
-          if test $GNULIB_OVERRIDES_WINT_T = 1; then
-    BITSIZEOF_WINT_T=32
-  fi
-
-  fi
-
-    LIMITS_H=limits.h
-   if test -n "$LIMITS_H"; then
-  GL_GENERATE_LIMITS_H_TRUE=
-  GL_GENERATE_LIMITS_H_FALSE='#'
-else
-  GL_GENERATE_LIMITS_H_TRUE='#'
-  GL_GENERATE_LIMITS_H_FALSE=
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
 
 
 
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-   if test -n "$STDINT_H"; then
-  GL_GENERATE_STDINT_H_TRUE=
-  GL_GENERATE_STDINT_H_FALSE='#'
-else
-  GL_GENERATE_STDINT_H_TRUE='#'
-  GL_GENERATE_STDINT_H_FALSE=
-fi
-
-
-
-     REPLACE_STRERROR_0=0
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
-$as_echo_n "checking whether strerror(0) succeeds... " >&6; }
-if ${gl_cv_func_strerror_0_works+:} false; 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_strerror_0_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_strerror_0_works="guessing no" ;;
-       esac
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <string.h>
-           #include <errno.h>
 
-int
-main ()
+#include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
 {
-int result = 0;
-           char *str;
-           errno = 0;
-           str = strerror (0);
-           if (!*str) result |= 1;
-           if (errno) result |= 2;
-           if (strstr (str, "nknown") || strstr (str, "ndefined"))
-             result |= 4;
-           return result;
-  ;
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  /* Check whether a typical GB18030 multibyte sequence is recognized as a
+     single wide character.  This excludes the GB2312 and GBK encodings.  */
+  if (mblen ("\203\062\332\066", 5) != 4)
+    return 1;
   return 0;
+#endif
 }
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_strerror_0_works=yes
-else
-  gl_cv_func_strerror_0_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        solaris2.8)
+          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+          gt_cv_locale_zh_CN=none
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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.
+      gt_cv_locale_zh_CN=none
+    fi
+    rm -fr conftest*
+
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+    HAVE_NL_LANGINFO=1;
+  REPLACE_NL_LANGINFO=0;
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
-$as_echo "$gl_cv_func_strerror_0_works" >&6; }
-  case "$gl_cv_func_strerror_0_works" in
-    *yes) ;;
-    *)
-      REPLACE_STRERROR_0=1
 
-$as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
 
-      ;;
-  esac
 
 
 
@@ -18468,19 +20979,23 @@ $as_echo "#define REPLACE_STRERROR_0 1" >>confdefs.h
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_string_h='<'string.h'>'
+       gl_cv_next_langinfo_h='<'langinfo.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
-$as_echo_n "checking absolute name of <string.h>... " >&6; }
-if ${gl_cv_next_string_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <langinfo.h>" >&5
+printf %s "checking absolute name of <langinfo.h>... " >&6; }
+if test ${gl_cv_next_langinfo_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_langinfo_h = yes; then
+
 
 
 
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <string.h>
+#include <langinfo.h>
 _ACEOF
                 case "$host_os" in
     aix*) gl_absname_cpp="$ac_cpp -C" ;;
@@ -18496,7 +21011,7 @@ _ACEOF
       ;;
   esac
       gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'string.h' \
+  gl_header_literal_regex=`echo 'langinfo.h' \
                            | sed -e "$gl_make_literal_regex_sed"`
   gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
       s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
@@ -18505,360 +21020,381 @@ _ACEOF
       q
     }'
 
-        gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+        gl_cv_absolute_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
   sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_string_h
-           gl_cv_next_string_h='"'$gl_header'"'
+           gl_header=$gl_cv_absolute_langinfo_h
+           gl_cv_next_langinfo_h='"'$gl_header'"'
+          else
+               gl_cv_next_langinfo_h='<'langinfo.h'>'
+             fi
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
-$as_echo "$gl_cv_next_string_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5
+printf "%s\n" "$gl_cv_next_langinfo_h" >&6; }
      fi
-     NEXT_STRING_H=$gl_cv_next_string_h
+     NEXT_LANGINFO_H=$gl_cv_next_langinfo_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='<'string.h'>'
+       gl_next_as_first_directive='<'langinfo.h'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_string_h
+       gl_next_as_first_directive=$gl_cv_next_langinfo_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
+     NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive
 
 
 
 
 
+    HAVE_LANGINFO_CODESET=0
+  HAVE_LANGINFO_T_FMT_AMPM=0
+  HAVE_LANGINFO_ALTMON=0
+  HAVE_LANGINFO_ERA=0
+  HAVE_LANGINFO_YESEXPR=0
 
+  if test $ac_cv_header_langinfo_h = yes; then
+    HAVE_LANGINFO_H=1
+                        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5
+printf %s "checking whether langinfo.h defines CODESET... " >&6; }
+if test ${gl_cv_header_langinfo_codeset+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <langinfo.h>
+int a = CODESET;
 
-ac_fn_c_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strndup" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+int
+main (void)
+{
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRNDUP $ac_have_decl
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_langinfo_codeset=yes
+else $as_nop
+  gl_cv_header_langinfo_codeset=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
-
-
-ac_fn_c_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strnlen" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5
+printf "%s\n" "$gl_cv_header_langinfo_codeset" >&6; }
+    if test $gl_cv_header_langinfo_codeset = yes; then
+      HAVE_LANGINFO_CODESET=1
+    fi
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5
+printf %s "checking whether langinfo.h defines T_FMT_AMPM... " >&6; }
+if test ${gl_cv_header_langinfo_t_fmt_ampm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <langinfo.h>
+int a = T_FMT_AMPM;
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRNLEN $ac_have_decl
-_ACEOF
+int
+main (void)
+{
 
-ac_fn_c_check_decl "$LINENO" "strsignal" "ac_cv_have_decl_strsignal" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strsignal" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_langinfo_t_fmt_ampm=yes
+else $as_nop
+  gl_cv_header_langinfo_t_fmt_ampm=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRSIGNAL $ac_have_decl
-_ACEOF
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5
+printf "%s\n" "$gl_cv_header_langinfo_t_fmt_ampm" >&6; }
+    if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
+      HAVE_LANGINFO_T_FMT_AMPM=1
+    fi
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ALTMON_1" >&5
+printf %s "checking whether langinfo.h defines ALTMON_1... " >&6; }
+if test ${gl_cv_header_langinfo_altmon+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <langinfo.h>
+int a = ALTMON_1;
 
-ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
-/* NetBSD declares sys_siglist in unistd.h.  */
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+int
+main (void)
+{
 
-"
-if test "x$ac_cv_have_decl_sys_siglist" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_langinfo_altmon=yes
+else $as_nop
+  gl_cv_header_langinfo_altmon=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SYS_SIGLIST $ac_have_decl
-_ACEOF
-
-
-
-
-
-  if test "$gl_cv_func_memchr_works" != yes; then
-    REPLACE_STRSTR=1
-  else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
-$as_echo_n "checking whether strstr works... " >&6; }
-if ${gl_cv_func_strstr_works_always+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-                                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#ifdef __GNU_LIBRARY__
- #include <features.h>
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
-     || defined __UCLIBC__
-  Lucky user
- #endif
-#elif defined __CYGWIN__
- #include <cygwin/version.h>
- #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
-  Lucky user
- #endif
-#else
-  Lucky user
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky user" >/dev/null 2>&1; then :
-  gl_cv_func_strstr_works_always="guessing yes"
-else
-  gl_cv_func_strstr_works_always="guessing no"
 fi
-rm -f conftest*
-
-
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_altmon" >&5
+printf "%s\n" "$gl_cv_header_langinfo_altmon" >&6; }
+    if test $gl_cv_header_langinfo_altmon = yes; then
+      HAVE_LANGINFO_ALTMON=1
+    fi
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5
+printf %s "checking whether langinfo.h defines ERA... " >&6; }
+if test ${gl_cv_header_langinfo_era+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <string.h> /* for strstr */
-#define P "_EF_BF_BD"
-#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
-#define NEEDLE P P P P P
+#include <langinfo.h>
+int a = ERA;
 
 int
-main ()
+main (void)
 {
-return !!strstr (HAYSTACK, NEEDLE);
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_strstr_works_always=yes
-else
-  gl_cv_func_strstr_works_always=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_langinfo_era=yes
+else $as_nop
+  gl_cv_header_langinfo_era=no
 fi
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
-$as_echo "$gl_cv_func_strstr_works_always" >&6; }
-    case "$gl_cv_func_strstr_works_always" in
-      *yes) ;;
-      *)
-        REPLACE_STRSTR=1
-        ;;
-    esac
-  fi
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp() can be used without linking with libm" >&5
-$as_echo_n "checking whether ldexp() can be used without linking with libm... " >&6; }
-if ${gl_cv_func_ldexp_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5
+printf "%s\n" "$gl_cv_header_langinfo_era" >&6; }
+    if test $gl_cv_header_langinfo_era = yes; then
+      HAVE_LANGINFO_ERA=1
+    fi
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5
+printf %s "checking whether langinfo.h defines YESEXPR... " >&6; }
+if test ${gl_cv_header_langinfo_yesexpr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#ifndef __NO_MATH_INLINES
-                           # define __NO_MATH_INLINES 1 /* for glibc */
-                           #endif
-                           #include <math.h>
-                           double (*funcptr) (double, int) = ldexp;
-                           double x;
+#include <langinfo.h>
+int a = YESEXPR;
+
 int
-main ()
+main (void)
 {
-return ldexp (x, -1) > 0;
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_ldexp_no_libm=yes
-else
-  gl_cv_func_ldexp_no_libm=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_langinfo_yesexpr=yes
+else $as_nop
+  gl_cv_header_langinfo_yesexpr=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5
-$as_echo "$gl_cv_func_ldexp_no_libm" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5
+printf "%s\n" "$gl_cv_header_langinfo_yesexpr" >&6; }
+    if test $gl_cv_header_langinfo_yesexpr = yes; then
+      HAVE_LANGINFO_YESEXPR=1
+    fi
+  else
+    HAVE_LANGINFO_H=0
+  fi
 
 
-  GNULIB_WAITPID=0;
 
 
 
 
-  GNULIB_MKTIME=0;
-  GNULIB_NANOSLEEP=0;
-  GNULIB_STRPTIME=0;
-  GNULIB_TIMEGM=0;
-  GNULIB_TIME_R=0;
-  GNULIB_TIME_RZ=0;
-    HAVE_DECL_LOCALTIME_R=1;
-  HAVE_NANOSLEEP=1;
-  HAVE_STRPTIME=1;
-  HAVE_TIMEGM=1;
-        REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
-  REPLACE_MKTIME=GNULIB_PORTCHECK;
-  REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
-  REPLACE_TIMEGM=GNULIB_PORTCHECK;
 
-      : ${GNULIB_GETTIMEOFDAY=0};
-        REPLACE_GMTIME=0;
-  REPLACE_LOCALTIME=0;
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
-$as_echo_n "checking for struct timespec in <time.h>... " >&6; }
-if ${gl_cv_sys_struct_timespec_in_time_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <time.h>
 
-int
-main ()
-{
-static struct timespec x; x.tv_sec = x.tv_nsec;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_sys_struct_timespec_in_time_h=yes
-else
-  gl_cv_sys_struct_timespec_in_time_h=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
-$as_echo "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
+  GL_M4_GNULIB_NL_LANGINFO=0
 
-  TIME_H_DEFINES_STRUCT_TIMESPEC=0
-  SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
-  PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
-  UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
-  if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
-    TIME_H_DEFINES_STRUCT_TIMESPEC=1
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
-$as_echo_n "checking for struct timespec in <sys/time.h>... " >&6; }
-if ${gl_cv_sys_struct_timespec_in_sys_time_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+
+
+    HAVE_NEWLOCALE=1;
+  HAVE_DUPLOCALE=1;
+  HAVE_FREELOCALE=1;
+  REPLACE_LOCALECONV=0;
+  REPLACE_SETLOCALE=0;
+  REPLACE_NEWLOCALE=0;
+  REPLACE_DUPLOCALE=0;
+  REPLACE_FREELOCALE=0;
+  REPLACE_STRUCT_LCONV=0;
+  LOCALENAME_ENHANCE_LOCALE_FUNCS=0;
+
+
+    REPLACE_NULL=0;
+  HAVE_MAX_ALIGN_T=1;
+  HAVE_WCHAR_T=1;
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wchar_t" >&5
+printf %s "checking for wchar_t... " >&6; }
+if test ${gt_cv_c_wchar_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/time.h>
-
+#include <stddef.h>
+            wchar_t foo = (wchar_t)'\0';
 int
-main ()
+main (void)
 {
-static struct timespec x; x.tv_sec = x.tv_nsec;
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_sys_struct_timespec_in_sys_time_h=yes
-else
-  gl_cv_sys_struct_timespec_in_sys_time_h=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gt_cv_c_wchar_t=yes
+else $as_nop
+  gt_cv_c_wchar_t=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
-$as_echo "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
-    if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
-      SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
-    else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
-$as_echo_n "checking for struct timespec in <pthread.h>... " >&6; }
-if ${gl_cv_sys_struct_timespec_in_pthread_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_wchar_t" >&5
+printf "%s\n" "$gt_cv_c_wchar_t" >&6; }
+  if test $gt_cv_c_wchar_t = yes; then
+
+printf "%s\n" "#define HAVE_WCHAR_T 1" >>confdefs.h
+
+  fi
+
+
+
+
+
+
+
+  STDDEF_H=
+
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for good max_align_t" >&5
+printf %s "checking for good max_align_t... " >&6; }
+if test ${gl_cv_type_max_align_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <pthread.h>
+#include <stddef.h>
+            unsigned int s = sizeof (max_align_t);
+            #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
+            int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
+            int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
+            #endif
+            typedef struct { char a; max_align_t b; } max_helper;
+            typedef struct { char a; long b; } long_helper;
+            typedef struct { char a; double b; } double_helper;
+            typedef struct { char a; long double b; } long_double_helper;
+            int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
+            int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
+            int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
 
 int
-main ()
+main (void)
 {
-static struct timespec x; x.tv_sec = x.tv_nsec;
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_sys_struct_timespec_in_pthread_h=yes
-else
-  gl_cv_sys_struct_timespec_in_pthread_h=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_type_max_align_t=yes
+else $as_nop
+  gl_cv_type_max_align_t=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
-$as_echo "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
-      if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
-        PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
-      else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
-$as_echo_n "checking for struct timespec in <unistd.h>... " >&6; }
-if ${gl_cv_sys_struct_timespec_in_unistd_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_type_max_align_t" >&5
+printf "%s\n" "$gl_cv_type_max_align_t" >&6; }
+  if test $gl_cv_type_max_align_t = no; then
+    HAVE_MAX_ALIGN_T=0
+    STDDEF_H=stddef.h
+  fi
+
+  if test $gt_cv_c_wchar_t = no; then
+    HAVE_WCHAR_T=0
+    STDDEF_H=stddef.h
+  fi
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
+printf %s "checking whether NULL can be used in arbitrary expressions... " >&6; }
+if test ${gl_cv_decl_null_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
+#include <stddef.h>
+      int test[2 * (sizeof NULL == sizeof (void *)) -1];
 
 int
-main ()
+main (void)
 {
-static struct timespec x; x.tv_sec = x.tv_nsec;
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_sys_struct_timespec_in_unistd_h=yes
-else
-  gl_cv_sys_struct_timespec_in_unistd_h=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_decl_null_works=yes
+else $as_nop
+  gl_cv_decl_null_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
-$as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
-        if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
-          UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
-        fi
-      fi
-    fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
+printf "%s\n" "$gl_cv_decl_null_works" >&6; }
+  if test $gl_cv_decl_null_works = no; then
+    REPLACE_NULL=1
+    STDDEF_H=stddef.h
   fi
 
 
+   if test -n "$STDDEF_H"; then
+  GL_GENERATE_STDDEF_H_TRUE=
+  GL_GENERATE_STDDEF_H_FALSE='#'
+else
+  GL_GENERATE_STDDEF_H_TRUE='#'
+  GL_GENERATE_STDDEF_H_FALSE=
+fi
 
-
-
-
-
-
+  if test -n "$STDDEF_H"; then
 
 
 
@@ -18868,19 +21404,20 @@ $as_echo "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_time_h='<'time.h'>'
+       gl_cv_next_stddef_h='<'stddef.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
-$as_echo_n "checking absolute name of <time.h>... " >&6; }
-if ${gl_cv_next_time_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
+printf %s "checking absolute name of <stddef.h>... " >&6; }
+if test ${gl_cv_next_stddef_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
 
 
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <time.h>
+#include <stddef.h>
 _ACEOF
                 case "$host_os" in
     aix*) gl_absname_cpp="$ac_cpp -C" ;;
@@ -18896,7 +21433,7 @@ _ACEOF
       ;;
   esac
       gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'time.h' \
+  gl_header_literal_regex=`echo 'stddef.h' \
                            | sed -e "$gl_make_literal_regex_sed"`
   gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
       s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
@@ -18905,166 +21442,90 @@ _ACEOF
       q
     }'
 
-        gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+        gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
   sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_time_h
-           gl_cv_next_time_h='"'$gl_header'"'
+           gl_header=$gl_cv_absolute_stddef_h
+           gl_cv_next_stddef_h='"'$gl_header'"'
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
-$as_echo "$gl_cv_next_time_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
+printf "%s\n" "$gl_cv_next_stddef_h" >&6; }
      fi
-     NEXT_TIME_H=$gl_cv_next_time_h
+     NEXT_STDDEF_H=$gl_cv_next_stddef_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='<'time.h'>'
+       gl_next_as_first_directive='<'stddef.h'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_time_h
+       gl_next_as_first_directive=$gl_cv_next_stddef_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
-
-
-
-
-
-
-
-
-ac_fn_c_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl
-_ACEOF
-
-ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_feof_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl
-_ACEOF
+     NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
 
-ac_fn_c_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_ferror_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl
-_ACEOF
 
-ac_fn_c_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_fflush_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl
-_ACEOF
+  fi
 
-ac_fn_c_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_fgets_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl
-_ACEOF
 
-ac_fn_c_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_fputc_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl
-_ACEOF
 
-ac_fn_c_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_fputs_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5
+printf %s "checking whether locale.h defines locale_t... " >&6; }
+if test ${gl_cv_header_locale_has_locale_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <locale.h>
+            locale_t x;
+int
+main (void)
+{
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl
+  ;
+  return 0;
+}
 _ACEOF
-
-ac_fn_c_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_fread_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_locale_has_locale_t=yes
+else $as_nop
+  gl_cv_header_locale_has_locale_t=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl
-_ACEOF
-
-ac_fn_c_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5
+printf "%s\n" "$gl_cv_header_locale_has_locale_t" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl
-_ACEOF
 
-ac_fn_c_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getchar_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+  if test $ac_cv_header_xlocale_h = yes; then
+    HAVE_XLOCALE_H=1
+    if test $gl_cv_header_locale_has_locale_t = yes; then
+      gl_cv_header_locale_h_needs_xlocale_h=no
+    else
+      gl_cv_header_locale_h_needs_xlocale_h=yes
+    fi
+    HAVE_LOCALE_T=1
+  else
+    HAVE_XLOCALE_H=0
+    gl_cv_header_locale_h_needs_xlocale_h=no
+    if test $gl_cv_header_locale_has_locale_t = yes; then
+      HAVE_LOCALE_T=1
+    else
+      HAVE_LOCALE_T=0
+    fi
+  fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl
-_ACEOF
 
-ac_fn_c_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_putc_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl
-_ACEOF
 
-ac_fn_c_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default"
-if test "x$ac_cv_have_decl_putchar_unlocked" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl
-_ACEOF
 
 
 
@@ -19072,313 +21533,281 @@ _ACEOF
 
 
 
-  if test $ac_cv_header_features_h = yes; then
-    HAVE_FEATURES_H=1
-  else
-    HAVE_FEATURES_H=0
-  fi
+  case "$host_os" in
+    solaris*)
 
+printf "%s\n" "#define _LCONV_C99 1" >>confdefs.h
 
+      ;;
+  esac
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5
-$as_echo_n "checking for inttypes.h... " >&6; }
-if ${gl_cv_header_inttypes_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5
+printf %s "checking whether locale.h conforms to POSIX:2001... " >&6; }
+if test ${gl_cv_header_locale_h_posix2001+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <sys/types.h>
-#include <inttypes.h>
-
+#include <locale.h>
+            int x = LC_MESSAGES;
+            int y = sizeof (((struct lconv *) 0)->decimal_point);
 int
-main ()
+main (void)
 {
-uintmax_t i = (uintmax_t) -1; return !i;
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_inttypes_h=yes
-else
-  gl_cv_header_inttypes_h=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_locale_h_posix2001=yes
+else $as_nop
+  gl_cv_header_locale_h_posix2001=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5
-$as_echo "$gl_cv_header_inttypes_h" >&6; }
-  if test $gl_cv_header_inttypes_h = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define HAVE_INTTYPES_H_WITH_UINTMAX 1
-_ACEOF
-
-  fi
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5
+printf "%s\n" "$gl_cv_header_locale_h_posix2001" >&6; }
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5
-$as_echo_n "checking for stdint.h... " >&6; }
-if ${gl_cv_header_stdint_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5
+printf %s "checking whether struct lconv is properly defined... " >&6; }
+if test ${gl_cv_sys_struct_lconv_ok+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-            #include <stdint.h>
+#include <locale.h>
+            struct lconv l;
+            int x = sizeof (l.decimal_point);
+            int y = sizeof (l.int_p_cs_precedes);
 int
-main ()
+main (void)
 {
-uintmax_t i = (uintmax_t) -1; return !i;
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_stdint_h=yes
-else
-  gl_cv_header_stdint_h=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_sys_struct_lconv_ok=yes
+else $as_nop
+  gl_cv_sys_struct_lconv_ok=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5
-$as_echo "$gl_cv_header_stdint_h" >&6; }
-  if test $gl_cv_header_stdint_h = yes; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5
+printf "%s\n" "$gl_cv_sys_struct_lconv_ok" >&6; }
+  if test $gl_cv_sys_struct_lconv_ok = no; then
+            case "$host_os" in
+      mingw*)
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef _MSC_VER
+ Special
+#endif
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H_WITH_UINTMAX 1
 _ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Special" >/dev/null 2>&1
+then :
 
+else $as_nop
+  REPLACE_STRUCT_LCONV=1
+fi
+rm -rf conftest*
+
+        ;;
+      *) REPLACE_STRUCT_LCONV=1 ;;
+    esac
   fi
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5
-$as_echo_n "checking for intmax_t... " >&6; }
-if ${gt_cv_c_intmax_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_locale_h='<'locale.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5
+printf %s "checking absolute name of <locale.h>... " >&6; }
+if test ${gl_cv_next_locale_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+
+
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <locale.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'locale.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_locale_h
+           gl_cv_next_locale_h='"'$gl_header'"'
 
-#include <stddef.h>
-#include <stdlib.h>
-#if HAVE_STDINT_H_WITH_UINTMAX
-#include <stdint.h>
-#endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-#include <inttypes.h>
-#endif
 
-int
-main ()
-{
-intmax_t x = -1; return !x;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_c_intmax_t=yes
-else
-  gt_cv_c_intmax_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5
-$as_echo "$gt_cv_c_intmax_t" >&6; }
-  if test $gt_cv_c_intmax_t = yes; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5
+printf "%s\n" "$gl_cv_next_locale_h" >&6; }
+     fi
+     NEXT_LOCALE_H=$gl_cv_next_locale_h
 
-$as_echo "#define HAVE_INTMAX_T 1" >>confdefs.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='<'locale.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_locale_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive
 
-  else
 
-    test $ac_cv_type_long_long_int = yes \
-      && ac_type='long long' \
-      || ac_type='long'
 
-cat >>confdefs.h <<_ACEOF
-#define intmax_t $ac_type
-_ACEOF
 
-  fi
 
 
 
 
 
+  GL_M4_GNULIB_LOCALECONV=0
 
-  for ac_func in snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
-fi
-done
 
-      ac_fn_c_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h>
-"
-if test "x$ac_cv_have_decl__snprintf" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+  GL_M4_GNULIB_SETLOCALE=0
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL__SNPRINTF $ac_have_decl
-_ACEOF
 
 
+  GL_M4_GNULIB_SETLOCALE_NULL=0
 
-  case "$gl_cv_func_snprintf_retval_c99" in
-    *yes)
 
-$as_echo "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h
 
-      ;;
-  esac
+  GL_M4_GNULIB_DUPLOCALE=0
 
 
 
+  GL_M4_GNULIB_LOCALENAME=0
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports size specifiers as in C99" >&5
-$as_echo_n "checking whether printf supports size specifiers as in C99... " >&6; }
-if ${gl_cv_func_printf_sizes_c99+:} false; 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_printf_sizes_c99="guessing yes";;
-                                 # Guess yes on FreeBSD >= 5.
-           freebsd[1-4].*)       gl_cv_func_printf_sizes_c99="guessing no";;
-           freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
-                                 # Guess yes on Mac OS X >= 10.3.
-           darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
-           darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
-                                 # Guess yes on OpenBSD >= 3.9.
-           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
-                                 gl_cv_func_printf_sizes_c99="guessing no";;
-           openbsd*)             gl_cv_func_printf_sizes_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 NetBSD >= 3.
-           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                                 gl_cv_func_printf_sizes_c99="guessing no";;
-           netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_printf_sizes_c99="guessing no";;
-         esac
-
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
+printf %s "checking for LC_MESSAGES... " >&6; }
+if test ${gt_cv_val_LC_MESSAGES+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#if HAVE_STDINT_H_WITH_UINTMAX
-# include <stdint.h>
-#endif
-#if HAVE_INTTYPES_H_WITH_UINTMAX
-# include <inttypes.h>
-#endif
-static char buf[100];
-int main ()
+#include <locale.h>
+int
+main (void)
 {
-  int result = 0;
-#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
-  buf[0] = '\0';
-  if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
-      || strcmp (buf, "12345671 33") != 0)
-    result |= 1;
-#else
-  result |= 1;
-#endif
-  buf[0] = '\0';
-  if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
-      || strcmp (buf, "12345672 33") != 0)
-    result |= 2;
-  buf[0] = '\0';
-  if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
-      || strcmp (buf, "12345673 33") != 0)
-    result |= 4;
-  buf[0] = '\0';
-  if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
-      || strcmp (buf, "1.5 33") != 0)
-    result |= 8;
-  return result;
+return LC_MESSAGES
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_sizes_c99=yes
-else
-  gl_cv_func_printf_sizes_c99=no
+if ac_fn_c_try_link "$LINENO"
+then :
+  gt_cv_val_LC_MESSAGES=yes
+else $as_nop
+  gt_cv_val_LC_MESSAGES=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_val_LC_MESSAGES" >&5
+printf "%s\n" "$gt_cv_val_LC_MESSAGES" >&6; }
+  if test $gt_cv_val_LC_MESSAGES = yes; then
 
+printf "%s\n" "#define HAVE_LC_MESSAGES 1" >>confdefs.h
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_sizes_c99" >&5
-$as_echo "$gl_cv_func_printf_sizes_c99" >&6; }
+  fi
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports 'long double' arguments" >&5
-$as_echo_n "checking whether printf supports 'long double' arguments... " >&6; }
-if ${gl_cv_func_printf_long_double+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
 
-         case "$host_os" in
-           beos*)        gl_cv_func_printf_long_double="guessing no";;
-           mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
-           *)            gl_cv_func_printf_long_double="guessing yes";;
-         esac
 
-else
+
+
+
+
+
+
+
+          if test $ac_cv_func_uselocale = yes; then
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether uselocale works" >&5
+printf %s "checking whether uselocale works... " >&6; }
+if test ${gt_cv_func_uselocale_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  # Guess no on AIX and z/OS, yes otherwise.
+          case "$host_os" in
+            aix* | openedition*) gt_cv_func_uselocale_works="guessing no" ;;
+            *)                   gt_cv_func_uselocale_works="guessing yes" ;;
+          esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdio.h>
-#include <string.h>
-static char buf[10000];
+#include <locale.h>
+#if HAVE_XLOCALE_H
+# include <xlocale.h>
+#endif
+locale_t loc1;
 int main ()
 {
-  int result = 0;
-  buf[0] = '\0';
-  if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
-      || strcmp (buf, "1.750000 33") != 0)
-    result |= 1;
-  buf[0] = '\0';
-  if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
-      || strcmp (buf, "1.750000e+00 33") != 0)
-    result |= 2;
-  buf[0] = '\0';
-  if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
-      || strcmp (buf, "1.75 33") != 0)
-    result |= 4;
-  return result;
+  uselocale (NULL);
+  setlocale (LC_ALL, "en_US.UTF-8");
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_long_double=yes
-else
-  gl_cv_func_printf_long_double=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gt_cv_func_uselocale_works=yes
+else $as_nop
+  gt_cv_func_uselocale_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_long_double" >&5
-$as_echo "$gl_cv_func_printf_long_double" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_uselocale_works" >&5
+printf "%s\n" "$gt_cv_func_uselocale_works" >&6; }
+  else
+    gt_cv_func_uselocale_works=no
+  fi
+  case "$gt_cv_func_uselocale_works" in
+    *yes)
+      gt_working_uselocale=yes
 
+printf "%s\n" "#define HAVE_WORKING_USELOCALE 1" >>confdefs.h
 
+      ;;
+    *)
+      gt_working_uselocale=no
+      ;;
+  esac
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'double' arguments" >&5
-$as_echo_n "checking whether printf supports infinite 'double' arguments... " >&6; }
-if ${gl_cv_func_printf_infinite+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
+                            case "$gt_cv_func_uselocale_works" in
+    *yes)
 
-         case "$host_os" in
-                                 # Guess yes on glibc systems.
-           *-gnu*)               gl_cv_func_printf_infinite="guessing yes";;
-                                 # Guess yes on FreeBSD >= 6.
-           freebsd[1-5].*)       gl_cv_func_printf_infinite="guessing no";;
-           freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
-                                 # Guess yes on Mac OS X >= 10.3.
-           darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
-           darwin*)              gl_cv_func_printf_infinite="guessing yes";;
-                                 # Guess yes on HP-UX >= 11.
-           hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
-           hpux*)                gl_cv_func_printf_infinite="guessing yes";;
-                                 # Guess yes on NetBSD >= 3.
-           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
-                                 gl_cv_func_printf_infinite="guessing no";;
-           netbsd*)              gl_cv_func_printf_infinite="guessing yes";;
-                                 # Guess yes on BeOS.
-           beos*)                gl_cv_func_printf_infinite="guessing yes";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_printf_infinite="guessing no";;
-         esac
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fake locale system (OpenBSD)" >&5
+printf %s "checking for fake locale system (OpenBSD)... " >&6; }
+if test ${gt_cv_locale_fake+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+              case "$host_os" in
+              openbsd*) gt_cv_locale_fake="guessing yes" ;;
+              *)        gt_cv_locale_fake="guessing no" ;;
+            esac
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdio.h>
-#include <string.h>
-static int
-strisnan (const char *string, size_t start_index, size_t end_index)
-{
-  if (start_index < end_index)
-    {
-      if (string[start_index] == '-')
-        start_index++;
-      if (start_index + 3 <= end_index
-          && memcmp (string + start_index, "nan", 3) == 0)
-        {
-          start_index += 3;
-          if (start_index == end_index
-              || (string[start_index] == '(' && string[end_index - 1] == ')'))
-            return 1;
-        }
-    }
-  return 0;
-}
-static int
-have_minus_zero ()
-{
-  static double plus_zero = 0.0;
-  double minus_zero = - plus_zero;
-  return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0;
-}
-static char buf[10000];
-static double zero = 0.0;
+#include <locale.h>
+#if HAVE_XLOCALE_H
+# include <xlocale.h>
+#endif
 int main ()
 {
-  int result = 0;
-  if (sprintf (buf, "%f", 1.0 / zero) < 0
-      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    result |= 1;
-  if (sprintf (buf, "%f", -1.0 / zero) < 0
-      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    result |= 1;
-  if (sprintf (buf, "%f", zero / zero) < 0
-      || !strisnan (buf, 0, strlen (buf)))
-    result |= 2;
-  if (sprintf (buf, "%e", 1.0 / zero) < 0
-      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    result |= 4;
-  if (sprintf (buf, "%e", -1.0 / zero) < 0
-      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    result |= 4;
-  if (sprintf (buf, "%e", zero / zero) < 0
-      || !strisnan (buf, 0, strlen (buf)))
-    result |= 8;
-  if (sprintf (buf, "%g", 1.0 / zero) < 0
-      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    result |= 16;
-  if (sprintf (buf, "%g", -1.0 / zero) < 0
-      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    result |= 16;
-  if (sprintf (buf, "%g", zero / zero) < 0
-      || !strisnan (buf, 0, strlen (buf)))
-    result |= 32;
-  /* This test fails on HP-UX 10.20.  */
-  if (have_minus_zero ())
-    if (sprintf (buf, "%g", - zero) < 0
-        || strcmp (buf, "-0") != 0)
-    result |= 64;
-  return result;
+  locale_t loc1, loc2;
+  if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL) return 1;
+  if (setlocale (LC_ALL, "fr_FR.UTF-8") == NULL) return 1;
+  loc1 = newlocale (LC_ALL_MASK, "de_DE.UTF-8", (locale_t)0);
+  loc2 = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", (locale_t)0);
+  return !(loc1 == loc2);
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_infinite=yes
-else
-  gl_cv_func_printf_infinite=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gt_cv_locale_fake=yes
+else $as_nop
+  gt_cv_locale_fake=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite" >&5
-$as_echo "$gl_cv_func_printf_infinite" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fake" >&5
+printf "%s\n" "$gt_cv_locale_fake" >&6; }
+      ;;
+    *) gt_cv_locale_fake=no ;;
+  esac
+  case "$gt_cv_locale_fake" in
+    *yes)
+      gt_fake_locales=yes
 
+printf "%s\n" "#define HAVE_FAKE_LOCALES 1" >>confdefs.h
 
+      ;;
+    *)
+      gt_fake_locales=no
+      ;;
+  esac
 
+  case "$gt_cv_func_uselocale_works" in
+    *yes)
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Solaris 11.4 locale system" >&5
+printf %s "checking for Solaris 11.4 locale system... " >&6; }
+if test ${gt_cv_locale_solaris114+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  case "$host_os" in
+           solaris*)
+                                                                                           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+                  #include <locale.h>
+                  struct _LC_locale_t *x;
+                  locale_t y;
 
+int
+main (void)
+{
+*y = x;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gt_cv_locale_solaris114=yes
+else $as_nop
+  gt_cv_locale_solaris114=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+             ;;
+           *) gt_cv_locale_solaris114=no ;;
+         esac
 
-         if test -n "$gl_printf_safe"; then
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_solaris114" >&5
+printf "%s\n" "$gt_cv_locale_solaris114" >&6; }
+      ;;
+    *) gt_cv_locale_solaris114=no ;;
+  esac
+  if test $gt_cv_locale_solaris114 = yes; then
 
-$as_echo "#define CHECK_PRINTF_SAFE 1" >>confdefs.h
+printf "%s\n" "#define HAVE_SOLARIS114_LOCALES 1" >>confdefs.h
 
   fi
-  case "$gl_cv_func_printf_long_double" in
+
+        case "$gt_cv_func_uselocale_works" in
     *yes)
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'long double' arguments" >&5
-$as_echo_n "checking whether printf supports infinite 'long double' arguments... " >&6; }
-if ${gl_cv_func_printf_infinite_long_double+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+      ac_fn_c_check_func "$LINENO" "getlocalename_l" "ac_cv_func_getlocalename_l"
+if test "x$ac_cv_func_getlocalename_l" = xyes
+then :
+  printf "%s\n" "#define HAVE_GETLOCALENAME_L 1" >>confdefs.h
 
-          if test "$cross_compiling" = yes; then :
+fi
 
-             case "$host_cpu" in
-                                     # Guess no on ia64, x86_64, i386.
-               ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
-               *)
-                 case "$host_os" in
-                                         # Guess yes on glibc systems.
-                   *-gnu*)               gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                         # Guess yes on FreeBSD >= 6.
-                   freebsd[1-5].*)       gl_cv_func_printf_infinite_long_double="guessing no";;
-                   freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                         # Guess yes on HP-UX >= 11.
-                   hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
-                   hpux*)                gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                         # If we don't know, assume the worst.
-                   *)                    gl_cv_func_printf_infinite_long_double="guessing no";;
-                 esac
-                 ;;
-             esac
+      ;;
+  esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+            gt_nameless_locales=no
+  case "$host_os" in
+        aix*)
+      gt_nameless_locales=yes
 
+printf "%s\n" "#define HAVE_NAMELESS_LOCALES 1" >>confdefs.h
 
-#include <stdlib.h>
-#if defined __MACH__ && defined __APPLE__
-/* Avoid a crash on Mac OS X.  */
-#include <mach/mach.h>
-#include <mach/mach_error.h>
-#include <mach/thread_status.h>
-#include <mach/exception.h>
-#include <mach/task.h>
-#include <pthread.h>
-/* The exception port on which our thread listens.  */
-static mach_port_t our_exception_port;
-/* The main function of the thread listening for exceptions of type
-   EXC_BAD_ACCESS.  */
-static void *
-mach_exception_thread (void *arg)
-{
-  /* Buffer for a message to be received.  */
-  struct {
-    mach_msg_header_t head;
-    mach_msg_body_t msgh_body;
-    char data[1024];
-  } msg;
-  mach_msg_return_t retval;
-  /* Wait for a message on the exception port.  */
-  retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
-                     our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
-  if (retval != MACH_MSG_SUCCESS)
-    abort ();
-  exit (1);
-}
-static void
-nocrash_init (void)
+      ;;
+  esac
+
+        if test $gt_working_uselocale = yes && test $gt_fake_locales = no; then
+    gt_good_uselocale=yes
+
+printf "%s\n" "#define HAVE_GOOD_USELOCALE 1" >>confdefs.h
+
+  else
+    gt_good_uselocale=no
+  fi
+
+        if test $gt_good_uselocale = yes && test $gt_nameless_locales = yes; then
+    gt_localename_enhances_locale_funcs=yes
+    LOCALENAME_ENHANCE_LOCALE_FUNCS=1
+
+printf "%s\n" "#define LOCALENAME_ENHANCE_LOCALE_FUNCS 1" >>confdefs.h
+
+  else
+    gt_localename_enhances_locale_funcs=no
+  fi
+
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
+printf %s "checking for CFPreferencesCopyAppValue... " >&6; }
+if test ${gt_cv_func_CFPreferencesCopyAppValue+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <CoreFoundation/CFPreferences.h>
+int
+main (void)
 {
-  mach_port_t self = mach_task_self ();
-  /* Allocate a port on which the thread shall listen for exceptions.  */
-  if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
-      == KERN_SUCCESS) {
-    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
-    if (mach_port_insert_right (self, our_exception_port, our_exception_port,
-                                MACH_MSG_TYPE_MAKE_SEND)
-        == KERN_SUCCESS) {
-      /* The exceptions we want to catch.  Only EXC_BAD_ACCESS is interesting
-         for us.  */
-      exception_mask_t mask = EXC_MASK_BAD_ACCESS;
-      /* Create the thread listening on the exception port.  */
-      pthread_attr_t attr;
-      pthread_t thread;
-      if (pthread_attr_init (&attr) == 0
-          && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
-          && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
-        pthread_attr_destroy (&attr);
-        /* Replace the exception port info for these exceptions with our own.
-           Note that we replace the exception port for the entire task, not only
-           for a particular thread.  This has the effect that when our exception
-           port gets the message, the thread specific exception port has already
-           been asked, and we don't need to bother about it.
-           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
-        task_set_exception_ports (self, mask, our_exception_port,
-                                  EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
-      }
-    }
-  }
+CFPreferencesCopyAppValue(NULL, NULL)
+  ;
+  return 0;
 }
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Avoid a crash on native Windows.  */
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winerror.h>
-static LONG WINAPI
-exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gt_cv_func_CFPreferencesCopyAppValue=yes
+else $as_nop
+  gt_cv_func_CFPreferencesCopyAppValue=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+     LIBS="$gt_save_LIBS"
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
+printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+
+printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
+
+  fi
+                    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5
+printf %s "checking for CFLocaleCopyPreferredLanguages... " >&6; }
+if test ${gt_cv_func_CFLocaleCopyPreferredLanguages+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <CoreFoundation/CFLocale.h>
+int
+main (void)
 {
-  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
-    {
-    case EXCEPTION_ACCESS_VIOLATION:
-    case EXCEPTION_IN_PAGE_ERROR:
-    case EXCEPTION_STACK_OVERFLOW:
-    case EXCEPTION_GUARD_PAGE:
-    case EXCEPTION_PRIV_INSTRUCTION:
-    case EXCEPTION_ILLEGAL_INSTRUCTION:
-    case EXCEPTION_DATATYPE_MISALIGNMENT:
-    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
-    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
-      exit (1);
-    }
-  return EXCEPTION_CONTINUE_SEARCH;
+CFLocaleCopyPreferredLanguages();
+  ;
+  return 0;
 }
-static void
-nocrash_init (void)
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gt_cv_func_CFLocaleCopyPreferredLanguages=yes
+else $as_nop
+  gt_cv_func_CFLocaleCopyPreferredLanguages=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+     LIBS="$gt_save_LIBS"
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5
+printf "%s\n" "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; }
+  if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+
+printf "%s\n" "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h
+
+  fi
+  INTL_MACOSX_LIBS=
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+     || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+  fi
+
+
+
+
+
+
+
+  gl_threads_api=none
+  LIBTHREAD=
+  LTLIBTHREAD=
+  LIBMULTITHREAD=
+  LTLIBMULTITHREAD=
+  if test "$gl_use_threads" != no; then
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
+printf %s "checking whether imported symbols can be declared weak... " >&6; }
+if test ${gl_cv_have_weak+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_cv_have_weak=no
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern void xyzzy ();
+#pragma weak xyzzy
+int
+main (void)
 {
-  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+xyzzy();
+  ;
+  return 0;
 }
-#else
-/* Avoid a crash on POSIX systems.  */
-#include <signal.h>
-#include <unistd.h>
-/* A POSIX signal handler.  */
-static void
-exception_handler (int sig)
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_have_weak=maybe
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+     if test $gl_cv_have_weak = maybe; then
+                     if test "$cross_compiling" = yes
+then :
+                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __ELF__
+             Extensible Linking Format
+             #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Extensible Linking Format" >/dev/null 2>&1
+then :
+  gl_cv_have_weak="guessing yes"
+else $as_nop
+  gl_cv_have_weak="guessing no"
+fi
+rm -rf conftest*
+
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#pragma weak fputs
+int main ()
 {
-  _exit (1);
+  return (fputs == NULL);
 }
-static void
-nocrash_init (void)
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_have_weak=yes
+else $as_nop
+  gl_cv_have_weak=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+     fi
+          case " $LDFLAGS " in
+       *" -static "*) gl_cv_have_weak=no ;;
+     esac
+                    case "$gl_cv_have_weak" in
+       *yes)
+         case "$host_os" in
+           freebsd* | dragonfly* | midnightbsd*)
+             : > conftest1.c
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
+             cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
 {
-#ifdef SIGSEGV
-  signal (SIGSEGV, exception_handler);
-#endif
-#ifdef SIGBUS
-  signal (SIGBUS, exception_handler);
-#endif
+  return (pthread_mutexattr_gettype != NULL);
 }
-#endif
+EOF
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
+               || gl_cv_have_weak=no
+             rm -f conftest1.c libempty.so conftest2.c conftest
+             ;;
+         esac
+         ;;
+     esac
 
-#include <float.h>
-#include <stdio.h>
-#include <string.h>
-static int
-strisnan (const char *string, size_t start_index, size_t end_index)
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
+printf "%s\n" "$gl_cv_have_weak" >&6; }
+  case "$gl_cv_have_weak" in
+    *yes)
+
+printf "%s\n" "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
+
+      ;;
+  esac
+
+    if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+
+      :
+    fi
+    if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
+
+      gl_have_isoc_threads="$ac_cv_header_threads_h"
+    fi
+    if test "$gl_use_threads" = yes \
+       || test "$gl_use_threads" = posix \
+       || test "$gl_use_threads" = isoc+posix; then
+
+
+  if test -z "$gl_pthreadlib_body_done"; then
+    gl_pthread_api=no
+    LIBPTHREAD=
+    LIBPMULTITHREAD=
+    # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+    # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+    ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes
+then :
+  gl_have_pthread_h=yes
+else $as_nop
+  gl_have_pthread_h=no
+fi
+
+    if test "$gl_have_pthread_h" = yes; then
+      # Other possible tests:
+      #   -lpthreads (FSU threads, PCthreads)
+      #   -lgthreads
+      # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+      # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+      # the second one only in libpthread, and lock.c needs it.
+      #
+      # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+      # needs -pthread for some reason.  See:
+      # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+      save_LIBS=$LIBS
+      for gl_pthread in '' '-pthread'; do
+        LIBS="$LIBS $gl_pthread"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+               pthread_mutex_t m;
+               pthread_mutexattr_t ma;
+
+int
+main (void)
 {
-  if (start_index < end_index)
-    {
-      if (string[start_index] == '-')
-        start_index++;
-      if (start_index + 3 <= end_index
-          && memcmp (string + start_index, "nan", 3) == 0)
-        {
-          start_index += 3;
-          if (start_index == end_index
-              || (string[start_index] == '(' && string[end_index - 1] == ')'))
-            return 1;
-        }
-    }
+pthread_mutex_lock (&m);
+               pthread_mutexattr_init (&ma);
+  ;
   return 0;
 }
-static char buf[10000];
-static long double zeroL = 0.0L;
-int main ()
-{
-  int result = 0;
-  nocrash_init();
-  if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0
-      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    result |= 1;
-  if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0
-      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    result |= 1;
-  if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
-      || !strisnan (buf, 0, strlen (buf)))
-    result |= 1;
-  if (sprintf (buf, "%Le", 1.0L / zeroL) < 0
-      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    result |= 1;
-  if (sprintf (buf, "%Le", -1.0L / zeroL) < 0
-      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    result |= 1;
-  if (sprintf (buf, "%Le", zeroL / zeroL) < 0
-      || !strisnan (buf, 0, strlen (buf)))
-    result |= 1;
-  if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0
-      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
-    result |= 1;
-  if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0
-      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
-    result |= 1;
-  if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
-      || !strisnan (buf, 0, strlen (buf)))
-    result |= 1;
-#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
-/* Representation of an 80-bit 'long double' as an initializer for a sequence
-   of 'unsigned int' words.  */
-# ifdef WORDS_BIGENDIAN
-#  define LDBL80_WORDS(exponent,manthi,mantlo) \
-     { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
-       ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16),   \
-       (unsigned int) (mantlo) << 16                                        \
-     }
-# else
-#  define LDBL80_WORDS(exponent,manthi,mantlo) \
-     { mantlo, manthi, exponent }
-# endif
-  { /* Quiet NaN.  */
-    static union { unsigned int word[4]; long double value; } x =
-      { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
-    if (sprintf (buf, "%Lf", x.value) < 0
-        || !strisnan (buf, 0, strlen (buf)))
-      result |= 2;
-    if (sprintf (buf, "%Le", x.value) < 0
-        || !strisnan (buf, 0, strlen (buf)))
-      result |= 2;
-    if (sprintf (buf, "%Lg", x.value) < 0
-        || !strisnan (buf, 0, strlen (buf)))
-      result |= 2;
-  }
-  {
-    /* Signalling NaN.  */
-    static union { unsigned int word[4]; long double value; } x =
-      { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
-    if (sprintf (buf, "%Lf", x.value) < 0
-        || !strisnan (buf, 0, strlen (buf)))
-      result |= 2;
-    if (sprintf (buf, "%Le", x.value) < 0
-        || !strisnan (buf, 0, strlen (buf)))
-      result |= 2;
-    if (sprintf (buf, "%Lg", x.value) < 0
-        || !strisnan (buf, 0, strlen (buf)))
-      result |= 2;
-  }
-  { /* Pseudo-NaN.  */
-    static union { unsigned int word[4]; long double value; } x =
-      { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
-    if (sprintf (buf, "%Lf", x.value) <= 0)
-      result |= 4;
-    if (sprintf (buf, "%Le", x.value) <= 0)
-      result |= 4;
-    if (sprintf (buf, "%Lg", x.value) <= 0)
-      result |= 4;
-  }
-  { /* Pseudo-Infinity.  */
-    static union { unsigned int word[4]; long double value; } x =
-      { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
-    if (sprintf (buf, "%Lf", x.value) <= 0)
-      result |= 8;
-    if (sprintf (buf, "%Le", x.value) <= 0)
-      result |= 8;
-    if (sprintf (buf, "%Lg", x.value) <= 0)
-      result |= 8;
-  }
-  { /* Pseudo-Zero.  */
-    static union { unsigned int word[4]; long double value; } x =
-      { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
-    if (sprintf (buf, "%Lf", x.value) <= 0)
-      result |= 16;
-    if (sprintf (buf, "%Le", x.value) <= 0)
-      result |= 16;
-    if (sprintf (buf, "%Lg", x.value) <= 0)
-      result |= 16;
-  }
-  { /* Unnormalized number.  */
-    static union { unsigned int word[4]; long double value; } x =
-      { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
-    if (sprintf (buf, "%Lf", x.value) <= 0)
-      result |= 32;
-    if (sprintf (buf, "%Le", x.value) <= 0)
-      result |= 32;
-    if (sprintf (buf, "%Lg", x.value) <= 0)
-      result |= 32;
-  }
-  { /* Pseudo-Denormal.  */
-    static union { unsigned int word[4]; long double value; } x =
-      { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
-    if (sprintf (buf, "%Lf", x.value) <= 0)
-      result |= 64;
-    if (sprintf (buf, "%Le", x.value) <= 0)
-      result |= 64;
-    if (sprintf (buf, "%Lg", x.value) <= 0)
-      result |= 64;
-  }
-#endif
-  return result;
-}
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_infinite_long_double=yes
-else
-  gl_cv_func_printf_infinite_long_double=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_pthread_api=yes
+           LIBPTHREAD=$gl_pthread
+           LIBPMULTITHREAD=$gl_pthread
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+        LIBS=$save_LIBS
+        test $gl_pthread_api = yes && break
+      done
 
+      # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+      # since it is defined as a macro on OSF/1.)
+      if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+        # The program links fine without libpthread. But it may actually
+        # need to link with libpthread in order to create multiple threads.
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+printf %s "checking for pthread_kill in -lpthread... " >&6; }
+if test ${ac_cv_lib_pthread_pthread_kill+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main (void)
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_pthread_pthread_kill=yes
+else $as_nop
+  ac_cv_lib_pthread_pthread_kill=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite_long_double" >&5
-$as_echo "$gl_cv_func_printf_infinite_long_double" >&6; }
-      ;;
-    *)
-      gl_cv_func_printf_infinite_long_double="irrelevant"
-      ;;
-  esac
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+printf "%s\n" "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes
+then :
+  LIBPMULTITHREAD=-lpthread
+           # On Solaris and HP-UX, most pthread functions exist also in libc.
+           # Therefore pthread_in_use() needs to actually try to create a
+           # thread: pthread_create from libc will fail, whereas
+           # pthread_create will actually create a thread.
+           # On Solaris 10 or newer, this test is no longer needed, because
+           # libc contains the fully functional pthread functions.
+           case "$host_os" in
+             solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
 
+printf "%s\n" "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'a' and 'A' directives" >&5
-$as_echo_n "checking whether printf supports the 'a' and 'A' directives... " >&6; }
-if ${gl_cv_func_printf_directive_a+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+           esac
 
-      if test "$cross_compiling" = yes; then :
+fi
 
-         case "$host_os" in
-                                 # Guess yes on glibc >= 2.5 systems.
-           *-gnu*)
-             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      elif test $gl_pthread_api != yes; then
+        # Some library is needed. Try libpthread and libc_r.
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+printf %s "checking for pthread_kill in -lpthread... " >&6; }
+if test ${ac_cv_lib_pthread_pthread_kill+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-               #include <features.h>
-               #ifdef __GNU_LIBRARY__
-                #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__
-                 BZ2908
-                #endif
-               #endif
-
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main (void)
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "BZ2908" >/dev/null 2>&1; then :
-  gl_cv_func_printf_directive_a="guessing yes"
-else
-  gl_cv_func_printf_directive_a="guessing no"
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_pthread_pthread_kill=yes
+else $as_nop
+  ac_cv_lib_pthread_pthread_kill=no
 fi
-rm -f conftest*
-
-             ;;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_printf_directive_a="guessing no";;
-         esac
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+printf "%s\n" "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes
+then :
+  gl_pthread_api=yes
+           LIBPTHREAD=-lpthread
+           LIBPMULTITHREAD=-lpthread
+fi
+
+        if test $gl_pthread_api != yes; then
+          # For FreeBSD 4.
+          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
+printf %s "checking for pthread_kill in -lc_r... " >&6; }
+if test ${ac_cv_lib_c_r_pthread_kill+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-static double zero = 0.0;
-int main ()
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main (void)
 {
-  int result = 0;
-  if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
-      || (strcmp (buf, "0x1.922p+1 33") != 0
-          && strcmp (buf, "0x3.244p+0 33") != 0
-          && strcmp (buf, "0x6.488p-1 33") != 0
-          && strcmp (buf, "0xc.91p-2 33") != 0))
-    result |= 1;
-  if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
-      || (strcmp (buf, "-0X1.922P+1 33") != 0
-          && strcmp (buf, "-0X3.244P+0 33") != 0
-          && strcmp (buf, "-0X6.488P-1 33") != 0
-          && strcmp (buf, "-0XC.91P-2 33") != 0))
-    result |= 2;
-  /* This catches a FreeBSD 6.1 bug: it doesn't round.  */
-  if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
-      || (strcmp (buf, "0x1.83p+0 33") != 0
-          && strcmp (buf, "0x3.05p-1 33") != 0
-          && strcmp (buf, "0x6.0ap-2 33") != 0
-          && strcmp (buf, "0xc.14p-3 33") != 0))
-    result |= 4;
-  /* This catches a FreeBSD 6.1 bug.  See
-     <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
-  if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
-      || buf[0] == '0')
-    result |= 8;
-  /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug.  */
-  if (sprintf (buf, "%.1a", 1.999) < 0
-      || (strcmp (buf, "0x1.0p+1") != 0
-          && strcmp (buf, "0x2.0p+0") != 0
-          && strcmp (buf, "0x4.0p-1") != 0
-          && strcmp (buf, "0x8.0p-2") != 0))
-    result |= 16;
-  /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
-     glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
-  if (sprintf (buf, "%.1La", 1.999L) < 0
-      || (strcmp (buf, "0x1.0p+1") != 0
-          && strcmp (buf, "0x2.0p+0") != 0
-          && strcmp (buf, "0x4.0p-1") != 0
-          && strcmp (buf, "0x8.0p-2") != 0))
-    result |= 32;
-  return result;
+return pthread_kill ();
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_directive_a=yes
-else
-  gl_cv_func_printf_directive_a=no
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_c_r_pthread_kill=yes
+else $as_nop
+  ac_cv_lib_c_r_pthread_kill=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
+printf "%s\n" "$ac_cv_lib_c_r_pthread_kill" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_kill" = xyes
+then :
+  gl_pthread_api=yes
+             LIBPTHREAD=-lc_r
+             LIBPMULTITHREAD=-lc_r
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_a" >&5
-$as_echo "$gl_cv_func_printf_directive_a" >&6; }
 
+        fi
+      fi
+    fi
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
+printf %s "checking whether POSIX threads API is available... " >&6; }
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
+printf "%s\n" "$gl_pthread_api" >&6; }
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'F' directive" >&5
-$as_echo_n "checking whether printf supports the 'F' directive... " >&6; }
-if ${gl_cv_func_printf_directive_f+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+    if test $gl_pthread_api = yes; then
 
-      if test "$cross_compiling" = yes; then :
+printf "%s\n" "#define HAVE_PTHREAD_API 1" >>confdefs.h
 
-         case "$host_os" in
-                                 # Guess yes on glibc systems.
-           *-gnu*)               gl_cv_func_printf_directive_f="guessing yes";;
-                                 # Guess yes on FreeBSD >= 6.
-           freebsd[1-5].*)       gl_cv_func_printf_directive_f="guessing no";;
-           freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
-                                 # Guess yes on Mac OS X >= 10.3.
-           darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
-           darwin*)              gl_cv_func_printf_directive_f="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";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_printf_directive_f="guessing no";;
-         esac
+    fi
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-static double zero = 0.0;
-int main ()
+#include <sched.h>
+int
+main (void)
 {
-  int result = 0;
-  if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
-      || strcmp (buf, "1234567.000000 33") != 0)
-    result |= 1;
-  if (sprintf (buf, "%F", 1.0 / zero) < 0
-      || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
-    result |= 2;
-  /* This catches a Cygwin 1.5.x bug.  */
-  if (sprintf (buf, "%.F", 1234.0) < 0
-      || strcmp (buf, "1234") != 0)
-    result |= 4;
-  return result;
+sched_yield ();
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_directive_f=yes
-else
-  gl_cv_func_printf_directive_f=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_f" >&5
-$as_echo "$gl_cv_func_printf_directive_f" >&6; }
+if ac_fn_c_try_link "$LINENO"
+then :
+  LIB_SCHED_YIELD=
 
-
-
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'n' directive" >&5
-$as_echo_n "checking whether printf supports the 'n' directive... " >&6; }
-if ${gl_cv_func_printf_directive_n+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      if test "$cross_compiling" = yes; then :
-
-         case "$host_os" in
-           mingw*) gl_cv_func_printf_directive_n="guessing no";;
-           *)      gl_cv_func_printf_directive_n="guessing yes";;
-         esac
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else $as_nop
+         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+printf %s "checking for sched_yield in -lrt... " >&6; }
+if test ${ac_cv_lib_rt_sched_yield+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef _MSC_VER
-/* See page about "Parameter Validation" on msdn.microsoft.com.  */
-static void cdecl
-invalid_parameter_handler (const wchar_t *expression,
-                           const wchar_t *function,
-                           const wchar_t *file, unsigned int line,
-                           uintptr_t dummy)
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char sched_yield ();
+int
+main (void)
 {
-  exit (1);
+return sched_yield ();
+  ;
+  return 0;
 }
-#endif
-static char fmtstring[10];
-static char buf[100];
-int main ()
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_rt_sched_yield=yes
+else $as_nop
+  ac_cv_lib_rt_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+printf "%s\n" "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes
+then :
+  LIB_SCHED_YIELD=-lrt
+else $as_nop
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
+printf %s "checking for sched_yield in -lposix4... " >&6; }
+if test ${ac_cv_lib_posix4_sched_yield+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix4  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char sched_yield ();
+int
+main (void)
 {
-  int count = -1;
-#ifdef _MSC_VER
-  _set_invalid_parameter_handler (invalid_parameter_handler);
-#endif
-  /* Copy the format string.  Some systems (glibc with _FORTIFY_SOURCE=2)
-     support %n in format strings in read-only memory but not in writable
-     memory.  */
-  strcpy (fmtstring, "%d %n");
-  if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
-      || strcmp (buf, "123 ") != 0
-      || count != 4)
-    return 1;
+return sched_yield ();
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_directive_n=yes
-else
-  gl_cv_func_printf_directive_n=no
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_posix4_sched_yield=yes
+else $as_nop
+  ac_cv_lib_posix4_sched_yield=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
+printf "%s\n" "$ac_cv_lib_posix4_sched_yield" >&6; }
+if test "x$ac_cv_lib_posix4_sched_yield" = xyes
+then :
+  LIB_SCHED_YIELD=-lposix4
+fi
+
 fi
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_n" >&5
-$as_echo "$gl_cv_func_printf_directive_n" >&6; }
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
 
+    gl_pthreadlib_body_done=done
+  fi
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'ls' directive" >&5
-$as_echo_n "checking whether printf supports the 'ls' directive... " >&6; }
-if ${gl_cv_func_printf_directive_ls+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+      LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
+      LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
+      if test $gl_pthread_api = yes; then
+        if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
+          gl_threads_api='isoc+posix'
 
-      if test "$cross_compiling" = yes; then :
+printf "%s\n" "#define USE_ISOC_AND_POSIX_THREADS 1" >>confdefs.h
 
-         case "$host_os" in
-           openbsd*)        gl_cv_func_printf_directive_ls="guessing no";;
-           irix*)           gl_cv_func_printf_directive_ls="guessing no";;
-           solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
-           cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
-           beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
-           *)               gl_cv_func_printf_directive_ls="guessing yes";;
-         esac
+          LIBTHREAD= LTLIBTHREAD=
+        else
+          gl_threads_api=posix
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+printf "%s\n" "#define USE_POSIX_THREADS 1" >>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 <string.h>
-int main ()
-{
-  int result = 0;
-  char buf[100];
-  /* Test whether %ls works at all.
-     This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
-     Cygwin 1.5.  */
-  {
-    static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
-    buf[0] = '\0';
-    if (sprintf (buf, "%ls", wstring) < 0
-        || strcmp (buf, "abc") != 0)
-      result |= 1;
-  }
-  /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
-     assertion failure inside libc), but not on OpenBSD 4.0.  */
-  {
-    static const wchar_t wstring[] = { 'a', 0 };
-    buf[0] = '\0';
-    if (sprintf (buf, "%ls", wstring) < 0
-        || strcmp (buf, "a") != 0)
-      result |= 2;
-  }
-  /* Test whether precisions in %ls are supported as specified in ISO C 99
-     section 7.19.6.1:
-       "If a precision is specified, no more than that many bytes are written
-        (including shift sequences, if any), and the array shall contain a
-        null wide character if, to equal the multibyte character sequence
-        length given by the precision, the function would need to access a
-        wide character one past the end of the array."
-     This test fails on Solaris 10.  */
-  {
-    static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 };
-    buf[0] = '\0';
-    if (sprintf (buf, "%.2ls", wstring) < 0
-        || strcmp (buf, "ab") != 0)
-      result |= 8;
-  }
-  return result;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_directive_ls=yes
-else
-  gl_cv_func_printf_directive_ls=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+          if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
+            if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
 
+printf "%s\n" "#define USE_POSIX_THREADS_WEAK 1" >>confdefs.h
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_ls" >&5
-$as_echo "$gl_cv_func_printf_directive_ls" >&6; }
+              LIBTHREAD= LTLIBTHREAD=
+            else
+              case "$host_os" in
+                freebsd* | dragonfly* | midnightbsd*)
+                  if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then
+
+printf "%s\n" "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
 
+                  fi
+                  ;;
+              esac
+            fi
+          fi
+        fi
+      fi
+    fi
+    if test $gl_threads_api = none; then
+      if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the grouping flag" >&5
-$as_echo_n "checking whether printf supports the grouping flag... " >&6; }
-if ${gl_cv_func_printf_flag_grouping+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
+  if test -z "$gl_stdthreadlib_body_done"; then
 
-         case "$host_os" in
-           cygwin*)      gl_cv_func_printf_flag_grouping="guessing no";;
-           netbsd*)      gl_cv_func_printf_flag_grouping="guessing no";;
-           mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
-           *)            gl_cv_func_printf_flag_grouping="guessing yes";;
-         esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+    case "$host_os" in
+      mingw*)
+        LIBSTDTHREAD=
+        ;;
+      *)
+
+
+  if test -z "$gl_pthreadlib_body_done"; then
+    gl_pthread_api=no
+    LIBPTHREAD=
+    LIBPMULTITHREAD=
+    # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+    # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+    ac_fn_c_check_header_compile "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes
+then :
+  gl_have_pthread_h=yes
+else $as_nop
+  gl_have_pthread_h=no
+fi
+
+    if test "$gl_have_pthread_h" = yes; then
+      # Other possible tests:
+      #   -lpthreads (FSU threads, PCthreads)
+      #   -lgthreads
+      # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+      # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+      # the second one only in libpthread, and lock.c needs it.
+      #
+      # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+      # needs -pthread for some reason.  See:
+      # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+      save_LIBS=$LIBS
+      for gl_pthread in '' '-pthread'; do
+        LIBS="$LIBS $gl_pthread"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <pthread.h>
+               pthread_mutex_t m;
+               pthread_mutexattr_t ma;
 
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-int main ()
+int
+main (void)
 {
-  if (sprintf (buf, "%'d %d", 1234567, 99) < 0
-      || buf[strlen (buf) - 1] != '9')
-    return 1;
+pthread_mutex_lock (&m);
+               pthread_mutexattr_init (&ma);
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_flag_grouping=yes
-else
-  gl_cv_func_printf_flag_grouping=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_pthread_api=yes
+           LIBPTHREAD=$gl_pthread
+           LIBPMULTITHREAD=$gl_pthread
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+        LIBS=$save_LIBS
+        test $gl_pthread_api = yes && break
+      done
 
+      # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+      # since it is defined as a macro on OSF/1.)
+      if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+        # The program links fine without libpthread. But it may actually
+        # need to link with libpthread in order to create multiple threads.
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+printf %s "checking for pthread_kill in -lpthread... " >&6; }
+if test ${ac_cv_lib_pthread_pthread_kill+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_grouping" >&5
-$as_echo "$gl_cv_func_printf_flag_grouping" >&6; }
-
-
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main (void)
+{
+return pthread_kill ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_pthread_pthread_kill=yes
+else $as_nop
+  ac_cv_lib_pthread_pthread_kill=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+printf "%s\n" "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes
+then :
+  LIBPMULTITHREAD=-lpthread
+           # On Solaris and HP-UX, most pthread functions exist also in libc.
+           # Therefore pthread_in_use() needs to actually try to create a
+           # thread: pthread_create from libc will fail, whereas
+           # pthread_create will actually create a thread.
+           # On Solaris 10 or newer, this test is no longer needed, because
+           # libc contains the fully functional pthread functions.
+           case "$host_os" in
+             solaris | solaris2.1-9 | solaris2.1-9.* | hpux*)
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the left-adjust flag correctly" >&5
-$as_echo_n "checking whether printf supports the left-adjust flag correctly... " >&6; }
-if ${gl_cv_func_printf_flag_leftadjust+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+printf "%s\n" "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
 
-      if test "$cross_compiling" = yes; then :
+           esac
 
-         case "$host_os" in
-                    # Guess yes on HP-UX 11.
-           hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
-                    # Guess no on HP-UX 10 and older.
-           hpux*)   gl_cv_func_printf_flag_leftadjust="guessing no";;
-                    # Guess yes otherwise.
-           *)       gl_cv_func_printf_flag_leftadjust="guessing yes";;
-         esac
+fi
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      elif test $gl_pthread_api != yes; then
+        # Some library is needed. Try libpthread and libc_r.
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
+printf %s "checking for pthread_kill in -lpthread... " >&6; }
+if test ${ac_cv_lib_pthread_pthread_kill+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-int main ()
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main (void)
 {
-  /* Check that a '-' flag is not annihilated by a negative width.  */
-  if (sprintf (buf, "a%-*sc", -3, "b") < 0
-      || strcmp (buf, "ab  c") != 0)
-    return 1;
+return pthread_kill ();
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_flag_leftadjust=yes
-else
-  gl_cv_func_printf_flag_leftadjust=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_pthread_pthread_kill=yes
+else $as_nop
+  ac_cv_lib_pthread_pthread_kill=no
 fi
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_leftadjust" >&5
-$as_echo "$gl_cv_func_printf_flag_leftadjust" >&6; }
-
-
-
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports the zero flag correctly" >&5
-$as_echo_n "checking whether printf supports the zero flag correctly... " >&6; }
-if ${gl_cv_func_printf_flag_zero+:} false; 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_printf_flag_zero="guessing yes";;
-                   # Guess yes on BeOS.
-           beos*)  gl_cv_func_printf_flag_zero="guessing yes";;
-                   # If we don't know, assume the worst.
-           *)      gl_cv_func_printf_flag_zero="guessing no";;
-         esac
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_kill" >&5
+printf "%s\n" "$ac_cv_lib_pthread_pthread_kill" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_kill" = xyes
+then :
+  gl_pthread_api=yes
+           LIBPTHREAD=-lpthread
+           LIBPMULTITHREAD=-lpthread
+fi
+
+        if test $gl_pthread_api != yes; then
+          # For FreeBSD 4.
+          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lc_r" >&5
+printf %s "checking for pthread_kill in -lc_r... " >&6; }
+if test ${ac_cv_lib_c_r_pthread_kill+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lc_r  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdio.h>
-#include <string.h>
-static char buf[100];
-static double zero = 0.0;
-int main ()
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char pthread_kill ();
+int
+main (void)
 {
-  if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0
-      || (strcmp (buf, "       inf") != 0
-          && strcmp (buf, "  infinity") != 0))
-    return 1;
+return pthread_kill ();
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_flag_zero=yes
-else
-  gl_cv_func_printf_flag_zero=no
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_c_r_pthread_kill=yes
+else $as_nop
+  ac_cv_lib_c_r_pthread_kill=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
-
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_r_pthread_kill" >&5
+printf "%s\n" "$ac_cv_lib_c_r_pthread_kill" >&6; }
+if test "x$ac_cv_lib_c_r_pthread_kill" = xyes
+then :
+  gl_pthread_api=yes
+             LIBPTHREAD=-lc_r
+             LIBPMULTITHREAD=-lc_r
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_zero" >&5
-$as_echo "$gl_cv_func_printf_flag_zero" >&6; }
 
+        fi
+      fi
+    fi
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether POSIX threads API is available" >&5
+printf %s "checking whether POSIX threads API is available... " >&6; }
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_pthread_api" >&5
+printf "%s\n" "$gl_pthread_api" >&6; }
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports large precisions" >&5
-$as_echo_n "checking whether printf supports large precisions... " >&6; }
-if ${gl_cv_func_printf_precision+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+    if test $gl_pthread_api = yes; then
 
-      if test "$cross_compiling" = yes; then :
+printf "%s\n" "#define HAVE_PTHREAD_API 1" >>confdefs.h
 
-         case "$host_os" in
-           # Guess no only on Solaris, native Windows, and BeOS systems.
-           solaris*)     gl_cv_func_printf_precision="guessing no" ;;
-           mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
-           beos*)        gl_cv_func_printf_precision="guessing no" ;;
-           *)            gl_cv_func_printf_precision="guessing yes" ;;
-         esac
+    fi
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <sched.h>
+int
+main (void)
+{
+sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  LIB_SCHED_YIELD=
 
-#include <stdio.h>
-#include <string.h>
-static char buf[5000];
-int main ()
+else $as_nop
+         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+printf %s "checking for sched_yield in -lrt... " >&6; }
+if test ${ac_cv_lib_rt_sched_yield+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrt  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char sched_yield ();
+int
+main (void)
 {
-  int result = 0;
-#ifdef __BEOS__
-  /* On BeOS, this would crash and show a dialog box.  Avoid the crash.  */
-  return 1;
-#endif
-  if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
-    result |= 1;
-  if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
-    result |= 2;
-  if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
-      || buf[0] != '1')
-    result |= 4;
-  if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5
-      || buf[0] != '1')
-    result |= 4;
-  return result;
+return sched_yield ();
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_precision=yes
-else
-  gl_cv_func_printf_precision=no
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_rt_sched_yield=yes
+else $as_nop
+  ac_cv_lib_rt_sched_yield=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_rt_sched_yield" >&5
+printf "%s\n" "$ac_cv_lib_rt_sched_yield" >&6; }
+if test "x$ac_cv_lib_rt_sched_yield" = xyes
+then :
+  LIB_SCHED_YIELD=-lrt
+else $as_nop
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lposix4" >&5
+printf %s "checking for sched_yield in -lposix4... " >&6; }
+if test ${ac_cv_lib_posix4_sched_yield+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lposix4  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char sched_yield ();
+int
+main (void)
+{
+return sched_yield ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_posix4_sched_yield=yes
+else $as_nop
+  ac_cv_lib_posix4_sched_yield=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix4_sched_yield" >&5
+printf "%s\n" "$ac_cv_lib_posix4_sched_yield" >&6; }
+if test "x$ac_cv_lib_posix4_sched_yield" = xyes
+then :
+  LIB_SCHED_YIELD=-lposix4
+fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_precision" >&5
-$as_echo "$gl_cv_func_printf_precision" >&6; }
 
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf survives out-of-memory conditions" >&5
-$as_echo_n "checking whether printf survives out-of-memory conditions... " >&6; }
-if ${gl_cv_func_printf_enomem+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+    gl_pthreadlib_body_done=done
+  fi
 
-      gl_cv_func_printf_enomem="guessing no"
-      if test "$cross_compiling" = no; then
-        if test $APPLE_UNIVERSAL_BUILD = 0; then
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+        if test $ac_cv_header_threads_h = yes; then
+                                                  ac_fn_c_check_func "$LINENO" "thrd_create" "ac_cv_func_thrd_create"
+if test "x$ac_cv_func_thrd_create" = xyes
+then :
+  printf "%s\n" "#define HAVE_THRD_CREATE 1" >>confdefs.h
 
+fi
 
-#include <stdlib.h>
-#if defined __MACH__ && defined __APPLE__
-/* Avoid a crash on Mac OS X.  */
-#include <mach/mach.h>
-#include <mach/mach_error.h>
-#include <mach/thread_status.h>
-#include <mach/exception.h>
-#include <mach/task.h>
-#include <pthread.h>
-/* The exception port on which our thread listens.  */
-static mach_port_t our_exception_port;
-/* The main function of the thread listening for exceptions of type
-   EXC_BAD_ACCESS.  */
-static void *
-mach_exception_thread (void *arg)
-{
-  /* Buffer for a message to be received.  */
-  struct {
-    mach_msg_header_t head;
-    mach_msg_body_t msgh_body;
-    char data1024;
-  } msg;
-  mach_msg_return_t retval;
-  /* Wait for a message on the exception port.  */
-  retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
-                     our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
-  if (retval != MACH_MSG_SUCCESS)
-    abort ();
-  exit (1);
-}
-static void
-nocrash_init (void)
-{
-  mach_port_t self = mach_task_self ();
-  /* Allocate a port on which the thread shall listen for exceptions.  */
-  if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
-      == KERN_SUCCESS) {
-    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
-    if (mach_port_insert_right (self, our_exception_port, our_exception_port,
-                                MACH_MSG_TYPE_MAKE_SEND)
-        == KERN_SUCCESS) {
-      /* The exceptions we want to catch.  Only EXC_BAD_ACCESS is interesting
-         for us.  */
-      exception_mask_t mask = EXC_MASK_BAD_ACCESS;
-      /* Create the thread listening on the exception port.  */
-      pthread_attr_t attr;
-      pthread_t thread;
-      if (pthread_attr_init (&attr) == 0
-          && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
-          && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
-        pthread_attr_destroy (&attr);
-        /* Replace the exception port info for these exceptions with our own.
-           Note that we replace the exception port for the entire task, not only
-           for a particular thread.  This has the effect that when our exception
-           port gets the message, the thread specific exception port has already
-           been asked, and we don't need to bother about it.
-           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
-        task_set_exception_ports (self, mask, our_exception_port,
-                                  EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
-      }
-    }
-  }
-}
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* Avoid a crash on native Windows.  */
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#include <winerror.h>
-static LONG WINAPI
-exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
-{
-  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
-    {
-    case EXCEPTION_ACCESS_VIOLATION:
-    case EXCEPTION_IN_PAGE_ERROR:
-    case EXCEPTION_STACK_OVERFLOW:
-    case EXCEPTION_GUARD_PAGE:
-    case EXCEPTION_PRIV_INSTRUCTION:
-    case EXCEPTION_ILLEGAL_INSTRUCTION:
-    case EXCEPTION_DATATYPE_MISALIGNMENT:
-    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
-    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
-      exit (1);
-    }
-  return EXCEPTION_CONTINUE_SEARCH;
-}
-static void
-nocrash_init (void)
-{
-  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
-}
-#else
-/* Avoid a crash on POSIX systems.  */
-#include <signal.h>
-#include <unistd.h>
-/* A POSIX signal handler.  */
-static void
-exception_handler (int sig)
-{
-  _exit (1);
-}
-static void
-nocrash_init (void)
-{
-#ifdef SIGSEGV
-  signal (SIGSEGV, exception_handler);
-#endif
-#ifdef SIGBUS
-  signal (SIGBUS, exception_handler);
-#endif
-}
-#endif
+          if test $ac_cv_func_thrd_create = yes; then
+            LIBSTDTHREAD=
+          else
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for thrd_create in -lstdthreads" >&5
+printf %s "checking for thrd_create in -lstdthreads... " >&6; }
+if test ${ac_cv_lib_stdthreads_thrd_create+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lstdthreads  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <errno.h>
-int main()
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char thrd_create ();
+int
+main (void)
 {
-  struct rlimit limit;
-  int ret;
-  nocrash_init ();
-  /* Some printf implementations allocate temporary space with malloc.  */
-  /* On BSD systems, malloc() is limited by RLIMIT_DATA.  */
-#ifdef RLIMIT_DATA
-  if (getrlimit (RLIMIT_DATA, &limit) < 0)
-    return 77;
-  if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
-    limit.rlim_max = 5000000;
-  limit.rlim_cur = limit.rlim_max;
-  if (setrlimit (RLIMIT_DATA, &limit) < 0)
-    return 77;
-#endif
-  /* On Linux systems, malloc() is limited by RLIMIT_AS.  */
-#ifdef RLIMIT_AS
-  if (getrlimit (RLIMIT_AS, &limit) < 0)
-    return 77;
-  if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
-    limit.rlim_max = 5000000;
-  limit.rlim_cur = limit.rlim_max;
-  if (setrlimit (RLIMIT_AS, &limit) < 0)
-    return 77;
-#endif
-  /* Some printf implementations allocate temporary space on the stack.  */
-#ifdef RLIMIT_STACK
-  if (getrlimit (RLIMIT_STACK, &limit) < 0)
-    return 77;
-  if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
-    limit.rlim_max = 5000000;
-  limit.rlim_cur = limit.rlim_max;
-  if (setrlimit (RLIMIT_STACK, &limit) < 0)
-    return 77;
-#endif
-  ret = printf ("%.5000000f", 1.0);
-  return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
+return thrd_create ();
+  ;
+  return 0;
 }
-
 _ACEOF
-          if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-            (./conftest 2>&5
-             result=$?
-             $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $result" >&5
-             if test $result != 0 && test $result != 77; then result=1; fi
-             exit $result
-            ) >/dev/null 2>/dev/null
-            case $? in
-              0) gl_cv_func_printf_enomem="yes" ;;
-              77) gl_cv_func_printf_enomem="guessing no" ;;
-              *) gl_cv_func_printf_enomem="no" ;;
-            esac
-          else
-            gl_cv_func_printf_enomem="guessing no"
-          fi
-          rm -fr conftest*
-        else
-                                        gl_cv_func_printf_enomem="guessing no"
-        fi
-      fi
-      if test "$gl_cv_func_printf_enomem" = "guessing no"; then
-        case "$host_os" in
-                    # Guess yes on glibc systems.
-          *-gnu*)   gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on Solaris.
-          solaris*) gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on AIX.
-          aix*)     gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on HP-UX/hppa.
-          hpux*)    case "$host_cpu" in
-                      hppa*) gl_cv_func_printf_enomem="guessing yes";;
-                      *)     gl_cv_func_printf_enomem="guessing no";;
-                    esac
-                    ;;
-                    # Guess yes on IRIX.
-          irix*)    gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on OSF/1.
-          osf*)     gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on BeOS.
-          beos*)    gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on Haiku.
-          haiku*)   gl_cv_func_printf_enomem="guessing yes";;
-                    # If we don't know, assume the worst.
-          *)        gl_cv_func_printf_enomem="guessing no";;
-        esac
-      fi
-
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_stdthreads_thrd_create=yes
+else $as_nop
+  ac_cv_lib_stdthreads_thrd_create=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_enomem" >&5
-$as_echo "$gl_cv_func_printf_enomem" >&6; }
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdthreads_thrd_create" >&5
+printf "%s\n" "$ac_cv_lib_stdthreads_thrd_create" >&6; }
+if test "x$ac_cv_lib_stdthreads_thrd_create" = xyes
+then :
 
+              LIBSTDTHREAD='-lstdthreads -lpthread'
 
-  case "$gl_cv_func_printf_long_double" in
-    *yes)
-      ;;
-    *)
+else $as_nop
 
-$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
+                            LIBSTDTHREAD="$LIBPMULTITHREAD"
 
-      ;;
-  esac
+fi
 
+          fi
+        else
+                    LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+        fi
+        ;;
+    esac
 
 
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ISO C threads API is available" >&5
+printf %s "checking whether ISO C threads API is available... " >&6; }
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_threads_h" >&5
+printf "%s\n" "$ac_cv_header_threads_h" >&6; }
+    gl_stdthreadlib_body_done=done
+  fi
 
-  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;
+        LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
+        LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
+        gl_threads_api=isoc
 
+printf "%s\n" "#define USE_ISOC_THREADS 1" >>confdefs.h
 
+      fi
+    fi
+    if test $gl_threads_api = none; then
+      case "$gl_use_threads" in
+        yes | windows | win32) # The 'win32' is for backward compatibility.
+          if { case "$host_os" in
+                 mingw*) true;;
+                 *) false;;
+               esac
+             }; then
+            gl_threads_api=windows
 
+printf "%s\n" "#define USE_WINDOWS_THREADS 1" >>confdefs.h
 
+          fi
+          ;;
+      esac
+    fi
+  fi
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for multithread API to use" >&5
+printf %s "checking for multithread API to use... " >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_threads_api" >&5
+printf "%s\n" "$gl_threads_api" >&6; }
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use C++" >&5
-$as_echo_n "checking whether to use C++... " >&6; }
-    # Check whether --enable-c++ was given.
-if test "${enable_c__+set}" = set; then :
-  enableval=$enable_c__; CXX_CHOICE="$enableval"
-else
-  CXX_CHOICE=no
-fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX_CHOICE" >&5
-$as_echo "$CXX_CHOICE" >&6; }
 
 
 
-     GNULIB_OPENDIR=0;
-  GNULIB_READDIR=0;
-  GNULIB_REWINDDIR=0;
-  GNULIB_CLOSEDIR=0;
-  GNULIB_DIRFD=0;
-  GNULIB_FDOPENDIR=0;
-  GNULIB_SCANDIR=0;
-  GNULIB_ALPHASORT=0;
-    HAVE_OPENDIR=1;
-  HAVE_READDIR=1;
-  HAVE_REWINDDIR=1;
-  HAVE_CLOSEDIR=1;
-  HAVE_DECL_DIRFD=1;
-  HAVE_DECL_FDOPENDIR=1;
-  HAVE_FDOPENDIR=1;
-  HAVE_SCANDIR=1;
-  HAVE_ALPHASORT=1;
-  REPLACE_OPENDIR=0;
-  REPLACE_CLOSEDIR=0;
-  REPLACE_DIRFD=0;
-  REPLACE_FDOPENDIR=0;
 
 
-  GNULIB_ISBLANK=0;
-    HAVE_ISBLANK=1;
 
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+printf %s "checking for a sed that does not truncate output... " >&6; }
+if test ${ac_cv_path_SED+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    for ac_prog in sed gsed
+   do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  printf %s 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    printf "%s\n" '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
 
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+printf "%s\n" "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ungetc works on arbitrary bytes" >&5
-$as_echo_n "checking whether ungetc works on arbitrary bytes... " >&6; }
-if ${gl_cv_func_ungetc_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc (0) returns nonnull" >&5
+printf %s "checking whether malloc (0) returns nonnull... " >&6; }
+if test ${ac_cv_func_malloc_0_nonnull+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
   case "$host_os" in
-                   # Guess yes on glibc and bionic systems.
-           *-gnu*|*-android*)
-                   gl_cv_func_ungetc_works="guessing yes" ;;
-                   # If we don't know, assume the worst.
-           *)      gl_cv_func_ungetc_works="guessing no" ;;
-         esac
+          # Guess yes on platforms where we know the result.
+          *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+          | gnu* | *-musl* | midnightbsd* \
+          | hpux* | solaris* | cygwin* | mingw* | msys* )
+            ac_cv_func_malloc_0_nonnull="guessing yes" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
+        esac
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <stdio.h>
+#include <stdlib.h>
 
 int
-main ()
+main (void)
 {
-FILE *f;
-           if (!(f = fopen ("conftest.tmp", "w+"))) return 1;
-           if (fputs ("abc", f) < 0) return 2;
-           rewind (f);
-           if (fgetc (f) != 'a') return 3;
-           if (fgetc (f) != 'b') return 4;
-           if (ungetc ('d', f) != 'd') return 5;
-           if (ftell (f) != 1) return 6;
-           if (fgetc (f) != 'd') return 7;
-           if (ftell (f) != 2) return 8;
-           if (fseek (f, 0, SEEK_CUR) != 0) return 9;
-           if (ftell (f) != 2) return 10;
-           if (fgetc (f) != 'c') return 11;
-           fclose (f); remove ("conftest.tmp");
+void *p = malloc (0);
+            int result = !p;
+            free (p);
+            return result;
   ;
   return 0;
 }
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_ungetc_works=yes
-else
-  gl_cv_func_ungetc_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  ac_cv_func_malloc_0_nonnull=yes
+else $as_nop
+  ac_cv_func_malloc_0_nonnull=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ungetc_works" >&5
-$as_echo "$gl_cv_func_ungetc_works" >&6; }
-  case "$gl_cv_func_ungetc_works" in
-    *yes) ;;
-    *)
-
-$as_echo "#define FUNC_UNGETC_BROKEN 1" >>confdefs.h
-
-      ;;
-  esac
-
-
-
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getcwd (NULL, 0) allocates memory for result" >&5
-$as_echo_n "checking whether getcwd (NULL, 0) allocates memory for result... " >&6; }
-if ${gl_cv_func_getcwd_null+:} false; 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_getcwd_null="guessing yes";;
-                     # Guess yes on Cygwin.
-            cygwin*) gl_cv_func_getcwd_null="guessing yes";;
-                     # If we don't know, assume the worst.
-            *)       gl_cv_func_getcwd_null="guessing no";;
-          esac
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#       include <stdlib.h>
-#        if HAVE_UNISTD_H
-#         include <unistd.h>
-#        else /* on Windows with MSVC */
-#         include <direct.h>
-#        endif
-#        ifndef getcwd
-         char *getcwd ();
-#        endif
-
-int
-main ()
-{
-
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* mingw cwd does not start with '/', but getcwd does allocate.
-   However, mingw fails to honor non-zero size.  */
-#else
-           if (chdir ("/") != 0)
-             return 1;
-           else
-             {
-               char *f = getcwd (NULL, 0);
-               if (! f)
-                 return 2;
-               if (f[0] != '/')
-                 return 3;
-               if (f[1] != '\0')
-                 return 4;
-               free (f);
-               return 0;
-             }
-#endif
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_getcwd_null=yes
-else
-  gl_cv_func_getcwd_null=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_null" >&5
-$as_echo "$gl_cv_func_getcwd_null" >&6; }
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getcwd with POSIX signature" >&5
-$as_echo_n "checking for getcwd with POSIX signature... " >&6; }
-if ${gl_cv_func_getcwd_posix_signature+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <unistd.h>
-int
-main ()
-{
-extern
-           #ifdef __cplusplus
-           "C"
-           #endif
-           char *getcwd (char *, size_t);
-
-  ;
-  return 0;
-}
-
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_getcwd_posix_signature=yes
-else
-  gl_cv_func_getcwd_posix_signature=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_posix_signature" >&5
-$as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
-
-
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; }
+  case $ac_cv_func_malloc_0_nonnull in #(
+  *yes) :
+    gl_cv_func_malloc_0_nonnull=1 ;; #(
+  *) :
+    gl_cv_func_malloc_0_nonnull=0 ;;
+esac
 
-  GNULIB_IMAXABS=0;
-  GNULIB_IMAXDIV=0;
-  GNULIB_STRTOIMAX=0;
-  GNULIB_STRTOUMAX=0;
-    HAVE_DECL_IMAXABS=1;
-  HAVE_DECL_IMAXDIV=1;
-  HAVE_DECL_STRTOIMAX=1;
-  HAVE_DECL_STRTOUMAX=1;
-  REPLACE_STRTOIMAX=0;
-  REPLACE_STRTOUMAX=0;
-  INT32_MAX_LT_INTMAX_MAX=1;
-  INT64_MAX_EQ_LONG_MAX='defined _LP64';
-  PRI_MACROS_BROKEN=0;
-  PRIPTR_PREFIX=__PRIPTR_PREFIX;
-  UINT32_MAX_LT_UINTMAX_MAX=1;
-  UINT64_MAX_EQ_ULONG_MAX='defined _LP64';
 
+printf "%s\n" "#define MALLOC_0_IS_NONNULL $gl_cv_func_malloc_0_nonnull" >>confdefs.h
 
 
 
@@ -20864,22 +23148,23 @@ $as_echo "$gl_cv_func_getcwd_posix_signature" >&6; }
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_inttypes_h='<'inttypes.h'>'
+       gl_cv_next_math_h='<'math.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <inttypes.h>" >&5
-$as_echo_n "checking absolute name of <inttypes.h>... " >&6; }
-if ${gl_cv_next_inttypes_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
+printf %s "checking absolute name of <math.h>... " >&6; }
+if test ${gl_cv_next_math_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-             if test $ac_cv_header_inttypes_h = yes; then
+             if test $ac_cv_header_math_h = yes; then
 
 
 
 
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <inttypes.h>
+#include <math.h>
 _ACEOF
                 case "$host_os" in
     aix*) gl_absname_cpp="$ac_cpp -C" ;;
@@ -20895,7 +23180,7 @@ _ACEOF
       ;;
   esac
       gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'inttypes.h' \
+  gl_header_literal_regex=`echo 'math.h' \
                            | sed -e "$gl_make_literal_regex_sed"`
   gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
       s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
@@ -20904,1011 +23189,542 @@ _ACEOF
       q
     }'
 
-        gl_cv_absolute_inttypes_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+        gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
   sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_inttypes_h
-           gl_cv_next_inttypes_h='"'$gl_header'"'
+           gl_header=$gl_cv_absolute_math_h
+           gl_cv_next_math_h='"'$gl_header'"'
           else
-               gl_cv_next_inttypes_h='<'inttypes.h'>'
+               gl_cv_next_math_h='<'math.h'>'
              fi
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_inttypes_h" >&5
-$as_echo "$gl_cv_next_inttypes_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
+printf "%s\n" "$gl_cv_next_math_h" >&6; }
      fi
-     NEXT_INTTYPES_H=$gl_cv_next_inttypes_h
+     NEXT_MATH_H=$gl_cv_next_math_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='<'inttypes.h'>'
+       gl_next_as_first_directive='<'math.h'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_inttypes_h
+       gl_next_as_first_directive=$gl_cv_next_math_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H=$gl_next_as_first_directive
-
-
-
-
-
-
-
-
-
+     NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
 
-  for ac_header in inttypes.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
-if test "x$ac_cv_header_inttypes_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_INTTYPES_H 1
-_ACEOF
 
-fi
 
-done
 
-  if test $ac_cv_header_inttypes_h = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5
-$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; }
-if ${gt_cv_inttypes_pri_broken+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
+printf %s "checking whether NAN macro works... " >&6; }
+if test ${gl_cv_header_math_nan_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <inttypes.h>
-#ifdef PRId32
-char *p = PRId32;
-#endif
-
+#include <math.h>
 int
-main ()
+main (void)
 {
-
+/* Solaris 10 has a broken definition of NAN.  Other platforms
+        fail to provide NAN, or provide it only in C99 mode; this
+        test only needs to fail when NAN is provided but wrong.  */
+         float f = 1.0f;
+#ifdef NAN
+         f = NAN;
+#endif
+         return f == 0;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_inttypes_pri_broken=no
-else
-  gt_cv_inttypes_pri_broken=yes
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_math_nan_works=yes
+else $as_nop
+  gl_cv_header_math_nan_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5
-$as_echo "$gt_cv_inttypes_pri_broken" >&6; }
-  fi
-  if test "$gt_cv_inttypes_pri_broken" = yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define PRI_MACROS_BROKEN 1
-_ACEOF
-
-    PRI_MACROS_BROKEN=1
-  else
-    PRI_MACROS_BROKEN=0
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
+printf "%s\n" "$gl_cv_header_math_nan_works" >&6; }
+  if test $gl_cv_header_math_nan_works = no; then
+    REPLACE_NAN=1
   fi
-
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LC_MESSAGES" >&5
-$as_echo_n "checking for LC_MESSAGES... " >&6; }
-if ${gt_cv_val_LC_MESSAGES+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
+printf %s "checking whether HUGE_VAL works... " >&6; }
+if test ${gl_cv_header_math_huge_val_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <locale.h>
+#include <math.h>
 int
-main ()
+main (void)
 {
-return LC_MESSAGES
+/* Solaris 10 has a broken definition of HUGE_VAL.  */
+         double d = HUGE_VAL;
+         return d == 0;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gt_cv_val_LC_MESSAGES=yes
-else
-  gt_cv_val_LC_MESSAGES=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_math_huge_val_works=yes
+else $as_nop
+  gl_cv_header_math_huge_val_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_val_LC_MESSAGES" >&5
-$as_echo "$gt_cv_val_LC_MESSAGES" >&6; }
-  if test $gt_cv_val_LC_MESSAGES = yes; then
-
-$as_echo "#define HAVE_LC_MESSAGES 1" >>confdefs.h
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
+printf "%s\n" "$gl_cv_header_math_huge_val_works" >&6; }
+  if test $gl_cv_header_math_huge_val_works = no; then
+    REPLACE_HUGE_VAL=1
   fi
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
-$as_echo_n "checking for CFPreferencesCopyAppValue... " >&6; }
-if ${gt_cv_func_CFPreferencesCopyAppValue+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  gt_save_LIBS="$LIBS"
-     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <CoreFoundation/CFPreferences.h>
-int
-main ()
-{
-CFPreferencesCopyAppValue(NULL, NULL)
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gt_cv_func_CFPreferencesCopyAppValue=yes
-else
-  gt_cv_func_CFPreferencesCopyAppValue=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-     LIBS="$gt_save_LIBS"
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
-$as_echo "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
-  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
 
-$as_echo "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
 
-  fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyCurrent" >&5
-$as_echo_n "checking for CFLocaleCopyCurrent... " >&6; }
-if ${gt_cv_func_CFLocaleCopyCurrent+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  gt_save_LIBS="$LIBS"
-     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
-     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for mbstate_t" >&5
+printf %s "checking for mbstate_t... " >&6; }
+if test ${ac_cv_type_mbstate_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <CoreFoundation/CFLocale.h>
+$ac_includes_default
+             #include <wchar.h>
 int
-main ()
+main (void)
 {
-CFLocaleCopyCurrent();
+mbstate_t x; return sizeof x;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gt_cv_func_CFLocaleCopyCurrent=yes
-else
-  gt_cv_func_CFLocaleCopyCurrent=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_type_mbstate_t=yes
+else $as_nop
+  ac_cv_type_mbstate_t=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-     LIBS="$gt_save_LIBS"
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyCurrent" >&5
-$as_echo "$gt_cv_func_CFLocaleCopyCurrent" >&6; }
-  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
-
-$as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_mbstate_t" >&5
+printf "%s\n" "$ac_cv_type_mbstate_t" >&6; }
+   if test $ac_cv_type_mbstate_t = yes; then
 
-  fi
-  INTL_MACOSX_LIBS=
-  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
-    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
-  fi
+printf "%s\n" "#define HAVE_MBSTATE_T 1" >>confdefs.h
 
+   else
 
-ac_fn_c_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default"
-if test "x$ac_cv_have_decl_setenv" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+printf "%s\n" "#define mbstate_t int" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SETENV $ac_have_decl
-_ACEOF
+   fi
 
 
 
 
+  HAVE_MBSLEN=0;
+    HAVE_EXPLICIT_BZERO=1;
+  HAVE_FFSL=1;
+  HAVE_FFSLL=1;
+  HAVE_DECL_MEMMEM=1;
+  HAVE_MEMPCPY=1;
+  HAVE_DECL_MEMRCHR=1;
+  HAVE_RAWMEMCHR=1;
+  HAVE_STPCPY=1;
+  HAVE_STPNCPY=1;
+  HAVE_STRCHRNUL=1;
+  HAVE_DECL_STRDUP=1;
+  HAVE_DECL_STRNDUP=1;
+  HAVE_DECL_STRNLEN=1;
+  HAVE_STRPBRK=1;
+  HAVE_STRSEP=1;
+  HAVE_STRCASESTR=1;
+  HAVE_DECL_STRTOK_R=1;
+  HAVE_DECL_STRERROR_R=1;
+  HAVE_STRERRORNAME_NP=1;
+  HAVE_SIGABBREV_NP=1;
+  HAVE_SIGDESCR_NP=1;
+  HAVE_DECL_STRSIGNAL=1;
+  HAVE_STRVERSCMP=1;
+  REPLACE_FFSLL=0;
+  REPLACE_MEMCHR=0;
+  REPLACE_MEMMEM=0;
+  REPLACE_STPNCPY=0;
+  REPLACE_STRCHRNUL=0;
+  REPLACE_STRDUP=0;
+  REPLACE_STRNCAT=0;
+  REPLACE_STRNDUP=0;
+  REPLACE_STRNLEN=0;
+  REPLACE_STRSTR=0;
+  REPLACE_STRCASESTR=0;
+  REPLACE_STRTOK_R=0;
+  REPLACE_STRERROR=0;
+  REPLACE_STRERROR_R=0;
+  REPLACE_STRERRORNAME_NP=0;
+  REPLACE_STRSIGNAL=0;
+  UNDEFINE_STRTOK_R=0;
 
 
-  if test $ac_cv_have_decl_setenv = no; then
-    HAVE_DECL_SETENV=0
-  fi
 
 
+  GL_M4_GNULIB_EXPLICIT_BZERO=0
 
 
 
-  for ac_header in search.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
-if test "x$ac_cv_header_search_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SEARCH_H 1
-_ACEOF
+  GL_M4_GNULIB_FFSL=0
 
-fi
 
-done
 
-  for ac_func in tsearch
-do :
-  ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
-if test "x$ac_cv_func_tsearch" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_TSEARCH 1
-_ACEOF
+  GL_M4_GNULIB_FFSLL=0
 
-fi
-done
 
 
+  GL_M4_GNULIB_MEMCHR=0
 
 
 
+  GL_M4_GNULIB_MEMMEM=0
 
 
-ac_fn_c_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default"
-if test "x$ac_cv_have_decl_strdup" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_STRDUP $ac_have_decl
-_ACEOF
+  GL_M4_GNULIB_MEMPCPY=0
 
-ac_fn_c_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default"
-if test "x$ac_cv_have_decl_unsetenv" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_UNSETENV $ac_have_decl
-_ACEOF
 
+  GL_M4_GNULIB_MEMRCHR=0
 
 
 
-   if false; then
-  GL_COND_LIBTOOL_TRUE=
-  GL_COND_LIBTOOL_FALSE='#'
-else
-  GL_COND_LIBTOOL_TRUE='#'
-  GL_COND_LIBTOOL_FALSE=
-fi
+  GL_M4_GNULIB_RAWMEMCHR=0
 
-  gl_cond_libtool=false
-  gl_libdeps=
-  gl_ltlibdeps=
-  gl_m4_base='m4'
 
 
+  GL_M4_GNULIB_STPCPY=0
 
 
 
+  GL_M4_GNULIB_STPNCPY=0
 
 
 
+  GL_M4_GNULIB_STRCHRNUL=0
 
-  gl_source_base='lib'
 
 
-  if test $ac_cv_func_alloca_works = no; then
-    :
-  fi
+  GL_M4_GNULIB_STRDUP=0
 
-  # Define an additional variable used in the Makefile substitution.
-  if test $ac_cv_working_alloca_h = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
-$as_echo_n "checking for alloca as a compiler built-in... " >&6; }
-if ${gl_cv_rpl_alloca+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#if defined __GNUC__ || defined _AIX || defined _MSC_VER
-        Need own alloca
-#endif
+  GL_M4_GNULIB_STRNCAT=0
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Need own alloca" >/dev/null 2>&1; then :
-  gl_cv_rpl_alloca=yes
-else
-  gl_cv_rpl_alloca=no
-fi
-rm -f conftest*
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
-$as_echo "$gl_cv_rpl_alloca" >&6; }
-    if test $gl_cv_rpl_alloca = yes; then
+  GL_M4_GNULIB_STRNDUP=0
 
-$as_echo "#define HAVE_ALLOCA 1" >>confdefs.h
 
-      ALLOCA_H=alloca.h
-    else
-                  ALLOCA_H=
-    fi
-  else
-    ALLOCA_H=alloca.h
-  fi
 
-   if test -n "$ALLOCA_H"; then
-  GL_GENERATE_ALLOCA_H_TRUE=
-  GL_GENERATE_ALLOCA_H_FALSE='#'
-else
-  GL_GENERATE_ALLOCA_H_TRUE='#'
-  GL_GENERATE_ALLOCA_H_FALSE=
-fi
+  GL_M4_GNULIB_STRNLEN=0
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5
-$as_echo_n "checking whether to enable assertions... " >&6; }
-  # Check whether --enable-assert was given.
-if test "${enable_assert+set}" = set; then :
-  enableval=$enable_assert; if test "x$enableval" = xno; then :
+  GL_M4_GNULIB_STRPBRK=0
 
-$as_echo "#define NDEBUG 1" >>confdefs.h
 
-elif test "x$enableval" != xyes; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-assert" >&5
-$as_echo "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;}
-      enable_assert=yes
-fi
-else
-  enable_assert=yes
-fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5
-$as_echo "$enable_assert" >&6; }
+  GL_M4_GNULIB_STRSEP=0
 
 
 
+  GL_M4_GNULIB_STRSTR=0
 
 
 
+  GL_M4_GNULIB_STRCASESTR=0
 
-  if test $ac_cv_func_btowc = no; then
-    HAVE_BTOWC=0
-  else
 
 
+  GL_M4_GNULIB_STRTOK_R=0
 
 
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5
-$as_echo_n "checking whether btowc(0) is correct... " >&6; }
-if ${gl_cv_func_btowc_nul+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-        if test "$cross_compiling" = yes; then :
+  GL_M4_GNULIB_MBSLEN=0
 
-           case "$host_os" in
-                      # Guess no on Cygwin.
-             cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
-                      # Guess yes otherwise.
-             *)       gl_cv_func_btowc_nul="guessing yes" ;;
-           esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.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 ()
-{
-  if (btowc ('\0') != 0)
-    return 1;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_btowc_nul=yes
-else
-  gl_cv_func_btowc_nul=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  GL_M4_GNULIB_MBSNLEN=0
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5
-$as_echo "$gl_cv_func_btowc_nul" >&6; }
 
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5
-$as_echo_n "checking whether btowc(EOF) is correct... " >&6; }
-if ${gl_cv_func_btowc_eof+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  GL_M4_GNULIB_MBSCHR=0
 
-                        case "$host_os" in
-                 # Guess no on IRIX.
-          irix*) gl_cv_func_btowc_eof="guessing no" ;;
-                 # Guess yes otherwise.
-          *)     gl_cv_func_btowc_eof="guessing yes" ;;
-        esac
-        if test $LOCALE_FR != none; then
-          if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#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 ()
-{
-  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
-    {
-      if (btowc (EOF) != WEOF)
-        return 1;
-    }
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_btowc_eof=yes
-else
-  gl_cv_func_btowc_eof=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-        fi
+  GL_M4_GNULIB_MBSRCHR=0
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5
-$as_echo "$gl_cv_func_btowc_eof" >&6; }
 
-    case "$gl_cv_func_btowc_nul" in
-      *yes) ;;
-      *) REPLACE_BTOWC=1 ;;
-    esac
-    case "$gl_cv_func_btowc_eof" in
-      *yes) ;;
-      *) REPLACE_BTOWC=1 ;;
-    esac
-  fi
 
-  if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
+  GL_M4_GNULIB_MBSSTR=0
 
 
 
+  GL_M4_GNULIB_MBSCASECMP=0
 
 
 
+  GL_M4_GNULIB_MBSNCASECMP=0
 
 
-  M4_LIBOBJS="$M4_LIBOBJS btowc.$ac_objext"
 
+  GL_M4_GNULIB_MBSPCASECMP=0
 
-  :
 
-  fi
 
+  GL_M4_GNULIB_MBSCASESTR=0
 
 
 
+  GL_M4_GNULIB_MBSCSPN=0
 
-          GNULIB_BTOWC=1
 
 
+  GL_M4_GNULIB_MBSPBRK=0
 
 
 
-$as_echo "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
+  GL_M4_GNULIB_MBSSPN=0
 
 
 
+  GL_M4_GNULIB_MBSSEP=0
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
-$as_echo_n "checking for __builtin_expect... " >&6; }
-if ${gl_cv___builtin_expect+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-         int
-         main (int argc, char **argv)
-         {
-           argc = __builtin_expect (argc, 100);
-           return argv[argc != 100][0];
-         }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv___builtin_expect=yes
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-             #include <builtins.h>
-             int
-             main (int argc, char **argv)
-             {
-               argc = __builtin_expect (argc, 100);
-               return argv[argc != 100][0];
-             }
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv___builtin_expect="in <builtins.h>"
-else
-  gl_cv___builtin_expect=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
-$as_echo "$gl_cv___builtin_expect" >&6; }
-  if test "$gl_cv___builtin_expect" = yes; then
-    $as_echo "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
+  GL_M4_GNULIB_MBSTOK_R=0
 
-  elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
-    $as_echo "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
 
-  fi
 
+  GL_M4_GNULIB_STRERROR=0
 
 
 
+  GL_M4_GNULIB_STRERROR_R=0
 
 
-   # for STACK_DIRECTION
 
+  GL_M4_GNULIB_STRERRORNAME_NP=0
 
 
-   ac_fn_c_check_decl "$LINENO" "sigaltstack" "ac_cv_have_decl_sigaltstack" "#include <signal.h>
-"
-if test "x$ac_cv_have_decl_sigaltstack" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SIGALTSTACK $ac_have_decl
-_ACEOF
+  GL_M4_GNULIB_SIGABBREV_NP=0
 
 
 
+  GL_M4_GNULIB_SIGDESCR_NP=0
 
-   ac_fn_c_check_type "$LINENO" "stack_t" "ac_cv_type_stack_t" "#include <signal.h>
-"
-if test "x$ac_cv_type_stack_t" = xyes; then :
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STACK_T 1
-_ACEOF
 
+  GL_M4_GNULIB_STRSIGNAL=0
 
-fi
 
 
-      if test "$gl_cv_lib_sigsegv" = yes \
-       && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then
-     LIBCSTACK=$LIBSIGSEGV
+  GL_M4_GNULIB_STRVERSCMP=0
 
-     LTLIBCSTACK=$LTLIBSIGSEGV
 
-   fi
 
+  GL_M4_GNULIB_MDA_MEMCCPY=1
 
 
 
+  GL_M4_GNULIB_MDA_STRDUP=1
 
-  if test $ac_cv_func_canonicalize_file_name = no; then
-    HAVE_CANONICALIZE_FILE_NAME=0
-    if test $ac_cv_func_realpath = no; then
-      HAVE_REALPATH=0
-    else
-      case "$gl_cv_func_realpath_works" in
-       *yes) ;;
-       *)    REPLACE_REALPATH=1 ;;
-      esac
-    fi
-  else
-    case "$gl_cv_func_realpath_works" in
-      *yes)
-        ;;
-      *)
-        REPLACE_CANONICALIZE_FILE_NAME=1
-        REPLACE_REALPATH=1
-        ;;
-    esac
-  fi
 
-  if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
 
 
 
 
+  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
+  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
+  # irrelevant for anonymous mappings.
+  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
+if test "x$ac_cv_func_mmap" = xyes
+then :
+  gl_have_mmap=yes
+else $as_nop
+  gl_have_mmap=no
+fi
 
 
+  # Try to allow MAP_ANONYMOUS.
+  gl_have_mmap_anonymous=no
+  if test $gl_have_mmap = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
+printf %s "checking for MAP_ANONYMOUS... " >&6; }
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <sys/mman.h>
+#ifdef MAP_ANONYMOUS
+    I cannot identify this map
+#endif
 
-  M4_LIBOBJS="$M4_LIBOBJS canonicalize-lgpl.$ac_objext"
-
-  fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_CANONICALIZE_LGPL 1
-_ACEOF
-
-
-
-
-
-
-
-          GNULIB_CANONICALIZE_FILE_NAME=1
-
-
-
-
-
-$as_echo "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
-
-
-
-
-
-
-
-
-          GNULIB_REALPATH=1
-
-
-
-
-
-$as_echo "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
-
-
-
-
-
-
-
-
-          GNULIB_CHDIR=1
-
-
-
-
-
-$as_echo "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
-
-
-
-
-$as_echo "#define SIGNAL_SAFE_LIST 1" >>confdefs.h
-
-
-
-$as_echo "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
-
-
-
-
-
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-    REPLACE_CLOSE=1
-  fi
-
-
-
-
-
-  if test $ac_cv_header_sys_socket_h != yes; then
-                    for ac_header in winsock2.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
-if test "x$ac_cv_header_winsock2_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_WINSOCK2_H 1
 _ACEOF
-
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
+  gl_have_mmap_anonymous=yes
 fi
+rm -rf conftest*
 
-done
-
-  fi
-  if test "$ac_cv_header_winsock2_h" = yes; then
-    HAVE_WINSOCK2_H=1
-    UNISTD_H_HAVE_WINSOCK2_H=1
-    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
-  else
-    HAVE_WINSOCK2_H=0
-  fi
-
-
-    if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
-                        REPLACE_CLOSE=1
-    fi
-
-
-
-  if test $REPLACE_CLOSE = 1; then
-
-
-
-
-
-
-
-
-  M4_LIBOBJS="$M4_LIBOBJS close.$ac_objext"
-
-  fi
-
-
-
-
-
-          GNULIB_CLOSE=1
-
-
-
-
-
-$as_echo "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
-
-
-
-
-  :
-
+    if test $gl_have_mmap_anonymous != yes; then
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <sys/mman.h>
+#ifdef MAP_ANON
+    I cannot identify this map
+#endif
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_CLOSE_STREAM 1
 _ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "I cannot identify this map" >/dev/null 2>&1
+then :
 
+printf "%s\n" "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
+         gl_have_mmap_anonymous=yes
+fi
+rm -rf conftest*
 
-  :
-
-
-  :
-
-
-
-          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
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
+printf "%s\n" "$gl_have_mmap_anonymous" >&6; }
+    if test $gl_have_mmap_anonymous = yes; then
 
-  fi
-    if test "x$runstatedir" = x; then
-    runstatedir='${localstatedir}/run'
+printf "%s\n" "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
+    fi
   fi
 
-      pkglibexecdir='${libexecdir}/${PACKAGE}'
-
-
-
-
 
 
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_DIRNAME 1
-_ACEOF
-
 
 
 
 
 
 
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
-$as_echo_n "checking whether // is distinct from /... " >&6; }
-if ${gl_cv_double_slash_root+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-   if test x"$cross_compiling" = xyes ; then
-        # When cross-compiling, there is no way to tell whether // is special
-        # short of a list of hosts.  However, the only known hosts to date
-        # that have a distinct // are Apollo DomainOS (too old to port to),
-        # Cygwin, and z/OS.  If anyone knows of another system for which // has
-        # special semantics and is distinct from /, please report it to
-        # <bug-gnulib@gnu.org>.
-        case $host in
-          *-cygwin | i370-ibm-openedition)
-            gl_cv_double_slash_root=yes ;;
-          *)
-            # Be optimistic and assume that / and // are the same when we
-            # don't know.
-            gl_cv_double_slash_root='unknown, assuming no' ;;
+  # Detect platform-specific bugs in some versions of glibc:
+  # memchr should not dereference anything with length 0
+  #   https://bugzilla.redhat.com/show_bug.cgi?id=499689
+  # memchr should not dereference overestimated length after a match
+  #   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+  #   https://sourceware.org/bugzilla/show_bug.cgi?id=10162
+  # memchr should cast the second argument to 'unsigned char'.
+  #   This bug exists in Android 4.3.
+  # Assume that memchr works on platforms that lack mprotect.
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether memchr works" >&5
+printf %s "checking whether memchr works... " >&6; }
+if test ${gl_cv_func_memchr_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                           # Guess no on Android.
+          linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
+                           # Guess yes on native Windows.
+          mingw*)          gl_cv_func_memchr_works="guessing yes" ;;
+                           # If we don't know, obey --enable-cross-guesses.
+          *)               gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
         esac
-      else
-        set x `ls -di / // 2>/dev/null`
-        if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
-          gl_cv_double_slash_root=no
-        else
-          gl_cv_double_slash_root=yes
-        fi
-      fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
-$as_echo "$gl_cv_double_slash_root" >&6; }
-  if test "$gl_cv_double_slash_root" = yes; then
-
-$as_echo "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
-
-  fi
 
-
-
-
-
-
-$as_echo "#define HAVE_DUP2 1" >>confdefs.h
-
-
-  if test $HAVE_DUP2 = 1; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
-$as_echo_n "checking whether dup2 works... " >&6; }
-if ${gl_cv_func_dup2_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-           mingw*) # on this platform, dup2 always returns 0 for success
-             gl_cv_func_dup2_works="guessing no" ;;
-           cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
-             gl_cv_func_dup2_works="guessing no" ;;
-           aix* | freebsd*)
-                   # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
-                   # not EBADF.
-             gl_cv_func_dup2_works="guessing no" ;;
-           haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
-             gl_cv_func_dup2_works="guessing no" ;;
-           *-android*) # implemented using dup3(), which fails if oldfd == newfd
-             gl_cv_func_dup2_works="guessing no" ;;
-           os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
-             gl_cv_func_dup2_works="guessing no" ;;
-           *) gl_cv_func_dup2_works="guessing yes" ;;
-         esac
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-         #include <errno.h>
-             #include <fcntl.h>
-             #include <limits.h>
-             #include <sys/resource.h>
-             #include <unistd.h>
-             #ifndef RLIM_SAVED_CUR
-             # define RLIM_SAVED_CUR RLIM_INFINITY
-             #endif
-             #ifndef RLIM_SAVED_MAX
-             # define RLIM_SAVED_MAX RLIM_INFINITY
-             #endif
+#include <string.h>
+#if HAVE_SYS_MMAN_H
+# include <fcntl.h>
+# include <unistd.h>
+# include <sys/types.h>
+# include <sys/mman.h>
+# ifndef MAP_FILE
+#  define MAP_FILE 0
+# endif
+#endif
 
 int
-main ()
+main (void)
 {
-int result = 0;
-             int bad_fd = INT_MAX;
-             struct rlimit rlim;
-             if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
-                 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
-                 && rlim.rlim_cur != RLIM_INFINITY
-                 && rlim.rlim_cur != RLIM_SAVED_MAX
-                 && rlim.rlim_cur != RLIM_SAVED_CUR)
-               bad_fd = rlim.rlim_cur;
-             #ifdef FD_CLOEXEC
-               if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
-                 result |= 1;
-             #endif
-             if (dup2 (1, 1) != 1)
-               result |= 2;
-             #ifdef FD_CLOEXEC
-               if (fcntl (1, F_GETFD) != FD_CLOEXEC)
-                 result |= 4;
-             #endif
-             close (0);
-             if (dup2 (0, 0) != -1)
-               result |= 8;
-             /* Many gnulib modules require POSIX conformance of EBADF.  */
-             if (dup2 (2, bad_fd) == -1 && errno != EBADF)
-               result |= 16;
-             /* Flush out some cygwin core dumps.  */
-             if (dup2 (2, -1) != -1 || errno != EBADF)
-               result |= 32;
-             dup2 (2, 255);
-             dup2 (2, 256);
-             /* On OS/2 kLIBC, dup2() does not work on a directory fd.  */
-             {
-               int fd = open (".", O_RDONLY);
-               if (fd == -1)
-                 result |= 64;
-               else if (dup2 (fd, fd + 1) == -1)
-                 result |= 128;
 
-               close (fd);
-             }
-             return result;
+  int result = 0;
+  char *fence = NULL;
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+# if HAVE_MAP_ANONYMOUS
+  const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
+  const int fd = -1;
+# else /* !HAVE_MAP_ANONYMOUS */
+  const int flags = MAP_FILE | MAP_PRIVATE;
+  int fd = open ("/dev/zero", O_RDONLY, 0666);
+  if (fd >= 0)
+# endif
+    {
+      int pagesize = getpagesize ();
+      char *two_pages =
+        (char *) mmap (NULL, 2 * pagesize, PROT_READ | PROT_WRITE,
+                       flags, fd, 0);
+      if (two_pages != (char *)(-1)
+          && mprotect (two_pages + pagesize, pagesize, PROT_NONE) == 0)
+        fence = two_pages + pagesize;
+    }
+#endif
+  if (fence)
+    {
+      /* Test against bugs on glibc systems.  */
+      if (memchr (fence, 0, 0))
+        result |= 1;
+      strcpy (fence - 9, "12345678");
+      if (memchr (fence - 9, 0, 79) != fence - 1)
+        result |= 2;
+      if (memchr (fence - 1, 0, 3) != fence - 1)
+        result |= 4;
+      /* Test against bug on AIX 7.2.  */
+      if (memchr (fence - 4, '6', 16) != fence - 4)
+        result |= 8;
+    }
+  /* Test against bug on Android 4.3.  */
+  {
+    char input[3];
+    input[0] = 'a';
+    input[1] = 'b';
+    input[2] = 'c';
+    if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
+      result |= 16;
+  }
+  return result;
+
   ;
   return 0;
 }
-
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_dup2_works=yes
-else
-  gl_cv_func_dup2_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_memchr_works=yes
+else $as_nop
+  gl_cv_func_memchr_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
-$as_echo "$gl_cv_func_dup2_works" >&6; }
-    case "$gl_cv_func_dup2_works" in
-      *yes) ;;
-      *)
-        REPLACE_DUP2=1
-        for ac_func in setdtablesize
-do :
-  ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
-if test "x$ac_cv_func_setdtablesize" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SETDTABLESIZE 1
-_ACEOF
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_memchr_works" >&5
+printf "%s\n" "$gl_cv_func_memchr_works" >&6; }
+  case "$gl_cv_func_memchr_works" in
+    *yes) ;;
+    *) REPLACE_MEMCHR=1 ;;
+  esac
 
+ac_fn_check_decl "$LINENO" "memrchr" "ac_cv_have_decl_memrchr" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_memrchr" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
 fi
-done
-
-        ;;
-    esac
-  fi
-
-
-  if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
-
-
+printf "%s\n" "#define HAVE_DECL_MEMRCHR $ac_have_decl" >>confdefs.h
 
 
 
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <limits.h> defines MIN and MAX" >&5
+printf %s "checking whether <limits.h> defines MIN and MAX... " >&6; }
+if test ${gl_cv_minmax_in_limits_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+            int x = MIN (42, 17);
+int
+main (void)
+{
 
-  M4_LIBOBJS="$M4_LIBOBJS dup2.$ac_objext"
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_minmax_in_limits_h=yes
+else $as_nop
+  gl_cv_minmax_in_limits_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_limits_h" >&5
+printf "%s\n" "$gl_cv_minmax_in_limits_h" >&6; }
+  if test $gl_cv_minmax_in_limits_h = yes; then
 
+printf "%s\n" "#define HAVE_MINMAX_IN_LIMITS_H 1" >>confdefs.h
 
   fi
 
 
 
 
-          GNULIB_DUP2=1
-
-
-
-
-
-$as_echo "#define GNULIB_TEST_DUP2 1" >>confdefs.h
-
-
-
-
-
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/param.h> defines MIN and MAX" >&5
+printf %s "checking whether <sys/param.h> defines MIN and MAX... " >&6; }
+if test ${gl_cv_minmax_in_sys_param_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/param.h>
+            int x = MIN (42, 17);
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_minmax_in_sys_param_h=yes
+else $as_nop
+  gl_cv_minmax_in_sys_param_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_minmax_in_sys_param_h" >&5
+printf "%s\n" "$gl_cv_minmax_in_sys_param_h" >&6; }
+  if test $gl_cv_minmax_in_sys_param_h = yes; then
 
+printf "%s\n" "#define HAVE_MINMAX_IN_SYS_PARAM_H 1" >>confdefs.h
 
-          GNULIB_ENVIRON=1
+  fi
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
 
 
 
 
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
-$as_echo_n "checking for error_at_line... " >&6; }
-if ${ac_cv_lib_error_at_line+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for O_CLOEXEC" >&5
+printf %s "checking for O_CLOEXEC... " >&6; }
+if test ${gl_cv_macro_O_CLOEXEC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <error.h>
+#include <fcntl.h>
+                          #ifndef O_CLOEXEC
+                            choke me;
+                          #endif
+
 int
-main ()
+main (void)
 {
-error_at_line (0, 0, "", 0, "an error occurred");
+return O_CLOEXEC;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_lib_error_at_line=yes
-else
-  ac_cv_lib_error_at_line=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_macro_O_CLOEXEC=yes
+else $as_nop
+  gl_cv_macro_O_CLOEXEC=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
-$as_echo "$ac_cv_lib_error_at_line" >&6; }
-
-  if test $ac_cv_lib_error_at_line = no; then
-
-
-
-
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_macro_O_CLOEXEC" >&5
+printf "%s\n" "$gl_cv_macro_O_CLOEXEC" >&6; }
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS error.$ac_objext"
-
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for promoted mode_t type" >&5
+printf %s "checking for promoted mode_t type... " >&6; }
+if test ${gl_cv_promoted_mode_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+int
+main (void)
+{
+typedef int array[2 * (sizeof (mode_t) < sizeof (int)) - 1];
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_promoted_mode_t='int'
+else $as_nop
+  gl_cv_promoted_mode_t='mode_t'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
-  :
-
-  fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_promoted_mode_t" >&5
+printf "%s\n" "$gl_cv_promoted_mode_t" >&6; }
 
+printf "%s\n" "#define PROMOTED_MODE_T $gl_cv_promoted_mode_t" >>confdefs.h
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format"
 
 
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format"
 
 
+    HAVE_POSIX_SPAWN=1;
+  HAVE_POSIX_SPAWNATTR_T=1;
+  HAVE_POSIX_SPAWN_FILE_ACTIONS_T=1;
 
+  HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=1;
 
+  HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=1;
 
+  REPLACE_POSIX_SPAWN=0;
+  REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0;
 
+  REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0;
 
+  REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0;
 
-  :
+  REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=0;
 
+  REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0;
 
 
 
 
 
+  LIB_POSIX_SPAWN=
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
-$as_echo_n "checking whether fflush works on input streams... " >&6; }
-if ${gl_cv_func_fflush_stdin+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  echo hello world > conftest.txt
-     if test "$cross_compiling" = yes; then :
-  gl_cv_func_fflush_stdin=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  gl_saved_libs=$LIBS
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing posix_spawn" >&5
+printf %s "checking for library containing posix_spawn... " >&6; }
+if test ${ac_cv_search_posix_spawn+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdio.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#else /* on Windows with MSVC */
-# include <io.h>
-#endif
-
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char posix_spawn ();
 int
-main ()
+main (void)
 {
-FILE *f = fopen ("conftest.txt", "r");
-         char buffer[10];
-         int fd;
-         int c;
-         if (f == NULL)
-           return 1;
-         fd = fileno (f);
-         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
-           return 2;
-         /* For deterministic results, ensure f read a bigger buffer.  */
-         if (lseek (fd, 0, SEEK_CUR) == 5)
-           return 3;
-         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
-            on BSD systems and on mingw.  */
-         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
-           return 4;
-         if (lseek (fd, 0, SEEK_CUR) != 5)
-           return 5;
-         /* Verify behaviour of fflush after ungetc. See
-            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
-         /* Verify behaviour of fflush after a backup ungetc.  This fails on
-            mingw.  */
-         c = fgetc (f);
-         ungetc (c, f);
-         fflush (f);
-         if (fgetc (f) != c)
-           return 6;
-         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
-            on glibc 2.8 and on BSD systems.  */
-         c = fgetc (f);
-         ungetc ('@', f);
-         fflush (f);
-         if (fgetc (f) != c)
-           return 7;
-         return 0;
-
+return posix_spawn ();
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_fflush_stdin=yes
-else
-  gl_cv_func_fflush_stdin=no
+for ac_lib in '' rt
+do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_search_posix_spawn=$ac_res
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext
+  if test ${ac_cv_search_posix_spawn+y}
+then :
+  break
 fi
+done
+if test ${ac_cv_search_posix_spawn+y}
+then :
 
-     rm conftest.txt
-
+else $as_nop
+  ac_cv_search_posix_spawn=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_posix_spawn" >&5
+printf "%s\n" "$ac_cv_search_posix_spawn" >&6; }
+ac_res=$ac_cv_search_posix_spawn
+if test "$ac_res" != no
+then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  test "$ac_cv_search_posix_spawn" = "none required" ||
+                    LIB_POSIX_SPAWN=$ac_cv_search_posix_spawn
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
-$as_echo "$gl_cv_func_fflush_stdin" >&6; }
-  case $gl_cv_func_fflush_stdin in
-    yes) gl_func_fflush_stdin=1 ;;
-    no)  gl_func_fflush_stdin=0 ;;
-    *)   gl_func_fflush_stdin='(-1)' ;;
-  esac
-
-cat >>confdefs.h <<_ACEOF
-#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
-_ACEOF
 
+    ac_fn_c_check_func "$LINENO" "posix_spawn" "ac_cv_func_posix_spawn"
+if test "x$ac_cv_func_posix_spawn" = xyes
+then :
+  printf "%s\n" "#define HAVE_POSIX_SPAWN 1" >>confdefs.h
 
-  if test $gl_cv_func_fflush_stdin != yes; then
-    REPLACE_FCLOSE=1
-  fi
+fi
 
+  LIBS=$gl_saved_libs
 
-  if test $REPLACE_CLOSE = 1; then
-    REPLACE_FCLOSE=1
+  if test $ac_cv_func_posix_spawn != yes; then
+    HAVE_POSIX_SPAWN=0
   fi
 
-  case "$host_os" in
-    openedition) REPLACE_FCLOSE=1 ;;
-  esac
-
-  if test $REPLACE_FCLOSE = 1; then
-
-
 
 
 
 
+                                      ac_fn_check_decl "$LINENO" "posix_spawn" "ac_cv_have_decl_posix_spawn" "#include <spawn.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_posix_spawn" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_POSIX_SPAWN $ac_have_decl" >>confdefs.h
 
+  if test $ac_cv_func_posix_spawn = yes; then
 
-  M4_LIBOBJS="$M4_LIBOBJS fclose.$ac_objext"
-
-  fi
-
+       if test $ac_cv_func_posix_spawn_file_actions_addchdir_np = no; then
+                           REPLACE_POSIX_SPAWN=1
+       fi
 
 
+    if test $REPLACE_POSIX_SPAWN = 0; then
 
 
-          GNULIB_FCLOSE=1
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn works" >&5
+printf %s "checking whether posix_spawn works... " >&6; }
+if test ${gl_cv_func_posix_spawn_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test $cross_compiling = no; then
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <spawn.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
 
 
+$gl_mda_defines
 
 
-$as_echo "#define GNULIB_TEST_FCLOSE 1" >>confdefs.h
+extern char **environ;
 
+#ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+# define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+# define STDERR_FILENO 2
+#endif
 
+#ifndef WTERMSIG
+# define WTERMSIG(x) ((x) & 0x7f)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(x) (WTERMSIG (x) == 0)
+#endif
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
+#endif
+
+#define CHILD_PROGRAM_FILENAME "/non/exist/ent"
+
+static int
+fd_safer (int fd)
+{
+  if (0 <= fd && fd <= 2)
+    {
+      int f = fd_safer (dup (fd));
+      int e = errno;
+      close (fd);
+      errno = e;
+      fd = f;
+    }
 
+  return fd;
+}
 
+int
+main ()
+{
+  char *argv[2] = { CHILD_PROGRAM_FILENAME, NULL };
+  int ofd[2];
+  sigset_t blocked_signals;
+  sigset_t fatal_signal_set;
+  posix_spawn_file_actions_t actions;
+  bool actions_allocated;
+  posix_spawnattr_t attrs;
+  bool attrs_allocated;
+  int err;
+  pid_t child;
+  int status;
+  int exitstatus;
 
+  setvbuf (stdout, NULL, _IOFBF, 0);
+  puts ("This should be seen only once.");
+  if (pipe (ofd) < 0 || (ofd[1] = fd_safer (ofd[1])) < 0)
+    {
+      perror ("cannot create pipe");
+      exit (1);
+    }
+  sigprocmask (SIG_SETMASK, NULL, &blocked_signals);
+  sigemptyset (&fatal_signal_set);
+  sigaddset (&fatal_signal_set, SIGINT);
+  sigaddset (&fatal_signal_set, SIGTERM);
+  sigaddset (&fatal_signal_set, SIGHUP);
+  sigaddset (&fatal_signal_set, SIGPIPE);
+  sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL);
+  actions_allocated = false;
+  attrs_allocated = false;
+  if ((err = posix_spawn_file_actions_init (&actions)) != 0
+      || (actions_allocated = true,
+          (err = posix_spawn_file_actions_adddup2 (&actions, ofd[0], STDIN_FILENO)) != 0
+          || (err = posix_spawn_file_actions_addclose (&actions, ofd[0])) != 0
+          || (err = posix_spawn_file_actions_addclose (&actions, ofd[1])) != 0
+          || (err = posix_spawnattr_init (&attrs)) != 0
+          || (attrs_allocated = true,
+              (err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0
+              || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0)
+          || (err = posix_spawnp (&child, CHILD_PROGRAM_FILENAME, &actions, &attrs, argv, environ)) != 0))
+    {
+      if (actions_allocated)
+        posix_spawn_file_actions_destroy (&actions);
+      if (attrs_allocated)
+        posix_spawnattr_destroy (&attrs);
+      sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
+      if (err == ENOENT)
+        return 0;
+      else
+        {
+          errno = err;
+          perror ("subprocess failed");
+          exit (1);
+        }
+    }
+  posix_spawn_file_actions_destroy (&actions);
+  posix_spawnattr_destroy (&attrs);
+  sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
+  close (ofd[0]);
+  close (ofd[1]);
+  status = 0;
+  while (waitpid (child, &status, 0) != child)
+    ;
+  if (!WIFEXITED (status))
+    {
+      fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+      exit (1);
+    }
+  exitstatus = WEXITSTATUS (status);
+  if (exitstatus != 127)
+    {
+      fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+      exit (1);
+    }
+  return 0;
+}
 
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  if test -s conftest$ac_exeext \
+             && ./conftest$ac_exeext > conftest.out \
+             && echo 'This should be seen only once.' > conftest.ok \
+             && cmp conftest.out conftest.ok >/dev/null 2>&1; then
+            gl_cv_func_posix_spawn_works=yes
+          else
+            gl_cv_func_posix_spawn_works=no
+          fi
+else $as_nop
+  gl_cv_func_posix_spawn_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+       if test $gl_cv_func_posix_spawn_works = yes; then
+         if test "$cross_compiling" = yes
+then :
+  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Test whether posix_spawn_file_actions_addopen supports filename arguments
+   that contain special characters such as '*'.  */
 
-  if test $ac_cv_func_fcntl = no; then
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <spawn.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
 
 
+$gl_mda_defines
 
-  if test $ac_cv_func_fcntl = no; then
-    HAVE_FCNTL=0
-  else
-    REPLACE_FCNTL=1
-  fi
 
+extern char **environ;
+
+#ifndef STDIN_FILENO
+# define STDIN_FILENO 0
+#endif
+#ifndef STDOUT_FILENO
+# define STDOUT_FILENO 1
+#endif
+#ifndef STDERR_FILENO
+# define STDERR_FILENO 2
+#endif
+
+#ifndef WTERMSIG
+# define WTERMSIG(x) ((x) & 0x7f)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(x) (WTERMSIG (x) == 0)
+#endif
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(x) (((x) >> 8) & 0xff)
+#endif
+
+#define CHILD_PROGRAM_FILENAME "conftest"
+#define DATA_FILENAME "conftest%=*#?"
+
+static int
+parent_main (void)
+{
+  FILE *fp;
+  char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
+  posix_spawn_file_actions_t actions;
+  bool actions_allocated;
+  int err;
+  pid_t child;
+  int status;
+  int exitstatus;
+
+  /* Create a data file with specific contents.  */
+  fp = fopen (DATA_FILENAME, "wb");
+  if (fp == NULL)
+    {
+      perror ("cannot create data file");
+      return 1;
+    }
+  fwrite ("Halle Potta", 1, 11, fp);
+  if (fflush (fp) || fclose (fp))
+    {
+      perror ("cannot prepare data file");
+      return 2;
+    }
+
+  /* Avoid reading from our stdin, as it could block.  */
+  freopen ("/dev/null", "rb", stdin);
+
+  /* Test whether posix_spawn_file_actions_addopen with this file name
+     actually works, but spawning a child that reads from this file.  */
+  actions_allocated = false;
+  if ((err = posix_spawn_file_actions_init (&actions)) != 0
+      || (actions_allocated = true,
+          (err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, DATA_FILENAME, O_RDONLY, 0600)) != 0
+          || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0))
+    {
+      if (actions_allocated)
+        posix_spawn_file_actions_destroy (&actions);
+      errno = err;
+      perror ("subprocess failed");
+      return 3;
+    }
+  posix_spawn_file_actions_destroy (&actions);
+  status = 0;
+  while (waitpid (child, &status, 0) != child)
+    ;
+  if (!WIFEXITED (status))
+    {
+      fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+      return 4;
+    }
+  exitstatus = WEXITSTATUS (status);
+  if (exitstatus != 0)
+    {
+      fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+      return 5;
+    }
+  return 0;
+}
+
+static int
+child_main (void)
+{
+  char buf[1024];
+
+  /* See if reading from STDIN_FILENO yields the expected contents.  */
+  if (fread (buf, 1, sizeof (buf), stdin) == 11
+      && memcmp (buf, "Halle Potta", 11) == 0)
+    return 0;
   else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
-$as_echo_n "checking whether fcntl handles F_DUPFD correctly... " >&6; }
-if ${gl_cv_func_fcntl_f_dupfd_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  case $host_os in
-            aix* | cygwin* | haiku*)
-               gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
-            *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
-          esac
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <errno.h>
-              #include <fcntl.h>
-              #include <limits.h>
-              #include <sys/resource.h>
-              #include <unistd.h>
-              #ifndef RLIM_SAVED_CUR
-              # define RLIM_SAVED_CUR RLIM_INFINITY
-              #endif
-              #ifndef RLIM_SAVED_MAX
-              # define RLIM_SAVED_MAX RLIM_INFINITY
-              #endif
+    return 8;
+}
+
+static void
+cleanup_then_die (int sig)
+{
+  /* Clean up data file.  */
+  unlink (DATA_FILENAME);
+
+  /* Re-raise the signal and die from it.  */
+  signal (sig, SIG_DFL);
+  raise (sig);
+}
 
 int
-main ()
+main (int argc, char *argv[])
 {
-int result = 0;
-              int bad_fd = INT_MAX;
-              struct rlimit rlim;
-              if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
-                  && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
-                  && rlim.rlim_cur != RLIM_INFINITY
-                  && rlim.rlim_cur != RLIM_SAVED_MAX
-                  && rlim.rlim_cur != RLIM_SAVED_CUR)
-                bad_fd = rlim.rlim_cur;
-              if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
-              if (errno != EINVAL) result |= 2;
-              if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
-              if (errno != EINVAL) result |= 8;
-              /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
-              {
-                int fd;
-                fd = open (".", O_RDONLY);
-                if (fd == -1)
-                  result |= 16;
-                else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
-                  result |= 32;
+  int exitstatus;
 
-                close (fd);
-              }
-              return result;
-  ;
-  return 0;
+  if (!(argc > 1 && strcmp (argv[1], "-child") == 0))
+    {
+      /* This is the parent process.  */
+      signal (SIGINT, cleanup_then_die);
+      signal (SIGTERM, cleanup_then_die);
+      #ifdef SIGHUP
+      signal (SIGHUP, cleanup_then_die);
+      #endif
+
+      exitstatus = parent_main ();
+    }
+  else
+    {
+      /* This is the child process.  */
+
+      exitstatus = child_main ();
+    }
+  unlink (DATA_FILENAME);
+  return exitstatus;
 }
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_fcntl_f_dupfd_works=yes
-else
-  gl_cv_func_fcntl_f_dupfd_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+
+else $as_nop
+  gl_cv_func_posix_spawn_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+       fi
+     else
+       case "$host_os" in
+         aix*) gl_cv_func_posix_spawn_works="guessing no";;
+         *)    gl_cv_func_posix_spawn_works="guessing yes";;
+       esac
+     fi
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
-$as_echo "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
-    case $gl_cv_func_fcntl_f_dupfd_works in
-      *yes) ;;
-      *)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_works" >&5
+printf "%s\n" "$gl_cv_func_posix_spawn_works" >&6; }
 
+      case "$gl_cv_func_posix_spawn_works" in
+        *yes) ;;
+        *) REPLACE_POSIX_SPAWN=1 ;;
+      esac
+    fi
+    if test $REPLACE_POSIX_SPAWN = 0; then
+
+
+         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn rejects scripts without shebang" >&5
+printf %s "checking whether posix_spawn rejects scripts without shebang... " >&6; }
+if test ${gl_cv_func_posix_spawn_secure_exec+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  echo ':' > conftest.scr
+     chmod a+x conftest.scr
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+          # Guess no on GNU/Hurd.
+          gnu*)
+            gl_cv_func_posix_spawn_secure_exec="guessing no" ;;
+          # Guess yes on all other platforms.
+          *)
+            gl_cv_func_posix_spawn_secure_exec="guessing yes" ;;
+        esac
 
-  if test $ac_cv_func_fcntl = no; then
-    HAVE_FCNTL=0
-  else
-    REPLACE_FCNTL=1
-  fi
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+       #include <errno.h>
+       #include <spawn.h>
+       #include <stddef.h>
+       #include <sys/types.h>
+       #include <sys/wait.h>
+       int
+       main ()
+       {
+         const char *prog_path = "./conftest.scr";
+         const char *prog_argv[2] = { prog_path, NULL };
+         const char *environment[2] = { "PATH=.", NULL };
+         pid_t child;
+         int status;
+         int err = posix_spawn (&child, prog_path, NULL, NULL,
+                                (char **) prog_argv, (char **) environment);
+         if (err == ENOEXEC)
+           return 0;
+         if (err != 0)
+           return 1;
+         status = 0;
+         while (waitpid (child, &status, 0) != child)
+           ;
+         if (!WIFEXITED (status))
+           return 2;
+         if (WEXITSTATUS (status) != 127)
+           return 3;
+         return 0;
+       }
 
-$as_echo "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
- ;;
-    esac
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_posix_spawn_secure_exec=yes
+else $as_nop
+  gl_cv_func_posix_spawn_secure_exec=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
-$as_echo_n "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
-if ${gl_cv_func_fcntl_f_dupfd_cloexec+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+     rm -f conftest.scr
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_secure_exec" >&5
+printf "%s\n" "$gl_cv_func_posix_spawn_secure_exec" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether posix_spawnp rejects scripts without shebang" >&5
+printf %s "checking whether posix_spawnp rejects scripts without shebang... " >&6; }
+if test ${gl_cv_func_posix_spawnp_secure_exec+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  echo ':' > conftest.scr
+     chmod a+x conftest.scr
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+          # Guess yes on glibc systems (glibc >= 2.15 actually) except GNU/Hurd,
+          # musl libc, NetBSD.
+          *-gnu* | *-musl* | netbsd*)
+            gl_cv_func_posix_spawnp_secure_exec="guessing yes" ;;
+          # Guess no on GNU/Hurd, macOS, FreeBSD, OpenBSD, AIX, Solaris, Cygwin.
+          gnu* | darwin* | freebsd* | dragonfly* | midnightbsd* | openbsd* | \
+          aix* | solaris* | cygwin*)
+            gl_cv_func_posix_spawnp_secure_exec="guessing no" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *)
+            gl_cv_func_posix_spawnp_secure_exec="$gl_cross_guess_normal" ;;
+        esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <fcntl.h>
-#ifndef F_DUPFD_CLOEXEC
-choke me
-#endif
-
-int
-main ()
-{
+       #include <errno.h>
+       #include <spawn.h>
+       #include <stddef.h>
+       #include <sys/types.h>
+       #include <sys/wait.h>
+       int
+       main ()
+       {
+         const char *prog_path = "./conftest.scr";
+         const char *prog_argv[2] = { prog_path, NULL };
+         const char *environment[2] = { "PATH=.", NULL };
+         pid_t child;
+         int status;
+         int err = posix_spawnp (&child, prog_path, NULL, NULL,
+                                 (char **) prog_argv, (char **) environment);
+         if (err == ENOEXEC)
+           return 0;
+         if (err != 0)
+           return 1;
+         status = 0;
+         while (waitpid (child, &status, 0) != child)
+           ;
+         if (!WIFEXITED (status))
+           return 2;
+         if (WEXITSTATUS (status) != 127)
+           return 3;
+         return 0;
+       }
 
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_posix_spawnp_secure_exec=yes
+else $as_nop
+  gl_cv_func_posix_spawnp_secure_exec=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+     rm -f conftest.scr
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawnp_secure_exec" >&5
+printf "%s\n" "$gl_cv_func_posix_spawnp_secure_exec" >&6; }
+
+      case "$gl_cv_func_posix_spawn_secure_exec" in
+        *yes) ;;
+        *) REPLACE_POSIX_SPAWN=1 ;;
+      esac
+      case "$gl_cv_func_posix_spawnp_secure_exec" in
+        *yes) ;;
+        *) REPLACE_POSIX_SPAWN=1 ;;
+      esac
+    fi
+    if test $REPLACE_POSIX_SPAWN = 0; then
+                              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether posix_spawnattr_setschedpolicy is supported" >&5
+printf %s "checking whether posix_spawnattr_setschedpolicy is supported... " >&6; }
+if test ${gl_cv_func_spawnattr_setschedpolicy+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#ifdef __linux__
-/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
-   it to support the semantics on older kernels that failed with EINVAL.  */
-choke me
+#include <spawn.h>
+#if POSIX_SPAWN_SETSCHEDULER
+ POSIX scheduling supported
 #endif
 
-int
-main ()
-{
-
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_fcntl_f_dupfd_cloexec=yes
-else
-  gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
-  gl_cv_func_fcntl_f_dupfd_cloexec=no
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "POSIX scheduling supported" >/dev/null 2>&1
+then :
+  gl_cv_func_spawnattr_setschedpolicy=yes
+else $as_nop
+  gl_cv_func_spawnattr_setschedpolicy=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest*
+
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
-$as_echo "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
-    if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_spawnattr_setschedpolicy" >&5
+printf "%s\n" "$gl_cv_func_spawnattr_setschedpolicy" >&6; }
+                              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether posix_spawnattr_setschedparam is supported" >&5
+printf %s "checking whether posix_spawnattr_setschedparam is supported... " >&6; }
+if test ${gl_cv_func_spawnattr_setschedparam+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <spawn.h>
+#if POSIX_SPAWN_SETSCHEDPARAM
+ POSIX scheduling supported
+#endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "POSIX scheduling supported" >/dev/null 2>&1
+then :
+  gl_cv_func_spawnattr_setschedparam=yes
+else $as_nop
+  gl_cv_func_spawnattr_setschedparam=no
+fi
+rm -rf conftest*
 
-  if test $ac_cv_func_fcntl = no; then
-    HAVE_FCNTL=0
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_spawnattr_setschedparam" >&5
+printf "%s\n" "$gl_cv_func_spawnattr_setschedparam" >&6; }
+    fi
   else
-    REPLACE_FCNTL=1
+                if test $ac_cv_have_decl_posix_spawn = yes; then
+                              REPLACE_POSIX_SPAWN=1
+    fi
   fi
+  if test $ac_cv_func_posix_spawn != yes || test $REPLACE_POSIX_SPAWN = 1; then
+
+printf "%s\n" "#define REPLACE_POSIX_SPAWN 1" >>confdefs.h
 
-          fi
   fi
 
 
-  if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
 
+  GL_M4_GNULIB_POSIX_SPAWN=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWNP=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=0
 
-  M4_LIBOBJS="$M4_LIBOBJS fcntl.$ac_objext"
 
-  fi
 
+  GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0
 
-          GNULIB_FCNTL=1
 
 
+  GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0
 
 
 
-$as_echo "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
+  GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWNATTR_INIT=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS=0
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_fcntl_h='<'fcntl.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <fcntl.h>" >&5
-$as_echo_n "checking absolute name of <fcntl.h>... " >&6; }
-if ${gl_cv_next_fcntl_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
+  GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS=0
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <fcntl.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'fcntl.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
+  GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP=0
 
-        gl_cv_absolute_fcntl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_fcntl_h
-           gl_cv_next_fcntl_h='"'$gl_header'"'
 
+  GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP=0
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_fcntl_h" >&5
-$as_echo "$gl_cv_next_fcntl_h" >&6; }
-     fi
-     NEXT_FCNTL_H=$gl_cv_next_fcntl_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='<'fcntl.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_fcntl_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_FCNTL_H=$gl_next_as_first_directive
 
+  GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY=0
 
 
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_FD_SAFER_FLAG 1
-_ACEOF
+  GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT=0
 
 
 
+  GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT=0
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
-$as_echo_n "checking whether fflush works on input streams... " >&6; }
-if ${gl_cv_func_fflush_stdin+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  echo hello world > conftest.txt
-     if test "$cross_compiling" = yes; then :
-  gl_cv_func_fflush_stdin=cross
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK=0
 
-#include <stdio.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#else /* on Windows with MSVC */
-# include <io.h>
-#endif
 
-int
-main ()
-{
-FILE *f = fopen ("conftest.txt", "r");
-         char buffer[10];
-         int fd;
-         int c;
-         if (f == NULL)
-           return 1;
-         fd = fileno (f);
-         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
-           return 2;
-         /* For deterministic results, ensure f read a bigger buffer.  */
-         if (lseek (fd, 0, SEEK_CUR) == 5)
-           return 3;
-         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
-            on BSD systems and on mingw.  */
-         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
-           return 4;
-         if (lseek (fd, 0, SEEK_CUR) != 5)
-           return 5;
-         /* Verify behaviour of fflush after ungetc. See
-            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
-         /* Verify behaviour of fflush after a backup ungetc.  This fails on
-            mingw.  */
-         c = fgetc (f);
-         ungetc (c, f);
-         fflush (f);
-         if (fgetc (f) != c)
-           return 6;
-         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
-            on glibc 2.8 and on BSD systems.  */
-         c = fgetc (f);
-         ungetc ('@', f);
-         fflush (f);
-         if (fgetc (f) != c)
-           return 7;
-         return 0;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_fflush_stdin=yes
-else
-  gl_cv_func_fflush_stdin=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK=0
 
-     rm conftest.txt
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
-$as_echo "$gl_cv_func_fflush_stdin" >&6; }
-  case $gl_cv_func_fflush_stdin in
-    yes) gl_func_fflush_stdin=1 ;;
-    no)  gl_func_fflush_stdin=0 ;;
-    *)   gl_func_fflush_stdin='(-1)' ;;
-  esac
 
-cat >>confdefs.h <<_ACEOF
-#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
-_ACEOF
+  GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY=0
+
 
 
-  if test $gl_cv_func_fflush_stdin != yes; then
-    REPLACE_FFLUSH=1
-  fi
 
-  if test $REPLACE_FFLUSH = 1; then
 
+    HAVE_POSIX_SIGNALBLOCKING=1;
+  HAVE_PTHREAD_SIGMASK=1;
+  HAVE_RAISE=1;
+  HAVE_SIGSET_T=1;
+  HAVE_SIGINFO_T=1;
+  HAVE_SIGACTION=1;
+  HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
 
+  HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=1;
 
+  HAVE_SIGHANDLER_T=1;
+  REPLACE_PTHREAD_SIGMASK=0;
+  REPLACE_RAISE=0;
 
 
+  ac_fn_c_check_type "$LINENO" "sigset_t" "ac_cv_type_sigset_t" "
+      #include <signal.h>
+      /* Mingw defines sigset_t not in <signal.h>, but in <sys/types.h>.  */
+      #include <sys/types.h>
 
+"
+if test "x$ac_cv_type_sigset_t" = xyes
+then :
 
+printf "%s\n" "#define HAVE_SIGSET_T 1" >>confdefs.h
 
-  M4_LIBOBJS="$M4_LIBOBJS fflush.$ac_objext"
+gl_cv_type_sigset_t=yes
+else $as_nop
+  gl_cv_type_sigset_t=no
+fi
 
-    :
+  if test $gl_cv_type_sigset_t != yes; then
+    HAVE_SIGSET_T=0
   fi
 
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_FFLUSH 1
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIGPIPE" >&5
+printf %s "checking for SIGPIPE... " >&6; }
+if test ${gl_cv_header_signal_h_SIGPIPE+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <signal.h>
+#if !defined SIGPIPE
+booboo
+#endif
+
 _ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "booboo" >/dev/null 2>&1
+then :
+  gl_cv_header_signal_h_SIGPIPE=no
+else $as_nop
+  gl_cv_header_signal_h_SIGPIPE=yes
+fi
+rm -rf conftest*
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_signal_h_SIGPIPE" >&5
+printf "%s\n" "$gl_cv_header_signal_h_SIGPIPE" >&6; }
 
 
 
+  GL_M4_GNULIB_PTHREAD_SIGMASK=0
 
 
-          GNULIB_FFLUSH=1
 
+  GL_M4_GNULIB_RAISE=0
 
 
 
+  GL_M4_GNULIB_SIGNAL_H_SIGPIPE=0
 
-$as_echo "#define GNULIB_TEST_FFLUSH 1" >>confdefs.h
 
 
+  GL_M4_GNULIB_SIGPROCMASK=0
 
 
 
+  GL_M4_GNULIB_SIGACTION=0
 
 
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_FILENAMECAT 1
-_ACEOF
 
 
 
 
+  if test $REPLACE_MALLOC = 1; then
+    REPLACE_REALLOC=1
+  fi
 
 
 
 
-  FLOAT_H=
-  REPLACE_FLOAT_LDBL=0
-  case "$host_os" in
-    aix* | beos* | openbsd* | mirbsd* | irix*)
-      FLOAT_H=float.h
-      ;;
-    freebsd*)
-      case "$host_cpu" in
-        i[34567]86 )
-          FLOAT_H=float.h
-          ;;
-        x86_64 )
-          # On x86_64 systems, the C compiler may still be generating
-          # 32-bit code.
-          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined __LP64__ || defined __x86_64__ || defined __amd64__
-             yes
-             #endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
 
-else
-  FLOAT_H=float.h
-fi
-rm -f conftest*
 
-          ;;
-      esac
-      ;;
-    linux*)
-      case "$host_cpu" in
-        powerpc*)
-          FLOAT_H=float.h
-          ;;
-      esac
-      ;;
-  esac
-  case "$host_os" in
-    aix* | freebsd* | linux*)
-      if test -n "$FLOAT_H"; then
-        REPLACE_FLOAT_LDBL=1
-      fi
-      ;;
-  esac
+    HAVE_SCHED_YIELD=1;
+  REPLACE_SCHED_YIELD=0;
+
 
-    REPLACE_ITOLD=0
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
-$as_echo_n "checking whether conversion from 'int' to 'long double' works... " >&6; }
-if ${gl_cv_func_itold_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
-  case "$host" in
-           sparc*-*-linux*)
-             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined __LP64__ || defined __arch64__
-                yes
-                #endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "yes" >/dev/null 2>&1; then :
-  gl_cv_func_itold_works="guessing no"
-else
-  gl_cv_func_itold_works="guessing yes"
-fi
-rm -f conftest*
 
-             ;;
-           *) gl_cv_func_itold_works="guessing yes" ;;
-         esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-int i = -1;
-volatile long double ld;
-int main ()
-{
-  ld += i * 1.0L;
-  if (ld > 0)
-    return 1;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_itold_works=yes
-else
-  gl_cv_func_itold_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
+  ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "#if HAVE_SYS_CDEFS_H
+       #include <sys/cdefs.h>
+      #endif
+
+"
+if test "x$ac_cv_header_sched_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_SCHED_H 1" >>confdefs.h
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
-$as_echo "$gl_cv_func_itold_works" >&6; }
-  case "$gl_cv_func_itold_works" in
-    *no)
-      REPLACE_ITOLD=1
-                  FLOAT_H=float.h
-      ;;
-  esac
 
-  if test -n "$FLOAT_H"; then
 
 
 
@@ -22725,19 +24831,20 @@ $as_echo "$gl_cv_func_itold_works" >&6; }
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_float_h='<'float.h'>'
+       gl_cv_next_sched_h='<'sched.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
-$as_echo_n "checking absolute name of <float.h>... " >&6; }
-if ${gl_cv_next_float_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sched.h>" >&5
+printf %s "checking absolute name of <sched.h>... " >&6; }
+if test ${gl_cv_next_sched_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
 
 
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <float.h>
+#include <sched.h>
 _ACEOF
                 case "$host_os" in
     aix*) gl_absname_cpp="$ac_cpp -C" ;;
@@ -22753,7 +24860,7 @@ _ACEOF
       ;;
   esac
       gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'float.h' \
+  gl_header_literal_regex=`echo 'sched.h' \
                            | sed -e "$gl_make_literal_regex_sed"`
   gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
       s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
@@ -22762,129 +24869,132 @@ _ACEOF
       q
     }'
 
-        gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+        gl_cv_absolute_sched_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
   sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_float_h
-           gl_cv_next_float_h='"'$gl_header'"'
+           gl_header=$gl_cv_absolute_sched_h
+           gl_cv_next_sched_h='"'$gl_header'"'
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
-$as_echo "$gl_cv_next_float_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sched_h" >&5
+printf "%s\n" "$gl_cv_next_sched_h" >&6; }
      fi
-     NEXT_FLOAT_H=$gl_cv_next_float_h
+     NEXT_SCHED_H=$gl_cv_next_sched_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='<'float.h'>'
+       gl_next_as_first_directive='<'sched.h'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_float_h
+       gl_next_as_first_directive=$gl_cv_next_sched_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
-
-
+     NEXT_AS_FIRST_DIRECTIVE_SCHED_H=$gl_next_as_first_directive
 
 
-  fi
 
-   if test -n "$FLOAT_H"; then
-  GL_GENERATE_FLOAT_H_TRUE=
-  GL_GENERATE_FLOAT_H_FALSE='#'
-else
-  GL_GENERATE_FLOAT_H_TRUE='#'
-  GL_GENERATE_FLOAT_H_FALSE=
-fi
 
 
+  if test "$ac_cv_header_sched_h" = yes; then
+    HAVE_SCHED_H=1
+  else
+    HAVE_SCHED_H=0
+  fi
 
-  if test $REPLACE_FLOAT_LDBL = 1; then
 
+  if test "$HAVE_SCHED_H" = 1; then
+    ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#if HAVE_SYS_CDEFS_H
+         #include <sys/cdefs.h>
+        #endif
+        #include <sched.h>
 
+"
+if test "x$ac_cv_type_struct_sched_param" = xyes
+then :
+  HAVE_STRUCT_SCHED_PARAM=1
+else $as_nop
+  HAVE_STRUCT_SCHED_PARAM=0
+fi
 
+  else
+    HAVE_STRUCT_SCHED_PARAM=0
+    case "$host_os" in
+      os2*)
+                ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include <spawn.h>
+"
+if test "x$ac_cv_type_struct_sched_param" = xyes
+then :
+  HAVE_STRUCT_SCHED_PARAM=1
+fi
 
+        ;;
+      vms)
+                ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include <pthread.h>
+"
+if test "x$ac_cv_type_struct_sched_param" = xyes
+then :
+  HAVE_STRUCT_SCHED_PARAM=1
+fi
 
+        ;;
+    esac
+  fi
 
 
+  if test "$ac_cv_header_sys_cdefs_h" = yes; then
+    HAVE_SYS_CDEFS_H=1
+  else
+    HAVE_SYS_CDEFS_H=0
+  fi
 
-  M4_LIBOBJS="$M4_LIBOBJS float.$ac_objext"
 
-  fi
-  if test $REPLACE_ITOLD = 1; then
 
 
 
 
 
 
+  GL_M4_GNULIB_SCHED_YIELD=0
 
 
-  M4_LIBOBJS="$M4_LIBOBJS itold.$ac_objext"
 
-  fi
 
 
 
-  case "$host_os" in
-    mingw* | pw*)
-            REPLACE_FOPEN=1
-            gl_cv_func_fopen_slash="guessing no"
-      ;;
-    *)
-                  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fopen recognizes a trailing slash" >&5
-$as_echo_n "checking whether fopen recognizes a trailing slash... " >&6; }
-if ${gl_cv_func_fopen_slash+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-          if test "$cross_compiling" = yes; then :
 
-             case "$host_os" in
-               aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
-                 gl_cv_func_fopen_slash="guessing no" ;;
-               *)
-                 gl_cv_func_fopen_slash="guessing yes" ;;
-             esac
 
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5
+printf %s "checking for uid_t in sys/types.h... " >&6; }
+if test ${ac_cv_type_uid_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <sys/types.h>
 
-#include <stddef.h>
-#include <stdio.h>
-int main ()
-{
-  return fopen ("conftest.sl/", "w") != NULL;
-}
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_fopen_slash=yes
-else
-  gl_cv_func_fopen_slash=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "uid_t" >/dev/null 2>&1
+then :
+  ac_cv_type_uid_t=yes
+else $as_nop
+  ac_cv_type_uid_t=no
 fi
-
-          rm -f conftest.sl
+rm -rf conftest*
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fopen_slash" >&5
-$as_echo "$gl_cv_func_fopen_slash" >&6; }
-      ;;
-  esac
-  case "$gl_cv_func_fopen_slash" in
-    *no)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5
+printf "%s\n" "$ac_cv_type_uid_t" >&6; }
+if test $ac_cv_type_uid_t = no; then
 
-$as_echo "#define FOPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
+printf "%s\n" "#define uid_t int" >>confdefs.h
 
-      REPLACE_FOPEN=1
-      ;;
-  esac
 
-  if test $REPLACE_FOPEN = 1; then
+printf "%s\n" "#define gid_t int" >>confdefs.h
 
+fi
 
 
 
@@ -22892,203 +25002,283 @@ $as_echo "#define FOPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS fopen.$ac_objext"
 
-    :
-  fi
 
 
 
 
 
-          GNULIB_FOPEN=1
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_signal_h='<'signal.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
+printf %s "checking absolute name of <signal.h>... " >&6; }
+if test ${gl_cv_next_signal_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
 
 
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <signal.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
-$as_echo "#define GNULIB_TEST_FOPEN 1" >>confdefs.h
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'signal.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
+        gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
+           gl_header=$gl_cv_absolute_signal_h
+           gl_cv_next_signal_h='"'$gl_header'"'
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
+printf "%s\n" "$gl_cv_next_signal_h" >&6; }
+     fi
+     NEXT_SIGNAL_H=$gl_cv_next_signal_h
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_FOPEN_SAFER 1
-_ACEOF
+     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='<'signal.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_signal_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
 
 
 
 
-  fp_headers='
-    #include <stdio.h>
-    #if HAVE_STDIO_EXT_H
-    # include <stdio_ext.h>
-    #endif
-  '
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __fpending" >&5
-$as_echo_n "checking for __fpending... " >&6; }
-if ${gl_cv_func___fpending+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$fp_headers
-int
-main ()
-{
-return ! __fpending (stdin);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func___fpending=yes
-else
-  gl_cv_func___fpending=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+# AIX declares sig_atomic_t to already include volatile, and C89 compilers
+# then choke on 'volatile sig_atomic_t'.  C99 requires that it compile.
+  ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
+#include <signal.h>
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func___fpending" >&5
-$as_echo "$gl_cv_func___fpending" >&6; }
-  if test $gl_cv_func___fpending = yes; then
-    ac_fn_c_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers
 "
-if test "x$ac_cv_have_decl___fpending" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes
+then :
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL___FPENDING $ac_have_decl
-_ACEOF
+else $as_nop
+  HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
+fi
 
-  fi
 
-  if test $gl_cv_func___fpending = no; then
 
 
 
 
 
+  ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
+#include <signal.h>
 
+"
+if test "x$ac_cv_type_sighandler_t" = xyes
+then :
 
+else $as_nop
+  HAVE_SIGHANDLER_T=0
+fi
 
-  M4_LIBOBJS="$M4_LIBOBJS fpending.$ac_objext"
 
-  fi
 
 
 
 
-  ac_fn_c_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" "#include <stdio.h>
-"
-if test "x$ac_cv_have_decl_fpurge" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_FPURGE $ac_have_decl
-_ACEOF
 
-  if test "x$ac_cv_func_fpurge" = xyes; then
-    HAVE_FPURGE=1
-    # Detect BSD bug.  Only cygwin 1.7 is known to be immune.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fpurge works" >&5
-$as_echo_n "checking whether fpurge works... " >&6; }
-if ${gl_cv_func_fpurge_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  gl_cv_func_fpurge_works='guessing no'
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
 
-int
-main ()
-{
-FILE *f = fopen ("conftest.txt", "w+");
-        if (!f) return 1;
-        if (fputc ('a', f) != 'a') return 2;
-        rewind (f);
-        if (fgetc (f) != 'a') return 3;
-        if (fgetc (f) != EOF) return 4;
-        if (fpurge (f) != 0) return 5;
-        if (putc ('b', f) != 'b') return 6;
-        if (fclose (f) != 0) return 7;
-        if ((f = fopen ("conftest.txt", "r")) == NULL) return 8;
-        if (fgetc (f) != 'a') return 9;
-        if (fgetc (f) != 'b') return 10;
-        if (fgetc (f) != EOF) return 11;
-        if (fclose (f) != 0) return 12;
-        if (remove ("conftest.txt") != 0) return 13;
-        return 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_fpurge_works=yes
-else
-  gl_cv_func_fpurge_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C symbols are prefixed with underscore at the linker level" >&5
+printf %s "checking whether C symbols are prefixed with underscore at the linker level... " >&6; }
+if test ${gl_cv_prog_as_underscore+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  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 $gl_c_asm_opt conftest.c'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null 2>&1
+     if LC_ALL=C $EGREP '(^|[^a-zA-Z0-9_])_foo([^a-zA-Z0-9_]|$)' conftest.$gl_asmext >/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:${as_lineno-$LINENO}: result: $gl_cv_func_fpurge_works" >&5
-$as_echo "$gl_cv_func_fpurge_works" >&6; }
-    if test "x$gl_cv_func_fpurge_works" != xyes; then
-      REPLACE_FPURGE=1
-    fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_prog_as_underscore" >&5
+printf "%s\n" "$gl_cv_prog_as_underscore" >&6; }
+  if test $gl_cv_prog_as_underscore = yes; then
+    USER_LABEL_PREFIX=_
   else
-    HAVE_FPURGE=0
-  fi
-  if test "x$ac_cv_have_decl_fpurge" = xno; then
-    HAVE_DECL_FPURGE=0
+    USER_LABEL_PREFIX=
   fi
 
-  if test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1; then
-
-
-
-
-
+printf "%s\n" "#define USER_LABEL_PREFIX $USER_LABEL_PREFIX" >>confdefs.h
 
+  ASM_SYMBOL_PREFIX='"'${USER_LABEL_PREFIX}'"'
 
 
-  M4_LIBOBJS="$M4_LIBOBJS fpurge.$ac_objext"
 
-  fi
 
 
 
 
 
-          GNULIB_FPURGE=1
 
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf returns a byte count as in C99" >&5
+printf %s "checking whether snprintf returns a byte count as in C99... " >&6; }
+if test ${gl_cv_func_snprintf_retval_c99+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu* | gnu*)        gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              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";;
+           midnightbsd*)         gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on Mac OS 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";;
+                                 # Guess yes on Android.
+           linux*-android*)      gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on MSVC, no on mingw.
+           mingw*)               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-$as_echo "#define GNULIB_TEST_FPURGE 1" >>confdefs.h
+#ifdef _MSC_VER
+ Known
+#endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_func_snprintf_retval_c99="guessing yes"
+else $as_nop
+  gl_cv_func_snprintf_retval_c99="guessing no"
+fi
+rm -rf conftest*
 
+                                 ;;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";;
+         esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <stdio.h>
+#include <string.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+  va_list args;
+  int ret;
+  va_start (args, format);
+  ret = vsnprintf (buf, size, format, args);
+  va_end (args);
+  return ret;
+}
+#endif
+static char buf[100];
+int main ()
+{
+  strcpy (buf, "ABCDEF");
+  if (my_snprintf (buf, 3, "%d %d", 4567, 89) != 7)
+    return 1;
+  if (my_snprintf (buf, 0, "%d %d", 4567, 89) != 7)
+    return 2;
+  if (my_snprintf (NULL, 0, "%d %d", 4567, 89) != 7)
+    return 3;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_snprintf_retval_c99=yes
+else $as_nop
+  gl_cv_func_snprintf_retval_c99=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
-  if test $ac_cv_func___freadahead = no; then
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_retval_c99" >&5
+printf "%s\n" "$gl_cv_func_snprintf_retval_c99" >&6; }
 
+ac_fn_check_decl "$LINENO" "snprintf" "ac_cv_have_decl_snprintf" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_snprintf" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_SNPRINTF $ac_have_decl" >>confdefs.h
 
 
 
@@ -23096,341 +25286,245 @@ $as_echo "#define GNULIB_TEST_FPURGE 1" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS freadahead.$ac_objext"
 
-  fi
 
 
 
 
 
 
-  if test $gl_cv_func_frexp_no_libm = yes; then
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_spawn_h='<'spawn.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <spawn.h>" >&5
+printf %s "checking absolute name of <spawn.h>... " >&6; }
+if test ${gl_cv_next_spawn_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+             if test $ac_cv_header_spawn_h = yes; then
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
-$as_echo_n "checking whether frexp works... " >&6; }
-if ${gl_cv_func_frexp_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-           netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
-           *)                        gl_cv_func_frexp_works="guessing yes";;
-         esac
 
-else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <float.h>
-#include <math.h>
-#include <string.h>
-#if HAVE_DECL_ALARM
-# include <signal.h>
-# include <unistd.h>
-#endif
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
-   ICC 10.0 has a bug when optimizing the expression -zero.
-   The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
-   to PowerPC on Mac OS X 10.5.  */
-#if defined __hpux || defined __sgi || defined __ICC
-static double
-compute_minus_zero (void)
-{
-  return -DBL_MIN * DBL_MIN;
-}
-# define minus_zero compute_minus_zero ()
-#else
-double minus_zero = -0.0;
-#endif
-int main()
-{
-  int result = 0;
-  int i;
-  volatile double x;
-  double zero = 0.0;
-#if HAVE_DECL_ALARM
-  /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
-     number.  Let the test fail in this case.  */
-  signal (SIGALRM, SIG_DFL);
-  alarm (5);
-#endif
-  /* Test on denormalized numbers.  */
-  for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
-    ;
-  if (x > 0.0)
-    {
-      int exp;
-      double y = frexp (x, &exp);
-      /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
-         On NetBSD: y = 0.75. Correct: y = 0.5.  */
-      if (y != 0.5)
-        result |= 1;
-    }
-  /* Test on infinite numbers.  */
-  x = 1.0 / zero;
-  {
-    int exp;
-    double y = frexp (x, &exp);
-    if (y != x)
-      result |= 2;
-  }
-  /* Test on negative zero.  */
-  x = minus_zero;
-  {
-    int exp;
-    double y = frexp (x, &exp);
-    if (memcmp (&y, &x, sizeof x))
-      result |= 4;
-  }
-  return result;
-}
+#include <spawn.h>
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_frexp_works=yes
-else
-  gl_cv_func_frexp_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'spawn.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_spawn_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_spawn_h
+           gl_cv_next_spawn_h='"'$gl_header'"'
+          else
+               gl_cv_next_spawn_h='<'spawn.h'>'
+             fi
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
-$as_echo "$gl_cv_func_frexp_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_spawn_h" >&5
+printf "%s\n" "$gl_cv_next_spawn_h" >&6; }
+     fi
+     NEXT_SPAWN_H=$gl_cv_next_spawn_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='<'spawn.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_spawn_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SPAWN_H=$gl_next_as_first_directive
 
-    case "$gl_cv_func_frexp_works" in
-      *yes) gl_func_frexp_no_libm=yes ;;
-      *)    gl_func_frexp_no_libm=no; REPLACE_FREXP=1 ;;
-    esac
-  else
-    gl_func_frexp_no_libm=no
-        REPLACE_FREXP=1
-  fi
-  if test $gl_func_frexp_no_libm = yes; then
 
-$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h
 
-  fi
 
-  if test $gl_func_frexp_no_libm != yes; then
 
+  if test $ac_cv_header_spawn_h = yes; then
+    HAVE_SPAWN_H=1
+    ac_fn_c_check_type "$LINENO" "posix_spawnattr_t" "ac_cv_type_posix_spawnattr_t" "
+#include <spawn.h>
 
+"
+if test "x$ac_cv_type_posix_spawnattr_t" = xyes
+then :
+
+printf "%s\n" "#define HAVE_POSIX_SPAWNATTR_T 1" >>confdefs.h
 
 
+else $as_nop
+  HAVE_POSIX_SPAWNATTR_T=0
+fi
+
+    ac_fn_c_check_type "$LINENO" "posix_spawn_file_actions_t" "ac_cv_type_posix_spawn_file_actions_t" "
+#include <spawn.h>
 
+"
+if test "x$ac_cv_type_posix_spawn_file_actions_t" = xyes
+then :
 
+printf "%s\n" "#define HAVE_POSIX_SPAWN_FILE_ACTIONS_T 1" >>confdefs.h
 
 
-  M4_LIBOBJS="$M4_LIBOBJS frexp.$ac_objext"
+else $as_nop
+  HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0
+fi
 
+  else
+    HAVE_SPAWN_H=0
+    HAVE_POSIX_SPAWNATTR_T=0
+    HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0
   fi
 
 
 
 
 
-          GNULIB_FREXP=1
-
 
 
 
 
-$as_echo "#define GNULIB_TEST_FREXP 1" >>confdefs.h
 
 
 
 
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
+printf %s "checking for stdbool.h that conforms to C99... " >&6; }
+if test ${ac_cv_header_stdbool_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+             #include <stdbool.h>
 
-      ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_frexpl" = xyes; then :
+             #ifdef __cplusplus
+              typedef bool Bool;
+             #else
+              typedef _Bool Bool;
+              #ifndef bool
+               "error: bool is not defined"
+              #endif
+              #ifndef false
+               "error: false is not defined"
+              #endif
+              #if false
+               "error: false is not 0"
+              #endif
+              #ifndef true
+               "error: true is not defined"
+              #endif
+              #if true != 1
+               "error: true is not 1"
+              #endif
+             #endif
 
-else
-  HAVE_DECL_FREXPL=0
-fi
+             #ifndef __bool_true_false_are_defined
+              "error: __bool_true_false_are_defined is not defined"
+             #endif
 
-  if test $HAVE_DECL_FREXPL = 1; then
+             struct s { Bool s: 1; Bool t; bool u: 1; bool v; } s;
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
-$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
-if ${gl_cv_func_frexpl_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+             char a[true == 1 ? 1 : -1];
+             char b[false == 0 ? 1 : -1];
+             char c[__bool_true_false_are_defined == 1 ? 1 : -1];
+             char d[(bool) 0.5 == true ? 1 : -1];
+             /* See body of main program for 'e'.  */
+             char f[(Bool) 0.0 == false ? 1 : -1];
+             char g[true];
+             char h[sizeof (Bool)];
+             char i[sizeof s.t];
+             enum { j = false, k = true, l = false * true, m = true * 256 };
+             /* The following fails for
+                HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
+             Bool n[m];
+             char o[sizeof n == m * sizeof n[0] ? 1 : -1];
+             char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
+             /* Catch a bug in an HP-UX C compiler.  See
+                https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
+              */
+             Bool q = true;
+             Bool *pq = &q;
+             bool *qq = &q;
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-             long double x;
 int
-main ()
+main (void)
 {
-int e; return frexpl (x, &e) > 0;
+
+             bool e = &s;
+             *pq |= q; *pq |= ! q;
+             *qq |= q; *qq |= ! q;
+             /* Refer to every declared value, to avoid compiler optimizations.  */
+             return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l
+                     + !m + !n + !o + !p + !q + !pq + !qq);
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_frexpl_no_libm=yes
-else
-  gl_cv_func_frexpl_no_libm=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_header_stdbool_h=yes
+else $as_nop
+  ac_cv_header_stdbool_h=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
-$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
+printf "%s\n" "$ac_cv_header_stdbool_h" >&6; }
+   ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
+if test "x$ac_cv_type__Bool" = xyes
+then :
 
-    if test $gl_cv_func_frexpl_no_libm = yes; then
+printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
-$as_echo_n "checking whether frexpl works... " >&6; }
-if ${gl_cv_func_frexpl_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+fi
 
-      if test "$cross_compiling" = yes; then :
 
-         case "$host_os" in
-           aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
-              gl_cv_func_frexpl_works="guessing no";;
-           *) gl_cv_func_frexpl_works="guessing yes";;
-         esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <float.h>
-#include <math.h>
-/* Override the values of <float.h>, like done in float.in.h.  */
-#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP    (-16381)
-#endif
-#if defined __i386__ && defined __FreeBSD__
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP    (-16381)
-#endif
-#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP DBL_MIN_EXP
-#endif
-#if defined __sgi && (LDBL_MANT_DIG >= 106)
-# if defined __GNUC__
-#  undef LDBL_MIN_EXP
-#  define LDBL_MIN_EXP DBL_MIN_EXP
-# endif
-#endif
-extern
-#ifdef __cplusplus
-"C"
-#endif
-long double frexpl (long double, int *);
-int main()
-{
-  int result = 0;
-  volatile long double x;
-  /* Test on finite numbers that fails on AIX 5.1.  */
-  x = 16.0L;
-  {
-    int exp = -9999;
-    frexpl (x, &exp);
-    if (exp != 5)
-      result |= 1;
-  }
-  /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
-     function returns an invalid (incorrectly normalized) value: it returns
-               y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
-     but the correct result is
-          0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 }  */
-  x = 1.01L;
-  {
-    int exp = -9999;
-    long double y = frexpl (x, &exp);
-    if (!(exp == 1 && y == 0.505L))
-      result |= 2;
-  }
-  /* Test on large finite numbers.  This fails on BeOS at i = 16322, while
-     LDBL_MAX_EXP = 16384.
-     In the loop end test, we test x against Infinity, rather than comparing
-     i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP.  */
-  {
-    int i;
-    for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
-      {
-        int exp = -9999;
-        frexpl (x, &exp);
-        if (exp != i)
-          {
-            result |= 4;
-            break;
-          }
-      }
-  }
-  /* Test on denormalized numbers.  */
-  {
-    int i;
-    for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
-      ;
-    if (x > 0.0L)
-      {
-        int exp;
-        long double y = frexpl (x, &exp);
-        /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
-           exp = -16382, y = 0.5.  On Mac OS X 10.5: exp = -16384, y = 0.5.  */
-        if (exp != LDBL_MIN_EXP - 1)
-          result |= 8;
-      }
-  }
-  /* Test on infinite numbers.  */
-  x = 1.0L / 0.0L;
-  {
-    int exp;
-    long double y = frexpl (x, &exp);
-    if (y != x)
-      result |= 16;
-  }
-  return result;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_frexpl_works=yes
-else
-  gl_cv_func_frexpl_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+ac_fn_check_decl "$LINENO" "fcloseall" "ac_cv_have_decl_fcloseall" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fcloseall" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
 fi
+printf "%s\n" "#define HAVE_DECL_FCLOSEALL $ac_have_decl" >>confdefs.h
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
-$as_echo "$gl_cv_func_frexpl_works" >&6; }
 
-      case "$gl_cv_func_frexpl_works" in
-        *yes) gl_func_frexpl_no_libm=yes ;;
-        *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
-      esac
-    else
-      gl_func_frexpl_no_libm=no
-            REPLACE_FREXPL=1
-    fi
-    if test $gl_func_frexpl_no_libm = yes; then
 
-$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h
+  printf "%s\n" "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
 
-    fi
-  fi
 
-  if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then
 
 
 
@@ -23438,208 +25532,245 @@ $as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h
 
 
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_stdio_h='<'stdio.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
+printf %s "checking absolute name of <stdio.h>... " >&6; }
+if test ${gl_cv_next_stdio_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  M4_LIBOBJS="$M4_LIBOBJS frexpl.$ac_objext"
 
-  fi
 
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'stdio.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
+        gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
+           gl_header=$gl_cv_absolute_stdio_h
+           gl_cv_next_stdio_h='"'$gl_header'"'
 
 
-          GNULIB_FREXPL=1
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
+printf "%s\n" "$gl_cv_next_stdio_h" >&6; }
+     fi
+     NEXT_STDIO_H=$gl_cv_next_stdio_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='<'stdio.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_stdio_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
 
 
 
 
-$as_echo "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
 
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
+printf %s "checking which flavor of printf attribute matches inttypes macros... " >&6; }
+if test ${gl_cv_func_printf_attribute_flavor+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+       #define __STDC_FORMAT_MACROS 1
+       #include <stdio.h>
+       #include <inttypes.h>
+       /* For non-mingw systems, compilation will trivially succeed.
+          For mingw, compilation will succeed for older mingw (system
+          printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
+       #if (defined _WIN32 && ! defined __CYGWIN__) && \
+         (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
+       extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
+       #endif
 
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_printf_attribute_flavor=system
+else $as_nop
+  gl_cv_func_printf_attribute_flavor=gnu
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
+printf "%s\n" "$gl_cv_func_printf_attribute_flavor" >&6; }
+  if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
 
+printf "%s\n" "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
 
-    if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
-    REPLACE_FSEEK=1
   fi
 
-  if test $REPLACE_FSEEK = 1; then
 
 
 
 
 
 
+    if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+      REPLACE_STDIO_WRITE_FUNCS=1
 
 
-  M4_LIBOBJS="$M4_LIBOBJS fseek.$ac_objext"
 
-  fi
 
 
 
 
 
-          GNULIB_FSEEK=1
+  M4_LIBOBJS="$M4_LIBOBJS stdio-write.$ac_objext"
 
+    fi
 
 
 
 
-$as_echo "#define GNULIB_TEST_FSEEK 1" >>confdefs.h
 
 
 
 
+  if test $ac_cv_have_decl_fcloseall = no; then
+    HAVE_DECL_FCLOSEALL=0
+  fi
 
+ac_fn_check_decl "$LINENO" "ecvt" "ac_cv_have_decl_ecvt" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_ecvt" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_ECVT $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "fcvt" "ac_cv_have_decl_fcvt" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fcvt" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FCVT $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "gcvt" "ac_cv_have_decl_gcvt" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_gcvt" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_GCVT $ac_have_decl" >>confdefs.h
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5
-$as_echo_n "checking for fseeko... " >&6; }
-if ${gl_cv_func_fseeko+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
 
-int
-main ()
-{
-fseeko (stdin, 0, 0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_fseeko=yes
-else
-  gl_cv_func_fseeko=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5
-$as_echo "$gl_cv_func_fseeko" >&6; }
 
 
-  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
-  else
-    if test $WINDOWS_64_BIT_OFF_T = 1; then
-      REPLACE_FSEEKO=1
-    fi
-    if test $gl_cv_var_stdin_large_offset = no; then
-      REPLACE_FSEEKO=1
-    fi
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_stdlib_h='<'stdlib.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
+printf %s "checking absolute name of <stdlib.h>... " >&6; }
+if test ${gl_cv_next_stdlib_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
-$as_echo_n "checking whether fflush works on input streams... " >&6; }
-if ${gl_cv_func_fflush_stdin+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  echo hello world > conftest.txt
-     if test "$cross_compiling" = yes; then :
-  gl_cv_func_fflush_stdin=cross
-else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <stdlib.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
-#include <stdio.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#else /* on Windows with MSVC */
-# include <io.h>
-#endif
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'stdlib.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
-int
-main ()
-{
-FILE *f = fopen ("conftest.txt", "r");
-         char buffer[10];
-         int fd;
-         int c;
-         if (f == NULL)
-           return 1;
-         fd = fileno (f);
-         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
-           return 2;
-         /* For deterministic results, ensure f read a bigger buffer.  */
-         if (lseek (fd, 0, SEEK_CUR) == 5)
-           return 3;
-         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
-            on BSD systems and on mingw.  */
-         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
-           return 4;
-         if (lseek (fd, 0, SEEK_CUR) != 5)
-           return 5;
-         /* Verify behaviour of fflush after ungetc. See
-            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
-         /* Verify behaviour of fflush after a backup ungetc.  This fails on
-            mingw.  */
-         c = fgetc (f);
-         ungetc (c, f);
-         fflush (f);
-         if (fgetc (f) != c)
-           return 6;
-         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
-            on glibc 2.8 and on BSD systems.  */
-         c = fgetc (f);
-         ungetc ('@', f);
-         fflush (f);
-         if (fgetc (f) != c)
-           return 7;
-         return 0;
+        gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_fflush_stdin=yes
-else
-  gl_cv_func_fflush_stdin=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+           gl_header=$gl_cv_absolute_stdlib_h
+           gl_cv_next_stdlib_h='"'$gl_header'"'
 
-     rm conftest.txt
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
-$as_echo "$gl_cv_func_fflush_stdin" >&6; }
-  case $gl_cv_func_fflush_stdin in
-    yes) gl_func_fflush_stdin=1 ;;
-    no)  gl_func_fflush_stdin=0 ;;
-    *)   gl_func_fflush_stdin='(-1)' ;;
-  esac
-
-cat >>confdefs.h <<_ACEOF
-#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin
-_ACEOF
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
+printf "%s\n" "$gl_cv_next_stdlib_h" >&6; }
+     fi
+     NEXT_STDLIB_H=$gl_cv_next_stdlib_h
 
-      if test $gl_cv_func_fflush_stdin != yes; then
-        REPLACE_FSEEKO=1
-      fi
+     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='<'stdlib.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_stdlib_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
 
-  fi
 
-  if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
 
 
 
@@ -23648,246 +25779,448 @@ _ACEOF
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS fseeko.$ac_objext"
+  if test $ac_cv_have_decl_ecvt = no; then
+    HAVE_DECL_ECVT=0
+  fi
 
+  if test $ac_cv_have_decl_fcvt = no; then
+    HAVE_DECL_FCVT=0
+  fi
 
-      for ac_func in _fseeki64
-do :
-  ac_fn_c_check_func "$LINENO" "_fseeki64" "ac_cv_func__fseeki64"
-if test "x$ac_cv_func__fseeki64" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE__FSEEKI64 1
-_ACEOF
+  if test $ac_cv_have_decl_gcvt = no; then
+    HAVE_DECL_GCVT=0
+  fi
 
+ac_fn_check_decl "$LINENO" "strdup" "ac_cv_have_decl_strdup" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_strdup" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
 fi
-done
-
-
-  fi
+printf "%s\n" "#define HAVE_DECL_STRDUP $ac_have_decl" >>confdefs.h
 
 
+     REPLACE_STRERROR_0=0
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror(0) succeeds" >&5
+printf %s "checking whether strerror(0) succeeds... " >&6; }
+if test ${gl_cv_func_strerror_0_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                        # Guess yes on glibc systems.
+         *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+                        # Guess yes on musl systems.
+         *-musl*)       gl_cv_func_strerror_0_works="guessing yes" ;;
+                        # Guess yes on native Windows.
+         mingw*)        gl_cv_func_strerror_0_works="guessing yes" ;;
+                        # If we don't know, obey --enable-cross-guesses.
+         *)             gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
+       esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+           #include <errno.h>
 
+int
+main (void)
+{
+int result = 0;
+           char *str;
+           errno = 0;
+           str = strerror (0);
+           if (!*str) result |= 1;
+           if (errno) result |= 2;
+           if (strstr (str, "nknown") || strstr (str, "ndefined"))
+             result |= 4;
+           return result;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_strerror_0_works=yes
+else $as_nop
+  gl_cv_func_strerror_0_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-          GNULIB_FSEEKO=1
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_0_works" >&5
+printf "%s\n" "$gl_cv_func_strerror_0_works" >&6; }
+  case "$gl_cv_func_strerror_0_works" in
+    *yes) ;;
+    *)
+      REPLACE_STRERROR_0=1
 
+printf "%s\n" "#define REPLACE_STRERROR_0 1" >>confdefs.h
 
+      ;;
+  esac
 
 
-$as_echo "#define GNULIB_TEST_FSEEKO 1" >>confdefs.h
 
 
 
 
 
 
+  if test $ac_cv_func_strerror_r = yes; then
+    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+                        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for strerror_r with POSIX signature" >&5
+printf %s "checking for strerror_r with POSIX signature... " >&6; }
+if test ${gl_cv_func_strerror_r_posix_signature+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+                int strerror_r (int, char *, size_t);
 
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-    REPLACE_FSTAT=1
-  fi
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_strerror_r_posix_signature=yes
+else $as_nop
+  gl_cv_func_strerror_r_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
-  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
-    REPLACE_FSTAT=1
-  fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_posix_signature" >&5
+printf "%s\n" "$gl_cv_func_strerror_r_posix_signature" >&6; }
+      if test $gl_cv_func_strerror_r_posix_signature = yes; then
+                                                        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strerror_r works" >&5
+printf %s "checking whether strerror_r works... " >&6; }
+if test ${gl_cv_func_strerror_r_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
 
+              case "$host_os" in
+                       # Guess no on AIX.
+                aix*)  gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess no on HP-UX.
+                hpux*) gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess no on BSD variants.
+                *bsd*)  gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess yes otherwise.
+                *)     gl_cv_func_strerror_r_works="guessing yes";;
+              esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <errno.h>
+                  #include <string.h>
 
-  if test $REPLACE_FSTAT = 1; then
+int
+main (void)
+{
+int result = 0;
+                  char buf[79];
+                  if (strerror_r (EACCES, buf, 0) < 0)
+                    result |= 1;
+                  errno = 0;
+                  if (strerror_r (EACCES, buf, sizeof buf) != 0)
+                    result |= 2;
+                  strcpy (buf, "Unknown");
+                  if (strerror_r (0, buf, sizeof buf) != 0)
+                    result |= 4;
+                  if (errno)
+                    result |= 8;
+                  if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
+                    result |= 0x10;
+                  errno = 0;
+                  *buf = 0;
+                  if (strerror_r (-3, buf, sizeof buf) < 0)
+                    result |= 0x20;
+                  if (errno)
+                    result |= 0x40;
+                  if (!*buf)
+                    result |= 0x80;
+                  return result;
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_strerror_r_works=yes
+else $as_nop
+  gl_cv_func_strerror_r_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
+printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; }
+      else
 
+                        if test $ac_cv_func___xpg_strerror_r = yes; then
+          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __xpg_strerror_r works" >&5
+printf %s "checking whether __xpg_strerror_r works... " >&6; }
+if test ${gl_cv_func_strerror_r_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+                                  gl_cv_func_strerror_r_works="$gl_cross_guess_normal"
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <errno.h>
+                    #include <string.h>
+                    extern
+                    #ifdef __cplusplus
+                    "C"
+                    #endif
+                    int __xpg_strerror_r(int, char *, size_t);
 
+int
+main (void)
+{
+int result = 0;
+                    char buf[256] = "^";
+                    char copy[256];
+                    char *str = strerror (-1);
+                    strcpy (copy, str);
+                    if (__xpg_strerror_r (-2, buf, 1) == 0)
+                      result |= 1;
+                    if (*buf)
+                      result |= 2;
+                    __xpg_strerror_r (-2, buf, 256);
+                    if (strcmp (str, copy))
+                      result |= 4;
+                    return result;
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_strerror_r_works=yes
+else $as_nop
+  gl_cv_func_strerror_r_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-  M4_LIBOBJS="$M4_LIBOBJS fstat.$ac_objext"
 
-    :
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strerror_r_works" >&5
+printf "%s\n" "$gl_cv_func_strerror_r_works" >&6; }
+        fi
+      fi
+    fi
   fi
 
 
 
 
 
-          GNULIB_FSTAT=1
-
-
-
-
-
-$as_echo "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
-
-
-
-
-
-
-    if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
-    REPLACE_FTELL=1
-  fi
-
-  if test $REPLACE_FTELL = 1; then
 
 
 
 
 
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_string_h='<'string.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <string.h>" >&5
+printf %s "checking absolute name of <string.h>... " >&6; }
+if test ${gl_cv_next_string_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
 
-  M4_LIBOBJS="$M4_LIBOBJS ftell.$ac_objext"
 
-  fi
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'string.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
+        gl_cv_absolute_string_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
+           gl_header=$gl_cv_absolute_string_h
+           gl_cv_next_string_h='"'$gl_header'"'
 
 
-          GNULIB_FTELL=1
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_string_h" >&5
+printf "%s\n" "$gl_cv_next_string_h" >&6; }
+     fi
+     NEXT_STRING_H=$gl_cv_next_string_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='<'string.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_string_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STRING_H=$gl_next_as_first_directive
 
 
 
 
-$as_echo "#define GNULIB_TEST_FTELL 1" >>confdefs.h
 
 
 
 
 
+ac_fn_check_decl "$LINENO" "strndup" "ac_cv_have_decl_strndup" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_strndup" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_STRNDUP $ac_have_decl" >>confdefs.h
 
 
+ac_fn_check_decl "$LINENO" "strnlen" "ac_cv_have_decl_strnlen" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_strnlen" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_STRNLEN $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "strsignal" "ac_cv_have_decl_strsignal" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_strsignal" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_STRSIGNAL $ac_have_decl" >>confdefs.h
 
 
 
 
-  if test $ac_cv_have_decl_ftello = no; then
-    HAVE_DECL_FTELLO=0
-  fi
+  if test $REPLACE_MEMCHR = 1; then
+    REPLACE_STRSTR=1
+  else
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
+printf %s "checking whether strstr works... " >&6; }
+if test ${gl_cv_func_strstr_works_always+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+                                                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
-$as_echo_n "checking for ftello... " >&6; }
-if ${gl_cv_func_ftello+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     || defined __UCLIBC__
+  Lucky user
+ #endif
+#elif defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+  Lucky user
+ #endif
+#else
+  Lucky user
+#endif
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-ftello (stdin);
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_ftello=yes
-else
-  gl_cv_func_ftello=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Lucky user" >/dev/null 2>&1
+then :
+  gl_cv_func_strstr_works_always="guessing yes"
+else $as_nop
+  gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
-$as_echo "$gl_cv_func_ftello" >&6; }
-  if test $gl_cv_func_ftello = no; then
-    HAVE_FTELLO=0
-  else
-    if test $WINDOWS_64_BIT_OFF_T = 1; then
-      REPLACE_FTELLO=1
-    fi
-    if test $gl_cv_var_stdin_large_offset = no; then
-      REPLACE_FTELLO=1
-    fi
-    if test $REPLACE_FTELLO = 0; then
+rm -rf conftest*
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ftello works" >&5
-$as_echo_n "checking whether ftello works... " >&6; }
-if ${gl_cv_func_ftello_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                              case "$host_os" in
-                      # Guess no on Solaris.
-            solaris*) gl_cv_func_ftello_works="guessing no" ;;
-                      # Guess yes otherwise.
-            *)        gl_cv_func_ftello_works="guessing yes" ;;
-          esac
-          if test "$cross_compiling" = yes; then :
-  :
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#define TESTFILE "conftest.tmp"
+#include <string.h> /* for strstr */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
+  Unlucky user
+ #endif
+#endif
+#define P "_EF_BF_BD"
+#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
+#define NEEDLE P P P P P
+
 int
 main (void)
 {
-  FILE *fp;
-
-  /* Create a file with some contents.  */
-  fp = fopen (TESTFILE, "w");
-  if (fp == NULL)
-    return 70;
-  if (fwrite ("foogarsh", 1, 8, fp) < 8)
-    return 71;
-  if (fclose (fp))
-    return 72;
-
-  /* The file's contents is now "foogarsh".  */
-
-  /* Try writing after reading to EOF.  */
-  fp = fopen (TESTFILE, "r+");
-  if (fp == NULL)
-    return 73;
-  if (fseek (fp, -1, SEEK_END))
-    return 74;
-  if (!(getc (fp) == 'h'))
-    return 1;
-  if (!(getc (fp) == EOF))
-    return 2;
-  if (!(ftell (fp) == 8))
-    return 3;
-  if (!(ftell (fp) == 8))
-    return 4;
-  if (!(putc ('!', fp) == '!'))
-    return 5;
-  if (!(ftell (fp) == 9))
-    return 6;
-  if (!(fclose (fp) == 0))
-    return 7;
-  fp = fopen (TESTFILE, "r");
-  if (fp == NULL)
-    return 75;
-  {
-    char buf[10];
-    if (!(fread (buf, 1, 10, fp) == 9))
-      return 10;
-    if (!(memcmp (buf, "foogarsh!", 9) == 0))
-      return 11;
-  }
-  if (!(fclose (fp) == 0))
-    return 12;
-
-  /* The file's contents is now "foogarsh!".  */
+return !!strstr (HAYSTACK, NEEDLE);
 
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_ftello_works=yes
-else
-  gl_cv_func_ftello_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_strstr_works_always=yes
+else $as_nop
+  gl_cv_func_strstr_works_always=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello_works" >&5
-$as_echo "$gl_cv_func_ftello_works" >&6; }
-      case "$gl_cv_func_ftello_works" in
-        *yes) ;;
-        *)
-          REPLACE_FTELLO=1
-
-$as_echo "#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1" >>confdefs.h
-
-          ;;
-      esac
-    fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
+printf "%s\n" "$gl_cv_func_strstr_works_always" >&6; }
+    case "$gl_cv_func_strstr_works_always" in
+      *yes) ;;
+      *)
+        REPLACE_STRSTR=1
+        ;;
+    esac
   fi
 
-  if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
-
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ldexp() can be used without linking with libm" >&5
+printf %s "checking whether ldexp() can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_ldexp_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __NO_MATH_INLINES
+                           # define __NO_MATH_INLINES 1 /* for glibc */
+                           #endif
+                           #include <math.h>
+                           double (*funcptr) (double, int) = ldexp;
+                           double x;
+int
+main (void)
+{
+return ldexp (x, -1) > 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_ldexp_no_libm=yes
+else $as_nop
+  gl_cv_func_ldexp_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5
+printf "%s\n" "$gl_cv_func_ldexp_no_libm" >&6; }
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS ftello.$ac_objext"
 
 
-      for ac_func in _ftelli64
-do :
-  ac_fn_c_check_func "$LINENO" "_ftelli64" "ac_cv_func__ftelli64"
-if test "x$ac_cv_func__ftelli64" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE__FTELLI64 1
-_ACEOF
 
-fi
-done
 
 
-  fi
 
 
 
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_random_h='<'sys/random.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/random.h>" >&5
+printf %s "checking absolute name of <sys/random.h>... " >&6; }
+if test ${gl_cv_next_sys_random_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-          GNULIB_FTELLO=1
+             if test $ac_cv_header_sys_random_h = yes; then
 
 
 
 
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/random.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
-$as_echo "#define GNULIB_TEST_FTELLO 1" >>confdefs.h
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'sys/random.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
+        gl_cv_absolute_sys_random_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
+           gl_header=$gl_cv_absolute_sys_random_h
+           gl_cv_next_sys_random_h='"'$gl_header'"'
+          else
+               gl_cv_next_sys_random_h='<'sys/random.h'>'
+             fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_random_h" >&5
+printf "%s\n" "$gl_cv_next_sys_random_h" >&6; }
+     fi
+     NEXT_SYS_RANDOM_H=$gl_cv_next_sys_random_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='<'sys/random.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_random_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H=$gl_next_as_first_directive
 
 
 
-  if test $ac_cv_func_getdtablesize = yes &&
-     test $ac_cv_have_decl_getdtablesize = yes; then
-    # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit
-    # up to an unchangeable hard limit; all other platforms correctly
-    # require setrlimit before getdtablesize() can report a larger value.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
-$as_echo_n "checking whether getdtablesize works... " >&6; }
-if ${gl_cv_func_getdtablesize_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-          cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
-            gl_cv_func_getdtablesize_works="guessing no" ;;
-          *) gl_cv_func_getdtablesize_works="guessing yes" ;;
-         esac
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-        #include <unistd.h>
-int
-main ()
-{
-int size = getdtablesize();
-           if (dup2 (0, getdtablesize()) != -1)
-             return 1;
-           if (size != getdtablesize())
-             return 2;
+  if test $ac_cv_header_sys_random_h = yes; then
+    HAVE_SYS_RANDOM_H=1
+  else
+    HAVE_SYS_RANDOM_H=0
+  fi
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_getdtablesize_works=yes
-else
-  gl_cv_func_getdtablesize_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
-$as_echo "$gl_cv_func_getdtablesize_works" >&6; }
-    case "$gl_cv_func_getdtablesize_works" in
-      *yes) ;;
-      *) REPLACE_GETDTABLESIZE=1 ;;
-    esac
-  else
-    HAVE_GETDTABLESIZE=0
+  if test $ac_cv_header_sys_random_h = yes; then
+    UNISTD_H_HAVE_SYS_RANDOM_H=1
   fi
 
-  if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
 
 
 
@@ -24018,78 +26377,258 @@ $as_echo "$gl_cv_func_getdtablesize_works" >&6; }
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS getdtablesize.$ac_objext"
 
-    :
-  fi
 
 
 
 
 
-          GNULIB_GETDTABLESIZE=1
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_wait_h='<'sys/wait.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/wait.h>" >&5
+printf %s "checking absolute name of <sys/wait.h>... " >&6; }
+if test ${gl_cv_next_sys_wait_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+             if test $ac_cv_header_sys_wait_h = yes; then
 
 
 
 
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/wait.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'sys/wait.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
+        gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
-  if test $REPLACE_GETOPT = 1; then
+           gl_header=$gl_cv_absolute_sys_wait_h
+           gl_cv_next_sys_wait_h='"'$gl_header'"'
+          else
+               gl_cv_next_sys_wait_h='<'sys/wait.h'>'
+             fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5
+printf "%s\n" "$gl_cv_next_sys_wait_h" >&6; }
+     fi
+     NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_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='<'sys/wait.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_wait_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS getopt.$ac_objext"
 
 
 
 
 
 
+  GL_M4_GNULIB_WAITPID=0
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS getopt1.$ac_objext"
 
+    HAVE_DECL_LOCALTIME_R=1;
+  HAVE_NANOSLEEP=1;
+  HAVE_STRPTIME=1;
+  HAVE_TIMEGM=1;
+  HAVE_TIMESPEC_GET=1;
+    HAVE_TIMEZONE_T=0;
+        REPLACE_CTIME=GNULIB_PORTCHECK;
+  REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;
+  REPLACE_MKTIME=GNULIB_PORTCHECK;
+  REPLACE_NANOSLEEP=GNULIB_PORTCHECK;
+  REPLACE_STRFTIME=GNULIB_PORTCHECK;
+  REPLACE_TIMEGM=GNULIB_PORTCHECK;
+  REPLACE_TZSET=GNULIB_PORTCHECK;
 
+      : ${GNULIB_GETTIMEOFDAY=0};
+        REPLACE_GMTIME=0;
+  REPLACE_LOCALTIME=0;
 
 
-        GNULIB_GL_M4_UNISTD_H_GETOPT=1
-  fi
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <time.h>" >&5
+printf %s "checking for struct timespec in <time.h>... " >&6; }
+if test ${gl_cv_sys_struct_timespec_in_time_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <time.h>
 
+int
+main (void)
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_sys_struct_timespec_in_time_h=yes
+else $as_nop
+  gl_cv_sys_struct_timespec_in_time_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_time_h" >&5
+printf "%s\n" "$gl_cv_sys_struct_timespec_in_time_h" >&6; }
 
+  TIME_H_DEFINES_STRUCT_TIMESPEC=0
+  SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=0
+  PTHREAD_H_DEFINES_STRUCT_TIMESPEC=0
+  UNISTD_H_DEFINES_STRUCT_TIMESPEC=0
+  if test $gl_cv_sys_struct_timespec_in_time_h = yes; then
+    TIME_H_DEFINES_STRUCT_TIMESPEC=1
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <sys/time.h>" >&5
+printf %s "checking for struct timespec in <sys/time.h>... " >&6; }
+if test ${gl_cv_sys_struct_timespec_in_sys_time_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/time.h>
 
+int
+main (void)
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_sys_struct_timespec_in_sys_time_h=yes
+else $as_nop
+  gl_cv_sys_struct_timespec_in_sys_time_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_sys_time_h" >&5
+printf "%s\n" "$gl_cv_sys_struct_timespec_in_sys_time_h" >&6; }
+    if test $gl_cv_sys_struct_timespec_in_sys_time_h = yes; then
+      SYS_TIME_H_DEFINES_STRUCT_TIMESPEC=1
+    else
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <pthread.h>" >&5
+printf %s "checking for struct timespec in <pthread.h>... " >&6; }
+if test ${gl_cv_sys_struct_timespec_in_pthread_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
 
+int
+main (void)
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_sys_struct_timespec_in_pthread_h=yes
+else $as_nop
+  gl_cv_sys_struct_timespec_in_pthread_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_pthread_h" >&5
+printf "%s\n" "$gl_cv_sys_struct_timespec_in_pthread_h" >&6; }
+      if test $gl_cv_sys_struct_timespec_in_pthread_h = yes; then
+        PTHREAD_H_DEFINES_STRUCT_TIMESPEC=1
+      else
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timespec in <unistd.h>" >&5
+printf %s "checking for struct timespec in <unistd.h>... " >&6; }
+if test ${gl_cv_sys_struct_timespec_in_unistd_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
 
-    REPLACE_GETOPT=0
-    if test -n "$gl_replace_getopt"; then
-      REPLACE_GETOPT=1
+int
+main (void)
+{
+static struct timespec x; x.tv_sec = x.tv_nsec;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_sys_struct_timespec_in_unistd_h=yes
+else $as_nop
+  gl_cv_sys_struct_timespec_in_unistd_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timespec_in_unistd_h" >&5
+printf "%s\n" "$gl_cv_sys_struct_timespec_in_unistd_h" >&6; }
+        if test $gl_cv_sys_struct_timespec_in_unistd_h = yes; then
+          UNISTD_H_DEFINES_STRUCT_TIMESPEC=1
+        fi
+      fi
     fi
+  fi
 
-  if test $REPLACE_GETOPT = 1; then
 
-  GETOPT_H=getopt.h
 
-$as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
 
 
 
-  fi
 
-  if test $REPLACE_GETOPT = 1; then
 
 
 
@@ -24098,267 +26637,172 @@ $as_echo "#define __GETOPT_PREFIX rpl_" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS getopt.$ac_objext"
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_time_h='<'time.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <time.h>" >&5
+printf %s "checking absolute name of <time.h>... " >&6; }
+if test ${gl_cv_next_time_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
 
 
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <time.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'time.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
+        gl_cv_absolute_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
+           gl_header=$gl_cv_absolute_time_h
+           gl_cv_next_time_h='"'$gl_header'"'
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_time_h" >&5
+printf "%s\n" "$gl_cv_next_time_h" >&6; }
+     fi
+     NEXT_TIME_H=$gl_cv_next_time_h
 
-  M4_LIBOBJS="$M4_LIBOBJS getopt1.$ac_objext"
+     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='<'time.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_time_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_TIME_H=$gl_next_as_first_directive
 
 
 
 
-        GNULIB_GL_M4_UNISTD_H_GETOPT=1
-  fi
 
 
 
 
-  ac_found=0
-  ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
-"
-if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for TIME_UTC in <time.h>" >&5
+printf %s "checking for TIME_UTC in <time.h>... " >&6; }
+if test ${gl_cv_time_h_has_TIME_UTC+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <time.h>
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
+int
+main (void)
+{
+static int x = TIME_UTC; x++;
+  ;
+  return 0;
+}
 _ACEOF
-if test $ac_have_decl = 1; then :
-  ac_found=1
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_time_h_has_TIME_UTC=yes
+else $as_nop
+  gl_cv_time_h_has_TIME_UTC=no
 fi
-
-  ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
-"
-if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_time_h_has_TIME_UTC" >&5
+printf "%s\n" "$gl_cv_time_h_has_TIME_UTC" >&6; }
+  if test $gl_cv_time_h_has_TIME_UTC = yes; then
+    TIME_H_DEFINES_TIME_UTC=1
+  else
+    TIME_H_DEFINES_TIME_UTC=0
+  fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
-_ACEOF
-if test $ac_have_decl = 1; then :
-  ac_found=1
-fi
 
-  ac_fn_c_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
-"
-if test "x$ac_cv_have_decl___argv" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL___ARGV $ac_have_decl
-_ACEOF
-if test $ac_have_decl = 1; then :
-  ac_found=1
-fi
 
+  GL_M4_GNULIB_CTIME=0
 
-  # Incur the cost of this test only if none of the above worked.
-  if test $ac_found = 0; then
-    # On OpenBSD 5.1, using the global __progname variable appears to be
-    # the only way to implement getprogname.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
-$as_echo_n "checking whether __progname is defined in default libraries... " >&6; }
-if ${gl_cv_var___progname+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-        gl_cv_var___progname=
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-extern char *__progname;
-int
-main ()
-{
-return *__progname;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_var___progname=yes
+  GL_M4_GNULIB_MKTIME=0
 
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
-$as_echo "$gl_cv_var___progname" >&6; }
-    if test "$gl_cv_var___progname" = yes; then
+  GL_M4_GNULIB_LOCALTIME=0
 
-$as_echo "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
 
-    fi
-  fi
 
+  GL_M4_GNULIB_NANOSLEEP=0
 
 
 
+  GL_M4_GNULIB_STRFTIME=0
 
 
 
+  GL_M4_GNULIB_STRPTIME=0
 
 
-  gl_gettimeofday_timezone=void
-  if test $ac_cv_func_gettimeofday != yes; then
-    HAVE_GETTIMEOFDAY=0
-  else
 
+  GL_M4_GNULIB_TIMEGM=0
 
 
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gettimeofday clobbers localtime buffer" >&5
-$as_echo_n "checking whether gettimeofday clobbers localtime buffer... " >&6; }
-if ${gl_cv_func_gettimeofday_clobber+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  # When cross-compiling:
-      case "$host_os" in
-                # Guess all is fine on glibc systems.
-        *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
-                # If we don't know, assume the worst.
-        *)      gl_cv_func_gettimeofday_clobber="guessing yes" ;;
-      esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-          #include <sys/time.h>
-          #include <time.h>
-          #include <stdlib.h>
+  GL_M4_GNULIB_TIMESPEC_GET=0
 
-int
-main ()
-{
 
-          time_t t = 0;
-          struct tm *lt;
-          struct tm saved_lt;
-          struct timeval tv;
-          lt = localtime (&t);
-          saved_lt = *lt;
-          gettimeofday (&tv, NULL);
-          return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_gettimeofday_clobber=no
-else
-  gl_cv_func_gettimeofday_clobber=yes
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  GL_M4_GNULIB_TIME_R=0
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_clobber" >&5
-$as_echo "$gl_cv_func_gettimeofday_clobber" >&6; }
 
- case "$gl_cv_func_gettimeofday_clobber" in
-   *yes)
-     REPLACE_GETTIMEOFDAY=1
 
-  REPLACE_GMTIME=1
-  REPLACE_LOCALTIME=1
+  GL_M4_GNULIB_TIME_RZ=0
 
 
-$as_echo "#define GETTIMEOFDAY_CLOBBERS_LOCALTIME 1" >>confdefs.h
 
-     ;;
- esac
+  GL_M4_GNULIB_TZSET=0
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
-$as_echo_n "checking for gettimeofday with POSIX signature... " >&6; }
-if ${gl_cv_func_gettimeofday_posix_signature+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/time.h>
-              struct timeval c;
-              int gettimeofday (struct timeval *restrict, void *restrict);
 
-int
-main ()
-{
-/* glibc uses struct timezone * rather than the POSIX void *
-                 if _GNU_SOURCE is defined.  However, since the only portable
-                 use of gettimeofday uses NULL as the second parameter, and
-                 since the glibc definition is actually more typesafe, it is
-                 not worth wrapping this to get a compliant signature.  */
-              int (*f) (struct timeval *restrict, void *restrict)
-                = gettimeofday;
-              int x = f (&c, 0);
-              return !(x | c.tv_sec | c.tv_usec);
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_gettimeofday_posix_signature=yes
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/time.h>
-int gettimeofday (struct timeval *restrict, struct timezone *restrict);
+  GL_M4_GNULIB_MDA_TZSET=1
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_gettimeofday_posix_signature=almost
-else
-  gl_cv_func_gettimeofday_posix_signature=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+ac_fn_check_decl "$LINENO" "execvpe" "ac_cv_have_decl_execvpe" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_execvpe" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
-$as_echo "$gl_cv_func_gettimeofday_posix_signature" >&6; }
-    if test $gl_cv_func_gettimeofday_posix_signature = almost; then
-      gl_gettimeofday_timezone='struct timezone'
-    elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
-      REPLACE_GETTIMEOFDAY=1
-    fi
-        if test $REPLACE_STRUCT_TIMEVAL = 1; then
-      REPLACE_GETTIMEOFDAY=1
-    fi
+printf "%s\n" "#define HAVE_DECL_EXECVPE $ac_have_decl" >>confdefs.h
 
-  fi
 
-cat >>confdefs.h <<_ACEOF
-#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone
-_ACEOF
 
 
-  if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
 
 
 
@@ -24367,555 +26811,655 @@ _ACEOF
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS gettimeofday.$ac_objext"
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_unistd_h='<'unistd.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
+printf %s "checking absolute name of <unistd.h>... " >&6; }
+if test ${gl_cv_next_unistd_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_unistd_h = yes; then
 
-  for ac_header in sys/timeb.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "sys/timeb.h" "ac_cv_header_sys_timeb_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_timeb_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_TIMEB_H 1
-_ACEOF
 
-fi
 
-done
 
-  for ac_func in _ftime
-do :
-  ac_fn_c_check_func "$LINENO" "_ftime" "ac_cv_func__ftime"
-if test "x$ac_cv_func__ftime" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE__FTIME 1
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
 _ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'unistd.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_unistd_h
+           gl_cv_next_unistd_h='"'$gl_header'"'
+          else
+               gl_cv_next_unistd_h='<'unistd.h'>'
+             fi
+
 
 fi
-done
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
+printf "%s\n" "$gl_cv_next_unistd_h" >&6; }
+     fi
+     NEXT_UNISTD_H=$gl_cv_next_unistd_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='<'unistd.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_unistd_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
+
 
 
+
+  if test $ac_cv_header_unistd_h = yes; then
+    HAVE_UNISTD_H=1
+  else
+    HAVE_UNISTD_H=0
   fi
 
 
 
 
 
-          GNULIB_GETTIMEOFDAY=1
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
 
+  if test $ac_cv_have_decl_execvpe = no; then
+    HAVE_DECL_EXECVPE=0
+  fi
 
 
-  # Autoconf 2.61a.99 and earlier don't support linking a file only
-  # in VPATH builds.  But since GNUmakefile is for maintainer use
-  # only, it does not matter if we skip the link with older autoconf.
-  # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
-  # builds, so use a shell variable to bypass this.
-  GNUmakefile=GNUmakefile
-  ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
 
 
-  :
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
-$as_echo_n "checking whether isnan(double) can be used without linking with libm... " >&6; }
-if ${gl_cv_func_isnand_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-             #if __GNUC__ >= 4
-             # undef isnand
-             # define isnand(x) __builtin_isnan ((double)(x))
-             #else
-             # undef isnand
-             # define isnand(x) isnan ((double)(x))
-             #endif
-             double x;
-int
-main ()
-{
-return isnand (x);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_isnand_no_libm=yes
-else
-  gl_cv_func_isnand_no_libm=no
+
+  if test "$HAVE_LIBUNISTRING" = yes; then
+    LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"`
+    LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"`
+    LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"`
+  fi
+
+ac_fn_check_decl "$LINENO" "clearerr_unlocked" "ac_cv_have_decl_clearerr_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_clearerr_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+printf "%s\n" "#define HAVE_DECL_CLEARERR_UNLOCKED $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_feof_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
-$as_echo "$gl_cv_func_isnand_no_libm" >&6; }
+printf "%s\n" "#define HAVE_DECL_FEOF_UNLOCKED $ac_have_decl" >>confdefs.h
 
-  gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
-  if test $gl_cv_func_isnand_no_libm = yes; then
+ac_fn_check_decl "$LINENO" "ferror_unlocked" "ac_cv_have_decl_ferror_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_ferror_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FERROR_UNLOCKED $ac_have_decl" >>confdefs.h
 
-$as_echo "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
+ac_fn_check_decl "$LINENO" "fflush_unlocked" "ac_cv_have_decl_fflush_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fflush_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FFLUSH_UNLOCKED $ac_have_decl" >>confdefs.h
 
-  fi
+ac_fn_check_decl "$LINENO" "fgets_unlocked" "ac_cv_have_decl_fgets_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fgets_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FGETS_UNLOCKED $ac_have_decl" >>confdefs.h
 
-  if test $gl_func_isnand_no_libm != yes; then
+ac_fn_check_decl "$LINENO" "fputc_unlocked" "ac_cv_have_decl_fputc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fputc_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FPUTC_UNLOCKED $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "fputs_unlocked" "ac_cv_have_decl_fputs_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fputs_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FPUTS_UNLOCKED $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "fread_unlocked" "ac_cv_have_decl_fread_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fread_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FREAD_UNLOCKED $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "fwrite_unlocked" "ac_cv_have_decl_fwrite_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fwrite_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FWRITE_UNLOCKED $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "getc_unlocked" "ac_cv_have_decl_getc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_getc_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_GETC_UNLOCKED $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "getchar_unlocked" "ac_cv_have_decl_getchar_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_getchar_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_GETCHAR_UNLOCKED $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "putc_unlocked" "ac_cv_have_decl_putc_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_putc_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_PUTC_UNLOCKED $ac_have_decl" >>confdefs.h
 
+ac_fn_check_decl "$LINENO" "putchar_unlocked" "ac_cv_have_decl_putchar_unlocked" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_putchar_unlocked" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_PUTCHAR_UNLOCKED $ac_have_decl" >>confdefs.h
 
-  M4_LIBOBJS="$M4_LIBOBJS isnand.$ac_objext"
 
 
 
 
+  if test $ac_cv_header_features_h = yes; then
+    HAVE_FEATURES_H=1
+  else
+    HAVE_FEATURES_H=0
   fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used without linking with libm" >&5
-$as_echo_n "checking whether isnan(float) can be used without linking with libm... " >&6; }
-if ${gl_cv_func_isnanf_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inttypes.h" >&5
+printf %s "checking for inttypes.h... " >&6; }
+if test ${gl_cv_header_inttypes_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <math.h>
-             #if __GNUC__ >= 4
-             # undef isnanf
-             # define isnanf(x) __builtin_isnanf ((float)(x))
-             #elif defined isnan
-             # undef isnanf
-             # define isnanf(x) isnan ((float)(x))
-             #endif
-             float x;
+
+#include <sys/types.h>
+#include <inttypes.h>
+
 int
-main ()
+main (void)
 {
-return isnanf (x);
+uintmax_t i = (uintmax_t) -1; return !i;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_isnanf_no_libm=yes
-else
-  gl_cv_func_isnanf_no_libm=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_inttypes_h=yes
+else $as_nop
+  gl_cv_header_inttypes_h=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_inttypes_h" >&5
+printf "%s\n" "$gl_cv_header_inttypes_h" >&6; }
+  if test $gl_cv_header_inttypes_h = yes; then
+
+printf "%s\n" "#define HAVE_INTTYPES_H_WITH_UINTMAX 1" >>confdefs.h
 
+  fi
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdint.h" >&5
+printf %s "checking for stdint.h... " >&6; }
+if test ${gl_cv_header_stdint_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+            #include <stdint.h>
+int
+main (void)
+{
+uintmax_t i = (uintmax_t) -1; return !i;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_stdint_h=yes
+else $as_nop
+  gl_cv_header_stdint_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_no_libm" >&5
-$as_echo "$gl_cv_func_isnanf_no_libm" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_stdint_h" >&5
+printf "%s\n" "$gl_cv_header_stdint_h" >&6; }
+  if test $gl_cv_header_stdint_h = yes; then
 
-  if test $gl_cv_func_isnanf_no_libm = yes; then
+printf "%s\n" "#define HAVE_STDINT_H_WITH_UINTMAX 1" >>confdefs.h
 
+  fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) works" >&5
-$as_echo_n "checking whether isnan(float) works... " >&6; }
-if ${gl_cv_func_isnanf_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-           irix* | solaris*) gl_cv_func_isnanf_works="guessing no";;
-           *)                gl_cv_func_isnanf_works="guessing yes";;
-         esac
 
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for intmax_t" >&5
+printf %s "checking for intmax_t... " >&6; }
+if test ${gt_cv_c_intmax_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <math.h>
-#if __GNUC__ >= 4
-# undef isnanf
-# define isnanf(x) __builtin_isnanf ((float)(x))
-#elif defined isnan
-# undef isnanf
-# define isnanf(x) isnan ((float)(x))
+#include <stddef.h>
+#include <stdlib.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+#include <stdint.h>
 #endif
-/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
-#ifdef __DECC
-static float
-NaN ()
-{
-  static float zero = 0.0f;
-  return zero / zero;
-}
-#else
-# define NaN() (0.0f / 0.0f)
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+#include <inttypes.h>
 #endif
-#define NWORDS \
-  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { unsigned int word[NWORDS]; float value; } memory_float;
-int main()
-{
-  int result = 0;
 
-  if (isnanf (1.0f / 0.0f))
-    result |= 1;
-
-  if (!isnanf (NaN ()))
-    result |= 2;
-
-#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
-  /* The isnanf function should be immune against changes in the sign bit and
-     in the mantissa bits.  The xor operation twiddles a bit that can only be
-     a sign bit or a mantissa bit.  */
-  if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0)
-    {
-      memory_float m;
-
-      m.value = NaN ();
-      /* Set the bits below the exponent to 01111...111.  */
-      m.word[0] &= -1U << FLT_EXPBIT0_BIT;
-      m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1;
-      if (!isnanf (m.value))
-        result |= 4;
-    }
-#endif
-
-  return result;
+int
+main (void)
+{
+intmax_t x = -1; return !x;
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_isnanf_works=yes
-else
-  gl_cv_func_isnanf_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gt_cv_c_intmax_t=yes
+else $as_nop
+  gt_cv_c_intmax_t=no
 fi
-
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_works" >&5
-$as_echo "$gl_cv_func_isnanf_works" >&6; }
-
-  fi
-  if test $gl_cv_func_isnanf_no_libm = yes \
-     && { case "$gl_cv_func_isnanf_works" in
-            *yes) true;;
-            *) false;;
-          esac
-        }; then
-    gl_func_isnanf_no_libm=yes
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_c_intmax_t" >&5
+printf "%s\n" "$gt_cv_c_intmax_t" >&6; }
+  if test $gt_cv_c_intmax_t = yes; then
 
-$as_echo "#define HAVE_ISNANF_IN_LIBC 1" >>confdefs.h
+printf "%s\n" "#define HAVE_INTMAX_T 1" >>confdefs.h
 
   else
-    gl_func_isnanf_no_libm=no
-  fi
-
-  if test $gl_func_isnanf_no_libm != yes; then
-
-
-
 
+printf "%s\n" "#define intmax_t long long" >>confdefs.h
 
+  fi
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS isnanf.$ac_objext"
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf truncates the result as in C99" >&5
+printf %s "checking whether snprintf truncates the result as in C99... " >&6; }
+if test ${gl_cv_func_snprintf_truncation_c99+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
-$as_echo_n "checking where to find the exponent in a 'float'... " >&6; }
-if ${gl_cv_cc_float_expbit0+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu* | gnu*)        gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4].*)       gl_cv_func_snprintf_truncation_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+           midnightbsd*)         gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on Mac OS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
+           darwin*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_snprintf_truncation_c99="guessing no";;
+           openbsd*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on Solaris >= 2.6.
+           solaris2.[0-5] | solaris2.[0-5].*)
+                                 gl_cv_func_snprintf_truncation_c99="guessing no";;
+           solaris*)             gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on AIX >= 4.
+           aix[1-3]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
+           aix*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on HP-UX >= 11.
+           hpux[7-9]* | hpux10*) gl_cv_func_snprintf_truncation_c99="guessing no";;
+           hpux*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on IRIX >= 6.5.
+           irix6.5)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on OSF/1 >= 5.
+           osf[3-4]*)            gl_cv_func_snprintf_truncation_c99="guessing no";;
+           osf*)                 gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_snprintf_truncation_c99="guessing no";;
+           netbsd*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on Android.
+           linux*-android*)      gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess no on native Windows.
+           mingw*)               gl_cv_func_snprintf_truncation_c99="guessing no";;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";;
+         esac
 
-      if test "$cross_compiling" = yes; then :
-  gl_cv_cc_float_expbit0="word 0 bit 23"
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <float.h>
-#include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#define NWORDS \
-  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { float value; unsigned int word[NWORDS]; } memory_float;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (float x)
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
 {
-  memory_float m;
-  size_t i;
-  /* Clear it first, in case
-     sizeof (float) < sizeof (memory_float).  */
-  memset (&m, 0, sizeof (memory_float));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
+  va_list args;
+  int ret;
+  va_start (args, format);
+  ret = vsnprintf (buf, size, format, args);
+  va_end (args);
+  return ret;
 }
+#endif
+static char buf[100];
 int main ()
 {
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
+  strcpy (buf, "ABCDEF");
+  my_snprintf (buf, 3, "%d %d", 4567, 89);
+  if (memcmp (buf, "45\0DEF", 6) != 0)
     return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25f);
-  add_to_ored_words (0.5f);
-  add_to_ored_words (1.0f);
-  add_to_ored_words (2.0f);
-  add_to_ored_words (4.0f);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
+  return 0;
 }
-
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_float_expbit0=`cat conftest.out`
-else
-  gl_cv_cc_float_expbit0="unknown"
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_snprintf_truncation_c99=yes
+else $as_nop
+  gl_cv_func_snprintf_truncation_c99=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-      rm -f conftest.out
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
-$as_echo "$gl_cv_cc_float_expbit0" >&6; }
-  case "$gl_cv_cc_float_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_truncation_c99" >&5
+printf "%s\n" "$gl_cv_func_snprintf_truncation_c99" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define FLT_EXPBIT0_WORD $word
-_ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define FLT_EXPBIT0_BIT $bit
-_ACEOF
 
-      ;;
-  esac
 
+  ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
+if test "x$ac_cv_func_snprintf" = xyes
+then :
+  printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h
 
-  fi
+fi
+ac_fn_c_check_func "$LINENO" "strnlen" "ac_cv_func_strnlen"
+if test "x$ac_cv_func_strnlen" = xyes
+then :
+  printf "%s\n" "#define HAVE_STRNLEN 1" >>confdefs.h
 
+fi
+ac_fn_c_check_func "$LINENO" "wcslen" "ac_cv_func_wcslen"
+if test "x$ac_cv_func_wcslen" = xyes
+then :
+  printf "%s\n" "#define HAVE_WCSLEN 1" >>confdefs.h
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
-$as_echo_n "checking whether isnan(long double) can be used without linking with libm... " >&6; }
-if ${gl_cv_func_isnanl_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+fi
+ac_fn_c_check_func "$LINENO" "wcsnlen" "ac_cv_func_wcsnlen"
+if test "x$ac_cv_func_wcsnlen" = xyes
+then :
+  printf "%s\n" "#define HAVE_WCSNLEN 1" >>confdefs.h
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-             #if __GNUC__ >= 4
-             # undef isnanl
-             # define isnanl(x) __builtin_isnanl ((long double)(x))
-             #elif defined isnan
-             # undef isnanl
-             # define isnanl(x) isnan ((long double)(x))
-             #endif
-             long double x;
-int
-main ()
-{
-return isnanl (x);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_isnanl_no_libm=yes
-else
-  gl_cv_func_isnanl_no_libm=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+ac_fn_c_check_func "$LINENO" "mbrtowc" "ac_cv_func_mbrtowc"
+if test "x$ac_cv_func_mbrtowc" = xyes
+then :
+  printf "%s\n" "#define HAVE_MBRTOWC 1" >>confdefs.h
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5
-$as_echo "$gl_cv_func_isnanl_no_libm" >&6; }
+ac_fn_c_check_func "$LINENO" "wcrtomb" "ac_cv_func_wcrtomb"
+if test "x$ac_cv_func_wcrtomb" = xyes
+then :
+  printf "%s\n" "#define HAVE_WCRTOMB 1" >>confdefs.h
 
-  gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
-  if test $gl_func_isnanl_no_libm = yes; then
+fi
 
+      ac_fn_check_decl "$LINENO" "_snprintf" "ac_cv_have_decl__snprintf" "#include <stdio.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl__snprintf" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL__SNPRINTF $ac_have_decl" >>confdefs.h
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
-$as_echo_n "checking whether isnanl works... " >&6; }
-if ${gl_cv_func_isnanl_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  case "$gl_cv_func_snprintf_retval_c99" in
+    *yes)
 
-      if test "$cross_compiling" = yes; then :
-  gl_cv_func_isnanl_works="guessing yes"
-else
+printf "%s\n" "#define HAVE_SNPRINTF_RETVAL_C99 1" >>confdefs.h
+
+      ;;
+  esac
+
+  case "$gl_cv_func_snprintf_truncation_c99" in
+    *yes)
+
+printf "%s\n" "#define HAVE_SNPRINTF_TRUNCATION_C99 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports size specifiers as in C99" >&5
+printf %s "checking whether printf supports size specifiers as in C99... " >&6; }
+if test ${gl_cv_func_printf_sizes_c99+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu* | gnu*)        gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on FreeBSD >= 5.
+           freebsd[1-4].*)       gl_cv_func_printf_sizes_c99="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           midnightbsd*)         gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on Mac OS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
+           darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on OpenBSD >= 3.9.
+           openbsd[1-2].* | openbsd3.[0-8] | openbsd3.[0-8].*)
+                                 gl_cv_func_printf_sizes_c99="guessing no";;
+           openbsd*)             gl_cv_func_printf_sizes_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 NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_printf_sizes_c99="guessing no";;
+           netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on Android.
+           linux*-android*)      gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on MSVC, no on mingw.
+           mingw*)               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef _MSC_VER
+ Known
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_func_printf_sizes_c99="guessing yes"
+else $as_nop
+  gl_cv_func_printf_sizes_c99="guessing no"
+fi
+rm -rf conftest*
+
+                                 ;;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_printf_sizes_c99="$gl_cross_guess_normal";;
+         esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <float.h>
-#include <limits.h>
-#include <math.h>
-#if __GNUC__ >= 4
-# undef isnanl
-# define isnanl(x) __builtin_isnanl ((long double)(x))
-#elif defined isnan
-# undef isnanl
-# define isnanl(x) isnan ((long double)(x))
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#if HAVE_STDINT_H_WITH_UINTMAX
+# include <stdint.h>
 #endif
-#define NWORDS \
-  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { unsigned int word[NWORDS]; long double value; }
-        memory_long_double;
-/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
-   runtime type conversion.  */
-#ifdef __sgi
-static long double NaNl ()
-{
-  double zero = 0.0;
-  return zero / zero;
-}
-#else
-# define NaNl() (0.0L / 0.0L)
+#if HAVE_INTTYPES_H_WITH_UINTMAX
+# include <inttypes.h>
 #endif
+static char buf[100];
 int main ()
 {
   int result = 0;
-
-  if (!isnanl (NaNl ()))
+#if HAVE_STDINT_H_WITH_UINTMAX || HAVE_INTTYPES_H_WITH_UINTMAX
+  buf[0] = '\0';
+  if (sprintf (buf, "%ju %d", (uintmax_t) 12345671, 33, 44, 55) < 0
+      || strcmp (buf, "12345671 33") != 0)
     result |= 1;
-
-  {
-    memory_long_double m;
-    unsigned int i;
-
-    /* The isnanl function should be immune against changes in the sign bit and
-       in the mantissa bits.  The xor operation twiddles a bit that can only be
-       a sign bit or a mantissa bit (since the exponent never extends to
-       bit 31).  */
-    m.value = NaNl ();
-    m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
-    for (i = 0; i < NWORDS; i++)
-      m.word[i] |= 1;
-    if (!isnanl (m.value))
-      result |= 1;
-  }
-
-#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
-/* Representation of an 80-bit 'long double' as an initializer for a sequence
-   of 'unsigned int' words.  */
-# ifdef WORDS_BIGENDIAN
-#  define LDBL80_WORDS(exponent,manthi,mantlo) \
-     { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
-       ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16),   \
-       (unsigned int) (mantlo) << 16                                        \
-     }
-# else
-#  define LDBL80_WORDS(exponent,manthi,mantlo) \
-     { mantlo, manthi, exponent }
-# endif
-  { /* Quiet NaN.  */
-    static memory_long_double x =
-      { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
-    if (!isnanl (x.value))
-      result |= 2;
-  }
-  {
-    /* Signalling NaN.  */
-    static memory_long_double x =
-      { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
-    if (!isnanl (x.value))
-      result |= 2;
-  }
-  /* isnanl should return something even for noncanonical values.  */
-  { /* Pseudo-NaN.  */
-    static memory_long_double x =
-      { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
-    if (isnanl (x.value) && !isnanl (x.value))
-      result |= 4;
-  }
-  { /* Pseudo-Infinity.  */
-    static memory_long_double x =
-      { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
-    if (isnanl (x.value) && !isnanl (x.value))
-      result |= 8;
-  }
-  { /* Pseudo-Zero.  */
-    static memory_long_double x =
-      { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
-    if (isnanl (x.value) && !isnanl (x.value))
-      result |= 16;
-  }
-  { /* Unnormalized number.  */
-    static memory_long_double x =
-      { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
-    if (isnanl (x.value) && !isnanl (x.value))
-      result |= 32;
-  }
-  { /* Pseudo-Denormal.  */
-    static memory_long_double x =
-      { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
-    if (isnanl (x.value) && !isnanl (x.value))
-      result |= 64;
-  }
+#else
+  result |= 1;
 #endif
-
+  buf[0] = '\0';
+  if (sprintf (buf, "%zu %d", (size_t) 12345672, 33, 44, 55) < 0
+      || strcmp (buf, "12345672 33") != 0)
+    result |= 2;
+  buf[0] = '\0';
+  if (sprintf (buf, "%tu %d", (ptrdiff_t) 12345673, 33, 44, 55) < 0
+      || strcmp (buf, "12345673 33") != 0)
+    result |= 4;
+  buf[0] = '\0';
+  if (sprintf (buf, "%Lg %d", (long double) 1.5, 33, 44, 55) < 0
+      || strcmp (buf, "1.5 33") != 0)
+    result |= 8;
   return result;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_isnanl_works=yes
-else
-  gl_cv_func_isnanl_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_sizes_c99=yes
+else $as_nop
+  gl_cv_func_printf_sizes_c99=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5
-$as_echo "$gl_cv_func_isnanl_works" >&6; }
-
-    case "$gl_cv_func_isnanl_works" in
-      *yes) ;;
-      *)    gl_func_isnanl_no_libm=no ;;
-    esac
-  fi
-  if test $gl_func_isnanl_no_libm = yes; then
-
-$as_echo "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
-
-  fi
-
-  if test $gl_func_isnanl_no_libm != yes; then
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_sizes_c99" >&5
+printf "%s\n" "$gl_cv_func_printf_sizes_c99" >&6; }
 
 
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports 'long double' arguments" >&5
+printf %s "checking whether printf supports 'long double' arguments... " >&6; }
+if test ${gl_cv_func_printf_long_double+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                            # Guess no on BeOS.
+           beos*)           gl_cv_func_printf_long_double="guessing no";;
+                            # Guess yes on Android.
+           linux*-android*) gl_cv_func_printf_long_double="guessing yes";;
+                            # Guess yes on MSVC, no on mingw.
+           mingw*)          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#ifdef _MSC_VER
+ Known
+#endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_func_printf_long_double="guessing yes"
+else $as_nop
+  gl_cv_func_printf_long_double="guessing no"
+fi
+rm -rf conftest*
 
-  M4_LIBOBJS="$M4_LIBOBJS isnanl.$ac_objext"
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
-$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
-if ${gl_cv_cc_long_double_expbit0+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      if test "$cross_compiling" = yes; then :
-
-                              gl_cv_cc_long_double_expbit0="unknown"
+                            ;;
+           *)               gl_cv_func_printf_long_double="guessing yes";;
+         esac
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <float.h>
-#include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#define NWORDS \
-  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { long double value; unsigned int word[NWORDS]; }
-        memory_long_double;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (long double x)
-{
-  memory_long_double m;
-  size_t i;
-  /* Clear it first, in case
-     sizeof (long double) < sizeof (memory_long_double).  */
-  memset (&m, 0, sizeof (memory_long_double));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
+static char buf[10000];
 int main ()
 {
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25L);
-  add_to_ored_words (0.5L);
-  add_to_ored_words (1.0L);
-  add_to_ored_words (2.0L);
-  add_to_ored_words (4.0L);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
+  int result = 0;
+  buf[0] = '\0';
+  if (sprintf (buf, "%Lf %d", 1.75L, 33, 44, 55) < 0
+      || strcmp (buf, "1.750000 33") != 0)
+    result |= 1;
+  buf[0] = '\0';
+  if (sprintf (buf, "%Le %d", 1.75L, 33, 44, 55) < 0
+      || strcmp (buf, "1.750000e+00 33") != 0)
+    result |= 2;
+  buf[0] = '\0';
+  if (sprintf (buf, "%Lg %d", 1.75L, 33, 44, 55) < 0
+      || strcmp (buf, "1.75 33") != 0)
+    result |= 4;
+  return result;
 }
-
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_long_double_expbit0=`cat conftest.out`
-else
-  gl_cv_cc_long_double_expbit0="unknown"
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_long_double=yes
+else $as_nop
+  gl_cv_func_printf_long_double=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-      rm -f conftest.out
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
-$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
-  case "$gl_cv_cc_long_double_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_long_double" >&5
+printf "%s\n" "$gl_cv_func_printf_long_double" >&6; }
 
-cat >>confdefs.h <<_ACEOF
-#define LDBL_EXPBIT0_WORD $word
-_ACEOF
 
 
-cat >>confdefs.h <<_ACEOF
-#define LDBL_EXPBIT0_BIT $bit
-_ACEOF
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'double' arguments" >&5
+printf %s "checking whether printf supports infinite 'double' arguments... " >&6; }
+if test ${gl_cv_func_printf_infinite+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-      ;;
-  esac
+      if test "$cross_compiling" = yes
+then :
 
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu* | gnu*)        gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on FreeBSD >= 6.
+           freebsd[1-5].*)       gl_cv_func_printf_infinite="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
+           midnightbsd*)         gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on Mac OS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
+           darwin*)              gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on HP-UX >= 11.
+           hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite="guessing no";;
+           hpux*)                gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on NetBSD >= 3.
+           netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
+                                 gl_cv_func_printf_infinite="guessing no";;
+           netbsd*)              gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on OpenBSD >= 6.0.
+           openbsd[1-5].*)       gl_cv_func_printf_infinite="guessing no";;
+           openbsd*)             gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on BeOS.
+           beos*)                gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess no on Android.
+           linux*-android*)      gl_cv_func_printf_infinite="guessing no";;
+                                 # Guess yes on MSVC, no on mingw.
+           mingw*)               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#ifdef _MSC_VER
+ Known
+#endif
 
-  fi
-
-
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_func_printf_infinite="guessing yes"
+else $as_nop
+  gl_cv_func_printf_infinite="guessing no"
+fi
+rm -rf conftest*
 
+                                 ;;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_printf_infinite="$gl_cross_guess_normal";;
+         esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <stdio.h>
+#include <string.h>
+static int
+strisnan (const char *string, size_t start_index, size_t end_index)
+{
+  if (start_index < end_index)
+    {
+      if (string[start_index] == '-')
+        start_index++;
+      if (start_index + 3 <= end_index
+          && memcmp (string + start_index, "nan", 3) == 0)
+        {
+          start_index += 3;
+          if (start_index == end_index
+              || (string[start_index] == '(' && string[end_index - 1] == ')'))
+            return 1;
+        }
+    }
+  return 0;
+}
+static int
+have_minus_zero ()
+{
+  static double plus_zero = 0.0;
+  double minus_zero = - plus_zero;
+  return memcmp (&plus_zero, &minus_zero, sizeof (double)) != 0;
+}
+static char buf[10000];
+static double zero = 0.0;
+int main ()
+{
+  int result = 0;
+  if (sprintf (buf, "%f", 1.0 / zero) < 0
+      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+    result |= 1;
+  if (sprintf (buf, "%f", -1.0 / zero) < 0
+      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+    result |= 1;
+  if (sprintf (buf, "%f", zero / zero) < 0
+      || !strisnan (buf, 0, strlen (buf)))
+    result |= 2;
+  if (sprintf (buf, "%e", 1.0 / zero) < 0
+      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+    result |= 4;
+  if (sprintf (buf, "%e", -1.0 / zero) < 0
+      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+    result |= 4;
+  if (sprintf (buf, "%e", zero / zero) < 0
+      || !strisnan (buf, 0, strlen (buf)))
+    result |= 8;
+  if (sprintf (buf, "%g", 1.0 / zero) < 0
+      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+    result |= 16;
+  if (sprintf (buf, "%g", -1.0 / zero) < 0
+      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+    result |= 16;
+  if (sprintf (buf, "%g", zero / zero) < 0
+      || !strisnan (buf, 0, strlen (buf)))
+    result |= 32;
+  /* This test fails on HP-UX 10.20.  */
+  if (have_minus_zero ())
+    if (sprintf (buf, "%g", - zero) < 0
+        || strcmp (buf, "-0") != 0)
+    result |= 64;
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_infinite=yes
+else $as_nop
+  gl_cv_func_printf_infinite=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite" >&5
+printf "%s\n" "$gl_cv_func_printf_infinite" >&6; }
 
 
 
 
 
 
+         if test -n "$gl_printf_safe"; then
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_langinfo_h='<'langinfo.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <langinfo.h>" >&5
-$as_echo_n "checking absolute name of <langinfo.h>... " >&6; }
-if ${gl_cv_next_langinfo_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+printf "%s\n" "#define CHECK_PRINTF_SAFE 1" >>confdefs.h
 
-             if test $ac_cv_header_langinfo_h = yes; then
+  fi
+  case "$gl_cv_func_printf_long_double" in
+    *yes)
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports infinite 'long double' arguments" >&5
+printf %s "checking whether printf supports infinite 'long double' arguments... " >&6; }
+if test ${gl_cv_func_printf_infinite_long_double+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+          if test "$cross_compiling" = yes
+then :
+  case "$host_cpu" in
+                                     # Guess no on ia64, x86_64, i386.
+               ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
+               *)
+                 case "$host_os" in
+                                         # Guess yes on glibc systems.
+                   *-gnu* | gnu*)        gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on musl systems.
+                   *-musl*)              gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on FreeBSD >= 6.
+                   freebsd[1-5].*)       gl_cv_func_printf_infinite_long_double="guessing no";;
+                   freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+                   midnightbsd*)         gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on HP-UX >= 11.
+                   hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
+                   hpux*)                gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on OpenBSD >= 6.0.
+                   openbsd[1-5].*)       gl_cv_func_printf_infinite_long_double="guessing no";;
+                   openbsd*)             gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess no on Android.
+                   linux*-android*)      gl_cv_func_printf_infinite_long_double="guessing no";;
+                                         # Guess yes on MSVC, no on mingw.
+                   mingw*)               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#ifdef _MSC_VER
+ Known
+#endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_func_printf_infinite_long_double="guessing yes"
+else $as_nop
+  gl_cv_func_printf_infinite_long_double="guessing no"
+fi
+rm -rf conftest*
 
+                                         ;;
+                                         # If we don't know, obey --enable-cross-guesses.
+                   *)                    gl_cv_func_printf_infinite_long_double="$gl_cross_guess_normal";;
+                 esac
+                 ;;
+             esac
 
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <langinfo.h>
+
+
+#include <stdlib.h>
+#if defined __MACH__ && defined __APPLE__
+/* Avoid a crash on Mac OS X.  */
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+/* The exception port on which our thread listens.  */
+static mach_port_t our_exception_port;
+/* The main function of the thread listening for exceptions of type
+   EXC_BAD_ACCESS.  */
+static void *
+mach_exception_thread (void *arg)
+{
+  /* Buffer for a message to be received.  */
+  struct {
+    mach_msg_header_t head;
+    mach_msg_body_t msgh_body;
+    char data[1024];
+  } msg;
+  mach_msg_return_t retval;
+  /* Wait for a message on the exception port.  */
+  retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
+                     our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+  if (retval != MACH_MSG_SUCCESS)
+    abort ();
+  exit (1);
+}
+static void
+nocrash_init (void)
+{
+  mach_port_t self = mach_task_self ();
+  /* Allocate a port on which the thread shall listen for exceptions.  */
+  if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
+      == KERN_SUCCESS) {
+    /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
+    if (mach_port_insert_right (self, our_exception_port, our_exception_port,
+                                MACH_MSG_TYPE_MAKE_SEND)
+        == KERN_SUCCESS) {
+      /* The exceptions we want to catch.  Only EXC_BAD_ACCESS is interesting
+         for us.  */
+      exception_mask_t mask = EXC_MASK_BAD_ACCESS;
+      /* Create the thread listening on the exception port.  */
+      pthread_attr_t attr;
+      pthread_t thread;
+      if (pthread_attr_init (&attr) == 0
+          && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
+          && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
+        pthread_attr_destroy (&attr);
+        /* Replace the exception port info for these exceptions with our own.
+           Note that we replace the exception port for the entire task, not only
+           for a particular thread.  This has the effect that when our exception
+           port gets the message, the thread specific exception port has already
+           been asked, and we don't need to bother about it.
+           See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
+        task_set_exception_ports (self, mask, our_exception_port,
+                                  EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
+      }
+    }
+  }
+}
+#elif defined _WIN32 && ! defined __CYGWIN__
+/* Avoid a crash on native Windows.  */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+    {
+    case EXCEPTION_ACCESS_VIOLATION:
+    case EXCEPTION_IN_PAGE_ERROR:
+    case EXCEPTION_STACK_OVERFLOW:
+    case EXCEPTION_GUARD_PAGE:
+    case EXCEPTION_PRIV_INSTRUCTION:
+    case EXCEPTION_ILLEGAL_INSTRUCTION:
+    case EXCEPTION_DATATYPE_MISALIGNMENT:
+    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+      exit (1);
+    }
+  return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
+#else
+/* Avoid a crash on POSIX systems.  */
+#include <signal.h>
+#include <unistd.h>
+/* A POSIX signal handler.  */
+static void
+exception_handler (int sig)
+{
+  _exit (1);
+}
+static void
+nocrash_init (void)
+{
+#ifdef SIGSEGV
+  signal (SIGSEGV, exception_handler);
+#endif
+#ifdef SIGBUS
+  signal (SIGBUS, exception_handler);
+#endif
+}
+#endif
+
+#include <float.h>
+#include <stdio.h>
+#include <string.h>
+static int
+strisnan (const char *string, size_t start_index, size_t end_index)
+{
+  if (start_index < end_index)
+    {
+      if (string[start_index] == '-')
+        start_index++;
+      if (start_index + 3 <= end_index
+          && memcmp (string + start_index, "nan", 3) == 0)
+        {
+          start_index += 3;
+          if (start_index == end_index
+              || (string[start_index] == '(' && string[end_index - 1] == ')'))
+            return 1;
+        }
+    }
+  return 0;
+}
+static char buf[10000];
+static long double zeroL = 0.0L;
+int main ()
+{
+  int result = 0;
+  nocrash_init();
+  if (sprintf (buf, "%Lf", 1.0L / zeroL) < 0
+      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+    result |= 1;
+  if (sprintf (buf, "%Lf", -1.0L / zeroL) < 0
+      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+    result |= 1;
+  if (sprintf (buf, "%Lf", zeroL / zeroL) < 0
+      || !strisnan (buf, 0, strlen (buf)))
+    result |= 1;
+  if (sprintf (buf, "%Le", 1.0L / zeroL) < 0
+      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+    result |= 1;
+  if (sprintf (buf, "%Le", -1.0L / zeroL) < 0
+      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+    result |= 1;
+  if (sprintf (buf, "%Le", zeroL / zeroL) < 0
+      || !strisnan (buf, 0, strlen (buf)))
+    result |= 1;
+  if (sprintf (buf, "%Lg", 1.0L / zeroL) < 0
+      || (strcmp (buf, "inf") != 0 && strcmp (buf, "infinity") != 0))
+    result |= 1;
+  if (sprintf (buf, "%Lg", -1.0L / zeroL) < 0
+      || (strcmp (buf, "-inf") != 0 && strcmp (buf, "-infinity") != 0))
+    result |= 1;
+  if (sprintf (buf, "%Lg", zeroL / zeroL) < 0
+      || !strisnan (buf, 0, strlen (buf)))
+    result |= 1;
+#if CHECK_PRINTF_SAFE && ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+/* Representation of an 80-bit 'long double' as an initializer for a sequence
+   of 'unsigned int' words.  */
+# ifdef WORDS_BIGENDIAN
+#  define LDBL80_WORDS(exponent,manthi,mantlo) \
+     { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
+       ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16),   \
+       (unsigned int) (mantlo) << 16                                        \
+     }
+# else
+#  define LDBL80_WORDS(exponent,manthi,mantlo) \
+     { mantlo, manthi, exponent }
+# endif
+  { /* Quiet NaN.  */
+    static union { unsigned int word[4]; long double value; } x =
+      { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
+    if (sprintf (buf, "%Lf", x.value) < 0
+        || !strisnan (buf, 0, strlen (buf)))
+      result |= 2;
+    if (sprintf (buf, "%Le", x.value) < 0
+        || !strisnan (buf, 0, strlen (buf)))
+      result |= 2;
+    if (sprintf (buf, "%Lg", x.value) < 0
+        || !strisnan (buf, 0, strlen (buf)))
+      result |= 2;
+  }
+  {
+    /* Signalling NaN.  */
+    static union { unsigned int word[4]; long double value; } x =
+      { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
+    if (sprintf (buf, "%Lf", x.value) < 0
+        || !strisnan (buf, 0, strlen (buf)))
+      result |= 2;
+    if (sprintf (buf, "%Le", x.value) < 0
+        || !strisnan (buf, 0, strlen (buf)))
+      result |= 2;
+    if (sprintf (buf, "%Lg", x.value) < 0
+        || !strisnan (buf, 0, strlen (buf)))
+      result |= 2;
+  }
+  { /* Pseudo-NaN.  */
+    static union { unsigned int word[4]; long double value; } x =
+      { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
+    if (sprintf (buf, "%Lf", x.value) <= 0)
+      result |= 4;
+    if (sprintf (buf, "%Le", x.value) <= 0)
+      result |= 4;
+    if (sprintf (buf, "%Lg", x.value) <= 0)
+      result |= 4;
+  }
+  { /* Pseudo-Infinity.  */
+    static union { unsigned int word[4]; long double value; } x =
+      { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
+    if (sprintf (buf, "%Lf", x.value) <= 0)
+      result |= 8;
+    if (sprintf (buf, "%Le", x.value) <= 0)
+      result |= 8;
+    if (sprintf (buf, "%Lg", x.value) <= 0)
+      result |= 8;
+  }
+  { /* Pseudo-Zero.  */
+    static union { unsigned int word[4]; long double value; } x =
+      { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
+    if (sprintf (buf, "%Lf", x.value) <= 0)
+      result |= 16;
+    if (sprintf (buf, "%Le", x.value) <= 0)
+      result |= 16;
+    if (sprintf (buf, "%Lg", x.value) <= 0)
+      result |= 16;
+  }
+  { /* Unnormalized number.  */
+    static union { unsigned int word[4]; long double value; } x =
+      { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
+    if (sprintf (buf, "%Lf", x.value) <= 0)
+      result |= 32;
+    if (sprintf (buf, "%Le", x.value) <= 0)
+      result |= 32;
+    if (sprintf (buf, "%Lg", x.value) <= 0)
+      result |= 32;
+  }
+  { /* Pseudo-Denormal.  */
+    static union { unsigned int word[4]; long double value; } x =
+      { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
+    if (sprintf (buf, "%Lf", x.value) <= 0)
+      result |= 64;
+    if (sprintf (buf, "%Le", x.value) <= 0)
+      result |= 64;
+    if (sprintf (buf, "%Lg", x.value) <= 0)
+      result |= 64;
+  }
+#endif
+  return result;
+}
 _ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_infinite_long_double=yes
+else $as_nop
+  gl_cv_func_printf_infinite_long_double=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_infinite_long_double" >&5
+printf "%s\n" "$gl_cv_func_printf_infinite_long_double" >&6; }
       ;;
     *)
-      gl_dirsep_regex='\/'
+      gl_cv_func_printf_infinite_long_double="irrelevant"
       ;;
   esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'langinfo.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
-
-        gl_cv_absolute_langinfo_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
-
-           gl_header=$gl_cv_absolute_langinfo_h
-           gl_cv_next_langinfo_h='"'$gl_header'"'
-          else
-               gl_cv_next_langinfo_h='<'langinfo.h'>'
-             fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_langinfo_h" >&5
-$as_echo "$gl_cv_next_langinfo_h" >&6; }
-     fi
-     NEXT_LANGINFO_H=$gl_cv_next_langinfo_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='<'langinfo.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_langinfo_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H=$gl_next_as_first_directive
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'a' and 'A' directives" >&5
+printf %s "checking whether printf supports the 'a' and 'A' directives... " >&6; }
+if test ${gl_cv_func_printf_directive_a+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
 
+         case "$host_os" in
+                                 # Guess yes on glibc >= 2.5 systems.
+           *-gnu* | gnu*)
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+               #include <features.h>
+               #ifdef __GNU_LIBRARY__
+                #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 5) || (__GLIBC__ > 2)) && !defined __UCLIBC__
+                 BZ2908
+                #endif
+               #endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "BZ2908" >/dev/null 2>&1
+then :
+  gl_cv_func_printf_directive_a="guessing yes"
+else $as_nop
+  gl_cv_func_printf_directive_a="guessing no"
+fi
+rm -rf conftest*
 
-    HAVE_LANGINFO_CODESET=0
-  HAVE_LANGINFO_T_FMT_AMPM=0
-  HAVE_LANGINFO_ERA=0
-  HAVE_LANGINFO_YESEXPR=0
+             ;;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_printf_directive_a="guessing yes";;
+                                 # Guess no on Android.
+           linux*-android*)      gl_cv_func_printf_directive_a="guessing no";;
+                                 # Guess no on native Windows.
+           mingw*)               gl_cv_func_printf_directive_a="guessing no";;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_printf_directive_a="$gl_cross_guess_normal";;
+         esac
 
-  if test $ac_cv_header_langinfo_h = yes; then
-    HAVE_LANGINFO_H=1
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines CODESET" >&5
-$as_echo_n "checking whether langinfo.h defines CODESET... " >&6; }
-if ${gl_cv_header_langinfo_codeset+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <langinfo.h>
-int a = CODESET;
 
-int
-main ()
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+static double zero = 0.0;
+int main ()
 {
-
-  ;
-  return 0;
+  int result = 0;
+  if (sprintf (buf, "%a %d", 3.1416015625, 33, 44, 55) < 0
+      || (strcmp (buf, "0x1.922p+1 33") != 0
+          && strcmp (buf, "0x3.244p+0 33") != 0
+          && strcmp (buf, "0x6.488p-1 33") != 0
+          && strcmp (buf, "0xc.91p-2 33") != 0))
+    result |= 1;
+  if (sprintf (buf, "%A %d", -3.1416015625, 33, 44, 55) < 0
+      || (strcmp (buf, "-0X1.922P+1 33") != 0
+          && strcmp (buf, "-0X3.244P+0 33") != 0
+          && strcmp (buf, "-0X6.488P-1 33") != 0
+          && strcmp (buf, "-0XC.91P-2 33") != 0))
+    result |= 2;
+  /* This catches a FreeBSD 13.0 bug: it doesn't round.  */
+  if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
+      || (strcmp (buf, "0x1.83p+0 33") != 0
+          && strcmp (buf, "0x3.05p-1 33") != 0
+          && strcmp (buf, "0x6.0ap-2 33") != 0
+          && strcmp (buf, "0xc.14p-3 33") != 0))
+    result |= 4;
+  /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round.  */
+  if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
+      || (strcmp (buf, "0x2p+0 33") != 0
+          && strcmp (buf, "0x3p-1 33") != 0
+          && strcmp (buf, "0x6p-2 33") != 0
+          && strcmp (buf, "0xcp-3 33") != 0))
+    result |= 4;
+  /* This catches a FreeBSD 6.1 bug.  See
+     <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
+  if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
+      || buf[0] == '0')
+    result |= 8;
+  /* This catches a Mac OS X 10.3.9 (Darwin 7.9) bug.  */
+  if (sprintf (buf, "%.1a", 1.999) < 0
+      || (strcmp (buf, "0x1.0p+1") != 0
+          && strcmp (buf, "0x2.0p+0") != 0
+          && strcmp (buf, "0x4.0p-1") != 0
+          && strcmp (buf, "0x8.0p-2") != 0))
+    result |= 16;
+  /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
+     glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
+  if (sprintf (buf, "%.1La", 1.999L) < 0
+      || (strcmp (buf, "0x1.0p+1") != 0
+          && strcmp (buf, "0x2.0p+0") != 0
+          && strcmp (buf, "0x4.0p-1") != 0
+          && strcmp (buf, "0x8.0p-2") != 0))
+    result |= 32;
+  return result;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_langinfo_codeset=yes
-else
-  gl_cv_header_langinfo_codeset=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_directive_a=yes
+else $as_nop
+  gl_cv_func_printf_directive_a=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_codeset" >&5
-$as_echo "$gl_cv_header_langinfo_codeset" >&6; }
-    if test $gl_cv_header_langinfo_codeset = yes; then
-      HAVE_LANGINFO_CODESET=1
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines T_FMT_AMPM" >&5
-$as_echo_n "checking whether langinfo.h defines T_FMT_AMPM... " >&6; }
-if ${gl_cv_header_langinfo_t_fmt_ampm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <langinfo.h>
-int a = T_FMT_AMPM;
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_a" >&5
+printf "%s\n" "$gl_cv_func_printf_directive_a" >&6; }
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'F' directive" >&5
+printf %s "checking whether printf supports the 'F' directive... " >&6; }
+if test ${gl_cv_func_printf_directive_f+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+         case "$host_os" in
+                                 # Guess yes on glibc systems.
+           *-gnu* | gnu*)        gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on FreeBSD >= 6.
+           freebsd[1-5].*)       gl_cv_func_printf_directive_f="guessing no";;
+           freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
+           midnightbsd*)         gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on Mac OS X >= 10.3.
+           darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
+           darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on OpenBSD >= 6.0.
+           openbsd[1-5].*)       gl_cv_func_printf_directive_f="guessing no";;
+           openbsd*)             gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on Solaris >= 2.10.
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_directive_f="guessing yes";;
+           solaris*)             gl_cv_func_printf_directive_f="guessing no";;
+                                 # Guess no on Android.
+           linux*-android*)      gl_cv_func_printf_directive_f="guessing no";;
+                                 # Guess yes on MSVC, no on mingw.
+           mingw*)               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef _MSC_VER
+ Known
+#endif
+
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_langinfo_t_fmt_ampm=yes
-else
-  gl_cv_header_langinfo_t_fmt_ampm=no
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_func_printf_directive_f="guessing yes"
+else $as_nop
+  gl_cv_func_printf_directive_f="guessing no"
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -rf conftest*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_t_fmt_ampm" >&5
-$as_echo "$gl_cv_header_langinfo_t_fmt_ampm" >&6; }
-    if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
-      HAVE_LANGINFO_T_FMT_AMPM=1
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines ERA" >&5
-$as_echo_n "checking whether langinfo.h defines ERA... " >&6; }
-if ${gl_cv_header_langinfo_era+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+                                 ;;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_printf_directive_f="$gl_cross_guess_normal";;
+         esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <langinfo.h>
-int a = ERA;
 
-int
-main ()
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+static double zero = 0.0;
+int main ()
 {
-
-  ;
-  return 0;
+  int result = 0;
+  if (sprintf (buf, "%F %d", 1234567.0, 33, 44, 55) < 0
+      || strcmp (buf, "1234567.000000 33") != 0)
+    result |= 1;
+  if (sprintf (buf, "%F", 1.0 / zero) < 0
+      || (strcmp (buf, "INF") != 0 && strcmp (buf, "INFINITY") != 0))
+    result |= 2;
+  /* This catches a Cygwin 1.5.x bug.  */
+  if (sprintf (buf, "%.F", 1234.0) < 0
+      || strcmp (buf, "1234") != 0)
+    result |= 4;
+  return result;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_langinfo_era=yes
-else
-  gl_cv_header_langinfo_era=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_directive_f=yes
+else $as_nop
+  gl_cv_func_printf_directive_f=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_era" >&5
-$as_echo "$gl_cv_header_langinfo_era" >&6; }
-    if test $gl_cv_header_langinfo_era = yes; then
-      HAVE_LANGINFO_ERA=1
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether langinfo.h defines YESEXPR" >&5
-$as_echo_n "checking whether langinfo.h defines YESEXPR... " >&6; }
-if ${gl_cv_header_langinfo_yesexpr+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_f" >&5
+printf "%s\n" "$gl_cv_func_printf_directive_f" >&6; }
+
+
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'n' directive" >&5
+printf %s "checking whether printf supports the 'n' directive... " >&6; }
+if test ${gl_cv_func_printf_directive_n+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                            # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+           *-gnu* | gnu*)   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if _FORTIFY_SOURCE >= 2
+                                    error fail
+                                   #endif
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_printf_directive_n="guessing yes"
+else $as_nop
+  gl_cv_func_printf_directive_n="guessing no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+                            ;;
+                            # Guess no on Android.
+           linux*-android*) gl_cv_func_printf_directive_n="guessing no";;
+                            # Guess no on native Windows.
+           mingw*)          gl_cv_func_printf_directive_n="guessing no";;
+           *)               gl_cv_func_printf_directive_n="guessing yes";;
+         esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <langinfo.h>
-int a = YESEXPR;
 
-int
-main ()
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef _MSC_VER
+#include <inttypes.h>
+/* See page about "Parameter Validation" on msdn.microsoft.com.
+   <https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
+   <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler>  */
+static void cdecl
+invalid_parameter_handler (const wchar_t *expression,
+                           const wchar_t *function,
+                           const wchar_t *file, unsigned int line,
+                           uintptr_t dummy)
 {
-
-  ;
+  exit (1);
+}
+#endif
+static char fmtstring[10];
+static char buf[100];
+int main ()
+{
+  int count = -1;
+#ifdef _MSC_VER
+  _set_invalid_parameter_handler (invalid_parameter_handler);
+#endif
+  /* Copy the format string.  Some systems (glibc with _FORTIFY_SOURCE=2)
+     support %n in format strings in read-only memory but not in writable
+     memory.  */
+  strcpy (fmtstring, "%d %n");
+  if (sprintf (buf, fmtstring, 123, &count, 33, 44, 55) < 0
+      || strcmp (buf, "123 ") != 0
+      || count != 4)
+    return 1;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_langinfo_yesexpr=yes
-else
-  gl_cv_header_langinfo_yesexpr=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_directive_n=yes
+else $as_nop
+  gl_cv_func_printf_directive_n=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_langinfo_yesexpr" >&5
-$as_echo "$gl_cv_header_langinfo_yesexpr" >&6; }
-    if test $gl_cv_header_langinfo_yesexpr = yes; then
-      HAVE_LANGINFO_YESEXPR=1
-    fi
-  else
-    HAVE_LANGINFO_H=0
-  fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_n" >&5
+printf "%s\n" "$gl_cv_func_printf_directive_n" >&6; }
 
 
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports the 'ls' directive" >&5
+printf %s "checking whether printf supports the 'ls' directive... " >&6; }
+if test ${gl_cv_func_printf_directive_ls+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
 
+         case "$host_os" in
+                            # Guess yes on OpenBSD >= 6.0.
+           openbsd[1-5].*)  gl_cv_func_printf_directive_ls="guessing no";;
+           openbsd*)        gl_cv_func_printf_directive_ls="guessing yes";;
+           irix*)           gl_cv_func_printf_directive_ls="guessing no";;
+           solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
+           cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
+           beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
+                            # Guess no on Android.
+           linux*-android*) gl_cv_func_printf_directive_ls="guessing no";;
+                            # Guess yes on native Windows.
+           mingw*)          gl_cv_func_printf_directive_ls="guessing yes";;
+           *)               gl_cv_func_printf_directive_ls="guessing yes";;
+         esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <stdio.h>
+#include <wchar.h>
+#include <string.h>
+int main ()
+{
+  int result = 0;
+  char buf[100];
+  /* Test whether %ls works at all.
+     This test fails on OpenBSD 4.0, IRIX 6.5, Solaris 2.6, Haiku, but not on
+     Cygwin 1.5.  */
+  {
+    static const wchar_t wstring[] = { 'a', 'b', 'c', 0 };
+    buf[0] = '\0';
+    if (sprintf (buf, "%ls", wstring) < 0
+        || strcmp (buf, "abc") != 0)
+      result |= 1;
+  }
+  /* This test fails on IRIX 6.5, Solaris 2.6, Cygwin 1.5, Haiku (with an
+     assertion failure inside libc), but not on OpenBSD 4.0.  */
+  {
+    static const wchar_t wstring[] = { 'a', 0 };
+    buf[0] = '\0';
+    if (sprintf (buf, "%ls", wstring) < 0
+        || strcmp (buf, "a") != 0)
+      result |= 2;
+  }
+  /* Test whether precisions in %ls are supported as specified in ISO C 99
+     section 7.19.6.1:
+       "If a precision is specified, no more than that many bytes are written
+        (including shift sequences, if any), and the array shall contain a
+        null wide character if, to equal the multibyte character sequence
+        length given by the precision, the function would need to access a
+        wide character one past the end of the array."
+     This test fails on Solaris 10.  */
+  {
+    static const wchar_t wstring[] = { 'a', 'b', (wchar_t) 0xfdfdfdfd, 0 };
+    buf[0] = '\0';
+    if (sprintf (buf, "%.2ls", wstring) < 0
+        || strcmp (buf, "ab") != 0)
+      result |= 8;
+  }
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_directive_ls=yes
+else $as_nop
+  gl_cv_func_printf_directive_ls=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_directive_ls" >&5
+printf "%s\n" "$gl_cv_func_printf_directive_ls" >&6; }
 
 
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports the grouping flag" >&5
+printf %s "checking whether printf supports the grouping flag... " >&6; }
+if test ${gl_cv_func_printf_flag_grouping+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
 
+         case "$host_os" in
+           cygwin*)         gl_cv_func_printf_flag_grouping="guessing no";;
+           netbsd*)         gl_cv_func_printf_flag_grouping="guessing no";;
+                            # Guess no on Android.
+           linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";;
+                            # Guess no on native Windows.
+           mingw* | pw*)    gl_cv_func_printf_flag_grouping="guessing no";;
+           *)               gl_cv_func_printf_flag_grouping="guessing yes";;
+         esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+int main ()
+{
+  if (sprintf (buf, "%'d %d", 1234567, 99) < 0
+      || buf[strlen (buf) - 1] != '9')
+    return 1;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_flag_grouping=yes
+else $as_nop
+  gl_cv_func_printf_flag_grouping=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_grouping" >&5
+printf "%s\n" "$gl_cv_func_printf_flag_grouping" >&6; }
 
 
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports the left-adjust flag correctly" >&5
+printf %s "checking whether printf supports the left-adjust flag correctly... " >&6; }
+if test ${gl_cv_func_printf_flag_leftadjust+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
 
-    use_additional=yes
+         case "$host_os" in
+                            # Guess yes on HP-UX 11.
+           hpux11*)         gl_cv_func_printf_flag_leftadjust="guessing yes";;
+                            # Guess no on HP-UX 10 and older.
+           hpux*)           gl_cv_func_printf_flag_leftadjust="guessing no";;
+                            # Guess yes on Android.
+           linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+                            # Guess yes on native Windows.
+           mingw*)          gl_cv_func_printf_flag_leftadjust="guessing yes";;
+                            # Guess yes otherwise.
+           *)               gl_cv_func_printf_flag_leftadjust="guessing yes";;
+         esac
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-    eval additional_includedir=\"$includedir\"
-    eval additional_libdir=\"$libdir\"
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+int main ()
+{
+  /* Check that a '-' flag is not annihilated by a negative width.  */
+  if (sprintf (buf, "a%-*sc", -3, "b") < 0
+      || strcmp (buf, "ab  c") != 0)
+    return 1;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_flag_leftadjust=yes
+else $as_nop
+  gl_cv_func_printf_flag_leftadjust=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_leftadjust" >&5
+printf "%s\n" "$gl_cv_func_printf_flag_leftadjust" >&6; }
 
-# Check whether --with-libsigsegv-prefix was given.
-if test "${with_libsigsegv_prefix+set}" = set; then :
-  withval=$with_libsigsegv_prefix;
-    if test "X$withval" = "Xno"; then
-      use_additional=no
-    else
-      if test "X$withval" = "X"; then
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
 
-          eval additional_includedir=\"$includedir\"
-          eval additional_libdir=\"$libdir\"
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports the zero flag correctly" >&5
+printf %s "checking whether printf supports the zero flag correctly... " >&6; }
+if test ${gl_cv_func_printf_flag_zero+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
+      if test "$cross_compiling" = yes
+then :
 
-      else
-        additional_includedir="$withval/include"
-        additional_libdir="$withval/$acl_libdirstem"
-        if test "$acl_libdirstem2" != "$acl_libdirstem" \
-           && ! test -d "$withval/$acl_libdirstem"; then
-          additional_libdir="$withval/$acl_libdirstem2"
-        fi
-      fi
-    fi
+         case "$host_os" in
+                            # Guess yes on glibc systems.
+           *-gnu* | gnu*)   gl_cv_func_printf_flag_zero="guessing yes";;
+                            # Guess yes on musl systems.
+           *-musl*)         gl_cv_func_printf_flag_zero="guessing yes";;
+                            # Guess yes on BeOS.
+           beos*)           gl_cv_func_printf_flag_zero="guessing yes";;
+                            # Guess no on Android.
+           linux*-android*) gl_cv_func_printf_flag_zero="guessing no";;
+                            # Guess no on native Windows.
+           mingw*)          gl_cv_func_printf_flag_zero="guessing no";;
+                            # If we don't know, obey --enable-cross-guesses.
+           *)               gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <stdio.h>
+#include <string.h>
+static char buf[100];
+static double zero = 0.0;
+int main ()
+{
+  if (sprintf (buf, "%010f", 1.0 / zero, 33, 44, 55) < 0
+      || (strcmp (buf, "       inf") != 0
+          && strcmp (buf, "  infinity") != 0))
+    return 1;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_flag_zero=yes
+else $as_nop
+  gl_cv_func_printf_flag_zero=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-      LIBSIGSEGV=
-  LTLIBSIGSEGV=
-  INCSIGSEGV=
-  LIBSIGSEGV_PREFIX=
-      HAVE_LIBSIGSEGV=
-  rpathdirs=
-  ltrpathdirs=
-  names_already_handled=
-  names_next_round='sigsegv '
-  while test -n "$names_next_round"; do
-    names_this_round="$names_next_round"
-    names_next_round=
-    for name in $names_this_round; do
-      already_handled=
-      for n in $names_already_handled; do
-        if test "$n" = "$name"; then
-          already_handled=yes
-          break
-        fi
-      done
-      if test -z "$already_handled"; then
-        names_already_handled="$names_already_handled $name"
-                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
-        eval value=\"\$HAVE_LIB$uppername\"
-        if test -n "$value"; then
-          if test "$value" = yes; then
-            eval value=\"\$LIB$uppername\"
-            test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value"
-            eval value=\"\$LTLIB$uppername\"
-            test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value"
-          else
-                                    :
-          fi
-        else
-                              found_dir=
-          found_la=
-          found_so=
-          found_a=
-          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
-          if test -n "$acl_shlibext"; then
-            shrext=".$acl_shlibext"             # typically: shrext=.so
-          else
-            shrext=
-          fi
-          if test $use_additional = yes; then
-            dir="$additional_libdir"
-                                    if test -n "$acl_shlibext"; then
-              if test -f "$dir/$libname$shrext"; then
-                found_dir="$dir"
-                found_so="$dir/$libname$shrext"
-              else
-                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                  ver=`(cd "$dir" && \
-                        for f in "$libname$shrext".*; do echo "$f"; done \
-                        | sed -e "s,^$libname$shrext\\\\.,," \
-                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                        | sed 1q ) 2>/dev/null`
-                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                    found_dir="$dir"
-                    found_so="$dir/$libname$shrext.$ver"
-                  fi
-                else
-                  eval library_names=\"$acl_library_names_spec\"
-                  for f in $library_names; do
-                    if test -f "$dir/$f"; then
-                      found_dir="$dir"
-                      found_so="$dir/$f"
-                      break
-                    fi
-                  done
-                fi
-              fi
-            fi
-                        if test "X$found_dir" = "X"; then
-              if test -f "$dir/$libname.$acl_libext"; then
-                found_dir="$dir"
-                found_a="$dir/$libname.$acl_libext"
-              fi
-            fi
-            if test "X$found_dir" != "X"; then
-              if test -f "$dir/$libname.la"; then
-                found_la="$dir/$libname.la"
-              fi
-            fi
-          fi
-          if test "X$found_dir" = "X"; then
-            for x in $LDFLAGS $LTLIBSIGSEGV; do
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_flag_zero" >&5
+printf "%s\n" "$gl_cv_func_printf_flag_zero" >&6; }
 
-              case "$x" in
-                -L*)
-                  dir=`echo "X$x" | sed -e 's/^X-L//'`
-                                    if test -n "$acl_shlibext"; then
-                    if test -f "$dir/$libname$shrext"; then
-                      found_dir="$dir"
-                      found_so="$dir/$libname$shrext"
-                    else
-                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                        ver=`(cd "$dir" && \
-                              for f in "$libname$shrext".*; do echo "$f"; done \
-                              | sed -e "s,^$libname$shrext\\\\.,," \
-                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                              | sed 1q ) 2>/dev/null`
-                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                          found_dir="$dir"
-                          found_so="$dir/$libname$shrext.$ver"
-                        fi
-                      else
-                        eval library_names=\"$acl_library_names_spec\"
-                        for f in $library_names; do
-                          if test -f "$dir/$f"; then
-                            found_dir="$dir"
-                            found_so="$dir/$f"
-                            break
-                          fi
-                        done
-                      fi
-                    fi
-                  fi
-                                    if test "X$found_dir" = "X"; then
-                    if test -f "$dir/$libname.$acl_libext"; then
-                      found_dir="$dir"
-                      found_a="$dir/$libname.$acl_libext"
-                    fi
-                  fi
-                  if test "X$found_dir" != "X"; then
-                    if test -f "$dir/$libname.la"; then
-                      found_la="$dir/$libname.la"
-                    fi
-                  fi
-                  ;;
-              esac
-              if test "X$found_dir" != "X"; then
-                break
-              fi
-            done
-          fi
-          if test "X$found_dir" != "X"; then
-                        LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name"
-            if test "X$found_so" != "X"; then
-                                                        if test "$enable_rpath" = no \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
-                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
-              else
-                                                                                haveit=
-                for x in $ltrpathdirs; do
-                  if test "X$x" = "X$found_dir"; then
-                    haveit=yes
-                    break
-                  fi
-                done
-                if test -z "$haveit"; then
-                  ltrpathdirs="$ltrpathdirs $found_dir"
-                fi
-                                if test "$acl_hardcode_direct" = yes; then
-                                                      LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
-                else
-                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
-                                                            LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
-                                                            haveit=
-                    for x in $rpathdirs; do
-                      if test "X$x" = "X$found_dir"; then
-                        haveit=yes
-                        break
-                      fi
-                    done
-                    if test -z "$haveit"; then
-                      rpathdirs="$rpathdirs $found_dir"
-                    fi
-                  else
-                                                                                haveit=
-                    for x in $LDFLAGS $LIBSIGSEGV; do
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-                      if test "X$x" = "X-L$found_dir"; then
-                        haveit=yes
-                        break
-                      fi
-                    done
-                    if test -z "$haveit"; then
-                      LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir"
-                    fi
-                    if test "$acl_hardcode_minus_L" != no; then
-                                                                                        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
-                    else
-                                                                                                                                                                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name"
-                    fi
-                  fi
-                fi
-              fi
-            else
-              if test "X$found_a" != "X"; then
-                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a"
-              else
-                                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name"
-              fi
-            fi
-                        additional_includedir=
-            case "$found_dir" in
-              */$acl_libdirstem | */$acl_libdirstem/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
-                if test "$name" = 'sigsegv'; then
-                  LIBSIGSEGV_PREFIX="$basedir"
-                fi
-                additional_includedir="$basedir/include"
-                ;;
-              */$acl_libdirstem2 | */$acl_libdirstem2/)
-                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
-                if test "$name" = 'sigsegv'; then
-                  LIBSIGSEGV_PREFIX="$basedir"
-                fi
-                additional_includedir="$basedir/include"
-                ;;
-            esac
-            if test "X$additional_includedir" != "X"; then
-                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
-                haveit=
-                if test "X$additional_includedir" = "X/usr/local/include"; then
-                  if test -n "$GCC"; then
-                    case $host_os in
-                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
-                    esac
-                  fi
-                fi
-                if test -z "$haveit"; then
-                  for x in $CPPFLAGS $INCSIGSEGV; do
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports large precisions" >&5
+printf %s "checking whether printf supports large precisions... " >&6; }
+if test ${gl_cv_func_printf_precision+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
+      if test "$cross_compiling" = yes
+then :
 
-                    if test "X$x" = "X-I$additional_includedir"; then
-                      haveit=yes
-                      break
-                    fi
-                  done
-                  if test -z "$haveit"; then
-                    if test -d "$additional_includedir"; then
-                                            INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir"
-                    fi
-                  fi
-                fi
-              fi
-            fi
-                        if test -n "$found_la"; then
-                                                        save_libdir="$libdir"
-              case "$found_la" in
-                */* | *\\*) . "$found_la" ;;
-                *) . "./$found_la" ;;
-              esac
-              libdir="$save_libdir"
-                            for dep in $dependency_libs; do
-                case "$dep" in
-                  -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                                                                                                                                                                if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
-                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
-                      haveit=
-                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
-                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
-                        if test -n "$GCC"; then
-                          case $host_os in
-                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
-                          esac
-                        fi
-                      fi
-                      if test -z "$haveit"; then
-                        haveit=
-                        for x in $LDFLAGS $LIBSIGSEGV; do
+         case "$host_os" in
+           # Guess no only on Solaris, native Windows, and BeOS systems.
+           solaris*)        gl_cv_func_printf_precision="guessing no" ;;
+           mingw* | pw*)    gl_cv_func_printf_precision="guessing no" ;;
+           beos*)           gl_cv_func_printf_precision="guessing no" ;;
+                            # Guess yes on Android.
+           linux*-android*) gl_cv_func_printf_precision="guessing yes" ;;
+           *)               gl_cv_func_printf_precision="guessing yes" ;;
+         esac
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-                          if test "X$x" = "X-L$additional_libdir"; then
-                            haveit=yes
-                            break
-                          fi
-                        done
-                        if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$additional_libdir"
-                          fi
-                        fi
-                        haveit=
-                        for x in $LDFLAGS $LTLIBSIGSEGV; do
+#include <stdio.h>
+#include <string.h>
+static char buf[5000];
+int main ()
+{
+  int result = 0;
+#ifdef __BEOS__
+  /* On BeOS, this would crash and show a dialog box.  Avoid the crash.  */
+  return 1;
+#endif
+  if (sprintf (buf, "%.4000d %d", 1, 33, 44) < 4000 + 3)
+    result |= 1;
+  if (sprintf (buf, "%.4000f %d", 1.0, 33, 44) < 4000 + 5)
+    result |= 2;
+  if (sprintf (buf, "%.511f %d", 1.0, 33, 44) < 511 + 5
+      || buf[0] != '1')
+    result |= 4;
+  if (sprintf (buf, "%.999f %d", 1.0, 33, 44) < 999 + 5
+      || buf[0] != '1')
+    result |= 4;
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_precision=yes
+else $as_nop
+  gl_cv_func_printf_precision=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-                          if test "X$x" = "X-L$additional_libdir"; then
-                            haveit=yes
-                            break
-                          fi
-                        done
-                        if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                                                        LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$additional_libdir"
-                          fi
-                        fi
-                      fi
-                    fi
-                    ;;
-                  -R*)
-                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
-                    if test "$enable_rpath" != no; then
-                                                                  haveit=
-                      for x in $rpathdirs; do
-                        if test "X$x" = "X$dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        rpathdirs="$rpathdirs $dir"
-                      fi
-                                                                  haveit=
-                      for x in $ltrpathdirs; do
-                        if test "X$x" = "X$dir"; then
-                          haveit=yes
-                          break
-                        fi
-                      done
-                      if test -z "$haveit"; then
-                        ltrpathdirs="$ltrpathdirs $dir"
-                      fi
-                    fi
-                    ;;
-                  -l*)
-                                        names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
-                    ;;
-                  *.la)
-                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
-                    ;;
-                  *)
-                                        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep"
-                    LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep"
-                    ;;
-                esac
-              done
-            fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_precision" >&5
+printf "%s\n" "$gl_cv_func_printf_precision" >&6; }
+
+
+
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf survives out-of-memory conditions" >&5
+printf %s "checking whether printf survives out-of-memory conditions... " >&6; }
+if test ${gl_cv_func_printf_enomem+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      gl_cv_func_printf_enomem="guessing no"
+      if test "$cross_compiling" = no; then
+        if test $APPLE_UNIVERSAL_BUILD = 0; then
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+#include <stdlib.h>
+#if defined __MACH__ && defined __APPLE__
+/* Avoid a crash on Mac OS X.  */
+#include <mach/mach.h>
+#include <mach/mach_error.h>
+#include <mach/thread_status.h>
+#include <mach/exception.h>
+#include <mach/task.h>
+#include <pthread.h>
+/* The exception port on which our thread listens.  */
+static mach_port_t our_exception_port;
+/* The main function of the thread listening for exceptions of type
+   EXC_BAD_ACCESS.  */
+static void *
+mach_exception_thread (void *arg)
+{
+  /* Buffer for a message to be received.  */
+  struct {
+    mach_msg_header_t head;
+    mach_msg_body_t msgh_body;
+    char data[1024];
+  } msg;
+  mach_msg_return_t retval;
+  /* Wait for a message on the exception port.  */
+  retval = mach_msg (&msg.head, MACH_RCV_MSG | MACH_RCV_LARGE, 0, sizeof (msg),
+                     our_exception_port, MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
+  if (retval != MACH_MSG_SUCCESS)
+    abort ();
+  exit (1);
+}
+static void
+nocrash_init (void)
+{
+  mach_port_t self = mach_task_self ();
+  /* Allocate a port on which the thread shall listen for exceptions.  */
+  if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
+      == KERN_SUCCESS) {
+    /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
+    if (mach_port_insert_right (self, our_exception_port, our_exception_port,
+                                MACH_MSG_TYPE_MAKE_SEND)
+        == KERN_SUCCESS) {
+      /* The exceptions we want to catch.  Only EXC_BAD_ACCESS is interesting
+         for us.  */
+      exception_mask_t mask = EXC_MASK_BAD_ACCESS;
+      /* Create the thread listening on the exception port.  */
+      pthread_attr_t attr;
+      pthread_t thread;
+      if (pthread_attr_init (&attr) == 0
+          && pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED) == 0
+          && pthread_create (&thread, &attr, mach_exception_thread, NULL) == 0) {
+        pthread_attr_destroy (&attr);
+        /* Replace the exception port info for these exceptions with our own.
+           Note that we replace the exception port for the entire task, not only
+           for a particular thread.  This has the effect that when our exception
+           port gets the message, the thread specific exception port has already
+           been asked, and we don't need to bother about it.
+           See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
+        task_set_exception_ports (self, mask, our_exception_port,
+                                  EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
+      }
+    }
+  }
+}
+#elif defined _WIN32 && ! defined __CYGWIN__
+/* Avoid a crash on native Windows.  */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#include <winerror.h>
+static LONG WINAPI
+exception_filter (EXCEPTION_POINTERS *ExceptionInfo)
+{
+  switch (ExceptionInfo->ExceptionRecord->ExceptionCode)
+    {
+    case EXCEPTION_ACCESS_VIOLATION:
+    case EXCEPTION_IN_PAGE_ERROR:
+    case EXCEPTION_STACK_OVERFLOW:
+    case EXCEPTION_GUARD_PAGE:
+    case EXCEPTION_PRIV_INSTRUCTION:
+    case EXCEPTION_ILLEGAL_INSTRUCTION:
+    case EXCEPTION_DATATYPE_MISALIGNMENT:
+    case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+    case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+      exit (1);
+    }
+  return EXCEPTION_CONTINUE_SEARCH;
+}
+static void
+nocrash_init (void)
+{
+  SetUnhandledExceptionFilter ((LPTOP_LEVEL_EXCEPTION_FILTER) exception_filter);
+}
+#else
+/* Avoid a crash on POSIX systems.  */
+#include <signal.h>
+#include <unistd.h>
+/* A POSIX signal handler.  */
+static void
+exception_handler (int sig)
+{
+  _exit (1);
+}
+static void
+nocrash_init (void)
+{
+#ifdef SIGSEGV
+  signal (SIGSEGV, exception_handler);
+#endif
+#ifdef SIGBUS
+  signal (SIGBUS, exception_handler);
+#endif
+}
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <errno.h>
+int main()
+{
+  struct rlimit limit;
+  int ret;
+  nocrash_init ();
+  /* Some printf implementations allocate temporary space with malloc.  */
+  /* On BSD systems, malloc() is limited by RLIMIT_DATA.  */
+#ifdef RLIMIT_DATA
+  if (getrlimit (RLIMIT_DATA, &limit) < 0)
+    return 77;
+  if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
+    limit.rlim_max = 5000000;
+  limit.rlim_cur = limit.rlim_max;
+  if (setrlimit (RLIMIT_DATA, &limit) < 0)
+    return 77;
+#endif
+  /* On Linux systems, malloc() is limited by RLIMIT_AS.  */
+#ifdef RLIMIT_AS
+  if (getrlimit (RLIMIT_AS, &limit) < 0)
+    return 77;
+  if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
+    limit.rlim_max = 5000000;
+  limit.rlim_cur = limit.rlim_max;
+  if (setrlimit (RLIMIT_AS, &limit) < 0)
+    return 77;
+#endif
+  /* Some printf implementations allocate temporary space on the stack.  */
+#ifdef RLIMIT_STACK
+  if (getrlimit (RLIMIT_STACK, &limit) < 0)
+    return 77;
+  if (limit.rlim_max == RLIM_INFINITY || limit.rlim_max > 5000000)
+    limit.rlim_max = 5000000;
+  limit.rlim_cur = limit.rlim_max;
+  if (setrlimit (RLIMIT_STACK, &limit) < 0)
+    return 77;
+#endif
+  ret = printf ("%.5000000f", 1.0);
+  return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
+}
+
+_ACEOF
+          if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+            (./conftest 2>&5
+             result=$?
+             printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $result" >&5
+             if test $result != 0 && test $result != 77; then result=1; fi
+             exit $result
+            ) >/dev/null 2>/dev/null
+            case $? in
+              0) gl_cv_func_printf_enomem="yes" ;;
+              77) gl_cv_func_printf_enomem="guessing no" ;;
+              *) gl_cv_func_printf_enomem="no" ;;
+            esac
           else
-                                                            LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name"
-            LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name"
+            gl_cv_func_printf_enomem="guessing no"
           fi
+          rm -fr conftest*
+        else
+                                        gl_cv_func_printf_enomem="guessing no"
         fi
       fi
-    done
-  done
-  if test "X$rpathdirs" != "X"; then
-    if test -n "$acl_hardcode_libdir_separator"; then
-                        alldirs=
-      for found_dir in $rpathdirs; do
-        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
-      done
-            acl_save_libdir="$libdir"
-      libdir="$alldirs"
-      eval flag=\"$acl_hardcode_libdir_flag_spec\"
-      libdir="$acl_save_libdir"
-      LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag"
-    else
-            for found_dir in $rpathdirs; do
-        acl_save_libdir="$libdir"
-        libdir="$found_dir"
-        eval flag=\"$acl_hardcode_libdir_flag_spec\"
-        libdir="$acl_save_libdir"
-        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag"
-      done
-    fi
-  fi
-  if test "X$ltrpathdirs" != "X"; then
-            for found_dir in $ltrpathdirs; do
-      LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir"
-    done
-  fi
+      if test "$gl_cv_func_printf_enomem" = "guessing no"; then
+        case "$host_os" in
+                           # Guess yes on glibc systems.
+          *-gnu* | gnu*)   gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on Solaris.
+          solaris*)        gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on AIX.
+          aix*)            gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on HP-UX/hppa.
+          hpux*)           case "$host_cpu" in
+                             hppa*) gl_cv_func_printf_enomem="guessing yes";;
+                             *)     gl_cv_func_printf_enomem="guessing no";;
+                           esac
+                           ;;
+                           # Guess yes on IRIX.
+          irix*)           gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on OSF/1.
+          osf*)            gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on BeOS.
+          beos*)           gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on Haiku.
+          haiku*)          gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess no on Android.
+          linux*-android*) gl_cv_func_printf_enomem="guessing no";;
+                           # If we don't know, obey --enable-cross-guesses.
+          *)               gl_cv_func_printf_enomem="$gl_cross_guess_normal";;
+        esac
+      fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_enomem" >&5
+printf "%s\n" "$gl_cv_func_printf_enomem" >&6; }
 
 
 
+  case "$gl_cv_func_printf_long_double" in
+    *yes)
+      ;;
+    *)
 
+printf "%s\n" "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
 
+      ;;
+  esac
 
-        ac_save_CPPFLAGS="$CPPFLAGS"
 
-  for element in $INCSIGSEGV; do
-    haveit=
-    for x in $CPPFLAGS; do
 
-  acl_save_prefix="$prefix"
-  prefix="$acl_final_prefix"
-  acl_save_exec_prefix="$exec_prefix"
-  exec_prefix="$acl_final_exec_prefix"
-  eval x=\"$x\"
-  exec_prefix="$acl_save_exec_prefix"
-  prefix="$acl_save_prefix"
 
-      if test "X$x" = "X$element"; then
-        haveit=yes
-        break
-      fi
-    done
-    if test -z "$haveit"; then
-      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
-    fi
-  done
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5
-$as_echo_n "checking for libsigsegv... " >&6; }
-if ${ac_cv_libsigsegv+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    ac_save_LIBS="$LIBS"
-                                case " $LIBSIGSEGV" in
-      *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;;
-      *)       LIBS="$LIBSIGSEGV $LIBS" ;;
-    esac
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_wchar_h='<'wchar.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
+printf %s "checking absolute name of <wchar.h>... " >&6; }
+if test ${gl_cv_next_wchar_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_wchar_h = yes; then
+
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sigsegv.h>
-int
-main ()
-{
-sigsegv_deinstall_handler();
-  ;
-  return 0;
-}
+#include <wchar.h>
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_libsigsegv=yes
-else
-  ac_cv_libsigsegv='no, consider installing GNU libsigsegv'
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-    LIBS="$ac_save_LIBS"
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'wchar.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_wchar_h
+           gl_cv_next_wchar_h='"'$gl_header'"'
+          else
+               gl_cv_next_wchar_h='<'wchar.h'>'
+             fi
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5
-$as_echo "$ac_cv_libsigsegv" >&6; }
-  if test "$ac_cv_libsigsegv" = yes; then
-    HAVE_LIBSIGSEGV=yes
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
+printf "%s\n" "$gl_cv_next_wchar_h" >&6; }
+     fi
+     NEXT_WCHAR_H=$gl_cv_next_wchar_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='<'wchar.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_wchar_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
+
+
 
-$as_echo "#define HAVE_LIBSIGSEGV 1" >>confdefs.h
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5
-$as_echo_n "checking how to link with libsigsegv... " >&6; }
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5
-$as_echo "$LIBSIGSEGV" >&6; }
+  if test $ac_cv_header_wchar_h = yes; then
+    HAVE_WCHAR_H=1
   else
-    HAVE_LIBSIGSEGV=no
-            CPPFLAGS="$ac_save_CPPFLAGS"
-    LIBSIGSEGV=
-    LTLIBSIGSEGV=
-    LIBSIGSEGV_PREFIX=
+    HAVE_WCHAR_H=0
   fi
 
 
 
 
 
+  if test $gt_cv_c_wint_t = yes; then
+    HAVE_WINT_T=1
+  else
+    HAVE_WINT_T=0
+  fi
+
+
 
 
-    gl_cv_lib_sigsegv="$ac_cv_libsigsegv"
 
 
 
 
+  ac_fn_check_decl "$LINENO" "wcsdup" "ac_cv_have_decl_wcsdup" "
+      #include <wchar.h>
 
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_wcsdup" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_WCSDUP $ac_have_decl" >>confdefs.h
 
+  if test $ac_cv_have_decl_wcsdup = no; then
+    HAVE_DECL_WCSDUP=0
+  fi
 
 
 
 
-  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+  HAVE_STRUCT_SOCKADDR_STORAGE=1;
+  HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
 
+  HAVE_SA_FAMILY_T=1;
+  HAVE_ACCEPT4=1;
 
 
+   if test $ac_cv_header_sys_socket_h = no; then
+                         ac_fn_c_check_header_compile "$LINENO" "ws2tcpip.h" "ac_cv_header_ws2tcpip_h" "$ac_includes_default"
+if test "x$ac_cv_header_ws2tcpip_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_WS2TCPIP_H 1" >>confdefs.h
 
+fi
 
+   fi
 
 
 
 
-  case "$host_os" in
-    solaris*)
 
-$as_echo "#define _LCONV_C99 1" >>confdefs.h
+        case "$host_os" in
+    osf*)
+
+printf "%s\n" "#define _POSIX_PII_SOCKET 1" >>confdefs.h
 
       ;;
   esac
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h conforms to POSIX:2001" >&5
-$as_echo_n "checking whether locale.h conforms to POSIX:2001... " >&6; }
-if ${gl_cv_header_locale_h_posix2001+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> is self-contained" >&5
+printf %s "checking whether <sys/socket.h> is self-contained... " >&6; }
+if test ${gl_cv_header_sys_socket_h_selfcontained+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <locale.h>
-            int x = LC_MESSAGES;
-            int y = sizeof (((struct lconv *) 0)->decimal_point);
+#include <sys/socket.h>
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_locale_h_posix2001=yes
-else
-  gl_cv_header_locale_h_posix2001=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_sys_socket_h_selfcontained=yes
+else $as_nop
+  gl_cv_header_sys_socket_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_selfcontained" >&5
+printf "%s\n" "$gl_cv_header_sys_socket_h_selfcontained" >&6; }
+  if test $gl_cv_header_sys_socket_h_selfcontained = yes; then
+            ac_fn_c_check_func "$LINENO" "shutdown" "ac_cv_func_shutdown"
+if test "x$ac_cv_func_shutdown" = xyes
+then :
+  printf "%s\n" "#define HAVE_SHUTDOWN 1" >>confdefs.h
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_h_posix2001" >&5
-$as_echo "$gl_cv_header_locale_h_posix2001" >&6; }
 
+    if test $ac_cv_func_shutdown = yes; then
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/socket.h> defines the SHUT_* macros" >&5
+printf %s "checking whether <sys/socket.h> defines the SHUT_* macros... " >&6; }
+if test ${gl_cv_header_sys_socket_h_shut+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  if test $ac_cv_header_xlocale_h = yes; then
-    HAVE_XLOCALE_H=1
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether locale.h defines locale_t" >&5
-$as_echo_n "checking whether locale.h defines locale_t... " >&6; }
-if ${gl_cv_header_locale_has_locale_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <locale.h>
-              locale_t x;
+#include <sys/socket.h>
 int
-main ()
+main (void)
 {
-
+int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_locale_has_locale_t=yes
-else
-  gl_cv_header_locale_has_locale_t=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_sys_socket_h_shut=yes
+else $as_nop
+  gl_cv_header_sys_socket_h_shut=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_locale_has_locale_t" >&5
-$as_echo "$gl_cv_header_locale_has_locale_t" >&6; }
-    if test $gl_cv_header_locale_has_locale_t = yes; then
-      gl_cv_header_locale_h_needs_xlocale_h=no
-    else
-      gl_cv_header_locale_h_needs_xlocale_h=yes
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_socket_h_shut" >&5
+printf "%s\n" "$gl_cv_header_sys_socket_h_shut" >&6; }
+      if test $gl_cv_header_sys_socket_h_shut = no; then
+        SYS_SOCKET_H='sys/socket.h'
+      fi
     fi
-  else
-    HAVE_XLOCALE_H=0
-    gl_cv_header_locale_h_needs_xlocale_h=no
   fi
+  # We need to check for ws2tcpip.h now.
 
 
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct lconv is properly defined" >&5
-$as_echo_n "checking whether struct lconv is properly defined... " >&6; }
-if ${gl_cv_sys_struct_lconv_ok+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <locale.h>
-            struct lconv l;
-            int x = sizeof (l.decimal_point);
-            int y = sizeof (l.int_p_cs_precedes);
-int
-main ()
-{
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_sys_struct_lconv_ok=yes
-else
-  gl_cv_sys_struct_lconv_ok=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_lconv_ok" >&5
-$as_echo "$gl_cv_sys_struct_lconv_ok" >&6; }
-  if test $gl_cv_sys_struct_lconv_ok = no; then
-    REPLACE_STRUCT_LCONV=1
-  fi
 
 
 
@@ -25983,19 +29157,23 @@ $as_echo "$gl_cv_sys_struct_lconv_ok" >&6; }
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_locale_h='<'locale.h'>'
+       gl_cv_next_sys_socket_h='<'sys/socket.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <locale.h>" >&5
-$as_echo_n "checking absolute name of <locale.h>... " >&6; }
-if ${gl_cv_next_locale_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/socket.h>" >&5
+printf %s "checking absolute name of <sys/socket.h>... " >&6; }
+if test ${gl_cv_next_sys_socket_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_sys_socket_h = yes; then
+
 
 
 
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <locale.h>
+#include <sys/socket.h>
 _ACEOF
                 case "$host_os" in
     aix*) gl_absname_cpp="$ac_cpp -C" ;;
@@ -26011,7 +29189,7 @@ _ACEOF
       ;;
   esac
       gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'locale.h' \
+  gl_header_literal_regex=`echo 'sys/socket.h' \
                            | sed -e "$gl_make_literal_regex_sed"`
   gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
       s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
@@ -26020,333 +29198,499 @@ _ACEOF
       q
     }'
 
-        gl_cv_absolute_locale_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+        gl_cv_absolute_sys_socket_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
   sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_locale_h
-           gl_cv_next_locale_h='"'$gl_header'"'
+           gl_header=$gl_cv_absolute_sys_socket_h
+           gl_cv_next_sys_socket_h='"'$gl_header'"'
+          else
+               gl_cv_next_sys_socket_h='<'sys/socket.h'>'
+             fi
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_locale_h" >&5
-$as_echo "$gl_cv_next_locale_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_socket_h" >&5
+printf "%s\n" "$gl_cv_next_sys_socket_h" >&6; }
      fi
-     NEXT_LOCALE_H=$gl_cv_next_locale_h
+     NEXT_SYS_SOCKET_H=$gl_cv_next_sys_socket_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='<'locale.h'>'
+       gl_next_as_first_directive='<'sys/socket.h'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_locale_h
+       gl_next_as_first_directive=$gl_cv_next_sys_socket_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_LOCALE_H=$gl_next_as_first_directive
-
-
+     NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H=$gl_next_as_first_directive
 
 
 
 
+  if test $ac_cv_header_sys_socket_h = yes; then
+    HAVE_SYS_SOCKET_H=1
+  else
+    HAVE_SYS_SOCKET_H=0
+  fi
 
 
 
+  if test $ac_cv_header_sys_socket_h = yes; then
+    HAVE_WS2TCPIP_H=0
+  else
+    if test $ac_cv_header_ws2tcpip_h = yes; then
+      HAVE_WS2TCPIP_H=1
+    else
+      HAVE_WS2TCPIP_H=0
+    fi
+  fi
 
 
-  if test $REPLACE_STRUCT_LCONV = 1; then
-    REPLACE_LOCALECONV=1
-  fi
 
-  if test $REPLACE_LOCALECONV = 1; then
+  ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
 
+"
+if test "x$ac_cv_type_struct_sockaddr_storage" = xyes
+then :
 
+printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE 1" >>confdefs.h
 
 
+fi
+ac_fn_c_check_type "$LINENO" "sa_family_t" "ac_cv_type_sa_family_t" "
+  /* sys/types.h is not needed according to POSIX, but the
+     sys/socket.h in i386-unknown-freebsd4.10 and
+     powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
 
+"
+if test "x$ac_cv_type_sa_family_t" = xyes
+then :
 
+printf "%s\n" "#define HAVE_SA_FAMILY_T 1" >>confdefs.h
 
 
-  M4_LIBOBJS="$M4_LIBOBJS localeconv.$ac_objext"
+fi
 
+  if test $ac_cv_type_struct_sockaddr_storage = no; then
+    HAVE_STRUCT_SOCKADDR_STORAGE=0
+  fi
+  if test $ac_cv_type_sa_family_t = no; then
+    HAVE_SA_FAMILY_T=0
+  fi
+  if test $ac_cv_type_struct_sockaddr_storage != no; then
+    ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
+       #ifdef HAVE_SYS_SOCKET_H
+       #include <sys/socket.h>
+       #endif
+       #ifdef HAVE_WS2TCPIP_H
+       #include <ws2tcpip.h>
+       #endif
 
-  ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h>
 "
-if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes; then :
+if test "x$ac_cv_member_struct_sockaddr_storage_ss_family" = xyes
+then :
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1
-_ACEOF
+printf "%s\n" "#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1" >>confdefs.h
 
 
+else $as_nop
+  HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=0
 fi
 
+  fi
+  if test $HAVE_STRUCT_SOCKADDR_STORAGE = 0 || test $HAVE_SA_FAMILY_T = 0 \
+     || test $HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = 0; then
+    SYS_SOCKET_H='sys/socket.h'
+  fi
+
+
+
+
+  if test $ac_cv_header_sys_socket_h != yes; then
+                    ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h
+
+fi
 
   fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+  else
+    HAVE_WINSOCK2_H=0
+  fi
 
 
 
 
 
-          GNULIB_LOCALECONV=1
 
 
 
 
+  GL_M4_GNULIB_SOCKET=0
 
-$as_echo "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h
 
 
+  GL_M4_GNULIB_CONNECT=0
 
 
 
-  if test "$gl_threads_api" = posix; then
-    # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
-    # pthread_rwlock_* functions.
-    ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
-"
-if test "x$ac_cv_type_pthread_rwlock_t" = xyes; then :
+  GL_M4_GNULIB_ACCEPT=0
 
-$as_echo "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
 
-fi
 
-    # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  GL_M4_GNULIB_BIND=0
 
-      #include <pthread.h>
-int
-main ()
-{
 
-#if __FreeBSD__ == 4
-error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
-#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
-       && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
-error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
-#else
-int x = (int)PTHREAD_MUTEX_RECURSIVE;
-return !x;
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+  GL_M4_GNULIB_GETPEERNAME=0
 
-$as_echo "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
 
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-  fi
-  :
 
+  GL_M4_GNULIB_GETSOCKNAME=0
 
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_LOCK 1
-_ACEOF
 
+  GL_M4_GNULIB_GETSOCKOPT=0
 
 
 
+  GL_M4_GNULIB_LISTEN=0
 
 
 
+  GL_M4_GNULIB_RECV=0
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek detects pipes" >&5
-$as_echo_n "checking whether lseek detects pipes... " >&6; }
-if ${gl_cv_func_lseek_pipe+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  case "$host_os" in
-       mingw*)
-                                                               gl_cv_func_lseek_pipe=no
-         ;;
-       *)
-         if test $cross_compiling = no; then
-           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <sys/types.h> /* for off_t */
-#include <stdio.h> /* for SEEK_CUR */
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#else /* on Windows with MSVC */
-# include <io.h>
-#endif
 
-int
-main ()
-{
+  GL_M4_GNULIB_SEND=0
 
-  /* Exit with success only if stdin is seekable.  */
-  return lseek (0, (off_t)0, SEEK_CUR) < 0;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  if test -s conftest$ac_exeext \
-                 && ./conftest$ac_exeext < conftest.$ac_ext \
-                 && test 1 = "`echo hi \
-                   | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
-                gl_cv_func_lseek_pipe=yes
-              else
-                gl_cv_func_lseek_pipe=no
-              fi
 
-else
-  gl_cv_func_lseek_pipe=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
-         else
-           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  GL_M4_GNULIB_RECVFROM=0
 
-#if defined __BEOS__
-/* BeOS mistakenly return 0 when trying to seek on pipes.  */
-  Choke me.
-#endif
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_lseek_pipe=yes
-else
-  gl_cv_func_lseek_pipe=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-         fi
-         ;;
-     esac
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lseek_pipe" >&5
-$as_echo "$gl_cv_func_lseek_pipe" >&6; }
-  if test $gl_cv_func_lseek_pipe = no; then
-    REPLACE_LSEEK=1
 
-$as_echo "#define LSEEK_PIPE_BROKEN 1" >>confdefs.h
+  GL_M4_GNULIB_SENDTO=0
 
-  fi
 
 
-  if test $WINDOWS_64_BIT_OFF_T = 1; then
-    REPLACE_LSEEK=1
-  fi
+  GL_M4_GNULIB_SETSOCKOPT=0
 
-  if test $REPLACE_LSEEK = 1; then
 
 
+  GL_M4_GNULIB_SHUTDOWN=0
 
 
 
+  GL_M4_GNULIB_ACCEPT4=0
+
+
+
+
+    HAVE_DECL_INET_NTOP=1;
+  HAVE_DECL_INET_PTON=1;
+  REPLACE_INET_NTOP=0;
+  REPLACE_INET_PTON=0;
+
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS lseek.$ac_objext"
 
+
+  if test $ac_cv_header_arpa_inet_h = yes; then
+    HAVE_ARPA_INET_H=1
+  else
+    HAVE_ARPA_INET_H=0
   fi
 
 
 
 
 
-          GNULIB_LSEEK=1
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_LSEEK 1" >>confdefs.h
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <arpa/inet.h>" >&5
+printf %s "checking absolute name of <arpa/inet.h>... " >&6; }
+if test ${gl_cv_next_arpa_inet_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_arpa_inet_h = yes; then
 
 
 
 
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <arpa/inet.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'arpa/inet.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
-  if test $ac_cv_func_lstat = yes; then
+        gl_cv_absolute_arpa_inet_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
-    case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
-      *no)
-        REPLACE_LSTAT=1
-        ;;
-    esac
-  else
-    HAVE_LSTAT=0
-  fi
+           gl_header=$gl_cv_absolute_arpa_inet_h
+           gl_cv_next_arpa_inet_h='"'$gl_header'"'
+          else
+               gl_cv_next_arpa_inet_h='<'arpa/inet.h'>'
+             fi
 
-  if test $REPLACE_LSTAT = 1; then
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_arpa_inet_h" >&5
+printf "%s\n" "$gl_cv_next_arpa_inet_h" >&6; }
+     fi
+     NEXT_ARPA_INET_H=$gl_cv_next_arpa_inet_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='<'arpa/inet.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_arpa_inet_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H=$gl_next_as_first_directive
 
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS lstat.$ac_objext"
 
-    :
-  fi
 
 
+  if test $ac_cv_header_sys_socket_h = yes; then
+    HAVE_WS2TCPIP_H=0
+  else
+    if test $ac_cv_header_ws2tcpip_h = yes; then
+      HAVE_WS2TCPIP_H=1
+    else
+      HAVE_WS2TCPIP_H=0
+    fi
+  fi
 
 
 
-          GNULIB_LSTAT=1
 
 
 
 
+  GL_M4_GNULIB_INET_NTOP=0
 
-$as_echo "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
 
 
+  GL_M4_GNULIB_INET_PTON=0
 
 
 
 
 
 
-  if test $gl_cv_func_malloc_posix = yes; then
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library needed for semaphore functions" >&5
+printf %s "checking for library needed for semaphore functions... " >&6; }
+if test ${gl_cv_semaphore_lib+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  save_LIBS="$LIBS"
+     LIBS="$LIBS $LIBMULTITHREAD"
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <semaphore.h>
+int
+main (void)
+{
+sem_post ((sem_t *)0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_semaphore_lib=none
+else $as_nop
+  LIBS="$LIBS -lrt"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <semaphore.h>
+int
+main (void)
+{
+sem_post ((sem_t *)0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_semaphore_lib='-lrt'
+else $as_nop
+  gl_cv_semaphore_lib=none
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
-$as_echo "#define HAVE_MALLOC_POSIX 1" >>confdefs.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+     LIBS="$save_LIBS"
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_semaphore_lib" >&5
+printf "%s\n" "$gl_cv_semaphore_lib" >&6; }
+  if test "x$gl_cv_semaphore_lib" = xnone; then
+    LIB_SEMAPHORE=
   else
-    REPLACE_MALLOC=1
+    LIB_SEMAPHORE="$gl_cv_semaphore_lib"
   fi
 
-  if test $REPLACE_MALLOC = 1; then
 
 
+    HAVE_ISBLANK=1;
+
 
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS malloc.$ac_objext"
 
-  fi
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_ctype_h='<'ctype.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5
+printf %s "checking absolute name of <ctype.h>... " >&6; }
+if test ${gl_cv_next_ctype_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'ctype.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_ctype_h
+           gl_cv_next_ctype_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5
+printf "%s\n" "$gl_cv_next_ctype_h" >&6; }
+     fi
+     NEXT_CTYPE_H=$gl_cv_next_ctype_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='<'ctype.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_ctype_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive
+
 
 
 
 
 
-          GNULIB_MALLOC_POSIX=1
 
 
 
+  GL_M4_GNULIB_ISBLANK=0
 
 
-$as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
 
 
 
 
 
+    HAVE_GETTIMEOFDAY=1;
+  HAVE_STRUCT_TIMEVAL=1;
+  HAVE_SYS_TIME_H=1;
+  REPLACE_GETTIMEOFDAY=0;
+  REPLACE_STRUCT_TIMEVAL=0;
+
 
 
 
@@ -26361,22 +29705,23 @@ $as_echo "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_math_h='<'math.h'>'
+       gl_cv_next_sys_time_h='<'sys/time.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <math.h>" >&5
-$as_echo_n "checking absolute name of <math.h>... " >&6; }
-if ${gl_cv_next_math_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/time.h>" >&5
+printf %s "checking absolute name of <sys/time.h>... " >&6; }
+if test ${gl_cv_next_sys_time_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-             if test $ac_cv_header_math_h = yes; then
+             if test $ac_cv_header_sys_time_h = yes; then
 
 
 
 
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <math.h>
+#include <sys/time.h>
 _ACEOF
                 case "$host_os" in
     aix*) gl_absname_cpp="$ac_cpp -C" ;;
@@ -26392,7 +29737,7 @@ _ACEOF
       ;;
   esac
       gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'math.h' \
+  gl_header_literal_regex=`echo 'sys/time.h' \
                            | sed -e "$gl_make_literal_regex_sed"`
   gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
       s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
@@ -26401,99 +29746,141 @@ _ACEOF
       q
     }'
 
-        gl_cv_absolute_math_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+        gl_cv_absolute_sys_time_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
   sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_math_h
-           gl_cv_next_math_h='"'$gl_header'"'
+           gl_header=$gl_cv_absolute_sys_time_h
+           gl_cv_next_sys_time_h='"'$gl_header'"'
           else
-               gl_cv_next_math_h='<'math.h'>'
+               gl_cv_next_sys_time_h='<'sys/time.h'>'
              fi
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_math_h" >&5
-$as_echo "$gl_cv_next_math_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_time_h" >&5
+printf "%s\n" "$gl_cv_next_sys_time_h" >&6; }
      fi
-     NEXT_MATH_H=$gl_cv_next_math_h
+     NEXT_SYS_TIME_H=$gl_cv_next_sys_time_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='<'math.h'>'
+       gl_next_as_first_directive='<'sys/time.h'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_math_h
+       gl_next_as_first_directive=$gl_cv_next_sys_time_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_MATH_H=$gl_next_as_first_directive
+     NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H=$gl_next_as_first_directive
 
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NAN macro works" >&5
-$as_echo_n "checking whether NAN macro works... " >&6; }
-if ${gl_cv_header_math_nan_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  if test $ac_cv_header_sys_time_h != yes; then
+    HAVE_SYS_TIME_H=0
+  fi
+
+
+
+
+
+  if test $ac_cv_header_sys_socket_h != yes; then
+                    ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h
+
+fi
+
+  fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+  else
+    HAVE_WINSOCK2_H=0
+  fi
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for struct timeval" >&5
+printf %s "checking for struct timeval... " >&6; }
+if test ${gl_cv_sys_struct_timeval+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <math.h>
+#if HAVE_SYS_TIME_H
+             #include <sys/time.h>
+            #endif
+            #include <time.h>
+            #if HAVE_WINSOCK2_H
+            # include <winsock2.h>
+            #endif
+
 int
-main ()
+main (void)
 {
-/* Solaris 10 has a broken definition of NAN.  Other platforms
-        fail to provide NAN, or provide it only in C99 mode; this
-        test only needs to fail when NAN is provided but wrong.  */
-         float f = 1.0f;
-#ifdef NAN
-         f = NAN;
-#endif
-         return f == 0;
+static struct timeval x; x.tv_sec = x.tv_usec;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_math_nan_works=yes
-else
-  gl_cv_header_math_nan_works=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_sys_struct_timeval=yes
+else $as_nop
+  gl_cv_sys_struct_timeval=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_nan_works" >&5
-$as_echo "$gl_cv_header_math_nan_works" >&6; }
-  if test $gl_cv_header_math_nan_works = no; then
-    REPLACE_NAN=1
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether HUGE_VAL works" >&5
-$as_echo_n "checking whether HUGE_VAL works... " >&6; }
-if ${gl_cv_header_math_huge_val_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval" >&5
+printf "%s\n" "$gl_cv_sys_struct_timeval" >&6; }
+  if test $gl_cv_sys_struct_timeval != yes; then
+    HAVE_STRUCT_TIMEVAL=0
+  else
+                            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wide-enough struct timeval.tv_sec member" >&5
+printf %s "checking for wide-enough struct timeval.tv_sec member... " >&6; }
+if test ${gl_cv_sys_struct_timeval_tv_sec+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <math.h>
+#if HAVE_SYS_TIME_H
+               #include <sys/time.h>
+              #endif
+              #include <time.h>
+              #if HAVE_WINSOCK2_H
+              # include <winsock2.h>
+              #endif
+
 int
-main ()
+main (void)
 {
-/* Solaris 10 has a broken definition of HUGE_VAL.  */
-         double d = HUGE_VAL;
-         return d == 0;
+static struct timeval x;
+              typedef int verify_tv_sec_type[
+                sizeof (time_t) <= sizeof x.tv_sec ? 1 : -1
+              ];
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_math_huge_val_works=yes
-else
-  gl_cv_header_math_huge_val_works=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_sys_struct_timeval_tv_sec=yes
+else $as_nop
+  gl_cv_sys_struct_timeval_tv_sec=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_math_huge_val_works" >&5
-$as_echo "$gl_cv_header_math_huge_val_works" >&6; }
-  if test $gl_cv_header_math_huge_val_works = no; then
-    REPLACE_HUGE_VAL=1
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_struct_timeval_tv_sec" >&5
+printf "%s\n" "$gl_cv_sys_struct_timeval_tv_sec" >&6; }
+    if test $gl_cv_sys_struct_timeval_tv_sec != yes; then
+      REPLACE_STRUCT_TIMEVAL=1
+    fi
   fi
 
 
@@ -26501,680 +29888,602 @@ $as_echo "$gl_cv_header_math_huge_val_works" >&6; }
 
 
 
+  GL_M4_GNULIB_GETTIMEOFDAY=0
 
 
 
 
 
+  case "$host_os" in
+    *-musl*)
+printf "%s\n" "#define MUSL_LIBC 1" >>confdefs.h
+ ;;
+  esac
 
 
-  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
-$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
-if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                  case "$host_os" in
-                     # Guess no on AIX and OSF/1.
-        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-                     # Guess yes otherwise.
-        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
-      esac
-      if test $LOCALE_JA != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv4 sockets" >&5
+printf %s "checking for IPv4 sockets... " >&6; }
+if test ${gl_cv_socket_ipv4+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#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 ()
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+int
+main (void)
 {
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        if (mbsinit (&state))
-          return 2;
-    }
+int x = AF_INET; struct in_addr y; struct sockaddr_in z;
+ if (&x && &y && &z) return 0;
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_incomplete_state=yes
-else
-  gl_cv_func_mbrtowc_incomplete_state=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_socket_ipv4=yes
+else $as_nop
+  gl_cv_socket_ipv4=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv4" >&5
+printf "%s\n" "$gl_cv_socket_ipv4" >&6; }
+  if test $gl_cv_socket_ipv4 = yes; then
 
-      fi
+printf "%s\n" "#define HAVE_IPV4 1" >>confdefs.h
+
+  fi
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for IPv6 sockets" >&5
+printf %s "checking for IPv6 sockets... " >&6; }
+if test ${gl_cv_socket_ipv6+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif
+int
+main (void)
+{
+int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
+ if (&x && &y && &z) return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_socket_ipv6=yes
+else $as_nop
+  gl_cv_socket_ipv6=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
-$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socket_ipv6" >&5
+printf "%s\n" "$gl_cv_socket_ipv6" >&6; }
+  if test $gl_cv_socket_ipv6 = yes; then
 
+printf "%s\n" "#define HAVE_IPV6 1" >>confdefs.h
 
+  fi
 
+ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default"
+if test "x$ac_cv_type_off_t" = xyes
+then :
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
-$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
-if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+else $as_nop
 
-                  case "$host_os" in
-                    # Guess no on Solaris 8.
-        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
-                    # Guess yes otherwise.
-        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
-      esac
-      if test $LOCALE_ZH_CN != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+printf "%s\n" "#define off_t long int" >>confdefs.h
+
+fi
+
+
+
+
+  PRIPTR_PREFIX=
+  if test -n "$STDINT_H"; then
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* 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 ()
+         #ifdef _WIN64
+         LLP64
+         #endif
+
+int
+main (void)
 {
-  /* This fails on Solaris 8:
-     mbrtowc returns 2, and sets wc to 0x00F0.
-     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
-    {
-      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
 
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 3, 6, &state) != 4
-          && mbtowc (&wc, input + 3, 6) == 4)
-        return 2;
-    }
+  ;
   return 0;
 }
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_sanitycheck=yes
-else
-  gl_cv_func_mbrtowc_sanitycheck=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  PRIPTR_PREFIX='"l"'
+else $as_nop
+  PRIPTR_PREFIX='"ll"'
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+  else
+        for glpfx in '' l ll I64; do
+      case $glpfx in
+        '')  gltype1='int';;
+        l)   gltype1='long int';;
+        ll)  gltype1='long long int';;
+        I64) gltype1='__int64';;
+      esac
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdint.h>
+           extern intptr_t foo;
+           extern $gltype1 foo;
+int
+main (void)
+{
 
-      fi
-
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  PRIPTR_PREFIX='"'$glpfx'"'
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
-$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
-
-    REPLACE_MBSTATE_T=0
-    case "$gl_cv_func_mbrtowc_incomplete_state" in
-      *yes) ;;
-      *) REPLACE_MBSTATE_T=1 ;;
-    esac
-    case "$gl_cv_func_mbrtowc_sanitycheck" in
-      *yes) ;;
-      *) REPLACE_MBSTATE_T=1 ;;
-    esac
-  else
-    REPLACE_MBSTATE_T=1
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+      test -n "$PRIPTR_PREFIX" && break
+    done
   fi
 
 
 
-  if test $ac_cv_func_mbrtowc = no; then
-    HAVE_MBRTOWC=0
-    ac_fn_c_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
-/* 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>
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
+printf %s "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
+if test ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Work also in C++ mode.  */
+            #define __STDC_LIMIT_MACROS 1
 
-"
-if test "x$ac_cv_have_decl_mbrtowc" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+            /* Work if build is not clean.  */
+            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MBRTOWC $ac_have_decl
-_ACEOF
+            #include <limits.h>
+            #if HAVE_STDINT_H
+             #include <stdint.h>
+            #endif
 
-    if test $ac_cv_have_decl_mbrtowc = yes; then
-                        REPLACE_MBRTOWC=1
-    fi
-  else
-    if test $REPLACE_MBSTATE_T = 1; then
-      REPLACE_MBRTOWC=1
-    else
+            #if defined INT32_MAX && defined INTMAX_MAX
+             #define CONDITION (INT32_MAX < INTMAX_MAX)
+            #else
+             #define CONDITION (sizeof (int) < sizeof (long long int))
+            #endif
+            int test[CONDITION ? 1 : -1];
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
+else $as_nop
+  gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
+printf "%s\n" "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
+  if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
+    INT32_MAX_LT_INTMAX_MAX=1;
+  else
+    INT32_MAX_LT_INTMAX_MAX=0;
+  fi
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
-$as_echo_n "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
-if ${gl_cv_func_mbrtowc_null_arg1+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
-                  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
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
+printf %s "checking whether INT64_MAX == LONG_MAX... " >&6; }
+if test ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+/* Work also in C++ mode.  */
+            #define __STDC_LIMIT_MACROS 1
 
-#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;
+            /* Work if build is not clean.  */
+            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
 
-  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
-    {
-      char input[] = "\303\237er";
-      mbstate_t state;
-      wchar_t wc;
-      size_t ret;
+            #include <limits.h>
+            #if HAVE_STDINT_H
+             #include <stdint.h>
+            #endif
 
-      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;
+            #if defined INT64_MAX
+             #define CONDITION (INT64_MAX == LONG_MAX)
+            #else
+             #define CONDITION (sizeof (long long int) == sizeof (long int))
+            #endif
+            int test[CONDITION ? 1 : -1];
+int
+main (void)
+{
 
-      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;
+  ;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_null_arg1=yes
-else
-  gl_cv_func_mbrtowc_null_arg1=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
+else $as_nop
+  gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
 fi
-
-      fi
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
-$as_echo "$gl_cv_func_mbrtowc_null_arg1" >&6; }
-
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
+printf "%s\n" "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
+  if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
+    INT64_MAX_EQ_LONG_MAX=1;
+  else
+    INT64_MAX_EQ_LONG_MAX=0;
+  fi
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
-$as_echo_n "checking whether mbrtowc handles a NULL string argument... " >&6; }
-if ${gl_cv_func_mbrtowc_null_arg2+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  else
+    INT64_MAX_EQ_LONG_MAX=-1
+  fi
 
-                  case "$host_os" in
-              # Guess no on OSF/1.
-        osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
-              # Guess yes otherwise.
-        *)    gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
-      esac
-      if test $LOCALE_FR_UTF8 != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
+printf %s "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
+if test ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+/* Work also in C++ mode.  */
+            #define __STDC_LIMIT_MACROS 1
 
-#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 ()
+            /* Work if build is not clean.  */
+            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+
+            #include <limits.h>
+            #if HAVE_STDINT_H
+             #include <stdint.h>
+            #endif
+
+            #if defined UINT32_MAX && defined UINTMAX_MAX
+             #define CONDITION (UINT32_MAX < UINTMAX_MAX)
+            #else
+             #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
+            #endif
+            int test[CONDITION ? 1 : -1];
+int
+main (void)
 {
-  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
-    {
-      mbstate_t state;
-      wchar_t wc;
-      int ret;
 
-      memset (&state, '\0', sizeof (mbstate_t));
-      wc = (wchar_t) 0xBADFACE;
-      mbrtowc (&wc, NULL, 5, &state);
-      /* Check that wc was not modified.  */
-      if (wc != (wchar_t) 0xBADFACE)
-        return 2;
-    }
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_null_arg2=yes
-else
-  gl_cv_func_mbrtowc_null_arg2=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
+else $as_nop
+  gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
+printf "%s\n" "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
+  if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
+    UINT32_MAX_LT_UINTMAX_MAX=1;
+  else
+    UINT32_MAX_LT_UINTMAX_MAX=0;
+  fi
 
-      fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
-$as_echo "$gl_cv_func_mbrtowc_null_arg2" >&6; }
+  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
+printf %s "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
+if test ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Work also in C++ mode.  */
+            #define __STDC_LIMIT_MACROS 1
 
+            /* Work if build is not clean.  */
+            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
 
+            #include <limits.h>
+            #if HAVE_STDINT_H
+             #include <stdint.h>
+            #endif
 
+            #if defined UINT64_MAX
+             #define CONDITION (UINT64_MAX == ULONG_MAX)
+            #else
+             #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
+            #endif
+            int test[CONDITION ? 1 : -1];
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
+else $as_nop
+  gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
+printf "%s\n" "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
+  if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
+    UINT64_MAX_EQ_ULONG_MAX=1;
+  else
+    UINT64_MAX_EQ_ULONG_MAX=0;
+  fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
-$as_echo_n "checking whether mbrtowc has a correct return value... " >&6; }
-if ${gl_cv_func_mbrtowc_retval+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                  case "$host_os" in
-                                   # 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 \
-         || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  else
+    UINT64_MAX_EQ_ULONG_MAX=-1
+  fi
 
-#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)
-    {
-      char input[] = "B\303\274\303\237er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
 
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        {
-          input[1] = '\0';
-          if (mbrtowc (&wc, input + 2, 5, &state) != 1)
-            result |= 1;
-        }
-      found_some_locale = 1;
-    }
-  /* This fails on HP-UX 11.11.  */
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
 
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        {
-          input[1] = '\0';
-          if (mbrtowc (&wc, input + 2, 5, &state) != 2)
-            result |= 2;
-        }
-      found_some_locale = 1;
-    }
-  /* 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;
+  GL_M4_GNULIB_IOCTL=0
 
-      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
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_retval=yes
-else
-  if test $? != 77; then
-             gl_cv_func_mbrtowc_retval=no
-           fi
 
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-      fi
+    HAVE_PSELECT=1;
+  REPLACE_PSELECT=0;
+  REPLACE_SELECT=0;
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
-$as_echo "$gl_cv_func_mbrtowc_retval" >&6; }
 
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
-$as_echo_n "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
-if ${gl_cv_func_mbrtowc_nul_retval+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/select.h> is self-contained" >&5
+printf %s "checking whether <sys/select.h> is self-contained... " >&6; }
+if test ${gl_cv_header_sys_select_h_selfcontained+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-                  case "$host_os" in
-                       # Guess no on Solaris 8 and 9.
-        solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
-                       # Guess yes otherwise.
-        *)             gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
-      esac
-      if test $LOCALE_ZH_CN != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/select.h>
+int
+main (void)
+{
+struct timeval b;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_sys_select_h_selfcontained=yes
+else $as_nop
+  gl_cv_header_sys_select_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+                        if test $gl_cv_header_sys_select_h_selfcontained = yes; then
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <sys/select.h>
+int
+main (void)
+{
+int memset; int bzero;
+  ;
+  return 0;
+}
 
-#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 ()
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/select.h>
+int
+main (void)
 {
-  /* This fails on Solaris 8 and 9.  */
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
-    {
-      mbstate_t state;
-      wchar_t wc;
 
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, "", 1, &state) != 0)
-        return 2;
-    }
+                  #undef memset
+                  #define memset nonexistent_memset
+                  extern
+                  #ifdef __cplusplus
+                  "C"
+                  #endif
+                  void *memset (void *, int, unsigned long);
+                  #undef bzero
+                  #define bzero nonexistent_bzero
+                  extern
+                  #ifdef __cplusplus
+                  "C"
+                  #endif
+                  void bzero (void *, unsigned long);
+                  fd_set fds;
+                  FD_ZERO (&fds);
+
+  ;
   return 0;
 }
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_nul_retval=yes
-else
-  gl_cv_func_mbrtowc_nul_retval=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"
+then :
+
+else $as_nop
+  gl_cv_header_sys_select_h_selfcontained=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
       fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
-$as_echo "$gl_cv_func_mbrtowc_nul_retval" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_sys_select_h_selfcontained" >&5
+printf "%s\n" "$gl_cv_header_sys_select_h_selfcontained" >&6; }
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
-$as_echo_n "checking whether mbrtowc works on empty input... " >&6; }
-if ${gl_cv_func_mbrtowc_empty_input+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                  case "$host_os" in
-                     # Guess no on AIX and glibc systems.
-        aix* | *-gnu*)
-                    gl_cv_func_mbrtowc_empty_input="guessing no" ;;
-        *)          gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
-      esac
-      if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-           #include <wchar.h>
-           static wchar_t wc;
-           static mbstate_t mbs;
-           int
-           main (void)
-           {
-             return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
-           }
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_empty_input=yes
-else
-  gl_cv_func_mbrtowc_empty_input=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
-$as_echo "$gl_cv_func_mbrtowc_empty_input" >&6; }
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
-$as_echo_n "checking whether the C locale is free of encoding errors... " >&6; }
-if ${gl_cv_C_locale_sans_EILSEQ+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_select_h='<'sys/select.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/select.h>" >&5
+printf %s "checking absolute name of <sys/select.h>... " >&6; }
+if test ${gl_cv_next_sys_select_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_sys_select_h = yes; then
+
+
 
-               gl_cv_C_locale_sans_EILSEQ="guessing no"
 
-     if test "$cross_compiling" = yes; then :
-  :
-else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <limits.h>
-            #include <locale.h>
-            #include <wchar.h>
+#include <sys/select.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
-int
-main ()
-{
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'sys/select.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
-            int i;
-            char *locale = setlocale (LC_ALL, "C");
-            if (! locale)
-              return 2;
-            for (i = CHAR_MIN; i <= CHAR_MAX; i++)
-              {
-                char c = i;
-                wchar_t wc;
-                mbstate_t mbs = { 0, };
-                size_t ss = mbrtowc (&wc, &c, 1, &mbs);
-                if (1 < ss)
-                  return 3;
-              }
-            return 0;
+        gl_cv_absolute_sys_select_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_sys_select_h
+           gl_cv_next_sys_select_h='"'$gl_header'"'
+          else
+               gl_cv_next_sys_select_h='<'sys/select.h'>'
+             fi
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_C_locale_sans_EILSEQ=yes
-else
-  gl_cv_C_locale_sans_EILSEQ=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_C_locale_sans_EILSEQ" >&5
-$as_echo "$gl_cv_C_locale_sans_EILSEQ" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_select_h" >&5
+printf "%s\n" "$gl_cv_next_sys_select_h" >&6; }
+     fi
+     NEXT_SYS_SELECT_H=$gl_cv_next_sys_select_h
 
-      case "$gl_cv_func_mbrtowc_null_arg1" in
-        *yes) ;;
-        *)
-$as_echo "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.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='<'sys/select.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_select_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H=$gl_next_as_first_directive
 
-           REPLACE_MBRTOWC=1
-           ;;
-      esac
-      case "$gl_cv_func_mbrtowc_null_arg2" in
-        *yes) ;;
-        *)
-$as_echo "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
 
-           REPLACE_MBRTOWC=1
-           ;;
-      esac
-      case "$gl_cv_func_mbrtowc_retval" in
-        *yes) ;;
-        *)
-$as_echo "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
 
-           REPLACE_MBRTOWC=1
-           ;;
-      esac
-      case "$gl_cv_func_mbrtowc_nul_retval" in
-        *yes) ;;
-        *)
-$as_echo "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
 
-           REPLACE_MBRTOWC=1
-           ;;
-      esac
-      case "$gl_cv_func_mbrtowc_empty_input" in
-        *yes) ;;
-        *)
-$as_echo "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
+  if test $ac_cv_header_sys_select_h = yes; then
+    HAVE_SYS_SELECT_H=1
+  else
+    HAVE_SYS_SELECT_H=0
+  fi
 
-           REPLACE_MBRTOWC=1
-           ;;
-      esac
-      case $gl_cv_C_locale_sans_EILSEQ in
-        *yes) ;;
-        *)
-$as_echo "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
 
-           REPLACE_MBRTOWC=1
-           ;;
-      esac
-    fi
+
+
+
+  if test $ac_cv_header_sys_socket_h != yes; then
+                    ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h
+
+fi
+
+  fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+  else
+    HAVE_WINSOCK2_H=0
   fi
 
-  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
 
 
 
@@ -27183,222 +30492,494 @@ $as_echo "#define C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS mbrtowc.$ac_objext"
 
+  if test $ac_cv_header_sys_socket_h != yes; then
+                    ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h
 
-  :
+fi
 
   fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+  else
+    HAVE_WINSOCK2_H=0
+  fi
 
+   LIBSOCKET=
+  if test $HAVE_WINSOCK2_H = 1; then
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for WSAStartup" >&5
+printf %s "checking for WSAStartup... " >&6; }
+if test ${gl_cv_func_wsastartup+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+       gl_save_LIBS="$LIBS"
+       LIBS="$LIBS -lws2_32"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif
+int
+main (void)
+{
 
+            WORD wVersionRequested = MAKEWORD(1, 1);
+            WSADATA wsaData;
+            int err = WSAStartup(wVersionRequested, &wsaData);
+            WSACleanup ();
 
-          GNULIB_MBRTOWC=1
+  ;
+  return 0;
+}
 
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_wsastartup=yes
+else $as_nop
+  gl_cv_func_wsastartup=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+       LIBS="$gl_save_LIBS"
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wsastartup" >&5
+printf "%s\n" "$gl_cv_func_wsastartup" >&6; }
+    if test "$gl_cv_func_wsastartup" = "yes"; then
 
+printf "%s\n" "#define WINDOWS_SOCKETS 1" >>confdefs.h
 
+      LIBSOCKET='-lws2_32'
+    fi
+  else
+                                    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5
+printf %s "checking for library containing setsockopt... " >&6; }
+if test ${gl_cv_lib_socket+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      gl_cv_lib_socket=
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main (void)
+{
+setsockopt();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
 
-$as_echo "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
+else $as_nop
+  gl_save_LIBS="$LIBS"
+         LIBS="$gl_save_LIBS -lsocket"
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main (void)
+{
+setsockopt();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_lib_socket="-lsocket"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+         if test -z "$gl_cv_lib_socket"; then
+           LIBS="$gl_save_LIBS -lnetwork"
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main (void)
+{
+setsockopt();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_lib_socket="-lnetwork"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+           if test -z "$gl_cv_lib_socket"; then
+             LIBS="$gl_save_LIBS -lnet"
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();
+int
+main (void)
+{
+setsockopt();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_lib_socket="-lnet"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+           fi
+         fi
+         LIBS="$gl_save_LIBS"
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+      if test -z "$gl_cv_lib_socket"; then
+        gl_cv_lib_socket="none needed"
+      fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_socket" >&5
+printf "%s\n" "$gl_cv_lib_socket" >&6; }
+    if test "$gl_cv_lib_socket" != "none needed"; then
+      LIBSOCKET="$gl_cv_lib_socket"
+    fi
+  fi
 
 
 
 
 
 
+  :
 
 
 
 
 
 
-  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    REPLACE_SELECT=1
+  else
 
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5
+printf %s "checking whether select supports a 0 argument... " >&6; }
+if test ${gl_cv_func_select_supports0+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+        if test "$cross_compiling" = yes
+then :
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
-$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
-if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+           case "$host_os" in
+                       # Guess no on Interix.
+             interix*) gl_cv_func_select_supports0="guessing no";;
+                       # Guess yes otherwise.
+             *)        gl_cv_func_select_supports0="guessing yes";;
+           esac
 
-                  case "$host_os" in
-                     # Guess no on AIX and OSF/1.
-        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-                     # Guess yes otherwise.
-        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
-      esac
-      if test $LOCALE_JA != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#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>
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
 int main ()
 {
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        if (mbsinit (&state))
-          return 2;
-    }
-  return 0;
+  struct timeval timeout;
+  timeout.tv_sec = 0;
+  timeout.tv_usec = 5;
+  return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_incomplete_state=yes
-else
-  gl_cv_func_mbrtowc_incomplete_state=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_select_supports0=yes
+else $as_nop
+  gl_cv_func_select_supports0=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
-$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5
+printf "%s\n" "$gl_cv_func_select_supports0" >&6; }
+    case "$gl_cv_func_select_supports0" in
+      *yes) ;;
+      *) REPLACE_SELECT=1 ;;
+    esac
 
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5
+printf %s "checking whether select detects invalid fds... " >&6; }
+if test ${gl_cv_func_select_detects_ebadf+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+        if test "$cross_compiling" = yes
+then :
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
-$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
-if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+           case "$host_os" in
+                             # Guess yes on Linux systems.
+            linux-* | linux) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+                             # Guess yes on glibc systems.
+            *-gnu* | gnu*)   gl_cv_func_select_detects_ebadf="guessing yes" ;;
+                             # If we don't know, obey --enable-cross-guesses.
+            *)               gl_cv_func_select_detects_ebadf="$gl_cross_guess_normal" ;;
+           esac
 
-                  case "$host_os" in
-                    # Guess no on Solaris 8.
-        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
-                    # Guess yes otherwise.
-        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
-      esac
-      if test $LOCALE_ZH_CN != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* 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 ()
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#include <unistd.h>
+#include <errno.h>
+
+
+$gl_mda_defines
+
+int
+main (void)
 {
-  /* This fails on Solaris 8:
-     mbrtowc returns 2, and sets wc to 0x00F0.
-     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
-    {
-      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
 
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 3, 6, &state) != 4
-          && mbtowc (&wc, input + 3, 6) == 4)
-        return 2;
-    }
+  fd_set set;
+  dup2(0, 16);
+  FD_ZERO(&set);
+  FD_SET(16, &set);
+  close(16);
+  struct timeval timeout;
+  timeout.tv_sec = 0;
+  timeout.tv_usec = 5;
+  return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF;
+
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_sanitycheck=yes
-else
-  gl_cv_func_mbrtowc_sanitycheck=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_select_detects_ebadf=yes
+else $as_nop
+  gl_cv_func_select_detects_ebadf=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
-$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
-
-    REPLACE_MBSTATE_T=0
-    case "$gl_cv_func_mbrtowc_incomplete_state" in
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5
+printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; }
+    case $gl_cv_func_select_detects_ebadf in
       *yes) ;;
-      *) REPLACE_MBSTATE_T=1 ;;
+      *) REPLACE_SELECT=1 ;;
     esac
-    case "$gl_cv_func_mbrtowc_sanitycheck" in
-      *yes) ;;
-      *) REPLACE_MBSTATE_T=1 ;;
+  fi
+
+    LIB_SELECT="$LIBSOCKET"
+  if test $REPLACE_SELECT = 1; then
+    case "$host_os" in
+      mingw*)
+                                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+int
+main ()
+{
+  MsgWaitForMultipleObjects (0, NULL, 0, 0, 0);
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+
+else $as_nop
+  LIB_SELECT="$LIB_SELECT -luser32"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+        ;;
     esac
-  else
-    REPLACE_MBSTATE_T=1
   fi
 
 
 
-  if test $ac_cv_func_mbsinit = no; then
-    HAVE_MBSINIT=0
-    ac_fn_c_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
-/* 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 test "x$ac_cv_have_decl_mbsinit" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_MBSINIT $ac_have_decl
-_ACEOF
 
-    if test $ac_cv_have_decl_mbsinit = yes; then
-                        REPLACE_MBSINIT=1
-    fi
-  else
-    if test $REPLACE_MBSTATE_T = 1; then
-      REPLACE_MBSINIT=1
+
+
+
+  if test $ac_cv_have_decl_strerror_r = no; then
+    HAVE_DECL_STRERROR_R=0
+  fi
+
+  if test $ac_cv_func_strerror_r = yes; then
+    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+      if test $gl_cv_func_strerror_r_posix_signature = yes; then
+        case "$gl_cv_func_strerror_r_works" in
+                    *no) REPLACE_STRERROR_R=1 ;;
+        esac
+      else
+                REPLACE_STRERROR_R=1
+      fi
     else
-                        case "$host_os" in
-        mingw*) REPLACE_MBSINIT=1 ;;
-      esac
+                  REPLACE_STRERROR_R=1
     fi
   fi
 
-  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
 
+    HAVE_PTHREAD_T=1;
+  HAVE_PTHREAD_SPINLOCK_T=1;
+  HAVE_PTHREAD_CREATE_DETACHED=1;
+  HAVE_PTHREAD_MUTEX_RECURSIVE=1;
+  HAVE_PTHREAD_MUTEX_ROBUST=1;
+  HAVE_PTHREAD_PROCESS_SHARED=1;
+  HAVE_PTHREAD_CREATE=1;
+  HAVE_PTHREAD_ATTR_INIT=1;
+  HAVE_PTHREAD_ATTR_GETDETACHSTATE=1;
+  HAVE_PTHREAD_ATTR_SETDETACHSTATE=1;
+  HAVE_PTHREAD_ATTR_DESTROY=1;
+  HAVE_PTHREAD_SELF=1;
+  HAVE_PTHREAD_EQUAL=1;
+  HAVE_PTHREAD_DETACH=1;
+  HAVE_PTHREAD_JOIN=1;
+  HAVE_PTHREAD_EXIT=1;
+  HAVE_PTHREAD_ONCE=1;
+  HAVE_PTHREAD_MUTEX_INIT=1;
+  HAVE_PTHREAD_MUTEXATTR_INIT=1;
+  HAVE_PTHREAD_MUTEXATTR_GETTYPE=1;
+  HAVE_PTHREAD_MUTEXATTR_SETTYPE=1;
+  HAVE_PTHREAD_MUTEXATTR_GETROBUST=1;
+  HAVE_PTHREAD_MUTEXATTR_SETROBUST=1;
+  HAVE_PTHREAD_MUTEXATTR_DESTROY=1;
+  HAVE_PTHREAD_MUTEX_LOCK=1;
+  HAVE_PTHREAD_MUTEX_TRYLOCK=1;
+  HAVE_PTHREAD_MUTEX_TIMEDLOCK=1;
+  HAVE_PTHREAD_MUTEX_UNLOCK=1;
+  HAVE_PTHREAD_MUTEX_DESTROY=1;
+  HAVE_PTHREAD_RWLOCK_INIT=1;
+  HAVE_PTHREAD_RWLOCKATTR_INIT=1;
+  HAVE_PTHREAD_RWLOCKATTR_DESTROY=1;
+  HAVE_PTHREAD_RWLOCK_RDLOCK=1;
+  HAVE_PTHREAD_RWLOCK_WRLOCK=1;
+  HAVE_PTHREAD_RWLOCK_TRYRDLOCK=1;
+  HAVE_PTHREAD_RWLOCK_TRYWRLOCK=1;
+  HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK=1;
+  HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK=1;
+  HAVE_PTHREAD_RWLOCK_UNLOCK=1;
+  HAVE_PTHREAD_RWLOCK_DESTROY=1;
+  HAVE_PTHREAD_COND_INIT=1;
+  HAVE_PTHREAD_CONDATTR_INIT=1;
+  HAVE_PTHREAD_CONDATTR_DESTROY=1;
+  HAVE_PTHREAD_COND_WAIT=1;
+  HAVE_PTHREAD_COND_TIMEDWAIT=1;
+  HAVE_PTHREAD_COND_SIGNAL=1;
+  HAVE_PTHREAD_COND_BROADCAST=1;
+  HAVE_PTHREAD_COND_DESTROY=1;
+  HAVE_PTHREAD_KEY_CREATE=1;
+  HAVE_PTHREAD_SETSPECIFIC=1;
+  HAVE_PTHREAD_GETSPECIFIC=1;
+  HAVE_PTHREAD_KEY_DELETE=1;
+  HAVE_PTHREAD_SPIN_INIT=1;
+  HAVE_PTHREAD_SPIN_LOCK=1;
+  HAVE_PTHREAD_SPIN_TRYLOCK=1;
+  HAVE_PTHREAD_SPIN_UNLOCK=1;
+  HAVE_PTHREAD_SPIN_DESTROY=1;
+  REPLACE_PTHREAD_CREATE=0;
+  REPLACE_PTHREAD_ATTR_INIT=0;
+  REPLACE_PTHREAD_ATTR_GETDETACHSTATE=0;
+  REPLACE_PTHREAD_ATTR_SETDETACHSTATE=0;
+  REPLACE_PTHREAD_ATTR_DESTROY=0;
+  REPLACE_PTHREAD_SELF=0;
+  REPLACE_PTHREAD_EQUAL=0;
+  REPLACE_PTHREAD_DETACH=0;
+  REPLACE_PTHREAD_JOIN=0;
+  REPLACE_PTHREAD_EXIT=0;
+  REPLACE_PTHREAD_ONCE=0;
+  REPLACE_PTHREAD_MUTEX_INIT=0;
+  REPLACE_PTHREAD_MUTEXATTR_INIT=0;
+  REPLACE_PTHREAD_MUTEXATTR_GETTYPE=0;
+  REPLACE_PTHREAD_MUTEXATTR_SETTYPE=0;
+  REPLACE_PTHREAD_MUTEXATTR_GETROBUST=0;
+  REPLACE_PTHREAD_MUTEXATTR_SETROBUST=0;
+  REPLACE_PTHREAD_MUTEXATTR_DESTROY=0;
+  REPLACE_PTHREAD_MUTEX_LOCK=0;
+  REPLACE_PTHREAD_MUTEX_TRYLOCK=0;
+  REPLACE_PTHREAD_MUTEX_TIMEDLOCK=0;
+  REPLACE_PTHREAD_MUTEX_UNLOCK=0;
+  REPLACE_PTHREAD_MUTEX_DESTROY=0;
+  REPLACE_PTHREAD_RWLOCK_INIT=0;
+  REPLACE_PTHREAD_RWLOCKATTR_INIT=0;
+  REPLACE_PTHREAD_RWLOCKATTR_DESTROY=0;
+  REPLACE_PTHREAD_RWLOCK_RDLOCK=0;
+  REPLACE_PTHREAD_RWLOCK_WRLOCK=0;
+  REPLACE_PTHREAD_RWLOCK_TRYRDLOCK=0;
+  REPLACE_PTHREAD_RWLOCK_TRYWRLOCK=0;
+  REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK=0;
+  REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK=0;
+  REPLACE_PTHREAD_RWLOCK_UNLOCK=0;
+  REPLACE_PTHREAD_RWLOCK_DESTROY=0;
+  REPLACE_PTHREAD_COND_INIT=0;
+  REPLACE_PTHREAD_CONDATTR_INIT=0;
+  REPLACE_PTHREAD_CONDATTR_DESTROY=0;
+  REPLACE_PTHREAD_COND_WAIT=0;
+  REPLACE_PTHREAD_COND_TIMEDWAIT=0;
+  REPLACE_PTHREAD_COND_SIGNAL=0;
+  REPLACE_PTHREAD_COND_BROADCAST=0;
+  REPLACE_PTHREAD_COND_DESTROY=0;
+  REPLACE_PTHREAD_KEY_CREATE=0;
+  REPLACE_PTHREAD_SETSPECIFIC=0;
+  REPLACE_PTHREAD_GETSPECIFIC=0;
+  REPLACE_PTHREAD_KEY_DELETE=0;
+  REPLACE_PTHREAD_SPIN_INIT=0;
+  REPLACE_PTHREAD_SPIN_LOCK=0;
+  REPLACE_PTHREAD_SPIN_TRYLOCK=0;
+  REPLACE_PTHREAD_SPIN_UNLOCK=0;
+  REPLACE_PTHREAD_SPIN_DESTROY=0;
 
 
 
@@ -27406,152 +30987,355 @@ _ACEOF
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS mbsinit.$ac_objext"
 
 
-  :
 
-  fi
 
 
 
 
 
-          GNULIB_MBSINIT=1
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_pthread_h='<'pthread.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <pthread.h>" >&5
+printf %s "checking absolute name of <pthread.h>... " >&6; }
+if test ${gl_cv_next_pthread_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_pthread_h = yes; then
+
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'pthread.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_pthread_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_pthread_h
+           gl_cv_next_pthread_h='"'$gl_header'"'
+          else
+               gl_cv_next_pthread_h='<'pthread.h'>'
+             fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_pthread_h" >&5
+printf "%s\n" "$gl_cv_next_pthread_h" >&6; }
+     fi
+     NEXT_PTHREAD_H=$gl_cv_next_pthread_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='<'pthread.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_pthread_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H=$gl_next_as_first_directive
 
-$as_echo "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
 
 
 
+  if test $ac_cv_header_pthread_h = yes; then
+    HAVE_PTHREAD_H=1
 
 
+      if { case "$host_os" in mingw*) true;; *) false;; esac; } \
+         && test $gl_threads_api = windows; then
+        HAVE_PTHREAD_H=0
+      fi
 
-  if false; then
-    REPLACE_MBTOWC=1
+  else
+    HAVE_PTHREAD_H=0
   fi
 
-  if test $REPLACE_MBTOWC = 1; then
 
+  ac_fn_c_check_type "$LINENO" "pthread_t" "ac_cv_type_pthread_t" "$ac_includes_default
+     #if HAVE_PTHREAD_H
+      #include <pthread.h>
+     #endif
+"
+if test "x$ac_cv_type_pthread_t" = xyes
+then :
+
+printf "%s\n" "#define HAVE_PTHREAD_T 1" >>confdefs.h
 
 
+fi
+ac_fn_c_check_type "$LINENO" "pthread_spinlock_t" "ac_cv_type_pthread_spinlock_t" "$ac_includes_default
+     #if HAVE_PTHREAD_H
+      #include <pthread.h>
+     #endif
+"
+if test "x$ac_cv_type_pthread_spinlock_t" = xyes
+then :
+
+printf "%s\n" "#define HAVE_PTHREAD_SPINLOCK_T 1" >>confdefs.h
 
 
+fi
 
+  if test $ac_cv_type_pthread_t != yes; then
+    HAVE_PTHREAD_T=0
+  fi
+  if test $ac_cv_type_pthread_spinlock_t != yes; then
+    HAVE_PTHREAD_SPINLOCK_T=0
+  fi
 
 
-  M4_LIBOBJS="$M4_LIBOBJS mbtowc.$ac_objext"
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_CREATE_DETACHED" >&5
+printf %s "checking for PTHREAD_CREATE_DETACHED... " >&6; }
+if test ${gl_cv_const_PTHREAD_CREATE_DETACHED+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+            int x = PTHREAD_CREATE_DETACHED;
 
+int
+main (void)
+{
 
-  :
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_const_PTHREAD_CREATE_DETACHED=yes
+else $as_nop
+  gl_cv_const_PTHREAD_CREATE_DETACHED=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_const_PTHREAD_CREATE_DETACHED" >&5
+printf "%s\n" "$gl_cv_const_PTHREAD_CREATE_DETACHED" >&6; }
+  if test $gl_cv_const_PTHREAD_CREATE_DETACHED != yes; then
+    HAVE_PTHREAD_CREATE_DETACHED=0
   fi
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_MUTEX_RECURSIVE" >&5
+printf %s "checking for PTHREAD_MUTEX_RECURSIVE... " >&6; }
+if test ${gl_cv_const_PTHREAD_MUTEX_RECURSIVE+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+            int x = PTHREAD_MUTEX_RECURSIVE;
 
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_const_PTHREAD_MUTEX_RECURSIVE=yes
+else $as_nop
+  gl_cv_const_PTHREAD_MUTEX_RECURSIVE=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_const_PTHREAD_MUTEX_RECURSIVE" >&5
+printf "%s\n" "$gl_cv_const_PTHREAD_MUTEX_RECURSIVE" >&6; }
+  if test $gl_cv_const_PTHREAD_MUTEX_RECURSIVE != yes; then
+    HAVE_PTHREAD_MUTEX_RECURSIVE=0
+  fi
 
-          GNULIB_MBTOWC=1
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_MUTEX_ROBUST" >&5
+printf %s "checking for PTHREAD_MUTEX_ROBUST... " >&6; }
+if test ${gl_cv_const_PTHREAD_MUTEX_ROBUST+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+            int x = PTHREAD_MUTEX_ROBUST;
 
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_const_PTHREAD_MUTEX_ROBUST=yes
+else $as_nop
+  gl_cv_const_PTHREAD_MUTEX_ROBUST=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_const_PTHREAD_MUTEX_ROBUST" >&5
+printf "%s\n" "$gl_cv_const_PTHREAD_MUTEX_ROBUST" >&6; }
+  if test $gl_cv_const_PTHREAD_MUTEX_ROBUST != yes; then
+    HAVE_PTHREAD_MUTEX_ROBUST=0
+  fi
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for PTHREAD_PROCESS_SHARED" >&5
+printf %s "checking for PTHREAD_PROCESS_SHARED... " >&6; }
+if test ${gl_cv_const_PTHREAD_PROCESS_SHARED+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+            int x = PTHREAD_PROCESS_SHARED;
 
-$as_echo "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_const_PTHREAD_PROCESS_SHARED=yes
+else $as_nop
+  gl_cv_const_PTHREAD_PROCESS_SHARED=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_const_PTHREAD_PROCESS_SHARED" >&5
+printf "%s\n" "$gl_cv_const_PTHREAD_PROCESS_SHARED" >&6; }
+  if test $gl_cv_const_PTHREAD_PROCESS_SHARED != yes; then
+    HAVE_PTHREAD_PROCESS_SHARED=0
+  fi
 
 
-  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
 
 
 
+    LIB_PTHREAD="$LIBPMULTITHREAD"
 
 
 
 
+  GL_M4_GNULIB_PTHREAD_THREAD=0
 
-  M4_LIBOBJS="$M4_LIBOBJS memchr.$ac_objext"
 
 
-  for ac_header in bp-sym.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
-if test "x$ac_cv_header_bp_sym_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_BP_SYM_H 1
-_ACEOF
+  GL_M4_GNULIB_PTHREAD_ONCE=0
 
-fi
 
-done
 
+  GL_M4_GNULIB_PTHREAD_MUTEX=0
 
-  fi
 
 
+  GL_M4_GNULIB_PTHREAD_RWLOCK=0
 
 
 
-          GNULIB_MEMCHR=1
+  GL_M4_GNULIB_PTHREAD_COND=0
 
 
 
+  GL_M4_GNULIB_PTHREAD_TSS=0
 
 
-$as_echo "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
 
+  GL_M4_GNULIB_PTHREAD_SPIN=0
 
 
 
+  GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK=0
 
 
 
 
-  for ac_func in mkdtemp
-do :
-  ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
-if test "x$ac_cv_func_mkdtemp" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_MKDTEMP 1
-_ACEOF
 
-fi
-done
 
-  if test $ac_cv_func_mkdtemp = no; then
-    HAVE_MKDTEMP=0
-  fi
+  GL_M4_GNULIB_PSELECT=0
 
-  if test $HAVE_MKDTEMP = 0; then
 
 
+  GL_M4_GNULIB_SELECT=0
 
 
 
+ac_fn_check_decl "$LINENO" "setenv" "ac_cv_have_decl_setenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_setenv" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_SETENV $ac_have_decl" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS mkdtemp.$ac_objext"
 
-    :
 
+  if test $ac_cv_have_decl_setenv = no; then
+    HAVE_DECL_SETENV=0
   fi
 
 
 
 
 
-          GNULIB_MKDTEMP=1
-
+  ac_fn_c_check_header_compile "$LINENO" "search.h" "ac_cv_header_search_h" "$ac_includes_default"
+if test "x$ac_cv_header_search_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_SEARCH_H 1" >>confdefs.h
 
+fi
 
+  ac_fn_c_check_func "$LINENO" "tsearch" "ac_cv_func_tsearch"
+if test "x$ac_cv_func_tsearch" = xyes
+then :
+  printf "%s\n" "#define HAVE_TSEARCH 1" >>confdefs.h
 
+fi
 
-$as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h
 
 
 
@@ -27559,86 +31343,42 @@ $as_echo "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h
 
 
 
-  if test $ac_cv_func_mkstemp = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5
-$as_echo_n "checking for working mkstemp... " >&6; }
-if ${gl_cv_func_working_mkstemp+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-        mkdir conftest.mkstemp
-        if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-                     # Guess yes on glibc systems.
-             *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
-                     # If we don't know, assume the worst.
-             *)      gl_cv_func_working_mkstemp="guessing no" ;;
-           esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  if test $ac_cv_header_sys_ioctl_h = yes; then
+    HAVE_SYS_IOCTL_H=1
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <sys/ioctl.h> declares ioctl" >&5
+printf %s "checking whether <sys/ioctl.h> declares ioctl... " >&6; }
+if test ${gl_cv_decl_ioctl_in_sys_ioctl_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
+#include <sys/ioctl.h>
 int
-main ()
+main (void)
 {
-int result = 0;
-              int i;
-              off_t large = (off_t) 4294967295u;
-              if (large < 0)
-                large = 2147483647;
-              umask (0);
-              for (i = 0; i < 70; i++)
-                {
-                  char templ[] = "conftest.mkstemp/coXXXXXX";
-                  int (*mkstemp_function) (char *) = mkstemp;
-                  int fd = mkstemp_function (templ);
-                  if (fd < 0)
-                    result |= 1;
-                  else
-                    {
-                      struct stat st;
-                      if (lseek (fd, large, SEEK_SET) != large)
-                        result |= 2;
-                      if (fstat (fd, &st) < 0)
-                        result |= 4;
-                      else if (st.st_mode & 0077)
-                        result |= 8;
-                      if (close (fd))
-                        result |= 16;
-                    }
-                }
-              return result;
+(void) ioctl;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_working_mkstemp=yes
-else
-  gl_cv_func_working_mkstemp=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_decl_ioctl_in_sys_ioctl_h=yes
+else $as_nop
+  gl_cv_decl_ioctl_in_sys_ioctl_h=no
 fi
-
-        rm -rf conftest.mkstemp
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5
-$as_echo "$gl_cv_func_working_mkstemp" >&6; }
-    case "$gl_cv_func_working_mkstemp" in
-      *yes) ;;
-      *)
-        REPLACE_MKSTEMP=1
-        ;;
-    esac
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_ioctl_in_sys_ioctl_h" >&5
+printf "%s\n" "$gl_cv_decl_ioctl_in_sys_ioctl_h" >&6; }
   else
-    HAVE_MKSTEMP=0
+    HAVE_SYS_IOCTL_H=0
   fi
 
-  if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then
-
 
 
 
@@ -27646,28 +31386,78 @@ $as_echo "$gl_cv_func_working_mkstemp" >&6; }
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS mkstemp.$ac_objext"
 
 
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/ioctl.h>" >&5
+printf %s "checking absolute name of <sys/ioctl.h>... " >&6; }
+if test ${gl_cv_next_sys_ioctl_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  fi
+             if test $ac_cv_header_sys_ioctl_h = yes; then
 
 
 
 
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/ioctl.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
-          GNULIB_MKSTEMP=1
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'sys/ioctl.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
+        gl_cv_absolute_sys_ioctl_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
+           gl_header=$gl_cv_absolute_sys_ioctl_h
+           gl_cv_next_sys_ioctl_h='"'$gl_header'"'
+          else
+               gl_cv_next_sys_ioctl_h='<'sys/ioctl.h'>'
+             fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_ioctl_h" >&5
+printf "%s\n" "$gl_cv_next_sys_ioctl_h" >&6; }
+     fi
+     NEXT_SYS_IOCTL_H=$gl_cv_next_sys_ioctl_h
 
-$as_echo "#define GNULIB_TEST_MKSTEMP 1" >>confdefs.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='<'sys/ioctl.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_ioctl_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H=$gl_next_as_first_directive
 
 
 
 
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
 
 
 
@@ -27676,11 +31466,8 @@ $as_echo "#define GNULIB_TEST_MKSTEMP 1" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS msvc-inval.$ac_objext"
 
-  fi
 
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
 
 
 
@@ -27689,103 +31476,143 @@ $as_echo "#define GNULIB_TEST_MKSTEMP 1" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS msvc-nothrow.$ac_objext"
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_sys_uio_h='<'sys/uio.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/uio.h>" >&5
+printf %s "checking absolute name of <sys/uio.h>... " >&6; }
+if test ${gl_cv_next_sys_uio_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  fi
+             if test $ac_cv_header_sys_uio_h = yes; then
 
 
 
 
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/uio.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
 
-     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:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5
-$as_echo_n "checking whether YESEXPR works... " >&6; }
-if ${gl_cv_func_nl_langinfo_yesexpr_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'sys/uio.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
 
-         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
+        gl_cv_absolute_sys_uio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <langinfo.h>
+           gl_header=$gl_cv_absolute_sys_uio_h
+           gl_cv_next_sys_uio_h='"'$gl_header'"'
+          else
+               gl_cv_next_sys_uio_h='<'sys/uio.h'>'
+             fi
 
-int
-main ()
-{
-return !*nl_langinfo(YESEXPR);
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_nl_langinfo_yesexpr_works=yes
-else
-  gl_cv_func_nl_langinfo_yesexpr_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_uio_h" >&5
+printf "%s\n" "$gl_cv_next_sys_uio_h" >&6; }
+     fi
+     NEXT_SYS_UIO_H=$gl_cv_next_sys_uio_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='<'sys/uio.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_sys_uio_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H=$gl_next_as_first_directive
+
+
+
+
+  if test $ac_cv_header_sys_uio_h = yes; then
+    HAVE_SYS_UIO_H=1
+  else
+    HAVE_SYS_UIO_H=0
+  fi
+
 
 
+
+ac_fn_check_decl "$LINENO" "unsetenv" "ac_cv_have_decl_unsetenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_unsetenv" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
 fi
-{ $as_echo "$as_me:${as_lineno-$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
+printf "%s\n" "#define HAVE_DECL_UNSETENV $ac_have_decl" >>confdefs.h
 
-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
 
-$as_echo "#define REPLACE_NL_LANGINFO 1" >>confdefs.h
 
-    fi
+
+
+
+
+  if test $gl_threads_api = posix; then
+    YIELD_LIB="$LIB_SCHED_YIELD"
   else
-    HAVE_NL_LANGINFO=0
+    YIELD_LIB=
   fi
 
-  if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
 
 
+   if false; then
+  GL_COND_LIBTOOL_TRUE=
+  GL_COND_LIBTOOL_FALSE='#'
+else
+  GL_COND_LIBTOOL_TRUE='#'
+  GL_COND_LIBTOOL_FALSE=
+fi
+
+  gl_cond_libtool=false
+  gl_libdeps=
+  gl_ltlibdeps=
+  gl_m4_base='m4'
 
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS nl_langinfo.$ac_objext"
 
-  fi
 
 
 
 
 
-          GNULIB_NL_LANGINFO=1
+  gl_source_base='lib'
 
 
 
+      case "$host_os" in
+    mingw*) REPLACE_ACCESS=1 ;;
+  esac
 
+  if test $REPLACE_ACCESS = 1; then
 
-$as_echo "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h
 
 
 
@@ -27793,7 +31620,9 @@ $as_echo "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS access.$ac_objext"
 
+  fi
 
 
 
@@ -27801,45 +31630,106 @@ $as_echo "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h
 
 
 
-   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for obstacks that work with any size object" >&5
-$as_echo_n "checking for obstacks that work with any size object... " >&6; }
-if ${ac_cv_func_obstack+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+
+          GL_M4_GNULIB_ACCESS=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_ACCESS 1" >>confdefs.h
+
+
+
+
+
+  if test $ac_cv_func_alloca_works = no; then
+    :
+  fi
+
+  # Define an additional variable used in the Makefile substitution.
+  if test $ac_cv_working_alloca_h = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for alloca as a compiler built-in" >&5
+printf %s "checking for alloca as a compiler built-in... " >&6; }
+if test ${gl_cv_rpl_alloca+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include "obstack.h"
-             void *obstack_chunk_alloc (size_t n) { return 0; }
-             void obstack_chunk_free (void *p) { }
-             /* Check that an internal function returns size_t, not int.  */
-             size_t _obstack_memory_used (struct obstack *);
 
-int
-main ()
-{
-struct obstack mem;
-             obstack_init (&mem);
-             obstack_free (&mem, 0);
+#if defined __GNUC__ || defined _AIX || defined _MSC_VER
+        Need own alloca
+#endif
 
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  ac_cv_func_obstack=yes
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Need own alloca" >/dev/null 2>&1
+then :
+  gl_cv_rpl_alloca=yes
+else $as_nop
+  gl_cv_rpl_alloca=no
+fi
+rm -rf conftest*
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_rpl_alloca" >&5
+printf "%s\n" "$gl_cv_rpl_alloca" >&6; }
+    if test $gl_cv_rpl_alloca = yes; then
+
+printf "%s\n" "#define HAVE_ALLOCA 1" >>confdefs.h
+
+      ALLOCA_H=alloca.h
+    else
+                  ALLOCA_H=
+    fi
+  else
+    ALLOCA_H=alloca.h
+  fi
+
+   if test -n "$ALLOCA_H"; then
+  GL_GENERATE_ALLOCA_H_TRUE=
+  GL_GENERATE_ALLOCA_H_FALSE='#'
 else
-  ac_cv_func_obstack=no
+  GL_GENERATE_ALLOCA_H_TRUE='#'
+  GL_GENERATE_ALLOCA_H_FALSE=
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+
+
+  if test $ac_cv_working_alloca_h = yes; then
+    HAVE_ALLOCA_H=1
+  else
+    HAVE_ALLOCA_H=0
+  fi
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to enable assertions" >&5
+printf %s "checking whether to enable assertions... " >&6; }
+  # Check whether --enable-assert was given.
+if test ${enable_assert+y}
+then :
+  enableval=$enable_assert; if test "x$enableval" = xno
+then :
+
+printf "%s\n" "#define NDEBUG 1" >>confdefs.h
+
+elif test "x$enableval" != xyes
+then :
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: invalid argument supplied to --enable-assert" >&5
+printf "%s\n" "$as_me: WARNING: invalid argument supplied to --enable-assert" >&2;}
+      enable_assert=yes
+fi
+else $as_nop
+  enable_assert=yes
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_obstack" >&5
-$as_echo "$ac_cv_func_obstack" >&6; }
-   if test "$ac_cv_func_obstack" = yes; then
 
-$as_echo "#define HAVE_OBSTACK 1" >>confdefs.h
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_assert" >&5
+printf "%s\n" "$enable_assert" >&6; }
 
-   else
 
 
 
@@ -27848,86 +31738,124 @@ $as_echo "#define HAVE_OBSTACK 1" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS obstack.$ac_objext"
 
-   fi
 
+  if test $ac_cv_func_btowc = no; then
+    HAVE_BTOWC=0
+  else
 
 
-  case "$host_os" in
-    mingw* | pw*)
-      REPLACE_OPEN=1
-      ;;
-    *)
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
-$as_echo_n "checking whether open recognizes a trailing slash... " >&6; }
-if ${gl_cv_func_open_slash+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # Assume that if we have lstat, we can also check symlinks.
-          if test $ac_cv_func_lstat = yes; then
-            touch conftest.tmp
-            ln -s conftest.tmp conftest.lnk
-          fi
-          if test "$cross_compiling" = yes; then :
 
-             case "$host_os" in
-               freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
-                 gl_cv_func_open_slash="guessing no" ;;
-               *)
-                 gl_cv_func_open_slash="guessing yes" ;;
-             esac
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(0) is correct" >&5
+printf %s "checking whether btowc(0) is correct... " >&6; }
+if test ${gl_cv_func_btowc_nul+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-else
+        if test "$cross_compiling" = yes
+then :
+
+           case "$host_os" in
+                      # Guess no on Cygwin.
+             cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+                      # Guess yes on native Windows.
+             mingw*)  gl_cv_func_btowc_nul="guessing yes" ;;
+                      # Guess yes otherwise.
+             *)       gl_cv_func_btowc_nul="guessing yes" ;;
+           esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <fcntl.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <wchar.h>
 int main ()
 {
-  int result = 0;
-#if HAVE_LSTAT
-  if (open ("conftest.lnk/", O_RDONLY) != -1)
-    result |= 1;
-#endif
-  if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
-    result |= 2;
-  return result;
+  if (btowc ('\0') != 0)
+    return 1;
+  return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_open_slash=yes
-else
-  gl_cv_func_open_slash=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_btowc_nul=yes
+else $as_nop
+  gl_cv_func_btowc_nul=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-          rm -f conftest.sl conftest.tmp conftest.lnk
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
-$as_echo "$gl_cv_func_open_slash" >&6; }
-      case "$gl_cv_func_open_slash" in
-        *no)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_nul" >&5
+printf "%s\n" "$gl_cv_func_btowc_nul" >&6; }
 
-$as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether btowc(EOF) is correct" >&5
+printf %s "checking whether btowc(EOF) is correct... " >&6; }
+if test ${gl_cv_func_btowc_eof+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-          REPLACE_OPEN=1
-          ;;
-      esac
-      ;;
-  esac
+                        case "$host_os" in
+                  # Guess no on IRIX.
+          irix*)  gl_cv_func_btowc_eof="guessing no" ;;
+                  # Guess yes on native Windows.
+          mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
+                  # Guess yes otherwise.
+          *)      gl_cv_func_btowc_eof="guessing yes" ;;
+        esac
+        if test $LOCALE_FR != none; then
+          if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdio.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+    {
+      if (btowc (EOF) != WEOF)
+        return 1;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_btowc_eof=yes
+else $as_nop
+  gl_cv_func_btowc_eof=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+        fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_btowc_eof" >&5
+printf "%s\n" "$gl_cv_func_btowc_eof" >&6; }
 
-  if test $REPLACE_OPEN = 1; then
+    case "$gl_cv_func_btowc_nul" in
+      *yes) ;;
+      *) REPLACE_BTOWC=1 ;;
+    esac
+    case "$gl_cv_func_btowc_eof" in
+      *yes) ;;
+      *) REPLACE_BTOWC=1 ;;
+    esac
+  fi
 
+  if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
 
 
 
@@ -27935,8 +31863,8 @@ $as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS open.$ac_objext"
 
+  M4_LIBOBJS="$M4_LIBOBJS btowc.$ac_objext"
 
 
   :
@@ -27947,49 +31875,158 @@ $as_echo "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
 
 
 
-          GNULIB_OPEN=1
 
 
 
 
+          GL_M4_GNULIB_BTOWC=1
 
-$as_echo "#define GNULIB_TEST_OPEN 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_BTOWC 1" >>confdefs.h
 
 
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __builtin_expect" >&5
+printf %s "checking for __builtin_expect... " >&6; }
+if test ${gl_cv___builtin_expect+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+         int
+         main (int argc, char **argv)
+         {
+           argc = __builtin_expect (argc, 100);
+           return argv[argc != 100][0];
+         }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv___builtin_expect=yes
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+             #include <builtins.h>
+             int
+             main (int argc, char **argv)
+             {
+               argc = __builtin_expect (argc, 100);
+               return argv[argc != 100][0];
+             }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv___builtin_expect="in <builtins.h>"
+else $as_nop
+  gl_cv___builtin_expect=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv___builtin_expect" >&5
+printf "%s\n" "$gl_cv___builtin_expect" >&6; }
+  if test "$gl_cv___builtin_expect" = yes; then
+    printf "%s\n" "#define HAVE___BUILTIN_EXPECT 1" >>confdefs.h
 
+  elif test "$gl_cv___builtin_expect" = "in <builtins.h>"; then
+    printf "%s\n" "#define HAVE___BUILTIN_EXPECT 2" >>confdefs.h
 
-  if test $ac_cv_func_pipe2 != yes; then
-    HAVE_PIPE2=0
   fi
 
 
 
+    if test "$with_libsigsegv" = yes; then
+    if test "$gl_cv_lib_sigsegv" = yes; then
+      LIBCSTACK=$LIBSIGSEGV
 
+      LTLIBCSTACK=$LTLIBSIGSEGV
 
+    fi
+  fi
 
-          GNULIB_PIPE2=1
 
 
 
+  if test $REPLACE_CALLOC = 0; then
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether calloc (0, n) and calloc (n, 0) return nonnull" >&5
+printf %s "checking whether calloc (0, n) and calloc (n, 0) return nonnull... " >&6; }
+if test ${ac_cv_func_calloc_0_nonnull+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test $cross_compiling != yes; then
+       ac_cv_func_calloc_0_nonnull=yes
+       if test "$cross_compiling" = yes
+then :
+  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run test program while cross compiling
+See \`config.log' for more details" "$LINENO" 5; }
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main (void)
+{
+int result = 0;
+              char * volatile p = calloc (0, 0);
+              if (!p)
+                result |= 1;
+              free (p);
+              return result;
 
-$as_echo "#define GNULIB_TEST_PIPE2 1" >>confdefs.h
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
 
+else $as_nop
+  ac_cv_func_calloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+     else
+       case "$host_os" in
+                        # Guess yes on glibc systems.
+         *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+                        # Guess yes on musl systems.
+         *-musl*)       ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+                        # Guess yes on native Windows.
+         mingw*)        ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+                        # If we don't know, obey --enable-cross-guesses.
+         *)             ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;;
+       esac
+     fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_calloc_0_nonnull" >&5
+printf "%s\n" "$ac_cv_func_calloc_0_nonnull" >&6; }
+  case $ac_cv_func_calloc_0_nonnull in #(
+  *yes) :
+     ;; #(
+  *) :
+    REPLACE_CALLOC=1 ;;
+esac
 
+  fi
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_PIPE2_SAFER 1
-_ACEOF
+  if test $REPLACE_CALLOC = 1; then
 
 
 
@@ -27998,56 +32035,17 @@ _ACEOF
 
 
 
-  if test $REPLACE_POSIX_SPAWN = 1; then
-    REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1
-  else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn_file_actions_addclose works" >&5
-$as_echo_n "checking whether posix_spawn_file_actions_addclose works... " >&6; }
-if ${gl_cv_func_posix_spawn_file_actions_addclose_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  # Guess no on Solaris, yes otherwise.
-          case "$host_os" in
-            solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no";;
-            *)        gl_cv_func_posix_spawn_file_actions_addclose_works="guessing yes";;
-          esac
+  M4_LIBOBJS="$M4_LIBOBJS calloc.$ac_objext"
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  fi
 
-#include <spawn.h>
-int main ()
-{
-  posix_spawn_file_actions_t actions;
-  if (posix_spawn_file_actions_init (&actions) != 0)
-    return 1;
-  if (posix_spawn_file_actions_addclose (&actions, 10000000) == 0)
-    return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_posix_spawn_file_actions_addclose_works=yes
-else
-  gl_cv_func_posix_spawn_file_actions_addclose_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_file_actions_addclose_works" >&5
-$as_echo "$gl_cv_func_posix_spawn_file_actions_addclose_works" >&6; }
-    case "$gl_cv_func_posix_spawn_file_actions_addclose_works" in
-      *yes) ;;
-      *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1 ;;
-    esac
+  if test $REPLACE_MALLOC = 1; then
+    REPLACE_CALLOC=1
   fi
 
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = 1; then
+  if test $REPLACE_CALLOC = 1; then
 
 
 
@@ -28056,7 +32054,7 @@ $as_echo "$gl_cv_func_posix_spawn_file_actions_addclose_works" >&6; }
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_addclose.$ac_objext"
+  M4_LIBOBJS="$M4_LIBOBJS calloc.$ac_objext"
 
   fi
 
@@ -28064,156 +32062,89 @@ $as_echo "$gl_cv_func_posix_spawn_file_actions_addclose_works" >&6; }
 
 
 
-          GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1
 
 
 
 
+          GL_M4_GNULIB_CALLOC_POSIX=1
 
-$as_echo "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_CALLOC_POSIX 1" >>confdefs.h
 
 
 
 
 
-  if test $REPLACE_POSIX_SPAWN = 1; then
-    REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1
-  else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn_file_actions_adddup2 works" >&5
-$as_echo_n "checking whether posix_spawn_file_actions_adddup2 works... " >&6; }
-if ${gl_cv_func_posix_spawn_file_actions_adddup2_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  # Guess no on Solaris, yes otherwise.
-          case "$host_os" in
-            solaris*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";;
-            *)        gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing yes";;
-          esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <spawn.h>
-int main ()
-{
-  posix_spawn_file_actions_t actions;
-  if (posix_spawn_file_actions_init (&actions) != 0)
-    return 1;
-  if (posix_spawn_file_actions_adddup2 (&actions, 10000000, 2) == 0)
-    return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_posix_spawn_file_actions_adddup2_works=yes
-else
-  gl_cv_func_posix_spawn_file_actions_adddup2_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_file_actions_adddup2_works" >&5
-$as_echo "$gl_cv_func_posix_spawn_file_actions_adddup2_works" >&6; }
-    case "$gl_cv_func_posix_spawn_file_actions_adddup2_works" in
+  if test $ac_cv_func_canonicalize_file_name = no; then
+    HAVE_CANONICALIZE_FILE_NAME=0
+  else
+    case "$gl_cv_func_realpath_works" in
       *yes) ;;
-      *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1 ;;
+      *)    REPLACE_CANONICALIZE_FILE_NAME=1 ;;
     esac
   fi
 
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = 1; then
 
 
+printf "%s\n" "#define GNULIB_CANONICALIZE 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_CANONICALIZE 1" >>confdefs.h
 
 
-  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_adddup2.$ac_objext"
-
-  fi
 
 
 
 
 
-          GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1
 
 
 
 
+          GL_M4_GNULIB_CANONICALIZE_FILE_NAME=1
 
-$as_echo "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
 
 
 
 
 
-  if test $REPLACE_POSIX_SPAWN = 1; then
-    REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1
-  else
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn_file_actions_addopen works" >&5
-$as_echo_n "checking whether posix_spawn_file_actions_addopen works... " >&6; }
-if ${gl_cv_func_posix_spawn_file_actions_addopen_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  # Guess no on Solaris, yes otherwise.
-          case "$host_os" in
-            solaris*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";;
-            *)        gl_cv_func_posix_spawn_file_actions_addopen_works="guessing yes";;
-          esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#include <spawn.h>
-#include <fcntl.h>
-int main ()
-{
-  posix_spawn_file_actions_t actions;
-  if (posix_spawn_file_actions_init (&actions) != 0)
-    return 1;
-  if (posix_spawn_file_actions_addopen (&actions, 10000000, "foo", 0, O_RDONLY)
-      == 0)
-    return 2;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_posix_spawn_file_actions_addopen_works=yes
-else
-  gl_cv_func_posix_spawn_file_actions_addopen_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_file_actions_addopen_works" >&5
-$as_echo "$gl_cv_func_posix_spawn_file_actions_addopen_works" >&6; }
-    case "$gl_cv_func_posix_spawn_file_actions_addopen_works" in
-      *yes) ;;
-      *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1 ;;
+  if test $ac_cv_func_canonicalize_file_name = no; then
+    HAVE_CANONICALIZE_FILE_NAME=0
+    if test $ac_cv_func_realpath = no; then
+      HAVE_REALPATH=0
+    else
+      case "$gl_cv_func_realpath_works" in
+        *yes) ;;
+        *)    REPLACE_REALPATH=1 ;;
+      esac
+    fi
+  else
+    case "$gl_cv_func_realpath_works" in
+      *yes)
+        ;;
+      *)
+        REPLACE_CANONICALIZE_FILE_NAME=1
+        REPLACE_REALPATH=1
+        ;;
     esac
   fi
 
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = 1; then
+  if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
 
 
 
@@ -28222,1284 +32153,1102 @@ $as_echo "$gl_cv_func_posix_spawn_file_actions_addopen_works" >&6; }
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_addopen.$ac_objext"
+  M4_LIBOBJS="$M4_LIBOBJS canonicalize-lgpl.$ac_objext"
 
   fi
 
 
+printf "%s\n" "#define GNULIB_CANONICALIZE_LGPL 1" >>confdefs.h
 
 
 
-          GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN 1" >>confdefs.h
 
 
 
+          GL_M4_GNULIB_CANONICALIZE_FILE_NAME=1
 
 
 
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
 
+printf "%s\n" "#define GNULIB_TEST_CANONICALIZE_FILE_NAME 1" >>confdefs.h
 
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_destroy.$ac_objext"
 
-  fi
 
 
 
 
 
-          GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=1
+          GL_M4_GNULIB_REALPATH=1
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_DESTROY 1" >>confdefs.h
+printf "%s\n" "#define GNULIB_TEST_REALPATH 1" >>confdefs.h
 
 
 
 
 
 
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
 
 
 
 
 
+          GL_M4_GNULIB_CHDIR=1
 
 
-  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_init.$ac_objext"
 
-  fi
 
 
+printf "%s\n" "#define GNULIB_TEST_CHDIR 1" >>confdefs.h
 
 
 
-          GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=1
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether this system supports file names of any length" >&5
+printf %s "checking whether this system supports file names of any length... " >&6; }
+if test ${gl_cv_have_unlimited_file_name_length+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Arrange to define PATH_MAX, like "pathmax.h" does. */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <limits.h>
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+#ifdef __hpux
+# undef PATH_MAX
+# define PATH_MAX 1024
+#endif
+#if defined _WIN32 && ! defined __CYGWIN__
+# undef PATH_MAX
+# define PATH_MAX 260
+#endif
 
+#ifdef PATH_MAX
+have_arbitrary_file_name_length_limit
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "have_arbitrary_file_name_length_limit" >/dev/null 2>&1
+then :
+  gl_cv_have_unlimited_file_name_length=no
+else $as_nop
+  gl_cv_have_unlimited_file_name_length=yes
+fi
+rm -rf conftest*
 
-$as_echo "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_INIT 1" >>confdefs.h
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_unlimited_file_name_length" >&5
+printf "%s\n" "$gl_cv_have_unlimited_file_name_length" >&6; }
 
+  if test $gl_cv_have_unlimited_file_name_length = no; then
 
 
 
 
 
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS chdir-long.$ac_objext"
 
+    :
+  fi
 
+printf "%s\n" "#define SIGNAL_SAFE_LIST 1" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS spawnattr_destroy.$ac_objext"
 
-  fi
+  # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
+  # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
 
+  # Save and restore LIBS so e.g., -lrt, isn't added to it.  Otherwise, *all*
+  # programs in the package would end up linked with that potentially-shared
+  # library, inducing unnecessary run-time overhead.
+  LIB_CLOCK_GETTIME=
 
+  gl_saved_libs=$LIBS
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5
+printf %s "checking for library containing clock_gettime... " >&6; }
+if test ${ac_cv_search_clock_gettime+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char clock_gettime ();
+int
+main (void)
+{
+return clock_gettime ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' rt posix4
+do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_search_clock_gettime=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext
+  if test ${ac_cv_search_clock_gettime+y}
+then :
+  break
+fi
+done
+if test ${ac_cv_search_clock_gettime+y}
+then :
 
+else $as_nop
+  ac_cv_search_clock_gettime=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5
+printf "%s\n" "$ac_cv_search_clock_gettime" >&6; }
+ac_res=$ac_cv_search_clock_gettime
+if test "$ac_res" != no
+then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  test "$ac_cv_search_clock_gettime" = "none required" ||
+                    LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime
+fi
 
-          GNULIB_POSIX_SPAWNATTR_DESTROY=1
+    ac_fn_c_check_func "$LINENO" "clock_gettime" "ac_cv_func_clock_gettime"
+if test "x$ac_cv_func_clock_gettime" = xyes
+then :
+  printf "%s\n" "#define HAVE_CLOCK_GETTIME 1" >>confdefs.h
 
+fi
+ac_fn_c_check_func "$LINENO" "clock_settime" "ac_cv_func_clock_settime"
+if test "x$ac_cv_func_clock_settime" = xyes
+then :
+  printf "%s\n" "#define HAVE_CLOCK_SETTIME 1" >>confdefs.h
 
+fi
 
+  LIBS=$gl_saved_libs
 
 
-$as_echo "#define GNULIB_TEST_POSIX_SPAWNATTR_DESTROY 1" >>confdefs.h
 
+printf "%s\n" "#define GNULIB_TEST_CLOEXEC 1" >>confdefs.h
 
 
 
 
 
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
+    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+      REPLACE_CLOSE=1
+    fi
 
 
 
 
 
 
+  if test $ac_cv_header_sys_socket_h != yes; then
+                    ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h
 
-  M4_LIBOBJS="$M4_LIBOBJS spawnattr_init.$ac_objext"
+fi
 
   fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+  else
+    HAVE_WINSOCK2_H=0
+  fi
 
 
+    if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
+                        REPLACE_CLOSE=1
+    fi
 
 
-
-          GNULIB_POSIX_SPAWNATTR_INIT=1
+    if test $REPLACE_CLOSE = 0; then
 
 
 
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
 
+      if test $HAVE_FCHDIR = 0; then
+        REPLACE_CLOSE=1
+      fi
+    fi
 
-$as_echo "#define GNULIB_TEST_POSIX_SPAWNATTR_INIT 1" >>confdefs.h
 
+  if test $REPLACE_CLOSE = 1; then
 
 
 
 
 
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS close.$ac_objext"
 
+  fi
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS spawnattr_setflags.$ac_objext"
 
-  fi
 
 
 
 
+          GL_M4_GNULIB_CLOSE=1
 
-          GNULIB_POSIX_SPAWNATTR_SETFLAGS=1
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_CLOSE 1" >>confdefs.h
 
-$as_echo "#define GNULIB_TEST_POSIX_SPAWNATTR_SETFLAGS 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_CLOSE_STREAM 1" >>confdefs.h
 
 
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
 
 
+  ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
+if test "x$ac_cv_func_closedir" = xyes
+then :
+  printf "%s\n" "#define HAVE_CLOSEDIR 1" >>confdefs.h
 
+fi
 
+  if test $ac_cv_func_closedir = no; then
+    HAVE_CLOSEDIR=0
+  fi
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS spawnattr_setsigmask.$ac_objext"
 
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
   fi
 
+    if test $HAVE_FCHDIR = 0; then
+      if test $HAVE_CLOSEDIR = 1; then
+        REPLACE_CLOSEDIR=1
+      fi
+    fi
 
+    case $host_os,$HAVE_CLOSEDIR in
+    os2*,1)
+      REPLACE_CLOSEDIR=1;;
+  esac
 
+  if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
 
 
-          GNULIB_POSIX_SPAWNATTR_SETSIGMASK=1
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_POSIX_SPAWNATTR_SETSIGMASK 1" >>confdefs.h
 
+  M4_LIBOBJS="$M4_LIBOBJS closedir.$ac_objext"
 
+  fi
 
 
 
 
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
 
 
 
 
+          GL_M4_GNULIB_CLOSEDIR=1
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS spawnp.$ac_objext"
 
 
+printf "%s\n" "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
 
 
 
 
 
+  if test "x$lispdir" = x; then
+    lispdir='${datarootdir}/emacs/site-lisp'
 
+  fi
+    if test "x$runstatedir" = x; then
+    runstatedir='${localstatedir}/run'
 
-  M4_LIBOBJS="$M4_LIBOBJS spawni.$ac_objext"
+  fi
 
+      pkglibexecdir='${libexecdir}/${PACKAGE}'
 
-  for ac_header in paths.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "paths.h" "ac_cv_header_paths_h" "$ac_includes_default"
-if test "x$ac_cv_header_paths_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PATHS_H 1
-_ACEOF
 
-fi
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for d_ino member in directory struct" >&5
+printf %s "checking for d_ino member in directory struct... " >&6; }
+if test ${gl_cv_struct_dirent_d_ino+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                            # Guess yes on glibc systems with Linux kernel.
+              linux*-gnu*)  gl_cv_struct_dirent_d_ino="guessing yes" ;;
+                            # Guess yes on musl systems with Linux kernel.
+              linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
+                            # Guess no on native Windows.
+              mingw*)       gl_cv_struct_dirent_d_ino="guessing no" ;;
+                            # If we don't know, obey --enable-cross-guesses.
+              *)            gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
+            esac
 
-done
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+             #include <sys/stat.h>
+             #include <dirent.h>
 
-  for ac_func in confstr sched_setparam sched_setscheduler setegid seteuid vfork
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+int
+main (void)
+{
+DIR *dp = opendir (".");
+             struct dirent *e;
+             struct stat st;
+             if (! dp)
+               return 1;
+             e = readdir (dp);
+             if (! e)
+               { closedir (dp); return 2; }
+             if (lstat (e->d_name, &st) != 0)
+               { closedir (dp); return 3; }
+             if (e->d_ino != st.st_ino)
+               { closedir (dp); return 4; }
+             closedir (dp);
+             return 0;
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_struct_dirent_d_ino=yes
+else $as_nop
+  gl_cv_struct_dirent_d_ino=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-done
-
-
-  fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_struct_dirent_d_ino" >&5
+printf "%s\n" "$gl_cv_struct_dirent_d_ino" >&6; }
+   case "$gl_cv_struct_dirent_d_ino" in
+     *yes)
 
+printf "%s\n" "#define D_INO_IN_DIRENT 1" >>confdefs.h
 
+       ;;
+   esac
 
 
-          GNULIB_POSIX_SPAWNP=1
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_POSIX_SPAWNP 1" >>confdefs.h
 
 
 
 
 
-  if test $gl_cv_func_frexp_no_libm = yes; then
 
+  ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
+if test "x$ac_cv_func_dirfd" = xyes
+then :
+  printf "%s\n" "#define HAVE_DIRFD 1" >>confdefs.h
 
+fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
-$as_echo_n "checking whether frexp works... " >&6; }
-if ${gl_cv_func_frexp_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  ac_fn_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
+      #include <dirent.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_dirfd" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_DIRFD $ac_have_decl" >>confdefs.h
 
-      if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-           netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
-           *)                        gl_cv_func_frexp_works="guessing yes";;
-         esac
+  if test $ac_cv_have_decl_dirfd = no; then
+    HAVE_DECL_DIRFD=0
+  fi
 
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
+printf %s "checking whether dirfd is a macro... " >&6; }
+if test ${gl_cv_func_dirfd_macro+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <float.h>
-#include <math.h>
-#include <string.h>
-#if HAVE_DECL_ALARM
-# include <signal.h>
-# include <unistd.h>
-#endif
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
-   ICC 10.0 has a bug when optimizing the expression -zero.
-   The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
-   to PowerPC on Mac OS X 10.5.  */
-#if defined __hpux || defined __sgi || defined __ICC
-static double
-compute_minus_zero (void)
-{
-  return -DBL_MIN * DBL_MIN;
-}
-# define minus_zero compute_minus_zero ()
-#else
-double minus_zero = -0.0;
-#endif
-int main()
-{
-  int result = 0;
-  int i;
-  volatile double x;
-  double zero = 0.0;
-#if HAVE_DECL_ALARM
-  /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
-     number.  Let the test fail in this case.  */
-  signal (SIGALRM, SIG_DFL);
-  alarm (5);
+#include <sys/types.h>
+#include <dirent.h>
+#ifdef dirfd
+ dirent_header_defines_dirfd
 #endif
-  /* Test on denormalized numbers.  */
-  for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
-    ;
-  if (x > 0.0)
-    {
-      int exp;
-      double y = frexp (x, &exp);
-      /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
-         On NetBSD: y = 0.75. Correct: y = 0.5.  */
-      if (y != 0.5)
-        result |= 1;
-    }
-  /* Test on infinite numbers.  */
-  x = 1.0 / zero;
-  {
-    int exp;
-    double y = frexp (x, &exp);
-    if (y != x)
-      result |= 2;
-  }
-  /* Test on negative zero.  */
-  x = minus_zero;
-  {
-    int exp;
-    double y = frexp (x, &exp);
-    if (memcmp (&y, &x, sizeof x))
-      result |= 4;
-  }
-  return result;
-}
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_frexp_works=yes
-else
-  gl_cv_func_frexp_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1
+then :
+  gl_cv_func_dirfd_macro=yes
+else $as_nop
+  gl_cv_func_dirfd_macro=no
 fi
-
+rm -rf conftest*
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
-$as_echo "$gl_cv_func_frexp_works" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
+printf "%s\n" "$gl_cv_func_dirfd_macro" >&6; }
 
-    case "$gl_cv_func_frexp_works" in
-      *yes)
+  # Use the replacement if we have no function or macro with that name,
+  # or if OS/2 kLIBC whose dirfd() does not work.
+  # Replace only if the system declares dirfd already.
+  case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
+    no,no,*,yes | *,*,os2*,yes)
+      REPLACE_DIRFD=1
 
-$as_echo "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h
+printf "%s\n" "#define REPLACE_DIRFD 1" >>confdefs.h
+;;
+  esac
 
-        ;;
-    esac
-  fi
+  if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
+     || test $REPLACE_DIRFD = 1; then
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexp can be used without linking with libm" >&5
-$as_echo_n "checking whether ldexp can be used without linking with libm... " >&6; }
-if ${gl_cv_func_ldexp_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-             double x;
-             int y;
-int
-main ()
-{
-return ldexp (x, y) < 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_ldexp_no_libm=yes
-else
-  gl_cv_func_ldexp_no_libm=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5
-$as_echo "$gl_cv_func_ldexp_no_libm" >&6; }
-  if test $gl_cv_func_ldexp_no_libm = yes; then
 
-$as_echo "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h
 
-  fi
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS dirfd.$ac_objext"
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
+printf %s "checking how to get the file descriptor associated with an open DIR*... " >&6; }
+if test ${gl_cv_sys_dir_fd_member_name+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
-$as_echo_n "checking whether frexpl() can be used without linking with libm... " >&6; }
-if ${gl_cv_func_frexpl_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+      dirfd_save_CFLAGS=$CFLAGS
+      for ac_expr in d_fd dd_fd; do
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <math.h>
-             long double x;
+
+           #include <sys/types.h>
+           #include <dirent.h>
 int
-main ()
+main (void)
 {
-int e; return frexpl (x, &e) > 0;
+DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_frexpl_no_libm=yes
-else
-  gl_cv_func_frexpl_no_libm=no
+if ac_fn_c_try_compile "$LINENO"
+then :
+  dir_fd_found=yes
+
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+        CFLAGS=$dirfd_save_CFLAGS
+        test "$dir_fd_found" = yes && break
+      done
+      test "$dir_fd_found" = yes || ac_expr=no_such_member
+
+      gl_cv_sys_dir_fd_member_name=$ac_expr
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
-$as_echo "$gl_cv_func_frexpl_no_libm" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
+printf "%s\n" "$gl_cv_sys_dir_fd_member_name" >&6; }
+  if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
 
-  if test $gl_cv_func_frexpl_no_libm = yes; then
+printf "%s\n" "#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name" >>confdefs.h
 
+  fi
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
-$as_echo_n "checking whether frexpl works... " >&6; }
-if ${gl_cv_func_frexpl_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
+  fi
 
-         case "$host_os" in
-           aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
-              gl_cv_func_frexpl_works="guessing no";;
-           *) gl_cv_func_frexpl_works="guessing yes";;
-         esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <float.h>
-#include <math.h>
-/* Override the values of <float.h>, like done in float.in.h.  */
-#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP    (-16381)
-#endif
-#if defined __i386__ && defined __FreeBSD__
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP    (-16381)
-#endif
-#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
-# undef LDBL_MIN_EXP
-# define LDBL_MIN_EXP DBL_MIN_EXP
-#endif
-#if defined __sgi && (LDBL_MANT_DIG >= 106)
-# if defined __GNUC__
-#  undef LDBL_MIN_EXP
-#  define LDBL_MIN_EXP DBL_MIN_EXP
-# endif
-#endif
-extern
-#ifdef __cplusplus
-"C"
-#endif
-long double frexpl (long double, int *);
-int main()
-{
-  int result = 0;
-  volatile long double x;
-  /* Test on finite numbers that fails on AIX 5.1.  */
-  x = 16.0L;
-  {
-    int exp = -9999;
-    frexpl (x, &exp);
-    if (exp != 5)
-      result |= 1;
-  }
-  /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
-     function returns an invalid (incorrectly normalized) value: it returns
-               y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
-     but the correct result is
-          0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 }  */
-  x = 1.01L;
-  {
-    int exp = -9999;
-    long double y = frexpl (x, &exp);
-    if (!(exp == 1 && y == 0.505L))
-      result |= 2;
-  }
-  /* Test on large finite numbers.  This fails on BeOS at i = 16322, while
-     LDBL_MAX_EXP = 16384.
-     In the loop end test, we test x against Infinity, rather than comparing
-     i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP.  */
-  {
-    int i;
-    for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
-      {
-        int exp = -9999;
-        frexpl (x, &exp);
-        if (exp != i)
-          {
-            result |= 4;
-            break;
-          }
-      }
-  }
-  /* Test on denormalized numbers.  */
-  {
-    int i;
-    for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
-      ;
-    if (x > 0.0L)
-      {
-        int exp;
-        long double y = frexpl (x, &exp);
-        /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
-           exp = -16382, y = 0.5.  On Mac OS X 10.5: exp = -16384, y = 0.5.  */
-        if (exp != LDBL_MIN_EXP - 1)
-          result |= 8;
-      }
-  }
-  /* Test on infinite numbers.  */
-  x = 1.0L / 0.0L;
-  {
-    int exp;
-    long double y = frexpl (x, &exp);
-    if (y != x)
-      result |= 16;
-  }
-  return result;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_frexpl_works=yes
-else
-  gl_cv_func_frexpl_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
-$as_echo "$gl_cv_func_frexpl_works" >&6; }
 
-    case "$gl_cv_func_frexpl_works" in
-      *yes) gl_func_frexpl_no_libm=yes ;;
-      *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
-    esac
-  else
-    gl_func_frexpl_no_libm=no
-        REPLACE_FREXPL=1
-  fi
-  if test $gl_func_frexpl_no_libm = yes; then
 
-$as_echo "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h
 
-            ac_fn_c_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_frexpl" = xyes; then :
 
-else
-  HAVE_DECL_FREXPL=0
-fi
+          GL_M4_GNULIB_DIRFD=1
 
-  fi
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used without linking with libm" >&5
-$as_echo_n "checking whether ldexpl() can be used without linking with libm... " >&6; }
-if ${gl_cv_func_ldexpl_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-             long double x;
-int
-main ()
-{
-return ldexpl (x, -1) > 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_ldexpl_no_libm=yes
-else
-  gl_cv_func_ldexpl_no_libm=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5
-$as_echo "$gl_cv_func_ldexpl_no_libm" >&6; }
+printf "%s\n" "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
 
-  if test $gl_cv_func_ldexpl_no_libm = yes; then
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5
-$as_echo_n "checking whether ldexpl works... " >&6; }
-if ${gl_cv_func_ldexpl_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
 
-         case "$host_os" in
-           aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";;
-           *)               gl_cv_func_ldexpl_works="guessing yes";;
-         esac
+printf "%s\n" "#define GNULIB_DIRNAME 1" >>confdefs.h
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <math.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-long double ldexpl (long double, int);
-int main()
-{
-  int result = 0;
-  {
-    volatile long double x = 1.0;
-    volatile long double y = ldexpl (x, -1);
-    if (y != 0.5L)
-      result |= 1;
-  }
-  {
-    volatile long double x = 1.73205L;
-    volatile long double y = ldexpl (x, 0);
-    if (y != x)
-      result |= 2;
-  }
-  return result;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_ldexpl_works=yes
-else
-  gl_cv_func_ldexpl_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether // is distinct from /" >&5
+printf %s "checking whether // is distinct from /... " >&6; }
+if test ${gl_cv_double_slash_root+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+   if test x"$cross_compiling" = xyes ; then
+        # When cross-compiling, there is no way to tell whether // is special
+        # short of a list of hosts.  However, the only known hosts to date
+        # that have a distinct // are Apollo DomainOS (too old to port to),
+        # Cygwin, and z/OS.  If anyone knows of another system for which // has
+        # special semantics and is distinct from /, please report it to
+        # <bug-gnulib@gnu.org>.
+        case $host in
+          *-cygwin | i370-ibm-openedition)
+            gl_cv_double_slash_root=yes ;;
+          *)
+            # Be optimistic and assume that / and // are the same when we
+            # don't know.
+            gl_cv_double_slash_root='unknown, assuming no' ;;
+        esac
+      else
+        set x `ls -di / // 2>/dev/null`
+        if test "$2" = "$4" && wc //dev/null >/dev/null 2>&1; then
+          gl_cv_double_slash_root=no
+        else
+          gl_cv_double_slash_root=yes
+        fi
+      fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5
-$as_echo "$gl_cv_func_ldexpl_works" >&6; }
-
-    case "$gl_cv_func_ldexpl_works" in
-      *yes)
-
-$as_echo "#define HAVE_LDEXPL_IN_LIBC 1" >>confdefs.h
-
-                        ac_fn_c_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_ldexpl" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_double_slash_root" >&5
+printf "%s\n" "$gl_cv_double_slash_root" >&6; }
+  if test "$gl_cv_double_slash_root" = yes; then
 
-else
-  HAVE_DECL_LDEXPL=0
-fi
+printf "%s\n" "#define DOUBLE_SLASH_IS_DISTINCT_ROOT 1" >>confdefs.h
 
-        ;;
-    esac
   fi
 
 
-  ac_fn_c_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
-"
-if test "x$ac_cv_have_decl_program_invocation_name" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl
-_ACEOF
 
-  ac_fn_c_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
-"
-if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl
-_ACEOF
+    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+      REPLACE_DUP=1
+    fi
 
 
-  :
 
 
 
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
 
+    if test $HAVE_FCHDIR = 0; then
+      REPLACE_DUP=1
+    fi
 
-  for ac_func in raise
-do :
-  ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise"
-if test "x$ac_cv_func_raise" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_RAISE 1
-_ACEOF
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5
+printf %s "checking whether dup works... " >&6; }
+if test ${gl_cv_func_dup_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                 # Guess no on native Windows.
+         mingw*) gl_cv_func_dup_works="guessing no" ;;
+         *)      gl_cv_func_dup_works="guessing yes" ;;
+       esac
 
-fi
-done
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+                         #include <fcntl.h>
+                         #include <errno.h>
 
-  if test $ac_cv_func_raise = no; then
-    HAVE_RAISE=0
-  else
-    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-      REPLACE_RAISE=1
-    fi
 
+$gl_mda_defines
 
+int
+main (void)
+{
+/* On OS/2 kLIBC, dup does not work on a directory fd.  */
+           int fd = open (".", O_RDONLY);
+           return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
 
+  ;
+  return 0;
+}
 
-  if test $gl_cv_type_sigset_t = yes; then
-    ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
-if test "x$ac_cv_func_sigprocmask" = xyes; then :
-  gl_cv_func_sigprocmask=1
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_dup_works=yes
+else $as_nop
+  gl_cv_func_dup_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-  fi
-  if test -z "$gl_cv_func_sigprocmask"; then
-    HAVE_POSIX_SIGNALBLOCKING=0
-  fi
-
-      if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5
+printf "%s\n" "$gl_cv_func_dup_works" >&6; }
+  case "$gl_cv_func_dup_works" in
+    *yes) ;;
+    *)
+      REPLACE_DUP=1
+      ;;
+  esac
 
+  if test $REPLACE_DUP = 1; then
 
 
-          if test $gl_cv_header_signal_h_SIGPIPE != yes; then
-            REPLACE_RAISE=1
-          fi
 
-      fi
 
-  fi
 
-  if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS dup.$ac_objext"
 
+    :
+  fi
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS raise.$ac_objext"
 
-    :
-  fi
 
 
 
 
+          GL_M4_GNULIB_DUP=1
 
-          GNULIB_RAISE=1
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_DUP 1" >>confdefs.h
 
-$as_echo "#define GNULIB_TEST_RAISE 1" >>confdefs.h
 
 
 
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether dup2 works" >&5
+printf %s "checking whether dup2 works... " >&6; }
+if test ${gl_cv_func_dup2_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+         mingw*) # on this platform, dup2 always returns 0 for success
+           gl_cv_func_dup2_works="guessing no" ;;
+         cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+           gl_cv_func_dup2_works="guessing no" ;;
+         aix* | freebsd*)
+                 # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
+                 # not EBADF.
+           gl_cv_func_dup2_works="guessing no" ;;
+         haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
+           gl_cv_func_dup2_works="guessing no" ;;
+         *-android*) # implemented using dup3(), which fails if oldfd == newfd
+           gl_cv_func_dup2_works="guessing no" ;;
+         os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
+           gl_cv_func_dup2_works="guessing no" ;;
+         *) gl_cv_func_dup2_works="guessing yes" ;;
+       esac
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+       #include <errno.h>
+           #include <fcntl.h>
+           #include <limits.h>
+           #include <sys/resource.h>
+           #include <unistd.h>
 
-  for ac_func in rawmemchr
-do :
-  ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr"
-if test "x$ac_cv_func_rawmemchr" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_RAWMEMCHR 1
-_ACEOF
 
-fi
-done
+$gl_mda_defines
 
-  if test $ac_cv_func_rawmemchr = no; then
-    HAVE_RAWMEMCHR=0
-  fi
+           #ifndef RLIM_SAVED_CUR
+           # define RLIM_SAVED_CUR RLIM_INFINITY
+           #endif
+           #ifndef RLIM_SAVED_MAX
+           # define RLIM_SAVED_MAX RLIM_INFINITY
+           #endif
 
-  if test $HAVE_RAWMEMCHR = 0; then
+int
+main (void)
+{
+int result = 0;
+           int bad_fd = INT_MAX;
+           struct rlimit rlim;
+           if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+               && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+               && rlim.rlim_cur != RLIM_INFINITY
+               && rlim.rlim_cur != RLIM_SAVED_MAX
+               && rlim.rlim_cur != RLIM_SAVED_CUR)
+             bad_fd = rlim.rlim_cur;
+           #ifdef FD_CLOEXEC
+             if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
+               result |= 1;
+           #endif
+           if (dup2 (1, 1) != 1)
+             result |= 2;
+           #ifdef FD_CLOEXEC
+             if (fcntl (1, F_GETFD) != FD_CLOEXEC)
+               result |= 4;
+           #endif
+           close (0);
+           if (dup2 (0, 0) != -1)
+             result |= 8;
+           /* Many gnulib modules require POSIX conformance of EBADF.  */
+           if (dup2 (2, bad_fd) == -1 && errno != EBADF)
+             result |= 16;
+           /* Flush out some cygwin core dumps.  */
+           if (dup2 (2, -1) != -1 || errno != EBADF)
+             result |= 32;
+           dup2 (2, 255);
+           dup2 (2, 256);
+           /* On OS/2 kLIBC, dup2() does not work on a directory fd.  */
+           {
+             int fd = open (".", O_RDONLY);
+             if (fd == -1)
+               result |= 64;
+             else if (dup2 (fd, fd + 1) == -1)
+               result |= 128;
+             close (fd);
+           }
+           return result;
+  ;
+  return 0;
+}
 
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_dup2_works=yes
+else $as_nop
+  gl_cv_func_dup2_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup2_works" >&5
+printf "%s\n" "$gl_cv_func_dup2_works" >&6; }
+  case "$gl_cv_func_dup2_works" in
+    *yes) ;;
+    *)
+      REPLACE_DUP2=1
+      ac_fn_c_check_func "$LINENO" "setdtablesize" "ac_cv_func_setdtablesize"
+if test "x$ac_cv_func_setdtablesize" = xyes
+then :
+  printf "%s\n" "#define HAVE_SETDTABLESIZE 1" >>confdefs.h
 
+fi
 
+      ;;
+  esac
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS rawmemchr.$ac_objext"
 
-    :
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
   fi
 
+    if test $HAVE_FCHDIR = 0; then
+      REPLACE_DUP2=1
+    fi
 
 
-
-
-          GNULIB_RAWMEMCHR=1
-
+  if test $REPLACE_DUP2 = 1; then
 
 
 
 
-$as_echo "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS dup2.$ac_objext"
 
 
-  if test $ac_cv_func_readlink = no; then
-    HAVE_READLINK=0
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
-$as_echo_n "checking whether readlink signature is correct... " >&6; }
-if ${gl_cv_decl_readlink_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <unistd.h>
-      /* Cause compilation failure if original declaration has wrong type.  */
-      ssize_t readlink (const char *, char *, size_t);
-int
-main ()
-{
+  fi
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_decl_readlink_works=yes
-else
-  gl_cv_decl_readlink_works=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
-$as_echo "$gl_cv_decl_readlink_works" >&6; }
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
-$as_echo_n "checking whether readlink handles trailing slash correctly... " >&6; }
-if ${gl_cv_func_readlink_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  # We have readlink, so assume ln -s works.
-       ln -s conftest.no-such conftest.link
-       ln -s conftest.link conftest.lnk2
-       if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-                    # Guess yes on glibc systems.
-            *-gnu*) gl_cv_func_readlink_works="guessing yes" ;;
-                    # If we don't know, assume the worst.
-            *)      gl_cv_func_readlink_works="guessing no" ;;
-          esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <unistd.h>
 
-int
-main ()
-{
-char buf[20];
-      return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_readlink_works=yes
-else
-  gl_cv_func_readlink_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-      rm -f conftest.link conftest.lnk2
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_works" >&5
-$as_echo "$gl_cv_func_readlink_works" >&6; }
-    case "$gl_cv_func_readlink_works" in
-      *yes)
-        if test "$gl_cv_decl_readlink_works" != yes; then
-          REPLACE_READLINK=1
-        fi
-        ;;
-      *)
 
-$as_echo "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
 
-        REPLACE_READLINK=1
-        ;;
-    esac
-  fi
 
-  if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
 
 
+          GL_M4_GNULIB_DUP2=1
 
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_DUP2 1" >>confdefs.h
 
-  M4_LIBOBJS="$M4_LIBOBJS readlink.$ac_objext"
 
 
-  :
 
-  fi
 
 
 
 
 
-          GNULIB_READLINK=1
 
 
 
 
+          GL_M4_GNULIB_ENVIRON=1
 
-$as_echo "#define GNULIB_TEST_READLINK 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_ENVIRON 1" >>confdefs.h
 
-# Check whether --with-included-regex was given.
-if test "${with_included_regex+set}" = set; then :
-  withval=$with_included_regex;
-fi
 
 
-  case $with_included_regex in #(
-  yes|no) ac_use_included_regex=$with_included_regex
-        ;;
-  '')
-    # If the system regex support is good enough that it passes the
-    # following run test, then default to *not* using the included regex.c.
-    # If cross compiling, assume the test would fail and use the included
-    # regex.c.
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5
-$as_echo_n "checking for working re_compile_pattern... " >&6; }
-if ${gl_cv_func_re_compile_pattern_working+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-         gl_cv_func_re_compile_pattern_working=no
-else
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for error_at_line" >&5
+printf %s "checking for error_at_line... " >&6; }
+if test ${ac_cv_lib_error_at_line+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <regex.h>
-
-            #include <locale.h>
-            #include <limits.h>
-            #include <string.h>
-
-            #if defined M_CHECK_ACTION || HAVE_DECL_ALARM
-            # include <signal.h>
-            # include <unistd.h>
-            #endif
-
-            #if HAVE_MALLOC_H
-            # include <malloc.h>
-            #endif
-
-            #ifdef M_CHECK_ACTION
-            /* Exit with distinguishable exit code.  */
-            static void sigabrt_no_core (int sig) { raise (SIGTERM); }
-            #endif
-
+#include <error.h>
 int
-main ()
+main (void)
 {
-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;
+error_at_line (0, 0, "", 0, "an error occurred");
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_lib_error_at_line=yes
+else $as_nop
+  ac_cv_lib_error_at_line=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_error_at_line" >&5
+printf "%s\n" "$ac_cv_lib_error_at_line" >&6; }
 
-            /* Some builds of glibc go into an infinite loop on this
-               test.  Use alarm to force death, and mallopt to avoid
-               malloc recursion in diagnosing the corrupted heap. */
-#if HAVE_DECL_ALARM
-            signal (SIGALRM, SIG_DFL);
-            alarm (2);
-#endif
-#ifdef M_CHECK_ACTION
-            signal (SIGABRT, sigabrt_no_core);
-            mallopt (M_CHECK_ACTION, 2);
-#endif
+  if test $ac_cv_lib_error_at_line = no; then
 
-            if (setlocale (LC_ALL, "en_US.UTF-8"))
-              {
-                {
-                  /* 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.  */
-                  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;
-                  regfree (&regex);
-                }
 
-                {
-                  /* This test is from glibc bug 15078.
-                     The test case is from Andreas Schwab in
-                     <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
-                     */
-                  static char const pat[] = "[^x]x";
-                  static char const data[] =
-                    /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */
-                    "\xe1\x80\x80"
-                    "\xe1\x80\xbb"
-                    "\xe1\x80\xbd"
-                    "\xe1\x80\x94"
-                    "\xe1\x80\xba"
-                    "\xe1\x80\xaf"
-                    "\xe1\x80\x95"
-                    "\xe1\x80\xba"
-                    "x";
-                  re_set_syntax (0);
-                  memset (&regex, 0, sizeof regex);
-                  s = re_compile_pattern (pat, sizeof pat - 1, &regex);
-                  if (s)
-                    result |= 1;
-                  else
-                    {
-                      i = re_search (&regex, data, sizeof data - 1,
-                                     0, sizeof data - 1, 0);
-                      if (i != 0 && i != 21)
-                        result |= 1;
-                    }
-                  regfree (&regex);
-                }
 
-                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)
-              result |= 2;
-            /* This should fail, but succeeds for glibc-2.5.  */
-            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.  */
-            re_set_syntax (RE_SYNTAX_POSIX_EGREP);
-            memset (&regex, 0, sizeof regex);
-            for (i = 0; i <= UCHAR_MAX; i++)
-              folded_chars[i] = i;
-            regex.translate = folded_chars;
-            s = re_compile_pattern ("a[[:]:]]b\n", 11, &regex);
-            /* This should fail with _Invalid character class name_ error.  */
-            if (!s)
-              result |= 4;
 
-            /* Ensure that [b-a] is diagnosed as invalid, when
-               using RE_NO_EMPTY_RANGES. */
-            re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
-            memset (&regex, 0, sizeof regex);
-            s = re_compile_pattern ("a[b-a]", 6, &regex);
-            if (s == 0)
-              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)
-              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)
-              result |= 8;
-            /* This should match, but does not for glibc-2.2.1.  */
-            else if (re_match (&regex, "an", 2, 0, &regs) != 2)
-              result |= 8;
+  M4_LIBOBJS="$M4_LIBOBJS error.$ac_objext"
 
-            memset (&regex, 0, sizeof regex);
-            s = re_compile_pattern ("x", 1, &regex);
-            if (s)
-              result |= 8;
-            /* glibc-2.2.93 does not work with a negative RANGE argument.  */
-            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.  */
-            re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
-            memset (&regex, 0, sizeof regex);
-            s = re_compile_pattern ("x", 1, &regex);
-            if (s)
-              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
-               */
-            re_set_syntax (RE_SYNTAX_POSIX_BASIC
-                           & ~RE_CONTEXT_INVALID_DUP
-                           & ~RE_NO_EMPTY_RANGES);
-            memset (&regex, 0, sizeof regex);
-            s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
-            if (s)
-              result |= 32;
+  :
 
-            /* REG_STARTEND was added to glibc on 2004-01-15.
-               Reject older versions.  */
-            if (! REG_STARTEND)
-              result |= 64;
+  fi
 
-#if 0
-            /* It would be nice to reject hosts whose regoff_t values are too
-               narrow (including glibc on hosts with 64-bit ptrdiff_t and
-               32-bit int), but we should wait until glibc implements this
-               feature.  Otherwise, support for equivalence classes and
-               multibyte collation symbols would always be broken except
-               when compiling --without-included-regex.   */
-            if (sizeof (regoff_t) < sizeof (ptrdiff_t)
-                || sizeof (regoff_t) < sizeof (ssize_t))
-              result |= 64;
-#endif
 
-            return result;
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error:3:c-format"
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_re_compile_pattern_working=yes
-else
-  gl_cv_func_re_compile_pattern_working=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5
-$as_echo "$gl_cv_func_re_compile_pattern_working" >&6; }
-    case $gl_cv_func_re_compile_pattern_working in #(
-    yes) ac_use_included_regex=no;; #(
-    no) ac_use_included_regex=yes;;
-    esac
-    ;;
-  *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5
-    ;;
-  esac
 
-  if test $ac_use_included_regex = yes; then
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=error_at_line:5:c-format"
 
-$as_echo "#define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h
 
 
-$as_echo "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h
 
 
-$as_echo "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h
 
 
-$as_echo "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h
 
+  :
 
-$as_echo "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h
 
 
-$as_echo "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h
 
 
-$as_echo "#define re_search rpl_re_search" >>confdefs.h
 
+  if test $ac_cv_have_decl_fchdir = no; then
+    HAVE_DECL_FCHDIR=0
+  fi
 
-$as_echo "#define re_search_2 rpl_re_search_2" >>confdefs.h
 
+  if test $HAVE_FCHDIR = 0; then
 
-$as_echo "#define re_match rpl_re_match" >>confdefs.h
 
 
-$as_echo "#define re_match_2 rpl_re_match_2" >>confdefs.h
 
 
-$as_echo "#define re_set_registers rpl_re_set_registers" >>confdefs.h
 
 
-$as_echo "#define re_comp rpl_re_comp" >>confdefs.h
 
+  M4_LIBOBJS="$M4_LIBOBJS fchdir.$ac_objext"
 
-$as_echo "#define re_exec rpl_re_exec" >>confdefs.h
+    :
 
+printf "%s\n" "#define REPLACE_FCHDIR 1" >>confdefs.h
 
-$as_echo "#define regcomp rpl_regcomp" >>confdefs.h
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open can visit directories" >&5
+printf %s "checking whether open can visit directories... " >&6; }
+if test ${gl_cv_func_open_directory_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                             # Guess yes on Linux systems.
+            linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
+                             # Guess yes on glibc systems.
+            *-gnu* | gnu*)   gl_cv_func_open_directory_works="guessing yes" ;;
+                             # Guess no on native Windows.
+            mingw*)          gl_cv_func_open_directory_works="guessing no" ;;
+                             # If we don't know, obey --enable-cross-guesses.
+            *)               gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
+          esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <fcntl.h>
 
-$as_echo "#define regexec rpl_regexec" >>confdefs.h
 
+$gl_mda_defines
 
-$as_echo "#define regerror rpl_regerror" >>confdefs.h
+int
+main (void)
+{
+return open(".", O_RDONLY) < 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_open_directory_works=yes
+else $as_nop
+  gl_cv_func_open_directory_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_directory_works" >&5
+printf "%s\n" "$gl_cv_func_open_directory_works" >&6; }
+    case "$gl_cv_func_open_directory_works" in
+      *yes) ;;
+      *)
 
-$as_echo "#define regfree rpl_regfree" >>confdefs.h
+printf "%s\n" "#define REPLACE_OPEN_DIRECTORY 1" >>confdefs.h
 
+        ;;
+    esac
   fi
 
-  if test $ac_use_included_regex = yes; then
-
 
 
 
@@ -29507,321 +33256,240 @@ $as_echo "#define regfree rpl_regfree" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS regex.$ac_objext"
 
 
+          GL_M4_GNULIB_FCHDIR=1
 
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_FCHDIR 1" >>confdefs.h
 
-  for ac_header in libintl.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
-if test "x$ac_cv_header_libintl_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBINTL_H 1
-_ACEOF
 
-fi
 
-done
 
 
-  ac_fn_c_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
-"
-if test "x$ac_cv_have_decl_isblank" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_ISBLANK $ac_have_decl
-_ACEOF
 
 
-  fi
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
+printf %s "checking whether fflush works on input streams... " >&6; }
+if test ${gl_cv_func_fflush_stdin+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  echo hello world > conftest.txt
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                  # Guess no on native Windows.
+          mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
+          *)      gl_cv_func_fflush_stdin=cross ;;
+        esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <stdio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
 
 
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5
-$as_echo_n "checking whether rename honors trailing slash on destination... " >&6; }
-if ${gl_cv_func_rename_slash_dst_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
-    touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
-      as_fn_error $? "cannot create temporary files" "$LINENO" 5
-    # Assume that if we have lstat, we can also check symlinks.
-    if test $ac_cv_func_lstat = yes; then
-      ln -s conftest.f conftest.lnk
-    fi
-    if test "$cross_compiling" = yes; then :
-        case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_rename_slash_dst_works="guessing no" ;;
-       esac
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#        include <stdio.h>
-#        include <stdlib.h>
+$gl_mda_defines
 
 int
-main ()
+main (void)
 {
-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)
-             result |= 4;
-#endif
-           return result;
+FILE *f = fopen ("conftest.txt", "r");
+         char buffer[10];
+         int fd;
+         int c;
+         if (f == NULL)
+           return 1;
+         fd = fileno (f);
+         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+           { fclose (f); return 2; }
+         /* For deterministic results, ensure f read a bigger buffer.  */
+         if (lseek (fd, 0, SEEK_CUR) == 5)
+           { fclose (f); return 3; }
+         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
+            on BSD systems and on mingw.  */
+         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+           { fclose (f); return 4; }
+         if (lseek (fd, 0, SEEK_CUR) != 5)
+           { fclose (f); return 5; }
+         /* Verify behaviour of fflush after ungetc. See
+            <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
+         /* Verify behaviour of fflush after a backup ungetc.  This fails on
+            mingw.  */
+         c = fgetc (f);
+         ungetc (c, f);
+         fflush (f);
+         if (fgetc (f) != c)
+           { fclose (f); return 6; }
+         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
+            on glibc 2.8 and on BSD systems.  */
+         c = fgetc (f);
+         ungetc ('@', f);
+         fflush (f);
+         if (fgetc (f) != c)
+           { fclose (f); return 7; }
+         fclose (f);
+         return 0;
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_rename_slash_dst_works=yes
-else
-  gl_cv_func_rename_slash_dst_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fflush_stdin=yes
+else $as_nop
+  gl_cv_func_fflush_stdin=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-    rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
+     rm conftest.txt
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5
-$as_echo "$gl_cv_func_rename_slash_dst_works" >&6; }
-  case "$gl_cv_func_rename_slash_dst_works" in
-    *yes) ;;
-    *)
-      REPLACE_RENAME=1
-
-$as_echo "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h
-
-      ;;
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
+printf "%s\n" "$gl_cv_func_fflush_stdin" >&6; }
+  case "$gl_cv_func_fflush_stdin" in
+    *yes) gl_func_fflush_stdin=1 ;;
+    *no)  gl_func_fflush_stdin=0 ;;
+    *)    gl_func_fflush_stdin='(-1)' ;;
   esac
 
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5
-$as_echo_n "checking whether rename honors trailing slash on source... " >&6; }
-if ${gl_cv_func_rename_slash_src_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
-    touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
-      as_fn_error $? "cannot create temporary files" "$LINENO" 5
-    # Assume that if we have lstat, we can also check symlinks.
-    if test $ac_cv_func_lstat = yes; then
-      ln -s conftest.f conftest.lnk
-    fi
-    if test "$cross_compiling" = yes; then :
-        case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_rename_slash_src_works="guessing no" ;;
-       esac
-
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#        include <stdio.h>
-#        include <stdlib.h>
-
-int
-main ()
-{
-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)
-             result |= 4;
-#endif
-           return result;
-
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_rename_slash_src_works=yes
-else
-  gl_cv_func_rename_slash_src_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+printf "%s\n" "#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin" >>confdefs.h
 
-    rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5
-$as_echo "$gl_cv_func_rename_slash_src_works" >&6; }
-  case "$gl_cv_func_rename_slash_src_works" in
+  case "$gl_cv_func_fflush_stdin" in
     *yes) ;;
-    *)
-      REPLACE_RENAME=1
+    *) REPLACE_FCLOSE=1 ;;
+  esac
 
-$as_echo "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h
 
-      ;;
+  if test $REPLACE_CLOSE = 1; then
+    REPLACE_FCLOSE=1
+  fi
+
+  case "$host_os" in
+    openedition) REPLACE_FCLOSE=1 ;;
   esac
 
+  if test $REPLACE_FCLOSE = 0; then
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5
-$as_echo_n "checking whether rename manages hard links correctly... " >&6; }
-if ${gl_cv_func_rename_link_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test $ac_cv_func_link = yes; then
-       rm -rf conftest.f conftest.f1
-       if touch conftest.f && ln conftest.f conftest.f1 &&
-           set x `ls -i conftest.f conftest.f1` && test "" = ""; then
-         if test "$cross_compiling" = yes; then :
-             case "$host_os" in
-                      # Guess yes on glibc systems.
-              *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
-                      # If we don't know, assume the worst.
-              *)      gl_cv_func_rename_link_works="guessing no" ;;
-            esac
 
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fclose works on input streams" >&5
+printf %s "checking whether fclose works on input streams... " >&6; }
+if test ${gl_cv_func_fclose_stdin+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  echo hello world > conftest.txt
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                         # Guess no on glibc systems.
+          *-gnu* | gnu*) gl_cv_func_fclose_stdin="guessing no" ;;
+                         # Guess yes on musl systems.
+          *-musl*)       gl_cv_func_fclose_stdin="guessing yes" ;;
+                         # Guess no on native Windows.
+          mingw*)        gl_cv_func_fclose_stdin="guessing no" ;;
+                         # If we don't know, obey --enable-cross-guesses.
+          *)             gl_cv_func_fclose_stdin="$gl_cross_guess_normal" ;;
+        esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <fcntl.h>
+            #include <stdio.h>
+            #if HAVE_UNISTD_H
+            # include <unistd.h>
+            #else /* on Windows with MSVC */
+            # include <io.h>
+            #endif
+
 
-#             include <stdio.h>
-#             include <stdlib.h>
-#             include <unistd.h>
+$gl_mda_defines
 
 int
-main ()
+main (void)
 {
-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;
+int fd;
+            int fd2;
+            FILE *fp;
+            fd = open ("conftest.txt", O_RDONLY);
+            if (fd < 0)
+              return 1;
+            if (lseek (fd, 1, SEEK_SET) != 1)
+              return 2;
+            fd2 = dup (fd);
+            if (fd2 < 0)
+              return 3;
+            fp = fdopen (fd2, "r");
+            if (fp == NULL)
+              return 4;
+            if (fgetc (fp) != 'e')
+              { fclose (fp); return 5; }
+            /* This fclose() call should reposition the underlying file
+               descriptor.  */
+            if (fclose (fp) != 0)
+              return 6;
+            if (lseek (fd2, 0, SEEK_CUR) != -1) /* should fail with EBADF */
+              return 7;
+            /* Verify the file position.  */
+            if (lseek (fd, 0, SEEK_CUR) != 2)
+              return 8;
+            return 0;
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_rename_link_works=yes
-else
-  gl_cv_func_rename_link_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fclose_stdin=yes
+else $as_nop
+  gl_cv_func_fclose_stdin=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-       else
-         gl_cv_func_rename_link_works="guessing no"
-       fi
-       rm -rf conftest.f conftest.f1
-     else
-       gl_cv_func_rename_link_works=yes
-     fi
+     rm conftest.txt
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5
-$as_echo "$gl_cv_func_rename_link_works" >&6; }
-  case "$gl_cv_func_rename_link_works" in
-    *yes) ;;
-    *)
-      REPLACE_RENAME=1
-
-$as_echo "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fclose_stdin" >&5
+printf "%s\n" "$gl_cv_func_fclose_stdin" >&6; }
 
-      ;;
-  esac
+    case "$gl_cv_func_fclose_stdin" in
+      *yes) ;;
+      *) REPLACE_FCLOSE=1 ;;
+    esac
+  fi
 
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5
-$as_echo_n "checking whether rename manages existing destinations correctly... " >&6; }
-if ${gl_cv_func_rename_dest_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  rm -rf conftest.f conftest.d1 conftest.d2
-    touch conftest.f && mkdir conftest.d1 conftest.d2 ||
-      as_fn_error $? "cannot create temporary files" "$LINENO" 5
-    if test "$cross_compiling" = yes; then :
-        case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_rename_dest_works="guessing no" ;;
-       esac
+  if test $REPLACE_FCLOSE = 1; then
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#        include <stdio.h>
-#        include <stdlib.h>
 
-int
-main ()
-{
-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;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_rename_dest_works=yes
-else
-  gl_cv_func_rename_dest_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-    rm -rf conftest.f conftest.d1 conftest.d2
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5
-$as_echo "$gl_cv_func_rename_dest_works" >&6; }
-  case "$gl_cv_func_rename_dest_works" in
-    *yes) ;;
-    *)
-      REPLACE_RENAME=1
 
-$as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
 
-      ;;
-  esac
+  M4_LIBOBJS="$M4_LIBOBJS fclose.$ac_objext"
 
-  if test $REPLACE_RENAME = 1; then
+  fi
 
 
 
@@ -29830,417 +33498,738 @@ $as_echo "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS rename.$ac_objext"
 
-  fi
+          GL_M4_GNULIB_FCLOSE=1
 
 
 
 
 
-          GNULIB_RENAME=1
+printf "%s\n" "#define GNULIB_TEST_FCLOSE 1" >>confdefs.h
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_RENAME 1" >>confdefs.h
 
 
 
+  if test $ac_cv_func_fcntl = no; then
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
-$as_echo_n "checking whether rmdir works... " >&6; }
-if ${gl_cv_func_rmdir_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  mkdir conftest.dir
-     touch conftest.file
-     if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-                  # Guess yes on glibc systems.
-          *-gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
-                  # If we don't know, assume the worst.
-          *)      gl_cv_func_rmdir_works="guessing no" ;;
-        esac
+  if test $ac_cv_func_fcntl = no; then
+    HAVE_FCNTL=0
+  else
+    REPLACE_FCNTL=1
+  fi
 
-else
+  else
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl handles F_DUPFD correctly" >&5
+printf %s "checking whether fcntl handles F_DUPFD correctly... " >&6; }
+if test ${gl_cv_func_fcntl_f_dupfd_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case $host_os in
+            aix* | cygwin* | haiku*)
+               gl_cv_func_fcntl_f_dupfd_works="guessing no" ;;
+            *) gl_cv_func_fcntl_f_dupfd_works="guessing yes" ;;
+          esac
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdio.h>
-           #include <errno.h>
-           #if HAVE_UNISTD_H
-           # include <unistd.h>
-           #else /* on Windows with MSVC */
-           # include <direct.h>
-           #endif
+#include <errno.h>
+              #include <fcntl.h>
+              #include <limits.h>
+              #include <sys/resource.h>
+              #include <unistd.h>
+
+
+$gl_mda_defines
+
+              #ifndef RLIM_SAVED_CUR
+              # define RLIM_SAVED_CUR RLIM_INFINITY
+              #endif
+              #ifndef RLIM_SAVED_MAX
+              # define RLIM_SAVED_MAX RLIM_INFINITY
+              #endif
 
 int
-main ()
+main (void)
 {
 int result = 0;
-      if (!rmdir ("conftest.file/"))
-        result |= 1;
-      else if (errno != ENOTDIR)
-        result |= 2;
-      if (!rmdir ("conftest.dir/./"))
-        result |= 4;
-      return result;
+              int bad_fd = INT_MAX;
+              struct rlimit rlim;
+              if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+                  && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+                  && rlim.rlim_cur != RLIM_INFINITY
+                  && rlim.rlim_cur != RLIM_SAVED_MAX
+                  && rlim.rlim_cur != RLIM_SAVED_CUR)
+                bad_fd = rlim.rlim_cur;
+              if (fcntl (0, F_DUPFD, -1) != -1) result |= 1;
+              if (errno != EINVAL) result |= 2;
+              if (fcntl (0, F_DUPFD, bad_fd) != -1) result |= 4;
+              if (errno != EINVAL) result |= 8;
+              /* On OS/2 kLIBC, F_DUPFD does not work on a directory fd */
+              {
+                int fd;
+                fd = open (".", O_RDONLY);
+                if (fd == -1)
+                  result |= 16;
+                else if (fcntl (fd, F_DUPFD, STDERR_FILENO + 1) == -1)
+                  result |= 32;
 
+                close (fd);
+              }
+              return result;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_rmdir_works=yes
-else
-  gl_cv_func_rmdir_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fcntl_f_dupfd_works=yes
+else $as_nop
+  gl_cv_func_fcntl_f_dupfd_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-     rm -rf conftest.dir conftest.file
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
-$as_echo "$gl_cv_func_rmdir_works" >&6; }
-  case "$gl_cv_func_rmdir_works" in
-    *yes) ;;
-    *)
-      REPLACE_RMDIR=1
-      ;;
-  esac
-
-  if test $REPLACE_RMDIR = 1; then
-
-
-
-
-
-
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_works" >&5
+printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_works" >&6; }
+    case $gl_cv_func_fcntl_f_dupfd_works in
+      *yes) ;;
+      *)
 
-  M4_LIBOBJS="$M4_LIBOBJS rmdir.$ac_objext"
 
+  if test $ac_cv_func_fcntl = no; then
+    HAVE_FCNTL=0
+  else
+    REPLACE_FCNTL=1
   fi
 
 
+printf "%s\n" "#define FCNTL_DUPFD_BUGGY 1" >>confdefs.h
+ ;;
+    esac
 
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fcntl understands F_DUPFD_CLOEXEC" >&5
+printf %s "checking whether fcntl understands F_DUPFD_CLOEXEC... " >&6; }
+if test ${gl_cv_func_fcntl_f_dupfd_cloexec+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                     # Guess no on NetBSD.
+            netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
+            *)       gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;;
+          esac
 
-
-          GNULIB_RMDIR=1
-
-
-
-
-
-$as_echo "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
-
-
-
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <fcntl.h>
+              #include <unistd.h>
+              int main (int argc, char *argv[])
+              {
+                if (argc == 1)
+                  /* parent process */
+                  {
+                    if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
+                      return 1;
+                    return execl ("./conftest", "./conftest", "child", NULL);
+                  }
+                else
+                  /* child process */
+                  return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
+              }
 
 
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-       #include <sched.h>
-       struct sched_param a;
-       int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER };
-       pid_t t1;
+#ifdef __linux__
+/* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
+   it to support the semantics on older kernels that failed with EINVAL.  */
+choke me
+#endif
 
 int
-main ()
+main (void)
 {
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  SCHED_H=''
-else
-  SCHED_H='sched.h'
-     for ac_header in sched.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "sched.h" "ac_cv_header_sched_h" "#if HAVE_SYS_CDEFS_H
-          #include <sys/cdefs.h>
-         #endif
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_fcntl_f_dupfd_cloexec=yes
+else $as_nop
+  gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+else $as_nop
+  gl_cv_func_fcntl_f_dupfd_cloexec=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-"
-if test "x$ac_cv_header_sched_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SCHED_H 1
-_ACEOF
 
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fcntl_f_dupfd_cloexec" >&5
+printf "%s\n" "$gl_cv_func_fcntl_f_dupfd_cloexec" >&6; }
+    case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
+      *yes) ;;
+      *)
 
-done
 
+  if test $ac_cv_func_fcntl = no; then
+    HAVE_FCNTL=0
+  else
+    REPLACE_FCNTL=1
+  fi
 
+                        ;;
+    esac
+  fi
 
 
 
 
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
 
+    if test $HAVE_FCHDIR = 0; then
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_sched_h='<'sched.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sched.h>" >&5
-$as_echo_n "checking absolute name of <sched.h>... " >&6; }
-if ${gl_cv_next_sched_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
+  if test $ac_cv_func_fcntl = no; then
+    HAVE_FCNTL=0
+  else
+    REPLACE_FCNTL=1
+  fi
 
+    fi
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sched.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'sched.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
+  if test $HAVE_FCNTL = 0 || test $REPLACE_FCNTL = 1; then
 
-        gl_cv_absolute_sched_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_sched_h
-           gl_cv_next_sched_h='"'$gl_header'"'
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sched_h" >&5
-$as_echo "$gl_cv_next_sched_h" >&6; }
-     fi
-     NEXT_SCHED_H=$gl_cv_next_sched_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='<'sched.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_sched_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_SCHED_H=$gl_next_as_first_directive
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS fcntl.$ac_objext"
 
+  fi
 
-     if test "$ac_cv_header_sched_h" = yes; then
-       HAVE_SCHED_H=1
-     else
-       HAVE_SCHED_H=0
-     fi
 
 
-     if test "$HAVE_SCHED_H" = 1; then
-       ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#if HAVE_SYS_CDEFS_H
-            #include <sys/cdefs.h>
-           #endif
-           #include <sched.h>
 
-"
-if test "x$ac_cv_type_struct_sched_param" = xyes; then :
-  HAVE_STRUCT_SCHED_PARAM=1
-else
-  HAVE_STRUCT_SCHED_PARAM=0
-fi
 
-     else
-              ac_fn_c_check_type "$LINENO" "struct sched_param" "ac_cv_type_struct_sched_param" "#include <spawn.h>
-"
-if test "x$ac_cv_type_struct_sched_param" = xyes; then :
-  HAVE_STRUCT_SCHED_PARAM=1
-else
-  HAVE_STRUCT_SCHED_PARAM=0
-fi
 
-     fi
 
 
-     if test "$ac_cv_header_sys_cdefs_h" = yes; then
-       HAVE_SYS_CDEFS_H=1
-     else
-       HAVE_SYS_CDEFS_H=0
-     fi
 
+          GL_M4_GNULIB_FCNTL=1
 
 
 
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-   if test -n "$SCHED_H"; then
-  GL_GENERATE_SCHED_H_TRUE=
-  GL_GENERATE_SCHED_H_FALSE='#'
-else
-  GL_GENERATE_SCHED_H_TRUE='#'
-  GL_GENERATE_SCHED_H_FALSE=
-fi
 
+printf "%s\n" "#define GNULIB_TEST_FCNTL 1" >>confdefs.h
 
 
 
 
 
 
-  if test $ac_cv_func_secure_getenv = no; then
-    HAVE_SECURE_GETENV=0
-  fi
 
-  if test $HAVE_SECURE_GETENV = 0; then
 
 
 
 
+printf "%s\n" "#define GNULIB_FD_SAFER_FLAG 1" >>confdefs.h
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS secure_getenv.$ac_objext"
 
 
-  for ac_func in __secure_getenv
-do :
-  ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv"
-if test "x$ac_cv_func___secure_getenv" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE___SECURE_GETENV 1
-_ACEOF
 
-fi
-done
+    ac_fn_check_decl "$LINENO" "fdopendir" "ac_cv_have_decl_fdopendir" "
+#include <dirent.h>
 
-  if test $ac_cv_func___secure_getenv = no; then
-    for ac_func in issetugid
-do :
-  ac_fn_c_check_func "$LINENO" "issetugid" "ac_cv_func_issetugid"
-if test "x$ac_cv_func_issetugid" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_ISSETUGID 1
-_ACEOF
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fdopendir" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_FDOPENDIR $ac_have_decl" >>confdefs.h
+if test $ac_have_decl = 1
+then :
 
+else $as_nop
+  HAVE_DECL_FDOPENDIR=0
 fi
-done
 
-  fi
 
+  if test $ac_cv_func_fdopendir = no; then
+    HAVE_FDOPENDIR=0
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fdopendir works" >&5
+printf %s "checking whether fdopendir works... " >&6; }
+if test ${gl_cv_func_fdopendir_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                     # Guess yes on glibc systems.
+            *-gnu*)  gl_cv_func_fdopendir_works="guessing yes" ;;
+                     # Guess yes on musl systems.
+            *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
+                     # If we don't know, obey --enable-cross-guesses.
+            *)       gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
+          esac
 
-  fi
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <dirent.h>
+#include <fcntl.h>
+#include <unistd.h>
 
 
+$gl_mda_defines
 
+#if !HAVE_DECL_FDOPENDIR
+extern
+# ifdef __cplusplus
+"C"
+# endif
+DIR *fdopendir (int);
+#endif
 
-          GNULIB_SECURE_GETENV=1
+int
+main (void)
+{
+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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fdopendir_works=yes
+else $as_nop
+  gl_cv_func_fdopendir_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopendir_works" >&5
+printf "%s\n" "$gl_cv_func_fdopendir_works" >&6; }
+    case "$gl_cv_func_fdopendir_works" in
+      *yes) ;;
+      *)
+        REPLACE_FDOPENDIR=1
+        ;;
+    esac
+  fi
 
+  if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
 
 
-$as_echo "#define GNULIB_TEST_SECURE_GETENV 1" >>confdefs.h
 
 
 
 
 
 
-  if test $ac_cv_func_sigaction = yes; then
-    ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include <signal.h>
-"
-if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes; then :
+  M4_LIBOBJS="$M4_LIBOBJS fdopendir.$ac_objext"
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1
-_ACEOF
+  fi
 
 
-fi
 
-    if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then
-      HAVE_STRUCT_SIGACTION_SA_SIGACTION=0
-    fi
-  else
-    HAVE_SIGACTION=0
-  fi
 
-  if test $HAVE_SIGACTION = 0; then
 
 
 
 
 
+          GL_M4_GNULIB_FDOPENDIR=1
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS sigaction.$ac_objext"
 
 
+printf "%s\n" "#define GNULIB_TEST_FDOPENDIR 1" >>confdefs.h
 
 
 
 
 
-  ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" "
-#include <signal.h>
+printf "%s\n" "#define GNULIB_FDOPENDIR 1" >>confdefs.h
 
-"
-if test "x$ac_cv_type_siginfo_t" = xyes; then :
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_SIGINFO_T 1
-_ACEOF
 
 
-fi
 
-  if test $ac_cv_type_siginfo_t = no; then
-    HAVE_SIGINFO_T=0
-  fi
 
-  fi
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
+printf %s "checking whether fflush works on input streams... " >&6; }
+if test ${gl_cv_func_fflush_stdin+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  echo hello world > conftest.txt
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                  # Guess no on native Windows.
+          mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
+          *)      gl_cv_func_fflush_stdin=cross ;;
+        esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <stdio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
 
 
+$gl_mda_defines
+
+int
+main (void)
+{
+FILE *f = fopen ("conftest.txt", "r");
+         char buffer[10];
+         int fd;
+         int c;
+         if (f == NULL)
+           return 1;
+         fd = fileno (f);
+         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+           { fclose (f); return 2; }
+         /* For deterministic results, ensure f read a bigger buffer.  */
+         if (lseek (fd, 0, SEEK_CUR) == 5)
+           { fclose (f); return 3; }
+         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
+            on BSD systems and on mingw.  */
+         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+           { fclose (f); return 4; }
+         if (lseek (fd, 0, SEEK_CUR) != 5)
+           { fclose (f); return 5; }
+         /* Verify behaviour of fflush after ungetc. See
+            <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
+         /* Verify behaviour of fflush after a backup ungetc.  This fails on
+            mingw.  */
+         c = fgetc (f);
+         ungetc (c, f);
+         fflush (f);
+         if (fgetc (f) != c)
+           { fclose (f); return 6; }
+         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
+            on glibc 2.8 and on BSD systems.  */
+         c = fgetc (f);
+         ungetc ('@', f);
+         fflush (f);
+         if (fgetc (f) != c)
+           { fclose (f); return 7; }
+         fclose (f);
+         return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fflush_stdin=yes
+else $as_nop
+  gl_cv_func_fflush_stdin=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+     rm conftest.txt
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
+printf "%s\n" "$gl_cv_func_fflush_stdin" >&6; }
+  case "$gl_cv_func_fflush_stdin" in
+    *yes) gl_func_fflush_stdin=1 ;;
+    *no)  gl_func_fflush_stdin=0 ;;
+    *)    gl_func_fflush_stdin='(-1)' ;;
+  esac
+
+printf "%s\n" "#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin" >>confdefs.h
+
+
+  case "$gl_cv_func_fflush_stdin" in
+    *yes) ;;
+    *) REPLACE_FFLUSH=1 ;;
+  esac
+
+  if test $REPLACE_FFLUSH = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS fflush.$ac_objext"
+
+    :
+  fi
+
+
+printf "%s\n" "#define GNULIB_FFLUSH 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_FFLUSH=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FFLUSH 1" >>confdefs.h
+
+
+
+
+
+
+
+
+printf "%s\n" "#define GNULIB_FILENAMECAT 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
+printf %s "checking for flexible array member... " >&6; }
+if test ${ac_cv_c_flexmember+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+            #include <stdio.h>
+            #include <stddef.h>
+            struct m { struct m *next, **list; char name[]; };
+            struct s { struct s *p; struct m *m; int n; double d[]; };
+int
+main (void)
+{
+int m = getchar ();
+            size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
+            nbytes += sizeof (struct s) - 1;
+            nbytes -= nbytes % sizeof (struct s);
+            struct s *p = malloc (nbytes);
+            p->p = p;
+            p->m = NULL;
+            p->d[0] = 0.0;
+            return p->d != (double *) NULL;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_flexmember=yes
+else $as_nop
+  ac_cv_c_flexmember=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
+printf "%s\n" "$ac_cv_c_flexmember" >&6; }
+  if test $ac_cv_c_flexmember = yes; then
+
+printf "%s\n" "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
+
+  else
+    printf "%s\n" "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
+
+  fi
+
 
-          GNULIB_SIGACTION=1
 
 
+  FLOAT_H=
+  REPLACE_FLOAT_LDBL=0
+  case "$host_os" in
+    aix* | beos* | openbsd* | mirbsd* | irix*)
+      FLOAT_H=float.h
+      ;;
+    freebsd* | dragonfly*)
+      case "$host_cpu" in
+        i[34567]86 )
+          FLOAT_H=float.h
+          ;;
+        x86_64 )
+          # On x86_64 systems, the C compiler may still be generating
+          # 32-bit code.
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+                  int ok;
+                 #else
+                  error fail
+                 #endif
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
 
+else $as_nop
+  FLOAT_H=float.h
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+          ;;
+      esac
+      ;;
+    linux*)
+      case "$host_cpu" in
+        powerpc*)
+          FLOAT_H=float.h
+          ;;
+      esac
+      ;;
+  esac
+  case "$host_os" in
+    aix* | freebsd* | dragonfly* | linux*)
+      if test -n "$FLOAT_H"; then
+        REPLACE_FLOAT_LDBL=1
+      fi
+      ;;
+  esac
 
-$as_echo "#define GNULIB_TEST_SIGACTION 1" >>confdefs.h
+    REPLACE_ITOLD=0
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether conversion from 'int' to 'long double' works" >&5
+printf %s "checking whether conversion from 'int' to 'long double' works... " >&6; }
+if test ${gl_cv_func_itold_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+  case "$host" in
+           sparc*-*-linux*)
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined __LP64__ || defined __arch64__
+                    int ok;
+                   #else
+                    error fail
+                   #endif
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_itold_works="guessing no"
+else $as_nop
+  gl_cv_func_itold_works="guessing yes"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+             ;;
+                   # Guess yes on native Windows.
+           mingw*) gl_cv_func_itold_works="guessing yes" ;;
+           *)      gl_cv_func_itold_works="guessing yes" ;;
+         esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+int i = -1;
+volatile long double ld;
+int main ()
+{
+  ld += i * 1.0L;
+  if (ld > 0)
+    return 1;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_itold_works=yes
+else $as_nop
+  gl_cv_func_itold_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_itold_works" >&5
+printf "%s\n" "$gl_cv_func_itold_works" >&6; }
+  case "$gl_cv_func_itold_works" in
+    *no)
+      REPLACE_ITOLD=1
+                  FLOAT_H=float.h
+      ;;
+  esac
 
+  if test -n "$FLOAT_H"; then
 
 
 
@@ -30250,19 +34239,20 @@ $as_echo "#define GNULIB_TEST_SIGACTION 1" >>confdefs.h
 
 
      if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_signal_h='<'signal.h'>'
+       gl_cv_next_float_h='<'float.h'>'
      else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <signal.h>" >&5
-$as_echo_n "checking absolute name of <signal.h>... " >&6; }
-if ${gl_cv_next_signal_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <float.h>" >&5
+printf %s "checking absolute name of <float.h>... " >&6; }
+if test ${gl_cv_next_float_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
 
 
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <signal.h>
+#include <float.h>
 _ACEOF
                 case "$host_os" in
     aix*) gl_absname_cpp="$ac_cpp -C" ;;
@@ -30278,7 +34268,7 @@ _ACEOF
       ;;
   esac
       gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'signal.h' \
+  gl_header_literal_regex=`echo 'float.h' \
                            | sed -e "$gl_make_literal_regex_sed"`
   gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
       s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
@@ -30287,784 +34277,492 @@ _ACEOF
       q
     }'
 
-        gl_cv_absolute_signal_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+        gl_cv_absolute_float_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
   sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_signal_h
-           gl_cv_next_signal_h='"'$gl_header'"'
+           gl_header=$gl_cv_absolute_float_h
+           gl_cv_next_float_h='"'$gl_header'"'
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_signal_h" >&5
-$as_echo "$gl_cv_next_signal_h" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_float_h" >&5
+printf "%s\n" "$gl_cv_next_float_h" >&6; }
      fi
-     NEXT_SIGNAL_H=$gl_cv_next_signal_h
+     NEXT_FLOAT_H=$gl_cv_next_float_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='<'signal.h'>'
+       gl_next_as_first_directive='<'float.h'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_signal_h
+       gl_next_as_first_directive=$gl_cv_next_float_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H=$gl_next_as_first_directive
-
-
+     NEXT_AS_FIRST_DIRECTIVE_FLOAT_H=$gl_next_as_first_directive
 
 
 
-# AIX declares sig_atomic_t to already include volatile, and C89 compilers
-# then choke on 'volatile sig_atomic_t'.  C99 requires that it compile.
-  ac_fn_c_check_type "$LINENO" "volatile sig_atomic_t" "ac_cv_type_volatile_sig_atomic_t" "
-#include <signal.h>
 
-"
-if test "x$ac_cv_type_volatile_sig_atomic_t" = xyes; then :
+  fi
 
+   if test -n "$FLOAT_H"; then
+  GL_GENERATE_FLOAT_H_TRUE=
+  GL_GENERATE_FLOAT_H_FALSE='#'
 else
-  HAVE_TYPE_VOLATILE_SIG_ATOMIC_T=0
+  GL_GENERATE_FLOAT_H_TRUE='#'
+  GL_GENERATE_FLOAT_H_FALSE=
 fi
 
 
 
+  if test $REPLACE_FLOAT_LDBL = 1; then
 
 
 
 
-  ac_fn_c_check_type "$LINENO" "sighandler_t" "ac_cv_type_sighandler_t" "
-#include <signal.h>
 
-"
-if test "x$ac_cv_type_sighandler_t" = xyes; then :
 
-else
-  HAVE_SIGHANDLER_T=0
-fi
 
 
+  M4_LIBOBJS="$M4_LIBOBJS float.$ac_objext"
 
+  fi
+  if test $REPLACE_ITOLD = 1; then
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit macro" >&5
-$as_echo_n "checking for signbit macro... " >&6; }
-if ${gl_cv_func_signbit+:} false; 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_signbit="guessing yes" ;;
-                   # If we don't know, assume the worst.
-           *)      gl_cv_func_signbit="guessing no" ;;
-         esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <math.h>
-/* If signbit is defined as a function, don't use it, since calling it for
-   'float' or 'long double' arguments would involve conversions.
-   If signbit is not declared at all but exists as a library function, don't
-   use it, since the prototype may not match.
-   If signbit is not declared at all but exists as a compiler built-in, don't
-   use it, since it's preferable to use __builtin_signbit* (no warnings,
-   no conversions).  */
-#ifndef signbit
-# error "signbit should be a macro"
-#endif
-#include <string.h>
 
-/* Global variables.
-   Needed because GCC 4 constant-folds __builtin_signbitl (literal)
-   but cannot constant-fold            __builtin_signbitl (variable).  */
-float vf;
-double vd;
-long double vl;
-int main ()
-{
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
-   So we use -p0f and -p0d instead.  */
-float p0f = 0.0f;
-float m0f = -p0f;
-double p0d = 0.0;
-double m0d = -p0d;
-/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
-   So we use another constant expression instead.
-   But that expression does not work on other platforms, such as when
-   cross-compiling to PowerPC on Mac OS X 10.5.  */
-long double p0l = 0.0L;
-#if defined __hpux || defined __sgi
-long double m0l = -LDBL_MIN * LDBL_MIN;
-#else
-long double m0l = -p0l;
-#endif
-  int result = 0;
-  if (signbit (vf)) /* link check */
-    vf++;
-  {
-    float plus_inf = 1.0f / p0f;
-    float minus_inf = -1.0f / p0f;
-    if (!(!signbit (255.0f)
-          && signbit (-255.0f)
-          && !signbit (p0f)
-          && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      result |= 1;
-  }
-  if (signbit (vd)) /* link check */
-    vd++;
-  {
-    double plus_inf = 1.0 / p0d;
-    double minus_inf = -1.0 / p0d;
-    if (!(!signbit (255.0)
-          && signbit (-255.0)
-          && !signbit (p0d)
-          && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      result |= 2;
-  }
-  if (signbit (vl)) /* link check */
-    vl++;
-  {
-    long double plus_inf = 1.0L / p0l;
-    long double minus_inf = -1.0L / p0l;
-    if (signbit (255.0L))
-      result |= 4;
-    if (!signbit (-255.0L))
-      result |= 4;
-    if (signbit (p0l))
-      result |= 8;
-    if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
-      result |= 16;
-    if (signbit (plus_inf))
-      result |= 32;
-    if (!signbit (minus_inf))
-      result |= 64;
-  }
-  return result;
-}
 
+  M4_LIBOBJS="$M4_LIBOBJS itold.$ac_objext"
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_signbit=yes
-else
-  gl_cv_func_signbit=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit" >&5
-$as_echo "$gl_cv_func_signbit" >&6; }
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for signbit compiler built-ins" >&5
-$as_echo_n "checking for signbit compiler built-ins... " >&6; }
-if ${gl_cv_func_signbit_gcc+:} false; 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_signbit_gcc="guessing yes" ;;
-                   # If we don't know, assume the worst.
-           *)      gl_cv_func_signbit_gcc="guessing no" ;;
-         esac
+    mingw* | pw*)
+            REPLACE_FOPEN=1
+            gl_cv_func_fopen_slash="guessing no"
+      ;;
+    *)
+                  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fopen recognizes a trailing slash" >&5
+printf %s "checking whether fopen recognizes a trailing slash... " >&6; }
+if test ${gl_cv_func_fopen_slash+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-else
+          if test "$cross_compiling" = yes
+then :
+
+             case "$host_os" in
+               aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+                 gl_cv_func_fopen_slash="guessing no" ;;
+               *)
+                 gl_cv_func_fopen_slash="guessing yes" ;;
+             esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#if __GNUC__ >= 4
-# define signbit(x) \
-   (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
-    sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
-    __builtin_signbitf (x))
-#else
-# error "signbit should be three compiler built-ins"
-#endif
-#include <string.h>
-
-/* Global variables.
-   Needed because GCC 4 constant-folds __builtin_signbitl (literal)
-   but cannot constant-fold            __builtin_signbitl (variable).  */
-float vf;
-double vd;
-long double vl;
+#include <stddef.h>
+#include <stdio.h>
 int main ()
 {
-/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
-   So we use -p0f and -p0d instead.  */
-float p0f = 0.0f;
-float m0f = -p0f;
-double p0d = 0.0;
-double m0d = -p0d;
-/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
-   So we use another constant expression instead.
-   But that expression does not work on other platforms, such as when
-   cross-compiling to PowerPC on Mac OS X 10.5.  */
-long double p0l = 0.0L;
-#if defined __hpux || defined __sgi
-long double m0l = -LDBL_MIN * LDBL_MIN;
-#else
-long double m0l = -p0l;
-#endif
-  int result = 0;
-  if (signbit (vf)) /* link check */
-    vf++;
-  {
-    float plus_inf = 1.0f / p0f;
-    float minus_inf = -1.0f / p0f;
-    if (!(!signbit (255.0f)
-          && signbit (-255.0f)
-          && !signbit (p0f)
-          && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      result |= 1;
-  }
-  if (signbit (vd)) /* link check */
-    vd++;
-  {
-    double plus_inf = 1.0 / p0d;
-    double minus_inf = -1.0 / p0d;
-    if (!(!signbit (255.0)
-          && signbit (-255.0)
-          && !signbit (p0d)
-          && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
-          && !signbit (plus_inf)
-          && signbit (minus_inf)))
-      result |= 2;
-  }
-  if (signbit (vl)) /* link check */
-    vl++;
-  {
-    long double plus_inf = 1.0L / p0l;
-    long double minus_inf = -1.0L / p0l;
-    if (signbit (255.0L))
-      result |= 4;
-    if (!signbit (-255.0L))
-      result |= 4;
-    if (signbit (p0l))
-      result |= 8;
-    if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
-      result |= 16;
-    if (signbit (plus_inf))
-      result |= 32;
-    if (!signbit (minus_inf))
-      result |= 64;
-  }
+  FILE *fp = fopen ("conftest.sl/", "w");
+  int result = (fp != NULL);
+  if (fp != NULL)
+    fclose (fp);
   return result;
 }
-
-
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_signbit_gcc=yes
-else
-  gl_cv_func_signbit_gcc=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fopen_slash=yes
+else $as_nop
+  gl_cv_func_fopen_slash=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+          rm -f conftest.sl
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit_gcc" >&5
-$as_echo "$gl_cv_func_signbit_gcc" >&6; }
-      case "$gl_cv_func_signbit_gcc" in
-    *yes)
-      REPLACE_SIGNBIT_USING_GCC=1
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fopen_slash" >&5
+printf "%s\n" "$gl_cv_func_fopen_slash" >&6; }
       ;;
-    *)
-      case "$gl_cv_func_signbit" in
-        *yes) ;;
-        *)
-                    REPLACE_SIGNBIT=1
+  esac
+  case "$gl_cv_func_fopen_slash" in
+    *no)
 
+printf "%s\n" "#define FOPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'float'" >&5
-$as_echo_n "checking where to find the sign bit in a 'float'... " >&6; }
-if ${gl_cv_cc_float_signbit+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+      REPLACE_FOPEN=1
+      ;;
+  esac
 
-      if test "$cross_compiling" = yes; then :
+  if test $REPLACE_FOPEN = 1; then
 
-                              gl_cv_cc_float_signbit="unknown"
 
-else
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS fopen.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_FOPEN=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FOPEN 1" >>confdefs.h
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fopen supports the mode character 'x'" >&5
+printf %s "checking whether fopen supports the mode character 'x'... " >&6; }
+if test ${gl_cv_func_fopen_mode_x+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  rm -f conftest.x
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+          # Guess yes on glibc and musl systems.
+          linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*)
+            gl_cv_func_fopen_mode_x="guessing yes" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *)
+            gl_cv_func_fopen_mode_x="$gl_cross_guess_normal" ;;
+        esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stddef.h>
 #include <stdio.h>
-#define NWORDS \
-  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { float value; unsigned int word[NWORDS]; }
-        memory_float;
-static memory_float plus = { 1.0f };
-static memory_float minus = { -1.0f };
+#include <errno.h>
 int main ()
 {
-  size_t j, k, i;
-  unsigned int m;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
+  FILE *fp;
+  fp = fopen ("conftest.x", "w");
+  fclose (fp);
+  fp = fopen ("conftest.x", "wx");
+  if (fp != NULL)
+    /* 'x' ignored */
     return 1;
-  /* Find the different bit.  */
-  k = 0; m = 0;
-  for (j = 0; j < NWORDS; j++)
-    {
-      unsigned int x = plus.word[j] ^ minus.word[j];
-      if ((x & (x - 1)) || (x && m))
-        {
-          /* More than one bit difference.  */
-          fprintf (fp, "unknown");
-          return 2;
-        }
-      if (x)
-        {
-          k = j;
-          m = x;
-        }
-    }
-  if (m == 0)
-    {
-      /* No difference.  */
-      fprintf (fp, "unknown");
-      return 3;
-    }
-  /* Now m = plus.word[k] ^ ~minus.word[k].  */
-  if (plus.word[k] & ~minus.word[k])
-    {
-      /* Oh? The sign bit is set in the positive and cleared in the negative
-         numbers?  */
-      fprintf (fp, "unknown");
-      return 4;
-    }
-  for (i = 0; ; i++)
-    if ((m >> i) & 1)
-      break;
-  fprintf (fp, "word %d bit %d", (int) k, (int) i);
-  if (fclose (fp) != 0)
-    return 5;
-  return 0;
+  else if (errno == EEXIST)
+    return 0;
+  else
+    /* 'x' rejected */
+    return 2;
 }
-
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_float_signbit=`cat conftest.out`
-else
-  gl_cv_cc_float_signbit="unknown"
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fopen_mode_x=yes
+else $as_nop
+  gl_cv_func_fopen_mode_x=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-      rm -f conftest.out
+     rm -f conftest.x
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_signbit" >&5
-$as_echo "$gl_cv_cc_float_signbit" >&6; }
-  case "$gl_cv_cc_float_signbit" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word.*bit //'`
-
-cat >>confdefs.h <<_ACEOF
-#define FLT_SIGNBIT_WORD $word
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define FLT_SIGNBIT_BIT $bit
-_ACEOF
-
-      ;;
-  esac
-
-
-
-
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'double'" >&5
-$as_echo_n "checking where to find the sign bit in a 'double'... " >&6; }
-if ${gl_cv_cc_double_signbit+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-      if test "$cross_compiling" = yes; then :
-
-                              gl_cv_cc_double_signbit="unknown"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fopen_mode_x" >&5
+printf "%s\n" "$gl_cv_func_fopen_mode_x" >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fopen supports the mode character 'e'" >&5
+printf %s "checking whether fopen supports the mode character 'e'... " >&6; }
+if test ${gl_cv_func_fopen_mode_e+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  echo foo > conftest.x
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+          # Guess yes on glibc and musl systems.
+          linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*)
+            gl_cv_func_fopen_mode_e="guessing yes" ;;
+          # Guess no on native Windows.
+          mingw*)
+            gl_cv_func_fopen_mode_e="guessing no" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *)
+            gl_cv_func_fopen_mode_e="$gl_cross_guess_normal" ;;
+        esac
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <stddef.h>
 #include <stdio.h>
-#define NWORDS \
-  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { double value; unsigned int word[NWORDS]; }
-        memory_float;
-static memory_float plus = { 1.0 };
-static memory_float minus = { -1.0 };
+#include <errno.h>
+#include <fcntl.h>
+
+
+$gl_mda_defines
+
 int main ()
 {
-  size_t j, k, i;
-  unsigned int m;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  /* Find the different bit.  */
-  k = 0; m = 0;
-  for (j = 0; j < NWORDS; j++)
-    {
-      unsigned int x = plus.word[j] ^ minus.word[j];
-      if ((x & (x - 1)) || (x && m))
-        {
-          /* More than one bit difference.  */
-          fprintf (fp, "unknown");
-          return 2;
-        }
-      if (x)
-        {
-          k = j;
-          m = x;
-        }
-    }
-  if (m == 0)
-    {
-      /* No difference.  */
-      fprintf (fp, "unknown");
-      return 3;
-    }
-  /* Now m = plus.word[k] ^ ~minus.word[k].  */
-  if (plus.word[k] & ~minus.word[k])
+  FILE *fp = fopen ("conftest.x", "re");
+  if (fp != NULL)
     {
-      /* Oh? The sign bit is set in the positive and cleared in the negative
-         numbers?  */
-      fprintf (fp, "unknown");
-      return 4;
+      if (fcntl (fileno (fp), F_GETFD) & FD_CLOEXEC)
+        return 0;
+      else
+        /* 'e' ignored */
+        return 1;
     }
-  for (i = 0; ; i++)
-    if ((m >> i) & 1)
-      break;
-  fprintf (fp, "word %d bit %d", (int) k, (int) i);
-  if (fclose (fp) != 0)
-    return 5;
-  return 0;
+  else
+    /* 'e' rejected */
+    return 2;
 }
-
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_double_signbit=`cat conftest.out`
-else
-  gl_cv_cc_double_signbit="unknown"
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fopen_mode_e=yes
+else $as_nop
+  gl_cv_func_fopen_mode_e=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-      rm -f conftest.out
+     rm -f conftest.x
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_signbit" >&5
-$as_echo "$gl_cv_cc_double_signbit" >&6; }
-  case "$gl_cv_cc_double_signbit" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word.*bit //'`
-
-cat >>confdefs.h <<_ACEOF
-#define DBL_SIGNBIT_WORD $word
-_ACEOF
-
-
-cat >>confdefs.h <<_ACEOF
-#define DBL_SIGNBIT_BIT $bit
-_ACEOF
-
-      ;;
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fopen_mode_e" >&5
+printf "%s\n" "$gl_cv_func_fopen_mode_e" >&6; }
+  case "$gl_cv_func_fopen_mode_x" in
+    *no) REPLACE_FOPEN=1 ;;
+  esac
+  case "$gl_cv_func_fopen_mode_e" in
+    *no) REPLACE_FOPEN=1 ;;
   esac
 
+  if test $REPLACE_FOPEN = 1; then
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'long double'" >&5
-$as_echo_n "checking where to find the sign bit in a 'long double'... " >&6; }
-if ${gl_cv_cc_long_double_signbit+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
 
-                              gl_cv_cc_long_double_signbit="unknown"
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <stddef.h>
-#include <stdio.h>
-#define NWORDS \
-  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { long double value; unsigned int word[NWORDS]; }
-        memory_float;
-static memory_float plus = { 1.0L };
-static memory_float minus = { -1.0L };
-int main ()
-{
-  size_t j, k, i;
-  unsigned int m;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  /* Find the different bit.  */
-  k = 0; m = 0;
-  for (j = 0; j < NWORDS; j++)
-    {
-      unsigned int x = plus.word[j] ^ minus.word[j];
-      if ((x & (x - 1)) || (x && m))
-        {
-          /* More than one bit difference.  */
-          fprintf (fp, "unknown");
-          return 2;
-        }
-      if (x)
-        {
-          k = j;
-          m = x;
-        }
-    }
-  if (m == 0)
-    {
-      /* No difference.  */
-      fprintf (fp, "unknown");
-      return 3;
-    }
-  /* Now m = plus.word[k] ^ ~minus.word[k].  */
-  if (plus.word[k] & ~minus.word[k])
-    {
-      /* Oh? The sign bit is set in the positive and cleared in the negative
-         numbers?  */
-      fprintf (fp, "unknown");
-      return 4;
-    }
-  for (i = 0; ; i++)
-    if ((m >> i) & 1)
-      break;
-  fprintf (fp, "word %d bit %d", (int) k, (int) i);
-  if (fclose (fp) != 0)
-    return 5;
-  return 0;
-}
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_long_double_signbit=`cat conftest.out`
-else
-  gl_cv_cc_long_double_signbit="unknown"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  M4_LIBOBJS="$M4_LIBOBJS fopen.$ac_objext"
 
-      rm -f conftest.out
+    :
+  fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_signbit" >&5
-$as_echo "$gl_cv_cc_long_double_signbit" >&6; }
-  case "$gl_cv_cc_long_double_signbit" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word.*bit //'`
 
-cat >>confdefs.h <<_ACEOF
-#define LDBL_SIGNBIT_WORD $word
-_ACEOF
+printf "%s\n" "#define GNULIB_FOPEN_GNU 1" >>confdefs.h
 
 
-cat >>confdefs.h <<_ACEOF
-#define LDBL_SIGNBIT_BIT $bit
-_ACEOF
 
-      ;;
-  esac
 
+printf "%s\n" "#define GNULIB_FOPEN_SAFER 1" >>confdefs.h
 
-          if test "$gl_cv_cc_float_signbit" = unknown; then
-                        ac_fn_c_check_decl "$LINENO" "copysignf" "ac_cv_have_decl_copysignf" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_copysignf" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_COPYSIGNF $ac_have_decl
-_ACEOF
 
-            if test "$ac_cv_have_decl_copysignf" = yes; then
-                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignf can be used without linking with libm" >&5
-$as_echo_n "checking whether copysignf can be used without linking with libm... " >&6; }
-if ${gl_cv_func_copysignf_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  fp_headers='
+    #include <stdio.h>
+    #if HAVE_STDIO_EXT_H
+    # include <stdio_ext.h>
+    #endif
+  '
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for __fpending" >&5
+printf %s "checking for __fpending... " >&6; }
+if test ${gl_cv_func___fpending+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <math.h>
-                         float x, y;
+$fp_headers
 int
-main ()
+main (void)
 {
-return copysignf (x, y) < 0;
+return ! __fpending (stdin);
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_copysignf_no_libm=yes
-else
-  gl_cv_func_copysignf_no_libm=no
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func___fpending=yes
+else $as_nop
+  gl_cv_func___fpending=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
     conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignf_no_libm" >&5
-$as_echo "$gl_cv_func_copysignf_no_libm" >&6; }
-              if test $gl_cv_func_copysignf_no_libm = yes; then
-
-$as_echo "#define HAVE_COPYSIGNF_IN_LIBC 1" >>confdefs.h
-
-              fi
-            fi
-          fi
-          if test "$gl_cv_cc_double_signbit" = unknown; then
-                        ac_fn_c_check_decl "$LINENO" "copysign" "ac_cv_have_decl_copysign" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_copysign" = xyes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func___fpending" >&5
+printf "%s\n" "$gl_cv_func___fpending" >&6; }
+  if test $gl_cv_func___fpending = yes; then
+    ac_fn_check_decl "$LINENO" "__fpending" "ac_cv_have_decl___fpending" "$fp_headers
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl___fpending" = xyes
+then :
   ac_have_decl=1
-else
+else $as_nop
   ac_have_decl=0
 fi
+printf "%s\n" "#define HAVE_DECL___FPENDING $ac_have_decl" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_COPYSIGN $ac_have_decl
-_ACEOF
+  fi
 
-            if test "$ac_cv_have_decl_copysign" = yes; then
-                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysign can be used without linking with libm" >&5
-$as_echo_n "checking whether copysign can be used without linking with libm... " >&6; }
-if ${gl_cv_func_copysign_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  if test $gl_cv_func___fpending = no; then
 
-                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <math.h>
-                         double x, y;
-int
-main ()
-{
-return copysign (x, y) < 0;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_copysign_no_libm=yes
-else
-  gl_cv_func_copysign_no_libm=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysign_no_libm" >&5
-$as_echo "$gl_cv_func_copysign_no_libm" >&6; }
-              if test $gl_cv_func_copysign_no_libm = yes; then
 
-$as_echo "#define HAVE_COPYSIGN_IN_LIBC 1" >>confdefs.h
 
-              fi
-            fi
-          fi
-          if test "$gl_cv_cc_long_double_signbit" = unknown; then
-                        ac_fn_c_check_decl "$LINENO" "copysignl" "ac_cv_have_decl_copysignl" "#include <math.h>
-"
-if test "x$ac_cv_have_decl_copysignl" = xyes; then :
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS fpending.$ac_objext"
+
+  fi
+
+
+
+
+
+  ac_fn_check_decl "$LINENO" "fpurge" "ac_cv_have_decl_fpurge" "#include <stdio.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_fpurge" = xyes
+then :
   ac_have_decl=1
-else
+else $as_nop
   ac_have_decl=0
 fi
+printf "%s\n" "#define HAVE_DECL_FPURGE $ac_have_decl" >>confdefs.h
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_COPYSIGNL $ac_have_decl
-_ACEOF
-
-            if test "$ac_cv_have_decl_copysignl" = yes; then
-                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether copysignl can be used without linking with libm" >&5
-$as_echo_n "checking whether copysignl can be used without linking with libm... " >&6; }
-if ${gl_cv_func_copysignl_no_libm+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  if test "x$ac_cv_func_fpurge" = xyes; then
+    HAVE_FPURGE=1
+    # Detect BSD bug.  Only cygwin 1.7 and musl are known to be immune.
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fpurge works" >&5
+printf %s "checking whether fpurge works... " >&6; }
+if test ${gl_cv_func_fpurge_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                     # Guess yes on musl systems.
+            *-musl*) gl_cv_func_fpurge_works="guessing yes" ;;
+                     # Otherwise obey --enable-cross-guesses.
+            *)       gl_cv_func_fpurge_works="$gl_cross_guess_normal" ;;
+          esac
 
-                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <math.h>
-                         long double x, y;
+#include <stdio.h>
+
 int
-main ()
+main (void)
 {
-return copysignl (x, y) < 0;
+FILE *f = fopen ("conftest.txt", "w+");
+              if (!f)
+                return 1;
+              if (fputc ('a', f) != 'a')
+                { fclose (f); return 2; }
+              rewind (f);
+              if (fgetc (f) != 'a')
+                { fclose (f); return 3; }
+              if (fgetc (f) != EOF)
+                { fclose (f); return 4; }
+              if (fpurge (f) != 0)
+                { fclose (f); return 5; }
+              if (putc ('b', f) != 'b')
+                { fclose (f); return 6; }
+              if (fclose (f) != 0)
+                return 7;
+              if ((f = fopen ("conftest.txt", "r")) == NULL)
+                return 8;
+              if (fgetc (f) != 'a')
+                { fclose (f); return 9; }
+              if (fgetc (f) != 'b')
+                { fclose (f); return 10; }
+              if (fgetc (f) != EOF)
+                { fclose (f); return 11; }
+              if (fclose (f) != 0)
+                return 12;
+              if (remove ("conftest.txt") != 0)
+                return 13;
+              return 0;
+
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
-  gl_cv_func_copysignl_no_libm=yes
-else
-  gl_cv_func_copysignl_no_libm=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fpurge_works=yes
+else $as_nop
+  gl_cv_func_fpurge_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext \
-    conftest$ac_exeext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignl_no_libm" >&5
-$as_echo "$gl_cv_func_copysignl_no_libm" >&6; }
-              if test $gl_cv_func_copysignl_no_libm = yes; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fpurge_works" >&5
+printf "%s\n" "$gl_cv_func_fpurge_works" >&6; }
+    case "$gl_cv_func_fpurge_works" in
+      *yes) ;;
+      *) REPLACE_FPURGE=1 ;;
+    esac
+  else
+    HAVE_FPURGE=0
+  fi
+  if test "x$ac_cv_have_decl_fpurge" = xno; then
+    HAVE_DECL_FPURGE=0
+  fi
 
-$as_echo "#define HAVE_COPYSIGNL_IN_LIBC 1" >>confdefs.h
+  if test $HAVE_FPURGE = 0 || test $REPLACE_FPURGE = 1; then
 
-              fi
-            fi
-          fi
-          ;;
-      esac
-      ;;
-  esac
 
-  if test $REPLACE_SIGNBIT = 1; then
 
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS fpurge.$ac_objext"
 
+  fi
 
-  M4_LIBOBJS="$M4_LIBOBJS signbitf.$ac_objext"
 
 
 
@@ -31073,367 +34771,478 @@ $as_echo "#define HAVE_COPYSIGNL_IN_LIBC 1" >>confdefs.h
 
 
 
+          GL_M4_GNULIB_FPURGE=1
 
-  M4_LIBOBJS="$M4_LIBOBJS signbitd.$ac_objext"
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_FPURGE 1" >>confdefs.h
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS signbitl.$ac_objext"
 
-  fi
+  if test $ac_cv_func___freadahead = no; then
 
 
 
 
 
-          GNULIB_SIGNBIT=1
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS freadahead.$ac_objext"
 
+  fi
 
-$as_echo "#define GNULIB_TEST_SIGNBIT 1" >>confdefs.h
 
 
 
 
 
 
+                          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether free is known to preserve errno" >&5
+printf %s "checking whether free is known to preserve errno... " >&6; }
+if test ${gl_cv_func_free_preserves_errno+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
 
+int
+main (void)
+{
+#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
+            #elif defined __OpenBSD__
+            #elif defined __sun
+            #else
+              #error "'free' is not known to preserve errno"
+            #endif
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_SIGPIPE 1
+  ;
+  return 0;
+}
 _ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_free_preserves_errno=yes
+else $as_nop
+  gl_cv_func_free_preserves_errno=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_free_preserves_errno" >&5
+printf "%s\n" "$gl_cv_func_free_preserves_errno" >&6; }
 
+  case $gl_cv_func_free_preserves_errno in
+   *yes)
 
-  GNULIB_SIGNAL_H_SIGPIPE=1
+printf "%s\n" "#define HAVE_FREE_POSIX 1" >>confdefs.h
 
+    ;;
+   *) REPLACE_FREE=1 ;;
+  esac
 
-  GNULIB_STDIO_H_SIGPIPE=1
+  if test $REPLACE_FREE = 1; then
 
-  GNULIB_UNISTD_H_SIGPIPE=1
 
 
 
-  if test $gl_cv_type_sigset_t = yes; then
-    ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
-if test "x$ac_cv_func_sigprocmask" = xyes; then :
-  gl_cv_func_sigprocmask=1
-fi
 
-  fi
-  if test -z "$gl_cv_func_sigprocmask"; then
-    HAVE_POSIX_SIGNALBLOCKING=0
-  fi
 
-  if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
 
 
+  M4_LIBOBJS="$M4_LIBOBJS free.$ac_objext"
 
+    :
+  fi
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS sigprocmask.$ac_objext"
 
-    :
-  fi
 
 
 
+          GL_M4_GNULIB_FREE_POSIX=1
 
 
-          GNULIB_SIGPROCMASK=1
 
 
 
+printf "%s\n" "#define GNULIB_TEST_FREE_POSIX 1" >>confdefs.h
 
 
-$as_echo "#define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h
 
 
 
 
-  for ac_header in stdint.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdint_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H 1
-_ACEOF
+  if test $gl_cv_func_frexp_no_libm = yes; then
 
-fi
 
-done
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5
-$as_echo_n "checking for SIZE_MAX... " >&6; }
-if ${gl_cv_size_max+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
+printf %s "checking whether frexp works... " >&6; }
+if test ${gl_cv_func_frexp_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-    gl_cv_size_max=
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+           netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
+           mingw*) # Guess yes with MSVC, no with mingw.
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <limits.h>
-#if HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifdef SIZE_MAX
-Found it
+#ifdef _MSC_VER
+ Good
 #endif
 
 _ACEOF
 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Found it" >/dev/null 2>&1; then :
-  gl_cv_size_max=yes
-fi
-rm -f conftest*
-
-    if test -z "$gl_cv_size_max"; then
-                        if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1"        "#include <stddef.h>
-#include <limits.h>"; then :
-
-else
-  size_t_bits_minus_1=
+  $EGREP "Good" >/dev/null 2>&1
+then :
+  gl_cv_func_frexp_works="guessing yes"
+else $as_nop
+  gl_cv_func_frexp_works="guessing no"
 fi
+rm -rf conftest*
 
-      if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint"        "#include <stddef.h>"; then :
-
-else
-  fits_in_uint=
-fi
+             ;;
+           *) gl_cv_func_frexp_works="guessing yes" ;;
+         esac
 
-      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
-        if test $fits_in_uint = 1; then
-                              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stddef.h>
-                 extern size_t foo;
-                 extern unsigned long foo;
 
-int
-main ()
+#include <float.h>
+#include <math.h>
+#include <string.h>
+#if HAVE_DECL_ALARM
+# include <signal.h>
+# include <unistd.h>
+#endif
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
+   ICC 10.0 has a bug when optimizing the expression -zero.
+   The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
+   to PowerPC on Mac OS X 10.5.  */
+#if defined __hpux || defined __sgi || defined __ICC
+static double
+compute_minus_zero (void)
 {
-
-  ;
-  return 0;
+  return -DBL_MIN * DBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
+#else
+double minus_zero = -0.0;
+#endif
+int main()
+{
+  int result = 0;
+  int i;
+  volatile double x;
+  double zero = 0.0;
+#if HAVE_DECL_ALARM
+  /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
+     number.  Let the test fail in this case.  */
+  signal (SIGALRM, SIG_DFL);
+  alarm (5);
+#endif
+  /* Test on denormalized numbers.  */
+  for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
+    ;
+  if (x > 0.0)
+    {
+      int exp;
+      double y = frexp (x, &exp);
+      /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
+         On NetBSD: y = 0.75. Correct: y = 0.5.  */
+      if (y != 0.5)
+        result |= 1;
+    }
+  /* Test on infinite numbers.  */
+  x = 1.0 / zero;
+  {
+    int exp;
+    double y = frexp (x, &exp);
+    if (y != x)
+      result |= 2;
+  }
+  /* Test on negative zero.  */
+  x = minus_zero;
+  {
+    int exp;
+    double y = frexp (x, &exp);
+    if (memcmp (&y, &x, sizeof x))
+      result |= 4;
+  }
+  return result;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  fits_in_uint=0
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_frexp_works=yes
+else $as_nop
+  gl_cv_func_frexp_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        fi
-                                if test $fits_in_uint = 1; then
-          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
-        else
-          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
-        fi
-      else
-                gl_cv_size_max='((size_t)~(size_t)0)'
-      fi
-    fi
-
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5
-$as_echo "$gl_cv_size_max" >&6; }
-  if test "$gl_cv_size_max" != yes; then
-
-cat >>confdefs.h <<_ACEOF
-#define SIZE_MAX $gl_cv_size_max
-_ACEOF
-
-  fi
-
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
+printf "%s\n" "$gl_cv_func_frexp_works" >&6; }
 
-  gl_cv_func_snprintf_usable=no
-  for ac_func in snprintf
-do :
-  ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
-if test "x$ac_cv_func_snprintf" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SNPRINTF 1
-_ACEOF
+    case "$gl_cv_func_frexp_works" in
+      *yes) gl_func_frexp_no_libm=yes ;;
+      *)    gl_func_frexp_no_libm=no; REPLACE_FREXP=1 ;;
+    esac
+  else
+    gl_func_frexp_no_libm=no
+        REPLACE_FREXP=1
+  fi
+  if test $gl_func_frexp_no_libm = yes; then
 
-fi
-done
+printf "%s\n" "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h
 
-  if test $ac_cv_func_snprintf = yes; then
+  fi
 
+  if test $gl_func_frexp_no_libm != yes; then
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5
-$as_echo_n "checking whether snprintf respects a size of 1... " >&6; }
-if ${gl_cv_func_snprintf_size1+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
-  gl_cv_func_snprintf_size1="guessing yes"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <stdio.h>
-#if HAVE_SNPRINTF
-# define my_snprintf snprintf
-#else
-# include <stdarg.h>
-static int my_snprintf (char *buf, int size, const char *format, ...)
-{
-  va_list args;
-  int ret;
-  va_start (args, format);
-  ret = vsnprintf (buf, size, format, args);
-  va_end (args);
-  return ret;
-}
-#endif
-int main()
-{
-  static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
-  my_snprintf (buf, 1, "%d", 12345);
-  return buf[1] != 'E';
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_snprintf_size1=yes
-else
-  gl_cv_func_snprintf_size1=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5
-$as_echo "$gl_cv_func_snprintf_size1" >&6; }
 
-    case "$gl_cv_func_snprintf_size1" in
-      *yes)
 
-        case "$gl_cv_func_snprintf_retval_c99" in
-          *yes)
+  M4_LIBOBJS="$M4_LIBOBJS frexp.$ac_objext"
 
+  fi
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5
-$as_echo_n "checking whether printf supports POSIX/XSI format strings with positions... " >&6; }
-if ${gl_cv_func_printf_positions+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
 
-         case "$host_os" in
-           netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
-                         gl_cv_func_printf_positions="guessing no";;
-           beos*)        gl_cv_func_printf_positions="guessing no";;
-           mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
-           *)            gl_cv_func_printf_positions="guessing yes";;
-         esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <stdio.h>
-#include <string.h>
-/* The string "%2$d %1$d", with dollar characters protected from the shell's
-   dollar expansion (possibly an autoconf bug).  */
-static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
-static char buf[100];
-int main ()
-{
-  sprintf (buf, format, 33, 55);
-  return (strcmp (buf, "55 33") != 0);
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_printf_positions=yes
-else
-  gl_cv_func_printf_positions=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5
-$as_echo "$gl_cv_func_printf_positions" >&6; }
 
-            case "$gl_cv_func_printf_positions" in
-              *yes)
-                gl_cv_func_snprintf_usable=yes
-                ;;
-            esac
-            ;;
-        esac
-        ;;
-    esac
-  fi
-  if test $gl_cv_func_snprintf_usable = no; then
 
+          GL_M4_GNULIB_FREXP=1
 
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_FREXP 1" >>confdefs.h
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS snprintf.$ac_objext"
 
-  if test $ac_cv_func_snprintf = yes; then
-    REPLACE_SNPRINTF=1
-  else
 
-    if test $ac_cv_have_decl_snprintf = yes; then
-                        REPLACE_SNPRINTF=1
-    fi
-  fi
-  :
+      ac_fn_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_frexpl" = xyes
+then :
 
-  fi
+else $as_nop
+  HAVE_DECL_FREXPL=0
+fi
+  if test $HAVE_DECL_FREXPL = 1; then
 
-  if test $ac_cv_have_decl_snprintf = no; then
-    HAVE_DECL_SNPRINTF=0
-  fi
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
+printf %s "checking whether frexpl() can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_frexpl_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             long double x;
+int
+main (void)
+{
+int e; return frexpl (x, &e) > 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_frexpl_no_libm=yes
+else $as_nop
+  gl_cv_func_frexpl_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
+printf "%s\n" "$gl_cv_func_frexpl_no_libm" >&6; }
 
+    if test $gl_cv_func_frexpl_no_libm = yes; then
 
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
+printf %s "checking whether frexpl works... " >&6; }
+if test ${gl_cv_func_frexpl_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-          GNULIB_SNPRINTF=1
+      if test "$cross_compiling" = yes
+then :
 
+         case "$host_os" in
+           aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
+              gl_cv_func_frexpl_works="guessing no";;
+           *) gl_cv_func_frexpl_works="guessing yes";;
+         esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <float.h>
+#include <math.h>
+/* Override the values of <float.h>, like done in float.in.h.  */
+#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+#endif
+#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+#endif
+#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+#endif
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# if defined __GNUC__
+#  undef LDBL_MIN_EXP
+#  define LDBL_MIN_EXP DBL_MIN_EXP
+# endif
+#endif
+extern
+#ifdef __cplusplus
+"C"
+#endif
+long double frexpl (long double, int *);
+long double zero = 0.0L;
+int main()
+{
+  int result = 0;
+  volatile long double x;
+  /* Test on finite numbers that fails on AIX 5.1.  */
+  x = 16.0L;
+  {
+    int exp = -9999;
+    frexpl (x, &exp);
+    if (exp != 5)
+      result |= 1;
+  }
+  /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
+     function returns an invalid (incorrectly normalized) value: it returns
+               y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
+     but the correct result is
+          0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 }  */
+  x = 1.01L;
+  {
+    int exp = -9999;
+    long double y = frexpl (x, &exp);
+    if (!(exp == 1 && y == 0.505L))
+      result |= 2;
+  }
+  /* Test on large finite numbers.  This fails on BeOS at i = 16322, while
+     LDBL_MAX_EXP = 16384.
+     In the loop end test, we test x against Infinity, rather than comparing
+     i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP.  */
+  {
+    int i;
+    for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
+      {
+        int exp = -9999;
+        frexpl (x, &exp);
+        if (exp != i)
+          {
+            result |= 4;
+            break;
+          }
+      }
+  }
+  /* Test on denormalized numbers.  */
+  {
+    int i;
+    for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
+      ;
+    if (x > 0.0L)
+      {
+        int exp;
+        long double y = frexpl (x, &exp);
+        /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
+           exp = -16382, y = 0.5.  On Mac OS X 10.5: exp = -16384, y = 0.5.  */
+        if (exp != LDBL_MIN_EXP - 1)
+          result |= 8;
+      }
+  }
+  /* Test on infinite numbers.  */
+  /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0.  */
+  x = 1.0L / zero;
+  {
+    int exp;
+    long double y = frexpl (x, &exp);
+    if (y != x)
+      result |= 16;
+  }
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_frexpl_works=yes
+else $as_nop
+  gl_cv_func_frexpl_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
-$as_echo "#define GNULIB_TEST_SNPRINTF 1" >>confdefs.h
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
+printf "%s\n" "$gl_cv_func_frexpl_works" >&6; }
 
+      case "$gl_cv_func_frexpl_works" in
+        *yes) gl_func_frexpl_no_libm=yes ;;
+        *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
+      esac
+    else
+      gl_func_frexpl_no_libm=no
+            REPLACE_FREXPL=1
+    fi
+    if test $gl_func_frexpl_no_libm = yes; then
 
+printf "%s\n" "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h
 
+    fi
+  fi
 
+  if test $HAVE_DECL_FREXPL = 0 || test $gl_func_frexpl_no_libm = no; then
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_SNPRINTF 1
-_ACEOF
 
 
 
@@ -31441,120 +35250,49 @@ _ACEOF
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS frexpl.$ac_objext"
 
+  fi
 
 
 
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_spawn_h='<'spawn.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <spawn.h>" >&5
-$as_echo_n "checking absolute name of <spawn.h>... " >&6; }
-if ${gl_cv_next_spawn_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-             if test $ac_cv_header_spawn_h = yes; then
 
 
+          GL_M4_GNULIB_FREXPL=1
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <spawn.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'spawn.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
 
-        gl_cv_absolute_spawn_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_spawn_h
-           gl_cv_next_spawn_h='"'$gl_header'"'
-          else
-               gl_cv_next_spawn_h='<'spawn.h'>'
-             fi
+printf "%s\n" "#define GNULIB_TEST_FREXPL 1" >>confdefs.h
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_spawn_h" >&5
-$as_echo "$gl_cv_next_spawn_h" >&6; }
-     fi
-     NEXT_SPAWN_H=$gl_cv_next_spawn_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='<'spawn.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_spawn_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_SPAWN_H=$gl_next_as_first_directive
 
 
 
+    if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
+    REPLACE_FSEEK=1
+  fi
 
+  if test $REPLACE_FSEEK = 1; then
 
-  if test $ac_cv_header_spawn_h = yes; then
-    HAVE_SPAWN_H=1
-    ac_fn_c_check_type "$LINENO" "posix_spawnattr_t" "ac_cv_type_posix_spawnattr_t" "
-#include <spawn.h>
 
-"
-if test "x$ac_cv_type_posix_spawnattr_t" = xyes; then :
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_POSIX_SPAWNATTR_T 1
-_ACEOF
 
 
-else
-  HAVE_POSIX_SPAWNATTR_T=0
-fi
 
-    ac_fn_c_check_type "$LINENO" "posix_spawn_file_actions_t" "ac_cv_type_posix_spawn_file_actions_t" "
-#include <spawn.h>
 
-"
-if test "x$ac_cv_type_posix_spawn_file_actions_t" = xyes; then :
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_POSIX_SPAWN_FILE_ACTIONS_T 1
-_ACEOF
+  M4_LIBOBJS="$M4_LIBOBJS fseek.$ac_objext"
 
+  fi
 
-else
-  HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0
-fi
 
-  else
-    HAVE_SPAWN_H=0
-    HAVE_POSIX_SPAWNATTR_T=0
-    HAVE_POSIX_SPAWN_FILE_ACTIONS_T=0
-  fi
 
 
 
 
 
 
+          GL_M4_GNULIB_FSEEK=1
 
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_FSEEK 1" >>confdefs.h
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
-$as_echo_n "checking for ssize_t... " >&6; }
-if ${gt_cv_ssize_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-int
-main ()
-{
-int x = sizeof (ssize_t *) + sizeof (ssize_t);
-            return !x;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_ssize_t=yes
-else
-  gt_cv_ssize_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
-$as_echo "$gt_cv_ssize_t" >&6; }
-  if test $gt_cv_ssize_t = no; then
 
-$as_echo "#define ssize_t int" >>confdefs.h
 
-  fi
 
 
 
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on directories" >&5
-$as_echo_n "checking whether stat handles trailing slashes on directories... " >&6; }
-if ${gl_cv_func_stat_dir_slash+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  case $host_os in
-            mingw*) gl_cv_func_stat_dir_slash="guessing no";;
-            *) gl_cv_func_stat_dir_slash="guessing yes";;
-          esac
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fseeko" >&5
+printf %s "checking for fseeko... " >&6; }
+if test ${gl_cv_func_fseeko+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/stat.h>
+#include <stdio.h>
 
 int
-main ()
+main (void)
 {
-struct stat st; return stat (".", &st) != stat ("./", &st);
+fseeko (stdin, 0, 0);
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_stat_dir_slash=yes
-else
-  gl_cv_func_stat_dir_slash=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_fseeko=yes
+else $as_nop
+  gl_cv_func_fseeko=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_dir_slash" >&5
-$as_echo "$gl_cv_func_stat_dir_slash" >&6; }
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
-$as_echo_n "checking whether stat handles trailing slashes on files... " >&6; }
-if ${gl_cv_func_stat_file_slash+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  touch conftest.tmp
-       # Assume that if we have lstat, we can also check symlinks.
-       if test $ac_cv_func_lstat = yes; then
-         ln -s conftest.tmp conftest.lnk
-       fi
-       if test "$cross_compiling" = yes; then :
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fseeko" >&5
+printf "%s\n" "$gl_cv_func_fseeko" >&6; }
+
+
+  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
+  else
+    if test $WINDOWS_64_BIT_OFF_T = 1; then
+      REPLACE_FSEEKO=1
+    fi
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FSEEKO=1
+    fi
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fflush works on input streams" >&5
+printf %s "checking whether fflush works on input streams... " >&6; }
+if test ${gl_cv_func_fflush_stdin+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  echo hello world > conftest.txt
+     if test "$cross_compiling" = yes
+then :
   case "$host_os" in
-                    # Guess yes on glibc systems.
-            *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
-                    # If we don't know, assume the worst.
-            *)      gl_cv_func_stat_file_slash="guessing no" ;;
-          esac
+                  # Guess no on native Windows.
+          mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
+          *)      gl_cv_func_fflush_stdin=cross ;;
+        esac
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/stat.h>
+
+#include <stdio.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
+
+
+$gl_mda_defines
 
 int
-main ()
+main (void)
 {
-int result = 0;
-      struct stat st;
-      if (!stat ("conftest.tmp/", &st))
-        result |= 1;
-#if HAVE_LSTAT
-      if (!stat ("conftest.lnk/", &st))
-        result |= 2;
-#endif
-      return result;
+FILE *f = fopen ("conftest.txt", "r");
+         char buffer[10];
+         int fd;
+         int c;
+         if (f == NULL)
+           return 1;
+         fd = fileno (f);
+         if (fd < 0 || fread (buffer, 1, 5, f) != 5)
+           { fclose (f); return 2; }
+         /* For deterministic results, ensure f read a bigger buffer.  */
+         if (lseek (fd, 0, SEEK_CUR) == 5)
+           { fclose (f); return 3; }
+         /* POSIX requires fflush-fseek to set file offset of fd.  This fails
+            on BSD systems and on mingw.  */
+         if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
+           { fclose (f); return 4; }
+         if (lseek (fd, 0, SEEK_CUR) != 5)
+           { fclose (f); return 5; }
+         /* Verify behaviour of fflush after ungetc. See
+            <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
+         /* Verify behaviour of fflush after a backup ungetc.  This fails on
+            mingw.  */
+         c = fgetc (f);
+         ungetc (c, f);
+         fflush (f);
+         if (fgetc (f) != c)
+           { fclose (f); return 6; }
+         /* Verify behaviour of fflush after a non-backup ungetc.  This fails
+            on glibc 2.8 and on BSD systems.  */
+         c = fgetc (f);
+         ungetc ('@', f);
+         fflush (f);
+         if (fgetc (f) != c)
+           { fclose (f); return 7; }
+         fclose (f);
+         return 0;
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_stat_file_slash=yes
-else
-  gl_cv_func_stat_file_slash=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fflush_stdin=yes
+else $as_nop
+  gl_cv_func_fflush_stdin=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-       rm -f conftest.tmp conftest.lnk
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
-$as_echo "$gl_cv_func_stat_file_slash" >&6; }
-  case $gl_cv_func_stat_dir_slash in
-    *no) REPLACE_STAT=1
+     rm conftest.txt
 
-$as_echo "#define REPLACE_FUNC_STAT_DIR 1" >>confdefs.h
-;;
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fflush_stdin" >&5
+printf "%s\n" "$gl_cv_func_fflush_stdin" >&6; }
+  case "$gl_cv_func_fflush_stdin" in
+    *yes) gl_func_fflush_stdin=1 ;;
+    *no)  gl_func_fflush_stdin=0 ;;
+    *)    gl_func_fflush_stdin='(-1)' ;;
   esac
-  case $gl_cv_func_stat_file_slash in
-    *no) REPLACE_STAT=1
 
-$as_echo "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
-;;
-  esac
+printf "%s\n" "#define FUNC_FFLUSH_STDIN $gl_func_fflush_stdin" >>confdefs.h
 
-  if test $REPLACE_STAT = 1; then
 
+      case "$gl_cv_func_fflush_stdin" in
+        *yes) ;;
+        *) REPLACE_FSEEKO=1 ;;
+      esac
 
+  fi
 
+  if test $HAVE_FSEEKO = 0 || test $REPLACE_FSEEKO = 1; then
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS stat.$ac_objext"
 
-    :
-  fi
 
 
+  M4_LIBOBJS="$M4_LIBOBJS fseeko.$ac_objext"
 
 
+      ac_fn_c_check_func "$LINENO" "_fseeki64" "ac_cv_func__fseeki64"
+if test "x$ac_cv_func__fseeki64" = xyes
+then :
+  printf "%s\n" "#define HAVE__FSEEKI64 1" >>confdefs.h
 
-          GNULIB_STAT=1
+fi
 
+  if test $ac_cv_func__fseeki64 = yes; then
+    ac_fn_check_decl "$LINENO" "_fseeki64" "ac_cv_have_decl__fseeki64" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl__fseeki64" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL__FSEEKI64 $ac_have_decl" >>confdefs.h
 
+  fi
 
+  fi
 
 
-$as_echo "#define GNULIB_TEST_STAT 1" >>confdefs.h
 
 
 
 
-  STDARG_H=''
-  NEXT_STDARG_H='<stdarg.h>'
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5
-$as_echo_n "checking for va_copy... " >&6; }
-  if ${gl_cv_func_va_copy+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-int
-main ()
-{
 
-#ifndef va_copy
-void (*func) (va_list, va_list) = va_copy;
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_va_copy=yes
-else
-  gl_cv_func_va_copy=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
+          GL_M4_GNULIB_FSEEKO=1
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5
-$as_echo "$gl_cv_func_va_copy" >&6; }
-  if test $gl_cv_func_va_copy = no; then
-                                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#if defined _AIX && !defined __GNUC__
-        AIX vaccine
-       #endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "vaccine" >/dev/null 2>&1; then :
-  gl_aixcc=yes
-else
-  gl_aixcc=no
-fi
-rm -f conftest*
 
-    if test $gl_aixcc = yes; then
-            STDARG_H=stdarg.h
 
 
+printf "%s\n" "#define GNULIB_TEST_FSEEKO 1" >>confdefs.h
 
 
 
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_stdarg_h='<'stdarg.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdarg.h>" >&5
-$as_echo_n "checking absolute name of <stdarg.h>... " >&6; }
-if ${gl_cv_next_stdarg_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
+  case "$host_os" in
+    mingw* | solaris*)
+                        REPLACE_FSTAT=1
+      ;;
+  esac
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'stdarg.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
-
-        gl_cv_absolute_stdarg_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_stdarg_h
-           gl_cv_next_stdarg_h='"'$gl_header'"'
 
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5
-$as_echo "$gl_cv_next_stdarg_h" >&6; }
-     fi
-     NEXT_STDARG_H=$gl_cv_next_stdarg_h
+    if test $HAVE_FCHDIR = 0; then
+      case "$gl_cv_func_open_directory_works" in
+        *yes) ;;
+        *)
+          REPLACE_FSTAT=1
+          ;;
+      esac
+    fi
 
-     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='<'stdarg.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_stdarg_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive
 
+  if test $REPLACE_FSTAT = 1; then
 
 
 
-            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"
-      fi
-    else
 
-  saved_as_echo_n="$as_echo_n"
-  as_echo_n=':'
-  if ${gl_cv_func___va_copy+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-int
-main ()
-{
 
-#ifndef __va_copy
-error, bail out
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func___va_copy=yes
-else
-  gl_cv_func___va_copy=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
 
-  as_echo_n="$saved_as_echo_n"
+  M4_LIBOBJS="$M4_LIBOBJS fstat.$ac_objext"
 
-      if test $gl_cv_func___va_copy = yes; then
+    case "$host_os" in
+      mingw*)
 
-$as_echo "#define va_copy __va_copy" >>confdefs.h
 
-      else
 
 
-$as_echo "#define va_copy gl_va_copy" >>confdefs.h
 
-      fi
-    fi
-  fi
 
-   if test -n "$STDARG_H"; then
-  GL_GENERATE_STDARG_H_TRUE=
-  GL_GENERATE_STDARG_H_FALSE='#'
-else
-  GL_GENERATE_STDARG_H_TRUE='#'
-  GL_GENERATE_STDARG_H_FALSE=
-fi
 
 
+  M4_LIBOBJS="$M4_LIBOBJS stat-w32.$ac_objext"
 
+        ;;
+    esac
 
 
 
-  # Define two additional variables used in the Makefile substitution.
+  :
 
-  if test "$ac_cv_header_stdbool_h" = yes; then
-    STDBOOL_H=''
-  else
-    STDBOOL_H='stdbool.h'
   fi
 
-   if test -n "$STDBOOL_H"; then
-  GL_GENERATE_STDBOOL_H_TRUE=
-  GL_GENERATE_STDBOOL_H_FALSE='#'
-else
-  GL_GENERATE_STDBOOL_H_TRUE='#'
-  GL_GENERATE_STDBOOL_H_FALSE=
-fi
-
 
-  if test "$ac_cv_type__Bool" = yes; then
-    HAVE__BOOL=1
-  else
-    HAVE__BOOL=0
-  fi
 
 
 
 
 
-  STDDEF_H=
-  ac_fn_c_check_type "$LINENO" "max_align_t" "ac_cv_type_max_align_t" "#include <stddef.h>
 
-"
-if test "x$ac_cv_type_max_align_t" = xyes; then :
 
-else
-  HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h
-fi
+          GL_M4_GNULIB_FSTAT=1
 
-  if test $gt_cv_c_wchar_t = no; then
-    HAVE_WCHAR_T=0
-    STDDEF_H=stddef.h
-  fi
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether NULL can be used in arbitrary expressions" >&5
-$as_echo_n "checking whether NULL can be used in arbitrary expressions... " >&6; }
-if ${gl_cv_decl_null_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stddef.h>
-      int test[2 * (sizeof NULL == sizeof (void *)) -1];
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_decl_null_works=yes
-else
-  gl_cv_decl_null_works=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_null_works" >&5
-$as_echo "$gl_cv_decl_null_works" >&6; }
-  if test $gl_cv_decl_null_works = no; then
-    REPLACE_NULL=1
-    STDDEF_H=stddef.h
-  fi
 
-   if test -n "$STDDEF_H"; then
-  GL_GENERATE_STDDEF_H_TRUE=
-  GL_GENERATE_STDDEF_H_FALSE='#'
-else
-  GL_GENERATE_STDDEF_H_TRUE='#'
-  GL_GENERATE_STDDEF_H_FALSE=
-fi
 
-  if test -n "$STDDEF_H"; then
+printf "%s\n" "#define GNULIB_TEST_FSTAT 1" >>confdefs.h
 
 
 
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_stddef_h='<'stddef.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stddef.h>" >&5
-$as_echo_n "checking absolute name of <stddef.h>... " >&6; }
-if ${gl_cv_next_stddef_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
 
+  if test $ac_cv_func_fstatat = no; then
+    HAVE_FSTATAT=0
+  else
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fstatat (..., 0) works" >&5
+printf %s "checking whether fstatat (..., 0) works... " >&6; }
+if test ${gl_cv_func_fstatat_zero_flag+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+            aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
+            *)    gl_cv_func_fstatat_zero_flag="guessing yes";;
+          esac
 
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stddef.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
-
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'stddef.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
 
-        gl_cv_absolute_stddef_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
+              #include <fcntl.h>
+              #include <sys/stat.h>
+              int
+              main (void)
+              {
+                struct stat a;
+                return fstatat (AT_FDCWD, ".", &a, 0) != 0;
+              }
 
-           gl_header=$gl_cv_absolute_stddef_h
-           gl_cv_next_stddef_h='"'$gl_header'"'
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fstatat_zero_flag=yes
+else $as_nop
+  gl_cv_func_fstatat_zero_flag=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stddef_h" >&5
-$as_echo "$gl_cv_next_stddef_h" >&6; }
-     fi
-     NEXT_STDDEF_H=$gl_cv_next_stddef_h
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fstatat_zero_flag" >&5
+printf "%s\n" "$gl_cv_func_fstatat_zero_flag" >&6; }
 
-     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='<'stddef.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_stddef_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_STDDEF_H=$gl_next_as_first_directive
+    case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
+    *yes+*yes) ;;
+    *) REPLACE_FSTATAT=1 ;;
+    esac
 
+    case $host_os in
+      solaris*)
+        REPLACE_FSTATAT=1 ;;
+    esac
 
+    case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
+      1,*yes)
 
+printf "%s\n" "#define HAVE_WORKING_FSTATAT_ZERO_FLAG 1" >>confdefs.h
 
+         ;;
+    esac
   fi
 
-
-
-
-  $as_echo "#define __USE_MINGW_ANSI_STDIO 1" >>confdefs.h
+  if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
 
 
 
@@ -32088,153 +35680,48 @@ $as_echo "$gl_cv_next_stddef_h" >&6; }
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS fstatat.$ac_objext"
 
+  fi
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_stdio_h='<'stdio.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdio.h>" >&5
-$as_echo_n "checking absolute name of <stdio.h>... " >&6; }
-if ${gl_cv_next_stdio_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'stdio.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
 
-        gl_cv_absolute_stdio_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_stdio_h
-           gl_cv_next_stdio_h='"'$gl_header'"'
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdio_h" >&5
-$as_echo "$gl_cv_next_stdio_h" >&6; }
-     fi
-     NEXT_STDIO_H=$gl_cv_next_stdio_h
+          GL_M4_GNULIB_FSTATAT=1
 
-     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='<'stdio.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_stdio_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_STDIO_H=$gl_next_as_first_directive
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_FSTATAT 1" >>confdefs.h
 
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking which flavor of printf attribute matches inttypes macros" >&5
-$as_echo_n "checking which flavor of printf attribute matches inttypes macros... " >&6; }
-if ${gl_cv_func_printf_attribute_flavor+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-       #define __STDC_FORMAT_MACROS 1
-       #include <stdio.h>
-       #include <inttypes.h>
-       /* For non-mingw systems, compilation will trivially succeed.
-          For mingw, compilation will succeed for older mingw (system
-          printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
-       #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \
-         (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
-       extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
-       #endif
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_printf_attribute_flavor=system
-else
-  gl_cv_func_printf_attribute_flavor=gnu
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_attribute_flavor" >&5
-$as_echo "$gl_cv_func_printf_attribute_flavor" >&6; }
-  if test "$gl_cv_func_printf_attribute_flavor" = gnu; then
 
-$as_echo "#define GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU 1" >>confdefs.h
 
+    if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
+    REPLACE_FTELL=1
   fi
 
-      GNULIB_FSCANF=1
-
-
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_FSCANF 1
-_ACEOF
-
-
-  GNULIB_SCANF=1
+  if test $REPLACE_FTELL = 1; then
 
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_SCANF 1
-_ACEOF
 
 
-  GNULIB_FGETC=1
-  GNULIB_GETC=1
-  GNULIB_GETCHAR=1
-  GNULIB_FGETS=1
-  GNULIB_FREAD=1
 
 
-      GNULIB_FPRINTF=1
-  GNULIB_PRINTF=1
-  GNULIB_VFPRINTF=1
-  GNULIB_VPRINTF=1
-  GNULIB_FPUTC=1
-  GNULIB_PUTC=1
-  GNULIB_PUTCHAR=1
-  GNULIB_FPUTS=1
-  GNULIB_PUTS=1
-  GNULIB_FWRITE=1
 
 
+  M4_LIBOBJS="$M4_LIBOBJS ftell.$ac_objext"
 
+  fi
 
-    if test $gl_cv_header_signal_h_SIGPIPE != yes; then
-      REPLACE_STDIO_WRITE_FUNCS=1
 
 
 
@@ -32243,13 +35730,13 @@ _ACEOF
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS stdio-write.$ac_objext"
+          GL_M4_GNULIB_FTELL=1
 
-    fi
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_FTELL 1" >>confdefs.h
 
 
 
@@ -32261,138 +35748,137 @@ _ACEOF
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_stdlib_h='<'stdlib.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdlib.h>" >&5
-$as_echo_n "checking absolute name of <stdlib.h>... " >&6; }
-if ${gl_cv_next_stdlib_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
+  if test $ac_cv_have_decl_ftello = no; then
+    HAVE_DECL_FTELLO=0
+  fi
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ftello" >&5
+printf %s "checking for ftello... " >&6; }
+if test ${gl_cv_func_ftello+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdlib.h>
+#include <stdio.h>
+int
+main (void)
+{
+ftello (stdin);
+  ;
+  return 0;
+}
 _ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
-
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'stdlib.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
-
-        gl_cv_absolute_stdlib_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
-
-           gl_header=$gl_cv_absolute_stdlib_h
-           gl_cv_next_stdlib_h='"'$gl_header'"'
-
-
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_ftello=yes
+else $as_nop
+  gl_cv_func_ftello=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdlib_h" >&5
-$as_echo "$gl_cv_next_stdlib_h" >&6; }
-     fi
-     NEXT_STDLIB_H=$gl_cv_next_stdlib_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='<'stdlib.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_stdlib_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_STDLIB_H=$gl_next_as_first_directive
-
-
-
-
-
-
-
-
-
-
-
-  for ac_func in strchrnul
-do :
-  ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul"
-if test "x$ac_cv_func_strchrnul" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STRCHRNUL 1
-_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
 fi
-done
-
-  if test $ac_cv_func_strchrnul = no; then
-    HAVE_STRCHRNUL=0
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello" >&5
+printf "%s\n" "$gl_cv_func_ftello" >&6; }
+  if test $gl_cv_func_ftello = no; then
+    HAVE_FTELLO=0
   else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5
-$as_echo_n "checking whether strchrnul works... " >&6; }
-if ${gl_cv_func_strchrnul_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-
-#if defined __CYGWIN__
- #include <cygwin/version.h>
- #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
-  Lucky user
- #endif
-#else
-  Lucky user
-#endif
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky user" >/dev/null 2>&1; then :
-  gl_cv_func_strchrnul_works="guessing yes"
-else
-  gl_cv_func_strchrnul_works="guessing no"
-fi
-rm -f conftest*
+    if test $WINDOWS_64_BIT_OFF_T = 1; then
+      REPLACE_FTELLO=1
+    fi
+    if test $gl_cv_var_stdin_large_offset = no; then
+      REPLACE_FTELLO=1
+    fi
+    if test $REPLACE_FTELLO = 0; then
 
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ftello works" >&5
+printf %s "checking whether ftello works... " >&6; }
+if test ${gl_cv_func_ftello_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-else
+                              case "$host_os" in
+                      # Guess no on Solaris.
+            solaris*) gl_cv_func_ftello_works="guessing no" ;;
+                      # Guess yes on native Windows.
+            mingw*)   gl_cv_func_ftello_works="guessing yes" ;;
+                      # Guess yes otherwise.
+            *)        gl_cv_func_ftello_works="guessing yes" ;;
+          esac
+          if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <string.h> /* for strchrnul */
-
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define TESTFILE "conftest.tmp"
 int
-main ()
+main (void)
 {
-const char *buf = "a";
-      return strchrnul (buf, 'b') != buf + 1;
+  FILE *fp;
+
+  /* Create a file with some contents.  */
+  fp = fopen (TESTFILE, "w");
+  if (fp == NULL)
+    return 70;
+  if (fwrite ("foogarsh", 1, 8, fp) < 8)
+    { fclose (fp); return 71; }
+  if (fclose (fp))
+    return 72;
+
+  /* The file's contents is now "foogarsh".  */
+
+  /* Try writing after reading to EOF.  */
+  fp = fopen (TESTFILE, "r+");
+  if (fp == NULL)
+    return 73;
+  if (fseek (fp, -1, SEEK_END))
+    { fclose (fp); return 74; }
+  if (!(getc (fp) == 'h'))
+    { fclose (fp); return 1; }
+  if (!(getc (fp) == EOF))
+    { fclose (fp); return 2; }
+  if (!(ftell (fp) == 8))
+    { fclose (fp); return 3; }
+  if (!(ftell (fp) == 8))
+    { fclose (fp); return 4; }
+  if (!(putc ('!', fp) == '!'))
+    { fclose (fp); return 5; }
+  if (!(ftell (fp) == 9))
+    { fclose (fp); return 6; }
+  if (!(fclose (fp) == 0))
+    return 7;
+  fp = fopen (TESTFILE, "r");
+  if (fp == NULL)
+    return 75;
+  {
+    char buf[10];
+    if (!(fread (buf, 1, 10, fp) == 9))
+      { fclose (fp); return 10; }
+    if (!(memcmp (buf, "foogarsh!", 9) == 0))
+      { fclose (fp); return 11; }
+  }
+  if (!(fclose (fp) == 0))
+    return 12;
+
+  /* The file's contents is now "foogarsh!".  */
 
-  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_strchrnul_works=yes
-else
-  gl_cv_func_strchrnul_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_ftello_works=yes
+else $as_nop
+  gl_cv_func_ftello_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5
-$as_echo "$gl_cv_func_strchrnul_works" >&6; }
-    case "$gl_cv_func_strchrnul_works" in
-      *yes) ;;
-      *) REPLACE_STRCHRNUL=1 ;;
-    esac
-  fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ftello_works" >&5
+printf "%s\n" "$gl_cv_func_ftello_works" >&6; }
+      case "$gl_cv_func_ftello_works" in
+        *yes) ;;
+        *)
+          REPLACE_FTELLO=1
 
-  if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
+printf "%s\n" "#define FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE 1" >>confdefs.h
 
+          ;;
+      esac
+    fi
+    if test $REPLACE_FTELLO = 0; then
 
+      if test $gl_ftello_broken_after_ungetc = yes; then
+        REPLACE_FTELLO=1
 
+printf "%s\n" "#define FTELLO_BROKEN_AFTER_UNGETC 1" >>confdefs.h
 
+      fi
+    fi
+  fi
 
+  if test $HAVE_FTELLO = 0 || test $REPLACE_FTELLO = 1; then
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS strchrnul.$ac_objext"
 
-    :
-  fi
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS ftello.$ac_objext"
 
-          GNULIB_STRCHRNUL=1
 
+      ac_fn_c_check_func "$LINENO" "_ftelli64" "ac_cv_func__ftelli64"
+if test "x$ac_cv_func__ftelli64" = xyes
+then :
+  printf "%s\n" "#define HAVE__FTELLI64 1" >>confdefs.h
 
+fi
 
 
+  fi
 
-$as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
 
 
 
@@ -32441,58 +35939,14 @@ $as_echo "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
 
 
 
-  if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
-$as_echo_n "checking for working strerror function... " >&6; }
-if ${gl_cv_func_working_strerror+:} false; 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_working_strerror="guessing yes" ;;
-                   # If we don't know, assume the worst.
-           *)      gl_cv_func_working_strerror="guessing no" ;;
-         esac
+          GL_M4_GNULIB_FTELLO=1
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
 
-int
-main ()
-{
-if (!*strerror (-2)) return 1;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_working_strerror=yes
-else
-  gl_cv_func_working_strerror=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
-$as_echo "$gl_cv_func_working_strerror" >&6; }
-    case "$gl_cv_func_working_strerror" in
-      *yes) ;;
-      *)
-                        REPLACE_STRERROR=1
-        ;;
-    esac
 
-  else
-            REPLACE_STRERROR=1
-  fi
+printf "%s\n" "#define GNULIB_TEST_FTELLO 1" >>confdefs.h
 
-  if test $REPLACE_STRERROR = 1; then
 
 
 
@@ -32500,150 +35954,516 @@ $as_echo "$gl_cv_func_working_strerror" >&6; }
 
 
 
+  gl_abort_bug=no
+  case "$host_os" in
+    mingw*)
+      gl_cv_func_getcwd_path_max=yes
+      ;;
+    *)
 
-  M4_LIBOBJS="$M4_LIBOBJS strerror.$ac_objext"
 
-  fi
 
 
-cat >>confdefs.h <<_ACEOF
-#define GNULIB_STRERROR 1
-_ACEOF
-
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getcwd handles long file names properly" >&5
+printf %s "checking whether getcwd handles long file names properly... " >&6; }
+if test ${gl_cv_func_getcwd_path_max+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  # Arrange for deletion of the temporary directory this test creates.
+     ac_clean_files="$ac_clean_files confdir3"
+          if test "$cross_compiling" = yes
+then :
+  # Cross-compilation guesses:
+        case "$host_os" in
+          aix*) # On AIX, it has the AIX bug.
+            gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
+          gnu*) # On Hurd, it is 'yes'.
+            gl_cv_func_getcwd_path_max='guessing yes' ;;
+          linux* | kfreebsd*)
+            # On older Linux+glibc it's 'no, but it is partly working',
+            # on newer Linux+glibc it's 'yes'.
+            # On Linux+musl libc, it's 'no, but it is partly working'.
+            # On kFreeBSD+glibc, it's 'no, but it is partly working'.
+            gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
+          *) # If we don't know, obey --enable-cross-guesses.
+            gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
+        esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <errno.h>
+#include <stdlib.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else
+# include <direct.h>
+#endif
+#include <string.h>
+#include <limits.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
 
 
+/* Arrange to define PATH_MAX, like "pathmax.h" does. */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <limits.h>
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+#ifdef __hpux
+# undef PATH_MAX
+# define PATH_MAX 1024
+#endif
+#if defined _WIN32 && ! defined __CYGWIN__
+# undef PATH_MAX
+# define PATH_MAX 260
+#endif
 
-          GNULIB_STRERROR=1
 
+#ifndef AT_FDCWD
+# define AT_FDCWD 0
+#endif
+#ifdef ENAMETOOLONG
+# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
+#else
+# define is_ENAMETOOLONG(x) 0
+#endif
 
+/* Use the getcwd function, not any macro.  */
+#undef getcwd
 
 
 
-$as_echo "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
+$gl_mda_defines
 
 
+#ifndef S_IRWXU
+# define S_IRWXU 0700
+#endif
 
+/* The length of this name must be 8.  */
+#define DIR_NAME "confdir3"
+#define DIR_NAME_LEN 8
+#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
 
+/* The length of "../".  */
+#define DOTDOTSLASH_LEN 3
 
-  if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+/* Leftover bytes in the buffer, to work around library or OS bugs.  */
+#define BUF_SLOP 20
 
+int
+main ()
+{
+#ifndef PATH_MAX
+  /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
+     at least not on a local file system.  And if we were to start worrying
+     about remote file systems, we'd have to enable the wrapper function
+     all of the time, just to be safe.  That's not worth the cost.  */
+  exit (0);
+#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
+        - DIR_NAME_SIZE - BUF_SLOP) \
+       <= PATH_MAX)
+  /* FIXME: Assuming there's a system for which this is true,
+     this should be done in a compile test.  */
+  exit (0);
+#else
+  char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
+           + DIR_NAME_SIZE + BUF_SLOP];
+  char *cwd = getcwd (buf, PATH_MAX);
+  size_t initial_cwd_len;
+  size_t cwd_len;
+  int fail = 0;
+  size_t n_chdirs = 0;
 
+  if (cwd == NULL)
+    exit (10);
 
+  cwd_len = initial_cwd_len = strlen (cwd);
 
+  while (1)
+    {
+      size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
+      char *c = NULL;
+
+      cwd_len += DIR_NAME_SIZE;
+      /* If mkdir or chdir fails, it could be that this system cannot create
+         any file with an absolute name longer than PATH_MAX, such as cygwin.
+         If so, leave fail as 0, because the current working directory can't
+         be too long for getcwd if it can't even be created.  On Linux with
+         the 9p file system, mkdir fails with error EINVAL when cwd_len gets
+         too long; ignore this failure because the getcwd() system call
+         produces good results whereas the gnulib substitute calls getdents64
+         which fails with error EPROTO.
+         For other errors, be pessimistic and consider that as a failure,
+         too.  */
+      if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
+        {
+          if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
+            #ifdef __linux__
+            if (! (errno == EINVAL))
+            #endif
+              fail = 20;
+          break;
+        }
 
+      if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
+        {
+          struct stat sb;
 
+          c = getcwd (buf, PATH_MAX);
+          if (!c && errno == ENOENT)
+            {
+              fail = 11;
+              break;
+            }
+          if (c)
+            {
+              fail = 31;
+              break;
+            }
+          if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
+            {
+              fail = 21;
+              break;
+            }
 
+          /* Our replacement needs to be able to stat() long ../../paths,
+             so generate a path larger than PATH_MAX to check,
+             avoiding the replacement if we can't stat().  */
+          c = getcwd (buf, cwd_len + 1);
+          if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
+            {
+              fail = 32;
+              break;
+            }
+        }
 
-  M4_LIBOBJS="$M4_LIBOBJS strerror-override.$ac_objext"
+      if (dotdot_max <= cwd_len - initial_cwd_len)
+        {
+          if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
+            break;
+          c = getcwd (buf, cwd_len + 1);
+          if (!c)
+            {
+              if (! (errno == ERANGE || errno == ENOENT
+                     || is_ENAMETOOLONG (errno)))
+                {
+                  fail = 22;
+                  break;
+                }
+              if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
+                {
+                  fail = 12;
+                  break;
+                }
+            }
+        }
 
+      if (c && strlen (c) != cwd_len)
+        {
+          fail = 23;
+          break;
+        }
+      ++n_chdirs;
+    }
 
+  /* Leaving behind such a deep directory is not polite.
+     So clean up here, right away, even though the driving
+     shell script would also clean up.  */
+  {
+    size_t i;
 
+    /* Try rmdir first, in case the chdir failed.  */
+    rmdir (DIR_NAME);
+    for (i = 0; i <= n_chdirs; i++)
+      {
+        if (chdir ("..") < 0)
+          break;
+        if (rmdir (DIR_NAME) != 0)
+          break;
+      }
+  }
 
+  exit (fail);
+#endif
+}
 
-  if test $ac_cv_header_sys_socket_h != yes; then
-                    for ac_header in winsock2.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
-if test "x$ac_cv_header_winsock2_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_WINSOCK2_H 1
 _ACEOF
-
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_getcwd_path_max=yes
+else $as_nop
+  case $? in
+        10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
+        31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
+        32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
+        *) gl_cv_func_getcwd_path_max=no;;
+        esac
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-done
 
-  fi
-  if test "$ac_cv_header_winsock2_h" = yes; then
-    HAVE_WINSOCK2_H=1
-    UNISTD_H_HAVE_WINSOCK2_H=1
-    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
-  else
-    HAVE_WINSOCK2_H=0
-  fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_path_max" >&5
+printf "%s\n" "$gl_cv_func_getcwd_path_max" >&6; }
+
+      case "$gl_cv_func_getcwd_null" in
+        *yes)
 
 
-  fi
 
 
 
 
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
+printf %s "checking for getpagesize... " >&6; }
+if test ${gl_cv_func_getpagesize+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+int
+main (void)
+{
+return getpagesize();
+  ;
+  return 0;
+}
 
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_getpagesize=yes
+else $as_nop
+  gl_cv_func_getpagesize=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
+printf "%s\n" "$gl_cv_func_getpagesize" >&6; }
 
+  if test $gl_cv_func_getpagesize = yes; then
 
+printf "%s\n" "#define HAVE_GETPAGESIZE 1" >>confdefs.h
 
-  if test $ac_cv_have_decl_strndup = no; then
-    HAVE_DECL_STRNDUP=0
   fi
 
-  if test $ac_cv_func_strndup = yes; then
-    HAVE_STRNDUP=1
-    # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5
-$as_echo_n "checking for working strndup... " >&6; }
-if ${gl_cv_func_strndup_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-
-          case $host_os in
-            aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";;
-            *)               gl_cv_func_strndup_works="guessing yes";;
-          esac
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getcwd succeeds when 4k < cwd_length < 16k" >&5
+printf %s "checking whether getcwd succeeds when 4k < cwd_length < 16k... " >&6; }
+if test ${gl_cv_func_getcwd_succeeds_beyond_4k+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  # Remove any remnants of a previous test.
+     rm -rf confdir-14B---
+     # Arrange for deletion of the temporary directory this test creates.
+     ac_clean_files="$ac_clean_files confdir-14B---"
+          if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+             # Guess no otherwise, even on glibc systems and musl systems.
+          *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no"
+        esac
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-         #include <string.h>
-                           #include <stdlib.h>
+#include <errno.h>
+#include <stdlib.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <direct.h>
+#endif
+#include <string.h>
+#include <sys/stat.h>
+
+
+/* Arrange to define PATH_MAX, like "pathmax.h" does. */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#include <limits.h>
+#if defined HAVE_SYS_PARAM_H && !defined PATH_MAX && !defined MAXPATHLEN
+# include <sys/param.h>
+#endif
+#if !defined PATH_MAX && defined MAXPATHLEN
+# define PATH_MAX MAXPATHLEN
+#endif
+#ifdef __hpux
+# undef PATH_MAX
+# define PATH_MAX 1024
+#endif
+#if defined _WIN32 && ! defined __CYGWIN__
+# undef PATH_MAX
+# define PATH_MAX 260
+#endif
+
+
+
+$gl_mda_defines
+
+
+#ifndef S_IRWXU
+# define S_IRWXU 0700
+#endif
+
+/* FIXME: skip the run-test altogether on systems without getpagesize.  */
+#if ! HAVE_GETPAGESIZE
+# define getpagesize() 0
+#endif
+
+/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
+   the 16kB pagesize on ia64 linux.  Those conditions make the code below
+   trigger a bug in glibc's getcwd implementation before 2.4.90-10.  */
+#define TARGET_LEN (5 * 1024)
+
 int
 main ()
 {
+  char *cwd;
+  size_t initial_cwd_len;
+  int fail = 0;
 
-#if !HAVE_DECL_STRNDUP
-  extern
-  #ifdef __cplusplus
-  "C"
-  #endif
-  char *strndup (const char *, size_t);
+  /* The bug is triggered when PATH_MAX < getpagesize (), so skip
+     this relatively expensive and invasive test if that's not true.  */
+#ifdef PATH_MAX
+  int bug_possible = PATH_MAX < getpagesize ();
+#else
+  int bug_possible = 0;
 #endif
-  int result;
-  char *s;
-  s = strndup ("some longer string", 15);
-  free (s);
-  s = strndup ("shorter string", 13);
-  result = s[13] != '\0';
-  free (s);
-  return result;
-  ;
-  return 0;
+  if (! bug_possible)
+    return 0;
+
+  cwd = getcwd (NULL, 0);
+  if (cwd == NULL)
+    return 2;
+
+  initial_cwd_len = strlen (cwd);
+  free (cwd);
+
+  if (1)
+    {
+      static char const dir_name[] = "confdir-14B---";
+      size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
+                              / sizeof dir_name);
+      size_t d;
+      for (d = 0; d < desired_depth; d++)
+        {
+          if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
+            {
+              if (! (errno == ERANGE || errno == ENAMETOOLONG
+                     || errno == ENOENT))
+                fail = 3; /* Unable to construct deep hierarchy.  */
+              break;
+            }
+        }
+
+      /* If libc has the bug in question, this invocation of getcwd
+         results in a failed assertion.  */
+      cwd = getcwd (NULL, 0);
+      if (cwd == NULL)
+        fail = 4; /* getcwd didn't assert, but it failed for a long name
+                     where the answer could have been learned.  */
+      free (cwd);
+
+      /* Call rmdir first, in case the above chdir failed.  */
+      rmdir (dir_name);
+      while (0 < d--)
+        {
+          if (chdir ("..") < 0)
+            {
+              fail = 5;
+              break;
+            }
+          rmdir (dir_name);
+        }
+    }
+
+  return fail;
 }
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_strndup_works=yes
-else
-  gl_cv_func_strndup_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_getcwd_succeeds_beyond_4k=yes
+else $as_nop
+                                                          ret=$?
+        if test $ret -ge 128 || test $ret = 4; then
+          gl_cv_func_getcwd_succeeds_beyond_4k=no
+        else
+          gl_cv_func_getcwd_succeeds_beyond_4k=yes
+        fi
+
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup_works" >&5
-$as_echo "$gl_cv_func_strndup_works" >&6; }
-    case $gl_cv_func_strndup_works in
-      *no) REPLACE_STRNDUP=1 ;;
-    esac
-  else
-    HAVE_STRNDUP=0
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getcwd_succeeds_beyond_4k" >&5
+printf "%s\n" "$gl_cv_func_getcwd_succeeds_beyond_4k" >&6; }
+  case "$gl_cv_func_getcwd_succeeds_beyond_4k" in
+    *no)
+      gl_abort_bug=yes
+      ;;
+    *)
+
+      ;;
+  esac
+
+          ;;
+      esac
+      ;;
+  esac
+      case "$gl_cv_func_getcwd_path_max" in
+    *"no" | *"no, it has the AIX bug") ;;
+    *)
+
+printf "%s\n" "#define HAVE_MINIMALLY_WORKING_GETCWD 1" >>confdefs.h
+
+      ;;
+  esac
+  case "$gl_cv_func_getcwd_path_max" in
+    *"no, but it is partly working")
+
+printf "%s\n" "#define HAVE_PARTLY_WORKING_GETCWD 1" >>confdefs.h
+
+      ;;
+    *"yes, but with shorter paths")
+
+printf "%s\n" "#define HAVE_GETCWD_SHORTER 1" >>confdefs.h
+
+      ;;
+  esac
+
+  if { case "$gl_cv_func_getcwd_null" in *yes) false;; *) true;; esac; } \
+     || test $gl_cv_func_getcwd_posix_signature != yes \
+     || { case "$gl_cv_func_getcwd_path_max" in *yes*) false;; *) true;; esac; } \
+     || test $gl_abort_bug = yes; then
+    REPLACE_GETCWD=1
   fi
 
-  if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
+  if test $REPLACE_GETCWD = 1; then
 
 
 
@@ -32652,21 +36472,21 @@ $as_echo "$gl_cv_func_strndup_works" >&6; }
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS strndup.$ac_objext"
+  M4_LIBOBJS="$M4_LIBOBJS getcwd.$ac_objext"
 
-  fi
 
 
 
+  :
 
+  fi
 
-          GNULIB_STRNDUP=1
 
+printf "%s\n" "#define GNULIB_GETCWD 1" >>confdefs.h
 
 
 
 
-$as_echo "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h
 
 
 
@@ -32674,607 +36494,322 @@ $as_echo "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h
 
 
 
+          GL_M4_GNULIB_GETCWD=1
 
 
-  if test $ac_cv_have_decl_strnlen = no; then
-    HAVE_DECL_STRNLEN=0
-  else
 
-         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
-$as_echo_n "checking for working strnlen... " >&6; }
-if ${ac_cv_func_strnlen_working+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  # Guess no on AIX systems, yes otherwise.
-               case "$host_os" in
-                 aix*) ac_cv_func_strnlen_working=no;;
-                 *)    ac_cv_func_strnlen_working=yes;;
-               esac
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
 
-#define S "foobar"
-#define S_LEN (sizeof S - 1)
 
-  /* At least one implementation is buggy: that of AIX 4.3 would
-     give strnlen (S, 1) == 3.  */
+printf "%s\n" "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
 
-  int i;
-  for (i = 0; i < S_LEN + 1; ++i)
-    {
-      int expected = i <= S_LEN ? i : S_LEN;
-      if (strnlen (S, i) != expected)
-       return 1;
-    }
-  return 0;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_func_strnlen_working=yes
-else
-  ac_cv_func_strnlen_working=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5
-$as_echo "$ac_cv_func_strnlen_working" >&6; }
-test $ac_cv_func_strnlen_working = no && :
 
 
-    if test $ac_cv_func_strnlen_working = no; then
-      REPLACE_STRNLEN=1
-    fi
-  fi
 
-  if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
 
 
+  case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
+  *yes,yes) ;;
+  *)
+        REPLACE_GETCWD=1
+    ;;
+  esac
 
+  if test $REPLACE_GETCWD = 1; then
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS strnlen.$ac_objext"
 
-    :
+
+
+  M4_LIBOBJS="$M4_LIBOBJS getcwd-lgpl.$ac_objext"
+
   fi
 
 
 
 
 
-          GNULIB_STRNLEN=1
 
 
 
 
+          GL_M4_GNULIB_GETCWD=1
 
-$as_echo "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
 
 
 
 
 
-  if test $ac_cv_have_decl_strsignal = no; then
-    HAVE_DECL_STRSIGNAL=0
-  fi
 
-  for ac_func in strsignal
-do :
-  ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal"
-if test "x$ac_cv_func_strsignal" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STRSIGNAL 1
-_ACEOF
 
-fi
-done
 
-  if test $ac_cv_func_strsignal = yes; then
-    HAVE_STRSIGNAL=1
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strsignal always returns a string" >&5
-$as_echo_n "checking whether strsignal always returns a string... " >&6; }
-if ${gl_cv_func_working_strsignal+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
+  if test $ac_cv_func_getdtablesize = yes &&
+     test $ac_cv_have_decl_getdtablesize = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getdtablesize works" >&5
+printf %s "checking whether getdtablesize works... " >&6; }
+if test ${gl_cv_func_getdtablesize_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+                                                   case "$host_os" in
+         vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
+         *)
+                                                       if test "$cross_compiling" = yes
+then :
   case "$host_os" in
-            solaris* | aix*) gl_cv_func_working_strsignal=no;;
-            *)               gl_cv_func_working_strsignal="guessing yes";;
-          esac
-else
+                cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
+                  gl_cv_func_getdtablesize_works="guessing no" ;;
+                *) gl_cv_func_getdtablesize_works="guessing yes" ;;
+              esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <string.h>
-#include <unistd.h> /* NetBSD 5.0 declares it in wrong header. */
+
+             #include <unistd.h>
+
+
+$gl_mda_defines
+
 
 int
-main ()
+main (void)
 {
-int result = 0;
-              char *s = strsignal (-1);
-              if (s == (char *) 0)
-                result |= 1;
-              if (s == (char *) -1)
-                result |= 2;
-              return result;
+int size = getdtablesize();
+                 if (dup2 (0, getdtablesize()) != -1)
+                   return 1;
+                 if (size != getdtablesize())
+                   return 2;
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_working_strsignal=yes
-else
-  gl_cv_func_working_strsignal=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_getdtablesize_works=yes
+else $as_nop
+  gl_cv_func_getdtablesize_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+           ;;
+       esac
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strsignal" >&5
-$as_echo "$gl_cv_func_working_strsignal" >&6; }
-    if test "$gl_cv_func_working_strsignal" = no; then
-      REPLACE_STRSIGNAL=1
-    fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getdtablesize_works" >&5
+printf "%s\n" "$gl_cv_func_getdtablesize_works" >&6; }
+    case "$gl_cv_func_getdtablesize_works" in
+      *yes | "no (limitation)") ;;
+      *) REPLACE_GETDTABLESIZE=1 ;;
+    esac
   else
-    HAVE_STRSIGNAL=0
+    HAVE_GETDTABLESIZE=0
   fi
 
-  if test $HAVE_STRSIGNAL = 0 || test $REPLACE_STRSIGNAL = 1; then
-
-
+  if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
 
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS strsignal.$ac_objext"
 
 
+  M4_LIBOBJS="$M4_LIBOBJS getdtablesize.$ac_objext"
 
+    :
+  fi
 
-  ac_fn_c_check_decl "$LINENO" "_sys_siglist" "ac_cv_have_decl__sys_siglist" "#include <signal.h>
-"
-if test "x$ac_cv_have_decl__sys_siglist" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL__SYS_SIGLIST $ac_have_decl
-_ACEOF
 
 
-  fi
 
 
 
 
 
-          GNULIB_STRSIGNAL=1
+          GL_M4_GNULIB_GETDTABLESIZE=1
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_STRSIGNAL 1" >>confdefs.h
+printf "%s\n" "#define GNULIB_TEST_GETDTABLESIZE 1" >>confdefs.h
 
 
 
 
 
-  if test $REPLACE_STRSTR = 0; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5
-$as_echo_n "checking whether strstr works in linear time... " >&6; }
-if ${gl_cv_func_strstr_linear+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-                             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
-     && !(defined __i386__ || defined __x86_64__) \
-     && !defined __UCLIBC__
-  Lucky user
- #endif
-#endif
-#ifdef __CYGWIN__
- #include <cygwin/version.h>
- #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
-  Lucky user
- #endif
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky user" >/dev/null 2>&1; then :
-  gl_cv_func_strstr_linear="guessing yes"
-else
-  gl_cv_func_strstr_linear="guessing no"
-fi
-rm -f conftest*
 
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#ifdef __MVS__
-/* z/OS does not deliver signals while strstr() is running (thanks to
-   restrictions on its LE runtime), which prevents us from limiting the
-   running time of this test.  */
-# error "This test does not work properly on z/OS"
-#endif
-#include <signal.h> /* for signal */
-#include <string.h> /* for strstr */
-#include <stdlib.h> /* for malloc */
-#include <unistd.h> /* for alarm */
-static void quit (int sig) { _exit (sig + 128); }
 
-int
-main ()
-{
 
-    int result = 0;
-    size_t m = 1000000;
-    char *haystack = (char *) malloc (2 * m + 2);
-    char *needle = (char *) malloc (m + 2);
-    /* Failure to compile this test due to missing alarm is okay,
-       since all such platforms (mingw) also have quadratic strstr.  */
-    signal (SIGALRM, quit);
-    alarm (5);
-    /* Check for quadratic performance.  */
-    if (haystack && needle)
-      {
-        memset (haystack, 'A', 2 * m);
-        haystack[2 * m] = 'B';
-        haystack[2 * m + 1] = 0;
-        memset (needle, 'A', m);
-        needle[m] = 'B';
-        needle[m + 1] = 0;
-        if (!strstr (haystack, needle))
-          result |= 1;
-      }
-    return result;
+    REPLACE_GETOPT=0
+    if test -n "$gl_replace_getopt"; then
+      REPLACE_GETOPT=1
+    fi
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_strstr_linear=yes
-else
-  gl_cv_func_strstr_linear=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  if test $REPLACE_GETOPT = 1; then
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5
-$as_echo "$gl_cv_func_strstr_linear" >&6; }
-    case "$gl_cv_func_strstr_linear" in
-      *yes) ;;
-      *)
-        REPLACE_STRSTR=1
-        ;;
-    esac
+  if test $ac_cv_header_sys_cdefs_h = yes; then
+    HAVE_SYS_CDEFS_H=1
+  else
+    HAVE_SYS_CDEFS_H=0
   fi
 
-  if test $REPLACE_STRSTR = 1; then
-
-
-
 
 
+printf "%s\n" "#define __GETOPT_PREFIX rpl_" >>confdefs.h
 
+  GETOPT_H=getopt.h
+  GETOPT_CDEFS_H=getopt-cdefs.h
 
 
-  M4_LIBOBJS="$M4_LIBOBJS strstr.$ac_objext"
 
   fi
 
+  if test $REPLACE_GETOPT = 1; then
 
 
-  if test "$gl_cv_func_memchr_works" != yes; then
-    REPLACE_STRSTR=1
-  else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
-$as_echo_n "checking whether strstr works... " >&6; }
-if ${gl_cv_func_strstr_works_always+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-                                               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#ifdef __GNU_LIBRARY__
- #include <features.h>
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
-     || defined __UCLIBC__
-  Lucky user
- #endif
-#elif defined __CYGWIN__
- #include <cygwin/version.h>
- #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
-  Lucky user
- #endif
-#else
-  Lucky user
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky user" >/dev/null 2>&1; then :
-  gl_cv_func_strstr_works_always="guessing yes"
-else
-  gl_cv_func_strstr_works_always="guessing no"
-fi
-rm -f conftest*
 
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <string.h> /* for strstr */
-#define P "_EF_BF_BD"
-#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
-#define NEEDLE P P P P P
 
-int
-main ()
-{
-return !!strstr (HAYSTACK, NEEDLE);
+  M4_LIBOBJS="$M4_LIBOBJS getopt.$ac_objext"
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_strstr_works_always=yes
-else
-  gl_cv_func_strstr_works_always=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
-$as_echo "$gl_cv_func_strstr_works_always" >&6; }
-    case "$gl_cv_func_strstr_works_always" in
-      *yes) ;;
-      *)
-        REPLACE_STRSTR=1
-        ;;
-    esac
-  fi
 
-  if test $REPLACE_STRSTR = 1; then
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS getopt1.$ac_objext"
 
+        GNULIB_GL_M4_UNISTD_H_GETOPT=1
+  fi
 
 
-  M4_LIBOBJS="$M4_LIBOBJS strstr.$ac_objext"
 
-  fi
 
 
 
 
 
-          GNULIB_STRSTR=1
 
 
+          GL_M4_GNULIB_GETOPT_POSIX=1
 
 
 
-$as_echo "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
 
 
+printf "%s\n" "#define GNULIB_TEST_GETOPT_POSIX 1" >>confdefs.h
 
 
 
 
-  if test $HAVE_STRTOD = 1; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether strtod obeys C99" >&5
-$as_echo_n "checking whether strtod obeys C99... " >&6; }
-if ${gl_cv_func_strtod_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \
-     && !defined __UCLIBC__
-  Lucky user
- #endif
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "Lucky user" >/dev/null 2>&1; then :
-  gl_cv_func_strtod_works="guessing yes"
-else
-  gl_cv_func_strtod_works="guessing no"
-fi
-rm -f conftest*
 
-else
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for getpagesize" >&5
+printf %s "checking for getpagesize... " >&6; }
+if test ${gl_cv_func_getpagesize+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-
-#include <stdlib.h>
-#include <math.h>
-#include <errno.h>
-/* Compare two numbers with ==.
-   This is a separate function because IRIX 6.5 "cc -O" miscompiles an
-   'x == x' test.  */
-static int
-numeric_equal (double x, double y)
-{
-  return x == y;
-}
-
+#include <unistd.h>
 int
-main ()
+main (void)
 {
-
-  int result = 0;
-  {
-    /* In some old versions of Linux (2000 or before), strtod mis-parses
-       strings with leading '+'.  */
-    const char *string = " +69";
-    char *term;
-    double value = strtod (string, &term);
-    if (value != 69 || term != (string + 4))
-      result |= 1;
-  }
-  {
-    /* Under Solaris 2.4, strtod returns the wrong value for the
-       terminating character under some conditions.  */
-    const char *string = "NaN";
-    char *term;
-    strtod (string, &term);
-    if (term != string && *(term - 1) == 0)
-      result |= 2;
-  }
-  {
-    /* Older glibc and Cygwin mis-parse "-0x".  */
-    const char *string = "-0x";
-    char *term;
-    double value = strtod (string, &term);
-    double zero = 0.0;
-    if (1.0 / value != -1.0 / zero || term != (string + 2))
-      result |= 4;
-  }
-  {
-    /* Many platforms do not parse hex floats.  */
-    const char *string = "0XaP+1";
-    char *term;
-    double value = strtod (string, &term);
-    if (value != 20.0 || term != (string + 6))
-      result |= 8;
-  }
-  {
-    /* Many platforms do not parse infinities.  HP-UX 11.31 parses inf,
-       but mistakenly sets errno.  */
-    const char *string = "inf";
-    char *term;
-    double value;
-    errno = 0;
-    value = strtod (string, &term);
-    if (value != HUGE_VAL || term != (string + 3) || errno)
-      result |= 16;
-  }
-  {
-    /* glibc 2.7 and cygwin 1.5.24 misparse "nan()".  */
-    const char *string = "nan()";
-    char *term;
-    double value = strtod (string, &term);
-    if (numeric_equal (value, value) || term != (string + 5))
-      result |= 32;
-  }
-  {
-    /* darwin 10.6.1 misparses "nan(".  */
-    const char *string = "nan(";
-    char *term;
-    double value = strtod (string, &term);
-    if (numeric_equal (value, value) || term != (string + 3))
-      result |= 64;
-  }
-  return result;
-
+return getpagesize();
   ;
   return 0;
 }
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_strtod_works=yes
-else
-  gl_cv_func_strtod_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_getpagesize=yes
+else $as_nop
+  gl_cv_func_getpagesize=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtod_works" >&5
-$as_echo "$gl_cv_func_strtod_works" >&6; }
-    case "$gl_cv_func_strtod_works" in
-      *yes) ;;
-      *)
-        REPLACE_STRTOD=1
-        ;;
-    esac
-  fi
-
-  if test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1; then
-
-
-
-
-
-
-
-
-  M4_LIBOBJS="$M4_LIBOBJS strtod.$ac_objext"
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getpagesize" >&5
+printf "%s\n" "$gl_cv_func_getpagesize" >&6; }
 
+  if test $gl_cv_func_getpagesize = no; then
+    HAVE_GETPAGESIZE=0
+    ac_fn_c_check_header_compile "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default"
+if test "x$ac_cv_header_OS_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_OS_H 1" >>confdefs.h
 
+fi
 
-  if test $gl_cv_func_ldexp_no_libm = yes; then
+    if test $ac_cv_header_OS_h = yes; then
+      HAVE_OS_H=1
+    fi
+    ac_fn_c_check_header_compile "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_param_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_SYS_PARAM_H 1" >>confdefs.h
 
-$as_echo "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h
+fi
 
+    if test $ac_cv_header_sys_param_h = yes; then
+      HAVE_SYS_PARAM_H=1
+    fi
   fi
+  case "$host_os" in
+    mingw*)
+      REPLACE_GETPAGESIZE=1
+      ;;
+  esac
+      ac_fn_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_getpagesize" = xyes
+then :
 
-  fi
+else $as_nop
+  HAVE_DECL_GETPAGESIZE=0
+fi
 
+  if test $REPLACE_GETPAGESIZE = 1; then
 
 
 
 
-          GNULIB_STRTOD=1
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS getpagesize.$ac_objext"
 
-$as_echo "#define GNULIB_TEST_STRTOD 1" >>confdefs.h
+  fi
 
 
 
@@ -33284,114 +36819,211 @@ $as_echo "#define GNULIB_TEST_STRTOD 1" >>confdefs.h
 
 
 
+          GL_M4_GNULIB_GETPAGESIZE=1
 
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_sys_stat_h='<'sys/stat.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/stat.h>" >&5
-$as_echo_n "checking absolute name of <sys/stat.h>... " >&6; }
-if ${gl_cv_next_sys_stat_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-             if test $ac_cv_header_sys_stat_h = yes; then
 
 
+  ac_found=0
+  ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_program_invocation_name" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h
+if test $ac_have_decl = 1
+then :
+  ac_found=1
+fi
 
+  ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h
+if test $ac_have_decl = 1
+then :
+  ac_found=1
+fi
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/stat.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
+  ac_fn_check_decl "$LINENO" "__argv" "ac_cv_have_decl___argv" "#include <stdlib.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl___argv" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL___ARGV $ac_have_decl" >>confdefs.h
+if test $ac_have_decl = 1
+then :
+  ac_found=1
+fi
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'sys/stat.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
 
-        gl_cv_absolute_sys_stat_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
+  # Incur the cost of this test only if none of the above worked.
+  if test $ac_found = 0; then
+    # On OpenBSD 5.1, using the global __progname variable appears to be
+    # the only way to implement getprogname.
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether __progname is defined in default libraries" >&5
+printf %s "checking whether __progname is defined in default libraries... " >&6; }
+if test ${gl_cv_var___progname+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-           gl_header=$gl_cv_absolute_sys_stat_h
-           gl_cv_next_sys_stat_h='"'$gl_header'"'
-          else
-               gl_cv_next_sys_stat_h='<'sys/stat.h'>'
-             fi
+        gl_cv_var___progname=
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern char *__progname;
+int
+main (void)
+{
+return *__progname;
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_var___progname=yes
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_stat_h" >&5
-$as_echo "$gl_cv_next_sys_stat_h" >&6; }
-     fi
-     NEXT_SYS_STAT_H=$gl_cv_next_sys_stat_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='<'sys/stat.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_sys_stat_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H=$gl_next_as_first_directive
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_var___progname" >&5
+printf "%s\n" "$gl_cv_var___progname" >&6; }
+    if test "$gl_cv_var___progname" = yes; then
 
+printf "%s\n" "#define HAVE_VAR___PROGNAME 1" >>confdefs.h
 
+    fi
+  fi
 
 
 
 
 
+  if test "$ac_cv_func_getrandom" != yes; then
+    HAVE_GETRANDOM=0
+  else
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getrandom is compatible with its GNU+BSD signature" >&5
+printf %s "checking whether getrandom is compatible with its GNU+BSD signature... " >&6; }
+if test ${gl_cv_func_getrandom_ok+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Additional includes are needed before <sys/random.h> on uClibc
+                 and Mac OS X.  */
+              #include <sys/types.h>
+              #include <stdlib.h>
+              #include <sys/random.h>
+              ssize_t getrandom (void *, size_t, unsigned int);
 
+int
+main (void)
+{
 
-  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
+  ;
+  return 0;
+}
 
-$as_echo "#define _GL_WINDOWS_64_BIT_ST_SIZE 1" >>confdefs.h
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_getrandom_ok=yes
+else $as_nop
+  gl_cv_func_getrandom_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_getrandom_ok" >&5
+printf "%s\n" "$gl_cv_func_getrandom_ok" >&6; }
+    if test $gl_cv_func_getrandom_ok = no; then
+      REPLACE_GETRANDOM=1
+    fi
   fi
 
-      ac_fn_c_check_type "$LINENO" "nlink_t" "ac_cv_type_nlink_t" "#include <sys/types.h>
-     #include <sys/stat.h>
-"
-if test "x$ac_cv_type_nlink_t" = xyes; then :
-
-else
+  case "$host_os" in
+    mingw*)
+      ac_fn_c_check_header_compile "$LINENO" "bcrypt.h" "ac_cv_header_bcrypt_h" "#include <windows.h>
 
-$as_echo "#define nlink_t int" >>confdefs.h
+"
+if test "x$ac_cv_header_bcrypt_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_BCRYPT_H 1" >>confdefs.h
 
 fi
 
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the bcrypt library is guaranteed to be present" >&5
+printf %s "checking whether the bcrypt library is guaranteed to be present... " >&6; }
+if test ${gl_cv_lib_assume_bcrypt+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <windows.h>
+int
+main (void)
+{
+#if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
+                  cannot assume it
+                #endif
 
+  ;
+  return 0;
+}
 
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_lib_assume_bcrypt=yes
+else $as_nop
+  gl_cv_lib_assume_bcrypt=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_lib_assume_bcrypt" >&5
+printf "%s\n" "$gl_cv_lib_assume_bcrypt" >&6; }
+      if test $gl_cv_lib_assume_bcrypt = yes; then
 
+printf "%s\n" "#define HAVE_LIB_BCRYPT 1" >>confdefs.h
 
+        LIB_GETRANDOM='-lbcrypt'
+      else
+        LIB_GETRANDOM='-ladvapi32'
+      fi
+      ;;
+    *)
+      LIB_GETRANDOM= ;;
+  esac
 
 
+  if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then
 
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS getrandom.$ac_objext"
 
+  fi
 
 
 
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_sys_wait_h='<'sys/wait.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <sys/wait.h>" >&5
-$as_echo_n "checking absolute name of <sys/wait.h>... " >&6; }
-if ${gl_cv_next_sys_wait_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-             if test $ac_cv_header_sys_wait_h = yes; then
-
 
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/wait.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
+          GL_M4_GNULIB_GETRANDOM=1
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'sys/wait.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
 
-        gl_cv_absolute_sys_wait_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_sys_wait_h
-           gl_cv_next_sys_wait_h='"'$gl_header'"'
-          else
-               gl_cv_next_sys_wait_h='<'sys/wait.h'>'
-             fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_sys_wait_h" >&5
-$as_echo "$gl_cv_next_sys_wait_h" >&6; }
-     fi
-     NEXT_SYS_WAIT_H=$gl_cv_next_sys_wait_h
+printf "%s\n" "#define GNULIB_TEST_GETRANDOM 1" >>confdefs.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='<'sys/wait.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_sys_wait_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H=$gl_next_as_first_directive
 
 
 
 
+  # Autoconf 2.61a.99 and earlier don't support linking a file only
+  # in VPATH builds.  But since GNUmakefile is for maintainer use
+  # only, it does not matter if we skip the link with older autoconf.
+  # Automake 1.10.1 and earlier try to remove GNUmakefile in non-VPATH
+  # builds, so use a shell variable to bypass this.
+  GNUmakefile=GNUmakefile
+  ac_config_links="$ac_config_links $GNUmakefile:$GNUmakefile"
 
 
+  LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
 
 
 
 
 
 
-  :
 
 
 
@@ -33492,12 +37079,12 @@ $as_echo "$gl_cv_next_sys_wait_h" >&6; }
 
 
 
+          GL_M4_GNULIB_ICONV=1
 
 
 
 
 
-  :
 
 
 
@@ -33507,83 +37094,54 @@ $as_echo "$gl_cv_next_sys_wait_h" >&6; }
 
 
 
+  if test "$am_cv_func_iconv" = yes; then
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_unistd_h='<'unistd.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <unistd.h>" >&5
-$as_echo_n "checking absolute name of <unistd.h>... " >&6; }
-if ${gl_cv_next_unistd_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-             if test $ac_cv_header_unistd_h = yes; then
 
 
+  ICONV_H='iconv.h'
+   if test -n "$ICONV_H"; then
+  GL_GENERATE_ICONV_H_TRUE=
+  GL_GENERATE_ICONV_H_FALSE='#'
+else
+  GL_GENERATE_ICONV_H_TRUE='#'
+  GL_GENERATE_ICONV_H_FALSE=
+fi
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
-
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'unistd.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
-
-        gl_cv_absolute_unistd_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
-
-           gl_header=$gl_cv_absolute_unistd_h
-           gl_cv_next_unistd_h='"'$gl_header'"'
-          else
-               gl_cv_next_unistd_h='<'unistd.h'>'
-             fi
 
+      #include <iconv.h>
+      #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+       gnu_iconv
+      #endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "gnu_iconv" >/dev/null 2>&1
+then :
+  gl_func_iconv_gnu=yes
+else $as_nop
+  gl_func_iconv_gnu=no
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_unistd_h" >&5
-$as_echo "$gl_cv_next_unistd_h" >&6; }
-     fi
-     NEXT_UNISTD_H=$gl_cv_next_unistd_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='<'unistd.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_unistd_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_UNISTD_H=$gl_next_as_first_directive
-
-
+rm -rf conftest*
 
+    if test $gl_func_iconv_gnu = no; then
+      iconv_flavor=
+      case "$host_os" in
+        aix*)         iconv_flavor=ICONV_FLAVOR_AIX ;;
+        irix*)        iconv_flavor=ICONV_FLAVOR_IRIX ;;
+        hpux*)        iconv_flavor=ICONV_FLAVOR_HPUX ;;
+        osf*)         iconv_flavor=ICONV_FLAVOR_OSF ;;
+        solaris*)     iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
+        openedition*) iconv_flavor=ICONV_FLAVOR_ZOS ;;
+      esac
+      if test -n "$iconv_flavor"; then
 
-  if test $ac_cv_header_unistd_h = yes; then
-    HAVE_UNISTD_H=1
-  else
-    HAVE_UNISTD_H=0
-  fi
+printf "%s\n" "#define ICONV_FLAVOR $iconv_flavor" >>confdefs.h
 
 
 
@@ -33592,12 +37150,24 @@ $as_echo "$gl_cv_next_unistd_h" >&6; }
 
 
 
+  ICONV_H='iconv.h'
+   if test -n "$ICONV_H"; then
+  GL_GENERATE_ICONV_H_TRUE=
+  GL_GENERATE_ICONV_H_FALSE='#'
+else
+  GL_GENERATE_ICONV_H_TRUE='#'
+  GL_GENERATE_ICONV_H_FALSE=
+fi
 
 
+  REPLACE_ICONV_OPEN=1
 
+      fi
+    fi
 
+  fi
 
-$as_echo "#define USE_UNLOCKED_IO 1" >>confdefs.h
+  if test $REPLACE_ICONV_OPEN = 1; then
 
 
 
@@ -33606,7 +37176,10 @@ $as_echo "#define USE_UNLOCKED_IO 1" >>confdefs.h
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS iconv_open.$ac_objext"
 
+  fi
+  if test $REPLACE_ICONV = 1; then
 
 
 
@@ -33615,41 +37188,116 @@ $as_echo "#define USE_UNLOCKED_IO 1" >>confdefs.h
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS iconv.$ac_objext"
 
 
 
-  if test $ac_cv_func_vasnprintf = no; then
 
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS iconv_close.$ac_objext"
 
+  fi
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler generally respects inline" >&5
+printf %s "checking whether the compiler generally respects inline... " >&6; }
+if test ${gl_cv_c_inline_effective+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test $ac_cv_c_inline = no; then
+       gl_cv_c_inline_effective=no
+     else
+                                          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  M4_LIBOBJS="$M4_LIBOBJS vasnprintf.$ac_objext"
+int
+main (void)
+{
+#ifdef __NO_INLINE__
+               #error "inline is not effective"
+             #endif
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_c_inline_effective=yes
+else $as_nop
+  gl_cv_c_inline_effective=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+     fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c_inline_effective" >&5
+printf "%s\n" "$gl_cv_c_inline_effective" >&6; }
+  if test $gl_cv_c_inline_effective = yes; then
 
+printf "%s\n" "#define HAVE_INLINE 1" >>confdefs.h
 
+  fi
 
 
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS printf-args.$ac_objext"
 
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether isnan(double) can be used without linking with libm" >&5
+printf %s "checking whether isnan(double) can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_isnand_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+             # undef isnand
+             # define isnand(x) __builtin_isnan ((double)(x))
+             #else
+             # undef isnand
+             # define isnand(x) isnan ((double)(x))
+             #endif
+             double x;
+int
+main (void)
+{
+return isnand (x);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_isnand_no_libm=yes
+else $as_nop
+  gl_cv_func_isnand_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnand_no_libm" >&5
+printf "%s\n" "$gl_cv_func_isnand_no_libm" >&6; }
 
+  gl_func_isnand_no_libm=$gl_cv_func_isnand_no_libm
+  if test $gl_cv_func_isnand_no_libm = yes; then
 
+printf "%s\n" "#define HAVE_ISNAND_IN_LIBC 1" >>confdefs.h
 
+  fi
 
-  M4_LIBOBJS="$M4_LIBOBJS printf-parse.$ac_objext"
+  if test $gl_func_isnand_no_libm != yes; then
 
 
 
@@ -33658,353 +37306,745 @@ $as_echo "#define USE_UNLOCKED_IO 1" >>confdefs.h
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS isnand.$ac_objext"
 
-  M4_LIBOBJS="$M4_LIBOBJS asnprintf.$ac_objext"
 
-  if test $ac_cv_func_vasnprintf = yes; then
 
-$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
 
   fi
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) can be used without linking with libm" >&5
+printf %s "checking whether isnan(float) can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_isnanf_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-
-
-
-
-
-
-
-
-  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
-
-else
-
-$as_echo "#define ptrdiff_t long" >>confdefs.h
-
-
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+             # undef isnanf
+             # define isnanf(x) __builtin_isnan ((float)(x))
+             #elif defined isnan
+             # undef isnanf
+             # define isnanf(x) isnan ((float)(x))
+             #endif
+             float x;
+int
+main (void)
+{
+return isnanf (x);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_isnanf_no_libm=yes
+else $as_nop
+  gl_cv_func_isnanf_no_libm=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_no_libm" >&5
+printf "%s\n" "$gl_cv_func_isnanf_no_libm" >&6; }
 
+  if test $gl_cv_func_isnanf_no_libm = yes; then
 
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether isnan(float) works" >&5
+printf %s "checking whether isnan(float) works... " >&6; }
+if test ${gl_cv_func_isnanf_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+           irix* | solaris*) gl_cv_func_isnanf_works="guessing no" ;;
+           mingw*) # Guess yes on mingw, no on MSVC.
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  fi
-
+#ifdef __MINGW32__
+ Known
+#endif
 
-  for ac_func in vasprintf
-do :
-  ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
-if test "x$ac_cv_func_vasprintf" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_VASPRINTF 1
 _ACEOF
-
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_func_isnanf_works="guessing yes"
+else $as_nop
+  gl_cv_func_isnanf_works="guessing no"
 fi
-done
-
-  if test $ac_cv_func_vasprintf = no; then
+rm -rf conftest*
 
+             ;;
+           *) gl_cv_func_isnanf_works="guessing yes" ;;
+         esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <math.h>
+#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+# undef isnanf
+# define isnanf(x) __builtin_isnan ((float)(x))
+#elif defined isnan
+# undef isnanf
+# define isnanf(x) isnan ((float)(x))
+#endif
+/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0.  */
+#ifdef __DECC
+static float
+NaN ()
+{
+  static float zero = 0.0f;
+  return zero / zero;
+}
+#else
+# define NaN() (0.0f / 0.0f)
+#endif
+#define NWORDS \
+  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { unsigned int word[NWORDS]; float value; } memory_float;
+int main()
+{
+  int result = 0;
 
+  if (isnanf (1.0f / 0.0f))
+    result |= 1;
 
+  if (!isnanf (NaN ()))
+    result |= 2;
 
+#if defined FLT_EXPBIT0_WORD && defined FLT_EXPBIT0_BIT
+  /* The isnanf function should be immune against changes in the sign bit and
+     in the mantissa bits.  The xor operation twiddles a bit that can only be
+     a sign bit or a mantissa bit.  */
+  if (FLT_EXPBIT0_WORD == 0 && FLT_EXPBIT0_BIT > 0)
+    {
+      memory_float m;
 
+      m.value = NaN ();
+      /* Set the bits below the exponent to 01111...111.  */
+      m.word[0] &= -1U << FLT_EXPBIT0_BIT;
+      m.word[0] |= (1U << (FLT_EXPBIT0_BIT - 1)) - 1;
+      if (!isnanf (m.value))
+        result |= 4;
+    }
+#endif
 
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_isnanf_works=yes
+else $as_nop
+  gl_cv_func_isnanf_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-  M4_LIBOBJS="$M4_LIBOBJS vasprintf.$ac_objext"
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanf_works" >&5
+printf "%s\n" "$gl_cv_func_isnanf_works" >&6; }
 
+  fi
+  if test $gl_cv_func_isnanf_no_libm = yes \
+     && { case "$gl_cv_func_isnanf_works" in
+            *yes) true;;
+            *) false;;
+          esac
+        }; then
+    gl_func_isnanf_no_libm=yes
 
+printf "%s\n" "#define HAVE_ISNANF_IN_LIBC 1" >>confdefs.h
 
+  else
+    gl_func_isnanf_no_libm=no
+  fi
 
+  if test $gl_func_isnanf_no_libm != yes; then
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS asprintf.$ac_objext"
 
 
-  if test $ac_cv_func_vasprintf = yes; then
-    REPLACE_VASPRINTF=1
-  else
-    HAVE_VASPRINTF=0
-  fi
 
 
+  M4_LIBOBJS="$M4_LIBOBJS isnanf.$ac_objext"
 
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
+printf %s "checking where to find the exponent in a 'float'... " >&6; }
+if test ${gl_cv_cc_float_expbit0+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
+  gl_cv_cc_float_expbit0="word 0 bit 23"
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { float value; unsigned int word[NWORDS]; } memory_float;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (float x)
+{
+  memory_float m;
+  size_t i;
+  /* Clear it first, in case
+     sizeof (float) < sizeof (memory_float).  */
+  memset (&m, 0, sizeof (memory_float));
+  m.value = x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  add_to_ored_words (0.25f);
+  add_to_ored_words (0.5f);
+  add_to_ored_words (1.0f);
+  add_to_ored_words (2.0f);
+  add_to_ored_words (4.0f);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
+}
 
-  fi
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_cc_float_expbit0=`cat conftest.out`
+else $as_nop
+  gl_cv_cc_float_expbit0="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+      rm -f conftest.out
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
+printf "%s\n" "$gl_cv_cc_float_expbit0" >&6; }
+  case "$gl_cv_cc_float_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
 
+printf "%s\n" "#define FLT_EXPBIT0_WORD $word" >>confdefs.h
 
 
+printf "%s\n" "#define FLT_EXPBIT0_BIT $bit" >>confdefs.h
 
-          GNULIB_VASPRINTF=1
+      ;;
+  esac
 
 
+  fi
 
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether isnan(long double) can be used without linking with libm" >&5
+printf %s "checking whether isnan(long double) can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_isnanl_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-$as_echo "#define GNULIB_TEST_VASPRINTF 1" >>confdefs.h
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+             # undef isnanl
+             # define isnanl(x) __builtin_isnan ((long double)(x))
+             #elif defined isnan
+             # undef isnanl
+             # define isnanl(x) isnan ((long double)(x))
+             #endif
+             long double x;
+int
+main (void)
+{
+return isnanl (x);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_isnanl_no_libm=yes
+else $as_nop
+  gl_cv_func_isnanl_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_no_libm" >&5
+printf "%s\n" "$gl_cv_func_isnanl_no_libm" >&6; }
 
+  gl_func_isnanl_no_libm=$gl_cv_func_isnanl_no_libm
+  if test $gl_func_isnanl_no_libm = yes; then
 
 
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format"
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether isnanl works" >&5
+printf %s "checking whether isnanl works... " >&6; }
+if test ${gl_cv_func_isnanl_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+           mingw*) # Guess yes on mingw, no on MSVC.
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format"
+#ifdef __MINGW32__
+ Known
+#endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_func_isnanl_works="guessing yes"
+else $as_nop
+  gl_cv_func_isnanl_works="guessing no"
+fi
+rm -rf conftest*
 
+             ;;
+           *) gl_cv_func_isnanl_works="guessing yes" ;;
+         esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <float.h>
+#include <limits.h>
+#include <math.h>
+#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+# undef isnanl
+# define isnanl(x) __builtin_isnan ((long double)(x))
+#elif defined isnan
+# undef isnanl
+# define isnanl(x) isnan ((long double)(x))
+#endif
+#define NWORDS \
+  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { unsigned int word[NWORDS]; long double value; }
+        memory_long_double;
+/* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
+   runtime type conversion.  */
+#ifdef __sgi
+static long double NaNl ()
+{
+  double zero = 0.0;
+  return zero / zero;
+}
+#else
+# define NaNl() (0.0L / 0.0L)
+#endif
+int main ()
+{
+  int result = 0;
 
+  if (!isnanl (NaNl ()))
+    result |= 1;
 
+  {
+    memory_long_double m;
+    unsigned int i;
 
+    /* The isnanl function should be immune against changes in the sign bit and
+       in the mantissa bits.  The xor operation twiddles a bit that can only be
+       a sign bit or a mantissa bit (since the exponent never extends to
+       bit 31).  */
+    m.value = NaNl ();
+    m.word[NWORDS / 2] ^= (unsigned int) 1 << (sizeof (unsigned int) * CHAR_BIT - 1);
+    for (i = 0; i < NWORDS; i++)
+      m.word[i] |= 1;
+    if (!isnanl (m.value))
+      result |= 1;
+  }
 
+#if ((defined __ia64 && LDBL_MANT_DIG == 64) || (defined __x86_64__ || defined __amd64__) || (defined __i386 || defined __i386__ || defined _I386 || defined _M_IX86 || defined _X86_)) && !HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
+/* Representation of an 80-bit 'long double' as an initializer for a sequence
+   of 'unsigned int' words.  */
+# ifdef WORDS_BIGENDIAN
+#  define LDBL80_WORDS(exponent,manthi,mantlo) \
+     { ((unsigned int) (exponent) << 16) | ((unsigned int) (manthi) >> 16), \
+       ((unsigned int) (manthi) << 16) | ((unsigned int) (mantlo) >> 16),   \
+       (unsigned int) (mantlo) << 16                                        \
+     }
+# else
+#  define LDBL80_WORDS(exponent,manthi,mantlo) \
+     { mantlo, manthi, exponent }
+# endif
+  { /* Quiet NaN.  */
+    static memory_long_double x =
+      { LDBL80_WORDS (0xFFFF, 0xC3333333, 0x00000000) };
+    if (!isnanl (x.value))
+      result |= 2;
+  }
+  {
+    /* Signalling NaN.  */
+    static memory_long_double x =
+      { LDBL80_WORDS (0xFFFF, 0x83333333, 0x00000000) };
+    if (!isnanl (x.value))
+      result |= 2;
+  }
+  /* isnanl should return something even for noncanonical values.  */
+  { /* Pseudo-NaN.  */
+    static memory_long_double x =
+      { LDBL80_WORDS (0xFFFF, 0x40000001, 0x00000000) };
+    if (isnanl (x.value) && !isnanl (x.value))
+      result |= 4;
+  }
+  { /* Pseudo-Infinity.  */
+    static memory_long_double x =
+      { LDBL80_WORDS (0xFFFF, 0x00000000, 0x00000000) };
+    if (isnanl (x.value) && !isnanl (x.value))
+      result |= 8;
+  }
+  { /* Pseudo-Zero.  */
+    static memory_long_double x =
+      { LDBL80_WORDS (0x4004, 0x00000000, 0x00000000) };
+    if (isnanl (x.value) && !isnanl (x.value))
+      result |= 16;
+  }
+  { /* Unnormalized number.  */
+    static memory_long_double x =
+      { LDBL80_WORDS (0x4000, 0x63333333, 0x00000000) };
+    if (isnanl (x.value) && !isnanl (x.value))
+      result |= 32;
+  }
+  { /* Pseudo-Denormal.  */
+    static memory_long_double x =
+      { LDBL80_WORDS (0x0000, 0x83333333, 0x00000000) };
+    if (isnanl (x.value) && !isnanl (x.value))
+      result |= 64;
+  }
+#endif
 
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_isnanl_works=yes
+else $as_nop
+  gl_cv_func_isnanl_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_isnanl_works" >&5
+printf "%s\n" "$gl_cv_func_isnanl_works" >&6; }
 
+    case "$gl_cv_func_isnanl_works" in
+      *yes) ;;
+      *)    gl_func_isnanl_no_libm=no ;;
+    esac
+  fi
+  if test $gl_func_isnanl_no_libm = yes; then
 
+printf "%s\n" "#define HAVE_ISNANL_IN_LIBC 1" >>confdefs.h
 
+  fi
 
+  if test $gl_func_isnanl_no_libm != yes; then
 
-  gl_cv_func_vasprintf_posix=no
-  for ac_func in vasprintf
-do :
-  ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
-if test "x$ac_cv_func_vasprintf" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_VASPRINTF 1
-_ACEOF
 
-fi
-done
 
-  case "$gl_cv_func_printf_sizes_c99" in
-    *yes)
-      case "$gl_cv_func_printf_long_double" in
-        *yes)
-          case "$gl_cv_func_printf_infinite" in
-            *yes)
-              case "$gl_cv_func_printf_infinite_long_double" in
-                *yes)
-                  case "$gl_cv_func_printf_directive_a" in
-                    *yes)
-                      case "$gl_cv_func_printf_directive_f" in
-                        *yes)
-                          case "$gl_cv_func_printf_directive_n" in
-                            *yes)
-                              case "$gl_cv_func_printf_directive_ls" in
-                                *yes)
-                                  case "$gl_cv_func_printf_positions" in
-                                    *yes)
-                                      case "$gl_cv_func_printf_flag_grouping" in
-                                        *yes)
-                                          case "$gl_cv_func_printf_flag_leftadjust" in
-                                            *yes)
-                                              case "$gl_cv_func_printf_flag_zero" in
-                                                *yes)
-                                                  case "$gl_cv_func_printf_precision" in
-                                                    *yes)
-                                                      case "$gl_cv_func_printf_enomem" in
-                                                        *yes)
-                                                          if test $ac_cv_func_vasprintf = yes; then
-                                                            # vasprintf exists and is
-                                                            # already POSIX compliant.
-                                                            gl_cv_func_vasprintf_posix=yes
-                                                          fi
-                                                          ;;
-                                                      esac
-                                                      ;;
-                                                  esac
-                                                  ;;
-                                              esac
-                                              ;;
-                                          esac
-                                          ;;
-                                      esac
-                                      ;;
-                                  esac
-                                  ;;
-                              esac
-                              ;;
-                          esac
-                          ;;
-                      esac
-                      ;;
-                  esac
-                  ;;
-              esac
-              ;;
-          esac
-          ;;
-      esac
-      ;;
-  esac
-  if test $gl_cv_func_vasprintf_posix = no; then
 
 
 
-  case "$gl_cv_func_printf_infinite" in
-    *yes)
-      ;;
-    *)
 
-$as_echo "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h
 
-      ;;
-  esac
+  M4_LIBOBJS="$M4_LIBOBJS isnanl.$ac_objext"
 
 
 
 
-  case "$gl_cv_func_printf_long_double" in
-    *yes)
-      case "$gl_cv_func_printf_infinite_long_double" in
-        *yes)
-          ;;
-        *)
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
+printf %s "checking where to find the exponent in a 'long double'... " >&6; }
+if test ${gl_cv_cc_long_double_expbit0+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-$as_echo "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h
+      if test "$cross_compiling" = yes
+then :
 
-          ;;
-      esac
-      ;;
-  esac
+                              gl_cv_cc_long_double_expbit0="unknown"
+          case "$host_os" in
+            mingw*) # On native Windows (little-endian), we know the result
+                    # in two cases: mingw, MSVC.
+              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#ifdef __MINGW32__
+ Known
+#endif
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_cc_long_double_expbit0="word 2 bit 0"
+fi
+rm -rf conftest*
 
-  case "$gl_cv_func_printf_directive_a" in
-    *yes)
-      ;;
-    *)
+              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-$as_echo "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h
+#ifdef _MSC_VER
+ Known
+#endif
 
-      for ac_func in nl_langinfo
-do :
-  ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo"
-if test "x$ac_cv_func_nl_langinfo" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_NL_LANGINFO 1
 _ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_cc_long_double_expbit0="word 1 bit 20"
+fi
+rm -rf conftest*
+
+              ;;
+          esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { long double value; unsigned int word[NWORDS]; }
+        memory_long_double;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (long double *x)
+{
+  memory_long_double m;
+  size_t i;
+  /* Clear it first, in case
+     sizeof (long double) < sizeof (memory_long_double).  */
+  memset (&m, 0, sizeof (memory_long_double));
+  m.value = *x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L };
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  for (j = 0; j < 5; j++)
+    add_to_ored_words (&samples[j]);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
+}
 
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_cc_long_double_expbit0=`cat conftest.out`
+else $as_nop
+  gl_cv_cc_long_double_expbit0="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-done
 
-      ;;
-  esac
+      rm -f conftest.out
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
+printf "%s\n" "$gl_cv_cc_long_double_expbit0" >&6; }
+  case "$gl_cv_cc_long_double_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
 
+printf "%s\n" "#define LDBL_EXPBIT0_WORD $word" >>confdefs.h
 
-  case "$gl_cv_func_printf_directive_f" in
-    *yes)
-      ;;
-    *)
 
-$as_echo "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h
+printf "%s\n" "#define LDBL_EXPBIT0_BIT $bit" >>confdefs.h
 
       ;;
   esac
 
 
 
-  case "$gl_cv_func_printf_directive_ls" in
-    *yes)
-      ;;
-    *)
+  fi
 
-$as_echo "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h
 
-      ;;
-  esac
 
 
 
-  case "$gl_cv_func_printf_flag_grouping" in
-    *yes)
-      ;;
-    *)
+  ac_fn_check_decl "$LINENO" "iswblank" "ac_cv_have_decl_iswblank" "
+    #include <wchar.h>
+    #include <wctype.h>
 
-$as_echo "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_iswblank" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_ISWBLANK $ac_have_decl" >>confdefs.h
 
-      ;;
-  esac
+  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
+            :
+    fi
+  fi
 
 
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+    :
+  else
+    if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
 
-  case "$gl_cv_func_printf_flag_leftadjust" in
-    *yes)
-      ;;
-    *)
 
-$as_echo "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h
 
-      ;;
-  esac
 
 
 
-  case "$gl_cv_func_printf_flag_zero" in
-    *yes)
-      ;;
-    *)
 
-$as_echo "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h
 
-      ;;
-  esac
+  M4_LIBOBJS="$M4_LIBOBJS iswblank.$ac_objext"
 
+    fi
+  fi
 
 
-  case "$gl_cv_func_printf_precision" in
-    *yes)
-      ;;
-    *)
 
-$as_echo "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h
 
 
-$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
 
 
-$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
 
-      ;;
-  esac
 
+          GL_M4_GNULIB_ISWBLANK=1
 
 
-  case "$gl_cv_func_printf_enomem" in
-    *yes)
-      ;;
-    *)
 
-$as_echo "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h
 
 
-$as_echo "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
+printf "%s\n" "#define GNULIB_TEST_ISWBLANK 1" >>confdefs.h
 
 
-$as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
 
-      ;;
-  esac
 
 
 
@@ -34013,46 +38053,154 @@ $as_echo "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
 
 
 
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+        REPLACE_ISWDIGIT="$REPLACE_ISWCNTRL"
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswdigit is ISO C compliant" >&5
+printf %s "checking whether iswdigit is ISO C compliant... " >&6; }
+if test ${gl_cv_func_iswdigit_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+                     case "$host_os" in
+         # Guess no on FreeBSD, NetBSD, Solaris, native Windows.
+         freebsd* | dragonfly* | netbsd* | solaris* | mingw*)
+           gl_cv_func_iswdigit_works="guessing no" ;;
+         # Guess yes otherwise.
+         *) gl_cv_func_iswdigit_works="guessing yes" ;;
+       esac
+       if test $LOCALE_FR != none || test $LOCALE_JA != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_ZH_CN != none; then
+         if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+#include <wctype.h>
 
+/* Returns the value of iswdigit for the multibyte character s[0..n-1].  */
+static int
+for_character (const char *s, size_t n)
+{
+  mbstate_t state;
+  wchar_t wc;
+  size_t ret;
 
-  M4_LIBOBJS="$M4_LIBOBJS vasnprintf.$ac_objext"
+  memset (&state, '\0', sizeof (mbstate_t));
+  wc = (wchar_t) 0xBADFACE;
+  ret = mbrtowc (&wc, s, n, &state);
+  if (ret != n)
+    abort ();
 
+  return iswdigit (wc);
+}
 
+int
+main (int argc, char *argv[])
+{
+  int is;
+  int result = 0;
 
+  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+    {
+      /* This fails on mingw, MSVC 14.  */
+      /* U+00B2 SUPERSCRIPT TWO */
+      is = for_character ("\262", 1);
+      if (!(is == 0))
+        result |= 1;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      /* This fails on NetBSD 8.0.  */
+      /* U+FF11 FULLWIDTH DIGIT ONE */
+      is = for_character ("\243\261", 2);
+      if (!(is == 0))
+        result |= 2;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      /* This fails on FreeBSD 13.0, NetBSD 8.0, MSVC 14.  */
+      /* U+0663 ARABIC-INDIC DIGIT THREE */
+      is = for_character ("\331\243", 2);
+      if (!(is == 0))
+        result |= 4;
+      /* This fails on FreeBSD 13.0, NetBSD 8.0, MSVC 14.  */
+      /* U+FF11 FULLWIDTH DIGIT ONE */
+      is = for_character ("\357\274\221", 3);
+      if (!(is == 0))
+        result |= 8;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      /* This fails on NetBSD 8.0, Solaris 10, Solaris 11.4.  */
+      /* U+FF11 FULLWIDTH DIGIT ONE */
+      is = for_character ("\243\261", 2);
+      if (!(is == 0))
+        result |= 16;
+    }
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_iswdigit_works=yes
+else $as_nop
+  gl_cv_func_iswdigit_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+       fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswdigit_works" >&5
+printf "%s\n" "$gl_cv_func_iswdigit_works" >&6; }
+    case "$gl_cv_func_iswdigit_works" in
+      *yes) ;;
+      *) REPLACE_ISWDIGIT=1 ;;
+    esac
+  fi
 
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+    :
+  else
+    if test $REPLACE_ISWDIGIT = 1; then
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS printf-args.$ac_objext"
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS iswdigit.$ac_objext"
 
+    fi
+  fi
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS printf-parse.$ac_objext"
 
 
 
 
 
 
+          GL_M4_GNULIB_ISWDIGIT=1
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS asnprintf.$ac_objext"
 
-  if test $ac_cv_func_vasnprintf = yes; then
 
-$as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
+printf "%s\n" "#define GNULIB_TEST_ISWDIGIT 1" >>confdefs.h
 
-  fi
 
 
 
@@ -34062,20 +38210,117 @@ $as_echo "#define REPLACE_VASNPRINTF 1" >>confdefs.h
 
 
 
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+        REPLACE_ISWXDIGIT="$REPLACE_ISWCNTRL"
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether iswxdigit is ISO C compliant" >&5
+printf %s "checking whether iswxdigit is ISO C compliant... " >&6; }
+if test ${gl_cv_func_iswxdigit_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+                     case "$host_os" in
+         # Guess no on FreeBSD, NetBSD, Solaris, native Windows.
+         freebsd* | dragonfly* | netbsd* | solaris* | mingw*)
+           gl_cv_func_iswxdigit_works="guessing no" ;;
+         # Guess yes otherwise.
+         *) gl_cv_func_iswxdigit_works="guessing yes" ;;
+       esac
+       if test $LOCALE_JA != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_ZH_CN != none; then
+         if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+#include <wctype.h>
 
-  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
-if test "x$ac_cv_type_ptrdiff_t" = xyes; then :
+/* Returns the value of iswxdigit for the multibyte character s[0..n-1].  */
+static int
+for_character (const char *s, size_t n)
+{
+  mbstate_t state;
+  wchar_t wc;
+  size_t ret;
 
-else
+  memset (&state, '\0', sizeof (mbstate_t));
+  wc = (wchar_t) 0xBADFACE;
+  ret = mbrtowc (&wc, s, n, &state);
+  if (ret != n)
+    abort ();
 
-$as_echo "#define ptrdiff_t long" >>confdefs.h
+  return iswxdigit (wc);
+}
 
+int
+main (int argc, char *argv[])
+{
+  int is;
+  int result = 0;
 
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      /* This fails on NetBSD 8.0.  */
+      /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
+      is = for_character ("\243\301", 2);
+      if (!(is == 0))
+        result |= 1;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      /* This fails on FreeBSD 13.0.  */
+      /* U+0663 ARABIC-INDIC DIGIT THREE */
+      is = for_character ("\331\243", 2);
+      if (!(is == 0))
+        result |= 2;
+      /* This fails on MSVC 14.  */
+      /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
+      is = for_character ("\357\274\241", 3);
+      if (!(is == 0))
+        result |= 4;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      /* This fails on Solaris 10, Solaris 11.4.  */
+      /* U+FF11 FULLWIDTH DIGIT ONE */
+      is = for_character ("\243\261", 2);
+      if (!(is == 0))
+        result |= 8;
+    }
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_iswxdigit_works=yes
+else $as_nop
+  gl_cv_func_iswxdigit_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+       fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswxdigit_works" >&5
+printf "%s\n" "$gl_cv_func_iswxdigit_works" >&6; }
+    case "$gl_cv_func_iswxdigit_works" in
+      *yes) ;;
+      *) REPLACE_ISWXDIGIT=1 ;;
+    esac
+  fi
 
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+    :
+  else
+    if test $REPLACE_ISWXDIGIT = 1; then
 
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS iswxdigit.$ac_objext"
 
+    fi
+  fi
 
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS vasprintf.$ac_objext"
-
-
-
-
-
-
-
-
-
-  M4_LIBOBJS="$M4_LIBOBJS asprintf.$ac_objext"
-
 
-  if test $ac_cv_func_vasprintf = yes; then
-    REPLACE_VASPRINTF=1
-  else
-    HAVE_VASPRINTF=0
-  fi
 
 
 
 
+          GL_M4_GNULIB_ISWXDIGIT=1
 
 
 
 
-  fi
 
+printf "%s\n" "#define GNULIB_TEST_ISWXDIGIT 1" >>confdefs.h
 
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=verror:3:c-format"
 
 
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=verror_at_line:5:c-format"
 
 
-# Check whether --with-packager was given.
-if test "${with_packager+set}" = set; then :
-  withval=$with_packager;       case $withval in
-        yes|no) ;;
-        *)
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_PACKAGER "$withval"
-_ACEOF
- ;;
-      esac
 
-fi
 
 
 
-# Check whether --with-packager-version was given.
-if test "${with_packager_version+set}" = set; then :
-  withval=$with_packager_version;       case $withval in
-        yes|no) ;;
-        *)
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_PACKAGER_VERSION "$withval"
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports the __inline keyword" >&5
+printf %s "checking whether the compiler supports the __inline keyword... " >&6; }
+if test ${gl_cv_c___inline+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+typedef int foo_t;
+           static __inline foo_t foo (void) { return 0; }
+int
+main (void)
+{
+return foo ();
+  ;
+  return 0;
+}
 _ACEOF
- ;;
-      esac
-
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_c___inline=yes
+else $as_nop
+  gl_cv_c___inline=no
 fi
-
-
-
-# Check whether --with-packager-bug-reports was given.
-if test "${with_packager_bug_reports+set}" = set; then :
-  withval=$with_packager_bug_reports;       case $withval in
-        yes|no) ;;
-        *)
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE_PACKAGER_BUG_REPORTS "$withval"
-_ACEOF
- ;;
-      esac
-
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_c___inline" >&5
+printf "%s\n" "$gl_cv_c___inline" >&6; }
+  if test $gl_cv_c___inline = yes; then
 
+printf "%s\n" "#define HAVE___INLINE 1" >>confdefs.h
 
-  if test "X$with_packager" = "X" && \
-     test "X$with_packager_version$with_packager_bug_reports" != "X"
-  then
-    as_fn_error $? "The --with-packager-{bug-reports,version} options require --with-packager" "$LINENO" 5
   fi
 
 
 
-  for ac_func in waitid
-do :
-  ac_fn_c_check_func "$LINENO" "waitid" "ac_cv_func_waitid"
-if test "x$ac_cv_func_waitid" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_WAITID 1
-_ACEOF
-
-fi
-done
-
 
 
+    LOCALCHARSET_TESTS_ENVIRONMENT=
 
-  HAVE_WAITPID=1
-  case $host_os in
-    mingw*) HAVE_WAITPID=0 ;;
-  esac
 
-  if test $HAVE_WAITPID = 0; then
 
 
 
@@ -34206,119 +38409,84 @@ done
 
 
 
-  M4_LIBOBJS="$M4_LIBOBJS waitpid.$ac_objext"
 
+  if test $REPLACE_STRUCT_LCONV = 1; then
+    REPLACE_LOCALECONV=1
   fi
 
-
-
-
-
-          GNULIB_WAITPID=1
+  if test $REPLACE_LOCALECONV = 1; then
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_WAITPID 1" >>confdefs.h
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS localeconv.$ac_objext"
 
 
+  ac_fn_c_check_member "$LINENO" "struct lconv" "decimal_point" "ac_cv_member_struct_lconv_decimal_point" "#include <locale.h>
+"
+if test "x$ac_cv_member_struct_lconv_decimal_point" = xyes
+then :
 
+printf "%s\n" "#define HAVE_STRUCT_LCONV_DECIMAL_POINT 1" >>confdefs.h
 
 
+fi
 
 
+  fi
 
 
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_wchar_h='<'wchar.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wchar.h>" >&5
-$as_echo_n "checking absolute name of <wchar.h>... " >&6; }
-if ${gl_cv_next_wchar_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-             if test $ac_cv_header_wchar_h = yes; then
 
 
 
+          GL_M4_GNULIB_LOCALECONV=1
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <wchar.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'wchar.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
 
-        gl_cv_absolute_wchar_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_wchar_h
-           gl_cv_next_wchar_h='"'$gl_header'"'
-          else
-               gl_cv_next_wchar_h='<'wchar.h'>'
-             fi
 
+printf "%s\n" "#define GNULIB_TEST_LOCALECONV 1" >>confdefs.h
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_wchar_h" >&5
-$as_echo "$gl_cv_next_wchar_h" >&6; }
-     fi
-     NEXT_WCHAR_H=$gl_cv_next_wchar_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='<'wchar.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_wchar_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_WCHAR_H=$gl_next_as_first_directive
 
 
 
 
-  if test $ac_cv_header_wchar_h = yes; then
-    HAVE_WCHAR_H=1
-  else
-    HAVE_WCHAR_H=0
-  fi
 
 
 
 
+  if test $HAVE_LOCALE_T = 1; then
 
-  if test $gt_cv_c_wint_t = yes; then
-    HAVE_WINT_T=1
+    gl_func_newlocale="$ac_cv_func_newlocale"
+    gl_func_duplocale="$ac_cv_func_duplocale"
+    gl_func_freelocale="$ac_cv_func_freelocale"
   else
-    HAVE_WINT_T=0
+            gl_func_newlocale=no
+    gl_func_duplocale=no
+    gl_func_freelocale=no
+  fi
+  if test $gl_func_newlocale != yes; then
+    HAVE_NEWLOCALE=0
+  fi
+  if test $gl_func_duplocale != yes; then
+    HAVE_DUPLOCALE=0
+  fi
+  if test $gl_func_freelocale != yes; then
+    HAVE_FREELOCALE=0
+  fi
+  if test $gt_localename_enhances_locale_funcs = yes; then
+    REPLACE_NEWLOCALE=1
+    REPLACE_DUPLOCALE=1
+    REPLACE_FREELOCALE=1
   fi
 
 
@@ -34330,318 +38498,337 @@ $as_echo "$gl_cv_next_wchar_h" >&6; }
 
 
 
+          GL_M4_GNULIB_LOCALENAME=1
 
 
 
 
-  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
 
+printf "%s\n" "#define GNULIB_TEST_LOCALENAME 1" >>confdefs.h
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
-$as_echo_n "checking whether mbrtowc handles incomplete characters... " >&6; }
-if ${gl_cv_func_mbrtowc_incomplete_state+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                  case "$host_os" in
-                     # Guess no on AIX and OSF/1.
-        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
-                     # Guess yes otherwise.
-        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
-      esac
-      if test $LOCALE_JA != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#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 ()
-{
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
 
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
-        if (mbsinit (&state))
-          return 2;
-    }
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_incomplete_state=yes
-else
-  gl_cv_func_mbrtowc_incomplete_state=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  if test "$gl_threads_api" = posix; then
+    # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
+    # pthread_rwlock_* functions.
+    has_rwlock=false
+    ac_fn_c_check_type "$LINENO" "pthread_rwlock_t" "ac_cv_type_pthread_rwlock_t" "#include <pthread.h>
+"
+if test "x$ac_cv_type_pthread_rwlock_t" = xyes
+then :
+  has_rwlock=true
 
-      fi
+printf "%s\n" "#define HAVE_PTHREAD_RWLOCK 1" >>confdefs.h
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
-$as_echo "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
 
+    if $has_rwlock; then
 
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthread_rwlock_rdlock prefers a writer to a reader" >&5
+printf %s "checking whether pthread_rwlock_rdlock prefers a writer to a reader... " >&6; }
+if test ${gl_cv_pthread_rwlock_rdlock_prefer_writer+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  save_LIBS="$LIBS"
+     LIBS="$LIBS $LIBMULTITHREAD"
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                         # Guess no on glibc systems.
+          *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+                         # Guess no on musl systems.
+          *-musl*)       gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+                         # Guess no on bionic systems.
+          *-android*)    gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+                         # Guess yes on native Windows with the mingw-w64 winpthreads library.
+                         # Guess no on native Windows with the gnulib windows-rwlock module.
+          mingw*)        if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+                           gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
+                         else
+                           gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
+                         fi
+                         ;;
+                         # If we don't know, obey --enable-cross-guesses.
+          *)             gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
+         esac
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
-$as_echo_n "checking whether mbrtowc works as well as mbtowc... " >&6; }
-if ${gl_cv_func_mbrtowc_sanitycheck+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-
-                  case "$host_os" in
-                    # Guess no on Solaris 8.
-        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
-                    # Guess yes otherwise.
-        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
-      esac
-      if test $LOCALE_ZH_CN != none; then
-        if test "$cross_compiling" = yes; then :
-  :
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <locale.h>
+#include <errno.h>
+#include <pthread.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 ()
-{
-  /* This fails on Solaris 8:
-     mbrtowc returns 2, and sets wc to 0x00F0.
-     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
-    {
-      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
-      mbstate_t state;
-      wchar_t wc;
-
-      memset (&state, '\0', sizeof (mbstate_t));
-      if (mbrtowc (&wc, input + 3, 6, &state) != 4
-          && mbtowc (&wc, input + 3, 6) == 4)
-        return 2;
-    }
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_mbrtowc_sanitycheck=yes
-else
-  gl_cv_func_mbrtowc_sanitycheck=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-      fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
-$as_echo "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
-
-    REPLACE_MBSTATE_T=0
-    case "$gl_cv_func_mbrtowc_incomplete_state" in
-      *yes) ;;
-      *) REPLACE_MBSTATE_T=1 ;;
-    esac
-    case "$gl_cv_func_mbrtowc_sanitycheck" in
-      *yes) ;;
-      *) REPLACE_MBSTATE_T=1 ;;
-    esac
-  else
-    REPLACE_MBSTATE_T=1
-  fi
-
-
+#include <unistd.h>
 
-  if test $ac_cv_func_wcrtomb = no; then
-    HAVE_WCRTOMB=0
-    ac_fn_c_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" "
-/* 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>
+#define SUCCEED() exit (0)
+#define FAILURE() exit (1)
+#define UNEXPECTED(n) (exit (10 + (n)))
+
+/* The main thread creates the waiting writer and the requesting reader threads
+   in the default way; this guarantees that they have the same priority.
+   We can reuse the main thread as first reader thread.  */
+
+static pthread_rwlock_t lock;
+static pthread_t reader1;
+static pthread_t writer;
+static pthread_t reader2;
+static pthread_t timer;
+/* Used to pass control from writer to reader2 and from reader2 to timer,
+   as in a relay race.
+   Passing control from one running thread to another running thread
+   is most likely faster than to create the second thread.  */
+static pthread_mutex_t baton;
 
-"
-if test "x$ac_cv_have_decl_wcrtomb" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+static void *
+timer_func (void *ignored)
+{
+  /* Step 13 (can be before or after step 12):
+     The timer thread takes the baton, then waits a moment to make sure
+     it can tell whether the second reader thread is blocked at step 12.  */
+  if (pthread_mutex_lock (&baton))
+    UNEXPECTED (13);
+  usleep (100000);
+  /* By the time we get here, it's clear that the second reader thread is
+     blocked at step 12.  This is the desired behaviour.  */
+  SUCCEED ();
+}
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_WCRTOMB $ac_have_decl
-_ACEOF
+static void *
+reader2_func (void *ignored)
+{
+  int err;
 
-    if test $ac_cv_have_decl_wcrtomb = yes; then
-                        REPLACE_WCRTOMB=1
-    fi
+  /* Step 8 (can be before or after step 7):
+     The second reader thread takes the baton, then waits a moment to make sure
+     the writer thread has reached step 7.  */
+  if (pthread_mutex_lock (&baton))
+    UNEXPECTED (8);
+  usleep (100000);
+  /* Step 9: The second reader thread requests the lock.  */
+  err = pthread_rwlock_tryrdlock (&lock);
+  if (err == 0)
+    FAILURE ();
+  else if (err != EBUSY)
+    UNEXPECTED (9);
+  /* Step 10: Launch a timer, to test whether the next call blocks.  */
+  if (pthread_create (&timer, NULL, timer_func, NULL))
+    UNEXPECTED (10);
+  /* Step 11: Release the baton.  */
+  if (pthread_mutex_unlock (&baton))
+    UNEXPECTED (11);
+  /* Step 12: The second reader thread requests the lock.  */
+  err = pthread_rwlock_rdlock (&lock);
+  if (err == 0)
+    FAILURE ();
   else
-    if test $REPLACE_MBSTATE_T = 1; then
-      REPLACE_WCRTOMB=1
-    else
-
-
-
-
-
-             { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5
-$as_echo_n "checking whether wcrtomb return value is correct... " >&6; }
-if ${gl_cv_func_wcrtomb_retval+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+    UNEXPECTED (12);
+}
 
-                              case "$host_os" in
-                                     # Guess no on AIX 4, OSF/1 and Solaris.
-            aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
-                                     # Guess yes otherwise.
-            *)                       gl_cv_func_wcrtomb_retval="guessing yes" ;;
-          esac
-          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
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+static void *
+writer_func (void *ignored)
+{
+  /* Step 4: Take the baton, so that the second reader thread does not go ahead
+     too early.  */
+  if (pthread_mutex_lock (&baton))
+    UNEXPECTED (4);
+  /* Step 5: Create the second reader thread.  */
+  if (pthread_create (&reader2, NULL, reader2_func, NULL))
+    UNEXPECTED (5);
+  /* Step 6: Release the baton.  */
+  if (pthread_mutex_unlock (&baton))
+    UNEXPECTED (6);
+  /* Step 7: The writer thread requests the lock.  */
+  if (pthread_rwlock_wrlock (&lock))
+    UNEXPECTED (7);
+  return NULL;
+}
 
-#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
+main ()
 {
-  int result = 0;
-  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
-    {
-      if (wcrtomb (NULL, 0, NULL) != 1)
-        result |= 1;
-    }
-  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
-    {
-      if (wcrtomb (NULL, 0, NULL) != 1)
-        result |= 2;
-    }
-  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
-    {
-      if (wcrtomb (NULL, 0, NULL) != 1)
-        result |= 4;
-    }
-  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+  reader1 = pthread_self ();
+
+  /* Step 1: The main thread initializes the lock and the baton.  */
+  if (pthread_rwlock_init (&lock, NULL))
+    UNEXPECTED (1);
+  if (pthread_mutex_init (&baton, NULL))
+    UNEXPECTED (1);
+  /* Step 2: The main thread acquires the lock as a reader.  */
+  if (pthread_rwlock_rdlock (&lock))
+    UNEXPECTED (2);
+  /* Step 3: Create the writer thread.  */
+  if (pthread_create (&writer, NULL, writer_func, NULL))
+    UNEXPECTED (3);
+  /* Job done.  Go to sleep.  */
+  for (;;)
     {
-      if (wcrtomb (NULL, 0, NULL) != 1)
-        result |= 8;
+      sleep (1);
     }
-  return result;
 }
+
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_wcrtomb_retval=yes
-else
-  gl_cv_func_wcrtomb_retval=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_pthread_rwlock_rdlock_prefer_writer=yes
+else $as_nop
+  gl_cv_pthread_rwlock_rdlock_prefer_writer=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-          fi
+     LIBS="$save_LIBS"
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5
-$as_echo "$gl_cv_func_wcrtomb_retval" >&6; }
-      case "$gl_cv_func_wcrtomb_retval" in
-        *yes) ;;
-        *) REPLACE_WCRTOMB=1 ;;
-      esac
-    fi
-  fi
-
-  if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
-
-
-
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_pthread_rwlock_rdlock_prefer_writer" >&5
+printf "%s\n" "$gl_cv_pthread_rwlock_rdlock_prefer_writer" >&6; }
+  case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
+    *yes)
 
+printf "%s\n" "#define HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER 1" >>confdefs.h
 
+      ;;
+  esac
 
+    fi
+    # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+      #include <pthread.h>
+int
+main (void)
+{
 
-  M4_LIBOBJS="$M4_LIBOBJS wcrtomb.$ac_objext"
+#if __FreeBSD__ == 4
+error "No, in FreeBSD 4.0 recursive mutexes actually don't work."
+#elif (defined __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ \
+       && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1070)
+error "No, in Mac OS X < 10.7 recursive mutexes actually don't work."
+#else
+int x = (int)PTHREAD_MUTEX_RECURSIVE;
+return !x;
+#endif
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
 
-  :
+printf "%s\n" "#define HAVE_PTHREAD_MUTEX_RECURSIVE 1" >>confdefs.h
 
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
   fi
+  :
 
 
 
+printf "%s\n" "#define GNULIB_LOCK 1" >>confdefs.h
 
 
-          GNULIB_WCRTOMB=1
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_WCRTOMB 1" >>confdefs.h
 
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether lseek detects pipes" >&5
+printf %s "checking whether lseek detects pipes... " >&6; }
+if test ${gl_cv_func_lseek_pipe+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  case "$host_os" in
+       mingw*)
+                                                               gl_cv_func_lseek_pipe=no
+         ;;
+       *)
+         if test $cross_compiling = no; then
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <sys/types.h> /* for off_t */
+#include <stdio.h> /* for SEEK_CUR */
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <io.h>
+#endif
 
 
+$gl_mda_defines
 
+int
+main (void)
+{
 
+  /* Exit with success only if stdin is seekable.  */
+  return lseek (0, (off_t)0, SEEK_CUR) < 0;
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  if test -s conftest$ac_exeext \
+                 && ./conftest$ac_exeext < conftest.$ac_ext \
+                 && test 1 = "`echo hi \
+                   | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
+                gl_cv_func_lseek_pipe=yes
+              else
+                gl_cv_func_lseek_pipe=no
+              fi
 
-  if test $ac_cv_func_iswcntrl = yes; then
-    HAVE_ISWCNTRL=1
-  else
-    HAVE_ISWCNTRL=0
-  fi
+else $as_nop
+  gl_cv_func_lseek_pipe=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+         else
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if defined __BEOS__
+/* BeOS mistakenly return 0 when trying to seek on pipes.  */
+  Choke me.
+#endif
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_lseek_pipe=yes
+else $as_nop
+  gl_cv_func_lseek_pipe=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+         fi
+         ;;
+     esac
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_lseek_pipe" >&5
+printf "%s\n" "$gl_cv_func_lseek_pipe" >&6; }
+  if test $gl_cv_func_lseek_pipe = no; then
+    REPLACE_LSEEK=1
 
+printf "%s\n" "#define LSEEK_PIPE_BROKEN 1" >>confdefs.h
 
-  if test $gt_cv_c_wint_t = yes; then
-    HAVE_WINT_T=1
-  else
-    HAVE_WINT_T=0
   fi
 
 
+  if test $WINDOWS_64_BIT_OFF_T = 1; then
+    REPLACE_LSEEK=1
+  fi
 
+  if test $REPLACE_LSEEK = 1; then
 
 
 
@@ -34650,331 +38837,186 @@ $as_echo "#define GNULIB_TEST_WCRTOMB 1" >>confdefs.h
 
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_wctype_h='<'wctype.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <wctype.h>" >&5
-$as_echo_n "checking absolute name of <wctype.h>... " >&6; }
-if ${gl_cv_next_wctype_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  M4_LIBOBJS="$M4_LIBOBJS lseek.$ac_objext"
 
-             if test $ac_cv_header_wctype_h = yes; then
+  fi
 
 
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <wctype.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'wctype.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
 
-        gl_cv_absolute_wctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_wctype_h
-           gl_cv_next_wctype_h='"'$gl_header'"'
-          else
-               gl_cv_next_wctype_h='<'wctype.h'>'
-             fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$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
+          GL_M4_GNULIB_LSEEK=1
 
-     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:${as_lineno-$LINENO}: checking whether iswcntrl works" >&5
-$as_echo_n "checking whether iswcntrl works... " >&6; }
-if ${gl_cv_func_iswcntrl_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+printf "%s\n" "#define GNULIB_TEST_LSEEK 1" >>confdefs.h
 
-          if test "$cross_compiling" = yes; then :
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-                          #if __GNU_LIBRARY__ == 1
-                          Linux libc5 i18n is broken.
-                          #endif
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_func_iswcntrl_works="guessing yes"
-else
-  gl_cv_func_iswcntrl_works="guessing no"
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* 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
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_iswcntrl_works=yes
-else
-  gl_cv_func_iswcntrl_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_iswcntrl_works" >&5
-$as_echo "$gl_cv_func_iswcntrl_works" >&6; }
-    fi
-    HAVE_WCTYPE_H=1
+  if test $ac_cv_func_lstat = yes; then
+
+    case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
+      solaris* | *no)
+        REPLACE_LSTAT=1
+        ;;
+    esac
   else
-    HAVE_WCTYPE_H=0
+    HAVE_LSTAT=0
   fi
 
+  if test $REPLACE_LSTAT = 1; then
 
-  case "$gl_cv_func_iswcntrl_works" in
-    *yes) REPLACE_ISWCNTRL=0 ;;
-    *)    REPLACE_ISWCNTRL=1 ;;
-  esac
 
 
-  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
-        :
-  fi
 
-  if test $REPLACE_ISWCNTRL = 1; then
-    REPLACE_TOWLOWER=1
-  else
-    for ac_func in towlower
-do :
-  ac_fn_c_check_func "$LINENO" "towlower" "ac_cv_func_towlower"
-if test "x$ac_cv_func_towlower" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_TOWLOWER 1
-_ACEOF
 
-fi
-done
 
-    if test $ac_cv_func_towlower = yes; then
-      REPLACE_TOWLOWER=0
-    else
-      ac_fn_c_check_decl "$LINENO" "towlower" "ac_cv_have_decl_towlower" "/* 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
 
-"
-if test "x$ac_cv_have_decl_towlower" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_TOWLOWER $ac_have_decl
-_ACEOF
+  M4_LIBOBJS="$M4_LIBOBJS lstat.$ac_objext"
 
-      if test $ac_cv_have_decl_towlower = yes; then
-                                REPLACE_TOWLOWER=1
-      else
-        REPLACE_TOWLOWER=0
-      fi
-    fi
+    :
   fi
 
 
-  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_TOWLOWER = 1; then
-        :
-  fi
 
-          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctype_t" >&5
-$as_echo_n "checking for wctype_t... " >&6; }
-if ${gl_cv_type_wctype_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+
+
+
+
+
+
+          GL_M4_GNULIB_LSTAT=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_LSTAT 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+  if test $REPLACE_MALLOC = 0; then
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether malloc (0) returns nonnull" >&5
+printf %s "checking whether malloc (0) returns nonnull... " >&6; }
+if test ${ac_cv_func_malloc_0_nonnull+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+          # Guess yes on platforms where we know the result.
+          *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+          | gnu* | *-musl* | midnightbsd* \
+          | hpux* | solaris* | cygwin* | mingw* | msys* )
+            ac_cv_func_malloc_0_nonnull="guessing yes" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
+        esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* 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;
+#include <stdlib.h>
 
 int
-main ()
+main (void)
 {
-
+void *p = malloc (0);
+            int result = !p;
+            free (p);
+            return result;
   ;
   return 0;
 }
+
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_type_wctype_t=yes
-else
-  gl_cv_type_wctype_t=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  ac_cv_func_malloc_0_nonnull=yes
+else $as_nop
+  ac_cv_func_malloc_0_nonnull=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
 
 fi
-{ $as_echo "$as_me:${as_lineno-$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
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_malloc_0_nonnull" >&5
+printf "%s\n" "$ac_cv_func_malloc_0_nonnull" >&6; }
+  case $ac_cv_func_malloc_0_nonnull in #(
+  *yes) :
+     ;; #(
+  *) :
+    REPLACE_MALLOC=1 ;;
+esac
+
   fi
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for wctrans_t" >&5
-$as_echo_n "checking for wctrans_t... " >&6; }
-if ${gl_cv_type_wctrans_t+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* 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;
+  if test $REPLACE_MALLOC = 1; then
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_type_wctrans_t=yes
-else
-  gl_cv_type_wctrans_t=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-fi
-{ $as_echo "$as_me:${as_lineno-$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
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS malloc.$ac_objext"
+
   fi
 
+  if test $REPLACE_MALLOC = 1; then
 
 
-  :
 
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xprintf:1:c-format"
 
 
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xvprintf:1:c-format"
 
+  M4_LIBOBJS="$M4_LIBOBJS malloc.$ac_objext"
 
+  fi
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xfprintf:2:c-format"
 
 
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xvfprintf:2:c-format"
 
 
 
-  for ac_header in stdint.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
-if test "x$ac_cv_header_stdint_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_STDINT_H 1
-_ACEOF
 
-fi
 
-done
+          GL_M4_GNULIB_MALLOC_POSIX=1
 
 
 
 
-  :
 
+printf "%s\n" "#define GNULIB_TEST_MALLOC_POSIX 1" >>confdefs.h
 
-  :
 
 
-  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format"
 
-  # End of code from modules
 
 
 
 
 
 
-  gltests_libdeps=
-  gltests_ltlibdeps=
 
 
 
 
+  :
 
 
 
 
 
-  gl_source_base='tests'
-  M4tests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
 
-  gl_module_indicator_condition=$M4tests_WITNESS
 
 
 
 
-  if test "$CXX_CHOICE" = no; then
-    CXX=no
-  fi
-  if test -z "$CXX"; then
-    if test -n "$CCC"; then
-      CXX="$CCC"
-    else
-      if test -n "$ac_tool_prefix"; then
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CXX"; then
-  ac_cv_prog_CXX="$CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-CXX=$ac_cv_prog_CXX
-if test -n "$CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
-$as_echo "$CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 
-    test -n "$CXX" && break
-  done
-fi
-if test -z "$CXX"; then
-  ac_ct_CXX=$CXX
-  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CXX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$ac_ct_CXX"; then
-  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CXX="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
-fi
-fi
-ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
-if test -n "$ac_ct_CXX"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
-$as_echo "$ac_ct_CXX" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+        if case "$host_os" in
+       mingw*) true ;;
+       *) test $ac_cv_func_mbsinit = yes ;;
+     esac \
+    && test $ac_cv_func_mbrtowc = yes; then
 
 
-  test -n "$ac_ct_CXX" && break
-done
 
-  if test "x$ac_ct_CXX" = x; then
-    CXX=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CXX=$ac_ct_CXX
-  fi
-fi
 
-    fi
-  fi
-  if test "$CXX" != no; then
-            { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
-$as_echo_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works... " >&6; }
-    ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+printf %s "checking whether mbrtowc handles incomplete characters... " >&6; }
+if test ${gl_cv_func_mbrtowc_incomplete_state+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+                  case "$host_os" in
+                     # Guess no on AIX and OSF/1.
+        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+                     # Guess yes otherwise.
+        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+      esac
+      if test $LOCALE_JA != none; then
+        if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        if (mbsinit (&state))
+          return 2;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_incomplete_state=yes
+else $as_nop
+  gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-    echo 'int main () { return 0; }' > conftest.$ac_ext
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      gl_cv_prog_ansicxx_works=yes
-      if (./conftest; exit) 2>/dev/null; then
-        gl_cv_prog_ansicxx_cross=no
       else
-        gl_cv_prog_ansicxx_cross=yes
-      fi
-    else
-      gl_cv_prog_ansicxx_works=no
-    fi
-    rm -fr conftest*
-    ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+        if test $LOCALE_FR_UTF8 != none; then
+          if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_prog_ansicxx_works" >&5
-$as_echo "$gl_cv_prog_ansicxx_works" >&6; }
-    if test $gl_cv_prog_ansicxx_works = no; then
-      CXX=no
-    else
-                  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C++ compiler supports namespaces" >&5
-$as_echo_n "checking whether the C++ compiler supports namespaces... " >&6; }
-      ac_ext=cpp
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
-      cat <<EOF > conftest.$ac_ext
-#include <iostream>
-namespace test { using namespace std; }
-std::ostream* ptr;
-int main () { return 0; }
-EOF
-      if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-        gl_cv_prog_ansicxx_namespaces=yes
-      else
-        gl_cv_prog_ansicxx_namespaces=no
-      fi
-      rm -fr conftest*
-      ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        if (mbsinit (&state))
+          return 2;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_incomplete_state=yes
+else $as_nop
+  gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_prog_ansicxx_namespaces" >&5
-$as_echo "$gl_cv_prog_ansicxx_namespaces" >&6; }
-      if test $gl_cv_prog_ansicxx_namespaces = no; then
-        CXX=no
+        fi
       fi
-    fi
-  fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
 
 
-   if test "$CXX" != no; then
-  ANSICXX_TRUE=
-  ANSICXX_FALSE='#'
-else
-  ANSICXX_TRUE='#'
-  ANSICXX_FALSE=
-fi
 
 
-  if test "$CXX" != no; then
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if test ${gl_cv_func_mbrtowc_sanitycheck+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-depcc="$CXX"  am_compiler_list=
+                  case "$host_os" in
+                    # Guess no on Solaris 8.
+        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
+                    # Guess yes otherwise.
+        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
+      esac
+      if test $LOCALE_ZH_CN != none; then
+        if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named 'D' -- because '-MD' means "put the output
-  # in D".
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
-
-  am_cv_CXX_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  /* This fails on Solaris 8:
+     mbrtowc returns 2, and sets wc to 0x00F0.
+     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
-      # Solaris 10 /bin/sh.
-      echo '/* dummy */' > sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 6, &state) != 4
+          && mbtowc (&wc, input + 3, 6) == 4)
+        return 2;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_sanitycheck=yes
+else $as_nop
+  gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-    # We check with '-c' and '-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle '-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs.
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # After this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested.
-      if test "x$enable_dependency_tracking" = xyes; then
-       continue
-      else
-       break
-      fi
-      ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok '-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CXX_dependencies_compiler_type=$depmode
-        break
       fi
-    fi
-  done
 
-  cd ..
-  rm -rf conftest.dir
-else
-  am_cv_CXX_dependencies_compiler_type=none
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
-CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+    REPLACE_MBSTATE_T=0
+    case "$gl_cv_func_mbrtowc_incomplete_state" in
+      *yes) ;;
+      *) REPLACE_MBSTATE_T=1 ;;
+    esac
+    case "$gl_cv_func_mbrtowc_sanitycheck" in
+      *yes) ;;
+      *) REPLACE_MBSTATE_T=1 ;;
+    esac
+  else
+    REPLACE_MBSTATE_T=1
+  fi
 
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
-else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
-fi
 
 
-  else
-     if false; then
-  am__fastdepCXX_TRUE=
-  am__fastdepCXX_FALSE='#'
-else
-  am__fastdepCXX_TRUE='#'
-  am__fastdepCXX_FALSE=
-fi
+  if test $ac_cv_func_mbrtowc = no; then
+    HAVE_MBRTOWC=0
+    ac_fn_check_decl "$LINENO" "mbrtowc" "ac_cv_have_decl_mbrtowc" "
+      #include <wchar.h>
 
-  fi
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_mbrtowc" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_MBRTOWC $ac_have_decl" >>confdefs.h
 
+    if test $ac_cv_have_decl_mbrtowc = yes; then
+                        REPLACE_MBRTOWC=1
+    fi
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_MBRTOWC=1
+    else
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
-$as_echo_n "checking for a traditional french locale... " >&6; }
-if ${gt_cv_locale_fr+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL pwc argument" >&5
+printf %s "checking whether mbrtowc handles a NULL pwc argument... " >&6; }
+if test ${gl_cv_func_mbrtowc_null_arg1+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                  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 $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
 #include <stdlib.h>
 #include <string.h>
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
-     one byte long. This excludes the UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
+#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
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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 Mac OS 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
-              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
-                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
-          ;;
-      esac
-    fi
-    rm -fr conftest*
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_null_arg1=yes
+else $as_nop
+  gl_cv_func_mbrtowc_null_arg1=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
-$as_echo "$gt_cv_locale_fr" >&6; }
-  LOCALE_FR=$gt_cv_locale_fr
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg1" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_null_arg1" >&6; }
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
-$as_echo_n "checking for a french Unicode locale... " >&6; }
-if ${gt_cv_locale_fr_utf8+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles a NULL string argument" >&5
+printf %s "checking whether mbrtowc handles a NULL string argument... " >&6; }
+if test ${gl_cv_func_mbrtowc_null_arg2+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                  case "$host_os" in
+              # Guess no on OSF/1.
+        osf*) gl_cv_func_mbrtowc_null_arg2="guessing no" ;;
+              # Guess yes otherwise.
+        *)    gl_cv_func_mbrtowc_null_arg2="guessing yes" ;;
+      esac
+      if test $LOCALE_FR_UTF8 != none; then
+        if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
 #include <string.h>
-struct tm t;
-char buf[16];
-int main () {
-  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
-     imitates locale dependent behaviour by looking at the environment
-     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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
-# if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
-      return 1;
-  }
-# endif
-# ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-# endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
-     two bytes long, with UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 4
-      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
-    return 1;
-#endif
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      mbstate_t state;
+      wchar_t wc;
+      int ret;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      wc = (wchar_t) 0xBADFACE;
+      mbrtowc (&wc, NULL, 5, &state);
+      /* Check that wc was not modified.  */
+      if (wc != (wchar_t) 0xBADFACE)
+        return 2;
+    }
   return 0;
 }
-
 _ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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*
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_null_arg2=yes
+else $as_nop
+  gl_cv_func_mbrtowc_null_arg2=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
-$as_echo "$gt_cv_locale_fr_utf8" >&6; }
-  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_null_arg2" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_null_arg2" >&6; }
 
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
-$as_echo_n "checking for a traditional french locale... " >&6; }
-if ${gt_cv_locale_fr+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc has a correct return value" >&5
+printf %s "checking whether mbrtowc has a correct return value... " >&6; }
+if test ${gl_cv_func_mbrtowc_retval+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+                  case "$host_os" in
+                                   # 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 \
+         || { case "$host_os" in mingw*) true;; *) false;; esac; }; then
+        if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
 #include <string.h>
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
-     one byte long. This excludes the UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
+#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)
+    {
+      char input[] = "B\303\274\303\237er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        {
+          input[1] = '\0';
+          if (mbrtowc (&wc, input + 2, 5, &state) != 1)
+            result |= 1;
+        }
+      found_some_locale = 1;
+    }
+  /* This fails on HP-UX 11.11.  */
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        {
+          input[1] = '\0';
+          if (mbrtowc (&wc, input + 2, 5, &state) != 2)
+            result |= 2;
+        }
+      found_some_locale = 1;
+    }
+  /* 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
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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 Mac OS 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
-              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
-                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
-          ;;
-      esac
-    fi
-    rm -fr conftest*
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_retval=yes
+else $as_nop
+  if test $? != 77; then
+             gl_cv_func_mbrtowc_retval=no
+           fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
-$as_echo "$gt_cv_locale_fr" >&6; }
-  LOCALE_FR=$gt_cv_locale_fr
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_retval" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_retval" >&6; }
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5
-$as_echo_n "checking for a turkish Unicode locale... " >&6; }
-if ${gt_cv_locale_tr_utf8+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc returns 0 when parsing a NUL character" >&5
+printf %s "checking whether mbrtowc returns 0 when parsing a NUL character... " >&6; }
+if test ${gl_cv_func_mbrtowc_nul_retval+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+                  case "$host_os" in
+                       # Guess no on Solaris 8 and 9.
+        solaris2.[89]) gl_cv_func_mbrtowc_nul_retval="guessing no" ;;
+                       # Guess yes otherwise.
+        *)             gl_cv_func_mbrtowc_nul_retval="guessing yes" ;;
+      esac
+      if test $LOCALE_ZH_CN != none; then
+        if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
 #include <string.h>
-struct tm t;
-char buf[16];
-int main () {
-  /* On BeOS, locales are not implemented in libc.  Rather, libintl
-     imitates locale dependent behaviour by looking at the environment
-     variables, and all locales use the UTF-8 encoding.  But BeOS does not
-     implement the Turkish upper-/lowercase mappings.  Therefore, let this
-     program return 1 on BeOS.  */
-  /* Check whether the given locale name is recognized by the system.  */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET)
-     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in the abbreviation of the eighth month, the second
-     character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is
-     two bytes long, with UTF-8 encoding.  */
-  t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 4
-      || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f)
-    return 1;
-  /* Check whether the upper-/lowercase mappings are as expected for
-     Turkish.  */
-  if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i'
-      || towupper(0x0131) != 'I' || towlower ('I') != 0x0131)
-    return 1;
+#include <wchar.h>
+int main ()
+{
+  /* This fails on Solaris 8 and 9.  */
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "", 1, &state) != 0)
+        return 2;
+    }
   return 0;
 }
-
 _ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows locale name.
-          if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_tr_utf8=Turkish_Turkey.65001
-          else
-            # None found.
-            gt_cv_locale_tr_utf8=none
-          fi
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_tr_utf8=tr_TR
-          else
-            # Test for the locale name with explicit encoding suffix.
-            if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-              gt_cv_locale_tr_utf8=tr_TR.UTF-8
-            else
-              # Test for the Solaris 7 locale name.
-              if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
-                gt_cv_locale_tr_utf8=tr.UTF-8
-              else
-                # None found.
-                gt_cv_locale_tr_utf8=none
-              fi
-            fi
-          fi
-          ;;
-      esac
-    else
-      gt_cv_locale_tr_utf8=none
-    fi
-    rm -fr conftest*
-
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_nul_retval=yes
+else $as_nop
+  gl_cv_func_mbrtowc_nul_retval=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5
-$as_echo "$gt_cv_locale_tr_utf8" >&6; }
-  LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8
-
 
+      fi
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_nul_retval" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_nul_retval" >&6; }
 
 
-  for ac_func in closedir
-do :
-  ac_fn_c_check_func "$LINENO" "closedir" "ac_cv_func_closedir"
-if test "x$ac_cv_func_closedir" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_CLOSEDIR 1
-_ACEOF
 
-fi
-done
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc stores incomplete characters" >&5
+printf %s "checking whether mbrtowc stores incomplete characters... " >&6; }
+if test ${gl_cv_func_mbrtowc_stores_incomplete+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  if test $ac_cv_func_closedir = no; then
-    HAVE_CLOSEDIR=0
-  fi
+               case "$host_os" in
+               # Guess yes on native Windows.
+       mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
+       *)      gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
+     esac
+     case "$host_os" in
+       mingw*)
+         if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-    case $host_os,$HAVE_CLOSEDIR in
-    os2*,1)
-      REPLACE_CLOSEDIR=1;;
-  esac
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  int result = 0;
+  if (setlocale (LC_ALL, "French_France.65001") != NULL)
+    {
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      mbstate_t state;
 
-  if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+          && wc != (wchar_t) 0xBADFACE)
+        result |= 1;
+    }
+  if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+    {
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      mbstate_t state;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
+          && wc != (wchar_t) 0xBADFACE)
+        result |= 2;
+    }
+  if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+    {
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      mbstate_t state;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
+          && wc != (wchar_t) 0xBADFACE)
+        result |= 4;
+    }
+  if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+    {
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      mbstate_t state;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
+          && wc != (wchar_t) 0xBADFACE)
+        result |= 8;
+    }
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_stores_incomplete=no
+else $as_nop
+  gl_cv_func_mbrtowc_stores_incomplete=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+         ;;
+       *)
 
+         if test $LOCALE_FR_UTF8 != none; then
+           if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      mbstate_t state;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+          && wc != (wchar_t) 0xBADFACE)
+        return 1;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_stores_incomplete=no
+else $as_nop
+  gl_cv_func_mbrtowc_stores_incomplete=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS closedir.$ac_objext"
+         fi
+         ;;
+     esac
 
-  fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_stores_incomplete" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_stores_incomplete" >&6; }
 
 
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works on empty input" >&5
+printf %s "checking whether mbrtowc works on empty input... " >&6; }
+if test ${gl_cv_func_mbrtowc_empty_input+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+                  case "$host_os" in
+                              # Guess no on AIX and glibc systems.
+        aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+                              # Guess yes on native Windows.
+        mingw*)               gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+        *)                    gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+      esac
+      if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-    if test "$GNULIB_CLOSEDIR" != 1; then
-        if test "$GNULIB_CLOSEDIR" = 0; then
-      GNULIB_CLOSEDIR=$gl_module_indicator_condition
-    else
-      GNULIB_CLOSEDIR="($GNULIB_CLOSEDIR || $gl_module_indicator_condition)"
-    fi
-  fi
+           #include <wchar.h>
+           static wchar_t wc;
+           static mbstate_t mbs;
+           int
+           main (void)
+           {
+             return mbrtowc (&wc, "", 0, &mbs) != (size_t) -2;
+           }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_empty_input=yes
+else $as_nop
+  gl_cv_func_mbrtowc_empty_input=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_empty_input" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_empty_input" >&6; }
 
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C locale is free of encoding errors" >&5
+printf %s "checking whether the C locale is free of encoding errors... " >&6; }
+if test ${gl_cv_func_mbrtowc_C_locale_sans_EILSEQ+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-$as_echo "#define GNULIB_TEST_CLOSEDIR 1" >>confdefs.h
+               gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
 
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                 # Guess yes on native Windows.
+         mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
+       esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+            #include <locale.h>
+            #include <wchar.h>
 
+int
+main (void)
+{
 
+            int i;
+            char *locale = setlocale (LC_ALL, "C");
+            if (! locale)
+              return 2;
+            for (i = CHAR_MIN; i <= CHAR_MAX; i++)
+              {
+                char c = i;
+                wchar_t wc;
+                mbstate_t mbs = { 0, };
+                size_t ss = mbrtowc (&wc, &c, 1, &mbs);
+                if (1 < ss)
+                  return 3;
+              }
+            return 0;
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes
+else $as_nop
+  gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" >&6; }
 
+      case "$gl_cv_func_mbrtowc_null_arg1" in
+        *yes) ;;
+        *)
+printf "%s\n" "#define MBRTOWC_NULL_ARG1_BUG 1" >>confdefs.h
 
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_null_arg2" in
+        *yes) ;;
+        *)
+printf "%s\n" "#define MBRTOWC_NULL_ARG2_BUG 1" >>confdefs.h
 
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_retval" in
+        *yes) ;;
+        *)
+printf "%s\n" "#define MBRTOWC_RETVAL_BUG 1" >>confdefs.h
 
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_nul_retval" in
+        *yes) ;;
+        *)
+printf "%s\n" "#define MBRTOWC_NUL_RETVAL_BUG 1" >>confdefs.h
 
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_stores_incomplete" in
+        *no) ;;
+        *)
+printf "%s\n" "#define MBRTOWC_STORES_INCOMPLETE_BUG 1" >>confdefs.h
 
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_empty_input" in
+        *yes) ;;
+        *)
+printf "%s\n" "#define MBRTOWC_EMPTY_INPUT_BUG 1" >>confdefs.h
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_ctype_h='<'ctype.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <ctype.h>" >&5
-$as_echo_n "checking absolute name of <ctype.h>... " >&6; }
-if ${gl_cv_next_ctype_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+      case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
+        *yes) ;;
+        *)
+printf "%s\n" "#define MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ 1" >>confdefs.h
 
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
+    fi
+  fi
+  if test $REPLACE_MBSTATE_T = 1; then
+    case "$host_os" in
+      mingw*) LIB_MBRTOWC= ;;
+      *)
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
+printf %s "checking whether imported symbols can be declared weak... " >&6; }
+if test ${gl_cv_have_weak+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_cv_have_weak=no
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <ctype.h>
+extern void xyzzy ();
+#pragma weak xyzzy
+int
+main (void)
+{
+xyzzy();
+  ;
+  return 0;
+}
 _ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
-
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'ctype.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_have_weak=maybe
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+     if test $gl_cv_have_weak = maybe; then
+                     if test "$cross_compiling" = yes
+then :
+                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __ELF__
+             Extensible Linking Format
+             #endif
 
-        gl_cv_absolute_ctype_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Extensible Linking Format" >/dev/null 2>&1
+then :
+  gl_cv_have_weak="guessing yes"
+else $as_nop
+  gl_cv_have_weak="guessing no"
+fi
+rm -rf conftest*
 
-           gl_header=$gl_cv_absolute_ctype_h
-           gl_cv_next_ctype_h='"'$gl_header'"'
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+  return (fputs == NULL);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_have_weak=yes
+else $as_nop
+  gl_cv_have_weak=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_ctype_h" >&5
-$as_echo "$gl_cv_next_ctype_h" >&6; }
-     fi
-     NEXT_CTYPE_H=$gl_cv_next_ctype_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='<'ctype.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_ctype_h
      fi
-     NEXT_AS_FIRST_DIRECTIVE_CTYPE_H=$gl_next_as_first_directive
-
-
+          case " $LDFLAGS " in
+       *" -static "*) gl_cv_have_weak=no ;;
+     esac
+                    case "$gl_cv_have_weak" in
+       *yes)
+         case "$host_os" in
+           freebsd* | dragonfly* | midnightbsd*)
+             : > conftest1.c
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
+             cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+  return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
+               || gl_cv_have_weak=no
+             rm -f conftest1.c libempty.so conftest2.c conftest
+             ;;
+         esac
+         ;;
+     esac
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
+printf "%s\n" "$gl_cv_have_weak" >&6; }
+  case "$gl_cv_have_weak" in
+    *yes)
 
+printf "%s\n" "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
 
+      ;;
+  esac
 
+        case "$gl_cv_have_weak" in
+          *yes) LIB_MBRTOWC= ;;
+          *)    LIB_MBRTOWC="$LIBPTHREAD" ;;
+        esac
+        ;;
+    esac
+  else
+    LIB_MBRTOWC=
+  fi
 
 
+  if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
 
 
 
@@ -36010,160 +39999,124 @@ $as_echo "$gl_cv_next_ctype_h" >&6; }
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS mbrtowc.$ac_objext"
 
+    if test $REPLACE_MBSTATE_T = 1; then
 
 
-     if test $gl_cv_have_include_next = yes; then
-       gl_cv_next_dirent_h='<'dirent.h'>'
-     else
-       { $as_echo "$as_me:${as_lineno-$LINENO}: checking absolute name of <dirent.h>" >&5
-$as_echo_n "checking absolute name of <dirent.h>... " >&6; }
-if ${gl_cv_next_dirent_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-             if test $ac_cv_header_dirent_h = yes; then
 
 
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <dirent.h>
-_ACEOF
-                case "$host_os" in
-    aix*) gl_absname_cpp="$ac_cpp -C" ;;
-    *)    gl_absname_cpp="$ac_cpp" ;;
-  esac
 
-  case "$host_os" in
-    mingw*)
-                                          gl_dirsep_regex='[/\\]'
-      ;;
-    *)
-      gl_dirsep_regex='\/'
-      ;;
-  esac
-      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
-  gl_header_literal_regex=`echo 'dirent.h' \
-                           | sed -e "$gl_make_literal_regex_sed"`
-  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
-      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
-      s|^/[^/]|//&|
-      p
-      q
-    }'
+  M4_LIBOBJS="$M4_LIBOBJS lc-charset-dispatch.$ac_objext"
 
-        gl_cv_absolute_dirent_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
-  sed -n "$gl_absolute_header_sed"`
 
-           gl_header=$gl_cv_absolute_dirent_h
-           gl_cv_next_dirent_h='"'$gl_header'"'
-          else
-               gl_cv_next_dirent_h='<'dirent.h'>'
-             fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_dirent_h" >&5
-$as_echo "$gl_cv_next_dirent_h" >&6; }
-     fi
-     NEXT_DIRENT_H=$gl_cv_next_dirent_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='<'dirent.h'>'
-     else
-       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=$gl_cv_next_dirent_h
-     fi
-     NEXT_AS_FIRST_DIRECTIVE_DIRENT_H=$gl_next_as_first_directive
 
 
 
 
-  if test $ac_cv_header_dirent_h = yes; then
-    HAVE_DIRENT_H=1
-  else
-    HAVE_DIRENT_H=0
-  fi
+  M4_LIBOBJS="$M4_LIBOBJS mbtowc-lock.$ac_objext"
 
 
 
 
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  if test -n "$GCC"; then
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
+printf %s "checking whether the -Werror option is usable... " >&6; }
+if test ${gl_cv_cc_vis_werror+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Werror"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_cc_vis_werror=yes
+else $as_nop
+  gl_cv_cc_vis_werror=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+       CFLAGS="$gl_save_CFLAGS"
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
+printf "%s\n" "$gl_cv_cc_vis_werror" >&6; }
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
+printf %s "checking for simple visibility declarations... " >&6; }
+if test ${gl_cv_cc_visibility+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -fvisibility=hidden"
+                                          if test $gl_cv_cc_vis_werror = yes; then
+         CFLAGS="$CFLAGS -Werror"
+       fi
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+              extern __attribute__((__visibility__("default"))) int exportedvar;
+              extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+              extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+              void dummyfunc (void);
+              void dummyfunc (void) {}
 
+int
+main (void)
+{
 
-  for ac_func in dirfd
-do :
-  ac_fn_c_check_func "$LINENO" "dirfd" "ac_cv_func_dirfd"
-if test "x$ac_cv_func_dirfd" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_DIRFD 1
+  ;
+  return 0;
+}
 _ACEOF
-
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_cc_visibility=yes
+else $as_nop
+  gl_cv_cc_visibility=no
 fi
-done
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+       CFLAGS="$gl_save_CFLAGS"
 
-  ac_fn_c_check_decl "$LINENO" "dirfd" "ac_cv_have_decl_dirfd" "#include <sys/types.h>
-      #include <dirent.h>
-"
-if test "x$ac_cv_have_decl_dirfd" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
+printf "%s\n" "$gl_cv_cc_visibility" >&6; }
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
+    fi
+  fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_DIRFD $ac_have_decl
-_ACEOF
 
-  if test $ac_cv_have_decl_dirfd = no; then
-    HAVE_DECL_DIRFD=0
-  fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dirfd is a macro" >&5
-$as_echo_n "checking whether dirfd is a macro... " >&6; }
-if ${gl_cv_func_dirfd_macro+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+printf "%s\n" "#define HAVE_VISIBILITY $HAVE_VISIBILITY" >>confdefs.h
 
-#include <sys/types.h>
-#include <dirent.h>
-#ifdef dirfd
- dirent_header_defines_dirfd
-#endif
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "dirent_header_defines_dirfd" >/dev/null 2>&1; then :
-  gl_cv_func_dirfd_macro=yes
-else
-  gl_cv_func_dirfd_macro=no
-fi
-rm -f conftest*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dirfd_macro" >&5
-$as_echo "$gl_cv_func_dirfd_macro" >&6; }
 
-  # Use the replacement if we have no function or macro with that name,
-  # or if OS/2 kLIBC whose dirfd() does not work.
-  # Replace only if the system declares dirfd already.
-  case $ac_cv_func_dirfd,$gl_cv_func_dirfd_macro,$host_os,$ac_cv_have_decl_dirfd in
-    no,no,*,yes | *,*,os2*,yes)
-      REPLACE_DIRFD=1
+    fi
 
-$as_echo "#define REPLACE_DIRFD 1" >>confdefs.h
-;;
-  esac
 
-  if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
-     || test $REPLACE_DIRFD = 1; then
+  :
 
+  fi
 
 
 
@@ -36171,298 +40124,298 @@ $as_echo "#define REPLACE_DIRFD 1" >>confdefs.h
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS dirfd.$ac_objext"
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to get the file descriptor associated with an open DIR*" >&5
-$as_echo_n "checking how to get the file descriptor associated with an open DIR*... " >&6; }
-if ${gl_cv_sys_dir_fd_member_name+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+          GL_M4_GNULIB_MBRTOWC=1
 
-      dirfd_save_CFLAGS=$CFLAGS
-      for ac_expr in d_fd dd_fd; do
 
-        CFLAGS="$CFLAGS -DDIR_FD_MEMBER_NAME=$ac_expr"
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-           #include <sys/types.h>
-           #include <dirent.h>
-int
-main ()
-{
-DIR *dir_p = opendir("."); (void) dir_p->DIR_FD_MEMBER_NAME;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  dir_fd_found=yes
 
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-        CFLAGS=$dirfd_save_CFLAGS
-        test "$dir_fd_found" = yes && break
-      done
-      test "$dir_fd_found" = yes || ac_expr=no_such_member
 
-      gl_cv_sys_dir_fd_member_name=$ac_expr
+printf "%s\n" "#define GNULIB_TEST_MBRTOWC 1" >>confdefs.h
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_sys_dir_fd_member_name" >&5
-$as_echo "$gl_cv_sys_dir_fd_member_name" >&6; }
-  if test $gl_cv_sys_dir_fd_member_name != no_such_member; then
 
-cat >>confdefs.h <<_ACEOF
-#define DIR_FD_MEMBER_NAME $gl_cv_sys_dir_fd_member_name
-_ACEOF
 
-  fi
 
 
-  fi
 
 
 
 
 
-    if test "$GNULIB_DIRFD" != 1; then
-        if test "$GNULIB_DIRFD" = 0; then
-      GNULIB_DIRFD=$gl_module_indicator_condition
-    else
-      GNULIB_DIRFD="($GNULIB_DIRFD || $gl_module_indicator_condition)"
-    fi
-  fi
 
 
 
 
+        if case "$host_os" in
+       mingw*) true ;;
+       *) test $ac_cv_func_mbsinit = yes ;;
+     esac \
+    && test $ac_cv_func_mbrtowc = yes; then
 
-$as_echo "#define GNULIB_TEST_DIRFD 1" >>confdefs.h
 
 
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+printf %s "checking whether mbrtowc handles incomplete characters... " >&6; }
+if test ${gl_cv_func_mbrtowc_incomplete_state+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+                  case "$host_os" in
+                     # Guess no on AIX and OSF/1.
+        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+                     # Guess yes otherwise.
+        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+      esac
+      if test $LOCALE_JA != none; then
+        if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-    REPLACE_DUP=1
-  fi
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        if (mbsinit (&state))
+          return 2;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_incomplete_state=yes
+else $as_nop
+  gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dup works" >&5
-$as_echo_n "checking whether dup works... " >&6; }
-if ${gl_cv_func_dup_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  gl_cv_func_dup_works='guessing yes'
-else
+      else
+        if test $LOCALE_FR_UTF8 != none; then
+          if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
-                         #include <fcntl.h>
-                         #include <errno.h>
-int
-main ()
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
 {
-/* On OS/2 kLIBC, dup does not work on a directory fd.  */
-           int fd = open (".", O_RDONLY);
-           return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
-  ;
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        if (mbsinit (&state))
+          return 2;
+    }
   return 0;
 }
-
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_dup_works=yes
-else
-  gl_cv_func_dup_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_incomplete_state=yes
+else $as_nop
+  gl_cv_func_mbrtowc_incomplete_state=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+        fi
+      fi
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_dup_works" >&5
-$as_echo "$gl_cv_func_dup_works" >&6; }
-  case "$gl_cv_func_dup_works" in
-    *yes) ;;
-    *)
-      REPLACE_DUP=1
-      ;;
-  esac
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
 
-  if test $REPLACE_DUP = 1; then
 
 
 
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if test ${gl_cv_func_mbrtowc_sanitycheck+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+                  case "$host_os" in
+                    # Guess no on Solaris 8.
+        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
+                    # Guess yes otherwise.
+        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
+      esac
+      if test $LOCALE_ZH_CN != none; then
+        if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  /* This fails on Solaris 8:
+     mbrtowc returns 2, and sets wc to 0x00F0.
+     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
 
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 6, &state) != 4
+          && mbtowc (&wc, input + 3, 6) == 4)
+        return 2;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_sanitycheck=yes
+else $as_nop
+  gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+      fi
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS dup.$ac_objext"
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
 
-    :
+    REPLACE_MBSTATE_T=0
+    case "$gl_cv_func_mbrtowc_incomplete_state" in
+      *yes) ;;
+      *) REPLACE_MBSTATE_T=1 ;;
+    esac
+    case "$gl_cv_func_mbrtowc_sanitycheck" in
+      *yes) ;;
+      *) REPLACE_MBSTATE_T=1 ;;
+    esac
+  else
+    REPLACE_MBSTATE_T=1
   fi
 
 
 
+  if test $ac_cv_func_mbsinit = no; then
+    HAVE_MBSINIT=0
+    ac_fn_check_decl "$LINENO" "mbsinit" "ac_cv_have_decl_mbsinit" "
+      #include <wchar.h>
 
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_mbsinit" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_MBSINIT $ac_have_decl" >>confdefs.h
 
-    if test "$GNULIB_DUP" != 1; then
-        if test "$GNULIB_DUP" = 0; then
-      GNULIB_DUP=$gl_module_indicator_condition
+    if test $ac_cv_have_decl_mbsinit = yes; then
+                        REPLACE_MBSINIT=1
+    fi
+  else
+    if test $REPLACE_MBSTATE_T = 1; then
+      REPLACE_MBSINIT=1
     else
-      GNULIB_DUP="($GNULIB_DUP || $gl_module_indicator_condition)"
+                        case "$host_os" in
+        mingw*) REPLACE_MBSINIT=1 ;;
+      esac
     fi
   fi
 
+  if test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1; then
 
 
 
 
-$as_echo "#define GNULIB_TEST_DUP 1" >>confdefs.h
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS mbsinit.$ac_objext"
 
 
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-    REPLACE_FDOPEN=1
-  else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fdopen sets errno" >&5
-$as_echo_n "checking whether fdopen sets errno... " >&6; }
-if ${gl_cv_func_fdopen_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  :
 
-        if test "$cross_compiling" = yes; then :
-  case "$host_os" in
-             mingw*) gl_cv_func_fdopen_works="guessing no" ;;
-             *)      gl_cv_func_fdopen_works="guessing yes" ;;
-           esac
+  fi
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <stdio.h>
-#include <errno.h>
-int
-main (void)
-{
-  FILE *fp;
-  errno = 0;
-  fp = fdopen (-1, "r");
-  if (fp == NULL && errno == 0)
-    return 1;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_fdopen_works=yes
-else
-  gl_cv_func_fdopen_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopen_works" >&5
-$as_echo "$gl_cv_func_fdopen_works" >&6; }
-    case "$gl_cv_func_fdopen_works" in
-      *no) REPLACE_FDOPEN=1 ;;
-    esac
-  fi
 
-  if test $REPLACE_FDOPEN = 1; then
 
 
 
 
+          GL_M4_GNULIB_MBSINIT=1
 
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS fdopen.$ac_objext"
 
+printf "%s\n" "#define GNULIB_TEST_MBSINIT 1" >>confdefs.h
 
-  fi
 
 
 
 
 
-    if test "$GNULIB_FDOPEN" != 1; then
-        if test "$GNULIB_FDOPEN" = 0; then
-      GNULIB_FDOPEN=$gl_module_indicator_condition
-    else
-      GNULIB_FDOPEN="($GNULIB_FDOPEN || $gl_module_indicator_condition)"
-    fi
+  if test $ac_cv_func_mbslen = yes; then
+    HAVE_MBSLEN=1
+  else
+    HAVE_MBSLEN=0
   fi
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_FDOPEN 1" >>confdefs.h
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flexible array member" >&5
-$as_echo_n "checking for flexible array member... " >&6; }
-if ${ac_cv_c_flexmember+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdlib.h>
-            #include <stdio.h>
-            #include <stddef.h>
-            struct s { int n; double d[]; };
-int
-main ()
-{
-int m = getchar ();
-            size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
-            nbytes += sizeof (struct s) - 1;
-            nbytes -= nbytes % sizeof (struct s);
-            struct s *p = malloc (nbytes);
-            p->d[0] = 0.0;
-            return p->d != (double *) NULL;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_flexmember=yes
-else
-  ac_cv_c_flexmember=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_flexmember" >&5
-$as_echo "$ac_cv_c_flexmember" >&6; }
-  if test $ac_cv_c_flexmember = yes; then
 
-$as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
+          GL_M4_GNULIB_MBSLEN=1
 
-  else
-    $as_echo "#define FLEXIBLE_ARRAY_MEMBER 1" >>confdefs.h
 
-  fi
 
 
 
+printf "%s\n" "#define GNULIB_TEST_MBSLEN 1" >>confdefs.h
 
 
 
@@ -36470,389 +40423,166 @@ $as_echo "#define FLEXIBLE_ARRAY_MEMBER /**/" >>confdefs.h
 
 
 
-  case $gl_cv_func_getcwd_null,$gl_cv_func_getcwd_posix_signature in
-  *yes,yes) ;;
-  *)
-        REPLACE_GETCWD=1
-    ;;
-  esac
 
-  if test $REPLACE_GETCWD = 1; then
 
 
 
 
+          GL_M4_GNULIB_MBSSTR=1
 
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS getcwd-lgpl.$ac_objext"
 
-  fi
+printf "%s\n" "#define GNULIB_TEST_MBSSTR 1" >>confdefs.h
 
 
 
 
 
-    if test "$GNULIB_GETCWD" != 1; then
-        if test "$GNULIB_GETCWD" = 0; then
-      GNULIB_GETCWD=$gl_module_indicator_condition
-    else
-      GNULIB_GETCWD="($GNULIB_GETCWD || $gl_module_indicator_condition)"
+
+  ac_fn_c_check_func "$LINENO" "mbtowc" "ac_cv_func_mbtowc"
+if test "x$ac_cv_func_mbtowc" = xyes
+then :
+  printf "%s\n" "#define HAVE_MBTOWC 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_mbtowc = no; then
+    HAVE_MBTOWC=0
+  else
+    if false; then
+      REPLACE_MBTOWC=1
     fi
   fi
 
+  if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then
 
 
 
 
-$as_echo "#define GNULIB_TEST_GETCWD 1" >>confdefs.h
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS mbtowc.$ac_objext"
 
 
-  for ac_func in getpagesize
-do :
-  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
-if test "x$ac_cv_func_getpagesize" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETPAGESIZE 1
-_ACEOF
+  :
 
-fi
-done
+  fi
 
-  if test $ac_cv_func_getpagesize = no; then
-    HAVE_GETPAGESIZE=0
-    for ac_header in OS.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "OS.h" "ac_cv_header_OS_h" "$ac_includes_default"
-if test "x$ac_cv_header_OS_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_OS_H 1
-_ACEOF
 
-fi
 
-done
 
-    if test $ac_cv_header_OS_h = yes; then
-      HAVE_OS_H=1
-    fi
-    for ac_header in sys/param.h
-do :
-  ac_fn_c_check_header_mongrel "$LINENO" "sys/param.h" "ac_cv_header_sys_param_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_param_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_PARAM_H 1
-_ACEOF
 
-fi
 
-done
 
-    if test $ac_cv_header_sys_param_h = yes; then
-      HAVE_SYS_PARAM_H=1
-    fi
-  fi
-  case "$host_os" in
-    mingw*)
-      REPLACE_GETPAGESIZE=1
-      ;;
-  esac
-      ac_fn_c_check_decl "$LINENO" "getpagesize" "ac_cv_have_decl_getpagesize" "$ac_includes_default"
-if test "x$ac_cv_have_decl_getpagesize" = xyes; then :
 
-else
-  HAVE_DECL_GETPAGESIZE=0
-fi
 
+          GL_M4_GNULIB_MBTOWC=1
 
-  if test $REPLACE_GETPAGESIZE = 1; then
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_MBTOWC 1" >>confdefs.h
 
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS getpagesize.$ac_objext"
 
-  fi
+  :
 
 
+  if test $REPLACE_MEMCHR = 1; then
 
 
 
-    if test "$GNULIB_GETPAGESIZE" != 1; then
-        if test "$GNULIB_GETPAGESIZE" = 0; then
-      GNULIB_GETPAGESIZE=$gl_module_indicator_condition
-    else
-      GNULIB_GETPAGESIZE="($GNULIB_GETPAGESIZE || $gl_module_indicator_condition)"
-    fi
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS memchr.$ac_objext"
+
+
+  ac_fn_c_check_header_compile "$LINENO" "bp-sym.h" "ac_cv_header_bp_sym_h" "$ac_includes_default"
+if test "x$ac_cv_header_bp_sym_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_BP_SYM_H 1" >>confdefs.h
+
+fi
+
+
   fi
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_GETPAGESIZE 1" >>confdefs.h
 
 
 
 
+          GL_M4_GNULIB_MEMCHR=1
 
 
 
 
-  PRIPTR_PREFIX=
-  if test -n "$STDINT_H"; then
-        PRIPTR_PREFIX='"l"'
-  else
-        for glpfx in '' l ll I64; do
-      case $glpfx in
-        '')  gltype1='int';;
-        l)   gltype1='long int';;
-        ll)  gltype1='long long int';;
-        I64) gltype1='__int64';;
-      esac
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdint.h>
-           extern intptr_t foo;
-           extern $gltype1 foo;
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  PRIPTR_PREFIX='"'$glpfx'"'
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-      test -n "$PRIPTR_PREFIX" && break
-    done
-  fi
+printf "%s\n" "#define GNULIB_TEST_MEMCHR 1" >>confdefs.h
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT32_MAX < INTMAX_MAX" >&5
-$as_echo_n "checking whether INT32_MAX < INTMAX_MAX... " >&6; }
-if ${gl_cv_test_INT32_MAX_LT_INTMAX_MAX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Work also in C++ mode.  */
-            #define __STDC_LIMIT_MACROS 1
 
-            /* Work if build is not clean.  */
-            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
 
-            #include <limits.h>
-            #if HAVE_STDINT_H
-             #include <stdint.h>
-            #endif
 
-            #if defined INT32_MAX && defined INTMAX_MAX
-             #define CONDITION (INT32_MAX < INTMAX_MAX)
-            #elif HAVE_LONG_LONG_INT
-             #define CONDITION (sizeof (int) < sizeof (long long int))
-            #else
-             #define CONDITION 0
-            #endif
-            int test[CONDITION ? 1 : -1];
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_test_INT32_MAX_LT_INTMAX_MAX=yes
-else
-  gl_cv_test_INT32_MAX_LT_INTMAX_MAX=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+
+  ac_fn_c_check_func "$LINENO" "mempcpy" "ac_cv_func_mempcpy"
+if test "x$ac_cv_func_mempcpy" = xyes
+then :
+  printf "%s\n" "#define HAVE_MEMPCPY 1" >>confdefs.h
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&5
-$as_echo "$gl_cv_test_INT32_MAX_LT_INTMAX_MAX" >&6; }
-  if test $gl_cv_test_INT32_MAX_LT_INTMAX_MAX = yes; then
-    INT32_MAX_LT_INTMAX_MAX=1;
-  else
-    INT32_MAX_LT_INTMAX_MAX=0;
+
+  if test $ac_cv_func_mempcpy = no; then
+    HAVE_MEMPCPY=0
   fi
 
+  if test $HAVE_MEMPCPY = 0; then
 
-  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether INT64_MAX == LONG_MAX" >&5
-$as_echo_n "checking whether INT64_MAX == LONG_MAX... " >&6; }
-if ${gl_cv_test_INT64_MAX_EQ_LONG_MAX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Work also in C++ mode.  */
-            #define __STDC_LIMIT_MACROS 1
 
-            /* Work if build is not clean.  */
-            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
 
-            #include <limits.h>
-            #if HAVE_STDINT_H
-             #include <stdint.h>
-            #endif
 
-            #if defined INT64_MAX
-             #define CONDITION (INT64_MAX == LONG_MAX)
-            #elif HAVE_LONG_LONG_INT
-             #define CONDITION (sizeof (long long int) == sizeof (long int))
-            #else
-             #define CONDITION 0
-            #endif
-            int test[CONDITION ? 1 : -1];
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_test_INT64_MAX_EQ_LONG_MAX=yes
-else
-  gl_cv_test_INT64_MAX_EQ_LONG_MAX=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&5
-$as_echo "$gl_cv_test_INT64_MAX_EQ_LONG_MAX" >&6; }
-  if test $gl_cv_test_INT64_MAX_EQ_LONG_MAX = yes; then
-    INT64_MAX_EQ_LONG_MAX=1;
-  else
-    INT64_MAX_EQ_LONG_MAX=0;
-  fi
 
 
-  else
-    INT64_MAX_EQ_LONG_MAX=-1
+  M4_LIBOBJS="$M4_LIBOBJS mempcpy.$ac_objext"
+
+
+  :
+
   fi
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT32_MAX < UINTMAX_MAX" >&5
-$as_echo_n "checking whether UINT32_MAX < UINTMAX_MAX... " >&6; }
-if ${gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Work also in C++ mode.  */
-            #define __STDC_LIMIT_MACROS 1
 
-            /* Work if build is not clean.  */
-            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
 
-            #include <limits.h>
-            #if HAVE_STDINT_H
-             #include <stdint.h>
-            #endif
 
-            #if defined UINT32_MAX && defined UINTMAX_MAX
-             #define CONDITION (UINT32_MAX < UINTMAX_MAX)
-            #elif HAVE_LONG_LONG_INT
-             #define CONDITION (sizeof (unsigned int) < sizeof (unsigned long long int))
-            #else
-             #define CONDITION 0
-            #endif
-            int test[CONDITION ? 1 : -1];
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=yes
-else
-  gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&5
-$as_echo "$gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX" >&6; }
-  if test $gl_cv_test_UINT32_MAX_LT_UINTMAX_MAX = yes; then
-    UINT32_MAX_LT_UINTMAX_MAX=1;
-  else
-    UINT32_MAX_LT_UINTMAX_MAX=0;
-  fi
 
 
-  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether UINT64_MAX == ULONG_MAX" >&5
-$as_echo_n "checking whether UINT64_MAX == ULONG_MAX... " >&6; }
-if ${gl_cv_test_UINT64_MAX_EQ_ULONG_MAX+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-/* Work also in C++ mode.  */
-            #define __STDC_LIMIT_MACROS 1
 
-            /* Work if build is not clean.  */
-            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H
+          GL_M4_GNULIB_MEMPCPY=1
 
-            #include <limits.h>
-            #if HAVE_STDINT_H
-             #include <stdint.h>
-            #endif
 
-            #if defined UINT64_MAX
-             #define CONDITION (UINT64_MAX == ULONG_MAX)
-            #elif HAVE_LONG_LONG_INT
-             #define CONDITION (sizeof (unsigned long long int) == sizeof (unsigned long int))
-            #else
-             #define CONDITION 0
-            #endif
-            int test[CONDITION ? 1 : -1];
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=yes
-else
-  gl_cv_test_UINT64_MAX_EQ_ULONG_MAX=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&5
-$as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
-  if test $gl_cv_test_UINT64_MAX_EQ_ULONG_MAX = yes; then
-    UINT64_MAX_EQ_ULONG_MAX=1;
-  else
-    UINT64_MAX_EQ_ULONG_MAX=0;
-  fi
 
 
-  else
-    UINT64_MAX_EQ_ULONG_MAX=-1
-  fi
+printf "%s\n" "#define GNULIB_TEST_MEMPCPY 1" >>confdefs.h
 
 
 
@@ -36861,679 +40591,367 @@ $as_echo "$gl_cv_test_UINT64_MAX_EQ_ULONG_MAX" >&6; }
 
 
 
-  if test $ac_cv_func_isblank = no; then
-    HAVE_ISBLANK=0
+  if test $ac_cv_have_decl_memrchr = no; then
+    HAVE_DECL_MEMRCHR=0
   fi
 
-  if test $HAVE_ISBLANK = 0; then
+  ac_fn_c_check_func "$LINENO" "memrchr" "ac_cv_func_memrchr"
+if test "x$ac_cv_func_memrchr" = xyes
+then :
+  printf "%s\n" "#define HAVE_MEMRCHR 1" >>confdefs.h
+
+fi
 
 
+  if test $ac_cv_func_memrchr = no; then
 
 
 
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS isblank.$ac_objext"
 
+
+  M4_LIBOBJS="$M4_LIBOBJS memrchr.$ac_objext"
+
+    :
   fi
 
 
 
 
 
-    if test "$GNULIB_ISBLANK" != 1; then
-        if test "$GNULIB_ISBLANK" = 0; then
-      GNULIB_ISBLANK=$gl_module_indicator_condition
-    else
-      GNULIB_ISBLANK="($GNULIB_ISBLANK || $gl_module_indicator_condition)"
-    fi
-  fi
 
 
 
 
+          GL_M4_GNULIB_MEMRCHR=1
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
-$as_echo_n "checking where to find the exponent in a 'double'... " >&6; }
-if ${gl_cv_cc_double_expbit0+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
 
-                                                                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#if defined arm || defined __arm || defined __arm__
-  mixed_endianness
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "mixed_endianness" >/dev/null 2>&1; then :
-  gl_cv_cc_double_expbit0="unknown"
-else
+printf "%s\n" "#define GNULIB_TEST_MEMRCHR 1" >>confdefs.h
 
-                                                         :
-if ${ac_cv_c_bigendian+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_c_bigendian=unknown
-    # See if we're dealing with a universal compiler.
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifndef __APPLE_CC__
-              not a universal capable compiler
-            #endif
-            typedef int dummy;
 
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
 
-       # Check for potential -arch flags.  It is not universal unless
-       # there are at least two -arch flags with different values.
-       ac_arch=
-       ac_prev=
-       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
-        if test -n "$ac_prev"; then
-          case $ac_word in
-            i?86 | x86_64 | ppc | ppc64)
-              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
-                ac_arch=$ac_word
-              else
-                ac_cv_c_bigendian=universal
-                break
-              fi
-              ;;
-          esac
-          ac_prev=
-        elif test "x$ac_word" = "x-arch"; then
-          ac_prev=arch
-        fi
-       done
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if sys/param.h defines the BYTE_ORDER macro.
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <sys/types.h>
-            #include <sys/param.h>
 
-int
-main ()
-{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
-                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
-                    && LITTLE_ENDIAN)
-             bogus endian macros
-            #endif
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to BIG_ENDIAN or not.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing slash" >&5
+printf %s "checking whether mkdir handles trailing slash... " >&6; }
+if test ${gl_cv_func_mkdir_trailing_slash_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  rm -rf conftest.dir
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                           # Guess yes on Linux systems.
+          linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+                           # Guess yes on glibc systems.
+          *-gnu* | gnu*)   gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+                           # Guess yes on MSVC, no on mingw.
+          mingw*)          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <sys/types.h>
-               #include <sys/param.h>
 
-int
-main ()
-{
-#if BYTE_ORDER != BIG_ENDIAN
-                not big endian
-               #endif
+#ifdef _MSC_VER
+ Known
+#endif
 
-  ;
-  return 0;
-}
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_func_mkdir_trailing_slash_works="guessing yes"
+else $as_nop
+  gl_cv_func_mkdir_trailing_slash_works="guessing no"
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <limits.h>
+rm -rf conftest*
 
-int
-main ()
-{
-#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
-             bogus endian macros
-            #endif
+                           ;;
+                           # If we don't know, obey --enable-cross-guesses.
+          *)               gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
+        esac
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  # It does; now see whether it defined to _BIG_ENDIAN or not.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <limits.h>
+
+          #include <sys/types.h>
+          #include <sys/stat.h>
+
+
+$gl_mda_defines
 
 int
-main ()
+main (void)
 {
-#ifndef _BIG_ENDIAN
-                not big endian
-               #endif
-
+return mkdir ("conftest.dir/", 0700);
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_c_bigendian=yes
-else
-  ac_cv_c_bigendian=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mkdir_trailing_slash_works=yes
+else $as_nop
+  gl_cv_func_mkdir_trailing_slash_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    fi
-    if test $ac_cv_c_bigendian = unknown; then
-      # Compile a test program.
-      if test "$cross_compiling" = yes; then :
-  # Try to guess by grepping values from an object file.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-short int ascii_mm[] =
-                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-               short int ascii_ii[] =
-                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
-               int use_ascii (int i) {
-                 return ascii_mm[i] + ascii_ii[i];
-               }
-               short int ebcdic_ii[] =
-                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-               short int ebcdic_mm[] =
-                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
-               int use_ebcdic (int i) {
-                 return ebcdic_mm[i] + ebcdic_ii[i];
-               }
-               extern int foo;
 
-int
-main ()
-{
-return use_ascii (foo) == use_ebcdic (foo);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
-             ac_cv_c_bigendian=yes
-           fi
-           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
-             if test "$ac_cv_c_bigendian" = unknown; then
-               ac_cv_c_bigendian=no
-             else
-               # finding both strings is unlikely to happen, but who knows?
-               ac_cv_c_bigendian=unknown
-             fi
-           fi
+     rm -rf conftest.dir
+
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-else
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_slash_works" >&5
+printf "%s\n" "$gl_cv_func_mkdir_trailing_slash_works" >&6; }
+  case "$gl_cv_func_mkdir_trailing_slash_works" in
+    *yes) ;;
+    *)
+      REPLACE_MKDIR=1
+      ;;
+  esac
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mkdir handles trailing dot" >&5
+printf %s "checking whether mkdir handles trailing dot... " >&6; }
+if test ${gl_cv_func_mkdir_trailing_dot_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  rm -rf conftest.dir
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                         # Guess yes on glibc systems.
+          *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
+                         # Guess yes on musl systems.
+          *-musl*)       gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
+                         # Guess no on native Windows.
+          mingw*)        gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
+                         # If we don't know, obey --enable-cross-guesses.
+          *)             gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
+        esac
+
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
 
-            /* Are we little or big endian?  From Harbison&Steele.  */
-            union
-            {
-              long int l;
-              char c[sizeof (long int)];
-            } u;
-            u.l = 1;
-            return u.c[sizeof (long int) - 1] == 1;
+          #include <sys/types.h>
+          #include <sys/stat.h>
+
 
+$gl_mda_defines
+
+int
+main (void)
+{
+return !mkdir ("conftest.dir/./", 0700);
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  ac_cv_c_bigendian=no
-else
-  ac_cv_c_bigendian=yes
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mkdir_trailing_dot_works=yes
+else $as_nop
+  gl_cv_func_mkdir_trailing_dot_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-    fi
+     rm -rf conftest.dir
+
+
 fi
-:
- case $ac_cv_c_bigendian in #(
-   yes)
-     gl_cv_cc_double_expbit0="word 0 bit 20";; #(
-   no)
-     gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
-   universal)
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mkdir_trailing_dot_works" >&5
+printf "%s\n" "$gl_cv_func_mkdir_trailing_dot_works" >&6; }
+  case "$gl_cv_func_mkdir_trailing_dot_works" in
+    *yes) ;;
+    *)
+      REPLACE_MKDIR=1
 
-$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+printf "%s\n" "#define FUNC_MKDIR_DOT_BUG 1" >>confdefs.h
 
-     ;; #(
-   *)
-     gl_cv_cc_double_expbit0="unknown" ;;
- esac
+      ;;
+  esac
 
+  if test $REPLACE_MKDIR = 1; then
 
-fi
-rm -f conftest*
 
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
-  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { double value; unsigned int word[NWORDS]; } memory_double;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (double x)
-{
-  memory_double m;
-  size_t i;
-  /* Clear it first, in case sizeof (double) < sizeof (memory_double).  */
-  memset (&m, 0, sizeof (memory_double));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
-int main ()
-{
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25);
-  add_to_ored_words (0.5);
-  add_to_ored_words (1.0);
-  add_to_ored_words (2.0);
-  add_to_ored_words (4.0);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
-}
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_double_expbit0=`cat conftest.out`
-else
-  gl_cv_cc_double_expbit0="unknown"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-      rm -f conftest.out
+
+
+  M4_LIBOBJS="$M4_LIBOBJS mkdir.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_MKDIR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_MKDIR 1" >>confdefs.h
+
+
+
+
+
+  ac_fn_c_check_func "$LINENO" "mkdtemp" "ac_cv_func_mkdtemp"
+if test "x$ac_cv_func_mkdtemp" = xyes
+then :
+  printf "%s\n" "#define HAVE_MKDTEMP 1" >>confdefs.h
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
-$as_echo "$gl_cv_cc_double_expbit0" >&6; }
-  case "$gl_cv_cc_double_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
 
-cat >>confdefs.h <<_ACEOF
-#define DBL_EXPBIT0_WORD $word
-_ACEOF
+  if test $ac_cv_func_mkdtemp = no; then
+    HAVE_MKDTEMP=0
+  fi
 
+  if test $HAVE_MKDTEMP = 0; then
 
-cat >>confdefs.h <<_ACEOF
-#define DBL_EXPBIT0_BIT $bit
-_ACEOF
 
-      ;;
-  esac
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
-$as_echo_n "checking where to find the exponent in a 'float'... " >&6; }
-if ${gl_cv_cc_float_expbit0+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
-  gl_cv_cc_float_expbit0="word 0 bit 23"
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
-  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { float value; unsigned int word[NWORDS]; } memory_float;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (float x)
-{
-  memory_float m;
-  size_t i;
-  /* Clear it first, in case
-     sizeof (float) < sizeof (memory_float).  */
-  memset (&m, 0, sizeof (memory_float));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
-int main ()
-{
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25f);
-  add_to_ored_words (0.5f);
-  add_to_ored_words (1.0f);
-  add_to_ored_words (2.0f);
-  add_to_ored_words (4.0f);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
-}
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_float_expbit0=`cat conftest.out`
-else
-  gl_cv_cc_float_expbit0="unknown"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-      rm -f conftest.out
+  M4_LIBOBJS="$M4_LIBOBJS mkdtemp.$ac_objext"
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
-$as_echo "$gl_cv_cc_float_expbit0" >&6; }
-  case "$gl_cv_cc_float_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
+    :
 
-cat >>confdefs.h <<_ACEOF
-#define FLT_EXPBIT0_WORD $word
-_ACEOF
+  fi
 
 
-cat >>confdefs.h <<_ACEOF
-#define FLT_EXPBIT0_BIT $bit
-_ACEOF
 
-      ;;
-  esac
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
-$as_echo_n "checking where to find the exponent in a 'long double'... " >&6; }
-if ${gl_cv_cc_long_double_expbit0+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-      if test "$cross_compiling" = yes; then :
 
-                              gl_cv_cc_long_double_expbit0="unknown"
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+          GL_M4_GNULIB_MKDTEMP=1
 
-#include <float.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <string.h>
-#define NWORDS \
-  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
-typedef union { long double value; unsigned int word[NWORDS]; }
-        memory_long_double;
-static unsigned int ored_words[NWORDS];
-static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (long double x)
-{
-  memory_long_double m;
-  size_t i;
-  /* Clear it first, in case
-     sizeof (long double) < sizeof (memory_long_double).  */
-  memset (&m, 0, sizeof (memory_long_double));
-  m.value = x;
-  for (i = 0; i < NWORDS; i++)
-    {
-      ored_words[i] |= m.word[i];
-      anded_words[i] &= m.word[i];
-    }
-}
-int main ()
-{
-  size_t j;
-  FILE *fp = fopen ("conftest.out", "w");
-  if (fp == NULL)
-    return 1;
-  for (j = 0; j < NWORDS; j++)
-    anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25L);
-  add_to_ored_words (0.5L);
-  add_to_ored_words (1.0L);
-  add_to_ored_words (2.0L);
-  add_to_ored_words (4.0L);
-  /* Remove bits that are common (e.g. if representation of the first mantissa
-     bit is explicit).  */
-  for (j = 0; j < NWORDS; j++)
-    ored_words[j] &= ~anded_words[j];
-  /* Now find the nonzero word.  */
-  for (j = 0; j < NWORDS; j++)
-    if (ored_words[j] != 0)
-      break;
-  if (j < NWORDS)
-    {
-      size_t i;
-      for (i = j + 1; i < NWORDS; i++)
-        if (ored_words[i] != 0)
-          {
-            fprintf (fp, "unknown");
-            return (fclose (fp) != 0);
-          }
-      for (i = 0; ; i++)
-        if ((ored_words[j] >> i) & 1)
-          {
-            fprintf (fp, "word %d bit %d", (int) j, (int) i);
-            return (fclose (fp) != 0);
-          }
-    }
-  fprintf (fp, "unknown");
-  return (fclose (fp) != 0);
-}
 
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_cc_long_double_expbit0=`cat conftest.out`
-else
-  gl_cv_cc_long_double_expbit0="unknown"
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-      rm -f conftest.out
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
-$as_echo "$gl_cv_cc_long_double_expbit0" >&6; }
-  case "$gl_cv_cc_long_double_expbit0" in
-    word*bit*)
-      word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
-      bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
 
-cat >>confdefs.h <<_ACEOF
-#define LDBL_EXPBIT0_WORD $word
-_ACEOF
+printf "%s\n" "#define GNULIB_TEST_MKDTEMP 1" >>confdefs.h
 
 
-cat >>confdefs.h <<_ACEOF
-#define LDBL_EXPBIT0_BIT $bit
-_ACEOF
 
-      ;;
-  esac
 
 
 
 
+  if test $ac_cv_func_mkstemp = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working mkstemp" >&5
+printf %s "checking for working mkstemp... " >&6; }
+if test ${gl_cv_func_working_mkstemp+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
-  if test $ac_cv_func_link = no; then
-    HAVE_LINK=0
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether link obeys POSIX" >&5
-$as_echo_n "checking whether link obeys POSIX... " >&6; }
-if ${gl_cv_func_link_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  touch conftest.a
-       # Assume that if we have lstat, we can also check symlinks.
-       if test $ac_cv_func_lstat = yes; then
-         ln -s conftest.a conftest.lnk
-       fi
-       if test "$cross_compiling" = yes; then :
+        mkdir conftest.mkstemp
+        if test "$cross_compiling" = yes
+then :
   case "$host_os" in
-                    # Guess yes on glibc systems.
-            *-gnu*) gl_cv_func_link_works="guessing yes" ;;
-                    # If we don't know, assume the worst.
-            *)      gl_cv_func_link_works="guessing no" ;;
-          esac
+                            # Guess yes on glibc systems.
+             *-gnu* | gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
+                            # Guess yes on musl systems.
+             *-musl*)       gl_cv_func_working_mkstemp="guessing yes" ;;
+                            # Guess no on native Windows.
+             mingw*)        gl_cv_func_working_mkstemp="guessing no" ;;
+                            # If we don't know, obey --enable-cross-guesses.
+             *)             gl_cv_func_working_mkstemp="$gl_cross_guess_normal" ;;
+           esac
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <unistd.h>
-             #include <stdio.h>
+$ac_includes_default
+
+
+$gl_mda_defines
 
 int
-main ()
+main (void)
 {
 int result = 0;
-             if (!link ("conftest.a", "conftest.b/"))
-               result |= 1;
-#if HAVE_LSTAT
-             if (!link ("conftest.lnk/", "conftest.b"))
-               result |= 2;
-             if (rename ("conftest.a", "conftest.b"))
-               result |= 4;
-             if (!link ("conftest.b", "conftest.lnk"))
-               result |= 8;
-#endif
-             return result;
-
+              int i;
+              off_t large = (off_t) 4294967295u;
+              if (large < 0)
+                large = 2147483647;
+              umask (0);
+              for (i = 0; i < 70; i++)
+                {
+                  char templ[] = "conftest.mkstemp/coXXXXXX";
+                  int (*mkstemp_function) (char *) = mkstemp;
+                  int fd = mkstemp_function (templ);
+                  if (fd < 0)
+                    result |= 1;
+                  else
+                    {
+                      struct stat st;
+                      if (lseek (fd, large, SEEK_SET) != large)
+                        result |= 2;
+                      if (fstat (fd, &st) < 0)
+                        result |= 4;
+                      else if (st.st_mode & 0077)
+                        result |= 8;
+                      if (close (fd))
+                        result |= 16;
+                    }
+                }
+              return result;
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_link_works=yes
-else
-  gl_cv_func_link_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_working_mkstemp=yes
+else $as_nop
+  gl_cv_func_working_mkstemp=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
-       rm -f conftest.a conftest.b conftest.lnk
+        rm -rf conftest.mkstemp
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_link_works" >&5
-$as_echo "$gl_cv_func_link_works" >&6; }
-    case "$gl_cv_func_link_works" in
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_mkstemp" >&5
+printf "%s\n" "$gl_cv_func_working_mkstemp" >&6; }
+    case "$gl_cv_func_working_mkstemp" in
       *yes) ;;
       *)
-        REPLACE_LINK=1
+        REPLACE_MKSTEMP=1
         ;;
     esac
+  else
+    HAVE_MKSTEMP=0
   fi
 
-  if test $HAVE_LINK = 0 || test $REPLACE_LINK = 1; then
+  if test $HAVE_MKSTEMP = 0 || test $REPLACE_MKSTEMP = 1; then
 
 
 
@@ -37542,7 +40960,9 @@ $as_echo "$gl_cv_func_link_works" >&6; }
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS link.$ac_objext"
+  M4_LIBOBJS="$M4_LIBOBJS mkstemp.$ac_objext"
+
+
 
   fi
 
@@ -37550,777 +40970,256 @@ $as_echo "$gl_cv_func_link_works" >&6; }
 
 
 
-    if test "$GNULIB_LINK" != 1; then
-        if test "$GNULIB_LINK" = 0; then
-      GNULIB_LINK=$gl_module_indicator_condition
-    else
-      GNULIB_LINK="($GNULIB_LINK || $gl_module_indicator_condition)"
-    fi
-  fi
 
 
 
 
+          GL_M4_GNULIB_MKSTEMP=1
 
-$as_echo "#define GNULIB_TEST_LINK 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_MKSTEMP 1" >>confdefs.h
 
 
 
-  for ac_func in setlocale uselocale
-do :
-  as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
 
-fi
-done
+  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
 
-      if test $ac_cv_func_uselocale = yes; then
-    for ac_func in getlocalename_l
-do :
-  ac_fn_c_check_func "$LINENO" "getlocalename_l" "ac_cv_func_getlocalename_l"
-if test "x$ac_cv_func_getlocalename_l" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_GETLOCALENAME_L 1
-_ACEOF
 
-fi
-done
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS msvc-inval.$ac_objext"
 
   fi
 
+  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
-$as_echo_n "checking for a traditional french locale... " >&6; }
-if ${gt_cv_locale_fr+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
-     one byte long. This excludes the UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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 Mac OS 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
-              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
-                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
-          ;;
-      esac
-    fi
-    rm -fr conftest*
+  M4_LIBOBJS="$M4_LIBOBJS msvc-nothrow.$ac_objext"
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
-$as_echo "$gt_cv_locale_fr" >&6; }
-  LOCALE_FR=$gt_cv_locale_fr
+  fi
 
 
+printf "%s\n" "#define GNULIB_MSVC_NOTHROW 1" >>confdefs.h
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
-$as_echo_n "checking for a french Unicode locale... " >&6; }
-if ${gt_cv_locale_fr_utf8+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main () {
-  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
-     imitates locale dependent behaviour by looking at the environment
-     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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
-# if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
-      return 1;
-  }
-# endif
-# ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-# endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
-     two bytes long, with UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 4
-      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
-    return 1;
-#endif
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
-$as_echo "$gt_cv_locale_fr_utf8" >&6; }
-  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
 
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
-$as_echo_n "checking for a traditional japanese locale... " >&6; }
-if ${gt_cv_locale_ja+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  if test $ac_cv_func_nl_langinfo = yes; then
+    # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether YESEXPR works" >&5
+printf %s "checking whether YESEXPR works... " >&6; }
+if test ${gl_cv_func_nl_langinfo_yesexpr_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+         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 $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include <langinfo.h>
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
-     on Cygwin 1.5.x.  */
-  if (MB_CUR_MAX == 1)
-    return 1;
-  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
+int
+main (void)
+{
+return !*nl_langinfo(YESEXPR);
+
+  ;
   return 0;
 }
-
 _ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows, 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 Mac OS 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
-              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
-                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
-                  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
-          ;;
-      esac
-    fi
-    rm -fr conftest*
-
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_nl_langinfo_yesexpr_works=yes
+else $as_nop
+  gl_cv_func_nl_langinfo_yesexpr_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
-$as_echo "$gt_cv_locale_ja" >&6; }
-  LOCALE_JA=$gt_cv_locale_ja
 
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nl_langinfo_yesexpr_works" >&5
+printf "%s\n" "$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
 
+printf "%s\n" "#define FUNC_NL_LANGINFO_YESEXPR_WORKS $FUNC_NL_LANGINFO_YESEXPR_WORKS" >>confdefs.h
 
+    # On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe.
+    case "$host_os" in
+      solaris*) NL_LANGINFO_MTSAFE=0 ;;
+      *)        NL_LANGINFO_MTSAFE=1 ;;
+    esac
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
-$as_echo_n "checking for a transitional chinese locale... " >&6; }
-if ${gt_cv_locale_zh_CN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+printf "%s\n" "#define NL_LANGINFO_MTSAFE $NL_LANGINFO_MTSAFE" >>confdefs.h
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+    if test $HAVE_LANGINFO_CODESET = 1 \
+       && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
+       && test $HAVE_LANGINFO_ALTMON = 1 \
+       && test $HAVE_LANGINFO_ERA = 1 \
+       && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \
+       && test $NL_LANGINFO_MTSAFE = 1; then
+      :
+    else
+      REPLACE_NL_LANGINFO=1
 
-#include <locale.h>
-#include <stdlib.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
-  /* Check whether a typical GB18030 multibyte sequence is recognized as a
-     single wide character.  This excludes the GB2312 and GBK encodings.  */
-  if (mblen ("\203\062\332\066", 5) != 4)
-    return 1;
-  return 0;
-}
+printf "%s\n" "#define REPLACE_NL_LANGINFO 1" >>confdefs.h
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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
-          ;;
-        solaris2.8)
-          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
-          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
-          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
-          gt_cv_locale_zh_CN=none
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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.
-      gt_cv_locale_zh_CN=none
     fi
-    rm -fr conftest*
+  else
+    HAVE_NL_LANGINFO=0
+  fi
+  if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then
+    LIB_NL_LANGINFO="$LIB_SETLOCALE_NULL"
+  else
+    LIB_NL_LANGINFO=
+  fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
-$as_echo "$gt_cv_locale_zh_CN" >&6; }
-  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
 
+  if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
-$as_echo_n "checking for a french Unicode locale... " >&6; }
-if ${gt_cv_locale_fr_utf8+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main () {
-  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
-     imitates locale dependent behaviour by looking at the environment
-     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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
-# if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
-      return 1;
-  }
-# endif
-# ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-# endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
-     two bytes long, with UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 4
-      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
-    return 1;
-#endif
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
-$as_echo "$gt_cv_locale_fr_utf8" >&6; }
-  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
 
+  M4_LIBOBJS="$M4_LIBOBJS nl_langinfo.$ac_objext"
 
+  fi
+  if test $REPLACE_NL_LANGINFO = 1 && test $NL_LANGINFO_MTSAFE = 0; then
 
 
 
-  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
-  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
-  # irrelevant for anonymous mappings.
-  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = xyes; then :
-  gl_have_mmap=yes
-else
-  gl_have_mmap=no
-fi
 
 
-  # Try to allow MAP_ANONYMOUS.
-  gl_have_mmap_anonymous=no
-  if test $gl_have_mmap = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
-$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS nl_langinfo-lock.$ac_objext"
+
+
+
+
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  if test -n "$GCC"; then
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
+printf %s "checking whether the -Werror option is usable... " >&6; }
+if test ${gl_cv_cc_vis_werror+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Werror"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <sys/mman.h>
-#ifdef MAP_ANONYMOUS
-    I cannot identify this map
-#endif
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
-  gl_have_mmap_anonymous=yes
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_cc_vis_werror=yes
+else $as_nop
+  gl_cv_cc_vis_werror=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+       CFLAGS="$gl_save_CFLAGS"
 
-    if test $gl_have_mmap_anonymous != yes; then
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
+printf "%s\n" "$gl_cv_cc_vis_werror" >&6; }
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
+printf %s "checking for simple visibility declarations... " >&6; }
+if test ${gl_cv_cc_visibility+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -fvisibility=hidden"
+                                          if test $gl_cv_cc_vis_werror = yes; then
+         CFLAGS="$CFLAGS -Werror"
+       fi
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+              extern __attribute__((__visibility__("default"))) int exportedvar;
+              extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+              extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+              void dummyfunc (void);
+              void dummyfunc (void) {}
 
-#include <sys/mman.h>
-#ifdef MAP_ANON
-    I cannot identify this map
-#endif
+int
+main (void)
+{
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
-
-$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
-
-         gl_have_mmap_anonymous=yes
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_cc_visibility=yes
+else $as_nop
+  gl_cv_cc_visibility=no
 fi
-rm -f conftest*
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+       CFLAGS="$gl_save_CFLAGS"
 
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
+printf "%s\n" "$gl_cv_cc_visibility" >&6; }
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
     fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
-$as_echo "$gl_have_mmap_anonymous" >&6; }
-    if test $gl_have_mmap_anonymous = yes; then
+  fi
+
+
+
+printf "%s\n" "#define HAVE_VISIBILITY $HAVE_VISIBILITY" >>confdefs.h
+
 
-$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
-    fi
   fi
 
 
@@ -38328,364 +41227,203 @@ $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
 
 
-  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
-  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
-  # irrelevant for anonymous mappings.
-  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = xyes; then :
-  gl_have_mmap=yes
-else
-  gl_have_mmap=no
-fi
 
 
-  # Try to allow MAP_ANONYMOUS.
-  gl_have_mmap_anonymous=no
-  if test $gl_have_mmap = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
-$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+          GL_M4_GNULIB_NL_LANGINFO=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_NL_LANGINFO 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for obstacks that work with any size object" >&5
+printf %s "checking for obstacks that work with any size object... " >&6; }
+if test ${ac_cv_func_obstack+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
+#include "obstack.h"
+             void *obstack_chunk_alloc (size_t n) { return 0; }
+             void obstack_chunk_free (void *p) { }
+             /* Check that an internal function returns size_t, not int.  */
+             size_t _obstack_memory_used (struct obstack *);
 
-#include <sys/mman.h>
-#ifdef MAP_ANONYMOUS
-    I cannot identify this map
-#endif
+int
+main (void)
+{
+struct obstack mem;
+             obstack_init (&mem);
+             obstack_free (&mem, 0);
 
+  ;
+  return 0;
+}
 _ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
-  gl_have_mmap_anonymous=yes
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_func_obstack=yes
+else $as_nop
+  ac_cv_func_obstack=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 fi
-rm -f conftest*
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_obstack" >&5
+printf "%s\n" "$ac_cv_func_obstack" >&6; }
+   if test "$ac_cv_func_obstack" = yes; then
 
-    if test $gl_have_mmap_anonymous != yes; then
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+printf "%s\n" "#define HAVE_OBSTACK 1" >>confdefs.h
 
-#include <sys/mman.h>
-#ifdef MAP_ANON
-    I cannot identify this map
-#endif
+   else
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
 
-$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
-         gl_have_mmap_anonymous=yes
-fi
-rm -f conftest*
 
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
-$as_echo "$gl_have_mmap_anonymous" >&6; }
-    if test $gl_have_mmap_anonymous = yes; then
 
-$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
-    fi
-  fi
 
 
+  M4_LIBOBJS="$M4_LIBOBJS obstack.$ac_objext"
 
+   fi
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
-$as_echo_n "checking for a traditional french locale... " >&6; }
-if ${gt_cv_locale_fr+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  case "$host_os" in
+    mingw* | pw*)
+      REPLACE_OPEN=1
+      ;;
+    *)
+
+      if test "$gl_cv_macro_O_CLOEXEC" != yes; then
+        REPLACE_OPEN=1
+      fi
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
+printf %s "checking whether open recognizes a trailing slash... " >&6; }
+if test ${gl_cv_func_open_slash+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  # Assume that if we have lstat, we can also check symlinks.
+     if test $ac_cv_func_lstat = yes; then
+       touch conftest.tmp
+       ln -s conftest.tmp conftest.lnk
+     fi
+     if test "$cross_compiling" = yes
+then :
+
+        case "$host_os" in
+          freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+            gl_cv_func_open_slash="guessing no" ;;
+          *)
+            gl_cv_func_open_slash="guessing yes" ;;
+        esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
 #endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
-     one byte long. This excludes the UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
+
+
+$gl_mda_defines
+
+int main ()
+{
+  int result = 0;
+#if HAVE_LSTAT
+  if (open ("conftest.lnk/", O_RDONLY) != -1)
+    result |= 1;
 #endif
-  return 0;
+  if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+    result |= 2;
+  return result;
 }
-
 _ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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 Mac OS 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
-              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
-                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
-          ;;
-      esac
-    fi
-    rm -fr conftest*
-
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_open_slash=yes
+else $as_nop
+  gl_cv_func_open_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
-$as_echo "$gt_cv_locale_fr" >&6; }
-  LOCALE_FR=$gt_cv_locale_fr
-
-
 
+     rm -f conftest.sl conftest.tmp conftest.lnk
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
-$as_echo_n "checking for a french Unicode locale... " >&6; }
-if ${gt_cv_locale_fr_utf8+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
+printf "%s\n" "$gl_cv_func_open_slash" >&6; }
+  case "$gl_cv_func_open_slash" in
+    *no)
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+printf "%s\n" "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main () {
-  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
-     imitates locale dependent behaviour by looking at the environment
-     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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
-# if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
-      return 1;
-  }
-# endif
-# ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-# endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
-     two bytes long, with UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 4
-      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
-    return 1;
-#endif
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
+      ;;
+  esac
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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
+      case "$gl_cv_func_open_slash" in
+        *no)
+          REPLACE_OPEN=1
           ;;
       esac
-    fi
-    rm -fr conftest*
+      ;;
+  esac
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
-$as_echo "$gt_cv_locale_fr_utf8" >&6; }
-  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+    if test $REPLACE_OPEN = 0; then
 
 
 
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
 
+      if test $HAVE_FCHDIR = 0; then
+        REPLACE_OPEN=1
+      fi
+    fi
 
-  for ac_func in opendir
-do :
-  ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
-if test "x$ac_cv_func_opendir" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_OPENDIR 1
-_ACEOF
 
-fi
-done
 
-  if test $ac_cv_func_opendir = no; then
-    HAVE_OPENDIR=0
-  fi
+  if test $REPLACE_OPEN = 1; then
 
-      case $host_os,$HAVE_OPENDIR in
-    os2*,1)
-      REPLACE_OPENDIR=1;;
-  esac
 
-  if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
 
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS open.$ac_objext"
+
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS opendir.$ac_objext"
+  :
 
   fi
 
 
 
 
-    if test "$GNULIB_OPENDIR" != 1; then
-        if test "$GNULIB_OPENDIR" = 0; then
-      GNULIB_OPENDIR=$gl_module_indicator_condition
-    else
-      GNULIB_OPENDIR="($GNULIB_OPENDIR || $gl_module_indicator_condition)"
-    fi
-  fi
 
 
 
 
+          GL_M4_GNULIB_OPEN=1
 
-$as_echo "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
 
 
 
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-[
-  #if defined _MSC_VER || defined __MINGW32__
-    notposix
-  #endif
-    ]
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "notposix" >/dev/null 2>&1; then :
-  posix_spawn_ported=no
-else
-  posix_spawn_ported=yes
-fi
-rm -f conftest*
 
-   if test $posix_spawn_ported = yes; then
-  POSIX_SPAWN_PORTED_TRUE=
-  POSIX_SPAWN_PORTED_FALSE='#'
-else
-  POSIX_SPAWN_PORTED_TRUE='#'
-  POSIX_SPAWN_PORTED_FALSE=
-fi
+printf "%s\n" "#define GNULIB_TEST_OPEN 1" >>confdefs.h
 
 
 
-     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5
-$as_echo_n "checking for putenv compatible with GNU and SVID... " >&6; }
-if ${gl_cv_func_svid_putenv+:} false; 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_svid_putenv="guessing yes" ;;
-                        # If we don't know, assume the worst.
-                *)      gl_cv_func_svid_putenv="guessing no" ;;
-              esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
 
-    /* Put it in env.  */
-    if (putenv ("CONFTEST_putenv=val"))
-      return 1;
 
-    /* Try to remove it.  */
-    if (putenv ("CONFTEST_putenv"))
-      return 2;
 
-    /* Make sure it was deleted.  */
-    if (getenv ("CONFTEST_putenv") != 0)
-      return 3;
 
-    return 0;
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_svid_putenv=yes
-else
-  gl_cv_func_svid_putenv=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+  case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
+  yes+*yes+yes)
+    ;;
+  yes+*)
+    # Solaris 10 lacks O_CLOEXEC.
+    # Solaris 9 has *at functions, but uniformly mishandles trailing
+    # slash in all of them.
+    REPLACE_OPENAT=1
+    ;;
+  *)
+    HAVE_OPENAT=0
+    ;;
+  esac
 
+  if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5
-$as_echo "$gl_cv_func_svid_putenv" >&6; }
-  case "$gl_cv_func_svid_putenv" in
-    *yes) ;;
-    *)
-      REPLACE_PUTENV=1
-      ;;
-  esac
 
-  if test $REPLACE_PUTENV = 1; then
 
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS openat.$ac_objext"
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS putenv.$ac_objext"
 
+  :
 
-  ac_fn_c_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default"
-if test "x$ac_cv_have_decl__putenv" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
+  fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL__PUTENV $ac_have_decl
-_ACEOF
 
+printf "%s\n" "#define GNULIB_OPENAT 1" >>confdefs.h
 
-  fi
 
 
 
 
 
-    if test "$GNULIB_PUTENV" != 1; then
-        if test "$GNULIB_PUTENV" = 0; then
-      GNULIB_PUTENV=$gl_module_indicator_condition
-    else
-      GNULIB_PUTENV="($GNULIB_PUTENV || $gl_module_indicator_condition)"
-    fi
-  fi
 
 
 
 
+          GL_M4_GNULIB_OPENAT=1
 
-$as_echo "#define GNULIB_TEST_PUTENV 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_OPENAT 1" >>confdefs.h
 
 
-  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
-  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
-  # irrelevant for anonymous mappings.
-  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = xyes; then :
-  gl_have_mmap=yes
-else
-  gl_have_mmap=no
-fi
 
 
-  # Try to allow MAP_ANONYMOUS.
-  gl_have_mmap_anonymous=no
-  if test $gl_have_mmap = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
-$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <sys/mman.h>
-#ifdef MAP_ANONYMOUS
-    I cannot identify this map
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
-  gl_have_mmap_anonymous=yes
+  ac_fn_c_check_func "$LINENO" "opendir" "ac_cv_func_opendir"
+if test "x$ac_cv_func_opendir" = xyes
+then :
+  printf "%s\n" "#define HAVE_OPENDIR 1" >>confdefs.h
+
 fi
-rm -f conftest*
 
-    if test $gl_have_mmap_anonymous != yes; then
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  if test $ac_cv_func_opendir = no; then
+    HAVE_OPENDIR=0
+  fi
 
-#include <sys/mman.h>
-#ifdef MAP_ANON
-    I cannot identify this map
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
 
-$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
-         gl_have_mmap_anonymous=yes
-fi
-rm -f conftest*
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
 
+    if test $HAVE_FCHDIR = 0; then
+      if test $HAVE_OPENDIR = 1; then
+        REPLACE_OPENDIR=1
+      fi
     fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
-$as_echo "$gl_have_mmap_anonymous" >&6; }
-    if test $gl_have_mmap_anonymous = yes; then
 
-$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
+      case $host_os,$HAVE_OPENDIR in
+    os2*,1)
+      REPLACE_OPENDIR=1;;
+  esac
 
-    fi
-  fi
+  if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
 
 
 
 
 
 
-  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
-  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
-  # irrelevant for anonymous mappings.
-  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = xyes; then :
-  gl_have_mmap=yes
-else
-  gl_have_mmap=no
-fi
 
 
-  # Try to allow MAP_ANONYMOUS.
-  gl_have_mmap_anonymous=no
-  if test $gl_have_mmap = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
-$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  M4_LIBOBJS="$M4_LIBOBJS opendir.$ac_objext"
 
-#include <sys/mman.h>
-#ifdef MAP_ANONYMOUS
-    I cannot identify this map
-#endif
+  fi
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
-  gl_have_mmap_anonymous=yes
-fi
-rm -f conftest*
 
-    if test $gl_have_mmap_anonymous != yes; then
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <sys/mman.h>
-#ifdef MAP_ANON
-    I cannot identify this map
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
 
-$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
-         gl_have_mmap_anonymous=yes
-fi
-rm -f conftest*
 
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
-$as_echo "$gl_have_mmap_anonymous" >&6; }
-    if test $gl_have_mmap_anonymous = yes; then
 
-$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
-    fi
-  fi
+          GL_M4_GNULIB_OPENDIR=1
 
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_OPENDIR 1" >>confdefs.h
 
-  for ac_func in readdir
-do :
-  ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
-if test "x$ac_cv_func_readdir" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_READDIR 1
-_ACEOF
 
-fi
-done
 
-  if test $ac_cv_func_readdir = no; then
-    HAVE_READDIR=0
+
+
+
+
+
+
+
+  if test $ac_cv_func_pipe != yes; then
+    HAVE_PIPE=0
   fi
 
-  if test $HAVE_READDIR = 0; then
+  if test $HAVE_PIPE = 0; then
 
 
 
@@ -38997,7 +41587,7 @@ done
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS readdir.$ac_objext"
+  M4_LIBOBJS="$M4_LIBOBJS pipe.$ac_objext"
 
   fi
 
@@ -39005,92 +41595,30 @@ done
 
 
 
-    if test "$GNULIB_READDIR" != 1; then
-        if test "$GNULIB_READDIR" = 0; then
-      GNULIB_READDIR=$gl_module_indicator_condition
-    else
-      GNULIB_READDIR="($GNULIB_READDIR || $gl_module_indicator_condition)"
-    fi
-  fi
 
 
 
 
+          GL_M4_GNULIB_PIPE=1
 
-$as_echo "#define GNULIB_TEST_READDIR 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_PIPE 1" >>confdefs.h
 
-     if test $ac_cv_func_setenv = no; then
-    HAVE_SETENV=0
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
-$as_echo_n "checking whether setenv validates arguments... " >&6; }
-if ${gl_cv_func_setenv_works+:} false; 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_setenv_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_setenv_works="guessing no" ;;
-       esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-       #include <stdlib.h>
-       #include <errno.h>
-       #include <string.h>
 
-int
-main ()
-{
 
-       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;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_setenv_works=yes
-else
-  gl_cv_func_setenv_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
-$as_echo "$gl_cv_func_setenv_works" >&6; }
-    case "$gl_cv_func_setenv_works" in
-      *yes) ;;
-      *)
-        REPLACE_SETENV=1
-        ;;
-    esac
+
+
+  if test $ac_cv_func_pipe2 != yes; then
+    HAVE_PIPE2=0
   fi
 
-  if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
 
 
 
@@ -39099,703 +41627,223 @@ $as_echo "$gl_cv_func_setenv_works" >&6; }
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS setenv.$ac_objext"
 
-  fi
+          GL_M4_GNULIB_PIPE2=1
 
 
 
 
 
-    if test "$GNULIB_SETENV" != 1; then
-        if test "$GNULIB_SETENV" = 0; then
-      GNULIB_SETENV=$gl_module_indicator_condition
-    else
-      GNULIB_SETENV="($GNULIB_SETENV || $gl_module_indicator_condition)"
-    fi
-  fi
+printf "%s\n" "#define GNULIB_TEST_PIPE2 1" >>confdefs.h
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_SETENV 1" >>confdefs.h
+printf "%s\n" "#define GNULIB_PIPE2_SAFER 1" >>confdefs.h
 
 
 
 
 
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
-  case "$host_os" in
-            mingw*) REPLACE_SETLOCALE=1 ;;
-            cygwin*)
-      case `uname -r` in
-        1.5.*) REPLACE_SETLOCALE=1 ;;
-      esac
-      ;;
-  esac
 
-  if test $REPLACE_SETLOCALE = 1; then
 
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS spawn.$ac_objext"
 
+  fi
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS setlocale.$ac_objext"
 
 
-  :
 
-  fi
 
 
 
 
 
-    if test "$GNULIB_SETLOCALE" != 1; then
-        if test "$GNULIB_SETLOCALE" = 0; then
-      GNULIB_SETLOCALE=$gl_module_indicator_condition
-    else
-      GNULIB_SETLOCALE="($GNULIB_SETLOCALE || $gl_module_indicator_condition)"
-    fi
-  fi
+          GL_M4_GNULIB_POSIX_SPAWN=1
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_SETLOCALE 1" >>confdefs.h
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWN 1" >>confdefs.h
 
 
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
-$as_echo_n "checking for a traditional french locale... " >&6; }
-if ${gt_cv_locale_fr+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
-     one byte long. This excludes the UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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 Mac OS 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
-              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
-                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
-          ;;
-      esac
-    fi
-    rm -fr conftest*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
-$as_echo "$gt_cv_locale_fr" >&6; }
-  LOCALE_FR=$gt_cv_locale_fr
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
-$as_echo_n "checking for a french Unicode locale... " >&6; }
-if ${gt_cv_locale_fr_utf8+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  M4_LIBOBJS="$M4_LIBOBJS spawni.$ac_objext"
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main () {
-  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
-     imitates locale dependent behaviour by looking at the environment
-     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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
-# if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
-      return 1;
-  }
-# endif
-# ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-# endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
-     two bytes long, with UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 4
-      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
-    return 1;
-#endif
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
+  ac_fn_c_check_header_compile "$LINENO" "paths.h" "ac_cv_header_paths_h" "$ac_includes_default"
+if test "x$ac_cv_header_paths_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_PATHS_H 1" >>confdefs.h
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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*
+fi
+
+  ac_fn_c_check_func "$LINENO" "confstr" "ac_cv_func_confstr"
+if test "x$ac_cv_func_confstr" = xyes
+then :
+  printf "%s\n" "#define HAVE_CONFSTR 1" >>confdefs.h
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
-$as_echo "$gt_cv_locale_fr_utf8" >&6; }
-  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+ac_fn_c_check_func "$LINENO" "sched_setparam" "ac_cv_func_sched_setparam"
+if test "x$ac_cv_func_sched_setparam" = xyes
+then :
+  printf "%s\n" "#define HAVE_SCHED_SETPARAM 1" >>confdefs.h
 
+fi
+ac_fn_c_check_func "$LINENO" "sched_setscheduler" "ac_cv_func_sched_setscheduler"
+if test "x$ac_cv_func_sched_setscheduler" = xyes
+then :
+  printf "%s\n" "#define HAVE_SCHED_SETSCHEDULER 1" >>confdefs.h
 
+fi
+ac_fn_c_check_func "$LINENO" "setegid" "ac_cv_func_setegid"
+if test "x$ac_cv_func_setegid" = xyes
+then :
+  printf "%s\n" "#define HAVE_SETEGID 1" >>confdefs.h
 
+fi
+ac_fn_c_check_func "$LINENO" "seteuid" "ac_cv_func_seteuid"
+if test "x$ac_cv_func_seteuid" = xyes
+then :
+  printf "%s\n" "#define HAVE_SETEUID 1" >>confdefs.h
 
+fi
+ac_fn_c_check_func "$LINENO" "vfork" "ac_cv_func_vfork"
+if test "x$ac_cv_func_vfork" = xyes
+then :
+  printf "%s\n" "#define HAVE_VFORK 1" >>confdefs.h
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
-$as_echo_n "checking for a traditional japanese locale... " >&6; }
-if ${gt_cv_locale_ja+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+fi
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
-     on Cygwin 1.5.x.  */
-  if (MB_CUR_MAX == 1)
-    return 1;
-  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
-  return 0;
-}
+  fi
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows, 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 Mac OS 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
-              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
-                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
-                  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
-          ;;
-      esac
-    fi
-    rm -fr conftest*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
-$as_echo "$gt_cv_locale_ja" >&6; }
-  LOCALE_JA=$gt_cv_locale_ja
 
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
-$as_echo_n "checking for a transitional chinese locale... " >&6; }
-if ${gt_cv_locale_zh_CN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+  if test $ac_cv_func_posix_spawn_file_actions_addchdir = yes; then
+            REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=1
+  else
+    HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0
+  fi
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = 1; then
 
-#include <locale.h>
-#include <stdlib.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
-  /* Check whether a typical GB18030 multibyte sequence is recognized as a
-     single wide character.  This excludes the GB2312 and GBK encodings.  */
-  if (mblen ("\203\062\332\066", 5) != 4)
-    return 1;
-  return 0;
-}
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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
-          ;;
-        solaris2.8)
-          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
-          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
-          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
-          gt_cv_locale_zh_CN=none
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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.
-      gt_cv_locale_zh_CN=none
-    fi
-    rm -fr conftest*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
-$as_echo "$gt_cv_locale_zh_CN" >&6; }
-  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_addchdir.$ac_objext"
 
+  fi
 
-               ac_fn_c_check_decl "$LINENO" "sleep" "ac_cv_have_decl_sleep" "#include <unistd.h>
-"
-if test "x$ac_cv_have_decl_sleep" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_SLEEP $ac_have_decl
-_ACEOF
 
 
-  if test $ac_cv_have_decl_sleep != yes; then
-    HAVE_SLEEP=0
+
+
+
+
+
+          GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+  if test $REPLACE_POSIX_SPAWN = 1; then
+    REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1
   else
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working sleep" >&5
-$as_echo_n "checking for working sleep... " >&6; }
-if ${gl_cv_func_sleep_works+:} false; 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_sleep_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_sleep_works="guessing no" ;;
-       esac
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn_file_actions_addclose works" >&5
+printf %s "checking whether posix_spawn_file_actions_addclose works... " >&6; }
+if test ${gl_cv_func_posix_spawn_file_actions_addclose_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  # Guess no on musl libc and Solaris, yes otherwise.
+          case "$host_os" in
+            *-musl*)  gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;;
+            solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;;
+                      # Guess no on native Windows.
+            mingw*)   gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;;
+            *)        gl_cv_func_posix_spawn_file_actions_addclose_works="guessing yes" ;;
+          esac
 
-else
+else $as_nop
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <errno.h>
-#include <unistd.h>
-#include <signal.h>
-static void
-handle_alarm (int sig)
+#include <spawn.h>
+int main ()
 {
-  if (sig != SIGALRM)
-    _exit (2);
-}
-
-int
-main ()
-{
-
-    /* Failure to compile this test due to missing alarm is okay,
-       since all such platforms (mingw) also lack sleep.  */
-    unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days.  */
-    unsigned int remaining;
-    signal (SIGALRM, handle_alarm);
-    alarm (1);
-    remaining = sleep (pentecost);
-    if (remaining > pentecost)
-      return 3;
-    if (remaining <= pentecost - 10)
-      return 4;
-    return 0;
-
-  ;
+  posix_spawn_file_actions_t actions;
+  if (posix_spawn_file_actions_init (&actions) != 0)
+    return 1;
+  if (posix_spawn_file_actions_addclose (&actions, -5) == 0)
+    return 2;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_sleep_works=yes
-else
-  gl_cv_func_sleep_works=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_posix_spawn_file_actions_addclose_works=yes
+else $as_nop
+  gl_cv_func_posix_spawn_file_actions_addclose_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_sleep_works" >&5
-$as_echo "$gl_cv_func_sleep_works" >&6; }
-    case "$gl_cv_func_sleep_works" in
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_file_actions_addclose_works" >&5
+printf "%s\n" "$gl_cv_func_posix_spawn_file_actions_addclose_works" >&6; }
+    case "$gl_cv_func_posix_spawn_file_actions_addclose_works" in
       *yes) ;;
-      *)
-        REPLACE_SLEEP=1
-        ;;
+      *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1 ;;
     esac
   fi
 
-  if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = 1; then
 
 
 
@@ -39804,7 +41852,7 @@ $as_echo "$gl_cv_func_sleep_works" >&6; }
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS sleep.$ac_objext"
+  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_addclose.$ac_objext"
 
   fi
 
@@ -39812,93 +41860,83 @@ $as_echo "$gl_cv_func_sleep_works" >&6; }
 
 
 
-    if test "$GNULIB_SLEEP" != 1; then
-        if test "$GNULIB_SLEEP" = 0; then
-      GNULIB_SLEEP=$gl_module_indicator_condition
-    else
-      GNULIB_SLEEP="($GNULIB_SLEEP || $gl_module_indicator_condition)"
-    fi
-  fi
 
 
 
 
+          GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1
 
-$as_echo "#define GNULIB_TEST_SLEEP 1" >>confdefs.h
 
 
 
 
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE 1" >>confdefs.h
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
-$as_echo_n "checking for working stdalign.h... " >&6; }
-if ${gl_cv_header_working_stdalign_h+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdalign.h>
-            #include <stddef.h>
 
-            /* Test that alignof yields a result consistent with offsetof.
-               This catches GCC bug 52023
-               <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.  */
-            #ifdef __cplusplus
-               template <class t> struct alignof_helper { char a; t b; };
-            # define ao(type) offsetof (alignof_helper<type>, b)
-            #else
-            # define ao(type) offsetof (struct { char a; type b; }, b)
-            #endif
-            char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
-            char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
-            char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
 
-            /* Test _Alignas only on platforms where gnulib can help.  */
-            #if \
-                ((defined __cplusplus && 201103 <= __cplusplus) \
-                 || (defined __APPLE__ && defined __MACH__ \
-                     ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
-                     : __GNUC__) \
-                 || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
-                 || __ICC || 0x5110 <= __SUNPRO_C \
-                 || 1300 <= _MSC_VER)
-              struct alignas_test { char c; char alignas (8) alignas_8; };
-              char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
-                                ? 1 : -1];
-            #endif
 
-int
-main ()
-{
 
-  ;
+
+
+
+
+  if test $REPLACE_POSIX_SPAWN = 1; then
+    REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1
+  else
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn_file_actions_adddup2 works" >&5
+printf %s "checking whether posix_spawn_file_actions_adddup2 works... " >&6; }
+if test ${gl_cv_func_posix_spawn_file_actions_adddup2_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  # Guess no on musl libc and Solaris, yes otherwise.
+          case "$host_os" in
+            *-musl*)  gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";;
+            solaris*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";;
+                      # Guess no on native Windows.
+            mingw*)   gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no" ;;
+            *)        gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing yes";;
+          esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <spawn.h>
+int main ()
+{
+  posix_spawn_file_actions_t actions;
+  if (posix_spawn_file_actions_init (&actions) != 0)
+    return 1;
+  if (posix_spawn_file_actions_adddup2 (&actions, 10000000, 2) == 0)
+    return 2;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gl_cv_header_working_stdalign_h=yes
-else
-  gl_cv_header_working_stdalign_h=no
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_posix_spawn_file_actions_adddup2_works=yes
+else $as_nop
+  gl_cv_func_posix_spawn_file_actions_adddup2_works=no
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
-$as_echo "$gl_cv_header_working_stdalign_h" >&6; }
 
-  if test $gl_cv_header_working_stdalign_h = yes; then
-    STDALIGN_H=''
-  else
-    STDALIGN_H='stdalign.h'
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_file_actions_adddup2_works" >&5
+printf "%s\n" "$gl_cv_func_posix_spawn_file_actions_adddup2_works" >&6; }
+    case "$gl_cv_func_posix_spawn_file_actions_adddup2_works" in
+      *yes) ;;
+      *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1 ;;
+    esac
   fi
 
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = 1; then
 
-   if test -n "$STDALIGN_H"; then
-  GL_GENERATE_STDALIGN_H_TRUE=
-  GL_GENERATE_STDALIGN_H_FALSE='#'
-else
-  GL_GENERATE_STDALIGN_H_TRUE='#'
-  GL_GENERATE_STDALIGN_H_FALSE=
-fi
 
 
 
 
 
 
+  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_adddup2.$ac_objext"
 
-  if test $ac_cv_func_strdup = yes; then
-    if test $gl_cv_func_malloc_posix != yes; then
-      REPLACE_STRDUP=1
-    fi
   fi
 
-  if test $ac_cv_have_decl_strdup = no; then
-    HAVE_DECL_STRDUP=0
-  fi
 
-  if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
 
 
 
 
 
 
+          GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS strdup.$ac_objext"
 
-    :
-  fi
 
 
 
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 1" >>confdefs.h
 
 
-    if test "$GNULIB_STRDUP" != 1; then
-        if test "$GNULIB_STRDUP" = 0; then
-      GNULIB_STRDUP=$gl_module_indicator_condition
-    else
-      GNULIB_STRDUP="($GNULIB_STRDUP || $gl_module_indicator_condition)"
-    fi
-  fi
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
 
 
+  if test $REPLACE_POSIX_SPAWN = 1; then
+    REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1
+  else
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether posix_spawn_file_actions_addopen works" >&5
+printf %s "checking whether posix_spawn_file_actions_addopen works... " >&6; }
+if test ${gl_cv_func_posix_spawn_file_actions_addopen_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  # Guess no on musl libc and Solaris, yes otherwise.
+          case "$host_os" in
+            *-musl*)  gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";;
+            solaris*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";;
+                      # Guess no on native Windows.
+            mingw*)   gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no" ;;
+            *)        gl_cv_func_posix_spawn_file_actions_addopen_works="guessing yes";;
+          esac
 
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+#include <spawn.h>
+#include <fcntl.h>
+int main ()
+{
+  posix_spawn_file_actions_t actions;
+  if (posix_spawn_file_actions_init (&actions) != 0)
+    return 1;
+  if (posix_spawn_file_actions_addopen (&actions, 10000000, "foo", 0, O_RDONLY)
+      == 0)
+    return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_posix_spawn_file_actions_addopen_works=yes
+else $as_nop
+  gl_cv_func_posix_spawn_file_actions_addopen_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
 
-  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
-  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
-  # irrelevant for anonymous mappings.
-  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = xyes; then :
-  gl_have_mmap=yes
-else
-  gl_have_mmap=no
 fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_posix_spawn_file_actions_addopen_works" >&5
+printf "%s\n" "$gl_cv_func_posix_spawn_file_actions_addopen_works" >&6; }
+    case "$gl_cv_func_posix_spawn_file_actions_addopen_works" in
+      *yes) ;;
+      *) REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1 ;;
+    esac
+  fi
 
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = 1; then
 
-  # Try to allow MAP_ANONYMOUS.
-  gl_have_mmap_anonymous=no
-  if test $gl_have_mmap = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
-$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <sys/mman.h>
-#ifdef MAP_ANONYMOUS
-    I cannot identify this map
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
-  gl_have_mmap_anonymous=yes
-fi
-rm -f conftest*
 
-    if test $gl_have_mmap_anonymous != yes; then
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <sys/mman.h>
-#ifdef MAP_ANON
-    I cannot identify this map
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
 
-$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
-         gl_have_mmap_anonymous=yes
-fi
-rm -f conftest*
+  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_addopen.$ac_objext"
 
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
-$as_echo "$gl_have_mmap_anonymous" >&6; }
-    if test $gl_have_mmap_anonymous = yes; then
+  fi
 
-$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
-    fi
-  fi
 
 
 
@@ -40020,64 +42050,30 @@ $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
 
 
-  # Check for mmap(). Don't use AC_FUNC_MMAP, because it checks too much: it
-  # fails on HP-UX 11, because MAP_FIXED mappings do not work. But this is
-  # irrelevant for anonymous mappings.
-  ac_fn_c_check_func "$LINENO" "mmap" "ac_cv_func_mmap"
-if test "x$ac_cv_func_mmap" = xyes; then :
-  gl_have_mmap=yes
-else
-  gl_have_mmap=no
-fi
+          GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1
 
 
-  # Try to allow MAP_ANONYMOUS.
-  gl_have_mmap_anonymous=no
-  if test $gl_have_mmap = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAP_ANONYMOUS" >&5
-$as_echo_n "checking for MAP_ANONYMOUS... " >&6; }
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <sys/mman.h>
-#ifdef MAP_ANONYMOUS
-    I cannot identify this map
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
-  gl_have_mmap_anonymous=yes
-fi
-rm -f conftest*
 
-    if test $gl_have_mmap_anonymous != yes; then
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN 1" >>confdefs.h
 
-#include <sys/mman.h>
-#ifdef MAP_ANON
-    I cannot identify this map
-#endif
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "I cannot identify this map" >/dev/null 2>&1; then :
 
-$as_echo "#define MAP_ANONYMOUS MAP_ANON" >>confdefs.h
 
-         gl_have_mmap_anonymous=yes
-fi
-rm -f conftest*
 
-    fi
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_have_mmap_anonymous" >&5
-$as_echo "$gl_have_mmap_anonymous" >&6; }
-    if test $gl_have_mmap_anonymous = yes; then
 
-$as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_destroy.$ac_objext"
 
-    fi
   fi
 
 
@@ -40085,225 +42081,69 @@ $as_echo "#define HAVE_MAP_ANONYMOUS 1" >>confdefs.h
 
 
 
-        if test $ac_cv_func_symlink = no; then
-    HAVE_SYMLINK=0
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5
-$as_echo_n "checking whether symlink handles trailing slash correctly... " >&6; }
-if ${gl_cv_func_symlink_works+:} false; 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_symlink_works="guessing yes" ;;
-                    # If we don't know, assume the worst.
-            *)      gl_cv_func_symlink_works="guessing no" ;;
-          esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <unistd.h>
 
-int
-main ()
-{
-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;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_symlink_works=yes
-else
-  gl_cv_func_symlink_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
+          GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=1
 
-      rm -f conftest.f conftest.link conftest.lnk2
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5
-$as_echo "$gl_cv_func_symlink_works" >&6; }
-    case "$gl_cv_func_symlink_works" in
-      *yes) ;;
-      *)
-        REPLACE_SYMLINK=1
-        ;;
-    esac
-  fi
 
-  if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
 
 
 
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_DESTROY 1" >>confdefs.h
 
 
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS symlink.$ac_objext"
 
-  fi
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
 
 
 
 
-    if test "$GNULIB_SYMLINK" != 1; then
-        if test "$GNULIB_SYMLINK" = 0; then
-      GNULIB_SYMLINK=$gl_module_indicator_condition
-    else
-      GNULIB_SYMLINK="($GNULIB_SYMLINK || $gl_module_indicator_condition)"
-    fi
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS spawn_faction_init.$ac_objext"
+
   fi
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_SYMLINK 1" >>confdefs.h
 
 
 
 
+          GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=1
 
 
-  if test $ac_cv_have_decl_unsetenv = no; then
-    HAVE_DECL_UNSETENV=0
-  fi
-  for ac_func in unsetenv
-do :
-  ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
-if test "x$ac_cv_func_unsetenv" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_UNSETENV 1
-_ACEOF
 
-fi
-done
 
-  if test $ac_cv_func_unsetenv = no; then
-    HAVE_UNSETENV=0
-  else
-    HAVE_UNSETENV=1
-        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
-$as_echo_n "checking for unsetenv() return type... " >&6; }
-if ${gt_cv_func_unsetenv_ret+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#undef _BSD
-#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
-#include <stdlib.h>
-extern
-#ifdef __cplusplus
-"C"
-#endif
-int unsetenv (const char *name);
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_INIT 1" >>confdefs.h
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  gt_cv_func_unsetenv_ret='int'
-else
-  gt_cv_func_unsetenv_ret='void'
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
-$as_echo "$gt_cv_func_unsetenv_ret" >&6; }
-    if test $gt_cv_func_unsetenv_ret = 'void'; then
 
-$as_echo "#define VOID_UNSETENV 1" >>confdefs.h
 
-      REPLACE_UNSETENV=1
-    fi
 
-                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
-$as_echo_n "checking whether unsetenv obeys POSIX... " >&6; }
-if ${gl_cv_func_unsetenv_works+:} false; 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_unsetenv_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_unsetenv_works="guessing no" ;;
-       esac
 
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
-       #include <stdlib.h>
-       #include <errno.h>
-       extern char **environ;
 
-int
-main ()
-{
 
-       char entry1[] = "a=1";
-       char entry2[] = "b=2";
-       char *env[] = { entry1, entry2, NULL };
-       if (putenv ((char *) "a=1")) return 1;
-       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;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_unsetenv_works=yes
-else
-  gl_cv_func_unsetenv_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
-$as_echo "$gl_cv_func_unsetenv_works" >&6; }
-    case "$gl_cv_func_unsetenv_works" in
-      *yes) ;;
-      *)
-        REPLACE_UNSETENV=1
-        ;;
-    esac
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS spawnattr_destroy.$ac_objext"
+
   fi
 
-  if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
 
 
 
@@ -40312,523 +42152,17097 @@ $as_echo "$gl_cv_func_unsetenv_works" >&6; }
 
 
 
-  M4tests_LIBOBJS="$M4tests_LIBOBJS unsetenv.$ac_objext"
+          GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY=1
 
 
 
 
 
-  fi
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWNATTR_DESTROY 1" >>confdefs.h
 
 
 
 
 
-    if test "$GNULIB_UNSETENV" != 1; then
-        if test "$GNULIB_UNSETENV" = 0; then
-      GNULIB_UNSETENV=$gl_module_indicator_condition
-    else
-      GNULIB_UNSETENV="($GNULIB_UNSETENV || $gl_module_indicator_condition)"
-    fi
+
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS spawnattr_init.$ac_objext"
+
   fi
 
 
 
 
 
-$as_echo "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
 
 
 
-  abs_aux_dir=`cd "$ac_aux_dir"; pwd`
 
+          GL_M4_GNULIB_POSIX_SPAWNATTR_INIT=1
 
-  abs_aux_dir=`cd "$ac_aux_dir"; pwd`
 
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
-$as_echo_n "checking for a traditional french locale... " >&6; }
-if ${gt_cv_locale_fr+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWNATTR_INIT 1" >>confdefs.h
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
-     one byte long. This excludes the UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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 Mac OS 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
-              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
-                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
-          ;;
-      esac
-    fi
-    rm -fr conftest*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
-$as_echo "$gt_cv_locale_fr" >&6; }
-  LOCALE_FR=$gt_cv_locale_fr
 
 
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
-$as_echo_n "checking for a french Unicode locale... " >&6; }
-if ${gt_cv_locale_fr_utf8+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main () {
-  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
-     imitates locale dependent behaviour by looking at the environment
-     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 Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.  */
-# if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
-      return 1;
-  }
-# endif
-# ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-# endif
-  /* Check whether in the abbreviation of the second month, the second
-     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
-     two bytes long, with UTF-8 encoding.  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%b", &t) < 4
-      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
-    return 1;
-#endif
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
-  /* Check whether the decimal separator is a comma.
-     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
-     are nl_langinfo(RADIXCHAR) are both ".".  */
-  if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
-  return 0;
-}
 
-_ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows 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
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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*
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
-$as_echo "$gt_cv_locale_fr_utf8" >&6; }
-  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
 
 
+  M4_LIBOBJS="$M4_LIBOBJS spawnattr_setflags.$ac_objext"
+
+  fi
+
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
-$as_echo_n "checking for a traditional japanese locale... " >&6; }
-if ${gt_cv_locale_ja+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+
+
+
+
+          GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWNATTR_SETFLAGS 1" >>confdefs.h
+
+
+
+
+
+
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS spawnattr_setpgroup.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWNATTR_SETPGROUP 1" >>confdefs.h
+
+
+
+
+
+
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS spawnattr_setsigmask.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWNATTR_SETSIGMASK 1" >>confdefs.h
+
+
+
+
+
+
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS spawnp.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_POSIX_SPAWNP=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_POSIX_SPAWNP 1" >>confdefs.h
+
+
+
+
+
+  if test $gl_cv_func_frexp_no_libm = yes; then
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether frexp works" >&5
+printf %s "checking whether frexp works... " >&6; }
+if test ${gl_cv_func_frexp_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+           netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
+           mingw*) # Guess yes with MSVC, no with mingw.
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <locale.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
+#ifdef _MSC_VER
+ Good
 #endif
-#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Good" >/dev/null 2>&1
+then :
+  gl_cv_func_frexp_works="guessing yes"
+else $as_nop
+  gl_cv_func_frexp_works="guessing no"
+fi
+rm -rf conftest*
+
+             ;;
+           *) gl_cv_func_frexp_works="guessing yes" ;;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <float.h>
+#include <math.h>
 #include <string.h>
-struct tm t;
-char buf[16];
-int main ()
+#if HAVE_DECL_ALARM
+# include <signal.h>
+# include <unistd.h>
+#endif
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
+   ICC 10.0 has a bug when optimizing the expression -zero.
+   The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
+   to PowerPC on Mac OS X 10.5.  */
+#if defined __hpux || defined __sgi || defined __ICC
+static double
+compute_minus_zero (void)
 {
-  const char *p;
-  /* Check whether the given locale name is recognized by the system.  */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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;
+  return -DBL_MIN * DBL_MIN;
+}
+# define minus_zero compute_minus_zero ()
 #else
-  if (setlocale (LC_ALL, "") == NULL) return 1;
+double minus_zero = -0.0;
 #endif
-  /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
-     On Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
+int main()
+{
+  int result = 0;
+  int i;
+  volatile double x;
+  double zero = 0.0;
+#if HAVE_DECL_ALARM
+  /* NeXTstep 3.3 frexp() runs into an endless loop when called on an infinite
+     number.  Let the test fail in this case.  */
+  signal (SIGALRM, SIG_DFL);
+  alarm (5);
+#endif
+  /* Test on denormalized numbers.  */
+  for (i = 1, x = 1.0; i >= DBL_MIN_EXP; i--, x *= 0.5)
+    ;
+  if (x > 0.0)
+    {
+      int exp;
+      double y = frexp (x, &exp);
+      /* On machines with IEEE754 arithmetic: x = 1.11254e-308, exp = -1022.
+         On NetBSD: y = 0.75. Correct: y = 0.5.  */
+      if (y != 0.5)
+        result |= 1;
+    }
+  /* Test on infinite numbers.  */
+  x = 1.0 / zero;
   {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
+    int exp;
+    double y = frexp (x, &exp);
+    if (y != x)
+      result |= 2;
   }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
-     on Cygwin 1.5.x.  */
-  if (MB_CUR_MAX == 1)
-    return 1;
-  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
-  return 0;
+  /* Test on negative zero.  */
+  x = minus_zero;
+  {
+    int exp;
+    double y = frexp (x, &exp);
+    if (memcmp (&y, &x, sizeof x))
+      result |= 4;
+  }
+  return result;
 }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_frexp_works=yes
+else $as_nop
+  gl_cv_func_frexp_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexp_works" >&5
+printf "%s\n" "$gl_cv_func_frexp_works" >&6; }
+
+    case "$gl_cv_func_frexp_works" in
+      *yes)
+
+printf "%s\n" "#define HAVE_FREXP_IN_LIBC 1" >>confdefs.h
+
+        ;;
+    esac
+  fi
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ldexp can be used without linking with libm" >&5
+printf %s "checking whether ldexp can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_ldexp_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
 
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             double x;
+             int y;
+int
+main (void)
+{
+return ldexp (x, y) < 1;
+  ;
+  return 0;
+}
 _ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      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 Windows, 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 Mac OS 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
-              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
-                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
-                  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
-          ;;
-      esac
-    fi
-    rm -fr conftest*
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_ldexp_no_libm=yes
+else $as_nop
+  gl_cv_func_ldexp_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
-$as_echo "$gt_cv_locale_ja" >&6; }
-  LOCALE_JA=$gt_cv_locale_ja
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexp_no_libm" >&5
+printf "%s\n" "$gl_cv_func_ldexp_no_libm" >&6; }
+  if test $gl_cv_func_ldexp_no_libm = yes; then
 
+printf "%s\n" "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h
 
+  fi
 
 
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
-$as_echo_n "checking for a transitional chinese locale... " >&6; }
-if ${gt_cv_locale_zh_CN+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-#include <locale.h>
-#include <stdlib.h>
-#include <time.h>
-#if HAVE_LANGINFO_CODESET
-# include <langinfo.h>
-#endif
-#include <stdlib.h>
-#include <string.h>
-struct tm t;
-char buf[16];
-int main ()
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether frexpl() can be used without linking with libm" >&5
+printf %s "checking whether frexpl() can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_frexpl_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             long double x;
+int
+main (void)
 {
-  const char *p;
-  /* Check whether the given locale name is recognized by the system.  */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-  /* On native Windows, setlocale(category, "") looks at the system settings,
-     not at the environment variables.  Also, when an encoding suffix such
-     as ".65001" or ".54936" is specified, 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 Mac OS 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.
-     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
-     some unit tests fail.
-     On MirBSD 10, when an unsupported locale is specified, setlocale()
-     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
-  {
-    const char *cs = nl_langinfo (CODESET);
-    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
-        || strcmp (cs, "UTF-8") == 0)
-      return 1;
-  }
-#endif
-#ifdef __CYGWIN__
-  /* On Cygwin, avoid locale names without encoding suffix, because the
-     locale_charset() function relies on the encoding suffix.  Note that
-     LC_ALL is set on the command line.  */
-  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
-  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
-     This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
-  /* Check whether a typical GB18030 multibyte sequence is recognized as a
-     single wide character.  This excludes the GB2312 and GBK encodings.  */
-  if (mblen ("\203\062\332\066", 5) != 4)
-    return 1;
+int e; return frexpl (x, &e) > 0;
+  ;
   return 0;
 }
-
 _ACEOF
-    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
-  (eval $ac_link) 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; } && test -s conftest$ac_exeext; then
-      case "$host_os" in
-        # Handle native Windows specially, because there setlocale() interprets
-        # "ar" as "Arabic" or "Arabic_Saudi Arabia.1256",
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_frexpl_no_libm=yes
+else $as_nop
+  gl_cv_func_frexpl_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_no_libm" >&5
+printf "%s\n" "$gl_cv_func_frexpl_no_libm" >&6; }
+
+  if test $gl_cv_func_frexpl_no_libm = yes; then
+
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether frexpl works" >&5
+printf %s "checking whether frexpl works... " >&6; }
+if test ${gl_cv_func_frexpl_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+         case "$host_os" in
+           aix | aix[3-6]* | beos* | darwin* | irix* | mingw* | pw*)
+              gl_cv_func_frexpl_works="guessing no";;
+           *) gl_cv_func_frexpl_works="guessing yes";;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <float.h>
+#include <math.h>
+/* Override the values of <float.h>, like done in float.in.h.  */
+#if defined __i386__ && (defined __BEOS__ || defined __OpenBSD__)
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+#endif
+#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP    (-16381)
+#endif
+#if (defined _ARCH_PPC || defined _POWER) && defined _AIX && (LDBL_MANT_DIG == 106) && defined __GNUC__
+# undef LDBL_MIN_EXP
+# define LDBL_MIN_EXP DBL_MIN_EXP
+#endif
+#if defined __sgi && (LDBL_MANT_DIG >= 106)
+# if defined __GNUC__
+#  undef LDBL_MIN_EXP
+#  define LDBL_MIN_EXP DBL_MIN_EXP
+# endif
+#endif
+extern
+#ifdef __cplusplus
+"C"
+#endif
+long double frexpl (long double, int *);
+long double zero = 0.0L;
+int main()
+{
+  int result = 0;
+  volatile long double x;
+  /* Test on finite numbers that fails on AIX 5.1.  */
+  x = 16.0L;
+  {
+    int exp = -9999;
+    frexpl (x, &exp);
+    if (exp != 5)
+      result |= 1;
+  }
+  /* Test on finite numbers that fails on Mac OS X 10.4, because its frexpl
+     function returns an invalid (incorrectly normalized) value: it returns
+               y = { 0x3fe028f5, 0xc28f5c28, 0x3c9eb851, 0xeb851eb8 }
+     but the correct result is
+          0.505L = { 0x3fe028f5, 0xc28f5c29, 0xbc547ae1, 0x47ae1480 }  */
+  x = 1.01L;
+  {
+    int exp = -9999;
+    long double y = frexpl (x, &exp);
+    if (!(exp == 1 && y == 0.505L))
+      result |= 2;
+  }
+  /* Test on large finite numbers.  This fails on BeOS at i = 16322, while
+     LDBL_MAX_EXP = 16384.
+     In the loop end test, we test x against Infinity, rather than comparing
+     i with LDBL_MAX_EXP, because BeOS <float.h> has a wrong LDBL_MAX_EXP.  */
+  {
+    int i;
+    for (i = 1, x = 1.0L; x != x + x; i++, x *= 2.0L)
+      {
+        int exp = -9999;
+        frexpl (x, &exp);
+        if (exp != i)
+          {
+            result |= 4;
+            break;
+          }
+      }
+  }
+  /* Test on denormalized numbers.  */
+  {
+    int i;
+    for (i = 1, x = 1.0L; i >= LDBL_MIN_EXP; i--, x *= 0.5L)
+      ;
+    if (x > 0.0L)
+      {
+        int exp;
+        long double y = frexpl (x, &exp);
+        /* On machines with IEEE854 arithmetic: x = 1.68105e-4932,
+           exp = -16382, y = 0.5.  On Mac OS X 10.5: exp = -16384, y = 0.5.  */
+        if (exp != LDBL_MIN_EXP - 1)
+          result |= 8;
+      }
+  }
+  /* Test on infinite numbers.  */
+  /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0.  */
+  x = 1.0L / zero;
+  {
+    int exp;
+    long double y = frexpl (x, &exp);
+    if (y != x)
+      result |= 16;
+  }
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_frexpl_works=yes
+else $as_nop
+  gl_cv_func_frexpl_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_frexpl_works" >&5
+printf "%s\n" "$gl_cv_func_frexpl_works" >&6; }
+
+    case "$gl_cv_func_frexpl_works" in
+      *yes) gl_func_frexpl_no_libm=yes ;;
+      *)    gl_func_frexpl_no_libm=no; REPLACE_FREXPL=1 ;;
+    esac
+  else
+    gl_func_frexpl_no_libm=no
+        REPLACE_FREXPL=1
+  fi
+  if test $gl_func_frexpl_no_libm = yes; then
+
+printf "%s\n" "#define HAVE_FREXPL_IN_LIBC 1" >>confdefs.h
+
+            ac_fn_check_decl "$LINENO" "frexpl" "ac_cv_have_decl_frexpl" "#include <math.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_frexpl" = xyes
+then :
+
+else $as_nop
+  HAVE_DECL_FREXPL=0
+fi
+  fi
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ldexpl() can be used without linking with libm" >&5
+printf %s "checking whether ldexpl() can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_ldexpl_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+             long double x;
+int
+main (void)
+{
+return ldexpl (x, -1) > 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_ldexpl_no_libm=yes
+else $as_nop
+  gl_cv_func_ldexpl_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_no_libm" >&5
+printf "%s\n" "$gl_cv_func_ldexpl_no_libm" >&6; }
+
+  if test $gl_cv_func_ldexpl_no_libm = yes; then
+
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ldexpl works" >&5
+printf %s "checking whether ldexpl works... " >&6; }
+if test ${gl_cv_func_ldexpl_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+         case "$host_os" in
+           aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no" ;;
+                            # Guess yes on native Windows.
+           mingw*)          gl_cv_func_ldexpl_works="guessing yes" ;;
+           *)               gl_cv_func_ldexpl_works="guessing yes" ;;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <math.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+long double ldexpl (long double, int);
+int main()
+{
+  int result = 0;
+  {
+    volatile long double x = 1.0;
+    volatile long double y = ldexpl (x, -1);
+    if (y != 0.5L)
+      result |= 1;
+  }
+  {
+    volatile long double x = 1.73205L;
+    volatile long double y = ldexpl (x, 0);
+    if (y != x)
+      result |= 2;
+  }
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_ldexpl_works=yes
+else $as_nop
+  gl_cv_func_ldexpl_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ldexpl_works" >&5
+printf "%s\n" "$gl_cv_func_ldexpl_works" >&6; }
+
+    case "$gl_cv_func_ldexpl_works" in
+      *yes)
+
+printf "%s\n" "#define HAVE_LDEXPL_IN_LIBC 1" >>confdefs.h
+
+                        ac_fn_check_decl "$LINENO" "ldexpl" "ac_cv_have_decl_ldexpl" "#include <math.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_ldexpl" = xyes
+then :
+
+else $as_nop
+  HAVE_DECL_LDEXPL=0
+fi
+        ;;
+    esac
+  fi
+
+
+  ac_fn_check_decl "$LINENO" "program_invocation_name" "ac_cv_have_decl_program_invocation_name" "#include <errno.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_program_invocation_name" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_NAME $ac_have_decl" >>confdefs.h
+
+  ac_fn_check_decl "$LINENO" "program_invocation_short_name" "ac_cv_have_decl_program_invocation_short_name" "#include <errno.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_program_invocation_short_name" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_PROGRAM_INVOCATION_SHORT_NAME $ac_have_decl" >>confdefs.h
+
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'"
+
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'"
+
+
+
+  :
+
+
+
+
+  ac_fn_c_check_func "$LINENO" "raise" "ac_cv_func_raise"
+if test "x$ac_cv_func_raise" = xyes
+then :
+  printf "%s\n" "#define HAVE_RAISE 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_raise = no; then
+    HAVE_RAISE=0
+  else
+
+
+      if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+        REPLACE_RAISE=1
+      fi
+
+
+
+
+
+  HAVE_POSIX_SIGNALBLOCKING=0
+  if test "$gl_cv_type_sigset_t" = yes; then
+    ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
+if test "x$ac_cv_func_sigprocmask" = xyes
+then :
+  HAVE_POSIX_SIGNALBLOCKING=1
+fi
+
+  fi
+
+      if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+
+
+
+
+          if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+            REPLACE_RAISE=1
+          fi
+
+      fi
+
+  fi
+
+  if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS raise.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_RAISE=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_RAISE 1" >>confdefs.h
+
+
+
+
+
+
+
+  ac_fn_c_check_func "$LINENO" "rawmemchr" "ac_cv_func_rawmemchr"
+if test "x$ac_cv_func_rawmemchr" = xyes
+then :
+  printf "%s\n" "#define HAVE_RAWMEMCHR 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_rawmemchr = no; then
+    HAVE_RAWMEMCHR=0
+  fi
+
+  if test $HAVE_RAWMEMCHR = 0; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS rawmemchr.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_RAWMEMCHR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_RAWMEMCHR 1" >>confdefs.h
+
+
+
+
+
+
+  ac_fn_c_check_func "$LINENO" "readdir" "ac_cv_func_readdir"
+if test "x$ac_cv_func_readdir" = xyes
+then :
+  printf "%s\n" "#define HAVE_READDIR 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_readdir = no; then
+    HAVE_READDIR=0
+  fi
+
+  if test $HAVE_READDIR = 0; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS readdir.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_READDIR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_READDIR 1" >>confdefs.h
+
+
+
+
+
+
+  if test $ac_cv_func_readlink = no; then
+    HAVE_READLINK=0
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink signature is correct" >&5
+printf %s "checking whether readlink signature is correct... " >&6; }
+if test ${gl_cv_decl_readlink_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+      /* Cause compilation failure if original declaration has wrong type.  */
+      ssize_t readlink (const char *, char *, size_t);
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_decl_readlink_works=yes
+else $as_nop
+  gl_cv_decl_readlink_works=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_decl_readlink_works" >&5
+printf "%s\n" "$gl_cv_decl_readlink_works" >&6; }
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink handles trailing slash correctly" >&5
+printf %s "checking whether readlink handles trailing slash correctly... " >&6; }
+if test ${gl_cv_func_readlink_trailing_slash+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  # We have readlink, so assume ln -s works.
+       ln -s conftest.no-such conftest.link
+       ln -s conftest.link conftest.lnk2
+       if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+            # Guess yes on Linux or glibc systems.
+            linux-* | linux | *-gnu* | gnu*)
+              gl_cv_func_readlink_trailing_slash="guessing yes" ;;
+            # Guess no on AIX or HP-UX.
+            aix* | hpux*)
+              gl_cv_func_readlink_trailing_slash="guessing no" ;;
+            # If we don't know, obey --enable-cross-guesses.
+            *)
+              gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;;
+          esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+
+int
+main (void)
+{
+char buf[20];
+      return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_readlink_trailing_slash=yes
+else $as_nop
+  gl_cv_func_readlink_trailing_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      rm -f conftest.link conftest.lnk2
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_trailing_slash" >&5
+printf "%s\n" "$gl_cv_func_readlink_trailing_slash" >&6; }
+    case "$gl_cv_func_readlink_trailing_slash" in
+      *yes)
+        if test "$gl_cv_decl_readlink_works" != yes; then
+          REPLACE_READLINK=1
+        fi
+        ;;
+      *)
+
+printf "%s\n" "#define READLINK_TRAILING_SLASH_BUG 1" >>confdefs.h
+
+        REPLACE_READLINK=1
+        ;;
+    esac
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether readlink truncates results correctly" >&5
+printf %s "checking whether readlink truncates results correctly... " >&6; }
+if test ${gl_cv_func_readlink_truncate+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  # We have readlink, so assume ln -s works.
+       ln -s ab conftest.link
+       if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+            # Guess yes on Linux or glibc systems.
+            linux-* | linux | *-gnu* | gnu*)
+              gl_cv_func_readlink_truncate="guessing yes" ;;
+            # Guess no on AIX or HP-UX.
+            aix* | hpux*)
+              gl_cv_func_readlink_truncate="guessing no" ;;
+            # If we don't know, obey --enable-cross-guesses.
+            *)
+              gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;;
+          esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+
+int
+main (void)
+{
+char c;
+      return readlink ("conftest.link", &c, 1) != 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_readlink_truncate=yes
+else $as_nop
+  gl_cv_func_readlink_truncate=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      rm -f conftest.link conftest.lnk2
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_readlink_truncate" >&5
+printf "%s\n" "$gl_cv_func_readlink_truncate" >&6; }
+    case $gl_cv_func_readlink_truncate in
+      *yes)
+        if test "$gl_cv_decl_readlink_works" != yes; then
+          REPLACE_READLINK=1
+        fi
+        ;;
+      *)
+
+printf "%s\n" "#define READLINK_TRUNCATE_BUG 1" >>confdefs.h
+
+        REPLACE_READLINK=1
+        ;;
+    esac
+  fi
+
+  if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS readlink.$ac_objext"
+
+
+  :
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_READLINK=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_READLINK 1" >>confdefs.h
+
+
+
+
+
+
+  if test $REPLACE_REALLOC = 0; then
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether realloc (0, 0) returns nonnull" >&5
+printf %s "checking whether realloc (0, 0) returns nonnull... " >&6; }
+if test ${ac_cv_func_realloc_0_nonnull+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+          # Guess yes on platforms where we know the result.
+          *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+          | gnu* | *-musl* | midnightbsd* \
+          | hpux* | solaris* | cygwin* | mingw* | msys* )
+            ac_cv_func_realloc_0_nonnull="guessing yes" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;;
+        esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+int
+main (void)
+{
+void *p = realloc (0, 0);
+            int result = !p;
+            free (p);
+            return result;
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  ac_cv_func_realloc_0_nonnull=yes
+else $as_nop
+  ac_cv_func_realloc_0_nonnull=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_realloc_0_nonnull" >&5
+printf "%s\n" "$ac_cv_func_realloc_0_nonnull" >&6; }
+  case $ac_cv_func_realloc_0_nonnull in #(
+  *yes) :
+     ;; #(
+  *) :
+    REPLACE_REALLOC=1 ;;
+esac
+
+  fi
+
+  if test $REPLACE_REALLOC = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS realloc.$ac_objext"
+
+  fi
+
+
+
+  if test $REPLACE_MALLOC = 1; then
+    REPLACE_REALLOC=1
+  fi
+
+  if test $REPLACE_REALLOC = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS realloc.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_REALLOC_POSIX=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_REALLOC_POSIX 1" >>confdefs.h
+
+
+
+
+
+
+
+
+  ac_fn_c_check_func "$LINENO" "reallocarray" "ac_cv_func_reallocarray"
+if test "x$ac_cv_func_reallocarray" = xyes
+then :
+  printf "%s\n" "#define HAVE_REALLOCARRAY 1" >>confdefs.h
+
+fi
+
+  if test "$ac_cv_func_reallocarray" = no; then
+    HAVE_REALLOCARRAY=0
+  elif test "$gl_cv_malloc_ptrdiff" = no; then
+    REPLACE_REALLOCARRAY=1
+  fi
+
+  if test $HAVE_REALLOCARRAY = 0 || test $REPLACE_REALLOCARRAY = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS reallocarray.$ac_objext"
+
+    :
+  fi
+
+
+printf "%s\n" "#define GNULIB_REALLOCARRAY 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_REALLOCARRAY=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_REALLOCARRAY 1" >>confdefs.h
+
+
+
+
+
+# Check whether --with-included-regex was given.
+if test ${with_included_regex+y}
+then :
+  withval=$with_included_regex;
+fi
+
+
+  case $with_included_regex in #(
+  yes|no) ac_use_included_regex=$with_included_regex
+        ;;
+  '')
+    # If the system regex support is good enough that it passes the
+    # following run test, then default to *not* using the included regex.c.
+    # If cross compiling, assume the test would fail and use the included
+    # regex.c.
+
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working re_compile_pattern" >&5
+printf %s "checking for working re_compile_pattern... " >&6; }
+if test ${gl_cv_func_re_compile_pattern_working+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                   # Guess no on native Windows.
+           mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;;
+                   # Otherwise obey --enable-cross-guesses.
+           *)      gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <regex.h>
+
+            #include <locale.h>
+            #include <limits.h>
+            #include <string.h>
+
+            #if defined M_CHECK_ACTION || HAVE_DECL_ALARM
+            # include <signal.h>
+            # include <unistd.h>
+            #endif
+
+            #if HAVE_MALLOC_H
+            # include <malloc.h>
+            #endif
+
+            #ifdef M_CHECK_ACTION
+            /* Exit with distinguishable exit code.  */
+            static void sigabrt_no_core (int sig) { raise (SIGTERM); }
+            #endif
+
+int
+main (void)
+{
+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;
+
+            /* Some builds of glibc go into an infinite loop on this
+               test.  Use alarm to force death, and mallopt to avoid
+               malloc recursion in diagnosing the corrupted heap. */
+#if HAVE_DECL_ALARM
+            signal (SIGALRM, SIG_DFL);
+            alarm (2);
+#endif
+#ifdef M_CHECK_ACTION
+            signal (SIGABRT, sigabrt_no_core);
+            mallopt (M_CHECK_ACTION, 2);
+#endif
+
+            if (setlocale (LC_ALL, "en_US.UTF-8"))
+              {
+                {
+                  /* https://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.  */
+                  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;
+                      regfree (&regex);
+                    }
+                }
+
+                {
+                  /* This test is from glibc bug 15078.
+                     The test case is from Andreas Schwab in
+                     <https://sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
+                     */
+                  static char const pat[] = "[^x]x";
+                  static char const data[] =
+                    /* <U1000><U103B><U103D><U1014><U103A><U102F><U1015><U103A> */
+                    "\xe1\x80\x80"
+                    "\xe1\x80\xbb"
+                    "\xe1\x80\xbd"
+                    "\xe1\x80\x94"
+                    "\xe1\x80\xba"
+                    "\xe1\x80\xaf"
+                    "\xe1\x80\x95"
+                    "\xe1\x80\xba"
+                    "x";
+                  re_set_syntax (0);
+                  memset (&regex, 0, sizeof regex);
+                  s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+                  if (s)
+                    result |= 1;
+                  else
+                    {
+                      i = re_search (&regex, data, sizeof data - 1,
+                                     0, sizeof data - 1, 0);
+                      if (i != 0 && i != 21)
+                        result |= 1;
+                      regfree (&regex);
+                    }
+                }
+
+                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)
+              result |= 2;
+            else
+              {
+                /* This should fail, but succeeds for glibc-2.5.  */
+                if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+                  result |= 2;
+                regfree (&regex);
+              }
+
+            /* This regular expression is from Spencer ere test number 75
+               in grep-2.3.  */
+            re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+            memset (&regex, 0, sizeof regex);
+            for (i = 0; i <= UCHAR_MAX; i++)
+              folded_chars[i] = i;
+            regex.translate = folded_chars;
+            s = re_compile_pattern ("a[[:]:]]b\n", 11, &regex);
+            /* This should fail with _Invalid character class name_ error.  */
+            if (!s)
+              {
+                result |= 4;
+                regfree (&regex);
+              }
+
+            /* Ensure that [b-a] is diagnosed as invalid, when
+               using RE_NO_EMPTY_RANGES. */
+            re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("a[b-a]", 6, &regex);
+            if (s == 0)
+              {
+                result |= 8;
+                regfree (&regex);
+              }
+
+            /* 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)
+              result |= 8;
+            else
+              regfree (&regex);
+
+            /* 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)
+              result |= 8;
+            else
+              {
+                /* This should match, but does not for glibc-2.2.1.  */
+                if (re_match (&regex, "an", 2, 0, &regs) != 2)
+                  result |= 8;
+                else
+                  {
+                    free (regs.start);
+                    free (regs.end);
+                  }
+                regfree (&regex);
+              }
+
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("x", 1, &regex);
+            if (s)
+              result |= 8;
+            else
+              {
+                /* glibc-2.2.93 does not work with a negative RANGE argument.  */
+                if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+                  result |= 8;
+                else
+                  {
+                    free (regs.start);
+                    free (regs.end);
+                  }
+                regfree (&regex);
+              }
+
+            /* The version of regex.c in older versions of gnulib
+               ignored RE_ICASE.  Detect that problem too.  */
+            re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("x", 1, &regex);
+            if (s)
+              result |= 16;
+            else
+              {
+                if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+                  result |= 16;
+                else
+                  {
+                    free (regs.start);
+                    free (regs.end);
+                  }
+                regfree (&regex);
+              }
+
+            /* Catch a bug reported by Vin Shelton in
+               https://lists.gnu.org/r/bug-coreutils/2007-06/msg00089.html
+               */
+            re_set_syntax (RE_SYNTAX_POSIX_BASIC
+                           & ~RE_CONTEXT_INVALID_DUP
+                           & ~RE_NO_EMPTY_RANGES);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
+            if (s)
+              result |= 32;
+            else
+              regfree (&regex);
+
+            /* REG_STARTEND was added to glibc on 2004-01-15.
+               Reject older versions.  */
+            if (! REG_STARTEND)
+              result |= 64;
+
+            /* Matching with the compiled form of this regexp would provoke
+               an assertion failure prior to glibc-2.28:
+                 regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+               With glibc-2.28, compilation fails and reports the invalid
+               back reference.  */
+            re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("0|()0|\\1|0", 10, &regex);
+            if (!s)
+              result |= 64;
+            else
+              {
+                if (strcmp (s, "Invalid back reference"))
+                  result |= 64;
+                regfree (&regex);
+              }
+
+#if 0
+            /* It would be nice to reject hosts whose regoff_t values are too
+               narrow (including glibc on hosts with 64-bit ptrdiff_t and
+               32-bit int), but we should wait until glibc implements this
+               feature.  Otherwise, support for equivalence classes and
+               multibyte collation symbols would always be broken except
+               when compiling --without-included-regex.   */
+            if (sizeof (regoff_t) < sizeof (ptrdiff_t)
+                || sizeof (regoff_t) < sizeof (ssize_t))
+              result |= 64;
+#endif
+
+            return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_re_compile_pattern_working=yes
+else $as_nop
+  gl_cv_func_re_compile_pattern_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_re_compile_pattern_working" >&5
+printf "%s\n" "$gl_cv_func_re_compile_pattern_working" >&6; }
+    case "$gl_cv_func_re_compile_pattern_working" in #(
+      *yes) ac_use_included_regex=no;; #(
+      *no) ac_use_included_regex=yes;;
+    esac
+    ;;
+  *) as_fn_error $? "Invalid value for --with-included-regex: $with_included_regex" "$LINENO" 5
+    ;;
+  esac
+
+  if test $ac_use_included_regex = yes; then
+
+printf "%s\n" "#define _REGEX_INCLUDE_LIMITS_H 1" >>confdefs.h
+
+
+printf "%s\n" "#define _REGEX_LARGE_OFFSETS 1" >>confdefs.h
+
+
+printf "%s\n" "#define re_syntax_options rpl_re_syntax_options" >>confdefs.h
+
+
+printf "%s\n" "#define re_set_syntax rpl_re_set_syntax" >>confdefs.h
+
+
+printf "%s\n" "#define re_compile_pattern rpl_re_compile_pattern" >>confdefs.h
+
+
+printf "%s\n" "#define re_compile_fastmap rpl_re_compile_fastmap" >>confdefs.h
+
+
+printf "%s\n" "#define re_search rpl_re_search" >>confdefs.h
+
+
+printf "%s\n" "#define re_search_2 rpl_re_search_2" >>confdefs.h
+
+
+printf "%s\n" "#define re_match rpl_re_match" >>confdefs.h
+
+
+printf "%s\n" "#define re_match_2 rpl_re_match_2" >>confdefs.h
+
+
+printf "%s\n" "#define re_set_registers rpl_re_set_registers" >>confdefs.h
+
+
+printf "%s\n" "#define re_comp rpl_re_comp" >>confdefs.h
+
+
+printf "%s\n" "#define re_exec rpl_re_exec" >>confdefs.h
+
+
+printf "%s\n" "#define regcomp rpl_regcomp" >>confdefs.h
+
+
+printf "%s\n" "#define regexec rpl_regexec" >>confdefs.h
+
+
+printf "%s\n" "#define regerror rpl_regerror" >>confdefs.h
+
+
+printf "%s\n" "#define regfree rpl_regfree" >>confdefs.h
+
+  fi
+
+  if test $ac_use_included_regex = yes; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS regex.$ac_objext"
+
+
+
+
+
+
+
+  ac_fn_c_check_header_compile "$LINENO" "libintl.h" "ac_cv_header_libintl_h" "$ac_includes_default"
+if test "x$ac_cv_header_libintl_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_LIBINTL_H 1" >>confdefs.h
+
+fi
+
+
+  ac_fn_check_decl "$LINENO" "isblank" "ac_cv_have_decl_isblank" "#include <ctype.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_isblank" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_ISBLANK $ac_have_decl" >>confdefs.h
+
+
+  fi
+
+
+
+
+
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on destination" >&5
+printf %s "checking whether rename honors trailing slash on destination... " >&6; }
+if test ${gl_cv_func_rename_slash_dst_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
+    touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
+      as_fn_error $? "cannot create temporary files" "$LINENO" 5
+    # Assume that if we have lstat, we can also check symlinks.
+    if test $ac_cv_func_lstat = yes; then
+      ln -s conftest.f conftest.lnk
+    fi
+    if test "$cross_compiling" = yes
+then :
+        case "$host_os" in
+                          # Guess yes on Linux systems.
+         linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+                          # Guess yes on glibc systems.
+         *-gnu*)          gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+                          # Guess no on native Windows.
+         mingw*)          gl_cv_func_rename_slash_dst_works="guessing no" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+         *)               gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
+       esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#        include <stdio.h>
+#        include <stdlib.h>
+
+int
+main (void)
+{
+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)
+             result |= 4;
+#endif
+           return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_rename_slash_dst_works=yes
+else $as_nop
+  gl_cv_func_rename_slash_dst_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_dst_works" >&5
+printf "%s\n" "$gl_cv_func_rename_slash_dst_works" >&6; }
+  case "$gl_cv_func_rename_slash_dst_works" in
+    *yes) ;;
+    *)
+      REPLACE_RENAME=1
+
+printf "%s\n" "#define RENAME_TRAILING_SLASH_DEST_BUG 1" >>confdefs.h
+
+      ;;
+  esac
+
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether rename honors trailing slash on source" >&5
+printf %s "checking whether rename honors trailing slash on source... " >&6; }
+if test ${gl_cv_func_rename_slash_src_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
+    touch conftest.f && touch conftest.f1 && mkdir conftest.d1 ||
+      as_fn_error $? "cannot create temporary files" "$LINENO" 5
+    # Assume that if we have lstat, we can also check symlinks.
+    if test $ac_cv_func_lstat = yes; then
+      ln -s conftest.f conftest.lnk
+    fi
+    if test "$cross_compiling" = yes
+then :
+        case "$host_os" in
+                          # Guess yes on Linux systems.
+         linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+                          # Guess yes on glibc systems.
+         *-gnu*)          gl_cv_func_rename_slash_src_works="guessing yes" ;;
+                          # Guess yes on native Windows.
+         mingw*)          gl_cv_func_rename_slash_src_works="guessing yes" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+         *)               gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
+       esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#        include <stdio.h>
+#        include <stdlib.h>
+
+int
+main (void)
+{
+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)
+             result |= 4;
+#endif
+           return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_rename_slash_src_works=yes
+else $as_nop
+  gl_cv_func_rename_slash_src_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_slash_src_works" >&5
+printf "%s\n" "$gl_cv_func_rename_slash_src_works" >&6; }
+  case "$gl_cv_func_rename_slash_src_works" in
+    *yes) ;;
+    *)
+      REPLACE_RENAME=1
+
+printf "%s\n" "#define RENAME_TRAILING_SLASH_SOURCE_BUG 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether rename manages hard links correctly" >&5
+printf %s "checking whether rename manages hard links correctly... " >&6; }
+if test ${gl_cv_func_rename_link_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test $ac_cv_func_link = yes; then
+       if test $cross_compiling != yes; then
+         rm -rf conftest.f conftest.f1 conftest.f2
+         if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
+             set x `ls -i conftest.f conftest.f1` && test "" = ""; then
+           if test "$cross_compiling" = yes
+then :
+                :
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#               include <errno.h>
+#               include <stdio.h>
+#               include <stdlib.h>
+#               include <unistd.h>
+
+
+$gl_mda_defines
+
+int
+main (void)
+{
+int result = 0;
+                  if (rename ("conftest.f", "conftest.f1"))
+                    result |= 1;
+                  if (unlink ("conftest.f1"))
+                    result |= 2;
+
+                  /* Allow either the POSIX-required behavior, where the
+                     previous rename kept conftest.f, or the (better) NetBSD
+                     behavior, where it removed conftest.f.  */
+                  if (rename ("conftest.f", "conftest.f") != 0
+                      && errno != ENOENT)
+                    result |= 4;
+
+                  if (rename ("conftest.f1", "conftest.f1") == 0)
+                    result |= 8;
+                  if (rename ("conftest.f2", "conftest.f2") != 0)
+                    result |= 16;
+                  return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_rename_link_works=yes
+else $as_nop
+  gl_cv_func_rename_link_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+         else
+           gl_cv_func_rename_link_works="guessing no"
+         fi
+         rm -rf conftest.f conftest.f1 conftest.f2
+       else
+                  case "$host_os" in
+                            # Guess yes on Linux systems.
+           linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
+                            # Guess yes on glibc systems.
+           *-gnu*)          gl_cv_func_rename_link_works="guessing yes" ;;
+                            # Guess yes on native Windows.
+           mingw*)          gl_cv_func_rename_link_works="guessing yes" ;;
+                            # If we don't know, obey --enable-cross-guesses.
+           *)               gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
+         esac
+       fi
+     else
+       gl_cv_func_rename_link_works=yes
+     fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_link_works" >&5
+printf "%s\n" "$gl_cv_func_rename_link_works" >&6; }
+  case "$gl_cv_func_rename_link_works" in
+    *yes) ;;
+    *)
+      REPLACE_RENAME=1
+
+printf "%s\n" "#define RENAME_HARD_LINK_BUG 1" >>confdefs.h
+
+      ;;
+  esac
+
+          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether rename manages existing destinations correctly" >&5
+printf %s "checking whether rename manages existing destinations correctly... " >&6; }
+if test ${gl_cv_func_rename_dest_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  rm -rf conftest.f conftest.d1 conftest.d2
+    touch conftest.f && mkdir conftest.d1 conftest.d2 ||
+      as_fn_error $? "cannot create temporary files" "$LINENO" 5
+    if test "$cross_compiling" = yes
+then :
+        case "$host_os" in
+                          # Guess yes on Linux systems.
+         linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
+                          # Guess yes on glibc systems.
+         *-gnu*)          gl_cv_func_rename_dest_works="guessing yes" ;;
+                          # Guess no on native Windows.
+         mingw*)          gl_cv_func_rename_dest_works="guessing no" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+         *)               gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
+       esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#        include <stdio.h>
+#        include <stdlib.h>
+
+int
+main (void)
+{
+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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_rename_dest_works=yes
+else $as_nop
+  gl_cv_func_rename_dest_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    rm -rf conftest.f conftest.d1 conftest.d2
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rename_dest_works" >&5
+printf "%s\n" "$gl_cv_func_rename_dest_works" >&6; }
+  case "$gl_cv_func_rename_dest_works" in
+    *yes) ;;
+    *)
+      REPLACE_RENAME=1
+
+printf "%s\n" "#define RENAME_DEST_EXISTS_BUG 1" >>confdefs.h
+
+      ;;
+  esac
+
+  if test $REPLACE_RENAME = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS rename.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_RENAME=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_RENAME 1" >>confdefs.h
+
+
+
+
+
+
+  ac_fn_c_check_func "$LINENO" "rewinddir" "ac_cv_func_rewinddir"
+if test "x$ac_cv_func_rewinddir" = xyes
+then :
+  printf "%s\n" "#define HAVE_REWINDDIR 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_rewinddir = no; then
+    HAVE_REWINDDIR=0
+  fi
+
+  if test $HAVE_REWINDDIR = 0; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS rewinddir.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_REWINDDIR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_REWINDDIR 1" >>confdefs.h
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether rmdir works" >&5
+printf %s "checking whether rmdir works... " >&6; }
+if test ${gl_cv_func_rmdir_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  mkdir conftest.dir
+     touch conftest.file
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                           # Guess yes on Linux systems.
+          linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
+                           # Guess yes on glibc systems.
+          *-gnu* | gnu*)   gl_cv_func_rmdir_works="guessing yes" ;;
+                           # Guess no on native Windows.
+          mingw*)          gl_cv_func_rmdir_works="guessing no" ;;
+                           # If we don't know, obey --enable-cross-guesses.
+          *)               gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
+        esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+           #include <errno.h>
+           #if HAVE_UNISTD_H
+           # include <unistd.h>
+           #else /* on Windows with MSVC */
+           # include <direct.h>
+           #endif
+
+
+$gl_mda_defines
+
+int
+main (void)
+{
+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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_rmdir_works=yes
+else $as_nop
+  gl_cv_func_rmdir_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+     rm -rf conftest.dir conftest.file
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_rmdir_works" >&5
+printf "%s\n" "$gl_cv_func_rmdir_works" >&6; }
+  case "$gl_cv_func_rmdir_works" in
+    *yes) ;;
+    *)
+      REPLACE_RMDIR=1
+      ;;
+  esac
+
+  if test $REPLACE_RMDIR = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS rmdir.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_RMDIR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_RMDIR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_func_secure_getenv = no; then
+    HAVE_SECURE_GETENV=0
+  fi
+
+  if test $HAVE_SECURE_GETENV = 0; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS secure_getenv.$ac_objext"
+
+
+  ac_fn_c_check_func "$LINENO" "__secure_getenv" "ac_cv_func___secure_getenv"
+if test "x$ac_cv_func___secure_getenv" = xyes
+then :
+  printf "%s\n" "#define HAVE___SECURE_GETENV 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func___secure_getenv = no; then
+    ac_fn_c_check_func "$LINENO" "issetugid" "ac_cv_func_issetugid"
+if test "x$ac_cv_func_issetugid" = xyes
+then :
+  printf "%s\n" "#define HAVE_ISSETUGID 1" >>confdefs.h
+
+fi
+
+  fi
+
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_SECURE_GETENV=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SECURE_GETENV 1" >>confdefs.h
+
+
+
+
+
+
+
+
+    NEED_SETLOCALE_IMPROVED=0
+  case "$host_os" in
+            mingw*) NEED_SETLOCALE_IMPROVED=1 ;;
+            cygwin*)
+      case `uname -r` in
+        1.5.*) NEED_SETLOCALE_IMPROVED=1 ;;
+      esac
+      ;;
+        *)
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setlocale supports the C locale" >&5
+printf %s "checking whether setlocale supports the C locale... " >&6; }
+if test ${gl_cv_func_setlocale_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                               # Guess no on Android.
+              linux*-android*) gl_cv_func_setlocale_works="guessing no";;
+                               # Guess yes otherwise.
+              *)               gl_cv_func_setlocale_works="guessing yes";;
+            esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+int main ()
+{
+  return setlocale (LC_ALL, "C") == NULL;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_setlocale_works=yes
+else $as_nop
+  gl_cv_func_setlocale_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_works" >&5
+printf "%s\n" "$gl_cv_func_setlocale_works" >&6; }
+      case "$gl_cv_func_setlocale_works" in
+        *yes) ;;
+        *) NEED_SETLOCALE_IMPROVED=1 ;;
+      esac
+      ;;
+  esac
+
+printf "%s\n" "#define NEED_SETLOCALE_IMPROVED $NEED_SETLOCALE_IMPROVED" >>confdefs.h
+
+
+    NEED_SETLOCALE_MTSAFE=0
+  if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+    NEED_SETLOCALE_MTSAFE=1
+  fi
+
+printf "%s\n" "#define NEED_SETLOCALE_MTSAFE $NEED_SETLOCALE_MTSAFE" >>confdefs.h
+
+
+  if test $NEED_SETLOCALE_IMPROVED = 1 || test $NEED_SETLOCALE_MTSAFE = 1; then
+    REPLACE_SETLOCALE=1
+  fi
+
+  if test $NEED_SETLOCALE_MTSAFE = 1; then
+    LIB_SETLOCALE="$LIB_SETLOCALE_NULL"
+  else
+    LIB_SETLOCALE=
+  fi
+
+
+  if test $REPLACE_SETLOCALE = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS setlocale.$ac_objext"
+
+
+        :
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_SETLOCALE=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SETLOCALE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setlocale (LC_ALL, NULL) is multithread-safe" >&5
+printf %s "checking whether setlocale (LC_ALL, NULL) is multithread-safe... " >&6; }
+if test ${gl_cv_func_setlocale_null_all_mtsafe+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  case "$host_os" in
+       # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
+       *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
+         gl_cv_func_setlocale_null_all_mtsafe=no ;;
+       # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
+       *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
+         gl_cv_func_setlocale_null_all_mtsafe=yes ;;
+       # If we don't know, obey --enable-cross-guesses.
+       *)
+         gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
+     esac
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_all_mtsafe" >&5
+printf "%s\n" "$gl_cv_func_setlocale_null_all_mtsafe" >&6; }
+    case "$host_os" in
+    mingw*) ;;
+    *)
+      if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+        gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
+      fi
+      ;;
+  esac
+  case "$gl_cv_func_setlocale_null_all_mtsafe" in
+    *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
+    *)    SETLOCALE_NULL_ALL_MTSAFE=0 ;;
+  esac
+
+printf "%s\n" "#define SETLOCALE_NULL_ALL_MTSAFE $SETLOCALE_NULL_ALL_MTSAFE" >>confdefs.h
+
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setlocale (category, NULL) is multithread-safe" >&5
+printf %s "checking whether setlocale (category, NULL) is multithread-safe... " >&6; }
+if test ${gl_cv_func_setlocale_null_one_mtsafe+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  case "$host_os" in
+       # Guess no on OpenBSD, AIX.
+       openbsd* | aix*)
+         gl_cv_func_setlocale_null_one_mtsafe=no ;;
+       # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
+       *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
+         gl_cv_func_setlocale_null_one_mtsafe=yes ;;
+       # If we don't know, obey --enable-cross-guesses.
+       *)
+         gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
+     esac
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setlocale_null_one_mtsafe" >&5
+printf "%s\n" "$gl_cv_func_setlocale_null_one_mtsafe" >&6; }
+    case "$host_os" in
+    mingw*) ;;
+    *)
+      if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+        gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
+      fi
+      ;;
+  esac
+  case "$gl_cv_func_setlocale_null_one_mtsafe" in
+    *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
+    *)    SETLOCALE_NULL_ONE_MTSAFE=0 ;;
+  esac
+
+printf "%s\n" "#define SETLOCALE_NULL_ONE_MTSAFE $SETLOCALE_NULL_ONE_MTSAFE" >>confdefs.h
+
+
+    if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+    case "$host_os" in
+      mingw*) LIB_SETLOCALE_NULL= ;;
+      *)
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether imported symbols can be declared weak" >&5
+printf %s "checking whether imported symbols can be declared weak... " >&6; }
+if test ${gl_cv_have_weak+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_cv_have_weak=no
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern void xyzzy ();
+#pragma weak xyzzy
+int
+main (void)
+{
+xyzzy();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_have_weak=maybe
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+     if test $gl_cv_have_weak = maybe; then
+                     if test "$cross_compiling" = yes
+then :
+                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __ELF__
+             Extensible Linking Format
+             #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Extensible Linking Format" >/dev/null 2>&1
+then :
+  gl_cv_have_weak="guessing yes"
+else $as_nop
+  gl_cv_have_weak="guessing no"
+fi
+rm -rf conftest*
+
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+  return (fputs == NULL);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_have_weak=yes
+else $as_nop
+  gl_cv_have_weak=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+     fi
+          case " $LDFLAGS " in
+       *" -static "*) gl_cv_have_weak=no ;;
+     esac
+                    case "$gl_cv_have_weak" in
+       *yes)
+         case "$host_os" in
+           freebsd* | dragonfly* | midnightbsd*)
+             : > conftest1.c
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&5 2>&1
+             cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+  return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&5 2>&1 \
+               || gl_cv_have_weak=no
+             rm -f conftest1.c libempty.so conftest2.c conftest
+             ;;
+         esac
+         ;;
+     esac
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_have_weak" >&5
+printf "%s\n" "$gl_cv_have_weak" >&6; }
+  case "$gl_cv_have_weak" in
+    *yes)
+
+printf "%s\n" "#define HAVE_WEAK_SYMBOLS 1" >>confdefs.h
+
+      ;;
+  esac
+
+        case "$gl_cv_have_weak" in
+          *yes) LIB_SETLOCALE_NULL= ;;
+          *)    LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
+        esac
+        ;;
+    esac
+  else
+    LIB_SETLOCALE_NULL=
+  fi
+
+
+  if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS setlocale-lock.$ac_objext"
+
+
+
+
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  if test -n "$GCC"; then
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the -Werror option is usable" >&5
+printf %s "checking whether the -Werror option is usable... " >&6; }
+if test ${gl_cv_cc_vis_werror+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Werror"
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_cc_vis_werror=yes
+else $as_nop
+  gl_cv_cc_vis_werror=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+       CFLAGS="$gl_save_CFLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_vis_werror" >&5
+printf "%s\n" "$gl_cv_cc_vis_werror" >&6; }
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for simple visibility declarations" >&5
+printf %s "checking for simple visibility declarations... " >&6; }
+if test ${gl_cv_cc_visibility+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -fvisibility=hidden"
+                                          if test $gl_cv_cc_vis_werror = yes; then
+         CFLAGS="$CFLAGS -Werror"
+       fi
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+              extern __attribute__((__visibility__("default"))) int exportedvar;
+              extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+              extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+              void dummyfunc (void);
+              void dummyfunc (void) {}
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_cc_visibility=yes
+else $as_nop
+  gl_cv_cc_visibility=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+       CFLAGS="$gl_save_CFLAGS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_visibility" >&5
+printf "%s\n" "$gl_cv_cc_visibility" >&6; }
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
+    fi
+  fi
+
+
+
+printf "%s\n" "#define HAVE_VISIBILITY $HAVE_VISIBILITY" >>confdefs.h
+
+
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_SETLOCALE_NULL=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SETLOCALE_NULL 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_func_sigaction = yes; then
+    ac_fn_c_check_member "$LINENO" "struct sigaction" "sa_sigaction" "ac_cv_member_struct_sigaction_sa_sigaction" "#include <signal.h>
+"
+if test "x$ac_cv_member_struct_sigaction_sa_sigaction" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_SIGACTION_SA_SIGACTION 1" >>confdefs.h
+
+
+fi
+
+    if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then
+      HAVE_STRUCT_SIGACTION_SA_SIGACTION=0
+    fi
+  else
+    HAVE_SIGACTION=0
+  fi
+
+  if test $HAVE_SIGACTION = 0; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS sigaction.$ac_objext"
+
+
+
+
+
+
+
+  ac_fn_c_check_type "$LINENO" "siginfo_t" "ac_cv_type_siginfo_t" "
+#include <signal.h>
+
+"
+if test "x$ac_cv_type_siginfo_t" = xyes
+then :
+
+printf "%s\n" "#define HAVE_SIGINFO_T 1" >>confdefs.h
+
+
+fi
+
+  if test $ac_cv_type_siginfo_t = no; then
+    HAVE_SIGINFO_T=0
+  fi
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_SIGACTION=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SIGACTION 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for signbit macro" >&5
+printf %s "checking for signbit macro... " >&6; }
+if test ${gl_cv_func_signbit+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                          # Guess yes on glibc systems.
+           *-gnu* | gnu*) gl_cv_func_signbit="guessing yes" ;;
+                          # Guess yes on musl systems.
+           *-musl*)       gl_cv_func_signbit="guessing yes" ;;
+                          # Guess yes on native Windows.
+           mingw*)        gl_cv_func_signbit="guessing yes" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+           *)             gl_cv_func_signbit="$gl_cross_guess_normal" ;;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <math.h>
+/* If signbit is defined as a function, don't use it, since calling it for
+   'float' or 'long double' arguments would involve conversions.
+   If signbit is not declared at all but exists as a library function, don't
+   use it, since the prototype may not match.
+   If signbit is not declared at all but exists as a compiler built-in, don't
+   use it, since it's preferable to use __builtin_signbit* (no warnings,
+   no conversions).  */
+#ifndef signbit
+# error "signbit should be a macro"
+#endif
+#include <string.h>
+
+/* Global variables.
+   Needed because GCC 4 constant-folds __builtin_signbitl (literal)
+   but cannot constant-fold            __builtin_signbitl (variable).  */
+float vf;
+double vd;
+long double vl;
+int main ()
+{
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
+   So we use -p0f and -p0d instead.  */
+float p0f = 0.0f;
+float m0f = -p0f;
+double p0d = 0.0;
+double m0d = -p0d;
+/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
+   So we use another constant expression instead.
+   But that expression does not work on other platforms, such as when
+   cross-compiling to PowerPC on Mac OS X 10.5.  */
+long double p0l = 0.0L;
+#if defined __hpux || defined __sgi
+long double m0l = -LDBL_MIN * LDBL_MIN;
+#else
+long double m0l = -p0l;
+#endif
+  int result = 0;
+  if (signbit (vf)) /* link check */
+    vf++;
+  {
+    float plus_inf = 1.0f / p0f;
+    float minus_inf = -1.0f / p0f;
+    if (!(!signbit (255.0f)
+          && signbit (-255.0f)
+          && !signbit (p0f)
+          && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
+          && !signbit (plus_inf)
+          && signbit (minus_inf)))
+      result |= 1;
+  }
+  if (signbit (vd)) /* link check */
+    vd++;
+  {
+    double plus_inf = 1.0 / p0d;
+    double minus_inf = -1.0 / p0d;
+    if (!(!signbit (255.0)
+          && signbit (-255.0)
+          && !signbit (p0d)
+          && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
+          && !signbit (plus_inf)
+          && signbit (minus_inf)))
+      result |= 2;
+  }
+  if (signbit (vl)) /* link check */
+    vl++;
+  {
+    long double plus_inf = 1.0L / p0l;
+    long double minus_inf = -1.0L / p0l;
+    if (signbit (255.0L))
+      result |= 4;
+    if (!signbit (-255.0L))
+      result |= 4;
+    if (signbit (p0l))
+      result |= 8;
+    if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
+      result |= 16;
+    if (signbit (plus_inf))
+      result |= 32;
+    if (!signbit (minus_inf))
+      result |= 64;
+  }
+  return result;
+}
+
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_signbit=yes
+else $as_nop
+  gl_cv_func_signbit=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit" >&5
+printf "%s\n" "$gl_cv_func_signbit" >&6; }
+          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for signbit compiler built-ins" >&5
+printf %s "checking for signbit compiler built-ins... " >&6; }
+if test ${gl_cv_func_signbit_builtins+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                          # Guess yes on glibc systems.
+           *-gnu* | gnu*) gl_cv_func_signbit_builtins="guessing yes" ;;
+                          # Guess yes on musl systems.
+           *-musl*)       gl_cv_func_signbit_builtins="guessing yes" ;;
+                          # Guess yes on mingw, no on MSVC.
+           mingw*)        if test -n "$GCC"; then
+                            gl_cv_func_signbit_builtins="guessing yes"
+                          else
+                            gl_cv_func_signbit_builtins="guessing no"
+                          fi
+                          ;;
+                          # If we don't know, obey --enable-cross-guesses.
+           *)             gl_cv_func_signbit_builtins="$gl_cross_guess_normal" ;;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+# define signbit(x) \
+   (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
+    sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
+    __builtin_signbitf (x))
+#else
+# error "signbit should be three compiler built-ins"
+#endif
+#include <string.h>
+
+/* Global variables.
+   Needed because GCC 4 constant-folds __builtin_signbitl (literal)
+   but cannot constant-fold            __builtin_signbitl (variable).  */
+float vf;
+double vd;
+long double vl;
+int main ()
+{
+/* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
+   So we use -p0f and -p0d instead.  */
+float p0f = 0.0f;
+float m0f = -p0f;
+double p0d = 0.0;
+double m0d = -p0d;
+/* On HP-UX 10.20, negating 0.0L does not yield -0.0L.
+   So we use another constant expression instead.
+   But that expression does not work on other platforms, such as when
+   cross-compiling to PowerPC on Mac OS X 10.5.  */
+long double p0l = 0.0L;
+#if defined __hpux || defined __sgi
+long double m0l = -LDBL_MIN * LDBL_MIN;
+#else
+long double m0l = -p0l;
+#endif
+  int result = 0;
+  if (signbit (vf)) /* link check */
+    vf++;
+  {
+    float plus_inf = 1.0f / p0f;
+    float minus_inf = -1.0f / p0f;
+    if (!(!signbit (255.0f)
+          && signbit (-255.0f)
+          && !signbit (p0f)
+          && (memcmp (&m0f, &p0f, sizeof (float)) == 0 || signbit (m0f))
+          && !signbit (plus_inf)
+          && signbit (minus_inf)))
+      result |= 1;
+  }
+  if (signbit (vd)) /* link check */
+    vd++;
+  {
+    double plus_inf = 1.0 / p0d;
+    double minus_inf = -1.0 / p0d;
+    if (!(!signbit (255.0)
+          && signbit (-255.0)
+          && !signbit (p0d)
+          && (memcmp (&m0d, &p0d, sizeof (double)) == 0 || signbit (m0d))
+          && !signbit (plus_inf)
+          && signbit (minus_inf)))
+      result |= 2;
+  }
+  if (signbit (vl)) /* link check */
+    vl++;
+  {
+    long double plus_inf = 1.0L / p0l;
+    long double minus_inf = -1.0L / p0l;
+    if (signbit (255.0L))
+      result |= 4;
+    if (!signbit (-255.0L))
+      result |= 4;
+    if (signbit (p0l))
+      result |= 8;
+    if (!(memcmp (&m0l, &p0l, sizeof (long double)) == 0 || signbit (m0l)))
+      result |= 16;
+    if (signbit (plus_inf))
+      result |= 32;
+    if (!signbit (minus_inf))
+      result |= 64;
+  }
+  return result;
+}
+
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_signbit_builtins=yes
+else $as_nop
+  gl_cv_func_signbit_builtins=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_signbit_builtins" >&5
+printf "%s\n" "$gl_cv_func_signbit_builtins" >&6; }
+      case "$gl_cv_func_signbit_builtins" in
+    *yes)
+      REPLACE_SIGNBIT_USING_BUILTINS=1
+      ;;
+    *)
+      case "$gl_cv_func_signbit" in
+        *yes) ;;
+        *)
+                    REPLACE_SIGNBIT=1
+          ;;
+      esac
+      ;;
+  esac
+          case "$host_os" in
+    solaris*)
+      REPLACE_SIGNBIT=1
+      ;;
+  esac
+  if test $REPLACE_SIGNBIT = 1; then
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'float'" >&5
+printf %s "checking where to find the sign bit in a 'float'... " >&6; }
+if test ${gl_cv_cc_float_signbit+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+                              gl_cv_cc_float_signbit="unknown"
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stddef.h>
+#include <stdio.h>
+#define NWORDS \
+  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { float value; unsigned int word[NWORDS]; }
+        memory_float;
+static memory_float plus = { 1.0f };
+static memory_float minus = { -1.0f };
+int main ()
+{
+  size_t j, k, i;
+  unsigned int m;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  /* Find the different bit.  */
+  k = 0; m = 0;
+  for (j = 0; j < NWORDS; j++)
+    {
+      unsigned int x = plus.word[j] ^ minus.word[j];
+      if ((x & (x - 1)) || (x && m))
+        {
+          /* More than one bit difference.  */
+          fprintf (fp, "unknown");
+          fclose (fp);
+          return 2;
+        }
+      if (x)
+        {
+          k = j;
+          m = x;
+        }
+    }
+  if (m == 0)
+    {
+      /* No difference.  */
+      fprintf (fp, "unknown");
+      fclose (fp);
+      return 3;
+    }
+  /* Now m = plus.word[k] ^ ~minus.word[k].  */
+  if (plus.word[k] & ~minus.word[k])
+    {
+      /* Oh? The sign bit is set in the positive and cleared in the negative
+         numbers?  */
+      fprintf (fp, "unknown");
+      fclose (fp);
+      return 4;
+    }
+  for (i = 0; ; i++)
+    if ((m >> i) & 1)
+      break;
+  fprintf (fp, "word %d bit %d", (int) k, (int) i);
+  if (fclose (fp) != 0)
+    return 5;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_cc_float_signbit=`cat conftest.out`
+else $as_nop
+  gl_cv_cc_float_signbit="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      rm -f conftest.out
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_signbit" >&5
+printf "%s\n" "$gl_cv_cc_float_signbit" >&6; }
+  case "$gl_cv_cc_float_signbit" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_float_signbit" | sed -e 's/word.*bit //'`
+
+printf "%s\n" "#define FLT_SIGNBIT_WORD $word" >>confdefs.h
+
+
+printf "%s\n" "#define FLT_SIGNBIT_BIT $bit" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'double'" >&5
+printf %s "checking where to find the sign bit in a 'double'... " >&6; }
+if test ${gl_cv_cc_double_signbit+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+                              gl_cv_cc_double_signbit="unknown"
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stddef.h>
+#include <stdio.h>
+#define NWORDS \
+  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { double value; unsigned int word[NWORDS]; }
+        memory_float;
+static memory_float plus = { 1.0 };
+static memory_float minus = { -1.0 };
+int main ()
+{
+  size_t j, k, i;
+  unsigned int m;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  /* Find the different bit.  */
+  k = 0; m = 0;
+  for (j = 0; j < NWORDS; j++)
+    {
+      unsigned int x = plus.word[j] ^ minus.word[j];
+      if ((x & (x - 1)) || (x && m))
+        {
+          /* More than one bit difference.  */
+          fprintf (fp, "unknown");
+          fclose (fp);
+          return 2;
+        }
+      if (x)
+        {
+          k = j;
+          m = x;
+        }
+    }
+  if (m == 0)
+    {
+      /* No difference.  */
+      fprintf (fp, "unknown");
+      fclose (fp);
+      return 3;
+    }
+  /* Now m = plus.word[k] ^ ~minus.word[k].  */
+  if (plus.word[k] & ~minus.word[k])
+    {
+      /* Oh? The sign bit is set in the positive and cleared in the negative
+         numbers?  */
+      fprintf (fp, "unknown");
+      fclose (fp);
+      return 4;
+    }
+  for (i = 0; ; i++)
+    if ((m >> i) & 1)
+      break;
+  fprintf (fp, "word %d bit %d", (int) k, (int) i);
+  if (fclose (fp) != 0)
+    return 5;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_cc_double_signbit=`cat conftest.out`
+else $as_nop
+  gl_cv_cc_double_signbit="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      rm -f conftest.out
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_signbit" >&5
+printf "%s\n" "$gl_cv_cc_double_signbit" >&6; }
+  case "$gl_cv_cc_double_signbit" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_double_signbit" | sed -e 's/word.*bit //'`
+
+printf "%s\n" "#define DBL_SIGNBIT_WORD $word" >>confdefs.h
+
+
+printf "%s\n" "#define DBL_SIGNBIT_BIT $bit" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the sign bit in a 'long double'" >&5
+printf %s "checking where to find the sign bit in a 'long double'... " >&6; }
+if test ${gl_cv_cc_long_double_signbit+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+                              gl_cv_cc_long_double_signbit="unknown"
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stddef.h>
+#include <stdio.h>
+#define NWORDS \
+  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { long double value; unsigned int word[NWORDS]; }
+        memory_float;
+static memory_float plus = { 1.0L };
+static memory_float minus = { -1.0L };
+int main ()
+{
+  size_t j, k, i;
+  unsigned int m;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  /* Find the different bit.  */
+  k = 0; m = 0;
+  for (j = 0; j < NWORDS; j++)
+    {
+      unsigned int x = plus.word[j] ^ minus.word[j];
+      if ((x & (x - 1)) || (x && m))
+        {
+          /* More than one bit difference.  */
+          fprintf (fp, "unknown");
+          fclose (fp);
+          return 2;
+        }
+      if (x)
+        {
+          k = j;
+          m = x;
+        }
+    }
+  if (m == 0)
+    {
+      /* No difference.  */
+      fprintf (fp, "unknown");
+      fclose (fp);
+      return 3;
+    }
+  /* Now m = plus.word[k] ^ ~minus.word[k].  */
+  if (plus.word[k] & ~minus.word[k])
+    {
+      /* Oh? The sign bit is set in the positive and cleared in the negative
+         numbers?  */
+      fprintf (fp, "unknown");
+      fclose (fp);
+      return 4;
+    }
+  for (i = 0; ; i++)
+    if ((m >> i) & 1)
+      break;
+  fprintf (fp, "word %d bit %d", (int) k, (int) i);
+  if (fclose (fp) != 0)
+    return 5;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_cc_long_double_signbit=`cat conftest.out`
+else $as_nop
+  gl_cv_cc_long_double_signbit="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      rm -f conftest.out
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_signbit" >&5
+printf "%s\n" "$gl_cv_cc_long_double_signbit" >&6; }
+  case "$gl_cv_cc_long_double_signbit" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_long_double_signbit" | sed -e 's/word.*bit //'`
+
+printf "%s\n" "#define LDBL_SIGNBIT_WORD $word" >>confdefs.h
+
+
+printf "%s\n" "#define LDBL_SIGNBIT_BIT $bit" >>confdefs.h
+
+      ;;
+  esac
+
+
+    if test "$gl_cv_cc_float_signbit" = unknown; then
+            ac_fn_check_decl "$LINENO" "copysignf" "ac_cv_have_decl_copysignf" "#include <math.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_copysignf" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_COPYSIGNF $ac_have_decl" >>confdefs.h
+
+      if test "$ac_cv_have_decl_copysignf" = yes; then
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether copysignf can be used without linking with libm" >&5
+printf %s "checking whether copysignf can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_copysignf_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+                   float x, y;
+int
+main (void)
+{
+return copysignf (x, y) < 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_copysignf_no_libm=yes
+else $as_nop
+  gl_cv_func_copysignf_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignf_no_libm" >&5
+printf "%s\n" "$gl_cv_func_copysignf_no_libm" >&6; }
+        if test $gl_cv_func_copysignf_no_libm = yes; then
+
+printf "%s\n" "#define HAVE_COPYSIGNF_IN_LIBC 1" >>confdefs.h
+
+        fi
+      fi
+    fi
+    if test "$gl_cv_cc_double_signbit" = unknown; then
+            ac_fn_check_decl "$LINENO" "copysign" "ac_cv_have_decl_copysign" "#include <math.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_copysign" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_COPYSIGN $ac_have_decl" >>confdefs.h
+
+      if test "$ac_cv_have_decl_copysign" = yes; then
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether copysign can be used without linking with libm" >&5
+printf %s "checking whether copysign can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_copysign_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+                   double x, y;
+int
+main (void)
+{
+return copysign (x, y) < 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_copysign_no_libm=yes
+else $as_nop
+  gl_cv_func_copysign_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysign_no_libm" >&5
+printf "%s\n" "$gl_cv_func_copysign_no_libm" >&6; }
+        if test $gl_cv_func_copysign_no_libm = yes; then
+
+printf "%s\n" "#define HAVE_COPYSIGN_IN_LIBC 1" >>confdefs.h
+
+        fi
+      fi
+    fi
+    if test "$gl_cv_cc_long_double_signbit" = unknown; then
+            ac_fn_check_decl "$LINENO" "copysignl" "ac_cv_have_decl_copysignl" "#include <math.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_copysignl" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_COPYSIGNL $ac_have_decl" >>confdefs.h
+
+      if test "$ac_cv_have_decl_copysignl" = yes; then
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether copysignl can be used without linking with libm" >&5
+printf %s "checking whether copysignl can be used without linking with libm... " >&6; }
+if test ${gl_cv_func_copysignl_no_libm+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <math.h>
+                   long double x, y;
+int
+main (void)
+{
+return copysignl (x, y) < 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_copysignl_no_libm=yes
+else $as_nop
+  gl_cv_func_copysignl_no_libm=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_copysignl_no_libm" >&5
+printf "%s\n" "$gl_cv_func_copysignl_no_libm" >&6; }
+        if test $gl_cv_func_copysignl_no_libm = yes; then
+
+printf "%s\n" "#define HAVE_COPYSIGNL_IN_LIBC 1" >>confdefs.h
+
+        fi
+      fi
+    fi
+  fi
+
+  if test $REPLACE_SIGNBIT = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS signbitf.$ac_objext"
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS signbitd.$ac_objext"
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS signbitl.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_SIGNBIT=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SIGNBIT 1" >>confdefs.h
+
+
+
+
+
+
+
+
+printf "%s\n" "#define GNULIB_SIGPIPE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+  GL_M4_GNULIB_SIGNAL_H_SIGPIPE=1
+
+
+
+
+
+
+
+
+
+  GL_M4_GNULIB_STDIO_H_SIGPIPE=1
+
+
+
+
+
+
+
+
+  GL_M4_GNULIB_UNISTD_H_SIGPIPE=1
+
+
+
+
+
+  HAVE_POSIX_SIGNALBLOCKING=0
+  if test "$gl_cv_type_sigset_t" = yes; then
+    ac_fn_c_check_func "$LINENO" "sigprocmask" "ac_cv_func_sigprocmask"
+if test "x$ac_cv_func_sigprocmask" = xyes
+then :
+  HAVE_POSIX_SIGNALBLOCKING=1
+fi
+
+  fi
+
+  if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS sigprocmask.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_SIGPROCMASK=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SIGPROCMASK 1" >>confdefs.h
+
+
+
+
+# Check whether --with-libsigsegv was given.
+if test ${with_libsigsegv+y}
+then :
+  withval=$with_libsigsegv;
+fi
+
+  SIGSEGV_H=sigsegv.h
+  if test "$with_libsigsegv" = yes; then
+
+
+
+
+
+
+
+
+
+
+
+
+
+    use_additional=yes
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+    eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+    eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+
+# Check whether --with-libsigsegv-prefix was given.
+if test ${with_libsigsegv_prefix+y}
+then :
+  withval=$with_libsigsegv_prefix;
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+          eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+          eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+        additional_libdir2="$withval/$acl_libdirstem2"
+        additional_libdir3="$withval/$acl_libdirstem3"
+      fi
+    fi
+
+fi
+
+  if test "X$additional_libdir2" = "X$additional_libdir"; then
+    additional_libdir2=
+  fi
+  if test "X$additional_libdir3" = "X$additional_libdir"; then
+    additional_libdir3=
+  fi
+      LIBSIGSEGV=
+  LTLIBSIGSEGV=
+  INCSIGSEGV=
+  LIBSIGSEGV_PREFIX=
+      HAVE_LIBSIGSEGV=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='sigsegv '
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$value"
+          else
+                                    :
+          fi
+        else
+                              found_dir=
+          found_la=
+          found_so=
+          found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
+          else
+            shrext=
+          fi
+          if test $use_additional = yes; then
+            for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+              if test "X$found_dir" = "X"; then
+                eval dir=\$$additional_libdir_variable
+                if test -n "$dir"; then
+                                                      if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
+                fi
+              fi
+            done
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIBSIGSEGV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                                    if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+                        LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+                                                        if test "$enable_rpath" = no \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
+                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+              else
+                                                                                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                                if test "$acl_hardcode_direct" = yes; then
+                                                      LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+                else
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+                                                            LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+                                                            haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                                                                                haveit=
+                    for x in $LDFLAGS $LIBSIGSEGV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir"
+                    fi
+                    if test "$acl_hardcode_minus_L" != no; then
+                                                                                        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_so"
+                    else
+                                                                                                                                                                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
+            else
+              if test "X$found_a" != "X"; then
+                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$found_a"
+              else
+                                                LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$found_dir -l$name"
+              fi
+            fi
+                        additional_includedir=
+            case "$found_dir" in
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                if test "$name" = 'sigsegv'; then
+                  LIBSIGSEGV_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem2 | */$acl_libdirstem2/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+                if test "$name" = 'sigsegv'; then
+                  LIBSIGSEGV_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem3 | */$acl_libdirstem3/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+                if test "$name" = 'sigsegv'; then
+                  LIBSIGSEGV_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INCSIGSEGV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                                            INCSIGSEGV="${INCSIGSEGV}${INCSIGSEGV:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+                        if test -n "$found_la"; then
+                                                        save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+                            for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
+                      haveit=
+                      if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIBSIGSEGV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$dependency_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$dependency_libdir"; then
+                                                        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-L$dependency_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIBSIGSEGV; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$dependency_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$dependency_libdir"; then
+                                                        LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-L$dependency_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                                                                  haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                                                                  haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                                                                                                                                                                dep=`echo "X$dep" | sed -e 's/^X-l//'`
+                    if test "X$dep" != Xc \
+                       || case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) false ;;
+                            *)                          true ;;
+                          esac; then
+                      names_next_round="$names_next_round $dep"
+                    fi
+                    ;;
+                  *.la)
+                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                                        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$dep"
+                    LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+                                                            LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }-l$name"
+            LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
+                        alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+      done
+            acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag"
+    else
+            for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIBSIGSEGV="${LIBSIGSEGV}${LIBSIGSEGV:+ }$flag"
+      done
+    fi
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+            for found_dir in $ltrpathdirs; do
+      LTLIBSIGSEGV="${LTLIBSIGSEGV}${LTLIBSIGSEGV:+ }-R$found_dir"
+    done
+  fi
+
+
+
+
+
+
+        ac_save_CPPFLAGS="$CPPFLAGS"
+
+  for element in $INCSIGSEGV; do
+    haveit=
+    for x in $CPPFLAGS; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+    fi
+  done
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libsigsegv" >&5
+printf %s "checking for libsigsegv... " >&6; }
+if test ${ac_cv_libsigsegv+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    ac_save_LIBS="$LIBS"
+                                case " $LIBSIGSEGV" in
+      *" -l"*) LIBS="$LIBS $LIBSIGSEGV" ;;
+      *)       LIBS="$LIBSIGSEGV $LIBS" ;;
+    esac
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sigsegv.h>
+int
+main (void)
+{
+sigsegv_deinstall_handler();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_libsigsegv=yes
+else $as_nop
+  ac_cv_libsigsegv='no, consider installing GNU libsigsegv'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+    LIBS="$ac_save_LIBS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_libsigsegv" >&5
+printf "%s\n" "$ac_cv_libsigsegv" >&6; }
+  if test "$ac_cv_libsigsegv" = yes; then
+    HAVE_LIBSIGSEGV=yes
+
+printf "%s\n" "#define HAVE_LIBSIGSEGV 1" >>confdefs.h
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libsigsegv" >&5
+printf %s "checking how to link with libsigsegv... " >&6; }
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBSIGSEGV" >&5
+printf "%s\n" "$LIBSIGSEGV" >&6; }
+  else
+    HAVE_LIBSIGSEGV=no
+            CPPFLAGS="$ac_save_CPPFLAGS"
+    LIBSIGSEGV=
+    LTLIBSIGSEGV=
+    LIBSIGSEGV_PREFIX=
+  fi
+
+
+
+
+
+
+
+    gl_cv_lib_sigsegv="$ac_cv_libsigsegv"
+
+    if test "$gl_cv_lib_sigsegv" = yes; then
+      SIGSEGV_H=
+    fi
+  fi
+
+   if test -n "$SIGSEGV_H"; then
+  GL_GENERATE_SIGSEGV_H_TRUE=
+  GL_GENERATE_SIGSEGV_H_FALSE='#'
+else
+  GL_GENERATE_SIGSEGV_H_TRUE='#'
+  GL_GENERATE_SIGSEGV_H_FALSE=
+fi
+
+  if test -n "$SIGSEGV_H"; then
+
+
+    case "$host_os" in
+      solaris2.11)
+
+printf "%s\n" "#define SOLARIS11 1" >>confdefs.h
+
+        ;;
+    esac
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stack direction" >&5
+printf %s "checking for stack direction... " >&6; }
+if test ${sv_cv_stack_direction_msg+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    case "$host_cpu" in
+            a29k | \
+      aarch64* | \
+      alpha* | \
+      arc | \
+      arm* | strongarm* | xscale* | \
+      avr | avr32 | \
+      bfin | \
+      c1 | c2 | c32 | c34 | c38 | \
+      clipper | \
+      cris | \
+      d30v | \
+      elxsi | \
+      fr30 | \
+      h8300 | \
+      i?86 | x86_64 | \
+      i860 | \
+      ia64 | \
+      m32r | \
+      m68* | \
+      m88k | \
+      mcore | \
+      microblaze | \
+      mips* | \
+      mmix | \
+      mn10200 | \
+      mn10300 | \
+      nios2 | \
+      nds32* | \
+      ns32k | \
+      pdp11 | \
+      pj* | \
+      powerpc* | rs6000 | \
+      riscv* | \
+      romp | \
+      s390* | \
+      sh* | \
+      sparc* | \
+      v850 | \
+      vax | \
+      xtensa)
+        sv_cv_stack_direction=-1 ;;
+      c4x | \
+      dsp16xx | \
+      i960 | \
+      hppa* | parisc* | \
+      stormy16 | \
+      we32k)
+        sv_cv_stack_direction=1 ;;
+      *)
+        if test $cross_compiling = no; then
+          cat > conftest.c <<EOF
+#include <stdio.h>
+int
+find_stack_direction (int *addr, int depth)
+{
+  int dir, dummy = 0;
+  if (! addr)
+    addr = &dummy;
+  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+  return dir + dummy;
+}
+int
+main (int argc, char *argv)
+{
+  printf ("%d\n", find_stack_direction (NULL, argc + 20));
+  return 0;
+}
+EOF
+          { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+          sv_cv_stack_direction=`./conftest`
+        else
+          sv_cv_stack_direction=0
+        fi
+        ;;
+    esac
+    case $sv_cv_stack_direction in
+      1)  sv_cv_stack_direction_msg="grows up";;
+      -1) sv_cv_stack_direction_msg="grows down";;
+      *)  sv_cv_stack_direction_msg="unknown";;
+    esac
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $sv_cv_stack_direction_msg" >&5
+printf "%s\n" "$sv_cv_stack_direction_msg" >&6; }
+
+printf "%s\n" "#define STACK_DIRECTION $sv_cv_stack_direction" >>confdefs.h
+
+
+
+
+
+
+
+
+  if test "$ac_cv_func_sigaltstack" = yes; then
+    ac_fn_c_check_type "$LINENO" "stack_t" "ac_cv_type_stack_t" "
+#include <signal.h>
+#if HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#endif
+
+"
+if test "x$ac_cv_type_stack_t" = xyes
+then :
+
+else $as_nop
+
+printf "%s\n" "#define stack_t struct sigaltstack" >>confdefs.h
+
+
+fi
+
+  fi
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working sigaltstack" >&5
+printf %s "checking for working sigaltstack... " >&6; }
+if test ${sv_cv_sigaltstack+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    if test "$ac_cv_func_sigaltstack" = yes; then
+      case "$host_os" in
+        macos* | darwin[6-9]* | darwin[1-9][0-9]*)
+          # On MacOS X 10.2 or newer, just assume that if it compiles, it will
+          # work. If we were to perform the real test, 1 Crash Report dialog
+          # window would pop up.
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+            #include <signal.h>
+int
+main (void)
+{
+int x = SA_ONSTACK; stack_t ss; sigaltstack ((stack_t*)0, &ss);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  sv_cv_sigaltstack="guessing yes"
+else $as_nop
+  sv_cv_sigaltstack=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+          ;;
+        *)
+          if test "$cross_compiling" = yes
+then :
+
+                            case "$host_os" in
+                *)
+                  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+                    #include <signal.h>
+int
+main (void)
+{
+int x = SA_ONSTACK; stack_t ss; sigaltstack ((stack_t*)0, &ss);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  sv_cv_sigaltstack="guessing yes"
+else $as_nop
+  sv_cv_sigaltstack=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+                  ;;
+              esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+#include <stdlib.h>
+#include <signal.h>
+#if HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#endif
+#if HAVE_SETRLIMIT
+# include <sys/types.h>
+# include <sys/time.h>
+# include <sys/resource.h>
+#endif
+void stackoverflow_handler (int sig)
+{
+  /* If we get here, the stack overflow was caught.  */
+  exit (0);
+}
+volatile int * recurse_1 (volatile int n, volatile int *p)
+{
+  if (n >= 0)
+    *recurse_1 (n + 1, p) += n;
+  return p;
+}
+int recurse (volatile int n)
+{
+  int sum = 0;
+  return *recurse_1 (n, &sum);
+}
+char mystack[2 * (1 << 24)];
+int main ()
+{
+  stack_t altstack;
+  struct sigaction action;
+#if defined HAVE_SETRLIMIT && defined RLIMIT_STACK
+  /* Before starting the endless recursion, try to be friendly to the user's
+     machine.  On some Linux 2.2.x systems, there is no stack limit for user
+     processes at all.  We don't want to kill such systems.  */
+  struct rlimit rl;
+  rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+  setrlimit (RLIMIT_STACK, &rl);
+#endif
+  /* Install the alternate stack.  Use the midpoint of mystack, to guard
+     against a buggy interpretation of ss_sp on IRIX.  */
+#ifdef SIGSTKSZ
+  if (sizeof mystack / 2 < SIGSTKSZ)
+    exit (3);
+#endif
+  altstack.ss_sp = mystack + sizeof mystack / 2;
+  altstack.ss_size = sizeof mystack / 2;
+  altstack.ss_flags = 0; /* no SS_DISABLE */
+  if (sigaltstack (&altstack, NULL) < 0)
+    exit (1);
+  /* Install the SIGSEGV handler.  */
+  sigemptyset (&action.sa_mask);
+  action.sa_handler = &stackoverflow_handler;
+  action.sa_flags = SA_ONSTACK;
+  sigaction (SIGSEGV, &action, (struct sigaction *) NULL);
+  sigaction (SIGBUS, &action, (struct sigaction *) NULL);
+  /* Provoke a stack overflow.  */
+  recurse (0);
+  exit (2);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  sv_cv_sigaltstack=yes
+else $as_nop
+  sv_cv_sigaltstack=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+          ;;
+      esac
+    else
+      sv_cv_sigaltstack=no
+    fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $sv_cv_sigaltstack" >&5
+printf "%s\n" "$sv_cv_sigaltstack" >&6; }
+  if test "$sv_cv_sigaltstack" != no; then
+
+printf "%s\n" "#define HAVE_WORKING_SIGALTSTACK 1" >>confdefs.h
+
+
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for correct stack_t interpretation" >&5
+printf %s "checking for correct stack_t interpretation... " >&6; }
+if test ${sv_cv_sigaltstack_low_base+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+                case "$host_os" in
+          irix5*) sv_cv_sigaltstack_low_base="no" ;;
+          *)      sv_cv_sigaltstack_low_base="guessing yes" ;;
+        esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+
+#include <stdlib.h>
+#include <signal.h>
+#if HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#endif
+volatile char *stack_lower_bound;
+volatile char *stack_upper_bound;
+static void check_stack_location (volatile char *addr)
+{
+  if (addr >= stack_lower_bound && addr <= stack_upper_bound)
+    exit (0);
+  else
+    exit (1);
+}
+static void stackoverflow_handler (int sig)
+{
+  char dummy;
+  check_stack_location (&dummy);
+}
+char mystack[2 * (1 << 24)];
+int main ()
+{
+  stack_t altstack;
+  struct sigaction action;
+  /* Install the alternate stack.  */
+  altstack.ss_sp = mystack + sizeof mystack / 2;
+  altstack.ss_size = sizeof mystack / 2;
+  stack_lower_bound = (char *) altstack.ss_sp;
+  stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1;
+  altstack.ss_flags = 0; /* no SS_DISABLE */
+  if (sigaltstack (&altstack, NULL) < 0)
+    exit (2);
+  /* Install the SIGSEGV handler.  */
+  sigemptyset (&action.sa_mask);
+  action.sa_handler = &stackoverflow_handler;
+  action.sa_flags = SA_ONSTACK;
+  if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0)
+    exit(3);
+  /* Provoke a SIGSEGV.  */
+  raise (SIGSEGV);
+  exit (3);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  sv_cv_sigaltstack_low_base=yes
+else $as_nop
+  sv_cv_sigaltstack_low_base=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $sv_cv_sigaltstack_low_base" >&5
+printf "%s\n" "$sv_cv_sigaltstack_low_base" >&6; }
+    if test "$sv_cv_sigaltstack_low_base" = no; then
+
+printf "%s\n" "#define SIGALTSTACK_SS_REVERSED 1" >>confdefs.h
+
+    fi
+  fi
+
+
+  fi
+
+  ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdint_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h
+
+fi
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for SIZE_MAX" >&5
+printf %s "checking for SIZE_MAX... " >&6; }
+if test ${gl_cv_size_max+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    gl_cv_size_max=no
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <limits.h>
+#if HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#ifdef SIZE_MAX
+Found it
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Found it" >/dev/null 2>&1
+then :
+  gl_cv_size_max=yes
+fi
+rm -rf conftest*
+
+    if test $gl_cv_size_max != yes; then
+                        if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) * CHAR_BIT - 1" "size_t_bits_minus_1"        "#include <stddef.h>
+#include <limits.h>"
+then :
+
+else $as_nop
+  size_t_bits_minus_1=
+fi
+
+      if ac_fn_c_compute_int "$LINENO" "sizeof (size_t) <= sizeof (unsigned int)" "fits_in_uint"        "#include <stddef.h>"
+then :
+
+else $as_nop
+  fits_in_uint=
+fi
+
+      if test -n "$size_t_bits_minus_1" && test -n "$fits_in_uint"; then
+        if test $fits_in_uint = 1; then
+                              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stddef.h>
+                 extern size_t foo;
+                 extern unsigned long foo;
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  fits_in_uint=0
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+        fi
+                                if test $fits_in_uint = 1; then
+          gl_cv_size_max="(((1U << $size_t_bits_minus_1) - 1) * 2 + 1)"
+        else
+          gl_cv_size_max="(((1UL << $size_t_bits_minus_1) - 1) * 2 + 1)"
+        fi
+      else
+                gl_cv_size_max='((size_t)~(size_t)0)'
+      fi
+    fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_size_max" >&5
+printf "%s\n" "$gl_cv_size_max" >&6; }
+  if test "$gl_cv_size_max" != yes; then
+
+printf "%s\n" "#define SIZE_MAX $gl_cv_size_max" >>confdefs.h
+
+  fi
+
+
+
+
+  gl_cv_func_snprintf_usable=no
+  ac_fn_c_check_func "$LINENO" "snprintf" "ac_cv_func_snprintf"
+if test "x$ac_cv_func_snprintf" = xyes
+then :
+  printf "%s\n" "#define HAVE_SNPRINTF 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_snprintf = yes; then
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether snprintf respects a size of 1" >&5
+printf %s "checking whether snprintf respects a size of 1... " >&6; }
+if test ${gl_cv_func_snprintf_size1+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                            # Guess yes on Android.
+           linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;;
+                            # Guess yes on native Windows.
+           mingw*)          gl_cv_func_snprintf_size1="guessing yes" ;;
+           *)               gl_cv_func_snprintf_size1="guessing yes" ;;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#if HAVE_SNPRINTF
+# define my_snprintf snprintf
+#else
+# include <stdarg.h>
+static int my_snprintf (char *buf, int size, const char *format, ...)
+{
+  va_list args;
+  int ret;
+  va_start (args, format);
+  ret = vsnprintf (buf, size, format, args);
+  va_end (args);
+  return ret;
+}
+#endif
+int main()
+{
+  static char buf[8] = { 'D', 'E', 'A', 'D', 'B', 'E', 'E', 'F' };
+  my_snprintf (buf, 1, "%d", 12345);
+  return buf[1] != 'E';
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_snprintf_size1=yes
+else $as_nop
+  gl_cv_func_snprintf_size1=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_snprintf_size1" >&5
+printf "%s\n" "$gl_cv_func_snprintf_size1" >&6; }
+
+    case "$gl_cv_func_snprintf_size1" in
+      *yes)
+
+        case "$gl_cv_func_snprintf_retval_c99" in
+          *yes)
+
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether printf supports POSIX/XSI format strings with positions" >&5
+printf %s "checking whether printf supports POSIX/XSI format strings with positions... " >&6; }
+if test ${gl_cv_func_printf_positions+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+         case "$host_os" in
+           netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
+                            gl_cv_func_printf_positions="guessing no";;
+           beos*)           gl_cv_func_printf_positions="guessing no";;
+                            # Guess yes on Android.
+           linux*-android*) gl_cv_func_printf_positions="guessing yes";;
+                            # Guess no on native Windows.
+           mingw* | pw*)    gl_cv_func_printf_positions="guessing no";;
+           *)               gl_cv_func_printf_positions="guessing yes";;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <string.h>
+/* The string "%2$d %1$d", with dollar characters protected from the shell's
+   dollar expansion (possibly an autoconf bug).  */
+static char format[] = { '%', '2', '$', 'd', ' ', '%', '1', '$', 'd', '\0' };
+static char buf[100];
+int main ()
+{
+  sprintf (buf, format, 33, 55);
+  return (strcmp (buf, "55 33") != 0);
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_printf_positions=yes
+else $as_nop
+  gl_cv_func_printf_positions=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_printf_positions" >&5
+printf "%s\n" "$gl_cv_func_printf_positions" >&6; }
+
+            case "$gl_cv_func_printf_positions" in
+              *yes)
+                gl_cv_func_snprintf_usable=yes
+                ;;
+            esac
+            ;;
+        esac
+        ;;
+    esac
+  fi
+  if test $gl_cv_func_snprintf_usable = no; then
+
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS snprintf.$ac_objext"
+
+  if test $ac_cv_func_snprintf = yes; then
+    REPLACE_SNPRINTF=1
+  else
+
+    if test $ac_cv_have_decl_snprintf = yes; then
+                        REPLACE_SNPRINTF=1
+    fi
+  fi
+  :
+
+  fi
+
+  if test $ac_cv_have_decl_snprintf = no; then
+    HAVE_DECL_SNPRINTF=0
+  fi
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_SNPRINTF=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SNPRINTF 1" >>confdefs.h
+
+
+
+
+
+printf "%s\n" "#define GNULIB_SNPRINTF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+  case "$host_os" in
+    os2*)
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS os2-spawn.$ac_objext"
+
+      ;;
+  esac
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ssize_t" >&5
+printf %s "checking for ssize_t... " >&6; }
+if test ${gt_cv_ssize_t+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+int
+main (void)
+{
+int x = sizeof (ssize_t *) + sizeof (ssize_t);
+            return !x;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gt_cv_ssize_t=yes
+else $as_nop
+  gt_cv_ssize_t=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_ssize_t" >&5
+printf "%s\n" "$gt_cv_ssize_t" >&6; }
+  if test $gt_cv_ssize_t = no; then
+
+printf "%s\n" "#define ssize_t int" >>confdefs.h
+
+  fi
+
+
+
+
+
+  case "$host_os" in
+    mingw*)
+                  REPLACE_STAT=1
+      ;;
+    *)
+                        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether stat handles trailing slashes on files" >&5
+printf %s "checking whether stat handles trailing slashes on files... " >&6; }
+if test ${gl_cv_func_stat_file_slash+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  touch conftest.tmp
+         # Assume that if we have lstat, we can also check symlinks.
+         if test $ac_cv_func_lstat = yes; then
+           ln -s conftest.tmp conftest.lnk
+         fi
+         if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                               # Guess yes on Linux systems.
+              linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+                               # Guess yes on glibc systems.
+              *-gnu* | gnu*)   gl_cv_func_stat_file_slash="guessing yes" ;;
+                               # If we don't know, obey --enable-cross-guesses.
+              *)               gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
+            esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/stat.h>
+
+int
+main (void)
+{
+int result = 0;
+               struct stat st;
+               if (!stat ("conftest.tmp/", &st))
+                 result |= 1;
+#if HAVE_LSTAT
+               if (!stat ("conftest.lnk/", &st))
+                 result |= 2;
+#endif
+               return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_stat_file_slash=yes
+else $as_nop
+  gl_cv_func_stat_file_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+         rm -f conftest.tmp conftest.lnk
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_stat_file_slash" >&5
+printf "%s\n" "$gl_cv_func_stat_file_slash" >&6; }
+      case $gl_cv_func_stat_file_slash in
+        *no)
+          REPLACE_STAT=1
+
+printf "%s\n" "#define REPLACE_FUNC_STAT_FILE 1" >>confdefs.h
+;;
+      esac
+      case $host_os in
+                solaris*)
+          REPLACE_FSTAT=1 ;;
+      esac
+      ;;
+  esac
+
+  if test $REPLACE_STAT = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS stat.$ac_objext"
+
+    case "$host_os" in
+      mingw*)
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS stat-w32.$ac_objext"
+
+        ;;
+    esac
+
+
+
+  :
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_STAT=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STAT 1" >>confdefs.h
+
+
+
+
+
+
+
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.tv_nsec" "ac_cv_member_struct_stat_st_atim_tv_nsec" "#include <sys/types.h>
+     #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atim_tv_nsec" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC 1" >>confdefs.h
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether struct stat.st_atim is of type struct timespec" >&5
+printf %s "checking whether struct stat.st_atim is of type struct timespec... " >&6; }
+if test ${ac_cv_typeof_struct_stat_st_atim_is_struct_timespec+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+            #include <sys/types.h>
+            #include <sys/stat.h>
+            #if HAVE_SYS_TIME_H
+            # include <sys/time.h>
+            #endif
+            #include <time.h>
+            struct timespec ts;
+            struct stat st;
+
+int
+main (void)
+{
+
+            st.st_atim = ts;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes
+else $as_nop
+  ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&5
+printf "%s\n" "$ac_cv_typeof_struct_stat_st_atim_is_struct_timespec" >&6; }
+     if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+
+printf "%s\n" "#define TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC 1" >>confdefs.h
+
+     fi
+else $as_nop
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_atimespec.tv_nsec" "ac_cv_member_struct_stat_st_atimespec_tv_nsec" "#include <sys/types.h>
+        #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atimespec_tv_nsec" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC 1" >>confdefs.h
+
+
+else $as_nop
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_atimensec" "ac_cv_member_struct_stat_st_atimensec" "#include <sys/types.h>
+           #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atimensec" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIMENSEC 1" >>confdefs.h
+
+
+else $as_nop
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_atim.st__tim.tv_nsec" "ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" "#include <sys/types.h>
+              #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_atim_st__tim_tv_nsec" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC 1" >>confdefs.h
+
+
+fi
+
+fi
+
+fi
+
+fi
+
+
+
+
+
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimespec.tv_nsec" "ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" "#include <sys/types.h>
+     #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtimespec_tv_nsec" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1" >>confdefs.h
+
+
+else $as_nop
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtimensec" "ac_cv_member_struct_stat_st_birthtimensec" "#include <sys/types.h>
+        #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtimensec" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC 1" >>confdefs.h
+
+
+else $as_nop
+  ac_fn_c_check_member "$LINENO" "struct stat" "st_birthtim.tv_nsec" "ac_cv_member_struct_stat_st_birthtim_tv_nsec" "#include <sys/types.h>
+          #include <sys/stat.h>
+"
+if test "x$ac_cv_member_struct_stat_st_birthtim_tv_nsec" = xyes
+then :
+
+printf "%s\n" "#define HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC 1" >>confdefs.h
+
+
+fi
+
+fi
+
+fi
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working stdalign.h" >&5
+printf %s "checking for working stdalign.h... " >&6; }
+if test ${gl_cv_header_working_stdalign_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdint.h>
+            #include <stdalign.h>
+            #include <stddef.h>
+
+            /* Test that alignof yields a result consistent with offsetof.
+               This catches GCC bug 52023
+               <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.  */
+            #ifdef __cplusplus
+               template <class t> struct alignof_helper { char a; t b; };
+            # define ao(type) offsetof (alignof_helper<type>, b)
+            #else
+            # define ao(type) offsetof (struct { char a; type b; }, b)
+            #endif
+            char test_double[ao (double) % _Alignof (double) == 0 ? 1 : -1];
+            char test_long[ao (long int) % _Alignof (long int) == 0 ? 1 : -1];
+            char test_alignof[alignof (double) == _Alignof (double) ? 1 : -1];
+
+            /* Test _Alignas only on platforms where gnulib can help.  */
+            #if \
+                ((defined __cplusplus && 201103 <= __cplusplus) \
+                 || (__TINYC__ && defined __attribute__) \
+                 || (defined __APPLE__ && defined __MACH__ \
+                     ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+                     : __GNUC__) \
+                 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+                 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
+                 || 1300 <= _MSC_VER)
+              struct alignas_test { char c; char alignas (8) alignas_8; };
+              char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
+                                ? 1 : -1];
+            #endif
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_working_stdalign_h=yes
+else $as_nop
+  gl_cv_header_working_stdalign_h=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_working_stdalign_h" >&5
+printf "%s\n" "$gl_cv_header_working_stdalign_h" >&6; }
+
+  if test $gl_cv_header_working_stdalign_h = yes; then
+    STDALIGN_H=''
+  else
+    STDALIGN_H='stdalign.h'
+  fi
+
+
+   if test -n "$STDALIGN_H"; then
+  GL_GENERATE_STDALIGN_H_TRUE=
+  GL_GENERATE_STDALIGN_H_FALSE='#'
+else
+  GL_GENERATE_STDALIGN_H_TRUE='#'
+  GL_GENERATE_STDALIGN_H_FALSE=
+fi
+
+
+
+  STDARG_H=''
+  NEXT_STDARG_H='<stdarg.h>'
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for va_copy" >&5
+printf %s "checking for va_copy... " >&6; }
+if test ${gl_cv_func_va_copy+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+int
+main (void)
+{
+
+#ifndef va_copy
+void (*func) (va_list, va_list) = va_copy;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_va_copy=yes
+else $as_nop
+  gl_cv_func_va_copy=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_va_copy" >&5
+printf "%s\n" "$gl_cv_func_va_copy" >&6; }
+  if test $gl_cv_func_va_copy = no; then
+                                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#if defined _AIX && !defined __GNUC__
+        AIX vaccine
+       #endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "vaccine" >/dev/null 2>&1
+then :
+  gl_aixcc=yes
+else $as_nop
+  gl_aixcc=no
+fi
+rm -rf conftest*
+
+    if test $gl_aixcc = yes; then
+            STDARG_H=stdarg.h
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_stdarg_h='<'stdarg.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <stdarg.h>" >&5
+printf %s "checking absolute name of <stdarg.h>... " >&6; }
+if test ${gl_cv_next_stdarg_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'stdarg.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_stdarg_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_stdarg_h
+           gl_cv_next_stdarg_h='"'$gl_header'"'
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_stdarg_h" >&5
+printf "%s\n" "$gl_cv_next_stdarg_h" >&6; }
+     fi
+     NEXT_STDARG_H=$gl_cv_next_stdarg_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='<'stdarg.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_stdarg_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_STDARG_H=$gl_next_as_first_directive
+
+
+
+
+            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"
+      fi
+    else
+
+
+  exec 9>&6 6>/dev/null
+
+    if test ${gl_cv_func___va_copy+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+int
+main (void)
+{
+
+#ifndef __va_copy
+error, bail out
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func___va_copy=yes
+else $as_nop
+  gl_cv_func___va_copy=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+  exec 6>&9 9>&-
+
+
+      if test $gl_cv_func___va_copy = yes; then
+
+printf "%s\n" "#define va_copy __va_copy" >>confdefs.h
+
+      else
+
+
+printf "%s\n" "#define va_copy gl_va_copy" >>confdefs.h
+
+      fi
+    fi
+  fi
+
+   if test -n "$STDARG_H"; then
+  GL_GENERATE_STDARG_H_TRUE=
+  GL_GENERATE_STDARG_H_FALSE='#'
+else
+  GL_GENERATE_STDARG_H_TRUE='#'
+  GL_GENERATE_STDARG_H_FALSE=
+fi
+
+
+
+
+
+
+
+          if test "$ac_cv_header_stdbool_h" = yes; then
+    case "$host_os" in
+      solaris*)
+        if test -z "$GCC"; then
+          STDBOOL_H='stdbool.h'
+        else
+          STDBOOL_H=''
+        fi
+        ;;
+      *)
+        STDBOOL_H=''
+        ;;
+    esac
+  else
+    STDBOOL_H='stdbool.h'
+  fi
+
+   if test -n "$STDBOOL_H"; then
+  GL_GENERATE_STDBOOL_H_TRUE=
+  GL_GENERATE_STDBOOL_H_FALSE='#'
+else
+  GL_GENERATE_STDBOOL_H_TRUE='#'
+  GL_GENERATE_STDBOOL_H_FALSE=
+fi
+
+
+  if test "$ac_cv_type__Bool" = yes; then
+    HAVE__BOOL=1
+  else
+    HAVE__BOOL=0
+  fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_FSCANF=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FSCANF 1" >>confdefs.h
+
+
+
+
+
+printf "%s\n" "#define GNULIB_FSCANF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_SCANF=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SCANF 1" >>confdefs.h
+
+
+
+
+
+printf "%s\n" "#define GNULIB_SCANF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_FGETC=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FGETC 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_GETC=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_GETC 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_GETCHAR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_GETCHAR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_FGETS=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FGETS 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_FREAD=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FREAD 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_FPRINTF=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FPRINTF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_PRINTF=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PRINTF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_VFPRINTF=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_VFPRINTF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_VPRINTF=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_VPRINTF 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_FPUTC=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FPUTC 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_PUTC=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PUTC 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_PUTCHAR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PUTCHAR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_FPUTS=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FPUTS 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_PUTS=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PUTS 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_FWRITE=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FWRITE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  ac_fn_c_check_func "$LINENO" "stpcpy" "ac_cv_func_stpcpy"
+if test "x$ac_cv_func_stpcpy" = xyes
+then :
+  printf "%s\n" "#define HAVE_STPCPY 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_stpcpy = no; then
+    HAVE_STPCPY=0
+  fi
+
+  if test $HAVE_STPCPY = 0; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS stpcpy.$ac_objext"
+
+
+  :
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_STPCPY=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STPCPY 1" >>confdefs.h
+
+
+
+
+
+
+
+  ac_fn_c_check_func "$LINENO" "strchrnul" "ac_cv_func_strchrnul"
+if test "x$ac_cv_func_strchrnul" = xyes
+then :
+  printf "%s\n" "#define HAVE_STRCHRNUL 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_strchrnul = no; then
+    HAVE_STRCHRNUL=0
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strchrnul works" >&5
+printf %s "checking whether strchrnul works... " >&6; }
+if test ${gl_cv_func_strchrnul_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+           cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 9)
+  Lucky user
+ #endif
+#else
+  Lucky user
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Lucky user" >/dev/null 2>&1
+then :
+  gl_cv_func_strchrnul_works="guessing yes"
+else $as_nop
+  gl_cv_func_strchrnul_works="guessing no"
+fi
+rm -rf conftest*
+
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <string.h> /* for strchrnul */
+
+int
+main (void)
+{
+const char *buf = "a";
+      return strchrnul (buf, 'b') != buf + 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_strchrnul_works=yes
+else $as_nop
+  gl_cv_func_strchrnul_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strchrnul_works" >&5
+printf "%s\n" "$gl_cv_func_strchrnul_works" >&6; }
+    case "$gl_cv_func_strchrnul_works" in
+      *yes) ;;
+      *) REPLACE_STRCHRNUL=1 ;;
+    esac
+  fi
+
+  if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS strchrnul.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_STRCHRNUL=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRCHRNUL 1" >>confdefs.h
+
+
+
+
+
+
+  if test $gl_cv_func_malloc_posix != yes; then
+    REPLACE_STRDUP=1
+  fi
+
+  if test $ac_cv_have_decl_strdup = no; then
+    HAVE_DECL_STRDUP=0
+  fi
+
+  if test $REPLACE_STRDUP = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS strdup.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_STRDUP=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRDUP 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+  if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strerror function" >&5
+printf %s "checking for working strerror function... " >&6; }
+if test ${gl_cv_func_working_strerror+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                          # Guess yes on glibc systems.
+           *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+                          # Guess yes on musl systems.
+           *-musl*)       gl_cv_func_working_strerror="guessing yes" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+           *)             gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
+         esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+int
+main (void)
+{
+if (!*strerror (-2)) return 1;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_working_strerror=yes
+else $as_nop
+  gl_cv_func_working_strerror=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strerror" >&5
+printf "%s\n" "$gl_cv_func_working_strerror" >&6; }
+    case "$gl_cv_func_working_strerror" in
+      *yes) ;;
+      *)
+                        REPLACE_STRERROR=1
+        ;;
+    esac
+
+                  case "$gl_cv_func_strerror_r_works" in
+        *no) REPLACE_STRERROR=1 ;;
+      esac
+
+  else
+            REPLACE_STRERROR=1
+  fi
+
+  if test $REPLACE_STRERROR = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS strerror.$ac_objext"
+
+  fi
+
+
+printf "%s\n" "#define GNULIB_STRERROR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_STRERROR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRERROR 1" >>confdefs.h
+
+
+
+
+
+  if test -n "$ERRNO_H" || test $REPLACE_STRERROR_0 = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS strerror-override.$ac_objext"
+
+
+
+
+
+  if test $ac_cv_header_sys_socket_h != yes; then
+                    ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h
+
+fi
+
+  fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+  else
+    HAVE_WINSOCK2_H=0
+  fi
+
+
+  fi
+  if test $gl_cond_libtool = false; then
+    gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV"
+    gl_libdeps="$gl_libdeps $LIBICONV"
+  fi
+
+
+
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_have_decl_strndup = no; then
+    HAVE_DECL_STRNDUP=0
+  fi
+
+  if test $ac_cv_func_strndup = yes; then
+    HAVE_STRNDUP=1
+    # AIX 4.3.3, AIX 5.1 have a function that fails to add the terminating '\0'.
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strndup" >&5
+printf %s "checking for working strndup... " >&6; }
+if test ${gl_cv_func_strndup_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+
+          case $host_os in
+            aix | aix[3-6]*) gl_cv_func_strndup_works="guessing no";;
+            *)               gl_cv_func_strndup_works="guessing yes";;
+          esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+         #include <string.h>
+                           #include <stdlib.h>
+int
+main (void)
+{
+
+#if !HAVE_DECL_STRNDUP
+  extern
+  #ifdef __cplusplus
+  "C"
+  #endif
+  char *strndup (const char *, size_t);
+#endif
+  int result;
+  char *s;
+  s = strndup ("some longer string", 15);
+  free (s);
+  s = strndup ("shorter string", 13);
+  result = s[13] != '\0';
+  free (s);
+  return result;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_strndup_works=yes
+else $as_nop
+  gl_cv_func_strndup_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strndup_works" >&5
+printf "%s\n" "$gl_cv_func_strndup_works" >&6; }
+    case $gl_cv_func_strndup_works in
+      *no) REPLACE_STRNDUP=1 ;;
+    esac
+  else
+    HAVE_STRNDUP=0
+  fi
+
+  if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS strndup.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_STRNDUP=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRNDUP 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_have_decl_strnlen = no; then
+    HAVE_DECL_STRNLEN=0
+  else
+
+         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working strnlen" >&5
+printf %s "checking for working strnlen... " >&6; }
+if test ${ac_cv_func_strnlen_working+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  # Guess no on AIX systems, yes otherwise.
+               case "$host_os" in
+                 aix*) ac_cv_func_strnlen_working=no;;
+                 *)    ac_cv_func_strnlen_working=yes;;
+               esac
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main (void)
+{
+
+#define S "foobar"
+#define S_LEN (sizeof S - 1)
+
+  /* At least one implementation is buggy: that of AIX 4.3 would
+     give strnlen (S, 1) == 3.  */
+
+  int i;
+  for (i = 0; i < S_LEN + 1; ++i)
+    {
+      int expected = i <= S_LEN ? i : S_LEN;
+      if (strnlen (S, i) != expected)
+       return 1;
+    }
+  return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  ac_cv_func_strnlen_working=yes
+else $as_nop
+  ac_cv_func_strnlen_working=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strnlen_working" >&5
+printf "%s\n" "$ac_cv_func_strnlen_working" >&6; }
+test $ac_cv_func_strnlen_working = no && :
+
+
+    if test $ac_cv_func_strnlen_working = no; then
+      REPLACE_STRNLEN=1
+    fi
+  fi
+
+  if test $HAVE_DECL_STRNLEN = 0 || test $REPLACE_STRNLEN = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS strnlen.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_STRNLEN=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRNLEN 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_have_decl_strsignal = no; then
+    HAVE_DECL_STRSIGNAL=0
+  fi
+
+  ac_fn_c_check_func "$LINENO" "strsignal" "ac_cv_func_strsignal"
+if test "x$ac_cv_func_strsignal" = xyes
+then :
+  printf "%s\n" "#define HAVE_STRSIGNAL 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_strsignal = yes; then
+    HAVE_STRSIGNAL=1
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strsignal always returns a string" >&5
+printf %s "checking whether strsignal always returns a string... " >&6; }
+if test ${gl_cv_func_working_strsignal+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+            solaris* | aix*) gl_cv_func_working_strsignal=no;;
+            *)               gl_cv_func_working_strsignal="guessing yes";;
+          esac
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+#include <unistd.h> /* NetBSD 5.0 declares it in wrong header. */
+
+int
+main (void)
+{
+int result = 0;
+              char *s = strsignal (-1);
+              if (s == (char *) 0)
+                result |= 1;
+              if (s == (char *) -1)
+                result |= 2;
+              return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_working_strsignal=yes
+else $as_nop
+  gl_cv_func_working_strsignal=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_working_strsignal" >&5
+printf "%s\n" "$gl_cv_func_working_strsignal" >&6; }
+    if test "$gl_cv_func_working_strsignal" = no; then
+      REPLACE_STRSIGNAL=1
+    fi
+  else
+    HAVE_STRSIGNAL=0
+  fi
+
+  if test $HAVE_STRSIGNAL = 0 || test $REPLACE_STRSIGNAL = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS strsignal.$ac_objext"
+
+
+
+  ac_fn_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include <signal.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_sys_siglist" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_SYS_SIGLIST $ac_have_decl" >>confdefs.h
+
+  ac_fn_check_decl "$LINENO" "_sys_siglist" "ac_cv_have_decl__sys_siglist" "#include <signal.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl__sys_siglist" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL__SYS_SIGLIST $ac_have_decl" >>confdefs.h
+
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_STRSIGNAL=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRSIGNAL 1" >>confdefs.h
+
+
+
+
+
+  if test $REPLACE_STRSTR = 0; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strstr works in linear time" >&5
+printf %s "checking whether strstr works in linear time... " >&6; }
+if test ${gl_cv_func_strstr_linear+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+                             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     && !(defined __i386__ || defined __x86_64__) \
+     && !defined __UCLIBC__
+  Lucky user
+ #endif
+#endif
+#ifdef __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+  Lucky user
+ #endif
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Lucky user" >/dev/null 2>&1
+then :
+  gl_cv_func_strstr_linear="guessing yes"
+else $as_nop
+  gl_cv_func_strstr_linear="$gl_cross_guess_normal"
+fi
+rm -rf conftest*
+
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef __MVS__
+/* z/OS does not deliver signals while strstr() is running (thanks to
+   restrictions on its LE runtime), which prevents us from limiting the
+   running time of this test.  */
+# error "This test does not work properly on z/OS"
+#endif
+#include <signal.h> /* for signal */
+#include <string.h> /* for strstr */
+#include <stdlib.h> /* for malloc */
+#include <unistd.h> /* for alarm */
+static void quit (int sig) { _exit (sig + 128); }
+
+int
+main (void)
+{
+
+    int result = 0;
+    size_t m = 1000000;
+    char *haystack = (char *) malloc (2 * m + 2);
+    char *needle = (char *) malloc (m + 2);
+    /* Failure to compile this test due to missing alarm is okay,
+       since all such platforms (mingw) also have quadratic strstr.  */
+    signal (SIGALRM, quit);
+    alarm (5);
+    /* Check for quadratic performance.  */
+    if (haystack && needle)
+      {
+        memset (haystack, 'A', 2 * m);
+        haystack[2 * m] = 'B';
+        haystack[2 * m + 1] = 0;
+        memset (needle, 'A', m);
+        needle[m] = 'B';
+        needle[m + 1] = 0;
+        if (!strstr (haystack, needle))
+          result |= 1;
+      }
+    /* Free allocated memory, in case some sanitizer is watching.  */
+    free (haystack);
+    free (needle);
+    return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_strstr_linear=yes
+else $as_nop
+  gl_cv_func_strstr_linear=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_linear" >&5
+printf "%s\n" "$gl_cv_func_strstr_linear" >&6; }
+    case "$gl_cv_func_strstr_linear" in
+      *yes) ;;
+      *)
+        REPLACE_STRSTR=1
+        ;;
+    esac
+  fi
+
+  if test $REPLACE_STRSTR = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS strstr.$ac_objext"
+
+  fi
+
+
+
+  if test $REPLACE_MEMCHR = 1; then
+    REPLACE_STRSTR=1
+  else
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strstr works" >&5
+printf %s "checking whether strstr works... " >&6; }
+if test ${gl_cv_func_strstr_works_always+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+                                                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
+     || defined __UCLIBC__
+  Lucky user
+ #endif
+#elif defined __CYGWIN__
+ #include <cygwin/version.h>
+ #if CYGWIN_VERSION_DLL_COMBINED > CYGWIN_VERSION_DLL_MAKE_COMBINED (1007, 7)
+  Lucky user
+ #endif
+#else
+  Lucky user
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Lucky user" >/dev/null 2>&1
+then :
+  gl_cv_func_strstr_works_always="guessing yes"
+else $as_nop
+  gl_cv_func_strstr_works_always="$gl_cross_guess_normal"
+fi
+rm -rf conftest*
+
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <string.h> /* for strstr */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
+  Unlucky user
+ #endif
+#endif
+#define P "_EF_BF_BD"
+#define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
+#define NEEDLE P P P P P
+
+int
+main (void)
+{
+return !!strstr (HAYSTACK, NEEDLE);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_strstr_works_always=yes
+else $as_nop
+  gl_cv_func_strstr_works_always=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strstr_works_always" >&5
+printf "%s\n" "$gl_cv_func_strstr_works_always" >&6; }
+    case "$gl_cv_func_strstr_works_always" in
+      *yes) ;;
+      *)
+        REPLACE_STRSTR=1
+        ;;
+    esac
+  fi
+
+  if test $REPLACE_STRSTR = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS strstr.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_STRSTR=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRSTR 1" >>confdefs.h
+
+
+
+
+
+
+  if test $HAVE_STRTOD = 1; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether strtod obeys C99" >&5
+printf %s "checking whether strtod obeys C99... " >&6; }
+if test ${gl_cv_func_strtod_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+                    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 8) || (__GLIBC__ > 2)) \
+     && !defined __UCLIBC__
+  Lucky user
+ #endif
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Lucky user" >/dev/null 2>&1
+then :
+  gl_cv_func_strtod_works="guessing yes"
+else $as_nop
+  case "$host_os" in
+                       # Guess yes on musl systems.
+              *-musl*) gl_cv_func_strtod_works="guessing yes" ;;
+                       # Guess yes on native Windows.
+              mingw*)  gl_cv_func_strtod_works="guessing yes" ;;
+              *)       gl_cv_func_strtod_works="$gl_cross_guess_normal" ;;
+            esac
+
+fi
+rm -rf conftest*
+
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdlib.h>
+#include <math.h>
+#include <errno.h>
+/* Compare two numbers with ==.
+   This is a separate function because IRIX 6.5 "cc -O" miscompiles an
+   'x == x' test.  */
+static int
+numeric_equal (double x, double y)
+{
+  return x == y;
+}
+
+int
+main (void)
+{
+
+  int result = 0;
+  {
+    /* In some old versions of Linux (2000 or before), strtod mis-parses
+       strings with leading '+'.  */
+    const char *string = " +69";
+    char *term;
+    double value = strtod (string, &term);
+    if (value != 69 || term != (string + 4))
+      result |= 1;
+  }
+  {
+    /* Under Solaris 2.4, strtod returns the wrong value for the
+       terminating character under some conditions.  */
+    const char *string = "NaN";
+    char *term;
+    strtod (string, &term);
+    if (term != string && *(term - 1) == 0)
+      result |= 2;
+  }
+  {
+    /* Older glibc and Cygwin mis-parse "-0x".  */
+    const char *string = "-0x";
+    char *term;
+    double value = strtod (string, &term);
+    double zero = 0.0;
+    if (1.0 / value != -1.0 / zero || term != (string + 2))
+      result |= 4;
+  }
+  {
+    /* Many platforms do not parse hex floats.  */
+    const char *string = "0XaP+1";
+    char *term;
+    double value = strtod (string, &term);
+    if (value != 20.0 || term != (string + 6))
+      result |= 8;
+  }
+  {
+    /* Many platforms do not parse infinities.  HP-UX 11.31 parses inf,
+       but mistakenly sets errno.  */
+    const char *string = "inf";
+    char *term;
+    double value;
+    errno = 0;
+    value = strtod (string, &term);
+    if (value != HUGE_VAL || term != (string + 3) || errno)
+      result |= 16;
+  }
+  {
+    /* glibc 2.7 and cygwin 1.5.24 misparse "nan()".  */
+    const char *string = "nan()";
+    char *term;
+    double value = strtod (string, &term);
+    if (numeric_equal (value, value) || term != (string + 5))
+      result |= 32;
+  }
+  {
+    /* darwin 10.6.1 misparses "nan(".  */
+    const char *string = "nan(";
+    char *term;
+    double value = strtod (string, &term);
+    if (numeric_equal (value, value) || term != (string + 3))
+      result |= 64;
+  }
+  return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_strtod_works=yes
+else $as_nop
+  gl_cv_func_strtod_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_strtod_works" >&5
+printf "%s\n" "$gl_cv_func_strtod_works" >&6; }
+    case "$gl_cv_func_strtod_works" in
+      *yes) ;;
+      *)
+        REPLACE_STRTOD=1
+        ;;
+    esac
+  fi
+
+  if test $HAVE_STRTOD = 0 || test $REPLACE_STRTOD = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS strtod.$ac_objext"
+
+
+
+  if test $gl_cv_func_ldexp_no_libm = yes; then
+
+printf "%s\n" "#define HAVE_LDEXP_IN_LIBC 1" >>confdefs.h
+
+  fi
+  ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo"
+if test "x$ac_cv_func_nl_langinfo" = xyes
+then :
+  printf "%s\n" "#define HAVE_NL_LANGINFO 1" >>confdefs.h
+
+fi
+
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_STRTOD=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRTOD 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+printf "%s\n" "#define GNULIB_TEMPNAME 1" >>confdefs.h
+
+
+  ac_fn_c_check_header_compile "$LINENO" "sys/single_threaded.h" "ac_cv_header_sys_single_threaded_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_single_threaded_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_SYS_SINGLE_THREADED_H 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+
+
+
+
+
+
+      if  { test "$HAVE_LIBUNISTRING" != yes \
+    || {
+
+
+
+            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 11
+                         }
+                    }
+               }
+
+
+
+
+       }
+  }; then
+    LIBUNISTRING_UNISTR_H='unistr.h'
+  else
+    LIBUNISTRING_UNISTR_H=
+  fi
+
+
+
+
+printf "%s\n" "#define GNULIB_UNISTR_U8_MBTOUCR 1" >>confdefs.h
+
+
+
+
+       if  { test "$HAVE_LIBUNISTRING" != yes \
+    || {
+
+
+
+            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0
+                         }
+                    }
+               }
+
+
+
+
+       }
+  }; then
+  LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE=
+  LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE='#'
+else
+  LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE='#'
+  LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE=
+fi
+
+
+
+
+printf "%s\n" "#define GNULIB_UNISTR_U8_UCTOMB 1" >>confdefs.h
+
+
+
+
+       if  { test "$HAVE_LIBUNISTRING" != yes \
+    || {
+
+
+
+            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 0
+                         }
+                    }
+               }
+
+
+
+
+       }
+  }; then
+  LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE=
+  LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE='#'
+else
+  LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE='#'
+  LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE=
+fi
+
+
+
+
+      if  { test "$HAVE_LIBUNISTRING" != yes \
+    || {
+
+
+
+            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 11
+                         }
+                    }
+               }
+
+
+
+
+       }
+  }; then
+    LIBUNISTRING_UNITYPES_H='unitypes.h'
+  else
+    LIBUNISTRING_UNITYPES_H=
+  fi
+
+
+
+
+      if  { test "$HAVE_LIBUNISTRING" != yes \
+    || {
+
+
+
+            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 11
+                         }
+                    }
+               }
+
+
+
+
+       }
+  }; then
+    LIBUNISTRING_UNIWIDTH_H='uniwidth.h'
+  else
+    LIBUNISTRING_UNIWIDTH_H=
+  fi
+
+
+
+
+       if  { test "$HAVE_LIBUNISTRING" != yes \
+    || {
+
+
+
+            test $LIBUNISTRING_VERSION_MAJOR -lt 0 \
+            || { test $LIBUNISTRING_VERSION_MAJOR -eq 0 \
+                 && { test $LIBUNISTRING_VERSION_MINOR -lt 9 \
+                      || { test $LIBUNISTRING_VERSION_MINOR -eq 9 \
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt 8
+                         }
+                    }
+               }
+
+
+
+
+       }
+  }; then
+  LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE=
+  LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE='#'
+else
+  LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE='#'
+  LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE=
+fi
+
+
+
+printf "%s\n" "#define GNULIB_STDIO_SINGLE_THREAD 1" >>confdefs.h
+
+
+printf "%s\n" "#define USE_UNLOCKED_IO GNULIB_STDIO_SINGLE_THREAD" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_func_vasnprintf = no; then
+
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS vasnprintf.$ac_objext"
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS printf-args.$ac_objext"
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS printf-parse.$ac_objext"
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS asnprintf.$ac_objext"
+
+  if test $ac_cv_func_vasnprintf = yes; then
+
+printf "%s\n" "#define REPLACE_VASNPRINTF 1" >>confdefs.h
+
+  fi
+
+
+
+
+
+
+
+
+
+  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes
+then :
+
+else $as_nop
+
+printf "%s\n" "#define ptrdiff_t long" >>confdefs.h
+
+
+fi
+
+
+
+
+
+
+
+  fi
+
+
+  ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
+if test "x$ac_cv_func_vasprintf" = xyes
+then :
+  printf "%s\n" "#define HAVE_VASPRINTF 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_vasprintf = no; then
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS vasprintf.$ac_objext"
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS asprintf.$ac_objext"
+
+
+  if test $ac_cv_func_vasprintf = yes; then
+    REPLACE_VASPRINTF=1
+  else
+    HAVE_VASPRINTF=0
+  fi
+
+
+
+
+
+
+
+
+  fi
+
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_VASPRINTF=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_VASPRINTF 1" >>confdefs.h
+
+
+
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=asprintf:2:c-format"
+
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=vasprintf:2:c-format"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  gl_cv_func_vasprintf_posix=no
+  ac_fn_c_check_func "$LINENO" "vasprintf" "ac_cv_func_vasprintf"
+if test "x$ac_cv_func_vasprintf" = xyes
+then :
+  printf "%s\n" "#define HAVE_VASPRINTF 1" >>confdefs.h
+
+fi
+
+  case "$gl_cv_func_printf_sizes_c99" in
+    *yes)
+      case "$gl_cv_func_printf_long_double" in
+        *yes)
+          case "$gl_cv_func_printf_infinite" in
+            *yes)
+              case "$gl_cv_func_printf_infinite_long_double" in
+                *yes)
+                  case "$gl_cv_func_printf_directive_a" in
+                    *yes)
+                      case "$gl_cv_func_printf_directive_f" in
+                        *yes)
+                          case "$gl_cv_func_printf_directive_n" in
+                            *yes)
+                              case "$gl_cv_func_printf_directive_ls" in
+                                *yes)
+                                  case "$gl_cv_func_printf_positions" in
+                                    *yes)
+                                      case "$gl_cv_func_printf_flag_grouping" in
+                                        *yes)
+                                          case "$gl_cv_func_printf_flag_leftadjust" in
+                                            *yes)
+                                              case "$gl_cv_func_printf_flag_zero" in
+                                                *yes)
+                                                  case "$gl_cv_func_printf_precision" in
+                                                    *yes)
+                                                      case "$gl_cv_func_printf_enomem" in
+                                                        *yes)
+                                                          if test $ac_cv_func_vasprintf = yes; then
+                                                            # vasprintf exists and is
+                                                            # already POSIX compliant.
+                                                            gl_cv_func_vasprintf_posix=yes
+                                                          fi
+                                                          ;;
+                                                      esac
+                                                      ;;
+                                                  esac
+                                                  ;;
+                                              esac
+                                              ;;
+                                          esac
+                                          ;;
+                                      esac
+                                      ;;
+                                  esac
+                                  ;;
+                              esac
+                              ;;
+                          esac
+                          ;;
+                      esac
+                      ;;
+                  esac
+                  ;;
+              esac
+              ;;
+          esac
+          ;;
+      esac
+      ;;
+  esac
+  if test $gl_cv_func_vasprintf_posix = no; then
+
+
+
+  case "$gl_cv_func_printf_infinite" in
+    *yes)
+      ;;
+    *)
+
+printf "%s\n" "#define NEED_PRINTF_INFINITE_DOUBLE 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+
+  case "$gl_cv_func_printf_long_double" in
+    *yes)
+      case "$gl_cv_func_printf_infinite_long_double" in
+        *yes)
+          ;;
+        *)
+
+printf "%s\n" "#define NEED_PRINTF_INFINITE_LONG_DOUBLE 1" >>confdefs.h
+
+          ;;
+      esac
+      ;;
+  esac
+
+
+
+  case "$gl_cv_func_printf_directive_a" in
+    *yes)
+      ;;
+    *)
+
+printf "%s\n" "#define NEED_PRINTF_DIRECTIVE_A 1" >>confdefs.h
+
+      ac_fn_c_check_func "$LINENO" "nl_langinfo" "ac_cv_func_nl_langinfo"
+if test "x$ac_cv_func_nl_langinfo" = xyes
+then :
+  printf "%s\n" "#define HAVE_NL_LANGINFO 1" >>confdefs.h
+
+fi
+
+      ;;
+  esac
+
+
+
+  case "$gl_cv_func_printf_directive_f" in
+    *yes)
+      ;;
+    *)
+
+printf "%s\n" "#define NEED_PRINTF_DIRECTIVE_F 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+  case "$gl_cv_func_printf_directive_ls" in
+    *yes)
+      ;;
+    *)
+
+printf "%s\n" "#define NEED_PRINTF_DIRECTIVE_LS 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+  case "$gl_cv_func_printf_flag_grouping" in
+    *yes)
+      ;;
+    *)
+
+printf "%s\n" "#define NEED_PRINTF_FLAG_GROUPING 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+  case "$gl_cv_func_printf_flag_leftadjust" in
+    *yes)
+      ;;
+    *)
+
+printf "%s\n" "#define NEED_PRINTF_FLAG_LEFTADJUST 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+  case "$gl_cv_func_printf_flag_zero" in
+    *yes)
+      ;;
+    *)
+
+printf "%s\n" "#define NEED_PRINTF_FLAG_ZERO 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+  case "$gl_cv_func_printf_precision" in
+    *yes)
+      ;;
+    *)
+
+printf "%s\n" "#define NEED_PRINTF_UNBOUNDED_PRECISION 1" >>confdefs.h
+
+
+printf "%s\n" "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
+
+
+printf "%s\n" "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+  case "$gl_cv_func_printf_enomem" in
+    *yes)
+      ;;
+    *)
+
+printf "%s\n" "#define NEED_PRINTF_ENOMEM 1" >>confdefs.h
+
+
+printf "%s\n" "#define NEED_PRINTF_DOUBLE 1" >>confdefs.h
+
+
+printf "%s\n" "#define NEED_PRINTF_LONG_DOUBLE 1" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS vasnprintf.$ac_objext"
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS printf-args.$ac_objext"
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS printf-parse.$ac_objext"
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS asnprintf.$ac_objext"
+
+  if test $ac_cv_func_vasnprintf = yes; then
+
+printf "%s\n" "#define REPLACE_VASNPRINTF 1" >>confdefs.h
+
+  fi
+
+
+
+
+
+
+
+
+
+  ac_fn_c_check_type "$LINENO" "ptrdiff_t" "ac_cv_type_ptrdiff_t" "$ac_includes_default"
+if test "x$ac_cv_type_ptrdiff_t" = xyes
+then :
+
+else $as_nop
+
+printf "%s\n" "#define ptrdiff_t long" >>confdefs.h
+
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS vasprintf.$ac_objext"
+
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS asprintf.$ac_objext"
+
+
+  if test $ac_cv_func_vasprintf = yes; then
+    REPLACE_VASPRINTF=1
+  else
+    HAVE_VASPRINTF=0
+  fi
+
+
+
+
+
+
+
+
+  fi
+
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=verror:3:c-format"
+
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=verror_at_line:5:c-format"
+
+
+# Check whether --with-packager was given.
+if test ${with_packager+y}
+then :
+  withval=$with_packager;       case $withval in
+        yes|no) ;;
+        *)
+printf "%s\n" "#define PACKAGE_PACKAGER \"$withval\"" >>confdefs.h
+ ;;
+      esac
+
+fi
+
+
+
+# Check whether --with-packager-version was given.
+if test ${with_packager_version+y}
+then :
+  withval=$with_packager_version;       case $withval in
+        yes|no) ;;
+        *)
+printf "%s\n" "#define PACKAGE_PACKAGER_VERSION \"$withval\"" >>confdefs.h
+ ;;
+      esac
+
+fi
+
+
+
+# Check whether --with-packager-bug-reports was given.
+if test ${with_packager_bug_reports+y}
+then :
+  withval=$with_packager_bug_reports;       case $withval in
+        yes|no) ;;
+        *)
+printf "%s\n" "#define PACKAGE_PACKAGER_BUG_REPORTS \"$withval\"" >>confdefs.h
+ ;;
+      esac
+
+fi
+
+
+  if test "X$with_packager" = "X" && \
+     test "X$with_packager_version$with_packager_bug_reports" != "X"
+  then
+    as_fn_error $? "The --with-packager-{bug-reports,version} options require --with-packager" "$LINENO" 5
+  fi
+
+
+
+  ac_fn_c_check_func "$LINENO" "waitid" "ac_cv_func_waitid"
+if test "x$ac_cv_func_waitid" = xyes
+then :
+  printf "%s\n" "#define HAVE_WAITID 1" >>confdefs.h
+
+fi
+
+
+
+
+  HAVE_WAITPID=1
+  case $host_os in
+    mingw*) HAVE_WAITPID=0 ;;
+  esac
+
+  if test $HAVE_WAITPID = 0; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS waitpid.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_WAITPID=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_WAITPID 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        if case "$host_os" in
+       mingw*) true ;;
+       *) test $ac_cv_func_mbsinit = yes ;;
+     esac \
+    && test $ac_cv_func_mbrtowc = yes; then
+
+
+
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc handles incomplete characters" >&5
+printf %s "checking whether mbrtowc handles incomplete characters... " >&6; }
+if test ${gl_cv_func_mbrtowc_incomplete_state+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+                  case "$host_os" in
+                     # Guess no on AIX and OSF/1.
+        aix* | osf*) gl_cv_func_mbrtowc_incomplete_state="guessing no" ;;
+                     # Guess yes otherwise.
+        *)           gl_cv_func_mbrtowc_incomplete_state="guessing yes" ;;
+      esac
+      if test $LOCALE_JA != none; then
+        if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      const char input[] = "B\217\253\344\217\251\316er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        if (mbsinit (&state))
+          return 2;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_incomplete_state=yes
+else $as_nop
+  gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      else
+        if test $LOCALE_FR_UTF8 != none; then
+          if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        if (mbsinit (&state))
+          return 2;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_incomplete_state=yes
+else $as_nop
+  gl_cv_func_mbrtowc_incomplete_state=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+        fi
+      fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_incomplete_state" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_incomplete_state" >&6; }
+
+
+
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether mbrtowc works as well as mbtowc" >&5
+printf %s "checking whether mbrtowc works as well as mbtowc... " >&6; }
+if test ${gl_cv_func_mbrtowc_sanitycheck+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+                  case "$host_os" in
+                    # Guess no on Solaris 8.
+        solaris2.8) gl_cv_func_mbrtowc_sanitycheck="guessing no" ;;
+                    # Guess yes otherwise.
+        *)          gl_cv_func_mbrtowc_sanitycheck="guessing yes" ;;
+      esac
+      if test $LOCALE_ZH_CN != none; then
+        if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  /* This fails on Solaris 8:
+     mbrtowc returns 2, and sets wc to 0x00F0.
+     mbtowc returns 4 (correct) and sets wc to 0x5EDC.  */
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 3, 6, &state) != 4
+          && mbtowc (&wc, input + 3, 6) == 4)
+        return 2;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_mbrtowc_sanitycheck=yes
+else $as_nop
+  gl_cv_func_mbrtowc_sanitycheck=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_mbrtowc_sanitycheck" >&5
+printf "%s\n" "$gl_cv_func_mbrtowc_sanitycheck" >&6; }
+
+    REPLACE_MBSTATE_T=0
+    case "$gl_cv_func_mbrtowc_incomplete_state" in
+      *yes) ;;
+      *) REPLACE_MBSTATE_T=1 ;;
+    esac
+    case "$gl_cv_func_mbrtowc_sanitycheck" in
+      *yes) ;;
+      *) REPLACE_MBSTATE_T=1 ;;
+    esac
+  else
+    REPLACE_MBSTATE_T=1
+  fi
+
+
+
+  if test $ac_cv_func_wcrtomb = no; then
+    HAVE_WCRTOMB=0
+    ac_fn_check_decl "$LINENO" "wcrtomb" "ac_cv_have_decl_wcrtomb" "
+      #include <wchar.h>
+
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_wcrtomb" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_WCRTOMB $ac_have_decl" >>confdefs.h
+
+    if test $ac_cv_have_decl_wcrtomb = yes; then
+                        REPLACE_WCRTOMB=1
+    fi
+  else
+                        if test $REPLACE_WCRTOMB = 0; then
+
+
+
+
+
+             { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb works in the C locale" >&5
+printf %s "checking whether wcrtomb works in the C locale... " >&6; }
+if test ${gl_cv_func_wcrtomb_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                               # Guess no on Android.
+              linux*-android*) gl_cv_func_wcrtomb_works="guessing no";;
+                               # Guess yes otherwise.
+              *)               gl_cv_func_wcrtomb_works="guessing yes";;
+            esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <string.h>
+#include <stdlib.h>
+#include <wchar.h>
+int main ()
+{
+  mbstate_t state;
+  char out[64];
+  int count;
+  memset (&state, 0, sizeof (state));
+  out[0] = 'x';
+  count = wcrtomb (out, L'a', &state);
+  return !(count == 1 && out[0] == 'a');
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_wcrtomb_works=yes
+else $as_nop
+  gl_cv_func_wcrtomb_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_works" >&5
+printf "%s\n" "$gl_cv_func_wcrtomb_works" >&6; }
+      case "$gl_cv_func_wcrtomb_works" in
+        *yes) ;;
+        *)
+printf "%s\n" "#define WCRTOMB_C_LOCALE_BUG 1" >>confdefs.h
+
+           REPLACE_WCRTOMB=1 ;;
+      esac
+    fi
+    if test $REPLACE_WCRTOMB = 0; then
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcrtomb return value is correct" >&5
+printf %s "checking whether wcrtomb return value is correct... " >&6; }
+if test ${gl_cv_func_wcrtomb_retval+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+                              case "$host_os" in
+            # Guess no on AIX 4, OSF/1, Solaris, native Windows.
+            aix4* | osf* | solaris* | mingw*) gl_cv_func_wcrtomb_retval="guessing no" ;;
+            # Guess yes otherwise.
+            *)                                gl_cv_func_wcrtomb_retval="guessing yes" ;;
+          esac
+          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 $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+#include <stdlib.h>
+int main ()
+{
+  int result = 0;
+  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+    {
+      if (wcrtomb (NULL, 0, NULL) != 1)
+        result |= 1;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      if (wcrtomb (NULL, 0, NULL) != 1)
+        result |= 2;
+      {
+        wchar_t wc = (wchar_t) 0xBADFACE;
+        if (mbtowc (&wc, "\303\274", 2) == 2)
+          if (wcrtomb (NULL, wc, NULL) != 1)
+            result |= 2;
+      }
+    }
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      if (wcrtomb (NULL, 0, NULL) != 1)
+        result |= 4;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      if (wcrtomb (NULL, 0, NULL) != 1)
+        result |= 8;
+    }
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_wcrtomb_retval=yes
+else $as_nop
+  gl_cv_func_wcrtomb_retval=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+          fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcrtomb_retval" >&5
+printf "%s\n" "$gl_cv_func_wcrtomb_retval" >&6; }
+      case "$gl_cv_func_wcrtomb_retval" in
+        *yes) ;;
+        *)
+printf "%s\n" "#define WCRTOMB_RETVAL_BUG 1" >>confdefs.h
+
+           REPLACE_WCRTOMB=1 ;;
+      esac
+    fi
+  fi
+
+  if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS wcrtomb.$ac_objext"
+
+
+  :
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_WCRTOMB=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_WCRTOMB 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  ac_fn_check_decl "$LINENO" "wcwidth" "ac_cv_have_decl_wcwidth" "
+    #include <wchar.h>
+
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_wcwidth" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_WCWIDTH $ac_have_decl" >>confdefs.h
+
+  if test $ac_cv_have_decl_wcwidth != yes; then
+    HAVE_DECL_WCWIDTH=0
+  fi
+
+  if test $ac_cv_func_wcwidth != yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcwidth is a macro" >&5
+printf %s "checking whether wcwidth is a macro... " >&6; }
+if test ${gl_cv_func_wcwidth_macro+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <wchar.h>
+#ifdef wcwidth
+ wchar_header_defines_wcwidth
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "wchar_header_defines_wcwidth" >/dev/null 2>&1
+then :
+  gl_cv_func_wcwidth_macro=yes
+else $as_nop
+  gl_cv_func_wcwidth_macro=no
+fi
+rm -rf conftest*
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_macro" >&5
+printf "%s\n" "$gl_cv_func_wcwidth_macro" >&6; }
+  fi
+
+  if test $ac_cv_func_wcwidth = yes || test $gl_cv_func_wcwidth_macro = yes; then
+    HAVE_WCWIDTH=1
+                                        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wcwidth works reasonably in UTF-8 locales" >&5
+printf %s "checking whether wcwidth works reasonably in UTF-8 locales... " >&6; }
+if test ${gl_cv_func_wcwidth_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+        if test "$cross_compiling" = yes
+then :
+
+           case "$host_os" in
+                            # Guess yes on glibc systems.
+             *-gnu* | gnu*) gl_cv_func_wcwidth_works="guessing yes";;
+                            # Guess yes on musl systems.
+             *-musl*)       gl_cv_func_wcwidth_works="guessing yes";;
+                            # Guess yes on AIX 7 systems.
+             aix[7-9]*)     gl_cv_func_wcwidth_works="guessing yes";;
+             *)             gl_cv_func_wcwidth_works="$gl_cross_guess_normal";;
+           esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <wchar.h>
+#if !HAVE_DECL_WCWIDTH
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int wcwidth (int);
+#endif
+int main ()
+{
+  int result = 0;
+  if (setlocale (LC_ALL, "en_US.UTF-8") != NULL)
+    {
+      if (wcwidth (0x0301) > 0)
+        result |= 1;
+      if (wcwidth (0x05B0) > 0)
+        result |= 2;
+      if (wcwidth (0x200B) > 0)
+        result |= 4;
+      if (wcwidth (0xFF1A) == 0)
+        result |= 8;
+      if (wcwidth (0x2202) > 1)
+        result |= 16;
+    }
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_wcwidth_works=yes
+else $as_nop
+  gl_cv_func_wcwidth_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wcwidth_works" >&5
+printf "%s\n" "$gl_cv_func_wcwidth_works" >&6; }
+    case "$gl_cv_func_wcwidth_works" in
+      *yes) ;;
+      *no) REPLACE_WCWIDTH=1 ;;
+    esac
+  else
+    HAVE_WCWIDTH=0
+  fi
+
+  if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS wcwidth.$ac_objext"
+
+
+
+  :
+
+  fi
+
+
+
+
+
+
+
+
+
+          GL_M4_GNULIB_WCWIDTH=1
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_WCWIDTH 1" >>confdefs.h
+
+
+
+
+  case "$host_os" in
+    mingw*)
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS windows-mutex.$ac_objext"
+
+      ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS windows-once.$ac_objext"
+
+      ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS windows-recmutex.$ac_objext"
+
+      ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS windows-rwlock.$ac_objext"
+
+      ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS windows-spawn.$ac_objext"
+
+      ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS windows-spin.$ac_objext"
+
+      ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+
+
+
+
+
+
+
+
+  M4_LIBOBJS="$M4_LIBOBJS windows-tls.$ac_objext"
+
+      ;;
+  esac
+  :
+
+
+printf "%s\n" "#define GNULIB_XALLOC 1" >>confdefs.h
+
+
+
+
+printf "%s\n" "#define GNULIB_XALLOC_DIE 1" >>confdefs.h
+
+
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xprintf:1:c-format"
+
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xvprintf:1:c-format"
+
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xfprintf:2:c-format"
+
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xvfprintf:2:c-format"
+
+
+
+  ac_fn_c_check_header_compile "$LINENO" "stdint.h" "ac_cv_header_stdint_h" "$ac_includes_default"
+if test "x$ac_cv_header_stdint_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_STDINT_H 1" >>confdefs.h
+
+fi
+
+
+
+
+  :
+
+
+  :
+
+
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS --flag=xasprintf:1:c-format"
+
+  # End of code from modules
+
+
+
+
+
+
+
+
+
+
+
+  gltests_libdeps=
+  gltests_ltlibdeps=
+
+
+
+
+
+
+
+
+
+
+
+
+  gl_source_base='tests'
+  M4tests_WITNESS=IN_`echo "${PACKAGE-$PACKAGE_TARNAME}" | LC_ALL=C tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | LC_ALL=C sed -e 's/[^A-Z0-9_]/_/g'`_GNULIB_TESTS
+
+  gl_module_indicator_condition=$M4tests_WITNESS
+
+
+  if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS accept.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_ACCEPT" != 1; then
+        if test "$GL_M4_GNULIB_ACCEPT" = 0; then
+      GL_M4_GNULIB_ACCEPT=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_ACCEPT="($GL_M4_GNULIB_ACCEPT || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_ACCEPT 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS bind.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_BIND" != 1; then
+        if test "$GL_M4_GNULIB_BIND" = 0; then
+      GL_M4_GNULIB_BIND=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_BIND="($GL_M4_GNULIB_BIND || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_BIND 1" >>confdefs.h
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+     one byte long. This excludes the UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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 Mac OS 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
+              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
+                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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+  LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+     one byte long. This excludes the UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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 Mac OS 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
+              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
+                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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+  LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a turkish Unicode locale" >&5
+printf %s "checking for a turkish Unicode locale... " >&6; }
+if test ${gt_cv_locale_tr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+#include <wctype.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  But BeOS does not
+     implement the Turkish upper-/lowercase mappings.  Therefore, let this
+     program return 1 on BeOS.  */
+  /* Check whether the given locale name is recognized by the system.  */
+#if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS X 10.3.5 (Darwin 7.5) in the tr_TR locale, nl_langinfo(CODESET)
+     is empty, and the behaviour of Tcl 8.4 in this locale is not useful.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+#if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+#endif
+#ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+#endif
+  /* Check whether in the abbreviation of the eighth month, the second
+     character (should be U+011F: LATIN SMALL LETTER G WITH BREVE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1992 - 1900; t.tm_mon = 8 - 1; t.tm_mday = 19;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc4 || buf[2] != (char) 0x9f)
+    return 1;
+  /* Check whether the upper-/lowercase mappings are as expected for
+     Turkish.  */
+  if (towupper ('i') != 0x0130 || towlower (0x0130) != 'i'
+      || towupper(0x0131) != 'I' || towlower ('I') != 0x0131)
+    return 1;
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows locale name.
+          if (LC_ALL=Turkish_Turkey.65001 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_tr_utf8=Turkish_Turkey.65001
+          else
+            # None found.
+            gt_cv_locale_tr_utf8=none
+          fi
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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=tr_TR LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_tr_utf8=tr_TR
+          else
+            # Test for the locale name with explicit encoding suffix.
+            if (LC_ALL=tr_TR.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_tr_utf8=tr_TR.UTF-8
+            else
+              # Test for the Solaris 7 locale name.
+              if (LC_ALL=tr.UTF-8 LC_TIME= LC_CTYPE= ./conftest; exit) 2>/dev/null; then
+                gt_cv_locale_tr_utf8=tr.UTF-8
+              else
+                # None found.
+                gt_cv_locale_tr_utf8=none
+              fi
+            fi
+          fi
+          ;;
+      esac
+    else
+      gt_cv_locale_tr_utf8=none
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_tr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_tr_utf8" >&6; }
+  LOCALE_TR_UTF8=$gt_cv_locale_tr_utf8
+
+
+
+  if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS connect.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_CONNECT" != 1; then
+        if test "$GL_M4_GNULIB_CONNECT" = 0; then
+      GL_M4_GNULIB_CONNECT=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_CONNECT="($GL_M4_GNULIB_CONNECT || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_CONNECT 1" >>confdefs.h
+
+
+
+
+
+  case "$host_os" in
+    mingw*)
+      REPLACE_CREAT=1
+      ;;
+    *)
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether open recognizes a trailing slash" >&5
+printf %s "checking whether open recognizes a trailing slash... " >&6; }
+if test ${gl_cv_func_open_slash+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  # Assume that if we have lstat, we can also check symlinks.
+     if test $ac_cv_func_lstat = yes; then
+       touch conftest.tmp
+       ln -s conftest.tmp conftest.lnk
+     fi
+     if test "$cross_compiling" = yes
+then :
+
+        case "$host_os" in
+          freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+            gl_cv_func_open_slash="guessing no" ;;
+          *)
+            gl_cv_func_open_slash="guessing yes" ;;
+        esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+
+$gl_mda_defines
+
+int main ()
+{
+  int result = 0;
+#if HAVE_LSTAT
+  if (open ("conftest.lnk/", O_RDONLY) != -1)
+    result |= 1;
+#endif
+  if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+    result |= 2;
+  return result;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_open_slash=yes
+else $as_nop
+  gl_cv_func_open_slash=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+     rm -f conftest.sl conftest.tmp conftest.lnk
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_open_slash" >&5
+printf "%s\n" "$gl_cv_func_open_slash" >&6; }
+  case "$gl_cv_func_open_slash" in
+    *no)
+
+printf "%s\n" "#define OPEN_TRAILING_SLASH_BUG 1" >>confdefs.h
+
+      ;;
+  esac
+
+      case "$gl_cv_func_open_slash" in
+        *no)
+          REPLACE_CREAT=1
+          ;;
+      esac
+      ;;
+  esac
+
+  if test $REPLACE_CREAT = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS creat.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_CREAT" != 1; then
+        if test "$GL_M4_GNULIB_CREAT" = 0; then
+      GL_M4_GNULIB_CREAT=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_CREAT="($GL_M4_GNULIB_CREAT || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_CREAT 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+    ac_fn_c_check_func "$LINENO" "close_range" "ac_cv_func_close_range"
+if test "x$ac_cv_func_close_range" = xyes
+then :
+  printf "%s\n" "#define HAVE_CLOSE_RANGE 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+
+  if test $ac_cv_func_explicit_bzero = no; then
+    HAVE_EXPLICIT_BZERO=0
+  fi
+
+  if test $HAVE_EXPLICIT_BZERO = 0; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS explicit_bzero.$ac_objext"
+
+
+  ac_fn_c_check_func "$LINENO" "explicit_memset" "ac_cv_func_explicit_memset"
+if test "x$ac_cv_func_explicit_memset" = xyes
+then :
+  printf "%s\n" "#define HAVE_EXPLICIT_MEMSET 1" >>confdefs.h
+
+fi
+
+
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_EXPLICIT_BZERO" != 1; then
+        if test "$GL_M4_GNULIB_EXPLICIT_BZERO" = 0; then
+      GL_M4_GNULIB_EXPLICIT_BZERO=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_EXPLICIT_BZERO="($GL_M4_GNULIB_EXPLICIT_BZERO || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_EXPLICIT_BZERO 1" >>confdefs.h
+
+
+
+
+
+
+
+    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+      REPLACE_FDOPEN=1
+    fi
+
+  if test $REPLACE_FDOPEN = 0; then
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether fdopen sets errno" >&5
+printf %s "checking whether fdopen sets errno... " >&6; }
+if test ${gl_cv_func_fdopen_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+        if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+             mingw*) gl_cv_func_fdopen_works="guessing no" ;;
+             *)      gl_cv_func_fdopen_works="guessing yes" ;;
+           esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdio.h>
+#include <errno.h>
+
+
+$gl_mda_defines
+
+int
+main (void)
+{
+  FILE *fp;
+  errno = 0;
+  fp = fdopen (-1, "r");
+  if (fp == NULL && errno == 0)
+    return 1;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_fdopen_works=yes
+else $as_nop
+  gl_cv_func_fdopen_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_fdopen_works" >&5
+printf "%s\n" "$gl_cv_func_fdopen_works" >&6; }
+    case "$gl_cv_func_fdopen_works" in
+      *no) REPLACE_FDOPEN=1 ;;
+    esac
+  fi
+
+  if test $REPLACE_FDOPEN = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS fdopen.$ac_objext"
+
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_FDOPEN" != 1; then
+        if test "$GL_M4_GNULIB_FDOPEN" = 0; then
+      GL_M4_GNULIB_FDOPEN=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_FDOPEN="($GL_M4_GNULIB_FDOPEN || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FDOPEN 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+  case "$host_os" in
+    mingw* | pw* | os2*)
+      REPLACE_FREOPEN=1
+      ;;
+    *)
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether freopen works on closed fds" >&5
+printf %s "checking whether freopen works on closed fds... " >&6; }
+if test ${gl_cv_func_freopen_works_on_closed+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case $host_os in
+              *gnu*) gl_cv_func_freopen_works_on_closed="guessing no" ;;
+              *)     gl_cv_func_freopen_works_on_closed="guessing yes";;
+            esac
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+                #include <unistd.h>
+
+
+$gl_mda_defines
+
+int
+main (void)
+{
+close (0);
+                return !(freopen ("/dev/null", "r", stdin)
+                         && getchar () == EOF
+                         && !ferror (stdin) && feof (stdin));
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_freopen_works_on_closed=yes
+else $as_nop
+  gl_cv_func_freopen_works_on_closed=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_freopen_works_on_closed" >&5
+printf "%s\n" "$gl_cv_func_freopen_works_on_closed" >&6; }
+      case $gl_cv_func_freopen_works_on_closed in
+        *no) REPLACE_FREOPEN=1;;
+      esac
+  esac
+
+  if test $REPLACE_FREOPEN = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS freopen.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_FREOPEN" != 1; then
+        if test "$GL_M4_GNULIB_FREOPEN" = 0; then
+      GL_M4_GNULIB_FREOPEN=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_FREOPEN="($GL_M4_GNULIB_FREOPEN || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FREOPEN 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_func_ftruncate = yes; then
+
+
+      case "$host_os" in
+        mingw*)
+                                                                      REPLACE_FTRUNCATE=1
+          ;;
+      esac
+
+  else
+    HAVE_FTRUNCATE=0
+  fi
+
+  if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS ftruncate.$ac_objext"
+
+
+  ac_fn_c_check_func "$LINENO" "_chsize" "ac_cv_func__chsize"
+if test "x$ac_cv_func__chsize" = xyes
+then :
+  printf "%s\n" "#define HAVE__CHSIZE 1" >>confdefs.h
+
+fi
+
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_FTRUNCATE" != 1; then
+        if test "$GL_M4_GNULIB_FTRUNCATE" = 0; then
+      GL_M4_GNULIB_FTRUNCATE=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_FTRUNCATE="($GL_M4_GNULIB_FTRUNCATE || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_FTRUNCATE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+  gl_gettimeofday_timezone=void
+  if test $ac_cv_func_gettimeofday != yes; then
+    HAVE_GETTIMEOFDAY=0
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gettimeofday with POSIX signature" >&5
+printf %s "checking for gettimeofday with POSIX signature... " >&6; }
+if test ${gl_cv_func_gettimeofday_posix_signature+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/time.h>
+              struct timeval c;
+              int gettimeofday (struct timeval *restrict, void *restrict);
+
+int
+main (void)
+{
+/* glibc uses struct timezone * rather than the POSIX void *
+                 if _GNU_SOURCE is defined.  However, since the only portable
+                 use of gettimeofday uses NULL as the second parameter, and
+                 since the glibc definition is actually more typesafe, it is
+                 not worth wrapping this to get a compliant signature.  */
+              int (*f) (struct timeval *restrict, void *restrict)
+                = gettimeofday;
+              int x = f (&c, 0);
+              return !(x | c.tv_sec | c.tv_usec);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_gettimeofday_posix_signature=yes
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/time.h>
+int gettimeofday (struct timeval *restrict, struct timezone *restrict);
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_gettimeofday_posix_signature=almost
+else $as_nop
+  gl_cv_func_gettimeofday_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_gettimeofday_posix_signature" >&5
+printf "%s\n" "$gl_cv_func_gettimeofday_posix_signature" >&6; }
+    if test $gl_cv_func_gettimeofday_posix_signature = almost; then
+      gl_gettimeofday_timezone='struct timezone'
+    elif test $gl_cv_func_gettimeofday_posix_signature != yes; then
+      REPLACE_GETTIMEOFDAY=1
+    fi
+        if test $REPLACE_STRUCT_TIMEVAL = 1; then
+      REPLACE_GETTIMEOFDAY=1
+    fi
+            case "$host_os" in
+      mingw*) REPLACE_GETTIMEOFDAY=1 ;;
+    esac
+  fi
+
+printf "%s\n" "#define GETTIMEOFDAY_TIMEZONE $gl_gettimeofday_timezone" >>confdefs.h
+
+
+  if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS gettimeofday.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_GETTIMEOFDAY" != 1; then
+        if test "$GL_M4_GNULIB_GETTIMEOFDAY" = 0; then
+      GL_M4_GNULIB_GETTIMEOFDAY=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_GETTIMEOFDAY="($GL_M4_GNULIB_GETTIMEOFDAY || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_GETTIMEOFDAY 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+                HAVE_INET_PTON=1
+  INET_PTON_LIB=
+
+
+
+
+  if test $ac_cv_header_sys_socket_h != yes; then
+                    ac_fn_c_check_header_compile "$LINENO" "winsock2.h" "ac_cv_header_winsock2_h" "$ac_includes_default"
+if test "x$ac_cv_header_winsock2_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_WINSOCK2_H 1" >>confdefs.h
+
+fi
+
+  fi
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    HAVE_WINSOCK2_H=1
+    UNISTD_H_HAVE_WINSOCK2_H=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H=1
+  else
+    HAVE_WINSOCK2_H=0
+  fi
+
+
+  if test $HAVE_WINSOCK2_H = 1; then
+                    REPLACE_INET_PTON=1
+    ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include <ws2tcpip.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_inet_pton" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h
+
+    if test $ac_cv_have_decl_inet_pton = yes; then
+      INET_PTON_LIB="-lws2_32"
+    else
+      HAVE_DECL_INET_PTON=0
+    fi
+  else
+    gl_save_LIBS=$LIBS
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing inet_pton" >&5
+printf %s "checking for library containing inet_pton... " >&6; }
+if test ${ac_cv_search_inet_pton+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char inet_pton ();
+int
+main (void)
+{
+return inet_pton ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' nsl resolv network
+do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_search_inet_pton=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext
+  if test ${ac_cv_search_inet_pton+y}
+then :
+  break
+fi
+done
+if test ${ac_cv_search_inet_pton+y}
+then :
+
+else $as_nop
+  ac_cv_search_inet_pton=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_pton" >&5
+printf "%s\n" "$ac_cv_search_inet_pton" >&6; }
+ac_res=$ac_cv_search_inet_pton
+if test "$ac_res" != no
+then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+else $as_nop
+  ac_fn_c_check_func "$LINENO" "inet_pton" "ac_cv_func_inet_pton"
+if test "x$ac_cv_func_inet_pton" = xyes
+then :
+  printf "%s\n" "#define HAVE_INET_PTON 1" >>confdefs.h
+
+fi
+
+       if test $ac_cv_func_inet_pton = no; then
+         HAVE_INET_PTON=0
+       fi
+
+fi
+
+    LIBS=$gl_save_LIBS
+
+    if test "$ac_cv_search_inet_pton" != "no" \
+       && test "$ac_cv_search_inet_pton" != "none required"; then
+      INET_PTON_LIB="$ac_cv_search_inet_pton"
+    fi
+
+
+    ac_fn_check_decl "$LINENO" "inet_pton" "ac_cv_have_decl_inet_pton" "#include <arpa/inet.h>
+        #if HAVE_NETDB_H
+        # include <netdb.h>
+        #endif
+
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_inet_pton" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_INET_PTON $ac_have_decl" >>confdefs.h
+
+    if test $ac_cv_have_decl_inet_pton = no; then
+      HAVE_DECL_INET_PTON=0
+    fi
+  fi
+
+
+  if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_PTON = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS inet_pton.$ac_objext"
+
+
+
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_INET_PTON" != 1; then
+        if test "$GL_M4_GNULIB_INET_PTON" = 0; then
+      GL_M4_GNULIB_INET_PTON=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_INET_PTON="($GL_M4_GNULIB_INET_PTON || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
+printf %s "checking whether byte ordering is bigendian... " >&6; }
+if test ${ac_cv_c_bigendian+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+              not a universal capable compiler
+            #endif
+            typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+
+       # Check for potential -arch flags.  It is not universal unless
+       # there are at least two -arch flags with different values.
+       ac_arch=
+       ac_prev=
+       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+        if test -n "$ac_prev"; then
+          case $ac_word in
+            i?86 | x86_64 | ppc | ppc64)
+              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+                ac_arch=$ac_word
+              else
+                ac_cv_c_bigendian=universal
+                break
+              fi
+              ;;
+          esac
+          ac_prev=
+        elif test "x$ac_word" = "x-arch"; then
+          ac_prev=arch
+        fi
+       done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+            #include <sys/param.h>
+
+int
+main (void)
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+                    && LITTLE_ENDIAN)
+             bogus endian macros
+            #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+               #include <sys/param.h>
+
+int
+main (void)
+{
+#if BYTE_ORDER != BIG_ENDIAN
+                not big endian
+               #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_bigendian=yes
+else $as_nop
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main (void)
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+             bogus endian macros
+            #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main (void)
+{
+#ifndef _BIG_ENDIAN
+                not big endian
+               #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_bigendian=yes
+else $as_nop
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes
+then :
+  # Try to guess by grepping values from an object file.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+unsigned short int ascii_mm[] =
+                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+               unsigned short int ascii_ii[] =
+                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+               int use_ascii (int i) {
+                 return ascii_mm[i] + ascii_ii[i];
+               }
+               unsigned short int ebcdic_ii[] =
+                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+               unsigned short int ebcdic_mm[] =
+                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+               int use_ebcdic (int i) {
+                 return ebcdic_mm[i] + ebcdic_ii[i];
+               }
+               extern int foo;
+
+int
+main (void)
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+             ac_cv_c_bigendian=yes
+           fi
+           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+             if test "$ac_cv_c_bigendian" = unknown; then
+               ac_cv_c_bigendian=no
+             else
+               # finding both strings is unlikely to happen, but who knows?
+               ac_cv_c_bigendian=unknown
+             fi
+           fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main (void)
+{
+
+            /* Are we little or big endian?  From Harbison&Steele.  */
+            union
+            {
+              long int l;
+              char c[sizeof (long int)];
+            } u;
+            u.l = 1;
+            return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  ac_cv_c_bigendian=no
+else $as_nop
+  ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
+printf "%s\n" "$ac_cv_c_bigendian" >&6; }
+ case $ac_cv_c_bigendian in #(
+   yes)
+     printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h
+;; #(
+   no)
+      ;; #(
+   universal)
+
+printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+     ;; #(
+   *)
+     as_fn_error $? "unknown endianness
+ presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
+ esac
+
+
+
+
+  :
+
+  :
+  :
+  :
+  :
+
+
+
+
+
+  HAVE_IOCTL=1
+  if test "$ac_cv_header_winsock2_h" = yes; then
+                HAVE_IOCTL=0
+  else
+    ac_fn_c_check_func "$LINENO" "ioctl" "ac_cv_func_ioctl"
+if test "x$ac_cv_func_ioctl" = xyes
+then :
+  printf "%s\n" "#define HAVE_IOCTL 1" >>confdefs.h
+
+fi
+
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for ioctl with POSIX signature" >&5
+printf %s "checking for ioctl with POSIX signature... " >&6; }
+if test ${gl_cv_func_ioctl_posix_signature+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/ioctl.h>
+              /* On some platforms, ioctl() is declared in <unistd.h>.  */
+              #include <unistd.h>
+
+int
+main (void)
+{
+extern
+              #ifdef __cplusplus
+              "C"
+              #endif
+              int ioctl (int, int, ...);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_func_ioctl_posix_signature=yes
+else $as_nop
+  gl_cv_func_ioctl_posix_signature=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_ioctl_posix_signature" >&5
+printf "%s\n" "$gl_cv_func_ioctl_posix_signature" >&6; }
+    if test $gl_cv_func_ioctl_posix_signature != yes; then
+      REPLACE_IOCTL=1
+    fi
+  fi
+
+  if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS ioctl.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_IOCTL" != 1; then
+        if test "$GL_M4_GNULIB_IOCTL" = 0; then
+      GL_M4_GNULIB_IOCTL=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_IOCTL="($GL_M4_GNULIB_IOCTL || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_IOCTL 1" >>confdefs.h
+
+
+
+
+
+
+
+
+  if test $ac_cv_func_isblank = no; then
+    HAVE_ISBLANK=0
+  fi
+
+  if test $HAVE_ISBLANK = 0; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS isblank.$ac_objext"
+
+  fi
+
+
+printf "%s\n" "#define GNULIB_ISBLANK $gl_module_indicator_condition" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_ISBLANK" != 1; then
+        if test "$GL_M4_GNULIB_ISBLANK" = 0; then
+      GL_M4_GNULIB_ISBLANK=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_ISBLANK="($GL_M4_GNULIB_ISBLANK || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'double'" >&5
+printf %s "checking where to find the exponent in a 'double'... " >&6; }
+if test ${gl_cv_cc_double_expbit0+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+                                                                      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#if defined arm || defined __arm || defined __arm__
+  mixed_endianness
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "mixed_endianness" >/dev/null 2>&1
+then :
+  gl_cv_cc_double_expbit0="unknown"
+else $as_nop
+
+                                                         :
+if test ${ac_cv_c_bigendian+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_cv_c_bigendian=unknown
+    # See if we're dealing with a universal compiler.
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifndef __APPLE_CC__
+              not a universal capable compiler
+            #endif
+            typedef int dummy;
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+
+       # Check for potential -arch flags.  It is not universal unless
+       # there are at least two -arch flags with different values.
+       ac_arch=
+       ac_prev=
+       for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
+        if test -n "$ac_prev"; then
+          case $ac_word in
+            i?86 | x86_64 | ppc | ppc64)
+              if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
+                ac_arch=$ac_word
+              else
+                ac_cv_c_bigendian=universal
+                break
+              fi
+              ;;
+          esac
+          ac_prev=
+        elif test "x$ac_word" = "x-arch"; then
+          ac_prev=arch
+        fi
+       done
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if sys/param.h defines the BYTE_ORDER macro.
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+            #include <sys/param.h>
+
+int
+main (void)
+{
+#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
+                    && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
+                    && LITTLE_ENDIAN)
+             bogus endian macros
+            #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  # It does; now see whether it defined to BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+               #include <sys/param.h>
+
+int
+main (void)
+{
+#if BYTE_ORDER != BIG_ENDIAN
+                not big endian
+               #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_bigendian=yes
+else $as_nop
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # See if <limits.h> defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main (void)
+{
+#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
+             bogus endian macros
+            #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  # It does; now see whether it defined to _BIG_ENDIAN or not.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <limits.h>
+
+int
+main (void)
+{
+#ifndef _BIG_ENDIAN
+                not big endian
+               #endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  ac_cv_c_bigendian=yes
+else $as_nop
+  ac_cv_c_bigendian=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+    fi
+    if test $ac_cv_c_bigendian = unknown; then
+      # Compile a test program.
+      if test "$cross_compiling" = yes
+then :
+  # Try to guess by grepping values from an object file.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+unsigned short int ascii_mm[] =
+                 { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+               unsigned short int ascii_ii[] =
+                 { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+               int use_ascii (int i) {
+                 return ascii_mm[i] + ascii_ii[i];
+               }
+               unsigned short int ebcdic_ii[] =
+                 { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+               unsigned short int ebcdic_mm[] =
+                 { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+               int use_ebcdic (int i) {
+                 return ebcdic_mm[i] + ebcdic_ii[i];
+               }
+               extern int foo;
+
+int
+main (void)
+{
+return use_ascii (foo) == use_ebcdic (foo);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
+             ac_cv_c_bigendian=yes
+           fi
+           if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
+             if test "$ac_cv_c_bigendian" = unknown; then
+               ac_cv_c_bigendian=no
+             else
+               # finding both strings is unlikely to happen, but who knows?
+               ac_cv_c_bigendian=unknown
+             fi
+           fi
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main (void)
+{
+
+            /* Are we little or big endian?  From Harbison&Steele.  */
+            union
+            {
+              long int l;
+              char c[sizeof (long int)];
+            } u;
+            u.l = 1;
+            return u.c[sizeof (long int) - 1] == 1;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  ac_cv_c_bigendian=no
+else $as_nop
+  ac_cv_c_bigendian=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+    fi
+fi
+:
+ case $ac_cv_c_bigendian in #(
+   yes)
+     gl_cv_cc_double_expbit0="word 0 bit 20";; #(
+   no)
+     gl_cv_cc_double_expbit0="word 1 bit 20" ;; #(
+   universal)
+
+printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+
+     ;; #(
+   *)
+     gl_cv_cc_double_expbit0="unknown" ;;
+ esac
+
+
+fi
+rm -rf conftest*
+
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+  ((sizeof (double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { double value; unsigned int word[NWORDS]; } memory_double;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (double x)
+{
+  memory_double m;
+  size_t i;
+  /* Clear it first, in case sizeof (double) < sizeof (memory_double).  */
+  memset (&m, 0, sizeof (memory_double));
+  m.value = x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  add_to_ored_words (0.25);
+  add_to_ored_words (0.5);
+  add_to_ored_words (1.0);
+  add_to_ored_words (2.0);
+  add_to_ored_words (4.0);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_cc_double_expbit0=`cat conftest.out`
+else $as_nop
+  gl_cv_cc_double_expbit0="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      rm -f conftest.out
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_double_expbit0" >&5
+printf "%s\n" "$gl_cv_cc_double_expbit0" >&6; }
+  case "$gl_cv_cc_double_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_double_expbit0" | sed -e 's/word.*bit //'`
+
+printf "%s\n" "#define DBL_EXPBIT0_WORD $word" >>confdefs.h
+
+
+printf "%s\n" "#define DBL_EXPBIT0_BIT $bit" >>confdefs.h
+
+      ;;
+  esac
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'float'" >&5
+printf %s "checking where to find the exponent in a 'float'... " >&6; }
+if test ${gl_cv_cc_float_expbit0+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+  gl_cv_cc_float_expbit0="word 0 bit 23"
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+  ((sizeof (float) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { float value; unsigned int word[NWORDS]; } memory_float;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (float x)
+{
+  memory_float m;
+  size_t i;
+  /* Clear it first, in case
+     sizeof (float) < sizeof (memory_float).  */
+  memset (&m, 0, sizeof (memory_float));
+  m.value = x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  add_to_ored_words (0.25f);
+  add_to_ored_words (0.5f);
+  add_to_ored_words (1.0f);
+  add_to_ored_words (2.0f);
+  add_to_ored_words (4.0f);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_cc_float_expbit0=`cat conftest.out`
+else $as_nop
+  gl_cv_cc_float_expbit0="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      rm -f conftest.out
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_float_expbit0" >&5
+printf "%s\n" "$gl_cv_cc_float_expbit0" >&6; }
+  case "$gl_cv_cc_float_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_float_expbit0" | sed -e 's/word.*bit //'`
+
+printf "%s\n" "#define FLT_EXPBIT0_WORD $word" >>confdefs.h
+
+
+printf "%s\n" "#define FLT_EXPBIT0_BIT $bit" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where to find the exponent in a 'long double'" >&5
+printf %s "checking where to find the exponent in a 'long double'... " >&6; }
+if test ${gl_cv_cc_long_double_expbit0+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      if test "$cross_compiling" = yes
+then :
+
+                              gl_cv_cc_long_double_expbit0="unknown"
+          case "$host_os" in
+            mingw*) # On native Windows (little-endian), we know the result
+                    # in two cases: mingw, MSVC.
+              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef __MINGW32__
+ Known
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_cc_long_double_expbit0="word 2 bit 0"
+fi
+rm -rf conftest*
+
+              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#ifdef _MSC_VER
+ Known
+#endif
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "Known" >/dev/null 2>&1
+then :
+  gl_cv_cc_long_double_expbit0="word 1 bit 20"
+fi
+rm -rf conftest*
+
+              ;;
+          esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <float.h>
+#include <stddef.h>
+#include <stdio.h>
+#include <string.h>
+#define NWORDS \
+  ((sizeof (long double) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
+typedef union { long double value; unsigned int word[NWORDS]; }
+        memory_long_double;
+static unsigned int ored_words[NWORDS];
+static unsigned int anded_words[NWORDS];
+static void add_to_ored_words (long double *x)
+{
+  memory_long_double m;
+  size_t i;
+  /* Clear it first, in case
+     sizeof (long double) < sizeof (memory_long_double).  */
+  memset (&m, 0, sizeof (memory_long_double));
+  m.value = *x;
+  for (i = 0; i < NWORDS; i++)
+    {
+      ored_words[i] |= m.word[i];
+      anded_words[i] &= m.word[i];
+    }
+}
+int main ()
+{
+  static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L };
+  size_t j;
+  FILE *fp = fopen ("conftest.out", "w");
+  if (fp == NULL)
+    return 1;
+  for (j = 0; j < NWORDS; j++)
+    anded_words[j] = ~ (unsigned int) 0;
+  for (j = 0; j < 5; j++)
+    add_to_ored_words (&samples[j]);
+  /* Remove bits that are common (e.g. if representation of the first mantissa
+     bit is explicit).  */
+  for (j = 0; j < NWORDS; j++)
+    ored_words[j] &= ~anded_words[j];
+  /* Now find the nonzero word.  */
+  for (j = 0; j < NWORDS; j++)
+    if (ored_words[j] != 0)
+      break;
+  if (j < NWORDS)
+    {
+      size_t i;
+      for (i = j + 1; i < NWORDS; i++)
+        if (ored_words[i] != 0)
+          {
+            fprintf (fp, "unknown");
+            return (fclose (fp) != 0);
+          }
+      for (i = 0; ; i++)
+        if ((ored_words[j] >> i) & 1)
+          {
+            fprintf (fp, "word %d bit %d", (int) j, (int) i);
+            return (fclose (fp) != 0);
+          }
+    }
+  fprintf (fp, "unknown");
+  return (fclose (fp) != 0);
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_cc_long_double_expbit0=`cat conftest.out`
+else $as_nop
+  gl_cv_cc_long_double_expbit0="unknown"
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      rm -f conftest.out
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_cc_long_double_expbit0" >&5
+printf "%s\n" "$gl_cv_cc_long_double_expbit0" >&6; }
+  case "$gl_cv_cc_long_double_expbit0" in
+    word*bit*)
+      word=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word //' -e 's/ bit.*//'`
+      bit=`echo "$gl_cv_cc_long_double_expbit0" | sed -e 's/word.*bit //'`
+
+printf "%s\n" "#define LDBL_EXPBIT0_WORD $word" >>confdefs.h
+
+
+printf "%s\n" "#define LDBL_EXPBIT0_BIT $bit" >>confdefs.h
+
+      ;;
+  esac
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+     one byte long. This excludes the UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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 Mac OS 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
+              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
+                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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+  LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
+     on Cygwin 1.5.x.  */
+  if (MB_CUR_MAX == 1)
+    return 1;
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows, 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 Mac OS 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
+              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
+                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
+                  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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+  LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  /* Check whether a typical GB18030 multibyte sequence is recognized as a
+     single wide character.  This excludes the GB2312 and GBK encodings.  */
+  if (mblen ("\203\062\332\066", 5) != 4)
+    return 1;
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        solaris2.8)
+          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+          gt_cv_locale_zh_CN=none
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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.
+      gt_cv_locale_zh_CN=none
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+     one byte long. This excludes the UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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 Mac OS 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
+              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
+                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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+  LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
+     on Cygwin 1.5.x.  */
+  if (MB_CUR_MAX == 1)
+    return 1;
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows, 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 Mac OS 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
+              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
+                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
+                  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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+  LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  /* Check whether a typical GB18030 multibyte sequence is recognized as a
+     single wide character.  This excludes the GB2312 and GBK encodings.  */
+  if (mblen ("\203\062\332\066", 5) != 4)
+    return 1;
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        solaris2.8)
+          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+          gt_cv_locale_zh_CN=none
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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.
+      gt_cv_locale_zh_CN=none
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+
+  if test $ac_cv_func_link = no; then
+    HAVE_LINK=0
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether link obeys POSIX" >&5
+printf %s "checking whether link obeys POSIX... " >&6; }
+if test ${gl_cv_func_link_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  touch conftest.a
+       # Assume that if we have lstat, we can also check symlinks.
+       if test $ac_cv_func_lstat = yes; then
+         ln -s conftest.a conftest.lnk
+       fi
+       if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                             # Guess yes on Linux systems.
+            linux-* | linux) gl_cv_func_link_works="guessing yes" ;;
+                             # Guess yes on glibc systems.
+            *-gnu* | gnu*)   gl_cv_func_link_works="guessing yes" ;;
+                             # If we don't know, obey --enable-cross-guesses.
+            *)               gl_cv_func_link_works="$gl_cross_guess_normal" ;;
+          esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+             #include <stdio.h>
+
+int
+main (void)
+{
+int result = 0;
+             if (!link ("conftest.a", "conftest.b/"))
+               result |= 1;
+#if HAVE_LSTAT
+             if (!link ("conftest.lnk/", "conftest.b"))
+               result |= 2;
+             if (rename ("conftest.a", "conftest.b"))
+               result |= 4;
+             if (!link ("conftest.b", "conftest.lnk"))
+               result |= 8;
+#endif
+             return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_link_works=yes
+else $as_nop
+  gl_cv_func_link_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+       rm -f conftest.a conftest.b conftest.lnk
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_link_works" >&5
+printf "%s\n" "$gl_cv_func_link_works" >&6; }
+    case "$gl_cv_func_link_works" in
+      *yes) ;;
+      *)
+        REPLACE_LINK=1
+        ;;
+    esac
+  fi
+
+  if test $HAVE_LINK = 0 || test $REPLACE_LINK = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS link.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_LINK" != 1; then
+        if test "$GL_M4_GNULIB_LINK" = 0; then
+      GL_M4_GNULIB_LINK=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_LINK="($GL_M4_GNULIB_LINK || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_LINK 1" >>confdefs.h
+
+
+
+
+  if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS listen.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_LISTEN" != 1; then
+        if test "$GL_M4_GNULIB_LISTEN" = 0; then
+      GL_M4_GNULIB_LISTEN=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_LISTEN="($GL_M4_GNULIB_LISTEN || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_LISTEN 1" >>confdefs.h
+
+
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+     one byte long. This excludes the UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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 Mac OS 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
+              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
+                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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+  LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
+     on Cygwin 1.5.x.  */
+  if (MB_CUR_MAX == 1)
+    return 1;
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows, 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 Mac OS 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
+              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
+                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
+                  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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+  LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  /* Check whether a typical GB18030 multibyte sequence is recognized as a
+     single wide character.  This excludes the GB2312 and GBK encodings.  */
+  if (mblen ("\203\062\332\066", 5) != 4)
+    return 1;
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        solaris2.8)
+          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+          gt_cv_locale_zh_CN=none
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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.
+      gt_cv_locale_zh_CN=none
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  /* Check whether a typical GB18030 multibyte sequence is recognized as a
+     single wide character.  This excludes the GB2312 and GBK encodings.  */
+  if (mblen ("\203\062\332\066", 5) != 4)
+    return 1;
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        solaris2.8)
+          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+          gt_cv_locale_zh_CN=none
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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.
+      gt_cv_locale_zh_CN=none
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ nanosleep_save_libs=$LIBS
+
+ # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
+ # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
+ LIB_NANOSLEEP=
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing nanosleep" >&5
+printf %s "checking for library containing nanosleep... " >&6; }
+if test ${ac_cv_search_nanosleep+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+char nanosleep ();
+int
+main (void)
+{
+return nanosleep ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' rt posix4
+do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"
+then :
+  ac_cv_search_nanosleep=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext
+  if test ${ac_cv_search_nanosleep+y}
+then :
+  break
+fi
+done
+if test ${ac_cv_search_nanosleep+y}
+then :
+
+else $as_nop
+  ac_cv_search_nanosleep=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nanosleep" >&5
+printf "%s\n" "$ac_cv_search_nanosleep" >&6; }
+ac_res=$ac_cv_search_nanosleep
+if test "$ac_res" != no
+then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  test "$ac_cv_search_nanosleep" = "none required" ||
+                 LIB_NANOSLEEP=$ac_cv_search_nanosleep
+fi
+
+ if test "x$ac_cv_search_nanosleep" != xno; then
+
+
+   if test $APPLE_UNIVERSAL_BUILD = 1; then
+     # A universal build on Apple Mac OS X platforms.
+     # The test result would be 'no (mishandles large arguments)' in 64-bit
+     # mode but 'yes' in 32-bit mode. But we need a configuration result that
+     # is valid in both modes.
+     gl_cv_func_nanosleep='no (mishandles large arguments)'
+   fi
+
+   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working nanosleep" >&5
+printf %s "checking for working nanosleep... " >&6; }
+if test ${gl_cv_func_nanosleep+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+     if test "$cross_compiling" = yes
+then :
+  case "$host_os" in           linux*) # Guess it halfway works when the kernel is Linux.
+            gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;;
+          mingw*) # Guess no on native Windows.
+            gl_cv_func_nanosleep='guessing no' ;;
+          *)      # If we don't know, obey --enable-cross-guesses.
+            gl_cv_func_nanosleep="$gl_cross_guess_normal" ;;
+        esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+          #include <errno.h>
+          #include <limits.h>
+          #include <signal.h>
+          #if HAVE_SYS_TIME_H
+           #include <sys/time.h>
+          #endif
+          #include <time.h>
+          #include <unistd.h>
+          #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+          #define TYPE_MAXIMUM(t) \
+            ((t) (! TYPE_SIGNED (t) \
+                  ? (t) -1 \
+                  : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+
+          #if HAVE_DECL_ALARM
+          static void
+          check_for_SIGALRM (int sig)
+          {
+            if (sig != SIGALRM)
+              _exit (1);
+          }
+          #endif
+
+          int
+          main ()
+          {
+            static struct timespec ts_sleep;
+            static struct timespec ts_remaining;
+            /* Test for major problems first.  */
+            if (! nanosleep)
+              return 2;
+            ts_sleep.tv_sec = 0;
+            ts_sleep.tv_nsec = 1;
+            #if HAVE_DECL_ALARM
+            {
+              static struct sigaction act;
+              act.sa_handler = check_for_SIGALRM;
+              sigemptyset (&act.sa_mask);
+              sigaction (SIGALRM, &act, NULL);
+              alarm (1);
+              if (nanosleep (&ts_sleep, NULL) != 0)
+                return 3;
+              /* Test for a minor problem: the handling of large arguments.  */
+              ts_sleep.tv_sec = TYPE_MAXIMUM (time_t);
+              ts_sleep.tv_nsec = 999999999;
+              alarm (1);
+              if (nanosleep (&ts_sleep, &ts_remaining) != -1)
+                return 4;
+              if (errno != EINTR)
+                return 5;
+              if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10)
+                return 6;
+            }
+            #else /* A simpler test for native Windows.  */
+            if (nanosleep (&ts_sleep, &ts_remaining) < 0)
+              return 3;
+            #endif
+            return 0;
+          }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_nanosleep=yes
+else $as_nop
+  case $? in         4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';;         *)   gl_cv_func_nanosleep=no;;
+        esac
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_nanosleep" >&5
+printf "%s\n" "$gl_cv_func_nanosleep" >&6; }
+   case "$gl_cv_func_nanosleep" in
+     *yes)
+       REPLACE_NANOSLEEP=0
+       ;;
+     *)
+       REPLACE_NANOSLEEP=1
+       case "$gl_cv_func_nanosleep" in
+         *"mishandles large arguments"*)
+
+printf "%s\n" "#define HAVE_BUG_BIG_NANOSLEEP 1" >>confdefs.h
+
+           ;;
+         *)
+           # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP.
+           for ac_lib in $LIBSOCKET; do
+             case " $LIB_NANOSLEEP " in
+               *" $ac_lib "*) ;;
+               *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";;
+             esac
+           done
+           ;;
+       esac
+       ;;
+   esac
+ else
+   HAVE_NANOSLEEP=0
+ fi
+ LIBS=$nanosleep_save_libs
+
+  if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS nanosleep.$ac_objext"
+
+
+
+  :
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_NANOSLEEP" != 1; then
+        if test "$GL_M4_GNULIB_NANOSLEEP" = 0; then
+      GL_M4_GNULIB_NANOSLEEP=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_NANOSLEEP="($GL_M4_GNULIB_NANOSLEEP || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_NANOSLEEP 1" >>confdefs.h
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether <netinet/in.h> is self-contained" >&5
+printf %s "checking whether <netinet/in.h> is self-contained... " >&6; }
+if test ${gl_cv_header_netinet_in_h_selfcontained+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <netinet/in.h>
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_header_netinet_in_h_selfcontained=yes
+else $as_nop
+  gl_cv_header_netinet_in_h_selfcontained=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_header_netinet_in_h_selfcontained" >&5
+printf "%s\n" "$gl_cv_header_netinet_in_h_selfcontained" >&6; }
+  if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
+    NETINET_IN_H=''
+  else
+    NETINET_IN_H='netinet/in.h'
+    ac_fn_c_check_header_compile "$LINENO" "netinet/in.h" "ac_cv_header_netinet_in_h" "$ac_includes_default"
+if test "x$ac_cv_header_netinet_in_h" = xyes
+then :
+  printf "%s\n" "#define HAVE_NETINET_IN_H 1" >>confdefs.h
+
+fi
+
+
+
+
+
+
+
+
+
+
+     if test $gl_cv_have_include_next = yes; then
+       gl_cv_next_netinet_in_h='<'netinet/in.h'>'
+     else
+       { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking absolute name of <netinet/in.h>" >&5
+printf %s "checking absolute name of <netinet/in.h>... " >&6; }
+if test ${gl_cv_next_netinet_in_h+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+             if test $ac_cv_header_netinet_in_h = yes; then
+
+
+
+
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <netinet/in.h>
+_ACEOF
+                case "$host_os" in
+    aix*) gl_absname_cpp="$ac_cpp -C" ;;
+    *)    gl_absname_cpp="$ac_cpp" ;;
+  esac
+
+  case "$host_os" in
+    mingw*)
+                                          gl_dirsep_regex='[/\\]'
+      ;;
+    *)
+      gl_dirsep_regex='\/'
+      ;;
+  esac
+      gl_make_literal_regex_sed='s,[]$^\\.*/[],\\&,g'
+  gl_header_literal_regex=`echo 'netinet/in.h' \
+                           | sed -e "$gl_make_literal_regex_sed"`
+  gl_absolute_header_sed="/${gl_dirsep_regex}${gl_header_literal_regex}/"'{
+      s/.*"\(.*'"${gl_dirsep_regex}${gl_header_literal_regex}"'\)".*/\1/
+      s|^/[^/]|//&|
+      p
+      q
+    }'
+
+        gl_cv_absolute_netinet_in_h=`(eval "$gl_absname_cpp conftest.$ac_ext") 2>&5 |
+  sed -n "$gl_absolute_header_sed"`
+
+           gl_header=$gl_cv_absolute_netinet_in_h
+           gl_cv_next_netinet_in_h='"'$gl_header'"'
+          else
+               gl_cv_next_netinet_in_h='<'netinet/in.h'>'
+             fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_next_netinet_in_h" >&5
+printf "%s\n" "$gl_cv_next_netinet_in_h" >&6; }
+     fi
+     NEXT_NETINET_IN_H=$gl_cv_next_netinet_in_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='<'netinet/in.h'>'
+     else
+       # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
+       gl_next_as_first_directive=$gl_cv_next_netinet_in_h
+     fi
+     NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H=$gl_next_as_first_directive
+
+
+
+
+    if test $ac_cv_header_netinet_in_h = yes; then
+      HAVE_NETINET_IN_H=1
+    else
+      HAVE_NETINET_IN_H=0
+    fi
+
+  fi
+
+   if test -n "$NETINET_IN_H"; then
+  GL_GENERATE_NETINET_IN_H_TRUE=
+  GL_GENERATE_NETINET_IN_H_FALSE='#'
+else
+  GL_GENERATE_NETINET_IN_H_TRUE='#'
+  GL_GENERATE_NETINET_IN_H_FALSE=
+fi
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+     one byte long. This excludes the UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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 Mac OS 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
+              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
+                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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+  LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+
+
+             if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then
+            REPLACE_PERROR=1
+  fi
+  case ${gl_cv_func_strerror_r_works-unset} in
+    unset|*yes)
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether perror matches strerror" >&5
+printf %s "checking whether perror matches strerror... " >&6; }
+if test ${gl_cv_func_perror_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                       # Guess yes on musl systems.
+              *-musl*) gl_cv_func_perror_works="guessing yes" ;;
+                       # Guess yes on native Windows.
+              mingw*)  gl_cv_func_perror_works="guessing yes" ;;
+                       # Otherwise obey --enable-cross-guesses.
+              *)       gl_cv_func_perror_works="$gl_cross_guess_normal" ;;
+            esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <errno.h>
+                #include <stdio.h>
+                #include <stdlib.h>
+                #include <string.h>
+
+int
+main (void)
+{
+char *str = strerror (-1);
+                if (!getenv("CONFTEST_OUTPUT")) return 0;
+                if (!str) str = "";
+                puts (str);
+                errno = -1;
+                perror ("");
+                return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \
+               && cmp conftest.txt1 conftest.txt2 >/dev/null; then
+              gl_cv_func_perror_works=yes
+            else
+              gl_cv_func_perror_works=no
+            fi
+            rm -rf conftest.txt1 conftest.txt2
+else $as_nop
+  gl_cv_func_perror_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_perror_works" >&5
+printf "%s\n" "$gl_cv_func_perror_works" >&6; }
+      case "$gl_cv_func_perror_works" in
+        *yes) ;;
+        *) REPLACE_PERROR=1 ;;
+      esac
+      ;;
+    *)
+                  REPLACE_PERROR=1
+      ;;
+  esac
+
+  if test $REPLACE_PERROR = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS perror.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_PERROR" != 1; then
+        if test "$GL_M4_GNULIB_PERROR" = 0; then
+      GL_M4_GNULIB_PERROR=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_PERROR="($GL_M4_GNULIB_PERROR || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PERROR 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+  if { case "$host_os" in mingw*) true;; *) false;; esac; } \
+     && test $gl_threads_api = windows; then
+            REPLACE_PTHREAD_CREATE=1
+    REPLACE_PTHREAD_ATTR_INIT=1
+    REPLACE_PTHREAD_ATTR_GETDETACHSTATE=1
+    REPLACE_PTHREAD_ATTR_SETDETACHSTATE=1
+    REPLACE_PTHREAD_ATTR_DESTROY=1
+    REPLACE_PTHREAD_SELF=1
+    REPLACE_PTHREAD_EQUAL=1
+    REPLACE_PTHREAD_DETACH=1
+    REPLACE_PTHREAD_JOIN=1
+    REPLACE_PTHREAD_EXIT=1
+  else
+    if test $HAVE_PTHREAD_H = 0; then
+      HAVE_PTHREAD_CREATE=0
+      HAVE_PTHREAD_ATTR_INIT=0
+      HAVE_PTHREAD_ATTR_GETDETACHSTATE=0
+      HAVE_PTHREAD_ATTR_SETDETACHSTATE=0
+      HAVE_PTHREAD_ATTR_DESTROY=0
+      HAVE_PTHREAD_SELF=0
+      HAVE_PTHREAD_EQUAL=0
+      HAVE_PTHREAD_DETACH=0
+      HAVE_PTHREAD_JOIN=0
+      HAVE_PTHREAD_EXIT=0
+    else
+                  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthread_create exists as a global function" >&5
+printf %s "checking whether pthread_create exists as a global function... " >&6; }
+if test ${gl_cv_func_pthread_create+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  saved_LIBS="$LIBS"
+         LIBS="$LIBS $LIBPMULTITHREAD"
+         cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+extern
+                #ifdef __cplusplus
+                "C"
+                #endif
+                int pthread_create (void);
+                int main ()
+                {
+                  return pthread_create ();
+                }
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_pthread_create=yes
+else $as_nop
+  gl_cv_func_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+         LIBS="$saved_LIBS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_create" >&5
+printf "%s\n" "$gl_cv_func_pthread_create" >&6; }
+      if test $gl_cv_func_pthread_create = no; then
+        REPLACE_PTHREAD_CREATE=1
+        REPLACE_PTHREAD_ATTR_INIT=1
+
+printf "%s\n" "#define PTHREAD_CREATE_IS_INLINE 1" >>confdefs.h
+
+      fi
+    fi
+  fi
+
+  if test $HAVE_PTHREAD_CREATE = 0 || test $REPLACE_PTHREAD_CREATE = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS pthread-thread.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_PTHREAD_THREAD" != 1; then
+        if test "$GL_M4_GNULIB_PTHREAD_THREAD" = 0; then
+      GL_M4_GNULIB_PTHREAD_THREAD=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_PTHREAD_THREAD="($GL_M4_GNULIB_PTHREAD_THREAD || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PTHREAD_THREAD 1" >>confdefs.h
+
+
+
+
+
+
+
+
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask is a macro" >&5
+printf %s "checking whether pthread_sigmask is a macro... " >&6; }
+if test ${gl_cv_func_pthread_sigmask_macro+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <pthread.h>
+#include <signal.h>
+#ifdef pthread_sigmask
+ headers_define_pthread_sigmask
+#endif
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "headers_define_pthread_sigmask" >/dev/null 2>&1
+then :
+  gl_cv_func_pthread_sigmask_macro=yes
+else $as_nop
+  gl_cv_func_pthread_sigmask_macro=no
+fi
+rm -rf conftest*
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_macro" >&5
+printf "%s\n" "$gl_cv_func_pthread_sigmask_macro" >&6; }
+
+  LIB_PTHREAD_SIGMASK=
+
+  if test $gl_cv_func_pthread_sigmask_macro = yes; then
+        HAVE_PTHREAD_SIGMASK=0
+        REPLACE_PTHREAD_SIGMASK=1
+  else
+
+
+
+      if test "$gl_threads_api" = posix; then
+        if test $ac_cv_func_pthread_sigmask = yes; then
+                    :
+        else
+          if test -n "$LIBMULTITHREAD"; then
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_sigmask in $LIBMULTITHREAD" >&5
+printf %s "checking for pthread_sigmask in $LIBMULTITHREAD... " >&6; }
+if test ${gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gl_save_LIBS="$LIBS"
+               LIBS="$LIBS $LIBMULTITHREAD"
+               cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+                      #include <signal.h>
+
+int
+main (void)
+{
+return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes
+else $as_nop
+  gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+               LIBS="$gl_save_LIBS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD" >&5
+printf "%s\n" "$gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD" >&6; }
+            if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
+                            LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
+            else
+                            HAVE_PTHREAD_SIGMASK=0
+            fi
+          else
+                        HAVE_PTHREAD_SIGMASK=0
+          fi
+        fi
+      else
+                        if test $ac_cv_func_pthread_sigmask = yes; then
+          REPLACE_PTHREAD_SIGMASK=1
+        else
+          HAVE_PTHREAD_SIGMASK=0
+        fi
+      fi
+
+  fi
+
+
+
+    if test $HAVE_PTHREAD_SIGMASK = 1; then
+
+
+                if test -z "$LIB_PTHREAD_SIGMASK"; then
+      case " $LIBS " in
+        *' -pthread '*) ;;
+        *' -lpthread '*) ;;
+        *)
+          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask works without -lpthread" >&5
+printf %s "checking whether pthread_sigmask works without -lpthread... " >&6; }
+if test ${gl_cv_func_pthread_sigmask_in_libc_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+              if test "$cross_compiling" = yes
+then :
+
+                                  case "$host_os" in
+                   freebsd* | midnightbsd* | hpux* | solaris | solaris2.[2-9]*)
+                     gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
+                   *)
+                     gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
+                 esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+                   #include <pthread.h>
+                   #include <signal.h>
+                   #include <stddef.h>
+                   int main ()
+                   {
+                     sigset_t set;
+                     sigemptyset (&set);
+                     return pthread_sigmask (1729, &set, NULL) != 0;
+                   }
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_pthread_sigmask_in_libc_works=no
+else $as_nop
+  gl_cv_func_pthread_sigmask_in_libc_works=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_in_libc_works" >&5
+printf "%s\n" "$gl_cv_func_pthread_sigmask_in_libc_works" >&6; }
+          case "$gl_cv_func_pthread_sigmask_in_libc_works" in
+            *no)
+              REPLACE_PTHREAD_SIGMASK=1
+
+printf "%s\n" "#define PTHREAD_SIGMASK_INEFFECTIVE 1" >>confdefs.h
+
+              ;;
+          esac;;
+      esac
+    fi
+
+            { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask returns error numbers" >&5
+printf %s "checking whether pthread_sigmask returns error numbers... " >&6; }
+if test ${gl_cv_func_pthread_sigmask_return_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+        gl_save_LIBS="$LIBS"
+        LIBS="$LIBS $LIB_PTHREAD_SIGMASK"
+        if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+             cygwin*)
+               gl_cv_func_pthread_sigmask_return_works="guessing no";;
+             *)
+               gl_cv_func_pthread_sigmask_return_works="guessing yes";;
+           esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <pthread.h>
+#include <signal.h>
+#include <stddef.h>
+int main ()
+{
+  sigset_t set;
+  sigemptyset (&set);
+  if (pthread_sigmask (1729, &set, NULL) == -1)
+    return 1;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_pthread_sigmask_return_works=yes
+else $as_nop
+  gl_cv_func_pthread_sigmask_return_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+        LIBS="$gl_save_LIBS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_return_works" >&5
+printf "%s\n" "$gl_cv_func_pthread_sigmask_return_works" >&6; }
+    case "$gl_cv_func_pthread_sigmask_return_works" in
+      *no)
+        REPLACE_PTHREAD_SIGMASK=1
+
+printf "%s\n" "#define PTHREAD_SIGMASK_FAILS_WITH_ERRNO 1" >>confdefs.h
+
+        ;;
+    esac
+
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether pthread_sigmask unblocks signals correctly" >&5
+printf %s "checking whether pthread_sigmask unblocks signals correctly... " >&6; }
+if test ${gl_cv_func_pthread_sigmask_unblock_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+        case "$host_os" in
+          irix*)
+            gl_cv_func_pthread_sigmask_unblock_works="guessing no";;
+          *)
+            gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
+        esac
+                                         gl_save_LIBS=$LIBS
+           LIBS="$LIBS $LIBMULTITHREAD"
+        if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+
+$gl_mda_defines
+
+static volatile int sigint_occurred;
+static void
+sigint_handler (int sig)
+{
+  sigint_occurred++;
+}
+int main ()
+{
+  sigset_t set;
+  int pid = getpid ();
+  char command[80];
+  signal (SIGINT, sigint_handler);
+  sigemptyset (&set);
+  sigaddset (&set, SIGINT);
+  if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
+    return 1;
+  sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
+  if (!(system (command) == 0))
+    return 2;
+  sleep (2);
+  if (!(sigint_occurred == 0))
+    return 3;
+  if (!(pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0))
+    return 4;
+  if (!(sigint_occurred == 1)) /* This fails on IRIX.  */
+    return 5;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  :
+else $as_nop
+  gl_cv_func_pthread_sigmask_unblock_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+        LIBS=$gl_save_LIBS
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_pthread_sigmask_unblock_works" >&5
+printf "%s\n" "$gl_cv_func_pthread_sigmask_unblock_works" >&6; }
+    case "$gl_cv_func_pthread_sigmask_unblock_works" in
+      *no)
+        REPLACE_PTHREAD_SIGMASK=1
+
+printf "%s\n" "#define PTHREAD_SIGMASK_UNBLOCK_BUG 1" >>confdefs.h
+
+        ;;
+    esac
+  fi
+
+  if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS pthread_sigmask.$ac_objext"
+
+
+  if test $HAVE_PTHREAD_SIGMASK = 1; then
+
+printf "%s\n" "#define HAVE_PTHREAD_SIGMASK 1" >>confdefs.h
+
+  fi
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_PTHREAD_SIGMASK" != 1; then
+        if test "$GL_M4_GNULIB_PTHREAD_SIGMASK" = 0; then
+      GL_M4_GNULIB_PTHREAD_SIGMASK=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_PTHREAD_SIGMASK="($GL_M4_GNULIB_PTHREAD_SIGMASK || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PTHREAD_SIGMASK 1" >>confdefs.h
+
+
+
+
+
+     { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for putenv compatible with GNU and SVID" >&5
+printf %s "checking for putenv compatible with GNU and SVID... " >&6; }
+if test ${gl_cv_func_svid_putenv+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+          case "$host_os" in
+                         # Guess yes on glibc systems.
+          *-gnu* | gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
+                         # Guess yes on musl systems.
+          *-musl*)       gl_cv_func_svid_putenv="guessing yes" ;;
+                         # Guess no on native Windows.
+          mingw*)        gl_cv_func_svid_putenv="guessing no" ;;
+                         # If we don't know, obey --enable-cross-guesses.
+          *)             gl_cv_func_svid_putenv="$gl_cross_guess_normal" ;;
+        esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+
+
+$gl_mda_defines
+
+int
+main (void)
+{
+
+            /* Put it in env.  */
+            if (putenv ("CONFTEST_putenv=val"))
+              return 1;
+
+            /* Try to remove it.  */
+            if (putenv ("CONFTEST_putenv"))
+              return 2;
+
+            /* Make sure it was deleted.  */
+            if (getenv ("CONFTEST_putenv") != 0)
+              return 3;
+
+            return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_svid_putenv=yes
+else $as_nop
+  gl_cv_func_svid_putenv=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_svid_putenv" >&5
+printf "%s\n" "$gl_cv_func_svid_putenv" >&6; }
+  case "$gl_cv_func_svid_putenv" in
+    *yes) ;;
+    *)
+      REPLACE_PUTENV=1
+      ;;
+  esac
+
+  if test $REPLACE_PUTENV = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS putenv.$ac_objext"
+
+
+  ac_fn_check_decl "$LINENO" "_putenv" "ac_cv_have_decl__putenv" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl__putenv" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL__PUTENV $ac_have_decl" >>confdefs.h
+
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_PUTENV" != 1; then
+        if test "$GL_M4_GNULIB_PUTENV" = 0; then
+      GL_M4_GNULIB_PUTENV=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_PUTENV="($GL_M4_GNULIB_PUTENV || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_PUTENV 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+  :
+
+
+
+
+
+  if { case "$host_os" in mingw*) true;; *) false;; esac; } \
+     && test $gl_threads_api = windows; then
+            REPLACE_SCHED_YIELD=1
+  else
+    ac_fn_check_decl "$LINENO" "sched_yield" "ac_cv_have_decl_sched_yield" "#include <sched.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_sched_yield" = xyes
+then :
+
+else $as_nop
+  HAVE_SCHED_YIELD=0
+fi
+  fi
+
+  if test $HAVE_SCHED_YIELD = 0 || test $REPLACE_SCHED_YIELD = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS sched_yield.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_SCHED_YIELD" != 1; then
+        if test "$GL_M4_GNULIB_SCHED_YIELD" = 0; then
+      GL_M4_GNULIB_SCHED_YIELD=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_SCHED_YIELD="($GL_M4_GNULIB_SCHED_YIELD || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SCHED_YIELD 1" >>confdefs.h
+
+
+
+
+
+
+
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    REPLACE_SELECT=1
+  else
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select supports a 0 argument" >&5
+printf %s "checking whether select supports a 0 argument... " >&6; }
+if test ${gl_cv_func_select_supports0+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+        if test "$cross_compiling" = yes
+then :
+
+           case "$host_os" in
+                       # Guess no on Interix.
+             interix*) gl_cv_func_select_supports0="guessing no";;
+                       # Guess yes otherwise.
+             *)        gl_cv_func_select_supports0="guessing yes";;
+           esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+int main ()
+{
+  struct timeval timeout;
+  timeout.tv_sec = 0;
+  timeout.tv_usec = 5;
+  return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_select_supports0=yes
+else $as_nop
+  gl_cv_func_select_supports0=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_supports0" >&5
+printf "%s\n" "$gl_cv_func_select_supports0" >&6; }
+    case "$gl_cv_func_select_supports0" in
+      *yes) ;;
+      *) REPLACE_SELECT=1 ;;
+    esac
+
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether select detects invalid fds" >&5
+printf %s "checking whether select detects invalid fds... " >&6; }
+if test ${gl_cv_func_select_detects_ebadf+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+        if test "$cross_compiling" = yes
+then :
+
+           case "$host_os" in
+                             # Guess yes on Linux systems.
+            linux-* | linux) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+                             # Guess yes on glibc systems.
+            *-gnu* | gnu*)   gl_cv_func_select_detects_ebadf="guessing yes" ;;
+                             # If we don't know, obey --enable-cross-guesses.
+            *)               gl_cv_func_select_detects_ebadf="$gl_cross_guess_normal" ;;
+           esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#include <unistd.h>
+#include <errno.h>
+
+
+$gl_mda_defines
+
+int
+main (void)
+{
+
+  fd_set set;
+  dup2(0, 16);
+  FD_ZERO(&set);
+  FD_SET(16, &set);
+  close(16);
+  struct timeval timeout;
+  timeout.tv_sec = 0;
+  timeout.tv_usec = 5;
+  return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_select_detects_ebadf=yes
+else $as_nop
+  gl_cv_func_select_detects_ebadf=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_select_detects_ebadf" >&5
+printf "%s\n" "$gl_cv_func_select_detects_ebadf" >&6; }
+    case $gl_cv_func_select_detects_ebadf in
+      *yes) ;;
+      *) REPLACE_SELECT=1 ;;
+    esac
+  fi
+
+    LIB_SELECT="$LIBSOCKET"
+  if test $REPLACE_SELECT = 1; then
+    case "$host_os" in
+      mingw*)
+                                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+int
+main ()
+{
+  MsgWaitForMultipleObjects (0, NULL, 0, 0, 0);
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+
+else $as_nop
+  LIB_SELECT="$LIB_SELECT -luser32"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+        ;;
+    esac
+  fi
+
+
+  if test $REPLACE_SELECT = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS select.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_SELECT" != 1; then
+        if test "$GL_M4_GNULIB_SELECT" = 0; then
+      GL_M4_GNULIB_SELECT=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_SELECT="($GL_M4_GNULIB_SELECT || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SELECT 1" >>confdefs.h
+
+
+
+
+
+
+     if test $ac_cv_func_setenv = no; then
+    HAVE_SETENV=0
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether setenv validates arguments" >&5
+printf %s "checking whether setenv validates arguments... " >&6; }
+if test ${gl_cv_func_setenv_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                        # Guess yes on glibc systems.
+         *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+                        # Guess yes on musl systems.
+         *-musl*)       gl_cv_func_setenv_works="guessing yes" ;;
+                        # If we don't know, obey --enable-cross-guesses.
+         *)             gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
+       esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+       #include <stdlib.h>
+       #include <errno.h>
+       #include <string.h>
+
+int
+main (void)
+{
+
+       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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_setenv_works=yes
+else $as_nop
+  gl_cv_func_setenv_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_setenv_works" >&5
+printf "%s\n" "$gl_cv_func_setenv_works" >&6; }
+    case "$gl_cv_func_setenv_works" in
+      *yes) ;;
+      *)
+        REPLACE_SETENV=1
+        ;;
+    esac
+  fi
+
+  if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS setenv.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_SETENV" != 1; then
+        if test "$GL_M4_GNULIB_SETENV" = 0; then
+      GL_M4_GNULIB_SETENV=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_SETENV="($GL_M4_GNULIB_SETENV || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SETENV 1" >>confdefs.h
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+     one byte long. This excludes the UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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 Mac OS 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
+              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
+                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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+  LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
+     on Cygwin 1.5.x.  */
+  if (MB_CUR_MAX == 1)
+    return 1;
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows, 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 Mac OS 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
+              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
+                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
+                  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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+  LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  /* Check whether a typical GB18030 multibyte sequence is recognized as a
+     single wide character.  This excludes the GB2312 and GBK encodings.  */
+  if (mblen ("\203\062\332\066", 5) != 4)
+    return 1;
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        solaris2.8)
+          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+          gt_cv_locale_zh_CN=none
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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.
+      gt_cv_locale_zh_CN=none
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+  if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS setsockopt.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_SETSOCKOPT" != 1; then
+        if test "$GL_M4_GNULIB_SETSOCKOPT" = 0; then
+      GL_M4_GNULIB_SETSOCKOPT=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_SETSOCKOPT="($GL_M4_GNULIB_SETSOCKOPT || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SETSOCKOPT 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+               ac_fn_check_decl "$LINENO" "sleep" "ac_cv_have_decl_sleep" "#include <unistd.h>
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_sleep" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_SLEEP $ac_have_decl" >>confdefs.h
+
+
+  if test $ac_cv_have_decl_sleep != yes; then
+    HAVE_SLEEP=0
+  else
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working sleep" >&5
+printf %s "checking for working sleep... " >&6; }
+if test ${gl_cv_func_sleep_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                        # Guess yes on glibc systems.
+         *-gnu* | gnu*) gl_cv_func_sleep_works="guessing yes" ;;
+                        # Guess yes on musl systems.
+         *-musl*)       gl_cv_func_sleep_works="guessing yes" ;;
+                        # Guess no on native Windows.
+         mingw*)        gl_cv_func_sleep_works="guessing no" ;;
+                        # If we don't know, obey --enable-cross-guesses.
+         *)             gl_cv_func_sleep_works="$gl_cross_guess_normal" ;;
+       esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <errno.h>
+#include <unistd.h>
+#include <signal.h>
+static void
+handle_alarm (int sig)
+{
+  if (sig != SIGALRM)
+    _exit (2);
+}
+
+int
+main (void)
+{
+
+    /* Failure to compile this test due to missing alarm is okay,
+       since all such platforms (mingw) also lack sleep.  */
+    unsigned int pentecost = 50 * 24 * 60 * 60; /* 50 days.  */
+    unsigned int remaining;
+    signal (SIGALRM, handle_alarm);
+    alarm (1);
+    remaining = sleep (pentecost);
+    if (remaining > pentecost)
+      return 3;
+    if (remaining <= pentecost - 10)
+      return 4;
+    return 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_sleep_works=yes
+else $as_nop
+  gl_cv_func_sleep_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_sleep_works" >&5
+printf "%s\n" "$gl_cv_func_sleep_works" >&6; }
+    case "$gl_cv_func_sleep_works" in
+      *yes) ;;
+      *)
+        REPLACE_SLEEP=1
+        ;;
+    esac
+  fi
+
+  if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS sleep.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_SLEEP" != 1; then
+        if test "$GL_M4_GNULIB_SLEEP" = 0; then
+      GL_M4_GNULIB_SLEEP=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_SLEEP="($GL_M4_GNULIB_SLEEP || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SLEEP 1" >>confdefs.h
+
+
+
+
+
+  if test "$ac_cv_header_winsock2_h" = yes; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS socket.$ac_objext"
+
+  fi
+  # When this module is used, sockets may actually occur as file descriptors,
+  # hence it is worth warning if the modules 'close' and 'ioctl' are not used.
+
+
+
+
+
+
+
+
+
+
+
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_SOCKET" != 1; then
+        if test "$GL_M4_GNULIB_SOCKET" = 0; then
+      GL_M4_GNULIB_SOCKET=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_SOCKET="($GL_M4_GNULIB_SOCKET || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SOCKET 1" >>confdefs.h
+
+
+
+
+
+     ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "
+/* <sys/types.h> is not needed according to POSIX, but the
+   <sys/socket.h> in i386-unknown-freebsd4.10 and
+   powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#elif HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+#endif
+
+"
+if test "x$ac_cv_type_socklen_t" = xyes
+then :
+
+else $as_nop
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for socklen_t equivalent" >&5
+printf %s "checking for socklen_t equivalent... " >&6; }
+if test ${gl_cv_socklen_t_equiv+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  # Systems have either "struct sockaddr *" or
+         # "void *" as the second argument to getpeername
+         gl_cv_socklen_t_equiv=
+         for arg2 in "struct sockaddr" void; do
+           for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+             cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+                   #include <sys/socket.h>
+
+                   int getpeername (int, $arg2 *, $t *);
+int
+main (void)
+{
+$t len;
+                  getpeername (0, 0, &len);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gl_cv_socklen_t_equiv="$t"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+             test "$gl_cv_socklen_t_equiv" != "" && break
+           done
+           test "$gl_cv_socklen_t_equiv" != "" && break
+         done
+         if test "$gl_cv_socklen_t_equiv" = ""; then
+           as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5
+         fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_socklen_t_equiv" >&5
+printf "%s\n" "$gl_cv_socklen_t_equiv" >&6; }
+
+printf "%s\n" "#define socklen_t $gl_cv_socklen_t_equiv" >>confdefs.h
+
+fi
+
+
+
+
+
+
+
+
+
+
+  if test $ac_cv_have_decl_strerror_r = no; then
+    HAVE_DECL_STRERROR_R=0
+  fi
+
+  if test $ac_cv_func_strerror_r = yes; then
+    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+      if test $gl_cv_func_strerror_r_posix_signature = yes; then
+        case "$gl_cv_func_strerror_r_works" in
+                    *no) REPLACE_STRERROR_R=1 ;;
+        esac
+      else
+                REPLACE_STRERROR_R=1
+      fi
+    else
+                  REPLACE_STRERROR_R=1
+    fi
+  fi
+
+  if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS strerror_r.$ac_objext"
+
+
+
+
+
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_STRERROR_R" != 1; then
+        if test "$GL_M4_GNULIB_STRERROR_R" = 0; then
+      GL_M4_GNULIB_STRERROR_R=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_STRERROR_R="($GL_M4_GNULIB_STRERROR_R || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_STRERROR_R 1" >>confdefs.h
+
+
+
+
+
+printf "%s\n" "#define GNULIB_STRERROR_R_POSIX $gl_module_indicator_condition" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+     one byte long. This excludes the UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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 Mac OS 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
+              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
+                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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+  LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+        if test $ac_cv_func_symlink = no; then
+    HAVE_SYMLINK=0
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether symlink handles trailing slash correctly" >&5
+printf %s "checking whether symlink handles trailing slash correctly... " >&6; }
+if test ${gl_cv_func_symlink_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                             # Guess yes on Linux systems.
+            linux-* | linux) gl_cv_func_symlink_works="guessing yes" ;;
+                             # Guess yes on glibc systems.
+            *-gnu* | gnu*)   gl_cv_func_symlink_works="guessing yes" ;;
+                             # If we don't know, obey --enable-cross-guesses.
+            *)               gl_cv_func_symlink_works="$gl_cross_guess_normal" ;;
+          esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <unistd.h>
+
+int
+main (void)
+{
+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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_symlink_works=yes
+else $as_nop
+  gl_cv_func_symlink_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+      rm -f conftest.f conftest.link conftest.lnk2
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_symlink_works" >&5
+printf "%s\n" "$gl_cv_func_symlink_works" >&6; }
+    case "$gl_cv_func_symlink_works" in
+      *yes) ;;
+      *)
+        REPLACE_SYMLINK=1
+        ;;
+    esac
+  fi
+
+  if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS symlink.$ac_objext"
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_SYMLINK" != 1; then
+        if test "$GL_M4_GNULIB_SYMLINK" = 0; then
+      GL_M4_GNULIB_SYMLINK=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_SYMLINK="($GL_M4_GNULIB_SYMLINK || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_SYMLINK 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  if test $gl_threads_api = posix; then
+    gl_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIBMULTITHREAD"
+    ac_fn_c_check_func "$LINENO" "pthread_atfork" "ac_cv_func_pthread_atfork"
+if test "x$ac_cv_func_pthread_atfork" = xyes
+then :
+  printf "%s\n" "#define HAVE_PTHREAD_ATFORK 1" >>confdefs.h
+
+fi
+
+    LIBS="$gl_save_LIBS"
+  fi
+
+
+
+
+  if test $ac_cv_have_decl_unsetenv = no; then
+    HAVE_DECL_UNSETENV=0
+  fi
+  ac_fn_c_check_func "$LINENO" "unsetenv" "ac_cv_func_unsetenv"
+if test "x$ac_cv_func_unsetenv" = xyes
+then :
+  printf "%s\n" "#define HAVE_UNSETENV 1" >>confdefs.h
+
+fi
+
+  if test $ac_cv_func_unsetenv = no; then
+    HAVE_UNSETENV=0
+  else
+    HAVE_UNSETENV=1
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for unsetenv() return type" >&5
+printf %s "checking for unsetenv() return type... " >&6; }
+if test ${gt_cv_func_unsetenv_ret+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#undef _BSD
+#define _BSD 1 /* unhide unsetenv declaration in OSF/1 5.1 <stdlib.h> */
+#include <stdlib.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int unsetenv (const char *name);
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  gt_cv_func_unsetenv_ret='int'
+else $as_nop
+  gt_cv_func_unsetenv_ret='void'
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_unsetenv_ret" >&5
+printf "%s\n" "$gt_cv_func_unsetenv_ret" >&6; }
+    if test $gt_cv_func_unsetenv_ret = 'void'; then
+
+printf "%s\n" "#define VOID_UNSETENV 1" >>confdefs.h
+
+      REPLACE_UNSETENV=1
+    fi
+
+                { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether unsetenv obeys POSIX" >&5
+printf %s "checking whether unsetenv obeys POSIX... " >&6; }
+if test ${gl_cv_func_unsetenv_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+                    # Guess yes on glibc systems.
+            *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+                    # If we don't know, obey --enable-cross-guesses.
+            *)      gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
+          esac
+
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+            #include <stdlib.h>
+            #include <errno.h>
+            extern char **environ;
+
+
+$gl_mda_defines
+
+int
+main (void)
+{
+
+            char entry1[] = "a=1";
+            char entry2[] = "b=2";
+            char *env[] = { entry1, entry2, NULL };
+            if (putenv ((char *) "a=1")) return 1;
+            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;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_unsetenv_works=yes
+else $as_nop
+  gl_cv_func_unsetenv_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_unsetenv_works" >&5
+printf "%s\n" "$gl_cv_func_unsetenv_works" >&6; }
+    case "$gl_cv_func_unsetenv_works" in
+      *yes) ;;
+      *)
+        REPLACE_UNSETENV=1
+        ;;
+    esac
+  fi
+
+  if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS unsetenv.$ac_objext"
+
+
+
+
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_UNSETENV" != 1; then
+        if test "$GL_M4_GNULIB_UNSETENV" = 0; then
+      GL_M4_GNULIB_UNSETENV=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_UNSETENV="($GL_M4_GNULIB_UNSETENV || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_UNSETENV 1" >>confdefs.h
+
+
+
+  abs_aux_dir=`cd "$ac_aux_dir"; pwd`
+
+
+  abs_aux_dir=`cd "$ac_aux_dir"; pwd`
+
+
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional french locale" >&5
+printf %s "checking for a traditional french locale... " >&6; }
+if test ${gt_cv_locale_fr+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
+     one byte long. This excludes the UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+# endif
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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 Mac OS 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
+              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
+                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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr" >&5
+printf "%s\n" "$gt_cv_locale_fr" >&6; }
+  LOCALE_FR=$gt_cv_locale_fr
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a french Unicode locale" >&5
+printf %s "checking for a french Unicode locale... " >&6; }
+if test ${gt_cv_locale_fr_utf8+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     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 __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+  /* Check whether the decimal separator is a comma.
+     On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
+     are nl_langinfo(RADIXCHAR) are both ".".  */
+  if (localeconv () ->decimal_point[0] != ',') return 1;
+#endif
+  return 0;
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows 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
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_fr_utf8" >&5
+printf "%s\n" "$gt_cv_locale_fr_utf8" >&6; }
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a traditional japanese locale" >&5
+printf %s "checking for a traditional japanese locale... " >&6; }
+if test ${gt_cv_locale_ja+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
+     on Cygwin 1.5.x.  */
+  if (MB_CUR_MAX == 1)
+    return 1;
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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 Windows, 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 Mac OS 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
+              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
+                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
+                  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
+          ;;
+      esac
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_ja" >&5
+printf "%s\n" "$gt_cv_locale_ja" >&6; }
+  LOCALE_JA=$gt_cv_locale_ja
+
+
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a transitional chinese locale" >&5
+printf %s "checking for a transitional chinese locale... " >&6; }
+if test ${gt_cv_locale_zh_CN+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <time.h>
+#if HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+#include <stdlib.h>
+#include <string.h>
+struct tm t;
+char buf[16];
+int main ()
+{
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
+  /* Check whether the given locale name is recognized by the system.  */
+# if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, setlocale(category, "") looks at the system settings,
+     not at the environment variables.  Also, when an encoding suffix such
+     as ".65001" or ".54936" is specified, 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 Mac OS 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.
+     On OpenBSD 4.0, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "646". In this situation,
+     some unit tests fail.
+     On MirBSD 10, when an unsupported locale is specified, setlocale()
+     succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
+# if HAVE_LANGINFO_CODESET
+  {
+    const char *cs = nl_langinfo (CODESET);
+    if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
+        || strcmp (cs, "UTF-8") == 0)
+      return 1;
+  }
+# endif
+# ifdef __CYGWIN__
+  /* On Cygwin, avoid locale names without encoding suffix, because the
+     locale_charset() function relies on the encoding suffix.  Note that
+     LC_ALL is set on the command line.  */
+  if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
+# endif
+  /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
+     This excludes the UTF-8 encoding (except on MirBSD).  */
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
+  /* Check whether a typical GB18030 multibyte sequence is recognized as a
+     single wide character.  This excludes the GB2312 and GBK encodings.  */
+  if (mblen ("\203\062\332\066", 5) != 4)
+    return 1;
+  return 0;
+#endif
+}
+
+_ACEOF
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest$ac_exeext; then
+      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",
@@ -40838,484 +59252,1948 @@ _ACEOF
           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
+            # None found.
+            gt_cv_locale_zh_CN=none
+          fi
+          ;;
+        solaris2.8)
+          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
+          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
+          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
+          gt_cv_locale_zh_CN=none
+          ;;
+        *)
+          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+          # otherwise on Mac OS 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.
+      gt_cv_locale_zh_CN=none
+    fi
+    rm -fr conftest*
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
+printf "%s\n" "$gt_cv_locale_zh_CN" >&6; }
+  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
+
+
+
+
+
+
+  if test $ac_cv_func_wctob = no; then
+    HAVE_WCTOB=0
+    HAVE_DECL_WCTOB=0
+  else
+    HAVE_WCTOB=1
+
+
+
+         { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5
+printf %s "checking whether wctob works... " >&6; }
+if test ${gl_cv_func_wctob_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+                        case "$host_os" in
+            # Guess no on Solaris <= 9 and Cygwin.
+          solaris2.[1-9] | solaris2.[1-9].* | cygwin*)
+            gl_cv_func_wctob_works="guessing no" ;;
+            # Guess no on native Windows.
+          mingw*)
+            gl_cv_func_wctob_works="guessing no" ;;
+            # Guess yes otherwise.
+          *) gl_cv_func_wctob_works="guessing yes" ;;
+        esac
+        case "$host_os" in
+          cygwin*)
+            if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <wchar.h>
+
+register long global __asm__ ("%ebx");
+
+int main ()
+{
+  setlocale (LC_ALL, "en_US.UTF-8");
+
+  global = 0x12345678;
+  if (wctob (0x00FC) != -1)
+    return 1;
+  if (global != 0x12345678)
+    return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  :
+else $as_nop
+  gl_cv_func_wctob_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+            ;;
+        esac
+        if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then
+          if test "$cross_compiling" = yes
+then :
+  :
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <locale.h>
+#include <stdlib.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+    {
+      wchar_t wc;
+
+      if (mbtowc (&wc, "\374", 1) == 1)
+        if (wctob (wc) != (unsigned char) '\374')
+          return 1;
+    }
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  gl_cv_func_wctob_works=yes
+else $as_nop
+  gl_cv_func_wctob_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+        fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5
+printf "%s\n" "$gl_cv_func_wctob_works" >&6; }
+    case "$gl_cv_func_wctob_works" in
+      *yes) ;;
+      *) REPLACE_WCTOB=1 ;;
+    esac
+    if test $REPLACE_WCTOB = 0; then
+
+            ac_fn_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" "
+        #include <wchar.h>
+
+" "$ac_c_undeclared_builtin_options" "CFLAGS"
+if test "x$ac_cv_have_decl_wctob" = xyes
+then :
+  ac_have_decl=1
+else $as_nop
+  ac_have_decl=0
+fi
+printf "%s\n" "#define HAVE_DECL_WCTOB $ac_have_decl" >>confdefs.h
+
+      if test $ac_cv_have_decl_wctob != yes; then
+        HAVE_DECL_WCTOB=0
+      fi
+    fi
+  fi
+
+  if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS wctob.$ac_objext"
+
+
+  :
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_WCTOB" != 1; then
+        if test "$GL_M4_GNULIB_WCTOB" = 0; then
+      GL_M4_GNULIB_WCTOB=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_WCTOB="($GL_M4_GNULIB_WCTOB || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_WCTOB 1" >>confdefs.h
+
+
+
+
+
+
+  if false; then
+    REPLACE_WCTOMB=1
+  fi
+
+  if test $REPLACE_WCTOMB = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS wctomb.$ac_objext"
+
+
+  :
+
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_WCTOMB" != 1; then
+        if test "$GL_M4_GNULIB_WCTOMB" = 0; then
+      GL_M4_GNULIB_WCTOMB=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_WCTOMB="($GL_M4_GNULIB_WCTOMB || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_WCTOMB 1" >>confdefs.h
+
+
+
+
+  case "$host_os" in
+    mingw*)
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS windows-thread.$ac_objext"
+
+      ;;
+  esac
+
+
+
+
+    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+      REPLACE_WRITE=1
+    fi
+
+
+
+
+
+    if test $gl_cv_header_signal_h_SIGPIPE != yes; then
+      REPLACE_WRITE=1
+    fi
+
+
+
+  if test $REPLACE_WRITE = 1; then
+
+
+
+
+
+
+
+
+  M4tests_LIBOBJS="$M4tests_LIBOBJS write.$ac_objext"
+
+    :
+  fi
+
+
+
+
+
+
+
+
+
+    if test "$GL_M4_GNULIB_WRITE" != 1; then
+        if test "$GL_M4_GNULIB_WRITE" = 0; then
+      GL_M4_GNULIB_WRITE=$gl_module_indicator_condition
+    else
+      GL_M4_GNULIB_WRITE="($GL_M4_GNULIB_WRITE || $gl_module_indicator_condition)"
+    fi
+  fi
+
+
+
+
+
+printf "%s\n" "#define GNULIB_TEST_WRITE 1" >>confdefs.h
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  LIBM4_LIBDEPS="$gl_libdeps"
+
+  LIBM4_LTLIBDEPS="$gl_ltlibdeps"
+
+  LIBTESTS_LIBDEPS="$gltests_libdeps"
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether an open file can be renamed" >&5
+printf %s "checking whether an open file can be renamed... " >&6; }
+if test ${M4_cv_func_rename_open_file_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  if test "$cross_compiling" = yes
+then :
+  M4_cv_func_rename_open_file_works='guessing no'
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+int
+main (void)
+{
+FILE *f = fopen ("conftest.1", "w+");
+       int result = rename ("conftest.1", "conftest.2");
+       fclose (f); remove ("conftest.1"); remove ("conftest.2");
+       return result;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  M4_cv_func_rename_open_file_works=yes
+else $as_nop
+  M4_cv_func_rename_open_file_works=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $M4_cv_func_rename_open_file_works" >&5
+printf "%s\n" "$M4_cv_func_rename_open_file_works" >&6; }
+if test "$M4_cv_func_rename_open_file_works" = yes ; then
+  M4_rename_open_works=1
+else
+  M4_rename_open_works=0
+fi
+
+printf "%s\n" "#define RENAME_OPEN_FILE_WORKS $M4_rename_open_works" >>confdefs.h
+
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if changeword is wanted" >&5
+printf %s "checking if changeword is wanted... " >&6; }
+# Check whether --enable-changeword was given.
+if test ${enable_changeword+y}
+then :
+  enableval=$enable_changeword; if test "$enableval" = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+printf "%s\n" "#define ENABLE_CHANGEWORD 1" >>confdefs.h
+
+  else
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+  fi
+else $as_nop
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking which shell to use for syscmd" >&5
+printf %s "checking which shell to use for syscmd... " >&6; }
+
+# Check whether --with-syscmd-shell was given.
+if test ${with_syscmd_shell+y}
+then :
+  withval=$with_syscmd_shell; case $withval in
+    yes) with_syscmd_shell=no;;
+   esac
+else $as_nop
+  with_syscmd_shell=no
+fi
+
+if test "$with_syscmd_shell" = no ; then
+  with_syscmd_shell=/bin/sh
+  if test "$cross_compiling" != yes ; then
+    if as_fn_executable_p /bin/sh$EXEEXT
+then :
+
+else $as_nop
+  if (cmd /c) 2>/dev/null; then with_syscmd_shell=cmd; fi
+fi
+    M4_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+    for M4_dir in `if (command -p getconf PATH) 2>/dev/null ; then
+        command -p getconf PATH
+      else
+        echo "/bin$PATH_SEPARATOR$PATH"
+      fi`
+    do
+      IFS=$M4_save_IFS
+      test -z "$M4_dir" && continue
+      as_fn_executable_p "$M4_dir/sh" \
+        && { with_syscmd_shell=$M4_dir/sh; break; }
+    done
+    IFS=$M4_save_IFS
+  fi
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_syscmd_shell" >&5
+printf "%s\n" "$with_syscmd_shell" >&6; }
+
+printf "%s\n" "#define SYSCMD_SHELL \"$with_syscmd_shell\"" >>confdefs.h
+
+
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if malloc debugging is wanted" >&5
+printf %s "checking if malloc debugging is wanted... " >&6; }
+
+# Check whether --with-dmalloc was given.
+if test ${with_dmalloc+y}
+then :
+  withval=$with_dmalloc; if test "$withval" = yes; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+printf "%s\n" "yes" >&6; }
+
+printf "%s\n" "#define WITH_DMALLOC 1" >>confdefs.h
+
+  LIBS="$LIBS -ldmalloc"
+  LDFLAGS="$LDFLAGS -g"
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+else $as_nop
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ac_config_commands="$ac_config_commands stamp-h"
+
+
+case $host in #(
+  *-*-os2*) :
+    OS2_LDFLAGS="-Zargs-resp" ;; #(
+  *) :
+     ;;
+esac
+
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether NLS is requested" >&5
+printf %s "checking whether NLS is requested... " >&6; }
+    # Check whether --enable-nls was given.
+if test ${enable_nls+y}
+then :
+  enableval=$enable_nls; USE_NLS=$enableval
+else $as_nop
+  USE_NLS=yes
+fi
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
+printf "%s\n" "$USE_NLS" >&6; }
+
+
+
+
+      GETTEXT_MACRO_VERSION=0.19
+
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
+else
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_path_MSGFMT+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  case "$MSGFMT" in
+  [\\/]* | ?:[\\/]*)
+    ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH; do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&5
+          if $ac_dir/$ac_word --statistics /dev/null >&5 2>&1 &&
+     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+            ac_cv_path_MSGFMT="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":"
+    ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test "$MSGFMT" != ":"; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGFMT" >&5
+printf "%s\n" "$MSGFMT" >&6; }
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+  # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_path_GMSGFMT+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  case $GMSGFMT in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+    ac_cv_path_GMSGFMT="$as_dir$ac_word$ac_exec_ext"
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+  ;;
+esac
+fi
+GMSGFMT=$ac_cv_path_GMSGFMT
+if test -n "$GMSGFMT"; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $GMSGFMT" >&5
+printf "%s\n" "$GMSGFMT" >&6; }
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+
+    case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+    *) MSGFMT_015=$MSGFMT ;;
+  esac
+
+  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+    *) GMSGFMT_015=$GMSGFMT ;;
+  esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
+else
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_path_XGETTEXT+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  case "$XGETTEXT" in
+  [\\/]* | ?:[\\/]*)
+    ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH; do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&5
+          if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&5 2>&1 &&
+     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi); then
+            ac_cv_path_XGETTEXT="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+    ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test "$XGETTEXT" != ":"; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $XGETTEXT" >&5
+printf "%s\n" "$XGETTEXT" >&6; }
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+    rm -f messages.po
+
+    case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+    *) XGETTEXT_015=$XGETTEXT ;;
+  esac
+
+
+
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
+else
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "msgmerge", so it can be a program name with args.
+set dummy msgmerge; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_path_MSGMERGE+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  case "$MSGMERGE" in
+  [\\/]* | ?:[\\/]*)
+    ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH; do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&5
+          if $ac_dir/$ac_word --update -q /dev/null /dev/null >&5 2>&1; then
+            ac_cv_path_MSGMERGE="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+  test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE=":"
+    ;;
+esac
+fi
+MSGMERGE="$ac_cv_path_MSGMERGE"
+if test "$MSGMERGE" != ":"; then
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MSGMERGE" >&5
+printf "%s\n" "$MSGMERGE" >&6; }
+else
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+        test -n "$localedir" || localedir='${datadir}/locale'
+
+
+    test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+
+
+  ac_config_commands="$ac_config_commands po-directories"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFPreferencesCopyAppValue" >&5
+printf %s "checking for CFPreferencesCopyAppValue... " >&6; }
+if test ${gt_cv_func_CFPreferencesCopyAppValue+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <CoreFoundation/CFPreferences.h>
+int
+main (void)
+{
+CFPreferencesCopyAppValue(NULL, NULL)
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gt_cv_func_CFPreferencesCopyAppValue=yes
+else $as_nop
+  gt_cv_func_CFPreferencesCopyAppValue=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+     LIBS="$gt_save_LIBS"
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFPreferencesCopyAppValue" >&5
+printf "%s\n" "$gt_cv_func_CFPreferencesCopyAppValue" >&6; }
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then
+
+printf "%s\n" "#define HAVE_CFPREFERENCESCOPYAPPVALUE 1" >>confdefs.h
+
+  fi
+                    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for CFLocaleCopyPreferredLanguages" >&5
+printf %s "checking for CFLocaleCopyPreferredLanguages... " >&6; }
+if test ${gt_cv_func_CFLocaleCopyPreferredLanguages+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gt_save_LIBS="$LIBS"
+     LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <CoreFoundation/CFLocale.h>
+int
+main (void)
+{
+CFLocaleCopyPreferredLanguages();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  gt_cv_func_CFLocaleCopyPreferredLanguages=yes
+else $as_nop
+  gt_cv_func_CFLocaleCopyPreferredLanguages=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+     LIBS="$gt_save_LIBS"
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_cv_func_CFLocaleCopyPreferredLanguages" >&5
+printf "%s\n" "$gt_cv_func_CFLocaleCopyPreferredLanguages" >&6; }
+  if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+
+printf "%s\n" "#define HAVE_CFLOCALECOPYPREFERREDLANGUAGES 1" >>confdefs.h
+
+  fi
+  INTL_MACOSX_LIBS=
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+     || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+    INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
+  fi
+
+
+
+
+
+
+  LIBINTL=
+  LTLIBINTL=
+  POSUB=
+
+    case " $gt_needs " in
+    *" need-formatstring-macros "*) gt_api_version=3 ;;
+    *" need-ngettext "*) gt_api_version=2 ;;
+    *) gt_api_version=1 ;;
+  esac
+  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+    if test "$USE_NLS" = "yes"; then
+    gt_use_preinstalled_gnugettext=no
+
+
+        if test $gt_api_version -ge 3; then
+          gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+'
+        else
+          gt_revision_test_code=
+        fi
+        if test $gt_api_version -ge 2; then
+          gt_expression_test_code=' + * ngettext ("", "", 0)'
+        else
+          gt_expression_test_code=
+        fi
+
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libc" >&5
+printf %s "checking for GNU gettext in libc... " >&6; }
+if eval test \${$gt_func_gnugettext_libc+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+
+int
+main (void)
+{
+
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  eval "$gt_func_gnugettext_libc=yes"
+else $as_nop
+  eval "$gt_func_gnugettext_libc=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$gt_func_gnugettext_libc
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+
+        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+
+
+
+
+
+          am_save_CPPFLAGS="$CPPFLAGS"
+
+  for element in $INCICONV; do
+    haveit=
+    for x in $CPPFLAGS; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
+    fi
+  done
+
+
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for iconv" >&5
+printf %s "checking for iconv... " >&6; }
+if test ${am_cv_func_iconv+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+    am_cv_func_iconv="no, consider installing GNU libiconv"
+    am_cv_lib_iconv=no
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdlib.h>
+#include <iconv.h>
+
+int
+main (void)
+{
+iconv_t cd = iconv_open("","");
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+    if test "$am_cv_func_iconv" != yes; then
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS $LIBICONV"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <stdlib.h>
+#include <iconv.h>
+
+int
+main (void)
+{
+iconv_t cd = iconv_open("","");
+             iconv(cd,NULL,NULL,NULL,NULL);
+             iconv_close(cd);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+  am_cv_lib_iconv=yes
+        am_cv_func_iconv=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+      LIBS="$am_save_LIBS"
+    fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv" >&5
+printf "%s\n" "$am_cv_func_iconv" >&6; }
+  if test "$am_cv_func_iconv" = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working iconv" >&5
+printf %s "checking for working iconv... " >&6; }
+if test ${am_cv_func_iconv_works+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+                  am_save_LIBS="$LIBS"
+      if test $am_cv_lib_iconv = yes; then
+        LIBS="$LIBS $LIBICONV"
+      fi
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        if test "$cross_compiling" = yes
+then :
+  case "$host_os" in
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac
+else $as_nop
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+#include <iconv.h>
+#include <string.h>
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main (void)
+{
+int result = 0;
+  /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from
+     successful returns.  This is even documented in
+     <https://www.ibm.com/support/knowledgecenter/ssw_aix_72/i_bostechref/iconv.html> */
+  {
+    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+    if (cd_utf8_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_utf8_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
+      }
+  }
+  /* Test against Solaris 10 bug: Failures are not distinguishable from
+     successful returns.  */
+  {
+    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+    if (cd_ascii_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\263";
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_ascii_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
+      }
+  }
+  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304";
+        static char buf[2] = { (char)0xDE, (char)0xAD };
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = 1;
+        char *outptr = buf;
+        size_t outbytesleft = 1;
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#if 0 /* This bug could be worked around by the caller.  */
+  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        char buf[50];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if ((int)res > 0)
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#endif
+  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+     provided.  */
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
+  return result;
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"
+then :
+  am_cv_func_iconv_works=yes
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+        test "$am_cv_func_iconv_works" = no || break
+      done
+      LIBS="$am_save_LIBS"
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_func_iconv_works" >&5
+printf "%s\n" "$am_cv_func_iconv_works" >&6; }
+    case "$am_cv_func_iconv_works" in
+      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+      *)   am_func_iconv=yes ;;
+    esac
+  else
+    am_func_iconv=no am_cv_lib_iconv=no
+  fi
+  if test "$am_func_iconv" = yes; then
+
+printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h
+
+  fi
+  if test "$am_cv_lib_iconv" = yes; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libiconv" >&5
+printf %s "checking how to link with libiconv... " >&6; }
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBICONV" >&5
+printf "%s\n" "$LIBICONV" >&6; }
+  else
+            CPPFLAGS="$am_save_CPPFLAGS"
+    LIBICONV=
+    LTLIBICONV=
+  fi
+
+
+
+
+
+
+
+
+
+
+    use_additional=yes
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+    eval additional_includedir=\"$includedir\"
+    eval additional_libdir=\"$libdir\"
+    eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+    eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+
+# Check whether --with-libintl-prefix was given.
+if test ${with_libintl_prefix+y}
+then :
+  withval=$with_libintl_prefix;
+    if test "X$withval" = "Xno"; then
+      use_additional=no
+    else
+      if test "X$withval" = "X"; then
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+
+          eval additional_includedir=\"$includedir\"
+          eval additional_libdir=\"$libdir\"
+          eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+          eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
+
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+      else
+        additional_includedir="$withval/include"
+        additional_libdir="$withval/$acl_libdirstem"
+        additional_libdir2="$withval/$acl_libdirstem2"
+        additional_libdir3="$withval/$acl_libdirstem3"
+      fi
+    fi
+
+fi
+
+  if test "X$additional_libdir2" = "X$additional_libdir"; then
+    additional_libdir2=
+  fi
+  if test "X$additional_libdir3" = "X$additional_libdir"; then
+    additional_libdir3=
+  fi
+      LIBINTL=
+  LTLIBINTL=
+  INCINTL=
+  LIBINTL_PREFIX=
+      HAVE_LIBINTL=
+  rpathdirs=
+  ltrpathdirs=
+  names_already_handled=
+  names_next_round='intl '
+  while test -n "$names_next_round"; do
+    names_this_round="$names_next_round"
+    names_next_round=
+    for name in $names_this_round; do
+      already_handled=
+      for n in $names_already_handled; do
+        if test "$n" = "$name"; then
+          already_handled=yes
+          break
+        fi
+      done
+      if test -z "$already_handled"; then
+        names_already_handled="$names_already_handled $name"
+                        uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./+-|ABCDEFGHIJKLMNOPQRSTUVWXYZ____|'`
+        eval value=\"\$HAVE_LIB$uppername\"
+        if test -n "$value"; then
+          if test "$value" = yes; then
+            eval value=\"\$LIB$uppername\"
+            test -z "$value" || LIBINTL="${LIBINTL}${LIBINTL:+ }$value"
+            eval value=\"\$LTLIB$uppername\"
+            test -z "$value" || LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$value"
+          else
+                                    :
           fi
-          ;;
-        solaris2.8)
-          # On Solaris 8, the locales zh_CN.GB18030, zh_CN.GBK, zh.GBK are
-          # broken. One witness is the test case in gl_MBRTOWC_SANITYCHECK.
-          # Another witness is that "LC_ALL=zh_CN.GB18030 bash -c true" dumps core.
-          gt_cv_locale_zh_CN=none
-          ;;
-        *)
-          # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
-          # otherwise on Mac OS 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
+                              found_dir=
+          found_la=
+          found_so=
+          found_a=
+          eval libname=\"$acl_libname_spec\"    # typically: libname=lib$name
+          if test -n "$acl_shlibext"; then
+            shrext=".$acl_shlibext"             # typically: shrext=.so
           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
+            shrext=
+          fi
+          if test $use_additional = yes; then
+            for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+              if test "X$found_dir" = "X"; then
+                eval dir=\$$additional_libdir_variable
+                if test -n "$dir"; then
+                                                      if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
+                fi
+              fi
+            done
+          fi
+          if test "X$found_dir" = "X"; then
+            for x in $LDFLAGS $LTLIBINTL; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+              case "$x" in
+                -L*)
+                  dir=`echo "X$x" | sed -e 's/^X-L//'`
+                                    if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
+                  fi
+                                    if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
+                      found_dir="$dir"
+                      found_a="$dir/$libname.$acl_libext"
+                    fi
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
+                  ;;
+              esac
+              if test "X$found_dir" != "X"; then
+                break
+              fi
+            done
+          fi
+          if test "X$found_dir" != "X"; then
+                        LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$found_dir -l$name"
+            if test "X$found_so" != "X"; then
+                                                        if test "$enable_rpath" = no \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
+                                LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+              else
+                                                                                haveit=
+                for x in $ltrpathdirs; do
+                  if test "X$x" = "X$found_dir"; then
+                    haveit=yes
+                    break
+                  fi
+                done
+                if test -z "$haveit"; then
+                  ltrpathdirs="$ltrpathdirs $found_dir"
+                fi
+                                if test "$acl_hardcode_direct" = yes; then
+                                                      LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+                else
+                  if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then
+                                                            LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+                                                            haveit=
+                    for x in $rpathdirs; do
+                      if test "X$x" = "X$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      rpathdirs="$rpathdirs $found_dir"
+                    fi
+                  else
+                                                                                haveit=
+                    for x in $LDFLAGS $LIBINTL; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                      if test "X$x" = "X-L$found_dir"; then
+                        haveit=yes
+                        break
+                      fi
+                    done
+                    if test -z "$haveit"; then
+                      LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir"
+                    fi
+                    if test "$acl_hardcode_minus_L" != no; then
+                                                                                        LIBINTL="${LIBINTL}${LIBINTL:+ }$found_so"
+                    else
+                                                                                                                                                                                LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+                    fi
+                  fi
+                fi
+              fi
             else
-              # None found.
-              gt_cv_locale_zh_CN=none
+              if test "X$found_a" != "X"; then
+                                LIBINTL="${LIBINTL}${LIBINTL:+ }$found_a"
+              else
+                                                LIBINTL="${LIBINTL}${LIBINTL:+ }-L$found_dir -l$name"
+              fi
             fi
-          fi
-          ;;
-      esac
+                        additional_includedir=
+            case "$found_dir" in
+              */$acl_libdirstem | */$acl_libdirstem/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'`
+                if test "$name" = 'intl'; then
+                  LIBINTL_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem2 | */$acl_libdirstem2/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem2/"'*$,,'`
+                if test "$name" = 'intl'; then
+                  LIBINTL_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+              */$acl_libdirstem3 | */$acl_libdirstem3/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+                if test "$name" = 'intl'; then
+                  LIBINTL_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
+            esac
+            if test "X$additional_includedir" != "X"; then
+                                                                                                                if test "X$additional_includedir" != "X/usr/include"; then
+                haveit=
+                if test "X$additional_includedir" = "X/usr/local/include"; then
+                  if test -n "$GCC"; then
+                    case $host_os in
+                      linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                    esac
+                  fi
+                fi
+                if test -z "$haveit"; then
+                  for x in $CPPFLAGS $INCINTL; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                    if test "X$x" = "X-I$additional_includedir"; then
+                      haveit=yes
+                      break
+                    fi
+                  done
+                  if test -z "$haveit"; then
+                    if test -d "$additional_includedir"; then
+                                            INCINTL="${INCINTL}${INCINTL:+ }-I$additional_includedir"
+                    fi
+                  fi
+                fi
+              fi
+            fi
+                        if test -n "$found_la"; then
+                                                        save_libdir="$libdir"
+              case "$found_la" in
+                */* | *\\*) . "$found_la" ;;
+                *) . "./$found_la" ;;
+              esac
+              libdir="$save_libdir"
+                            for dep in $dependency_libs; do
+                case "$dep" in
+                  -L*)
+                    dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                                                                                                                                                                if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
+                      haveit=
+                      if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
+                        if test -n "$GCC"; then
+                          case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) haveit=yes;;
+                          esac
+                        fi
+                      fi
+                      if test -z "$haveit"; then
+                        haveit=
+                        for x in $LDFLAGS $LIBINTL; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$dependency_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$dependency_libdir"; then
+                                                        LIBINTL="${LIBINTL}${LIBINTL:+ }-L$dependency_libdir"
+                          fi
+                        fi
+                        haveit=
+                        for x in $LDFLAGS $LTLIBINTL; do
+
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
+
+                          if test "X$x" = "X-L$dependency_libdir"; then
+                            haveit=yes
+                            break
+                          fi
+                        done
+                        if test -z "$haveit"; then
+                          if test -d "$dependency_libdir"; then
+                                                        LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-L$dependency_libdir"
+                          fi
+                        fi
+                      fi
+                    fi
+                    ;;
+                  -R*)
+                    dir=`echo "X$dep" | sed -e 's/^X-R//'`
+                    if test "$enable_rpath" != no; then
+                                                                  haveit=
+                      for x in $rpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        rpathdirs="$rpathdirs $dir"
+                      fi
+                                                                  haveit=
+                      for x in $ltrpathdirs; do
+                        if test "X$x" = "X$dir"; then
+                          haveit=yes
+                          break
+                        fi
+                      done
+                      if test -z "$haveit"; then
+                        ltrpathdirs="$ltrpathdirs $dir"
+                      fi
+                    fi
+                    ;;
+                  -l*)
+                                                                                                                                                                dep=`echo "X$dep" | sed -e 's/^X-l//'`
+                    if test "X$dep" != Xc \
+                       || case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) false ;;
+                            *)                          true ;;
+                          esac; then
+                      names_next_round="$names_next_round $dep"
+                    fi
+                    ;;
+                  *.la)
+                                                                                names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'`
+                    ;;
+                  *)
+                                        LIBINTL="${LIBINTL}${LIBINTL:+ }$dep"
+                    LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }$dep"
+                    ;;
+                esac
+              done
+            fi
+          else
+                                                            LIBINTL="${LIBINTL}${LIBINTL:+ }-l$name"
+            LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-l$name"
+          fi
+        fi
+      fi
+    done
+  done
+  if test "X$rpathdirs" != "X"; then
+    if test -n "$acl_hardcode_libdir_separator"; then
+                        alldirs=
+      for found_dir in $rpathdirs; do
+        alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir"
+      done
+            acl_save_libdir="$libdir"
+      libdir="$alldirs"
+      eval flag=\"$acl_hardcode_libdir_flag_spec\"
+      libdir="$acl_save_libdir"
+      LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
     else
-      # If there was a link error, due to mblen(), the system is so old that
-      # it certainly doesn't have a chinese locale.
-      gt_cv_locale_zh_CN=none
+            for found_dir in $rpathdirs; do
+        acl_save_libdir="$libdir"
+        libdir="$found_dir"
+        eval flag=\"$acl_hardcode_libdir_flag_spec\"
+        libdir="$acl_save_libdir"
+        LIBINTL="${LIBINTL}${LIBINTL:+ }$flag"
+      done
     fi
-    rm -fr conftest*
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_locale_zh_CN" >&5
-$as_echo "$gt_cv_locale_zh_CN" >&6; }
-  LOCALE_ZH_CN=$gt_cv_locale_zh_CN
-
-
-
-
-
+  fi
+  if test "X$ltrpathdirs" != "X"; then
+            for found_dir in $ltrpathdirs; do
+      LTLIBINTL="${LTLIBINTL}${LTLIBINTL:+ }-R$found_dir"
+    done
+  fi
 
-  if test $ac_cv_func_wctob = no; then
-    HAVE_WCTOB=0
-    HAVE_DECL_WCTOB=0
-  else
-    HAVE_WCTOB=1
 
 
 
-         { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wctob works" >&5
-$as_echo_n "checking whether wctob works... " >&6; }
-if ${gl_cv_func_wctob_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
 
-                        case "$host_os" in
-            # Guess no on Solaris <= 9 and Cygwin.
-          solaris2.[1-9] | solaris2.[1-9].* | cygwin*)
-            gl_cv_func_wctob_works="guessing no" ;;
-            # Guess yes otherwise.
-          *) gl_cv_func_wctob_works="guessing yes" ;;
-        esac
-        case "$host_os" in
-          cygwin*)
-            if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+          { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GNU gettext in libintl" >&5
+printf %s "checking for GNU gettext in libintl... " >&6; }
+if eval test \${$gt_func_gnugettext_libintl+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+  gt_save_CPPFLAGS="$CPPFLAGS"
+            CPPFLAGS="$CPPFLAGS $INCINTL"
+            gt_save_LIBS="$LIBS"
+            LIBS="$LIBS $LIBINTL"
+                        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#include <locale.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>
-
-register long global __asm__ ("%ebx");
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
 
-int main ()
+int
+main (void)
 {
-  setlocale (LC_ALL, "en_US.UTF-8");
 
-  global = 0x12345678;
-  if (wctob (0x00FC) != -1)
-    return 1;
-  if (global != 0x12345678)
-    return 2;
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  :
-else
-  gl_cv_func_wctob_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+if ac_fn_c_try_link "$LINENO"
+then :
+  eval "$gt_func_gnugettext_libintl=yes"
+else $as_nop
+  eval "$gt_func_gnugettext_libintl=no"
 fi
-
-            ;;
-        esac
-        if test "$gl_cv_func_wctob_works" != no && test $LOCALE_FR != none; then
-          if test "$cross_compiling" = yes; then :
-  :
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+                        if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+              LIBS="$LIBS $LIBICONV"
+              cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#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 ()
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+
+int
+main (void)
 {
-  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
-    {
-      wchar_t wc;
 
-      if (mbtowc (&wc, "\374", 1) == 1)
-        if (wctob (wc) != (unsigned char) '\374')
-          return 1;
-    }
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  gl_cv_func_wctob_works=yes
-else
-  gl_cv_func_wctob_works=no
+if ac_fn_c_try_link "$LINENO"
+then :
+  LIBINTL="$LIBINTL $LIBICONV"
+                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                 eval "$gt_func_gnugettext_libintl=yes"
+
 fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+    conftest$ac_exeext conftest.$ac_ext
+            fi
+            CPPFLAGS="$gt_save_CPPFLAGS"
+            LIBS="$gt_save_LIBS"
 fi
-
+eval ac_res=\$$gt_func_gnugettext_libintl
+              { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
         fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_func_wctob_works" >&5
-$as_echo "$gl_cv_func_wctob_works" >&6; }
-    case "$gl_cv_func_wctob_works" in
-      *yes) ;;
-      *) REPLACE_WCTOB=1 ;;
-    esac
-    if test $REPLACE_WCTOB = 0; then
-
-            ac_fn_c_check_decl "$LINENO" "wctob" "ac_cv_have_decl_wctob" "
-/* 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 { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+                && test "$PACKAGE" != gettext-runtime \
+                && test "$PACKAGE" != gettext-tools; }; then
+          gt_use_preinstalled_gnugettext=yes
+        else
+                    LIBINTL=
+          LTLIBINTL=
+          INCINTL=
+        fi
 
-"
-if test "x$ac_cv_have_decl_wctob" = xyes; then :
-  ac_have_decl=1
-else
-  ac_have_decl=0
-fi
 
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_WCTOB $ac_have_decl
-_ACEOF
 
-      if test $ac_cv_have_decl_wctob != yes; then
-        HAVE_DECL_WCTOB=0
+    if test -n "$INTL_MACOSX_LIBS"; then
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+                LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
       fi
     fi
-  fi
-
-  if test $HAVE_WCTOB = 0 || test $REPLACE_WCTOB = 1; then
-
-
-
-
-
-
-
-
-  M4tests_LIBOBJS="$M4tests_LIBOBJS wctob.$ac_objext"
-
-
-  :
-
-  fi
 
+    if test "$gt_use_preinstalled_gnugettext" = "yes" \
+       || test "$nls_cv_use_gnu_gettext" = "yes"; then
 
+printf "%s\n" "#define ENABLE_NLS 1" >>confdefs.h
 
-
-
-    if test "$GNULIB_WCTOB" != 1; then
-        if test "$GNULIB_WCTOB" = 0; then
-      GNULIB_WCTOB=$gl_module_indicator_condition
     else
-      GNULIB_WCTOB="($GNULIB_WCTOB || $gl_module_indicator_condition)"
+      USE_NLS=no
     fi
   fi
 
-
-
-
-
-$as_echo "#define GNULIB_TEST_WCTOB 1" >>confdefs.h
-
-
-
-
-
-
-  if false; then
-    REPLACE_WCTOMB=1
-  fi
-
-  if test $REPLACE_WCTOMB = 1; then
-
-
-
-
-
-
-
-
-  M4tests_LIBOBJS="$M4tests_LIBOBJS wctomb.$ac_objext"
-
-
-  :
-
-  fi
-
-
-
-
-
-    if test "$GNULIB_WCTOMB" != 1; then
-        if test "$GNULIB_WCTOMB" = 0; then
-      GNULIB_WCTOMB=$gl_module_indicator_condition
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use NLS" >&5
+printf %s "checking whether to use NLS... " >&6; }
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $USE_NLS" >&5
+printf "%s\n" "$USE_NLS" >&6; }
+  if test "$USE_NLS" = "yes"; then
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking where the gettext function comes from" >&5
+printf %s "checking where the gettext function comes from... " >&6; }
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+        gt_source="external libintl"
+      else
+        gt_source="libc"
+      fi
     else
-      GNULIB_WCTOMB="($GNULIB_WCTOMB || $gl_module_indicator_condition)"
+      gt_source="included intl directory"
     fi
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $gt_source" >&5
+printf "%s\n" "$gt_source" >&6; }
   fi
 
+  if test "$USE_NLS" = "yes"; then
 
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to link with libintl" >&5
+printf %s "checking how to link with libintl... " >&6; }
+        { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $LIBINTL" >&5
+printf "%s\n" "$LIBINTL" >&6; }
 
+  for element in $INCINTL; do
+    haveit=
+    for x in $CPPFLAGS; do
 
+  acl_save_prefix="$prefix"
+  prefix="$acl_final_prefix"
+  acl_save_exec_prefix="$exec_prefix"
+  exec_prefix="$acl_final_exec_prefix"
+  eval x=\"$x\"
+  exec_prefix="$acl_save_exec_prefix"
+  prefix="$acl_save_prefix"
 
-$as_echo "#define GNULIB_TEST_WCTOMB 1" >>confdefs.h
-
-
-
-
-
-
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-    REPLACE_WRITE=1
-  fi
-
-
-
-
-    if test $gl_cv_header_signal_h_SIGPIPE != yes; then
-      REPLACE_WRITE=1
+      if test "X$x" = "X$element"; then
+        haveit=yes
+        break
+      fi
+    done
+    if test -z "$haveit"; then
+      CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element"
     fi
+  done
 
+      fi
 
 
-  if test $REPLACE_WRITE = 1; then
-
-
-
-
-
-
-
-
-  M4tests_LIBOBJS="$M4tests_LIBOBJS write.$ac_objext"
-
-    :
-  fi
-
-
+printf "%s\n" "#define HAVE_GETTEXT 1" >>confdefs.h
 
 
+printf "%s\n" "#define HAVE_DCGETTEXT 1" >>confdefs.h
 
-    if test "$GNULIB_WRITE" != 1; then
-        if test "$GNULIB_WRITE" = 0; then
-      GNULIB_WRITE=$gl_module_indicator_condition
-    else
-      GNULIB_WRITE="($GNULIB_WRITE || $gl_module_indicator_condition)"
     fi
-  fi
-
-
-
-
-
-$as_echo "#define GNULIB_TEST_WRITE 1" >>confdefs.h
 
-
-
-
-
-
-
-
-
-
-
-
-
-  LIBM4_LIBDEPS="$gl_libdeps"
-
-  LIBM4_LTLIBDEPS="$gl_ltlibdeps"
-
-  LIBTESTS_LIBDEPS="$gltests_libdeps"
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether an open file can be renamed" >&5
-$as_echo_n "checking whether an open file can be renamed... " >&6; }
-if ${M4_cv_func_rename_open_file_works+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "$cross_compiling" = yes; then :
-  M4_cv_func_rename_open_file_works='guessing no'
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-$ac_includes_default
-int
-main ()
-{
-FILE *f = fopen ("conftest.1", "w+");
-       int result = rename ("conftest.1", "conftest.2");
-       fclose (f); remove ("conftest.1"); remove ("conftest.2");
-       return result;
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-  M4_cv_func_rename_open_file_works=yes
-else
-  M4_cv_func_rename_open_file_works=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
-fi
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $M4_cv_func_rename_open_file_works" >&5
-$as_echo "$M4_cv_func_rename_open_file_works" >&6; }
-if test "$M4_cv_func_rename_open_file_works" = yes ; then
-  M4_rename_open_works=1
-else
-  M4_rename_open_works=0
-fi
-
-cat >>confdefs.h <<_ACEOF
-#define RENAME_OPEN_FILE_WORKS $M4_rename_open_works
-_ACEOF
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if changeword is wanted" >&5
-$as_echo_n "checking if changeword is wanted... " >&6; }
-# Check whether --enable-changeword was given.
-if test "${enable_changeword+set}" = set; then :
-  enableval=$enable_changeword; if test "$enableval" = yes; then
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-
-$as_echo "#define ENABLE_CHANGEWORD 1" >>confdefs.h
-
-  else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  fi
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking which shell to use for syscmd" >&5
-$as_echo_n "checking which shell to use for syscmd... " >&6; }
-
-# Check whether --with-syscmd-shell was given.
-if test "${with_syscmd_shell+set}" = set; then :
-  withval=$with_syscmd_shell; case $withval in
-    yes) with_syscmd_shell=no;;
-   esac
-else
-  with_syscmd_shell=no
-fi
-
-if test "$with_syscmd_shell" = no ; then
-  with_syscmd_shell=/bin/sh
-  if test "$cross_compiling" != yes ; then
-    if as_fn_executable_p /bin/sh$EXEEXT; then :
-
-else
-  if (cmd /c) 2>/dev/null; then with_syscmd_shell=cmd; fi
-fi
-    M4_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-    for M4_dir in `if (command -p getconf PATH) 2>/dev/null ; then
-        command -p getconf PATH
-      else
-        echo "/bin$PATH_SEPARATOR$PATH"
-      fi`
-    do
-      IFS=$M4_save_IFS
-      test -z "$M4_dir" && continue
-      as_fn_executable_p "$M4_dir/sh" \
-        && { with_syscmd_shell=$M4_dir/sh; break; }
-    done
-    IFS=$M4_save_IFS
+        POSUB=po
   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_syscmd_shell" >&5
-$as_echo "$with_syscmd_shell" >&6; }
-
-cat >>confdefs.h <<_ACEOF
-#define SYSCMD_SHELL "$with_syscmd_shell"
-_ACEOF
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if malloc debugging is wanted" >&5
-$as_echo_n "checking if malloc debugging is wanted... " >&6; }
 
-# Check whether --with-dmalloc was given.
-if test "${with_dmalloc+set}" = set; then :
-  withval=$with_dmalloc; if test "$withval" = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
+    INTLLIBS="$LIBINTL"
 
-$as_echo "#define WITH_DMALLOC 1" >>confdefs.h
 
-  LIBS="$LIBS -ldmalloc"
-  LDFLAGS="$LDFLAGS -g"
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
 
-ac_config_commands="$ac_config_commands stamp-h"
 
 
-case $host in #(
-  *-*-os2*) :
-    OS2_LDFLAGS="-Zargs-resp" ;; #(
-  *) :
-     ;;
-esac
 
 
-ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile src/Makefile tests/Makefile checks/Makefile examples/Makefile"
+ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile po/Makefile.in src/Makefile tests/Makefile checks/Makefile examples/Makefile"
 
 
 cat >confcache <<\_ACEOF
@@ -41345,8 +61223,8 @@ _ACEOF
     case $ac_val in #(
     *${as_nl}*)
       case $ac_var in #(
-      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
-$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
       esac
       case $ac_var in #(
       _ | IFS | as_nl) ;; #(
@@ -41376,15 +61254,15 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
      /^ac_cv_env_/b end
      t clear
      :clear
-     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
      t end
      s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
      :end' >>confcache
 if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
   if test -w "$cache_file"; then
     if test "x$cache_file" != "x/dev/null"; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
-$as_echo "$as_me: updating cache $cache_file" >&6;}
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
       if test ! -f "$cache_file" || test -h "$cache_file"; then
        cat confcache >"$cache_file"
       else
@@ -41398,8 +61276,8 @@ $as_echo "$as_me: updating cache $cache_file" >&6;}
       fi
     fi
   else
-    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
-$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
   fi
 fi
 rm -f confcache
@@ -41416,7 +61294,7 @@ U=
 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
   # 1. Remove the extension, and $U if already installed.
   ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
-  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
   # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
   #    will be set to the directory where LIBOBJS objects are built.
   as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
@@ -41427,14 +61305,14 @@ LIBOBJS=$ac_libobjs
 LTLIBOBJS=$ac_ltlibobjs
 
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
-$as_echo_n "checking that generated files are newer than configure... " >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+printf %s "checking that generated files are newer than configure... " >&6; }
    if test -n "$am_sleep_pid"; then
      # Hide warnings about reused PIDs.
      wait $am_sleep_pid 2>/dev/null
    fi
-   { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
-$as_echo "done" >&6; }
+   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: done" >&5
+printf "%s\n" "done" >&6; }
  if test -n "$EXEEXT"; then
   am__EXEEXT_TRUE=
   am__EXEEXT_FALSE='#'
@@ -41451,6 +61329,18 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${ANSICXX_TRUE}" && test -z "${ANSICXX_FALSE}"; then
+  as_fn_error $? "conditional \"ANSICXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${GL_COND_LIBTOOL_TRUE}" && test -z "${GL_COND_LIBTOOL_FALSE}"; then
   as_fn_error $? "conditional \"GL_COND_LIBTOOL\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -41468,20 +61358,44 @@ if test -z "${GL_GENERATE_FLOAT_H_TRUE}" && test -z "${GL_GENERATE_FLOAT_H_FALSE
   as_fn_error $? "conditional \"GL_GENERATE_FLOAT_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-
-
+if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_ICONV_H_TRUE}" && test -z "${GL_GENERATE_ICONV_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_ICONV_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
   as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+
 if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
   as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 CONFIG_INCLUDE=lib/config.h
 
-if test -z "${GL_GENERATE_SCHED_H_TRUE}" && test -z "${GL_GENERATE_SCHED_H_FALSE}"; then
-  as_fn_error $? "conditional \"GL_GENERATE_SCHED_H\" was never defined.
+if test -z "${GL_GENERATE_SIGSEGV_H_TRUE}" && test -z "${GL_GENERATE_SIGSEGV_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_SIGSEGV_H\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 if test -z "${GL_GENERATE_STDARG_H_TRUE}" && test -z "${GL_GENERATE_STDARG_H_FALSE}"; then
@@ -41492,16 +61406,16 @@ if test -z "${GL_GENERATE_STDBOOL_H_TRUE}" && test -z "${GL_GENERATE_STDBOOL_H_F
   as_fn_error $? "conditional \"GL_GENERATE_STDBOOL_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${GL_GENERATE_STDDEF_H_TRUE}" && test -z "${GL_GENERATE_STDDEF_H_FALSE}"; then
-  as_fn_error $? "conditional \"GL_GENERATE_STDDEF_H\" was never defined.
+if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_FALSE}"; then
+  as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${GL_GENERATE_LIMITS_H_TRUE}" && test -z "${GL_GENERATE_LIMITS_H_FALSE}"; then
-  as_fn_error $? "conditional \"GL_GENERATE_LIMITS_H\" was never defined.
+if test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_FALSE}"; then
+  as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-if test -z "${GL_GENERATE_STDINT_H_TRUE}" && test -z "${GL_GENERATE_STDINT_H_FALSE}"; then
-  as_fn_error $? "conditional \"GL_GENERATE_STDINT_H\" was never defined.
+if test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE}" && test -z "${LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_FALSE}"; then
+  as_fn_error $? "conditional \"LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
     M4_LTLIBOBJS=$M4_ltlibobjs
 
 
-if test -z "${ANSICXX_TRUE}" && test -z "${ANSICXX_FALSE}"; then
-  as_fn_error $? "conditional \"ANSICXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
-  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
 
-if test -z "${POSIX_SPAWN_PORTED_TRUE}" && test -z "${POSIX_SPAWN_PORTED_FALSE}"; then
-  as_fn_error $? "conditional \"POSIX_SPAWN_PORTED\" was never defined.
-Usually this means the macro was only invoked conditionally." "$LINENO" 5
-fi
-if test -z "${GL_GENERATE_STDALIGN_H_TRUE}" && test -z "${GL_GENERATE_STDALIGN_H_FALSE}"; then
-  as_fn_error $? "conditional \"GL_GENERATE_STDALIGN_H\" was never defined.
+
+if test -z "${GL_GENERATE_NETINET_IN_H_TRUE}" && test -z "${GL_GENERATE_NETINET_IN_H_FALSE}"; then
+  as_fn_error $? "conditional \"GL_GENERATE_NETINET_IN_H\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
 
@@ -41562,8 +61461,8 @@ fi
 ac_write_fail=0
 ac_clean_files_save=$ac_clean_files
 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
-{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
-$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
 as_write_fail=0
 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
 #! $SHELL
@@ -41586,14 +61485,16 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
 
 # Be more Bourne compatible
 DUALCASE=1; export DUALCASE # for MKS sh
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+as_nop=:
+if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
+then :
   emulate sh
   NULLCMD=:
   # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
   # is contrary to our usage.  Disable this feature.
   alias -g '${1+"$@"}'='"$@"'
   setopt NO_GLOB_SUBST
-else
+else $as_nop
   case `(set -o) 2>/dev/null` in #(
   *posix*) :
     set -o posix ;; #(
@@ -41603,46 +61504,46 @@ esac
 fi
 
 
+
+# Reset variables that may have inherited troublesome values from
+# the environment.
+
+# IFS needs to be set, to space, tab, and newline, in precisely that order.
+# (If _AS_PATH_WALK were called with IFS unset, it would have the
+# side effect of setting IFS to empty, thus disabling word splitting.)
+# Quoting is to prevent editors from complaining about space-tab.
 as_nl='
 '
 export as_nl
-# Printing a long string crashes Solaris 7 /usr/bin/printf.
-as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
-as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
-# Prefer a ksh shell builtin over an external printf program on Solaris,
-# but without wasting forks for bash or zsh.
-if test -z "$BASH_VERSION$ZSH_VERSION" \
-    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='print -r --'
-  as_echo_n='print -rn --'
-elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
-  as_echo='printf %s\n'
-  as_echo_n='printf %s'
-else
-  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
-    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
-    as_echo_n='/usr/ucb/echo -n'
-  else
-    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
-    as_echo_n_body='eval
-      arg=$1;
-      case $arg in #(
-      *"$as_nl"*)
-       expr "X$arg" : "X\\(.*\\)$as_nl";
-       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
-      esac;
-      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
-    '
-    export as_echo_n_body
-    as_echo_n='sh -c $as_echo_n_body as_echo'
-  fi
-  export as_echo_body
-  as_echo='sh -c $as_echo_body as_echo'
-fi
+IFS=" ""       $as_nl"
+
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# Ensure predictable behavior from utilities with locale-dependent output.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# We cannot yet rely on "unset" to work, but we need these variables
+# to be unset--not just set to an empty or harmless value--now, to
+# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh).  This construct
+# also avoids known problems related to "unset" and subshell syntax
+# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
+for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
+do eval test \${$as_var+y} \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+
+# Ensure that fds 0, 1, and 2 are open.
+if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
+if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
+if (exec 3>&2)            ; then :; else exec 2>/dev/null; fi
 
 # The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
+if ${PATH_SEPARATOR+false} :; then
   PATH_SEPARATOR=:
   (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
     (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
@@ -41651,13 +61552,6 @@ if test "${PATH_SEPARATOR+set}" != set; then
 fi
 
 
-# IFS
-# We need space, tab and new line, in precisely that order.  Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-IFS=" ""       $as_nl"
-
 # Find who we are.  Look in the path if we contain no directory separator.
 as_myself=
 case $0 in #((
@@ -41666,8 +61560,12 @@ case $0 in #((
 for as_dir in $PATH
 do
   IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  case $as_dir in #(((
+    '') as_dir=./ ;;
+    */) ;;
+    *) as_dir=$as_dir/ ;;
+  esac
+    test -r "$as_dir$0" && as_myself=$as_dir$0 && break
   done
 IFS=$as_save_IFS
 
@@ -41679,30 +61577,10 @@ if test "x$as_myself" = x; then
   as_myself=$0
 fi
 if test ! -f "$as_myself"; then
-  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
   exit 1
 fi
 
-# Unset variables that we do not need and which cause bugs (e.g. in
-# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
-# suppresses any "Segmentation fault" message there.  '((' could
-# trigger a bug in pdksh 5.2.14.
-for as_var in BASH_ENV ENV MAIL MAILPATH
-do eval test x\${$as_var+set} = xset \
-  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
-done
-PS1='$ '
-PS2='> '
-PS4='+ '
-
-# NLS nuisances.
-LC_ALL=C
-export LC_ALL
-LANGUAGE=C
-export LANGUAGE
-
-# CDPATH.
-(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
 
 
 # as_fn_error STATUS ERROR [LINENO LOG_FD]
@@ -41715,13 +61593,14 @@ as_fn_error ()
   as_status=$1; test $as_status -eq 0 && as_status=1
   if test "$4"; then
     as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
-    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+    printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
   fi
-  $as_echo "$as_me: error: $2" >&2
+  printf "%s\n" "$as_me: error: $2" >&2
   as_fn_exit $as_status
 } # as_fn_error
 
 
+
 # as_fn_set_status STATUS
 # -----------------------
 # Set $? to STATUS, without forking.
@@ -41748,18 +61627,20 @@ as_fn_unset ()
   { eval $1=; unset $1;}
 }
 as_unset=as_fn_unset
+
 # as_fn_append VAR VALUE
 # ----------------------
 # Append the text in VALUE to the end of the definition contained in VAR. Take
 # advantage of any shell optimizations that allow amortized linear growth over
 # repeated appends, instead of the typical quadratic growth present in naive
 # implementations.
-if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
+then :
   eval 'as_fn_append ()
   {
     eval $1+=\$2
   }'
-else
+else $as_nop
   as_fn_append ()
   {
     eval $1=\$$1\$2
@@ -41771,12 +61652,13 @@ fi # as_fn_append
 # Perform arithmetic evaluation on the ARGs, and store the result in the
 # global $as_val. Take advantage of shells that can avoid forks. The arguments
 # must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
+then :
   eval 'as_fn_arith ()
   {
     as_val=$(( $* ))
   }'
-else
+else $as_nop
   as_fn_arith ()
   {
     as_val=`expr "$@" || test $? -eq 1`
@@ -41807,7 +61689,7 @@ as_me=`$as_basename -- "$0" ||
 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
         X"$0" : 'X\(//\)$' \| \
         X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
+printf "%s\n" X/"$0" |
     sed '/^.*\/\([^/][^/]*\)\/*$/{
            s//\1/
            q
@@ -41829,6 +61711,10 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS
 as_cr_digits='0123456789'
 as_cr_alnum=$as_cr_Letters$as_cr_digits
 
+
+# Determine whether it's possible to make 'echo' print without a newline.
+# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
+# for compatibility with existing Makefiles.
 ECHO_C= ECHO_N= ECHO_T=
 case `echo -n x` in #(((((
 -n*)
@@ -41842,6 +61728,12 @@ case `echo -n x` in #(((((
   ECHO_N='-n';;
 esac
 
+# For backward compatibility with old third-party macros, we provide
+# the shell variables $as_echo and $as_echo_n.  New code should use
+# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
+as_echo='printf %s\n'
+as_echo_n='printf %s'
+
 rm -f conf$$ conf$$.exe conf$$.file
 if test -d conf$$.dir; then
   rm -f conf$$.dir/conf$$.file
@@ -41883,7 +61775,7 @@ as_fn_mkdir_p ()
     as_dirs=
     while :; do
       case $as_dir in #(
-      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
       *) as_qdir=$as_dir;;
       esac
       as_dirs="'$as_qdir' $as_dirs"
@@ -41892,7 +61784,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$as_dir" : 'X\(//\)[^/]' \| \
         X"$as_dir" : 'X\(//\)$' \| \
         X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$as_dir" |
+printf "%s\n" X"$as_dir" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -41954,8 +61846,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by GNU M4 $as_me 1.4.18, which was
-generated by GNU Autoconf 2.69.  Invocation command line was
+This file was extended by GNU M4 $as_me 1.4.19, which was
+generated by GNU Autoconf 2.71.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
   CONFIG_HEADERS  = $CONFIG_HEADERS
@@ -42019,18 +61911,20 @@ Configuration commands:
 $config_commands
 
 Report bugs to <bug-m4@gnu.org>.
-GNU M4 home page: <http://www.gnu.org/software/m4/>.
-General help using GNU software: <http://www.gnu.org/gethelp/>."
+GNU M4 home page: <https://www.gnu.org/software/m4/>.
+General help using GNU software: <https://www.gnu.org/gethelp/>."
 
 _ACEOF
+ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
+ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
-ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-GNU M4 config.status 1.4.18
-configured by $0, generated by GNU Autoconf 2.69,
+GNU M4 config.status 1.4.19
+configured by $0, generated by GNU Autoconf 2.71,
   with options \\"\$ac_cs_config\\"
 
-Copyright (C) 2012 Free Software Foundation, Inc.
+Copyright (C) 2021 Free Software Foundation, Inc.
 This config.status script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it."
 
   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
     ac_cs_recheck=: ;;
   --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
-    $as_echo "$ac_cs_version"; exit ;;
+    printf "%s\n" "$ac_cs_version"; exit ;;
   --config | --confi | --conf | --con | --co | --c )
-    $as_echo "$ac_cs_config"; exit ;;
+    printf "%s\n" "$ac_cs_config"; exit ;;
   --debug | --debu | --deb | --de | --d | -d )
     debug=: ;;
   --file | --fil | --fi | --f )
     $ac_shift
     case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
     '') as_fn_error $? "missing file argument" ;;
     esac
     as_fn_append CONFIG_FILES " '$ac_optarg'"
@@ -42086,7 +61980,7 @@ do
   --header | --heade | --head | --hea )
     $ac_shift
     case $ac_optarg in
-    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
     esac
     as_fn_append CONFIG_HEADERS " '$ac_optarg'"
     ac_need_defaults=false;;
@@ -42095,7 +61989,7 @@ do
     as_fn_error $? "ambiguous option: \`$1'
 Try \`$0 --help' for more information.";;
   --help | --hel | -h )
-    $as_echo "$ac_cs_usage"; exit ;;
+    printf "%s\n" "$ac_cs_usage"; exit ;;
   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
   | -silent | --silent | --silen | --sile | --sil | --si | --s)
     ac_cs_silent=: ;;
@@ -42123,7 +62017,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 if \$ac_cs_recheck; then
   set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
   shift
-  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
   CONFIG_SHELL='$SHELL'
   export CONFIG_SHELL
   exec "\$@"
@@ -42137,7 +62031,7 @@ exec 5>>config.log
   sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
 ## Running $as_me. ##
 _ASBOX
-  $as_echo "$ac_log"
+  printf "%s\n" "$ac_log"
 } >&5
 
 _ACEOF
@@ -42145,8 +62039,15 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 #
 # INIT-COMMANDS
 #
-AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"
 GNUmakefile=$GNUmakefile
+# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+    # from automake < 1.5.
+    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+    # Capture the value of LINGUAS because we need it to compute CATALOGS.
+    LINGUAS="${LINGUAS-%UNSET%}"
+
 
 _ACEOF
 
     "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
     "$GNUmakefile") CONFIG_LINKS="$CONFIG_LINKS $GNUmakefile:$GNUmakefile" ;;
     "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;;
+    "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;;
     "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
     "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
     "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+    "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;;
     "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
     "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
     "checks/Makefile") CONFIG_FILES="$CONFIG_FILES checks/Makefile" ;;
@@ -42178,10 +62081,10 @@ done
 # We use the long form for the default assignment because of an extremely
 # bizarre bug on SunOS 4.1.3.
 if $ac_need_defaults; then
-  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
-  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
-  test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
-  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+  test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
+  test ${CONFIG_HEADERS+y} || CONFIG_HEADERS=$config_headers
+  test ${CONFIG_LINKS+y} || CONFIG_LINKS=$config_links
+  test ${CONFIG_COMMANDS+y} || CONFIG_COMMANDS=$config_commands
 fi
 
 # Have a temporary directory for convenience.  Make it in the build tree
@@ -42517,7 +62420,7 @@ do
           esac ||
           as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
       esac
-      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
       as_fn_append ac_file_inputs " '$ac_f'"
     done
 
     # use $as_me), people would be surprised to read:
     #    /* config.h.  Generated by config.status.  */
     configure_input='Generated from '`
-         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+         printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
        `' by configure.'
     if test x"$ac_file" != x-; then
       configure_input="$ac_file.  $configure_input"
-      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
-$as_echo "$as_me: creating $ac_file" >&6;}
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+printf "%s\n" "$as_me: creating $ac_file" >&6;}
     fi
     # Neutralize special characters interpreted by sed in replacement strings.
     case $configure_input in #(
     *\&* | *\|* | *\\* )
-       ac_sed_conf_input=`$as_echo "$configure_input" |
+       ac_sed_conf_input=`printf "%s\n" "$configure_input" |
        sed 's/[\\\\&|]/\\\\&/g'`;; #(
     *) ac_sed_conf_input=$configure_input;;
     esac
@@ -42552,7 +62455,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$ac_file" : 'X\(//\)[^/]' \| \
         X"$ac_file" : 'X\(//\)$' \| \
         X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$ac_file" |
+printf "%s\n" X"$ac_file" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -42576,9 +62479,9 @@ $as_echo X"$ac_file" |
 case "$ac_dir" in
 .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
 *)
-  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
   # A ".." for each directory in $ac_dir_suffix.
-  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
   case $ac_top_builddir_sub in
   "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
   *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
@@ -42640,8 +62543,8 @@ ac_sed_dataroot='
 case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
 *datarootdir*) ac_datarootdir_seen=yes;;
 *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
   ac_datarootdir_hack='
@@ -42685,9 +62588,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
   { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
       "$ac_tmp/out"`; test -z "$ac_out"; } &&
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&5
-$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
 which seems to be undefined.  Please make sure it is defined" >&2;}
 
   rm -f "$ac_tmp/stdin"
@@ -42703,20 +62606,20 @@ which seems to be undefined.  Please make sure it is defined" >&2;}
   #
   if test x"$ac_file" != x-; then
     {
-      $as_echo "/* $configure_input  */" \
+      printf "%s\n" "/* $configure_input  */" >&1 \
       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
     } >"$ac_tmp/config.h" \
       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
-$as_echo "$as_me: $ac_file is unchanged" >&6;}
+      { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+printf "%s\n" "$as_me: $ac_file is unchanged" >&6;}
     else
       rm -f "$ac_file"
       mv "$ac_tmp/config.h" "$ac_file" \
        || as_fn_error $? "could not create $ac_file" "$LINENO" 5
     fi
   else
-    $as_echo "/* $configure_input  */" \
+    printf "%s\n" "/* $configure_input  */" >&1 \
       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
       || as_fn_error $? "could not create -" "$LINENO" 5
   fi
@@ -42736,7 +62639,7 @@ $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$_am_arg" : 'X\(//\)[^/]' \| \
         X"$_am_arg" : 'X\(//\)$' \| \
         X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$_am_arg" |
+printf "%s\n" X"$_am_arg" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -42768,8 +62671,8 @@ $as_echo X"$_am_arg" |
       ac_source=$srcdir/$ac_source
     fi
 
-    { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
-$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
+    { printf "%s\n" "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
+printf "%s\n" "$as_me: linking $ac_source to $ac_file" >&6;}
 
     if test ! -r "$ac_source"; then
       as_fn_error $? "$ac_source: file not found" "$LINENO" 5
@@ -42787,8 +62690,8 @@ $as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
       as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
   fi
  ;;
-  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
-$as_echo "$as_me: executing $ac_file commands" >&6;}
+  :C)  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+printf "%s\n" "$as_me: executing $ac_file commands" >&6;}
  ;;
   esac
 
@@ -42798,29 +62701,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
   # Older Autoconf quotes --file arguments for eval, but not when files
   # are listed without --file.  Let's play safe and only enable the eval
   # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
+  # TODO: see whether this extra hack can be removed once we start
+  # requiring Autoconf 2.70 or later.
+  case $CONFIG_FILES in #(
+  *\'*) :
+    eval set x "$CONFIG_FILES" ;; #(
+  *) :
+    set x $CONFIG_FILES ;; #(
+  *) :
+     ;;
+esac
   shift
-  for mf
+  # Used to flag and report bootstrapping failures.
+  am_rc=0
+  for am_mf
   do
     # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named 'Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
+    am_mf=`printf "%s\n" "$am_mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile which includes
+    # dependency-tracking related rules and includes.
+    # Grep'ing the whole file directly is not great: AIX grep has a line
     # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
-$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$mf" : 'X\(//\)[^/]' \| \
-        X"$mf" : 'X\(//\)$' \| \
-        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$mf" |
+    sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \
+      || continue
+    am_dirpart=`$as_dirname -- "$am_mf" ||
+$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$am_mf" : 'X\(//\)[^/]' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X"$am_mf" |
     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
            s//\1/
            q
@@ -42838,56 +62747,167 @@ $as_echo X"$mf" |
            q
          }
          s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running 'make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "$am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
-$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
-        X"$file" : 'X\(//\)[^/]' \| \
-        X"$file" : 'X\(//\)$' \| \
-        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X"$file" |
-    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
-           s//\1/
-           q
-         }
-         /^X\(\/\/\)[^/].*/{
+    am_filepart=`$as_basename -- "$am_mf" ||
+$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$am_mf" : 'X\(//\)$' \| \
+        X"$am_mf" : 'X\(/\)' \| . 2>/dev/null ||
+printf "%s\n" X/"$am_mf" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
            s//\1/
            q
          }
-         /^X\(\/\/\)$/{
+         /^X\/\(\/\/\)$/{
            s//\1/
            q
          }
-         /^X\(\/\).*/{
+         /^X\/\(\/\).*/{
            s//\1/
            q
          }
          s/.*/./; q'`
-      as_dir=$dirpart/$fdir; as_fn_mkdir_p
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    { echo "$as_me:$LINENO: cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles" >&5
+   (cd "$am_dirpart" \
+      && sed -e '/# am--include-marker/d' "$am_filepart" \
+        | $MAKE -f - am--depfiles) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } || am_rc=$?
   done
+  if test $am_rc -ne 0; then
+    { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "Something went wrong bootstrapping makefile fragments
+    for automatic dependency tracking.  If GNU make was not used, consider
+    re-running the configure script with MAKE=\"gmake\" (or whatever is
+    necessary).  You can also try re-running configure with the
+    '--disable-dependency-tracking' option to at least be able to build
+    the package (albeit without support for automatic dependency tracking).
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+  { am_dirpart=; unset am_dirpart;}
+  { am_filepart=; unset am_filepart;}
+  { am_mf=; unset am_mf;}
+  { am_rc=; unset am_rc;}
+  rm -f conftest-deps.mk
 }
  ;;
     "stamp-h":C) test -z "$CONFIG_HEADERS" || date > stamp-h ;;
+    "po-directories":C)
+    for ac_file in $CONFIG_FILES; do
+      # Support "outfile[:infile[:infile...]]"
+      case "$ac_file" in
+        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+      esac
+      # PO directories have a Makefile.in generated from Makefile.in.in.
+      case "$ac_file" in */Makefile.in)
+        # Adjust a relative srcdir.
+        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
+        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+        # In autoconf-2.13 it is called $ac_given_srcdir.
+        # In autoconf-2.50 it is called $srcdir.
+        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+        case "$ac_given_srcdir" in
+          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+          /*) top_srcdir="$ac_given_srcdir" ;;
+          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
+        esac
+        # Treat a directory as a PO directory if and only if it has a
+        # POTFILES.in file. This allows packages to have multiple PO
+        # directories under different names or in different locations.
+        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+          rm -f "$ac_dir/POTFILES"
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+          gt_tab=`printf '\t'`
+          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+          POMAKEFILEDEPS="POTFILES.in"
+          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+          # on $ac_dir but don't depend on user-specified configuration
+          # parameters.
+          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+            # The LINGUAS file contains the set of available languages.
+            if test -n "$OBSOLETE_ALL_LINGUAS"; then
+              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+            fi
+            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+            # Hide the ALL_LINGUAS assignment from automake < 1.5.
+            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+          else
+            # The set of available languages was given in configure.in.
+            # Hide the ALL_LINGUAS assignment from automake < 1.5.
+            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+          fi
+          # Compute POFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+          # Compute UPDATEPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+          # Compute DUMMYPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+          # Compute GMOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+          case "$ac_given_srcdir" in
+            .) srcdirpre= ;;
+            *) srcdirpre='$(srcdir)/' ;;
+          esac
+          POFILES=
+          UPDATEPOFILES=
+          DUMMYPOFILES=
+          GMOFILES=
+          for lang in $ALL_LINGUAS; do
+            POFILES="$POFILES $srcdirpre$lang.po"
+            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+          done
+          # CATALOGS depends on both $ac_dir and the user's LINGUAS
+          # environment variable.
+          INST_LINGUAS=
+          if test -n "$ALL_LINGUAS"; then
+            for presentlang in $ALL_LINGUAS; do
+              useit=no
+              if test "%UNSET%" != "$LINGUAS"; then
+                desiredlanguages="$LINGUAS"
+              else
+                desiredlanguages="$ALL_LINGUAS"
+              fi
+              for desiredlang in $desiredlanguages; do
+                # Use the presentlang catalog if desiredlang is
+                #   a. equal to presentlang, or
+                #   b. a variant of presentlang (because in this case,
+                #      presentlang can be used as a fallback for messages
+                #      which are not translated in the desiredlang catalog).
+                case "$desiredlang" in
+                  "$presentlang"*) useit=yes;;
+                esac
+              done
+              if test $useit = yes; then
+                INST_LINGUAS="$INST_LINGUAS $presentlang"
+              fi
+            done
+          fi
+          CATALOGS=
+          if test -n "$INST_LINGUAS"; then
+            for lang in $INST_LINGUAS; do
+              CATALOGS="$CATALOGS $lang.gmo"
+            done
+          fi
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+            if test -f "$f"; then
+              case "$f" in
+                *.orig | *.bak | *~) ;;
+                *) cat "$f" >> "$ac_dir/Makefile" ;;
+              esac
+            fi
+          done
+        fi
+        ;;
+      esac
+    done ;;
 
   esac
 done # for ac_tag
@@ -42922,7 +62942,8 @@ if test "$no_create" != yes; then
   $ac_cs_success || as_fn_exit 1
 fi
 if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
-$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
 fi
 
+
index 78b8788..517666f 100644 (file)
@@ -1,6 +1,6 @@
 # Configure template for GNU M4.           -*-Autoconf-*-
-# Copyright (C) 1991, 1993-1994, 2004-2014, 2016 Free Software
-# Foundation, Inc.
+# Copyright (C) 1991, 1993-1994, 2004-2014, 2016-2017, 2020-2021 Free
+# Software Foundation, Inc.
 #
 # This file is part of GNU M4.
 #
@@ -15,9 +15,9 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
-AC_PREREQ([2.62])
+AC_PREREQ([2.64])
 AC_INIT([GNU M4], m4_esyscmd([build-aux/git-version-gen .tarball-version]),
   [bug-m4@gnu.org])
 AC_CONFIG_AUX_DIR([build-aux])
@@ -42,6 +42,9 @@ gl_ASSERT_NO_GNULIB_POSIXCHECK
 
 # M4 is single-threaded; so we can optimize gnulib code by using this:
 gl_DISABLE_THREADS
+AC_DEFINE([GNULIB_REGEX_SINGLE_THREAD], [1], [Define to optimize regex.])
+AC_DEFINE([GNULIB_MBRTOWC_SINGLE_THREAD], [1], [Define to optimize mbrtowc.])
+AC_DEFINE([GNULIB_WCHAR_SINGLE_LOCALE], [1], [Define to optimize mbrtowc.])
 
 AC_ARG_ENABLE([gcc-warnings],
   [AS_HELP_STRING([--enable-gcc-warnings],
@@ -83,6 +86,7 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wundef"                  # K&R is anachronistic
   nw="$nw -Wtraditional"            # K&R is anachronistic
   nw="$nw -Wlong-long"              # C90 is anachronistic
+  nw="$nw -Wvla"                   # gettext's use of VLAs is safe
   nw="$nw -Wsystem-headers"         # Don't let system headers trigger warnings
   nw="$nw -Wpadded"                 # Our structs are not packed
   nw="$nw -Wconversion"             # Too many warnings for now
@@ -221,9 +225,13 @@ AC_CONFIG_COMMANDS([stamp-h], [[test -z "$CONFIG_HEADERS" || date > stamp-h]])
 AS_CASE([$host], [*-*-os2*], [OS2_LDFLAGS="-Zargs-resp"])
 AC_SUBST([OS2_LDFLAGS])
 
+AM_GNU_GETTEXT([external], [need-formatstring-macros])
+AM_GNU_GETTEXT_VERSION([0.19.2])
+
 AC_CONFIG_FILES([Makefile
                  doc/Makefile
                  lib/Makefile
+                po/Makefile.in
                  src/Makefile
                  tests/Makefile
                  checks/Makefile
index 30faf3b..49e91ce 100644 (file)
@@ -1,6 +1,7 @@
 ## Makefile.am - template for generating Makefile via Automake
 ##
-## Copyright (C) 2006-2014, 2016 Free Software Foundation, Inc.
+## Copyright (C) 2006-2014, 2016-2017, 2020-2021 Free Software
+## Foundation, Inc.
 ##
 ## This file is part of GNU M4.
 ##
@@ -15,7 +16,7 @@
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 ##
 ## This file written by Eric Blake <ebb9@byu.net>
 
index d3473c3..895a780 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -89,54 +89,69 @@ host_triplet = @host@
 subdir = doc
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
-       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
-       $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/__inline.m4 \
+       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/access.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/arpa_inet_h.m4 \
        $(top_srcdir)/m4/asm-underscore.m4 $(top_srcdir)/m4/assert.m4 \
        $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \
        $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \
-       $(top_srcdir)/m4/canonicalize.m4 \
-       $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
-       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
-       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
-       $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
-       $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirent_h.m4 \
-       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/canonicalize.m4 \
+       $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/clock_time.m4 \
+       $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closedir.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \
+       $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/creat.m4 \
+       $(top_srcdir)/m4/ctype_h.m4 $(top_srcdir)/m4/d-ino.m4 \
+       $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
        $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
-       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
-       $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \
-       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/execute.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eaccess.m4 \
+       $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+       $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+       $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/explicit_bzero.m4 \
        $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \
        $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \
        $(top_srcdir)/m4/extern-inline.m4 \
-       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fclose.m4 \
-       $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl.m4 \
-       $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopen.m4 \
+       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fchdir.m4 \
+       $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+       $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+       $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/fdopendir.m4 \
        $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/findprog-in.m4 $(top_srcdir)/m4/findprog.m4 \
        $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
        $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \
        $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fpurge.m4 \
        $(top_srcdir)/m4/freadahead.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/freopen.m4 \
        $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
        $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
-       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
-       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \
+       $(top_srcdir)/m4/ftell.m4 $(top_srcdir)/m4/ftello.m4 \
+       $(top_srcdir)/m4/ftruncate.m4 \
+       $(top_srcdir)/m4/getcwd-abort-bug.m4 \
+       $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
        $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
        $(top_srcdir)/m4/getpagesize.m4 \
-       $(top_srcdir)/m4/getprogname.m4 \
-       $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
+       $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/getrandom.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
        $(top_srcdir)/m4/gnulib-common.m4 \
        $(top_srcdir)/m4/gnulib-comp.m4 \
-       $(top_srcdir)/m4/hard-locale.m4 \
-       $(top_srcdir)/m4/include_next.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+       $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+       $(top_srcdir)/m4/inline.m4 \
+       $(top_srcdir)/m4/intl-thread-locale.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \
-       $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
-       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isblank.m4 \
-       $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
-       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/langinfo_h.m4 \
+       $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes.m4 \
+       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+       $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/isnand.m4 \
+       $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
+       $(top_srcdir)/m4/iswblank.m4 $(top_srcdir)/m4/iswdigit.m4 \
+       $(top_srcdir)/m4/iswxdigit.m4 $(top_srcdir)/m4/langinfo_h.m4 \
        $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lcmessage.m4 \
        $(top_srcdir)/m4/ldexp.m4 $(top_srcdir)/m4/ldexpl.m4 \
        $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
        $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+       $(top_srcdir)/m4/libunistring-base.m4 \
        $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/link.m4 \
        $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
        $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
@@ -146,61 +161,93 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
        $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
        $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \
+       $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
        $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
-       $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
-       $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/minmax.m4 \
+       $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+       $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
+       $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
+       $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkdir.m4 \
        $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \
        $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
        $(top_srcdir)/m4/msvc-inval.m4 \
        $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
-       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nocrash.m4 \
-       $(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/off_t.m4 \
-       $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/opendir.m4 \
-       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/pipe2.m4 \
-       $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/musl.m4 $(top_srcdir)/m4/nanosleep.m4 \
+       $(top_srcdir)/m4/netinet_in_h.m4 \
+       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/obstack.m4 \
+       $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/open-cloexec.m4 \
+       $(top_srcdir)/m4/open-slash.m4 $(top_srcdir)/m4/open.m4 \
+       $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/opendir.m4 \
+       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perror.m4 \
+       $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/pipe2.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/posix_spawn_faction_addchdir.m4 \
        $(top_srcdir)/m4/printf-frexp.m4 \
        $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \
-       $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quotearg.m4 \
-       $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+       $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/pthread-thread.m4 \
+       $(top_srcdir)/m4/pthread_h.m4 \
+       $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
+       $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \
+       $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/raise.m4 \
+       $(top_srcdir)/m4/rawmemchr.m4 $(top_srcdir)/m4/read-file.m4 \
        $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/readlink.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/reallocarray.m4 \
        $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
-       $(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/sched_h.m4 \
-       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/setenv.m4 \
-       $(top_srcdir)/m4/setlocale.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \
-       $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/rewinddir.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/sched_h.m4 \
+       $(top_srcdir)/m4/sched_yield.m4 \
+       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+       $(top_srcdir)/m4/semaphore.m4 $(top_srcdir)/m4/setenv.m4 \
+       $(top_srcdir)/m4/setlocale.m4 \
+       $(top_srcdir)/m4/setlocale_null.m4 \
+       $(top_srcdir)/m4/sh-filename.m4 \
+       $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/sigaltstack.m4 $(top_srcdir)/m4/signal_h.m4 \
        $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \
        $(top_srcdir)/m4/sigpipe.m4 $(top_srcdir)/m4/size_max.m4 \
        $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/snprintf.m4 \
-       $(top_srcdir)/m4/spawn-pipe.m4 $(top_srcdir)/m4/spawn_h.m4 \
-       $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \
+       $(top_srcdir)/m4/socketlib.m4 $(top_srcdir)/m4/sockets.m4 \
+       $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \
+       $(top_srcdir)/m4/sparcv8+.m4 $(top_srcdir)/m4/spawn-pipe.m4 \
+       $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/ssize_t.m4 \
+       $(top_srcdir)/m4/stack-direction.m4 \
+       $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
        $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
        $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
        $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
        $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
-       $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \
-       $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \
+       $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
        $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
        $(top_srcdir)/m4/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \
        $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/symlink.m4 \
+       $(top_srcdir)/m4/sys_ioctl_h.m4 \
+       $(top_srcdir)/m4/sys_random_h.m4 \
+       $(top_srcdir)/m4/sys_select_h.m4 \
        $(top_srcdir)/m4/sys_socket_h.m4 \
        $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
-       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \
-       $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+       $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+       $(top_srcdir)/m4/thread.m4 $(top_srcdir)/m4/threadlib.m4 \
        $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/tls.m4 \
        $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/ungetc.m4 \
        $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
        $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \
        $(top_srcdir)/m4/vasprintf-posix.m4 \
        $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+       $(top_srcdir)/m4/visibility.m4 \
        $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \
        $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/m4/wchar_h.m4 \
        $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wcrtomb.m4 \
        $(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
-       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
-       $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \
-       $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \
-       $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \
+       $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \
+       $(top_srcdir)/m4/yield.m4 $(top_srcdir)/m4/zzgnulib.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
@@ -327,6 +374,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CONFIG_INCLUDE = @CONFIG_INCLUDE@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
@@ -350,392 +398,519 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
 ERRNO_H = @ERRNO_H@
 EXEEXT = @EXEEXT@
 FLOAT_H = @FLOAT_H@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
 GETOPT_H = @GETOPT_H@
-GLIBC21 = @GLIBC21@
-GNULIB_ACOSF = @GNULIB_ACOSF@
-GNULIB_ACOSL = @GNULIB_ACOSL@
-GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
-GNULIB_ASINF = @GNULIB_ASINF@
-GNULIB_ASINL = @GNULIB_ASINL@
-GNULIB_ATAN2F = @GNULIB_ATAN2F@
-GNULIB_ATANF = @GNULIB_ATANF@
-GNULIB_ATANL = @GNULIB_ATANL@
-GNULIB_ATOLL = @GNULIB_ATOLL@
-GNULIB_BTOWC = @GNULIB_BTOWC@
-GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
-GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
-GNULIB_CBRT = @GNULIB_CBRT@
-GNULIB_CBRTF = @GNULIB_CBRTF@
-GNULIB_CBRTL = @GNULIB_CBRTL@
-GNULIB_CEIL = @GNULIB_CEIL@
-GNULIB_CEILF = @GNULIB_CEILF@
-GNULIB_CEILL = @GNULIB_CEILL@
-GNULIB_CHDIR = @GNULIB_CHDIR@
-GNULIB_CHOWN = @GNULIB_CHOWN@
-GNULIB_CLOSE = @GNULIB_CLOSE@
-GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
-GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
-GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
-GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
-GNULIB_COSF = @GNULIB_COSF@
-GNULIB_COSHF = @GNULIB_COSHF@
-GNULIB_COSL = @GNULIB_COSL@
-GNULIB_DIRFD = @GNULIB_DIRFD@
-GNULIB_DPRINTF = @GNULIB_DPRINTF@
-GNULIB_DUP = @GNULIB_DUP@
-GNULIB_DUP2 = @GNULIB_DUP2@
-GNULIB_DUP3 = @GNULIB_DUP3@
-GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
-GNULIB_ENVIRON = @GNULIB_ENVIRON@
-GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
-GNULIB_EXP2 = @GNULIB_EXP2@
-GNULIB_EXP2F = @GNULIB_EXP2F@
-GNULIB_EXP2L = @GNULIB_EXP2L@
-GNULIB_EXPF = @GNULIB_EXPF@
-GNULIB_EXPL = @GNULIB_EXPL@
-GNULIB_EXPM1 = @GNULIB_EXPM1@
-GNULIB_EXPM1F = @GNULIB_EXPM1F@
-GNULIB_EXPM1L = @GNULIB_EXPM1L@
-GNULIB_FABSF = @GNULIB_FABSF@
-GNULIB_FABSL = @GNULIB_FABSL@
-GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
-GNULIB_FCHDIR = @GNULIB_FCHDIR@
-GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
-GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
-GNULIB_FCLOSE = @GNULIB_FCLOSE@
-GNULIB_FCNTL = @GNULIB_FCNTL@
-GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
-GNULIB_FDOPEN = @GNULIB_FDOPEN@
-GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
-GNULIB_FFLUSH = @GNULIB_FFLUSH@
-GNULIB_FFSL = @GNULIB_FFSL@
-GNULIB_FFSLL = @GNULIB_FFSLL@
-GNULIB_FGETC = @GNULIB_FGETC@
-GNULIB_FGETS = @GNULIB_FGETS@
-GNULIB_FLOOR = @GNULIB_FLOOR@
-GNULIB_FLOORF = @GNULIB_FLOORF@
-GNULIB_FLOORL = @GNULIB_FLOORL@
-GNULIB_FMA = @GNULIB_FMA@
-GNULIB_FMAF = @GNULIB_FMAF@
-GNULIB_FMAL = @GNULIB_FMAL@
-GNULIB_FMOD = @GNULIB_FMOD@
-GNULIB_FMODF = @GNULIB_FMODF@
-GNULIB_FMODL = @GNULIB_FMODL@
-GNULIB_FOPEN = @GNULIB_FOPEN@
-GNULIB_FPRINTF = @GNULIB_FPRINTF@
-GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
-GNULIB_FPURGE = @GNULIB_FPURGE@
-GNULIB_FPUTC = @GNULIB_FPUTC@
-GNULIB_FPUTS = @GNULIB_FPUTS@
-GNULIB_FREAD = @GNULIB_FREAD@
-GNULIB_FREOPEN = @GNULIB_FREOPEN@
-GNULIB_FREXP = @GNULIB_FREXP@
-GNULIB_FREXPF = @GNULIB_FREXPF@
-GNULIB_FREXPL = @GNULIB_FREXPL@
-GNULIB_FSCANF = @GNULIB_FSCANF@
-GNULIB_FSEEK = @GNULIB_FSEEK@
-GNULIB_FSEEKO = @GNULIB_FSEEKO@
-GNULIB_FSTAT = @GNULIB_FSTAT@
-GNULIB_FSTATAT = @GNULIB_FSTATAT@
-GNULIB_FSYNC = @GNULIB_FSYNC@
-GNULIB_FTELL = @GNULIB_FTELL@
-GNULIB_FTELLO = @GNULIB_FTELLO@
-GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
-GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
-GNULIB_FWRITE = @GNULIB_FWRITE@
-GNULIB_GETC = @GNULIB_GETC@
-GNULIB_GETCHAR = @GNULIB_GETCHAR@
-GNULIB_GETCWD = @GNULIB_GETCWD@
-GNULIB_GETDELIM = @GNULIB_GETDELIM@
-GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
-GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
-GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
-GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
-GNULIB_GETLINE = @GNULIB_GETLINE@
-GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
-GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
-GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
-GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
-GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_M4_GNULIB_ACCEPT = @GL_M4_GNULIB_ACCEPT@
+GL_M4_GNULIB_ACCEPT4 = @GL_M4_GNULIB_ACCEPT4@
+GL_M4_GNULIB_ACCESS = @GL_M4_GNULIB_ACCESS@
+GL_M4_GNULIB_ACOSF = @GL_M4_GNULIB_ACOSF@
+GL_M4_GNULIB_ACOSL = @GL_M4_GNULIB_ACOSL@
+GL_M4_GNULIB_ALIGNED_ALLOC = @GL_M4_GNULIB_ALIGNED_ALLOC@
+GL_M4_GNULIB_ALPHASORT = @GL_M4_GNULIB_ALPHASORT@
+GL_M4_GNULIB_ASINF = @GL_M4_GNULIB_ASINF@
+GL_M4_GNULIB_ASINL = @GL_M4_GNULIB_ASINL@
+GL_M4_GNULIB_ATAN2F = @GL_M4_GNULIB_ATAN2F@
+GL_M4_GNULIB_ATANF = @GL_M4_GNULIB_ATANF@
+GL_M4_GNULIB_ATANL = @GL_M4_GNULIB_ATANL@
+GL_M4_GNULIB_ATOLL = @GL_M4_GNULIB_ATOLL@
+GL_M4_GNULIB_BIND = @GL_M4_GNULIB_BIND@
+GL_M4_GNULIB_BTOWC = @GL_M4_GNULIB_BTOWC@
+GL_M4_GNULIB_CALLOC_POSIX = @GL_M4_GNULIB_CALLOC_POSIX@
+GL_M4_GNULIB_CANONICALIZE_FILE_NAME = @GL_M4_GNULIB_CANONICALIZE_FILE_NAME@
+GL_M4_GNULIB_CBRT = @GL_M4_GNULIB_CBRT@
+GL_M4_GNULIB_CBRTF = @GL_M4_GNULIB_CBRTF@
+GL_M4_GNULIB_CBRTL = @GL_M4_GNULIB_CBRTL@
+GL_M4_GNULIB_CEIL = @GL_M4_GNULIB_CEIL@
+GL_M4_GNULIB_CEILF = @GL_M4_GNULIB_CEILF@
+GL_M4_GNULIB_CEILL = @GL_M4_GNULIB_CEILL@
+GL_M4_GNULIB_CHDIR = @GL_M4_GNULIB_CHDIR@
+GL_M4_GNULIB_CHOWN = @GL_M4_GNULIB_CHOWN@
+GL_M4_GNULIB_CLOSE = @GL_M4_GNULIB_CLOSE@
+GL_M4_GNULIB_CLOSEDIR = @GL_M4_GNULIB_CLOSEDIR@
+GL_M4_GNULIB_CONNECT = @GL_M4_GNULIB_CONNECT@
+GL_M4_GNULIB_COPYSIGN = @GL_M4_GNULIB_COPYSIGN@
+GL_M4_GNULIB_COPYSIGNF = @GL_M4_GNULIB_COPYSIGNF@
+GL_M4_GNULIB_COPYSIGNL = @GL_M4_GNULIB_COPYSIGNL@
+GL_M4_GNULIB_COPY_FILE_RANGE = @GL_M4_GNULIB_COPY_FILE_RANGE@
+GL_M4_GNULIB_COSF = @GL_M4_GNULIB_COSF@
+GL_M4_GNULIB_COSHF = @GL_M4_GNULIB_COSHF@
+GL_M4_GNULIB_COSL = @GL_M4_GNULIB_COSL@
+GL_M4_GNULIB_CREAT = @GL_M4_GNULIB_CREAT@
+GL_M4_GNULIB_CTIME = @GL_M4_GNULIB_CTIME@
+GL_M4_GNULIB_DIRFD = @GL_M4_GNULIB_DIRFD@
+GL_M4_GNULIB_DPRINTF = @GL_M4_GNULIB_DPRINTF@
+GL_M4_GNULIB_DUP = @GL_M4_GNULIB_DUP@
+GL_M4_GNULIB_DUP2 = @GL_M4_GNULIB_DUP2@
+GL_M4_GNULIB_DUP3 = @GL_M4_GNULIB_DUP3@
+GL_M4_GNULIB_DUPLOCALE = @GL_M4_GNULIB_DUPLOCALE@
+GL_M4_GNULIB_ENVIRON = @GL_M4_GNULIB_ENVIRON@
+GL_M4_GNULIB_EUIDACCESS = @GL_M4_GNULIB_EUIDACCESS@
+GL_M4_GNULIB_EXECL = @GL_M4_GNULIB_EXECL@
+GL_M4_GNULIB_EXECLE = @GL_M4_GNULIB_EXECLE@
+GL_M4_GNULIB_EXECLP = @GL_M4_GNULIB_EXECLP@
+GL_M4_GNULIB_EXECV = @GL_M4_GNULIB_EXECV@
+GL_M4_GNULIB_EXECVE = @GL_M4_GNULIB_EXECVE@
+GL_M4_GNULIB_EXECVP = @GL_M4_GNULIB_EXECVP@
+GL_M4_GNULIB_EXECVPE = @GL_M4_GNULIB_EXECVPE@
+GL_M4_GNULIB_EXP2 = @GL_M4_GNULIB_EXP2@
+GL_M4_GNULIB_EXP2F = @GL_M4_GNULIB_EXP2F@
+GL_M4_GNULIB_EXP2L = @GL_M4_GNULIB_EXP2L@
+GL_M4_GNULIB_EXPF = @GL_M4_GNULIB_EXPF@
+GL_M4_GNULIB_EXPL = @GL_M4_GNULIB_EXPL@
+GL_M4_GNULIB_EXPLICIT_BZERO = @GL_M4_GNULIB_EXPLICIT_BZERO@
+GL_M4_GNULIB_EXPM1 = @GL_M4_GNULIB_EXPM1@
+GL_M4_GNULIB_EXPM1F = @GL_M4_GNULIB_EXPM1F@
+GL_M4_GNULIB_EXPM1L = @GL_M4_GNULIB_EXPM1L@
+GL_M4_GNULIB_FABSF = @GL_M4_GNULIB_FABSF@
+GL_M4_GNULIB_FABSL = @GL_M4_GNULIB_FABSL@
+GL_M4_GNULIB_FACCESSAT = @GL_M4_GNULIB_FACCESSAT@
+GL_M4_GNULIB_FCHDIR = @GL_M4_GNULIB_FCHDIR@
+GL_M4_GNULIB_FCHMODAT = @GL_M4_GNULIB_FCHMODAT@
+GL_M4_GNULIB_FCHOWNAT = @GL_M4_GNULIB_FCHOWNAT@
+GL_M4_GNULIB_FCLOSE = @GL_M4_GNULIB_FCLOSE@
+GL_M4_GNULIB_FCNTL = @GL_M4_GNULIB_FCNTL@
+GL_M4_GNULIB_FDATASYNC = @GL_M4_GNULIB_FDATASYNC@
+GL_M4_GNULIB_FDOPEN = @GL_M4_GNULIB_FDOPEN@
+GL_M4_GNULIB_FDOPENDIR = @GL_M4_GNULIB_FDOPENDIR@
+GL_M4_GNULIB_FFLUSH = @GL_M4_GNULIB_FFLUSH@
+GL_M4_GNULIB_FFSL = @GL_M4_GNULIB_FFSL@
+GL_M4_GNULIB_FFSLL = @GL_M4_GNULIB_FFSLL@
+GL_M4_GNULIB_FGETC = @GL_M4_GNULIB_FGETC@
+GL_M4_GNULIB_FGETS = @GL_M4_GNULIB_FGETS@
+GL_M4_GNULIB_FLOOR = @GL_M4_GNULIB_FLOOR@
+GL_M4_GNULIB_FLOORF = @GL_M4_GNULIB_FLOORF@
+GL_M4_GNULIB_FLOORL = @GL_M4_GNULIB_FLOORL@
+GL_M4_GNULIB_FMA = @GL_M4_GNULIB_FMA@
+GL_M4_GNULIB_FMAF = @GL_M4_GNULIB_FMAF@
+GL_M4_GNULIB_FMAL = @GL_M4_GNULIB_FMAL@
+GL_M4_GNULIB_FMOD = @GL_M4_GNULIB_FMOD@
+GL_M4_GNULIB_FMODF = @GL_M4_GNULIB_FMODF@
+GL_M4_GNULIB_FMODL = @GL_M4_GNULIB_FMODL@
+GL_M4_GNULIB_FOPEN = @GL_M4_GNULIB_FOPEN@
+GL_M4_GNULIB_FPRINTF = @GL_M4_GNULIB_FPRINTF@
+GL_M4_GNULIB_FPRINTF_POSIX = @GL_M4_GNULIB_FPRINTF_POSIX@
+GL_M4_GNULIB_FPURGE = @GL_M4_GNULIB_FPURGE@
+GL_M4_GNULIB_FPUTC = @GL_M4_GNULIB_FPUTC@
+GL_M4_GNULIB_FPUTS = @GL_M4_GNULIB_FPUTS@
+GL_M4_GNULIB_FREAD = @GL_M4_GNULIB_FREAD@
+GL_M4_GNULIB_FREE_POSIX = @GL_M4_GNULIB_FREE_POSIX@
+GL_M4_GNULIB_FREOPEN = @GL_M4_GNULIB_FREOPEN@
+GL_M4_GNULIB_FREXP = @GL_M4_GNULIB_FREXP@
+GL_M4_GNULIB_FREXPF = @GL_M4_GNULIB_FREXPF@
+GL_M4_GNULIB_FREXPL = @GL_M4_GNULIB_FREXPL@
+GL_M4_GNULIB_FSCANF = @GL_M4_GNULIB_FSCANF@
+GL_M4_GNULIB_FSEEK = @GL_M4_GNULIB_FSEEK@
+GL_M4_GNULIB_FSEEKO = @GL_M4_GNULIB_FSEEKO@
+GL_M4_GNULIB_FSTAT = @GL_M4_GNULIB_FSTAT@
+GL_M4_GNULIB_FSTATAT = @GL_M4_GNULIB_FSTATAT@
+GL_M4_GNULIB_FSYNC = @GL_M4_GNULIB_FSYNC@
+GL_M4_GNULIB_FTELL = @GL_M4_GNULIB_FTELL@
+GL_M4_GNULIB_FTELLO = @GL_M4_GNULIB_FTELLO@
+GL_M4_GNULIB_FTRUNCATE = @GL_M4_GNULIB_FTRUNCATE@
+GL_M4_GNULIB_FUTIMENS = @GL_M4_GNULIB_FUTIMENS@
+GL_M4_GNULIB_FWRITE = @GL_M4_GNULIB_FWRITE@
+GL_M4_GNULIB_GETC = @GL_M4_GNULIB_GETC@
+GL_M4_GNULIB_GETCHAR = @GL_M4_GNULIB_GETCHAR@
+GL_M4_GNULIB_GETCWD = @GL_M4_GNULIB_GETCWD@
+GL_M4_GNULIB_GETDELIM = @GL_M4_GNULIB_GETDELIM@
+GL_M4_GNULIB_GETDOMAINNAME = @GL_M4_GNULIB_GETDOMAINNAME@
+GL_M4_GNULIB_GETDTABLESIZE = @GL_M4_GNULIB_GETDTABLESIZE@
+GL_M4_GNULIB_GETENTROPY = @GL_M4_GNULIB_GETENTROPY@
+GL_M4_GNULIB_GETGROUPS = @GL_M4_GNULIB_GETGROUPS@
+GL_M4_GNULIB_GETHOSTNAME = @GL_M4_GNULIB_GETHOSTNAME@
+GL_M4_GNULIB_GETLINE = @GL_M4_GNULIB_GETLINE@
+GL_M4_GNULIB_GETLOADAVG = @GL_M4_GNULIB_GETLOADAVG@
+GL_M4_GNULIB_GETLOGIN = @GL_M4_GNULIB_GETLOGIN@
+GL_M4_GNULIB_GETLOGIN_R = @GL_M4_GNULIB_GETLOGIN_R@
+GL_M4_GNULIB_GETOPT_POSIX = @GL_M4_GNULIB_GETOPT_POSIX@
+GL_M4_GNULIB_GETPAGESIZE = @GL_M4_GNULIB_GETPAGESIZE@
+GL_M4_GNULIB_GETPASS = @GL_M4_GNULIB_GETPASS@
+GL_M4_GNULIB_GETPEERNAME = @GL_M4_GNULIB_GETPEERNAME@
+GL_M4_GNULIB_GETRANDOM = @GL_M4_GNULIB_GETRANDOM@
+GL_M4_GNULIB_GETSOCKNAME = @GL_M4_GNULIB_GETSOCKNAME@
+GL_M4_GNULIB_GETSOCKOPT = @GL_M4_GNULIB_GETSOCKOPT@
+GL_M4_GNULIB_GETSUBOPT = @GL_M4_GNULIB_GETSUBOPT@
+GL_M4_GNULIB_GETTIMEOFDAY = @GL_M4_GNULIB_GETTIMEOFDAY@
+GL_M4_GNULIB_GETUMASK = @GL_M4_GNULIB_GETUMASK@
+GL_M4_GNULIB_GETUSERSHELL = @GL_M4_GNULIB_GETUSERSHELL@
+GL_M4_GNULIB_GRANTPT = @GL_M4_GNULIB_GRANTPT@
+GL_M4_GNULIB_GROUP_MEMBER = @GL_M4_GNULIB_GROUP_MEMBER@
+GL_M4_GNULIB_HYPOT = @GL_M4_GNULIB_HYPOT@
+GL_M4_GNULIB_HYPOTF = @GL_M4_GNULIB_HYPOTF@
+GL_M4_GNULIB_HYPOTL = @GL_M4_GNULIB_HYPOTL@
+GL_M4_GNULIB_ICONV = @GL_M4_GNULIB_ICONV@
+GL_M4_GNULIB_ILOGB = @GL_M4_GNULIB_ILOGB@
+GL_M4_GNULIB_ILOGBF = @GL_M4_GNULIB_ILOGBF@
+GL_M4_GNULIB_ILOGBL = @GL_M4_GNULIB_ILOGBL@
+GL_M4_GNULIB_IMAXABS = @GL_M4_GNULIB_IMAXABS@
+GL_M4_GNULIB_IMAXDIV = @GL_M4_GNULIB_IMAXDIV@
+GL_M4_GNULIB_INET_NTOP = @GL_M4_GNULIB_INET_NTOP@
+GL_M4_GNULIB_INET_PTON = @GL_M4_GNULIB_INET_PTON@
+GL_M4_GNULIB_IOCTL = @GL_M4_GNULIB_IOCTL@
+GL_M4_GNULIB_ISATTY = @GL_M4_GNULIB_ISATTY@
+GL_M4_GNULIB_ISBLANK = @GL_M4_GNULIB_ISBLANK@
+GL_M4_GNULIB_ISFINITE = @GL_M4_GNULIB_ISFINITE@
+GL_M4_GNULIB_ISINF = @GL_M4_GNULIB_ISINF@
+GL_M4_GNULIB_ISNAN = @GL_M4_GNULIB_ISNAN@
+GL_M4_GNULIB_ISNAND = @GL_M4_GNULIB_ISNAND@
+GL_M4_GNULIB_ISNANF = @GL_M4_GNULIB_ISNANF@
+GL_M4_GNULIB_ISNANL = @GL_M4_GNULIB_ISNANL@
+GL_M4_GNULIB_ISWBLANK = @GL_M4_GNULIB_ISWBLANK@
+GL_M4_GNULIB_ISWCTYPE = @GL_M4_GNULIB_ISWCTYPE@
+GL_M4_GNULIB_ISWDIGIT = @GL_M4_GNULIB_ISWDIGIT@
+GL_M4_GNULIB_ISWXDIGIT = @GL_M4_GNULIB_ISWXDIGIT@
+GL_M4_GNULIB_LCHMOD = @GL_M4_GNULIB_LCHMOD@
+GL_M4_GNULIB_LCHOWN = @GL_M4_GNULIB_LCHOWN@
+GL_M4_GNULIB_LDEXPF = @GL_M4_GNULIB_LDEXPF@
+GL_M4_GNULIB_LDEXPL = @GL_M4_GNULIB_LDEXPL@
+GL_M4_GNULIB_LINK = @GL_M4_GNULIB_LINK@
+GL_M4_GNULIB_LINKAT = @GL_M4_GNULIB_LINKAT@
+GL_M4_GNULIB_LISTEN = @GL_M4_GNULIB_LISTEN@
+GL_M4_GNULIB_LOCALECONV = @GL_M4_GNULIB_LOCALECONV@
+GL_M4_GNULIB_LOCALENAME = @GL_M4_GNULIB_LOCALENAME@
+GL_M4_GNULIB_LOCALTIME = @GL_M4_GNULIB_LOCALTIME@
+GL_M4_GNULIB_LOG = @GL_M4_GNULIB_LOG@
+GL_M4_GNULIB_LOG10 = @GL_M4_GNULIB_LOG10@
+GL_M4_GNULIB_LOG10F = @GL_M4_GNULIB_LOG10F@
+GL_M4_GNULIB_LOG10L = @GL_M4_GNULIB_LOG10L@
+GL_M4_GNULIB_LOG1P = @GL_M4_GNULIB_LOG1P@
+GL_M4_GNULIB_LOG1PF = @GL_M4_GNULIB_LOG1PF@
+GL_M4_GNULIB_LOG1PL = @GL_M4_GNULIB_LOG1PL@
+GL_M4_GNULIB_LOG2 = @GL_M4_GNULIB_LOG2@
+GL_M4_GNULIB_LOG2F = @GL_M4_GNULIB_LOG2F@
+GL_M4_GNULIB_LOG2L = @GL_M4_GNULIB_LOG2L@
+GL_M4_GNULIB_LOGB = @GL_M4_GNULIB_LOGB@
+GL_M4_GNULIB_LOGBF = @GL_M4_GNULIB_LOGBF@
+GL_M4_GNULIB_LOGBL = @GL_M4_GNULIB_LOGBL@
+GL_M4_GNULIB_LOGF = @GL_M4_GNULIB_LOGF@
+GL_M4_GNULIB_LOGL = @GL_M4_GNULIB_LOGL@
+GL_M4_GNULIB_LSEEK = @GL_M4_GNULIB_LSEEK@
+GL_M4_GNULIB_LSTAT = @GL_M4_GNULIB_LSTAT@
+GL_M4_GNULIB_MALLOC_POSIX = @GL_M4_GNULIB_MALLOC_POSIX@
+GL_M4_GNULIB_MBRLEN = @GL_M4_GNULIB_MBRLEN@
+GL_M4_GNULIB_MBRTOWC = @GL_M4_GNULIB_MBRTOWC@
+GL_M4_GNULIB_MBSCASECMP = @GL_M4_GNULIB_MBSCASECMP@
+GL_M4_GNULIB_MBSCASESTR = @GL_M4_GNULIB_MBSCASESTR@
+GL_M4_GNULIB_MBSCHR = @GL_M4_GNULIB_MBSCHR@
+GL_M4_GNULIB_MBSCSPN = @GL_M4_GNULIB_MBSCSPN@
+GL_M4_GNULIB_MBSINIT = @GL_M4_GNULIB_MBSINIT@
+GL_M4_GNULIB_MBSLEN = @GL_M4_GNULIB_MBSLEN@
+GL_M4_GNULIB_MBSNCASECMP = @GL_M4_GNULIB_MBSNCASECMP@
+GL_M4_GNULIB_MBSNLEN = @GL_M4_GNULIB_MBSNLEN@
+GL_M4_GNULIB_MBSNRTOWCS = @GL_M4_GNULIB_MBSNRTOWCS@
+GL_M4_GNULIB_MBSPBRK = @GL_M4_GNULIB_MBSPBRK@
+GL_M4_GNULIB_MBSPCASECMP = @GL_M4_GNULIB_MBSPCASECMP@
+GL_M4_GNULIB_MBSRCHR = @GL_M4_GNULIB_MBSRCHR@
+GL_M4_GNULIB_MBSRTOWCS = @GL_M4_GNULIB_MBSRTOWCS@
+GL_M4_GNULIB_MBSSEP = @GL_M4_GNULIB_MBSSEP@
+GL_M4_GNULIB_MBSSPN = @GL_M4_GNULIB_MBSSPN@
+GL_M4_GNULIB_MBSSTR = @GL_M4_GNULIB_MBSSTR@
+GL_M4_GNULIB_MBSTOK_R = @GL_M4_GNULIB_MBSTOK_R@
+GL_M4_GNULIB_MBTOWC = @GL_M4_GNULIB_MBTOWC@
+GL_M4_GNULIB_MDA_ACCESS = @GL_M4_GNULIB_MDA_ACCESS@
+GL_M4_GNULIB_MDA_CHDIR = @GL_M4_GNULIB_MDA_CHDIR@
+GL_M4_GNULIB_MDA_CHMOD = @GL_M4_GNULIB_MDA_CHMOD@
+GL_M4_GNULIB_MDA_CLOSE = @GL_M4_GNULIB_MDA_CLOSE@
+GL_M4_GNULIB_MDA_CREAT = @GL_M4_GNULIB_MDA_CREAT@
+GL_M4_GNULIB_MDA_DUP = @GL_M4_GNULIB_MDA_DUP@
+GL_M4_GNULIB_MDA_DUP2 = @GL_M4_GNULIB_MDA_DUP2@
+GL_M4_GNULIB_MDA_ECVT = @GL_M4_GNULIB_MDA_ECVT@
+GL_M4_GNULIB_MDA_EXECL = @GL_M4_GNULIB_MDA_EXECL@
+GL_M4_GNULIB_MDA_EXECLE = @GL_M4_GNULIB_MDA_EXECLE@
+GL_M4_GNULIB_MDA_EXECLP = @GL_M4_GNULIB_MDA_EXECLP@
+GL_M4_GNULIB_MDA_EXECV = @GL_M4_GNULIB_MDA_EXECV@
+GL_M4_GNULIB_MDA_EXECVE = @GL_M4_GNULIB_MDA_EXECVE@
+GL_M4_GNULIB_MDA_EXECVP = @GL_M4_GNULIB_MDA_EXECVP@
+GL_M4_GNULIB_MDA_EXECVPE = @GL_M4_GNULIB_MDA_EXECVPE@
+GL_M4_GNULIB_MDA_FCLOSEALL = @GL_M4_GNULIB_MDA_FCLOSEALL@
+GL_M4_GNULIB_MDA_FCVT = @GL_M4_GNULIB_MDA_FCVT@
+GL_M4_GNULIB_MDA_FDOPEN = @GL_M4_GNULIB_MDA_FDOPEN@
+GL_M4_GNULIB_MDA_FILENO = @GL_M4_GNULIB_MDA_FILENO@
+GL_M4_GNULIB_MDA_GCVT = @GL_M4_GNULIB_MDA_GCVT@
+GL_M4_GNULIB_MDA_GETCWD = @GL_M4_GNULIB_MDA_GETCWD@
+GL_M4_GNULIB_MDA_GETPID = @GL_M4_GNULIB_MDA_GETPID@
+GL_M4_GNULIB_MDA_GETW = @GL_M4_GNULIB_MDA_GETW@
+GL_M4_GNULIB_MDA_ISATTY = @GL_M4_GNULIB_MDA_ISATTY@
+GL_M4_GNULIB_MDA_J0 = @GL_M4_GNULIB_MDA_J0@
+GL_M4_GNULIB_MDA_J1 = @GL_M4_GNULIB_MDA_J1@
+GL_M4_GNULIB_MDA_JN = @GL_M4_GNULIB_MDA_JN@
+GL_M4_GNULIB_MDA_LSEEK = @GL_M4_GNULIB_MDA_LSEEK@
+GL_M4_GNULIB_MDA_MEMCCPY = @GL_M4_GNULIB_MDA_MEMCCPY@
+GL_M4_GNULIB_MDA_MKDIR = @GL_M4_GNULIB_MDA_MKDIR@
+GL_M4_GNULIB_MDA_MKTEMP = @GL_M4_GNULIB_MDA_MKTEMP@
+GL_M4_GNULIB_MDA_OPEN = @GL_M4_GNULIB_MDA_OPEN@
+GL_M4_GNULIB_MDA_PUTENV = @GL_M4_GNULIB_MDA_PUTENV@
+GL_M4_GNULIB_MDA_PUTW = @GL_M4_GNULIB_MDA_PUTW@
+GL_M4_GNULIB_MDA_READ = @GL_M4_GNULIB_MDA_READ@
+GL_M4_GNULIB_MDA_RMDIR = @GL_M4_GNULIB_MDA_RMDIR@
+GL_M4_GNULIB_MDA_STRDUP = @GL_M4_GNULIB_MDA_STRDUP@
+GL_M4_GNULIB_MDA_SWAB = @GL_M4_GNULIB_MDA_SWAB@
+GL_M4_GNULIB_MDA_TEMPNAM = @GL_M4_GNULIB_MDA_TEMPNAM@
+GL_M4_GNULIB_MDA_TZSET = @GL_M4_GNULIB_MDA_TZSET@
+GL_M4_GNULIB_MDA_UMASK = @GL_M4_GNULIB_MDA_UMASK@
+GL_M4_GNULIB_MDA_UNLINK = @GL_M4_GNULIB_MDA_UNLINK@
+GL_M4_GNULIB_MDA_WCSDUP = @GL_M4_GNULIB_MDA_WCSDUP@
+GL_M4_GNULIB_MDA_WRITE = @GL_M4_GNULIB_MDA_WRITE@
+GL_M4_GNULIB_MDA_Y0 = @GL_M4_GNULIB_MDA_Y0@
+GL_M4_GNULIB_MDA_Y1 = @GL_M4_GNULIB_MDA_Y1@
+GL_M4_GNULIB_MDA_YN = @GL_M4_GNULIB_MDA_YN@
+GL_M4_GNULIB_MEMCHR = @GL_M4_GNULIB_MEMCHR@
+GL_M4_GNULIB_MEMMEM = @GL_M4_GNULIB_MEMMEM@
+GL_M4_GNULIB_MEMPCPY = @GL_M4_GNULIB_MEMPCPY@
+GL_M4_GNULIB_MEMRCHR = @GL_M4_GNULIB_MEMRCHR@
+GL_M4_GNULIB_MKDIR = @GL_M4_GNULIB_MKDIR@
+GL_M4_GNULIB_MKDIRAT = @GL_M4_GNULIB_MKDIRAT@
+GL_M4_GNULIB_MKDTEMP = @GL_M4_GNULIB_MKDTEMP@
+GL_M4_GNULIB_MKFIFO = @GL_M4_GNULIB_MKFIFO@
+GL_M4_GNULIB_MKFIFOAT = @GL_M4_GNULIB_MKFIFOAT@
+GL_M4_GNULIB_MKNOD = @GL_M4_GNULIB_MKNOD@
+GL_M4_GNULIB_MKNODAT = @GL_M4_GNULIB_MKNODAT@
+GL_M4_GNULIB_MKOSTEMP = @GL_M4_GNULIB_MKOSTEMP@
+GL_M4_GNULIB_MKOSTEMPS = @GL_M4_GNULIB_MKOSTEMPS@
+GL_M4_GNULIB_MKSTEMP = @GL_M4_GNULIB_MKSTEMP@
+GL_M4_GNULIB_MKSTEMPS = @GL_M4_GNULIB_MKSTEMPS@
+GL_M4_GNULIB_MKTIME = @GL_M4_GNULIB_MKTIME@
+GL_M4_GNULIB_MODF = @GL_M4_GNULIB_MODF@
+GL_M4_GNULIB_MODFF = @GL_M4_GNULIB_MODFF@
+GL_M4_GNULIB_MODFL = @GL_M4_GNULIB_MODFL@
+GL_M4_GNULIB_NANOSLEEP = @GL_M4_GNULIB_NANOSLEEP@
+GL_M4_GNULIB_NL_LANGINFO = @GL_M4_GNULIB_NL_LANGINFO@
+GL_M4_GNULIB_NONBLOCKING = @GL_M4_GNULIB_NONBLOCKING@
+GL_M4_GNULIB_OBSTACK_PRINTF = @GL_M4_GNULIB_OBSTACK_PRINTF@
+GL_M4_GNULIB_OBSTACK_PRINTF_POSIX = @GL_M4_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_M4_GNULIB_OPEN = @GL_M4_GNULIB_OPEN@
+GL_M4_GNULIB_OPENAT = @GL_M4_GNULIB_OPENAT@
+GL_M4_GNULIB_OPENDIR = @GL_M4_GNULIB_OPENDIR@
+GL_M4_GNULIB_OVERRIDES_STRUCT_STAT = @GL_M4_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_M4_GNULIB_PCLOSE = @GL_M4_GNULIB_PCLOSE@
+GL_M4_GNULIB_PERROR = @GL_M4_GNULIB_PERROR@
+GL_M4_GNULIB_PIPE = @GL_M4_GNULIB_PIPE@
+GL_M4_GNULIB_PIPE2 = @GL_M4_GNULIB_PIPE2@
+GL_M4_GNULIB_POPEN = @GL_M4_GNULIB_POPEN@
+GL_M4_GNULIB_POSIX_MEMALIGN = @GL_M4_GNULIB_POSIX_MEMALIGN@
+GL_M4_GNULIB_POSIX_OPENPT = @GL_M4_GNULIB_POSIX_OPENPT@
+GL_M4_GNULIB_POSIX_SPAWN = @GL_M4_GNULIB_POSIX_SPAWN@
+GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY = @GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNATTR_INIT = @GL_M4_GNULIB_POSIX_SPAWNATTR_INIT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNP = @GL_M4_GNULIB_POSIX_SPAWNP@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
+GL_M4_GNULIB_POWF = @GL_M4_GNULIB_POWF@
+GL_M4_GNULIB_PREAD = @GL_M4_GNULIB_PREAD@
+GL_M4_GNULIB_PRINTF = @GL_M4_GNULIB_PRINTF@
+GL_M4_GNULIB_PRINTF_POSIX = @GL_M4_GNULIB_PRINTF_POSIX@
+GL_M4_GNULIB_PSELECT = @GL_M4_GNULIB_PSELECT@
+GL_M4_GNULIB_PTHREAD_COND = @GL_M4_GNULIB_PTHREAD_COND@
+GL_M4_GNULIB_PTHREAD_MUTEX = @GL_M4_GNULIB_PTHREAD_MUTEX@
+GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK = @GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK@
+GL_M4_GNULIB_PTHREAD_ONCE = @GL_M4_GNULIB_PTHREAD_ONCE@
+GL_M4_GNULIB_PTHREAD_RWLOCK = @GL_M4_GNULIB_PTHREAD_RWLOCK@
+GL_M4_GNULIB_PTHREAD_SIGMASK = @GL_M4_GNULIB_PTHREAD_SIGMASK@
+GL_M4_GNULIB_PTHREAD_SPIN = @GL_M4_GNULIB_PTHREAD_SPIN@
+GL_M4_GNULIB_PTHREAD_THREAD = @GL_M4_GNULIB_PTHREAD_THREAD@
+GL_M4_GNULIB_PTHREAD_TSS = @GL_M4_GNULIB_PTHREAD_TSS@
+GL_M4_GNULIB_PTSNAME = @GL_M4_GNULIB_PTSNAME@
+GL_M4_GNULIB_PTSNAME_R = @GL_M4_GNULIB_PTSNAME_R@
+GL_M4_GNULIB_PUTC = @GL_M4_GNULIB_PUTC@
+GL_M4_GNULIB_PUTCHAR = @GL_M4_GNULIB_PUTCHAR@
+GL_M4_GNULIB_PUTENV = @GL_M4_GNULIB_PUTENV@
+GL_M4_GNULIB_PUTS = @GL_M4_GNULIB_PUTS@
+GL_M4_GNULIB_PWRITE = @GL_M4_GNULIB_PWRITE@
+GL_M4_GNULIB_QSORT_R = @GL_M4_GNULIB_QSORT_R@
+GL_M4_GNULIB_RAISE = @GL_M4_GNULIB_RAISE@
+GL_M4_GNULIB_RANDOM = @GL_M4_GNULIB_RANDOM@
+GL_M4_GNULIB_RANDOM_R = @GL_M4_GNULIB_RANDOM_R@
+GL_M4_GNULIB_RAWMEMCHR = @GL_M4_GNULIB_RAWMEMCHR@
+GL_M4_GNULIB_READ = @GL_M4_GNULIB_READ@
+GL_M4_GNULIB_READDIR = @GL_M4_GNULIB_READDIR@
+GL_M4_GNULIB_READLINK = @GL_M4_GNULIB_READLINK@
+GL_M4_GNULIB_READLINKAT = @GL_M4_GNULIB_READLINKAT@
+GL_M4_GNULIB_REALLOCARRAY = @GL_M4_GNULIB_REALLOCARRAY@
+GL_M4_GNULIB_REALLOC_POSIX = @GL_M4_GNULIB_REALLOC_POSIX@
+GL_M4_GNULIB_REALPATH = @GL_M4_GNULIB_REALPATH@
+GL_M4_GNULIB_RECV = @GL_M4_GNULIB_RECV@
+GL_M4_GNULIB_RECVFROM = @GL_M4_GNULIB_RECVFROM@
+GL_M4_GNULIB_REMAINDER = @GL_M4_GNULIB_REMAINDER@
+GL_M4_GNULIB_REMAINDERF = @GL_M4_GNULIB_REMAINDERF@
+GL_M4_GNULIB_REMAINDERL = @GL_M4_GNULIB_REMAINDERL@
+GL_M4_GNULIB_REMOVE = @GL_M4_GNULIB_REMOVE@
+GL_M4_GNULIB_RENAME = @GL_M4_GNULIB_RENAME@
+GL_M4_GNULIB_RENAMEAT = @GL_M4_GNULIB_RENAMEAT@
+GL_M4_GNULIB_REWINDDIR = @GL_M4_GNULIB_REWINDDIR@
+GL_M4_GNULIB_RINT = @GL_M4_GNULIB_RINT@
+GL_M4_GNULIB_RINTF = @GL_M4_GNULIB_RINTF@
+GL_M4_GNULIB_RINTL = @GL_M4_GNULIB_RINTL@
+GL_M4_GNULIB_RMDIR = @GL_M4_GNULIB_RMDIR@
+GL_M4_GNULIB_ROUND = @GL_M4_GNULIB_ROUND@
+GL_M4_GNULIB_ROUNDF = @GL_M4_GNULIB_ROUNDF@
+GL_M4_GNULIB_ROUNDL = @GL_M4_GNULIB_ROUNDL@
+GL_M4_GNULIB_RPMATCH = @GL_M4_GNULIB_RPMATCH@
+GL_M4_GNULIB_SCANDIR = @GL_M4_GNULIB_SCANDIR@
+GL_M4_GNULIB_SCANF = @GL_M4_GNULIB_SCANF@
+GL_M4_GNULIB_SCHED_YIELD = @GL_M4_GNULIB_SCHED_YIELD@
+GL_M4_GNULIB_SECURE_GETENV = @GL_M4_GNULIB_SECURE_GETENV@
+GL_M4_GNULIB_SELECT = @GL_M4_GNULIB_SELECT@
+GL_M4_GNULIB_SEND = @GL_M4_GNULIB_SEND@
+GL_M4_GNULIB_SENDTO = @GL_M4_GNULIB_SENDTO@
+GL_M4_GNULIB_SETENV = @GL_M4_GNULIB_SETENV@
+GL_M4_GNULIB_SETHOSTNAME = @GL_M4_GNULIB_SETHOSTNAME@
+GL_M4_GNULIB_SETLOCALE = @GL_M4_GNULIB_SETLOCALE@
+GL_M4_GNULIB_SETLOCALE_NULL = @GL_M4_GNULIB_SETLOCALE_NULL@
+GL_M4_GNULIB_SETSOCKOPT = @GL_M4_GNULIB_SETSOCKOPT@
+GL_M4_GNULIB_SHUTDOWN = @GL_M4_GNULIB_SHUTDOWN@
+GL_M4_GNULIB_SIGABBREV_NP = @GL_M4_GNULIB_SIGABBREV_NP@
+GL_M4_GNULIB_SIGACTION = @GL_M4_GNULIB_SIGACTION@
+GL_M4_GNULIB_SIGDESCR_NP = @GL_M4_GNULIB_SIGDESCR_NP@
+GL_M4_GNULIB_SIGNAL_H_SIGPIPE = @GL_M4_GNULIB_SIGNAL_H_SIGPIPE@
+GL_M4_GNULIB_SIGNBIT = @GL_M4_GNULIB_SIGNBIT@
+GL_M4_GNULIB_SIGPROCMASK = @GL_M4_GNULIB_SIGPROCMASK@
+GL_M4_GNULIB_SINF = @GL_M4_GNULIB_SINF@
+GL_M4_GNULIB_SINHF = @GL_M4_GNULIB_SINHF@
+GL_M4_GNULIB_SINL = @GL_M4_GNULIB_SINL@
+GL_M4_GNULIB_SLEEP = @GL_M4_GNULIB_SLEEP@
+GL_M4_GNULIB_SNPRINTF = @GL_M4_GNULIB_SNPRINTF@
+GL_M4_GNULIB_SOCKET = @GL_M4_GNULIB_SOCKET@
+GL_M4_GNULIB_SPRINTF_POSIX = @GL_M4_GNULIB_SPRINTF_POSIX@
+GL_M4_GNULIB_SQRTF = @GL_M4_GNULIB_SQRTF@
+GL_M4_GNULIB_SQRTL = @GL_M4_GNULIB_SQRTL@
+GL_M4_GNULIB_STAT = @GL_M4_GNULIB_STAT@
+GL_M4_GNULIB_STDIO_H_NONBLOCKING = @GL_M4_GNULIB_STDIO_H_NONBLOCKING@
+GL_M4_GNULIB_STDIO_H_SIGPIPE = @GL_M4_GNULIB_STDIO_H_SIGPIPE@
+GL_M4_GNULIB_STPCPY = @GL_M4_GNULIB_STPCPY@
+GL_M4_GNULIB_STPNCPY = @GL_M4_GNULIB_STPNCPY@
+GL_M4_GNULIB_STRCASESTR = @GL_M4_GNULIB_STRCASESTR@
+GL_M4_GNULIB_STRCHRNUL = @GL_M4_GNULIB_STRCHRNUL@
+GL_M4_GNULIB_STRDUP = @GL_M4_GNULIB_STRDUP@
+GL_M4_GNULIB_STRERROR = @GL_M4_GNULIB_STRERROR@
+GL_M4_GNULIB_STRERRORNAME_NP = @GL_M4_GNULIB_STRERRORNAME_NP@
+GL_M4_GNULIB_STRERROR_R = @GL_M4_GNULIB_STRERROR_R@
+GL_M4_GNULIB_STRFTIME = @GL_M4_GNULIB_STRFTIME@
+GL_M4_GNULIB_STRNCAT = @GL_M4_GNULIB_STRNCAT@
+GL_M4_GNULIB_STRNDUP = @GL_M4_GNULIB_STRNDUP@
+GL_M4_GNULIB_STRNLEN = @GL_M4_GNULIB_STRNLEN@
+GL_M4_GNULIB_STRPBRK = @GL_M4_GNULIB_STRPBRK@
+GL_M4_GNULIB_STRPTIME = @GL_M4_GNULIB_STRPTIME@
+GL_M4_GNULIB_STRSEP = @GL_M4_GNULIB_STRSEP@
+GL_M4_GNULIB_STRSIGNAL = @GL_M4_GNULIB_STRSIGNAL@
+GL_M4_GNULIB_STRSTR = @GL_M4_GNULIB_STRSTR@
+GL_M4_GNULIB_STRTOD = @GL_M4_GNULIB_STRTOD@
+GL_M4_GNULIB_STRTOIMAX = @GL_M4_GNULIB_STRTOIMAX@
+GL_M4_GNULIB_STRTOK_R = @GL_M4_GNULIB_STRTOK_R@
+GL_M4_GNULIB_STRTOL = @GL_M4_GNULIB_STRTOL@
+GL_M4_GNULIB_STRTOLD = @GL_M4_GNULIB_STRTOLD@
+GL_M4_GNULIB_STRTOLL = @GL_M4_GNULIB_STRTOLL@
+GL_M4_GNULIB_STRTOUL = @GL_M4_GNULIB_STRTOUL@
+GL_M4_GNULIB_STRTOULL = @GL_M4_GNULIB_STRTOULL@
+GL_M4_GNULIB_STRTOUMAX = @GL_M4_GNULIB_STRTOUMAX@
+GL_M4_GNULIB_STRVERSCMP = @GL_M4_GNULIB_STRVERSCMP@
+GL_M4_GNULIB_SYMLINK = @GL_M4_GNULIB_SYMLINK@
+GL_M4_GNULIB_SYMLINKAT = @GL_M4_GNULIB_SYMLINKAT@
+GL_M4_GNULIB_SYSTEM_POSIX = @GL_M4_GNULIB_SYSTEM_POSIX@
+GL_M4_GNULIB_TANF = @GL_M4_GNULIB_TANF@
+GL_M4_GNULIB_TANHF = @GL_M4_GNULIB_TANHF@
+GL_M4_GNULIB_TANL = @GL_M4_GNULIB_TANL@
+GL_M4_GNULIB_TIMEGM = @GL_M4_GNULIB_TIMEGM@
+GL_M4_GNULIB_TIMESPEC_GET = @GL_M4_GNULIB_TIMESPEC_GET@
+GL_M4_GNULIB_TIME_R = @GL_M4_GNULIB_TIME_R@
+GL_M4_GNULIB_TIME_RZ = @GL_M4_GNULIB_TIME_RZ@
+GL_M4_GNULIB_TMPFILE = @GL_M4_GNULIB_TMPFILE@
+GL_M4_GNULIB_TOWCTRANS = @GL_M4_GNULIB_TOWCTRANS@
+GL_M4_GNULIB_TRUNC = @GL_M4_GNULIB_TRUNC@
+GL_M4_GNULIB_TRUNCATE = @GL_M4_GNULIB_TRUNCATE@
+GL_M4_GNULIB_TRUNCF = @GL_M4_GNULIB_TRUNCF@
+GL_M4_GNULIB_TRUNCL = @GL_M4_GNULIB_TRUNCL@
+GL_M4_GNULIB_TTYNAME_R = @GL_M4_GNULIB_TTYNAME_R@
+GL_M4_GNULIB_TZSET = @GL_M4_GNULIB_TZSET@
+GL_M4_GNULIB_UNISTD_H_NONBLOCKING = @GL_M4_GNULIB_UNISTD_H_NONBLOCKING@
+GL_M4_GNULIB_UNISTD_H_SIGPIPE = @GL_M4_GNULIB_UNISTD_H_SIGPIPE@
+GL_M4_GNULIB_UNLINK = @GL_M4_GNULIB_UNLINK@
+GL_M4_GNULIB_UNLINKAT = @GL_M4_GNULIB_UNLINKAT@
+GL_M4_GNULIB_UNLOCKPT = @GL_M4_GNULIB_UNLOCKPT@
+GL_M4_GNULIB_UNSETENV = @GL_M4_GNULIB_UNSETENV@
+GL_M4_GNULIB_USLEEP = @GL_M4_GNULIB_USLEEP@
+GL_M4_GNULIB_UTIMENSAT = @GL_M4_GNULIB_UTIMENSAT@
+GL_M4_GNULIB_VASPRINTF = @GL_M4_GNULIB_VASPRINTF@
+GL_M4_GNULIB_VDPRINTF = @GL_M4_GNULIB_VDPRINTF@
+GL_M4_GNULIB_VFPRINTF = @GL_M4_GNULIB_VFPRINTF@
+GL_M4_GNULIB_VFPRINTF_POSIX = @GL_M4_GNULIB_VFPRINTF_POSIX@
+GL_M4_GNULIB_VFSCANF = @GL_M4_GNULIB_VFSCANF@
+GL_M4_GNULIB_VPRINTF = @GL_M4_GNULIB_VPRINTF@
+GL_M4_GNULIB_VPRINTF_POSIX = @GL_M4_GNULIB_VPRINTF_POSIX@
+GL_M4_GNULIB_VSCANF = @GL_M4_GNULIB_VSCANF@
+GL_M4_GNULIB_VSNPRINTF = @GL_M4_GNULIB_VSNPRINTF@
+GL_M4_GNULIB_VSPRINTF_POSIX = @GL_M4_GNULIB_VSPRINTF_POSIX@
+GL_M4_GNULIB_WAITPID = @GL_M4_GNULIB_WAITPID@
+GL_M4_GNULIB_WCPCPY = @GL_M4_GNULIB_WCPCPY@
+GL_M4_GNULIB_WCPNCPY = @GL_M4_GNULIB_WCPNCPY@
+GL_M4_GNULIB_WCRTOMB = @GL_M4_GNULIB_WCRTOMB@
+GL_M4_GNULIB_WCSCASECMP = @GL_M4_GNULIB_WCSCASECMP@
+GL_M4_GNULIB_WCSCAT = @GL_M4_GNULIB_WCSCAT@
+GL_M4_GNULIB_WCSCHR = @GL_M4_GNULIB_WCSCHR@
+GL_M4_GNULIB_WCSCMP = @GL_M4_GNULIB_WCSCMP@
+GL_M4_GNULIB_WCSCOLL = @GL_M4_GNULIB_WCSCOLL@
+GL_M4_GNULIB_WCSCPY = @GL_M4_GNULIB_WCSCPY@
+GL_M4_GNULIB_WCSCSPN = @GL_M4_GNULIB_WCSCSPN@
+GL_M4_GNULIB_WCSDUP = @GL_M4_GNULIB_WCSDUP@
+GL_M4_GNULIB_WCSFTIME = @GL_M4_GNULIB_WCSFTIME@
+GL_M4_GNULIB_WCSLEN = @GL_M4_GNULIB_WCSLEN@
+GL_M4_GNULIB_WCSNCASECMP = @GL_M4_GNULIB_WCSNCASECMP@
+GL_M4_GNULIB_WCSNCAT = @GL_M4_GNULIB_WCSNCAT@
+GL_M4_GNULIB_WCSNCMP = @GL_M4_GNULIB_WCSNCMP@
+GL_M4_GNULIB_WCSNCPY = @GL_M4_GNULIB_WCSNCPY@
+GL_M4_GNULIB_WCSNLEN = @GL_M4_GNULIB_WCSNLEN@
+GL_M4_GNULIB_WCSNRTOMBS = @GL_M4_GNULIB_WCSNRTOMBS@
+GL_M4_GNULIB_WCSPBRK = @GL_M4_GNULIB_WCSPBRK@
+GL_M4_GNULIB_WCSRCHR = @GL_M4_GNULIB_WCSRCHR@
+GL_M4_GNULIB_WCSRTOMBS = @GL_M4_GNULIB_WCSRTOMBS@
+GL_M4_GNULIB_WCSSPN = @GL_M4_GNULIB_WCSSPN@
+GL_M4_GNULIB_WCSSTR = @GL_M4_GNULIB_WCSSTR@
+GL_M4_GNULIB_WCSTOK = @GL_M4_GNULIB_WCSTOK@
+GL_M4_GNULIB_WCSWIDTH = @GL_M4_GNULIB_WCSWIDTH@
+GL_M4_GNULIB_WCSXFRM = @GL_M4_GNULIB_WCSXFRM@
+GL_M4_GNULIB_WCTOB = @GL_M4_GNULIB_WCTOB@
+GL_M4_GNULIB_WCTOMB = @GL_M4_GNULIB_WCTOMB@
+GL_M4_GNULIB_WCTRANS = @GL_M4_GNULIB_WCTRANS@
+GL_M4_GNULIB_WCTYPE = @GL_M4_GNULIB_WCTYPE@
+GL_M4_GNULIB_WCWIDTH = @GL_M4_GNULIB_WCWIDTH@
+GL_M4_GNULIB_WMEMCHR = @GL_M4_GNULIB_WMEMCHR@
+GL_M4_GNULIB_WMEMCMP = @GL_M4_GNULIB_WMEMCMP@
+GL_M4_GNULIB_WMEMCPY = @GL_M4_GNULIB_WMEMCPY@
+GL_M4_GNULIB_WMEMMOVE = @GL_M4_GNULIB_WMEMMOVE@
+GL_M4_GNULIB_WMEMPCPY = @GL_M4_GNULIB_WMEMPCPY@
+GL_M4_GNULIB_WMEMSET = @GL_M4_GNULIB_WMEMSET@
+GL_M4_GNULIB_WRITE = @GL_M4_GNULIB_WRITE@
+GL_M4_GNULIB__EXIT = @GL_M4_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
-GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
 GNULIB_GL_M4_UNISTD_H_GETOPT = @GNULIB_GL_M4_UNISTD_H_GETOPT@
-GNULIB_GRANTPT = @GNULIB_GRANTPT@
-GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
-GNULIB_HYPOT = @GNULIB_HYPOT@
-GNULIB_HYPOTF = @GNULIB_HYPOTF@
-GNULIB_HYPOTL = @GNULIB_HYPOTL@
-GNULIB_ILOGB = @GNULIB_ILOGB@
-GNULIB_ILOGBF = @GNULIB_ILOGBF@
-GNULIB_ILOGBL = @GNULIB_ILOGBL@
-GNULIB_IMAXABS = @GNULIB_IMAXABS@
-GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
-GNULIB_ISATTY = @GNULIB_ISATTY@
-GNULIB_ISBLANK = @GNULIB_ISBLANK@
-GNULIB_ISFINITE = @GNULIB_ISFINITE@
-GNULIB_ISINF = @GNULIB_ISINF@
-GNULIB_ISNAN = @GNULIB_ISNAN@
-GNULIB_ISNAND = @GNULIB_ISNAND@
-GNULIB_ISNANF = @GNULIB_ISNANF@
-GNULIB_ISNANL = @GNULIB_ISNANL@
-GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
-GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
-GNULIB_LCHMOD = @GNULIB_LCHMOD@
-GNULIB_LCHOWN = @GNULIB_LCHOWN@
-GNULIB_LDEXPF = @GNULIB_LDEXPF@
-GNULIB_LDEXPL = @GNULIB_LDEXPL@
-GNULIB_LINK = @GNULIB_LINK@
-GNULIB_LINKAT = @GNULIB_LINKAT@
-GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
-GNULIB_LOG = @GNULIB_LOG@
-GNULIB_LOG10 = @GNULIB_LOG10@
-GNULIB_LOG10F = @GNULIB_LOG10F@
-GNULIB_LOG10L = @GNULIB_LOG10L@
-GNULIB_LOG1P = @GNULIB_LOG1P@
-GNULIB_LOG1PF = @GNULIB_LOG1PF@
-GNULIB_LOG1PL = @GNULIB_LOG1PL@
-GNULIB_LOG2 = @GNULIB_LOG2@
-GNULIB_LOG2F = @GNULIB_LOG2F@
-GNULIB_LOG2L = @GNULIB_LOG2L@
-GNULIB_LOGB = @GNULIB_LOGB@
-GNULIB_LOGBF = @GNULIB_LOGBF@
-GNULIB_LOGBL = @GNULIB_LOGBL@
-GNULIB_LOGF = @GNULIB_LOGF@
-GNULIB_LOGL = @GNULIB_LOGL@
-GNULIB_LSEEK = @GNULIB_LSEEK@
-GNULIB_LSTAT = @GNULIB_LSTAT@
-GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
-GNULIB_MBRLEN = @GNULIB_MBRLEN@
-GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
-GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
-GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
-GNULIB_MBSCHR = @GNULIB_MBSCHR@
-GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
-GNULIB_MBSINIT = @GNULIB_MBSINIT@
-GNULIB_MBSLEN = @GNULIB_MBSLEN@
-GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
-GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
-GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
-GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
-GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
-GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
-GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
-GNULIB_MBSSEP = @GNULIB_MBSSEP@
-GNULIB_MBSSPN = @GNULIB_MBSSPN@
-GNULIB_MBSSTR = @GNULIB_MBSSTR@
-GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
-GNULIB_MBTOWC = @GNULIB_MBTOWC@
-GNULIB_MEMCHR = @GNULIB_MEMCHR@
-GNULIB_MEMMEM = @GNULIB_MEMMEM@
-GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
-GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
-GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
-GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
-GNULIB_MKFIFO = @GNULIB_MKFIFO@
-GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
-GNULIB_MKNOD = @GNULIB_MKNOD@
-GNULIB_MKNODAT = @GNULIB_MKNODAT@
-GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
-GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
-GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
-GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
-GNULIB_MKTIME = @GNULIB_MKTIME@
-GNULIB_MODF = @GNULIB_MODF@
-GNULIB_MODFF = @GNULIB_MODFF@
-GNULIB_MODFL = @GNULIB_MODFL@
-GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
-GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
-GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
-GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
-GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
-GNULIB_OPEN = @GNULIB_OPEN@
-GNULIB_OPENAT = @GNULIB_OPENAT@
-GNULIB_OPENDIR = @GNULIB_OPENDIR@
-GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@
-GNULIB_PCLOSE = @GNULIB_PCLOSE@
-GNULIB_PERROR = @GNULIB_PERROR@
-GNULIB_PIPE = @GNULIB_PIPE@
-GNULIB_PIPE2 = @GNULIB_PIPE2@
-GNULIB_POPEN = @GNULIB_POPEN@
-GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
-GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@
-GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@
-GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
-GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
-GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@
-GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
-GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
-GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
-GNULIB_POWF = @GNULIB_POWF@
-GNULIB_PREAD = @GNULIB_PREAD@
-GNULIB_PRINTF = @GNULIB_PRINTF@
-GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
-GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
-GNULIB_PTSNAME = @GNULIB_PTSNAME@
-GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
-GNULIB_PUTC = @GNULIB_PUTC@
-GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
-GNULIB_PUTENV = @GNULIB_PUTENV@
-GNULIB_PUTS = @GNULIB_PUTS@
-GNULIB_PWRITE = @GNULIB_PWRITE@
-GNULIB_QSORT_R = @GNULIB_QSORT_R@
-GNULIB_RAISE = @GNULIB_RAISE@
-GNULIB_RANDOM = @GNULIB_RANDOM@
-GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
-GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
-GNULIB_READ = @GNULIB_READ@
-GNULIB_READDIR = @GNULIB_READDIR@
-GNULIB_READLINK = @GNULIB_READLINK@
-GNULIB_READLINKAT = @GNULIB_READLINKAT@
-GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
-GNULIB_REALPATH = @GNULIB_REALPATH@
-GNULIB_REMAINDER = @GNULIB_REMAINDER@
-GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
-GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
-GNULIB_REMOVE = @GNULIB_REMOVE@
-GNULIB_RENAME = @GNULIB_RENAME@
-GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
-GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
-GNULIB_RINT = @GNULIB_RINT@
-GNULIB_RINTF = @GNULIB_RINTF@
-GNULIB_RINTL = @GNULIB_RINTL@
-GNULIB_RMDIR = @GNULIB_RMDIR@
-GNULIB_ROUND = @GNULIB_ROUND@
-GNULIB_ROUNDF = @GNULIB_ROUNDF@
-GNULIB_ROUNDL = @GNULIB_ROUNDL@
-GNULIB_RPMATCH = @GNULIB_RPMATCH@
-GNULIB_SCANDIR = @GNULIB_SCANDIR@
-GNULIB_SCANF = @GNULIB_SCANF@
-GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
-GNULIB_SETENV = @GNULIB_SETENV@
-GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
-GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
-GNULIB_SIGACTION = @GNULIB_SIGACTION@
-GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
-GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
-GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
-GNULIB_SINF = @GNULIB_SINF@
-GNULIB_SINHF = @GNULIB_SINHF@
-GNULIB_SINL = @GNULIB_SINL@
-GNULIB_SLEEP = @GNULIB_SLEEP@
-GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
-GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
-GNULIB_SQRTF = @GNULIB_SQRTF@
-GNULIB_SQRTL = @GNULIB_SQRTL@
-GNULIB_STAT = @GNULIB_STAT@
-GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
-GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
-GNULIB_STPCPY = @GNULIB_STPCPY@
-GNULIB_STPNCPY = @GNULIB_STPNCPY@
-GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
-GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
-GNULIB_STRDUP = @GNULIB_STRDUP@
-GNULIB_STRERROR = @GNULIB_STRERROR@
-GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
-GNULIB_STRNCAT = @GNULIB_STRNCAT@
-GNULIB_STRNDUP = @GNULIB_STRNDUP@
-GNULIB_STRNLEN = @GNULIB_STRNLEN@
-GNULIB_STRPBRK = @GNULIB_STRPBRK@
-GNULIB_STRPTIME = @GNULIB_STRPTIME@
-GNULIB_STRSEP = @GNULIB_STRSEP@
-GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
-GNULIB_STRSTR = @GNULIB_STRSTR@
-GNULIB_STRTOD = @GNULIB_STRTOD@
-GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
-GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
-GNULIB_STRTOLL = @GNULIB_STRTOLL@
-GNULIB_STRTOULL = @GNULIB_STRTOULL@
-GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
-GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
-GNULIB_SYMLINK = @GNULIB_SYMLINK@
-GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
-GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
-GNULIB_TANF = @GNULIB_TANF@
-GNULIB_TANHF = @GNULIB_TANHF@
-GNULIB_TANL = @GNULIB_TANL@
-GNULIB_TIMEGM = @GNULIB_TIMEGM@
-GNULIB_TIME_R = @GNULIB_TIME_R@
-GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
-GNULIB_TMPFILE = @GNULIB_TMPFILE@
-GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
-GNULIB_TRUNC = @GNULIB_TRUNC@
-GNULIB_TRUNCF = @GNULIB_TRUNCF@
-GNULIB_TRUNCL = @GNULIB_TRUNCL@
-GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
-GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
-GNULIB_UNLINK = @GNULIB_UNLINK@
-GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
-GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
-GNULIB_UNSETENV = @GNULIB_UNSETENV@
-GNULIB_USLEEP = @GNULIB_USLEEP@
-GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
-GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
-GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
-GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
-GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
-GNULIB_VFSCANF = @GNULIB_VFSCANF@
-GNULIB_VPRINTF = @GNULIB_VPRINTF@
-GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
-GNULIB_VSCANF = @GNULIB_VSCANF@
-GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
-GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
-GNULIB_WAITPID = @GNULIB_WAITPID@
-GNULIB_WCPCPY = @GNULIB_WCPCPY@
-GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
-GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
-GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
-GNULIB_WCSCAT = @GNULIB_WCSCAT@
-GNULIB_WCSCHR = @GNULIB_WCSCHR@
-GNULIB_WCSCMP = @GNULIB_WCSCMP@
-GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
-GNULIB_WCSCPY = @GNULIB_WCSCPY@
-GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
-GNULIB_WCSDUP = @GNULIB_WCSDUP@
-GNULIB_WCSLEN = @GNULIB_WCSLEN@
-GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
-GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
-GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
-GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
-GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
-GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
-GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
-GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
-GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
-GNULIB_WCSSPN = @GNULIB_WCSSPN@
-GNULIB_WCSSTR = @GNULIB_WCSSTR@
-GNULIB_WCSTOK = @GNULIB_WCSTOK@
-GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
-GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
-GNULIB_WCTOB = @GNULIB_WCTOB@
-GNULIB_WCTOMB = @GNULIB_WCTOMB@
-GNULIB_WCTRANS = @GNULIB_WCTRANS@
-GNULIB_WCTYPE = @GNULIB_WCTYPE@
-GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
-GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
-GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
-GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
-GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
-GNULIB_WMEMSET = @GNULIB_WMEMSET@
-GNULIB_WRITE = @GNULIB_WRITE@
-GNULIB__EXIT = @GNULIB__EXIT@
 GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ACOSF = @HAVE_ACOSF@
 HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ASINF = @HAVE_ASINF@
 HAVE_ASINL = @HAVE_ASINL@
 HAVE_ATAN2F = @HAVE_ATAN2F@
@@ -752,9 +927,11 @@ HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
 HAVE_COPYSIGN = @HAVE_COPYSIGN@
 HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
 HAVE_COSF = @HAVE_COSF@
 HAVE_COSHF = @HAVE_COSHF@
 HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
 HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
 HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
 HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
@@ -765,13 +942,17 @@ HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
 HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
 HAVE_DECL_COSL = @HAVE_DECL_COSL@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
 HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
 HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
 HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
 HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
 HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
 HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
 HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
@@ -780,6 +961,7 @@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
 HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
@@ -790,6 +972,9 @@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
 HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
 HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
 HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
 HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
@@ -809,6 +994,7 @@ HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
 HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
 HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
 HAVE_DECL_SINL = @HAVE_DECL_SINL@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
@@ -822,21 +1008,24 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TANL = @HAVE_DECL_TANL@
 HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
-HAVE_DUP2 = @HAVE_DUP2@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
 HAVE_EXPF = @HAVE_EXPF@
 HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
 HAVE_EXPM1 = @HAVE_EXPM1@
 HAVE_EXPM1F = @HAVE_EXPM1F@
 HAVE_FABSF = @HAVE_FABSF@
@@ -856,6 +1045,7 @@ HAVE_FMAF = @HAVE_FMAF@
 HAVE_FMAL = @HAVE_FMAL@
 HAVE_FMODF = @HAVE_FMODF@
 HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
 HAVE_FREXPF = @HAVE_FREXPF@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
@@ -864,13 +1054,17 @@ HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
 HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
 HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETRANDOM = @HAVE_GETRANDOM@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GETUMASK = @HAVE_GETUMASK@
 HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_HYPOTF = @HAVE_HYPOTF@
@@ -878,6 +1072,8 @@ HAVE_HYPOTL = @HAVE_HYPOTL@
 HAVE_ILOGB = @HAVE_ILOGB@
 HAVE_ILOGBF = @HAVE_ILOGBF@
 HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISNAND = @HAVE_ISNAND@
@@ -885,6 +1081,7 @@ HAVE_ISNANF = @HAVE_ISNANF@
 HAVE_ISNANL = @HAVE_ISNANL@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
 HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
 HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
 HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
@@ -905,7 +1102,6 @@ HAVE_LOGBF = @HAVE_LOGBF@
 HAVE_LOGBL = @HAVE_LOGBL@
 HAVE_LOGF = @HAVE_LOGF@
 HAVE_LOGL = @HAVE_LOGL@
-HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
 HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
 HAVE_MBRLEN = @HAVE_MBRLEN@
@@ -914,7 +1110,7 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
 HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
-HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MBTOWC = @HAVE_MBTOWC@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
 HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
@@ -930,6 +1126,8 @@ HAVE_MODFF = @HAVE_MODFF@
 HAVE_MODFL = @HAVE_MODFL@
 HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OPENDIR = @HAVE_OPENDIR@
@@ -938,14 +1136,76 @@ HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@
 HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PSELECT = @HAVE_PSELECT@
+HAVE_PTHREAD_ATTR_DESTROY = @HAVE_PTHREAD_ATTR_DESTROY@
+HAVE_PTHREAD_ATTR_GETDETACHSTATE = @HAVE_PTHREAD_ATTR_GETDETACHSTATE@
+HAVE_PTHREAD_ATTR_INIT = @HAVE_PTHREAD_ATTR_INIT@
+HAVE_PTHREAD_ATTR_SETDETACHSTATE = @HAVE_PTHREAD_ATTR_SETDETACHSTATE@
+HAVE_PTHREAD_CONDATTR_DESTROY = @HAVE_PTHREAD_CONDATTR_DESTROY@
+HAVE_PTHREAD_CONDATTR_INIT = @HAVE_PTHREAD_CONDATTR_INIT@
+HAVE_PTHREAD_COND_BROADCAST = @HAVE_PTHREAD_COND_BROADCAST@
+HAVE_PTHREAD_COND_DESTROY = @HAVE_PTHREAD_COND_DESTROY@
+HAVE_PTHREAD_COND_INIT = @HAVE_PTHREAD_COND_INIT@
+HAVE_PTHREAD_COND_SIGNAL = @HAVE_PTHREAD_COND_SIGNAL@
+HAVE_PTHREAD_COND_TIMEDWAIT = @HAVE_PTHREAD_COND_TIMEDWAIT@
+HAVE_PTHREAD_COND_WAIT = @HAVE_PTHREAD_COND_WAIT@
+HAVE_PTHREAD_CREATE = @HAVE_PTHREAD_CREATE@
+HAVE_PTHREAD_CREATE_DETACHED = @HAVE_PTHREAD_CREATE_DETACHED@
+HAVE_PTHREAD_DETACH = @HAVE_PTHREAD_DETACH@
+HAVE_PTHREAD_EQUAL = @HAVE_PTHREAD_EQUAL@
+HAVE_PTHREAD_EXIT = @HAVE_PTHREAD_EXIT@
+HAVE_PTHREAD_GETSPECIFIC = @HAVE_PTHREAD_GETSPECIFIC@
+HAVE_PTHREAD_H = @HAVE_PTHREAD_H@
+HAVE_PTHREAD_JOIN = @HAVE_PTHREAD_JOIN@
+HAVE_PTHREAD_KEY_CREATE = @HAVE_PTHREAD_KEY_CREATE@
+HAVE_PTHREAD_KEY_DELETE = @HAVE_PTHREAD_KEY_DELETE@
+HAVE_PTHREAD_MUTEXATTR_DESTROY = @HAVE_PTHREAD_MUTEXATTR_DESTROY@
+HAVE_PTHREAD_MUTEXATTR_GETROBUST = @HAVE_PTHREAD_MUTEXATTR_GETROBUST@
+HAVE_PTHREAD_MUTEXATTR_GETTYPE = @HAVE_PTHREAD_MUTEXATTR_GETTYPE@
+HAVE_PTHREAD_MUTEXATTR_INIT = @HAVE_PTHREAD_MUTEXATTR_INIT@
+HAVE_PTHREAD_MUTEXATTR_SETROBUST = @HAVE_PTHREAD_MUTEXATTR_SETROBUST@
+HAVE_PTHREAD_MUTEXATTR_SETTYPE = @HAVE_PTHREAD_MUTEXATTR_SETTYPE@
+HAVE_PTHREAD_MUTEX_DESTROY = @HAVE_PTHREAD_MUTEX_DESTROY@
+HAVE_PTHREAD_MUTEX_INIT = @HAVE_PTHREAD_MUTEX_INIT@
+HAVE_PTHREAD_MUTEX_LOCK = @HAVE_PTHREAD_MUTEX_LOCK@
+HAVE_PTHREAD_MUTEX_RECURSIVE = @HAVE_PTHREAD_MUTEX_RECURSIVE@
+HAVE_PTHREAD_MUTEX_ROBUST = @HAVE_PTHREAD_MUTEX_ROBUST@
+HAVE_PTHREAD_MUTEX_TIMEDLOCK = @HAVE_PTHREAD_MUTEX_TIMEDLOCK@
+HAVE_PTHREAD_MUTEX_TRYLOCK = @HAVE_PTHREAD_MUTEX_TRYLOCK@
+HAVE_PTHREAD_MUTEX_UNLOCK = @HAVE_PTHREAD_MUTEX_UNLOCK@
+HAVE_PTHREAD_ONCE = @HAVE_PTHREAD_ONCE@
+HAVE_PTHREAD_PROCESS_SHARED = @HAVE_PTHREAD_PROCESS_SHARED@
+HAVE_PTHREAD_RWLOCKATTR_DESTROY = @HAVE_PTHREAD_RWLOCKATTR_DESTROY@
+HAVE_PTHREAD_RWLOCKATTR_INIT = @HAVE_PTHREAD_RWLOCKATTR_INIT@
+HAVE_PTHREAD_RWLOCK_DESTROY = @HAVE_PTHREAD_RWLOCK_DESTROY@
+HAVE_PTHREAD_RWLOCK_INIT = @HAVE_PTHREAD_RWLOCK_INIT@
+HAVE_PTHREAD_RWLOCK_RDLOCK = @HAVE_PTHREAD_RWLOCK_RDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+HAVE_PTHREAD_RWLOCK_TRYRDLOCK = @HAVE_PTHREAD_RWLOCK_TRYRDLOCK@
+HAVE_PTHREAD_RWLOCK_TRYWRLOCK = @HAVE_PTHREAD_RWLOCK_TRYWRLOCK@
+HAVE_PTHREAD_RWLOCK_UNLOCK = @HAVE_PTHREAD_RWLOCK_UNLOCK@
+HAVE_PTHREAD_RWLOCK_WRLOCK = @HAVE_PTHREAD_RWLOCK_WRLOCK@
+HAVE_PTHREAD_SELF = @HAVE_PTHREAD_SELF@
+HAVE_PTHREAD_SETSPECIFIC = @HAVE_PTHREAD_SETSPECIFIC@
 HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
+HAVE_PTHREAD_SPINLOCK_T = @HAVE_PTHREAD_SPINLOCK_T@
+HAVE_PTHREAD_SPIN_DESTROY = @HAVE_PTHREAD_SPIN_DESTROY@
+HAVE_PTHREAD_SPIN_INIT = @HAVE_PTHREAD_SPIN_INIT@
+HAVE_PTHREAD_SPIN_LOCK = @HAVE_PTHREAD_SPIN_LOCK@
+HAVE_PTHREAD_SPIN_TRYLOCK = @HAVE_PTHREAD_SPIN_TRYLOCK@
+HAVE_PTHREAD_SPIN_UNLOCK = @HAVE_PTHREAD_SPIN_UNLOCK@
+HAVE_PTHREAD_T = @HAVE_PTHREAD_T@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
@@ -958,6 +1218,7 @@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READDIR = @HAVE_READDIR@
 HAVE_READLINK = @HAVE_READLINK@
 HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
 HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_REMAINDER = @HAVE_REMAINDER@
 HAVE_REMAINDERF = @HAVE_REMAINDERF@
@@ -967,12 +1228,17 @@ HAVE_RINT = @HAVE_RINT@
 HAVE_RINTL = @HAVE_RINTL@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SCHED_H = @HAVE_SCHED_H@
+HAVE_SCHED_YIELD = @HAVE_SCHED_YIELD@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
 HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
 HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
 HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
@@ -991,15 +1257,21 @@ HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
 HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRPTIME = @HAVE_STRPTIME@
 HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
 HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@
 HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -1007,24 +1279,30 @@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@
+HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
 HAVE_TANF = @HAVE_TANF@
 HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
 HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
-HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
 HAVE_USLEEP = @HAVE_USLEEP@
 HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
 HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCPCPY = @HAVE_WCPCPY@
@@ -1038,6 +1316,7 @@ HAVE_WCSCOLL = @HAVE_WCSCOLL@
 HAVE_WCSCPY = @HAVE_WCSCPY@
 HAVE_WCSCSPN = @HAVE_WCSCSPN@
 HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
 HAVE_WCSLEN = @HAVE_WCSLEN@
 HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
 HAVE_WCSNCAT = @HAVE_WCSNCAT@
@@ -1062,12 +1341,19 @@ HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
 HAVE_WMEMCPY = @HAVE_WMEMCPY@
 HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
 HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
+HOST_CPU = @HOST_CPU@
+HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -1075,34 +1361,55 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
 INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LIBCSTACK = @LIBCSTACK@
+LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM4_LIBDEPS = @LIBM4_LIBDEPS@
 LIBM4_LTLIBDEPS = @LIBM4_LTLIBDEPS@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
-LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBSIGSEGV = @LIBSIGSEGV@
 LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
 LIBTHREAD = @LIBTHREAD@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_GETRANDOM = @LIB_GETRANDOM@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
 LIB_POSIX_SPAWN = @LIB_POSIX_SPAWN@
+LIB_PTHREAD = @LIB_PTHREAD@
+LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SELECT = @LIB_SELECT@
+LIB_SEMAPHORE = @LIB_SEMAPHORE@
+LIB_SETLOCALE = @LIB_SETLOCALE@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
 LIMITS_H = @LIMITS_H@
 LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
 LOCALE_FR = @LOCALE_FR@
 LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
 LOCALE_JA = @LOCALE_JA@
 LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
 LOCALE_ZH_CN = @LOCALE_ZH_CN@
 LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
-LTLIBPTH = @LTLIBPTH@
 LTLIBSIGSEGV = @LTLIBSIGSEGV@
 LTLIBTHREAD = @LTLIBTHREAD@
 M4_LIBOBJS = @M4_LIBOBJS@
@@ -1112,17 +1419,26 @@ M4tests_LTLIBOBJS = @M4tests_LTLIBOBJS@
 M4tests_WITNESS = @M4tests_WITNESS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
 NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@
 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H = @NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H@
 NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@
 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
 NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@
@@ -1132,9 +1448,14 @@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
 NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
@@ -1146,11 +1467,14 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FCNTL_H = @NEXT_FCNTL_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
 NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_PTHREAD_H = @NEXT_PTHREAD_H@
 NEXT_SCHED_H = @NEXT_SCHED_H@
 NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_SPAWN_H = @NEXT_SPAWN_H@
@@ -1160,9 +1484,14 @@ NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@
+NEXT_SYS_RANDOM_H = @NEXT_SYS_RANDOM_H@
+NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
 NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
 NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -1178,14 +1507,16 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
 PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
 PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PRIPTR_PREFIX = @PRIPTR_PREFIX@
-PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
 PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
+REPLACE_ACCESS = @REPLACE_ACCESS@
 REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
 REPLACE_ASINF = @REPLACE_ASINF@
 REPLACE_ATAN2F = @REPLACE_ATAN2F@
 REPLACE_ATANF = @REPLACE_ATANF@
@@ -1202,23 +1533,37 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
 REPLACE_COSF = @REPLACE_COSF@
 REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
 REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
 REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
 REPLACE_EXP2 = @REPLACE_EXP2@
 REPLACE_EXP2L = @REPLACE_EXP2L@
 REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
 REPLACE_EXPM1 = @REPLACE_EXPM1@
 REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
 REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
 REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
 REPLACE_FLOOR = @REPLACE_FLOOR@
 REPLACE_FLOORF = @REPLACE_FLOORF@
 REPLACE_FLOORL = @REPLACE_FLOORL@
@@ -1231,6 +1576,8 @@ REPLACE_FMODL = @REPLACE_FMODL@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FREXP = @REPLACE_FREXP@
 REPLACE_FREXPF = @REPLACE_FREXPF@
@@ -1251,20 +1598,32 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
 REPLACE_HYPOT = @REPLACE_HYPOT@
 REPLACE_HYPOTF = @REPLACE_HYPOTF@
 REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
 REPLACE_ILOGB = @REPLACE_ILOGB@
 REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_IOCTL = @REPLACE_IOCTL@
 REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISFINITE = @REPLACE_ISFINITE@
 REPLACE_ISINF = @REPLACE_ISINF@
 REPLACE_ISNAN = @REPLACE_ISNAN@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
 REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LDEXPL = @REPLACE_LDEXPL@
@@ -1302,7 +1661,9 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@
 REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
 REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
 REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
 REPLACE_MKTIME = @REPLACE_MKTIME@
 REPLACE_MODF = @REPLACE_MODF@
@@ -1310,6 +1671,7 @@ REPLACE_MODFF = @REPLACE_MODFF@
 REPLACE_MODFL = @REPLACE_MODFL@
 REPLACE_NAN = @REPLACE_NAN@
 REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
 REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
 REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
@@ -1318,24 +1680,81 @@ REPLACE_OPENAT = @REPLACE_OPENAT@
 REPLACE_OPENDIR = @REPLACE_OPENDIR@
 REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
 REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PSELECT = @REPLACE_PSELECT@
+REPLACE_PTHREAD_ATTR_DESTROY = @REPLACE_PTHREAD_ATTR_DESTROY@
+REPLACE_PTHREAD_ATTR_GETDETACHSTATE = @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@
+REPLACE_PTHREAD_ATTR_INIT = @REPLACE_PTHREAD_ATTR_INIT@
+REPLACE_PTHREAD_ATTR_SETDETACHSTATE = @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@
+REPLACE_PTHREAD_CONDATTR_DESTROY = @REPLACE_PTHREAD_CONDATTR_DESTROY@
+REPLACE_PTHREAD_CONDATTR_INIT = @REPLACE_PTHREAD_CONDATTR_INIT@
+REPLACE_PTHREAD_COND_BROADCAST = @REPLACE_PTHREAD_COND_BROADCAST@
+REPLACE_PTHREAD_COND_DESTROY = @REPLACE_PTHREAD_COND_DESTROY@
+REPLACE_PTHREAD_COND_INIT = @REPLACE_PTHREAD_COND_INIT@
+REPLACE_PTHREAD_COND_SIGNAL = @REPLACE_PTHREAD_COND_SIGNAL@
+REPLACE_PTHREAD_COND_TIMEDWAIT = @REPLACE_PTHREAD_COND_TIMEDWAIT@
+REPLACE_PTHREAD_COND_WAIT = @REPLACE_PTHREAD_COND_WAIT@
+REPLACE_PTHREAD_CREATE = @REPLACE_PTHREAD_CREATE@
+REPLACE_PTHREAD_DETACH = @REPLACE_PTHREAD_DETACH@
+REPLACE_PTHREAD_EQUAL = @REPLACE_PTHREAD_EQUAL@
+REPLACE_PTHREAD_EXIT = @REPLACE_PTHREAD_EXIT@
+REPLACE_PTHREAD_GETSPECIFIC = @REPLACE_PTHREAD_GETSPECIFIC@
+REPLACE_PTHREAD_JOIN = @REPLACE_PTHREAD_JOIN@
+REPLACE_PTHREAD_KEY_CREATE = @REPLACE_PTHREAD_KEY_CREATE@
+REPLACE_PTHREAD_KEY_DELETE = @REPLACE_PTHREAD_KEY_DELETE@
+REPLACE_PTHREAD_MUTEXATTR_DESTROY = @REPLACE_PTHREAD_MUTEXATTR_DESTROY@
+REPLACE_PTHREAD_MUTEXATTR_GETROBUST = @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_GETTYPE = @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@
+REPLACE_PTHREAD_MUTEXATTR_INIT = @REPLACE_PTHREAD_MUTEXATTR_INIT@
+REPLACE_PTHREAD_MUTEXATTR_SETROBUST = @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_SETTYPE = @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@
+REPLACE_PTHREAD_MUTEX_DESTROY = @REPLACE_PTHREAD_MUTEX_DESTROY@
+REPLACE_PTHREAD_MUTEX_INIT = @REPLACE_PTHREAD_MUTEX_INIT@
+REPLACE_PTHREAD_MUTEX_LOCK = @REPLACE_PTHREAD_MUTEX_LOCK@
+REPLACE_PTHREAD_MUTEX_TIMEDLOCK = @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@
+REPLACE_PTHREAD_MUTEX_TRYLOCK = @REPLACE_PTHREAD_MUTEX_TRYLOCK@
+REPLACE_PTHREAD_MUTEX_UNLOCK = @REPLACE_PTHREAD_MUTEX_UNLOCK@
+REPLACE_PTHREAD_ONCE = @REPLACE_PTHREAD_ONCE@
+REPLACE_PTHREAD_RWLOCKATTR_DESTROY = @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@
+REPLACE_PTHREAD_RWLOCKATTR_INIT = @REPLACE_PTHREAD_RWLOCKATTR_INIT@
+REPLACE_PTHREAD_RWLOCK_DESTROY = @REPLACE_PTHREAD_RWLOCK_DESTROY@
+REPLACE_PTHREAD_RWLOCK_INIT = @REPLACE_PTHREAD_RWLOCK_INIT@
+REPLACE_PTHREAD_RWLOCK_RDLOCK = @REPLACE_PTHREAD_RWLOCK_RDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYRDLOCK = @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYWRLOCK = @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@
+REPLACE_PTHREAD_RWLOCK_UNLOCK = @REPLACE_PTHREAD_RWLOCK_UNLOCK@
+REPLACE_PTHREAD_RWLOCK_WRLOCK = @REPLACE_PTHREAD_RWLOCK_WRLOCK@
+REPLACE_PTHREAD_SELF = @REPLACE_PTHREAD_SELF@
+REPLACE_PTHREAD_SETSPECIFIC = @REPLACE_PTHREAD_SETSPECIFIC@
 REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
+REPLACE_PTHREAD_SPIN_DESTROY = @REPLACE_PTHREAD_SPIN_DESTROY@
+REPLACE_PTHREAD_SPIN_INIT = @REPLACE_PTHREAD_SPIN_INIT@
+REPLACE_PTHREAD_SPIN_LOCK = @REPLACE_PTHREAD_SPIN_LOCK@
+REPLACE_PTHREAD_SPIN_TRYLOCK = @REPLACE_PTHREAD_SPIN_TRYLOCK@
+REPLACE_PTHREAD_SPIN_UNLOCK = @REPLACE_PTHREAD_SPIN_UNLOCK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
 REPLACE_RAISE = @REPLACE_RAISE@
+REPLACE_RANDOM = @REPLACE_RANDOM@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_READLINKAT = @REPLACE_READLINKAT@
 REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
 REPLACE_REALPATH = @REPLACE_REALPATH@
 REPLACE_REMAINDER = @REPLACE_REMAINDER@
 REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
@@ -1343,14 +1762,18 @@ REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
 REPLACE_REMOVE = @REPLACE_REMOVE@
 REPLACE_RENAME = @REPLACE_RENAME@
 REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
 REPLACE_RMDIR = @REPLACE_RMDIR@
 REPLACE_ROUND = @REPLACE_ROUND@
 REPLACE_ROUNDF = @REPLACE_ROUNDF@
 REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SCHED_YIELD = @REPLACE_SCHED_YIELD@
+REPLACE_SELECT = @REPLACE_SELECT@
 REPLACE_SETENV = @REPLACE_SETENV@
 REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
 REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
-REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
 REPLACE_SINF = @REPLACE_SINF@
 REPLACE_SINHF = @REPLACE_SINHF@
 REPLACE_SLEEP = @REPLACE_SLEEP@
@@ -1366,7 +1789,9 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
 REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
 REPLACE_STRNCAT = @REPLACE_STRNCAT@
 REPLACE_STRNDUP = @REPLACE_STRNDUP@
 REPLACE_STRNLEN = @REPLACE_STRNLEN@
@@ -1375,6 +1800,11 @@ REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
 REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
 REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
 REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
 REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
@@ -1386,9 +1816,11 @@ REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
 REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
 REPLACE_TRUNCF = @REPLACE_TRUNCF@
 REPLACE_TRUNCL = @REPLACE_TRUNCL@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
 REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -1401,17 +1833,19 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
 REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
 REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCTOMB = @REPLACE_WCTOMB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 REPLACE_WRITE = @REPLACE_WRITE@
-SCHED_H = @SCHED_H@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIGSEGV_H = @SIGSEGV_H@
 SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
 SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 STDALIGN_H = @STDALIGN_H@
@@ -1420,27 +1854,37 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
 UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
 UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
 WERROR_CFLAGS = @WERROR_CFLAGS@
 WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
 WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+YIELD_LIB = @YIELD_LIB@
 abs_aux_dir = @abs_aux_dir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 am__include = @am__include@
@@ -1518,8 +1962,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -1741,7 +2185,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index 9c3bbe5..eaf3da0 100644 (file)
@@ -6,7 +6,7 @@
 
 @display
 Copyright @copyright{} 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
-@uref{http://fsf.org/}
+@uref{https://fsf.org/}
 
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.
@@ -414,7 +414,7 @@ The Free Software Foundation may publish new, revised versions
 of the GNU Free Documentation License from time to time.  Such new
 versions will be similar in spirit to the present version, but may
 differ in detail to address new problems or concerns.  See
-@uref{http://www.gnu.org/copyleft/}.
+@uref{https://www.gnu.org/licenses/}.
 
 Each version of the License is given a distinguishing version number.
 If the Document specifies that a particular numbered version of this
index fea0ebc..cd9ac38 100644 (file)
@@ -1,5 +1,15 @@
 <!--#include virtual="/server/header.html" -->
-<!-- Parent-Version: 1.77 -->
+<!-- Parent-Version: 1.78 -->
+
+<!--
+Copyright (C) 2006-2021 Free Software Foundation, Inc.
+
+Copying and distribution of this file, with or without modification,
+are permitted in any medium without royalty provided the copyright
+notice and this notice are preserved.  This file is offered as-is,
+without any warranty.
+-->
+
 <title>%%TITLE%% - GNU Project - Free Software Foundation</title>
 <!--#include virtual="/server/banner.html" -->
 <h2>%%TITLE%%</h2>
@@ -52,7 +62,7 @@
     (%%TEXI_TGZ_SIZE%%K bytes gzipped tar file).</a></li>
 </ul>
 
-<p>You can <a href="http://shop.fsf.org/">buy printed copies of
+<p>You can <a href="https://shop.fsf.org/">buy printed copies of
 some manuals</a> (among other items) from the Free Software Foundation;
 this helps support FSF activities.</p>
 
@@ -77,10 +87,10 @@ the FSF.  Broken links and other corrections or suggestions can be sent
 to <a href="mailto:%%EMAIL%%">&lt;%%EMAIL%%&gt;</a>.</p>
 </div>
 
-<p>Copyright &copy; 2016 Free Software Foundation, Inc.</p>
+<p>Copyright &copy; 2020 Free Software Foundation, Inc.</p>
 
 <p>This page is licensed under a <a rel="license"
-href="http://creativecommons.org/licenses/by-nd/3.0/us/">Creative
+href="https://creativecommons.org/licenses/by-nd/3.0/us/">Creative
 Commons Attribution-NoDerivs 3.0 United States License</a>.</p>
 
 <!--#include virtual="/server/bottom-notes.html" -->
index 0e2e212..c007dc0 100644 (file)
@@ -5,7 +5,7 @@
 @c hence no sectioning command or @node.
 
 @display
-Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/}
+Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{https://fsf.org/}
 
 Everyone is permitted to copy and distribute verbatim copies of this
 license document, but changing it is not allowed.
@@ -684,7 +684,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE@.  See the GNU
 General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program.  If not, see @url{http://www.gnu.org/licenses/}.
+along with this program.  If not, see @url{https://www.gnu.org/licenses/}.
 @end smallexample
 
 Also add information on how to contact you by electronic and paper mail.
@@ -707,11 +707,11 @@ use an ``about box''.
 You should also get your employer (if you work as a programmer) or school,
 if any, to sign a ``copyright disclaimer'' for the program, if necessary.
 For more information on this, and how to apply and follow the GNU GPL, see
-@url{http://www.gnu.org/licenses/}.
+@url{https://www.gnu.org/licenses/}.
 
 The GNU General Public License does not permit incorporating your
 program into proprietary programs.  If your program is a subroutine
 library, you may consider it more useful to permit linking proprietary
 applications with the library.  If this is what you want to do, use
 the GNU Lesser General Public License instead of this License.  But
-first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}.
+first, please read @url{https://www.gnu.org/licenses/why-not-lgpl.html}.
index 919a8fb..536f289 100644 (file)
--- a/doc/m4.1
+++ b/doc/m4.1
@@ -1,5 +1,5 @@
-.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.47.4.
-.TH M4 "1" "December 2016" "GNU M4 1.4.18" "User Commands"
+.\" DO NOT MODIFY THIS FILE!  It was generated by help2man 1.48.3.
+.TH M4 "1" "May 2021" "GNU M4 1.4.19" "User Commands"
 .SH NAME
 m4 \- macro processor
 .SH SYNOPSIS
@@ -131,12 +131,12 @@ Written by Rene' Seindal.
 .SH "REPORTING BUGS"
 Report bugs to: bug\-m4@gnu.org
 .br
-GNU M4 home page: <http://www.gnu.org/software/m4/>
+GNU M4 home page: <https://www.gnu.org/software/m4/>
 .br
-General help using GNU software: <http://www.gnu.org/gethelp/>
+General help using GNU software: <https://www.gnu.org/gethelp/>
 .SH COPYRIGHT
-Copyright \(co 2016 Free Software Foundation, Inc.
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
+Copyright \(co 2021 Free Software Foundation, Inc.
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
 .br
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
index c2a876e..7e33514 100644 (file)
@@ -1,17 +1,17 @@
-This is m4.info, produced by makeinfo version 6.1 from m4.texi.
+This is m4.info, produced by makeinfo version 6.7 from m4.texi.
 
-This manual (31 December 2016) is for GNU M4 (version 1.4.18), a package
+This manual (28 May 2021) is for GNU M4 (version 1.4.19), a package
 containing an implementation of the m4 macro language.
 
-   Copyright (C) 1989-1994, 2004-2014, 2016 Free Software Foundation,
-Inc.
+   Copyright © 1989–1994, 2004–2014, 2016–2017, 2020–2021 Free Software
+Foundation, Inc.
 
      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
      Version 1.3 or any later version published by the Free Software
      Foundation; with no Invariant Sections, no Front-Cover Texts, and
      no Back-Cover Texts.  A copy of the license is included in the
-     section entitled "GNU Free Documentation License."
+     section entitled “GNU Free Documentation License.”
 INFO-DIR-SECTION Text creation and manipulation
 START-INFO-DIR-ENTRY
 * M4: (m4).                     A powerful macro processor.
@@ -19,116 +19,121 @@ END-INFO-DIR-ENTRY
 
 \1f
 Indirect:
-m4.info-1: 818
-m4.info-2: 301584
+m4.info-1: 840
+m4.info-2: 310227
 \1f
 Tag Table:
 (Indirect)
-Node: Top\7f818
-Node: Preliminaries\7f9627
-Node: Intro\7f10313
-Node: History\7f11944
-Node: Bugs\7f15881
-Node: Manual\7f17132
-Node: Invoking m4\7f20530
-Node: Operation modes\7f22674
-Node: Preprocessor features\7f25641
-Node: Limits control\7f28737
-Node: Frozen state\7f32634
-Node: Debugging options\7f33433
-Node: Command line files\7f35413
-Node: Syntax\7f36986
-Node: Names\7f38105
-Node: Quoted strings\7f38567
-Node: Comments\7f39216
-Node: Other tokens\7f40093
-Node: Input processing\7f40671
-Ref: Input processing-Footnote-1\7f48597
-Node: Macros\7f48792
-Node: Invocation\7f49286
-Node: Inhibiting Invocation\7f50087
-Node: Macro Arguments\7f54223
-Node: Quoting Arguments\7f57282
-Node: Macro expansion\7f59405
-Node: Definitions\7f60106
-Node: Define\7f60891
-Node: Arguments\7f63329
-Node: Pseudo Arguments\7f66999
-Node: Undefine\7f70541
-Node: Defn\7f71671
-Node: Pushdef\7f76115
-Node: Indir\7f78741
-Node: Builtin\7f80865
-Node: Conditionals\7f83083
-Node: Ifdef\7f84025
-Node: Ifelse\7f84887
-Node: Shift\7f88202
-Node: Forloop\7f98746
-Node: Foreach\7f101383
-Node: Stacks\7f106871
-Node: Composition\7f109911
-Node: Debugging\7f115851
-Node: Dumpdef\7f116436
-Node: Trace\7f117790
-Node: Debug Levels\7f121349
-Node: Debug Output\7f126041
-Node: Input Control\7f127321
-Node: Dnl\7f127858
-Node: Changequote\7f129757
-Node: Changecom\7f135853
-Node: Changeword\7f139548
-Node: M4wrap\7f144989
-Node: File Inclusion\7f148985
-Node: Include\7f149302
-Node: Search Path\7f152010
-Node: Diversions\7f152927
-Node: Divert\7f154610
-Node: Undivert\7f157136
-Node: Divnum\7f160459
-Node: Cleardivert\7f160923
-Node: Text handling\7f162128
-Node: Len\7f162851
-Node: Index macro\7f163236
-Node: Regexp\7f164108
-Node: Substr\7f166640
-Node: Translit\7f167685
-Node: Patsubst\7f170406
-Node: Format\7f174930
-Node: Arithmetic\7f178121
-Node: Incr\7f178570
-Node: Eval\7f179343
-Node: Shell commands\7f187285
-Node: Platform macros\7f188207
-Node: Syscmd\7f190322
-Node: Esyscmd\7f192602
-Node: Sysval\7f194111
-Node: Mkstemp\7f195793
-Node: Miscellaneous\7f199743
-Node: Errprint\7f200176
-Node: Location\7f201393
-Node: M4exit\7f204164
-Node: Frozen files\7f206250
-Node: Using frozen files\7f207032
-Node: Frozen file format\7f210297
-Node: Compatibility\7f213363
-Node: Extensions\7f214428
-Node: Incompatibilities\7f218295
-Node: Other Incompatibilities\7f227209
-Node: Answers\7f229855
-Node: Improved exch\7f230637
-Node: Improved forloop\7f231175
-Node: Improved foreach\7f236505
-Node: Improved copy\7f249465
-Node: Improved m4wrap\7f253419
-Node: Improved cleardivert\7f255843
-Node: Improved capitalize\7f256824
-Node: Improved fatal_error\7f261684
-Node: Copying This Package\7f262744
-Node: GNU General Public License\7f263223
-Node: Copying This Manual\7f301584
-Node: GNU Free Documentation License\7f302104
-Node: Indices\7f327215
-Node: Macro index\7f327495
-Node: Concept index\7f333878
+Node: Top\7f840
+Node: Preliminaries\7f9797
+Node: Intro\7f10503
+Node: History\7f12194
+Node: Bugs\7f16281
+Node: Manual\7f17556
+Node: Invoking m4\7f21066
+Node: Operation modes\7f23270
+Node: Preprocessor features\7f26369
+Node: Limits control\7f29539
+Node: Frozen state\7f33550
+Node: Debugging options\7f34389
+Node: Command line files\7f36441
+Node: Syntax\7f38092
+Node: Names\7f39247
+Node: Quoted strings\7f39729
+Node: Comments\7f40396
+Node: Other tokens\7f41300
+Node: Input processing\7f41894
+Ref: Input processing-Footnote-1\7f50337
+Node: Macros\7f50534
+Node: Invocation\7f51028
+Node: Inhibiting Invocation\7f51829
+Node: Macro Arguments\7f56077
+Node: Quoting Arguments\7f59199
+Node: Macro expansion\7f61339
+Node: Definitions\7f62059
+Node: Define\7f62844
+Node: Arguments\7f65365
+Node: Pseudo Arguments\7f69132
+Node: Undefine\7f72762
+Node: Defn\7f73924
+Node: Pushdef\7f78479
+Node: Indir\7f81221
+Node: Builtin\7f83393
+Node: Conditionals\7f85669
+Node: Ifdef\7f86615
+Node: Ifelse\7f87498
+Node: Shift\7f90887
+Node: Forloop\7f101719
+Node: Foreach\7f104402
+Node: Stacks\7f110026
+Node: Composition\7f113163
+Node: Debugging\7f119258
+Node: Dumpdef\7f119851
+Node: Trace\7f121223
+Node: Debug Levels\7f124877
+Node: Debug Output\7f129752
+Node: Input Control\7f131066
+Node: Dnl\7f131607
+Node: Changequote\7f133553
+Node: Changecom\7f139947
+Node: Changeword\7f143840
+Node: M4wrap\7f149443
+Node: File Inclusion\7f153534
+Node: Include\7f153855
+Node: Search Path\7f156674
+Node: Diversions\7f157623
+Node: Divert\7f159332
+Node: Undivert\7f161905
+Node: Divnum\7f165291
+Node: Cleardivert\7f165764
+Node: Text handling\7f166986
+Node: Len\7f167713
+Node: Index macro\7f168108
+Node: Regexp\7f169002
+Node: Substr\7f171590
+Node: Translit\7f172649
+Node: Patsubst\7f175449
+Node: Format\7f180080
+Node: Arithmetic\7f183491
+Node: Incr\7f183944
+Node: Eval\7f184739
+Node: Shell commands\7f192948
+Node: Platform macros\7f193886
+Node: Syscmd\7f196088
+Node: Esyscmd\7f198464
+Node: Sysval\7f200048
+Node: Mkstemp\7f201993
+Node: Miscellaneous\7f206052
+Node: Errprint\7f206489
+Node: Location\7f207742
+Node: M4exit\7f210623
+Node: Frozen files\7f212757
+Node: Using frozen files\7f213557
+Node: Frozen file format\7f216938
+Node: Compatibility\7f220088
+Node: Extensions\7f221170
+Node: Incompatibilities\7f225224
+Node: Other Incompatibilities\7f234528
+Node: Answers\7f237258
+Node: Improved exch\7f238072
+Node: Improved forloop\7f238625
+Node: Improved foreach\7f244081
+Node: Improved copy\7f257459
+Node: Improved m4wrap\7f261518
+Node: Improved cleardivert\7f264014
+Node: Improved capitalize\7f265012
+Node: Improved fatal_error\7f270048
+Node: Copying This Package\7f271145
+Node: GNU General Public License\7f271624
+Node: Copying This Manual\7f310227
+Node: GNU Free Documentation License\7f310751
+Node: Indices\7f336068
+Node: Macro index\7f336352
+Node: Concept index\7f342743
 \1f
 End Tag Table
+
+\1f
+Local Variables:
+coding: utf-8
+End:
index 93c8f7f..ec6d71f 100644 (file)
@@ -1,17 +1,17 @@
-This is m4.info, produced by makeinfo version 6.1 from m4.texi.
+This is m4.info, produced by makeinfo version 6.7 from m4.texi.
 
-This manual (31 December 2016) is for GNU M4 (version 1.4.18), a package
+This manual (28 May 2021) is for GNU M4 (version 1.4.19), a package
 containing an implementation of the m4 macro language.
 
-   Copyright (C) 1989-1994, 2004-2014, 2016 Free Software Foundation,
-Inc.
+   Copyright © 1989–1994, 2004–2014, 2016–2017, 2020–2021 Free Software
+Foundation, Inc.
 
      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
      Version 1.3 or any later version published by the Free Software
      Foundation; with no Invariant Sections, no Front-Cover Texts, and
      no Back-Cover Texts.  A copy of the license is included in the
-     section entitled "GNU Free Documentation License."
+     section entitled “GNU Free Documentation License.”
 INFO-DIR-SECTION Text creation and manipulation
 START-INFO-DIR-ENTRY
 * M4: (m4).                     A powerful macro processor.
@@ -23,40 +23,40 @@ File: m4.info,  Node: Top,  Next: Preliminaries,  Up: (dir)
 GNU M4
 ******
 
-This manual (31 December 2016) is for GNU M4 (version 1.4.18), a package
+This manual (28 May 2021) is for GNU M4 (version 1.4.19), a package
 containing an implementation of the m4 macro language.
 
-   Copyright (C) 1989-1994, 2004-2014, 2016 Free Software Foundation,
-Inc.
+   Copyright © 1989–1994, 2004–2014, 2016–2017, 2020–2021 Free Software
+Foundation, Inc.
 
      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
      Version 1.3 or any later version published by the Free Software
      Foundation; with no Invariant Sections, no Front-Cover Texts, and
      no Back-Cover Texts.  A copy of the license is included in the
-     section entitled "GNU Free Documentation License."
+     section entitled “GNU Free Documentation License.”
 
-   GNU 'm4' is an implementation of the traditional UNIX macro
+   GNU ‘m4’ is an implementation of the traditional UNIX macro
 processor.  It is mostly SVR4 compatible, although it has some
 extensions (for example, handling more than 9 positional parameters to
-macros).  'm4' also has builtin functions for including files, running
-shell commands, doing arithmetic, etc.  Autoconf needs GNU 'm4' for
-generating 'configure' scripts, but not for running them.
+macros).  ‘m4’ also has builtin functions for including files, running
+shell commands, doing arithmetic, etc.  Autoconf needs GNU ‘m4’ for
+generating ‘configure’ scripts, but not for running them.
 
-   GNU 'm4' was originally written by Rene' Seindal, with subsequent
-changes by Franc,ois Pinard and other volunteers on the Internet.  All
-names and email addresses can be found in the files 'm4-1.4.18/AUTHORS'
-and 'm4-1.4.18/THANKS' from the GNU M4 distribution.
+   GNU ‘m4’ was originally written by René Seindal, with subsequent
+changes by François Pinard and other volunteers on the Internet.  All
+names and email addresses can be found in the files ‘m4-1.4.19/AUTHORS’
+and ‘m4-1.4.19/THANKS’ from the GNU M4 distribution.
 
-   This is release 1.4.18.  It is now considered stable: future releases
+   This is release 1.4.19.  It is now considered stable: future releases
 in the 1.4.x series are only meant to fix bugs, increase speed, or
 improve documentation.  However...
 
-   An experimental feature, which would improve 'm4' usefulness, allows
-for changing the syntax for what is a "word" in 'm4'.  You should use:
+   An experimental feature, which would improve ‘m4’ usefulness, allows
+for changing the syntax for what is a “word” in ‘m4’.  You should use:
      ./configure --enable-changeword
 if you want this feature compiled in.  The current implementation slows
-down 'm4' considerably and is hardly acceptable.  In the future, 'm4'
+down ‘m4’ considerably and is hardly acceptable.  In the future, ‘m4’
 2.0 will come with a different set of new features that provide similar
 capabilities, but without the inefficiencies, so changeword will go away
 and _you should not count on it_.
@@ -64,7 +64,7 @@ and _you should not count on it_.
 * Menu:
 
 * Preliminaries::               Introduction and preliminaries
-* Invoking m4::                 Invoking 'm4'
+* Invoking m4::                 Invoking ‘m4’
 * Syntax::                      Lexical and syntactic conventions
 
 * Macros::                      How to invoke macros
@@ -83,23 +83,23 @@ and _you should not count on it_.
 * Miscellaneous::               Miscellaneous builtin macros
 * Frozen files::                Fast loading of frozen state
 
-* Compatibility::               Compatibility with other versions of 'm4'
+* Compatibility::               Compatibility with other versions of ‘m4’
 * Answers::                     Correct version of some examples
 
 * Copying This Package::        How to make copies of the overall M4 package
 * Copying This Manual::         How to make copies of this manual
 * Indices::                     Indices of concepts and macros
 
- -- The Detailed Node Listing --
+ — The Detailed Node Listing —
 
 Introduction and preliminaries
 
-* Intro::                       Introduction to 'm4'
+* Intro::                       Introduction to ‘m4’
 * History::                     Historical references
 * Bugs::                        Problems and bugs
 * Manual::                      Using this manual
 
-Invoking 'm4'
+Invoking ‘m4’
 
 * Operation modes::             Command line options for operation modes
 * Preprocessor features::       Command line options for preprocessor features
@@ -111,10 +111,10 @@ Invoking 'm4'
 Lexical and syntactic conventions
 
 * Names::                       Macro names
-* Quoted strings::              Quoting input to 'm4'
-* Comments::                    Comments in 'm4' input
+* Quoted strings::              Quoting input to ‘m4’
+* Comments::                    Comments in ‘m4’ input
 * Other tokens::                Other kinds of input tokens
-* Input processing::            How 'm4' copies input to output
+* Input processing::            How ‘m4’ copies input to output
 
 How to invoke macros
 
@@ -140,7 +140,7 @@ Conditionals, loops, and recursion
 
 * Ifdef::                       Testing if a macro is defined
 * Ifelse::                      If-else construct, or multibranch
-* Shift::                       Recursion in 'm4'
+* Shift::                       Recursion in ‘m4’
 * Forloop::                     Iteration by counting
 * Foreach::                     Iteration by list contents
 * Stacks::                      Working with definition stacks
@@ -200,14 +200,14 @@ Miscellaneous builtin macros
 
 * Errprint::                    Printing error messages
 * Location::                    Printing current location
-* M4exit::                      Exiting from 'm4'
+* M4exit::                      Exiting from ‘m4’
 
 Fast loading of frozen state
 
 * Using frozen files::          Using frozen files
 * Frozen file format::          Frozen file format
 
-Compatibility with other versions of 'm4'
+Compatibility with other versions of ‘m4’
 
 * Extensions::                  Extensions in GNU M4
 * Incompatibilities::           Facilities in System V m4 not in GNU M4
@@ -215,14 +215,14 @@ Compatibility with other versions of 'm4'
 
 Correct version of some examples
 
-* Improved exch::               Solution for 'exch'
-* Improved forloop::            Solution for 'forloop'
-* Improved foreach::            Solution for 'foreach'
-* Improved copy::               Solution for 'copy'
-* Improved m4wrap::             Solution for 'm4wrap'
-* Improved cleardivert::        Solution for 'cleardivert'
-* Improved capitalize::         Solution for 'capitalize'
-* Improved fatal_error::        Solution for 'fatal_error'
+* Improved exch::               Solution for ‘exch’
+* Improved forloop::            Solution for ‘forloop’
+* Improved foreach::            Solution for ‘foreach’
+* Improved copy::               Solution for ‘copy’
+* Improved m4wrap::             Solution for ‘m4wrap’
+* Improved cleardivert::        Solution for ‘cleardivert’
+* Improved capitalize::         Solution for ‘capitalize’
+* Improved fatal_error::        Solution for ‘fatal_error’
 
 How to make copies of the overall M4 package
 
@@ -234,7 +234,7 @@ How to make copies of this manual
 
 Indices of concepts and macros
 
-* Macro index::                 Index for all 'm4' macros
+* Macro index::                 Index for all ‘m4’ macros
 * Concept index::               Index for many concepts
 
 
@@ -244,17 +244,17 @@ File: m4.info,  Node: Preliminaries,  Next: Invoking m4,  Prev: Top,  Up: Top
 1 Introduction and preliminaries
 ********************************
 
-This first chapter explains what GNU 'm4' is, where 'm4' comes from, how
-to read and use this documentation, how to call the 'm4' program, and
+This first chapter explains what GNU ‘m4’ is, where ‘m4’ comes from, how
+to read and use this documentation, how to call the ‘m4’ program, and
 how to report bugs about it.  It concludes by giving tips for reading
 the remainder of the manual.
 
-   The following chapters then detail all the features of the 'm4'
+   The following chapters then detail all the features of the ‘m4’
 language.
 
 * Menu:
 
-* Intro::                       Introduction to 'm4'
+* Intro::                       Introduction to ‘m4’
 * History::                     Historical references
 * Bugs::                        Problems and bugs
 * Manual::                      Using this manual
@@ -262,32 +262,32 @@ language.
 \1f
 File: m4.info,  Node: Intro,  Next: History,  Up: Preliminaries
 
-1.1 Introduction to 'm4'
+1.1 Introduction to ‘m4’
 ========================
 
-'m4' is a macro processor, in the sense that it copies its input to the
+‘m4’ is a macro processor, in the sense that it copies its input to the
 output, expanding macros as it goes.  Macros are either builtin or
 user-defined, and can take any number of arguments.  Besides just doing
-macro expansion, 'm4' has builtin functions for including named files,
+macro expansion, ‘m4’ has builtin functions for including named files,
 running shell commands, doing integer arithmetic, manipulating text in
-various ways, performing recursion, etc.... 'm4' can be used either as a
+various ways, performing recursion, etc.... ‘m4’ can be used either as a
 front-end to a compiler, or as a macro processor in its own right.
 
-   The 'm4' macro processor is widely available on all UNIXes, and has
+   The ‘m4’ macro processor is widely available on all UNIXes, and has
 been standardized by POSIX. Usually, only a small percentage of users
 are aware of its existence.  However, those who find it often become
 committed users.  The popularity of GNU Autoconf, which requires GNU
-'m4' for _generating_ 'configure' scripts, is an incentive for many to
-install it, while these people will not themselves program in 'm4'.  GNU
-'m4' is mostly compatible with the System V, Release 4 version, except
+‘m4’ for _generating_ ‘configure’ scripts, is an incentive for many to
+install it, while these people will not themselves program in ‘m4’.  GNU
+‘m4’ is mostly compatible with the System V, Release 4 version, except
 for some minor differences.  *Note Compatibility::, for more details.
 
-   Some people find 'm4' to be fairly addictive.  They first use 'm4'
+   Some people find ‘m4’ to be fairly addictive.  They first use ‘m4’
 for simple problems, then take bigger and bigger challenges, learning
-how to write complex sets of 'm4' macros along the way.  Once really
-addicted, users pursue writing of sophisticated 'm4' applications even
-to solve simple problems, devoting more time debugging their 'm4'
-scripts than doing real work.  Beware that 'm4' may be dangerous for the
+how to write complex sets of ‘m4’ macros along the way.  Once really
+addicted, users pursue writing of sophisticated ‘m4’ applications even
+to solve simple problems, devoting more time debugging their ‘m4’
+scripts than doing real work.  Beware that ‘m4’ may be dangerous for the
 health of compulsive programmers.
 
 \1f
@@ -300,75 +300,75 @@ Macro languages were invented early in the history of computing.  In the
 1950s Alan Perlis suggested that the macro language be independent of
 the language being processed.  Techniques such as conditional and
 recursive macros, and using macros to define other macros, were
-described by Doug McIlroy of Bell Labs in "Macro Instruction Extensions
-of Compiler Languages", _Communications of the ACM_ 3, 4 (1960), 214-20,
-<http://dx.doi.org/10.1145/367177.367223>.
-
-   An important precursor of 'm4' was GPM; see C. Strachey, "A general
-purpose macrogenerator", _Computer Journal_ 8, 3 (1965), 225-41,
-<http://dx.doi.org/10.1093/comjnl/8.3.225>.  GPM is also succinctly
-described in David Gries's book _Compiler Construction for Digital
-Computers_, Wiley (1971).  Strachey was a brilliant programmer: GPM fit
-into 250 machine instructions!
-
-   Inspired by GPM while visiting Strachey's Lab in 1968, McIlroy wrote
+described by Doug McIlroy of Bell Labs in Macro Instruction Extensions
+of Compiler Languages”, _Communications of the ACM_ 3, 4 (1960), 214–20,
+<https://dl.acm.org/doi/10.1145/367177.367223>.
+
+   An important precursor of ‘m4’ was GPM; see C. Strachey, “A general
+purpose macrogenerator”, _Computer Journal_ 8, 3 (1965), 225–41,
+<https://academic.oup.com/comjnl/article/8/3/225/336044>.  GPM is also
+succinctly described in David Gries’s book _Compiler Construction for
+Digital Computers_, Wiley (1971).  Strachey was a brilliant programmer:
+GPM fit into 250 machine instructions!
+
+   Inspired by GPM while visiting Stracheys Lab in 1968, McIlroy wrote
 a model preprocessor in that fit into a page of Snobol 3 code, and
 McIlroy and Robert Morris developed a series of further models at Bell
 Labs.  Andrew D. Hall followed up with M6, a general purpose macro
 processor used to port the Fortran source code of the Altran computer
-algebra system; see Hall's "The M6 Macro Processor", Computing Science
+algebra system; see Hall’s “The M6 Macro Processor”, Computing Science
 Technical Report #2, Bell Labs (1972),
-<http://cm.bell-labs.com/cm/cs/cstr/2.pdf>.  M6's source code consisted
-of about 600 Fortran statements.  Its name was the first of the 'm4'
+<http://cm.bell-labs.com/cm/cs/cstr/2.pdf>.  M6s source code consisted
+of about 600 Fortran statements.  Its name was the first of the ‘m4’
 line.
 
    The Brian Kernighan and P.J. Plauger book _Software Tools_,
 Addison-Wesley (1976), describes and implements a Unix macro-processor
-language, which inspired Dennis Ritchie to write 'm3', a macro processor
+language, which inspired Dennis Ritchie to write ‘m3’, a macro processor
 for the AP-3 minicomputer.
 
    Kernighan and Ritchie then joined forces to develop the original
-'m4', described in "The M4 Macro Processor", Bell Laboratories (1977),
-<http://wolfram.schneider.org/bsd/7thEdManVol2/m4/m4.pdf>.  It had only
+‘m4’, described in “The M4 Macro Processor”, Bell Laboratories (1977),
+<https://wolfram.schneider.org/bsd/7thEdManVol2/m4/m4.pdf>.  It had only
 21 builtin macros.
 
-   While 'GPM' was more _pure_, 'm4' is meant to deal with the true
+   While ‘GPM’ was more _pure_, ‘m4’ is meant to deal with the true
 intricacies of real life: macros can be recognized without being
 pre-announced, skipping whitespace or end-of-lines is easier, more
 constructs are builtin instead of derived, etc.
 
-   Originally, the Kernighan and Plauger macro-processor, and then 'm3',
+   Originally, the Kernighan and Plauger macro-processor, and then ‘m3’,
 formed the engine for the Rational FORTRAN preprocessor, that is, the
-'Ratfor' equivalent of 'cpp'.  Later, 'm4' was used as a front-end for
-'Ratfor', 'C' and 'Cobol'.
+‘Ratfor’ equivalent of ‘cpp’.  Later, ‘m4’ was used as a front-end for
+‘Ratfor’, ‘C’ and ‘Cobol’.
 
-   Rene' Seindal released his implementation of 'm4', GNU 'm4', in 1990,
+   René Seindal released his implementation of ‘m4’, GNU ‘m4’, in 1990,
 with the aim of removing the artificial limitations in many of the
-traditional 'm4' implementations, such as maximum line length, macro
+traditional ‘m4’ implementations, such as maximum line length, macro
 size, or number of macros.
 
    The late Professor A. Dain Samples described and implemented a
-further evolution in the form of 'M5': "User's Guide to the M5 Macro
-Language: 2nd edition", Electronic Announcement on comp.compilers
+further evolution in the form of ‘M5’: “User’s Guide to the M5 Macro
+Language: 2nd edition, Electronic Announcement on comp.compilers
 newsgroup (1992).
 
-   Franc,ois Pinard took over maintenance of GNU 'm4' in 1992, until
-1994 when he released GNU 'm4' 1.4, which was the stable release for 10
+   François Pinard took over maintenance of GNU ‘m4’ in 1992, until 1994
+when he released GNU ‘m4’ 1.4, which was the stable release for 10
 years.  It was at this time that GNU Autoconf decided to require GNU
-'m4' as its underlying engine, since all other implementations of 'm4'
+‘m4’ as its underlying engine, since all other implementations of ‘m4’
 had too many limitations.
 
    More recently, in 2004, Paul Eggert released 1.4.1 and 1.4.2 which
 addressed some long standing bugs in the venerable 1.4 release.  Then in
-2005, Gary V. Vaughan collected together the many patches to GNU 'm4'
+2005, Gary V. Vaughan collected together the many patches to GNU ‘m4’
 1.4 that were floating around the net and released 1.4.3 and 1.4.4.  And
 in 2006, Eric Blake joined the team and prepared patches for the release
 of 1.4.5, with subsequent releases through intervening years, as recent
 as 1.4.18 in 2016.
 
-   Meanwhile, development has continued on new features for 'm4', such
+   Meanwhile, development has continued on new features for ‘m4’, such
 as dynamic module loading and additional builtins.  When complete, GNU
-'m4' 2.0 will start a new series of releases.
+‘m4’ 2.0 will start a new series of releases.
 
 \1f
 File: m4.info,  Node: Bugs,  Next: Manual,  Prev: History,  Up: Preliminaries
@@ -376,22 +376,22 @@ File: m4.info,  Node: Bugs,  Next: Manual,  Prev: History,  Up: Preliminaries
 1.3 Problems and bugs
 =====================
 
-If you have problems with GNU M4 or think you've found a bug, please
-report it.  Before reporting a bug, make sure you've actually found a
+If you have problems with GNU M4 or think youve found a bug, please
+report it.  Before reporting a bug, make sure youve actually found a
 real bug.  Carefully reread the documentation and see if it really says
-you can do what you're trying to do.  If it's not clear whether you
-should be able to do something or not, report that too; it's a bug in
+you can do what you’re trying to do.  If it’s not clear whether you
+should be able to do something or not, report that too; its a bug in
 the documentation!
 
    Before reporting a bug or trying to fix it yourself, try to isolate
 it to the smallest possible input file that reproduces the problem.
-Then send us the input file and the exact results 'm4' gave you.  Also
+Then send us the input file and the exact results ‘m4’ gave you.  Also
 say what you expected to occur; this will help us decide whether the
 problem was really in the documentation.
 
-   Once you've got a precise problem, send e-mail to <bug-m4@gnu.org>.
-Please include the version number of 'm4' you are using.  You can get
-this information with the command 'm4 --version'.  Also provide details
+   Once youve got a precise problem, send e-mail to <bug-m4@gnu.org>.
+Please include the version number of ‘m4’ you are using.  You can get
+this information with the command ‘m4 --version’.  Also provide details
 about the platform you are executing on.
 
    Non-bug suggestions are always welcome as well.  If you have
@@ -404,58 +404,58 @@ File: m4.info,  Node: Manual,  Prev: Bugs,  Up: Preliminaries
 1.4 Using this manual
 =====================
 
-This manual contains a number of examples of 'm4' input and output, and
+This manual contains a number of examples of ‘m4’ input and output, and
 a simple notation is used to distinguish input, output and error
-messages from 'm4'.  Examples are set out from the normal text, and
+messages from ‘m4’.  Examples are set out from the normal text, and
 shown in a fixed width font, like this
 
      This is an example of an example!
 
-   To distinguish input from output, all output from 'm4' is prefixed by
-the string '=>', and all error messages by the string 'error->'.  When
+   To distinguish input from output, all output from ‘m4’ is prefixed by
+the string ‘⇒’, and all error messages by the string ‘error→’.  When
 showing how command line options affect matters, the command line is
-shown with a prompt '$ 'like this'', otherwise, you can assume that a
-simple 'm4' invocation will work.  Thus:
+shown with a prompt ‘$ ‘like this’’, otherwise, you can assume that a
+simple ‘m4’ invocation will work.  Thus:
 
      $ command line to invoke m4
      Example of input line
-     =>Output line from m4
-     error->and an error message
+     Output line from m4
+     errorand an error message
 
-   The sequence '^D' in an example indicates the end of the input file.
-The sequence '<NL>' refers to the newline character.  The majority of
+   The sequence ‘^D’ in an example indicates the end of the input file.
+The sequence ‘<NL>’ refers to the newline character.  The majority of
 these examples are self-contained, and you can run them with similar
-results by invoking 'm4 -d'.  In fact, the testsuite that is bundled in
+results by invoking ‘m4 -d’.  In fact, the testsuite that is bundled in
 the GNU M4 package consists of the examples in this document!  Some of
 the examples assume that your current directory is located where you
 unpacked the installation, so if you plan on following along, you may
 find it helpful to do this now:
 
-     $ cd m4-1.4.18
+     $ cd m4-1.4.19
 
-   As each of the predefined macros in 'm4' is described, a prototype
+   As each of the predefined macros in ‘m4’ is described, a prototype
 call of the macro will be shown, giving descriptive names to the
 arguments, e.g.,
 
- -- Composite: example (STRING, [COUNT = '1'], [ARGUMENT]...)
+ -- Composite: example (STRING, [COUNT = ‘1’], [ARGUMENT]...)
      This is a sample prototype.  There is not really a macro named
-     'example', but this documents that if there were, it would be a
+     ‘example’, but this documents that if there were, it would be a
      Composite macro, rather than a Builtin.  It requires at least one
-     argument, STRING.  Remember that in 'm4', there must not be a space
+     argument, STRING.  Remember that in ‘m4’, there must not be a space
      between the macro name and the opening parenthesis, unless it was
      intended to call the macro without any arguments.  The brackets
      around COUNT and ARGUMENT show that these arguments are optional.
-     If COUNT is omitted, the macro behaves as if count were '1',
+     If COUNT is omitted, the macro behaves as if count were ‘1’,
      whereas if ARGUMENT is omitted, the macro behaves as if it were the
      empty string.  A blank argument is not the same as an omitted
-     argument.  For example, 'example(`a')', 'example(`a',`1')', and
-     'example(`a',`1',)' would behave identically with COUNT set to '1';
-     while 'example(`a',)' and 'example(`a',`')' would explicitly pass
-     the empty string for COUNT.  The ellipses ('...') show that the
+     argument.  For example, ‘example(`a')’, ‘example(`a',`1')’, and
+     ‘example(`a',`1',)’ would behave identically with COUNT set to ‘1’;
+     while ‘example(`a',)’ and ‘example(`a',`')’ would explicitly pass
+     the empty string for COUNT.  The ellipses (‘...’) show that the
      macro processes additional arguments after ARGUMENT, rather than
      ignoring them.
 
-   All macro arguments in 'm4' are strings, but some are given special
+   All macro arguments in ‘m4’ are strings, but some are given special
 interpretation, e.g., as numbers, file names, regular expressions, etc.
 The documentation for each macro will state how the parameters are
 interpreted, and what happens if the argument cannot be parsed according
@@ -464,46 +464,46 @@ specified to be a number is parsed as a decimal, even if the argument
 has leading zeros; and parsing the empty string as a number results in 0
 rather than an error, although a warning will be issued.
 
-   This document consistently writes and uses "builtin", without a
-hyphen, as if it were an English word.  This is how the 'builtin'
-primitive is spelled within 'm4'.
+   This document consistently writes and uses “builtin”, without a
+hyphen, as if it were an English word.  This is how the ‘builtin’
+primitive is spelled within ‘m4’.
 
 \1f
 File: m4.info,  Node: Invoking m4,  Next: Syntax,  Prev: Preliminaries,  Up: Top
 
-2 Invoking 'm4'
+2 Invoking ‘m4’
 ***************
 
-The format of the 'm4' command is:
+The format of the ‘m4’ command is:
 
      m4 [OPTION...] [FILE...]
 
-   All options begin with '-', or if long option names are used, with
-'--'.  A long option name need not be written completely, any
-unambiguous prefix is sufficient.  POSIX requires 'm4' to recognize
-arguments intermixed with files, even when 'POSIXLY_CORRECT' is set in
+   All options begin with ‘-’, or if long option names are used, with
+‘--’.  A long option name need not be written completely, any
+unambiguous prefix is sufficient.  POSIX requires ‘m4’ to recognize
+arguments intermixed with files, even when ‘POSIXLY_CORRECT’ is set in
 the environment.  Most options take effect at startup regardless of
 their position, but some are documented below as taking effect after any
-files that occurred earlier in the command line.  The argument '--' is a
+files that occurred earlier in the command line.  The argument ‘--’ is a
 marker to denote the end of options.
 
    With short options, options that do not take arguments may be
 combined into a single command line argument with subsequent options,
 options with mandatory arguments may be provided either as a single
 command line argument or as two arguments, and options with optional
-arguments must be provided as a single argument.  In other words, 'm4
--QPDfoo -d a -df' is equivalent to 'm4 -Q -P -D foo -d -df -- ./a',
+arguments must be provided as a single argument.  In other words, m4
+-QPDfoo -d a -df’ is equivalent to ‘m4 -Q -P -D foo -d -df -- ./a’,
 although the latter form is considered canonical.
 
    With long options, options with mandatory arguments may be provided
-with an equal sign ('=') in a single argument, or as two arguments, and
+with an equal sign (‘=’) in a single argument, or as two arguments, and
 options with optional arguments must be provided as a single argument.
-In other words, 'm4 --def foo --debug a' is equivalent to 'm4
---define=foo --debug= -- ./a', although the latter form is considered
-canonical (not to mention more robust, in case a future version of 'm4'
-introduces an option named '--default').
+In other words, ‘m4 --def foo --debug a’ is equivalent to ‘m4
+--define=foo --debug= -- ./a, although the latter form is considered
+canonical (not to mention more robust, in case a future version of ‘m4’
+introduces an option named ‘--default’).
 
-   'm4' understands the following options, grouped by functionality.
+   ‘m4’ understands the following options, grouped by functionality.
 
 * Menu:
 
@@ -520,19 +520,19 @@ File: m4.info,  Node: Operation modes,  Next: Preprocessor features,  Up: Invoki
 2.1 Command line options for operation modes
 ============================================
 
-Several options control the overall operation of 'm4':
+Several options control the overall operation of ‘m4’:
 
-'--help'
-     Print a help summary on standard output, then immediately exit 'm4'
+‘--help’
+     Print a help summary on standard output, then immediately exit ‘m4’
      without reading any input files or performing any other actions.
 
-'--version'
+‘--version’
      Print the version number of the program on standard output, then
-     immediately exit 'm4' without reading any input files or performing
+     immediately exit ‘m4’ without reading any input files or performing
      any other actions.
 
-'-E'
-'--fatal-warnings'
+‘-E’
+‘--fatal-warnings’
      Controls the effect of warnings.  If unspecified, then execution
      continues and exit status is unaffected when a warning is printed.
      If specified exactly once, warnings become fatal; when one is
@@ -540,37 +540,37 @@ Several options control the overall operation of 'm4':
      If specified multiple times, then execution halts with non-zero
      status the first time a warning is issued.  The introduction of
      behavior levels is new to M4 1.4.9; for behavior consistent with
-     earlier versions, you should specify '-E' twice.
+     earlier versions, you should specify ‘-E’ twice.
 
-'-i'
-'--interactive'
-'-e'
-     Makes this invocation of 'm4' interactive.  This means that all
+‘-i’
+‘--interactive’
+‘-e’
+     Makes this invocation of ‘m4’ interactive.  This means that all
      output will be unbuffered, and interrupts will be ignored.  The
-     spelling '-e' exists for compatibility with other 'm4'
+     spelling ‘-e’ exists for compatibility with other ‘m4’
      implementations, and issues a warning because it may be withdrawn
      in a future version of GNU M4.
 
-'-P'
-'--prefix-builtins'
+‘-P’
+‘--prefix-builtins’
      Internally modify _all_ builtin macro names so they all start with
-     the prefix 'm4_'.  For example, using this option, one should write
-     'm4_define' instead of 'define', and 'm4___file__' instead of
-     '__file__'.  This option has no effect if '-R' is also specified.
+     the prefix ‘m4_’.  For example, using this option, one should write
+     ‘m4_define’ instead of ‘define’, and ‘m4___file__’ instead of
+     ‘__file__’.  This option has no effect if ‘-R’ is also specified.
 
-'-Q'
-'--quiet'
-'--silent'
+‘-Q’
+‘--quiet’
+‘--silent’
      Suppress warnings, such as missing or superfluous arguments in
      macro calls, or treating the empty string as zero.
 
-'--warn-macro-sequence[=REGEXP]'
+‘--warn-macro-sequence[=REGEXP]’
      Issue a warning if the regular expression REGEXP has a non-empty
-     match in any macro definition (either by 'define' or 'pushdef').
+     match in any macro definition (either by ‘define’ or ‘pushdef’).
      Empty matches are ignored; therefore, supplying the empty string as
      REGEXP disables any warning.  If the optional REGEXP is not
      supplied, then the default regular expression is
-     '\$\({[^}]*}\|[0-9][0-9]+\)' (a literal '$' followed by multiple
+     ‘\$\({[^}]*}\|[0-9][0-9]+\)’ (a literal ‘$’ followed by multiple
      digits or by an open brace), since these sequences will change
      semantics in the default operation of GNU M4 2.0 (due to a change
      in how more than 9 arguments in a macro definition will be handled,
@@ -578,10 +578,10 @@ Several options control the overall operation of 'm4':
      provide a useful reverse lookup feature of finding where a macro is
      defined to have a given definition.
 
-'-W REGEXP'
-'--word-regexp=REGEXP'
+‘-W REGEXP’
+‘--word-regexp=REGEXP’
      Use REGEXP as an alternative syntax for macro names.  This
-     experimental option will not be present in all GNU 'm4'
+     experimental option will not be present in all GNU ‘m4’
      implementations (*note Changeword::).
 
 \1f
@@ -590,37 +590,37 @@ File: m4.info,  Node: Preprocessor features,  Next: Limits control,  Prev: Opera
 2.2 Command line options for preprocessor features
 ==================================================
 
-Several options allow 'm4' to behave more like a preprocessor.  Macro
+Several options allow ‘m4’ to behave more like a preprocessor.  Macro
 definitions and deletions can be made on the command line, the search
 path can be altered, and the output file can track where the input came
 from.  These features occur with the following options:
 
-'-D NAME[=VALUE]'
-'--define=NAME[=VALUE]'
-     This enters NAME into the symbol table.  If '=VALUE' is missing,
+‘-D NAME[=VALUE]’
+‘--define=NAME[=VALUE]’
+     This enters NAME into the symbol table.  If ‘=VALUE’ is missing,
      the value is taken to be the empty string.  The VALUE can be any
      string, and the macro can be defined to take arguments, just as if
      it was defined from within the input.  This option may be given
      more than once; order with respect to file names is significant,
      and redefining the same NAME loses the previous value.
 
-'-I DIRECTORY'
-'--include=DIRECTORY'
-     Make 'm4' search DIRECTORY for included files that are not found in
+‘-I DIRECTORY’
+‘--include=DIRECTORY’
+     Make ‘m4’ search DIRECTORY for included files that are not found in
      the current working directory.  *Note Search Path::, for more
      details.  This option may be given more than once.
 
-'-s'
-'--synclines'
+‘-s’
+‘--synclines’
      Generate synchronization lines, for use by the C preprocessor or
      other similar tools.  Order is significant with respect to file
-     names.  This option is useful, for example, when 'm4' is used as a
+     names.  This option is useful, for example, when ‘m4’ is used as a
      front end to a compiler.  Source file name and line number
-     information is conveyed by directives of the form '#line LINENUM
-     "FILE"', which are inserted as needed into the middle of the
+     information is conveyed by directives of the form #line LINENUM
+     "FILE", which are inserted as needed into the middle of the
      output.  Such directives mean that the following line originated or
      was expanded from the contents of input file FILE at line LINENUM.
-     The '"FILE"' part is often omitted when the file name did not
+     The ‘"FILE"’ part is often omitted when the file name did not
      change from the previous directive.
 
      Synchronization directives are always given on complete lines by
@@ -631,37 +631,37 @@ from.  These features occur with the following options:
 
           define(`twoline', `1
           2')
-          =>#line 2 "stdin"
-          =>
+          #line 2 "stdin"
+          ⇒
           changecom(`/*', `*/')
-          =>
+          ⇒
           define(`comment', `/*1
           2*/')
-          =>#line 5
-          =>
+          #line 5
+          ⇒
           dnl no line
           hello
-          =>#line 7
-          =>hello
+          #line 7
+          hello
           twoline
-          =>1
-          =>#line 8
-          =>2
+          1
+          #line 8
+          2
           comment
-          =>/*1
-          =>2*/
+          /*1
+          2*/
           one comment `two
           three'
-          =>#line 10
-          =>one /*1
-          =>2*/ two
-          =>three
+          #line 10
+          one /*1
+          2*/ two
+          three
           goodbye
-          =>#line 12
-          =>goodbye
+          #line 12
+          goodbye
 
-'-U NAME'
-'--undefine=NAME'
+‘-U NAME’
+‘--undefine=NAME’
      This deletes any predefined meaning NAME might have.  Obviously,
      only predefined macros can be deleted in this way.  This option may
      be given more than once; undefining a NAME that does not have a
@@ -674,43 +674,43 @@ File: m4.info,  Node: Limits control,  Next: Frozen state,  Prev: Preprocessor f
 2.3 Command line options for limits control
 ===========================================
 
-There are some limits within 'm4' that can be tuned.  For compatibility,
-'m4' also accepts some options that control limits in other
+There are some limits within ‘m4’ that can be tuned.  For compatibility,
+‘m4’ also accepts some options that control limits in other
 implementations, but which are automatically unbounded (limited only by
-your hardware and operating system constraints) in GNU 'm4'.
+your hardware and operating system constraints) in GNU ‘m4’.
 
-'-g'
-'--gnu'
+‘-g’
+‘--gnu’
      Enable all the extensions in this implementation.  In this release
      of M4, this option is always on by default; it is currently only
-     useful when overriding a prior use of '--traditional'.  However,
+     useful when overriding a prior use of ‘--traditional’.  However,
      having GNU behavior as default makes it impossible to write a
      strictly POSIX-compliant client that avoids all incompatible GNU M4
      extensions, since such a client would have to use the non-POSIX
      command-line option to force full POSIX behavior.  Thus, a future
      version of M4 will be changed to implicitly use the option
-     '--traditional' if the environment variable 'POSIXLY_CORRECT' is
+     ‘--traditional’ if the environment variable ‘POSIXLY_CORRECT’ is
      set.  Projects that intentionally use GNU extensions should
-     consider using '--gnu' to state their intentions, so that the
+     consider using ‘--gnu’ to state their intentions, so that the
      project will not mysteriously break if the user upgrades to a newer
-     M4 and has 'POSIXLY_CORRECT' set in their environment.
+     M4 and has ‘POSIXLY_CORRECT’ set in their environment.
 
-'-G'
-'--traditional'
+‘-G’
+‘--traditional’
      Suppress all the extensions made in this implementation, compared
      to the System V version.  *Note Compatibility::, for a list of
      these.
 
-'-H NUM'
-'--hashsize=NUM'
+‘-H NUM’
+‘--hashsize=NUM’
      Make the internal hash table for symbol lookup be NUM entries big.
      For better performance, the number should be prime, but this is not
-     checked.  The default is 509 entries.  It should not be necessary
+     checked.  The default is 65537 entries.  It should not be necessary
      to increase this value, unless you define an excessive number of
      macros.
 
-'-L NUM'
-'--nesting-limit=NUM'
+‘-L NUM’
+‘--nesting-limit=NUM’
      Artificially limit the nesting of macro calls to NUM levels,
      stopping program execution if this limit is ever exceeded.  When
      not specified, nesting defaults to unlimited on platforms that can
@@ -720,32 +720,32 @@ your hardware and operating system constraints) in GNU 'm4'.
 
      The precise effect of this option is more correctly associated with
      textual nesting than dynamic recursion.  It has been useful when
-     some complex 'm4' input was generated by mechanical means, and also
+     some complex ‘m4’ input was generated by mechanical means, and also
      in diagnosing recursive algorithms that do not scale well.  Most
      users never need to change this option from its default.
 
      This option does _not_ have the ability to break endless rescanning
      loops, since these do not necessarily consume much memory or stack
      space.  Through clever usage of rescanning loops, one can request
-     complex, time-consuming computations from 'm4' with useful results.
-     Putting limitations in this area would break 'm4' power.  There are
-     many pathological cases: 'define(`a', `a')a' is only the simplest
-     example (but *note Compatibility::).  Expecting GNU 'm4' to detect
+     complex, time-consuming computations from ‘m4’ with useful results.
+     Putting limitations in this area would break ‘m4’ power.  There are
+     many pathological cases: ‘define(`a', `a')a’ is only the simplest
+     example (but *note Compatibility::).  Expecting GNU ‘m4’ to detect
      these would be a little like expecting a compiler system to detect
      and diagnose endless loops: it is a quite _hard_ problem in
      general, if not undecidable!
 
-'-B NUM'
-'-S NUM'
-'-T NUM'
-     These options are present for compatibility with System V 'm4', but
+‘-B NUM’
+‘-S NUM’
+‘-T NUM’
+     These options are present for compatibility with System V ‘m4’, but
      do nothing in this implementation.  They may disappear in future
      releases, and issue a warning to that effect.
 
-'-N NUM'
-'--diversions=NUM'
+‘-N NUM’
+‘--diversions=NUM’
      These options are present only for compatibility with previous
-     versions of GNU 'm4', and were controlling the number of possible
+     versions of GNU ‘m4’, and were controlling the number of possible
      diversions which could be used at the same time.  They do nothing,
      because there is no fixed limit anymore.  They may disappear in
      future releases, and issue a warning to that effect.
@@ -756,20 +756,20 @@ File: m4.info,  Node: Frozen state,  Next: Debugging options,  Prev: Limits cont
 2.4 Command line options for frozen state
 =========================================
 
-GNU 'm4' comes with a feature of freezing internal state (*note Frozen
-files::).  This can be used to speed up 'm4' execution when reusing a
+GNU ‘m4’ comes with a feature of freezing internal state (*note Frozen
+files::).  This can be used to speed up ‘m4’ execution when reusing a
 common initialization script.
 
-'-F FILE'
-'--freeze-state=FILE'
+‘-F FILE’
+‘--freeze-state=FILE’
      Once execution is finished, write out the frozen state on the
      specified FILE.  It is conventional, but not required, for FILE to
-     end in '.m4f'.
+     end in ‘.m4f’.
 
-'-R FILE'
-'--reload-state=FILE'
+‘-R FILE’
+‘--reload-state=FILE’
      Before execution starts, recover the internal state from the
-     specified frozen FILE.  The options '-D', '-U', and '-t' take
+     specified frozen FILE.  The options ‘-D’, ‘-U’, and ‘-t’ take
      effect after state is reloaded, but before the input files are
      read.
 
@@ -779,39 +779,39 @@ File: m4.info,  Node: Debugging options,  Next: Command line files,  Prev: Froze
 2.5 Command line options for debugging
 ======================================
 
-Finally, there are several options for aiding in debugging 'm4' scripts.
+Finally, there are several options for aiding in debugging ‘m4’ scripts.
 
-'-d[FLAGS]'
-'--debug[=FLAGS]'
+‘-d[FLAGS]’
+‘--debug[=FLAGS]’
      Set the debug-level according to the flags FLAGS.  The debug-level
      controls the format and amount of information presented by the
      debugging functions.  *Note Debug Levels::, for more details on the
-     format and meaning of FLAGS.  If omitted, FLAGS defaults to 'aeq'.
+     format and meaning of FLAGS.  If omitted, FLAGS defaults to ‘aeq’.
 
-'--debugfile[=FILE]'
-'-o FILE'
-'--error-output=FILE'
-     Redirect 'dumpdef' output, debug messages, and trace output to the
-     named FILE.  Warnings, error messages, and 'errprint' output are
+‘--debugfile[=FILE]’
+‘-o FILE’
+‘--error-output=FILE’
+     Redirect ‘dumpdef’ output, debug messages, and trace output to the
+     named FILE.  Warnings, error messages, and ‘errprint’ output are
      still printed to standard error.  If these options are not used, or
-     if FILE is unspecified (only possible for '--debugfile'), debug
+     if FILE is unspecified (only possible for ‘--debugfile’), debug
      output goes to standard error; if FILE is the empty string, debug
      output is discarded.  *Note Debug Output::, for more details.  The
-     option '--debugfile' may be given more than once, and order is
-     significant with respect to file names.  The spellings '-o' and
-     '--error-output' are misleading and inconsistent with other GNU
+     option ‘--debugfile’ may be given more than once, and order is
+     significant with respect to file names.  The spellings ‘-o’ and
+     ‘--error-output’ are misleading and inconsistent with other GNU
      tools; for now they are silently accepted as synonyms of
-     '--debugfile' and only recognized once, but in a future version of
+     ‘--debugfile’ and only recognized once, but in a future version of
      M4, using them will cause a warning to be issued.
 
-'-l NUM'
-'--arglength=NUM'
+‘-l NUM’
+‘--arglength=NUM’
      Restrict the size of the output generated by macro tracing to NUM
      characters per trace line.  If unspecified or zero, output is
      unlimited.  *Note Debug Levels::, for more details.
 
-'-t NAME'
-'--trace=NAME'
+‘-t NAME’
+‘--trace=NAME’
      This enables tracing for the macro NAME, at any point where it is
      defined.  NAME need not be defined when this option is given.  This
      option may be given more than once, and order is significant with
@@ -825,37 +825,37 @@ File: m4.info,  Node: Command line files,  Prev: Debugging options,  Up: Invokin
 
 The remaining arguments on the command line are taken to be input file
 names.  If no names are present, standard input is read.  A file name of
-'-' is taken to mean standard input.  It is conventional, but not
-required, for input files to end in '.m4'.
+‘-’ is taken to mean standard input.  It is conventional, but not
+required, for input files to end in ‘.m4’.
 
    The input files are read in the sequence given.  Standard input can
-be read more than once, so the file name '-' may appear multiple times
+be read more than once, so the file name ‘-’ may appear multiple times
 on the command line; this makes a difference when input is from a
 terminal or other special file type.  It is an error if an input file
 ends in the middle of argument collection, a comment, or a quoted
 string.
 
-   The options '--define' ('-D'), '--undefine' ('-U'), '--synclines'
-('-s'), and '--trace' ('-t') only take effect after processing input
+   The options ‘--define’ (‘-D’), ‘--undefine’ (‘-U’), ‘--synclines’
+(‘-s’), and ‘--trace’ (‘-t’) only take effect after processing input
 from any file names that occur earlier on the command line.  For
-example, assume the file 'foo' contains:
+example, assume the file ‘foo’ contains:
 
      $ cat foo
      bar
 
-   The text 'bar' can then be redefined over multiple uses of 'foo':
+   The text ‘bar’ can then be redefined over multiple uses of ‘foo’:
 
      $ m4 -Dbar=hello foo -Dbar=world foo
-     =>hello
-     =>world
+     hello
+     world
 
-   If none of the input files invoked 'm4exit' (*note M4exit::), the
-exit status of 'm4' will be 0 for success, 1 for general failure (such
+   If none of the input files invoked ‘m4exit’ (*note M4exit::), the
+exit status of ‘m4’ will be 0 for success, 1 for general failure (such
 as problems with reading an input file), and 63 for version mismatch
 (*note Using frozen files::).
 
-   If you need to read a file whose name starts with a '-', you can
-specify it as './-file', or use '--' to mark the end of options.
+   If you need to read a file whose name starts with a ‘-’, you can
+specify it as ‘./-file’, or use ‘--’ to mark the end of options.
 
 \1f
 File: m4.info,  Node: Syntax,  Next: Macros,  Prev: Invoking m4,  Up: Top
@@ -863,24 +863,24 @@ File: m4.info,  Node: Syntax,  Next: Macros,  Prev: Invoking m4,  Up: Top
 3 Lexical and syntactic conventions
 ***********************************
 
-As 'm4' reads its input, it separates it into "tokens".  A token is
+As ‘m4’ reads its input, it separates it into “tokens”.  A token is
 either a name, a quoted string, or any single character, that is not a
-part of either a name or a string.  Input to 'm4' can also contain
-comments.  GNU 'm4' does not yet understand multibyte locales; all
+part of either a name or a string.  Input to ‘m4’ can also contain
+comments.  GNU ‘m4’ does not yet understand multibyte locales; all
 operations are byte-oriented rather than character-oriented (although if
 your locale uses a single byte encoding, such as ISO-8859-1, you will
-not notice a difference).  However, 'm4' is eight-bit clean, so you can
+not notice a difference).  However, ‘m4’ is eight-bit clean, so you can
 use non-ASCII characters in quoted strings (*note Changequote::),
 comments (*note Changecom::), and macro names (*note Indir::), with the
-exception of the NUL character (the zero byte ''\0'').
+exception of the NUL character (the zero byte ‘'\0'’).
 
 * Menu:
 
 * Names::                       Macro names
-* Quoted strings::              Quoting input to 'm4'
-* Comments::                    Comments in 'm4' input
+* Quoted strings::              Quoting input to ‘m4’
+* Comments::                    Comments in ‘m4’ input
 * Other tokens::                Other kinds of input tokens
-* Input processing::            How 'm4' copies input to output
+* Input processing::            How ‘m4’ copies input to output
 
 \1f
 File: m4.info,  Node: Names,  Next: Quoted strings,  Up: Syntax
@@ -888,59 +888,59 @@ File: m4.info,  Node: Names,  Next: Quoted strings,  Up: Syntax
 3.1 Macro names
 ===============
 
-A name is any sequence of letters, digits, and the character '_'
-(underscore), where the first character is not a digit.  'm4' will use
+A name is any sequence of letters, digits, and the character ‘_’
+(underscore), where the first character is not a digit.  ‘m4’ will use
 the longest such sequence found in the input.  If a name has a macro
 definition, it will be subject to macro expansion (*note Macros::).
 Names are case-sensitive.
 
-   Examples of legal names are: 'foo', '_tmp', and 'name01'.
+   Examples of legal names are: ‘foo’, ‘_tmp’, and ‘name01’.
 
 \1f
 File: m4.info,  Node: Quoted strings,  Next: Comments,  Prev: Names,  Up: Syntax
 
-3.2 Quoting input to 'm4'
+3.2 Quoting input to ‘m4’
 =========================
 
 A quoted string is a sequence of characters surrounded by quote strings,
-defaulting to '`' and ''', where the nested begin and end quotes within
+defaulting to ‘`’ and ‘'’, where the nested begin and end quotes within
 the string are balanced.  The value of a string token is the text, with
 one level of quotes stripped off.  Thus
 
      `'
-     =>
+     ⇒
 
 is the empty string, and double-quoting turns into single-quoting.
 
      ``quoted''
-     =>`quoted'
+     `quoted'
 
    The quote characters can be changed at any time, using the builtin
-macro 'changequote'.  *Note Changequote::, for more information.
+macro ‘changequote’.  *Note Changequote::, for more information.
 
 \1f
 File: m4.info,  Node: Comments,  Next: Other tokens,  Prev: Quoted strings,  Up: Syntax
 
-3.3 Comments in 'm4' input
+3.3 Comments in ‘m4’ input
 ==========================
 
-Comments in 'm4' are normally delimited by the characters '#' and
+Comments in ‘m4’ are normally delimited by the characters ‘#’ and
 newline.  All characters between the comment delimiters are ignored, but
 the entire comment (including the delimiters) is passed through to the
-output--comments are _not_ discarded by 'm4'.
+output—comments are _not_ discarded by ‘m4’.
 
-   Comments cannot be nested, so the first newline after a '#' ends the
+   Comments cannot be nested, so the first newline after a ‘#’ ends the
 comment.  The commenting effect of the begin-comment string can be
 inhibited by quoting it.
 
      $ m4
      `quoted text' # `commented text'
-     =>quoted text # `commented text'
+     quoted text # `commented text'
      `quoting inhibits' `#' `comments'
-     =>quoting inhibits # comments
+     quoting inhibits # comments
 
    The comment delimiters can be changed to any string at any time,
-using the builtin macro 'changecom'.  *Note Changecom::, for more
+using the builtin macro ‘changecom’.  *Note Changecom::, for more
 information.
 
 \1f
@@ -953,49 +953,49 @@ Any character, that is neither a part of a name, nor of a quoted string,
 nor a comment, is a token by itself.  When not in the context of macro
 expansion, all of these tokens are just copied to output.  However,
 during macro expansion, whitespace characters (space, tab, newline,
-formfeed, carriage return, vertical tab), parentheses ('(' and ')'),
-comma (','), and dollar ('$') have additional roles, explained later.
+formfeed, carriage return, vertical tab), parentheses (‘(’ and ‘)’),
+comma (‘,’), and dollar (‘$’) have additional roles, explained later.
 
 \1f
 File: m4.info,  Node: Input processing,  Prev: Other tokens,  Up: Syntax
 
-3.5 How 'm4' copies input to output
+3.5 How ‘m4’ copies input to output
 ===================================
 
-As 'm4' reads the input token by token, it will copy each token directly
+As ‘m4’ reads the input token by token, it will copy each token directly
 to the output immediately.
 
    The exception is when it finds a word with a macro definition.  In
-that case 'm4' will calculate the macro's expansion, possibly reading
+that case ‘m4’ will calculate the macro’s expansion, possibly reading
 more input to get the arguments.  It then inserts the expansion in front
 of the remaining input.  In other words, the resulting text from a macro
 call will be read and parsed into tokens again.
 
-   'm4' expands a macro as soon as possible.  If it finds a macro call
+   ‘m4’ expands a macro as soon as possible.  If it finds a macro call
 when collecting the arguments to another, it will expand the second call
 first.  This process continues until there are no more macro calls to
 expand and all the input has been consumed.
 
-   For a running example, examine how 'm4' handles this input:
+   For a running example, examine how ‘m4’ handles this input:
 
      format(`Result is %d', eval(`2**15'))
 
-First, 'm4' sees that the token 'format' is a macro name, so it collects
-the tokens '(', '`Result is %d'', ',', and ' ', before encountering
-another potential macro.  Sure enough, 'eval' is a macro name, so the
-nested argument collection picks up '(', '`2**15'', and ')', invoking
-the eval macro with the lone argument of '2**15'.  The expansion of
-'eval(2**15)' is '32768', which is then rescanned as the five tokens
-'3', '2', '7', '6', and '8'; and combined with the next ')', the format
+First, ‘m4’ sees that the token ‘format’ is a macro name, so it collects
+the tokens ‘(’, ‘`Result is %d'’, ‘,’, and ‘ ’, before encountering
+another potential macro.  Sure enough, ‘eval’ is a macro name, so the
+nested argument collection picks up ‘(’, ‘`2**15'’, and ‘)’, invoking
+the eval macro with the lone argument of ‘2**15’.  The expansion of
+‘eval(2**15)’ is ‘32768’, which is then rescanned as the five tokens
+‘3’, ‘2’, ‘7’, ‘6’, and ‘8’; and combined with the next ‘)’, the format
 macro now has all its arguments, as if the user had typed:
 
      format(`Result is %d', 32768)
 
-The format macro expands to 'Result is 32768', and we have another round
-of scanning for the tokens 'Result', ' ', 'is', ' ', '3', '2', '7', '6',
-and '8'.  None of these are macros, so the final output is
+The format macro expands to ‘Result is 32768’, and we have another round
+of scanning for the tokens ‘Result’, ‘ ’, ‘is’, ‘ ’, ‘3’, ‘2’, ‘7’, ‘6’,
+and ‘8’.  None of these are macros, so the final output is
 
-     =>Result is 32768
+     Result is 32768
 
    As a more complicated example, we will contrast an actual code
 example from the Gnulib project(1), showing both a buggy approach and
@@ -1011,67 +1011,67 @@ attempt looks like this:
          GNULIB_]translit([$1],[a-z],[A-Z])[=1
        ])dnl
        gl_STRING_MODULE_INDICATOR([strcase])
-     =>  
-     =>        GNULIB_strcase=1
-     =>  
+     ⇒  
+             GNULIB_strcase=1
+     ⇒  
 
-   Oops - the argument did not get capitalized.  And although the manual
+   Oops  the argument did not get capitalized.  And although the manual
 is not able to easily show it, both lines that appear empty actually
 contain two trailing spaces.  By stepping through the parse, it is easy
-to see what happened.  First, 'm4' sees the token 'changequote', which
-it recognizes as a macro, followed by '(', '[', ',', ']', and ')' to
+to see what happened.  First, ‘m4’ sees the token ‘changequote’, which
+it recognizes as a macro, followed by ‘(’, ‘[’, ‘,’, ‘]’, and ‘)’ to
 form the argument list.  The macro expands to the empty string, but
 changes the quoting characters to something more useful for generating
-shell code (unbalanced '`' and ''' appear all the time in shell scripts,
-but unbalanced '[]' tend to be rare).  Also in the first line, 'm4' sees
-the token 'dnl', which it recognizes as a builtin macro that consumes
+shell code (unbalanced ‘`’ and ‘'’ appear all the time in shell scripts,
+but unbalanced ‘[]’ tend to be rare).  Also in the first line, ‘m4’ sees
+the token ‘dnl’, which it recognizes as a builtin macro that consumes
 the rest of the line, resulting in no output for that line.
 
-   The second line starts a macro definition.  'm4' sees the token
-'define', which it recognizes as a macro, followed by a '(',
-'[gl_STRING_MODULE_INDICATOR]', and ','.  Because an unquoted comma was
+   The second line starts a macro definition.  ‘m4’ sees the token
+‘define’, which it recognizes as a macro, followed by a ‘(’,
+‘[gl_STRING_MODULE_INDICATOR]’, and ‘,’.  Because an unquoted comma was
 encountered, the first argument is known to be the expansion of the
-single-quoted string token, or 'gl_STRING_MODULE_INDICATOR'.  Next, 'm4'
-sees '<NL>', ' ', and ' ', but this whitespace is discarded as part of
+single-quoted string token, or ‘gl_STRING_MODULE_INDICATOR’.  Next, ‘m4’
+sees ‘<NL>’, ‘ ’, and ‘ ’, but this whitespace is discarded as part of
 argument collection.  Then comes a rather lengthy single-quoted string
-token, '[<NL>    dnl comment<NL>    GNULIB_]'.  This is followed by the
-token 'translit', which 'm4' recognizes as a macro name, so a nested
+token, ‘[<NL>    dnl comment<NL>    GNULIB_]’.  This is followed by the
+token ‘translit’, which ‘m4’ recognizes as a macro name, so a nested
 macro expansion has started.
 
-   The arguments to the 'translit' are found by the tokens '(', '[$1]',
-',', '[a-z]', ',', '[A-Z]', and finally ')'.  All three string arguments
+   The arguments to the ‘translit’ are found by the tokens ‘(’, ‘[$1]’,
+‘,’, ‘[a-z]’, ‘,’, ‘[A-Z]’, and finally ‘)’.  All three string arguments
 are expanded (or in other words, the quotes are stripped), and since
-neither '$' nor '1' need capitalization, the result of the macro is
-'$1'.  This expansion is rescanned, resulting in the two literal
-characters '$' and '1'.
+neither ‘$’ nor ‘1’ need capitalization, the result of the macro is
+‘$1’.  This expansion is rescanned, resulting in the two literal
+characters ‘$’ and ‘1’.
 
-   Scanning of the outer macro resumes, and picks up with '[=1<NL>  ]',
-and finally ')'.  The collected pieces of expanded text are
+   Scanning of the outer macro resumes, and picks up with ‘[=1<NL>  ]’,
+and finally ‘)’.  The collected pieces of expanded text are
 concatenated, with the end result that the macro
-'gl_STRING_MODULE_INDICATOR' is now defined to be the sequence
-'<NL>    dnl comment<NL>    GNULIB_$1=1<NL>  '.  Once again, 'dnl' is
+‘gl_STRING_MODULE_INDICATOR’ is now defined to be the sequence
+‘<NL>    dnl comment<NL>    GNULIB_$1=1<NL>  ’.  Once again, ‘dnl’ is
 recognized and avoids a newline in the output.
 
-   The final line is then parsed, beginning with ' ' and ' ' that are
-output literally.  Then 'gl_STRING_MODULE_INDICATOR' is recognized as a
-macro name, with an argument list of '(', '[strcase]', and ')'.  Since
-the definition of the macro contains the sequence '$1', that sequence is
-replaced with the argument 'strcase' prior to starting the rescan.  The
-rescan sees '<NL>' and four spaces, which are output literally, then
-'dnl', which discards the text ' comment<NL>'.  Next comes four more
-spaces, also output literally, and the token 'GNULIB_strcase', which
+   The final line is then parsed, beginning with ‘ ’ and ‘ ’ that are
+output literally.  Then ‘gl_STRING_MODULE_INDICATOR’ is recognized as a
+macro name, with an argument list of ‘(’, ‘[strcase]’, and ‘)’.  Since
+the definition of the macro contains the sequence ‘$1’, that sequence is
+replaced with the argument ‘strcase’ prior to starting the rescan.  The
+rescan sees ‘<NL>’ and four spaces, which are output literally, then
+‘dnl’, which discards the text ‘ comment<NL>’.  Next comes four more
+spaces, also output literally, and the token ‘GNULIB_strcase’, which
 resulted from the earlier parameter substitution.  Since that is not a
-macro name, it is output literally, followed by the literal tokens '=',
-'1', '<NL>', and two more spaces.  Finally, the original '<NL>' seen
+macro name, it is output literally, followed by the literal tokens ‘=’,
+‘1’, ‘<NL>’, and two more spaces.  Finally, the original ‘<NL>’ seen
 after the macro invocation is scanned and output literally.
 
    Now for a corrected approach.  This rearranges the use of newlines
 and whitespace so that less whitespace is output (which, although
 harmless to shell scripts, can be visually unappealing), and fixes the
 quoting issues so that the capitalization occurs when the macro
-'gl_STRING_MODULE_INDICATOR' is invoked, rather then when it is defined.
+‘gl_STRING_MODULE_INDICATOR’ is invoked, rather then when it is defined.
 It also adds another layer of quoting to the first argument of
-'translit', to ensure that the output will be rescanned as a string
+‘translit’, to ensure that the output will be rescanned as a string
 rather than a potential uppercase macro name needing further expansion.
 
      changequote([,])dnl
@@ -1080,44 +1080,44 @@ rather than a potential uppercase macro name needing further expansion.
        GNULIB_[]translit([[$1]], [a-z], [A-Z])=1dnl
      ])dnl
        gl_STRING_MODULE_INDICATOR([strcase])
-     =>    GNULIB_STRCASE=1
+         GNULIB_STRCASE=1
 
    The parsing of the first line is unchanged.  The second line sees the
-name of the macro to define, then sees the discarded '<NL>' and two
-spaces, as before.  But this time, the next token is '[dnl
-comment<NL>  GNULIB_[]translit([[$1]], [a-z], [A-Z])=1dnl<NL>]', which
-includes nested quotes, followed by ')' to end the macro definition and
-'dnl' to skip the newline.  No early expansion of 'translit' occurs, so
+name of the macro to define, then sees the discarded ‘<NL>’ and two
+spaces, as before.  But this time, the next token is [dnl
+comment<NL>  GNULIB_[]translit([[$1]], [a-z], [A-Z])=1dnl<NL>], which
+includes nested quotes, followed by ‘)’ to end the macro definition and
+‘dnl’ to skip the newline.  No early expansion of ‘translit’ occurs, so
 the entire string becomes the definition of the macro.
 
    The final line is then parsed, beginning with two spaces that are
-output literally, and an invocation of 'gl_STRING_MODULE_INDICATOR' with
-the argument 'strcase'.  Again, the '$1' in the macro definition is
-substituted prior to rescanning.  Rescanning first encounters 'dnl', and
-discards ' comment<NL>'.  Then two spaces are output literally.  Next
-comes the token 'GNULIB_', but that is not a macro, so it is output
-literally.  The token '[]' is an empty string, so it does not affect
-output.  Then the token 'translit' is encountered.
-
-   This time, the arguments to 'translit' are parsed as '(',
-'[[strcase]]', ',', ' ', '[a-z]', ',', ' ', '[A-Z]', and ')'.  The two
+output literally, and an invocation of ‘gl_STRING_MODULE_INDICATOR’ with
+the argument ‘strcase’.  Again, the ‘$1’ in the macro definition is
+substituted prior to rescanning.  Rescanning first encounters ‘dnl’, and
+discards ‘ comment<NL>’.  Then two spaces are output literally.  Next
+comes the token ‘GNULIB_’, but that is not a macro, so it is output
+literally.  The token ‘[]’ is an empty string, so it does not affect
+output.  Then the token ‘translit’ is encountered.
+
+   This time, the arguments to ‘translit’ are parsed as ‘(’,
+‘[[strcase]]’, ‘,’, ‘ ’, ‘[a-z]’, ‘,’, ‘ ’, ‘[A-Z]’, and ‘)’.  The two
 spaces are discarded, and the translit results in the desired result
-'[STRCASE]'.  This is rescanned, but since it is a string, the quotes
-are stripped and the only output is a literal 'STRCASE'.  Then the
-scanner sees '=' and '1', which are output literally, followed by 'dnl'
+‘[STRCASE]’.  This is rescanned, but since it is a string, the quotes
+are stripped and the only output is a literal ‘STRCASE’.  Then the
+scanner sees ‘=’ and ‘1’, which are output literally, followed by ‘dnl’
 which discards the rest of the definition of
-'gl_STRING_MODULE_INDICATOR'.  The newline at the end of output is the
-literal '<NL>' that appeared after the invocation of the macro.
+‘gl_STRING_MODULE_INDICATOR’.  The newline at the end of output is the
+literal ‘<NL>’ that appeared after the invocation of the macro.
 
-   The order in which 'm4' expands the macros can be further explored
-using the trace facilities of GNU 'm4' (*note Trace::).
+   The order in which ‘m4’ expands the macros can be further explored
+using the trace facilities of GNU ‘m4’ (*note Trace::).
 
    ---------- Footnotes ----------
 
    (1) Derived from a patch in
-<http://lists.gnu.org/archive/html/bug-gnulib/2007-01/msg00389.html>,
+<https://lists.gnu.org/archive/html/bug-gnulib/2007-01/msg00389.html>,
 and a followup patch in
-<http://lists.gnu.org/archive/html/bug-gnulib/2007-02/msg00000.html>
+<https://lists.gnu.org/archive/html/bug-gnulib/2007-02/msg00000.html>
 
 \1f
 File: m4.info,  Node: Macros,  Next: Definitions,  Prev: Syntax,  Up: Top
@@ -1172,19 +1172,19 @@ File: m4.info,  Node: Inhibiting Invocation,  Next: Macro Arguments,  Prev: Invo
 4.2 Preventing macro invocation
 ===============================
 
-An innovation of the 'm4' language, compared to some of its predecessors
-(like Strachey's 'GPM', for example), is the ability to recognize macro
+An innovation of the ‘m4’ language, compared to some of its predecessors
+(like Strachey’s ‘GPM’, for example), is the ability to recognize macro
 calls without resorting to any special, prefixed invocation character.
 While generally useful, this feature might sometimes be the source of
-spurious, unwanted macro calls.  So, GNU 'm4' offers several mechanisms
+spurious, unwanted macro calls.  So, GNU ‘m4’ offers several mechanisms
 or techniques for inhibiting the recognition of names as macro calls.
 
    First of all, many builtin macros cannot meaningfully be called
 without arguments.  As a GNU extension, for any of these macros,
 whenever an opening parenthesis does not immediately follow their name,
 the builtin macro call is not triggered.  This solves the most usual
-cases, like for 'include' or 'eval'.  Later in this document, the
-sentence "This macro is recognized only with parameters" refers to this
+cases, like for ‘include’ or ‘eval’.  Later in this document, the
+sentence “This macro is recognized only with parameters” refers to this
 specific provision of GNU M4, also known as a blind builtin macro.  For
 the builtins defined by POSIX that bear this disclaimer, POSIX
 specifically states that invoking those builtins without arguments is
@@ -1193,31 +1193,31 @@ builtin as though it were given one empty argument instead.
 
      $ m4
      eval
-     =>eval
+     eval
      eval(`1')
-     =>1
+     1
 
-   There is also a command line option ('--prefix-builtins', or '-P',
+   There is also a command line option (‘--prefix-builtins’, or ‘-P’,
 *note Invoking m4: Operation modes.) that renames all builtin macros
-with a prefix of 'm4_' at startup.  The option has no effect whatsoever
+with a prefix of ‘m4_’ at startup.  The option has no effect whatsoever
 on user defined macros.  For example, with this option, one has to write
-'m4_dnl' and even 'm4_m4exit'.  It also has no effect on whether a macro
+‘m4_dnl’ and even ‘m4_m4exit’.  It also has no effect on whether a macro
 requires parameters.
 
      $ m4 -P
      eval
-     =>eval
+     eval
      eval(`1')
-     =>eval(1)
+     eval(1)
      m4_eval
-     =>m4_eval
+     m4_eval
      m4_eval(`1')
-     =>1
+     1
 
    Another alternative is to redefine problematic macros to a name less
 likely to cause conflicts, using *note Definitions::.
 
-   If your version of GNU 'm4' has the 'changeword' feature compiled in,
+   If your version of GNU ‘m4’ has the ‘changeword’ feature compiled in,
 it offers far more flexibility in specifying the syntax of macro names,
 both builtin or user-defined.  *Note Changeword::, for more information
 on this experimental feature.
@@ -1234,60 +1234,60 @@ possible to quote the empty string, but this works only _inside_ the
 name.  For example:
 
      `divert'
-     =>divert
+     divert
      `d'ivert
-     =>divert
+     divert
      di`ver't
-     =>divert
+     divert
      div`'ert
-     =>divert
+     divert
 
-all yield the string 'divert'.  While in both:
+all yield the string ‘divert’.  While in both:
 
      `'divert
-     =>
+     ⇒
      divert`'
-     =>
+     ⇒
 
-the 'divert' builtin macro will be called, which expands to the empty
+the ‘divert’ builtin macro will be called, which expands to the empty
 string.
 
    The output of macro evaluations is always rescanned.  In the
-following example, the input 'x`'y' yields the string 'bCD', exactly as
-if 'm4' has been given 'substr(ab`'cde, `1', `3')' as input:
+following example, the input ‘x`'y’ yields the string ‘bCD’, exactly as
+if ‘m4’ has been given ‘substr(ab`'cde, `1', `3')’ as input:
 
      define(`cde', `CDE')
-     =>
+     ⇒
      define(`x', `substr(ab')
-     =>
+     ⇒
      define(`y', `cde, `1', `3')')
-     =>
+     ⇒
      x`'y
-     =>bCD
+     bCD
 
    Unquoted strings on either side of a quoted string are subject to
 being recognized as macro names.  In the following example, quoting the
-empty string allows for the second 'macro' to be recognized as such:
+empty string allows for the second ‘macro’ to be recognized as such:
 
      define(`macro', `m')
-     =>
+     ⇒
      macro(`m')macro
-     =>mmacro
+     mmacro
      macro(`m')`'macro
-     =>mm
+     mm
 
    Quoting may prevent recognizing as a macro name the concatenation of
 a macro expansion with the surrounding characters.  In this example:
 
      define(`macro', `di$1')
-     =>
+     ⇒
      macro(`v')`ert'
-     =>divert
+     divert
      macro(`v')ert
-     =>
+     ⇒
 
-the input will produce the string 'divert'.  When the quotes were
-removed, the 'divert' builtin was called instead.
+the input will produce the string ‘divert’.  When the quotes were
+removed, the ‘divert’ builtin was called instead.
 
 \1f
 File: m4.info,  Node: Macro Arguments,  Next: Quoting Arguments,  Prev: Inhibiting Invocation,  Up: Macros
@@ -1310,77 +1310,77 @@ to an empty string remains intact.  Whitespace includes space, tab,
 newline, carriage return, vertical tab, and formfeed.
 
      define(`macro', `$1')
-     =>
+     ⇒
      macro( unquoted leading space lost)
-     =>unquoted leading space lost
+     unquoted leading space lost
      macro(` quoted leading space kept')
-     => quoted leading space kept
+      quoted leading space kept
      macro(
       divert `unquoted space kept after expansion')
-     => unquoted space kept after expansion
+      unquoted space kept after expansion
      macro(macro(`
      ')`whitespace from expansion kept')
-     =>
-     =>whitespace from expansion kept
+     ⇒
+     whitespace from expansion kept
      macro(`unquoted trailing whitespace kept'
      )
-     =>unquoted trailing whitespace kept
-     =>
+     unquoted trailing whitespace kept
+     ⇒
 
-   Normally 'm4' will issue warnings if a builtin macro is called with
+   Normally ‘m4’ will issue warnings if a builtin macro is called with
 an inappropriate number of arguments, but it can be suppressed with the
-'--quiet' command line option (or '--silent', or '-Q', *note Invoking
+‘--quiet’ command line option (or ‘--silent’, or ‘-Q’, *note Invoking
 m4: Operation modes.).  For user defined macros, there is no check of
 the number of arguments given.
 
      $ m4
      index(`abc')
-     error->m4:stdin:1: Warning: too few arguments to builtin `index'
-     =>0
+     errorm4:stdin:1: Warning: too few arguments to builtin `index'
+     0
      index(`abc',)
-     =>0
+     0
      index(`abc', `b', `ignored')
-     error->m4:stdin:3: Warning: excess arguments to builtin `index' ignored
-     =>1
+     errorm4:stdin:3: Warning: excess arguments to builtin `index' ignored
+     1
 
      $ m4 -Q
      index(`abc')
-     =>0
+     0
      index(`abc',)
-     =>0
+     0
      index(`abc', `b', `ignored')
-     =>1
+     1
 
    Macros are expanded normally during argument collection, and whatever
 commas, quotes and parentheses that might show up in the resulting
 expanded text will serve to define the arguments as well.  Thus, if FOO
-expands to ', b, c', the macro call
+expands to ‘, b, c’, the macro call
 
      bar(a foo, d)
 
-is a macro call with four arguments, which are 'a ', 'b', 'c' and 'd'.
+is a macro call with four arguments, which are ‘a ’, ‘b’, ‘c’ and ‘d’.
 To understand why the first argument contains whitespace, remember that
 unquoted leading whitespace is never part of an argument, but trailing
 whitespace always is.
 
-   It is possible for a macro's definition to change during argument
+   It is possible for a macros definition to change during argument
 collection, in which case the expansion uses the definition that was in
-effect at the time the opening '(' was seen.
+effect at the time the opening ‘(’ was seen.
 
      define(`f', `1')
-     =>
+     ⇒
      f(define(`f', `2'))
-     =>1
+     1
      f
-     =>2
+     2
 
    It is an error if the end of file occurs while collecting arguments.
 
      hello world
-     =>hello world
+     hello world
      define(
      ^D
-     error->m4:stdin:2: ERROR: end of file in argument list
+     errorm4:stdin:2: ERROR: end of file in argument list
 
 \1f
 File: m4.info,  Node: Quoting Arguments,  Next: Macro expansion,  Prev: Macro Arguments,  Up: Macros
@@ -1394,13 +1394,13 @@ macro,
 
      foo(() (`(') `(')
 
-is a macro call, with one argument, whose value is '() (() ('.  Commas
+is a macro call, with one argument, whose value is ‘() (() (’.  Commas
 separate arguments, except when they occur inside quotes, comments, or
 unquoted parentheses.  *Note Pseudo Arguments::, for examples.
 
    It is common practice to quote all arguments to macros, unless you
 are sure you want the arguments expanded.  Thus, in the above example
-with the parentheses, the 'right' way to do it is like this:
+with the parentheses, the ‘right’ way to do it is like this:
 
      foo(`() (() (')
 
@@ -1413,7 +1413,7 @@ For consistency, this manual follows the rule of thumb that each layer
 of parentheses introduces another layer of single quoting, except when
 showing the consequences of quoting rules.  This is done even when the
 quoted string cannot be a macro, such as with integers when you have not
-changed the syntax via 'changeword' (*note Changeword::).
+changed the syntax via ‘changeword’ (*note Changeword::).
 
    The quoting rule of thumb of one level of quoting per parentheses has
 a nice property: when a macro name appears inside parentheses, you can
@@ -1424,15 +1424,15 @@ macro.  And if it is double-quoted, it will be used as literal text
 instead of a macro name.
 
      define(`active', `ACT, IVE')
-     =>
+     ⇒
      define(`show', `$1 $1')
-     =>
+     ⇒
      show(active)
-     =>ACT ACT
+     ACT ACT
      show(`active')
-     =>ACT, IVE ACT, IVE
+     ACT, IVE ACT, IVE
      show(``active'')
-     =>active active
+     active active
 
 \1f
 File: m4.info,  Node: Macro expansion,  Prev: Quoting Arguments,  Up: Macros
@@ -1444,17 +1444,17 @@ When the arguments, if any, to a macro call have been collected, the
 macro is expanded, and the expansion text is pushed back onto the input
 (unquoted), and reread.  The expansion text from one macro call might
 therefore result in more macros being called, if the calls are included,
-completely or partially, in the first macro calls' expansion.
+completely or partially, in the first macro calls expansion.
 
-   Taking a very simple example, if FOO expands to 'bar', and BAR
-expands to 'Hello', the input
+   Taking a very simple example, if FOO expands to ‘bar’, and BAR
+expands to ‘Hello’, the input
 
      $ m4 -Dbar=Hello -Dfoo=bar
      foo
-     =>Hello
+     Hello
 
-will expand first to 'bar', and when this is reread and expanded, into
-'Hello'.
+will expand first to ‘bar’, and when this is reread and expanded, into
+‘Hello’.
 
 \1f
 File: m4.info,  Node: Definitions,  Next: Conditionals,  Prev: Macros,  Up: Top
@@ -1485,73 +1485,73 @@ File: m4.info,  Node: Define,  Next: Arguments,  Up: Definitions
 ====================
 
 The normal way to define or redefine macros is to use the builtin
-'define':
+‘define’:
 
  -- Builtin: define (NAME, [EXPANSION])
      Defines NAME to expand to EXPANSION.  If EXPANSION is not given, it
      is taken to be empty.
 
-     The expansion of 'define' is void.  The macro 'define' is
+     The expansion of ‘define’ is void.  The macro ‘define’ is
      recognized only with parameters.
 
    The following example defines the macro FOO to expand to the text
-'Hello World.'.
+‘Hello World.’.
 
      define(`foo', `Hello world.')
-     =>
+     ⇒
      foo
-     =>Hello world.
+     Hello world.
 
    The empty line in the output is there because the newline is not a
 part of the macro definition, and it is consequently copied to the
-output.  This can be avoided by use of the macro 'dnl'.  *Note Dnl::,
+output.  This can be avoided by use of the macro ‘dnl’.  *Note Dnl::,
 for details.
 
-   The first argument to 'define' should be quoted; otherwise, if the
+   The first argument to ‘define’ should be quoted; otherwise, if the
 macro is already defined, you will be defining a different macro.  This
 example shows the problems with underquoting, since we did not want to
-redefine 'one':
+redefine ‘one’:
 
      define(foo, one)
-     =>
+     ⇒
      define(foo, two)
-     =>
+     ⇒
      one
-     =>two
+     two
 
-   GNU 'm4' normally replaces only the _topmost_ definition of a macro
-if it has several definitions from 'pushdef' (*note Pushdef::).  Some
-other implementations of 'm4' replace all definitions of a macro with
-'define'.  *Note Incompatibilities::, for more details.
+   GNU ‘m4’ normally replaces only the _topmost_ definition of a macro
+if it has several definitions from ‘pushdef’ (*note Pushdef::).  Some
+other implementations of ‘m4’ replace all definitions of a macro with
+‘define’.  *Note Incompatibilities::, for more details.
 
-   As a GNU extension, the first argument to 'define' does not have to
+   As a GNU extension, the first argument to ‘define’ does not have to
 be a simple word.  It can be any text string, even the empty string.  A
 macro with a non-standard name cannot be invoked in the normal way, as
 the name is not recognized.  It can only be referenced by the builtins
-'indir' (*note Indir::) and 'defn' (*note Defn::).
+‘indir’ (*note Indir::) and ‘defn’ (*note Defn::).
 
    Arrays and associative arrays can be simulated by using non-standard
 macro names.
 
  -- Composite: array (INDEX)
  -- Composite: array_set (INDEX, [VALUE])
-     Provide access to entries within an array.  'array' reads the entry
-     at location INDEX, and 'array_set' assigns VALUE to location INDEX.
+     Provide access to entries within an array.  ‘array’ reads the entry
+     at location INDEX, and ‘array_set’ assigns VALUE to location INDEX.
 
      define(`array', `defn(format(``array[%d]'', `$1'))')
-     =>
+     ⇒
      define(`array_set', `define(format(``array[%d]'', `$1'), `$2')')
-     =>
+     ⇒
      array_set(`4', `array element no. 4')
-     =>
+     ⇒
      array_set(`17', `array element no. 17')
-     =>
+     ⇒
      array(`4')
-     =>array element no. 4
+     array element no. 4
      array(eval(`10 + 7'))
-     =>array element no. 17
+     array element no. 17
 
-   Change the '%d' to '%s' and it is an associative array.
+   Change the ‘%d’ to ‘%s’ and it is an associative array.
 
 \1f
 File: m4.info,  Node: Arguments,  Next: Pseudo Arguments,  Prev: Define,  Up: Definitions
@@ -1559,7 +1559,7 @@ File: m4.info,  Node: Arguments,  Next: Pseudo Arguments,  Prev: Define,  Up: De
 5.2 Arguments to macros
 =======================
 
-Macros can have arguments.  The Nth argument is denoted by '$n' in the
+Macros can have arguments.  The Nth argument is denoted by ‘$n’ in the
 expansion text, and is replaced by the Nth actual argument, when the
 macro is expanded.  Replacement of arguments happens before rescanning,
 regardless of how many nesting levels of quoting appear in the
@@ -1570,86 +1570,86 @@ expansion.  Here is an example of a macro with two arguments.
      order.
 
      define(`exch', `$2, $1')
-     =>
+     ⇒
      exch(`arg1', `arg2')
-     =>arg2, arg1
+     arg2, arg1
 
-   This can be used, for example, if you like the arguments to 'define'
+   This can be used, for example, if you like the arguments to ‘define’
 to be reversed.
 
      define(`exch', `$2, $1')
-     =>
+     ⇒
      define(exch(``expansion text'', ``macro''))
-     =>
+     ⇒
      macro
-     =>expansion text
+     expansion text
 
    *Note Quoting Arguments::, for an explanation of the double quotes.
-(You should try and improve this example so that clients of 'exch' do
+(You should try and improve this example so that clients of ‘exch’ do
 not have to double quote; or *note Answers: Improved exch.).
 
-   As a special case, the zeroth argument, '$0', is always the name of
+   As a special case, the zeroth argument, ‘$0’, is always the name of
 the macro being expanded.
 
      define(`test', ``Macro name: $0'')
-     =>
+     ⇒
      test
-     =>Macro name: test
+     Macro name: test
 
    If you want quoted text to appear as part of the expansion text,
 remember that quotes can be nested in quoted strings.  Thus, in
 
      define(`foo', `This is macro `foo'.')
-     =>
+     ⇒
      foo
-     =>This is macro foo.
+     This is macro foo.
 
-The 'foo' in the expansion text is _not_ expanded, since it is a quoted
+The ‘foo’ in the expansion text is _not_ expanded, since it is a quoted
 string, and not a name.
 
-   GNU 'm4' allows the number following the '$' to consist of one or
+   GNU ‘m4’ allows the number following the ‘$’ to consist of one or
 more digits, allowing macros to have any number of arguments.  The
 extension of accepting multiple digits is incompatible with POSIX, and
-is different than traditional implementations of 'm4', which only
+is different than traditional implementations of ‘m4’, which only
 recognize one digit.  Therefore, future versions of GNU M4 will phase
 out this feature.  To portably access beyond the ninth argument, you can
-use the 'argn' macro documented later (*note Shift::).
+use the ‘argn’ macro documented later (*note Shift::).
 
-   POSIX also states that '$' followed immediately by '{' in a macro
+   POSIX also states that ‘$’ followed immediately by ‘{’ in a macro
 definition is implementation-defined.  This version of M4 passes the
-literal characters '${' through unchanged, but M4 2.0 will implement an
-optional feature similar to 'sh', where '${11}' expands to the eleventh
-argument, to replace the current recognition of '$11'.  Meanwhile, if
-you want to guarantee that you will get a literal '${' in output when
+literal characters ‘${’ through unchanged, but M4 2.0 will implement an
+optional feature similar to ‘sh’, where ‘${11}’ expands to the eleventh
+argument, to replace the current recognition of ‘$11’.  Meanwhile, if
+you want to guarantee that you will get a literal ‘${’ in output when
 expanding a macro, even when you upgrade to M4 2.0, you can use nested
 quoting to your advantage:
 
      define(`foo', `single quoted $`'{1} output')
-     =>
+     ⇒
      define(`bar', ``double quoted $'`{2} output'')
-     =>
+     ⇒
      foo(`a', `b')
-     =>single quoted ${1} output
+     single quoted ${1} output
      bar(`a', `b')
-     =>double quoted ${2} output
+     double quoted ${2} output
 
    To help you detect places in your M4 input files that might change in
 behavior due to the changed behavior of M4 2.0, you can use the
-'--warn-macro-sequence' command-line option (*note Invoking m4:
+‘--warn-macro-sequence’ command-line option (*note Invoking m4:
 Operation modes.) with the default regular expression.  This will add a
-warning any time a macro definition includes '$' followed by multiple
-digits, or by '{'.  The warning is not enabled by default, because it
-triggers a number of warnings in Autoconf 2.61 (and Autoconf uses '-E'
+warning any time a macro definition includes ‘$’ followed by multiple
+digits, or by ‘{’.  The warning is not enabled by default, because it
+triggers a number of warnings in Autoconf 2.61 (and Autoconf uses ‘-E’
 to treat warnings as errors), and because it will still be possible to
 restore older behavior in M4 2.0.
 
      $ m4 --warn-macro-sequence
      define(`foo', `$001 ${1} $1')
-     error->m4:stdin:1: Warning: definition of `foo' contains sequence `$001'
-     error->m4:stdin:1: Warning: definition of `foo' contains sequence `${1}'
-     =>
+     errorm4:stdin:1: Warning: definition of `foo' contains sequence `$001'
+     errorm4:stdin:1: Warning: definition of `foo' contains sequence `${1}'
+     ⇒
      foo(`bar')
-     =>bar ${1} bar
+     bar ${1} bar
 
 \1f
 File: m4.info,  Node: Pseudo Arguments,  Next: Undefine,  Prev: Arguments,  Up: Definitions
@@ -1660,129 +1660,129 @@ File: m4.info,  Node: Pseudo Arguments,  Next: Undefine,  Prev: Arguments,  Up:
 There is a special notation for the number of actual arguments supplied,
 and for all the actual arguments.
 
-   The number of actual arguments in a macro call is denoted by '$#' in
+   The number of actual arguments in a macro call is denoted by ‘$#’ in
 the expansion text.
 
  -- Composite: nargs (...)
      Expands to a count of the number of arguments supplied.
 
      define(`nargs', `$#')
-     =>
+     ⇒
      nargs
-     =>0
+     0
      nargs()
-     =>1
+     1
      nargs(`arg1', `arg2', `arg3')
-     =>3
+     3
      nargs(`commas can be quoted, like this')
-     =>1
+     1
      nargs(arg1#inside comments, commas do not separate arguments
      still arg1)
-     =>1
+     1
      nargs((unquoted parentheses, like this, group arguments))
-     =>1
+     1
 
-   Remember that '#' defaults to the comment character; if you forget
+   Remember that ‘#’ defaults to the comment character; if you forget
 quotes to inhibit the comment behavior, your macro definition may not
 end where you expected.
 
      dnl Attempt to define a macro to just `$#'
      define(underquoted, $#)
      oops)
-     =>
+     ⇒
      underquoted
-     =>0)
-     =>oops
+     0)
+     oops
 
-   The notation '$*' can be used in the expansion text to denote all the
+   The notation ‘$*’ can be used in the expansion text to denote all the
 actual arguments, unquoted, with commas in between.  For example
 
      define(`echo', `$*')
-     =>
+     ⇒
      echo(arg1,    arg2, arg3 , arg4)
-     =>arg1,arg2,arg3 ,arg4
+     arg1,arg2,arg3 ,arg4
 
-   Often each argument should be quoted, and the notation '$@' handles
-that.  It is just like '$*', except that it quotes each argument.  A
+   Often each argument should be quoted, and the notation ‘$@’ handles
+that.  It is just like ‘$*’, except that it quotes each argument.  A
 simple example of that is:
 
      define(`echo', `$@')
-     =>
+     ⇒
      echo(arg1,    arg2, arg3 , arg4)
-     =>arg1,arg2,arg3 ,arg4
+     arg1,arg2,arg3 ,arg4
 
    Where did the quotes go?  Of course, they were eaten, when the
-expanded text were reread by 'm4'.  To show the difference, try
+expanded text were reread by ‘m4’.  To show the difference, try
 
      define(`echo1', `$*')
-     =>
+     ⇒
      define(`echo2', `$@')
-     =>
+     ⇒
      define(`foo', `This is macro `foo'.')
-     =>
+     ⇒
      echo1(foo)
-     =>This is macro This is macro foo..
+     This is macro This is macro foo..
      echo1(`foo')
-     =>This is macro foo.
+     This is macro foo.
      echo2(foo)
-     =>This is macro foo.
+     This is macro foo.
      echo2(`foo')
-     =>foo
+     foo
 
 *Note Trace::, if you do not understand this.  As another example of the
 difference, remember that comments encountered in arguments are passed
 untouched to the macro, and that quoting disables comments.
 
      define(`echo1', `$*')
-     =>
+     ⇒
      define(`echo2', `$@')
-     =>
+     ⇒
      define(`foo', `bar')
-     =>
+     ⇒
      echo1(#foo'foo
      foo)
-     =>#foo'foo
-     =>bar
+     #foo'foo
+     bar
      echo2(#foo'foo
      foo)
-     =>#foobar
-     =>bar'
+     #foobar
+     bar'
 
-   A '$' sign in the expansion text, that is not followed by anything
-'m4' understands, is simply copied to the macro expansion, as any other
+   A ‘$’ sign in the expansion text, that is not followed by anything
+‘m4’ understands, is simply copied to the macro expansion, as any other
 text is.
 
      define(`foo', `$$$ hello $$$')
-     =>
+     ⇒
      foo
-     =>$$$ hello $$$
+     $$$ hello $$$
 
-   If you want a macro to expand to something like '$12', the judicious
-use of nested quoting can put a safe character between the '$' and the
+   If you want a macro to expand to something like ‘$12’, the judicious
+use of nested quoting can put a safe character between the ‘$’ and the
 next character, relying on the rescanning to remove the nested quote.
-This will prevent 'm4' from interpreting the '$' sign as a reference to
+This will prevent ‘m4’ from interpreting the ‘$’ sign as a reference to
 an argument.
 
      define(`foo', `no nested quote: $1')
-     =>
+     ⇒
      foo(`arg')
-     =>no nested quote: arg
+     no nested quote: arg
      define(`foo', `nested quote around $: `$'1')
-     =>
+     ⇒
      foo(`arg')
-     =>nested quote around $: $1
+     nested quote around $: $1
      define(`foo', `nested empty quote after $: $`'1')
-     =>
+     ⇒
      foo(`arg')
-     =>nested empty quote after $: $1
+     nested empty quote after $: $1
      define(`foo', `nested quote around next character: $`1'')
-     =>
+     ⇒
      foo(`arg')
-     =>nested quote around next character: $1
+     nested quote around next character: $1
      define(`foo', `nested quote around both: `$1'')
-     =>
+     ⇒
      foo(`arg')
-     =>nested quote around both: arg
+     nested quote around both: arg
 
 \1f
 File: m4.info,  Node: Undefine,  Next: Defn,  Prev: Pseudo Arguments,  Up: Definitions
@@ -1790,42 +1790,42 @@ File: m4.info,  Node: Undefine,  Next: Defn,  Prev: Pseudo Arguments,  Up: Defin
 5.4 Deleting a macro
 ====================
 
-A macro definition can be removed with 'undefine':
+A macro definition can be removed with ‘undefine’:
 
  -- Builtin: undefine (NAME...)
      For each argument, remove the macro NAME.  The macro names must
      necessarily be quoted, since they will be expanded otherwise.
 
-     The expansion of 'undefine' is void.  The macro 'undefine' is
+     The expansion of ‘undefine’ is void.  The macro ‘undefine’ is
      recognized only with parameters.
 
      foo bar blah
-     =>foo bar blah
+     foo bar blah
      define(`foo', `some')define(`bar', `other')define(`blah', `text')
-     =>
+     ⇒
      foo bar blah
-     =>some other text
+     some other text
      undefine(`foo')
-     =>
+     ⇒
      foo bar blah
-     =>foo other text
+     foo other text
      undefine(`bar', `blah')
-     =>
+     ⇒
      foo bar blah
-     =>foo bar blah
+     foo bar blah
 
-   Undefining a macro inside that macro's expansion is safe; the macro
-still expands to the definition that was in effect at the '('.
+   Undefining a macro inside that macros expansion is safe; the macro
+still expands to the definition that was in effect at the ‘(’.
 
      define(`f', ``$0':$1')
-     =>
+     ⇒
      f(f(f(undefine(`f')`hello world')))
-     =>f:f:f:hello world
+     f:f:f:hello world
      f(`bye')
-     =>f(bye)
+     f(bye)
 
    It is not an error for NAME to have no macro definition.  In that
-case, 'undefine' does nothing.
+case, ‘undefine’ does nothing.
 
 \1f
 File: m4.info,  Node: Defn,  Next: Pushdef,  Prev: Undefine,  Up: Definitions
@@ -1834,7 +1834,7 @@ File: m4.info,  Node: Defn,  Next: Pushdef,  Prev: Undefine,  Up: Definitions
 ===================
 
 It is possible to rename an already defined macro.  To do this, you need
-the builtin 'defn':
+the builtin ‘defn’:
 
  -- Builtin: defn (NAME...)
      Expands to the _quoted definition_ of each NAME.  If an argument is
@@ -1843,127 +1843,127 @@ the builtin 'defn':
      If NAME is a user-defined macro, the quoted definition is simply
      the quoted expansion text.  If, instead, there is only one NAME and
      it is a builtin, the expansion is a special token, which points to
-     the builtin's internal definition.  This token is only meaningful
-     as the second argument to 'define' (and 'pushdef'), and is silently
+     the builtins internal definition.  This token is only meaningful
+     as the second argument to ‘define’ (and ‘pushdef’), and is silently
      converted to an empty string in most other contexts.  Combining a
      builtin with anything else is not supported; a warning is issued
      and the builtin is omitted from the final expansion.
 
-     The macro 'defn' is recognized only with parameters.
+     The macro ‘defn’ is recognized only with parameters.
 
    Its normal use is best understood through an example, which shows how
-to rename 'undefine' to 'zap':
+to rename ‘undefine’ to ‘zap’:
 
      define(`zap', defn(`undefine'))
-     =>
+     ⇒
      zap(`undefine')
-     =>
+     ⇒
      undefine(`zap')
-     =>undefine(zap)
+     undefine(zap)
 
-   In this way, 'defn' can be used to copy macro definitions, and also
+   In this way, ‘defn’ can be used to copy macro definitions, and also
 definitions of builtin macros.  Even if the original macro is removed,
 the other name can still be used to access the definition.
 
    The fact that macro definitions can be transferred also explains why
-you should use '$0', rather than retyping a macro's name in its
+you should use ‘$0’, rather than retyping a macro’s name in its
 definition:
 
      define(`foo', `This is `$0'')
-     =>
+     ⇒
      define(`bar', defn(`foo'))
-     =>
+     ⇒
      bar
-     =>This is bar
+     This is bar
 
-   Macros used as string variables should be referred through 'defn', to
+   Macros used as string variables should be referred through ‘defn’, to
 avoid unwanted expansion of the text:
 
      define(`string', `The macro dnl is very useful
      ')
-     =>
+     ⇒
      string
-     =>The macro 
+     The macro 
      defn(`string')
-     =>The macro dnl is very useful
-     =>
+     The macro dnl is very useful
+     ⇒
 
-   However, it is important to remember that 'm4' rescanning is purely
+   However, it is important to remember that ‘m4’ rescanning is purely
 textual.  If an unbalanced end-quote string occurs in a macro
 definition, the rescan will see that embedded quote as the termination
-of the quoted string, and the remainder of the macro's definition will
+of the quoted string, and the remainder of the macros definition will
 be rescanned unquoted.  Thus it is a good idea to avoid unbalanced
 end-quotes in macro definitions or arguments to macros.
 
      define(`foo', a'a)
-     =>
+     ⇒
      define(`a', `A')
-     =>
+     ⇒
      define(`echo', `$@')
-     =>
+     ⇒
      foo
-     =>A'A
+     A'A
      defn(`foo')
-     =>aA'
+     aA'
      echo(foo)
-     =>AA'
+     AA'
 
-   On the other hand, it is possible to exploit the fact that 'defn' can
+   On the other hand, it is possible to exploit the fact that ‘defn’ can
 concatenate multiple macros prior to the rescanning phase, in order to
 join the definitions of macros that, in isolation, have unbalanced
 quotes.  This is particularly useful when one has used several macros to
 accumulate text that M4 should rescan as a whole.  In the example below,
-note how the use of 'defn' on 'l' in isolation opens a string, which is
-not closed until the next line; but used on 'l' and 'r' together results
+note how the use of ‘defn’ on ‘l’ in isolation opens a string, which is
+not closed until the next line; but used on ‘l’ and ‘r’ together results
 in nested quoting.
 
      define(`l', `<[>')define(`r', `<]>')
-     =>
+     ⇒
      changequote(`[', `]')
-     =>
+     ⇒
      defn([l])defn([r])
      ])
-     =><[>]defn([r])
-     =>)
+     <[>]defn([r])
+     )
      defn([l], [r])
-     =><[>][<]>
+     <[>][<]>
 
-   Using 'defn' to generate special tokens for builtin macros outside of
+   Using ‘defn’ to generate special tokens for builtin macros outside of
 expected contexts can sometimes trigger warnings.  But most of the time,
 such tokens are silently converted to the empty string.
 
      $ m4 -d
      defn(`defn')
-     =>
+     ⇒
      define(defn(`divnum'), `cannot redefine a builtin token')
-     error->m4:stdin:2: Warning: define: invalid macro name ignored
-     =>
+     errorm4:stdin:2: Warning: define: invalid macro name ignored
+     ⇒
      divnum
-     =>0
+     0
      len(defn(`divnum'))
-     =>0
+     0
 
-   Also note that 'defn' with multiple arguments can only join text
+   Also note that ‘defn’ with multiple arguments can only join text
 macros, not builtins, although a future version of GNU M4 may lift this
 restriction.
 
      $ m4 -d
      define(`a', `A')define(`AA', `b')
-     =>
+     ⇒
      traceon(`defn', `define')
-     =>
+     ⇒
      defn(`a', `divnum', `a')
-     error->m4:stdin:3: Warning: cannot concatenate builtin `divnum'
-     error->m4trace: -1- defn(`a', `divnum', `a') -> ``A'`A''
-     =>AA
+     errorm4:stdin:3: Warning: cannot concatenate builtin `divnum'
+     errorm4trace: -1- defn(`a', `divnum', `a') -> ``A'`A''
+     AA
      define(`mydivnum', defn(`divnum', `divnum'))mydivnum
-     error->m4:stdin:4: Warning: cannot concatenate builtin `divnum'
-     error->m4:stdin:4: Warning: cannot concatenate builtin `divnum'
-     error->m4trace: -2- defn(`divnum', `divnum')
-     error->m4trace: -1- define(`mydivnum', `')
-     =>
+     errorm4:stdin:4: Warning: cannot concatenate builtin `divnum'
+     errorm4:stdin:4: Warning: cannot concatenate builtin `divnum'
+     errorm4trace: -2- defn(`divnum', `divnum')
+     errorm4trace: -1- define(`mydivnum', `')
+     ⇒
      traceoff(`defn', `define')
-     =>
+     ⇒
 
 \1f
 File: m4.info,  Node: Pushdef,  Next: Indir,  Prev: Defn,  Up: Definitions
@@ -1973,84 +1973,84 @@ File: m4.info,  Node: Pushdef,  Next: Indir,  Prev: Defn,  Up: Definitions
 
 It is possible to redefine a macro temporarily, reverting to the
 previous definition at a later time.  This is done with the builtins
-'pushdef' and 'popdef':
+‘pushdef’ and ‘popdef’:
 
  -- Builtin: pushdef (NAME, [EXPANSION])
  -- Builtin: popdef (NAME...)
-     Analogous to 'define' and 'undefine'.
+     Analogous to ‘define’ and ‘undefine’.
 
      These macros work in a stack-like fashion.  A macro is temporarily
-     redefined with 'pushdef', which replaces an existing definition of
+     redefined with ‘pushdef’, which replaces an existing definition of
      NAME, while saving the previous definition, before the new one is
-     installed.  If there is no previous definition, 'pushdef' behaves
-     exactly like 'define'.
+     installed.  If there is no previous definition, ‘pushdef’ behaves
+     exactly like ‘define’.
 
      If a macro has several definitions (of which only one is
-     accessible), the topmost definition can be removed with 'popdef'.
-     If there is no previous definition, 'popdef' behaves like
-     'undefine'.
+     accessible), the topmost definition can be removed with ‘popdef’.
+     If there is no previous definition, ‘popdef’ behaves like
+     ‘undefine’.
 
-     The expansion of both 'pushdef' and 'popdef' is void.  The macros
-     'pushdef' and 'popdef' are recognized only with parameters.
+     The expansion of both ‘pushdef’ and ‘popdef’ is void.  The macros
+     ‘pushdef’ and ‘popdef’ are recognized only with parameters.
 
      define(`foo', `Expansion one.')
-     =>
+     ⇒
      foo
-     =>Expansion one.
+     Expansion one.
      pushdef(`foo', `Expansion two.')
-     =>
+     ⇒
      foo
-     =>Expansion two.
+     Expansion two.
      pushdef(`foo', `Expansion three.')
-     =>
+     ⇒
      pushdef(`foo', `Expansion four.')
-     =>
+     ⇒
      popdef(`foo')
-     =>
+     ⇒
      foo
-     =>Expansion three.
+     Expansion three.
      popdef(`foo', `foo')
-     =>
+     ⇒
      foo
-     =>Expansion one.
+     Expansion one.
      popdef(`foo')
-     =>
+     ⇒
      foo
-     =>foo
+     foo
 
-   If a macro with several definitions is redefined with 'define', the
+   If a macro with several definitions is redefined with ‘define’, the
 topmost definition is _replaced_ with the new definition.  If it is
-removed with 'undefine', _all_ the definitions are removed, and not only
+removed with ‘undefine’, _all_ the definitions are removed, and not only
 the topmost one.  However, POSIX allows other implementations that treat
-'define' as replacing an entire stack of definitions with a single new
+‘define’ as replacing an entire stack of definitions with a single new
 definition, so to be portable to other implementations, it may be worth
-explicitly using 'popdef' and 'pushdef' rather than relying on the GNU
-behavior of 'define'.
+explicitly using ‘popdef’ and ‘pushdef’ rather than relying on the GNU
+behavior of ‘define’.
 
      define(`foo', `Expansion one.')
-     =>
+     ⇒
      foo
-     =>Expansion one.
+     Expansion one.
      pushdef(`foo', `Expansion two.')
-     =>
+     ⇒
      foo
-     =>Expansion two.
+     Expansion two.
      define(`foo', `Second expansion two.')
-     =>
+     ⇒
      foo
-     =>Second expansion two.
+     Second expansion two.
      undefine(`foo')
-     =>
+     ⇒
      foo
-     =>foo
+     foo
 
-   Local variables within macros are made with 'pushdef' and 'popdef'.
+   Local variables within macros are made with ‘pushdef’ and ‘popdef’.
 At the start of the macro a new definition is pushed, within the macro
 it is manipulated and at the end it is popped, revealing the former
 definition.
 
-   It is possible to temporarily redefine a builtin with 'pushdef' and
-'defn'.
+   It is possible to temporarily redefine a builtin with ‘pushdef’ and
+‘defn’.
 
 \1f
 File: m4.info,  Node: Indir,  Next: Builtin,  Prev: Pushdef,  Up: Definitions
@@ -2058,64 +2058,64 @@ File: m4.info,  Node: Indir,  Next: Builtin,  Prev: Pushdef,  Up: Definitions
 5.7 Indirect call of macros
 ===========================
 
-Any macro can be called indirectly with 'indir':
+Any macro can be called indirectly with ‘indir’:
 
  -- Builtin: indir (NAME, [ARGS...])
      Results in a call to the macro NAME, which is passed the rest of
      the arguments ARGS.  If NAME is not defined, an error message is
      printed, and the expansion is void.
 
-     The macro 'indir' is recognized only with parameters.
+     The macro ‘indir’ is recognized only with parameters.
 
-   This can be used to call macros with computed or "invalid" names
-('define' allows such names to be defined):
+   This can be used to call macros with computed or “invalid” names
+(‘define’ allows such names to be defined):
 
      define(`$$internal$macro', `Internal macro (name `$0')')
-     =>
+     ⇒
      $$internal$macro
-     =>$$internal$macro
+     $$internal$macro
      indir(`$$internal$macro')
-     =>Internal macro (name $$internal$macro)
+     Internal macro (name $$internal$macro)
 
    The point is, here, that larger macro packages can have private
 macros defined, that will not be called by accident.  They can _only_ be
-called through the builtin 'indir'.
+called through the builtin ‘indir’.
 
    One other point to observe is that argument collection occurs before
-'indir' invokes NAME, so if argument collection changes the value of
+‘indir’ invokes NAME, so if argument collection changes the value of
 NAME, that will be reflected in the final expansion.  This is different
 than the behavior when invoking macros directly, where the definition
 that was in effect before argument collection is used.
 
      $ m4 -d
      define(`f', `1')
-     =>
+     ⇒
      f(define(`f', `2'))
-     =>1
+     1
      indir(`f', define(`f', `3'))
-     =>3
+     3
      indir(`f', undefine(`f'))
-     error->m4:stdin:4: undefined macro `f'
-     =>
+     errorm4:stdin:4: undefined macro `f'
+     ⇒
 
-   When handed the result of 'defn' (*note Defn::) as one of its
-arguments, 'indir' defers to the invoked NAME for whether a token
+   When handed the result of ‘defn’ (*note Defn::) as one of its
+arguments, ‘indir’ defers to the invoked NAME for whether a token
 representing a builtin is recognized or flattened to the empty string.
 
      $ m4 -d
      indir(defn(`defn'), `divnum')
-     error->m4:stdin:1: Warning: indir: invalid macro name ignored
-     =>
+     errorm4:stdin:1: Warning: indir: invalid macro name ignored
+     ⇒
      indir(`define', defn(`defn'), `divnum')
-     error->m4:stdin:2: Warning: define: invalid macro name ignored
-     =>
+     errorm4:stdin:2: Warning: define: invalid macro name ignored
+     ⇒
      indir(`define', `foo', defn(`divnum'))
-     =>
+     ⇒
      foo
-     =>0
+     0
      indir(`divert', defn(`foo'))
-     error->m4:stdin:5: empty string treated as 0 in builtin `divert'
-     =>
+     errorm4:stdin:5: empty string treated as 0 in builtin `divert'
+     ⇒
 
 \1f
 File: m4.info,  Node: Builtin,  Prev: Indir,  Up: Definitions
@@ -2123,85 +2123,85 @@ File: m4.info,  Node: Builtin,  Prev: Indir,  Up: Definitions
 5.8 Indirect call of builtins
 =============================
 
-Builtin macros can be called indirectly with 'builtin':
+Builtin macros can be called indirectly with ‘builtin’:
 
  -- Builtin: builtin (NAME, [ARGS...])
      Results in a call to the builtin NAME, which is passed the rest of
      the arguments ARGS.  If NAME does not name a builtin, an error
      message is printed, and the expansion is void.
 
-     The macro 'builtin' is recognized only with parameters.
+     The macro ‘builtin’ is recognized only with parameters.
 
    This can be used even if NAME has been given another definition that
 has covered the original, or been undefined so that no macro maps to the
 builtin.
 
      pushdef(`define', `hidden')
-     =>
+     ⇒
      undefine(`undefine')
-     =>
+     ⇒
      define(`foo', `bar')
-     =>hidden
+     hidden
      foo
-     =>foo
+     foo
      builtin(`define', `foo', defn(`divnum'))
-     =>
+     ⇒
      foo
-     =>0
+     0
      builtin(`define', `foo', `BAR')
-     =>
+     ⇒
      foo
-     =>BAR
+     BAR
      undefine(`foo')
-     =>undefine(foo)
+     undefine(foo)
      foo
-     =>BAR
+     BAR
      builtin(`undefine', `foo')
-     =>
+     ⇒
      foo
-     =>foo
+     foo
 
    The NAME argument only matches the original name of the builtin, even
-when the '--prefix-builtins' option (or '-P', *note Invoking m4:
-Operation modes.) is in effect.  This is different from 'indir', which
+when the ‘--prefix-builtins’ option (or ‘-P’, *note Invoking m4:
+Operation modes.) is in effect.  This is different from ‘indir’, which
 only tracks current macro names.
 
      $ m4 -P
      m4_builtin(`divnum')
-     =>0
+     0
      m4_builtin(`m4_divnum')
-     error->m4:stdin:2: undefined builtin `m4_divnum'
-     =>
+     errorm4:stdin:2: undefined builtin `m4_divnum'
+     ⇒
      m4_indir(`divnum')
-     error->m4:stdin:3: undefined macro `divnum'
-     =>
+     errorm4:stdin:3: undefined macro `divnum'
+     ⇒
      m4_indir(`m4_divnum')
-     =>0
+     0
 
-   Note that 'indir' and 'builtin' can be used to invoke builtins
+   Note that ‘indir’ and ‘builtin’ can be used to invoke builtins
 without arguments, even when they normally require parameters to be
 recognized; but it will provoke a warning, and result in a void
 expansion.
 
      builtin
-     =>builtin
+     builtin
      builtin()
-     error->m4:stdin:2: undefined builtin `'
-     =>
+     errorm4:stdin:2: undefined builtin `'
+     ⇒
      builtin(`builtin')
-     error->m4:stdin:3: Warning: too few arguments to builtin `builtin'
-     =>
+     errorm4:stdin:3: Warning: too few arguments to builtin `builtin'
+     ⇒
      builtin(`builtin',)
-     error->m4:stdin:4: undefined builtin `'
-     =>
+     errorm4:stdin:4: undefined builtin `'
+     ⇒
      builtin(`builtin', ``'
      ')
-     error->m4:stdin:5: undefined builtin ``'
-     error->'
-     =>
+     errorm4:stdin:5: undefined builtin ``'
+     error'
+     ⇒
      indir(`index')
-     error->m4:stdin:7: Warning: too few arguments to builtin `index'
-     =>
+     errorm4:stdin:7: Warning: too few arguments to builtin `index'
+     ⇒
 
 \1f
 File: m4.info,  Node: Conditionals,  Next: Debugging,  Prev: Definitions,  Up: Top
@@ -2220,7 +2220,7 @@ true.
 
 * Ifdef::                       Testing if a macro is defined
 * Ifelse::                      If-else construct, or multibranch
-* Shift::                       Recursion in 'm4'
+* Shift::                       Recursion in ‘m4’
 * Forloop::                     Iteration by counting
 * Foreach::                     Iteration by list contents
 * Stacks::                      Working with definition stacks
@@ -2232,25 +2232,25 @@ File: m4.info,  Node: Ifdef,  Next: Ifelse,  Up: Conditionals
 6.1 Testing if a macro is defined
 =================================
 
-There are two different builtin conditionals in 'm4'.  The first is
-'ifdef':
+There are two different builtin conditionals in ‘m4’.  The first is
+‘ifdef’:
 
  -- Builtin: ifdef (NAME, STRING-1, [STRING-2])
-     If NAME is defined as a macro, 'ifdef' expands to STRING-1,
+     If NAME is defined as a macro, ‘ifdef’ expands to STRING-1,
      otherwise to STRING-2.  If STRING-2 is omitted, it is taken to be
      the empty string (according to the normal rules).
 
-     The macro 'ifdef' is recognized only with parameters.
+     The macro ‘ifdef’ is recognized only with parameters.
 
      ifdef(`foo', ``foo' is defined', ``foo' is not defined')
-     =>foo is not defined
+     foo is not defined
      define(`foo', `')
-     =>
+     ⇒
      ifdef(`foo', ``foo' is defined', ``foo' is not defined')
-     =>foo is defined
+     foo is defined
      ifdef(`no_such_macro', `yes', `no', `extra argument')
-     error->m4:stdin:4: Warning: excess arguments to builtin `ifdef' ignored
-     =>no
+     errorm4:stdin:4: Warning: excess arguments to builtin `ifdef' ignored
+     no
 
 \1f
 File: m4.info,  Node: Ifelse,  Next: Shift,  Prev: Ifdef,  Up: Conditionals
@@ -2258,7 +2258,7 @@ File: m4.info,  Node: Ifelse,  Next: Shift,  Prev: Ifdef,  Up: Conditionals
 6.2 If-else construct, or multibranch
 =====================================
 
-The other conditional, 'ifelse', is much more powerful.  It can be used
+The other conditional, ‘ifelse’, is much more powerful.  It can be used
 as a way to introduce a long comment, as an if-else construct, or as a
 multibranch, depending on the number of arguments supplied:
 
@@ -2266,43 +2266,43 @@ multibranch, depending on the number of arguments supplied:
  -- Builtin: ifelse (STRING-1, STRING-2, EQUAL, [NOT-EQUAL])
  -- Builtin: ifelse (STRING-1, STRING-2, EQUAL-1, STRING-3, STRING-4,
           EQUAL-2, ..., [NOT-EQUAL])
-     Used with only one argument, the 'ifelse' simply discards it and
+     Used with only one argument, the ‘ifelse’ simply discards it and
      produces no output.
 
-     If called with three or four arguments, 'ifelse' expands into
+     If called with three or four arguments, ‘ifelse’ expands into
      EQUAL, if STRING-1 and STRING-2 are equal (character for
      character), otherwise it expands to NOT-EQUAL.  A final fifth
      argument is ignored, after triggering a warning.
 
      If called with six or more arguments, and STRING-1 and STRING-2 are
-     equal, 'ifelse' expands into EQUAL-1, otherwise the first three
+     equal, ‘ifelse’ expands into EQUAL-1, otherwise the first three
      arguments are discarded and the processing starts again.
 
-     The macro 'ifelse' is recognized only with parameters.
+     The macro ‘ifelse’ is recognized only with parameters.
 
-   Using only one argument is a common 'm4' idiom for introducing a
-block comment, as an alternative to repeatedly using 'dnl'.  This
-special usage is recognized by GNU 'm4', so that in this case, the
+   Using only one argument is a common ‘m4’ idiom for introducing a
+block comment, as an alternative to repeatedly using ‘dnl’.  This
+special usage is recognized by GNU ‘m4’, so that in this case, the
 warning about missing arguments is never triggered.
 
      ifelse(`some comments')
-     =>
+     ⇒
      ifelse(`foo', `bar')
-     error->m4:stdin:2: Warning: too few arguments to builtin `ifelse'
-     =>
+     errorm4:stdin:2: Warning: too few arguments to builtin `ifelse'
+     ⇒
 
    Using three or four arguments provides decision points.
 
      ifelse(`foo', `bar', `true')
-     =>
+     ⇒
      ifelse(`foo', `foo', `true')
-     =>true
+     true
      define(`foo', `bar')
-     =>
+     ⇒
      ifelse(foo, `bar', `true', `false')
-     =>true
+     true
      ifelse(foo, `foo', `true', `false')
-     =>false
+     false
 
    Notice how the first argument was used unquoted; it is common to
 compare the expansion of a macro with a string.  With this macro, you
@@ -2310,69 +2310,69 @@ can now reproduce the behavior of blind builtins, where the macro is
 recognized only with arguments.
 
      define(`foo', `ifelse(`$#', `0', ``$0'', `arguments:$#')')
-     =>
+     ⇒
      foo
-     =>foo
+     foo
      foo()
-     =>arguments:1
+     arguments:1
      foo(`a', `b', `c')
-     =>arguments:3
+     arguments:3
 
    For an example of a way to make defining blind macros easier, see
 *note Composition::.
 
-   The macro 'ifelse' can take more than four arguments.  If given more
-than four arguments, 'ifelse' works like a 'case' or 'switch' statement
+   The macro ‘ifelse’ can take more than four arguments.  If given more
+than four arguments, ‘ifelse’ works like a ‘case’ or ‘switch’ statement
 in traditional programming languages.  If STRING-1 and STRING-2 are
-equal, 'ifelse' expands into EQUAL-1, otherwise the procedure is
+equal, ‘ifelse’ expands into EQUAL-1, otherwise the procedure is
 repeated with the first three arguments discarded.  This calls for an
 example:
 
      ifelse(`foo', `bar', `third', `gnu', `gnats')
-     error->m4:stdin:1: Warning: excess arguments to builtin `ifelse' ignored
-     =>gnu
+     errorm4:stdin:1: Warning: excess arguments to builtin `ifelse' ignored
+     gnu
      ifelse(`foo', `bar', `third', `gnu', `gnats', `sixth')
-     =>
+     ⇒
      ifelse(`foo', `bar', `third', `gnu', `gnats', `sixth', `seventh')
-     =>seventh
+     seventh
      ifelse(`foo', `bar', `3', `gnu', `gnats', `6', `7', `8')
-     error->m4:stdin:4: Warning: excess arguments to builtin `ifelse' ignored
-     =>7
+     errorm4:stdin:4: Warning: excess arguments to builtin `ifelse' ignored
+     7
 
    Naturally, the normal case will be slightly more advanced than these
-examples.  A common use of 'ifelse' is in macros implementing loops of
+examples.  A common use of ‘ifelse’ is in macros implementing loops of
 various kinds.
 
 \1f
 File: m4.info,  Node: Shift,  Next: Forloop,  Prev: Ifelse,  Up: Conditionals
 
-6.3 Recursion in 'm4'
+6.3 Recursion in ‘m4’
 =====================
 
-There is no direct support for loops in 'm4', but macros can be
+There is no direct support for loops in ‘m4’, but macros can be
 recursive.  There is no limit on the number of recursion levels, other
 than those enforced by your hardware and operating system.
 
    Loops can be programmed using recursion and the conditionals
 described previously.
 
-   There is a builtin macro, 'shift', which can, among other things, be
+   There is a builtin macro, ‘shift’, which can, among other things, be
 used for iterating through the actual arguments to a macro:
 
  -- Builtin: shift (ARG1, ...)
      Takes any number of arguments, and expands to all its arguments
      except ARG1, separated by commas, with each argument quoted.
 
-     The macro 'shift' is recognized only with parameters.
+     The macro ‘shift’ is recognized only with parameters.
 
      shift
-     =>shift
+     shift
      shift(`bar')
-     =>
+     ⇒
      shift(`foo', `bar', `baz')
-     =>bar,baz
+     bar,baz
 
-   An example of the use of 'shift' is this macro:
+   An example of the use of ‘shift’ is this macro:
 
  -- Composite: reverse (...)
      Takes any number of arguments, and reverses their order.
@@ -2381,32 +2381,32 @@ used for iterating through the actual arguments to a macro:
 
      define(`reverse', `ifelse(`$#', `0', , `$#', `1', ``$1'',
                                `reverse(shift($@)), `$1'')')
-     =>
+     ⇒
      reverse
-     =>
+     ⇒
      reverse(`foo')
-     =>foo
+     foo
      reverse(`foo', `bar', `gnats', `and gnus')
-     =>and gnus, gnats, bar, foo
+     and gnus, gnats, bar, foo
 
    While not a very interesting macro, it does show how simple loops can
-be made with 'shift', 'ifelse' and recursion.  It also shows that
-'shift' is usually used with '$@'.  Another example of this is an
+be made with ‘shift’, ‘ifelse’ and recursion.  It also shows that
+‘shift’ is usually used with ‘$@’.  Another example of this is an
 implementation of a short-circuiting conditional operator.
 
  -- Composite: cond (TEST-1, STRING-1, EQUAL-1, [TEST-2], [STRING-2],
           [EQUAL-2], ..., [NOT-EQUAL])
-     Similar to 'ifelse', where an equal comparison between the first
+     Similar to ‘ifelse’, where an equal comparison between the first
      two strings results in the third, otherwise the first three
      arguments are discarded and the process repeats.  The difference is
      that each TEST-<N> is expanded only when it is encountered.  This
-     means that every third argument to 'cond' is normally given one
-     more level of quoting than the corresponding argument to 'ifelse'.
+     means that every third argument to ‘cond’ is normally given one
+     more level of quoting than the corresponding argument to ‘ifelse’.
 
-   Here is the implementation of 'cond', along with a demonstration of
-how it can short-circuit the side effects in 'side'.  Notice how all the
+   Here is the implementation of ‘cond’, along with a demonstration of
+how it can short-circuit the side effects in ‘side’.  Notice how all the
 unquoted side effects happen regardless of how many comparisons are made
-with 'ifelse', compared with only the relevant effects with 'cond'.
+with ‘ifelse’, compared with only the relevant effects with ‘cond’.
 
      define(`cond',
      `ifelse(`$#', `1', `$1',
@@ -2426,21 +2426,21 @@ with 'ifelse', compared with only the relevant effects with 'cond'.
           `side(`$1')', `maybe', `three comparisons: ',
           `side(`default answer: ')')counter')dnl
      example1(`yes')
-     =>one comparison: 3
+     one comparison: 3
      example1(`no')
-     =>two comparisons: 3
+     two comparisons: 3
      example1(`maybe')
-     =>three comparisons: 3
+     three comparisons: 3
      example1(`feeling rather indecisive today')
-     =>default answer: 4
+     default answer: 4
      example2(`yes')
-     =>one comparison: 1
+     one comparison: 1
      example2(`no')
-     =>two comparisons: 2
+     two comparisons: 2
      example2(`maybe')
-     =>three comparisons: 3
+     three comparisons: 3
      example2(`feeling rather indecisive today')
-     =>default answer: 4
+     default answer: 4
 
    Another common task that requires iteration is joining a list of
 arguments into a single string.
@@ -2448,89 +2448,89 @@ arguments into a single string.
  -- Composite: join ([SEPARATOR], [ARGS...])
  -- Composite: joinall ([SEPARATOR], [ARGS...])
      Generate a single-quoted string, consisting of each ARG separated
-     by SEPARATOR.  While 'joinall' always outputs a SEPARATOR between
-     arguments, 'join' avoids the SEPARATOR for an empty ARG.
+     by SEPARATOR.  While ‘joinall’ always outputs a SEPARATOR between
+     arguments, ‘join’ avoids the SEPARATOR for an empty ARG.
 
    Here are some examples of its usage, based on the implementation
-'m4-1.4.18/examples/join.m4' distributed in this package:
+‘m4-1.4.19/examples/join.m4’ distributed in this package:
 
      $ m4 -I examples
      include(`join.m4')
-     =>
+     ⇒
      join,join(`-'),join(`-', `'),join(`-', `', `')
-     =>,,,
+     ,,,
      joinall,joinall(`-'),joinall(`-', `'),joinall(`-', `', `')
-     =>,,,-
+     ,,,-
      join(`-', `1')
-     =>1
+     1
      join(`-', `1', `2', `3')
-     =>1-2-3
+     1-2-3
      join(`', `1', `2', `3')
-     =>123
+     123
      join(`-', `', `1', `', `', `2', `')
-     =>1-2
+     1-2
      joinall(`-', `', `1', `', `', `2', `')
-     =>-1---2-
+     -1---2-
      join(`,', `1', `2', `3')
-     =>1,2,3
+     1,2,3
      define(`nargs', `$#')dnl
      nargs(join(`,', `1', `2', `3'))
-     =>1
+     1
 
    Examining the implementation shows some interesting points about
 several m4 programming idioms.
 
      $ m4 -I examples
      undivert(`join.m4')dnl
-     =>divert(`-1')
-     =># join(sep, args) - join each non-empty ARG into a single
-     =># string, with each element separated by SEP
-     =>define(`join',
-     =>`ifelse(`$#', `2', ``$2'',
-     =>  `ifelse(`$2', `', `', ``$2'_')$0(`$1', shift(shift($@)))')')
-     =>define(`_join',
-     =>`ifelse(`$#$2', `2', `',
-     =>  `ifelse(`$2', `', `', ``$1$2'')$0(`$1', shift(shift($@)))')')
-     =># joinall(sep, args) - join each ARG, including empty ones,
-     =># into a single string, with each element separated by SEP
-     =>define(`joinall', ``$2'_$0(`$1', shift($@))')
-     =>define(`_joinall',
-     =>`ifelse(`$#', `2', `', ``$1$3'$0(`$1', shift(shift($@)))')')
-     =>divert`'dnl
-
-   First, notice that this implementation creates helper macros '_join'
-and '_joinall'.  This division of labor makes it easier to output the
-correct number of SEPARATOR instances: 'join' and 'joinall' are
-responsible for the first argument, without a separator, while '_join'
-and '_joinall' are responsible for all remaining arguments, always
+     divert(`-1')
+     # join(sep, args) - join each non-empty ARG into a single
+     # string, with each element separated by SEP
+     define(`join',
+     `ifelse(`$#', `2', ``$2'',
+       `ifelse(`$2', `', `', ``$2'_')$0(`$1', shift(shift($@)))')')
+     define(`_join',
+     `ifelse(`$#$2', `2', `',
+       `ifelse(`$2', `', `', ``$1$2'')$0(`$1', shift(shift($@)))')')
+     # joinall(sep, args) - join each ARG, including empty ones,
+     # into a single string, with each element separated by SEP
+     define(`joinall', ``$2'_$0(`$1', shift($@))')
+     define(`_joinall',
+     `ifelse(`$#', `2', `', ``$1$3'$0(`$1', shift(shift($@)))')')
+     divert`'dnl
+
+   First, notice that this implementation creates helper macros ‘_join’
+and ‘_joinall’.  This division of labor makes it easier to output the
+correct number of SEPARATOR instances: ‘join’ and ‘joinall’ are
+responsible for the first argument, without a separator, while ‘_join’
+and ‘_joinall’ are responsible for all remaining arguments, always
 outputting a separator when outputting an argument.
 
-   Next, observe how 'join' decides to iterate to itself, because the
-first ARG was empty, or to output the argument and swap over to '_join'.
-If the argument is non-empty, then the nested 'ifelse' results in an
-unquoted '_', which is concatenated with the '$0' to form the next macro
-name to invoke.  The 'joinall' implementation is simpler since it does
+   Next, observe how ‘join’ decides to iterate to itself, because the
+first ARG was empty, or to output the argument and swap over to ‘_join’.
+If the argument is non-empty, then the nested ‘ifelse’ results in an
+unquoted ‘_’, which is concatenated with the ‘$0’ to form the next macro
+name to invoke.  The ‘joinall’ implementation is simpler since it does
 not have to suppress empty ARG; it always executes once then defers to
-'_joinall'.
+‘_joinall’.
 
    Another important idiom is the idea that SEPARATOR is reused for each
 iteration.  Each iteration has one less argument, but rather than
-discarding '$1' by iterating with '$0(shift($@))', the macro discards
-'$2' by using '$0(`$1', shift(shift($@)))'.
+discarding ‘$1’ by iterating with ‘$0(shift($@))’, the macro discards
+‘$2’ by using ‘$0(`$1', shift(shift($@)))’.
 
    Next, notice that it is possible to compare more than one condition
-in a single 'ifelse' test.  The test of '$#$2' against '2' allows
-'_join' to iterate for two separate reasons--either there are still more
+in a single ‘ifelse’ test.  The test of ‘$#$2’ against ‘2’ allows
+‘_join’ to iterate for two separate reasons—either there are still more
 than two arguments, or there are exactly two arguments but the last
 argument is not empty.
 
    Finally, notice that these macros require exactly two arguments to
 terminate recursion, but that they still correctly result in empty
 output when given no ARGS (i.e., zero or one macro argument).  On the
-first pass when there are too few arguments, the 'shift' results in no
+first pass when there are too few arguments, the ‘shift’ results in no
 output, but leaves an empty string to serve as the required second
-argument for the second pass.  Put another way, '`$1', shift($@)' is not
-the same as '$@', since only the former guarantees at least two
+argument for the second pass.  Put another way, ‘`$1', shift($@)’ is not
+the same as ‘$@’, since only the former guarantees at least two
 arguments.
 
    Sometimes, a recursive algorithm requires adding quotes to each
@@ -2539,81 +2539,81 @@ element, or treating multiple arguments as a single element:
  -- Composite: quote (...)
  -- Composite: dquote (...)
  -- Composite: dquote_elt (...)
-     Takes any number of arguments, and adds quoting.  With 'quote',
+     Takes any number of arguments, and adds quoting.  With ‘quote’,
      only one level of quoting is added, effectively removing whitespace
      after commas and turning multiple arguments into a single string.
-     With 'dquote', two levels of quoting are added, one around each
-     element, and one around the list.  And with 'dquote_elt', two
+     With ‘dquote’, two levels of quoting are added, one around each
+     element, and one around the list.  And with ‘dquote_elt’, two
      levels of quoting are added around each element.
 
    An actual implementation of these three macros is distributed as
-'m4-1.4.18/examples/quote.m4' in this package.  First, let's examine
+‘m4-1.4.19/examples/quote.m4’ in this package.  First, let’s examine
 their usage:
 
      $ m4 -I examples
      include(`quote.m4')
-     =>
+     ⇒
      -quote-dquote-dquote_elt-
-     =>----
+     ----
      -quote()-dquote()-dquote_elt()-
-     =>--`'-`'-
+     --`'-`'-
      -quote(`1')-dquote(`1')-dquote_elt(`1')-
-     =>-1-`1'-`1'-
+     -1-`1'-`1'-
      -quote(`1', `2')-dquote(`1', `2')-dquote_elt(`1', `2')-
-     =>-1,2-`1',`2'-`1',`2'-
+     -1,2-`1',`2'-`1',`2'-
      define(`n', `$#')dnl
      -n(quote(`1', `2'))-n(dquote(`1', `2'))-n(dquote_elt(`1', `2'))-
-     =>-1-1-2-
+     -1-1-2-
      dquote(dquote_elt(`1', `2'))
-     =>``1'',``2''
+     ``1'',``2''
      dquote_elt(dquote(`1', `2'))
-     =>``1',`2''
+     ``1',`2''
 
-   The last two lines show that when given two arguments, 'dquote'
-results in one string, while 'dquote_elt' results in two.  Now, examine
-the implementation.  Note that 'quote' and 'dquote_elt' make decisions
+   The last two lines show that when given two arguments, ‘dquote’
+results in one string, while ‘dquote_elt’ results in two.  Now, examine
+the implementation.  Note that ‘quote’ and ‘dquote_elt’ make decisions
 based on their number of arguments, so that when called without
 arguments, they result in nothing instead of a quoted empty string; this
 is so that it is possible to distinguish between no arguments and an
-empty first argument.  'dquote', on the other hand, results in a string
+empty first argument.  ‘dquote’, on the other hand, results in a string
 no matter what, since it is still possible to tell whether it was
 invoked without arguments based on the resulting string.
 
      $ m4 -I examples
      undivert(`quote.m4')dnl
-     =>divert(`-1')
-     =># quote(args) - convert args to single-quoted string
-     =>define(`quote', `ifelse(`$#', `0', `', ``$*'')')
-     =># dquote(args) - convert args to quoted list of quoted strings
-     =>define(`dquote', ``$@'')
-     =># dquote_elt(args) - convert args to list of double-quoted strings
-     =>define(`dquote_elt', `ifelse(`$#', `0', `', `$#', `1', ```$1''',
-     =>                             ```$1'',$0(shift($@))')')
-     =>divert`'dnl
-
-   It is worth pointing out that 'quote(ARGS)' is more efficient than
-'joinall(`,', ARGS)' for producing the same output.
-
-   One more useful macro based on 'shift' allows portably selecting an
+     divert(`-1')
+     # quote(args) - convert args to single-quoted string
+     define(`quote', `ifelse(`$#', `0', `', ``$*'')')
+     # dquote(args) - convert args to quoted list of quoted strings
+     define(`dquote', ``$@'')
+     # dquote_elt(args) - convert args to list of double-quoted strings
+     define(`dquote_elt', `ifelse(`$#', `0', `', `$#', `1', ```$1''',
+                                  ```$1'',$0(shift($@))')')
+     divert`'dnl
+
+   It is worth pointing out that ‘quote(ARGS)’ is more efficient than
+‘joinall(`,', ARGS)’ for producing the same output.
+
+   One more useful macro based on ‘shift’ allows portably selecting an
 arbitrary argument (usually greater than the ninth argument), without
 relying on the GNU extension of multi-digit arguments (*note
 Arguments::).
 
  -- Composite: argn (N, ...)
      Expands to argument N out of the remaining arguments.  N must be a
-     positive number.  Usually invoked as 'argn(`N',$@)'.
+     positive number.  Usually invoked as ‘argn(`N',$@)’.
 
    It is implemented as:
 
      define(`argn', `ifelse(`$1', 1, ``$2'',
        `argn(decr(`$1'), shift(shift($@)))')')
-     =>
+     ⇒
      argn(`1', `a')
-     =>a
+     a
      define(`foo', `argn(`11', $@)')
-     =>
+     ⇒
      foo(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k', `l')
-     =>k
+     k
 
 \1f
 File: m4.info,  Node: Forloop,  Next: Foreach,  Prev: Shift,  Up: Conditionals
@@ -2627,51 +2627,51 @@ Here is an example of a loop macro that implements a simple for loop.
      Takes the name in ITERATOR, which must be a valid macro name, and
      successively assign it each integer value from START to END,
      inclusive.  For each assignment to ITERATOR, append TEXT to the
-     expansion of the 'forloop'.  TEXT may refer to ITERATOR.  Any
+     expansion of the ‘forloop’.  TEXT may refer to ITERATOR.  Any
      definition of ITERATOR prior to this invocation is restored.
 
    It can, for example, be used for simple counting:
 
      $ m4 -I examples
      include(`forloop.m4')
-     =>
+     ⇒
      forloop(`i', `1', `8', `i ')
-     =>1 2 3 4 5 6 7 8 
+     1 2 3 4 5 6 7 8 
 
    For-loops can be nested, like:
 
      $ m4 -I examples
      include(`forloop.m4')
-     =>
+     ⇒
      forloop(`i', `1', `4', `forloop(`j', `1', `8', ` (i, j)')
      ')
-     => (1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6) (1, 7) (1, 8)
-     => (2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6) (2, 7) (2, 8)
-     => (3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6) (3, 7) (3, 8)
-     => (4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6) (4, 7) (4, 8)
-     =>
-
-   The implementation of the 'forloop' macro is fairly straightforward.
-The 'forloop' macro itself is simply a wrapper, which saves the previous
-definition of the first argument, calls the internal macro '_forloop',
+      (1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6) (1, 7) (1, 8)
+      (2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6) (2, 7) (2, 8)
+      (3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6) (3, 7) (3, 8)
+      (4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6) (4, 7) (4, 8)
+     ⇒
+
+   The implementation of the ‘forloop’ macro is fairly straightforward.
+The ‘forloop’ macro itself is simply a wrapper, which saves the previous
+definition of the first argument, calls the internal macro ‘_forloop’,
 and re-establishes the saved definition of the first argument.
 
-   The macro '_forloop' expands the fourth argument once, and tests to
+   The macro ‘_forloop’ expands the fourth argument once, and tests to
 see if the iterator has reached the final value.  If it has not
-finished, it increments the iterator (using the predefined macro 'incr',
+finished, it increments the iterator (using the predefined macro ‘incr’,
 *note Incr::), and recurses.
 
-   Here is an actual implementation of 'forloop', distributed as
-'m4-1.4.18/examples/forloop.m4' in this package:
+   Here is an actual implementation of ‘forloop’, distributed as
+‘m4-1.4.19/examples/forloop.m4’ in this package:
 
      $ m4 -I examples
      undivert(`forloop.m4')dnl
-     =>divert(`-1')
-     =># forloop(var, from, to, stmt) - simple version
-     =>define(`forloop', `pushdef(`$1', `$2')_forloop($@)popdef(`$1')')
-     =>define(`_forloop',
-     =>       `$4`'ifelse($1, `$3', `', `define(`$1', incr($1))$0($@)')')
-     =>divert`'dnl
+     divert(`-1')
+     # forloop(var, from, to, stmt) - simple version
+     define(`forloop', `pushdef(`$1', `$2')_forloop($@)popdef(`$1')')
+     define(`_forloop',
+            `$4`'ifelse($1, `$3', `', `define(`$1', incr($1))$0($@)')')
+     divert`'dnl
 
    Notice the careful use of quotes.  Certain macro arguments are left
 unquoted, each for its own reason.  Try to find out _why_ these
@@ -2693,33 +2693,33 @@ Here is an example of a loop macro that implements list iteration.
  -- Composite: foreachq (ITERATOR, QUOTE-LIST, TEXT)
      Takes the name in ITERATOR, which must be a valid macro name, and
      successively assign it each value from PAREN-LIST or QUOTE-LIST.
-     In 'foreach', PAREN-LIST is a comma-separated list of elements
-     contained in parentheses.  In 'foreachq', QUOTE-LIST is a
+     In ‘foreach’, PAREN-LIST is a comma-separated list of elements
+     contained in parentheses.  In ‘foreachq’, QUOTE-LIST is a
      comma-separated list of elements contained in a quoted string.  For
      each assignment to ITERATOR, append TEXT to the overall expansion.
      TEXT may refer to ITERATOR.  Any definition of ITERATOR prior to
      this invocation is restored.
 
    As an example, this displays each word in a list inside of a
-sentence, using an implementation of 'foreach' distributed as
-'m4-1.4.18/examples/foreach.m4', and 'foreachq' in
-'m4-1.4.18/examples/foreachq.m4'.
+sentence, using an implementation of ‘foreach’ distributed as
+‘m4-1.4.19/examples/foreach.m4’, and ‘foreachq’ in
+‘m4-1.4.19/examples/foreachq.m4’.
 
      $ m4 -I examples
      include(`foreach.m4')
-     =>
+     ⇒
      foreach(`x', (foo, bar, foobar), `Word was: x
      ')dnl
-     =>Word was: foo
-     =>Word was: bar
-     =>Word was: foobar
+     Word was: foo
+     Word was: bar
+     Word was: foobar
      include(`foreachq.m4')
-     =>
+     ⇒
      foreachq(`x', `foo, bar, foobar', `Word was: x
      ')dnl
-     =>Word was: foo
-     =>Word was: bar
-     =>Word was: foobar
+     Word was: foo
+     Word was: bar
+     Word was: foobar
 
    It is possible to be more complex; each element of the PAREN-LIST or
 QUOTE-LIST can itself be a list, to pass as further arguments to a
@@ -2727,45 +2727,45 @@ helper macro.  This example generates a shell case statement:
 
      $ m4 -I examples
      include(`foreach.m4')
-     =>
+     ⇒
      define(`_case', `  $1)
          $2=" $1";;
      ')dnl
      define(`_cat', `$1$2')dnl
      case $`'1 in
-     =>case $1 in
+     case $1 in
      foreach(`x', `(`(`a', `vara')', `(`b', `varb')', `(`c', `varc')')',
              `_cat(`_case', x)')dnl
-     =>  a)
-     =>    vara=" a";;
-     =>  b)
-     =>    varb=" b";;
-     =>  c)
-     =>    varc=" c";;
+       a)
+         vara=" a";;
+       b)
+         varb=" b";;
+       c)
+         varc=" c";;
      esac
-     =>esac
+     esac
 
-   The implementation of the 'foreach' macro is a bit more involved; it
-is a wrapper around two helper macros.  First, '_arg1' is needed to grab
-the first element of a list.  Second, '_foreach' implements the
+   The implementation of the ‘foreach’ macro is a bit more involved; it
+is a wrapper around two helper macros.  First, ‘_arg1’ is needed to grab
+the first element of a list.  Second, ‘_foreach’ implements the
 recursion, successively walking through the original list.  Here is a
-simple implementation of 'foreach':
+simple implementation of ‘foreach’:
 
      $ m4 -I examples
      undivert(`foreach.m4')dnl
-     =>divert(`-1')
-     =># foreach(x, (item_1, item_2, ..., item_n), stmt)
-     =>#   parenthesized list, simple version
-     =>define(`foreach', `pushdef(`$1')_foreach($@)popdef(`$1')')
-     =>define(`_arg1', `$1')
-     =>define(`_foreach', `ifelse(`$2', `()', `',
-     =>  `define(`$1', _arg1$2)$3`'$0(`$1', (shift$2), `$3')')')
-     =>divert`'dnl
+     divert(`-1')
+     # foreach(x, (item_1, item_2, ..., item_n), stmt)
+     #   parenthesized list, simple version
+     define(`foreach', `pushdef(`$1')_foreach($@)popdef(`$1')')
+     define(`_arg1', `$1')
+     define(`_foreach', `ifelse(`$2', `()', `',
+       `define(`$1', _arg1$2)$3`'$0(`$1', (shift$2), `$3')')')
+     divert`'dnl
 
    Unfortunately, that implementation is not robust to macro names as
-list elements.  Each iteration of '_foreach' is stripping another layer
+list elements.  Each iteration of ‘_foreach’ is stripping another layer
 of quotes, leading to erratic results if list elements are not already
-fully expanded.  The first cut at implementing 'foreachq' takes this
+fully expanded.  The first cut at implementing ‘foreachq’ takes this
 into account.  Also, when using quoted elements in a PAREN-LIST, the
 overall list must be quoted.  A QUOTE-LIST has the nice property of
 requiring fewer characters to create a list containing the same quoted
@@ -2776,55 +2776,55 @@ the final layer removed during the final rescan:
 
      $ m4 -I examples
      define(`a', `1')define(`b', `2')define(`c', `3')
-     =>
+     ⇒
      include(`foreach.m4')
-     =>
+     ⇒
      include(`foreachq.m4')
-     =>
+     ⇒
      foreach(`x', `(``a'', ``(b'', ``c)'')', `x
      ')
-     =>1
-     =>(2)1
-     =>
-     =>, x
-     =>)
+     1
+     (2)1
+     ⇒
+     , x
+     )
      foreachq(`x', ```a'', ``(b'', ``c)''', `x
      ')dnl
-     =>a
-     =>(b
-     =>c)
+     a
+     (b
+     c)
 
-   Obviously, 'foreachq' did a better job; here is its implementation:
+   Obviously, ‘foreachq’ did a better job; here is its implementation:
 
      $ m4 -I examples
      undivert(`foreachq.m4')dnl
-     =>include(`quote.m4')dnl
-     =>divert(`-1')
-     =># foreachq(x, `item_1, item_2, ..., item_n', stmt)
-     =>#   quoted list, simple version
-     =>define(`foreachq', `pushdef(`$1')_foreachq($@)popdef(`$1')')
-     =>define(`_arg1', `$1')
-     =>define(`_foreachq', `ifelse(quote($2), `', `',
-     =>  `define(`$1', `_arg1($2)')$3`'$0(`$1', `shift($2)', `$3')')')
-     =>divert`'dnl
-
-   Notice that '_foreachq' had to use the helper macro 'quote' defined
-earlier (*note Shift::), to ensure that the embedded 'ifelse' call does
+     include(`quote.m4')dnl
+     divert(`-1')
+     # foreachq(x, `item_1, item_2, ..., item_n', stmt)
+     #   quoted list, simple version
+     define(`foreachq', `pushdef(`$1')_foreachq($@)popdef(`$1')')
+     define(`_arg1', `$1')
+     define(`_foreachq', `ifelse(quote($2), `', `',
+       `define(`$1', `_arg1($2)')$3`'$0(`$1', `shift($2)', `$3')')')
+     divert`'dnl
+
+   Notice that ‘_foreachq’ had to use the helper macro ‘quote’ defined
+earlier (*note Shift::), to ensure that the embedded ‘ifelse’ call does
 not go haywire if a list element contains a comma.  Unfortunately, this
-implementation of 'foreachq' has its own severe flaw.  Whereas the
-'foreach' implementation was linear, this macro is quadratic in the
+implementation of ‘foreachq’ has its own severe flaw.  Whereas the
+‘foreach’ implementation was linear, this macro is quadratic in the
 number of list elements, and is much more likely to trip up the limit
-set by the command line option '--nesting-limit' (or '-L', *note
+set by the command line option ‘--nesting-limit’ (or ‘-L’, *note
 Invoking m4: Limits control.).  Additionally, this implementation does
-not expand 'defn(`ITERATOR')' very well, when compared with 'foreach'.
+not expand ‘defn(`ITERATOR')’ very well, when compared with ‘foreach’.
 
      $ m4 -I examples
      include(`foreach.m4')include(`foreachq.m4')
-     =>
+     ⇒
      foreach(`name', `(`a', `b')', ` defn(`name')')
-     => a b
+      a b
      foreachq(`name', ``a', `b'', ` defn(`name')')
-     => _arg1(`a', `b') _arg1(shift(`a', `b'))
+      _arg1(`a', `b') _arg1(shift(`a', `b'))
 
    It is possible to have robust iteration with linear behavior and sane
 ITERATOR contents for either list style.  See if you can learn from the
@@ -2837,74 +2837,74 @@ File: m4.info,  Node: Stacks,  Next: Composition,  Prev: Foreach,  Up: Condition
 6.6 Working with definition stacks
 ==================================
 
-Thanks to 'pushdef', manipulation of a stack is an intrinsic operation
-in 'm4'.  Normally, only the topmost definition in a stack is important,
+Thanks to ‘pushdef’, manipulation of a stack is an intrinsic operation
+in ‘m4’.  Normally, only the topmost definition in a stack is important,
 but sometimes, it is desirable to manipulate the entire definition
 stack.
 
  -- Composite: stack_foreach (MACRO, ACTION)
  -- Composite: stack_foreach_lifo (MACRO, ACTION)
-     For each of the 'pushdef' definitions associated with MACRO, invoke
+     For each of the ‘pushdef’ definitions associated with MACRO, invoke
      the macro ACTION with a single argument of that definition.
-     'stack_foreach' visits the oldest definition first, while
-     'stack_foreach_lifo' visits the current definition first.  ACTION
+     ‘stack_foreach’ visits the oldest definition first, while
+     ‘stack_foreach_lifo’ visits the current definition first.  ACTION
      should not modify or dereference MACRO.  There are a few special
-     macros, such as 'defn', which cannot be used as the MACRO
+     macros, such as ‘defn’, which cannot be used as the MACRO
      parameter.
 
    A sample implementation of these macros is distributed in the file
-'m4-1.4.18/examples/stack.m4'.
+‘m4-1.4.19/examples/stack.m4’.
 
      $ m4 -I examples
      include(`stack.m4')
-     =>
+     ⇒
      pushdef(`a', `1')pushdef(`a', `2')pushdef(`a', `3')
-     =>
+     ⇒
      define(`show', ``$1'
      ')
-     =>
+     ⇒
      stack_foreach(`a', `show')dnl
-     =>1
-     =>2
-     =>3
+     1
+     2
+     3
      stack_foreach_lifo(`a', `show')dnl
-     =>3
-     =>2
-     =>1
+     3
+     2
+     1
 
    Now for the implementation.  Note the definition of a helper macro,
-'_stack_reverse', which destructively swaps the contents of one stack of
-definitions into the reverse order in the temporary macro 'tmp-$1'.  By
+‘_stack_reverse’, which destructively swaps the contents of one stack of
+definitions into the reverse order in the temporary macro ‘tmp-$1’.  By
 calling the helper twice, the original order is restored back into the
-macro '$1'; since the operation is destructive, this explains why '$1'
+macro ‘$1’; since the operation is destructive, this explains why ‘$1’
 must not be modified or dereferenced during the traversal.  The caller
 can then inject additional code to pass the definition currently being
-visited to '$2'.  The choice of helper names is intentional; since '-'
+visited to ‘$2’.  The choice of helper names is intentional; since ‘-’
 is not valid as part of a macro name, there is no risk of conflict with
-a valid macro name, and the code is guaranteed to use 'defn' where
+a valid macro name, and the code is guaranteed to use ‘defn’ where
 necessary.  Finally, note that any macro used in the traversal of a
-'pushdef' stack, such as 'pushdef' or 'defn', cannot be handled by
-'stack_foreach', since the macro would temporarily be undefined during
+‘pushdef’ stack, such as ‘pushdef’ or ‘defn’, cannot be handled by
+‘stack_foreach’, since the macro would temporarily be undefined during
 the algorithm.
 
      $ m4 -I examples
      undivert(`stack.m4')dnl
-     =>divert(`-1')
-     =># stack_foreach(macro, action)
-     =># Invoke ACTION with a single argument of each definition
-     =># from the definition stack of MACRO, starting with the oldest.
-     =>define(`stack_foreach',
-     =>`_stack_reverse(`$1', `tmp-$1')'dnl
-     =>`_stack_reverse(`tmp-$1', `$1', `$2(defn(`$1'))')')
-     =># stack_foreach_lifo(macro, action)
-     =># Invoke ACTION with a single argument of each definition
-     =># from the definition stack of MACRO, starting with the newest.
-     =>define(`stack_foreach_lifo',
-     =>`_stack_reverse(`$1', `tmp-$1', `$2(defn(`$1'))')'dnl
-     =>`_stack_reverse(`tmp-$1', `$1')')
-     =>define(`_stack_reverse',
-     =>`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0($@)')')
-     =>divert`'dnl
+     divert(`-1')
+     # stack_foreach(macro, action)
+     # Invoke ACTION with a single argument of each definition
+     # from the definition stack of MACRO, starting with the oldest.
+     define(`stack_foreach',
+     `_stack_reverse(`$1', `tmp-$1')'dnl
+     `_stack_reverse(`tmp-$1', `$1', `$2(defn(`$1'))')')
+     # stack_foreach_lifo(macro, action)
+     # Invoke ACTION with a single argument of each definition
+     # from the definition stack of MACRO, starting with the newest.
+     define(`stack_foreach_lifo',
+     `_stack_reverse(`$1', `tmp-$1', `$2(defn(`$1'))')'dnl
+     `_stack_reverse(`tmp-$1', `$1')')
+     define(`_stack_reverse',
+     `ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0($@)')')
+     divert`'dnl
 
 \1f
 File: m4.info,  Node: Composition,  Prev: Stacks,  Up: Conditionals
@@ -2919,57 +2919,57 @@ of blind macros.
  -- Composite: define_blind (NAME, [VALUE])
      Defines NAME as a blind macro, such that NAME will expand to VALUE
      only when given explicit arguments.  VALUE should not be the result
-     of 'defn' (*note Defn::).  This macro is only recognized with
+     of ‘defn’ (*note Defn::).  This macro is only recognized with
      parameters, and results in an empty string.
 
    Defining a macro to define another macro can be a bit tricky.  We
-want to use a literal '$#' in the argument to the nested 'define'.
-However, if '$' and '#' are adjacent in the definition of
-'define_blind', then it would be expanded as the number of arguments to
-'define_blind' rather than the intended number of arguments to NAME.
+want to use a literal ‘$#’ in the argument to the nested ‘define’.
+However, if ‘$’ and ‘#’ are adjacent in the definition of
+‘define_blind’, then it would be expanded as the number of arguments to
+‘define_blind’ rather than the intended number of arguments to NAME.
 The solution is to pass the difficult characters through extra arguments
-to a helper macro '_define_blind'.  When composing macros, it is a
+to a helper macro ‘_define_blind’.  When composing macros, it is a
 common idiom to need a helper macro to concatenate text that forms
 parameters in the composed macro, rather than interpreting the text as a
 parameter of the composing macro.
 
-   As for the limitation against using 'defn', there are two reasons.
-If a macro was previously defined with 'define_blind', then it can
-safely be renamed to a new blind macro using plain 'define'; using
-'define_blind' to rename it just adds another layer of 'ifelse',
+   As for the limitation against using ‘defn’, there are two reasons.
+If a macro was previously defined with ‘define_blind’, then it can
+safely be renamed to a new blind macro using plain ‘define’; using
+‘define_blind’ to rename it just adds another layer of ‘ifelse’,
 occupying memory and slowing down execution.  And if a macro is a
 builtin, then it would result in an attempt to define a macro consisting
 of both text and a builtin token; this is not supported, and the builtin
 token is flattened to an empty string.
 
-   With that explanation, here's the definition, and some sample usage.
-Notice that 'define_blind' is itself a blind macro.
+   With that explanation, heres the definition, and some sample usage.
+Notice that ‘define_blind’ is itself a blind macro.
 
      $ m4 -d
      define(`define_blind', `ifelse(`$#', `0', ``$0'',
      `_$0(`$1', `$2', `$'`#', `$'`0')')')
-     =>
+     ⇒
      define(`_define_blind', `define(`$1',
      `ifelse(`$3', `0', ``$4'', `$2')')')
-     =>
+     ⇒
      define_blind
-     =>define_blind
+     define_blind
      define_blind(`foo', `arguments were $*')
-     =>
+     ⇒
      foo
-     =>foo
+     foo
      foo(`bar')
-     =>arguments were bar
+     arguments were bar
      define(`blah', defn(`foo'))
-     =>
+     ⇒
      blah
-     =>blah
+     blah
      blah(`a', `b')
-     =>arguments were a,b
+     arguments were a,b
      defn(`blah')
-     =>ifelse(`$#', `0', ``$0'', `arguments were $*')
+     ifelse(`$#', `0', ``$0'', `arguments were $*')
 
-   Another interesting composition tactic is argument "currying", or
+   Another interesting composition tactic is argument “currying”, or
 factoring a macro that takes multiple arguments for use in a context
 that provides exactly one argument.
 
@@ -2979,45 +2979,45 @@ that provides exactly one argument.
      with the resulting list of arguments.
 
    A demonstration of currying makes the intent of this macro a little
-more obvious.  The macro 'stack_foreach' mentioned earlier is an example
+more obvious.  The macro ‘stack_foreach’ mentioned earlier is an example
 of a context that provides exactly one argument to a macro name.  But
-coupled with currying, we can invoke 'reverse' with two arguments for
+coupled with currying, we can invoke ‘reverse’ with two arguments for
 each definition of a macro stack.  This example uses the file
-'m4-1.4.18/examples/curry.m4' included in the distribution.
+‘m4-1.4.19/examples/curry.m4’ included in the distribution.
 
      $ m4 -I examples
      include(`curry.m4')include(`stack.m4')
-     =>
+     ⇒
      define(`reverse', `ifelse(`$#', `0', , `$#', `1', ``$1'',
                                `reverse(shift($@)), `$1'')')
-     =>
+     ⇒
      pushdef(`a', `1')pushdef(`a', `2')pushdef(`a', `3')
-     =>
+     ⇒
      stack_foreach(`a', `:curry(`reverse', `4')')
-     =>:1, 4:2, 4:3, 4
+     :1, 4:2, 4:3, 4
      curry(`curry', `reverse', `1')(`2')(`3')
-     =>3, 2, 1
+     3, 2, 1
 
-   Now for the implementation.  Notice how 'curry' leaves off with a
+   Now for the implementation.  Notice how ‘curry’ leaves off with a
 macro name but no open parenthesis, while still in the middle of
-collecting arguments for '$1'.  The macro '_curry' is the helper macro
+collecting arguments for ‘$1’.  The macro ‘_curry’ is the helper macro
 that takes one argument, then adds it to the list and finally supplies
-the closing parenthesis.  The use of a comma inside the 'shift' call
+the closing parenthesis.  The use of a comma inside the ‘shift’ call
 allows currying to also work for a macro that takes one argument,
 although it often makes more sense to invoke that macro directly rather
-than going through 'curry'.
+than going through ‘curry’.
 
      $ m4 -I examples
      undivert(`curry.m4')dnl
-     =>divert(`-1')
-     =># curry(macro, args)
-     =># Expand to a macro call that takes one argument, then invoke
-     =># macro(args, extra).
-     =>define(`curry', `$1(shift($@,)_$0')
-     =>define(`_curry', ``$1')')
-     =>divert`'dnl
-
-   Unfortunately, with M4 1.4.x, 'curry' is unable to handle builtin
+     divert(`-1')
+     # curry(macro, args)
+     # Expand to a macro call that takes one argument, then invoke
+     # macro(args, extra).
+     define(`curry', `$1(shift($@,)_$0')
+     define(`_curry', ``$1')')
+     divert`'dnl
+
+   Unfortunately, with M4 1.4.x, ‘curry’ is unable to handle builtin
 tokens, which are silently flattened to the empty string when passed
 through another text macro.  This limitation will be lifted in a future
 release of M4.
@@ -3028,35 +3028,35 @@ rename an entire stack of macro definitions.
  -- Composite: copy (SOURCE, DEST)
  -- Composite: rename (SOURCE, DEST)
      Ensure that DEST is undefined, then define it to the same stack of
-     definitions currently in SOURCE.  'copy' leaves SOURCE unchanged,
-     while 'rename' undefines SOURCE.  There are only a few macros, such
-     as 'copy' or 'defn', which cannot be copied via this macro.
+     definitions currently in SOURCE.  ‘copy’ leaves SOURCE unchanged,
+     while ‘rename’ undefines SOURCE.  There are only a few macros, such
+     as ‘copy’ or ‘defn’, which cannot be copied via this macro.
 
    The implementation is relatively straightforward (although since it
-uses 'curry', it is unable to copy builtin macros, such as the second
-definition of 'a' as a synonym for 'divnum'.  See if you can design a
+uses ‘curry’, it is unable to copy builtin macros, such as the second
+definition of ‘a’ as a synonym for ‘divnum’.  See if you can design a
 version that works around this limitation, or *note Answers: Improved
 copy.).
 
      $ m4 -I examples
      include(`curry.m4')include(`stack.m4')
-     =>
+     ⇒
      define(`rename', `copy($@)undefine(`$1')')dnl
      define(`copy', `ifdef(`$2', `errprint(`$2 already defined
      ')m4exit(`1')',
         `stack_foreach(`$1', `curry(`pushdef', `$2')')')')dnl
      pushdef(`a', `1')pushdef(`a', defn(`divnum'))pushdef(`a', `2')
-     =>
+     ⇒
      copy(`a', `b')
-     =>
+     ⇒
      rename(`b', `c')
-     =>
+     ⇒
      a b c
-     =>2 b 2
+     2 b 2
      popdef(`a', `c')c a
-     => 0
+      0
      popdef(`a', `c')a c
-     =>1 1
+     1 1
 
 \1f
 File: m4.info,  Node: Debugging,  Next: Input Control,  Prev: Conditionals,  Up: Top
@@ -3064,9 +3064,9 @@ File: m4.info,  Node: Debugging,  Next: Input Control,  Prev: Conditionals,  Up:
 7 How to debug macros and input
 *******************************
 
-When writing macros for 'm4', they often do not work as intended on the
+When writing macros for ‘m4’, they often do not work as intended on the
 first try (as is the case with most programming languages).
-Fortunately, there is support for macro debugging in 'm4'.
+Fortunately, there is support for macro debugging in ‘m4’.
 
 * Menu:
 
@@ -3082,7 +3082,7 @@ File: m4.info,  Node: Dumpdef,  Next: Trace,  Up: Debugging
 ================================
 
 If you want to see what a name expands into, you can use the builtin
-'dumpdef':
+‘dumpdef’:
 
  -- Builtin: dumpdef ([NAMES...])
      Accepts any number of arguments.  If called without any arguments,
@@ -3091,15 +3091,15 @@ If you want to see what a name expands into, you can use the builtin
      to the current debug file (usually standard error), and is sorted
      by name.  If an unknown name is encountered, a warning is printed.
 
-     The expansion of 'dumpdef' is void.
+     The expansion of ‘dumpdef’ is void.
 
      $ m4 -d
      define(`foo', `Hello world.')
-     =>
+     ⇒
      dumpdef(`foo')
-     error->foo: =>
+     error→foo: ⇒
      dumpdef(`define')
-     error->define: =>
+     error→define: ⇒
 
    The last example shows how builtin macros definitions are displayed.
 The definition that is dumped corresponds to what would occur if the
@@ -3108,12 +3108,12 @@ still live due to redefining a macro during argument collection.
 
      $ m4 -d
      pushdef(`f', ``$0'1')pushdef(`f', ``$0'2')
-     =>
+     ⇒
      f(popdef(`f')dumpdef(`f'))
-     error->f: =>f2
+     error→f: ⇒f2
      f(popdef(`f')dumpdef(`f'))
-     error->m4:stdin:3: undefined macro `f'
-     =>f1
+     errorm4:stdin:3: undefined macro `f'
+     f1
 
    *Note Debug Levels::, for information on controlling the details of
 the display.
@@ -3125,18 +3125,18 @@ File: m4.info,  Node: Trace,  Next: Debug Levels,  Prev: Dumpdef,  Up: Debugging
 =======================
 
 It is possible to trace macro calls and expansions through the builtins
-'traceon' and 'traceoff':
+‘traceon’ and ‘traceoff’:
 
  -- Builtin: traceon ([NAMES...])
  -- Builtin: traceoff ([NAMES...])
-     When called without any arguments, 'traceon' and 'traceoff' will
+     When called without any arguments, ‘traceon’ and ‘traceoff’ will
      turn tracing on and off, respectively, for all currently defined
      macros.
 
      When called with arguments, only the macros listed in NAMES are
      affected, whether or not they are currently defined.
 
-     The expansion of 'traceon' and 'traceoff' is void.
+     The expansion of ‘traceon’ and ‘traceoff’ is void.
 
    Whenever a traced macro is called and the arguments have been
 collected, the call is displayed.  If the expansion of the macro call is
@@ -3146,37 +3146,37 @@ Debug Output::).
 
      $ m4 -d
      define(`foo', `Hello World.')
-     =>
+     ⇒
      define(`echo', `$@')
-     =>
+     ⇒
      traceon(`foo', `echo')
-     =>
+     ⇒
      foo
-     error->m4trace: -1- foo -> `Hello World.'
-     =>Hello World.
+     errorm4trace: -1- foo -> `Hello World.'
+     Hello World.
      echo(`gnus', `and gnats')
-     error->m4trace: -1- echo(`gnus', `and gnats') -> ``gnus',`and gnats''
-     =>gnus,and gnats
+     errorm4trace: -1- echo(`gnus', `and gnats') -> ``gnus',`and gnats''
+     gnus,and gnats
 
    The number between dashes is the depth of the expansion.  It is one
 most of the time, signifying an expansion at the outermost level, but it
 increases when macro arguments contain unquoted macro calls.  The
 maximum number that will appear between dashes is controlled by the
-option '--nesting-limit' (or '-L', *note Invoking m4: Limits control.).
-Additionally, the option '--trace' (or '-t') can be used to invoke
-'traceon(NAME)' before parsing input.
+option ‘--nesting-limit’ (or ‘-L’, *note Invoking m4: Limits control.).
+Additionally, the option ‘--trace’ (or ‘-t’) can be used to invoke
+‘traceon(NAME)’ before parsing input.
 
      $ m4 -L 3 -t ifelse
      ifelse(`one level')
-     error->m4trace: -1- ifelse
-     =>
+     errorm4trace: -1- ifelse
+     ⇒
      ifelse(ifelse(ifelse(`three levels')))
-     error->m4trace: -3- ifelse
-     error->m4trace: -2- ifelse
-     error->m4trace: -1- ifelse
-     =>
+     errorm4trace: -3- ifelse
+     errorm4trace: -2- ifelse
+     errorm4trace: -1- ifelse
+     ⇒
      ifelse(ifelse(ifelse(ifelse(`four levels'))))
-     error->m4:stdin:3: recursion limit of 3 exceeded, use -L<N> to change it
+     errorm4:stdin:3: recursion limit of 3 exceeded, use -L<N> to change it
 
    Tracing by name is an attribute that is preserved whether the macro
 is defined or not.  This allows the selection of macros to trace before
@@ -3184,65 +3184,65 @@ those macros are defined.
 
      $ m4 -d
      traceoff(`foo')
-     =>
+     ⇒
      traceon(`foo')
-     =>
+     ⇒
      foo
-     =>foo
+     foo
      defn(`foo')
-     =>
+     ⇒
      define(`foo', `bar')
-     =>
+     ⇒
      foo
-     error->m4trace: -1- foo -> `bar'
-     =>bar
+     errorm4trace: -1- foo -> `bar'
+     bar
      undefine(`foo')
-     =>
+     ⇒
      ifdef(`foo', `yes', `no')
-     =>no
+     no
      indir(`foo')
-     error->m4:stdin:9: undefined macro `foo'
-     =>
+     errorm4:stdin:9: undefined macro `foo'
+     ⇒
      define(`foo', `blah')
-     =>
+     ⇒
      foo
-     error->m4trace: -1- foo -> `blah'
-     =>blah
+     errorm4trace: -1- foo -> `blah'
+     blah
      traceoff
-     =>
+     ⇒
      foo
-     =>blah
+     blah
 
-   Tracing even works on builtins.  However, 'defn' (*note Defn::) does
+   Tracing even works on builtins.  However, ‘defn’ (*note Defn::) does
 not transfer tracing status.
 
      $ m4 -d
      traceon(`traceon')
-     =>
+     ⇒
      traceon(`traceoff')
-     error->m4trace: -1- traceon(`traceoff')
-     =>
+     errorm4trace: -1- traceon(`traceoff')
+     ⇒
      traceoff(`traceoff')
-     error->m4trace: -1- traceoff(`traceoff')
-     =>
+     errorm4trace: -1- traceoff(`traceoff')
+     ⇒
      traceoff(`traceon')
-     =>
+     ⇒
      traceon(`eval', `m4_divnum')
-     =>
+     ⇒
      define(`m4_eval', defn(`eval'))
-     =>
+     ⇒
      define(`m4_divnum', defn(`divnum'))
-     =>
+     ⇒
      eval(divnum)
-     error->m4trace: -1- eval(`0') -> `0'
-     =>0
+     errorm4trace: -1- eval(`0') -> `0'
+     0
      m4_eval(m4_divnum)
-     error->m4trace: -2- m4_divnum -> `0'
-     =>0
+     errorm4trace: -2- m4_divnum -> `0'
+     0
 
    *Note Debug Levels::, for information on controlling the details of
 the display.  The format of the trace output is not specified by POSIX,
-and varies between implementations of 'm4'.
+and varies between implementations of ‘m4’.
 
 \1f
 File: m4.info,  Node: Debug Levels,  Next: Debug Output,  Prev: Trace,  Up: Debugging
@@ -3250,107 +3250,107 @@ File: m4.info,  Node: Debug Levels,  Next: Debug Output,  Prev: Trace,  Up: Debu
 7.3 Controlling debugging output
 ================================
 
-The '-d' option to 'm4' (or '--debug', *note Invoking m4: Debugging
+The ‘-d’ option to ‘m4’ (or ‘--debug’, *note Invoking m4: Debugging
 options.) controls the amount of details presented in three categories
-of output.  Trace output is requested by 'traceon' (*note Trace::), and
-each line is prefixed by 'm4trace:' in relation to a macro invocation.
+of output.  Trace output is requested by ‘traceon’ (*note Trace::), and
+each line is prefixed by ‘m4trace:’ in relation to a macro invocation.
 Debug output tracks useful events not associated with a macro
-invocation, and each line is prefixed by 'm4debug:'.  Finally, 'dumpdef'
+invocation, and each line is prefixed by ‘m4debug:’.  Finally, ‘dumpdef’
 (*note Dumpdef::) output is affected, with no prefix added to the output
 lines.
 
    The FLAGS following the option can be one or more of the following:
 
-'a'
+‘a’
      In trace output, show the actual arguments that were collected
      before invoking the macro.  This applies to all macro calls if the
-     't' flag is used, otherwise only the macros covered by calls of
-     'traceon'.  Arguments are subject to length truncation specified by
-     the command line option '--arglength' (or '-l').
+     ‘t’ flag is used, otherwise only the macros covered by calls of
+     ‘traceon’.  Arguments are subject to length truncation specified by
+     the command line option ‘--arglength’ (or ‘-l’).
 
-'c'
+‘c’
      In trace output, show several trace lines for each macro call.  A
      line is shown when the macro is seen, but before the arguments are
      collected; a second line when the arguments have been collected and
      a third line after the call has completed.
 
-'e'
+‘e’
      In trace output, show the expansion of each macro call, if it is
-     not void.  This applies to all macro calls if the 't' flag is used,
-     otherwise only the macros covered by calls of 'traceon'.  The
+     not void.  This applies to all macro calls if the ‘t’ flag is used,
+     otherwise only the macros covered by calls of ‘traceon’.  The
      expansion is subject to length truncation specified by the command
-     line option '--arglength' (or '-l').
+     line option ‘--arglength’ (or ‘-l’).
 
-'f'
+‘f’
      In debug and trace output, include the name of the current input
      file in the output line.
 
-'i'
+‘i’
      In debug output, print a message each time the current input file
      is changed.
 
-'l'
+‘l’
      In debug and trace output, include the current input line number in
      the output line.
 
-'p'
+‘p’
      In debug output, print a message when a named file is found through
      the path search mechanism (*note Search Path::), giving the actual
      file name used.
 
-'q'
+‘q’
      In trace and dumpdef output, quote actual arguments and macro
      expansions in the display with the current quotes.  This is useful
-     in connection with the 'a' and 'e' flags above.
+     in connection with the ‘a’ and ‘e’ flags above.
 
-'t'
+‘t’
      In trace output, trace all macro calls made in this invocation of
-     'm4', regardless of the settings of 'traceon'.
+     ‘m4’, regardless of the settings of ‘traceon’.
 
-'x'
-     In trace output, add a unique 'macro call id' to each line of the
-     trace output.  This is useful in connection with the 'c' flag
+‘x’
+     In trace output, add a unique ‘macro call id’ to each line of the
+     trace output.  This is useful in connection with the ‘c’ flag
      above.
 
-'V'
+‘V’
      A shorthand for all of the above flags.
 
-   If no flags are specified with the '-d' option, the default is 'aeq'.
+   If no flags are specified with the ‘-d’ option, the default is ‘aeq’.
 The examples throughout this manual assume the default flags.
 
-   There is a builtin macro 'debugmode', which allows on-the-fly control
+   There is a builtin macro ‘debugmode’, which allows on-the-fly control
 of the debugging output format:
 
  -- Builtin: debugmode ([FLAGS])
      The argument FLAGS should be a subset of the letters listed above.
-     As special cases, if the argument starts with a '+', the flags are
-     added to the current debug flags, and if it starts with a '-', they
+     As special cases, if the argument starts with a ‘+’, the flags are
+     added to the current debug flags, and if it starts with a ‘-’, they
      are removed.  If no argument is present, all debugging flags are
-     cleared (as if no '-d' was given), and with an empty argument the
-     flags are reset to the default of 'aeq'.
+     cleared (as if no ‘-d’ was given), and with an empty argument the
+     flags are reset to the default of ‘aeq’.
 
-     The expansion of 'debugmode' is void.
+     The expansion of ‘debugmode’ is void.
 
      $ m4
      define(`foo', `FOO')
-     =>
+     ⇒
      traceon(`foo')
-     =>
+     ⇒
      debugmode()
-     =>
+     ⇒
      foo
-     error->m4trace: -1- foo -> `FOO'
-     =>FOO
+     errorm4trace: -1- foo -> `FOO'
+     FOO
      debugmode
-     =>
+     ⇒
      foo
-     error->m4trace: -1- foo
-     =>FOO
+     errorm4trace: -1- foo
+     FOO
      debugmode(`+l')
-     =>
+     ⇒
      foo
-     error->m4trace:8: -1- foo
-     =>FOO
+     errorm4trace:8: -1- foo
+     FOO
 
    The following example demonstrates the behavior of length truncation,
 when specified on the command line.  Note that each argument and the
@@ -3359,27 +3359,27 @@ builtin functions are not truncated.
 
      $ m4 -d -l 6
      define(`echo', `$@')debugmode(`+t')
-     =>
+     ⇒
      echo(`1', `long string')
-     error->m4trace: -1- echo(`1', `long s...') -> ``1',`l...'
-     =>1,long string
+     errorm4trace: -1- echo(`1', `long s...') -> ``1',`l...'
+     1,long string
      indir(`echo', defn(`changequote'))
-     error->m4trace: -2- defn(`change...')
-     error->m4trace: -1- indir(`echo', <changequote>) -> ``''
-     =>
+     errorm4trace: -2- defn(`change...')
+     errorm4trace: -1- indir(`echo', <changequote>) -> ``''
+     ⇒
 
    This example shows the effects of the debug flags that are not
 related to macro tracing.
 
      $ m4 -dip -I examples
-     error->m4debug: input read from stdin
+     errorm4debug: input read from stdin
      include(`foo')dnl
-     error->m4debug: path search for `foo' found `examples/foo'
-     error->m4debug: input read from examples/foo
-     =>bar
-     error->m4debug: input reverted to stdin, line 1
+     errorm4debug: path search for `foo' found `examples/foo'
+     errorm4debug: input read from examples/foo
+     bar
+     errorm4debug: input reverted to stdin, line 1
      ^D
-     error->m4debug: input exhausted
+     errorm4debug: input exhausted
 
 \1f
 File: m4.info,  Node: Debug Output,  Prev: Debug Levels,  Up: Debugging
@@ -3388,37 +3388,37 @@ File: m4.info,  Node: Debug Output,  Prev: Debug Levels,  Up: Debugging
 ===========================
 
 Debug and tracing output can be redirected to files using either the
-'--debugfile' option to 'm4' (*note Invoking m4: Debugging options.), or
-with the builtin macro 'debugfile':
+‘--debugfile’ option to ‘m4’ (*note Invoking m4: Debugging options.), or
+with the builtin macro ‘debugfile’:
 
  -- Builtin: debugfile ([FILE])
      Sends all further debug and trace output to FILE, opened in append
      mode.  If FILE is the empty string, debug and trace output are
-     discarded.  If 'debugfile' is called without any arguments, debug
+     discarded.  If ‘debugfile’ is called without any arguments, debug
      and trace output are sent to standard error.  This does not affect
-     warnings, error messages, or 'errprint' output, which are always
+     warnings, error messages, or ‘errprint’ output, which are always
      sent to standard error.  If FILE cannot be opened, the current
      debug file is unchanged, and an error is issued.
 
-     The expansion of 'debugfile' is void.
+     The expansion of ‘debugfile’ is void.
 
      $ m4 -d
      traceon(`divnum')
-     =>
+     ⇒
      divnum(`extra')
-     error->m4:stdin:2: Warning: excess arguments to builtin `divnum' ignored
-     error->m4trace: -1- divnum(`extra') -> `0'
-     =>0
+     errorm4:stdin:2: Warning: excess arguments to builtin `divnum' ignored
+     errorm4trace: -1- divnum(`extra') -> `0'
+     0
      debugfile()
-     =>
+     ⇒
      divnum(`extra')
-     error->m4:stdin:4: Warning: excess arguments to builtin `divnum' ignored
-     =>0
+     errorm4:stdin:4: Warning: excess arguments to builtin `divnum' ignored
+     0
      debugfile
-     =>
+     ⇒
      divnum
-     error->m4trace: -1- divnum -> `0'
-     =>0
+     errorm4trace: -1- divnum -> `0'
+     0
 
 \1f
 File: m4.info,  Node: Input Control,  Next: File Inclusion,  Prev: Debugging,  Up: Top
@@ -3427,7 +3427,7 @@ File: m4.info,  Node: Input Control,  Next: File Inclusion,  Prev: Debugging,  U
 ***************
 
 This chapter describes various builtin macros for controlling the input
-to 'm4'.
+to ‘m4’.
 
 * Menu:
 
@@ -3443,51 +3443,51 @@ File: m4.info,  Node: Dnl,  Next: Changequote,  Up: Input Control
 8.1 Deleting whitespace in input
 ================================
 
-The builtin 'dnl' stands for "Discard to Next Line":
+The builtin ‘dnl’ stands for “Discard to Next Line”:
 
  -- Builtin: dnl
      All characters, up to and including the next newline, are discarded
      without performing any macro expansion.  A warning is issued if the
      end of the file is encountered without a newline.
 
-     The expansion of 'dnl' is void.
+     The expansion of ‘dnl’ is void.
 
-   It is often used in connection with 'define', to remove the newline
-that follows the call to 'define'.  Thus
+   It is often used in connection with ‘define’, to remove the newline
+that follows the call to ‘define’.  Thus
 
      define(`foo', `Macro `foo'.')dnl A very simple macro, indeed.
      foo
-     =>Macro foo.
+     Macro foo.
 
    The input up to and including the next newline is discarded, as
 opposed to the way comments are treated (*note Comments::).
 
-   Usually, 'dnl' is immediately followed by an end of line or some
-other whitespace.  GNU 'm4' will produce a warning diagnostic if 'dnl'
-is followed by an open parenthesis.  In this case, 'dnl' will collect
+   Usually, ‘dnl’ is immediately followed by an end of line or some
+other whitespace.  GNU ‘m4’ will produce a warning diagnostic if ‘dnl’
+is followed by an open parenthesis.  In this case, ‘dnl’ will collect
 and process all arguments, looking for a matching close parenthesis.
 All predictable side effects resulting from this collection will take
-place.  'dnl' will return no output.  The input following the matching
+place.  ‘dnl’ will return no output.  The input following the matching
 close parenthesis up to and including the next newline, on whatever line
 containing it, will still be discarded.
 
      dnl(`args are ignored, but side effects occur',
      define(`foo', `like this')) while this text is ignored: undefine(`foo')
-     error->m4:stdin:1: Warning: excess arguments to builtin `dnl' ignored
+     errorm4:stdin:1: Warning: excess arguments to builtin `dnl' ignored
      See how `foo' was defined, foo?
-     =>See how foo was defined, like this?
+     See how foo was defined, like this?
 
    If the end of file is encountered without a newline character, a
 warning is issued and dnl stops consuming input.
 
      m4wrap(`m4wrap(`2 hi
      ')0 hi dnl 1 hi')
-     =>
+     ⇒
      define(`hi', `HI')
-     =>
+     ⇒
      ^D
-     error->m4:stdin:1: Warning: end of file treated as newline
-     =>0 HI 2 HI
+     errorm4:stdin:1: Warning: end of file treated as newline
+     0 HI 2 HI
 
 \1f
 File: m4.info,  Node: Changequote,  Next: Changecom,  Prev: Dnl,  Up: Input Control
@@ -3496,143 +3496,153 @@ File: m4.info,  Node: Changequote,  Next: Changecom,  Prev: Dnl,  Up: Input Cont
 =================================
 
 The default quote delimiters can be changed with the builtin
-'changequote':
+‘changequote’:
 
- -- Builtin: changequote ([START = '`'], [END = '''])
+ -- Builtin: changequote ([START = ‘`’], [END = ‘'’])
      This sets START as the new begin-quote delimiter and END as the new
      end-quote delimiter.  If both arguments are missing, the default
-     quotes ('`' and ''') are used.  If START is void, then quoting is
+     quotes (‘`’ and ‘'’) are used.  If START is void, then quoting is
      disabled.  Otherwise, if END is missing or void, the default
-     end-quote delimiter (''') is used.  The quote delimiters can be of
+     end-quote delimiter (‘'’) is used.  The quote delimiters can be of
      any length.
 
-     The expansion of 'changequote' is void.
+     The expansion of ‘changequote’ is void.
 
      changequote(`[', `]')
-     =>
+     ⇒
      define([foo], [Macro [foo].])
-     =>
+     ⇒
      foo
-     =>Macro foo.
+     Macro foo.
 
-   The quotation strings can safely contain eight-bit characters.  If no
-single character is appropriate, START and END can be of any length.
-Other implementations cap the delimiter length to five characters, but
-GNU has no inherent limit.
+   The quotation strings can safely contain non-ASCII characters.
+
+     define(`a', `b')
+     ⇒
+     «a»
+     ⇒«b»
+     changequote(`«', `»')
+     ⇒
+     «a»
+     ⇒a
+
+   If no single character is appropriate, START and END can be of any
+length.  Other implementations cap the delimiter length to five
+characters, but GNU has no inherent limit.
 
      changequote(`[[[', `]]]')
-     =>
+     ⇒
      define([[[foo]]], [[[Macro [[[[[foo]]]]].]]])
-     =>
+     ⇒
      foo
-     =>Macro [[foo]].
+     Macro [[foo]].
 
-   Calling 'changequote' with START as the empty string will effectively
+   Calling ‘changequote’ with START as the empty string will effectively
 disable the quoting mechanism, leaving no way to quote text.  However,
 using an empty string is not portable, as some other implementations of
-'m4' revert to the default quoting, while others preserve the prior
+‘m4’ revert to the default quoting, while others preserve the prior
 non-empty delimiter.  If START is not empty, then an empty END will use
-the default end-quote delimiter of ''', as otherwise, it would be
+the default end-quote delimiter of ‘'’, as otherwise, it would be
 impossible to end a quoted string.  Again, this is not portable, as some
-other 'm4' implementations reuse START as the end-quote delimiter, while
+other ‘m4’ implementations reuse START as the end-quote delimiter, while
 others preserve the previous non-empty value.  Omitting both arguments
 restores the default begin-quote and end-quote delimiters; fortunately
-this behavior is portable to all implementations of 'm4'.
+this behavior is portable to all implementations of ‘m4’.
 
      define(`foo', `Macro `FOO'.')
-     =>
+     ⇒
      changequote(`', `')
-     =>
+     ⇒
      foo
-     =>Macro `FOO'.
+     Macro `FOO'.
      `foo'
-     =>`Macro `FOO'.'
+     `Macro `FOO'.'
      changequote(`,)
-     =>
+     ⇒
      foo
-     =>Macro FOO.
+     Macro FOO.
 
-   There is no way in 'm4' to quote a string containing an unmatched
-begin-quote, except using 'changequote' to change the current quotes.
+   There is no way in ‘m4’ to quote a string containing an unmatched
+begin-quote, except using ‘changequote’ to change the current quotes.
 
-   If the quotes should be changed from, say, '[' to '[[', temporary
+   If the quotes should be changed from, say, ‘[’ to ‘[[’, temporary
 quote characters have to be defined.  To achieve this, two calls of
-'changequote' must be made, one for the temporary quotes and one for the
+‘changequote’ must be made, one for the temporary quotes and one for the
 new quotes.
 
    Macros are recognized in preference to the begin-quote string, so if
 a prefix of START can be recognized as part of a potential macro name,
 the quoting mechanism is effectively disabled.  Unless you use
-'changeword' (*note Changeword::), this means that START should not
-begin with a letter, digit, or '_' (underscore).  However, even though
+‘changeword’ (*note Changeword::), this means that START should not
+begin with a letter, digit, or ‘_’ (underscore).  However, even though
 quoted strings are not recognized, the quote characters can still be
 discerned in macro expansion and in trace output.
 
      define(`echo', `$@')
-     =>
+     ⇒
      define(`hi', `HI')
-     =>
+     ⇒
      changequote(`q', `Q')
-     =>
+     ⇒
      q hi Q hi
-     =>q HI Q HI
+     q HI Q HI
      echo(hi)
-     =>qHIQ
+     qHIQ
      changequote
-     =>
+     ⇒
      changequote(`-', `EOF')
-     =>
+     ⇒
      - hi EOF hi
-     => hi  HI
+      hi  HI
      changequote
-     =>
+     ⇒
      changequote(`1', `2')
-     =>
+     ⇒
      hi1hi2
-     =>hi1hi2
+     hi1hi2
      hi 1hi2
-     =>HI hi
+     HI hi
 
    Quotes are recognized in preference to argument collection.  In
-particular, if START is a single '(', then argument collection is
+particular, if START is a single ‘(’, then argument collection is
 effectively disabled.  For portability with other implementations, it is
-a good idea to avoid '(', ',', and ')' as the first character in START.
+a good idea to avoid ‘(’, ‘,’, and ‘)’ as the first character in START.
 
      define(`echo', `$#:$@:')
-     =>
+     ⇒
      define(`hi', `HI')
-     =>
+     ⇒
      changequote(`(',`)')
-     =>
+     ⇒
      echo(hi)
-     =>0::hi
+     0::hi
      changequote
-     =>
+     ⇒
      changequote(`((', `))')
-     =>
+     ⇒
      echo(hi)
-     =>1:HI:
+     1:HI:
      echo((hi))
-     =>0::hi
+     0::hi
      changequote
-     =>
+     ⇒
      changequote(`,', `)')
-     =>
+     ⇒
      echo(hi,hi)bye)
-     =>1:HIhibye:
+     1:HIhibye:
 
-   However, if you are not worried about portability, using '(' and ')'
-as quoting characters has an interesting property--you can use it to
+   However, if you are not worried about portability, using ‘(’ and ‘)’
+as quoting characters has an interesting propertyyou can use it to
 compute a quoted string containing the expansion of any quoted text, as
 long as the expansion results in both balanced quotes and balanced
-parentheses.  The trick is realizing 'expand' uses '$1' unquoted, to
+parentheses.  The trick is realizing ‘expand’ uses ‘$1’ unquoted, to
 trigger its expansion using the normal quoting characters, but uses
 extra parentheses to group unquoted commas that occur in the expansion
-without consuming whitespace following those commas.  Then '_expand'
-uses 'changequote' to convert the extra parentheses back into quoting
-characters.  Note that it takes two more 'changequote' invocations to
+without consuming whitespace following those commas.  Then ‘_expand’
+uses ‘changequote’ to convert the extra parentheses back into quoting
+characters.  Note that it takes two more ‘changequote’ invocations to
 restore the original quotes.  Contrast the behavior on whitespace when
-using '$*', via 'quote', to attempt the same task.
+using ‘$*’, via ‘quote’, to attempt the same task.
 
      changequote(`[', `]')dnl
      define([a], [1, (b)])dnl
@@ -3642,9 +3652,9 @@ using '$*', via 'quote', to attempt the same task.
      define([_expand],
        [changequote([(], [)])$1changequote`'changequote(`[', `]')])dnl
      expand([a, a, [a, a], [[a, a]]])
-     =>1, (2), 1, (2), a, a, [a, a]
+     1, (2), 1, (2), a, a, [a, a]
      quote(a, a, [a, a], [[a, a]])
-     =>1,(2),1,(2),a, a,[a, a]
+     1,(2),1,(2),a, a,[a, a]
 
    If END is a prefix of START, the end-quote will be recognized in
 preference to a nested begin-quote.  In particular, changing the quotes
@@ -3654,35 +3664,35 @@ across macro expansions, so using the same string is not done very
 often.
 
      define(`hi', `HI')
-     =>
+     ⇒
      changequote(`""', `"')
-     =>
+     ⇒
      ""hi"""hi"
-     =>hihi
+     hihi
      ""hi" ""hi"
-     =>hi hi
+     hi hi
      ""hi"" "hi"
-     =>hi" "HI"
+     hi" "HI"
      changequote
-     =>
+     ⇒
      `hi`hi'hi'
-     =>hi`hi'hi
+     hi`hi'hi
      changequote(`"', `"')
-     =>
+     ⇒
      "hi"hi"hi"
-     =>hiHIhi
+     hiHIhi
 
    It is an error if the end of file occurs within a quoted string.
 
      `hello world'
-     =>hello world
+     hello world
      `dangling quote
      ^D
-     error->m4:stdin:2: ERROR: end of file in string
+     errorm4:stdin:2: ERROR: end of file in string
 
      ifelse(`dangling quote
      ^D
-     error->m4:stdin:1: ERROR: end of file in string
+     errorm4:stdin:1: ERROR: end of file in string
 
 \1f
 File: m4.info,  Node: Changecom,  Next: Changeword,  Prev: Changequote,  Up: Input Control
@@ -3691,117 +3701,127 @@ File: m4.info,  Node: Changecom,  Next: Changeword,  Prev: Changequote,  Up: Inp
 ===================================
 
 The default comment delimiters can be changed with the builtin macro
-'changecom':
+‘changecom’:
 
- -- Builtin: changecom ([START], [END = '<NL>'])
+ -- Builtin: changecom ([START], [END = ‘<NL>’])
      This sets START as the new begin-comment delimiter and END as the
      new end-comment delimiter.  If both arguments are missing, or START
      is void, then comments are disabled.  Otherwise, if END is missing
      or void, the default end-comment delimiter of newline is used.  The
      comment delimiters can be of any length.
 
-     The expansion of 'changecom' is void.
+     The expansion of ‘changecom’ is void.
 
      define(`comment', `COMMENT')
-     =>
+     ⇒
      # A normal comment
-     =># A normal comment
+     # A normal comment
      changecom(`/*', `*/')
-     =>
+     ⇒
      # Not a comment anymore
-     =># Not a COMMENT anymore
+     # Not a COMMENT anymore
      But: /* this is a comment now */ while this is not a comment
-     =>But: /* this is a comment now */ while this is not a COMMENT
+     But: /* this is a comment now */ while this is not a COMMENT
 
    Note how comments are copied to the output, much as if they were
 quoted strings.  If you want the text inside a comment expanded, quote
 the begin-comment delimiter.
 
-   Calling 'changecom' without any arguments, or with START as the empty
+   Calling ‘changecom’ without any arguments, or with START as the empty
 string, will effectively disable the commenting mechanism.  To restore
-the original comment start of '#', you must explicitly ask for it.  If
+the original comment start of ‘#’, you must explicitly ask for it.  If
 START is not empty, then an empty END will use the default end-comment
 delimiter of newline, as otherwise, it would be impossible to end a
-comment.  However, this is not portable, as some other 'm4'
+comment.  However, this is not portable, as some other ‘m4’
 implementations preserve the previous non-empty delimiters instead.
 
      define(`comment', `COMMENT')
-     =>
+     ⇒
      changecom
-     =>
+     ⇒
      # Not a comment anymore
-     =># Not a COMMENT anymore
+     # Not a COMMENT anymore
      changecom(`#', `')
-     =>
+     ⇒
      # comment again
-     =># comment again
+     ⇒# comment again
+
+   The comment strings can safely contain non-ASCII characters.
 
-   The comment strings can safely contain eight-bit characters.  If no
-single character is appropriate, START and END can be of any length.
-Other implementations cap the delimiter length to five characters, but
-GNU has no inherent limit.
+     define(`a', `b')
+     ⇒
+     «a»
+     ⇒«b»
+     changecom(`«', `»')
+     ⇒
+     «a»
+     ⇒«a»
+
+   If no single character is appropriate, START and END can be of any
+length.  Other implementations cap the delimiter length to five
+characters, but GNU has no inherent limit.
 
    Comments are recognized in preference to macros.  However, this is
 not compatible with other implementations, where macros and even quoting
 takes precedence over comments, so it may change in a future release.
 For portability, this means that START should not begin with a letter,
-digit, or '_' (underscore), and that neither the start-quote nor the
+digit, or ‘_’ (underscore), and that neither the start-quote nor the
 start-comment string should be a prefix of the other.
 
      define(`hi', `HI')
-     =>
+     ⇒
      define(`hi1hi2', `hello')
-     =>
+     ⇒
      changecom(`q', `Q')
-     =>
+     ⇒
      q hi Q hi
-     =>q hi Q HI
+     q hi Q HI
      changecom(`1', `2')
-     =>
+     ⇒
      hi1hi2
-     =>hello
+     hello
      hi 1hi2
-     =>HI 1hi2
+     HI 1hi2
 
    Comments are recognized in preference to argument collection.  In
-particular, if START is a single '(', then argument collection is
+particular, if START is a single ‘(’, then argument collection is
 effectively disabled.  For portability with other implementations, it is
-a good idea to avoid '(', ',', and ')' as the first character in START.
+a good idea to avoid ‘(’, ‘,’, and ‘)’ as the first character in START.
 
      define(`echo', `$#:$*:$@:')
-     =>
+     ⇒
      define(`hi', `HI')
-     =>
+     ⇒
      changecom(`(',`)')
-     =>
+     ⇒
      echo(hi)
-     =>0:::(hi)
+     0:::(hi)
      changecom
-     =>
+     ⇒
      changecom(`((', `))')
-     =>
+     ⇒
      echo(hi)
-     =>1:HI:HI:
+     1:HI:HI:
      echo((hi))
-     =>0:::((hi))
+     0:::((hi))
      changecom(`,', `)')
-     =>
+     ⇒
      echo(hi,hi)bye)
-     =>1:HI,hi)bye:HI,hi)bye:
+     1:HI,hi)bye:HI,hi)bye:
      changecom
-     =>
+     ⇒
      echo(hi,`,`'hi',hi)
-     =>3:HI,,HI,HI:HI,,`'hi,HI:
+     3:HI,,HI,HI:HI,,`'hi,HI:
      echo(hi,`,`'hi',hi`'changecom(`,,', `hi'))
-     =>3:HI,,`'hi,HI:HI,,`'hi,HI:
+     3:HI,,`'hi,HI:HI,,`'hi,HI:
 
    It is an error if the end of file occurs within a comment.
 
      changecom(`/*', `*/')
-     =>
+     ⇒
      /*dangling comment
      ^D
-     error->m4:stdin:2: ERROR: end of file in comment
+     errorm4:stdin:2: ERROR: end of file in comment
 
 \1f
 File: m4.info,  Node: Changeword,  Next: M4wrap,  Prev: Changecom,  Up: Input Control
@@ -3809,43 +3829,43 @@ File: m4.info,  Node: Changeword,  Next: M4wrap,  Prev: Changecom,  Up: Input Co
 8.4 Changing the lexical structure of words
 ===========================================
 
-     The macro 'changeword' and all associated functionality is
-     experimental.  It is only available if the '--enable-changeword'
-     option was given to 'configure', at GNU 'm4' installation time.
+     The macro ‘changeword’ and all associated functionality is
+     experimental.  It is only available if the ‘--enable-changeword’
+     option was given to ‘configure’, at GNU ‘m4’ installation time.
      The functionality will go away in the future, to be replaced by
      other new features that are more efficient at providing the same
      capabilities.  _Do not rely on it_.  Please direct your comments
      about it the same way you would do for bugs.
 
-   A file being processed by 'm4' is split into quoted strings, words
+   A file being processed by ‘m4’ is split into quoted strings, words
 (potential macro names) and simple tokens (any other single character).
 Initially a word is defined by the following regular expression:
 
      [_a-zA-Z][_a-zA-Z0-9]*
 
-   Using 'changeword', you can change this regular expression:
+   Using ‘changeword’, you can change this regular expression:
 
  -- Optional builtin: changeword (REGEX)
      Changes the regular expression for recognizing macro names to be
-     REGEX.  If REGEX is empty, use '[_a-zA-Z][_a-zA-Z0-9]*'.  REGEX
+     REGEX.  If REGEX is empty, use ‘[_a-zA-Z][_a-zA-Z0-9]*’.  REGEX
      must obey the constraint that every prefix of the desired final
      pattern is also accepted by the regular expression.  If REGEX
      contains grouping parentheses, the macro invoked is the portion
      that matched the first group, rather than the entire matching
      string.
 
-     The expansion of 'changeword' is void.  The macro 'changeword' is
+     The expansion of ‘changeword’ is void.  The macro ‘changeword’ is
      recognized only with parameters.
 
-   Relaxing the lexical rules of 'm4' might be useful (for example) if
+   Relaxing the lexical rules of ‘m4’ might be useful (for example) if
 you wanted to apply translations to a file of numbers:
 
      ifdef(`changeword', `', `errprint(` skipping: no changeword support
      ')m4exit(`77')')dnl
      changeword(`[_a-zA-Z0-9]+')
-     =>
+     ⇒
      define(`1', `0')1
-     =>0
+     0
 
    Tightening the lexical rules is less useful, because it will
 generally make some of the builtins unavailable.  You could use it to
@@ -3854,54 +3874,54 @@ prevent accidental call of builtins, for example:
      ifdef(`changeword', `', `errprint(` skipping: no changeword support
      ')m4exit(`77')')dnl
      define(`_indir', defn(`indir'))
-     =>
+     ⇒
      changeword(`_[_a-zA-Z0-9]*')
-     =>
+     ⇒
      esyscmd(`foo')
-     =>esyscmd(foo)
+     esyscmd(foo)
      _indir(`esyscmd', `echo hi')
-     =>hi
-     =>
+     hi
+     ⇒
 
-   Because 'm4' constructs its words a character at a time, there is a
+   Because ‘m4’ constructs its words a character at a time, there is a
 restriction on the regular expressions that may be passed to
-'changeword'.  This is that if your regular expression accepts 'foo', it
-must also accept 'f' and 'fo'.
+‘changeword’.  This is that if your regular expression accepts ‘foo’, it
+must also accept ‘f’ and ‘fo’.
 
      ifdef(`changeword', `', `errprint(` skipping: no changeword support
      ')m4exit(`77')')dnl
      define(`foo
      ', `bar
      ')
-     =>
+     ⇒
      dnl This example wants to recognize changeword, dnl, and `foo\n'.
      dnl First, we check that our regexp will match.
      regexp(`changeword', `[cd][a-z]*\|foo[
      ]')
-     =>0
+     0
      regexp(`foo
      ', `[cd][a-z]*\|foo[
      ]')
-     =>0
+     0
      regexp(`f', `[cd][a-z]*\|foo[
      ]')
-     =>-1
+     -1
      foo
-     =>foo
+     foo
      changeword(`[cd][a-z]*\|foo[
      ]')
-     =>
+     ⇒
      dnl Even though `foo\n' matches, we forgot to allow `f'.
      foo
-     =>foo
+     foo
      changeword(`[cd][a-z]*\|fo*[
      ]?')
-     =>
+     ⇒
      dnl Now we can call `foo\n'.
      foo
-     =>bar
+     bar
 
-   'changeword' has another function.  If the regular expression
+   ‘changeword’ has another function.  If the regular expression
 supplied contains any grouped subexpressions, then text outside the
 first of these is discarded before symbol lookup.  So:
 
@@ -3913,18 +3933,18 @@ first of these is discarded before symbol lookup.  So:
      changecom(`/*', `*/')dnl
      define(`foo', `bar')dnl
      changeword(`#\([_a-zA-Z0-9]*\)')
-     =>
+     ⇒
      #esyscmd(`echo foo \#foo')
-     =>foo bar
-     =>
+     foo bar
+     ⇒
 
-   'm4' now requires a '#' mark at the beginning of every macro
-invocation, so one can use 'm4' to preprocess plain text without losing
-various words like 'divert'.
+   ‘m4’ now requires a ‘#’ mark at the beginning of every macro
+invocation, so one can use ‘m4’ to preprocess plain text without losing
+various words like ‘divert’.
 
-   In 'm4', macro substitution is based on text, while in TeX, it is
-based on tokens.  'changeword' can throw this difference into relief.
-For example, here is the same idea represented in TeX and 'm4'.  First,
+   In ‘m4’, macro substitution is based on text, while in TeX, it is
+based on tokens.  ‘changeword’ can throw this difference into relief.
+For example, here is the same idea represented in TeX and ‘m4’.  First,
 the TeX version:
 
      \def\a{\message{Hello}}
@@ -3932,33 +3952,33 @@ the TeX version:
      \catcode`\\=12
      @a
      @bye
-     =>Hello
+     Hello
 
-Then, the 'm4' version:
+Then, the ‘m4’ version:
 
      ifdef(`changeword', `', `errprint(` skipping: no changeword support
      ')m4exit(`77')')dnl
      define(`a', `errprint(`Hello')')dnl
      changeword(`@\([_a-zA-Z0-9]*\)')
-     =>
+     ⇒
      @a
-     =>errprint(Hello)
+     errprint(Hello)
 
-   In the TeX example, the first line defines a macro 'a' to print the
-message 'Hello'.  The second line defines <@> to be usable instead of
+   In the TeX example, the first line defines a macro ‘a’ to print the
+message ‘Hello’.  The second line defines <@> to be usable instead of
 <\> as an escape character.  The third line defines <\> to be a normal
 printing character, not an escape.  The fourth line invokes the macro
-'a'.  So, when TeX is run on this file, it displays the message 'Hello'.
+‘a’.  So, when TeX is run on this file, it displays the message ‘Hello’.
 
-   When the 'm4' example is passed through 'm4', it outputs
-'errprint(Hello)'.  The reason for this is that TeX does lexical
-analysis of macro definition when the macro is _defined_.  'm4' just
+   When the ‘m4’ example is passed through ‘m4’, it outputs
+‘errprint(Hello)’.  The reason for this is that TeX does lexical
+analysis of macro definition when the macro is _defined_.  ‘m4’ just
 stores the text, postponing the lexical analysis until the macro is
 _used_.
 
-   You should note that using 'changeword' will slow 'm4' down by a
+   You should note that using ‘changeword’ will slow ‘m4’ down by a
 factor of about seven, once it is changed to something other than the
-default regular expression.  You can invoke 'changeword' with the empty
+default regular expression.  You can invoke ‘changeword’ with the empty
 string to restore the default word definition, and regain the parsing
 speed.
 
@@ -3968,121 +3988,121 @@ File: m4.info,  Node: M4wrap,  Prev: Changeword,  Up: Input Control
 8.5 Saving text until end of input
 ==================================
 
-It is possible to 'save' some text until the end of the normal input has
-been seen.  Text can be saved, to be read again by 'm4' when the normal
+It is possible to ‘save’ some text until the end of the normal input has
+been seen.  Text can be saved, to be read again by ‘m4’ when the normal
 input has been exhausted.  This feature is normally used to initiate
 cleanup actions before normal exit, e.g., deleting temporary files.
 
-   To save input text, use the builtin 'm4wrap':
+   To save input text, use the builtin ‘m4wrap’:
 
  -- Builtin: m4wrap (STRING, ...)
      Stores STRING in a safe place, to be reread when end of input is
      reached.  As a GNU extension, additional arguments are concatenated
      with a space to the STRING.
 
-     The expansion of 'm4wrap' is void.  The macro 'm4wrap' is
+     The expansion of ‘m4wrap’ is void.  The macro ‘m4wrap’ is
      recognized only with parameters.
 
      define(`cleanup', `This is the `cleanup' action.
      ')
-     =>
+     ⇒
      m4wrap(`cleanup')
-     =>
+     ⇒
      This is the first and last normal input line.
-     =>This is the first and last normal input line.
+     This is the first and last normal input line.
      ^D
-     =>This is the cleanup action.
+     This is the cleanup action.
 
    The saved input is only reread when the end of normal input is seen,
-and not if 'm4exit' is used to exit 'm4'.
+and not if ‘m4exit’ is used to exit ‘m4’.
 
-   It is safe to call 'm4wrap' from saved text, but then the order in
-which the saved text is reread is undefined.  If 'm4wrap' is not used
+   It is safe to call ‘m4wrap’ from saved text, but then the order in
+which the saved text is reread is undefined.  If ‘m4wrap’ is not used
 recursively, the saved pieces of text are reread in the opposite order
-in which they were saved (LIFO--last in, first out).  However, this
+in which they were saved (LIFOlast in, first out).  However, this
 behavior is likely to change in a future release, to match POSIX, so you
 should not depend on this order.
 
    It is possible to emulate POSIX behavior even with older versions of
-GNU M4 by including the file 'm4-1.4.18/examples/wrapfifo.m4' from the
+GNU M4 by including the file ‘m4-1.4.19/examples/wrapfifo.m4’ from the
 distribution:
 
      $ m4 -I examples
      undivert(`wrapfifo.m4')dnl
-     =>dnl Redefine m4wrap to have FIFO semantics.
-     =>define(`_m4wrap_level', `0')dnl
-     =>define(`m4wrap',
-     =>`ifdef(`m4wrap'_m4wrap_level,
-     =>       `define(`m4wrap'_m4wrap_level,
-     =>               defn(`m4wrap'_m4wrap_level)`$1')',
-     =>       `builtin(`m4wrap', `define(`_m4wrap_level',
-     =>                                  incr(_m4wrap_level))dnl
-     =>m4wrap'_m4wrap_level)dnl
-     =>define(`m4wrap'_m4wrap_level, `$1')')')dnl
+     dnl Redefine m4wrap to have FIFO semantics.
+     define(`_m4wrap_level', `0')dnl
+     define(`m4wrap',
+     `ifdef(`m4wrap'_m4wrap_level,
+            `define(`m4wrap'_m4wrap_level,
+                    defn(`m4wrap'_m4wrap_level)`$1')',
+            `builtin(`m4wrap', `define(`_m4wrap_level',
+                                       incr(_m4wrap_level))dnl
+     m4wrap'_m4wrap_level)dnl
+     define(`m4wrap'_m4wrap_level, `$1')')')dnl
      include(`wrapfifo.m4')
-     =>
+     ⇒
      m4wrap(`a`'m4wrap(`c
      ', `d')')m4wrap(`b')
-     =>
+     ⇒
      ^D
-     =>abc
+     abc
 
    It is likewise possible to emulate LIFO behavior without resorting to
-the GNU M4 extension of 'builtin', by including the file
-'m4-1.4.18/examples/wraplifo.m4' from the distribution.  (Unfortunately,
+the GNU M4 extension of ‘builtin’, by including the file
+‘m4-1.4.19/examples/wraplifo.m4’ from the distribution.  (Unfortunately,
 both examples shown here share some subtle bugs.  See if you can find
 and correct them; or *note Answers: Improved m4wrap.).
 
      $ m4 -I examples
      undivert(`wraplifo.m4')dnl
-     =>dnl Redefine m4wrap to have LIFO semantics.
-     =>define(`_m4wrap_level', `0')dnl
-     =>define(`_m4wrap', defn(`m4wrap'))dnl
-     =>define(`m4wrap',
-     =>`ifdef(`m4wrap'_m4wrap_level,
-     =>       `define(`m4wrap'_m4wrap_level,
-     =>               `$1'defn(`m4wrap'_m4wrap_level))',
-     =>       `_m4wrap(`define(`_m4wrap_level', incr(_m4wrap_level))dnl
-     =>m4wrap'_m4wrap_level)dnl
-     =>define(`m4wrap'_m4wrap_level, `$1')')')dnl
+     dnl Redefine m4wrap to have LIFO semantics.
+     define(`_m4wrap_level', `0')dnl
+     define(`_m4wrap', defn(`m4wrap'))dnl
+     define(`m4wrap',
+     `ifdef(`m4wrap'_m4wrap_level,
+            `define(`m4wrap'_m4wrap_level,
+                    `$1'defn(`m4wrap'_m4wrap_level))',
+            `_m4wrap(`define(`_m4wrap_level', incr(_m4wrap_level))dnl
+     m4wrap'_m4wrap_level)dnl
+     define(`m4wrap'_m4wrap_level, `$1')')')dnl
      include(`wraplifo.m4')
-     =>
+     ⇒
      m4wrap(`a`'m4wrap(`c
      ', `d')')m4wrap(`b')
-     =>
+     ⇒
      ^D
-     =>bac
+     bac
 
    Here is an example of implementing a factorial function using
-'m4wrap':
+‘m4wrap’:
 
      define(`f', `ifelse(`$1', `0', `Answer: 0!=1
      ', eval(`$1>1'), `0', `Answer: $2$1=eval(`$2$1')
      ', `m4wrap(`f(decr(`$1'), `$2$1*')')')')
-     =>
+     ⇒
      f(`10')
-     =>
+     ⇒
      ^D
-     =>Answer: 10*9*8*7*6*5*4*3*2*1=3628800
+     Answer: 10*9*8*7*6*5*4*3*2*1=3628800
 
-   Invocations of 'm4wrap' at the same recursion level are concatenated
+   Invocations of ‘m4wrap’ at the same recursion level are concatenated
 and rescanned as usual:
 
      define(`aa', `AA
      ')
-     =>
+     ⇒
      m4wrap(`a')m4wrap(`a')
-     =>
+     ⇒
      ^D
-     =>AA
+     AA
 
 however, the transition between recursion levels behaves like an end of
 file condition between two input files.
 
      m4wrap(`m4wrap(`)')len(abc')
-     =>
+     ⇒
      ^D
-     error->m4:stdin:1: ERROR: end of file in argument list
+     errorm4:stdin:1: ERROR: end of file in argument list
 
 \1f
 File: m4.info,  Node: File Inclusion,  Next: Diversions,  Prev: Input Control,  Up: Top
@@ -4090,7 +4110,7 @@ File: m4.info,  Node: File Inclusion,  Next: Diversions,  Prev: Input Control,
 9 File inclusion
 ****************
 
-'m4' allows you to include named files at any point in the input.
+‘m4’ allows you to include named files at any point in the input.
 
 * Menu:
 
@@ -4103,82 +4123,82 @@ File: m4.info,  Node: Include,  Next: Search Path,  Up: File Inclusion
 9.1 Including named files
 =========================
 
-There are two builtin macros in 'm4' for including files:
+There are two builtin macros in ‘m4’ for including files:
 
  -- Builtin: include (FILE)
  -- Builtin: sinclude (FILE)
-     Both macros cause the file named FILE to be read by 'm4'.  When the
+     Both macros cause the file named FILE to be read by ‘m4’.  When the
      end of the file is reached, input is resumed from the previous
      input file.
 
-     The expansion of 'include' and 'sinclude' is therefore the contents
+     The expansion of ‘include’ and ‘sinclude’ is therefore the contents
      of FILE.
 
      If FILE does not exist, is a directory, or cannot otherwise be
-     read, the expansion is void, and 'include' will fail with an error
-     while 'sinclude' is silent.  The empty string counts as a file that
+     read, the expansion is void, and ‘include’ will fail with an error
+     while ‘sinclude’ is silent.  The empty string counts as a file that
      does not exist.
 
-     The macros 'include' and 'sinclude' are recognized only with
+     The macros ‘include’ and ‘sinclude’ are recognized only with
      parameters.
 
      include(`none')
-     error->m4:stdin:1: cannot open `none': No such file or directory
-     =>
+     errorm4:stdin:1: cannot open `none': No such file or directory
+     ⇒
      include()
-     error->m4:stdin:2: cannot open `': No such file or directory
-     =>
+     errorm4:stdin:2: cannot open `': No such file or directory
+     ⇒
      sinclude(`none')
-     =>
+     ⇒
      sinclude()
-     =>
+     ⇒
 
-   The rest of this section assumes that 'm4' is invoked with the '-I'
+   The rest of this section assumes that ‘m4’ is invoked with the ‘-I’
 option (*note Invoking m4: Preprocessor features.) pointing to the
-'m4-1.4.18/examples' directory shipped as part of the GNU 'm4' package.
-The file 'm4-1.4.18/examples/incl.m4' in the distribution contains the
+‘m4-1.4.19/examples’ directory shipped as part of the GNU ‘m4’ package.
+The file ‘m4-1.4.19/examples/incl.m4’ in the distribution contains the
 lines:
 
      $ cat examples/incl.m4
-     =>Include file start
-     =>foo
-     =>Include file end
+     Include file start
+     foo
+     Include file end
 
    Normally file inclusion is used to insert the contents of a file into
-the input stream.  The contents of the file will be read by 'm4' and
+the input stream.  The contents of the file will be read by ‘m4’ and
 macro calls in the file will be expanded:
 
      $ m4 -I examples
      define(`foo', `FOO')
-     =>
+     ⇒
      include(`incl.m4')
-     =>Include file start
-     =>FOO
-     =>Include file end
-     =>
+     Include file start
+     FOO
+     Include file end
+     ⇒
 
-   The fact that 'include' and 'sinclude' expand to the contents of the
+   The fact that ‘include’ and ‘sinclude’ expand to the contents of the
 file can be used to define macros that operate on entire files.  Here is
-an example, which defines 'bar' to expand to the contents of 'incl.m4':
+an example, which defines ‘bar’ to expand to the contents of ‘incl.m4’:
 
      $ m4 -I examples
      define(`bar', include(`incl.m4'))
-     =>
+     ⇒
      This is `bar':  >>bar<<
-     =>This is bar:  >>Include file start
-     =>foo
-     =>Include file end
-     =><<
+     This is bar:  >>Include file start
+     foo
+     Include file end
+     <<
 
-   This use of 'include' is not trivial, though, as files can contain
+   This use of ‘include’ is not trivial, though, as files can contain
 quotes, commas, and parentheses, which can interfere with the way the
-'m4' parser works.  GNU 'm4' seamlessly concatenates the file contents
+‘m4’ parser works.  GNU ‘m4’ seamlessly concatenates the file contents
 with the next character, even if the included file ended in the middle
 of a comment, string, or macro call.  These conditions are only treated
 as end of file errors if specified as input files on the command line.
 
-   In GNU 'm4', an alternative method of reading files is using
-'undivert' (*note Undivert::) on a named file.
+   In GNU ‘m4’, an alternative method of reading files is using
+‘undivert’ (*note Undivert::) on a named file.
 
 \1f
 File: m4.info,  Node: Search Path,  Prev: Include,  Up: File Inclusion
@@ -4186,19 +4206,19 @@ File: m4.info,  Node: Search Path,  Prev: Include,  Up: File Inclusion
 9.2 Searching for include files
 ===============================
 
-GNU 'm4' allows included files to be found in other directories than the
+GNU ‘m4’ allows included files to be found in other directories than the
 current working directory.
 
-   If the '--prepend-include' or '-B' command-line option was provided
+   If the ‘--prepend-include’ or ‘-B’ command-line option was provided
 (*note Invoking m4: Preprocessor features.), those directories are
 searched first, in reverse order that those options were listed on the
-command line.  Then 'm4' looks in the current working directory.  Next
-comes the directories specified with the '--include' or '-I' option, in
-the order found on the command line.  Finally, if the 'M4PATH'
+command line.  Then ‘m4’ looks in the current working directory.  Next
+comes the directories specified with the ‘--include’ or ‘-I’ option, in
+the order found on the command line.  Finally, if the ‘M4PATH’
 environment variable is set, it is expected to contain a colon-separated
 list of directories, which will be searched in order.
 
-   If the automatic search for include-files causes trouble, the 'p'
+   If the automatic search for include-files causes trouble, the ‘p’
 debug flag (*note Debug Levels::) can help isolate the problem.
 
 \1f
@@ -4207,18 +4227,18 @@ File: m4.info,  Node: Diversions,  Next: Text handling,  Prev: File Inclusion,
 10 Diverting and undiverting output
 ***********************************
 
-Diversions are a way of temporarily saving output.  The output of 'm4'
+Diversions are a way of temporarily saving output.  The output of ‘m4’
 can at any time be diverted to a temporary file, and be reinserted into
-the output stream, "undiverted", again at a later time.
+the output stream, “undiverted”, again at a later time.
 
    Numbered diversions are counted from 0 upwards, diversion number 0
-being the normal output stream.  GNU 'm4' tries to keep diversions in
+being the normal output stream.  GNU ‘m4’ tries to keep diversions in
 memory.  However, there is a limit to the overall memory usable by all
 diversions taken together (512K, currently).  When this maximum is about
 to be exceeded, a temporary file is opened to receive the contents of
 the biggest diversion still in memory, freeing this memory for other
-diversions.  When creating the temporary file, 'm4' honors the value of
-the environment variable 'TMPDIR', and falls back to '/tmp'.  Thus, the
+diversions.  When creating the temporary file, ‘m4’ honors the value of
+the environment variable ‘TMPDIR’, and falls back to ‘/tmp’.  Thus, the
 amount of available disk space provides the only real limit on the
 number and aggregate size of diversions.
 
@@ -4227,7 +4247,7 @@ than the input was read.  It is possible to implement topological
 sorting dependencies.  For example, GNU Autoconf makes use of diversions
 under the hood to ensure that the expansion of a prerequisite macro
 appears in the output prior to the expansion of a dependent macro,
-regardless of which order the two macros were invoked in the user's
+regardless of which order the two macros were invoked in the users
 input file.
 
 * Menu:
@@ -4243,53 +4263,53 @@ File: m4.info,  Node: Divert,  Next: Undivert,  Up: Diversions
 10.1 Diverting output
 =====================
 
-Output is diverted using 'divert':
+Output is diverted using ‘divert’:
 
- -- Builtin: divert ([NUMBER = '0'])
+ -- Builtin: divert ([NUMBER = ‘0’])
      The current diversion is changed to NUMBER.  If NUMBER is left out
      or empty, it is assumed to be zero.  If NUMBER cannot be parsed,
      the diversion is unchanged.
 
-     The expansion of 'divert' is void.
+     The expansion of ‘divert’ is void.
 
-   When all the 'm4' input will have been processed, all existing
+   When all the ‘m4’ input will have been processed, all existing
 diversions are automatically undiverted, in numerical order.
 
      divert(`1')
      This text is diverted.
      divert
-     =>
+     ⇒
      This text is not diverted.
-     =>This text is not diverted.
+     This text is not diverted.
      ^D
-     =>
-     =>This text is diverted.
+     ⇒
+     This text is diverted.
 
-   Several calls of 'divert' with the same argument do not overwrite the
+   Several calls of ‘divert’ with the same argument do not overwrite the
 previous diverted text, but append to it.  Diversions are printed after
 any wrapped text is expanded.
 
      define(`text', `TEXT')
-     =>
+     ⇒
      divert(`1')`diverted text.'
      divert
-     =>
+     ⇒
      m4wrap(`Wrapped text precedes ')
-     =>
+     ⇒
      ^D
-     =>Wrapped TEXT precedes diverted text.
+     Wrapped TEXT precedes diverted text.
 
    If output is diverted to a negative diversion, it is simply
 discarded.  This can be used to suppress unwanted output.  A common
 example of unwanted output is the trailing newlines after macro
-definitions.  Here is a common programming idiom in 'm4' for avoiding
+definitions.  Here is a common programming idiom in ‘m4’ for avoiding
 them.
 
      divert(`-1')
      define(`foo', `Macro `foo'.')
      define(`bar', `Macro `bar'.')
      divert
-     =>
+     ⇒
 
    Traditional implementations only supported ten diversions.  But as a
 GNU extension, diversion numbers can be as large as positive integers
@@ -4299,26 +4319,26 @@ request to discard text.
      divert(eval(`1<<28'))world
      divert(`2')hello
      ^D
-     =>hello
-     =>world
+     hello
+     world
 
-   Note that 'divert' is an English word, but also an active macro
+   Note that ‘divert’ is an English word, but also an active macro
 without arguments.  When processing plain text, the word might appear in
 normal text and be unintentionally swallowed as a macro invocation.  One
-way to avoid this is to use the '-P' option to rename all builtins
+way to avoid this is to use the ‘-P’ option to rename all builtins
 (*note Invoking m4: Operation modes.).  Another is to write a wrapper
 that requires a parameter to be recognized.
 
      We decided to divert the stream for irrigation.
-     =>We decided to  the stream for irrigation.
+     We decided to  the stream for irrigation.
      define(`divert', `ifelse(`$#', `0', ``$0'', `builtin(`$0', $@)')')
-     =>
+     ⇒
      divert(`-1')
      Ignored text.
      divert(`0')
-     =>
+     ⇒
      We decided to divert the stream for irrigation.
-     =>We decided to divert the stream for irrigation.
+     We decided to divert the stream for irrigation.
 
 \1f
 File: m4.info,  Node: Undivert,  Next: Divnum,  Prev: Divert,  Up: Diversions
@@ -4326,7 +4346,7 @@ File: m4.info,  Node: Undivert,  Next: Divnum,  Prev: Divert,  Up: Diversions
 10.2 Undiverting output
 =======================
 
-Diverted text can be undiverted explicitly using the builtin 'undivert':
+Diverted text can be undiverted explicitly using the builtin ‘undivert’:
 
  -- Builtin: undivert ([DIVERSIONS...])
      Undiverts the numeric DIVERSIONS given by the arguments, in the
@@ -4338,24 +4358,24 @@ Diverted text can be undiverted explicitly using the builtin 'undivert':
      without expansion.  A warning is issued if a file could not be
      opened.
 
-     The expansion of 'undivert' is void.
+     The expansion of ‘undivert’ is void.
 
      divert(`1')
      This text is diverted.
      divert
-     =>
+     ⇒
      This text is not diverted.
-     =>This text is not diverted.
+     This text is not diverted.
      undivert(`1')
-     =>
-     =>This text is diverted.
-     =>
+     ⇒
+     This text is diverted.
+     ⇒
 
    Notice the last two blank lines.  One of them comes from the newline
-following 'undivert', the other from the newline that followed the
-'divert'!  A diversion often starts with a blank line like this.
+following ‘undivert’, the other from the newline that followed the
+‘divert’!  A diversion often starts with a blank line like this.
 
-   When diverted text is undiverted, it is _not_ reread by 'm4', but
+   When diverted text is undiverted, it is _not_ reread by ‘m4’, but
 rather copied directly to the current output, and it is therefore not an
 error to undivert into a diversion.  Undiverting the empty string is the
 same as specifying diversion 0; in either case nothing happens since the
@@ -4363,22 +4383,22 @@ output has already been flushed.
 
      divert(`1')diverted text
      divert
-     =>
+     ⇒
      undivert()
-     =>
+     ⇒
      undivert(`0')
-     =>
+     ⇒
      undivert
-     =>diverted text
-     =>
+     diverted text
+     ⇒
      divert(`1')more
      divert(`2')undivert(`1')diverted text`'divert
-     =>
+     ⇒
      undivert(`1')
-     =>
+     ⇒
      undivert(`2')
-     =>more
-     =>diverted text
+     more
+     diverted text
 
    When a diversion has been undiverted, the diverted text is discarded,
 and it is not possible to bring back diverted text more than once.
@@ -4386,15 +4406,15 @@ and it is not possible to bring back diverted text more than once.
      divert(`1')
      This text is diverted first.
      divert(`0')undivert(`1')dnl
-     =>
-     =>This text is diverted first.
+     ⇒
+     This text is diverted first.
      undivert(`1')
-     =>
+     ⇒
      divert(`1')
      This text is also diverted but not appended.
      divert(`0')undivert(`1')dnl
-     =>
-     =>This text is also diverted but not appended.
+     ⇒
+     This text is also diverted but not appended.
 
    Attempts to undivert the current diversion are silently ignored.
 Thus, when the current diversion is not 0, the current diversion does
@@ -4405,14 +4425,14 @@ not get rearranged among the other diversions.
      divert(`3')three
      divert(`2')undivert`'dnl
      divert`'undivert`'dnl
-     =>two
-     =>one
-     =>three
+     two
+     one
+     three
 
-   GNU 'm4' allows named files to be undiverted.  Given a non-numeric
+   GNU ‘m4’ allows named files to be undiverted.  Given a non-numeric
 argument, the contents of the file named will be copied, uninterpreted,
-to the current output.  This complements the builtin 'include' (*note
-Include::).  To illustrate the difference, assume the file 'foo'
+to the current output.  This complements the builtin ‘include’ (*note
+Include::).  To illustrate the difference, assume the file ‘foo’
 contains:
 
      $ cat foo
@@ -4421,13 +4441,13 @@ contains:
 then
 
      define(`bar', `BAR')
-     =>
+     ⇒
      undivert(`foo')
-     =>bar
-     =>
+     bar
+     ⇒
      include(`foo')
-     =>BAR
-     =>
+     BAR
+     ⇒
 
    If the file is not found (or cannot be read), an error message is
 issued, and the expansion is void.  It is possible to intermix files and
@@ -4438,10 +4458,10 @@ diversion numbers.
      divert(`3')diversion three
      divert`'dnl
      undivert(`1', `2', `foo', `3')dnl
-     =>diversion one
-     =>bar
-     =>bar
-     =>diversion three
+     diversion one
+     bar
+     bar
+     diversion three
 
 \1f
 File: m4.info,  Node: Divnum,  Next: Cleardivert,  Prev: Undivert,  Up: Diversions
@@ -4449,22 +4469,22 @@ File: m4.info,  Node: Divnum,  Next: Cleardivert,  Prev: Undivert,  Up: Diversio
 10.3 Diversion numbers
 ======================
 
-The current diversion is tracked by the builtin 'divnum':
+The current diversion is tracked by the builtin ‘divnum’:
 
  -- Builtin: divnum
      Expands to the number of the current diversion.
 
      Initial divnum
-     =>Initial 0
+     Initial 0
      divert(`1')
      Diversion one: divnum
      divert(`2')
      Diversion two: divnum
      ^D
-     =>
-     =>Diversion one: 1
-     =>
-     =>Diversion two: 2
+     ⇒
+     Diversion one: 1
+     ⇒
+     Diversion two: 2
 
 \1f
 File: m4.info,  Node: Cleardivert,  Prev: Divnum,  Up: Diversions
@@ -4476,8 +4496,8 @@ Often it is not known, when output is diverted, whether the diverted
 text is actually needed.  Since all non-empty diversion are brought back
 on the main output stream when the end of input is seen, a method of
 discarding a diversion is needed.  If all diversions should be
-discarded, the easiest is to end the input to 'm4' with 'divert(`-1')'
-followed by an explicit 'undivert':
+discarded, the easiest is to end the input to ‘m4’ with ‘divert(`-1')’
+followed by an explicit ‘undivert’:
 
      divert(`1')
      Diversion one: divnum
@@ -4496,9 +4516,9 @@ No output is produced at all.
 
      define(`cleardivert',
      `pushdef(`_n', divnum)divert(`-1')undivert($@)divert(_n)popdef(`_n')')
-     =>
+     ⇒
 
-   It is called just like 'undivert', but the effect is to clear the
+   It is called just like ‘undivert’, but the effect is to clear the
 diversions, given by the arguments.  (This macro has a nasty bug!  You
 should try to see if you can find it and correct it; or *note Answers:
 Improved cleardivert.).
@@ -4509,7 +4529,7 @@ File: m4.info,  Node: Text handling,  Next: Arithmetic,  Prev: Diversions,  Up:
 11 Macros for text handling
 ***************************
 
-There are a number of builtins in 'm4' for manipulating text in various
+There are a number of builtins in ‘m4’ for manipulating text in various
 ways, extracting substrings, searching, substituting, and so on.
 
 * Menu:
@@ -4528,17 +4548,17 @@ File: m4.info,  Node: Len,  Next: Index macro,  Up: Text handling
 11.1 Calculating length of strings
 ==================================
 
-The length of a string can be calculated by 'len':
+The length of a string can be calculated by ‘len’:
 
  -- Builtin: len (STRING)
      Expands to the length of STRING, as a decimal number.
 
-     The macro 'len' is recognized only with parameters.
+     The macro ‘len’ is recognized only with parameters.
 
      len()
-     =>0
+     0
      len(`abcdef')
-     =>6
+     6
 
 \1f
 File: m4.info,  Node: Index macro,  Next: Regexp,  Prev: Len,  Up: Text handling
@@ -4546,30 +4566,30 @@ File: m4.info,  Node: Index macro,  Next: Regexp,  Prev: Len,  Up: Text handling
 11.2 Searching for substrings
 =============================
 
-Searching for substrings is done with 'index':
+Searching for substrings is done with ‘index’:
 
  -- Builtin: index (STRING, SUBSTRING)
      Expands to the index of the first occurrence of SUBSTRING in
      STRING.  The first character in STRING has index 0.  If SUBSTRING
-     does not occur in STRING, 'index' expands to '-1'.
+     does not occur in STRING, ‘index’ expands to ‘-1’.
 
-     The macro 'index' is recognized only with parameters.
+     The macro ‘index’ is recognized only with parameters.
 
      index(`gnus, gnats, and armadillos', `nat')
-     =>7
+     7
      index(`gnus, gnats, and armadillos', `dag')
-     =>-1
+     -1
 
    Omitting SUBSTRING evokes a warning, but still produces output;
 contrast this with an empty SUBSTRING.
 
      index(`abc')
-     error->m4:stdin:1: Warning: too few arguments to builtin `index'
-     =>0
+     errorm4:stdin:1: Warning: too few arguments to builtin `index'
+     0
      index(`abc', `')
-     =>0
+     0
      index(`abc', `b')
-     =>1
+     1
 
 \1f
 File: m4.info,  Node: Regexp,  Next: Substr,  Prev: Index macro,  Up: Text handling
@@ -4577,7 +4597,7 @@ File: m4.info,  Node: Regexp,  Next: Substr,  Prev: Index macro,  Up: Text handl
 11.3 Searching for regular expressions
 ======================================
 
-Searching for regular expressions is done with the builtin 'regexp':
+Searching for regular expressions is done with the builtin ‘regexp’:
 
  -- Builtin: regexp (STRING, REGEXP, [REPLACEMENT])
      Searches for REGEXP in STRING.  The syntax for regular expressions
@@ -4586,55 +4606,55 @@ Searching for regular expressions is done with the builtin 'regexp':
      (emacs)Regexps.  Support for ERE, Extended Regular Expressions is
      not available, but will be added in GNU M4 2.0.
 
-     If REPLACEMENT is omitted, 'regexp' expands to the index of the
+     If REPLACEMENT is omitted, ‘regexp’ expands to the index of the
      first match of REGEXP in STRING.  If REGEXP does not match anywhere
      in STRING, it expands to -1.
 
-     If REPLACEMENT is supplied, and there was a match, 'regexp' changes
-     the expansion to this argument, with '\N' substituted by the text
+     If REPLACEMENT is supplied, and there was a match, ‘regexp’ changes
+     the expansion to this argument, with ‘\N’ substituted by the text
      matched by the Nth parenthesized sub-expression of REGEXP, up to
-     nine sub-expressions.  The escape '\&' is replaced by the text of
+     nine sub-expressions.  The escape ‘\&’ is replaced by the text of
      the entire regular expression matched.  For all other characters,
-     '\' treats the next character literally.  A warning is issued if
-     there were fewer sub-expressions than the '\N' requested, or if
-     there is a trailing '\'.  If there was no match, 'regexp' expands
+     ‘\’ treats the next character literally.  A warning is issued if
+     there were fewer sub-expressions than the ‘\N’ requested, or if
+     there is a trailing ‘\’.  If there was no match, ‘regexp’ expands
      to the empty string.
 
-     The macro 'regexp' is recognized only with parameters.
+     The macro ‘regexp’ is recognized only with parameters.
 
      regexp(`GNUs not Unix', `\<[a-z]\w+')
-     =>5
+     5
      regexp(`GNUs not Unix', `\<Q\w*')
-     =>-1
+     -1
      regexp(`GNUs not Unix', `\w\(\w+\)$', `*** \& *** \1 ***')
-     =>*** Unix *** nix ***
+     *** Unix *** nix ***
      regexp(`GNUs not Unix', `\<Q\w*', `*** \& *** \1 ***')
-     =>
+     ⇒
 
    Here are some more examples on the handling of backslash:
 
      regexp(`abc', `\(b\)', `\\\10\a')
-     =>\b0a
+     \b0a
      regexp(`abc', `b', `\1\')
-     error->m4:stdin:2: Warning: sub-expression 1 not present
-     error->m4:stdin:2: Warning: trailing \ ignored in replacement
-     =>
+     errorm4:stdin:2: Warning: sub-expression 1 not present
+     errorm4:stdin:2: Warning: trailing \ ignored in replacement
+     ⇒
      regexp(`abc', `\(\(d\)?\)\(c\)', `\1\2\3\4\5\6')
-     error->m4:stdin:3: Warning: sub-expression 4 not present
-     error->m4:stdin:3: Warning: sub-expression 5 not present
-     error->m4:stdin:3: Warning: sub-expression 6 not present
-     =>c
+     errorm4:stdin:3: Warning: sub-expression 4 not present
+     errorm4:stdin:3: Warning: sub-expression 5 not present
+     errorm4:stdin:3: Warning: sub-expression 6 not present
+     c
 
    Omitting REGEXP evokes a warning, but still produces output; contrast
 this with an empty REGEXP argument.
 
      regexp(`abc')
-     error->m4:stdin:1: Warning: too few arguments to builtin `regexp'
-     =>0
+     errorm4:stdin:1: Warning: too few arguments to builtin `regexp'
+     0
      regexp(`abc', `')
-     =>0
+     0
      regexp(`abc', `', `\\def')
-     =>\def
+     \def
 
 \1f
 File: m4.info,  Node: Substr,  Next: Translit,  Prev: Regexp,  Up: Text handling
@@ -4642,7 +4662,7 @@ File: m4.info,  Node: Substr,  Next: Translit,  Prev: Regexp,  Up: Text handling
 11.4 Extracting substrings
 ==========================
 
-Substrings are extracted with 'substr':
+Substrings are extracted with ‘substr’:
 
  -- Builtin: substr (STRING, FROM, [LENGTH])
      Expands to the substring of STRING, which starts at index FROM, and
@@ -4651,21 +4671,21 @@ Substrings are extracted with 'substr':
      expansion is empty if there is an error parsing FROM or LENGTH, if
      FROM is beyond the end of STRING, or if LENGTH is negative.
 
-     The macro 'substr' is recognized only with parameters.
+     The macro ‘substr’ is recognized only with parameters.
 
      substr(`gnus, gnats, and armadillos', `6')
-     =>gnats, and armadillos
+     gnats, and armadillos
      substr(`gnus, gnats, and armadillos', `6', `5')
-     =>gnats
+     gnats
 
    Omitting FROM evokes a warning, but still produces output.
 
      substr(`abc')
-     error->m4:stdin:1: Warning: too few arguments to builtin `substr'
-     =>abc
+     errorm4:stdin:1: Warning: too few arguments to builtin `substr'
+     abc
      substr(`abc',)
-     error->m4:stdin:2: empty string treated as 0 in builtin `substr'
-     =>abc
+     errorm4:stdin:2: empty string treated as 0 in builtin `substr'
+     abc
 
 \1f
 File: m4.info,  Node: Translit,  Next: Patsubst,  Prev: Substr,  Up: Text handling
@@ -4673,7 +4693,7 @@ File: m4.info,  Node: Translit,  Next: Patsubst,  Prev: Substr,  Up: Text handli
 11.5 Translating characters
 ===========================
 
-Character translation is done with 'translit':
+Character translation is done with ‘translit’:
 
  -- Builtin: translit (STRING, CHARS, [REPLACEMENT])
      Expands to STRING, with each character that occurs in CHARS
@@ -4689,44 +4709,44 @@ Character translation is done with 'translit':
      characters in REPLACEMENT also appear in CHARS.
 
      As a GNU extension, both CHARS and REPLACEMENT can contain
-     character-ranges, e.g., 'a-z' (meaning all lowercase letters) or
-     '0-9' (meaning all digits).  To include a dash '-' in CHARS or
+     character-ranges, e.g., ‘a-z’ (meaning all lowercase letters) or
+     ‘0-9’ (meaning all digits).  To include a dash ‘-’ in CHARS or
      REPLACEMENT, place it first or last in the entire string, or as the
      last character of a range.  Back-to-back ranges can share a common
      endpoint.  It is not an error for the last character in the range
-     to be 'larger' than the first.  In that case, the range runs
-     backwards, i.e., '9-0' means the string '9876543210'.  The
+     to be ‘larger’ than the first.  In that case, the range runs
+     backwards, i.e., ‘9-0’ means the string ‘9876543210’.  The
      expansion of a range is dependent on the underlying encoding of
      characters, so using ranges is not always portable between
      machines.
 
-     The macro 'translit' is recognized only with parameters.
+     The macro ‘translit’ is recognized only with parameters.
 
      translit(`GNUs not Unix', `A-Z')
-     =>s not nix
+     s not nix
      translit(`GNUs not Unix', `a-z', `A-Z')
-     =>GNUS NOT UNIX
+     GNUS NOT UNIX
      translit(`GNUs not Unix', `A-Z', `z-a')
-     =>tmfs not fnix
+     tmfs not fnix
      translit(`+,-12345', `+--1-5', `<;>a-c-a')
-     =><;>abcba
+     <;>abcba
      translit(`abcdef', `aabdef', `bcged')
-     =>bgced
+     bgced
 
    In the ASCII encoding, the first example deletes all uppercase
 letters, the second converts lowercase to uppercase, and the third
-'mirrors' all uppercase letters, while converting them to lowercase.
+‘mirrors’ all uppercase letters, while converting them to lowercase.
 The two first cases are by far the most common, even though they are not
 portable to EBCDIC or other encodings.  The fourth example shows a range
-ending in '-', as well as back-to-back ranges.  The final example shows
-that 'a' is mapped to 'b', not 'c'; the resulting 'b' is not further
-remapped to 'g'; the 'd' and 'e' are swapped, and the 'f' is discarded.
+ending in ‘-’, as well as back-to-back ranges.  The final example shows
+that ‘a’ is mapped to ‘b’, not ‘c’; the resulting ‘b’ is not further
+remapped to ‘g’; the ‘d’ and ‘e’ are swapped, and the ‘f’ is discarded.
 
    Omitting CHARS evokes a warning, but still produces output.
 
      translit(`abc')
-     error->m4:stdin:1: Warning: too few arguments to builtin `translit'
-     =>abc
+     errorm4:stdin:1: Warning: too few arguments to builtin `translit'
+     abc
 
 \1f
 File: m4.info,  Node: Patsubst,  Next: Format,  Prev: Translit,  Up: Text handling
@@ -4734,7 +4754,7 @@ File: m4.info,  Node: Patsubst,  Next: Format,  Prev: Translit,  Up: Text handli
 11.6 Substituting text by regular expression
 ============================================
 
-Global substitution in a string is done by 'patsubst':
+Global substitution in a string is done by ‘patsubst’:
 
  -- Builtin: patsubst (STRING, REGEXP, [REPLACEMENT])
      Searches STRING for matches of REGEXP, and substitutes REPLACEMENT
@@ -4749,104 +4769,104 @@ Global substitution in a string is done by 'patsubst':
      infinite loops.
 
      When a replacement is to be made, REPLACEMENT is inserted into the
-     expansion, with '\N' substituted by the text matched by the Nth
+     expansion, with ‘\N’ substituted by the text matched by the Nth
      parenthesized sub-expression of PATSUBST, for up to nine
-     sub-expressions.  The escape '\&' is replaced by the text of the
-     entire regular expression matched.  For all other characters, '\'
+     sub-expressions.  The escape ‘\&’ is replaced by the text of the
+     entire regular expression matched.  For all other characters, ‘\’
      treats the next character literally.  A warning is issued if there
-     were fewer sub-expressions than the '\N' requested, or if there is
-     a trailing '\'.
+     were fewer sub-expressions than the ‘\N’ requested, or if there is
+     a trailing ‘\’.
 
      The REPLACEMENT argument can be omitted, in which case the text
      matched by REGEXP is deleted.
 
-     The macro 'patsubst' is recognized only with parameters.
+     The macro ‘patsubst’ is recognized only with parameters.
 
      patsubst(`GNUs not Unix', `^', `OBS: ')
-     =>OBS: GNUs not Unix
+     OBS: GNUs not Unix
      patsubst(`GNUs not Unix', `\<', `OBS: ')
-     =>OBS: GNUs OBS: not OBS: Unix
+     OBS: GNUs OBS: not OBS: Unix
      patsubst(`GNUs not Unix', `\w*', `(\&)')
-     =>(GNUs)() (not)() (Unix)()
+     (GNUs)() (not)() (Unix)()
      patsubst(`GNUs not Unix', `\w+', `(\&)')
-     =>(GNUs) (not) (Unix)
+     (GNUs) (not) (Unix)
      patsubst(`GNUs not Unix', `[A-Z][a-z]+')
-     =>GN not 
+     GN not 
      patsubst(`GNUs not Unix', `not', `NOT\')
-     error->m4:stdin:6: Warning: trailing \ ignored in replacement
-     =>GNUs NOT Unix
+     errorm4:stdin:6: Warning: trailing \ ignored in replacement
+     GNUs NOT Unix
 
    Here is a slightly more realistic example, which capitalizes
 individual words or whole sentences, by substituting calls of the macros
-'upcase' and 'downcase' into the strings.
+‘upcase’ and ‘downcase’ into the strings.
 
  -- Composite: upcase (TEXT)
  -- Composite: downcase (TEXT)
  -- Composite: capitalize (TEXT)
-     Expand to TEXT, but with capitalization changed: 'upcase' changes
-     all letters to upper case, 'downcase' changes all letters to lower
-     case, and 'capitalize' changes the first character of each word to
+     Expand to TEXT, but with capitalization changed: ‘upcase’ changes
+     all letters to upper case, ‘downcase’ changes all letters to lower
+     case, and ‘capitalize’ changes the first character of each word to
      upper case and the remaining characters to lower case.
 
    First, an example of their usage, using implementations distributed
-in 'm4-1.4.18/examples/capitalize.m4'.
+in ‘m4-1.4.19/examples/capitalize.m4’.
 
      $ m4 -I examples
      include(`capitalize.m4')
-     =>
+     ⇒
      upcase(`GNUs not Unix')
-     =>GNUS NOT UNIX
+     GNUS NOT UNIX
      downcase(`GNUs not Unix')
-     =>gnus not unix
+     gnus not unix
      capitalize(`GNUs not Unix')
-     =>Gnus Not Unix
+     Gnus Not Unix
 
-   Now for the implementation.  There is a helper macro '_capitalize'
-which puts only its first word in mixed case.  Then 'capitalize' merely
+   Now for the implementation.  There is a helper macro ‘_capitalize’
+which puts only its first word in mixed case.  Then ‘capitalize’ merely
 parses out the words, and replaces them with an invocation of
-'_capitalize'.  (As presented here, the 'capitalize' macro has some
+‘_capitalize’.  (As presented here, the ‘capitalize’ macro has some
 subtle flaws.  You should try to see if you can find and correct them;
 or *note Answers: Improved capitalize.).
 
      $ m4 -I examples
      undivert(`capitalize.m4')dnl
-     =>divert(`-1')
-     =># upcase(text)
-     =># downcase(text)
-     =># capitalize(text)
-     =>#   change case of text, simple version
-     =>define(`upcase', `translit(`$*', `a-z', `A-Z')')
-     =>define(`downcase', `translit(`$*', `A-Z', `a-z')')
-     =>define(`_capitalize',
-     =>       `regexp(`$1', `^\(\w\)\(\w*\)',
-     =>               `upcase(`\1')`'downcase(`\2')')')
-     =>define(`capitalize', `patsubst(`$1', `\w+', `_$0(`\&')')')
-     =>divert`'dnl
-
-   While 'regexp' replaces the whole input with the replacement as soon
-as there is a match, 'patsubst' replaces each _occurrence_ of a match
+     divert(`-1')
+     # upcase(text)
+     # downcase(text)
+     # capitalize(text)
+     #   change case of text, simple version
+     define(`upcase', `translit(`$*', `a-z', `A-Z')')
+     define(`downcase', `translit(`$*', `A-Z', `a-z')')
+     define(`_capitalize',
+            `regexp(`$1', `^\(\w\)\(\w*\)',
+                    `upcase(`\1')`'downcase(`\2')')')
+     define(`capitalize', `patsubst(`$1', `\w+', `_$0(`\&')')')
+     divert`'dnl
+
+   While ‘regexp’ replaces the whole input with the replacement as soon
+as there is a match, ‘patsubst’ replaces each _occurrence_ of a match
 and preserves non-matching pieces:
 
      define(`patreg',
      `patsubst($@)
      regexp($@)')dnl
      patreg(`bar foo baz Foo', `foo\|Foo', `FOO')
-     =>bar FOO baz FOO
-     =>FOO
+     bar FOO baz FOO
+     FOO
      patreg(`aba abb 121', `\(.\)\(.\)\1', `\2\1\2')
-     =>bab abb 212
-     =>bab
+     bab abb 212
+     bab
 
    Omitting REGEXP evokes a warning, but still produces output; contrast
 this with an empty REGEXP argument.
 
      patsubst(`abc')
-     error->m4:stdin:1: Warning: too few arguments to builtin `patsubst'
-     =>abc
+     errorm4:stdin:1: Warning: too few arguments to builtin `patsubst'
+     abc
      patsubst(`abc', `')
-     =>abc
+     abc
      patsubst(`abc', `', `\\-')
-     =>\-a\-b\-c\-
+     \-a\-b\-c\-
 
 \1f
 File: m4.info,  Node: Format,  Prev: Patsubst,  Up: Text handling
@@ -4854,81 +4874,81 @@ File: m4.info,  Node: Format,  Prev: Patsubst,  Up: Text handling
 11.7 Formatting strings (printf-like)
 =====================================
 
-Formatted output can be made with 'format':
+Formatted output can be made with ‘format’:
 
  -- Builtin: format (FORMAT-STRING, ...)
-     Works much like the C function 'printf'.  The first argument
-     FORMAT-STRING can contain '%' specifications which are satisfied by
-     additional arguments, and the expansion of 'format' is the
+     Works much like the C function ‘printf’.  The first argument
+     FORMAT-STRING can contain ‘%’ specifications which are satisfied by
+     additional arguments, and the expansion of ‘format’ is the
      formatted string.
 
-     The macro 'format' is recognized only with parameters.
+     The macro ‘format’ is recognized only with parameters.
 
    Its use is best described by a few examples:
 
      define(`foo', `The brown fox jumped over the lazy dog')
-     =>
+     ⇒
      format(`The string "%s" uses %d characters', foo, len(foo))
-     =>The string "The brown fox jumped over the lazy dog" uses 38 characters
+     The string "The brown fox jumped over the lazy dog" uses 38 characters
      format(`%*.*d', `-1', `-1', `1')
-     =>1
+     1
      format(`%.0f', `56789.9876')
-     =>56790
+     56790
      len(format(`%-*X', `5000', `1'))
-     =>5000
+     5000
      ifelse(format(`%010F', `infinity'), `       INF', `success',
             format(`%010F', `infinity'), `  INFINITY', `success',
             format(`%010F', `infinity'))
-     =>success
+     success
      ifelse(format(`%.1A', `1.999'), `0X1.0P+1', `success',
             format(`%.1A', `1.999'), `0X2.0P+0', `success',
             format(`%.1A', `1.999'))
-     =>success
+     success
      format(`%g', `0xa.P+1')
-     =>20
+     20
 
-   Using the 'forloop' macro defined earlier (*note Forloop::), this
-example shows how 'format' can be used to produce tabular output.
+   Using the ‘forloop’ macro defined earlier (*note Forloop::), this
+example shows how ‘format’ can be used to produce tabular output.
 
      $ m4 -I examples
      include(`forloop.m4')
-     =>
+     ⇒
      forloop(`i', `1', `10', `format(`%6d squared is %10d
      ', i, eval(i**2))')
-     =>     1 squared is          1
-     =>     2 squared is          4
-     =>     3 squared is          9
-     =>     4 squared is         16
-     =>     5 squared is         25
-     =>     6 squared is         36
-     =>     7 squared is         49
-     =>     8 squared is         64
-     =>     9 squared is         81
-     =>    10 squared is        100
-     =>
-
-   The builtin 'format' is modeled after the ANSI C 'printf' function,
-and supports these '%' specifiers: 'c', 's', 'd', 'o', 'x', 'X', 'u',
-'a', 'A', 'e', 'E', 'f', 'F', 'g', 'G', and '%'; it supports field
-widths and precisions, and the flags '+', '-', ' ', '0', '#', and '''.
-For integer specifiers, the width modifiers 'hh', 'h', and 'l' are
-recognized, and for floating point specifiers, the width modifier 'l' is
+          1 squared is          1
+          2 squared is          4
+          3 squared is          9
+          4 squared is         16
+          5 squared is         25
+          6 squared is         36
+          7 squared is         49
+          8 squared is         64
+          9 squared is         81
+         10 squared is        100
+     ⇒
+
+   The builtin ‘format’ is modeled after the ANSI C ‘printf’ function,
+and supports these ‘%’ specifiers: ‘c’, ‘s’, ‘d’, ‘o’, ‘x’, ‘X’, ‘u’,
+‘a’, ‘A’, ‘e’, ‘E’, ‘f’, ‘F’, ‘g’, ‘G’, and ‘%’; it supports field
+widths and precisions, and the flags ‘+’, ‘-’, ‘ ’, ‘0’, ‘#’, and ‘'’.
+For integer specifiers, the width modifiers ‘hh’, ‘h’, and ‘l’ are
+recognized, and for floating point specifiers, the width modifier ‘l’ is
 recognized.  Items not yet supported include positional arguments, the
-'n', 'p', 'S', and 'C' specifiers, the 'z', 't', 'j', 'L' and 'll'
-modifiers, and any platform extensions available in the native 'printf'.
-For more details on the functioning of 'printf', see the C Library
-Manual, or the POSIX specification (for example, '%a' is supported even
-on platforms that haven't yet implemented C99 hexadecimal floating point
+‘n’, ‘p’, ‘S’, and ‘C’ specifiers, the ‘z’, ‘t’, ‘j’, ‘L’ and ‘ll’
+modifiers, and any platform extensions available in the native ‘printf’.
+For more details on the functioning of ‘printf’, see the C Library
+Manual, or the POSIX specification (for example, ‘%a’ is supported even
+on platforms that havent yet implemented C99 hexadecimal floating point
 output natively).
 
    Unrecognized specifiers result in a warning.  It is anticipated that
-a future release of GNU 'm4' will support more specifiers, and give
+a future release of GNU ‘m4’ will support more specifiers, and give
 better warnings when various problems such as overflow are encountered.
 Likewise, escape sequences are not yet recognized.
 
      format(`%p', `0')
-     error->m4:stdin:1: Warning: unrecognized specifier in `%p'
-     =>
+     errorm4:stdin:1: Warning: unrecognized specifier in `%p'
+     ⇒
 
 \1f
 File: m4.info,  Node: Arithmetic,  Next: Shell commands,  Prev: Text handling,  Up: Top
@@ -4936,7 +4956,7 @@ File: m4.info,  Node: Arithmetic,  Next: Shell commands,  Prev: Text handling,
 12 Macros for doing arithmetic
 ******************************
 
-Integer arithmetic is included in 'm4', with a C-like syntax.  As
+Integer arithmetic is included in ‘m4’, with a C-like syntax.  As
 convenient shorthands, there are builtins for simple increment and
 decrement operations.
 
@@ -4952,7 +4972,7 @@ File: m4.info,  Node: Incr,  Next: Eval,  Up: Arithmetic
 ======================================
 
 Increment and decrement of integers are supported using the builtins
-'incr' and 'decr':
+‘incr’ and ‘decr’:
 
  -- Builtin: incr (NUMBER)
  -- Builtin: decr (NUMBER)
@@ -4960,18 +4980,18 @@ Increment and decrement of integers are supported using the builtins
      decremented, respectively, by one.  Except for the empty string,
      the expansion is empty if NUMBER could not be parsed.
 
-     The macros 'incr' and 'decr' are recognized only with parameters.
+     The macros ‘incr’ and ‘decr’ are recognized only with parameters.
 
      incr(`4')
-     =>5
+     5
      decr(`7')
-     =>6
+     6
      incr()
-     error->m4:stdin:3: empty string treated as 0 in builtin `incr'
-     =>1
+     errorm4:stdin:3: empty string treated as 0 in builtin `incr'
+     1
      decr()
-     error->m4:stdin:4: empty string treated as 0 in builtin `decr'
-     =>-1
+     errorm4:stdin:4: empty string treated as 0 in builtin `decr'
+     -1
 
 \1f
 File: m4.info,  Node: Eval,  Prev: Incr,  Up: Arithmetic
@@ -4979,9 +4999,9 @@ File: m4.info,  Node: Eval,  Prev: Incr,  Up: Arithmetic
 12.2 Evaluating integer expressions
 ===================================
 
-Integer expressions are evaluated with 'eval':
+Integer expressions are evaluated with ‘eval’:
 
- -- Builtin: eval (EXPRESSION, [RADIX = '10'], [WIDTH])
+ -- Builtin: eval (EXPRESSION, [RADIX = ‘10’], [WIDTH])
      Expands to the value of EXPRESSION.  The expansion is empty if a
      problem is encountered while parsing the arguments.  If specified,
      RADIX and WIDTH control the format of the output.
@@ -4993,63 +5013,63 @@ Integer expressions are evaluated with 'eval':
      Expressions can contain the following operators, listed in order of
      decreasing precedence.
 
-     '()'
+     ‘()’
           Parentheses
-     '+ - ~ !'
+     ‘+ - ~ !’
           Unary plus and minus, and bitwise and logical negation
-     '**'
+     ‘**’
           Exponentiation
-     '* / %'
+     ‘* / %’
           Multiplication, division, and modulo
-     '+ -'
+     ‘+ -’
           Addition and subtraction
-     '<< >>'
+     ‘<< >>’
           Shift left or right
-     '> >= < <='
+     ‘> >= < <=’
           Relational operators
-     '== !='
+     ‘== !=’
           Equality operators
-     '&'
+     ‘&’
           Bitwise and
-     '^'
+     ‘^’
           Bitwise exclusive-or
-     '|'
+     ‘|’
           Bitwise or
-     '&&'
+     ‘&&’
           Logical and
-     '||'
+     ‘||’
           Logical or
 
-     The macro 'eval' is recognized only with parameters.
+     The macro ‘eval’ is recognized only with parameters.
 
    All binary operators, except exponentiation, are left associative.  C
-operators that perform variable assignment, such as '+=' or '--', are
-not implemented, since 'eval' only operates on constants, not variables.
+operators that perform variable assignment, such as ‘+=’ or ‘--’, are
+not implemented, since ‘eval’ only operates on constants, not variables.
 Attempting to use them results in an error.  However, since traditional
-implementations treated '=' as an undocumented alias for '==' as opposed
+implementations treated ‘=’ as an undocumented alias for ‘==’ as opposed
 to an assignment operator, this usage is supported as a special case.
 Be aware that a future version of GNU M4 may support assignment
 semantics as an extension when POSIX mode is not requested, and that
-using '=' to check equality is not portable.
+using ‘=’ to check equality is not portable.
 
      eval(`2 = 2')
-     error->m4:stdin:1: Warning: recommend ==, not =, for equality operator
-     =>1
+     errorm4:stdin:1: Warning: recommend ==, not =, for equality operator
+     1
      eval(`++0')
-     error->m4:stdin:2: invalid operator in eval: ++0
-     =>
+     errorm4:stdin:2: invalid operator in eval: ++0
+     ⇒
      eval(`0 |= 1')
-     error->m4:stdin:3: invalid operator in eval: 0 |= 1
-     =>
+     errorm4:stdin:3: invalid operator in eval: 0 |= 1
+     ⇒
 
-   Note that some older 'm4' implementations use '^' as an alternate
+   Note that some older ‘m4’ implementations use ‘^’ as an alternate
 operator for the exponentiation, although POSIX requires the C behavior
-of bitwise exclusive-or.  The precedence of the negation operators, '~'
-and '!', was traditionally lower than equality.  The unary operators
+of bitwise exclusive-or.  The precedence of the negation operators, ‘~’
+and ‘!’, was traditionally lower than equality.  The unary operators
 could not be used reliably more than once on the same term without
 intervening parentheses.  The traditional precedence of the equality
-operators '==' and '!=' was identical instead of lower than the
-relational operators such as '<', even through GNU M4 1.4.8.  Starting
+operators ‘==’ and ‘!=’ was identical instead of lower than the
+relational operators such as ‘<’, even through GNU M4 1.4.8.  Starting
 with version 1.4.9, GNU M4 correctly follows POSIX precedence rules.  M4
 scripts designed to be portable between releases must be aware that
 parentheses may be required to enforce C precedence rules.  Likewise,
@@ -5058,163 +5078,163 @@ operator, is not always well-defined in other implementations.
 
    Following are some examples where the current version of M4 follows C
 precedence rules, but where older versions and some other
-implementations of 'm4' require explicit parentheses to get the correct
+implementations of ‘m4’ require explicit parentheses to get the correct
 result:
 
      eval(`1 == 2 > 0')
-     =>1
+     1
      eval(`(1 == 2) > 0')
-     =>0
+     0
      eval(`! 0 * 2')
-     =>2
+     2
      eval(`! (0 * 2)')
-     =>1
+     1
      eval(`1 | 1 ^ 1')
-     =>1
+     1
      eval(`(1 | 1) ^ 1')
-     =>0
+     0
      eval(`+ + - ~ ! ~ 0')
-     =>1
+     1
      eval(`2 || 1 / 0')
-     =>1
+     1
      eval(`0 || 1 / 0')
-     error->m4:stdin:9: divide by zero in eval: 0 || 1 / 0
-     =>
+     errorm4:stdin:9: divide by zero in eval: 0 || 1 / 0
+     ⇒
      eval(`0 && 1 % 0')
-     =>0
+     0
      eval(`2 && 1 % 0')
-     error->m4:stdin:11: modulo by zero in eval: 2 && 1 % 0
-     =>
+     errorm4:stdin:11: modulo by zero in eval: 2 && 1 % 0
+     ⇒
 
-   As a GNU extension, the operator '**' performs integral
+   As a GNU extension, the operator ‘**’ performs integral
 exponentiation.  The operator is right-associative, and if evaluated,
 the exponent must be non-negative, and at least one of the arguments
 must be non-zero, or a warning is issued.
 
      eval(`2 ** 3 ** 2')
-     =>512
+     512
      eval(`(2 ** 3) ** 2')
-     =>64
+     64
      eval(`0 ** 1')
-     =>0
+     0
      eval(`2 ** 0')
-     =>1
+     1
      eval(`0 ** 0')
-     =>
-     error->m4:stdin:5: divide by zero in eval: 0 ** 0
+     ⇒
+     errorm4:stdin:5: divide by zero in eval: 0 ** 0
      eval(`4 ** -2')
-     error->m4:stdin:6: negative exponent in eval: 4 ** -2
-     =>
+     errorm4:stdin:6: negative exponent in eval: 4 ** -2
+     ⇒
 
    Within EXPRESSION, (but not RADIX or WIDTH), numbers without a
-special prefix are decimal.  A simple '0' prefix introduces an octal
-number.  '0x' introduces a hexadecimal number.  As GNU extensions, '0b'
-introduces a binary number.  '0r' introduces a number expressed in any
+special prefix are decimal.  A simple ‘0’ prefix introduces an octal
+number.  ‘0x’ introduces a hexadecimal number.  As GNU extensions, ‘0b’
+introduces a binary number.  ‘0r’ introduces a number expressed in any
 radix between 1 and 36: the prefix should be immediately followed by the
 decimal expression of the radix, a colon, then the digits making the
 number.  For radix 1, leading zeros are ignored, and all remaining
-digits must be '1'; for all other radices, the digits are '0', '1', '2',
-....  Beyond '9', the digits are 'a', 'b' ... up to 'z'.  Lower and
+digits must be ‘1’; for all other radices, the digits are ‘0’, ‘1’, ‘2’,
+....  Beyond ‘9’, the digits are ‘a’, ‘b’ ... up to ‘z’.  Lower and
 upper case letters can be used interchangeably in numbers prefixes and
 as number digits.
 
    Parentheses may be used to group subexpressions whenever needed.  For
-the relational operators, a true relation returns '1', and a false
-relation return '0'.
+the relational operators, a true relation returns ‘1’, and a false
+relation return ‘0’.
 
-   Here are a few examples of use of 'eval'.
+   Here are a few examples of use of ‘eval’.
 
      eval(`-3 * 5')
-     =>-15
+     -15
      eval(`-99 / 10')
-     =>-9
+     -9
      eval(`-99 % 10')
-     =>-9
+     -9
      eval(`99 % -10')
-     =>9
+     9
      eval(index(`Hello world', `llo') >= 0)
-     =>1
+     1
      eval(`0r1:0111 + 0b100 + 0r3:12')
-     =>12
+     12
      define(`square', `eval(`($1) ** 2')')
-     =>
+     ⇒
      square(`9')
-     =>81
+     81
      square(square(`5')` + 1')
-     =>676
+     676
      define(`foo', `666')
-     =>
+     ⇒
      eval(`foo / 6')
-     error->m4:stdin:11: bad expression in eval: foo / 6
-     =>
+     errorm4:stdin:11: bad expression in eval: foo / 6
+     ⇒
      eval(foo / 6)
-     =>111
+     111
 
-   As the last two lines show, 'eval' does not handle macro names, even
+   As the last two lines show, ‘eval’ does not handle macro names, even
 if they expand to a valid expression (or part of a valid expression).
-Therefore all macros must be expanded before they are passed to 'eval'.
+Therefore all macros must be expanded before they are passed to ‘eval’.
 
    Some calculations are not portable to other implementations, since
-they have undefined semantics in C, but GNU 'm4' has well-defined
+they have undefined semantics in C, but GNU ‘m4’ has well-defined
 behavior on overflow.  When shifting, an out-of-range shift amount is
 implicitly brought into the range of 32-bit signed integers using an
 implicit bit-wise and with 0x1f).
 
      define(`max_int', eval(`0x7fffffff'))
-     =>
+     ⇒
      define(`min_int', incr(max_int))
-     =>
+     ⇒
      eval(min_int` < 0')
-     =>1
+     1
      eval(max_int` > 0')
-     =>1
+     1
      ifelse(eval(min_int` / -1'), min_int, `overflow occurred')
-     =>overflow occurred
+     overflow occurred
      min_int
-     =>-2147483648
+     -2147483648
      eval(`0x80000000 % -1')
-     =>0
+     0
      eval(`-4 >> 1')
-     =>-2
+     -2
      eval(`-4 >> 33')
-     =>-2
+     -2
 
    If RADIX is specified, it specifies the radix to be used in the
 expansion.  The default radix is 10; this is also the case if RADIX is
 the empty string.  A warning results if the radix is outside the range
-of 1 through 36, inclusive.  The result of 'eval' is always taken to be
+of 1 through 36, inclusive.  The result of ‘eval’ is always taken to be
 signed.  No radix prefix is output, and for radices greater than 10, the
 digits are lower case.  The WIDTH argument specifies the minimum output
 width, excluding any negative sign.  The result is zero-padded to extend
 the expansion to the requested width.  A warning results if the width is
-negative.  If RADIX or WIDTH is out of bounds, the expansion of 'eval'
+negative.  If RADIX or WIDTH is out of bounds, the expansion of ‘eval’
 is empty.
 
      eval(`666', `10')
-     =>666
+     666
      eval(`666', `11')
-     =>556
+     556
      eval(`666', `6')
-     =>3030
+     3030
      eval(`666', `6', `10')
-     =>0000003030
+     0000003030
      eval(`-666', `6', `10')
-     =>-0000003030
+     -0000003030
      eval(`10', `', `0')
-     =>10
+     10
      `0r1:'eval(`10', `1', `11')
-     =>0r1:01111111111
+     0r1:01111111111
      eval(`10', `16')
-     =>a
+     a
      eval(`1', `37')
-     error->m4:stdin:9: radix 37 in builtin `eval' out of range
-     =>
+     errorm4:stdin:9: radix 37 in builtin `eval' out of range
+     ⇒
      eval(`1', , `-1')
-     error->m4:stdin:10: negative width to builtin `eval'
-     =>
+     errorm4:stdin:10: negative width to builtin `eval'
+     ⇒
      eval()
-     error->m4:stdin:11: empty string treated as 0 in builtin `eval'
-     =>0
+     errorm4:stdin:11: empty string treated as 0 in builtin `eval'
+     0
 
 \1f
 File: m4.info,  Node: Shell commands,  Next: Miscellaneous,  Prev: Arithmetic,  Up: Top
@@ -5222,14 +5242,14 @@ File: m4.info,  Node: Shell commands,  Next: Miscellaneous,  Prev: Arithmetic,
 13 Macros for running shell commands
 ************************************
 
-There are a few builtin macros in 'm4' that allow you to run shell
-commands from within 'm4'.
+There are a few builtin macros in ‘m4’ that allow you to run shell
+commands from within ‘m4’.
 
    Note that the definition of a valid shell command is system
-dependent.  On UNIX systems, this is the typical '/bin/sh'.  But on
+dependent.  On UNIX systems, this is the typical ‘/bin/sh’.  But on
 other systems, such as native Windows, the shell has a different syntax
 of commands that it understands.  Some examples in this chapter assume
-'/bin/sh', and also demonstrate how to quit early with a known exit
+‘/bin/sh’, and also demonstrate how to quit early with a known exit
 value if this is not the case.
 
 * Menu:
@@ -5246,8 +5266,8 @@ File: m4.info,  Node: Platform macros,  Next: Syscmd,  Up: Shell commands
 13.1 Determining the platform
 =============================
 
-Sometimes it is desirable for an input file to know which platform 'm4'
-is running on.  GNU 'm4' provides several macros that are predefined to
+Sometimes it is desirable for an input file to know which platform ‘m4’
+is running on.  GNU ‘m4’ provides several macros that are predefined to
 expand to the empty string; checking for their existence will confirm
 platform details.
 
@@ -5259,53 +5279,53 @@ platform details.
  -- Optional builtin: __windows__
  -- Optional builtin: windows
      Each of these macros is conditionally defined as needed to describe
-     the environment of 'm4'.  If defined, each macro expands to the
+     the environment of ‘m4’.  If defined, each macro expands to the
      empty string.  For now, these macros silently ignore all arguments,
      but in a future release of M4, they might warn if arguments are
      present.
 
    When GNU extensions are in effect (that is, when you did not use the
-'-G' option, *note Invoking m4: Limits control.), GNU 'm4' will define
-the macro '__gnu__' to expand to the empty string.
+‘-G’ option, *note Invoking m4: Limits control.), GNU ‘m4’ will define
+the macro ‘__gnu__’ to expand to the empty string.
 
      $ m4
      __gnu__
-     =>
+     ⇒
      __gnu__(`ignored')
-     =>
+     ⇒
      Extensions are ifdef(`__gnu__', `active', `inactive')
-     =>Extensions are active
+     Extensions are active
 
      $ m4 -G
      __gnu__
-     =>__gnu__
+     __gnu__
      __gnu__(`ignored')
-     =>__gnu__(ignored)
+     __gnu__(ignored)
      Extensions are ifdef(`__gnu__', `active', `inactive')
-     =>Extensions are inactive
+     Extensions are inactive
 
-   On UNIX systems, GNU 'm4' will define '__unix__' by default, or
-'unix' when the '-G' option is specified.
+   On UNIX systems, GNU ‘m4’ will define ‘__unix__’ by default, or
+‘unix’ when the ‘-G’ option is specified.
 
-   On native Windows systems, GNU 'm4' will define '__windows__' by
-default, or 'windows' when the '-G' option is specified.
+   On native Windows systems, GNU ‘m4’ will define ‘__windows__’ by
+default, or ‘windows’ when the ‘-G’ option is specified.
 
-   On OS/2 systems, GNU 'm4' will define '__os2__' by default, or 'os2'
-when the '-G' option is specified.
+   On OS/2 systems, GNU ‘m4’ will define ‘__os2__’ by default, or ‘os2’
+when the ‘-G’ option is specified.
 
-   If GNU 'm4' does not provide a platform macro for your system, please
+   If GNU ‘m4’ does not provide a platform macro for your system, please
 report that as a bug.
 
      define(`provided', `0')
-     =>
+     ⇒
      ifdef(`__unix__', `define(`provided', incr(provided))')
-     =>
+     ⇒
      ifdef(`__windows__', `define(`provided', incr(provided))')
-     =>
+     ⇒
      ifdef(`__os2__', `define(`provided', incr(provided))')
-     =>
+     ⇒
      provided
-     =>1
+     1
 
 \1f
 File: m4.info,  Node: Syscmd,  Next: Esyscmd,  Prev: Platform macros,  Up: Shell commands
@@ -5313,55 +5333,55 @@ File: m4.info,  Node: Syscmd,  Next: Esyscmd,  Prev: Platform macros,  Up: Shell
 13.2 Executing simple commands
 ==============================
 
-Any shell command can be executed, using 'syscmd':
+Any shell command can be executed, using ‘syscmd’:
 
  -- Builtin: syscmd (SHELL-COMMAND)
      Executes SHELL-COMMAND as a shell command.
 
-     The expansion of 'syscmd' is void, _not_ the output from
+     The expansion of ‘syscmd’ is void, _not_ the output from
      SHELL-COMMAND!  Output or error messages from SHELL-COMMAND are not
-     read by 'm4'.  *Note Esyscmd::, if you need to process the command
+     read by ‘m4’.  *Note Esyscmd::, if you need to process the command
      output.
 
-     Prior to executing the command, 'm4' flushes its buffers.  The
+     Prior to executing the command, ‘m4’ flushes its buffers.  The
      default standard input, output and error of SHELL-COMMAND are the
-     same as those of 'm4'.
+     same as those of ‘m4’.
 
      By default, the SHELL-COMMAND will be used as the argument to the
-     '-c' option of the '/bin/sh' shell (or the version of 'sh'
-     specified by 'command -p getconf PATH', if your system supports
-     that).  If you prefer a different shell, the 'configure' script can
-     be given the option '--with-syscmd-shell=LOCATION' to set the
-     location of an alternative shell at GNU 'm4' installation; the
-     alternative shell must still support '-c'.
+     ‘-c’ option of the ‘/bin/sh’ shell (or the version of ‘sh’
+     specified by ‘command -p getconf PATH’, if your system supports
+     that).  If you prefer a different shell, the ‘configure’ script can
+     be given the option ‘--with-syscmd-shell=LOCATION’ to set the
+     location of an alternative shell at GNU ‘m4’ installation; the
+     alternative shell must still support ‘-c’.
 
-     The macro 'syscmd' is recognized only with parameters.
+     The macro ‘syscmd’ is recognized only with parameters.
 
      define(`foo', `FOO')
-     =>
+     ⇒
      syscmd(`echo foo')
-     =>foo
-     =>
+     foo
+     ⇒
 
-   Note how the expansion of 'syscmd' keeps the trailing newline of the
+   Note how the expansion of ‘syscmd’ keeps the trailing newline of the
 command, as well as using the newline that appeared after the macro.
 
    The following is an example of SHELL-COMMAND using the same standard
-input as 'm4':
+input as ‘m4’:
 
      $ echo "m4wrap(\`syscmd(\`cat')')" | m4
-     =>
+     ⇒
 
-   It tells 'm4' to read all of its input before executing the wrapped
+   It tells ‘m4’ to read all of its input before executing the wrapped
 text, then hand a valid (albeit emptied) pipe as standard input for the
-'cat' subcommand.  Therefore, you should be careful when using standard
-input (either by specifying no files, or by passing '-' as a file name
+‘cat’ subcommand.  Therefore, you should be careful when using standard
+input (either by specifying no files, or by passing ‘-’ as a file name
 on the command line, *note Invoking m4: Command line files.), and also
-invoking subcommands via 'syscmd' or 'esyscmd' that consume data from
+invoking subcommands via ‘syscmd’ or ‘esyscmd’ that consume data from
 standard input.  When standard input is a seekable file, the subprocess
-will pick up with the next character not yet processed by 'm4'; when it
+will pick up with the next character not yet processed by ‘m4’; when it
 is a pipe or other non-seekable file, there is no guarantee how much
-data will already be buffered by 'm4' and thus unavailable to the child.
+data will already be buffered by ‘m4’ and thus unavailable to the child.
 
 \1f
 File: m4.info,  Node: Esyscmd,  Next: Sysval,  Prev: Syscmd,  Up: Shell commands
@@ -5369,38 +5389,38 @@ File: m4.info,  Node: Esyscmd,  Next: Sysval,  Prev: Syscmd,  Up: Shell commands
 13.3 Reading the output of commands
 ===================================
 
-If you want 'm4' to read the output of a shell command, use 'esyscmd':
+If you want ‘m4’ to read the output of a shell command, use ‘esyscmd’:
 
  -- Builtin: esyscmd (SHELL-COMMAND)
      Expands to the standard output of the shell command SHELL-COMMAND.
 
-     Prior to executing the command, 'm4' flushes its buffers.  The
+     Prior to executing the command, ‘m4’ flushes its buffers.  The
      default standard input and standard error of SHELL-COMMAND are the
-     same as those of 'm4'.  The error output of SHELL-COMMAND is not a
+     same as those of ‘m4’.  The error output of SHELL-COMMAND is not a
      part of the expansion: it will appear along with the error output
-     of 'm4'.
+     of ‘m4’.
 
      By default, the SHELL-COMMAND will be used as the argument to the
-     '-c' option of the '/bin/sh' shell (or the version of 'sh'
-     specified by 'command -p getconf PATH', if your system supports
-     that).  If you prefer a different shell, the 'configure' script can
-     be given the option '--with-syscmd-shell=LOCATION' to set the
-     location of an alternative shell at GNU 'm4' installation; the
-     alternative shell must still support '-c'.
+     ‘-c’ option of the ‘/bin/sh’ shell (or the version of ‘sh’
+     specified by ‘command -p getconf PATH’, if your system supports
+     that).  If you prefer a different shell, the ‘configure’ script can
+     be given the option ‘--with-syscmd-shell=LOCATION’ to set the
+     location of an alternative shell at GNU ‘m4’ installation; the
+     alternative shell must still support ‘-c’.
 
-     The macro 'esyscmd' is recognized only with parameters.
+     The macro ‘esyscmd’ is recognized only with parameters.
 
      define(`foo', `FOO')
-     =>
+     ⇒
      esyscmd(`echo foo')
-     =>FOO
-     =>
+     FOO
+     ⇒
 
-   Note how the expansion of 'esyscmd' keeps the trailing newline of the
+   Note how the expansion of ‘esyscmd’ keeps the trailing newline of the
 command, as well as using the newline that appeared after the macro.
 
-   Just as with 'syscmd', care must be exercised when sharing standard
-input between 'm4' and the child process of 'esyscmd'.
+   Just as with ‘syscmd’, care must be exercised when sharing standard
+input between ‘m4’ and the child process of ‘esyscmd’.
 
 \1f
 File: m4.info,  Node: Sysval,  Next: Mkstemp,  Prev: Esyscmd,  Up: Shell commands
@@ -5408,41 +5428,41 @@ File: m4.info,  Node: Sysval,  Next: Mkstemp,  Prev: Esyscmd,  Up: Shell command
 13.4 Exit status
 ================
 
-To see whether a shell command succeeded, use 'sysval':
+To see whether a shell command succeeded, use ‘sysval’:
 
  -- Builtin: sysval
      Expands to the exit status of the last shell command run with
-     'syscmd' or 'esyscmd'.  Expands to 0 if no command has been run
+     ‘syscmd’ or ‘esyscmd’.  Expands to 0 if no command has been run
      yet.
 
      sysval
-     =>0
+     0
      syscmd(`false')
-     =>
+     ⇒
      ifelse(sysval, `0', `zero', `non-zero')
-     =>non-zero
+     non-zero
      syscmd(`exit 2')
-     =>
+     ⇒
      sysval
-     =>2
+     2
      syscmd(`true')
-     =>
+     ⇒
      sysval
-     =>0
+     0
      esyscmd(`false')
-     =>
+     ⇒
      ifelse(sysval, `0', `zero', `non-zero')
-     =>non-zero
+     non-zero
      esyscmd(`echo dnl && exit 127')
-     =>
+     ⇒
      sysval
-     =>127
+     127
      esyscmd(`true')
-     =>
+     ⇒
      sysval
-     =>0
+     0
 
-   'sysval' results in 127 if there was a problem executing the command,
+   ‘sysval’ results in 127 if there was a problem executing the command,
 for example, if the system-imposed argument length is exceeded, or if
 there were not enough resources to fork.  It is not possible to
 distinguish between failed execution and successful execution that had
@@ -5457,18 +5477,24 @@ result is the signal number shifted left by eight bits.
      ifdef(`__unix__', ,
            `errprint(` skipping: syscmd does not have unix semantics
      ')m4exit(`77')')dnl
-     syscmd(`kill -9 $$')
-     =>
+     changequote(`[', `]')
+     ⇒
+     syscmd([/bin/sh -c 'kill -9 $$'; st=$?; test $st = 137 || test $st = 265])
+     ⇒
+     ifelse(sysval, [0], , [errprint([ skipping: shell does not send signal 9
+     ])m4exit([77])])dnl
+     syscmd([kill -9 $$])
+     ⇒
      sysval
-     =>2304
+     2304
      syscmd()
-     =>
+     ⇒
      sysval
-     =>0
-     esyscmd(`kill -9 $$')
-     =>
+     0
+     esyscmd([kill -9 $$])
+     ⇒
      sysval
-     =>2304
+     2304
 
 \1f
 File: m4.info,  Node: Mkstemp,  Prev: Sysval,  Up: Shell commands
@@ -5476,39 +5502,39 @@ File: m4.info,  Node: Mkstemp,  Prev: Sysval,  Up: Shell commands
 13.5 Making temporary files
 ===========================
 
-Commands specified to 'syscmd' or 'esyscmd' might need a temporary file,
+Commands specified to ‘syscmd’ or ‘esyscmd’ might need a temporary file,
 for output or for some other purpose.  There is a builtin macro,
-'mkstemp', for making a temporary file:
+‘mkstemp’, for making a temporary file:
 
  -- Builtin: mkstemp (TEMPLATE)
  -- Builtin: maketemp (TEMPLATE)
      Expands to the quoted name of a new, empty file, made from the
-     string TEMPLATE, which should end with the string 'XXXXXX'.  The
-     six 'X' characters are then replaced with random characters
-     matching the regular expression '[a-zA-Z0-9._-]', in order to make
-     the file name unique.  If fewer than six 'X' characters are found
-     at the end of 'template', the result will be longer than the
+     string TEMPLATE, which should end with the string ‘XXXXXX’.  The
+     six ‘X’ characters are then replaced with random characters
+     matching the regular expression ‘[a-zA-Z0-9._-]’, in order to make
+     the file name unique.  If fewer than six ‘X’ characters are found
+     at the end of ‘template’, the result will be longer than the
      template.  The created file will have access permissions as if by
-     'chmod =rw,go=', meaning that the current umask of the 'm4' process
+     ‘chmod =rw,go=’, meaning that the current umask of the ‘m4’ process
      is taken into account, and at most only the current user can read
      and write the file.
 
-     The traditional behavior, standardized by POSIX, is that 'maketemp'
-     merely replaces the trailing 'X' with the process id, without
+     The traditional behavior, standardized by POSIX, is that ‘maketemp’
+     merely replaces the trailing ‘X’ with the process id, without
      creating a file or quoting the expansion, and without ensuring that
      the resulting string is a unique file name.  In part, this means
      that using the same TEMPLATE twice in the same input file will
      result in the same expansion.  This behavior is a security hole, as
      it is very easy for another process to guess the name that will be
-     generated, and thus interfere with a subsequent use of 'syscmd'
+     generated, and thus interfere with a subsequent use of ‘syscmd’
      trying to manipulate that file name.  Hence, POSIX has recommended
-     that all new implementations of 'm4' provide the secure 'mkstemp'
-     builtin, and that users of 'm4' check for its existence.
+     that all new implementations of ‘m4’ provide the secure ‘mkstemp’
+     builtin, and that users of ‘m4’ check for its existence.
 
      The expansion is void and an error issued if a temporary file could
      not be created.
 
-     The macros 'mkstemp' and 'maketemp' are recognized only with
+     The macros ‘mkstemp’ and ‘maketemp’ are recognized only with
      parameters.
 
    If you try this next example, you will most likely get different
@@ -5517,52 +5543,52 @@ randomly chosen:
 
      $ m4
      define(`tmp', `oops')
-     =>
+     ⇒
      maketemp(`/tmp/fooXXXXXX')
-     =>/tmp/fooa07346
+     /tmp/fooa07346
      ifdef(`mkstemp', `define(`maketemp', defn(`mkstemp'))',
            `define(`mkstemp', defn(`maketemp'))dnl
      errprint(`warning: potentially insecure maketemp implementation
      ')')
-     =>
+     ⇒
      mkstemp(`doc')
-     =>docQv83Uw
+     docQv83Uw
 
-   Unless you use the '--traditional' command line option (or '-G',
-*note Invoking m4: Limits control.), the GNU version of 'maketemp' is
+   Unless you use the ‘--traditional’ command line option (or ‘-G’,
+*note Invoking m4: Limits control.), the GNU version of ‘maketemp’ is
 secure.  This means that using the same template to multiple calls will
 generate multiple files.  However, we recommend that you use the new
-'mkstemp' macro, introduced in GNU M4 1.4.8, which is secure even in
+‘mkstemp’ macro, introduced in GNU M4 1.4.8, which is secure even in
 traditional mode.  Also, as of M4 1.4.11, the secure implementation
 quotes the resulting file name, so that you are guaranteed to know what
 file was created even if the random file name happens to match an
-existing macro.  Notice that this example is careful to use 'defn' to
-avoid unintended expansion of 'foo'.
+existing macro.  Notice that this example is careful to use ‘defn’ to
+avoid unintended expansion of ‘foo’.
 
      $ m4
      define(`foo', `errprint(`oops')')
-     =>
+     ⇒
      syscmd(`rm -f foo-??????')sysval
-     =>0
+     0
      define(`file1', maketemp(`foo-XXXXXX'))dnl
      ifelse(esyscmd(`echo \` foo-?????? \''), ` foo-?????? ',
             `no file', `created')
-     =>created
+     created
      define(`file2', maketemp(`foo-XX'))dnl
      define(`file3', mkstemp(`foo-XXXXXX'))dnl
      ifelse(len(defn(`file1')), len(defn(`file2')),
             `same length', `different')
-     =>same length
+     same length
      ifelse(defn(`file1'), defn(`file2'), `same', `different file')
-     =>different file
+     different file
      ifelse(defn(`file2'), defn(`file3'), `same', `different file')
-     =>different file
+     different file
      ifelse(defn(`file1'), defn(`file3'), `same', `different file')
-     =>different file
+     different file
      syscmd(`rm 'defn(`file1') defn(`file2') defn(`file3'))
-     =>
+     ⇒
      sysval
-     =>0
+     0
 
 \1f
 File: m4.info,  Node: Miscellaneous,  Next: Frozen files,  Prev: Shell commands,  Up: Top
@@ -5577,7 +5603,7 @@ any of the previous chapters.
 
 * Errprint::                    Printing error messages
 * Location::                    Printing current location
-* M4exit::                      Exiting from 'm4'
+* M4exit::                      Exiting from ‘m4’
 
 \1f
 File: m4.info,  Node: Errprint,  Next: Location,  Up: Miscellaneous
@@ -5585,31 +5611,31 @@ File: m4.info,  Node: Errprint,  Next: Location,  Up: Miscellaneous
 14.1 Printing error messages
 ============================
 
-You can print error messages using 'errprint':
+You can print error messages using ‘errprint’:
 
  -- Builtin: errprint (MESSAGE, ...)
      Prints MESSAGE and the rest of the arguments to standard error,
      separated by spaces.  Standard error is used, regardless of the
-     '--debugfile' option (*note Invoking m4: Debugging options.).
+     ‘--debugfile’ option (*note Invoking m4: Debugging options.).
 
-     The expansion of 'errprint' is void.  The macro 'errprint' is
+     The expansion of ‘errprint’ is void.  The macro ‘errprint’ is
      recognized only with parameters.
 
      errprint(`Invalid arguments to forloop
      ')
-     error->Invalid arguments to forloop
-     =>
+     errorInvalid arguments to forloop
+     ⇒
      errprint(`1')errprint(`2',`3
      ')
-     error->12 3
-     =>
+     error12 3
+     ⇒
 
    A trailing newline is _not_ printed automatically, so it should be
 supplied as part of the argument, as in the example.  Unfortunately, the
-exact output of 'errprint' is not very portable to other 'm4'
+exact output of ‘errprint’ is not very portable to other ‘m4’
 implementations: POSIX requires that all arguments be printed, but some
-implementations of 'm4' only print the first.  Furthermore, some BSD
-implementations always append a newline for each 'errprint' call,
+implementations of ‘m4’ only print the first.  Furthermore, some BSD
+implementations always append a newline for each ‘errprint’ call,
 regardless of whether the last argument already had one, and POSIX is
 silent on whether this is acceptable.
 
@@ -5627,102 +5653,102 @@ builtins exist:
  -- Builtin: __program__
      Expand to the quoted name of the current input file, the current
      input line number in that file, and the quoted name of the current
-     invocation of 'm4'.
+     invocation of ‘m4’.
 
      errprint(__program__:__file__:__line__: `input error
      ')
-     error->m4:stdin:1: input error
-     =>
+     errorm4:stdin:1: input error
+     ⇒
 
    Line numbers start at 1 for each file.  If the file was found due to
-the '-I' option or 'M4PATH' environment variable, that is reflected in
-the file name.  The syncline option ('-s', *note Invoking m4:
-Preprocessor features.), and the 'f' and 'l' flags of 'debugmode' (*note
+the ‘-I’ option or ‘M4PATH’ environment variable, that is reflected in
+the file name.  The syncline option (‘-s’, *note Invoking m4:
+Preprocessor features.), and the ‘f’ and ‘l’ flags of ‘debugmode’ (*note
 Debug Levels::), also use this notion of current file and line.
 Redefining the three location macros has no effect on syncline, debug,
 warning, or error message output.
 
-   This example reuses the file 'incl.m4' mentioned earlier (*note
+   This example reuses the file ‘incl.m4’ mentioned earlier (*note
 Include::):
 
      $ m4 -I examples
      define(`foo', ``$0' called at __file__:__line__')
-     =>
+     ⇒
      foo
-     =>foo called at stdin:2
+     foo called at stdin:2
      include(`incl.m4')
-     =>Include file start
-     =>foo called at examples/incl.m4:2
-     =>Include file end
-     =>
+     Include file start
+     foo called at examples/incl.m4:2
+     Include file end
+     ⇒
 
    The location of macros invoked during the rescanning of macro
 expansion text corresponds to the location in the file where the
 expansion was triggered, regardless of how many newline characters the
 expansion text contains.  As of GNU M4 1.4.8, the location of text
-wrapped with 'm4wrap' (*note M4wrap::) is the point at which the
-'m4wrap' was invoked.  Previous versions, however, behaved as though
-wrapped text came from line 0 of the file "".
+wrapped with ‘m4wrap’ (*note M4wrap::) is the point at which the
+‘m4wrap’ was invoked.  Previous versions, however, behaved as though
+wrapped text came from line 0 of the file “”.
 
      define(`echo', `$@')
-     =>
+     ⇒
      define(`foo', `echo(__line__
      __line__)')
-     =>
+     ⇒
      echo(__line__
      __line__)
-     =>4
-     =>5
+     4
+     5
      m4wrap(`foo
      ')
-     =>
+     ⇒
      foo(errprint(__line__
      __line__
      ))
-     error->8
-     error->9
-     =>8
-     =>8
+     error8
+     error9
+     8
+     8
      __line__
-     =>11
+     11
      m4wrap(`__line__
      ')
-     =>
+     ⇒
      ^D
-     =>12
-     =>6
-     =>6
-
-   The '__program__' macro behaves like '$0' in shell terminology.  If
-you invoke 'm4' through an absolute path or a link with a different
-spelling, rather than by relying on a 'PATH' search for plain 'm4', it
-will affect how '__program__' expands.  The intent is that you can use
-it to produce error messages with the same formatting that 'm4' produces
-internally.  It can also be used within 'syscmd' (*note Syscmd::) to
-pick the same version of 'm4' that is currently running, rather than
-whatever version of 'm4' happens to be first in 'PATH'.  It was first
+     12
+     6
+     6
+
+   The ‘__program__’ macro behaves like ‘$0’ in shell terminology.  If
+you invoke ‘m4’ through an absolute path or a link with a different
+spelling, rather than by relying on a ‘PATH’ search for plain ‘m4’, it
+will affect how ‘__program__’ expands.  The intent is that you can use
+it to produce error messages with the same formatting that ‘m4’ produces
+internally.  It can also be used within ‘syscmd’ (*note Syscmd::) to
+pick the same version of ‘m4’ that is currently running, rather than
+whatever version of ‘m4’ happens to be first in ‘PATH’.  It was first
 introduced in GNU M4 1.4.6.
 
 \1f
 File: m4.info,  Node: M4exit,  Prev: Location,  Up: Miscellaneous
 
-14.3 Exiting from 'm4'
+14.3 Exiting from ‘m4’
 ======================
 
-If you need to exit from 'm4' before the entire input has been read, you
-can use 'm4exit':
+If you need to exit from ‘m4’ before the entire input has been read, you
+can use ‘m4exit’:
 
- -- Builtin: m4exit ([CODE = '0'])
-     Causes 'm4' to exit, with exit status CODE.  If CODE is left out,
+ -- Builtin: m4exit ([CODE = ‘0’])
+     Causes ‘m4’ to exit, with exit status CODE.  If CODE is left out,
      the exit status is zero.  If CODE cannot be parsed, or is outside
      the range of 0 to 255, the exit status is one.  No further input is
      read, and all wrapped and diverted text is discarded.
 
      m4wrap(`This text is lost due to `m4exit'.')
-     =>
+     ⇒
      divert(`1') So is this.
      divert
-     =>
+     ⇒
      m4exit And this is never read.
 
    A common use of this is to abort processing:
@@ -5735,25 +5761,25 @@ can use 'm4exit':
      define(`fatal_error',
             `errprint(__program__:__file__:__line__`: fatal error: $*
      ')m4exit(`1')')
-     =>
+     ⇒
      fatal_error(`this is a BAD one, buster')
-     error->m4:stdin:4: fatal error: this is a BAD one, buster
+     errorm4:stdin:4: fatal error: this is a BAD one, buster
 
-   After this macro call, 'm4' will exit with exit status 1.  This macro
+   After this macro call, ‘m4’ will exit with exit status 1.  This macro
 is only intended for error exits, since the normal exit procedures are
 not followed, i.e., diverted text is not undiverted, and saved text
 (*note M4wrap::) is not reread.  (This macro could be made more robust
-to earlier versions of 'm4'.  You should try to see if you can find
+to earlier versions of ‘m4’.  You should try to see if you can find
 weaknesses and correct them; or *note Answers: Improved fatal_error.).
 
    Note that it is still possible for the exit status to be different
-than what was requested by 'm4exit'.  If 'm4' detects some other error,
+than what was requested by ‘m4exit’.  If ‘m4’ detects some other error,
 such as a write error on standard output, the exit status will be
-non-zero even if 'm4exit' requested zero.
+non-zero even if ‘m4exit’ requested zero.
 
    If standard input is seekable, then the file will be positioned at
 the next unread character.  If it is a pipe or other non-seekable file,
-then there are no guarantees how much data 'm4' might have read into
+then there are no guarantees how much data ‘m4’ might have read into
 buffers, and thus discarded.
 
 \1f
@@ -5762,14 +5788,14 @@ File: m4.info,  Node: Frozen files,  Next: Compatibility,  Prev: Miscellaneous,
 15 Fast loading of frozen state
 *******************************
 
-Some bigger 'm4' applications may be built over a common base containing
+Some bigger ‘m4’ applications may be built over a common base containing
 hundreds of definitions and other costly initializations.  Usually, the
 common base is kept in one or more declarative files, which files are
-listed on each 'm4' invocation prior to the user's input file, or else
-each input file uses 'include'.
+listed on each ‘m4’ invocation prior to the user’s input file, or else
+each input file uses ‘include’.
 
    Reading the common base of a big application, over and over again,
-may be time consuming.  GNU 'm4' offers some machinery to speed up the
+may be time consuming.  GNU ‘m4’ offers some machinery to speed up the
 start of an application using lengthy common bases.
 
 * Menu:
@@ -5783,14 +5809,14 @@ File: m4.info,  Node: Using frozen files,  Next: Frozen file format,  Up: Frozen
 15.1 Using frozen files
 =======================
 
-Suppose a user has a library of 'm4' initializations in 'base.m4', which
+Suppose a user has a library of ‘m4’ initializations in ‘base.m4’, which
 is then used with multiple input files:
 
      $ m4 base.m4 input1.m4
      $ m4 base.m4 input2.m4
      $ m4 base.m4 input3.m4
 
-   Rather than spending time parsing the fixed contents of 'base.m4'
+   Rather than spending time parsing the fixed contents of ‘base.m4’
 every time, the user might rather execute:
 
      $ m4 -F base.m4f base.m4
@@ -5801,24 +5827,24 @@ once, and further execute, as often as needed:
      $ m4 -R base.m4f input2.m4
      $ m4 -R base.m4f input3.m4
 
-with the varying input.  The first call, containing the '-F' option,
-only reads and executes file 'base.m4', defining various application
+with the varying input.  The first call, containing the ‘-F’ option,
+only reads and executes file ‘base.m4’, defining various application
 macros and computing other initializations.  Once the input file
-'base.m4' has been completely processed, GNU 'm4' produces in 'base.m4f'
-a "frozen" file, that is, a file which contains a kind of snapshot of
-the 'm4' internal state.
+‘base.m4’ has been completely processed, GNU ‘m4’ produces in ‘base.m4f’
+a “frozen” file, that is, a file which contains a kind of snapshot of
+the ‘m4’ internal state.
 
-   Later calls, containing the '-R' option, are able to reload the
-internal state of 'm4', from 'base.m4f', _prior_ to reading any other
-input files.  This means instead of starting with a virgin copy of 'm4',
+   Later calls, containing the ‘-R’ option, are able to reload the
+internal state of ‘m4’, from ‘base.m4f’, _prior_ to reading any other
+input files.  This means instead of starting with a virgin copy of ‘m4’,
 input will be read after having effectively recovered the effect of a
-prior run.  In our example, the effect is the same as if file 'base.m4'
+prior run.  In our example, the effect is the same as if file ‘base.m4’
 has been read anew.  However, this effect is achieved a lot faster.
 
-   Only one frozen file may be created or read in any one 'm4'
+   Only one frozen file may be created or read in any one ‘m4’
 invocation.  It is not possible to recover two frozen files at once.
-However, frozen files may be updated incrementally, through using '-R'
-and '-F' options simultaneously.  For example, if some care is taken,
+However, frozen files may be updated incrementally, through using ‘-R’
+and ‘-F’ options simultaneously.  For example, if some care is taken,
 the command:
 
      $ m4 file1.m4 file2.m4 file3.m4 file4.m4
@@ -5833,27 +5859,27 @@ output:
 
    Some care is necessary because not every effort has been made for
 this to work in all cases.  In particular, the trace attribute of macros
-is not handled, nor the current setting of 'changeword'.  Currently,
-'m4wrap' and 'sysval' also have problems.  Also, interactions for some
-options of 'm4', being used in one call and not in the next, have not
+is not handled, nor the current setting of ‘changeword’.  Currently,
+‘m4wrap’ and ‘sysval’ also have problems.  Also, interactions for some
+options of ‘m4’, being used in one call and not in the next, have not
 been fully analyzed yet.  On the other end, you may be confident that
-stacks of 'pushdef' definitions are handled correctly, as well as
+stacks of ‘pushdef’ definitions are handled correctly, as well as
 undefined or renamed builtins, and changed strings for quotes or
 comments.  And future releases of GNU M4 will improve on the utility of
 frozen files.
 
-   When an 'm4' run is to be frozen, the automatic undiversion which
+   When an ‘m4’ run is to be frozen, the automatic undiversion which
 takes place at end of execution is inhibited.  Instead, all positively
 numbered diversions are saved into the frozen file.  The active
 diversion number is also transmitted.
 
    A frozen file to be reloaded need not reside in the current
-directory.  It is looked up the same way as an 'include' file (*note
+directory.  It is looked up the same way as an ‘include’ file (*note
 Search Path::).
 
-   If the frozen file was generated with a newer version of 'm4', and
-contains directives that an older 'm4' cannot parse, attempting to load
-the frozen file with option '-R' will cause 'm4' to exit with status 63
+   If the frozen file was generated with a newer version of ‘m4’, and
+contains directives that an older ‘m4’ cannot parse, attempting to load
+the frozen file with option ‘-R’ will cause ‘m4’ to exit with status 63
 to indicate version mismatch.
 
 \1f
@@ -5864,56 +5890,56 @@ File: m4.info,  Node: Frozen file format,  Prev: Using frozen files,  Up: Frozen
 
 Frozen files are sharable across architectures.  It is safe to write a
 frozen file on one machine and read it on another, given that the second
-machine uses the same or newer version of GNU 'm4'.  It is conventional,
-but not required, to give a frozen file the suffix of '.m4f'.
+machine uses the same or newer version of GNU ‘m4’.  It is conventional,
+but not required, to give a frozen file the suffix of ‘.m4f’.
 
    These are simple (editable) text files, made up of directives, each
 starting with a capital letter and ending with a newline (<NL>).
-Wherever a directive is expected, the character '#' introduces a comment
+Wherever a directive is expected, the character ‘#’ introduces a comment
 line; empty lines are also ignored if they are not part of an embedded
 string.  In the following descriptions, each LEN refers to the length of
 the corresponding strings STR in the next line of input.  Numbers are
 always expressed in decimal.  There are no escape characters.  The
 directives are:
 
-'C LEN1 , LEN2 <NL> STR1 STR2 <NL>'
+‘C LEN1 , LEN2 <NL> STR1 STR2 <NL>’
      Uses STR1 and STR2 as the begin-comment and end-comment strings.
-     If omitted, then '#' and <NL> are the comment delimiters.
+     If omitted, then ‘#’ and <NL> are the comment delimiters.
 
-'D NUMBER, LEN <NL> STR <NL>'
+‘D NUMBER, LEN <NL> STR <NL>’
      Selects diversion NUMBER, making it current, then copy STR in the
      current diversion.  NUMBER may be a negative number for a
      non-existing diversion.  To merely specify an active selection, use
      this command with an empty STR.  With 0 as the diversion NUMBER,
-     STR will be issued on standard output at reload time.  GNU 'm4'
-     will not produce the 'D' directive with non-zero length for
+     STR will be issued on standard output at reload time.  GNU ‘m4’
+     will not produce the ‘D’ directive with non-zero length for
      diversion 0, but this can be done with manual edits.  This
      directive may appear more than once for the same diversion, in
      which case the diversion is the concatenation of the various uses.
      If omitted, then diversion 0 is current.
 
-'F LEN1 , LEN2 <NL> STR1 STR2 <NL>'
-     Defines, through 'pushdef', a definition for STR1 expanding to the
+‘F LEN1 , LEN2 <NL> STR1 STR2 <NL>’
+     Defines, through ‘pushdef’, a definition for STR1 expanding to the
      function whose builtin name is STR2.  If the builtin does not exist
-     (for example, if the frozen file was produced by a copy of 'm4'
-     compiled with changeword support, but the version of 'm4' reloading
+     (for example, if the frozen file was produced by a copy of ‘m4’
+     compiled with changeword support, but the version of ‘m4’ reloading
      was compiled without it), the reload is silent, but any subsequent
      use of the definition of STR1 will result in a warning.  This
      directive may appear more than once for the same name, and its
-     order, along with 'T', is important.  If omitted, you will have no
+     order, along with ‘T’, is important.  If omitted, you will have no
      access to any builtins.
 
-'Q LEN1 , LEN2 <NL> STR1 STR2 <NL>'
+‘Q LEN1 , LEN2 <NL> STR1 STR2 <NL>’
      Uses STR1 and STR2 as the begin-quote and end-quote strings.  If
-     omitted, then '`' and ''' are the quote delimiters.
+     omitted, then ‘`’ and ‘'’ are the quote delimiters.
 
-'T LEN1 , LEN2 <NL> STR1 STR2 <NL>'
-     Defines, though 'pushdef', a definition for STR1 expanding to the
+‘T LEN1 , LEN2 <NL> STR1 STR2 <NL>’
+     Defines, though ‘pushdef’, a definition for STR1 expanding to the
      text given by STR2.  This directive may appear more than once for
-     the same name, and its order, along with 'F', is important.
+     the same name, and its order, along with ‘F’, is important.
 
-'V NUMBER <NL>'
-     Confirms the format of the file.  'm4' 1.4.18 only creates and
+‘V NUMBER <NL>’
+     Confirms the format of the file.  ‘m4’ 1.4.19 only creates and
      understands frozen files where NUMBER is 1.  This directive must be
      the first non-comment in the file, and may not appear more than
      once.
@@ -5921,21 +5947,21 @@ directives are:
 \1f
 File: m4.info,  Node: Compatibility,  Next: Answers,  Prev: Frozen files,  Up: Top
 
-16 Compatibility with other versions of 'm4'
+16 Compatibility with other versions of ‘m4’
 ********************************************
 
 This chapter describes the many of the differences between this
-implementation of 'm4', and of other implementations found under UNIX,
+implementation of ‘m4’, and of other implementations found under UNIX,
 such as System V Release 4, Solaris, and BSD flavors.  In particular, it
 lists the known differences and extensions to POSIX. However, the list
 is not necessarily comprehensive.
 
    At the time of this writing, POSIX 2001 (also known as IEEE Std
 1003.1-2001) is the latest standard, although a new version of POSIX is
-under development and includes several proposals for modifying what 'm4'
-is required to do.  The requirements for 'm4' are shared between SUSv3
+under development and includes several proposals for modifying what ‘m4’
+is required to do.  The requirements for ‘m4’ are shared between SUSv3
 and POSIX, and can be viewed at
-<http://www.opengroup.org/onlinepubs/000095399/utilities/m4.html>.
+<https://www.opengroup.org/onlinepubs/000095399/utilities/m4.html>.
 
 * Menu:
 
@@ -5949,198 +5975,198 @@ File: m4.info,  Node: Extensions,  Next: Incompatibilities,  Up: Compatibility
 16.1 Extensions in GNU M4
 =========================
 
-This version of 'm4' contains a few facilities that do not exist in
-System V 'm4'.  These extra facilities are all suppressed by using the
-'-G' command line option (*note Invoking m4: Limits control.), unless
+This version of ‘m4’ contains a few facilities that do not exist in
+System V ‘m4’.  These extra facilities are all suppressed by using the
+‘-G’ command line option (*note Invoking m4: Limits control.), unless
 overridden by other command line options.
 
-   * In the '$N' notation for macro arguments, N can contain several
-     digits, while the System V 'm4' only accepts one digit.  This
-     allows macros in GNU 'm4' to take any number of arguments, and not
+   • In the ‘$N’ notation for macro arguments, N can contain several
+     digits, while the System V ‘m4’ only accepts one digit.  This
+     allows macros in GNU ‘m4’ to take any number of arguments, and not
      only nine (*note Arguments::).
 
-     This means that 'define(`foo', `$11')' is ambiguous between
+     This means that ‘define(`foo', `$11')’ is ambiguous between
      implementations.  To portably choose between grabbing the first
      parameter and appending 1 to the expansion, or grabbing the
      eleventh parameter, you can do the following:
 
           define(`a1', `A1')
-          =>
+          ⇒
           dnl First argument, concatenated with 1
           define(`_1', `$1')define(`first1', `_1($@)1')
-          =>
+          ⇒
           dnl Eleventh argument, portable
           define(`_9', `$9')define(`eleventh', `_9(shift(shift($@)))')
-          =>
+          ⇒
           dnl Eleventh argument, GNU style
           define(`Eleventh', `$11')
-          =>
+          ⇒
           first1(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k')
-          =>A1
+          A1
           eleventh(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k')
-          =>k
+          k
           Eleventh(`a', `b', `c', `d', `e', `f', `g', `h', `i', `j', `k')
-          =>k
+          k
 
-     Also see the 'argn' macro (*note Shift::).
+     Also see the ‘argn’ macro (*note Shift::).
 
-   * The 'divert' (*note Divert::) macro can manage more than 9
-     diversions.  GNU 'm4' treats all positive numbers as valid
+   • The ‘divert’ (*note Divert::) macro can manage more than 9
+     diversions.  GNU ‘m4’ treats all positive numbers as valid
      diversions, rather than discarding diversions greater than 9.
 
-   * Files included with 'include' and 'sinclude' are sought in a user
+   • Files included with ‘include’ and ‘sinclude’ are sought in a user
      specified search path, if they are not found in the working
-     directory.  The search path is specified by the '-I' option and the
-     'M4PATH' environment variable (*note Search Path::).
+     directory.  The search path is specified by the ‘-I’ option and the
+     ‘M4PATH’ environment variable (*note Search Path::).
 
-   * Arguments to 'undivert' can be non-numeric, in which case the named
+   • Arguments to ‘undivert’ can be non-numeric, in which case the named
      file will be included uninterpreted in the output (*note
      Undivert::).
 
-   * Formatted output is supported through the 'format' builtin, which
-     is modeled after the C library function 'printf' (*note Format::).
+   • Formatted output is supported through the ‘format’ builtin, which
+     is modeled after the C library function ‘printf’ (*note Format::).
 
-   * Searches and text substitution through basic regular expressions
-     are supported by the 'regexp' (*note Regexp::) and 'patsubst'
+    Searches and text substitution through basic regular expressions
+     are supported by the ‘regexp’ (*note Regexp::) and ‘patsubst’
      (*note Patsubst::) builtins.  Some BSD implementations use extended
      regular expressions instead.
 
-   * The output of shell commands can be read into 'm4' with 'esyscmd'
+   • The output of shell commands can be read into ‘m4’ with ‘esyscmd’
      (*note Esyscmd::).
 
-   * There is indirect access to any builtin macro with 'builtin' (*note
+   • There is indirect access to any builtin macro with ‘builtin’ (*note
      Builtin::).
 
-   * Macros can be called indirectly through 'indir' (*note Indir::).
+   • Macros can be called indirectly through ‘indir’ (*note Indir::).
 
-   * The name of the program, the current input file, and the current
+    The name of the program, the current input file, and the current
      input line number are accessible through the builtins
-     '__program__', '__file__', and '__line__' (*note Location::).
+     ‘__program__’, ‘__file__’, and ‘__line__’ (*note Location::).
 
-   * The format of the output from 'dumpdef' and macro tracing can be
-     controlled with 'debugmode' (*note Debug Levels::).
+   • The format of the output from ‘dumpdef’ and macro tracing can be
+     controlled with ‘debugmode’ (*note Debug Levels::).
 
-   * The destination of trace and debug output can be controlled with
-     'debugfile' (*note Debug Output::).
+    The destination of trace and debug output can be controlled with
+     ‘debugfile’ (*note Debug Output::).
 
-   * The 'maketemp' (*note Mkstemp::) macro behaves like 'mkstemp',
+   • The ‘maketemp’ (*note Mkstemp::) macro behaves like ‘mkstemp’,
      creating a new file with a unique name on every invocation, rather
-     than following the insecure behavior of replacing the trailing 'X'
-     characters with the 'm4' process id.
+     than following the insecure behavior of replacing the trailing ‘X’
+     characters with the ‘m4’ process id.
 
-   * POSIX only requires support for the command line options '-s',
-     '-D', and '-U', so all other options accepted by GNU M4 are
+   • POSIX only requires support for the command line options ‘-s’,
+     ‘-D’, and ‘-U’, so all other options accepted by GNU M4 are
      extensions.  *Note Invoking m4::, for a description of these
      options.
 
-     The debugging and tracing facilities in GNU 'm4' are much more
-     extensive than in most other versions of 'm4'.
+     The debugging and tracing facilities in GNU ‘m4’ are much more
+     extensive than in most other versions of ‘m4’.
 
 \1f
 File: m4.info,  Node: Incompatibilities,  Next: Other Incompatibilities,  Prev: Extensions,  Up: Compatibility
 
-16.2 Facilities in System V 'm4' not in GNU 'm4'
+16.2 Facilities in System V ‘m4’ not in GNU ‘m4’
 ================================================
 
-The version of 'm4' from System V contains a few facilities that have
-not been implemented in GNU 'm4' yet.  Additionally, POSIX requires some
-behaviors that GNU 'm4' has not implemented yet.  Relying on these
-behaviors is non-portable, as a future release of GNU 'm4' may change.
+The version of ‘m4’ from System V contains a few facilities that have
+not been implemented in GNU ‘m4’ yet.  Additionally, POSIX requires some
+behaviors that GNU ‘m4’ has not implemented yet.  Relying on these
+behaviors is non-portable, as a future release of GNU ‘m4’ may change.
 
-   * POSIX requires support for multiple arguments to 'defn', without
-     any clarification on how 'defn' behaves when one of the multiple
-     arguments names a builtin.  System V 'm4' and some other
+   • POSIX requires support for multiple arguments to ‘defn’, without
+     any clarification on how ‘defn’ behaves when one of the multiple
+     arguments names a builtin.  System V ‘m4’ and some other
      implementations allow mixing builtins and text macros into a single
-     macro.  GNU 'm4' only supports joining multiple text arguments,
+     macro.  GNU ‘m4’ only supports joining multiple text arguments,
      although a future implementation may lift this restriction to
      behave more like System V.  The only portable way to join text
      macros with builtins is via helper macros and implicit
      concatenation of macro results.
 
-   * POSIX requires an application to exit with non-zero status if it
+    POSIX requires an application to exit with non-zero status if it
      wrote an error message to stderr.  This has not yet been
      consistently implemented for the various builtins that are required
-     to issue an error (such as 'eval' (*note Eval::) when an argument
+     to issue an error (such as ‘eval’ (*note Eval::) when an argument
      cannot be parsed).
 
-   * Some traditional implementations only allow reading standard input
-     once, but GNU 'm4' correctly handles multiple instances of '-' on
+    Some traditional implementations only allow reading standard input
+     once, but GNU ‘m4’ correctly handles multiple instances of ‘-’ on
      the command line.
 
-   * POSIX requires 'm4wrap' (*note M4wrap::) to act in FIFO (first-in,
-     first-out) order, but GNU 'm4' currently uses LIFO order.
-     Furthermore, POSIX states that only the first argument to 'm4wrap'
-     is saved for later evaluation, but GNU 'm4' saves and processes all
+   • POSIX requires ‘m4wrap’ (*note M4wrap::) to act in FIFO (first-in,
+     first-out) order, but GNU ‘m4’ currently uses LIFO order.
+     Furthermore, POSIX states that only the first argument to ‘m4wrap’
+     is saved for later evaluation, but GNU ‘m4’ saves and processes all
      arguments, with output separated by spaces.
 
-   * POSIX states that builtins that require arguments, but are called
+    POSIX states that builtins that require arguments, but are called
      without arguments, have undefined behavior.  Traditional
      implementations simply behave as though empty strings had been
-     passed.  For example, 'a`'define`'b' would expand to 'ab'.  But GNU
-     'm4' ignores certain builtins if they have missing arguments,
-     giving 'adefineb' for the above example.
+     passed.  For example, ‘a`'define`'b’ would expand to ‘ab’.  But GNU
+     ‘m4’ ignores certain builtins if they have missing arguments,
+     giving ‘adefineb’ for the above example.
 
-   * Traditional implementations handle 'define(`f',`1')' (*note
+   • Traditional implementations handle ‘define(`f',`1')’ (*note
      Define::) by undefining the entire stack of previous definitions,
-     and if doing 'undefine(`f')' first.  GNU 'm4' replaces just the top
-     definition on the stack, as if doing 'popdef(`f')' followed by
-     'pushdef(`f',`1')'.  POSIX allows either behavior.
+     and if doing ‘undefine(`f')’ first.  GNU ‘m4’ replaces just the top
+     definition on the stack, as if doing ‘popdef(`f')’ followed by
+     ‘pushdef(`f',`1')’.  POSIX allows either behavior.
 
-   * POSIX 2001 requires 'syscmd' (*note Syscmd::) to evaluate command
+   • POSIX 2001 requires ‘syscmd’ (*note Syscmd::) to evaluate command
      output for macro expansion, but this was a mistake that is
-     anticipated to be corrected in the next version of POSIX. GNU 'm4'
-     follows traditional behavior in 'syscmd' where output is not
-     rescanned, and provides the extension 'esyscmd' that does scan the
+     anticipated to be corrected in the next version of POSIX. GNU ‘m4’
+     follows traditional behavior in ‘syscmd’ where output is not
+     rescanned, and provides the extension ‘esyscmd’ that does scan the
      output.
 
-   * At one point, POSIX required 'changequote(ARG)' (*note
+   • At one point, POSIX required ‘changequote(ARG)’ (*note
      Changequote::) to use newline as the close quote, but this was a
      bug, and the next version of POSIX is anticipated to state that
      using empty strings or just one argument is unspecified.
-     Meanwhile, the GNU 'm4' behavior of treating an empty end-quote
-     delimiter as ''' is not portable, as Solaris treats it as repeating
+     Meanwhile, the GNU ‘m4’ behavior of treating an empty end-quote
+     delimiter as ‘'’ is not portable, as Solaris treats it as repeating
      the start-quote delimiter, and BSD treats it as leaving the
      previous end-quote delimiter unchanged.  For predictable results,
      never call changequote with just one argument, or with empty
      strings for arguments.
 
-   * At one point, POSIX required 'changecom(ARG,)' (*note Changecom::)
+   • At one point, POSIX required ‘changecom(ARG,)’ (*note Changecom::)
      to make it impossible to end a comment, but this is a bug, and the
      next version of POSIX is anticipated to state that using empty
-     strings is unspecified.  Meanwhile, the GNU 'm4' behavior of
+     strings is unspecified.  Meanwhile, the GNU ‘m4’ behavior of
      treating an empty end-comment delimiter as newline is not portable,
      as BSD treats it as leaving the previous end-comment delimiter
      unchanged.  It is also impossible in BSD implementations to disable
      comments, even though that is required by POSIX. For predictable
      results, never call changecom with empty strings for arguments.
 
-   * Most implementations of 'm4' give macros a higher precedence than
+   • Most implementations of ‘m4’ give macros a higher precedence than
      comments when parsing, meaning that if the start delimiter given to
-     'changecom' (*note Changecom::) starts with a macro name, comments
+     ‘changecom’ (*note Changecom::) starts with a macro name, comments
      are effectively disabled.  POSIX does not specify what the
-     precedence is, so this version of GNU 'm4' parser recognizes
+     precedence is, so this version of GNU ‘m4’ parser recognizes
      comments, then macros, then quoted strings.
 
-   * Traditional implementations allow argument collection, but not
+    Traditional implementations allow argument collection, but not
      string and comment processing, to span file boundaries.  Thus, if
-     'a.m4' contains 'len(', and 'b.m4' contains 'abc)', 'm4 a.m4 b.m4'
-     outputs '3' with traditional 'm4', but gives an error message that
-     the end of file was encountered inside a macro with GNU 'm4'.  On
+     ‘a.m4’ contains ‘len(’, and ‘b.m4’ contains ‘abc)’, ‘m4 a.m4 b.m4’
+     outputs ‘3’ with traditional ‘m4’, but gives an error message that
+     the end of file was encountered inside a macro with GNU ‘m4’.  On
      the other hand, traditional implementations do end of file
-     processing for files included with 'include' or 'sinclude' (*note
-     Include::), while GNU 'm4' seamlessly integrates the content of
-     those files.  Thus 'include(`a.m4')include(`b.m4')' will output '3'
+     processing for files included with ‘include’ or ‘sinclude’ (*note
+     Include::), while GNU ‘m4’ seamlessly integrates the content of
+     those files.  Thus ‘include(`a.m4')include(`b.m4')’ will output ‘3’
      instead of giving an error.
 
-   * Traditional 'm4' treats 'traceon' (*note Trace::) without arguments
+   • Traditional ‘m4’ treats ‘traceon’ (*note Trace::) without arguments
      as a global variable, independent of named macro tracing.  Also,
      once a macro is undefined, named tracing of that macro is lost.  On
-     the other hand, when GNU 'm4' encounters 'traceon' without
+     the other hand, when GNU ‘m4’ encounters ‘traceon’ without
      arguments, it turns tracing on for all existing definitions at the
-     time, but does not trace future definitions; 'traceoff' without
+     time, but does not trace future definitions; ‘traceoff’ without
      arguments turns tracing off for all definitions regardless of
      whether they were also traced by name; and tracing by name, such as
-     with '-tfoo' at the command line or 'traceon(`foo')' in the input,
+     with ‘-tfoo’ at the command line or ‘traceon(`foo')’ in the input,
      is an attribute that is preserved even if the macro is currently
      undefined.
 
@@ -6149,50 +6175,50 @@ behaviors is non-portable, as a future release of GNU 'm4' may change.
      not guaranteed to be reliable, even between different releases of
      GNU M4; however, the intent is that any future changes in trace
      output will only occur under the direction of additional
-     'debugmode' flags (*note Debug Levels::).
+     ‘debugmode’ flags (*note Debug Levels::).
 
-   * POSIX requires 'eval' (*note Eval::) to treat all operators with
-     the same precedence as C.  However, earlier versions of GNU 'm4'
-     followed the traditional behavior of other 'm4' implementations,
-     where bitwise and logical negation ('~' and '!') have lower
+   • POSIX requires ‘eval’ (*note Eval::) to treat all operators with
+     the same precedence as C.  However, earlier versions of GNU ‘m4’
+     followed the traditional behavior of other ‘m4’ implementations,
+     where bitwise and logical negation (‘~’ and ‘!’) have lower
      precedence than equality operators; and where equality operators
-     ('==' and '!=') had the same precedence as relational operators
-     (such as '<').  Use explicit parentheses to ensure proper
-     precedence.  As extensions to POSIX, GNU 'm4' gives well-defined
+     (‘==’ and ‘!=’) had the same precedence as relational operators
+     (such as ‘<’).  Use explicit parentheses to ensure proper
+     precedence.  As extensions to POSIX, GNU ‘m4’ gives well-defined
      semantics to operations that C leaves undefined, such as when
      overflow occurs, when shifting negative numbers, or when performing
-     division by zero.  POSIX also requires '=' to cause an error, but
-     many traditional implementations allowed it as an alias for '=='.
+     division by zero.  POSIX also requires ‘=’ to cause an error, but
+     many traditional implementations allowed it as an alias for ‘==’.
 
-   * POSIX 2001 requires 'translit' (*note Translit::) to treat each
+   • POSIX 2001 requires ‘translit’ (*note Translit::) to treat each
      character of the second and third arguments literally.  However, it
      is anticipated that the next version of POSIX will allow the GNU
-     'm4' behavior of treating '-' as a range operator.
+     ‘m4’ behavior of treating ‘-’ as a range operator.
 
-   * POSIX requires 'm4' to honor the locale environment variables of
-     'LANG', 'LC_ALL', 'LC_CTYPE', 'LC_MESSAGES', and 'NLSPATH', but
-     this has not yet been implemented in GNU 'm4'.
+   • POSIX requires ‘m4’ to honor the locale environment variables of
+     ‘LANG’, ‘LC_ALL’, ‘LC_CTYPE’, ‘LC_MESSAGES’, and ‘NLSPATH’, but
+     this has not yet been implemented in GNU ‘m4’.
 
-   * POSIX states that only unquoted leading newlines and blanks (that
+    POSIX states that only unquoted leading newlines and blanks (that
      is, space and tab) are ignored when collecting macro arguments.
      However, this appears to be a bug in POSIX, since most traditional
      implementations also ignore all whitespace (formfeed, carriage
-     return, and vertical tab).  GNU 'm4' follows tradition and ignores
+     return, and vertical tab).  GNU ‘m4’ follows tradition and ignores
      all leading unquoted whitespace.
 
-   * A strictly-compliant POSIX client is not allowed to use
+    A strictly-compliant POSIX client is not allowed to use
      command-line arguments not specified by POSIX. However, since this
-     version of M4 ignores 'POSIXLY_CORRECT' and enables the option
-     '--gnu' by default (*note Invoking m4: Limits control.), a client
+     version of M4 ignores ‘POSIXLY_CORRECT’ and enables the option
+     ‘--gnu’ by default (*note Invoking m4: Limits control.), a client
      desiring to be strictly compliant has no way to disable GNU
      extensions that conflict with POSIX when directly invoking the
-     compiled 'm4'.  A future version of 'GNU' M4 will honor the
-     environment variable 'POSIXLY_CORRECT', implicitly enabling
-     '--traditional' if it is set, in order to allow a
+     compiled ‘m4’.  A future version of ‘GNU’ M4 will honor the
+     environment variable ‘POSIXLY_CORRECT’, implicitly enabling
+     ‘--traditional’ if it is set, in order to allow a
      strictly-compliant client.  In the meantime, a client needing
      strict POSIX compliance can use the workaround of invoking a shell
-     script wrapper, where the wrapper then adds '--traditional' to the
-     arguments passed to the compiled 'm4'.
+     script wrapper, where the wrapper then adds ‘--traditional’ to the
+     arguments passed to the compiled ‘m4’.
 
 \1f
 File: m4.info,  Node: Other Incompatibilities,  Prev: Incompatibilities,  Up: Compatibility
@@ -6201,20 +6227,20 @@ File: m4.info,  Node: Other Incompatibilities,  Prev: Incompatibilities,  Up: Co
 ============================
 
 There are a few other incompatibilities between this implementation of
-'m4', and the System V version.
+‘m4’, and the System V version.
 
-   * GNU 'm4' implements sync lines differently from System V 'm4', when
-     text is being diverted.  GNU 'm4' outputs the sync lines when the
-     text is being diverted, and System V 'm4' when the diverted text is
+   • GNU ‘m4’ implements sync lines differently from System V ‘m4’, when
+     text is being diverted.  GNU ‘m4’ outputs the sync lines when the
+     text is being diverted, and System V ‘m4’ when the diverted text is
      being brought back.
 
      The problem is which lines and file names should be attached to
-     text that is being, or has been, diverted.  System V 'm4' regards
+     text that is being, or has been, diverted.  System V ‘m4’ regards
      all the diverted text as being generated by the source line
-     containing the 'undivert' call, whereas GNU 'm4' regards the
+     containing the ‘undivert’ call, whereas GNU ‘m4’ regards the
      diverted text as being generated at the time it is diverted.
 
-     The sync line option is used mostly when using 'm4' as a front end
+     The sync line option is used mostly when using ‘m4’ as a front end
      to a compiler.  If a diverted line causes a compiler error, the
      error messages should most probably refer to the place where the
      diversion was made, and not where it was inserted again.
@@ -6222,33 +6248,33 @@ There are a few other incompatibilities between this implementation of
           divert(2)2
           divert(1)1
           divert`'0
-          =>#line 3 "stdin"
-          =>0
+          #line 3 "stdin"
+          0
           ^D
-          =>#line 2 "stdin"
-          =>1
-          =>#line 1 "stdin"
-          =>2
+          #line 2 "stdin"
+          1
+          #line 1 "stdin"
+          2
 
-     The current 'm4' implementation has a limitation that the syncline
+     The current ‘m4’ implementation has a limitation that the syncline
      output at the start of each diversion occurs no matter what, even
      if the previous diversion did not end with a newline.  This goes
      contrary to the claim that synclines appear on a line by
      themselves, so this limitation may be corrected in a future version
-     of 'm4'.  In the meantime, when using '-s', it is wisest to make
+     of ‘m4’.  In the meantime, when using ‘-s’, it is wisest to make
      sure all diversions end with newline.
 
-   * GNU 'm4' makes no attempt at prohibiting self-referential
+   • GNU ‘m4’ makes no attempt at prohibiting self-referential
      definitions like:
 
           define(`x', `x')
-          =>
+          ⇒
           define(`x', `x ')
-          =>
+          ⇒
 
-     There is nothing inherently wrong with defining 'x' to return 'x'.
-     The wrong thing is to expand 'x' unquoted, because that would cause
-     an infinite rescan loop.  In 'm4', one might use macros to hold
+     There is nothing inherently wrong with defining ‘x’ to return ‘x’.
+     The wrong thing is to expand ‘x’ unquoted, because that would cause
+     an infinite rescan loop.  In ‘m4’, one might use macros to hold
      strings, as we do for variables in other programming languages,
      further checking them with:
 
@@ -6256,7 +6282,7 @@ There are a few other incompatibilities between this implementation of
 
      In cases like this one, an interdiction for a macro to hold its own
      name would be a useless limitation.  Of course, this leaves more
-     rope for the GNU 'm4' user to hang himself!  Rescanning hangs may
+     rope for the GNU ‘m4’ user to hang himself!  Rescanning hangs may
      be avoided through careful programming, a little like for endless
      loops in traditional programming languages.
 
@@ -6272,653 +6298,653 @@ presented here.
 
 * Menu:
 
-* Improved exch::               Solution for 'exch'
-* Improved forloop::            Solution for 'forloop'
-* Improved foreach::            Solution for 'foreach'
-* Improved copy::               Solution for 'copy'
-* Improved m4wrap::             Solution for 'm4wrap'
-* Improved cleardivert::        Solution for 'cleardivert'
-* Improved capitalize::         Solution for 'capitalize'
-* Improved fatal_error::        Solution for 'fatal_error'
+* Improved exch::               Solution for ‘exch’
+* Improved forloop::            Solution for ‘forloop’
+* Improved foreach::            Solution for ‘foreach’
+* Improved copy::               Solution for ‘copy’
+* Improved m4wrap::             Solution for ‘m4wrap’
+* Improved cleardivert::        Solution for ‘cleardivert’
+* Improved capitalize::         Solution for ‘capitalize’
+* Improved fatal_error::        Solution for ‘fatal_error’
 
 \1f
 File: m4.info,  Node: Improved exch,  Next: Improved forloop,  Up: Answers
 
-17.1 Solution for 'exch'
+17.1 Solution for ‘exch’
 ========================
 
-The 'exch' macro (*note Arguments::) as presented requires clients to
+The ‘exch’ macro (*note Arguments::) as presented requires clients to
 double quote their arguments.  A nicer definition, which lets clients
 follow the rule of thumb of one level of quoting per level of
-parentheses, involves adding quotes in the definition of 'exch', as
+parentheses, involves adding quotes in the definition of ‘exch’, as
 follows:
 
      define(`exch', ``$2', `$1'')
-     =>
+     ⇒
      define(exch(`expansion text', `macro'))
-     =>
+     ⇒
      macro
-     =>expansion text
+     expansion text
 
 \1f
 File: m4.info,  Node: Improved forloop,  Next: Improved foreach,  Prev: Improved exch,  Up: Answers
 
-17.2 Solution for 'forloop'
+17.2 Solution for ‘forloop’
 ===========================
 
-The 'forloop' macro (*note Forloop::) as presented earlier can go into
+The ‘forloop’ macro (*note Forloop::) as presented earlier can go into
 an infinite loop if given an iterator that is not parsed as a macro
 name.  It does not do any sanity checking on its numeric bounds, and
 only permits decimal numbers for bounds.  Here is an improved version,
-shipped as 'm4-1.4.18/examples/forloop2.m4'; this version also optimizes
+shipped as ‘m4-1.4.19/examples/forloop2.m4’; this version also optimizes
 overhead by calling four macros instead of six per iteration (excluding
 those in TEXT), by not dereferencing the ITERATOR in the helper
-'_forloop'.
+‘_forloop’.
 
      $ m4 -d -I examples
      undivert(`forloop2.m4')dnl
-     =>divert(`-1')
-     =># forloop(var, from, to, stmt) - improved version:
-     =>#   works even if VAR is not a strict macro name
-     =>#   performs sanity check that FROM is larger than TO
-     =>#   allows complex numerical expressions in TO and FROM
-     =>define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1',
-     =>  `pushdef(`$1')_$0(`$1', eval(`$2'),
-     =>    eval(`$3'), `$4')popdef(`$1')')')
-     =>define(`_forloop',
-     =>  `define(`$1', `$2')$4`'ifelse(`$2', `$3', `',
-     =>    `$0(`$1', incr(`$2'), `$3', `$4')')')
-     =>divert`'dnl
+     divert(`-1')
+     # forloop(var, from, to, stmt) - improved version:
+     #   works even if VAR is not a strict macro name
+     #   performs sanity check that FROM is larger than TO
+     #   allows complex numerical expressions in TO and FROM
+     define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1',
+       `pushdef(`$1')_$0(`$1', eval(`$2'),
+         eval(`$3'), `$4')popdef(`$1')')')
+     define(`_forloop',
+       `define(`$1', `$2')$4`'ifelse(`$2', `$3', `',
+         `$0(`$1', incr(`$2'), `$3', `$4')')')
+     divert`'dnl
      include(`forloop2.m4')
-     =>
+     ⇒
      forloop(`i', `2', `1', `no iteration occurs')
-     =>
+     ⇒
      forloop(`', `1', `2', ` odd iterator name')
-     => odd iterator name odd iterator name
+      odd iterator name odd iterator name
      forloop(`i', `5 + 5', `0xc', ` 0x`'eval(i, `16')')
-     => 0xa 0xb 0xc
+      0xa 0xb 0xc
      forloop(`i', `a', `b', `non-numeric bounds')
-     error->m4:stdin:6: bad expression in eval (bad input): (a) <= (b)
-     =>
+     errorm4:stdin:6: bad expression in eval (bad input): (a) <= (b)
+     ⇒
 
-   One other change to notice is that the improved version used '_$0'
-rather than '_foreach' to invoke the helper routine.  In general, this
+   One other change to notice is that the improved version used ‘_$0’
+rather than ‘_foreach’ to invoke the helper routine.  In general, this
 is a good practice to follow, because then the set of macros can be
 uniformly transformed.  The following example shows a transformation
-that doubles the current quoting and appends a suffix '2' to each
-transformed macro.  If 'foreach' refers to the literal '_foreach', then
-'foreach2' invokes '_foreach' instead of the intended '_foreach2', and
+that doubles the current quoting and appends a suffix ‘2’ to each
+transformed macro.  If ‘foreach’ refers to the literal ‘_foreach’, then
+‘foreach2’ invokes ‘_foreach’ instead of the intended ‘_foreach2’, and
 the mixing of quoting paradigms leads to an infinite recursion loop in
 this example.
 
      $ m4 -d -L 9 -I examples
      define(`arg1', `$1')include(`forloop2.m4')include(`quote.m4')
-     =>
+     ⇒
      define(`double', `define(`$1'`2',
        arg1(patsubst(dquote(defn(`$1')), `[`']', `\&\&')))')
-     =>
+     ⇒
      double(`forloop')double(`_forloop')defn(`forloop2')
-     =>ifelse(eval(``($2) <= ($3)''), ``1'',
-     =>  ``pushdef(``$1'')_$0(``$1'', eval(``$2''),
-     =>    eval(``$3''), ``$4'')popdef(``$1'')'')
+     ifelse(eval(``($2) <= ($3)''), ``1'',
+       ``pushdef(``$1'')_$0(``$1'', eval(``$2''),
+         eval(``$3''), ``$4'')popdef(``$1'')'')
      forloop(i, 1, 5, `ifelse(')forloop(i, 1, 5, `)')
-     =>
+     ⇒
      changequote(`[', `]')changequote([``], [''])
-     =>
+     ⇒
      forloop2(i, 1, 5, ``ifelse('')forloop2(i, 1, 5, ``)'')
-     =>
+     ⇒
      changequote`'include(`forloop.m4')
-     =>
+     ⇒
      double(`forloop')double(`_forloop')defn(`forloop2')
-     =>pushdef(``$1'', ``$2'')_forloop($@)popdef(``$1'')
+     pushdef(``$1'', ``$2'')_forloop($@)popdef(``$1'')
      forloop(i, 1, 5, `ifelse(')forloop(i, 1, 5, `)')
-     =>
+     ⇒
      changequote(`[', `]')changequote([``], [''])
-     =>
+     ⇒
      forloop2(i, 1, 5, ``ifelse('')forloop2(i, 1, 5, ``)'')
-     error->m4:stdin:12: recursion limit of 9 exceeded, use -L<N> to change it
+     errorm4:stdin:12: recursion limit of 9 exceeded, use -L<N> to change it
 
    One more optimization is still possible.  Instead of repeatedly
 assigning a variable then invoking or dereferencing it, it is possible
 to pass the current iterator value as a single argument.  Coupled with
-'curry' if other arguments are needed (*note Composition::), or with
+‘curry’ if other arguments are needed (*note Composition::), or with
 helper macros if the argument is needed in more than one place in the
 expansion, the output can be generated with three, rather than four,
 macros of overhead per iteration.  Notice how the file
-'m4-1.4.18/examples/forloop3.m4' rearranges the arguments of the helper
-'_forloop' to take two arguments that are placed around the current
+‘m4-1.4.19/examples/forloop3.m4’ rearranges the arguments of the helper
+‘_forloop’ to take two arguments that are placed around the current
 value.  By splitting a balanced set of parantheses across multiple
-arguments, the helper macro can now be shared by 'forloop' and the new
-'forloop_arg'.
+arguments, the helper macro can now be shared by ‘forloop’ and the new
+‘forloop_arg’.
 
      $ m4 -I examples
      include(`forloop3.m4')
-     =>
+     ⇒
      undivert(`forloop3.m4')dnl
-     =>divert(`-1')
-     =># forloop_arg(from, to, macro) - invoke MACRO(value) for
-     =>#   each value between FROM and TO, without define overhead
-     =>define(`forloop_arg', `ifelse(eval(`($1) <= ($2)'), `1',
-     =>  `_forloop(`$1', eval(`$2'), `$3(', `)')')')
-     =># forloop(var, from, to, stmt) - refactored to share code
-     =>define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1',
-     =>  `pushdef(`$1')_forloop(eval(`$2'), eval(`$3'),
-     =>    `define(`$1',', `)$4')popdef(`$1')')')
-     =>define(`_forloop',
-     =>  `$3`$1'$4`'ifelse(`$1', `$2', `',
-     =>    `$0(incr(`$1'), `$2', `$3', `$4')')')
-     =>divert`'dnl
+     divert(`-1')
+     # forloop_arg(from, to, macro) - invoke MACRO(value) for
+     #   each value between FROM and TO, without define overhead
+     define(`forloop_arg', `ifelse(eval(`($1) <= ($2)'), `1',
+       `_forloop(`$1', eval(`$2'), `$3(', `)')')')
+     # forloop(var, from, to, stmt) - refactored to share code
+     define(`forloop', `ifelse(eval(`($2) <= ($3)'), `1',
+       `pushdef(`$1')_forloop(eval(`$2'), eval(`$3'),
+         `define(`$1',', `)$4')popdef(`$1')')')
+     define(`_forloop',
+       `$3`$1'$4`'ifelse(`$1', `$2', `',
+         `$0(incr(`$1'), `$2', `$3', `$4')')')
+     divert`'dnl
      forloop(`i', `1', `3', ` i')
-     => 1 2 3
+      1 2 3
      define(`echo', `$@')
-     =>
+     ⇒
      forloop_arg(`1', `3', ` echo')
-     => 1 2 3
+      1 2 3
      include(`curry.m4')
-     =>
+     ⇒
      forloop_arg(`1', `3', `curry(`pushdef', `a')')
-     =>
+     ⇒
      a
-     =>3
+     3
      popdef(`a')a
-     =>2
+     2
      popdef(`a')a
-     =>1
+     1
      popdef(`a')a
-     =>a
+     a
 
    Of course, it is possible to make even more improvements, such as
 adding an optional step argument, or allowing iteration through
 descending sequences.  GNU Autoconf provides some of these additional
-bells and whistles in its 'm4_for' macro.
+bells and whistles in its ‘m4_for’ macro.
 
 \1f
 File: m4.info,  Node: Improved foreach,  Next: Improved copy,  Prev: Improved forloop,  Up: Answers
 
-17.3 Solution for 'foreach'
+17.3 Solution for ‘foreach’
 ===========================
 
-The 'foreach' and 'foreachq' macros (*note Foreach::) as presented
+The ‘foreach’ and ‘foreachq’ macros (*note Foreach::) as presented
 earlier each have flaws.  First, we will examine and fix the quadratic
-behavior of 'foreachq':
+behavior of ‘foreachq’:
 
      $ m4 -I examples
      include(`foreachq.m4')
-     =>
+     ⇒
      traceon(`shift')debugmode(`aq')
-     =>
+     ⇒
      foreachq(`x', ``1', `2', `3', `4'', `x
      ')dnl
-     =>1
-     error->m4trace: -3- shift(`1', `2', `3', `4')
-     error->m4trace: -2- shift(`1', `2', `3', `4')
-     =>2
-     error->m4trace: -4- shift(`1', `2', `3', `4')
-     error->m4trace: -3- shift(`2', `3', `4')
-     error->m4trace: -3- shift(`1', `2', `3', `4')
-     error->m4trace: -2- shift(`2', `3', `4')
-     =>3
-     error->m4trace: -5- shift(`1', `2', `3', `4')
-     error->m4trace: -4- shift(`2', `3', `4')
-     error->m4trace: -3- shift(`3', `4')
-     error->m4trace: -4- shift(`1', `2', `3', `4')
-     error->m4trace: -3- shift(`2', `3', `4')
-     error->m4trace: -2- shift(`3', `4')
-     =>4
-     error->m4trace: -6- shift(`1', `2', `3', `4')
-     error->m4trace: -5- shift(`2', `3', `4')
-     error->m4trace: -4- shift(`3', `4')
-     error->m4trace: -3- shift(`4')
-
-   Each successive iteration was adding more quoted 'shift' invocations,
+     1
+     errorm4trace: -3- shift(`1', `2', `3', `4')
+     errorm4trace: -2- shift(`1', `2', `3', `4')
+     2
+     errorm4trace: -4- shift(`1', `2', `3', `4')
+     errorm4trace: -3- shift(`2', `3', `4')
+     errorm4trace: -3- shift(`1', `2', `3', `4')
+     errorm4trace: -2- shift(`2', `3', `4')
+     3
+     errorm4trace: -5- shift(`1', `2', `3', `4')
+     errorm4trace: -4- shift(`2', `3', `4')
+     errorm4trace: -3- shift(`3', `4')
+     errorm4trace: -4- shift(`1', `2', `3', `4')
+     errorm4trace: -3- shift(`2', `3', `4')
+     errorm4trace: -2- shift(`3', `4')
+     4
+     errorm4trace: -6- shift(`1', `2', `3', `4')
+     errorm4trace: -5- shift(`2', `3', `4')
+     errorm4trace: -4- shift(`3', `4')
+     errorm4trace: -3- shift(`4')
+
+   Each successive iteration was adding more quoted ‘shift’ invocations,
 and the entire list contents were passing through every iteration.  In
 general, when recursing, it is a good idea to make the recursion use
-fewer arguments, rather than adding additional quoted uses of 'shift'.
-By doing so, 'm4' uses less memory, invokes fewer macros, is less likely
+fewer arguments, rather than adding additional quoted uses of ‘shift’.
+By doing so, ‘m4’ uses less memory, invokes fewer macros, is less likely
 to run into machine limits, and most importantly, performs faster.  The
-fixed version of 'foreachq' can be found in
-'m4-1.4.18/examples/foreachq2.m4':
+fixed version of ‘foreachq’ can be found in
+‘m4-1.4.19/examples/foreachq2.m4’:
 
      $ m4 -I examples
      include(`foreachq2.m4')
-     =>
+     ⇒
      undivert(`foreachq2.m4')dnl
-     =>include(`quote.m4')dnl
-     =>divert(`-1')
-     =># foreachq(x, `item_1, item_2, ..., item_n', stmt)
-     =>#   quoted list, improved version
-     =>define(`foreachq', `pushdef(`$1')_$0($@)popdef(`$1')')
-     =>define(`_arg1q', ``$1'')
-     =>define(`_rest', `ifelse(`$#', `1', `', `dquote(shift($@))')')
-     =>define(`_foreachq', `ifelse(`$2', `', `',
-     =>  `define(`$1', _arg1q($2))$3`'$0(`$1', _rest($2), `$3')')')
-     =>divert`'dnl
+     include(`quote.m4')dnl
+     divert(`-1')
+     # foreachq(x, `item_1, item_2, ..., item_n', stmt)
+     #   quoted list, improved version
+     define(`foreachq', `pushdef(`$1')_$0($@)popdef(`$1')')
+     define(`_arg1q', ``$1'')
+     define(`_rest', `ifelse(`$#', `1', `', `dquote(shift($@))')')
+     define(`_foreachq', `ifelse(`$2', `', `',
+       `define(`$1', _arg1q($2))$3`'$0(`$1', _rest($2), `$3')')')
+     divert`'dnl
      traceon(`shift')debugmode(`aq')
-     =>
+     ⇒
      foreachq(`x', ``1', `2', `3', `4'', `x
      ')dnl
-     =>1
-     error->m4trace: -3- shift(`1', `2', `3', `4')
-     =>2
-     error->m4trace: -3- shift(`2', `3', `4')
-     =>3
-     error->m4trace: -3- shift(`3', `4')
-     =>4
+     1
+     errorm4trace: -3- shift(`1', `2', `3', `4')
+     2
+     errorm4trace: -3- shift(`2', `3', `4')
+     3
+     errorm4trace: -3- shift(`3', `4')
+     4
 
    Note that the fixed version calls unquoted helper macros in
-'_foreachq' to trim elements immediately; those helper macros in turn
+‘_foreachq’ to trim elements immediately; those helper macros in turn
 must re-supply the layer of quotes lost in the macro invocation.
-Contrast the use of '_arg1q', which quotes the first list element, with
-'_arg1' of the earlier implementation that returned the first list
+Contrast the use of ‘_arg1q’, which quotes the first list element, with
+‘_arg1’ of the earlier implementation that returned the first list
 element directly.  Additionally, by calling the helper method
-immediately, the 'defn(`ITERATOR')' no longer contains unexpanded
+immediately, the ‘defn(`ITERATOR')’ no longer contains unexpanded
 macros.
 
    The astute m4 programmer might notice that the solution above still
 uses more memory and macro invocations, and thus more time, than
-strictly necessary.  Note that '$2', which contains an arbitrarily long
+strictly necessary.  Note that ‘$2’, which contains an arbitrarily long
 quoted list, is expanded and rescanned three times per iteration of
-'_foreachq'.  Furthermore, every iteration of the algorithm effectively
+‘_foreachq’.  Furthermore, every iteration of the algorithm effectively
 unboxes then reboxes the list, which costs a couple of macro
 invocations.  It is possible to rewrite the algorithm for a bit more
-speed by swapping the order of the arguments to '_foreachq' in order to
+speed by swapping the order of the arguments to ‘_foreachq’ in order to
 operate on an unboxed list in the first place, and by using the
-fixed-length '$#' instead of an arbitrary length list as the key to end
+fixed-length ‘$#’ instead of an arbitrary length list as the key to end
 recursion.  The result is an overhead of six macro invocations per loop
 (excluding any macros in TEXT), instead of eight.  This alternative
-approach is available as 'm4-1.4.18/examples/foreach3.m4':
+approach is available as ‘m4-1.4.19/examples/foreach3.m4’:
 
      $ m4 -I examples
      include(`foreachq3.m4')
-     =>
+     ⇒
      undivert(`foreachq3.m4')dnl
-     =>divert(`-1')
-     =># foreachq(x, `item_1, item_2, ..., item_n', stmt)
-     =>#   quoted list, alternate improved version
-     =>define(`foreachq', `ifelse(`$2', `', `',
-     =>  `pushdef(`$1')_$0(`$1', `$3', `', $2)popdef(`$1')')')
-     =>define(`_foreachq', `ifelse(`$#', `3', `',
-     =>  `define(`$1', `$4')$2`'$0(`$1', `$2',
-     =>    shift(shift(shift($@))))')')
-     =>divert`'dnl
+     divert(`-1')
+     # foreachq(x, `item_1, item_2, ..., item_n', stmt)
+     #   quoted list, alternate improved version
+     define(`foreachq', `ifelse(`$2', `', `',
+       `pushdef(`$1')_$0(`$1', `$3', `', $2)popdef(`$1')')')
+     define(`_foreachq', `ifelse(`$#', `3', `',
+       `define(`$1', `$4')$2`'$0(`$1', `$2',
+         shift(shift(shift($@))))')')
+     divert`'dnl
      traceon(`shift')debugmode(`aq')
-     =>
+     ⇒
      foreachq(`x', ``1', `2', `3', `4'', `x
      ')dnl
-     =>1
-     error->m4trace: -4- shift(`x', `x
-     error->', `', `1', `2', `3', `4')
-     error->m4trace: -3- shift(`x
-     error->', `', `1', `2', `3', `4')
-     error->m4trace: -2- shift(`', `1', `2', `3', `4')
-     =>2
-     error->m4trace: -4- shift(`x', `x
-     error->', `1', `2', `3', `4')
-     error->m4trace: -3- shift(`x
-     error->', `1', `2', `3', `4')
-     error->m4trace: -2- shift(`1', `2', `3', `4')
-     =>3
-     error->m4trace: -4- shift(`x', `x
-     error->', `2', `3', `4')
-     error->m4trace: -3- shift(`x
-     error->', `2', `3', `4')
-     error->m4trace: -2- shift(`2', `3', `4')
-     =>4
-     error->m4trace: -4- shift(`x', `x
-     error->', `3', `4')
-     error->m4trace: -3- shift(`x
-     error->', `3', `4')
-     error->m4trace: -2- shift(`3', `4')
-
-   In the current version of M4, every instance of '$@' is rescanned as
-it is encountered.  Thus, the 'foreachq3.m4' alternative uses much less
-memory than 'foreachq2.m4', and executes as much as 10% faster, since
-each iteration encounters fewer '$@'.  However, the implementation of
-rescanning every byte in '$@' is quadratic in the number of bytes
-scanned (for example, making the broken version in 'foreachq.m4' cubic,
+     1
+     errorm4trace: -4- shift(`x', `x
+     error', `', `1', `2', `3', `4')
+     errorm4trace: -3- shift(`x
+     error', `', `1', `2', `3', `4')
+     errorm4trace: -2- shift(`', `1', `2', `3', `4')
+     2
+     errorm4trace: -4- shift(`x', `x
+     error', `1', `2', `3', `4')
+     errorm4trace: -3- shift(`x
+     error', `1', `2', `3', `4')
+     errorm4trace: -2- shift(`1', `2', `3', `4')
+     3
+     errorm4trace: -4- shift(`x', `x
+     error', `2', `3', `4')
+     errorm4trace: -3- shift(`x
+     error', `2', `3', `4')
+     errorm4trace: -2- shift(`2', `3', `4')
+     4
+     errorm4trace: -4- shift(`x', `x
+     error', `3', `4')
+     errorm4trace: -3- shift(`x
+     error', `3', `4')
+     errorm4trace: -2- shift(`3', `4')
+
+   In the current version of M4, every instance of ‘$@’ is rescanned as
+it is encountered.  Thus, the ‘foreachq3.m4’ alternative uses much less
+memory than ‘foreachq2.m4’, and executes as much as 10% faster, since
+each iteration encounters fewer ‘$@’.  However, the implementation of
+rescanning every byte in ‘$@’ is quadratic in the number of bytes
+scanned (for example, making the broken version in ‘foreachq.m4’ cubic,
 rather than quadratic, in behavior).  A future release of M4 will
 improve the underlying implementation by reusing results of previous
-scans, so that both styles of 'foreachq' can become linear in the number
+scans, so that both styles of ‘foreachq’ can become linear in the number
 of bytes scanned.  Notice how the implementation injects an empty
-argument prior to expanding '$2' within 'foreachq'; the helper macro
-'_foreachq' then ignores the third argument altogether, and ends
+argument prior to expanding ‘$2’ within ‘foreachq’; the helper macro
+‘_foreachq’ then ignores the third argument altogether, and ends
 recursion when there are three arguments left because there was nothing
-left to pass through 'shift'.  Thus, each iteration only needs one
-'ifelse', rather than the two conditionals used in the version from
-'foreachq2.m4'.
+left to pass through ‘shift’.  Thus, each iteration only needs one
+‘ifelse’, rather than the two conditionals used in the version from
+‘foreachq2.m4’.
 
-   So far, all of the implementations of 'foreachq' presented have been
-quadratic with M4 1.4.x.  But 'forloop' is linear, because each
+   So far, all of the implementations of ‘foreachq’ presented have been
+quadratic with M4 1.4.x.  But ‘forloop’ is linear, because each
 iteration parses a constant amount of arguments.  So, it is possible to
-design a variant that uses 'forloop' to do the iteration, then uses '$@'
+design a variant that uses ‘forloop’ to do the iteration, then uses ‘$@’
 only once at the end, giving a linear result even with older M4
 implementations.  This implementation relies on the GNU extension that
-'$10' expands to the tenth argument rather than the first argument
-concatenated with '0'.  The trick is to define an intermediate macro
-that repeats the text 'm4_define(`$1', `$N')$2`'', with 'n' set to
+‘$10’ expands to the tenth argument rather than the first argument
+concatenated with ‘0’.  The trick is to define an intermediate macro
+that repeats the text ‘m4_define(`$1', `$N')$2`'’, with ‘n’ set to
 successive integers corresponding to each argument.  The helper macro
-'_foreachq_' is needed in order to generate the literal sequences such
-as '$1' into the intermediate macro, rather than expanding them as the
-arguments of '_foreachq'.  With this approach, no 'shift' calls are even
+‘_foreachq_’ is needed in order to generate the literal sequences such
+as ‘$1’ into the intermediate macro, rather than expanding them as the
+arguments of ‘_foreachq’.  With this approach, no ‘shift’ calls are even
 needed!  Even though there are seven macros of overhead per iteration
-instead of six in 'foreachq3.m4', the linear scaling is apparent at
+instead of six in ‘foreachq3.m4’, the linear scaling is apparent at
 relatively small list sizes.  However, this approach will need
 adjustment when a future version of M4 follows POSIX by no longer
-treating '$10' as the tenth argument; the anticipation is that '${10}'
+treating ‘$10’ as the tenth argument; the anticipation is that ‘${10}’
 can be used instead, although that alternative syntax is not yet
 supported.
 
      $ m4 -I examples
      include(`foreachq4.m4')
-     =>
+     ⇒
      undivert(`foreachq4.m4')dnl
-     =>include(`forloop2.m4')dnl
-     =>divert(`-1')
-     =># foreachq(x, `item_1, item_2, ..., item_n', stmt)
-     =>#   quoted list, version based on forloop
-     =>define(`foreachq',
-     =>`ifelse(`$2', `', `', `_$0(`$1', `$3', $2)')')
-     =>define(`_foreachq',
-     =>`pushdef(`$1', forloop(`$1', `3', `$#',
-     =>  `$0_(`1', `2', indir(`$1'))')`popdef(
-     =>    `$1')')indir(`$1', $@)')
-     =>define(`_foreachq_',
-     =>``define(`$$1', `$$3')$$2`''')
-     =>divert`'dnl
+     include(`forloop2.m4')dnl
+     divert(`-1')
+     # foreachq(x, `item_1, item_2, ..., item_n', stmt)
+     #   quoted list, version based on forloop
+     define(`foreachq',
+     `ifelse(`$2', `', `', `_$0(`$1', `$3', $2)')')
+     define(`_foreachq',
+     `pushdef(`$1', forloop(`$1', `3', `$#',
+       `$0_(`1', `2', indir(`$1'))')`popdef(
+         `$1')')indir(`$1', $@)')
+     define(`_foreachq_',
+     ``define(`$$1', `$$3')$$2`''')
+     divert`'dnl
      traceon(`shift')debugmode(`aq')
-     =>
+     ⇒
      foreachq(`x', ``1', `2', `3', `4'', `x
      ')dnl
-     =>1
-     =>2
-     =>3
-     =>4
-
-   For yet another approach, the improved version of 'foreach',
-available in 'm4-1.4.18/examples/foreach2.m4', simply overquotes the
-arguments to '_foreach' to begin with, using 'dquote_elt'.  Then
-'_foreach' can just use '_arg1' to remove the extra layer of quoting
+     1
+     2
+     3
+     4
+
+   For yet another approach, the improved version of ‘foreach’,
+available in ‘m4-1.4.19/examples/foreach2.m4’, simply overquotes the
+arguments to ‘_foreach’ to begin with, using ‘dquote_elt’.  Then
+‘_foreach’ can just use ‘_arg1’ to remove the extra layer of quoting
 that was added up front:
 
      $ m4 -I examples
      include(`foreach2.m4')
-     =>
+     ⇒
      undivert(`foreach2.m4')dnl
-     =>include(`quote.m4')dnl
-     =>divert(`-1')
-     =># foreach(x, (item_1, item_2, ..., item_n), stmt)
-     =>#   parenthesized list, improved version
-     =>define(`foreach', `pushdef(`$1')_$0(`$1',
-     =>  (dquote(dquote_elt$2)), `$3')popdef(`$1')')
-     =>define(`_arg1', `$1')
-     =>define(`_foreach', `ifelse(`$2', `(`')', `',
-     =>  `define(`$1', _arg1$2)$3`'$0(`$1', (dquote(shift$2)), `$3')')')
-     =>divert`'dnl
+     include(`quote.m4')dnl
+     divert(`-1')
+     # foreach(x, (item_1, item_2, ..., item_n), stmt)
+     #   parenthesized list, improved version
+     define(`foreach', `pushdef(`$1')_$0(`$1',
+       (dquote(dquote_elt$2)), `$3')popdef(`$1')')
+     define(`_arg1', `$1')
+     define(`_foreach', `ifelse(`$2', `(`')', `',
+       `define(`$1', _arg1$2)$3`'$0(`$1', (dquote(shift$2)), `$3')')')
+     divert`'dnl
      traceon(`shift')debugmode(`aq')
-     =>
+     ⇒
      foreach(`x', `(`1', `2', `3', `4')', `x
      ')dnl
-     error->m4trace: -4- shift(`1', `2', `3', `4')
-     error->m4trace: -4- shift(`2', `3', `4')
-     error->m4trace: -4- shift(`3', `4')
-     =>1
-     error->m4trace: -3- shift(``1'', ``2'', ``3'', ``4'')
-     =>2
-     error->m4trace: -3- shift(``2'', ``3'', ``4'')
-     =>3
-     error->m4trace: -3- shift(``3'', ``4'')
-     =>4
-     error->m4trace: -3- shift(``4'')
-
-   It is likewise possible to write a variant of 'foreach' that performs
+     errorm4trace: -4- shift(`1', `2', `3', `4')
+     errorm4trace: -4- shift(`2', `3', `4')
+     errorm4trace: -4- shift(`3', `4')
+     1
+     errorm4trace: -3- shift(``1'', ``2'', ``3'', ``4'')
+     2
+     errorm4trace: -3- shift(``2'', ``3'', ``4'')
+     3
+     errorm4trace: -3- shift(``3'', ``4'')
+     4
+     errorm4trace: -3- shift(``4'')
+
+   It is likewise possible to write a variant of ‘foreach’ that performs
 in linear time on M4 1.4.x; the easiest method is probably writing a
-version of 'foreach' that unboxes its list, then invokes '_foreachq' as
-previously defined in 'foreachq4.m4'.
+version of ‘foreach’ that unboxes its list, then invokes ‘_foreachq’ as
+previously defined in ‘foreachq4.m4’.
 
    In summary, recursion over list elements is trickier than it appeared
-at first glance, but provides a powerful idiom within 'm4' processing.
+at first glance, but provides a powerful idiom within ‘m4’ processing.
 As a final demonstration, both list styles are now able to handle
 several scenarios that would wreak havoc on one or both of the original
 implementations.  This points out one other difference between the list
-styles.  'foreach' evaluates unquoted list elements only once, in
-preparation for calling '_foreach', similary for 'foreachq' as provided
-by 'foreachq3.m4' or 'foreachq4.m4'.  But 'foreachq', as provided by
-'foreachq2.m4', evaluates unquoted list elements twice while visiting
-the first list element, once in '_arg1q' and once in '_rest'.  When
+styles.  ‘foreach’ evaluates unquoted list elements only once, in
+preparation for calling ‘_foreach’, similary for ‘foreachq’ as provided
+by ‘foreachq3.m4’ or ‘foreachq4.m4’.  But ‘foreachq’, as provided by
+‘foreachq2.m4’, evaluates unquoted list elements twice while visiting
+the first list element, once in ‘_arg1q’ and once in ‘_rest’.  When
 deciding which list style to use, one must take into account whether
 repeating the side effects of unquoted list elements will have any
 detrimental effects.
 
      $ m4 -I examples
      include(`foreach2.m4')
-     =>
+     ⇒
      include(`foreachq2.m4')
-     =>
+     ⇒
      dnl 0-element list:
      foreach(`x', `', `<x>') / foreachq(`x', `', `<x>')
-     => / 
+      / 
      dnl 1-element list of empty element
      foreach(`x', `()', `<x>') / foreachq(`x', ``'', `<x>')
-     =><> / <>
+     <> / <>
      dnl 2-element list of empty elements
      foreach(`x', `(`',`')', `<x>') / foreachq(`x', ``',`'', `<x>')
-     =><><> / <><>
+     <><> / <><>
      dnl 1-element list of a comma
      foreach(`x', `(`,')', `<x>') / foreachq(`x', ``,'', `<x>')
-     =><,> / <,>
+     <,> / <,>
      dnl 2-element list of unbalanced parentheses
      foreach(`x', `(`(', `)')', `<x>') / foreachq(`x', ``(', `)'', `<x>')
-     =><(><)> / <(><)>
+     <(><)> / <(><)>
      define(`ab', `oops')dnl using defn(`iterator')
      foreach(`x', `(`a', `b')', `defn(`x')') /dnl
       foreachq(`x', ``a', `b'', `defn(`x')')
-     =>ab / ab
+     ab / ab
      define(`active', `ACT, IVE')
-     =>
+     ⇒
      traceon(`active')
-     =>
+     ⇒
      dnl list of unquoted macros; expansion occurs before recursion
      foreach(`x', `(active, active)', `<x>
      ')dnl
-     error->m4trace: -4- active -> `ACT, IVE'
-     error->m4trace: -4- active -> `ACT, IVE'
-     =><ACT>
-     =><IVE>
-     =><ACT>
-     =><IVE>
+     errorm4trace: -4- active -> `ACT, IVE'
+     errorm4trace: -4- active -> `ACT, IVE'
+     <ACT>
+     <IVE>
+     <ACT>
+     <IVE>
      foreachq(`x', `active, active', `<x>
      ')dnl
-     error->m4trace: -3- active -> `ACT, IVE'
-     error->m4trace: -3- active -> `ACT, IVE'
-     =><ACT>
-     error->m4trace: -3- active -> `ACT, IVE'
-     error->m4trace: -3- active -> `ACT, IVE'
-     =><IVE>
-     =><ACT>
-     =><IVE>
+     errorm4trace: -3- active -> `ACT, IVE'
+     errorm4trace: -3- active -> `ACT, IVE'
+     <ACT>
+     errorm4trace: -3- active -> `ACT, IVE'
+     errorm4trace: -3- active -> `ACT, IVE'
+     <IVE>
+     <ACT>
+     <IVE>
      dnl list of quoted macros; expansion occurs during recursion
      foreach(`x', `(`active', `active')', `<x>
      ')dnl
-     error->m4trace: -1- active -> `ACT, IVE'
-     =><ACT, IVE>
-     error->m4trace: -1- active -> `ACT, IVE'
-     =><ACT, IVE>
+     errorm4trace: -1- active -> `ACT, IVE'
+     <ACT, IVE>
+     errorm4trace: -1- active -> `ACT, IVE'
+     <ACT, IVE>
      foreachq(`x', ``active', `active'', `<x>
      ')dnl
-     error->m4trace: -1- active -> `ACT, IVE'
-     =><ACT, IVE>
-     error->m4trace: -1- active -> `ACT, IVE'
-     =><ACT, IVE>
+     errorm4trace: -1- active -> `ACT, IVE'
+     <ACT, IVE>
+     errorm4trace: -1- active -> `ACT, IVE'
+     <ACT, IVE>
      dnl list of double-quoted macro names; no expansion
      foreach(`x', `(``active'', ``active'')', `<x>
      ')dnl
-     =><active>
-     =><active>
+     <active>
+     <active>
      foreachq(`x', ```active'', ``active''', `<x>
      ')dnl
-     =><active>
-     =><active>
+     <active>
+     <active>
 
 \1f
 File: m4.info,  Node: Improved copy,  Next: Improved m4wrap,  Prev: Improved foreach,  Up: Answers
 
-17.4 Solution for 'copy'
+17.4 Solution for ‘copy’
 ========================
 
-The macro 'copy' presented above is unable to handle builtin tokens with
+The macro ‘copy’ presented above is unable to handle builtin tokens with
 M4 1.4.x, because it tries to pass the builtin token through the macro
-'curry', where it is silently flattened to an empty string (*note
-Composition::).  Rather than using the problematic 'curry' to work
-around the limitation that 'stack_foreach' expects to invoke a macro
+‘curry’, where it is silently flattened to an empty string (*note
+Composition::).  Rather than using the problematic ‘curry’ to work
+around the limitation that ‘stack_foreach’ expects to invoke a macro
 that takes exactly one argument, we can write a new macro that lets us
-form the exact two-argument 'pushdef' call sequence needed, so that we
+form the exact two-argument ‘pushdef’ call sequence needed, so that we
 are no longer passing a builtin token through a text macro.
 
  -- Composite: stack_foreach_sep (MACRO, PRE, POST, SEP)
  -- Composite: stack_foreach_sep_lifo (MACRO, PRE, POST, SEP)
-     For each of the 'pushdef' definitions associated with MACRO, expand
-     the sequence 'PRE`'definition`'POST'.  Additionally, expand SEP
-     between definitions.  'stack_foreach_sep' visits the oldest
-     definition first, while 'stack_foreach_sep_lifo' visits the current
+     For each of the ‘pushdef’ definitions associated with MACRO, expand
+     the sequence ‘PRE`'definition`'POST’.  Additionally, expand SEP
+     between definitions.  ‘stack_foreach_sep’ visits the oldest
+     definition first, while ‘stack_foreach_sep_lifo’ visits the current
      definition first.  The expansion may dereference MACRO, but should
-     not modify it.  There are a few special macros, such as 'defn',
+     not modify it.  There are a few special macros, such as ‘defn’,
      which cannot be used as the MACRO parameter.
 
-   Note that 'stack_foreach(`MACRO', `ACTION')' is equivalent to
-'stack_foreach_sep(`MACRO', `ACTION(', `)')'.  By supplying explicit
+   Note that ‘stack_foreach(`MACRO', `ACTION')’ is equivalent to
+‘stack_foreach_sep(`MACRO', `ACTION(', `)')’.  By supplying explicit
 parentheses, split among the PRE and POST arguments to
-'stack_foreach_sep', it is now possible to construct macro calls with
+‘stack_foreach_sep’, it is now possible to construct macro calls with
 more than one argument, without passing builtin tokens through a macro
 call.  It is likewise possible to directly reference the stack
 definitions without a macro call, by leaving PRE and POST empty.  Thus,
-in addition to fixing 'copy' on builtin tokens, it also executes with
+in addition to fixing ‘copy’ on builtin tokens, it also executes with
 fewer macro invocations.
 
    The new macro also adds a separator that is only output after the
-first iteration of the helper '_stack_reverse_sep', implemented by
+first iteration of the helper ‘_stack_reverse_sep’, implemented by
 prepending the original SEP to PRE and omitting a SEP argument in
 subsequent iterations.  Note that the empty string that separates SEP
 from PRE is provided as part of the fourth argument when originally
-calling '_stack_reverse_sep', and not by writing '$4`'$3' as the third
+calling ‘_stack_reverse_sep’, and not by writing ‘$4`'$3’ as the third
 argument in the recursive call; while the other approach would give the
 same output, it does so at the expense of increasing the argument size
-on each iteration of '_stack_reverse_sep', which results in quadratic
+on each iteration of ‘_stack_reverse_sep’, which results in quadratic
 instead of linear execution time.  The improved stack walking macros are
-available in 'm4-1.4.18/examples/stack_sep.m4':
+available in ‘m4-1.4.19/examples/stack_sep.m4’:
 
      $ m4 -I examples
      include(`stack_sep.m4')
-     =>
+     ⇒
      define(`copy', `ifdef(`$2', `errprint(`$2 already defined
      ')m4exit(`1')',
         `stack_foreach_sep(`$1', `pushdef(`$2',', `)')')')dnl
      pushdef(`a', `1')pushdef(`a', defn(`divnum'))
-     =>
+     ⇒
      copy(`a', `b')
-     =>
+     ⇒
      b
-     =>0
+     0
      popdef(`b')
-     =>
+     ⇒
      b
-     =>1
+     1
      pushdef(`c', `1')pushdef(`c', `2')
-     =>
+     ⇒
      stack_foreach_sep_lifo(`c', `', `', `, ')
-     =>2, 1
+     2, 1
      undivert(`stack_sep.m4')dnl
-     =>divert(`-1')
-     =># stack_foreach_sep(macro, pre, post, sep)
-     =># Invoke PRE`'defn`'POST with a single argument of each definition
-     =># from the definition stack of MACRO, starting with the oldest, and
-     =># separated by SEP between definitions.
-     =>define(`stack_foreach_sep',
-     =>`_stack_reverse_sep(`$1', `tmp-$1')'dnl
-     =>`_stack_reverse_sep(`tmp-$1', `$1', `$2`'defn(`$1')$3', `$4`'')')
-     =># stack_foreach_sep_lifo(macro, pre, post, sep)
-     =># Like stack_foreach_sep, but starting with the newest definition.
-     =>define(`stack_foreach_sep_lifo',
-     =>`_stack_reverse_sep(`$1', `tmp-$1', `$2`'defn(`$1')$3', `$4`'')'dnl
-     =>`_stack_reverse_sep(`tmp-$1', `$1')')
-     =>define(`_stack_reverse_sep',
-     =>`ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0(
-     =>  `$1', `$2', `$4$3')')')
-     =>divert`'dnl
+     divert(`-1')
+     # stack_foreach_sep(macro, pre, post, sep)
+     # Invoke PRE`'defn`'POST with a single argument of each definition
+     # from the definition stack of MACRO, starting with the oldest, and
+     # separated by SEP between definitions.
+     define(`stack_foreach_sep',
+     `_stack_reverse_sep(`$1', `tmp-$1')'dnl
+     `_stack_reverse_sep(`tmp-$1', `$1', `$2`'defn(`$1')$3', `$4`'')')
+     # stack_foreach_sep_lifo(macro, pre, post, sep)
+     # Like stack_foreach_sep, but starting with the newest definition.
+     define(`stack_foreach_sep_lifo',
+     `_stack_reverse_sep(`$1', `tmp-$1', `$2`'defn(`$1')$3', `$4`'')'dnl
+     `_stack_reverse_sep(`tmp-$1', `$1')')
+     define(`_stack_reverse_sep',
+     `ifdef(`$1', `pushdef(`$2', defn(`$1'))$3`'popdef(`$1')$0(
+       `$1', `$2', `$4$3')')')
+     divert`'dnl
 
 \1f
 File: m4.info,  Node: Improved m4wrap,  Next: Improved cleardivert,  Prev: Improved copy,  Up: Answers
 
-17.5 Solution for 'm4wrap'
+17.5 Solution for ‘m4wrap’
 ==========================
 
-The replacement 'm4wrap' versions presented above, designed to guarantee
+The replacement ‘m4wrap’ versions presented above, designed to guarantee
 FIFO or LIFO order regardless of the underlying M4 implementation, share
 a bug when dealing with wrapped text that looks like parameter
-expansion.  Note how the invocation of 'm4wrapN' interprets these
+expansion.  Note how the invocation of ‘m4wrapN’ interprets these
 parameters, while using the builtin preserves them for their intended
 use.
 
      $ m4 -I examples
      include(`wraplifo.m4')
-     =>
+     ⇒
      m4wrap(`define(`foo', ``$0:'-$1-$*-$#-')foo(`a', `b')
      ')
-     =>
+     ⇒
      builtin(`m4wrap', ``'define(`bar', ``$0:'-$1-$*-$#-')bar(`a', `b')
      ')
-     =>
+     ⇒
      ^D
-     =>bar:-a-a,b-2-
-     =>m4wrap0:---0-
+     bar:-a-a,b-2-
+     m4wrap0:---0-
 
-   Additionally, the computation of '_m4wrap_level' and creation of
-multiple 'm4wrapN' placeholders in the original examples is more
+   Additionally, the computation of ‘_m4wrap_level’ and creation of
+multiple ‘m4wrapN’ placeholders in the original examples is more
 expensive in time and memory than strictly necessary.  Notice how the
-improved version grabs the wrapped text via 'defn' to avoid parameter
-expansion, then undefines '_m4wrap_text', before stripping a level of
-quotes with '_arg1' to expand the text.  That way, each level of
+improved version grabs the wrapped text via ‘defn’ to avoid parameter
+expansion, then undefines ‘_m4wrap_text’, before stripping a level of
+quotes with ‘_arg1’ to expand the text.  That way, each level of
 wrapping reuses the single placeholder, which starts each nesting level
 in an undefined state.
 
    Finally, it is worth emulating the GNU M4 extension of saving all
-arguments to 'm4wrap', separated by a space, rather than saving just the
-first argument.  This is done with the 'join' macro documented
+arguments to ‘m4wrap’, separated by a space, rather than saving just the
+first argument.  This is done with the ‘join’ macro documented
 previously (*note Shift::).  The improved LIFO example is shipped as
-'m4-1.4.18/examples/wraplifo2.m4', and can easily be converted to a FIFO
-solution by swapping the adjacent invocations of 'joinall' and 'defn'.
+‘m4-1.4.19/examples/wraplifo2.m4’, and can easily be converted to a FIFO
+solution by swapping the adjacent invocations of ‘joinall’ and ‘defn’.
 
      $ m4 -I examples
      include(`wraplifo2.m4')
-     =>
+     ⇒
      undivert(`wraplifo2.m4')dnl
-     =>dnl Redefine m4wrap to have LIFO semantics, improved example.
-     =>include(`join.m4')dnl
-     =>define(`_m4wrap', defn(`m4wrap'))dnl
-     =>define(`_arg1', `$1')dnl
-     =>define(`m4wrap',
-     =>`ifdef(`_$0_text',
-     =>       `define(`_$0_text', joinall(` ', $@)defn(`_$0_text'))',
-     =>       `_$0(`_arg1(defn(`_$0_text')undefine(`_$0_text'))')dnl
-     =>define(`_$0_text', joinall(` ', $@))')')dnl
+     dnl Redefine m4wrap to have LIFO semantics, improved example.
+     include(`join.m4')dnl
+     define(`_m4wrap', defn(`m4wrap'))dnl
+     define(`_arg1', `$1')dnl
+     define(`m4wrap',
+     `ifdef(`_$0_text',
+            `define(`_$0_text', joinall(` ', $@)defn(`_$0_text'))',
+            `_$0(`_arg1(defn(`_$0_text')undefine(`_$0_text'))')dnl
+     define(`_$0_text', joinall(` ', $@))')')dnl
      m4wrap(`define(`foo', ``$0:'-$1-$*-$#-')foo(`a', `b')
      ')
-     =>
+     ⇒
      m4wrap(`lifo text
      m4wrap(`nested', `', `$@
      ')')
-     =>
+     ⇒
      ^D
-     =>lifo text
-     =>foo:-a-a,b-2-
-     =>nested  $@
+     lifo text
+     foo:-a-a,b-2-
+     nested  $@
 
 \1f
 File: m4.info,  Node: Improved cleardivert,  Next: Improved capitalize,  Prev: Improved m4wrap,  Up: Answers
 
-17.6 Solution for 'cleardivert'
+17.6 Solution for ‘cleardivert’
 ===============================
 
-The 'cleardivert' macro (*note Cleardivert::) cannot, as it stands, be
+The ‘cleardivert’ macro (*note Cleardivert::) cannot, as it stands, be
 called without arguments to clear all pending diversions.  That is
 because using undivert with an empty string for an argument is different
 than using it with no arguments at all.  Compare the earlier definition
@@ -6926,37 +6952,37 @@ with one that takes the number of arguments into account:
 
      define(`cleardivert',
        `pushdef(`_n', divnum)divert(`-1')undivert($@)divert(_n)popdef(`_n')')
-     =>
+     ⇒
      divert(`1')one
      divert
-     =>
+     ⇒
      cleardivert
-     =>
+     ⇒
      undivert
-     =>one
-     =>
+     one
+     ⇒
      define(`cleardivert',
        `pushdef(`_num', divnum)divert(`-1')ifelse(`$#', `0',
          `undivert`'', `undivert($@)')divert(_num)popdef(`_num')')
-     =>
+     ⇒
      divert(`2')two
      divert
-     =>
+     ⇒
      cleardivert
-     =>
+     ⇒
      undivert
-     =>
+     ⇒
 
 \1f
 File: m4.info,  Node: Improved capitalize,  Next: Improved fatal_error,  Prev: Improved cleardivert,  Up: Answers
 
-17.7 Solution for 'capitalize'
+17.7 Solution for ‘capitalize’
 ==============================
 
-The 'capitalize' macro (*note Patsubst::) as presented earlier does not
+The ‘capitalize’ macro (*note Patsubst::) as presented earlier does not
 allow clients to follow the quoting rule of thumb.  Consider the three
-macros 'active', 'Active', and 'ACTIVE', and the difference between
-calling 'capitalize' with the expansion of a macro, expanding the result
+macros ‘active’, ‘Active’, and ‘ACTIVE’, and the difference between
+calling ‘capitalize’ with the expansion of a macro, expanding the result
 of a case change, and changing the case of a double-quoted string:
 
      $ m4 -I examples
@@ -6965,69 +6991,69 @@ of a case change, and changing the case of a double-quoted string:
      define(`Active', `Act2, Ive')dnl
      define(`ACTIVE', `ACT3, IVE')dnl
      upcase(active)
-     =>ACT1,IVE
+     ACT1,IVE
      upcase(`active')
-     =>ACT3, IVE
+     ACT3, IVE
      upcase(``active'')
-     =>ACTIVE
+     ACTIVE
      downcase(ACTIVE)
-     =>act3,ive
+     act3,ive
      downcase(`ACTIVE')
-     =>act1, ive
+     act1, ive
      downcase(``ACTIVE'')
-     =>active
+     active
      capitalize(active)
-     =>Act1
+     Act1
      capitalize(`active')
-     =>Active
+     Active
      capitalize(``active'')
-     =>_capitalize(`active')
+     _capitalize(`active')
      define(`A', `OOPS')
-     =>
+     ⇒
      capitalize(active)
-     =>OOPSct1
+     OOPSct1
      capitalize(`active')
-     =>OOPSctive
+     OOPSctive
 
-   First, when 'capitalize' is called with more than one argument, it
-was throwing away later arguments, whereas 'upcase' and 'downcase' used
-'$*' to collect them all.  The fix is simple: use '$*' consistently.
+   First, when ‘capitalize’ is called with more than one argument, it
+was throwing away later arguments, whereas ‘upcase’ and ‘downcase’ used
+‘$*’ to collect them all.  The fix is simple: use ‘$*’ consistently.
 
-   Next, with single-quoting, 'capitalize' outputs a single character, a
+   Next, with single-quoting, ‘capitalize’ outputs a single character, a
 set of quotes, then the rest of the characters, making it impossible to
-invoke 'Active' after the fact, and allowing the alternate macro 'A' to
+invoke ‘Active’ after the fact, and allowing the alternate macro ‘A’ to
 interfere.  Here, the solution is to use additional quoting in the
 helper macros, then pass the final over-quoted output string through
-'_arg1' to remove the extra quoting and finally invoke the concatenated
+‘_arg1’ to remove the extra quoting and finally invoke the concatenated
 portions as a single string.
 
    Finally, when passed a double-quoted string, the nested macro
-'_capitalize' is never invoked because it ended up nested inside quotes.
+‘_capitalize’ is never invoked because it ended up nested inside quotes.
 This one is the toughest to fix.  In short, we have no idea how many
 levels of quotes are in effect on the substring being altered by
-'patsubst'.  If the replacement string cannot be expressed entirely in
+‘patsubst’.  If the replacement string cannot be expressed entirely in
 terms of literal text and backslash substitutions, then we need a
 mechanism to guarantee that the helper macros are invoked outside of
-quotes.  In other words, this sounds like a job for 'changequote' (*note
+quotes.  In other words, this sounds like a job for ‘changequote’ (*note
 Changequote::).  By changing the active quoting characters, we can
-guarantee that replacement text injected by 'patsubst' always occurs in
+guarantee that replacement text injected by ‘patsubst’ always occurs in
 the middle of a string that has exactly one level of over-quoting using
 alternate quotes; so the replacement text closes the quoted string,
 invokes the helper macros, then reopens the quoted string.  In turn,
 that means the replacement text has unbalanced quotes, necessitating
-another round of 'changequote'.
+another round of ‘changequote’.
 
    In the fixed version below, (also shipped as
-'m4-1.4.18/examples/capitalize2.m4'), 'capitalize' uses the alternate
-quotes of '<<[' and ']>>' (the longer strings are chosen so as to be
+‘m4-1.4.19/examples/capitalize2.m4’), ‘capitalize’ uses the alternate
+quotes of ‘<<[’ and ‘]>>’ (the longer strings are chosen so as to be
 less likely to appear in the text being converted).  The helpers
-'_to_alt' and '_from_alt' merely reduce the number of characters
-required to perform a 'changequote', since the definition changes twice.
-The outermost pair means that 'patsubst' and '_capitalize_alt' are
+‘_to_alt’ and ‘_from_alt’ merely reduce the number of characters
+required to perform a ‘changequote’, since the definition changes twice.
+The outermost pair means that ‘patsubst’ and ‘_capitalize_alt’ are
 invoked with alternate quoting; the innermost pair is used so that the
-third argument to 'patsubst' can contain an unbalanced ']>>'/'<<[' pair.
-Note that 'upcase' and 'downcase' must be redefined as '_upcase_alt' and
-'_downcase_alt', since they contain nested quotes but are invoked with
+third argument to ‘patsubst’ can contain an unbalanced ‘]>>’/‘<<[’ pair.
+Note that ‘upcase’ and ‘downcase’ must be redefined as ‘_upcase_alt’ and
+‘_downcase_alt’, since they contain nested quotes but are invoked with
 the alternate quoting scheme in effect.
 
      $ m4 -I examples
@@ -7037,40 +7063,40 @@ the alternate quoting scheme in effect.
      define(`ACTIVE', `ACT3, IVE')dnl
      define(`A', `OOPS')dnl
      capitalize(active; `active'; ``active''; ```actIVE''')
-     =>Act1,Ive; Act2, Ive; Active; `Active'
+     Act1,Ive; Act2, Ive; Active; `Active'
      undivert(`capitalize2.m4')dnl
-     =>divert(`-1')
-     =># upcase(text)
-     =># downcase(text)
-     =># capitalize(text)
-     =>#   change case of text, improved version
-     =>define(`upcase', `translit(`$*', `a-z', `A-Z')')
-     =>define(`downcase', `translit(`$*', `A-Z', `a-z')')
-     =>define(`_arg1', `$1')
-     =>define(`_to_alt', `changequote(`<<[', `]>>')')
-     =>define(`_from_alt', `changequote(<<[`]>>, <<[']>>)')
-     =>define(`_upcase_alt', `translit(<<[$*]>>, <<[a-z]>>, <<[A-Z]>>)')
-     =>define(`_downcase_alt', `translit(<<[$*]>>, <<[A-Z]>>, <<[a-z]>>)')
-     =>define(`_capitalize_alt',
-     =>  `regexp(<<[$1]>>, <<[^\(\w\)\(\w*\)]>>,
-     =>    <<[_upcase_alt(<<[<<[\1]>>]>>)_downcase_alt(<<[<<[\2]>>]>>)]>>)')
-     =>define(`capitalize',
-     =>  `_arg1(_to_alt()patsubst(<<[<<[$*]>>]>>, <<[\w+]>>,
-     =>    _from_alt()`]>>_$0_alt(<<[\&]>>)<<['_to_alt())_from_alt())')
-     =>divert`'dnl
+     divert(`-1')
+     # upcase(text)
+     # downcase(text)
+     # capitalize(text)
+     #   change case of text, improved version
+     define(`upcase', `translit(`$*', `a-z', `A-Z')')
+     define(`downcase', `translit(`$*', `A-Z', `a-z')')
+     define(`_arg1', `$1')
+     define(`_to_alt', `changequote(`<<[', `]>>')')
+     define(`_from_alt', `changequote(<<[`]>>, <<[']>>)')
+     define(`_upcase_alt', `translit(<<[$*]>>, <<[a-z]>>, <<[A-Z]>>)')
+     define(`_downcase_alt', `translit(<<[$*]>>, <<[A-Z]>>, <<[a-z]>>)')
+     define(`_capitalize_alt',
+       `regexp(<<[$1]>>, <<[^\(\w\)\(\w*\)]>>,
+         <<[_upcase_alt(<<[<<[\1]>>]>>)_downcase_alt(<<[<<[\2]>>]>>)]>>)')
+     define(`capitalize',
+       `_arg1(_to_alt()patsubst(<<[<<[$*]>>]>>, <<[\w+]>>,
+         _from_alt()`]>>_$0_alt(<<[\&]>>)<<['_to_alt())_from_alt())')
+     divert`'dnl
 
 \1f
 File: m4.info,  Node: Improved fatal_error,  Prev: Improved capitalize,  Up: Answers
 
-17.8 Solution for 'fatal_error'
+17.8 Solution for ‘fatal_error’
 ===============================
 
-The 'fatal_error' macro (*note M4exit::) is not robust to versions of
-GNU M4 earlier than 1.4.8, where invoking '__file__' (*note Location::)
-inside 'm4wrap' would result in an empty string, and '__line__' resulted
-in '0' even though all files start at line 1.  Furthermore, versions
-earlier than 1.4.6 did not support the '__program__' macro.  If you want
-'fatal_error' to work across the entire 1.4.x release series, a better
+The ‘fatal_error’ macro (*note M4exit::) is not robust to versions of
+GNU M4 earlier than 1.4.8, where invoking ‘__file__’ (*note Location::)
+inside ‘m4wrap’ would result in an empty string, and ‘__line__’ resulted
+in ‘0’ even though all files start at line 1.  Furthermore, versions
+earlier than 1.4.6 did not support the ‘__program__’ macro.  If you want
+‘fatal_error’ to work across the entire 1.4.x release series, a better
 implementation would be:
 
      define(`fatal_error',
@@ -7078,14 +7104,14 @@ implementation would be:
      `:ifelse(__line__, `0', `',
          `__file__:__line__:')` fatal error: $*
      ')m4exit(`1')')
-     =>
+     ⇒
      m4wrap(`divnum(`demo of internal message')
      fatal_error(`inside wrapped text')')
-     =>
+     ⇒
      ^D
-     error->m4:stdin:6: Warning: excess arguments to builtin `divnum' ignored
-     =>0
-     error->m4:stdin:6: fatal error: inside wrapped text
+     errorm4:stdin:6: Warning: excess arguments to builtin `divnum' ignored
+     0
+     errorm4:stdin:6: fatal error: inside wrapped text
 
 \1f
 File: m4.info,  Node: Copying This Package,  Next: Copying This Manual,  Prev: Answers,  Up: Top
@@ -7109,7 +7135,7 @@ A.1 License for copying the M4 package
 
                         Version 3, 29 June 2007
 
-     Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+     Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
 
      Everyone is permitted to copy and distribute verbatim copies of this
      license document, but changing it is not allowed.
@@ -7123,7 +7149,7 @@ and other kinds of works.
    The licenses for most software and other practical works are designed
 to take away your freedom to share and change the works.  By contrast,
 the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
+share and change all versions of a programto make sure it remains free
 software for all its users.  We, the Free Software Foundation, use the
 GNU General Public License for most of our software; it applies also to
 any other work released this way by its authors.  You can apply it to
@@ -7151,16 +7177,16 @@ know their rights.
 (1) assert copyright on the software, and (2) offer you this License
 giving you legal permission to copy, distribute and/or modify it.
 
-   For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software.  For both users' and
-authors' sake, the GPL requires that modified versions be marked as
+   For the developers’ and authors’ protection, the GPL clearly explains
+that there is no warranty for this free software.  For both users and
+authors sake, the GPL requires that modified versions be marked as
 changed, so that their problems will not be attributed erroneously to
 authors of previous versions.
 
    Some devices are designed to deny users access to install or run
 modified versions of the software inside them, although the manufacturer
 can do so.  This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software.  The systematic
+protecting users freedom to change the software.  The systematic
 pattern of such abuse occurs in the area of products for individuals to
 use, which is precisely where it is most unacceptable.  Therefore, we
 have designed this version of the GPL to prohibit the practice for those
@@ -7183,25 +7209,25 @@ TERMS AND CONDITIONS
 
   0. Definitions.
 
-     "This License" refers to version 3 of the GNU General Public
+     “This License” refers to version 3 of the GNU General Public
      License.
 
-     "Copyright" also means copyright-like laws that apply to other
+     “Copyright” also means copyright-like laws that apply to other
      kinds of works, such as semiconductor masks.
 
-     "The Program" refers to any copyrightable work licensed under this
-     License.  Each licensee is addressed as "you".  "Licensees" and
-     "recipients" may be individuals or organizations.
+     “The Program” refers to any copyrightable work licensed under this
+     License.  Each licensee is addressed as “you”.  “Licensees” and
+     “recipients” may be individuals or organizations.
 
-     To "modify" a work means to copy from or adapt all or part of the
+     To “modify” a work means to copy from or adapt all or part of the
      work in a fashion requiring copyright permission, other than the
-     making of an exact copy.  The resulting work is called a "modified
-     version" of the earlier work or a work "based on" the earlier work.
+     making of an exact copy.  The resulting work is called a modified
+     version” of the earlier work or a work “based on” the earlier work.
 
-     A "covered work" means either the unmodified Program or a work
+     A “covered work” means either the unmodified Program or a work
      based on the Program.
 
-     To "propagate" a work means to do anything with it that, without
+     To “propagate” a work means to do anything with it that, without
      permission, would make you directly or secondarily liable for
      infringement under applicable copyright law, except executing it on
      a computer or modifying a private copy.  Propagation includes
@@ -7209,12 +7235,12 @@ TERMS AND CONDITIONS
      available to the public, and in some countries other activities as
      well.
 
-     To "convey" a work means any kind of propagation that enables other
+     To “convey” a work means any kind of propagation that enables other
      parties to make or receive copies.  Mere interaction with a user
      through a computer network, with no transfer of a copy, is not
      conveying.
 
-     An interactive user interface displays "Appropriate Legal Notices"
+     An interactive user interface displays “Appropriate Legal Notices”
      to the extent that it includes a convenient and prominently visible
      feature that (1) displays an appropriate copyright notice, and (2)
      tells the user that there is no warranty for the work (except to
@@ -7226,33 +7252,33 @@ TERMS AND CONDITIONS
 
   1. Source Code.
 
-     The "source code" for a work means the preferred form of the work
-     for making modifications to it.  "Object code" means any non-source
+     The “source code” for a work means the preferred form of the work
+     for making modifications to it.  “Object code” means any non-source
      form of a work.
 
-     A "Standard Interface" means an interface that either is an
+     A “Standard Interface” means an interface that either is an
      official standard defined by a recognized standards body, or, in
      the case of interfaces specified for a particular programming
      language, one that is widely used among developers working in that
      language.
 
-     The "System Libraries" of an executable work include anything,
+     The “System Libraries” of an executable work include anything,
      other than the work as a whole, that (a) is included in the normal
      form of packaging a Major Component, but which is not part of that
      Major Component, and (b) serves only to enable use of the work with
      that Major Component, or to implement a Standard Interface for
      which an implementation is available to the public in source code
-     form.  A "Major Component", in this context, means a major
+     form.  A “Major Component”, in this context, means a major
      essential component (kernel, window system, and so on) of the
      specific operating system (if any) on which the executable work
      runs, or a compiler used to produce the work, or an object code
      interpreter used to run it.
 
-     The "Corresponding Source" for a work in object code form means all
+     The “Corresponding Source” for a work in object code form means all
      the source code needed to generate, install, and (for an executable
      work) run the object code and to modify the work, including scripts
      to control those activities.  However, it does not include the
-     work's System Libraries, or general-purpose tools or generally
+     works System Libraries, or general-purpose tools or generally
      available free programs which are used unmodified in performing
      those activities but which are not part of the work.  For example,
      Corresponding Source includes interface definition files associated
@@ -7296,7 +7322,7 @@ TERMS AND CONDITIONS
      the conditions stated below.  Sublicensing is not allowed; section
      10 makes it unnecessary.
 
-  3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+  3. Protecting Users Legal Rights From Anti-Circumvention Law.
 
      No covered work shall be deemed part of an effective technological
      measure under any applicable law fulfilling obligations under
@@ -7309,12 +7335,12 @@ TERMS AND CONDITIONS
      circumvention is effected by exercising rights under this License
      with respect to the covered work, and you disclaim any intention to
      limit operation or modification of the work as a means of
-     enforcing, against the work's users, your or third parties' legal
+     enforcing, against the work’s users, your or third parties’ legal
      rights to forbid circumvention of technological measures.
 
   4. Conveying Verbatim Copies.
 
-     You may convey verbatim copies of the Program's source code as you
+     You may convey verbatim copies of the Programs source code as you
      receive it, in any medium, provided that you conspicuously and
      appropriately publish on each copy an appropriate copyright notice;
      keep intact all notices stating that this License and any
@@ -7338,7 +7364,7 @@ TERMS AND CONDITIONS
        b. The work must carry prominent notices stating that it is
           released under this License and any conditions added under
           section 7.  This requirement modifies the requirement in
-          section 4 to "keep intact all notices".
+          section 4 to “keep intact all notices”.
 
        c. You must license the entire work, as a whole, under this
           License to anyone who comes into possession of a copy.  This
@@ -7358,9 +7384,9 @@ TERMS AND CONDITIONS
      works, which are not by their nature extensions of the covered
      work, and which are not combined with it such as to form a larger
      program, in or on a volume of a storage or distribution medium, is
-     called an "aggregate" if the compilation and its resulting
+     called an “aggregate” if the compilation and its resulting
      copyright are not used to limit the access or legal rights of the
-     compilation's users beyond what the individual works permit.
+     compilations users beyond what the individual works permit.
      Inclusion of a covered work in an aggregate does not cause this
      License to apply to the other parts of the aggregate.
 
@@ -7418,13 +7444,13 @@ TERMS AND CONDITIONS
      excluded from the Corresponding Source as a System Library, need
      not be included in conveying the object code work.
 
-     A "User Product" is either (1) a "consumer product", which means
+     A “User Product” is either (1) a “consumer product”, which means
      any tangible personal property which is normally used for personal,
      family, or household purposes, or (2) anything designed or sold for
      incorporation into a dwelling.  In determining whether a product is
      a consumer product, doubtful cases shall be resolved in favor of
      coverage.  For a particular product received by a particular user,
-     "normally used" refers to a typical or common use of that class of
+     “normally used” refers to a typical or common use of that class of
      product, regardless of the status of the particular user or of the
      way in which the particular user actually uses, or expects or is
      expected to use, the product.  A product is a consumer product
@@ -7432,7 +7458,7 @@ TERMS AND CONDITIONS
      industrial or non-consumer uses, unless such uses represent the
      only significant mode of use of the product.
 
-     "Installation Information" for a User Product means any methods,
+     “Installation Information” for a User Product means any methods,
      procedures, authorization keys, or other information required to
      install and execute modified versions of a covered work in that
      User Product from a modified version of its Corresponding Source.
@@ -7468,7 +7494,7 @@ TERMS AND CONDITIONS
 
   7. Additional Terms.
 
-     "Additional permissions" are terms that supplement the terms of
+     “Additional permissions” are terms that supplement the terms of
      this License by making exceptions from one or more of its
      conditions.  Additional permissions that are applicable to the
      entire Program shall be treated as though they were included in
@@ -7513,8 +7539,8 @@ TERMS AND CONDITIONS
           the recipient, for any liability that these contractual
           assumptions directly impose on those licensors and authors.
 
-     All other non-permissive additional terms are considered "further
-     restrictions" within the meaning of section 10.  If the Program as
+     All other non-permissive additional terms are considered further
+     restrictions within the meaning of section 10.  If the Program as
      you received it, or any part of it, contains a notice stating that
      it is governed by this License along with a term that is a further
      restriction, you may remove that term.  If a license document
@@ -7580,12 +7606,12 @@ TERMS AND CONDITIONS
      responsible for enforcing compliance by third parties with this
      License.
 
-     An "entity transaction" is a transaction transferring control of an
+     An “entity transaction” is a transaction transferring control of an
      organization, or substantially all assets of one, or subdividing an
      organization, or merging organizations.  If propagation of a
      covered work results from an entity transaction, each party to that
      transaction who receives a copy of the work also receives whatever
-     licenses to the work the party's predecessor in interest had or
+     licenses to the work the partys predecessor in interest had or
      could give under the previous paragraph, plus a right to possession
      of the Corresponding Source of the work from the predecessor in
      interest, if the predecessor has it or can get it with reasonable
@@ -7602,31 +7628,31 @@ TERMS AND CONDITIONS
 
   11. Patents.
 
-     A "contributor" is a copyright holder who authorizes use under this
+     A “contributor” is a copyright holder who authorizes use under this
      License of the Program or a work on which the Program is based.
-     The work thus licensed is called the contributor's "contributor
-     version".
+     The work thus licensed is called the contributor’s “contributor
+     version.
 
-     A contributor's "essential patent claims" are all patent claims
+     A contributor’s “essential patent claims” are all patent claims
      owned or controlled by the contributor, whether already acquired or
      hereafter acquired, that would be infringed by some manner,
      permitted by this License, of making, using, or selling its
      contributor version, but do not include claims that would be
      infringed only as a consequence of further modification of the
-     contributor version.  For purposes of this definition, "control"
+     contributor version.  For purposes of this definition, “control”
      includes the right to grant patent sublicenses in a manner
      consistent with the requirements of this License.
 
      Each contributor grants you a non-exclusive, worldwide,
-     royalty-free patent license under the contributor's essential
+     royalty-free patent license under the contributors essential
      patent claims, to make, use, sell, offer for sale, import and
      otherwise run, modify and propagate the contents of its contributor
      version.
 
-     In the following three paragraphs, a "patent license" is any
+     In the following three paragraphs, a “patent license” is any
      express agreement or commitment, however denominated, not to
      enforce a patent (such as an express permission to practice a
-     patent or covenant not to sue for patent infringement).  To "grant"
+     patent or covenant not to sue for patent infringement).  To “grant”
      such a patent license to a party means to make such an agreement or
      commitment not to enforce a patent against the party.
 
@@ -7639,9 +7665,9 @@ TERMS AND CONDITIONS
      yourself of the benefit of the patent license for this particular
      work, or (3) arrange, in a manner consistent with the requirements
      of this License, to extend the patent license to downstream
-     recipients.  "Knowingly relying" means you have actual knowledge
+     recipients.  “Knowingly relying” means you have actual knowledge
      that, but for the patent license, your conveying the covered work
-     in a country, or your recipient's use of the covered work in a
+     in a country, or your recipients use of the covered work in a
      country, would infringe one or more identifiable patents in that
      country that you have reason to believe are valid.
 
@@ -7653,7 +7679,7 @@ TERMS AND CONDITIONS
      patent license you grant is automatically extended to all
      recipients of the covered work and works based on it.
 
-     A patent license is "discriminatory" if it does not include within
+     A patent license is “discriminatory” if it does not include within
      the scope of its coverage, prohibits the exercise of, or is
      conditioned on the non-exercise of one or more of the rights that
      are specifically granted under this License.  You may not convey a
@@ -7673,7 +7699,7 @@ TERMS AND CONDITIONS
      any implied license or other defenses to infringement that may
      otherwise be available to you under applicable patent law.
 
-  12. No Surrender of Others' Freedom.
+  12. No Surrender of Others Freedom.
 
      If conditions are imposed on you (whether by court order, agreement
      or otherwise) that contradict the conditions of this License, they
@@ -7706,7 +7732,7 @@ TERMS AND CONDITIONS
 
      Each version is given a distinguishing version number.  If the
      Program specifies that a certain numbered version of the GNU
-     General Public License "or any later version" applies to it, you
+     General Public License “or any later version” applies to it, you
      have the option of following the terms and conditions either of
      that numbered version or of any later version published by the Free
      Software Foundation.  If the Program does not specify a version
@@ -7715,7 +7741,7 @@ TERMS AND CONDITIONS
 
      If the Program specifies that a proxy can decide which future
      versions of the GNU General Public License can be used, that
-     proxy's public statement of acceptance of a version permanently
+     proxys public statement of acceptance of a version permanently
      authorizes you to choose that version for the Program.
 
      Later license versions may give you additional or different
@@ -7727,7 +7753,7 @@ TERMS AND CONDITIONS
 
      THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
      APPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE
-     COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS"
+     COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS”
      WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
      INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
      MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE
@@ -7771,7 +7797,7 @@ terms.
    To do so, attach the following notices to the program.  It is safest
 to attach them to the start of each source file to most effectively
 state the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
+“copyright” line and a pointer to where the full notice is found.
 
      ONE LINE TO GIVE THE PROGRAM'S NAME AND A BRIEF IDEA OF WHAT IT DOES.
      Copyright (C) YEAR NAME OF AUTHOR
@@ -7787,7 +7813,7 @@ state the exclusion of warranty; and each file should have at least the
      General Public License for more details.
 
      You should have received a copy of the GNU General Public License
-     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+     along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
    Also add information on how to contact you by electronic and paper
 mail.
@@ -7796,24 +7822,24 @@ mail.
 notice like this when it starts in an interactive mode:
 
      PROGRAM Copyright (C) YEAR NAME OF AUTHOR
-     This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
+     This program comes with ABSOLUTELY NO WARRANTY; for details type ‘show w’.
      This is free software, and you are welcome to redistribute it
-     under certain conditions; type 'show c' for details.
+     under certain conditions; type ‘show c’ for details.
 
-   The hypothetical commands 'show w' and 'show c' should show the
+   The hypothetical commands ‘show w’ and ‘show c’ should show the
 appropriate parts of the General Public License.  Of course, your
-program's commands might be different; for a GUI interface, you would
-use an "about box".
+programs commands might be different; for a GUI interface, you would
+use an “about box”.
 
    You should also get your employer (if you work as a programmer) or
-school, if any, to sign a "copyright disclaimer" for the program, if
+school, if any, to sign a “copyright disclaimer” for the program, if
 necessary.  For more information on this, and how to apply and follow
-the GNU GPL, see <http://www.gnu.org/licenses/>.
+the GNU GPL, see <https://www.gnu.org/licenses/>.
 
    The GNU General Public License does not permit incorporating your
 program into proprietary programs.  If your program is a subroutine
 library, you may consider it more useful to permit linking proprietary
 applications with the library.  If this is what you want to do, use the
 GNU Lesser General Public License instead of this License.  But first,
-please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
+please read <https://www.gnu.org/licenses/why-not-lgpl.html>.
 
index 566c372..75442a2 100644 (file)
@@ -1,17 +1,17 @@
-This is m4.info, produced by makeinfo version 6.1 from m4.texi.
+This is m4.info, produced by makeinfo version 6.7 from m4.texi.
 
-This manual (31 December 2016) is for GNU M4 (version 1.4.18), a package
+This manual (28 May 2021) is for GNU M4 (version 1.4.19), a package
 containing an implementation of the m4 macro language.
 
-   Copyright (C) 1989-1994, 2004-2014, 2016 Free Software Foundation,
-Inc.
+   Copyright © 1989–1994, 2004–2014, 2016–2017, 2020–2021 Free Software
+Foundation, Inc.
 
      Permission is granted to copy, distribute and/or modify this
      document under the terms of the GNU Free Documentation License,
      Version 1.3 or any later version published by the Free Software
      Foundation; with no Invariant Sections, no Front-Cover Texts, and
      no Back-Cover Texts.  A copy of the license is included in the
-     section entitled "GNU Free Documentation License."
+     section entitled “GNU Free Documentation License.”
 INFO-DIR-SECTION Text creation and manipulation
 START-INFO-DIR-ENTRY
 * M4: (m4).                     A powerful macro processor.
@@ -25,7 +25,7 @@ Appendix B How to make copies of this manual
 
 This appendix covers the license for copying this manual.  Note that
 some of the longer examples in this manual are also distributed in the
-directory 'm4-1.4.18/examples/', where a more permissive license is in
+directory ‘m4-1.4.19/examples/’, where a more permissive license is in
 effect when copying just the examples.
 
 * Menu:
@@ -40,8 +40,8 @@ B.1 License for copying this manual
 
                      Version 1.3, 3 November 2008
 
-     Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
-     <http://fsf.org/>
+     Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
+     <https://fsf.org/>
 
      Everyone is permitted to copy and distribute verbatim copies
      of this license document, but changing it is not allowed.
@@ -49,14 +49,14 @@ B.1 License for copying this manual
   0. PREAMBLE
 
      The purpose of this License is to make a manual, textbook, or other
-     functional and useful document "free" in the sense of freedom: to
+     functional and useful document “free” in the sense of freedom: to
      assure everyone the effective freedom to copy and redistribute it,
      with or without modifying it, either commercially or
      noncommercially.  Secondarily, this License preserves for the
      author and publisher a way to get credit for their work, while not
      being considered responsible for modifications made by others.
 
-     This License is a kind of "copyleft", which means that derivative
+     This License is a kind of “copyleft”, which means that derivative
      works of the document must themselves be free in the same sense.
      It complements the GNU General Public License, which is a copyleft
      license designed for free software.
@@ -77,18 +77,18 @@ B.1 License for copying this manual
      be distributed under the terms of this License.  Such a notice
      grants a world-wide, royalty-free license, unlimited in duration,
      to use that work under the conditions stated herein.  The
-     "Document", below, refers to any such manual or work.  Any member
-     of the public is a licensee, and is addressed as "you".  You accept
+     “Document”, below, refers to any such manual or work.  Any member
+     of the public is a licensee, and is addressed as “you”.  You accept
      the license if you copy, modify or distribute the work in a way
      requiring permission under copyright law.
 
-     A "Modified Version" of the Document means any work containing the
+     A “Modified Version” of the Document means any work containing the
      Document or a portion of it, either copied verbatim, or with
      modifications and/or translated into another language.
 
-     A "Secondary Section" is a named appendix or a front-matter section
+     A “Secondary Section” is a named appendix or a front-matter section
      of the Document that deals exclusively with the relationship of the
-     publishers or authors of the Document to the Document's overall
+     publishers or authors of the Document to the Documents overall
      subject (or to related matters) and contains nothing that could
      fall directly within that overall subject.  (Thus, if the Document
      is in part a textbook of mathematics, a Secondary Section may not
@@ -97,7 +97,7 @@ B.1 License for copying this manual
      of legal, commercial, philosophical, ethical or political position
      regarding them.
 
-     The "Invariant Sections" are certain Secondary Sections whose
+     The “Invariant Sections” are certain Secondary Sections whose
      titles are designated, as being those of Invariant Sections, in the
      notice that says that the Document is released under this License.
      If a section does not fit the above definition of Secondary then it
@@ -105,13 +105,13 @@ B.1 License for copying this manual
      contain zero Invariant Sections.  If the Document does not identify
      any Invariant Sections then there are none.
 
-     The "Cover Texts" are certain short passages of text that are
+     The “Cover Texts” are certain short passages of text that are
      listed, as Front-Cover Texts or Back-Cover Texts, in the notice
      that says that the Document is released under this License.  A
      Front-Cover Text may be at most 5 words, and a Back-Cover Text may
      be at most 25 words.
 
-     A "Transparent" copy of the Document means a machine-readable copy,
+     A “Transparent” copy of the Document means a machine-readable copy,
      represented in a format whose specification is available to the
      general public, that is suitable for revising the document
      straightforwardly with generic text editors or (for images composed
@@ -123,7 +123,7 @@ B.1 License for copying this manual
      been arranged to thwart or discourage subsequent modification by
      readers is not Transparent.  An image format is not Transparent if
      used for any substantial amount of text.  A copy that is not
-     "Transparent" is called "Opaque".
+     “Transparent” is called “Opaque”.
 
      Examples of suitable formats for Transparent copies include plain
      ASCII without markup, Texinfo input format, LaTeX input format,
@@ -136,23 +136,23 @@ B.1 License for copying this manual
      the machine-generated HTML, PostScript or PDF produced by some word
      processors for output purposes only.
 
-     The "Title Page" means, for a printed book, the title page itself,
+     The “Title Page” means, for a printed book, the title page itself,
      plus such following pages as are needed to hold, legibly, the
      material this License requires to appear in the title page.  For
-     works in formats which do not have any title page as such, "Title
-     Page" means the text near the most prominent appearance of the
-     work's title, preceding the beginning of the body of the text.
+     works in formats which do not have any title page as such, Title
+     Page means the text near the most prominent appearance of the
+     works title, preceding the beginning of the body of the text.
 
-     The "publisher" means any person or entity that distributes copies
+     The “publisher” means any person or entity that distributes copies
      of the Document to the public.
 
-     A section "Entitled XYZ" means a named subunit of the Document
+     A section “Entitled XYZ” means a named subunit of the Document
      whose title either is precisely XYZ or contains XYZ in parentheses
      following text that translates XYZ in another language.  (Here XYZ
      stands for a specific section name mentioned below, such as
-     "Acknowledgements", "Dedications", "Endorsements", or "History".)
-     To "Preserve the Title" of such a section when you modify the
-     Document means that it remains a section "Entitled XYZ" according
+     “Acknowledgements”, “Dedications”, “Endorsements”, or “History”.)
+     To “Preserve the Title” of such a section when you modify the
+     Document means that it remains a section “Entitled XYZ” according
      to this definition.
 
      The Document may include Warranty Disclaimers next to the notice
@@ -182,7 +182,7 @@ B.1 License for copying this manual
 
      If you publish printed copies (or copies in media that commonly
      have printed covers) of the Document, numbering more than 100, and
-     the Document's license notice requires Cover Texts, you must
+     the Documents license notice requires Cover Texts, you must
      enclose the copies in covers that carry, clearly and legibly, all
      these Cover Texts: Front-Cover Texts on the front cover, and
      Back-Cover Texts on the back cover.  Both covers must also clearly
@@ -254,15 +254,15 @@ B.1 License for copying this manual
           the Addendum below.
 
        G. Preserve in that license notice the full lists of Invariant
-          Sections and required Cover Texts given in the Document's
+          Sections and required Cover Texts given in the Documents
           license notice.
 
        H. Include an unaltered copy of this License.
 
-       I. Preserve the section Entitled "History", Preserve its Title,
+       I. Preserve the section Entitled “History”, Preserve its Title,
           and add to it an item stating at least the title, year, new
           authors, and publisher of the Modified Version as given on the
-          Title Page.  If there is no section Entitled "History" in the
+          Title Page.  If there is no section Entitled “History” in the
           Document, create one stating the title, year, authors, and
           publisher of the Document as given on its Title Page, then add
           an item describing the Modified Version as stated in the
@@ -272,12 +272,12 @@ B.1 License for copying this manual
           for public access to a Transparent copy of the Document, and
           likewise the network locations given in the Document for
           previous versions it was based on.  These may be placed in the
-          "History" section.  You may omit a network location for a work
+          “History” section.  You may omit a network location for a work
           that was published at least four years before the Document
           itself, or if the original publisher of the version it refers
           to gives permission.
 
-       K. For any section Entitled "Acknowledgements" or "Dedications",
+       K. For any section Entitled “Acknowledgements” or “Dedications”,
           Preserve the Title of the section, and preserve in the section
           all the substance and tone of each of the contributor
           acknowledgements and/or dedications given therein.
@@ -286,11 +286,11 @@ B.1 License for copying this manual
           in their text and in their titles.  Section numbers or the
           equivalent are not considered part of the section titles.
 
-       M. Delete any section Entitled "Endorsements".  Such a section
+       M. Delete any section Entitled “Endorsements”.  Such a section
           may not be included in the Modified Version.
 
        N. Do not retitle any existing section to be Entitled
-          "Endorsements" or to conflict in title with any Invariant
+          “Endorsements” or to conflict in title with any Invariant
           Section.
 
        O. Preserve any Warranty Disclaimers.
@@ -299,15 +299,15 @@ B.1 License for copying this manual
      appendices that qualify as Secondary Sections and contain no
      material copied from the Document, you may at your option designate
      some or all of these sections as invariant.  To do this, add their
-     titles to the list of Invariant Sections in the Modified Version's
+     titles to the list of Invariant Sections in the Modified Versions
      license notice.  These titles must be distinct from any other
      section titles.
 
-     You may add a section Entitled "Endorsements", provided it contains
+     You may add a section Entitled “Endorsements”, provided it contains
      nothing but endorsements of your Modified Version by various
-     parties--for example, statements of peer review or that the text
-     has been approved by an organization as the authoritative
-     definition of a standard.
+     parties—for example, statements of peer review or that the text has
+     been approved by an organization as the authoritative definition of
+     a standard.
 
      You may add a passage of up to five words as a Front-Cover Text,
      and a passage of up to 25 words as a Back-Cover Text, to the end of
@@ -345,10 +345,10 @@ B.1 License for copying this manual
      combined work.
 
      In the combination, you must combine any sections Entitled
-     "History" in the various original documents, forming one section
-     Entitled "History"; likewise combine any sections Entitled
-     "Acknowledgements", and any sections Entitled "Dedications".  You
-     must delete all sections Entitled "Endorsements."
+     “History” in the various original documents, forming one section
+     Entitled “History”; likewise combine any sections Entitled
+     “Acknowledgements”, and any sections Entitled “Dedications”.  You
+     must delete all sections Entitled “Endorsements.”
 
   6. COLLECTIONS OF DOCUMENTS
 
@@ -369,16 +369,16 @@ B.1 License for copying this manual
 
      A compilation of the Document or its derivatives with other
      separate and independent documents or works, in or on a volume of a
-     storage or distribution medium, is called an "aggregate" if the
+     storage or distribution medium, is called an “aggregate” if the
      copyright resulting from the compilation is not used to limit the
-     legal rights of the compilation's users beyond what the individual
+     legal rights of the compilations users beyond what the individual
      works permit.  When the Document is included in an aggregate, this
      License does not apply to the other works in the aggregate which
      are not themselves derivative works of the Document.
 
      If the Cover Text requirement of section 3 is applicable to these
      copies of the Document, then if the Document is less than one half
-     of the entire aggregate, the Document's Cover Texts may be placed
+     of the entire aggregate, the Documents Cover Texts may be placed
      on covers that bracket the Document within the aggregate, or the
      electronic equivalent of covers if the Document is in electronic
      form.  Otherwise they must appear on printed covers that bracket
@@ -400,8 +400,8 @@ B.1 License for copying this manual
      this License or a notice or disclaimer, the original version will
      prevail.
 
-     If a section in the Document is Entitled "Acknowledgements",
-     "Dedications", or "History", the requirement (section 4) to
+     If a section in the Document is Entitled “Acknowledgements”,
+     “Dedications”, or “History”, the requirement (section 4) to
      Preserve its Title (section 1) will typically require changing the
      actual title.
 
@@ -438,11 +438,11 @@ B.1 License for copying this manual
      the GNU Free Documentation License from time to time.  Such new
      versions will be similar in spirit to the present version, but may
      differ in detail to address new problems or concerns.  See
-     <http://www.gnu.org/copyleft/>.
+     <https://www.gnu.org/licenses/>.
 
      Each version of the License is given a distinguishing version
      number.  If the Document specifies that a particular numbered
-     version of this License "or any later version" applies to it, you
+     version of this License “or any later version” applies to it, you
      have the option of following the terms and conditions either of
      that specified version or of any later version that has been
      published (not as a draft) by the Free Software Foundation.  If the
@@ -450,29 +450,29 @@ B.1 License for copying this manual
      choose any version ever published (not as a draft) by the Free
      Software Foundation.  If the Document specifies that a proxy can
      decide which future versions of this License can be used, that
-     proxy's public statement of acceptance of a version permanently
+     proxys public statement of acceptance of a version permanently
      authorizes you to choose that version for the Document.
 
   11. RELICENSING
 
-     "Massive Multiauthor Collaboration Site" (or "MMC Site") means any
+     “Massive Multiauthor Collaboration Site” (or “MMC Site”) means any
      World Wide Web server that publishes copyrightable works and also
      provides prominent facilities for anybody to edit those works.  A
      public wiki that anybody can edit is an example of such a server.
-     A "Massive Multiauthor Collaboration" (or "MMC") contained in the
+     A “Massive Multiauthor Collaboration” (or “MMC”) contained in the
      site means any set of copyrightable works thus published on the MMC
      site.
 
-     "CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
+     “CC-BY-SA” means the Creative Commons Attribution-Share Alike 3.0
      license published by Creative Commons Corporation, a not-for-profit
      corporation with a principal place of business in San Francisco,
      California, as well as future copyleft versions of that license
      published by that same organization.
 
-     "Incorporate" means to publish or republish a Document, in whole or
+     “Incorporate” means to publish or republish a Document, in whole or
      in part, as part of another Document.
 
-     An MMC is "eligible for relicensing" if it is licensed under this
+     An MMC is “eligible for relicensing” if it is licensed under this
      License, and if all works that were first published under this
      License somewhere other than this MMC, and subsequently
      incorporated in whole or in part into the MMC, (1) had no cover
@@ -499,7 +499,7 @@ notices just after the title page:
        Free Documentation License''.
 
    If you have Invariant Sections, Front-Cover Texts and Back-Cover
-Texts, replace the "with...Texts." line with this:
+Texts, replace the “with...Texts.” line with this:
 
          with the Invariant Sections being LIST THEIR TITLES, with
          the Front-Cover Texts being LIST, and with the Back-Cover Texts
@@ -522,16 +522,16 @@ Appendix C Indices of concepts and macros
 
 * Menu:
 
-* Macro index::                 Index for all 'm4' macros
+* Macro index::                 Index for all ‘m4’ macros
 * Concept index::               Index for many concepts
 
 \1f
 File: m4.info,  Node: Macro index,  Next: Concept index,  Up: Indices
 
-C.1 Index for all 'm4' macros
+C.1 Index for all ‘m4’ macros
 =============================
 
-This index covers all 'm4' builtins, as well as several useful composite
+This index covers all ‘m4’ builtins, as well as several useful composite
 macros.  References are exclusively to the places where a macro is
 introduced the first time.
 
index bc50533..94ac851 100644 (file)
@@ -4,6 +4,9 @@
 @setfilename m4.info
 @include version.texi
 @settitle GNU M4 @value{VERSION} macro processor
+@documentencoding UTF-8
+@set txicodequoteundirected
+@set txicodequotebacktick
 @setchapternewpage odd
 @finalout
 
@@ -40,8 +43,8 @@ This manual (@value{UPDATED}) is for GNU M4 (version
 @value{VERSION}), a package containing an implementation of the m4 macro
 language.
 
-Copyright @copyright{} 1989-1994, 2004-2014, 2016 Free Software
-Foundation, Inc.
+Copyright @copyright{} 1989--1994, 2004--2014, 2016--2017, 2020--2021
+Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -352,12 +355,13 @@ language being processed.  Techniques such as conditional and recursive
 macros, and using macros to define other macros, were described by Doug
 McIlroy of Bell Labs in ``Macro Instruction Extensions of Compiler
 Languages'', @emph{Communications of the ACM} 3, 4 (1960), 214--20,
-@url{http://dx.doi.org/10.1145/367177.367223}.
+@url{https://dl.acm.org/doi/10.1145/367177.367223}.
 
 An important precursor of @code{m4} was GPM; see C. Strachey,
 @c The title uses lower case and has no space between "macro" and "generator".
 ``A general purpose macrogenerator'', @emph{Computer Journal} 8, 3
-(1965), 225--41, @url{http://dx.doi.org/10.1093/comjnl/8.3.225}.  GPM is
+(1965), 225--41,
+@url{https://academic.oup.com/comjnl/article/8/3/225/336044}.  GPM is
 also succinctly described in David Gries's book @emph{Compiler
 Construction for Digital Computers}, Wiley (1971).  Strachey was a
 brilliant programmer: GPM fit into 250 machine instructions!
@@ -380,7 +384,7 @@ macro-processor language, which inspired Dennis Ritchie to write
 
 Kernighan and Ritchie then joined forces to develop the original
 @code{m4}, described in ``The M4 Macro Processor'', Bell Laboratories
-(1977), @url{http://wolfram.schneider.org/bsd/7thEdManVol2/m4/m4.pdf}.
+(1977), @url{https://wolfram.schneider.org/bsd/7thEdManVol2/m4/m4.pdf}.
 It had only 21 builtin macros.
 
 While @code{GPM} was more @emph{pure}, @code{m4} is meant to deal with
@@ -788,7 +792,7 @@ System V version.  @xref{Compatibility}, for a list of these.
 @itemx --hashsize=@var{num}
 Make the internal hash table for symbol lookup be @var{num} entries big.
 For better performance, the number should be prime, but this is not
-checked.  The default is 509 entries.  It should not be necessary to
+checked.  The default is 65537 entries.  It should not be necessary to
 increase this value, unless you define an excessive number of macros.
 
 @item -L @var{num}
@@ -1210,9 +1214,9 @@ round of scanning for the tokens @samp{Result}, @samp{@w{ }},
 
 As a more complicated example, we will contrast an actual code
 example from the Gnulib project@footnote{Derived from a patch in
-@uref{http://lists.gnu.org/archive/html/bug-gnulib/@/2007-01/@/msg00389.html},
+@uref{https://lists.gnu.org/archive/html/bug-gnulib/@/2007-01/@/msg00389.html},
 and a followup patch in
-@uref{http://lists.gnu.org/archive/html/bug-gnulib/@/2007-02/@/msg00000.html}},
+@uref{https://lists.gnu.org/archive/html/bug-gnulib/@/2007-02/@/msg00000.html}},
 showing both a buggy approach and the desired results.  The user desires
 to output a shell assignment statement that takes its argument and turns
 it into a shell variable by converting it to uppercase and prepending a
@@ -4242,23 +4246,19 @@ foo
 @result{}Macro foo.
 @end example
 
-The quotation strings can safely contain eight-bit characters.
-@ignore
-@comment Yuck.  I know of no clean way to render an 8-bit character in
-@comment both info and dvi.  This example uses the `open-guillemot' and
-@comment `close-guillemot' characters of the Latin-1 character set.
+The quotation strings can safely contain non-@sc{ascii} characters.
 
 @example
 define(`a', `b')
 @result{}
-«a»
-@result{}«b»
-changequote(`«', `»')
+«a»
+@result{}«b»
+changequote(`«', `»')
 @result{}
-«a»
+«a»
 @result{}a
 @end example
-@end ignore
+
 If no single character is appropriate, @var{start} and @var{end} can be
 of any length.  Other implementations cap the delimiter length to five
 characters, but GNU has no inherent limit.
@@ -4521,23 +4521,19 @@ changecom(`#', `')
 @result{}# comment again
 @end example
 
-The comment strings can safely contain eight-bit characters.
-@ignore
-@comment Yuck.  I know of no clean way to render an 8-bit character in
-@comment both info and dvi.  This example uses the `open-guillemot' and
-@comment `close-guillemot' characters of the Latin-1 character set.
+The comment strings can safely contain non-@sc{ascii} characters.
 
 @example
 define(`a', `b')
 @result{}
-«a»
-@result{}«b»
-changecom(`«', `»')
+«a»
+@result{}«b»
+changecom(`«', `»')
 @result{}
-«a»
-@result{}«a»
+«a»
+@result{}«a»
 @end example
-@end ignore
+
 If no single character is appropriate, @var{start} and @var{end} can be
 of any length.  Other implementations cap the delimiter length to five
 characters, but GNU has no inherent limit.
@@ -5705,7 +5701,7 @@ Manual}.
 @end ifnothtml
 @ifhtml
 See
-@uref{http://www.gnu.org/@/software/@/emacs/@/manual/@/emacs.html#Regexps,
+@uref{https://www.gnu.org/@/software/@/emacs/@/manual/@/emacs.html#Regexps,
 Syntax of Regular Expressions} in the GNU Emacs Manual.
 @end ifhtml
 Support for ERE, Extended Regular Expressions is not
@@ -5865,10 +5861,11 @@ resulting @samp{b} is not further remapped to @samp{g}; the @samp{d} and
 
 @ignore
 @comment No need to fight 8-bit characters, as it is difficult to get
-@comment rendering right in both info and dvi.
+@comment rendering right in both info and dvi, and examples like this
+@comment do not work correctly with UTF-8 anyway since m4 is byte-oriented.
 
 @example
-translit(`«abc~', `~-»')
+translit(`«abc~', `~-»')
 @result{}abc
 @end example
 
@@ -6748,14 +6745,22 @@ signal number shifted left by eight bits.
 @comment systems where /bin/sh does not create its own process group.
 @comment And PIPE is unreliable, since people tend to run with it
 @comment ignored, with m4 inheriting that choice.  That leaves KILL as
-@comment the only signal we can reliably test.
+@comment the only signal we can reliably test, but even that is tricky:
+@comment on Haiku, 'kill -9' actually causes a process to die with
+@comment signal 15 named KILLTHR on that platform.
 @example
 dnl This test assumes kill is a shell builtin, and that signals are
 dnl recognizable.
 ifdef(`__unix__', ,
       `errprint(` skipping: syscmd does not have unix semantics
 ')m4exit(`77')')dnl
-syscmd(`kill -9 $$')
+changequote(`[', `]')
+@result{}
+syscmd([/bin/sh -c 'kill -9 $$'; st=$?; test $st = 137 || test $st = 265])
+@result{}
+ifelse(sysval, [0], , [errprint([ skipping: shell does not send signal 9
+])m4exit([77])])dnl
+syscmd([kill -9 $$])
 @result{}
 sysval
 @result{}2304
@@ -6763,7 +6768,7 @@ syscmd()
 @result{}
 sysval
 @result{}0
-esyscmd(`kill -9 $$')
+esyscmd([kill -9 $$])
 @result{}
 sysval
 @result{}2304
@@ -7356,7 +7361,7 @@ POSIX is under development and includes several proposals for
 modifying what @code{m4} is required to do.  The requirements for
 @code{m4} are shared between SUSv3 and POSIX, and
 can be viewed at
-@uref{http://www.opengroup.org/onlinepubs/@/000095399/@/utilities/@/m4.html}.
+@uref{https://www.opengroup.org/onlinepubs/@/000095399/@/utilities/@/m4.html}.
 
 @menu
 * Extensions::                  Extensions in GNU M4
@@ -8744,7 +8749,7 @@ macro is introduced the first time.
 @bye
 
 @c Local Variables:
-@c coding: iso-8859-1
+@c coding: utf-8
 @c fill-column: 72
 @c ispell-local-dictionary: "american"
 @c indent-tabs-mode: nil
index 6d171e0..341ce42 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 31 December 2016
-@set UPDATED-MONTH December 2016
-@set EDITION 1.4.18
-@set VERSION 1.4.18
+@set UPDATED 28 May 2021
+@set UPDATED-MONTH May 2021
+@set EDITION 1.4.19
+@set VERSION 1.4.19
index 6d171e0..341ce42 100644 (file)
@@ -1,4 +1,4 @@
-@set UPDATED 31 December 2016
-@set UPDATED-MONTH December 2016
-@set EDITION 1.4.18
-@set VERSION 1.4.18
+@set UPDATED 28 May 2021
+@set UPDATED-MONTH May 2021
+@set EDITION 1.4.19
+@set VERSION 1.4.19
index 9c99d5b..5a03df9 100644 (file)
@@ -1,6 +1,7 @@
 ## Makefile.am - template for generating Makefile via Automake
 ##
-## Copyright (C) 2006-2014, 2016 Free Software Foundation, Inc.
+## Copyright (C) 2006-2014, 2016-2017, 2020-2021 Free Software
+## Foundation, Inc.
 ##
 ## This file is part of GNU M4.
 ##
@@ -15,7 +16,7 @@
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 ##
 ## This file written by Eric Blake <ebb9@byu.net>
 
index 81c5e54..7c2ce85 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -89,54 +89,69 @@ host_triplet = @host@
 subdir = examples
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
-       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
-       $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/__inline.m4 \
+       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/access.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/arpa_inet_h.m4 \
        $(top_srcdir)/m4/asm-underscore.m4 $(top_srcdir)/m4/assert.m4 \
        $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \
        $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \
-       $(top_srcdir)/m4/canonicalize.m4 \
-       $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
-       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
-       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
-       $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
-       $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirent_h.m4 \
-       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/canonicalize.m4 \
+       $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/clock_time.m4 \
+       $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closedir.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \
+       $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/creat.m4 \
+       $(top_srcdir)/m4/ctype_h.m4 $(top_srcdir)/m4/d-ino.m4 \
+       $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
        $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
-       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
-       $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \
-       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/execute.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eaccess.m4 \
+       $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+       $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+       $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/explicit_bzero.m4 \
        $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \
        $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \
        $(top_srcdir)/m4/extern-inline.m4 \
-       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fclose.m4 \
-       $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl.m4 \
-       $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopen.m4 \
+       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fchdir.m4 \
+       $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+       $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+       $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/fdopendir.m4 \
        $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/findprog-in.m4 $(top_srcdir)/m4/findprog.m4 \
        $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
        $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \
        $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fpurge.m4 \
        $(top_srcdir)/m4/freadahead.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/freopen.m4 \
        $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
        $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
-       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
-       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \
+       $(top_srcdir)/m4/ftell.m4 $(top_srcdir)/m4/ftello.m4 \
+       $(top_srcdir)/m4/ftruncate.m4 \
+       $(top_srcdir)/m4/getcwd-abort-bug.m4 \
+       $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
        $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
        $(top_srcdir)/m4/getpagesize.m4 \
-       $(top_srcdir)/m4/getprogname.m4 \
-       $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
+       $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/getrandom.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
        $(top_srcdir)/m4/gnulib-common.m4 \
        $(top_srcdir)/m4/gnulib-comp.m4 \
-       $(top_srcdir)/m4/hard-locale.m4 \
-       $(top_srcdir)/m4/include_next.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+       $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+       $(top_srcdir)/m4/inline.m4 \
+       $(top_srcdir)/m4/intl-thread-locale.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \
-       $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
-       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isblank.m4 \
-       $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
-       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/langinfo_h.m4 \
+       $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes.m4 \
+       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+       $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/isnand.m4 \
+       $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
+       $(top_srcdir)/m4/iswblank.m4 $(top_srcdir)/m4/iswdigit.m4 \
+       $(top_srcdir)/m4/iswxdigit.m4 $(top_srcdir)/m4/langinfo_h.m4 \
        $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lcmessage.m4 \
        $(top_srcdir)/m4/ldexp.m4 $(top_srcdir)/m4/ldexpl.m4 \
        $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
        $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+       $(top_srcdir)/m4/libunistring-base.m4 \
        $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/link.m4 \
        $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
        $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
@@ -146,61 +161,93 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
        $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
        $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \
+       $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
        $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
-       $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
-       $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/minmax.m4 \
+       $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+       $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
+       $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
+       $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkdir.m4 \
        $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \
        $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
        $(top_srcdir)/m4/msvc-inval.m4 \
        $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
-       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nocrash.m4 \
-       $(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/off_t.m4 \
-       $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/opendir.m4 \
-       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/pipe2.m4 \
-       $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/musl.m4 $(top_srcdir)/m4/nanosleep.m4 \
+       $(top_srcdir)/m4/netinet_in_h.m4 \
+       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/obstack.m4 \
+       $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/open-cloexec.m4 \
+       $(top_srcdir)/m4/open-slash.m4 $(top_srcdir)/m4/open.m4 \
+       $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/opendir.m4 \
+       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perror.m4 \
+       $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/pipe2.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/posix_spawn_faction_addchdir.m4 \
        $(top_srcdir)/m4/printf-frexp.m4 \
        $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \
-       $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quotearg.m4 \
-       $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+       $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/pthread-thread.m4 \
+       $(top_srcdir)/m4/pthread_h.m4 \
+       $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
+       $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \
+       $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/raise.m4 \
+       $(top_srcdir)/m4/rawmemchr.m4 $(top_srcdir)/m4/read-file.m4 \
        $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/readlink.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/reallocarray.m4 \
        $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
-       $(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/sched_h.m4 \
-       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/setenv.m4 \
-       $(top_srcdir)/m4/setlocale.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \
-       $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/rewinddir.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/sched_h.m4 \
+       $(top_srcdir)/m4/sched_yield.m4 \
+       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+       $(top_srcdir)/m4/semaphore.m4 $(top_srcdir)/m4/setenv.m4 \
+       $(top_srcdir)/m4/setlocale.m4 \
+       $(top_srcdir)/m4/setlocale_null.m4 \
+       $(top_srcdir)/m4/sh-filename.m4 \
+       $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/sigaltstack.m4 $(top_srcdir)/m4/signal_h.m4 \
        $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \
        $(top_srcdir)/m4/sigpipe.m4 $(top_srcdir)/m4/size_max.m4 \
        $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/snprintf.m4 \
-       $(top_srcdir)/m4/spawn-pipe.m4 $(top_srcdir)/m4/spawn_h.m4 \
-       $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \
+       $(top_srcdir)/m4/socketlib.m4 $(top_srcdir)/m4/sockets.m4 \
+       $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \
+       $(top_srcdir)/m4/sparcv8+.m4 $(top_srcdir)/m4/spawn-pipe.m4 \
+       $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/ssize_t.m4 \
+       $(top_srcdir)/m4/stack-direction.m4 \
+       $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
        $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
        $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
        $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
        $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
-       $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \
-       $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \
+       $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
        $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
        $(top_srcdir)/m4/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \
        $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/symlink.m4 \
+       $(top_srcdir)/m4/sys_ioctl_h.m4 \
+       $(top_srcdir)/m4/sys_random_h.m4 \
+       $(top_srcdir)/m4/sys_select_h.m4 \
        $(top_srcdir)/m4/sys_socket_h.m4 \
        $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
-       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \
-       $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+       $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+       $(top_srcdir)/m4/thread.m4 $(top_srcdir)/m4/threadlib.m4 \
        $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/tls.m4 \
        $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/ungetc.m4 \
        $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
        $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \
        $(top_srcdir)/m4/vasprintf-posix.m4 \
        $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+       $(top_srcdir)/m4/visibility.m4 \
        $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \
        $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/m4/wchar_h.m4 \
        $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wcrtomb.m4 \
        $(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
-       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
-       $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \
-       $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \
-       $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \
+       $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \
+       $(top_srcdir)/m4/yield.m4 $(top_srcdir)/m4/zzgnulib.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
@@ -252,6 +299,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CONFIG_INCLUDE = @CONFIG_INCLUDE@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
@@ -275,392 +323,519 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
 ERRNO_H = @ERRNO_H@
 EXEEXT = @EXEEXT@
 FLOAT_H = @FLOAT_H@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
 GETOPT_H = @GETOPT_H@
-GLIBC21 = @GLIBC21@
-GNULIB_ACOSF = @GNULIB_ACOSF@
-GNULIB_ACOSL = @GNULIB_ACOSL@
-GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
-GNULIB_ASINF = @GNULIB_ASINF@
-GNULIB_ASINL = @GNULIB_ASINL@
-GNULIB_ATAN2F = @GNULIB_ATAN2F@
-GNULIB_ATANF = @GNULIB_ATANF@
-GNULIB_ATANL = @GNULIB_ATANL@
-GNULIB_ATOLL = @GNULIB_ATOLL@
-GNULIB_BTOWC = @GNULIB_BTOWC@
-GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
-GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
-GNULIB_CBRT = @GNULIB_CBRT@
-GNULIB_CBRTF = @GNULIB_CBRTF@
-GNULIB_CBRTL = @GNULIB_CBRTL@
-GNULIB_CEIL = @GNULIB_CEIL@
-GNULIB_CEILF = @GNULIB_CEILF@
-GNULIB_CEILL = @GNULIB_CEILL@
-GNULIB_CHDIR = @GNULIB_CHDIR@
-GNULIB_CHOWN = @GNULIB_CHOWN@
-GNULIB_CLOSE = @GNULIB_CLOSE@
-GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
-GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
-GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
-GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
-GNULIB_COSF = @GNULIB_COSF@
-GNULIB_COSHF = @GNULIB_COSHF@
-GNULIB_COSL = @GNULIB_COSL@
-GNULIB_DIRFD = @GNULIB_DIRFD@
-GNULIB_DPRINTF = @GNULIB_DPRINTF@
-GNULIB_DUP = @GNULIB_DUP@
-GNULIB_DUP2 = @GNULIB_DUP2@
-GNULIB_DUP3 = @GNULIB_DUP3@
-GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
-GNULIB_ENVIRON = @GNULIB_ENVIRON@
-GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
-GNULIB_EXP2 = @GNULIB_EXP2@
-GNULIB_EXP2F = @GNULIB_EXP2F@
-GNULIB_EXP2L = @GNULIB_EXP2L@
-GNULIB_EXPF = @GNULIB_EXPF@
-GNULIB_EXPL = @GNULIB_EXPL@
-GNULIB_EXPM1 = @GNULIB_EXPM1@
-GNULIB_EXPM1F = @GNULIB_EXPM1F@
-GNULIB_EXPM1L = @GNULIB_EXPM1L@
-GNULIB_FABSF = @GNULIB_FABSF@
-GNULIB_FABSL = @GNULIB_FABSL@
-GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
-GNULIB_FCHDIR = @GNULIB_FCHDIR@
-GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
-GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
-GNULIB_FCLOSE = @GNULIB_FCLOSE@
-GNULIB_FCNTL = @GNULIB_FCNTL@
-GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
-GNULIB_FDOPEN = @GNULIB_FDOPEN@
-GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
-GNULIB_FFLUSH = @GNULIB_FFLUSH@
-GNULIB_FFSL = @GNULIB_FFSL@
-GNULIB_FFSLL = @GNULIB_FFSLL@
-GNULIB_FGETC = @GNULIB_FGETC@
-GNULIB_FGETS = @GNULIB_FGETS@
-GNULIB_FLOOR = @GNULIB_FLOOR@
-GNULIB_FLOORF = @GNULIB_FLOORF@
-GNULIB_FLOORL = @GNULIB_FLOORL@
-GNULIB_FMA = @GNULIB_FMA@
-GNULIB_FMAF = @GNULIB_FMAF@
-GNULIB_FMAL = @GNULIB_FMAL@
-GNULIB_FMOD = @GNULIB_FMOD@
-GNULIB_FMODF = @GNULIB_FMODF@
-GNULIB_FMODL = @GNULIB_FMODL@
-GNULIB_FOPEN = @GNULIB_FOPEN@
-GNULIB_FPRINTF = @GNULIB_FPRINTF@
-GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
-GNULIB_FPURGE = @GNULIB_FPURGE@
-GNULIB_FPUTC = @GNULIB_FPUTC@
-GNULIB_FPUTS = @GNULIB_FPUTS@
-GNULIB_FREAD = @GNULIB_FREAD@
-GNULIB_FREOPEN = @GNULIB_FREOPEN@
-GNULIB_FREXP = @GNULIB_FREXP@
-GNULIB_FREXPF = @GNULIB_FREXPF@
-GNULIB_FREXPL = @GNULIB_FREXPL@
-GNULIB_FSCANF = @GNULIB_FSCANF@
-GNULIB_FSEEK = @GNULIB_FSEEK@
-GNULIB_FSEEKO = @GNULIB_FSEEKO@
-GNULIB_FSTAT = @GNULIB_FSTAT@
-GNULIB_FSTATAT = @GNULIB_FSTATAT@
-GNULIB_FSYNC = @GNULIB_FSYNC@
-GNULIB_FTELL = @GNULIB_FTELL@
-GNULIB_FTELLO = @GNULIB_FTELLO@
-GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
-GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
-GNULIB_FWRITE = @GNULIB_FWRITE@
-GNULIB_GETC = @GNULIB_GETC@
-GNULIB_GETCHAR = @GNULIB_GETCHAR@
-GNULIB_GETCWD = @GNULIB_GETCWD@
-GNULIB_GETDELIM = @GNULIB_GETDELIM@
-GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
-GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
-GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
-GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
-GNULIB_GETLINE = @GNULIB_GETLINE@
-GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
-GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
-GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
-GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
-GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_M4_GNULIB_ACCEPT = @GL_M4_GNULIB_ACCEPT@
+GL_M4_GNULIB_ACCEPT4 = @GL_M4_GNULIB_ACCEPT4@
+GL_M4_GNULIB_ACCESS = @GL_M4_GNULIB_ACCESS@
+GL_M4_GNULIB_ACOSF = @GL_M4_GNULIB_ACOSF@
+GL_M4_GNULIB_ACOSL = @GL_M4_GNULIB_ACOSL@
+GL_M4_GNULIB_ALIGNED_ALLOC = @GL_M4_GNULIB_ALIGNED_ALLOC@
+GL_M4_GNULIB_ALPHASORT = @GL_M4_GNULIB_ALPHASORT@
+GL_M4_GNULIB_ASINF = @GL_M4_GNULIB_ASINF@
+GL_M4_GNULIB_ASINL = @GL_M4_GNULIB_ASINL@
+GL_M4_GNULIB_ATAN2F = @GL_M4_GNULIB_ATAN2F@
+GL_M4_GNULIB_ATANF = @GL_M4_GNULIB_ATANF@
+GL_M4_GNULIB_ATANL = @GL_M4_GNULIB_ATANL@
+GL_M4_GNULIB_ATOLL = @GL_M4_GNULIB_ATOLL@
+GL_M4_GNULIB_BIND = @GL_M4_GNULIB_BIND@
+GL_M4_GNULIB_BTOWC = @GL_M4_GNULIB_BTOWC@
+GL_M4_GNULIB_CALLOC_POSIX = @GL_M4_GNULIB_CALLOC_POSIX@
+GL_M4_GNULIB_CANONICALIZE_FILE_NAME = @GL_M4_GNULIB_CANONICALIZE_FILE_NAME@
+GL_M4_GNULIB_CBRT = @GL_M4_GNULIB_CBRT@
+GL_M4_GNULIB_CBRTF = @GL_M4_GNULIB_CBRTF@
+GL_M4_GNULIB_CBRTL = @GL_M4_GNULIB_CBRTL@
+GL_M4_GNULIB_CEIL = @GL_M4_GNULIB_CEIL@
+GL_M4_GNULIB_CEILF = @GL_M4_GNULIB_CEILF@
+GL_M4_GNULIB_CEILL = @GL_M4_GNULIB_CEILL@
+GL_M4_GNULIB_CHDIR = @GL_M4_GNULIB_CHDIR@
+GL_M4_GNULIB_CHOWN = @GL_M4_GNULIB_CHOWN@
+GL_M4_GNULIB_CLOSE = @GL_M4_GNULIB_CLOSE@
+GL_M4_GNULIB_CLOSEDIR = @GL_M4_GNULIB_CLOSEDIR@
+GL_M4_GNULIB_CONNECT = @GL_M4_GNULIB_CONNECT@
+GL_M4_GNULIB_COPYSIGN = @GL_M4_GNULIB_COPYSIGN@
+GL_M4_GNULIB_COPYSIGNF = @GL_M4_GNULIB_COPYSIGNF@
+GL_M4_GNULIB_COPYSIGNL = @GL_M4_GNULIB_COPYSIGNL@
+GL_M4_GNULIB_COPY_FILE_RANGE = @GL_M4_GNULIB_COPY_FILE_RANGE@
+GL_M4_GNULIB_COSF = @GL_M4_GNULIB_COSF@
+GL_M4_GNULIB_COSHF = @GL_M4_GNULIB_COSHF@
+GL_M4_GNULIB_COSL = @GL_M4_GNULIB_COSL@
+GL_M4_GNULIB_CREAT = @GL_M4_GNULIB_CREAT@
+GL_M4_GNULIB_CTIME = @GL_M4_GNULIB_CTIME@
+GL_M4_GNULIB_DIRFD = @GL_M4_GNULIB_DIRFD@
+GL_M4_GNULIB_DPRINTF = @GL_M4_GNULIB_DPRINTF@
+GL_M4_GNULIB_DUP = @GL_M4_GNULIB_DUP@
+GL_M4_GNULIB_DUP2 = @GL_M4_GNULIB_DUP2@
+GL_M4_GNULIB_DUP3 = @GL_M4_GNULIB_DUP3@
+GL_M4_GNULIB_DUPLOCALE = @GL_M4_GNULIB_DUPLOCALE@
+GL_M4_GNULIB_ENVIRON = @GL_M4_GNULIB_ENVIRON@
+GL_M4_GNULIB_EUIDACCESS = @GL_M4_GNULIB_EUIDACCESS@
+GL_M4_GNULIB_EXECL = @GL_M4_GNULIB_EXECL@
+GL_M4_GNULIB_EXECLE = @GL_M4_GNULIB_EXECLE@
+GL_M4_GNULIB_EXECLP = @GL_M4_GNULIB_EXECLP@
+GL_M4_GNULIB_EXECV = @GL_M4_GNULIB_EXECV@
+GL_M4_GNULIB_EXECVE = @GL_M4_GNULIB_EXECVE@
+GL_M4_GNULIB_EXECVP = @GL_M4_GNULIB_EXECVP@
+GL_M4_GNULIB_EXECVPE = @GL_M4_GNULIB_EXECVPE@
+GL_M4_GNULIB_EXP2 = @GL_M4_GNULIB_EXP2@
+GL_M4_GNULIB_EXP2F = @GL_M4_GNULIB_EXP2F@
+GL_M4_GNULIB_EXP2L = @GL_M4_GNULIB_EXP2L@
+GL_M4_GNULIB_EXPF = @GL_M4_GNULIB_EXPF@
+GL_M4_GNULIB_EXPL = @GL_M4_GNULIB_EXPL@
+GL_M4_GNULIB_EXPLICIT_BZERO = @GL_M4_GNULIB_EXPLICIT_BZERO@
+GL_M4_GNULIB_EXPM1 = @GL_M4_GNULIB_EXPM1@
+GL_M4_GNULIB_EXPM1F = @GL_M4_GNULIB_EXPM1F@
+GL_M4_GNULIB_EXPM1L = @GL_M4_GNULIB_EXPM1L@
+GL_M4_GNULIB_FABSF = @GL_M4_GNULIB_FABSF@
+GL_M4_GNULIB_FABSL = @GL_M4_GNULIB_FABSL@
+GL_M4_GNULIB_FACCESSAT = @GL_M4_GNULIB_FACCESSAT@
+GL_M4_GNULIB_FCHDIR = @GL_M4_GNULIB_FCHDIR@
+GL_M4_GNULIB_FCHMODAT = @GL_M4_GNULIB_FCHMODAT@
+GL_M4_GNULIB_FCHOWNAT = @GL_M4_GNULIB_FCHOWNAT@
+GL_M4_GNULIB_FCLOSE = @GL_M4_GNULIB_FCLOSE@
+GL_M4_GNULIB_FCNTL = @GL_M4_GNULIB_FCNTL@
+GL_M4_GNULIB_FDATASYNC = @GL_M4_GNULIB_FDATASYNC@
+GL_M4_GNULIB_FDOPEN = @GL_M4_GNULIB_FDOPEN@
+GL_M4_GNULIB_FDOPENDIR = @GL_M4_GNULIB_FDOPENDIR@
+GL_M4_GNULIB_FFLUSH = @GL_M4_GNULIB_FFLUSH@
+GL_M4_GNULIB_FFSL = @GL_M4_GNULIB_FFSL@
+GL_M4_GNULIB_FFSLL = @GL_M4_GNULIB_FFSLL@
+GL_M4_GNULIB_FGETC = @GL_M4_GNULIB_FGETC@
+GL_M4_GNULIB_FGETS = @GL_M4_GNULIB_FGETS@
+GL_M4_GNULIB_FLOOR = @GL_M4_GNULIB_FLOOR@
+GL_M4_GNULIB_FLOORF = @GL_M4_GNULIB_FLOORF@
+GL_M4_GNULIB_FLOORL = @GL_M4_GNULIB_FLOORL@
+GL_M4_GNULIB_FMA = @GL_M4_GNULIB_FMA@
+GL_M4_GNULIB_FMAF = @GL_M4_GNULIB_FMAF@
+GL_M4_GNULIB_FMAL = @GL_M4_GNULIB_FMAL@
+GL_M4_GNULIB_FMOD = @GL_M4_GNULIB_FMOD@
+GL_M4_GNULIB_FMODF = @GL_M4_GNULIB_FMODF@
+GL_M4_GNULIB_FMODL = @GL_M4_GNULIB_FMODL@
+GL_M4_GNULIB_FOPEN = @GL_M4_GNULIB_FOPEN@
+GL_M4_GNULIB_FPRINTF = @GL_M4_GNULIB_FPRINTF@
+GL_M4_GNULIB_FPRINTF_POSIX = @GL_M4_GNULIB_FPRINTF_POSIX@
+GL_M4_GNULIB_FPURGE = @GL_M4_GNULIB_FPURGE@
+GL_M4_GNULIB_FPUTC = @GL_M4_GNULIB_FPUTC@
+GL_M4_GNULIB_FPUTS = @GL_M4_GNULIB_FPUTS@
+GL_M4_GNULIB_FREAD = @GL_M4_GNULIB_FREAD@
+GL_M4_GNULIB_FREE_POSIX = @GL_M4_GNULIB_FREE_POSIX@
+GL_M4_GNULIB_FREOPEN = @GL_M4_GNULIB_FREOPEN@
+GL_M4_GNULIB_FREXP = @GL_M4_GNULIB_FREXP@
+GL_M4_GNULIB_FREXPF = @GL_M4_GNULIB_FREXPF@
+GL_M4_GNULIB_FREXPL = @GL_M4_GNULIB_FREXPL@
+GL_M4_GNULIB_FSCANF = @GL_M4_GNULIB_FSCANF@
+GL_M4_GNULIB_FSEEK = @GL_M4_GNULIB_FSEEK@
+GL_M4_GNULIB_FSEEKO = @GL_M4_GNULIB_FSEEKO@
+GL_M4_GNULIB_FSTAT = @GL_M4_GNULIB_FSTAT@
+GL_M4_GNULIB_FSTATAT = @GL_M4_GNULIB_FSTATAT@
+GL_M4_GNULIB_FSYNC = @GL_M4_GNULIB_FSYNC@
+GL_M4_GNULIB_FTELL = @GL_M4_GNULIB_FTELL@
+GL_M4_GNULIB_FTELLO = @GL_M4_GNULIB_FTELLO@
+GL_M4_GNULIB_FTRUNCATE = @GL_M4_GNULIB_FTRUNCATE@
+GL_M4_GNULIB_FUTIMENS = @GL_M4_GNULIB_FUTIMENS@
+GL_M4_GNULIB_FWRITE = @GL_M4_GNULIB_FWRITE@
+GL_M4_GNULIB_GETC = @GL_M4_GNULIB_GETC@
+GL_M4_GNULIB_GETCHAR = @GL_M4_GNULIB_GETCHAR@
+GL_M4_GNULIB_GETCWD = @GL_M4_GNULIB_GETCWD@
+GL_M4_GNULIB_GETDELIM = @GL_M4_GNULIB_GETDELIM@
+GL_M4_GNULIB_GETDOMAINNAME = @GL_M4_GNULIB_GETDOMAINNAME@
+GL_M4_GNULIB_GETDTABLESIZE = @GL_M4_GNULIB_GETDTABLESIZE@
+GL_M4_GNULIB_GETENTROPY = @GL_M4_GNULIB_GETENTROPY@
+GL_M4_GNULIB_GETGROUPS = @GL_M4_GNULIB_GETGROUPS@
+GL_M4_GNULIB_GETHOSTNAME = @GL_M4_GNULIB_GETHOSTNAME@
+GL_M4_GNULIB_GETLINE = @GL_M4_GNULIB_GETLINE@
+GL_M4_GNULIB_GETLOADAVG = @GL_M4_GNULIB_GETLOADAVG@
+GL_M4_GNULIB_GETLOGIN = @GL_M4_GNULIB_GETLOGIN@
+GL_M4_GNULIB_GETLOGIN_R = @GL_M4_GNULIB_GETLOGIN_R@
+GL_M4_GNULIB_GETOPT_POSIX = @GL_M4_GNULIB_GETOPT_POSIX@
+GL_M4_GNULIB_GETPAGESIZE = @GL_M4_GNULIB_GETPAGESIZE@
+GL_M4_GNULIB_GETPASS = @GL_M4_GNULIB_GETPASS@
+GL_M4_GNULIB_GETPEERNAME = @GL_M4_GNULIB_GETPEERNAME@
+GL_M4_GNULIB_GETRANDOM = @GL_M4_GNULIB_GETRANDOM@
+GL_M4_GNULIB_GETSOCKNAME = @GL_M4_GNULIB_GETSOCKNAME@
+GL_M4_GNULIB_GETSOCKOPT = @GL_M4_GNULIB_GETSOCKOPT@
+GL_M4_GNULIB_GETSUBOPT = @GL_M4_GNULIB_GETSUBOPT@
+GL_M4_GNULIB_GETTIMEOFDAY = @GL_M4_GNULIB_GETTIMEOFDAY@
+GL_M4_GNULIB_GETUMASK = @GL_M4_GNULIB_GETUMASK@
+GL_M4_GNULIB_GETUSERSHELL = @GL_M4_GNULIB_GETUSERSHELL@
+GL_M4_GNULIB_GRANTPT = @GL_M4_GNULIB_GRANTPT@
+GL_M4_GNULIB_GROUP_MEMBER = @GL_M4_GNULIB_GROUP_MEMBER@
+GL_M4_GNULIB_HYPOT = @GL_M4_GNULIB_HYPOT@
+GL_M4_GNULIB_HYPOTF = @GL_M4_GNULIB_HYPOTF@
+GL_M4_GNULIB_HYPOTL = @GL_M4_GNULIB_HYPOTL@
+GL_M4_GNULIB_ICONV = @GL_M4_GNULIB_ICONV@
+GL_M4_GNULIB_ILOGB = @GL_M4_GNULIB_ILOGB@
+GL_M4_GNULIB_ILOGBF = @GL_M4_GNULIB_ILOGBF@
+GL_M4_GNULIB_ILOGBL = @GL_M4_GNULIB_ILOGBL@
+GL_M4_GNULIB_IMAXABS = @GL_M4_GNULIB_IMAXABS@
+GL_M4_GNULIB_IMAXDIV = @GL_M4_GNULIB_IMAXDIV@
+GL_M4_GNULIB_INET_NTOP = @GL_M4_GNULIB_INET_NTOP@
+GL_M4_GNULIB_INET_PTON = @GL_M4_GNULIB_INET_PTON@
+GL_M4_GNULIB_IOCTL = @GL_M4_GNULIB_IOCTL@
+GL_M4_GNULIB_ISATTY = @GL_M4_GNULIB_ISATTY@
+GL_M4_GNULIB_ISBLANK = @GL_M4_GNULIB_ISBLANK@
+GL_M4_GNULIB_ISFINITE = @GL_M4_GNULIB_ISFINITE@
+GL_M4_GNULIB_ISINF = @GL_M4_GNULIB_ISINF@
+GL_M4_GNULIB_ISNAN = @GL_M4_GNULIB_ISNAN@
+GL_M4_GNULIB_ISNAND = @GL_M4_GNULIB_ISNAND@
+GL_M4_GNULIB_ISNANF = @GL_M4_GNULIB_ISNANF@
+GL_M4_GNULIB_ISNANL = @GL_M4_GNULIB_ISNANL@
+GL_M4_GNULIB_ISWBLANK = @GL_M4_GNULIB_ISWBLANK@
+GL_M4_GNULIB_ISWCTYPE = @GL_M4_GNULIB_ISWCTYPE@
+GL_M4_GNULIB_ISWDIGIT = @GL_M4_GNULIB_ISWDIGIT@
+GL_M4_GNULIB_ISWXDIGIT = @GL_M4_GNULIB_ISWXDIGIT@
+GL_M4_GNULIB_LCHMOD = @GL_M4_GNULIB_LCHMOD@
+GL_M4_GNULIB_LCHOWN = @GL_M4_GNULIB_LCHOWN@
+GL_M4_GNULIB_LDEXPF = @GL_M4_GNULIB_LDEXPF@
+GL_M4_GNULIB_LDEXPL = @GL_M4_GNULIB_LDEXPL@
+GL_M4_GNULIB_LINK = @GL_M4_GNULIB_LINK@
+GL_M4_GNULIB_LINKAT = @GL_M4_GNULIB_LINKAT@
+GL_M4_GNULIB_LISTEN = @GL_M4_GNULIB_LISTEN@
+GL_M4_GNULIB_LOCALECONV = @GL_M4_GNULIB_LOCALECONV@
+GL_M4_GNULIB_LOCALENAME = @GL_M4_GNULIB_LOCALENAME@
+GL_M4_GNULIB_LOCALTIME = @GL_M4_GNULIB_LOCALTIME@
+GL_M4_GNULIB_LOG = @GL_M4_GNULIB_LOG@
+GL_M4_GNULIB_LOG10 = @GL_M4_GNULIB_LOG10@
+GL_M4_GNULIB_LOG10F = @GL_M4_GNULIB_LOG10F@
+GL_M4_GNULIB_LOG10L = @GL_M4_GNULIB_LOG10L@
+GL_M4_GNULIB_LOG1P = @GL_M4_GNULIB_LOG1P@
+GL_M4_GNULIB_LOG1PF = @GL_M4_GNULIB_LOG1PF@
+GL_M4_GNULIB_LOG1PL = @GL_M4_GNULIB_LOG1PL@
+GL_M4_GNULIB_LOG2 = @GL_M4_GNULIB_LOG2@
+GL_M4_GNULIB_LOG2F = @GL_M4_GNULIB_LOG2F@
+GL_M4_GNULIB_LOG2L = @GL_M4_GNULIB_LOG2L@
+GL_M4_GNULIB_LOGB = @GL_M4_GNULIB_LOGB@
+GL_M4_GNULIB_LOGBF = @GL_M4_GNULIB_LOGBF@
+GL_M4_GNULIB_LOGBL = @GL_M4_GNULIB_LOGBL@
+GL_M4_GNULIB_LOGF = @GL_M4_GNULIB_LOGF@
+GL_M4_GNULIB_LOGL = @GL_M4_GNULIB_LOGL@
+GL_M4_GNULIB_LSEEK = @GL_M4_GNULIB_LSEEK@
+GL_M4_GNULIB_LSTAT = @GL_M4_GNULIB_LSTAT@
+GL_M4_GNULIB_MALLOC_POSIX = @GL_M4_GNULIB_MALLOC_POSIX@
+GL_M4_GNULIB_MBRLEN = @GL_M4_GNULIB_MBRLEN@
+GL_M4_GNULIB_MBRTOWC = @GL_M4_GNULIB_MBRTOWC@
+GL_M4_GNULIB_MBSCASECMP = @GL_M4_GNULIB_MBSCASECMP@
+GL_M4_GNULIB_MBSCASESTR = @GL_M4_GNULIB_MBSCASESTR@
+GL_M4_GNULIB_MBSCHR = @GL_M4_GNULIB_MBSCHR@
+GL_M4_GNULIB_MBSCSPN = @GL_M4_GNULIB_MBSCSPN@
+GL_M4_GNULIB_MBSINIT = @GL_M4_GNULIB_MBSINIT@
+GL_M4_GNULIB_MBSLEN = @GL_M4_GNULIB_MBSLEN@
+GL_M4_GNULIB_MBSNCASECMP = @GL_M4_GNULIB_MBSNCASECMP@
+GL_M4_GNULIB_MBSNLEN = @GL_M4_GNULIB_MBSNLEN@
+GL_M4_GNULIB_MBSNRTOWCS = @GL_M4_GNULIB_MBSNRTOWCS@
+GL_M4_GNULIB_MBSPBRK = @GL_M4_GNULIB_MBSPBRK@
+GL_M4_GNULIB_MBSPCASECMP = @GL_M4_GNULIB_MBSPCASECMP@
+GL_M4_GNULIB_MBSRCHR = @GL_M4_GNULIB_MBSRCHR@
+GL_M4_GNULIB_MBSRTOWCS = @GL_M4_GNULIB_MBSRTOWCS@
+GL_M4_GNULIB_MBSSEP = @GL_M4_GNULIB_MBSSEP@
+GL_M4_GNULIB_MBSSPN = @GL_M4_GNULIB_MBSSPN@
+GL_M4_GNULIB_MBSSTR = @GL_M4_GNULIB_MBSSTR@
+GL_M4_GNULIB_MBSTOK_R = @GL_M4_GNULIB_MBSTOK_R@
+GL_M4_GNULIB_MBTOWC = @GL_M4_GNULIB_MBTOWC@
+GL_M4_GNULIB_MDA_ACCESS = @GL_M4_GNULIB_MDA_ACCESS@
+GL_M4_GNULIB_MDA_CHDIR = @GL_M4_GNULIB_MDA_CHDIR@
+GL_M4_GNULIB_MDA_CHMOD = @GL_M4_GNULIB_MDA_CHMOD@
+GL_M4_GNULIB_MDA_CLOSE = @GL_M4_GNULIB_MDA_CLOSE@
+GL_M4_GNULIB_MDA_CREAT = @GL_M4_GNULIB_MDA_CREAT@
+GL_M4_GNULIB_MDA_DUP = @GL_M4_GNULIB_MDA_DUP@
+GL_M4_GNULIB_MDA_DUP2 = @GL_M4_GNULIB_MDA_DUP2@
+GL_M4_GNULIB_MDA_ECVT = @GL_M4_GNULIB_MDA_ECVT@
+GL_M4_GNULIB_MDA_EXECL = @GL_M4_GNULIB_MDA_EXECL@
+GL_M4_GNULIB_MDA_EXECLE = @GL_M4_GNULIB_MDA_EXECLE@
+GL_M4_GNULIB_MDA_EXECLP = @GL_M4_GNULIB_MDA_EXECLP@
+GL_M4_GNULIB_MDA_EXECV = @GL_M4_GNULIB_MDA_EXECV@
+GL_M4_GNULIB_MDA_EXECVE = @GL_M4_GNULIB_MDA_EXECVE@
+GL_M4_GNULIB_MDA_EXECVP = @GL_M4_GNULIB_MDA_EXECVP@
+GL_M4_GNULIB_MDA_EXECVPE = @GL_M4_GNULIB_MDA_EXECVPE@
+GL_M4_GNULIB_MDA_FCLOSEALL = @GL_M4_GNULIB_MDA_FCLOSEALL@
+GL_M4_GNULIB_MDA_FCVT = @GL_M4_GNULIB_MDA_FCVT@
+GL_M4_GNULIB_MDA_FDOPEN = @GL_M4_GNULIB_MDA_FDOPEN@
+GL_M4_GNULIB_MDA_FILENO = @GL_M4_GNULIB_MDA_FILENO@
+GL_M4_GNULIB_MDA_GCVT = @GL_M4_GNULIB_MDA_GCVT@
+GL_M4_GNULIB_MDA_GETCWD = @GL_M4_GNULIB_MDA_GETCWD@
+GL_M4_GNULIB_MDA_GETPID = @GL_M4_GNULIB_MDA_GETPID@
+GL_M4_GNULIB_MDA_GETW = @GL_M4_GNULIB_MDA_GETW@
+GL_M4_GNULIB_MDA_ISATTY = @GL_M4_GNULIB_MDA_ISATTY@
+GL_M4_GNULIB_MDA_J0 = @GL_M4_GNULIB_MDA_J0@
+GL_M4_GNULIB_MDA_J1 = @GL_M4_GNULIB_MDA_J1@
+GL_M4_GNULIB_MDA_JN = @GL_M4_GNULIB_MDA_JN@
+GL_M4_GNULIB_MDA_LSEEK = @GL_M4_GNULIB_MDA_LSEEK@
+GL_M4_GNULIB_MDA_MEMCCPY = @GL_M4_GNULIB_MDA_MEMCCPY@
+GL_M4_GNULIB_MDA_MKDIR = @GL_M4_GNULIB_MDA_MKDIR@
+GL_M4_GNULIB_MDA_MKTEMP = @GL_M4_GNULIB_MDA_MKTEMP@
+GL_M4_GNULIB_MDA_OPEN = @GL_M4_GNULIB_MDA_OPEN@
+GL_M4_GNULIB_MDA_PUTENV = @GL_M4_GNULIB_MDA_PUTENV@
+GL_M4_GNULIB_MDA_PUTW = @GL_M4_GNULIB_MDA_PUTW@
+GL_M4_GNULIB_MDA_READ = @GL_M4_GNULIB_MDA_READ@
+GL_M4_GNULIB_MDA_RMDIR = @GL_M4_GNULIB_MDA_RMDIR@
+GL_M4_GNULIB_MDA_STRDUP = @GL_M4_GNULIB_MDA_STRDUP@
+GL_M4_GNULIB_MDA_SWAB = @GL_M4_GNULIB_MDA_SWAB@
+GL_M4_GNULIB_MDA_TEMPNAM = @GL_M4_GNULIB_MDA_TEMPNAM@
+GL_M4_GNULIB_MDA_TZSET = @GL_M4_GNULIB_MDA_TZSET@
+GL_M4_GNULIB_MDA_UMASK = @GL_M4_GNULIB_MDA_UMASK@
+GL_M4_GNULIB_MDA_UNLINK = @GL_M4_GNULIB_MDA_UNLINK@
+GL_M4_GNULIB_MDA_WCSDUP = @GL_M4_GNULIB_MDA_WCSDUP@
+GL_M4_GNULIB_MDA_WRITE = @GL_M4_GNULIB_MDA_WRITE@
+GL_M4_GNULIB_MDA_Y0 = @GL_M4_GNULIB_MDA_Y0@
+GL_M4_GNULIB_MDA_Y1 = @GL_M4_GNULIB_MDA_Y1@
+GL_M4_GNULIB_MDA_YN = @GL_M4_GNULIB_MDA_YN@
+GL_M4_GNULIB_MEMCHR = @GL_M4_GNULIB_MEMCHR@
+GL_M4_GNULIB_MEMMEM = @GL_M4_GNULIB_MEMMEM@
+GL_M4_GNULIB_MEMPCPY = @GL_M4_GNULIB_MEMPCPY@
+GL_M4_GNULIB_MEMRCHR = @GL_M4_GNULIB_MEMRCHR@
+GL_M4_GNULIB_MKDIR = @GL_M4_GNULIB_MKDIR@
+GL_M4_GNULIB_MKDIRAT = @GL_M4_GNULIB_MKDIRAT@
+GL_M4_GNULIB_MKDTEMP = @GL_M4_GNULIB_MKDTEMP@
+GL_M4_GNULIB_MKFIFO = @GL_M4_GNULIB_MKFIFO@
+GL_M4_GNULIB_MKFIFOAT = @GL_M4_GNULIB_MKFIFOAT@
+GL_M4_GNULIB_MKNOD = @GL_M4_GNULIB_MKNOD@
+GL_M4_GNULIB_MKNODAT = @GL_M4_GNULIB_MKNODAT@
+GL_M4_GNULIB_MKOSTEMP = @GL_M4_GNULIB_MKOSTEMP@
+GL_M4_GNULIB_MKOSTEMPS = @GL_M4_GNULIB_MKOSTEMPS@
+GL_M4_GNULIB_MKSTEMP = @GL_M4_GNULIB_MKSTEMP@
+GL_M4_GNULIB_MKSTEMPS = @GL_M4_GNULIB_MKSTEMPS@
+GL_M4_GNULIB_MKTIME = @GL_M4_GNULIB_MKTIME@
+GL_M4_GNULIB_MODF = @GL_M4_GNULIB_MODF@
+GL_M4_GNULIB_MODFF = @GL_M4_GNULIB_MODFF@
+GL_M4_GNULIB_MODFL = @GL_M4_GNULIB_MODFL@
+GL_M4_GNULIB_NANOSLEEP = @GL_M4_GNULIB_NANOSLEEP@
+GL_M4_GNULIB_NL_LANGINFO = @GL_M4_GNULIB_NL_LANGINFO@
+GL_M4_GNULIB_NONBLOCKING = @GL_M4_GNULIB_NONBLOCKING@
+GL_M4_GNULIB_OBSTACK_PRINTF = @GL_M4_GNULIB_OBSTACK_PRINTF@
+GL_M4_GNULIB_OBSTACK_PRINTF_POSIX = @GL_M4_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_M4_GNULIB_OPEN = @GL_M4_GNULIB_OPEN@
+GL_M4_GNULIB_OPENAT = @GL_M4_GNULIB_OPENAT@
+GL_M4_GNULIB_OPENDIR = @GL_M4_GNULIB_OPENDIR@
+GL_M4_GNULIB_OVERRIDES_STRUCT_STAT = @GL_M4_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_M4_GNULIB_PCLOSE = @GL_M4_GNULIB_PCLOSE@
+GL_M4_GNULIB_PERROR = @GL_M4_GNULIB_PERROR@
+GL_M4_GNULIB_PIPE = @GL_M4_GNULIB_PIPE@
+GL_M4_GNULIB_PIPE2 = @GL_M4_GNULIB_PIPE2@
+GL_M4_GNULIB_POPEN = @GL_M4_GNULIB_POPEN@
+GL_M4_GNULIB_POSIX_MEMALIGN = @GL_M4_GNULIB_POSIX_MEMALIGN@
+GL_M4_GNULIB_POSIX_OPENPT = @GL_M4_GNULIB_POSIX_OPENPT@
+GL_M4_GNULIB_POSIX_SPAWN = @GL_M4_GNULIB_POSIX_SPAWN@
+GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY = @GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNATTR_INIT = @GL_M4_GNULIB_POSIX_SPAWNATTR_INIT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNP = @GL_M4_GNULIB_POSIX_SPAWNP@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
+GL_M4_GNULIB_POWF = @GL_M4_GNULIB_POWF@
+GL_M4_GNULIB_PREAD = @GL_M4_GNULIB_PREAD@
+GL_M4_GNULIB_PRINTF = @GL_M4_GNULIB_PRINTF@
+GL_M4_GNULIB_PRINTF_POSIX = @GL_M4_GNULIB_PRINTF_POSIX@
+GL_M4_GNULIB_PSELECT = @GL_M4_GNULIB_PSELECT@
+GL_M4_GNULIB_PTHREAD_COND = @GL_M4_GNULIB_PTHREAD_COND@
+GL_M4_GNULIB_PTHREAD_MUTEX = @GL_M4_GNULIB_PTHREAD_MUTEX@
+GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK = @GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK@
+GL_M4_GNULIB_PTHREAD_ONCE = @GL_M4_GNULIB_PTHREAD_ONCE@
+GL_M4_GNULIB_PTHREAD_RWLOCK = @GL_M4_GNULIB_PTHREAD_RWLOCK@
+GL_M4_GNULIB_PTHREAD_SIGMASK = @GL_M4_GNULIB_PTHREAD_SIGMASK@
+GL_M4_GNULIB_PTHREAD_SPIN = @GL_M4_GNULIB_PTHREAD_SPIN@
+GL_M4_GNULIB_PTHREAD_THREAD = @GL_M4_GNULIB_PTHREAD_THREAD@
+GL_M4_GNULIB_PTHREAD_TSS = @GL_M4_GNULIB_PTHREAD_TSS@
+GL_M4_GNULIB_PTSNAME = @GL_M4_GNULIB_PTSNAME@
+GL_M4_GNULIB_PTSNAME_R = @GL_M4_GNULIB_PTSNAME_R@
+GL_M4_GNULIB_PUTC = @GL_M4_GNULIB_PUTC@
+GL_M4_GNULIB_PUTCHAR = @GL_M4_GNULIB_PUTCHAR@
+GL_M4_GNULIB_PUTENV = @GL_M4_GNULIB_PUTENV@
+GL_M4_GNULIB_PUTS = @GL_M4_GNULIB_PUTS@
+GL_M4_GNULIB_PWRITE = @GL_M4_GNULIB_PWRITE@
+GL_M4_GNULIB_QSORT_R = @GL_M4_GNULIB_QSORT_R@
+GL_M4_GNULIB_RAISE = @GL_M4_GNULIB_RAISE@
+GL_M4_GNULIB_RANDOM = @GL_M4_GNULIB_RANDOM@
+GL_M4_GNULIB_RANDOM_R = @GL_M4_GNULIB_RANDOM_R@
+GL_M4_GNULIB_RAWMEMCHR = @GL_M4_GNULIB_RAWMEMCHR@
+GL_M4_GNULIB_READ = @GL_M4_GNULIB_READ@
+GL_M4_GNULIB_READDIR = @GL_M4_GNULIB_READDIR@
+GL_M4_GNULIB_READLINK = @GL_M4_GNULIB_READLINK@
+GL_M4_GNULIB_READLINKAT = @GL_M4_GNULIB_READLINKAT@
+GL_M4_GNULIB_REALLOCARRAY = @GL_M4_GNULIB_REALLOCARRAY@
+GL_M4_GNULIB_REALLOC_POSIX = @GL_M4_GNULIB_REALLOC_POSIX@
+GL_M4_GNULIB_REALPATH = @GL_M4_GNULIB_REALPATH@
+GL_M4_GNULIB_RECV = @GL_M4_GNULIB_RECV@
+GL_M4_GNULIB_RECVFROM = @GL_M4_GNULIB_RECVFROM@
+GL_M4_GNULIB_REMAINDER = @GL_M4_GNULIB_REMAINDER@
+GL_M4_GNULIB_REMAINDERF = @GL_M4_GNULIB_REMAINDERF@
+GL_M4_GNULIB_REMAINDERL = @GL_M4_GNULIB_REMAINDERL@
+GL_M4_GNULIB_REMOVE = @GL_M4_GNULIB_REMOVE@
+GL_M4_GNULIB_RENAME = @GL_M4_GNULIB_RENAME@
+GL_M4_GNULIB_RENAMEAT = @GL_M4_GNULIB_RENAMEAT@
+GL_M4_GNULIB_REWINDDIR = @GL_M4_GNULIB_REWINDDIR@
+GL_M4_GNULIB_RINT = @GL_M4_GNULIB_RINT@
+GL_M4_GNULIB_RINTF = @GL_M4_GNULIB_RINTF@
+GL_M4_GNULIB_RINTL = @GL_M4_GNULIB_RINTL@
+GL_M4_GNULIB_RMDIR = @GL_M4_GNULIB_RMDIR@
+GL_M4_GNULIB_ROUND = @GL_M4_GNULIB_ROUND@
+GL_M4_GNULIB_ROUNDF = @GL_M4_GNULIB_ROUNDF@
+GL_M4_GNULIB_ROUNDL = @GL_M4_GNULIB_ROUNDL@
+GL_M4_GNULIB_RPMATCH = @GL_M4_GNULIB_RPMATCH@
+GL_M4_GNULIB_SCANDIR = @GL_M4_GNULIB_SCANDIR@
+GL_M4_GNULIB_SCANF = @GL_M4_GNULIB_SCANF@
+GL_M4_GNULIB_SCHED_YIELD = @GL_M4_GNULIB_SCHED_YIELD@
+GL_M4_GNULIB_SECURE_GETENV = @GL_M4_GNULIB_SECURE_GETENV@
+GL_M4_GNULIB_SELECT = @GL_M4_GNULIB_SELECT@
+GL_M4_GNULIB_SEND = @GL_M4_GNULIB_SEND@
+GL_M4_GNULIB_SENDTO = @GL_M4_GNULIB_SENDTO@
+GL_M4_GNULIB_SETENV = @GL_M4_GNULIB_SETENV@
+GL_M4_GNULIB_SETHOSTNAME = @GL_M4_GNULIB_SETHOSTNAME@
+GL_M4_GNULIB_SETLOCALE = @GL_M4_GNULIB_SETLOCALE@
+GL_M4_GNULIB_SETLOCALE_NULL = @GL_M4_GNULIB_SETLOCALE_NULL@
+GL_M4_GNULIB_SETSOCKOPT = @GL_M4_GNULIB_SETSOCKOPT@
+GL_M4_GNULIB_SHUTDOWN = @GL_M4_GNULIB_SHUTDOWN@
+GL_M4_GNULIB_SIGABBREV_NP = @GL_M4_GNULIB_SIGABBREV_NP@
+GL_M4_GNULIB_SIGACTION = @GL_M4_GNULIB_SIGACTION@
+GL_M4_GNULIB_SIGDESCR_NP = @GL_M4_GNULIB_SIGDESCR_NP@
+GL_M4_GNULIB_SIGNAL_H_SIGPIPE = @GL_M4_GNULIB_SIGNAL_H_SIGPIPE@
+GL_M4_GNULIB_SIGNBIT = @GL_M4_GNULIB_SIGNBIT@
+GL_M4_GNULIB_SIGPROCMASK = @GL_M4_GNULIB_SIGPROCMASK@
+GL_M4_GNULIB_SINF = @GL_M4_GNULIB_SINF@
+GL_M4_GNULIB_SINHF = @GL_M4_GNULIB_SINHF@
+GL_M4_GNULIB_SINL = @GL_M4_GNULIB_SINL@
+GL_M4_GNULIB_SLEEP = @GL_M4_GNULIB_SLEEP@
+GL_M4_GNULIB_SNPRINTF = @GL_M4_GNULIB_SNPRINTF@
+GL_M4_GNULIB_SOCKET = @GL_M4_GNULIB_SOCKET@
+GL_M4_GNULIB_SPRINTF_POSIX = @GL_M4_GNULIB_SPRINTF_POSIX@
+GL_M4_GNULIB_SQRTF = @GL_M4_GNULIB_SQRTF@
+GL_M4_GNULIB_SQRTL = @GL_M4_GNULIB_SQRTL@
+GL_M4_GNULIB_STAT = @GL_M4_GNULIB_STAT@
+GL_M4_GNULIB_STDIO_H_NONBLOCKING = @GL_M4_GNULIB_STDIO_H_NONBLOCKING@
+GL_M4_GNULIB_STDIO_H_SIGPIPE = @GL_M4_GNULIB_STDIO_H_SIGPIPE@
+GL_M4_GNULIB_STPCPY = @GL_M4_GNULIB_STPCPY@
+GL_M4_GNULIB_STPNCPY = @GL_M4_GNULIB_STPNCPY@
+GL_M4_GNULIB_STRCASESTR = @GL_M4_GNULIB_STRCASESTR@
+GL_M4_GNULIB_STRCHRNUL = @GL_M4_GNULIB_STRCHRNUL@
+GL_M4_GNULIB_STRDUP = @GL_M4_GNULIB_STRDUP@
+GL_M4_GNULIB_STRERROR = @GL_M4_GNULIB_STRERROR@
+GL_M4_GNULIB_STRERRORNAME_NP = @GL_M4_GNULIB_STRERRORNAME_NP@
+GL_M4_GNULIB_STRERROR_R = @GL_M4_GNULIB_STRERROR_R@
+GL_M4_GNULIB_STRFTIME = @GL_M4_GNULIB_STRFTIME@
+GL_M4_GNULIB_STRNCAT = @GL_M4_GNULIB_STRNCAT@
+GL_M4_GNULIB_STRNDUP = @GL_M4_GNULIB_STRNDUP@
+GL_M4_GNULIB_STRNLEN = @GL_M4_GNULIB_STRNLEN@
+GL_M4_GNULIB_STRPBRK = @GL_M4_GNULIB_STRPBRK@
+GL_M4_GNULIB_STRPTIME = @GL_M4_GNULIB_STRPTIME@
+GL_M4_GNULIB_STRSEP = @GL_M4_GNULIB_STRSEP@
+GL_M4_GNULIB_STRSIGNAL = @GL_M4_GNULIB_STRSIGNAL@
+GL_M4_GNULIB_STRSTR = @GL_M4_GNULIB_STRSTR@
+GL_M4_GNULIB_STRTOD = @GL_M4_GNULIB_STRTOD@
+GL_M4_GNULIB_STRTOIMAX = @GL_M4_GNULIB_STRTOIMAX@
+GL_M4_GNULIB_STRTOK_R = @GL_M4_GNULIB_STRTOK_R@
+GL_M4_GNULIB_STRTOL = @GL_M4_GNULIB_STRTOL@
+GL_M4_GNULIB_STRTOLD = @GL_M4_GNULIB_STRTOLD@
+GL_M4_GNULIB_STRTOLL = @GL_M4_GNULIB_STRTOLL@
+GL_M4_GNULIB_STRTOUL = @GL_M4_GNULIB_STRTOUL@
+GL_M4_GNULIB_STRTOULL = @GL_M4_GNULIB_STRTOULL@
+GL_M4_GNULIB_STRTOUMAX = @GL_M4_GNULIB_STRTOUMAX@
+GL_M4_GNULIB_STRVERSCMP = @GL_M4_GNULIB_STRVERSCMP@
+GL_M4_GNULIB_SYMLINK = @GL_M4_GNULIB_SYMLINK@
+GL_M4_GNULIB_SYMLINKAT = @GL_M4_GNULIB_SYMLINKAT@
+GL_M4_GNULIB_SYSTEM_POSIX = @GL_M4_GNULIB_SYSTEM_POSIX@
+GL_M4_GNULIB_TANF = @GL_M4_GNULIB_TANF@
+GL_M4_GNULIB_TANHF = @GL_M4_GNULIB_TANHF@
+GL_M4_GNULIB_TANL = @GL_M4_GNULIB_TANL@
+GL_M4_GNULIB_TIMEGM = @GL_M4_GNULIB_TIMEGM@
+GL_M4_GNULIB_TIMESPEC_GET = @GL_M4_GNULIB_TIMESPEC_GET@
+GL_M4_GNULIB_TIME_R = @GL_M4_GNULIB_TIME_R@
+GL_M4_GNULIB_TIME_RZ = @GL_M4_GNULIB_TIME_RZ@
+GL_M4_GNULIB_TMPFILE = @GL_M4_GNULIB_TMPFILE@
+GL_M4_GNULIB_TOWCTRANS = @GL_M4_GNULIB_TOWCTRANS@
+GL_M4_GNULIB_TRUNC = @GL_M4_GNULIB_TRUNC@
+GL_M4_GNULIB_TRUNCATE = @GL_M4_GNULIB_TRUNCATE@
+GL_M4_GNULIB_TRUNCF = @GL_M4_GNULIB_TRUNCF@
+GL_M4_GNULIB_TRUNCL = @GL_M4_GNULIB_TRUNCL@
+GL_M4_GNULIB_TTYNAME_R = @GL_M4_GNULIB_TTYNAME_R@
+GL_M4_GNULIB_TZSET = @GL_M4_GNULIB_TZSET@
+GL_M4_GNULIB_UNISTD_H_NONBLOCKING = @GL_M4_GNULIB_UNISTD_H_NONBLOCKING@
+GL_M4_GNULIB_UNISTD_H_SIGPIPE = @GL_M4_GNULIB_UNISTD_H_SIGPIPE@
+GL_M4_GNULIB_UNLINK = @GL_M4_GNULIB_UNLINK@
+GL_M4_GNULIB_UNLINKAT = @GL_M4_GNULIB_UNLINKAT@
+GL_M4_GNULIB_UNLOCKPT = @GL_M4_GNULIB_UNLOCKPT@
+GL_M4_GNULIB_UNSETENV = @GL_M4_GNULIB_UNSETENV@
+GL_M4_GNULIB_USLEEP = @GL_M4_GNULIB_USLEEP@
+GL_M4_GNULIB_UTIMENSAT = @GL_M4_GNULIB_UTIMENSAT@
+GL_M4_GNULIB_VASPRINTF = @GL_M4_GNULIB_VASPRINTF@
+GL_M4_GNULIB_VDPRINTF = @GL_M4_GNULIB_VDPRINTF@
+GL_M4_GNULIB_VFPRINTF = @GL_M4_GNULIB_VFPRINTF@
+GL_M4_GNULIB_VFPRINTF_POSIX = @GL_M4_GNULIB_VFPRINTF_POSIX@
+GL_M4_GNULIB_VFSCANF = @GL_M4_GNULIB_VFSCANF@
+GL_M4_GNULIB_VPRINTF = @GL_M4_GNULIB_VPRINTF@
+GL_M4_GNULIB_VPRINTF_POSIX = @GL_M4_GNULIB_VPRINTF_POSIX@
+GL_M4_GNULIB_VSCANF = @GL_M4_GNULIB_VSCANF@
+GL_M4_GNULIB_VSNPRINTF = @GL_M4_GNULIB_VSNPRINTF@
+GL_M4_GNULIB_VSPRINTF_POSIX = @GL_M4_GNULIB_VSPRINTF_POSIX@
+GL_M4_GNULIB_WAITPID = @GL_M4_GNULIB_WAITPID@
+GL_M4_GNULIB_WCPCPY = @GL_M4_GNULIB_WCPCPY@
+GL_M4_GNULIB_WCPNCPY = @GL_M4_GNULIB_WCPNCPY@
+GL_M4_GNULIB_WCRTOMB = @GL_M4_GNULIB_WCRTOMB@
+GL_M4_GNULIB_WCSCASECMP = @GL_M4_GNULIB_WCSCASECMP@
+GL_M4_GNULIB_WCSCAT = @GL_M4_GNULIB_WCSCAT@
+GL_M4_GNULIB_WCSCHR = @GL_M4_GNULIB_WCSCHR@
+GL_M4_GNULIB_WCSCMP = @GL_M4_GNULIB_WCSCMP@
+GL_M4_GNULIB_WCSCOLL = @GL_M4_GNULIB_WCSCOLL@
+GL_M4_GNULIB_WCSCPY = @GL_M4_GNULIB_WCSCPY@
+GL_M4_GNULIB_WCSCSPN = @GL_M4_GNULIB_WCSCSPN@
+GL_M4_GNULIB_WCSDUP = @GL_M4_GNULIB_WCSDUP@
+GL_M4_GNULIB_WCSFTIME = @GL_M4_GNULIB_WCSFTIME@
+GL_M4_GNULIB_WCSLEN = @GL_M4_GNULIB_WCSLEN@
+GL_M4_GNULIB_WCSNCASECMP = @GL_M4_GNULIB_WCSNCASECMP@
+GL_M4_GNULIB_WCSNCAT = @GL_M4_GNULIB_WCSNCAT@
+GL_M4_GNULIB_WCSNCMP = @GL_M4_GNULIB_WCSNCMP@
+GL_M4_GNULIB_WCSNCPY = @GL_M4_GNULIB_WCSNCPY@
+GL_M4_GNULIB_WCSNLEN = @GL_M4_GNULIB_WCSNLEN@
+GL_M4_GNULIB_WCSNRTOMBS = @GL_M4_GNULIB_WCSNRTOMBS@
+GL_M4_GNULIB_WCSPBRK = @GL_M4_GNULIB_WCSPBRK@
+GL_M4_GNULIB_WCSRCHR = @GL_M4_GNULIB_WCSRCHR@
+GL_M4_GNULIB_WCSRTOMBS = @GL_M4_GNULIB_WCSRTOMBS@
+GL_M4_GNULIB_WCSSPN = @GL_M4_GNULIB_WCSSPN@
+GL_M4_GNULIB_WCSSTR = @GL_M4_GNULIB_WCSSTR@
+GL_M4_GNULIB_WCSTOK = @GL_M4_GNULIB_WCSTOK@
+GL_M4_GNULIB_WCSWIDTH = @GL_M4_GNULIB_WCSWIDTH@
+GL_M4_GNULIB_WCSXFRM = @GL_M4_GNULIB_WCSXFRM@
+GL_M4_GNULIB_WCTOB = @GL_M4_GNULIB_WCTOB@
+GL_M4_GNULIB_WCTOMB = @GL_M4_GNULIB_WCTOMB@
+GL_M4_GNULIB_WCTRANS = @GL_M4_GNULIB_WCTRANS@
+GL_M4_GNULIB_WCTYPE = @GL_M4_GNULIB_WCTYPE@
+GL_M4_GNULIB_WCWIDTH = @GL_M4_GNULIB_WCWIDTH@
+GL_M4_GNULIB_WMEMCHR = @GL_M4_GNULIB_WMEMCHR@
+GL_M4_GNULIB_WMEMCMP = @GL_M4_GNULIB_WMEMCMP@
+GL_M4_GNULIB_WMEMCPY = @GL_M4_GNULIB_WMEMCPY@
+GL_M4_GNULIB_WMEMMOVE = @GL_M4_GNULIB_WMEMMOVE@
+GL_M4_GNULIB_WMEMPCPY = @GL_M4_GNULIB_WMEMPCPY@
+GL_M4_GNULIB_WMEMSET = @GL_M4_GNULIB_WMEMSET@
+GL_M4_GNULIB_WRITE = @GL_M4_GNULIB_WRITE@
+GL_M4_GNULIB__EXIT = @GL_M4_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
-GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
 GNULIB_GL_M4_UNISTD_H_GETOPT = @GNULIB_GL_M4_UNISTD_H_GETOPT@
-GNULIB_GRANTPT = @GNULIB_GRANTPT@
-GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
-GNULIB_HYPOT = @GNULIB_HYPOT@
-GNULIB_HYPOTF = @GNULIB_HYPOTF@
-GNULIB_HYPOTL = @GNULIB_HYPOTL@
-GNULIB_ILOGB = @GNULIB_ILOGB@
-GNULIB_ILOGBF = @GNULIB_ILOGBF@
-GNULIB_ILOGBL = @GNULIB_ILOGBL@
-GNULIB_IMAXABS = @GNULIB_IMAXABS@
-GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
-GNULIB_ISATTY = @GNULIB_ISATTY@
-GNULIB_ISBLANK = @GNULIB_ISBLANK@
-GNULIB_ISFINITE = @GNULIB_ISFINITE@
-GNULIB_ISINF = @GNULIB_ISINF@
-GNULIB_ISNAN = @GNULIB_ISNAN@
-GNULIB_ISNAND = @GNULIB_ISNAND@
-GNULIB_ISNANF = @GNULIB_ISNANF@
-GNULIB_ISNANL = @GNULIB_ISNANL@
-GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
-GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
-GNULIB_LCHMOD = @GNULIB_LCHMOD@
-GNULIB_LCHOWN = @GNULIB_LCHOWN@
-GNULIB_LDEXPF = @GNULIB_LDEXPF@
-GNULIB_LDEXPL = @GNULIB_LDEXPL@
-GNULIB_LINK = @GNULIB_LINK@
-GNULIB_LINKAT = @GNULIB_LINKAT@
-GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
-GNULIB_LOG = @GNULIB_LOG@
-GNULIB_LOG10 = @GNULIB_LOG10@
-GNULIB_LOG10F = @GNULIB_LOG10F@
-GNULIB_LOG10L = @GNULIB_LOG10L@
-GNULIB_LOG1P = @GNULIB_LOG1P@
-GNULIB_LOG1PF = @GNULIB_LOG1PF@
-GNULIB_LOG1PL = @GNULIB_LOG1PL@
-GNULIB_LOG2 = @GNULIB_LOG2@
-GNULIB_LOG2F = @GNULIB_LOG2F@
-GNULIB_LOG2L = @GNULIB_LOG2L@
-GNULIB_LOGB = @GNULIB_LOGB@
-GNULIB_LOGBF = @GNULIB_LOGBF@
-GNULIB_LOGBL = @GNULIB_LOGBL@
-GNULIB_LOGF = @GNULIB_LOGF@
-GNULIB_LOGL = @GNULIB_LOGL@
-GNULIB_LSEEK = @GNULIB_LSEEK@
-GNULIB_LSTAT = @GNULIB_LSTAT@
-GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
-GNULIB_MBRLEN = @GNULIB_MBRLEN@
-GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
-GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
-GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
-GNULIB_MBSCHR = @GNULIB_MBSCHR@
-GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
-GNULIB_MBSINIT = @GNULIB_MBSINIT@
-GNULIB_MBSLEN = @GNULIB_MBSLEN@
-GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
-GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
-GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
-GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
-GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
-GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
-GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
-GNULIB_MBSSEP = @GNULIB_MBSSEP@
-GNULIB_MBSSPN = @GNULIB_MBSSPN@
-GNULIB_MBSSTR = @GNULIB_MBSSTR@
-GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
-GNULIB_MBTOWC = @GNULIB_MBTOWC@
-GNULIB_MEMCHR = @GNULIB_MEMCHR@
-GNULIB_MEMMEM = @GNULIB_MEMMEM@
-GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
-GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
-GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
-GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
-GNULIB_MKFIFO = @GNULIB_MKFIFO@
-GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
-GNULIB_MKNOD = @GNULIB_MKNOD@
-GNULIB_MKNODAT = @GNULIB_MKNODAT@
-GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
-GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
-GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
-GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
-GNULIB_MKTIME = @GNULIB_MKTIME@
-GNULIB_MODF = @GNULIB_MODF@
-GNULIB_MODFF = @GNULIB_MODFF@
-GNULIB_MODFL = @GNULIB_MODFL@
-GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
-GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
-GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
-GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
-GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
-GNULIB_OPEN = @GNULIB_OPEN@
-GNULIB_OPENAT = @GNULIB_OPENAT@
-GNULIB_OPENDIR = @GNULIB_OPENDIR@
-GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@
-GNULIB_PCLOSE = @GNULIB_PCLOSE@
-GNULIB_PERROR = @GNULIB_PERROR@
-GNULIB_PIPE = @GNULIB_PIPE@
-GNULIB_PIPE2 = @GNULIB_PIPE2@
-GNULIB_POPEN = @GNULIB_POPEN@
-GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
-GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@
-GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@
-GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
-GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
-GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@
-GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
-GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
-GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
-GNULIB_POWF = @GNULIB_POWF@
-GNULIB_PREAD = @GNULIB_PREAD@
-GNULIB_PRINTF = @GNULIB_PRINTF@
-GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
-GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
-GNULIB_PTSNAME = @GNULIB_PTSNAME@
-GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
-GNULIB_PUTC = @GNULIB_PUTC@
-GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
-GNULIB_PUTENV = @GNULIB_PUTENV@
-GNULIB_PUTS = @GNULIB_PUTS@
-GNULIB_PWRITE = @GNULIB_PWRITE@
-GNULIB_QSORT_R = @GNULIB_QSORT_R@
-GNULIB_RAISE = @GNULIB_RAISE@
-GNULIB_RANDOM = @GNULIB_RANDOM@
-GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
-GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
-GNULIB_READ = @GNULIB_READ@
-GNULIB_READDIR = @GNULIB_READDIR@
-GNULIB_READLINK = @GNULIB_READLINK@
-GNULIB_READLINKAT = @GNULIB_READLINKAT@
-GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
-GNULIB_REALPATH = @GNULIB_REALPATH@
-GNULIB_REMAINDER = @GNULIB_REMAINDER@
-GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
-GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
-GNULIB_REMOVE = @GNULIB_REMOVE@
-GNULIB_RENAME = @GNULIB_RENAME@
-GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
-GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
-GNULIB_RINT = @GNULIB_RINT@
-GNULIB_RINTF = @GNULIB_RINTF@
-GNULIB_RINTL = @GNULIB_RINTL@
-GNULIB_RMDIR = @GNULIB_RMDIR@
-GNULIB_ROUND = @GNULIB_ROUND@
-GNULIB_ROUNDF = @GNULIB_ROUNDF@
-GNULIB_ROUNDL = @GNULIB_ROUNDL@
-GNULIB_RPMATCH = @GNULIB_RPMATCH@
-GNULIB_SCANDIR = @GNULIB_SCANDIR@
-GNULIB_SCANF = @GNULIB_SCANF@
-GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
-GNULIB_SETENV = @GNULIB_SETENV@
-GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
-GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
-GNULIB_SIGACTION = @GNULIB_SIGACTION@
-GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
-GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
-GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
-GNULIB_SINF = @GNULIB_SINF@
-GNULIB_SINHF = @GNULIB_SINHF@
-GNULIB_SINL = @GNULIB_SINL@
-GNULIB_SLEEP = @GNULIB_SLEEP@
-GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
-GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
-GNULIB_SQRTF = @GNULIB_SQRTF@
-GNULIB_SQRTL = @GNULIB_SQRTL@
-GNULIB_STAT = @GNULIB_STAT@
-GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
-GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
-GNULIB_STPCPY = @GNULIB_STPCPY@
-GNULIB_STPNCPY = @GNULIB_STPNCPY@
-GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
-GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
-GNULIB_STRDUP = @GNULIB_STRDUP@
-GNULIB_STRERROR = @GNULIB_STRERROR@
-GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
-GNULIB_STRNCAT = @GNULIB_STRNCAT@
-GNULIB_STRNDUP = @GNULIB_STRNDUP@
-GNULIB_STRNLEN = @GNULIB_STRNLEN@
-GNULIB_STRPBRK = @GNULIB_STRPBRK@
-GNULIB_STRPTIME = @GNULIB_STRPTIME@
-GNULIB_STRSEP = @GNULIB_STRSEP@
-GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
-GNULIB_STRSTR = @GNULIB_STRSTR@
-GNULIB_STRTOD = @GNULIB_STRTOD@
-GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
-GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
-GNULIB_STRTOLL = @GNULIB_STRTOLL@
-GNULIB_STRTOULL = @GNULIB_STRTOULL@
-GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
-GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
-GNULIB_SYMLINK = @GNULIB_SYMLINK@
-GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
-GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
-GNULIB_TANF = @GNULIB_TANF@
-GNULIB_TANHF = @GNULIB_TANHF@
-GNULIB_TANL = @GNULIB_TANL@
-GNULIB_TIMEGM = @GNULIB_TIMEGM@
-GNULIB_TIME_R = @GNULIB_TIME_R@
-GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
-GNULIB_TMPFILE = @GNULIB_TMPFILE@
-GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
-GNULIB_TRUNC = @GNULIB_TRUNC@
-GNULIB_TRUNCF = @GNULIB_TRUNCF@
-GNULIB_TRUNCL = @GNULIB_TRUNCL@
-GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
-GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
-GNULIB_UNLINK = @GNULIB_UNLINK@
-GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
-GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
-GNULIB_UNSETENV = @GNULIB_UNSETENV@
-GNULIB_USLEEP = @GNULIB_USLEEP@
-GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
-GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
-GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
-GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
-GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
-GNULIB_VFSCANF = @GNULIB_VFSCANF@
-GNULIB_VPRINTF = @GNULIB_VPRINTF@
-GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
-GNULIB_VSCANF = @GNULIB_VSCANF@
-GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
-GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
-GNULIB_WAITPID = @GNULIB_WAITPID@
-GNULIB_WCPCPY = @GNULIB_WCPCPY@
-GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
-GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
-GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
-GNULIB_WCSCAT = @GNULIB_WCSCAT@
-GNULIB_WCSCHR = @GNULIB_WCSCHR@
-GNULIB_WCSCMP = @GNULIB_WCSCMP@
-GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
-GNULIB_WCSCPY = @GNULIB_WCSCPY@
-GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
-GNULIB_WCSDUP = @GNULIB_WCSDUP@
-GNULIB_WCSLEN = @GNULIB_WCSLEN@
-GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
-GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
-GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
-GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
-GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
-GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
-GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
-GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
-GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
-GNULIB_WCSSPN = @GNULIB_WCSSPN@
-GNULIB_WCSSTR = @GNULIB_WCSSTR@
-GNULIB_WCSTOK = @GNULIB_WCSTOK@
-GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
-GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
-GNULIB_WCTOB = @GNULIB_WCTOB@
-GNULIB_WCTOMB = @GNULIB_WCTOMB@
-GNULIB_WCTRANS = @GNULIB_WCTRANS@
-GNULIB_WCTYPE = @GNULIB_WCTYPE@
-GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
-GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
-GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
-GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
-GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
-GNULIB_WMEMSET = @GNULIB_WMEMSET@
-GNULIB_WRITE = @GNULIB_WRITE@
-GNULIB__EXIT = @GNULIB__EXIT@
 GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ACOSF = @HAVE_ACOSF@
 HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ASINF = @HAVE_ASINF@
 HAVE_ASINL = @HAVE_ASINL@
 HAVE_ATAN2F = @HAVE_ATAN2F@
@@ -677,9 +852,11 @@ HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
 HAVE_COPYSIGN = @HAVE_COPYSIGN@
 HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
 HAVE_COSF = @HAVE_COSF@
 HAVE_COSHF = @HAVE_COSHF@
 HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
 HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
 HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
 HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
@@ -690,13 +867,17 @@ HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
 HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
 HAVE_DECL_COSL = @HAVE_DECL_COSL@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
 HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
 HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
 HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
 HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
 HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
 HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
 HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
@@ -705,6 +886,7 @@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
 HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
@@ -715,6 +897,9 @@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
 HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
 HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
 HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
 HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
@@ -734,6 +919,7 @@ HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
 HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
 HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
 HAVE_DECL_SINL = @HAVE_DECL_SINL@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
@@ -747,21 +933,24 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TANL = @HAVE_DECL_TANL@
 HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
-HAVE_DUP2 = @HAVE_DUP2@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
 HAVE_EXPF = @HAVE_EXPF@
 HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
 HAVE_EXPM1 = @HAVE_EXPM1@
 HAVE_EXPM1F = @HAVE_EXPM1F@
 HAVE_FABSF = @HAVE_FABSF@
@@ -781,6 +970,7 @@ HAVE_FMAF = @HAVE_FMAF@
 HAVE_FMAL = @HAVE_FMAL@
 HAVE_FMODF = @HAVE_FMODF@
 HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
 HAVE_FREXPF = @HAVE_FREXPF@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
@@ -789,13 +979,17 @@ HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
 HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
 HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETRANDOM = @HAVE_GETRANDOM@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GETUMASK = @HAVE_GETUMASK@
 HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_HYPOTF = @HAVE_HYPOTF@
@@ -803,6 +997,8 @@ HAVE_HYPOTL = @HAVE_HYPOTL@
 HAVE_ILOGB = @HAVE_ILOGB@
 HAVE_ILOGBF = @HAVE_ILOGBF@
 HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISNAND = @HAVE_ISNAND@
@@ -810,6 +1006,7 @@ HAVE_ISNANF = @HAVE_ISNANF@
 HAVE_ISNANL = @HAVE_ISNANL@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
 HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
 HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
 HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
@@ -830,7 +1027,6 @@ HAVE_LOGBF = @HAVE_LOGBF@
 HAVE_LOGBL = @HAVE_LOGBL@
 HAVE_LOGF = @HAVE_LOGF@
 HAVE_LOGL = @HAVE_LOGL@
-HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
 HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
 HAVE_MBRLEN = @HAVE_MBRLEN@
@@ -839,7 +1035,7 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
 HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
-HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MBTOWC = @HAVE_MBTOWC@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
 HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
@@ -855,6 +1051,8 @@ HAVE_MODFF = @HAVE_MODFF@
 HAVE_MODFL = @HAVE_MODFL@
 HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OPENDIR = @HAVE_OPENDIR@
@@ -863,14 +1061,76 @@ HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@
 HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PSELECT = @HAVE_PSELECT@
+HAVE_PTHREAD_ATTR_DESTROY = @HAVE_PTHREAD_ATTR_DESTROY@
+HAVE_PTHREAD_ATTR_GETDETACHSTATE = @HAVE_PTHREAD_ATTR_GETDETACHSTATE@
+HAVE_PTHREAD_ATTR_INIT = @HAVE_PTHREAD_ATTR_INIT@
+HAVE_PTHREAD_ATTR_SETDETACHSTATE = @HAVE_PTHREAD_ATTR_SETDETACHSTATE@
+HAVE_PTHREAD_CONDATTR_DESTROY = @HAVE_PTHREAD_CONDATTR_DESTROY@
+HAVE_PTHREAD_CONDATTR_INIT = @HAVE_PTHREAD_CONDATTR_INIT@
+HAVE_PTHREAD_COND_BROADCAST = @HAVE_PTHREAD_COND_BROADCAST@
+HAVE_PTHREAD_COND_DESTROY = @HAVE_PTHREAD_COND_DESTROY@
+HAVE_PTHREAD_COND_INIT = @HAVE_PTHREAD_COND_INIT@
+HAVE_PTHREAD_COND_SIGNAL = @HAVE_PTHREAD_COND_SIGNAL@
+HAVE_PTHREAD_COND_TIMEDWAIT = @HAVE_PTHREAD_COND_TIMEDWAIT@
+HAVE_PTHREAD_COND_WAIT = @HAVE_PTHREAD_COND_WAIT@
+HAVE_PTHREAD_CREATE = @HAVE_PTHREAD_CREATE@
+HAVE_PTHREAD_CREATE_DETACHED = @HAVE_PTHREAD_CREATE_DETACHED@
+HAVE_PTHREAD_DETACH = @HAVE_PTHREAD_DETACH@
+HAVE_PTHREAD_EQUAL = @HAVE_PTHREAD_EQUAL@
+HAVE_PTHREAD_EXIT = @HAVE_PTHREAD_EXIT@
+HAVE_PTHREAD_GETSPECIFIC = @HAVE_PTHREAD_GETSPECIFIC@
+HAVE_PTHREAD_H = @HAVE_PTHREAD_H@
+HAVE_PTHREAD_JOIN = @HAVE_PTHREAD_JOIN@
+HAVE_PTHREAD_KEY_CREATE = @HAVE_PTHREAD_KEY_CREATE@
+HAVE_PTHREAD_KEY_DELETE = @HAVE_PTHREAD_KEY_DELETE@
+HAVE_PTHREAD_MUTEXATTR_DESTROY = @HAVE_PTHREAD_MUTEXATTR_DESTROY@
+HAVE_PTHREAD_MUTEXATTR_GETROBUST = @HAVE_PTHREAD_MUTEXATTR_GETROBUST@
+HAVE_PTHREAD_MUTEXATTR_GETTYPE = @HAVE_PTHREAD_MUTEXATTR_GETTYPE@
+HAVE_PTHREAD_MUTEXATTR_INIT = @HAVE_PTHREAD_MUTEXATTR_INIT@
+HAVE_PTHREAD_MUTEXATTR_SETROBUST = @HAVE_PTHREAD_MUTEXATTR_SETROBUST@
+HAVE_PTHREAD_MUTEXATTR_SETTYPE = @HAVE_PTHREAD_MUTEXATTR_SETTYPE@
+HAVE_PTHREAD_MUTEX_DESTROY = @HAVE_PTHREAD_MUTEX_DESTROY@
+HAVE_PTHREAD_MUTEX_INIT = @HAVE_PTHREAD_MUTEX_INIT@
+HAVE_PTHREAD_MUTEX_LOCK = @HAVE_PTHREAD_MUTEX_LOCK@
+HAVE_PTHREAD_MUTEX_RECURSIVE = @HAVE_PTHREAD_MUTEX_RECURSIVE@
+HAVE_PTHREAD_MUTEX_ROBUST = @HAVE_PTHREAD_MUTEX_ROBUST@
+HAVE_PTHREAD_MUTEX_TIMEDLOCK = @HAVE_PTHREAD_MUTEX_TIMEDLOCK@
+HAVE_PTHREAD_MUTEX_TRYLOCK = @HAVE_PTHREAD_MUTEX_TRYLOCK@
+HAVE_PTHREAD_MUTEX_UNLOCK = @HAVE_PTHREAD_MUTEX_UNLOCK@
+HAVE_PTHREAD_ONCE = @HAVE_PTHREAD_ONCE@
+HAVE_PTHREAD_PROCESS_SHARED = @HAVE_PTHREAD_PROCESS_SHARED@
+HAVE_PTHREAD_RWLOCKATTR_DESTROY = @HAVE_PTHREAD_RWLOCKATTR_DESTROY@
+HAVE_PTHREAD_RWLOCKATTR_INIT = @HAVE_PTHREAD_RWLOCKATTR_INIT@
+HAVE_PTHREAD_RWLOCK_DESTROY = @HAVE_PTHREAD_RWLOCK_DESTROY@
+HAVE_PTHREAD_RWLOCK_INIT = @HAVE_PTHREAD_RWLOCK_INIT@
+HAVE_PTHREAD_RWLOCK_RDLOCK = @HAVE_PTHREAD_RWLOCK_RDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+HAVE_PTHREAD_RWLOCK_TRYRDLOCK = @HAVE_PTHREAD_RWLOCK_TRYRDLOCK@
+HAVE_PTHREAD_RWLOCK_TRYWRLOCK = @HAVE_PTHREAD_RWLOCK_TRYWRLOCK@
+HAVE_PTHREAD_RWLOCK_UNLOCK = @HAVE_PTHREAD_RWLOCK_UNLOCK@
+HAVE_PTHREAD_RWLOCK_WRLOCK = @HAVE_PTHREAD_RWLOCK_WRLOCK@
+HAVE_PTHREAD_SELF = @HAVE_PTHREAD_SELF@
+HAVE_PTHREAD_SETSPECIFIC = @HAVE_PTHREAD_SETSPECIFIC@
 HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
+HAVE_PTHREAD_SPINLOCK_T = @HAVE_PTHREAD_SPINLOCK_T@
+HAVE_PTHREAD_SPIN_DESTROY = @HAVE_PTHREAD_SPIN_DESTROY@
+HAVE_PTHREAD_SPIN_INIT = @HAVE_PTHREAD_SPIN_INIT@
+HAVE_PTHREAD_SPIN_LOCK = @HAVE_PTHREAD_SPIN_LOCK@
+HAVE_PTHREAD_SPIN_TRYLOCK = @HAVE_PTHREAD_SPIN_TRYLOCK@
+HAVE_PTHREAD_SPIN_UNLOCK = @HAVE_PTHREAD_SPIN_UNLOCK@
+HAVE_PTHREAD_T = @HAVE_PTHREAD_T@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
@@ -883,6 +1143,7 @@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READDIR = @HAVE_READDIR@
 HAVE_READLINK = @HAVE_READLINK@
 HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
 HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_REMAINDER = @HAVE_REMAINDER@
 HAVE_REMAINDERF = @HAVE_REMAINDERF@
@@ -892,12 +1153,17 @@ HAVE_RINT = @HAVE_RINT@
 HAVE_RINTL = @HAVE_RINTL@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SCHED_H = @HAVE_SCHED_H@
+HAVE_SCHED_YIELD = @HAVE_SCHED_YIELD@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
 HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
 HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
 HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
@@ -916,15 +1182,21 @@ HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
 HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRPTIME = @HAVE_STRPTIME@
 HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
 HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@
 HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -932,24 +1204,30 @@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@
+HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
 HAVE_TANF = @HAVE_TANF@
 HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
 HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
-HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
 HAVE_USLEEP = @HAVE_USLEEP@
 HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
 HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCPCPY = @HAVE_WCPCPY@
@@ -963,6 +1241,7 @@ HAVE_WCSCOLL = @HAVE_WCSCOLL@
 HAVE_WCSCPY = @HAVE_WCSCPY@
 HAVE_WCSCSPN = @HAVE_WCSCSPN@
 HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
 HAVE_WCSLEN = @HAVE_WCSLEN@
 HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
 HAVE_WCSNCAT = @HAVE_WCSNCAT@
@@ -987,12 +1266,19 @@ HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
 HAVE_WMEMCPY = @HAVE_WMEMCPY@
 HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
 HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
+HOST_CPU = @HOST_CPU@
+HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -1000,34 +1286,55 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
 INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LIBCSTACK = @LIBCSTACK@
+LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM4_LIBDEPS = @LIBM4_LIBDEPS@
 LIBM4_LTLIBDEPS = @LIBM4_LTLIBDEPS@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
-LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBSIGSEGV = @LIBSIGSEGV@
 LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
 LIBTHREAD = @LIBTHREAD@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_GETRANDOM = @LIB_GETRANDOM@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
 LIB_POSIX_SPAWN = @LIB_POSIX_SPAWN@
+LIB_PTHREAD = @LIB_PTHREAD@
+LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SELECT = @LIB_SELECT@
+LIB_SEMAPHORE = @LIB_SEMAPHORE@
+LIB_SETLOCALE = @LIB_SETLOCALE@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
 LIMITS_H = @LIMITS_H@
 LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
 LOCALE_FR = @LOCALE_FR@
 LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
 LOCALE_JA = @LOCALE_JA@
 LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
 LOCALE_ZH_CN = @LOCALE_ZH_CN@
 LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
-LTLIBPTH = @LTLIBPTH@
 LTLIBSIGSEGV = @LTLIBSIGSEGV@
 LTLIBTHREAD = @LTLIBTHREAD@
 M4_LIBOBJS = @M4_LIBOBJS@
@@ -1037,17 +1344,26 @@ M4tests_LTLIBOBJS = @M4tests_LTLIBOBJS@
 M4tests_WITNESS = @M4tests_WITNESS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
 NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@
 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H = @NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H@
 NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@
 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
 NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@
@@ -1057,9 +1373,14 @@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
 NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
@@ -1071,11 +1392,14 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FCNTL_H = @NEXT_FCNTL_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
 NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_PTHREAD_H = @NEXT_PTHREAD_H@
 NEXT_SCHED_H = @NEXT_SCHED_H@
 NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_SPAWN_H = @NEXT_SPAWN_H@
@@ -1085,9 +1409,14 @@ NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@
+NEXT_SYS_RANDOM_H = @NEXT_SYS_RANDOM_H@
+NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
 NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
 NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -1103,14 +1432,16 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
 PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
 PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PRIPTR_PREFIX = @PRIPTR_PREFIX@
-PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
 PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
+REPLACE_ACCESS = @REPLACE_ACCESS@
 REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
 REPLACE_ASINF = @REPLACE_ASINF@
 REPLACE_ATAN2F = @REPLACE_ATAN2F@
 REPLACE_ATANF = @REPLACE_ATANF@
@@ -1127,23 +1458,37 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
 REPLACE_COSF = @REPLACE_COSF@
 REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
 REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
 REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
 REPLACE_EXP2 = @REPLACE_EXP2@
 REPLACE_EXP2L = @REPLACE_EXP2L@
 REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
 REPLACE_EXPM1 = @REPLACE_EXPM1@
 REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
 REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
 REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
 REPLACE_FLOOR = @REPLACE_FLOOR@
 REPLACE_FLOORF = @REPLACE_FLOORF@
 REPLACE_FLOORL = @REPLACE_FLOORL@
@@ -1156,6 +1501,8 @@ REPLACE_FMODL = @REPLACE_FMODL@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FREXP = @REPLACE_FREXP@
 REPLACE_FREXPF = @REPLACE_FREXPF@
@@ -1176,20 +1523,32 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
 REPLACE_HYPOT = @REPLACE_HYPOT@
 REPLACE_HYPOTF = @REPLACE_HYPOTF@
 REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
 REPLACE_ILOGB = @REPLACE_ILOGB@
 REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_IOCTL = @REPLACE_IOCTL@
 REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISFINITE = @REPLACE_ISFINITE@
 REPLACE_ISINF = @REPLACE_ISINF@
 REPLACE_ISNAN = @REPLACE_ISNAN@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
 REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LDEXPL = @REPLACE_LDEXPL@
@@ -1227,7 +1586,9 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@
 REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
 REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
 REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
 REPLACE_MKTIME = @REPLACE_MKTIME@
 REPLACE_MODF = @REPLACE_MODF@
@@ -1235,6 +1596,7 @@ REPLACE_MODFF = @REPLACE_MODFF@
 REPLACE_MODFL = @REPLACE_MODFL@
 REPLACE_NAN = @REPLACE_NAN@
 REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
 REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
 REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
@@ -1243,24 +1605,81 @@ REPLACE_OPENAT = @REPLACE_OPENAT@
 REPLACE_OPENDIR = @REPLACE_OPENDIR@
 REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
 REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PSELECT = @REPLACE_PSELECT@
+REPLACE_PTHREAD_ATTR_DESTROY = @REPLACE_PTHREAD_ATTR_DESTROY@
+REPLACE_PTHREAD_ATTR_GETDETACHSTATE = @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@
+REPLACE_PTHREAD_ATTR_INIT = @REPLACE_PTHREAD_ATTR_INIT@
+REPLACE_PTHREAD_ATTR_SETDETACHSTATE = @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@
+REPLACE_PTHREAD_CONDATTR_DESTROY = @REPLACE_PTHREAD_CONDATTR_DESTROY@
+REPLACE_PTHREAD_CONDATTR_INIT = @REPLACE_PTHREAD_CONDATTR_INIT@
+REPLACE_PTHREAD_COND_BROADCAST = @REPLACE_PTHREAD_COND_BROADCAST@
+REPLACE_PTHREAD_COND_DESTROY = @REPLACE_PTHREAD_COND_DESTROY@
+REPLACE_PTHREAD_COND_INIT = @REPLACE_PTHREAD_COND_INIT@
+REPLACE_PTHREAD_COND_SIGNAL = @REPLACE_PTHREAD_COND_SIGNAL@
+REPLACE_PTHREAD_COND_TIMEDWAIT = @REPLACE_PTHREAD_COND_TIMEDWAIT@
+REPLACE_PTHREAD_COND_WAIT = @REPLACE_PTHREAD_COND_WAIT@
+REPLACE_PTHREAD_CREATE = @REPLACE_PTHREAD_CREATE@
+REPLACE_PTHREAD_DETACH = @REPLACE_PTHREAD_DETACH@
+REPLACE_PTHREAD_EQUAL = @REPLACE_PTHREAD_EQUAL@
+REPLACE_PTHREAD_EXIT = @REPLACE_PTHREAD_EXIT@
+REPLACE_PTHREAD_GETSPECIFIC = @REPLACE_PTHREAD_GETSPECIFIC@
+REPLACE_PTHREAD_JOIN = @REPLACE_PTHREAD_JOIN@
+REPLACE_PTHREAD_KEY_CREATE = @REPLACE_PTHREAD_KEY_CREATE@
+REPLACE_PTHREAD_KEY_DELETE = @REPLACE_PTHREAD_KEY_DELETE@
+REPLACE_PTHREAD_MUTEXATTR_DESTROY = @REPLACE_PTHREAD_MUTEXATTR_DESTROY@
+REPLACE_PTHREAD_MUTEXATTR_GETROBUST = @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_GETTYPE = @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@
+REPLACE_PTHREAD_MUTEXATTR_INIT = @REPLACE_PTHREAD_MUTEXATTR_INIT@
+REPLACE_PTHREAD_MUTEXATTR_SETROBUST = @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_SETTYPE = @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@
+REPLACE_PTHREAD_MUTEX_DESTROY = @REPLACE_PTHREAD_MUTEX_DESTROY@
+REPLACE_PTHREAD_MUTEX_INIT = @REPLACE_PTHREAD_MUTEX_INIT@
+REPLACE_PTHREAD_MUTEX_LOCK = @REPLACE_PTHREAD_MUTEX_LOCK@
+REPLACE_PTHREAD_MUTEX_TIMEDLOCK = @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@
+REPLACE_PTHREAD_MUTEX_TRYLOCK = @REPLACE_PTHREAD_MUTEX_TRYLOCK@
+REPLACE_PTHREAD_MUTEX_UNLOCK = @REPLACE_PTHREAD_MUTEX_UNLOCK@
+REPLACE_PTHREAD_ONCE = @REPLACE_PTHREAD_ONCE@
+REPLACE_PTHREAD_RWLOCKATTR_DESTROY = @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@
+REPLACE_PTHREAD_RWLOCKATTR_INIT = @REPLACE_PTHREAD_RWLOCKATTR_INIT@
+REPLACE_PTHREAD_RWLOCK_DESTROY = @REPLACE_PTHREAD_RWLOCK_DESTROY@
+REPLACE_PTHREAD_RWLOCK_INIT = @REPLACE_PTHREAD_RWLOCK_INIT@
+REPLACE_PTHREAD_RWLOCK_RDLOCK = @REPLACE_PTHREAD_RWLOCK_RDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYRDLOCK = @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYWRLOCK = @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@
+REPLACE_PTHREAD_RWLOCK_UNLOCK = @REPLACE_PTHREAD_RWLOCK_UNLOCK@
+REPLACE_PTHREAD_RWLOCK_WRLOCK = @REPLACE_PTHREAD_RWLOCK_WRLOCK@
+REPLACE_PTHREAD_SELF = @REPLACE_PTHREAD_SELF@
+REPLACE_PTHREAD_SETSPECIFIC = @REPLACE_PTHREAD_SETSPECIFIC@
 REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
+REPLACE_PTHREAD_SPIN_DESTROY = @REPLACE_PTHREAD_SPIN_DESTROY@
+REPLACE_PTHREAD_SPIN_INIT = @REPLACE_PTHREAD_SPIN_INIT@
+REPLACE_PTHREAD_SPIN_LOCK = @REPLACE_PTHREAD_SPIN_LOCK@
+REPLACE_PTHREAD_SPIN_TRYLOCK = @REPLACE_PTHREAD_SPIN_TRYLOCK@
+REPLACE_PTHREAD_SPIN_UNLOCK = @REPLACE_PTHREAD_SPIN_UNLOCK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
 REPLACE_RAISE = @REPLACE_RAISE@
+REPLACE_RANDOM = @REPLACE_RANDOM@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_READLINKAT = @REPLACE_READLINKAT@
 REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
 REPLACE_REALPATH = @REPLACE_REALPATH@
 REPLACE_REMAINDER = @REPLACE_REMAINDER@
 REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
@@ -1268,14 +1687,18 @@ REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
 REPLACE_REMOVE = @REPLACE_REMOVE@
 REPLACE_RENAME = @REPLACE_RENAME@
 REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
 REPLACE_RMDIR = @REPLACE_RMDIR@
 REPLACE_ROUND = @REPLACE_ROUND@
 REPLACE_ROUNDF = @REPLACE_ROUNDF@
 REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SCHED_YIELD = @REPLACE_SCHED_YIELD@
+REPLACE_SELECT = @REPLACE_SELECT@
 REPLACE_SETENV = @REPLACE_SETENV@
 REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
 REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
-REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
 REPLACE_SINF = @REPLACE_SINF@
 REPLACE_SINHF = @REPLACE_SINHF@
 REPLACE_SLEEP = @REPLACE_SLEEP@
@@ -1291,7 +1714,9 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
 REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
 REPLACE_STRNCAT = @REPLACE_STRNCAT@
 REPLACE_STRNDUP = @REPLACE_STRNDUP@
 REPLACE_STRNLEN = @REPLACE_STRNLEN@
@@ -1300,6 +1725,11 @@ REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
 REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
 REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
 REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
 REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
@@ -1311,9 +1741,11 @@ REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
 REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
 REPLACE_TRUNCF = @REPLACE_TRUNCF@
 REPLACE_TRUNCL = @REPLACE_TRUNCL@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
 REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -1326,17 +1758,19 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
 REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
 REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCTOMB = @REPLACE_WCTOMB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 REPLACE_WRITE = @REPLACE_WRITE@
-SCHED_H = @SCHED_H@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIGSEGV_H = @SIGSEGV_H@
 SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
 SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 STDALIGN_H = @STDALIGN_H@
@@ -1345,27 +1779,37 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
 UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
 UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
 WERROR_CFLAGS = @WERROR_CFLAGS@
 WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
 WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+YIELD_LIB = @YIELD_LIB@
 abs_aux_dir = @abs_aux_dir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 am__include = @am__include@
@@ -1483,8 +1927,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -1502,7 +1946,10 @@ ctags CTAGS:
 cscope cscopelist:
 
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
index fac929b..c406c81 100644 (file)
@@ -1,6 +1,7 @@
 ## Makefile.am - template for generating Makefile via Automake
 ##
-## Copyright (C) 2009-2014, 2016 Free Software Foundation, Inc.
+## Copyright (C) 2009-2014, 2016-2017, 2020-2021 Free Software
+## Foundation, Inc.
 ##
 ## This file is part of GNU M4.
 ##
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 BUILT_SOURCES =
 CLEANFILES =
 EXTRA_DIST =
+MAINTAINERCLEANFILES =
 MOSTLYCLEANDIRS =
 MOSTLYCLEANFILES =
 SUFFIXES =
index 1cbc39f..392435e 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,7 @@
 
 @SET_MAKE@
 
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+# along with this file.  If not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License,
 # this file may be distributed as part of a program that
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --local-dir=gl --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --with-c++-tests --avoid=lock-tests --avoid=tls-tests --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname do-release-commit-and-tag error execute fclose fdl-1.3 fflush filenamecat fopen fopen-safer fseeko gendocs getopt-gnu git-version-gen gitlog-to-changelog gnu-web-doc-update gnumakefile gnupload gpl-3.0 ignore-value intprops maintainer-makefile manywarnings memchr2 mkstemp obstack progname regex rename sigaction sigpipe spawn-pipe stdbool stdint stdlib-safer strsignal strstr strtod unlocked-io update-copyright vc-list-files verror version-etc version-etc-fsf wait-process xalloc xoset xprintf xvasprintf-posix
+# Reproduce by:
+# gnulib-tool --import --local-dir=gl \
+#  --lib=libm4 \
+#  --source-base=lib \
+#  --m4-base=m4 \
+#  --doc-base=doc \
+#  --tests-base=tests \
+#  --aux-dir=build-aux \
+#  --with-tests \
+#  --with-c++-tests \
+#  --makefile-name=gnulib.mk \
+#  --no-conditional-dependencies \
+#  --no-libtool \
+#  --macro-prefix=M4 \
+#  --avoid=getopt-posix-tests \
+#  --avoid=lock-tests \
+#  --avoid=tls-tests \
+#  announce-gen \
+#  assert \
+#  attribute \
+#  autobuild \
+#  avltree-oset \
+#  binary-io \
+#  c-ctype \
+#  c-stack \
+#  clean-temp \
+#  close-stream \
+#  closein \
+#  config-h \
+#  configmake \
+#  dirname \
+#  do-release-commit-and-tag \
+#  error \
+#  execute \
+#  fclose \
+#  fdl-1.3 \
+#  fflush \
+#  filenamecat \
+#  fopen-gnu \
+#  fopen-safer \
+#  fseeko \
+#  gendocs \
+#  getopt-gnu \
+#  gettext-h \
+#  git-version-gen \
+#  gitlog-to-changelog \
+#  gnu-web-doc-update \
+#  gnumakefile \
+#  gnupload \
+#  gpl-3.0 \
+#  ignore-value \
+#  intprops \
+#  maintainer-makefile \
+#  manywarnings \
+#  memchr2 \
+#  mkstemp \
+#  obstack \
+#  progname \
+#  propername \
+#  regex \
+#  rename \
+#  setlocale \
+#  sigaction \
+#  sigpipe \
+#  spawn-pipe \
+#  stdbool \
+#  stdint \
+#  stdlib-safer \
+#  strsignal \
+#  strstr \
+#  strtod \
+#  unlocked-io \
+#  update-copyright \
+#  vc-list-files \
+#  verify \
+#  verror \
+#  version-etc \
+#  version-etc-fsf \
+#  wait-process \
+#  xalloc \
+#  xoset \
+#  xprintf \
+#  xvasprintf-posix
 
 VPATH = @srcdir@
 am__is_gnu_make = { \
@@ -110,57 +192,76 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
+@GL_GENERATE_SIGSEGV_H_TRUE@am__append_1 = sigsegv.c stackvma.c
+@LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE@am__append_2 = unistr/u8-mbtoucr.c
+@LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@am__append_3 = unistr/u8-uctomb.c unistr/u8-uctomb-aux.c
+@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__append_4 = uniwidth/width.c
 subdir = lib
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
-       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
-       $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/__inline.m4 \
+       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/access.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/arpa_inet_h.m4 \
        $(top_srcdir)/m4/asm-underscore.m4 $(top_srcdir)/m4/assert.m4 \
        $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \
        $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \
-       $(top_srcdir)/m4/canonicalize.m4 \
-       $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
-       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
-       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
-       $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
-       $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirent_h.m4 \
-       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/canonicalize.m4 \
+       $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/clock_time.m4 \
+       $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closedir.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \
+       $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/creat.m4 \
+       $(top_srcdir)/m4/ctype_h.m4 $(top_srcdir)/m4/d-ino.m4 \
+       $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
        $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
-       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
-       $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \
-       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/execute.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eaccess.m4 \
+       $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+       $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+       $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/explicit_bzero.m4 \
        $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \
        $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \
        $(top_srcdir)/m4/extern-inline.m4 \
-       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fclose.m4 \
-       $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl.m4 \
-       $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopen.m4 \
+       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fchdir.m4 \
+       $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+       $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+       $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/fdopendir.m4 \
        $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/findprog-in.m4 $(top_srcdir)/m4/findprog.m4 \
        $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
        $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \
        $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fpurge.m4 \
        $(top_srcdir)/m4/freadahead.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/freopen.m4 \
        $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
        $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
-       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
-       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \
+       $(top_srcdir)/m4/ftell.m4 $(top_srcdir)/m4/ftello.m4 \
+       $(top_srcdir)/m4/ftruncate.m4 \
+       $(top_srcdir)/m4/getcwd-abort-bug.m4 \
+       $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
        $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
        $(top_srcdir)/m4/getpagesize.m4 \
-       $(top_srcdir)/m4/getprogname.m4 \
-       $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
+       $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/getrandom.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
        $(top_srcdir)/m4/gnulib-common.m4 \
        $(top_srcdir)/m4/gnulib-comp.m4 \
-       $(top_srcdir)/m4/hard-locale.m4 \
-       $(top_srcdir)/m4/include_next.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+       $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+       $(top_srcdir)/m4/inline.m4 \
+       $(top_srcdir)/m4/intl-thread-locale.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \
-       $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
-       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isblank.m4 \
-       $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
-       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/langinfo_h.m4 \
+       $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes.m4 \
+       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+       $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/isnand.m4 \
+       $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
+       $(top_srcdir)/m4/iswblank.m4 $(top_srcdir)/m4/iswdigit.m4 \
+       $(top_srcdir)/m4/iswxdigit.m4 $(top_srcdir)/m4/langinfo_h.m4 \
        $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lcmessage.m4 \
        $(top_srcdir)/m4/ldexp.m4 $(top_srcdir)/m4/ldexpl.m4 \
        $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
        $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+       $(top_srcdir)/m4/libunistring-base.m4 \
        $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/link.m4 \
        $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
        $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
@@ -170,61 +271,93 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
        $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
        $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \
+       $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
        $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
-       $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
-       $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/minmax.m4 \
+       $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+       $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
+       $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
+       $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkdir.m4 \
        $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \
        $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
        $(top_srcdir)/m4/msvc-inval.m4 \
        $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
-       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nocrash.m4 \
-       $(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/off_t.m4 \
-       $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/opendir.m4 \
-       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/pipe2.m4 \
-       $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/musl.m4 $(top_srcdir)/m4/nanosleep.m4 \
+       $(top_srcdir)/m4/netinet_in_h.m4 \
+       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/obstack.m4 \
+       $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/open-cloexec.m4 \
+       $(top_srcdir)/m4/open-slash.m4 $(top_srcdir)/m4/open.m4 \
+       $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/opendir.m4 \
+       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perror.m4 \
+       $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/pipe2.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/posix_spawn_faction_addchdir.m4 \
        $(top_srcdir)/m4/printf-frexp.m4 \
        $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \
-       $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quotearg.m4 \
-       $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+       $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/pthread-thread.m4 \
+       $(top_srcdir)/m4/pthread_h.m4 \
+       $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
+       $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \
+       $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/raise.m4 \
+       $(top_srcdir)/m4/rawmemchr.m4 $(top_srcdir)/m4/read-file.m4 \
        $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/readlink.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/reallocarray.m4 \
        $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
-       $(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/sched_h.m4 \
-       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/setenv.m4 \
-       $(top_srcdir)/m4/setlocale.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \
-       $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/rewinddir.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/sched_h.m4 \
+       $(top_srcdir)/m4/sched_yield.m4 \
+       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+       $(top_srcdir)/m4/semaphore.m4 $(top_srcdir)/m4/setenv.m4 \
+       $(top_srcdir)/m4/setlocale.m4 \
+       $(top_srcdir)/m4/setlocale_null.m4 \
+       $(top_srcdir)/m4/sh-filename.m4 \
+       $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/sigaltstack.m4 $(top_srcdir)/m4/signal_h.m4 \
        $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \
        $(top_srcdir)/m4/sigpipe.m4 $(top_srcdir)/m4/size_max.m4 \
        $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/snprintf.m4 \
-       $(top_srcdir)/m4/spawn-pipe.m4 $(top_srcdir)/m4/spawn_h.m4 \
-       $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \
+       $(top_srcdir)/m4/socketlib.m4 $(top_srcdir)/m4/sockets.m4 \
+       $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \
+       $(top_srcdir)/m4/sparcv8+.m4 $(top_srcdir)/m4/spawn-pipe.m4 \
+       $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/ssize_t.m4 \
+       $(top_srcdir)/m4/stack-direction.m4 \
+       $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
        $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
        $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
        $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
        $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
-       $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \
-       $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \
+       $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
        $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
        $(top_srcdir)/m4/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \
        $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/symlink.m4 \
+       $(top_srcdir)/m4/sys_ioctl_h.m4 \
+       $(top_srcdir)/m4/sys_random_h.m4 \
+       $(top_srcdir)/m4/sys_select_h.m4 \
        $(top_srcdir)/m4/sys_socket_h.m4 \
        $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
-       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \
-       $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+       $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+       $(top_srcdir)/m4/thread.m4 $(top_srcdir)/m4/threadlib.m4 \
        $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/tls.m4 \
        $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/ungetc.m4 \
        $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
        $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \
        $(top_srcdir)/m4/vasprintf-posix.m4 \
        $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+       $(top_srcdir)/m4/visibility.m4 \
        $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \
        $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/m4/wchar_h.m4 \
        $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wcrtomb.m4 \
        $(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
-       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
-       $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \
-       $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \
-       $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \
+       $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \
+       $(top_srcdir)/m4/yield.m4 $(top_srcdir)/m4/zzgnulib.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
@@ -239,32 +372,101 @@ am__v_AR_0 = @echo "  AR      " $@;
 am__v_AR_1 = 
 libm4_a_AR = $(AR) $(ARFLAGS)
 am__DEPENDENCIES_1 =
+am__libm4_a_SOURCES_DIST = asyncsafe-spin.c openat-priv.h \
+       openat-proc.c gl_avltree_oset.h gl_avltree_oset.c \
+       gl_avltree_ordered.h gl_anytree_oset.h basename-lgpl.c \
+       binary-io.h binary-io.c bitrotate.h bitrotate.c c-ctype.h \
+       c-ctype.c c-stack.h c-stack.c c-strcase.h c-strcasecmp.c \
+       c-strncasecmp.c canonicalize.c clean-temp.h clean-temp.c \
+       clean-temp-simple.h clean-temp-simple.c cloexec.c \
+       close-stream.c closein.c closeout.c concat-filename.c \
+       dirname.c basename.c dirname-lgpl.c stripslash.c \
+       malloc/dynarray_at_failure.c malloc/dynarray_emplace_enlarge.c \
+       malloc/dynarray_finalize.c malloc/dynarray_resize.c \
+       malloc/dynarray_resize_clear.c execute.h execute.c exitfail.c \
+       fatal-signal.h fatal-signal.c fd-hook.c fd-safer-flag.c \
+       dup-safer-flag.c file-set.c filenamecat.c filenamecat-lgpl.c \
+       findprog.h findprog-in.c fopen-safer.c freading.c \
+       getprogname.h getprogname.c gettext.h hard-locale.c hash.c \
+       hash-pjw.h hash-pjw.c hash-triple-simple.c idx.h \
+       gl_linked_list.h gl_linked_list.c gl_anylinked_list1.h \
+       gl_anylinked_list2.h gl_linkedhash_list.h gl_linkedhash_list.c \
+       gl_anyhash1.h gl_anyhash2.h gl_anyhash_primes.h gl_list.h \
+       gl_list.c localcharset.c localename.c localename-table.c \
+       glthread/lock.h glthread/lock.c malloca.c math.c mbchar.c \
+       mbiter.h mbiter.c mbslen.c mbsstr.c mbuiter.h mbuiter.c \
+       memchr2.h memchr2.c minmax.h openat-die.c gl_oset.h gl_oset.c \
+       pipe2.c pipe2-safer.c printf-frexp.c printf-frexpl.c \
+       progname.h progname.c propername.h propername.c quotearg.c \
+       save-cwd.c malloc/scratch_buffer_dupfree.c \
+       malloc/scratch_buffer_grow.c \
+       malloc/scratch_buffer_grow_preserve.c \
+       malloc/scratch_buffer_set_array_size.c setlocale_null.c \
+       sig-handler.c sigsegv.c stackvma.c size_max.h spawn-pipe.h \
+       spawn-pipe.c stat-time.c mkstemp-safer.c striconv.h striconv.c \
+       strnlen1.h strnlen1.c tempname.c glthread/threadlib.c \
+       glthread/tls.h glthread/tls.c tmpdir.h tmpdir.c trim.c \
+       unistd.c dup-safer.c fd-safer.c pipe-safer.c \
+       unistr/u8-mbtoucr.c unistr/u8-uctomb.c unistr/u8-uctomb-aux.c \
+       uniwidth/width.c verror.h verror.c version-etc.h version-etc.c \
+       version-etc-fsf.c wait-process.h wait-process.c wctype-h.c \
+       xmalloc.c xalloc-die.c gl_xlist.h gl_xlist.c xmalloca.c \
+       gl_xoset.h gl_xoset.c xprintf.h xprintf.c xsize.h xsize.c \
+       xstriconv.h xstriconv.c xstrndup.h xstrndup.c xvasprintf.h \
+       xvasprintf.c xasprintf.c
 am__dirstamp = $(am__leading_dot)dirstamp
-am_libm4_a_OBJECTS = gl_avltree_oset.$(OBJEXT) binary-io.$(OBJEXT) \
-       c-ctype.$(OBJEXT) c-stack.$(OBJEXT) c-strcasecmp.$(OBJEXT) \
-       c-strncasecmp.$(OBJEXT) clean-temp.$(OBJEXT) cloexec.$(OBJEXT) \
-       close-stream.$(OBJEXT) closein.$(OBJEXT) closeout.$(OBJEXT) \
-       dirname.$(OBJEXT) basename.$(OBJEXT) dirname-lgpl.$(OBJEXT) \
-       basename-lgpl.$(OBJEXT) stripslash.$(OBJEXT) execute.$(OBJEXT) \
+@GL_GENERATE_SIGSEGV_H_TRUE@am__objects_1 = sigsegv.$(OBJEXT) \
+@GL_GENERATE_SIGSEGV_H_TRUE@   stackvma.$(OBJEXT)
+@LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR_TRUE@am__objects_2 = unistr/u8-mbtoucr.$(OBJEXT)
+@LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@am__objects_3 = unistr/u8-uctomb.$(OBJEXT) \
+@LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB_TRUE@   unistr/u8-uctomb-aux.$(OBJEXT)
+@LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH_TRUE@am__objects_4 = uniwidth/width.$(OBJEXT)
+am_libm4_a_OBJECTS = asyncsafe-spin.$(OBJEXT) openat-proc.$(OBJEXT) \
+       gl_avltree_oset.$(OBJEXT) basename-lgpl.$(OBJEXT) \
+       binary-io.$(OBJEXT) bitrotate.$(OBJEXT) c-ctype.$(OBJEXT) \
+       c-stack.$(OBJEXT) c-strcasecmp.$(OBJEXT) \
+       c-strncasecmp.$(OBJEXT) canonicalize.$(OBJEXT) \
+       clean-temp.$(OBJEXT) clean-temp-simple.$(OBJEXT) \
+       cloexec.$(OBJEXT) close-stream.$(OBJEXT) closein.$(OBJEXT) \
+       closeout.$(OBJEXT) concat-filename.$(OBJEXT) dirname.$(OBJEXT) \
+       basename.$(OBJEXT) dirname-lgpl.$(OBJEXT) stripslash.$(OBJEXT) \
+       malloc/dynarray_at_failure.$(OBJEXT) \
+       malloc/dynarray_emplace_enlarge.$(OBJEXT) \
+       malloc/dynarray_finalize.$(OBJEXT) \
+       malloc/dynarray_resize.$(OBJEXT) \
+       malloc/dynarray_resize_clear.$(OBJEXT) execute.$(OBJEXT) \
        exitfail.$(OBJEXT) fatal-signal.$(OBJEXT) fd-hook.$(OBJEXT) \
        fd-safer-flag.$(OBJEXT) dup-safer-flag.$(OBJEXT) \
-       filenamecat.$(OBJEXT) filenamecat-lgpl.$(OBJEXT) \
+       file-set.$(OBJEXT) filenamecat.$(OBJEXT) \
+       filenamecat-lgpl.$(OBJEXT) findprog-in.$(OBJEXT) \
        fopen-safer.$(OBJEXT) freading.$(OBJEXT) getprogname.$(OBJEXT) \
-       hard-locale.$(OBJEXT) gl_linkedhash_list.$(OBJEXT) \
-       gl_list.$(OBJEXT) localcharset.$(OBJEXT) \
-       glthread/lock.$(OBJEXT) malloca.$(OBJEXT) math.$(OBJEXT) \
-       memchr2.$(OBJEXT) gl_oset.$(OBJEXT) pipe2.$(OBJEXT) \
-       pipe2-safer.$(OBJEXT) printf-frexp.$(OBJEXT) \
-       printf-frexpl.$(OBJEXT) progname.$(OBJEXT) quotearg.$(OBJEXT) \
-       sig-handler.$(OBJEXT) spawn-pipe.$(OBJEXT) \
-       mkstemp-safer.$(OBJEXT) tempname.$(OBJEXT) \
-       glthread/threadlib.$(OBJEXT) glthread/tls.$(OBJEXT) \
-       tmpdir.$(OBJEXT) unistd.$(OBJEXT) dup-safer.$(OBJEXT) \
-       fd-safer.$(OBJEXT) pipe-safer.$(OBJEXT) verror.$(OBJEXT) \
-       version-etc.$(OBJEXT) version-etc-fsf.$(OBJEXT) \
-       wait-process.$(OBJEXT) wctype-h.$(OBJEXT) xmalloc.$(OBJEXT) \
-       xalloc-die.$(OBJEXT) gl_xlist.$(OBJEXT) xmalloca.$(OBJEXT) \
-       gl_xoset.$(OBJEXT) xprintf.$(OBJEXT) xsize.$(OBJEXT) \
+       hard-locale.$(OBJEXT) hash.$(OBJEXT) hash-pjw.$(OBJEXT) \
+       hash-triple-simple.$(OBJEXT) gl_linked_list.$(OBJEXT) \
+       gl_linkedhash_list.$(OBJEXT) gl_list.$(OBJEXT) \
+       localcharset.$(OBJEXT) localename.$(OBJEXT) \
+       localename-table.$(OBJEXT) glthread/lock.$(OBJEXT) \
+       malloca.$(OBJEXT) math.$(OBJEXT) mbchar.$(OBJEXT) \
+       mbiter.$(OBJEXT) mbslen.$(OBJEXT) mbsstr.$(OBJEXT) \
+       mbuiter.$(OBJEXT) memchr2.$(OBJEXT) openat-die.$(OBJEXT) \
+       gl_oset.$(OBJEXT) pipe2.$(OBJEXT) pipe2-safer.$(OBJEXT) \
+       printf-frexp.$(OBJEXT) printf-frexpl.$(OBJEXT) \
+       progname.$(OBJEXT) propername.$(OBJEXT) quotearg.$(OBJEXT) \
+       save-cwd.$(OBJEXT) malloc/scratch_buffer_dupfree.$(OBJEXT) \
+       malloc/scratch_buffer_grow.$(OBJEXT) \
+       malloc/scratch_buffer_grow_preserve.$(OBJEXT) \
+       malloc/scratch_buffer_set_array_size.$(OBJEXT) \
+       setlocale_null.$(OBJEXT) sig-handler.$(OBJEXT) \
+       $(am__objects_1) spawn-pipe.$(OBJEXT) stat-time.$(OBJEXT) \
+       mkstemp-safer.$(OBJEXT) striconv.$(OBJEXT) strnlen1.$(OBJEXT) \
+       tempname.$(OBJEXT) glthread/threadlib.$(OBJEXT) \
+       glthread/tls.$(OBJEXT) tmpdir.$(OBJEXT) trim.$(OBJEXT) \
+       unistd.$(OBJEXT) dup-safer.$(OBJEXT) fd-safer.$(OBJEXT) \
+       pipe-safer.$(OBJEXT) $(am__objects_2) $(am__objects_3) \
+       $(am__objects_4) verror.$(OBJEXT) version-etc.$(OBJEXT) \
+       version-etc-fsf.$(OBJEXT) wait-process.$(OBJEXT) \
+       wctype-h.$(OBJEXT) xmalloc.$(OBJEXT) xalloc-die.$(OBJEXT) \
+       gl_xlist.$(OBJEXT) xmalloca.$(OBJEXT) gl_xoset.$(OBJEXT) \
+       xprintf.$(OBJEXT) xsize.$(OBJEXT) xstriconv.$(OBJEXT) \
        xstrndup.$(OBJEXT) xvasprintf.$(OBJEXT) xasprintf.$(OBJEXT)
 libm4_a_OBJECTS = $(am_libm4_a_OBJECTS)
 AM_V_P = $(am__v_P_@AM_V@)
@@ -281,7 +483,141 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@
 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/access.Po ./$(DEPDIR)/asnprintf.Po \
+       ./$(DEPDIR)/asprintf.Po ./$(DEPDIR)/asyncsafe-spin.Po \
+       ./$(DEPDIR)/at-func.Po ./$(DEPDIR)/basename-lgpl.Po \
+       ./$(DEPDIR)/basename.Po ./$(DEPDIR)/binary-io.Po \
+       ./$(DEPDIR)/bitrotate.Po ./$(DEPDIR)/btowc.Po \
+       ./$(DEPDIR)/c-ctype.Po ./$(DEPDIR)/c-stack.Po \
+       ./$(DEPDIR)/c-strcasecmp.Po ./$(DEPDIR)/c-strncasecmp.Po \
+       ./$(DEPDIR)/calloc.Po ./$(DEPDIR)/canonicalize-lgpl.Po \
+       ./$(DEPDIR)/canonicalize.Po ./$(DEPDIR)/chdir-long.Po \
+       ./$(DEPDIR)/clean-temp-simple.Po ./$(DEPDIR)/clean-temp.Po \
+       ./$(DEPDIR)/cloexec.Po ./$(DEPDIR)/close-stream.Po \
+       ./$(DEPDIR)/close.Po ./$(DEPDIR)/closedir.Po \
+       ./$(DEPDIR)/closein.Po ./$(DEPDIR)/closeout.Po \
+       ./$(DEPDIR)/concat-filename.Po ./$(DEPDIR)/dirfd.Po \
+       ./$(DEPDIR)/dirname-lgpl.Po ./$(DEPDIR)/dirname.Po \
+       ./$(DEPDIR)/dup-safer-flag.Po ./$(DEPDIR)/dup-safer.Po \
+       ./$(DEPDIR)/dup.Po ./$(DEPDIR)/dup2.Po ./$(DEPDIR)/error.Po \
+       ./$(DEPDIR)/execute.Po ./$(DEPDIR)/exitfail.Po \
+       ./$(DEPDIR)/fatal-signal.Po ./$(DEPDIR)/fchdir.Po \
+       ./$(DEPDIR)/fclose.Po ./$(DEPDIR)/fcntl.Po \
+       ./$(DEPDIR)/fd-hook.Po ./$(DEPDIR)/fd-safer-flag.Po \
+       ./$(DEPDIR)/fd-safer.Po ./$(DEPDIR)/fdopendir.Po \
+       ./$(DEPDIR)/fflush.Po ./$(DEPDIR)/file-set.Po \
+       ./$(DEPDIR)/filenamecat-lgpl.Po ./$(DEPDIR)/filenamecat.Po \
+       ./$(DEPDIR)/findprog-in.Po ./$(DEPDIR)/float.Po \
+       ./$(DEPDIR)/fopen-safer.Po ./$(DEPDIR)/fopen.Po \
+       ./$(DEPDIR)/fpending.Po ./$(DEPDIR)/fpurge.Po \
+       ./$(DEPDIR)/freadahead.Po ./$(DEPDIR)/freading.Po \
+       ./$(DEPDIR)/free.Po ./$(DEPDIR)/frexp.Po ./$(DEPDIR)/frexpl.Po \
+       ./$(DEPDIR)/fseek.Po ./$(DEPDIR)/fseeko.Po \
+       ./$(DEPDIR)/fstat.Po ./$(DEPDIR)/fstatat.Po \
+       ./$(DEPDIR)/ftell.Po ./$(DEPDIR)/ftello.Po \
+       ./$(DEPDIR)/getcwd-lgpl.Po ./$(DEPDIR)/getcwd.Po \
+       ./$(DEPDIR)/getdtablesize.Po ./$(DEPDIR)/getopt.Po \
+       ./$(DEPDIR)/getopt1.Po ./$(DEPDIR)/getpagesize.Po \
+       ./$(DEPDIR)/getprogname.Po ./$(DEPDIR)/getrandom.Po \
+       ./$(DEPDIR)/gl_avltree_oset.Po ./$(DEPDIR)/gl_linked_list.Po \
+       ./$(DEPDIR)/gl_linkedhash_list.Po ./$(DEPDIR)/gl_list.Po \
+       ./$(DEPDIR)/gl_oset.Po ./$(DEPDIR)/gl_xlist.Po \
+       ./$(DEPDIR)/gl_xoset.Po ./$(DEPDIR)/hard-locale.Po \
+       ./$(DEPDIR)/hash-pjw.Po ./$(DEPDIR)/hash-triple-simple.Po \
+       ./$(DEPDIR)/hash.Po ./$(DEPDIR)/iconv.Po \
+       ./$(DEPDIR)/iconv_close.Po ./$(DEPDIR)/iconv_open.Po \
+       ./$(DEPDIR)/isnan.Po ./$(DEPDIR)/isnand.Po \
+       ./$(DEPDIR)/isnanf.Po ./$(DEPDIR)/isnanl.Po \
+       ./$(DEPDIR)/iswblank.Po ./$(DEPDIR)/iswdigit.Po \
+       ./$(DEPDIR)/iswxdigit.Po ./$(DEPDIR)/itold.Po \
+       ./$(DEPDIR)/lc-charset-dispatch.Po ./$(DEPDIR)/localcharset.Po \
+       ./$(DEPDIR)/localeconv.Po ./$(DEPDIR)/localename-table.Po \
+       ./$(DEPDIR)/localename.Po ./$(DEPDIR)/lseek.Po \
+       ./$(DEPDIR)/lstat.Po ./$(DEPDIR)/malloc.Po \
+       ./$(DEPDIR)/malloca.Po ./$(DEPDIR)/math.Po \
+       ./$(DEPDIR)/mbchar.Po ./$(DEPDIR)/mbiter.Po \
+       ./$(DEPDIR)/mbrtowc.Po ./$(DEPDIR)/mbsinit.Po \
+       ./$(DEPDIR)/mbslen.Po ./$(DEPDIR)/mbsstr.Po \
+       ./$(DEPDIR)/mbtowc-lock.Po ./$(DEPDIR)/mbtowc.Po \
+       ./$(DEPDIR)/mbuiter.Po ./$(DEPDIR)/memchr.Po \
+       ./$(DEPDIR)/memchr2.Po ./$(DEPDIR)/mempcpy.Po \
+       ./$(DEPDIR)/memrchr.Po ./$(DEPDIR)/mkdir.Po \
+       ./$(DEPDIR)/mkdtemp.Po ./$(DEPDIR)/mkstemp-safer.Po \
+       ./$(DEPDIR)/mkstemp.Po ./$(DEPDIR)/msvc-inval.Po \
+       ./$(DEPDIR)/msvc-nothrow.Po ./$(DEPDIR)/nl_langinfo-lock.Po \
+       ./$(DEPDIR)/nl_langinfo.Po ./$(DEPDIR)/obstack.Po \
+       ./$(DEPDIR)/open.Po ./$(DEPDIR)/openat-die.Po \
+       ./$(DEPDIR)/openat-proc.Po ./$(DEPDIR)/openat.Po \
+       ./$(DEPDIR)/opendir.Po ./$(DEPDIR)/os2-spawn.Po \
+       ./$(DEPDIR)/pipe-safer.Po ./$(DEPDIR)/pipe.Po \
+       ./$(DEPDIR)/pipe2-safer.Po ./$(DEPDIR)/pipe2.Po \
+       ./$(DEPDIR)/printf-args.Po ./$(DEPDIR)/printf-frexp.Po \
+       ./$(DEPDIR)/printf-frexpl.Po ./$(DEPDIR)/printf-parse.Po \
+       ./$(DEPDIR)/progname.Po ./$(DEPDIR)/propername.Po \
+       ./$(DEPDIR)/quotearg.Po ./$(DEPDIR)/raise.Po \
+       ./$(DEPDIR)/rawmemchr.Po ./$(DEPDIR)/readdir.Po \
+       ./$(DEPDIR)/readlink.Po ./$(DEPDIR)/realloc.Po \
+       ./$(DEPDIR)/reallocarray.Po ./$(DEPDIR)/regcomp.Po \
+       ./$(DEPDIR)/regex.Po ./$(DEPDIR)/regex_internal.Po \
+       ./$(DEPDIR)/regexec.Po ./$(DEPDIR)/rename.Po \
+       ./$(DEPDIR)/rewinddir.Po ./$(DEPDIR)/rmdir.Po \
+       ./$(DEPDIR)/save-cwd.Po ./$(DEPDIR)/secure_getenv.Po \
+       ./$(DEPDIR)/setlocale-lock.Po ./$(DEPDIR)/setlocale.Po \
+       ./$(DEPDIR)/setlocale_null.Po ./$(DEPDIR)/sig-handler.Po \
+       ./$(DEPDIR)/sigaction.Po ./$(DEPDIR)/signbitd.Po \
+       ./$(DEPDIR)/signbitf.Po ./$(DEPDIR)/signbitl.Po \
+       ./$(DEPDIR)/sigprocmask.Po ./$(DEPDIR)/sigsegv.Po \
+       ./$(DEPDIR)/snprintf.Po ./$(DEPDIR)/spawn-pipe.Po \
+       ./$(DEPDIR)/spawn.Po ./$(DEPDIR)/spawn_faction_addchdir.Po \
+       ./$(DEPDIR)/spawn_faction_addclose.Po \
+       ./$(DEPDIR)/spawn_faction_adddup2.Po \
+       ./$(DEPDIR)/spawn_faction_addopen.Po \
+       ./$(DEPDIR)/spawn_faction_destroy.Po \
+       ./$(DEPDIR)/spawn_faction_init.Po \
+       ./$(DEPDIR)/spawnattr_destroy.Po ./$(DEPDIR)/spawnattr_init.Po \
+       ./$(DEPDIR)/spawnattr_setflags.Po \
+       ./$(DEPDIR)/spawnattr_setpgroup.Po \
+       ./$(DEPDIR)/spawnattr_setsigmask.Po ./$(DEPDIR)/spawni.Po \
+       ./$(DEPDIR)/spawnp.Po ./$(DEPDIR)/stackvma.Po \
+       ./$(DEPDIR)/stat-time.Po ./$(DEPDIR)/stat-w32.Po \
+       ./$(DEPDIR)/stat.Po ./$(DEPDIR)/stdio-write.Po \
+       ./$(DEPDIR)/stpcpy.Po ./$(DEPDIR)/strchrnul.Po \
+       ./$(DEPDIR)/strdup.Po ./$(DEPDIR)/strerror-override.Po \
+       ./$(DEPDIR)/strerror.Po ./$(DEPDIR)/striconv.Po \
+       ./$(DEPDIR)/stripslash.Po ./$(DEPDIR)/strndup.Po \
+       ./$(DEPDIR)/strnlen.Po ./$(DEPDIR)/strnlen1.Po \
+       ./$(DEPDIR)/strsignal.Po ./$(DEPDIR)/strstr.Po \
+       ./$(DEPDIR)/strtod.Po ./$(DEPDIR)/tempname.Po \
+       ./$(DEPDIR)/tmpdir.Po ./$(DEPDIR)/trim.Po \
+       ./$(DEPDIR)/unistd.Po ./$(DEPDIR)/vasnprintf.Po \
+       ./$(DEPDIR)/vasprintf.Po ./$(DEPDIR)/verror.Po \
+       ./$(DEPDIR)/version-etc-fsf.Po ./$(DEPDIR)/version-etc.Po \
+       ./$(DEPDIR)/wait-process.Po ./$(DEPDIR)/waitpid.Po \
+       ./$(DEPDIR)/wcrtomb.Po ./$(DEPDIR)/wctype-h.Po \
+       ./$(DEPDIR)/wcwidth.Po ./$(DEPDIR)/windows-mutex.Po \
+       ./$(DEPDIR)/windows-once.Po ./$(DEPDIR)/windows-recmutex.Po \
+       ./$(DEPDIR)/windows-rwlock.Po ./$(DEPDIR)/windows-spawn.Po \
+       ./$(DEPDIR)/windows-spin.Po ./$(DEPDIR)/windows-tls.Po \
+       ./$(DEPDIR)/xalloc-die.Po ./$(DEPDIR)/xasprintf.Po \
+       ./$(DEPDIR)/xmalloc.Po ./$(DEPDIR)/xmalloca.Po \
+       ./$(DEPDIR)/xprintf.Po ./$(DEPDIR)/xsize.Po \
+       ./$(DEPDIR)/xstriconv.Po ./$(DEPDIR)/xstrndup.Po \
+       ./$(DEPDIR)/xvasprintf.Po glthread/$(DEPDIR)/lock.Po \
+       glthread/$(DEPDIR)/threadlib.Po glthread/$(DEPDIR)/tls.Po \
+       malloc/$(DEPDIR)/dynarray-skeleton.Po \
+       malloc/$(DEPDIR)/dynarray_at_failure.Po \
+       malloc/$(DEPDIR)/dynarray_emplace_enlarge.Po \
+       malloc/$(DEPDIR)/dynarray_finalize.Po \
+       malloc/$(DEPDIR)/dynarray_resize.Po \
+       malloc/$(DEPDIR)/dynarray_resize_clear.Po \
+       malloc/$(DEPDIR)/scratch_buffer_dupfree.Po \
+       malloc/$(DEPDIR)/scratch_buffer_grow.Po \
+       malloc/$(DEPDIR)/scratch_buffer_grow_preserve.Po \
+       malloc/$(DEPDIR)/scratch_buffer_set_array_size.Po \
+       unistr/$(DEPDIR)/u8-mbtoucr.Po \
+       unistr/$(DEPDIR)/u8-uctomb-aux.Po \
+       unistr/$(DEPDIR)/u8-uctomb.Po uniwidth/$(DEPDIR)/width.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -296,14 +632,14 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
 am__v_CCLD_0 = @echo "  CCLD    " $@;
 am__v_CCLD_1 = 
 SOURCES = $(libm4_a_SOURCES) $(EXTRA_libm4_a_SOURCES)
-DIST_SOURCES = $(libm4_a_SOURCES) $(EXTRA_libm4_a_SOURCES)
+DIST_SOURCES = $(am__libm4_a_SOURCES_DIST) $(EXTRA_libm4_a_SOURCES)
 am__can_run_installinfo = \
   case $$AM_UPDATE_INFO_DIR in \
     n|no|NO) false;; \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
-am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
-       $(LISP)config.hin
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) \
+       config.hin
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
 # *not* preserved.
@@ -347,6 +683,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CONFIG_INCLUDE = @CONFIG_INCLUDE@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
@@ -370,392 +707,519 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
 ERRNO_H = @ERRNO_H@
 EXEEXT = @EXEEXT@
 FLOAT_H = @FLOAT_H@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
 GETOPT_H = @GETOPT_H@
-GLIBC21 = @GLIBC21@
-GNULIB_ACOSF = @GNULIB_ACOSF@
-GNULIB_ACOSL = @GNULIB_ACOSL@
-GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
-GNULIB_ASINF = @GNULIB_ASINF@
-GNULIB_ASINL = @GNULIB_ASINL@
-GNULIB_ATAN2F = @GNULIB_ATAN2F@
-GNULIB_ATANF = @GNULIB_ATANF@
-GNULIB_ATANL = @GNULIB_ATANL@
-GNULIB_ATOLL = @GNULIB_ATOLL@
-GNULIB_BTOWC = @GNULIB_BTOWC@
-GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
-GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
-GNULIB_CBRT = @GNULIB_CBRT@
-GNULIB_CBRTF = @GNULIB_CBRTF@
-GNULIB_CBRTL = @GNULIB_CBRTL@
-GNULIB_CEIL = @GNULIB_CEIL@
-GNULIB_CEILF = @GNULIB_CEILF@
-GNULIB_CEILL = @GNULIB_CEILL@
-GNULIB_CHDIR = @GNULIB_CHDIR@
-GNULIB_CHOWN = @GNULIB_CHOWN@
-GNULIB_CLOSE = @GNULIB_CLOSE@
-GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
-GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
-GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
-GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
-GNULIB_COSF = @GNULIB_COSF@
-GNULIB_COSHF = @GNULIB_COSHF@
-GNULIB_COSL = @GNULIB_COSL@
-GNULIB_DIRFD = @GNULIB_DIRFD@
-GNULIB_DPRINTF = @GNULIB_DPRINTF@
-GNULIB_DUP = @GNULIB_DUP@
-GNULIB_DUP2 = @GNULIB_DUP2@
-GNULIB_DUP3 = @GNULIB_DUP3@
-GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
-GNULIB_ENVIRON = @GNULIB_ENVIRON@
-GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
-GNULIB_EXP2 = @GNULIB_EXP2@
-GNULIB_EXP2F = @GNULIB_EXP2F@
-GNULIB_EXP2L = @GNULIB_EXP2L@
-GNULIB_EXPF = @GNULIB_EXPF@
-GNULIB_EXPL = @GNULIB_EXPL@
-GNULIB_EXPM1 = @GNULIB_EXPM1@
-GNULIB_EXPM1F = @GNULIB_EXPM1F@
-GNULIB_EXPM1L = @GNULIB_EXPM1L@
-GNULIB_FABSF = @GNULIB_FABSF@
-GNULIB_FABSL = @GNULIB_FABSL@
-GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
-GNULIB_FCHDIR = @GNULIB_FCHDIR@
-GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
-GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
-GNULIB_FCLOSE = @GNULIB_FCLOSE@
-GNULIB_FCNTL = @GNULIB_FCNTL@
-GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
-GNULIB_FDOPEN = @GNULIB_FDOPEN@
-GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
-GNULIB_FFLUSH = @GNULIB_FFLUSH@
-GNULIB_FFSL = @GNULIB_FFSL@
-GNULIB_FFSLL = @GNULIB_FFSLL@
-GNULIB_FGETC = @GNULIB_FGETC@
-GNULIB_FGETS = @GNULIB_FGETS@
-GNULIB_FLOOR = @GNULIB_FLOOR@
-GNULIB_FLOORF = @GNULIB_FLOORF@
-GNULIB_FLOORL = @GNULIB_FLOORL@
-GNULIB_FMA = @GNULIB_FMA@
-GNULIB_FMAF = @GNULIB_FMAF@
-GNULIB_FMAL = @GNULIB_FMAL@
-GNULIB_FMOD = @GNULIB_FMOD@
-GNULIB_FMODF = @GNULIB_FMODF@
-GNULIB_FMODL = @GNULIB_FMODL@
-GNULIB_FOPEN = @GNULIB_FOPEN@
-GNULIB_FPRINTF = @GNULIB_FPRINTF@
-GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
-GNULIB_FPURGE = @GNULIB_FPURGE@
-GNULIB_FPUTC = @GNULIB_FPUTC@
-GNULIB_FPUTS = @GNULIB_FPUTS@
-GNULIB_FREAD = @GNULIB_FREAD@
-GNULIB_FREOPEN = @GNULIB_FREOPEN@
-GNULIB_FREXP = @GNULIB_FREXP@
-GNULIB_FREXPF = @GNULIB_FREXPF@
-GNULIB_FREXPL = @GNULIB_FREXPL@
-GNULIB_FSCANF = @GNULIB_FSCANF@
-GNULIB_FSEEK = @GNULIB_FSEEK@
-GNULIB_FSEEKO = @GNULIB_FSEEKO@
-GNULIB_FSTAT = @GNULIB_FSTAT@
-GNULIB_FSTATAT = @GNULIB_FSTATAT@
-GNULIB_FSYNC = @GNULIB_FSYNC@
-GNULIB_FTELL = @GNULIB_FTELL@
-GNULIB_FTELLO = @GNULIB_FTELLO@
-GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
-GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
-GNULIB_FWRITE = @GNULIB_FWRITE@
-GNULIB_GETC = @GNULIB_GETC@
-GNULIB_GETCHAR = @GNULIB_GETCHAR@
-GNULIB_GETCWD = @GNULIB_GETCWD@
-GNULIB_GETDELIM = @GNULIB_GETDELIM@
-GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
-GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
-GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
-GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
-GNULIB_GETLINE = @GNULIB_GETLINE@
-GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
-GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
-GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
-GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
-GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_M4_GNULIB_ACCEPT = @GL_M4_GNULIB_ACCEPT@
+GL_M4_GNULIB_ACCEPT4 = @GL_M4_GNULIB_ACCEPT4@
+GL_M4_GNULIB_ACCESS = @GL_M4_GNULIB_ACCESS@
+GL_M4_GNULIB_ACOSF = @GL_M4_GNULIB_ACOSF@
+GL_M4_GNULIB_ACOSL = @GL_M4_GNULIB_ACOSL@
+GL_M4_GNULIB_ALIGNED_ALLOC = @GL_M4_GNULIB_ALIGNED_ALLOC@
+GL_M4_GNULIB_ALPHASORT = @GL_M4_GNULIB_ALPHASORT@
+GL_M4_GNULIB_ASINF = @GL_M4_GNULIB_ASINF@
+GL_M4_GNULIB_ASINL = @GL_M4_GNULIB_ASINL@
+GL_M4_GNULIB_ATAN2F = @GL_M4_GNULIB_ATAN2F@
+GL_M4_GNULIB_ATANF = @GL_M4_GNULIB_ATANF@
+GL_M4_GNULIB_ATANL = @GL_M4_GNULIB_ATANL@
+GL_M4_GNULIB_ATOLL = @GL_M4_GNULIB_ATOLL@
+GL_M4_GNULIB_BIND = @GL_M4_GNULIB_BIND@
+GL_M4_GNULIB_BTOWC = @GL_M4_GNULIB_BTOWC@
+GL_M4_GNULIB_CALLOC_POSIX = @GL_M4_GNULIB_CALLOC_POSIX@
+GL_M4_GNULIB_CANONICALIZE_FILE_NAME = @GL_M4_GNULIB_CANONICALIZE_FILE_NAME@
+GL_M4_GNULIB_CBRT = @GL_M4_GNULIB_CBRT@
+GL_M4_GNULIB_CBRTF = @GL_M4_GNULIB_CBRTF@
+GL_M4_GNULIB_CBRTL = @GL_M4_GNULIB_CBRTL@
+GL_M4_GNULIB_CEIL = @GL_M4_GNULIB_CEIL@
+GL_M4_GNULIB_CEILF = @GL_M4_GNULIB_CEILF@
+GL_M4_GNULIB_CEILL = @GL_M4_GNULIB_CEILL@
+GL_M4_GNULIB_CHDIR = @GL_M4_GNULIB_CHDIR@
+GL_M4_GNULIB_CHOWN = @GL_M4_GNULIB_CHOWN@
+GL_M4_GNULIB_CLOSE = @GL_M4_GNULIB_CLOSE@
+GL_M4_GNULIB_CLOSEDIR = @GL_M4_GNULIB_CLOSEDIR@
+GL_M4_GNULIB_CONNECT = @GL_M4_GNULIB_CONNECT@
+GL_M4_GNULIB_COPYSIGN = @GL_M4_GNULIB_COPYSIGN@
+GL_M4_GNULIB_COPYSIGNF = @GL_M4_GNULIB_COPYSIGNF@
+GL_M4_GNULIB_COPYSIGNL = @GL_M4_GNULIB_COPYSIGNL@
+GL_M4_GNULIB_COPY_FILE_RANGE = @GL_M4_GNULIB_COPY_FILE_RANGE@
+GL_M4_GNULIB_COSF = @GL_M4_GNULIB_COSF@
+GL_M4_GNULIB_COSHF = @GL_M4_GNULIB_COSHF@
+GL_M4_GNULIB_COSL = @GL_M4_GNULIB_COSL@
+GL_M4_GNULIB_CREAT = @GL_M4_GNULIB_CREAT@
+GL_M4_GNULIB_CTIME = @GL_M4_GNULIB_CTIME@
+GL_M4_GNULIB_DIRFD = @GL_M4_GNULIB_DIRFD@
+GL_M4_GNULIB_DPRINTF = @GL_M4_GNULIB_DPRINTF@
+GL_M4_GNULIB_DUP = @GL_M4_GNULIB_DUP@
+GL_M4_GNULIB_DUP2 = @GL_M4_GNULIB_DUP2@
+GL_M4_GNULIB_DUP3 = @GL_M4_GNULIB_DUP3@
+GL_M4_GNULIB_DUPLOCALE = @GL_M4_GNULIB_DUPLOCALE@
+GL_M4_GNULIB_ENVIRON = @GL_M4_GNULIB_ENVIRON@
+GL_M4_GNULIB_EUIDACCESS = @GL_M4_GNULIB_EUIDACCESS@
+GL_M4_GNULIB_EXECL = @GL_M4_GNULIB_EXECL@
+GL_M4_GNULIB_EXECLE = @GL_M4_GNULIB_EXECLE@
+GL_M4_GNULIB_EXECLP = @GL_M4_GNULIB_EXECLP@
+GL_M4_GNULIB_EXECV = @GL_M4_GNULIB_EXECV@
+GL_M4_GNULIB_EXECVE = @GL_M4_GNULIB_EXECVE@
+GL_M4_GNULIB_EXECVP = @GL_M4_GNULIB_EXECVP@
+GL_M4_GNULIB_EXECVPE = @GL_M4_GNULIB_EXECVPE@
+GL_M4_GNULIB_EXP2 = @GL_M4_GNULIB_EXP2@
+GL_M4_GNULIB_EXP2F = @GL_M4_GNULIB_EXP2F@
+GL_M4_GNULIB_EXP2L = @GL_M4_GNULIB_EXP2L@
+GL_M4_GNULIB_EXPF = @GL_M4_GNULIB_EXPF@
+GL_M4_GNULIB_EXPL = @GL_M4_GNULIB_EXPL@
+GL_M4_GNULIB_EXPLICIT_BZERO = @GL_M4_GNULIB_EXPLICIT_BZERO@
+GL_M4_GNULIB_EXPM1 = @GL_M4_GNULIB_EXPM1@
+GL_M4_GNULIB_EXPM1F = @GL_M4_GNULIB_EXPM1F@
+GL_M4_GNULIB_EXPM1L = @GL_M4_GNULIB_EXPM1L@
+GL_M4_GNULIB_FABSF = @GL_M4_GNULIB_FABSF@
+GL_M4_GNULIB_FABSL = @GL_M4_GNULIB_FABSL@
+GL_M4_GNULIB_FACCESSAT = @GL_M4_GNULIB_FACCESSAT@
+GL_M4_GNULIB_FCHDIR = @GL_M4_GNULIB_FCHDIR@
+GL_M4_GNULIB_FCHMODAT = @GL_M4_GNULIB_FCHMODAT@
+GL_M4_GNULIB_FCHOWNAT = @GL_M4_GNULIB_FCHOWNAT@
+GL_M4_GNULIB_FCLOSE = @GL_M4_GNULIB_FCLOSE@
+GL_M4_GNULIB_FCNTL = @GL_M4_GNULIB_FCNTL@
+GL_M4_GNULIB_FDATASYNC = @GL_M4_GNULIB_FDATASYNC@
+GL_M4_GNULIB_FDOPEN = @GL_M4_GNULIB_FDOPEN@
+GL_M4_GNULIB_FDOPENDIR = @GL_M4_GNULIB_FDOPENDIR@
+GL_M4_GNULIB_FFLUSH = @GL_M4_GNULIB_FFLUSH@
+GL_M4_GNULIB_FFSL = @GL_M4_GNULIB_FFSL@
+GL_M4_GNULIB_FFSLL = @GL_M4_GNULIB_FFSLL@
+GL_M4_GNULIB_FGETC = @GL_M4_GNULIB_FGETC@
+GL_M4_GNULIB_FGETS = @GL_M4_GNULIB_FGETS@
+GL_M4_GNULIB_FLOOR = @GL_M4_GNULIB_FLOOR@
+GL_M4_GNULIB_FLOORF = @GL_M4_GNULIB_FLOORF@
+GL_M4_GNULIB_FLOORL = @GL_M4_GNULIB_FLOORL@
+GL_M4_GNULIB_FMA = @GL_M4_GNULIB_FMA@
+GL_M4_GNULIB_FMAF = @GL_M4_GNULIB_FMAF@
+GL_M4_GNULIB_FMAL = @GL_M4_GNULIB_FMAL@
+GL_M4_GNULIB_FMOD = @GL_M4_GNULIB_FMOD@
+GL_M4_GNULIB_FMODF = @GL_M4_GNULIB_FMODF@
+GL_M4_GNULIB_FMODL = @GL_M4_GNULIB_FMODL@
+GL_M4_GNULIB_FOPEN = @GL_M4_GNULIB_FOPEN@
+GL_M4_GNULIB_FPRINTF = @GL_M4_GNULIB_FPRINTF@
+GL_M4_GNULIB_FPRINTF_POSIX = @GL_M4_GNULIB_FPRINTF_POSIX@
+GL_M4_GNULIB_FPURGE = @GL_M4_GNULIB_FPURGE@
+GL_M4_GNULIB_FPUTC = @GL_M4_GNULIB_FPUTC@
+GL_M4_GNULIB_FPUTS = @GL_M4_GNULIB_FPUTS@
+GL_M4_GNULIB_FREAD = @GL_M4_GNULIB_FREAD@
+GL_M4_GNULIB_FREE_POSIX = @GL_M4_GNULIB_FREE_POSIX@
+GL_M4_GNULIB_FREOPEN = @GL_M4_GNULIB_FREOPEN@
+GL_M4_GNULIB_FREXP = @GL_M4_GNULIB_FREXP@
+GL_M4_GNULIB_FREXPF = @GL_M4_GNULIB_FREXPF@
+GL_M4_GNULIB_FREXPL = @GL_M4_GNULIB_FREXPL@
+GL_M4_GNULIB_FSCANF = @GL_M4_GNULIB_FSCANF@
+GL_M4_GNULIB_FSEEK = @GL_M4_GNULIB_FSEEK@
+GL_M4_GNULIB_FSEEKO = @GL_M4_GNULIB_FSEEKO@
+GL_M4_GNULIB_FSTAT = @GL_M4_GNULIB_FSTAT@
+GL_M4_GNULIB_FSTATAT = @GL_M4_GNULIB_FSTATAT@
+GL_M4_GNULIB_FSYNC = @GL_M4_GNULIB_FSYNC@
+GL_M4_GNULIB_FTELL = @GL_M4_GNULIB_FTELL@
+GL_M4_GNULIB_FTELLO = @GL_M4_GNULIB_FTELLO@
+GL_M4_GNULIB_FTRUNCATE = @GL_M4_GNULIB_FTRUNCATE@
+GL_M4_GNULIB_FUTIMENS = @GL_M4_GNULIB_FUTIMENS@
+GL_M4_GNULIB_FWRITE = @GL_M4_GNULIB_FWRITE@
+GL_M4_GNULIB_GETC = @GL_M4_GNULIB_GETC@
+GL_M4_GNULIB_GETCHAR = @GL_M4_GNULIB_GETCHAR@
+GL_M4_GNULIB_GETCWD = @GL_M4_GNULIB_GETCWD@
+GL_M4_GNULIB_GETDELIM = @GL_M4_GNULIB_GETDELIM@
+GL_M4_GNULIB_GETDOMAINNAME = @GL_M4_GNULIB_GETDOMAINNAME@
+GL_M4_GNULIB_GETDTABLESIZE = @GL_M4_GNULIB_GETDTABLESIZE@
+GL_M4_GNULIB_GETENTROPY = @GL_M4_GNULIB_GETENTROPY@
+GL_M4_GNULIB_GETGROUPS = @GL_M4_GNULIB_GETGROUPS@
+GL_M4_GNULIB_GETHOSTNAME = @GL_M4_GNULIB_GETHOSTNAME@
+GL_M4_GNULIB_GETLINE = @GL_M4_GNULIB_GETLINE@
+GL_M4_GNULIB_GETLOADAVG = @GL_M4_GNULIB_GETLOADAVG@
+GL_M4_GNULIB_GETLOGIN = @GL_M4_GNULIB_GETLOGIN@
+GL_M4_GNULIB_GETLOGIN_R = @GL_M4_GNULIB_GETLOGIN_R@
+GL_M4_GNULIB_GETOPT_POSIX = @GL_M4_GNULIB_GETOPT_POSIX@
+GL_M4_GNULIB_GETPAGESIZE = @GL_M4_GNULIB_GETPAGESIZE@
+GL_M4_GNULIB_GETPASS = @GL_M4_GNULIB_GETPASS@
+GL_M4_GNULIB_GETPEERNAME = @GL_M4_GNULIB_GETPEERNAME@
+GL_M4_GNULIB_GETRANDOM = @GL_M4_GNULIB_GETRANDOM@
+GL_M4_GNULIB_GETSOCKNAME = @GL_M4_GNULIB_GETSOCKNAME@
+GL_M4_GNULIB_GETSOCKOPT = @GL_M4_GNULIB_GETSOCKOPT@
+GL_M4_GNULIB_GETSUBOPT = @GL_M4_GNULIB_GETSUBOPT@
+GL_M4_GNULIB_GETTIMEOFDAY = @GL_M4_GNULIB_GETTIMEOFDAY@
+GL_M4_GNULIB_GETUMASK = @GL_M4_GNULIB_GETUMASK@
+GL_M4_GNULIB_GETUSERSHELL = @GL_M4_GNULIB_GETUSERSHELL@
+GL_M4_GNULIB_GRANTPT = @GL_M4_GNULIB_GRANTPT@
+GL_M4_GNULIB_GROUP_MEMBER = @GL_M4_GNULIB_GROUP_MEMBER@
+GL_M4_GNULIB_HYPOT = @GL_M4_GNULIB_HYPOT@
+GL_M4_GNULIB_HYPOTF = @GL_M4_GNULIB_HYPOTF@
+GL_M4_GNULIB_HYPOTL = @GL_M4_GNULIB_HYPOTL@
+GL_M4_GNULIB_ICONV = @GL_M4_GNULIB_ICONV@
+GL_M4_GNULIB_ILOGB = @GL_M4_GNULIB_ILOGB@
+GL_M4_GNULIB_ILOGBF = @GL_M4_GNULIB_ILOGBF@
+GL_M4_GNULIB_ILOGBL = @GL_M4_GNULIB_ILOGBL@
+GL_M4_GNULIB_IMAXABS = @GL_M4_GNULIB_IMAXABS@
+GL_M4_GNULIB_IMAXDIV = @GL_M4_GNULIB_IMAXDIV@
+GL_M4_GNULIB_INET_NTOP = @GL_M4_GNULIB_INET_NTOP@
+GL_M4_GNULIB_INET_PTON = @GL_M4_GNULIB_INET_PTON@
+GL_M4_GNULIB_IOCTL = @GL_M4_GNULIB_IOCTL@
+GL_M4_GNULIB_ISATTY = @GL_M4_GNULIB_ISATTY@
+GL_M4_GNULIB_ISBLANK = @GL_M4_GNULIB_ISBLANK@
+GL_M4_GNULIB_ISFINITE = @GL_M4_GNULIB_ISFINITE@
+GL_M4_GNULIB_ISINF = @GL_M4_GNULIB_ISINF@
+GL_M4_GNULIB_ISNAN = @GL_M4_GNULIB_ISNAN@
+GL_M4_GNULIB_ISNAND = @GL_M4_GNULIB_ISNAND@
+GL_M4_GNULIB_ISNANF = @GL_M4_GNULIB_ISNANF@
+GL_M4_GNULIB_ISNANL = @GL_M4_GNULIB_ISNANL@
+GL_M4_GNULIB_ISWBLANK = @GL_M4_GNULIB_ISWBLANK@
+GL_M4_GNULIB_ISWCTYPE = @GL_M4_GNULIB_ISWCTYPE@
+GL_M4_GNULIB_ISWDIGIT = @GL_M4_GNULIB_ISWDIGIT@
+GL_M4_GNULIB_ISWXDIGIT = @GL_M4_GNULIB_ISWXDIGIT@
+GL_M4_GNULIB_LCHMOD = @GL_M4_GNULIB_LCHMOD@
+GL_M4_GNULIB_LCHOWN = @GL_M4_GNULIB_LCHOWN@
+GL_M4_GNULIB_LDEXPF = @GL_M4_GNULIB_LDEXPF@
+GL_M4_GNULIB_LDEXPL = @GL_M4_GNULIB_LDEXPL@
+GL_M4_GNULIB_LINK = @GL_M4_GNULIB_LINK@
+GL_M4_GNULIB_LINKAT = @GL_M4_GNULIB_LINKAT@
+GL_M4_GNULIB_LISTEN = @GL_M4_GNULIB_LISTEN@
+GL_M4_GNULIB_LOCALECONV = @GL_M4_GNULIB_LOCALECONV@
+GL_M4_GNULIB_LOCALENAME = @GL_M4_GNULIB_LOCALENAME@
+GL_M4_GNULIB_LOCALTIME = @GL_M4_GNULIB_LOCALTIME@
+GL_M4_GNULIB_LOG = @GL_M4_GNULIB_LOG@
+GL_M4_GNULIB_LOG10 = @GL_M4_GNULIB_LOG10@
+GL_M4_GNULIB_LOG10F = @GL_M4_GNULIB_LOG10F@
+GL_M4_GNULIB_LOG10L = @GL_M4_GNULIB_LOG10L@
+GL_M4_GNULIB_LOG1P = @GL_M4_GNULIB_LOG1P@
+GL_M4_GNULIB_LOG1PF = @GL_M4_GNULIB_LOG1PF@
+GL_M4_GNULIB_LOG1PL = @GL_M4_GNULIB_LOG1PL@
+GL_M4_GNULIB_LOG2 = @GL_M4_GNULIB_LOG2@
+GL_M4_GNULIB_LOG2F = @GL_M4_GNULIB_LOG2F@
+GL_M4_GNULIB_LOG2L = @GL_M4_GNULIB_LOG2L@
+GL_M4_GNULIB_LOGB = @GL_M4_GNULIB_LOGB@
+GL_M4_GNULIB_LOGBF = @GL_M4_GNULIB_LOGBF@
+GL_M4_GNULIB_LOGBL = @GL_M4_GNULIB_LOGBL@
+GL_M4_GNULIB_LOGF = @GL_M4_GNULIB_LOGF@
+GL_M4_GNULIB_LOGL = @GL_M4_GNULIB_LOGL@
+GL_M4_GNULIB_LSEEK = @GL_M4_GNULIB_LSEEK@
+GL_M4_GNULIB_LSTAT = @GL_M4_GNULIB_LSTAT@
+GL_M4_GNULIB_MALLOC_POSIX = @GL_M4_GNULIB_MALLOC_POSIX@
+GL_M4_GNULIB_MBRLEN = @GL_M4_GNULIB_MBRLEN@
+GL_M4_GNULIB_MBRTOWC = @GL_M4_GNULIB_MBRTOWC@
+GL_M4_GNULIB_MBSCASECMP = @GL_M4_GNULIB_MBSCASECMP@
+GL_M4_GNULIB_MBSCASESTR = @GL_M4_GNULIB_MBSCASESTR@
+GL_M4_GNULIB_MBSCHR = @GL_M4_GNULIB_MBSCHR@
+GL_M4_GNULIB_MBSCSPN = @GL_M4_GNULIB_MBSCSPN@
+GL_M4_GNULIB_MBSINIT = @GL_M4_GNULIB_MBSINIT@
+GL_M4_GNULIB_MBSLEN = @GL_M4_GNULIB_MBSLEN@
+GL_M4_GNULIB_MBSNCASECMP = @GL_M4_GNULIB_MBSNCASECMP@
+GL_M4_GNULIB_MBSNLEN = @GL_M4_GNULIB_MBSNLEN@
+GL_M4_GNULIB_MBSNRTOWCS = @GL_M4_GNULIB_MBSNRTOWCS@
+GL_M4_GNULIB_MBSPBRK = @GL_M4_GNULIB_MBSPBRK@
+GL_M4_GNULIB_MBSPCASECMP = @GL_M4_GNULIB_MBSPCASECMP@
+GL_M4_GNULIB_MBSRCHR = @GL_M4_GNULIB_MBSRCHR@
+GL_M4_GNULIB_MBSRTOWCS = @GL_M4_GNULIB_MBSRTOWCS@
+GL_M4_GNULIB_MBSSEP = @GL_M4_GNULIB_MBSSEP@
+GL_M4_GNULIB_MBSSPN = @GL_M4_GNULIB_MBSSPN@
+GL_M4_GNULIB_MBSSTR = @GL_M4_GNULIB_MBSSTR@
+GL_M4_GNULIB_MBSTOK_R = @GL_M4_GNULIB_MBSTOK_R@
+GL_M4_GNULIB_MBTOWC = @GL_M4_GNULIB_MBTOWC@
+GL_M4_GNULIB_MDA_ACCESS = @GL_M4_GNULIB_MDA_ACCESS@
+GL_M4_GNULIB_MDA_CHDIR = @GL_M4_GNULIB_MDA_CHDIR@
+GL_M4_GNULIB_MDA_CHMOD = @GL_M4_GNULIB_MDA_CHMOD@
+GL_M4_GNULIB_MDA_CLOSE = @GL_M4_GNULIB_MDA_CLOSE@
+GL_M4_GNULIB_MDA_CREAT = @GL_M4_GNULIB_MDA_CREAT@
+GL_M4_GNULIB_MDA_DUP = @GL_M4_GNULIB_MDA_DUP@
+GL_M4_GNULIB_MDA_DUP2 = @GL_M4_GNULIB_MDA_DUP2@
+GL_M4_GNULIB_MDA_ECVT = @GL_M4_GNULIB_MDA_ECVT@
+GL_M4_GNULIB_MDA_EXECL = @GL_M4_GNULIB_MDA_EXECL@
+GL_M4_GNULIB_MDA_EXECLE = @GL_M4_GNULIB_MDA_EXECLE@
+GL_M4_GNULIB_MDA_EXECLP = @GL_M4_GNULIB_MDA_EXECLP@
+GL_M4_GNULIB_MDA_EXECV = @GL_M4_GNULIB_MDA_EXECV@
+GL_M4_GNULIB_MDA_EXECVE = @GL_M4_GNULIB_MDA_EXECVE@
+GL_M4_GNULIB_MDA_EXECVP = @GL_M4_GNULIB_MDA_EXECVP@
+GL_M4_GNULIB_MDA_EXECVPE = @GL_M4_GNULIB_MDA_EXECVPE@
+GL_M4_GNULIB_MDA_FCLOSEALL = @GL_M4_GNULIB_MDA_FCLOSEALL@
+GL_M4_GNULIB_MDA_FCVT = @GL_M4_GNULIB_MDA_FCVT@
+GL_M4_GNULIB_MDA_FDOPEN = @GL_M4_GNULIB_MDA_FDOPEN@
+GL_M4_GNULIB_MDA_FILENO = @GL_M4_GNULIB_MDA_FILENO@
+GL_M4_GNULIB_MDA_GCVT = @GL_M4_GNULIB_MDA_GCVT@
+GL_M4_GNULIB_MDA_GETCWD = @GL_M4_GNULIB_MDA_GETCWD@
+GL_M4_GNULIB_MDA_GETPID = @GL_M4_GNULIB_MDA_GETPID@
+GL_M4_GNULIB_MDA_GETW = @GL_M4_GNULIB_MDA_GETW@
+GL_M4_GNULIB_MDA_ISATTY = @GL_M4_GNULIB_MDA_ISATTY@
+GL_M4_GNULIB_MDA_J0 = @GL_M4_GNULIB_MDA_J0@
+GL_M4_GNULIB_MDA_J1 = @GL_M4_GNULIB_MDA_J1@
+GL_M4_GNULIB_MDA_JN = @GL_M4_GNULIB_MDA_JN@
+GL_M4_GNULIB_MDA_LSEEK = @GL_M4_GNULIB_MDA_LSEEK@
+GL_M4_GNULIB_MDA_MEMCCPY = @GL_M4_GNULIB_MDA_MEMCCPY@
+GL_M4_GNULIB_MDA_MKDIR = @GL_M4_GNULIB_MDA_MKDIR@
+GL_M4_GNULIB_MDA_MKTEMP = @GL_M4_GNULIB_MDA_MKTEMP@
+GL_M4_GNULIB_MDA_OPEN = @GL_M4_GNULIB_MDA_OPEN@
+GL_M4_GNULIB_MDA_PUTENV = @GL_M4_GNULIB_MDA_PUTENV@
+GL_M4_GNULIB_MDA_PUTW = @GL_M4_GNULIB_MDA_PUTW@
+GL_M4_GNULIB_MDA_READ = @GL_M4_GNULIB_MDA_READ@
+GL_M4_GNULIB_MDA_RMDIR = @GL_M4_GNULIB_MDA_RMDIR@
+GL_M4_GNULIB_MDA_STRDUP = @GL_M4_GNULIB_MDA_STRDUP@
+GL_M4_GNULIB_MDA_SWAB = @GL_M4_GNULIB_MDA_SWAB@
+GL_M4_GNULIB_MDA_TEMPNAM = @GL_M4_GNULIB_MDA_TEMPNAM@
+GL_M4_GNULIB_MDA_TZSET = @GL_M4_GNULIB_MDA_TZSET@
+GL_M4_GNULIB_MDA_UMASK = @GL_M4_GNULIB_MDA_UMASK@
+GL_M4_GNULIB_MDA_UNLINK = @GL_M4_GNULIB_MDA_UNLINK@
+GL_M4_GNULIB_MDA_WCSDUP = @GL_M4_GNULIB_MDA_WCSDUP@
+GL_M4_GNULIB_MDA_WRITE = @GL_M4_GNULIB_MDA_WRITE@
+GL_M4_GNULIB_MDA_Y0 = @GL_M4_GNULIB_MDA_Y0@
+GL_M4_GNULIB_MDA_Y1 = @GL_M4_GNULIB_MDA_Y1@
+GL_M4_GNULIB_MDA_YN = @GL_M4_GNULIB_MDA_YN@
+GL_M4_GNULIB_MEMCHR = @GL_M4_GNULIB_MEMCHR@
+GL_M4_GNULIB_MEMMEM = @GL_M4_GNULIB_MEMMEM@
+GL_M4_GNULIB_MEMPCPY = @GL_M4_GNULIB_MEMPCPY@
+GL_M4_GNULIB_MEMRCHR = @GL_M4_GNULIB_MEMRCHR@
+GL_M4_GNULIB_MKDIR = @GL_M4_GNULIB_MKDIR@
+GL_M4_GNULIB_MKDIRAT = @GL_M4_GNULIB_MKDIRAT@
+GL_M4_GNULIB_MKDTEMP = @GL_M4_GNULIB_MKDTEMP@
+GL_M4_GNULIB_MKFIFO = @GL_M4_GNULIB_MKFIFO@
+GL_M4_GNULIB_MKFIFOAT = @GL_M4_GNULIB_MKFIFOAT@
+GL_M4_GNULIB_MKNOD = @GL_M4_GNULIB_MKNOD@
+GL_M4_GNULIB_MKNODAT = @GL_M4_GNULIB_MKNODAT@
+GL_M4_GNULIB_MKOSTEMP = @GL_M4_GNULIB_MKOSTEMP@
+GL_M4_GNULIB_MKOSTEMPS = @GL_M4_GNULIB_MKOSTEMPS@
+GL_M4_GNULIB_MKSTEMP = @GL_M4_GNULIB_MKSTEMP@
+GL_M4_GNULIB_MKSTEMPS = @GL_M4_GNULIB_MKSTEMPS@
+GL_M4_GNULIB_MKTIME = @GL_M4_GNULIB_MKTIME@
+GL_M4_GNULIB_MODF = @GL_M4_GNULIB_MODF@
+GL_M4_GNULIB_MODFF = @GL_M4_GNULIB_MODFF@
+GL_M4_GNULIB_MODFL = @GL_M4_GNULIB_MODFL@
+GL_M4_GNULIB_NANOSLEEP = @GL_M4_GNULIB_NANOSLEEP@
+GL_M4_GNULIB_NL_LANGINFO = @GL_M4_GNULIB_NL_LANGINFO@
+GL_M4_GNULIB_NONBLOCKING = @GL_M4_GNULIB_NONBLOCKING@
+GL_M4_GNULIB_OBSTACK_PRINTF = @GL_M4_GNULIB_OBSTACK_PRINTF@
+GL_M4_GNULIB_OBSTACK_PRINTF_POSIX = @GL_M4_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_M4_GNULIB_OPEN = @GL_M4_GNULIB_OPEN@
+GL_M4_GNULIB_OPENAT = @GL_M4_GNULIB_OPENAT@
+GL_M4_GNULIB_OPENDIR = @GL_M4_GNULIB_OPENDIR@
+GL_M4_GNULIB_OVERRIDES_STRUCT_STAT = @GL_M4_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_M4_GNULIB_PCLOSE = @GL_M4_GNULIB_PCLOSE@
+GL_M4_GNULIB_PERROR = @GL_M4_GNULIB_PERROR@
+GL_M4_GNULIB_PIPE = @GL_M4_GNULIB_PIPE@
+GL_M4_GNULIB_PIPE2 = @GL_M4_GNULIB_PIPE2@
+GL_M4_GNULIB_POPEN = @GL_M4_GNULIB_POPEN@
+GL_M4_GNULIB_POSIX_MEMALIGN = @GL_M4_GNULIB_POSIX_MEMALIGN@
+GL_M4_GNULIB_POSIX_OPENPT = @GL_M4_GNULIB_POSIX_OPENPT@
+GL_M4_GNULIB_POSIX_SPAWN = @GL_M4_GNULIB_POSIX_SPAWN@
+GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY = @GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNATTR_INIT = @GL_M4_GNULIB_POSIX_SPAWNATTR_INIT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNP = @GL_M4_GNULIB_POSIX_SPAWNP@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
+GL_M4_GNULIB_POWF = @GL_M4_GNULIB_POWF@
+GL_M4_GNULIB_PREAD = @GL_M4_GNULIB_PREAD@
+GL_M4_GNULIB_PRINTF = @GL_M4_GNULIB_PRINTF@
+GL_M4_GNULIB_PRINTF_POSIX = @GL_M4_GNULIB_PRINTF_POSIX@
+GL_M4_GNULIB_PSELECT = @GL_M4_GNULIB_PSELECT@
+GL_M4_GNULIB_PTHREAD_COND = @GL_M4_GNULIB_PTHREAD_COND@
+GL_M4_GNULIB_PTHREAD_MUTEX = @GL_M4_GNULIB_PTHREAD_MUTEX@
+GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK = @GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK@
+GL_M4_GNULIB_PTHREAD_ONCE = @GL_M4_GNULIB_PTHREAD_ONCE@
+GL_M4_GNULIB_PTHREAD_RWLOCK = @GL_M4_GNULIB_PTHREAD_RWLOCK@
+GL_M4_GNULIB_PTHREAD_SIGMASK = @GL_M4_GNULIB_PTHREAD_SIGMASK@
+GL_M4_GNULIB_PTHREAD_SPIN = @GL_M4_GNULIB_PTHREAD_SPIN@
+GL_M4_GNULIB_PTHREAD_THREAD = @GL_M4_GNULIB_PTHREAD_THREAD@
+GL_M4_GNULIB_PTHREAD_TSS = @GL_M4_GNULIB_PTHREAD_TSS@
+GL_M4_GNULIB_PTSNAME = @GL_M4_GNULIB_PTSNAME@
+GL_M4_GNULIB_PTSNAME_R = @GL_M4_GNULIB_PTSNAME_R@
+GL_M4_GNULIB_PUTC = @GL_M4_GNULIB_PUTC@
+GL_M4_GNULIB_PUTCHAR = @GL_M4_GNULIB_PUTCHAR@
+GL_M4_GNULIB_PUTENV = @GL_M4_GNULIB_PUTENV@
+GL_M4_GNULIB_PUTS = @GL_M4_GNULIB_PUTS@
+GL_M4_GNULIB_PWRITE = @GL_M4_GNULIB_PWRITE@
+GL_M4_GNULIB_QSORT_R = @GL_M4_GNULIB_QSORT_R@
+GL_M4_GNULIB_RAISE = @GL_M4_GNULIB_RAISE@
+GL_M4_GNULIB_RANDOM = @GL_M4_GNULIB_RANDOM@
+GL_M4_GNULIB_RANDOM_R = @GL_M4_GNULIB_RANDOM_R@
+GL_M4_GNULIB_RAWMEMCHR = @GL_M4_GNULIB_RAWMEMCHR@
+GL_M4_GNULIB_READ = @GL_M4_GNULIB_READ@
+GL_M4_GNULIB_READDIR = @GL_M4_GNULIB_READDIR@
+GL_M4_GNULIB_READLINK = @GL_M4_GNULIB_READLINK@
+GL_M4_GNULIB_READLINKAT = @GL_M4_GNULIB_READLINKAT@
+GL_M4_GNULIB_REALLOCARRAY = @GL_M4_GNULIB_REALLOCARRAY@
+GL_M4_GNULIB_REALLOC_POSIX = @GL_M4_GNULIB_REALLOC_POSIX@
+GL_M4_GNULIB_REALPATH = @GL_M4_GNULIB_REALPATH@
+GL_M4_GNULIB_RECV = @GL_M4_GNULIB_RECV@
+GL_M4_GNULIB_RECVFROM = @GL_M4_GNULIB_RECVFROM@
+GL_M4_GNULIB_REMAINDER = @GL_M4_GNULIB_REMAINDER@
+GL_M4_GNULIB_REMAINDERF = @GL_M4_GNULIB_REMAINDERF@
+GL_M4_GNULIB_REMAINDERL = @GL_M4_GNULIB_REMAINDERL@
+GL_M4_GNULIB_REMOVE = @GL_M4_GNULIB_REMOVE@
+GL_M4_GNULIB_RENAME = @GL_M4_GNULIB_RENAME@
+GL_M4_GNULIB_RENAMEAT = @GL_M4_GNULIB_RENAMEAT@
+GL_M4_GNULIB_REWINDDIR = @GL_M4_GNULIB_REWINDDIR@
+GL_M4_GNULIB_RINT = @GL_M4_GNULIB_RINT@
+GL_M4_GNULIB_RINTF = @GL_M4_GNULIB_RINTF@
+GL_M4_GNULIB_RINTL = @GL_M4_GNULIB_RINTL@
+GL_M4_GNULIB_RMDIR = @GL_M4_GNULIB_RMDIR@
+GL_M4_GNULIB_ROUND = @GL_M4_GNULIB_ROUND@
+GL_M4_GNULIB_ROUNDF = @GL_M4_GNULIB_ROUNDF@
+GL_M4_GNULIB_ROUNDL = @GL_M4_GNULIB_ROUNDL@
+GL_M4_GNULIB_RPMATCH = @GL_M4_GNULIB_RPMATCH@
+GL_M4_GNULIB_SCANDIR = @GL_M4_GNULIB_SCANDIR@
+GL_M4_GNULIB_SCANF = @GL_M4_GNULIB_SCANF@
+GL_M4_GNULIB_SCHED_YIELD = @GL_M4_GNULIB_SCHED_YIELD@
+GL_M4_GNULIB_SECURE_GETENV = @GL_M4_GNULIB_SECURE_GETENV@
+GL_M4_GNULIB_SELECT = @GL_M4_GNULIB_SELECT@
+GL_M4_GNULIB_SEND = @GL_M4_GNULIB_SEND@
+GL_M4_GNULIB_SENDTO = @GL_M4_GNULIB_SENDTO@
+GL_M4_GNULIB_SETENV = @GL_M4_GNULIB_SETENV@
+GL_M4_GNULIB_SETHOSTNAME = @GL_M4_GNULIB_SETHOSTNAME@
+GL_M4_GNULIB_SETLOCALE = @GL_M4_GNULIB_SETLOCALE@
+GL_M4_GNULIB_SETLOCALE_NULL = @GL_M4_GNULIB_SETLOCALE_NULL@
+GL_M4_GNULIB_SETSOCKOPT = @GL_M4_GNULIB_SETSOCKOPT@
+GL_M4_GNULIB_SHUTDOWN = @GL_M4_GNULIB_SHUTDOWN@
+GL_M4_GNULIB_SIGABBREV_NP = @GL_M4_GNULIB_SIGABBREV_NP@
+GL_M4_GNULIB_SIGACTION = @GL_M4_GNULIB_SIGACTION@
+GL_M4_GNULIB_SIGDESCR_NP = @GL_M4_GNULIB_SIGDESCR_NP@
+GL_M4_GNULIB_SIGNAL_H_SIGPIPE = @GL_M4_GNULIB_SIGNAL_H_SIGPIPE@
+GL_M4_GNULIB_SIGNBIT = @GL_M4_GNULIB_SIGNBIT@
+GL_M4_GNULIB_SIGPROCMASK = @GL_M4_GNULIB_SIGPROCMASK@
+GL_M4_GNULIB_SINF = @GL_M4_GNULIB_SINF@
+GL_M4_GNULIB_SINHF = @GL_M4_GNULIB_SINHF@
+GL_M4_GNULIB_SINL = @GL_M4_GNULIB_SINL@
+GL_M4_GNULIB_SLEEP = @GL_M4_GNULIB_SLEEP@
+GL_M4_GNULIB_SNPRINTF = @GL_M4_GNULIB_SNPRINTF@
+GL_M4_GNULIB_SOCKET = @GL_M4_GNULIB_SOCKET@
+GL_M4_GNULIB_SPRINTF_POSIX = @GL_M4_GNULIB_SPRINTF_POSIX@
+GL_M4_GNULIB_SQRTF = @GL_M4_GNULIB_SQRTF@
+GL_M4_GNULIB_SQRTL = @GL_M4_GNULIB_SQRTL@
+GL_M4_GNULIB_STAT = @GL_M4_GNULIB_STAT@
+GL_M4_GNULIB_STDIO_H_NONBLOCKING = @GL_M4_GNULIB_STDIO_H_NONBLOCKING@
+GL_M4_GNULIB_STDIO_H_SIGPIPE = @GL_M4_GNULIB_STDIO_H_SIGPIPE@
+GL_M4_GNULIB_STPCPY = @GL_M4_GNULIB_STPCPY@
+GL_M4_GNULIB_STPNCPY = @GL_M4_GNULIB_STPNCPY@
+GL_M4_GNULIB_STRCASESTR = @GL_M4_GNULIB_STRCASESTR@
+GL_M4_GNULIB_STRCHRNUL = @GL_M4_GNULIB_STRCHRNUL@
+GL_M4_GNULIB_STRDUP = @GL_M4_GNULIB_STRDUP@
+GL_M4_GNULIB_STRERROR = @GL_M4_GNULIB_STRERROR@
+GL_M4_GNULIB_STRERRORNAME_NP = @GL_M4_GNULIB_STRERRORNAME_NP@
+GL_M4_GNULIB_STRERROR_R = @GL_M4_GNULIB_STRERROR_R@
+GL_M4_GNULIB_STRFTIME = @GL_M4_GNULIB_STRFTIME@
+GL_M4_GNULIB_STRNCAT = @GL_M4_GNULIB_STRNCAT@
+GL_M4_GNULIB_STRNDUP = @GL_M4_GNULIB_STRNDUP@
+GL_M4_GNULIB_STRNLEN = @GL_M4_GNULIB_STRNLEN@
+GL_M4_GNULIB_STRPBRK = @GL_M4_GNULIB_STRPBRK@
+GL_M4_GNULIB_STRPTIME = @GL_M4_GNULIB_STRPTIME@
+GL_M4_GNULIB_STRSEP = @GL_M4_GNULIB_STRSEP@
+GL_M4_GNULIB_STRSIGNAL = @GL_M4_GNULIB_STRSIGNAL@
+GL_M4_GNULIB_STRSTR = @GL_M4_GNULIB_STRSTR@
+GL_M4_GNULIB_STRTOD = @GL_M4_GNULIB_STRTOD@
+GL_M4_GNULIB_STRTOIMAX = @GL_M4_GNULIB_STRTOIMAX@
+GL_M4_GNULIB_STRTOK_R = @GL_M4_GNULIB_STRTOK_R@
+GL_M4_GNULIB_STRTOL = @GL_M4_GNULIB_STRTOL@
+GL_M4_GNULIB_STRTOLD = @GL_M4_GNULIB_STRTOLD@
+GL_M4_GNULIB_STRTOLL = @GL_M4_GNULIB_STRTOLL@
+GL_M4_GNULIB_STRTOUL = @GL_M4_GNULIB_STRTOUL@
+GL_M4_GNULIB_STRTOULL = @GL_M4_GNULIB_STRTOULL@
+GL_M4_GNULIB_STRTOUMAX = @GL_M4_GNULIB_STRTOUMAX@
+GL_M4_GNULIB_STRVERSCMP = @GL_M4_GNULIB_STRVERSCMP@
+GL_M4_GNULIB_SYMLINK = @GL_M4_GNULIB_SYMLINK@
+GL_M4_GNULIB_SYMLINKAT = @GL_M4_GNULIB_SYMLINKAT@
+GL_M4_GNULIB_SYSTEM_POSIX = @GL_M4_GNULIB_SYSTEM_POSIX@
+GL_M4_GNULIB_TANF = @GL_M4_GNULIB_TANF@
+GL_M4_GNULIB_TANHF = @GL_M4_GNULIB_TANHF@
+GL_M4_GNULIB_TANL = @GL_M4_GNULIB_TANL@
+GL_M4_GNULIB_TIMEGM = @GL_M4_GNULIB_TIMEGM@
+GL_M4_GNULIB_TIMESPEC_GET = @GL_M4_GNULIB_TIMESPEC_GET@
+GL_M4_GNULIB_TIME_R = @GL_M4_GNULIB_TIME_R@
+GL_M4_GNULIB_TIME_RZ = @GL_M4_GNULIB_TIME_RZ@
+GL_M4_GNULIB_TMPFILE = @GL_M4_GNULIB_TMPFILE@
+GL_M4_GNULIB_TOWCTRANS = @GL_M4_GNULIB_TOWCTRANS@
+GL_M4_GNULIB_TRUNC = @GL_M4_GNULIB_TRUNC@
+GL_M4_GNULIB_TRUNCATE = @GL_M4_GNULIB_TRUNCATE@
+GL_M4_GNULIB_TRUNCF = @GL_M4_GNULIB_TRUNCF@
+GL_M4_GNULIB_TRUNCL = @GL_M4_GNULIB_TRUNCL@
+GL_M4_GNULIB_TTYNAME_R = @GL_M4_GNULIB_TTYNAME_R@
+GL_M4_GNULIB_TZSET = @GL_M4_GNULIB_TZSET@
+GL_M4_GNULIB_UNISTD_H_NONBLOCKING = @GL_M4_GNULIB_UNISTD_H_NONBLOCKING@
+GL_M4_GNULIB_UNISTD_H_SIGPIPE = @GL_M4_GNULIB_UNISTD_H_SIGPIPE@
+GL_M4_GNULIB_UNLINK = @GL_M4_GNULIB_UNLINK@
+GL_M4_GNULIB_UNLINKAT = @GL_M4_GNULIB_UNLINKAT@
+GL_M4_GNULIB_UNLOCKPT = @GL_M4_GNULIB_UNLOCKPT@
+GL_M4_GNULIB_UNSETENV = @GL_M4_GNULIB_UNSETENV@
+GL_M4_GNULIB_USLEEP = @GL_M4_GNULIB_USLEEP@
+GL_M4_GNULIB_UTIMENSAT = @GL_M4_GNULIB_UTIMENSAT@
+GL_M4_GNULIB_VASPRINTF = @GL_M4_GNULIB_VASPRINTF@
+GL_M4_GNULIB_VDPRINTF = @GL_M4_GNULIB_VDPRINTF@
+GL_M4_GNULIB_VFPRINTF = @GL_M4_GNULIB_VFPRINTF@
+GL_M4_GNULIB_VFPRINTF_POSIX = @GL_M4_GNULIB_VFPRINTF_POSIX@
+GL_M4_GNULIB_VFSCANF = @GL_M4_GNULIB_VFSCANF@
+GL_M4_GNULIB_VPRINTF = @GL_M4_GNULIB_VPRINTF@
+GL_M4_GNULIB_VPRINTF_POSIX = @GL_M4_GNULIB_VPRINTF_POSIX@
+GL_M4_GNULIB_VSCANF = @GL_M4_GNULIB_VSCANF@
+GL_M4_GNULIB_VSNPRINTF = @GL_M4_GNULIB_VSNPRINTF@
+GL_M4_GNULIB_VSPRINTF_POSIX = @GL_M4_GNULIB_VSPRINTF_POSIX@
+GL_M4_GNULIB_WAITPID = @GL_M4_GNULIB_WAITPID@
+GL_M4_GNULIB_WCPCPY = @GL_M4_GNULIB_WCPCPY@
+GL_M4_GNULIB_WCPNCPY = @GL_M4_GNULIB_WCPNCPY@
+GL_M4_GNULIB_WCRTOMB = @GL_M4_GNULIB_WCRTOMB@
+GL_M4_GNULIB_WCSCASECMP = @GL_M4_GNULIB_WCSCASECMP@
+GL_M4_GNULIB_WCSCAT = @GL_M4_GNULIB_WCSCAT@
+GL_M4_GNULIB_WCSCHR = @GL_M4_GNULIB_WCSCHR@
+GL_M4_GNULIB_WCSCMP = @GL_M4_GNULIB_WCSCMP@
+GL_M4_GNULIB_WCSCOLL = @GL_M4_GNULIB_WCSCOLL@
+GL_M4_GNULIB_WCSCPY = @GL_M4_GNULIB_WCSCPY@
+GL_M4_GNULIB_WCSCSPN = @GL_M4_GNULIB_WCSCSPN@
+GL_M4_GNULIB_WCSDUP = @GL_M4_GNULIB_WCSDUP@
+GL_M4_GNULIB_WCSFTIME = @GL_M4_GNULIB_WCSFTIME@
+GL_M4_GNULIB_WCSLEN = @GL_M4_GNULIB_WCSLEN@
+GL_M4_GNULIB_WCSNCASECMP = @GL_M4_GNULIB_WCSNCASECMP@
+GL_M4_GNULIB_WCSNCAT = @GL_M4_GNULIB_WCSNCAT@
+GL_M4_GNULIB_WCSNCMP = @GL_M4_GNULIB_WCSNCMP@
+GL_M4_GNULIB_WCSNCPY = @GL_M4_GNULIB_WCSNCPY@
+GL_M4_GNULIB_WCSNLEN = @GL_M4_GNULIB_WCSNLEN@
+GL_M4_GNULIB_WCSNRTOMBS = @GL_M4_GNULIB_WCSNRTOMBS@
+GL_M4_GNULIB_WCSPBRK = @GL_M4_GNULIB_WCSPBRK@
+GL_M4_GNULIB_WCSRCHR = @GL_M4_GNULIB_WCSRCHR@
+GL_M4_GNULIB_WCSRTOMBS = @GL_M4_GNULIB_WCSRTOMBS@
+GL_M4_GNULIB_WCSSPN = @GL_M4_GNULIB_WCSSPN@
+GL_M4_GNULIB_WCSSTR = @GL_M4_GNULIB_WCSSTR@
+GL_M4_GNULIB_WCSTOK = @GL_M4_GNULIB_WCSTOK@
+GL_M4_GNULIB_WCSWIDTH = @GL_M4_GNULIB_WCSWIDTH@
+GL_M4_GNULIB_WCSXFRM = @GL_M4_GNULIB_WCSXFRM@
+GL_M4_GNULIB_WCTOB = @GL_M4_GNULIB_WCTOB@
+GL_M4_GNULIB_WCTOMB = @GL_M4_GNULIB_WCTOMB@
+GL_M4_GNULIB_WCTRANS = @GL_M4_GNULIB_WCTRANS@
+GL_M4_GNULIB_WCTYPE = @GL_M4_GNULIB_WCTYPE@
+GL_M4_GNULIB_WCWIDTH = @GL_M4_GNULIB_WCWIDTH@
+GL_M4_GNULIB_WMEMCHR = @GL_M4_GNULIB_WMEMCHR@
+GL_M4_GNULIB_WMEMCMP = @GL_M4_GNULIB_WMEMCMP@
+GL_M4_GNULIB_WMEMCPY = @GL_M4_GNULIB_WMEMCPY@
+GL_M4_GNULIB_WMEMMOVE = @GL_M4_GNULIB_WMEMMOVE@
+GL_M4_GNULIB_WMEMPCPY = @GL_M4_GNULIB_WMEMPCPY@
+GL_M4_GNULIB_WMEMSET = @GL_M4_GNULIB_WMEMSET@
+GL_M4_GNULIB_WRITE = @GL_M4_GNULIB_WRITE@
+GL_M4_GNULIB__EXIT = @GL_M4_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
-GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
 GNULIB_GL_M4_UNISTD_H_GETOPT = @GNULIB_GL_M4_UNISTD_H_GETOPT@
-GNULIB_GRANTPT = @GNULIB_GRANTPT@
-GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
-GNULIB_HYPOT = @GNULIB_HYPOT@
-GNULIB_HYPOTF = @GNULIB_HYPOTF@
-GNULIB_HYPOTL = @GNULIB_HYPOTL@
-GNULIB_ILOGB = @GNULIB_ILOGB@
-GNULIB_ILOGBF = @GNULIB_ILOGBF@
-GNULIB_ILOGBL = @GNULIB_ILOGBL@
-GNULIB_IMAXABS = @GNULIB_IMAXABS@
-GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
-GNULIB_ISATTY = @GNULIB_ISATTY@
-GNULIB_ISBLANK = @GNULIB_ISBLANK@
-GNULIB_ISFINITE = @GNULIB_ISFINITE@
-GNULIB_ISINF = @GNULIB_ISINF@
-GNULIB_ISNAN = @GNULIB_ISNAN@
-GNULIB_ISNAND = @GNULIB_ISNAND@
-GNULIB_ISNANF = @GNULIB_ISNANF@
-GNULIB_ISNANL = @GNULIB_ISNANL@
-GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
-GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
-GNULIB_LCHMOD = @GNULIB_LCHMOD@
-GNULIB_LCHOWN = @GNULIB_LCHOWN@
-GNULIB_LDEXPF = @GNULIB_LDEXPF@
-GNULIB_LDEXPL = @GNULIB_LDEXPL@
-GNULIB_LINK = @GNULIB_LINK@
-GNULIB_LINKAT = @GNULIB_LINKAT@
-GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
-GNULIB_LOG = @GNULIB_LOG@
-GNULIB_LOG10 = @GNULIB_LOG10@
-GNULIB_LOG10F = @GNULIB_LOG10F@
-GNULIB_LOG10L = @GNULIB_LOG10L@
-GNULIB_LOG1P = @GNULIB_LOG1P@
-GNULIB_LOG1PF = @GNULIB_LOG1PF@
-GNULIB_LOG1PL = @GNULIB_LOG1PL@
-GNULIB_LOG2 = @GNULIB_LOG2@
-GNULIB_LOG2F = @GNULIB_LOG2F@
-GNULIB_LOG2L = @GNULIB_LOG2L@
-GNULIB_LOGB = @GNULIB_LOGB@
-GNULIB_LOGBF = @GNULIB_LOGBF@
-GNULIB_LOGBL = @GNULIB_LOGBL@
-GNULIB_LOGF = @GNULIB_LOGF@
-GNULIB_LOGL = @GNULIB_LOGL@
-GNULIB_LSEEK = @GNULIB_LSEEK@
-GNULIB_LSTAT = @GNULIB_LSTAT@
-GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
-GNULIB_MBRLEN = @GNULIB_MBRLEN@
-GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
-GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
-GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
-GNULIB_MBSCHR = @GNULIB_MBSCHR@
-GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
-GNULIB_MBSINIT = @GNULIB_MBSINIT@
-GNULIB_MBSLEN = @GNULIB_MBSLEN@
-GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
-GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
-GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
-GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
-GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
-GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
-GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
-GNULIB_MBSSEP = @GNULIB_MBSSEP@
-GNULIB_MBSSPN = @GNULIB_MBSSPN@
-GNULIB_MBSSTR = @GNULIB_MBSSTR@
-GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
-GNULIB_MBTOWC = @GNULIB_MBTOWC@
-GNULIB_MEMCHR = @GNULIB_MEMCHR@
-GNULIB_MEMMEM = @GNULIB_MEMMEM@
-GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
-GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
-GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
-GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
-GNULIB_MKFIFO = @GNULIB_MKFIFO@
-GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
-GNULIB_MKNOD = @GNULIB_MKNOD@
-GNULIB_MKNODAT = @GNULIB_MKNODAT@
-GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
-GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
-GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
-GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
-GNULIB_MKTIME = @GNULIB_MKTIME@
-GNULIB_MODF = @GNULIB_MODF@
-GNULIB_MODFF = @GNULIB_MODFF@
-GNULIB_MODFL = @GNULIB_MODFL@
-GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
-GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
-GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
-GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
-GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
-GNULIB_OPEN = @GNULIB_OPEN@
-GNULIB_OPENAT = @GNULIB_OPENAT@
-GNULIB_OPENDIR = @GNULIB_OPENDIR@
-GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@
-GNULIB_PCLOSE = @GNULIB_PCLOSE@
-GNULIB_PERROR = @GNULIB_PERROR@
-GNULIB_PIPE = @GNULIB_PIPE@
-GNULIB_PIPE2 = @GNULIB_PIPE2@
-GNULIB_POPEN = @GNULIB_POPEN@
-GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
-GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@
-GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@
-GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
-GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
-GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@
-GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
-GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
-GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
-GNULIB_POWF = @GNULIB_POWF@
-GNULIB_PREAD = @GNULIB_PREAD@
-GNULIB_PRINTF = @GNULIB_PRINTF@
-GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
-GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
-GNULIB_PTSNAME = @GNULIB_PTSNAME@
-GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
-GNULIB_PUTC = @GNULIB_PUTC@
-GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
-GNULIB_PUTENV = @GNULIB_PUTENV@
-GNULIB_PUTS = @GNULIB_PUTS@
-GNULIB_PWRITE = @GNULIB_PWRITE@
-GNULIB_QSORT_R = @GNULIB_QSORT_R@
-GNULIB_RAISE = @GNULIB_RAISE@
-GNULIB_RANDOM = @GNULIB_RANDOM@
-GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
-GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
-GNULIB_READ = @GNULIB_READ@
-GNULIB_READDIR = @GNULIB_READDIR@
-GNULIB_READLINK = @GNULIB_READLINK@
-GNULIB_READLINKAT = @GNULIB_READLINKAT@
-GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
-GNULIB_REALPATH = @GNULIB_REALPATH@
-GNULIB_REMAINDER = @GNULIB_REMAINDER@
-GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
-GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
-GNULIB_REMOVE = @GNULIB_REMOVE@
-GNULIB_RENAME = @GNULIB_RENAME@
-GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
-GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
-GNULIB_RINT = @GNULIB_RINT@
-GNULIB_RINTF = @GNULIB_RINTF@
-GNULIB_RINTL = @GNULIB_RINTL@
-GNULIB_RMDIR = @GNULIB_RMDIR@
-GNULIB_ROUND = @GNULIB_ROUND@
-GNULIB_ROUNDF = @GNULIB_ROUNDF@
-GNULIB_ROUNDL = @GNULIB_ROUNDL@
-GNULIB_RPMATCH = @GNULIB_RPMATCH@
-GNULIB_SCANDIR = @GNULIB_SCANDIR@
-GNULIB_SCANF = @GNULIB_SCANF@
-GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
-GNULIB_SETENV = @GNULIB_SETENV@
-GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
-GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
-GNULIB_SIGACTION = @GNULIB_SIGACTION@
-GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
-GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
-GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
-GNULIB_SINF = @GNULIB_SINF@
-GNULIB_SINHF = @GNULIB_SINHF@
-GNULIB_SINL = @GNULIB_SINL@
-GNULIB_SLEEP = @GNULIB_SLEEP@
-GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
-GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
-GNULIB_SQRTF = @GNULIB_SQRTF@
-GNULIB_SQRTL = @GNULIB_SQRTL@
-GNULIB_STAT = @GNULIB_STAT@
-GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
-GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
-GNULIB_STPCPY = @GNULIB_STPCPY@
-GNULIB_STPNCPY = @GNULIB_STPNCPY@
-GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
-GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
-GNULIB_STRDUP = @GNULIB_STRDUP@
-GNULIB_STRERROR = @GNULIB_STRERROR@
-GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
-GNULIB_STRNCAT = @GNULIB_STRNCAT@
-GNULIB_STRNDUP = @GNULIB_STRNDUP@
-GNULIB_STRNLEN = @GNULIB_STRNLEN@
-GNULIB_STRPBRK = @GNULIB_STRPBRK@
-GNULIB_STRPTIME = @GNULIB_STRPTIME@
-GNULIB_STRSEP = @GNULIB_STRSEP@
-GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
-GNULIB_STRSTR = @GNULIB_STRSTR@
-GNULIB_STRTOD = @GNULIB_STRTOD@
-GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
-GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
-GNULIB_STRTOLL = @GNULIB_STRTOLL@
-GNULIB_STRTOULL = @GNULIB_STRTOULL@
-GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
-GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
-GNULIB_SYMLINK = @GNULIB_SYMLINK@
-GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
-GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
-GNULIB_TANF = @GNULIB_TANF@
-GNULIB_TANHF = @GNULIB_TANHF@
-GNULIB_TANL = @GNULIB_TANL@
-GNULIB_TIMEGM = @GNULIB_TIMEGM@
-GNULIB_TIME_R = @GNULIB_TIME_R@
-GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
-GNULIB_TMPFILE = @GNULIB_TMPFILE@
-GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
-GNULIB_TRUNC = @GNULIB_TRUNC@
-GNULIB_TRUNCF = @GNULIB_TRUNCF@
-GNULIB_TRUNCL = @GNULIB_TRUNCL@
-GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
-GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
-GNULIB_UNLINK = @GNULIB_UNLINK@
-GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
-GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
-GNULIB_UNSETENV = @GNULIB_UNSETENV@
-GNULIB_USLEEP = @GNULIB_USLEEP@
-GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
-GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
-GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
-GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
-GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
-GNULIB_VFSCANF = @GNULIB_VFSCANF@
-GNULIB_VPRINTF = @GNULIB_VPRINTF@
-GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
-GNULIB_VSCANF = @GNULIB_VSCANF@
-GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
-GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
-GNULIB_WAITPID = @GNULIB_WAITPID@
-GNULIB_WCPCPY = @GNULIB_WCPCPY@
-GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
-GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
-GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
-GNULIB_WCSCAT = @GNULIB_WCSCAT@
-GNULIB_WCSCHR = @GNULIB_WCSCHR@
-GNULIB_WCSCMP = @GNULIB_WCSCMP@
-GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
-GNULIB_WCSCPY = @GNULIB_WCSCPY@
-GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
-GNULIB_WCSDUP = @GNULIB_WCSDUP@
-GNULIB_WCSLEN = @GNULIB_WCSLEN@
-GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
-GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
-GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
-GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
-GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
-GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
-GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
-GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
-GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
-GNULIB_WCSSPN = @GNULIB_WCSSPN@
-GNULIB_WCSSTR = @GNULIB_WCSSTR@
-GNULIB_WCSTOK = @GNULIB_WCSTOK@
-GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
-GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
-GNULIB_WCTOB = @GNULIB_WCTOB@
-GNULIB_WCTOMB = @GNULIB_WCTOMB@
-GNULIB_WCTRANS = @GNULIB_WCTRANS@
-GNULIB_WCTYPE = @GNULIB_WCTYPE@
-GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
-GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
-GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
-GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
-GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
-GNULIB_WMEMSET = @GNULIB_WMEMSET@
-GNULIB_WRITE = @GNULIB_WRITE@
-GNULIB__EXIT = @GNULIB__EXIT@
 GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ACOSF = @HAVE_ACOSF@
 HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ASINF = @HAVE_ASINF@
 HAVE_ASINL = @HAVE_ASINL@
 HAVE_ATAN2F = @HAVE_ATAN2F@
@@ -772,9 +1236,11 @@ HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
 HAVE_COPYSIGN = @HAVE_COPYSIGN@
 HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
 HAVE_COSF = @HAVE_COSF@
 HAVE_COSHF = @HAVE_COSHF@
 HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
 HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
 HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
 HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
@@ -785,13 +1251,17 @@ HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
 HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
 HAVE_DECL_COSL = @HAVE_DECL_COSL@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
 HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
 HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
 HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
 HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
 HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
 HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
 HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
@@ -800,6 +1270,7 @@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
 HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
@@ -810,6 +1281,9 @@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
 HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
 HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
 HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
 HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
@@ -829,6 +1303,7 @@ HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
 HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
 HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
 HAVE_DECL_SINL = @HAVE_DECL_SINL@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
@@ -842,21 +1317,24 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TANL = @HAVE_DECL_TANL@
 HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
-HAVE_DUP2 = @HAVE_DUP2@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
 HAVE_EXPF = @HAVE_EXPF@
 HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
 HAVE_EXPM1 = @HAVE_EXPM1@
 HAVE_EXPM1F = @HAVE_EXPM1F@
 HAVE_FABSF = @HAVE_FABSF@
@@ -876,6 +1354,7 @@ HAVE_FMAF = @HAVE_FMAF@
 HAVE_FMAL = @HAVE_FMAL@
 HAVE_FMODF = @HAVE_FMODF@
 HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
 HAVE_FREXPF = @HAVE_FREXPF@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
@@ -884,13 +1363,17 @@ HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
 HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
 HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETRANDOM = @HAVE_GETRANDOM@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GETUMASK = @HAVE_GETUMASK@
 HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_HYPOTF = @HAVE_HYPOTF@
@@ -898,6 +1381,8 @@ HAVE_HYPOTL = @HAVE_HYPOTL@
 HAVE_ILOGB = @HAVE_ILOGB@
 HAVE_ILOGBF = @HAVE_ILOGBF@
 HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISNAND = @HAVE_ISNAND@
@@ -905,6 +1390,7 @@ HAVE_ISNANF = @HAVE_ISNANF@
 HAVE_ISNANL = @HAVE_ISNANL@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
 HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
 HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
 HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
@@ -925,7 +1411,6 @@ HAVE_LOGBF = @HAVE_LOGBF@
 HAVE_LOGBL = @HAVE_LOGBL@
 HAVE_LOGF = @HAVE_LOGF@
 HAVE_LOGL = @HAVE_LOGL@
-HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
 HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
 HAVE_MBRLEN = @HAVE_MBRLEN@
@@ -934,7 +1419,7 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
 HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
-HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MBTOWC = @HAVE_MBTOWC@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
 HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
@@ -950,6 +1435,8 @@ HAVE_MODFF = @HAVE_MODFF@
 HAVE_MODFL = @HAVE_MODFL@
 HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OPENDIR = @HAVE_OPENDIR@
@@ -958,14 +1445,76 @@ HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@
 HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PSELECT = @HAVE_PSELECT@
+HAVE_PTHREAD_ATTR_DESTROY = @HAVE_PTHREAD_ATTR_DESTROY@
+HAVE_PTHREAD_ATTR_GETDETACHSTATE = @HAVE_PTHREAD_ATTR_GETDETACHSTATE@
+HAVE_PTHREAD_ATTR_INIT = @HAVE_PTHREAD_ATTR_INIT@
+HAVE_PTHREAD_ATTR_SETDETACHSTATE = @HAVE_PTHREAD_ATTR_SETDETACHSTATE@
+HAVE_PTHREAD_CONDATTR_DESTROY = @HAVE_PTHREAD_CONDATTR_DESTROY@
+HAVE_PTHREAD_CONDATTR_INIT = @HAVE_PTHREAD_CONDATTR_INIT@
+HAVE_PTHREAD_COND_BROADCAST = @HAVE_PTHREAD_COND_BROADCAST@
+HAVE_PTHREAD_COND_DESTROY = @HAVE_PTHREAD_COND_DESTROY@
+HAVE_PTHREAD_COND_INIT = @HAVE_PTHREAD_COND_INIT@
+HAVE_PTHREAD_COND_SIGNAL = @HAVE_PTHREAD_COND_SIGNAL@
+HAVE_PTHREAD_COND_TIMEDWAIT = @HAVE_PTHREAD_COND_TIMEDWAIT@
+HAVE_PTHREAD_COND_WAIT = @HAVE_PTHREAD_COND_WAIT@
+HAVE_PTHREAD_CREATE = @HAVE_PTHREAD_CREATE@
+HAVE_PTHREAD_CREATE_DETACHED = @HAVE_PTHREAD_CREATE_DETACHED@
+HAVE_PTHREAD_DETACH = @HAVE_PTHREAD_DETACH@
+HAVE_PTHREAD_EQUAL = @HAVE_PTHREAD_EQUAL@
+HAVE_PTHREAD_EXIT = @HAVE_PTHREAD_EXIT@
+HAVE_PTHREAD_GETSPECIFIC = @HAVE_PTHREAD_GETSPECIFIC@
+HAVE_PTHREAD_H = @HAVE_PTHREAD_H@
+HAVE_PTHREAD_JOIN = @HAVE_PTHREAD_JOIN@
+HAVE_PTHREAD_KEY_CREATE = @HAVE_PTHREAD_KEY_CREATE@
+HAVE_PTHREAD_KEY_DELETE = @HAVE_PTHREAD_KEY_DELETE@
+HAVE_PTHREAD_MUTEXATTR_DESTROY = @HAVE_PTHREAD_MUTEXATTR_DESTROY@
+HAVE_PTHREAD_MUTEXATTR_GETROBUST = @HAVE_PTHREAD_MUTEXATTR_GETROBUST@
+HAVE_PTHREAD_MUTEXATTR_GETTYPE = @HAVE_PTHREAD_MUTEXATTR_GETTYPE@
+HAVE_PTHREAD_MUTEXATTR_INIT = @HAVE_PTHREAD_MUTEXATTR_INIT@
+HAVE_PTHREAD_MUTEXATTR_SETROBUST = @HAVE_PTHREAD_MUTEXATTR_SETROBUST@
+HAVE_PTHREAD_MUTEXATTR_SETTYPE = @HAVE_PTHREAD_MUTEXATTR_SETTYPE@
+HAVE_PTHREAD_MUTEX_DESTROY = @HAVE_PTHREAD_MUTEX_DESTROY@
+HAVE_PTHREAD_MUTEX_INIT = @HAVE_PTHREAD_MUTEX_INIT@
+HAVE_PTHREAD_MUTEX_LOCK = @HAVE_PTHREAD_MUTEX_LOCK@
+HAVE_PTHREAD_MUTEX_RECURSIVE = @HAVE_PTHREAD_MUTEX_RECURSIVE@
+HAVE_PTHREAD_MUTEX_ROBUST = @HAVE_PTHREAD_MUTEX_ROBUST@
+HAVE_PTHREAD_MUTEX_TIMEDLOCK = @HAVE_PTHREAD_MUTEX_TIMEDLOCK@
+HAVE_PTHREAD_MUTEX_TRYLOCK = @HAVE_PTHREAD_MUTEX_TRYLOCK@
+HAVE_PTHREAD_MUTEX_UNLOCK = @HAVE_PTHREAD_MUTEX_UNLOCK@
+HAVE_PTHREAD_ONCE = @HAVE_PTHREAD_ONCE@
+HAVE_PTHREAD_PROCESS_SHARED = @HAVE_PTHREAD_PROCESS_SHARED@
+HAVE_PTHREAD_RWLOCKATTR_DESTROY = @HAVE_PTHREAD_RWLOCKATTR_DESTROY@
+HAVE_PTHREAD_RWLOCKATTR_INIT = @HAVE_PTHREAD_RWLOCKATTR_INIT@
+HAVE_PTHREAD_RWLOCK_DESTROY = @HAVE_PTHREAD_RWLOCK_DESTROY@
+HAVE_PTHREAD_RWLOCK_INIT = @HAVE_PTHREAD_RWLOCK_INIT@
+HAVE_PTHREAD_RWLOCK_RDLOCK = @HAVE_PTHREAD_RWLOCK_RDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+HAVE_PTHREAD_RWLOCK_TRYRDLOCK = @HAVE_PTHREAD_RWLOCK_TRYRDLOCK@
+HAVE_PTHREAD_RWLOCK_TRYWRLOCK = @HAVE_PTHREAD_RWLOCK_TRYWRLOCK@
+HAVE_PTHREAD_RWLOCK_UNLOCK = @HAVE_PTHREAD_RWLOCK_UNLOCK@
+HAVE_PTHREAD_RWLOCK_WRLOCK = @HAVE_PTHREAD_RWLOCK_WRLOCK@
+HAVE_PTHREAD_SELF = @HAVE_PTHREAD_SELF@
+HAVE_PTHREAD_SETSPECIFIC = @HAVE_PTHREAD_SETSPECIFIC@
 HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
+HAVE_PTHREAD_SPINLOCK_T = @HAVE_PTHREAD_SPINLOCK_T@
+HAVE_PTHREAD_SPIN_DESTROY = @HAVE_PTHREAD_SPIN_DESTROY@
+HAVE_PTHREAD_SPIN_INIT = @HAVE_PTHREAD_SPIN_INIT@
+HAVE_PTHREAD_SPIN_LOCK = @HAVE_PTHREAD_SPIN_LOCK@
+HAVE_PTHREAD_SPIN_TRYLOCK = @HAVE_PTHREAD_SPIN_TRYLOCK@
+HAVE_PTHREAD_SPIN_UNLOCK = @HAVE_PTHREAD_SPIN_UNLOCK@
+HAVE_PTHREAD_T = @HAVE_PTHREAD_T@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
@@ -978,6 +1527,7 @@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READDIR = @HAVE_READDIR@
 HAVE_READLINK = @HAVE_READLINK@
 HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
 HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_REMAINDER = @HAVE_REMAINDER@
 HAVE_REMAINDERF = @HAVE_REMAINDERF@
@@ -987,12 +1537,17 @@ HAVE_RINT = @HAVE_RINT@
 HAVE_RINTL = @HAVE_RINTL@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SCHED_H = @HAVE_SCHED_H@
+HAVE_SCHED_YIELD = @HAVE_SCHED_YIELD@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
 HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
 HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
 HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
@@ -1011,15 +1566,21 @@ HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
 HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRPTIME = @HAVE_STRPTIME@
 HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
 HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@
 HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -1027,24 +1588,30 @@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@
+HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
 HAVE_TANF = @HAVE_TANF@
 HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
 HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
-HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
 HAVE_USLEEP = @HAVE_USLEEP@
 HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
 HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCPCPY = @HAVE_WCPCPY@
@@ -1058,6 +1625,7 @@ HAVE_WCSCOLL = @HAVE_WCSCOLL@
 HAVE_WCSCPY = @HAVE_WCSCPY@
 HAVE_WCSCSPN = @HAVE_WCSCSPN@
 HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
 HAVE_WCSLEN = @HAVE_WCSLEN@
 HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
 HAVE_WCSNCAT = @HAVE_WCSNCAT@
@@ -1082,12 +1650,19 @@ HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
 HAVE_WMEMCPY = @HAVE_WMEMCPY@
 HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
 HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
+HOST_CPU = @HOST_CPU@
+HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -1095,34 +1670,55 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
 INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LIBCSTACK = @LIBCSTACK@
+LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM4_LIBDEPS = @LIBM4_LIBDEPS@
 LIBM4_LTLIBDEPS = @LIBM4_LTLIBDEPS@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
-LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBSIGSEGV = @LIBSIGSEGV@
 LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
 LIBTHREAD = @LIBTHREAD@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_GETRANDOM = @LIB_GETRANDOM@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
 LIB_POSIX_SPAWN = @LIB_POSIX_SPAWN@
+LIB_PTHREAD = @LIB_PTHREAD@
+LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SELECT = @LIB_SELECT@
+LIB_SEMAPHORE = @LIB_SEMAPHORE@
+LIB_SETLOCALE = @LIB_SETLOCALE@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
 LIMITS_H = @LIMITS_H@
 LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
 LOCALE_FR = @LOCALE_FR@
 LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
 LOCALE_JA = @LOCALE_JA@
 LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
 LOCALE_ZH_CN = @LOCALE_ZH_CN@
 LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
-LTLIBPTH = @LTLIBPTH@
 LTLIBSIGSEGV = @LTLIBSIGSEGV@
 LTLIBTHREAD = @LTLIBTHREAD@
 M4_LIBOBJS = @M4_LIBOBJS@
@@ -1132,17 +1728,26 @@ M4tests_LTLIBOBJS = @M4tests_LTLIBOBJS@
 M4tests_WITNESS = @M4tests_WITNESS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
 NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@
 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H = @NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H@
 NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@
 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
 NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@
@@ -1152,9 +1757,14 @@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
 NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
@@ -1166,11 +1776,14 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FCNTL_H = @NEXT_FCNTL_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
 NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_PTHREAD_H = @NEXT_PTHREAD_H@
 NEXT_SCHED_H = @NEXT_SCHED_H@
 NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_SPAWN_H = @NEXT_SPAWN_H@
@@ -1180,9 +1793,14 @@ NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@
+NEXT_SYS_RANDOM_H = @NEXT_SYS_RANDOM_H@
+NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
 NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
 NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -1198,14 +1816,16 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
 PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
 PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PRIPTR_PREFIX = @PRIPTR_PREFIX@
-PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
 PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
+REPLACE_ACCESS = @REPLACE_ACCESS@
 REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
 REPLACE_ASINF = @REPLACE_ASINF@
 REPLACE_ATAN2F = @REPLACE_ATAN2F@
 REPLACE_ATANF = @REPLACE_ATANF@
@@ -1222,23 +1842,37 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
 REPLACE_COSF = @REPLACE_COSF@
 REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
 REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
 REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
 REPLACE_EXP2 = @REPLACE_EXP2@
 REPLACE_EXP2L = @REPLACE_EXP2L@
 REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
 REPLACE_EXPM1 = @REPLACE_EXPM1@
 REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
 REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
 REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
 REPLACE_FLOOR = @REPLACE_FLOOR@
 REPLACE_FLOORF = @REPLACE_FLOORF@
 REPLACE_FLOORL = @REPLACE_FLOORL@
@@ -1251,6 +1885,8 @@ REPLACE_FMODL = @REPLACE_FMODL@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FREXP = @REPLACE_FREXP@
 REPLACE_FREXPF = @REPLACE_FREXPF@
@@ -1271,20 +1907,32 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
 REPLACE_HYPOT = @REPLACE_HYPOT@
 REPLACE_HYPOTF = @REPLACE_HYPOTF@
 REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
 REPLACE_ILOGB = @REPLACE_ILOGB@
 REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_IOCTL = @REPLACE_IOCTL@
 REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISFINITE = @REPLACE_ISFINITE@
 REPLACE_ISINF = @REPLACE_ISINF@
 REPLACE_ISNAN = @REPLACE_ISNAN@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
 REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LDEXPL = @REPLACE_LDEXPL@
@@ -1322,7 +1970,9 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@
 REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
 REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
 REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
 REPLACE_MKTIME = @REPLACE_MKTIME@
 REPLACE_MODF = @REPLACE_MODF@
@@ -1330,6 +1980,7 @@ REPLACE_MODFF = @REPLACE_MODFF@
 REPLACE_MODFL = @REPLACE_MODFL@
 REPLACE_NAN = @REPLACE_NAN@
 REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
 REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
 REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
@@ -1338,24 +1989,81 @@ REPLACE_OPENAT = @REPLACE_OPENAT@
 REPLACE_OPENDIR = @REPLACE_OPENDIR@
 REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
 REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PSELECT = @REPLACE_PSELECT@
+REPLACE_PTHREAD_ATTR_DESTROY = @REPLACE_PTHREAD_ATTR_DESTROY@
+REPLACE_PTHREAD_ATTR_GETDETACHSTATE = @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@
+REPLACE_PTHREAD_ATTR_INIT = @REPLACE_PTHREAD_ATTR_INIT@
+REPLACE_PTHREAD_ATTR_SETDETACHSTATE = @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@
+REPLACE_PTHREAD_CONDATTR_DESTROY = @REPLACE_PTHREAD_CONDATTR_DESTROY@
+REPLACE_PTHREAD_CONDATTR_INIT = @REPLACE_PTHREAD_CONDATTR_INIT@
+REPLACE_PTHREAD_COND_BROADCAST = @REPLACE_PTHREAD_COND_BROADCAST@
+REPLACE_PTHREAD_COND_DESTROY = @REPLACE_PTHREAD_COND_DESTROY@
+REPLACE_PTHREAD_COND_INIT = @REPLACE_PTHREAD_COND_INIT@
+REPLACE_PTHREAD_COND_SIGNAL = @REPLACE_PTHREAD_COND_SIGNAL@
+REPLACE_PTHREAD_COND_TIMEDWAIT = @REPLACE_PTHREAD_COND_TIMEDWAIT@
+REPLACE_PTHREAD_COND_WAIT = @REPLACE_PTHREAD_COND_WAIT@
+REPLACE_PTHREAD_CREATE = @REPLACE_PTHREAD_CREATE@
+REPLACE_PTHREAD_DETACH = @REPLACE_PTHREAD_DETACH@
+REPLACE_PTHREAD_EQUAL = @REPLACE_PTHREAD_EQUAL@
+REPLACE_PTHREAD_EXIT = @REPLACE_PTHREAD_EXIT@
+REPLACE_PTHREAD_GETSPECIFIC = @REPLACE_PTHREAD_GETSPECIFIC@
+REPLACE_PTHREAD_JOIN = @REPLACE_PTHREAD_JOIN@
+REPLACE_PTHREAD_KEY_CREATE = @REPLACE_PTHREAD_KEY_CREATE@
+REPLACE_PTHREAD_KEY_DELETE = @REPLACE_PTHREAD_KEY_DELETE@
+REPLACE_PTHREAD_MUTEXATTR_DESTROY = @REPLACE_PTHREAD_MUTEXATTR_DESTROY@
+REPLACE_PTHREAD_MUTEXATTR_GETROBUST = @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_GETTYPE = @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@
+REPLACE_PTHREAD_MUTEXATTR_INIT = @REPLACE_PTHREAD_MUTEXATTR_INIT@
+REPLACE_PTHREAD_MUTEXATTR_SETROBUST = @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_SETTYPE = @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@
+REPLACE_PTHREAD_MUTEX_DESTROY = @REPLACE_PTHREAD_MUTEX_DESTROY@
+REPLACE_PTHREAD_MUTEX_INIT = @REPLACE_PTHREAD_MUTEX_INIT@
+REPLACE_PTHREAD_MUTEX_LOCK = @REPLACE_PTHREAD_MUTEX_LOCK@
+REPLACE_PTHREAD_MUTEX_TIMEDLOCK = @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@
+REPLACE_PTHREAD_MUTEX_TRYLOCK = @REPLACE_PTHREAD_MUTEX_TRYLOCK@
+REPLACE_PTHREAD_MUTEX_UNLOCK = @REPLACE_PTHREAD_MUTEX_UNLOCK@
+REPLACE_PTHREAD_ONCE = @REPLACE_PTHREAD_ONCE@
+REPLACE_PTHREAD_RWLOCKATTR_DESTROY = @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@
+REPLACE_PTHREAD_RWLOCKATTR_INIT = @REPLACE_PTHREAD_RWLOCKATTR_INIT@
+REPLACE_PTHREAD_RWLOCK_DESTROY = @REPLACE_PTHREAD_RWLOCK_DESTROY@
+REPLACE_PTHREAD_RWLOCK_INIT = @REPLACE_PTHREAD_RWLOCK_INIT@
+REPLACE_PTHREAD_RWLOCK_RDLOCK = @REPLACE_PTHREAD_RWLOCK_RDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYRDLOCK = @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYWRLOCK = @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@
+REPLACE_PTHREAD_RWLOCK_UNLOCK = @REPLACE_PTHREAD_RWLOCK_UNLOCK@
+REPLACE_PTHREAD_RWLOCK_WRLOCK = @REPLACE_PTHREAD_RWLOCK_WRLOCK@
+REPLACE_PTHREAD_SELF = @REPLACE_PTHREAD_SELF@
+REPLACE_PTHREAD_SETSPECIFIC = @REPLACE_PTHREAD_SETSPECIFIC@
 REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
+REPLACE_PTHREAD_SPIN_DESTROY = @REPLACE_PTHREAD_SPIN_DESTROY@
+REPLACE_PTHREAD_SPIN_INIT = @REPLACE_PTHREAD_SPIN_INIT@
+REPLACE_PTHREAD_SPIN_LOCK = @REPLACE_PTHREAD_SPIN_LOCK@
+REPLACE_PTHREAD_SPIN_TRYLOCK = @REPLACE_PTHREAD_SPIN_TRYLOCK@
+REPLACE_PTHREAD_SPIN_UNLOCK = @REPLACE_PTHREAD_SPIN_UNLOCK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
 REPLACE_RAISE = @REPLACE_RAISE@
+REPLACE_RANDOM = @REPLACE_RANDOM@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_READLINKAT = @REPLACE_READLINKAT@
 REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
 REPLACE_REALPATH = @REPLACE_REALPATH@
 REPLACE_REMAINDER = @REPLACE_REMAINDER@
 REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
@@ -1363,14 +2071,18 @@ REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
 REPLACE_REMOVE = @REPLACE_REMOVE@
 REPLACE_RENAME = @REPLACE_RENAME@
 REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
 REPLACE_RMDIR = @REPLACE_RMDIR@
 REPLACE_ROUND = @REPLACE_ROUND@
 REPLACE_ROUNDF = @REPLACE_ROUNDF@
 REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SCHED_YIELD = @REPLACE_SCHED_YIELD@
+REPLACE_SELECT = @REPLACE_SELECT@
 REPLACE_SETENV = @REPLACE_SETENV@
 REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
 REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
-REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
 REPLACE_SINF = @REPLACE_SINF@
 REPLACE_SINHF = @REPLACE_SINHF@
 REPLACE_SLEEP = @REPLACE_SLEEP@
@@ -1386,7 +2098,9 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
 REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
 REPLACE_STRNCAT = @REPLACE_STRNCAT@
 REPLACE_STRNDUP = @REPLACE_STRNDUP@
 REPLACE_STRNLEN = @REPLACE_STRNLEN@
@@ -1395,6 +2109,11 @@ REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
 REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
 REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
 REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
 REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
@@ -1406,9 +2125,11 @@ REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
 REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
 REPLACE_TRUNCF = @REPLACE_TRUNCF@
 REPLACE_TRUNCL = @REPLACE_TRUNCL@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
 REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -1421,17 +2142,19 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
 REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
 REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCTOMB = @REPLACE_WCTOMB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 REPLACE_WRITE = @REPLACE_WRITE@
-SCHED_H = @SCHED_H@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIGSEGV_H = @SIGSEGV_H@
 SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
 SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 STDALIGN_H = @STDALIGN_H@
@@ -1440,27 +2163,37 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
 UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
 UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
 WERROR_CFLAGS = @WERROR_CFLAGS@
 WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
 WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+YIELD_LIB = @YIELD_LIB@
 abs_aux_dir = @abs_aux_dir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 am__include = @am__include@
@@ -1510,171 +2243,245 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-BUILT_SOURCES = $(ALLOCA_H) configmake.h $(ERRNO_H) fcntl.h $(FLOAT_H) \
-       $(GETOPT_H) langinfo.h $(LIMITS_H) locale.h math.h $(SCHED_H) \
-       signal.h arg-nonnull.h c++defs.h unused-parameter.h \
-       warn-on-use.h spawn.h $(STDARG_H) $(STDBOOL_H) $(STDDEF_H) \
-       $(STDINT_H) stdio.h stdlib.h string.h sys/stat.h sys/time.h \
-       sys/types.h sys/wait.h time.h unistd.h wchar.h wctype.h
-CLEANFILES = configmake.h configmake.h-t charset.alias ref-add.sed \
-       ref-del.sed
-EXTRA_DIST = alignof.h alloca.in.h \
-       $(top_srcdir)/build-aux/announce-gen btowc.c c-strcaseeq.h \
-       canonicalize-lgpl.c cloexec.h close.c close-stream.h closein.h \
-       closeout.h stripslash.c dirname.h \
-       $(top_srcdir)/build-aux/do-release-commit-and-tag dosname.h \
-       dup2.c errno.in.h error.c error.h exitfail.h fclose.c fcntl.c \
-       fcntl.in.h fd-hook.h fflush.c stdio-impl.h filenamecat.h \
-       float.c float.in.h itold.c fopen.c stdio--.h stdio-safer.h \
-       fpending.c fpending.h stdio-impl.h fpucw.h fpurge.c \
-       stdio-impl.h freadahead.c freadahead.h stdio-impl.h freading.h \
-       stdio-impl.h frexp.c frexp.c frexpl.c fseek.c fseeko.c \
-       stdio-impl.h fstat.c ftell.c ftello.c stdio-impl.h \
-       $(top_srcdir)/build-aux/gendocs.sh getdtablesize.c getopt.c \
-       getopt.in.h getopt1.c getopt_int.h gettimeofday.c \
+BUILT_SOURCES = $(ALLOCA_H) configmake.h dirent.h $(ERRNO_H) fcntl.h \
+       $(FLOAT_H) $(GETOPT_H) $(GETOPT_CDEFS_H) $(ICONV_H) \
+       iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h \
+       iconv_open-osf.h iconv_open-solaris.h iconv_open-zos.h \
+       inttypes.h langinfo.h $(LIMITS_H) locale.h math.h sched.h \
+       signal.h $(SIGSEGV_H) spawn.h $(STDALIGN_H) $(STDARG_H) \
+       $(STDBOOL_H) $(STDDEF_H) $(STDINT_H) stdio.h stdlib.h string.h \
+       sys/random.h sys/stat.h sys/types.h sys/wait.h time.h unistd.h \
+       $(LIBUNISTRING_UNISTR_H) $(LIBUNISTRING_UNITYPES_H) \
+       $(LIBUNISTRING_UNIWIDTH_H) wchar.h wctype.h
+CLEANFILES = configmake.h configmake.h-t
+EXTRA_DIST = access.c alignof.h alloca.in.h \
+       $(top_srcdir)/build-aux/announce-gen assure.h asyncsafe-spin.h \
+       attribute.h basename-lgpl.h btowc.c c-strcaseeq.h calloc.c \
+       calloc.c canonicalize.h canonicalize-lgpl.c chdir-long.c \
+       chdir-long.h clean-temp-private.h cloexec.h close.c \
+       close-stream.h closedir.c dirent-private.h closein.h \
+       closeout.h concat-filename.h dirent.in.h dirfd.c stripslash.c \
+       dirname.h $(top_srcdir)/build-aux/do-release-commit-and-tag \
+       dup.c dup2.c dynarray.h malloc/dynarray-skeleton.c \
+       malloc/dynarray.h eloop-threshold.h errno.in.h error.c error.h \
+       exitfail.h fchdir.c fclose.c fcntl.c fcntl.in.h fd-hook.h \
+       fdopendir.c fflush.c stdio-impl.h file-set.h filename.h \
+       filenamecat.h flexmember.h float.c float.in.h itold.c fopen.c \
+       fopen.c stdio--.h stdio-safer.h fpending.c fpending.h \
+       stdio-impl.h fpucw.h fpurge.c stdio-impl.h freadahead.c \
+       freadahead.h stdio-impl.h freading.h stdio-impl.h free.c \
+       frexp.c frexp.c frexpl.c fseek.c fseeko.c stdio-impl.h fstat.c \
+       stat-w32.c stat-w32.h at-func.c fstatat.c ftell.c ftello.c \
+       stdio-impl.h $(top_srcdir)/build-aux/gendocs.sh getcwd.c \
+       getcwd-lgpl.c getdtablesize.c getopt-cdefs.in.h getopt-core.h \
+       getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.c \
+       getopt.in.h getopt1.c getopt_int.h getpagesize.c getrandom.c \
        $(top_srcdir)/build-aux/git-version-gen \
        $(top_srcdir)/build-aux/gitlog-to-changelog \
        $(top_srcdir)/build-aux/gnu-web-doc-update \
        $(top_srcdir)/GNUmakefile $(top_srcdir)/build-aux/gnupload \
-       hard-locale.h $(top_srcdir)/build-aux/config.rpath \
-       ignore-value.h intprops.h float+.h isnan.c isnand-nolibm.h \
-       isnand.c float+.h isnan.c isnanf-nolibm.h isnanf.c float+.h \
-       isnan.c isnanl-nolibm.h isnanl.c langinfo.in.h limits.in.h \
-       config.charset ref-add.sin ref-del.sin locale.in.h \
-       localeconv.c lseek.c lstat.c $(top_srcdir)/maint.mk malloc.c \
-       malloca.h malloca.valgrind math.in.h mbrtowc.c mbsinit.c \
+       hard-locale.h hash.h hash-triple.h \
+       $(top_srcdir)/build-aux/config.rpath iconv.in.h \
+       iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h \
+       iconv_open-osf.h iconv_open-solaris.h iconv_open-zos.h iconv.c \
+       iconv_close.c iconv_open-aix.gperf iconv_open-hpux.gperf \
+       iconv_open-irix.gperf iconv_open-osf.gperf \
+       iconv_open-solaris.gperf iconv_open-zos.gperf iconv_open.c \
+       ignore-value.h intprops.h inttypes.in.h float+.h isnan.c \
+       isnand-nolibm.h isnand.c float+.h isnan.c isnanf-nolibm.h \
+       isnanf.c float+.h isnan.c isnanl-nolibm.h isnanl.c iswblank.c \
+       iswdigit.c iswxdigit.c langinfo.in.h cdefs.h libc-config.h \
+       limits.in.h localcharset.h locale.in.h localeconv.c \
+       localename-table.h localename.h lseek.c lstat.c \
+       $(top_srcdir)/maint.mk malloc.c malloc.c malloca.h math.in.h \
+       mbchar.h lc-charset-dispatch.c lc-charset-dispatch.h \
+       mbrtowc-impl-utf8.h mbrtowc-impl.h mbrtowc.c mbtowc-lock.c \
+       mbtowc-lock.h windows-initguard.h mbsinit.c str-kmp.h \
        mbtowc-impl.h mbtowc.c memchr.c memchr.valgrind \
-       memchr2.valgrind mkdtemp.c mkstemp.c msvc-inval.c msvc-inval.h \
-       msvc-nothrow.c msvc-nothrow.h nl_langinfo.c obstack.c \
-       obstack.h open.c pathmax.h spawn_int.h spawni.c \
+       memchr2.valgrind mempcpy.c memrchr.c mkdir.c mkdtemp.c \
+       mkstemp.c msvc-inval.c msvc-inval.h msvc-nothrow.c \
+       msvc-nothrow.h nl_langinfo-lock.c nl_langinfo.c \
+       windows-initguard.h obstack.c obstack.h open.c openat.c \
+       openat.h dirent-private.h opendir.c pathmax.h pipe.c spawn.c \
+       spawn_int.h spawni.c spawn_faction_addchdir.c spawn_int.h \
        spawn_faction_addclose.c spawn_int.h spawn_faction_adddup2.c \
        spawn_int.h spawn_faction_addopen.c spawn_int.h \
        spawn_faction_destroy.c spawn_faction_init.c spawn_int.h \
        spawnattr_destroy.c spawnattr_init.c spawnattr_setflags.c \
-       spawnattr_setsigmask.c spawnp.c printf-frexp.h printf-frexp.c \
-       printf-frexpl.h quote.h quotearg.h raise.c rawmemchr.c \
-       rawmemchr.valgrind readlink.c regcomp.c regex.c regex.h \
-       regex_internal.c regex_internal.h regexec.c rename.c rmdir.c \
-       same-inode.h sched.in.h secure_getenv.c sig-handler.h \
-       sigaction.c signal.in.h float+.h signbitd.c signbitf.c \
-       signbitl.c stdio-write.c sigprocmask.c \
-       $(top_srcdir)/build-aux/snippet/_Noreturn.h \
-       $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
-       $(top_srcdir)/build-aux/snippet/c++defs.h \
-       $(top_srcdir)/build-aux/snippet/unused-parameter.h \
-       $(top_srcdir)/build-aux/snippet/warn-on-use.h snprintf.c \
-       spawn.in.h stat.c stdarg.in.h stdbool.in.h stddef.in.h \
-       stdint.in.h stdio.in.h stdlib.in.h stdlib--.h stdlib-safer.h \
-       strchrnul.c strchrnul.valgrind streq.h strerror.c \
+       spawnattr_setpgroup.c spawnattr_setsigmask.c spawnp.c \
+       printf-frexp.h printf-frexp.c printf-frexpl.h quote.h \
+       quotearg.h raise.c rawmemchr.c rawmemchr.valgrind \
+       dirent-private.h readdir.c readlink.c realloc.c realloc.c \
+       reallocarray.c regcomp.c regex.c regex.h regex_internal.c \
+       regex_internal.h regexec.c rename.c dirent-private.h \
+       rewinddir.c rmdir.c same-inode.h save-cwd.h sched.in.h \
+       malloc/scratch_buffer.h scratch_buffer.h secure_getenv.c \
+       setlocale.c setlocale-lock.c setlocale_null.h \
+       windows-initguard.h sig-handler.h sigaction.c signal.in.h \
+       float+.h signbitd.c signbitf.c signbitl.c stdio-write.c \
+       sigprocmask.c sigsegv.in.h stackvma.h _Noreturn.h \
+       arg-nonnull.h c++defs.h unused-parameter.h warn-on-use.h \
+       snprintf.c spawn.in.h os2-spawn.c os2-spawn.h stat-w32.c \
+       stat-w32.h stat.c stat-time.h stdalign.in.h stdarg.in.h \
+       stdbool.in.h stddef.in.h stdint.in.h stdio.in.h stdlib.in.h \
+       stdlib--.h stdlib-safer.h stpcpy.c strchrnul.c \
+       strchrnul.valgrind strdup.c streq.h strerror.c \
        strerror-override.c strerror-override.h string.in.h strndup.c \
-       strnlen.c siglist.h strsignal.c str-two-way.h strstr.c \
-       strtod.c sys_stat.in.h sys_time.in.h sys_types.in.h \
-       sys_wait.in.h tempname.h $(top_srcdir)/build-aux/config.rpath \
-       time.in.h unistd.in.h unistd--.h unistd-safer.h unlocked-io.h \
-       $(top_srcdir)/build-aux/update-copyright \
+       strnlen.c siglist.h strsignal.c strstr.c str-two-way.h \
+       strstr.c strtod.c sys_random.in.h sys_stat.in.h sys_types.in.h \
+       sys_wait.in.h tempname.h thread-optim.h time.in.h trim.h \
+       unistd.in.h unistd--.h unistd-safer.h unistr.in.h \
+       unitypes.in.h localcharset.h uniwidth.in.h uniwidth/cjk.h \
+       unlocked-io.h $(top_srcdir)/build-aux/update-copyright \
        $(top_srcdir)/build-aux/useless-if-before-free asnprintf.c \
        float+.h printf-args.c printf-args.h printf-parse.c \
        printf-parse.h vasnprintf.c vasnprintf.h asprintf.c \
        vasprintf.c $(top_srcdir)/build-aux/vc-list-files verify.h \
-       waitpid.c wchar.in.h wcrtomb.c wctype.in.h xalloc.h \
-       xalloc-oversized.h xmalloca.h xalloc.h
-MOSTLYCLEANDIRS = sys sys
-MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t errno.h \
-       errno.h-t fcntl.h fcntl.h-t float.h float.h-t getopt.h \
-       getopt.h-t langinfo.h langinfo.h-t limits.h limits.h-t \
-       locale.h locale.h-t math.h math.h-t sched.h sched.h-t signal.h \
-       signal.h-t arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \
-       unused-parameter.h unused-parameter.h-t warn-on-use.h \
-       warn-on-use.h-t spawn.h spawn.h-t stdarg.h stdarg.h-t \
-       stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h stdint.h-t \
-       stdio.h stdio.h-t stdlib.h stdlib.h-t string.h string.h-t \
-       sys/stat.h sys/stat.h-t sys/time.h sys/time.h-t sys/types.h \
-       sys/types.h-t sys/wait.h sys/wait.h-t time.h time.h-t unistd.h \
-       unistd.h-t wchar.h wchar.h-t wctype.h wctype.h-t
-SUFFIXES = .sed .sin
+       waitpid.c wchar.in.h wcrtomb.c wctype.in.h wcwidth.c \
+       windows-initguard.h windows-mutex.c windows-mutex.h \
+       windows-once.c windows-once.h windows-initguard.h \
+       windows-recmutex.c windows-recmutex.h windows-initguard.h \
+       windows-rwlock.c windows-rwlock.h windows-spawn.c \
+       windows-spawn.h windows-spin.c windows-spin.h windows-tls.c \
+       windows-tls.h xalloc.h xalloc.h xalloc-oversized.h xmalloca.h \
+       xalloc.h
+MAINTAINERCLEANFILES = iconv_open-aix.h iconv_open-hpux.h \
+       iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h \
+       iconv_open-zos.h
+MOSTLYCLEANDIRS = sys sys sys
+MOSTLYCLEANFILES = core *.stackdump alloca.h alloca.h-t dirent.h \
+       dirent.h-t errno.h errno.h-t fcntl.h fcntl.h-t float.h \
+       float.h-t getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t \
+       iconv.h iconv.h-t iconv_open-aix.h-t iconv_open-hpux.h-t \
+       iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t \
+       iconv_open-zos.h-t inttypes.h inttypes.h-t langinfo.h \
+       langinfo.h-t limits.h limits.h-t locale.h locale.h-t math.h \
+       math.h-t sched.h sched.h-t signal.h signal.h-t sigsegv.h \
+       sigsegv.h-t spawn.h spawn.h-t stdalign.h stdalign.h-t stdarg.h \
+       stdarg.h-t stdbool.h stdbool.h-t stddef.h stddef.h-t stdint.h \
+       stdint.h-t stdio.h stdio.h-t stdlib.h stdlib.h-t string.h \
+       string.h-t sys/random.h sys/random.h-t sys/stat.h sys/stat.h-t \
+       sys/types.h sys/types.h-t sys/wait.h sys/wait.h-t time.h \
+       time.h-t unistd.h unistd.h-t unistr.h unistr.h-t unitypes.h \
+       unitypes.h-t uniwidth.h uniwidth.h-t wchar.h wchar.h-t \
+       wctype.h wctype.h-t
+SUFFIXES = 
 noinst_LIBRARIES = libm4.a
-libm4_a_SOURCES = gl_avltree_oset.h gl_avltree_oset.c \
-       gl_anytree_oset.h binary-io.h binary-io.c c-ctype.h c-ctype.c \
-       c-stack.h c-stack.c c-strcase.h c-strcasecmp.c c-strncasecmp.c \
-       clean-temp.h clean-temp.c cloexec.c close-stream.c closein.c \
-       closeout.c dirname.c basename.c dirname-lgpl.c basename-lgpl.c \
-       stripslash.c execute.h execute.c w32spawn.h exitfail.c \
-       fatal-signal.h fatal-signal.c fd-hook.c fd-safer-flag.c \
-       dup-safer-flag.c filenamecat.c filenamecat-lgpl.c \
+# No GNU Make output.
+libm4_a_SOURCES = asyncsafe-spin.c openat-priv.h openat-proc.c \
+       gl_avltree_oset.h gl_avltree_oset.c gl_avltree_ordered.h \
+       gl_anytree_oset.h basename-lgpl.c binary-io.h binary-io.c \
+       bitrotate.h bitrotate.c c-ctype.h c-ctype.c c-stack.h \
+       c-stack.c c-strcase.h c-strcasecmp.c c-strncasecmp.c \
+       canonicalize.c clean-temp.h clean-temp.c clean-temp-simple.h \
+       clean-temp-simple.c cloexec.c close-stream.c closein.c \
+       closeout.c concat-filename.c dirname.c basename.c \
+       dirname-lgpl.c stripslash.c malloc/dynarray_at_failure.c \
+       malloc/dynarray_emplace_enlarge.c malloc/dynarray_finalize.c \
+       malloc/dynarray_resize.c malloc/dynarray_resize_clear.c \
+       execute.h execute.c exitfail.c fatal-signal.h fatal-signal.c \
+       fd-hook.c fd-safer-flag.c dup-safer-flag.c file-set.c \
+       filenamecat.c filenamecat-lgpl.c findprog.h findprog-in.c \
        fopen-safer.c freading.c getprogname.h getprogname.c gettext.h \
-       hard-locale.c gl_linkedhash_list.h gl_linkedhash_list.c \
-       gl_anyhash_list1.h gl_anyhash_list2.h gl_anylinked_list1.h \
-       gl_anylinked_list2.h gl_list.h gl_list.c localcharset.h \
-       localcharset.c glthread/lock.h glthread/lock.c malloca.c \
-       math.c memchr2.h memchr2.c minmax.h gl_oset.h gl_oset.c \
-       pipe2.c pipe2-safer.c printf-frexp.c printf-frexpl.c \
-       progname.h progname.c quotearg.c sig-handler.c size_max.h \
-       spawn-pipe.h spawn-pipe.c w32spawn.h mkstemp-safer.c \
-       tempname.c glthread/threadlib.c glthread/tls.h glthread/tls.c \
-       tmpdir.h tmpdir.c unistd.c dup-safer.c fd-safer.c pipe-safer.c \
-       verror.h verror.c version-etc.h version-etc.c \
-       version-etc-fsf.c wait-process.h wait-process.c wctype-h.c \
-       xmalloc.c xalloc-die.c gl_xlist.h gl_xlist.c xmalloca.c \
-       gl_xoset.h gl_xoset.c xprintf.h xprintf.c xsize.h xsize.c \
-       xstrndup.h xstrndup.c xvasprintf.h xvasprintf.c xasprintf.c
+       hard-locale.c hash.c hash-pjw.h hash-pjw.c \
+       hash-triple-simple.c idx.h gl_linked_list.h gl_linked_list.c \
+       gl_anylinked_list1.h gl_anylinked_list2.h gl_linkedhash_list.h \
+       gl_linkedhash_list.c gl_anyhash1.h gl_anyhash2.h \
+       gl_anyhash_primes.h gl_anylinked_list1.h gl_anylinked_list2.h \
+       gl_list.h gl_list.c localcharset.c localename.c \
+       localename-table.c glthread/lock.h glthread/lock.c malloca.c \
+       math.c mbchar.c mbiter.h mbiter.c mbslen.c mbsstr.c mbuiter.h \
+       mbuiter.c memchr2.h memchr2.c minmax.h openat-die.c gl_oset.h \
+       gl_oset.c pipe2.c pipe2-safer.c printf-frexp.c printf-frexpl.c \
+       progname.h progname.c propername.h propername.c quotearg.c \
+       save-cwd.c malloc/scratch_buffer_dupfree.c \
+       malloc/scratch_buffer_grow.c \
+       malloc/scratch_buffer_grow_preserve.c \
+       malloc/scratch_buffer_set_array_size.c setlocale_null.c \
+       sig-handler.c $(am__append_1) size_max.h spawn-pipe.h \
+       spawn-pipe.c stat-time.c mkstemp-safer.c striconv.h striconv.c \
+       strnlen1.h strnlen1.c tempname.c glthread/threadlib.c \
+       glthread/tls.h glthread/tls.c tmpdir.h tmpdir.c trim.c \
+       unistd.c dup-safer.c fd-safer.c pipe-safer.c $(am__append_2) \
+       $(am__append_3) $(am__append_4) verror.h verror.c \
+       version-etc.h version-etc.c version-etc-fsf.c wait-process.h \
+       wait-process.c wctype-h.c xmalloc.c xalloc-die.c gl_xlist.h \
+       gl_xlist.c xmalloca.c gl_xoset.h gl_xoset.c xprintf.h \
+       xprintf.c xsize.h xsize.c xstriconv.h xstriconv.c xstrndup.h \
+       xstrndup.c xvasprintf.h xvasprintf.c xasprintf.c
 libm4_a_LIBADD = $(M4_LIBOBJS)
 libm4_a_DEPENDENCIES = $(M4_LIBOBJS)
-EXTRA_libm4_a_SOURCES = btowc.c canonicalize-lgpl.c close.c \
-       stripslash.c dup2.c error.c fclose.c fcntl.c fflush.c float.c \
-       itold.c fopen.c fpending.c fpurge.c freadahead.c frexp.c \
-       frexp.c frexpl.c fseek.c fseeko.c fstat.c ftell.c ftello.c \
-       getdtablesize.c getopt.c getopt1.c gettimeofday.c isnan.c \
-       isnand.c isnan.c isnanf.c isnan.c isnanl.c localeconv.c \
-       lseek.c lstat.c malloc.c mbrtowc.c mbsinit.c mbtowc.c memchr.c \
-       mkdtemp.c mkstemp.c msvc-inval.c msvc-nothrow.c nl_langinfo.c \
-       obstack.c open.c spawni.c spawn_faction_addclose.c \
-       spawn_faction_adddup2.c spawn_faction_addopen.c \
-       spawn_faction_destroy.c spawn_faction_init.c \
-       spawnattr_destroy.c spawnattr_init.c spawnattr_setflags.c \
+EXTRA_libm4_a_SOURCES = access.c btowc.c calloc.c calloc.c \
+       canonicalize-lgpl.c chdir-long.c close.c closedir.c dirfd.c \
+       stripslash.c dup.c dup2.c malloc/dynarray-skeleton.c error.c \
+       fchdir.c fclose.c fcntl.c fdopendir.c fflush.c float.c itold.c \
+       fopen.c fopen.c fpending.c fpurge.c freadahead.c free.c \
+       frexp.c frexp.c frexpl.c fseek.c fseeko.c fstat.c stat-w32.c \
+       at-func.c fstatat.c ftell.c ftello.c getcwd.c getcwd-lgpl.c \
+       getdtablesize.c getopt.c getopt1.c getpagesize.c getrandom.c \
+       iconv.c iconv_close.c iconv_open.c isnan.c isnand.c isnan.c \
+       isnanf.c isnan.c isnanl.c iswblank.c iswdigit.c iswxdigit.c \
+       localeconv.c lseek.c lstat.c malloc.c malloc.c \
+       lc-charset-dispatch.c mbrtowc.c mbtowc-lock.c mbsinit.c \
+       mbtowc.c memchr.c mempcpy.c memrchr.c mkdir.c mkdtemp.c \
+       mkstemp.c msvc-inval.c msvc-nothrow.c nl_langinfo-lock.c \
+       nl_langinfo.c obstack.c open.c openat.c opendir.c pipe.c \
+       spawn.c spawni.c spawn_faction_addchdir.c \
+       spawn_faction_addclose.c spawn_faction_adddup2.c \
+       spawn_faction_addopen.c spawn_faction_destroy.c \
+       spawn_faction_init.c spawnattr_destroy.c spawnattr_init.c \
+       spawnattr_setflags.c spawnattr_setpgroup.c \
        spawnattr_setsigmask.c spawnp.c printf-frexp.c raise.c \
-       rawmemchr.c readlink.c regcomp.c regex.c regex_internal.c \
-       regexec.c rename.c rmdir.c secure_getenv.c sigaction.c \
-       signbitd.c signbitf.c signbitl.c stdio-write.c sigprocmask.c \
-       snprintf.c stat.c strchrnul.c strerror.c strerror-override.c \
-       strndup.c strnlen.c strsignal.c strstr.c strtod.c asnprintf.c \
-       printf-args.c printf-parse.c vasnprintf.c asprintf.c \
-       vasprintf.c waitpid.c wcrtomb.c
+       rawmemchr.c readdir.c readlink.c realloc.c realloc.c \
+       reallocarray.c regcomp.c regex.c regex_internal.c regexec.c \
+       rename.c rewinddir.c rmdir.c secure_getenv.c setlocale.c \
+       setlocale-lock.c sigaction.c signbitd.c signbitf.c signbitl.c \
+       stdio-write.c sigprocmask.c snprintf.c os2-spawn.c stat-w32.c \
+       stat.c stpcpy.c strchrnul.c strdup.c strerror.c \
+       strerror-override.c strndup.c strnlen.c strsignal.c strstr.c \
+       strstr.c strtod.c asnprintf.c printf-args.c printf-parse.c \
+       vasnprintf.c asprintf.c vasprintf.c waitpid.c wcrtomb.c \
+       wcwidth.c windows-mutex.c windows-once.c windows-recmutex.c \
+       windows-rwlock.c windows-spawn.c windows-spin.c windows-tls.c
 
 # Use this preprocessor expression to decide whether #include_next works.
 # Do not rely on a 'configure'-time test for this, since the expression
 # might appear in an installed header, which is used by some other compiler.
-HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER)
-charset_alias = $(DESTDIR)$(libdir)/charset.alias
-charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
+HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER)
+GPERF = gperf
+V_GPERF = $(V_GPERF_@AM_V@)
+V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@)
+V_GPERF_0 = @echo "  GPERF   " $@;
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+_NORETURN_H = $(srcdir)/_Noreturn.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+ARG_NONNULL_H = $(srcdir)/arg-nonnull.h
 
 # Because this Makefile snippet defines a variable used by other
-# gnulib Makefile snippets, it must be present in all Makefile.am that
+# gnulib Makefile snippets, it must be present in all makefiles that
 # need it. This is ensured by the applicability 'all' defined above.
-_NORETURN_H = $(top_srcdir)/build-aux/snippet/_Noreturn.h
-ARG_NONNULL_H = arg-nonnull.h
-CXXDEFS_H = c++defs.h
-UNUSED_PARAMETER_H = unused-parameter.h
-WARN_ON_USE_H = warn-on-use.h
+CXXDEFS_H = $(srcdir)/c++defs.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+UNUSED_PARAMETER_H = $(srcdir)/unused-parameter.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+WARN_ON_USE_H = $(srcdir)/warn-on-use.h
 all: $(BUILT_SOURCES) config.h
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-.SUFFIXES: .sed .sin .c .o .obj
+.SUFFIXES: .c .o .obj
 $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am $(srcdir)/gnulib.mk $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -1692,8 +2499,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 $(srcdir)/gnulib.mk $(am__empty):
 
@@ -1723,6 +2530,22 @@ distclean-hdr:
 
 clean-noinstLIBRARIES:
        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+malloc/$(am__dirstamp):
+       @$(MKDIR_P) malloc
+       @: > malloc/$(am__dirstamp)
+malloc/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) malloc/$(DEPDIR)
+       @: > malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/dynarray_at_failure.$(OBJEXT): malloc/$(am__dirstamp) \
+       malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/dynarray_emplace_enlarge.$(OBJEXT): malloc/$(am__dirstamp) \
+       malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/dynarray_finalize.$(OBJEXT): malloc/$(am__dirstamp) \
+       malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/dynarray_resize.$(OBJEXT): malloc/$(am__dirstamp) \
+       malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/dynarray_resize_clear.$(OBJEXT): malloc/$(am__dirstamp) \
+       malloc/$(DEPDIR)/$(am__dirstamp)
 glthread/$(am__dirstamp):
        @$(MKDIR_P) glthread
        @: > glthread/$(am__dirstamp)
@@ -1731,10 +2554,40 @@ glthread/$(DEPDIR)/$(am__dirstamp):
        @: > glthread/$(DEPDIR)/$(am__dirstamp)
 glthread/lock.$(OBJEXT): glthread/$(am__dirstamp) \
        glthread/$(DEPDIR)/$(am__dirstamp)
+malloc/scratch_buffer_dupfree.$(OBJEXT): malloc/$(am__dirstamp) \
+       malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/scratch_buffer_grow.$(OBJEXT): malloc/$(am__dirstamp) \
+       malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/scratch_buffer_grow_preserve.$(OBJEXT): malloc/$(am__dirstamp) \
+       malloc/$(DEPDIR)/$(am__dirstamp)
+malloc/scratch_buffer_set_array_size.$(OBJEXT):  \
+       malloc/$(am__dirstamp) malloc/$(DEPDIR)/$(am__dirstamp)
 glthread/threadlib.$(OBJEXT): glthread/$(am__dirstamp) \
        glthread/$(DEPDIR)/$(am__dirstamp)
 glthread/tls.$(OBJEXT): glthread/$(am__dirstamp) \
        glthread/$(DEPDIR)/$(am__dirstamp)
+unistr/$(am__dirstamp):
+       @$(MKDIR_P) unistr
+       @: > unistr/$(am__dirstamp)
+unistr/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) unistr/$(DEPDIR)
+       @: > unistr/$(DEPDIR)/$(am__dirstamp)
+unistr/u8-mbtoucr.$(OBJEXT): unistr/$(am__dirstamp) \
+       unistr/$(DEPDIR)/$(am__dirstamp)
+unistr/u8-uctomb.$(OBJEXT): unistr/$(am__dirstamp) \
+       unistr/$(DEPDIR)/$(am__dirstamp)
+unistr/u8-uctomb-aux.$(OBJEXT): unistr/$(am__dirstamp) \
+       unistr/$(DEPDIR)/$(am__dirstamp)
+uniwidth/$(am__dirstamp):
+       @$(MKDIR_P) uniwidth
+       @: > uniwidth/$(am__dirstamp)
+uniwidth/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) uniwidth/$(DEPDIR)
+       @: > uniwidth/$(DEPDIR)/$(am__dirstamp)
+uniwidth/width.$(OBJEXT): uniwidth/$(am__dirstamp) \
+       uniwidth/$(DEPDIR)/$(am__dirstamp)
+malloc/dynarray-skeleton.$(OBJEXT): malloc/$(am__dirstamp) \
+       malloc/$(DEPDIR)/$(am__dirstamp)
 
 libm4.a: $(libm4_a_OBJECTS) $(libm4_a_DEPENDENCIES) $(EXTRA_libm4_a_DEPENDENCIES) 
        $(AM_V_at)-rm -f libm4.a
@@ -1744,167 +2597,270 @@ libm4.a: $(libm4_a_OBJECTS) $(libm4_a_DEPENDENCIES) $(EXTRA_libm4_a_DEPENDENCIES
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
        -rm -f glthread/*.$(OBJEXT)
+       -rm -f malloc/*.$(OBJEXT)
+       -rm -f unistr/*.$(OBJEXT)
+       -rm -f uniwidth/*.$(OBJEXT)
 
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename-lgpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binary-io.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btowc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-ctype.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-stack.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strcasecmp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strncasecmp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canonicalize-lgpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clean-temp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cloexec.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close-stream.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closein.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closeout.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname-lgpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup-safer-flag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup-safer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execute.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exitfail.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fatal-signal.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fclose.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-hook.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-safer-flag.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-safer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fflush.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat-lgpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fopen-safer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fopen.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpending.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpurge.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freadahead.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freading.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseek.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseeko.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftell.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftello.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdtablesize.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getprogname.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_avltree_oset.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_linkedhash_list.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_list.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_oset.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_xlist.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_xoset.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hard-locale.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnan.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnand.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnanf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnanl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itold.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localeconv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsinit.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbtowc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdtemp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkstemp-safer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkstemp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-inval.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-nothrow.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl_langinfo.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obstack.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe-safer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2-safer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-frexp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-frexpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progname.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotearg.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raise.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawmemchr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_internal.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_getenv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig-handler.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn-pipe.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_addclose.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_adddup2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_addopen.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_destroy.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_init.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_destroy.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_init.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_setflags.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_setsigmask.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawni.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio-write.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strchrnul.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror-override.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strndup.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strsignal.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strstr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtod.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmpdir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unistd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verror.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc-fsf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait-process.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcrtomb.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctype-h.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xasprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloca.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsize.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvasprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/lock.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/threadlib.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/tls.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asnprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/asyncsafe-spin.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/at-func.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/basename.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binary-io.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bitrotate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-ctype.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-stack.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strcasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/c-strncasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canonicalize-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canonicalize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chdir-long.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clean-temp-simple.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clean-temp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cloexec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close-stream.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/close.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closedir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closein.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closeout.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/concat-filename.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirfd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup-safer-flag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup-safer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execute.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/exitfail.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fatal-signal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fclose.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-hook.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-safer-flag.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fd-safer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdopendir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fflush.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file-set.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filenamecat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findprog-in.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/float.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fopen-safer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpending.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fpurge.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freadahead.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freading.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/free.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/frexpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseek.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fseeko.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftell.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftello.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdtablesize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpagesize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getprogname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_avltree_oset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_linked_list.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_linkedhash_list.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_list.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_oset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_xlist.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_xoset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hard-locale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash-pjw.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash-triple-simple.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv_close.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iconv_open.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnan.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnand.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnanf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isnanl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iswblank.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iswdigit.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iswxdigit.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/itold.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lc-charset-dispatch.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localcharset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localeconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localename-table.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localename.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/malloca.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/math.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbchar.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbiter.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbrtowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsinit.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbslen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbsstr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbtowc-lock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbtowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbuiter.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memchr2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mempcpy.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memrchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdtemp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkstemp-safer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkstemp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-inval.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msvc-nothrow.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl_langinfo-lock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nl_langinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/obstack.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-die.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat-proc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os2-spawn.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe-safer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2-safer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-args.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-frexp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-frexpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printf-parse.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/progname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/propername.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotearg.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raise.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rawmemchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/realloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reallocarray.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regcomp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regex_internal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regexec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rewinddir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/save-cwd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/secure_getenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setlocale-lock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setlocale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setlocale_null.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sig-handler.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signbitl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigsegv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn-pipe.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_addchdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_addclose.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_adddup2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_addopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_destroy.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawn_faction_init.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_destroy.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_init.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_setflags.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_setpgroup.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnattr_setsigmask.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawni.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/spawnp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stackvma.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat-w32.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stdio-write.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stpcpy.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strchrnul.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror-override.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/striconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stripslash.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strndup.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strnlen1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strsignal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strstr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strtod.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tempname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tmpdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/trim.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unistd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasnprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc-fsf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/version-etc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait-process.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcrtomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctype-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wcwidth.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-mutex.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-once.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-recmutex.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-rwlock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-spawn.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-spin.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-tls.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xalloc-die.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xmalloca.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xsize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstriconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xstrndup.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/lock.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/threadlib.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/tls.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/dynarray-skeleton.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/dynarray_at_failure.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/dynarray_emplace_enlarge.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/dynarray_finalize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/dynarray_resize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/dynarray_resize_clear.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/scratch_buffer_dupfree.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/scratch_buffer_grow.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/scratch_buffer_grow_preserve.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@malloc/$(DEPDIR)/scratch_buffer_set_array_size.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-mbtoucr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-uctomb-aux.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/u8-uctomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@uniwidth/$(DEPDIR)/width.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -1974,7 +2930,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -2007,11 +2966,12 @@ distdir: $(DISTFILES)
 check-am: all-am
 check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-am
-all-am: Makefile $(LIBRARIES) config.h all-local
+all-am: Makefile $(LIBRARIES) config.h
 installdirs:
 install: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) install-am
-install-exec: install-exec-am
+install-exec: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
 
@@ -2040,17 +3000,274 @@ distclean-generic:
        -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
        -rm -f glthread/$(DEPDIR)/$(am__dirstamp)
        -rm -f glthread/$(am__dirstamp)
+       -rm -f malloc/$(DEPDIR)/$(am__dirstamp)
+       -rm -f malloc/$(am__dirstamp)
+       -rm -f unistr/$(DEPDIR)/$(am__dirstamp)
+       -rm -f unistr/$(am__dirstamp)
+       -rm -f uniwidth/$(DEPDIR)/$(am__dirstamp)
+       -rm -f uniwidth/$(am__dirstamp)
 
 maintainer-clean-generic:
        @echo "This command is intended for maintainers to use"
        @echo "it deletes files that may require special tools to rebuild."
        -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
+       -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 clean: clean-am
 
 clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR) glthread/$(DEPDIR)
+               -rm -f ./$(DEPDIR)/access.Po
+       -rm -f ./$(DEPDIR)/asnprintf.Po
+       -rm -f ./$(DEPDIR)/asprintf.Po
+       -rm -f ./$(DEPDIR)/asyncsafe-spin.Po
+       -rm -f ./$(DEPDIR)/at-func.Po
+       -rm -f ./$(DEPDIR)/basename-lgpl.Po
+       -rm -f ./$(DEPDIR)/basename.Po
+       -rm -f ./$(DEPDIR)/binary-io.Po
+       -rm -f ./$(DEPDIR)/bitrotate.Po
+       -rm -f ./$(DEPDIR)/btowc.Po
+       -rm -f ./$(DEPDIR)/c-ctype.Po
+       -rm -f ./$(DEPDIR)/c-stack.Po
+       -rm -f ./$(DEPDIR)/c-strcasecmp.Po
+       -rm -f ./$(DEPDIR)/c-strncasecmp.Po
+       -rm -f ./$(DEPDIR)/calloc.Po
+       -rm -f ./$(DEPDIR)/canonicalize-lgpl.Po
+       -rm -f ./$(DEPDIR)/canonicalize.Po
+       -rm -f ./$(DEPDIR)/chdir-long.Po
+       -rm -f ./$(DEPDIR)/clean-temp-simple.Po
+       -rm -f ./$(DEPDIR)/clean-temp.Po
+       -rm -f ./$(DEPDIR)/cloexec.Po
+       -rm -f ./$(DEPDIR)/close-stream.Po
+       -rm -f ./$(DEPDIR)/close.Po
+       -rm -f ./$(DEPDIR)/closedir.Po
+       -rm -f ./$(DEPDIR)/closein.Po
+       -rm -f ./$(DEPDIR)/closeout.Po
+       -rm -f ./$(DEPDIR)/concat-filename.Po
+       -rm -f ./$(DEPDIR)/dirfd.Po
+       -rm -f ./$(DEPDIR)/dirname-lgpl.Po
+       -rm -f ./$(DEPDIR)/dirname.Po
+       -rm -f ./$(DEPDIR)/dup-safer-flag.Po
+       -rm -f ./$(DEPDIR)/dup-safer.Po
+       -rm -f ./$(DEPDIR)/dup.Po
+       -rm -f ./$(DEPDIR)/dup2.Po
+       -rm -f ./$(DEPDIR)/error.Po
+       -rm -f ./$(DEPDIR)/execute.Po
+       -rm -f ./$(DEPDIR)/exitfail.Po
+       -rm -f ./$(DEPDIR)/fatal-signal.Po
+       -rm -f ./$(DEPDIR)/fchdir.Po
+       -rm -f ./$(DEPDIR)/fclose.Po
+       -rm -f ./$(DEPDIR)/fcntl.Po
+       -rm -f ./$(DEPDIR)/fd-hook.Po
+       -rm -f ./$(DEPDIR)/fd-safer-flag.Po
+       -rm -f ./$(DEPDIR)/fd-safer.Po
+       -rm -f ./$(DEPDIR)/fdopendir.Po
+       -rm -f ./$(DEPDIR)/fflush.Po
+       -rm -f ./$(DEPDIR)/file-set.Po
+       -rm -f ./$(DEPDIR)/filenamecat-lgpl.Po
+       -rm -f ./$(DEPDIR)/filenamecat.Po
+       -rm -f ./$(DEPDIR)/findprog-in.Po
+       -rm -f ./$(DEPDIR)/float.Po
+       -rm -f ./$(DEPDIR)/fopen-safer.Po
+       -rm -f ./$(DEPDIR)/fopen.Po
+       -rm -f ./$(DEPDIR)/fpending.Po
+       -rm -f ./$(DEPDIR)/fpurge.Po
+       -rm -f ./$(DEPDIR)/freadahead.Po
+       -rm -f ./$(DEPDIR)/freading.Po
+       -rm -f ./$(DEPDIR)/free.Po
+       -rm -f ./$(DEPDIR)/frexp.Po
+       -rm -f ./$(DEPDIR)/frexpl.Po
+       -rm -f ./$(DEPDIR)/fseek.Po
+       -rm -f ./$(DEPDIR)/fseeko.Po
+       -rm -f ./$(DEPDIR)/fstat.Po
+       -rm -f ./$(DEPDIR)/fstatat.Po
+       -rm -f ./$(DEPDIR)/ftell.Po
+       -rm -f ./$(DEPDIR)/ftello.Po
+       -rm -f ./$(DEPDIR)/getcwd-lgpl.Po
+       -rm -f ./$(DEPDIR)/getcwd.Po
+       -rm -f ./$(DEPDIR)/getdtablesize.Po
+       -rm -f ./$(DEPDIR)/getopt.Po
+       -rm -f ./$(DEPDIR)/getopt1.Po
+       -rm -f ./$(DEPDIR)/getpagesize.Po
+       -rm -f ./$(DEPDIR)/getprogname.Po
+       -rm -f ./$(DEPDIR)/getrandom.Po
+       -rm -f ./$(DEPDIR)/gl_avltree_oset.Po
+       -rm -f ./$(DEPDIR)/gl_linked_list.Po
+       -rm -f ./$(DEPDIR)/gl_linkedhash_list.Po
+       -rm -f ./$(DEPDIR)/gl_list.Po
+       -rm -f ./$(DEPDIR)/gl_oset.Po
+       -rm -f ./$(DEPDIR)/gl_xlist.Po
+       -rm -f ./$(DEPDIR)/gl_xoset.Po
+       -rm -f ./$(DEPDIR)/hard-locale.Po
+       -rm -f ./$(DEPDIR)/hash-pjw.Po
+       -rm -f ./$(DEPDIR)/hash-triple-simple.Po
+       -rm -f ./$(DEPDIR)/hash.Po
+       -rm -f ./$(DEPDIR)/iconv.Po
+       -rm -f ./$(DEPDIR)/iconv_close.Po
+       -rm -f ./$(DEPDIR)/iconv_open.Po
+       -rm -f ./$(DEPDIR)/isnan.Po
+       -rm -f ./$(DEPDIR)/isnand.Po
+       -rm -f ./$(DEPDIR)/isnanf.Po
+       -rm -f ./$(DEPDIR)/isnanl.Po
+       -rm -f ./$(DEPDIR)/iswblank.Po
+       -rm -f ./$(DEPDIR)/iswdigit.Po
+       -rm -f ./$(DEPDIR)/iswxdigit.Po
+       -rm -f ./$(DEPDIR)/itold.Po
+       -rm -f ./$(DEPDIR)/lc-charset-dispatch.Po
+       -rm -f ./$(DEPDIR)/localcharset.Po
+       -rm -f ./$(DEPDIR)/localeconv.Po
+       -rm -f ./$(DEPDIR)/localename-table.Po
+       -rm -f ./$(DEPDIR)/localename.Po
+       -rm -f ./$(DEPDIR)/lseek.Po
+       -rm -f ./$(DEPDIR)/lstat.Po
+       -rm -f ./$(DEPDIR)/malloc.Po
+       -rm -f ./$(DEPDIR)/malloca.Po
+       -rm -f ./$(DEPDIR)/math.Po
+       -rm -f ./$(DEPDIR)/mbchar.Po
+       -rm -f ./$(DEPDIR)/mbiter.Po
+       -rm -f ./$(DEPDIR)/mbrtowc.Po
+       -rm -f ./$(DEPDIR)/mbsinit.Po
+       -rm -f ./$(DEPDIR)/mbslen.Po
+       -rm -f ./$(DEPDIR)/mbsstr.Po
+       -rm -f ./$(DEPDIR)/mbtowc-lock.Po
+       -rm -f ./$(DEPDIR)/mbtowc.Po
+       -rm -f ./$(DEPDIR)/mbuiter.Po
+       -rm -f ./$(DEPDIR)/memchr.Po
+       -rm -f ./$(DEPDIR)/memchr2.Po
+       -rm -f ./$(DEPDIR)/mempcpy.Po
+       -rm -f ./$(DEPDIR)/memrchr.Po
+       -rm -f ./$(DEPDIR)/mkdir.Po
+       -rm -f ./$(DEPDIR)/mkdtemp.Po
+       -rm -f ./$(DEPDIR)/mkstemp-safer.Po
+       -rm -f ./$(DEPDIR)/mkstemp.Po
+       -rm -f ./$(DEPDIR)/msvc-inval.Po
+       -rm -f ./$(DEPDIR)/msvc-nothrow.Po
+       -rm -f ./$(DEPDIR)/nl_langinfo-lock.Po
+       -rm -f ./$(DEPDIR)/nl_langinfo.Po
+       -rm -f ./$(DEPDIR)/obstack.Po
+       -rm -f ./$(DEPDIR)/open.Po
+       -rm -f ./$(DEPDIR)/openat-die.Po
+       -rm -f ./$(DEPDIR)/openat-proc.Po
+       -rm -f ./$(DEPDIR)/openat.Po
+       -rm -f ./$(DEPDIR)/opendir.Po
+       -rm -f ./$(DEPDIR)/os2-spawn.Po
+       -rm -f ./$(DEPDIR)/pipe-safer.Po
+       -rm -f ./$(DEPDIR)/pipe.Po
+       -rm -f ./$(DEPDIR)/pipe2-safer.Po
+       -rm -f ./$(DEPDIR)/pipe2.Po
+       -rm -f ./$(DEPDIR)/printf-args.Po
+       -rm -f ./$(DEPDIR)/printf-frexp.Po
+       -rm -f ./$(DEPDIR)/printf-frexpl.Po
+       -rm -f ./$(DEPDIR)/printf-parse.Po
+       -rm -f ./$(DEPDIR)/progname.Po
+       -rm -f ./$(DEPDIR)/propername.Po
+       -rm -f ./$(DEPDIR)/quotearg.Po
+       -rm -f ./$(DEPDIR)/raise.Po
+       -rm -f ./$(DEPDIR)/rawmemchr.Po
+       -rm -f ./$(DEPDIR)/readdir.Po
+       -rm -f ./$(DEPDIR)/readlink.Po
+       -rm -f ./$(DEPDIR)/realloc.Po
+       -rm -f ./$(DEPDIR)/reallocarray.Po
+       -rm -f ./$(DEPDIR)/regcomp.Po
+       -rm -f ./$(DEPDIR)/regex.Po
+       -rm -f ./$(DEPDIR)/regex_internal.Po
+       -rm -f ./$(DEPDIR)/regexec.Po
+       -rm -f ./$(DEPDIR)/rename.Po
+       -rm -f ./$(DEPDIR)/rewinddir.Po
+       -rm -f ./$(DEPDIR)/rmdir.Po
+       -rm -f ./$(DEPDIR)/save-cwd.Po
+       -rm -f ./$(DEPDIR)/secure_getenv.Po
+       -rm -f ./$(DEPDIR)/setlocale-lock.Po
+       -rm -f ./$(DEPDIR)/setlocale.Po
+       -rm -f ./$(DEPDIR)/setlocale_null.Po
+       -rm -f ./$(DEPDIR)/sig-handler.Po
+       -rm -f ./$(DEPDIR)/sigaction.Po
+       -rm -f ./$(DEPDIR)/signbitd.Po
+       -rm -f ./$(DEPDIR)/signbitf.Po
+       -rm -f ./$(DEPDIR)/signbitl.Po
+       -rm -f ./$(DEPDIR)/sigprocmask.Po
+       -rm -f ./$(DEPDIR)/sigsegv.Po
+       -rm -f ./$(DEPDIR)/snprintf.Po
+       -rm -f ./$(DEPDIR)/spawn-pipe.Po
+       -rm -f ./$(DEPDIR)/spawn.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_addchdir.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_addclose.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_adddup2.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_addopen.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_destroy.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_init.Po
+       -rm -f ./$(DEPDIR)/spawnattr_destroy.Po
+       -rm -f ./$(DEPDIR)/spawnattr_init.Po
+       -rm -f ./$(DEPDIR)/spawnattr_setflags.Po
+       -rm -f ./$(DEPDIR)/spawnattr_setpgroup.Po
+       -rm -f ./$(DEPDIR)/spawnattr_setsigmask.Po
+       -rm -f ./$(DEPDIR)/spawni.Po
+       -rm -f ./$(DEPDIR)/spawnp.Po
+       -rm -f ./$(DEPDIR)/stackvma.Po
+       -rm -f ./$(DEPDIR)/stat-time.Po
+       -rm -f ./$(DEPDIR)/stat-w32.Po
+       -rm -f ./$(DEPDIR)/stat.Po
+       -rm -f ./$(DEPDIR)/stdio-write.Po
+       -rm -f ./$(DEPDIR)/stpcpy.Po
+       -rm -f ./$(DEPDIR)/strchrnul.Po
+       -rm -f ./$(DEPDIR)/strdup.Po
+       -rm -f ./$(DEPDIR)/strerror-override.Po
+       -rm -f ./$(DEPDIR)/strerror.Po
+       -rm -f ./$(DEPDIR)/striconv.Po
+       -rm -f ./$(DEPDIR)/stripslash.Po
+       -rm -f ./$(DEPDIR)/strndup.Po
+       -rm -f ./$(DEPDIR)/strnlen.Po
+       -rm -f ./$(DEPDIR)/strnlen1.Po
+       -rm -f ./$(DEPDIR)/strsignal.Po
+       -rm -f ./$(DEPDIR)/strstr.Po
+       -rm -f ./$(DEPDIR)/strtod.Po
+       -rm -f ./$(DEPDIR)/tempname.Po
+       -rm -f ./$(DEPDIR)/tmpdir.Po
+       -rm -f ./$(DEPDIR)/trim.Po
+       -rm -f ./$(DEPDIR)/unistd.Po
+       -rm -f ./$(DEPDIR)/vasnprintf.Po
+       -rm -f ./$(DEPDIR)/vasprintf.Po
+       -rm -f ./$(DEPDIR)/verror.Po
+       -rm -f ./$(DEPDIR)/version-etc-fsf.Po
+       -rm -f ./$(DEPDIR)/version-etc.Po
+       -rm -f ./$(DEPDIR)/wait-process.Po
+       -rm -f ./$(DEPDIR)/waitpid.Po
+       -rm -f ./$(DEPDIR)/wcrtomb.Po
+       -rm -f ./$(DEPDIR)/wctype-h.Po
+       -rm -f ./$(DEPDIR)/wcwidth.Po
+       -rm -f ./$(DEPDIR)/windows-mutex.Po
+       -rm -f ./$(DEPDIR)/windows-once.Po
+       -rm -f ./$(DEPDIR)/windows-recmutex.Po
+       -rm -f ./$(DEPDIR)/windows-rwlock.Po
+       -rm -f ./$(DEPDIR)/windows-spawn.Po
+       -rm -f ./$(DEPDIR)/windows-spin.Po
+       -rm -f ./$(DEPDIR)/windows-tls.Po
+       -rm -f ./$(DEPDIR)/xalloc-die.Po
+       -rm -f ./$(DEPDIR)/xasprintf.Po
+       -rm -f ./$(DEPDIR)/xmalloc.Po
+       -rm -f ./$(DEPDIR)/xmalloca.Po
+       -rm -f ./$(DEPDIR)/xprintf.Po
+       -rm -f ./$(DEPDIR)/xsize.Po
+       -rm -f ./$(DEPDIR)/xstriconv.Po
+       -rm -f ./$(DEPDIR)/xstrndup.Po
+       -rm -f ./$(DEPDIR)/xvasprintf.Po
+       -rm -f glthread/$(DEPDIR)/lock.Po
+       -rm -f glthread/$(DEPDIR)/threadlib.Po
+       -rm -f glthread/$(DEPDIR)/tls.Po
+       -rm -f malloc/$(DEPDIR)/dynarray-skeleton.Po
+       -rm -f malloc/$(DEPDIR)/dynarray_at_failure.Po
+       -rm -f malloc/$(DEPDIR)/dynarray_emplace_enlarge.Po
+       -rm -f malloc/$(DEPDIR)/dynarray_finalize.Po
+       -rm -f malloc/$(DEPDIR)/dynarray_resize.Po
+       -rm -f malloc/$(DEPDIR)/dynarray_resize_clear.Po
+       -rm -f malloc/$(DEPDIR)/scratch_buffer_dupfree.Po
+       -rm -f malloc/$(DEPDIR)/scratch_buffer_grow.Po
+       -rm -f malloc/$(DEPDIR)/scratch_buffer_grow_preserve.Po
+       -rm -f malloc/$(DEPDIR)/scratch_buffer_set_array_size.Po
+       -rm -f unistr/$(DEPDIR)/u8-mbtoucr.Po
+       -rm -f unistr/$(DEPDIR)/u8-uctomb-aux.Po
+       -rm -f unistr/$(DEPDIR)/u8-uctomb.Po
+       -rm -f uniwidth/$(DEPDIR)/width.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-hdr distclean-local distclean-tags
@@ -2073,7 +3290,7 @@ install-dvi: install-dvi-am
 
 install-dvi-am:
 
-install-exec-am: install-exec-local
+install-exec-am:
 
 install-html: install-html-am
 
@@ -2096,7 +3313,257 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR) glthread/$(DEPDIR)
+               -rm -f ./$(DEPDIR)/access.Po
+       -rm -f ./$(DEPDIR)/asnprintf.Po
+       -rm -f ./$(DEPDIR)/asprintf.Po
+       -rm -f ./$(DEPDIR)/asyncsafe-spin.Po
+       -rm -f ./$(DEPDIR)/at-func.Po
+       -rm -f ./$(DEPDIR)/basename-lgpl.Po
+       -rm -f ./$(DEPDIR)/basename.Po
+       -rm -f ./$(DEPDIR)/binary-io.Po
+       -rm -f ./$(DEPDIR)/bitrotate.Po
+       -rm -f ./$(DEPDIR)/btowc.Po
+       -rm -f ./$(DEPDIR)/c-ctype.Po
+       -rm -f ./$(DEPDIR)/c-stack.Po
+       -rm -f ./$(DEPDIR)/c-strcasecmp.Po
+       -rm -f ./$(DEPDIR)/c-strncasecmp.Po
+       -rm -f ./$(DEPDIR)/calloc.Po
+       -rm -f ./$(DEPDIR)/canonicalize-lgpl.Po
+       -rm -f ./$(DEPDIR)/canonicalize.Po
+       -rm -f ./$(DEPDIR)/chdir-long.Po
+       -rm -f ./$(DEPDIR)/clean-temp-simple.Po
+       -rm -f ./$(DEPDIR)/clean-temp.Po
+       -rm -f ./$(DEPDIR)/cloexec.Po
+       -rm -f ./$(DEPDIR)/close-stream.Po
+       -rm -f ./$(DEPDIR)/close.Po
+       -rm -f ./$(DEPDIR)/closedir.Po
+       -rm -f ./$(DEPDIR)/closein.Po
+       -rm -f ./$(DEPDIR)/closeout.Po
+       -rm -f ./$(DEPDIR)/concat-filename.Po
+       -rm -f ./$(DEPDIR)/dirfd.Po
+       -rm -f ./$(DEPDIR)/dirname-lgpl.Po
+       -rm -f ./$(DEPDIR)/dirname.Po
+       -rm -f ./$(DEPDIR)/dup-safer-flag.Po
+       -rm -f ./$(DEPDIR)/dup-safer.Po
+       -rm -f ./$(DEPDIR)/dup.Po
+       -rm -f ./$(DEPDIR)/dup2.Po
+       -rm -f ./$(DEPDIR)/error.Po
+       -rm -f ./$(DEPDIR)/execute.Po
+       -rm -f ./$(DEPDIR)/exitfail.Po
+       -rm -f ./$(DEPDIR)/fatal-signal.Po
+       -rm -f ./$(DEPDIR)/fchdir.Po
+       -rm -f ./$(DEPDIR)/fclose.Po
+       -rm -f ./$(DEPDIR)/fcntl.Po
+       -rm -f ./$(DEPDIR)/fd-hook.Po
+       -rm -f ./$(DEPDIR)/fd-safer-flag.Po
+       -rm -f ./$(DEPDIR)/fd-safer.Po
+       -rm -f ./$(DEPDIR)/fdopendir.Po
+       -rm -f ./$(DEPDIR)/fflush.Po
+       -rm -f ./$(DEPDIR)/file-set.Po
+       -rm -f ./$(DEPDIR)/filenamecat-lgpl.Po
+       -rm -f ./$(DEPDIR)/filenamecat.Po
+       -rm -f ./$(DEPDIR)/findprog-in.Po
+       -rm -f ./$(DEPDIR)/float.Po
+       -rm -f ./$(DEPDIR)/fopen-safer.Po
+       -rm -f ./$(DEPDIR)/fopen.Po
+       -rm -f ./$(DEPDIR)/fpending.Po
+       -rm -f ./$(DEPDIR)/fpurge.Po
+       -rm -f ./$(DEPDIR)/freadahead.Po
+       -rm -f ./$(DEPDIR)/freading.Po
+       -rm -f ./$(DEPDIR)/free.Po
+       -rm -f ./$(DEPDIR)/frexp.Po
+       -rm -f ./$(DEPDIR)/frexpl.Po
+       -rm -f ./$(DEPDIR)/fseek.Po
+       -rm -f ./$(DEPDIR)/fseeko.Po
+       -rm -f ./$(DEPDIR)/fstat.Po
+       -rm -f ./$(DEPDIR)/fstatat.Po
+       -rm -f ./$(DEPDIR)/ftell.Po
+       -rm -f ./$(DEPDIR)/ftello.Po
+       -rm -f ./$(DEPDIR)/getcwd-lgpl.Po
+       -rm -f ./$(DEPDIR)/getcwd.Po
+       -rm -f ./$(DEPDIR)/getdtablesize.Po
+       -rm -f ./$(DEPDIR)/getopt.Po
+       -rm -f ./$(DEPDIR)/getopt1.Po
+       -rm -f ./$(DEPDIR)/getpagesize.Po
+       -rm -f ./$(DEPDIR)/getprogname.Po
+       -rm -f ./$(DEPDIR)/getrandom.Po
+       -rm -f ./$(DEPDIR)/gl_avltree_oset.Po
+       -rm -f ./$(DEPDIR)/gl_linked_list.Po
+       -rm -f ./$(DEPDIR)/gl_linkedhash_list.Po
+       -rm -f ./$(DEPDIR)/gl_list.Po
+       -rm -f ./$(DEPDIR)/gl_oset.Po
+       -rm -f ./$(DEPDIR)/gl_xlist.Po
+       -rm -f ./$(DEPDIR)/gl_xoset.Po
+       -rm -f ./$(DEPDIR)/hard-locale.Po
+       -rm -f ./$(DEPDIR)/hash-pjw.Po
+       -rm -f ./$(DEPDIR)/hash-triple-simple.Po
+       -rm -f ./$(DEPDIR)/hash.Po
+       -rm -f ./$(DEPDIR)/iconv.Po
+       -rm -f ./$(DEPDIR)/iconv_close.Po
+       -rm -f ./$(DEPDIR)/iconv_open.Po
+       -rm -f ./$(DEPDIR)/isnan.Po
+       -rm -f ./$(DEPDIR)/isnand.Po
+       -rm -f ./$(DEPDIR)/isnanf.Po
+       -rm -f ./$(DEPDIR)/isnanl.Po
+       -rm -f ./$(DEPDIR)/iswblank.Po
+       -rm -f ./$(DEPDIR)/iswdigit.Po
+       -rm -f ./$(DEPDIR)/iswxdigit.Po
+       -rm -f ./$(DEPDIR)/itold.Po
+       -rm -f ./$(DEPDIR)/lc-charset-dispatch.Po
+       -rm -f ./$(DEPDIR)/localcharset.Po
+       -rm -f ./$(DEPDIR)/localeconv.Po
+       -rm -f ./$(DEPDIR)/localename-table.Po
+       -rm -f ./$(DEPDIR)/localename.Po
+       -rm -f ./$(DEPDIR)/lseek.Po
+       -rm -f ./$(DEPDIR)/lstat.Po
+       -rm -f ./$(DEPDIR)/malloc.Po
+       -rm -f ./$(DEPDIR)/malloca.Po
+       -rm -f ./$(DEPDIR)/math.Po
+       -rm -f ./$(DEPDIR)/mbchar.Po
+       -rm -f ./$(DEPDIR)/mbiter.Po
+       -rm -f ./$(DEPDIR)/mbrtowc.Po
+       -rm -f ./$(DEPDIR)/mbsinit.Po
+       -rm -f ./$(DEPDIR)/mbslen.Po
+       -rm -f ./$(DEPDIR)/mbsstr.Po
+       -rm -f ./$(DEPDIR)/mbtowc-lock.Po
+       -rm -f ./$(DEPDIR)/mbtowc.Po
+       -rm -f ./$(DEPDIR)/mbuiter.Po
+       -rm -f ./$(DEPDIR)/memchr.Po
+       -rm -f ./$(DEPDIR)/memchr2.Po
+       -rm -f ./$(DEPDIR)/mempcpy.Po
+       -rm -f ./$(DEPDIR)/memrchr.Po
+       -rm -f ./$(DEPDIR)/mkdir.Po
+       -rm -f ./$(DEPDIR)/mkdtemp.Po
+       -rm -f ./$(DEPDIR)/mkstemp-safer.Po
+       -rm -f ./$(DEPDIR)/mkstemp.Po
+       -rm -f ./$(DEPDIR)/msvc-inval.Po
+       -rm -f ./$(DEPDIR)/msvc-nothrow.Po
+       -rm -f ./$(DEPDIR)/nl_langinfo-lock.Po
+       -rm -f ./$(DEPDIR)/nl_langinfo.Po
+       -rm -f ./$(DEPDIR)/obstack.Po
+       -rm -f ./$(DEPDIR)/open.Po
+       -rm -f ./$(DEPDIR)/openat-die.Po
+       -rm -f ./$(DEPDIR)/openat-proc.Po
+       -rm -f ./$(DEPDIR)/openat.Po
+       -rm -f ./$(DEPDIR)/opendir.Po
+       -rm -f ./$(DEPDIR)/os2-spawn.Po
+       -rm -f ./$(DEPDIR)/pipe-safer.Po
+       -rm -f ./$(DEPDIR)/pipe.Po
+       -rm -f ./$(DEPDIR)/pipe2-safer.Po
+       -rm -f ./$(DEPDIR)/pipe2.Po
+       -rm -f ./$(DEPDIR)/printf-args.Po
+       -rm -f ./$(DEPDIR)/printf-frexp.Po
+       -rm -f ./$(DEPDIR)/printf-frexpl.Po
+       -rm -f ./$(DEPDIR)/printf-parse.Po
+       -rm -f ./$(DEPDIR)/progname.Po
+       -rm -f ./$(DEPDIR)/propername.Po
+       -rm -f ./$(DEPDIR)/quotearg.Po
+       -rm -f ./$(DEPDIR)/raise.Po
+       -rm -f ./$(DEPDIR)/rawmemchr.Po
+       -rm -f ./$(DEPDIR)/readdir.Po
+       -rm -f ./$(DEPDIR)/readlink.Po
+       -rm -f ./$(DEPDIR)/realloc.Po
+       -rm -f ./$(DEPDIR)/reallocarray.Po
+       -rm -f ./$(DEPDIR)/regcomp.Po
+       -rm -f ./$(DEPDIR)/regex.Po
+       -rm -f ./$(DEPDIR)/regex_internal.Po
+       -rm -f ./$(DEPDIR)/regexec.Po
+       -rm -f ./$(DEPDIR)/rename.Po
+       -rm -f ./$(DEPDIR)/rewinddir.Po
+       -rm -f ./$(DEPDIR)/rmdir.Po
+       -rm -f ./$(DEPDIR)/save-cwd.Po
+       -rm -f ./$(DEPDIR)/secure_getenv.Po
+       -rm -f ./$(DEPDIR)/setlocale-lock.Po
+       -rm -f ./$(DEPDIR)/setlocale.Po
+       -rm -f ./$(DEPDIR)/setlocale_null.Po
+       -rm -f ./$(DEPDIR)/sig-handler.Po
+       -rm -f ./$(DEPDIR)/sigaction.Po
+       -rm -f ./$(DEPDIR)/signbitd.Po
+       -rm -f ./$(DEPDIR)/signbitf.Po
+       -rm -f ./$(DEPDIR)/signbitl.Po
+       -rm -f ./$(DEPDIR)/sigprocmask.Po
+       -rm -f ./$(DEPDIR)/sigsegv.Po
+       -rm -f ./$(DEPDIR)/snprintf.Po
+       -rm -f ./$(DEPDIR)/spawn-pipe.Po
+       -rm -f ./$(DEPDIR)/spawn.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_addchdir.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_addclose.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_adddup2.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_addopen.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_destroy.Po
+       -rm -f ./$(DEPDIR)/spawn_faction_init.Po
+       -rm -f ./$(DEPDIR)/spawnattr_destroy.Po
+       -rm -f ./$(DEPDIR)/spawnattr_init.Po
+       -rm -f ./$(DEPDIR)/spawnattr_setflags.Po
+       -rm -f ./$(DEPDIR)/spawnattr_setpgroup.Po
+       -rm -f ./$(DEPDIR)/spawnattr_setsigmask.Po
+       -rm -f ./$(DEPDIR)/spawni.Po
+       -rm -f ./$(DEPDIR)/spawnp.Po
+       -rm -f ./$(DEPDIR)/stackvma.Po
+       -rm -f ./$(DEPDIR)/stat-time.Po
+       -rm -f ./$(DEPDIR)/stat-w32.Po
+       -rm -f ./$(DEPDIR)/stat.Po
+       -rm -f ./$(DEPDIR)/stdio-write.Po
+       -rm -f ./$(DEPDIR)/stpcpy.Po
+       -rm -f ./$(DEPDIR)/strchrnul.Po
+       -rm -f ./$(DEPDIR)/strdup.Po
+       -rm -f ./$(DEPDIR)/strerror-override.Po
+       -rm -f ./$(DEPDIR)/strerror.Po
+       -rm -f ./$(DEPDIR)/striconv.Po
+       -rm -f ./$(DEPDIR)/stripslash.Po
+       -rm -f ./$(DEPDIR)/strndup.Po
+       -rm -f ./$(DEPDIR)/strnlen.Po
+       -rm -f ./$(DEPDIR)/strnlen1.Po
+       -rm -f ./$(DEPDIR)/strsignal.Po
+       -rm -f ./$(DEPDIR)/strstr.Po
+       -rm -f ./$(DEPDIR)/strtod.Po
+       -rm -f ./$(DEPDIR)/tempname.Po
+       -rm -f ./$(DEPDIR)/tmpdir.Po
+       -rm -f ./$(DEPDIR)/trim.Po
+       -rm -f ./$(DEPDIR)/unistd.Po
+       -rm -f ./$(DEPDIR)/vasnprintf.Po
+       -rm -f ./$(DEPDIR)/vasprintf.Po
+       -rm -f ./$(DEPDIR)/verror.Po
+       -rm -f ./$(DEPDIR)/version-etc-fsf.Po
+       -rm -f ./$(DEPDIR)/version-etc.Po
+       -rm -f ./$(DEPDIR)/wait-process.Po
+       -rm -f ./$(DEPDIR)/waitpid.Po
+       -rm -f ./$(DEPDIR)/wcrtomb.Po
+       -rm -f ./$(DEPDIR)/wctype-h.Po
+       -rm -f ./$(DEPDIR)/wcwidth.Po
+       -rm -f ./$(DEPDIR)/windows-mutex.Po
+       -rm -f ./$(DEPDIR)/windows-once.Po
+       -rm -f ./$(DEPDIR)/windows-recmutex.Po
+       -rm -f ./$(DEPDIR)/windows-rwlock.Po
+       -rm -f ./$(DEPDIR)/windows-spawn.Po
+       -rm -f ./$(DEPDIR)/windows-spin.Po
+       -rm -f ./$(DEPDIR)/windows-tls.Po
+       -rm -f ./$(DEPDIR)/xalloc-die.Po
+       -rm -f ./$(DEPDIR)/xasprintf.Po
+       -rm -f ./$(DEPDIR)/xmalloc.Po
+       -rm -f ./$(DEPDIR)/xmalloca.Po
+       -rm -f ./$(DEPDIR)/xprintf.Po
+       -rm -f ./$(DEPDIR)/xsize.Po
+       -rm -f ./$(DEPDIR)/xstriconv.Po
+       -rm -f ./$(DEPDIR)/xstrndup.Po
+       -rm -f ./$(DEPDIR)/xvasprintf.Po
+       -rm -f glthread/$(DEPDIR)/lock.Po
+       -rm -f glthread/$(DEPDIR)/threadlib.Po
+       -rm -f glthread/$(DEPDIR)/tls.Po
+       -rm -f malloc/$(DEPDIR)/dynarray-skeleton.Po
+       -rm -f malloc/$(DEPDIR)/dynarray_at_failure.Po
+       -rm -f malloc/$(DEPDIR)/dynarray_emplace_enlarge.Po
+       -rm -f malloc/$(DEPDIR)/dynarray_finalize.Po
+       -rm -f malloc/$(DEPDIR)/dynarray_resize.Po
+       -rm -f malloc/$(DEPDIR)/dynarray_resize_clear.Po
+       -rm -f malloc/$(DEPDIR)/scratch_buffer_dupfree.Po
+       -rm -f malloc/$(DEPDIR)/scratch_buffer_grow.Po
+       -rm -f malloc/$(DEPDIR)/scratch_buffer_grow_preserve.Po
+       -rm -f malloc/$(DEPDIR)/scratch_buffer_set_array_size.Po
+       -rm -f unistr/$(DEPDIR)/u8-mbtoucr.Po
+       -rm -f unistr/$(DEPDIR)/u8-uctomb-aux.Po
+       -rm -f unistr/$(DEPDIR)/u8-uctomb.Po
+       -rm -f uniwidth/$(DEPDIR)/width.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -2113,24 +3580,23 @@ ps: ps-am
 
 ps-am:
 
-uninstall-am: uninstall-local
+uninstall-am:
 
-.MAKE: all check install install-am install-strip
+.MAKE: all check install install-am install-exec install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
        clean-generic clean-noinstLIBRARIES cscopelist-am ctags \
        ctags-am distclean distclean-compile distclean-generic \
        distclean-hdr distclean-local distclean-tags distdir dvi \
        dvi-am html html-am info info-am install install-am \
        install-data install-data-am install-dvi install-dvi-am \
-       install-exec install-exec-am install-exec-local install-html \
-       install-html-am install-info install-info-am install-man \
-       install-pdf install-pdf-am install-ps install-ps-am \
-       install-strip installcheck installcheck-am installdirs \
-       maintainer-clean maintainer-clean-generic mostlyclean \
-       mostlyclean-compile mostlyclean-generic mostlyclean-local pdf \
-       pdf-am ps ps-am tags tags-am uninstall uninstall-am \
-       uninstall-local
+       install-exec install-exec-am install-html install-html-am \
+       install-info install-info-am install-man install-pdf \
+       install-pdf-am install-ps install-ps-am install-strip \
+       installcheck installcheck-am installdirs maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-local pdf pdf-am ps ps-am tags \
+       tags-am uninstall uninstall-am
 
 .PRECIOUS: Makefile
 
@@ -2140,7 +3606,7 @@ uninstall-am: uninstall-local
 @GL_GENERATE_ALLOCA_H_TRUE@alloca.h: alloca.in.h $(top_builddir)/config.status
 @GL_GENERATE_ALLOCA_H_TRUE@    $(AM_V_GEN)rm -f $@-t $@ && \
 @GL_GENERATE_ALLOCA_H_TRUE@    { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-@GL_GENERATE_ALLOCA_H_TRUE@      cat $(srcdir)/alloca.in.h; \
+@GL_GENERATE_ALLOCA_H_TRUE@      sed -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' < $(srcdir)/alloca.in.h; \
 @GL_GENERATE_ALLOCA_H_TRUE@    } > $@-t && \
 @GL_GENERATE_ALLOCA_H_TRUE@    mv -f $@-t $@
 @GL_GENERATE_ALLOCA_H_FALSE@alloca.h: $(top_builddir)/config.status
@@ -2153,6 +3619,9 @@ uninstall-am: uninstall-local
 configmake.h: Makefile
        $(AM_V_GEN)rm -f $@-t && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         echo '#if HAVE_WINSOCK2_H'; \
+         echo '# include <winsock2.h> /* avoid mingw pollution on DATADIR */'; \
+         echo '#endif'; \
          echo '#define PREFIX "$(prefix)"'; \
          echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
          echo '#define BINDIR "$(bindir)"'; \
@@ -2184,6 +3653,45 @@ configmake.h: Makefile
        } | sed '/""/d' > $@-t && \
        mv -f $@-t $@
 
+# We need the following in order to create <dirent.h> when the system
+# doesn't have one that works with the given compiler.
+dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
+             -e 's/@''GNULIB_OPENDIR''@/$(GL_M4_GNULIB_OPENDIR)/g' \
+             -e 's/@''GNULIB_READDIR''@/$(GL_M4_GNULIB_READDIR)/g' \
+             -e 's/@''GNULIB_REWINDDIR''@/$(GL_M4_GNULIB_REWINDDIR)/g' \
+             -e 's/@''GNULIB_CLOSEDIR''@/$(GL_M4_GNULIB_CLOSEDIR)/g' \
+             -e 's/@''GNULIB_DIRFD''@/$(GL_M4_GNULIB_DIRFD)/g' \
+             -e 's/@''GNULIB_FDOPENDIR''@/$(GL_M4_GNULIB_FDOPENDIR)/g' \
+             -e 's/@''GNULIB_SCANDIR''@/$(GL_M4_GNULIB_SCANDIR)/g' \
+             -e 's/@''GNULIB_ALPHASORT''@/$(GL_M4_GNULIB_ALPHASORT)/g' \
+             -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
+             -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
+             -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
+             -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
+             -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
+             -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
+             -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
+             -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
+             -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
+             -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
+             -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
+             -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
+             -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/dirent.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+
 # We need the following in order to create <errno.h> when the system
 # doesn't have one that is POSIX compliant.
 @GL_GENERATE_ERRNO_H_TRUE@errno.h: errno.in.h $(top_builddir)/config.status
@@ -2216,12 +3724,16 @@ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-             -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
-             -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
-             -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
-             -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
+             -e 's/@''GNULIB_CREAT''@/$(GL_M4_GNULIB_CREAT)/g' \
+             -e 's/@''GNULIB_FCNTL''@/$(GL_M4_GNULIB_FCNTL)/g' \
+             -e 's/@''GNULIB_NONBLOCKING''@/$(GL_M4_GNULIB_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_OPEN''@/$(GL_M4_GNULIB_OPEN)/g' \
+             -e 's/@''GNULIB_OPENAT''@/$(GL_M4_GNULIB_OPENAT)/g' \
+             -e 's/@''GNULIB_MDA_CREAT''@/$(GL_M4_GNULIB_MDA_CREAT)/g' \
+             -e 's/@''GNULIB_MDA_OPEN''@/$(GL_M4_GNULIB_MDA_OPEN)/g' \
              -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
              -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+             -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \
              -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
              -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
              -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
@@ -2265,10 +3777,94 @@ getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
        } > $@-t && \
        mv -f $@-t $@
 
+getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+          sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
+             < $(srcdir)/getopt-cdefs.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
 distclean-local: clean-GNUmakefile
 clean-GNUmakefile:
        test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile
 
+# We need the following in order to create <iconv.h> when the system
+# doesn't have one that works with the given compiler.
+@GL_GENERATE_ICONV_H_TRUE@iconv.h: iconv.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+@GL_GENERATE_ICONV_H_TRUE@     $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_ICONV_H_TRUE@     { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+@GL_GENERATE_ICONV_H_TRUE@       sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+@GL_GENERATE_ICONV_H_TRUE@           -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_ICONV_H_TRUE@           -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_ICONV_H_TRUE@           -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_ICONV_H_TRUE@           -e 's|@''NEXT_ICONV_H''@|$(NEXT_ICONV_H)|g' \
+@GL_GENERATE_ICONV_H_TRUE@           -e 's/@''GNULIB_ICONV''@/$(GL_M4_GNULIB_ICONV)/g' \
+@GL_GENERATE_ICONV_H_TRUE@           -e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \
+@GL_GENERATE_ICONV_H_TRUE@           -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \
+@GL_GENERATE_ICONV_H_TRUE@           -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
+@GL_GENERATE_ICONV_H_TRUE@           -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \
+@GL_GENERATE_ICONV_H_TRUE@           -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+@GL_GENERATE_ICONV_H_TRUE@           -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+@GL_GENERATE_ICONV_H_TRUE@           -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+@GL_GENERATE_ICONV_H_TRUE@           < $(srcdir)/iconv.in.h; \
+@GL_GENERATE_ICONV_H_TRUE@     } > $@-t && \
+@GL_GENERATE_ICONV_H_TRUE@     mv $@-t $@
+@GL_GENERATE_ICONV_H_FALSE@iconv.h: $(top_builddir)/config.status
+@GL_GENERATE_ICONV_H_FALSE@    rm -f $@
+
+$(srcdir)/iconv_open-aix.h: $(srcdir)/iconv_open-aix.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t && \
+       mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h
+$(srcdir)/iconv_open-hpux.h: $(srcdir)/iconv_open-hpux.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t && \
+       mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h
+$(srcdir)/iconv_open-irix.h: $(srcdir)/iconv_open-irix.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t && \
+       mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h
+$(srcdir)/iconv_open-osf.h: $(srcdir)/iconv_open-osf.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t && \
+       mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
+$(srcdir)/iconv_open-solaris.h: $(srcdir)/iconv_open-solaris.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t && \
+       mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h
+$(srcdir)/iconv_open-zos.h: $(srcdir)/iconv_open-zos.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-zos.gperf > $(srcdir)/iconv_open-zos.h-t && \
+       mv $(srcdir)/iconv_open-zos.h-t $(srcdir)/iconv_open-zos.h
+
+# We need the following in order to create <inttypes.h> when the system
+# doesn't have one that works with the given compiler.
+inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \
+             -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+             -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
+             -e 's/@''GNULIB_IMAXABS''@/$(GL_M4_GNULIB_IMAXABS)/g' \
+             -e 's/@''GNULIB_IMAXDIV''@/$(GL_M4_GNULIB_IMAXDIV)/g' \
+             -e 's/@''GNULIB_STRTOIMAX''@/$(GL_M4_GNULIB_STRTOIMAX)/g' \
+             -e 's/@''GNULIB_STRTOUMAX''@/$(GL_M4_GNULIB_STRTOUMAX)/g' \
+             -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \
+             -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
+             -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
+             -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
+             -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
+             -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
+             -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
+             -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
+             -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
+             -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
+             -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/inttypes.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+
 # We need the following in order to create an empty placeholder for
 # <langinfo.h> when the system doesn't have one.
 langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
@@ -2280,9 +3876,10 @@ langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
-             -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \
+             -e 's/@''GNULIB_NL_LANGINFO''@/$(GL_M4_GNULIB_NL_LANGINFO)/g' \
              -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \
              -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \
+             -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \
              -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
              -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \
              -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
@@ -2309,65 +3906,6 @@ langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
 @GL_GENERATE_LIMITS_H_FALSE@limits.h: $(top_builddir)/config.status
 @GL_GENERATE_LIMITS_H_FALSE@   rm -f $@
 
-# We need the following in order to install a simple file in $(libdir)
-# which is shared with other installed packages. We use a list of referencing
-# packages so that "make uninstall" will remove the file if and only if it
-# is not used by another installed package.
-# On systems with glibc-2.1 or newer, the file is redundant, therefore we
-# avoid installing it.
-
-all-local: charset.alias ref-add.sed ref-del.sed
-install-exec-local: install-exec-localcharset
-install-exec-localcharset: all-local
-       if test $(GLIBC21) = no; then \
-         case '$(host_os)' in \
-           darwin[56]*) \
-             need_charset_alias=true ;; \
-           darwin* | cygwin* | mingw* | pw32* | cegcc*) \
-             need_charset_alias=false ;; \
-           *) \
-             need_charset_alias=true ;; \
-         esac ; \
-       else \
-         need_charset_alias=false ; \
-       fi ; \
-       if $$need_charset_alias; then \
-         $(mkinstalldirs) $(DESTDIR)$(libdir) ; \
-       fi ; \
-       if test -f $(charset_alias); then \
-         sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
-         $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
-         rm -f $(charset_tmp) ; \
-       else \
-         if $$need_charset_alias; then \
-           sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
-           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
-           rm -f $(charset_tmp) ; \
-         fi ; \
-       fi
-
-uninstall-local: uninstall-localcharset
-uninstall-localcharset: all-local
-       if test -f $(charset_alias); then \
-         sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
-         if grep '^# Packages using this file: $$' $(charset_tmp) \
-             > /dev/null; then \
-           rm -f $(charset_alias); \
-         else \
-           $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
-         fi; \
-         rm -f $(charset_tmp); \
-       fi
-
-charset.alias: config.charset
-       $(AM_V_GEN)rm -f t-$@ $@ && \
-       $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
-       mv t-$@ $@
-.sin.sed:
-       $(AM_V_GEN)rm -f t-$@ $@ && \
-       sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
-       mv t-$@ $@
-
 # We need the following in order to create <locale.h> when the system
 # doesn't have one that provides all definitions.
 locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
@@ -2378,15 +3916,22 @@ locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
-             -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \
-             -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \
-             -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \
+             -e 's/@''GNULIB_LOCALECONV''@/$(GL_M4_GNULIB_LOCALECONV)/g' \
+             -e 's/@''GNULIB_SETLOCALE''@/$(GL_M4_GNULIB_SETLOCALE)/g' \
+             -e 's/@''GNULIB_SETLOCALE_NULL''@/$(GL_M4_GNULIB_SETLOCALE_NULL)/g' \
+             -e 's/@''GNULIB_DUPLOCALE''@/$(GL_M4_GNULIB_DUPLOCALE)/g' \
+             -e 's/@''GNULIB_LOCALENAME''@/$(GL_M4_GNULIB_LOCALENAME)/g' \
+             -e 's|@''HAVE_NEWLOCALE''@|$(HAVE_NEWLOCALE)|g' \
              -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \
+             -e 's|@''HAVE_FREELOCALE''@|$(HAVE_FREELOCALE)|g' \
              -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
              -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \
              -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \
+             -e 's|@''REPLACE_NEWLOCALE''@|$(REPLACE_NEWLOCALE)|g' \
              -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+             -e 's|@''REPLACE_FREELOCALE''@|$(REPLACE_FREELOCALE)|g' \
              -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \
+             -e 's|@''LOCALENAME_ENHANCE_LOCALE_FUNCS''@|$(LOCALENAME_ENHANCE_LOCALE_FUNCS)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
@@ -2404,102 +3949,108 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \
-             -e 's/@''GNULIB_ACOSF''@/$(GNULIB_ACOSF)/g' \
-             -e 's/@''GNULIB_ACOSL''@/$(GNULIB_ACOSL)/g' \
-             -e 's/@''GNULIB_ASINF''@/$(GNULIB_ASINF)/g' \
-             -e 's/@''GNULIB_ASINL''@/$(GNULIB_ASINL)/g' \
-             -e 's/@''GNULIB_ATANF''@/$(GNULIB_ATANF)/g' \
-             -e 's/@''GNULIB_ATANL''@/$(GNULIB_ATANL)/g' \
-             -e 's/@''GNULIB_ATAN2F''@/$(GNULIB_ATAN2F)/g' \
-             -e 's/@''GNULIB_CBRT''@/$(GNULIB_CBRT)/g' \
-             -e 's/@''GNULIB_CBRTF''@/$(GNULIB_CBRTF)/g' \
-             -e 's/@''GNULIB_CBRTL''@/$(GNULIB_CBRTL)/g' \
-             -e 's/@''GNULIB_CEIL''@/$(GNULIB_CEIL)/g' \
-             -e 's/@''GNULIB_CEILF''@/$(GNULIB_CEILF)/g' \
-             -e 's/@''GNULIB_CEILL''@/$(GNULIB_CEILL)/g' \
-             -e 's/@''GNULIB_COPYSIGN''@/$(GNULIB_COPYSIGN)/g' \
-             -e 's/@''GNULIB_COPYSIGNF''@/$(GNULIB_COPYSIGNF)/g' \
-             -e 's/@''GNULIB_COPYSIGNL''@/$(GNULIB_COPYSIGNL)/g' \
-             -e 's/@''GNULIB_COSF''@/$(GNULIB_COSF)/g' \
-             -e 's/@''GNULIB_COSL''@/$(GNULIB_COSL)/g' \
-             -e 's/@''GNULIB_COSHF''@/$(GNULIB_COSHF)/g' \
-             -e 's/@''GNULIB_EXPF''@/$(GNULIB_EXPF)/g' \
-             -e 's/@''GNULIB_EXPL''@/$(GNULIB_EXPL)/g' \
-             -e 's/@''GNULIB_EXP2''@/$(GNULIB_EXP2)/g' \
-             -e 's/@''GNULIB_EXP2F''@/$(GNULIB_EXP2F)/g' \
-             -e 's/@''GNULIB_EXP2L''@/$(GNULIB_EXP2L)/g' \
-             -e 's/@''GNULIB_EXPM1''@/$(GNULIB_EXPM1)/g' \
-             -e 's/@''GNULIB_EXPM1F''@/$(GNULIB_EXPM1F)/g' \
-             -e 's/@''GNULIB_EXPM1L''@/$(GNULIB_EXPM1L)/g' \
-             -e 's/@''GNULIB_FABSF''@/$(GNULIB_FABSF)/g' \
-             -e 's/@''GNULIB_FABSL''@/$(GNULIB_FABSL)/g' \
-             -e 's/@''GNULIB_FLOOR''@/$(GNULIB_FLOOR)/g' \
-             -e 's/@''GNULIB_FLOORF''@/$(GNULIB_FLOORF)/g' \
-             -e 's/@''GNULIB_FLOORL''@/$(GNULIB_FLOORL)/g' \
-             -e 's/@''GNULIB_FMA''@/$(GNULIB_FMA)/g' \
-             -e 's/@''GNULIB_FMAF''@/$(GNULIB_FMAF)/g' \
-             -e 's/@''GNULIB_FMAL''@/$(GNULIB_FMAL)/g' \
-             -e 's/@''GNULIB_FMOD''@/$(GNULIB_FMOD)/g' \
-             -e 's/@''GNULIB_FMODF''@/$(GNULIB_FMODF)/g' \
-             -e 's/@''GNULIB_FMODL''@/$(GNULIB_FMODL)/g' \
-             -e 's/@''GNULIB_FREXPF''@/$(GNULIB_FREXPF)/g' \
-             -e 's/@''GNULIB_FREXP''@/$(GNULIB_FREXP)/g' \
-             -e 's/@''GNULIB_FREXPL''@/$(GNULIB_FREXPL)/g' \
-             -e 's/@''GNULIB_HYPOT''@/$(GNULIB_HYPOT)/g' \
-             -e 's/@''GNULIB_HYPOTF''@/$(GNULIB_HYPOTF)/g' \
-             -e 's/@''GNULIB_HYPOTL''@/$(GNULIB_HYPOTL)/g' \
+             -e 's/@''GNULIB_ACOSF''@/$(GL_M4_GNULIB_ACOSF)/g' \
+             -e 's/@''GNULIB_ACOSL''@/$(GL_M4_GNULIB_ACOSL)/g' \
+             -e 's/@''GNULIB_ASINF''@/$(GL_M4_GNULIB_ASINF)/g' \
+             -e 's/@''GNULIB_ASINL''@/$(GL_M4_GNULIB_ASINL)/g' \
+             -e 's/@''GNULIB_ATANF''@/$(GL_M4_GNULIB_ATANF)/g' \
+             -e 's/@''GNULIB_ATANL''@/$(GL_M4_GNULIB_ATANL)/g' \
+             -e 's/@''GNULIB_ATAN2F''@/$(GL_M4_GNULIB_ATAN2F)/g' \
+             -e 's/@''GNULIB_CBRT''@/$(GL_M4_GNULIB_CBRT)/g' \
+             -e 's/@''GNULIB_CBRTF''@/$(GL_M4_GNULIB_CBRTF)/g' \
+             -e 's/@''GNULIB_CBRTL''@/$(GL_M4_GNULIB_CBRTL)/g' \
+             -e 's/@''GNULIB_CEIL''@/$(GL_M4_GNULIB_CEIL)/g' \
+             -e 's/@''GNULIB_CEILF''@/$(GL_M4_GNULIB_CEILF)/g' \
+             -e 's/@''GNULIB_CEILL''@/$(GL_M4_GNULIB_CEILL)/g' \
+             -e 's/@''GNULIB_COPYSIGN''@/$(GL_M4_GNULIB_COPYSIGN)/g' \
+             -e 's/@''GNULIB_COPYSIGNF''@/$(GL_M4_GNULIB_COPYSIGNF)/g' \
+             -e 's/@''GNULIB_COPYSIGNL''@/$(GL_M4_GNULIB_COPYSIGNL)/g' \
+             -e 's/@''GNULIB_COSF''@/$(GL_M4_GNULIB_COSF)/g' \
+             -e 's/@''GNULIB_COSL''@/$(GL_M4_GNULIB_COSL)/g' \
+             -e 's/@''GNULIB_COSHF''@/$(GL_M4_GNULIB_COSHF)/g' \
+             -e 's/@''GNULIB_EXPF''@/$(GL_M4_GNULIB_EXPF)/g' \
+             -e 's/@''GNULIB_EXPL''@/$(GL_M4_GNULIB_EXPL)/g' \
+             -e 's/@''GNULIB_EXP2''@/$(GL_M4_GNULIB_EXP2)/g' \
+             -e 's/@''GNULIB_EXP2F''@/$(GL_M4_GNULIB_EXP2F)/g' \
+             -e 's/@''GNULIB_EXP2L''@/$(GL_M4_GNULIB_EXP2L)/g' \
+             -e 's/@''GNULIB_EXPM1''@/$(GL_M4_GNULIB_EXPM1)/g' \
+             -e 's/@''GNULIB_EXPM1F''@/$(GL_M4_GNULIB_EXPM1F)/g' \
+             -e 's/@''GNULIB_EXPM1L''@/$(GL_M4_GNULIB_EXPM1L)/g' \
+             -e 's/@''GNULIB_FABSF''@/$(GL_M4_GNULIB_FABSF)/g' \
+             -e 's/@''GNULIB_FABSL''@/$(GL_M4_GNULIB_FABSL)/g' \
+             -e 's/@''GNULIB_FLOOR''@/$(GL_M4_GNULIB_FLOOR)/g' \
+             -e 's/@''GNULIB_FLOORF''@/$(GL_M4_GNULIB_FLOORF)/g' \
+             -e 's/@''GNULIB_FLOORL''@/$(GL_M4_GNULIB_FLOORL)/g' \
+             -e 's/@''GNULIB_FMA''@/$(GL_M4_GNULIB_FMA)/g' \
+             -e 's/@''GNULIB_FMAF''@/$(GL_M4_GNULIB_FMAF)/g' \
+             -e 's/@''GNULIB_FMAL''@/$(GL_M4_GNULIB_FMAL)/g' \
+             -e 's/@''GNULIB_FMOD''@/$(GL_M4_GNULIB_FMOD)/g' \
+             -e 's/@''GNULIB_FMODF''@/$(GL_M4_GNULIB_FMODF)/g' \
+             -e 's/@''GNULIB_FMODL''@/$(GL_M4_GNULIB_FMODL)/g' \
+             -e 's/@''GNULIB_FREXPF''@/$(GL_M4_GNULIB_FREXPF)/g' \
+             -e 's/@''GNULIB_FREXP''@/$(GL_M4_GNULIB_FREXP)/g' \
+             -e 's/@''GNULIB_FREXPL''@/$(GL_M4_GNULIB_FREXPL)/g' \
+             -e 's/@''GNULIB_HYPOT''@/$(GL_M4_GNULIB_HYPOT)/g' \
+             -e 's/@''GNULIB_HYPOTF''@/$(GL_M4_GNULIB_HYPOTF)/g' \
+             -e 's/@''GNULIB_HYPOTL''@/$(GL_M4_GNULIB_HYPOTL)/g' \
              < $(srcdir)/math.in.h | \
-         sed -e 's/@''GNULIB_ILOGB''@/$(GNULIB_ILOGB)/g' \
-             -e 's/@''GNULIB_ILOGBF''@/$(GNULIB_ILOGBF)/g' \
-             -e 's/@''GNULIB_ILOGBL''@/$(GNULIB_ILOGBL)/g' \
-             -e 's/@''GNULIB_ISFINITE''@/$(GNULIB_ISFINITE)/g' \
-             -e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \
-             -e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \
-             -e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \
-             -e 's/@''GNULIB_ISNAND''@/$(GNULIB_ISNAND)/g' \
-             -e 's/@''GNULIB_ISNANL''@/$(GNULIB_ISNANL)/g' \
-             -e 's/@''GNULIB_LDEXPF''@/$(GNULIB_LDEXPF)/g' \
-             -e 's/@''GNULIB_LDEXPL''@/$(GNULIB_LDEXPL)/g' \
-             -e 's/@''GNULIB_LOG''@/$(GNULIB_LOG)/g' \
-             -e 's/@''GNULIB_LOGF''@/$(GNULIB_LOGF)/g' \
-             -e 's/@''GNULIB_LOGL''@/$(GNULIB_LOGL)/g' \
-             -e 's/@''GNULIB_LOG10''@/$(GNULIB_LOG10)/g' \
-             -e 's/@''GNULIB_LOG10F''@/$(GNULIB_LOG10F)/g' \
-             -e 's/@''GNULIB_LOG10L''@/$(GNULIB_LOG10L)/g' \
-             -e 's/@''GNULIB_LOG1P''@/$(GNULIB_LOG1P)/g' \
-             -e 's/@''GNULIB_LOG1PF''@/$(GNULIB_LOG1PF)/g' \
-             -e 's/@''GNULIB_LOG1PL''@/$(GNULIB_LOG1PL)/g' \
-             -e 's/@''GNULIB_LOG2''@/$(GNULIB_LOG2)/g' \
-             -e 's/@''GNULIB_LOG2F''@/$(GNULIB_LOG2F)/g' \
-             -e 's/@''GNULIB_LOG2L''@/$(GNULIB_LOG2L)/g' \
-             -e 's/@''GNULIB_LOGB''@/$(GNULIB_LOGB)/g' \
-             -e 's/@''GNULIB_LOGBF''@/$(GNULIB_LOGBF)/g' \
-             -e 's/@''GNULIB_LOGBL''@/$(GNULIB_LOGBL)/g' \
-             -e 's/@''GNULIB_MODF''@/$(GNULIB_MODF)/g' \
-             -e 's/@''GNULIB_MODFF''@/$(GNULIB_MODFF)/g' \
-             -e 's/@''GNULIB_MODFL''@/$(GNULIB_MODFL)/g' \
-             -e 's/@''GNULIB_POWF''@/$(GNULIB_POWF)/g' \
-             -e 's/@''GNULIB_REMAINDER''@/$(GNULIB_REMAINDER)/g' \
-             -e 's/@''GNULIB_REMAINDERF''@/$(GNULIB_REMAINDERF)/g' \
-             -e 's/@''GNULIB_REMAINDERL''@/$(GNULIB_REMAINDERL)/g' \
-             -e 's/@''GNULIB_RINT''@/$(GNULIB_RINT)/g' \
-             -e 's/@''GNULIB_RINTF''@/$(GNULIB_RINTF)/g' \
-             -e 's/@''GNULIB_RINTL''@/$(GNULIB_RINTL)/g' \
-             -e 's/@''GNULIB_ROUND''@/$(GNULIB_ROUND)/g' \
-             -e 's/@''GNULIB_ROUNDF''@/$(GNULIB_ROUNDF)/g' \
-             -e 's/@''GNULIB_ROUNDL''@/$(GNULIB_ROUNDL)/g' \
-             -e 's/@''GNULIB_SIGNBIT''@/$(GNULIB_SIGNBIT)/g' \
-             -e 's/@''GNULIB_SINF''@/$(GNULIB_SINF)/g' \
-             -e 's/@''GNULIB_SINL''@/$(GNULIB_SINL)/g' \
-             -e 's/@''GNULIB_SINHF''@/$(GNULIB_SINHF)/g' \
-             -e 's/@''GNULIB_SQRTF''@/$(GNULIB_SQRTF)/g' \
-             -e 's/@''GNULIB_SQRTL''@/$(GNULIB_SQRTL)/g' \
-             -e 's/@''GNULIB_TANF''@/$(GNULIB_TANF)/g' \
-             -e 's/@''GNULIB_TANL''@/$(GNULIB_TANL)/g' \
-             -e 's/@''GNULIB_TANHF''@/$(GNULIB_TANHF)/g' \
-             -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \
-             -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \
-             -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \
+         sed -e 's/@''GNULIB_ILOGB''@/$(GL_M4_GNULIB_ILOGB)/g' \
+             -e 's/@''GNULIB_ILOGBF''@/$(GL_M4_GNULIB_ILOGBF)/g' \
+             -e 's/@''GNULIB_ILOGBL''@/$(GL_M4_GNULIB_ILOGBL)/g' \
+             -e 's/@''GNULIB_ISFINITE''@/$(GL_M4_GNULIB_ISFINITE)/g' \
+             -e 's/@''GNULIB_ISINF''@/$(GL_M4_GNULIB_ISINF)/g' \
+             -e 's/@''GNULIB_ISNAN''@/$(GL_M4_GNULIB_ISNAN)/g' \
+             -e 's/@''GNULIB_ISNANF''@/$(GL_M4_GNULIB_ISNANF)/g' \
+             -e 's/@''GNULIB_ISNAND''@/$(GL_M4_GNULIB_ISNAND)/g' \
+             -e 's/@''GNULIB_ISNANL''@/$(GL_M4_GNULIB_ISNANL)/g' \
+             -e 's/@''GNULIB_LDEXPF''@/$(GL_M4_GNULIB_LDEXPF)/g' \
+             -e 's/@''GNULIB_LDEXPL''@/$(GL_M4_GNULIB_LDEXPL)/g' \
+             -e 's/@''GNULIB_LOG''@/$(GL_M4_GNULIB_LOG)/g' \
+             -e 's/@''GNULIB_LOGF''@/$(GL_M4_GNULIB_LOGF)/g' \
+             -e 's/@''GNULIB_LOGL''@/$(GL_M4_GNULIB_LOGL)/g' \
+             -e 's/@''GNULIB_LOG10''@/$(GL_M4_GNULIB_LOG10)/g' \
+             -e 's/@''GNULIB_LOG10F''@/$(GL_M4_GNULIB_LOG10F)/g' \
+             -e 's/@''GNULIB_LOG10L''@/$(GL_M4_GNULIB_LOG10L)/g' \
+             -e 's/@''GNULIB_LOG1P''@/$(GL_M4_GNULIB_LOG1P)/g' \
+             -e 's/@''GNULIB_LOG1PF''@/$(GL_M4_GNULIB_LOG1PF)/g' \
+             -e 's/@''GNULIB_LOG1PL''@/$(GL_M4_GNULIB_LOG1PL)/g' \
+             -e 's/@''GNULIB_LOG2''@/$(GL_M4_GNULIB_LOG2)/g' \
+             -e 's/@''GNULIB_LOG2F''@/$(GL_M4_GNULIB_LOG2F)/g' \
+             -e 's/@''GNULIB_LOG2L''@/$(GL_M4_GNULIB_LOG2L)/g' \
+             -e 's/@''GNULIB_LOGB''@/$(GL_M4_GNULIB_LOGB)/g' \
+             -e 's/@''GNULIB_LOGBF''@/$(GL_M4_GNULIB_LOGBF)/g' \
+             -e 's/@''GNULIB_LOGBL''@/$(GL_M4_GNULIB_LOGBL)/g' \
+             -e 's/@''GNULIB_MODF''@/$(GL_M4_GNULIB_MODF)/g' \
+             -e 's/@''GNULIB_MODFF''@/$(GL_M4_GNULIB_MODFF)/g' \
+             -e 's/@''GNULIB_MODFL''@/$(GL_M4_GNULIB_MODFL)/g' \
+             -e 's/@''GNULIB_POWF''@/$(GL_M4_GNULIB_POWF)/g' \
+             -e 's/@''GNULIB_REMAINDER''@/$(GL_M4_GNULIB_REMAINDER)/g' \
+             -e 's/@''GNULIB_REMAINDERF''@/$(GL_M4_GNULIB_REMAINDERF)/g' \
+             -e 's/@''GNULIB_REMAINDERL''@/$(GL_M4_GNULIB_REMAINDERL)/g' \
+             -e 's/@''GNULIB_RINT''@/$(GL_M4_GNULIB_RINT)/g' \
+             -e 's/@''GNULIB_RINTF''@/$(GL_M4_GNULIB_RINTF)/g' \
+             -e 's/@''GNULIB_RINTL''@/$(GL_M4_GNULIB_RINTL)/g' \
+             -e 's/@''GNULIB_ROUND''@/$(GL_M4_GNULIB_ROUND)/g' \
+             -e 's/@''GNULIB_ROUNDF''@/$(GL_M4_GNULIB_ROUNDF)/g' \
+             -e 's/@''GNULIB_ROUNDL''@/$(GL_M4_GNULIB_ROUNDL)/g' \
+             -e 's/@''GNULIB_SIGNBIT''@/$(GL_M4_GNULIB_SIGNBIT)/g' \
+             -e 's/@''GNULIB_SINF''@/$(GL_M4_GNULIB_SINF)/g' \
+             -e 's/@''GNULIB_SINL''@/$(GL_M4_GNULIB_SINL)/g' \
+             -e 's/@''GNULIB_SINHF''@/$(GL_M4_GNULIB_SINHF)/g' \
+             -e 's/@''GNULIB_SQRTF''@/$(GL_M4_GNULIB_SQRTF)/g' \
+             -e 's/@''GNULIB_SQRTL''@/$(GL_M4_GNULIB_SQRTL)/g' \
+             -e 's/@''GNULIB_TANF''@/$(GL_M4_GNULIB_TANF)/g' \
+             -e 's/@''GNULIB_TANL''@/$(GL_M4_GNULIB_TANL)/g' \
+             -e 's/@''GNULIB_TANHF''@/$(GL_M4_GNULIB_TANHF)/g' \
+             -e 's/@''GNULIB_TRUNC''@/$(GL_M4_GNULIB_TRUNC)/g' \
+             -e 's/@''GNULIB_TRUNCF''@/$(GL_M4_GNULIB_TRUNCF)/g' \
+             -e 's/@''GNULIB_TRUNCL''@/$(GL_M4_GNULIB_TRUNCL)/g' \
+             -e 's/@''GNULIB_MDA_J0''@/$(GL_M4_GNULIB_MDA_J0)/g' \
+             -e 's/@''GNULIB_MDA_J1''@/$(GL_M4_GNULIB_MDA_J1)/g' \
+             -e 's/@''GNULIB_MDA_JN''@/$(GL_M4_GNULIB_MDA_JN)/g' \
+             -e 's/@''GNULIB_MDA_Y0''@/$(GL_M4_GNULIB_MDA_Y0)/g' \
+             -e 's/@''GNULIB_MDA_Y1''@/$(GL_M4_GNULIB_MDA_Y1)/g' \
+             -e 's/@''GNULIB_MDA_YN''@/$(GL_M4_GNULIB_MDA_YN)/g' \
          | \
          sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \
              -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
@@ -2610,8 +4161,10 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''REPLACE_COSF''@|$(REPLACE_COSF)|g' \
              -e 's|@''REPLACE_COSHF''@|$(REPLACE_COSHF)|g' \
              -e 's|@''REPLACE_EXPF''@|$(REPLACE_EXPF)|g' \
+             -e 's|@''REPLACE_EXPL''@|$(REPLACE_EXPL)|g' \
              -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \
              -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \
+             -e 's|@''REPLACE_EXPM1L''@|$(REPLACE_EXPM1L)|g' \
              -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \
              -e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \
              -e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \
@@ -2633,6 +4186,7 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \
              -e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \
              -e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \
+             -e 's|@''REPLACE_ILOGBL''@|$(REPLACE_ILOGBL)|g' \
              -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \
              -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \
              -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \
@@ -2660,11 +4214,12 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \
              -e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \
              -e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \
+             -e 's|@''REPLACE_RINTL''@|$(REPLACE_RINTL)|g' \
              -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \
              -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \
              -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
              -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
-             -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
+             -e 's|@''REPLACE_SIGNBIT_USING_BUILTINS''@|$(REPLACE_SIGNBIT_USING_BUILTINS)|g' \
              -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \
              -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \
              -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \
@@ -2682,22 +4237,25 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
 
 # We need the following in order to create a replacement for <sched.h> when
 # the system doesn't have one.
-@GL_GENERATE_SCHED_H_TRUE@sched.h: sched.in.h $(top_builddir)/config.status
-@GL_GENERATE_SCHED_H_TRUE@     $(AM_V_GEN)rm -f $@-t $@ && \
-@GL_GENERATE_SCHED_H_TRUE@     { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-@GL_GENERATE_SCHED_H_TRUE@       sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
-@GL_GENERATE_SCHED_H_TRUE@           -e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \
-@GL_GENERATE_SCHED_H_TRUE@           -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
-@GL_GENERATE_SCHED_H_TRUE@           -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-@GL_GENERATE_SCHED_H_TRUE@           -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-@GL_GENERATE_SCHED_H_TRUE@           -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-@GL_GENERATE_SCHED_H_TRUE@           -e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \
-@GL_GENERATE_SCHED_H_TRUE@           -e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g' \
-@GL_GENERATE_SCHED_H_TRUE@           < $(srcdir)/sched.in.h; \
-@GL_GENERATE_SCHED_H_TRUE@     } > $@-t && \
-@GL_GENERATE_SCHED_H_TRUE@     mv $@-t $@
-@GL_GENERATE_SCHED_H_FALSE@sched.h: $(top_builddir)/config.status
-@GL_GENERATE_SCHED_H_FALSE@    rm -f $@
+sched.h: sched.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''HAVE_SCHED_H''@|$(HAVE_SCHED_H)|g' \
+             -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \
+             -e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g' \
+             -e 's/@''GNULIB_SCHED_YIELD''@/$(GL_M4_GNULIB_SCHED_YIELD)/g' \
+             -e 's|@''HAVE_SCHED_YIELD''@|$(HAVE_SCHED_YIELD)|g' \
+             -e 's|@''REPLACE_SCHED_YIELD''@|$(REPLACE_SCHED_YIELD)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sched.in.h; \
+       } > $@-t && \
+       mv $@-t $@
 
 # We need the following in order to create <signal.h> when the system
 # doesn't have a complete one.
@@ -2709,11 +4267,11 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
-             -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \
-             -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \
-             -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
-             -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
-             -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \
+             -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GL_M4_GNULIB_PTHREAD_SIGMASK)/g' \
+             -e 's/@''GNULIB_RAISE''@/$(GL_M4_GNULIB_RAISE)/g' \
+             -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GL_M4_GNULIB_SIGNAL_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_SIGPROCMASK''@/$(GL_M4_GNULIB_SIGPROCMASK)/g' \
+             -e 's/@''GNULIB_SIGACTION''@/$(GL_M4_GNULIB_SIGACTION)/g' \
              -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \
              -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \
              -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \
@@ -2731,41 +4289,15 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              < $(srcdir)/signal.in.h; \
        } > $@-t && \
        mv $@-t $@
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
-# off.
-arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
-# The c++defs.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/c++defs.h \
-         > $@-t && \
-       mv $@-t $@
-# The unused-parameter.h that gets inserted into generated .h files is the same
-# as build-aux/snippet/unused-parameter.h, except that it has the copyright
-# header cut off.
-unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/unused-parameter.h \
-         > $@-t && \
-       mv $@-t $@
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
-# off.
-warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
-         > $@-t && \
-       mv $@-t $@
+
+@GL_GENERATE_SIGSEGV_H_TRUE@sigsegv.h: sigsegv.in.h $(top_builddir)/config.status
+@GL_GENERATE_SIGSEGV_H_TRUE@   $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_SIGSEGV_H_TRUE@   { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_SIGSEGV_H_TRUE@     cat $(srcdir)/sigsegv.in.h; \
+@GL_GENERATE_SIGSEGV_H_TRUE@   } > $@-t && \
+@GL_GENERATE_SIGSEGV_H_TRUE@   mv $@-t $@
+@GL_GENERATE_SIGSEGV_H_FALSE@sigsegv.h: $(top_builddir)/config.status
+@GL_GENERATE_SIGSEGV_H_FALSE@  rm -f $@
 
 # We need the following in order to create a replacement for <spawn.h> when
 # the system doesn't have one.
@@ -2778,33 +4310,39 @@ spawn.h: spawn.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SPAWN_H''@|$(NEXT_SPAWN_H)|g' \
-             -e 's/@''GNULIB_POSIX_SPAWN''@/$(GNULIB_POSIX_SPAWN)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNP''@/$(GNULIB_POSIX_SPAWNP)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_INIT''@/$(GNULIB_POSIX_SPAWNATTR_INIT)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETFLAGS''@/$(GNULIB_POSIX_SPAWNATTR_GETFLAGS)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETFLAGS''@/$(GNULIB_POSIX_SPAWNATTR_SETFLAGS)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETPGROUP''@/$(GNULIB_POSIX_SPAWNATTR_GETPGROUP)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETPGROUP''@/$(GNULIB_POSIX_SPAWNATTR_SETPGROUP)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM''@/$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM''@/$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY''@/$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY''@/$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT''@/$(GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT''@/$(GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGMASK''@/$(GNULIB_POSIX_SPAWNATTR_GETSIGMASK)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGMASK''@/$(GNULIB_POSIX_SPAWNATTR_SETSIGMASK)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_DESTROY''@/$(GNULIB_POSIX_SPAWNATTR_DESTROY)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN''@/$(GL_M4_GNULIB_POSIX_SPAWN)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNP''@/$(GL_M4_GNULIB_POSIX_SPAWNP)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_INIT''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_INIT)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETFLAGS''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETFLAGS''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETPGROUP''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETPGROUP''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGMASK''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGMASK''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_DESTROY''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY)/g' \
              -e 's|@''HAVE_POSIX_SPAWN''@|$(HAVE_POSIX_SPAWN)|g' \
              -e 's|@''HAVE_POSIX_SPAWNATTR_T''@|$(HAVE_POSIX_SPAWNATTR_T)|g' \
              -e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_T''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_T)|g' \
+             -e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)|g' \
+             -e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)|g' \
              -e 's|@''REPLACE_POSIX_SPAWN''@|$(REPLACE_POSIX_SPAWN)|g' \
+             -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)|g' \
              -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)|g' \
              -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)|g' \
+             -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)|g' \
              -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
@@ -2813,6 +4351,17 @@ spawn.h: spawn.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
        } > $@-t && \
        mv $@-t $@
 
+# We need the following in order to create <stdalign.h> when the system
+# doesn't have one that works.
+@GL_GENERATE_STDALIGN_H_TRUE@stdalign.h: stdalign.in.h $(top_builddir)/config.status
+@GL_GENERATE_STDALIGN_H_TRUE@  $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_STDALIGN_H_TRUE@  { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_STDALIGN_H_TRUE@    cat $(srcdir)/stdalign.in.h; \
+@GL_GENERATE_STDALIGN_H_TRUE@  } > $@-t && \
+@GL_GENERATE_STDALIGN_H_TRUE@  mv $@-t $@
+@GL_GENERATE_STDALIGN_H_FALSE@stdalign.h: $(top_builddir)/config.status
+@GL_GENERATE_STDALIGN_H_FALSE@ rm -f $@
+
 # We need the following in order to create <stdarg.h> when the system
 # doesn't have one that works with the given compiler.
 @GL_GENERATE_STDARG_H_TRUE@stdarg.h: stdarg.in.h $(top_builddir)/config.status
@@ -2876,8 +4425,6 @@ spawn.h: spawn.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
 @GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
 @GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
 @GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
-@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
-@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
 @GL_GENERATE_STDINT_H_TRUE@          -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
 @GL_GENERATE_STDINT_H_TRUE@          -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
 @GL_GENERATE_STDINT_H_TRUE@          -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
@@ -2892,7 +4439,7 @@ spawn.h: spawn.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
 @GL_GENERATE_STDINT_H_TRUE@          -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
 @GL_GENERATE_STDINT_H_TRUE@          -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
 @GL_GENERATE_STDINT_H_TRUE@          -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
-@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
+@GL_GENERATE_STDINT_H_TRUE@          -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
 @GL_GENERATE_STDINT_H_TRUE@          < $(srcdir)/stdint.in.h; \
 @GL_GENERATE_STDINT_H_TRUE@    } > $@-t && \
 @GL_GENERATE_STDINT_H_TRUE@    mv $@-t $@
@@ -2909,61 +4456,68 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-             -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
-             -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
-             -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
-             -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
-             -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
-             -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
-             -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
-             -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
-             -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
-             -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
-             -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
-             -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
-             -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
-             -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
-             -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
-             -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
-             -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
-             -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
-             -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
-             -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
-             -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
-             -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
-             -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
-             -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
-             -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
-             -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
-             -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
-             -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
-             -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
-             -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
-             -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
-             -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
-             -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
-             -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
-             -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
-             -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
-             -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
-             -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
-             -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
-             -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
-             -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
-             -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
-             -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
-             -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
-             -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
-             -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
-             -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_DPRINTF''@/$(GL_M4_GNULIB_DPRINTF)/g' \
+             -e 's/@''GNULIB_FCLOSE''@/$(GL_M4_GNULIB_FCLOSE)/g' \
+             -e 's/@''GNULIB_FDOPEN''@/$(GL_M4_GNULIB_FDOPEN)/g' \
+             -e 's/@''GNULIB_FFLUSH''@/$(GL_M4_GNULIB_FFLUSH)/g' \
+             -e 's/@''GNULIB_FGETC''@/$(GL_M4_GNULIB_FGETC)/g' \
+             -e 's/@''GNULIB_FGETS''@/$(GL_M4_GNULIB_FGETS)/g' \
+             -e 's/@''GNULIB_FOPEN''@/$(GL_M4_GNULIB_FOPEN)/g' \
+             -e 's/@''GNULIB_FPRINTF''@/$(GL_M4_GNULIB_FPRINTF)/g' \
+             -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GL_M4_GNULIB_FPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_FPURGE''@/$(GL_M4_GNULIB_FPURGE)/g' \
+             -e 's/@''GNULIB_FPUTC''@/$(GL_M4_GNULIB_FPUTC)/g' \
+             -e 's/@''GNULIB_FPUTS''@/$(GL_M4_GNULIB_FPUTS)/g' \
+             -e 's/@''GNULIB_FREAD''@/$(GL_M4_GNULIB_FREAD)/g' \
+             -e 's/@''GNULIB_FREOPEN''@/$(GL_M4_GNULIB_FREOPEN)/g' \
+             -e 's/@''GNULIB_FSCANF''@/$(GL_M4_GNULIB_FSCANF)/g' \
+             -e 's/@''GNULIB_FSEEK''@/$(GL_M4_GNULIB_FSEEK)/g' \
+             -e 's/@''GNULIB_FSEEKO''@/$(GL_M4_GNULIB_FSEEKO)/g' \
+             -e 's/@''GNULIB_FTELL''@/$(GL_M4_GNULIB_FTELL)/g' \
+             -e 's/@''GNULIB_FTELLO''@/$(GL_M4_GNULIB_FTELLO)/g' \
+             -e 's/@''GNULIB_FWRITE''@/$(GL_M4_GNULIB_FWRITE)/g' \
+             -e 's/@''GNULIB_GETC''@/$(GL_M4_GNULIB_GETC)/g' \
+             -e 's/@''GNULIB_GETCHAR''@/$(GL_M4_GNULIB_GETCHAR)/g' \
+             -e 's/@''GNULIB_GETDELIM''@/$(GL_M4_GNULIB_GETDELIM)/g' \
+             -e 's/@''GNULIB_GETLINE''@/$(GL_M4_GNULIB_GETLINE)/g' \
+             -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GL_M4_GNULIB_OBSTACK_PRINTF)/g' \
+             -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GL_M4_GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_PCLOSE''@/$(GL_M4_GNULIB_PCLOSE)/g' \
+             -e 's/@''GNULIB_PERROR''@/$(GL_M4_GNULIB_PERROR)/g' \
+             -e 's/@''GNULIB_POPEN''@/$(GL_M4_GNULIB_POPEN)/g' \
+             -e 's/@''GNULIB_PRINTF''@/$(GL_M4_GNULIB_PRINTF)/g' \
+             -e 's/@''GNULIB_PRINTF_POSIX''@/$(GL_M4_GNULIB_PRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_PUTC''@/$(GL_M4_GNULIB_PUTC)/g' \
+             -e 's/@''GNULIB_PUTCHAR''@/$(GL_M4_GNULIB_PUTCHAR)/g' \
+             -e 's/@''GNULIB_PUTS''@/$(GL_M4_GNULIB_PUTS)/g' \
+             -e 's/@''GNULIB_REMOVE''@/$(GL_M4_GNULIB_REMOVE)/g' \
+             -e 's/@''GNULIB_RENAME''@/$(GL_M4_GNULIB_RENAME)/g' \
+             -e 's/@''GNULIB_RENAMEAT''@/$(GL_M4_GNULIB_RENAMEAT)/g' \
+             -e 's/@''GNULIB_SCANF''@/$(GL_M4_GNULIB_SCANF)/g' \
+             -e 's/@''GNULIB_SNPRINTF''@/$(GL_M4_GNULIB_SNPRINTF)/g' \
+             -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_M4_GNULIB_SPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_M4_GNULIB_STDIO_H_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_M4_GNULIB_STDIO_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_TMPFILE''@/$(GL_M4_GNULIB_TMPFILE)/g' \
+             -e 's/@''GNULIB_VASPRINTF''@/$(GL_M4_GNULIB_VASPRINTF)/g' \
+             -e 's/@''GNULIB_VDPRINTF''@/$(GL_M4_GNULIB_VDPRINTF)/g' \
+             -e 's/@''GNULIB_VFPRINTF''@/$(GL_M4_GNULIB_VFPRINTF)/g' \
+             -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_M4_GNULIB_VFPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_VFSCANF''@/$(GL_M4_GNULIB_VFSCANF)/g' \
+             -e 's/@''GNULIB_VSCANF''@/$(GL_M4_GNULIB_VSCANF)/g' \
+             -e 's/@''GNULIB_VPRINTF''@/$(GL_M4_GNULIB_VPRINTF)/g' \
+             -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_M4_GNULIB_VPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_VSNPRINTF''@/$(GL_M4_GNULIB_VSNPRINTF)/g' \
+             -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_M4_GNULIB_VSPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_M4_GNULIB_MDA_FCLOSEALL)/g' \
+             -e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_M4_GNULIB_MDA_FDOPEN)/g' \
+             -e 's/@''GNULIB_MDA_FILENO''@/$(GL_M4_GNULIB_MDA_FILENO)/g' \
+             -e 's/@''GNULIB_MDA_GETW''@/$(GL_M4_GNULIB_MDA_GETW)/g' \
+             -e 's/@''GNULIB_MDA_PUTW''@/$(GL_M4_GNULIB_MDA_PUTW)/g' \
+             -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GL_M4_GNULIB_MDA_TEMPNAM)/g' \
              < $(srcdir)/stdio.in.h | \
-         sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+         sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
+             -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
              -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
              -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
              -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
@@ -3029,51 +4583,71 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
-             -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
-             -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
-             -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
-             -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
-             -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
-             -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
-             -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
-             -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \
-             -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \
-             -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \
-             -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \
-             -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
-             -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
-             -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
-             -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \
-             -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
-             -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
-             -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
-             -e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \
-             -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
-             -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
-             -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
-             -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
-             -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
-             -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
-             -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
-             -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
-             -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
-             -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
-             -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
-             -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
-             -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
-             -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
+             -e 's/@''GNULIB__EXIT''@/$(GL_M4_GNULIB__EXIT)/g' \
+             -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GL_M4_GNULIB_ALIGNED_ALLOC)/g' \
+             -e 's/@''GNULIB_ATOLL''@/$(GL_M4_GNULIB_ATOLL)/g' \
+             -e 's/@''GNULIB_CALLOC_POSIX''@/$(GL_M4_GNULIB_CALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GL_M4_GNULIB_CANONICALIZE_FILE_NAME)/g' \
+             -e 's/@''GNULIB_FREE_POSIX''@/$(GL_M4_GNULIB_FREE_POSIX)/g' \
+             -e 's/@''GNULIB_GETLOADAVG''@/$(GL_M4_GNULIB_GETLOADAVG)/g' \
+             -e 's/@''GNULIB_GETSUBOPT''@/$(GL_M4_GNULIB_GETSUBOPT)/g' \
+             -e 's/@''GNULIB_GRANTPT''@/$(GL_M4_GNULIB_GRANTPT)/g' \
+             -e 's/@''GNULIB_MALLOC_POSIX''@/$(GL_M4_GNULIB_MALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_MBTOWC''@/$(GL_M4_GNULIB_MBTOWC)/g' \
+             -e 's/@''GNULIB_MKDTEMP''@/$(GL_M4_GNULIB_MKDTEMP)/g' \
+             -e 's/@''GNULIB_MKOSTEMP''@/$(GL_M4_GNULIB_MKOSTEMP)/g' \
+             -e 's/@''GNULIB_MKOSTEMPS''@/$(GL_M4_GNULIB_MKOSTEMPS)/g' \
+             -e 's/@''GNULIB_MKSTEMP''@/$(GL_M4_GNULIB_MKSTEMP)/g' \
+             -e 's/@''GNULIB_MKSTEMPS''@/$(GL_M4_GNULIB_MKSTEMPS)/g' \
+             -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GL_M4_GNULIB_POSIX_MEMALIGN)/g' \
+             -e 's/@''GNULIB_POSIX_OPENPT''@/$(GL_M4_GNULIB_POSIX_OPENPT)/g' \
+             -e 's/@''GNULIB_PTSNAME''@/$(GL_M4_GNULIB_PTSNAME)/g' \
+             -e 's/@''GNULIB_PTSNAME_R''@/$(GL_M4_GNULIB_PTSNAME_R)/g' \
+             -e 's/@''GNULIB_PUTENV''@/$(GL_M4_GNULIB_PUTENV)/g' \
+             -e 's/@''GNULIB_QSORT_R''@/$(GL_M4_GNULIB_QSORT_R)/g' \
+             -e 's/@''GNULIB_RANDOM''@/$(GL_M4_GNULIB_RANDOM)/g' \
+             -e 's/@''GNULIB_RANDOM_R''@/$(GL_M4_GNULIB_RANDOM_R)/g' \
+             -e 's/@''GNULIB_REALLOC_POSIX''@/$(GL_M4_GNULIB_REALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_REALLOCARRAY''@/$(GL_M4_GNULIB_REALLOCARRAY)/g' \
+             -e 's/@''GNULIB_REALPATH''@/$(GL_M4_GNULIB_REALPATH)/g' \
+             -e 's/@''GNULIB_RPMATCH''@/$(GL_M4_GNULIB_RPMATCH)/g' \
+             -e 's/@''GNULIB_SECURE_GETENV''@/$(GL_M4_GNULIB_SECURE_GETENV)/g' \
+             -e 's/@''GNULIB_SETENV''@/$(GL_M4_GNULIB_SETENV)/g' \
+             -e 's/@''GNULIB_STRTOD''@/$(GL_M4_GNULIB_STRTOD)/g' \
+             -e 's/@''GNULIB_STRTOL''@/$(GL_M4_GNULIB_STRTOL)/g' \
+             -e 's/@''GNULIB_STRTOLD''@/$(GL_M4_GNULIB_STRTOLD)/g' \
+             -e 's/@''GNULIB_STRTOLL''@/$(GL_M4_GNULIB_STRTOLL)/g' \
+             -e 's/@''GNULIB_STRTOUL''@/$(GL_M4_GNULIB_STRTOUL)/g' \
+             -e 's/@''GNULIB_STRTOULL''@/$(GL_M4_GNULIB_STRTOULL)/g' \
+             -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GL_M4_GNULIB_SYSTEM_POSIX)/g' \
+             -e 's/@''GNULIB_UNLOCKPT''@/$(GL_M4_GNULIB_UNLOCKPT)/g' \
+             -e 's/@''GNULIB_UNSETENV''@/$(GL_M4_GNULIB_UNSETENV)/g' \
+             -e 's/@''GNULIB_WCTOMB''@/$(GL_M4_GNULIB_WCTOMB)/g' \
+             -e 's/@''GNULIB_MDA_ECVT''@/$(GL_M4_GNULIB_MDA_ECVT)/g' \
+             -e 's/@''GNULIB_MDA_FCVT''@/$(GL_M4_GNULIB_MDA_FCVT)/g' \
+             -e 's/@''GNULIB_MDA_GCVT''@/$(GL_M4_GNULIB_MDA_GCVT)/g' \
+             -e 's/@''GNULIB_MDA_MKTEMP''@/$(GL_M4_GNULIB_MDA_MKTEMP)/g' \
+             -e 's/@''GNULIB_MDA_PUTENV''@/$(GL_M4_GNULIB_MDA_PUTENV)/g' \
              < $(srcdir)/stdlib.in.h | \
          sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+             -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
              -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \
+             -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \
+             -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \
              -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
              -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
              -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
+             -e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \
+             -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \
+             -e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \
              -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
              -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
              -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
              -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
              -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+             -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \
              -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
              -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
              -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
@@ -3081,31 +4655,49 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
              -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
              -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
              -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
+             -e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \
              -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
              -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
              -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
              -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
+             -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
+             -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
              -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
+             -e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \
+             -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \
              -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
+             -e 's|@''HAVE_STRTOUL''@|$(HAVE_STRTOUL)|g' \
              -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
              -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
              -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
              -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
              -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+             -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
              -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
              -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+             -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
              -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
              -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+             -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
              -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
              -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
              -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
+             -e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \
              -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
              -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
+             -e 's|@''REPLACE_REALLOCARRAY''@|$(REPLACE_REALLOCARRAY)|g' \
              -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
              -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
+             -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
              -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
+             -e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \
+             -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \
+             -e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \
+             -e 's|@''REPLACE_STRTOUL''@|$(REPLACE_STRTOUL)|g' \
+             -e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \
              -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
              -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -3125,48 +4717,54 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
-             -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
-             -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
-             -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
-             -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
-             -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
-             -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
-             -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
-             -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
-             -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
-             -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
-             -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
-             -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
-             -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
-             -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
-             -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
-             -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
-             -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
-             -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
-             -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
-             -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
-             -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
-             -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
-             -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
-             -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
-             -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
-             -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
-             -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
-             -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
-             -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
-             -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
-             -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
-             -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
-             -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
-             -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
-             -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
-             -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
-             -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
+             -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GL_M4_GNULIB_EXPLICIT_BZERO)/g' \
+             -e 's/@''GNULIB_FFSL''@/$(GL_M4_GNULIB_FFSL)/g' \
+             -e 's/@''GNULIB_FFSLL''@/$(GL_M4_GNULIB_FFSLL)/g' \
+             -e 's/@''GNULIB_MBSLEN''@/$(GL_M4_GNULIB_MBSLEN)/g' \
+             -e 's/@''GNULIB_MBSNLEN''@/$(GL_M4_GNULIB_MBSNLEN)/g' \
+             -e 's/@''GNULIB_MBSCHR''@/$(GL_M4_GNULIB_MBSCHR)/g' \
+             -e 's/@''GNULIB_MBSRCHR''@/$(GL_M4_GNULIB_MBSRCHR)/g' \
+             -e 's/@''GNULIB_MBSSTR''@/$(GL_M4_GNULIB_MBSSTR)/g' \
+             -e 's/@''GNULIB_MBSCASECMP''@/$(GL_M4_GNULIB_MBSCASECMP)/g' \
+             -e 's/@''GNULIB_MBSNCASECMP''@/$(GL_M4_GNULIB_MBSNCASECMP)/g' \
+             -e 's/@''GNULIB_MBSPCASECMP''@/$(GL_M4_GNULIB_MBSPCASECMP)/g' \
+             -e 's/@''GNULIB_MBSCASESTR''@/$(GL_M4_GNULIB_MBSCASESTR)/g' \
+             -e 's/@''GNULIB_MBSCSPN''@/$(GL_M4_GNULIB_MBSCSPN)/g' \
+             -e 's/@''GNULIB_MBSPBRK''@/$(GL_M4_GNULIB_MBSPBRK)/g' \
+             -e 's/@''GNULIB_MBSSPN''@/$(GL_M4_GNULIB_MBSSPN)/g' \
+             -e 's/@''GNULIB_MBSSEP''@/$(GL_M4_GNULIB_MBSSEP)/g' \
+             -e 's/@''GNULIB_MBSTOK_R''@/$(GL_M4_GNULIB_MBSTOK_R)/g' \
+             -e 's/@''GNULIB_MEMCHR''@/$(GL_M4_GNULIB_MEMCHR)/g' \
+             -e 's/@''GNULIB_MEMMEM''@/$(GL_M4_GNULIB_MEMMEM)/g' \
+             -e 's/@''GNULIB_MEMPCPY''@/$(GL_M4_GNULIB_MEMPCPY)/g' \
+             -e 's/@''GNULIB_MEMRCHR''@/$(GL_M4_GNULIB_MEMRCHR)/g' \
+             -e 's/@''GNULIB_RAWMEMCHR''@/$(GL_M4_GNULIB_RAWMEMCHR)/g' \
+             -e 's/@''GNULIB_STPCPY''@/$(GL_M4_GNULIB_STPCPY)/g' \
+             -e 's/@''GNULIB_STPNCPY''@/$(GL_M4_GNULIB_STPNCPY)/g' \
+             -e 's/@''GNULIB_STRCHRNUL''@/$(GL_M4_GNULIB_STRCHRNUL)/g' \
+             -e 's/@''GNULIB_STRDUP''@/$(GL_M4_GNULIB_STRDUP)/g' \
+             -e 's/@''GNULIB_STRNCAT''@/$(GL_M4_GNULIB_STRNCAT)/g' \
+             -e 's/@''GNULIB_STRNDUP''@/$(GL_M4_GNULIB_STRNDUP)/g' \
+             -e 's/@''GNULIB_STRNLEN''@/$(GL_M4_GNULIB_STRNLEN)/g' \
+             -e 's/@''GNULIB_STRPBRK''@/$(GL_M4_GNULIB_STRPBRK)/g' \
+             -e 's/@''GNULIB_STRSEP''@/$(GL_M4_GNULIB_STRSEP)/g' \
+             -e 's/@''GNULIB_STRSTR''@/$(GL_M4_GNULIB_STRSTR)/g' \
+             -e 's/@''GNULIB_STRCASESTR''@/$(GL_M4_GNULIB_STRCASESTR)/g' \
+             -e 's/@''GNULIB_STRTOK_R''@/$(GL_M4_GNULIB_STRTOK_R)/g' \
+             -e 's/@''GNULIB_STRERROR''@/$(GL_M4_GNULIB_STRERROR)/g' \
+             -e 's/@''GNULIB_STRERROR_R''@/$(GL_M4_GNULIB_STRERROR_R)/g' \
+             -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GL_M4_GNULIB_STRERRORNAME_NP)/g' \
+             -e 's/@''GNULIB_SIGABBREV_NP''@/$(GL_M4_GNULIB_SIGABBREV_NP)/g' \
+             -e 's/@''GNULIB_SIGDESCR_NP''@/$(GL_M4_GNULIB_SIGDESCR_NP)/g' \
+             -e 's/@''GNULIB_STRSIGNAL''@/$(GL_M4_GNULIB_STRSIGNAL)/g' \
+             -e 's/@''GNULIB_STRVERSCMP''@/$(GL_M4_GNULIB_STRVERSCMP)/g' \
+             -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GL_M4_GNULIB_MDA_MEMCCPY)/g' \
+             -e 's/@''GNULIB_MDA_STRDUP''@/$(GL_M4_GNULIB_MDA_STRDUP)/g' \
              < $(srcdir)/string.in.h | \
-         sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+         sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
+             -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
              -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
              -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
-             -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
              -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
              -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
              -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
@@ -3182,22 +4780,27 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
              -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
              -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
+             -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \
+             -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \
+             -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \
              -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
              -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
-             -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+             -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \
              -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
              -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-             -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+             -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
              -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
              -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
-             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-             -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
-             -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
              -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
              -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
              -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
-             -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+             -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
              -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+             -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+             -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
+             -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \
+             -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
              -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
@@ -3206,6 +4809,28 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
        } > $@-t && \
        mv $@-t $@
 
+# We need the following in order to create <sys/random.h> when the system
+# doesn't have one.
+sys/random.h: sys_random.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_RANDOM_H''@|$(NEXT_SYS_RANDOM_H)|g' \
+             -e 's|@''HAVE_SYS_RANDOM_H''@|$(HAVE_SYS_RANDOM_H)|g' \
+             -e 's/@''GNULIB_GETRANDOM''@/$(GL_M4_GNULIB_GETRANDOM)/g' \
+             -e 's/@''HAVE_GETRANDOM''@/$(HAVE_GETRANDOM)/g' \
+             -e 's/@''REPLACE_GETRANDOM''@/$(REPLACE_GETRANDOM)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sys_random.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+
 # We need the following in order to create <sys/stat.h> when the system
 # has one that is incomplete.
 sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
@@ -3218,22 +4843,30 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
              -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
-             -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
-             -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \
-             -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
-             -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \
-             -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
-             -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
-             -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
-             -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
-             -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
-             -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \
-             -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
-             -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
-             -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \
+             -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \
+             -e 's/@''GNULIB_FCHMODAT''@/$(GL_M4_GNULIB_FCHMODAT)/g' \
+             -e 's/@''GNULIB_FSTAT''@/$(GL_M4_GNULIB_FSTAT)/g' \
+             -e 's/@''GNULIB_FSTATAT''@/$(GL_M4_GNULIB_FSTATAT)/g' \
+             -e 's/@''GNULIB_FUTIMENS''@/$(GL_M4_GNULIB_FUTIMENS)/g' \
+             -e 's/@''GNULIB_GETUMASK''@/$(GL_M4_GNULIB_GETUMASK)/g' \
+             -e 's/@''GNULIB_LCHMOD''@/$(GL_M4_GNULIB_LCHMOD)/g' \
+             -e 's/@''GNULIB_LSTAT''@/$(GL_M4_GNULIB_LSTAT)/g' \
+             -e 's/@''GNULIB_MKDIR''@/$(GL_M4_GNULIB_MKDIR)/g' \
+             -e 's/@''GNULIB_MKDIRAT''@/$(GL_M4_GNULIB_MKDIRAT)/g' \
+             -e 's/@''GNULIB_MKFIFO''@/$(GL_M4_GNULIB_MKFIFO)/g' \
+             -e 's/@''GNULIB_MKFIFOAT''@/$(GL_M4_GNULIB_MKFIFOAT)/g' \
+             -e 's/@''GNULIB_MKNOD''@/$(GL_M4_GNULIB_MKNOD)/g' \
+             -e 's/@''GNULIB_MKNODAT''@/$(GL_M4_GNULIB_MKNODAT)/g' \
+             -e 's/@''GNULIB_STAT''@/$(GL_M4_GNULIB_STAT)/g' \
+             -e 's/@''GNULIB_UTIMENSAT''@/$(GL_M4_GNULIB_UTIMENSAT)/g' \
+             -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GL_M4_GNULIB_OVERRIDES_STRUCT_STAT)/g' \
+             -e 's/@''GNULIB_MDA_CHMOD''@/$(GL_M4_GNULIB_MDA_CHMOD)/g' \
+             -e 's/@''GNULIB_MDA_MKDIR''@/$(GL_M4_GNULIB_MDA_MKDIR)/g' \
+             -e 's/@''GNULIB_MDA_UMASK''@/$(GL_M4_GNULIB_MDA_UMASK)/g' \
              -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
              -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
              -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
+             -e 's|@''HAVE_GETUMASK''@|$(HAVE_GETUMASK)|g' \
              -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
              -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
              -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
@@ -3242,13 +4875,16 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
              -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
              -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
              -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
+             -e 's|@''REPLACE_FCHMODAT''@|$(REPLACE_FCHMODAT)|g' \
              -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
              -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
              -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
              -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
              -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
              -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
+             -e 's|@''REPLACE_MKFIFOAT''@|$(REPLACE_MKFIFOAT)|g' \
              -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
+             -e 's|@''REPLACE_MKNODAT''@|$(REPLACE_MKNODAT)|g' \
              -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
              -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -3258,31 +4894,6 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
        } > $@-t && \
        mv $@-t $@
 
-# We need the following in order to create <sys/time.h> when the system
-# doesn't have one that works with the given compiler.
-sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-       $(AM_V_at)$(MKDIR_P) sys
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
-             -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
-             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-             -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
-             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
-             -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
-             -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
-             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
-             -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \
-             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/sys_time.in.h; \
-       } > $@-t && \
-       mv $@-t $@
-
 # We need the following in order to create <sys/types.h> when the system
 # doesn't have one that works with the given compiler.
 sys/types.h: sys_types.in.h $(top_builddir)/config.status
@@ -3295,6 +4906,7 @@ sys/types.h: sys_types.in.h $(top_builddir)/config.status
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
              -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+             -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \
              < $(srcdir)/sys_types.in.h; \
        } > $@-t && \
        mv $@-t $@
@@ -3310,7 +4922,7 @@ sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
-             -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \
+             -e 's/@''GNULIB_WAITPID''@/$(GL_M4_GNULIB_WAITPID)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_wait.in.h; \
@@ -3327,28 +4939,38 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
-             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
-             -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
-             -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
-             -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
-             -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
-             -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
-             -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \
+             -e 's/@''GNULIB_CTIME''@/$(GL_M4_GNULIB_CTIME)/g' \
+             -e 's/@''GNULIB_LOCALTIME''@/$(GL_M4_GNULIB_LOCALTIME)/g' \
+             -e 's/@''GNULIB_MKTIME''@/$(GL_M4_GNULIB_MKTIME)/g' \
+             -e 's/@''GNULIB_NANOSLEEP''@/$(GL_M4_GNULIB_NANOSLEEP)/g' \
+             -e 's/@''GNULIB_STRFTIME''@/$(GL_M4_GNULIB_STRFTIME)/g' \
+             -e 's/@''GNULIB_STRPTIME''@/$(GL_M4_GNULIB_STRPTIME)/g' \
+             -e 's/@''GNULIB_TIMEGM''@/$(GL_M4_GNULIB_TIMEGM)/g' \
+             -e 's/@''GNULIB_TIMESPEC_GET''@/$(GL_M4_GNULIB_TIMESPEC_GET)/g' \
+             -e 's/@''GNULIB_TIME_R''@/$(GL_M4_GNULIB_TIME_R)/g' \
+             -e 's/@''GNULIB_TIME_RZ''@/$(GL_M4_GNULIB_TIME_RZ)/g' \
+             -e 's/@''GNULIB_TZSET''@/$(GL_M4_GNULIB_TZSET)/g' \
+             -e 's/@''GNULIB_MDA_TZSET''@/$(GL_M4_GNULIB_MDA_TZSET)/g' \
              -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
              -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
              -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
              -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+             -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \
              -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
+             -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \
              -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
              -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
              -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
              -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
              -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
+             -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
              -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+             -e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
              -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
              -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
              -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
              -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''TIME_H_DEFINES_TIME_UTC''@|$(TIME_H_DEFINES_TIME_UTC)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
@@ -3368,60 +4990,95 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
              -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
-             -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \
-             -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
-             -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
-             -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \
-             -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
-             -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
-             -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
-             -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
-             -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
-             -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
-             -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
-             -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \
-             -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \
-             -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \
-             -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
-             -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
-             -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
-             -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
-             -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
-             -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
-             -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
-             -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
-             -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
-             -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
-             -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
-             -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
-             -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
-             -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
-             -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \
-             -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \
-             -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \
-             -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \
-             -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \
-             -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \
-             -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
-             -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
-             -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
-             -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \
-             -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
-             -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
-             -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
-             -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
-             -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_M4_UNISTD_H_GETOPT)/g' \
-             -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
-             -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
-             -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
-             -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
-             -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
-             -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
+             -e 's/@''GNULIB_ACCESS''@/$(GL_M4_GNULIB_ACCESS)/g' \
+             -e 's/@''GNULIB_CHDIR''@/$(GL_M4_GNULIB_CHDIR)/g' \
+             -e 's/@''GNULIB_CHOWN''@/$(GL_M4_GNULIB_CHOWN)/g' \
+             -e 's/@''GNULIB_CLOSE''@/$(GL_M4_GNULIB_CLOSE)/g' \
+             -e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GL_M4_GNULIB_COPY_FILE_RANGE)/g' \
+             -e 's/@''GNULIB_DUP''@/$(GL_M4_GNULIB_DUP)/g' \
+             -e 's/@''GNULIB_DUP2''@/$(GL_M4_GNULIB_DUP2)/g' \
+             -e 's/@''GNULIB_DUP3''@/$(GL_M4_GNULIB_DUP3)/g' \
+             -e 's/@''GNULIB_ENVIRON''@/$(GL_M4_GNULIB_ENVIRON)/g' \
+             -e 's/@''GNULIB_EUIDACCESS''@/$(GL_M4_GNULIB_EUIDACCESS)/g' \
+             -e 's/@''GNULIB_EXECL''@/$(GL_M4_GNULIB_EXECL)/g' \
+             -e 's/@''GNULIB_EXECLE''@/$(GL_M4_GNULIB_EXECLE)/g' \
+             -e 's/@''GNULIB_EXECLP''@/$(GL_M4_GNULIB_EXECLP)/g' \
+             -e 's/@''GNULIB_EXECV''@/$(GL_M4_GNULIB_EXECV)/g' \
+             -e 's/@''GNULIB_EXECVE''@/$(GL_M4_GNULIB_EXECVE)/g' \
+             -e 's/@''GNULIB_EXECVP''@/$(GL_M4_GNULIB_EXECVP)/g' \
+             -e 's/@''GNULIB_EXECVPE''@/$(GL_M4_GNULIB_EXECVPE)/g' \
+             -e 's/@''GNULIB_FACCESSAT''@/$(GL_M4_GNULIB_FACCESSAT)/g' \
+             -e 's/@''GNULIB_FCHDIR''@/$(GL_M4_GNULIB_FCHDIR)/g' \
+             -e 's/@''GNULIB_FCHOWNAT''@/$(GL_M4_GNULIB_FCHOWNAT)/g' \
+             -e 's/@''GNULIB_FDATASYNC''@/$(GL_M4_GNULIB_FDATASYNC)/g' \
+             -e 's/@''GNULIB_FSYNC''@/$(GL_M4_GNULIB_FSYNC)/g' \
+             -e 's/@''GNULIB_FTRUNCATE''@/$(GL_M4_GNULIB_FTRUNCATE)/g' \
+             -e 's/@''GNULIB_GETCWD''@/$(GL_M4_GNULIB_GETCWD)/g' \
+             -e 's/@''GNULIB_GETDOMAINNAME''@/$(GL_M4_GNULIB_GETDOMAINNAME)/g' \
+             -e 's/@''GNULIB_GETDTABLESIZE''@/$(GL_M4_GNULIB_GETDTABLESIZE)/g' \
+             -e 's/@''GNULIB_GETENTROPY''@/$(GL_M4_GNULIB_GETENTROPY)/g' \
+             -e 's/@''GNULIB_GETGROUPS''@/$(GL_M4_GNULIB_GETGROUPS)/g' \
+             -e 's/@''GNULIB_GETHOSTNAME''@/$(GL_M4_GNULIB_GETHOSTNAME)/g' \
+             -e 's/@''GNULIB_GETLOGIN''@/$(GL_M4_GNULIB_GETLOGIN)/g' \
+             -e 's/@''GNULIB_GETLOGIN_R''@/$(GL_M4_GNULIB_GETLOGIN_R)/g' \
+             -e 's/@''GNULIB_GETOPT_POSIX''@/$(GL_M4_GNULIB_GETOPT_POSIX)/g' \
+             -e 's/@''GNULIB_GETPAGESIZE''@/$(GL_M4_GNULIB_GETPAGESIZE)/g' \
+             -e 's/@''GNULIB_GETPASS''@/$(GL_M4_GNULIB_GETPASS)/g' \
+             -e 's/@''GNULIB_GETUSERSHELL''@/$(GL_M4_GNULIB_GETUSERSHELL)/g' \
+             -e 's/@''GNULIB_GROUP_MEMBER''@/$(GL_M4_GNULIB_GROUP_MEMBER)/g' \
+             -e 's/@''GNULIB_ISATTY''@/$(GL_M4_GNULIB_ISATTY)/g' \
+             -e 's/@''GNULIB_LCHOWN''@/$(GL_M4_GNULIB_LCHOWN)/g' \
+             -e 's/@''GNULIB_LINK''@/$(GL_M4_GNULIB_LINK)/g' \
+             -e 's/@''GNULIB_LINKAT''@/$(GL_M4_GNULIB_LINKAT)/g' \
+             -e 's/@''GNULIB_LSEEK''@/$(GL_M4_GNULIB_LSEEK)/g' \
+             -e 's/@''GNULIB_PIPE''@/$(GL_M4_GNULIB_PIPE)/g' \
+             -e 's/@''GNULIB_PIPE2''@/$(GL_M4_GNULIB_PIPE2)/g' \
+             -e 's/@''GNULIB_PREAD''@/$(GL_M4_GNULIB_PREAD)/g' \
+             -e 's/@''GNULIB_PWRITE''@/$(GL_M4_GNULIB_PWRITE)/g' \
+             -e 's/@''GNULIB_READ''@/$(GL_M4_GNULIB_READ)/g' \
+             -e 's/@''GNULIB_READLINK''@/$(GL_M4_GNULIB_READLINK)/g' \
+             -e 's/@''GNULIB_READLINKAT''@/$(GL_M4_GNULIB_READLINKAT)/g' \
+             -e 's/@''GNULIB_RMDIR''@/$(GL_M4_GNULIB_RMDIR)/g' \
+             -e 's/@''GNULIB_SETHOSTNAME''@/$(GL_M4_GNULIB_SETHOSTNAME)/g' \
+             -e 's/@''GNULIB_SLEEP''@/$(GL_M4_GNULIB_SLEEP)/g' \
+             -e 's/@''GNULIB_SYMLINK''@/$(GL_M4_GNULIB_SYMLINK)/g' \
+             -e 's/@''GNULIB_SYMLINKAT''@/$(GL_M4_GNULIB_SYMLINKAT)/g' \
+             -e 's/@''GNULIB_TRUNCATE''@/$(GL_M4_GNULIB_TRUNCATE)/g' \
+             -e 's/@''GNULIB_TTYNAME_R''@/$(GL_M4_GNULIB_TTYNAME_R)/g' \
+             -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_M4_GNULIB_GL_M4_UNISTD_H_GETOPT)/g' \
+             -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GL_M4_GNULIB_UNISTD_H_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GL_M4_GNULIB_UNISTD_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_UNLINK''@/$(GL_M4_GNULIB_UNLINK)/g' \
+             -e 's/@''GNULIB_UNLINKAT''@/$(GL_M4_GNULIB_UNLINKAT)/g' \
+             -e 's/@''GNULIB_USLEEP''@/$(GL_M4_GNULIB_USLEEP)/g' \
+             -e 's/@''GNULIB_WRITE''@/$(GL_M4_GNULIB_WRITE)/g' \
+             -e 's/@''GNULIB_MDA_ACCESS''@/$(GL_M4_GNULIB_MDA_ACCESS)/g' \
+             -e 's/@''GNULIB_MDA_CHDIR''@/$(GL_M4_GNULIB_MDA_CHDIR)/g' \
+             -e 's/@''GNULIB_MDA_CLOSE''@/$(GL_M4_GNULIB_MDA_CLOSE)/g' \
+             -e 's/@''GNULIB_MDA_DUP''@/$(GL_M4_GNULIB_MDA_DUP)/g' \
+             -e 's/@''GNULIB_MDA_DUP2''@/$(GL_M4_GNULIB_MDA_DUP2)/g' \
+             -e 's/@''GNULIB_MDA_EXECL''@/$(GL_M4_GNULIB_MDA_EXECL)/g' \
+             -e 's/@''GNULIB_MDA_EXECLE''@/$(GL_M4_GNULIB_MDA_EXECLE)/g' \
+             -e 's/@''GNULIB_MDA_EXECLP''@/$(GL_M4_GNULIB_MDA_EXECLP)/g' \
+             -e 's/@''GNULIB_MDA_EXECV''@/$(GL_M4_GNULIB_MDA_EXECV)/g' \
+             -e 's/@''GNULIB_MDA_EXECVE''@/$(GL_M4_GNULIB_MDA_EXECVE)/g' \
+             -e 's/@''GNULIB_MDA_EXECVP''@/$(GL_M4_GNULIB_MDA_EXECVP)/g' \
+             -e 's/@''GNULIB_MDA_EXECVPE''@/$(GL_M4_GNULIB_MDA_EXECVPE)/g' \
+             -e 's/@''GNULIB_MDA_GETCWD''@/$(GL_M4_GNULIB_MDA_GETCWD)/g' \
+             -e 's/@''GNULIB_MDA_GETPID''@/$(GL_M4_GNULIB_MDA_GETPID)/g' \
+             -e 's/@''GNULIB_MDA_ISATTY''@/$(GL_M4_GNULIB_MDA_ISATTY)/g' \
+             -e 's/@''GNULIB_MDA_LSEEK''@/$(GL_M4_GNULIB_MDA_LSEEK)/g' \
+             -e 's/@''GNULIB_MDA_READ''@/$(GL_M4_GNULIB_MDA_READ)/g' \
+             -e 's/@''GNULIB_MDA_RMDIR''@/$(GL_M4_GNULIB_MDA_RMDIR)/g' \
+             -e 's/@''GNULIB_MDA_SWAB''@/$(GL_M4_GNULIB_MDA_SWAB)/g' \
+             -e 's/@''GNULIB_MDA_UNLINK''@/$(GL_M4_GNULIB_MDA_UNLINK)/g' \
+             -e 's/@''GNULIB_MDA_WRITE''@/$(GL_M4_GNULIB_MDA_WRITE)/g' \
              < $(srcdir)/unistd.in.h | \
          sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
-             -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+             -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \
              -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
              -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+             -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \
              -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
              -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
              -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
@@ -3429,9 +5086,11 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
              -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
+             -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \
              -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
+             -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \
              -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
              -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
@@ -3449,6 +5108,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+             -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \
              -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
              -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
              -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
@@ -3457,14 +5117,24 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
              -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
              -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
+             -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \
              -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
              -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
              -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
          | \
-         sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+         sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
+             -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
              -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
              -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+             -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
+             -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \
+             -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \
+             -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \
+             -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \
+             -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \
+             -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
+             -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
              -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
@@ -3473,6 +5143,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
              -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
+             -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \
              -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
              -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
@@ -3487,11 +5158,13 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
              -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
              -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
+             -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \
              -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
              -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
              -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
              -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
              -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
+             -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \
              -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
              -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -3500,6 +5173,27 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
        } > $@-t && \
        mv $@-t $@
 
+unistr.h: unistr.in.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/unistr.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+
+unitypes.h: unitypes.in.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/unitypes.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+
+uniwidth.h: uniwidth.in.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/uniwidth.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+
 # We need the following in order to create <wchar.h> when the system
 # version does not work standalone.
 wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
@@ -3512,46 +5206,50 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
              -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
-             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
-             -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
-             -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
-             -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \
-             -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \
-             -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \
-             -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \
-             -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \
-             -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \
-             -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \
-             -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \
-             -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \
-             -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \
-             -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \
-             -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \
-             -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \
-             -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \
-             -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \
-             -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \
-             -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \
-             -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \
-             -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \
-             -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \
-             -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \
-             -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \
-             -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \
-             -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \
-             -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \
-             -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \
-             -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \
-             -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \
-             -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \
-             -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \
-             -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \
-             -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \
-             -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \
-             -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \
-             -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \
-             -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \
-             -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \
+             -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+             -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+             -e 's/@''GNULIB_BTOWC''@/$(GL_M4_GNULIB_BTOWC)/g' \
+             -e 's/@''GNULIB_WCTOB''@/$(GL_M4_GNULIB_WCTOB)/g' \
+             -e 's/@''GNULIB_MBSINIT''@/$(GL_M4_GNULIB_MBSINIT)/g' \
+             -e 's/@''GNULIB_MBRTOWC''@/$(GL_M4_GNULIB_MBRTOWC)/g' \
+             -e 's/@''GNULIB_MBRLEN''@/$(GL_M4_GNULIB_MBRLEN)/g' \
+             -e 's/@''GNULIB_MBSRTOWCS''@/$(GL_M4_GNULIB_MBSRTOWCS)/g' \
+             -e 's/@''GNULIB_MBSNRTOWCS''@/$(GL_M4_GNULIB_MBSNRTOWCS)/g' \
+             -e 's/@''GNULIB_WCRTOMB''@/$(GL_M4_GNULIB_WCRTOMB)/g' \
+             -e 's/@''GNULIB_WCSRTOMBS''@/$(GL_M4_GNULIB_WCSRTOMBS)/g' \
+             -e 's/@''GNULIB_WCSNRTOMBS''@/$(GL_M4_GNULIB_WCSNRTOMBS)/g' \
+             -e 's/@''GNULIB_WCWIDTH''@/$(GL_M4_GNULIB_WCWIDTH)/g' \
+             -e 's/@''GNULIB_WMEMCHR''@/$(GL_M4_GNULIB_WMEMCHR)/g' \
+             -e 's/@''GNULIB_WMEMCMP''@/$(GL_M4_GNULIB_WMEMCMP)/g' \
+             -e 's/@''GNULIB_WMEMCPY''@/$(GL_M4_GNULIB_WMEMCPY)/g' \
+             -e 's/@''GNULIB_WMEMMOVE''@/$(GL_M4_GNULIB_WMEMMOVE)/g' \
+             -e 's/@''GNULIB_WMEMPCPY''@/$(GL_M4_GNULIB_WMEMPCPY)/g' \
+             -e 's/@''GNULIB_WMEMSET''@/$(GL_M4_GNULIB_WMEMSET)/g' \
+             -e 's/@''GNULIB_WCSLEN''@/$(GL_M4_GNULIB_WCSLEN)/g' \
+             -e 's/@''GNULIB_WCSNLEN''@/$(GL_M4_GNULIB_WCSNLEN)/g' \
+             -e 's/@''GNULIB_WCSCPY''@/$(GL_M4_GNULIB_WCSCPY)/g' \
+             -e 's/@''GNULIB_WCPCPY''@/$(GL_M4_GNULIB_WCPCPY)/g' \
+             -e 's/@''GNULIB_WCSNCPY''@/$(GL_M4_GNULIB_WCSNCPY)/g' \
+             -e 's/@''GNULIB_WCPNCPY''@/$(GL_M4_GNULIB_WCPNCPY)/g' \
+             -e 's/@''GNULIB_WCSCAT''@/$(GL_M4_GNULIB_WCSCAT)/g' \
+             -e 's/@''GNULIB_WCSNCAT''@/$(GL_M4_GNULIB_WCSNCAT)/g' \
+             -e 's/@''GNULIB_WCSCMP''@/$(GL_M4_GNULIB_WCSCMP)/g' \
+             -e 's/@''GNULIB_WCSNCMP''@/$(GL_M4_GNULIB_WCSNCMP)/g' \
+             -e 's/@''GNULIB_WCSCASECMP''@/$(GL_M4_GNULIB_WCSCASECMP)/g' \
+             -e 's/@''GNULIB_WCSNCASECMP''@/$(GL_M4_GNULIB_WCSNCASECMP)/g' \
+             -e 's/@''GNULIB_WCSCOLL''@/$(GL_M4_GNULIB_WCSCOLL)/g' \
+             -e 's/@''GNULIB_WCSXFRM''@/$(GL_M4_GNULIB_WCSXFRM)/g' \
+             -e 's/@''GNULIB_WCSDUP''@/$(GL_M4_GNULIB_WCSDUP)/g' \
+             -e 's/@''GNULIB_WCSCHR''@/$(GL_M4_GNULIB_WCSCHR)/g' \
+             -e 's/@''GNULIB_WCSRCHR''@/$(GL_M4_GNULIB_WCSRCHR)/g' \
+             -e 's/@''GNULIB_WCSCSPN''@/$(GL_M4_GNULIB_WCSCSPN)/g' \
+             -e 's/@''GNULIB_WCSSPN''@/$(GL_M4_GNULIB_WCSSPN)/g' \
+             -e 's/@''GNULIB_WCSPBRK''@/$(GL_M4_GNULIB_WCSPBRK)/g' \
+             -e 's/@''GNULIB_WCSSTR''@/$(GL_M4_GNULIB_WCSSTR)/g' \
+             -e 's/@''GNULIB_WCSTOK''@/$(GL_M4_GNULIB_WCSTOK)/g' \
+             -e 's/@''GNULIB_WCSWIDTH''@/$(GL_M4_GNULIB_WCSWIDTH)/g' \
+             -e 's/@''GNULIB_WCSFTIME''@/$(GL_M4_GNULIB_WCSFTIME)/g' \
+             -e 's/@''GNULIB_MDA_WCSDUP''@/$(GL_M4_GNULIB_MDA_WCSDUP)/g' \
              < $(srcdir)/wchar.in.h | \
          sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
              -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
@@ -3567,6 +5265,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
              -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
              -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+             -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \
              -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
              -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
              -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
@@ -3591,7 +5290,9 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
              -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
              -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
+             -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \
              -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
+             -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \
              -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
          | \
          sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
@@ -3607,6 +5308,8 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
              -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
              -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
+             -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \
+             -e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
@@ -3624,18 +5327,23 @@ wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
-             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
-             -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
-             -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
-             -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
-             -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \
-             -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \
+             -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+             -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+             -e 's/@''GNULIB_ISWBLANK''@/$(GL_M4_GNULIB_ISWBLANK)/g' \
+             -e 's/@''GNULIB_ISWDIGIT''@/$(GL_M4_GNULIB_ISWDIGIT)/g' \
+             -e 's/@''GNULIB_ISWXDIGIT''@/$(GL_M4_GNULIB_ISWXDIGIT)/g' \
+             -e 's/@''GNULIB_WCTYPE''@/$(GL_M4_GNULIB_WCTYPE)/g' \
+             -e 's/@''GNULIB_ISWCTYPE''@/$(GL_M4_GNULIB_ISWCTYPE)/g' \
+             -e 's/@''GNULIB_WCTRANS''@/$(GL_M4_GNULIB_WCTRANS)/g' \
+             -e 's/@''GNULIB_TOWCTRANS''@/$(GL_M4_GNULIB_TOWCTRANS)/g' \
              -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
              -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
              -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \
              -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \
              -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
              -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
+             -e 's/@''REPLACE_ISWDIGIT''@/$(REPLACE_ISWDIGIT)/g' \
+             -e 's/@''REPLACE_ISWXDIGIT''@/$(REPLACE_ISWXDIGIT)/g' \
              -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
              -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
diff --git a/lib/_Noreturn.h b/lib/_Noreturn.h
new file mode 100644 (file)
index 0000000..fb718bc
--- /dev/null
@@ -0,0 +1,45 @@
+/* A C macro for declaring that a function does not return.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _Noreturn
+# if (defined __cplusplus \
+      && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+          || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+      && 0)
+    /* [[noreturn]] is not practically usable, because with it the syntax
+         extern _Noreturn void func (...);
+       would not be valid; such a declaration would only be valid with 'extern'
+       and '_Noreturn' swapped, or without the 'extern' keyword.  However, some
+       AIX system header files and several gnulib header files use precisely
+       this syntax with 'extern'.  */
+#  define _Noreturn [[noreturn]]
+# elif ((!defined __cplusplus || defined __clang__) \
+        && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+            || (!defined __STRICT_ANSI__ \
+                && (__4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+                    || (defined __apple_build_version__ \
+                        ? 6000000 <= __apple_build_version__ \
+                        : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+   /* _Noreturn works as-is.  */
+# elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \
+        || 0x5110 <= __SUNPRO_C)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn
+# endif
+#endif
diff --git a/lib/access.c b/lib/access.c
new file mode 100644 (file)
index 0000000..097f85f
--- /dev/null
@@ -0,0 +1,31 @@
+/* Test the access rights of a file.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <unistd.h>
+
+#include <fcntl.h>
+#include <io.h>
+
+int
+access (const char *file, int mode)
+{
+  if ((mode & X_OK) != 0)
+    mode = (mode & ~X_OK) | R_OK;
+  return _access (file, mode);
+}
index 9b51af0..f335143 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine alignment of types.
-   Copyright (C) 2003-2004, 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2004, 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _ALIGNOF_H
 #define _ALIGNOF_H
 /* alignof_type (TYPE)
    Determine the good alignment of an object of the given type at compile time.
    Note that this is not necessarily the same as alignof_slot(type).
-   For example, with GNU C on x86 platforms: alignof_type(double) = 8, but
+   For example, with GNU C on x86 platforms and with clang on Linux/x86:
+   alignof_type(long long) = 8, but alignof_slot(long long) = 4.
+   And alignof_type(double) = 8, but
    - when -malign-double is not specified:  alignof_slot(double) = 4,
    - when -malign-double is specified:      alignof_slot(double) = 8.
    Note: The result cannot be used as a value for an 'enum' constant,
    due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc.  */
-#if defined __GNUC__ || defined __IBM__ALIGNOF__
+#if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
 # define alignof_type __alignof__
 #else
 # define alignof_type alignof_slot
index 6a25ecd..0a6137e 100644 (file)
@@ -1,6 +1,6 @@
 /* Memory allocation on the stack.
 
-   Copyright (C) 1995, 1999, 2001-2004, 2006-2016 Free Software Foundation,
+   Copyright (C) 1995, 1999, 2001-2004, 2006-2021 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU General Public
    License along with this program; if not, see
-   <http://www.gnu.org/licenses/>.
+   <https://www.gnu.org/licenses/>.
   */
 
 /* Avoid using the symbol _ALLOCA_H here, as Bison assumes _ALLOCA_H
  */
 
 #ifndef alloca
-# ifdef __GNUC__
+  /* Some version of mingw have an <alloca.h> that causes trouble when
+     included after 'alloca' gets defined as a macro.  As a workaround,
+     include this <alloca.h> first and define 'alloca' as a macro afterwards
+     if needed.  */
+# if defined __GNUC__ && (defined _WIN32 && ! defined __CYGWIN__) && @HAVE_ALLOCA_H@
+#  include_next <alloca.h>
+# endif
+#endif
+#ifndef alloca
+# if defined __GNUC__ || (__clang_major__ >= 4)
 #  define alloca __builtin_alloca
 # elif defined _AIX
 #  define alloca __alloca
similarity index 82%
rename from build-aux/snippet/arg-nonnull.h
rename to lib/arg-nonnull.h
index 584649f..5b81b50 100644 (file)
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific arguments must not be NULL.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
    General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
    that the values passed as arguments n, ..., m must be non-NULL pointers.
    n = 1 stands for the first argument, n = 2 for the second argument etc.  */
 #ifndef _GL_ARG_NONNULL
-# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || __GNUC__ > 3
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
 #  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
 # else
 #  define _GL_ARG_NONNULL(params)
index f23b776..4848443 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index d0ca5f2..891e8b8 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2007, 2009-2016 Free Software Foundation,
+   Copyright (C) 1999, 2002, 2006-2007, 2009-2021 Free Software Foundation,
    Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/lib/assure.h b/lib/assure.h
new file mode 100644 (file)
index 0000000..b6f4076
--- /dev/null
@@ -0,0 +1,57 @@
+/* Run-time assert-like macros.
+
+   Copyright (C) 2014-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#ifndef _GL_ASSURE_H
+#define _GL_ASSURE_H
+
+#include <assert.h>
+#include "verify.h"
+
+/* Evaluate an assertion E that is guaranteed to be true.
+   If NDEBUG is not defined, abort the program if E is false.
+   If NDEBUG is defined, the compiler can assume E and behavior is
+   undefined if E is false, fails to evaluate, or has side effects.
+
+   Unlike standard 'assert', this macro evaluates E even when NDEBUG
+   is defined, so as to catch typos, avoid some GCC warnings, and
+   improve performance when E is simple enough.
+
+   Also see the documentation for 'assume' in verify.h.  */
+
+#ifdef NDEBUG
+# define affirm(E) assume (E)
+#else
+# define affirm(E) assert (E)
+#endif
+
+/* Check E's value at runtime, and report an error and abort if not.
+   However, do nothing if NDEBUG is defined.
+
+   Unlike standard 'assert', this macro compiles E even when NDEBUG
+   is defined, so as to catch typos and avoid some GCC warnings.
+   Unlike 'affirm', it is OK for E to use hard-to-optimize features,
+   since E is not executed if NDEBUG is defined.  */
+
+#ifdef NDEBUG
+# define assure(E) ((void) (0 && (E)))
+#else
+# define assure(E) assert (E)
+#endif
+
+#endif
diff --git a/lib/asyncsafe-spin.c b/lib/asyncsafe-spin.c
new file mode 100644 (file)
index 0000000..9643d99
--- /dev/null
@@ -0,0 +1,352 @@
+/* Spin locks for communication between threads and signal handlers.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "asyncsafe-spin.h"
+
+#include <stdbool.h>
+#include <stdlib.h>
+#if defined _AIX
+# include <sys/atomic_op.h>
+#endif
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Use Windows threads.  */
+
+void
+asyncsafe_spin_init (asyncsafe_spinlock_t *lock)
+{
+  glwthread_spin_init (lock);
+}
+
+static inline void
+do_lock (asyncsafe_spinlock_t *lock)
+{
+  glwthread_spin_lock (lock);
+}
+
+static inline void
+do_unlock (asyncsafe_spinlock_t *lock)
+{
+  if (glwthread_spin_unlock (lock))
+    abort ();
+}
+
+void
+asyncsafe_spin_destroy (asyncsafe_spinlock_t *lock)
+{
+  glwthread_spin_destroy (lock);
+}
+
+#else
+
+# if HAVE_PTHREAD_H
+/* Use POSIX threads.  */
+
+/* We don't use semaphores (although sem_post() is allowed in signal handlers),
+   because it would require to link with -lrt on HP-UX 11, OSF/1, Solaris 10,
+   and also because on macOS only named semaphores work.
+
+   We don't use the C11 <stdatomic.h> (available in GCC >= 4.9) because it would
+   require to link with -latomic.  */
+
+#  if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) \
+       || __clang_major > 3 || (__clang_major__ == 3 && __clang_minor__ >= 1)) \
+      && !defined __ibmxl__
+/* Use GCC built-ins (available in GCC >= 4.7 and clang >= 3.1) that operate on
+   the first byte of the lock.
+   Documentation:
+   <https://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/_005f_005fatomic-Builtins.html>
+ */
+
+#   if 1
+/* An implementation that verifies the unlocks.  */
+
+void
+asyncsafe_spin_init (asyncsafe_spinlock_t *lock)
+{
+  __atomic_store_n (lock, 0, __ATOMIC_SEQ_CST);
+}
+
+static inline void
+do_lock (asyncsafe_spinlock_t *lock)
+{
+  /* Wait until *lock becomes 0, then replace it with 1.  */
+  asyncsafe_spinlock_t zero;
+  while (!(zero = 0,
+           __atomic_compare_exchange_n (lock, &zero, 1, false,
+                                        __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)))
+    ;
+}
+
+static inline void
+do_unlock (asyncsafe_spinlock_t *lock)
+{
+  /* If *lock is 1, then replace it with 0.  */
+  asyncsafe_spinlock_t one = 1;
+  if (!__atomic_compare_exchange_n (lock, &one, 0, false,
+                                    __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))
+    abort ();
+}
+
+#   else
+/* An implementation that is a little bit more optimized, but does not verify
+   the unlocks.  */
+
+void
+asyncsafe_spin_init (asyncsafe_spinlock_t *lock)
+{
+  __atomic_clear (lock, __ATOMIC_SEQ_CST);
+}
+
+static inline void
+do_lock (asyncsafe_spinlock_t *lock)
+{
+  while (__atomic_test_and_set (lock, __ATOMIC_SEQ_CST))
+    ;
+}
+
+static inline void
+do_unlock (asyncsafe_spinlock_t *lock)
+{
+  __atomic_clear (lock, __ATOMIC_SEQ_CST);
+}
+
+#   endif
+
+#  elif (((__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) \
+          && !defined __sparc__) \
+         || __clang_major__ >= 3) \
+        && !defined __ibmxl__
+/* Use GCC built-ins (available in GCC >= 4.1, except on SPARC, and
+   clang >= 3.0).
+   Documentation:
+   <https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html>  */
+
+void
+asyncsafe_spin_init (asyncsafe_spinlock_t *lock)
+{
+  volatile unsigned int *vp = lock;
+  *vp = 0;
+  __sync_synchronize ();
+}
+
+static inline void
+do_lock (asyncsafe_spinlock_t *lock)
+{
+  /* Wait until *lock becomes 0, then replace it with 1.  */
+  while (__sync_val_compare_and_swap (lock, 0, 1) != 0)
+    ;
+}
+
+static inline void
+do_unlock (asyncsafe_spinlock_t *lock)
+{
+  /* If *lock is 1, then replace it with 0.  */
+  if (__sync_val_compare_and_swap (lock, 1, 0) != 1)
+    abort ();
+}
+
+#  elif defined _AIX
+/* AIX */
+
+void
+asyncsafe_spin_init (asyncsafe_spinlock_t *lock)
+{
+  atomic_p vp = (int *) lock;
+  _clear_lock (vp, 0);
+}
+
+static inline void
+do_lock (asyncsafe_spinlock_t *lock)
+{
+  atomic_p vp = (int *) lock;
+  while (_check_lock (vp, 0, 1))
+    ;
+}
+
+static inline void
+do_unlock (asyncsafe_spinlock_t *lock)
+{
+  atomic_p vp = (int *) lock;
+  if (_check_lock (vp, 1, 0))
+    abort ();
+}
+
+#  elif ((defined __GNUC__ || defined __clang__ || defined __SUNPRO_C) && (defined __sparc || defined __i386 || defined __x86_64__)) || (defined __TINYC__ && (defined __i386 || defined __x86_64__))
+/* For older versions of GCC or clang, use inline assembly.
+   GCC, clang, and the Oracle Studio C 12 compiler understand GCC's extended
+   asm syntax, but the plain Oracle Studio C 11 compiler understands only
+   simple asm.  */
+/* An implementation that verifies the unlocks.  */
+
+static void
+memory_barrier (void)
+{
+#   if defined __GNUC__ || defined __clang__ || __SUNPRO_C >= 0x590 || defined __TINYC__
+#    if defined __i386 || defined __x86_64__
+#     if defined __TINYC__ && defined __i386
+  /* Cannot use the SSE instruction "mfence" with this compiler.  */
+  asm volatile ("lock orl $0,(%esp)");
+#     else
+  asm volatile ("mfence");
+#     endif
+#    endif
+#    if defined __sparc
+  asm volatile ("membar 2");
+#    endif
+#   else
+#    if defined __i386 || defined __x86_64__
+  asm ("mfence");
+#    endif
+#    if defined __sparc
+  asm ("membar 2");
+#    endif
+#   endif
+}
+
+/* Store NEWVAL in *VP if the old value *VP is == CMP.
+   Return the old value.  */
+static unsigned int
+atomic_compare_and_swap (volatile unsigned int *vp, unsigned int cmp,
+                         unsigned int newval)
+{
+#   if defined __GNUC__ || defined __clang__ || __SUNPRO_C >= 0x590 || defined __TINYC__
+  unsigned int oldval;
+#    if defined __i386 || defined __x86_64__
+  asm volatile (" lock\n cmpxchgl %3,(%1)"
+                : "=a" (oldval) : "r" (vp), "a" (cmp), "r" (newval) : "memory");
+#    endif
+#    if defined __sparc
+  asm volatile (" cas [%1],%2,%3\n"
+                " mov %3,%0"
+                : "=r" (oldval) : "r" (vp), "r" (cmp), "r" (newval) : "memory");
+#    endif
+  return oldval;
+#   else /* __SUNPRO_C */
+#    if defined __x86_64__
+  asm (" movl %esi,%eax\n"
+       " lock\n cmpxchgl %edx,(%rdi)");
+#    elif defined __i386
+  asm (" movl 16(%ebp),%ecx\n"
+       " movl 12(%ebp),%eax\n"
+       " movl 8(%ebp),%edx\n"
+       " lock\n cmpxchgl %ecx,(%edx)");
+#    endif
+#    if defined __sparc
+  asm (" cas [%i0],%i1,%i2\n"
+       " mov %i2,%i0");
+#    endif
+#   endif
+}
+
+void
+asyncsafe_spin_init (asyncsafe_spinlock_t *lock)
+{
+  volatile unsigned int *vp = lock;
+  *vp = 0;
+  memory_barrier ();
+}
+
+static inline void
+do_lock (asyncsafe_spinlock_t *lock)
+{
+  volatile unsigned int *vp = lock;
+  while (atomic_compare_and_swap (vp, 0, 1) != 0)
+    ;
+}
+
+static inline void
+do_unlock (asyncsafe_spinlock_t *lock)
+{
+  volatile unsigned int *vp = lock;
+  if (atomic_compare_and_swap (vp, 1, 0) != 1)
+    abort ();
+}
+
+#  else
+/* Fallback code.  It has some race conditions.  */
+
+void
+asyncsafe_spin_init (asyncsafe_spinlock_t *lock)
+{
+  volatile unsigned int *vp = lock;
+  *vp = 0;
+}
+
+static inline void
+do_lock (asyncsafe_spinlock_t *lock)
+{
+  volatile unsigned int *vp = lock;
+  while (*vp)
+    ;
+  *vp = 1;
+}
+
+static inline void
+do_unlock (asyncsafe_spinlock_t *lock)
+{
+  volatile unsigned int *vp = lock;
+  *vp = 0;
+}
+
+#  endif
+
+# else
+/* Provide a dummy implementation for single-threaded applications.  */
+
+void
+asyncsafe_spin_init (asyncsafe_spinlock_t *lock)
+{
+}
+
+static inline void
+do_lock (asyncsafe_spinlock_t *lock)
+{
+}
+
+static inline void
+do_unlock (asyncsafe_spinlock_t *lock)
+{
+}
+
+# endif
+
+void
+asyncsafe_spin_destroy (asyncsafe_spinlock_t *lock)
+{
+}
+
+#endif
+
+void
+asyncsafe_spin_lock (asyncsafe_spinlock_t *lock,
+                     const sigset_t *mask, sigset_t *saved_mask)
+{
+  sigprocmask (SIG_BLOCK, mask, saved_mask); /* equivalent to pthread_sigmask */
+  do_lock (lock);
+}
+
+void
+asyncsafe_spin_unlock (asyncsafe_spinlock_t *lock, const sigset_t *saved_mask)
+{
+  do_unlock (lock);
+  sigprocmask (SIG_SETMASK, saved_mask, NULL); /* equivalent to pthread_sigmask */
+}
diff --git a/lib/asyncsafe-spin.h b/lib/asyncsafe-spin.h
new file mode 100644 (file)
index 0000000..e045fe3
--- /dev/null
@@ -0,0 +1,69 @@
+/* Spin locks for communication between threads and signal handlers.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+#ifndef _ASYNCSAFE_SPIN_H
+#define _ASYNCSAFE_SPIN_H
+
+/* Usual spin locks are not allowed for communication between threads and signal
+   handlers, because the pthread_spin_* functions are not async-safe; see
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html>
+   section 2.4.3 Signal Actions.
+
+   This module provides spin locks with a similar API.  It can be used like this,
+   both in regular multithreaded code and in signal handlers:
+
+       sigset_t saved_mask;
+       asyncsafe_spin_lock (&lock, &mask, &saved_mask);
+       do_something_contentious ();
+       asyncsafe_spin_unlock (&lock, &saved_mask);
+
+   The mask you specify here is the set of signals whose handlers might want to
+   take the same lock.
+
+   asyncsafe_spin_lock/unlock use pthread_sigmask, to ensure that while a thread
+   is executing such code, no signal handler will start such code for the same
+   lock *in the same thread* (because if this happened, the signal handler would
+   hang!).  */
+
+#include <signal.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# include "windows-spin.h"
+typedef glwthread_spinlock_t asyncsafe_spinlock_t;
+# define ASYNCSAFE_SPIN_INIT GLWTHREAD_SPIN_INIT
+#else
+typedef unsigned int asyncsafe_spinlock_t;
+# define ASYNCSAFE_SPIN_INIT 0
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void asyncsafe_spin_init (asyncsafe_spinlock_t *lock);
+extern void asyncsafe_spin_lock (asyncsafe_spinlock_t *lock,
+                                 const sigset_t *mask, sigset_t *saved_mask);
+extern void asyncsafe_spin_unlock (asyncsafe_spinlock_t *lock,
+                                   const sigset_t *saved_mask);
+extern void asyncsafe_spin_destroy (asyncsafe_spinlock_t *lock);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _ASYNCSAFE_SPIN_H */
diff --git a/lib/at-func.c b/lib/at-func.c
new file mode 100644 (file)
index 0000000..b6d9de7
--- /dev/null
@@ -0,0 +1,146 @@
+/* Define at-style functions like fstatat, unlinkat, fchownat, etc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering */
+
+#include "filename.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+
+#ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD
+# include <errno.h>
+# ifndef ENOTSUP
+#  define ENOTSUP EINVAL
+# endif
+#else
+# include "openat.h"
+# include "openat-priv.h"
+# include "save-cwd.h"
+#endif
+
+#ifdef AT_FUNC_USE_F1_COND
+# define CALL_FUNC(F)                           \
+  (flag == AT_FUNC_USE_F1_COND                  \
+    ? AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS)     \
+    : AT_FUNC_F2 (F AT_FUNC_POST_FILE_ARGS))
+# define VALIDATE_FLAG(F)                       \
+  if (flag & ~AT_FUNC_USE_F1_COND)              \
+    {                                           \
+      errno = EINVAL;                           \
+      return FUNC_FAIL;                         \
+    }
+#else
+# define CALL_FUNC(F) (AT_FUNC_F1 (F AT_FUNC_POST_FILE_ARGS))
+# define VALIDATE_FLAG(F) /* empty */
+#endif
+
+#ifdef AT_FUNC_RESULT
+# define FUNC_RESULT AT_FUNC_RESULT
+#else
+# define FUNC_RESULT int
+#endif
+
+#ifdef AT_FUNC_FAIL
+# define FUNC_FAIL AT_FUNC_FAIL
+#else
+# define FUNC_FAIL -1
+#endif
+
+/* Call AT_FUNC_F1 to operate on FILE, which is in the directory
+   open on descriptor FD.  If AT_FUNC_USE_F1_COND is defined to a value,
+   AT_FUNC_POST_FILE_PARAM_DECLS must include a parameter named flag;
+   call AT_FUNC_F2 if FLAG is 0 or fail if FLAG contains more bits than
+   AT_FUNC_USE_F1_COND.  Return int and fail with -1 unless AT_FUNC_RESULT
+   or AT_FUNC_FAIL are defined.  If possible, do it without changing the
+   working directory.  Otherwise, resort to using save_cwd/fchdir,
+   then AT_FUNC_F?/restore_cwd.  If either the save_cwd or the restore_cwd
+   fails, then give a diagnostic and exit nonzero.  */
+FUNC_RESULT
+AT_FUNC_NAME (int fd, char const *file AT_FUNC_POST_FILE_PARAM_DECLS)
+{
+  VALIDATE_FLAG (flag);
+
+  if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
+    return CALL_FUNC (file);
+
+#ifdef GNULIB_SUPPORT_ONLY_AT_FDCWD
+  errno = ENOTSUP;
+  return FUNC_FAIL;
+#else
+  {
+  /* Be careful to choose names unlikely to conflict with
+     AT_FUNC_POST_FILE_PARAM_DECLS.  */
+  struct saved_cwd saved_cwd;
+  int saved_errno;
+  FUNC_RESULT err;
+
+  {
+    char proc_buf[OPENAT_BUFFER_SIZE];
+    char *proc_file = openat_proc_name (proc_buf, fd, file);
+    if (proc_file)
+      {
+        FUNC_RESULT proc_result = CALL_FUNC (proc_file);
+        int proc_errno = errno;
+        if (proc_file != proc_buf)
+          free (proc_file);
+        /* If the syscall succeeds, or if it fails with an unexpected
+           errno value, then return right away.  Otherwise, fall through
+           and resort to using save_cwd/restore_cwd.  */
+        if (FUNC_FAIL != proc_result)
+          return proc_result;
+        if (! EXPECTED_ERRNO (proc_errno))
+          {
+            errno = proc_errno;
+            return proc_result;
+          }
+      }
+  }
+
+  if (save_cwd (&saved_cwd) != 0)
+    openat_save_fail (errno);
+  if (0 <= fd && fd == saved_cwd.desc)
+    {
+      /* If saving the working directory collides with the user's
+         requested fd, then the user's fd must have been closed to
+         begin with.  */
+      free_cwd (&saved_cwd);
+      errno = EBADF;
+      return FUNC_FAIL;
+    }
+
+  if (fchdir (fd) != 0)
+    {
+      saved_errno = errno;
+      free_cwd (&saved_cwd);
+      errno = saved_errno;
+      return FUNC_FAIL;
+    }
+
+  err = CALL_FUNC (file);
+  saved_errno = (err == FUNC_FAIL ? errno : 0);
+
+  if (restore_cwd (&saved_cwd) != 0)
+    openat_restore_fail (errno);
+
+  free_cwd (&saved_cwd);
+
+  if (saved_errno)
+    errno = saved_errno;
+  return err;
+  }
+#endif
+}
+#undef CALL_FUNC
+#undef FUNC_RESULT
+#undef FUNC_FAIL
diff --git a/lib/attribute.h b/lib/attribute.h
new file mode 100644 (file)
index 0000000..8224527
--- /dev/null
@@ -0,0 +1,218 @@
+/* ATTRIBUTE_* macros for using attributes in GCC and similar compilers
+
+   Copyright 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+/* Provide public ATTRIBUTE_* names for the private _GL_ATTRIBUTE_*
+   macros used within Gnulib.  */
+
+/* These attributes can be placed in two ways:
+     - At the start of a declaration (i.e. even before storage-class
+       specifiers!); then they apply to all entities that are declared
+       by the declaration.
+     - Immediately after the name of an entity being declared by the
+       declaration; then they apply to that entity only.  */
+
+#ifndef _GL_ATTRIBUTE_H
+#define _GL_ATTRIBUTE_H
+
+
+/* This file defines two types of attributes:
+   * C2X standard attributes.  These have macro names that do not begin with
+     'ATTRIBUTE_'.
+   * Selected GCC attributes; see:
+     https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html
+     https://gcc.gnu.org/onlinedocs/gcc/Common-Variable-Attributes.html
+     https://gcc.gnu.org/onlinedocs/gcc/Common-Type-Attributes.html
+     These names begin with 'ATTRIBUTE_' to avoid name clashes.  */
+
+
+/* =============== Attributes for specific kinds of functions =============== */
+
+/* Attributes for functions that should not be used.  */
+
+/* Warn if the entity is used.  */
+/* Applies to:
+     - function, variable,
+     - struct, union, struct/union member,
+     - enumeration, enumeration item,
+     - typedef,
+   in C++ also: namespace, class, template specialization.  */
+#define DEPRECATED _GL_ATTRIBUTE_DEPRECATED
+
+/* If a function call is not optimized way, warn with MSG.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_WARNING(msg) _GL_ATTRIBUTE_WARNING (msg)
+
+/* If a function call is not optimized way, report an error with MSG.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_ERROR(msg) _GL_ATTRIBUTE_ERROR (msg)
+
+
+/* Attributes for memory-allocating functions.  */
+
+/* The function returns a pointer to freshly allocated memory.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_MALLOC _GL_ATTRIBUTE_MALLOC
+
+/* ATTRIBUTE_ALLOC_SIZE ((N)) - The Nth argument of the function
+   is the size of the returned memory block.
+   ATTRIBUTE_ALLOC_SIZE ((M, N)) - Multiply the Mth and Nth arguments
+   to determine the size of the returned memory block.  */
+/* Applies to: function, pointer to function, function types.  */
+#define ATTRIBUTE_ALLOC_SIZE(args) _GL_ATTRIBUTE_ALLOC_SIZE (args)
+
+
+/* Attributes for variadic functions.  */
+
+/* The variadic function expects a trailing NULL argument.
+   ATTRIBUTE_SENTINEL () - The last argument is NULL (requires C99).
+   ATTRIBUTE_SENTINEL ((N)) - The (N+1)st argument from the end is NULL.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_SENTINEL(pos) _GL_ATTRIBUTE_SENTINEL (pos)
+
+
+/* ================== Attributes for compiler diagnostics ================== */
+
+/* Attributes that help the compiler diagnose programmer mistakes.
+   Some of them may also help for some compiler optimizations.  */
+
+/* ATTRIBUTE_FORMAT ((ARCHETYPE, STRING-INDEX, FIRST-TO-CHECK)) -
+   The STRING-INDEXth function argument is a format string of style
+   ARCHETYPE, which is one of:
+     printf, gnu_printf
+     scanf, gnu_scanf,
+     strftime, gnu_strftime,
+     strfmon,
+   or the same thing prefixed and suffixed with '__'.
+   If FIRST-TO-CHECK is not 0, arguments starting at FIRST-TO_CHECK
+   are suitable for the format string.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_FORMAT(spec) _GL_ATTRIBUTE_FORMAT (spec)
+
+/* ATTRIBUTE_NONNULL ((N1, N2,...)) - Arguments N1, N2,... must not be NULL.
+   ATTRIBUTE_NONNULL () - All pointer arguments must not be null.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_NONNULL(args) _GL_ATTRIBUTE_NONNULL (args)
+
+/* The function's return value is a non-NULL pointer.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_RETURNS_NONNULL _GL_ATTRIBUTE_RETURNS_NONNULL
+
+/* Warn if the caller does not use the return value,
+   unless the caller uses something like ignore_value.  */
+/* Applies to: function, enumeration, class.  */
+#define NODISCARD _GL_ATTRIBUTE_NODISCARD
+
+
+/* Attributes that disable false alarms when the compiler diagnoses
+   programmer "mistakes".  */
+
+/* Do not warn if the entity is not used.  */
+/* Applies to:
+     - function, variable,
+     - struct, union, struct/union member,
+     - enumeration, enumeration item,
+     - typedef,
+   in C++ also: class.  */
+#define MAYBE_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+
+/* The contents of a character array is not meant to be NUL-terminated.  */
+/* Applies to: struct/union members and variables that are arrays of element
+   type '[[un]signed] char'.  */
+#define ATTRIBUTE_NONSTRING _GL_ATTRIBUTE_NONSTRING
+
+/* Do not warn if control flow falls through to the immediately
+   following 'case' or 'default' label.  */
+/* Applies to: Empty statement (;), inside a 'switch' statement.  */
+#define FALLTHROUGH _GL_ATTRIBUTE_FALLTHROUGH
+
+
+/* ================== Attributes for debugging information ================== */
+
+/* Attributes regarding debugging information emitted by the compiler.  */
+
+/* Omit the function from stack traces when debugging.  */
+/* Applies to: function.  */
+#define ATTRIBUTE_ARTIFICIAL _GL_ATTRIBUTE_ARTIFICIAL
+
+/* Make the entity visible to debuggers etc., even with '-fwhole-program'.  */
+/* Applies to: functions, variables.  */
+#define ATTRIBUTE_EXTERNALLY_VISIBLE _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+
+
+/* ========== Attributes that mainly direct compiler optimizations ========== */
+
+/* The function does not throw exceptions.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_NOTHROW _GL_ATTRIBUTE_NOTHROW
+
+/* Do not inline the function.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_NOINLINE _GL_ATTRIBUTE_NOINLINE
+
+/* Always inline the function, and report an error if the compiler
+   cannot inline.  */
+/* Applies to: function.  */
+#define ATTRIBUTE_ALWAYS_INLINE _GL_ATTRIBUTE_ALWAYS_INLINE
+
+/* It is OK for a compiler to omit duplicate calls with the same arguments.
+   This attribute is safe for a function that neither depends on
+   nor affects observable state, and always returns exactly once -
+   e.g., does not loop forever, and does not call longjmp.
+   (This attribute is stricter than ATTRIBUTE_PURE.)  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_CONST _GL_ATTRIBUTE_CONST
+
+/* It is OK for a compiler to omit duplicate calls with the same
+   arguments if observable state is not changed between calls.
+   This attribute is safe for a function that does not affect
+   observable state, and always returns exactly once.
+   (This attribute is looser than ATTRIBUTE_CONST.)  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_PURE _GL_ATTRIBUTE_PURE
+
+/* The function is rarely executed.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_COLD _GL_ATTRIBUTE_COLD
+
+/* If called from some other compilation unit, the function executes
+   code from that unit only by return or by exception handling,
+   letting the compiler optimize that unit more aggressively.  */
+/* Applies to: functions.  */
+#define ATTRIBUTE_LEAF _GL_ATTRIBUTE_LEAF
+
+/* For struct members: The member has the smallest possible alignment.
+   For struct, union, class: All members have the smallest possible alignment,
+   minimizing the memory required.  */
+/* Applies to: struct members, struct, union,
+   in C++ also: class.  */
+#define ATTRIBUTE_PACKED _GL_ATTRIBUTE_PACKED
+
+
+/* ================ Attributes that make invalid code valid ================ */
+
+/* Attributes that prevent fatal compiler optimizations for code that is not
+   fully ISO C compliant.  */
+
+/* Pointers to the type may point to the same storage as pointers to
+   other types, thus disabling strict aliasing optimization.  */
+/* Applies to: types.  */
+#define ATTRIBUTE_MAY_ALIAS _GL_ATTRIBUTE_MAY_ALIAS
+
+
+#endif /* _GL_ATTRIBUTE_H */
index 1182109..f8394ed 100644 (file)
@@ -1,6 +1,6 @@
 /* basename.c -- return the last element in a file name
 
-   Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2016 Free Software
+   Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
-#include "dirname.h"
+/* Specification.  */
+#include "basename-lgpl.h"
 
+#include <stdbool.h>
 #include <string.h>
 
-/* Return the address of the last file name component of NAME.  If
-   NAME has no relative file name components because it is a file
-   system root, return the empty string.  */
+#include "filename.h"
 
 char *
 last_component (char const *name)
 {
   char const *base = name + FILE_SYSTEM_PREFIX_LEN (name);
   char const *p;
-  bool saw_slash = false;
+  bool last_was_slash = false;
 
   while (ISSLASH (*base))
     base++;
@@ -39,21 +39,17 @@ last_component (char const *name)
   for (p = base; *p; p++)
     {
       if (ISSLASH (*p))
-        saw_slash = true;
-      else if (saw_slash)
+        last_was_slash = true;
+      else if (last_was_slash)
         {
           base = p;
-          saw_slash = false;
+          last_was_slash = false;
         }
     }
 
   return (char *) base;
 }
 
-/* Return the length of the basename NAME.  Typically NAME is the
-   value returned by base_name or last_component.  Act like strlen
-   (NAME), except omit all trailing slashes.  */
-
 size_t
 base_len (char const *name)
 {
diff --git a/lib/basename-lgpl.h b/lib/basename-lgpl.h
new file mode 100644 (file)
index 0000000..1e9631a
--- /dev/null
@@ -0,0 +1,78 @@
+/*  Extract the last component (base name) of a file name.
+
+    Copyright (C) 1998, 2001, 2003-2006, 2009-2021 Free Software Foundation,
+    Inc.
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 3 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _BASENAME_LGPL_H
+#define _BASENAME_LGPL_H
+
+#include <stddef.h>
+
+#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
+# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Return the address of the last file name component of FILENAME.
+   If FILENAME has some trailing slash(es), they are considered to be
+   part of the last component.
+   If FILENAME has no relative file name components because it is a file
+   system root, return the empty string.
+   Examples:
+              FILENAME      RESULT
+              "foo.c"       "foo.c"
+              "foo/bar.c"   "bar.c"
+              "/foo/bar.c"  "bar.c"
+              "foo/bar/"    "bar/"
+              "foo/bar//"   "bar//"
+              "/"           ""
+              "//"          ""
+              ""            ""
+   The return value is a tail of the given FILENAME; do NOT free() it!  */
+
+/* This function was traditionally called 'basename', but we avoid this
+   function name because
+     * Various platforms have different functions in their libc.
+       In particular, the glibc basename(), defined in <string.h>, does
+       not consider trailing slashes to be part of the component:
+              FILENAME      RESULT
+              "foo/bar/"    ""
+              "foo/bar//"   ""
+     * The 'basename' command eliminates trailing slashes and for a root
+       produces a non-empty result:
+              FILENAME      RESULT
+              "foo/bar/"    "bar"
+              "foo/bar//"   "bar"
+              "/"           "/"
+              "//"          "/"
+ */
+extern char *last_component (char const *filename) _GL_ATTRIBUTE_PURE;
+
+/* Return the length of the basename FILENAME.
+   Typically FILENAME is the value returned by base_name or last_component.
+   Act like strlen (FILENAME), except omit all trailing slashes.  */
+extern size_t base_len (char const *filename) _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /* _BASENAME_LGPL_H */
index ed1872d..0ba2878 100644 (file)
@@ -1,6 +1,6 @@
 /* basename.c -- return the last element in a file name
 
-   Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2016 Free Software
+   Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index d828bcd..f267897 100644 (file)
@@ -1,4 +1,39 @@
+/* Binary mode I/O.
+   Copyright 2017-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
 #include <config.h>
+
 #define BINARY_IO_INLINE _GL_EXTERN_INLINE
 #include "binary-io.h"
-typedef int dummy;
+
+#if defined __DJGPP__ || defined __EMX__
+# include <unistd.h>
+
+int
+set_binary_mode (int fd, int mode)
+{
+  if (isatty (fd))
+    /* If FD refers to a console (not a pipe, not a regular file),
+       O_TEXT is the only reasonable mode, both on input and on output.
+       Silently ignore the request.  If we were to return -1 here,
+       all programs that use xset_binary_mode would fail when run
+       with console input or console output.  */
+    return O_TEXT;
+  else
+    return __gl_setmode (fd, mode);
+}
+
+#endif
index 9f17c0d..8654fd2 100644 (file)
@@ -1,5 +1,5 @@
 /* Binary mode I/O.
-   Copyright (C) 2001, 2003, 2005, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2005, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _BINARY_H
 #define _BINARY_H
@@ -33,15 +33,12 @@ _GL_INLINE_HEADER_BEGIN
 # define BINARY_IO_INLINE _GL_INLINE
 #endif
 
-/* set_binary_mode (fd, mode)
-   sets the binary/text I/O mode of file descriptor fd to the given mode
-   (must be O_BINARY or O_TEXT) and returns the previous mode.  */
 #if O_BINARY
 # if defined __EMX__ || defined __DJGPP__ || defined __CYGWIN__
 #  include <io.h> /* declares setmode() */
-#  define set_binary_mode setmode
+#  define __gl_setmode setmode
 # else
-#  define set_binary_mode _setmode
+#  define __gl_setmode _setmode
 #  undef fileno
 #  define fileno _fileno
 # endif
@@ -50,26 +47,31 @@ _GL_INLINE_HEADER_BEGIN
   /* Use a function rather than a macro, to avoid gcc warnings
      "warning: statement with no effect".  */
 BINARY_IO_INLINE int
-set_binary_mode (int fd, int mode)
+__gl_setmode (int fd _GL_UNUSED, int mode _GL_UNUSED)
 {
-  (void) fd;
-  (void) mode;
   return O_BINARY;
 }
 #endif
 
-/* SET_BINARY (fd);
-   changes the file descriptor fd to perform binary I/O.  */
+/* Set FD's mode to MODE, which should be either O_TEXT or O_BINARY.
+   Return the old mode if successful, -1 (setting errno) on failure.
+   Ordinarily this function would be called 'setmode', since that is
+   its old name on MS-Windows, but it is called 'set_binary_mode' here
+   to avoid colliding with a BSD function of another name.  */
+
 #if defined __DJGPP__ || defined __EMX__
-# include <unistd.h> /* declares isatty() */
-  /* Avoid putting stdin/stdout in binary mode if it is connected to
-     the console, because that would make it impossible for the user
-     to interrupt the program through Ctrl-C or Ctrl-Break.  */
-# define SET_BINARY(fd) ((void) (!isatty (fd) ? (set_binary_mode (fd, O_BINARY), 0) : 0))
+extern int set_binary_mode (int fd, int mode);
 #else
-# define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY))
+BINARY_IO_INLINE int
+set_binary_mode (int fd, int mode)
+{
+  return __gl_setmode (fd, mode);
+}
 #endif
 
+/* This macro is obsolescent.  */
+#define SET_BINARY(fd) ((void) set_binary_mode (fd, O_BINARY))
+
 _GL_INLINE_HEADER_END
 
 #endif /* _BINARY_H */
diff --git a/lib/bitrotate.c b/lib/bitrotate.c
new file mode 100644 (file)
index 0000000..a8f6028
--- /dev/null
@@ -0,0 +1,3 @@
+#include <config.h>
+#define BITROTATE_INLINE _GL_EXTERN_INLINE
+#include "bitrotate.h"
diff --git a/lib/bitrotate.h b/lib/bitrotate.h
new file mode 100644 (file)
index 0000000..895cc0d
--- /dev/null
@@ -0,0 +1,138 @@
+/* bitrotate.h - Rotate bits in integers
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Simon Josefsson <simon@josefsson.org>, 2008. */
+
+#ifndef _GL_BITROTATE_H
+#define _GL_BITROTATE_H
+
+#include <limits.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef BITROTATE_INLINE
+# define BITROTATE_INLINE _GL_INLINE
+#endif
+
+#ifdef UINT64_MAX
+/* Given an unsigned 64-bit argument X, return the value corresponding
+   to rotating the bits N steps to the left.  N must be between 1 and
+   63 inclusive. */
+BITROTATE_INLINE uint64_t
+rotl64 (uint64_t x, int n)
+{
+  return ((x << n) | (x >> (64 - n))) & UINT64_MAX;
+}
+
+/* Given an unsigned 64-bit argument X, return the value corresponding
+   to rotating the bits N steps to the right.  N must be between 1 to
+   63 inclusive.*/
+BITROTATE_INLINE uint64_t
+rotr64 (uint64_t x, int n)
+{
+  return ((x >> n) | (x << (64 - n))) & UINT64_MAX;
+}
+#endif
+
+/* Given an unsigned 32-bit argument X, return the value corresponding
+   to rotating the bits N steps to the left.  N must be between 1 and
+   31 inclusive. */
+BITROTATE_INLINE uint32_t
+rotl32 (uint32_t x, int n)
+{
+  return ((x << n) | (x >> (32 - n))) & UINT32_MAX;
+}
+
+/* Given an unsigned 32-bit argument X, return the value corresponding
+   to rotating the bits N steps to the right.  N must be between 1 to
+   31 inclusive.*/
+BITROTATE_INLINE uint32_t
+rotr32 (uint32_t x, int n)
+{
+  return ((x >> n) | (x << (32 - n))) & UINT32_MAX;
+}
+
+/* Given a size_t argument X, return the value corresponding
+   to rotating the bits N steps to the left.  N must be between 1 and
+   (CHAR_BIT * sizeof (size_t) - 1) inclusive.  */
+BITROTATE_INLINE size_t
+rotl_sz (size_t x, int n)
+{
+  return ((x << n) | (x >> ((CHAR_BIT * sizeof x) - n))) & SIZE_MAX;
+}
+
+/* Given a size_t argument X, return the value corresponding
+   to rotating the bits N steps to the right.  N must be between 1 to
+   (CHAR_BIT * sizeof (size_t) - 1) inclusive.  */
+BITROTATE_INLINE size_t
+rotr_sz (size_t x, int n)
+{
+  return ((x >> n) | (x << ((CHAR_BIT * sizeof x) - n))) & SIZE_MAX;
+}
+
+/* Given an unsigned 16-bit argument X, return the value corresponding
+   to rotating the bits N steps to the left.  N must be between 1 to
+   15 inclusive, but on most relevant targets N can also be 0 and 16
+   because 'int' is at least 32 bits and the arguments must widen
+   before shifting. */
+BITROTATE_INLINE uint16_t
+rotl16 (uint16_t x, int n)
+{
+  return (((unsigned int) x << n) | ((unsigned int) x >> (16 - n)))
+         & UINT16_MAX;
+}
+
+/* Given an unsigned 16-bit argument X, return the value corresponding
+   to rotating the bits N steps to the right.  N must be in 1 to 15
+   inclusive, but on most relevant targets N can also be 0 and 16
+   because 'int' is at least 32 bits and the arguments must widen
+   before shifting. */
+BITROTATE_INLINE uint16_t
+rotr16 (uint16_t x, int n)
+{
+  return (((unsigned int) x >> n) | ((unsigned int) x << (16 - n)))
+         & UINT16_MAX;
+}
+
+/* Given an unsigned 8-bit argument X, return the value corresponding
+   to rotating the bits N steps to the left.  N must be between 1 to 7
+   inclusive, but on most relevant targets N can also be 0 and 8
+   because 'int' is at least 32 bits and the arguments must widen
+   before shifting. */
+BITROTATE_INLINE uint8_t
+rotl8 (uint8_t x, int n)
+{
+  return (((unsigned int) x << n) | ((unsigned int) x >> (8 - n))) & UINT8_MAX;
+}
+
+/* Given an unsigned 8-bit argument X, return the value corresponding
+   to rotating the bits N steps to the right.  N must be in 1 to 7
+   inclusive, but on most relevant targets N can also be 0 and 8
+   because 'int' is at least 32 bits and the arguments must widen
+   before shifting. */
+BITROTATE_INLINE uint8_t
+rotr8 (uint8_t x, int n)
+{
+  return (((unsigned int) x >> n) | ((unsigned int) x << (8 - n))) & UINT8_MAX;
+}
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_BITROTATE_H */
index e7badf9..58186c4 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert unibyte character to wide character.
-   Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2010-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
similarity index 91%
rename from build-aux/snippet/c++defs.h
rename to lib/c++defs.h
index 2b819da..39df1bc 100644 (file)
@@ -1,5 +1,5 @@
 /* C++ compatible function declaration macros.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -12,7 +12,7 @@
    General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_CXXDEFS_H
 #define _GL_CXXDEFS_H
     _GL_EXTERN_C int _gl_cxxalias_dummy
 #endif
 
+/* _GL_CXXALIAS_MDA (func, rettype, parameters);
+   is to be used when func is a Microsoft deprecated alias, on native Windows.
+   It declares a C++ alias called GNULIB_NAMESPACE::func
+   that redirects to _func, if GNULIB_NAMESPACE is defined.
+   Example:
+     _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
+ */
+#define _GL_CXXALIAS_MDA(func,rettype,parameters) \
+  _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
+
 /* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
    is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
    except that the C function rpl_func may have a slightly different
     _GL_EXTERN_C int _gl_cxxalias_dummy
 #endif
 
+/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
+   is like  _GL_CXXALIAS_MDA (func, rettype, parameters);
+   except that the C function func may have a slightly different declaration.
+   A cast is used to silence the "invalid conversion" error that would
+   otherwise occur.  */
+#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
+  _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
+
 /* _GL_CXXALIAS_SYS (func, rettype, parameters);
    declares a C++ alias called GNULIB_NAMESPACE::func
    that redirects to the system provided function func, if GNULIB_NAMESPACE
    _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
 # define _GL_CXXALIASWARN_1(func,namespace) \
    _GL_CXXALIASWARN_2 (func, namespace)
-/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
    we enable the warning only when not optimizing.  */
-# if !__OPTIMIZE__
+# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
 #  define _GL_CXXALIASWARN_2(func,namespace) \
     _GL_WARN_ON_USE (func, \
                      "The symbol ::" #func " refers to the system function. " \
                         GNULIB_NAMESPACE)
 # define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
    _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
-/* To work around GCC bug <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
    we enable the warning only when not optimizing.  */
-# if !__OPTIMIZE__
+# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
-    _GL_WARN_ON_USE_CXX (func, rettype, parameters_and_attributes, \
+    _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
                          "The symbol ::" #func " refers to the system function. " \
                          "Use " #namespace "::" #func " instead.")
-# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
-#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
-     extern __typeof__ (func) func
 # else
 #  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
      _GL_EXTERN_C int _gl_cxxalias_dummy
index 717ae78..bf24a88 100644 (file)
@@ -5,7 +5,7 @@
    <ctype.h> functions' behaviour depends on the current locale set via
    setlocale.
 
-   Copyright (C) 2000-2003, 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2006, 2008-2021 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef C_CTYPE_H
 #define C_CTYPE_H
@@ -115,16 +115,16 @@ extern "C" {
 
 /* Cases for lowercase hex letters, and lowercase letters, all offset by N.  */
 
-#define _C_CTYPE_LOWER_A_THRU_F_N(n) \
-   case 'a' + (n): case 'b' + (n): case 'c' + (n): case 'd' + (n): \
-   case 'e' + (n): case 'f' + (n)
-#define _C_CTYPE_LOWER_N(n) \
-   _C_CTYPE_LOWER_A_THRU_F_N(n): \
-   case 'g' + (n): case 'h' + (n): case 'i' + (n): case 'j' + (n): \
-   case 'k' + (n): case 'l' + (n): case 'm' + (n): case 'n' + (n): \
-   case 'o' + (n): case 'p' + (n): case 'q' + (n): case 'r' + (n): \
-   case 's' + (n): case 't' + (n): case 'u' + (n): case 'v' + (n): \
-   case 'w' + (n): case 'x' + (n): case 'y' + (n): case 'z' + (n)
+#define _C_CTYPE_LOWER_A_THRU_F_N(N) \
+   case 'a' + (N): case 'b' + (N): case 'c' + (N): case 'd' + (N): \
+   case 'e' + (N): case 'f' + (N)
+#define _C_CTYPE_LOWER_N(N) \
+   _C_CTYPE_LOWER_A_THRU_F_N(N): \
+   case 'g' + (N): case 'h' + (N): case 'i' + (N): case 'j' + (N): \
+   case 'k' + (N): case 'l' + (N): case 'm' + (N): case 'n' + (N): \
+   case 'o' + (N): case 'p' + (N): case 'q' + (N): case 'r' + (N): \
+   case 's' + (N): case 't' + (N): case 'u' + (N): case 'v' + (N): \
+   case 'w' + (N): case 'x' + (N): case 'y' + (N): case 'z' + (N)
 
 /* Cases for hex letters, digits, lower, punct, and upper.  */
 
index 5353c08..1965bdd 100644 (file)
@@ -1,6 +1,6 @@
 /* Stack overflow handling.
 
-   Copyright (C) 2002, 2004, 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
 
 #include <config.h>
 
-#ifndef __attribute__
-# if __GNUC__ < 3
-#  define __attribute__(x)
-# endif
-#endif
-
-#include "gettext.h"
-#define _(msgid) gettext (msgid)
+#include "c-stack.h"
 
 #include <errno.h>
-
+#include <inttypes.h>
 #include <signal.h>
-#if ! HAVE_STACK_T && ! defined stack_t
-typedef struct sigaltstack stack_t;
-#endif
-#ifndef SIGSTKSZ
-# define SIGSTKSZ 16384
-#elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384
-/* libsigsegv 2.6 through 2.8 have a bug where some architectures use
-   more than the Linux default of an 8k alternate stack when deciding
-   if a fault was caused by stack overflow.  */
-# undef SIGSTKSZ
-# define SIGSTKSZ 16384
-#endif
-
+#include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
-
-/* Posix 2001 declares ucontext_t in <ucontext.h>, Posix 200x in
-   <signal.h>.  */
-#if HAVE_UCONTEXT_H
-# include <ucontext.h>
-#endif
-
 #include <unistd.h>
 
-#if HAVE_LIBSIGSEGV
-# include <sigsegv.h>
+#if DEBUG
+# include <stdio.h>
 #endif
 
-#include "c-stack.h"
+#include <sigsegv.h>
+
 #include "exitfail.h"
-#include "ignore-value.h"
 #include "getprogname.h"
+#include "idx.h"
+#include "ignore-value.h"
 
-#if defined SA_ONSTACK && defined SA_SIGINFO
-# define SIGINFO_WORKS 1
-#else
-# define SIGINFO_WORKS 0
-# ifndef SA_ONSTACK
-#  define SA_ONSTACK 0
-# endif
-#endif
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+#if HAVE_STACK_OVERFLOW_RECOVERY
+
+/* Storage for the alternate signal stack.
+   64 KiB is not too large for Gnulib-using apps, and is large enough
+   for all known platforms.  Smaller sizes may run into trouble.
+   For example, libsigsegv 2.6 through 2.8 have a bug where some
+   architectures use more than the Linux default of an 8 KiB alternate
+   stack when deciding if a fault was caused by stack overflow.  */
+static max_align_t alternate_signal_stack[(64 * 1024
+                                           + sizeof (max_align_t) - 1)
+                                          / sizeof (max_align_t)];
 
 /* The user-specified action to take when a SEGV-related program error
    or stack overflow occurs.  */
-static void (* volatile segv_action) (int);
+static _GL_ASYNC_SAFE void (* volatile segv_action) (int);
 
 /* Translated messages for program errors and stack overflow.  Do not
    translate them in the signal handler, since gettext is not
@@ -103,55 +85,55 @@ static char const * volatile stack_overflow_message;
    appears to have been a stack overflow, or with a core dump
    otherwise.  This function is async-signal-safe.  */
 
-static _Noreturn void
+static char const * volatile progname;
+
+static _GL_ASYNC_SAFE _Noreturn void
 die (int signo)
 {
-  char const *message;
-#if !SIGINFO_WORKS && !HAVE_LIBSIGSEGV
-  /* We can't easily determine whether it is a stack overflow; so
-     assume that the rest of our program is perfect (!) and that
-     this segmentation violation is a stack overflow.  */
-  signo = 0;
-#endif /* !SIGINFO_WORKS && !HAVE_LIBSIGSEGV */
   segv_action (signo);
-  message = signo ? program_error_message : stack_overflow_message;
-  ignore_value (write (STDERR_FILENO, getprogname (), strlen (getprogname ())));
-  ignore_value (write (STDERR_FILENO, ": ", 2));
-  ignore_value (write (STDERR_FILENO, message, strlen (message)));
-  ignore_value (write (STDERR_FILENO, "\n", 1));
+  char const *message = signo ? program_error_message : stack_overflow_message;
+
+  /* If the message is short, write it all at once to avoid
+     interleaving with other messages.  Avoid writev as it is not
+     documented to be async-signal-safe.  */
+  size_t prognamelen = strlen (progname);
+  size_t messagelen = strlen (message);
+  static char const separator[] = {':', ' '};
+  char buf[sizeof alternate_signal_stack / 16 + sizeof separator];
+  idx_t buflen;
+  if (prognamelen + messagelen < sizeof buf - sizeof separator)
+    {
+      char *p = mempcpy (buf, progname, prognamelen);
+      p = mempcpy (p, separator, sizeof separator);
+      p = mempcpy (p, message, messagelen);
+      *p++ = '\n';
+      buflen = p - buf;
+    }
+  else
+    {
+      ignore_value (write (STDERR_FILENO, progname, prognamelen));
+      ignore_value (write (STDERR_FILENO, separator, sizeof separator));
+      ignore_value (write (STDERR_FILENO, message, messagelen));
+      buf[0] = '\n';
+      buflen = 1;
+    }
+  ignore_value (write (STDERR_FILENO, buf, buflen));
+
   if (! signo)
     _exit (exit_failure);
   raise (signo);
   abort ();
 }
 
-#if (HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK \
-     && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV
-
-/* Storage for the alternate signal stack.  */
-static union
-{
-  char buffer[SIGSTKSZ];
-
-  /* These other members are for proper alignment.  There's no
-     standard way to guarantee stack alignment, but this seems enough
-     in practice.  */
-  long double ld;
-  long l;
-  void *p;
-} alternate_signal_stack;
-
-static void
-null_action (int signo __attribute__ ((unused)))
+static _GL_ASYNC_SAFE void
+null_action (int signo _GL_UNUSED)
 {
 }
 
-#endif /* SIGALTSTACK || LIBSIGSEGV */
-
-/* Only use libsigsegv if we need it; platforms like Solaris can
-   detect stack overflow without the overhead of an external
-   library.  */
-#if HAVE_LIBSIGSEGV && ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC
+/* Pacify GCC 9.3.1, which otherwise would complain about segv_handler.  */
+# if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
+#  pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
+# endif
 
 /* Nonzero if general segv handler could not be installed.  */
 static volatile int segv_handler_missing;
@@ -159,14 +141,16 @@ static volatile int segv_handler_missing;
 /* Handle a segmentation violation and exit if it cannot be stack
    overflow.  This function is async-signal-safe.  */
 
-static int segv_handler (void *address __attribute__ ((unused)),
-                         int serious)
+static _GL_ASYNC_SAFE int
+segv_handler (void *address _GL_UNUSED, int serious)
 {
 # if DEBUG
   {
     char buf[1024];
-    sprintf (buf, "segv_handler serious=%d\n", serious);
-    write (STDERR_FILENO, buf, strlen (buf));
+    int saved_errno = errno;
+    ignore_value (write (STDERR_FILENO, buf,
+                         sprintf (buf, "segv_handler serious=%d\n", serious)));
+    errno = saved_errno;
   }
 # endif
 
@@ -180,16 +164,16 @@ static int segv_handler (void *address __attribute__ ((unused)),
 /* Handle a segmentation violation that is likely to be a stack
    overflow and exit.  This function is async-signal-safe.  */
 
-static _Noreturn void
-overflow_handler (int emergency,
-                  stackoverflow_context_t context __attribute__ ((unused)))
+static _GL_ASYNC_SAFE _Noreturn void
+overflow_handler (int emergency, stackoverflow_context_t context _GL_UNUSED)
 {
 # if DEBUG
   {
     char buf[1024];
-    sprintf (buf, "overflow_handler emergency=%d segv_handler_missing=%d\n",
-             emergency, segv_handler_missing);
-    write (STDERR_FILENO, buf, strlen (buf));
+    ignore_value (write (STDERR_FILENO, buf,
+                         sprintf (buf, ("overflow_handler emergency=%d"
+                                        " segv_handler_missing=%d\n"),
+                                  emergency, segv_handler_missing)));
   }
 # endif
 
@@ -197,16 +181,17 @@ overflow_handler (int emergency,
 }
 
 int
-c_stack_action (void (*action) (int))
+c_stack_action (_GL_ASYNC_SAFE void (*action) (int))
 {
   segv_action = action ? action : null_action;
   program_error_message = _("program error");
   stack_overflow_message = _("stack overflow");
+  progname = getprogname ();
 
   /* Always install the overflow handler.  */
   if (stackoverflow_install_handler (overflow_handler,
-                                     alternate_signal_stack.buffer,
-                                     sizeof alternate_signal_stack.buffer))
+                                     alternate_signal_stack,
+                                     sizeof alternate_signal_stack))
     {
       errno = ENOTSUP;
       return -1;
@@ -217,110 +202,10 @@ c_stack_action (void (*action) (int))
   return 0;
 }
 
-#elif HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK && HAVE_STACK_OVERFLOW_HANDLING
-
-# if SIGINFO_WORKS
-
-/* Handle a segmentation violation and exit.  This function is
-   async-signal-safe.  */
-
-static _Noreturn void
-segv_handler (int signo, siginfo_t *info,
-              void *context __attribute__ ((unused)))
-{
-  /* Clear SIGNO if it seems to have been a stack overflow.  */
-#  if ! HAVE_XSI_STACK_OVERFLOW_HEURISTIC
-  /* We can't easily determine whether it is a stack overflow; so
-     assume that the rest of our program is perfect (!) and that
-     this segmentation violation is a stack overflow.
-
-     Note that although both Linux and Solaris provide
-     sigaltstack, SA_ONSTACK, and SA_SIGINFO, currently only
-     Solaris satisfies the XSI heuristic.  This is because
-     Solaris populates uc_stack with the details of the
-     interrupted stack, while Linux populates it with the details
-     of the current stack.  */
-  signo = 0;
-#  else
-  if (0 < info->si_code)
-    {
-      /* If the faulting address is within the stack, or within one
-         page of the stack, assume that it is a stack overflow.  */
-      ucontext_t const *user_context = context;
-      char const *stack_base = user_context->uc_stack.ss_sp;
-      size_t stack_size = user_context->uc_stack.ss_size;
-      char const *faulting_address = info->si_addr;
-      size_t page_size = sysconf (_SC_PAGESIZE);
-      size_t s = faulting_address - stack_base + page_size;
-      if (s < stack_size + 2 * page_size)
-        signo = 0;
-
-#   if DEBUG
-      {
-        char buf[1024];
-        sprintf (buf,
-                 "segv_handler fault=%p base=%p size=%lx page=%lx signo=%d\n",
-                 faulting_address, stack_base, (unsigned long) stack_size,
-                 (unsigned long) page_size, signo);
-        write (STDERR_FILENO, buf, strlen (buf));
-      }
-#   endif
-    }
-#  endif
-
-  die (signo);
-}
-# endif
-
-int
-c_stack_action (void (*action) (int))
-{
-  int r;
-  stack_t st;
-  struct sigaction act;
-  st.ss_flags = 0;
-# if SIGALTSTACK_SS_REVERSED
-  /* Irix mistakenly treats ss_sp as the upper bound, rather than
-     lower bound, of the alternate stack.  */
-  st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ - sizeof (void *);
-  st.ss_size = sizeof alternate_signal_stack.buffer - sizeof (void *);
-# else
-  st.ss_sp = alternate_signal_stack.buffer;
-  st.ss_size = sizeof alternate_signal_stack.buffer;
-# endif
-  r = sigaltstack (&st, NULL);
-  if (r != 0)
-    return r;
-
-  segv_action = action ? action : null_action;
-  program_error_message = _("program error");
-  stack_overflow_message = _("stack overflow");
-
-  sigemptyset (&act.sa_mask);
-
-# if SIGINFO_WORKS
-  /* POSIX 1003.1-2001 says SA_RESETHAND implies SA_NODEFER, but
-     this is not true on Solaris 8 at least.  It doesn't hurt to use
-     SA_NODEFER here, so leave it in.  */
-  act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
-  act.sa_sigaction = segv_handler;
-# else
-  act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND;
-  act.sa_handler = die;
-# endif
-
-# if FAULT_YIELDS_SIGBUS
-  if (sigaction (SIGBUS, &act, NULL) < 0)
-    return -1;
-# endif
-  return sigaction (SIGSEGV, &act, NULL);
-}
-
-#else /* ! ((HAVE_SIGALTSTACK && HAVE_DECL_SIGALTSTACK
-             && HAVE_STACK_OVERFLOW_HANDLING) || HAVE_LIBSIGSEGV) */
+#else /* !HAVE_STACK_OVERFLOW_RECOVERY */
 
 int
-c_stack_action (void (*action) (int)  __attribute__ ((unused)))
+c_stack_action (_GL_ASYNC_SAFE void (*action) (int)  _GL_UNUSED)
 {
   errno = ENOTSUP;
   return -1;
index efd3b8f..a9a8b13 100644 (file)
@@ -1,6 +1,6 @@
 /* Stack overflow handling.
 
-   Copyright (C) 2002, 2004, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
 /* Set up ACTION so that it is invoked on C stack overflow and on other,
 
    A null ACTION acts like an action that does nothing.
 
-   ACTION must be async-signal-safe.  ACTION together with its callees
-   must not require more than SIGSTKSZ bytes of stack space.  Also,
-   ACTION should not call longjmp, because this implementation does
-   not guarantee that it is safe to return to the original stack.
+   Restrictions:
+   - ACTION must be async-signal-safe.
+   - ACTION together with its callees must not require more than 64 KiB of
+     stack space.
+   - ACTION must not create and then invoke nested functions
+     <https://gcc.gnu.org/onlinedocs/gcc/Nested-Functions.html>, because
+     this implementation does not guarantee an executable stack.
+   - ACTION should not call longjmp, because this implementation does not
+     guarantee that it is safe to return to the original stack.
 
    This function may install a handler for the SIGSEGV signal or for the SIGBUS
    signal or exercise other system dependent exception handling APIs.  */
 
-extern int c_stack_action (void (* /*action*/) (int));
+extern int c_stack_action (_GL_ASYNC_SAFE void (* /*action*/) (int));
index 7e570f5..089edfe 100644 (file)
@@ -1,5 +1,5 @@
 /* Case-insensitive string comparison functions in C locale.
-   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2016 Free Software
+   Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef C_STRCASE_H
 #define C_STRCASE_H
index bd113b7..55479d6 100644 (file)
@@ -1,5 +1,5 @@
 /* c-strcasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -52,5 +52,5 @@ c_strcasecmp (const char *s1, const char *s2)
     /* On machines where 'char' and 'int' are types of the same size, the
        difference of two 'unsigned char' values - including the sign bit -
        doesn't fit in an 'int'.  */
-    return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
+    return _GL_CMP (c1, c2);
 }
index ed57251..191b670 100644 (file)
@@ -1,5 +1,5 @@
 /* Optimized case-insensitive string comparison in C locale.
-   Copyright (C) 2001-2002, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -12,7 +12,7 @@
    General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>.  */
 
@@ -27,7 +27,7 @@
 
 /* Help GCC to generate good code for string comparisons with
    immediate strings. */
-#if defined (__GNUC__) && defined (__OPTIMIZE__)
+#if (defined __GNUC__ || defined __clang__) && defined __OPTIMIZE__
 
 /* Case insensitive comparison of ASCII characters.  */
 # if C_CTYPE_ASCII
index c316929..02bc0f2 100644 (file)
@@ -1,5 +1,5 @@
 /* c-strncasecmp.c -- case insensitive string comparator in C locale
-   Copyright (C) 1998-1999, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-1999, 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -52,5 +52,5 @@ c_strncasecmp (const char *s1, const char *s2, size_t n)
     /* On machines where 'char' and 'int' are types of the same size, the
        difference of two 'unsigned char' values - including the sign bit -
        doesn't fit in an 'int'.  */
-    return (c1 > c2 ? 1 : c1 < c2 ? -1 : 0);
+    return _GL_CMP (c1, c2);
 }
diff --git a/lib/calloc.c b/lib/calloc.c
new file mode 100644 (file)
index 0000000..c9da080
--- /dev/null
@@ -0,0 +1,55 @@
+/* calloc() function that is glibc compatible.
+   This wrapper function is required at least on Tru64 UNIX 5.1 and mingw.
+   Copyright (C) 2004-2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering and Bruno Haible */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdlib.h>
+
+#include <errno.h>
+
+#include "xalloc-oversized.h"
+
+/* Call the system's calloc below.  */
+#undef calloc
+
+/* Allocate and zero-fill an NxS-byte block of memory from the heap,
+   even if N or S is zero.  */
+
+void *
+rpl_calloc (size_t n, size_t s)
+{
+  if (n == 0 || s == 0)
+    n = s = 1;
+
+  if (xalloc_oversized (n, s))
+    {
+      errno = ENOMEM;
+      return NULL;
+    }
+
+  void *result = calloc (n, s);
+
+#if !HAVE_MALLOC_POSIX
+  if (result == NULL)
+    errno = ENOMEM;
+#endif
+
+  return result;
+}
index 4b1f6cb..2acf413 100644 (file)
@@ -1,66 +1,68 @@
 /* Return the canonical absolute name of a given file.
-   Copyright (C) 1996-2016 Free Software Foundation, Inc.
+   Copyright (C) 1996-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
 /* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
    optimizes away the name == NULL test below.  */
 # define _GL_ARG_NONNULL(params)
 
-# define _GL_USE_STDLIB_ALLOC 1
-# include <config.h>
+# include <libc-config.h>
 #endif
 
-#if !HAVE_CANONICALIZE_FILE_NAME || !FUNC_REALPATH_WORKS || defined _LIBC
-
 /* Specification.  */
 #include <stdlib.h>
 
-#include <alloca.h>
-#include <string.h>
-#include <unistd.h>
+#include <errno.h>
+#include <fcntl.h>
 #include <limits.h>
-#if HAVE_SYS_PARAM_H || defined _LIBC
-# include <sys/param.h>
-#endif
+#include <stdbool.h>
+#include <string.h>
 #include <sys/stat.h>
-#include <errno.h>
-#include <stddef.h>
+#include <unistd.h>
+
+#include <eloop-threshold.h>
+#include <filename.h>
+#include <idx.h>
+#include <intprops.h>
+#include <scratch_buffer.h>
 
 #ifdef _LIBC
 # include <shlib-compat.h>
+# define GCC_LINT 1
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
 #else
-# define SHLIB_COMPAT(lib, introduced, obsoleted) 0
-# define versioned_symbol(lib, local, symbol, version) extern int dummy
-# define compat_symbol(lib, local, symbol, version)
-# define weak_alias(local, symbol)
 # define __canonicalize_file_name canonicalize_file_name
 # define __realpath realpath
 # include "pathmax.h"
-# include "malloca.h"
-# include "dosname.h"
-# if HAVE_GETCWD
+# define __faccessat faccessat
+# if defined _WIN32 && !defined __CYGWIN__
+#  define __getcwd _getcwd
+# elif HAVE_GETCWD
 #  if IN_RELOCWRAPPER
     /* When building the relocatable program wrapper, use the system's getcwd
        function, not the gnulib override, otherwise we would get a link error.
      */
 #   undef getcwd
 #  endif
-#  ifdef VMS
-    /* We want the directory in Unix syntax, not in VMS syntax.  */
+#  if defined VMS && !defined getcwd
+    /* We want the directory in Unix syntax, not in VMS syntax.
+       The gnulib override of 'getcwd' takes 2 arguments; the original VMS
+       'getcwd' takes 3 arguments.  */
 #   define __getcwd(buf, max) getcwd (buf, max, 0)
 #  else
 #   define __getcwd getcwd
 # else
 #  define __getcwd(buf, max) getwd (buf)
 # endif
+# define __mempcpy mempcpy
+# define __pathconf pathconf
+# define __rawmemchr rawmemchr
 # define __readlink readlink
-# define __set_errno(e) errno = (e)
-# ifndef MAXSYMLINKS
-#  ifdef SYMLOOP_MAX
-#   define MAXSYMLINKS SYMLOOP_MAX
-#  else
-#   define MAXSYMLINKS 20
-#  endif
+# define __stat stat
+# if IN_RELOCWRAPPER
+    /* When building the relocatable program wrapper, use the system's memmove
+       function, not the gnulib override, otherwise we would get a link error.
+     */
+#  undef memmove
 # endif
 #endif
 
-#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
-# define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
+/* Suppress bogus GCC -Wmaybe-uninitialized warnings.  */
+#if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
 #endif
 
-/* Define this independently so that stdint.h is not a prerequisite.  */
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
+#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
+# define DOUBLE_SLASH_IS_DISTINCT_ROOT false
 #endif
 
-#if !FUNC_REALPATH_WORKS || defined _LIBC
+#if defined _LIBC || !FUNC_REALPATH_WORKS
 
-static void
-alloc_failed (void)
+/* Return true if FILE's existence can be shown, false (setting errno)
+   otherwise.  Follow symbolic links.  */
+static bool
+file_accessible (char const *file)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-  /* Avoid errno problem without using the malloc or realloc modules; see:
-     http://lists.gnu.org/archive/html/bug-gnulib/2016-08/msg00025.html  */
-  errno = ENOMEM;
-#endif
+# if defined _LIBC || HAVE_FACCESSAT
+  return __faccessat (AT_FDCWD, file, F_OK, AT_EACCESS) == 0;
+# else
+  struct stat st;
+  return __stat (file, &st) == 0 || errno == EOVERFLOW;
+# endif
 }
 
-/* Return the canonical absolute name of file NAME.  A canonical name
-   does not contain any ".", ".." components nor any repeated path
-   separators ('/') or symlinks.  All path components must exist.  If
-   RESOLVED is null, the result is malloc'd; otherwise, if the
-   canonical name is PATH_MAX chars or more, returns null with 'errno'
-   set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars,
-   returns the name in RESOLVED.  If the name cannot be resolved and
-   RESOLVED is non-NULL, it contains the path of the first component
-   that cannot be resolved.  If the path can be resolved, RESOLVED
-   holds the same value as the value returned.  */
+/* True if concatenating END as a suffix to a file name means that the
+   code needs to check that the file name is that of a searchable
+   directory, since the canonicalize_filename_mode_stk code won't
+   check this later anyway when it checks an ordinary file name
+   component within END.  END must either be empty, or start with a
+   slash.  */
 
-char *
-__realpath (const char *name, char *resolved)
+static bool _GL_ATTRIBUTE_PURE
+suffix_requires_dir_check (char const *end)
+{
+  /* If END does not start with a slash, the suffix is OK.  */
+  while (ISSLASH (*end))
+    {
+      /* Two or more slashes act like a single slash.  */
+      do
+        end++;
+      while (ISSLASH (*end));
+
+      switch (*end++)
+        {
+        default: return false;  /* An ordinary file name component is OK.  */
+        case '\0': return true; /* Trailing "/" is trouble.  */
+        case '.': break;        /* Possibly "." or "..".  */
+        }
+      /* Trailing "/.", or "/.." even if not trailing, is trouble.  */
+      if (!*end || (*end == '.' && (!end[1] || ISSLASH (end[1]))))
+        return true;
+    }
+
+  return false;
+}
+
+/* Append this to a file name to test whether it is a searchable directory.
+   On POSIX platforms "/" suffices, but "/./" is sometimes needed on
+   macOS 10.13 <https://bugs.gnu.org/30350>, and should also work on
+   platforms like AIX 7.2 that need at least "/.".  */
+
+# if defined _LIBC || defined LSTAT_FOLLOWS_SLASHED_SYMLINK
+static char const dir_suffix[] = "/";
+# else
+static char const dir_suffix[] = "/./";
+# endif
+
+/* Return true if DIR is a searchable dir, false (setting errno) otherwise.
+   DIREND points to the NUL byte at the end of the DIR string.
+   Store garbage into DIREND[0 .. strlen (dir_suffix)].  */
+
+static bool
+dir_check (char *dir, char *dirend)
 {
-  char *rpath, *dest, *extra_buf = NULL;
-  const char *start, *end, *rpath_limit;
-  long int path_max;
+  strcpy (dirend, dir_suffix);
+  return file_accessible (dir);
+}
+
+static idx_t
+get_path_max (void)
+{
+# ifdef PATH_MAX
+  long int path_max = PATH_MAX;
+# else
+  /* The caller invoked realpath with a null RESOLVED, even though
+     PATH_MAX is not defined as a constant.  The glibc manual says
+     programs should not do this, and POSIX says the behavior is undefined.
+     Historically, glibc here used the result of pathconf, or 1024 if that
+     failed; stay consistent with this (dubious) historical practice.  */
+  int err = errno;
+  long int path_max = __pathconf ("/", _PC_PATH_MAX);
+  __set_errno (err);
+# endif
+  return path_max < 0 ? 1024 : path_max <= IDX_MAX ? path_max : IDX_MAX;
+}
+
+/* Act like __realpath (see below), with an additional argument
+   rname_buf that can be used as temporary storage.
+
+   If GCC_LINT is defined, do not inline this function with GCC 10.1
+   and later, to avoid creating a pointer to the stack that GCC
+   -Wreturn-local-addr incorrectly complains about.  See:
+   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
+   Although the noinline attribute can hurt performance a bit, no better way
+   to pacify GCC is known; even an explicit #pragma does not pacify GCC.
+   When the GCC bug is fixed this workaround should be limited to the
+   broken GCC versions.  */
+# if __GNUC_PREREQ (10, 1)
+#  if defined GCC_LINT || defined lint
+__attribute__ ((__noinline__))
+#  elif __OPTIMIZE__ && !__NO_INLINE__
+#   define GCC_BOGUS_WRETURN_LOCAL_ADDR
+#  endif
+# endif
+static char *
+realpath_stk (const char *name, char *resolved,
+              struct scratch_buffer *rname_buf)
+{
+  char *dest;
+  char const *start;
+  char const *end;
   int num_links = 0;
-  size_t prefix_len;
 
   if (name == NULL)
     {
@@ -138,203 +226,148 @@ __realpath (const char *name, char *resolved)
       return NULL;
     }
 
-#ifdef PATH_MAX
-  path_max = PATH_MAX;
-#else
-  path_max = pathconf (name, _PC_PATH_MAX);
-  if (path_max <= 0)
-    path_max = 8192;
-#endif
-
-  if (resolved == NULL)
-    {
-      rpath = malloc (path_max);
-      if (rpath == NULL)
-        {
-          alloc_failed ();
-          return NULL;
-        }
-    }
-  else
-    rpath = resolved;
-  rpath_limit = rpath + path_max;
+  struct scratch_buffer extra_buffer, link_buffer;
+  scratch_buffer_init (&extra_buffer);
+  scratch_buffer_init (&link_buffer);
+  scratch_buffer_init (rname_buf);
+  char *rname_on_stack = rname_buf->data;
+  char *rname = rname_on_stack;
+  bool end_in_extra_buffer = false;
+  bool failed = true;
 
   /* This is always zero for Posix hosts, but can be 2 for MS-Windows
      and MS-DOS X:/foo/bar file names.  */
-  prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
+  idx_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
 
   if (!IS_ABSOLUTE_FILE_NAME (name))
     {
-      if (!__getcwd (rpath, path_max))
+      while (!__getcwd (rname, rname_buf->length))
         {
-          rpath[0] = '\0';
-          goto error;
+          if (errno != ERANGE)
+            {
+              dest = rname;
+              goto error;
+            }
+          if (!scratch_buffer_grow (rname_buf))
+            goto error_nomem;
+          rname = rname_buf->data;
         }
-      dest = strchr (rpath, '\0');
+      dest = __rawmemchr (rname, '\0');
       start = name;
-      prefix_len = FILE_SYSTEM_PREFIX_LEN (rpath);
+      prefix_len = FILE_SYSTEM_PREFIX_LEN (rname);
     }
   else
     {
-      dest = rpath;
-      if (prefix_len)
-        {
-          memcpy (rpath, name, prefix_len);
-          dest += prefix_len;
-        }
+      dest = __mempcpy (rname, name, prefix_len);
       *dest++ = '/';
       if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
         {
-          if (ISSLASH (name[1]) && !ISSLASH (name[2]) && !prefix_len)
+          if (prefix_len == 0 /* implies ISSLASH (name[0]) */
+              && ISSLASH (name[1]) && !ISSLASH (name[2]))
             *dest++ = '/';
           *dest = '\0';
         }
       start = name + prefix_len;
     }
 
-  for (end = start; *start; start = end)
+  for ( ; *start; start = end)
     {
-#ifdef _LIBC
-      struct stat64 st;
-#else
-      struct stat st;
-#endif
-
-      /* Skip sequence of multiple path-separators.  */
+      /* Skip sequence of multiple file name separators.  */
       while (ISSLASH (*start))
         ++start;
 
-      /* Find end of path component.  */
+      /* Find end of component.  */
       for (end = start; *end && !ISSLASH (*end); ++end)
         /* Nothing.  */;
 
-      if (end - start == 0)
+      /* Length of this file name component; it can be zero if a file
+         name ends in '/'.  */
+      idx_t startlen = end - start;
+
+      if (startlen == 0)
         break;
-      else if (end - start == 1 && start[0] == '.')
+      else if (startlen == 1 && start[0] == '.')
         /* nothing */;
-      else if (end - start == 2 && start[0] == '.' && start[1] == '.')
+      else if (startlen == 2 && start[0] == '.' && start[1] == '.')
         {
           /* Back up to previous component, ignore if at root already.  */
-          if (dest > rpath + prefix_len + 1)
-            for (--dest; dest > rpath && !ISSLASH (dest[-1]); --dest)
+          if (dest > rname + prefix_len + 1)
+            for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest)
               continue;
           if (DOUBLE_SLASH_IS_DISTINCT_ROOT
-              && dest == rpath + 1 && !prefix_len
+              && dest == rname + 1 && !prefix_len
               && ISSLASH (*dest) && !ISSLASH (dest[1]))
             dest++;
         }
       else
         {
-          size_t new_size;
-
           if (!ISSLASH (dest[-1]))
             *dest++ = '/';
 
-          if (dest + (end - start) >= rpath_limit)
+          while (rname + rname_buf->length - dest
+                 < startlen + sizeof dir_suffix)
             {
-              ptrdiff_t dest_offset = dest - rpath;
-              char *new_rpath;
-
-              if (resolved)
-                {
-                  __set_errno (ENAMETOOLONG);
-                  if (dest > rpath + prefix_len + 1)
-                    dest--;
-                  *dest = '\0';
-                  goto error;
-                }
-              new_size = rpath_limit - rpath;
-              if (end - start + 1 > path_max)
-                new_size += end - start + 1;
-              else
-                new_size += path_max;
-              new_rpath = (char *) realloc (rpath, new_size);
-              if (new_rpath == NULL)
-                {
-                  alloc_failed ();
-                  goto error;
-                }
-              rpath = new_rpath;
-              rpath_limit = rpath + new_size;
-
-              dest = rpath + dest_offset;
+              idx_t dest_offset = dest - rname;
+              if (!scratch_buffer_grow_preserve (rname_buf))
+                goto error_nomem;
+              rname = rname_buf->data;
+              dest = rname + dest_offset;
             }
 
-#ifdef _LIBC
-          dest = __mempcpy (dest, start, end - start);
-#else
-          memcpy (dest, start, end - start);
-          dest += end - start;
-#endif
+          dest = __mempcpy (dest, start, startlen);
           *dest = '\0';
 
-#ifdef _LIBC
-          if (__lxstat64 (_STAT_VER, rpath, &st) < 0)
-#else
-          if (lstat (rpath, &st) < 0)
-#endif
-            goto error;
-
-          if (S_ISLNK (st.st_mode))
+          char *buf;
+          ssize_t n;
+          while (true)
             {
-              char *buf;
-              size_t len;
-              ssize_t n;
-
-              if (++num_links > MAXSYMLINKS)
+              buf = link_buffer.data;
+              idx_t bufsize = link_buffer.length;
+              n = __readlink (rname, buf, bufsize - 1);
+              if (n < bufsize - 1)
+                break;
+              if (!scratch_buffer_grow (&link_buffer))
+                goto error_nomem;
+            }
+          if (0 <= n)
+            {
+              if (++num_links > __eloop_threshold ())
                 {
                   __set_errno (ELOOP);
                   goto error;
                 }
 
-              buf = malloca (path_max);
-              if (!buf)
-                {
-                  __set_errno (ENOMEM);
-                  goto error;
-                }
-
-              n = __readlink (rpath, buf, path_max - 1);
-              if (n < 0)
-                {
-                  int saved_errno = errno;
-                  freea (buf);
-                  __set_errno (saved_errno);
-                  goto error;
-                }
               buf[n] = '\0';
 
-              if (!extra_buf)
+              char *extra_buf = extra_buffer.data;
+              idx_t end_idx IF_LINT (= 0);
+              if (end_in_extra_buffer)
+                end_idx = end - extra_buf;
+              size_t len = strlen (end);
+              if (INT_ADD_OVERFLOW (len, n))
                 {
-                  extra_buf = malloca (path_max);
-                  if (!extra_buf)
-                    {
-                      freea (buf);
-                      __set_errno (ENOMEM);
-                      goto error;
-                    }
+                  __set_errno (ENOMEM);
+                  goto error_nomem;
                 }
-
-              len = strlen (end);
-              /* Check that n + len + 1 doesn't overflow and is <= path_max. */
-              if (n >= SIZE_MAX - len || n + len >= path_max)
+              while (extra_buffer.length <= len + n)
                 {
-                  freea (buf);
-                  __set_errno (ENAMETOOLONG);
-                  goto error;
+                  if (!scratch_buffer_grow_preserve (&extra_buffer))
+                    goto error_nomem;
+                  extra_buf = extra_buffer.data;
                 }
+              if (end_in_extra_buffer)
+                end = extra_buf + end_idx;
 
               /* Careful here, end may be a pointer into extra_buf... */
               memmove (&extra_buf[n], end, len + 1);
               name = end = memcpy (extra_buf, buf, n);
+              end_in_extra_buffer = true;
 
               if (IS_ABSOLUTE_FILE_NAME (buf))
                 {
-                  size_t pfxlen = FILE_SYSTEM_PREFIX_LEN (buf);
+                  idx_t pfxlen = FILE_SYSTEM_PREFIX_LEN (buf);
 
-                  if (pfxlen)
-                    memcpy (rpath, buf, pfxlen);
-                  dest = rpath + pfxlen;
+                  dest = __mempcpy (rname, buf, pfxlen);
                   *dest++ = '/'; /* It's an absolute symlink */
                   if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
                     {
@@ -349,46 +382,70 @@ __realpath (const char *name, char *resolved)
                 {
                   /* Back up to previous component, ignore if at root
                      already: */
-                  if (dest > rpath + prefix_len + 1)
-                    for (--dest; dest > rpath && !ISSLASH (dest[-1]); --dest)
+                  if (dest > rname + prefix_len + 1)
+                    for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest)
                       continue;
-                  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rpath + 1
+                  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1
                       && ISSLASH (*dest) && !ISSLASH (dest[1]) && !prefix_len)
                     dest++;
                 }
             }
-          else if (!S_ISDIR (st.st_mode) && *end != '\0')
-            {
-              __set_errno (ENOTDIR);
-              goto error;
-            }
+          else if (! (suffix_requires_dir_check (end)
+                      ? dir_check (rname, dest)
+                      : errno == EINVAL))
+            goto error;
         }
     }
-  if (dest > rpath + prefix_len + 1 && ISSLASH (dest[-1]))
+  if (dest > rname + prefix_len + 1 && ISSLASH (dest[-1]))
     --dest;
-  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rpath + 1 && !prefix_len
+  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1 && !prefix_len
       && ISSLASH (*dest) && !ISSLASH (dest[1]))
     dest++;
-  *dest = '\0';
+  failed = false;
 
-  if (extra_buf)
-    freea (extra_buf);
+error:
+  *dest++ = '\0';
+  if (resolved != NULL && dest - rname <= get_path_max ())
+    rname = strcpy (resolved, rname);
 
-  return rpath;
+error_nomem:
+  scratch_buffer_free (&extra_buffer);
+  scratch_buffer_free (&link_buffer);
 
-error:
-  {
-    int saved_errno = errno;
-    if (extra_buf)
-      freea (extra_buf);
-    if (resolved == NULL)
-      free (rpath);
-    __set_errno (saved_errno);
-  }
-  return NULL;
+  if (failed || rname == resolved)
+    {
+      scratch_buffer_free (rname_buf);
+      return failed ? NULL : resolved;
+    }
+
+  return scratch_buffer_dupfree (rname_buf, dest - rname);
+}
+
+/* Return the canonical absolute name of file NAME.  A canonical name
+   does not contain any ".", ".." components nor any repeated file name
+   separators ('/') or symlinks.  All file name components must exist.  If
+   RESOLVED is null, the result is malloc'd; otherwise, if the
+   canonical name is PATH_MAX chars or more, returns null with 'errno'
+   set to ENAMETOOLONG; if the name fits in fewer than PATH_MAX chars,
+   returns the name in RESOLVED.  If the name cannot be resolved and
+   RESOLVED is non-NULL, it contains the name of the first component
+   that cannot be resolved.  If the name can be resolved, RESOLVED
+   holds the same value as the value returned.  */
+
+char *
+__realpath (const char *name, char *resolved)
+{
+  #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
+   #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
+   #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
+  #endif
+  struct scratch_buffer rname_buffer;
+  return realpath_stk (name, resolved, &rname_buffer);
 }
+libc_hidden_def (__realpath)
 versioned_symbol (libc, __realpath, realpath, GLIBC_2_3);
-#endif /* !FUNC_REALPATH_WORKS || defined _LIBC */
+
+#endif /* defined _LIBC || !FUNC_REALPATH_WORKS */
 
 
 #if SHLIB_COMPAT(libc, GLIBC_2_0, GLIBC_2_3)
@@ -414,11 +471,3 @@ __canonicalize_file_name (const char *name)
   return __realpath (name, NULL);
 }
 weak_alias (__canonicalize_file_name, canonicalize_file_name)
-
-#else
-
-/* This declaration is solely to ensure that after preprocessing
-   this file is never empty.  */
-typedef int dummy;
-
-#endif
diff --git a/lib/canonicalize.c b/lib/canonicalize.c
new file mode 100644 (file)
index 0000000..3a1c809
--- /dev/null
@@ -0,0 +1,489 @@
+/* Return the canonical absolute name of a given file.
+   Copyright (C) 1996-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "canonicalize.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <filename.h>
+#include <idx.h>
+#include <intprops.h>
+#include <scratch_buffer.h>
+
+#include "attribute.h"
+#include "file-set.h"
+#include "hash-triple.h"
+#include "xalloc.h"
+
+/* Suppress bogus GCC -Wmaybe-uninitialized warnings.  */
+#if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
+#ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
+# define DOUBLE_SLASH_IS_DISTINCT_ROOT false
+#endif
+
+#if ISSLASH ('\\')
+# define SLASHES "/\\"
+#else
+# define SLASHES "/"
+#endif
+
+/* Return true if FILE's existence can be shown, false (setting errno)
+   otherwise.  Follow symbolic links.  */
+static bool
+file_accessible (char const *file)
+{
+# if HAVE_FACCESSAT
+  return faccessat (AT_FDCWD, file, F_OK, AT_EACCESS) == 0;
+# else
+  struct stat st;
+  return stat (file, &st) == 0 || errno == EOVERFLOW;
+# endif
+}
+
+/* True if concatenating END as a suffix to a file name means that the
+   code needs to check that the file name is that of a searchable
+   directory, since the canonicalize_filename_mode_stk code won't
+   check this later anyway when it checks an ordinary file name
+   component within END.  END must either be empty, or start with a
+   slash.  */
+
+static bool _GL_ATTRIBUTE_PURE
+suffix_requires_dir_check (char const *end)
+{
+  /* If END does not start with a slash, the suffix is OK.  */
+  while (ISSLASH (*end))
+    {
+      /* Two or more slashes act like a single slash.  */
+      do
+        end++;
+      while (ISSLASH (*end));
+
+      switch (*end++)
+        {
+        default: return false;  /* An ordinary file name component is OK.  */
+        case '\0': return true; /* Trailing "/" is trouble.  */
+        case '.': break;        /* Possibly "." or "..".  */
+        }
+      /* Trailing "/.", or "/.." even if not trailing, is trouble.  */
+      if (!*end || (*end == '.' && (!end[1] || ISSLASH (end[1]))))
+        return true;
+    }
+
+  return false;
+}
+
+/* Append this to a file name to test whether it is a searchable directory.
+   On POSIX platforms "/" suffices, but "/./" is sometimes needed on
+   macOS 10.13 <https://bugs.gnu.org/30350>, and should also work on
+   platforms like AIX 7.2 that need at least "/.".  */
+
+#ifdef LSTAT_FOLLOWS_SLASHED_SYMLINK
+static char const dir_suffix[] = "/";
+#else
+static char const dir_suffix[] = "/./";
+#endif
+
+/* Return true if DIR is a searchable dir, false (setting errno) otherwise.
+   DIREND points to the NUL byte at the end of the DIR string.
+   Store garbage into DIREND[0 .. strlen (dir_suffix)].  */
+
+static bool
+dir_check (char *dir, char *dirend)
+{
+  strcpy (dirend, dir_suffix);
+  return file_accessible (dir);
+}
+
+#if !((HAVE_CANONICALIZE_FILE_NAME && FUNC_REALPATH_WORKS)      \
+      || GNULIB_CANONICALIZE_LGPL)
+/* Return the canonical absolute name of file NAME.  A canonical name
+   does not contain any ".", ".." components nor any repeated file name
+   separators ('/') or symlinks.  All components must exist.
+   The result is malloc'd.  */
+
+char *
+canonicalize_file_name (const char *name)
+{
+  return canonicalize_filename_mode (name, CAN_EXISTING);
+}
+#endif /* !HAVE_CANONICALIZE_FILE_NAME */
+
+static bool
+multiple_bits_set (canonicalize_mode_t i)
+{
+  return (i & (i - 1)) != 0;
+}
+
+/* Return true if we've already seen the triple, <FILENAME, dev, ino>.
+   If *HT is not initialized, initialize it.  */
+static bool
+seen_triple (Hash_table **ht, char const *filename, struct stat const *st)
+{
+  if (*ht == NULL)
+    {
+      idx_t initial_capacity = 7;
+      *ht = hash_initialize (initial_capacity,
+                            NULL,
+                            triple_hash,
+                            triple_compare_ino_str,
+                            triple_free);
+      if (*ht == NULL)
+        xalloc_die ();
+    }
+
+  if (seen_file (*ht, filename, st))
+    return true;
+
+  record_file (*ht, filename, st);
+  return false;
+}
+
+
+/* Act like canonicalize_filename_mode (see below), with an additional argument
+   rname_buf that can be used as temporary storage.
+
+   If GCC_LINT is defined, do not inline this function with GCC 10.1
+   and later, to avoid creating a pointer to the stack that GCC
+   -Wreturn-local-addr incorrectly complains about.  See:
+   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644
+   Although the noinline attribute can hurt performance a bit, no better way
+   to pacify GCC is known; even an explicit #pragma does not pacify GCC.
+   When the GCC bug is fixed this workaround should be limited to the
+   broken GCC versions.  */
+#if _GL_GNUC_PREREQ (10, 1)
+# if defined GCC_LINT || defined lint
+__attribute__ ((__noinline__))
+# elif __OPTIMIZE__ && !__NO_INLINE__
+#  define GCC_BOGUS_WRETURN_LOCAL_ADDR
+# endif
+#endif
+static char *
+canonicalize_filename_mode_stk (const char *name, canonicalize_mode_t can_mode,
+                                struct scratch_buffer *rname_buf)
+{
+  char *dest;
+  char const *start;
+  char const *end;
+  Hash_table *ht = NULL;
+  bool logical = (can_mode & CAN_NOLINKS) != 0;
+  int num_links = 0;
+
+  canonicalize_mode_t can_exist = can_mode & CAN_MODE_MASK;
+  if (multiple_bits_set (can_exist))
+    {
+      errno = EINVAL;
+      return NULL;
+    }
+
+  if (name == NULL)
+    {
+      errno = EINVAL;
+      return NULL;
+    }
+
+  if (name[0] == '\0')
+    {
+      errno = ENOENT;
+      return NULL;
+    }
+
+  struct scratch_buffer extra_buffer, link_buffer;
+  scratch_buffer_init (&extra_buffer);
+  scratch_buffer_init (&link_buffer);
+  scratch_buffer_init (rname_buf);
+  char *rname_on_stack = rname_buf->data;
+  char *rname = rname_on_stack;
+  bool end_in_extra_buffer = false;
+  bool failed = true;
+
+  /* This is always zero for Posix hosts, but can be 2 for MS-Windows
+     and MS-DOS X:/foo/bar file names.  */
+  idx_t prefix_len = FILE_SYSTEM_PREFIX_LEN (name);
+
+  if (!IS_ABSOLUTE_FILE_NAME (name))
+    {
+      while (!getcwd (rname, rname_buf->length))
+        {
+          switch (errno)
+            {
+            case ERANGE:
+              if (scratch_buffer_grow (rname_buf))
+                break;
+              FALLTHROUGH;
+            case ENOMEM:
+              xalloc_die ();
+
+            default:
+              dest = rname;
+              goto error;
+            }
+          rname = rname_buf->data;
+        }
+      dest = rawmemchr (rname, '\0');
+      start = name;
+      prefix_len = FILE_SYSTEM_PREFIX_LEN (rname);
+    }
+  else
+    {
+      dest = mempcpy (rname, name, prefix_len);
+      *dest++ = '/';
+      if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
+        {
+          if (prefix_len == 0 /* implies ISSLASH (name[0]) */
+              && ISSLASH (name[1]) && !ISSLASH (name[2]))
+            {
+              *dest++ = '/';
+#if defined _WIN32 && !defined __CYGWIN__
+              /* For UNC file names '\\server\path\to\file', extend the prefix
+                 to include the server: '\\server\'.  */
+              {
+                idx_t i;
+                for (i = 2; name[i] != '\0' && !ISSLASH (name[i]); )
+                  i++;
+                if (name[i] != '\0' /* implies ISSLASH (name[i]) */
+                    && i + 1 < rname_buf->length)
+                  {
+                    prefix_len = i;
+                    memcpy (dest, name + 2, i - 2 + 1);
+                    dest += i - 2 + 1;
+                  }
+                else
+                  {
+                    /* Either name = '\\server'; this is an invalid file name.
+                       Or name = '\\server\...' and server is more than
+                       rname_buf->length - 4 bytes long.  In either
+                       case, stop the UNC processing.  */
+                  }
+              }
+#endif
+            }
+          *dest = '\0';
+        }
+      start = name + prefix_len;
+    }
+
+  for ( ; *start; start = end)
+    {
+      /* Skip sequence of multiple file name separators.  */
+      while (ISSLASH (*start))
+        ++start;
+
+      /* Find end of component.  */
+      for (end = start; *end && !ISSLASH (*end); ++end)
+        /* Nothing.  */;
+
+      /* Length of this file name component; it can be zero if a file
+         name ends in '/'.  */
+      idx_t startlen = end - start;
+
+      if (startlen == 0)
+        break;
+      else if (startlen == 1 && start[0] == '.')
+        /* nothing */;
+      else if (startlen == 2 && start[0] == '.' && start[1] == '.')
+        {
+          /* Back up to previous component, ignore if at root already.  */
+          if (dest > rname + prefix_len + 1)
+            for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest)
+              continue;
+          if (DOUBLE_SLASH_IS_DISTINCT_ROOT
+              && dest == rname + 1 && !prefix_len
+              && ISSLASH (*dest) && !ISSLASH (dest[1]))
+            dest++;
+        }
+      else
+        {
+          if (!ISSLASH (dest[-1]))
+            *dest++ = '/';
+
+          while (rname + rname_buf->length - dest
+                 < startlen + sizeof dir_suffix)
+            {
+              idx_t dest_offset = dest - rname;
+              if (!scratch_buffer_grow_preserve (rname_buf))
+                xalloc_die ();
+              rname = rname_buf->data;
+              dest = rname + dest_offset;
+            }
+
+          dest = mempcpy (dest, start, startlen);
+          *dest = '\0';
+
+          char *buf;
+          ssize_t n = -1;
+          if (!logical)
+            {
+              while (true)
+                {
+                  buf = link_buffer.data;
+                  idx_t bufsize = link_buffer.length;
+                  n = readlink (rname, buf, bufsize - 1);
+                  if (n < bufsize - 1)
+                    break;
+                  if (!scratch_buffer_grow (&link_buffer))
+                    xalloc_die ();
+                }
+            }
+          if (0 <= n)
+            {
+              /* A physical traversal and RNAME is a symbolic link.  */
+
+              if (num_links < 20)
+                num_links++;
+              else if (*start)
+                {
+                  /* Enough symlinks have been seen that it is time to
+                     worry about being in a symlink cycle.
+                     Get the device and inode of the parent directory, as
+                     pre-2017 POSIX says this info is not reliable for
+                     symlinks.  */
+                  struct stat st;
+                  dest[- startlen] = '\0';
+                  if (stat (*rname ? rname : ".", &st) != 0)
+                    goto error;
+                  dest[- startlen] = *start;
+
+                  /* Detect loops.  We cannot use the cycle-check module here,
+                     since it's possible to encounter the same parent
+                     directory more than once in a given traversal.  However,
+                     encountering the same (parentdir, START) pair twice does
+                     indicate a loop.  */
+                  if (seen_triple (&ht, start, &st))
+                    {
+                      if (can_exist == CAN_MISSING)
+                        continue;
+                      errno = ELOOP;
+                      goto error;
+                    }
+                }
+
+              buf[n] = '\0';
+
+              char *extra_buf = extra_buffer.data;
+              idx_t end_idx IF_LINT (= 0);
+              if (end_in_extra_buffer)
+                end_idx = end - extra_buf;
+              size_t len = strlen (end);
+              if (INT_ADD_OVERFLOW (len, n))
+                xalloc_die ();
+              while (extra_buffer.length <= len + n)
+                {
+                  if (!scratch_buffer_grow_preserve (&extra_buffer))
+                    xalloc_die ();
+                  extra_buf = extra_buffer.data;
+                }
+              if (end_in_extra_buffer)
+                end = extra_buf + end_idx;
+
+              /* Careful here, end may be a pointer into extra_buf... */
+              memmove (&extra_buf[n], end, len + 1);
+              name = end = memcpy (extra_buf, buf, n);
+              end_in_extra_buffer = true;
+
+              if (IS_ABSOLUTE_FILE_NAME (buf))
+                {
+                  idx_t pfxlen = FILE_SYSTEM_PREFIX_LEN (buf);
+
+                  dest = mempcpy (rname, buf, pfxlen);
+                  *dest++ = '/'; /* It's an absolute symlink */
+                  if (DOUBLE_SLASH_IS_DISTINCT_ROOT)
+                    {
+                      if (ISSLASH (buf[1]) && !ISSLASH (buf[2]) && !pfxlen)
+                        *dest++ = '/';
+                      *dest = '\0';
+                    }
+                  /* Install the new prefix to be in effect hereafter.  */
+                  prefix_len = pfxlen;
+                }
+              else
+                {
+                  /* Back up to previous component, ignore if at root
+                     already: */
+                  if (dest > rname + prefix_len + 1)
+                    for (--dest; dest > rname && !ISSLASH (dest[-1]); --dest)
+                      continue;
+                  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1
+                      && ISSLASH (*dest) && !ISSLASH (dest[1]) && !prefix_len)
+                    dest++;
+                }
+            }
+          else if (! (can_exist == CAN_MISSING
+                      || (suffix_requires_dir_check (end)
+                          ? dir_check (rname, dest)
+                          : !logical
+                          ? errno == EINVAL
+                          : *end || file_accessible (rname))
+                      || (can_exist == CAN_ALL_BUT_LAST
+                          && errno == ENOENT
+                          && !end[strspn (end, SLASHES)])))
+            goto error;
+        }
+    }
+  if (dest > rname + prefix_len + 1 && ISSLASH (dest[-1]))
+    --dest;
+  if (DOUBLE_SLASH_IS_DISTINCT_ROOT && dest == rname + 1 && !prefix_len
+      && ISSLASH (*dest) && !ISSLASH (dest[1]))
+    dest++;
+  failed = false;
+
+error:
+  if (ht)
+    hash_free (ht);
+  scratch_buffer_free (&extra_buffer);
+  scratch_buffer_free (&link_buffer);
+
+  if (failed)
+    {
+      scratch_buffer_free (rname_buf);
+      return NULL;
+    }
+
+  *dest++ = '\0';
+  char *result = scratch_buffer_dupfree (rname_buf, dest - rname);
+  if (!result)
+    xalloc_die ();
+  return result;
+}
+
+/* Return the canonical absolute name of file NAME, while treating
+   missing elements according to CAN_MODE.  A canonical name
+   does not contain any ".", ".." components nor any repeated file name
+   separators ('/') or, depending on other CAN_MODE flags, symlinks.
+   Whether components must exist or not depends on canonicalize mode.
+   The result is malloc'd.  */
+
+char *
+canonicalize_filename_mode (const char *name, canonicalize_mode_t can_mode)
+{
+  #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR
+   #warning "GCC might issue a bogus -Wreturn-local-addr warning here."
+   #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>."
+  #endif
+  struct scratch_buffer rname_buffer;
+  return canonicalize_filename_mode_stk (name, can_mode, &rname_buffer);
+}
diff --git a/lib/canonicalize.h b/lib/canonicalize.h
new file mode 100644 (file)
index 0000000..f3054d4
--- /dev/null
@@ -0,0 +1,57 @@
+/* Return the canonical absolute name of a given file.
+   Copyright (C) 1996-2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef CANONICALIZE_H_
+# define CANONICALIZE_H_
+
+#include <stdlib.h> /* for canonicalize_file_name */
+
+#define CAN_MODE_MASK (CAN_EXISTING | CAN_ALL_BUT_LAST | CAN_MISSING)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum canonicalize_mode_t
+  {
+    /* All components must exist.  */
+    CAN_EXISTING = 0,
+
+    /* All components excluding last one must exist.  */
+    CAN_ALL_BUT_LAST = 1,
+
+    /* No requirements on components existence.  */
+    CAN_MISSING = 2,
+
+    /* Don't expand symlinks.  */
+    CAN_NOLINKS = 4
+  };
+typedef enum canonicalize_mode_t canonicalize_mode_t;
+
+/* Return the canonical absolute name of file NAME, while treating
+   missing elements according to CAN_MODE.  A canonical name
+   does not contain any `.', `..' components nor any repeated file name
+   separators ('/') or, depending on other CAN_MODE flags, symlinks.
+   Whether components must exist or not depends on canonicalize mode.
+   The result is malloc'd.
+   Upon failure, return NULL with errno set.  */
+char *canonicalize_filename_mode (const char *, canonicalize_mode_t);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !CANONICALIZE_H_ */
diff --git a/lib/cdefs.h b/lib/cdefs.h
new file mode 100644 (file)
index 0000000..7d91b06
--- /dev/null
@@ -0,0 +1,614 @@
+/* Copyright (C) 1992-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef        _SYS_CDEFS_H
+#define        _SYS_CDEFS_H    1
+
+/* We are almost always included from features.h. */
+#ifndef _FEATURES_H
+# include <features.h>
+#endif
+
+/* The GNU libc does not support any K&R compilers or the traditional mode
+   of ISO C compilers anymore.  Check for some of the combinations not
+   supported anymore.  */
+#if defined __GNUC__ && !defined __STDC__
+# error "You need a ISO C conforming compiler to use the glibc headers"
+#endif
+
+/* Some user header file might have defined this before.  */
+#undef __P
+#undef __PMT
+
+/* Compilers that lack __has_attribute may object to
+       #if defined __has_attribute && __has_attribute (...)
+   even though they do not need to evaluate the right-hand side of the &&.
+   Similarly for __has_builtin, etc.  */
+#if (defined __has_attribute \
+     && (!defined __clang_minor__ \
+         || 3 < __clang_major__ + (5 <= __clang_minor__)))
+# define __glibc_has_attribute(attr) __has_attribute (attr)
+#else
+# define __glibc_has_attribute(attr) 0
+#endif
+#ifdef __has_builtin
+# define __glibc_has_builtin(name) __has_builtin (name)
+#else
+# define __glibc_has_builtin(name) 0
+#endif
+#ifdef __has_extension
+# define __glibc_has_extension(ext) __has_extension (ext)
+#else
+# define __glibc_has_extension(ext) 0
+#endif
+
+#if defined __GNUC__ || defined __clang__
+
+/* All functions, except those with callbacks or those that
+   synchronize memory, are leaf functions.  */
+# if __GNUC_PREREQ (4, 6) && !defined _LIBC
+#  define __LEAF , __leaf__
+#  define __LEAF_ATTR __attribute__ ((__leaf__))
+# else
+#  define __LEAF
+#  define __LEAF_ATTR
+# endif
+
+/* GCC can always grok prototypes.  For C++ programs we add throw()
+   to help it optimize the function calls.  But this only works with
+   gcc 2.8.x and egcs.  For gcc 3.4 and up we even mark C functions
+   as non-throwing using a function attribute since programs can use
+   the -fexceptions options for C code as well.  */
+# if !defined __cplusplus \
+     && (__GNUC_PREREQ (3, 4) || __glibc_has_attribute (__nothrow__))
+#  define __THROW      __attribute__ ((__nothrow__ __LEAF))
+#  define __THROWNL    __attribute__ ((__nothrow__))
+#  define __NTH(fct)   __attribute__ ((__nothrow__ __LEAF)) fct
+#  define __NTHNL(fct)  __attribute__ ((__nothrow__)) fct
+# else
+#  if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major >= 4)
+#   if __cplusplus >= 201103L
+#    define __THROW    noexcept (true)
+#   else
+#    define __THROW    throw ()
+#   endif
+#   define __THROWNL   __THROW
+#   define __NTH(fct)  __LEAF_ATTR fct __THROW
+#   define __NTHNL(fct) fct __THROW
+#  else
+#   define __THROW
+#   define __THROWNL
+#   define __NTH(fct)  fct
+#   define __NTHNL(fct) fct
+#  endif
+# endif
+
+#else  /* Not GCC or clang.  */
+
+# if (defined __cplusplus                                              \
+      || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
+#  define __inline     inline
+# else
+#  define __inline             /* No inline functions.  */
+# endif
+
+# define __THROW
+# define __THROWNL
+# define __NTH(fct)    fct
+
+#endif /* GCC || clang.  */
+
+/* These two macros are not used in glibc anymore.  They are kept here
+   only because some other projects expect the macros to be defined.  */
+#define __P(args)      args
+#define __PMT(args)    args
+
+/* For these things, GCC behaves the ANSI way normally,
+   and the non-ANSI way under -traditional.  */
+
+#define __CONCAT(x,y)  x ## y
+#define __STRING(x)    #x
+
+/* This is not a typedef so `const __ptr_t' does the right thing.  */
+#define __ptr_t void *
+
+
+/* C++ needs to know that types and declarations are C, not C++.  */
+#ifdef __cplusplus
+# define __BEGIN_DECLS extern "C" {
+# define __END_DECLS   }
+#else
+# define __BEGIN_DECLS
+# define __END_DECLS
+#endif
+
+
+/* Fortify support.  */
+#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
+#define __bos0(ptr) __builtin_object_size (ptr, 0)
+
+/* Use __builtin_dynamic_object_size at _FORTIFY_SOURCE=3 when available.  */
+#if __USE_FORTIFY_LEVEL == 3 && __glibc_clang_prereq (9, 0)
+# define __glibc_objsize0(__o) __builtin_dynamic_object_size (__o, 0)
+# define __glibc_objsize(__o) __builtin_dynamic_object_size (__o, 1)
+#else
+# define __glibc_objsize0(__o) __bos0 (__o)
+# define __glibc_objsize(__o) __bos (__o)
+#endif
+
+#if __GNUC_PREREQ (4,3)
+# define __warnattr(msg) __attribute__((__warning__ (msg)))
+# define __errordecl(name, msg) \
+  extern void name (void) __attribute__((__error__ (msg)))
+#else
+# define __warnattr(msg)
+# define __errordecl(name, msg) extern void name (void)
+#endif
+
+/* Support for flexible arrays.
+   Headers that should use flexible arrays only if they're "real"
+   (e.g. only if they won't affect sizeof()) should test
+   #if __glibc_c99_flexarr_available.  */
+#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
+# define __flexarr     []
+# define __glibc_c99_flexarr_available 1
+#elif __GNUC_PREREQ (2,97) || defined __clang__
+/* GCC 2.97 and clang support C99 flexible array members as an extension,
+   even when in C89 mode or compiling C++ (any version).  */
+# define __flexarr     []
+# define __glibc_c99_flexarr_available 1
+#elif defined __GNUC__
+/* Pre-2.97 GCC did not support C99 flexible arrays but did have
+   an equivalent extension with slightly different notation.  */
+# define __flexarr     [0]
+# define __glibc_c99_flexarr_available 1
+#else
+/* Some other non-C99 compiler.  Approximate with [1].  */
+# define __flexarr     [1]
+# define __glibc_c99_flexarr_available 0
+#endif
+
+
+/* __asm__ ("xyz") is used throughout the headers to rename functions
+   at the assembly language level.  This is wrapped by the __REDIRECT
+   macro, in order to support compilers that can do this some other
+   way.  When compilers don't support asm-names at all, we have to do
+   preprocessor tricks instead (which don't have exactly the right
+   semantics, but it's the best we can do).
+
+   Example:
+   int __REDIRECT(setpgrp, (__pid_t pid, __pid_t pgrp), setpgid); */
+
+#if (defined __GNUC__ && __GNUC__ >= 2) || (__clang_major__ >= 4)
+
+# define __REDIRECT(name, proto, alias) name proto __asm__ (__ASMNAME (#alias))
+# ifdef __cplusplus
+#  define __REDIRECT_NTH(name, proto, alias) \
+     name proto __THROW __asm__ (__ASMNAME (#alias))
+#  define __REDIRECT_NTHNL(name, proto, alias) \
+     name proto __THROWNL __asm__ (__ASMNAME (#alias))
+# else
+#  define __REDIRECT_NTH(name, proto, alias) \
+     name proto __asm__ (__ASMNAME (#alias)) __THROW
+#  define __REDIRECT_NTHNL(name, proto, alias) \
+     name proto __asm__ (__ASMNAME (#alias)) __THROWNL
+# endif
+# define __ASMNAME(cname)  __ASMNAME2 (__USER_LABEL_PREFIX__, cname)
+# define __ASMNAME2(prefix, cname) __STRING (prefix) cname
+
+/*
+#elif __SOME_OTHER_COMPILER__
+
+# define __REDIRECT(name, proto, alias) name proto; \
+       _Pragma("let " #name " = " #alias)
+*/
+#endif
+
+/* GCC and clang have various useful declarations that can be made with
+   the '__attribute__' syntax.  All of the ways we use this do fine if
+   they are omitted for compilers that don't understand it.  */
+#if !(defined __GNUC__ || defined __clang__)
+# define __attribute__(xyz)    /* Ignore */
+#endif
+
+/* At some point during the gcc 2.96 development the `malloc' attribute
+   for functions was introduced.  We don't want to use it unconditionally
+   (although this would be possible) since it generates warnings.  */
+#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__malloc__)
+# define __attribute_malloc__ __attribute__ ((__malloc__))
+#else
+# define __attribute_malloc__ /* Ignore */
+#endif
+
+/* Tell the compiler which arguments to an allocation function
+   indicate the size of the allocation.  */
+#if __GNUC_PREREQ (4, 3)
+# define __attribute_alloc_size__(params) \
+  __attribute__ ((__alloc_size__ params))
+#else
+# define __attribute_alloc_size__(params) /* Ignore.  */
+#endif
+
+/* At some point during the gcc 2.96 development the `pure' attribute
+   for functions was introduced.  We don't want to use it unconditionally
+   (although this would be possible) since it generates warnings.  */
+#if __GNUC_PREREQ (2,96) || __glibc_has_attribute (__pure__)
+# define __attribute_pure__ __attribute__ ((__pure__))
+#else
+# define __attribute_pure__ /* Ignore */
+#endif
+
+/* This declaration tells the compiler that the value is constant.  */
+#if __GNUC_PREREQ (2,5) || __glibc_has_attribute (__const__)
+# define __attribute_const__ __attribute__ ((__const__))
+#else
+# define __attribute_const__ /* Ignore */
+#endif
+
+#if __GNUC_PREREQ (2,7) || __glibc_has_attribute (__unused__)
+# define __attribute_maybe_unused__ __attribute__ ((__unused__))
+/* Once the next version of the C standard comes out, we can
+   do something like the following here:
+   #elif defined __STDC_VERSION__ && 202???L <= __STDC_VERSION__
+   # define __attribute_maybe_unused__ [[__maybe_unused__]]   */
+#else
+# define __attribute_maybe_unused__ /* Ignore */
+#endif
+
+/* At some point during the gcc 3.1 development the `used' attribute
+   for functions was introduced.  We don't want to use it unconditionally
+   (although this would be possible) since it generates warnings.  */
+#if __GNUC_PREREQ (3,1) || __glibc_has_attribute (__used__)
+# define __attribute_used__ __attribute__ ((__used__))
+# define __attribute_noinline__ __attribute__ ((__noinline__))
+#else
+# define __attribute_used__ __attribute__ ((__unused__))
+# define __attribute_noinline__ /* Ignore */
+#endif
+
+/* Since version 3.2, gcc allows marking deprecated functions.  */
+#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__deprecated__)
+# define __attribute_deprecated__ __attribute__ ((__deprecated__))
+#else
+# define __attribute_deprecated__ /* Ignore */
+#endif
+
+/* Since version 4.5, gcc also allows one to specify the message printed
+   when a deprecated function is used.  clang claims to be gcc 4.2, but
+   may also support this feature.  */
+#if __GNUC_PREREQ (4,5) \
+    || __glibc_has_extension (__attribute_deprecated_with_message__)
+# define __attribute_deprecated_msg__(msg) \
+        __attribute__ ((__deprecated__ (msg)))
+#else
+# define __attribute_deprecated_msg__(msg) __attribute_deprecated__
+#endif
+
+/* At some point during the gcc 2.8 development the `format_arg' attribute
+   for functions was introduced.  We don't want to use it unconditionally
+   (although this would be possible) since it generates warnings.
+   If several `format_arg' attributes are given for the same function, in
+   gcc-3.0 and older, all but the last one are ignored.  In newer gccs,
+   all designated arguments are considered.  */
+#if __GNUC_PREREQ (2,8) || __glibc_has_attribute (__format_arg__)
+# define __attribute_format_arg__(x) __attribute__ ((__format_arg__ (x)))
+#else
+# define __attribute_format_arg__(x) /* Ignore */
+#endif
+
+/* At some point during the gcc 2.97 development the `strfmon' format
+   attribute for functions was introduced.  We don't want to use it
+   unconditionally (although this would be possible) since it
+   generates warnings.  */
+#if __GNUC_PREREQ (2,97) || __glibc_has_attribute (__format__)
+# define __attribute_format_strfmon__(a,b) \
+  __attribute__ ((__format__ (__strfmon__, a, b)))
+#else
+# define __attribute_format_strfmon__(a,b) /* Ignore */
+#endif
+
+/* The nonnull function attribute marks pointer parameters that
+   must not be NULL.  This has the name __nonnull in glibc,
+   and __attribute_nonnull__ in files shared with Gnulib to avoid
+   collision with a different __nonnull in DragonFlyBSD 5.9.  */
+#ifndef __attribute_nonnull__
+# if __GNUC_PREREQ (3,3) || __glibc_has_attribute (__nonnull__)
+#  define __attribute_nonnull__(params) __attribute__ ((__nonnull__ params))
+# else
+#  define __attribute_nonnull__(params)
+# endif
+#endif
+#ifndef __nonnull
+# define __nonnull(params) __attribute_nonnull__ (params)
+#endif
+
+/* If fortification mode, we warn about unused results of certain
+   function calls which can lead to problems.  */
+#if __GNUC_PREREQ (3,4) || __glibc_has_attribute (__warn_unused_result__)
+# define __attribute_warn_unused_result__ \
+   __attribute__ ((__warn_unused_result__))
+# if defined __USE_FORTIFY_LEVEL && __USE_FORTIFY_LEVEL > 0
+#  define __wur __attribute_warn_unused_result__
+# endif
+#else
+# define __attribute_warn_unused_result__ /* empty */
+#endif
+#ifndef __wur
+# define __wur /* Ignore */
+#endif
+
+/* Forces a function to be always inlined.  */
+#if __GNUC_PREREQ (3,2) || __glibc_has_attribute (__always_inline__)
+/* The Linux kernel defines __always_inline in stddef.h (283d7573), and
+   it conflicts with this definition.  Therefore undefine it first to
+   allow either header to be included first.  */
+# undef __always_inline
+# define __always_inline __inline __attribute__ ((__always_inline__))
+#else
+# undef __always_inline
+# define __always_inline __inline
+#endif
+
+/* Associate error messages with the source location of the call site rather
+   than with the source location inside the function.  */
+#if __GNUC_PREREQ (4,3) || __glibc_has_attribute (__artificial__)
+# define __attribute_artificial__ __attribute__ ((__artificial__))
+#else
+# define __attribute_artificial__ /* Ignore */
+#endif
+
+/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+   inline semantics, unless -fgnu89-inline is used.  Using __GNUC_STDC_INLINE__
+   or __GNUC_GNU_INLINE is not a good enough check for gcc because gcc versions
+   older than 4.3 may define these macros and still not guarantee GNU inlining
+   semantics.
+
+   clang++ identifies itself as gcc-4.2, but has support for GNU inlining
+   semantics, that can be checked for by using the __GNUC_STDC_INLINE_ and
+   __GNUC_GNU_INLINE__ macro definitions.  */
+#if (!defined __cplusplus || __GNUC_PREREQ (4,3) \
+     || (defined __clang__ && (defined __GNUC_STDC_INLINE__ \
+                              || defined __GNUC_GNU_INLINE__)))
+# if defined __GNUC_STDC_INLINE__ || defined __cplusplus
+#  define __extern_inline extern __inline __attribute__ ((__gnu_inline__))
+#  define __extern_always_inline \
+  extern __always_inline __attribute__ ((__gnu_inline__))
+# else
+#  define __extern_inline extern __inline
+#  define __extern_always_inline extern __always_inline
+# endif
+#endif
+
+#ifdef __extern_always_inline
+# define __fortify_function __extern_always_inline __attribute_artificial__
+#endif
+
+/* GCC 4.3 and above allow passing all anonymous arguments of an
+   __extern_always_inline function to some other vararg function.  */
+#if __GNUC_PREREQ (4,3)
+# define __va_arg_pack() __builtin_va_arg_pack ()
+# define __va_arg_pack_len() __builtin_va_arg_pack_len ()
+#endif
+
+/* It is possible to compile containing GCC extensions even if GCC is
+   run in pedantic mode if the uses are carefully marked using the
+   `__extension__' keyword.  But this is not generally available before
+   version 2.8.  */
+#if !(__GNUC_PREREQ (2,8) || defined __clang__)
+# define __extension__         /* Ignore */
+#endif
+
+/* __restrict is known in EGCS 1.2 and above, and in clang.
+   It works also in C++ mode (outside of arrays), but only when spelled
+   as '__restrict', not 'restrict'.  */
+#if !(__GNUC_PREREQ (2,92) || __clang_major__ >= 3)
+# if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#  define __restrict   restrict
+# else
+#  define __restrict   /* Ignore */
+# endif
+#endif
+
+/* ISO C99 also allows to declare arrays as non-overlapping.  The syntax is
+     array_name[restrict]
+   GCC 3.1 and clang support this.
+   This syntax is not usable in C++ mode.  */
+#if (__GNUC_PREREQ (3,1) || __clang_major__ >= 3) && !defined __cplusplus
+# define __restrict_arr        __restrict
+#else
+# ifdef __GNUC__
+#  define __restrict_arr       /* Not supported in old GCC.  */
+# else
+#  if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
+#   define __restrict_arr      restrict
+#  else
+/* Some other non-C99 compiler.  */
+#   define __restrict_arr      /* Not supported.  */
+#  endif
+# endif
+#endif
+
+#if (__GNUC__ >= 3) || __glibc_has_builtin (__builtin_expect)
+# define __glibc_unlikely(cond)        __builtin_expect ((cond), 0)
+# define __glibc_likely(cond)  __builtin_expect ((cond), 1)
+#else
+# define __glibc_unlikely(cond)        (cond)
+# define __glibc_likely(cond)  (cond)
+#endif
+
+#if (!defined _Noreturn \
+     && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+     &&  !(__GNUC_PREREQ (4,7) \
+           || (3 < __clang_major__ + (5 <= __clang_minor__))))
+# if __GNUC_PREREQ (2,8)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# else
+#  define _Noreturn
+# endif
+#endif
+
+#if __GNUC_PREREQ (8, 0)
+/* Describes a char array whose address can safely be passed as the first
+   argument to strncpy and strncat, as the char array is not necessarily
+   a NUL-terminated string.  */
+# define __attribute_nonstring__ __attribute__ ((__nonstring__))
+#else
+# define __attribute_nonstring__
+#endif
+
+/* Undefine (also defined in libc-symbols.h).  */
+#undef __attribute_copy__
+#if __GNUC_PREREQ (9, 0)
+/* Copies attributes from the declaration or type referenced by
+   the argument.  */
+# define __attribute_copy__(arg) __attribute__ ((__copy__ (arg)))
+#else
+# define __attribute_copy__(arg)
+#endif
+
+#if (!defined _Static_assert && !defined __cplusplus \
+     && (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) < 201112 \
+     && (!(__GNUC_PREREQ (4, 6) || __clang_major__ >= 4) \
+         || defined __STRICT_ANSI__))
+# define _Static_assert(expr, diagnostic) \
+    extern int (*__Static_assert_function (void)) \
+      [!!sizeof (struct { int __error_if_negative: (expr) ? 2 : -1; })]
+#endif
+
+/* Gnulib avoids including these, as they don't work on non-glibc or
+   older glibc platforms.  */
+#ifndef __GNULIB_CDEFS
+# include <bits/wordsize.h>
+# include <bits/long-double.h>
+#endif
+
+#if __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 1
+# ifdef __REDIRECT
+
+/* Alias name defined automatically.  */
+#  define __LDBL_REDIR(name, proto) ... unused__ldbl_redir
+#  define __LDBL_REDIR_DECL(name) \
+  extern __typeof (name) name __asm (__ASMNAME ("__" #name "ieee128"));
+
+/* Alias name defined automatically, with leading underscores.  */
+#  define __LDBL_REDIR2_DECL(name) \
+  extern __typeof (__##name) __##name \
+    __asm (__ASMNAME ("__" #name "ieee128"));
+
+/* Alias name defined manually.  */
+#  define __LDBL_REDIR1(name, proto, alias) ... unused__ldbl_redir1
+#  define __LDBL_REDIR1_DECL(name, alias) \
+  extern __typeof (name) name __asm (__ASMNAME (#alias));
+
+#  define __LDBL_REDIR1_NTH(name, proto, alias) \
+  __REDIRECT_NTH (name, proto, alias)
+#  define __REDIRECT_NTH_LDBL(name, proto, alias) \
+  __LDBL_REDIR1_NTH (name, proto, __##alias##ieee128)
+
+/* Unused.  */
+#  define __REDIRECT_LDBL(name, proto, alias) ... unused__redirect_ldbl
+#  define __LDBL_REDIR_NTH(name, proto) ... unused__ldbl_redir_nth
+
+# else
+_Static_assert (0, "IEEE 128-bits long double requires redirection on this platform");
+# endif
+#elif defined __LONG_DOUBLE_MATH_OPTIONAL && defined __NO_LONG_DOUBLE_MATH
+# define __LDBL_COMPAT 1
+# ifdef __REDIRECT
+#  define __LDBL_REDIR1(name, proto, alias) __REDIRECT (name, proto, alias)
+#  define __LDBL_REDIR(name, proto) \
+  __LDBL_REDIR1 (name, proto, __nldbl_##name)
+#  define __LDBL_REDIR1_NTH(name, proto, alias) __REDIRECT_NTH (name, proto, alias)
+#  define __LDBL_REDIR_NTH(name, proto) \
+  __LDBL_REDIR1_NTH (name, proto, __nldbl_##name)
+#  define __LDBL_REDIR2_DECL(name) \
+  extern __typeof (__##name) __##name __asm (__ASMNAME ("__nldbl___" #name));
+#  define __LDBL_REDIR1_DECL(name, alias) \
+  extern __typeof (name) name __asm (__ASMNAME (#alias));
+#  define __LDBL_REDIR_DECL(name) \
+  extern __typeof (name) name __asm (__ASMNAME ("__nldbl_" #name));
+#  define __REDIRECT_LDBL(name, proto, alias) \
+  __LDBL_REDIR1 (name, proto, __nldbl_##alias)
+#  define __REDIRECT_NTH_LDBL(name, proto, alias) \
+  __LDBL_REDIR1_NTH (name, proto, __nldbl_##alias)
+# endif
+#endif
+#if (!defined __LDBL_COMPAT && __LDOUBLE_REDIRECTS_TO_FLOAT128_ABI == 0) \
+    || !defined __REDIRECT
+# define __LDBL_REDIR1(name, proto, alias) name proto
+# define __LDBL_REDIR(name, proto) name proto
+# define __LDBL_REDIR1_NTH(name, proto, alias) name proto __THROW
+# define __LDBL_REDIR_NTH(name, proto) name proto __THROW
+# define __LDBL_REDIR2_DECL(name)
+# define __LDBL_REDIR_DECL(name)
+# ifdef __REDIRECT
+#  define __REDIRECT_LDBL(name, proto, alias) __REDIRECT (name, proto, alias)
+#  define __REDIRECT_NTH_LDBL(name, proto, alias) \
+  __REDIRECT_NTH (name, proto, alias)
+# endif
+#endif
+
+/* __glibc_macro_warning (MESSAGE) issues warning MESSAGE.  This is
+   intended for use in preprocessor macros.
+
+   Note: MESSAGE must be a _single_ string; concatenation of string
+   literals is not supported.  */
+#if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
+# define __glibc_macro_warning1(message) _Pragma (#message)
+# define __glibc_macro_warning(message) \
+  __glibc_macro_warning1 (GCC warning message)
+#else
+# define __glibc_macro_warning(msg)
+#endif
+
+/* Generic selection (ISO C11) is a C-only feature, available in GCC
+   since version 4.9.  Previous versions do not provide generic
+   selection, even though they might set __STDC_VERSION__ to 201112L,
+   when in -std=c11 mode.  Thus, we must check for !defined __GNUC__
+   when testing __STDC_VERSION__ for generic selection support.
+   On the other hand, Clang also defines __GNUC__, so a clang-specific
+   check is required to enable the use of generic selection.  */
+#if !defined __cplusplus \
+    && (__GNUC_PREREQ (4, 9) \
+       || __glibc_has_extension (c_generic_selections) \
+       || (!defined __GNUC__ && defined __STDC_VERSION__ \
+           && __STDC_VERSION__ >= 201112L))
+# define __HAVE_GENERIC_SELECTION 1
+#else
+# define __HAVE_GENERIC_SELECTION 0
+#endif
+
+#if __GNUC_PREREQ (10, 0)
+/* Designates a 1-based positional argument ref-index of pointer type
+   that can be used to access size-index elements of the pointed-to
+   array according to access mode, or at least one element when
+   size-index is not provided:
+     access (access-mode, <ref-index> [, <size-index>])  */
+#define __attr_access(x) __attribute__ ((__access__ x))
+#else
+#  define __attr_access(x)
+#endif
+
+/* Specify that a function such as setjmp or vfork may return
+   twice.  */
+#if __GNUC_PREREQ (4, 1)
+# define __attribute_returns_twice__ __attribute__ ((__returns_twice__))
+#else
+# define __attribute_returns_twice__ /* Ignore.  */
+#endif
+
+#endif  /* sys/cdefs.h */
diff --git a/lib/chdir-long.c b/lib/chdir-long.c
new file mode 100644 (file)
index 0000000..0d693b0
--- /dev/null
@@ -0,0 +1,264 @@
+/* provide a chdir function that tries not to fail due to ENAMETOOLONG
+   Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering */
+
+#include <config.h>
+
+#include "chdir-long.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "assure.h"
+
+#ifndef PATH_MAX
+# error "compile this file only if your system defines PATH_MAX"
+#endif
+
+/* The results of openat() in this file are not leaked to any
+   single-threaded code that could use stdio.
+   FIXME - if the kernel ever adds support for multi-thread safety for
+   avoiding standard fds, then we should use openat_safer.  */
+
+struct cd_buf
+{
+  int fd;
+};
+
+static void
+cdb_init (struct cd_buf *cdb)
+{
+  cdb->fd = AT_FDCWD;
+}
+
+static int
+cdb_fchdir (struct cd_buf const *cdb)
+{
+  return fchdir (cdb->fd);
+}
+
+static void
+cdb_free (struct cd_buf const *cdb)
+{
+  if (0 <= cdb->fd)
+    {
+      bool close_fail = close (cdb->fd);
+      assure (! close_fail);
+    }
+}
+
+/* Given a file descriptor of an open directory (or AT_FDCWD), CDB->fd,
+   try to open the CDB->fd-relative directory, DIR.  If the open succeeds,
+   update CDB->fd with the resulting descriptor, close the incoming file
+   descriptor, and return zero.  Upon failure, return -1 and set errno.  */
+static int
+cdb_advance_fd (struct cd_buf *cdb, char const *dir)
+{
+  int new_fd = openat (cdb->fd, dir,
+                       O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
+  if (new_fd < 0)
+    return -1;
+
+  cdb_free (cdb);
+  cdb->fd = new_fd;
+
+  return 0;
+}
+
+/* Return a pointer to the first non-slash in S.  */
+static char * _GL_ATTRIBUTE_PURE
+find_non_slash (char const *s)
+{
+  size_t n_slash = strspn (s, "/");
+  return (char *) s + n_slash;
+}
+
+/* This is a function much like chdir, but without the PATH_MAX limitation
+   on the length of the directory name.  A significant difference is that
+   it must be able to modify (albeit only temporarily) the directory
+   name.  It handles an arbitrarily long directory name by operating
+   on manageable portions of the name.  On systems without the openat
+   syscall, this means changing the working directory to more and more
+   "distant" points along the long directory name and then restoring
+   the working directory.  If any of those attempts to save or restore
+   the working directory fails, this function exits nonzero.
+
+   Note that this function may still fail with errno == ENAMETOOLONG, but
+   only if the specified directory name contains a component that is long
+   enough to provoke such a failure all by itself (e.g. if the component
+   has length PATH_MAX or greater on systems that define PATH_MAX).  */
+
+int
+chdir_long (char *dir)
+{
+  int e = chdir (dir);
+  if (e == 0 || errno != ENAMETOOLONG)
+    return e;
+
+  {
+    size_t len = strlen (dir);
+    char *dir_end = dir + len;
+    struct cd_buf cdb;
+    size_t n_leading_slash;
+
+    cdb_init (&cdb);
+
+    /* If DIR is the empty string, then the chdir above
+       must have failed and set errno to ENOENT.  */
+    assure (0 < len);
+    assure (PATH_MAX <= len);
+
+    /* Count leading slashes.  */
+    n_leading_slash = strspn (dir, "/");
+
+    /* Handle any leading slashes as well as any name that matches
+       the regular expression, m!^//hostname[/]*! .  Handling this
+       prefix separately usually results in a single additional
+       cdb_advance_fd call, but it's worthwhile, since it makes the
+       code in the following loop cleaner.  */
+    if (n_leading_slash == 2)
+      {
+        int err;
+        /* Find next slash.
+           We already know that dir[2] is neither a slash nor '\0'.  */
+        char *slash = memchr (dir + 3, '/', dir_end - (dir + 3));
+        if (slash == NULL)
+          {
+            errno = ENAMETOOLONG;
+            return -1;
+          }
+        *slash = '\0';
+        err = cdb_advance_fd (&cdb, dir);
+        *slash = '/';
+        if (err != 0)
+          goto Fail;
+        dir = find_non_slash (slash + 1);
+      }
+    else if (n_leading_slash)
+      {
+        if (cdb_advance_fd (&cdb, "/") != 0)
+          goto Fail;
+        dir += n_leading_slash;
+      }
+
+    assure (*dir != '/');
+    assure (dir <= dir_end);
+
+    while (PATH_MAX <= dir_end - dir)
+      {
+        int err;
+        /* Find a slash that is PATH_MAX or fewer bytes away from dir.
+           I.e. see if there is a slash that will give us a name of
+           length PATH_MAX-1 or less.  */
+        char *slash = memrchr (dir, '/', PATH_MAX);
+        if (slash == NULL)
+          {
+            errno = ENAMETOOLONG;
+            return -1;
+          }
+
+        *slash = '\0';
+        assure (slash - dir < PATH_MAX);
+        err = cdb_advance_fd (&cdb, dir);
+        *slash = '/';
+        if (err != 0)
+          goto Fail;
+
+        dir = find_non_slash (slash + 1);
+      }
+
+    if (dir < dir_end)
+      {
+        if (cdb_advance_fd (&cdb, dir) != 0)
+          goto Fail;
+      }
+
+    if (cdb_fchdir (&cdb) != 0)
+      goto Fail;
+
+    cdb_free (&cdb);
+    return 0;
+
+   Fail:
+    {
+      int saved_errno = errno;
+      cdb_free (&cdb);
+      errno = saved_errno;
+      return -1;
+    }
+  }
+}
+
+#if TEST_CHDIR
+
+# include "closeout.h"
+# include "error.h"
+
+int
+main (int argc, char *argv[])
+{
+  char *line = NULL;
+  size_t n = 0;
+  int len;
+
+  atexit (close_stdout);
+
+  len = getline (&line, &n, stdin);
+  if (len < 0)
+    {
+      int saved_errno = errno;
+      if (feof (stdin))
+        exit (0);
+
+      error (EXIT_FAILURE, saved_errno,
+             "reading standard input");
+    }
+  else if (len == 0)
+    exit (0);
+
+  if (line[len-1] == '\n')
+    line[len-1] = '\0';
+
+  if (chdir_long (line) != 0)
+    error (EXIT_FAILURE, errno,
+           "chdir_long failed: %s", line);
+
+  if (argc <= 1)
+    {
+      /* Using 'pwd' here makes sense only if it is a robust implementation,
+         like the one in coreutils after the 2004-04-19 changes.  */
+      char const *cmd = "pwd";
+      execlp (cmd, (char *) NULL);
+      error (EXIT_FAILURE, errno, "%s", cmd);
+    }
+
+  fclose (stdin);
+  fclose (stderr);
+
+  exit (EXIT_SUCCESS);
+}
+#endif
+
+/*
+Local Variables:
+compile-command: "gcc -DTEST_CHDIR=1 -g -O -W -Wall chdir-long.c libcoreutils.a"
+End:
+*/
diff --git a/lib/chdir-long.h b/lib/chdir-long.h
new file mode 100644 (file)
index 0000000..17d9aa5
--- /dev/null
@@ -0,0 +1,30 @@
+/* provide a chdir function that tries not to fail due to ENAMETOOLONG
+   Copyright (C) 2004-2005, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering.  */
+
+#include <unistd.h>
+#include <limits.h>
+
+#include "pathmax.h"
+
+/* On systems without PATH_MAX, presume that chdir accepts
+   arbitrarily long directory names.  */
+#ifndef PATH_MAX
+# define chdir_long(Dir) chdir (Dir)
+#else
+int chdir_long (char *dir);
+#endif
diff --git a/lib/clean-temp-private.h b/lib/clean-temp-private.h
new file mode 100644 (file)
index 0000000..46dba23
--- /dev/null
@@ -0,0 +1,82 @@
+/* Private interface between modules 'clean-temp-simple' and 'clean-temp'.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _CLEAN_TEMP_PRIVATE_H
+#define _CLEAN_TEMP_PRIVATE_H
+
+#include <stdbool.h>
+#include <stddef.h>
+#include "gl_list.h"
+#include "asyncsafe-spin.h"
+
+/* The use of 'volatile' in the types below (and ISO C 99 section 5.1.2.3.(5))
+   ensure that while constructing or modifying the data structures, the field
+   values are written to memory in the order of the C statements.  So the
+   signal handler can rely on these field values to be up to date.  */
+
+/* Registry for a single temporary directory.
+   'struct temp_dir' from the public header file overlaps with this.  */
+struct tempdir
+{
+  /* The absolute pathname of the directory.  */
+  char * volatile dirname;
+  /* Whether errors during explicit cleanup are reported to standard error.  */
+  bool cleanup_verbose;
+  /* Absolute pathnames of subdirectories.  */
+  gl_list_t /* <char *> */ volatile subdirs;
+  /* Absolute pathnames of files.  */
+  gl_list_t /* <char *> */ volatile files;
+};
+
+/* List of all temporary directories.  */
+struct all_tempdirs
+{
+  struct tempdir * volatile * volatile tempdir_list;
+  size_t volatile tempdir_count;
+  size_t tempdir_allocated;
+};
+#define dir_cleanup_list clean_temp_dir_cleanup_list
+extern struct all_tempdirs dir_cleanup_list;
+
+/* A file descriptor to be closed.
+   In multithreaded programs, it is forbidden to close the same fd twice,
+   because you never know what unrelated open() calls are being executed in
+   other threads. So, the 'close (fd)' must be guarded by a once-only guard.  */
+struct closeable_fd
+{
+  /* The file descriptor to close.  */
+  int volatile fd;
+  /* Set to true when it has been closed.  */
+  bool volatile closed;
+  /* Lock that protects the fd from being closed twice.  */
+  asyncsafe_spinlock_t lock;
+  /* Tells whether this list element has been done and can be freed.  */
+  bool volatile done;
+};
+#define descriptors clean_temp_descriptors
+extern gl_list_t /* <closeable_fd *> */ volatile descriptors;
+
+extern bool clean_temp_string_equals (const void *x1, const void *x2);
+extern size_t clean_temp_string_hash (const void *x);
+
+extern _GL_ASYNC_SAFE int clean_temp_asyncsafe_close (struct closeable_fd *element);
+extern void clean_temp_init_asyncsafe_close (void);
+
+extern int clean_temp_init (void);
+
+extern int clean_temp_unlink (const char *absolute_file_name, bool cleanup_verbose);
+
+#endif /* _CLEAN_TEMP_PRIVATE_H */
diff --git a/lib/clean-temp-simple.c b/lib/clean-temp-simple.c
new file mode 100644 (file)
index 0000000..42b2c0d
--- /dev/null
@@ -0,0 +1,401 @@
+/* Temporary files with automatic cleanup.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "clean-temp-simple.h"
+#include "clean-temp-private.h"
+
+#include <errno.h>
+#include <limits.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "error.h"
+#include "fatal-signal.h"
+#include "asyncsafe-spin.h"
+#include "glthread/lock.h"
+#include "thread-optim.h"
+#include "gl_list.h"
+#include "gl_linkedhash_list.h"
+#include "gettext.h"
+
+#define _(str) gettext (str)
+
+
+/* Lock that protects the file_cleanup_list from concurrent modification in
+   different threads.  */
+gl_lock_define_initialized (static, file_cleanup_list_lock)
+
+/* List of all temporary files without temporary directories.  */
+static gl_list_t /* <char *> */ volatile file_cleanup_list;
+
+
+/* List of all temporary directories.  */
+struct all_tempdirs dir_cleanup_list /* = { NULL, 0, 0 } */;
+
+
+/* List of all open file descriptors to temporary files.  */
+gl_list_t /* <closeable_fd *> */ volatile descriptors;
+
+
+/* For the subdirs and for the files, we use a gl_list_t of type LINKEDHASH.
+   Why?  We need a data structure that
+
+     1) Can contain an arbitrary number of 'char *' values.  The strings
+        are compared via strcmp, not pointer comparison.
+     2) Has insertion and deletion operations that are fast: ideally O(1),
+        or possibly O(log n).  This is important for GNU sort, which may
+        create a large number of temporary files.
+     3) Allows iteration through all elements from within a signal handler.
+     4) May or may not allow duplicates.  It doesn't matter here, since
+        any file or subdir can only be removed once.
+
+   Criterion 1) would allow any gl_list_t or gl_oset_t implementation.
+
+   Criterion 2) leaves only GL_LINKEDHASH_LIST, GL_TREEHASH_LIST, or
+   GL_TREE_OSET.
+
+   Criterion 3) puts at disadvantage GL_TREEHASH_LIST and GL_TREE_OSET.
+   Namely, iteration through the elements of a binary tree requires access
+   to many ->left, ->right, ->parent pointers. However, the rebalancing
+   code for insertion and deletion in an AVL or red-black tree is so
+   complicated that we cannot assume that >left, ->right, ->parent pointers
+   are in a consistent state throughout these operations.  Therefore, to
+   avoid a crash in the signal handler, all destructive operations to the
+   lists would have to be protected by a
+       block_fatal_signals ();
+       ...
+       unblock_fatal_signals ();
+   pair.  Which causes extra system calls.
+
+   Criterion 3) would also discourage GL_ARRAY_LIST and GL_CARRAY_LIST,
+   if they were not already excluded.  Namely, these implementations use
+   xrealloc(), leaving a time window in which in the list->elements pointer
+   points to already deallocated memory.  To avoid a crash in the signal
+   handler at such a moment, all destructive operations would have to
+   protected by block/unblock_fatal_signals (), in this case too.
+
+   A list of type GL_LINKEDHASH_LIST without duplicates fulfills all
+   requirements:
+     2) Insertion and deletion are O(1) on average.
+     3) The gl_list_iterator, gl_list_iterator_next implementations do
+        not trigger memory allocations, nor other system calls, and are
+        therefore safe to be called from a signal handler.
+        Furthermore, since SIGNAL_SAFE_LIST is defined, the implementation
+        of the destructive functions ensures that the list structure is
+        safe to be traversed at any moment, even when interrupted by an
+        asynchronous signal.
+ */
+
+/* String equality and hash code functions used by the lists.  */
+
+bool
+clean_temp_string_equals (const void *x1, const void *x2)
+{
+  const char *s1 = (const char *) x1;
+  const char *s2 = (const char *) x2;
+  return strcmp (s1, s2) == 0;
+}
+
+#define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
+
+/* A hash function for NUL-terminated char* strings using
+   the method described by Bruno Haible.
+   See https://www.haible.de/bruno/hashfunc.html.  */
+size_t
+clean_temp_string_hash (const void *x)
+{
+  const char *s = (const char *) x;
+  size_t h = 0;
+
+  for (; *s; s++)
+    h = *s + ((h << 9) | (h >> (SIZE_BITS - 9)));
+
+  return h;
+}
+
+
+/* The set of fatal signal handlers.
+   Cached here because we are not allowed to call get_fatal_signal_set ()
+   from a signal handler.  */
+static const sigset_t *fatal_signal_set /* = NULL */;
+
+static void
+init_fatal_signal_set (void)
+{
+  if (fatal_signal_set == NULL)
+    fatal_signal_set = get_fatal_signal_set ();
+}
+
+
+/* Close a file descriptor.
+   Avoids race conditions with normal thread code or signal-handler code that
+   might want to close the same file descriptor.  */
+_GL_ASYNC_SAFE int
+clean_temp_asyncsafe_close (struct closeable_fd *element)
+{
+  sigset_t saved_mask;
+  int ret;
+  int saved_errno;
+
+  asyncsafe_spin_lock (&element->lock, fatal_signal_set, &saved_mask);
+  if (!element->closed)
+    {
+      ret = close (element->fd);
+      saved_errno = errno;
+      element->closed = true;
+    }
+  else
+    {
+      ret = 0;
+      saved_errno = 0;
+    }
+  asyncsafe_spin_unlock (&element->lock, &saved_mask);
+  element->done = true;
+
+  errno = saved_errno;
+  return ret;
+}
+/* Initializations for use of this function.  */
+void
+clean_temp_init_asyncsafe_close (void)
+{
+  init_fatal_signal_set ();
+}
+
+/* The signal handler.  It gets called asynchronously.  */
+static _GL_ASYNC_SAFE void
+cleanup_action (int sig _GL_UNUSED)
+{
+  size_t i;
+
+  /* First close all file descriptors to temporary files.  */
+  {
+    gl_list_t fds = descriptors;
+
+    if (fds != NULL)
+      {
+        gl_list_iterator_t iter;
+        const void *element;
+
+        iter = gl_list_iterator (fds);
+        while (gl_list_iterator_next (&iter, &element, NULL))
+          {
+            clean_temp_asyncsafe_close ((struct closeable_fd *) element);
+          }
+        gl_list_iterator_free (&iter);
+      }
+  }
+
+  {
+    gl_list_t files = file_cleanup_list;
+
+    if (files != NULL)
+      {
+        gl_list_iterator_t iter;
+        const void *element;
+
+        iter = gl_list_iterator (files);
+        while (gl_list_iterator_next (&iter, &element, NULL))
+          {
+            const char *file = (const char *) element;
+            unlink (file);
+          }
+        gl_list_iterator_free (&iter);
+      }
+  }
+
+  for (i = 0; i < dir_cleanup_list.tempdir_count; i++)
+    {
+      struct tempdir *dir = dir_cleanup_list.tempdir_list[i];
+
+      if (dir != NULL)
+        {
+          gl_list_iterator_t iter;
+          const void *element;
+
+          /* First cleanup the files in the subdirectories.  */
+          iter = gl_list_iterator (dir->files);
+          while (gl_list_iterator_next (&iter, &element, NULL))
+            {
+              const char *file = (const char *) element;
+              unlink (file);
+            }
+          gl_list_iterator_free (&iter);
+
+          /* Then cleanup the subdirectories.  */
+          iter = gl_list_iterator (dir->subdirs);
+          while (gl_list_iterator_next (&iter, &element, NULL))
+            {
+              const char *subdir = (const char *) element;
+              rmdir (subdir);
+            }
+          gl_list_iterator_free (&iter);
+
+          /* Then cleanup the temporary directory itself.  */
+          rmdir (dir->dirname);
+        }
+    }
+}
+
+
+/* Set to -1 if initialization of this facility failed.  */
+static int volatile init_failed /* = 0 */;
+
+/* Initializes this facility.  */
+static void
+do_clean_temp_init (void)
+{
+  /* Initialize the data used by the cleanup handler.  */
+  init_fatal_signal_set ();
+  /* Register the cleanup handler.  */
+  if (at_fatal_signal (&cleanup_action) < 0)
+    init_failed = -1;
+}
+
+/* Ensure that do_clean_temp_init is called once only.  */
+gl_once_define(static, clean_temp_once)
+
+/* Initializes this facility upon first use.
+   Return 0 upon success, or -1 if there was a memory allocation problem.  */
+int
+clean_temp_init (void)
+{
+  gl_once (clean_temp_once, do_clean_temp_init);
+  return init_failed;
+}
+
+
+/* Remove a file, with optional error message.
+   Return 0 upon success, or -1 if there was some problem.  */
+int
+clean_temp_unlink (const char *absolute_file_name, bool cleanup_verbose)
+{
+  if (unlink (absolute_file_name) < 0 && cleanup_verbose
+      && errno != ENOENT)
+    {
+      error (0, errno,
+             _("cannot remove temporary file %s"), absolute_file_name);
+      return -1;
+    }
+  return 0;
+}
+
+
+/* ============= Temporary files without temporary directories ============= */
+
+/* Register the given ABSOLUTE_FILE_NAME as being a file that needs to be
+   removed.
+   Should be called before the file ABSOLUTE_FILE_NAME is created.
+   Return 0 upon success, or -1 if there was a memory allocation problem.  */
+int
+register_temporary_file (const char *absolute_file_name)
+{
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (file_cleanup_list_lock);
+
+  int ret = 0;
+
+  /* Make sure that this facility and the file_cleanup_list are initialized.  */
+  if (file_cleanup_list == NULL)
+    {
+      if (clean_temp_init () < 0)
+        {
+          ret = -1;
+          goto done;
+        }
+      file_cleanup_list =
+        gl_list_nx_create_empty (GL_LINKEDHASH_LIST,
+                                 clean_temp_string_equals,
+                                 clean_temp_string_hash,
+                                 NULL, false);
+      if (file_cleanup_list == NULL)
+        {
+          ret = -1;
+          goto done;
+        }
+    }
+
+  /* Add absolute_file_name to file_cleanup_list, without duplicates.  */
+  if (gl_list_search (file_cleanup_list, absolute_file_name) == NULL)
+    {
+      char *absolute_file_name_copy = strdup (absolute_file_name);
+      if (absolute_file_name_copy == NULL)
+        {
+          ret = -1;
+          goto done;
+        }
+      if (gl_list_nx_add_first (file_cleanup_list, absolute_file_name_copy)
+          == NULL)
+        {
+          free (absolute_file_name_copy);
+          ret = -1;
+          goto done;
+        }
+    }
+
+ done:
+  if (mt) gl_lock_unlock (file_cleanup_list_lock);
+
+  return ret;
+}
+
+/* Unregister the given ABSOLUTE_FILE_NAME as being a file that needs to be
+   removed.
+   Should be called when the file ABSOLUTE_FILE_NAME could not be created.  */
+void
+unregister_temporary_file (const char *absolute_file_name)
+{
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (file_cleanup_list_lock);
+
+  gl_list_t list = file_cleanup_list;
+  if (list != NULL)
+    {
+      gl_list_node_t node = gl_list_search (list, absolute_file_name);
+      if (node != NULL)
+        {
+          char *old_string = (char *) gl_list_node_value (list, node);
+
+          gl_list_remove_node (list, node);
+          free (old_string);
+        }
+    }
+
+  if (mt) gl_lock_unlock (file_cleanup_list_lock);
+}
+
+/* Remove the given ABSOLUTE_FILE_NAME and unregister it.
+   CLEANUP_VERBOSE determines whether errors are reported to standard error.
+   Return 0 upon success, or -1 if there was some problem.  */
+int
+cleanup_temporary_file (const char *absolute_file_name, bool cleanup_verbose)
+{
+  int err;
+
+  err = clean_temp_unlink (absolute_file_name, cleanup_verbose);
+  unregister_temporary_file (absolute_file_name);
+
+  return err;
+}
diff --git a/lib/clean-temp-simple.h b/lib/clean-temp-simple.h
new file mode 100644 (file)
index 0000000..9b9ab07
--- /dev/null
@@ -0,0 +1,52 @@
+/* Temporary files with automatic cleanup.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _CLEAN_TEMP_SIMPLE_H
+#define _CLEAN_TEMP_SIMPLE_H
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* See clean-temp.h for a general discussion of this module.  */
+
+/* Register the given ABSOLUTE_FILE_NAME as being a file that needs to be
+   removed.
+   Should be called before the file ABSOLUTE_FILE_NAME is created.
+   Return 0 upon success, or -1 if there was a memory allocation problem.  */
+extern int register_temporary_file (const char *absolute_file_name);
+
+/* Unregister the given ABSOLUTE_FILE_NAME as being a file that needs to be
+   removed.
+   Should be called when the file ABSOLUTE_FILE_NAME could not be created.  */
+extern void unregister_temporary_file (const char *absolute_file_name);
+
+/* Remove the given ABSOLUTE_FILE_NAME and unregister it.
+   CLEANUP_VERBOSE determines whether errors are reported to standard error.
+   Return 0 upon success, or -1 if there was some problem.  */
+extern int cleanup_temporary_file (const char *absolute_file_name,
+                                   bool cleanup_verbose);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _CLEAN_TEMP_SIMPLE_H */
index 9e0fb27..215c0d9 100644 (file)
@@ -1,5 +1,5 @@
 /* Temporary directories and temporary files with automatic cleanup.
-   Copyright (C) 2001, 2003, 2006-2007, 2009-2016 Free Software Foundation,
+   Copyright (C) 2001, 2003, 2006-2007, 2009-2021 Free Software Foundation,
    Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
@@ -14,8 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 
 #include <errno.h>
 #include <fcntl.h>
-#include <limits.h>
+#include <signal.h>
 #include <stdbool.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 #endif
 
+#include "clean-temp-simple.h"
+#include "clean-temp-private.h"
 #include "error.h"
 #include "fatal-signal.h"
+#include "asyncsafe-spin.h"
 #include "pathmax.h"
 #include "tmpdir.h"
 #include "xalloc.h"
 #include "xmalloca.h"
+#include "glthread/lock.h"
+#include "thread-optim.h"
 #include "gl_xlist.h"
 #include "gl_linkedhash_list.h"
+#include "gl_linked_list.h"
 #include "gettext.h"
+#if GNULIB_TEMPNAME
+# include "tempname.h"
+#endif
 #if GNULIB_FWRITEERROR
 # include "fwriteerror.h"
 #endif
 # define PATH_MAX 1024
 #endif
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Don't assume that UNICODE is not defined.  */
+# undef OSVERSIONINFO
+# define OSVERSIONINFO OSVERSIONINFOA
+# undef GetVersionEx
+# define GetVersionEx GetVersionExA
 #endif
 
 
-/* The use of 'volatile' in the types below (and ISO C 99 section 5.1.2.3.(5))
-   ensure that while constructing or modifying the data structures, the field
-   values are written to memory in the order of the C statements.  So the
-   signal handler can rely on these field values to be up to date.  */
-
-
-/* Registry for a single temporary directory.
-   'struct temp_dir' from the public header file overlaps with this.  */
-struct tempdir
-{
-  /* The absolute pathname of the directory.  */
-  char * volatile dirname;
-  /* Whether errors during explicit cleanup are reported to standard error.  */
-  bool cleanup_verbose;
-  /* Absolute pathnames of subdirectories.  */
-  gl_list_t /* <char *> */ volatile subdirs;
-  /* Absolute pathnames of files.  */
-  gl_list_t /* <char *> */ volatile files;
-};
-
-/* List of all temporary directories.  */
-static struct
-{
-  struct tempdir * volatile * volatile tempdir_list;
-  size_t volatile tempdir_count;
-  size_t tempdir_allocated;
-} cleanup_list /* = { NULL, 0, 0 } */;
-
-/* List of all open file descriptors to temporary files.  */
-static gl_list_t /* <int> */ volatile descriptors;
-
-
-/* For the subdirs and for the files, we use a gl_list_t of type LINKEDHASH.
-   Why?  We need a data structure that
-
-     1) Can contain an arbitrary number of 'char *' values.  The strings
-        are compared via strcmp, not pointer comparison.
-     2) Has insertion and deletion operations that are fast: ideally O(1),
-        or possibly O(log n).  This is important for GNU sort, which may
-        create a large number of temporary files.
-     3) Allows iteration through all elements from within a signal handler.
-     4) May or may not allow duplicates.  It doesn't matter here, since
-        any file or subdir can only be removed once.
-
-   Criterion 1) would allow any gl_list_t or gl_oset_t implementation.
-
-   Criterion 2) leaves only GL_LINKEDHASH_LIST, GL_TREEHASH_LIST, or
-   GL_TREE_OSET.
-
-   Criterion 3) puts at disadvantage GL_TREEHASH_LIST and GL_TREE_OSET.
-   Namely, iteration through the elements of a binary tree requires access
-   to many ->left, ->right, ->parent pointers. However, the rebalancing
-   code for insertion and deletion in an AVL or red-black tree is so
-   complicated that we cannot assume that >left, ->right, ->parent pointers
-   are in a consistent state throughout these operations.  Therefore, to
-   avoid a crash in the signal handler, all destructive operations to the
-   lists would have to be protected by a
-       block_fatal_signals ();
-       ...
-       unblock_fatal_signals ();
-   pair.  Which causes extra system calls.
-
-   Criterion 3) would also discourage GL_ARRAY_LIST and GL_CARRAY_LIST,
-   if they were not already excluded.  Namely, these implementations use
-   xrealloc(), leaving a time window in which in the list->elements pointer
-   points to already deallocated memory.  To avoid a crash in the signal
-   handler at such a moment, all destructive operations would have to
-   protected by block/unblock_fatal_signals (), in this case too.
-
-   A list of type GL_LINKEDHASH_LIST without duplicates fulfills all
-   requirements:
-     2) Insertion and deletion are O(1) on average.
-     3) The gl_list_iterator, gl_list_iterator_next implementations do
-        not trigger memory allocations, nor other system calls, and are
-        therefore safe to be called from a signal handler.
-        Furthermore, since SIGNAL_SAFE_LIST is defined, the implementation
-        of the destructive functions ensures that the list structure is
-        safe to be traversed at any moment, even when interrupted by an
-        asynchronous signal.
- */
-
-/* String equality and hash code functions used by the lists.  */
+/* Lock that protects the dir_cleanup_list from concurrent modification in
+   different threads.  */
+gl_lock_define_initialized (static, dir_cleanup_list_lock)
 
-static bool
-string_equals (const void *x1, const void *x2)
-{
-  const char *s1 = (const char *) x1;
-  const char *s2 = (const char *) x2;
-  return strcmp (s1, s2) == 0;
-}
+/* Lock that protects the descriptors list from concurrent modification in
+   different threads.  */
+gl_lock_define_initialized (static, descriptors_lock)
 
-#define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
 
-/* A hash function for NUL-terminated char* strings using
-   the method described by Bruno Haible.
-   See http://www.haible.de/bruno/hashfunc.html.  */
-static size_t
-string_hash (const void *x)
-{
-  const char *s = (const char *) x;
-  size_t h = 0;
-
-  for (; *s; s++)
-    h = *s + ((h << 9) | (h >> (SIZE_BITS - 9)));
-
-  return h;
-}
-
-
-/* The signal handler.  It gets called asynchronously.  */
-static void
-cleanup ()
+/* Close a file descriptor and the stream that contains it.
+   Avoids race conditions with signal-handler code that might want to close the
+   same file descriptor.  */
+static int
+asyncsafe_fclose_variant (struct closeable_fd *element, FILE *fp,
+                          int (*fclose_variant) (FILE *))
 {
-  size_t i;
-
-  /* First close all file descriptors to temporary files.  */
-  {
-    gl_list_t fds = descriptors;
+  if (fileno (fp) != element->fd)
+    abort ();
 
-    if (fds != NULL)
-      {
-        gl_list_iterator_t iter;
-        const void *element;
+  /* Flush buffered data first, to minimize the duration of the spin lock.  */
+  fflush (fp);
 
-        iter = gl_list_iterator (fds);
-        while (gl_list_iterator_next (&iter, &element, NULL))
-          {
-            int fd = (int) (uintptr_t) element;
-            close (fd);
-          }
-        gl_list_iterator_free (&iter);
-      }
-  }
+  sigset_t saved_mask;
+  int ret;
+  int saved_errno;
 
-  for (i = 0; i < cleanup_list.tempdir_count; i++)
+  asyncsafe_spin_lock (&element->lock, get_fatal_signal_set (), &saved_mask);
+  if (!element->closed)
     {
-      struct tempdir *dir = cleanup_list.tempdir_list[i];
-
-      if (dir != NULL)
-        {
-          gl_list_iterator_t iter;
-          const void *element;
+      ret = fclose_variant (fp); /* invokes close (element->fd) */
+      saved_errno = errno;
+      element->closed = true;
+    }
+  else
+    {
+      ret = 0;
+      saved_errno = 0;
+    }
+  asyncsafe_spin_unlock (&element->lock, &saved_mask);
+  element->done = true;
 
-          /* First cleanup the files in the subdirectories.  */
-          iter = gl_list_iterator (dir->files);
-          while (gl_list_iterator_next (&iter, &element, NULL))
-            {
-              const char *file = (const char *) element;
-              unlink (file);
-            }
-          gl_list_iterator_free (&iter);
+  errno = saved_errno;
+  return ret;
+}
 
-          /* Then cleanup the subdirectories.  */
-          iter = gl_list_iterator (dir->subdirs);
-          while (gl_list_iterator_next (&iter, &element, NULL))
-            {
-              const char *subdir = (const char *) element;
-              rmdir (subdir);
-            }
-          gl_list_iterator_free (&iter);
 
-          /* Then cleanup the temporary directory itself.  */
-          rmdir (dir->dirname);
-        }
-    }
-}
+/* ========= Temporary directories and temporary files inside them ========= */
 
 /* Create a temporary directory.
    PREFIX is used as a prefix for the name of the temporary directory. It
@@ -250,6 +144,10 @@ struct temp_dir *
 create_temp_dir (const char *prefix, const char *parentdir,
                  bool cleanup_verbose)
 {
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (dir_cleanup_list_lock);
+
   struct tempdir * volatile *tmpdirp = NULL;
   struct tempdir *tmpdir;
   size_t i;
@@ -258,28 +156,31 @@ create_temp_dir (const char *prefix, const char *parentdir,
 
   /* See whether it can take the slot of an earlier temporary directory
      already cleaned up.  */
-  for (i = 0; i < cleanup_list.tempdir_count; i++)
-    if (cleanup_list.tempdir_list[i] == NULL)
+  for (i = 0; i < dir_cleanup_list.tempdir_count; i++)
+    if (dir_cleanup_list.tempdir_list[i] == NULL)
       {
-        tmpdirp = &cleanup_list.tempdir_list[i];
+        tmpdirp = &dir_cleanup_list.tempdir_list[i];
         break;
       }
   if (tmpdirp == NULL)
     {
       /* See whether the array needs to be extended.  */
-      if (cleanup_list.tempdir_count == cleanup_list.tempdir_allocated)
+      if (dir_cleanup_list.tempdir_count == dir_cleanup_list.tempdir_allocated)
         {
           /* Note that we cannot use xrealloc(), because then the cleanup()
              function could access an already deallocated array.  */
-          struct tempdir * volatile *old_array = cleanup_list.tempdir_list;
-          size_t old_allocated = cleanup_list.tempdir_allocated;
-          size_t new_allocated = 2 * cleanup_list.tempdir_allocated + 1;
+          struct tempdir * volatile *old_array = dir_cleanup_list.tempdir_list;
+          size_t old_allocated = dir_cleanup_list.tempdir_allocated;
+          size_t new_allocated = 2 * dir_cleanup_list.tempdir_allocated + 1;
           struct tempdir * volatile *new_array =
             XNMALLOC (new_allocated, struct tempdir * volatile);
 
           if (old_allocated == 0)
-            /* First use of this facility.  Register the cleanup handler.  */
-            at_fatal_signal (&cleanup);
+            {
+              /* First use of this facility.  */
+              if (clean_temp_init () < 0)
+                xalloc_die ();
+            }
           else
             {
               /* Don't use memcpy() here, because memcpy takes non-volatile
@@ -291,31 +192,40 @@ create_temp_dir (const char *prefix, const char *parentdir,
                 new_array[k] = old_array[k];
             }
 
-          cleanup_list.tempdir_list = new_array;
-          cleanup_list.tempdir_allocated = new_allocated;
+          dir_cleanup_list.tempdir_list = new_array;
+          dir_cleanup_list.tempdir_allocated = new_allocated;
 
           /* Now we can free the old array.  */
+          /* No, we can't do that.  If cleanup_action is running in a different
+             thread and has already fetched the tempdir_list pointer (getting
+             old_array) but not yet accessed its i-th element, that thread may
+             crash when accessing an element of the already freed old_array
+             array.  */
+          #if 0
           if (old_array != NULL)
             free ((struct tempdir **) old_array);
+          #endif
         }
 
-      tmpdirp = &cleanup_list.tempdir_list[cleanup_list.tempdir_count];
+      tmpdirp = &dir_cleanup_list.tempdir_list[dir_cleanup_list.tempdir_count];
       /* Initialize *tmpdirp before incrementing tempdir_count, so that
          cleanup() will skip this entry before it is fully initialized.  */
       *tmpdirp = NULL;
-      cleanup_list.tempdir_count++;
+      dir_cleanup_list.tempdir_count++;
     }
 
   /* Initialize a 'struct tempdir'.  */
   tmpdir = XMALLOC (struct tempdir);
   tmpdir->dirname = NULL;
   tmpdir->cleanup_verbose = cleanup_verbose;
-  tmpdir->subdirs = gl_list_create_empty (GL_LINKEDHASH_LIST,
-                                          string_equals, string_hash, NULL,
-                                          false);
-  tmpdir->files = gl_list_create_empty (GL_LINKEDHASH_LIST,
-                                        string_equals, string_hash, NULL,
-                                        false);
+  tmpdir->subdirs =
+    gl_list_create_empty (GL_LINKEDHASH_LIST,
+                          clean_temp_string_equals, clean_temp_string_hash,
+                          NULL, false);
+  tmpdir->files =
+    gl_list_create_empty (GL_LINKEDHASH_LIST,
+                          clean_temp_string_equals, clean_temp_string_hash,
+                          NULL, false);
 
   /* Create the temporary directory.  */
   xtemplate = (char *) xmalloca (PATH_MAX);
@@ -327,6 +237,7 @@ create_temp_dir (const char *prefix, const char *parentdir,
     }
   block_fatal_signals ();
   tmpdirname = mkdtemp (xtemplate);
+  int saved_errno = errno;
   if (tmpdirname != NULL)
     {
       tmpdir->dirname = tmpdirname;
@@ -335,7 +246,7 @@ create_temp_dir (const char *prefix, const char *parentdir,
   unblock_fatal_signals ();
   if (tmpdirname == NULL)
     {
-      error (0, errno,
+      error (0, saved_errno,
              _("cannot create a temporary directory using template \"%s\""),
              xtemplate);
       goto quit;
@@ -345,10 +256,12 @@ create_temp_dir (const char *prefix, const char *parentdir,
      block because then the cleanup handler would not remove the directory
      if xstrdup fails.  */
   tmpdir->dirname = xstrdup (tmpdirname);
+  if (mt) gl_lock_unlock (dir_cleanup_list_lock);
   freea (xtemplate);
   return (struct temp_dir *) tmpdir;
 
  quit:
+  if (mt) gl_lock_unlock (dir_cleanup_list_lock);
   freea (xtemplate);
   return NULL;
 }
@@ -361,10 +274,15 @@ register_temp_file (struct temp_dir *dir,
                     const char *absolute_file_name)
 {
   struct tempdir *tmpdir = (struct tempdir *)dir;
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (dir_cleanup_list_lock);
 
   /* Add absolute_file_name to tmpdir->files, without duplicates.  */
   if (gl_list_search (tmpdir->files, absolute_file_name) == NULL)
     gl_list_add_first (tmpdir->files, xstrdup (absolute_file_name));
+
+  if (mt) gl_lock_unlock (dir_cleanup_list_lock);
 }
 
 /* Unregister the given ABSOLUTE_FILE_NAME as being a file inside DIR, that
@@ -375,6 +293,10 @@ unregister_temp_file (struct temp_dir *dir,
                       const char *absolute_file_name)
 {
   struct tempdir *tmpdir = (struct tempdir *)dir;
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (dir_cleanup_list_lock);
+
   gl_list_t list = tmpdir->files;
   gl_list_node_t node;
 
@@ -386,6 +308,8 @@ unregister_temp_file (struct temp_dir *dir,
       gl_list_remove_node (list, node);
       free (old_string);
     }
+
+  if (mt) gl_lock_unlock (dir_cleanup_list_lock);
 }
 
 /* Register the given ABSOLUTE_DIR_NAME as being a subdirectory inside DIR,
@@ -396,10 +320,15 @@ register_temp_subdir (struct temp_dir *dir,
                       const char *absolute_dir_name)
 {
   struct tempdir *tmpdir = (struct tempdir *)dir;
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (dir_cleanup_list_lock);
 
   /* Add absolute_dir_name to tmpdir->subdirs, without duplicates.  */
   if (gl_list_search (tmpdir->subdirs, absolute_dir_name) == NULL)
     gl_list_add_first (tmpdir->subdirs, xstrdup (absolute_dir_name));
+
+  if (mt) gl_lock_unlock (dir_cleanup_list_lock);
 }
 
 /* Unregister the given ABSOLUTE_DIR_NAME as being a subdirectory inside DIR,
@@ -411,6 +340,10 @@ unregister_temp_subdir (struct temp_dir *dir,
                         const char *absolute_dir_name)
 {
   struct tempdir *tmpdir = (struct tempdir *)dir;
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (dir_cleanup_list_lock);
+
   gl_list_t list = tmpdir->subdirs;
   gl_list_node_t node;
 
@@ -422,28 +355,16 @@ unregister_temp_subdir (struct temp_dir *dir,
       gl_list_remove_node (list, node);
       free (old_string);
     }
-}
 
-/* Remove a file, with optional error message.
-   Return 0 upon success, or -1 if there was some problem.  */
-static int
-do_unlink (struct temp_dir *dir, const char *absolute_file_name)
-{
-  if (unlink (absolute_file_name) < 0 && dir->cleanup_verbose
-      && errno != ENOENT)
-    {
-      error (0, errno, _("cannot remove temporary file %s"), absolute_file_name);
-      return -1;
-    }
-  return 0;
+  if (mt) gl_lock_unlock (dir_cleanup_list_lock);
 }
 
 /* Remove a directory, with optional error message.
    Return 0 upon success, or -1 if there was some problem.  */
 static int
-do_rmdir (struct temp_dir *dir, const char *absolute_dir_name)
+do_rmdir (const char *absolute_dir_name, bool cleanup_verbose)
 {
-  if (rmdir (absolute_dir_name) < 0 && dir->cleanup_verbose
+  if (rmdir (absolute_dir_name) < 0 && cleanup_verbose
       && errno != ENOENT)
     {
       error (0, errno,
@@ -461,7 +382,7 @@ cleanup_temp_file (struct temp_dir *dir,
 {
   int err;
 
-  err = do_unlink (dir, absolute_file_name);
+  err = clean_temp_unlink (absolute_file_name, dir->cleanup_verbose);
   unregister_temp_file (dir, absolute_file_name);
 
   return err;
@@ -475,13 +396,14 @@ cleanup_temp_subdir (struct temp_dir *dir,
 {
   int err;
 
-  err = do_rmdir (dir, absolute_dir_name);
+  err = do_rmdir (absolute_dir_name, dir->cleanup_verbose);
   unregister_temp_subdir (dir, absolute_dir_name);
 
   return err;
 }
 
 /* Remove all registered files and subdirectories inside DIR.
+   Only to be called with dir_cleanup_list_lock locked.
    Return 0 upon success, or -1 if there was some problem.  */
 int
 cleanup_temp_dir_contents (struct temp_dir *dir)
@@ -500,7 +422,7 @@ cleanup_temp_dir_contents (struct temp_dir *dir)
     {
       char *file = (char *) element;
 
-      err |= do_unlink (dir, file);
+      err |= clean_temp_unlink (file, dir->cleanup_verbose);
       gl_list_remove_node (list, node);
       /* Now only we can free file.  */
       free (file);
@@ -514,7 +436,7 @@ cleanup_temp_dir_contents (struct temp_dir *dir)
     {
       char *subdir = (char *) element;
 
-      err |= do_rmdir (dir, subdir);
+      err |= do_rmdir (subdir, dir->cleanup_verbose);
       gl_list_remove_node (list, node);
       /* Now only we can free subdir.  */
       free (subdir);
@@ -530,31 +452,36 @@ cleanup_temp_dir_contents (struct temp_dir *dir)
 int
 cleanup_temp_dir (struct temp_dir *dir)
 {
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (dir_cleanup_list_lock);
+
   struct tempdir *tmpdir = (struct tempdir *)dir;
   int err = 0;
   size_t i;
 
   err |= cleanup_temp_dir_contents (dir);
-  err |= do_rmdir (dir, tmpdir->dirname);
+  err |= do_rmdir (tmpdir->dirname, dir->cleanup_verbose);
 
-  for (i = 0; i < cleanup_list.tempdir_count; i++)
-    if (cleanup_list.tempdir_list[i] == tmpdir)
+  for (i = 0; i < dir_cleanup_list.tempdir_count; i++)
+    if (dir_cleanup_list.tempdir_list[i] == tmpdir)
       {
-        /* Remove cleanup_list.tempdir_list[i].  */
-        if (i + 1 == cleanup_list.tempdir_count)
+        /* Remove dir_cleanup_list.tempdir_list[i].  */
+        if (i + 1 == dir_cleanup_list.tempdir_count)
           {
-            while (i > 0 && cleanup_list.tempdir_list[i - 1] == NULL)
+            while (i > 0 && dir_cleanup_list.tempdir_list[i - 1] == NULL)
               i--;
-            cleanup_list.tempdir_count = i;
+            dir_cleanup_list.tempdir_count = i;
           }
         else
-          cleanup_list.tempdir_list[i] = NULL;
+          dir_cleanup_list.tempdir_list[i] = NULL;
         /* Now only we can free the tmpdir->dirname, tmpdir->subdirs,
            tmpdir->files, and tmpdir itself.  */
         gl_list_free (tmpdir->files);
         gl_list_free (tmpdir->subdirs);
         free (tmpdir->dirname);
         free (tmpdir);
+        if (mt) gl_lock_unlock (dir_cleanup_list_lock);
         return err;
       }
 
@@ -563,7 +490,9 @@ cleanup_temp_dir (struct temp_dir *dir)
 }
 
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+/* ================== Opening and closing temporary files ================== */
+
+#if defined _WIN32 && ! defined __CYGWIN__
 
 /* On Windows, opening a file with _O_TEMPORARY has the effect of passing
    the FILE_FLAG_DELETE_ON_CLOSE flag to CreateFile(), which has the effect
@@ -575,15 +504,12 @@ static bool
 supports_delete_on_close ()
 {
   static int known; /* 1 = yes, -1 = no, 0 = unknown */
-  /* M4 wants to close and later reopen a temporary file, so
-     delete-on-close must not be used.  */
-  known = -1;
   if (!known)
     {
       OSVERSIONINFO v;
 
       /* According to
-         <http://msdn.microsoft.com/en-us/library/windows/desktop/ms724451(v=vs.85).aspx>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getversionexa>
          this structure must be initialized as follows:  */
       v.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
 
@@ -602,43 +528,42 @@ supports_delete_on_close ()
 static void
 register_fd (int fd)
 {
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (descriptors_lock);
+
   if (descriptors == NULL)
-    descriptors = gl_list_create_empty (GL_LINKEDHASH_LIST, NULL, NULL, NULL,
+    descriptors = gl_list_create_empty (GL_LINKED_LIST, NULL, NULL, NULL,
                                         false);
-  gl_list_add_first (descriptors, (void *) (uintptr_t) fd);
-}
 
-/* Unregister a file descriptor to be closed.  */
-static void
-unregister_fd (int fd)
-{
-  gl_list_t fds = descriptors;
-  gl_list_node_t node;
+  struct closeable_fd *element = XMALLOC (struct closeable_fd);
+  element->fd = fd;
+  element->closed = false;
+  asyncsafe_spin_init (&element->lock);
+  element->done = false;
 
-  if (fds == NULL)
-    /* descriptors should already contain fd.  */
-    abort ();
-  node = gl_list_search (fds, (void *) (uintptr_t) fd);
-  if (node == NULL)
-    /* descriptors should already contain fd.  */
-    abort ();
-  gl_list_remove_node (fds, node);
+  gl_list_add_first (descriptors, element);
+
+  if (mt) gl_lock_unlock (descriptors_lock);
 }
 
 /* Open a temporary file in a temporary directory.
-   Registers the resulting file descriptor to be closed.  */
+   FILE_NAME must already have been passed to register_temp_file.
+   Registers the resulting file descriptor to be closed.
+   DELETE_ON_CLOSE indicates whether the file can be deleted when the resulting
+   file descriptor or stream is closed.  */
 int
-open_temp (const char *file_name, int flags, mode_t mode)
+open_temp (const char *file_name, int flags, mode_t mode, bool delete_on_close)
 {
   int fd;
   int saved_errno;
 
   block_fatal_signals ();
   /* Note: 'open' here is actually open() or open_safer().  */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* Use _O_TEMPORARY when possible, to increase the chances that the
      temporary file is removed when the process crashes.  */
-  if (supports_delete_on_close ())
+  if (delete_on_close && supports_delete_on_close ())
     fd = open (file_name, flags | _O_TEMPORARY, mode);
   else
 #endif
@@ -652,19 +577,22 @@ open_temp (const char *file_name, int flags, mode_t mode)
 }
 
 /* Open a temporary file in a temporary directory.
-   Registers the resulting file descriptor to be closed.  */
+   FILE_NAME must already have been passed to register_temp_file.
+   Registers the resulting file descriptor to be closed.
+   DELETE_ON_CLOSE indicates whether the file can be deleted when the resulting
+   file descriptor or stream is closed.  */
 FILE *
-fopen_temp (const char *file_name, const char *mode)
+fopen_temp (const char *file_name, const char *mode, bool delete_on_close)
 {
   FILE *fp;
   int saved_errno;
 
   block_fatal_signals ();
   /* Note: 'fopen' here is actually fopen() or fopen_safer().  */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* Use _O_TEMPORARY when possible, to increase the chances that the
      temporary file is removed when the process crashes.  */
-  if (supports_delete_on_close ())
+  if (delete_on_close && supports_delete_on_close ())
     {
       size_t mode_len = strlen (mode);
       char *augmented_mode = (char *) xmalloca (mode_len + 2);
@@ -697,90 +625,219 @@ fopen_temp (const char *file_name, const char *mode)
   return fp;
 }
 
-/* Close a temporary file in a temporary directory.
-   Unregisters the previously registered file descriptor.  */
+#if GNULIB_TEMPNAME
+
+struct try_create_file_params
+{
+  int flags;
+  mode_t mode;
+};
+
+static int
+try_create_file (char *file_name_tmpl, void *params_)
+{
+  struct try_create_file_params *params = params_;
+  return open (file_name_tmpl,
+               (params->flags & ~O_ACCMODE) | O_RDWR | O_CREAT | O_EXCL,
+               params->mode);
+}
+
+/* Open a temporary file, generating its name based on FILE_NAME_TMPL.
+   FILE_NAME_TMPL must match the rules for mk[s]temp (i.e. end in "XXXXXX",
+   possibly with a suffix).  The name constructed does not exist at the time
+   of the call.  FILE_NAME_TMPL is overwritten with the result.
+   A safe choice for MODE is S_IRUSR | S_IWUSR, a.k.a. 0600.
+   Registers the file for deletion.
+   Opens the file, with the given FLAGS and mode MODE.
+   Registers the resulting file descriptor to be closed.  */
 int
-close_temp (int fd)
+gen_register_open_temp (char *file_name_tmpl, int suffixlen,
+                        int flags, mode_t mode)
 {
-  if (fd >= 0)
-    {
-      /* No blocking of signals is needed here, since a double close of a
-         file descriptor is harmless.  */
-      int result = close (fd);
-      int saved_errno = errno;
+  block_fatal_signals ();
 
-      /* No race condition here: we assume a single-threaded program, hence
-         fd cannot be re-opened here.  */
+  struct try_create_file_params params;
+  params.flags = flags;
+  params.mode = mode;
 
-      unregister_fd (fd);
+  int fd = try_tempname (file_name_tmpl, suffixlen, &params, try_create_file);
 
-      errno = saved_errno;
-      return result;
+  int saved_errno = errno;
+  if (fd >= 0)
+    {
+      if (clean_temp_init () < 0)
+        xalloc_die ();
+      register_fd (fd);
+      if (register_temporary_file (file_name_tmpl) < 0)
+        xalloc_die ();
     }
-  else
-    return close (fd);
+  unblock_fatal_signals ();
+  errno = saved_errno;
+  return fd;
 }
 
-/* Close a temporary file in a temporary directory.
+#endif
+
+/* Close a temporary file.
+   FD must have been returned by open_temp or gen_register_open_temp.
    Unregisters the previously registered file descriptor.  */
 int
-fclose_temp (FILE *fp)
+close_temp (int fd)
 {
-  int fd = fileno (fp);
-  /* No blocking of signals is needed here, since a double close of a
-     file descriptor is harmless.  */
-  int result = fclose (fp);
-  int saved_errno = errno;
+  if (fd < 0)
+    return close (fd);
+
+  clean_temp_init_asyncsafe_close ();
 
-  /* No race condition here: we assume a single-threaded program, hence
-     fd cannot be re-opened here.  */
+  int result = 0;
+  int saved_errno = 0;
 
-  unregister_fd (fd);
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (descriptors_lock);
+
+  gl_list_t list = descriptors;
+  if (list == NULL)
+    /* descriptors should already contain fd.  */
+    abort ();
+
+  /* Search through the list, and clean it up on the fly.  */
+  bool found = false;
+  gl_list_iterator_t iter = gl_list_iterator (list);
+  const void *elt;
+  gl_list_node_t node;
+  if (gl_list_iterator_next (&iter, &elt, &node))
+    for (;;)
+      {
+        struct closeable_fd *element = (struct closeable_fd *) elt;
+
+        /* Close the file descriptor, avoiding races with the signal
+           handler.  */
+        if (element->fd == fd)
+          {
+            found = true;
+            result = clean_temp_asyncsafe_close (element);
+            saved_errno = errno;
+          }
+
+        bool free_this_node = element->done;
+        struct closeable_fd *element_to_free = element;
+        gl_list_node_t node_to_free = node;
+
+        bool have_next = gl_list_iterator_next (&iter, &elt, &node);
+
+        if (free_this_node)
+          {
+            free (element_to_free);
+            gl_list_remove_node (list, node_to_free);
+          }
+
+        if (!have_next)
+          break;
+      }
+  gl_list_iterator_free (&iter);
+  if (!found)
+    /* descriptors should already contain fd.  */
+    abort ();
+
+  if (mt) gl_lock_unlock (descriptors_lock);
 
   errno = saved_errno;
   return result;
 }
 
-#if GNULIB_FWRITEERROR
-/* Like fwriteerror.
-   Unregisters the previously registered file descriptor.  */
-int
-fwriteerror_temp (FILE *fp)
+static int
+fclose_variant_temp (FILE *fp, int (*fclose_variant) (FILE *))
 {
   int fd = fileno (fp);
-  /* No blocking of signals is needed here, since a double close of a
-     file descriptor is harmless.  */
-  int result = fwriteerror (fp);
-  int saved_errno = errno;
 
-  /* No race condition here: we assume a single-threaded program, hence
-     fd cannot be re-opened here.  */
+  int result = 0;
+  int saved_errno = 0;
+
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (descriptors_lock);
+
+  gl_list_t list = descriptors;
+  if (list == NULL)
+    /* descriptors should already contain fd.  */
+    abort ();
+
+  /* Search through the list, and clean it up on the fly.  */
+  bool found = false;
+  gl_list_iterator_t iter = gl_list_iterator (list);
+  const void *elt;
+  gl_list_node_t node;
+  if (gl_list_iterator_next (&iter, &elt, &node))
+    for (;;)
+      {
+        struct closeable_fd *element = (struct closeable_fd *) elt;
+
+        /* Close the file descriptor and the stream, avoiding races with the
+           signal handler.  */
+        if (element->fd == fd)
+          {
+            found = true;
+            result = asyncsafe_fclose_variant (element, fp, fclose_variant);
+            saved_errno = errno;
+          }
+
+        bool free_this_node = element->done;
+        struct closeable_fd *element_to_free = element;
+        gl_list_node_t node_to_free = node;
+
+        bool have_next = gl_list_iterator_next (&iter, &elt, &node);
+
+        if (free_this_node)
+          {
+            free (element_to_free);
+            gl_list_remove_node (list, node_to_free);
+          }
+
+        if (!have_next)
+          break;
+      }
+  gl_list_iterator_free (&iter);
+  if (!found)
+    /* descriptors should have contained fd.  */
+    abort ();
 
-  unregister_fd (fd);
+  if (mt) gl_lock_unlock (descriptors_lock);
 
   errno = saved_errno;
   return result;
 }
+
+/* Close a temporary file.
+   FP must have been returned by fopen_temp, or by fdopen on a file descriptor
+   returned by open_temp or gen_register_open_temp.
+   Unregisters the previously registered file descriptor.  */
+int
+fclose_temp (FILE *fp)
+{
+  return fclose_variant_temp (fp, fclose);
+}
+
+#if GNULIB_FWRITEERROR
+/* Like fwriteerror.
+   FP must have been returned by fopen_temp, or by fdopen on a file descriptor
+   returned by open_temp or gen_register_open_temp.
+   Unregisters the previously registered file descriptor.  */
+int
+fwriteerror_temp (FILE *fp)
+{
+  return fclose_variant_temp (fp, fwriteerror);
+}
 #endif
 
 #if GNULIB_CLOSE_STREAM
 /* Like close_stream.
+   FP must have been returned by fopen_temp, or by fdopen on a file descriptor
+   returned by open_temp or gen_register_open_temp.
    Unregisters the previously registered file descriptor.  */
 int
 close_stream_temp (FILE *fp)
 {
-  int fd = fileno (fp);
-  /* No blocking of signals is needed here, since a double close of a
-     file descriptor is harmless.  */
-  int result = close_stream (fp);
-  int saved_errno = errno;
-
-  /* No race condition here: we assume a single-threaded program, hence
-     fd cannot be re-opened here.  */
-
-  unregister_fd (fd);
-
-  errno = saved_errno;
-  return result;
+  return fclose_variant_temp (fp, close_stream);
 }
 #endif
index 335e504..db4d7fe 100644 (file)
@@ -1,5 +1,5 @@
 /* Temporary directories and temporary files with automatic cleanup.
-   Copyright (C) 2006, 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2011-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _CLEAN_TEMP_H
 #define _CLEAN_TEMP_H
@@ -37,18 +37,37 @@ extern "C" {
    and the temporary directories can be removed, because only on Unix
    (excluding Cygwin) can one remove directories containing open files.
 
-   This module provides support for temporary directories and temporary files
-   inside these temporary directories.  Temporary files without temporary
-   directories are not supported here.  The temporary directories and files
-   are automatically cleaned up (at the latest) when the program exits or
-   dies from a fatal signal such as SIGINT, SIGTERM, SIGHUP, but not if it
-   dies from a fatal signal such as SIGQUIT, SIGKILL, or SIGABRT, SIGSEGV,
-   SIGBUS, SIGILL, SIGFPE.
+   There are two modules:
+     - 'clean-temp' provides support for temporary directories and temporary
+       files inside these temporary directories,
+     - 'clean-temp-simple' provides support for temporary files without
+       temporary directories.
+   The temporary directories and files are automatically cleaned up (at the
+   latest) when the program exits or dies from a fatal signal such as SIGINT,
+   SIGTERM, SIGHUP, but not if it dies from a fatal signal such as SIGQUIT,
+   SIGKILL, or SIGABRT, SIGSEGV, SIGBUS, SIGILL, SIGFPE.
 
    For the cleanup in the normal case, programs that use this module need to
    call 'cleanup_temp_dir' for each successful return of 'create_temp_dir'.
    The cleanup in the case of a fatal signal such as SIGINT, SIGTERM, SIGHUP,
-   is done entirely automatically by the functions of this module.  */
+   is done entirely automatically by the functions of this module.
+
+   Limitations: Files or directories can still be left over if
+     - the program is dies from a fatal signal such as SIGQUIT, SIGKILL, or
+       SIGABRT, SIGSEGV, SIGBUS, SIGILL, SIGFPE, or
+     - in a multithreaded program, the fatal signal handler is already running
+       while another thread of the program creates a new temporary directory
+       or temporary file, or
+     - on native Windows, some temporary files are used by a subprocess while
+       the fatal signal interrupts the program.
+ */
+
+
+/* ============= Temporary files without temporary directories ============= */
+
+#include "clean-temp-simple.h"
+
+/* ========= Temporary directories and temporary files inside them ========= */
 
 struct temp_dir
 {
@@ -116,21 +135,49 @@ extern int cleanup_temp_dir_contents (struct temp_dir *dir);
    Return 0 upon success, or -1 if there was some problem.  */
 extern int cleanup_temp_dir (struct temp_dir *dir);
 
+/* ================== Opening and closing temporary files ================== */
+
 /* Open a temporary file in a temporary directory.
+   FILE_NAME must already have been passed to register_temp_file.
+   Registers the resulting file descriptor to be closed.
+   DELETE_ON_CLOSE indicates whether the file can be deleted when the resulting
+   file descriptor or stream is closed.  */
+extern int open_temp (const char *file_name, int flags, mode_t mode,
+                      bool delete_on_close);
+extern FILE * fopen_temp (const char *file_name, const char *mode,
+                          bool delete_on_close);
+
+/* Open a temporary file, generating its name based on FILE_NAME_TMPL.
+   FILE_NAME_TMPL must match the rules for mk[s]temp (i.e. end in "XXXXXX",
+   possibly with a suffix).  The name constructed does not exist at the time
+   of the call.  FILE_NAME_TMPL is overwritten with the result.
+   A safe choice for MODE is S_IRUSR | S_IWUSR, a.k.a. 0600.
+   Registers the file for deletion.
+   Opens the file, with the given FLAGS and mode MODE.
    Registers the resulting file descriptor to be closed.  */
-extern int open_temp (const char *file_name, int flags, mode_t mode);
-extern FILE * fopen_temp (const char *file_name, const char *mode);
+extern int gen_register_open_temp (char *file_name_tmpl, int suffixlen,
+                                   int flags, mode_t mode);
 
-/* Close a temporary file in a temporary directory.
+/* Close a temporary file.
+   FD must have been returned by open_temp or gen_register_open_temp.
    Unregisters the previously registered file descriptor.  */
 extern int close_temp (int fd);
+
+/* Close a temporary file.
+   FP must have been returned by fopen_temp, or by fdopen on a file descriptor
+   returned by open_temp or gen_register_open_temp.
+   Unregisters the previously registered file descriptor.  */
 extern int fclose_temp (FILE *fp);
 
 /* Like fwriteerror.
+   FP must have been returned by fopen_temp, or by fdopen on a file descriptor
+   returned by open_temp or gen_register_open_temp.
    Unregisters the previously registered file descriptor.  */
 extern int fwriteerror_temp (FILE *fp);
 
 /* Like close_stream.
+   FP must have been returned by fopen_temp, or by fdopen on a file descriptor
+   returned by open_temp or gen_register_open_temp.
    Unregisters the previously registered file descriptor.  */
 extern int close_stream_temp (FILE *fp);
 
index 1202836..8363dda 100644 (file)
@@ -1,6 +1,6 @@
-/* closexec.c - set or clear the close-on-exec descriptor flag
+/* cloexec.c - set or clear the close-on-exec descriptor flag
 
-   Copyright (C) 1991, 2004-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1991, 2004-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
    The code is taken from glibc/manual/llio.texi  */
 
index 0e58437..5ca0e64 100644 (file)
@@ -1,6 +1,6 @@
-/* closexec.c - set or clear the close-on-exec descriptor flag
+/* cloexec.c - set or clear the close-on-exec descriptor flag
 
-   Copyright (C) 2004, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 */
 
index 0c4beae..86f6d6e 100644 (file)
@@ -1,6 +1,6 @@
 /* Close a stream, with nicer error checking than fclose's.
 
-   Copyright (C) 1998-2002, 2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-2002, 2004, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 46a7aa5..e1264d5 100644 (file)
@@ -1,5 +1,5 @@
 /* close replacement.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include <errno.h>
 
 #include "fd-hook.h"
-#include "msvc-inval.h"
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
 
 #undef close
 
-#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+#if defined _WIN32 && !defined __CYGWIN__
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
 static int
 close_nothrow (int fd)
 {
@@ -34,7 +37,7 @@ close_nothrow (int fd)
 
   TRY_MSVC_INVAL
     {
-      result = close (fd);
+      result = _close (fd);
     }
   CATCH_MSVC_INVAL
     {
@@ -45,6 +48,9 @@ close_nothrow (int fd)
 
   return result;
 }
+# else
+#  define close_nothrow _close
+# endif
 #else
 # define close_nothrow close
 #endif
similarity index 91%
rename from tests/closedir.c
rename to lib/closedir.c
index 30d1290..0847422 100644 (file)
@@ -1,5 +1,5 @@
 /* Stop reading the entries of a directory.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 7415b19..02b34ca 100644 (file)
@@ -1,6 +1,6 @@
 /* Close standard input, rewinding seekable stdin if necessary.
 
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index c578839..4c9bcdd 100644 (file)
@@ -1,6 +1,6 @@
 /* Close standard input, rewinding seekable stdin if necessary.
 
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_CLOSEIN_H
 # define _GL_CLOSEIN_H 1
index 311faf4..a0c935f 100644 (file)
@@ -1,6 +1,6 @@
 /* Close standard output and standard error, exiting with a diagnostic on error.
 
-   Copyright (C) 1998-2002, 2004, 2006, 2008-2016 Free Software Foundation,
+   Copyright (C) 1998-2002, 2004, 2006, 2008-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include "exitfail.h"
 #include "quotearg.h"
 
+#ifndef __has_feature
+# define __has_feature(a) false
+#endif
+
+#if defined __SANITIZE_ADDRESS__ || __has_feature (address_sanitizer)
+enum { SANITIZE_ADDRESS = true };
+#else
+enum { SANITIZE_ADDRESS = false };
+#endif
+
 static const char *file_name;
 
 /* Set the file name to be reported in the event an error is detected
@@ -119,6 +129,8 @@ close_stdout (void)
       _exit (exit_failure);
     }
 
-   if (close_stream (stderr) != 0)
-     _exit (exit_failure);
+  /* Close stderr only if not sanitizing, as sanitizers may report to
+     stderr after this function returns.  */
+  if (!SANITIZE_ADDRESS && close_stream (stderr) != 0)
+    _exit (exit_failure);
 }
index bde9bf0..68a6425 100644 (file)
@@ -1,6 +1,6 @@
 /* Close standard output and standard error.
 
-   Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2016 Free Software
+   Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef CLOSEOUT_H
 # define CLOSEOUT_H 1
diff --git a/lib/concat-filename.c b/lib/concat-filename.c
new file mode 100644 (file)
index 0000000..2a63cfe
--- /dev/null
@@ -0,0 +1,73 @@
+/* Construct a full filename from a directory and a relative filename.
+   Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by the
+   Free Software Foundation; either version 3 of the License, or any
+   later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <haible@clisp.cons.org>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "concat-filename.h"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "filename.h"
+
+/* Concatenate a directory filename, a relative filename and an optional
+   suffix.  The directory may end with the directory separator.  The second
+   argument may not start with the directory separator (it is relative).
+   Return a freshly allocated filename.  Return NULL and set errno
+   upon memory allocation failure.  */
+char *
+concatenated_filename (const char *directory, const char *filename,
+                       const char *suffix)
+{
+  char *result;
+  char *p;
+
+  if (strcmp (directory, ".") == 0)
+    {
+      /* No need to prepend the directory.  */
+      result = (char *) malloc (strlen (filename)
+                                + (suffix != NULL ? strlen (suffix) : 0)
+                                + 1);
+      if (result == NULL)
+        return NULL; /* errno is set here */
+      p = result;
+    }
+  else
+    {
+      size_t directory_len = strlen (directory);
+      int need_slash =
+        (directory_len > FILE_SYSTEM_PREFIX_LEN (directory)
+         && !ISSLASH (directory[directory_len - 1]));
+      result = (char *) malloc (directory_len + need_slash
+                                + strlen (filename)
+                                + (suffix != NULL ? strlen (suffix) : 0)
+                                + 1);
+      if (result == NULL)
+        return NULL; /* errno is set here */
+      memcpy (result, directory, directory_len);
+      p = result + directory_len;
+      if (need_slash)
+        *p++ = '/';
+    }
+  p = stpcpy (p, filename);
+  if (suffix != NULL)
+    stpcpy (p, suffix);
+  return result;
+}
diff --git a/lib/concat-filename.h b/lib/concat-filename.h
new file mode 100644 (file)
index 0000000..9b6e47e
--- /dev/null
@@ -0,0 +1,41 @@
+/* Construct a full filename from a directory and a relative filename.
+   Copyright (C) 2001-2004, 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _CONCAT_FILENAME_H
+#define _CONCAT_FILENAME_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Concatenate a directory filename, a relative filename and an optional
+   suffix.  Return a freshly allocated filename.  Return NULL and set errno
+   upon memory allocation failure.  */
+extern char *concatenated_filename (const char *directory,
+                                    const char *filename, const char *suffix);
+
+/* Concatenate a directory filename, a relative filename and an optional
+   suffix.  Return a freshly allocated filename.  */
+extern char *xconcatenated_filename (const char *directory,
+                                     const char *filename, const char *suffix);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _CONCAT_FILENAME_H */
diff --git a/lib/config.charset b/lib/config.charset
deleted file mode 100644 (file)
index 947d916..0000000
+++ /dev/null
@@ -1,682 +0,0 @@
-#! /bin/sh
-# Output a system dependent table of character encoding aliases.
-#
-#   Copyright (C) 2000-2004, 2006-2016 Free Software Foundation, Inc.
-#
-#   This program is free software; you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 3, or (at your option)
-#   any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#   GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License along
-#   with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# The table consists of lines of the form
-#    ALIAS  CANONICAL
-#
-# ALIAS is the (system dependent) result of "nl_langinfo (CODESET)".
-# ALIAS is compared in a case sensitive way.
-#
-# CANONICAL is the GNU canonical name for this character encoding.
-# It must be an encoding supported by libiconv. Support by GNU libc is
-# also desirable. CANONICAL is case insensitive. Usually an upper case
-# MIME charset name is preferred.
-# The current list of GNU canonical charset names is as follows.
-#
-#       name              MIME?             used by which systems
-#                                    (darwin = Mac OS X, woe32 = native Windows)
-#
-#   ASCII, ANSI_X3.4-1968       glibc solaris freebsd netbsd darwin cygwin
-#   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
-#   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
-#   ISO-8859-3              Y   glibc solaris cygwin
-#   ISO-8859-4              Y   osf solaris freebsd netbsd openbsd darwin
-#   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin
-#   ISO-8859-6              Y   glibc aix hpux solaris cygwin
-#   ISO-8859-7              Y   glibc aix hpux irix osf solaris netbsd openbsd darwin cygwin
-#   ISO-8859-8              Y   glibc aix hpux osf solaris cygwin
-#   ISO-8859-9              Y   glibc aix hpux irix osf solaris darwin cygwin
-#   ISO-8859-13                 glibc netbsd openbsd darwin cygwin
-#   ISO-8859-14                 glibc cygwin
-#   ISO-8859-15                 glibc aix osf solaris freebsd netbsd openbsd darwin cygwin
-#   KOI8-R                  Y   glibc solaris freebsd netbsd openbsd darwin
-#   KOI8-U                  Y   glibc freebsd netbsd openbsd darwin cygwin
-#   KOI8-T                      glibc
-#   CP437                       dos
-#   CP775                       dos
-#   CP850                       aix osf dos
-#   CP852                       dos
-#   CP855                       dos
-#   CP856                       aix
-#   CP857                       dos
-#   CP861                       dos
-#   CP862                       dos
-#   CP864                       dos
-#   CP865                       dos
-#   CP866                       freebsd netbsd openbsd darwin dos
-#   CP869                       dos
-#   CP874                       woe32 dos
-#   CP922                       aix
-#   CP932                       aix cygwin woe32 dos
-#   CP943                       aix
-#   CP949                       osf darwin woe32 dos
-#   CP950                       woe32 dos
-#   CP1046                      aix
-#   CP1124                      aix
-#   CP1125                      dos
-#   CP1129                      aix
-#   CP1131                      darwin
-#   CP1250                      woe32
-#   CP1251                      glibc solaris netbsd openbsd darwin cygwin woe32
-#   CP1252                      aix woe32
-#   CP1253                      woe32
-#   CP1254                      woe32
-#   CP1255                      glibc woe32
-#   CP1256                      woe32
-#   CP1257                      woe32
-#   GB2312                  Y   glibc aix hpux irix solaris freebsd netbsd darwin
-#   EUC-JP                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin
-#   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
-#   EUC-TW                      glibc aix hpux irix osf solaris netbsd
-#   BIG5                    Y   glibc aix hpux osf solaris freebsd netbsd darwin cygwin
-#   BIG5-HKSCS                  glibc solaris darwin
-#   GBK                         glibc aix osf solaris darwin cygwin woe32 dos
-#   GB18030                     glibc solaris netbsd darwin
-#   SHIFT_JIS               Y   hpux osf solaris freebsd netbsd darwin
-#   JOHAB                       glibc solaris woe32
-#   TIS-620                     glibc aix hpux osf solaris cygwin
-#   VISCII                  Y   glibc
-#   TCVN5712-1                  glibc
-#   ARMSCII-8                   glibc darwin
-#   GEORGIAN-PS                 glibc cygwin
-#   PT154                       glibc
-#   HP-ROMAN8                   hpux
-#   HP-ARABIC8                  hpux
-#   HP-GREEK8                   hpux
-#   HP-HEBREW8                  hpux
-#   HP-TURKISH8                 hpux
-#   HP-KANA8                    hpux
-#   DEC-KANJI                   osf
-#   DEC-HANYU                   osf
-#   UTF-8                   Y   glibc aix hpux osf solaris netbsd darwin cygwin
-#
-# Note: Names which are not marked as being a MIME name should not be used in
-# Internet protocols for information interchange (mail, news, etc.).
-#
-# Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names. Applications
-# must understand both names and treat them as equivalent.
-#
-# The first argument passed to this file is the canonical host specification,
-#    CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
-# or
-#    CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
-
-host="$1"
-os=`echo "$host" | sed -e 's/^[^-]*-[^-]*-\(.*\)$/\1/'`
-echo "# This file contains a table of character encoding aliases,"
-echo "# suitable for operating system '${os}'."
-echo "# It was automatically generated from config.charset."
-# List of references, updated during installation:
-echo "# Packages using this file: "
-case "$os" in
-  linux-gnulibc1*)
-    # Linux libc5 doesn't have nl_langinfo(CODESET); therefore
-    # localcharset.c falls back to using the full locale name
-    # from the environment variables.
-    echo "C ASCII"
-    echo "POSIX ASCII"
-    for l in af af_ZA ca ca_ES da da_DK de de_AT de_BE de_CH de_DE de_LU \
-             en en_AU en_BW en_CA en_DK en_GB en_IE en_NZ en_US en_ZA \
-             en_ZW es es_AR es_BO es_CL es_CO es_DO es_EC es_ES es_GT \
-             es_HN es_MX es_PA es_PE es_PY es_SV es_US es_UY es_VE et \
-             et_EE eu eu_ES fi fi_FI fo fo_FO fr fr_BE fr_CA fr_CH fr_FR \
-             fr_LU ga ga_IE gl gl_ES id id_ID in in_ID is is_IS it it_CH \
-             it_IT kl kl_GL nl nl_BE nl_NL no no_NO pt pt_BR pt_PT sv \
-             sv_FI sv_SE; do
-      echo "$l ISO-8859-1"
-      echo "$l.iso-8859-1 ISO-8859-1"
-      echo "$l.iso-8859-15 ISO-8859-15"
-      echo "$l.iso-8859-15@euro ISO-8859-15"
-      echo "$l@euro ISO-8859-15"
-      echo "$l.cp-437 CP437"
-      echo "$l.cp-850 CP850"
-      echo "$l.cp-1252 CP1252"
-      echo "$l.cp-1252@euro CP1252"
-      #echo "$l.atari-st ATARI-ST" # not a commonly used encoding
-      echo "$l.utf-8 UTF-8"
-      echo "$l.utf-8@euro UTF-8"
-    done
-    for l in cs cs_CZ hr hr_HR hu hu_HU pl pl_PL ro ro_RO sk sk_SK sl \
-             sl_SI sr sr_CS sr_YU; do
-      echo "$l ISO-8859-2"
-      echo "$l.iso-8859-2 ISO-8859-2"
-      echo "$l.cp-852 CP852"
-      echo "$l.cp-1250 CP1250"
-      echo "$l.utf-8 UTF-8"
-    done
-    for l in mk mk_MK ru ru_RU; do
-      echo "$l ISO-8859-5"
-      echo "$l.iso-8859-5 ISO-8859-5"
-      echo "$l.koi8-r KOI8-R"
-      echo "$l.cp-866 CP866"
-      echo "$l.cp-1251 CP1251"
-      echo "$l.utf-8 UTF-8"
-    done
-    for l in ar ar_SA; do
-      echo "$l ISO-8859-6"
-      echo "$l.iso-8859-6 ISO-8859-6"
-      echo "$l.cp-864 CP864"
-      #echo "$l.cp-868 CP868" # not a commonly used encoding
-      echo "$l.cp-1256 CP1256"
-      echo "$l.utf-8 UTF-8"
-    done
-    for l in el el_GR gr gr_GR; do
-      echo "$l ISO-8859-7"
-      echo "$l.iso-8859-7 ISO-8859-7"
-      echo "$l.cp-869 CP869"
-      echo "$l.cp-1253 CP1253"
-      echo "$l.cp-1253@euro CP1253"
-      echo "$l.utf-8 UTF-8"
-      echo "$l.utf-8@euro UTF-8"
-    done
-    for l in he he_IL iw iw_IL; do
-      echo "$l ISO-8859-8"
-      echo "$l.iso-8859-8 ISO-8859-8"
-      echo "$l.cp-862 CP862"
-      echo "$l.cp-1255 CP1255"
-      echo "$l.utf-8 UTF-8"
-    done
-    for l in tr tr_TR; do
-      echo "$l ISO-8859-9"
-      echo "$l.iso-8859-9 ISO-8859-9"
-      echo "$l.cp-857 CP857"
-      echo "$l.cp-1254 CP1254"
-      echo "$l.utf-8 UTF-8"
-    done
-    for l in lt lt_LT lv lv_LV; do
-      #echo "$l BALTIC" # not a commonly used encoding, wrong encoding name
-      echo "$l ISO-8859-13"
-    done
-    for l in ru_UA uk uk_UA; do
-      echo "$l KOI8-U"
-    done
-    for l in zh zh_CN; do
-      #echo "$l GB_2312-80" # not a commonly used encoding, wrong encoding name
-      echo "$l GB2312"
-    done
-    for l in ja ja_JP ja_JP.EUC; do
-      echo "$l EUC-JP"
-    done
-    for l in ko ko_KR; do
-      echo "$l EUC-KR"
-    done
-    for l in th th_TH; do
-      echo "$l TIS-620"
-    done
-    for l in fa fa_IR; do
-      #echo "$l ISIRI-3342" # a broken encoding
-      echo "$l.utf-8 UTF-8"
-    done
-    ;;
-  linux* | *-gnu*)
-    # With glibc-2.1 or newer, we don't need any canonicalization,
-    # because glibc has iconv and both glibc and libiconv support all
-    # GNU canonical names directly. Therefore, the Makefile does not
-    # need to install the alias file at all.
-    # The following applies only to glibc-2.0.x and older libcs.
-    echo "ISO_646.IRV:1983 ASCII"
-    ;;
-  aix*)
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-6 ISO-8859-6"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-8 ISO-8859-8"
-    echo "ISO8859-9 ISO-8859-9"
-    echo "ISO8859-15 ISO-8859-15"
-    echo "IBM-850 CP850"
-    echo "IBM-856 CP856"
-    echo "IBM-921 ISO-8859-13"
-    echo "IBM-922 CP922"
-    echo "IBM-932 CP932"
-    echo "IBM-943 CP943"
-    echo "IBM-1046 CP1046"
-    echo "IBM-1124 CP1124"
-    echo "IBM-1129 CP1129"
-    echo "IBM-1252 CP1252"
-    echo "IBM-eucCN GB2312"
-    echo "IBM-eucJP EUC-JP"
-    echo "IBM-eucKR EUC-KR"
-    echo "IBM-eucTW EUC-TW"
-    echo "big5 BIG5"
-    echo "GBK GBK"
-    echo "TIS-620 TIS-620"
-    echo "UTF-8 UTF-8"
-    ;;
-  hpux*)
-    echo "iso88591 ISO-8859-1"
-    echo "iso88592 ISO-8859-2"
-    echo "iso88595 ISO-8859-5"
-    echo "iso88596 ISO-8859-6"
-    echo "iso88597 ISO-8859-7"
-    echo "iso88598 ISO-8859-8"
-    echo "iso88599 ISO-8859-9"
-    echo "iso885915 ISO-8859-15"
-    echo "roman8 HP-ROMAN8"
-    echo "arabic8 HP-ARABIC8"
-    echo "greek8 HP-GREEK8"
-    echo "hebrew8 HP-HEBREW8"
-    echo "turkish8 HP-TURKISH8"
-    echo "kana8 HP-KANA8"
-    echo "tis620 TIS-620"
-    echo "big5 BIG5"
-    echo "eucJP EUC-JP"
-    echo "eucKR EUC-KR"
-    echo "eucTW EUC-TW"
-    echo "hp15CN GB2312"
-    #echo "ccdc ?" # what is this?
-    echo "SJIS SHIFT_JIS"
-    echo "utf8 UTF-8"
-    ;;
-  irix*)
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-9 ISO-8859-9"
-    echo "eucCN GB2312"
-    echo "eucJP EUC-JP"
-    echo "eucKR EUC-KR"
-    echo "eucTW EUC-TW"
-    ;;
-  osf*)
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-4 ISO-8859-4"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-8 ISO-8859-8"
-    echo "ISO8859-9 ISO-8859-9"
-    echo "ISO8859-15 ISO-8859-15"
-    echo "cp850 CP850"
-    echo "big5 BIG5"
-    echo "dechanyu DEC-HANYU"
-    echo "dechanzi GB2312"
-    echo "deckanji DEC-KANJI"
-    echo "deckorean EUC-KR"
-    echo "eucJP EUC-JP"
-    echo "eucKR EUC-KR"
-    echo "eucTW EUC-TW"
-    echo "GBK GBK"
-    echo "KSC5601 CP949"
-    echo "sdeckanji EUC-JP"
-    echo "SJIS SHIFT_JIS"
-    echo "TACTIS TIS-620"
-    echo "UTF-8 UTF-8"
-    ;;
-  solaris*)
-    echo "646 ASCII"
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-3 ISO-8859-3"
-    echo "ISO8859-4 ISO-8859-4"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-6 ISO-8859-6"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-8 ISO-8859-8"
-    echo "ISO8859-9 ISO-8859-9"
-    echo "ISO8859-15 ISO-8859-15"
-    echo "koi8-r KOI8-R"
-    echo "ansi-1251 CP1251"
-    echo "BIG5 BIG5"
-    echo "Big5-HKSCS BIG5-HKSCS"
-    echo "gb2312 GB2312"
-    echo "GBK GBK"
-    echo "GB18030 GB18030"
-    echo "cns11643 EUC-TW"
-    echo "5601 EUC-KR"
-    echo "ko_KR.johap92 JOHAB"
-    echo "eucJP EUC-JP"
-    echo "PCK SHIFT_JIS"
-    echo "TIS620.2533 TIS-620"
-    #echo "sun_eu_greek ?" # what is this?
-    echo "UTF-8 UTF-8"
-    ;;
-  freebsd*)
-    # FreeBSD 4.2 doesn't have nl_langinfo(CODESET); therefore
-    # localcharset.c falls back to using the full locale name
-    # from the environment variables.
-    echo "C ASCII"
-    echo "US-ASCII ASCII"
-    for l in la_LN lt_LN; do
-      echo "$l.ASCII ASCII"
-    done
-    for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
-             fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT la_LN \
-             lt_LN nl_BE nl_NL no_NO pt_PT sv_SE; do
-      echo "$l.ISO_8859-1 ISO-8859-1"
-      echo "$l.DIS_8859-15 ISO-8859-15"
-    done
-    for l in cs_CZ hr_HR hu_HU la_LN lt_LN pl_PL sl_SI; do
-      echo "$l.ISO_8859-2 ISO-8859-2"
-    done
-    for l in la_LN lt_LT; do
-      echo "$l.ISO_8859-4 ISO-8859-4"
-    done
-    for l in ru_RU ru_SU; do
-      echo "$l.KOI8-R KOI8-R"
-      echo "$l.ISO_8859-5 ISO-8859-5"
-      echo "$l.CP866 CP866"
-    done
-    echo "uk_UA.KOI8-U KOI8-U"
-    echo "zh_TW.BIG5 BIG5"
-    echo "zh_TW.Big5 BIG5"
-    echo "zh_CN.EUC GB2312"
-    echo "ja_JP.EUC EUC-JP"
-    echo "ja_JP.SJIS SHIFT_JIS"
-    echo "ja_JP.Shift_JIS SHIFT_JIS"
-    echo "ko_KR.EUC EUC-KR"
-    ;;
-  netbsd*)
-    echo "646 ASCII"
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-4 ISO-8859-4"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-13 ISO-8859-13"
-    echo "ISO8859-15 ISO-8859-15"
-    echo "eucCN GB2312"
-    echo "eucJP EUC-JP"
-    echo "eucKR EUC-KR"
-    echo "eucTW EUC-TW"
-    echo "BIG5 BIG5"
-    echo "SJIS SHIFT_JIS"
-    ;;
-  openbsd*)
-    echo "646 ASCII"
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-4 ISO-8859-4"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-13 ISO-8859-13"
-    echo "ISO8859-15 ISO-8859-15"
-    ;;
-  darwin[56]*)
-    # Darwin 6.8 doesn't have nl_langinfo(CODESET); therefore
-    # localcharset.c falls back to using the full locale name
-    # from the environment variables.
-    echo "C ASCII"
-    for l in en_AU en_CA en_GB en_US la_LN; do
-      echo "$l.US-ASCII ASCII"
-    done
-    for l in da_DK de_AT de_CH de_DE en_AU en_CA en_GB en_US es_ES \
-             fi_FI fr_BE fr_CA fr_CH fr_FR is_IS it_CH it_IT nl_BE \
-             nl_NL no_NO pt_PT sv_SE; do
-      echo "$l ISO-8859-1"
-      echo "$l.ISO8859-1 ISO-8859-1"
-      echo "$l.ISO8859-15 ISO-8859-15"
-    done
-    for l in la_LN; do
-      echo "$l.ISO8859-1 ISO-8859-1"
-      echo "$l.ISO8859-15 ISO-8859-15"
-    done
-    for l in cs_CZ hr_HR hu_HU la_LN pl_PL sl_SI; do
-      echo "$l.ISO8859-2 ISO-8859-2"
-    done
-    for l in la_LN lt_LT; do
-      echo "$l.ISO8859-4 ISO-8859-4"
-    done
-    for l in ru_RU; do
-      echo "$l.KOI8-R KOI8-R"
-      echo "$l.ISO8859-5 ISO-8859-5"
-      echo "$l.CP866 CP866"
-    done
-    for l in bg_BG; do
-      echo "$l.CP1251 CP1251"
-    done
-    echo "uk_UA.KOI8-U KOI8-U"
-    echo "zh_TW.BIG5 BIG5"
-    echo "zh_TW.Big5 BIG5"
-    echo "zh_CN.EUC GB2312"
-    echo "ja_JP.EUC EUC-JP"
-    echo "ja_JP.SJIS SHIFT_JIS"
-    echo "ko_KR.EUC EUC-KR"
-    ;;
-  darwin*)
-    # Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
-    # useless:
-    # - It returns the empty string when LANG is set to a locale of the
-    #   form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
-    #   LC_CTYPE file.
-    # - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
-    #   the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
-    # - The documentation says:
-    #     "... all code that calls BSD system routines should ensure
-    #      that the const *char parameters of these routines are in UTF-8
-    #      encoding. All BSD system functions expect their string
-    #      parameters to be in UTF-8 encoding and nothing else."
-    #   It also says
-    #     "An additional caveat is that string parameters for files,
-    #      paths, and other file-system entities must be in canonical
-    #      UTF-8. In a canonical UTF-8 Unicode string, all decomposable
-    #      characters are decomposed ..."
-    #   but this is not true: You can pass non-decomposed UTF-8 strings
-    #   to file system functions, and it is the OS which will convert
-    #   them to decomposed UTF-8 before accessing the file system.
-    # - The Apple Terminal application displays UTF-8 by default.
-    # - However, other applications are free to use different encodings:
-    #   - xterm uses ISO-8859-1 by default.
-    #   - TextEdit uses MacRoman by default.
-    # We prefer UTF-8 over decomposed UTF-8-MAC because one should
-    # minimize the use of decomposed Unicode. Unfortunately, through the
-    # Darwin file system, decomposed UTF-8 strings are leaked into user
-    # space nevertheless.
-    # Then there are also the locales with encodings other than US-ASCII
-    # and UTF-8. These locales can be occasionally useful to users (e.g.
-    # when grepping through ISO-8859-1 encoded text files), when all their
-    # file names are in US-ASCII.
-    echo "ISO8859-1 ISO-8859-1"
-    echo "ISO8859-2 ISO-8859-2"
-    echo "ISO8859-4 ISO-8859-4"
-    echo "ISO8859-5 ISO-8859-5"
-    echo "ISO8859-7 ISO-8859-7"
-    echo "ISO8859-9 ISO-8859-9"
-    echo "ISO8859-13 ISO-8859-13"
-    echo "ISO8859-15 ISO-8859-15"
-    echo "KOI8-R KOI8-R"
-    echo "KOI8-U KOI8-U"
-    echo "CP866 CP866"
-    echo "CP949 CP949"
-    echo "CP1131 CP1131"
-    echo "CP1251 CP1251"
-    echo "eucCN GB2312"
-    echo "GB2312 GB2312"
-    echo "eucJP EUC-JP"
-    echo "eucKR EUC-KR"
-    echo "Big5 BIG5"
-    echo "Big5HKSCS BIG5-HKSCS"
-    echo "GBK GBK"
-    echo "GB18030 GB18030"
-    echo "SJIS SHIFT_JIS"
-    echo "ARMSCII-8 ARMSCII-8"
-    echo "PT154 PT154"
-    #echo "ISCII-DEV ?"
-    echo "* UTF-8"
-    ;;
-  beos* | haiku*)
-    # BeOS and Haiku have a single locale, and it has UTF-8 encoding.
-    echo "* UTF-8"
-    ;;
-  msdosdjgpp*)
-    # DJGPP 2.03 doesn't have nl_langinfo(CODESET); therefore
-    # localcharset.c falls back to using the full locale name
-    # from the environment variables.
-    echo "#"
-    echo "# The encodings given here may not all be correct."
-    echo "# If you find that the encoding given for your language and"
-    echo "# country is not the one your DOS machine actually uses, just"
-    echo "# correct it in this file, and send a mail to"
-    echo "# Juan Manuel Guerrero <juan.guerrero@gmx.de>"
-    echo "# and Bruno Haible <bruno@clisp.org>."
-    echo "#"
-    echo "C ASCII"
-    # ISO-8859-1 languages
-    echo "ca CP850"
-    echo "ca_ES CP850"
-    echo "da CP865"    # not CP850 ??
-    echo "da_DK CP865" # not CP850 ??
-    echo "de CP850"
-    echo "de_AT CP850"
-    echo "de_CH CP850"
-    echo "de_DE CP850"
-    echo "en CP850"
-    echo "en_AU CP850" # not CP437 ??
-    echo "en_CA CP850"
-    echo "en_GB CP850"
-    echo "en_NZ CP437"
-    echo "en_US CP437"
-    echo "en_ZA CP850" # not CP437 ??
-    echo "es CP850"
-    echo "es_AR CP850"
-    echo "es_BO CP850"
-    echo "es_CL CP850"
-    echo "es_CO CP850"
-    echo "es_CR CP850"
-    echo "es_CU CP850"
-    echo "es_DO CP850"
-    echo "es_EC CP850"
-    echo "es_ES CP850"
-    echo "es_GT CP850"
-    echo "es_HN CP850"
-    echo "es_MX CP850"
-    echo "es_NI CP850"
-    echo "es_PA CP850"
-    echo "es_PY CP850"
-    echo "es_PE CP850"
-    echo "es_SV CP850"
-    echo "es_UY CP850"
-    echo "es_VE CP850"
-    echo "et CP850"
-    echo "et_EE CP850"
-    echo "eu CP850"
-    echo "eu_ES CP850"
-    echo "fi CP850"
-    echo "fi_FI CP850"
-    echo "fr CP850"
-    echo "fr_BE CP850"
-    echo "fr_CA CP850"
-    echo "fr_CH CP850"
-    echo "fr_FR CP850"
-    echo "ga CP850"
-    echo "ga_IE CP850"
-    echo "gd CP850"
-    echo "gd_GB CP850"
-    echo "gl CP850"
-    echo "gl_ES CP850"
-    echo "id CP850"    # not CP437 ??
-    echo "id_ID CP850" # not CP437 ??
-    echo "is CP861"    # not CP850 ??
-    echo "is_IS CP861" # not CP850 ??
-    echo "it CP850"
-    echo "it_CH CP850"
-    echo "it_IT CP850"
-    echo "lt CP775"
-    echo "lt_LT CP775"
-    echo "lv CP775"
-    echo "lv_LV CP775"
-    echo "nb CP865"    # not CP850 ??
-    echo "nb_NO CP865" # not CP850 ??
-    echo "nl CP850"
-    echo "nl_BE CP850"
-    echo "nl_NL CP850"
-    echo "nn CP865"    # not CP850 ??
-    echo "nn_NO CP865" # not CP850 ??
-    echo "no CP865"    # not CP850 ??
-    echo "no_NO CP865" # not CP850 ??
-    echo "pt CP850"
-    echo "pt_BR CP850"
-    echo "pt_PT CP850"
-    echo "sv CP850"
-    echo "sv_SE CP850"
-    # ISO-8859-2 languages
-    echo "cs CP852"
-    echo "cs_CZ CP852"
-    echo "hr CP852"
-    echo "hr_HR CP852"
-    echo "hu CP852"
-    echo "hu_HU CP852"
-    echo "pl CP852"
-    echo "pl_PL CP852"
-    echo "ro CP852"
-    echo "ro_RO CP852"
-    echo "sk CP852"
-    echo "sk_SK CP852"
-    echo "sl CP852"
-    echo "sl_SI CP852"
-    echo "sq CP852"
-    echo "sq_AL CP852"
-    echo "sr CP852"    # CP852 or CP866 or CP855 ??
-    echo "sr_CS CP852" # CP852 or CP866 or CP855 ??
-    echo "sr_YU CP852" # CP852 or CP866 or CP855 ??
-    # ISO-8859-3 languages
-    echo "mt CP850"
-    echo "mt_MT CP850"
-    # ISO-8859-5 languages
-    echo "be CP866"
-    echo "be_BE CP866"
-    echo "bg CP866"    # not CP855 ??
-    echo "bg_BG CP866" # not CP855 ??
-    echo "mk CP866"    # not CP855 ??
-    echo "mk_MK CP866" # not CP855 ??
-    echo "ru CP866"
-    echo "ru_RU CP866"
-    echo "uk CP1125"
-    echo "uk_UA CP1125"
-    # ISO-8859-6 languages
-    echo "ar CP864"
-    echo "ar_AE CP864"
-    echo "ar_DZ CP864"
-    echo "ar_EG CP864"
-    echo "ar_IQ CP864"
-    echo "ar_IR CP864"
-    echo "ar_JO CP864"
-    echo "ar_KW CP864"
-    echo "ar_MA CP864"
-    echo "ar_OM CP864"
-    echo "ar_QA CP864"
-    echo "ar_SA CP864"
-    echo "ar_SY CP864"
-    # ISO-8859-7 languages
-    echo "el CP869"
-    echo "el_GR CP869"
-    # ISO-8859-8 languages
-    echo "he CP862"
-    echo "he_IL CP862"
-    # ISO-8859-9 languages
-    echo "tr CP857"
-    echo "tr_TR CP857"
-    # Japanese
-    echo "ja CP932"
-    echo "ja_JP CP932"
-    # Chinese
-    echo "zh_CN GBK"
-    echo "zh_TW CP950" # not CP938 ??
-    # Korean
-    echo "kr CP949"    # not CP934 ??
-    echo "kr_KR CP949" # not CP934 ??
-    # Thai
-    echo "th CP874"
-    echo "th_TH CP874"
-    # Other
-    echo "eo CP850"
-    echo "eo_EO CP850"
-    ;;
-esac
index d967943..1a9a70f 100644 (file)
@@ -1,5 +1,113 @@
 /* lib/config.hin.  Generated from configure.ac by autoheader.  */
 
+/* CPU and C ABI indicator */
+#ifndef __i386__
+#undef __i386__
+#endif
+#ifndef __x86_64_x32__
+#undef __x86_64_x32__
+#endif
+#ifndef __x86_64__
+#undef __x86_64__
+#endif
+#ifndef __alpha__
+#undef __alpha__
+#endif
+#ifndef __arm__
+#undef __arm__
+#endif
+#ifndef __armhf__
+#undef __armhf__
+#endif
+#ifndef __arm64_ilp32__
+#undef __arm64_ilp32__
+#endif
+#ifndef __arm64__
+#undef __arm64__
+#endif
+#ifndef __hppa__
+#undef __hppa__
+#endif
+#ifndef __hppa64__
+#undef __hppa64__
+#endif
+#ifndef __ia64_ilp32__
+#undef __ia64_ilp32__
+#endif
+#ifndef __ia64__
+#undef __ia64__
+#endif
+#ifndef __m68k__
+#undef __m68k__
+#endif
+#ifndef __mips__
+#undef __mips__
+#endif
+#ifndef __mipsn32__
+#undef __mipsn32__
+#endif
+#ifndef __mips64__
+#undef __mips64__
+#endif
+#ifndef __powerpc__
+#undef __powerpc__
+#endif
+#ifndef __powerpc64__
+#undef __powerpc64__
+#endif
+#ifndef __powerpc64_elfv2__
+#undef __powerpc64_elfv2__
+#endif
+#ifndef __riscv32__
+#undef __riscv32__
+#endif
+#ifndef __riscv64__
+#undef __riscv64__
+#endif
+#ifndef __riscv32_ilp32__
+#undef __riscv32_ilp32__
+#endif
+#ifndef __riscv32_ilp32f__
+#undef __riscv32_ilp32f__
+#endif
+#ifndef __riscv32_ilp32d__
+#undef __riscv32_ilp32d__
+#endif
+#ifndef __riscv64_ilp32__
+#undef __riscv64_ilp32__
+#endif
+#ifndef __riscv64_ilp32f__
+#undef __riscv64_ilp32f__
+#endif
+#ifndef __riscv64_ilp32d__
+#undef __riscv64_ilp32d__
+#endif
+#ifndef __riscv64_lp64__
+#undef __riscv64_lp64__
+#endif
+#ifndef __riscv64_lp64f__
+#undef __riscv64_lp64f__
+#endif
+#ifndef __riscv64_lp64d__
+#undef __riscv64_lp64d__
+#endif
+#ifndef __s390__
+#undef __s390__
+#endif
+#ifndef __s390x__
+#undef __s390x__
+#endif
+#ifndef __sh__
+#undef __sh__
+#endif
+#ifndef __sparc__
+#undef __sparc__
+#endif
+#ifndef __sparc64__
+#undef __sparc64__
+#endif
+
+
 /* Define if building universal (internal helper macro) */
 #undef AC_APPLE_UNIVERSAL_BUILD
 
    non-IEEE-754 'long double' values. */
 #undef CHECK_PRINTF_SAFE
 
-/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
-   systems. This function is required for `alloca.c' support on those systems.
-   */
-#undef CRAY_STACKSEG_END
-
-/* Define to 1 if using `alloca.c'. */
+/* Define to 1 if using 'alloca.c'. */
 #undef C_ALLOCA
 
-/* Define to 1 if the C locale may have encoding errors. */
-#undef C_LOCALE_MAYBE_EILSEQ
-
 /* Define as the bit index in the word where to find bit 0 of the exponent of
    'double'. */
 #undef DBL_EXPBIT0_BIT
 /* Define to 1 if // is a file system root distinct from /. */
 #undef DOUBLE_SLASH_IS_DISTINCT_ROOT
 
+/* Define if struct dirent has a member d_ino that actually works. */
+#undef D_INO_IN_DIRENT
+
 /* Define to 1 if the changeword(REGEXP) functionality is wanted */
 #undef ENABLE_CHANGEWORD
 
-/* Define to 1 if an invalid memory address access may yield a SIGBUS. */
-#undef FAULT_YIELDS_SIGBUS
+/* Define to 1 if translation of program messages to the user's native
+   language is requested. */
+#undef ENABLE_NLS
 
 /* Define this to 1 if F_DUPFD behavior does not match POSIX */
 #undef FCNTL_DUPFD_BUGGY
 
 /* Define to nothing if C supports flexible array members, and to 1 if it does
-   not. That way, with a declaration like 'struct s { int n; double
+   not. That way, with a declaration like 'struct s { int n; short
    d[FLEXIBLE_ARRAY_MEMBER]; };', the struct hack can be used with pre-C99
-   compilers. When computing the size of such an object, don't use 'sizeof
-   (struct s)' as it overestimates the size. Use 'offsetof (struct s, d)'
-   instead. Don't use 'offsetof (struct s, d[0])', as this doesn't work with
-   MSVC and with C++ compilers. */
+   compilers. Use 'FLEXSIZEOF (struct s, d, N * sizeof (short))' to calculate
+   the size in bytes of such a struct containing an N-element array. */
 #undef FLEXIBLE_ARRAY_MEMBER
 
 /* Define as the bit index in the word where to find bit 0 of the exponent of
 /* Define to 1 if the system's ftello function has the Solaris bug. */
 #undef FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE
 
+/* Define to 1 if the system's ftello function has the macOS bug. */
+#undef FTELLO_BROKEN_AFTER_UNGETC
+
 /* Define to 1 if fflush is known to work on stdin as per POSIX.1-2008, 0 if
    fflush is known to not work, -1 if unknown. */
 #undef FUNC_FFLUSH_STDIN
 
+/* Define to 1 if mkdir mistakenly creates a directory given with a trailing
+   dot component. */
+#undef FUNC_MKDIR_DOT_BUG
+
 /* Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string. */
 #undef FUNC_NL_LANGINFO_YESEXPR_WORKS
 
 /* Define to 1 if realpath() can malloc memory, always gives an absolute path,
-   and handles trailing slash correctly. */
+   and handles a trailing slash correctly. */
+#undef FUNC_REALPATH_NEARLY_WORKS
+
+/* Define to 1 if realpath() can malloc memory, always gives an absolute path,
+   and handles leading slashes and a trailing slash correctly. */
 #undef FUNC_REALPATH_WORKS
 
 /* Define to 1 if ungetc is broken when used on arbitrary bytes. */
 #undef FUNC_UNGETC_BROKEN
 
-/* Define if gettimeofday clobbers the localtime buffer. */
-#undef GETTIMEOFDAY_CLOBBERS_LOCALTIME
-
 /* Define this to 'void' or 'struct timezone' to match the system's
    declaration of the second argument to gettimeofday. */
 #undef GETTIMEOFDAY_TIMEZONE
 
 /* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module canonicalize shall be considered present. */
+#undef GNULIB_CANONICALIZE
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
    whether the gnulib module canonicalize-lgpl shall be considered present. */
 #undef GNULIB_CANONICALIZE_LGPL
 
 #undef GNULIB_DIRNAME
 
 /* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module fdopendir shall be considered present. */
+#undef GNULIB_FDOPENDIR
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
    whether the gnulib module fd-safer-flag shall be considered present. */
 #undef GNULIB_FD_SAFER_FLAG
 
 #undef GNULIB_FILENAMECAT
 
 /* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module fopen-gnu shall be considered present. */
+#undef GNULIB_FOPEN_GNU
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
    whether the gnulib module fopen-safer shall be considered present. */
 #undef GNULIB_FOPEN_SAFER
 
 #undef GNULIB_FSCANF
 
 /* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module getcwd shall be considered present. */
+#undef GNULIB_GETCWD
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module isblank shall be considered present. */
+#undef GNULIB_ISBLANK
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
    whether the gnulib module lock shall be considered present. */
 #undef GNULIB_LOCK
 
+/* Define to optimize mbrtowc. */
+#undef GNULIB_MBRTOWC_SINGLE_THREAD
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module msvc-nothrow shall be considered present. */
+#undef GNULIB_MSVC_NOTHROW
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module openat shall be considered present. */
+#undef GNULIB_OPENAT
+
 /* Define to a C preprocessor expression that evaluates to 1 or 0, depending
    whether the gnulib module pipe2-safer shall be considered present. */
 #undef GNULIB_PIPE2_SAFER
 #undef GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
 
 /* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module reallocarray shall be considered present. */
+#undef GNULIB_REALLOCARRAY
+
+/* Define to optimize regex. */
+#undef GNULIB_REGEX_SINGLE_THREAD
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
    whether the gnulib module scanf shall be considered present. */
 #undef GNULIB_SCANF
 
    whether the gnulib module snprintf shall be considered present. */
 #undef GNULIB_SNPRINTF
 
+/* Define to 1 if you want the FILE stream functions getc, putc, etc. to use
+   unlocked I/O if available, throughout the package. Unlocked I/O can improve
+   performance, sometimes dramatically. But unlocked I/O is safe only in
+   single-threaded programs, as well as in multithreaded programs for which
+   you can guarantee that every FILE stream, including stdin, stdout, stderr,
+   is used only in a single thread. */
+#undef GNULIB_STDIO_SINGLE_THREAD
+
 /* Define to a C preprocessor expression that evaluates to 1 or 0, depending
    whether the gnulib module strerror shall be considered present. */
 #undef GNULIB_STRERROR
 
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module strerror_r-posix shall be considered present. */
+#undef GNULIB_STRERROR_R_POSIX
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module tempname shall be considered present. */
+#undef GNULIB_TEMPNAME
+
+/* Define to 1 when the gnulib module accept should be tested. */
+#undef GNULIB_TEST_ACCEPT
+
+/* Define to 1 when the gnulib module access should be tested. */
+#undef GNULIB_TEST_ACCESS
+
+/* Define to 1 when the gnulib module bind should be tested. */
+#undef GNULIB_TEST_BIND
+
 /* Define to 1 when the gnulib module btowc should be tested. */
 #undef GNULIB_TEST_BTOWC
 
+/* Define to 1 when the gnulib module calloc-posix should be tested. */
+#undef GNULIB_TEST_CALLOC_POSIX
+
+/* Define to 1 when the gnulib module canonicalize should be tested. */
+#undef GNULIB_TEST_CANONICALIZE
+
 /* Define to 1 when the gnulib module canonicalize_file_name should be tested.
    */
 #undef GNULIB_TEST_CANONICALIZE_FILE_NAME
 /* Define to 1 when the gnulib module closedir should be tested. */
 #undef GNULIB_TEST_CLOSEDIR
 
+/* Define to 1 when the gnulib module connect should be tested. */
+#undef GNULIB_TEST_CONNECT
+
+/* Define to 1 when the gnulib module creat should be tested. */
+#undef GNULIB_TEST_CREAT
+
 /* Define to 1 when the gnulib module dirfd should be tested. */
 #undef GNULIB_TEST_DIRFD
 
 /* Define to 1 when the gnulib module environ should be tested. */
 #undef GNULIB_TEST_ENVIRON
 
+/* Define to 1 when the gnulib module explicit_bzero should be tested. */
+#undef GNULIB_TEST_EXPLICIT_BZERO
+
+/* Define to 1 when the gnulib module fchdir should be tested. */
+#undef GNULIB_TEST_FCHDIR
+
 /* Define to 1 when the gnulib module fclose should be tested. */
 #undef GNULIB_TEST_FCLOSE
 
 /* Define to 1 when the gnulib module fdopen should be tested. */
 #undef GNULIB_TEST_FDOPEN
 
+/* Define to 1 when the gnulib module fdopendir should be tested. */
+#undef GNULIB_TEST_FDOPENDIR
+
 /* Define to 1 when the gnulib module fflush should be tested. */
 #undef GNULIB_TEST_FFLUSH
 
+/* Define to 1 when the gnulib module fgetc should be tested. */
+#undef GNULIB_TEST_FGETC
+
+/* Define to 1 when the gnulib module fgets should be tested. */
+#undef GNULIB_TEST_FGETS
+
 /* Define to 1 when the gnulib module fopen should be tested. */
 #undef GNULIB_TEST_FOPEN
 
+/* Define to 1 when the gnulib module fprintf should be tested. */
+#undef GNULIB_TEST_FPRINTF
+
 /* Define to 1 when the gnulib module fpurge should be tested. */
 #undef GNULIB_TEST_FPURGE
 
+/* Define to 1 when the gnulib module fputc should be tested. */
+#undef GNULIB_TEST_FPUTC
+
+/* Define to 1 when the gnulib module fputs should be tested. */
+#undef GNULIB_TEST_FPUTS
+
+/* Define to 1 when the gnulib module fread should be tested. */
+#undef GNULIB_TEST_FREAD
+
+/* Define to 1 when the gnulib module free-posix should be tested. */
+#undef GNULIB_TEST_FREE_POSIX
+
+/* Define to 1 when the gnulib module freopen should be tested. */
+#undef GNULIB_TEST_FREOPEN
+
 /* Define to 1 when the gnulib module frexp should be tested. */
 #undef GNULIB_TEST_FREXP
 
 /* Define to 1 when the gnulib module frexpl should be tested. */
 #undef GNULIB_TEST_FREXPL
 
+/* Define to 1 when the gnulib module fscanf should be tested. */
+#undef GNULIB_TEST_FSCANF
+
 /* Define to 1 when the gnulib module fseek should be tested. */
 #undef GNULIB_TEST_FSEEK
 
 /* Define to 1 when the gnulib module fstat should be tested. */
 #undef GNULIB_TEST_FSTAT
 
+/* Define to 1 when the gnulib module fstatat should be tested. */
+#undef GNULIB_TEST_FSTATAT
+
 /* Define to 1 when the gnulib module ftell should be tested. */
 #undef GNULIB_TEST_FTELL
 
 /* Define to 1 when the gnulib module ftello should be tested. */
 #undef GNULIB_TEST_FTELLO
 
+/* Define to 1 when the gnulib module ftruncate should be tested. */
+#undef GNULIB_TEST_FTRUNCATE
+
+/* Define to 1 when the gnulib module fwrite should be tested. */
+#undef GNULIB_TEST_FWRITE
+
+/* Define to 1 when the gnulib module getc should be tested. */
+#undef GNULIB_TEST_GETC
+
+/* Define to 1 when the gnulib module getchar should be tested. */
+#undef GNULIB_TEST_GETCHAR
+
 /* Define to 1 when the gnulib module getcwd should be tested. */
 #undef GNULIB_TEST_GETCWD
 
 /* Define to 1 when the gnulib module getdtablesize should be tested. */
 #undef GNULIB_TEST_GETDTABLESIZE
 
+/* Define to 1 when the gnulib module getopt-posix should be tested. */
+#undef GNULIB_TEST_GETOPT_POSIX
+
 /* Define to 1 when the gnulib module getpagesize should be tested. */
 #undef GNULIB_TEST_GETPAGESIZE
 
+/* Define to 1 when the gnulib module getrandom should be tested. */
+#undef GNULIB_TEST_GETRANDOM
+
 /* Define to 1 when the gnulib module gettimeofday should be tested. */
 #undef GNULIB_TEST_GETTIMEOFDAY
 
+/* Define to 1 when the gnulib module ioctl should be tested. */
+#undef GNULIB_TEST_IOCTL
+
+/* Define to 1 when the gnulib module iswblank should be tested. */
+#undef GNULIB_TEST_ISWBLANK
+
+/* Define to 1 when the gnulib module iswdigit should be tested. */
+#undef GNULIB_TEST_ISWDIGIT
+
+/* Define to 1 when the gnulib module iswxdigit should be tested. */
+#undef GNULIB_TEST_ISWXDIGIT
+
 /* Define to 1 when the gnulib module link should be tested. */
 #undef GNULIB_TEST_LINK
 
+/* Define to 1 when the gnulib module listen should be tested. */
+#undef GNULIB_TEST_LISTEN
+
 /* Define to 1 when the gnulib module localeconv should be tested. */
 #undef GNULIB_TEST_LOCALECONV
 
+/* Define to 1 when the gnulib module localename should be tested. */
+#undef GNULIB_TEST_LOCALENAME
+
 /* Define to 1 when the gnulib module lseek should be tested. */
 #undef GNULIB_TEST_LSEEK
 
 /* Define to 1 when the gnulib module mbsinit should be tested. */
 #undef GNULIB_TEST_MBSINIT
 
+/* Define to 1 when the gnulib module mbslen should be tested. */
+#undef GNULIB_TEST_MBSLEN
+
+/* Define to 1 when the gnulib module mbsstr should be tested. */
+#undef GNULIB_TEST_MBSSTR
+
 /* Define to 1 when the gnulib module mbtowc should be tested. */
 #undef GNULIB_TEST_MBTOWC
 
 /* Define to 1 when the gnulib module memchr should be tested. */
 #undef GNULIB_TEST_MEMCHR
 
+/* Define to 1 when the gnulib module mempcpy should be tested. */
+#undef GNULIB_TEST_MEMPCPY
+
+/* Define to 1 when the gnulib module memrchr should be tested. */
+#undef GNULIB_TEST_MEMRCHR
+
+/* Define to 1 when the gnulib module mkdir should be tested. */
+#undef GNULIB_TEST_MKDIR
+
 /* Define to 1 when the gnulib module mkdtemp should be tested. */
 #undef GNULIB_TEST_MKDTEMP
 
 /* Define to 1 when the gnulib module mkstemp should be tested. */
 #undef GNULIB_TEST_MKSTEMP
 
+/* Define to 1 when the gnulib module nanosleep should be tested. */
+#undef GNULIB_TEST_NANOSLEEP
+
 /* Define to 1 when the gnulib module nl_langinfo should be tested. */
 #undef GNULIB_TEST_NL_LANGINFO
 
 /* Define to 1 when the gnulib module open should be tested. */
 #undef GNULIB_TEST_OPEN
 
+/* Define to 1 when the gnulib module openat should be tested. */
+#undef GNULIB_TEST_OPENAT
+
 /* Define to 1 when the gnulib module opendir should be tested. */
 #undef GNULIB_TEST_OPENDIR
 
+/* Define to 1 when the gnulib module perror should be tested. */
+#undef GNULIB_TEST_PERROR
+
+/* Define to 1 when the gnulib module pipe should be tested. */
+#undef GNULIB_TEST_PIPE
+
 /* Define to 1 when the gnulib module pipe2 should be tested. */
 #undef GNULIB_TEST_PIPE2
 
+/* Define to 1 when the gnulib module posix_spawn should be tested. */
+#undef GNULIB_TEST_POSIX_SPAWN
+
 /* Define to 1 when the gnulib module posix_spawnattr_destroy should be
    tested. */
 #undef GNULIB_TEST_POSIX_SPAWNATTR_DESTROY
    tested. */
 #undef GNULIB_TEST_POSIX_SPAWNATTR_SETFLAGS
 
+/* Define to 1 when the gnulib module posix_spawnattr_setpgroup should be
+   tested. */
+#undef GNULIB_TEST_POSIX_SPAWNATTR_SETPGROUP
+
 /* Define to 1 when the gnulib module posix_spawnattr_setsigmask should be
    tested. */
 #undef GNULIB_TEST_POSIX_SPAWNATTR_SETSIGMASK
 /* Define to 1 when the gnulib module posix_spawnp should be tested. */
 #undef GNULIB_TEST_POSIX_SPAWNP
 
+/* Define to 1 when the gnulib module posix_spawn_file_actions_addchdir should
+   be tested. */
+#undef GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
+
 /* Define to 1 when the gnulib module posix_spawn_file_actions_addclose should
    be tested. */
 #undef GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
    tested. */
 #undef GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_INIT
 
+/* Define to 1 when the gnulib module printf should be tested. */
+#undef GNULIB_TEST_PRINTF
+
+/* Define to 1 when the gnulib module pthread_sigmask should be tested. */
+#undef GNULIB_TEST_PTHREAD_SIGMASK
+
+/* Define to 1 when the gnulib module pthread-thread should be tested. */
+#undef GNULIB_TEST_PTHREAD_THREAD
+
+/* Define to 1 when the gnulib module putc should be tested. */
+#undef GNULIB_TEST_PUTC
+
+/* Define to 1 when the gnulib module putchar should be tested. */
+#undef GNULIB_TEST_PUTCHAR
+
 /* Define to 1 when the gnulib module putenv should be tested. */
 #undef GNULIB_TEST_PUTENV
 
+/* Define to 1 when the gnulib module puts should be tested. */
+#undef GNULIB_TEST_PUTS
+
 /* Define to 1 when the gnulib module raise should be tested. */
 #undef GNULIB_TEST_RAISE
 
 /* Define to 1 when the gnulib module readlink should be tested. */
 #undef GNULIB_TEST_READLINK
 
+/* Define to 1 when the gnulib module reallocarray should be tested. */
+#undef GNULIB_TEST_REALLOCARRAY
+
+/* Define to 1 when the gnulib module realloc-posix should be tested. */
+#undef GNULIB_TEST_REALLOC_POSIX
+
 /* Define to 1 when the gnulib module realpath should be tested. */
 #undef GNULIB_TEST_REALPATH
 
 /* Define to 1 when the gnulib module rename should be tested. */
 #undef GNULIB_TEST_RENAME
 
+/* Define to 1 when the gnulib module rewinddir should be tested. */
+#undef GNULIB_TEST_REWINDDIR
+
 /* Define to 1 when the gnulib module rmdir should be tested. */
 #undef GNULIB_TEST_RMDIR
 
+/* Define to 1 when the gnulib module scanf should be tested. */
+#undef GNULIB_TEST_SCANF
+
+/* Define to 1 when the gnulib module sched_yield should be tested. */
+#undef GNULIB_TEST_SCHED_YIELD
+
 /* Define to 1 when the gnulib module secure_getenv should be tested. */
 #undef GNULIB_TEST_SECURE_GETENV
 
+/* Define to 1 when the gnulib module select should be tested. */
+#undef GNULIB_TEST_SELECT
+
 /* Define to 1 when the gnulib module setenv should be tested. */
 #undef GNULIB_TEST_SETENV
 
 /* Define to 1 when the gnulib module setlocale should be tested. */
 #undef GNULIB_TEST_SETLOCALE
 
+/* Define to 1 when the gnulib module setlocale_null should be tested. */
+#undef GNULIB_TEST_SETLOCALE_NULL
+
+/* Define to 1 when the gnulib module setsockopt should be tested. */
+#undef GNULIB_TEST_SETSOCKOPT
+
 /* Define to 1 when the gnulib module sigaction should be tested. */
 #undef GNULIB_TEST_SIGACTION
 
 /* Define to 1 when the gnulib module snprintf should be tested. */
 #undef GNULIB_TEST_SNPRINTF
 
+/* Define to 1 when the gnulib module socket should be tested. */
+#undef GNULIB_TEST_SOCKET
+
 /* Define to 1 when the gnulib module stat should be tested. */
 #undef GNULIB_TEST_STAT
 
+/* Define to 1 when the gnulib module stpcpy should be tested. */
+#undef GNULIB_TEST_STPCPY
+
 /* Define to 1 when the gnulib module strchrnul should be tested. */
 #undef GNULIB_TEST_STRCHRNUL
 
 /* Define to 1 when the gnulib module strerror should be tested. */
 #undef GNULIB_TEST_STRERROR
 
+/* Define to 1 when the gnulib module strerror_r should be tested. */
+#undef GNULIB_TEST_STRERROR_R
+
 /* Define to 1 when the gnulib module strndup should be tested. */
 #undef GNULIB_TEST_STRNDUP
 
 /* Define to 1 when the gnulib module vasprintf should be tested. */
 #undef GNULIB_TEST_VASPRINTF
 
+/* Define to 1 when the gnulib module vfprintf should be tested. */
+#undef GNULIB_TEST_VFPRINTF
+
+/* Define to 1 when the gnulib module vprintf should be tested. */
+#undef GNULIB_TEST_VPRINTF
+
 /* Define to 1 when the gnulib module waitpid should be tested. */
 #undef GNULIB_TEST_WAITPID
 
 /* Define to 1 when the gnulib module wctomb should be tested. */
 #undef GNULIB_TEST_WCTOMB
 
+/* Define to 1 when the gnulib module wcwidth should be tested. */
+#undef GNULIB_TEST_WCWIDTH
+
 /* Define to 1 when the gnulib module write should be tested. */
 #undef GNULIB_TEST_WRITE
 
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module unistr/u8-mbtoucr shall be considered present. */
+#undef GNULIB_UNISTR_U8_MBTOUCR
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module unistr/u8-uctomb shall be considered present. */
+#undef GNULIB_UNISTR_U8_UCTOMB
+
+/* Define to optimize mbrtowc. */
+#undef GNULIB_WCHAR_SINGLE_LOCALE
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module xalloc shall be considered present. */
+#undef GNULIB_XALLOC
+
+/* Define to a C preprocessor expression that evaluates to 1 or 0, depending
+   whether the gnulib module xalloc-die shall be considered present. */
+#undef GNULIB_XALLOC_DIE
+
 /* Define to 1 if you have 'alloca' after including <alloca.h>, a header that
    may be supplied by this distribution. */
 #undef HAVE_ALLOCA
 
-/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
-   */
+/* Define to 1 if <alloca.h> works. */
 #undef HAVE_ALLOCA_H
 
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
+
+/* Define to 1 if you have the <bcrypt.h> header file. */
+#undef HAVE_BCRYPT_H
+
 /* Define to 1 if you have the <bp-sym.h> header file. */
 #undef HAVE_BP_SYM_H
 
 /* Define to 1 if you have the `btowc' function. */
 #undef HAVE_BTOWC
 
+/* Define to 1 if nanosleep mishandles large arguments. */
+#undef HAVE_BUG_BIG_NANOSLEEP
+
 /* Define to 1 if you have the `canonicalize_file_name' function. */
 #undef HAVE_CANONICALIZE_FILE_NAME
 
-/* Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the
-   CoreFoundation framework. */
-#undef HAVE_CFLOCALECOPYCURRENT
+/* Define to 1 if you have the `catgets' function. */
+#undef HAVE_CATGETS
+
+/* Define to 1 if you have the Mac OS X function
+   CFLocaleCopyPreferredLanguages in the CoreFoundation framework. */
+#undef HAVE_CFLOCALECOPYPREFERREDLANGUAGES
 
 /* Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in
    the CoreFoundation framework. */
 #undef HAVE_CFPREFERENCESCOPYAPPVALUE
 
+/* Define to 1 if you have the `clock_gettime' function. */
+#undef HAVE_CLOCK_GETTIME
+
+/* Define to 1 if you have the `clock_settime' function. */
+#undef HAVE_CLOCK_SETTIME
+
 /* Define to 1 if you have the `closedir' function. */
 #undef HAVE_CLOSEDIR
 
+/* Define to 1 if you have the `close_range' function. */
+#undef HAVE_CLOSE_RANGE
+
 /* Define to 1 if you have the `confstr' function. */
 #undef HAVE_CONFSTR
 
    libc. */
 #undef HAVE_COPYSIGN_IN_LIBC
 
+/* Define to 1 if you have the <crtdefs.h> header file. */
+#undef HAVE_CRTDEFS_H
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+   */
+#undef HAVE_DCGETTEXT
+
 /* Define to 1 if you have the declaration of `alarm', and to 0 if you don't.
    */
 #undef HAVE_DECL_ALARM
    */
 #undef HAVE_DECL_DIRFD
 
+/* Define to 1 if you have the declaration of `ecvt', and to 0 if you don't.
+   */
+#undef HAVE_DECL_ECVT
+
+/* Define to 1 if you have the declaration of `execvpe', and to 0 if you
+   don't. */
+#undef HAVE_DECL_EXECVPE
+
+/* Define to 1 if you have the declaration of `fchdir', and to 0 if you don't.
+   */
+#undef HAVE_DECL_FCHDIR
+
+/* Define to 1 if you have the declaration of `fcloseall', and to 0 if you
+   don't. */
+#undef HAVE_DECL_FCLOSEALL
+
+/* Define to 1 if you have the declaration of `fcvt', and to 0 if you don't.
+   */
+#undef HAVE_DECL_FCVT
+
+/* Define to 1 if you have the declaration of `fdopendir', and to 0 if you
+   don't. */
+#undef HAVE_DECL_FDOPENDIR
+
 /* Define to 1 if you have the declaration of `feof_unlocked', and to 0 if you
    don't. */
 #undef HAVE_DECL_FEOF_UNLOCKED
    you don't. */
 #undef HAVE_DECL_FWRITE_UNLOCKED
 
+/* Define to 1 if you have the declaration of `gcvt', and to 0 if you don't.
+   */
+#undef HAVE_DECL_GCVT
+
 /* Define to 1 if you have the declaration of `getchar_unlocked', and to 0 if
    you don't. */
 #undef HAVE_DECL_GETCHAR_UNLOCKED
 
+/* Define to 1 if you have the declaration of `getcwd', and to 0 if you don't.
+   */
+#undef HAVE_DECL_GETCWD
+
 /* Define to 1 if you have the declaration of `getc_unlocked', and to 0 if you
    don't. */
 #undef HAVE_DECL_GETC_UNLOCKED
    don't. */
 #undef HAVE_DECL_GETDTABLESIZE
 
-/* Define to 1 if you have the declaration of `getenv', and to 0 if you don't.
-   */
-#undef HAVE_DECL_GETENV
+/* Define to 1 if you have the declaration of `inet_pton', and to 0 if you
+   don't. */
+#undef HAVE_DECL_INET_PTON
 
 /* Define to 1 if you have the declaration of `isblank', and to 0 if you
    don't. */
 #undef HAVE_DECL_ISBLANK
 
+/* Define to 1 if you have the declaration of `iswblank', and to 0 if you
+   don't. */
+#undef HAVE_DECL_ISWBLANK
+
 /* Define to 1 if you have the declaration of `mbrtowc', and to 0 if you
    don't. */
 #undef HAVE_DECL_MBRTOWC
    don't. */
 #undef HAVE_DECL_MBSINIT
 
+/* Define to 1 if you have the declaration of `memrchr', and to 0 if you
+   don't. */
+#undef HAVE_DECL_MEMRCHR
+
+/* Define to 1 if you have the declaration of `posix_spawn', and to 0 if you
+   don't. */
+#undef HAVE_DECL_POSIX_SPAWN
+
 /* Define to 1 if you have the declaration of `program_invocation_name', and
    to 0 if you don't. */
 #undef HAVE_DECL_PROGRAM_INVOCATION_NAME
    */
 #undef HAVE_DECL_SETENV
 
-/* Define to 1 if you have the declaration of `sigaltstack', and to 0 if you
-   don't. */
-#undef HAVE_DECL_SIGALTSTACK
-
 /* Define to 1 if you have the declaration of `sleep', and to 0 if you don't.
    */
 #undef HAVE_DECL_SLEEP
    don't. */
 #undef HAVE_DECL_WCRTOMB
 
+/* Define to 1 if you have the declaration of `wcsdup', and to 0 if you don't.
+   */
+#undef HAVE_DECL_WCSDUP
+
 /* Define to 1 if you have the declaration of `wctob', and to 0 if you don't.
    */
 #undef HAVE_DECL_WCTOB
 
+/* Define to 1 if you have the declaration of `wcwidth', and to 0 if you
+   don't. */
+#undef HAVE_DECL_WCWIDTH
+
+/* Define to 1 if you have the declaration of `_fseeki64', and to 0 if you
+   don't. */
+#undef HAVE_DECL__FSEEKI64
+
 /* Define to 1 if you have the declaration of `_putenv', and to 0 if you
    don't. */
 #undef HAVE_DECL__PUTENV
 /* Define to 1 if you have the `dirfd' function. */
 #undef HAVE_DIRFD
 
-/* Define to 1 if you have the 'dup2' function. */
-#undef HAVE_DUP2
+/* Define to 1 if you have the `duplocale' function. */
+#undef HAVE_DUPLOCALE
 
 /* Define if you have the declaration of environ. */
 #undef HAVE_ENVIRON_DECL
 
+/* Define to 1 if you have the `explicit_bzero' function. */
+#undef HAVE_EXPLICIT_BZERO
+
+/* Define to 1 if you have the `explicit_memset' function. */
+#undef HAVE_EXPLICIT_MEMSET
+
+/* Define to 1 if you have the `faccessat' function. */
+#undef HAVE_FACCESSAT
+
+/* Define if the locale_t type contains insufficient information, as on
+   OpenBSD. */
+#undef HAVE_FAKE_LOCALES
+
+/* Define to 1 if you have the `fchdir' function. */
+#undef HAVE_FCHDIR
+
 /* Define to 1 if you have the `fcntl' function. */
 #undef HAVE_FCNTL
 
+/* Define to 1 if you have the `fdopendir' function. */
+#undef HAVE_FDOPENDIR
+
 /* Define to 1 if you have the <features.h> header file. */
 #undef HAVE_FEATURES_H
 
 /* Define to 1 if you have the `fpurge' function. */
 #undef HAVE_FPURGE
 
+/* Define to 1 if you have the `freelocale' function. */
+#undef HAVE_FREELOCALE
+
+/* Define if the 'free' function is guaranteed to preserve errno. */
+#undef HAVE_FREE_POSIX
+
 /* Define if the frexpl function is available in libc. */
 #undef HAVE_FREXPL_IN_LIBC
 
 /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
 #undef HAVE_FSEEKO
 
+/* Define to 1 if you have the `fstatat' function. */
+#undef HAVE_FSTATAT
+
+/* Define to 1 if you have the `ftruncate' function. */
+#undef HAVE_FTRUNCATE
+
 /* Define to 1 if you have the `getcwd' function. */
 #undef HAVE_GETCWD
 
+/* Define to 1 if getcwd works, but with shorter paths than is generally
+   tested with the replacement. */
+#undef HAVE_GETCWD_SHORTER
+
 /* Define to 1 if you have the `getdtablesize' function. */
 #undef HAVE_GETDTABLESIZE
 
 /* Define to 1 if you have the `getopt_long_only' function. */
 #undef HAVE_GETOPT_LONG_ONLY
 
-/* Define to 1 if you have the `getpagesize' function. */
+/* Define to 1 if the system has the 'getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
 /* Define to 1 if you have the `getprogname' function. */
 #undef HAVE_GETPROGNAME
 
+/* Define to 1 if you have the `getrandom' function. */
+#undef HAVE_GETRANDOM
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
 /* Define to 1 if you have the `gettimeofday' function. */
 #undef HAVE_GETTIMEOFDAY
 
 /* Define to 1 if you have the `getuid' function. */
 #undef HAVE_GETUID
 
+/* Define if the uselocale exists, may be safely called, and returns
+   sufficient information. */
+#undef HAVE_GOOD_USELOCALE
+
+/* Define if you have the iconv() function and it works. */
+#undef HAVE_ICONV
+
+/* Define to 1 if you have the <iconv.h> header file. */
+#undef HAVE_ICONV_H
+
+/* Define to 1 if you have the `inet_pton' function. */
+#undef HAVE_INET_PTON
+
+/* Define to 1 if the compiler supports one of the keywords 'inline',
+   '__inline__', '__inline' and effectively inlines functions marked as such.
+   */
+#undef HAVE_INLINE
+
 /* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
 #undef HAVE_INTMAX_T
 
    declares uintmax_t. */
 #undef HAVE_INTTYPES_H_WITH_UINTMAX
 
+/* Define to 1 if you have the `ioctl' function. */
+#undef HAVE_IOCTL
+
+/* Define to 1 if <sys/socket.h> defines AF_INET. */
+#undef HAVE_IPV4
+
+/* Define to 1 if <sys/socket.h> defines AF_INET6. */
+#undef HAVE_IPV6
+
 /* Define to 1 if you have the `isblank' function. */
 #undef HAVE_ISBLANK
 
 /* Define to 1 if you have the `issetugid' function. */
 #undef HAVE_ISSETUGID
 
+/* Define to 1 if you have the `iswblank' function. */
+#undef HAVE_ISWBLANK
+
 /* Define to 1 if you have the `iswcntrl' function. */
 #undef HAVE_ISWCNTRL
 
 /* Define if you have the libsigsegv library. */
 #undef HAVE_LIBSIGSEGV
 
+/* Define to 1 if the bcrypt library is guaranteed to be present. */
+#undef HAVE_LIB_BCRYPT
+
 /* Define to 1 if you have the <limits.h> header file. */
 #undef HAVE_LIMITS_H
 
 /* Define to 1 if you have the `link' function. */
 #undef HAVE_LINK
 
-/* Define to 1 if the system has the type `long long int'. */
+/* Define to 1 if the system has the type 'long long int'. */
 #undef HAVE_LONG_LONG_INT
 
 /* Define to 1 if you have the `lstat' function. */
 /* Define to 1 if you have the <malloc.h> header file. */
 #undef HAVE_MALLOC_H
 
-/* Define if the 'malloc' function is POSIX compliant. */
+/* Define if malloc, realloc, and calloc set errno on allocation failure. */
 #undef HAVE_MALLOC_POSIX
 
 /* Define to 1 if mmap()'s MAP_ANONYMOUS flag is available after including
 /* Define to 1 if you have the `mbsinit' function. */
 #undef HAVE_MBSINIT
 
+/* Define to 1 if you have the `mbslen' function. */
+#undef HAVE_MBSLEN
+
 /* Define to 1 if <wchar.h> declares mbstate_t. */
 #undef HAVE_MBSTATE_T
 
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `mbtowc' function. */
+#undef HAVE_MBTOWC
 
 /* Define to 1 if you have the `mempcpy' function. */
 #undef HAVE_MEMPCPY
 
+/* Define to 1 if you have the `memrchr' function. */
+#undef HAVE_MEMRCHR
+
+/* Define to 1 if you have the `memset_s' function. */
+#undef HAVE_MEMSET_S
+
+/* Define to 1 if getcwd minimally works, that is, its result can be trusted
+   when it succeeds. */
+#undef HAVE_MINIMALLY_WORKING_GETCWD
+
+/* Define to 1 if you have the <minix/config.h> header file. */
+#undef HAVE_MINIX_CONFIG_H
+
 /* Define to 1 if <limits.h> defines the MIN and MAX macros. */
 #undef HAVE_MINMAX_IN_LIMITS_H
 
 /* Define to 1 if you have the `mprotect' function. */
 #undef HAVE_MPROTECT
 
+/* Define to 1 if you have the `mquery' function. */
+#undef HAVE_MQUERY
+
 /* Define to 1 on MSVC platforms that have the "invalid parameter handler"
    concept. */
 #undef HAVE_MSVC_INVALID_PARAMETER_HANDLER
 
+/* Define if the locale_t type does not contain the name of each locale
+   category. */
+#undef HAVE_NAMELESS_LOCALES
+
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
+
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
+
 /* Define to 1 if you have the `newlocale' function. */
 #undef HAVE_NEWLOCALE
 
 /* Define to 1 if the system has obstacks that work with any size object. */
 #undef HAVE_OBSTACK
 
+/* Define to 1 if you have the `openat' function. */
+#undef HAVE_OPENAT
+
 /* Define to 1 if you have the `opendir' function. */
 #undef HAVE_OPENDIR
 
 /* Define to 1 if you have the <OS.h> header file. */
 #undef HAVE_OS_H
 
+/* Define to 1 if getcwd works, except it sometimes fails when it shouldn't,
+   setting errno to ERANGE, ENAMETOOLONG, or ENOENT. */
+#undef HAVE_PARTLY_WORKING_GETCWD
+
 /* Define to 1 if you have the <paths.h> header file. */
 #undef HAVE_PATHS_H
 
 /* Define to 1 if the system has the type `posix_spawnattr_t'. */
 #undef HAVE_POSIX_SPAWNATTR_T
 
+/* Define to 1 if you have the `posix_spawn_file_actions_addchdir' function.
+   */
+#undef HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
+
+/* Define to 1 if you have the `posix_spawn_file_actions_addchdir_np'
+   function. */
+#undef HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR_NP
+
 /* Define to 1 if the system has the type `posix_spawn_file_actions_t'. */
 #undef HAVE_POSIX_SPAWN_FILE_ACTIONS_T
 
+/* Define to 1 if you have the `pstat_getprocvm' function. */
+#undef HAVE_PSTAT_GETPROCVM
+
+/* Define if you have the <pthread.h> header and the POSIX threads API. */
+#undef HAVE_PTHREAD_API
+
+/* Define to 1 if you have the `pthread_atfork' function. */
+#undef HAVE_PTHREAD_ATFORK
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
+
 /* Define if the <pthread.h> defines PTHREAD_MUTEX_RECURSIVE. */
 #undef HAVE_PTHREAD_MUTEX_RECURSIVE
 
 /* Define if the POSIX multithreading library has read/write locks. */
 #undef HAVE_PTHREAD_RWLOCK
 
+/* Define if the 'pthread_rwlock_rdlock' function prefers a writer to a
+   reader. */
+#undef HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+
+/* Define to 1 if the pthread_sigmask function can be used (despite bugs). */
+#undef HAVE_PTHREAD_SIGMASK
+
+/* Define to 1 if the system has the type `pthread_spinlock_t'. */
+#undef HAVE_PTHREAD_SPINLOCK_T
+
+/* Define to 1 if the system has the type `pthread_t'. */
+#undef HAVE_PTHREAD_T
+
 /* Define to 1 if you have the `raise' function. */
 #undef HAVE_RAISE
 
 /* Define to 1 if you have the `readlink' function. */
 #undef HAVE_READLINK
 
+/* Define to 1 if you have the `reallocarray' function. */
+#undef HAVE_REALLOCARRAY
+
 /* Define to 1 if you have the `realpath' function. */
 #undef HAVE_REALPATH
 
+/* Define to 1 if you have the `rewinddir' function. */
+#undef HAVE_REWINDDIR
+
 /* Define to 1 if 'long double' and 'double' have the same representation. */
 #undef HAVE_SAME_LONG_DOUBLE_AS_DOUBLE
 
+/* Define to 1 if the system has the type `sa_family_t'. */
+#undef HAVE_SA_FAMILY_T
+
 /* Define to 1 if you have the <sched.h> header file. */
 #undef HAVE_SCHED_H
 
 /* Define to 1 if you have the `sched_setscheduler' function. */
 #undef HAVE_SCHED_SETSCHEDULER
 
+/* Define to 1 if you have the <sdkddkver.h> header file. */
+#undef HAVE_SDKDDKVER_H
+
 /* Define to 1 if you have the <search.h> header file. */
 #undef HAVE_SEARCH_H
 
 /* Define to 1 if you have the `secure_getenv' function. */
 #undef HAVE_SECURE_GETENV
 
+/* Define to 1 if you have the <semaphore.h> header file. */
+#undef HAVE_SEMAPHORE_H
+
 /* Define to 1 if you have the `setdtablesize' function. */
 #undef HAVE_SETDTABLESIZE
 
 /* Define to 1 if you have the `seteuid' function. */
 #undef HAVE_SETEUID
 
-/* Define to 1 if you have the `setlocale' function. */
-#undef HAVE_SETLOCALE
-
 /* Define to 1 if you have the `setrlimit' function. */
 #undef HAVE_SETRLIMIT
 
+/* Define to 1 if you have the `shutdown' function. */
+#undef HAVE_SHUTDOWN
+
 /* Define to 1 if you have the `sigaction' function. */
 #undef HAVE_SIGACTION
 
    buffer had been large enough. */
 #undef HAVE_SNPRINTF_RETVAL_C99
 
-/* Define to 1 if you have the <spawn.h> header file. */
-#undef HAVE_SPAWN_H
+/* Define if the string produced by the snprintf function is always NUL
+   terminated. */
+#undef HAVE_SNPRINTF_TRUNCATION_C99
 
-/* Define to 1 if extending the stack slightly past the limit causes a SIGSEGV
-   which can be handled on an alternate stack established with sigaltstack. */
-#undef HAVE_STACK_OVERFLOW_HANDLING
+/* Define if the locale_t type is as on Solaris 11.4. */
+#undef HAVE_SOLARIS114_LOCALES
 
-/* Define to 1 if the system has the type `stack_t'. */
-#undef HAVE_STACK_T
+/* Define to 1 if you have the <spawn.h> header file. */
+#undef HAVE_SPAWN_H
 
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 /* Define to 1 if you have the <stdio_ext.h> header file. */
 #undef HAVE_STDIO_EXT_H
 
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
 /* Define to 1 if you have the <stdlib.h> header file. */
 #undef HAVE_STDLIB_H
 
+/* Define to 1 if you have the `stpcpy' function. */
+#undef HAVE_STPCPY
+
 /* Define to 1 if you have the `strchrnul' function. */
 #undef HAVE_STRCHRNUL
 
-/* Define to 1 if you have the `strdup' function. */
-#undef HAVE_STRDUP
-
 /* Define to 1 if you have the `strerror_r' function. */
 #undef HAVE_STRERROR_R
 
 /* Define to 1 if `sa_sigaction' is a member of `struct sigaction'. */
 #undef HAVE_STRUCT_SIGACTION_SA_SIGACTION
 
+/* Define to 1 if the system has the type `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE
+
+/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
+#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
+
+/* Define to 1 if `st_atimensec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIMENSEC
+
+/* Define to 1 if `st_atimespec.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
+
+/* Define to 1 if `st_atim.st__tim.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
+
+/* Define to 1 if `st_atim.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
+
+/* Define to 1 if `st_birthtimensec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+
+/* Define to 1 if `st_birthtimespec.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
+
+/* Define to 1 if `st_birthtim.tv_nsec' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC
+
 /* Define to 1 if you have the `symlink' function. */
 #undef HAVE_SYMLINK
 
 /* Define to 1 if you have the <sys/inttypes.h> header file. */
 #undef HAVE_SYS_INTTYPES_H
 
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
+
 /* Define to 1 if you have the <sys/mman.h> header file. */
 #undef HAVE_SYS_MMAN_H
 
 /* Define to 1 if you have the <sys/param.h> header file. */
 #undef HAVE_SYS_PARAM_H
 
+/* Define to 1 if you have the <sys/random.h> header file. */
+#undef HAVE_SYS_RANDOM_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/single_threaded.h> header file. */
+#undef HAVE_SYS_SINGLE_THREADED_H
+
 /* Define to 1 if you have the <sys/socket.h> header file. */
 #undef HAVE_SYS_SOCKET_H
 
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
-/* Define to 1 if you have the <sys/timeb.h> header file. */
-#undef HAVE_SYS_TIMEB_H
-
 /* Define to 1 if you have the <sys/time.h> header file. */
 #undef HAVE_SYS_TIME_H
 
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the <sys/uio.h> header file. */
+#undef HAVE_SYS_UIO_H
+
 /* Define to 1 if you have the <sys/wait.h> header file. */
 #undef HAVE_SYS_WAIT_H
 
+/* Define to 1 if you have the `thrd_create' function. */
+#undef HAVE_THRD_CREATE
+
+/* Define to 1 if you have the <threads.h> header file. */
+#undef HAVE_THREADS_H
+
 /* Define to 1 if you have the `towlower' function. */
 #undef HAVE_TOWLOWER
 
 /* Define to 1 if you have the `tsearch' function. */
 #undef HAVE_TSEARCH
 
-/* Define to 1 if you have the <ucontext.h> header file. */
-#undef HAVE_UCONTEXT_H
-
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
 /* Define to 1 if you have the `vfork' function. */
 #undef HAVE_VFORK
 
+/* Define to 1 or 0, depending whether the compiler supports simple visibility
+   declarations. */
+#undef HAVE_VISIBILITY
+
 /* Define to 1 if you have the `waitid' function. */
 #undef HAVE_WAITID
 
 /* Define to 1 if you have the <wctype.h> header file. */
 #undef HAVE_WCTYPE_H
 
+/* Define to 1 if you have the `wcwidth' function. */
+#undef HAVE_WCWIDTH
+
+/* Define to 1 if the compiler and linker support weak declarations of
+   symbols. */
+#undef HAVE_WEAK_SYMBOLS
+
 /* Define to 1 if you have the <winsock2.h> header file. */
 #undef HAVE_WINSOCK2_H
 
 /* Define if you have the 'wint_t' type. */
 #undef HAVE_WINT_T
 
+/* Define to 1 if fstatat (..., 0) works. For example, it does not work in AIX
+   7.1. */
+#undef HAVE_WORKING_FSTATAT_ZERO_FLAG
+
 /* Define to 1 if O_NOATIME works. */
 #undef HAVE_WORKING_O_NOATIME
 
 /* Define to 1 if O_NOFOLLOW works. */
 #undef HAVE_WORKING_O_NOFOLLOW
 
-/* Define if you have the posix_spawn and posix_spawnp functions and they
-   work. */
-#undef HAVE_WORKING_POSIX_SPAWN
+/* Define if you have the sigaltstack() function and it works. */
+#undef HAVE_WORKING_SIGALTSTACK
+
+/* Define if the uselocale function exists and may safely be called. */
+#undef HAVE_WORKING_USELOCALE
+
+/* Define to 1 if you have the <ws2tcpip.h> header file. */
+#undef HAVE_WS2TCPIP_H
 
 /* Define to 1 if you have the <xlocale.h> header file. */
 #undef HAVE_XLOCALE_H
 
-/* Define to 1 if extending the stack slightly past the limit causes a
-   SIGSEGV, and an alternate stack can be established with sigaltstack, and
-   the signal handler is passed a context that specifies the run time stack.
-   This behavior is defined by POSIX 1003.1-2001 with the X/Open System
-   Interface (XSI) option and is a standardized way to implement a SEGV-based
-   stack overflow detection heuristic. */
-#undef HAVE_XSI_STACK_OVERFLOW_HEURISTIC
-
 /* Define to 1 if the system has the type `_Bool'. */
 #undef HAVE__BOOL
 
+/* Define to 1 if you have the `_chsize' function. */
+#undef HAVE__CHSIZE
+
 /* Define to 1 if you have the `_fseeki64' function. */
 #undef HAVE__FSEEKI64
 
 /* Define to 1 if you have the `_ftelli64' function. */
 #undef HAVE__FTELLI64
 
-/* Define to 1 if you have the `_ftime' function. */
-#undef HAVE__FTIME
-
 /* Define to 1 if you have the `_set_invalid_parameter_handler' function. */
 #undef HAVE__SET_INVALID_PARAMETER_HANDLER
 
 /* Define to 1 if you have the `__freading' function. */
 #undef HAVE___FREADING
 
+/* Define to 1 if the compiler supports the keyword '__inline'. */
+#undef HAVE___INLINE
+
 /* Define to 1 if you have the `__secure_getenv' function. */
 #undef HAVE___SECURE_GETENV
 
+/* Define to 1 if you have the `__xpg_strerror_r' function. */
+#undef HAVE___XPG_STRERROR_R
+
+/* Define as const if the declaration of iconv() needs const. */
+#undef ICONV_CONST
+
+/* Define to a symbolic name denoting the flavor of iconv_open()
+   implementation. */
+#undef ICONV_FLAVOR
+
 /* Define as the bit index in the word where to find bit 0 of the exponent of
    'long double'. */
 #undef LDBL_EXPBIT0_BIT
 /* Define as the word index where to find the sign of 'long double'. */
 #undef LDBL_SIGNBIT_WORD
 
+/* Define if localename.c overrides newlocale(), duplocale(), freelocale(). */
+#undef LOCALENAME_ENHANCE_LOCALE_FUNCS
+
 /* Define to 1 if lseek does not detect pipes. */
 #undef LSEEK_PIPE_BROKEN
 
    */
 #undef MBRTOWC_EMPTY_INPUT_BUG
 
+/* Define if the mbrtowc function may signal encoding errors in the C locale.
+   */
+#undef MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ
+
 /* Define if the mbrtowc function has the NULL pwc argument bug. */
 #undef MBRTOWC_NULL_ARG1_BUG
 
 /* Define if the mbrtowc function returns a wrong return value. */
 #undef MBRTOWC_RETVAL_BUG
 
+/* Define if the mbrtowc function stores a wide character when reporting
+   incomplete input. */
+#undef MBRTOWC_STORES_INCOMPLETE_BUG
+
 /* Use GNU style printf and scanf.  */
 #ifndef __USE_MINGW_ANSI_STDIO
 # undef __USE_MINGW_ANSI_STDIO
 #endif
 
 
+/* Define to 1 on musl libc. */
+#undef MUSL_LIBC
+
 /* Define to 1 if assertions should be disabled. */
 #undef NDEBUG
 
    large precisions without arbitrary bounds. */
 #undef NEED_PRINTF_UNBOUNDED_PRECISION
 
+/* Define to 1 to enable general improvements of setlocale. */
+#undef NEED_SETLOCALE_IMPROVED
+
+/* Define to 1 to enable a multithread-safety fix of setlocale. */
+#undef NEED_SETLOCALE_MTSAFE
+
+/* Define to 1 if nl_langinfo is multithread-safe. */
+#undef NL_LANGINFO_MTSAFE
+
 /* Define to 1 if open() fails to recognize a trailing slash. */
 #undef OPEN_TRAILING_SLASH_BUG
 
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
-/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
-#undef PRI_MACROS_BROKEN
-
 /* Define to the type that is the result of default argument promotions of
    type mode_t. */
 #undef PROMOTED_MODE_T
 
+/* Define if pthread_create is an inline function. */
+#undef PTHREAD_CREATE_IS_INLINE
+
 /* Define if the pthread_in_use() detection is hard. */
 #undef PTHREAD_IN_USE_DETECTION_HARD
 
+/* Define to 1 if pthread_sigmask(), when it fails, returns -1 and sets errno.
+   */
+#undef PTHREAD_SIGMASK_FAILS_WITH_ERRNO
+
+/* Define to 1 if pthread_sigmask may return 0 and have no effect. */
+#undef PTHREAD_SIGMASK_INEFFECTIVE
+
+/* Define to 1 if pthread_sigmask() unblocks signals incorrectly. */
+#undef PTHREAD_SIGMASK_UNBLOCK_BUG
+
 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
    'ptrdiff_t'. */
 #undef PTRDIFF_T_SUFFIX
 /* Define to 1 if readlink fails to recognize a trailing slash. */
 #undef READLINK_TRAILING_SLASH_BUG
 
+/* Define to 1 if readlink sets errno instead of truncating a too-long link.
+   */
+#undef READLINK_TRUNCATE_BUG
+
 /* Define if rename does not work when the destination file exists, as on
    Cygwin 1.5 or Windows. */
 #undef RENAME_DEST_EXISTS_BUG
 #undef RENAME_OPEN_FILE_WORKS
 
 /* Define if rename does not correctly handle slashes on the destination
-   argument, such as on Solaris 10 or NetBSD 1.6. */
+   argument, such as on Solaris 11 or NetBSD 1.6. */
 #undef RENAME_TRAILING_SLASH_DEST_BUG
 
 /* Define if rename does not correctly handle slashes on the source argument,
 /* Define to 1 if gnulib's dirfd() replacement is used. */
 #undef REPLACE_DIRFD
 
-/* Define to 1 if stat needs help when passed a directory name with a trailing
-   slash */
-#undef REPLACE_FUNC_STAT_DIR
+/* Define to 1 if gnulib's fchdir() replacement is used. */
+#undef REPLACE_FCHDIR
 
 /* Define to 1 if stat needs help when passed a file name with a trailing
    slash */
 /* Define if nl_langinfo exists but is overridden by gnulib. */
 #undef REPLACE_NL_LANGINFO
 
+/* Define to 1 if open() should work around the inability to open a directory.
+   */
+#undef REPLACE_OPEN_DIRECTORY
+
+/* Define if gnulib uses its own posix_spawn and posix_spawnp functions. */
+#undef REPLACE_POSIX_SPAWN
+
 /* Define to 1 if strerror(0) does not return a message implying success. */
 #undef REPLACE_STRERROR_0
 
 /* Define if vasnprintf exists but is overridden by gnulib. */
 #undef REPLACE_VASNPRINTF
 
+/* Define to 1 if setlocale (LC_ALL, NULL) is multithread-safe. */
+#undef SETLOCALE_NULL_ALL_MTSAFE
+
+/* Define to 1 if setlocale (category, NULL) is multithread-safe. */
+#undef SETLOCALE_NULL_ONE_MTSAFE
+
+/* File name of the Bourne shell.  */
+#if (defined _WIN32 && !defined __CYGWIN__) || defined __CYGWIN__ || defined __ANDROID__
+/* Omit the directory part because
+   - For native Windows programs in a Cygwin environment, the Cygwin mounts
+     are not visible.
+   - For 32-bit Cygwin programs in a 64-bit Cygwin environment, the Cygwin
+     mounts are not visible.
+   - On Android, /bin/sh does not exist. It's /system/bin/sh instead.  */
+# define BOURNE_SHELL "sh"
+#else
+# define BOURNE_SHELL "/bin/sh"
+#endif
+
 /* Define if sigaltstack() interprets the stack_t.ss_sp field incorrectly, as
    the highest address of the alternate stack range rather than as the lowest
    address. */
    'size_t'. */
 #undef SIZE_T_SUFFIX
 
-/* If using the C implementation of alloca, define if you know the
-   direction of stack growth for your system; otherwise it will be
-   automatically deduced at runtime.
-       STACK_DIRECTION > 0 => grows toward higher addresses
-       STACK_DIRECTION < 0 => grows toward lower addresses
-       STACK_DIRECTION = 0 => direction of growth unknown */
+/* Define on Solaris 11 and its derivates. */
+#undef SOLARIS11
+
+/* Define as the direction of stack growth for your system. STACK_DIRECTION >
+   0 => grows toward higher addresses STACK_DIRECTION < 0 => grows toward
+   lower addresses STACK_DIRECTION = 0 => spaghetti stack. */
 #undef STACK_DIRECTION
 
 /* Define to 1 if the `S_IS*' macros in <sys/stat.h> do not work properly. */
 #undef STAT_MACROS_BROKEN
 
-/* Define to 1 if you have the ANSI C header files. */
+/* Define to 1 if all of the C90 standard headers exist (not just the ones
+   required in a freestanding environment). This macro is provided for
+   backward compatibility; new code need not use it. */
 #undef STDC_HEADERS
 
 /* Define to 1 if strerror_r returns char *. */
 /* Shell used by syscmd and esyscmd, must accept -c argument. */
 #undef SYSCMD_SHELL
 
+/* Define to 1 if the type of the st_atim member of a struct stat is struct
+   timespec. */
+#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
+
 /* Define to the prefix of C symbols at the assembler and linker level, either
    an underscore or empty. */
 #undef USER_LABEL_PREFIX
 
+/* Define if the combination of the ISO C and POSIX multithreading APIs can be
+   used. */
+#undef USE_ISOC_AND_POSIX_THREADS
+
+/* Define if the ISO C multithreading library can be used. */
+#undef USE_ISOC_THREADS
+
 /* Define if the POSIX multithreading library can be used. */
 #undef USE_POSIX_THREADS
 
    weak. */
 #undef USE_POSIX_THREADS_WEAK
 
-/* Define if the GNU Pth multithreading library can be used. */
-#undef USE_PTH_THREADS
-
-/* Define if references to the GNU Pth multithreading library should be made
-   weak. */
-#undef USE_PTH_THREADS_WEAK
-
-/* Define if the old Solaris multithreading library can be used. */
-#undef USE_SOLARIS_THREADS
-
-/* Define if references to the old Solaris multithreading library should be
-   made weak. */
-#undef USE_SOLARIS_THREADS_WEAK
-
 /* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
-/* Enable threading extensions on Solaris.  */
+/* Enable X/Open compliant socket functions that do not require linking
+   with -lxnet on HP-UX 11.11.  */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# undef _HPUX_ALT_XOPEN_SOCKET_API
+#endif
+/* Identify the host operating system as Minix.
+   This macro does not affect the system headers' behavior.
+   A future release of Autoconf may stop defining this macro.  */
+#ifndef _MINIX
+# undef _MINIX
+#endif
+/* Enable general extensions on NetBSD.
+   Enable NetBSD compatibility extensions on Minix.  */
+#ifndef _NETBSD_SOURCE
+# undef _NETBSD_SOURCE
+#endif
+/* Enable OpenBSD compatibility extensions on NetBSD.
+   Oddly enough, this does nothing on OpenBSD.  */
+#ifndef _OPENBSD_SOURCE
+# undef _OPENBSD_SOURCE
+#endif
+/* Define to 1 if needed for POSIX-compatible behavior.  */
+#ifndef _POSIX_SOURCE
+# undef _POSIX_SOURCE
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior.  */
+#ifndef _POSIX_1_SOURCE
+# undef _POSIX_1_SOURCE
+#endif
+/* Enable POSIX-compatible threading on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
 #endif
-/* Enable X/Open extensions if necessary.  HP-UX 11.11 defines
-   mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
-   whether compiling with -Ae or -D_HPUX_SOURCE=1.  */
+/* Enable X/Open extensions.  Define to 500 only if necessary
+   to make mbstate_t available.  */
 #ifndef _XOPEN_SOURCE
 # undef _XOPEN_SOURCE
 #endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
 
 
-/* Define to 1 if you want getc etc. to use unlocked I/O if available.
-   Unlocked I/O can improve performance in unithreaded apps, but it is not
-   safe for multithreaded apps. */
+/* An alias of GNULIB_STDIO_SINGLE_THREAD. */
 #undef USE_UNLOCKED_IO
 
 /* Define if the native Windows multithreading API can be used. */
    'wchar_t'. */
 #undef WCHAR_T_SUFFIX
 
+/* Define if the wcrtomb function does not work in the C locale. */
+#undef WCRTOMB_C_LOCALE_BUG
+
+/* Define if the wcrtomb function has an incorrect return value. */
+#undef WCRTOMB_RETVAL_BUG
+
+/* Define if WSAStartup is needed. */
+#undef WINDOWS_SOCKETS
+
 /* Define to l, ll, u, ul, ull, etc., as suitable for constants of type
    'wint_t'. */
 #undef WINT_T_SUFFIX
 # endif
 #endif
 
-/* Enable large inode numbers on Mac OS X 10.5. */
-#undef _DARWIN_USE_64_BIT_INODE
-
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 
-/* Define to 1 if Gnulib overrides 'struct stat' on Windows so that struct
-   stat.st_size becomes 64-bit. */
-#undef _GL_WINDOWS_64_BIT_ST_SIZE
+/* True if the compiler says it groks GNU C version MAJOR.MINOR.  */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define _GL_GNUC_PREREQ(major, minor) \
+    ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#else
+# define _GL_GNUC_PREREQ(major, minor) 0
+#endif
+
+
+/* Define to enable the declarations of ISO C 11 types and functions. */
+#undef _ISOC11_SOURCE
 
 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
 #undef _LARGEFILE_SOURCE
 /* Define to 1 on Solaris. */
 #undef _LCONV_C99
 
-/* Define to 1 if on MINIX. */
-#undef _MINIX
-
-/* Define to 1 to make NetBSD features available. MINIX 3 needs this. */
-#undef _NETBSD_SOURCE
-
 /* The _Noreturn keyword of C11.  */
-#if ! (defined _Noreturn \
-       || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
-      || 0x5110 <= __SUNPRO_C)
+#ifndef _Noreturn
+# if (defined __cplusplus \
+      && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+          || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+      && 0)
+    /* [[noreturn]] is not practically usable, because with it the syntax
+         extern _Noreturn void func (...);
+       would not be valid; such a declaration would only be valid with 'extern'
+       and '_Noreturn' swapped, or without the 'extern' keyword.  However, some
+       AIX system header files and several gnulib header files use precisely
+       this syntax with 'extern'.  */
+#  define _Noreturn [[noreturn]]
+# elif ((!defined __cplusplus || defined __clang__) \
+        && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+            || (!defined __STRICT_ANSI__ \
+                && (_GL_GNUC_PREREQ (4, 7) \
+                    || (defined __apple_build_version__ \
+                        ? 6000000 <= __apple_build_version__ \
+                        : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+   /* _Noreturn works as-is.  */
+# elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
 #  define _Noreturn __attribute__ ((__noreturn__))
-# elif defined _MSC_VER && 1200 <= _MSC_VER
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
 #  define _Noreturn __declspec (noreturn)
 # else
 #  define _Noreturn
 #endif
 
 
-/* Define to 2 if the system does not provide POSIX.1 features except with
-   this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define to 1 if you need to in order for 'stat' and other things to work. */
-#undef _POSIX_SOURCE
+/* Define to 1 in order to get the POSIX compatible declarations of socket
+   functions. */
+#undef _POSIX_PII_SOCKET
 
 /* Define if you want <regex.h> to include <limits.h>, so that it consistently
    overrides <limits.h>'s RE_DUP_MAX. */
 /* Define if you want regoff_t to be at least as wide POSIX requires. */
 #undef _REGEX_LARGE_OFFSETS
 
+/* For standard stat data types on VMS. */
+#undef _USE_STD_STAT
+
 /* Define to rpl_ if the getopt replacement functions and variables should be
    used. */
 #undef __GETOPT_PREFIX
 /* Define to 1 if the system <stdint.h> predates C++11. */
 #undef __STDC_LIMIT_MACROS
 
+/* The _GL_ASYNC_SAFE marker should be attached to functions that are
+   signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
+   invoked from such signal handlers.  Such functions have some restrictions:
+     * All functions that it calls should be marked _GL_ASYNC_SAFE as well,
+       or should be listed as async-signal-safe in POSIX
+       <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
+       section 2.4.3.  Note that malloc(), sprintf(), and fwrite(), in
+       particular, are NOT async-signal-safe.
+     * All memory locations (variables and struct fields) that these functions
+       access must be marked 'volatile'.  This holds for both read and write
+       accesses.  Otherwise the compiler might optimize away stores to and
+       reads from such locations that occur in the program, depending on its
+       data flow analysis.  For example, when the program contains a loop
+       that is intended to inspect a variable set from within a signal handler
+           while (!signal_occurred)
+             ;
+       the compiler is allowed to transform this into an endless loop if the
+       variable 'signal_occurred' is not declared 'volatile'.
+   Additionally, recall that:
+     * A signal handler should not modify errno (except if it is a handler
+       for a fatal signal and ends by raising the same signal again, thus
+       provoking the termination of the process).  If it invokes a function
+       that may clobber errno, it needs to save and restore the value of
+       errno.  */
+#define _GL_ASYNC_SAFE
+
+
+/* Attributes.  */
+#if (defined __has_attribute \
+     && (!defined __clang_minor__ \
+         || 3 < __clang_major__ + (5 <= __clang_minor__)))
+# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
+#else
+# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
+# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
+# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_diagnose_if 0
+# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
+# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
+# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
+# ifdef _ICC
+#  define _GL_ATTR_may_alias 0
+# else
+#  define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# endif
+# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
+# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
+# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
+# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
+# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
+# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
+#endif
+
+
+#if _GL_HAS_ATTRIBUTE (alloc_size)
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
+#else
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (always_inline)
+# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
+#else
+# define _GL_ATTRIBUTE_ALWAYS_INLINE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (artificial)
+# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
+#else
+# define _GL_ATTRIBUTE_ARTIFICIAL
+#endif
+
+/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
+   <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
+   Also, Oracle Studio 12.6 requires 'cold' not '__cold__'.  */
+#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
+# ifndef __SUNPRO_C
+#  define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# else
+#  define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+# endif
+#else
+# define _GL_ATTRIBUTE_COLD
+#endif
+
+#if _GL_HAS_ATTRIBUTE (const)
+# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
+#else
+# define _GL_ATTRIBUTE_CONST
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
+#elif _GL_HAS_ATTRIBUTE (deprecated)
+# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+#else
+# define _GL_ATTRIBUTE_DEPRECATED
+#endif
+
+#if _GL_HAS_ATTRIBUTE (error)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
+#elif _GL_HAS_ATTRIBUTE (diagnose_if)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+#else
+# define _GL_ATTRIBUTE_ERROR(msg)
+# define _GL_ATTRIBUTE_WARNING(msg)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (externally_visible)
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
+#else
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+#endif
+
+/* FALLTHROUGH is special, because it always expands to something.  */
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
+#elif _GL_HAS_ATTRIBUTE (fallthrough)
+# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
+#else
+# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (format)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (leaf)
+# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
+#else
+# define _GL_ATTRIBUTE_LEAF
+#endif
+
+/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK.  */
+#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
+# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
+#else
+# define _GL_ATTRIBUTE_MAY_ALIAS
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+#elif _GL_HAS_ATTRIBUTE (unused)
+# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
+#else
+# define _GL_ATTRIBUTE_MAYBE_UNUSED
+#endif
+/* Earlier spellings of this macro.  */
+#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
+
+#if _GL_HAS_ATTRIBUTE (malloc)
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#else
+# define _GL_ATTRIBUTE_MALLOC
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+#elif _GL_HAS_ATTRIBUTE (warn_unused_result)
+# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
+#else
+# define _GL_ATTRIBUTE_NODISCARD
+#endif
+
+#if _GL_HAS_ATTRIBUTE (noinline)
+# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
+#else
+# define _GL_ATTRIBUTE_NOINLINE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (nonnull)
+# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
+#else
+# define _GL_ATTRIBUTE_NONNULL(args)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (nonstring)
+# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
+#else
+# define _GL_ATTRIBUTE_NONSTRING
+#endif
+
+/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead.  */
+
+#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+#else
+# define _GL_ATTRIBUTE_NOTHROW
+#endif
+
+#if _GL_HAS_ATTRIBUTE (packed)
+# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
+#else
+# define _GL_ATTRIBUTE_PACKED
+#endif
+
+#if _GL_HAS_ATTRIBUTE (pure)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (returns_nonnull)
+# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+#else
+# define _GL_ATTRIBUTE_RETURNS_NONNULL
+#endif
+
+#if _GL_HAS_ATTRIBUTE (sentinel)
+# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
+#else
+# define _GL_ATTRIBUTE_SENTINEL(pos)
+#endif
+
+
+/* To support C++ as well as C, use _GL_UNUSED_LABEL with trailing ';'.  */
+#if !defined __cplusplus || _GL_GNUC_PREREQ (4, 5)
+# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_MAYBE_UNUSED
+#else
+# define _GL_UNUSED_LABEL
+#endif
+
+
+/* Define as 'access' if you don't have the eaccess() function. */
+#undef eaccess
+
 /* Please see the Gnulib manual for how to use these macros.
 
    Suppress extern inline with HP-UX cc, as it appears to be broken; see
-   <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+   <https://lists.gnu.org/r/bug-texinfo/2013-02/msg00030.html>.
 
    Suppress extern inline with Sun C in standards-conformance mode, as it
    mishandles inline functions that call each other.  E.g., for 'inline void f
    if isdigit is mistakenly implemented via a static inline function,
    a program containing an extern inline function that calls isdigit
    may not work since the C standard prohibits extern inline functions
-   from calling static functions.  This bug is known to occur on:
+   from calling static functions (ISO C 99 section 6.7.4.(3).
+   This bug is known to occur on:
 
      OS X 10.8 and earlier; see:
-     http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+     https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
 
      DragonFly; see
-     http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+     http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log
 
      FreeBSD; see:
-     http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
+     https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
 
    OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
-   for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
-   Assume DragonFly and FreeBSD will be similar.  */
+   for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
+   Assume DragonFly and FreeBSD will be similar.
+
+   GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+   inline semantics, unless -fgnu89-inline is used.  It defines a macro
+   __GNUC_STDC_INLINE__ to indicate this situation or a macro
+   __GNUC_GNU_INLINE__ to indicate the opposite situation.
+   GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
+   semantics but warns, unless -fgnu89-inline is used:
+     warning: C99 inline functions are not supported; using GNU89
+     warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
+   It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
+ */
 #if (((defined __APPLE__ && defined __MACH__) \
       || defined __DragonFly__ || defined __FreeBSD__) \
      && (defined __header_inline \
 /* Define to a type if <wchar.h> does not define. */
 #undef mbstate_t
 
+/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where
+   n1 and n2 are expressions without side effects, that evaluate to real
+   numbers (excluding NaN).
+   It returns
+     1  if n1 > n2
+     0  if n1 == n2
+     -1 if n1 < n2
+   The naïve code   (n1 > n2 ? 1 : n1 < n2 ? -1 : 0)  produces a conditional
+   jump with nearly all GCC versions up to GCC 10.
+   This variant     (n1 < n2 ? -1 : n1 > n2)  produces a conditional with many
+   GCC versions up to GCC 9.
+   The better code  (n1 > n2) - (n1 < n2)  from Hacker's Delight § 2-9
+   avoids conditional jumps in all GCC versions >= 3.4.  */
+#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
+
+
 /* Define to `int' if <sys/types.h> does not define. */
 #undef mode_t
 
 /* Define to the type of st_nlink in struct stat, or a supertype. */
 #undef nlink_t
 
-/* Define to `int' if <sys/types.h> does not define. */
+/* Define to `long int' if <sys/types.h> does not define. */
+#undef off_t
+
+/* Define as a signed integer type capable of holding a process identifier. */
 #undef pid_t
 
 /* Define as the type of the result of subtracting two pointers, if the system
 
 /* Define to the equivalent of the C99 'restrict' keyword, or to
    nothing if this is not supported.  Do not define if restrict is
-   supported directly.  */
+   supported only directly.  */
 #undef restrict
-/* Work around a bug in Sun C++: it does not support _Restrict or
-   __restrict__, even though the corresponding Sun C compiler ends up with
-   "#define restrict _Restrict" or "#define restrict __restrict__" in the
-   previous line.  Perhaps some future version of Sun C++ will work with
-   restrict; if so, hopefully it defines __RESTRICT like Sun C does.  */
-#if defined __SUNPRO_CC && !defined __RESTRICT
+/* Work around a bug in older versions of Sun C++, which did not
+   #define __restrict__ or support _Restrict or __restrict__
+   even though the corresponding Sun C compiler ended up with
+   "#define restrict _Restrict" or "#define restrict __restrict__"
+   in the previous line.  This workaround can be removed once
+   we assume Oracle Developer Studio 12.5 (2016) or later.  */
+#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
 # define _Restrict
 # define __restrict__
 #endif
 /* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
 
+/* type to use in place of socklen_t if not defined */
+#undef socklen_t
+
 /* Define as a signed type of the same size as size_t. */
 #undef ssize_t
 
+/* Define to 'struct sigaltstack' if that's the type of the argument to
+   sigaltstack */
+#undef stack_t
+
 /* Define to `int' if <sys/types.h> doesn't define. */
 #undef uid_t
 
-/* Define as a marker that can be attached to declarations that might not
-    be used.  This helps to reduce warnings, such as from
-    GCC -Wunused-parameter.  */
-#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_UNUSED __attribute__ ((__unused__))
-#else
-# define _GL_UNUSED
-#endif
-/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
-   is a misnomer outside of parameter lists.  */
-#define _UNUSED_PARAMETER_ _GL_UNUSED
-
-/* gcc supports the "unused" attribute on possibly unused labels, and
-   g++ has since version 4.5.  Note to support C++ as well as C,
-   _GL_UNUSED_LABEL should be used with a trailing ;  */
-#if !defined __cplusplus || __GNUC__ > 4 \
-    || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-# define _GL_UNUSED_LABEL _GL_UNUSED
-#else
-# define _GL_UNUSED_LABEL
-#endif
-
-/* The __pure__ attribute was added in gcc 2.96.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
-#endif
-
-/* The __const__ attribute was added in gcc 2.95.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-# define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
-#else
-# define _GL_ATTRIBUTE_CONST /* empty */
-#endif
-
-
 /* Define as a macro for copying va_list variables. */
 #undef va_copy
similarity index 84%
rename from tests/dirent-private.h
rename to lib/dirent-private.h
index 9b200f3..eaba1b9 100644 (file)
@@ -1,5 +1,5 @@
 /* Private details of the DIR type.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _DIRENT_PRIVATE_H
 #define _DIRENT_PRIVATE_H 1
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
+/* Don't assume that UNICODE is not defined.  */
+#undef WIN32_FIND_DATA
+#define WIN32_FIND_DATA WIN32_FIND_DATAA
+
 struct gl_directory
 {
   /* Status, or error code to produce in next readdir() call.
similarity index 94%
rename from tests/dirent.in.h
rename to lib/dirent.in.h
index 65482d7..4666972 100644 (file)
@@ -1,5 +1,5 @@
 /* A GNU-like <dirent.h>.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _@GUARD_PREFIX@_DIRENT_H
 
@@ -57,10 +57,12 @@ typedef struct gl_directory DIR;
 
 /* The __attribute__ feature is available in gcc versions 2.5 and later.
    The attribute __pure__ was added in gcc 2.96.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+#  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+#  define _GL_ATTRIBUTE_PURE /* empty */
+# endif
 #endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
@@ -152,7 +154,8 @@ _GL_WARN_ON_USE (closedir, "closedir is not portable - "
 /* Return the file descriptor associated with the given directory stream,
    or -1 if none exists.  */
 # if @REPLACE_DIRFD@
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+/* On kLIBC, dirfd() is a macro that does not work.  Undefine it.  */
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE) || defined dirfd
 #   undef dirfd
 #   define dirfd rpl_dirfd
 #  endif
similarity index 93%
rename from tests/dirfd.c
rename to lib/dirfd.c
index a325848..ced7531 100644 (file)
@@ -1,6 +1,6 @@
 /* dirfd.c -- return the file descriptor associated with an open DIR*
 
-   Copyright (C) 2001, 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering. */
 
index a7aabf9..cfdac03 100644 (file)
@@ -1,6 +1,6 @@
 /* dirname.c -- return all but the last element in a file name
 
-   Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2016 Free Software
+   Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 07aac13..d8b07d3 100644 (file)
@@ -1,6 +1,6 @@
 /* dirname.c -- return all but the last element in a file name
 
-   Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2016 Free Software
+   Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 875b31b..25116ab 100644 (file)
@@ -1,6 +1,6 @@
 /*  Take file names apart into directory and base names.
 
-    Copyright (C) 1998, 2001, 2003-2006, 2009-2016 Free Software Foundation,
+    Copyright (C) 1998, 2001, 2003-2006, 2009-2021 Free Software Foundation,
     Inc.
 
     This program is free software: you can redistribute it and/or modify
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef DIRNAME_H_
 # define DIRNAME_H_ 1
 
 # include <stdbool.h>
 # include <stddef.h>
-# include "dosname.h"
+# include "filename.h"
+# include "basename-lgpl.h"
 
 # ifndef DIRECTORY_SEPARATOR
 #  define DIRECTORY_SEPARATOR '/'
 # endif
 
-# ifndef DOUBLE_SLASH_IS_DISTINCT_ROOT
-#  define DOUBLE_SLASH_IS_DISTINCT_ROOT 0
-# endif
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 # if GNULIB_DIRNAME
-char *base_name (char const *file);
+char *base_name (char const *file) _GL_ATTRIBUTE_MALLOC;
 char *dir_name (char const *file);
 # endif
 
 char *mdir_name (char const *file);
-size_t base_len (char const *file) _GL_ATTRIBUTE_PURE;
 size_t dir_len (char const *file) _GL_ATTRIBUTE_PURE;
-char *last_component (char const *file) _GL_ATTRIBUTE_PURE;
 
 bool strip_trailing_slashes (char *file);
 
diff --git a/lib/dosname.h b/lib/dosname.h
deleted file mode 100644 (file)
index 83a953f..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/* File names on MS-DOS/Windows systems.
-
-   Copyright (C) 2000-2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-   From Paul Eggert and Jim Meyering.  */
-
-#ifndef _DOSNAME_H
-#define _DOSNAME_H
-
-#if (defined _WIN32 || defined __WIN32__ ||     \
-     defined __MSDOS__ || defined __CYGWIN__ || \
-     defined __EMX__ || defined __DJGPP__)
-   /* This internal macro assumes ASCII, but all hosts that support drive
-      letters use ASCII.  */
-# define _IS_DRIVE_LETTER(C) (((unsigned int) (C) | ('a' - 'A')) - 'a'  \
-                              <= 'z' - 'a')
-# define FILE_SYSTEM_PREFIX_LEN(Filename) \
-          (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':' ? 2 : 0)
-# ifndef __CYGWIN__
-#  define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
-# endif
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-#else
-# define FILE_SYSTEM_PREFIX_LEN(Filename) 0
-# define ISSLASH(C) ((C) == '/')
-#endif
-
-#ifndef FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
-#endif
-
-#if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
-#  define IS_ABSOLUTE_FILE_NAME(F) ISSLASH ((F)[FILE_SYSTEM_PREFIX_LEN (F)])
-# else
-#  define IS_ABSOLUTE_FILE_NAME(F)                              \
-     (ISSLASH ((F)[0]) || FILE_SYSTEM_PREFIX_LEN (F) != 0)
-#endif
-#define IS_RELATIVE_FILE_NAME(F) (! IS_ABSOLUTE_FILE_NAME (F))
-
-#endif /* DOSNAME_H_ */
index f5b81b7..bba1354 100644 (file)
@@ -1,7 +1,7 @@
 /* Duplicate a file descriptor result, avoiding clobbering
    STD{IN,OUT,ERR}_FILENO, with specific flags.
 
-   Copyright (C) 2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2004-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert and Eric Blake.  */
 
index 6ed8f79..2db1520 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke dup, but avoid some glitches.
 
-   Copyright (C) 2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2004-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
similarity index 83%
rename from tests/dup.c
rename to lib/dup.c
index 034fcf8..104d482 100644 (file)
+++ b/lib/dup.c
@@ -1,6 +1,6 @@
 /* Duplicate an open file descriptor.
 
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 
 #include <errno.h>
 
-#include "msvc-inval.h"
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
 
 #undef dup
 
-#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+#if defined _WIN32 && !defined __CYGWIN__
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
 static int
 dup_nothrow (int fd)
 {
@@ -34,7 +37,7 @@ dup_nothrow (int fd)
 
   TRY_MSVC_INVAL
     {
-      result = dup (fd);
+      result = _dup (fd);
     }
   CATCH_MSVC_INVAL
     {
@@ -45,6 +48,9 @@ dup_nothrow (int fd)
 
   return result;
 }
+# else
+#  define dup_nothrow _dup
+# endif
 #elif defined __KLIBC__
 # include <fcntl.h>
 # include <sys/stat.h>
index 5d026f2..c4a0a29 100644 (file)
@@ -1,6 +1,6 @@
 /* Duplicate an open file descriptor to a specified file descriptor.
 
-   Copyright (C) 1999, 2004-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2004-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* written by Paul Eggert */
 
 #include <errno.h>
 #include <fcntl.h>
 
-#if HAVE_DUP2
+#undef dup2
 
-# undef dup2
-
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 /* Get declarations of the native Windows API functions.  */
-#  define WIN32_LEAN_AND_MEAN
-#  include <windows.h>
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
 
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
 #  include "msvc-inval.h"
+# endif
 
 /* Get _get_osfhandle.  */
+# if GNULIB_MSVC_NOTHROW
 #  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
+
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+dup2_nothrow (int fd, int desired_fd)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = _dup2 (fd, desired_fd);
+    }
+  CATCH_MSVC_INVAL
+    {
+      errno = EBADF;
+      result = -1;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+# else
+#  define dup2_nothrow _dup2
+# endif
 
 static int
 ms_windows_dup2 (int fd, int desired_fd)
@@ -59,23 +86,14 @@ ms_windows_dup2 (int fd, int desired_fd)
     }
 
   /* Wine 1.0.1 return 0 when desired_fd is negative but not -1:
-     http://bugs.winehq.org/show_bug.cgi?id=21289 */
+     https://bugs.winehq.org/show_bug.cgi?id=21289 */
   if (desired_fd < 0)
     {
       errno = EBADF;
       return -1;
     }
 
-  TRY_MSVC_INVAL
-    {
-      result = dup2 (fd, desired_fd);
-    }
-  CATCH_MSVC_INVAL
-    {
-      errno = EBADF;
-      result = -1;
-    }
-  DONE_MSVC_INVAL;
+  result = dup2_nothrow (fd, desired_fd);
 
   if (result == 0)
     result = desired_fd;
@@ -83,11 +101,11 @@ ms_windows_dup2 (int fd, int desired_fd)
   return result;
 }
 
-#  define dup2 ms_windows_dup2
+# define dup2 ms_windows_dup2
 
-# elif defined __KLIBC__
+#elif defined __KLIBC__
 
-#  include <InnoTekLIBC/backend.h>
+# include <InnoTekLIBC/backend.h>
 
 static int
 klibc_dup2dirfd (int fd, int desired_fd)
@@ -135,81 +153,37 @@ klibc_dup2 (int fd, int desired_fd)
   return dupfd;
 }
 
-#  define dup2 klibc_dup2
-# endif
+# define dup2 klibc_dup2
+#endif
 
 int
 rpl_dup2 (int fd, int desired_fd)
 {
   int result;
 
-# ifdef F_GETFL
+#ifdef F_GETFL
   /* On Linux kernels 2.6.26-2.6.29, dup2 (fd, fd) returns -EBADF.
      On Cygwin 1.5.x, dup2 (1, 1) returns 0.
      On Cygwin 1.7.17, dup2 (1, -1) dumps core.
      On Cygwin 1.7.25, dup2 (1, 256) can dump core.
      On Haiku, dup2 (fd, fd) mistakenly clears FD_CLOEXEC.  */
-#  if HAVE_SETDTABLESIZE
+# if HAVE_SETDTABLESIZE
   setdtablesize (desired_fd + 1);
-#  endif
+# endif
   if (desired_fd < 0)
     fd = desired_fd;
   if (fd == desired_fd)
     return fcntl (fd, F_GETFL) == -1 ? -1 : fd;
-# endif
+#endif
 
   result = dup2 (fd, desired_fd);
 
   /* Correct an errno value on FreeBSD 6.1 and Cygwin 1.5.x.  */
   if (result == -1 && errno == EMFILE)
     errno = EBADF;
-# if REPLACE_FCHDIR
+#if REPLACE_FCHDIR
   if (fd != desired_fd && result != -1)
     result = _gl_register_dup (fd, result);
-# endif
-  return result;
-}
-
-#else /* !HAVE_DUP2 */
-
-/* On older platforms, dup2 did not exist.  */
-
-# ifndef F_DUPFD
-static int
-dupfd (int fd, int desired_fd)
-{
-  int duplicated_fd = dup (fd);
-  if (duplicated_fd < 0 || duplicated_fd == desired_fd)
-    return duplicated_fd;
-  else
-    {
-      int r = dupfd (fd, desired_fd);
-      int e = errno;
-      close (duplicated_fd);
-      errno = e;
-      return r;
-    }
-}
-# endif
-
-int
-dup2 (int fd, int desired_fd)
-{
-  int result = fcntl (fd, F_GETFL) < 0 ? -1 : fd;
-  if (result == -1 || fd == desired_fd)
-    return result;
-  close (desired_fd);
-# ifdef F_DUPFD
-  result = fcntl (fd, F_DUPFD, desired_fd);
-#  if REPLACE_FCHDIR
-  if (0 <= result)
-    result = _gl_register_dup (fd, result);
-#  endif
-# else
-  result = dupfd (fd, desired_fd);
-# endif
-  if (result == -1 && (errno == EMFILE || errno == EINVAL))
-    errno = EBADF;
+#endif
   return result;
 }
-#endif /* !HAVE_DUP2 */
diff --git a/lib/dynarray.h b/lib/dynarray.h
new file mode 100644 (file)
index 0000000..9a8d395
--- /dev/null
@@ -0,0 +1,280 @@
+/* Type-safe arrays which grow dynamically.
+   Copyright 2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert and Bruno Haible, 2021.  */
+
+#ifndef _GL_DYNARRAY_H
+#define _GL_DYNARRAY_H
+
+/* Before including this file, you need to define:
+
+   DYNARRAY_STRUCT
+      The struct tag of dynamic array to be defined.
+
+   DYNARRAY_ELEMENT
+      The type name of the element type.  Elements are copied
+      as if by memcpy, and can change address as the dynamic
+      array grows.
+
+   DYNARRAY_PREFIX
+      The prefix of the functions which are defined.
+
+   The following parameters are optional:
+
+   DYNARRAY_ELEMENT_FREE
+      DYNARRAY_ELEMENT_FREE (E) is evaluated to deallocate the
+      contents of elements. E is of type  DYNARRAY_ELEMENT *.
+
+   DYNARRAY_ELEMENT_INIT
+      DYNARRAY_ELEMENT_INIT (E) is evaluated to initialize a new
+      element.  E is of type  DYNARRAY_ELEMENT *.
+      If DYNARRAY_ELEMENT_FREE but not DYNARRAY_ELEMENT_INIT is
+      defined, new elements are automatically zero-initialized.
+      Otherwise, new elements have undefined contents.
+
+   DYNARRAY_INITIAL_SIZE
+      The size of the statically allocated array (default:
+      at least 2, more elements if they fit into 128 bytes).
+      Must be a preprocessor constant.  If DYNARRAY_INITIAL_SIZE is 0,
+      there is no statically allocated array at, and all non-empty
+      arrays are heap-allocated.
+
+   DYNARRAY_FINAL_TYPE
+      The name of the type which holds the final array.  If not
+      defined, is PREFIX##finalize not provided.  DYNARRAY_FINAL_TYPE
+      must be a struct type, with members of type DYNARRAY_ELEMENT and
+      size_t at the start (in this order).
+
+   These macros are undefined after this header file has been
+   included.
+
+   The following types are provided (their members are private to the
+   dynarray implementation):
+
+     struct DYNARRAY_STRUCT
+
+   The following functions are provided:
+ */
+
+/* Initialize a dynamic array object.  This must be called before any
+   use of the object.  */
+#if 0
+static void
+       DYNARRAY_PREFIX##init (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Deallocate the dynamic array and its elements.  */
+#if 0
+static void
+       DYNARRAY_PREFIX##free (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return true if the dynamic array is in an error state.  */
+#if 0
+static bool
+       DYNARRAY_PREFIX##has_failed (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Mark the dynamic array as failed.  All elements are deallocated as
+   a side effect.  */
+#if 0
+static void
+       DYNARRAY_PREFIX##mark_failed (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return the number of elements which have been added to the dynamic
+   array.  */
+#if 0
+static size_t
+       DYNARRAY_PREFIX##size (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer to the first array element, if any.  For a
+   zero-length array, the pointer can be NULL even though the dynamic
+   array has not entered the failure state.  */
+#if 0
+static DYNARRAY_ELEMENT *
+       DYNARRAY_PREFIX##begin (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer one element past the last array element.  For a
+   zero-length array, the pointer can be NULL even though the dynamic
+   array has not entered the failure state.  */
+#if 0
+static DYNARRAY_ELEMENT *
+       DYNARRAY_PREFIX##end (const struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Return a pointer to the array element at INDEX.  Terminate the
+   process if INDEX is out of bounds.  */
+#if 0
+static DYNARRAY_ELEMENT *
+       DYNARRAY_PREFIX##at (struct DYNARRAY_STRUCT *list, size_t index);
+#endif
+
+/* Add ITEM at the end of the array, enlarging it by one element.
+   Mark *LIST as failed if the dynamic array allocation size cannot be
+   increased.  */
+#if 0
+static void
+       DYNARRAY_PREFIX##add (struct DYNARRAY_STRUCT *list,
+                             DYNARRAY_ELEMENT item);
+#endif
+
+/* Allocate a place for a new element in *LIST and return a pointer to
+   it.  The pointer can be NULL if the dynamic array cannot be
+   enlarged due to a memory allocation failure.  */
+#if 0
+static DYNARRAY_ELEMENT *
+       DYNARRAY_PREFIX##emplace (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Change the size of *LIST to SIZE.  If SIZE is larger than the
+   existing size, new elements are added (which can be initialized).
+   Otherwise, the list is truncated, and elements are freed.  Return
+   false on memory allocation failure (and mark *LIST as failed).  */
+#if 0
+static bool
+       DYNARRAY_PREFIX##resize (struct DYNARRAY_STRUCT *list, size_t size);
+#endif
+
+/* Remove the last element of LIST if it is present.  */
+#if 0
+static void
+       DYNARRAY_PREFIX##remove_last (struct DYNARRAY_STRUCT *list);
+#endif
+
+/* Remove all elements from the list.  The elements are freed, but the
+   list itself is not.  */
+#if 0
+static void
+       DYNARRAY_PREFIX##clear (struct DYNARRAY_STRUCT *list);
+#endif
+
+#if defined DYNARRAY_FINAL_TYPE
+/* Transfer the dynamic array to a permanent location at *RESULT.
+   Returns true on success on false on allocation failure.  In either
+   case, *LIST is re-initialized and can be reused.  A NULL pointer is
+   stored in *RESULT if LIST refers to an empty list.  On success, the
+   pointer in *RESULT is heap-allocated and must be deallocated using
+   free.  */
+#if 0
+static bool
+       DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *list,
+                                  DYNARRAY_FINAL_TYPE *result);
+#endif
+#else /* !defined DYNARRAY_FINAL_TYPE */
+/* Transfer the dynamic array to a heap-allocated array and return a
+   pointer to it.  The pointer is NULL if memory allocation fails, or
+   if the array is empty, so this function should be used only for
+   arrays which are known not be empty (usually because they always
+   have a sentinel at the end).  If LENGTHP is not NULL, the array
+   length is written to *LENGTHP.  *LIST is re-initialized and can be
+   reused.  */
+#if 0
+static DYNARRAY_ELEMENT *
+       DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *list,
+                                  size_t *lengthp);
+#endif
+#endif
+
+/* A minimal example which provides a growing list of integers can be
+   defined like this:
+
+     struct int_array
+     {
+       // Pointer to result array followed by its length,
+       // as required by DYNARRAY_FINAL_TYPE.
+       int *array;
+       size_t length;
+     };
+
+     #define DYNARRAY_STRUCT dynarray_int
+     #define DYNARRAY_ELEMENT int
+     #define DYNARRAY_PREFIX dynarray_int_
+     #define DYNARRAY_FINAL_TYPE struct int_array
+     #include <malloc/dynarray-skeleton.c>
+
+   To create a three-element array with elements 1, 2, 3, use this
+   code:
+
+     struct dynarray_int dyn;
+     dynarray_int_init (&dyn);
+     for (int i = 1; i <= 3; ++i)
+       {
+         int *place = dynarray_int_emplace (&dyn);
+         assert (place != NULL);
+         *place = i;
+       }
+     struct int_array result;
+     bool ok = dynarray_int_finalize (&dyn, &result);
+     assert (ok);
+     assert (result.length == 3);
+     assert (result.array[0] == 1);
+     assert (result.array[1] == 2);
+     assert (result.array[2] == 3);
+     free (result.array);
+
+   If the elements contain resources which must be freed, define
+   DYNARRAY_ELEMENT_FREE appropriately, like this:
+
+     struct str_array
+     {
+       char **array;
+       size_t length;
+     };
+
+     #define DYNARRAY_STRUCT dynarray_str
+     #define DYNARRAY_ELEMENT char *
+     #define DYNARRAY_ELEMENT_FREE(ptr) free (*ptr)
+     #define DYNARRAY_PREFIX dynarray_str_
+     #define DYNARRAY_FINAL_TYPE struct str_array
+     #include <malloc/dynarray-skeleton.c>
+ */
+
+
+/* The implementation is imported from glibc.  */
+
+/* Avoid possible conflicts with symbols exported by the GNU libc.  */
+#define __libc_dynarray_at_failure gl_dynarray_at_failure
+#define __libc_dynarray_emplace_enlarge gl_dynarray_emplace_enlarge
+#define __libc_dynarray_finalize gl_dynarray_finalize
+#define __libc_dynarray_resize_clear gl_dynarray_resize_clear
+#define __libc_dynarray_resize gl_dynarray_resize
+
+#if defined DYNARRAY_STRUCT || defined DYNARRAY_ELEMENT || defined DYNARRAY_PREFIX
+
+# include <libc-config.h>
+
+/* Define auxiliary structs and declare auxiliary functions, common to all
+   instantiations of dynarray.  */
+# include <malloc/dynarray.h>
+
+/* Define the instantiation, specified through
+     DYNARRAY_STRUCT
+     DYNARRAY_ELEMENT
+     DYNARRAY_PREFIX
+   etc.  */
+# include <malloc/dynarray-skeleton.c>
+
+#else
+
+/* This file is being included from one of the malloc/dynarray_*.c files.  */
+# include <malloc/dynarray.h>
+
+#endif
+
+#endif /* _GL_DYNARRAY_H */
diff --git a/lib/eloop-threshold.h b/lib/eloop-threshold.h
new file mode 100644 (file)
index 0000000..27d07a7
--- /dev/null
@@ -0,0 +1,83 @@
+/* Threshold at which to diagnose ELOOP.  Generic version.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _ELOOP_THRESHOLD_H
+#define _ELOOP_THRESHOLD_H      1
+
+#include <limits.h>
+#ifdef _LIBC
+# include <sys/param.h>
+# define _GL_ATTRIBUTE_CONST __attribute__ ((const))
+#else
+# include <unistd.h>
+# include "minmax.h"
+# define __sysconf sysconf
+# if (!defined SYMLOOP_MAX \
+      && ! (defined _SC_SYMLOOP_MAX && defined _POSIX_SYMLOOP_MAX))
+#  define SYMLOOP_MAX 8
+# endif
+#endif
+
+/* POSIX specifies SYMLOOP_MAX as the "Maximum number of symbolic
+   links that can be reliably traversed in the resolution of a
+   pathname in the absence of a loop."  This makes it a minimum that
+   we should certainly accept.  But it leaves open the possibility
+   that more might sometimes work--just not "reliably".
+
+   For example, Linux implements a complex policy whereby there is a
+   small limit on the number of direct symlink traversals (a symlink
+   to a symlink to a symlink), but larger limit on the total number of
+   symlink traversals overall.  Hence the SYMLOOP_MAX number should be
+   the small one, but the limit library functions enforce on users
+   should be the larger one.
+
+   So, we use the larger of the reported SYMLOOP_MAX (if any) and our
+   own constant MIN_ELOOP_THRESHOLD, below.  This constant should be
+   large enough that it never rules out a file name and directory tree
+   that the underlying system (i.e. calls to 'open' et al) would
+   resolve successfully.  It should be small enough that actual loops
+   are detected without a huge number of iterations.  */
+
+#ifndef MIN_ELOOP_THRESHOLD
+# define MIN_ELOOP_THRESHOLD    40
+#endif
+
+/* Return the maximum number of symlink traversals to permit
+   before diagnosing ELOOP.  */
+static inline unsigned int _GL_ATTRIBUTE_CONST
+__eloop_threshold (void)
+{
+#ifdef SYMLOOP_MAX
+  const int symloop_max = SYMLOOP_MAX;
+#else
+  /* The function is marked 'const' even though we use memory and
+     call a function, because sysconf is required to return the
+     same value in every call and so it must always be safe to
+     call __eloop_threshold exactly once and reuse the value.  */
+  static long int sysconf_symloop_max;
+  if (sysconf_symloop_max == 0)
+    sysconf_symloop_max = __sysconf (_SC_SYMLOOP_MAX);
+  const unsigned int symloop_max = (sysconf_symloop_max <= 0
+                                    ? _POSIX_SYMLOOP_MAX
+                                    : sysconf_symloop_max);
+#endif
+
+  return MAX (symloop_max, MIN_ELOOP_THRESHOLD);
+}
+
+#endif  /* eloop-threshold.h */
index b8397ee..c6ab4e8 100644 (file)
@@ -1,6 +1,6 @@
 /* A POSIX-like <errno.h>.
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _@GUARD_PREFIX@_ERRNO_H
 
@@ -30,7 +30,7 @@
 
 
 /* On native Windows platforms, many macros are not defined.  */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 
 /* These are the same values as defined by MSVC 10, for interoperability.  */
 
        interoperability.  */
 #   define EOWNERDEAD      58
 #   define ENOTRECOVERABLE 59
-#  elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#  elif defined _WIN32 && ! defined __CYGWIN__
     /* We have a conflict here: pthreads-win32 defines these values
        differently than MSVC 10.  It's hairy to decide which one to use.  */
 #   if defined __MINGW32__ && !defined USE_WINDOWS_THREADS
index b3b1286..d17b5a6 100644 (file)
@@ -1,5 +1,5 @@
 /* Error handler for noninteractive utilities
-   Copyright (C) 1990-1998, 2000-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1990-1998, 2000-2007, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by David MacKenzie <djm@gnu.ai.mit.edu>.  */
 
@@ -40,7 +40,7 @@
 # include <wchar.h>
 # define mbsrtowcs __mbsrtowcs
 # define USE_UNLOCKED_IO 0
-# define _GL_ATTRIBUTE_FORMAT_PRINTF(a, b)
+# define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(a, b)
 # define _GL_ARG_NONNULL(a)
 #else
 # include "getprogname.h"
@@ -93,33 +93,37 @@ extern void __error_at_line (int status, int errnum, const char *file_name,
 # include <fcntl.h>
 # include <unistd.h>
 
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 /* Get declarations of the native Windows API functions.  */
 #  define WIN32_LEAN_AND_MEAN
 #  include <windows.h>
 /* Get _get_osfhandle.  */
-#  include "msvc-nothrow.h"
+#  if GNULIB_MSVC_NOTHROW
+#   include "msvc-nothrow.h"
+#  else
+#   include <io.h>
+#  endif
 # endif
 
 /* The gnulib override of fcntl is not needed in this file.  */
 # undef fcntl
 
-# if !HAVE_DECL_STRERROR_R
+# if !(GNULIB_STRERROR_R_POSIX || HAVE_DECL_STRERROR_R)
 #  ifndef HAVE_DECL_STRERROR_R
 "this configure-time declaration test was not run"
 #  endif
 #  if STRERROR_R_CHAR_P
-char *strerror_r ();
+char *strerror_r (int errnum, char *buf, size_t buflen);
 #  else
-int strerror_r ();
+int strerror_r (int errnum, char *buf, size_t buflen);
 #  endif
 # endif
 
-#define program_name getprogname ()
+# define program_name getprogname ()
 
-# if HAVE_STRERROR_R || defined strerror_r
+# if GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r
 #  define __strerror_r strerror_r
-# endif /* HAVE_STRERROR_R || defined strerror_r */
+# endif /* GNULIB_STRERROR_R_POSIX || HAVE_STRERROR_R || defined strerror_r */
 #endif  /* not _LIBC */
 
 #if !_LIBC
@@ -127,7 +131,7 @@ int strerror_r ();
 static int
 is_open (int fd)
 {
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
   /* On native Windows: The initial state of unassigned standard file
      descriptors is that they are open but point to an INVALID_HANDLE_VALUE.
      There is no fcntl, and the gnulib replacement fcntl does not support
@@ -172,9 +176,9 @@ print_errno_message (int errnum)
 {
   char const *s;
 
-#if defined HAVE_STRERROR_R || _LIBC
+#if _LIBC || GNULIB_STRERROR_R_POSIX || defined HAVE_STRERROR_R
   char errbuf[1024];
-# if _LIBC || STRERROR_R_CHAR_P
+# if _LIBC || (!GNULIB_STRERROR_R_POSIX && STRERROR_R_CHAR_P)
   s = __strerror_r (errnum, errbuf, sizeof errbuf);
 # else
   if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)
@@ -198,7 +202,7 @@ print_errno_message (int errnum)
 #endif
 }
 
-static void _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0) _GL_ARG_NONNULL ((3))
+static void _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0) _GL_ARG_NONNULL ((3))
 error_tail (int status, int errnum, const char *message, va_list args)
 {
 #if _LIBC
@@ -268,7 +272,6 @@ error_tail (int status, int errnum, const char *message, va_list args)
   else
 #endif
     vfprintf (stderr, message, args);
-  va_end (args);
 
   ++error_message_count;
   if (errnum)
@@ -318,6 +321,7 @@ error (int status, int errnum, const char *message, ...)
 
   va_start (args, message);
   error_tail (status, errnum, message, args);
+  va_end (args);
 
 #ifdef _LIBC
   _IO_funlockfile (stderr);
@@ -388,6 +392,7 @@ error_at_line (int status, int errnum, const char *file_name,
 
   va_start (args, message);
   error_tail (status, errnum, message, args);
+  va_end (args);
 
 #ifdef _LIBC
   _IO_funlockfile (stderr);
index 6a69db0..f65d072 100644 (file)
@@ -1,5 +1,5 @@
 /* Declaration for error-reporting function
-   Copyright (C) 1995-1997, 2003, 2006, 2008-2016 Free Software Foundation,
+   Copyright (C) 1995-1997, 2003, 2006, 2008-2021 Free Software Foundation,
    Inc.
    This file is part of the GNU C Library.
 
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _ERROR_H
 #define _ERROR_H 1
 
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
-   The __-protected variants of the attributes 'format' and 'printf' are
-   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
-   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
-   gnulib and libintl do '#define printf __printf__' when they override
-   the 'printf' function.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
-
-/* On mingw, the flavor of printf depends on whether the extensions module
- * is in use; the check for <stdio.h> determines the witness macro.  */
-#ifndef _GL_ATTRIBUTE_SPEC_PRINTF
-# if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
-#  define _GL_ATTRIBUTE_SPEC_PRINTF __gnu_printf__
-# else
-#  define _GL_ATTRIBUTE_SPEC_PRINTF __printf__
-# endif
-#endif
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM.  */
+#include <stdio.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -50,11 +31,21 @@ extern "C" {
    If STATUS is nonzero, terminate the program with 'exit (STATUS)'.  */
 
 extern void error (int __status, int __errnum, const char *__format, ...)
-     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 3, 4));
+#if GNULIB_VFPRINTF_POSIX
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4))
+#else
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 3, 4))
+#endif
+     ;
 
 extern void error_at_line (int __status, int __errnum, const char *__fname,
                            unsigned int __lineno, const char *__format, ...)
-     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF, 5, 6));
+#if GNULIB_VFPRINTF_POSIX
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 5, 6))
+#else
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 5, 6))
+#endif
+     ;
 
 /* If NULL, error will flush stdout, then print on stderr the program
    name, a colon and a space.  Otherwise, error will call this
index bf3f809..472b171 100644 (file)
@@ -1,5 +1,5 @@
 /* Creation of autonomous subprocesses.
-   Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
 #include <config.h>
 #include <signal.h>
 #include <unistd.h>
 
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include "canonicalize.h"
 #include "error.h"
 #include "fatal-signal.h"
+#include "filename.h"
+#include "findprog.h"
 #include "wait-process.h"
+#include "xalloc.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+
+/* Choice of implementation for native Windows.
+   - Define to 0 to use the posix_spawn facility (modules 'posix_spawn' and
+     'posix_spawnp'), that is based on the module 'windows-spawn'.
+   - Define to 1 to use the older code, that uses the module 'windows-spawn'
+     directly.
+   You can set this macro from a Makefile or at configure time, from the
+   CPPFLAGS.  */
+#ifndef EXECUTE_IMPL_AVOID_POSIX_SPAWN
+# define EXECUTE_IMPL_AVOID_POSIX_SPAWN 0
+#endif
+
+
+#if (defined _WIN32 && !defined __CYGWIN__) && EXECUTE_IMPL_AVOID_POSIX_SPAWN
 
 /* Native Windows API.  */
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
 # include <process.h>
-# include "w32spawn.h"
+# include "windows-spawn.h"
 
 #else
 
@@ -49,7 +74,7 @@
 #endif
 
 
-#if defined EINTR && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if defined EINTR && (defined _WIN32 && !defined __CYGWIN__) && EXECUTE_IMPL_AVOID_POSIX_SPAWN
 
 /* EINTR handling for close(), open().
    These functions can return -1/EINTR even though we don't have any
@@ -66,6 +91,7 @@ nonintr_close (int fd)
 
   return retval;
 }
+#undef close /* avoid warning related to gnulib module unistd */
 #define close nonintr_close
 
 static int
@@ -85,104 +111,138 @@ nonintr_open (const char *pathname, int oflag, mode_t mode)
 #endif
 
 
-/* Execute a command, optionally redirecting any of the three standard file
-   descriptors to /dev/null.  Return its exit code.
-   If it didn't terminate correctly, exit if exit_on_error is true, otherwise
-   return 127.
-   If slave_process is true, the child process will be terminated when its
-   creator receives a catchable fatal signal.  */
 int
 execute (const char *progname,
-         const char *prog_path, char **prog_argv,
+         const char *prog_path, const char * const *prog_argv,
+         const char *directory,
          bool ignore_sigpipe,
          bool null_stdin, bool null_stdout, bool null_stderr,
          bool slave_process, bool exit_on_error,
          int *termsigp)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+  int saved_errno;
+  char *prog_path_to_free = NULL;
+
+  if (directory != NULL)
+    {
+      /* If a change of directory is requested, make sure PROG_PATH is absolute
+         before we do so.  This is needed because
+           - posix_spawn and posix_spawnp are required to resolve a relative
+             PROG_PATH *after* changing the directory.  See
+             <https://www.austingroupbugs.net/view.php?id=1208>:
+               "if this pathname does not start with a <slash> it shall be
+                interpreted relative to the working directory of the child
+                process _after_ all file_actions have been performed."
+             But this would be a surprising application behaviour, possibly
+             even security relevant.
+           - For the Windows CreateProcess() function, it is unspecified whether
+             a relative file name is interpreted to the parent's current
+             directory or to the specified directory.  See
+             <https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa>  */
+      if (! IS_ABSOLUTE_FILE_NAME (prog_path))
+        {
+          const char *resolved_prog =
+            find_in_given_path (prog_path, getenv ("PATH"), NULL, false);
+          if (resolved_prog == NULL)
+            goto fail_with_errno;
+          if (resolved_prog != prog_path)
+            prog_path_to_free = (char *) resolved_prog;
+          prog_path = resolved_prog;
+
+          if (! IS_ABSOLUTE_FILE_NAME (prog_path))
+            {
+              char *absolute_prog =
+                canonicalize_filename_mode (prog_path,
+                                            CAN_MISSING | CAN_NOLINKS);
+              if (absolute_prog == NULL)
+                {
+                  free (prog_path_to_free);
+                  goto fail_with_errno;
+                }
+              free (prog_path_to_free);
+              prog_path_to_free = absolute_prog;
+              prog_path = absolute_prog;
+
+              if (! IS_ABSOLUTE_FILE_NAME (prog_path))
+                abort ();
+            }
+        }
+    }
+
+#if (defined _WIN32 && !defined __CYGWIN__) && EXECUTE_IMPL_AVOID_POSIX_SPAWN
 
   /* Native Windows API.  */
-  int orig_stdin;
-  int orig_stdout;
-  int orig_stderr;
-  int exitcode;
-  int nullinfd;
-  int nulloutfd;
-
-  /* FIXME: Need to free memory allocated by prepare_spawn.  */
-  prog_argv = prepare_spawn (prog_argv);
-
-  /* Save standard file handles of parent process.  */
-  if (null_stdin)
-    orig_stdin = dup_safer_noinherit (STDIN_FILENO);
-  if (null_stdout)
-    orig_stdout = dup_safer_noinherit (STDOUT_FILENO);
-  if (null_stderr)
-    orig_stderr = dup_safer_noinherit (STDERR_FILENO);
-  exitcode = -1;
+
+  char *argv_mem_to_free;
+
+  const char **argv = prepare_spawn (prog_argv, &argv_mem_to_free);
+  if (argv == NULL)
+    xalloc_die ();
+
+  int exitcode = -1;
 
   /* Create standard file handles of child process.  */
-  nullinfd = -1;
-  nulloutfd = -1;
+  int nullinfd = -1;
+  int nulloutfd = -1;
   if ((!null_stdin
-       || ((nullinfd = open ("NUL", O_RDONLY, 0)) >= 0
-           && (nullinfd == STDIN_FILENO
-               || (dup2 (nullinfd, STDIN_FILENO) >= 0
-                   && close (nullinfd) >= 0))))
+       || (nullinfd = open ("NUL", O_RDONLY, 0)) >= 0)
       && (!(null_stdout || null_stderr)
-          || ((nulloutfd = open ("NUL", O_RDWR, 0)) >= 0
-              && (!null_stdout
-                  || nulloutfd == STDOUT_FILENO
-                  || dup2 (nulloutfd, STDOUT_FILENO) >= 0)
-              && (!null_stderr
-                  || nulloutfd == STDERR_FILENO
-                  || dup2 (nulloutfd, STDERR_FILENO) >= 0)
-              && ((null_stdout && nulloutfd == STDOUT_FILENO)
-                  || (null_stderr && nulloutfd == STDERR_FILENO)
-                  || close (nulloutfd) >= 0))))
-    /* Use spawnvpe and pass the environment explicitly.  This is needed if
-       the program has modified the environment using putenv() or [un]setenv().
-       On Windows, programs have two environments, one in the "environment
-       block" of the process and managed through SetEnvironmentVariable(), and
-       one inside the process, in the location retrieved by the 'environ'
-       macro.  When using spawnvp() without 'e', the child process inherits a
-       copy of the environment block - ignoring the effects of putenv() and
-       [un]setenv().  */
+          || (nulloutfd = open ("NUL", O_RDWR, 0)) >= 0))
+    /* Pass the environment explicitly.  This is needed if the program has
+       modified the environment using putenv() or [un]setenv().  On Windows,
+       processes have two environments, one in the "environment block" of the
+       process and managed through SetEnvironmentVariable(), and one inside the
+       process, in the location retrieved by the 'environ' macro.  If we were
+       to pass NULL, the child process would inherit a copy of the environment
+       block - ignoring the effects of putenv() and [un]setenv().  */
     {
-      exitcode = spawnvpe (P_WAIT, prog_path, (const char **) prog_argv,
-                           (const char **) environ);
-      if (exitcode < 0 && errno == ENOEXEC)
+      HANDLE stdin_handle =
+        (HANDLE) _get_osfhandle (null_stdin ? nullinfd : STDIN_FILENO);
+      HANDLE stdout_handle =
+        (HANDLE) _get_osfhandle (null_stdout ? nulloutfd : STDOUT_FILENO);
+      HANDLE stderr_handle =
+        (HANDLE) _get_osfhandle (null_stderr ? nulloutfd : STDERR_FILENO);
+
+      exitcode = spawnpvech (P_WAIT, prog_path, argv + 1,
+                             (const char * const *) environ, directory,
+                             stdin_handle, stdout_handle, stderr_handle);
+# if 0 /* Executing arbitrary files as shell scripts is unsecure.  */
+      if (exitcode == -1 && errno == ENOEXEC)
         {
           /* prog is not a native executable.  Try to execute it as a
              shell script.  Note that prepare_spawn() has already prepended
-             a hidden element "sh.exe" to prog_argv.  */
-          --prog_argv;
-          exitcode = spawnvpe (P_WAIT, prog_argv[0], (const char **) prog_argv,
-                               (const char **) environ);
+             a hidden element "sh.exe" to argv.  */
+          argv[1] = prog_path;
+          exitcode = spawnpvech (P_WAIT, argv[0], argv,
+                                 (const char * const *) environ, directory,
+                                 stdin_handle, stdout_handle, stderr_handle);
         }
+# endif
     }
+  if (exitcode == -1)
+    saved_errno = errno;
   if (nulloutfd >= 0)
     close (nulloutfd);
   if (nullinfd >= 0)
     close (nullinfd);
+  free (argv);
+  free (argv_mem_to_free);
+  free (prog_path_to_free);
 
-  /* Restore standard file handles of parent process.  */
-  if (null_stderr)
-    undup_safer_noinherit (orig_stderr, STDERR_FILENO);
-  if (null_stdout)
-    undup_safer_noinherit (orig_stdout, STDOUT_FILENO);
-  if (null_stdin)
-    undup_safer_noinherit (orig_stdin, STDIN_FILENO);
-
+  /* Treat failure and signalled child processes like wait_subprocess()
+     does.  */
   if (termsigp != NULL)
     *termsigp = 0;
 
   if (exitcode == -1)
+    goto fail_with_saved_errno;
+
+  if (WIFSIGNALED (exitcode))
     {
-      if (exit_on_error || !null_stderr)
-        error (exit_on_error ? EXIT_FAILURE : 0, errno,
-               _("%s subprocess failed"), progname);
-      return 127;
+      if (termsigp != NULL)
+        *termsigp = WTERMSIG (exitcode);
+      saved_errno = 0;
+      goto fail_with_saved_errno;
     }
 
   return exitcode;
@@ -230,6 +290,10 @@ execute (const char *progname,
                                                           "/dev/null", O_RDWR,
                                                           0))
                  != 0)
+          || (directory != NULL
+              && (err = posix_spawn_file_actions_addchdir (&actions,
+                                                           directory)))
+# if !(defined _WIN32 && !defined __CYGWIN__)
           || (slave_process
               && ((err = posix_spawnattr_init (&attrs)) != 0
                   || (attrs_allocated = true,
@@ -239,9 +303,14 @@ execute (const char *progname,
                       || (err = posix_spawnattr_setflags (&attrs,
                                                         POSIX_SPAWN_SETSIGMASK))
                          != 0)))
-          || (err = posix_spawnp (&child, prog_path, &actions,
-                                  attrs_allocated ? &attrs : NULL, prog_argv,
-                                  environ))
+# endif
+          || (err = (directory != NULL
+                     ? posix_spawn (&child, prog_path, &actions,
+                                    attrs_allocated ? &attrs : NULL,
+                                    (char * const *) prog_argv, environ)
+                     : posix_spawnp (&child, prog_path, &actions,
+                                     attrs_allocated ? &attrs : NULL,
+                                     (char * const *) prog_argv, environ)))
              != 0))
     {
       if (actions_allocated)
@@ -250,12 +319,11 @@ execute (const char *progname,
         posix_spawnattr_destroy (&attrs);
       if (slave_process)
         unblock_fatal_signals ();
+      free (prog_path_to_free);
       if (termsigp != NULL)
         *termsigp = 0;
-      if (exit_on_error || !null_stderr)
-        error (exit_on_error ? EXIT_FAILURE : 0, err,
-               _("%s subprocess failed"), progname);
-      return 127;
+      saved_errno = err;
+      goto fail_with_saved_errno;
     }
   posix_spawn_file_actions_destroy (&actions);
   if (attrs_allocated)
@@ -265,9 +333,18 @@ execute (const char *progname,
       register_slave_subprocess (child);
       unblock_fatal_signals ();
     }
+  free (prog_path_to_free);
 
   return wait_subprocess (child, progname, ignore_sigpipe, null_stderr,
                           slave_process, exit_on_error, termsigp);
 
 #endif
+
+ fail_with_errno:
+  saved_errno = errno;
+ fail_with_saved_errno:
+  if (exit_on_error || !null_stderr)
+    error (exit_on_error ? EXIT_FAILURE : 0, saved_errno,
+           _("%s subprocess failed"), progname);
+  return 127;
 }
index 224141e..498ee1e 100644 (file)
@@ -1,5 +1,5 @@
 /* Creation of autonomous subprocesses.
-   Copyright (C) 2001-2003, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2008-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _EXECUTE_H
 #define _EXECUTE_H
    descriptors to /dev/null.  Return its exit code.
    If it didn't terminate correctly, exit if exit_on_error is true, otherwise
    return 127.
+   progname is the name of the program to be executed by the subprocess, used
+   for error messages.
+   prog_path is the file name of the program to be executed by the subprocess.
+   If it contains no slashes, a search is conducted in $PATH.  An operating
+   system dependent suffix is added, if necessary.
+   prog_argv is the array of strings that the subprocess shall receive in
+   argv[].  It is a NULL-terminated array.  prog_argv[0] should normally be
+   identical to prog_path.
+   If directory is not NULL, the command is executed in that directory.  If
+   prog_path is a relative file name, it resolved before changing to that
+   directory.  The current directory of the current process remains unchanged.
    If ignore_sigpipe is true, consider a subprocess termination due to SIGPIPE
    as equivalent to a success.  This is suitable for processes whose only
    purpose is to write to standard output.
    the subprocess (if supported by the platform: not on native Windows
    platforms), otherwise 0.
    It is recommended that no signal is blocked or ignored while execute()
-   is called.  See pipe.h for the reason.  */
+   is called.  See spawn-pipe.h for the reason.  */
 extern int execute (const char *progname,
-                    const char *prog_path, char **prog_argv,
+                    const char *prog_path, const char * const *prog_argv,
+                    const char *directory,
                     bool ignore_sigpipe,
                     bool null_stdin, bool null_stdout, bool null_stderr,
                     bool slave_process, bool exit_on_error,
index 8033c22..15ce2e6 100644 (file)
@@ -1,6 +1,6 @@
 /* Failure exit status
 
-   Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 62311bd..571729c 100644 (file)
@@ -1,6 +1,6 @@
 /* Failure exit status
 
-   Copyright (C) 2002, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,6 +13,6 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 extern int volatile exit_failure;
index 2126a90..ba5fb53 100644 (file)
@@ -1,5 +1,5 @@
 /* Emergency actions in case of a fatal signal.
-   Copyright (C) 2003-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2004, 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
 #include <config.h>
@@ -26,8 +26,9 @@
 #include <signal.h>
 #include <unistd.h>
 
+#include "glthread/lock.h"
+#include "thread-optim.h"
 #include "sig-handler.h"
-#include "xalloc.h"
 
 #define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
 
@@ -85,6 +86,10 @@ static int fatal_signals[] =
 static void
 init_fatal_signals (void)
 {
+  /* This function is multithread-safe even without synchronization, because
+     if two threads execute it simultaneously, the fatal_signals[] array will
+     not change any more after the first of the threads has completed this
+     function.  */
   static bool fatal_signals_initialized = false;
   if (!fatal_signals_initialized)
     {
@@ -107,7 +112,7 @@ init_fatal_signals (void)
 /* ========================================================================= */
 
 
-typedef void (*action_t) (void);
+typedef _GL_ASYNC_SAFE void (*action_t) (int sig);
 
 /* Type of an entry in the actions array.
    The 'action' field is accessed from within the fatal_signal_handler(),
@@ -131,7 +136,7 @@ static struct sigaction saved_sigactions[64];
 
 
 /* Uninstall the handlers.  */
-static void
+static _GL_ASYNC_SAFE void
 uninstall_handlers (void)
 {
   size_t i;
@@ -148,7 +153,7 @@ uninstall_handlers (void)
 
 
 /* The signal handler.  It gets called asynchronously.  */
-static void
+static _GL_ASYNC_SAFE void
 fatal_signal_handler (int sig)
 {
   for (;;)
@@ -162,7 +167,7 @@ fatal_signal_handler (int sig)
       actions_count = n;
       action = actions[n].action;
       /* Execute the action.  */
-      action ();
+      action (sig);
     }
 
   /* Now execute the signal's default action.
@@ -200,11 +205,18 @@ install_handlers (void)
 }
 
 
+/* Lock that makes at_fatal_signal multi-thread safe.  */
+gl_lock_define_initialized (static, at_fatal_signal_lock)
+
 /* Register a cleanup function to be executed when a catchable fatal signal
    occurs.  */
-void
+int
 at_fatal_signal (action_t action)
 {
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (at_fatal_signal_lock);
+
   static bool cleanup_initialized = false;
   if (!cleanup_initialized)
     {
@@ -213,6 +225,8 @@ at_fatal_signal (action_t action)
       cleanup_initialized = true;
     }
 
+  int ret = 0;
+
   if (actions_count == actions_allocated)
     {
       /* Extend the actions array.  Note that we cannot use xrealloc(),
@@ -222,9 +236,15 @@ at_fatal_signal (action_t action)
       size_t old_actions_allocated = actions_allocated;
       size_t new_actions_allocated = 2 * actions_allocated;
       actions_entry_t *new_actions =
-        XNMALLOC (new_actions_allocated, actions_entry_t);
-      size_t k;
+        (actions_entry_t *)
+        malloc (new_actions_allocated * sizeof (actions_entry_t));
+      if (new_actions == NULL)
+        {
+          ret = -1;
+          goto done;
+        }
 
+      size_t k;
       /* Don't use memcpy() here, because memcpy takes non-volatile arguments
          and is therefore not guaranteed to complete all memory stores before
          the next statement.  */
@@ -233,8 +253,15 @@ at_fatal_signal (action_t action)
       actions = new_actions;
       actions_allocated = new_actions_allocated;
       /* Now we can free the old actions array.  */
+      /* No, we can't do that.  If fatal_signal_handler is running in a
+         different thread and has already fetched the actions pointer (getting
+         old_actions) but not yet accessed its n-th element, that thread may
+         crash when accessing an element of the already freed old_actions
+         array.  */
+      #if 0
       if (old_actions != static_actions)
         free (old_actions);
+      #endif
     }
   /* The two uses of 'volatile' in the types above (and ISO C 99 section
      5.1.2.3.(5)) ensure that we increment the actions_count only after
@@ -242,6 +269,11 @@ at_fatal_signal (action_t action)
      actions[actions_count].  */
   actions[actions_count].action = action;
   actions_count++;
+
+ done:
+  if (mt) gl_lock_unlock (at_fatal_signal_lock);
+
+  return ret;
 }
 
 
@@ -251,36 +283,90 @@ at_fatal_signal (action_t action)
 static sigset_t fatal_signal_set;
 
 static void
-init_fatal_signal_set (void)
+do_init_fatal_signal_set (void)
 {
-  static bool fatal_signal_set_initialized = false;
-  if (!fatal_signal_set_initialized)
-    {
-      size_t i;
+  size_t i;
 
-      init_fatal_signals ();
+  init_fatal_signals ();
 
-      sigemptyset (&fatal_signal_set);
-      for (i = 0; i < num_fatal_signals; i++)
-        if (fatal_signals[i] >= 0)
-          sigaddset (&fatal_signal_set, fatal_signals[i]);
+  sigemptyset (&fatal_signal_set);
+  for (i = 0; i < num_fatal_signals; i++)
+    if (fatal_signals[i] >= 0)
+      sigaddset (&fatal_signal_set, fatal_signals[i]);
+}
 
-      fatal_signal_set_initialized = true;
-    }
+/* Ensure that do_init_fatal_signal_set is called once only.  */
+gl_once_define(static, fatal_signal_set_once)
+
+static void
+init_fatal_signal_set (void)
+{
+  gl_once (fatal_signal_set_once, do_init_fatal_signal_set);
 }
 
+/* Lock and counter that allow block_fatal_signals/unblock_fatal_signals pairs
+   to occur in different threads and even overlap in time.  */
+gl_lock_define_initialized (static, fatal_signals_block_lock)
+static unsigned int fatal_signals_block_counter = 0;
+
 /* Temporarily delay the catchable fatal signals.  */
 void
 block_fatal_signals (void)
 {
-  init_fatal_signal_set ();
-  sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL);
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (fatal_signals_block_lock);
+
+  if (fatal_signals_block_counter++ == 0)
+    {
+      init_fatal_signal_set ();
+      sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL);
+    }
+
+  if (mt) gl_lock_unlock (fatal_signals_block_lock);
 }
 
 /* Stop delaying the catchable fatal signals.  */
 void
 unblock_fatal_signals (void)
 {
+  bool mt = gl_multithreaded ();
+
+  if (mt) gl_lock_lock (fatal_signals_block_lock);
+
+  if (fatal_signals_block_counter == 0)
+    /* There are more calls to unblock_fatal_signals() than to
+       block_fatal_signals().  */
+    abort ();
+  if (--fatal_signals_block_counter == 0)
+    {
+      init_fatal_signal_set ();
+      sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
+    }
+
+  if (mt) gl_lock_unlock (fatal_signals_block_lock);
+}
+
+
+unsigned int
+get_fatal_signals (int signals[64])
+{
+  init_fatal_signal_set ();
+
+  {
+    int *p = signals;
+    size_t i;
+
+    for (i = 0; i < num_fatal_signals; i++)
+      if (fatal_signals[i] >= 0)
+        *p++ = fatal_signals[i];
+    return p - signals;
+  }
+}
+
+const sigset_t *
+get_fatal_signal_set (void)
+{
   init_fatal_signal_set ();
-  sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
+  return &fatal_signal_set;
 }
index 01b9ae0..e8c69f1 100644 (file)
@@ -1,5 +1,5 @@
 /* Emergency actions in case of a fatal signal.
-   Copyright (C) 2003-2004, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2004, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
+#ifndef _FATAL_SIGNAL_H
+#define _FATAL_SIGNAL_H
+
+#include <signal.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -36,7 +41,8 @@ extern "C" {
    occurs.
 
    Restrictions for the cleanup function:
-     - The cleanup function can do all kinds of system calls.
+     - The cleanup function can do all kinds of system calls.  It may also
+       modify (clobber) errno.
      - It can also access application dependent memory locations and data
        structures provided they are in a consistent state. One way to ensure
        this is through block_fatal_signals()/unblock_fatal_signals(), see
@@ -50,8 +56,10 @@ extern "C" {
 
    The cleanup function is executed asynchronously.  It is unspecified
    whether during its execution the catchable fatal signals are blocked
-   or not.  */
-extern void at_fatal_signal (void (*function) (void));
+   or not.
+
+   Return 0 upon success, or -1 if there was a memory allocation problem.  */
+extern int at_fatal_signal (_GL_ASYNC_SAFE void (*function) (int sig));
 
 
 /* Sometimes it is necessary to block the usually fatal signals while the
@@ -71,6 +79,18 @@ extern void block_fatal_signals (void);
 extern void unblock_fatal_signals (void);
 
 
+/* Return the list of signals that block_fatal_signals/unblock_fatal_signals
+   would block or unblock.
+   Fills signals[0..count-1] and returns count.  */
+extern unsigned int get_fatal_signals (int signals[64]);
+
+/* Return the list of signals that block_fatal_signals/unblock_fatal_signals
+   would block or unblock.  */
+extern const sigset_t * get_fatal_signal_set (void);
+
+
 #ifdef __cplusplus
 }
 #endif
+
+#endif /* _FATAL_SIGNAL_H */
diff --git a/lib/fchdir.c b/lib/fchdir.c
new file mode 100644 (file)
index 0000000..d909b29
--- /dev/null
@@ -0,0 +1,206 @@
+/* fchdir replacement.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <unistd.h>
+
+#include <dirent.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include "assure.h"
+#include "filename.h"
+#include "filenamecat.h"
+
+#ifndef REPLACE_OPEN_DIRECTORY
+# define REPLACE_OPEN_DIRECTORY 0
+#endif
+
+/* This replacement assumes that a directory is not renamed while opened
+   through a file descriptor.
+
+   FIXME: On mingw, this would be possible to enforce if we were to
+   also open a HANDLE to each directory currently visited by a file
+   descriptor, since mingw refuses to rename any in-use file system
+   object.  */
+
+/* Array of file descriptors opened.  If REPLACE_OPEN_DIRECTORY or if it points
+   to a directory, it stores info about this directory.  */
+typedef struct
+{
+  char *name;       /* Absolute name of the directory, or NULL.  */
+  /* FIXME - add a DIR* member to make dirfd possible on mingw?  */
+} dir_info_t;
+static dir_info_t *dirs;
+static size_t dirs_allocated;
+
+/* Try to ensure dirs has enough room for a slot at index fd; free any
+   contents already in that slot.  Return false and set errno to
+   ENOMEM on allocation failure.  */
+static bool
+ensure_dirs_slot (size_t fd)
+{
+  if (fd < dirs_allocated)
+    free (dirs[fd].name);
+  else
+    {
+      size_t new_allocated;
+      dir_info_t *new_dirs;
+
+      new_allocated = 2 * dirs_allocated + 1;
+      if (new_allocated <= fd)
+        new_allocated = fd + 1;
+      new_dirs =
+        (dirs != NULL
+         ? (dir_info_t *) realloc (dirs, new_allocated * sizeof *dirs)
+         : (dir_info_t *) malloc (new_allocated * sizeof *dirs));
+      if (new_dirs == NULL)
+        return false;
+      memset (new_dirs + dirs_allocated, 0,
+              (new_allocated - dirs_allocated) * sizeof *dirs);
+      dirs = new_dirs;
+      dirs_allocated = new_allocated;
+    }
+  return true;
+}
+
+/* Return an absolute name of DIR in malloc'd storage.
+   Upon failure, return NULL with errno set.  */
+static char *
+get_name (char const *dir)
+{
+  char *cwd;
+  char *result;
+
+  if (IS_ABSOLUTE_FILE_NAME (dir))
+    return strdup (dir);
+
+  /* We often encounter "."; treat it as a special case.  */
+  cwd = getcwd (NULL, 0);
+  if (!cwd || (dir[0] == '.' && dir[1] == '\0'))
+    return cwd;
+
+  result = mfile_name_concat (cwd, dir, NULL);
+  free (cwd);
+  return result;
+}
+
+/* Hook into the gnulib replacements for open() and close() to keep track
+   of the open file descriptors.  */
+
+/* Close FD, cleaning up any fd to name mapping if fd was visiting a
+   directory.  */
+void
+_gl_unregister_fd (int fd)
+{
+  if (fd >= 0 && fd < dirs_allocated)
+    {
+      free (dirs[fd].name);
+      dirs[fd].name = NULL;
+    }
+}
+
+/* Mark FD as visiting FILENAME.  FD must be non-negative, and refer
+   to an open file descriptor.  If REPLACE_OPEN_DIRECTORY is non-zero,
+   this should only be called if FD is visiting a directory.  Close FD
+   and return -1 with errno set if there is insufficient memory to track
+   the directory name; otherwise return FD.  */
+int
+_gl_register_fd (int fd, const char *filename)
+{
+  struct stat statbuf;
+
+  assure (0 <= fd);
+  if (REPLACE_OPEN_DIRECTORY
+      || (fstat (fd, &statbuf) == 0 && S_ISDIR (statbuf.st_mode)))
+    {
+      if (!ensure_dirs_slot (fd)
+          || (dirs[fd].name = get_name (filename)) == NULL)
+        {
+          int saved_errno = errno;
+          close (fd);
+          errno = saved_errno;
+          return -1;
+        }
+    }
+  return fd;
+}
+
+/* Mark NEWFD as a duplicate of OLDFD; useful from dup, dup2, dup3,
+   and fcntl.  Both arguments must be valid and distinct file
+   descriptors.  Close NEWFD and return -1 if OLDFD is tracking a
+   directory, but there is insufficient memory to track the same
+   directory in NEWFD; otherwise return NEWFD.  */
+int
+_gl_register_dup (int oldfd, int newfd)
+{
+  assure (0 <= oldfd && 0 <= newfd && oldfd != newfd);
+  if (oldfd < dirs_allocated && dirs[oldfd].name)
+    {
+      /* Duplicated a directory; must ensure newfd is allocated.  */
+      if (!ensure_dirs_slot (newfd)
+          || (dirs[newfd].name = strdup (dirs[oldfd].name)) == NULL)
+        {
+          int saved_errno = errno;
+          close (newfd);
+          errno = saved_errno;
+          newfd = -1;
+        }
+    }
+  else if (newfd < dirs_allocated)
+    {
+      /* Duplicated a non-directory; ensure newfd is cleared.  */
+      free (dirs[newfd].name);
+      dirs[newfd].name = NULL;
+    }
+  return newfd;
+}
+
+/* If FD is currently visiting a directory, then return the name of
+   that directory.  Otherwise, return NULL and set errno.  */
+const char *
+_gl_directory_name (int fd)
+{
+  if (0 <= fd && fd < dirs_allocated && dirs[fd].name != NULL)
+    return dirs[fd].name;
+  /* At this point, fd is either invalid, or open but not a directory.
+     If dup2 fails, errno is correctly EBADF.  */
+  if (0 <= fd)
+    {
+      if (dup2 (fd, fd) == fd)
+        errno = ENOTDIR;
+    }
+  else
+    errno = EBADF;
+  return NULL;
+}
+
+
+/* Implement fchdir() in terms of chdir().  */
+
+int
+fchdir (int fd)
+{
+  const char *name = _gl_directory_name (fd);
+  return name ? chdir (name) : -1;
+}
index d4783f6..fbe57ca 100644 (file)
@@ -1,5 +1,5 @@
 /* fclose replacement.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -23,7 +23,9 @@
 #include <unistd.h>
 
 #include "freading.h"
-#include "msvc-inval.h"
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
 
 #undef fclose
 
index fd17e96..9d6b10f 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide file descriptor control.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>.  */
 
 #include <errno.h>
 #include <limits.h>
 #include <stdarg.h>
+#include <stdlib.h>
 #include <unistd.h>
 
-#if !HAVE_FCNTL
-# define rpl_fcntl fcntl
+#ifdef __KLIBC__
+# define INCL_DOS
+# include <os2.h>
 #endif
-#undef fcntl
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Get declarations of the native Windows API functions.  */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 
 /* Get _get_osfhandle.  */
-# include "msvc-nothrow.h"
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
 
 /* Upper bound on getdtablesize().  See lib/getdtablesize.c.  */
 # define OPEN_MAX_MAX 0x10000
@@ -65,14 +70,14 @@ dupfd (int oldfd, int newfd, int flags)
       return -1;
     }
   if (old_handle == INVALID_HANDLE_VALUE
-      || (mode = setmode (oldfd, O_BINARY)) == -1)
+      || (mode = _setmode (oldfd, O_BINARY)) == -1)
     {
       /* oldfd is not open, or is an unassigned standard file
          descriptor.  */
       errno = EBADF;
       return -1;
     }
-  setmode (oldfd, mode);
+  _setmode (oldfd, mode);
   flags |= mode;
 
   for (;;)
@@ -162,93 +167,18 @@ dupfd (int oldfd, int newfd, int flags)
 }
 #endif /* W32 */
 
+/* Forward declarations, because we '#undef fcntl' in the middle of this
+   compilation unit.  */
+/* Our implementation of fcntl (fd, F_DUPFD, target).  */
+static int rpl_fcntl_DUPFD (int fd, int target);
+/* Our implementation of fcntl (fd, F_DUPFD_CLOEXEC, target).  */
+static int rpl_fcntl_DUPFD_CLOEXEC (int fd, int target);
 #ifdef __KLIBC__
-
-# define INCL_DOS
-# include <os2.h>
-
-static int
-klibc_fcntl (int fd, int action, /* arg */...)
-{
-  va_list arg_ptr;
-  int arg;
-  struct stat sbuf;
-  int result = -1;
-
-  va_start (arg_ptr, action);
-  arg = va_arg (arg_ptr, int);
-  result = fcntl (fd, action, arg);
-  /* EPERM for F_DUPFD, ENOTSUP for others */
-  if (result == -1 && (errno == EPERM || errno == ENOTSUP)
-      && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
-  {
-    ULONG ulMode;
-
-    switch (action)
-      {
-      case F_DUPFD:
-        /* Find available fd */
-        while (fcntl (arg, F_GETFL) != -1 || errno != EBADF)
-          arg++;
-
-        result = dup2 (fd, arg);
-        break;
-
-      /* Using underlying APIs is right ? */
-      case F_GETFD:
-        if (DosQueryFHState (fd, &ulMode))
-          break;
-
-        result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0;
-        break;
-
-      case F_SETFD:
-        if (arg & ~FD_CLOEXEC)
-          break;
-
-        if (DosQueryFHState (fd, &ulMode))
-          break;
-
-        if (arg & FD_CLOEXEC)
-          ulMode |= OPEN_FLAGS_NOINHERIT;
-        else
-          ulMode &= ~OPEN_FLAGS_NOINHERIT;
-
-        /* Filter supported flags.  */
-        ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR
-                   | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT);
-
-        if (DosSetFHState (fd, ulMode))
-          break;
-
-        result = 0;
-        break;
-
-      case F_GETFL:
-        result = 0;
-        break;
-
-      case F_SETFL:
-        if (arg != 0)
-          break;
-
-        result = 0;
-        break;
-
-      default :
-        errno = EINVAL;
-        break;
-      }
-  }
-
-  va_end (arg_ptr);
-
-  return result;
-}
-
-# define fcntl klibc_fcntl
+/* Adds support for fcntl on directories.  */
+static int klibc_fcntl (int fd, int action, /* arg */...);
 #endif
 
+
 /* Perform the specified ACTION on the file descriptor FD, possibly
    using the argument ARG further described below.  This replacement
    handles the following actions, and forwards all others on to the
@@ -269,110 +199,35 @@ klibc_fcntl (int fd, int action, /* arg */...)
    return -1 and set errno.  */
 
 int
-rpl_fcntl (int fd, int action, /* arg */...)
+fcntl (int fd, int action, /* arg */...)
+#undef fcntl
+#ifdef __KLIBC__
+# define fcntl klibc_fcntl
+#endif
 {
   va_list arg;
   int result = -1;
   va_start (arg, action);
   switch (action)
     {
-
-#if !HAVE_FCNTL
     case F_DUPFD:
       {
         int target = va_arg (arg, int);
-        result = dupfd (fd, target, 0);
+        result = rpl_fcntl_DUPFD (fd, target);
         break;
       }
-#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
-    case F_DUPFD:
-      {
-        int target = va_arg (arg, int);
-        /* Detect invalid target; needed for cygwin 1.5.x.  */
-        if (target < 0 || getdtablesize () <= target)
-          errno = EINVAL;
-        else
-          {
-            /* Haiku alpha 2 loses fd flags on original.  */
-            int flags = fcntl (fd, F_GETFD);
-            if (flags < 0)
-              {
-                result = -1;
-                break;
-              }
-            result = fcntl (fd, action, target);
-            if (0 <= result && fcntl (fd, F_SETFD, flags) == -1)
-              {
-                int saved_errno = errno;
-                close (result);
-                result = -1;
-                errno = saved_errno;
-              }
-# if REPLACE_FCHDIR
-            if (0 <= result)
-              result = _gl_register_dup (fd, result);
-# endif
-          }
-        break;
-      } /* F_DUPFD */
-#endif /* FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR */
 
     case F_DUPFD_CLOEXEC:
       {
         int target = va_arg (arg, int);
-
-#if !HAVE_FCNTL
-        result = dupfd (fd, target, O_CLOEXEC);
-        break;
-#else /* HAVE_FCNTL */
-        /* Try the system call first, if the headers claim it exists
-           (that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we
-           may be running with a glibc that has the macro but with an
-           older kernel that does not support it.  Cache the
-           information on whether the system call really works, but
-           avoid caching failure if the corresponding F_DUPFD fails
-           for any reason.  0 = unknown, 1 = yes, -1 = no.  */
-        static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
-        if (0 <= have_dupfd_cloexec)
-          {
-            result = fcntl (fd, action, target);
-            if (0 <= result || errno != EINVAL)
-              {
-                have_dupfd_cloexec = 1;
-# if REPLACE_FCHDIR
-                if (0 <= result)
-                  result = _gl_register_dup (fd, result);
-# endif
-              }
-            else
-              {
-                result = rpl_fcntl (fd, F_DUPFD, target);
-                if (result < 0)
-                  break;
-                have_dupfd_cloexec = -1;
-              }
-          }
-        else
-          result = rpl_fcntl (fd, F_DUPFD, target);
-        if (0 <= result && have_dupfd_cloexec == -1)
-          {
-            int flags = fcntl (result, F_GETFD);
-            if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1)
-              {
-                int saved_errno = errno;
-                close (result);
-                errno = saved_errno;
-                result = -1;
-              }
-          }
+        result = rpl_fcntl_DUPFD_CLOEXEC (fd, target);
         break;
-#endif /* HAVE_FCNTL */
-      } /* F_DUPFD_CLOEXEC */
+      }
 
 #if !HAVE_FCNTL
     case F_GETFD:
       {
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
         HANDLE handle = (HANDLE) _get_osfhandle (fd);
         DWORD flags;
         if (handle == INVALID_HANDLE_VALUE
@@ -401,8 +256,183 @@ rpl_fcntl (int fd, int action, /* arg */...)
     default:
       {
 #if HAVE_FCNTL
-        void *p = va_arg (arg, void *);
-        result = fcntl (fd, action, p);
+        switch (action)
+          {
+          #ifdef F_BARRIERFSYNC                  /* macOS */
+          case F_BARRIERFSYNC:
+          #endif
+          #ifdef F_CHKCLEAN                      /* macOS */
+          case F_CHKCLEAN:
+          #endif
+          #ifdef F_CLOSEM                        /* NetBSD, HP-UX */
+          case F_CLOSEM:
+          #endif
+          #ifdef F_FLUSH_DATA                    /* macOS */
+          case F_FLUSH_DATA:
+          #endif
+          #ifdef F_FREEZE_FS                     /* macOS */
+          case F_FREEZE_FS:
+          #endif
+          #ifdef F_FULLFSYNC                     /* macOS */
+          case F_FULLFSYNC:
+          #endif
+          #ifdef F_GETCONFINED                   /* macOS */
+          case F_GETCONFINED:
+          #endif
+          #ifdef F_GETDEFAULTPROTLEVEL           /* macOS */
+          case F_GETDEFAULTPROTLEVEL:
+          #endif
+          #ifdef F_GETFD                         /* POSIX */
+          case F_GETFD:
+          #endif
+          #ifdef F_GETFL                         /* POSIX */
+          case F_GETFL:
+          #endif
+          #ifdef F_GETLEASE                      /* Linux */
+          case F_GETLEASE:
+          #endif
+          #ifdef F_GETNOSIGPIPE                  /* macOS */
+          case F_GETNOSIGPIPE:
+          #endif
+          #ifdef F_GETOWN                        /* POSIX */
+          case F_GETOWN:
+          #endif
+          #ifdef F_GETPIPE_SZ                    /* Linux */
+          case F_GETPIPE_SZ:
+          #endif
+          #ifdef F_GETPROTECTIONCLASS            /* macOS */
+          case F_GETPROTECTIONCLASS:
+          #endif
+          #ifdef F_GETPROTECTIONLEVEL            /* macOS */
+          case F_GETPROTECTIONLEVEL:
+          #endif
+          #ifdef F_GET_SEALS                     /* Linux */
+          case F_GET_SEALS:
+          #endif
+          #ifdef F_GETSIG                        /* Linux */
+          case F_GETSIG:
+          #endif
+          #ifdef F_MAXFD                         /* NetBSD */
+          case F_MAXFD:
+          #endif
+          #ifdef F_RECYCLE                       /* macOS */
+          case F_RECYCLE:
+          #endif
+          #ifdef F_SETFIFOENH                    /* HP-UX */
+          case F_SETFIFOENH:
+          #endif
+          #ifdef F_THAW_FS                       /* macOS */
+          case F_THAW_FS:
+          #endif
+            /* These actions take no argument.  */
+            result = fcntl (fd, action);
+            break;
+
+          #ifdef F_ADD_SEALS                     /* Linux */
+          case F_ADD_SEALS:
+          #endif
+          #ifdef F_BADFD                         /* Solaris */
+          case F_BADFD:
+          #endif
+          #ifdef F_CHECK_OPENEVT                 /* macOS */
+          case F_CHECK_OPENEVT:
+          #endif
+          #ifdef F_DUP2FD                        /* FreeBSD, AIX, Solaris */
+          case F_DUP2FD:
+          #endif
+          #ifdef F_DUP2FD_CLOEXEC                /* FreeBSD, Solaris */
+          case F_DUP2FD_CLOEXEC:
+          #endif
+          #ifdef F_DUP2FD_CLOFORK                /* Solaris */
+          case F_DUP2FD_CLOFORK:
+          #endif
+          #ifdef F_DUPFD                         /* POSIX */
+          case F_DUPFD:
+          #endif
+          #ifdef F_DUPFD_CLOEXEC                 /* POSIX */
+          case F_DUPFD_CLOEXEC:
+          #endif
+          #ifdef F_DUPFD_CLOFORK                 /* Solaris */
+          case F_DUPFD_CLOFORK:
+          #endif
+          #ifdef F_GETXFL                        /* Solaris */
+          case F_GETXFL:
+          #endif
+          #ifdef F_GLOBAL_NOCACHE                /* macOS */
+          case F_GLOBAL_NOCACHE:
+          #endif
+          #ifdef F_MAKECOMPRESSED                /* macOS */
+          case F_MAKECOMPRESSED:
+          #endif
+          #ifdef F_MOVEDATAEXTENTS               /* macOS */
+          case F_MOVEDATAEXTENTS:
+          #endif
+          #ifdef F_NOCACHE                       /* macOS */
+          case F_NOCACHE:
+          #endif
+          #ifdef F_NODIRECT                      /* macOS */
+          case F_NODIRECT:
+          #endif
+          #ifdef F_NOTIFY                        /* Linux */
+          case F_NOTIFY:
+          #endif
+          #ifdef F_OPLKACK                       /* IRIX */
+          case F_OPLKACK:
+          #endif
+          #ifdef F_OPLKREG                       /* IRIX */
+          case F_OPLKREG:
+          #endif
+          #ifdef F_RDAHEAD                       /* macOS */
+          case F_RDAHEAD:
+          #endif
+          #ifdef F_SETBACKINGSTORE               /* macOS */
+          case F_SETBACKINGSTORE:
+          #endif
+          #ifdef F_SETCONFINED                   /* macOS */
+          case F_SETCONFINED:
+          #endif
+          #ifdef F_SETFD                         /* POSIX */
+          case F_SETFD:
+          #endif
+          #ifdef F_SETFL                         /* POSIX */
+          case F_SETFL:
+          #endif
+          #ifdef F_SETLEASE                      /* Linux */
+          case F_SETLEASE:
+          #endif
+          #ifdef F_SETNOSIGPIPE                  /* macOS */
+          case F_SETNOSIGPIPE:
+          #endif
+          #ifdef F_SETOWN                        /* POSIX */
+          case F_SETOWN:
+          #endif
+          #ifdef F_SETPIPE_SZ                    /* Linux */
+          case F_SETPIPE_SZ:
+          #endif
+          #ifdef F_SETPROTECTIONCLASS            /* macOS */
+          case F_SETPROTECTIONCLASS:
+          #endif
+          #ifdef F_SETSIG                        /* Linux */
+          case F_SETSIG:
+          #endif
+          #ifdef F_SINGLE_WRITER                 /* macOS */
+          case F_SINGLE_WRITER:
+          #endif
+            /* These actions take an 'int' argument.  */
+            {
+              int x = va_arg (arg, int);
+              result = fcntl (fd, action, x);
+            }
+            break;
+
+          default:
+            /* Other actions take a pointer argument.  */
+            {
+              void *p = va_arg (arg, void *);
+              result = fcntl (fd, action, p);
+            }
+            break;
+          }
 #else
         errno = EINVAL;
 #endif
@@ -412,3 +442,188 @@ rpl_fcntl (int fd, int action, /* arg */...)
   va_end (arg);
   return result;
 }
+
+static int
+rpl_fcntl_DUPFD (int fd, int target)
+{
+  int result;
+#if !HAVE_FCNTL
+  result = dupfd (fd, target, 0);
+#elif FCNTL_DUPFD_BUGGY || REPLACE_FCHDIR
+  /* Detect invalid target; needed for cygwin 1.5.x.  */
+  if (target < 0 || getdtablesize () <= target)
+    {
+      result = -1;
+      errno = EINVAL;
+    }
+  else
+    {
+      /* Haiku alpha 2 loses fd flags on original.  */
+      int flags = fcntl (fd, F_GETFD);
+      if (flags < 0)
+        result = -1;
+      else
+        {
+          result = fcntl (fd, F_DUPFD, target);
+          if (0 <= result && fcntl (fd, F_SETFD, flags) == -1)
+            {
+              int saved_errno = errno;
+              close (result);
+              result = -1;
+              errno = saved_errno;
+            }
+# if REPLACE_FCHDIR
+          if (0 <= result)
+            result = _gl_register_dup (fd, result);
+# endif
+        }
+    }
+#else
+  result = fcntl (fd, F_DUPFD, target);
+#endif
+  return result;
+}
+
+static int
+rpl_fcntl_DUPFD_CLOEXEC (int fd, int target)
+{
+  int result;
+#if !HAVE_FCNTL
+  result = dupfd (fd, target, O_CLOEXEC);
+#else /* HAVE_FCNTL */
+# if defined __NetBSD__ || defined __HAIKU__
+  /* On NetBSD 9.0, the system fcntl (fd, F_DUPFD_CLOEXEC, target)
+     has only the same effect as fcntl (fd, F_DUPFD, target).  */
+  /* On Haiku, the system fcntl (fd, F_DUPFD_CLOEXEC, target) sets
+     the FD_CLOEXEC flag on fd, not on target.  Therefore avoid the
+     system fcntl in this case.  */
+#  define have_dupfd_cloexec -1
+# else
+  /* Try the system call first, if the headers claim it exists
+     (that is, if GNULIB_defined_F_DUPFD_CLOEXEC is 0), since we
+     may be running with a glibc that has the macro but with an
+     older kernel that does not support it.  Cache the
+     information on whether the system call really works, but
+     avoid caching failure if the corresponding F_DUPFD fails
+     for any reason.  0 = unknown, 1 = yes, -1 = no.  */
+  static int have_dupfd_cloexec = GNULIB_defined_F_DUPFD_CLOEXEC ? -1 : 0;
+  if (0 <= have_dupfd_cloexec)
+    {
+      result = fcntl (fd, F_DUPFD_CLOEXEC, target);
+      if (0 <= result || errno != EINVAL)
+        {
+          have_dupfd_cloexec = 1;
+#  if REPLACE_FCHDIR
+          if (0 <= result)
+            result = _gl_register_dup (fd, result);
+#  endif
+        }
+      else
+        {
+          result = rpl_fcntl_DUPFD (fd, target);
+          if (result >= 0)
+            have_dupfd_cloexec = -1;
+        }
+    }
+  else
+# endif
+    result = rpl_fcntl_DUPFD (fd, target);
+  if (0 <= result && have_dupfd_cloexec == -1)
+    {
+      int flags = fcntl (result, F_GETFD);
+      if (flags < 0 || fcntl (result, F_SETFD, flags | FD_CLOEXEC) == -1)
+        {
+          int saved_errno = errno;
+          close (result);
+          errno = saved_errno;
+          result = -1;
+        }
+    }
+#endif /* HAVE_FCNTL */
+  return result;
+}
+
+#undef fcntl
+
+#ifdef __KLIBC__
+
+static int
+klibc_fcntl (int fd, int action, /* arg */...)
+{
+  va_list arg_ptr;
+  int arg;
+  struct stat sbuf;
+  int result;
+
+  va_start (arg_ptr, action);
+  arg = va_arg (arg_ptr, int);
+  result = fcntl (fd, action, arg);
+  /* EPERM for F_DUPFD, ENOTSUP for others */
+  if (result == -1 && (errno == EPERM || errno == ENOTSUP)
+      && !fstat (fd, &sbuf) && S_ISDIR (sbuf.st_mode))
+    {
+      ULONG ulMode;
+
+      switch (action)
+        {
+        case F_DUPFD:
+          /* Find available fd */
+          while (fcntl (arg, F_GETFL) != -1 || errno != EBADF)
+            arg++;
+
+          result = dup2 (fd, arg);
+          break;
+
+        /* Using underlying APIs is right ? */
+        case F_GETFD:
+          if (DosQueryFHState (fd, &ulMode))
+            break;
+
+          result = (ulMode & OPEN_FLAGS_NOINHERIT) ? FD_CLOEXEC : 0;
+          break;
+
+        case F_SETFD:
+          if (arg & ~FD_CLOEXEC)
+            break;
+
+          if (DosQueryFHState (fd, &ulMode))
+            break;
+
+          if (arg & FD_CLOEXEC)
+            ulMode |= OPEN_FLAGS_NOINHERIT;
+          else
+            ulMode &= ~OPEN_FLAGS_NOINHERIT;
+
+          /* Filter supported flags.  */
+          ulMode &= (OPEN_FLAGS_WRITE_THROUGH | OPEN_FLAGS_FAIL_ON_ERROR
+                     | OPEN_FLAGS_NO_CACHE | OPEN_FLAGS_NOINHERIT);
+
+          if (DosSetFHState (fd, ulMode))
+            break;
+
+          result = 0;
+          break;
+
+        case F_GETFL:
+          result = 0;
+          break;
+
+        case F_SETFL:
+          if (arg != 0)
+            break;
+
+          result = 0;
+          break;
+
+        default:
+          errno = EINVAL;
+          break;
+        }
+    }
+
+  va_end (arg_ptr);
+
+  return result;
+}
+
+#endif
index b943973..0b14467 100644 (file)
@@ -1,6 +1,6 @@
 /* Like <fcntl.h>, but with non-working flags defined to 0.
 
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* written by Paul Eggert */
 
 #endif
 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
 
+/* Native Windows platforms declare open(), creat() in <io.h>.  */
+#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+    && (defined _WIN32 && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
 #else
 /* Normal invocation convention.  */
 
 /* The include_next requires a split double-inclusion guard.  */
 #@INCLUDE_NEXT@ @NEXT_FCNTL_H@
 
+/* Native Windows platforms declare open(), creat() in <io.h>.  */
+#if (@GNULIB_CREAT@ || @GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
+    && (defined _WIN32 && ! defined __CYGWIN__)
+# include <io.h>
+#endif
+
 #ifndef _@GUARD_PREFIX@_FCNTL_H
 #define _@GUARD_PREFIX@_FCNTL_H
 
 # include <unistd.h>
 #endif
 
-/* Native Windows platforms declare open(), creat() in <io.h>.  */
-#if (@GNULIB_OPEN@ || defined GNULIB_POSIXCHECK) \
-    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
-# include <io.h>
-#endif
-
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 
 /* Declare overridden functions.  */
 
+#if @GNULIB_CREAT@
+# if @REPLACE_CREAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef creat
+#   define creat rpl_creat
+#  endif
+_GL_FUNCDECL_RPL (creat, int, (const char *filename, mode_t mode)
+                             _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (creat, int, (const char *filename, mode_t mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef creat
+#   define creat _creat
+#  endif
+_GL_CXXALIAS_MDA (creat, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (creat);
+#elif defined GNULIB_POSIXCHECK
+# undef creat
+/* Assume creat is always declared.  */
+_GL_WARN_ON_USE (creat, "creat is not always POSIX compliant - "
+                 "use gnulib module creat for portability");
+#elif @GNULIB_MDA_CREAT@
+/* On native Windows, map 'creat' to '_creat', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::creat always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef creat
+#   define creat _creat
+#  endif
+/* Need to cast, because in mingw the last argument is 'int mode'.  */
+_GL_CXXALIAS_MDA_CAST (creat, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (creat, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (creat);
+#endif
+
 #if @GNULIB_FCNTL@
 # if @REPLACE_FCNTL@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #  endif
 _GL_FUNCDECL_RPL (fcntl, int, (int fd, int action, ...));
 _GL_CXXALIAS_RPL (fcntl, int, (int fd, int action, ...));
+#  if !GNULIB_defined_rpl_fcntl
+#   define GNULIB_defined_rpl_fcntl 1
+#  endif
 # else
 #  if !@HAVE_FCNTL@
 _GL_FUNCDECL_SYS (fcntl, int, (int fd, int action, ...));
+#   if !GNULIB_defined_fcntl
+#    define GNULIB_defined_fcntl 1
+#   endif
 #  endif
 _GL_CXXALIAS_SYS (fcntl, int, (int fd, int action, ...));
 # endif
@@ -114,6 +167,12 @@ _GL_WARN_ON_USE (fcntl, "fcntl is not always POSIX compliant - "
 _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
                              _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef open
+#   define open _open
+#  endif
+_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
 # else
 _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
 # endif
@@ -127,6 +186,22 @@ _GL_CXXALIASWARN (open);
 /* Assume open is always declared.  */
 _GL_WARN_ON_USE (open, "open is not always POSIX compliant - "
                  "use gnulib module open for portability");
+#elif @GNULIB_MDA_OPEN@
+/* On native Windows, map 'open' to '_open', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::open always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef open
+#   define open _open
+#  endif
+_GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
+# else
+_GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+# endif
+# if !defined __hpux
+_GL_CXXALIASWARN (open);
+# endif
 #endif
 
 #if @GNULIB_OPENAT@
@@ -213,7 +288,10 @@ _GL_WARN_ON_USE (openat, "openat is not portable - "
 #endif
 
 #ifndef O_CLOEXEC
-# define O_CLOEXEC 0
+# define O_CLOEXEC 0x40000000 /* Try to not collide with system O_* flags.  */
+# define GNULIB_defined_O_CLOEXEC 1
+#else
+# define GNULIB_defined_O_CLOEXEC 0
 #endif
 
 #ifndef O_DIRECT
index 8676c6b..d8113eb 100644 (file)
@@ -1,5 +1,5 @@
-/* Hook for making making file descriptor functions close(), ioctl() extensible.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Hook for making file descriptor functions close(), ioctl() extensible.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2009.
 
    This program is free software: you can redistribute it and/or modify it
@@ -13,7 +13,7 @@
    General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 9568d07..bf1f394 100644 (file)
@@ -1,5 +1,5 @@
-/* Hook for making making file descriptor functions close(), ioctl() extensible.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+/* Hook for making file descriptor functions close(), ioctl() extensible.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -12,7 +12,7 @@
    General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
 #ifndef FD_HOOK_H
index 4b86583..bfaef4d 100644 (file)
@@ -1,7 +1,7 @@
 /* Adjust a file descriptor result so that it avoids clobbering
    STD{IN,OUT,ERR}_FILENO, with specific flags.
 
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert and Eric Blake.  */
 
index 8a6bee2..487b039 100644 (file)
@@ -1,6 +1,6 @@
 /* Return a safer copy of a file descriptor.
 
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
diff --git a/lib/fdopendir.c b/lib/fdopendir.c
new file mode 100644 (file)
index 0000000..451b4e1
--- /dev/null
@@ -0,0 +1,249 @@
+/* provide a replacement fdopendir function
+   Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering */
+
+#include <config.h>
+
+#include <dirent.h>
+
+#include <stdlib.h>
+#include <unistd.h>
+
+#if !HAVE_FDOPENDIR
+
+# include "openat.h"
+# include "openat-priv.h"
+# include "save-cwd.h"
+
+# if GNULIB_DIRENT_SAFER
+#  include "dirent--.h"
+# endif
+
+# ifndef REPLACE_FCHDIR
+#  define REPLACE_FCHDIR 0
+# endif
+
+static DIR *fdopendir_with_dup (int, int, struct saved_cwd const *);
+static DIR *fd_clone_opendir (int, struct saved_cwd const *);
+
+/* Replacement for POSIX fdopendir.
+
+   First, try to simulate it via opendir ("/proc/self/fd/...").  Failing
+   that, simulate it by using fchdir metadata, or by doing
+   save_cwd/fchdir/opendir(".")/restore_cwd.
+   If either the save_cwd or the restore_cwd fails (relatively unlikely),
+   then give a diagnostic and exit nonzero.
+
+   If successful, the resulting stream is based on FD in
+   implementations where streams are based on file descriptors and in
+   applications where no other thread or signal handler allocates or
+   frees file descriptors.  In other cases, consult dirfd on the result
+   to find out whether FD is still being used.
+
+   Otherwise, this function works just like POSIX fdopendir.
+
+   W A R N I N G:
+
+   Unlike other fd-related functions, this one places constraints on FD.
+   If this function returns successfully, FD is under control of the
+   dirent.h system, and the caller should not close or modify the state of
+   FD other than by the dirent.h functions.  */
+# ifdef __KLIBC__
+#  include <InnoTekLIBC/backend.h>
+
+DIR *
+fdopendir (int fd)
+{
+  char path[_MAX_PATH];
+  DIR *dirp;
+
+  /* Get a path from fd */
+  if (__libc_Back_ioFHToPath (fd, path, sizeof (path)))
+    return NULL;
+
+  dirp = opendir (path);
+  if (!dirp)
+    return NULL;
+
+  /* Unregister fd registered by opendir() */
+  _gl_unregister_dirp_fd (dirfd (dirp));
+
+  /* Register our fd */
+  if (_gl_register_dirp_fd (fd, dirp))
+    {
+      int saved_errno = errno;
+
+      closedir (dirp);
+
+      errno = saved_errno;
+
+      dirp = NULL;
+    }
+
+  return dirp;
+}
+# else
+DIR *
+fdopendir (int fd)
+{
+  DIR *dir = fdopendir_with_dup (fd, -1, NULL);
+
+  if (! REPLACE_FCHDIR && ! dir)
+    {
+      int saved_errno = errno;
+      if (EXPECTED_ERRNO (saved_errno))
+        {
+          struct saved_cwd cwd;
+          if (save_cwd (&cwd) != 0)
+            openat_save_fail (errno);
+          dir = fdopendir_with_dup (fd, -1, &cwd);
+          saved_errno = errno;
+          free_cwd (&cwd);
+          errno = saved_errno;
+        }
+    }
+
+  return dir;
+}
+# endif
+
+/* Like fdopendir, except that if OLDER_DUPFD is not -1, it is known
+   to be a dup of FD which is less than FD - 1 and which will be
+   closed by the caller and not otherwise used by the caller.  This
+   function makes sure that FD is closed and all file descriptors less
+   than FD are open, and then calls fd_clone_opendir on a dup of FD.
+   That way, barring race conditions, fd_clone_opendir returns a
+   stream whose file descriptor is FD.
+
+   If REPLACE_FCHDIR or CWD is null, use opendir ("/proc/self/fd/...",
+   falling back on fchdir metadata.  Otherwise, CWD is a saved version
+   of the working directory; use fchdir/opendir(".")/restore_cwd(CWD).  */
+static DIR *
+fdopendir_with_dup (int fd, int older_dupfd, struct saved_cwd const *cwd)
+{
+  int dupfd = dup (fd);
+  if (dupfd < 0 && errno == EMFILE)
+    dupfd = older_dupfd;
+  if (dupfd < 0)
+    return NULL;
+  else
+    {
+      DIR *dir;
+      int saved_errno;
+      if (dupfd < fd - 1 && dupfd != older_dupfd)
+        {
+          dir = fdopendir_with_dup (fd, dupfd, cwd);
+          saved_errno = errno;
+        }
+      else
+        {
+          close (fd);
+          dir = fd_clone_opendir (dupfd, cwd);
+          saved_errno = errno;
+          if (! dir)
+            {
+              int fd1 = dup (dupfd);
+              if (fd1 != fd)
+                openat_save_fail (fd1 < 0 ? errno : EBADF);
+            }
+        }
+
+      if (dupfd != older_dupfd)
+        close (dupfd);
+      errno = saved_errno;
+      return dir;
+    }
+}
+
+/* Like fdopendir, except the result controls a clone of FD.  It is
+   the caller's responsibility both to close FD and (if the result is
+   not null) to closedir the result.  */
+static DIR *
+fd_clone_opendir (int fd, struct saved_cwd const *cwd)
+{
+  if (REPLACE_FCHDIR || ! cwd)
+    {
+      DIR *dir = NULL;
+      int saved_errno = EOPNOTSUPP;
+      char buf[OPENAT_BUFFER_SIZE];
+      char *proc_file = openat_proc_name (buf, fd, ".");
+      if (proc_file)
+        {
+          dir = opendir (proc_file);
+          saved_errno = errno;
+          if (proc_file != buf)
+            free (proc_file);
+        }
+# if REPLACE_FCHDIR
+      if (! dir && EXPECTED_ERRNO (saved_errno))
+        {
+          char const *name = _gl_directory_name (fd);
+          DIR *dp = name ? opendir (name) : NULL;
+
+          /* The caller has done an elaborate dance to arrange for opendir to
+             consume just the right file descriptor.  If dirfd returns -1,
+             though, we're on a system like mingw where opendir does not
+             consume a file descriptor.  Consume it via 'dup' instead.  */
+          if (dp && dirfd (dp) < 0)
+            dup (fd);
+
+          return dp;
+        }
+# endif
+      errno = saved_errno;
+      return dir;
+    }
+  else
+    {
+      if (fchdir (fd) != 0)
+        return NULL;
+      else
+        {
+          DIR *dir = opendir (".");
+          int saved_errno = errno;
+          if (restore_cwd (cwd) != 0)
+            openat_restore_fail (errno);
+          errno = saved_errno;
+          return dir;
+        }
+    }
+}
+
+#else /* HAVE_FDOPENDIR */
+
+# include <errno.h>
+# include <sys/stat.h>
+
+# undef fdopendir
+
+/* Like fdopendir, but work around GNU/Hurd bug by validating FD.  */
+
+DIR *
+rpl_fdopendir (int fd)
+{
+  struct stat st;
+  if (fstat (fd, &st))
+    return NULL;
+  if (!S_ISDIR (st.st_mode))
+    {
+      errno = ENOTDIR;
+      return NULL;
+    }
+  return fdopendir (fd);
+}
+
+#endif /* HAVE_FDOPENDIR */
index ef2a7f1..50c0ee1 100644 (file)
@@ -1,5 +1,5 @@
 /* fflush.c -- allow flushing input streams
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake. */
 
@@ -33,7 +33,8 @@
 #undef fflush
 
 
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+/* GNU libc, BeOS, Haiku, Linux libc5 */
 
 /* Clear the stream's ungetc buffer, preserving the value of ftello (fp).  */
 static void
@@ -51,7 +52,7 @@ static void
 clear_ungetc_buffer (FILE *fp)
 {
 # if defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
   if (HASUB (fp))
     {
       fp_->_p += fp_->_r;
@@ -63,7 +64,7 @@ clear_ungetc_buffer (FILE *fp)
       fp->_ungetc_count = 0;
       fp->_rcount = - fp->_rcount;
     }
-# elif defined _IOERR               /* Minix, AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */
+# elif defined _IOERR               /* Minix, AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
   /* Nothing to do.  */
 # else                              /* other implementations */
   fseeko (fp, 0, SEEK_CUR);
@@ -72,10 +73,11 @@ clear_ungetc_buffer (FILE *fp)
 
 #endif
 
-#if ! (defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */)
+#if ! (defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1)
+/* GNU libc, BeOS, Haiku, Linux libc5 */
 
 # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
-/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
 
 static int
 disable_seek_optimization (FILE *fp)
@@ -98,7 +100,7 @@ update_fpos_cache (FILE *fp _GL_UNUSED_PARAMETER,
                    off_t pos _GL_UNUSED_PARAMETER)
 {
 #  if defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
 #   if defined __CYGWIN__
   /* fp_->_offset is typed as an integer.  */
   fp_->_offset = pos;
@@ -148,7 +150,8 @@ rpl_fflush (FILE *stream)
   if (stream == NULL || ! freading (stream))
     return fflush (stream);
 
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+  /* GNU libc, BeOS, Haiku, Linux libc5 */
 
   clear_ungetc_buffer_preserving_position (stream);
 
@@ -156,25 +159,28 @@ rpl_fflush (FILE *stream)
 
 #else
   {
-    /* Notes about the file-position indicator:
-       1) The file position indicator is incremented by fgetc() and decremented
+    /* What POSIX says:
+       1) About the file-position indicator (-> fseeko, ftello):
+          The file position indicator is incremented by fgetc() and decremented
           by ungetc():
-          <http://www.opengroup.org/susv3/functions/fgetc.html>
+          <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fgetc.html>
             "... the fgetc() function shall ... advance the associated file
              position indicator for the stream ..."
-          <http://www.opengroup.org/susv3/functions/ungetc.html>
+          <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ungetc.html>
             "The file-position indicator is decremented by each successful
              call to ungetc()..."
-       2) <http://www.opengroup.org/susv3/functions/ungetc.html> says:
-            "The value of the file-position indicator for the stream after
-             reading or discarding all pushed-back bytes shall be the same
-             as it was before the bytes were pushed back."
-          Here we are discarding all pushed-back bytes.  But more specifically,
-       3) <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt> says:
-            "[After fflush(),] the file offset of the underlying open file
-             description shall be set to the file position of the stream, and
-             any characters pushed back onto the stream by ungetc() ... shall
-             be discarded."  */
+       2) fflush discards bytes pushed back by ungetc:
+          <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html>
+            "...any characters pushed back onto the stream by ungetc()
+             or ungetwc() that have not subsequently been read from the
+             stream shall be discarded..."
+          This implies implicitly: fflush does not change the file position
+          indicator.
+       3) Effects on the file descriptor, if the file descriptor is capable of
+          seeking:
+          <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html>
+            "...the file offset of the underlying open file description shall
+             be set to the file position of the stream..."  */
 
     /* POSIX does not specify fflush behavior for non-seekable input
        streams.  Some implementations purge unread data, some return
@@ -199,7 +205,7 @@ rpl_fflush (FILE *stream)
     }
 
 # if (defined __sferror || defined __DragonFly__ || defined __ANDROID__) && defined __SNPT
-    /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+    /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
 
     {
       /* Disable seek optimization for the next fseeko call.  This tells the
diff --git a/lib/file-set.c b/lib/file-set.c
new file mode 100644 (file)
index 0000000..3b99b21
--- /dev/null
@@ -0,0 +1,74 @@
+/* Specialized functions to manipulate a set of files.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering */
+
+#include <config.h>
+#include "file-set.h"
+
+#include "hash-triple.h"
+#include "xalloc.h"
+
+/* Record file, FILE, and dev/ino from *STATS, in the hash table, HT.
+   If HT is NULL, return immediately.
+   If memory allocation fails, exit immediately.  */
+void
+record_file (Hash_table *ht, char const *file, struct stat const *stats)
+{
+  struct F_triple *ent;
+
+  if (ht == NULL)
+    return;
+
+  ent = xmalloc (sizeof *ent);
+  ent->name = xstrdup (file);
+  ent->st_ino = stats->st_ino;
+  ent->st_dev = stats->st_dev;
+
+  {
+    struct F_triple *ent_from_table = hash_insert (ht, ent);
+    if (ent_from_table == NULL)
+      {
+        /* Insertion failed due to lack of memory.  */
+        xalloc_die ();
+      }
+
+    if (ent_from_table != ent)
+      {
+        /* There was already a matching entry in the table, so ENT was
+           not inserted.  Free it.  */
+        triple_free (ent);
+      }
+  }
+}
+
+/* Return true if there is an entry in hash table, HT,
+   for the file described by FILE and STATS.  */
+bool
+seen_file (Hash_table const *ht, char const *file,
+           struct stat const *stats)
+{
+  struct F_triple new_ent;
+
+  if (ht == NULL)
+    return false;
+
+  new_ent.name = (char *) file;
+  new_ent.st_ino = stats->st_ino;
+  new_ent.st_dev = stats->st_dev;
+
+  return !!hash_lookup (ht, &new_ent);
+}
diff --git a/lib/file-set.h b/lib/file-set.h
new file mode 100644 (file)
index 0000000..45c951e
--- /dev/null
@@ -0,0 +1,33 @@
+/* Very specialized set-of-files code.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering, 2007.  */
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdbool.h>
+
+#include "hash.h"
+
+extern void record_file (Hash_table *ht, char const *file,
+                         struct stat const *stats)
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
+  __attribute__ ((__nonnull__ (2, 3)))
+#endif
+;
+
+extern bool seen_file (Hash_table const *ht, char const *file,
+                       struct stat const *stats);
diff --git a/lib/filename.h b/lib/filename.h
new file mode 100644 (file)
index 0000000..541ffec
--- /dev/null
@@ -0,0 +1,112 @@
+/* Basic filename support macros.
+   Copyright (C) 2001-2004, 2007-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* From Paul Eggert and Jim Meyering.  */
+
+#ifndef _FILENAME_H
+#define _FILENAME_H
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Filename support.
+   ISSLASH(C)                  tests whether C is a directory separator
+                               character.
+   HAS_DEVICE(Filename)        tests whether Filename contains a device
+                               specification.
+   FILE_SYSTEM_PREFIX_LEN(Filename)  length of the device specification
+                                     at the beginning of Filename,
+                                     index of the part consisting of
+                                     alternating components and slashes.
+   FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+                               1 when a non-empty device specification
+                               can be followed by an empty or relative
+                               part,
+                               0 when a non-empty device specification
+                               must be followed by a slash,
+                               0 when device specification don't exist.
+   IS_ABSOLUTE_FILE_NAME(Filename)
+                               tests whether Filename is independent of
+                               any notion of "current directory".
+   IS_RELATIVE_FILE_NAME(Filename)
+                               tests whether Filename may be concatenated
+                               to a directory filename.
+   Note: On native Windows, OS/2, DOS, "c:" is neither an absolute nor a
+   relative file name!
+   IS_FILE_NAME_WITH_DIR(Filename)  tests whether Filename contains a device
+                                    or directory specification.
+ */
+#if defined _WIN32 || defined __CYGWIN__ \
+    || defined __EMX__ || defined __MSDOS__ || defined __DJGPP__
+  /* Native Windows, Cygwin, OS/2, DOS */
+# define ISSLASH(C) ((C) == '/' || (C) == '\\')
+  /* Internal macro: Tests whether a character is a drive letter.  */
+# define _IS_DRIVE_LETTER(C) \
+    (((C) >= 'A' && (C) <= 'Z') || ((C) >= 'a' && (C) <= 'z'))
+  /* Help the compiler optimizing it.  This assumes ASCII.  */
+# undef _IS_DRIVE_LETTER
+# define _IS_DRIVE_LETTER(C) \
+    (((unsigned int) (C) | ('a' - 'A')) - 'a' <= 'z' - 'a')
+# define HAS_DEVICE(Filename) \
+    (_IS_DRIVE_LETTER ((Filename)[0]) && (Filename)[1] == ':')
+# define FILE_SYSTEM_PREFIX_LEN(Filename) (HAS_DEVICE (Filename) ? 2 : 0)
+# ifdef __CYGWIN__
+#  define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# else
+   /* On native Windows, OS/2, DOS, the system has the notion of a
+      "current directory" on each drive.  */
+#  define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 1
+# endif
+# if FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE
+#  define IS_ABSOLUTE_FILE_NAME(Filename) \
+     ISSLASH ((Filename)[FILE_SYSTEM_PREFIX_LEN (Filename)])
+# else
+#  define IS_ABSOLUTE_FILE_NAME(Filename) \
+     (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename))
+# endif
+# define IS_RELATIVE_FILE_NAME(Filename) \
+    (! (ISSLASH ((Filename)[0]) || HAS_DEVICE (Filename)))
+# define IS_FILE_NAME_WITH_DIR(Filename) \
+    (strchr ((Filename), '/') != NULL || strchr ((Filename), '\\') != NULL \
+     || HAS_DEVICE (Filename))
+#else
+  /* Unix */
+# define ISSLASH(C) ((C) == '/')
+# define HAS_DEVICE(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_PREFIX_LEN(Filename) ((void) (Filename), 0)
+# define FILE_SYSTEM_DRIVE_PREFIX_CAN_BE_RELATIVE 0
+# define IS_ABSOLUTE_FILE_NAME(Filename) ISSLASH ((Filename)[0])
+# define IS_RELATIVE_FILE_NAME(Filename) (! ISSLASH ((Filename)[0]))
+# define IS_FILE_NAME_WITH_DIR(Filename) (strchr ((Filename), '/') != NULL)
+#endif
+
+/* Deprecated macros.  For backward compatibility with old users of the
+   'filename' module.  */
+#define IS_ABSOLUTE_PATH IS_ABSOLUTE_FILE_NAME
+#define IS_PATH_WITH_DIR IS_FILE_NAME_WITH_DIR
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FILENAME_H */
index 4903fbf..008a640 100644 (file)
@@ -1,6 +1,6 @@
 /* Concatenate two arbitrary file names.
 
-   Copyright (C) 1996-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1996-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering.  */
 
 #include <stdlib.h>
 #include <string.h>
 
-#include "dirname.h"
+#include "basename-lgpl.h"
+#include "filename.h"
 
 #if ! HAVE_MEMPCPY && ! defined mempcpy
 # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
 #endif
 
-/* Return the longest suffix of F that is a relative file name.
-   If it has no such suffix, return the empty string.  */
-
-static char const * _GL_ATTRIBUTE_PURE
-longest_relative_suffix (char const *f)
-{
-  for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++)
-    continue;
-  return f;
-}
-
-/* Concatenate two file name components, DIR and ABASE, in
+/* Concatenate two file name components, DIR and BASE, in
    newly-allocated storage and return the result.
    The resulting file name F is such that the commands "ls F" and "(cd
-   DIR; ls BASE)" refer to the same file, where BASE is ABASE with any
-   file system prefixes and leading separators removed.
-   Arrange for a directory separator if necessary between DIR and BASE
-   in the result, removing any redundant separators.
+   DIR; ls ./BASE)" refer to the same file.  If necessary, put
+   a separator between DIR and BASE in the result.  Typically this
+   separator is "/", but in rare cases it might be ".".
    In any case, if BASE_IN_RESULT is non-NULL, set
-   *BASE_IN_RESULT to point to the copy of ABASE in the returned
-   concatenation.  However, if ABASE begins with more than one slash,
-   set *BASE_IN_RESULT to point to the sole corresponding slash that
-   is copied into the result buffer.
+   *BASE_IN_RESULT to point to the copy of BASE at the end of the
+   returned concatenation.
 
-   Return NULL if malloc fails.  */
+   If malloc fails, return NULL with errno set.  */
 
 char *
-mfile_name_concat (char const *dir, char const *abase, char **base_in_result)
+mfile_name_concat (char const *dir, char const *base, char **base_in_result)
 {
   char const *dirbase = last_component (dir);
   size_t dirbaselen = base_len (dirbase);
   size_t dirlen = dirbase - dir + dirbaselen;
-  size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1]));
-
-  char const *base = longest_relative_suffix (abase);
   size_t baselen = strlen (base);
-
-  char *p_concat = malloc (dirlen + needs_separator + baselen + 1);
-  char *p;
-
+  char sep = '\0';
+  if (dirbaselen)
+    {
+      /* DIR is not a file system root, so separate with / if needed.  */
+      if (! ISSLASH (dir[dirlen - 1]) && ! ISSLASH (*base))
+        sep = '/';
+    }
+  else if (ISSLASH (*base))
+    {
+      /* DIR is a file system root and BASE begins with a slash, so
+         separate with ".".  For example, if DIR is "/" and BASE is
+         "/foo" then return "/./foo", as "//foo" would be wrong on
+         some POSIX systems.  A fancier algorithm could omit "." in
+         some cases but is not worth the trouble.  */
+      sep = '.';
+    }
+
+  char *p_concat = malloc (dirlen + (sep != '\0')  + baselen + 1);
   if (p_concat == NULL)
     return NULL;
 
-  p = mempcpy (p_concat, dir, dirlen);
-  *p = DIRECTORY_SEPARATOR;
-  p += needs_separator;
+  {
+    char *p;
+
+    p = mempcpy (p_concat, dir, dirlen);
+    *p = sep;
+    p += sep != '\0';
 
-  if (base_in_result)
-    *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase);
+    if (base_in_result)
+      *base_in_result = p;
 
-  p = mempcpy (p, base, baselen);
-  *p = '\0';
+    p = mempcpy (p, base, baselen);
+    *p = '\0';
+  }
 
   return p_concat;
 }
index 06cfeae..8180acc 100644 (file)
@@ -1,6 +1,6 @@
 /* Concatenate two arbitrary file names.
 
-   Copyright (C) 1996-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1996-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering.  */
 
@@ -32,9 +32,9 @@
    "memory exhausted" condition and exit.  */
 
 char *
-file_name_concat (char const *dir, char const *abase, char **base_in_result)
+file_name_concat (char const *dir, char const *base, char **base_in_result)
 {
-  char *p = mfile_name_concat (dir, abase, base_in_result);
+  char *p = mfile_name_concat (dir, base, base_in_result);
   if (p == NULL)
     xalloc_die ();
   return p;
index 791a0af..15c5cf8 100644 (file)
@@ -1,6 +1,6 @@
 /* Concatenate two arbitrary file names.
 
-   Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2016 Free Software
+   Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering.  */
 
diff --git a/lib/findprog-in.c b/lib/findprog-in.c
new file mode 100644 (file)
index 0000000..7e0fb4e
--- /dev/null
@@ -0,0 +1,399 @@
+/* Locating a program in a given path.
+   Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <haible@clisp.cons.org>, 2001, 2019.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+
+#include <config.h>
+
+/* Specification.  */
+#include "findprog.h"
+
+#include <errno.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#include "filename.h"
+#include "concat-filename.h"
+
+#if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
+  /* Native Windows, OS/2, DOS */
+# define NATIVE_SLASH '\\'
+#else
+  /* Unix */
+# define NATIVE_SLASH '/'
+#endif
+
+/* Separator in PATH like lists of pathnames.  */
+#if (defined _WIN32 && !defined __CYGWIN__) || defined __EMX__ || defined __DJGPP__
+  /* Native Windows, OS/2, DOS */
+# define PATH_SEPARATOR ';'
+#else
+  /* Unix */
+# define PATH_SEPARATOR ':'
+#endif
+
+/* The list of suffixes that the execlp/execvp function tries when searching
+   for the program.  */
+static const char * const suffixes[] =
+  {
+    #if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
+    "", ".com", ".exe", ".bat", ".cmd"
+    /* Note: Files without any suffix are not considered executable.  */
+    /* Note: The cmd.exe program does a different lookup: It searches according
+       to the PATHEXT environment variable.
+       See <https://stackoverflow.com/questions/7839150/>.
+       Also, it executes files ending in .bat and .cmd directly without letting
+       the kernel interpret the program file.  */
+    #elif defined __CYGWIN__
+    "", ".exe", ".com"
+    #elif defined __EMX__
+    "", ".exe"
+    #elif defined __DJGPP__
+    "", ".com", ".exe", ".bat"
+    #else /* Unix */
+    ""
+    #endif
+  };
+
+const char *
+find_in_given_path (const char *progname, const char *path,
+                    const char *directory, bool optimize_for_exec)
+{
+  {
+    bool has_slash = false;
+    {
+      const char *p;
+
+      for (p = progname; *p != '\0'; p++)
+        if (ISSLASH (*p))
+          {
+            has_slash = true;
+            break;
+          }
+    }
+    if (has_slash)
+      {
+        /* If progname contains a slash, it is either absolute or relative to
+           the current directory.  PATH is not used.  */
+        if (optimize_for_exec)
+          /* The execl/execv/execlp/execvp functions will try the various
+             suffixes anyway and fail if no executable is found.  */
+          return progname;
+        else
+          {
+            /* Try the various suffixes and see whether one of the files
+               with such a suffix is actually executable.  */
+            int failure_errno;
+            size_t i;
+
+            const char *directory_as_prefix =
+              (directory != NULL && IS_RELATIVE_FILE_NAME (progname)
+               ? directory
+               : "");
+
+            #if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
+            const char *progbasename;
+
+            {
+              const char *p;
+
+              progbasename = progname;
+              for (p = progname; *p != '\0'; p++)
+                if (ISSLASH (*p))
+                  progbasename = p + 1;
+            }
+
+            bool progbasename_has_dot = (strchr (progbasename, '.') != NULL);
+            #endif
+
+            /* Try all platform-dependent suffixes.  */
+            failure_errno = ENOENT;
+            for (i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); i++)
+              {
+                const char *suffix = suffixes[i];
+
+                #if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
+                /* File names without a '.' are not considered executable, and
+                   for file names with a '.' no additional suffix is tried.  */
+                if ((*suffix != '\0') != progbasename_has_dot)
+                #endif
+                  {
+                    /* Concatenate directory_as_prefix, progname, suffix.  */
+                    char *progpathname =
+                      concatenated_filename (directory_as_prefix, progname,
+                                             suffix);
+
+                    if (progpathname == NULL)
+                      return NULL; /* errno is set here */
+
+                    /* On systems which have the eaccess() system call, let's
+                       use it.  On other systems, let's hope that this program
+                       is not installed setuid or setgid, so that it is ok to
+                       call access() despite its design flaw.  */
+                    if (eaccess (progpathname, X_OK) == 0)
+                      {
+                        /* Check that the progpathname does not point to a
+                           directory.  */
+                        struct stat statbuf;
+
+                        if (stat (progpathname, &statbuf) >= 0)
+                          {
+                            if (! S_ISDIR (statbuf.st_mode))
+                              {
+                                /* Found!  */
+                                if (strcmp (progpathname, progname) == 0)
+                                  {
+                                    free (progpathname);
+                                    return progname;
+                                  }
+                                else
+                                  return progpathname;
+                              }
+
+                            errno = EACCES;
+                          }
+                      }
+
+                    if (errno != ENOENT)
+                      failure_errno = errno;
+
+                    free (progpathname);
+                  }
+              }
+            #if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
+            if (failure_errno == ENOENT && !progbasename_has_dot)
+              {
+                /* In the loop above, we skipped suffix = "".  Do this loop
+                   round now, merely to provide a better errno than ENOENT.  */
+
+                char *progpathname =
+                  concatenated_filename (directory_as_prefix, progname, "");
+
+                if (progpathname == NULL)
+                  return NULL; /* errno is set here */
+
+                if (eaccess (progpathname, X_OK) == 0)
+                  {
+                    struct stat statbuf;
+
+                    if (stat (progpathname, &statbuf) >= 0)
+                      {
+                        if (! S_ISDIR (statbuf.st_mode))
+                          errno = ENOEXEC;
+                        else
+                          errno = EACCES;
+                      }
+                  }
+
+                failure_errno = errno;
+
+                free (progpathname);
+              }
+            #endif
+
+            errno = failure_errno;
+            return NULL;
+          }
+      }
+  }
+
+  if (path == NULL)
+    /* If PATH is not set, the default search path is implementation dependent.
+       In practice, it is treated like an empty PATH.  */
+    path = "";
+
+  {
+    /* Make a copy, to prepare for destructive modifications.  */
+    char *path_copy = strdup (path);
+    if (path_copy == NULL)
+      return NULL; /* errno is set here */
+
+    int failure_errno;
+    char *path_rest;
+    char *cp;
+
+    #if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
+    bool progname_has_dot = (strchr (progname, '.') != NULL);
+    #endif
+
+    failure_errno = ENOENT;
+    for (path_rest = path_copy; ; path_rest = cp + 1)
+      {
+        const char *dir;
+        bool last;
+        char *dir_as_prefix_to_free;
+        const char *dir_as_prefix;
+        size_t i;
+
+        /* Extract next directory in PATH.  */
+        dir = path_rest;
+        for (cp = path_rest; *cp != '\0' && *cp != PATH_SEPARATOR; cp++)
+          ;
+        last = (*cp == '\0');
+        *cp = '\0';
+
+        /* Empty PATH components designate the current directory.  */
+        if (dir == cp)
+          dir = ".";
+
+        /* Concatenate directory and dir.  */
+        if (directory != NULL && IS_RELATIVE_FILE_NAME (dir))
+          {
+            dir_as_prefix_to_free =
+              concatenated_filename (directory, dir, NULL);
+            if (dir_as_prefix_to_free == NULL)
+              {
+                /* errno is set here.  */
+                failure_errno = errno;
+                goto failed;
+              }
+            dir_as_prefix = dir_as_prefix_to_free;
+          }
+        else
+          {
+            dir_as_prefix_to_free = NULL;
+            dir_as_prefix = dir;
+          }
+
+        /* Try all platform-dependent suffixes.  */
+        for (i = 0; i < sizeof (suffixes) / sizeof (suffixes[0]); i++)
+          {
+            const char *suffix = suffixes[i];
+
+            #if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
+            /* File names without a '.' are not considered executable, and
+               for file names with a '.' no additional suffix is tried.  */
+            if ((*suffix != '\0') != progname_has_dot)
+            #endif
+              {
+                /* Concatenate dir_as_prefix, progname, and suffix.  */
+                char *progpathname =
+                  concatenated_filename (dir_as_prefix, progname, suffix);
+
+                if (progpathname == NULL)
+                  {
+                    /* errno is set here.  */
+                    failure_errno = errno;
+                    free (dir_as_prefix_to_free);
+                    goto failed;
+                  }
+
+                /* On systems which have the eaccess() system call, let's
+                   use it.  On other systems, let's hope that this program
+                   is not installed setuid or setgid, so that it is ok to
+                   call access() despite its design flaw.  */
+                if (eaccess (progpathname, X_OK) == 0)
+                  {
+                    /* Check that the progpathname does not point to a
+                       directory.  */
+                    struct stat statbuf;
+
+                    if (stat (progpathname, &statbuf) >= 0)
+                      {
+                        if (! S_ISDIR (statbuf.st_mode))
+                          {
+                            /* Found!  */
+                            if (strcmp (progpathname, progname) == 0)
+                              {
+                                free (progpathname);
+
+                                /* Add the "./" prefix for real, that
+                                   concatenated_filename() optimized away.
+                                   This avoids a second PATH search when the
+                                   caller uses execl/execv/execlp/execvp.  */
+                                progpathname =
+                                  (char *) malloc (2 + strlen (progname) + 1);
+                                if (progpathname == NULL)
+                                  {
+                                    /* errno is set here.  */
+                                    failure_errno = errno;
+                                    free (dir_as_prefix_to_free);
+                                    goto failed;
+                                  }
+                                progpathname[0] = '.';
+                                progpathname[1] = NATIVE_SLASH;
+                                memcpy (progpathname + 2, progname,
+                                        strlen (progname) + 1);
+                              }
+
+                            free (dir_as_prefix_to_free);
+                            free (path_copy);
+                            return progpathname;
+                          }
+
+                        errno = EACCES;
+                      }
+                  }
+
+                if (errno != ENOENT)
+                  failure_errno = errno;
+
+                free (progpathname);
+              }
+          }
+        #if defined _WIN32 && !defined __CYGWIN__ /* Native Windows */
+        if (failure_errno == ENOENT && !progname_has_dot)
+          {
+            /* In the loop above, we skipped suffix = "".  Do this loop
+               round now, merely to provide a better errno than ENOENT.  */
+
+            char *progpathname =
+              concatenated_filename (dir_as_prefix, progname, "");
+
+            if (progpathname == NULL)
+              {
+                /* errno is set here.  */
+                failure_errno = errno;
+                free (dir_as_prefix_to_free);
+                goto failed;
+              }
+
+            if (eaccess (progpathname, X_OK) == 0)
+              {
+                struct stat statbuf;
+
+                if (stat (progpathname, &statbuf) >= 0)
+                  {
+                    if (! S_ISDIR (statbuf.st_mode))
+                      errno = ENOEXEC;
+                    else
+                      errno = EACCES;
+                  }
+              }
+
+            failure_errno = errno;
+
+            free (progpathname);
+          }
+        #endif
+
+        free (dir_as_prefix_to_free);
+
+        if (last)
+          break;
+      }
+
+   failed:
+    /* Not found in PATH.  */
+    free (path_copy);
+
+    errno = failure_errno;
+    return NULL;
+  }
+}
diff --git a/lib/findprog.h b/lib/findprog.h
new file mode 100644 (file)
index 0000000..04d2d35
--- /dev/null
@@ -0,0 +1,77 @@
+/* Locating a program in PATH.
+   Copyright (C) 2001-2003, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _FINDPROG_H
+#define _FINDPROG_H
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Looks up a program in the PATH.
+   Attempts to determine the pathname that would be called by execlp/execvp
+   of PROGNAME.  If successful, it returns a pathname containing a slash
+   (either absolute or relative to the current directory).  Otherwise, it
+   returns PROGNAME unmodified.
+   Because of the latter case, callers should use execlp/execvp, not
+   execl/execv on the returned pathname.
+   The returned string is freshly malloc()ed if it is != PROGNAME.  */
+extern const char *find_in_path (const char *progname);
+
+/* Looks up a program in the given PATH-like string.
+
+   The PATH argument consists of a list of directories, separated by ':' or
+   (on native Windows) by ';'.  An empty PATH element designates the current
+   directory.  A null PATH is equivalent to an empty PATH, that is, to the
+   singleton list that contains only the current directory.
+
+   If DIRECTORY is not NULL, all relative filenames (i.e. PROGNAME when it
+   contains a slash, and the PATH elements) are considered relative to
+   DIRECTORY instead of relative to the current directory of this process.
+
+   Determines the pathname that would be called by execlp/execvp of PROGNAME.
+   - If successful, it returns a pathname containing a slash (either absolute
+     or relative to the current directory).  The returned string can be used
+     with either execl/execv or execlp/execvp.  It is freshly malloc()ed if it
+     is != PROGNAME.
+   - Otherwise, it sets errno and returns NULL.
+     Specific errno values include:
+       - ENOENT: means that the program's file was not found.
+       - EACCES: means that the program's file cannot be accessed (due to some
+         issue with one of the ancestor directories) or lacks the execute
+         permissions.
+       - ENOMEM: means out of memory.
+   If OPTIMIZE_FOR_EXEC is true, the function saves some work, under the
+   assumption that the resulting pathname will not be accessed directly,
+   only through execl/execv or execlp/execvp.
+
+   Here, a "slash" means:
+     - On POSIX systems excluding Cygwin: a '/',
+     - On Windows, OS/2, DOS platforms: a '/' or '\'. */
+extern const char *find_in_given_path (const char *progname, const char *path,
+                                       const char *directory,
+                                       bool optimize_for_exec);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FINDPROG_H */
diff --git a/lib/flexmember.h b/lib/flexmember.h
new file mode 100644 (file)
index 0000000..9f6e1bf
--- /dev/null
@@ -0,0 +1,60 @@
+/* Sizes of structs with flexible array members.
+
+   Copyright 2016-2021 Free Software Foundation, Inc.
+
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.
+
+   Written by Paul Eggert.  */
+
+#include <stddef.h>
+
+/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below.
+   On older platforms without _Alignof, use a pessimistic bound that is
+   safe in practice even if FLEXIBLE_ARRAY_MEMBER is 1.
+   On newer platforms, use _Alignof to get a tighter bound.  */
+
+#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
+# define FLEXALIGNOF(type) (sizeof (type) & ~ (sizeof (type) - 1))
+#else
+# define FLEXALIGNOF(type) _Alignof (type)
+#endif
+
+/* Yield a properly aligned upper bound on the size of a struct of
+   type TYPE with a flexible array member named MEMBER that is
+   followed by N bytes of other data.  The result is suitable as an
+   argument to malloc.  For example:
+
+     struct s { int n; char d[FLEXIBLE_ARRAY_MEMBER]; };
+     struct s *p = malloc (FLEXSIZEOF (struct s, d, n * sizeof (char)));
+
+   FLEXSIZEOF (TYPE, MEMBER, N) is not simply (sizeof (TYPE) + N),
+   since FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms.  Nor is
+   it simply (offsetof (TYPE, MEMBER) + N), as that might yield a size
+   that causes malloc to yield a pointer that is not properly aligned
+   for TYPE; for example, if sizeof (int) == alignof (int) == 4,
+   malloc (offsetof (struct s, d) + 3 * sizeof (char)) is equivalent
+   to malloc (7) and might yield a pointer that is not a multiple of 4
+   (which means the pointer is not properly aligned for struct s),
+   whereas malloc (FLEXSIZEOF (struct s, d, 3 * sizeof (char))) is
+   equivalent to malloc (8) and must yield a pointer that is a
+   multiple of 4.
+
+   Yield a value less than N if and only if arithmetic overflow occurs.  */
+
+#define FLEXSIZEOF(type, member, n) \
+   ((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \
+    & ~ (FLEXALIGNOF (type) - 1))
index 00fcc76..97c0b0a 100644 (file)
@@ -1,5 +1,5 @@
 /* Supplemental information about the floating-point formats.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _FLOATPLUS_H
 #define _FLOATPLUS_H
index 1bad2ee..6ef47a4 100644 (file)
@@ -1,5 +1,5 @@
 /* Auxiliary definitions for <float.h>.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 0b93d90..d2ac0cd 100644 (file)
@@ -1,6 +1,6 @@
 /* A correct <float.h>.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _@GUARD_PREFIX@_FLOAT_H
 
@@ -62,8 +62,8 @@
 
 /* On FreeBSD/x86 6.4, the 'long double' type really has only 53 bits of
    precision in the compiler but 64 bits of precision at runtime.  See
-   <http://lists.gnu.org/archive/html/bug-gnulib/2008-07/msg00063.html>.  */
-#if defined __i386__ && defined __FreeBSD__
+   <https://lists.gnu.org/r/bug-gnulib/2008-07/msg00063.html>.  */
+#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
 /* Number of mantissa units, in base FLT_RADIX.  */
 # undef LDBL_MANT_DIG
 # define LDBL_MANT_DIG   64
@@ -81,7 +81,7 @@
 # define LDBL_MAX_EXP    16384
 /* Minimum positive normalized number.  */
 # undef LDBL_MIN
-# define LDBL_MIN        3.3621031431120935E-4932L /* = 0x1p-16382L */
+# define LDBL_MIN        3.362103143112093506262677817321752E-4932L /* = 0x1p-16382L */
 /* Maximum representable finite number.  */
 # undef LDBL_MAX
 /* LDBL_MAX is represented as { 0xFFFFFFFF, 0xFFFFFFFF, 32766 }.
      extern const long double LDBL_MAX;
 
    Unfortunately, this is not a constant expression.  */
+# if !GNULIB_defined_long_double_union
 union gl_long_double_union
   {
     struct { unsigned int lo; unsigned int hi; unsigned int exponent; } xd;
     long double ld;
   };
+#  define GNULIB_defined_long_double_union 1
+# endif
 extern const union gl_long_double_union gl_LDBL_MAX;
 # define LDBL_MAX (gl_LDBL_MAX.ld)
 /* Minimum e such that 10^e is in the range of normalized numbers.  */
@@ -146,11 +149,14 @@ extern const union gl_long_double_union gl_LDBL_MAX;
 
    Unfortunately, this is not a constant expression, and the latter expression
    does not work well when GCC is optimizing..  */
+# if !GNULIB_defined_long_double_union
 union gl_long_double_union
   {
     struct { double hi; double lo; } dd;
     long double ld;
   };
+#  define GNULIB_defined_long_double_union 1
+# endif
 extern const union gl_long_double_union gl_LDBL_MAX;
 # define LDBL_MAX (gl_LDBL_MAX.ld)
 #endif
index 6e7c08d..ff20279 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke fopen, but avoid some glitches.
 
-   Copyright (C) 2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2004-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
index 6c0c847..899ed33 100644 (file)
@@ -1,5 +1,5 @@
 /* Open a stream to a file.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
 /* If the user's config.h happens to include <stdio.h>, let it include only
    the system's <stdio.h> here, so that orig_fopen doesn't recurse to
    rpl_fopen.  */
-#define __need_FILE
+#define _GL_ALREADY_INCLUDING_STDIO_H
 #include <config.h>
 
 /* Get the original definition of fopen.  It might be defined as a macro.  */
 #include <stdio.h>
-#undef __need_FILE
+#undef _GL_ALREADY_INCLUDING_STDIO_H
 
 static FILE *
 orig_fopen (const char *filename, const char *mode)
@@ -39,6 +39,7 @@ orig_fopen (const char *filename, const char *mode)
 
 #include <errno.h>
 #include <fcntl.h>
+#include <stdbool.h>
 #include <string.h>
 #include <unistd.h>
 #include <sys/types.h>
@@ -47,26 +48,118 @@ orig_fopen (const char *filename, const char *mode)
 FILE *
 rpl_fopen (const char *filename, const char *mode)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+  int open_direction;
+  int open_flags;
+#if GNULIB_FOPEN_GNU
+  bool open_flags_gnu;
+# define BUF_SIZE 80
+  char fdopen_mode_buf[BUF_SIZE + 1];
+#endif
+
+#if defined _WIN32 && ! defined __CYGWIN__
   if (strcmp (filename, "/dev/null") == 0)
     filename = "NUL";
 #endif
 
+  /* Parse the mode.  */
+  open_direction = 0;
+  open_flags = 0;
+#if GNULIB_FOPEN_GNU
+  open_flags_gnu = false;
+#endif
+  {
+    const char *p = mode;
+#if GNULIB_FOPEN_GNU
+    char *q = fdopen_mode_buf;
+#endif
+
+    for (; *p != '\0'; p++)
+      {
+        switch (*p)
+          {
+          case 'r':
+            open_direction = O_RDONLY;
+#if GNULIB_FOPEN_GNU
+            if (q < fdopen_mode_buf + BUF_SIZE)
+              *q++ = *p;
+#endif
+            continue;
+          case 'w':
+            open_direction = O_WRONLY;
+            open_flags |= O_CREAT | O_TRUNC;
+#if GNULIB_FOPEN_GNU
+            if (q < fdopen_mode_buf + BUF_SIZE)
+              *q++ = *p;
+#endif
+            continue;
+          case 'a':
+            open_direction = O_WRONLY;
+            open_flags |= O_CREAT | O_APPEND;
+#if GNULIB_FOPEN_GNU
+            if (q < fdopen_mode_buf + BUF_SIZE)
+              *q++ = *p;
+#endif
+            continue;
+          case 'b':
+            /* While it is non-standard, O_BINARY is guaranteed by
+               gnulib <fcntl.h>.  We can also assume that orig_fopen
+               supports the 'b' flag.  */
+            open_flags |= O_BINARY;
+#if GNULIB_FOPEN_GNU
+            if (q < fdopen_mode_buf + BUF_SIZE)
+              *q++ = *p;
+#endif
+            continue;
+          case '+':
+            open_direction = O_RDWR;
+#if GNULIB_FOPEN_GNU
+            if (q < fdopen_mode_buf + BUF_SIZE)
+              *q++ = *p;
+#endif
+            continue;
+#if GNULIB_FOPEN_GNU
+          case 'x':
+            open_flags |= O_EXCL;
+            open_flags_gnu = true;
+            continue;
+          case 'e':
+            open_flags |= O_CLOEXEC;
+            open_flags_gnu = true;
+            continue;
+#endif
+          default:
+            break;
+          }
+#if GNULIB_FOPEN_GNU
+        /* The rest of the mode string can be a platform-dependent extension.
+           Copy it unmodified.  */
+        {
+          size_t len = strlen (p);
+          if (len > fdopen_mode_buf + BUF_SIZE - q)
+            len = fdopen_mode_buf + BUF_SIZE - q;
+          memcpy (q, p, len);
+          q += len;
+        }
+#endif
+        break;
+      }
+#if GNULIB_FOPEN_GNU
+    *q = '\0';
+#endif
+  }
+
 #if FOPEN_TRAILING_SLASH_BUG
-  /* If the filename ends in a slash and a mode that requires write access is
-     specified, then fail.
-     Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html>
-     says that
-       "A pathname that contains at least one non-slash character and that
-        ends with one or more trailing slashes shall be resolved as if a
-        single dot character ( '.' ) were appended to the pathname."
-     and
-       "The special filename dot shall refer to the directory specified by
-        its predecessor."
+  /* Fail if the mode requires write access and the filename ends in a slash,
+     as POSIX says such a filename must name a directory
+     <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+       "A pathname that contains at least one non-<slash> character and that
+        ends with one or more trailing <slash> characters shall not be resolved
+        successfully unless the last pathname component before the trailing
+        <slash> characters names an existing directory"
      If the named file already exists as a directory, then if a mode that
      requires write access is specified, fopen() must fail because POSIX
-     <http://www.opengroup.org/susv3/functions/fopen.html> says that it
-     fails with errno = EISDIR in this case.
+     <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html>
+     says that it fails with errno = EISDIR in this case.
      If the named file does not exist or does not name a directory, then
      fopen() must fail since the file does not contain a '.' directory.  */
   {
@@ -77,13 +170,14 @@ rpl_fopen (const char *filename, const char *mode)
         struct stat statbuf;
         FILE *fp;
 
-        if (mode[0] == 'w' || mode[0] == 'a')
+        if (open_direction != O_RDONLY)
           {
             errno = EISDIR;
             return NULL;
           }
 
-        fd = open (filename, O_RDONLY);
+        fd = open (filename, open_direction | open_flags,
+                   S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
         if (fd < 0)
           return NULL;
 
@@ -94,7 +188,11 @@ rpl_fopen (const char *filename, const char *mode)
             return NULL;
           }
 
+# if GNULIB_FOPEN_GNU
+        fp = fdopen (fd, fdopen_mode_buf);
+# else
         fp = fdopen (fd, mode);
+# endif
         if (fp == NULL)
           {
             int saved_errno = errno;
@@ -104,7 +202,29 @@ rpl_fopen (const char *filename, const char *mode)
         return fp;
       }
   }
-# endif
+#endif
+
+#if GNULIB_FOPEN_GNU
+  if (open_flags_gnu)
+    {
+      int fd;
+      FILE *fp;
+
+      fd = open (filename, open_direction | open_flags,
+                 S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
+      if (fd < 0)
+        return NULL;
+
+      fp = fdopen (fd, fdopen_mode_buf);
+      if (fp == NULL)
+        {
+          int saved_errno = errno;
+          close (fd);
+          errno = saved_errno;
+        }
+      return fp;
+    }
+#endif
 
   return orig_fopen (filename, mode);
 }
index ce93604..7c61f7e 100644 (file)
@@ -1,5 +1,5 @@
 /* fpending.c -- return the number of pending output bytes on a stream
-   Copyright (C) 2000, 2004, 2006-2007, 2009-2016 Free Software Foundation,
+   Copyright (C) 2000, 2004, 2006-2007, 2009-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering. */
 
 
 #include "stdio-impl.h"
 
+/* This file is not used on systems that already have the __fpending function,
+   namely glibc >= 2.2, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.34,
+   Android API >= 23.  */
+
 /* Return the number of pending (aka buffered, unflushed)
    bytes on the stream, FP, that is open for writing.  */
 size_t
@@ -32,16 +36,17 @@ __fpending (FILE *fp)
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+  /* GNU libc, BeOS, Haiku, Linux libc5 */
   return fp->_IO_write_ptr - fp->_IO_write_base;
 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */
   return fp->_p - fp->_bf._base;
 #elif defined __EMX__                /* emx+gcc */
   return fp->_ptr - fp->_buffer;
 #elif defined __minix                /* Minix */
   return fp_->_ptr - fp_->_buf;
-#elif defined _IOERR                 /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */
+#elif defined _IOERR                 /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
   return (fp_->_ptr ? fp_->_ptr - fp_->_base : 0);
 #elif defined __UCLIBC__             /* uClibc */
   return (fp->__modeflags & __FLAG_WRITING ? fp->__bufpos - fp->__bufstart : 0);
@@ -51,8 +56,6 @@ __fpending (FILE *fp)
   return fp->__bufp - fp->__buffer;
 #elif defined EPLAN9                 /* Plan9 */
   return fp->wp - fp->buf;
-#elif defined __VMS                  /* VMS */
-  return (*fp)->_ptr - (*fp)->_base;
 #else
 # error "Please port gnulib fpending.c to your platform!"
   return 1;
index 61008aa..016341b 100644 (file)
@@ -1,6 +1,6 @@
 /* Declare __fpending.
 
-   Copyright (C) 2000, 2003, 2005-2006, 2009-2016 Free Software Foundation,
+   Copyright (C) 2000, 2003, 2005-2006, 2009-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
    Written by Jim Meyering.  */
 
index 05ee0ca..f6ed550 100644 (file)
@@ -1,5 +1,5 @@
 /* Manipulating the FPU control word.  -*- coding: utf-8 -*-
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _FPUCW_H
 #define _FPUCW_H
 
    The FPU control word is under control of the application, i.e. it is
    not required to be set either way by the ABI.  (In fact, the i386 ABI
-   http://refspecs.freestandards.org/elf/abi386-4.pdf page 3-12 = page 38
+   https://www.linux-mips.org/pub/linux/mips/doc/ABI/abi386-4.pdf page 3-12 = page 38
    is not clear about it.  But in any case, gcc treats the control word
    like a "preserved" register: it emits code that assumes that the control
    word is preserved across calls, and it restores the control word at the
    end of functions that modify it.)
 
-   See Vincent Lefèvre's page http://www.vinc17.org/research/extended.en.html
+   See Vincent Lefèvre's page https://www.vinc17.net/research/extended.en.html
    for a good explanation.
-   See http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html for
+   See https://web.archive.org/web/20060905133417/http://www.uwsg.iu.edu/hypermail/linux/kernel/0103.0/0453.html
    some argumentation which setting should be the default.  */
 
 /* This header file provides the following facilities:
@@ -61,8 +61,8 @@
                                     'long double' safe operation precision
  */
 
-/* Inline assembler like this works only with GNU C.  */
-#if (defined __i386__ || defined __x86_64__) && defined __GNUC__
+/* Inline assembler like this works only with GNU C and clang.  */
+#if (defined __i386__ || defined __x86_64__) && (defined __GNUC__ || defined __clang__)
 
 typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
 
@@ -70,12 +70,12 @@ typedef unsigned short fpucw_t; /* glibc calls this fpu_control_t */
 # define FPU_PC_DOUBLE 0x200    /* glibc calls this _FPU_DOUBLE */
 # define FPU_PC_EXTENDED 0x300  /* glibc calls this _FPU_EXTENDED */
 
-# define GET_FPUCW() \
+# define GET_FPUCW() __extension__ \
   ({ fpucw_t _cw;                                               \
      __asm__ __volatile__ ("fnstcw %0" : "=m" (*&_cw));         \
      _cw;                                                       \
    })
-# define SET_FPUCW(word) \
+# define SET_FPUCW(word) __extension__ \
   (void)({ fpucw_t _ncw = (word);                               \
            __asm__ __volatile__ ("fldcw %0" : : "m" (*&_ncw));  \
          })
index 53ee68c..139a436 100644 (file)
@@ -1,5 +1,5 @@
 /* Flushing buffers of a FILE stream.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 /* Specification.  */
 #include <stdio.h>
 
-#if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7 */
-# include <stdio_ext.h>
+#if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.10, Android API >= 23, musl libc */
+# if HAVE_STDIO_EXT_H
+#  include <stdio_ext.h>
+# endif
 #endif
 #include <stdlib.h>
 
 int
 fpurge (FILE *fp)
 {
-#if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7, musl libc */
+#if HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.10, Android API >= 23, musl libc */
 
   __fpurge (fp);
   /* The __fpurge function does not have a return value.  */
   return 0;
 
-#elif HAVE_FPURGE                   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin 1.7 */
+#elif HAVE_FPURGE                   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin >= 1.7 */
 
   /* Call the system's fpurge function.  */
 # undef fpurge
@@ -44,7 +46,7 @@ fpurge (FILE *fp)
 # endif
   int result = fpurge (fp);
 # if defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
   if (result == 0)
     /* Correct the invariants that fpurge broke.
        <stdio.h> on BSD systems says:
@@ -62,7 +64,8 @@ fpurge (FILE *fp)
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+  /* GNU libc, BeOS, Haiku, Linux libc5 */
   fp->_IO_read_end = fp->_IO_read_ptr;
   fp->_IO_write_ptr = fp->_IO_write_base;
   /* Avoid memory leak when there is an active ungetc buffer.  */
@@ -73,7 +76,7 @@ fpurge (FILE *fp)
     }
   return 0;
 # elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
   fp_->_p = fp_->_bf._base;
   fp_->_r = 0;
   fp_->_w = ((fp_->_flags & (__SLBF | __SNBF | __SRD)) == 0 /* fully buffered and not currently reading? */
@@ -98,7 +101,7 @@ fpurge (FILE *fp)
   if (fp->_ptr != NULL)
     fp->_count = 0;
   return 0;
-# elif defined _IOERR               /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */
+# elif defined _IOERR               /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
   fp_->_ptr = fp_->_base;
   if (fp_->_ptr != NULL)
     fp_->_cnt = 0;
index cfc969b..cab1b4f 100644 (file)
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include <stdlib.h>
 #include "stdio-impl.h"
 
+#if defined __DragonFly__
+/* Defined in libc, but not declared in <stdio.h>.  */
+extern size_t __sreadahead (FILE *);
+#endif
+
+/* This file is not used on systems that have the __freadahead function,
+   namely musl libc.  */
+
 size_t
 freadahead (FILE *fp)
 {
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+  /* GNU libc, BeOS, Haiku, Linux libc5 */
   if (fp->_IO_write_ptr > fp->_IO_write_base)
     return 0;
   return (fp->_IO_read_end - fp->_IO_read_ptr)
          + (fp->_flags & _IO_IN_BACKUP ? fp->_IO_save_end - fp->_IO_save_base :
             0);
 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
   if ((fp_->_flags & __SWR) != 0 || fp_->_r < 0)
     return 0;
 # if defined __DragonFly__
@@ -53,7 +62,7 @@ freadahead (FILE *fp)
   if ((fp_->_flags & _IOWRITING) != 0)
     return 0;
   return fp_->_count;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
   if ((fp_->_flag & _IOWRT) != 0)
     return 0;
   return fp_->_cnt;
index f8211af..d14e4bd 100644 (file)
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <stddef.h>
 #include <stdio.h>
index 05cb0b8..2c342cd 100644 (file)
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -22,7 +22,7 @@
 #include "stdio-impl.h"
 
 /* Don't use glibc's __freading function in glibc < 2.7, see
-   <http://sourceware.org/bugzilla/show_bug.cgi?id=4359>  */
+   <https://sourceware.org/bugzilla/show_bug.cgi?id=4359>  */
 #if !(HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7)))
 
 bool
@@ -31,18 +31,19 @@ freading (FILE *fp)
   /* Most systems provide FILE as a struct and the necessary bitmask in
      <stdio.h>, because they need it for implementing getc() and putc() as
      fast macros.  */
-# if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+# if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+  /* GNU libc, BeOS, Haiku, Linux libc5 */
   return ((fp->_flags & _IO_NO_WRITES) != 0
           || ((fp->_flags & (_IO_NO_READS | _IO_CURRENTLY_PUTTING)) == 0
               && fp->_IO_read_base != NULL));
 # elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin < 1.7.34, Minix 3, Android */
   return (fp_->_flags & __SRD) != 0;
 # elif defined __EMX__               /* emx+gcc */
   return (fp->_flags & _IOREAD) != 0;
 # elif defined __minix               /* Minix */
   return (fp->_flags & _IOREADING) != 0;
-# elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */
+# elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
 #  if defined __sun                  /* Solaris */
   return (fp_->_flag & _IOREAD) != 0 && (fp_->_flag & _IOWRT) == 0;
 #  else
index 949efd5..573ad0e 100644 (file)
@@ -1,5 +1,5 @@
 /* Retrieve information about a FILE stream.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <stdbool.h>
 #include <stdio.h>
    STREAM must not be wide-character oriented.  */
 
 #if HAVE___FREADING && (!defined __GLIBC__ || defined __UCLIBC__ || __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 7))
-/* Solaris >= 7, not glibc >= 2.2, but glibc >= 2.7, or musl libc  */
+/* Solaris >= 7, UnixWare >= 7.1.4.MP4, Cygwin >= 1.7.34, Android API >= 29, not glibc >= 2.2, but glibc >= 2.7, or musl libc  */
 
-# include <stdio_ext.h>
+# if HAVE_STDIO_EXT_H
+#  include <stdio_ext.h>
+# endif
 # define freading(stream) (__freading (stream) != 0)
 
 #else
diff --git a/lib/free.c b/lib/free.c
new file mode 100644 (file)
index 0000000..3f5968c
--- /dev/null
@@ -0,0 +1,53 @@
+/* Make free() preserve errno.
+
+   Copyright (C) 2003, 2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Paul Eggert */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdlib.h>
+
+/* A function definition is only needed if HAVE_FREE_POSIX is not defined.  */
+#if !HAVE_FREE_POSIX
+
+# include <errno.h>
+
+void
+rpl_free (void *p)
+# undef free
+{
+# if defined __GNUC__ && !defined __clang__
+  /* An invalid GCC optimization
+     <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98396>
+     would optimize away the assignments in the code below, when link-time
+     optimization (LTO) is enabled.  Make the code more complicated, so that
+     GCC does not grok how to optimize it.  */
+  int err[2];
+  err[0] = errno;
+  err[1] = errno;
+  errno = 0;
+  free (p);
+  errno = err[errno == 0];
+# else
+  int err = errno;
+  free (p);
+  errno = err;
+# endif
+}
+
+#endif
index 5edb028..288ca66 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a double into fraction and mantissa.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paolo Bonzini <bonzini@gnu.org>, 2003, and
    Bruno Haible <bruno@clisp.org>, 2007.  */
index 714a2ff..a5b1fd9 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a 'long double' into fraction and mantissa.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 8524a42..7275e75 100644 (file)
@@ -1,5 +1,5 @@
 /* An fseek() function that, together with fflush(), is POSIX compliant.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 0c01c4f..0c25a8b 100644 (file)
@@ -1,5 +1,5 @@
 /* An fseeko() function that, together with fflush(), is POSIX compliant.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -33,9 +33,9 @@ fseeko (FILE *fp, off_t offset, int whence)
 #endif
 #if _GL_WINDOWS_64_BIT_OFF_T
 # undef fseeko
-# if HAVE__FSEEKI64 /* msvc, mingw64 */
+# if HAVE__FSEEKI64 && HAVE_DECL__FSEEKI64 /* msvc, mingw since msvcrt8.0, mingw64 */
 #  define fseeko _fseeki64
-# else /* mingw */
+# else /* mingw before msvcrt8.0 */
 #  define fseeko fseeko64
 # endif
 #endif
@@ -47,12 +47,13 @@ fseeko (FILE *fp, off_t offset, int whence)
 #endif
 
   /* These tests are based on fpurge.c.  */
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+  /* GNU libc, BeOS, Haiku, Linux libc5 */
   if (fp->_IO_read_end == fp->_IO_read_ptr
       && fp->_IO_write_ptr == fp->_IO_write_base
       && fp->_IO_save_base == NULL)
 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
 # if defined __SL64 && defined __SCLE /* Cygwin */
   if ((fp->_flags & __SL64) == 0)
     {
@@ -80,7 +81,7 @@ fseeko (FILE *fp, off_t offset, int whence)
 #elif defined __minix               /* Minix */
   if (fp_->_ptr == fp_->_buf
       && (fp_->_ptr == NULL || fp_->_count == 0))
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
   if (fp_->_ptr == fp_->_base
       && (fp_->_ptr == NULL || fp_->_cnt == 0))
 #elif defined __UCLIBC__            /* uClibc */
@@ -117,18 +118,19 @@ fseeko (FILE *fp, off_t offset, int whence)
       if (pos == -1)
         {
 #if defined __sferror || defined __DragonFly__ || defined __ANDROID__
-          /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+          /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
           fp_->_flags &= ~__SOFF;
 #endif
           return -1;
         }
 
-#if defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1 /* GNU libc, BeOS, Haiku, Linux libc5 */
+#if defined _IO_EOF_SEEN || defined _IO_ftrylockfile || __GNU_LIBRARY__ == 1
+      /* GNU libc, BeOS, Haiku, Linux libc5 */
       fp->_flags &= ~_IO_EOF_SEEN;
       fp->_offset = pos;
 #elif defined __sferror || defined __DragonFly__ || defined __ANDROID__
-      /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
-# if defined __CYGWIN__ || (defined __NetBSD__ && __NetBSD_Version__ >= 600000000)
+      /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
+# if defined __CYGWIN__ || (defined __NetBSD__ && __NetBSD_Version__ >= 600000000) || defined __minix
       /* fp_->_offset is typed as an integer.  */
       fp_->_offset = pos;
 # else
@@ -150,7 +152,7 @@ fseeko (FILE *fp, off_t offset, int whence)
       fp_->_flags &= ~__SEOF;
 #elif defined __EMX__               /* emx+gcc */
       fp->_flags &= ~_IOEOF;
-#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, mingw, MSVC, NonStop Kernel */
+#elif defined _IOERR                /* AIX, HP-UX, IRIX, OSF/1, Solaris, OpenServer, UnixWare, mingw, MSVC, NonStop Kernel, OpenVMS */
       fp_->_flag &= ~_IOEOF;
 #elif defined __MINT__              /* Atari FreeMiNT */
       fp->__offset = pos;
index 435c429..05b9c86 100644 (file)
@@ -1,5 +1,5 @@
 /* fstat() replacement.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* If the user's config.h happens to include <sys/stat.h>, let it include only
    the system's <sys/stat.h> here, so that orig_fstat doesn't recurse to
 /* Get the original definition of fstat.  It might be defined as a macro.  */
 #include <sys/types.h>
 #include <sys/stat.h>
-#if _GL_WINDOWS_64_BIT_ST_SIZE
-# undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
-# define stat _stati64
-# undef fstat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
-# define fstat _fstati64
-#endif
 #undef __need_system_sys_stat_h
 
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
+#endif
+
+#if !defined WINDOWS_NATIVE
+
 static int
 orig_fstat (int fd, struct stat *buf)
 {
   return fstat (fd, buf);
 }
 
+#endif
+
 /* Specification.  */
+#ifdef __osf__
 /* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
    eliminates this include because of the preliminary #include <sys/stat.h>
    above.  */
-#include "sys/stat.h"
-
-#include <errno.h>
-#include <unistd.h>
-
-#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
-# include "msvc-inval.h"
+# include "sys/stat.h"
+#else
+# include <sys/stat.h>
 #endif
 
-#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
-static int
-fstat_nothrow (int fd, struct stat *buf)
-{
-  int result;
+#include "stat-time.h"
 
-  TRY_MSVC_INVAL
-    {
-      result = orig_fstat (fd, buf);
-    }
-  CATCH_MSVC_INVAL
-    {
-      result = -1;
-      errno = EBADF;
-    }
-  DONE_MSVC_INVAL;
-
-  return result;
-}
-#else
-# define fstat_nothrow orig_fstat
+#include <errno.h>
+#include <unistd.h>
+#ifdef WINDOWS_NATIVE
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
+# include "stat-w32.h"
 #endif
 
 int
@@ -84,5 +75,20 @@ rpl_fstat (int fd, struct stat *buf)
     return stat (name, buf);
 #endif
 
-  return fstat_nothrow (fd, buf);
+#ifdef WINDOWS_NATIVE
+  /* Fill the fields ourselves, because the original fstat function returns
+     values for st_atime, st_mtime, st_ctime that depend on the current time
+     zone.  See
+     <https://lists.gnu.org/r/bug-gnulib/2017-04/msg00134.html>  */
+  HANDLE h = (HANDLE) _get_osfhandle (fd);
+
+  if (h == INVALID_HANDLE_VALUE)
+    {
+      errno = EBADF;
+      return -1;
+    }
+  return _gl_fstat_by_handle (h, NULL, buf);
+#else
+  return stat_time_normalize (orig_fstat (fd, buf), buf);
+#endif
 }
diff --git a/lib/fstatat.c b/lib/fstatat.c
new file mode 100644 (file)
index 0000000..640a375
--- /dev/null
@@ -0,0 +1,148 @@
+/* Work around an fstatat bug on Solaris 9.
+
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert and Jim Meyering.  */
+
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+   the system's <sys/stat.h> here, so that orig_fstatat doesn't recurse to
+   rpl_fstatat.  */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+/* Get the original definition of fstatat.  It might be defined as a macro.  */
+#include <sys/types.h>
+#include <sys/stat.h>
+#undef __need_system_sys_stat_h
+
+#if HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG
+static int
+orig_fstatat (int fd, char const *filename, struct stat *buf, int flags)
+{
+  return fstatat (fd, filename, buf, flags);
+}
+#endif
+
+#ifdef __osf__
+/* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
+   eliminates this include because of the preliminary #include <sys/stat.h>
+   above.  */
+# include "sys/stat.h"
+#else
+# include <sys/stat.h>
+#endif
+
+#include "stat-time.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG
+
+# ifndef LSTAT_FOLLOWS_SLASHED_SYMLINK
+#  define LSTAT_FOLLOWS_SLASHED_SYMLINK 0
+# endif
+
+static int
+normal_fstatat (int fd, char const *file, struct stat *st, int flag)
+{
+  return stat_time_normalize (orig_fstatat (fd, file, st, flag), st);
+}
+
+/* fstatat should always follow symbolic links that end in /, but on
+   Solaris 9 it doesn't if AT_SYMLINK_NOFOLLOW is specified.
+   Likewise, trailing slash on a non-directory should be an error.
+   These are the same problems that lstat.c and stat.c address, so
+   solve it in a similar way.
+
+   AIX 7.1 fstatat (AT_FDCWD, ..., 0) always fails, which is a bug.
+   Work around this bug if FSTATAT_AT_FDCWD_0_BROKEN is nonzero.  */
+
+int
+rpl_fstatat (int fd, char const *file, struct stat *st, int flag)
+{
+  int result = normal_fstatat (fd, file, st, flag);
+  size_t len;
+
+  if (LSTAT_FOLLOWS_SLASHED_SYMLINK || result != 0)
+    return result;
+  len = strlen (file);
+  if (flag & AT_SYMLINK_NOFOLLOW)
+    {
+      /* Fix lstat behavior.  */
+      if (file[len - 1] != '/' || S_ISDIR (st->st_mode))
+        return 0;
+      if (!S_ISLNK (st->st_mode))
+        {
+          errno = ENOTDIR;
+          return -1;
+        }
+      result = normal_fstatat (fd, file, st, flag & ~AT_SYMLINK_NOFOLLOW);
+    }
+  /* Fix stat behavior.  */
+  if (result == 0 && !S_ISDIR (st->st_mode) && file[len - 1] == '/')
+    {
+      errno = ENOTDIR;
+      return -1;
+    }
+  return result;
+}
+
+#else /* ! (HAVE_FSTATAT && HAVE_WORKING_FSTATAT_ZERO_FLAG) */
+
+/* On mingw, the gnulib <sys/stat.h> defines 'stat' as a function-like
+   macro; but using it in AT_FUNC_F2 causes compilation failure
+   because the preprocessor sees a use of a macro that requires two
+   arguments but is only given one.  Hence, we need an inline
+   forwarder to get past the preprocessor.  */
+static int
+stat_func (char const *name, struct stat *st)
+{
+  return stat (name, st);
+}
+
+/* Likewise, if there is no native 'lstat', then the gnulib
+   <sys/stat.h> defined it as stat, which also needs adjustment.  */
+# if !HAVE_LSTAT
+#  undef lstat
+#  define lstat stat_func
+# endif
+
+/* Replacement for Solaris' function by the same name.
+   <https://www.google.com/search?q=fstatat+site:docs.oracle.com>
+   First, try to simulate it via l?stat ("/proc/self/fd/FD/FILE").
+   Failing that, simulate it via save_cwd/fchdir/(stat|lstat)/restore_cwd.
+   If either the save_cwd or the restore_cwd fails (relatively unlikely),
+   then give a diagnostic and exit nonzero.
+   Otherwise, this function works just like Solaris' fstatat.  */
+
+# define AT_FUNC_NAME fstatat
+# define AT_FUNC_F1 lstat
+# define AT_FUNC_F2 stat_func
+# define AT_FUNC_USE_F1_COND AT_SYMLINK_NOFOLLOW
+# define AT_FUNC_POST_FILE_PARAM_DECLS , struct stat *st, int flag
+# define AT_FUNC_POST_FILE_ARGS        , st
+# include "at-func.c"
+# undef AT_FUNC_NAME
+# undef AT_FUNC_F1
+# undef AT_FUNC_F2
+# undef AT_FUNC_USE_F1_COND
+# undef AT_FUNC_POST_FILE_PARAM_DECLS
+# undef AT_FUNC_POST_FILE_ARGS
+
+#endif /* !HAVE_FSTATAT */
index 75ed1b2..de088ce 100644 (file)
@@ -1,5 +1,5 @@
 /* An ftell() function that works around platform bugs.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 4c18ed1..da13694 100644 (file)
@@ -1,5 +1,5 @@
 /* An ftello() function that works around platform bugs.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 /* Specification.  */
 #include <stdio.h>
 
+#include <errno.h>
+#include "intprops.h"
+
 /* Get lseek.  */
 #include <unistd.h>
 
@@ -40,13 +43,79 @@ ftello (FILE *fp)
 # endif
 #endif
 {
-#if LSEEK_PIPE_BROKEN
+#if FTELLO_BROKEN_AFTER_UNGETC /* macOS >= 10.15 */
+  /* The system's ftello() is completely broken, because it calls __sflush,
+     which makes side effects on the stream.  */
+
+  /* Handle non-seekable files first.  */
+  if (fp->_file < 0 || fp->_seek == NULL)
+    {
+      errno = ESPIPE;
+      return -1;
+    }
+
+  /* Determine the current offset, ignoring buffered and pushed-back bytes.  */
+  off_t pos;
+
+  if (fp->_flags & __SOFF)
+    pos = fp->_offset;
+  else
+    {
+      pos = fp->_seek (fp->_cookie, 0, SEEK_CUR);
+      if (pos < 0)
+        return -1;
+      if (fp->_flags & __SOPT)
+        {
+          fp->_offset = pos;
+          fp->_flags |= __SOFF;
+        }
+    }
+
+  if (fp->_flags & __SRD)
+    {
+      /* Now consider buffered and pushed-back bytes from ungetc.  */
+      if (fp->_ub._base != NULL)
+        /* Considering the buffered bytes, we are at position
+             pos - fp->_ur.
+           Considering also the pushed-back bytes, we are at position
+             pos - fp->_ur - fp->_r.  */
+        pos = pos - fp->_ur - fp->_r;
+      else
+        /* Considering the buffered bytes, we are at position
+             pos - fp->_r.  */
+        pos = pos - fp->_r;
+      if (pos < 0)
+        {
+          errno = EIO;
+          return -1;
+        }
+    }
+  else if ((fp->_flags & __SWR) && fp->_p != NULL)
+    {
+      /* Consider the buffered bytes.  */
+      off_t buffered = fp->_p - fp->_bf._base;
+
+      /* Compute pos + buffered, with overflow check.  */
+      off_t sum;
+      if (! INT_ADD_OK (pos, buffered, &sum))
+        {
+          errno = EOVERFLOW;
+          return -1;
+        }
+      pos = sum;
+    }
+
+  return pos;
+
+#else
+
+# if LSEEK_PIPE_BROKEN
   /* mingw gives bogus answers rather than failure on non-seekable files.  */
   if (lseek (fileno (fp), 0, SEEK_CUR) == -1)
     return -1;
-#endif
+# endif
 
-#if FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE /* Solaris */
+# if FTELLO_BROKEN_AFTER_SWITCHING_FROM_READ_TO_WRITE /* Solaris */
   /* The Solaris stdio leaves the _IOREAD flag set after reading from a file
      reaches EOF and the program then starts writing to the file.  ftello
      gets confused by this.  */
@@ -66,9 +135,9 @@ ftello (FILE *fp)
         }
       return pos;
     }
-#endif
+# endif
 
-#if defined __SL64 && defined __SCLE /* Cygwin */
+# if defined __SL64 && defined __SCLE /* Cygwin */
   if ((fp->_flags & __SL64) == 0)
     {
       /* Cygwin 1.5.0 through 1.5.24 failed to open stdin in 64-bit
@@ -80,6 +149,9 @@ ftello (FILE *fp)
       fp->_seek64 = tmp->_seek64;
       fclose (tmp);
     }
-#endif
+# endif
+
   return ftello (fp);
+
+#endif
 }
similarity index 83%
rename from tests/getcwd-lgpl.c
rename to lib/getcwd-lgpl.c
index c553f7b..bfb33a8 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2011-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2011-2021 Free Software Foundation, Inc.
    This file is part of gnulib.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -38,6 +38,10 @@ typedef int dummy;
    necessary.  */
 
 # undef getcwd
+# if defined _WIN32 && !defined __CYGWIN__
+#  define getcwd _getcwd
+# endif
+
 char *
 rpl_getcwd (char *buf, size_t size)
 {
@@ -65,11 +69,7 @@ rpl_getcwd (char *buf, size_t size)
         }
       result = getcwd (buf, size);
       if (!result)
-        {
-          int saved_errno = errno;
-          free (buf);
-          errno = saved_errno;
-        }
+        free (buf);
       return result;
     }
 
@@ -108,17 +108,18 @@ rpl_getcwd (char *buf, size_t size)
   while (!result && errno == ERANGE);
 
   if (!result)
-    {
-      int saved_errno = errno;
-      free (buf);
-      errno = saved_errno;
-    }
+    free (buf);
   else
     {
-      /* Trim to fit, if possible.  */
-      result = realloc (buf, strlen (buf) + 1);
-      if (!result)
-        result = buf;
+      /* Here result == buf.  */
+      /* Shrink result before returning it.  */
+      size_t actual_size = strlen (result) + 1;
+      if (actual_size < size)
+        {
+          char *shrinked_result = realloc (result, actual_size);
+          if (shrinked_result != NULL)
+            result = shrinked_result;
+        }
     }
   return result;
 }
diff --git a/lib/getcwd.c b/lib/getcwd.c
new file mode 100644 (file)
index 0000000..6b2ac73
--- /dev/null
@@ -0,0 +1,496 @@
+/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#if !_LIBC
+# include <config.h>
+# include <unistd.h>
+# include "pathmax.h"
+#else
+# define HAVE_OPENAT 1
+# define D_INO_IN_DIRENT 1
+# define HAVE_MSVC_INVALID_PARAMETER_HANDLER 0
+# define HAVE_MINIMALLY_WORKING_GETCWD 0
+#endif
+
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdbool.h>
+#include <stddef.h>
+
+#include <fcntl.h> /* For AT_FDCWD on Solaris 9.  */
+
+/* If this host provides the openat function or if we're using the
+   gnulib replacement function with a native fdopendir, then enable
+   code below to make getcwd more efficient and robust.  */
+#if defined HAVE_OPENAT || (defined GNULIB_OPENAT && defined HAVE_FDOPENDIR)
+# define HAVE_OPENAT_SUPPORT 1
+#else
+# define HAVE_OPENAT_SUPPORT 0
+#endif
+
+#ifndef __set_errno
+# define __set_errno(val) (errno = (val))
+#endif
+
+#include <dirent.h>
+#ifndef _D_EXACT_NAMLEN
+# define _D_EXACT_NAMLEN(d) strlen ((d)->d_name)
+#endif
+#ifndef _D_ALLOC_NAMLEN
+# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
+#endif
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if _LIBC
+# ifndef mempcpy
+#  define mempcpy __mempcpy
+# endif
+#endif
+
+#ifndef MAX
+# define MAX(a, b) ((a) < (b) ? (b) : (a))
+#endif
+#ifndef MIN
+# define MIN(a, b) ((a) < (b) ? (a) : (b))
+#endif
+
+/* In this file, PATH_MAX only serves as a threshold for choosing among two
+   algorithms.  */
+#ifndef PATH_MAX
+# define PATH_MAX 8192
+#endif
+
+#if D_INO_IN_DIRENT
+# define MATCHING_INO(dp, ino) ((dp)->d_ino == (ino))
+#else
+# define MATCHING_INO(dp, ino) true
+#endif
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
+
+#if !_LIBC
+# define GETCWD_RETURN_TYPE char *
+# define __close_nocancel_nostatus close
+# define __getcwd_generic rpl_getcwd
+# undef stat64
+# define stat64    stat
+# define __fstat64 fstat
+# define __fstatat64 fstatat
+# define __lstat64 lstat
+# define __closedir closedir
+# define __opendir opendir
+# define __readdir64 readdir
+# define __fdopendir fdopendir
+# define __openat openat
+# define __rewinddir rewinddir
+# define __openat64 openat
+# define dirent64 dirent
+#else
+# include <not-cancel.h>
+#endif
+
+/* The results of opendir() in this file are not used with dirfd and fchdir,
+   and we do not leak fds to any single-threaded code that could use stdio,
+   therefore save some unnecessary recursion in fchdir.c.
+   FIXME - if the kernel ever adds support for multi-thread safety for
+   avoiding standard fds, then we should use opendir_safer and
+   openat_safer.  */
+#ifdef GNULIB_defined_opendir
+# undef opendir
+#endif
+#ifdef GNULIB_defined_closedir
+# undef closedir
+#endif
+\f
+#if defined _WIN32 && !defined __CYGWIN__
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static char *
+getcwd_nothrow (char *buf, size_t size)
+{
+  char *result;
+
+  TRY_MSVC_INVAL
+    {
+      result = _getcwd (buf, size);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = NULL;
+      errno = ERANGE;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+# else
+#  define getcwd_nothrow _getcwd
+# endif
+# define getcwd_system getcwd_nothrow
+#else
+# define getcwd_system getcwd
+#endif
+
+/* Get the name of the current working directory, and put it in SIZE
+   bytes of BUF.  Returns NULL with errno set if the directory couldn't be
+   determined or SIZE was too small.  If successful, returns BUF.  In GNU,
+   if BUF is NULL, an array is allocated with 'malloc'; the array is SIZE
+   bytes long, unless SIZE == 0, in which case it is as big as necessary.  */
+
+GETCWD_RETURN_TYPE
+__getcwd_generic (char *buf, size_t size)
+{
+  /* Lengths of big file name components and entire file names, and a
+     deep level of file name nesting.  These numbers are not upper
+     bounds; they are merely large values suitable for initial
+     allocations, designed to be large enough for most real-world
+     uses.  */
+  enum
+    {
+      BIG_FILE_NAME_COMPONENT_LENGTH = 255,
+      BIG_FILE_NAME_LENGTH = MIN (4095, PATH_MAX - 1),
+      DEEP_NESTING = 100
+    };
+
+#if HAVE_OPENAT_SUPPORT
+  int fd = AT_FDCWD;
+  bool fd_needs_closing = false;
+#else
+  char dots[DEEP_NESTING * sizeof ".." + BIG_FILE_NAME_COMPONENT_LENGTH + 1];
+  char *dotlist = dots;
+  size_t dotsize = sizeof dots;
+  size_t dotlen = 0;
+#endif
+  DIR *dirstream = NULL;
+  dev_t rootdev, thisdev;
+  ino_t rootino, thisino;
+  char *dir;
+  register char *dirp;
+  struct stat64 st;
+  size_t allocated = size;
+  size_t used;
+
+#if HAVE_MINIMALLY_WORKING_GETCWD
+  /* If AT_FDCWD is not defined, the algorithm below is O(N**2) and
+     this is much slower than the system getcwd (at least on
+     GNU/Linux).  So trust the system getcwd's results unless they
+     look suspicious.
+
+     Use the system getcwd even if we have openat support, since the
+     system getcwd works even when a parent is unreadable, while the
+     openat-based approach does not.
+
+     But on AIX 5.1..7.1, the system getcwd is not even minimally
+     working: If the current directory name is slightly longer than
+     PATH_MAX, it omits the first directory component and returns
+     this wrong result with errno = 0.  */
+
+# undef getcwd
+  dir = getcwd_system (buf, size);
+  if (dir || (size && errno == ERANGE))
+    return dir;
+
+  /* Solaris getcwd (NULL, 0) fails with errno == EINVAL, but it has
+     internal magic that lets it work even if an ancestor directory is
+     inaccessible, which is better in many cases.  So in this case try
+     again with a buffer that's almost always big enough.  */
+  if (errno == EINVAL && buf == NULL && size == 0)
+    {
+      char big_buffer[BIG_FILE_NAME_LENGTH + 1];
+      dir = getcwd_system (big_buffer, sizeof big_buffer);
+      if (dir)
+        return strdup (dir);
+    }
+
+# if HAVE_PARTLY_WORKING_GETCWD
+  /* The system getcwd works, except it sometimes fails when it
+     shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.    */
+  if (errno != ERANGE && errno != ENAMETOOLONG && errno != ENOENT)
+    return NULL;
+# endif
+#endif
+  if (size == 0)
+    {
+      if (buf != NULL)
+        {
+          __set_errno (EINVAL);
+          return NULL;
+        }
+
+      allocated = BIG_FILE_NAME_LENGTH + 1;
+    }
+
+  if (buf == NULL)
+    {
+      dir = malloc (allocated);
+      if (dir == NULL)
+        return NULL;
+    }
+  else
+    dir = buf;
+
+  dirp = dir + allocated;
+  *--dirp = '\0';
+
+  if (__lstat64 (".", &st) < 0)
+    goto lose;
+  thisdev = st.st_dev;
+  thisino = st.st_ino;
+
+  if (__lstat64 ("/", &st) < 0)
+    goto lose;
+  rootdev = st.st_dev;
+  rootino = st.st_ino;
+
+  while (!(thisdev == rootdev && thisino == rootino))
+    {
+      struct dirent64 *d;
+      dev_t dotdev;
+      ino_t dotino;
+      bool mount_point;
+      int parent_status;
+      size_t dirroom;
+      size_t namlen;
+      bool use_d_ino = true;
+
+      /* Look at the parent directory.  */
+#if HAVE_OPENAT_SUPPORT
+      fd = __openat64 (fd, "..", O_RDONLY);
+      if (fd < 0)
+        goto lose;
+      fd_needs_closing = true;
+      parent_status = __fstat64 (fd, &st);
+#else
+      dotlist[dotlen++] = '.';
+      dotlist[dotlen++] = '.';
+      dotlist[dotlen] = '\0';
+      parent_status = __lstat64 (dotlist, &st);
+#endif
+      if (parent_status != 0)
+        goto lose;
+
+      if (dirstream && __closedir (dirstream) != 0)
+        {
+          dirstream = NULL;
+          goto lose;
+        }
+
+      /* Figure out if this directory is a mount point.  */
+      dotdev = st.st_dev;
+      dotino = st.st_ino;
+      mount_point = dotdev != thisdev;
+
+      /* Search for the last directory.  */
+#if HAVE_OPENAT_SUPPORT
+      dirstream = __fdopendir (fd);
+      if (dirstream == NULL)
+        goto lose;
+      fd_needs_closing = false;
+#else
+      dirstream = __opendir (dotlist);
+      if (dirstream == NULL)
+        goto lose;
+      dotlist[dotlen++] = '/';
+#endif
+      for (;;)
+        {
+          /* Clear errno to distinguish EOF from error if readdir returns
+             NULL.  */
+          __set_errno (0);
+          d = __readdir64 (dirstream);
+
+          /* When we've iterated through all directory entries without finding
+             one with a matching d_ino, rewind the stream and consider each
+             name again, but this time, using lstat.  This is necessary in a
+             chroot on at least one system (glibc-2.3.6 + linux 2.6.12), where
+             .., ../.., ../../.., etc. all had the same device number, yet the
+             d_ino values for entries in / did not match those obtained
+             via lstat.  */
+          if (d == NULL && errno == 0 && use_d_ino)
+            {
+              use_d_ino = false;
+              __rewinddir (dirstream);
+              d = __readdir64 (dirstream);
+            }
+
+          if (d == NULL)
+            {
+              if (errno == 0)
+                /* EOF on dirstream, which can mean e.g., that the current
+                   directory has been removed.  */
+                __set_errno (ENOENT);
+              goto lose;
+            }
+          if (d->d_name[0] == '.' &&
+              (d->d_name[1] == '\0' ||
+               (d->d_name[1] == '.' && d->d_name[2] == '\0')))
+            continue;
+
+          if (use_d_ino)
+            {
+              bool match = (MATCHING_INO (d, thisino) || mount_point);
+              if (! match)
+                continue;
+            }
+
+          {
+            int entry_status;
+#if HAVE_OPENAT_SUPPORT
+            entry_status = __fstatat64 (fd, d->d_name, &st, AT_SYMLINK_NOFOLLOW);
+#else
+            /* Compute size needed for this file name, or for the file
+               name ".." in the same directory, whichever is larger.
+               Room for ".." might be needed the next time through
+               the outer loop.  */
+            size_t name_alloc = _D_ALLOC_NAMLEN (d);
+            size_t filesize = dotlen + MAX (sizeof "..", name_alloc);
+
+            if (filesize < dotlen)
+              goto memory_exhausted;
+
+            if (dotsize < filesize)
+              {
+                /* My, what a deep directory tree you have, Grandma.  */
+                size_t newsize = MAX (filesize, dotsize * 2);
+                size_t i;
+                if (newsize < dotsize)
+                  goto memory_exhausted;
+                if (dotlist != dots)
+                  free (dotlist);
+                dotlist = malloc (newsize);
+                if (dotlist == NULL)
+                  goto lose;
+                dotsize = newsize;
+
+                i = 0;
+                do
+                  {
+                    dotlist[i++] = '.';
+                    dotlist[i++] = '.';
+                    dotlist[i++] = '/';
+                  }
+                while (i < dotlen);
+              }
+
+            memcpy (dotlist + dotlen, d->d_name, _D_ALLOC_NAMLEN (d));
+            entry_status = __lstat64 (dotlist, &st);
+#endif
+            /* We don't fail here if we cannot stat() a directory entry.
+               This can happen when (network) file systems fail.  If this
+               entry is in fact the one we are looking for we will find
+               out soon as we reach the end of the directory without
+               having found anything.  */
+            if (entry_status == 0 && S_ISDIR (st.st_mode)
+                && st.st_dev == thisdev && st.st_ino == thisino)
+              break;
+          }
+        }
+
+      dirroom = dirp - dir;
+      namlen = _D_EXACT_NAMLEN (d);
+
+      if (dirroom <= namlen)
+        {
+          if (size != 0)
+            {
+              __set_errno (ERANGE);
+              goto lose;
+            }
+          else
+            {
+              char *tmp;
+              size_t oldsize = allocated;
+
+              allocated += MAX (allocated, namlen);
+              if (allocated < oldsize
+                  || ! (tmp = realloc (dir, allocated)))
+                goto memory_exhausted;
+
+              /* Move current contents up to the end of the buffer.
+                 This is guaranteed to be non-overlapping.  */
+              dirp = memcpy (tmp + allocated - (oldsize - dirroom),
+                             tmp + dirroom,
+                             oldsize - dirroom);
+              dir = tmp;
+            }
+        }
+      dirp -= namlen;
+      memcpy (dirp, d->d_name, namlen);
+      *--dirp = '/';
+
+      thisdev = dotdev;
+      thisino = dotino;
+    }
+
+  if (dirstream && __closedir (dirstream) != 0)
+    {
+      dirstream = NULL;
+      goto lose;
+    }
+
+  if (dirp == &dir[allocated - 1])
+    *--dirp = '/';
+
+#if ! HAVE_OPENAT_SUPPORT
+  if (dotlist != dots)
+    free (dotlist);
+#endif
+
+  used = dir + allocated - dirp;
+  memmove (dir, dirp, used);
+
+  if (size == 0)
+    /* Ensure that the buffer is only as large as necessary.  */
+    buf = (used < allocated ? realloc (dir, used) : dir);
+
+  if (buf == NULL)
+    /* Either buf was NULL all along, or 'realloc' failed but
+       we still have the original string.  */
+    buf = dir;
+
+  return buf;
+
+ memory_exhausted:
+  __set_errno (ENOMEM);
+ lose:
+  {
+    int save = errno;
+    if (dirstream)
+      __closedir (dirstream);
+#if HAVE_OPENAT_SUPPORT
+    if (fd_needs_closing)
+       __close_nocancel_nostatus (fd);
+#else
+    if (dotlist != dots)
+      free (dotlist);
+#endif
+    if (buf == NULL)
+      free (dir);
+    __set_errno (save);
+  }
+  return NULL;
+}
+
+#if defined _LIBC && !defined GETCWD_RETURN_TYPE
+libc_hidden_def (__getcwd)
+weak_alias (__getcwd, getcwd)
+#endif
index d234055..56eaf5d 100644 (file)
@@ -1,5 +1,5 @@
-/* getdtablesize() function for platforms that don't have it.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* getdtablesize() function: Return maximum possible file descriptor value + 1.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 /* Specification.  */
 #include <unistd.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 # include <stdio.h>
 
-# include "msvc-inval.h"
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+#  include "msvc-inval.h"
+# endif
 
 # if HAVE_MSVC_INVALID_PARAMETER_HANDLER
 static int
@@ -44,7 +46,8 @@ _setmaxstdio_nothrow (int newmax)
 
   return result;
 }
-#  define _setmaxstdio _setmaxstdio_nothrow
+# else
+#  define _setmaxstdio_nothrow _setmaxstdio
 # endif
 
 /* Cache for the previous getdtablesize () result.  Safe to cache because
@@ -76,9 +79,9 @@ getdtablesize (void)
          freed when we call _setmaxstdio with the original value.  */
       int orig_max_stdio = _getmaxstdio ();
       unsigned int bound;
-      for (bound = 0x10000; _setmaxstdio (bound) < 0; bound = bound / 2)
+      for (bound = 0x10000; _setmaxstdio_nothrow (bound) < 0; bound = bound / 2)
         ;
-      _setmaxstdio (orig_max_stdio);
+      _setmaxstdio_nothrow (orig_max_stdio);
       dtablesize = bound;
     }
   return dtablesize;
diff --git a/lib/getopt-cdefs.in.h b/lib/getopt-cdefs.in.h
new file mode 100644 (file)
index 0000000..11fe536
--- /dev/null
@@ -0,0 +1,67 @@
+/* getopt-on-non-glibc compatibility macros.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
+   This file is part of gnulib.
+   Unlike most of the getopt implementation, it is NOT shared
+   with the GNU C Library.
+
+   This file is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 3 of
+   the License, or (at your option) any later version.
+
+   This file is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with gnulib; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _GETOPT_CDEFS_H
+#define _GETOPT_CDEFS_H 1
+
+/* This header should not be used directly; include getopt.h or
+   unistd.h instead.  It does not have a protective #error, because
+   the guard macro for getopt.h in gnulib is not fixed.  */
+
+/* getopt-core.h and getopt-ext.h are shared with GNU libc, and expect
+   a number of the internal macros supplied to GNU libc's headers by
+   sys/cdefs.h.  Provide fallback definitions for all of them.  */
+#if @HAVE_SYS_CDEFS_H@
+# include <sys/cdefs.h>
+#endif
+
+#ifndef __BEGIN_DECLS
+# ifdef __cplusplus
+#  define __BEGIN_DECLS extern "C" {
+# else
+#  define __BEGIN_DECLS /* nothing */
+# endif
+#endif
+#ifndef __END_DECLS
+# ifdef __cplusplus
+#  define __END_DECLS }
+# else
+#  define __END_DECLS /* nothing */
+# endif
+#endif
+
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_VERSION__
+# define __GNUC_PREREQ(maj, min) \
+        ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+# else
+#  define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#ifndef __THROW
+# if defined __cplusplus && (__GNUC_PREREQ (2,8) || __clang_major__ >= 4)
+#  define __THROW       throw ()
+# else
+#  define __THROW
+# endif
+#endif
+
+#endif /* _GETOPT_CDEFS_H */
diff --git a/lib/getopt-core.h b/lib/getopt-core.h
new file mode 100644 (file)
index 0000000..05d16b0
--- /dev/null
@@ -0,0 +1,96 @@
+/* Declarations for getopt (basic, portable features only).
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _GETOPT_CORE_H
+#define _GETOPT_CORE_H 1
+
+/* This header should not be used directly; include getopt.h or
+   unistd.h instead.  Unlike most bits headers, it does not have
+   a protective #error, because the guard macro for getopt.h in
+   gnulib is not fixed.  */
+
+__BEGIN_DECLS
+
+/* For communication from 'getopt' to the caller.
+   When 'getopt' finds an option that takes an argument,
+   the argument value is returned here.
+   Also, when 'ordering' is RETURN_IN_ORDER,
+   each non-option ARGV-element is returned here.  */
+
+extern char *optarg;
+
+/* Index in ARGV of the next element to be scanned.
+   This is used for communication to and from the caller
+   and for communication between successive calls to 'getopt'.
+
+   On entry to 'getopt', zero means this is the first call; initialize.
+
+   When 'getopt' returns -1, this is the index of the first of the
+   non-option elements that the caller should itself scan.
+
+   Otherwise, 'optind' communicates from one call to the next
+   how much of ARGV has been scanned so far.  */
+
+extern int optind;
+
+/* Callers store zero here to inhibit the error message 'getopt' prints
+   for unrecognized options.  */
+
+extern int opterr;
+
+/* Set to an option character which was unrecognized.  */
+
+extern int optopt;
+
+/* Get definitions and prototypes for functions to process the
+   arguments in ARGV (ARGC of them, minus the program name) for
+   options given in OPTS.
+
+   Return the option character from OPTS just read.  Return -1 when
+   there are no more options.  For unrecognized options, or options
+   missing arguments, 'optopt' is set to the option letter, and '?' is
+   returned.
+
+   The OPTS string is a list of characters which are recognized option
+   letters, optionally followed by colons, specifying that that letter
+   takes an argument, to be placed in 'optarg'.
+
+   If a letter in OPTS is followed by two colons, its argument is
+   optional.  This behavior is specific to the GNU 'getopt'.
+
+   The argument '--' causes premature termination of argument
+   scanning, explicitly telling 'getopt' that there are no more
+   options.
+
+   If OPTS begins with '-', then non-option arguments are treated as
+   arguments to the option '\1'.  This behavior is specific to the GNU
+   'getopt'.  If OPTS begins with '+', or POSIXLY_CORRECT is set in
+   the environment, then do not permute arguments.
+
+   For standards compliance, the 'argv' argument has the type
+   char *const *, but this is inaccurate; if argument permutation is
+   enabled, the argv array (not the strings it points to) must be
+   writable.  */
+
+extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
+       __THROW _GL_ARG_NONNULL ((2, 3));
+
+__END_DECLS
+
+#endif /* _GETOPT_CORE_H */
diff --git a/lib/getopt-ext.h b/lib/getopt-ext.h
new file mode 100644 (file)
index 0000000..9b11b47
--- /dev/null
@@ -0,0 +1,77 @@
+/* Declarations for getopt (GNU extensions).
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _GETOPT_EXT_H
+#define _GETOPT_EXT_H 1
+
+/* This header should not be used directly; include getopt.h instead.
+   Unlike most bits headers, it does not have a protective #error,
+   because the guard macro for getopt.h in gnulib is not fixed.  */
+
+__BEGIN_DECLS
+
+/* Describe the long-named options requested by the application.
+   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
+   of 'struct option' terminated by an element containing a name which is
+   zero.
+
+   The field 'has_arg' is:
+   no_argument         (or 0) if the option does not take an argument,
+   required_argument   (or 1) if the option requires an argument,
+   optional_argument   (or 2) if the option takes an optional argument.
+
+   If the field 'flag' is not NULL, it points to a variable that is set
+   to the value given in the field 'val' when the option is found, but
+   left unchanged if the option is not found.
+
+   To have a long-named option do something other than set an 'int' to
+   a compiled-in constant, such as set a value from 'optarg', set the
+   option's 'flag' field to zero and its 'val' field to a nonzero
+   value (the equivalent single-letter option character, if there is
+   one).  For long options that have a zero 'flag' field, 'getopt'
+   returns the contents of the 'val' field.  */
+
+struct option
+{
+  const char *name;
+  /* has_arg can't be an enum because some compilers complain about
+     type mismatches in all the code that assumes it is an int.  */
+  int has_arg;
+  int *flag;
+  int val;
+};
+
+/* Names for the values of the 'has_arg' field of 'struct option'.  */
+
+#define no_argument            0
+#define required_argument      1
+#define optional_argument      2
+
+extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
+                       const char *__shortopts,
+                       const struct option *__longopts, int *__longind)
+       __THROW _GL_ARG_NONNULL ((2, 3));
+extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
+                            const char *__shortopts,
+                            const struct option *__longopts, int *__longind)
+       __THROW _GL_ARG_NONNULL ((2, 3));
+
+__END_DECLS
+
+#endif /* _GETOPT_EXT_H */
diff --git a/lib/getopt-pfx-core.h b/lib/getopt-pfx-core.h
new file mode 100644 (file)
index 0000000..78990a3
--- /dev/null
@@ -0,0 +1,67 @@
+/* getopt (basic, portable features) gnulib wrapper header.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
+   This file is part of gnulib.
+   Unlike most of the getopt implementation, it is NOT shared
+   with the GNU C Library.
+
+   This file is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 3 of
+   the License, or (at your option) any later version.
+
+   This file is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with gnulib; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _GETOPT_PFX_CORE_H
+#define _GETOPT_PFX_CORE_H 1
+
+/* This header should not be used directly; include getopt.h or
+   unistd.h instead.  It does not have a protective #error, because
+   the guard macro for getopt.h in gnulib is not fixed.  */
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+   identifier that prefixes the external functions and variables
+   defined in getopt-core.h and getopt-ext.h.  Systematically
+   rename identifiers so that they do not collide with the system
+   functions and variables.  Renaming avoids problems with some
+   compilers and linkers.  */
+#ifdef __GETOPT_PREFIX
+# ifndef __GETOPT_ID
+#  define __GETOPT_CONCAT(x, y) x ## y
+#  define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+#  define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# endif
+# undef getopt
+# undef optarg
+# undef opterr
+# undef optind
+# undef optopt
+# define getopt __GETOPT_ID (getopt)
+# define optarg __GETOPT_ID (optarg)
+# define opterr __GETOPT_ID (opterr)
+# define optind __GETOPT_ID (optind)
+# define optopt __GETOPT_ID (optopt)
+
+/* Work around a a problem on macOS, which declares getopt with a
+   trailing __DARWIN_ALIAS(getopt) that would expand to something like
+   __asm("_" "rpl_getopt" "$UNIX2003") were it not for the following
+   hack to suppress the macOS declaration <https://bugs.gnu.org/40205>.  */
+# ifdef __APPLE__
+#  define _GETOPT
+# endif
+
+/* The system's getopt.h may have already included getopt-core.h to
+   declare the unprefixed identifiers.  Undef _GETOPT_CORE_H so that
+   getopt-core.h declares them with prefixes.  */
+# undef _GETOPT_CORE_H
+#endif
+
+#include <getopt-core.h>
+
+#endif /* _GETOPT_PFX_CORE_H */
diff --git a/lib/getopt-pfx-ext.h b/lib/getopt-pfx-ext.h
new file mode 100644 (file)
index 0000000..61ea8d2
--- /dev/null
@@ -0,0 +1,71 @@
+/* getopt (GNU extensions) gnulib wrapper header.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
+   This file is part of gnulib.
+   Unlike most of the getopt implementation, it is NOT shared
+   with the GNU C Library.
+
+   This file is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 3 of
+   the License, or (at your option) any later version.
+
+   This file is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with gnulib; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _GETOPT_PFX_EXT_H
+#define _GETOPT_PFX_EXT_H 1
+
+/* This header should not be used directly; include getopt.h instead.
+   It does not have a protective #error, because the guard macro for
+   getopt.h in gnulib is not fixed.  */
+
+/* Standalone applications should #define __GETOPT_PREFIX to an
+   identifier that prefixes the external functions and variables
+   defined in getopt-core.h and getopt-ext.h.  Systematically
+   rename identifiers so that they do not collide with the system
+   functions and variables.  Renaming avoids problems with some
+   compilers and linkers.  */
+#ifdef __GETOPT_PREFIX
+# ifndef __GETOPT_ID
+#  define __GETOPT_CONCAT(x, y) x ## y
+#  define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
+#  define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
+# endif
+# undef getopt_long
+# undef getopt_long_only
+# undef option
+# undef _getopt_internal
+# define getopt_long __GETOPT_ID (getopt_long)
+# define getopt_long_only __GETOPT_ID (getopt_long_only)
+# define option __GETOPT_ID (option)
+# define _getopt_internal __GETOPT_ID (getopt_internal)
+
+/* The system's getopt.h may have already included getopt-ext.h to
+   declare the unprefixed identifiers.  Undef _GETOPT_EXT_H so that
+   getopt-ext.h declares them with prefixes.  */
+# undef _GETOPT_EXT_H
+#endif
+
+/* Standalone applications get correct prototypes for getopt_long and
+   getopt_long_only; they declare "char **argv".  For backward
+   compatibility with old applications, if __GETOPT_PREFIX is not
+   defined, we supply GNU-libc-compatible, but incorrect, prototypes
+   using "char *const *argv".  (GNU libc is stuck with the incorrect
+   prototypes, as they are baked into older versions of LSB.)  */
+#ifndef __getopt_argv_const
+# if defined __GETOPT_PREFIX
+#  define __getopt_argv_const /* empty */
+# else
+#  define __getopt_argv_const const
+# endif
+#endif
+
+#include <getopt-ext.h>
+
+#endif /* _GETOPT_PFX_EXT_H */
index 8ccb901..dd96c18 100644 (file)
@@ -1,23 +1,21 @@
 /* Getopt for GNU.
-   NOTE: getopt is part of the C library, so if you don't know what
-   "Keep this file name-space clean" means, talk to drepper@gnu.org
-   before changing it!
-   Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2016 Free Software
-   Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
+   Copyright (C) 1987-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 \f
 #ifndef _LIBC
 # include <config.h>
 #include <unistd.h>
 
 #ifdef _LIBC
+/* When used as part of glibc, error printing must be done differently
+   for standards compliance.  getopt is not a cancellation point, so
+   it must not call functions that are, and it is specified by an
+   older standard than stdio locking, so it must not refer to
+   functions in the "user namespace" related to stdio locking.
+   Finally, it must use glibc's internal message translation so that
+   the messages are looked up in the proper text domain.  */
 # include <libintl.h>
+# define fprintf __fxprintf_nocancel
+# define flockfile(fp) _IO_flockfile (fp)
+# define funlockfile(fp) _IO_funlockfile (fp)
 #else
 # include "gettext.h"
 # define _(msgid) gettext (msgid)
+/* When used standalone, flockfile and funlockfile might not be
+   available.  */
+# if (!defined _POSIX_THREAD_SAFE_FUNCTIONS \
+      || (defined _WIN32 && ! defined __CYGWIN__))
+#  define flockfile(fp) /* nop */
+#  define funlockfile(fp) /* nop */
+# endif
+/* When used standalone, do not attempt to use alloca.  */
+# define __libc_use_alloca(size) 0
+# undef alloca
+# define alloca(size) (abort (), (void *)0)
 #endif
 
-#if defined _LIBC && defined USE_IN_LIBIO
-# include <wchar.h>
-#endif
-
-/* This version of 'getopt' appears to the caller like standard Unix 'getopt'
-   but it behaves differently for the user, since it allows the user
-   to intersperse the options with the other arguments.
-
-   As 'getopt_long' works, it permutes the elements of ARGV so that,
-   when it is done, all the options precede everything else.  Thus
-   all application programs are extended to handle flexible argument order.
-
-   Using 'getopt' or setting the environment variable POSIXLY_CORRECT
+/* This implementation of 'getopt' has three modes for handling
+   options interspersed with non-option arguments.  It can stop
+   scanning for options at the first non-option argument encountered,
+   as POSIX specifies.  It can continue scanning for options after the
+   first non-option argument, but permute 'argv' as it goes so that,
+   after 'getopt' is done, all the options precede all the non-option
+   arguments and 'optind' points to the first non-option argument.
+   Or, it can report non-option arguments as if they were arguments to
+   the option character '\x01'.
+
+   The default behavior of 'getopt_long' is to permute the argument list.
+   When this implementation is used standalone, the default behavior of
+   'getopt' is to stop at the first non-option argument, but when it is
+   used as part of GNU libc it also permutes the argument list.  In both
+   cases, setting the environment variable POSIXLY_CORRECT to any value
    disables permutation.
-   Then the behavior is completely standard.
 
-   GNU application programs can use a third alternative mode in which
-   they can distinguish the relative order of options and other arguments.  */
+   If the first character of the OPTSTRING argument to 'getopt' or
+   'getopt_long' is '+', both functions will stop at the first
+   non-option argument.  If it is '-', both functions will report
+   non-option arguments as arguments to the option character '\x01'.  */
 
 #include "getopt_int.h"
 
@@ -95,42 +117,7 @@ int optopt = '?';
 /* Keep a global copy of all internal members of getopt_data.  */
 
 static struct _getopt_data getopt_data;
-
-\f
-#if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV
-extern char *getenv ();
-#endif
 \f
-#ifdef _LIBC
-/* Stored original parameters.
-   XXX This is no good solution.  We should rather copy the args so
-   that we can compare them later.  But we must not use malloc(3).  */
-extern int __libc_argc;
-extern char **__libc_argv;
-
-/* Bash 2.0 gives us an environment variable containing flags
-   indicating ARGV elements that should not be considered arguments.  */
-
-# ifdef USE_NONOPTION_FLAGS
-/* Defined in getopt_init.c  */
-extern char *__getopt_nonoption_flags;
-# endif
-
-# ifdef USE_NONOPTION_FLAGS
-#  define SWAP_FLAGS(ch1, ch2) \
-  if (d->__nonoption_flags_len > 0)                                           \
-    {                                                                         \
-      char __tmp = __getopt_nonoption_flags[ch1];                             \
-      __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2];          \
-      __getopt_nonoption_flags[ch2] = __tmp;                                  \
-    }
-# else
-#  define SWAP_FLAGS(ch1, ch2)
-# endif
-#else   /* !_LIBC */
-# define SWAP_FLAGS(ch1, ch2)
-#endif  /* _LIBC */
-
 /* Exchange two adjacent subsequences of ARGV.
    One subsequence is elements [first_nonopt,last_nonopt)
    which contains all the non-options that have been skipped so far.
@@ -153,64 +140,40 @@ exchange (char **argv, struct _getopt_data *d)
      It leaves the longer segment in the right place overall,
      but it consists of two parts that need to be swapped next.  */
 
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
-  /* First make sure the handling of the '__getopt_nonoption_flags'
-     string can work normally.  Our top argument must be in the range
-     of the string.  */
-  if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len)
-    {
-      /* We must extend the array.  The user plays games with us and
-         presents new arguments.  */
-      char *new_str = malloc (top + 1);
-      if (new_str == NULL)
-        d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0;
-      else
-        {
-          memset (__mempcpy (new_str, __getopt_nonoption_flags,
-                             d->__nonoption_flags_max_len),
-                  '\0', top + 1 - d->__nonoption_flags_max_len);
-          d->__nonoption_flags_max_len = top + 1;
-          __getopt_nonoption_flags = new_str;
-        }
-    }
-#endif
-
   while (top > middle && middle > bottom)
     {
       if (top - middle > middle - bottom)
-        {
-          /* Bottom segment is the short one.  */
-          int len = middle - bottom;
-          register int i;
-
-          /* Swap it with the top part of the top segment.  */
-          for (i = 0; i < len; i++)
-            {
-              tem = argv[bottom + i];
-              argv[bottom + i] = argv[top - (middle - bottom) + i];
-              argv[top - (middle - bottom) + i] = tem;
-              SWAP_FLAGS (bottom + i, top - (middle - bottom) + i);
-            }
-          /* Exclude the moved bottom segment from further swapping.  */
-          top -= len;
-        }
+       {
+         /* Bottom segment is the short one.  */
+         int len = middle - bottom;
+         int i;
+
+         /* Swap it with the top part of the top segment.  */
+         for (i = 0; i < len; i++)
+           {
+             tem = argv[bottom + i];
+             argv[bottom + i] = argv[top - (middle - bottom) + i];
+             argv[top - (middle - bottom) + i] = tem;
+           }
+         /* Exclude the moved bottom segment from further swapping.  */
+         top -= len;
+       }
       else
-        {
-          /* Top segment is the short one.  */
-          int len = top - middle;
-          register int i;
-
-          /* Swap it with the bottom part of the bottom segment.  */
-          for (i = 0; i < len; i++)
-            {
-              tem = argv[bottom + i];
-              argv[bottom + i] = argv[middle + i];
-              argv[middle + i] = tem;
-              SWAP_FLAGS (bottom + i, middle + i);
-            }
-          /* Exclude the moved top segment from further swapping.  */
-          bottom += len;
-        }
+       {
+         /* Top segment is the short one.  */
+         int len = top - middle;
+         int i;
+
+         /* Swap it with the bottom part of the bottom segment.  */
+         for (i = 0; i < len; i++)
+           {
+             tem = argv[bottom + i];
+             argv[bottom + i] = argv[middle + i];
+             argv[middle + i] = tem;
+           }
+         /* Exclude the moved top segment from further swapping.  */
+         bottom += len;
+       }
     }
 
   /* Update records for the slots the non-options now occupy.  */
@@ -219,25 +182,216 @@ exchange (char **argv, struct _getopt_data *d)
   d->__last_nonopt = d->optind;
 }
 
-/* Initialize the internal data when the first call is made.  */
+/* Process the argument starting with d->__nextchar as a long option.
+   d->optind should *not* have been advanced over this argument.
+
+   If the value returned is -1, it was not actually a long option, the
+   state is unchanged, and the argument should be processed as a set
+   of short options (this can only happen when long_only is true).
+   Otherwise, the option (and its argument, if any) have been consumed
+   and the return value is the value to return from _getopt_internal_r.  */
+static int
+process_long_option (int argc, char **argv, const char *optstring,
+                    const struct option *longopts, int *longind,
+                    int long_only, struct _getopt_data *d,
+                    int print_errors, const char *prefix)
+{
+  char *nameend;
+  size_t namelen;
+  const struct option *p;
+  const struct option *pfound = NULL;
+  int n_options;
+  int option_index;
+
+  for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
+    /* Do nothing.  */ ;
+  namelen = nameend - d->__nextchar;
+
+  /* First look for an exact match, counting the options as a side
+     effect.  */
+  for (p = longopts, n_options = 0; p->name; p++, n_options++)
+    if (!strncmp (p->name, d->__nextchar, namelen)
+       && namelen == strlen (p->name))
+      {
+       /* Exact match found.  */
+       pfound = p;
+       option_index = n_options;
+       break;
+      }
+
+  if (pfound == NULL)
+    {
+      /* Didn't find an exact match, so look for abbreviations.  */
+      unsigned char *ambig_set = NULL;
+      int ambig_malloced = 0;
+      int ambig_fallback = 0;
+      int indfound = -1;
+
+      for (p = longopts, option_index = 0; p->name; p++, option_index++)
+       if (!strncmp (p->name, d->__nextchar, namelen))
+         {
+           if (pfound == NULL)
+             {
+               /* First nonexact match found.  */
+               pfound = p;
+               indfound = option_index;
+             }
+           else if (long_only
+                    || pfound->has_arg != p->has_arg
+                    || pfound->flag != p->flag
+                    || pfound->val != p->val)
+             {
+               /* Second or later nonexact match found.  */
+               if (!ambig_fallback)
+                 {
+                   if (!print_errors)
+                     /* Don't waste effort tracking the ambig set if
+                        we're not going to print it anyway.  */
+                     ambig_fallback = 1;
+                   else if (!ambig_set)
+                     {
+                       if (__libc_use_alloca (n_options))
+                         ambig_set = alloca (n_options);
+                       else if ((ambig_set = malloc (n_options)) == NULL)
+                         /* Fall back to simpler error message.  */
+                         ambig_fallback = 1;
+                       else
+                         ambig_malloced = 1;
+
+                       if (ambig_set)
+                         {
+                           memset (ambig_set, 0, n_options);
+                           ambig_set[indfound] = 1;
+                         }
+                     }
+                   if (ambig_set)
+                     ambig_set[option_index] = 1;
+                 }
+             }
+         }
+
+      if (ambig_set || ambig_fallback)
+       {
+         if (print_errors)
+           {
+             if (ambig_fallback)
+               fprintf (stderr, _("%s: option '%s%s' is ambiguous\n"),
+                        argv[0], prefix, d->__nextchar);
+             else
+               {
+                 flockfile (stderr);
+                 fprintf (stderr,
+                          _("%s: option '%s%s' is ambiguous; possibilities:"),
+                          argv[0], prefix, d->__nextchar);
+
+                 for (option_index = 0; option_index < n_options; option_index++)
+                   if (ambig_set[option_index])
+                     fprintf (stderr, " '%s%s'",
+                              prefix, longopts[option_index].name);
+
+                 /* This must use 'fprintf' even though it's only
+                    printing a single character, so that it goes through
+                    __fxprintf_nocancel when compiled as part of glibc.  */
+                 fprintf (stderr, "\n");
+                 funlockfile (stderr);
+               }
+           }
+         if (ambig_malloced)
+           free (ambig_set);
+         d->__nextchar += strlen (d->__nextchar);
+         d->optind++;
+         d->optopt = 0;
+         return '?';
+       }
+
+      option_index = indfound;
+    }
+
+  if (pfound == NULL)
+    {
+      /* Can't find it as a long option.  If this is not getopt_long_only,
+        or the option starts with '--' or is not a valid short option,
+        then it's an error.  */
+      if (!long_only || argv[d->optind][1] == '-'
+         || strchr (optstring, *d->__nextchar) == NULL)
+       {
+         if (print_errors)
+           fprintf (stderr, _("%s: unrecognized option '%s%s'\n"),
+                    argv[0], prefix, d->__nextchar);
+
+         d->__nextchar = NULL;
+         d->optind++;
+         d->optopt = 0;
+         return '?';
+       }
+
+      /* Otherwise interpret it as a short option.  */
+      return -1;
+    }
+
+  /* We have found a matching long option.  Consume it.  */
+  d->optind++;
+  d->__nextchar = NULL;
+  if (*nameend)
+    {
+      /* Don't test has_arg with >, because some C compilers don't
+        allow it to be used on enums.  */
+      if (pfound->has_arg)
+       d->optarg = nameend + 1;
+      else
+       {
+         if (print_errors)
+           fprintf (stderr,
+                    _("%s: option '%s%s' doesn't allow an argument\n"),
+                    argv[0], prefix, pfound->name);
+
+         d->optopt = pfound->val;
+         return '?';
+       }
+    }
+  else if (pfound->has_arg == 1)
+    {
+      if (d->optind < argc)
+       d->optarg = argv[d->optind++];
+      else
+       {
+         if (print_errors)
+           fprintf (stderr,
+                    _("%s: option '%s%s' requires an argument\n"),
+                    argv[0], prefix, pfound->name);
+
+         d->optopt = pfound->val;
+         return optstring[0] == ':' ? ':' : '?';
+       }
+    }
+
+  if (longind != NULL)
+    *longind = option_index;
+  if (pfound->flag)
+    {
+      *(pfound->flag) = pfound->val;
+      return 0;
+    }
+  return pfound->val;
+}
+
+/* Initialize internal data upon the first call to getopt.  */
 
 static const char *
 _getopt_initialize (int argc _GL_UNUSED,
-                    char **argv _GL_UNUSED, const char *optstring,
-                    struct _getopt_data *d, int posixly_correct)
+                   char **argv _GL_UNUSED, const char *optstring,
+                   struct _getopt_data *d, int posixly_correct)
 {
   /* Start processing options with ARGV-element 1 (since ARGV-element 0
      is the program name); the sequence of previously skipped
      non-option ARGV-elements is empty.  */
+  if (d->optind == 0)
+    d->optind = 1;
 
   d->__first_nonopt = d->__last_nonopt = d->optind;
-
   d->__nextchar = NULL;
 
-  d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT");
-
   /* Determine how to handle the ordering of options and nonoptions.  */
-
   if (optstring[0] == '-')
     {
       d->__ordering = RETURN_IN_ORDER;
@@ -248,41 +402,12 @@ _getopt_initialize (int argc _GL_UNUSED,
       d->__ordering = REQUIRE_ORDER;
       ++optstring;
     }
-  else if (d->__posixly_correct)
+  else if (posixly_correct || !!getenv ("POSIXLY_CORRECT"))
     d->__ordering = REQUIRE_ORDER;
   else
     d->__ordering = PERMUTE;
 
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
-  if (!d->__posixly_correct
-      && argc == __libc_argc && argv == __libc_argv)
-    {
-      if (d->__nonoption_flags_max_len == 0)
-        {
-          if (__getopt_nonoption_flags == NULL
-              || __getopt_nonoption_flags[0] == '\0')
-            d->__nonoption_flags_max_len = -1;
-          else
-            {
-              const char *orig_str = __getopt_nonoption_flags;
-              int len = d->__nonoption_flags_max_len = strlen (orig_str);
-              if (d->__nonoption_flags_max_len < argc)
-                d->__nonoption_flags_max_len = argc;
-              __getopt_nonoption_flags =
-                (char *) malloc (d->__nonoption_flags_max_len);
-              if (__getopt_nonoption_flags == NULL)
-                d->__nonoption_flags_max_len = -1;
-              else
-                memset (__mempcpy (__getopt_nonoption_flags, orig_str, len),
-                        '\0', d->__nonoption_flags_max_len - len);
-            }
-        }
-      d->__nonoption_flags_len = d->__nonoption_flags_max_len;
-    }
-  else
-    d->__nonoption_flags_len = 0;
-#endif
-
+  d->__initialized = 1;
   return optstring;
 }
 \f
@@ -344,8 +469,8 @@ _getopt_initialize (int argc _GL_UNUSED,
 
 int
 _getopt_internal_r (int argc, char **argv, const char *optstring,
-                    const struct option *longopts, int *longind,
-                    int long_only, struct _getopt_data *d, int posixly_correct)
+                   const struct option *longopts, int *longind,
+                   int long_only, struct _getopt_data *d, int posixly_correct)
 {
   int print_errors = d->opterr;
 
@@ -355,461 +480,129 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
   d->optarg = NULL;
 
   if (d->optind == 0 || !d->__initialized)
-    {
-      if (d->optind == 0)
-        d->optind = 1;  /* Don't scan ARGV[0], the program name.  */
-      optstring = _getopt_initialize (argc, argv, optstring, d,
-                                      posixly_correct);
-      d->__initialized = 1;
-    }
+    optstring = _getopt_initialize (argc, argv, optstring, d, posixly_correct);
   else if (optstring[0] == '-' || optstring[0] == '+')
     optstring++;
+
   if (optstring[0] == ':')
     print_errors = 0;
 
-  /* Test whether ARGV[optind] points to a non-option argument.
-     Either it does not have option syntax, or there is an environment flag
-     from the shell indicating it is not an option.  The later information
-     is only used when the used in the GNU libc.  */
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
-# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \
-                      || (d->optind < d->__nonoption_flags_len                \
-                          && __getopt_nonoption_flags[d->optind] == '1'))
-#else
-# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
-#endif
+  /* Test whether ARGV[optind] points to a non-option argument.  */
+#define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0')
 
   if (d->__nextchar == NULL || *d->__nextchar == '\0')
     {
       /* Advance to the next ARGV-element.  */
 
       /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been
-         moved back by the user (who may also have changed the arguments).  */
+        moved back by the user (who may also have changed the arguments).  */
       if (d->__last_nonopt > d->optind)
-        d->__last_nonopt = d->optind;
+       d->__last_nonopt = d->optind;
       if (d->__first_nonopt > d->optind)
-        d->__first_nonopt = d->optind;
+       d->__first_nonopt = d->optind;
 
       if (d->__ordering == PERMUTE)
-        {
-          /* If we have just processed some options following some non-options,
-             exchange them so that the options come first.  */
+       {
+         /* If we have just processed some options following some non-options,
+            exchange them so that the options come first.  */
 
-          if (d->__first_nonopt != d->__last_nonopt
-              && d->__last_nonopt != d->optind)
-            exchange ((char **) argv, d);
-          else if (d->__last_nonopt != d->optind)
-            d->__first_nonopt = d->optind;
+         if (d->__first_nonopt != d->__last_nonopt
+             && d->__last_nonopt != d->optind)
+           exchange (argv, d);
+         else if (d->__last_nonopt != d->optind)
+           d->__first_nonopt = d->optind;
 
-          /* Skip any additional non-options
-             and extend the range of non-options previously skipped.  */
+         /* Skip any additional non-options
+            and extend the range of non-options previously skipped.  */
 
-          while (d->optind < argc && NONOPTION_P)
-            d->optind++;
-          d->__last_nonopt = d->optind;
-        }
+         while (d->optind < argc && NONOPTION_P)
+           d->optind++;
+         d->__last_nonopt = d->optind;
+       }
 
       /* The special ARGV-element '--' means premature end of options.
-         Skip it like a null option,
-         then exchange with previous non-options as if it were an option,
-         then skip everything else like a non-option.  */
+        Skip it like a null option,
+        then exchange with previous non-options as if it were an option,
+        then skip everything else like a non-option.  */
 
       if (d->optind != argc && !strcmp (argv[d->optind], "--"))
-        {
-          d->optind++;
+       {
+         d->optind++;
 
-          if (d->__first_nonopt != d->__last_nonopt
-              && d->__last_nonopt != d->optind)
-            exchange ((char **) argv, d);
-          else if (d->__first_nonopt == d->__last_nonopt)
-            d->__first_nonopt = d->optind;
-          d->__last_nonopt = argc;
+         if (d->__first_nonopt != d->__last_nonopt
+             && d->__last_nonopt != d->optind)
+           exchange (argv, d);
+         else if (d->__first_nonopt == d->__last_nonopt)
+           d->__first_nonopt = d->optind;
+         d->__last_nonopt = argc;
 
-          d->optind = argc;
-        }
+         d->optind = argc;
+       }
 
       /* If we have done all the ARGV-elements, stop the scan
-         and back over any non-options that we skipped and permuted.  */
+        and back over any non-options that we skipped and permuted.  */
 
       if (d->optind == argc)
-        {
-          /* Set the next-arg-index to point at the non-options
-             that we previously skipped, so the caller will digest them.  */
-          if (d->__first_nonopt != d->__last_nonopt)
-            d->optind = d->__first_nonopt;
-          return -1;
-        }
+       {
+         /* Set the next-arg-index to point at the non-options
+            that we previously skipped, so the caller will digest them.  */
+         if (d->__first_nonopt != d->__last_nonopt)
+           d->optind = d->__first_nonopt;
+         return -1;
+       }
 
       /* If we have come to a non-option and did not permute it,
-         either stop the scan or describe it to the caller and pass it by.  */
+        either stop the scan or describe it to the caller and pass it by.  */
 
       if (NONOPTION_P)
-        {
-          if (d->__ordering == REQUIRE_ORDER)
-            return -1;
-          d->optarg = argv[d->optind++];
-          return 1;
-        }
+       {
+         if (d->__ordering == REQUIRE_ORDER)
+           return -1;
+         d->optarg = argv[d->optind++];
+         return 1;
+       }
 
       /* We have found another option-ARGV-element.
-         Skip the initial punctuation.  */
-
-      d->__nextchar = (argv[d->optind] + 1
-                  + (longopts != NULL && argv[d->optind][1] == '-'));
-    }
-
-  /* Decode the current option-ARGV-element.  */
-
-  /* Check whether the ARGV-element is a long option.
-
-     If long_only and the ARGV-element has the form "-f", where f is
-     a valid short option, don't consider it an abbreviated form of
-     a long option that starts with f.  Otherwise there would be no
-     way to give the -f short option.
-
-     On the other hand, if there's a long option "fubar" and
-     the ARGV-element is "-fu", do consider that an abbreviation of
-     the long option, just like "--fu", and not "-f" with arg "u".
-
-     This distinction seems to be the most useful approach.  */
-
-  if (longopts != NULL
-      && (argv[d->optind][1] == '-'
-          || (long_only && (argv[d->optind][2]
-                            || !strchr (optstring, argv[d->optind][1])))))
-    {
-      char *nameend;
-      unsigned int namelen;
-      const struct option *p;
-      const struct option *pfound = NULL;
-      struct option_list
-      {
-        const struct option *p;
-        struct option_list *next;
-      } *ambig_list = NULL;
-#ifdef _LIBC
-/* malloc() not used for _LIBC to simplify failure messages.  */
-# define free_option_list(l)
-#else
-# define free_option_list(l)                   \
-      while (l != NULL)                                \
-        {                                      \
-          struct option_list *pn = l->next;    \
-          free (l);                            \
-          l = pn;                              \
-        }
-#endif
-      int exact = 0;
-      int ambig = 0;
-      int indfound = -1;
-      int option_index;
-
-      for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++)
-        /* Do nothing.  */ ;
-      namelen = nameend - d->__nextchar;
-
-      /* Test all long options for either exact match
-         or abbreviated matches.  */
-      for (p = longopts, option_index = 0; p->name; p++, option_index++)
-        if (!strncmp (p->name, d->__nextchar, namelen))
-          {
-            if (namelen == (unsigned int) strlen (p->name))
-              {
-                /* Exact match found.  */
-                pfound = p;
-                indfound = option_index;
-                exact = 1;
-                break;
-              }
-            else if (pfound == NULL)
-              {
-                /* First nonexact match found.  */
-                pfound = p;
-                indfound = option_index;
-              }
-            else if (ambig)
-              ; /* Taking simpler path to handling ambiguities.  */
-            else if (long_only
-                     || pfound->has_arg != p->has_arg
-                     || pfound->flag != p->flag
-                     || pfound->val != p->val)
-              {
-                /* Second or later nonexact match found.  */
-#ifdef _LIBC
-                struct option_list *newp = alloca (sizeof (*newp));
-#else
-                struct option_list *newp = malloc (sizeof (*newp));
-                if (newp == NULL)
-                  {
-                    free_option_list (ambig_list);
-                    ambig_list = NULL;
-                    ambig = 1; /* Use simpler fallback message.  */
-                  }
-                else
-#endif
-                  {
-                    newp->p = p;
-                    newp->next = ambig_list;
-                    ambig_list = newp;
-                  }
-              }
-          }
-
-      if ((ambig || ambig_list) && !exact)
-        {
-          if (print_errors && ambig_list)
-            {
-              struct option_list first;
-              first.p = pfound;
-              first.next = ambig_list;
-              ambig_list = &first;
-
-#if defined _LIBC && defined USE_IN_LIBIO
-              char *buf = NULL;
-              size_t buflen = 0;
-
-              FILE *fp = open_memstream (&buf, &buflen);
-              if (fp != NULL)
-                {
-                  fprintf (fp,
-                           _("%s: option '%s' is ambiguous; possibilities:"),
-                           argv[0], argv[d->optind]);
-
-                  do
-                    {
-                      fprintf (fp, " '--%s'", ambig_list->p->name);
-                      ambig_list = ambig_list->next;
-                    }
-                  while (ambig_list != NULL);
-
-                  fputc_unlocked ('\n', fp);
-
-                  if (__builtin_expect (fclose (fp) != EOF, 1))
-                    {
-                      _IO_flockfile (stderr);
-
-                      int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                      ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                      __fxprintf (NULL, "%s", buf);
-
-                      ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                      _IO_funlockfile (stderr);
-
-                      free (buf);
-                    }
-                }
-#else
-              fprintf (stderr,
-                       _("%s: option '%s' is ambiguous; possibilities:"),
-                       argv[0], argv[d->optind]);
-              do
-                {
-                  fprintf (stderr, " '--%s'", ambig_list->p->name);
-                  ambig_list = ambig_list->next;
-                }
-              while (ambig_list != NULL);
-
-              fputc ('\n', stderr);
-#endif
-            }
-          else if (print_errors && ambig)
-            {
-              fprintf (stderr,
-                       _("%s: option '%s' is ambiguous\n"),
-                       argv[0], argv[d->optind]);
-            }
-          d->__nextchar += strlen (d->__nextchar);
-          d->optind++;
-          d->optopt = 0;
-          free_option_list (ambig_list);
-          return '?';
-        }
-
-      free_option_list (ambig_list);
-
-      if (pfound != NULL)
-        {
-          option_index = indfound;
-          d->optind++;
-          if (*nameend)
-            {
-              /* Don't test has_arg with >, because some C compilers don't
-                 allow it to be used on enums.  */
-              if (pfound->has_arg)
-                d->optarg = nameend + 1;
-              else
-                {
-                  if (print_errors)
-                    {
-#if defined _LIBC && defined USE_IN_LIBIO
-                      char *buf;
-                      int n;
-#endif
-
-                      if (argv[d->optind - 1][1] == '-')
-                        {
-                          /* --option */
-#if defined _LIBC && defined USE_IN_LIBIO
-                          n = __asprintf (&buf, _("\
-%s: option '--%s' doesn't allow an argument\n"),
-                                          argv[0], pfound->name);
-#else
-                          fprintf (stderr, _("\
-%s: option '--%s' doesn't allow an argument\n"),
-                                   argv[0], pfound->name);
-#endif
-                        }
-                      else
-                        {
-                          /* +option or -option */
-#if defined _LIBC && defined USE_IN_LIBIO
-                          n = __asprintf (&buf, _("\
-%s: option '%c%s' doesn't allow an argument\n"),
-                                          argv[0], argv[d->optind - 1][0],
-                                          pfound->name);
-#else
-                          fprintf (stderr, _("\
-%s: option '%c%s' doesn't allow an argument\n"),
-                                   argv[0], argv[d->optind - 1][0],
-                                   pfound->name);
-#endif
-                        }
-
-#if defined _LIBC && defined USE_IN_LIBIO
-                      if (n >= 0)
-                        {
-                          _IO_flockfile (stderr);
-
-                          int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                          ((_IO_FILE *) stderr)->_flags2
-                            |= _IO_FLAGS2_NOTCANCEL;
-
-                          __fxprintf (NULL, "%s", buf);
-
-                          ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                          _IO_funlockfile (stderr);
-
-                          free (buf);
-                        }
-#endif
-                    }
-
-                  d->__nextchar += strlen (d->__nextchar);
-
-                  d->optopt = pfound->val;
-                  return '?';
-                }
-            }
-          else if (pfound->has_arg == 1)
-            {
-              if (d->optind < argc)
-                d->optarg = argv[d->optind++];
-              else
-                {
-                  if (print_errors)
-                    {
-#if defined _LIBC && defined USE_IN_LIBIO
-                      char *buf;
-
-                      if (__asprintf (&buf, _("\
-%s: option '--%s' requires an argument\n"),
-                                      argv[0], pfound->name) >= 0)
-                        {
-                          _IO_flockfile (stderr);
-
-                          int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                          ((_IO_FILE *) stderr)->_flags2
-                            |= _IO_FLAGS2_NOTCANCEL;
-
-                          __fxprintf (NULL, "%s", buf);
-
-                          ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                          _IO_funlockfile (stderr);
-
-                          free (buf);
-                        }
-#else
-                      fprintf (stderr,
-                               _("%s: option '--%s' requires an argument\n"),
-                               argv[0], pfound->name);
-#endif
-                    }
-                  d->__nextchar += strlen (d->__nextchar);
-                  d->optopt = pfound->val;
-                  return optstring[0] == ':' ? ':' : '?';
-                }
-            }
-          d->__nextchar += strlen (d->__nextchar);
-          if (longind != NULL)
-            *longind = option_index;
-          if (pfound->flag)
-            {
-              *(pfound->flag) = pfound->val;
-              return 0;
-            }
-          return pfound->val;
-        }
-
-      /* Can't find it as a long option.  If this is not getopt_long_only,
-         or the option starts with '--' or is not a valid short
-         option, then it's an error.
-         Otherwise interpret it as a short option.  */
-      if (!long_only || argv[d->optind][1] == '-'
-          || strchr (optstring, *d->__nextchar) == NULL)
-        {
-          if (print_errors)
-            {
-#if defined _LIBC && defined USE_IN_LIBIO
-              char *buf;
-              int n;
-#endif
-
-              if (argv[d->optind][1] == '-')
-                {
-                  /* --option */
-#if defined _LIBC && defined USE_IN_LIBIO
-                  n = __asprintf (&buf, _("%s: unrecognized option '--%s'\n"),
-                                  argv[0], d->__nextchar);
-#else
-                  fprintf (stderr, _("%s: unrecognized option '--%s'\n"),
-                           argv[0], d->__nextchar);
-#endif
-                }
-              else
-                {
-                  /* +option or -option */
-#if defined _LIBC && defined USE_IN_LIBIO
-                  n = __asprintf (&buf, _("%s: unrecognized option '%c%s'\n"),
-                                  argv[0], argv[d->optind][0], d->__nextchar);
-#else
-                  fprintf (stderr, _("%s: unrecognized option '%c%s'\n"),
-                           argv[0], argv[d->optind][0], d->__nextchar);
-#endif
-                }
-
-#if defined _LIBC && defined USE_IN_LIBIO
-              if (n >= 0)
-                {
-                  _IO_flockfile (stderr);
-
-                  int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                  ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                  __fxprintf (NULL, "%s", buf);
-
-                  ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                  _IO_funlockfile (stderr);
-
-                  free (buf);
-                }
-#endif
-            }
-          d->__nextchar = (char *) "";
-          d->optind++;
-          d->optopt = 0;
-          return '?';
-        }
+        Check whether it might be a long option.  */
+      if (longopts)
+       {
+         if (argv[d->optind][1] == '-')
+           {
+             /* "--foo" is always a long option.  The special option
+                "--" was handled above.  */
+             d->__nextchar = argv[d->optind] + 2;
+             return process_long_option (argc, argv, optstring, longopts,
+                                         longind, long_only, d,
+                                         print_errors, "--");
+           }
+
+         /* If long_only and the ARGV-element has the form "-f",
+            where f is a valid short option, don't consider it an
+            abbreviated form of a long option that starts with f.
+            Otherwise there would be no way to give the -f short
+            option.
+
+            On the other hand, if there's a long option "fubar" and
+            the ARGV-element is "-fu", do consider that an
+            abbreviation of the long option, just like "--fu", and
+            not "-f" with arg "u".
+
+            This distinction seems to be the most useful approach.  */
+         if (long_only && (argv[d->optind][2]
+                           || !strchr (optstring, argv[d->optind][1])))
+           {
+             int code;
+             d->__nextchar = argv[d->optind] + 1;
+             code = process_long_option (argc, argv, optstring, longopts,
+                                         longind, long_only, d,
+                                         print_errors, "-");
+             if (code != -1)
+               return code;
+           }
+       }
+
+      /* It is not a long option.  Skip the initial punctuation.  */
+      d->__nextchar = argv[d->optind] + 1;
     }
 
   /* Look at and handle the next short option-character.  */
@@ -824,331 +617,83 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
 
     if (temp == NULL || c == ':' || c == ';')
       {
-        if (print_errors)
-          {
-#if defined _LIBC && defined USE_IN_LIBIO
-              char *buf;
-              int n;
-#endif
-
-#if defined _LIBC && defined USE_IN_LIBIO
-              n = __asprintf (&buf, _("%s: invalid option -- '%c'\n"),
-                              argv[0], c);
-#else
-              fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
-#endif
-
-#if defined _LIBC && defined USE_IN_LIBIO
-            if (n >= 0)
-              {
-                _IO_flockfile (stderr);
-
-                int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                __fxprintf (NULL, "%s", buf);
-
-                ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                _IO_funlockfile (stderr);
-
-                free (buf);
-              }
-#endif
-          }
-        d->optopt = c;
-        return '?';
+       if (print_errors)
+         fprintf (stderr, _("%s: invalid option -- '%c'\n"), argv[0], c);
+       d->optopt = c;
+       return '?';
       }
+
     /* Convenience. Treat POSIX -W foo same as long option --foo */
-    if (temp[0] == 'W' && temp[1] == ';')
+    if (temp[0] == 'W' && temp[1] == ';' && longopts != NULL)
       {
-        char *nameend;
-        const struct option *p;
-        const struct option *pfound = NULL;
-        int exact = 0;
-        int ambig = 0;
-        int indfound = 0;
-        int option_index;
-
-        if (longopts == NULL)
-          goto no_longs;
-
-        /* This is an option that requires an argument.  */
-        if (*d->__nextchar != '\0')
-          {
-            d->optarg = d->__nextchar;
-            /* If we end this ARGV-element by taking the rest as an arg,
-               we must advance to the next element now.  */
-            d->optind++;
-          }
-        else if (d->optind == argc)
-          {
-            if (print_errors)
-              {
-#if defined _LIBC && defined USE_IN_LIBIO
-                char *buf;
-
-                if (__asprintf (&buf,
-                                _("%s: option requires an argument -- '%c'\n"),
-                                argv[0], c) >= 0)
-                  {
-                    _IO_flockfile (stderr);
-
-                    int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                    ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                    __fxprintf (NULL, "%s", buf);
-
-                    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                    _IO_funlockfile (stderr);
-
-                    free (buf);
-                  }
-#else
-                fprintf (stderr,
-                         _("%s: option requires an argument -- '%c'\n"),
-                         argv[0], c);
-#endif
-              }
-            d->optopt = c;
-            if (optstring[0] == ':')
-              c = ':';
-            else
-              c = '?';
-            return c;
-          }
-        else
-          /* We already incremented 'd->optind' once;
-             increment it again when taking next ARGV-elt as argument.  */
-          d->optarg = argv[d->optind++];
-
-        /* optarg is now the argument, see if it's in the
-           table of longopts.  */
-
-        for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '=';
-             nameend++)
-          /* Do nothing.  */ ;
-
-        /* Test all long options for either exact match
-           or abbreviated matches.  */
-        for (p = longopts, option_index = 0; p->name; p++, option_index++)
-          if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar))
-            {
-              if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name))
-                {
-                  /* Exact match found.  */
-                  pfound = p;
-                  indfound = option_index;
-                  exact = 1;
-                  break;
-                }
-              else if (pfound == NULL)
-                {
-                  /* First nonexact match found.  */
-                  pfound = p;
-                  indfound = option_index;
-                }
-              else if (long_only
-                       || pfound->has_arg != p->has_arg
-                       || pfound->flag != p->flag
-                       || pfound->val != p->val)
-                /* Second or later nonexact match found.  */
-                ambig = 1;
-            }
-        if (ambig && !exact)
-          {
-            if (print_errors)
-              {
-#if defined _LIBC && defined USE_IN_LIBIO
-                char *buf;
-
-                if (__asprintf (&buf, _("%s: option '-W %s' is ambiguous\n"),
-                                argv[0], d->optarg) >= 0)
-                  {
-                    _IO_flockfile (stderr);
-
-                    int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                    ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                    __fxprintf (NULL, "%s", buf);
-
-                    ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                    _IO_funlockfile (stderr);
-
-                    free (buf);
-                  }
-#else
-                fprintf (stderr, _("%s: option '-W %s' is ambiguous\n"),
-                         argv[0], d->optarg);
-#endif
-              }
-            d->__nextchar += strlen (d->__nextchar);
-            d->optind++;
-            return '?';
-          }
-        if (pfound != NULL)
-          {
-            option_index = indfound;
-            if (*nameend)
-              {
-                /* Don't test has_arg with >, because some C compilers don't
-                   allow it to be used on enums.  */
-                if (pfound->has_arg)
-                  d->optarg = nameend + 1;
-                else
-                  {
-                    if (print_errors)
-                      {
-#if defined _LIBC && defined USE_IN_LIBIO
-                        char *buf;
-
-                        if (__asprintf (&buf, _("\
-%s: option '-W %s' doesn't allow an argument\n"),
-                                        argv[0], pfound->name) >= 0)
-                          {
-                            _IO_flockfile (stderr);
-
-                            int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                            ((_IO_FILE *) stderr)->_flags2
-                              |= _IO_FLAGS2_NOTCANCEL;
-
-                            __fxprintf (NULL, "%s", buf);
-
-                            ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                            _IO_funlockfile (stderr);
-
-                            free (buf);
-                          }
-#else
-                        fprintf (stderr, _("\
-%s: option '-W %s' doesn't allow an argument\n"),
-                                 argv[0], pfound->name);
-#endif
-                      }
-
-                    d->__nextchar += strlen (d->__nextchar);
-                    return '?';
-                  }
-              }
-            else if (pfound->has_arg == 1)
-              {
-                if (d->optind < argc)
-                  d->optarg = argv[d->optind++];
-                else
-                  {
-                    if (print_errors)
-                      {
-#if defined _LIBC && defined USE_IN_LIBIO
-                        char *buf;
-
-                        if (__asprintf (&buf, _("\
-%s: option '-W %s' requires an argument\n"),
-                                        argv[0], pfound->name) >= 0)
-                          {
-                            _IO_flockfile (stderr);
-
-                            int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                            ((_IO_FILE *) stderr)->_flags2
-                              |= _IO_FLAGS2_NOTCANCEL;
-
-                            __fxprintf (NULL, "%s", buf);
-
-                            ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                            _IO_funlockfile (stderr);
-
-                            free (buf);
-                          }
-#else
-                        fprintf (stderr, _("\
-%s: option '-W %s' requires an argument\n"),
-                                 argv[0], pfound->name);
-#endif
-                      }
-                    d->__nextchar += strlen (d->__nextchar);
-                    return optstring[0] == ':' ? ':' : '?';
-                  }
-              }
-            else
-              d->optarg = NULL;
-            d->__nextchar += strlen (d->__nextchar);
-            if (longind != NULL)
-              *longind = option_index;
-            if (pfound->flag)
-              {
-                *(pfound->flag) = pfound->val;
-                return 0;
-              }
-            return pfound->val;
-          }
-
-      no_longs:
-        d->__nextchar = NULL;
-        return 'W';   /* Let the application handle it.   */
+       /* This is an option that requires an argument.  */
+       if (*d->__nextchar != '\0')
+         d->optarg = d->__nextchar;
+       else if (d->optind == argc)
+         {
+           if (print_errors)
+             fprintf (stderr,
+                      _("%s: option requires an argument -- '%c'\n"),
+                      argv[0], c);
+
+           d->optopt = c;
+           if (optstring[0] == ':')
+             c = ':';
+           else
+             c = '?';
+           return c;
+         }
+       else
+         d->optarg = argv[d->optind];
+
+       d->__nextchar = d->optarg;
+       d->optarg = NULL;
+       return process_long_option (argc, argv, optstring, longopts, longind,
+                                   0 /* long_only */, d, print_errors, "-W ");
       }
     if (temp[1] == ':')
       {
-        if (temp[2] == ':')
-          {
-            /* This is an option that accepts an argument optionally.  */
-            if (*d->__nextchar != '\0')
-              {
-                d->optarg = d->__nextchar;
-                d->optind++;
-              }
-            else
-              d->optarg = NULL;
-            d->__nextchar = NULL;
-          }
-        else
-          {
-            /* This is an option that requires an argument.  */
-            if (*d->__nextchar != '\0')
-              {
-                d->optarg = d->__nextchar;
-                /* If we end this ARGV-element by taking the rest as an arg,
-                   we must advance to the next element now.  */
-                d->optind++;
-              }
-            else if (d->optind == argc)
-              {
-                if (print_errors)
-                  {
-#if defined _LIBC && defined USE_IN_LIBIO
-                    char *buf;
-
-                    if (__asprintf (&buf, _("\
-%s: option requires an argument -- '%c'\n"),
-                                    argv[0], c) >= 0)
-                      {
-                        _IO_flockfile (stderr);
-
-                        int old_flags2 = ((_IO_FILE *) stderr)->_flags2;
-                        ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL;
-
-                        __fxprintf (NULL, "%s", buf);
-
-                        ((_IO_FILE *) stderr)->_flags2 = old_flags2;
-                        _IO_funlockfile (stderr);
-
-                        free (buf);
-                      }
-#else
-                    fprintf (stderr,
-                             _("%s: option requires an argument -- '%c'\n"),
-                             argv[0], c);
-#endif
-                  }
-                d->optopt = c;
-                if (optstring[0] == ':')
-                  c = ':';
-                else
-                  c = '?';
-              }
-            else
-              /* We already incremented 'optind' once;
-                 increment it again when taking next ARGV-elt as argument.  */
-              d->optarg = argv[d->optind++];
-            d->__nextchar = NULL;
-          }
+       if (temp[2] == ':')
+         {
+           /* This is an option that accepts an argument optionally.  */
+           if (*d->__nextchar != '\0')
+             {
+               d->optarg = d->__nextchar;
+               d->optind++;
+             }
+           else
+             d->optarg = NULL;
+           d->__nextchar = NULL;
+         }
+       else
+         {
+           /* This is an option that requires an argument.  */
+           if (*d->__nextchar != '\0')
+             {
+               d->optarg = d->__nextchar;
+               /* If we end this ARGV-element by taking the rest as an arg,
+                  we must advance to the next element now.  */
+               d->optind++;
+             }
+           else if (d->optind == argc)
+             {
+               if (print_errors)
+                 fprintf (stderr,
+                          _("%s: option requires an argument -- '%c'\n"),
+                          argv[0], c);
+
+               d->optopt = c;
+               if (optstring[0] == ':')
+                 c = ':';
+               else
+                 c = '?';
+             }
+           else
+             /* We already incremented 'optind' once;
+                increment it again when taking next ARGV-elt as argument.  */
+             d->optarg = argv[d->optind++];
+           d->__nextchar = NULL;
+         }
       }
     return c;
   }
@@ -1156,8 +701,8 @@ _getopt_internal_r (int argc, char **argv, const char *optstring,
 
 int
 _getopt_internal (int argc, char **argv, const char *optstring,
-                  const struct option *longopts, int *longind, int long_only,
-                  int posixly_correct)
+                 const struct option *longopts, int *longind, int long_only,
+                 int posixly_correct)
 {
   int result;
 
@@ -1165,8 +710,8 @@ _getopt_internal (int argc, char **argv, const char *optstring,
   getopt_data.opterr = opterr;
 
   result = _getopt_internal_r (argc, argv, optstring, longopts,
-                               longind, long_only, &getopt_data,
-                               posixly_correct);
+                              longind, long_only, &getopt_data,
+                              posixly_correct);
 
   optind = getopt_data.optind;
   optarg = getopt_data.optarg;
@@ -1175,32 +720,23 @@ _getopt_internal (int argc, char **argv, const char *optstring,
   return result;
 }
 
-/* glibc gets a LSB-compliant getopt.
-   Standalone applications get a POSIX-compliant getopt.  */
-#if _LIBC
-enum { POSIXLY_CORRECT = 0 };
-#else
-enum { POSIXLY_CORRECT = 1 };
-#endif
-
-int
-getopt (int argc, char *const *argv, const char *optstring)
-{
-  return _getopt_internal (argc, (char **) argv, optstring,
-                           (const struct option *) 0,
-                           (int *) 0,
-                           0, POSIXLY_CORRECT);
-}
+/* glibc gets a LSB-compliant getopt and a POSIX-complaint __posix_getopt.
+   Standalone applications just get a POSIX-compliant getopt.
+   POSIX and LSB both require these functions to take 'char *const *argv'
+   even though this is incorrect (because of the permutation).  */
+#define GETOPT_ENTRY(NAME, POSIXLY_CORRECT)                    \
+  int                                                          \
+  NAME (int argc, char *const *argv, const char *optstring)    \
+  {                                                            \
+    return _getopt_internal (argc, (char **)argv, optstring,   \
+                            0, 0, 0, POSIXLY_CORRECT);         \
+  }
 
 #ifdef _LIBC
-int
-__posix_getopt (int argc, char *const *argv, const char *optstring)
-{
-  return _getopt_internal (argc, argv, optstring,
-                           (const struct option *) 0,
-                           (int *) 0,
-                           0, 1);
-}
+GETOPT_ENTRY(getopt, 0)
+GETOPT_ENTRY(__posix_getopt, 1)
+#else
+GETOPT_ENTRY(getopt, 1)
 #endif
 
 \f
@@ -1221,51 +757,51 @@ main (int argc, char **argv)
 
       c = getopt (argc, argv, "abc:d:0123456789");
       if (c == -1)
-        break;
+       break;
 
       switch (c)
-        {
-        case '0':
-        case '1':
-        case '2':
-        case '3':
-        case '4':
-        case '5':
-        case '6':
-        case '7':
-        case '8':
-        case '9':
-          if (digit_optind != 0 && digit_optind != this_option_optind)
-            printf ("digits occur in two different argv-elements.\n");
-          digit_optind = this_option_optind;
-          printf ("option %c\n", c);
-          break;
-
-        case 'a':
-          printf ("option a\n");
-          break;
-
-        case 'b':
-          printf ("option b\n");
-          break;
-
-        case 'c':
-          printf ("option c with value '%s'\n", optarg);
-          break;
-
-        case '?':
-          break;
-
-        default:
-          printf ("?? getopt returned character code 0%o ??\n", c);
-        }
+       {
+       case '0':
+       case '1':
+       case '2':
+       case '3':
+       case '4':
+       case '5':
+       case '6':
+       case '7':
+       case '8':
+       case '9':
+         if (digit_optind != 0 && digit_optind != this_option_optind)
+           printf ("digits occur in two different argv-elements.\n");
+         digit_optind = this_option_optind;
+         printf ("option %c\n", c);
+         break;
+
+       case 'a':
+         printf ("option a\n");
+         break;
+
+       case 'b':
+         printf ("option b\n");
+         break;
+
+       case 'c':
+         printf ("option c with value '%s'\n", optarg);
+         break;
+
+       case '?':
+         break;
+
+       default:
+         printf ("?? getopt returned character code 0%o ??\n", c);
+       }
     }
 
   if (optind < argc)
     {
       printf ("non-option ARGV-elements: ");
       while (optind < argc)
-        printf ("%s ", argv[optind++]);
+       printf ("%s ", argv[optind++]);
       printf ("\n");
     }
 
index 64469b7..541fb9d 100644 (file)
@@ -1,20 +1,22 @@
 /* Declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2016 Free Software
-   Foundation, Inc.
-   This file is part of the GNU C Library.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
+   This file is part of gnulib.
+   Unlike most of the getopt implementation, it is NOT shared
+   with the GNU C Library, which supplies a different version of
+   this file.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
+   This file is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 3 of
+   the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   This file is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public
+   License along with gnulib; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _@GUARD_PREFIX@_GETOPT_H
 
 # undef _GL_SYSTEM_GETOPT
 #endif
 
-#ifndef _@GUARD_PREFIX@_GETOPT_H
-
-#ifndef __need_getopt
-# define _@GUARD_PREFIX@_GETOPT_H 1
-#endif
+#define _@GUARD_PREFIX@_GETOPT_H 1
 
 /* Standalone applications should #define __GETOPT_PREFIX to an
    identifier that prefixes the external functions and variables
-   defined in this header.  When this happens, include the
-   headers that might declare getopt so that they will not cause
-   confusion if included after this file (if the system had <getopt.h>,
-   we have already included it).  Then systematically rename
-   identifiers so that they do not collide with the system functions
-   and variables.  Renaming avoids problems with some compilers and
-   linkers.  */
+   defined in getopt-core.h and getopt-ext.h.  When this happens,
+   include the headers that might declare getopt so that they will not
+   cause confusion if included after this file (if the system had
+   <getopt.h>, we have already included it).  */
 #if defined __GETOPT_PREFIX
-# if !defined __need_getopt
-#  if !@HAVE_GETOPT_H@
-#   define __need_system_stdlib_h
-#   include <stdlib.h>
-#   undef __need_system_stdlib_h
-#   include <stdio.h>
-#   include <unistd.h>
-#  endif
-#  undef __need_getopt
-# endif
-# undef __GETOPT_CONCAT
-# undef __GETOPT_XCONCAT
-# undef __GETOPT_ID
-# undef getopt
-# undef getopt_long
-# undef getopt_long_only
-# undef optarg
-# undef opterr
-# undef optind
-# undef optopt
-# undef option
-# undef _getopt_internal
-# define __GETOPT_CONCAT(x, y) x ## y
-# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
-# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
-# define getopt __GETOPT_ID (getopt)
-# define getopt_long __GETOPT_ID (getopt_long)
-# define getopt_long_only __GETOPT_ID (getopt_long_only)
-# define optarg __GETOPT_ID (optarg)
-# define opterr __GETOPT_ID (opterr)
-# define optind __GETOPT_ID (optind)
-# define optopt __GETOPT_ID (optopt)
-# define option __GETOPT_ID (option)
-# define _getopt_internal __GETOPT_ID (getopt_internal)
-#endif
-
-/* Standalone applications get correct prototypes for getopt_long and
-   getopt_long_only; they declare "char **argv".  libc uses prototypes
-   with "char *const *argv" that are incorrect because getopt_long and
-   getopt_long_only can permute argv; this is required for backward
-   compatibility (e.g., for LSB 2.0.1).
-
-   This used to be '#if defined __GETOPT_PREFIX && !defined __need_getopt',
-   but it caused redefinition warnings if both unistd.h and getopt.h were
-   included, since unistd.h includes getopt.h having previously defined
-   __need_getopt.
-
-   The only place where __getopt_argv_const is used is in definitions
-   of getopt_long and getopt_long_only below, but these are visible
-   only if __need_getopt is not defined, so it is quite safe to rewrite
-   the conditional as follows:
-*/
-#if !defined __need_getopt
-# if defined __GETOPT_PREFIX
-#  define __getopt_argv_const /* empty */
-# else
-#  define __getopt_argv_const const
-# endif
-#endif
-
-/* If __GNU_LIBRARY__ is not already defined, either we are being used
-   standalone, or this is the first header included in the source file.
-   If we are being used with glibc, we need to include <features.h>, but
-   that does not exist if we are standalone.  So: if __GNU_LIBRARY__ is
-   not defined, include <ctype.h>, which will pull in <features.h> for us
-   if it's from glibc.  (Why ctype.h?  It's guaranteed to exist and it
-   doesn't flood the namespace with stuff the way some other headers do.)  */
-#if !defined __GNU_LIBRARY__
-# include <ctype.h>
-#endif
-
-#ifndef __THROW
-# ifndef __GNUC_PREREQ
-#  define __GNUC_PREREQ(maj, min) (0)
-# endif
-# if defined __cplusplus && __GNUC_PREREQ (2,8)
-#  define __THROW       throw ()
-# else
-#  define __THROW
+# if !@HAVE_GETOPT_H@
+#  define __need_system_stdlib_h
+#  include <stdlib.h>
+#  undef __need_system_stdlib_h
+#  include <stdio.h>
+#  include <unistd.h>
 # endif
 #endif
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* For communication from 'getopt' to the caller.
-   When 'getopt' finds an option that takes an argument,
-   the argument value is returned here.
-   Also, when 'ordering' is RETURN_IN_ORDER,
-   each non-option ARGV-element is returned here.  */
-
-extern char *optarg;
-
-/* Index in ARGV of the next element to be scanned.
-   This is used for communication to and from the caller
-   and for communication between successive calls to 'getopt'.
-
-   On entry to 'getopt', zero means this is the first call; initialize.
-
-   When 'getopt' returns -1, this is the index of the first of the
-   non-option elements that the caller should itself scan.
-
-   Otherwise, 'optind' communicates from one call to the next
-   how much of ARGV has been scanned so far.  */
-
-extern int optind;
-
-/* Callers store zero here to inhibit the error message 'getopt' prints
-   for unrecognized options.  */
-
-extern int opterr;
-
-/* Set to an option character which was unrecognized.  */
+#include <getopt-cdefs.h>
+#include <getopt-pfx-core.h>
+#include <getopt-pfx-ext.h>
 
-extern int optopt;
-
-#ifndef __need_getopt
-/* Describe the long-named options requested by the application.
-   The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
-   of 'struct option' terminated by an element containing a name which is
-   zero.
-
-   The field 'has_arg' is:
-   no_argument          (or 0) if the option does not take an argument,
-   required_argument    (or 1) if the option requires an argument,
-   optional_argument    (or 2) if the option takes an optional argument.
-
-   If the field 'flag' is not NULL, it points to a variable that is set
-   to the value given in the field 'val' when the option is found, but
-   left unchanged if the option is not found.
-
-   To have a long-named option do something other than set an 'int' to
-   a compiled-in constant, such as set a value from 'optarg', set the
-   option's 'flag' field to zero and its 'val' field to a nonzero
-   value (the equivalent single-letter option character, if there is
-   one).  For long options that have a zero 'flag' field, 'getopt'
-   returns the contents of the 'val' field.  */
-
-# if !GNULIB_defined_struct_option
-struct option
-{
-  const char *name;
-  /* has_arg can't be an enum because some compilers complain about
-     type mismatches in all the code that assumes it is an int.  */
-  int has_arg;
-  int *flag;
-  int val;
-};
-#  define GNULIB_defined_struct_option 1
-# endif
-
-/* Names for the values of the 'has_arg' field of 'struct option'.  */
-
-# define no_argument            0
-# define required_argument      1
-# define optional_argument      2
-#endif  /* need getopt */
-
-
-/* Get definitions and prototypes for functions to process the
-   arguments in ARGV (ARGC of them, minus the program name) for
-   options given in OPTS.
-
-   Return the option character from OPTS just read.  Return -1 when
-   there are no more options.  For unrecognized options, or options
-   missing arguments, 'optopt' is set to the option letter, and '?' is
-   returned.
-
-   The OPTS string is a list of characters which are recognized option
-   letters, optionally followed by colons, specifying that that letter
-   takes an argument, to be placed in 'optarg'.
-
-   If a letter in OPTS is followed by two colons, its argument is
-   optional.  This behavior is specific to the GNU 'getopt'.
-
-   The argument '--' causes premature termination of argument
-   scanning, explicitly telling 'getopt' that there are no more
-   options.
-
-   If OPTS begins with '-', then non-option arguments are treated as
-   arguments to the option '\1'.  This behavior is specific to the GNU
-   'getopt'.  If OPTS begins with '+', or POSIXLY_CORRECT is set in
-   the environment, then do not permute arguments.  */
-
-extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
-       __THROW _GL_ARG_NONNULL ((2, 3));
-
-#ifndef __need_getopt
-extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
-                        const char *__shortopts,
-                        const struct option *__longopts, int *__longind)
-       __THROW _GL_ARG_NONNULL ((2, 3));
-extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
-                             const char *__shortopts,
-                             const struct option *__longopts, int *__longind)
-       __THROW _GL_ARG_NONNULL ((2, 3));
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-/* Make sure we later can get all the definitions and declarations.  */
-#undef __need_getopt
-
-#endif /* _@GUARD_PREFIX@_GETOPT_H */
 #endif /* _@GUARD_PREFIX@_GETOPT_H */
index 63db74f..ca24eb8 100644 (file)
@@ -1,56 +1,44 @@
 /* getopt_long and getopt_long_only entry points for GNU getopt.
-   Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2016 Free Software
-   Foundation, Inc.
-   This file is part of the GNU C Library.
+   Copyright (C) 1987-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 \f
-#ifdef _LIBC
-# include <getopt.h>
-#else
+#ifndef _LIBC
 # include <config.h>
-# include "getopt.h"
 #endif
-#include "getopt_int.h"
-
-#include <stdio.h>
 
-/* This needs to come after some library #include
-   to get __GNU_LIBRARY__ defined.  */
-#ifdef __GNU_LIBRARY__
-#include <stdlib.h>
-#endif
-
-#ifndef NULL
-#define NULL 0
-#endif
+#include "getopt.h"
+#include "getopt_int.h"
 
 int
 getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
-             const struct option *long_options, int *opt_index)
+            const struct option *long_options, int *opt_index)
 {
   return _getopt_internal (argc, (char **) argv, options, long_options,
-                           opt_index, 0, 0);
+                          opt_index, 0, 0);
 }
 
 int
 _getopt_long_r (int argc, char **argv, const char *options,
-                const struct option *long_options, int *opt_index,
-                struct _getopt_data *d)
+               const struct option *long_options, int *opt_index,
+               struct _getopt_data *d)
 {
   return _getopt_internal_r (argc, argv, options, long_options, opt_index,
-                             0, d, 0);
+                            0, d, 0);
 }
 
 /* Like getopt_long, but '-' as well as '--' can indicate a long option.
@@ -60,26 +48,27 @@ _getopt_long_r (int argc, char **argv, const char *options,
 
 int
 getopt_long_only (int argc, char *__getopt_argv_const *argv,
-                  const char *options,
-                  const struct option *long_options, int *opt_index)
+                 const char *options,
+                 const struct option *long_options, int *opt_index)
 {
   return _getopt_internal (argc, (char **) argv, options, long_options,
-                           opt_index, 1, 0);
+                          opt_index, 1, 0);
 }
 
 int
 _getopt_long_only_r (int argc, char **argv, const char *options,
-                     const struct option *long_options, int *opt_index,
-                     struct _getopt_data *d)
+                    const struct option *long_options, int *opt_index,
+                    struct _getopt_data *d)
 {
   return _getopt_internal_r (argc, argv, options, long_options, opt_index,
-                             1, d, 0);
+                            1, d, 0);
 }
 
 \f
 #ifdef TEST
 
 #include <stdio.h>
+#include <stdlib.h>
 
 int
 main (int argc, char **argv)
@@ -93,74 +82,74 @@ main (int argc, char **argv)
       int option_index = 0;
       static const struct option long_options[] =
       {
-        {"add", 1, 0, 0},
-        {"append", 0, 0, 0},
-        {"delete", 1, 0, 0},
-        {"verbose", 0, 0, 0},
-        {"create", 0, 0, 0},
-        {"file", 1, 0, 0},
-        {0, 0, 0, 0}
+       {"add", 1, 0, 0},
+       {"append", 0, 0, 0},
+       {"delete", 1, 0, 0},
+       {"verbose", 0, 0, 0},
+       {"create", 0, 0, 0},
+       {"file", 1, 0, 0},
+       {0, 0, 0, 0}
       };
 
       c = getopt_long (argc, argv, "abc:d:0123456789",
-                       long_options, &option_index);
+                      long_options, &option_index);
       if (c == -1)
-        break;
+       break;
 
       switch (c)
-        {
-        case 0:
-          printf ("option %s", long_options[option_index].name);
-          if (optarg)
-            printf (" with arg %s", optarg);
-          printf ("\n");
-          break;
-
-        case '0':
-        case '1':
-        case '2':
-        case '3':
-        case '4':
-        case '5':
-        case '6':
-        case '7':
-        case '8':
-        case '9':
-          if (digit_optind != 0 && digit_optind != this_option_optind)
-            printf ("digits occur in two different argv-elements.\n");
-          digit_optind = this_option_optind;
-          printf ("option %c\n", c);
-          break;
-
-        case 'a':
-          printf ("option a\n");
-          break;
-
-        case 'b':
-          printf ("option b\n");
-          break;
-
-        case 'c':
-          printf ("option c with value '%s'\n", optarg);
-          break;
-
-        case 'd':
-          printf ("option d with value '%s'\n", optarg);
-          break;
-
-        case '?':
-          break;
-
-        default:
-          printf ("?? getopt returned character code 0%o ??\n", c);
-        }
+       {
+       case 0:
+         printf ("option %s", long_options[option_index].name);
+         if (optarg)
+           printf (" with arg %s", optarg);
+         printf ("\n");
+         break;
+
+       case '0':
+       case '1':
+       case '2':
+       case '3':
+       case '4':
+       case '5':
+       case '6':
+       case '7':
+       case '8':
+       case '9':
+         if (digit_optind != 0 && digit_optind != this_option_optind)
+           printf ("digits occur in two different argv-elements.\n");
+         digit_optind = this_option_optind;
+         printf ("option %c\n", c);
+         break;
+
+       case 'a':
+         printf ("option a\n");
+         break;
+
+       case 'b':
+         printf ("option b\n");
+         break;
+
+       case 'c':
+         printf ("option c with value '%s'\n", optarg);
+         break;
+
+       case 'd':
+         printf ("option d with value '%s'\n", optarg);
+         break;
+
+       case '?':
+         break;
+
+       default:
+         printf ("?? getopt returned character code 0%o ??\n", c);
+       }
     }
 
   if (optind < argc)
     {
       printf ("non-option ARGV-elements: ");
       while (optind < argc)
-        printf ("%s ", argv[optind++]);
+       printf ("%s ", argv[optind++]);
       printf ("\n");
     }
 
index be4c22e..b70ff5b 100644 (file)
@@ -1,30 +1,31 @@
 /* Internal declarations for getopt.
-   Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2016 Free Software
-   Foundation, Inc.
-   This file is part of the GNU C Library.
+   Copyright (C) 1989-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library and is also part of gnulib.
+   Patches to this file should be submitted to both projects.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GETOPT_INT_H
-#define _GETOPT_INT_H   1
+#define _GETOPT_INT_H  1
 
 #include <getopt.h>
 
 extern int _getopt_internal (int ___argc, char **___argv,
-                             const char *__shortopts,
-                             const struct option *__longopts, int *__longind,
-                             int __long_only, int __posixly_correct);
+                            const char *__shortopts,
+                            const struct option *__longopts, int *__longind,
+                            int __long_only, int __posixly_correct);
 
 \f
 /* Reentrant versions which can handle parsing multiple argument
@@ -32,28 +33,20 @@ extern int _getopt_internal (int ___argc, char **___argv,
 
 /* Describe how to deal with options that follow non-option ARGV-elements.
 
-   If the caller did not specify anything,
-   the default is REQUIRE_ORDER if the environment variable
-   POSIXLY_CORRECT is defined, PERMUTE otherwise.
+   REQUIRE_ORDER means don't recognize them as options; stop option
+   processing when the first non-option is seen.  This is what POSIX
+   specifies should happen.
 
-   REQUIRE_ORDER means don't recognize them as options;
-   stop option processing when the first non-option is seen.
-   This is what Unix does.
-   This mode of operation is selected by either setting the environment
-   variable POSIXLY_CORRECT, or using '+' as the first character
-   of the list of option characters, or by calling getopt.
-
-   PERMUTE is the default.  We permute the contents of ARGV as we
-   scan, so that eventually all the non-options are at the end.
-   This allows options to be given in any order, even with programs
-   that were not written to expect this.
+   PERMUTE means permute the contents of ARGV as we scan, so that
+   eventually all the non-options are at the end.  This allows options
+   to be given in any order, even with programs that were not written
+   to expect this.
 
    RETURN_IN_ORDER is an option available to programs that were
    written to expect options and other ARGV-elements in any order
    and that care about the ordering of the two.  We describe each
    non-option ARGV-element as if it were the argument of an option
-   with character code 1.  Using '-' as the first character of the
-   list of option characters selects this mode of operation.
+   with character code 1.
 
    The special argument '--' forces an end of option-scanning regardless
    of the value of 'ordering'.  In the case of RETURN_IN_ORDER, only
@@ -91,11 +84,6 @@ struct _getopt_data
   /* See __ord above.  */
   enum __ord __ordering;
 
-  /* If the POSIXLY_CORRECT environment variable is set
-     or getopt was called.  */
-  int __posixly_correct;
-
-
   /* Handle permutation of arguments.  */
 
   /* Describe the part of ARGV that contains non-options that have
@@ -104,32 +92,27 @@ struct _getopt_data
 
   int __first_nonopt;
   int __last_nonopt;
-
-#if defined _LIBC && defined USE_NONOPTION_FLAGS
-  int __nonoption_flags_max_len;
-  int __nonoption_flags_len;
-#endif
 };
 
 /* The initializer is necessary to set OPTIND and OPTERR to their
    default values and to clear the initialization flag.  */
-#define _GETOPT_DATA_INITIALIZER        { 1, 1 }
+#define _GETOPT_DATA_INITIALIZER       { 1, 1 }
 
 extern int _getopt_internal_r (int ___argc, char **___argv,
-                               const char *__shortopts,
-                               const struct option *__longopts, int *__longind,
-                               int __long_only, struct _getopt_data *__data,
-                               int __posixly_correct);
+                              const char *__shortopts,
+                              const struct option *__longopts, int *__longind,
+                              int __long_only, struct _getopt_data *__data,
+                              int __posixly_correct);
 
 extern int _getopt_long_r (int ___argc, char **___argv,
-                           const char *__shortopts,
-                           const struct option *__longopts, int *__longind,
-                           struct _getopt_data *__data);
+                          const char *__shortopts,
+                          const struct option *__longopts, int *__longind,
+                          struct _getopt_data *__data);
 
 extern int _getopt_long_only_r (int ___argc, char **___argv,
-                                const char *__shortopts,
-                                const struct option *__longopts,
-                                int *__longind,
-                                struct _getopt_data *__data);
+                               const char *__shortopts,
+                               const struct option *__longopts,
+                               int *__longind,
+                               struct _getopt_data *__data);
 
 #endif /* getopt_int.h */
similarity index 82%
rename from tests/getpagesize.c
rename to lib/getpagesize.c
index dc4a200..dab0462 100644 (file)
@@ -1,6 +1,6 @@
 /* getpagesize emulation for systems where it cannot be done in a C macro.
 
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible and Martin Lambers.  */
 
@@ -23,7 +23,7 @@
 #include <unistd.h>
 
 /* This implementation is only for native Windows systems.  */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
index a7246e9..6477e9e 100644 (file)
@@ -1,5 +1,5 @@
 /* Program name management.
-   Copyright (C) 2016 Free Software Foundation, Inc.
+   Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 # include <string.h>
 #endif
 
-#include "dirname.h"
+#if defined __sgi || defined __osf__
+# include <string.h>
+# include <unistd.h>
+# include <stdio.h>
+# include <fcntl.h>
+# include <sys/procfs.h>
+#endif
+
+#if defined __SCO_VERSION__ || defined __sysv5__
+# include <fcntl.h>
+# include <stdlib.h>
+# include <string.h>
+#endif
+
+#include "basename-lgpl.h"
 
 #ifndef HAVE_GETPROGNAME             /* not Mac OS X, FreeBSD, NetBSD, OpenBSD >= 5.4, Cygwin */
 char const *
@@ -56,17 +70,17 @@ getprogname (void)
   /* https://www.gnu.org/software/libc/manual/html_node/Error-Messages.html */
   return last_component (program_invocation_name);
 # elif HAVE_GETEXECNAME                                     /* Solaris */
-  /* http://docs.oracle.com/cd/E19253-01/816-5168/6mbb3hrb1/index.html */
+  /* https://docs.oracle.com/cd/E19253-01/816-5168/6mbb3hrb1/index.html */
   const char *p = getexecname ();
   if (!p)
     p = "?";
   return last_component (p);
 # elif HAVE_DECL___ARGV                                     /* mingw, MSVC */
-  /* https://msdn.microsoft.com/en-us/library/dn727674.aspx */
+  /* https://docs.microsoft.com/en-us/cpp/c-runtime-library/argc-argv-wargv */
   const char *p = __argv && __argv[0] ? __argv[0] : "?";
   return last_component (p);
-# elif HAVE_VAR___PROGNAME                                  /* OpenBSD, QNX */
-  /* http://man.openbsd.org/style.9 */
+# elif HAVE_VAR___PROGNAME                                  /* OpenBSD, Android, QNX */
+  /* https://man.openbsd.org/style.9 */
   /* http://www.qnx.de/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fp%2F__progname.html */
   /* Be careful to declare this only when we absolutely need it
      (OpenBSD 5.1), rather than when it's available.  Otherwise,
@@ -74,12 +88,15 @@ getprogname (void)
      malfunction (have zero length) with Fedora 25's glibc.  */
   extern char *__progname;
   const char *p = __progname;
+#  if defined __ANDROID__
+  return last_component (p);
+#  else
   return p && p[0] ? p : "?";
+#  endif
 # elif _AIX                                                 /* AIX */
   /* Idea by Bastien ROUCARIÈS,
-     http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00095.html
-     Reference: http://
-   ibm.biz/knowctr#ssw_aix_53/com.ibm.aix.basetechref/doc/basetrf1/getprocs.htm
+     https://lists.gnu.org/r/bug-gnulib/2010-12/msg00095.html
+     Reference: https://www.ibm.com/support/knowledgecenter/en/ssw_aix_61/com.ibm.aix.basetrf1/getprocs.htm
   */
   static char *p;
   static int first = 1;
@@ -103,9 +120,73 @@ getprogname (void)
       first = 0;
       pid_t pid = getpid ();
       struct pst_status status;
-      p = (0 < pstat_getproc (&status, sizeof status, 0, pid)
-           ? strdup (status.pst_ucomm)
-           : NULL);
+      if (pstat_getproc (&status, sizeof status, 0, pid) > 0)
+        {
+          char *ucomm = status.pst_ucomm;
+          char *cmd = status.pst_cmd;
+          if (strlen (ucomm) < PST_UCOMMLEN - 1)
+            p = ucomm;
+          else
+            {
+              /* ucomm is truncated to length PST_UCOMMLEN - 1.
+                 Look at cmd instead.  */
+              char *space = strchr (cmd, ' ');
+              if (space != NULL)
+                *space = '\0';
+              p = strrchr (cmd, '/');
+              if (p != NULL)
+                p++;
+              else
+                p = cmd;
+              if (strlen (p) > PST_UCOMMLEN - 1
+                  && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0)
+                /* p is less truncated than ucomm.  */
+                ;
+              else
+                p = ucomm;
+            }
+          p = strdup (p);
+        }
+      else
+        {
+#  if !defined __LP64__
+          /* Support for 32-bit programs running in 64-bit HP-UX.
+             The documented way to do this is to use the same source code
+             as above, but in a compilation unit where '#define _PSTAT64 1'
+             is in effect.  I prefer a single compilation unit; the struct
+             size and the offsets are not going to change.  */
+          char status64[1216];
+          if (__pstat_getproc64 (status64, sizeof status64, 0, pid) > 0)
+            {
+              char *ucomm = status64 + 288;
+              char *cmd = status64 + 168;
+              if (strlen (ucomm) < PST_UCOMMLEN - 1)
+                p = ucomm;
+              else
+                {
+                  /* ucomm is truncated to length PST_UCOMMLEN - 1.
+                     Look at cmd instead.  */
+                  char *space = strchr (cmd, ' ');
+                  if (space != NULL)
+                    *space = '\0';
+                  p = strrchr (cmd, '/');
+                  if (p != NULL)
+                    p++;
+                  else
+                    p = cmd;
+                  if (strlen (p) > PST_UCOMMLEN - 1
+                      && memcmp (p, ucomm, PST_UCOMMLEN - 1) == 0)
+                    /* p is less truncated than ucomm.  */
+                    ;
+                  else
+                    p = ucomm;
+                }
+              p = strdup (p);
+            }
+          else
+#  endif
+            p = NULL;
+        }
       if (!p)
         p = "?";
     }
@@ -143,9 +224,79 @@ getprogname (void)
       free (buf.ps_pathptr);
     }
   return p;
+# elif defined __sgi || defined __osf__                     /* IRIX or Tru64 */
+  char filename[50];
+  int fd;
+
+  # if defined __sgi
+    sprintf (filename, "/proc/pinfo/%d", (int) getpid ());
+  # else
+    sprintf (filename, "/proc/%d", (int) getpid ());
+  # endif
+  fd = open (filename, O_RDONLY | O_CLOEXEC);
+  if (0 <= fd)
+    {
+      prpsinfo_t buf;
+      int ioctl_ok = 0 <= ioctl (fd, PIOCPSINFO, &buf);
+      close (fd);
+      if (ioctl_ok)
+        {
+          char *name = buf.pr_fname;
+          size_t namesize = sizeof buf.pr_fname;
+          /* It may not be NUL-terminated.  */
+          char *namenul = memchr (name, '\0', namesize);
+          size_t namelen = namenul ? namenul - name : namesize;
+          char *namecopy = malloc (namelen + 1);
+          if (namecopy)
+            {
+              namecopy[namelen] = '\0';
+              return memcpy (namecopy, name, namelen);
+            }
+        }
+    }
+  return NULL;
+# elif defined __SCO_VERSION__ || defined __sysv5__                /* SCO OpenServer6/UnixWare */
+  char buf[80];
+  int fd;
+  sprintf (buf, "/proc/%d/cmdline", getpid());
+  fd = open (buf, O_RDONLY);
+  if (0 <= fd)
+    {
+      size_t n = read (fd, buf, 79);
+      if (n > 0)
+        {
+          buf[n] = '\0'; /* Guarantee null-termination */
+          char *progname;
+          progname = strrchr (buf, '/');
+          if (progname)
+            {
+              progname = progname + 1; /* Skip the '/' */
+            }
+          else
+            {
+              progname = buf;
+            }
+          char *ret;
+          ret = malloc (strlen (progname) + 1);
+          if (ret)
+            {
+              strcpy (ret, progname);
+              return ret;
+            }
+        }
+      close (fd);
+    }
+  return "?";
 # else
 #  error "getprogname module not ported to this OS"
 # endif
 }
 
 #endif
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
index e8f9e97..502f2cd 100644 (file)
@@ -1,5 +1,5 @@
 /* Program name management.
-   Copyright (C) 2016 Free Software Foundation, Inc.
+   Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_GETPROGNAME_H
 #define _GL_GETPROGNAME_H
diff --git a/lib/getrandom.c b/lib/getrandom.c
new file mode 100644 (file)
index 0000000..9e90e64
--- /dev/null
@@ -0,0 +1,191 @@
+/* Obtain a series of random bytes.
+
+   Copyright 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include <sys/random.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <unistd.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# if HAVE_BCRYPT_H
+#  include <bcrypt.h>
+# else
+#  define NTSTATUS LONG
+typedef void * BCRYPT_ALG_HANDLE;
+#  define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002
+#  if HAVE_LIB_BCRYPT
+extern NTSTATUS WINAPI BCryptGenRandom (BCRYPT_ALG_HANDLE, UCHAR *, ULONG, ULONG);
+#  endif
+# endif
+# if !HAVE_LIB_BCRYPT
+#  include <wincrypt.h>
+#  ifndef CRYPT_VERIFY_CONTEXT
+#   define CRYPT_VERIFY_CONTEXT 0xF0000000
+#  endif
+# endif
+#endif
+
+#include "minmax.h"
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* Don't assume that UNICODE is not defined.  */
+# undef LoadLibrary
+# define LoadLibrary LoadLibraryA
+# undef CryptAcquireContext
+# define CryptAcquireContext CryptAcquireContextA
+
+# if !HAVE_LIB_BCRYPT
+
+/* Avoid warnings from gcc -Wcast-function-type.  */
+#  define GetProcAddress \
+    (void *) GetProcAddress
+
+/* BCryptGenRandom with the BCRYPT_USE_SYSTEM_PREFERRED_RNG flag works only
+   starting with Windows 7.  */
+typedef NTSTATUS (WINAPI * BCryptGenRandomFuncType) (BCRYPT_ALG_HANDLE, UCHAR *, ULONG, ULONG);
+static BCryptGenRandomFuncType BCryptGenRandomFunc = NULL;
+static BOOL initialized = FALSE;
+
+static void
+initialize (void)
+{
+  HMODULE bcrypt = LoadLibrary ("bcrypt.dll");
+  if (bcrypt != NULL)
+    {
+      BCryptGenRandomFunc =
+        (BCryptGenRandomFuncType) GetProcAddress (bcrypt, "BCryptGenRandom");
+    }
+  initialized = TRUE;
+}
+
+# else
+
+#  define BCryptGenRandomFunc BCryptGenRandom
+
+# endif
+
+#else
+/* These devices exist on all platforms except native Windows.  */
+
+/* Name of a device through which the kernel returns high quality random
+   numbers, from an entropy pool.  When the pool is empty, the call blocks
+   until entropy sources have added enough bits of entropy.  */
+# ifndef NAME_OF_RANDOM_DEVICE
+#  define NAME_OF_RANDOM_DEVICE "/dev/random"
+# endif
+
+/* Name of a device through which the kernel returns random or pseudo-random
+   numbers.  It uses an entropy pool, but, in order to avoid blocking, adds
+   bits generated by a pseudo-random number generator, as needed.  */
+# ifndef NAME_OF_NONCE_DEVICE
+#  define NAME_OF_NONCE_DEVICE "/dev/urandom"
+# endif
+
+#endif
+
+/* Set BUFFER (of size LENGTH) to random bytes under the control of FLAGS.
+   Return the number of bytes written (> 0).
+   Upon error, return -1 and set errno.  */
+ssize_t
+getrandom (void *buffer, size_t length, unsigned int flags)
+#undef getrandom
+{
+#if defined _WIN32 && ! defined __CYGWIN__
+  /* BCryptGenRandom, defined in <bcrypt.h>
+     <https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptgenrandom>
+     with the BCRYPT_USE_SYSTEM_PREFERRED_RNG flag
+     works in Windows 7 and newer.  */
+  static int bcrypt_not_working /* = 0 */;
+  if (!bcrypt_not_working)
+    {
+# if !HAVE_LIB_BCRYPT
+      if (!initialized)
+        initialize ();
+# endif
+      if (BCryptGenRandomFunc != NULL
+          && BCryptGenRandomFunc (NULL, buffer, length,
+                                  BCRYPT_USE_SYSTEM_PREFERRED_RNG)
+             == 0 /*STATUS_SUCCESS*/)
+        return length;
+      bcrypt_not_working = 1;
+    }
+# if !HAVE_LIB_BCRYPT
+  /* CryptGenRandom, defined in <wincrypt.h>
+     <https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptgenrandom>
+     works in older releases as well, but is now deprecated.
+     CryptAcquireContext, defined in <wincrypt.h>
+     <https://docs.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecontexta>  */
+  {
+    static int crypt_initialized /* = 0 */;
+    static HCRYPTPROV provider;
+    if (!crypt_initialized)
+      {
+        if (CryptAcquireContext (&provider, NULL, NULL, PROV_RSA_FULL,
+                                 CRYPT_VERIFY_CONTEXT))
+          crypt_initialized = 1;
+        else
+          crypt_initialized = -1;
+      }
+    if (crypt_initialized >= 0)
+      {
+        if (!CryptGenRandom (provider, length, buffer))
+          {
+            errno = EIO;
+            return -1;
+          }
+        return length;
+      }
+  }
+# endif
+  errno = ENOSYS;
+  return -1;
+#elif HAVE_GETRANDOM
+  return getrandom (buffer, length, flags);
+#else
+  static int randfd[2] = { -1, -1 };
+  bool devrandom = (flags & GRND_RANDOM) != 0;
+  int fd = randfd[devrandom];
+
+  if (fd < 0)
+    {
+      static char const randdevice[][MAX (sizeof NAME_OF_NONCE_DEVICE,
+                                          sizeof NAME_OF_RANDOM_DEVICE)]
+        = { NAME_OF_NONCE_DEVICE, NAME_OF_RANDOM_DEVICE };
+      int oflags = (O_RDONLY + O_CLOEXEC
+                    + (flags & GRND_NONBLOCK ? O_NONBLOCK : 0));
+      fd = open (randdevice[devrandom], oflags);
+      if (fd < 0)
+        {
+          if (errno == ENOENT || errno == ENOTDIR)
+            errno = ENOSYS;
+          return -1;
+        }
+      randfd[devrandom] = fd;
+    }
+
+  return read (fd, buffer, length);
+#endif
+}
index 9a232cc..3552157 100644 (file)
@@ -1,5 +1,5 @@
 /* Convenience header for conditional use of GNU <libintl.h>.
-   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2016 Free Software
+   Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBGETTEXT_H
 #define _LIBGETTEXT_H 1
 
-/* NLS can be disabled through the configure --disable-nls option.  */
-#if ENABLE_NLS
+/* NLS can be disabled through the configure --disable-nls option
+   or through "#define ENABLE NLS 0" before including this file.  */
+#if defined ENABLE_NLS && ENABLE_NLS
 
 /* Get declarations of GNU message catalog functions.  */
 # include <libintl.h>
@@ -183,8 +184,16 @@ npgettext_aux (const char *domain,
 
 #include <string.h>
 
-#if (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
-     /* || __STDC_VERSION__ >= 199901L */ )
+/* GNULIB_NO_VLA can be defined to disable use of VLAs even if supported.
+   This relates to the -Wvla and -Wvla-larger-than warnings, enabled in
+   the default GCC many warnings set.  This allows programs to disable use
+   of VLAs, which may be unintended, or may be awkward to support portably,
+   or may have security implications due to non-deterministic stack usage.  */
+
+#if (!defined GNULIB_NO_VLA \
+     && (((__GNUC__ >= 3 || __GNUG__ >= 2) && !defined __STRICT_ANSI__) \
+     /*  || (__STDC_VERSION__ == 199901L && !defined __HP_cc)
+         || (__STDC_VERSION__ >= 201112L && !defined __STDC_NO_VLA__) */ ))
 # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 1
 #else
 # define _LIBGETTEXT_HAVE_VARIABLE_SIZE_ARRAYS 0
diff --git a/lib/gettimeofday.c b/lib/gettimeofday.c
deleted file mode 100644 (file)
index 224ca6a..0000000
+++ /dev/null
@@ -1,154 +0,0 @@
-/* Provide gettimeofday for systems that don't have it or for which it's broken.
-
-   Copyright (C) 2001-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3, or (at your option)
-   any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
-
-/* written by Jim Meyering */
-
-#include <config.h>
-
-/* Specification.  */
-#include <sys/time.h>
-
-#include <time.h>
-
-#if HAVE_SYS_TIMEB_H
-# include <sys/timeb.h>
-#endif
-
-#if GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME
-
-/* Work around the bug in some systems whereby gettimeofday clobbers
-   the static buffer that localtime uses for its return value.  The
-   gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has
-   this problem.  The tzset replacement is necessary for at least
-   Solaris 2.5, 2.5.1, and 2.6.  */
-
-static struct tm tm_zero_buffer;
-static struct tm *localtime_buffer_addr = &tm_zero_buffer;
-
-# undef localtime
-extern struct tm *localtime (time_t const *);
-
-# undef gmtime
-extern struct tm *gmtime (time_t const *);
-
-/* This is a wrapper for localtime.  It is used only on systems for which
-   gettimeofday clobbers the static buffer used for localtime's result.
-
-   On the first call, record the address of the static buffer that
-   localtime uses for its result.  */
-
-struct tm *
-rpl_localtime (time_t const *timep)
-{
-  struct tm *tm = localtime (timep);
-
-  if (localtime_buffer_addr == &tm_zero_buffer)
-    localtime_buffer_addr = tm;
-
-  return tm;
-}
-
-/* Same as above, since gmtime and localtime use the same buffer.  */
-struct tm *
-rpl_gmtime (time_t const *timep)
-{
-  struct tm *tm = gmtime (timep);
-
-  if (localtime_buffer_addr == &tm_zero_buffer)
-    localtime_buffer_addr = tm;
-
-  return tm;
-}
-
-#endif /* GETTIMEOFDAY_CLOBBERS_LOCALTIME || TZSET_CLOBBERS_LOCALTIME */
-
-#if TZSET_CLOBBERS_LOCALTIME
-
-# undef tzset
-extern void tzset (void);
-
-/* This is a wrapper for tzset, for systems on which tzset may clobber
-   the static buffer used for localtime's result.  */
-void
-rpl_tzset (void)
-{
-  /* Save and restore the contents of the buffer used for localtime's
-     result around the call to tzset.  */
-  struct tm save = *localtime_buffer_addr;
-  tzset ();
-  *localtime_buffer_addr = save;
-}
-#endif
-
-/* This is a wrapper for gettimeofday.  It is used only on systems
-   that lack this function, or whose implementation of this function
-   causes problems.  */
-
-int
-gettimeofday (struct timeval *restrict tv, void *restrict tz)
-{
-#undef gettimeofday
-#if HAVE_GETTIMEOFDAY
-# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
-  /* Save and restore the contents of the buffer used for localtime's
-     result around the call to gettimeofday.  */
-  struct tm save = *localtime_buffer_addr;
-# endif
-
-# if defined timeval /* 'struct timeval' overridden by gnulib?  */
-#  undef timeval
-  struct timeval otv;
-  int result = gettimeofday (&otv, (struct timezone *) tz);
-  if (result == 0)
-    {
-      tv->tv_sec = otv.tv_sec;
-      tv->tv_usec = otv.tv_usec;
-    }
-# else
-  int result = gettimeofday (tv, (struct timezone *) tz);
-# endif
-
-# if GETTIMEOFDAY_CLOBBERS_LOCALTIME
-  *localtime_buffer_addr = save;
-# endif
-
-  return result;
-
-#else
-
-# if HAVE__FTIME
-
-  struct _timeb timebuf;
-  _ftime (&timebuf);
-  tv->tv_sec = timebuf.time;
-  tv->tv_usec = timebuf.millitm * 1000;
-
-# else
-
-#  if !defined OK_TO_USE_1S_CLOCK
-#   error "Only 1-second nominal clock resolution found.  Is that intended?" \
-          "If so, compile with the -DOK_TO_USE_1S_CLOCK option."
-#  endif
-  tv->tv_sec = time (NULL);
-  tv->tv_usec = 0;
-
-# endif
-
-  return 0;
-
-#endif
-}
similarity index 63%
rename from lib/gl_anyhash_list1.h
rename to lib/gl_anyhash1.h
index de25706..3253673 100644 (file)
@@ -1,5 +1,5 @@
-/* Sequential list data type implemented by a hash table with another list.
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+/* Hash table for sequential list, set, and map data type.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Common code of
-   gl_linkedhash_list.c, gl_avltreehash_list.c, gl_rbtreehash_list.c.  */
+   gl_linkedhash_list.c, gl_avltreehash_list.c, gl_rbtreehash_list.c,
+   gl_linkedhash_set.c, gl_hash_set.c,
+   gl_linkedhash_map.c, gl_hash_map.c.  */
 
 /* Hash table entry.  */
 struct gl_hash_entry
 {
   struct gl_hash_entry *hash_next;  /* chain of entries in same bucket */
-  size_t hashcode;                  /* cache of values' common hash code */
+  size_t hashcode;                  /* cache of the hash code of
+                                       - the key (for map data type) or
+                                       - the value (for list, set data types) */
 };
 typedef struct gl_hash_entry * gl_hash_entry_t;
diff --git a/lib/gl_anyhash2.h b/lib/gl_anyhash2.h
new file mode 100644 (file)
index 0000000..d8b5fb0
--- /dev/null
@@ -0,0 +1,82 @@
+/* Hash table for sequential list, set, and map data type.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Common code of
+   gl_linkedhash_list.c, gl_avltreehash_list.c, gl_rbtreehash_list.c,
+   gl_linkedhash_set.c, gl_hash_set.c,
+   gl_linkedhash_map.c, gl_hash_map.c.  */
+
+#include "gl_anyhash_primes.h"
+
+/* Resizes the hash table with a new estimated size.  */
+static void
+hash_resize (CONTAINER_T container, size_t estimate)
+{
+  size_t new_size = next_prime (estimate);
+
+  if (new_size > container->table_size)
+    {
+      gl_hash_entry_t *old_table = container->table;
+      /* Allocate the new table.  */
+      gl_hash_entry_t *new_table;
+      size_t i;
+
+      if (size_overflow_p (xtimes (new_size, sizeof (gl_hash_entry_t))))
+        goto fail;
+      new_table =
+        (gl_hash_entry_t *) calloc (new_size, sizeof (gl_hash_entry_t));
+      if (new_table == NULL)
+        goto fail;
+
+      /* Iterate through the entries of the old table.  */
+      for (i = container->table_size; i > 0; )
+        {
+          gl_hash_entry_t node = old_table[--i];
+
+          while (node != NULL)
+            {
+              gl_hash_entry_t next = node->hash_next;
+              /* Add the entry to the new table.  */
+              size_t bucket = node->hashcode % new_size;
+              node->hash_next = new_table[bucket];
+              new_table[bucket] = node;
+
+              node = next;
+            }
+        }
+
+      container->table = new_table;
+      container->table_size = new_size;
+      free (old_table);
+    }
+  return;
+
+ fail:
+  /* Just continue without resizing the table.  */
+  return;
+}
+
+/* Resizes the hash table if needed, after CONTAINER_COUNT (container) was
+   incremented.  */
+static void
+hash_resize_after_add (CONTAINER_T container)
+{
+  size_t count = CONTAINER_COUNT (container);
+  size_t estimate = xsum (count, count / 2); /* 1.5 * count */
+  if (estimate > container->table_size)
+    hash_resize (container, estimate);
+}
similarity index 74%
rename from lib/gl_anyhash_list2.h
rename to lib/gl_anyhash_primes.h
index cace8f8..b723e64 100644 (file)
@@ -1,5 +1,5 @@
-/* Sequential list data type implemented by a hash table with another list.
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+/* Table of primes, for use by hash tables.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Common code of
-   gl_linkedhash_list.c, gl_avltreehash_list.c, gl_rbtreehash_list.c.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Array of primes, approximately in steps of factor 1.2.
    This table was computed by executing the Common Lisp expression
@@ -77,7 +74,7 @@ static const size_t primes[] =
     SIZE_MAX /* sentinel, to ensure the search terminates */
   };
 
-/* Return a suitable prime >= ESTIMATE.  */
+/* Returns a suitable prime >= ESTIMATE.  */
 static size_t
 next_prime (size_t estimate)
 {
@@ -88,51 +85,3 @@ next_prime (size_t estimate)
       return primes[i];
   return SIZE_MAX; /* not a prime, but better than nothing */
 }
-
-/* Resize the hash table with a new estimated size.  */
-static void
-hash_resize (gl_list_t list, size_t estimate)
-{
-  size_t new_size = next_prime (estimate);
-
-  if (new_size > list->table_size)
-    {
-      gl_hash_entry_t *old_table = list->table;
-      /* Allocate the new table.  */
-      gl_hash_entry_t *new_table;
-      size_t i;
-
-      if (size_overflow_p (xtimes (new_size, sizeof (gl_hash_entry_t))))
-        goto fail;
-      new_table =
-        (gl_hash_entry_t *) calloc (new_size, sizeof (gl_hash_entry_t));
-      if (new_table == NULL)
-        goto fail;
-
-      /* Iterate through the entries of the old table.  */
-      for (i = list->table_size; i > 0; )
-        {
-          gl_hash_entry_t node = old_table[--i];
-
-          while (node != NULL)
-            {
-              gl_hash_entry_t next = node->hash_next;
-              /* Add the entry to the new table.  */
-              size_t bucket = node->hashcode % new_size;
-              node->hash_next = new_table[bucket];
-              new_table[bucket] = node;
-
-              node = next;
-            }
-        }
-
-      list->table = new_table;
-      list->table_size = new_size;
-      free (old_table);
-    }
-  return;
-
- fail:
-  /* Just continue without resizing the table.  */
-  return;
-}
index dcb66ec..caaaa4a 100644 (file)
@@ -1,5 +1,5 @@
 /* Sequential list data type implemented by a linked list.
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Common code of gl_linked_list.c and gl_linkedhash_list.c.  */
 
index a1037ed..6af3f76 100644 (file)
@@ -1,5 +1,5 @@
 /* Sequential list data type implemented by a linked list.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Common code of gl_linked_list.c and gl_linkedhash_list.c.  */
 
@@ -29,7 +29,7 @@
    and we use 'volatile' assignments to prevent the compiler from reordering
    such assignments.  */
 #ifdef SIGNAL_SAFE_LIST
-# define ASYNCSAFE(type) *(volatile type *)&
+# define ASYNCSAFE(type) *(type volatile *)&
 #else
 # define ASYNCSAFE(type)
 #endif
@@ -76,11 +76,11 @@ gl_linked_nx_create_empty (gl_list_implementation_t implementation,
 
 static gl_list_t
 gl_linked_nx_create (gl_list_implementation_t implementation,
-                  gl_listelement_equals_fn equals_fn,
-                  gl_listelement_hashcode_fn hashcode_fn,
-                  gl_listelement_dispose_fn dispose_fn,
-                  bool allow_duplicates,
-                  size_t count, const void **contents)
+                     gl_listelement_equals_fn equals_fn,
+                     gl_listelement_hashcode_fn hashcode_fn,
+                     gl_listelement_dispose_fn dispose_fn,
+                     bool allow_duplicates,
+                     size_t count, const void **contents)
 {
   struct gl_list_impl *list =
     (struct gl_list_impl *) malloc (sizeof (struct gl_list_impl));
@@ -170,13 +170,15 @@ gl_linked_size (gl_list_t list)
 }
 
 static const void * _GL_ATTRIBUTE_PURE
-gl_linked_node_value (gl_list_t list, gl_list_node_t node)
+gl_linked_node_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+                      gl_list_node_t node)
 {
   return node->value;
 }
 
 static int
-gl_linked_node_nx_set_value (gl_list_t list, gl_list_node_t node,
+gl_linked_node_nx_set_value (gl_list_t list _GL_ATTRIBUTE_MAYBE_UNUSED,
+                             gl_list_node_t node,
                              const void *elt)
 {
 #if WITH_HASHTABLE
@@ -227,6 +229,24 @@ gl_linked_previous_node (gl_list_t list, gl_list_node_t node)
   return (node->prev != &list->root ? node->prev : NULL);
 }
 
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_linked_first_node (gl_list_t list)
+{
+  if (list->count > 0)
+    return list->root.next;
+  else
+    return NULL;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_linked_last_node (gl_list_t list)
+{
+  if (list->count > 0)
+    return list->root.prev;
+  else
+    return NULL;
+}
+
 static const void * _GL_ATTRIBUTE_PURE
 gl_linked_get_at (gl_list_t list, size_t position)
 {
@@ -914,7 +934,7 @@ gl_linked_list_free (gl_list_t list)
 
 /* --------------------- gl_list_iterator_t Data Type --------------------- */
 
-static gl_list_iterator_t
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
 gl_linked_iterator (gl_list_t list)
 {
   gl_list_iterator_t result;
@@ -932,7 +952,7 @@ gl_linked_iterator (gl_list_t list)
   return result;
 }
 
-static gl_list_iterator_t
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
 gl_linked_iterator_from_to (gl_list_t list,
                             size_t start_index, size_t end_index)
 {
@@ -1021,7 +1041,7 @@ gl_linked_iterator_next (gl_list_iterator_t *iterator,
 }
 
 static void
-gl_linked_iterator_free (gl_list_iterator_t *iterator)
+gl_linked_iterator_free (gl_list_iterator_t *iterator _GL_ATTRIBUTE_MAYBE_UNUSED)
 {
 }
 
index 127f4e3..569e0f9 100644 (file)
@@ -1,5 +1,5 @@
 /* Ordered set data type implemented by a binary tree.
-   Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Common code of gl_avltree_oset.c and gl_rbtree_oset.c.  */
 
@@ -47,12 +47,50 @@ gl_tree_nx_create_empty (gl_oset_implementation_t implementation,
   return set;
 }
 
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
 gl_tree_size (gl_oset_t set)
 {
   return set->count;
 }
 
+/* Returns the next node in the tree, or NULL if there is none.  */
+static inline gl_oset_node_t _GL_ATTRIBUTE_PURE
+gl_tree_next_node (gl_oset_node_t node)
+{
+  if (node->right != NULL)
+    {
+      node = node->right;
+      while (node->left != NULL)
+        node = node->left;
+    }
+  else
+    {
+      while (node->parent != NULL && node->parent->right == node)
+        node = node->parent;
+      node = node->parent;
+    }
+  return node;
+}
+
+/* Returns the previous node in the tree, or NULL if there is none.  */
+static inline gl_oset_node_t _GL_ATTRIBUTE_PURE
+gl_tree_prev_node (gl_oset_node_t node)
+{
+  if (node->left != NULL)
+    {
+      node = node->left;
+      while (node->right != NULL)
+        node = node->right;
+    }
+  else
+    {
+      while (node->parent != NULL && node->parent->left == node)
+        node = node->parent;
+      node = node->parent;
+    }
+  return node;
+}
+
 static bool
 gl_tree_search (gl_oset_t set, const void *elt)
 {
@@ -91,7 +129,7 @@ gl_tree_search_atleast (gl_oset_t set,
         node = node->right;
       else
         {
-          /* We have an element >= VALUE.  But we need the leftmost such
+          /* We have an element >= THRESHOLD.  But we need the leftmost such
              element.  */
           gl_oset_node_t found = node;
           node = node->left;
@@ -194,6 +232,79 @@ gl_tree_remove (gl_oset_t set, const void *elt)
     return false;
 }
 
+static int
+gl_tree_update (gl_oset_t set, const void *elt,
+                void (*action) (const void * /*elt*/, void * /*action_data*/),
+                void *action_data)
+{
+  /* Like gl_tree_remove, action (...), gl_tree_nx_add, except that we don't
+     actually remove ELT.  */
+  /* Remember the old node.  Don't free it.  */
+  gl_oset_node_t old_node = gl_tree_search_node (set, elt);
+  /* Invoke ACTION.  */
+  action (elt, action_data);
+  /* Determine where to put the node now.  */
+  if (old_node != NULL)
+    {
+      if (set->count > 1)
+        {
+          gl_setelement_compar_fn compar = set->base.compar_fn;
+
+          gl_oset_node_t prev_node = gl_tree_prev_node (old_node);
+          gl_oset_node_t next_node = gl_tree_next_node (old_node);
+          if (!(compar != NULL
+                ? (prev_node == NULL || compar (prev_node->value, elt) < 0)
+                  && (next_node == NULL || compar (next_node->value, elt) > 0)
+                : (prev_node == NULL || prev_node->value < elt)
+                  && (next_node == NULL || next_node->value > elt)))
+            {
+              /* old_node needs to move in the tree.  */
+              gl_oset_node_t node;
+
+              /* Remove the node from the tree.  Don't free it.  */
+              gl_tree_remove_node_no_free (set, old_node);
+
+              node = set->root;
+
+              for (;;)
+                {
+                  int cmp = (compar != NULL
+                             ? compar (node->value, elt)
+                             : (node->value > elt ? 1 :
+                                node->value < elt ? -1 : 0));
+
+                  if (cmp < 0)
+                    {
+                      if (node->right == NULL)
+                        {
+                          gl_tree_add_node_after (set, node, old_node);
+                          return true;
+                        }
+                      node = node->right;
+                    }
+                  else if (cmp > 0)
+                    {
+                      if (node->left == NULL)
+                        {
+                          gl_tree_add_node_before (set, node, old_node);
+                          return true;
+                        }
+                      node = node->left;
+                    }
+                  else /* cmp == 0 */
+                    {
+                      /* Two elements are the same.  */
+                      NODE_PAYLOAD_DISPOSE (set, old_node)
+                      free (old_node);
+                      return -1;
+                    }
+                }
+            }
+        }
+    }
+  return 0;
+}
+
 static void
 gl_tree_oset_free (gl_oset_t set)
 {
@@ -239,7 +350,7 @@ gl_tree_oset_free (gl_oset_t set)
 
 /* --------------------- gl_oset_iterator_t Data Type --------------------- */
 
-static gl_oset_iterator_t
+static gl_oset_iterator_t _GL_ATTRIBUTE_PURE
 gl_tree_iterator (gl_oset_t set)
 {
   gl_oset_iterator_t result;
@@ -264,6 +375,52 @@ gl_tree_iterator (gl_oset_t set)
   return result;
 }
 
+static gl_oset_iterator_t
+gl_tree_iterator_atleast (gl_oset_t set,
+                          gl_setelement_threshold_fn threshold_fn,
+                          const void *threshold)
+{
+  gl_oset_iterator_t result;
+  gl_oset_node_t node;
+
+  result.vtable = set->base.vtable;
+  result.set = set;
+  /* End point is past the rightmost node.  */
+  result.q = NULL;
+#if defined GCC_LINT || defined lint
+  result.i = 0;
+  result.j = 0;
+  result.count = 0;
+#endif
+
+  for (node = set->root; node != NULL; )
+    {
+      if (! threshold_fn (node->value, threshold))
+        node = node->right;
+      else
+        {
+          /* We have an element >= THRESHOLD.  But we need the leftmost such
+             element.  */
+          gl_oset_node_t found = node;
+          node = node->left;
+          for (; node != NULL; )
+            {
+              if (! threshold_fn (node->value, threshold))
+                node = node->right;
+              else
+                {
+                  found = node;
+                  node = node->left;
+                }
+            }
+          result.p = found;
+          return result;
+        }
+    }
+  result.p = NULL;
+  return result;
+}
+
 static bool
 gl_tree_iterator_next (gl_oset_iterator_t *iterator, const void **eltp)
 {
@@ -272,18 +429,7 @@ gl_tree_iterator_next (gl_oset_iterator_t *iterator, const void **eltp)
       gl_oset_node_t node = (gl_oset_node_t) iterator->p;
       *eltp = node->value;
       /* Advance to the next node.  */
-      if (node->right != NULL)
-        {
-          node = node->right;
-          while (node->left != NULL)
-            node = node->left;
-        }
-      else
-        {
-          while (node->parent != NULL && node->parent->right == node)
-            node = node->parent;
-          node = node->parent;
-        }
+      node = gl_tree_next_node (node);
       iterator->p = node;
       return true;
     }
@@ -292,6 +438,6 @@ gl_tree_iterator_next (gl_oset_iterator_t *iterator, const void **eltp)
 }
 
 static void
-gl_tree_iterator_free (gl_oset_iterator_t *iterator)
+gl_tree_iterator_free (gl_oset_iterator_t *iterator _GL_ATTRIBUTE_MAYBE_UNUSED)
 {
 }
diff --git a/lib/gl_avltree_ordered.h b/lib/gl_avltree_ordered.h
new file mode 100644 (file)
index 0000000..87c1749
--- /dev/null
@@ -0,0 +1,571 @@
+/* Ordered {set,map} data type implemented by a binary tree.
+   Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* An AVL tree is a binary tree where
+   1. The height of each node is calculated as
+        heightof(node) = 1 + max (heightof(node.left), heightof(node.right)).
+   2. The heights of the subtrees of each node differ by at most 1:
+        | heightof(right) - heightof(left) | <= 1.
+   3. The index of the elements in the node.left subtree are smaller than
+      the index of node.
+      The index of the elements in the node.right subtree are larger than
+      the index of node.
+ */
+
+/* Tree node implementation, valid for this file only.  */
+struct NODE_IMPL
+{
+  struct NODE_IMPL *left;   /* left branch, or NULL */
+  struct NODE_IMPL *right;  /* right branch, or NULL */
+  /* Parent pointer, or NULL. The parent pointer is not needed for most
+     operations.  It is needed so that a NODE_T can be returned without
+     memory allocation, on which the functions <container>_remove_node,
+     <container>_add_before, <container>_add_after can be implemented.  */
+  struct NODE_IMPL *parent;
+  int balance;                      /* heightof(right) - heightof(left),
+                                       always = -1 or 0 or 1 */
+  NODE_PAYLOAD_FIELDS
+};
+typedef struct NODE_IMPL * NODE_T;
+
+/* Concrete CONTAINER_IMPL type, valid for this file only.  */
+struct CONTAINER_IMPL
+{
+  struct CONTAINER_IMPL_BASE base;
+  struct NODE_IMPL *root;           /* root node or NULL */
+  size_t count;                     /* number of nodes */
+};
+
+/* An AVL tree of height h has at least F_(h+2) - 1 [Fibonacci number] and at
+   most 2^h - 1 elements.  So, h <= 84 (because a tree of height h >= 85 would
+   have at least F_87 - 1 elements, and because even on 64-bit machines,
+     sizeof (NODE_IMPL) * (F_87 - 1) > 2^64
+   this would exceed the address space of the machine.  */
+#define MAXHEIGHT 83
+
+/* Ensures the tree is balanced, after an insertion or deletion operation.
+   The height of NODE is incremented by HEIGHT_DIFF (1 or -1).
+   PARENT = NODE->parent.  (NODE can also be NULL.  But PARENT is non-NULL.)
+   Rotation operations are performed starting at PARENT (not NODE itself!).  */
+static void
+rebalance (CONTAINER_T container,
+           NODE_T node, int height_diff, NODE_T parent)
+{
+  for (;;)
+    {
+      NODE_T child;
+      int previous_balance;
+      int balance_diff;
+      NODE_T nodeleft;
+      NODE_T noderight;
+
+      child = node;
+      node = parent;
+
+      previous_balance = node->balance;
+
+      /* The balance of NODE is incremented by BALANCE_DIFF: +1 if the right
+         branch's height has increased by 1 or the left branch's height has
+         decreased by 1, -1 if the right branch's height has decreased by 1 or
+         the left branch's height has increased by 1, 0 if no height change.  */
+      if (node->left != NULL || node->right != NULL)
+        balance_diff = (child == node->right ? height_diff : -height_diff);
+      else
+        /* Special case where above formula doesn't work, because the caller
+           didn't tell whether node's left or right branch shrunk from height 1
+           to NULL.  */
+        balance_diff = - previous_balance;
+
+      node->balance += balance_diff;
+      if (balance_diff == previous_balance)
+        {
+          /* node->balance is outside the range [-1,1].  Must rotate.  */
+          NODE_T *nodep;
+
+          if (node->parent == NULL)
+            /* node == container->root */
+            nodep = &container->root;
+          else if (node->parent->left == node)
+            nodep = &node->parent->left;
+          else if (node->parent->right == node)
+            nodep = &node->parent->right;
+          else
+            abort ();
+
+          nodeleft = node->left;
+          noderight = node->right;
+
+          if (balance_diff < 0)
+            {
+              /* node->balance = -2.  The subtree is heavier on the left side.
+                 Rotate from left to right:
+
+                                  *
+                                /   \
+                             h+2      h
+               */
+              NODE_T nodeleftright = nodeleft->right;
+              if (nodeleft->balance <= 0)
+                {
+                  /*
+                              *                    h+2|h+3
+                            /   \                  /    \
+                         h+2      h      -->      /   h+1|h+2
+                         / \                      |    /    \
+                       h+1 h|h+1                 h+1  h|h+1  h
+                   */
+                  node->left = nodeleftright;
+                  nodeleft->right = node;
+
+                  nodeleft->parent = node->parent;
+                  node->parent = nodeleft;
+                  if (nodeleftright != NULL)
+                    nodeleftright->parent = node;
+
+                  nodeleft->balance += 1;
+                  node->balance = - nodeleft->balance;
+
+                  *nodep = nodeleft;
+                  height_diff = (height_diff < 0
+                                 ? /* noderight's height had been decremented from
+                                      h+1 to h.  The subtree's height changes from
+                                      h+3 to h+2|h+3.  */
+                                   nodeleft->balance - 1
+                                 : /* nodeleft's height had been incremented from
+                                      h+1 to h+2.  The subtree's height changes from
+                                      h+2 to h+2|h+3.  */
+                                   nodeleft->balance);
+                }
+              else
+                {
+                  /*
+                            *                     h+2
+                          /   \                 /     \
+                       h+2      h      -->    h+1     h+1
+                       / \                    / \     / \
+                      h  h+1                 h   L   R   h
+                         / \
+                        L   R
+
+                   */
+                  NODE_T L = nodeleft->right = nodeleftright->left;
+                  NODE_T R = node->left = nodeleftright->right;
+                  nodeleftright->left = nodeleft;
+                  nodeleftright->right = node;
+
+                  nodeleftright->parent = node->parent;
+                  if (L != NULL)
+                    L->parent = nodeleft;
+                  if (R != NULL)
+                    R->parent = node;
+                  nodeleft->parent = nodeleftright;
+                  node->parent = nodeleftright;
+
+                  nodeleft->balance = (nodeleftright->balance > 0 ? -1 : 0);
+                  node->balance = (nodeleftright->balance < 0 ? 1 : 0);
+                  nodeleftright->balance = 0;
+
+                  *nodep = nodeleftright;
+                  height_diff = (height_diff < 0
+                                 ? /* noderight's height had been decremented from
+                                      h+1 to h.  The subtree's height changes from
+                                      h+3 to h+2.  */
+                                   -1
+                                 : /* nodeleft's height had been incremented from
+                                      h+1 to h+2.  The subtree's height changes from
+                                      h+2 to h+2.  */
+                                   0);
+                }
+            }
+          else
+            {
+              /* node->balance = 2.  The subtree is heavier on the right side.
+                 Rotate from right to left:
+
+                                  *
+                                /   \
+                              h      h+2
+               */
+              NODE_T noderightleft = noderight->left;
+              if (noderight->balance >= 0)
+                {
+                  /*
+                              *                    h+2|h+3
+                            /   \                   /    \
+                          h      h+2     -->    h+1|h+2   \
+                                 / \            /    \    |
+                             h|h+1 h+1         h   h|h+1 h+1
+                   */
+                  node->right = noderightleft;
+                  noderight->left = node;
+
+                  noderight->parent = node->parent;
+                  node->parent = noderight;
+                  if (noderightleft != NULL)
+                    noderightleft->parent = node;
+
+                  noderight->balance -= 1;
+                  node->balance = - noderight->balance;
+
+                  *nodep = noderight;
+                  height_diff = (height_diff < 0
+                                 ? /* nodeleft's height had been decremented from
+                                      h+1 to h.  The subtree's height changes from
+                                      h+3 to h+2|h+3.  */
+                                   - noderight->balance - 1
+                                 : /* noderight's height had been incremented from
+                                      h+1 to h+2.  The subtree's height changes from
+                                      h+2 to h+2|h+3.  */
+                                   - noderight->balance);
+                }
+              else
+                {
+                  /*
+                            *                    h+2
+                          /   \                /     \
+                        h      h+2    -->    h+1     h+1
+                               / \           / \     / \
+                             h+1  h         h   L   R   h
+                             / \
+                            L   R
+
+                   */
+                  NODE_T L = node->right = noderightleft->left;
+                  NODE_T R = noderight->left = noderightleft->right;
+                  noderightleft->left = node;
+                  noderightleft->right = noderight;
+
+                  noderightleft->parent = node->parent;
+                  if (L != NULL)
+                    L->parent = node;
+                  if (R != NULL)
+                    R->parent = noderight;
+                  node->parent = noderightleft;
+                  noderight->parent = noderightleft;
+
+                  node->balance = (noderightleft->balance > 0 ? -1 : 0);
+                  noderight->balance = (noderightleft->balance < 0 ? 1 : 0);
+                  noderightleft->balance = 0;
+
+                  *nodep = noderightleft;
+                  height_diff = (height_diff < 0
+                                 ? /* nodeleft's height had been decremented from
+                                      h+1 to h.  The subtree's height changes from
+                                      h+3 to h+2.  */
+                                   -1
+                                 : /* noderight's height had been incremented from
+                                      h+1 to h+2.  The subtree's height changes from
+                                      h+2 to h+2.  */
+                                   0);
+                }
+            }
+          node = *nodep;
+        }
+      else
+        {
+          /* No rotation needed.  Only propagation of the height change to the
+             next higher level.  */
+          if (height_diff < 0)
+            height_diff = (previous_balance == 0 ? 0 : -1);
+          else
+            height_diff = (node->balance == 0 ? 0 : 1);
+        }
+
+      if (height_diff == 0)
+        break;
+
+      parent = node->parent;
+      if (parent == NULL)
+        break;
+    }
+}
+
+static NODE_T
+gl_tree_nx_add_first (CONTAINER_T container, NODE_PAYLOAD_PARAMS)
+{
+  /* Create new node.  */
+  NODE_T new_node =
+    (struct NODE_IMPL *) malloc (sizeof (struct NODE_IMPL));
+
+  if (new_node == NULL)
+    return NULL;
+
+  new_node->left = NULL;
+  new_node->right = NULL;
+  new_node->balance = 0;
+  NODE_PAYLOAD_ASSIGN(new_node)
+
+  /* Add it to the tree.  */
+  if (container->root == NULL)
+    {
+      container->root = new_node;
+      new_node->parent = NULL;
+    }
+  else
+    {
+      NODE_T node;
+
+      for (node = container->root; node->left != NULL; )
+        node = node->left;
+
+      node->left = new_node;
+      new_node->parent = node;
+      node->balance--;
+
+      /* Rebalance.  */
+      if (node->right == NULL && node->parent != NULL)
+        rebalance (container, node, 1, node->parent);
+    }
+
+  container->count++;
+  return new_node;
+}
+
+/* Adds the already allocated NEW_NODE to the tree, right before NODE.  */
+static void
+gl_tree_add_node_before (CONTAINER_T container, NODE_T node, NODE_T new_node)
+{
+  bool height_inc;
+
+  new_node->left = NULL;
+  new_node->right = NULL;
+  new_node->balance = 0;
+
+  /* Add it to the tree.  */
+  if (node->left == NULL)
+    {
+      node->left = new_node;
+      node->balance--;
+      height_inc = (node->right == NULL);
+    }
+  else
+    {
+      for (node = node->left; node->right != NULL; )
+        node = node->right;
+      node->right = new_node;
+      node->balance++;
+      height_inc = (node->left == NULL);
+    }
+  new_node->parent = node;
+
+  /* Rebalance.  */
+  if (height_inc && node->parent != NULL)
+    rebalance (container, node, 1, node->parent);
+
+  container->count++;
+}
+
+static NODE_T
+gl_tree_nx_add_before (CONTAINER_T container, NODE_T node, NODE_PAYLOAD_PARAMS)
+{
+  /* Create new node.  */
+  NODE_T new_node =
+    (struct NODE_IMPL *) malloc (sizeof (struct NODE_IMPL));
+
+  if (new_node == NULL)
+    return NULL;
+
+  NODE_PAYLOAD_ASSIGN(new_node)
+
+  gl_tree_add_node_before (container, node, new_node);
+  return new_node;
+}
+
+/* Adds the already allocated NEW_NODE to the tree, right after NODE.  */
+static void
+gl_tree_add_node_after (CONTAINER_T container, NODE_T node, NODE_T new_node)
+{
+  bool height_inc;
+
+  new_node->left = NULL;
+  new_node->right = NULL;
+  new_node->balance = 0;
+
+  /* Add it to the tree.  */
+  if (node->right == NULL)
+    {
+      node->right = new_node;
+      node->balance++;
+      height_inc = (node->left == NULL);
+    }
+  else
+    {
+      for (node = node->right; node->left != NULL; )
+        node = node->left;
+      node->left = new_node;
+      node->balance--;
+      height_inc = (node->right == NULL);
+    }
+  new_node->parent = node;
+
+  /* Rebalance.  */
+  if (height_inc && node->parent != NULL)
+    rebalance (container, node, 1, node->parent);
+
+  container->count++;
+}
+
+static NODE_T
+gl_tree_nx_add_after (CONTAINER_T container, NODE_T node, NODE_PAYLOAD_PARAMS)
+{
+  /* Create new node.  */
+  NODE_T new_node =
+    (struct NODE_IMPL *) malloc (sizeof (struct NODE_IMPL));
+
+  if (new_node == NULL)
+    return NULL;
+
+  NODE_PAYLOAD_ASSIGN(new_node)
+
+  gl_tree_add_node_after (container, node, new_node);
+  return new_node;
+}
+
+static void
+gl_tree_remove_node_no_free (CONTAINER_T container, NODE_T node)
+{
+  NODE_T parent = node->parent;
+
+  if (node->left == NULL)
+    {
+      /* Replace node with node->right.  */
+      NODE_T child = node->right;
+
+      if (child != NULL)
+        child->parent = parent;
+      if (parent == NULL)
+        container->root = child;
+      else
+        {
+          if (parent->left == node)
+            parent->left = child;
+          else /* parent->right == node */
+            parent->right = child;
+
+          rebalance (container, child, -1, parent);
+        }
+    }
+  else if (node->right == NULL)
+    {
+      /* It is not absolutely necessary to treat this case.  But the more
+         general case below is more complicated, hence slower.  */
+      /* Replace node with node->left.  */
+      NODE_T child = node->left;
+
+      child->parent = parent;
+      if (parent == NULL)
+        container->root = child;
+      else
+        {
+          if (parent->left == node)
+            parent->left = child;
+          else /* parent->right == node */
+            parent->right = child;
+
+          rebalance (container, child, -1, parent);
+        }
+    }
+  else
+    {
+      /* Replace node with the rightmost element of the node->left subtree.  */
+      NODE_T subst;
+      NODE_T subst_parent;
+      NODE_T child;
+
+      for (subst = node->left; subst->right != NULL; )
+        subst = subst->right;
+
+      subst_parent = subst->parent;
+
+      child = subst->left;
+
+      /* The case subst_parent == node is special:  If we do nothing special,
+         we get confusion about node->left, subst->left and child->parent.
+           subst_parent == node
+           <==> The 'for' loop above terminated immediately.
+           <==> subst == subst_parent->left
+                [otherwise subst == subst_parent->right]
+         In this case, we would need to first set
+           child->parent = node; node->left = child;
+         and later - when we copy subst into node's position - again
+           child->parent = subst; subst->left = child;
+         Altogether a no-op.  */
+      if (subst_parent != node)
+        {
+          if (child != NULL)
+            child->parent = subst_parent;
+          subst_parent->right = child;
+        }
+
+      /* Copy subst into node's position.
+         (This is safer than to copy subst's value into node, keep node in
+         place, and free subst.)  */
+      if (subst_parent != node)
+        {
+          subst->left = node->left;
+          subst->left->parent = subst;
+        }
+      subst->right = node->right;
+      subst->right->parent = subst;
+      subst->balance = node->balance;
+      subst->parent = parent;
+      if (parent == NULL)
+        container->root = subst;
+      else if (parent->left == node)
+        parent->left = subst;
+      else /* parent->right == node */
+        parent->right = subst;
+
+      /* Rebalancing starts at child's parent, that is subst_parent -
+         except when subst_parent == node.  In this case, we need to use
+         its replacement, subst.  */
+      rebalance (container, child, -1, subst_parent != node ? subst_parent : subst);
+    }
+
+  container->count--;
+}
+
+static bool
+gl_tree_remove_node (CONTAINER_T container, NODE_T node)
+{
+  gl_tree_remove_node_no_free (container, node);
+  NODE_PAYLOAD_DISPOSE (container, node)
+  free (node);
+  return true;
+}
+
+/* For debugging.  */
+static unsigned int
+check_invariants (NODE_T node, NODE_T parent, size_t *counterp)
+{
+  unsigned int left_height =
+    (node->left != NULL ? check_invariants (node->left, node, counterp) : 0);
+  unsigned int right_height =
+    (node->right != NULL ? check_invariants (node->right, node, counterp) : 0);
+  int balance = (int)right_height - (int)left_height;
+
+  if (!(node->parent == parent))
+    abort ();
+  if (!(balance >= -1 && balance <= 1))
+    abort ();
+  if (!(node->balance == balance))
+    abort ();
+
+  (*counterp)++;
+
+  return 1 + (left_height > right_height ? left_height : right_height);
+}
index ac7183b..eca5eaa 100644 (file)
@@ -1,5 +1,5 @@
 /* Ordered set data type implemented by a binary tree.
-   Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 
 #include <stdlib.h>
 
-/* An AVL tree is a binary tree where
-   1. The height of each node is calculated as
-        heightof(node) = 1 + max (heightof(node.left), heightof(node.right)).
-   2. The heights of the subtrees of each node differ by at most 1:
-        | heightof(right) - heightof(left) | <= 1.
-   3. The index of the elements in the node.left subtree are smaller than
-      the index of node.
-      The index of the elements in the node.right subtree are larger than
-      the index of node.
- */
-
 /* -------------------------- gl_oset_t Data Type -------------------------- */
 
-/* Tree node implementation, valid for this file only.  */
-struct gl_oset_node_impl
-{
-  struct gl_oset_node_impl *left;   /* left branch, or NULL */
-  struct gl_oset_node_impl *right;  /* right branch, or NULL */
-  /* Parent pointer, or NULL. The parent pointer is not needed for most
-     operations.  It is needed so that a gl_oset_node_t can be returned
-     without memory allocation, on which the functions gl_oset_remove_node,
-     gl_oset_add_before, gl_oset_add_after can be implemented.  */
-  struct gl_oset_node_impl *parent;
-  int balance;                      /* heightof(right) - heightof(left),
-                                       always = -1 or 0 or 1 */
+/* Parameterization of gl_avltree_ordered.h.  */
+#define CONTAINER_T gl_oset_t
+#define CONTAINER_IMPL gl_oset_impl
+#define CONTAINER_IMPL_BASE gl_oset_impl_base
+#define NODE_IMPL gl_oset_node_impl
+#define NODE_T gl_oset_node_t
+#define NODE_PAYLOAD_FIELDS \
   const void *value;
-};
-typedef struct gl_oset_node_impl * gl_oset_node_t;
-
-/* Concrete gl_oset_impl type, valid for this file only.  */
-struct gl_oset_impl
-{
-  struct gl_oset_impl_base base;
-  struct gl_oset_node_impl *root;   /* root node or NULL */
-  size_t count;                     /* number of nodes */
-};
-
-/* An AVL tree of height h has at least F_(h+2) [Fibonacci number] and at most
-   2^h - 1 elements.  So, h <= 84 (because a tree of height h >= 85 would have
-   at least F_87 elements, and because even on 64-bit machines,
-     sizeof (gl_oset_node_impl) * F_87 > 2^64
-   this would exceed the address space of the machine.  */
-#define MAXHEIGHT 83
-
-/* Ensure the tree is balanced, after an insertion or deletion operation.
-   The height of NODE is incremented by HEIGHT_DIFF (1 or -1).
-   PARENT = NODE->parent.  (NODE can also be NULL.  But PARENT is non-NULL.)
-   Rotation operations are performed starting at PARENT (not NODE itself!).  */
-static void
-rebalance (gl_oset_t set,
-           gl_oset_node_t node, int height_diff, gl_oset_node_t parent)
-{
-  for (;;)
-    {
-      gl_oset_node_t child;
-      int previous_balance;
-      int balance_diff;
-      gl_oset_node_t nodeleft;
-      gl_oset_node_t noderight;
-
-      child = node;
-      node = parent;
-
-      previous_balance = node->balance;
-
-      /* The balance of NODE is incremented by BALANCE_DIFF: +1 if the right
-         branch's height has increased by 1 or the left branch's height has
-         decreased by 1, -1 if the right branch's height has decreased by 1 or
-         the left branch's height has increased by 1, 0 if no height change.  */
-      if (node->left != NULL || node->right != NULL)
-        balance_diff = (child == node->right ? height_diff : -height_diff);
-      else
-        /* Special case where above formula doesn't work, because the caller
-           didn't tell whether node's left or right branch shrunk from height 1
-           to NULL.  */
-        balance_diff = - previous_balance;
-
-      node->balance += balance_diff;
-      if (balance_diff == previous_balance)
-        {
-          /* node->balance is outside the range [-1,1].  Must rotate.  */
-          gl_oset_node_t *nodep;
-
-          if (node->parent == NULL)
-            /* node == set->root */
-            nodep = &set->root;
-          else if (node->parent->left == node)
-            nodep = &node->parent->left;
-          else if (node->parent->right == node)
-            nodep = &node->parent->right;
-          else
-            abort ();
-
-          nodeleft = node->left;
-          noderight = node->right;
-
-          if (balance_diff < 0)
-            {
-              /* node->balance = -2.  The subtree is heavier on the left side.
-                 Rotate from left to right:
-
-                                  *
-                                /   \
-                             h+2      h
-               */
-              gl_oset_node_t nodeleftright = nodeleft->right;
-              if (nodeleft->balance <= 0)
-                {
-                  /*
-                              *                    h+2|h+3
-                            /   \                  /    \
-                         h+2      h      -->      /   h+1|h+2
-                         / \                      |    /    \
-                       h+1 h|h+1                 h+1  h|h+1  h
-                   */
-                  node->left = nodeleftright;
-                  nodeleft->right = node;
-
-                  nodeleft->parent = node->parent;
-                  node->parent = nodeleft;
-                  if (nodeleftright != NULL)
-                    nodeleftright->parent = node;
-
-                  nodeleft->balance += 1;
-                  node->balance = - nodeleft->balance;
-
-                  *nodep = nodeleft;
-                  height_diff = (height_diff < 0
-                                 ? /* noderight's height had been decremented from
-                                      h+1 to h.  The subtree's height changes from
-                                      h+3 to h+2|h+3.  */
-                                   nodeleft->balance - 1
-                                 : /* nodeleft's height had been incremented from
-                                      h+1 to h+2.  The subtree's height changes from
-                                      h+2 to h+2|h+3.  */
-                                   nodeleft->balance);
-                }
-              else
-                {
-                  /*
-                            *                     h+2
-                          /   \                 /     \
-                       h+2      h      -->    h+1     h+1
-                       / \                    / \     / \
-                      h  h+1                 h   L   R   h
-                         / \
-                        L   R
-
-                   */
-                  gl_oset_node_t L = nodeleft->right = nodeleftright->left;
-                  gl_oset_node_t R = node->left = nodeleftright->right;
-                  nodeleftright->left = nodeleft;
-                  nodeleftright->right = node;
-
-                  nodeleftright->parent = node->parent;
-                  if (L != NULL)
-                    L->parent = nodeleft;
-                  if (R != NULL)
-                    R->parent = node;
-                  nodeleft->parent = nodeleftright;
-                  node->parent = nodeleftright;
-
-                  nodeleft->balance = (nodeleftright->balance > 0 ? -1 : 0);
-                  node->balance = (nodeleftright->balance < 0 ? 1 : 0);
-                  nodeleftright->balance = 0;
+#define NODE_PAYLOAD_PARAMS \
+  const void *elt
+#define NODE_PAYLOAD_ASSIGN(node) \
+  node->value = elt;
+#define NODE_PAYLOAD_DISPOSE(container, node) \
+  if (container->base.dispose_fn != NULL) \
+    container->base.dispose_fn (node->value);
 
-                  *nodep = nodeleftright;
-                  height_diff = (height_diff < 0
-                                 ? /* noderight's height had been decremented from
-                                      h+1 to h.  The subtree's height changes from
-                                      h+3 to h+2.  */
-                                   -1
-                                 : /* nodeleft's height had been incremented from
-                                      h+1 to h+2.  The subtree's height changes from
-                                      h+2 to h+2.  */
-                                   0);
-                }
-            }
-          else
-            {
-              /* node->balance = 2.  The subtree is heavier on the right side.
-                 Rotate from right to left:
-
-                                  *
-                                /   \
-                              h      h+2
-               */
-              gl_oset_node_t noderightleft = noderight->left;
-              if (noderight->balance >= 0)
-                {
-                  /*
-                              *                    h+2|h+3
-                            /   \                   /    \
-                          h      h+2     -->    h+1|h+2   \
-                                 / \            /    \    |
-                             h|h+1 h+1         h   h|h+1 h+1
-                   */
-                  node->right = noderightleft;
-                  noderight->left = node;
-
-                  noderight->parent = node->parent;
-                  node->parent = noderight;
-                  if (noderightleft != NULL)
-                    noderightleft->parent = node;
-
-                  noderight->balance -= 1;
-                  node->balance = - noderight->balance;
-
-                  *nodep = noderight;
-                  height_diff = (height_diff < 0
-                                 ? /* nodeleft's height had been decremented from
-                                      h+1 to h.  The subtree's height changes from
-                                      h+3 to h+2|h+3.  */
-                                   - noderight->balance - 1
-                                 : /* noderight's height had been incremented from
-                                      h+1 to h+2.  The subtree's height changes from
-                                      h+2 to h+2|h+3.  */
-                                   - noderight->balance);
-                }
-              else
-                {
-                  /*
-                            *                    h+2
-                          /   \                /     \
-                        h      h+2    -->    h+1     h+1
-                               / \           / \     / \
-                             h+1  h         h   L   R   h
-                             / \
-                            L   R
-
-                   */
-                  gl_oset_node_t L = node->right = noderightleft->left;
-                  gl_oset_node_t R = noderight->left = noderightleft->right;
-                  noderightleft->left = node;
-                  noderightleft->right = noderight;
-
-                  noderightleft->parent = node->parent;
-                  if (L != NULL)
-                    L->parent = node;
-                  if (R != NULL)
-                    R->parent = noderight;
-                  node->parent = noderightleft;
-                  noderight->parent = noderightleft;
-
-                  node->balance = (noderightleft->balance > 0 ? -1 : 0);
-                  noderight->balance = (noderightleft->balance < 0 ? 1 : 0);
-                  noderightleft->balance = 0;
-
-                  *nodep = noderightleft;
-                  height_diff = (height_diff < 0
-                                 ? /* nodeleft's height had been decremented from
-                                      h+1 to h.  The subtree's height changes from
-                                      h+3 to h+2.  */
-                                   -1
-                                 : /* noderight's height had been incremented from
-                                      h+1 to h+2.  The subtree's height changes from
-                                      h+2 to h+2.  */
-                                   0);
-                }
-            }
-          node = *nodep;
-        }
-      else
-        {
-          /* No rotation needed.  Only propagation of the height change to the
-             next higher level.  */
-          if (height_diff < 0)
-            height_diff = (previous_balance == 0 ? 0 : -1);
-          else
-            height_diff = (node->balance == 0 ? 0 : 1);
-        }
-
-      if (height_diff == 0)
-        break;
-
-      parent = node->parent;
-      if (parent == NULL)
-        break;
-    }
-}
-
-static gl_oset_node_t
-gl_tree_nx_add_first (gl_oset_t set, const void *elt)
-{
-  /* Create new node.  */
-  gl_oset_node_t new_node =
-    (struct gl_oset_node_impl *) malloc (sizeof (struct gl_oset_node_impl));
-
-  if (new_node == NULL)
-    return NULL;
-
-  new_node->left = NULL;
-  new_node->right = NULL;
-  new_node->balance = 0;
-  new_node->value = elt;
-
-  /* Add it to the tree.  */
-  if (set->root == NULL)
-    {
-      set->root = new_node;
-      new_node->parent = NULL;
-    }
-  else
-    {
-      gl_oset_node_t node;
-
-      for (node = set->root; node->left != NULL; )
-        node = node->left;
-
-      node->left = new_node;
-      new_node->parent = node;
-      node->balance--;
-
-      /* Rebalance.  */
-      if (node->right == NULL && node->parent != NULL)
-        rebalance (set, node, 1, node->parent);
-    }
-
-  set->count++;
-  return new_node;
-}
-
-static gl_oset_node_t
-gl_tree_nx_add_before (gl_oset_t set, gl_oset_node_t node, const void *elt)
-{
-  /* Create new node.  */
-  gl_oset_node_t new_node =
-    (struct gl_oset_node_impl *) malloc (sizeof (struct gl_oset_node_impl));
-  bool height_inc;
-
-  if (new_node == NULL)
-    return NULL;
-
-  new_node->left = NULL;
-  new_node->right = NULL;
-  new_node->balance = 0;
-  new_node->value = elt;
-
-  /* Add it to the tree.  */
-  if (node->left == NULL)
-    {
-      node->left = new_node;
-      node->balance--;
-      height_inc = (node->right == NULL);
-    }
-  else
-    {
-      for (node = node->left; node->right != NULL; )
-        node = node->right;
-      node->right = new_node;
-      node->balance++;
-      height_inc = (node->left == NULL);
-    }
-  new_node->parent = node;
-
-  /* Rebalance.  */
-  if (height_inc && node->parent != NULL)
-    rebalance (set, node, 1, node->parent);
-
-  set->count++;
-  return new_node;
-}
-
-static gl_oset_node_t
-gl_tree_nx_add_after (gl_oset_t set, gl_oset_node_t node, const void *elt)
-{
-  /* Create new node.  */
-  gl_oset_node_t new_node =
-    (struct gl_oset_node_impl *) malloc (sizeof (struct gl_oset_node_impl));
-  bool height_inc;
-
-  if (new_node == NULL)
-    return NULL;
-
-  new_node->left = NULL;
-  new_node->right = NULL;
-  new_node->balance = 0;
-  new_node->value = elt;
-
-  /* Add it to the tree.  */
-  if (node->right == NULL)
-    {
-      node->right = new_node;
-      node->balance++;
-      height_inc = (node->left == NULL);
-    }
-  else
-    {
-      for (node = node->right; node->left != NULL; )
-        node = node->left;
-      node->left = new_node;
-      node->balance--;
-      height_inc = (node->right == NULL);
-    }
-  new_node->parent = node;
-
-  /* Rebalance.  */
-  if (height_inc && node->parent != NULL)
-    rebalance (set, node, 1, node->parent);
-
-  set->count++;
-  return new_node;
-}
-
-static bool
-gl_tree_remove_node (gl_oset_t set, gl_oset_node_t node)
-{
-  gl_oset_node_t parent = node->parent;
-
-  if (node->left == NULL)
-    {
-      /* Replace node with node->right.  */
-      gl_oset_node_t child = node->right;
-
-      if (child != NULL)
-        child->parent = parent;
-      if (parent == NULL)
-        set->root = child;
-      else
-        {
-          if (parent->left == node)
-            parent->left = child;
-          else /* parent->right == node */
-            parent->right = child;
-
-          rebalance (set, child, -1, parent);
-        }
-    }
-  else if (node->right == NULL)
-    {
-      /* It is not absolutely necessary to treat this case.  But the more
-         general case below is more complicated, hence slower.  */
-      /* Replace node with node->left.  */
-      gl_oset_node_t child = node->left;
-
-      child->parent = parent;
-      if (parent == NULL)
-        set->root = child;
-      else
-        {
-          if (parent->left == node)
-            parent->left = child;
-          else /* parent->right == node */
-            parent->right = child;
-
-          rebalance (set, child, -1, parent);
-        }
-    }
-  else
-    {
-      /* Replace node with the rightmost element of the node->left subtree.  */
-      gl_oset_node_t subst;
-      gl_oset_node_t subst_parent;
-      gl_oset_node_t child;
-
-      for (subst = node->left; subst->right != NULL; )
-        subst = subst->right;
-
-      subst_parent = subst->parent;
-
-      child = subst->left;
-
-      /* The case subst_parent == node is special:  If we do nothing special,
-         we get confusion about node->left, subst->left and child->parent.
-           subst_parent == node
-           <==> The 'for' loop above terminated immediately.
-           <==> subst == subst_parent->left
-                [otherwise subst == subst_parent->right]
-         In this case, we would need to first set
-           child->parent = node; node->left = child;
-         and later - when we copy subst into node's position - again
-           child->parent = subst; subst->left = child;
-         Altogether a no-op.  */
-      if (subst_parent != node)
-        {
-          if (child != NULL)
-            child->parent = subst_parent;
-          subst_parent->right = child;
-        }
-
-      /* Copy subst into node's position.
-         (This is safer than to copy subst's value into node, keep node in
-         place, and free subst.)  */
-      if (subst_parent != node)
-        {
-          subst->left = node->left;
-          subst->left->parent = subst;
-        }
-      subst->right = node->right;
-      subst->right->parent = subst;
-      subst->balance = node->balance;
-      subst->parent = parent;
-      if (parent == NULL)
-        set->root = subst;
-      else if (parent->left == node)
-        parent->left = subst;
-      else /* parent->right == node */
-        parent->right = subst;
-
-      /* Rebalancing starts at child's parent, that is subst_parent -
-         except when subst_parent == node.  In this case, we need to use
-         its replacement, subst.  */
-      rebalance (set, child, -1, subst_parent != node ? subst_parent : subst);
-    }
-
-  set->count--;
-  if (set->base.dispose_fn != NULL)
-    set->base.dispose_fn (node->value);
-  free (node);
-  return true;
-}
+#include "gl_avltree_ordered.h"
 
 /* Generic binary tree code.  */
 #include "gl_anytree_oset.h"
 
 /* For debugging.  */
-static unsigned int
-check_invariants (gl_oset_node_t node, gl_oset_node_t parent, size_t *counterp)
-{
-  unsigned int left_height =
-    (node->left != NULL ? check_invariants (node->left, node, counterp) : 0);
-  unsigned int right_height =
-    (node->right != NULL ? check_invariants (node->right, node, counterp) : 0);
-  int balance = (int)right_height - (int)left_height;
-
-  if (!(node->parent == parent))
-    abort ();
-  if (!(balance >= -1 && balance <= 1))
-    abort ();
-  if (!(node->balance == balance))
-    abort ();
-
-  (*counterp)++;
-
-  return 1 + (left_height > right_height ? left_height : right_height);
-}
 void
 gl_avltree_oset_check_invariants (gl_oset_t set)
 {
@@ -576,8 +64,10 @@ const struct gl_oset_implementation gl_avltree_oset_implementation =
     gl_tree_search_atleast,
     gl_tree_nx_add,
     gl_tree_remove,
+    gl_tree_update,
     gl_tree_oset_free,
     gl_tree_iterator,
+    gl_tree_iterator_atleast,
     gl_tree_iterator_next,
     gl_tree_iterator_free
   };
index 6229c84..b888738 100644 (file)
@@ -1,5 +1,5 @@
 /* Ordered set data type implemented by a binary tree.
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_AVLTREE_OSET_H
 #define _GL_AVLTREE_OSET_H
diff --git a/lib/gl_linked_list.c b/lib/gl_linked_list.c
new file mode 100644 (file)
index 0000000..087968e
--- /dev/null
@@ -0,0 +1,66 @@
+/* Sequential list data type implemented by a linked list.
+   Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "gl_linked_list.h"
+
+#include <stdlib.h>
+
+/* -------------------------- gl_list_t Data Type -------------------------- */
+
+/* Generic linked list code.  */
+#include "gl_anylinked_list1.h"
+#include "gl_anylinked_list2.h"
+
+
+const struct gl_list_implementation gl_linked_list_implementation =
+  {
+    gl_linked_nx_create_empty,
+    gl_linked_nx_create,
+    gl_linked_size,
+    gl_linked_node_value,
+    gl_linked_node_nx_set_value,
+    gl_linked_next_node,
+    gl_linked_previous_node,
+    gl_linked_first_node,
+    gl_linked_last_node,
+    gl_linked_get_at,
+    gl_linked_nx_set_at,
+    gl_linked_search_from_to,
+    gl_linked_indexof_from_to,
+    gl_linked_nx_add_first,
+    gl_linked_nx_add_last,
+    gl_linked_nx_add_before,
+    gl_linked_nx_add_after,
+    gl_linked_nx_add_at,
+    gl_linked_remove_node,
+    gl_linked_remove_at,
+    gl_linked_remove,
+    gl_linked_list_free,
+    gl_linked_iterator,
+    gl_linked_iterator_from_to,
+    gl_linked_iterator_next,
+    gl_linked_iterator_free,
+    gl_linked_sortedlist_search,
+    gl_linked_sortedlist_search_from_to,
+    gl_linked_sortedlist_indexof,
+    gl_linked_sortedlist_indexof_from_to,
+    gl_linked_sortedlist_nx_add,
+    gl_linked_sortedlist_remove
+  };
diff --git a/lib/gl_linked_list.h b/lib/gl_linked_list.h
new file mode 100644 (file)
index 0000000..3e39b50
--- /dev/null
@@ -0,0 +1,34 @@
+/* Sequential list data type implemented by a linked list.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _GL_LINKED_LIST_H
+#define _GL_LINKED_LIST_H
+
+#include "gl_list.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern const struct gl_list_implementation gl_linked_list_implementation;
+#define GL_LINKED_LIST &gl_linked_list_implementation
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GL_LINKED_LIST_H */
index 33d9bcf..70eca52 100644 (file)
@@ -1,5 +1,5 @@
 /* Sequential list data type implemented by a hash table with a linked list.
-   Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 /* Specification.  */
 #include "gl_linkedhash_list.h"
 
-#include <stdint.h> /* for SIZE_MAX */
+#include <stdint.h> /* for uintptr_t, SIZE_MAX */
 #include <stdlib.h>
 
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 #define WITH_HASHTABLE 1
 
 /* -------------------------- gl_list_t Data Type -------------------------- */
 
 /* Generic hash-table code.  */
-#include "gl_anyhash_list1.h"
+#include "gl_anyhash1.h"
 
 /* Generic linked list code.  */
 #include "gl_anylinked_list1.h"
 
 /* Generic hash-table code.  */
-#include "gl_anyhash_list2.h"
-
-/* Resize the hash table if needed, after list->count was incremented.  */
-static void
-hash_resize_after_add (gl_list_t list)
-{
-  size_t count = list->count;
-  size_t estimate = xsum (count, count / 2); /* 1.5 * count */
-  if (estimate > list->table_size)
-    hash_resize (list, estimate);
-}
+#define CONTAINER_T gl_list_t
+#define CONTAINER_COUNT(list) (list)->count
+#include "gl_anyhash2.h"
 
 /* Add a node to the hash table structure.  */
 static void
@@ -98,6 +86,8 @@ const struct gl_list_implementation gl_linkedhash_list_implementation =
     gl_linked_node_nx_set_value,
     gl_linked_next_node,
     gl_linked_previous_node,
+    gl_linked_first_node,
+    gl_linked_last_node,
     gl_linked_get_at,
     gl_linked_nx_set_at,
     gl_linked_search_from_to,
index 9d740ea..f908588 100644 (file)
@@ -1,5 +1,5 @@
 /* Sequential list data type implemented by a hash table with a linked list.
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_LINKEDHASH_LIST_H
 #define _GL_LINKEDHASH_LIST_H
index c9d05b0..7fc22bb 100644 (file)
@@ -1,5 +1,5 @@
 /* Abstract sequential list data type.  -*- coding: utf-8 -*-
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_LIST_H
 #define _GL_LIST_H
@@ -73,8 +73,14 @@ extern "C" {
    gl_list_node_set_value      O(1)     O(1)     O(1)      O(1)    O((log n)²)/O(1)
    gl_list_next_node           O(1)     O(1)   O(log n)    O(1)       O(log n)
    gl_list_previous_node       O(1)     O(1)   O(log n)    O(1)       O(log n)
+   gl_list_first_node          O(1)     O(1)   O(log n)    O(1)       O(log n)
+   gl_list_last_node           O(1)     O(1)   O(log n)    O(1)       O(log n)
    gl_list_get_at              O(1)     O(n)   O(log n)    O(n)       O(log n)
+   gl_list_get_first           O(1)     O(1)   O(log n)    O(1)       O(log n)
+   gl_list_get_last            O(1)     O(1)   O(log n)    O(1)       O(log n)
    gl_list_set_at              O(1)     O(n)   O(log n)    O(n)    O((log n)²)/O(log n)
+   gl_list_set_first           O(1)     O(1)   O(log n)  O(n)/O(1) O((log n)²)/O(log n)
+   gl_list_set_last            O(1)     O(1)   O(log n)  O(n)/O(1) O((log n)²)/O(log n)
    gl_list_search              O(n)     O(n)     O(n)    O(n)/O(1)    O(log n)/O(1)
    gl_list_search_from         O(n)     O(n)     O(n)    O(n)/O(1) O((log n)²)/O(log n)
    gl_list_search_from_to      O(n)     O(n)     O(n)    O(n)/O(1) O((log n)²)/O(log n)
@@ -88,6 +94,8 @@ extern "C" {
    gl_list_add_at              O(n)     O(n)   O(log n)    O(n)    O((log n)²)/O(log n)
    gl_list_remove_node         O(n)     O(1)   O(log n)  O(n)/O(1) O((log n)²)/O(log n)
    gl_list_remove_at           O(n)     O(n)   O(log n)    O(n)    O((log n)²)/O(log n)
+   gl_list_remove_first      O(n)/O(1)  O(1)   O(log n)  O(n)/O(1) O((log n)²)/O(log n)
+   gl_list_remove_last         O(1)     O(1)   O(log n)  O(n)/O(1) O((log n)²)/O(log n)
    gl_list_remove              O(n)     O(n)     O(n)    O(n)/O(1) O((log n)²)/O(log n)
    gl_list_iterator            O(1)     O(1)   O(log n)    O(1)       O(log n)
    gl_list_iterator_from_to    O(1)     O(n)   O(log n)    O(n)       O(log n)
@@ -130,7 +138,7 @@ typedef const struct gl_list_implementation * gl_list_implementation_t;
 
 #if 0 /* Unless otherwise specified, these are defined inline below.  */
 
-/* Create an empty list.
+/* Creates an empty list.
    IMPLEMENTATION is one of GL_ARRAY_LIST, GL_CARRAY_LIST, GL_LINKED_LIST,
    GL_AVLTREE_LIST, GL_RBTREE_LIST, GL_LINKEDHASH_LIST, GL_AVLTREEHASH_LIST,
    GL_RBTREEHASH_LIST.
@@ -145,14 +153,14 @@ extern gl_list_t gl_list_create_empty (gl_list_implementation_t implementation,
                                        gl_listelement_hashcode_fn hashcode_fn,
                                        gl_listelement_dispose_fn dispose_fn,
                                        bool allow_duplicates);
-/* Likewise.  Return NULL upon out-of-memory.  */
+/* Likewise.  Returns NULL upon out-of-memory.  */
 extern gl_list_t gl_list_nx_create_empty (gl_list_implementation_t implementation,
                                           gl_listelement_equals_fn equals_fn,
                                           gl_listelement_hashcode_fn hashcode_fn,
                                           gl_listelement_dispose_fn dispose_fn,
                                           bool allow_duplicates);
 
-/* Create a list with given contents.
+/* Creates a list with given contents.
    IMPLEMENTATION is one of GL_ARRAY_LIST, GL_CARRAY_LIST, GL_LINKED_LIST,
    GL_AVLTREE_LIST, GL_RBTREE_LIST, GL_LINKEDHASH_LIST, GL_AVLTREEHASH_LIST,
    GL_RBTREEHASH_LIST.
@@ -170,7 +178,7 @@ extern gl_list_t gl_list_create (gl_list_implementation_t implementation,
                                  gl_listelement_dispose_fn dispose_fn,
                                  bool allow_duplicates,
                                  size_t count, const void **contents);
-/* Likewise.  Return NULL upon out-of-memory.  */
+/* Likewise.  Returns NULL upon out-of-memory.  */
 extern gl_list_t gl_list_nx_create (gl_list_implementation_t implementation,
                                     gl_listelement_equals_fn equals_fn,
                                     gl_listelement_hashcode_fn hashcode_fn,
@@ -178,162 +186,194 @@ extern gl_list_t gl_list_nx_create (gl_list_implementation_t implementation,
                                     bool allow_duplicates,
                                     size_t count, const void **contents);
 
-/* Return the current number of elements in a list.  */
+/* Returns the current number of elements in a list.  */
 extern size_t gl_list_size (gl_list_t list);
 
-/* Return the element value represented by a list node.  */
+/* Returns the element value represented by a list node.  */
 extern const void * gl_list_node_value (gl_list_t list, gl_list_node_t node);
 
-/* Replace the element value represented by a list node.  */
+/* Replaces the element value represented by a list node.  */
 /* declared in gl_xlist.h */
 extern void gl_list_node_set_value (gl_list_t list, gl_list_node_t node,
                                     const void *elt);
-/* Likewise.  Return 0 upon success, -1 upon out-of-memory.  */
+/* Likewise.  Returns 0 upon success, -1 upon out-of-memory.  */
 extern int gl_list_node_nx_set_value (gl_list_t list, gl_list_node_t node,
                                       const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
-  ;
+  _GL_ATTRIBUTE_NODISCARD;
 
-/* Return the node immediately after the given node in the list, or NULL
+/* Returns the node immediately after the given node in the list, or NULL
    if the given node is the last (rightmost) one in the list.  */
 extern gl_list_node_t gl_list_next_node (gl_list_t list, gl_list_node_t node);
 
-/* Return the node immediately before the given node in the list, or NULL
+/* Returns the node immediately before the given node in the list, or NULL
    if the given node is the first (leftmost) one in the list.  */
 extern gl_list_node_t gl_list_previous_node (gl_list_t list, gl_list_node_t node);
 
-/* Return the element at a given position in the list.
+/* Returns the first node in the list, or NULL if the list is empty.
+   This function is useful for iterating through the list like this:
+     gl_list_node_t node;
+     for (node = gl_list_first_node (list); node != NULL; node = gl_list_next_node (node))
+       ...
+ */
+extern gl_list_node_t gl_list_first_node (gl_list_t list);
+
+/* Returns the last node in the list, or NULL if the list is empty.
+   This function is useful for iterating through the list in backward order,
+   like this:
+     gl_list_node_t node;
+     for (node = gl_list_last_node (list); node != NULL; node = gl_list_previous_node (node))
+       ...
+ */
+extern gl_list_node_t gl_list_last_node (gl_list_t list);
+
+/* Returns the element at a given position in the list.
    POSITION must be >= 0 and < gl_list_size (list).  */
 extern const void * gl_list_get_at (gl_list_t list, size_t position);
 
-/* Replace the element at a given position in the list.
+/* Returns the element at the first position in the list.
+   The list must be non-empty.  */
+extern const void * gl_list_get_first (gl_list_t list);
+
+/* Returns the element at the last position in the list.
+   The list must be non-empty.  */
+extern const void * gl_list_get_last (gl_list_t list);
+
+/* Replaces the element at a given position in the list.
    POSITION must be >= 0 and < gl_list_size (list).
-   Return its node.  */
+   Returns its node.  */
 /* declared in gl_xlist.h */
 extern gl_list_node_t gl_list_set_at (gl_list_t list, size_t position,
                                       const void *elt);
-/* Likewise.  Return NULL upon out-of-memory.  */
+/* Likewise.  Returns NULL upon out-of-memory.  */
 extern gl_list_node_t gl_list_nx_set_at (gl_list_t list, size_t position,
                                          const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
-  ;
+  _GL_ATTRIBUTE_NODISCARD;
 
-/* Search whether an element is already in the list.
-   Return its node if found, or NULL if not present in the list.  */
+/* Replaces the element at the first position in the list.
+   Returns its node.
+   The list must be non-empty.  */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_set_first (gl_list_t list, const void *elt);
+/* Likewise.  Returns NULL upon out-of-memory.  */
+extern gl_list_node_t gl_list_nx_set_first (gl_list_t list, const void *elt)
+  _GL_ATTRIBUTE_NODISCARD;
+
+/* Replaces the element at the last position in the list.
+   Returns its node.
+   The list must be non-empty.  */
+/* declared in gl_xlist.h */
+extern gl_list_node_t gl_list_set_last (gl_list_t list, const void *elt);
+/* Likewise.  Returns NULL upon out-of-memory.  */
+extern gl_list_node_t gl_list_nx_set_last (gl_list_t list, const void *elt)
+  _GL_ATTRIBUTE_NODISCARD;
+
+/* Searches whether an element is already in the list.
+   Returns its node if found, or NULL if not present in the list.  */
 extern gl_list_node_t gl_list_search (gl_list_t list, const void *elt);
 
-/* Search whether an element is already in the list,
+/* Searches whether an element is already in the list,
    at a position >= START_INDEX.
-   Return its node if found, or NULL if not present in the list.  */
+   Returns its node if found, or NULL if not present in the list.  */
 extern gl_list_node_t gl_list_search_from (gl_list_t list, size_t start_index,
                                            const void *elt);
 
-/* Search whether an element is already in the list,
+/* Searches whether an element is already in the list,
    at a position >= START_INDEX and < END_INDEX.
-   Return its node if found, or NULL if not present in the list.  */
+   Returns its node if found, or NULL if not present in the list.  */
 extern gl_list_node_t gl_list_search_from_to (gl_list_t list,
                                               size_t start_index,
                                               size_t end_index,
                                               const void *elt);
 
-/* Search whether an element is already in the list.
-   Return its position if found, or (size_t)(-1) if not present in the list.  */
+/* Searches whether an element is already in the list.
+   Returns its position if found, or (size_t)(-1) if not present in the list.  */
 extern size_t gl_list_indexof (gl_list_t list, const void *elt);
 
-/* Search whether an element is already in the list,
+/* Searches whether an element is already in the list,
    at a position >= START_INDEX.
-   Return its position if found, or (size_t)(-1) if not present in the list.  */
+   Returns its position if found, or (size_t)(-1) if not present in the list.  */
 extern size_t gl_list_indexof_from (gl_list_t list, size_t start_index,
                                     const void *elt);
 
-/* Search whether an element is already in the list,
+/* Searches whether an element is already in the list,
    at a position >= START_INDEX and < END_INDEX.
-   Return its position if found, or (size_t)(-1) if not present in the list.  */
+   Returns its position if found, or (size_t)(-1) if not present in the list.  */
 extern size_t gl_list_indexof_from_to (gl_list_t list,
                                        size_t start_index, size_t end_index,
                                        const void *elt);
 
-/* Add an element as the first element of the list.
-   Return its node.  */
+/* Adds an element as the first element of the list.
+   Returns its node.  */
 /* declared in gl_xlist.h */
 extern gl_list_node_t gl_list_add_first (gl_list_t list, const void *elt);
-/* Likewise.  Return NULL upon out-of-memory.  */
+/* Likewise.  Returns NULL upon out-of-memory.  */
 extern gl_list_node_t gl_list_nx_add_first (gl_list_t list, const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
-  ;
+  _GL_ATTRIBUTE_NODISCARD;
 
-/* Add an element as the last element of the list.
-   Return its node.  */
+/* Adds an element as the last element of the list.
+   Returns its node.  */
 /* declared in gl_xlist.h */
 extern gl_list_node_t gl_list_add_last (gl_list_t list, const void *elt);
-/* Likewise.  Return NULL upon out-of-memory.  */
+/* Likewise.  Returns NULL upon out-of-memory.  */
 extern gl_list_node_t gl_list_nx_add_last (gl_list_t list, const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
-  ;
+  _GL_ATTRIBUTE_NODISCARD;
 
-/* Add an element before a given element node of the list.
-   Return its node.  */
+/* Adds an element before a given element node of the list.
+   Returns its node.  */
 /* declared in gl_xlist.h */
 extern gl_list_node_t gl_list_add_before (gl_list_t list, gl_list_node_t node,
                                           const void *elt);
-/* Likewise.  Return NULL upon out-of-memory.  */
+/* Likewise.  Returns NULL upon out-of-memory.  */
 extern gl_list_node_t gl_list_nx_add_before (gl_list_t list,
                                              gl_list_node_t node,
                                              const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
-  ;
+  _GL_ATTRIBUTE_NODISCARD;
 
-/* Add an element after a given element node of the list.
-   Return its node.  */
+/* Adds an element after a given element node of the list.
+   Returns its node.  */
 /* declared in gl_xlist.h */
 extern gl_list_node_t gl_list_add_after (gl_list_t list, gl_list_node_t node,
                                          const void *elt);
-/* Likewise.  Return NULL upon out-of-memory.  */
+/* Likewise.  Returns NULL upon out-of-memory.  */
 extern gl_list_node_t gl_list_nx_add_after (gl_list_t list, gl_list_node_t node,
                                             const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
-  ;
+  _GL_ATTRIBUTE_NODISCARD;
 
-/* Add an element at a given position in the list.
+/* Adds an element at a given position in the list.
    POSITION must be >= 0 and <= gl_list_size (list).  */
 /* declared in gl_xlist.h */
 extern gl_list_node_t gl_list_add_at (gl_list_t list, size_t position,
                                       const void *elt);
-/* Likewise.  Return NULL upon out-of-memory.  */
+/* Likewise.  Returns NULL upon out-of-memory.  */
 extern gl_list_node_t gl_list_nx_add_at (gl_list_t list, size_t position,
                                          const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
-  ;
+  _GL_ATTRIBUTE_NODISCARD;
 
-/* Remove an element from the list.
-   Return true.  */
+/* Removes an element from the list.
+   Returns true.  */
 extern bool gl_list_remove_node (gl_list_t list, gl_list_node_t node);
 
-/* Remove an element at a given position from the list.
+/* Removes an element at a given position from the list.
    POSITION must be >= 0 and < gl_list_size (list).
-   Return true.  */
+   Returns true.  */
 extern bool gl_list_remove_at (gl_list_t list, size_t position);
 
-/* Search and remove an element from the list.
-   Return true if it was found and removed.  */
+/* Removes the element at the first position from the list.
+   Returns true if it was found and removed, or false if the list was empty.  */
+extern bool gl_list_remove_first (gl_list_t list);
+
+/* Removes the element at the last position from the list.
+   Returns true if it was found and removed, or false if the list was empty.  */
+extern bool gl_list_remove_last (gl_list_t list);
+
+/* Searches and removes an element from the list.
+   Returns true if it was found and removed.  */
 extern bool gl_list_remove (gl_list_t list, const void *elt);
 
-/* Free an entire list.
-   (But this call does not free the elements of the list.)  */
+/* Frees an entire list.
+   (But this call does not free the elements of the list.  It only invokes
+   the DISPOSE_FN on each of the elements of the list, and only if the list
+   is not a sublist.)  */
 extern void gl_list_free (gl_list_t list);
 
 #endif /* End of inline and gl_xlist.h-defined functions.  */
@@ -359,12 +399,12 @@ typedef struct
 
 #if 0 /* These are defined inline below.  */
 
-/* Create an iterator traversing a list.
+/* Creates an iterator traversing a list.
    The list contents must not be modified while the iterator is in use,
    except for replacing or removing the last returned element.  */
 extern gl_list_iterator_t gl_list_iterator (gl_list_t list);
 
-/* Create an iterator traversing the element with indices i,
+/* Creates an iterator traversing the element with indices i,
    start_index <= i < end_index, of a list.
    The list contents must not be modified while the iterator is in use,
    except for replacing or removing the last returned element.  */
@@ -372,13 +412,13 @@ extern gl_list_iterator_t gl_list_iterator_from_to (gl_list_t list,
                                                     size_t start_index,
                                                     size_t end_index);
 
-/* If there is a next element, store the next element in *ELTP, store its
-   node in *NODEP if NODEP is non-NULL, advance the iterator and return true.
-   Otherwise, return false.  */
+/* If there is a next element, stores the next element in *ELTP, stores its
+   node in *NODEP if NODEP is non-NULL, advances the iterator and returns true.
+   Otherwise, returns false.  */
 extern bool gl_list_iterator_next (gl_list_iterator_t *iterator,
                                    const void **eltp, gl_list_node_t *nodep);
 
-/* Free an iterator.  */
+/* Frees an iterator.  */
 extern void gl_list_iterator_free (gl_list_iterator_t *iterator);
 
 #endif /* End of inline functions.  */
@@ -394,21 +434,21 @@ typedef int (*gl_listelement_compar_fn) (const void *elt1, const void *elt2);
 
 #if 0 /* Unless otherwise specified, these are defined inline below.  */
 
-/* Search whether an element is already in the list.
+/* Searches whether an element is already in the list.
    The list is assumed to be sorted with COMPAR.
-   Return its node if found, or NULL if not present in the list.
+   Returns its node if found, or NULL if not present in the list.
    If the list contains several copies of ELT, the node of the leftmost one is
    returned.  */
 extern gl_list_node_t gl_sortedlist_search (gl_list_t list,
                                             gl_listelement_compar_fn compar,
                                             const void *elt);
 
-/* Search whether an element is already in the list.
+/* Searches whether an element is already in the list.
    The list is assumed to be sorted with COMPAR.
    Only list elements with indices >= START_INDEX and < END_INDEX are
    considered; the implementation uses these bounds to minimize the number
    of COMPAR invocations.
-   Return its node if found, or NULL if not present in the list.
+   Returns its node if found, or NULL if not present in the list.
    If the list contains several copies of ELT, the node of the leftmost one is
    returned.  */
 extern gl_list_node_t gl_sortedlist_search_from_to (gl_list_t list,
@@ -417,21 +457,21 @@ extern gl_list_node_t gl_sortedlist_search_from_to (gl_list_t list,
                                                     size_t end_index,
                                                     const void *elt);
 
-/* Search whether an element is already in the list.
+/* Searches whether an element is already in the list.
    The list is assumed to be sorted with COMPAR.
-   Return its position if found, or (size_t)(-1) if not present in the list.
+   Returns its position if found, or (size_t)(-1) if not present in the list.
    If the list contains several copies of ELT, the position of the leftmost one
    is returned.  */
 extern size_t gl_sortedlist_indexof (gl_list_t list,
                                      gl_listelement_compar_fn compar,
                                      const void *elt);
 
-/* Search whether an element is already in the list.
+/* Searches whether an element is already in the list.
    The list is assumed to be sorted with COMPAR.
    Only list elements with indices >= START_INDEX and < END_INDEX are
    considered; the implementation uses these bounds to minimize the number
    of COMPAR invocations.
-   Return its position if found, or (size_t)(-1) if not present in the list.
+   Returns its position if found, or (size_t)(-1) if not present in the list.
    If the list contains several copies of ELT, the position of the leftmost one
    is returned.  */
 extern size_t gl_sortedlist_indexof_from_to (gl_list_t list,
@@ -440,25 +480,22 @@ extern size_t gl_sortedlist_indexof_from_to (gl_list_t list,
                                              size_t end_index,
                                              const void *elt);
 
-/* Add an element at the appropriate position in the list.
+/* Adds an element at the appropriate position in the list.
    The list is assumed to be sorted with COMPAR.
-   Return its node.  */
+   Returns its node.  */
 /* declared in gl_xlist.h */
 extern gl_list_node_t gl_sortedlist_add (gl_list_t list,
                                          gl_listelement_compar_fn compar,
                                          const void *elt);
-/* Likewise.  Return NULL upon out-of-memory.  */
+/* Likewise.  Returns NULL upon out-of-memory.  */
 extern gl_list_node_t gl_sortedlist_nx_add (gl_list_t list,
                                             gl_listelement_compar_fn compar,
                                             const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
-  ;
+  _GL_ATTRIBUTE_NODISCARD;
 
-/* Search and remove an element from the list.
+/* Searches and removes an element from the list.
    The list is assumed to be sorted with COMPAR.
-   Return true if it was found and removed.
+   Returns true if it was found and removed.
    If the list contains several copies of ELT, only the leftmost one is
    removed.  */
 extern bool gl_sortedlist_remove (gl_list_t list,
@@ -489,6 +526,8 @@ struct gl_list_implementation
                             const void *elt);
   gl_list_node_t (*next_node) (gl_list_t list, gl_list_node_t node);
   gl_list_node_t (*previous_node) (gl_list_t list, gl_list_node_t node);
+  gl_list_node_t (*first_node) (gl_list_t list);
+  gl_list_node_t (*last_node) (gl_list_t list);
   const void * (*get_at) (gl_list_t list, size_t position);
   gl_list_node_t (*nx_set_at) (gl_list_t list, size_t position,
                                const void *elt);
@@ -591,10 +630,7 @@ gl_list_node_value (gl_list_t list, gl_list_node_t node)
          ->node_value (list, node);
 }
 
-GL_LIST_INLINE int
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD int
 gl_list_node_nx_set_value (gl_list_t list, gl_list_node_t node,
                            const void *elt)
 {
@@ -616,6 +652,20 @@ gl_list_previous_node (gl_list_t list, gl_list_node_t node)
          ->previous_node (list, node);
 }
 
+GL_LIST_INLINE gl_list_node_t
+gl_list_first_node (gl_list_t list)
+{
+  return ((const struct gl_list_impl_base *) list)->vtable
+         ->first_node (list);
+}
+
+GL_LIST_INLINE gl_list_node_t
+gl_list_last_node (gl_list_t list)
+{
+  return ((const struct gl_list_impl_base *) list)->vtable
+         ->last_node (list);
+}
+
 GL_LIST_INLINE const void *
 gl_list_get_at (gl_list_t list, size_t position)
 {
@@ -623,16 +673,37 @@ gl_list_get_at (gl_list_t list, size_t position)
          ->get_at (list, position);
 }
 
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE const void *
+gl_list_get_first (gl_list_t list)
+{
+  return gl_list_get_at (list, 0);
+}
+
+GL_LIST_INLINE const void *
+gl_list_get_last (gl_list_t list)
+{
+  return gl_list_get_at (list, gl_list_size (list) - 1);
+}
+
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
 gl_list_nx_set_at (gl_list_t list, size_t position, const void *elt)
 {
   return ((const struct gl_list_impl_base *) list)->vtable
          ->nx_set_at (list, position, elt);
 }
 
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
+gl_list_nx_set_first (gl_list_t list, const void *elt)
+{
+  return gl_list_nx_set_at (list, 0, elt);
+}
+
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
+gl_list_nx_set_last (gl_list_t list, const void *elt)
+{
+  return gl_list_nx_set_at (list, gl_list_size (list) - 1, elt);
+}
+
 GL_LIST_INLINE gl_list_node_t
 gl_list_search (gl_list_t list, const void *elt)
 {
@@ -681,50 +752,35 @@ gl_list_indexof_from_to (gl_list_t list, size_t start_index, size_t end_index,
          ->indexof_from_to (list, start_index, end_index, elt);
 }
 
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
 gl_list_nx_add_first (gl_list_t list, const void *elt)
 {
   return ((const struct gl_list_impl_base *) list)->vtable
          ->nx_add_first (list, elt);
 }
 
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
 gl_list_nx_add_last (gl_list_t list, const void *elt)
 {
   return ((const struct gl_list_impl_base *) list)->vtable
          ->nx_add_last (list, elt);
 }
 
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
 gl_list_nx_add_before (gl_list_t list, gl_list_node_t node, const void *elt)
 {
   return ((const struct gl_list_impl_base *) list)->vtable
          ->nx_add_before (list, node, elt);
 }
 
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
 gl_list_nx_add_after (gl_list_t list, gl_list_node_t node, const void *elt)
 {
   return ((const struct gl_list_impl_base *) list)->vtable
          ->nx_add_after (list, node, elt);
 }
 
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
 gl_list_nx_add_at (gl_list_t list, size_t position, const void *elt)
 {
   return ((const struct gl_list_impl_base *) list)->vtable
@@ -746,6 +802,26 @@ gl_list_remove_at (gl_list_t list, size_t position)
 }
 
 GL_LIST_INLINE bool
+gl_list_remove_first (gl_list_t list)
+{
+  size_t size = gl_list_size (list);
+  if (size > 0)
+    return gl_list_remove_at (list, 0);
+  else
+    return false;
+}
+
+GL_LIST_INLINE bool
+gl_list_remove_last (gl_list_t list)
+{
+  size_t size = gl_list_size (list);
+  if (size > 0)
+    return gl_list_remove_at (list, size - 1);
+  else
+    return false;
+}
+
+GL_LIST_INLINE bool
 gl_list_remove (gl_list_t list, const void *elt)
 {
   return ((const struct gl_list_impl_base *) list)->vtable
@@ -815,10 +891,7 @@ gl_sortedlist_indexof_from_to (gl_list_t list, gl_listelement_compar_fn compar,
                                        elt);
 }
 
-GL_LIST_INLINE gl_list_node_t
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
+GL_LIST_INLINE _GL_ATTRIBUTE_NODISCARD gl_list_node_t
 gl_sortedlist_nx_add (gl_list_t list, gl_listelement_compar_fn compar, const void *elt)
 {
   return ((const struct gl_list_impl_base *) list)->vtable
index ffca315..5e15919 100644 (file)
@@ -1,5 +1,5 @@
 /* Abstract ordered set data type.
-   Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_OSET_H
 #define _GL_OSET_H
@@ -65,9 +65,11 @@ extern "C" {
    gl_oset_size                O(1)     O(1)
    gl_oset_add                 O(n)   O(log n)
    gl_oset_remove              O(n)   O(log n)
+   gl_oset_update              O(n)   O(log n)
    gl_oset_search            O(log n) O(log n)
    gl_oset_search_atleast    O(log n) O(log n)
    gl_oset_iterator            O(1)   O(log n)
+   gl_oset_iterator_atleast  O(log n) O(log n)
    gl_oset_iterator_next       O(1)   O(log n)
  */
 
@@ -77,12 +79,15 @@ extern "C" {
    NULL denotes pointer comparison.  */
 typedef int (*gl_setelement_compar_fn) (const void *elt1, const void *elt2);
 
+#ifndef _GL_SETELEMENT_DISPOSE_FN_DEFINED
 /* Type of function used to dispose an element once it's removed from a set.
    NULL denotes a no-op.  */
 typedef void (*gl_setelement_dispose_fn) (const void *elt);
+# define _GL_SETELEMENT_DISPOSE_FN_DEFINED 1
+#endif
 
 /* Type of function used to compare an element with a threshold.
-   Return true if the element is greater or equal than the threshold.  */
+   Returns true if the element is greater or equal than the threshold.  */
 typedef bool (*gl_setelement_threshold_fn) (const void *elt, const void *threshold);
 
 struct gl_oset_impl;
@@ -95,7 +100,7 @@ typedef const struct gl_oset_implementation * gl_oset_implementation_t;
 
 #if 0 /* Unless otherwise specified, these are defined inline below.  */
 
-/* Create an empty set.
+/* Creates an empty set.
    IMPLEMENTATION is one of GL_ARRAY_OSET, GL_AVLTREE_OSET, GL_RBTREE_OSET.
    COMPAR_FN is an element comparison function or NULL.
    DISPOSE_FN is an element disposal function or NULL.  */
@@ -103,48 +108,58 @@ typedef const struct gl_oset_implementation * gl_oset_implementation_t;
 extern gl_oset_t gl_oset_create_empty (gl_oset_implementation_t implementation,
                                        gl_setelement_compar_fn compar_fn,
                                        gl_setelement_dispose_fn dispose_fn);
-/* Likewise.  Return NULL upon out-of-memory.  */
+/* Likewise.  Returns NULL upon out-of-memory.  */
 extern gl_oset_t gl_oset_nx_create_empty (gl_oset_implementation_t implementation,
                                           gl_setelement_compar_fn compar_fn,
                                           gl_setelement_dispose_fn dispose_fn);
 
-/* Return the current number of elements in an ordered set.  */
+/* Returns the current number of elements in an ordered set.  */
 extern size_t gl_oset_size (gl_oset_t set);
 
-/* Search whether an element is already in the ordered set.
-   Return true if found, or false if not present in the set.  */
+/* Searches whether an element is already in the ordered set.
+   Returns true if found, or false if not present in the set.  */
 extern bool gl_oset_search (gl_oset_t set, const void *elt);
 
-/* Search the least element in the ordered set that compares greater or equal
+/* Searches the least element in the ordered set that compares greater or equal
    to the given THRESHOLD.  The representation of the THRESHOLD is defined
    by the THRESHOLD_FN.
-   Return true and store the found element in *ELTP if found, otherwise return
+   Returns true and stores the found element in *ELTP if found, otherwise returns
    false.  */
 extern bool gl_oset_search_atleast (gl_oset_t set,
                                     gl_setelement_threshold_fn threshold_fn,
                                     const void *threshold,
                                     const void **eltp);
 
-/* Add an element to an ordered set.
-   Return true if it was not already in the set and added, false otherwise.  */
+/* Adds an element to an ordered set.
+   Returns true if it was not already in the set and added, false otherwise.  */
 /* declared in gl_xoset.h */
 extern bool gl_oset_add (gl_oset_t set, const void *elt);
-/* Likewise.  Return -1 upon out-of-memory.  */
+/* Likewise.  Returns -1 upon out-of-memory.  */
 extern int gl_oset_nx_add (gl_oset_t set, const void *elt)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
-  ;
+  _GL_ATTRIBUTE_NODISCARD;
 
-/* Remove an element from an ordered set.
-   Return true if it was found and removed.  */
+/* Removes an element from an ordered set.
+   Returns true if it was found and removed.  */
 extern bool gl_oset_remove (gl_oset_t set, const void *elt);
 
-/* Free an entire ordered set.
-   (But this call does not free the elements of the set.)  */
+/* Invokes ACTION (ELT, ACTION_DATA) and updates the given ordered set if,
+   during this invocation, the attributes/properties of the element ELT change
+   in a way that influences the comparison function.
+   Warning: During the invocation of ACTION, the ordered set is inconsistent
+   and must not be accessed!
+   Returns 1 if the position of the element in the ordered set has changed as
+   a consequence, 0 if the element stayed at the same position, or -1 if it
+   collided with another element and was therefore removed.  */
+extern int gl_oset_update (gl_oset_t set, const void *elt,
+                           void (*action) (const void *elt, void *action_data),
+                           void *action_data);
+
+/* Frees an entire ordered set.
+   (But this call does not free the elements of the set.  It only invokes
+   the DISPOSE_FN on each of the elements of the set.)  */
 extern void gl_oset_free (gl_oset_t set);
 
-#endif /* End of inline and gl_xlist.h-defined functions.  */
+#endif /* End of inline and gl_xoset.h-defined functions.  */
 
 /* --------------------- gl_oset_iterator_t Data Type --------------------- */
 
@@ -167,17 +182,24 @@ typedef struct
 
 #if 0 /* These are defined inline below.  */
 
-/* Create an iterator traversing an ordered set.
+/* Creates an iterator traversing an ordered set.
    The set's contents must not be modified while the iterator is in use,
    except for removing the last returned element.  */
 extern gl_oset_iterator_t gl_oset_iterator (gl_oset_t set);
 
-/* If there is a next element, store the next element in *ELTP, advance the
-   iterator and return true.  Otherwise, return false.  */
+/* Creates an iterator traversing the tail of an ordered set, that comprises
+   the elements that compare greater or equal to the given THRESHOLD.  The
+   representation of the THRESHOLD is defined by the THRESHOLD_FN.  */
+extern gl_oset_iterator_t gl_oset_iterator_atleast (gl_oset_t set,
+                                                    gl_setelement_threshold_fn threshold_fn,
+                                                    const void *threshold);
+
+/* If there is a next element, stores the next element in *ELTP, advances the
+   iterator and returns true.  Otherwise, returns false.  */
 extern bool gl_oset_iterator_next (gl_oset_iterator_t *iterator,
                                    const void **eltp);
 
-/* Free an iterator.  */
+/* Frees an iterator.  */
 extern void gl_oset_iterator_free (gl_oset_iterator_t *iterator);
 
 #endif /* End of inline functions.  */
@@ -197,9 +219,15 @@ struct gl_oset_implementation
                           const void *threshold, const void **eltp);
   int (*nx_add) (gl_oset_t set, const void *elt);
   bool (*remove_elt) (gl_oset_t set, const void *elt);
+  int (*update) (gl_oset_t set, const void *elt,
+                 void (*action) (const void * /*elt*/, void * /*action_data*/),
+                 void *action_data);
   void (*oset_free) (gl_oset_t set);
   /* gl_oset_iterator_t functions.  */
   gl_oset_iterator_t (*iterator) (gl_oset_t set);
+  gl_oset_iterator_t (*iterator_atleast) (gl_oset_t set,
+                                          gl_setelement_threshold_fn threshold_fn,
+                                          const void *threshold);
   bool (*iterator_next) (gl_oset_iterator_t *iterator, const void **eltp);
   void (*iterator_free) (gl_oset_iterator_t *iterator);
 };
@@ -244,10 +272,7 @@ gl_oset_search_atleast (gl_oset_t set,
          ->search_atleast (set, threshold_fn, threshold, eltp);
 }
 
-GL_OSET_INLINE int
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-  __attribute__ ((__warn_unused_result__))
-#endif
+GL_OSET_INLINE _GL_ATTRIBUTE_NODISCARD int
 gl_oset_nx_add (gl_oset_t set, const void *elt)
 {
   return ((const struct gl_oset_impl_base *) set)->vtable->nx_add (set, elt);
@@ -260,6 +285,15 @@ gl_oset_remove (gl_oset_t set, const void *elt)
          ->remove_elt (set, elt);
 }
 
+GL_OSET_INLINE int
+gl_oset_update (gl_oset_t set, const void *elt,
+                void (*action) (const void * /*elt*/, void * /*action_data*/),
+                void *action_data)
+{
+  return ((const struct gl_oset_impl_base *) set)->vtable
+         ->update (set, elt, action, action_data);
+}
+
 GL_OSET_INLINE void
 gl_oset_free (gl_oset_t set)
 {
@@ -272,6 +306,15 @@ gl_oset_iterator (gl_oset_t set)
   return ((const struct gl_oset_impl_base *) set)->vtable->iterator (set);
 }
 
+GL_OSET_INLINE gl_oset_iterator_t
+gl_oset_iterator_atleast (gl_oset_t set,
+                          gl_setelement_threshold_fn threshold_fn,
+                          const void *threshold)
+{
+  return ((const struct gl_oset_impl_base *) set)->vtable
+         ->iterator_atleast (set, threshold_fn, threshold);
+}
+
 GL_OSET_INLINE bool
 gl_oset_iterator_next (gl_oset_iterator_t *iterator, const void **eltp)
 {
index 06824fc..87fd6ea 100644 (file)
@@ -1,5 +1,5 @@
 /* Abstract sequential list data type, with out-of-memory checking.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2009.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_XLIST_H
 #define _GL_XLIST_H
@@ -52,6 +52,8 @@ extern void gl_list_node_set_value (gl_list_t list, gl_list_node_t node,
                                     const void *elt);
 extern gl_list_node_t gl_list_set_at (gl_list_t list, size_t position,
                                       const void *elt);
+extern gl_list_node_t gl_list_set_first (gl_list_t list, const void *elt);
+extern gl_list_node_t gl_list_set_last (gl_list_t list, const void *elt);
 extern gl_list_node_t gl_list_add_first (gl_list_t list, const void *elt);
 extern gl_list_node_t gl_list_add_last (gl_list_t list, const void *elt);
 extern gl_list_node_t gl_list_add_before (gl_list_t list, gl_list_node_t node,
@@ -114,6 +116,24 @@ gl_list_set_at (gl_list_t list, size_t position, const void *elt)
 }
 
 GL_XLIST_INLINE gl_list_node_t
+gl_list_set_first (gl_list_t list, const void *elt)
+{
+  gl_list_node_t result = gl_list_nx_set_first (list, elt);
+  if (result == NULL)
+    xalloc_die ();
+  return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
+gl_list_set_last (gl_list_t list, const void *elt)
+{
+  gl_list_node_t result = gl_list_nx_set_last (list, elt);
+  if (result == NULL)
+    xalloc_die ();
+  return result;
+}
+
+GL_XLIST_INLINE gl_list_node_t
 gl_list_add_first (gl_list_t list, const void *elt)
 {
   gl_list_node_t result = gl_list_nx_add_first (list, elt);
index 3419197..a2c7930 100644 (file)
@@ -1,5 +1,5 @@
 /* Abstract ordered set data type, with out-of-memory checking.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2009.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_XOSET_H
 #define _GL_XOSET_H
index 935043b..83f7565 100644 (file)
@@ -1,5 +1,5 @@
 /* Locking in multithreaded situations.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.
-   Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
-   gthr-win32.h.  */
+   Based on GCC's gthr-posix.h, gthr-posix95.h.  */
 
 #include <config.h>
 
 
 /* ========================================================================= */
 
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+int
+glthread_lock_init (gl_lock_t *lock)
+{
+  if (mtx_init (&lock->mutex, mtx_plain) != thrd_success)
+    return ENOMEM;
+  lock->init_needed = 0;
+  return 0;
+}
+
+int
+glthread_lock_lock (gl_lock_t *lock)
+{
+  if (lock->init_needed)
+    call_once (&lock->init_once, lock->init_func);
+  if (mtx_lock (&lock->mutex) != thrd_success)
+    return EAGAIN;
+  return 0;
+}
+
+int
+glthread_lock_unlock (gl_lock_t *lock)
+{
+  if (lock->init_needed)
+    call_once (&lock->init_once, lock->init_func);
+  if (mtx_unlock (&lock->mutex) != thrd_success)
+    return EINVAL;
+  return 0;
+}
+
+int
+glthread_lock_destroy (gl_lock_t *lock)
+{
+  if (lock->init_needed)
+    call_once (&lock->init_once, lock->init_func);
+  mtx_destroy (&lock->mutex);
+  return 0;
+}
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+int
+glthread_rwlock_init (gl_rwlock_t *lock)
+{
+  if (mtx_init (&lock->lock, mtx_plain) != thrd_success
+      || cnd_init (&lock->waiting_readers) != thrd_success
+      || cnd_init (&lock->waiting_writers) != thrd_success)
+    return ENOMEM;
+  lock->waiting_writers_count = 0;
+  lock->runcount = 0;
+  lock->init_needed = 0;
+  return 0;
+}
+
+int
+glthread_rwlock_rdlock (gl_rwlock_t *lock)
+{
+  if (lock->init_needed)
+    call_once (&lock->init_once, lock->init_func);
+  if (mtx_lock (&lock->lock) != thrd_success)
+    return EAGAIN;
+  /* Test whether only readers are currently running, and whether the runcount
+     field will not overflow, and whether no writer is waiting.  The latter
+     condition is because POSIX recommends that "write locks shall take
+     precedence over read locks", to avoid "writer starvation".  */
+  while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+         waiting_readers.  */
+      if (cnd_wait (&lock->waiting_readers, &lock->lock) != thrd_success)
+        {
+          mtx_unlock (&lock->lock);
+          return EINVAL;
+        }
+    }
+  lock->runcount++;
+  if (mtx_unlock (&lock->lock) != thrd_success)
+    return EINVAL;
+  return 0;
+}
+
+int
+glthread_rwlock_wrlock (gl_rwlock_t *lock)
+{
+  if (lock->init_needed)
+    call_once (&lock->init_once, lock->init_func);
+  if (mtx_lock (&lock->lock) != thrd_success)
+    return EAGAIN;
+  /* Test whether no readers or writers are currently running.  */
+  while (!(lock->runcount == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+         waiting_writers.  */
+      lock->waiting_writers_count++;
+      if (cnd_wait (&lock->waiting_writers, &lock->lock) != thrd_success)
+        {
+          lock->waiting_writers_count--;
+          mtx_unlock (&lock->lock);
+          return EINVAL;
+        }
+      lock->waiting_writers_count--;
+    }
+  lock->runcount--; /* runcount becomes -1 */
+  if (mtx_unlock (&lock->lock) != thrd_success)
+    return EINVAL;
+  return 0;
+}
+
+int
+glthread_rwlock_unlock (gl_rwlock_t *lock)
+{
+  if (lock->init_needed)
+    call_once (&lock->init_once, lock->init_func);
+  if (mtx_lock (&lock->lock) != thrd_success)
+    return EAGAIN;
+  if (lock->runcount < 0)
+    {
+      /* Drop a writer lock.  */
+      if (!(lock->runcount == -1))
+        {
+          mtx_unlock (&lock->lock);
+          return EINVAL;
+        }
+      lock->runcount = 0;
+    }
+  else
+    {
+      /* Drop a reader lock.  */
+      if (!(lock->runcount > 0))
+        {
+          mtx_unlock (&lock->lock);
+          return EINVAL;
+        }
+      lock->runcount--;
+    }
+  if (lock->runcount == 0)
+    {
+      /* POSIX recommends that "write locks shall take precedence over read
+         locks", to avoid "writer starvation".  */
+      if (lock->waiting_writers_count > 0)
+        {
+          /* Wake up one of the waiting writers.  */
+          if (cnd_signal (&lock->waiting_writers) != thrd_success)
+            {
+              mtx_unlock (&lock->lock);
+              return EINVAL;
+            }
+        }
+      else
+        {
+          /* Wake up all waiting readers.  */
+          if (cnd_broadcast (&lock->waiting_readers) != thrd_success)
+            {
+              mtx_unlock (&lock->lock);
+              return EINVAL;
+            }
+        }
+    }
+  if (mtx_unlock (&lock->lock) != thrd_success)
+    return EINVAL;
+  return 0;
+}
+
+int
+glthread_rwlock_destroy (gl_rwlock_t *lock)
+{
+  if (lock->init_needed)
+    call_once (&lock->init_once, lock->init_func);
+  mtx_destroy (&lock->lock);
+  cnd_destroy (&lock->waiting_readers);
+  cnd_destroy (&lock->waiting_writers);
+  return 0;
+}
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+int
+glthread_recursive_lock_init (gl_recursive_lock_t *lock)
+{
+  if (mtx_init (&lock->mutex, mtx_plain | mtx_recursive) != thrd_success)
+    return ENOMEM;
+  lock->init_needed = 0;
+  return 0;
+}
+
+int
+glthread_recursive_lock_lock (gl_recursive_lock_t *lock)
+{
+  if (lock->init_needed)
+    call_once (&lock->init_once, lock->init_func);
+  if (mtx_lock (&lock->mutex) != thrd_success)
+    return EAGAIN;
+  return 0;
+}
+
+int
+glthread_recursive_lock_unlock (gl_recursive_lock_t *lock)
+{
+  if (lock->init_needed)
+    call_once (&lock->init_once, lock->init_func);
+  if (mtx_unlock (&lock->mutex) != thrd_success)
+    return EINVAL;
+  return 0;
+}
+
+int
+glthread_recursive_lock_destroy (gl_recursive_lock_t *lock)
+{
+  if (lock->init_needed)
+    call_once (&lock->init_once, lock->init_func);
+  mtx_destroy (&lock->mutex);
+  return 0;
+}
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+#endif
+
+/* ========================================================================= */
+
 #if USE_POSIX_THREADS
 
 /* -------------------------- gl_lock_t datatype -------------------------- */
 
 /* ------------------------- gl_rwlock_t datatype ------------------------- */
 
-# if HAVE_PTHREAD_RWLOCK
+# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1)))
+
+#  if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP
+
+#   if !HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+     /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
+
+int
+glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock)
+{
+  pthread_rwlockattr_t attributes;
+  int err;
 
-#  if !defined PTHREAD_RWLOCK_INITIALIZER
+  err = pthread_rwlockattr_init (&attributes);
+  if (err != 0)
+    return err;
+  /* Note: PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP is the only value that
+     causes the writer to be preferred. PTHREAD_RWLOCK_PREFER_WRITER_NP does not
+     do this; see
+     http://man7.org/linux/man-pages/man3/pthread_rwlockattr_setkind_np.3.html */
+  err = pthread_rwlockattr_setkind_np (&attributes,
+                                       PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP);
+  if (err == 0)
+    err = pthread_rwlock_init(lock, &attributes);
+  /* pthread_rwlockattr_destroy always returns 0.  It cannot influence the
+     return value.  */
+  pthread_rwlockattr_destroy (&attributes);
+  return err;
+}
+
+#   endif
+#  else
 
 int
 glthread_rwlock_init_multithreaded (gl_rwlock_t *lock)
@@ -152,11 +403,9 @@ glthread_rwlock_rdlock_multithreaded (gl_rwlock_t *lock)
   if (err != 0)
     return err;
   /* Test whether only readers are currently running, and whether the runcount
-     field will not overflow.  */
-  /* POSIX says: "It is implementation-defined whether the calling thread
-     acquires the lock when a writer does not hold the lock and there are
-     writers blocked on the lock."  Let's say, no: give the writers a higher
-     priority.  */
+     field will not overflow, and whether no writer is waiting.  The latter
+     condition is because POSIX recommends that "write locks shall take
+     precedence over read locks", to avoid "writer starvation".  */
   while (!(lock->runcount + 1 > 0 && lock->waiting_writers_count == 0))
     {
       /* This thread has to wait for a while.  Enqueue it among the
@@ -469,161 +718,25 @@ glthread_once_singlethreaded (pthread_once_t *once_control)
     return 0;
 }
 
-#endif
-
-/* ========================================================================= */
-
-#if USE_PTH_THREADS
-
-/* Use the GNU Pth threads library.  */
-
-/* -------------------------- gl_lock_t datatype -------------------------- */
-
-/* ------------------------- gl_rwlock_t datatype ------------------------- */
-
-/* --------------------- gl_recursive_lock_t datatype --------------------- */
-
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-static void
-glthread_once_call (void *arg)
-{
-  void (**gl_once_temp_addr) (void) = (void (**) (void)) arg;
-  void (*initfunction) (void) = *gl_once_temp_addr;
-  initfunction ();
-}
-
-int
-glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void))
-{
-  void (*temp) (void) = initfunction;
-  return (!pth_once (once_control, glthread_once_call, &temp) ? errno : 0);
-}
-
-int
-glthread_once_singlethreaded (pth_once_t *once_control)
-{
-  /* We know that pth_once_t is an integer type.  */
-  if (*once_control == PTH_ONCE_INIT)
-    {
-      /* First time use of once_control.  Invert the marker.  */
-      *once_control = ~ PTH_ONCE_INIT;
-      return 1;
-    }
-  else
-    return 0;
-}
-
-#endif
-
-/* ========================================================================= */
-
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library.  */
-
-/* -------------------------- gl_lock_t datatype -------------------------- */
-
-/* ------------------------- gl_rwlock_t datatype ------------------------- */
-
-/* --------------------- gl_recursive_lock_t datatype --------------------- */
+# if !(PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK)
 
 int
-glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock)
+glthread_once_multithreaded (pthread_once_t *once_control,
+                             void (*init_function) (void))
 {
-  int err;
-
-  err = mutex_init (&lock->mutex, USYNC_THREAD, NULL);
-  if (err != 0)
-    return err;
-  lock->owner = (thread_t) 0;
-  lock->depth = 0;
-  return 0;
-}
-
-int
-glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock)
-{
-  thread_t self = thr_self ();
-  if (lock->owner != self)
+  int err = pthread_once (once_control, init_function);
+  if (err == ENOSYS)
     {
-      int err;
-
-      err = mutex_lock (&lock->mutex);
-      if (err != 0)
-        return err;
-      lock->owner = self;
+      /* This happens on FreeBSD 11: The pthread_once function in libc returns
+         ENOSYS.  */
+      if (glthread_once_singlethreaded (once_control))
+        init_function ();
+      return 0;
     }
-  if (++(lock->depth) == 0) /* wraparound? */
-    {
-      lock->depth--;
-      return EAGAIN;
-    }
-  return 0;
+  return err;
 }
 
-int
-glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock)
-{
-  if (lock->owner != thr_self ())
-    return EPERM;
-  if (lock->depth == 0)
-    return EINVAL;
-  if (--(lock->depth) == 0)
-    {
-      lock->owner = (thread_t) 0;
-      return mutex_unlock (&lock->mutex);
-    }
-  else
-    return 0;
-}
-
-int
-glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock)
-{
-  if (lock->owner != (thread_t) 0)
-    return EBUSY;
-  return mutex_destroy (&lock->mutex);
-}
-
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-int
-glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void))
-{
-  if (!once_control->inited)
-    {
-      int err;
-
-      /* Use the mutex to guarantee that if another thread is already calling
-         the initfunction, this thread waits until it's finished.  */
-      err = mutex_lock (&once_control->mutex);
-      if (err != 0)
-        return err;
-      if (!once_control->inited)
-        {
-          once_control->inited = 1;
-          initfunction ();
-        }
-      return mutex_unlock (&once_control->mutex);
-    }
-  else
-    return 0;
-}
-
-int
-glthread_once_singlethreaded (gl_once_t *once_control)
-{
-  /* We know that gl_once_t contains an integer type.  */
-  if (!once_control->inited)
-    {
-      /* First time use of once_control.  Invert the marker.  */
-      once_control->inited = ~ 0;
-      return 1;
-    }
-  else
-    return 0;
-}
+# endif
 
 #endif
 
@@ -631,427 +744,6 @@ glthread_once_singlethreaded (gl_once_t *once_control)
 
 #if USE_WINDOWS_THREADS
 
-/* -------------------------- gl_lock_t datatype -------------------------- */
-
-void
-glthread_lock_init_func (gl_lock_t *lock)
-{
-  InitializeCriticalSection (&lock->lock);
-  lock->guard.done = 1;
-}
-
-int
-glthread_lock_lock_func (gl_lock_t *lock)
-{
-  if (!lock->guard.done)
-    {
-      if (InterlockedIncrement (&lock->guard.started) == 0)
-        /* This thread is the first one to need this lock.  Initialize it.  */
-        glthread_lock_init (lock);
-      else
-        /* Yield the CPU while waiting for another thread to finish
-           initializing this lock.  */
-        while (!lock->guard.done)
-          Sleep (0);
-    }
-  EnterCriticalSection (&lock->lock);
-  return 0;
-}
-
-int
-glthread_lock_unlock_func (gl_lock_t *lock)
-{
-  if (!lock->guard.done)
-    return EINVAL;
-  LeaveCriticalSection (&lock->lock);
-  return 0;
-}
-
-int
-glthread_lock_destroy_func (gl_lock_t *lock)
-{
-  if (!lock->guard.done)
-    return EINVAL;
-  DeleteCriticalSection (&lock->lock);
-  lock->guard.done = 0;
-  return 0;
-}
-
-/* ------------------------- gl_rwlock_t datatype ------------------------- */
-
-/* In this file, the waitqueues are implemented as circular arrays.  */
-#define gl_waitqueue_t gl_carray_waitqueue_t
-
-static void
-gl_waitqueue_init (gl_waitqueue_t *wq)
-{
-  wq->array = NULL;
-  wq->count = 0;
-  wq->alloc = 0;
-  wq->offset = 0;
-}
-
-/* Enqueues the current thread, represented by an event, in a wait queue.
-   Returns INVALID_HANDLE_VALUE if an allocation failure occurs.  */
-static HANDLE
-gl_waitqueue_add (gl_waitqueue_t *wq)
-{
-  HANDLE event;
-  unsigned int index;
-
-  if (wq->count == wq->alloc)
-    {
-      unsigned int new_alloc = 2 * wq->alloc + 1;
-      HANDLE *new_array =
-        (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
-      if (new_array == NULL)
-        /* No more memory.  */
-        return INVALID_HANDLE_VALUE;
-      /* Now is a good opportunity to rotate the array so that its contents
-         starts at offset 0.  */
-      if (wq->offset > 0)
-        {
-          unsigned int old_count = wq->count;
-          unsigned int old_alloc = wq->alloc;
-          unsigned int old_offset = wq->offset;
-          unsigned int i;
-          if (old_offset + old_count > old_alloc)
-            {
-              unsigned int limit = old_offset + old_count - old_alloc;
-              for (i = 0; i < limit; i++)
-                new_array[old_alloc + i] = new_array[i];
-            }
-          for (i = 0; i < old_count; i++)
-            new_array[i] = new_array[old_offset + i];
-          wq->offset = 0;
-        }
-      wq->array = new_array;
-      wq->alloc = new_alloc;
-    }
-  /* Whether the created event is a manual-reset one or an auto-reset one,
-     does not matter, since we will wait on it only once.  */
-  event = CreateEvent (NULL, TRUE, FALSE, NULL);
-  if (event == INVALID_HANDLE_VALUE)
-    /* No way to allocate an event.  */
-    return INVALID_HANDLE_VALUE;
-  index = wq->offset + wq->count;
-  if (index >= wq->alloc)
-    index -= wq->alloc;
-  wq->array[index] = event;
-  wq->count++;
-  return event;
-}
-
-/* Notifies the first thread from a wait queue and dequeues it.  */
-static void
-gl_waitqueue_notify_first (gl_waitqueue_t *wq)
-{
-  SetEvent (wq->array[wq->offset + 0]);
-  wq->offset++;
-  wq->count--;
-  if (wq->count == 0 || wq->offset == wq->alloc)
-    wq->offset = 0;
-}
-
-/* Notifies all threads from a wait queue and dequeues them all.  */
-static void
-gl_waitqueue_notify_all (gl_waitqueue_t *wq)
-{
-  unsigned int i;
-
-  for (i = 0; i < wq->count; i++)
-    {
-      unsigned int index = wq->offset + i;
-      if (index >= wq->alloc)
-        index -= wq->alloc;
-      SetEvent (wq->array[index]);
-    }
-  wq->count = 0;
-  wq->offset = 0;
-}
-
-void
-glthread_rwlock_init_func (gl_rwlock_t *lock)
-{
-  InitializeCriticalSection (&lock->lock);
-  gl_waitqueue_init (&lock->waiting_readers);
-  gl_waitqueue_init (&lock->waiting_writers);
-  lock->runcount = 0;
-  lock->guard.done = 1;
-}
-
-int
-glthread_rwlock_rdlock_func (gl_rwlock_t *lock)
-{
-  if (!lock->guard.done)
-    {
-      if (InterlockedIncrement (&lock->guard.started) == 0)
-        /* This thread is the first one to need this lock.  Initialize it.  */
-        glthread_rwlock_init (lock);
-      else
-        /* Yield the CPU while waiting for another thread to finish
-           initializing this lock.  */
-        while (!lock->guard.done)
-          Sleep (0);
-    }
-  EnterCriticalSection (&lock->lock);
-  /* Test whether only readers are currently running, and whether the runcount
-     field will not overflow.  */
-  if (!(lock->runcount + 1 > 0))
-    {
-      /* This thread has to wait for a while.  Enqueue it among the
-         waiting_readers.  */
-      HANDLE event = gl_waitqueue_add (&lock->waiting_readers);
-      if (event != INVALID_HANDLE_VALUE)
-        {
-          DWORD result;
-          LeaveCriticalSection (&lock->lock);
-          /* Wait until another thread signals this event.  */
-          result = WaitForSingleObject (event, INFINITE);
-          if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
-            abort ();
-          CloseHandle (event);
-          /* The thread which signalled the event already did the bookkeeping:
-             removed us from the waiting_readers, incremented lock->runcount.  */
-          if (!(lock->runcount > 0))
-            abort ();
-          return 0;
-        }
-      else
-        {
-          /* Allocation failure.  Weird.  */
-          do
-            {
-              LeaveCriticalSection (&lock->lock);
-              Sleep (1);
-              EnterCriticalSection (&lock->lock);
-            }
-          while (!(lock->runcount + 1 > 0));
-        }
-    }
-  lock->runcount++;
-  LeaveCriticalSection (&lock->lock);
-  return 0;
-}
-
-int
-glthread_rwlock_wrlock_func (gl_rwlock_t *lock)
-{
-  if (!lock->guard.done)
-    {
-      if (InterlockedIncrement (&lock->guard.started) == 0)
-        /* This thread is the first one to need this lock.  Initialize it.  */
-        glthread_rwlock_init (lock);
-      else
-        /* Yield the CPU while waiting for another thread to finish
-           initializing this lock.  */
-        while (!lock->guard.done)
-          Sleep (0);
-    }
-  EnterCriticalSection (&lock->lock);
-  /* Test whether no readers or writers are currently running.  */
-  if (!(lock->runcount == 0))
-    {
-      /* This thread has to wait for a while.  Enqueue it among the
-         waiting_writers.  */
-      HANDLE event = gl_waitqueue_add (&lock->waiting_writers);
-      if (event != INVALID_HANDLE_VALUE)
-        {
-          DWORD result;
-          LeaveCriticalSection (&lock->lock);
-          /* Wait until another thread signals this event.  */
-          result = WaitForSingleObject (event, INFINITE);
-          if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
-            abort ();
-          CloseHandle (event);
-          /* The thread which signalled the event already did the bookkeeping:
-             removed us from the waiting_writers, set lock->runcount = -1.  */
-          if (!(lock->runcount == -1))
-            abort ();
-          return 0;
-        }
-      else
-        {
-          /* Allocation failure.  Weird.  */
-          do
-            {
-              LeaveCriticalSection (&lock->lock);
-              Sleep (1);
-              EnterCriticalSection (&lock->lock);
-            }
-          while (!(lock->runcount == 0));
-        }
-    }
-  lock->runcount--; /* runcount becomes -1 */
-  LeaveCriticalSection (&lock->lock);
-  return 0;
-}
-
-int
-glthread_rwlock_unlock_func (gl_rwlock_t *lock)
-{
-  if (!lock->guard.done)
-    return EINVAL;
-  EnterCriticalSection (&lock->lock);
-  if (lock->runcount < 0)
-    {
-      /* Drop a writer lock.  */
-      if (!(lock->runcount == -1))
-        abort ();
-      lock->runcount = 0;
-    }
-  else
-    {
-      /* Drop a reader lock.  */
-      if (!(lock->runcount > 0))
-        {
-          LeaveCriticalSection (&lock->lock);
-          return EPERM;
-        }
-      lock->runcount--;
-    }
-  if (lock->runcount == 0)
-    {
-      /* POSIX recommends that "write locks shall take precedence over read
-         locks", to avoid "writer starvation".  */
-      if (lock->waiting_writers.count > 0)
-        {
-          /* Wake up one of the waiting writers.  */
-          lock->runcount--;
-          gl_waitqueue_notify_first (&lock->waiting_writers);
-        }
-      else
-        {
-          /* Wake up all waiting readers.  */
-          lock->runcount += lock->waiting_readers.count;
-          gl_waitqueue_notify_all (&lock->waiting_readers);
-        }
-    }
-  LeaveCriticalSection (&lock->lock);
-  return 0;
-}
-
-int
-glthread_rwlock_destroy_func (gl_rwlock_t *lock)
-{
-  if (!lock->guard.done)
-    return EINVAL;
-  if (lock->runcount != 0)
-    return EBUSY;
-  DeleteCriticalSection (&lock->lock);
-  if (lock->waiting_readers.array != NULL)
-    free (lock->waiting_readers.array);
-  if (lock->waiting_writers.array != NULL)
-    free (lock->waiting_writers.array);
-  lock->guard.done = 0;
-  return 0;
-}
-
-/* --------------------- gl_recursive_lock_t datatype --------------------- */
-
-void
-glthread_recursive_lock_init_func (gl_recursive_lock_t *lock)
-{
-  lock->owner = 0;
-  lock->depth = 0;
-  InitializeCriticalSection (&lock->lock);
-  lock->guard.done = 1;
-}
-
-int
-glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock)
-{
-  if (!lock->guard.done)
-    {
-      if (InterlockedIncrement (&lock->guard.started) == 0)
-        /* This thread is the first one to need this lock.  Initialize it.  */
-        glthread_recursive_lock_init (lock);
-      else
-        /* Yield the CPU while waiting for another thread to finish
-           initializing this lock.  */
-        while (!lock->guard.done)
-          Sleep (0);
-    }
-  {
-    DWORD self = GetCurrentThreadId ();
-    if (lock->owner != self)
-      {
-        EnterCriticalSection (&lock->lock);
-        lock->owner = self;
-      }
-    if (++(lock->depth) == 0) /* wraparound? */
-      {
-        lock->depth--;
-        return EAGAIN;
-      }
-  }
-  return 0;
-}
-
-int
-glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock)
-{
-  if (lock->owner != GetCurrentThreadId ())
-    return EPERM;
-  if (lock->depth == 0)
-    return EINVAL;
-  if (--(lock->depth) == 0)
-    {
-      lock->owner = 0;
-      LeaveCriticalSection (&lock->lock);
-    }
-  return 0;
-}
-
-int
-glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock)
-{
-  if (lock->owner != 0)
-    return EBUSY;
-  DeleteCriticalSection (&lock->lock);
-  lock->guard.done = 0;
-  return 0;
-}
-
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-void
-glthread_once_func (gl_once_t *once_control, void (*initfunction) (void))
-{
-  if (once_control->inited <= 0)
-    {
-      if (InterlockedIncrement (&once_control->started) == 0)
-        {
-          /* This thread is the first one to come to this once_control.  */
-          InitializeCriticalSection (&once_control->lock);
-          EnterCriticalSection (&once_control->lock);
-          once_control->inited = 0;
-          initfunction ();
-          once_control->inited = 1;
-          LeaveCriticalSection (&once_control->lock);
-        }
-      else
-        {
-          /* Undo last operation.  */
-          InterlockedDecrement (&once_control->started);
-          /* Some other thread has already started the initialization.
-             Yield the CPU while waiting for the other thread to finish
-             initializing and taking the lock.  */
-          while (once_control->inited < 0)
-            Sleep (0);
-          if (once_control->inited <= 0)
-            {
-              /* Take the lock.  This blocks until the other thread has
-                 finished calling the initfunction.  */
-              EnterCriticalSection (&once_control->lock);
-              LeaveCriticalSection (&once_control->lock);
-              if (!(once_control->inited > 0))
-                abort ();
-            }
-        }
-    }
-}
-
 #endif
 
 /* ========================================================================= */
index e64506b..fe43d6e 100644 (file)
@@ -1,5 +1,5 @@
 /* Locking in multithreaded situations.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.
-   Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h,
-   gthr-win32.h.  */
+   Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h.  */
 
 /* This file contains locking primitives for use with a given thread library.
    It does not contain primitives for creating threads or for other
 #include <errno.h>
 #include <stdlib.h>
 
+#if !defined c11_threads_in_use
+# if HAVE_THREADS_H && USE_POSIX_THREADS_WEAK
+#  include <threads.h>
+#  pragma weak thrd_exit
+#  define c11_threads_in_use() (thrd_exit != NULL)
+# else
+#  define c11_threads_in_use() 0
+# endif
+#endif
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* Use the ISO C threads library.  */
+
+# include <threads.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* -------------------------- gl_lock_t datatype -------------------------- */
+
+typedef struct
+        {
+          int volatile init_needed;
+          once_flag init_once;
+          void (*init_func) (void);
+          mtx_t mutex;
+        }
+        gl_lock_t;
+# define gl_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_lock_t NAME;
+# define gl_lock_define_initialized(STORAGECLASS, NAME) \
+    static void _atomic_init_##NAME (void);       \
+    STORAGECLASS gl_lock_t NAME =                 \
+      { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
+    static void _atomic_init_##NAME (void)        \
+    {                                             \
+      if (glthread_lock_init (&(NAME)))           \
+        abort ();                                 \
+    }
+extern int glthread_lock_init (gl_lock_t *lock);
+extern int glthread_lock_lock (gl_lock_t *lock);
+extern int glthread_lock_unlock (gl_lock_t *lock);
+extern int glthread_lock_destroy (gl_lock_t *lock);
+
+/* ------------------------- gl_rwlock_t datatype ------------------------- */
+
+typedef struct
+        {
+          int volatile init_needed;
+          once_flag init_once;
+          void (*init_func) (void);
+          mtx_t lock; /* protects the remaining fields */
+          cnd_t waiting_readers; /* waiting readers */
+          cnd_t waiting_writers; /* waiting writers */
+          unsigned int waiting_writers_count; /* number of waiting writers */
+          int runcount; /* number of readers running, or -1 when a writer runs */
+        }
+        gl_rwlock_t;
+# define gl_rwlock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_rwlock_t NAME;
+# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
+    static void _atomic_init_##NAME (void);       \
+    STORAGECLASS gl_rwlock_t NAME =               \
+      { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
+    static void _atomic_init_##NAME (void)        \
+    {                                             \
+      if (glthread_rwlock_init (&(NAME)))         \
+        abort ();                                 \
+    }
+extern int glthread_rwlock_init (gl_rwlock_t *lock);
+extern int glthread_rwlock_rdlock (gl_rwlock_t *lock);
+extern int glthread_rwlock_wrlock (gl_rwlock_t *lock);
+extern int glthread_rwlock_unlock (gl_rwlock_t *lock);
+extern int glthread_rwlock_destroy (gl_rwlock_t *lock);
+
+/* --------------------- gl_recursive_lock_t datatype --------------------- */
+
+typedef struct
+        {
+          int volatile init_needed;
+          once_flag init_once;
+          void (*init_func) (void);
+          mtx_t mutex;
+        }
+        gl_recursive_lock_t;
+# define gl_recursive_lock_define(STORAGECLASS, NAME) \
+    STORAGECLASS gl_recursive_lock_t NAME;
+# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
+    static void _atomic_init_##NAME (void);       \
+    STORAGECLASS gl_recursive_lock_t NAME =       \
+      { 1, ONCE_FLAG_INIT, _atomic_init_##NAME }; \
+    static void _atomic_init_##NAME (void)        \
+    {                                             \
+      if (glthread_recursive_lock_init (&(NAME))) \
+        abort ();                                 \
+    }
+extern int glthread_recursive_lock_init (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_lock (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_unlock (gl_recursive_lock_t *lock);
+extern int glthread_recursive_lock_destroy (gl_recursive_lock_t *lock);
+
+/* -------------------------- gl_once_t datatype -------------------------- */
+
+typedef once_flag gl_once_t;
+# define gl_once_define(STORAGECLASS, NAME) \
+    STORAGECLASS once_flag NAME = ONCE_FLAG_INIT;
+# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+    (call_once (ONCE_CONTROL, INITFUNCTION), 0)
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
 /* ========================================================================= */
 
 #if USE_POSIX_THREADS
@@ -139,13 +257,25 @@ extern int glthread_in_use (void);
 #  pragma weak pthread_mutexattr_init
 #  pragma weak pthread_mutexattr_settype
 #  pragma weak pthread_mutexattr_destroy
+#  pragma weak pthread_rwlockattr_init
+#  if __GNU_LIBRARY__ > 1
+#   pragma weak pthread_rwlockattr_setkind_np
+#  endif
+#  pragma weak pthread_rwlockattr_destroy
 #  ifndef pthread_self
 #   pragma weak pthread_self
 #  endif
 
 #  if !PTHREAD_IN_USE_DETECTION_HARD
-#   pragma weak pthread_cancel
-#   define pthread_in_use() (pthread_cancel != NULL)
+    /* Considering all platforms with USE_POSIX_THREADS_WEAK, only few symbols
+       can be used to determine whether libpthread is in use.  These are:
+         pthread_mutexattr_gettype
+         pthread_rwlockattr_destroy
+         pthread_rwlockattr_init
+     */
+#   pragma weak pthread_mutexattr_gettype
+#   define pthread_in_use() \
+      (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
 #  endif
 
 # else
@@ -176,19 +306,32 @@ typedef pthread_mutex_t gl_lock_t;
 
 /* ------------------------- gl_rwlock_t datatype ------------------------- */
 
-# if HAVE_PTHREAD_RWLOCK
+# if HAVE_PTHREAD_RWLOCK && (HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER || (defined PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP && (__GNU_LIBRARY__ > 1)))
 
-#  ifdef PTHREAD_RWLOCK_INITIALIZER
+#  if defined PTHREAD_RWLOCK_INITIALIZER || defined PTHREAD_RWLOCK_INITIALIZER_NP
 
 typedef pthread_rwlock_t gl_rwlock_t;
 #   define gl_rwlock_define(STORAGECLASS, NAME) \
       STORAGECLASS pthread_rwlock_t NAME;
 #   define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
       STORAGECLASS pthread_rwlock_t NAME = gl_rwlock_initializer;
-#   define gl_rwlock_initializer \
-      PTHREAD_RWLOCK_INITIALIZER
-#   define glthread_rwlock_init(LOCK) \
-      (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
+#   if HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+#    if defined PTHREAD_RWLOCK_INITIALIZER
+#     define gl_rwlock_initializer \
+        PTHREAD_RWLOCK_INITIALIZER
+#    else
+#     define gl_rwlock_initializer \
+        PTHREAD_RWLOCK_INITIALIZER_NP
+#    endif
+#    define glthread_rwlock_init(LOCK) \
+       (pthread_in_use () ? pthread_rwlock_init (LOCK, NULL) : 0)
+#   else /* glibc with bug https://sourceware.org/bugzilla/show_bug.cgi?id=13701 */
+#    define gl_rwlock_initializer \
+       PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP
+#    define glthread_rwlock_init(LOCK) \
+       (pthread_in_use () ? glthread_rwlock_init_for_glibc (LOCK) : 0)
+extern int glthread_rwlock_init_for_glibc (pthread_rwlock_t *lock);
+#   endif
 #   define glthread_rwlock_rdlock(LOCK) \
       (pthread_in_use () ? pthread_rwlock_rdlock (LOCK) : 0)
 #   define glthread_rwlock_wrlock(LOCK) \
@@ -362,248 +505,20 @@ extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *l
 typedef pthread_once_t gl_once_t;
 # define gl_once_define(STORAGECLASS, NAME) \
     STORAGECLASS pthread_once_t NAME = PTHREAD_ONCE_INIT;
-# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
-    (pthread_in_use ()                                                         \
-     ? pthread_once (ONCE_CONTROL, INITFUNCTION)                               \
-     : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
-extern int glthread_once_singlethreaded (pthread_once_t *once_control);
-
-# ifdef __cplusplus
-}
-# endif
-
-#endif
-
-/* ========================================================================= */
-
-#if USE_PTH_THREADS
-
-/* Use the GNU Pth threads library.  */
-
-# include <pth.h>
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-# if USE_PTH_THREADS_WEAK
-
-/* Use weak references to the GNU Pth threads library.  */
-
-#  pragma weak pth_mutex_init
-#  pragma weak pth_mutex_acquire
-#  pragma weak pth_mutex_release
-#  pragma weak pth_rwlock_init
-#  pragma weak pth_rwlock_acquire
-#  pragma weak pth_rwlock_release
-#  pragma weak pth_once
-
-#  pragma weak pth_cancel
-#  define pth_in_use() (pth_cancel != NULL)
-
+# if PTHREAD_IN_USE_DETECTION_HARD || USE_POSIX_THREADS_WEAK
+#  define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+     (pthread_in_use ()                                                        \
+      ? pthread_once (ONCE_CONTROL, INITFUNCTION)                              \
+      : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
 # else
-
-#  define pth_in_use() 1
-
+#  define glthread_once(ONCE_CONTROL, INITFUNCTION) \
+     (pthread_in_use ()                                                        \
+      ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION)               \
+      : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
+extern int glthread_once_multithreaded (pthread_once_t *once_control,
+                                        void (*init_function) (void));
 # endif
-
-/* -------------------------- gl_lock_t datatype -------------------------- */
-
-typedef pth_mutex_t gl_lock_t;
-# define gl_lock_define(STORAGECLASS, NAME) \
-    STORAGECLASS pth_mutex_t NAME;
-# define gl_lock_define_initialized(STORAGECLASS, NAME) \
-    STORAGECLASS pth_mutex_t NAME = gl_lock_initializer;
-# define gl_lock_initializer \
-    PTH_MUTEX_INIT
-# define glthread_lock_init(LOCK) \
-    (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
-# define glthread_lock_lock(LOCK) \
-    (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
-# define glthread_lock_unlock(LOCK) \
-    (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
-# define glthread_lock_destroy(LOCK) \
-    ((void)(LOCK), 0)
-
-/* ------------------------- gl_rwlock_t datatype ------------------------- */
-
-typedef pth_rwlock_t gl_rwlock_t;
-#  define gl_rwlock_define(STORAGECLASS, NAME) \
-     STORAGECLASS pth_rwlock_t NAME;
-#  define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
-     STORAGECLASS pth_rwlock_t NAME = gl_rwlock_initializer;
-#  define gl_rwlock_initializer \
-     PTH_RWLOCK_INIT
-#  define glthread_rwlock_init(LOCK) \
-     (pth_in_use () && !pth_rwlock_init (LOCK) ? errno : 0)
-#  define glthread_rwlock_rdlock(LOCK) \
-     (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RD, 0, NULL) ? errno : 0)
-#  define glthread_rwlock_wrlock(LOCK) \
-     (pth_in_use () && !pth_rwlock_acquire (LOCK, PTH_RWLOCK_RW, 0, NULL) ? errno : 0)
-#  define glthread_rwlock_unlock(LOCK) \
-     (pth_in_use () && !pth_rwlock_release (LOCK) ? errno : 0)
-#  define glthread_rwlock_destroy(LOCK) \
-     ((void)(LOCK), 0)
-
-/* --------------------- gl_recursive_lock_t datatype --------------------- */
-
-/* In Pth, mutexes are recursive by default.  */
-typedef pth_mutex_t gl_recursive_lock_t;
-#  define gl_recursive_lock_define(STORAGECLASS, NAME) \
-     STORAGECLASS pth_mutex_t NAME;
-#  define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
-     STORAGECLASS pth_mutex_t NAME = gl_recursive_lock_initializer;
-#  define gl_recursive_lock_initializer \
-     PTH_MUTEX_INIT
-#  define glthread_recursive_lock_init(LOCK) \
-     (pth_in_use () && !pth_mutex_init (LOCK) ? errno : 0)
-#  define glthread_recursive_lock_lock(LOCK) \
-     (pth_in_use () && !pth_mutex_acquire (LOCK, 0, NULL) ? errno : 0)
-#  define glthread_recursive_lock_unlock(LOCK) \
-     (pth_in_use () && !pth_mutex_release (LOCK) ? errno : 0)
-#  define glthread_recursive_lock_destroy(LOCK) \
-     ((void)(LOCK), 0)
-
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-typedef pth_once_t gl_once_t;
-# define gl_once_define(STORAGECLASS, NAME) \
-    STORAGECLASS pth_once_t NAME = PTH_ONCE_INIT;
-# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
-    (pth_in_use ()                                                             \
-     ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION)                \
-     : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
-extern int glthread_once_multithreaded (pth_once_t *once_control, void (*initfunction) (void));
-extern int glthread_once_singlethreaded (pth_once_t *once_control);
-
-# ifdef __cplusplus
-}
-# endif
-
-#endif
-
-/* ========================================================================= */
-
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library.  */
-
-# include <thread.h>
-# include <synch.h>
-
-# ifdef __cplusplus
-extern "C" {
-# endif
-
-# if USE_SOLARIS_THREADS_WEAK
-
-/* Use weak references to the old Solaris threads library.  */
-
-#  pragma weak mutex_init
-#  pragma weak mutex_lock
-#  pragma weak mutex_unlock
-#  pragma weak mutex_destroy
-#  pragma weak rwlock_init
-#  pragma weak rw_rdlock
-#  pragma weak rw_wrlock
-#  pragma weak rw_unlock
-#  pragma weak rwlock_destroy
-#  pragma weak thr_self
-
-#  pragma weak thr_suspend
-#  define thread_in_use() (thr_suspend != NULL)
-
-# else
-
-#  define thread_in_use() 1
-
-# endif
-
-/* -------------------------- gl_lock_t datatype -------------------------- */
-
-typedef mutex_t gl_lock_t;
-# define gl_lock_define(STORAGECLASS, NAME) \
-    STORAGECLASS mutex_t NAME;
-# define gl_lock_define_initialized(STORAGECLASS, NAME) \
-    STORAGECLASS mutex_t NAME = gl_lock_initializer;
-# define gl_lock_initializer \
-    DEFAULTMUTEX
-# define glthread_lock_init(LOCK) \
-    (thread_in_use () ? mutex_init (LOCK, USYNC_THREAD, NULL) : 0)
-# define glthread_lock_lock(LOCK) \
-    (thread_in_use () ? mutex_lock (LOCK) : 0)
-# define glthread_lock_unlock(LOCK) \
-    (thread_in_use () ? mutex_unlock (LOCK) : 0)
-# define glthread_lock_destroy(LOCK) \
-    (thread_in_use () ? mutex_destroy (LOCK) : 0)
-
-/* ------------------------- gl_rwlock_t datatype ------------------------- */
-
-typedef rwlock_t gl_rwlock_t;
-# define gl_rwlock_define(STORAGECLASS, NAME) \
-    STORAGECLASS rwlock_t NAME;
-# define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
-    STORAGECLASS rwlock_t NAME = gl_rwlock_initializer;
-# define gl_rwlock_initializer \
-    DEFAULTRWLOCK
-# define glthread_rwlock_init(LOCK) \
-    (thread_in_use () ? rwlock_init (LOCK, USYNC_THREAD, NULL) : 0)
-# define glthread_rwlock_rdlock(LOCK) \
-    (thread_in_use () ? rw_rdlock (LOCK) : 0)
-# define glthread_rwlock_wrlock(LOCK) \
-    (thread_in_use () ? rw_wrlock (LOCK) : 0)
-# define glthread_rwlock_unlock(LOCK) \
-    (thread_in_use () ? rw_unlock (LOCK) : 0)
-# define glthread_rwlock_destroy(LOCK) \
-    (thread_in_use () ? rwlock_destroy (LOCK) : 0)
-
-/* --------------------- gl_recursive_lock_t datatype --------------------- */
-
-/* Old Solaris threads did not have recursive locks.
-   We have to implement them ourselves.  */
-
-typedef struct
-        {
-          mutex_t mutex;
-          thread_t owner;
-          unsigned long depth;
-        }
-        gl_recursive_lock_t;
-# define gl_recursive_lock_define(STORAGECLASS, NAME) \
-    STORAGECLASS gl_recursive_lock_t NAME;
-# define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
-    STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
-# define gl_recursive_lock_initializer \
-    { DEFAULTMUTEX, (thread_t) 0, 0 }
-# define glthread_recursive_lock_init(LOCK) \
-    (thread_in_use () ? glthread_recursive_lock_init_multithreaded (LOCK) : 0)
-# define glthread_recursive_lock_lock(LOCK) \
-    (thread_in_use () ? glthread_recursive_lock_lock_multithreaded (LOCK) : 0)
-# define glthread_recursive_lock_unlock(LOCK) \
-    (thread_in_use () ? glthread_recursive_lock_unlock_multithreaded (LOCK) : 0)
-# define glthread_recursive_lock_destroy(LOCK) \
-    (thread_in_use () ? glthread_recursive_lock_destroy_multithreaded (LOCK) : 0)
-extern int glthread_recursive_lock_init_multithreaded (gl_recursive_lock_t *lock);
-extern int glthread_recursive_lock_lock_multithreaded (gl_recursive_lock_t *lock);
-extern int glthread_recursive_lock_unlock_multithreaded (gl_recursive_lock_t *lock);
-extern int glthread_recursive_lock_destroy_multithreaded (gl_recursive_lock_t *lock);
-
-/* -------------------------- gl_once_t datatype -------------------------- */
-
-typedef struct
-        {
-          volatile int inited;
-          mutex_t mutex;
-        }
-        gl_once_t;
-# define gl_once_define(STORAGECLASS, NAME) \
-    STORAGECLASS gl_once_t NAME = { 0, DEFAULTMUTEX };
-# define glthread_once(ONCE_CONTROL, INITFUNCTION) \
-    (thread_in_use ()                                                          \
-     ? glthread_once_multithreaded (ONCE_CONTROL, INITFUNCTION)                \
-     : (glthread_once_singlethreaded (ONCE_CONTROL) ? (INITFUNCTION (), 0) : 0))
-extern int glthread_once_multithreaded (gl_once_t *once_control, void (*initfunction) (void));
-extern int glthread_once_singlethreaded (gl_once_t *once_control);
+extern int glthread_once_singlethreaded (pthread_once_t *once_control);
 
 # ifdef __cplusplus
 }
@@ -618,6 +533,11 @@ extern int glthread_once_singlethreaded (gl_once_t *once_control);
 # define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
+# include "windows-mutex.h"
+# include "windows-rwlock.h"
+# include "windows-recmutex.h"
+# include "windows-once.h"
+
 # ifdef __cplusplus
 extern "C" {
 # endif
@@ -633,127 +553,69 @@ extern "C" {
 /* There is no way to statically initialize a CRITICAL_SECTION.  It needs
    to be done lazily, once only.  For this we need spinlocks.  */
 
-typedef struct { volatile int done; volatile long started; } gl_spinlock_t;
-
 /* -------------------------- gl_lock_t datatype -------------------------- */
 
-typedef struct
-        {
-          gl_spinlock_t guard; /* protects the initialization */
-          CRITICAL_SECTION lock;
-        }
-        gl_lock_t;
+typedef glwthread_mutex_t gl_lock_t;
 # define gl_lock_define(STORAGECLASS, NAME) \
     STORAGECLASS gl_lock_t NAME;
 # define gl_lock_define_initialized(STORAGECLASS, NAME) \
     STORAGECLASS gl_lock_t NAME = gl_lock_initializer;
 # define gl_lock_initializer \
-    { { 0, -1 } }
+    GLWTHREAD_MUTEX_INIT
 # define glthread_lock_init(LOCK) \
-    (glthread_lock_init_func (LOCK), 0)
+    (glwthread_mutex_init (LOCK), 0)
 # define glthread_lock_lock(LOCK) \
-    glthread_lock_lock_func (LOCK)
+    glwthread_mutex_lock (LOCK)
 # define glthread_lock_unlock(LOCK) \
-    glthread_lock_unlock_func (LOCK)
+    glwthread_mutex_unlock (LOCK)
 # define glthread_lock_destroy(LOCK) \
-    glthread_lock_destroy_func (LOCK)
-extern void glthread_lock_init_func (gl_lock_t *lock);
-extern int glthread_lock_lock_func (gl_lock_t *lock);
-extern int glthread_lock_unlock_func (gl_lock_t *lock);
-extern int glthread_lock_destroy_func (gl_lock_t *lock);
+    glwthread_mutex_destroy (LOCK)
 
 /* ------------------------- gl_rwlock_t datatype ------------------------- */
 
-/* It is impossible to implement read-write locks using plain locks, without
-   introducing an extra thread dedicated to managing read-write locks.
-   Therefore here we need to use the low-level Event type.  */
-
-typedef struct
-        {
-          HANDLE *array; /* array of waiting threads, each represented by an event */
-          unsigned int count; /* number of waiting threads */
-          unsigned int alloc; /* length of allocated array */
-          unsigned int offset; /* index of first waiting thread in array */
-        }
-        gl_carray_waitqueue_t;
-typedef struct
-        {
-          gl_spinlock_t guard; /* protects the initialization */
-          CRITICAL_SECTION lock; /* protects the remaining fields */
-          gl_carray_waitqueue_t waiting_readers; /* waiting readers */
-          gl_carray_waitqueue_t waiting_writers; /* waiting writers */
-          int runcount; /* number of readers running, or -1 when a writer runs */
-        }
-        gl_rwlock_t;
+typedef glwthread_rwlock_t gl_rwlock_t;
 # define gl_rwlock_define(STORAGECLASS, NAME) \
     STORAGECLASS gl_rwlock_t NAME;
 # define gl_rwlock_define_initialized(STORAGECLASS, NAME) \
     STORAGECLASS gl_rwlock_t NAME = gl_rwlock_initializer;
 # define gl_rwlock_initializer \
-    { { 0, -1 } }
+    GLWTHREAD_RWLOCK_INIT
 # define glthread_rwlock_init(LOCK) \
-    (glthread_rwlock_init_func (LOCK), 0)
+    (glwthread_rwlock_init (LOCK), 0)
 # define glthread_rwlock_rdlock(LOCK) \
-    glthread_rwlock_rdlock_func (LOCK)
+    glwthread_rwlock_rdlock (LOCK)
 # define glthread_rwlock_wrlock(LOCK) \
-    glthread_rwlock_wrlock_func (LOCK)
+    glwthread_rwlock_wrlock (LOCK)
 # define glthread_rwlock_unlock(LOCK) \
-    glthread_rwlock_unlock_func (LOCK)
+    glwthread_rwlock_unlock (LOCK)
 # define glthread_rwlock_destroy(LOCK) \
-    glthread_rwlock_destroy_func (LOCK)
-extern void glthread_rwlock_init_func (gl_rwlock_t *lock);
-extern int glthread_rwlock_rdlock_func (gl_rwlock_t *lock);
-extern int glthread_rwlock_wrlock_func (gl_rwlock_t *lock);
-extern int glthread_rwlock_unlock_func (gl_rwlock_t *lock);
-extern int glthread_rwlock_destroy_func (gl_rwlock_t *lock);
+    glwthread_rwlock_destroy (LOCK)
 
 /* --------------------- gl_recursive_lock_t datatype --------------------- */
 
-/* The native Windows documentation says that CRITICAL_SECTION already
-   implements a recursive lock.  But we need not rely on it: It's easy to
-   implement a recursive lock without this assumption.  */
-
-typedef struct
-        {
-          gl_spinlock_t guard; /* protects the initialization */
-          DWORD owner;
-          unsigned long depth;
-          CRITICAL_SECTION lock;
-        }
-        gl_recursive_lock_t;
+typedef glwthread_recmutex_t gl_recursive_lock_t;
 # define gl_recursive_lock_define(STORAGECLASS, NAME) \
     STORAGECLASS gl_recursive_lock_t NAME;
 # define gl_recursive_lock_define_initialized(STORAGECLASS, NAME) \
     STORAGECLASS gl_recursive_lock_t NAME = gl_recursive_lock_initializer;
 # define gl_recursive_lock_initializer \
-    { { 0, -1 }, 0, 0 }
+    GLWTHREAD_RECMUTEX_INIT
 # define glthread_recursive_lock_init(LOCK) \
-    (glthread_recursive_lock_init_func (LOCK), 0)
+    (glwthread_recmutex_init (LOCK), 0)
 # define glthread_recursive_lock_lock(LOCK) \
-    glthread_recursive_lock_lock_func (LOCK)
+    glwthread_recmutex_lock (LOCK)
 # define glthread_recursive_lock_unlock(LOCK) \
-    glthread_recursive_lock_unlock_func (LOCK)
+    glwthread_recmutex_unlock (LOCK)
 # define glthread_recursive_lock_destroy(LOCK) \
-    glthread_recursive_lock_destroy_func (LOCK)
-extern void glthread_recursive_lock_init_func (gl_recursive_lock_t *lock);
-extern int glthread_recursive_lock_lock_func (gl_recursive_lock_t *lock);
-extern int glthread_recursive_lock_unlock_func (gl_recursive_lock_t *lock);
-extern int glthread_recursive_lock_destroy_func (gl_recursive_lock_t *lock);
+    glwthread_recmutex_destroy (LOCK)
 
 /* -------------------------- gl_once_t datatype -------------------------- */
 
-typedef struct
-        {
-          volatile int inited;
-          volatile long started;
-          CRITICAL_SECTION lock;
-        }
-        gl_once_t;
+typedef glwthread_once_t gl_once_t;
 # define gl_once_define(STORAGECLASS, NAME) \
-    STORAGECLASS gl_once_t NAME = { -1, -1 };
+    STORAGECLASS gl_once_t NAME = GLWTHREAD_ONCE_INIT;
 # define glthread_once(ONCE_CONTROL, INITFUNCTION) \
-    (glthread_once_func (ONCE_CONTROL, INITFUNCTION), 0)
-extern void glthread_once_func (gl_once_t *once_control, void (*initfunction) (void));
+    (glwthread_once (ONCE_CONTROL, INITFUNCTION), 0)
 
 # ifdef __cplusplus
 }
@@ -763,7 +625,7 @@ extern void glthread_once_func (gl_once_t *once_control, void (*initfunction) (v
 
 /* ========================================================================= */
 
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
+#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)
 
 /* Provide dummy implementation if threads are not supported.  */
 
index be63713..373806e 100644 (file)
@@ -1,5 +1,5 @@
 /* Multithreading primitives.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
 
 
 /* ========================================================================= */
 
-#if USE_POSIX_THREADS
+#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS
 
 /* Use the POSIX threads library.  */
 
+# include <errno.h>
 # include <pthread.h>
 # include <stdlib.h>
 
 # if PTHREAD_IN_USE_DETECTION_HARD
 
+#  if defined __FreeBSD__ || defined __DragonFly__                 /* FreeBSD */
+
+/* Test using pthread_key_create.  */
+
+int
+glthread_in_use (void)
+{
+  static int tested;
+  static int result; /* 1: linked with -lpthread, 0: only with libc */
+
+  if (!tested)
+    {
+      pthread_key_t key;
+      int err = pthread_key_create (&key, NULL);
+
+      if (err == ENOSYS)
+        result = 0;
+      else
+        {
+          result = 1;
+          if (err == 0)
+            pthread_key_delete (key);
+        }
+      tested = 1;
+    }
+  return result;
+}
+
+#  else                                                     /* Solaris, HP-UX */
+
+/* Test using pthread_create.  */
+
 /* The function to be executed by a dummy thread.  */
 static void *
 dummy_thread_func (void *arg)
@@ -62,6 +95,8 @@ glthread_in_use (void)
   return result;
 }
 
+#  endif
+
 # endif
 
 #endif
index 7c1916a..4577596 100644 (file)
@@ -1,5 +1,5 @@
 /* Thread-local storage in multithreaded situations.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
 
 
 /* ========================================================================= */
 
-#if USE_POSIX_THREADS
-
-#endif
-
-/* ========================================================================= */
-
-#if USE_PTH_THREADS
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
 
 #endif
 
 /* ========================================================================= */
 
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library.  */
-
-/* ------------------------- gl_tls_key_t datatype ------------------------- */
-
-void *
-glthread_tls_get_multithreaded (thread_key_t key)
-{
-  void *value;
-
-  if (thr_getspecific (key, &value) != 0)
-    abort ();
-  return value;
-}
+#if USE_POSIX_THREADS
 
 #endif
 
index 63955a2..321b536 100644 (file)
@@ -1,5 +1,5 @@
 /* Thread-local storage in multithreaded situations.
-   Copyright (C) 2005, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
 
 #include <errno.h>
 #include <stdlib.h>
 
+#if !defined c11_threads_in_use
+# if HAVE_THREADS_H && USE_POSIX_THREADS_WEAK
+#  include <threads.h>
+#  pragma weak thrd_exit
+#  define c11_threads_in_use() (thrd_exit != NULL)
+# else
+#  define c11_threads_in_use() 0
+# endif
+#endif
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* Use the ISO C threads library.  */
+
+# include <threads.h>
+
+/* ------------------------- gl_tls_key_t datatype ------------------------- */
+
+typedef tss_t gl_tls_key_t;
+# define glthread_tls_key_init(KEY, DESTRUCTOR) \
+    (tss_create (KEY, DESTRUCTOR) != thrd_success ? EAGAIN : 0)
+# define gl_tls_get(NAME) \
+    tss_get (NAME)
+# define glthread_tls_set(KEY, POINTER) \
+    (tss_set (*(KEY), (POINTER)) != thrd_success ? ENOMEM : 0)
+# define glthread_tls_key_destroy(KEY) \
+    (tss_delete (*(KEY)), 0)
+
+#endif
+
 /* ========================================================================= */
 
 #if USE_POSIX_THREADS
@@ -76,8 +108,9 @@ extern int glthread_in_use (void);
 #  endif
 
 #  if !PTHREAD_IN_USE_DETECTION_HARD
-#   pragma weak pthread_cancel
-#   define pthread_in_use() (pthread_cancel != NULL)
+#   pragma weak pthread_mutexattr_gettype
+#   define pthread_in_use() \
+      (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
 #  endif
 
 # else
@@ -115,134 +148,30 @@ typedef union
 
 /* ========================================================================= */
 
-#if USE_PTH_THREADS
-
-/* Use the GNU Pth threads library.  */
-
-# include <pth.h>
-
-# if USE_PTH_THREADS_WEAK
-
-/* Use weak references to the GNU Pth threads library.  */
-
-#  pragma weak pth_key_create
-#  pragma weak pth_key_getdata
-#  pragma weak pth_key_setdata
-#  pragma weak pth_key_delete
-
-#  pragma weak pth_cancel
-#  define pth_in_use() (pth_cancel != NULL)
-
-# else
-
-#  define pth_in_use() 1
-
-# endif
-
-/* ------------------------- gl_tls_key_t datatype ------------------------- */
-
-typedef union
-        {
-          void *singlethread_value;
-          pth_key_t key;
-        }
-        gl_tls_key_t;
-# define glthread_tls_key_init(KEY, DESTRUCTOR) \
-    (pth_in_use ()                                             \
-     ? (!pth_key_create (&(KEY)->key, DESTRUCTOR) ? errno : 0) \
-     : ((KEY)->singlethread_value = NULL, 0))
-# define gl_tls_get(NAME) \
-    (pth_in_use ()                  \
-     ? pth_key_getdata ((NAME).key) \
-     : (NAME).singlethread_value)
-# define glthread_tls_set(KEY, POINTER) \
-    (pth_in_use ()                                            \
-     ? (!pth_key_setdata ((KEY)->key, (POINTER)) ? errno : 0) \
-     : ((KEY)->singlethread_value = (POINTER), 0))
-# define glthread_tls_key_destroy(KEY) \
-    (pth_in_use ()                                \
-     ? (!pth_key_delete ((KEY)->key) ? errno : 0) \
-     : 0)
-
-#endif
-
-/* ========================================================================= */
-
-#if USE_SOLARIS_THREADS
-
-/* Use the old Solaris threads library.  */
-
-# include <thread.h>
-
-# if USE_SOLARIS_THREADS_WEAK
-
-/* Use weak references to the old Solaris threads library.  */
-
-#  pragma weak thr_keycreate
-#  pragma weak thr_getspecific
-#  pragma weak thr_setspecific
-
-#  pragma weak thr_suspend
-#  define thread_in_use() (thr_suspend != NULL)
-
-# else
-
-#  define thread_in_use() 1
-
-# endif
-
-/* ------------------------- gl_tls_key_t datatype ------------------------- */
-
-typedef union
-        {
-          void *singlethread_value;
-          thread_key_t key;
-        }
-        gl_tls_key_t;
-# define glthread_tls_key_init(KEY, DESTRUCTOR) \
-    (thread_in_use ()                          \
-     ? thr_keycreate (&(KEY)->key, DESTRUCTOR) \
-     : ((KEY)->singlethread_value = NULL, 0))
-# define gl_tls_get(NAME) \
-    (thread_in_use ()                \
-     ? glthread_tls_get_multithreaded ((NAME).key) \
-     : (NAME).singlethread_value)
-extern void *glthread_tls_get_multithreaded (thread_key_t key);
-# define glthread_tls_set(KEY, POINTER) \
-    (thread_in_use ()                              \
-     ? thr_setspecific ((KEY)->key, (POINTER))     \
-     : ((KEY)->singlethread_value = (POINTER), 0))
-# define glthread_tls_key_destroy(KEY) \
-    /* Unsupported.  */ \
-    0
-
-#endif
-
-/* ========================================================================= */
-
 #if USE_WINDOWS_THREADS
 
 # define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
+# include "windows-tls.h"
+
 /* ------------------------- gl_tls_key_t datatype ------------------------- */
 
-typedef DWORD gl_tls_key_t;
+typedef glwthread_tls_key_t gl_tls_key_t;
 # define glthread_tls_key_init(KEY, DESTRUCTOR) \
-    /* The destructor is unsupported.  */    \
-    ((*(KEY) = TlsAlloc ()) == (DWORD)-1 ? EAGAIN : ((void) (DESTRUCTOR), 0))
+    glwthread_tls_key_create (KEY, DESTRUCTOR)
 # define gl_tls_get(NAME) \
     TlsGetValue (NAME)
 # define glthread_tls_set(KEY, POINTER) \
     (!TlsSetValue (*(KEY), POINTER) ? EINVAL : 0)
 # define glthread_tls_key_destroy(KEY) \
-    (!TlsFree (*(KEY)) ? EINVAL : 0)
+    glwthread_tls_key_delete (*(KEY))
 
 #endif
 
 /* ========================================================================= */
 
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WINDOWS_THREADS)
+#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)
 
 /* Provide dummy implementation if threads are not supported.  */
 
index 3346e0d..b01cd02 100644 (file)
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+# along with this file.  If not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License,
 # this file may be distributed as part of a program that
 # the same distribution terms as the rest of that program.
 #
 # Generated by gnulib-tool.
-# Reproduce by: gnulib-tool --import --local-dir=gl --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --with-c++-tests --avoid=lock-tests --avoid=tls-tests --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname do-release-commit-and-tag error execute fclose fdl-1.3 fflush filenamecat fopen fopen-safer fseeko gendocs getopt-gnu git-version-gen gitlog-to-changelog gnu-web-doc-update gnumakefile gnupload gpl-3.0 ignore-value intprops maintainer-makefile manywarnings memchr2 mkstemp obstack progname regex rename sigaction sigpipe spawn-pipe stdbool stdint stdlib-safer strsignal strstr strtod unlocked-io update-copyright vc-list-files verror version-etc version-etc-fsf wait-process xalloc xoset xprintf xvasprintf-posix
+# Reproduce by:
+# gnulib-tool --import --local-dir=gl \
+#  --lib=libm4 \
+#  --source-base=lib \
+#  --m4-base=m4 \
+#  --doc-base=doc \
+#  --tests-base=tests \
+#  --aux-dir=build-aux \
+#  --with-tests \
+#  --with-c++-tests \
+#  --makefile-name=gnulib.mk \
+#  --no-conditional-dependencies \
+#  --no-libtool \
+#  --macro-prefix=M4 \
+#  --avoid=getopt-posix-tests \
+#  --avoid=lock-tests \
+#  --avoid=tls-tests \
+#  announce-gen \
+#  assert \
+#  attribute \
+#  autobuild \
+#  avltree-oset \
+#  binary-io \
+#  c-ctype \
+#  c-stack \
+#  clean-temp \
+#  close-stream \
+#  closein \
+#  config-h \
+#  configmake \
+#  dirname \
+#  do-release-commit-and-tag \
+#  error \
+#  execute \
+#  fclose \
+#  fdl-1.3 \
+#  fflush \
+#  filenamecat \
+#  fopen-gnu \
+#  fopen-safer \
+#  fseeko \
+#  gendocs \
+#  getopt-gnu \
+#  gettext-h \
+#  git-version-gen \
+#  gitlog-to-changelog \
+#  gnu-web-doc-update \
+#  gnumakefile \
+#  gnupload \
+#  gpl-3.0 \
+#  ignore-value \
+#  intprops \
+#  maintainer-makefile \
+#  manywarnings \
+#  memchr2 \
+#  mkstemp \
+#  obstack \
+#  progname \
+#  propername \
+#  regex \
+#  rename \
+#  setlocale \
+#  sigaction \
+#  sigpipe \
+#  spawn-pipe \
+#  stdbool \
+#  stdint \
+#  stdlib-safer \
+#  strsignal \
+#  strstr \
+#  strtod \
+#  unlocked-io \
+#  update-copyright \
+#  vc-list-files \
+#  verify \
+#  verror \
+#  version-etc \
+#  version-etc-fsf \
+#  wait-process \
+#  xalloc \
+#  xoset \
+#  xprintf \
+#  xvasprintf-posix
 
 
 MOSTLYCLEANFILES += core *.stackdump
+# No GNU Make output.
 
 
 libm4_a_SOURCES =
@@ -37,10 +120,19 @@ EXTRA_libm4_a_SOURCES =
 # Use this preprocessor expression to decide whether #include_next works.
 # Do not rely on a 'configure'-time test for this, since the expression
 # might appear in an installed header, which is used by some other compiler.
-HAVE_INCLUDE_NEXT = (__GNUC__ || 60000000 <= __DECC_VER)
+HAVE_INCLUDE_NEXT = (__GNUC__ || __clang__ || 60000000 <= __DECC_VER)
 
 ## end   gnulib module absolute-header
 
+## begin gnulib module access
+
+
+EXTRA_DIST += access.c
+
+EXTRA_libm4_a_SOURCES += access.c
+
+## end   gnulib module access
+
 ## begin gnulib module alignof
 
 
@@ -58,7 +150,7 @@ if GL_GENERATE_ALLOCA_H
 alloca.h: alloca.in.h $(top_builddir)/config.status
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/alloca.in.h; \
+         sed -e 's|@''HAVE_ALLOCA_H''@|$(HAVE_ALLOCA_H)|g' < $(srcdir)/alloca.in.h; \
        } > $@-t && \
        mv -f $@-t $@
 else
@@ -78,18 +170,60 @@ EXTRA_DIST += $(top_srcdir)/build-aux/announce-gen
 
 ## end   gnulib module announce-gen
 
+## begin gnulib module assure
+
+
+EXTRA_DIST += assure.h
+
+## end   gnulib module assure
+
+## begin gnulib module asyncsafe-spin
+
+libm4_a_SOURCES += asyncsafe-spin.c
+
+EXTRA_DIST += asyncsafe-spin.h
+
+## end   gnulib module asyncsafe-spin
+
+## begin gnulib module at-internal
+
+libm4_a_SOURCES += openat-priv.h openat-proc.c
+
+## end   gnulib module at-internal
+
+## begin gnulib module attribute
+
+
+EXTRA_DIST += attribute.h
+
+## end   gnulib module attribute
+
 ## begin gnulib module avltree-oset
 
-libm4_a_SOURCES += gl_avltree_oset.h gl_avltree_oset.c gl_anytree_oset.h
+libm4_a_SOURCES += gl_avltree_oset.h gl_avltree_oset.c gl_avltree_ordered.h gl_anytree_oset.h
 
 ## end   gnulib module avltree-oset
 
+## begin gnulib module basename-lgpl
+
+libm4_a_SOURCES += basename-lgpl.c
+
+EXTRA_DIST += basename-lgpl.h
+
+## end   gnulib module basename-lgpl
+
 ## begin gnulib module binary-io
 
 libm4_a_SOURCES += binary-io.h binary-io.c
 
 ## end   gnulib module binary-io
 
+## begin gnulib module bitrotate
+
+libm4_a_SOURCES += bitrotate.h bitrotate.c
+
+## end   gnulib module bitrotate
+
 ## begin gnulib module btowc
 
 
@@ -124,6 +258,32 @@ EXTRA_DIST += c-strcaseeq.h
 
 ## end   gnulib module c-strcaseeq
 
+## begin gnulib module calloc-gnu
+
+
+EXTRA_DIST += calloc.c
+
+EXTRA_libm4_a_SOURCES += calloc.c
+
+## end   gnulib module calloc-gnu
+
+## begin gnulib module calloc-posix
+
+
+EXTRA_DIST += calloc.c
+
+EXTRA_libm4_a_SOURCES += calloc.c
+
+## end   gnulib module calloc-posix
+
+## begin gnulib module canonicalize
+
+libm4_a_SOURCES += canonicalize.c
+
+EXTRA_DIST += canonicalize.h
+
+## end   gnulib module canonicalize
+
 ## begin gnulib module canonicalize-lgpl
 
 
@@ -133,12 +293,29 @@ EXTRA_libm4_a_SOURCES += canonicalize-lgpl.c
 
 ## end   gnulib module canonicalize-lgpl
 
+## begin gnulib module chdir-long
+
+
+EXTRA_DIST += chdir-long.c chdir-long.h
+
+EXTRA_libm4_a_SOURCES += chdir-long.c
+
+## end   gnulib module chdir-long
+
 ## begin gnulib module clean-temp
 
 libm4_a_SOURCES += clean-temp.h clean-temp.c
 
 ## end   gnulib module clean-temp
 
+## begin gnulib module clean-temp-simple
+
+libm4_a_SOURCES += clean-temp-simple.h clean-temp-simple.c
+
+EXTRA_DIST += clean-temp-private.h
+
+## end   gnulib module clean-temp-simple
+
 ## begin gnulib module cloexec
 
 libm4_a_SOURCES += cloexec.c
@@ -164,6 +341,15 @@ EXTRA_DIST += close-stream.h
 
 ## end   gnulib module close-stream
 
+## begin gnulib module closedir
+
+
+EXTRA_DIST += closedir.c dirent-private.h
+
+EXTRA_libm4_a_SOURCES += closedir.c
+
+## end   gnulib module closedir
+
 ## begin gnulib module closein
 
 libm4_a_SOURCES += closein.c
@@ -180,6 +366,14 @@ EXTRA_DIST += closeout.h
 
 ## end   gnulib module closeout
 
+## begin gnulib module concat-filename
+
+libm4_a_SOURCES += concat-filename.c
+
+EXTRA_DIST += concat-filename.h
+
+## end   gnulib module concat-filename
+
 ## begin gnulib module configmake
 
 # Listed in the same order as the GNU makefile conventions, and
@@ -189,6 +383,9 @@ EXTRA_DIST += closeout.h
 configmake.h: Makefile
        $(AM_V_GEN)rm -f $@-t && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         echo '#if HAVE_WINSOCK2_H'; \
+         echo '# include <winsock2.h> /* avoid mingw pollution on DATADIR */'; \
+         echo '#endif'; \
          echo '#define PREFIX "$(prefix)"'; \
          echo '#define EXEC_PREFIX "$(exec_prefix)"'; \
          echo '#define BINDIR "$(bindir)"'; \
@@ -225,6 +422,63 @@ CLEANFILES += configmake.h configmake.h-t
 
 ## end   gnulib module configmake
 
+## begin gnulib module dirent
+
+BUILT_SOURCES += dirent.h
+
+# We need the following in order to create <dirent.h> when the system
+# doesn't have one that works with the given compiler.
+dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
+             -e 's/@''GNULIB_OPENDIR''@/$(GL_M4_GNULIB_OPENDIR)/g' \
+             -e 's/@''GNULIB_READDIR''@/$(GL_M4_GNULIB_READDIR)/g' \
+             -e 's/@''GNULIB_REWINDDIR''@/$(GL_M4_GNULIB_REWINDDIR)/g' \
+             -e 's/@''GNULIB_CLOSEDIR''@/$(GL_M4_GNULIB_CLOSEDIR)/g' \
+             -e 's/@''GNULIB_DIRFD''@/$(GL_M4_GNULIB_DIRFD)/g' \
+             -e 's/@''GNULIB_FDOPENDIR''@/$(GL_M4_GNULIB_FDOPENDIR)/g' \
+             -e 's/@''GNULIB_SCANDIR''@/$(GL_M4_GNULIB_SCANDIR)/g' \
+             -e 's/@''GNULIB_ALPHASORT''@/$(GL_M4_GNULIB_ALPHASORT)/g' \
+             -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
+             -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
+             -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
+             -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
+             -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
+             -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
+             -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
+             -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
+             -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
+             -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
+             -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
+             -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
+             -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/dirent.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += dirent.h dirent.h-t
+
+EXTRA_DIST += dirent.in.h
+
+## end   gnulib module dirent
+
+## begin gnulib module dirfd
+
+
+EXTRA_DIST += dirfd.c
+
+EXTRA_libm4_a_SOURCES += dirfd.c
+
+## end   gnulib module dirfd
+
 ## begin gnulib module dirname
 
 libm4_a_SOURCES += dirname.c basename.c
@@ -237,7 +491,7 @@ EXTRA_libm4_a_SOURCES += stripslash.c
 
 ## begin gnulib module dirname-lgpl
 
-libm4_a_SOURCES += dirname-lgpl.c basename-lgpl.c stripslash.c
+libm4_a_SOURCES += dirname-lgpl.c stripslash.c
 
 EXTRA_DIST += dirname.h
 
@@ -250,12 +504,14 @@ EXTRA_DIST += $(top_srcdir)/build-aux/do-release-commit-and-tag
 
 ## end   gnulib module do-release-commit-and-tag
 
-## begin gnulib module dosname
+## begin gnulib module dup
+
 
+EXTRA_DIST += dup.c
 
-EXTRA_DIST += dosname.h
+EXTRA_libm4_a_SOURCES += dup.c
 
-## end   gnulib module dosname
+## end   gnulib module dup
 
 ## begin gnulib module dup2
 
@@ -266,6 +522,23 @@ EXTRA_libm4_a_SOURCES += dup2.c
 
 ## end   gnulib module dup2
 
+## begin gnulib module dynarray
+
+libm4_a_SOURCES += malloc/dynarray_at_failure.c                 malloc/dynarray_emplace_enlarge.c                 malloc/dynarray_finalize.c                 malloc/dynarray_resize.c                 malloc/dynarray_resize_clear.c
+
+EXTRA_DIST += dynarray.h malloc/dynarray-skeleton.c malloc/dynarray.h
+
+EXTRA_libm4_a_SOURCES += malloc/dynarray-skeleton.c
+
+## end   gnulib module dynarray
+
+## begin gnulib module eloop-threshold
+
+
+EXTRA_DIST += eloop-threshold.h
+
+## end   gnulib module eloop-threshold
+
 ## begin gnulib module errno
 
 BUILT_SOURCES += $(ERRNO_H)
@@ -311,7 +584,7 @@ EXTRA_libm4_a_SOURCES += error.c
 
 ## begin gnulib module execute
 
-libm4_a_SOURCES += execute.h execute.c w32spawn.h
+libm4_a_SOURCES += execute.h execute.c
 
 ## end   gnulib module execute
 
@@ -329,6 +602,15 @@ libm4_a_SOURCES += fatal-signal.h fatal-signal.c
 
 ## end   gnulib module fatal-signal
 
+## begin gnulib module fchdir
+
+
+EXTRA_DIST += fchdir.c
+
+EXTRA_libm4_a_SOURCES += fchdir.c
+
+## end   gnulib module fchdir
+
 ## begin gnulib module fclose
 
 
@@ -361,12 +643,16 @@ fcntl.h: fcntl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_FCNTL_H''@|$(NEXT_FCNTL_H)|g' \
-             -e 's/@''GNULIB_FCNTL''@/$(GNULIB_FCNTL)/g' \
-             -e 's/@''GNULIB_NONBLOCKING''@/$(GNULIB_NONBLOCKING)/g' \
-             -e 's/@''GNULIB_OPEN''@/$(GNULIB_OPEN)/g' \
-             -e 's/@''GNULIB_OPENAT''@/$(GNULIB_OPENAT)/g' \
+             -e 's/@''GNULIB_CREAT''@/$(GL_M4_GNULIB_CREAT)/g' \
+             -e 's/@''GNULIB_FCNTL''@/$(GL_M4_GNULIB_FCNTL)/g' \
+             -e 's/@''GNULIB_NONBLOCKING''@/$(GL_M4_GNULIB_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_OPEN''@/$(GL_M4_GNULIB_OPEN)/g' \
+             -e 's/@''GNULIB_OPENAT''@/$(GL_M4_GNULIB_OPENAT)/g' \
+             -e 's/@''GNULIB_MDA_CREAT''@/$(GL_M4_GNULIB_MDA_CREAT)/g' \
+             -e 's/@''GNULIB_MDA_OPEN''@/$(GL_M4_GNULIB_MDA_OPEN)/g' \
              -e 's|@''HAVE_FCNTL''@|$(HAVE_FCNTL)|g' \
              -e 's|@''HAVE_OPENAT''@|$(HAVE_OPENAT)|g' \
+             -e 's|@''REPLACE_CREAT''@|$(REPLACE_CREAT)|g' \
              -e 's|@''REPLACE_FCNTL''@|$(REPLACE_FCNTL)|g' \
              -e 's|@''REPLACE_OPEN''@|$(REPLACE_OPEN)|g' \
              -e 's|@''REPLACE_OPENAT''@|$(REPLACE_OPENAT)|g' \
@@ -396,6 +682,15 @@ libm4_a_SOURCES += fd-safer-flag.c dup-safer-flag.c
 
 ## end   gnulib module fd-safer-flag
 
+## begin gnulib module fdopendir
+
+
+EXTRA_DIST += fdopendir.c
+
+EXTRA_libm4_a_SOURCES += fdopendir.c
+
+## end   gnulib module fdopendir
+
 ## begin gnulib module fflush
 
 
@@ -405,6 +700,21 @@ EXTRA_libm4_a_SOURCES += fflush.c
 
 ## end   gnulib module fflush
 
+## begin gnulib module file-set
+
+libm4_a_SOURCES += file-set.c
+
+EXTRA_DIST += file-set.h
+
+## end   gnulib module file-set
+
+## begin gnulib module filename
+
+
+EXTRA_DIST += filename.h
+
+## end   gnulib module filename
+
 ## begin gnulib module filenamecat
 
 libm4_a_SOURCES += filenamecat.c
@@ -419,6 +729,19 @@ EXTRA_DIST += filenamecat.h
 
 ## end   gnulib module filenamecat-lgpl
 
+## begin gnulib module findprog-in
+
+libm4_a_SOURCES += findprog.h findprog-in.c
+
+## end   gnulib module findprog-in
+
+## begin gnulib module flexmember
+
+
+EXTRA_DIST += flexmember.h
+
+## end   gnulib module flexmember
+
 ## begin gnulib module float
 
 BUILT_SOURCES += $(FLOAT_H)
@@ -459,6 +782,15 @@ EXTRA_libm4_a_SOURCES += fopen.c
 
 ## end   gnulib module fopen
 
+## begin gnulib module fopen-gnu
+
+
+EXTRA_DIST += fopen.c
+
+EXTRA_libm4_a_SOURCES += fopen.c
+
+## end   gnulib module fopen-gnu
+
 ## begin gnulib module fopen-safer
 
 libm4_a_SOURCES += fopen-safer.c
@@ -509,6 +841,15 @@ EXTRA_DIST += freading.h stdio-impl.h
 
 ## end   gnulib module freading
 
+## begin gnulib module free-posix
+
+
+EXTRA_DIST += free.c
+
+EXTRA_libm4_a_SOURCES += free.c
+
+## end   gnulib module free-posix
+
 ## begin gnulib module frexp-nolibm
 
 
@@ -548,12 +889,21 @@ EXTRA_libm4_a_SOURCES += fseeko.c
 ## begin gnulib module fstat
 
 
-EXTRA_DIST += fstat.c
+EXTRA_DIST += fstat.c stat-w32.c stat-w32.h
 
-EXTRA_libm4_a_SOURCES += fstat.c
+EXTRA_libm4_a_SOURCES += fstat.c stat-w32.c
 
 ## end   gnulib module fstat
 
+## begin gnulib module fstatat
+
+
+EXTRA_DIST += at-func.c fstatat.c
+
+EXTRA_libm4_a_SOURCES += at-func.c fstatat.c
+
+## end   gnulib module fstatat
+
 ## begin gnulib module ftell
 
 
@@ -579,6 +929,24 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gendocs.sh
 
 ## end   gnulib module gendocs
 
+## begin gnulib module getcwd
+
+
+EXTRA_DIST += getcwd.c
+
+EXTRA_libm4_a_SOURCES += getcwd.c
+
+## end   gnulib module getcwd
+
+## begin gnulib module getcwd-lgpl
+
+
+EXTRA_DIST += getcwd-lgpl.c
+
+EXTRA_libm4_a_SOURCES += getcwd-lgpl.c
+
+## end   gnulib module getcwd-lgpl
+
 ## begin gnulib module getdtablesize
 
 
@@ -590,7 +958,7 @@ EXTRA_libm4_a_SOURCES += getdtablesize.c
 
 ## begin gnulib module getopt-posix
 
-BUILT_SOURCES += $(GETOPT_H)
+BUILT_SOURCES += $(GETOPT_H) $(GETOPT_CDEFS_H)
 
 # We need the following in order to create <getopt.h> when the system
 # doesn't have one that works with the given compiler.
@@ -607,34 +975,52 @@ getopt.h: getopt.in.h $(top_builddir)/config.status $(ARG_NONNULL_H)
              < $(srcdir)/getopt.in.h; \
        } > $@-t && \
        mv -f $@-t $@
-MOSTLYCLEANFILES += getopt.h getopt.h-t
 
-EXTRA_DIST += getopt.c getopt.in.h getopt1.c getopt_int.h
+getopt-cdefs.h: getopt-cdefs.in.h $(top_builddir)/config.status
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+          sed -e 's|@''HAVE_SYS_CDEFS_H''@|$(HAVE_SYS_CDEFS_H)|g' \
+             < $(srcdir)/getopt-cdefs.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+
+MOSTLYCLEANFILES += getopt.h getopt.h-t getopt-cdefs.h getopt-cdefs.h-t
+
+EXTRA_DIST += getopt-cdefs.in.h getopt-core.h getopt-ext.h getopt-pfx-core.h getopt-pfx-ext.h getopt.c getopt.in.h getopt1.c getopt_int.h
 
 EXTRA_libm4_a_SOURCES += getopt.c getopt1.c
 
 ## end   gnulib module getopt-posix
 
+## begin gnulib module getpagesize
+
+
+EXTRA_DIST += getpagesize.c
+
+EXTRA_libm4_a_SOURCES += getpagesize.c
+
+## end   gnulib module getpagesize
+
 ## begin gnulib module getprogname
 
 libm4_a_SOURCES += getprogname.h getprogname.c
 
 ## end   gnulib module getprogname
 
-## begin gnulib module gettext-h
+## begin gnulib module getrandom
 
-libm4_a_SOURCES += gettext.h
 
-## end   gnulib module gettext-h
+EXTRA_DIST += getrandom.c
 
-## begin gnulib module gettimeofday
+EXTRA_libm4_a_SOURCES += getrandom.c
 
+## end   gnulib module getrandom
 
-EXTRA_DIST += gettimeofday.c
+## begin gnulib module gettext-h
 
-EXTRA_libm4_a_SOURCES += gettimeofday.c
+libm4_a_SOURCES += gettext.h
 
-## end   gnulib module gettimeofday
+## end   gnulib module gettext-h
 
 ## begin gnulib module git-version-gen
 
@@ -659,12 +1045,11 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gnu-web-doc-update
 
 ## begin gnulib module gnumakefile
 
+EXTRA_DIST += $(top_srcdir)/GNUmakefile
 distclean-local: clean-GNUmakefile
 clean-GNUmakefile:
        test '$(srcdir)' = . || rm -f $(top_builddir)/GNUmakefile
 
-EXTRA_DIST += $(top_srcdir)/GNUmakefile
-
 ## end   gnulib module gnumakefile
 
 ## begin gnulib module gnupload
@@ -674,6 +1059,15 @@ EXTRA_DIST += $(top_srcdir)/build-aux/gnupload
 
 ## end   gnulib module gnupload
 
+## begin gnulib module gperf
+
+GPERF = gperf
+V_GPERF = $(V_GPERF_@AM_V@)
+V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@)
+V_GPERF_0 = @echo "  GPERF   " $@;
+
+## end   gnulib module gperf
+
 ## begin gnulib module hard-locale
 
 libm4_a_SOURCES += hard-locale.c
@@ -682,6 +1076,28 @@ EXTRA_DIST += hard-locale.h
 
 ## end   gnulib module hard-locale
 
+## begin gnulib module hash
+
+libm4_a_SOURCES += hash.c
+
+EXTRA_DIST += hash.h
+
+## end   gnulib module hash
+
+## begin gnulib module hash-pjw
+
+libm4_a_SOURCES += hash-pjw.h hash-pjw.c
+
+## end   gnulib module hash-pjw
+
+## begin gnulib module hash-triple-simple
+
+libm4_a_SOURCES += hash-triple-simple.c
+
+EXTRA_DIST += hash-triple.h
+
+## end   gnulib module hash-triple-simple
+
 ## begin gnulib module havelib
 
 
@@ -689,6 +1105,79 @@ EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
 
 ## end   gnulib module havelib
 
+## begin gnulib module iconv-h
+
+BUILT_SOURCES += $(ICONV_H)
+
+# We need the following in order to create <iconv.h> when the system
+# doesn't have one that works with the given compiler.
+if GL_GENERATE_ICONV_H
+iconv.h: iconv.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */' && \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_ICONV_H''@|$(NEXT_ICONV_H)|g' \
+             -e 's/@''GNULIB_ICONV''@/$(GL_M4_GNULIB_ICONV)/g' \
+             -e 's|@''ICONV_CONST''@|$(ICONV_CONST)|g' \
+             -e 's|@''REPLACE_ICONV''@|$(REPLACE_ICONV)|g' \
+             -e 's|@''REPLACE_ICONV_OPEN''@|$(REPLACE_ICONV_OPEN)|g' \
+             -e 's|@''REPLACE_ICONV_UTF''@|$(REPLACE_ICONV_UTF)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/iconv.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+else
+iconv.h: $(top_builddir)/config.status
+       rm -f $@
+endif
+MOSTLYCLEANFILES += iconv.h iconv.h-t
+
+EXTRA_DIST += iconv.in.h
+
+## end   gnulib module iconv-h
+
+## begin gnulib module iconv_open
+
+$(srcdir)/iconv_open-aix.h: $(srcdir)/iconv_open-aix.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-aix.gperf > $(srcdir)/iconv_open-aix.h-t && \
+       mv $(srcdir)/iconv_open-aix.h-t $(srcdir)/iconv_open-aix.h
+$(srcdir)/iconv_open-hpux.h: $(srcdir)/iconv_open-hpux.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-hpux.gperf > $(srcdir)/iconv_open-hpux.h-t && \
+       mv $(srcdir)/iconv_open-hpux.h-t $(srcdir)/iconv_open-hpux.h
+$(srcdir)/iconv_open-irix.h: $(srcdir)/iconv_open-irix.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-irix.gperf > $(srcdir)/iconv_open-irix.h-t && \
+       mv $(srcdir)/iconv_open-irix.h-t $(srcdir)/iconv_open-irix.h
+$(srcdir)/iconv_open-osf.h: $(srcdir)/iconv_open-osf.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-osf.gperf > $(srcdir)/iconv_open-osf.h-t && \
+       mv $(srcdir)/iconv_open-osf.h-t $(srcdir)/iconv_open-osf.h
+$(srcdir)/iconv_open-solaris.h: $(srcdir)/iconv_open-solaris.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-solaris.gperf > $(srcdir)/iconv_open-solaris.h-t && \
+       mv $(srcdir)/iconv_open-solaris.h-t $(srcdir)/iconv_open-solaris.h
+$(srcdir)/iconv_open-zos.h: $(srcdir)/iconv_open-zos.gperf
+       $(V_GPERF)$(GPERF) -m 10 $(srcdir)/iconv_open-zos.gperf > $(srcdir)/iconv_open-zos.h-t && \
+       mv $(srcdir)/iconv_open-zos.h-t $(srcdir)/iconv_open-zos.h
+BUILT_SOURCES        += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h iconv_open-zos.h
+MOSTLYCLEANFILES     += iconv_open-aix.h-t iconv_open-hpux.h-t iconv_open-irix.h-t iconv_open-osf.h-t iconv_open-solaris.h-t iconv_open-zos.h-t
+MAINTAINERCLEANFILES += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h iconv_open-zos.h
+EXTRA_DIST           += iconv_open-aix.h iconv_open-hpux.h iconv_open-irix.h iconv_open-osf.h iconv_open-solaris.h iconv_open-zos.h
+
+EXTRA_DIST += iconv.c iconv_close.c iconv_open-aix.gperf iconv_open-hpux.gperf iconv_open-irix.gperf iconv_open-osf.gperf iconv_open-solaris.gperf iconv_open-zos.gperf iconv_open.c
+
+EXTRA_libm4_a_SOURCES += iconv.c iconv_close.c iconv_open.c
+
+## end   gnulib module iconv_open
+
+## begin gnulib module idx
+
+libm4_a_SOURCES += idx.h
+
+## end   gnulib module idx
+
 ## begin gnulib module ignore-value
 
 
@@ -703,6 +1192,49 @@ EXTRA_DIST += intprops.h
 
 ## end   gnulib module intprops
 
+## begin gnulib module inttypes-incomplete
+
+BUILT_SOURCES += inttypes.h
+
+# We need the following in order to create <inttypes.h> when the system
+# doesn't have one that works with the given compiler.
+inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \
+             -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
+             -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
+             -e 's/@''GNULIB_IMAXABS''@/$(GL_M4_GNULIB_IMAXABS)/g' \
+             -e 's/@''GNULIB_IMAXDIV''@/$(GL_M4_GNULIB_IMAXDIV)/g' \
+             -e 's/@''GNULIB_STRTOIMAX''@/$(GL_M4_GNULIB_STRTOIMAX)/g' \
+             -e 's/@''GNULIB_STRTOUMAX''@/$(GL_M4_GNULIB_STRTOUMAX)/g' \
+             -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \
+             -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
+             -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
+             -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
+             -e 's/@''HAVE_IMAXDIV_T''@/$(HAVE_IMAXDIV_T)/g' \
+             -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
+             -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
+             -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
+             -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
+             -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
+             -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/inttypes.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += inttypes.h inttypes.h-t
+
+EXTRA_DIST += inttypes.in.h
+
+## end   gnulib module inttypes-incomplete
+
 ## begin gnulib module isnand-nolibm
 
 
@@ -730,6 +1262,33 @@ EXTRA_libm4_a_SOURCES += isnan.c isnanl.c
 
 ## end   gnulib module isnanl-nolibm
 
+## begin gnulib module iswblank
+
+
+EXTRA_DIST += iswblank.c
+
+EXTRA_libm4_a_SOURCES += iswblank.c
+
+## end   gnulib module iswblank
+
+## begin gnulib module iswdigit
+
+
+EXTRA_DIST += iswdigit.c
+
+EXTRA_libm4_a_SOURCES += iswdigit.c
+
+## end   gnulib module iswdigit
+
+## begin gnulib module iswxdigit
+
+
+EXTRA_DIST += iswxdigit.c
+
+EXTRA_libm4_a_SOURCES += iswxdigit.c
+
+## end   gnulib module iswxdigit
+
 ## begin gnulib module langinfo
 
 BUILT_SOURCES += langinfo.h
@@ -745,9 +1304,10 @@ langinfo.h: langinfo.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_LANGINFO_H''@|$(NEXT_LANGINFO_H)|g' \
-             -e 's/@''GNULIB_NL_LANGINFO''@/$(GNULIB_NL_LANGINFO)/g' \
+             -e 's/@''GNULIB_NL_LANGINFO''@/$(GL_M4_GNULIB_NL_LANGINFO)/g' \
              -e 's|@''HAVE_LANGINFO_CODESET''@|$(HAVE_LANGINFO_CODESET)|g' \
              -e 's|@''HAVE_LANGINFO_T_FMT_AMPM''@|$(HAVE_LANGINFO_T_FMT_AMPM)|g' \
+             -e 's|@''HAVE_LANGINFO_ALTMON''@|$(HAVE_LANGINFO_ALTMON)|g' \
              -e 's|@''HAVE_LANGINFO_ERA''@|$(HAVE_LANGINFO_ERA)|g' \
              -e 's|@''HAVE_LANGINFO_YESEXPR''@|$(HAVE_LANGINFO_YESEXPR)|g' \
              -e 's|@''HAVE_NL_LANGINFO''@|$(HAVE_NL_LANGINFO)|g' \
@@ -763,6 +1323,13 @@ EXTRA_DIST += langinfo.in.h
 
 ## end   gnulib module langinfo
 
+## begin gnulib module libc-config
+
+
+EXTRA_DIST += cdefs.h libc-config.h
+
+## end   gnulib module libc-config
+
 ## begin gnulib module limits-h
 
 BUILT_SOURCES += $(LIMITS_H)
@@ -791,9 +1358,15 @@ EXTRA_DIST += limits.in.h
 
 ## end   gnulib module limits-h
 
+## begin gnulib module linked-list
+
+libm4_a_SOURCES += gl_linked_list.h gl_linked_list.c gl_anylinked_list1.h gl_anylinked_list2.h
+
+## end   gnulib module linked-list
+
 ## begin gnulib module linkedhash-list
 
-libm4_a_SOURCES += gl_linkedhash_list.h gl_linkedhash_list.c gl_anyhash_list1.h gl_anyhash_list2.h gl_anylinked_list1.h gl_anylinked_list2.h
+libm4_a_SOURCES += gl_linkedhash_list.h gl_linkedhash_list.c gl_anyhash1.h gl_anyhash2.h gl_anyhash_primes.h gl_anylinked_list1.h gl_anylinked_list2.h
 
 ## end   gnulib module linkedhash-list
 
@@ -805,75 +1378,9 @@ libm4_a_SOURCES += gl_list.h gl_list.c
 
 ## begin gnulib module localcharset
 
-libm4_a_SOURCES += localcharset.h localcharset.c
-
-# We need the following in order to install a simple file in $(libdir)
-# which is shared with other installed packages. We use a list of referencing
-# packages so that "make uninstall" will remove the file if and only if it
-# is not used by another installed package.
-# On systems with glibc-2.1 or newer, the file is redundant, therefore we
-# avoid installing it.
-
-all-local: charset.alias ref-add.sed ref-del.sed
-
-charset_alias = $(DESTDIR)$(libdir)/charset.alias
-charset_tmp = $(DESTDIR)$(libdir)/charset.tmp
-install-exec-local: install-exec-localcharset
-install-exec-localcharset: all-local
-       if test $(GLIBC21) = no; then \
-         case '$(host_os)' in \
-           darwin[56]*) \
-             need_charset_alias=true ;; \
-           darwin* | cygwin* | mingw* | pw32* | cegcc*) \
-             need_charset_alias=false ;; \
-           *) \
-             need_charset_alias=true ;; \
-         esac ; \
-       else \
-         need_charset_alias=false ; \
-       fi ; \
-       if $$need_charset_alias; then \
-         $(mkinstalldirs) $(DESTDIR)$(libdir) ; \
-       fi ; \
-       if test -f $(charset_alias); then \
-         sed -f ref-add.sed $(charset_alias) > $(charset_tmp) ; \
-         $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
-         rm -f $(charset_tmp) ; \
-       else \
-         if $$need_charset_alias; then \
-           sed -f ref-add.sed charset.alias > $(charset_tmp) ; \
-           $(INSTALL_DATA) $(charset_tmp) $(charset_alias) ; \
-           rm -f $(charset_tmp) ; \
-         fi ; \
-       fi
-
-uninstall-local: uninstall-localcharset
-uninstall-localcharset: all-local
-       if test -f $(charset_alias); then \
-         sed -f ref-del.sed $(charset_alias) > $(charset_tmp); \
-         if grep '^# Packages using this file: $$' $(charset_tmp) \
-             > /dev/null; then \
-           rm -f $(charset_alias); \
-         else \
-           $(INSTALL_DATA) $(charset_tmp) $(charset_alias); \
-         fi; \
-         rm -f $(charset_tmp); \
-       fi
-
-charset.alias: config.charset
-       $(AM_V_GEN)rm -f t-$@ $@ && \
-       $(SHELL) $(srcdir)/config.charset '$(host)' > t-$@ && \
-       mv t-$@ $@
-
-SUFFIXES += .sed .sin
-.sin.sed:
-       $(AM_V_GEN)rm -f t-$@ $@ && \
-       sed -e '/^#/d' -e 's/@''PACKAGE''@/$(PACKAGE)/g' $< > t-$@ && \
-       mv t-$@ $@
+libm4_a_SOURCES += localcharset.c
 
-CLEANFILES += charset.alias ref-add.sed ref-del.sed
-
-EXTRA_DIST += config.charset ref-add.sin ref-del.sin
+EXTRA_DIST += localcharset.h
 
 ## end   gnulib module localcharset
 
@@ -891,15 +1398,22 @@ locale.h: locale.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_LOCALE_H''@|$(NEXT_LOCALE_H)|g' \
-             -e 's/@''GNULIB_LOCALECONV''@/$(GNULIB_LOCALECONV)/g' \
-             -e 's/@''GNULIB_SETLOCALE''@/$(GNULIB_SETLOCALE)/g' \
-             -e 's/@''GNULIB_DUPLOCALE''@/$(GNULIB_DUPLOCALE)/g' \
+             -e 's/@''GNULIB_LOCALECONV''@/$(GL_M4_GNULIB_LOCALECONV)/g' \
+             -e 's/@''GNULIB_SETLOCALE''@/$(GL_M4_GNULIB_SETLOCALE)/g' \
+             -e 's/@''GNULIB_SETLOCALE_NULL''@/$(GL_M4_GNULIB_SETLOCALE_NULL)/g' \
+             -e 's/@''GNULIB_DUPLOCALE''@/$(GL_M4_GNULIB_DUPLOCALE)/g' \
+             -e 's/@''GNULIB_LOCALENAME''@/$(GL_M4_GNULIB_LOCALENAME)/g' \
+             -e 's|@''HAVE_NEWLOCALE''@|$(HAVE_NEWLOCALE)|g' \
              -e 's|@''HAVE_DUPLOCALE''@|$(HAVE_DUPLOCALE)|g' \
+             -e 's|@''HAVE_FREELOCALE''@|$(HAVE_FREELOCALE)|g' \
              -e 's|@''HAVE_XLOCALE_H''@|$(HAVE_XLOCALE_H)|g' \
              -e 's|@''REPLACE_LOCALECONV''@|$(REPLACE_LOCALECONV)|g' \
              -e 's|@''REPLACE_SETLOCALE''@|$(REPLACE_SETLOCALE)|g' \
+             -e 's|@''REPLACE_NEWLOCALE''@|$(REPLACE_NEWLOCALE)|g' \
              -e 's|@''REPLACE_DUPLOCALE''@|$(REPLACE_DUPLOCALE)|g' \
+             -e 's|@''REPLACE_FREELOCALE''@|$(REPLACE_FREELOCALE)|g' \
              -e 's|@''REPLACE_STRUCT_LCONV''@|$(REPLACE_STRUCT_LCONV)|g' \
+             -e 's|@''LOCALENAME_ENHANCE_LOCALE_FUNCS''@|$(LOCALENAME_ENHANCE_LOCALE_FUNCS)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
@@ -921,6 +1435,14 @@ EXTRA_libm4_a_SOURCES += localeconv.c
 
 ## end   gnulib module localeconv
 
+## begin gnulib module localename
+
+libm4_a_SOURCES += localename.c localename-table.c
+
+EXTRA_DIST += localename-table.h localename.h
+
+## end   gnulib module localename
+
 ## begin gnulib module lock
 
 libm4_a_SOURCES += glthread/lock.h glthread/lock.c
@@ -951,6 +1473,15 @@ EXTRA_DIST += $(top_srcdir)/maint.mk
 
 ## end   gnulib module maintainer-makefile
 
+## begin gnulib module malloc-gnu
+
+
+EXTRA_DIST += malloc.c
+
+EXTRA_libm4_a_SOURCES += malloc.c
+
+## end   gnulib module malloc-gnu
+
 ## begin gnulib module malloc-posix
 
 
@@ -964,7 +1495,7 @@ EXTRA_libm4_a_SOURCES += malloc.c
 
 libm4_a_SOURCES += malloca.c
 
-EXTRA_DIST += malloca.h malloca.valgrind
+EXTRA_DIST += malloca.h
 
 ## end   gnulib module malloca
 
@@ -983,102 +1514,108 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_AS_FIRST_DIRECTIVE_MATH_H''@|$(NEXT_AS_FIRST_DIRECTIVE_MATH_H)|g' \
-             -e 's/@''GNULIB_ACOSF''@/$(GNULIB_ACOSF)/g' \
-             -e 's/@''GNULIB_ACOSL''@/$(GNULIB_ACOSL)/g' \
-             -e 's/@''GNULIB_ASINF''@/$(GNULIB_ASINF)/g' \
-             -e 's/@''GNULIB_ASINL''@/$(GNULIB_ASINL)/g' \
-             -e 's/@''GNULIB_ATANF''@/$(GNULIB_ATANF)/g' \
-             -e 's/@''GNULIB_ATANL''@/$(GNULIB_ATANL)/g' \
-             -e 's/@''GNULIB_ATAN2F''@/$(GNULIB_ATAN2F)/g' \
-             -e 's/@''GNULIB_CBRT''@/$(GNULIB_CBRT)/g' \
-             -e 's/@''GNULIB_CBRTF''@/$(GNULIB_CBRTF)/g' \
-             -e 's/@''GNULIB_CBRTL''@/$(GNULIB_CBRTL)/g' \
-             -e 's/@''GNULIB_CEIL''@/$(GNULIB_CEIL)/g' \
-             -e 's/@''GNULIB_CEILF''@/$(GNULIB_CEILF)/g' \
-             -e 's/@''GNULIB_CEILL''@/$(GNULIB_CEILL)/g' \
-             -e 's/@''GNULIB_COPYSIGN''@/$(GNULIB_COPYSIGN)/g' \
-             -e 's/@''GNULIB_COPYSIGNF''@/$(GNULIB_COPYSIGNF)/g' \
-             -e 's/@''GNULIB_COPYSIGNL''@/$(GNULIB_COPYSIGNL)/g' \
-             -e 's/@''GNULIB_COSF''@/$(GNULIB_COSF)/g' \
-             -e 's/@''GNULIB_COSL''@/$(GNULIB_COSL)/g' \
-             -e 's/@''GNULIB_COSHF''@/$(GNULIB_COSHF)/g' \
-             -e 's/@''GNULIB_EXPF''@/$(GNULIB_EXPF)/g' \
-             -e 's/@''GNULIB_EXPL''@/$(GNULIB_EXPL)/g' \
-             -e 's/@''GNULIB_EXP2''@/$(GNULIB_EXP2)/g' \
-             -e 's/@''GNULIB_EXP2F''@/$(GNULIB_EXP2F)/g' \
-             -e 's/@''GNULIB_EXP2L''@/$(GNULIB_EXP2L)/g' \
-             -e 's/@''GNULIB_EXPM1''@/$(GNULIB_EXPM1)/g' \
-             -e 's/@''GNULIB_EXPM1F''@/$(GNULIB_EXPM1F)/g' \
-             -e 's/@''GNULIB_EXPM1L''@/$(GNULIB_EXPM1L)/g' \
-             -e 's/@''GNULIB_FABSF''@/$(GNULIB_FABSF)/g' \
-             -e 's/@''GNULIB_FABSL''@/$(GNULIB_FABSL)/g' \
-             -e 's/@''GNULIB_FLOOR''@/$(GNULIB_FLOOR)/g' \
-             -e 's/@''GNULIB_FLOORF''@/$(GNULIB_FLOORF)/g' \
-             -e 's/@''GNULIB_FLOORL''@/$(GNULIB_FLOORL)/g' \
-             -e 's/@''GNULIB_FMA''@/$(GNULIB_FMA)/g' \
-             -e 's/@''GNULIB_FMAF''@/$(GNULIB_FMAF)/g' \
-             -e 's/@''GNULIB_FMAL''@/$(GNULIB_FMAL)/g' \
-             -e 's/@''GNULIB_FMOD''@/$(GNULIB_FMOD)/g' \
-             -e 's/@''GNULIB_FMODF''@/$(GNULIB_FMODF)/g' \
-             -e 's/@''GNULIB_FMODL''@/$(GNULIB_FMODL)/g' \
-             -e 's/@''GNULIB_FREXPF''@/$(GNULIB_FREXPF)/g' \
-             -e 's/@''GNULIB_FREXP''@/$(GNULIB_FREXP)/g' \
-             -e 's/@''GNULIB_FREXPL''@/$(GNULIB_FREXPL)/g' \
-             -e 's/@''GNULIB_HYPOT''@/$(GNULIB_HYPOT)/g' \
-             -e 's/@''GNULIB_HYPOTF''@/$(GNULIB_HYPOTF)/g' \
-             -e 's/@''GNULIB_HYPOTL''@/$(GNULIB_HYPOTL)/g' \
+             -e 's/@''GNULIB_ACOSF''@/$(GL_M4_GNULIB_ACOSF)/g' \
+             -e 's/@''GNULIB_ACOSL''@/$(GL_M4_GNULIB_ACOSL)/g' \
+             -e 's/@''GNULIB_ASINF''@/$(GL_M4_GNULIB_ASINF)/g' \
+             -e 's/@''GNULIB_ASINL''@/$(GL_M4_GNULIB_ASINL)/g' \
+             -e 's/@''GNULIB_ATANF''@/$(GL_M4_GNULIB_ATANF)/g' \
+             -e 's/@''GNULIB_ATANL''@/$(GL_M4_GNULIB_ATANL)/g' \
+             -e 's/@''GNULIB_ATAN2F''@/$(GL_M4_GNULIB_ATAN2F)/g' \
+             -e 's/@''GNULIB_CBRT''@/$(GL_M4_GNULIB_CBRT)/g' \
+             -e 's/@''GNULIB_CBRTF''@/$(GL_M4_GNULIB_CBRTF)/g' \
+             -e 's/@''GNULIB_CBRTL''@/$(GL_M4_GNULIB_CBRTL)/g' \
+             -e 's/@''GNULIB_CEIL''@/$(GL_M4_GNULIB_CEIL)/g' \
+             -e 's/@''GNULIB_CEILF''@/$(GL_M4_GNULIB_CEILF)/g' \
+             -e 's/@''GNULIB_CEILL''@/$(GL_M4_GNULIB_CEILL)/g' \
+             -e 's/@''GNULIB_COPYSIGN''@/$(GL_M4_GNULIB_COPYSIGN)/g' \
+             -e 's/@''GNULIB_COPYSIGNF''@/$(GL_M4_GNULIB_COPYSIGNF)/g' \
+             -e 's/@''GNULIB_COPYSIGNL''@/$(GL_M4_GNULIB_COPYSIGNL)/g' \
+             -e 's/@''GNULIB_COSF''@/$(GL_M4_GNULIB_COSF)/g' \
+             -e 's/@''GNULIB_COSL''@/$(GL_M4_GNULIB_COSL)/g' \
+             -e 's/@''GNULIB_COSHF''@/$(GL_M4_GNULIB_COSHF)/g' \
+             -e 's/@''GNULIB_EXPF''@/$(GL_M4_GNULIB_EXPF)/g' \
+             -e 's/@''GNULIB_EXPL''@/$(GL_M4_GNULIB_EXPL)/g' \
+             -e 's/@''GNULIB_EXP2''@/$(GL_M4_GNULIB_EXP2)/g' \
+             -e 's/@''GNULIB_EXP2F''@/$(GL_M4_GNULIB_EXP2F)/g' \
+             -e 's/@''GNULIB_EXP2L''@/$(GL_M4_GNULIB_EXP2L)/g' \
+             -e 's/@''GNULIB_EXPM1''@/$(GL_M4_GNULIB_EXPM1)/g' \
+             -e 's/@''GNULIB_EXPM1F''@/$(GL_M4_GNULIB_EXPM1F)/g' \
+             -e 's/@''GNULIB_EXPM1L''@/$(GL_M4_GNULIB_EXPM1L)/g' \
+             -e 's/@''GNULIB_FABSF''@/$(GL_M4_GNULIB_FABSF)/g' \
+             -e 's/@''GNULIB_FABSL''@/$(GL_M4_GNULIB_FABSL)/g' \
+             -e 's/@''GNULIB_FLOOR''@/$(GL_M4_GNULIB_FLOOR)/g' \
+             -e 's/@''GNULIB_FLOORF''@/$(GL_M4_GNULIB_FLOORF)/g' \
+             -e 's/@''GNULIB_FLOORL''@/$(GL_M4_GNULIB_FLOORL)/g' \
+             -e 's/@''GNULIB_FMA''@/$(GL_M4_GNULIB_FMA)/g' \
+             -e 's/@''GNULIB_FMAF''@/$(GL_M4_GNULIB_FMAF)/g' \
+             -e 's/@''GNULIB_FMAL''@/$(GL_M4_GNULIB_FMAL)/g' \
+             -e 's/@''GNULIB_FMOD''@/$(GL_M4_GNULIB_FMOD)/g' \
+             -e 's/@''GNULIB_FMODF''@/$(GL_M4_GNULIB_FMODF)/g' \
+             -e 's/@''GNULIB_FMODL''@/$(GL_M4_GNULIB_FMODL)/g' \
+             -e 's/@''GNULIB_FREXPF''@/$(GL_M4_GNULIB_FREXPF)/g' \
+             -e 's/@''GNULIB_FREXP''@/$(GL_M4_GNULIB_FREXP)/g' \
+             -e 's/@''GNULIB_FREXPL''@/$(GL_M4_GNULIB_FREXPL)/g' \
+             -e 's/@''GNULIB_HYPOT''@/$(GL_M4_GNULIB_HYPOT)/g' \
+             -e 's/@''GNULIB_HYPOTF''@/$(GL_M4_GNULIB_HYPOTF)/g' \
+             -e 's/@''GNULIB_HYPOTL''@/$(GL_M4_GNULIB_HYPOTL)/g' \
              < $(srcdir)/math.in.h | \
-         sed -e 's/@''GNULIB_ILOGB''@/$(GNULIB_ILOGB)/g' \
-             -e 's/@''GNULIB_ILOGBF''@/$(GNULIB_ILOGBF)/g' \
-             -e 's/@''GNULIB_ILOGBL''@/$(GNULIB_ILOGBL)/g' \
-             -e 's/@''GNULIB_ISFINITE''@/$(GNULIB_ISFINITE)/g' \
-             -e 's/@''GNULIB_ISINF''@/$(GNULIB_ISINF)/g' \
-             -e 's/@''GNULIB_ISNAN''@/$(GNULIB_ISNAN)/g' \
-             -e 's/@''GNULIB_ISNANF''@/$(GNULIB_ISNANF)/g' \
-             -e 's/@''GNULIB_ISNAND''@/$(GNULIB_ISNAND)/g' \
-             -e 's/@''GNULIB_ISNANL''@/$(GNULIB_ISNANL)/g' \
-             -e 's/@''GNULIB_LDEXPF''@/$(GNULIB_LDEXPF)/g' \
-             -e 's/@''GNULIB_LDEXPL''@/$(GNULIB_LDEXPL)/g' \
-             -e 's/@''GNULIB_LOG''@/$(GNULIB_LOG)/g' \
-             -e 's/@''GNULIB_LOGF''@/$(GNULIB_LOGF)/g' \
-             -e 's/@''GNULIB_LOGL''@/$(GNULIB_LOGL)/g' \
-             -e 's/@''GNULIB_LOG10''@/$(GNULIB_LOG10)/g' \
-             -e 's/@''GNULIB_LOG10F''@/$(GNULIB_LOG10F)/g' \
-             -e 's/@''GNULIB_LOG10L''@/$(GNULIB_LOG10L)/g' \
-             -e 's/@''GNULIB_LOG1P''@/$(GNULIB_LOG1P)/g' \
-             -e 's/@''GNULIB_LOG1PF''@/$(GNULIB_LOG1PF)/g' \
-             -e 's/@''GNULIB_LOG1PL''@/$(GNULIB_LOG1PL)/g' \
-             -e 's/@''GNULIB_LOG2''@/$(GNULIB_LOG2)/g' \
-             -e 's/@''GNULIB_LOG2F''@/$(GNULIB_LOG2F)/g' \
-             -e 's/@''GNULIB_LOG2L''@/$(GNULIB_LOG2L)/g' \
-             -e 's/@''GNULIB_LOGB''@/$(GNULIB_LOGB)/g' \
-             -e 's/@''GNULIB_LOGBF''@/$(GNULIB_LOGBF)/g' \
-             -e 's/@''GNULIB_LOGBL''@/$(GNULIB_LOGBL)/g' \
-             -e 's/@''GNULIB_MODF''@/$(GNULIB_MODF)/g' \
-             -e 's/@''GNULIB_MODFF''@/$(GNULIB_MODFF)/g' \
-             -e 's/@''GNULIB_MODFL''@/$(GNULIB_MODFL)/g' \
-             -e 's/@''GNULIB_POWF''@/$(GNULIB_POWF)/g' \
-             -e 's/@''GNULIB_REMAINDER''@/$(GNULIB_REMAINDER)/g' \
-             -e 's/@''GNULIB_REMAINDERF''@/$(GNULIB_REMAINDERF)/g' \
-             -e 's/@''GNULIB_REMAINDERL''@/$(GNULIB_REMAINDERL)/g' \
-             -e 's/@''GNULIB_RINT''@/$(GNULIB_RINT)/g' \
-             -e 's/@''GNULIB_RINTF''@/$(GNULIB_RINTF)/g' \
-             -e 's/@''GNULIB_RINTL''@/$(GNULIB_RINTL)/g' \
-             -e 's/@''GNULIB_ROUND''@/$(GNULIB_ROUND)/g' \
-             -e 's/@''GNULIB_ROUNDF''@/$(GNULIB_ROUNDF)/g' \
-             -e 's/@''GNULIB_ROUNDL''@/$(GNULIB_ROUNDL)/g' \
-             -e 's/@''GNULIB_SIGNBIT''@/$(GNULIB_SIGNBIT)/g' \
-             -e 's/@''GNULIB_SINF''@/$(GNULIB_SINF)/g' \
-             -e 's/@''GNULIB_SINL''@/$(GNULIB_SINL)/g' \
-             -e 's/@''GNULIB_SINHF''@/$(GNULIB_SINHF)/g' \
-             -e 's/@''GNULIB_SQRTF''@/$(GNULIB_SQRTF)/g' \
-             -e 's/@''GNULIB_SQRTL''@/$(GNULIB_SQRTL)/g' \
-             -e 's/@''GNULIB_TANF''@/$(GNULIB_TANF)/g' \
-             -e 's/@''GNULIB_TANL''@/$(GNULIB_TANL)/g' \
-             -e 's/@''GNULIB_TANHF''@/$(GNULIB_TANHF)/g' \
-             -e 's/@''GNULIB_TRUNC''@/$(GNULIB_TRUNC)/g' \
-             -e 's/@''GNULIB_TRUNCF''@/$(GNULIB_TRUNCF)/g' \
-             -e 's/@''GNULIB_TRUNCL''@/$(GNULIB_TRUNCL)/g' \
+         sed -e 's/@''GNULIB_ILOGB''@/$(GL_M4_GNULIB_ILOGB)/g' \
+             -e 's/@''GNULIB_ILOGBF''@/$(GL_M4_GNULIB_ILOGBF)/g' \
+             -e 's/@''GNULIB_ILOGBL''@/$(GL_M4_GNULIB_ILOGBL)/g' \
+             -e 's/@''GNULIB_ISFINITE''@/$(GL_M4_GNULIB_ISFINITE)/g' \
+             -e 's/@''GNULIB_ISINF''@/$(GL_M4_GNULIB_ISINF)/g' \
+             -e 's/@''GNULIB_ISNAN''@/$(GL_M4_GNULIB_ISNAN)/g' \
+             -e 's/@''GNULIB_ISNANF''@/$(GL_M4_GNULIB_ISNANF)/g' \
+             -e 's/@''GNULIB_ISNAND''@/$(GL_M4_GNULIB_ISNAND)/g' \
+             -e 's/@''GNULIB_ISNANL''@/$(GL_M4_GNULIB_ISNANL)/g' \
+             -e 's/@''GNULIB_LDEXPF''@/$(GL_M4_GNULIB_LDEXPF)/g' \
+             -e 's/@''GNULIB_LDEXPL''@/$(GL_M4_GNULIB_LDEXPL)/g' \
+             -e 's/@''GNULIB_LOG''@/$(GL_M4_GNULIB_LOG)/g' \
+             -e 's/@''GNULIB_LOGF''@/$(GL_M4_GNULIB_LOGF)/g' \
+             -e 's/@''GNULIB_LOGL''@/$(GL_M4_GNULIB_LOGL)/g' \
+             -e 's/@''GNULIB_LOG10''@/$(GL_M4_GNULIB_LOG10)/g' \
+             -e 's/@''GNULIB_LOG10F''@/$(GL_M4_GNULIB_LOG10F)/g' \
+             -e 's/@''GNULIB_LOG10L''@/$(GL_M4_GNULIB_LOG10L)/g' \
+             -e 's/@''GNULIB_LOG1P''@/$(GL_M4_GNULIB_LOG1P)/g' \
+             -e 's/@''GNULIB_LOG1PF''@/$(GL_M4_GNULIB_LOG1PF)/g' \
+             -e 's/@''GNULIB_LOG1PL''@/$(GL_M4_GNULIB_LOG1PL)/g' \
+             -e 's/@''GNULIB_LOG2''@/$(GL_M4_GNULIB_LOG2)/g' \
+             -e 's/@''GNULIB_LOG2F''@/$(GL_M4_GNULIB_LOG2F)/g' \
+             -e 's/@''GNULIB_LOG2L''@/$(GL_M4_GNULIB_LOG2L)/g' \
+             -e 's/@''GNULIB_LOGB''@/$(GL_M4_GNULIB_LOGB)/g' \
+             -e 's/@''GNULIB_LOGBF''@/$(GL_M4_GNULIB_LOGBF)/g' \
+             -e 's/@''GNULIB_LOGBL''@/$(GL_M4_GNULIB_LOGBL)/g' \
+             -e 's/@''GNULIB_MODF''@/$(GL_M4_GNULIB_MODF)/g' \
+             -e 's/@''GNULIB_MODFF''@/$(GL_M4_GNULIB_MODFF)/g' \
+             -e 's/@''GNULIB_MODFL''@/$(GL_M4_GNULIB_MODFL)/g' \
+             -e 's/@''GNULIB_POWF''@/$(GL_M4_GNULIB_POWF)/g' \
+             -e 's/@''GNULIB_REMAINDER''@/$(GL_M4_GNULIB_REMAINDER)/g' \
+             -e 's/@''GNULIB_REMAINDERF''@/$(GL_M4_GNULIB_REMAINDERF)/g' \
+             -e 's/@''GNULIB_REMAINDERL''@/$(GL_M4_GNULIB_REMAINDERL)/g' \
+             -e 's/@''GNULIB_RINT''@/$(GL_M4_GNULIB_RINT)/g' \
+             -e 's/@''GNULIB_RINTF''@/$(GL_M4_GNULIB_RINTF)/g' \
+             -e 's/@''GNULIB_RINTL''@/$(GL_M4_GNULIB_RINTL)/g' \
+             -e 's/@''GNULIB_ROUND''@/$(GL_M4_GNULIB_ROUND)/g' \
+             -e 's/@''GNULIB_ROUNDF''@/$(GL_M4_GNULIB_ROUNDF)/g' \
+             -e 's/@''GNULIB_ROUNDL''@/$(GL_M4_GNULIB_ROUNDL)/g' \
+             -e 's/@''GNULIB_SIGNBIT''@/$(GL_M4_GNULIB_SIGNBIT)/g' \
+             -e 's/@''GNULIB_SINF''@/$(GL_M4_GNULIB_SINF)/g' \
+             -e 's/@''GNULIB_SINL''@/$(GL_M4_GNULIB_SINL)/g' \
+             -e 's/@''GNULIB_SINHF''@/$(GL_M4_GNULIB_SINHF)/g' \
+             -e 's/@''GNULIB_SQRTF''@/$(GL_M4_GNULIB_SQRTF)/g' \
+             -e 's/@''GNULIB_SQRTL''@/$(GL_M4_GNULIB_SQRTL)/g' \
+             -e 's/@''GNULIB_TANF''@/$(GL_M4_GNULIB_TANF)/g' \
+             -e 's/@''GNULIB_TANL''@/$(GL_M4_GNULIB_TANL)/g' \
+             -e 's/@''GNULIB_TANHF''@/$(GL_M4_GNULIB_TANHF)/g' \
+             -e 's/@''GNULIB_TRUNC''@/$(GL_M4_GNULIB_TRUNC)/g' \
+             -e 's/@''GNULIB_TRUNCF''@/$(GL_M4_GNULIB_TRUNCF)/g' \
+             -e 's/@''GNULIB_TRUNCL''@/$(GL_M4_GNULIB_TRUNCL)/g' \
+             -e 's/@''GNULIB_MDA_J0''@/$(GL_M4_GNULIB_MDA_J0)/g' \
+             -e 's/@''GNULIB_MDA_J1''@/$(GL_M4_GNULIB_MDA_J1)/g' \
+             -e 's/@''GNULIB_MDA_JN''@/$(GL_M4_GNULIB_MDA_JN)/g' \
+             -e 's/@''GNULIB_MDA_Y0''@/$(GL_M4_GNULIB_MDA_Y0)/g' \
+             -e 's/@''GNULIB_MDA_Y1''@/$(GL_M4_GNULIB_MDA_Y1)/g' \
+             -e 's/@''GNULIB_MDA_YN''@/$(GL_M4_GNULIB_MDA_YN)/g' \
          | \
          sed -e 's|@''HAVE_ACOSF''@|$(HAVE_ACOSF)|g' \
              -e 's|@''HAVE_ACOSL''@|$(HAVE_ACOSL)|g' \
@@ -1189,8 +1726,10 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''REPLACE_COSF''@|$(REPLACE_COSF)|g' \
              -e 's|@''REPLACE_COSHF''@|$(REPLACE_COSHF)|g' \
              -e 's|@''REPLACE_EXPF''@|$(REPLACE_EXPF)|g' \
+             -e 's|@''REPLACE_EXPL''@|$(REPLACE_EXPL)|g' \
              -e 's|@''REPLACE_EXPM1''@|$(REPLACE_EXPM1)|g' \
              -e 's|@''REPLACE_EXPM1F''@|$(REPLACE_EXPM1F)|g' \
+             -e 's|@''REPLACE_EXPM1L''@|$(REPLACE_EXPM1L)|g' \
              -e 's|@''REPLACE_EXP2''@|$(REPLACE_EXP2)|g' \
              -e 's|@''REPLACE_EXP2L''@|$(REPLACE_EXP2L)|g' \
              -e 's|@''REPLACE_FABSL''@|$(REPLACE_FABSL)|g' \
@@ -1212,6 +1751,7 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''REPLACE_HYPOTL''@|$(REPLACE_HYPOTL)|g' \
              -e 's|@''REPLACE_ILOGB''@|$(REPLACE_ILOGB)|g' \
              -e 's|@''REPLACE_ILOGBF''@|$(REPLACE_ILOGBF)|g' \
+             -e 's|@''REPLACE_ILOGBL''@|$(REPLACE_ILOGBL)|g' \
              -e 's|@''REPLACE_ISFINITE''@|$(REPLACE_ISFINITE)|g' \
              -e 's|@''REPLACE_ISINF''@|$(REPLACE_ISINF)|g' \
              -e 's|@''REPLACE_ISNAN''@|$(REPLACE_ISNAN)|g' \
@@ -1239,11 +1779,12 @@ math.h: math.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''REPLACE_REMAINDER''@|$(REPLACE_REMAINDER)|g' \
              -e 's|@''REPLACE_REMAINDERF''@|$(REPLACE_REMAINDERF)|g' \
              -e 's|@''REPLACE_REMAINDERL''@|$(REPLACE_REMAINDERL)|g' \
+             -e 's|@''REPLACE_RINTL''@|$(REPLACE_RINTL)|g' \
              -e 's|@''REPLACE_ROUND''@|$(REPLACE_ROUND)|g' \
              -e 's|@''REPLACE_ROUNDF''@|$(REPLACE_ROUNDF)|g' \
              -e 's|@''REPLACE_ROUNDL''@|$(REPLACE_ROUNDL)|g' \
              -e 's|@''REPLACE_SIGNBIT''@|$(REPLACE_SIGNBIT)|g' \
-             -e 's|@''REPLACE_SIGNBIT_USING_GCC''@|$(REPLACE_SIGNBIT_USING_GCC)|g' \
+             -e 's|@''REPLACE_SIGNBIT_USING_BUILTINS''@|$(REPLACE_SIGNBIT_USING_BUILTINS)|g' \
              -e 's|@''REPLACE_SINF''@|$(REPLACE_SINF)|g' \
              -e 's|@''REPLACE_SINHF''@|$(REPLACE_SINHF)|g' \
              -e 's|@''REPLACE_SQRTF''@|$(REPLACE_SQRTF)|g' \
@@ -1264,12 +1805,26 @@ EXTRA_DIST += math.in.h
 
 ## end   gnulib module math
 
+## begin gnulib module mbchar
+
+libm4_a_SOURCES += mbchar.c
+
+EXTRA_DIST += mbchar.h
+
+## end   gnulib module mbchar
+
+## begin gnulib module mbiter
+
+libm4_a_SOURCES += mbiter.h mbiter.c
+
+## end   gnulib module mbiter
+
 ## begin gnulib module mbrtowc
 
 
-EXTRA_DIST += mbrtowc.c
+EXTRA_DIST += lc-charset-dispatch.c lc-charset-dispatch.h mbrtowc-impl-utf8.h mbrtowc-impl.h mbrtowc.c mbtowc-lock.c mbtowc-lock.h windows-initguard.h
 
-EXTRA_libm4_a_SOURCES += mbrtowc.c
+EXTRA_libm4_a_SOURCES += lc-charset-dispatch.c mbrtowc.c mbtowc-lock.c
 
 ## end   gnulib module mbrtowc
 
@@ -1282,6 +1837,20 @@ EXTRA_libm4_a_SOURCES += mbsinit.c
 
 ## end   gnulib module mbsinit
 
+## begin gnulib module mbslen
+
+libm4_a_SOURCES += mbslen.c
+
+## end   gnulib module mbslen
+
+## begin gnulib module mbsstr
+
+libm4_a_SOURCES += mbsstr.c
+
+EXTRA_DIST += str-kmp.h
+
+## end   gnulib module mbsstr
+
 ## begin gnulib module mbtowc
 
 
@@ -1291,6 +1860,12 @@ EXTRA_libm4_a_SOURCES += mbtowc.c
 
 ## end   gnulib module mbtowc
 
+## begin gnulib module mbuiter
+
+libm4_a_SOURCES += mbuiter.h mbuiter.c
+
+## end   gnulib module mbuiter
+
 ## begin gnulib module memchr
 
 
@@ -1308,12 +1883,39 @@ EXTRA_DIST += memchr2.valgrind
 
 ## end   gnulib module memchr2
 
+## begin gnulib module mempcpy
+
+
+EXTRA_DIST += mempcpy.c
+
+EXTRA_libm4_a_SOURCES += mempcpy.c
+
+## end   gnulib module mempcpy
+
+## begin gnulib module memrchr
+
+
+EXTRA_DIST += memrchr.c
+
+EXTRA_libm4_a_SOURCES += memrchr.c
+
+## end   gnulib module memrchr
+
 ## begin gnulib module minmax
 
 libm4_a_SOURCES += minmax.h
 
 ## end   gnulib module minmax
 
+## begin gnulib module mkdir
+
+
+EXTRA_DIST += mkdir.c
+
+EXTRA_libm4_a_SOURCES += mkdir.c
+
+## end   gnulib module mkdir
+
 ## begin gnulib module mkdtemp
 
 
@@ -1353,9 +1955,9 @@ EXTRA_libm4_a_SOURCES += msvc-nothrow.c
 ## begin gnulib module nl_langinfo
 
 
-EXTRA_DIST += nl_langinfo.c
+EXTRA_DIST += nl_langinfo-lock.c nl_langinfo.c windows-initguard.h
 
-EXTRA_libm4_a_SOURCES += nl_langinfo.c
+EXTRA_libm4_a_SOURCES += nl_langinfo-lock.c nl_langinfo.c
 
 ## end   gnulib module nl_langinfo
 
@@ -1377,6 +1979,37 @@ EXTRA_libm4_a_SOURCES += open.c
 
 ## end   gnulib module open
 
+## begin gnulib module openat
+
+
+EXTRA_DIST += openat.c
+
+EXTRA_libm4_a_SOURCES += openat.c
+
+## end   gnulib module openat
+
+## begin gnulib module openat-die
+
+libm4_a_SOURCES += openat-die.c
+
+## end   gnulib module openat-die
+
+## begin gnulib module openat-h
+
+
+EXTRA_DIST += openat.h
+
+## end   gnulib module openat-h
+
+## begin gnulib module opendir
+
+
+EXTRA_DIST += dirent-private.h opendir.c
+
+EXTRA_libm4_a_SOURCES += opendir.c
+
+## end   gnulib module opendir
+
 ## begin gnulib module oset
 
 libm4_a_SOURCES += gl_oset.h gl_oset.c
@@ -1390,6 +2023,15 @@ EXTRA_DIST += pathmax.h
 
 ## end   gnulib module pathmax
 
+## begin gnulib module pipe-posix
+
+
+EXTRA_DIST += pipe.c
+
+EXTRA_libm4_a_SOURCES += pipe.c
+
+## end   gnulib module pipe-posix
+
 ## begin gnulib module pipe2
 
 libm4_a_SOURCES += pipe2.c
@@ -1402,6 +2044,15 @@ libm4_a_SOURCES += pipe2-safer.c
 
 ## end   gnulib module pipe2-safer
 
+## begin gnulib module posix_spawn
+
+
+EXTRA_DIST += spawn.c
+
+EXTRA_libm4_a_SOURCES += spawn.c
+
+## end   gnulib module posix_spawn
+
 ## begin gnulib module posix_spawn-internal
 
 
@@ -1411,6 +2062,15 @@ EXTRA_libm4_a_SOURCES += spawni.c
 
 ## end   gnulib module posix_spawn-internal
 
+## begin gnulib module posix_spawn_file_actions_addchdir
+
+
+EXTRA_DIST += spawn_faction_addchdir.c spawn_int.h
+
+EXTRA_libm4_a_SOURCES += spawn_faction_addchdir.c
+
+## end   gnulib module posix_spawn_file_actions_addchdir
+
 ## begin gnulib module posix_spawn_file_actions_addclose
 
 
@@ -1483,6 +2143,15 @@ EXTRA_libm4_a_SOURCES += spawnattr_setflags.c
 
 ## end   gnulib module posix_spawnattr_setflags
 
+## begin gnulib module posix_spawnattr_setpgroup
+
+
+EXTRA_DIST += spawnattr_setpgroup.c
+
+EXTRA_libm4_a_SOURCES += spawnattr_setpgroup.c
+
+## end   gnulib module posix_spawnattr_setpgroup
+
 ## begin gnulib module posix_spawnattr_setsigmask
 
 
@@ -1525,6 +2194,12 @@ libm4_a_SOURCES += progname.h progname.c
 
 ## end   gnulib module progname
 
+## begin gnulib module propername
+
+libm4_a_SOURCES += propername.h propername.c
+
+## end   gnulib module propername
+
 ## begin gnulib module quotearg
 
 libm4_a_SOURCES += quotearg.c
@@ -1538,27 +2213,63 @@ EXTRA_DIST += quote.h quotearg.h
 
 EXTRA_DIST += raise.c
 
-EXTRA_libm4_a_SOURCES += raise.c
+EXTRA_libm4_a_SOURCES += raise.c
+
+## end   gnulib module raise
+
+## begin gnulib module rawmemchr
+
+
+EXTRA_DIST += rawmemchr.c rawmemchr.valgrind
+
+EXTRA_libm4_a_SOURCES += rawmemchr.c
+
+## end   gnulib module rawmemchr
+
+## begin gnulib module readdir
+
+
+EXTRA_DIST += dirent-private.h readdir.c
+
+EXTRA_libm4_a_SOURCES += readdir.c
+
+## end   gnulib module readdir
+
+## begin gnulib module readlink
+
+
+EXTRA_DIST += readlink.c
+
+EXTRA_libm4_a_SOURCES += readlink.c
+
+## end   gnulib module readlink
+
+## begin gnulib module realloc-gnu
+
+
+EXTRA_DIST += realloc.c
+
+EXTRA_libm4_a_SOURCES += realloc.c
 
-## end   gnulib module raise
+## end   gnulib module realloc-gnu
 
-## begin gnulib module rawmemchr
+## begin gnulib module realloc-posix
 
 
-EXTRA_DIST += rawmemchr.c rawmemchr.valgrind
+EXTRA_DIST += realloc.c
 
-EXTRA_libm4_a_SOURCES += rawmemchr.c
+EXTRA_libm4_a_SOURCES += realloc.c
 
-## end   gnulib module rawmemchr
+## end   gnulib module realloc-posix
 
-## begin gnulib module readlink
+## begin gnulib module reallocarray
 
 
-EXTRA_DIST += readlink.c
+EXTRA_DIST += reallocarray.c
 
-EXTRA_libm4_a_SOURCES += readlink.c
+EXTRA_libm4_a_SOURCES += reallocarray.c
 
-## end   gnulib module readlink
+## end   gnulib module reallocarray
 
 ## begin gnulib module regex
 
@@ -1578,6 +2289,15 @@ EXTRA_libm4_a_SOURCES += rename.c
 
 ## end   gnulib module rename
 
+## begin gnulib module rewinddir
+
+
+EXTRA_DIST += dirent-private.h rewinddir.c
+
+EXTRA_libm4_a_SOURCES += rewinddir.c
+
+## end   gnulib module rewinddir
+
 ## begin gnulib module rmdir
 
 
@@ -1594,14 +2314,21 @@ EXTRA_DIST += same-inode.h
 
 ## end   gnulib module same-inode
 
+## begin gnulib module save-cwd
+
+libm4_a_SOURCES += save-cwd.c
+
+EXTRA_DIST += save-cwd.h
+
+## end   gnulib module save-cwd
+
 ## begin gnulib module sched
 
-BUILT_SOURCES += $(SCHED_H)
+BUILT_SOURCES += sched.h
 
 # We need the following in order to create a replacement for <sched.h> when
 # the system doesn't have one.
-if GL_GENERATE_SCHED_H
-sched.h: sched.in.h $(top_builddir)/config.status
+sched.h: sched.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
@@ -1612,19 +2339,28 @@ sched.h: sched.in.h $(top_builddir)/config.status
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SCHED_H''@|$(NEXT_SCHED_H)|g' \
              -e 's|@''HAVE_STRUCT_SCHED_PARAM''@|$(HAVE_STRUCT_SCHED_PARAM)|g' \
+             -e 's/@''GNULIB_SCHED_YIELD''@/$(GL_M4_GNULIB_SCHED_YIELD)/g' \
+             -e 's|@''HAVE_SCHED_YIELD''@|$(HAVE_SCHED_YIELD)|g' \
+             -e 's|@''REPLACE_SCHED_YIELD''@|$(REPLACE_SCHED_YIELD)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sched.in.h; \
        } > $@-t && \
        mv $@-t $@
-else
-sched.h: $(top_builddir)/config.status
-       rm -f $@
-endif
 MOSTLYCLEANFILES += sched.h sched.h-t
 
 EXTRA_DIST += sched.in.h
 
 ## end   gnulib module sched
 
+## begin gnulib module scratch_buffer
+
+libm4_a_SOURCES += malloc/scratch_buffer_dupfree.c                 malloc/scratch_buffer_grow.c                 malloc/scratch_buffer_grow_preserve.c                 malloc/scratch_buffer_set_array_size.c
+
+EXTRA_DIST += malloc/scratch_buffer.h scratch_buffer.h
+
+## end   gnulib module scratch_buffer
+
 ## begin gnulib module secure_getenv
 
 
@@ -1634,6 +2370,25 @@ EXTRA_libm4_a_SOURCES += secure_getenv.c
 
 ## end   gnulib module secure_getenv
 
+## begin gnulib module setlocale
+
+
+EXTRA_DIST += setlocale.c
+
+EXTRA_libm4_a_SOURCES += setlocale.c
+
+## end   gnulib module setlocale
+
+## begin gnulib module setlocale-null
+
+libm4_a_SOURCES += setlocale_null.c
+
+EXTRA_DIST += setlocale-lock.c setlocale_null.h windows-initguard.h
+
+EXTRA_libm4_a_SOURCES += setlocale-lock.c
+
+## end   gnulib module setlocale-null
+
 ## begin gnulib module sigaction
 
 libm4_a_SOURCES += sig-handler.c
@@ -1658,11 +2413,11 @@ signal.h: signal.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SIGNAL_H''@|$(NEXT_SIGNAL_H)|g' \
-             -e 's|@''GNULIB_PTHREAD_SIGMASK''@|$(GNULIB_PTHREAD_SIGMASK)|g' \
-             -e 's|@''GNULIB_RAISE''@|$(GNULIB_RAISE)|g' \
-             -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GNULIB_SIGNAL_H_SIGPIPE)/g' \
-             -e 's/@''GNULIB_SIGPROCMASK''@/$(GNULIB_SIGPROCMASK)/g' \
-             -e 's/@''GNULIB_SIGACTION''@/$(GNULIB_SIGACTION)/g' \
+             -e 's/@''GNULIB_PTHREAD_SIGMASK''@/$(GL_M4_GNULIB_PTHREAD_SIGMASK)/g' \
+             -e 's/@''GNULIB_RAISE''@/$(GL_M4_GNULIB_RAISE)/g' \
+             -e 's/@''GNULIB_SIGNAL_H_SIGPIPE''@/$(GL_M4_GNULIB_SIGNAL_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_SIGPROCMASK''@/$(GL_M4_GNULIB_SIGPROCMASK)/g' \
+             -e 's/@''GNULIB_SIGACTION''@/$(GL_M4_GNULIB_SIGACTION)/g' \
              -e 's|@''HAVE_POSIX_SIGNALBLOCKING''@|$(HAVE_POSIX_SIGNALBLOCKING)|g' \
              -e 's|@''HAVE_PTHREAD_SIGMASK''@|$(HAVE_PTHREAD_SIGMASK)|g' \
              -e 's|@''HAVE_RAISE''@|$(HAVE_RAISE)|g' \
@@ -1713,6 +2468,31 @@ EXTRA_libm4_a_SOURCES += sigprocmask.c
 
 ## end   gnulib module sigprocmask
 
+## begin gnulib module sigsegv
+
+BUILT_SOURCES += $(SIGSEGV_H)
+
+if GL_GENERATE_SIGSEGV_H
+sigsegv.h: sigsegv.in.h $(top_builddir)/config.status
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/sigsegv.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+else
+sigsegv.h: $(top_builddir)/config.status
+       rm -f $@
+endif
+MOSTLYCLEANFILES += sigsegv.h sigsegv.h-t
+
+if GL_GENERATE_SIGSEGV_H
+libm4_a_SOURCES += sigsegv.c stackvma.c
+endif
+
+EXTRA_DIST += sigsegv.in.h stackvma.h
+
+## end   gnulib module sigsegv
+
 ## begin gnulib module size_max
 
 libm4_a_SOURCES += size_max.h
@@ -1722,106 +2502,60 @@ libm4_a_SOURCES += size_max.h
 ## begin gnulib module snippet/_Noreturn
 
 # Because this Makefile snippet defines a variable used by other
-# gnulib Makefile snippets, it must be present in all Makefile.am that
+# gnulib Makefile snippets, it must be present in all makefiles that
 # need it. This is ensured by the applicability 'all' defined above.
 
-_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
+_NORETURN_H=$(srcdir)/_Noreturn.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
+EXTRA_DIST += _Noreturn.h
 
 ## end   gnulib module snippet/_Noreturn
 
 ## begin gnulib module snippet/arg-nonnull
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += arg-nonnull.h
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
-# off.
-arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-ARG_NONNULL_H=arg-nonnull.h
+ARG_NONNULL_H=$(srcdir)/arg-nonnull.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+EXTRA_DIST += arg-nonnull.h
 
 ## end   gnulib module snippet/arg-nonnull
 
 ## begin gnulib module snippet/c++defs
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += c++defs.h
-# The c++defs.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/c++defs.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-CXXDEFS_H=c++defs.h
+CXXDEFS_H=$(srcdir)/c++defs.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
+EXTRA_DIST += c++defs.h
 
 ## end   gnulib module snippet/c++defs
 
 ## begin gnulib module snippet/unused-parameter
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += unused-parameter.h
-# The unused-parameter.h that gets inserted into generated .h files is the same
-# as build-aux/snippet/unused-parameter.h, except that it has the copyright
-# header cut off.
-unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/unused-parameter.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-UNUSED_PARAMETER_H=unused-parameter.h
+UNUSED_PARAMETER_H=$(srcdir)/unused-parameter.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/unused-parameter.h
+EXTRA_DIST += unused-parameter.h
 
 ## end   gnulib module snippet/unused-parameter
 
 ## begin gnulib module snippet/warn-on-use
 
-BUILT_SOURCES += warn-on-use.h
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
-# off.
-warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-WARN_ON_USE_H=warn-on-use.h
+WARN_ON_USE_H=$(srcdir)/warn-on-use.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
+EXTRA_DIST += warn-on-use.h
 
 ## end   gnulib module snippet/warn-on-use
 
@@ -1849,33 +2583,39 @@ spawn.h: spawn.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SPAWN_H''@|$(NEXT_SPAWN_H)|g' \
-             -e 's/@''GNULIB_POSIX_SPAWN''@/$(GNULIB_POSIX_SPAWN)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNP''@/$(GNULIB_POSIX_SPAWNP)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY''@/$(GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_INIT''@/$(GNULIB_POSIX_SPAWNATTR_INIT)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETFLAGS''@/$(GNULIB_POSIX_SPAWNATTR_GETFLAGS)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETFLAGS''@/$(GNULIB_POSIX_SPAWNATTR_SETFLAGS)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETPGROUP''@/$(GNULIB_POSIX_SPAWNATTR_GETPGROUP)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETPGROUP''@/$(GNULIB_POSIX_SPAWNATTR_SETPGROUP)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM''@/$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM''@/$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY''@/$(GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY''@/$(GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT''@/$(GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT''@/$(GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGMASK''@/$(GNULIB_POSIX_SPAWNATTR_GETSIGMASK)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGMASK''@/$(GNULIB_POSIX_SPAWNATTR_SETSIGMASK)/g' \
-             -e 's/@''GNULIB_POSIX_SPAWNATTR_DESTROY''@/$(GNULIB_POSIX_SPAWNATTR_DESTROY)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN''@/$(GL_M4_GNULIB_POSIX_SPAWN)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNP''@/$(GL_M4_GNULIB_POSIX_SPAWNP)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY''@/$(GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_INIT''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_INIT)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETFLAGS''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETFLAGS''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETPGROUP''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETPGROUP''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_GETSIGMASK''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_SETSIGMASK''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK)/g' \
+             -e 's/@''GNULIB_POSIX_SPAWNATTR_DESTROY''@/$(GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY)/g' \
              -e 's|@''HAVE_POSIX_SPAWN''@|$(HAVE_POSIX_SPAWN)|g' \
              -e 's|@''HAVE_POSIX_SPAWNATTR_T''@|$(HAVE_POSIX_SPAWNATTR_T)|g' \
              -e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_T''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_T)|g' \
+             -e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)|g' \
+             -e 's|@''HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@|$(HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)|g' \
              -e 's|@''REPLACE_POSIX_SPAWN''@|$(REPLACE_POSIX_SPAWN)|g' \
+             -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR)|g' \
              -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE)|g' \
              -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2)|g' \
+             -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR)|g' \
              -e 's|@''REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN''@|$(REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
@@ -1891,19 +2631,54 @@ EXTRA_DIST += spawn.in.h
 
 ## begin gnulib module spawn-pipe
 
-libm4_a_SOURCES += spawn-pipe.h spawn-pipe.c w32spawn.h
+libm4_a_SOURCES += spawn-pipe.h spawn-pipe.c
+
+EXTRA_DIST += os2-spawn.c os2-spawn.h
+
+EXTRA_libm4_a_SOURCES += os2-spawn.c
 
 ## end   gnulib module spawn-pipe
 
 ## begin gnulib module stat
 
 
-EXTRA_DIST += stat.c
+EXTRA_DIST += stat-w32.c stat-w32.h stat.c
 
-EXTRA_libm4_a_SOURCES += stat.c
+EXTRA_libm4_a_SOURCES += stat-w32.c stat.c
 
 ## end   gnulib module stat
 
+## begin gnulib module stat-time
+
+libm4_a_SOURCES += stat-time.c
+
+EXTRA_DIST += stat-time.h
+
+## end   gnulib module stat-time
+
+## begin gnulib module stdalign
+
+BUILT_SOURCES += $(STDALIGN_H)
+
+# We need the following in order to create <stdalign.h> when the system
+# doesn't have one that works.
+if GL_GENERATE_STDALIGN_H
+stdalign.h: stdalign.in.h $(top_builddir)/config.status
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/stdalign.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+else
+stdalign.h: $(top_builddir)/config.status
+       rm -f $@
+endif
+MOSTLYCLEANFILES += stdalign.h stdalign.h-t
+
+EXTRA_DIST += stdalign.in.h
+
+## end   gnulib module stdalign
+
 ## begin gnulib module stdarg
 
 BUILT_SOURCES += $(STDARG_H)
@@ -2008,8 +2783,6 @@ stdint.h: stdint.in.h $(top_builddir)/config.status
              -e 's/@''HAVE_SYS_INTTYPES_H''@/$(HAVE_SYS_INTTYPES_H)/g' \
              -e 's/@''HAVE_SYS_BITYPES_H''@/$(HAVE_SYS_BITYPES_H)/g' \
              -e 's/@''HAVE_WCHAR_H''@/$(HAVE_WCHAR_H)/g' \
-             -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
-             -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
              -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
              -e 's/@''BITSIZEOF_PTRDIFF_T''@/$(BITSIZEOF_PTRDIFF_T)/g' \
              -e 's/@''PTRDIFF_T_SUFFIX''@/$(PTRDIFF_T_SUFFIX)/g' \
@@ -2024,7 +2797,7 @@ stdint.h: stdint.in.h $(top_builddir)/config.status
              -e 's/@''BITSIZEOF_WINT_T''@/$(BITSIZEOF_WINT_T)/g' \
              -e 's/@''HAVE_SIGNED_WINT_T''@/$(HAVE_SIGNED_WINT_T)/g' \
              -e 's/@''WINT_T_SUFFIX''@/$(WINT_T_SUFFIX)/g' \
-             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
+             -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
              < $(srcdir)/stdint.in.h; \
        } > $@-t && \
        mv $@-t $@
@@ -2052,61 +2825,68 @@ stdio.h: stdio.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDIO_H''@|$(NEXT_STDIO_H)|g' \
-             -e 's/@''GNULIB_DPRINTF''@/$(GNULIB_DPRINTF)/g' \
-             -e 's/@''GNULIB_FCLOSE''@/$(GNULIB_FCLOSE)/g' \
-             -e 's/@''GNULIB_FDOPEN''@/$(GNULIB_FDOPEN)/g' \
-             -e 's/@''GNULIB_FFLUSH''@/$(GNULIB_FFLUSH)/g' \
-             -e 's/@''GNULIB_FGETC''@/$(GNULIB_FGETC)/g' \
-             -e 's/@''GNULIB_FGETS''@/$(GNULIB_FGETS)/g' \
-             -e 's/@''GNULIB_FOPEN''@/$(GNULIB_FOPEN)/g' \
-             -e 's/@''GNULIB_FPRINTF''@/$(GNULIB_FPRINTF)/g' \
-             -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GNULIB_FPRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_FPURGE''@/$(GNULIB_FPURGE)/g' \
-             -e 's/@''GNULIB_FPUTC''@/$(GNULIB_FPUTC)/g' \
-             -e 's/@''GNULIB_FPUTS''@/$(GNULIB_FPUTS)/g' \
-             -e 's/@''GNULIB_FREAD''@/$(GNULIB_FREAD)/g' \
-             -e 's/@''GNULIB_FREOPEN''@/$(GNULIB_FREOPEN)/g' \
-             -e 's/@''GNULIB_FSCANF''@/$(GNULIB_FSCANF)/g' \
-             -e 's/@''GNULIB_FSEEK''@/$(GNULIB_FSEEK)/g' \
-             -e 's/@''GNULIB_FSEEKO''@/$(GNULIB_FSEEKO)/g' \
-             -e 's/@''GNULIB_FTELL''@/$(GNULIB_FTELL)/g' \
-             -e 's/@''GNULIB_FTELLO''@/$(GNULIB_FTELLO)/g' \
-             -e 's/@''GNULIB_FWRITE''@/$(GNULIB_FWRITE)/g' \
-             -e 's/@''GNULIB_GETC''@/$(GNULIB_GETC)/g' \
-             -e 's/@''GNULIB_GETCHAR''@/$(GNULIB_GETCHAR)/g' \
-             -e 's/@''GNULIB_GETDELIM''@/$(GNULIB_GETDELIM)/g' \
-             -e 's/@''GNULIB_GETLINE''@/$(GNULIB_GETLINE)/g' \
-             -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GNULIB_OBSTACK_PRINTF)/g' \
-             -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GNULIB_OBSTACK_PRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_PCLOSE''@/$(GNULIB_PCLOSE)/g' \
-             -e 's/@''GNULIB_PERROR''@/$(GNULIB_PERROR)/g' \
-             -e 's/@''GNULIB_POPEN''@/$(GNULIB_POPEN)/g' \
-             -e 's/@''GNULIB_PRINTF''@/$(GNULIB_PRINTF)/g' \
-             -e 's/@''GNULIB_PRINTF_POSIX''@/$(GNULIB_PRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_PUTC''@/$(GNULIB_PUTC)/g' \
-             -e 's/@''GNULIB_PUTCHAR''@/$(GNULIB_PUTCHAR)/g' \
-             -e 's/@''GNULIB_PUTS''@/$(GNULIB_PUTS)/g' \
-             -e 's/@''GNULIB_REMOVE''@/$(GNULIB_REMOVE)/g' \
-             -e 's/@''GNULIB_RENAME''@/$(GNULIB_RENAME)/g' \
-             -e 's/@''GNULIB_RENAMEAT''@/$(GNULIB_RENAMEAT)/g' \
-             -e 's/@''GNULIB_SCANF''@/$(GNULIB_SCANF)/g' \
-             -e 's/@''GNULIB_SNPRINTF''@/$(GNULIB_SNPRINTF)/g' \
-             -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GNULIB_SPRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GNULIB_STDIO_H_NONBLOCKING)/g' \
-             -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GNULIB_STDIO_H_SIGPIPE)/g' \
-             -e 's/@''GNULIB_TMPFILE''@/$(GNULIB_TMPFILE)/g' \
-             -e 's/@''GNULIB_VASPRINTF''@/$(GNULIB_VASPRINTF)/g' \
-             -e 's/@''GNULIB_VDPRINTF''@/$(GNULIB_VDPRINTF)/g' \
-             -e 's/@''GNULIB_VFPRINTF''@/$(GNULIB_VFPRINTF)/g' \
-             -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GNULIB_VFPRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_VFSCANF''@/$(GNULIB_VFSCANF)/g' \
-             -e 's/@''GNULIB_VSCANF''@/$(GNULIB_VSCANF)/g' \
-             -e 's/@''GNULIB_VPRINTF''@/$(GNULIB_VPRINTF)/g' \
-             -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GNULIB_VPRINTF_POSIX)/g' \
-             -e 's/@''GNULIB_VSNPRINTF''@/$(GNULIB_VSNPRINTF)/g' \
-             -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GNULIB_VSPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_DPRINTF''@/$(GL_M4_GNULIB_DPRINTF)/g' \
+             -e 's/@''GNULIB_FCLOSE''@/$(GL_M4_GNULIB_FCLOSE)/g' \
+             -e 's/@''GNULIB_FDOPEN''@/$(GL_M4_GNULIB_FDOPEN)/g' \
+             -e 's/@''GNULIB_FFLUSH''@/$(GL_M4_GNULIB_FFLUSH)/g' \
+             -e 's/@''GNULIB_FGETC''@/$(GL_M4_GNULIB_FGETC)/g' \
+             -e 's/@''GNULIB_FGETS''@/$(GL_M4_GNULIB_FGETS)/g' \
+             -e 's/@''GNULIB_FOPEN''@/$(GL_M4_GNULIB_FOPEN)/g' \
+             -e 's/@''GNULIB_FPRINTF''@/$(GL_M4_GNULIB_FPRINTF)/g' \
+             -e 's/@''GNULIB_FPRINTF_POSIX''@/$(GL_M4_GNULIB_FPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_FPURGE''@/$(GL_M4_GNULIB_FPURGE)/g' \
+             -e 's/@''GNULIB_FPUTC''@/$(GL_M4_GNULIB_FPUTC)/g' \
+             -e 's/@''GNULIB_FPUTS''@/$(GL_M4_GNULIB_FPUTS)/g' \
+             -e 's/@''GNULIB_FREAD''@/$(GL_M4_GNULIB_FREAD)/g' \
+             -e 's/@''GNULIB_FREOPEN''@/$(GL_M4_GNULIB_FREOPEN)/g' \
+             -e 's/@''GNULIB_FSCANF''@/$(GL_M4_GNULIB_FSCANF)/g' \
+             -e 's/@''GNULIB_FSEEK''@/$(GL_M4_GNULIB_FSEEK)/g' \
+             -e 's/@''GNULIB_FSEEKO''@/$(GL_M4_GNULIB_FSEEKO)/g' \
+             -e 's/@''GNULIB_FTELL''@/$(GL_M4_GNULIB_FTELL)/g' \
+             -e 's/@''GNULIB_FTELLO''@/$(GL_M4_GNULIB_FTELLO)/g' \
+             -e 's/@''GNULIB_FWRITE''@/$(GL_M4_GNULIB_FWRITE)/g' \
+             -e 's/@''GNULIB_GETC''@/$(GL_M4_GNULIB_GETC)/g' \
+             -e 's/@''GNULIB_GETCHAR''@/$(GL_M4_GNULIB_GETCHAR)/g' \
+             -e 's/@''GNULIB_GETDELIM''@/$(GL_M4_GNULIB_GETDELIM)/g' \
+             -e 's/@''GNULIB_GETLINE''@/$(GL_M4_GNULIB_GETLINE)/g' \
+             -e 's/@''GNULIB_OBSTACK_PRINTF''@/$(GL_M4_GNULIB_OBSTACK_PRINTF)/g' \
+             -e 's/@''GNULIB_OBSTACK_PRINTF_POSIX''@/$(GL_M4_GNULIB_OBSTACK_PRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_PCLOSE''@/$(GL_M4_GNULIB_PCLOSE)/g' \
+             -e 's/@''GNULIB_PERROR''@/$(GL_M4_GNULIB_PERROR)/g' \
+             -e 's/@''GNULIB_POPEN''@/$(GL_M4_GNULIB_POPEN)/g' \
+             -e 's/@''GNULIB_PRINTF''@/$(GL_M4_GNULIB_PRINTF)/g' \
+             -e 's/@''GNULIB_PRINTF_POSIX''@/$(GL_M4_GNULIB_PRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_PUTC''@/$(GL_M4_GNULIB_PUTC)/g' \
+             -e 's/@''GNULIB_PUTCHAR''@/$(GL_M4_GNULIB_PUTCHAR)/g' \
+             -e 's/@''GNULIB_PUTS''@/$(GL_M4_GNULIB_PUTS)/g' \
+             -e 's/@''GNULIB_REMOVE''@/$(GL_M4_GNULIB_REMOVE)/g' \
+             -e 's/@''GNULIB_RENAME''@/$(GL_M4_GNULIB_RENAME)/g' \
+             -e 's/@''GNULIB_RENAMEAT''@/$(GL_M4_GNULIB_RENAMEAT)/g' \
+             -e 's/@''GNULIB_SCANF''@/$(GL_M4_GNULIB_SCANF)/g' \
+             -e 's/@''GNULIB_SNPRINTF''@/$(GL_M4_GNULIB_SNPRINTF)/g' \
+             -e 's/@''GNULIB_SPRINTF_POSIX''@/$(GL_M4_GNULIB_SPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_STDIO_H_NONBLOCKING''@/$(GL_M4_GNULIB_STDIO_H_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_STDIO_H_SIGPIPE''@/$(GL_M4_GNULIB_STDIO_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_TMPFILE''@/$(GL_M4_GNULIB_TMPFILE)/g' \
+             -e 's/@''GNULIB_VASPRINTF''@/$(GL_M4_GNULIB_VASPRINTF)/g' \
+             -e 's/@''GNULIB_VDPRINTF''@/$(GL_M4_GNULIB_VDPRINTF)/g' \
+             -e 's/@''GNULIB_VFPRINTF''@/$(GL_M4_GNULIB_VFPRINTF)/g' \
+             -e 's/@''GNULIB_VFPRINTF_POSIX''@/$(GL_M4_GNULIB_VFPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_VFSCANF''@/$(GL_M4_GNULIB_VFSCANF)/g' \
+             -e 's/@''GNULIB_VSCANF''@/$(GL_M4_GNULIB_VSCANF)/g' \
+             -e 's/@''GNULIB_VPRINTF''@/$(GL_M4_GNULIB_VPRINTF)/g' \
+             -e 's/@''GNULIB_VPRINTF_POSIX''@/$(GL_M4_GNULIB_VPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_VSNPRINTF''@/$(GL_M4_GNULIB_VSNPRINTF)/g' \
+             -e 's/@''GNULIB_VSPRINTF_POSIX''@/$(GL_M4_GNULIB_VSPRINTF_POSIX)/g' \
+             -e 's/@''GNULIB_MDA_FCLOSEALL''@/$(GL_M4_GNULIB_MDA_FCLOSEALL)/g' \
+             -e 's/@''GNULIB_MDA_FDOPEN''@/$(GL_M4_GNULIB_MDA_FDOPEN)/g' \
+             -e 's/@''GNULIB_MDA_FILENO''@/$(GL_M4_GNULIB_MDA_FILENO)/g' \
+             -e 's/@''GNULIB_MDA_GETW''@/$(GL_M4_GNULIB_MDA_GETW)/g' \
+             -e 's/@''GNULIB_MDA_PUTW''@/$(GL_M4_GNULIB_MDA_PUTW)/g' \
+             -e 's/@''GNULIB_MDA_TEMPNAM''@/$(GL_M4_GNULIB_MDA_TEMPNAM)/g' \
              < $(srcdir)/stdio.in.h | \
-         sed -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
+         sed -e 's|@''HAVE_DECL_FCLOSEALL''@|$(HAVE_DECL_FCLOSEALL)|g' \
+             -e 's|@''HAVE_DECL_FPURGE''@|$(HAVE_DECL_FPURGE)|g' \
              -e 's|@''HAVE_DECL_FSEEKO''@|$(HAVE_DECL_FSEEKO)|g' \
              -e 's|@''HAVE_DECL_FTELLO''@|$(HAVE_DECL_FTELLO)|g' \
              -e 's|@''HAVE_DECL_GETDELIM''@|$(HAVE_DECL_GETDELIM)|g' \
@@ -2181,51 +2961,71 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STDLIB_H''@|$(NEXT_STDLIB_H)|g' \
-             -e 's/@''GNULIB__EXIT''@/$(GNULIB__EXIT)/g' \
-             -e 's/@''GNULIB_ATOLL''@/$(GNULIB_ATOLL)/g' \
-             -e 's/@''GNULIB_CALLOC_POSIX''@/$(GNULIB_CALLOC_POSIX)/g' \
-             -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GNULIB_CANONICALIZE_FILE_NAME)/g' \
-             -e 's/@''GNULIB_GETLOADAVG''@/$(GNULIB_GETLOADAVG)/g' \
-             -e 's/@''GNULIB_GETSUBOPT''@/$(GNULIB_GETSUBOPT)/g' \
-             -e 's/@''GNULIB_GRANTPT''@/$(GNULIB_GRANTPT)/g' \
-             -e 's/@''GNULIB_MALLOC_POSIX''@/$(GNULIB_MALLOC_POSIX)/g' \
-             -e 's/@''GNULIB_MBTOWC''@/$(GNULIB_MBTOWC)/g' \
-             -e 's/@''GNULIB_MKDTEMP''@/$(GNULIB_MKDTEMP)/g' \
-             -e 's/@''GNULIB_MKOSTEMP''@/$(GNULIB_MKOSTEMP)/g' \
-             -e 's/@''GNULIB_MKOSTEMPS''@/$(GNULIB_MKOSTEMPS)/g' \
-             -e 's/@''GNULIB_MKSTEMP''@/$(GNULIB_MKSTEMP)/g' \
-             -e 's/@''GNULIB_MKSTEMPS''@/$(GNULIB_MKSTEMPS)/g' \
-             -e 's/@''GNULIB_POSIX_OPENPT''@/$(GNULIB_POSIX_OPENPT)/g' \
-             -e 's/@''GNULIB_PTSNAME''@/$(GNULIB_PTSNAME)/g' \
-             -e 's/@''GNULIB_PTSNAME_R''@/$(GNULIB_PTSNAME_R)/g' \
-             -e 's/@''GNULIB_PUTENV''@/$(GNULIB_PUTENV)/g' \
-             -e 's/@''GNULIB_QSORT_R''@/$(GNULIB_QSORT_R)/g' \
-             -e 's/@''GNULIB_RANDOM''@/$(GNULIB_RANDOM)/g' \
-             -e 's/@''GNULIB_RANDOM_R''@/$(GNULIB_RANDOM_R)/g' \
-             -e 's/@''GNULIB_REALLOC_POSIX''@/$(GNULIB_REALLOC_POSIX)/g' \
-             -e 's/@''GNULIB_REALPATH''@/$(GNULIB_REALPATH)/g' \
-             -e 's/@''GNULIB_RPMATCH''@/$(GNULIB_RPMATCH)/g' \
-             -e 's/@''GNULIB_SECURE_GETENV''@/$(GNULIB_SECURE_GETENV)/g' \
-             -e 's/@''GNULIB_SETENV''@/$(GNULIB_SETENV)/g' \
-             -e 's/@''GNULIB_STRTOD''@/$(GNULIB_STRTOD)/g' \
-             -e 's/@''GNULIB_STRTOLL''@/$(GNULIB_STRTOLL)/g' \
-             -e 's/@''GNULIB_STRTOULL''@/$(GNULIB_STRTOULL)/g' \
-             -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GNULIB_SYSTEM_POSIX)/g' \
-             -e 's/@''GNULIB_UNLOCKPT''@/$(GNULIB_UNLOCKPT)/g' \
-             -e 's/@''GNULIB_UNSETENV''@/$(GNULIB_UNSETENV)/g' \
-             -e 's/@''GNULIB_WCTOMB''@/$(GNULIB_WCTOMB)/g' \
+             -e 's/@''GNULIB__EXIT''@/$(GL_M4_GNULIB__EXIT)/g' \
+             -e 's/@''GNULIB_ALIGNED_ALLOC''@/$(GL_M4_GNULIB_ALIGNED_ALLOC)/g' \
+             -e 's/@''GNULIB_ATOLL''@/$(GL_M4_GNULIB_ATOLL)/g' \
+             -e 's/@''GNULIB_CALLOC_POSIX''@/$(GL_M4_GNULIB_CALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_CANONICALIZE_FILE_NAME''@/$(GL_M4_GNULIB_CANONICALIZE_FILE_NAME)/g' \
+             -e 's/@''GNULIB_FREE_POSIX''@/$(GL_M4_GNULIB_FREE_POSIX)/g' \
+             -e 's/@''GNULIB_GETLOADAVG''@/$(GL_M4_GNULIB_GETLOADAVG)/g' \
+             -e 's/@''GNULIB_GETSUBOPT''@/$(GL_M4_GNULIB_GETSUBOPT)/g' \
+             -e 's/@''GNULIB_GRANTPT''@/$(GL_M4_GNULIB_GRANTPT)/g' \
+             -e 's/@''GNULIB_MALLOC_POSIX''@/$(GL_M4_GNULIB_MALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_MBTOWC''@/$(GL_M4_GNULIB_MBTOWC)/g' \
+             -e 's/@''GNULIB_MKDTEMP''@/$(GL_M4_GNULIB_MKDTEMP)/g' \
+             -e 's/@''GNULIB_MKOSTEMP''@/$(GL_M4_GNULIB_MKOSTEMP)/g' \
+             -e 's/@''GNULIB_MKOSTEMPS''@/$(GL_M4_GNULIB_MKOSTEMPS)/g' \
+             -e 's/@''GNULIB_MKSTEMP''@/$(GL_M4_GNULIB_MKSTEMP)/g' \
+             -e 's/@''GNULIB_MKSTEMPS''@/$(GL_M4_GNULIB_MKSTEMPS)/g' \
+             -e 's/@''GNULIB_POSIX_MEMALIGN''@/$(GL_M4_GNULIB_POSIX_MEMALIGN)/g' \
+             -e 's/@''GNULIB_POSIX_OPENPT''@/$(GL_M4_GNULIB_POSIX_OPENPT)/g' \
+             -e 's/@''GNULIB_PTSNAME''@/$(GL_M4_GNULIB_PTSNAME)/g' \
+             -e 's/@''GNULIB_PTSNAME_R''@/$(GL_M4_GNULIB_PTSNAME_R)/g' \
+             -e 's/@''GNULIB_PUTENV''@/$(GL_M4_GNULIB_PUTENV)/g' \
+             -e 's/@''GNULIB_QSORT_R''@/$(GL_M4_GNULIB_QSORT_R)/g' \
+             -e 's/@''GNULIB_RANDOM''@/$(GL_M4_GNULIB_RANDOM)/g' \
+             -e 's/@''GNULIB_RANDOM_R''@/$(GL_M4_GNULIB_RANDOM_R)/g' \
+             -e 's/@''GNULIB_REALLOC_POSIX''@/$(GL_M4_GNULIB_REALLOC_POSIX)/g' \
+             -e 's/@''GNULIB_REALLOCARRAY''@/$(GL_M4_GNULIB_REALLOCARRAY)/g' \
+             -e 's/@''GNULIB_REALPATH''@/$(GL_M4_GNULIB_REALPATH)/g' \
+             -e 's/@''GNULIB_RPMATCH''@/$(GL_M4_GNULIB_RPMATCH)/g' \
+             -e 's/@''GNULIB_SECURE_GETENV''@/$(GL_M4_GNULIB_SECURE_GETENV)/g' \
+             -e 's/@''GNULIB_SETENV''@/$(GL_M4_GNULIB_SETENV)/g' \
+             -e 's/@''GNULIB_STRTOD''@/$(GL_M4_GNULIB_STRTOD)/g' \
+             -e 's/@''GNULIB_STRTOL''@/$(GL_M4_GNULIB_STRTOL)/g' \
+             -e 's/@''GNULIB_STRTOLD''@/$(GL_M4_GNULIB_STRTOLD)/g' \
+             -e 's/@''GNULIB_STRTOLL''@/$(GL_M4_GNULIB_STRTOLL)/g' \
+             -e 's/@''GNULIB_STRTOUL''@/$(GL_M4_GNULIB_STRTOUL)/g' \
+             -e 's/@''GNULIB_STRTOULL''@/$(GL_M4_GNULIB_STRTOULL)/g' \
+             -e 's/@''GNULIB_SYSTEM_POSIX''@/$(GL_M4_GNULIB_SYSTEM_POSIX)/g' \
+             -e 's/@''GNULIB_UNLOCKPT''@/$(GL_M4_GNULIB_UNLOCKPT)/g' \
+             -e 's/@''GNULIB_UNSETENV''@/$(GL_M4_GNULIB_UNSETENV)/g' \
+             -e 's/@''GNULIB_WCTOMB''@/$(GL_M4_GNULIB_WCTOMB)/g' \
+             -e 's/@''GNULIB_MDA_ECVT''@/$(GL_M4_GNULIB_MDA_ECVT)/g' \
+             -e 's/@''GNULIB_MDA_FCVT''@/$(GL_M4_GNULIB_MDA_FCVT)/g' \
+             -e 's/@''GNULIB_MDA_GCVT''@/$(GL_M4_GNULIB_MDA_GCVT)/g' \
+             -e 's/@''GNULIB_MDA_MKTEMP''@/$(GL_M4_GNULIB_MDA_MKTEMP)/g' \
+             -e 's/@''GNULIB_MDA_PUTENV''@/$(GL_M4_GNULIB_MDA_PUTENV)/g' \
              < $(srcdir)/stdlib.in.h | \
          sed -e 's|@''HAVE__EXIT''@|$(HAVE__EXIT)|g' \
+             -e 's|@''HAVE_ALIGNED_ALLOC''@|$(HAVE_ALIGNED_ALLOC)|g' \
              -e 's|@''HAVE_ATOLL''@|$(HAVE_ATOLL)|g' \
              -e 's|@''HAVE_CANONICALIZE_FILE_NAME''@|$(HAVE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''HAVE_DECL_ECVT''@|$(HAVE_DECL_ECVT)|g' \
+             -e 's|@''HAVE_DECL_FCVT''@|$(HAVE_DECL_FCVT)|g' \
+             -e 's|@''HAVE_DECL_GCVT''@|$(HAVE_DECL_GCVT)|g' \
              -e 's|@''HAVE_DECL_GETLOADAVG''@|$(HAVE_DECL_GETLOADAVG)|g' \
              -e 's|@''HAVE_GETSUBOPT''@|$(HAVE_GETSUBOPT)|g' \
              -e 's|@''HAVE_GRANTPT''@|$(HAVE_GRANTPT)|g' \
+             -e 's|@''HAVE_INITSTATE''@|$(HAVE_INITSTATE)|g' \
+             -e 's|@''HAVE_DECL_INITSTATE''@|$(HAVE_DECL_INITSTATE)|g' \
+             -e 's|@''HAVE_MBTOWC''@|$(HAVE_MBTOWC)|g' \
              -e 's|@''HAVE_MKDTEMP''@|$(HAVE_MKDTEMP)|g' \
              -e 's|@''HAVE_MKOSTEMP''@|$(HAVE_MKOSTEMP)|g' \
              -e 's|@''HAVE_MKOSTEMPS''@|$(HAVE_MKOSTEMPS)|g' \
              -e 's|@''HAVE_MKSTEMP''@|$(HAVE_MKSTEMP)|g' \
              -e 's|@''HAVE_MKSTEMPS''@|$(HAVE_MKSTEMPS)|g' \
+             -e 's|@''HAVE_POSIX_MEMALIGN''@|$(HAVE_POSIX_MEMALIGN)|g' \
              -e 's|@''HAVE_POSIX_OPENPT''@|$(HAVE_POSIX_OPENPT)|g' \
              -e 's|@''HAVE_PTSNAME''@|$(HAVE_PTSNAME)|g' \
              -e 's|@''HAVE_PTSNAME_R''@|$(HAVE_PTSNAME_R)|g' \
@@ -2233,31 +3033,49 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \
              -e 's|@''HAVE_RANDOM''@|$(HAVE_RANDOM)|g' \
              -e 's|@''HAVE_RANDOM_H''@|$(HAVE_RANDOM_H)|g' \
              -e 's|@''HAVE_RANDOM_R''@|$(HAVE_RANDOM_R)|g' \
+             -e 's|@''HAVE_REALLOCARRAY''@|$(HAVE_REALLOCARRAY)|g' \
              -e 's|@''HAVE_REALPATH''@|$(HAVE_REALPATH)|g' \
              -e 's|@''HAVE_RPMATCH''@|$(HAVE_RPMATCH)|g' \
              -e 's|@''HAVE_SECURE_GETENV''@|$(HAVE_SECURE_GETENV)|g' \
              -e 's|@''HAVE_DECL_SETENV''@|$(HAVE_DECL_SETENV)|g' \
+             -e 's|@''HAVE_SETSTATE''@|$(HAVE_SETSTATE)|g' \
+             -e 's|@''HAVE_DECL_SETSTATE''@|$(HAVE_DECL_SETSTATE)|g' \
              -e 's|@''HAVE_STRTOD''@|$(HAVE_STRTOD)|g' \
+             -e 's|@''HAVE_STRTOL''@|$(HAVE_STRTOL)|g' \
+             -e 's|@''HAVE_STRTOLD''@|$(HAVE_STRTOLD)|g' \
              -e 's|@''HAVE_STRTOLL''@|$(HAVE_STRTOLL)|g' \
+             -e 's|@''HAVE_STRTOUL''@|$(HAVE_STRTOUL)|g' \
              -e 's|@''HAVE_STRTOULL''@|$(HAVE_STRTOULL)|g' \
              -e 's|@''HAVE_STRUCT_RANDOM_DATA''@|$(HAVE_STRUCT_RANDOM_DATA)|g' \
              -e 's|@''HAVE_SYS_LOADAVG_H''@|$(HAVE_SYS_LOADAVG_H)|g' \
              -e 's|@''HAVE_UNLOCKPT''@|$(HAVE_UNLOCKPT)|g' \
              -e 's|@''HAVE_DECL_UNSETENV''@|$(HAVE_DECL_UNSETENV)|g' \
+             -e 's|@''REPLACE_ALIGNED_ALLOC''@|$(REPLACE_ALIGNED_ALLOC)|g' \
              -e 's|@''REPLACE_CALLOC''@|$(REPLACE_CALLOC)|g' \
              -e 's|@''REPLACE_CANONICALIZE_FILE_NAME''@|$(REPLACE_CANONICALIZE_FILE_NAME)|g' \
+             -e 's|@''REPLACE_FREE''@|$(REPLACE_FREE)|g' \
+             -e 's|@''REPLACE_INITSTATE''@|$(REPLACE_INITSTATE)|g' \
              -e 's|@''REPLACE_MALLOC''@|$(REPLACE_MALLOC)|g' \
              -e 's|@''REPLACE_MBTOWC''@|$(REPLACE_MBTOWC)|g' \
              -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \
+             -e 's|@''REPLACE_POSIX_MEMALIGN''@|$(REPLACE_POSIX_MEMALIGN)|g' \
              -e 's|@''REPLACE_PTSNAME''@|$(REPLACE_PTSNAME)|g' \
              -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \
              -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \
              -e 's|@''REPLACE_QSORT_R''@|$(REPLACE_QSORT_R)|g' \
+             -e 's|@''REPLACE_RANDOM''@|$(REPLACE_RANDOM)|g' \
              -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \
              -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \
+             -e 's|@''REPLACE_REALLOCARRAY''@|$(REPLACE_REALLOCARRAY)|g' \
              -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \
              -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \
+             -e 's|@''REPLACE_SETSTATE''@|$(REPLACE_SETSTATE)|g' \
              -e 's|@''REPLACE_STRTOD''@|$(REPLACE_STRTOD)|g' \
+             -e 's|@''REPLACE_STRTOL''@|$(REPLACE_STRTOL)|g' \
+             -e 's|@''REPLACE_STRTOLD''@|$(REPLACE_STRTOLD)|g' \
+             -e 's|@''REPLACE_STRTOLL''@|$(REPLACE_STRTOLL)|g' \
+             -e 's|@''REPLACE_STRTOUL''@|$(REPLACE_STRTOUL)|g' \
+             -e 's|@''REPLACE_STRTOULL''@|$(REPLACE_STRTOULL)|g' \
              -e 's|@''REPLACE_UNSETENV''@|$(REPLACE_UNSETENV)|g' \
              -e 's|@''REPLACE_WCTOMB''@|$(REPLACE_WCTOMB)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -2280,6 +3098,15 @@ EXTRA_DIST += stdlib--.h stdlib-safer.h
 
 ## end   gnulib module stdlib-safer
 
+## begin gnulib module stpcpy
+
+
+EXTRA_DIST += stpcpy.c
+
+EXTRA_libm4_a_SOURCES += stpcpy.c
+
+## end   gnulib module stpcpy
+
 ## begin gnulib module strchrnul
 
 
@@ -2289,6 +3116,15 @@ EXTRA_libm4_a_SOURCES += strchrnul.c
 
 ## end   gnulib module strchrnul
 
+## begin gnulib module strdup-posix
+
+
+EXTRA_DIST += strdup.c
+
+EXTRA_libm4_a_SOURCES += strdup.c
+
+## end   gnulib module strdup-posix
+
 ## begin gnulib module streq
 
 
@@ -2314,6 +3150,14 @@ EXTRA_libm4_a_SOURCES += strerror-override.c
 
 ## end   gnulib module strerror-override
 
+## begin gnulib module striconv
+
+libm4_a_SOURCES += striconv.h striconv.c
+if GL_COND_LIBTOOL
+endif
+
+## end   gnulib module striconv
+
 ## begin gnulib module string
 
 BUILT_SOURCES += string.h
@@ -2328,48 +3172,54 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_STRING_H''@|$(NEXT_STRING_H)|g' \
-             -e 's/@''GNULIB_FFSL''@/$(GNULIB_FFSL)/g' \
-             -e 's/@''GNULIB_FFSLL''@/$(GNULIB_FFSLL)/g' \
-             -e 's/@''GNULIB_MBSLEN''@/$(GNULIB_MBSLEN)/g' \
-             -e 's/@''GNULIB_MBSNLEN''@/$(GNULIB_MBSNLEN)/g' \
-             -e 's/@''GNULIB_MBSCHR''@/$(GNULIB_MBSCHR)/g' \
-             -e 's/@''GNULIB_MBSRCHR''@/$(GNULIB_MBSRCHR)/g' \
-             -e 's/@''GNULIB_MBSSTR''@/$(GNULIB_MBSSTR)/g' \
-             -e 's/@''GNULIB_MBSCASECMP''@/$(GNULIB_MBSCASECMP)/g' \
-             -e 's/@''GNULIB_MBSNCASECMP''@/$(GNULIB_MBSNCASECMP)/g' \
-             -e 's/@''GNULIB_MBSPCASECMP''@/$(GNULIB_MBSPCASECMP)/g' \
-             -e 's/@''GNULIB_MBSCASESTR''@/$(GNULIB_MBSCASESTR)/g' \
-             -e 's/@''GNULIB_MBSCSPN''@/$(GNULIB_MBSCSPN)/g' \
-             -e 's/@''GNULIB_MBSPBRK''@/$(GNULIB_MBSPBRK)/g' \
-             -e 's/@''GNULIB_MBSSPN''@/$(GNULIB_MBSSPN)/g' \
-             -e 's/@''GNULIB_MBSSEP''@/$(GNULIB_MBSSEP)/g' \
-             -e 's/@''GNULIB_MBSTOK_R''@/$(GNULIB_MBSTOK_R)/g' \
-             -e 's/@''GNULIB_MEMCHR''@/$(GNULIB_MEMCHR)/g' \
-             -e 's/@''GNULIB_MEMMEM''@/$(GNULIB_MEMMEM)/g' \
-             -e 's/@''GNULIB_MEMPCPY''@/$(GNULIB_MEMPCPY)/g' \
-             -e 's/@''GNULIB_MEMRCHR''@/$(GNULIB_MEMRCHR)/g' \
-             -e 's/@''GNULIB_RAWMEMCHR''@/$(GNULIB_RAWMEMCHR)/g' \
-             -e 's/@''GNULIB_STPCPY''@/$(GNULIB_STPCPY)/g' \
-             -e 's/@''GNULIB_STPNCPY''@/$(GNULIB_STPNCPY)/g' \
-             -e 's/@''GNULIB_STRCHRNUL''@/$(GNULIB_STRCHRNUL)/g' \
-             -e 's/@''GNULIB_STRDUP''@/$(GNULIB_STRDUP)/g' \
-             -e 's/@''GNULIB_STRNCAT''@/$(GNULIB_STRNCAT)/g' \
-             -e 's/@''GNULIB_STRNDUP''@/$(GNULIB_STRNDUP)/g' \
-             -e 's/@''GNULIB_STRNLEN''@/$(GNULIB_STRNLEN)/g' \
-             -e 's/@''GNULIB_STRPBRK''@/$(GNULIB_STRPBRK)/g' \
-             -e 's/@''GNULIB_STRSEP''@/$(GNULIB_STRSEP)/g' \
-             -e 's/@''GNULIB_STRSTR''@/$(GNULIB_STRSTR)/g' \
-             -e 's/@''GNULIB_STRCASESTR''@/$(GNULIB_STRCASESTR)/g' \
-             -e 's/@''GNULIB_STRTOK_R''@/$(GNULIB_STRTOK_R)/g' \
-             -e 's/@''GNULIB_STRERROR''@/$(GNULIB_STRERROR)/g' \
-             -e 's/@''GNULIB_STRERROR_R''@/$(GNULIB_STRERROR_R)/g' \
-             -e 's/@''GNULIB_STRSIGNAL''@/$(GNULIB_STRSIGNAL)/g' \
-             -e 's/@''GNULIB_STRVERSCMP''@/$(GNULIB_STRVERSCMP)/g' \
+             -e 's/@''GNULIB_EXPLICIT_BZERO''@/$(GL_M4_GNULIB_EXPLICIT_BZERO)/g' \
+             -e 's/@''GNULIB_FFSL''@/$(GL_M4_GNULIB_FFSL)/g' \
+             -e 's/@''GNULIB_FFSLL''@/$(GL_M4_GNULIB_FFSLL)/g' \
+             -e 's/@''GNULIB_MBSLEN''@/$(GL_M4_GNULIB_MBSLEN)/g' \
+             -e 's/@''GNULIB_MBSNLEN''@/$(GL_M4_GNULIB_MBSNLEN)/g' \
+             -e 's/@''GNULIB_MBSCHR''@/$(GL_M4_GNULIB_MBSCHR)/g' \
+             -e 's/@''GNULIB_MBSRCHR''@/$(GL_M4_GNULIB_MBSRCHR)/g' \
+             -e 's/@''GNULIB_MBSSTR''@/$(GL_M4_GNULIB_MBSSTR)/g' \
+             -e 's/@''GNULIB_MBSCASECMP''@/$(GL_M4_GNULIB_MBSCASECMP)/g' \
+             -e 's/@''GNULIB_MBSNCASECMP''@/$(GL_M4_GNULIB_MBSNCASECMP)/g' \
+             -e 's/@''GNULIB_MBSPCASECMP''@/$(GL_M4_GNULIB_MBSPCASECMP)/g' \
+             -e 's/@''GNULIB_MBSCASESTR''@/$(GL_M4_GNULIB_MBSCASESTR)/g' \
+             -e 's/@''GNULIB_MBSCSPN''@/$(GL_M4_GNULIB_MBSCSPN)/g' \
+             -e 's/@''GNULIB_MBSPBRK''@/$(GL_M4_GNULIB_MBSPBRK)/g' \
+             -e 's/@''GNULIB_MBSSPN''@/$(GL_M4_GNULIB_MBSSPN)/g' \
+             -e 's/@''GNULIB_MBSSEP''@/$(GL_M4_GNULIB_MBSSEP)/g' \
+             -e 's/@''GNULIB_MBSTOK_R''@/$(GL_M4_GNULIB_MBSTOK_R)/g' \
+             -e 's/@''GNULIB_MEMCHR''@/$(GL_M4_GNULIB_MEMCHR)/g' \
+             -e 's/@''GNULIB_MEMMEM''@/$(GL_M4_GNULIB_MEMMEM)/g' \
+             -e 's/@''GNULIB_MEMPCPY''@/$(GL_M4_GNULIB_MEMPCPY)/g' \
+             -e 's/@''GNULIB_MEMRCHR''@/$(GL_M4_GNULIB_MEMRCHR)/g' \
+             -e 's/@''GNULIB_RAWMEMCHR''@/$(GL_M4_GNULIB_RAWMEMCHR)/g' \
+             -e 's/@''GNULIB_STPCPY''@/$(GL_M4_GNULIB_STPCPY)/g' \
+             -e 's/@''GNULIB_STPNCPY''@/$(GL_M4_GNULIB_STPNCPY)/g' \
+             -e 's/@''GNULIB_STRCHRNUL''@/$(GL_M4_GNULIB_STRCHRNUL)/g' \
+             -e 's/@''GNULIB_STRDUP''@/$(GL_M4_GNULIB_STRDUP)/g' \
+             -e 's/@''GNULIB_STRNCAT''@/$(GL_M4_GNULIB_STRNCAT)/g' \
+             -e 's/@''GNULIB_STRNDUP''@/$(GL_M4_GNULIB_STRNDUP)/g' \
+             -e 's/@''GNULIB_STRNLEN''@/$(GL_M4_GNULIB_STRNLEN)/g' \
+             -e 's/@''GNULIB_STRPBRK''@/$(GL_M4_GNULIB_STRPBRK)/g' \
+             -e 's/@''GNULIB_STRSEP''@/$(GL_M4_GNULIB_STRSEP)/g' \
+             -e 's/@''GNULIB_STRSTR''@/$(GL_M4_GNULIB_STRSTR)/g' \
+             -e 's/@''GNULIB_STRCASESTR''@/$(GL_M4_GNULIB_STRCASESTR)/g' \
+             -e 's/@''GNULIB_STRTOK_R''@/$(GL_M4_GNULIB_STRTOK_R)/g' \
+             -e 's/@''GNULIB_STRERROR''@/$(GL_M4_GNULIB_STRERROR)/g' \
+             -e 's/@''GNULIB_STRERROR_R''@/$(GL_M4_GNULIB_STRERROR_R)/g' \
+             -e 's/@''GNULIB_STRERRORNAME_NP''@/$(GL_M4_GNULIB_STRERRORNAME_NP)/g' \
+             -e 's/@''GNULIB_SIGABBREV_NP''@/$(GL_M4_GNULIB_SIGABBREV_NP)/g' \
+             -e 's/@''GNULIB_SIGDESCR_NP''@/$(GL_M4_GNULIB_SIGDESCR_NP)/g' \
+             -e 's/@''GNULIB_STRSIGNAL''@/$(GL_M4_GNULIB_STRSIGNAL)/g' \
+             -e 's/@''GNULIB_STRVERSCMP''@/$(GL_M4_GNULIB_STRVERSCMP)/g' \
+             -e 's/@''GNULIB_MDA_MEMCCPY''@/$(GL_M4_GNULIB_MDA_MEMCCPY)/g' \
+             -e 's/@''GNULIB_MDA_STRDUP''@/$(GL_M4_GNULIB_MDA_STRDUP)/g' \
              < $(srcdir)/string.in.h | \
-         sed -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
+         sed -e 's|@''HAVE_EXPLICIT_BZERO''@|$(HAVE_EXPLICIT_BZERO)|g' \
+             -e 's|@''HAVE_FFSL''@|$(HAVE_FFSL)|g' \
              -e 's|@''HAVE_FFSLL''@|$(HAVE_FFSLL)|g' \
              -e 's|@''HAVE_MBSLEN''@|$(HAVE_MBSLEN)|g' \
-             -e 's|@''HAVE_MEMCHR''@|$(HAVE_MEMCHR)|g' \
              -e 's|@''HAVE_DECL_MEMMEM''@|$(HAVE_DECL_MEMMEM)|g' \
              -e 's|@''HAVE_MEMPCPY''@|$(HAVE_MEMPCPY)|g' \
              -e 's|@''HAVE_DECL_MEMRCHR''@|$(HAVE_DECL_MEMRCHR)|g' \
@@ -2385,22 +3235,27 @@ string.h: string.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_STRCASESTR''@|$(HAVE_STRCASESTR)|g' \
              -e 's|@''HAVE_DECL_STRTOK_R''@|$(HAVE_DECL_STRTOK_R)|g' \
              -e 's|@''HAVE_DECL_STRERROR_R''@|$(HAVE_DECL_STRERROR_R)|g' \
+             -e 's|@''HAVE_STRERRORNAME_NP''@|$(HAVE_STRERRORNAME_NP)|g' \
+             -e 's|@''HAVE_SIGABBREV_NP''@|$(HAVE_SIGABBREV_NP)|g' \
+             -e 's|@''HAVE_SIGDESCR_NP''@|$(HAVE_SIGDESCR_NP)|g' \
              -e 's|@''HAVE_DECL_STRSIGNAL''@|$(HAVE_DECL_STRSIGNAL)|g' \
              -e 's|@''HAVE_STRVERSCMP''@|$(HAVE_STRVERSCMP)|g' \
-             -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
+             -e 's|@''REPLACE_FFSLL''@|$(REPLACE_FFSLL)|g' \
              -e 's|@''REPLACE_MEMCHR''@|$(REPLACE_MEMCHR)|g' \
              -e 's|@''REPLACE_MEMMEM''@|$(REPLACE_MEMMEM)|g' \
-             -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
+             -e 's|@''REPLACE_STPNCPY''@|$(REPLACE_STPNCPY)|g' \
              -e 's|@''REPLACE_STRCHRNUL''@|$(REPLACE_STRCHRNUL)|g' \
              -e 's|@''REPLACE_STRDUP''@|$(REPLACE_STRDUP)|g' \
-             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
-             -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
-             -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
              -e 's|@''REPLACE_STRNCAT''@|$(REPLACE_STRNCAT)|g' \
              -e 's|@''REPLACE_STRNDUP''@|$(REPLACE_STRNDUP)|g' \
              -e 's|@''REPLACE_STRNLEN''@|$(REPLACE_STRNLEN)|g' \
-             -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
+             -e 's|@''REPLACE_STRSTR''@|$(REPLACE_STRSTR)|g' \
+             -e 's|@''REPLACE_STRCASESTR''@|$(REPLACE_STRCASESTR)|g' \
              -e 's|@''REPLACE_STRTOK_R''@|$(REPLACE_STRTOK_R)|g' \
+             -e 's|@''REPLACE_STRERROR''@|$(REPLACE_STRERROR)|g' \
+             -e 's|@''REPLACE_STRERROR_R''@|$(REPLACE_STRERROR_R)|g' \
+             -e 's|@''REPLACE_STRERRORNAME_NP''@|$(REPLACE_STRERRORNAME_NP)|g' \
+             -e 's|@''REPLACE_STRSIGNAL''@|$(REPLACE_STRSIGNAL)|g' \
              -e 's|@''UNDEFINE_STRTOK_R''@|$(UNDEFINE_STRTOK_R)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
@@ -2432,6 +3287,12 @@ EXTRA_libm4_a_SOURCES += strnlen.c
 
 ## end   gnulib module strnlen
 
+## begin gnulib module strnlen1
+
+libm4_a_SOURCES += strnlen1.h strnlen1.c
+
+## end   gnulib module strnlen1
+
 ## begin gnulib module strsignal
 
 
@@ -2441,6 +3302,15 @@ EXTRA_libm4_a_SOURCES += strsignal.c
 
 ## end   gnulib module strsignal
 
+## begin gnulib module strstr
+
+
+EXTRA_DIST += strstr.c
+
+EXTRA_libm4_a_SOURCES += strstr.c
+
+## end   gnulib module strstr
+
 ## begin gnulib module strstr-simple
 
 
@@ -2459,6 +3329,38 @@ EXTRA_libm4_a_SOURCES += strtod.c
 
 ## end   gnulib module strtod
 
+## begin gnulib module sys_random
+
+BUILT_SOURCES += sys/random.h
+
+# We need the following in order to create <sys/random.h> when the system
+# doesn't have one.
+sys/random.h: sys_random.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_RANDOM_H''@|$(NEXT_SYS_RANDOM_H)|g' \
+             -e 's|@''HAVE_SYS_RANDOM_H''@|$(HAVE_SYS_RANDOM_H)|g' \
+             -e 's/@''GNULIB_GETRANDOM''@/$(GL_M4_GNULIB_GETRANDOM)/g' \
+             -e 's/@''HAVE_GETRANDOM''@/$(HAVE_GETRANDOM)/g' \
+             -e 's/@''REPLACE_GETRANDOM''@/$(REPLACE_GETRANDOM)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sys_random.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+MOSTLYCLEANFILES += sys/random.h sys/random.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_random.in.h
+
+## end   gnulib module sys_random
+
 ## begin gnulib module sys_stat
 
 BUILT_SOURCES += sys/stat.h
@@ -2475,22 +3377,30 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_STAT_H''@|$(NEXT_SYS_STAT_H)|g' \
              -e 's|@''WINDOWS_64_BIT_ST_SIZE''@|$(WINDOWS_64_BIT_ST_SIZE)|g' \
-             -e 's/@''GNULIB_FCHMODAT''@/$(GNULIB_FCHMODAT)/g' \
-             -e 's/@''GNULIB_FSTAT''@/$(GNULIB_FSTAT)/g' \
-             -e 's/@''GNULIB_FSTATAT''@/$(GNULIB_FSTATAT)/g' \
-             -e 's/@''GNULIB_FUTIMENS''@/$(GNULIB_FUTIMENS)/g' \
-             -e 's/@''GNULIB_LCHMOD''@/$(GNULIB_LCHMOD)/g' \
-             -e 's/@''GNULIB_LSTAT''@/$(GNULIB_LSTAT)/g' \
-             -e 's/@''GNULIB_MKDIRAT''@/$(GNULIB_MKDIRAT)/g' \
-             -e 's/@''GNULIB_MKFIFO''@/$(GNULIB_MKFIFO)/g' \
-             -e 's/@''GNULIB_MKFIFOAT''@/$(GNULIB_MKFIFOAT)/g' \
-             -e 's/@''GNULIB_MKNOD''@/$(GNULIB_MKNOD)/g' \
-             -e 's/@''GNULIB_MKNODAT''@/$(GNULIB_MKNODAT)/g' \
-             -e 's/@''GNULIB_STAT''@/$(GNULIB_STAT)/g' \
-             -e 's/@''GNULIB_UTIMENSAT''@/$(GNULIB_UTIMENSAT)/g' \
+             -e 's|@''WINDOWS_STAT_TIMESPEC''@|$(WINDOWS_STAT_TIMESPEC)|g' \
+             -e 's/@''GNULIB_FCHMODAT''@/$(GL_M4_GNULIB_FCHMODAT)/g' \
+             -e 's/@''GNULIB_FSTAT''@/$(GL_M4_GNULIB_FSTAT)/g' \
+             -e 's/@''GNULIB_FSTATAT''@/$(GL_M4_GNULIB_FSTATAT)/g' \
+             -e 's/@''GNULIB_FUTIMENS''@/$(GL_M4_GNULIB_FUTIMENS)/g' \
+             -e 's/@''GNULIB_GETUMASK''@/$(GL_M4_GNULIB_GETUMASK)/g' \
+             -e 's/@''GNULIB_LCHMOD''@/$(GL_M4_GNULIB_LCHMOD)/g' \
+             -e 's/@''GNULIB_LSTAT''@/$(GL_M4_GNULIB_LSTAT)/g' \
+             -e 's/@''GNULIB_MKDIR''@/$(GL_M4_GNULIB_MKDIR)/g' \
+             -e 's/@''GNULIB_MKDIRAT''@/$(GL_M4_GNULIB_MKDIRAT)/g' \
+             -e 's/@''GNULIB_MKFIFO''@/$(GL_M4_GNULIB_MKFIFO)/g' \
+             -e 's/@''GNULIB_MKFIFOAT''@/$(GL_M4_GNULIB_MKFIFOAT)/g' \
+             -e 's/@''GNULIB_MKNOD''@/$(GL_M4_GNULIB_MKNOD)/g' \
+             -e 's/@''GNULIB_MKNODAT''@/$(GL_M4_GNULIB_MKNODAT)/g' \
+             -e 's/@''GNULIB_STAT''@/$(GL_M4_GNULIB_STAT)/g' \
+             -e 's/@''GNULIB_UTIMENSAT''@/$(GL_M4_GNULIB_UTIMENSAT)/g' \
+             -e 's/@''GNULIB_OVERRIDES_STRUCT_STAT''@/$(GL_M4_GNULIB_OVERRIDES_STRUCT_STAT)/g' \
+             -e 's/@''GNULIB_MDA_CHMOD''@/$(GL_M4_GNULIB_MDA_CHMOD)/g' \
+             -e 's/@''GNULIB_MDA_MKDIR''@/$(GL_M4_GNULIB_MDA_MKDIR)/g' \
+             -e 's/@''GNULIB_MDA_UMASK''@/$(GL_M4_GNULIB_MDA_UMASK)/g' \
              -e 's|@''HAVE_FCHMODAT''@|$(HAVE_FCHMODAT)|g' \
              -e 's|@''HAVE_FSTATAT''@|$(HAVE_FSTATAT)|g' \
              -e 's|@''HAVE_FUTIMENS''@|$(HAVE_FUTIMENS)|g' \
+             -e 's|@''HAVE_GETUMASK''@|$(HAVE_GETUMASK)|g' \
              -e 's|@''HAVE_LCHMOD''@|$(HAVE_LCHMOD)|g' \
              -e 's|@''HAVE_LSTAT''@|$(HAVE_LSTAT)|g' \
              -e 's|@''HAVE_MKDIRAT''@|$(HAVE_MKDIRAT)|g' \
@@ -2499,13 +3409,16 @@ sys/stat.h: sys_stat.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNU
              -e 's|@''HAVE_MKNOD''@|$(HAVE_MKNOD)|g' \
              -e 's|@''HAVE_MKNODAT''@|$(HAVE_MKNODAT)|g' \
              -e 's|@''HAVE_UTIMENSAT''@|$(HAVE_UTIMENSAT)|g' \
+             -e 's|@''REPLACE_FCHMODAT''@|$(REPLACE_FCHMODAT)|g' \
              -e 's|@''REPLACE_FSTAT''@|$(REPLACE_FSTAT)|g' \
              -e 's|@''REPLACE_FSTATAT''@|$(REPLACE_FSTATAT)|g' \
              -e 's|@''REPLACE_FUTIMENS''@|$(REPLACE_FUTIMENS)|g' \
              -e 's|@''REPLACE_LSTAT''@|$(REPLACE_LSTAT)|g' \
              -e 's|@''REPLACE_MKDIR''@|$(REPLACE_MKDIR)|g' \
              -e 's|@''REPLACE_MKFIFO''@|$(REPLACE_MKFIFO)|g' \
+             -e 's|@''REPLACE_MKFIFOAT''@|$(REPLACE_MKFIFOAT)|g' \
              -e 's|@''REPLACE_MKNOD''@|$(REPLACE_MKNOD)|g' \
+             -e 's|@''REPLACE_MKNODAT''@|$(REPLACE_MKNODAT)|g' \
              -e 's|@''REPLACE_STAT''@|$(REPLACE_STAT)|g' \
              -e 's|@''REPLACE_UTIMENSAT''@|$(REPLACE_UTIMENSAT)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -2521,40 +3434,6 @@ EXTRA_DIST += sys_stat.in.h
 
 ## end   gnulib module sys_stat
 
-## begin gnulib module sys_time
-
-BUILT_SOURCES += sys/time.h
-
-# We need the following in order to create <sys/time.h> when the system
-# doesn't have one that works with the given compiler.
-sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-       $(AM_V_at)$(MKDIR_P) sys
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
-             -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
-             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-             -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
-             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
-             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
-             -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
-             -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
-             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
-             -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \
-             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/sys_time.in.h; \
-       } > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += sys/time.h sys/time.h-t
-
-EXTRA_DIST += sys_time.in.h
-
-## end   gnulib module sys_time
-
 ## begin gnulib module sys_types
 
 BUILT_SOURCES += sys/types.h
@@ -2571,6 +3450,7 @@ sys/types.h: sys_types.in.h $(top_builddir)/config.status
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_TYPES_H''@|$(NEXT_SYS_TYPES_H)|g' \
              -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
+             -e 's|@''WINDOWS_STAT_INODES''@|$(WINDOWS_STAT_INODES)|g' \
              < $(srcdir)/sys_types.in.h; \
        } > $@-t && \
        mv $@-t $@
@@ -2595,7 +3475,7 @@ sys/wait.h: sys_wait.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_U
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_SYS_WAIT_H''@|$(NEXT_SYS_WAIT_H)|g' \
-             -e 's/@''GNULIB_WAITPID''@/$(GNULIB_WAITPID)/g' \
+             -e 's/@''GNULIB_WAITPID''@/$(GL_M4_GNULIB_WAITPID)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
              < $(srcdir)/sys_wait.in.h; \
@@ -2616,12 +3496,17 @@ EXTRA_DIST += tempname.h
 
 ## end   gnulib module tempname
 
+## begin gnulib module thread-optim
+
+
+EXTRA_DIST += thread-optim.h
+
+## end   gnulib module thread-optim
+
 ## begin gnulib module threadlib
 
 libm4_a_SOURCES += glthread/threadlib.c
 
-EXTRA_DIST += $(top_srcdir)/build-aux/config.rpath
-
 ## end   gnulib module threadlib
 
 ## begin gnulib module time
@@ -2638,28 +3523,38 @@ time.h: time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_TIME_H''@|$(NEXT_TIME_H)|g' \
-             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GNULIB_GETTIMEOFDAY)/g' \
-             -e 's/@''GNULIB_MKTIME''@/$(GNULIB_MKTIME)/g' \
-             -e 's/@''GNULIB_NANOSLEEP''@/$(GNULIB_NANOSLEEP)/g' \
-             -e 's/@''GNULIB_STRPTIME''@/$(GNULIB_STRPTIME)/g' \
-             -e 's/@''GNULIB_TIMEGM''@/$(GNULIB_TIMEGM)/g' \
-             -e 's/@''GNULIB_TIME_R''@/$(GNULIB_TIME_R)/g' \
-             -e 's/@''GNULIB_TIME_RZ''@/$(GNULIB_TIME_RZ)/g' \
+             -e 's/@''GNULIB_CTIME''@/$(GL_M4_GNULIB_CTIME)/g' \
+             -e 's/@''GNULIB_LOCALTIME''@/$(GL_M4_GNULIB_LOCALTIME)/g' \
+             -e 's/@''GNULIB_MKTIME''@/$(GL_M4_GNULIB_MKTIME)/g' \
+             -e 's/@''GNULIB_NANOSLEEP''@/$(GL_M4_GNULIB_NANOSLEEP)/g' \
+             -e 's/@''GNULIB_STRFTIME''@/$(GL_M4_GNULIB_STRFTIME)/g' \
+             -e 's/@''GNULIB_STRPTIME''@/$(GL_M4_GNULIB_STRPTIME)/g' \
+             -e 's/@''GNULIB_TIMEGM''@/$(GL_M4_GNULIB_TIMEGM)/g' \
+             -e 's/@''GNULIB_TIMESPEC_GET''@/$(GL_M4_GNULIB_TIMESPEC_GET)/g' \
+             -e 's/@''GNULIB_TIME_R''@/$(GL_M4_GNULIB_TIME_R)/g' \
+             -e 's/@''GNULIB_TIME_RZ''@/$(GL_M4_GNULIB_TIME_RZ)/g' \
+             -e 's/@''GNULIB_TZSET''@/$(GL_M4_GNULIB_TZSET)/g' \
+             -e 's/@''GNULIB_MDA_TZSET''@/$(GL_M4_GNULIB_MDA_TZSET)/g' \
              -e 's|@''HAVE_DECL_LOCALTIME_R''@|$(HAVE_DECL_LOCALTIME_R)|g' \
              -e 's|@''HAVE_NANOSLEEP''@|$(HAVE_NANOSLEEP)|g' \
              -e 's|@''HAVE_STRPTIME''@|$(HAVE_STRPTIME)|g' \
              -e 's|@''HAVE_TIMEGM''@|$(HAVE_TIMEGM)|g' \
+             -e 's|@''HAVE_TIMESPEC_GET''@|$(HAVE_TIMESPEC_GET)|g' \
              -e 's|@''HAVE_TIMEZONE_T''@|$(HAVE_TIMEZONE_T)|g' \
+             -e 's|@''REPLACE_CTIME''@|$(REPLACE_CTIME)|g' \
              -e 's|@''REPLACE_GMTIME''@|$(REPLACE_GMTIME)|g' \
              -e 's|@''REPLACE_LOCALTIME''@|$(REPLACE_LOCALTIME)|g' \
              -e 's|@''REPLACE_LOCALTIME_R''@|$(REPLACE_LOCALTIME_R)|g' \
              -e 's|@''REPLACE_MKTIME''@|$(REPLACE_MKTIME)|g' \
              -e 's|@''REPLACE_NANOSLEEP''@|$(REPLACE_NANOSLEEP)|g' \
+             -e 's|@''REPLACE_STRFTIME''@|$(REPLACE_STRFTIME)|g' \
              -e 's|@''REPLACE_TIMEGM''@|$(REPLACE_TIMEGM)|g' \
+             -e 's|@''REPLACE_TZSET''@|$(REPLACE_TZSET)|g' \
              -e 's|@''PTHREAD_H_DEFINES_STRUCT_TIMESPEC''@|$(PTHREAD_H_DEFINES_STRUCT_TIMESPEC)|g' \
              -e 's|@''SYS_TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(SYS_TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
              -e 's|@''TIME_H_DEFINES_STRUCT_TIMESPEC''@|$(TIME_H_DEFINES_STRUCT_TIMESPEC)|g' \
              -e 's|@''UNISTD_H_DEFINES_STRUCT_TIMESPEC''@|$(UNISTD_H_DEFINES_STRUCT_TIMESPEC)|g' \
+             -e 's|@''TIME_H_DEFINES_TIME_UTC''@|$(TIME_H_DEFINES_TIME_UTC)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
@@ -2684,6 +3579,14 @@ libm4_a_SOURCES += tmpdir.h tmpdir.c
 
 ## end   gnulib module tmpdir
 
+## begin gnulib module trim
+
+libm4_a_SOURCES += trim.c
+
+EXTRA_DIST += trim.h
+
+## end   gnulib module trim
+
 ## begin gnulib module unistd
 
 BUILT_SOURCES += unistd.h
@@ -2701,60 +3604,95 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_UNISTD_H''@|$(NEXT_UNISTD_H)|g' \
              -e 's|@''WINDOWS_64_BIT_OFF_T''@|$(WINDOWS_64_BIT_OFF_T)|g' \
-             -e 's/@''GNULIB_CHDIR''@/$(GNULIB_CHDIR)/g' \
-             -e 's/@''GNULIB_CHOWN''@/$(GNULIB_CHOWN)/g' \
-             -e 's/@''GNULIB_CLOSE''@/$(GNULIB_CLOSE)/g' \
-             -e 's/@''GNULIB_DUP''@/$(GNULIB_DUP)/g' \
-             -e 's/@''GNULIB_DUP2''@/$(GNULIB_DUP2)/g' \
-             -e 's/@''GNULIB_DUP3''@/$(GNULIB_DUP3)/g' \
-             -e 's/@''GNULIB_ENVIRON''@/$(GNULIB_ENVIRON)/g' \
-             -e 's/@''GNULIB_EUIDACCESS''@/$(GNULIB_EUIDACCESS)/g' \
-             -e 's/@''GNULIB_FACCESSAT''@/$(GNULIB_FACCESSAT)/g' \
-             -e 's/@''GNULIB_FCHDIR''@/$(GNULIB_FCHDIR)/g' \
-             -e 's/@''GNULIB_FCHOWNAT''@/$(GNULIB_FCHOWNAT)/g' \
-             -e 's/@''GNULIB_FDATASYNC''@/$(GNULIB_FDATASYNC)/g' \
-             -e 's/@''GNULIB_FSYNC''@/$(GNULIB_FSYNC)/g' \
-             -e 's/@''GNULIB_FTRUNCATE''@/$(GNULIB_FTRUNCATE)/g' \
-             -e 's/@''GNULIB_GETCWD''@/$(GNULIB_GETCWD)/g' \
-             -e 's/@''GNULIB_GETDOMAINNAME''@/$(GNULIB_GETDOMAINNAME)/g' \
-             -e 's/@''GNULIB_GETDTABLESIZE''@/$(GNULIB_GETDTABLESIZE)/g' \
-             -e 's/@''GNULIB_GETGROUPS''@/$(GNULIB_GETGROUPS)/g' \
-             -e 's/@''GNULIB_GETHOSTNAME''@/$(GNULIB_GETHOSTNAME)/g' \
-             -e 's/@''GNULIB_GETLOGIN''@/$(GNULIB_GETLOGIN)/g' \
-             -e 's/@''GNULIB_GETLOGIN_R''@/$(GNULIB_GETLOGIN_R)/g' \
-             -e 's/@''GNULIB_GETPAGESIZE''@/$(GNULIB_GETPAGESIZE)/g' \
-             -e 's/@''GNULIB_GETUSERSHELL''@/$(GNULIB_GETUSERSHELL)/g' \
-             -e 's/@''GNULIB_GROUP_MEMBER''@/$(GNULIB_GROUP_MEMBER)/g' \
-             -e 's/@''GNULIB_ISATTY''@/$(GNULIB_ISATTY)/g' \
-             -e 's/@''GNULIB_LCHOWN''@/$(GNULIB_LCHOWN)/g' \
-             -e 's/@''GNULIB_LINK''@/$(GNULIB_LINK)/g' \
-             -e 's/@''GNULIB_LINKAT''@/$(GNULIB_LINKAT)/g' \
-             -e 's/@''GNULIB_LSEEK''@/$(GNULIB_LSEEK)/g' \
-             -e 's/@''GNULIB_PIPE''@/$(GNULIB_PIPE)/g' \
-             -e 's/@''GNULIB_PIPE2''@/$(GNULIB_PIPE2)/g' \
-             -e 's/@''GNULIB_PREAD''@/$(GNULIB_PREAD)/g' \
-             -e 's/@''GNULIB_PWRITE''@/$(GNULIB_PWRITE)/g' \
-             -e 's/@''GNULIB_READ''@/$(GNULIB_READ)/g' \
-             -e 's/@''GNULIB_READLINK''@/$(GNULIB_READLINK)/g' \
-             -e 's/@''GNULIB_READLINKAT''@/$(GNULIB_READLINKAT)/g' \
-             -e 's/@''GNULIB_RMDIR''@/$(GNULIB_RMDIR)/g' \
-             -e 's/@''GNULIB_SETHOSTNAME''@/$(GNULIB_SETHOSTNAME)/g' \
-             -e 's/@''GNULIB_SLEEP''@/$(GNULIB_SLEEP)/g' \
-             -e 's/@''GNULIB_SYMLINK''@/$(GNULIB_SYMLINK)/g' \
-             -e 's/@''GNULIB_SYMLINKAT''@/$(GNULIB_SYMLINKAT)/g' \
-             -e 's/@''GNULIB_TTYNAME_R''@/$(GNULIB_TTYNAME_R)/g' \
-             -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GNULIB_GL_M4_UNISTD_H_GETOPT)/g' \
-             -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GNULIB_UNISTD_H_NONBLOCKING)/g' \
-             -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GNULIB_UNISTD_H_SIGPIPE)/g' \
-             -e 's/@''GNULIB_UNLINK''@/$(GNULIB_UNLINK)/g' \
-             -e 's/@''GNULIB_UNLINKAT''@/$(GNULIB_UNLINKAT)/g' \
-             -e 's/@''GNULIB_USLEEP''@/$(GNULIB_USLEEP)/g' \
-             -e 's/@''GNULIB_WRITE''@/$(GNULIB_WRITE)/g' \
+             -e 's/@''GNULIB_ACCESS''@/$(GL_M4_GNULIB_ACCESS)/g' \
+             -e 's/@''GNULIB_CHDIR''@/$(GL_M4_GNULIB_CHDIR)/g' \
+             -e 's/@''GNULIB_CHOWN''@/$(GL_M4_GNULIB_CHOWN)/g' \
+             -e 's/@''GNULIB_CLOSE''@/$(GL_M4_GNULIB_CLOSE)/g' \
+             -e 's/@''GNULIB_COPY_FILE_RANGE''@/$(GL_M4_GNULIB_COPY_FILE_RANGE)/g' \
+             -e 's/@''GNULIB_DUP''@/$(GL_M4_GNULIB_DUP)/g' \
+             -e 's/@''GNULIB_DUP2''@/$(GL_M4_GNULIB_DUP2)/g' \
+             -e 's/@''GNULIB_DUP3''@/$(GL_M4_GNULIB_DUP3)/g' \
+             -e 's/@''GNULIB_ENVIRON''@/$(GL_M4_GNULIB_ENVIRON)/g' \
+             -e 's/@''GNULIB_EUIDACCESS''@/$(GL_M4_GNULIB_EUIDACCESS)/g' \
+             -e 's/@''GNULIB_EXECL''@/$(GL_M4_GNULIB_EXECL)/g' \
+             -e 's/@''GNULIB_EXECLE''@/$(GL_M4_GNULIB_EXECLE)/g' \
+             -e 's/@''GNULIB_EXECLP''@/$(GL_M4_GNULIB_EXECLP)/g' \
+             -e 's/@''GNULIB_EXECV''@/$(GL_M4_GNULIB_EXECV)/g' \
+             -e 's/@''GNULIB_EXECVE''@/$(GL_M4_GNULIB_EXECVE)/g' \
+             -e 's/@''GNULIB_EXECVP''@/$(GL_M4_GNULIB_EXECVP)/g' \
+             -e 's/@''GNULIB_EXECVPE''@/$(GL_M4_GNULIB_EXECVPE)/g' \
+             -e 's/@''GNULIB_FACCESSAT''@/$(GL_M4_GNULIB_FACCESSAT)/g' \
+             -e 's/@''GNULIB_FCHDIR''@/$(GL_M4_GNULIB_FCHDIR)/g' \
+             -e 's/@''GNULIB_FCHOWNAT''@/$(GL_M4_GNULIB_FCHOWNAT)/g' \
+             -e 's/@''GNULIB_FDATASYNC''@/$(GL_M4_GNULIB_FDATASYNC)/g' \
+             -e 's/@''GNULIB_FSYNC''@/$(GL_M4_GNULIB_FSYNC)/g' \
+             -e 's/@''GNULIB_FTRUNCATE''@/$(GL_M4_GNULIB_FTRUNCATE)/g' \
+             -e 's/@''GNULIB_GETCWD''@/$(GL_M4_GNULIB_GETCWD)/g' \
+             -e 's/@''GNULIB_GETDOMAINNAME''@/$(GL_M4_GNULIB_GETDOMAINNAME)/g' \
+             -e 's/@''GNULIB_GETDTABLESIZE''@/$(GL_M4_GNULIB_GETDTABLESIZE)/g' \
+             -e 's/@''GNULIB_GETENTROPY''@/$(GL_M4_GNULIB_GETENTROPY)/g' \
+             -e 's/@''GNULIB_GETGROUPS''@/$(GL_M4_GNULIB_GETGROUPS)/g' \
+             -e 's/@''GNULIB_GETHOSTNAME''@/$(GL_M4_GNULIB_GETHOSTNAME)/g' \
+             -e 's/@''GNULIB_GETLOGIN''@/$(GL_M4_GNULIB_GETLOGIN)/g' \
+             -e 's/@''GNULIB_GETLOGIN_R''@/$(GL_M4_GNULIB_GETLOGIN_R)/g' \
+             -e 's/@''GNULIB_GETOPT_POSIX''@/$(GL_M4_GNULIB_GETOPT_POSIX)/g' \
+             -e 's/@''GNULIB_GETPAGESIZE''@/$(GL_M4_GNULIB_GETPAGESIZE)/g' \
+             -e 's/@''GNULIB_GETPASS''@/$(GL_M4_GNULIB_GETPASS)/g' \
+             -e 's/@''GNULIB_GETUSERSHELL''@/$(GL_M4_GNULIB_GETUSERSHELL)/g' \
+             -e 's/@''GNULIB_GROUP_MEMBER''@/$(GL_M4_GNULIB_GROUP_MEMBER)/g' \
+             -e 's/@''GNULIB_ISATTY''@/$(GL_M4_GNULIB_ISATTY)/g' \
+             -e 's/@''GNULIB_LCHOWN''@/$(GL_M4_GNULIB_LCHOWN)/g' \
+             -e 's/@''GNULIB_LINK''@/$(GL_M4_GNULIB_LINK)/g' \
+             -e 's/@''GNULIB_LINKAT''@/$(GL_M4_GNULIB_LINKAT)/g' \
+             -e 's/@''GNULIB_LSEEK''@/$(GL_M4_GNULIB_LSEEK)/g' \
+             -e 's/@''GNULIB_PIPE''@/$(GL_M4_GNULIB_PIPE)/g' \
+             -e 's/@''GNULIB_PIPE2''@/$(GL_M4_GNULIB_PIPE2)/g' \
+             -e 's/@''GNULIB_PREAD''@/$(GL_M4_GNULIB_PREAD)/g' \
+             -e 's/@''GNULIB_PWRITE''@/$(GL_M4_GNULIB_PWRITE)/g' \
+             -e 's/@''GNULIB_READ''@/$(GL_M4_GNULIB_READ)/g' \
+             -e 's/@''GNULIB_READLINK''@/$(GL_M4_GNULIB_READLINK)/g' \
+             -e 's/@''GNULIB_READLINKAT''@/$(GL_M4_GNULIB_READLINKAT)/g' \
+             -e 's/@''GNULIB_RMDIR''@/$(GL_M4_GNULIB_RMDIR)/g' \
+             -e 's/@''GNULIB_SETHOSTNAME''@/$(GL_M4_GNULIB_SETHOSTNAME)/g' \
+             -e 's/@''GNULIB_SLEEP''@/$(GL_M4_GNULIB_SLEEP)/g' \
+             -e 's/@''GNULIB_SYMLINK''@/$(GL_M4_GNULIB_SYMLINK)/g' \
+             -e 's/@''GNULIB_SYMLINKAT''@/$(GL_M4_GNULIB_SYMLINKAT)/g' \
+             -e 's/@''GNULIB_TRUNCATE''@/$(GL_M4_GNULIB_TRUNCATE)/g' \
+             -e 's/@''GNULIB_TTYNAME_R''@/$(GL_M4_GNULIB_TTYNAME_R)/g' \
+             -e 's/@''GNULIB_UNISTD_H_GETOPT''@/0$(GL_M4_GNULIB_GL_M4_UNISTD_H_GETOPT)/g' \
+             -e 's/@''GNULIB_UNISTD_H_NONBLOCKING''@/$(GL_M4_GNULIB_UNISTD_H_NONBLOCKING)/g' \
+             -e 's/@''GNULIB_UNISTD_H_SIGPIPE''@/$(GL_M4_GNULIB_UNISTD_H_SIGPIPE)/g' \
+             -e 's/@''GNULIB_UNLINK''@/$(GL_M4_GNULIB_UNLINK)/g' \
+             -e 's/@''GNULIB_UNLINKAT''@/$(GL_M4_GNULIB_UNLINKAT)/g' \
+             -e 's/@''GNULIB_USLEEP''@/$(GL_M4_GNULIB_USLEEP)/g' \
+             -e 's/@''GNULIB_WRITE''@/$(GL_M4_GNULIB_WRITE)/g' \
+             -e 's/@''GNULIB_MDA_ACCESS''@/$(GL_M4_GNULIB_MDA_ACCESS)/g' \
+             -e 's/@''GNULIB_MDA_CHDIR''@/$(GL_M4_GNULIB_MDA_CHDIR)/g' \
+             -e 's/@''GNULIB_MDA_CLOSE''@/$(GL_M4_GNULIB_MDA_CLOSE)/g' \
+             -e 's/@''GNULIB_MDA_DUP''@/$(GL_M4_GNULIB_MDA_DUP)/g' \
+             -e 's/@''GNULIB_MDA_DUP2''@/$(GL_M4_GNULIB_MDA_DUP2)/g' \
+             -e 's/@''GNULIB_MDA_EXECL''@/$(GL_M4_GNULIB_MDA_EXECL)/g' \
+             -e 's/@''GNULIB_MDA_EXECLE''@/$(GL_M4_GNULIB_MDA_EXECLE)/g' \
+             -e 's/@''GNULIB_MDA_EXECLP''@/$(GL_M4_GNULIB_MDA_EXECLP)/g' \
+             -e 's/@''GNULIB_MDA_EXECV''@/$(GL_M4_GNULIB_MDA_EXECV)/g' \
+             -e 's/@''GNULIB_MDA_EXECVE''@/$(GL_M4_GNULIB_MDA_EXECVE)/g' \
+             -e 's/@''GNULIB_MDA_EXECVP''@/$(GL_M4_GNULIB_MDA_EXECVP)/g' \
+             -e 's/@''GNULIB_MDA_EXECVPE''@/$(GL_M4_GNULIB_MDA_EXECVPE)/g' \
+             -e 's/@''GNULIB_MDA_GETCWD''@/$(GL_M4_GNULIB_MDA_GETCWD)/g' \
+             -e 's/@''GNULIB_MDA_GETPID''@/$(GL_M4_GNULIB_MDA_GETPID)/g' \
+             -e 's/@''GNULIB_MDA_ISATTY''@/$(GL_M4_GNULIB_MDA_ISATTY)/g' \
+             -e 's/@''GNULIB_MDA_LSEEK''@/$(GL_M4_GNULIB_MDA_LSEEK)/g' \
+             -e 's/@''GNULIB_MDA_READ''@/$(GL_M4_GNULIB_MDA_READ)/g' \
+             -e 's/@''GNULIB_MDA_RMDIR''@/$(GL_M4_GNULIB_MDA_RMDIR)/g' \
+             -e 's/@''GNULIB_MDA_SWAB''@/$(GL_M4_GNULIB_MDA_SWAB)/g' \
+             -e 's/@''GNULIB_MDA_UNLINK''@/$(GL_M4_GNULIB_MDA_UNLINK)/g' \
+             -e 's/@''GNULIB_MDA_WRITE''@/$(GL_M4_GNULIB_MDA_WRITE)/g' \
              < $(srcdir)/unistd.in.h | \
          sed -e 's|@''HAVE_CHOWN''@|$(HAVE_CHOWN)|g' \
-             -e 's|@''HAVE_DUP2''@|$(HAVE_DUP2)|g' \
+             -e 's|@''HAVE_COPY_FILE_RANGE''@|$(HAVE_COPY_FILE_RANGE)|g' \
              -e 's|@''HAVE_DUP3''@|$(HAVE_DUP3)|g' \
              -e 's|@''HAVE_EUIDACCESS''@|$(HAVE_EUIDACCESS)|g' \
+             -e 's|@''HAVE_EXECVPE''@|$(HAVE_EXECVPE)|g' \
              -e 's|@''HAVE_FACCESSAT''@|$(HAVE_FACCESSAT)|g' \
              -e 's|@''HAVE_FCHDIR''@|$(HAVE_FCHDIR)|g' \
              -e 's|@''HAVE_FCHOWNAT''@|$(HAVE_FCHOWNAT)|g' \
@@ -2762,9 +3700,11 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_FSYNC''@|$(HAVE_FSYNC)|g' \
              -e 's|@''HAVE_FTRUNCATE''@|$(HAVE_FTRUNCATE)|g' \
              -e 's|@''HAVE_GETDTABLESIZE''@|$(HAVE_GETDTABLESIZE)|g' \
+             -e 's|@''HAVE_GETENTROPY''@|$(HAVE_GETENTROPY)|g' \
              -e 's|@''HAVE_GETGROUPS''@|$(HAVE_GETGROUPS)|g' \
              -e 's|@''HAVE_GETHOSTNAME''@|$(HAVE_GETHOSTNAME)|g' \
              -e 's|@''HAVE_GETPAGESIZE''@|$(HAVE_GETPAGESIZE)|g' \
+             -e 's|@''HAVE_GETPASS''@|$(HAVE_GETPASS)|g' \
              -e 's|@''HAVE_GROUP_MEMBER''@|$(HAVE_GROUP_MEMBER)|g' \
              -e 's|@''HAVE_LCHOWN''@|$(HAVE_LCHOWN)|g' \
              -e 's|@''HAVE_LINK''@|$(HAVE_LINK)|g' \
@@ -2782,6 +3722,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_UNLINKAT''@|$(HAVE_UNLINKAT)|g' \
              -e 's|@''HAVE_USLEEP''@|$(HAVE_USLEEP)|g' \
              -e 's|@''HAVE_DECL_ENVIRON''@|$(HAVE_DECL_ENVIRON)|g' \
+             -e 's|@''HAVE_DECL_EXECVPE''@|$(HAVE_DECL_EXECVPE)|g' \
              -e 's|@''HAVE_DECL_FCHDIR''@|$(HAVE_DECL_FCHDIR)|g' \
              -e 's|@''HAVE_DECL_FDATASYNC''@|$(HAVE_DECL_FDATASYNC)|g' \
              -e 's|@''HAVE_DECL_GETDOMAINNAME''@|$(HAVE_DECL_GETDOMAINNAME)|g' \
@@ -2790,14 +3731,24 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''HAVE_DECL_GETPAGESIZE''@|$(HAVE_DECL_GETPAGESIZE)|g' \
              -e 's|@''HAVE_DECL_GETUSERSHELL''@|$(HAVE_DECL_GETUSERSHELL)|g' \
              -e 's|@''HAVE_DECL_SETHOSTNAME''@|$(HAVE_DECL_SETHOSTNAME)|g' \
+             -e 's|@''HAVE_DECL_TRUNCATE''@|$(HAVE_DECL_TRUNCATE)|g' \
              -e 's|@''HAVE_DECL_TTYNAME_R''@|$(HAVE_DECL_TTYNAME_R)|g' \
              -e 's|@''HAVE_OS_H''@|$(HAVE_OS_H)|g' \
              -e 's|@''HAVE_SYS_PARAM_H''@|$(HAVE_SYS_PARAM_H)|g' \
          | \
-         sed -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
+         sed -e 's|@''REPLACE_ACCESS''@|$(REPLACE_ACCESS)|g' \
+             -e 's|@''REPLACE_CHOWN''@|$(REPLACE_CHOWN)|g' \
              -e 's|@''REPLACE_CLOSE''@|$(REPLACE_CLOSE)|g' \
              -e 's|@''REPLACE_DUP''@|$(REPLACE_DUP)|g' \
              -e 's|@''REPLACE_DUP2''@|$(REPLACE_DUP2)|g' \
+             -e 's|@''REPLACE_EXECL''@|$(REPLACE_EXECL)|g' \
+             -e 's|@''REPLACE_EXECLE''@|$(REPLACE_EXECLE)|g' \
+             -e 's|@''REPLACE_EXECLP''@|$(REPLACE_EXECLP)|g' \
+             -e 's|@''REPLACE_EXECV''@|$(REPLACE_EXECV)|g' \
+             -e 's|@''REPLACE_EXECVE''@|$(REPLACE_EXECVE)|g' \
+             -e 's|@''REPLACE_EXECVP''@|$(REPLACE_EXECVP)|g' \
+             -e 's|@''REPLACE_EXECVPE''@|$(REPLACE_EXECVPE)|g' \
+             -e 's|@''REPLACE_FACCESSAT''@|$(REPLACE_FACCESSAT)|g' \
              -e 's|@''REPLACE_FCHOWNAT''@|$(REPLACE_FCHOWNAT)|g' \
              -e 's|@''REPLACE_FTRUNCATE''@|$(REPLACE_FTRUNCATE)|g' \
              -e 's|@''REPLACE_GETCWD''@|$(REPLACE_GETCWD)|g' \
@@ -2806,6 +3757,7 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''REPLACE_GETLOGIN_R''@|$(REPLACE_GETLOGIN_R)|g' \
              -e 's|@''REPLACE_GETGROUPS''@|$(REPLACE_GETGROUPS)|g' \
              -e 's|@''REPLACE_GETPAGESIZE''@|$(REPLACE_GETPAGESIZE)|g' \
+             -e 's|@''REPLACE_GETPASS''@|$(REPLACE_GETPASS)|g' \
              -e 's|@''REPLACE_ISATTY''@|$(REPLACE_ISATTY)|g' \
              -e 's|@''REPLACE_LCHOWN''@|$(REPLACE_LCHOWN)|g' \
              -e 's|@''REPLACE_LINK''@|$(REPLACE_LINK)|g' \
@@ -2820,11 +3772,13 @@ unistd.h: unistd.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H
              -e 's|@''REPLACE_SLEEP''@|$(REPLACE_SLEEP)|g' \
              -e 's|@''REPLACE_SYMLINK''@|$(REPLACE_SYMLINK)|g' \
              -e 's|@''REPLACE_SYMLINKAT''@|$(REPLACE_SYMLINKAT)|g' \
+             -e 's|@''REPLACE_TRUNCATE''@|$(REPLACE_TRUNCATE)|g' \
              -e 's|@''REPLACE_TTYNAME_R''@|$(REPLACE_TTYNAME_R)|g' \
              -e 's|@''REPLACE_UNLINK''@|$(REPLACE_UNLINK)|g' \
              -e 's|@''REPLACE_UNLINKAT''@|$(REPLACE_UNLINKAT)|g' \
              -e 's|@''REPLACE_USLEEP''@|$(REPLACE_USLEEP)|g' \
              -e 's|@''REPLACE_WRITE''@|$(REPLACE_WRITE)|g' \
+             -e 's|@''UNISTD_H_HAVE_SYS_RANDOM_H''@|$(UNISTD_H_HAVE_SYS_RANDOM_H)|g' \
              -e 's|@''UNISTD_H_HAVE_WINSOCK2_H''@|$(UNISTD_H_HAVE_WINSOCK2_H)|g' \
              -e 's|@''UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -2846,12 +3800,86 @@ EXTRA_DIST += unistd--.h unistd-safer.h
 
 ## end   gnulib module unistd-safer
 
-## begin gnulib module unlocked-io
+## begin gnulib module unistr/base
+
+BUILT_SOURCES += $(LIBUNISTRING_UNISTR_H)
+
+unistr.h: unistr.in.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/unistr.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+MOSTLYCLEANFILES += unistr.h unistr.h-t
+
+EXTRA_DIST += unistr.in.h
+
+## end   gnulib module unistr/base
+
+## begin gnulib module unistr/u8-mbtoucr
+
+if LIBUNISTRING_COMPILE_UNISTR_U8_MBTOUCR
+libm4_a_SOURCES += unistr/u8-mbtoucr.c
+endif
+
+## end   gnulib module unistr/u8-mbtoucr
+
+## begin gnulib module unistr/u8-uctomb
+
+if LIBUNISTRING_COMPILE_UNISTR_U8_UCTOMB
+libm4_a_SOURCES += unistr/u8-uctomb.c unistr/u8-uctomb-aux.c
+endif
+
+## end   gnulib module unistr/u8-uctomb
+
+## begin gnulib module unitypes
+
+BUILT_SOURCES += $(LIBUNISTRING_UNITYPES_H)
+
+unitypes.h: unitypes.in.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/unitypes.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+MOSTLYCLEANFILES += unitypes.h unitypes.h-t
+
+EXTRA_DIST += unitypes.in.h
+
+## end   gnulib module unitypes
+
+## begin gnulib module uniwidth/base
+
+BUILT_SOURCES += $(LIBUNISTRING_UNIWIDTH_H)
+
+uniwidth.h: uniwidth.in.h
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         cat $(srcdir)/uniwidth.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+MOSTLYCLEANFILES += uniwidth.h uniwidth.h-t
+
+EXTRA_DIST += localcharset.h uniwidth.in.h
+
+## end   gnulib module uniwidth/base
+
+## begin gnulib module uniwidth/width
+
+if LIBUNISTRING_COMPILE_UNIWIDTH_WIDTH
+libm4_a_SOURCES += uniwidth/width.c
+endif
+
+EXTRA_DIST += uniwidth/cjk.h
+
+## end   gnulib module uniwidth/width
+
+## begin gnulib module unlocked-io-internal
 
 
 EXTRA_DIST += unlocked-io.h
 
-## end   gnulib module unlocked-io
+## end   gnulib module unlocked-io-internal
 
 ## begin gnulib module update-copyright
 
@@ -2948,46 +3976,50 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
              -e 's|@''NEXT_WCHAR_H''@|$(NEXT_WCHAR_H)|g' \
              -e 's|@''HAVE_WCHAR_H''@|$(HAVE_WCHAR_H)|g' \
-             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
-             -e 's/@''GNULIB_BTOWC''@/$(GNULIB_BTOWC)/g' \
-             -e 's/@''GNULIB_WCTOB''@/$(GNULIB_WCTOB)/g' \
-             -e 's/@''GNULIB_MBSINIT''@/$(GNULIB_MBSINIT)/g' \
-             -e 's/@''GNULIB_MBRTOWC''@/$(GNULIB_MBRTOWC)/g' \
-             -e 's/@''GNULIB_MBRLEN''@/$(GNULIB_MBRLEN)/g' \
-             -e 's/@''GNULIB_MBSRTOWCS''@/$(GNULIB_MBSRTOWCS)/g' \
-             -e 's/@''GNULIB_MBSNRTOWCS''@/$(GNULIB_MBSNRTOWCS)/g' \
-             -e 's/@''GNULIB_WCRTOMB''@/$(GNULIB_WCRTOMB)/g' \
-             -e 's/@''GNULIB_WCSRTOMBS''@/$(GNULIB_WCSRTOMBS)/g' \
-             -e 's/@''GNULIB_WCSNRTOMBS''@/$(GNULIB_WCSNRTOMBS)/g' \
-             -e 's/@''GNULIB_WCWIDTH''@/$(GNULIB_WCWIDTH)/g' \
-             -e 's/@''GNULIB_WMEMCHR''@/$(GNULIB_WMEMCHR)/g' \
-             -e 's/@''GNULIB_WMEMCMP''@/$(GNULIB_WMEMCMP)/g' \
-             -e 's/@''GNULIB_WMEMCPY''@/$(GNULIB_WMEMCPY)/g' \
-             -e 's/@''GNULIB_WMEMMOVE''@/$(GNULIB_WMEMMOVE)/g' \
-             -e 's/@''GNULIB_WMEMSET''@/$(GNULIB_WMEMSET)/g' \
-             -e 's/@''GNULIB_WCSLEN''@/$(GNULIB_WCSLEN)/g' \
-             -e 's/@''GNULIB_WCSNLEN''@/$(GNULIB_WCSNLEN)/g' \
-             -e 's/@''GNULIB_WCSCPY''@/$(GNULIB_WCSCPY)/g' \
-             -e 's/@''GNULIB_WCPCPY''@/$(GNULIB_WCPCPY)/g' \
-             -e 's/@''GNULIB_WCSNCPY''@/$(GNULIB_WCSNCPY)/g' \
-             -e 's/@''GNULIB_WCPNCPY''@/$(GNULIB_WCPNCPY)/g' \
-             -e 's/@''GNULIB_WCSCAT''@/$(GNULIB_WCSCAT)/g' \
-             -e 's/@''GNULIB_WCSNCAT''@/$(GNULIB_WCSNCAT)/g' \
-             -e 's/@''GNULIB_WCSCMP''@/$(GNULIB_WCSCMP)/g' \
-             -e 's/@''GNULIB_WCSNCMP''@/$(GNULIB_WCSNCMP)/g' \
-             -e 's/@''GNULIB_WCSCASECMP''@/$(GNULIB_WCSCASECMP)/g' \
-             -e 's/@''GNULIB_WCSNCASECMP''@/$(GNULIB_WCSNCASECMP)/g' \
-             -e 's/@''GNULIB_WCSCOLL''@/$(GNULIB_WCSCOLL)/g' \
-             -e 's/@''GNULIB_WCSXFRM''@/$(GNULIB_WCSXFRM)/g' \
-             -e 's/@''GNULIB_WCSDUP''@/$(GNULIB_WCSDUP)/g' \
-             -e 's/@''GNULIB_WCSCHR''@/$(GNULIB_WCSCHR)/g' \
-             -e 's/@''GNULIB_WCSRCHR''@/$(GNULIB_WCSRCHR)/g' \
-             -e 's/@''GNULIB_WCSCSPN''@/$(GNULIB_WCSCSPN)/g' \
-             -e 's/@''GNULIB_WCSSPN''@/$(GNULIB_WCSSPN)/g' \
-             -e 's/@''GNULIB_WCSPBRK''@/$(GNULIB_WCSPBRK)/g' \
-             -e 's/@''GNULIB_WCSSTR''@/$(GNULIB_WCSSTR)/g' \
-             -e 's/@''GNULIB_WCSTOK''@/$(GNULIB_WCSTOK)/g' \
-             -e 's/@''GNULIB_WCSWIDTH''@/$(GNULIB_WCSWIDTH)/g' \
+             -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+             -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+             -e 's/@''GNULIB_BTOWC''@/$(GL_M4_GNULIB_BTOWC)/g' \
+             -e 's/@''GNULIB_WCTOB''@/$(GL_M4_GNULIB_WCTOB)/g' \
+             -e 's/@''GNULIB_MBSINIT''@/$(GL_M4_GNULIB_MBSINIT)/g' \
+             -e 's/@''GNULIB_MBRTOWC''@/$(GL_M4_GNULIB_MBRTOWC)/g' \
+             -e 's/@''GNULIB_MBRLEN''@/$(GL_M4_GNULIB_MBRLEN)/g' \
+             -e 's/@''GNULIB_MBSRTOWCS''@/$(GL_M4_GNULIB_MBSRTOWCS)/g' \
+             -e 's/@''GNULIB_MBSNRTOWCS''@/$(GL_M4_GNULIB_MBSNRTOWCS)/g' \
+             -e 's/@''GNULIB_WCRTOMB''@/$(GL_M4_GNULIB_WCRTOMB)/g' \
+             -e 's/@''GNULIB_WCSRTOMBS''@/$(GL_M4_GNULIB_WCSRTOMBS)/g' \
+             -e 's/@''GNULIB_WCSNRTOMBS''@/$(GL_M4_GNULIB_WCSNRTOMBS)/g' \
+             -e 's/@''GNULIB_WCWIDTH''@/$(GL_M4_GNULIB_WCWIDTH)/g' \
+             -e 's/@''GNULIB_WMEMCHR''@/$(GL_M4_GNULIB_WMEMCHR)/g' \
+             -e 's/@''GNULIB_WMEMCMP''@/$(GL_M4_GNULIB_WMEMCMP)/g' \
+             -e 's/@''GNULIB_WMEMCPY''@/$(GL_M4_GNULIB_WMEMCPY)/g' \
+             -e 's/@''GNULIB_WMEMMOVE''@/$(GL_M4_GNULIB_WMEMMOVE)/g' \
+             -e 's/@''GNULIB_WMEMPCPY''@/$(GL_M4_GNULIB_WMEMPCPY)/g' \
+             -e 's/@''GNULIB_WMEMSET''@/$(GL_M4_GNULIB_WMEMSET)/g' \
+             -e 's/@''GNULIB_WCSLEN''@/$(GL_M4_GNULIB_WCSLEN)/g' \
+             -e 's/@''GNULIB_WCSNLEN''@/$(GL_M4_GNULIB_WCSNLEN)/g' \
+             -e 's/@''GNULIB_WCSCPY''@/$(GL_M4_GNULIB_WCSCPY)/g' \
+             -e 's/@''GNULIB_WCPCPY''@/$(GL_M4_GNULIB_WCPCPY)/g' \
+             -e 's/@''GNULIB_WCSNCPY''@/$(GL_M4_GNULIB_WCSNCPY)/g' \
+             -e 's/@''GNULIB_WCPNCPY''@/$(GL_M4_GNULIB_WCPNCPY)/g' \
+             -e 's/@''GNULIB_WCSCAT''@/$(GL_M4_GNULIB_WCSCAT)/g' \
+             -e 's/@''GNULIB_WCSNCAT''@/$(GL_M4_GNULIB_WCSNCAT)/g' \
+             -e 's/@''GNULIB_WCSCMP''@/$(GL_M4_GNULIB_WCSCMP)/g' \
+             -e 's/@''GNULIB_WCSNCMP''@/$(GL_M4_GNULIB_WCSNCMP)/g' \
+             -e 's/@''GNULIB_WCSCASECMP''@/$(GL_M4_GNULIB_WCSCASECMP)/g' \
+             -e 's/@''GNULIB_WCSNCASECMP''@/$(GL_M4_GNULIB_WCSNCASECMP)/g' \
+             -e 's/@''GNULIB_WCSCOLL''@/$(GL_M4_GNULIB_WCSCOLL)/g' \
+             -e 's/@''GNULIB_WCSXFRM''@/$(GL_M4_GNULIB_WCSXFRM)/g' \
+             -e 's/@''GNULIB_WCSDUP''@/$(GL_M4_GNULIB_WCSDUP)/g' \
+             -e 's/@''GNULIB_WCSCHR''@/$(GL_M4_GNULIB_WCSCHR)/g' \
+             -e 's/@''GNULIB_WCSRCHR''@/$(GL_M4_GNULIB_WCSRCHR)/g' \
+             -e 's/@''GNULIB_WCSCSPN''@/$(GL_M4_GNULIB_WCSCSPN)/g' \
+             -e 's/@''GNULIB_WCSSPN''@/$(GL_M4_GNULIB_WCSSPN)/g' \
+             -e 's/@''GNULIB_WCSPBRK''@/$(GL_M4_GNULIB_WCSPBRK)/g' \
+             -e 's/@''GNULIB_WCSSTR''@/$(GL_M4_GNULIB_WCSSTR)/g' \
+             -e 's/@''GNULIB_WCSTOK''@/$(GL_M4_GNULIB_WCSTOK)/g' \
+             -e 's/@''GNULIB_WCSWIDTH''@/$(GL_M4_GNULIB_WCSWIDTH)/g' \
+             -e 's/@''GNULIB_WCSFTIME''@/$(GL_M4_GNULIB_WCSFTIME)/g' \
+             -e 's/@''GNULIB_MDA_WCSDUP''@/$(GL_M4_GNULIB_MDA_WCSDUP)/g' \
              < $(srcdir)/wchar.in.h | \
          sed -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \
              -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \
@@ -3003,6 +4035,7 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_WMEMCMP''@|$(HAVE_WMEMCMP)|g' \
              -e 's|@''HAVE_WMEMCPY''@|$(HAVE_WMEMCPY)|g' \
              -e 's|@''HAVE_WMEMMOVE''@|$(HAVE_WMEMMOVE)|g' \
+             -e 's|@''HAVE_WMEMPCPY''@|$(HAVE_WMEMPCPY)|g' \
              -e 's|@''HAVE_WMEMSET''@|$(HAVE_WMEMSET)|g' \
              -e 's|@''HAVE_WCSLEN''@|$(HAVE_WCSLEN)|g' \
              -e 's|@''HAVE_WCSNLEN''@|$(HAVE_WCSNLEN)|g' \
@@ -3027,7 +4060,9 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''HAVE_WCSSTR''@|$(HAVE_WCSSTR)|g' \
              -e 's|@''HAVE_WCSTOK''@|$(HAVE_WCSTOK)|g' \
              -e 's|@''HAVE_WCSWIDTH''@|$(HAVE_WCSWIDTH)|g' \
+             -e 's|@''HAVE_WCSFTIME''@|$(HAVE_WCSFTIME)|g' \
              -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \
+             -e 's|@''HAVE_DECL_WCSDUP''@|$(HAVE_DECL_WCSDUP)|g' \
              -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \
          | \
          sed -e 's|@''REPLACE_MBSTATE_T''@|$(REPLACE_MBSTATE_T)|g' \
@@ -3043,6 +4078,8 @@ wchar.h: wchar.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H)
              -e 's|@''REPLACE_WCSNRTOMBS''@|$(REPLACE_WCSNRTOMBS)|g' \
              -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \
              -e 's|@''REPLACE_WCSWIDTH''@|$(REPLACE_WCSWIDTH)|g' \
+             -e 's|@''REPLACE_WCSFTIME''@|$(REPLACE_WCSFTIME)|g' \
+             -e 's|@''REPLACE_WCSTOK''@|$(REPLACE_WCSTOK)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
@@ -3079,18 +4116,23 @@ wctype.h: wctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_WCTYPE_H''@|$(NEXT_WCTYPE_H)|g' \
-             -e 's/@''GNULIB_OVERRIDES_WINT_T''@/$(GNULIB_OVERRIDES_WINT_T)/g' \
-             -e 's/@''GNULIB_ISWBLANK''@/$(GNULIB_ISWBLANK)/g' \
-             -e 's/@''GNULIB_WCTYPE''@/$(GNULIB_WCTYPE)/g' \
-             -e 's/@''GNULIB_ISWCTYPE''@/$(GNULIB_ISWCTYPE)/g' \
-             -e 's/@''GNULIB_WCTRANS''@/$(GNULIB_WCTRANS)/g' \
-             -e 's/@''GNULIB_TOWCTRANS''@/$(GNULIB_TOWCTRANS)/g' \
+             -e 's/@''HAVE_CRTDEFS_H''@/$(HAVE_CRTDEFS_H)/g' \
+             -e 's/@''GNULIBHEADERS_OVERRIDE_WINT_T''@/$(GNULIBHEADERS_OVERRIDE_WINT_T)/g' \
+             -e 's/@''GNULIB_ISWBLANK''@/$(GL_M4_GNULIB_ISWBLANK)/g' \
+             -e 's/@''GNULIB_ISWDIGIT''@/$(GL_M4_GNULIB_ISWDIGIT)/g' \
+             -e 's/@''GNULIB_ISWXDIGIT''@/$(GL_M4_GNULIB_ISWXDIGIT)/g' \
+             -e 's/@''GNULIB_WCTYPE''@/$(GL_M4_GNULIB_WCTYPE)/g' \
+             -e 's/@''GNULIB_ISWCTYPE''@/$(GL_M4_GNULIB_ISWCTYPE)/g' \
+             -e 's/@''GNULIB_WCTRANS''@/$(GL_M4_GNULIB_WCTRANS)/g' \
+             -e 's/@''GNULIB_TOWCTRANS''@/$(GL_M4_GNULIB_TOWCTRANS)/g' \
              -e 's/@''HAVE_ISWBLANK''@/$(HAVE_ISWBLANK)/g' \
              -e 's/@''HAVE_ISWCNTRL''@/$(HAVE_ISWCNTRL)/g' \
              -e 's/@''HAVE_WCTYPE_T''@/$(HAVE_WCTYPE_T)/g' \
              -e 's/@''HAVE_WCTRANS_T''@/$(HAVE_WCTRANS_T)/g' \
              -e 's/@''HAVE_WINT_T''@/$(HAVE_WINT_T)/g' \
              -e 's/@''REPLACE_ISWBLANK''@/$(REPLACE_ISWBLANK)/g' \
+             -e 's/@''REPLACE_ISWDIGIT''@/$(REPLACE_ISWDIGIT)/g' \
+             -e 's/@''REPLACE_ISWXDIGIT''@/$(REPLACE_ISWXDIGIT)/g' \
              -e 's/@''REPLACE_ISWCNTRL''@/$(REPLACE_ISWCNTRL)/g' \
              -e 's/@''REPLACE_TOWLOWER''@/$(REPLACE_TOWLOWER)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
@@ -3104,6 +4146,78 @@ EXTRA_DIST += wctype.in.h
 
 ## end   gnulib module wctype-h
 
+## begin gnulib module wcwidth
+
+
+EXTRA_DIST += wcwidth.c
+
+EXTRA_libm4_a_SOURCES += wcwidth.c
+
+## end   gnulib module wcwidth
+
+## begin gnulib module windows-mutex
+
+
+EXTRA_DIST += windows-initguard.h windows-mutex.c windows-mutex.h
+
+EXTRA_libm4_a_SOURCES += windows-mutex.c
+
+## end   gnulib module windows-mutex
+
+## begin gnulib module windows-once
+
+
+EXTRA_DIST += windows-once.c windows-once.h
+
+EXTRA_libm4_a_SOURCES += windows-once.c
+
+## end   gnulib module windows-once
+
+## begin gnulib module windows-recmutex
+
+
+EXTRA_DIST += windows-initguard.h windows-recmutex.c windows-recmutex.h
+
+EXTRA_libm4_a_SOURCES += windows-recmutex.c
+
+## end   gnulib module windows-recmutex
+
+## begin gnulib module windows-rwlock
+
+
+EXTRA_DIST += windows-initguard.h windows-rwlock.c windows-rwlock.h
+
+EXTRA_libm4_a_SOURCES += windows-rwlock.c
+
+## end   gnulib module windows-rwlock
+
+## begin gnulib module windows-spawn
+
+
+EXTRA_DIST += windows-spawn.c windows-spawn.h
+
+EXTRA_libm4_a_SOURCES += windows-spawn.c
+
+## end   gnulib module windows-spawn
+
+## begin gnulib module windows-spin
+
+
+EXTRA_DIST += windows-spin.c windows-spin.h
+
+EXTRA_libm4_a_SOURCES += windows-spin.c
+
+## end   gnulib module windows-spin
+
+## begin gnulib module windows-tls
+
+
+EXTRA_DIST += windows-tls.c windows-tls.h
+
+EXTRA_libm4_a_SOURCES += windows-tls.c
+
+## end   gnulib module windows-tls
+
 ## begin gnulib module xalloc
 
 libm4_a_SOURCES += xmalloc.c
@@ -3116,6 +4230,8 @@ EXTRA_DIST += xalloc.h
 
 libm4_a_SOURCES += xalloc-die.c
 
+EXTRA_DIST += xalloc.h
+
 ## end   gnulib module xalloc-die
 
 ## begin gnulib module xalloc-oversized
@@ -3157,6 +4273,12 @@ libm4_a_SOURCES += xsize.h xsize.c
 
 ## end   gnulib module xsize
 
+## begin gnulib module xstriconv
+
+libm4_a_SOURCES += xstriconv.h xstriconv.c
+
+## end   gnulib module xstriconv
+
 ## begin gnulib module xstrndup
 
 libm4_a_SOURCES += xstrndup.h xstrndup.c
index c7d9da5..ccb75ee 100644 (file)
@@ -1,6 +1,6 @@
 /* hard-locale.c -- Determine whether a locale is hard.
 
-   Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2016 Free Software
+   Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include "hard-locale.h"
 
 #include <locale.h>
-#include <stdlib.h>
 #include <string.h>
 
-#ifdef __GLIBC__
-# define GLIBC_VERSION __GLIBC__
-#elif defined __UCLIBC__
-# define GLIBC_VERSION 2
-#else
-# define GLIBC_VERSION 0
-#endif
-
-/* Return true if the current CATEGORY locale is hard, i.e. if you
-   can't get away with assuming traditional C or POSIX behavior.  */
 bool
 hard_locale (int category)
 {
-  bool hard = true;
-  char const *p = setlocale (category, NULL);
-
-  if (p)
-    {
-      if (2 <= GLIBC_VERSION)
-        {
-          if (strcmp (p, "C") == 0 || strcmp (p, "POSIX") == 0)
-            hard = false;
-        }
-      else
-        {
-          char *locale = strdup (p);
-          if (locale)
-            {
-              /* Temporarily set the locale to the "C" and "POSIX" locales
-                 to find their names, so that we can determine whether one
-                 or the other is the caller's locale.  */
-              if (((p = setlocale (category, "C"))
-                   && strcmp (p, locale) == 0)
-                  || ((p = setlocale (category, "POSIX"))
-                      && strcmp (p, locale) == 0))
-                hard = false;
+  char locale[SETLOCALE_NULL_MAX];
 
-              /* Restore the caller's locale.  */
-              setlocale (category, locale);
-              free (locale);
-            }
-        }
-    }
+  if (setlocale_null_r (category, locale, sizeof (locale)))
+    return false;
 
-  return hard;
+  return !(strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0);
 }
index 7644afa..af09e26 100644 (file)
@@ -1,6 +1,6 @@
 /* Determine whether a locale is hard.
 
-   Copyright (C) 1999, 2003-2004, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2003-2004, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef HARD_LOCALE_H_
 # define HARD_LOCALE_H_ 1
 
 # include <stdbool.h>
 
-bool hard_locale (int);
+/* Return true if the specified CATEGORY of the current locale is hard, i.e.
+   different from the C or POSIX locale that has a fixed behavior.
+   CATEGORY must be one of the LC_* values, but not LC_ALL.  */
+extern bool hard_locale (int category);
 
 #endif /* HARD_LOCALE_H_ */
diff --git a/lib/hash-pjw.c b/lib/hash-pjw.c
new file mode 100644 (file)
index 0000000..f725db0
--- /dev/null
@@ -0,0 +1,40 @@
+/* hash-pjw.c -- compute a hash value from a NUL-terminated string.
+
+   Copyright (C) 2001, 2003, 2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "hash-pjw.h"
+
+#include <limits.h>
+
+#define SIZE_BITS (sizeof (size_t) * CHAR_BIT)
+
+/* A hash function for NUL-terminated char* strings using
+   the method described by Bruno Haible.
+   See https://www.haible.de/bruno/hashfunc.html.  */
+
+size_t
+hash_pjw (const void *x, size_t tablesize)
+{
+  const char *s;
+  size_t h = 0;
+
+  for (s = x; *s; s++)
+    h = *s + ((h << 9) | (h >> (SIZE_BITS - 9)));
+
+  return h % tablesize;
+}
diff --git a/lib/hash-pjw.h b/lib/hash-pjw.h
new file mode 100644 (file)
index 0000000..c8a911f
--- /dev/null
@@ -0,0 +1,23 @@
+/* hash-pjw.h -- declaration for a simple hash function
+   Copyright (C) 2001, 2003, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <stddef.h>
+
+/* Compute a hash code for a NUL-terminated string starting at X,
+   and return the hash code modulo TABLESIZE.
+   The result is platform dependent: it depends on the size of the 'size_t'
+   type and on the signedness of the 'char' type.  */
+extern size_t hash_pjw (void const *x, size_t tablesize) _GL_ATTRIBUTE_PURE;
diff --git a/lib/hash-triple-simple.c b/lib/hash-triple-simple.c
new file mode 100644 (file)
index 0000000..f382538
--- /dev/null
@@ -0,0 +1,59 @@
+/* Hash functions for file-related triples: name, device, inode.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering */
+
+#include <config.h>
+
+/* Specification.  */
+#include "hash-triple.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "hash-pjw.h"
+#include "same-inode.h"
+
+#define STREQ(a, b) (strcmp (a, b) == 0)
+
+/* Hash an F_triple, and *do* consider the file name.  */
+size_t
+triple_hash (void const *x, size_t table_size)
+{
+  struct F_triple const *p = x;
+  size_t tmp = hash_pjw (p->name, table_size);
+
+  /* Ignoring the device number here should be fine.  */
+  return (tmp ^ p->st_ino) % table_size;
+}
+
+/* Compare two F_triple structs.  */
+bool
+triple_compare_ino_str (void const *x, void const *y)
+{
+  struct F_triple const *a = x;
+  struct F_triple const *b = y;
+  return (SAME_INODE (*a, *b) && STREQ (a->name, b->name)) ? true : false;
+}
+
+/* Free an F_triple.  */
+void
+triple_free (void *x)
+{
+  struct F_triple *a = x;
+  free (a->name);
+  free (a);
+}
diff --git a/lib/hash-triple.h b/lib/hash-triple.h
new file mode 100644 (file)
index 0000000..896d3d2
--- /dev/null
@@ -0,0 +1,46 @@
+/* Hash functions for file-related (name, device, inode) triples.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering, 2007.  */
+
+#ifndef HASH_TRIPLE_H
+#define HASH_TRIPLE_H
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <stdbool.h>
+
+/* Describe a just-created or just-renamed destination file.  */
+struct F_triple
+{
+  char *name;
+  ino_t st_ino;
+  dev_t st_dev;
+};
+
+/* Defined in module 'hash-triple-simple'.  */
+
+extern size_t triple_hash (void const *x, size_t table_size) _GL_ATTRIBUTE_PURE;
+extern bool triple_compare_ino_str (void const *x, void const *y)
+  _GL_ATTRIBUTE_PURE;
+extern void triple_free (void *x);
+
+/* Defined in module 'hash-triple'.  */
+extern size_t triple_hash_no_name (void const *x, size_t table_size)
+  _GL_ATTRIBUTE_PURE;
+extern bool triple_compare (void const *x, void const *y);
+
+#endif
diff --git a/lib/hash.c b/lib/hash.c
new file mode 100644 (file)
index 0000000..87aa8f7
--- /dev/null
@@ -0,0 +1,1106 @@
+/* hash - hashing table processing.
+
+   Copyright (C) 1998-2004, 2006-2007, 2009-2021 Free Software Foundation, Inc.
+
+   Written by Jim Meyering, 1992.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* A generic hash table package.  */
+
+/* Define USE_OBSTACK to 1 if you want the allocator to use obstacks instead
+   of malloc.  If you change USE_OBSTACK, you have to recompile!  */
+
+#include <config.h>
+
+#include "hash.h"
+
+#include "bitrotate.h"
+#include "xalloc-oversized.h"
+
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#if USE_OBSTACK
+# include "obstack.h"
+# ifndef obstack_chunk_alloc
+#  define obstack_chunk_alloc malloc
+# endif
+# ifndef obstack_chunk_free
+#  define obstack_chunk_free free
+# endif
+#endif
+
+struct hash_entry
+  {
+    void *data;
+    struct hash_entry *next;
+  };
+
+struct hash_table
+  {
+    /* The array of buckets starts at BUCKET and extends to BUCKET_LIMIT-1,
+       for a possibility of N_BUCKETS.  Among those, N_BUCKETS_USED buckets
+       are not empty, there are N_ENTRIES active entries in the table.  */
+    struct hash_entry *bucket;
+    struct hash_entry const *bucket_limit;
+    size_t n_buckets;
+    size_t n_buckets_used;
+    size_t n_entries;
+
+    /* Tuning arguments, kept in a physically separate structure.  */
+    const Hash_tuning *tuning;
+
+    /* Three functions are given to 'hash_initialize', see the documentation
+       block for this function.  In a word, HASHER randomizes a user entry
+       into a number up from 0 up to some maximum minus 1; COMPARATOR returns
+       true if two user entries compare equally; and DATA_FREER is the cleanup
+       function for a user entry.  */
+    Hash_hasher hasher;
+    Hash_comparator comparator;
+    Hash_data_freer data_freer;
+
+    /* A linked list of freed struct hash_entry structs.  */
+    struct hash_entry *free_entry_list;
+
+#if USE_OBSTACK
+    /* Whenever obstacks are used, it is possible to allocate all overflowed
+       entries into a single stack, so they all can be freed in a single
+       operation.  It is not clear if the speedup is worth the trouble.  */
+    struct obstack entry_stack;
+#endif
+  };
+
+/* A hash table contains many internal entries, each holding a pointer to
+   some user-provided data (also called a user entry).  An entry indistinctly
+   refers to both the internal entry and its associated user entry.  A user
+   entry contents may be hashed by a randomization function (the hashing
+   function, or just "hasher" for short) into a number (or "slot") between 0
+   and the current table size.  At each slot position in the hash table,
+   starts a linked chain of entries for which the user data all hash to this
+   slot.  A bucket is the collection of all entries hashing to the same slot.
+
+   A good "hasher" function will distribute entries rather evenly in buckets.
+   In the ideal case, the length of each bucket is roughly the number of
+   entries divided by the table size.  Finding the slot for a data is usually
+   done in constant time by the "hasher", and the later finding of a precise
+   entry is linear in time with the size of the bucket.  Consequently, a
+   larger hash table size (that is, a larger number of buckets) is prone to
+   yielding shorter chains, *given* the "hasher" function behaves properly.
+
+   Long buckets slow down the lookup algorithm.  One might use big hash table
+   sizes in hope to reduce the average length of buckets, but this might
+   become inordinate, as unused slots in the hash table take some space.  The
+   best bet is to make sure you are using a good "hasher" function (beware
+   that those are not that easy to write! :-), and to use a table size
+   larger than the actual number of entries.  */
+
+/* If an insertion makes the ratio of nonempty buckets to table size larger
+   than the growth threshold (a number between 0.0 and 1.0), then increase
+   the table size by multiplying by the growth factor (a number greater than
+   1.0).  The growth threshold defaults to 0.8, and the growth factor
+   defaults to 1.414, meaning that the table will have doubled its size
+   every second time 80% of the buckets get used.  */
+#define DEFAULT_GROWTH_THRESHOLD 0.8f
+#define DEFAULT_GROWTH_FACTOR 1.414f
+
+/* If a deletion empties a bucket and causes the ratio of used buckets to
+   table size to become smaller than the shrink threshold (a number between
+   0.0 and 1.0), then shrink the table by multiplying by the shrink factor (a
+   number greater than the shrink threshold but smaller than 1.0).  The shrink
+   threshold and factor default to 0.0 and 1.0, meaning that the table never
+   shrinks.  */
+#define DEFAULT_SHRINK_THRESHOLD 0.0f
+#define DEFAULT_SHRINK_FACTOR 1.0f
+
+/* Use this to initialize or reset a TUNING structure to
+   some sensible values. */
+static const Hash_tuning default_tuning =
+  {
+    DEFAULT_SHRINK_THRESHOLD,
+    DEFAULT_SHRINK_FACTOR,
+    DEFAULT_GROWTH_THRESHOLD,
+    DEFAULT_GROWTH_FACTOR,
+    false
+  };
+
+/* Information and lookup.  */
+
+size_t
+hash_get_n_buckets (const Hash_table *table)
+{
+  return table->n_buckets;
+}
+
+size_t
+hash_get_n_buckets_used (const Hash_table *table)
+{
+  return table->n_buckets_used;
+}
+
+size_t
+hash_get_n_entries (const Hash_table *table)
+{
+  return table->n_entries;
+}
+
+size_t
+hash_get_max_bucket_length (const Hash_table *table)
+{
+  struct hash_entry const *bucket;
+  size_t max_bucket_length = 0;
+
+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+    {
+      if (bucket->data)
+        {
+          struct hash_entry const *cursor = bucket;
+          size_t bucket_length = 1;
+
+          while (cursor = cursor->next, cursor)
+            bucket_length++;
+
+          if (bucket_length > max_bucket_length)
+            max_bucket_length = bucket_length;
+        }
+    }
+
+  return max_bucket_length;
+}
+
+bool
+hash_table_ok (const Hash_table *table)
+{
+  struct hash_entry const *bucket;
+  size_t n_buckets_used = 0;
+  size_t n_entries = 0;
+
+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+    {
+      if (bucket->data)
+        {
+          struct hash_entry const *cursor = bucket;
+
+          /* Count bucket head.  */
+          n_buckets_used++;
+          n_entries++;
+
+          /* Count bucket overflow.  */
+          while (cursor = cursor->next, cursor)
+            n_entries++;
+        }
+    }
+
+  if (n_buckets_used == table->n_buckets_used && n_entries == table->n_entries)
+    return true;
+
+  return false;
+}
+
+void
+hash_print_statistics (const Hash_table *table, FILE *stream)
+{
+  size_t n_entries = hash_get_n_entries (table);
+  size_t n_buckets = hash_get_n_buckets (table);
+  size_t n_buckets_used = hash_get_n_buckets_used (table);
+  size_t max_bucket_length = hash_get_max_bucket_length (table);
+
+  fprintf (stream, "# entries:         %lu\n", (unsigned long int) n_entries);
+  fprintf (stream, "# buckets:         %lu\n", (unsigned long int) n_buckets);
+  fprintf (stream, "# buckets used:    %lu (%.2f%%)\n",
+           (unsigned long int) n_buckets_used,
+           (100.0 * n_buckets_used) / n_buckets);
+  fprintf (stream, "max bucket length: %lu\n",
+           (unsigned long int) max_bucket_length);
+}
+
+/* Hash KEY and return a pointer to the selected bucket.
+   If TABLE->hasher misbehaves, abort.  */
+static struct hash_entry *
+safe_hasher (const Hash_table *table, const void *key)
+{
+  size_t n = table->hasher (key, table->n_buckets);
+  if (! (n < table->n_buckets))
+    abort ();
+  return table->bucket + n;
+}
+
+void *
+hash_lookup (const Hash_table *table, const void *entry)
+{
+  struct hash_entry const *bucket = safe_hasher (table, entry);
+  struct hash_entry const *cursor;
+
+  if (bucket->data == NULL)
+    return NULL;
+
+  for (cursor = bucket; cursor; cursor = cursor->next)
+    if (entry == cursor->data || table->comparator (entry, cursor->data))
+      return cursor->data;
+
+  return NULL;
+}
+
+/* Walking.  */
+
+void *
+hash_get_first (const Hash_table *table)
+{
+  struct hash_entry const *bucket;
+
+  if (table->n_entries == 0)
+    return NULL;
+
+  for (bucket = table->bucket; ; bucket++)
+    if (! (bucket < table->bucket_limit))
+      abort ();
+    else if (bucket->data)
+      return bucket->data;
+}
+
+void *
+hash_get_next (const Hash_table *table, const void *entry)
+{
+  struct hash_entry const *bucket = safe_hasher (table, entry);
+  struct hash_entry const *cursor;
+
+  /* Find next entry in the same bucket.  */
+  cursor = bucket;
+  do
+    {
+      if (cursor->data == entry && cursor->next)
+        return cursor->next->data;
+      cursor = cursor->next;
+    }
+  while (cursor != NULL);
+
+  /* Find first entry in any subsequent bucket.  */
+  while (++bucket < table->bucket_limit)
+    if (bucket->data)
+      return bucket->data;
+
+  /* None found.  */
+  return NULL;
+}
+
+size_t
+hash_get_entries (const Hash_table *table, void **buffer,
+                  size_t buffer_size)
+{
+  size_t counter = 0;
+  struct hash_entry const *bucket;
+  struct hash_entry const *cursor;
+
+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+    {
+      if (bucket->data)
+        {
+          for (cursor = bucket; cursor; cursor = cursor->next)
+            {
+              if (counter >= buffer_size)
+                return counter;
+              buffer[counter++] = cursor->data;
+            }
+        }
+    }
+
+  return counter;
+}
+
+size_t
+hash_do_for_each (const Hash_table *table, Hash_processor processor,
+                  void *processor_data)
+{
+  size_t counter = 0;
+  struct hash_entry const *bucket;
+  struct hash_entry const *cursor;
+
+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+    {
+      if (bucket->data)
+        {
+          for (cursor = bucket; cursor; cursor = cursor->next)
+            {
+              if (! processor (cursor->data, processor_data))
+                return counter;
+              counter++;
+            }
+        }
+    }
+
+  return counter;
+}
+
+/* Allocation and clean-up.  */
+
+#if USE_DIFF_HASH
+
+/* About hashings, Paul Eggert writes to me (FP), on 1994-01-01: "Please see
+   B. J. McKenzie, R. Harries & T. Bell, Selecting a hashing algorithm,
+   Software--practice & experience 20, 2 (Feb 1990), 209-224.  Good hash
+   algorithms tend to be domain-specific, so what's good for [diffutils'] io.c
+   may not be good for your application."  */
+
+size_t
+hash_string (const char *string, size_t n_buckets)
+{
+# define HASH_ONE_CHAR(Value, Byte) \
+  ((Byte) + rotl_sz (Value, 7))
+
+  size_t value = 0;
+  unsigned char ch;
+
+  for (; (ch = *string); string++)
+    value = HASH_ONE_CHAR (value, ch);
+  return value % n_buckets;
+
+# undef HASH_ONE_CHAR
+}
+
+#else /* not USE_DIFF_HASH */
+
+/* This one comes from 'recode', and performs a bit better than the above as
+   per a few experiments.  It is inspired from a hashing routine found in the
+   very old Cyber 'snoop', itself written in typical Greg Mansfield style.
+   (By the way, what happened to this excellent man?  Is he still alive?)  */
+
+size_t
+hash_string (const char *string, size_t n_buckets)
+{
+  size_t value = 0;
+  unsigned char ch;
+
+  for (; (ch = *string); string++)
+    value = (value * 31 + ch) % n_buckets;
+  return value;
+}
+
+#endif /* not USE_DIFF_HASH */
+
+/* Return true if CANDIDATE is a prime number.  CANDIDATE should be an odd
+   number at least equal to 11.  */
+
+static bool _GL_ATTRIBUTE_CONST
+is_prime (size_t candidate)
+{
+  size_t divisor = 3;
+  size_t square = divisor * divisor;
+
+  while (square < candidate && (candidate % divisor))
+    {
+      divisor++;
+      square += 4 * divisor;
+      divisor++;
+    }
+
+  return (candidate % divisor ? true : false);
+}
+
+/* Round a given CANDIDATE number up to the nearest prime, and return that
+   prime.  Primes lower than 10 are merely skipped.  */
+
+static size_t _GL_ATTRIBUTE_CONST
+next_prime (size_t candidate)
+{
+  /* Skip small primes.  */
+  if (candidate < 10)
+    candidate = 10;
+
+  /* Make it definitely odd.  */
+  candidate |= 1;
+
+  while (SIZE_MAX != candidate && !is_prime (candidate))
+    candidate += 2;
+
+  return candidate;
+}
+
+void
+hash_reset_tuning (Hash_tuning *tuning)
+{
+  *tuning = default_tuning;
+}
+
+/* If the user passes a NULL hasher, we hash the raw pointer.  */
+static size_t
+raw_hasher (const void *data, size_t n)
+{
+  /* When hashing unique pointers, it is often the case that they were
+     generated by malloc and thus have the property that the low-order
+     bits are 0.  As this tends to give poorer performance with small
+     tables, we rotate the pointer value before performing division,
+     in an attempt to improve hash quality.  */
+  size_t val = rotr_sz ((size_t) data, 3);
+  return val % n;
+}
+
+/* If the user passes a NULL comparator, we use pointer comparison.  */
+static bool
+raw_comparator (const void *a, const void *b)
+{
+  return a == b;
+}
+
+
+/* For the given hash TABLE, check the user supplied tuning structure for
+   reasonable values, and return true if there is no gross error with it.
+   Otherwise, definitively reset the TUNING field to some acceptable default
+   in the hash table (that is, the user loses the right of further modifying
+   tuning arguments), and return false.  */
+
+static bool
+check_tuning (Hash_table *table)
+{
+  const Hash_tuning *tuning = table->tuning;
+  float epsilon;
+  if (tuning == &default_tuning)
+    return true;
+
+  /* Be a bit stricter than mathematics would require, so that
+     rounding errors in size calculations do not cause allocations to
+     fail to grow or shrink as they should.  The smallest allocation
+     is 11 (due to next_prime's algorithm), so an epsilon of 0.1
+     should be good enough.  */
+  epsilon = 0.1f;
+
+  if (epsilon < tuning->growth_threshold
+      && tuning->growth_threshold < 1 - epsilon
+      && 1 + epsilon < tuning->growth_factor
+      && 0 <= tuning->shrink_threshold
+      && tuning->shrink_threshold + epsilon < tuning->shrink_factor
+      && tuning->shrink_factor <= 1
+      && tuning->shrink_threshold + epsilon < tuning->growth_threshold)
+    return true;
+
+  table->tuning = &default_tuning;
+  return false;
+}
+
+/* Compute the size of the bucket array for the given CANDIDATE and
+   TUNING, or return 0 if there is no possible way to allocate that
+   many entries.  */
+
+static size_t _GL_ATTRIBUTE_PURE
+compute_bucket_size (size_t candidate, const Hash_tuning *tuning)
+{
+  if (!tuning->is_n_buckets)
+    {
+      float new_candidate = candidate / tuning->growth_threshold;
+      if ((float) SIZE_MAX <= new_candidate)
+        return 0;
+      candidate = new_candidate;
+    }
+  candidate = next_prime (candidate);
+  if (xalloc_oversized (candidate, sizeof (struct hash_entry *)))
+    return 0;
+  return candidate;
+}
+
+Hash_table *
+hash_initialize (size_t candidate, const Hash_tuning *tuning,
+                 Hash_hasher hasher, Hash_comparator comparator,
+                 Hash_data_freer data_freer)
+{
+  Hash_table *table;
+
+  if (hasher == NULL)
+    hasher = raw_hasher;
+  if (comparator == NULL)
+    comparator = raw_comparator;
+
+  table = malloc (sizeof *table);
+  if (table == NULL)
+    return NULL;
+
+  if (!tuning)
+    tuning = &default_tuning;
+  table->tuning = tuning;
+  if (!check_tuning (table))
+    {
+      /* Fail if the tuning options are invalid.  This is the only occasion
+         when the user gets some feedback about it.  Once the table is created,
+         if the user provides invalid tuning options, we silently revert to
+         using the defaults, and ignore further request to change the tuning
+         options.  */
+      goto fail;
+    }
+
+  table->n_buckets = compute_bucket_size (candidate, tuning);
+  if (!table->n_buckets)
+    goto fail;
+
+  table->bucket = calloc (table->n_buckets, sizeof *table->bucket);
+  if (table->bucket == NULL)
+    goto fail;
+  table->bucket_limit = table->bucket + table->n_buckets;
+  table->n_buckets_used = 0;
+  table->n_entries = 0;
+
+  table->hasher = hasher;
+  table->comparator = comparator;
+  table->data_freer = data_freer;
+
+  table->free_entry_list = NULL;
+#if USE_OBSTACK
+  obstack_init (&table->entry_stack);
+#endif
+  return table;
+
+ fail:
+  free (table);
+  return NULL;
+}
+
+void
+hash_clear (Hash_table *table)
+{
+  struct hash_entry *bucket;
+
+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+    {
+      if (bucket->data)
+        {
+          struct hash_entry *cursor;
+          struct hash_entry *next;
+
+          /* Free the bucket overflow.  */
+          for (cursor = bucket->next; cursor; cursor = next)
+            {
+              if (table->data_freer)
+                table->data_freer (cursor->data);
+              cursor->data = NULL;
+
+              next = cursor->next;
+              /* Relinking is done one entry at a time, as it is to be expected
+                 that overflows are either rare or short.  */
+              cursor->next = table->free_entry_list;
+              table->free_entry_list = cursor;
+            }
+
+          /* Free the bucket head.  */
+          if (table->data_freer)
+            table->data_freer (bucket->data);
+          bucket->data = NULL;
+          bucket->next = NULL;
+        }
+    }
+
+  table->n_buckets_used = 0;
+  table->n_entries = 0;
+}
+
+void
+hash_free (Hash_table *table)
+{
+  struct hash_entry *bucket;
+  struct hash_entry *cursor;
+  struct hash_entry *next;
+
+  /* Call the user data_freer function.  */
+  if (table->data_freer && table->n_entries)
+    {
+      for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+        {
+          if (bucket->data)
+            {
+              for (cursor = bucket; cursor; cursor = cursor->next)
+                table->data_freer (cursor->data);
+            }
+        }
+    }
+
+#if USE_OBSTACK
+
+  obstack_free (&table->entry_stack, NULL);
+
+#else
+
+  /* Free all bucket overflowed entries.  */
+  for (bucket = table->bucket; bucket < table->bucket_limit; bucket++)
+    {
+      for (cursor = bucket->next; cursor; cursor = next)
+        {
+          next = cursor->next;
+          free (cursor);
+        }
+    }
+
+  /* Also reclaim the internal list of previously freed entries.  */
+  for (cursor = table->free_entry_list; cursor; cursor = next)
+    {
+      next = cursor->next;
+      free (cursor);
+    }
+
+#endif
+
+  /* Free the remainder of the hash table structure.  */
+  free (table->bucket);
+  free (table);
+}
+
+/* Insertion and deletion.  */
+
+/* Get a new hash entry for a bucket overflow, possibly by recycling a
+   previously freed one.  If this is not possible, allocate a new one.  */
+
+static struct hash_entry *
+allocate_entry (Hash_table *table)
+{
+  struct hash_entry *new;
+
+  if (table->free_entry_list)
+    {
+      new = table->free_entry_list;
+      table->free_entry_list = new->next;
+    }
+  else
+    {
+#if USE_OBSTACK
+      new = obstack_alloc (&table->entry_stack, sizeof *new);
+#else
+      new = malloc (sizeof *new);
+#endif
+    }
+
+  return new;
+}
+
+/* Free a hash entry which was part of some bucket overflow,
+   saving it for later recycling.  */
+
+static void
+free_entry (Hash_table *table, struct hash_entry *entry)
+{
+  entry->data = NULL;
+  entry->next = table->free_entry_list;
+  table->free_entry_list = entry;
+}
+
+/* This private function is used to help with insertion and deletion.  When
+   ENTRY matches an entry in the table, return a pointer to the corresponding
+   user data and set *BUCKET_HEAD to the head of the selected bucket.
+   Otherwise, return NULL.  When DELETE is true and ENTRY matches an entry in
+   the table, unlink the matching entry.  */
+
+static void *
+hash_find_entry (Hash_table *table, const void *entry,
+                 struct hash_entry **bucket_head, bool delete)
+{
+  struct hash_entry *bucket = safe_hasher (table, entry);
+  struct hash_entry *cursor;
+
+  *bucket_head = bucket;
+
+  /* Test for empty bucket.  */
+  if (bucket->data == NULL)
+    return NULL;
+
+  /* See if the entry is the first in the bucket.  */
+  if (entry == bucket->data || table->comparator (entry, bucket->data))
+    {
+      void *data = bucket->data;
+
+      if (delete)
+        {
+          if (bucket->next)
+            {
+              struct hash_entry *next = bucket->next;
+
+              /* Bump the first overflow entry into the bucket head, then save
+                 the previous first overflow entry for later recycling.  */
+              *bucket = *next;
+              free_entry (table, next);
+            }
+          else
+            {
+              bucket->data = NULL;
+            }
+        }
+
+      return data;
+    }
+
+  /* Scan the bucket overflow.  */
+  for (cursor = bucket; cursor->next; cursor = cursor->next)
+    {
+      if (entry == cursor->next->data
+          || table->comparator (entry, cursor->next->data))
+        {
+          void *data = cursor->next->data;
+
+          if (delete)
+            {
+              struct hash_entry *next = cursor->next;
+
+              /* Unlink the entry to delete, then save the freed entry for later
+                 recycling.  */
+              cursor->next = next->next;
+              free_entry (table, next);
+            }
+
+          return data;
+        }
+    }
+
+  /* No entry found.  */
+  return NULL;
+}
+
+/* Internal helper, to move entries from SRC to DST.  Both tables must
+   share the same free entry list.  If SAFE, only move overflow
+   entries, saving bucket heads for later, so that no allocations will
+   occur.  Return false if the free entry list is exhausted and an
+   allocation fails.  */
+
+static bool
+transfer_entries (Hash_table *dst, Hash_table *src, bool safe)
+{
+  struct hash_entry *bucket;
+  struct hash_entry *cursor;
+  struct hash_entry *next;
+  for (bucket = src->bucket; bucket < src->bucket_limit; bucket++)
+    if (bucket->data)
+      {
+        void *data;
+        struct hash_entry *new_bucket;
+
+        /* Within each bucket, transfer overflow entries first and
+           then the bucket head, to minimize memory pressure.  After
+           all, the only time we might allocate is when moving the
+           bucket head, but moving overflow entries first may create
+           free entries that can be recycled by the time we finally
+           get to the bucket head.  */
+        for (cursor = bucket->next; cursor; cursor = next)
+          {
+            data = cursor->data;
+            new_bucket = safe_hasher (dst, data);
+
+            next = cursor->next;
+
+            if (new_bucket->data)
+              {
+                /* Merely relink an existing entry, when moving from a
+                   bucket overflow into a bucket overflow.  */
+                cursor->next = new_bucket->next;
+                new_bucket->next = cursor;
+              }
+            else
+              {
+                /* Free an existing entry, when moving from a bucket
+                   overflow into a bucket header.  */
+                new_bucket->data = data;
+                dst->n_buckets_used++;
+                free_entry (dst, cursor);
+              }
+          }
+        /* Now move the bucket head.  Be sure that if we fail due to
+           allocation failure that the src table is in a consistent
+           state.  */
+        data = bucket->data;
+        bucket->next = NULL;
+        if (safe)
+          continue;
+        new_bucket = safe_hasher (dst, data);
+
+        if (new_bucket->data)
+          {
+            /* Allocate or recycle an entry, when moving from a bucket
+               header into a bucket overflow.  */
+            struct hash_entry *new_entry = allocate_entry (dst);
+
+            if (new_entry == NULL)
+              return false;
+
+            new_entry->data = data;
+            new_entry->next = new_bucket->next;
+            new_bucket->next = new_entry;
+          }
+        else
+          {
+            /* Move from one bucket header to another.  */
+            new_bucket->data = data;
+            dst->n_buckets_used++;
+          }
+        bucket->data = NULL;
+        src->n_buckets_used--;
+      }
+  return true;
+}
+
+bool
+hash_rehash (Hash_table *table, size_t candidate)
+{
+  Hash_table storage;
+  Hash_table *new_table;
+  size_t new_size = compute_bucket_size (candidate, table->tuning);
+
+  if (!new_size)
+    return false;
+  if (new_size == table->n_buckets)
+    return true;
+  new_table = &storage;
+  new_table->bucket = calloc (new_size, sizeof *new_table->bucket);
+  if (new_table->bucket == NULL)
+    return false;
+  new_table->n_buckets = new_size;
+  new_table->bucket_limit = new_table->bucket + new_size;
+  new_table->n_buckets_used = 0;
+  new_table->n_entries = 0;
+  new_table->tuning = table->tuning;
+  new_table->hasher = table->hasher;
+  new_table->comparator = table->comparator;
+  new_table->data_freer = table->data_freer;
+
+  /* In order for the transfer to successfully complete, we need
+     additional overflow entries when distinct buckets in the old
+     table collide into a common bucket in the new table.  The worst
+     case possible is a hasher that gives a good spread with the old
+     size, but returns a constant with the new size; if we were to
+     guarantee table->n_buckets_used-1 free entries in advance, then
+     the transfer would be guaranteed to not allocate memory.
+     However, for large tables, a guarantee of no further allocation
+     introduces a lot of extra memory pressure, all for an unlikely
+     corner case (most rehashes reduce, rather than increase, the
+     number of overflow entries needed).  So, we instead ensure that
+     the transfer process can be reversed if we hit a memory
+     allocation failure mid-transfer.  */
+
+  /* Merely reuse the extra old space into the new table.  */
+#if USE_OBSTACK
+  new_table->entry_stack = table->entry_stack;
+#endif
+  new_table->free_entry_list = table->free_entry_list;
+
+  if (transfer_entries (new_table, table, false))
+    {
+      /* Entries transferred successfully; tie up the loose ends.  */
+      free (table->bucket);
+      table->bucket = new_table->bucket;
+      table->bucket_limit = new_table->bucket_limit;
+      table->n_buckets = new_table->n_buckets;
+      table->n_buckets_used = new_table->n_buckets_used;
+      table->free_entry_list = new_table->free_entry_list;
+      /* table->n_entries and table->entry_stack already hold their value.  */
+      return true;
+    }
+
+  /* We've allocated new_table->bucket (and possibly some entries),
+     exhausted the free list, and moved some but not all entries into
+     new_table.  We must undo the partial move before returning
+     failure.  The only way to get into this situation is if new_table
+     uses fewer buckets than the old table, so we will reclaim some
+     free entries as overflows in the new table are put back into
+     distinct buckets in the old table.
+
+     There are some pathological cases where a single pass through the
+     table requires more intermediate overflow entries than using two
+     passes.  Two passes give worse cache performance and takes
+     longer, but at this point, we're already out of memory, so slow
+     and safe is better than failure.  */
+  table->free_entry_list = new_table->free_entry_list;
+  if (! (transfer_entries (table, new_table, true)
+         && transfer_entries (table, new_table, false)))
+    abort ();
+  /* table->n_entries already holds its value.  */
+  free (new_table->bucket);
+  return false;
+}
+
+int
+hash_insert_if_absent (Hash_table *table, void const *entry,
+                       void const **matched_ent)
+{
+  void *data;
+  struct hash_entry *bucket;
+
+  /* The caller cannot insert a NULL entry, since hash_lookup returns NULL
+     to indicate "not found", and hash_find_entry uses "bucket->data == NULL"
+     to indicate an empty bucket.  */
+  if (! entry)
+    abort ();
+
+  /* If there's a matching entry already in the table, return that.  */
+  if ((data = hash_find_entry (table, entry, &bucket, false)) != NULL)
+    {
+      if (matched_ent)
+        *matched_ent = data;
+      return 0;
+    }
+
+  /* If the growth threshold of the buckets in use has been reached, increase
+     the table size and rehash.  There's no point in checking the number of
+     entries:  if the hashing function is ill-conditioned, rehashing is not
+     likely to improve it.  */
+
+  if (table->n_buckets_used
+      > table->tuning->growth_threshold * table->n_buckets)
+    {
+      /* Check more fully, before starting real work.  If tuning arguments
+         became invalid, the second check will rely on proper defaults.  */
+      check_tuning (table);
+      if (table->n_buckets_used
+          > table->tuning->growth_threshold * table->n_buckets)
+        {
+          const Hash_tuning *tuning = table->tuning;
+          float candidate =
+            (tuning->is_n_buckets
+             ? (table->n_buckets * tuning->growth_factor)
+             : (table->n_buckets * tuning->growth_factor
+                * tuning->growth_threshold));
+
+          if ((float) SIZE_MAX <= candidate)
+            return -1;
+
+          /* If the rehash fails, arrange to return NULL.  */
+          if (!hash_rehash (table, candidate))
+            return -1;
+
+          /* Update the bucket we are interested in.  */
+          if (hash_find_entry (table, entry, &bucket, false) != NULL)
+            abort ();
+        }
+    }
+
+  /* ENTRY is not matched, it should be inserted.  */
+
+  if (bucket->data)
+    {
+      struct hash_entry *new_entry = allocate_entry (table);
+
+      if (new_entry == NULL)
+        return -1;
+
+      /* Add ENTRY in the overflow of the bucket.  */
+
+      new_entry->data = (void *) entry;
+      new_entry->next = bucket->next;
+      bucket->next = new_entry;
+      table->n_entries++;
+      return 1;
+    }
+
+  /* Add ENTRY right in the bucket head.  */
+
+  bucket->data = (void *) entry;
+  table->n_entries++;
+  table->n_buckets_used++;
+
+  return 1;
+}
+
+void *
+hash_insert (Hash_table *table, void const *entry)
+{
+  void const *matched_ent;
+  int err = hash_insert_if_absent (table, entry, &matched_ent);
+  return (err == -1
+          ? NULL
+          : (void *) (err == 0 ? matched_ent : entry));
+}
+
+void *
+hash_remove (Hash_table *table, const void *entry)
+{
+  void *data;
+  struct hash_entry *bucket;
+
+  data = hash_find_entry (table, entry, &bucket, true);
+  if (!data)
+    return NULL;
+
+  table->n_entries--;
+  if (!bucket->data)
+    {
+      table->n_buckets_used--;
+
+      /* If the shrink threshold of the buckets in use has been reached,
+         rehash into a smaller table.  */
+
+      if (table->n_buckets_used
+          < table->tuning->shrink_threshold * table->n_buckets)
+        {
+          /* Check more fully, before starting real work.  If tuning arguments
+             became invalid, the second check will rely on proper defaults.  */
+          check_tuning (table);
+          if (table->n_buckets_used
+              < table->tuning->shrink_threshold * table->n_buckets)
+            {
+              const Hash_tuning *tuning = table->tuning;
+              size_t candidate =
+                (tuning->is_n_buckets
+                 ? table->n_buckets * tuning->shrink_factor
+                 : (table->n_buckets * tuning->shrink_factor
+                    * tuning->growth_threshold));
+
+              if (!hash_rehash (table, candidate))
+                {
+                  /* Failure to allocate memory in an attempt to
+                     shrink the table is not fatal.  But since memory
+                     is low, we can at least be kind and free any
+                     spare entries, rather than keeping them tied up
+                     in the free entry list.  */
+#if ! USE_OBSTACK
+                  struct hash_entry *cursor = table->free_entry_list;
+                  struct hash_entry *next;
+                  while (cursor)
+                    {
+                      next = cursor->next;
+                      free (cursor);
+                      cursor = next;
+                    }
+                  table->free_entry_list = NULL;
+#endif
+                }
+            }
+        }
+    }
+
+  return data;
+}
+
+void *
+hash_delete (Hash_table *table, const void *entry)
+{
+  return hash_remove (table, entry);
+}
+
+/* Testing.  */
+
+#if TESTING
+
+void
+hash_print (const Hash_table *table)
+{
+  struct hash_entry *bucket = (struct hash_entry *) table->bucket;
+
+  for ( ; bucket < table->bucket_limit; bucket++)
+    {
+      struct hash_entry *cursor;
+
+      if (bucket)
+        printf ("%lu:\n", (unsigned long int) (bucket - table->bucket));
+
+      for (cursor = bucket; cursor; cursor = cursor->next)
+        {
+          char const *s = cursor->data;
+          /* FIXME */
+          if (s)
+            printf ("  %s\n", s);
+        }
+    }
+}
+
+#endif /* TESTING */
diff --git a/lib/hash.h b/lib/hash.h
new file mode 100644 (file)
index 0000000..ae68921
--- /dev/null
@@ -0,0 +1,261 @@
+/* hash - hashing table processing.
+   Copyright (C) 1998-1999, 2001, 2003, 2009-2021 Free Software Foundation,
+   Inc.
+   Written by Jim Meyering <meyering@ascend.com>, 1998.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* A generic hash table package.  */
+
+/* Make sure USE_OBSTACK is defined to 1 if you want the allocator to use
+   obstacks instead of malloc, and recompile 'hash.c' with same setting.  */
+
+#ifndef HASH_H_
+# define HASH_H_
+
+# include <stdio.h>
+# include <stdbool.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+struct hash_tuning
+  {
+    /* This structure is mainly used for 'hash_initialize', see the block
+       documentation of 'hash_reset_tuning' for more complete comments.  */
+
+    float shrink_threshold;     /* ratio of used buckets to trigger a shrink */
+    float shrink_factor;        /* ratio of new smaller size to original size */
+    float growth_threshold;     /* ratio of used buckets to trigger a growth */
+    float growth_factor;        /* ratio of new bigger size to original size */
+    bool is_n_buckets;          /* if CANDIDATE really means table size */
+  };
+
+typedef struct hash_tuning Hash_tuning;
+
+struct hash_table;
+
+typedef struct hash_table Hash_table;
+
+/*
+ * Information and lookup.
+ */
+
+/* The following few functions provide information about the overall hash
+   table organization: the number of entries, number of buckets and maximum
+   length of buckets.  */
+
+/* Return the number of buckets in the hash table.  The table size, the total
+   number of buckets (used plus unused), or the maximum number of slots, are
+   the same quantity.  */
+extern size_t hash_get_n_buckets (const Hash_table *table)
+       _GL_ATTRIBUTE_PURE;
+
+/* Return the number of slots in use (non-empty buckets).  */
+extern size_t hash_get_n_buckets_used (const Hash_table *table)
+       _GL_ATTRIBUTE_PURE;
+
+/* Return the number of active entries.  */
+extern size_t hash_get_n_entries (const Hash_table *table)
+       _GL_ATTRIBUTE_PURE;
+
+/* Return the length of the longest chain (bucket).  */
+extern size_t hash_get_max_bucket_length (const Hash_table *table)
+       _GL_ATTRIBUTE_PURE;
+
+/* Do a mild validation of a hash table, by traversing it and checking two
+   statistics.  */
+extern bool hash_table_ok (const Hash_table *table)
+       _GL_ATTRIBUTE_PURE;
+
+extern void hash_print_statistics (const Hash_table *table, FILE *stream);
+
+/* If ENTRY matches an entry already in the hash table, return the
+   entry from the table.  Otherwise, return NULL.  */
+extern void *hash_lookup (const Hash_table *table, const void *entry);
+
+/*
+ * Walking.
+ */
+
+/* The functions in this page traverse the hash table and process the
+   contained entries.  For the traversal to work properly, the hash table
+   should not be resized nor modified while any particular entry is being
+   processed.  In particular, entries should not be added, and an entry
+   may be removed only if there is no shrink threshold and the entry being
+   removed has already been passed to hash_get_next.  */
+
+/* Return the first data in the table, or NULL if the table is empty.  */
+extern void *hash_get_first (const Hash_table *table)
+       _GL_ATTRIBUTE_PURE;
+
+/* Return the user data for the entry following ENTRY, where ENTRY has been
+   returned by a previous call to either 'hash_get_first' or 'hash_get_next'.
+   Return NULL if there are no more entries.  */
+extern void *hash_get_next (const Hash_table *table, const void *entry);
+
+/* Fill BUFFER with pointers to active user entries in the hash table, then
+   return the number of pointers copied.  Do not copy more than BUFFER_SIZE
+   pointers.  */
+extern size_t hash_get_entries (const Hash_table *table, void **buffer,
+                                size_t buffer_size);
+
+typedef bool (*Hash_processor) (void *entry, void *processor_data);
+
+/* Call a PROCESSOR function for each entry of a hash table, and return the
+   number of entries for which the processor function returned success.  A
+   pointer to some PROCESSOR_DATA which will be made available to each call to
+   the processor function.  The PROCESSOR accepts two arguments: the first is
+   the user entry being walked into, the second is the value of PROCESSOR_DATA
+   as received.  The walking continue for as long as the PROCESSOR function
+   returns nonzero.  When it returns zero, the walking is interrupted.  */
+extern size_t hash_do_for_each (const Hash_table *table,
+                                Hash_processor processor, void *processor_data);
+
+/*
+ * Allocation and clean-up.
+ */
+
+/* Return a hash index for a NUL-terminated STRING between 0 and N_BUCKETS-1.
+   This is a convenience routine for constructing other hashing functions.  */
+extern size_t hash_string (const char *string, size_t n_buckets)
+       _GL_ATTRIBUTE_PURE;
+
+extern void hash_reset_tuning (Hash_tuning *tuning);
+
+typedef size_t (*Hash_hasher) (const void *entry, size_t table_size);
+typedef bool (*Hash_comparator) (const void *entry1, const void *entry2);
+typedef void (*Hash_data_freer) (void *entry);
+
+/* Allocate and return a new hash table, or NULL upon failure.  The initial
+   number of buckets is automatically selected so as to _guarantee_ that you
+   may insert at least CANDIDATE different user entries before any growth of
+   the hash table size occurs.  So, if have a reasonably tight a-priori upper
+   bound on the number of entries you intend to insert in the hash table, you
+   may save some table memory and insertion time, by specifying it here.  If
+   the IS_N_BUCKETS field of the TUNING structure is true, the CANDIDATE
+   argument has its meaning changed to the wanted number of buckets.
+
+   TUNING points to a structure of user-supplied values, in case some fine
+   tuning is wanted over the default behavior of the hasher.  If TUNING is
+   NULL, the default tuning parameters are used instead.  If TUNING is
+   provided but the values requested are out of bounds or might cause
+   rounding errors, return NULL.
+
+   The user-supplied HASHER function, when not NULL, accepts two
+   arguments ENTRY and TABLE_SIZE.  It computes, by hashing ENTRY contents, a
+   slot number for that entry which should be in the range 0..TABLE_SIZE-1.
+   This slot number is then returned.
+
+   The user-supplied COMPARATOR function, when not NULL, accepts two
+   arguments pointing to user data, it then returns true for a pair of entries
+   that compare equal, or false otherwise.  This function is internally called
+   on entries which are already known to hash to the same bucket index,
+   but which are distinct pointers.
+
+   The user-supplied DATA_FREER function, when not NULL, may be later called
+   with the user data as an argument, just before the entry containing the
+   data gets freed.  This happens from within 'hash_free' or 'hash_clear'.
+   You should specify this function only if you want these functions to free
+   all of your 'data' data.  This is typically the case when your data is
+   simply an auxiliary struct that you have malloc'd to aggregate several
+   values.  */
+extern Hash_table *hash_initialize (size_t candidate,
+                                    const Hash_tuning *tuning,
+                                    Hash_hasher hasher,
+                                    Hash_comparator comparator,
+                                    Hash_data_freer data_freer)
+       _GL_ATTRIBUTE_NODISCARD;
+
+/* Same as hash_initialize, but invokes xalloc_die on memory exhaustion.  */
+/* This function is defined by module 'xhash'.  */
+extern Hash_table *hash_xinitialize (size_t candidate,
+                                     const Hash_tuning *tuning,
+                                     Hash_hasher hasher,
+                                     Hash_comparator comparator,
+                                     Hash_data_freer data_freer)
+       _GL_ATTRIBUTE_NODISCARD;
+
+/* Make all buckets empty, placing any chained entries on the free list.
+   Apply the user-specified function data_freer (if any) to the datas of any
+   affected entries.  */
+extern void hash_clear (Hash_table *table);
+
+/* Reclaim all storage associated with a hash table.  If a data_freer
+   function has been supplied by the user when the hash table was created,
+   this function applies it to the data of each entry before freeing that
+   entry.  */
+extern void hash_free (Hash_table *table);
+
+/*
+ * Insertion and deletion.
+ */
+
+/* For an already existing hash table, change the number of buckets through
+   specifying CANDIDATE.  The contents of the hash table are preserved.  The
+   new number of buckets is automatically selected so as to _guarantee_ that
+   the table may receive at least CANDIDATE different user entries, including
+   those already in the table, before any other growth of the hash table size
+   occurs.  If TUNING->IS_N_BUCKETS is true, then CANDIDATE specifies the
+   exact number of buckets desired.  Return true iff the rehash succeeded.  */
+extern bool hash_rehash (Hash_table *table, size_t candidate)
+       _GL_ATTRIBUTE_NODISCARD;
+
+/* If ENTRY matches an entry already in the hash table, return the pointer
+   to the entry from the table.  Otherwise, insert ENTRY and return ENTRY.
+   Return NULL if the storage required for insertion cannot be allocated.
+   This implementation does not support duplicate entries or insertion of
+   NULL.  */
+extern void *hash_insert (Hash_table *table, const void *entry)
+       _GL_ATTRIBUTE_NODISCARD;
+
+/* Same as hash_insert, but invokes xalloc_die on memory exhaustion.  */
+/* This function is defined by module 'xhash'.  */
+extern void *hash_xinsert (Hash_table *table, const void *entry);
+
+/* Insert ENTRY into hash TABLE if there is not already a matching entry.
+
+   Return -1 upon memory allocation failure.
+   Return 1 if insertion succeeded.
+   Return 0 if there is already a matching entry in the table,
+   and in that case, if MATCHED_ENT is non-NULL, set *MATCHED_ENT
+   to that entry.
+
+   This interface is easier to use than hash_insert when you must
+   distinguish between the latter two cases.  More importantly,
+   hash_insert is unusable for some types of ENTRY values.  When using
+   hash_insert, the only way to distinguish those cases is to compare
+   the return value and ENTRY.  That works only when you can have two
+   different ENTRY values that point to data that compares "equal".  Thus,
+   when the ENTRY value is a simple scalar, you must use
+   hash_insert_if_absent.  ENTRY must not be NULL.  */
+extern int hash_insert_if_absent (Hash_table *table, const void *entry,
+                                  const void **matched_ent);
+
+/* If ENTRY is already in the table, remove it and return the just-deleted
+   data (the user may want to deallocate its storage).  If ENTRY is not in the
+   table, don't modify the table and return NULL.  */
+extern void *hash_remove (Hash_table *table, const void *entry);
+
+/* Same as hash_remove.  This interface is deprecated.
+   FIXME: Remove in 2022.  */
+extern void *hash_delete (Hash_table *table, const void *entry)
+       _GL_ATTRIBUTE_DEPRECATED;
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
diff --git a/lib/iconv.c b/lib/iconv.c
new file mode 100644 (file)
index 0000000..85bfc71
--- /dev/null
@@ -0,0 +1,446 @@
+/* Character set conversion.
+   Copyright (C) 1999-2001, 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <iconv.h>
+
+#include <stddef.h>
+
+#if REPLACE_ICONV_UTF
+# include <errno.h>
+# include <stdint.h>
+# include <stdlib.h>
+# include "unistr.h"
+#endif
+
+#if REPLACE_ICONV_UTF
+
+/* UTF-{16,32}{BE,LE} converters taken from GNU libiconv 1.11.  */
+
+/* Return code if invalid. (xxx_mbtowc) */
+# define RET_ILSEQ      -1
+/* Return code if no bytes were read. (xxx_mbtowc) */
+# define RET_TOOFEW     -2
+
+/* Return code if invalid. (xxx_wctomb) */
+# define RET_ILUNI      -1
+/* Return code if output buffer is too small. (xxx_wctomb, xxx_reset) */
+# define RET_TOOSMALL   -2
+
+/*
+ * UTF-16BE
+ */
+
+/* Specification: RFC 2781 */
+
+static int
+utf16be_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
+{
+  if (n >= 2)
+    {
+      ucs4_t wc = (s[0] << 8) + s[1];
+      if (wc >= 0xd800 && wc < 0xdc00)
+        {
+          if (n >= 4)
+            {
+              ucs4_t wc2 = (s[2] << 8) + s[3];
+              if (!(wc2 >= 0xdc00 && wc2 < 0xe000))
+                return RET_ILSEQ;
+              *pwc = 0x10000 + ((wc - 0xd800) << 10) + (wc2 - 0xdc00);
+              return 4;
+            }
+        }
+      else if (wc >= 0xdc00 && wc < 0xe000)
+        {
+          return RET_ILSEQ;
+        }
+      else
+        {
+          *pwc = wc;
+          return 2;
+        }
+    }
+  return RET_TOOFEW;
+}
+
+static int
+utf16be_wctomb (unsigned char *r, ucs4_t wc, size_t n)
+{
+  if (!(wc >= 0xd800 && wc < 0xe000))
+    {
+      if (wc < 0x10000)
+        {
+          if (n >= 2)
+            {
+              r[0] = (unsigned char) (wc >> 8);
+              r[1] = (unsigned char) wc;
+              return 2;
+            }
+          else
+            return RET_TOOSMALL;
+        }
+      else if (wc < 0x110000)
+        {
+          if (n >= 4)
+            {
+              ucs4_t wc1 = 0xd800 + ((wc - 0x10000) >> 10);
+              ucs4_t wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff);
+              r[0] = (unsigned char) (wc1 >> 8);
+              r[1] = (unsigned char) wc1;
+              r[2] = (unsigned char) (wc2 >> 8);
+              r[3] = (unsigned char) wc2;
+              return 4;
+            }
+          else
+            return RET_TOOSMALL;
+        }
+    }
+  return RET_ILUNI;
+}
+
+/*
+ * UTF-16LE
+ */
+
+/* Specification: RFC 2781 */
+
+static int
+utf16le_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
+{
+  if (n >= 2)
+    {
+      ucs4_t wc = s[0] + (s[1] << 8);
+      if (wc >= 0xd800 && wc < 0xdc00)
+        {
+          if (n >= 4)
+            {
+              ucs4_t wc2 = s[2] + (s[3] << 8);
+              if (!(wc2 >= 0xdc00 && wc2 < 0xe000))
+                return RET_ILSEQ;
+              *pwc = 0x10000 + ((wc - 0xd800) << 10) + (wc2 - 0xdc00);
+              return 4;
+            }
+        }
+      else if (wc >= 0xdc00 && wc < 0xe000)
+        {
+          return RET_ILSEQ;
+        }
+      else
+        {
+          *pwc = wc;
+          return 2;
+        }
+    }
+  return RET_TOOFEW;
+}
+
+static int
+utf16le_wctomb (unsigned char *r, ucs4_t wc, size_t n)
+{
+  if (!(wc >= 0xd800 && wc < 0xe000))
+    {
+      if (wc < 0x10000)
+        {
+          if (n >= 2)
+            {
+              r[0] = (unsigned char) wc;
+              r[1] = (unsigned char) (wc >> 8);
+              return 2;
+            }
+          else
+            return RET_TOOSMALL;
+        }
+      else if (wc < 0x110000)
+        {
+          if (n >= 4)
+            {
+              ucs4_t wc1 = 0xd800 + ((wc - 0x10000) >> 10);
+              ucs4_t wc2 = 0xdc00 + ((wc - 0x10000) & 0x3ff);
+              r[0] = (unsigned char) wc1;
+              r[1] = (unsigned char) (wc1 >> 8);
+              r[2] = (unsigned char) wc2;
+              r[3] = (unsigned char) (wc2 >> 8);
+              return 4;
+            }
+          else
+            return RET_TOOSMALL;
+        }
+    }
+  return RET_ILUNI;
+}
+
+/*
+ * UTF-32BE
+ */
+
+/* Specification: Unicode 3.1 Standard Annex #19 */
+
+static int
+utf32be_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
+{
+  if (n >= 4)
+    {
+      ucs4_t wc = (s[0] << 24) + (s[1] << 16) + (s[2] << 8) + s[3];
+      if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
+        {
+          *pwc = wc;
+          return 4;
+        }
+      else
+        return RET_ILSEQ;
+    }
+  return RET_TOOFEW;
+}
+
+static int
+utf32be_wctomb (unsigned char *r, ucs4_t wc, size_t n)
+{
+  if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
+    {
+      if (n >= 4)
+        {
+          r[0] = 0;
+          r[1] = (unsigned char) (wc >> 16);
+          r[2] = (unsigned char) (wc >> 8);
+          r[3] = (unsigned char) wc;
+          return 4;
+        }
+      else
+        return RET_TOOSMALL;
+    }
+  return RET_ILUNI;
+}
+
+/*
+ * UTF-32LE
+ */
+
+/* Specification: Unicode 3.1 Standard Annex #19 */
+
+static int
+utf32le_mbtowc (ucs4_t *pwc, const unsigned char *s, size_t n)
+{
+  if (n >= 4)
+    {
+      ucs4_t wc = s[0] + (s[1] << 8) + (s[2] << 16) + (s[3] << 24);
+      if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
+        {
+          *pwc = wc;
+          return 4;
+        }
+      else
+        return RET_ILSEQ;
+    }
+  return RET_TOOFEW;
+}
+
+static int
+utf32le_wctomb (unsigned char *r, ucs4_t wc, size_t n)
+{
+  if (wc < 0x110000 && !(wc >= 0xd800 && wc < 0xe000))
+    {
+      if (n >= 4)
+        {
+          r[0] = (unsigned char) wc;
+          r[1] = (unsigned char) (wc >> 8);
+          r[2] = (unsigned char) (wc >> 16);
+          r[3] = 0;
+          return 4;
+        }
+      else
+        return RET_TOOSMALL;
+    }
+  return RET_ILUNI;
+}
+
+#endif
+
+size_t
+rpl_iconv (iconv_t cd,
+           ICONV_CONST char **inbuf, size_t *inbytesleft,
+           char **outbuf, size_t *outbytesleft)
+#undef iconv
+{
+#if REPLACE_ICONV_UTF
+  switch ((uintptr_t) cd)
+    {
+      {
+        int (*xxx_wctomb) (unsigned char *, ucs4_t, size_t);
+
+        case (uintptr_t) _ICONV_UTF8_UTF16BE:
+          xxx_wctomb = utf16be_wctomb;
+          goto loop_from_utf8;
+        case (uintptr_t) _ICONV_UTF8_UTF16LE:
+          xxx_wctomb = utf16le_wctomb;
+          goto loop_from_utf8;
+        case (uintptr_t) _ICONV_UTF8_UTF32BE:
+          xxx_wctomb = utf32be_wctomb;
+          goto loop_from_utf8;
+        case (uintptr_t) _ICONV_UTF8_UTF32LE:
+          xxx_wctomb = utf32le_wctomb;
+          goto loop_from_utf8;
+
+       loop_from_utf8:
+        if (inbuf == NULL || *inbuf == NULL)
+          return 0;
+        {
+          ICONV_CONST char *inptr = *inbuf;
+          size_t inleft = *inbytesleft;
+          char *outptr = *outbuf;
+          size_t outleft = *outbytesleft;
+          size_t res = 0;
+          while (inleft > 0)
+            {
+              ucs4_t uc;
+              int m = u8_mbtoucr (&uc, (const uint8_t *) inptr, inleft);
+              if (m <= 0)
+                {
+                  if (m == -1)
+                    {
+                      errno = EILSEQ;
+                      res = (size_t)(-1);
+                      break;
+                    }
+                  if (m == -2)
+                    {
+                      errno = EINVAL;
+                      res = (size_t)(-1);
+                      break;
+                    }
+                  abort ();
+                }
+              else
+                {
+                  int n = xxx_wctomb ((uint8_t *) outptr, uc, outleft);
+                  if (n < 0)
+                    {
+                      if (n == RET_ILUNI)
+                        {
+                          errno = EILSEQ;
+                          res = (size_t)(-1);
+                          break;
+                        }
+                      if (n == RET_TOOSMALL)
+                        {
+                          errno = E2BIG;
+                          res = (size_t)(-1);
+                          break;
+                        }
+                      abort ();
+                    }
+                  else
+                    {
+                      inptr += m;
+                      inleft -= m;
+                      outptr += n;
+                      outleft -= n;
+                    }
+                }
+            }
+          *inbuf = inptr;
+          *inbytesleft = inleft;
+          *outbuf = outptr;
+          *outbytesleft = outleft;
+          return res;
+        }
+      }
+
+      {
+        int (*xxx_mbtowc) (ucs4_t *, const unsigned char *, size_t);
+
+        case (uintptr_t) _ICONV_UTF16BE_UTF8:
+          xxx_mbtowc = utf16be_mbtowc;
+          goto loop_to_utf8;
+        case (uintptr_t) _ICONV_UTF16LE_UTF8:
+          xxx_mbtowc = utf16le_mbtowc;
+          goto loop_to_utf8;
+        case (uintptr_t) _ICONV_UTF32BE_UTF8:
+          xxx_mbtowc = utf32be_mbtowc;
+          goto loop_to_utf8;
+        case (uintptr_t) _ICONV_UTF32LE_UTF8:
+          xxx_mbtowc = utf32le_mbtowc;
+          goto loop_to_utf8;
+
+       loop_to_utf8:
+        if (inbuf == NULL || *inbuf == NULL)
+          return 0;
+        {
+          ICONV_CONST char *inptr = *inbuf;
+          size_t inleft = *inbytesleft;
+          char *outptr = *outbuf;
+          size_t outleft = *outbytesleft;
+          size_t res = 0;
+          while (inleft > 0)
+            {
+              ucs4_t uc;
+              int m = xxx_mbtowc (&uc, (const uint8_t *) inptr, inleft);
+              if (m <= 0)
+                {
+                  if (m == RET_ILSEQ)
+                    {
+                      errno = EILSEQ;
+                      res = (size_t)(-1);
+                      break;
+                    }
+                  if (m == RET_TOOFEW)
+                    {
+                      errno = EINVAL;
+                      res = (size_t)(-1);
+                      break;
+                    }
+                  abort ();
+                }
+              else
+                {
+                  int n = u8_uctomb ((uint8_t *) outptr, uc, outleft);
+                  if (n < 0)
+                    {
+                      if (n == -1)
+                        {
+                          errno = EILSEQ;
+                          res = (size_t)(-1);
+                          break;
+                        }
+                      if (n == -2)
+                        {
+                          errno = E2BIG;
+                          res = (size_t)(-1);
+                          break;
+                        }
+                      abort ();
+                    }
+                  else
+                    {
+                      inptr += m;
+                      inleft -= m;
+                      outptr += n;
+                      outleft -= n;
+                    }
+                }
+            }
+          *inbuf = inptr;
+          *inbytesleft = inleft;
+          *outbuf = outptr;
+          *outbytesleft = outleft;
+          return res;
+        }
+      }
+    }
+#endif
+  return iconv (cd, inbuf, inbytesleft, outbuf, outbytesleft);
+}
diff --git a/lib/iconv.in.h b/lib/iconv.in.h
new file mode 100644 (file)
index 0000000..e2f24ac
--- /dev/null
@@ -0,0 +1,127 @@
+/* A GNU-like <iconv.h>.
+
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _@GUARD_PREFIX@_ICONV_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard.  */
+#@INCLUDE_NEXT@ @NEXT_ICONV_H@
+
+#ifndef _@GUARD_PREFIX@_ICONV_H
+#define _@GUARD_PREFIX@_ICONV_H
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV_OPEN@
+/* An iconv_open wrapper that supports the IANA standardized encoding names
+   ("ISO-8859-1" etc.) as far as possible.  */
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define iconv_open rpl_iconv_open
+#  endif
+_GL_FUNCDECL_RPL (iconv_open, iconv_t,
+                  (const char *tocode, const char *fromcode)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (iconv_open, iconv_t,
+                  (const char *tocode, const char *fromcode));
+# else
+_GL_CXXALIAS_SYS (iconv_open, iconv_t,
+                  (const char *tocode, const char *fromcode));
+# endif
+_GL_CXXALIASWARN (iconv_open);
+#elif defined GNULIB_POSIXCHECK
+# undef iconv_open
+# if HAVE_RAW_DECL_ICONV_OPEN
+_GL_WARN_ON_USE (iconv_open, "iconv_open is not working correctly everywhere - "
+                 "use gnulib module iconv for portability");
+# endif
+#endif
+
+#if @REPLACE_ICONV_UTF@
+/* Special constants for supporting UTF-{16,32}{BE,LE} encodings.
+   Not public.  */
+# define _ICONV_UTF8_UTF16BE (iconv_t)(-161)
+# define _ICONV_UTF8_UTF16LE (iconv_t)(-162)
+# define _ICONV_UTF8_UTF32BE (iconv_t)(-163)
+# define _ICONV_UTF8_UTF32LE (iconv_t)(-164)
+# define _ICONV_UTF16BE_UTF8 (iconv_t)(-165)
+# define _ICONV_UTF16LE_UTF8 (iconv_t)(-166)
+# define _ICONV_UTF32BE_UTF8 (iconv_t)(-167)
+# define _ICONV_UTF32LE_UTF8 (iconv_t)(-168)
+#endif
+
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define iconv rpl_iconv
+#  endif
+_GL_FUNCDECL_RPL (iconv, size_t,
+                  (iconv_t cd,
+                   @ICONV_CONST@ char **restrict inbuf,
+                   size_t *restrict inbytesleft,
+                   char **restrict outbuf, size_t *restrict outbytesleft));
+_GL_CXXALIAS_RPL (iconv, size_t,
+                  (iconv_t cd,
+                   @ICONV_CONST@ char **restrict inbuf,
+                   size_t *restrict inbytesleft,
+                   char **restrict outbuf, size_t *restrict outbytesleft));
+# else
+/* Need to cast, because on some versions of Solaris, ICONV_CONST does
+   not have the right value for C++.  */
+_GL_CXXALIAS_SYS_CAST (iconv, size_t,
+                       (iconv_t cd,
+                        @ICONV_CONST@ char **restrict inbuf,
+                        size_t *restrict inbytesleft,
+                        char **restrict outbuf, size_t *restrict outbytesleft));
+# endif
+_GL_CXXALIASWARN (iconv);
+# ifndef ICONV_CONST
+#  define ICONV_CONST @ICONV_CONST@
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef iconv
+# if HAVE_RAW_DECL_ICONV
+_GL_WARN_ON_USE (iconv, "iconv is not working correctly everywhere - "
+                 "use gnulib module iconv for portability");
+# endif
+#endif
+
+#if @GNULIB_ICONV@
+# if @REPLACE_ICONV@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define iconv_close rpl_iconv_close
+#  endif
+_GL_FUNCDECL_RPL (iconv_close, int, (iconv_t cd));
+_GL_CXXALIAS_RPL (iconv_close, int, (iconv_t cd));
+# else
+_GL_CXXALIAS_SYS (iconv_close, int, (iconv_t cd));
+# endif
+_GL_CXXALIASWARN (iconv_close);
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_ICONV_H */
+#endif /* _@GUARD_PREFIX@_ICONV_H */
diff --git a/lib/iconv_close.c b/lib/iconv_close.c
new file mode 100644 (file)
index 0000000..65bbf39
--- /dev/null
@@ -0,0 +1,43 @@
+/* Character set conversion.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <iconv.h>
+
+#include <stdint.h>
+
+int
+rpl_iconv_close (iconv_t cd)
+#undef iconv_close
+{
+#if REPLACE_ICONV_UTF
+  switch ((uintptr_t) cd)
+    {
+    case (uintptr_t) _ICONV_UTF8_UTF16BE:
+    case (uintptr_t) _ICONV_UTF8_UTF16LE:
+    case (uintptr_t) _ICONV_UTF8_UTF32BE:
+    case (uintptr_t) _ICONV_UTF8_UTF32LE:
+    case (uintptr_t) _ICONV_UTF16BE_UTF8:
+    case (uintptr_t) _ICONV_UTF16LE_UTF8:
+    case (uintptr_t) _ICONV_UTF32BE_UTF8:
+    case (uintptr_t) _ICONV_UTF32LE_UTF8:
+      return 0;
+    }
+#endif
+  return iconv_close (cd);
+}
diff --git a/lib/iconv_open-aix.gperf b/lib/iconv_open-aix.gperf
new file mode 100644 (file)
index 0000000..f115f51
--- /dev/null
@@ -0,0 +1,60 @@
+/* Character set conversion.
+   Copyright (C) 2007, 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+# On AIX 5.1, look in /usr/lib/nls/loc/uconvTable.
+ISO-8859-1, "ISO8859-1"
+ISO-8859-2, "ISO8859-2"
+ISO-8859-3, "ISO8859-3"
+ISO-8859-4, "ISO8859-4"
+ISO-8859-5, "ISO8859-5"
+ISO-8859-6, "ISO8859-6"
+ISO-8859-7, "ISO8859-7"
+ISO-8859-8, "ISO8859-8"
+ISO-8859-9, "ISO8859-9"
+ISO-8859-15, "ISO8859-15"
+CP437, "IBM-437"
+CP850, "IBM-850"
+CP852, "IBM-852"
+CP856, "IBM-856"
+CP857, "IBM-857"
+CP861, "IBM-861"
+CP865, "IBM-865"
+CP869, "IBM-869"
+ISO-8859-13, "IBM-921"
+CP922, "IBM-922"
+CP932, "IBM-932"
+CP943, "IBM-943"
+CP1046, "IBM-1046"
+CP1124, "IBM-1124"
+CP1125, "IBM-1125"
+CP1129, "IBM-1129"
+CP1252, "IBM-1252"
+GB2312, "IBM-eucCN"
+EUC-JP, "IBM-eucJP"
+EUC-KR, "IBM-eucKR"
+EUC-TW, "IBM-eucTW"
+BIG5, "big5"
diff --git a/lib/iconv_open-aix.h b/lib/iconv_open-aix.h
new file mode 100644 (file)
index 0000000..85ed767
--- /dev/null
@@ -0,0 +1,250 @@
+/* ANSI-C code produced by gperf version 3.1 */
+/* Command-line: gperf -m 10 ./iconv_open-aix.gperf  */
+/* Computed positions: -k'4,$' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646.  */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
+#endif
+
+#line 17 "./iconv_open-aix.gperf"
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+
+#define TOTAL_KEYWORDS 32
+#define MIN_WORD_LENGTH 4
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 44
+/* maximum key range = 39, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register size_t len)
+{
+  static const unsigned char asso_values[] =
+    {
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45,  0,  4, 25,
+       0, 11, 24,  9, 17,  3, 14, 21, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+       3, 45,  1, 45, 45, 45, 45,  0, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+      45, 45, 45, 45, 45, 45, 45, 45
+    };
+  return len + asso_values[(unsigned char)str[3]+2] + asso_values[(unsigned char)str[len - 1]];
+}
+
+struct stringpool_t
+  {
+    char stringpool_str6[sizeof("EUC-TW")];
+    char stringpool_str7[sizeof("EUC-KR")];
+    char stringpool_str8[sizeof("CP852")];
+    char stringpool_str9[sizeof("EUC-JP")];
+    char stringpool_str10[sizeof("ISO-8859-2")];
+    char stringpool_str11[sizeof("CP857")];
+    char stringpool_str12[sizeof("CP850")];
+    char stringpool_str13[sizeof("ISO-8859-7")];
+    char stringpool_str14[sizeof("CP932")];
+    char stringpool_str15[sizeof("GB2312")];
+    char stringpool_str16[sizeof("BIG5")];
+    char stringpool_str17[sizeof("CP437")];
+    char stringpool_str19[sizeof("ISO-8859-5")];
+    char stringpool_str20[sizeof("ISO-8859-15")];
+    char stringpool_str21[sizeof("ISO-8859-3")];
+    char stringpool_str22[sizeof("ISO-8859-13")];
+    char stringpool_str23[sizeof("CP1046")];
+    char stringpool_str24[sizeof("ISO-8859-8")];
+    char stringpool_str25[sizeof("CP856")];
+    char stringpool_str26[sizeof("CP1125")];
+    char stringpool_str27[sizeof("ISO-8859-6")];
+    char stringpool_str28[sizeof("CP865")];
+    char stringpool_str29[sizeof("CP922")];
+    char stringpool_str30[sizeof("CP1252")];
+    char stringpool_str31[sizeof("ISO-8859-9")];
+    char stringpool_str33[sizeof("CP943")];
+    char stringpool_str34[sizeof("ISO-8859-4")];
+    char stringpool_str35[sizeof("ISO-8859-1")];
+    char stringpool_str38[sizeof("CP1129")];
+    char stringpool_str40[sizeof("CP869")];
+    char stringpool_str41[sizeof("CP1124")];
+    char stringpool_str44[sizeof("CP861")];
+  };
+static const struct stringpool_t stringpool_contents =
+  {
+    "EUC-TW",
+    "EUC-KR",
+    "CP852",
+    "EUC-JP",
+    "ISO-8859-2",
+    "CP857",
+    "CP850",
+    "ISO-8859-7",
+    "CP932",
+    "GB2312",
+    "BIG5",
+    "CP437",
+    "ISO-8859-5",
+    "ISO-8859-15",
+    "ISO-8859-3",
+    "ISO-8859-13",
+    "CP1046",
+    "ISO-8859-8",
+    "CP856",
+    "CP1125",
+    "ISO-8859-6",
+    "CP865",
+    "CP922",
+    "CP1252",
+    "ISO-8859-9",
+    "CP943",
+    "ISO-8859-4",
+    "ISO-8859-1",
+    "CP1129",
+    "CP869",
+    "CP1124",
+    "CP861"
+  };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+  {
+    {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#line 59 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "IBM-eucTW"},
+#line 58 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "IBM-eucKR"},
+#line 41 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "IBM-852"},
+#line 57 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "IBM-eucJP"},
+#line 30 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-2"},
+#line 43 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "IBM-857"},
+#line 40 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "IBM-850"},
+#line 35 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-7"},
+#line 49 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "IBM-932"},
+#line 56 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "IBM-eucCN"},
+#line 60 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "big5"},
+#line 39 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "IBM-437"},
+    {-1},
+#line 33 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-5"},
+#line 38 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-15"},
+#line 31 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-3"},
+#line 47 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "IBM-921"},
+#line 51 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "IBM-1046"},
+#line 36 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str24, "ISO8859-8"},
+#line 42 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "IBM-856"},
+#line 53 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "IBM-1125"},
+#line 34 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
+#line 45 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str28, "IBM-865"},
+#line 48 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "IBM-922"},
+#line 55 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "IBM-1252"},
+#line 37 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "ISO8859-9"},
+    {-1},
+#line 50 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "IBM-943"},
+#line 32 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-4"},
+#line 29 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "ISO8859-1"},
+    {-1}, {-1},
+#line 54 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "IBM-1129"},
+    {-1},
+#line 46 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "IBM-869"},
+#line 52 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"},
+    {-1}, {-1},
+#line 44 "./iconv_open-aix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str44, "IBM-861"}
+  };
+
+const struct mapping *
+mapping_lookup (register const char *str, register size_t len)
+{
+  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+    {
+      register unsigned int key = mapping_hash (str, len);
+
+      if (key <= MAX_HASH_VALUE)
+        {
+          register int o = mappings[key].standard_name;
+          if (o >= 0)
+            {
+              register const char *s = o + stringpool;
+
+              if (*str == *s && !strcmp (str + 1, s + 1))
+                return &mappings[key];
+            }
+        }
+    }
+  return 0;
+}
diff --git a/lib/iconv_open-hpux.gperf b/lib/iconv_open-hpux.gperf
new file mode 100644 (file)
index 0000000..f42fe05
--- /dev/null
@@ -0,0 +1,72 @@
+/* Character set conversion.
+   Copyright (C) 2007, 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+struct mapping { int standard_name; const char vendor_name[9 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+# On HP-UX 11.11, look in /usr/lib/nls/iconv.
+ISO-8859-1, "iso88591"
+ISO-8859-2, "iso88592"
+ISO-8859-5, "iso88595"
+ISO-8859-6, "iso88596"
+ISO-8859-7, "iso88597"
+ISO-8859-8, "iso88598"
+ISO-8859-9, "iso88599"
+ISO-8859-15, "iso885915"
+CP437, "cp437"
+CP775, "cp775"
+CP850, "cp850"
+CP852, "cp852"
+CP855, "cp855"
+CP857, "cp857"
+CP861, "cp861"
+CP862, "cp862"
+CP864, "cp864"
+CP865, "cp865"
+CP866, "cp866"
+CP869, "cp869"
+CP874, "cp874"
+CP1250, "cp1250"
+CP1251, "cp1251"
+CP1252, "cp1252"
+CP1253, "cp1253"
+CP1254, "cp1254"
+CP1255, "cp1255"
+CP1256, "cp1256"
+CP1257, "cp1257"
+CP1258, "cp1258"
+HP-ROMAN8, "roman8"
+HP-ARABIC8, "arabic8"
+HP-GREEK8, "greek8"
+HP-HEBREW8, "hebrew8"
+HP-TURKISH8, "turkish8"
+HP-KANA8, "kana8"
+TIS-620, "tis620"
+GB2312, "hp15CN"
+EUC-JP, "eucJP"
+EUC-KR, "eucKR"
+EUC-TW, "eucTW"
+BIG5, "big5"
+SHIFT_JIS, "sjis"
+UTF-8, "utf8"
diff --git a/lib/iconv_open-hpux.h b/lib/iconv_open-hpux.h
new file mode 100644 (file)
index 0000000..fe3c289
--- /dev/null
@@ -0,0 +1,293 @@
+/* ANSI-C code produced by gperf version 3.1 */
+/* Command-line: gperf -m 10 ./iconv_open-hpux.gperf  */
+/* Computed positions: -k'4,$' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646.  */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
+#endif
+
+#line 17 "./iconv_open-hpux.gperf"
+struct mapping { int standard_name; const char vendor_name[9 + 1]; };
+
+#define TOTAL_KEYWORDS 44
+#define MIN_WORD_LENGTH 4
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 49
+/* maximum key range = 44, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register size_t len)
+{
+  static const unsigned char asso_values[] =
+    {
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50,  1,  2,
+      24, 43,  5, 10,  0, 13, 32,  3, 19, 18,
+      50, 50, 50, 50, 50, 50, 50, 50, 50,  5,
+      50, 50, 50, 50, 14,  5,  0, 50, 50,  0,
+      27, 50, 12, 14, 50, 50,  0,  5,  2, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50,
+      50, 50, 50, 50, 50, 50, 50, 50, 50, 50
+    };
+  return len + asso_values[(unsigned char)str[3]+4] + asso_values[(unsigned char)str[len - 1]];
+}
+
+struct stringpool_t
+  {
+    char stringpool_str6[sizeof("CP1256")];
+    char stringpool_str7[sizeof("CP1250")];
+    char stringpool_str8[sizeof("CP1251")];
+    char stringpool_str9[sizeof("CP850")];
+    char stringpool_str10[sizeof("TIS-620")];
+    char stringpool_str11[sizeof("CP1254")];
+    char stringpool_str12[sizeof("ISO-8859-6")];
+    char stringpool_str13[sizeof("EUC-TW")];
+    char stringpool_str14[sizeof("ISO-8859-1")];
+    char stringpool_str15[sizeof("ISO-8859-9")];
+    char stringpool_str16[sizeof("CP1255")];
+    char stringpool_str17[sizeof("BIG5")];
+    char stringpool_str18[sizeof("CP855")];
+    char stringpool_str19[sizeof("CP1257")];
+    char stringpool_str20[sizeof("EUC-KR")];
+    char stringpool_str21[sizeof("CP857")];
+    char stringpool_str22[sizeof("ISO-8859-5")];
+    char stringpool_str23[sizeof("ISO-8859-15")];
+    char stringpool_str24[sizeof("CP866")];
+    char stringpool_str25[sizeof("ISO-8859-7")];
+    char stringpool_str26[sizeof("CP861")];
+    char stringpool_str27[sizeof("CP869")];
+    char stringpool_str28[sizeof("CP874")];
+    char stringpool_str29[sizeof("CP864")];
+    char stringpool_str30[sizeof("CP1252")];
+    char stringpool_str31[sizeof("CP437")];
+    char stringpool_str32[sizeof("CP852")];
+    char stringpool_str33[sizeof("CP775")];
+    char stringpool_str34[sizeof("CP865")];
+    char stringpool_str35[sizeof("EUC-JP")];
+    char stringpool_str36[sizeof("ISO-8859-2")];
+    char stringpool_str37[sizeof("SHIFT_JIS")];
+    char stringpool_str38[sizeof("CP1258")];
+    char stringpool_str39[sizeof("UTF-8")];
+    char stringpool_str40[sizeof("HP-KANA8")];
+    char stringpool_str41[sizeof("HP-ROMAN8")];
+    char stringpool_str42[sizeof("HP-HEBREW8")];
+    char stringpool_str43[sizeof("GB2312")];
+    char stringpool_str44[sizeof("ISO-8859-8")];
+    char stringpool_str45[sizeof("HP-TURKISH8")];
+    char stringpool_str46[sizeof("HP-GREEK8")];
+    char stringpool_str47[sizeof("HP-ARABIC8")];
+    char stringpool_str48[sizeof("CP862")];
+    char stringpool_str49[sizeof("CP1253")];
+  };
+static const struct stringpool_t stringpool_contents =
+  {
+    "CP1256",
+    "CP1250",
+    "CP1251",
+    "CP850",
+    "TIS-620",
+    "CP1254",
+    "ISO-8859-6",
+    "EUC-TW",
+    "ISO-8859-1",
+    "ISO-8859-9",
+    "CP1255",
+    "BIG5",
+    "CP855",
+    "CP1257",
+    "EUC-KR",
+    "CP857",
+    "ISO-8859-5",
+    "ISO-8859-15",
+    "CP866",
+    "ISO-8859-7",
+    "CP861",
+    "CP869",
+    "CP874",
+    "CP864",
+    "CP1252",
+    "CP437",
+    "CP852",
+    "CP775",
+    "CP865",
+    "EUC-JP",
+    "ISO-8859-2",
+    "SHIFT_JIS",
+    "CP1258",
+    "UTF-8",
+    "HP-KANA8",
+    "HP-ROMAN8",
+    "HP-HEBREW8",
+    "GB2312",
+    "ISO-8859-8",
+    "HP-TURKISH8",
+    "HP-GREEK8",
+    "HP-ARABIC8",
+    "CP862",
+    "CP1253"
+  };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+  {
+    {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#line 56 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "cp1256"},
+#line 50 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "cp1250"},
+#line 51 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "cp1251"},
+#line 39 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "cp850"},
+#line 65 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "tis620"},
+#line 54 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "cp1254"},
+#line 32 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "iso88596"},
+#line 69 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "eucTW"},
+#line 29 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "iso88591"},
+#line 35 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "iso88599"},
+#line 55 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "cp1255"},
+#line 70 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "big5"},
+#line 41 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "cp855"},
+#line 57 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "cp1257"},
+#line 68 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "eucKR"},
+#line 42 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "cp857"},
+#line 31 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "iso88595"},
+#line 36 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "iso885915"},
+#line 47 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str24, "cp866"},
+#line 33 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "iso88597"},
+#line 43 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "cp861"},
+#line 48 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "cp869"},
+#line 49 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str28, "cp874"},
+#line 45 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "cp864"},
+#line 52 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
+#line 37 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "cp437"},
+#line 40 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str32, "cp852"},
+#line 38 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "cp775"},
+#line 46 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "cp865"},
+#line 67 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "eucJP"},
+#line 30 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str36, "iso88592"},
+#line 71 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str37, "sjis"},
+#line 58 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "cp1258"},
+#line 72 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str39, "utf8"},
+#line 64 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "kana8"},
+#line 59 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "roman8"},
+#line 62 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str42, "hebrew8"},
+#line 66 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str43, "hp15CN"},
+#line 34 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str44, "iso88598"},
+#line 63 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str45, "turkish8"},
+#line 61 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str46, "greek8"},
+#line 60 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str47, "arabic8"},
+#line 44 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str48, "cp862"},
+#line 53 "./iconv_open-hpux.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str49, "cp1253"}
+  };
+
+const struct mapping *
+mapping_lookup (register const char *str, register size_t len)
+{
+  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+    {
+      register unsigned int key = mapping_hash (str, len);
+
+      if (key <= MAX_HASH_VALUE)
+        {
+          register int o = mappings[key].standard_name;
+          if (o >= 0)
+            {
+              register const char *s = o + stringpool;
+
+              if (*str == *s && !strcmp (str + 1, s + 1))
+                return &mappings[key];
+            }
+        }
+    }
+  return 0;
+}
diff --git a/lib/iconv_open-irix.gperf b/lib/iconv_open-irix.gperf
new file mode 100644 (file)
index 0000000..be20dc4
--- /dev/null
@@ -0,0 +1,47 @@
+/* Character set conversion.
+   Copyright (C) 2007, 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+# On IRIX 6.5, look in /usr/lib/iconv and /usr/lib/international/encodings.
+ISO-8859-1, "ISO8859-1"
+ISO-8859-2, "ISO8859-2"
+ISO-8859-3, "ISO8859-3"
+ISO-8859-4, "ISO8859-4"
+ISO-8859-5, "ISO8859-5"
+ISO-8859-6, "ISO8859-6"
+ISO-8859-7, "ISO8859-7"
+ISO-8859-8, "ISO8859-8"
+ISO-8859-9, "ISO8859-9"
+ISO-8859-15, "ISO8859-15"
+KOI8-R, "KOI8"
+CP855, "DOS855"
+CP1251, "WIN1251"
+GB2312, "eucCN"
+EUC-JP, "eucJP"
+EUC-KR, "eucKR"
+EUC-TW, "eucTW"
+SHIFT_JIS, "sjis"
+TIS-620, "TIS620"
diff --git a/lib/iconv_open-irix.h b/lib/iconv_open-irix.h
new file mode 100644 (file)
index 0000000..9eec045
--- /dev/null
@@ -0,0 +1,193 @@
+/* ANSI-C code produced by gperf version 3.1 */
+/* Command-line: gperf -m 10 ./iconv_open-irix.gperf  */
+/* Computed positions: -k'1,$' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646.  */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
+#endif
+
+#line 17 "./iconv_open-irix.gperf"
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+
+#define TOTAL_KEYWORDS 19
+#define MIN_WORD_LENGTH 5
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 5
+#define MAX_HASH_VALUE 23
+/* maximum key range = 19, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register size_t len)
+{
+  static const unsigned char asso_values[] =
+    {
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24,  8,  2,
+       5, 12, 11,  0, 10,  9,  8,  7, 24, 24,
+      24, 24, 24, 24, 24, 24, 24,  0, 24,  0,
+      24,  5, 24,  0, 24,  7, 24, 24, 24, 24,
+       7, 24,  1,  0,  8, 24, 24,  0, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+      24, 24, 24, 24, 24, 24
+    };
+  return len + asso_values[(unsigned char)str[len - 1]] + asso_values[(unsigned char)str[0]];
+}
+
+struct stringpool_t
+  {
+    char stringpool_str5[sizeof("CP855")];
+    char stringpool_str6[sizeof("EUC-TW")];
+    char stringpool_str7[sizeof("EUC-KR")];
+    char stringpool_str8[sizeof("CP1251")];
+    char stringpool_str9[sizeof("SHIFT_JIS")];
+    char stringpool_str10[sizeof("ISO-8859-5")];
+    char stringpool_str11[sizeof("ISO-8859-15")];
+    char stringpool_str12[sizeof("ISO-8859-1")];
+    char stringpool_str13[sizeof("EUC-JP")];
+    char stringpool_str14[sizeof("KOI8-R")];
+    char stringpool_str15[sizeof("ISO-8859-2")];
+    char stringpool_str16[sizeof("GB2312")];
+    char stringpool_str17[sizeof("ISO-8859-9")];
+    char stringpool_str18[sizeof("ISO-8859-8")];
+    char stringpool_str19[sizeof("ISO-8859-7")];
+    char stringpool_str20[sizeof("ISO-8859-6")];
+    char stringpool_str21[sizeof("ISO-8859-4")];
+    char stringpool_str22[sizeof("ISO-8859-3")];
+    char stringpool_str23[sizeof("TIS-620")];
+  };
+static const struct stringpool_t stringpool_contents =
+  {
+    "CP855",
+    "EUC-TW",
+    "EUC-KR",
+    "CP1251",
+    "SHIFT_JIS",
+    "ISO-8859-5",
+    "ISO-8859-15",
+    "ISO-8859-1",
+    "EUC-JP",
+    "KOI8-R",
+    "ISO-8859-2",
+    "GB2312",
+    "ISO-8859-9",
+    "ISO-8859-8",
+    "ISO-8859-7",
+    "ISO-8859-6",
+    "ISO-8859-4",
+    "ISO-8859-3",
+    "TIS-620"
+  };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+  {
+    {-1}, {-1}, {-1}, {-1}, {-1},
+#line 40 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str5, "DOS855"},
+#line 45 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "eucTW"},
+#line 44 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "eucKR"},
+#line 41 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "WIN1251"},
+#line 46 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "sjis"},
+#line 33 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-5"},
+#line 38 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
+#line 29 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-1"},
+#line 43 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "eucJP"},
+#line 39 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "KOI8"},
+#line 30 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-2"},
+#line 42 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "eucCN"},
+#line 37 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-9"},
+#line 36 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-8"},
+#line 35 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-7"},
+#line 34 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "ISO8859-6"},
+#line 32 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "ISO8859-4"},
+#line 31 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-3"},
+#line 47 "./iconv_open-irix.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "TIS620"}
+  };
+
+const struct mapping *
+mapping_lookup (register const char *str, register size_t len)
+{
+  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+    {
+      register unsigned int key = mapping_hash (str, len);
+
+      if (key <= MAX_HASH_VALUE)
+        {
+          register int o = mappings[key].standard_name;
+          if (o >= 0)
+            {
+              register const char *s = o + stringpool;
+
+              if (*str == *s && !strcmp (str + 1, s + 1))
+                return &mappings[key];
+            }
+        }
+    }
+  return 0;
+}
diff --git a/lib/iconv_open-osf.gperf b/lib/iconv_open-osf.gperf
new file mode 100644 (file)
index 0000000..926bbcc
--- /dev/null
@@ -0,0 +1,66 @@
+/* Character set conversion.
+   Copyright (C) 2007, 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+# On OSF/1 5.1, look in /usr/lib/nls/loc/iconv.
+ISO-8859-1, "ISO8859-1"
+ISO-8859-2, "ISO8859-2"
+ISO-8859-3, "ISO8859-3"
+ISO-8859-4, "ISO8859-4"
+ISO-8859-5, "ISO8859-5"
+ISO-8859-6, "ISO8859-6"
+ISO-8859-7, "ISO8859-7"
+ISO-8859-8, "ISO8859-8"
+ISO-8859-9, "ISO8859-9"
+ISO-8859-15, "ISO8859-15"
+CP437, "cp437"
+CP775, "cp775"
+CP850, "cp850"
+CP852, "cp852"
+CP855, "cp855"
+CP857, "cp857"
+CP861, "cp861"
+CP862, "cp862"
+CP865, "cp865"
+CP866, "cp866"
+CP869, "cp869"
+CP874, "cp874"
+CP949, "KSC5601"
+CP1250, "cp1250"
+CP1251, "cp1251"
+CP1252, "cp1252"
+CP1253, "cp1253"
+CP1254, "cp1254"
+CP1255, "cp1255"
+CP1256, "cp1256"
+CP1257, "cp1257"
+CP1258, "cp1258"
+EUC-JP, "eucJP"
+EUC-KR, "eucKR"
+EUC-TW, "eucTW"
+BIG5, "big5"
+SHIFT_JIS, "SJIS"
+TIS-620, "TACTIS"
diff --git a/lib/iconv_open-osf.h b/lib/iconv_open-osf.h
new file mode 100644 (file)
index 0000000..cf23c08
--- /dev/null
@@ -0,0 +1,272 @@
+/* ANSI-C code produced by gperf version 3.1 */
+/* Command-line: gperf -m 10 ./iconv_open-osf.gperf  */
+/* Computed positions: -k'4,$' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646.  */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
+#endif
+
+#line 17 "./iconv_open-osf.gperf"
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+
+#define TOTAL_KEYWORDS 38
+#define MIN_WORD_LENGTH 4
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 6
+#define MAX_HASH_VALUE 47
+/* maximum key range = 42, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register size_t len)
+{
+  static const unsigned char asso_values[] =
+    {
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48,  2, 29,
+      24, 34, 31,  0, 15, 14, 10, 13,  2, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48,  7, 48, 48, 48, 48, 48, 48,
+      11, 48,  2,  7, 48, 48, 48,  1, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48, 48,
+      48, 48, 48, 48, 48, 48, 48, 48, 48
+    };
+  return len + asso_values[(unsigned char)str[3]+3] + asso_values[(unsigned char)str[len - 1]];
+}
+
+struct stringpool_t
+  {
+    char stringpool_str6[sizeof("CP1255")];
+    char stringpool_str7[sizeof("CP775")];
+    char stringpool_str8[sizeof("CP1250")];
+    char stringpool_str9[sizeof("EUC-TW")];
+    char stringpool_str10[sizeof("EUC-KR")];
+    char stringpool_str11[sizeof("TIS-620")];
+    char stringpool_str12[sizeof("ISO-8859-5")];
+    char stringpool_str13[sizeof("ISO-8859-15")];
+    char stringpool_str14[sizeof("BIG5")];
+    char stringpool_str15[sizeof("CP855")];
+    char stringpool_str16[sizeof("CP1258")];
+    char stringpool_str17[sizeof("CP850")];
+    char stringpool_str18[sizeof("CP865")];
+    char stringpool_str19[sizeof("EUC-JP")];
+    char stringpool_str20[sizeof("CP1257")];
+    char stringpool_str21[sizeof("CP1256")];
+    char stringpool_str22[sizeof("ISO-8859-8")];
+    char stringpool_str23[sizeof("SHIFT_JIS")];
+    char stringpool_str25[sizeof("ISO-8859-9")];
+    char stringpool_str26[sizeof("ISO-8859-7")];
+    char stringpool_str27[sizeof("ISO-8859-6")];
+    char stringpool_str29[sizeof("CP857")];
+    char stringpool_str30[sizeof("CP1252")];
+    char stringpool_str31[sizeof("CP869")];
+    char stringpool_str32[sizeof("CP949")];
+    char stringpool_str33[sizeof("CP866")];
+    char stringpool_str34[sizeof("CP437")];
+    char stringpool_str35[sizeof("CP1251")];
+    char stringpool_str36[sizeof("ISO-8859-2")];
+    char stringpool_str37[sizeof("CP1254")];
+    char stringpool_str38[sizeof("CP874")];
+    char stringpool_str39[sizeof("CP852")];
+    char stringpool_str40[sizeof("CP1253")];
+    char stringpool_str41[sizeof("ISO-8859-1")];
+    char stringpool_str42[sizeof("CP862")];
+    char stringpool_str43[sizeof("ISO-8859-4")];
+    char stringpool_str46[sizeof("ISO-8859-3")];
+    char stringpool_str47[sizeof("CP861")];
+  };
+static const struct stringpool_t stringpool_contents =
+  {
+    "CP1255",
+    "CP775",
+    "CP1250",
+    "EUC-TW",
+    "EUC-KR",
+    "TIS-620",
+    "ISO-8859-5",
+    "ISO-8859-15",
+    "BIG5",
+    "CP855",
+    "CP1258",
+    "CP850",
+    "CP865",
+    "EUC-JP",
+    "CP1257",
+    "CP1256",
+    "ISO-8859-8",
+    "SHIFT_JIS",
+    "ISO-8859-9",
+    "ISO-8859-7",
+    "ISO-8859-6",
+    "CP857",
+    "CP1252",
+    "CP869",
+    "CP949",
+    "CP866",
+    "CP437",
+    "CP1251",
+    "ISO-8859-2",
+    "CP1254",
+    "CP874",
+    "CP852",
+    "CP1253",
+    "ISO-8859-1",
+    "CP862",
+    "ISO-8859-4",
+    "ISO-8859-3",
+    "CP861"
+  };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+  {
+    {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#line 57 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "cp1255"},
+#line 40 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "cp775"},
+#line 52 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "cp1250"},
+#line 63 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "eucTW"},
+#line 62 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "eucKR"},
+#line 66 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "TACTIS"},
+#line 33 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-5"},
+#line 38 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-15"},
+#line 64 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "big5"},
+#line 43 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "cp855"},
+#line 60 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "cp1258"},
+#line 41 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "cp850"},
+#line 47 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "cp865"},
+#line 61 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "eucJP"},
+#line 59 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "cp1257"},
+#line 58 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "cp1256"},
+#line 36 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "ISO8859-8"},
+#line 65 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "SJIS"},
+    {-1},
+#line 37 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-9"},
+#line 35 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "ISO8859-7"},
+#line 34 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "ISO8859-6"},
+    {-1},
+#line 44 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "cp857"},
+#line 54 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "cp1252"},
+#line 49 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "cp869"},
+#line 51 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str32, "KSC5601"},
+#line 48 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "cp866"},
+#line 39 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "cp437"},
+#line 53 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "cp1251"},
+#line 30 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str36, "ISO8859-2"},
+#line 56 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str37, "cp1254"},
+#line 50 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "cp874"},
+#line 42 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str39, "cp852"},
+#line 55 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "cp1253"},
+#line 29 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "ISO8859-1"},
+#line 46 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str42, "cp862"},
+#line 32 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"},
+    {-1}, {-1},
+#line 31 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str46, "ISO8859-3"},
+#line 45 "./iconv_open-osf.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str47, "cp861"}
+  };
+
+const struct mapping *
+mapping_lookup (register const char *str, register size_t len)
+{
+  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+    {
+      register unsigned int key = mapping_hash (str, len);
+
+      if (key <= MAX_HASH_VALUE)
+        {
+          register int o = mappings[key].standard_name;
+          if (o >= 0)
+            {
+              register const char *s = o + stringpool;
+
+              if (*str == *s && !strcmp (str + 1, s + 1))
+                return &mappings[key];
+            }
+        }
+    }
+  return 0;
+}
diff --git a/lib/iconv_open-solaris.gperf b/lib/iconv_open-solaris.gperf
new file mode 100644 (file)
index 0000000..0dd40f1
--- /dev/null
@@ -0,0 +1,46 @@
+/* Character set conversion.
+   Copyright (C) 2007, 2009, 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+# On Solaris 10, look in the "iconv -l" output. Some aliases are advertised but
+# not actually supported by the iconv() function and by the 'iconv' program.
+# For example:
+#   $ echo abc | iconv -f 646 -t ISO-8859-1
+#   Not supported 646 to ISO-8859-1
+#   $ echo abc | iconv -f 646 -t ISO8859-1
+$   abc
+ASCII, "646"
+ISO-8859-1, "ISO8859-1"
+ISO-8859-2, "ISO8859-2"
+ISO-8859-3, "ISO8859-3"
+ISO-8859-4, "ISO8859-4"
+ISO-8859-5, "ISO8859-5"
+ISO-8859-6, "ISO8859-6"
+ISO-8859-7, "ISO8859-7"
+ISO-8859-8, "ISO8859-8"
+ISO-8859-9, "ISO8859-9"
+ISO-8859-15, "ISO8859-15"
+CP1251, "ansi-1251"
diff --git a/lib/iconv_open-solaris.h b/lib/iconv_open-solaris.h
new file mode 100644 (file)
index 0000000..b38b16c
--- /dev/null
@@ -0,0 +1,184 @@
+/* ANSI-C code produced by gperf version 3.1 */
+/* Command-line: gperf -m 10 ./iconv_open-solaris.gperf  */
+/* Computed positions: -k'10' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646.  */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
+#endif
+
+#line 17 "./iconv_open-solaris.gperf"
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+
+#define TOTAL_KEYWORDS 13
+#define MIN_WORD_LENGTH 5
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 5
+#define MAX_HASH_VALUE 19
+/* maximum key range = 15, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register size_t len)
+{
+  static const unsigned char asso_values[] =
+    {
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20,  0,
+       9,  8,  7,  6,  5,  4,  3,  2, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+      20, 20, 20, 20, 20, 20
+    };
+  register unsigned int hval = len;
+
+  switch (hval)
+    {
+      default:
+        hval += asso_values[(unsigned char)str[9]];
+      /*FALLTHROUGH*/
+      case 9:
+      case 8:
+      case 7:
+      case 6:
+      case 5:
+        break;
+    }
+  return hval;
+}
+
+struct stringpool_t
+  {
+    char stringpool_str5[sizeof("ASCII")];
+    char stringpool_str6[sizeof("CP1251")];
+    char stringpool_str7[sizeof("$   abc")];
+    char stringpool_str10[sizeof("ISO-8859-1")];
+    char stringpool_str11[sizeof("ISO-8859-15")];
+    char stringpool_str12[sizeof("ISO-8859-9")];
+    char stringpool_str13[sizeof("ISO-8859-8")];
+    char stringpool_str14[sizeof("ISO-8859-7")];
+    char stringpool_str15[sizeof("ISO-8859-6")];
+    char stringpool_str16[sizeof("ISO-8859-5")];
+    char stringpool_str17[sizeof("ISO-8859-4")];
+    char stringpool_str18[sizeof("ISO-8859-3")];
+    char stringpool_str19[sizeof("ISO-8859-2")];
+  };
+static const struct stringpool_t stringpool_contents =
+  {
+    "ASCII",
+    "CP1251",
+    "$   abc",
+    "ISO-8859-1",
+    "ISO-8859-15",
+    "ISO-8859-9",
+    "ISO-8859-8",
+    "ISO-8859-7",
+    "ISO-8859-6",
+    "ISO-8859-5",
+    "ISO-8859-4",
+    "ISO-8859-3",
+    "ISO-8859-2"
+  };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+  {
+    {-1}, {-1}, {-1}, {-1}, {-1},
+#line 35 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str5, "646"},
+#line 46 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str6, "ansi-1251"},
+#line 34 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7},
+    {-1}, {-1},
+#line 36 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "ISO8859-1"},
+#line 45 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "ISO8859-15"},
+#line 44 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "ISO8859-9"},
+#line 43 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-8"},
+#line 42 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"},
+#line 41 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "ISO8859-6"},
+#line 40 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "ISO8859-5"},
+#line 39 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "ISO8859-4"},
+#line 38 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-3"},
+#line 37 "./iconv_open-solaris.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "ISO8859-2"}
+  };
+
+const struct mapping *
+mapping_lookup (register const char *str, register size_t len)
+{
+  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+    {
+      register unsigned int key = mapping_hash (str, len);
+
+      if (key <= MAX_HASH_VALUE)
+        {
+          register int o = mappings[key].standard_name;
+          if (o >= 0)
+            {
+              register const char *s = o + stringpool;
+
+              if (*str == *s && !strcmp (str + 1, s + 1))
+                return &mappings[key];
+            }
+        }
+    }
+  return 0;
+}
diff --git a/lib/iconv_open-zos.gperf b/lib/iconv_open-zos.gperf
new file mode 100644 (file)
index 0000000..9bba19d
--- /dev/null
@@ -0,0 +1,76 @@
+/* Character set conversion.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+%struct-type
+%language=ANSI-C
+%define slot-name standard_name
+%define hash-function-name mapping_hash
+%define lookup-function-name mapping_lookup
+%readonly-tables
+%global-table
+%define word-array-name mappings
+%pic
+%%
+ASCII, "00367"
+ISO-8859-1, "ISO8859-1"
+ISO-8859-2, "ISO8859-2"
+ISO-8859-3, "00913"
+ISO-8859-4, "ISO8859-4"
+ISO-8859-5, "ISO8859-5"
+ISO-8859-6, "ISO8859-6"
+ISO-8859-7, "ISO8859-7"
+ISO-8859-8, "05012"
+ISO-8859-9, "ISO8859-9"
+ISO-8859-13, "ISO8859-13"
+ISO-8859-15, "ISO8859-15"
+KOI8-R, "00878"
+KOI8-U, "01168"
+CP437, "IBM-437"
+CP775, "00775"
+CP850, "09042"
+CP852, "IBM-852"
+CP855, "13143"
+CP856, "IBM-856"
+CP857, "00857"
+CP861, "IBM-861"
+CP862, "IBM-862"
+CP864, "IBM-864"
+CP865, "00865"
+CP866, "04962"
+CP869, "IBM-869"
+CP874, "TIS-620"
+CP922, "IBM-922"
+CP932, "IBM-943"
+CP943, "IBM-943"
+CP949, "IBM-1363"
+CP1046, "IBM-1046"
+CP1124, "IBM-1124"
+CP1125, "IBM-1125"
+CP1129, "01129"
+CP1131, "01131"
+CP1250, "IBM-5346"
+CP1251, "IBM-5347"
+CP1252, "IBM-5348"
+CP1253, "IBM-5349"
+CP1254, "IBM-5350"
+CP1255, "09447"
+CP1256, "09448"
+CP1257, "09449"
+GB2312, "IBM-eucCN"
+EUC-JP, "01350"
+EUC-KR, "IBM-eucKR"
+GBK, "IBM-1386"
diff --git a/lib/iconv_open-zos.h b/lib/iconv_open-zos.h
new file mode 100644 (file)
index 0000000..5f84725
--- /dev/null
@@ -0,0 +1,329 @@
+/* ANSI-C code produced by gperf version 3.1 */
+/* Command-line: gperf -m 10 ./iconv_open-zos.gperf  */
+/* Computed positions: -k'4,$' */
+
+#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+      && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+      && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+      && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+      && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+      && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+      && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+      && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+      && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+      && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+      && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+      && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+      && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+      && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+      && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+      && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+      && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+      && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+      && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+      && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+      && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+      && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+      && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
+/* The character set is not based on ISO-646.  */
+#error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gperf@gnu.org>."
+#endif
+
+#line 17 "./iconv_open-zos.gperf"
+struct mapping { int standard_name; const char vendor_name[10 + 1]; };
+
+#define TOTAL_KEYWORDS 49
+#define MIN_WORD_LENGTH 3
+#define MAX_WORD_LENGTH 11
+#define MIN_HASH_VALUE 3
+#define MAX_HASH_VALUE 64
+/* maximum key range = 62, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+mapping_hash (register const char *str, register size_t len)
+{
+  static const unsigned char asso_values[] =
+    {
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 16, 38,
+      14,  1, 32, 22, 29,  3,  0,  7, 40,  2,
+       5, 18, 23, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65,  0, 65,  0, 65, 65, 65,  0,
+      43, 65,  1, 65, 65,  8, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
+      65, 65
+    };
+  register unsigned int hval = len;
+
+  switch (hval)
+    {
+      default:
+        hval += asso_values[(unsigned char)str[3]+6];
+      /*FALLTHROUGH*/
+      case 3:
+        break;
+    }
+  return hval + asso_values[(unsigned char)str[len - 1]];
+}
+
+struct stringpool_t
+  {
+    char stringpool_str3[sizeof("GBK")];
+    char stringpool_str5[sizeof("ASCII")];
+    char stringpool_str7[sizeof("CP1253")];
+    char stringpool_str8[sizeof("EUC-KR")];
+    char stringpool_str9[sizeof("CP1257")];
+    char stringpool_str10[sizeof("CP857")];
+    char stringpool_str11[sizeof("ISO-8859-8")];
+    char stringpool_str12[sizeof("ISO-8859-3")];
+    char stringpool_str13[sizeof("ISO-8859-13")];
+    char stringpool_str14[sizeof("ISO-8859-7")];
+    char stringpool_str15[sizeof("CP437")];
+    char stringpool_str16[sizeof("CP1129")];
+    char stringpool_str17[sizeof("CP869")];
+    char stringpool_str18[sizeof("ISO-8859-9")];
+    char stringpool_str19[sizeof("CP922")];
+    char stringpool_str20[sizeof("CP1252")];
+    char stringpool_str21[sizeof("CP852")];
+    char stringpool_str22[sizeof("CP1250")];
+    char stringpool_str23[sizeof("CP850")];
+    char stringpool_str24[sizeof("CP862")];
+    char stringpool_str25[sizeof("ISO-8859-2")];
+    char stringpool_str26[sizeof("CP932")];
+    char stringpool_str27[sizeof("GB2312")];
+    char stringpool_str28[sizeof("CP1255")];
+    char stringpool_str29[sizeof("CP855")];
+    char stringpool_str30[sizeof("KOI8-R")];
+    char stringpool_str31[sizeof("CP1125")];
+    char stringpool_str32[sizeof("CP865")];
+    char stringpool_str33[sizeof("ISO-8859-5")];
+    char stringpool_str34[sizeof("ISO-8859-15")];
+    char stringpool_str35[sizeof("CP1256")];
+    char stringpool_str36[sizeof("CP856")];
+    char stringpool_str37[sizeof("KOI8-U")];
+    char stringpool_str38[sizeof("CP1254")];
+    char stringpool_str39[sizeof("CP866")];
+    char stringpool_str40[sizeof("ISO-8859-6")];
+    char stringpool_str41[sizeof("CP1124")];
+    char stringpool_str42[sizeof("CP864")];
+    char stringpool_str43[sizeof("ISO-8859-4")];
+    char stringpool_str44[sizeof("CP1251")];
+    char stringpool_str45[sizeof("CP775")];
+    char stringpool_str46[sizeof("CP943")];
+    char stringpool_str47[sizeof("CP1131")];
+    char stringpool_str48[sizeof("CP861")];
+    char stringpool_str49[sizeof("ISO-8859-1")];
+    char stringpool_str50[sizeof("EUC-JP")];
+    char stringpool_str52[sizeof("CP949")];
+    char stringpool_str55[sizeof("CP874")];
+    char stringpool_str64[sizeof("CP1046")];
+  };
+static const struct stringpool_t stringpool_contents =
+  {
+    "GBK",
+    "ASCII",
+    "CP1253",
+    "EUC-KR",
+    "CP1257",
+    "CP857",
+    "ISO-8859-8",
+    "ISO-8859-3",
+    "ISO-8859-13",
+    "ISO-8859-7",
+    "CP437",
+    "CP1129",
+    "CP869",
+    "ISO-8859-9",
+    "CP922",
+    "CP1252",
+    "CP852",
+    "CP1250",
+    "CP850",
+    "CP862",
+    "ISO-8859-2",
+    "CP932",
+    "GB2312",
+    "CP1255",
+    "CP855",
+    "KOI8-R",
+    "CP1125",
+    "CP865",
+    "ISO-8859-5",
+    "ISO-8859-15",
+    "CP1256",
+    "CP856",
+    "KOI8-U",
+    "CP1254",
+    "CP866",
+    "ISO-8859-6",
+    "CP1124",
+    "CP864",
+    "ISO-8859-4",
+    "CP1251",
+    "CP775",
+    "CP943",
+    "CP1131",
+    "CP861",
+    "ISO-8859-1",
+    "EUC-JP",
+    "CP949",
+    "CP874",
+    "CP1046"
+  };
+#define stringpool ((const char *) &stringpool_contents)
+
+static const struct mapping mappings[] =
+  {
+    {-1}, {-1}, {-1},
+#line 76 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str3, "IBM-1386"},
+    {-1},
+#line 28 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str5, "00367"},
+    {-1},
+#line 68 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str7, "IBM-5349"},
+#line 75 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str8, "IBM-eucKR"},
+#line 72 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str9, "09449"},
+#line 48 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str10, "00857"},
+#line 36 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str11, "05012"},
+#line 31 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str12, "00913"},
+#line 38 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str13, "ISO8859-13"},
+#line 35 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str14, "ISO8859-7"},
+#line 42 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str15, "IBM-437"},
+#line 63 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str16, "01129"},
+#line 54 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str17, "IBM-869"},
+#line 37 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str18, "ISO8859-9"},
+#line 56 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str19, "IBM-922"},
+#line 67 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str20, "IBM-5348"},
+#line 45 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str21, "IBM-852"},
+#line 65 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str22, "IBM-5346"},
+#line 44 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str23, "09042"},
+#line 50 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str24, "IBM-862"},
+#line 30 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str25, "ISO8859-2"},
+#line 57 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str26, "IBM-943"},
+#line 73 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str27, "IBM-eucCN"},
+#line 70 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str28, "09447"},
+#line 46 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str29, "13143"},
+#line 40 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str30, "00878"},
+#line 62 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str31, "IBM-1125"},
+#line 52 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str32, "00865"},
+#line 33 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str33, "ISO8859-5"},
+#line 39 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str34, "ISO8859-15"},
+#line 71 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str35, "09448"},
+#line 47 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str36, "IBM-856"},
+#line 41 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str37, "01168"},
+#line 69 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str38, "IBM-5350"},
+#line 53 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str39, "04962"},
+#line 34 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str40, "ISO8859-6"},
+#line 61 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str41, "IBM-1124"},
+#line 51 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str42, "IBM-864"},
+#line 32 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str43, "ISO8859-4"},
+#line 66 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str44, "IBM-5347"},
+#line 43 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str45, "00775"},
+#line 58 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str46, "IBM-943"},
+#line 64 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str47, "01131"},
+#line 49 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str48, "IBM-861"},
+#line 29 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str49, "ISO8859-1"},
+#line 74 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str50, "01350"},
+    {-1},
+#line 59 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str52, "IBM-1363"},
+    {-1}, {-1},
+#line 55 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str55, "TIS-620"},
+    {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1},
+#line 60 "./iconv_open-zos.gperf"
+    {(int)(size_t)&((struct stringpool_t *)0)->stringpool_str64, "IBM-1046"}
+  };
+
+const struct mapping *
+mapping_lookup (register const char *str, register size_t len)
+{
+  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+    {
+      register unsigned int key = mapping_hash (str, len);
+
+      if (key <= MAX_HASH_VALUE)
+        {
+          register int o = mappings[key].standard_name;
+          if (o >= 0)
+            {
+              register const char *s = o + stringpool;
+
+              if (*str == *s && !strcmp (str + 1, s + 1))
+                return &mappings[key];
+            }
+        }
+    }
+  return 0;
+}
diff --git a/lib/iconv_open.c b/lib/iconv_open.c
new file mode 100644 (file)
index 0000000..84f6144
--- /dev/null
@@ -0,0 +1,173 @@
+/* Character set conversion.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <iconv.h>
+
+#include <errno.h>
+#include <string.h>
+#include "c-ctype.h"
+#include "c-strcase.h"
+
+#define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
+
+/* Namespace cleanliness.  */
+#define mapping_lookup rpl_iconv_open_mapping_lookup
+
+/* The macro ICONV_FLAVOR is defined to one of these or undefined.  */
+
+#define ICONV_FLAVOR_AIX "iconv_open-aix.h"
+#define ICONV_FLAVOR_HPUX "iconv_open-hpux.h"
+#define ICONV_FLAVOR_IRIX "iconv_open-irix.h"
+#define ICONV_FLAVOR_OSF "iconv_open-osf.h"
+#define ICONV_FLAVOR_SOLARIS "iconv_open-solaris.h"
+#define ICONV_FLAVOR_ZOS "iconv_open-zos.h"
+
+#ifdef ICONV_FLAVOR
+# include ICONV_FLAVOR
+#endif
+
+iconv_t
+rpl_iconv_open (const char *tocode, const char *fromcode)
+#undef iconv_open
+{
+  char fromcode_upper[32];
+  char tocode_upper[32];
+  char *fromcode_upper_end;
+  char *tocode_upper_end;
+
+#if REPLACE_ICONV_UTF
+  /* Special handling of conversion between UTF-8 and UTF-{16,32}{BE,LE}.
+     Do this here, before calling the real iconv_open(), because  OSF/1 5.1
+     iconv() to these encoding inserts a BOM, which is wrong.
+     We do not need to handle conversion between arbitrary encodings and
+     UTF-{16,32}{BE,LE}, because the 'striconveh' module implements two-step
+     conversion through UTF-8.
+     The _ICONV_* constants are chosen to be disjoint from any iconv_t
+     returned by the system's iconv_open() functions.  Recall that iconv_t
+     is a scalar type.  */
+  if (c_toupper (fromcode[0]) == 'U'
+      && c_toupper (fromcode[1]) == 'T'
+      && c_toupper (fromcode[2]) == 'F'
+      && fromcode[3] == '-')
+    {
+      if (c_toupper (tocode[0]) == 'U'
+          && c_toupper (tocode[1]) == 'T'
+          && c_toupper (tocode[2]) == 'F'
+          && tocode[3] == '-')
+        {
+          if (strcmp (fromcode + 4, "8") == 0)
+            {
+              if (c_strcasecmp (tocode + 4, "16BE") == 0)
+                return _ICONV_UTF8_UTF16BE;
+              if (c_strcasecmp (tocode + 4, "16LE") == 0)
+                return _ICONV_UTF8_UTF16LE;
+              if (c_strcasecmp (tocode + 4, "32BE") == 0)
+                return _ICONV_UTF8_UTF32BE;
+              if (c_strcasecmp (tocode + 4, "32LE") == 0)
+                return _ICONV_UTF8_UTF32LE;
+            }
+          else if (strcmp (tocode + 4, "8") == 0)
+            {
+              if (c_strcasecmp (fromcode + 4, "16BE") == 0)
+                return _ICONV_UTF16BE_UTF8;
+              if (c_strcasecmp (fromcode + 4, "16LE") == 0)
+                return _ICONV_UTF16LE_UTF8;
+              if (c_strcasecmp (fromcode + 4, "32BE") == 0)
+                return _ICONV_UTF32BE_UTF8;
+              if (c_strcasecmp (fromcode + 4, "32LE") == 0)
+                return _ICONV_UTF32LE_UTF8;
+            }
+        }
+    }
+#endif
+
+  /* Do *not* add special support for 8-bit encodings like ASCII or ISO-8859-1
+     here.  This would lead to programs that work in some locales (such as the
+     "C" or "en_US" locales) but do not work in East Asian locales.  It is
+     better if programmers make their programs depend on GNU libiconv (except
+     on glibc systems), e.g. by using the AM_ICONV macro and documenting the
+     dependency in an INSTALL or DEPENDENCIES file.  */
+
+  /* Try with the original names first.
+     This covers the case when fromcode or tocode is a lowercase encoding name
+     that is understood by the system's iconv_open but not listed in our
+     mappings table.  */
+  {
+    iconv_t cd = iconv_open (tocode, fromcode);
+    if (cd != (iconv_t)(-1))
+      return cd;
+  }
+
+  /* Convert the encodings to upper case, because
+       1. in the arguments of iconv_open() on AIX, HP-UX, and OSF/1 the case
+          matters,
+       2. it makes searching in the table faster.  */
+  {
+    const char *p = fromcode;
+    char *q = fromcode_upper;
+    while ((*q = c_toupper (*p)) != '\0')
+      {
+        p++;
+        q++;
+        if (q == &fromcode_upper[SIZEOF (fromcode_upper)])
+          {
+            errno = EINVAL;
+            return (iconv_t)(-1);
+          }
+      }
+    fromcode_upper_end = q;
+  }
+
+  {
+    const char *p = tocode;
+    char *q = tocode_upper;
+    while ((*q = c_toupper (*p)) != '\0')
+      {
+        p++;
+        q++;
+        if (q == &tocode_upper[SIZEOF (tocode_upper)])
+          {
+            errno = EINVAL;
+            return (iconv_t)(-1);
+          }
+      }
+    tocode_upper_end = q;
+  }
+
+#ifdef ICONV_FLAVOR
+  /* Apply the mappings.  */
+  {
+    const struct mapping *m =
+      mapping_lookup (fromcode_upper, fromcode_upper_end - fromcode_upper);
+
+    fromcode = (m != NULL ? m->vendor_name : fromcode_upper);
+  }
+  {
+    const struct mapping *m =
+      mapping_lookup (tocode_upper, tocode_upper_end - tocode_upper);
+
+    tocode = (m != NULL ? m->vendor_name : tocode_upper);
+  }
+#else
+  fromcode = fromcode_upper;
+  tocode = tocode_upper;
+#endif
+
+  return iconv_open (tocode, fromcode);
+}
diff --git a/lib/idx.h b/lib/idx.h
new file mode 100644 (file)
index 0000000..681c8c9
--- /dev/null
+++ b/lib/idx.h
@@ -0,0 +1,114 @@
+/* A type for indices and sizes.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _IDX_H
+#define _IDX_H
+
+/* Get ptrdiff_t.  */
+#include <stddef.h>
+
+/* Get PTRDIFF_MAX.  */
+#include <stdint.h>
+
+/* The type 'idx_t' holds an (array) index or an (object) size.
+   Its implementation promotes to a signed integer type,
+   which can hold the values
+     0..2^63-1 (on 64-bit platforms) or
+     0..2^31-1 (on 32-bit platforms).
+
+   Why a signed integer type?
+
+     * Security: Signed types can be checked for overflow via
+       '-fsanitize=undefined', but unsigned types cannot.
+
+     * Comparisons without surprises: ISO C99 § 6.3.1.8 specifies a few
+       surprising results for comparisons, such as
+
+           (int) -3 < (unsigned long) 7  =>  false
+           (int) -3 < (unsigned int) 7   =>  false
+       and on 32-bit machines:
+           (long) -3 < (unsigned int) 7  =>  false
+
+       This is surprising because the natural comparison order is by
+       value in the realm of infinite-precision signed integers (ℤ).
+
+       The best way to get rid of such surprises is to use signed types
+       for numerical integer values, and use unsigned types only for
+       bit masks and enums.
+
+   Why not use 'size_t' directly?
+
+     * Because 'size_t' is an unsigned type, and a signed type is better.
+       See above.
+
+   Why not use 'ptrdiff_t' directly?
+
+     * Maintainability: When reading and modifying code, it helps to know that
+       a certain variable cannot have negative values.  For example, when you
+       have a loop
+
+         int n = ...;
+         for (int i = 0; i < n; i++) ...
+
+       or
+
+         ptrdiff_t n = ...;
+         for (ptrdiff_t i = 0; i < n; i++) ...
+
+       you have to ask yourself "what if n < 0?".  Whereas in
+
+         idx_t n = ...;
+         for (idx_t i = 0; i < n; i++) ...
+
+       you know that this case cannot happen.
+
+       Similarly, when a programmer writes
+
+         idx_t = ptr2 - ptr1;
+
+       there is an implied assertion that ptr1 and ptr2 point into the same
+       object and that ptr1 <= ptr2.
+
+     * Being future-proof: In the future, range types (integers which are
+       constrained to a certain range of values) may be added to C compilers
+       or to the C standard.  Several programming languages (Ada, Haskell,
+       Common Lisp, Pascal) already have range types.  Such range types may
+       help producing good code and good warnings.  The type 'idx_t' could
+       then be typedef'ed to a range type that is signed after promotion.  */
+
+/* In the future, idx_t could be typedef'ed to a signed range type.
+   The clang "extended integer types", supported in Clang 11 or newer
+   <https://clang.llvm.org/docs/LanguageExtensions.html#extended-integer-types>,
+   are a special case of range types.  However, these types don't support binary
+   operators with plain integer types (e.g. expressions such as x > 1).
+   Therefore, they don't behave like signed types (and not like unsigned types
+   either).  So, we cannot use them here.  */
+
+/* Use the signed type 'ptrdiff_t'.  */
+/* Note: ISO C does not mandate that 'size_t' and 'ptrdiff_t' have the same
+   size, but it is so on all platforms we have seen since 1990.  */
+typedef ptrdiff_t idx_t;
+
+/* IDX_MAX is the maximum value of an idx_t.  */
+#define IDX_MAX PTRDIFF_MAX
+
+/* So far no need has been found for an IDX_WIDTH macro.
+   Perhaps there should be another macro IDX_VALUE_BITS that does not
+   count the sign bit and is therefore one less than PTRDIFF_WIDTH.  */
+
+#endif /* _IDX_H */
index 6713d96..0a3cf1e 100644 (file)
@@ -1,6 +1,6 @@
 /* ignore a function return without a compiler warning.  -*- coding: utf-8 -*-
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering, Eric Blake and Pádraig Brady.  */
 
@@ -39,8 +39,9 @@
    versions 3.4 and newer have __attribute__ ((__warn_unused_result__))
    which may cause unwanted diagnostics in that case.  Use __typeof__
    and __extension__ to work around the problem, if the workaround is
-   known to be needed.  */
-#if 3 < __GNUC__ + (4 <= __GNUC_MINOR__)
+   known to be needed.
+   The workaround is not needed with clang.  */
+#if (3 < __GNUC__ + (4 <= __GNUC_MINOR__)) && !defined __clang__
 # define ignore_value(x) \
     (__extension__ ({ __typeof__ (x) __x = (x); (void) __x; }))
 #else
index 8add5de..f25f1a3 100644 (file)
@@ -1,6 +1,6 @@
 /* intprops.h -- properties of integer types
 
-   Copyright (C) 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
 #define _GL_INTPROPS_H
 
 #include <limits.h>
-#include <verify.h>
 
-#ifndef __has_builtin
-# define __has_builtin(x) 0
-#endif
-
-/* Return a value with the common real type of E and V and the value of V.  */
-#define _GL_INT_CONVERT(e, v) (0 * (e) + (v))
+/* Return a value with the common real type of E and V and the value of V.
+   Do not evaluate E.  */
+#define _GL_INT_CONVERT(e, v) ((1 ? 0 : (e)) + (v))
 
 /* Act like _GL_INT_CONVERT (E, -V) but work around a bug in IRIX 6.5 cc; see
-   <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00406.html>.  */
-#define _GL_INT_NEGATE_CONVERT(e, v) (0 * (e) - (v))
+   <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00406.html>.  */
+#define _GL_INT_NEGATE_CONVERT(e, v) ((1 ? 0 : (e)) - (v))
 
 /* The extra casts in the following macros work around compiler bugs,
    e.g., in Cray C 5.0.3.0.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
 
 /* Return 1 if the real expression E, after promotion, has a
-   signed or floating type.  */
+   signed or floating type.  Do not evaluate E.  */
 #define EXPR_SIGNED(e) (_GL_INT_NEGATE_CONVERT (e, 1) < 0)
 
 
 /* Minimum and maximum values for integer types and expressions.  */
 
 /* The width in bits of the integer type or expression T.
+   Do not evaluate T.  T must not be a bit-field expression.
    Padding bits are not supported; this is checked at compile-time below.  */
 #define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
 
@@ -63,7 +60,7 @@
         : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
 
 /* The maximum and minimum values for the type of the expression E,
-   after integer promotion.  E should not have side effects.  */
+   after integer promotion.  E is not evaluated.  */
 #define _GL_INT_MINIMUM(e)                                              \
   (EXPR_SIGNED (e)                                                      \
    ? ~ _GL_SIGNED_INT_MAXIMUM (e)                                       \
@@ -73,7 +70,7 @@
    ? _GL_SIGNED_INT_MAXIMUM (e)                                         \
    : _GL_INT_NEGATE_CONVERT (e, 1))
 #define _GL_SIGNED_INT_MAXIMUM(e)                                       \
-  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1)
+  (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH (+ (e)) - 2)) - 1) * 2 + 1)
 
 /* Work around OpenVMS incompatibility with C99.  */
 #if !defined LLONG_MAX && defined __INT64_MAX
 /* This include file assumes that signed types are two's complement without
    padding bits; the above macros have undefined behavior otherwise.
    If this is a problem for you, please let us know how to fix it for your host.
-   As a sanity check, test the assumption for some signed types that
-   <limits.h> bounds.  */
-verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
-verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
-verify (TYPE_MINIMUM (short int) == SHRT_MIN);
-verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
-verify (TYPE_MINIMUM (int) == INT_MIN);
-verify (TYPE_MAXIMUM (int) == INT_MAX);
-verify (TYPE_MINIMUM (long int) == LONG_MIN);
-verify (TYPE_MAXIMUM (long int) == LONG_MAX);
-#ifdef LLONG_MAX
-verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
-verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
-#endif
-/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined.  */
-#ifdef UINT_WIDTH
-verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
-#endif
+   This assumption is tested by the intprops-tests module.  */
 
 /* Does the __typeof__ keyword work?  This could be done by
    'configure', but for now it's easier to do it by hand.  */
 #if (2 <= __GNUC__ \
+     || (4 <= __clang_major__) \
      || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \
      || (0x5110 <= __SUNPRO_C && !__STDC__))
 # define _GL_HAVE___TYPEOF__ 1
@@ -114,8 +95,9 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
 #endif
 
 /* Return 1 if the integer type or expression T might be signed.  Return 0
-   if it is definitely unsigned.  This macro does not evaluate its argument,
-   and expands to an integer constant expression.  */
+   if it is definitely unsigned.  T must not be a bit-field expression.
+   This macro does not evaluate its argument, and expands to an
+   integer constant expression.  */
 #if _GL_HAVE___TYPEOF__
 # define _GL_SIGNED_TYPE_OR_EXPR(t) TYPE_SIGNED (__typeof__ (t))
 #else
@@ -128,18 +110,20 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
 #define INT_BITS_STRLEN_BOUND(b) (((b) * 146 + 484) / 485)
 
 /* Bound on length of the string representing an integer type or expression T.
+   T must not be a bit-field expression.
+
    Subtract 1 for the sign bit if T is signed, and then add 1 more for
    a minus sign if needed.
 
-   Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 0 when its argument is
-   signed, this macro may overestimate the true bound by one byte when
+   Because _GL_SIGNED_TYPE_OR_EXPR sometimes returns 1 when its argument is
+   unsigned, this macro may overestimate the true bound by one byte when
    applied to unsigned types of size 2, 4, 16, ... bytes.  */
 #define INT_STRLEN_BOUND(t)                                     \
   (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \
    + _GL_SIGNED_TYPE_OR_EXPR (t))
 
 /* Bound on buffer size needed to represent an integer type or expression T,
-   including the terminating null.  */
+   including the terminating null.  T must not be a bit-field expression.  */
 #define INT_BUFSIZE_BOUND(t) (INT_STRLEN_BOUND (t) + 1)
 
 
@@ -149,7 +133,8 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
    operators might not yield numerically correct answers due to
    arithmetic overflow.  They do not rely on undefined or
    implementation-defined behavior.  Their implementations are simple
-   and straightforward, but they are a bit harder to use than the
+   and straightforward, but they are harder to use and may be less
+   efficient than the INT_<op>_WRAPV, INT_<op>_OK, and
    INT_<op>_OVERFLOW macros described below.
 
    Example usage:
@@ -174,6 +159,9 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
    must have minimum value MIN and maximum MAX.  Unsigned types should
    use a zero MIN of the proper type.
 
+   Because all arguments are subject to integer promotions, these
+   macros typically do not work on types narrower than 'int'.
+
    These macros are tuned for constant MIN and MAX.  For commutative
    operations such as A + B, they are also tuned for constant B.  */
 
@@ -201,7 +189,7 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
 /* Return 1 if A * B would overflow in [MIN,MAX] arithmetic.
    See above for restrictions.  Avoid && and || as they tickle
    bugs in Sun C 5.11 2010/08/13 and other compilers; see
-   <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>.  */
+   <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00401.html>.  */
 #define INT_MULTIPLY_RANGE_OVERFLOW(a, b, min, max)     \
   ((b) < 0                                              \
    ? ((a) < 0                                           \
@@ -240,13 +228,39 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
    ? (a) < (min) >> (b)                                 \
    : (max) >> (b) < (a))
 
-/* True if __builtin_add_overflow (A, B, P) works when P is non-null.  */
-#define _GL_HAS_BUILTIN_OVERFLOW \
-  (5 <= __GNUC__ || __has_builtin (__builtin_add_overflow))
+/* True if __builtin_add_overflow (A, B, P) and __builtin_sub_overflow
+   (A, B, P) work when P is non-null.  */
+/* __builtin_{add,sub}_overflow exists but is not reliable in GCC 5.x and 6.x,
+   see <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98269>.  */
+#if 7 <= __GNUC__ && !defined __ICC
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 1
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW __has_builtin (__builtin_add_overflow)
+#else
+# define _GL_HAS_BUILTIN_ADD_OVERFLOW 0
+#endif
+
+/* True if __builtin_mul_overflow (A, B, P) works when P is non-null.  */
+#ifdef __clang__
+/* Work around Clang bug <https://bugs.llvm.org/show_bug.cgi?id=16404>.  */
+# define _GL_HAS_BUILTIN_MUL_OVERFLOW 0
+#else
+# define _GL_HAS_BUILTIN_MUL_OVERFLOW _GL_HAS_BUILTIN_ADD_OVERFLOW
+#endif
 
-/* True if __builtin_add_overflow_p (A, B, C) works.  */
-#define _GL_HAS_BUILTIN_OVERFLOW_P \
-  (7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p))
+/* True if __builtin_add_overflow_p (A, B, C) works, and similarly for
+   __builtin_sub_overflow_p and __builtin_mul_overflow_p.  */
+#if defined __clang__ || defined __ICC
+/* Clang 11 lacks __builtin_mul_overflow_p, and even if it did it
+   would presumably run afoul of Clang bug 16404.  ICC 2021.1's
+   __builtin_add_overflow_p etc. are not treated as integral constant
+   expressions even when all arguments are.  */
+# define _GL_HAS_BUILTIN_OVERFLOW_P 0
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_OVERFLOW_P __has_builtin (__builtin_mul_overflow_p)
+#else
+# define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__)
+#endif
 
 /* The _GL*_OVERFLOW macros have the same restrictions as the
    *_RANGE_OVERFLOW macros, except that they do not assume that operands
@@ -299,7 +313,9 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
 
    The INT_<op>_OVERFLOW macros return 1 if the corresponding C operators
    might not yield numerically correct answers due to arithmetic overflow.
-   The INT_<op>_WRAPV macros also store the low-order bits of the answer.
+   The INT_<op>_WRAPV macros compute the low-order bits of the sum,
+   difference, and product of two C integers, and return 1 if these
+   low-order bits are not numerically correct.
    These macros work correctly on all known practical hosts, and do not rely
    on undefined behavior due to signed arithmetic overflow.
 
@@ -327,9 +343,17 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
    arguments should not have side effects.
 
    The WRAPV macros are not constant expressions.  They support only
-   +, binary -, and *.  The result type must be signed.
+   +, binary -, and *.
 
-   These macros are tuned for their last argument being a constant.
+   Because the WRAPV macros convert the result, they report overflow
+   in different circumstances than the OVERFLOW macros do.  For
+   example, in the typical case with 16-bit 'short' and 32-bit 'int',
+   if A, B and R are all of type 'short' then INT_ADD_OVERFLOW (A, B)
+   returns false because the addition cannot overflow after A and B
+   are converted to 'int', whereas INT_ADD_WRAPV (A, B, &R) returns
+   true or false depending on whether the sum fits into 'short'.
+
+   These macros are tuned for their last input argument being a constant.
 
    Return 1 if the integer expressions A * B, A - B, -A, A * B, A / B,
    A % B, and A << B would overflow, respectively.  */
@@ -360,105 +384,257 @@ verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
    Arguments should be free of side effects.  */
 #define _GL_BINARY_OP_OVERFLOW(a, b, op_result_overflow)        \
   op_result_overflow (a, b,                                     \
-                      _GL_INT_MINIMUM (0 * (b) + (a)),          \
-                      _GL_INT_MAXIMUM (0 * (b) + (a)))
+                      _GL_INT_MINIMUM (_GL_INT_CONVERT (a, b)), \
+                      _GL_INT_MAXIMUM (_GL_INT_CONVERT (a, b)))
 
 /* Store the low-order bits of A + B, A - B, A * B, respectively, into *R.
    Return 1 if the result overflows.  See above for restrictions.  */
-#define INT_ADD_WRAPV(a, b, r) \
-  _GL_INT_OP_WRAPV (a, b, r, +, __builtin_add_overflow, INT_ADD_OVERFLOW)
-#define INT_SUBTRACT_WRAPV(a, b, r) \
-  _GL_INT_OP_WRAPV (a, b, r, -, __builtin_sub_overflow, INT_SUBTRACT_OVERFLOW)
-#define INT_MULTIPLY_WRAPV(a, b, r) \
-  _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW)
+#if _GL_HAS_BUILTIN_ADD_OVERFLOW
+# define INT_ADD_WRAPV(a, b, r) __builtin_add_overflow (a, b, r)
+# define INT_SUBTRACT_WRAPV(a, b, r) __builtin_sub_overflow (a, b, r)
+#else
+# define INT_ADD_WRAPV(a, b, r) \
+   _GL_INT_OP_WRAPV (a, b, r, +, _GL_INT_ADD_RANGE_OVERFLOW)
+# define INT_SUBTRACT_WRAPV(a, b, r) \
+   _GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
+#endif
+#if _GL_HAS_BUILTIN_MUL_OVERFLOW
+# if ((9 < __GNUC__ + (3 <= __GNUC_MINOR__) \
+       || (__GNUC__ == 8 && 4 <= __GNUC_MINOR__)) \
+      && !defined __ICC)
+#  define INT_MULTIPLY_WRAPV(a, b, r) __builtin_mul_overflow (a, b, r)
+# else
+   /* Work around GCC bug 91450.  */
+#  define INT_MULTIPLY_WRAPV(a, b, r) \
+    ((!_GL_SIGNED_TYPE_OR_EXPR (*(r)) && EXPR_SIGNED (a) && EXPR_SIGNED (b) \
+      && _GL_INT_MULTIPLY_RANGE_OVERFLOW (a, b, 0, (__typeof__ (*(r))) -1)) \
+     ? ((void) __builtin_mul_overflow (a, b, r), 1) \
+     : __builtin_mul_overflow (a, b, r))
+# endif
+#else
+# define INT_MULTIPLY_WRAPV(a, b, r) \
+   _GL_INT_OP_WRAPV (a, b, r, *, _GL_INT_MULTIPLY_RANGE_OVERFLOW)
+#endif
 
 /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390.  See:
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193
    https://llvm.org/bugs/show_bug.cgi?id=25390
    For now, assume all versions of GCC-like compilers generate bogus
-   warnings for _Generic.  This matters only for older compilers that
-   lack __builtin_add_overflow.  */
-#if __GNUC__
+   warnings for _Generic.  This matters only for compilers that
+   lack relevant builtins.  */
+#if __GNUC__ || defined __clang__
 # define _GL__GENERIC_BOGUS 1
 #else
 # define _GL__GENERIC_BOGUS 0
 #endif
 
 /* Store the low-order bits of A <op> B into *R, where OP specifies
-   the operation.  BUILTIN is the builtin operation, and OVERFLOW the
-   overflow predicate.  Return 1 if the result overflows.  See above
-   for restrictions.  */
-#if _GL_HAS_BUILTIN_OVERFLOW
-# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r)
-#elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
-# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+   the operation and OVERFLOW the overflow predicate.  Return 1 if the
+   result overflows.  See above for restrictions.  */
+#if 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS
+# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
    (_Generic \
     (*(r), \
      signed char: \
-       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
                         signed char, SCHAR_MIN, SCHAR_MAX), \
+     unsigned char: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                        unsigned char, 0, UCHAR_MAX), \
      short int: \
-       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
                         short int, SHRT_MIN, SHRT_MAX), \
+     unsigned short int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                        unsigned short int, 0, USHRT_MAX), \
      int: \
        _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
                         int, INT_MIN, INT_MAX), \
+     unsigned int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                        unsigned int, 0, UINT_MAX), \
      long int: \
        _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
                         long int, LONG_MIN, LONG_MAX), \
+     unsigned long int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                        unsigned long int, 0, ULONG_MAX), \
      long long int: \
        _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
-                        long long int, LLONG_MIN, LLONG_MAX)))
+                        long long int, LLONG_MIN, LLONG_MAX), \
+     unsigned long long int: \
+       _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+                        unsigned long long int, 0, ULLONG_MAX)))
 #else
-# define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \
+/* Store the low-order bits of A <op> B into *R, where OP specifies
+   the operation and OVERFLOW the overflow predicate.  If *R is
+   signed, its type is ST with bounds SMIN..SMAX; otherwise its type
+   is UT with bounds U..UMAX.  ST and UT are narrower than int.
+   Return 1 if the result overflows.  See above for restrictions.  */
+# if _GL_HAVE___TYPEOF__
+#  define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
+    (TYPE_SIGNED (__typeof__ (*(r))) \
+     ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, st, smin, smax) \
+     : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, ut, 0, umax))
+# else
+#  define _GL_INT_OP_WRAPV_SMALLISH(a,b,r,op,overflow,st,smin,smax,ut,umax) \
+    (overflow (a, b, smin, smax) \
+     ? (overflow (a, b, 0, umax) \
+        ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 1) \
+        : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) < 0) \
+     : (overflow (a, b, 0, umax) \
+        ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st)) >= 0 \
+        : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a,b,op,unsigned,st), 0)))
+# endif
+
+# define _GL_INT_OP_WRAPV(a, b, r, op, overflow) \
    (sizeof *(r) == sizeof (signed char) \
-    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned char, \
-                       signed char, SCHAR_MIN, SCHAR_MAX) \
+    ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
+                                 signed char, SCHAR_MIN, SCHAR_MAX, \
+                                 unsigned char, UCHAR_MAX) \
     : sizeof *(r) == sizeof (short int) \
-    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned short int, \
-                       short int, SHRT_MIN, SHRT_MAX) \
+    ? _GL_INT_OP_WRAPV_SMALLISH (a, b, r, op, overflow, \
+                                 short int, SHRT_MIN, SHRT_MAX, \
+                                 unsigned short int, USHRT_MAX) \
     : sizeof *(r) == sizeof (int) \
-    ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
-                       int, INT_MIN, INT_MAX) \
+    ? (EXPR_SIGNED (*(r)) \
+       ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                          int, INT_MIN, INT_MAX) \
+       : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
+                          unsigned int, 0, UINT_MAX)) \
     : _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
 # ifdef LLONG_MAX
 #  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
     (sizeof *(r) == sizeof (long int) \
-     ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
-                        long int, LONG_MIN, LONG_MAX) \
-     : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
-                        long long int, LLONG_MIN, LLONG_MAX))
+     ? (EXPR_SIGNED (*(r)) \
+        ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                           long int, LONG_MIN, LONG_MAX) \
+        : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                           unsigned long int, 0, ULONG_MAX)) \
+     : (EXPR_SIGNED (*(r)) \
+        ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+                           long long int, LLONG_MIN, LLONG_MAX) \
+        : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long long int, \
+                           unsigned long long int, 0, ULLONG_MAX)))
 # else
 #  define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \
-    _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
-                     long int, LONG_MIN, LONG_MAX)
+    (EXPR_SIGNED (*(r)) \
+     ? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                        long int, LONG_MIN, LONG_MAX) \
+     : _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
+                        unsigned long int, 0, ULONG_MAX))
 # endif
 #endif
 
 /* Store the low-order bits of A <op> B into *R, where the operation
    is given by OP.  Use the unsigned type UT for calculation to avoid
-   overflow problems.  *R's type is T, with extremal values TMIN and
-   TMAX.  T must be a signed integer type.  Return 1 if the result
-   overflows.  */
+   overflow problems.  *R's type is T, with extrema TMIN and TMAX.
+   T must be a signed integer type.  Return 1 if the result overflows.  */
 #define _GL_INT_OP_CALC(a, b, r, op, overflow, ut, t, tmin, tmax) \
-  (sizeof ((a) op (b)) < sizeof (t) \
-   ? _GL_INT_OP_CALC1 ((t) (a), (t) (b), r, op, overflow, ut, t, tmin, tmax) \
-   : _GL_INT_OP_CALC1 (a, b, r, op, overflow, ut, t, tmin, tmax))
-#define _GL_INT_OP_CALC1(a, b, r, op, overflow, ut, t, tmin, tmax) \
-  ((overflow (a, b) \
-    || (EXPR_SIGNED ((a) op (b)) && ((a) op (b)) < (tmin)) \
-    || (tmax) < ((a) op (b))) \
-   ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 1) \
-   : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t, tmin, tmax), 0))
-
-/* Return A <op> B, where the operation is given by OP.  Use the
-   unsigned type UT for calculation to avoid overflow problems.
-   Convert the result to type T without overflow by subtracting TMIN
-   from large values before converting, and adding it afterwards.
-   Compilers can optimize all the operations except OP.  */
-#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t, tmin, tmax) \
-  (((ut) (a) op (ut) (b)) <= (tmax) \
-   ? (t) ((ut) (a) op (ut) (b)) \
-   : ((t) (((ut) (a) op (ut) (b)) - (tmin)) + (tmin)))
+  (overflow (a, b, tmin, tmax) \
+   ? (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 1) \
+   : (*(r) = _GL_INT_OP_WRAPV_VIA_UNSIGNED (a, b, op, ut, t), 0))
+
+/* Return the low-order bits of A <op> B, where the operation is given
+   by OP.  Use the unsigned type UT for calculation to avoid undefined
+   behavior on signed integer overflow, and convert the result to type T.
+   UT is at least as wide as T and is no narrower than unsigned int,
+   T is two's complement, and there is no padding or trap representations.
+   Assume that converting UT to T yields the low-order bits, as is
+   done in all known two's-complement C compilers.  E.g., see:
+   https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html
+
+   According to the C standard, converting UT to T yields an
+   implementation-defined result or signal for values outside T's
+   range.  However, code that works around this theoretical problem
+   runs afoul of a compiler bug in Oracle Studio 12.3 x86.  See:
+   https://lists.gnu.org/r/bug-gnulib/2017-04/msg00049.html
+   As the compiler bug is real, don't try to work around the
+   theoretical problem.  */
+
+#define _GL_INT_OP_WRAPV_VIA_UNSIGNED(a, b, op, ut, t) \
+  ((t) ((ut) (a) op (ut) (b)))
+
+/* Return true if the numeric values A + B, A - B, A * B fall outside
+   the range TMIN..TMAX.  Arguments should be integer expressions
+   without side effects.  TMIN should be signed and nonpositive.
+   TMAX should be positive, and should be signed unless TMIN is zero.  */
+#define _GL_INT_ADD_RANGE_OVERFLOW(a, b, tmin, tmax) \
+  ((b) < 0 \
+   ? (((tmin) \
+       ? ((EXPR_SIGNED (_GL_INT_CONVERT (a, (tmin) - (b))) || (b) < (tmin)) \
+          && (a) < (tmin) - (b)) \
+       : (a) <= -1 - (b)) \
+      || ((EXPR_SIGNED (a) ? 0 <= (a) : (tmax) < (a)) && (tmax) < (a) + (b))) \
+   : (a) < 0 \
+   ? (((tmin) \
+       ? ((EXPR_SIGNED (_GL_INT_CONVERT (b, (tmin) - (a))) || (a) < (tmin)) \
+          && (b) < (tmin) - (a)) \
+       : (b) <= -1 - (a)) \
+      || ((EXPR_SIGNED (_GL_INT_CONVERT (a, b)) || (tmax) < (b)) \
+          && (tmax) < (a) + (b))) \
+   : (tmax) < (b) || (tmax) - (b) < (a))
+#define _GL_INT_SUBTRACT_RANGE_OVERFLOW(a, b, tmin, tmax) \
+  (((a) < 0) == ((b) < 0) \
+   ? ((a) < (b) \
+      ? !(tmin) || -1 - (tmin) < (b) - (a) - 1 \
+      : (tmax) < (a) - (b)) \
+   : (a) < 0 \
+   ? ((!EXPR_SIGNED (_GL_INT_CONVERT ((a) - (tmin), b)) && (a) - (tmin) < 0) \
+      || (a) - (tmin) < (b)) \
+   : ((! (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
+          && EXPR_SIGNED (_GL_INT_CONVERT ((tmax) + (b), a))) \
+       && (tmax) <= -1 - (b)) \
+      || (tmax) + (b) < (a)))
+#define _GL_INT_MULTIPLY_RANGE_OVERFLOW(a, b, tmin, tmax) \
+  ((b) < 0 \
+   ? ((a) < 0 \
+      ? (EXPR_SIGNED (_GL_INT_CONVERT (tmax, b)) \
+         ? (a) < (tmax) / (b) \
+         : ((INT_NEGATE_OVERFLOW (b) \
+             ? _GL_INT_CONVERT (b, tmax) >> (TYPE_WIDTH (+ (b)) - 1) \
+             : (tmax) / -(b)) \
+            <= -1 - (a))) \
+      : INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (b, tmin)) && (b) == -1 \
+      ? (EXPR_SIGNED (a) \
+         ? 0 < (a) + (tmin) \
+         : 0 < (a) && -1 - (tmin) < (a) - 1) \
+      : (tmin) / (b) < (a)) \
+   : (b) == 0 \
+   ? 0 \
+   : ((a) < 0 \
+      ? (INT_NEGATE_OVERFLOW (_GL_INT_CONVERT (a, tmin)) && (a) == -1 \
+         ? (EXPR_SIGNED (b) ? 0 < (b) + (tmin) : -1 - (tmin) < (b) - 1) \
+         : (tmin) / (a) < (b)) \
+      : (tmax) / (b) < (a)))
+
+/* The following macros compute A + B, A - B, and A * B, respectively.
+   If no overflow occurs, they set *R to the result and return 1;
+   otherwise, they return 0 and may modify *R.
+
+   Example usage:
+
+     long int result;
+     if (INT_ADD_OK (a, b, &result))
+       printf ("result is %ld\n", result);
+     else
+       printf ("overflow\n");
+
+   A, B, and *R should be integers; they need not be the same type,
+   and they need not be all signed or all unsigned.
+
+   These macros work correctly on all known practical hosts, and do not rely
+   on undefined behavior due to signed arithmetic overflow.
+
+   These macros are not constant expressions.
+
+   These macros may evaluate their arguments zero or multiple times, so the
+   arguments should not have side effects.
+
+   These macros are tuned for B being a constant.  */
+
+#define INT_ADD_OK(a, b, r) ! INT_ADD_WRAPV (a, b, r)
+#define INT_SUBTRACT_OK(a, b, r) ! INT_SUBTRACT_WRAPV (a, b, r)
+#define INT_MULTIPLY_OK(a, b, r) ! INT_MULTIPLY_WRAPV (a, b, r)
 
 #endif /* _GL_INTPROPS_H */
similarity index 59%
rename from tests/inttypes.in.h
rename to lib/inttypes.in.h
index ed09db6..e9ee500 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Derek Price.
    This file is part of gnulib.
 
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /*
  * ISO C 99 <inttypes.h> for platforms that lack it.
- * <http://www.opengroup.org/susv3xbd/inttypes.h.html>
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/inttypes.h.html>
  */
 
 #if __GNUC__ >= 3
@@ -38,6 +38,8 @@
 #  endif
 
 #  @INCLUDE_NEXT@ @NEXT_INTTYPES_H@
+
+#  define _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H
 # endif
 #endif
 
 #ifndef __GLIBC__
 # include <stdint.h>
 #endif
-/* Get CHAR_BIT.  */
+/* Get CHAR_BIT, INT_MAX, LONG_MAX, etc.  */
 #include <limits.h>
 /* On mingw, __USE_MINGW_ANSI_STDIO only works if <stdio.h> is also included */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # include <stdio.h>
 #endif
 
-#if !(INT_MIN == INT32_MIN && INT_MAX == INT32_MAX)
-# error "This file assumes that 'int' has exactly 32 bits. Please report your platform and compiler to <bug-gnulib@gnu.org>."
+#if !(INT_MAX == 0x7fffffff && INT_MIN + INT_MAX == -1)
+# error "This file assumes that 'int' is 32-bit two's complement. Please report your platform and compiler to <bug-gnulib@gnu.org>."
 #endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 # define _LONG_LONG_FORMAT_PREFIX "ll"
 #endif
 
-#if !defined PRId8 || @PRI_MACROS_BROKEN@
-# undef PRId8
+#if !defined PRId8
 # ifdef INT8_MAX
 #  define PRId8 "d"
 # endif
 #endif
-#if !defined PRIi8 || @PRI_MACROS_BROKEN@
-# undef PRIi8
+#if !defined PRIi8
 # ifdef INT8_MAX
 #  define PRIi8 "i"
 # endif
 #endif
-#if !defined PRIo8 || @PRI_MACROS_BROKEN@
-# undef PRIo8
+#if !defined PRIo8
 # ifdef UINT8_MAX
 #  define PRIo8 "o"
 # endif
 #endif
-#if !defined PRIu8 || @PRI_MACROS_BROKEN@
-# undef PRIu8
+#if !defined PRIu8
 # ifdef UINT8_MAX
 #  define PRIu8 "u"
 # endif
 #endif
-#if !defined PRIx8 || @PRI_MACROS_BROKEN@
-# undef PRIx8
+#if !defined PRIx8
 # ifdef UINT8_MAX
 #  define PRIx8 "x"
 # endif
 #endif
-#if !defined PRIX8 || @PRI_MACROS_BROKEN@
-# undef PRIX8
+#if !defined PRIX8
 # ifdef UINT8_MAX
 #  define PRIX8 "X"
 # endif
 #endif
-#if !defined PRId16 || @PRI_MACROS_BROKEN@
-# undef PRId16
+#if !defined PRId16
 # ifdef INT16_MAX
 #  define PRId16 "d"
 # endif
 #endif
-#if !defined PRIi16 || @PRI_MACROS_BROKEN@
-# undef PRIi16
+#if !defined PRIi16
 # ifdef INT16_MAX
 #  define PRIi16 "i"
 # endif
 #endif
-#if !defined PRIo16 || @PRI_MACROS_BROKEN@
-# undef PRIo16
+#if !defined PRIo16
 # ifdef UINT16_MAX
 #  define PRIo16 "o"
 # endif
 #endif
-#if !defined PRIu16 || @PRI_MACROS_BROKEN@
-# undef PRIu16
+#if !defined PRIu16
 # ifdef UINT16_MAX
 #  define PRIu16 "u"
 # endif
 #endif
-#if !defined PRIx16 || @PRI_MACROS_BROKEN@
-# undef PRIx16
+#if !defined PRIx16
 # ifdef UINT16_MAX
 #  define PRIx16 "x"
 # endif
 #endif
-#if !defined PRIX16 || @PRI_MACROS_BROKEN@
-# undef PRIX16
+#if !defined PRIX16
 # ifdef UINT16_MAX
 #  define PRIX16 "X"
 # endif
 #endif
-#if !defined PRId32 || @PRI_MACROS_BROKEN@
-# undef PRId32
+#if !defined PRId32
 # ifdef INT32_MAX
 #  define PRId32 "d"
 # endif
 #endif
-#if !defined PRIi32 || @PRI_MACROS_BROKEN@
-# undef PRIi32
+#if !defined PRIi32
 # ifdef INT32_MAX
 #  define PRIi32 "i"
 # endif
 #endif
-#if !defined PRIo32 || @PRI_MACROS_BROKEN@
-# undef PRIo32
+#if !defined PRIo32
 # ifdef UINT32_MAX
 #  define PRIo32 "o"
 # endif
 #endif
-#if !defined PRIu32 || @PRI_MACROS_BROKEN@
-# undef PRIu32
+#if !defined PRIu32
 # ifdef UINT32_MAX
 #  define PRIu32 "u"
 # endif
 #endif
-#if !defined PRIx32 || @PRI_MACROS_BROKEN@
-# undef PRIx32
+#if !defined PRIx32
 # ifdef UINT32_MAX
 #  define PRIx32 "x"
 # endif
 #endif
-#if !defined PRIX32 || @PRI_MACROS_BROKEN@
-# undef PRIX32
+#if !defined PRIX32
 # ifdef UINT32_MAX
 #  define PRIX32 "X"
 # endif
 #  define _PRI64_PREFIX "l"
 # elif defined _MSC_VER || defined __MINGW32__
 #  define _PRI64_PREFIX "I64"
-# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+# elif LONG_MAX >> 30 == 1
 #  define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
 # endif
-# if !defined PRId64 || @PRI_MACROS_BROKEN@
-#  undef PRId64
+# if !defined PRId64
 #  define PRId64 _PRI64_PREFIX "d"
 # endif
-# if !defined PRIi64 || @PRI_MACROS_BROKEN@
-#  undef PRIi64
+# if !defined PRIi64
 #  define PRIi64 _PRI64_PREFIX "i"
 # endif
 #endif
 #  define _PRIu64_PREFIX "l"
 # elif defined _MSC_VER || defined __MINGW32__
 #  define _PRIu64_PREFIX "I64"
-# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# elif ULONG_MAX >> 31 == 1
 #  define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
 # endif
-# if !defined PRIo64 || @PRI_MACROS_BROKEN@
-#  undef PRIo64
+# if !defined PRIo64
 #  define PRIo64 _PRIu64_PREFIX "o"
 # endif
-# if !defined PRIu64 || @PRI_MACROS_BROKEN@
-#  undef PRIu64
+# if !defined PRIu64
 #  define PRIu64 _PRIu64_PREFIX "u"
 # endif
-# if !defined PRIx64 || @PRI_MACROS_BROKEN@
-#  undef PRIx64
+# if !defined PRIx64
 #  define PRIx64 _PRIu64_PREFIX "x"
 # endif
-# if !defined PRIX64 || @PRI_MACROS_BROKEN@
-#  undef PRIX64
+# if !defined PRIX64
 #  define PRIX64 _PRIu64_PREFIX "X"
 # endif
 #endif
 
-#if !defined PRIdLEAST8 || @PRI_MACROS_BROKEN@
-# undef PRIdLEAST8
+#if !defined PRIdLEAST8
 # define PRIdLEAST8 "d"
 #endif
-#if !defined PRIiLEAST8 || @PRI_MACROS_BROKEN@
-# undef PRIiLEAST8
+#if !defined PRIiLEAST8
 # define PRIiLEAST8 "i"
 #endif
-#if !defined PRIoLEAST8 || @PRI_MACROS_BROKEN@
-# undef PRIoLEAST8
+#if !defined PRIoLEAST8
 # define PRIoLEAST8 "o"
 #endif
-#if !defined PRIuLEAST8 || @PRI_MACROS_BROKEN@
-# undef PRIuLEAST8
+#if !defined PRIuLEAST8
 # define PRIuLEAST8 "u"
 #endif
-#if !defined PRIxLEAST8 || @PRI_MACROS_BROKEN@
-# undef PRIxLEAST8
+#if !defined PRIxLEAST8
 # define PRIxLEAST8 "x"
 #endif
-#if !defined PRIXLEAST8 || @PRI_MACROS_BROKEN@
-# undef PRIXLEAST8
+#if !defined PRIXLEAST8
 # define PRIXLEAST8 "X"
 #endif
-#if !defined PRIdLEAST16 || @PRI_MACROS_BROKEN@
-# undef PRIdLEAST16
+#if !defined PRIdLEAST16
 # define PRIdLEAST16 "d"
 #endif
-#if !defined PRIiLEAST16 || @PRI_MACROS_BROKEN@
-# undef PRIiLEAST16
+#if !defined PRIiLEAST16
 # define PRIiLEAST16 "i"
 #endif
-#if !defined PRIoLEAST16 || @PRI_MACROS_BROKEN@
-# undef PRIoLEAST16
+#if !defined PRIoLEAST16
 # define PRIoLEAST16 "o"
 #endif
-#if !defined PRIuLEAST16 || @PRI_MACROS_BROKEN@
-# undef PRIuLEAST16
+#if !defined PRIuLEAST16
 # define PRIuLEAST16 "u"
 #endif
-#if !defined PRIxLEAST16 || @PRI_MACROS_BROKEN@
-# undef PRIxLEAST16
+#if !defined PRIxLEAST16
 # define PRIxLEAST16 "x"
 #endif
-#if !defined PRIXLEAST16 || @PRI_MACROS_BROKEN@
-# undef PRIXLEAST16
+#if !defined PRIXLEAST16
 # define PRIXLEAST16 "X"
 #endif
-#if !defined PRIdLEAST32 || @PRI_MACROS_BROKEN@
-# undef PRIdLEAST32
+#if !defined PRIdLEAST32
 # define PRIdLEAST32 "d"
 #endif
-#if !defined PRIiLEAST32 || @PRI_MACROS_BROKEN@
-# undef PRIiLEAST32
+#if !defined PRIiLEAST32
 # define PRIiLEAST32 "i"
 #endif
-#if !defined PRIoLEAST32 || @PRI_MACROS_BROKEN@
-# undef PRIoLEAST32
+#if !defined PRIoLEAST32
 # define PRIoLEAST32 "o"
 #endif
-#if !defined PRIuLEAST32 || @PRI_MACROS_BROKEN@
-# undef PRIuLEAST32
+#if !defined PRIuLEAST32
 # define PRIuLEAST32 "u"
 #endif
-#if !defined PRIxLEAST32 || @PRI_MACROS_BROKEN@
-# undef PRIxLEAST32
+#if !defined PRIxLEAST32
 # define PRIxLEAST32 "x"
 #endif
-#if !defined PRIXLEAST32 || @PRI_MACROS_BROKEN@
-# undef PRIXLEAST32
+#if !defined PRIXLEAST32
 # define PRIXLEAST32 "X"
 #endif
 #ifdef INT64_MAX
-# if !defined PRIdLEAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIdLEAST64
+# if !defined PRIdLEAST64
 #  define PRIdLEAST64 PRId64
 # endif
-# if !defined PRIiLEAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIiLEAST64
+# if !defined PRIiLEAST64
 #  define PRIiLEAST64 PRIi64
 # endif
 #endif
 #ifdef UINT64_MAX
-# if !defined PRIoLEAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIoLEAST64
+# if !defined PRIoLEAST64
 #  define PRIoLEAST64 PRIo64
 # endif
-# if !defined PRIuLEAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIuLEAST64
+# if !defined PRIuLEAST64
 #  define PRIuLEAST64 PRIu64
 # endif
-# if !defined PRIxLEAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIxLEAST64
+# if !defined PRIxLEAST64
 #  define PRIxLEAST64 PRIx64
 # endif
-# if !defined PRIXLEAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIXLEAST64
+# if !defined PRIXLEAST64
 #  define PRIXLEAST64 PRIX64
 # endif
 #endif
 
-#if !defined PRIdFAST8 || @PRI_MACROS_BROKEN@
-# undef PRIdFAST8
+#if !defined PRIdFAST8
 # if INT_FAST8_MAX > INT32_MAX
 #  define PRIdFAST8 PRId64
 # else
 #  define PRIdFAST8 "d"
 # endif
 #endif
-#if !defined PRIiFAST8 || @PRI_MACROS_BROKEN@
-# undef PRIiFAST8
+#if !defined PRIiFAST8
 # if INT_FAST8_MAX > INT32_MAX
 #  define PRIiFAST8 PRIi64
 # else
 #  define PRIiFAST8 "i"
 # endif
 #endif
-#if !defined PRIoFAST8 || @PRI_MACROS_BROKEN@
-# undef PRIoFAST8
+#if !defined PRIoFAST8
 # if UINT_FAST8_MAX > UINT32_MAX
 #  define PRIoFAST8 PRIo64
 # else
 #  define PRIoFAST8 "o"
 # endif
 #endif
-#if !defined PRIuFAST8 || @PRI_MACROS_BROKEN@
-# undef PRIuFAST8
+#if !defined PRIuFAST8
 # if UINT_FAST8_MAX > UINT32_MAX
 #  define PRIuFAST8 PRIu64
 # else
 #  define PRIuFAST8 "u"
 # endif
 #endif
-#if !defined PRIxFAST8 || @PRI_MACROS_BROKEN@
-# undef PRIxFAST8
+#if !defined PRIxFAST8
 # if UINT_FAST8_MAX > UINT32_MAX
 #  define PRIxFAST8 PRIx64
 # else
 #  define PRIxFAST8 "x"
 # endif
 #endif
-#if !defined PRIXFAST8 || @PRI_MACROS_BROKEN@
-# undef PRIXFAST8
+#if !defined PRIXFAST8
 # if UINT_FAST8_MAX > UINT32_MAX
 #  define PRIXFAST8 PRIX64
 # else
 #  define PRIXFAST8 "X"
 # endif
 #endif
-#if !defined PRIdFAST16 || @PRI_MACROS_BROKEN@
-# undef PRIdFAST16
+#if !defined PRIdFAST16
 # if INT_FAST16_MAX > INT32_MAX
 #  define PRIdFAST16 PRId64
 # else
 #  define PRIdFAST16 "d"
 # endif
 #endif
-#if !defined PRIiFAST16 || @PRI_MACROS_BROKEN@
-# undef PRIiFAST16
+#if !defined PRIiFAST16
 # if INT_FAST16_MAX > INT32_MAX
 #  define PRIiFAST16 PRIi64
 # else
 #  define PRIiFAST16 "i"
 # endif
 #endif
-#if !defined PRIoFAST16 || @PRI_MACROS_BROKEN@
-# undef PRIoFAST16
+#if !defined PRIoFAST16
 # if UINT_FAST16_MAX > UINT32_MAX
 #  define PRIoFAST16 PRIo64
 # else
 #  define PRIoFAST16 "o"
 # endif
 #endif
-#if !defined PRIuFAST16 || @PRI_MACROS_BROKEN@
-# undef PRIuFAST16
+#if !defined PRIuFAST16
 # if UINT_FAST16_MAX > UINT32_MAX
 #  define PRIuFAST16 PRIu64
 # else
 #  define PRIuFAST16 "u"
 # endif
 #endif
-#if !defined PRIxFAST16 || @PRI_MACROS_BROKEN@
-# undef PRIxFAST16
+#if !defined PRIxFAST16
 # if UINT_FAST16_MAX > UINT32_MAX
 #  define PRIxFAST16 PRIx64
 # else
 #  define PRIxFAST16 "x"
 # endif
 #endif
-#if !defined PRIXFAST16 || @PRI_MACROS_BROKEN@
-# undef PRIXFAST16
+#if !defined PRIXFAST16
 # if UINT_FAST16_MAX > UINT32_MAX
 #  define PRIXFAST16 PRIX64
 # else
 #  define PRIXFAST16 "X"
 # endif
 #endif
-#if !defined PRIdFAST32 || @PRI_MACROS_BROKEN@
-# undef PRIdFAST32
+#if !defined PRIdFAST32
 # if INT_FAST32_MAX > INT32_MAX
 #  define PRIdFAST32 PRId64
 # else
 #  define PRIdFAST32 "d"
 # endif
 #endif
-#if !defined PRIiFAST32 || @PRI_MACROS_BROKEN@
-# undef PRIiFAST32
+#if !defined PRIiFAST32
 # if INT_FAST32_MAX > INT32_MAX
 #  define PRIiFAST32 PRIi64
 # else
 #  define PRIiFAST32 "i"
 # endif
 #endif
-#if !defined PRIoFAST32 || @PRI_MACROS_BROKEN@
-# undef PRIoFAST32
+#if !defined PRIoFAST32
 # if UINT_FAST32_MAX > UINT32_MAX
 #  define PRIoFAST32 PRIo64
 # else
 #  define PRIoFAST32 "o"
 # endif
 #endif
-#if !defined PRIuFAST32 || @PRI_MACROS_BROKEN@
-# undef PRIuFAST32
+#if !defined PRIuFAST32
 # if UINT_FAST32_MAX > UINT32_MAX
 #  define PRIuFAST32 PRIu64
 # else
 #  define PRIuFAST32 "u"
 # endif
 #endif
-#if !defined PRIxFAST32 || @PRI_MACROS_BROKEN@
-# undef PRIxFAST32
+#if !defined PRIxFAST32
 # if UINT_FAST32_MAX > UINT32_MAX
 #  define PRIxFAST32 PRIx64
 # else
 #  define PRIxFAST32 "x"
 # endif
 #endif
-#if !defined PRIXFAST32 || @PRI_MACROS_BROKEN@
-# undef PRIXFAST32
+#if !defined PRIXFAST32
 # if UINT_FAST32_MAX > UINT32_MAX
 #  define PRIXFAST32 PRIX64
 # else
 # endif
 #endif
 #ifdef INT64_MAX
-# if !defined PRIdFAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIdFAST64
+# if !defined PRIdFAST64
 #  define PRIdFAST64 PRId64
 # endif
-# if !defined PRIiFAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIiFAST64
+# if !defined PRIiFAST64
 #  define PRIiFAST64 PRIi64
 # endif
 #endif
 #ifdef UINT64_MAX
-# if !defined PRIoFAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIoFAST64
+# if !defined PRIoFAST64
 #  define PRIoFAST64 PRIo64
 # endif
-# if !defined PRIuFAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIuFAST64
+# if !defined PRIuFAST64
 #  define PRIuFAST64 PRIu64
 # endif
-# if !defined PRIxFAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIxFAST64
+# if !defined PRIxFAST64
 #  define PRIxFAST64 PRIx64
 # endif
-# if !defined PRIXFAST64 || @PRI_MACROS_BROKEN@
-#  undef PRIXFAST64
+# if !defined PRIXFAST64
 #  define PRIXFAST64 PRIX64
 # endif
 #endif
 
-#if !defined PRIdMAX || @PRI_MACROS_BROKEN@
-# undef PRIdMAX
+#if !defined PRIdMAX
 # if @INT32_MAX_LT_INTMAX_MAX@
 #  define PRIdMAX PRId64
 # else
 #  define PRIdMAX "ld"
 # endif
 #endif
-#if !defined PRIiMAX || @PRI_MACROS_BROKEN@
-# undef PRIiMAX
+#if !defined PRIiMAX
 # if @INT32_MAX_LT_INTMAX_MAX@
 #  define PRIiMAX PRIi64
 # else
 #  define PRIiMAX "li"
 # endif
 #endif
-#if !defined PRIoMAX || @PRI_MACROS_BROKEN@
-# undef PRIoMAX
+#if !defined PRIoMAX
 # if @UINT32_MAX_LT_UINTMAX_MAX@
 #  define PRIoMAX PRIo64
 # else
 #  define PRIoMAX "lo"
 # endif
 #endif
-#if !defined PRIuMAX || @PRI_MACROS_BROKEN@
-# undef PRIuMAX
+#if !defined PRIuMAX
 # if @UINT32_MAX_LT_UINTMAX_MAX@
 #  define PRIuMAX PRIu64
 # else
 #  define PRIuMAX "lu"
 # endif
 #endif
-#if !defined PRIxMAX || @PRI_MACROS_BROKEN@
-# undef PRIxMAX
+#if !defined PRIxMAX
 # if @UINT32_MAX_LT_UINTMAX_MAX@
 #  define PRIxMAX PRIx64
 # else
 #  define PRIxMAX "lx"
 # endif
 #endif
-#if !defined PRIXMAX || @PRI_MACROS_BROKEN@
-# undef PRIXMAX
+#if !defined PRIXMAX
 # if @UINT32_MAX_LT_UINTMAX_MAX@
 #  define PRIXMAX PRIX64
 # else
 # endif
 #endif
 
-#if !defined PRIdPTR || @PRI_MACROS_BROKEN@
-# undef PRIdPTR
+#if !defined PRIdPTR
 # ifdef INTPTR_MAX
 #  define PRIdPTR @PRIPTR_PREFIX@ "d"
 # endif
 #endif
-#if !defined PRIiPTR || @PRI_MACROS_BROKEN@
-# undef PRIiPTR
+#if !defined PRIiPTR
 # ifdef INTPTR_MAX
 #  define PRIiPTR @PRIPTR_PREFIX@ "i"
 # endif
 #endif
-#if !defined PRIoPTR || @PRI_MACROS_BROKEN@
-# undef PRIoPTR
+#if !defined PRIoPTR
 # ifdef UINTPTR_MAX
 #  define PRIoPTR @PRIPTR_PREFIX@ "o"
 # endif
 #endif
-#if !defined PRIuPTR || @PRI_MACROS_BROKEN@
-# undef PRIuPTR
+#if !defined PRIuPTR
 # ifdef UINTPTR_MAX
 #  define PRIuPTR @PRIPTR_PREFIX@ "u"
 # endif
 #endif
-#if !defined PRIxPTR || @PRI_MACROS_BROKEN@
-# undef PRIxPTR
+#if !defined PRIxPTR
 # ifdef UINTPTR_MAX
 #  define PRIxPTR @PRIPTR_PREFIX@ "x"
 # endif
 #endif
-#if !defined PRIXPTR || @PRI_MACROS_BROKEN@
-# undef PRIXPTR
+#if !defined PRIXPTR
 # ifdef UINTPTR_MAX
 #  define PRIXPTR @PRIPTR_PREFIX@ "X"
 # endif
 #endif
 
-#if !defined SCNd8 || @PRI_MACROS_BROKEN@
-# undef SCNd8
+#if !defined SCNd8
 # ifdef INT8_MAX
 #  define SCNd8 "hhd"
 # endif
 #endif
-#if !defined SCNi8 || @PRI_MACROS_BROKEN@
-# undef SCNi8
+#if !defined SCNi8
 # ifdef INT8_MAX
 #  define SCNi8 "hhi"
 # endif
 #endif
-#if !defined SCNo8 || @PRI_MACROS_BROKEN@
-# undef SCNo8
+#if !defined SCNo8
 # ifdef UINT8_MAX
 #  define SCNo8 "hho"
 # endif
 #endif
-#if !defined SCNu8 || @PRI_MACROS_BROKEN@
-# undef SCNu8
+#if !defined SCNu8
 # ifdef UINT8_MAX
 #  define SCNu8 "hhu"
 # endif
 #endif
-#if !defined SCNx8 || @PRI_MACROS_BROKEN@
-# undef SCNx8
+#if !defined SCNx8
 # ifdef UINT8_MAX
 #  define SCNx8 "hhx"
 # endif
 #endif
-#if !defined SCNd16 || @PRI_MACROS_BROKEN@
-# undef SCNd16
+#if !defined SCNd16
 # ifdef INT16_MAX
 #  define SCNd16 "hd"
 # endif
 #endif
-#if !defined SCNi16 || @PRI_MACROS_BROKEN@
-# undef SCNi16
+#if !defined SCNi16
 # ifdef INT16_MAX
 #  define SCNi16 "hi"
 # endif
 #endif
-#if !defined SCNo16 || @PRI_MACROS_BROKEN@
-# undef SCNo16
+#if !defined SCNo16
 # ifdef UINT16_MAX
 #  define SCNo16 "ho"
 # endif
 #endif
-#if !defined SCNu16 || @PRI_MACROS_BROKEN@
-# undef SCNu16
+#if !defined SCNu16
 # ifdef UINT16_MAX
 #  define SCNu16 "hu"
 # endif
 #endif
-#if !defined SCNx16 || @PRI_MACROS_BROKEN@
-# undef SCNx16
+#if !defined SCNx16
 # ifdef UINT16_MAX
 #  define SCNx16 "hx"
 # endif
 #endif
-#if !defined SCNd32 || @PRI_MACROS_BROKEN@
-# undef SCNd32
+#if !defined SCNd32
 # ifdef INT32_MAX
 #  define SCNd32 "d"
 # endif
 #endif
-#if !defined SCNi32 || @PRI_MACROS_BROKEN@
-# undef SCNi32
+#if !defined SCNi32
 # ifdef INT32_MAX
 #  define SCNi32 "i"
 # endif
 #endif
-#if !defined SCNo32 || @PRI_MACROS_BROKEN@
-# undef SCNo32
+#if !defined SCNo32
 # ifdef UINT32_MAX
 #  define SCNo32 "o"
 # endif
 #endif
-#if !defined SCNu32 || @PRI_MACROS_BROKEN@
-# undef SCNu32
+#if !defined SCNu32
 # ifdef UINT32_MAX
 #  define SCNu32 "u"
 # endif
 #endif
-#if !defined SCNx32 || @PRI_MACROS_BROKEN@
-# undef SCNx32
+#if !defined SCNx32
 # ifdef UINT32_MAX
 #  define SCNx32 "x"
 # endif
 #  define _SCN64_PREFIX "l"
 # elif defined _MSC_VER || defined __MINGW32__
 #  define _SCN64_PREFIX "I64"
-# elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+# elif LONG_MAX >> 30 == 1
 #  define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
 # endif
-# if !defined SCNd64 || @PRI_MACROS_BROKEN@
-#  undef SCNd64
+# if !defined SCNd64
 #  define SCNd64 _SCN64_PREFIX "d"
 # endif
-# if !defined SCNi64 || @PRI_MACROS_BROKEN@
-#  undef SCNi64
+# if !defined SCNi64
 #  define SCNi64 _SCN64_PREFIX "i"
 # endif
 #endif
 #  define _SCNu64_PREFIX "l"
 # elif defined _MSC_VER || defined __MINGW32__
 #  define _SCNu64_PREFIX "I64"
-# elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+# elif ULONG_MAX >> 31 == 1
 #  define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
 # endif
-# if !defined SCNo64 || @PRI_MACROS_BROKEN@
-#  undef SCNo64
+# if !defined SCNo64
 #  define SCNo64 _SCNu64_PREFIX "o"
 # endif
-# if !defined SCNu64 || @PRI_MACROS_BROKEN@
-#  undef SCNu64
+# if !defined SCNu64
 #  define SCNu64 _SCNu64_PREFIX "u"
 # endif
-# if !defined SCNx64 || @PRI_MACROS_BROKEN@
-#  undef SCNx64
+# if !defined SCNx64
 #  define SCNx64 _SCNu64_PREFIX "x"
 # endif
 #endif
 
-#if !defined SCNdLEAST8 || @PRI_MACROS_BROKEN@
-# undef SCNdLEAST8
+#if !defined SCNdLEAST8
 # define SCNdLEAST8 "hhd"
 #endif
-#if !defined SCNiLEAST8 || @PRI_MACROS_BROKEN@
-# undef SCNiLEAST8
+#if !defined SCNiLEAST8
 # define SCNiLEAST8 "hhi"
 #endif
-#if !defined SCNoLEAST8 || @PRI_MACROS_BROKEN@
-# undef SCNoLEAST8
+#if !defined SCNoLEAST8
 # define SCNoLEAST8 "hho"
 #endif
-#if !defined SCNuLEAST8 || @PRI_MACROS_BROKEN@
-# undef SCNuLEAST8
+#if !defined SCNuLEAST8
 # define SCNuLEAST8 "hhu"
 #endif
-#if !defined SCNxLEAST8 || @PRI_MACROS_BROKEN@
-# undef SCNxLEAST8
+#if !defined SCNxLEAST8
 # define SCNxLEAST8 "hhx"
 #endif
-#if !defined SCNdLEAST16 || @PRI_MACROS_BROKEN@
-# undef SCNdLEAST16
+#if !defined SCNdLEAST16
 # define SCNdLEAST16 "hd"
 #endif
-#if !defined SCNiLEAST16 || @PRI_MACROS_BROKEN@
-# undef SCNiLEAST16
+#if !defined SCNiLEAST16
 # define SCNiLEAST16 "hi"
 #endif
-#if !defined SCNoLEAST16 || @PRI_MACROS_BROKEN@
-# undef SCNoLEAST16
+#if !defined SCNoLEAST16
 # define SCNoLEAST16 "ho"
 #endif
-#if !defined SCNuLEAST16 || @PRI_MACROS_BROKEN@
-# undef SCNuLEAST16
+#if !defined SCNuLEAST16
 # define SCNuLEAST16 "hu"
 #endif
-#if !defined SCNxLEAST16 || @PRI_MACROS_BROKEN@
-# undef SCNxLEAST16
+#if !defined SCNxLEAST16
 # define SCNxLEAST16 "hx"
 #endif
-#if !defined SCNdLEAST32 || @PRI_MACROS_BROKEN@
-# undef SCNdLEAST32
+#if !defined SCNdLEAST32
 # define SCNdLEAST32 "d"
 #endif
-#if !defined SCNiLEAST32 || @PRI_MACROS_BROKEN@
-# undef SCNiLEAST32
+#if !defined SCNiLEAST32
 # define SCNiLEAST32 "i"
 #endif
-#if !defined SCNoLEAST32 || @PRI_MACROS_BROKEN@
-# undef SCNoLEAST32
+#if !defined SCNoLEAST32
 # define SCNoLEAST32 "o"
 #endif
-#if !defined SCNuLEAST32 || @PRI_MACROS_BROKEN@
-# undef SCNuLEAST32
+#if !defined SCNuLEAST32
 # define SCNuLEAST32 "u"
 #endif
-#if !defined SCNxLEAST32 || @PRI_MACROS_BROKEN@
-# undef SCNxLEAST32
+#if !defined SCNxLEAST32
 # define SCNxLEAST32 "x"
 #endif
 #ifdef INT64_MAX
-# if !defined SCNdLEAST64 || @PRI_MACROS_BROKEN@
-#  undef SCNdLEAST64
+# if !defined SCNdLEAST64
 #  define SCNdLEAST64 SCNd64
 # endif
-# if !defined SCNiLEAST64 || @PRI_MACROS_BROKEN@
-#  undef SCNiLEAST64
+# if !defined SCNiLEAST64
 #  define SCNiLEAST64 SCNi64
 # endif
 #endif
 #ifdef UINT64_MAX
-# if !defined SCNoLEAST64 || @PRI_MACROS_BROKEN@
-#  undef SCNoLEAST64
+# if !defined SCNoLEAST64
 #  define SCNoLEAST64 SCNo64
 # endif
-# if !defined SCNuLEAST64 || @PRI_MACROS_BROKEN@
-#  undef SCNuLEAST64
+# if !defined SCNuLEAST64
 #  define SCNuLEAST64 SCNu64
 # endif
-# if !defined SCNxLEAST64 || @PRI_MACROS_BROKEN@
-#  undef SCNxLEAST64
+# if !defined SCNxLEAST64
 #  define SCNxLEAST64 SCNx64
 # endif
 #endif
 
-#if !defined SCNdFAST8 || @PRI_MACROS_BROKEN@
-# undef SCNdFAST8
+#if !defined SCNdFAST8
 # if INT_FAST8_MAX > INT32_MAX
 #  define SCNdFAST8 SCNd64
 # elif INT_FAST8_MAX == 0x7fff
 #  define SCNdFAST8 "d"
 # endif
 #endif
-#if !defined SCNiFAST8 || @PRI_MACROS_BROKEN@
-# undef SCNiFAST8
+#if !defined SCNiFAST8
 # if INT_FAST8_MAX > INT32_MAX
 #  define SCNiFAST8 SCNi64
 # elif INT_FAST8_MAX == 0x7fff
 #  define SCNiFAST8 "i"
 # endif
 #endif
-#if !defined SCNoFAST8 || @PRI_MACROS_BROKEN@
-# undef SCNoFAST8
+#if !defined SCNoFAST8
 # if UINT_FAST8_MAX > UINT32_MAX
 #  define SCNoFAST8 SCNo64
 # elif UINT_FAST8_MAX == 0xffff
 #  define SCNoFAST8 "o"
 # endif
 #endif
-#if !defined SCNuFAST8 || @PRI_MACROS_BROKEN@
-# undef SCNuFAST8
+#if !defined SCNuFAST8
 # if UINT_FAST8_MAX > UINT32_MAX
 #  define SCNuFAST8 SCNu64
 # elif UINT_FAST8_MAX == 0xffff
 #  define SCNuFAST8 "u"
 # endif
 #endif
-#if !defined SCNxFAST8 || @PRI_MACROS_BROKEN@
-# undef SCNxFAST8
+#if !defined SCNxFAST8
 # if UINT_FAST8_MAX > UINT32_MAX
 #  define SCNxFAST8 SCNx64
 # elif UINT_FAST8_MAX == 0xffff
 #  define SCNxFAST8 "x"
 # endif
 #endif
-#if !defined SCNdFAST16 || @PRI_MACROS_BROKEN@
-# undef SCNdFAST16
+#if !defined SCNdFAST16
 # if INT_FAST16_MAX > INT32_MAX
 #  define SCNdFAST16 SCNd64
 # elif INT_FAST16_MAX == 0x7fff
 #  define SCNdFAST16 "d"
 # endif
 #endif
-#if !defined SCNiFAST16 || @PRI_MACROS_BROKEN@
-# undef SCNiFAST16
+#if !defined SCNiFAST16
 # if INT_FAST16_MAX > INT32_MAX
 #  define SCNiFAST16 SCNi64
 # elif INT_FAST16_MAX == 0x7fff
 #  define SCNiFAST16 "i"
 # endif
 #endif
-#if !defined SCNoFAST16 || @PRI_MACROS_BROKEN@
-# undef SCNoFAST16
+#if !defined SCNoFAST16
 # if UINT_FAST16_MAX > UINT32_MAX
 #  define SCNoFAST16 SCNo64
 # elif UINT_FAST16_MAX == 0xffff
 #  define SCNoFAST16 "o"
 # endif
 #endif
-#if !defined SCNuFAST16 || @PRI_MACROS_BROKEN@
-# undef SCNuFAST16
+#if !defined SCNuFAST16
 # if UINT_FAST16_MAX > UINT32_MAX
 #  define SCNuFAST16 SCNu64
 # elif UINT_FAST16_MAX == 0xffff
 #  define SCNuFAST16 "u"
 # endif
 #endif
-#if !defined SCNxFAST16 || @PRI_MACROS_BROKEN@
-# undef SCNxFAST16
+#if !defined SCNxFAST16
 # if UINT_FAST16_MAX > UINT32_MAX
 #  define SCNxFAST16 SCNx64
 # elif UINT_FAST16_MAX == 0xffff
 #  define SCNxFAST16 "x"
 # endif
 #endif
-#if !defined SCNdFAST32 || @PRI_MACROS_BROKEN@
-# undef SCNdFAST32
+#if !defined SCNdFAST32
 # if INT_FAST32_MAX > INT32_MAX
 #  define SCNdFAST32 SCNd64
 # else
 #  define SCNdFAST32 "d"
 # endif
 #endif
-#if !defined SCNiFAST32 || @PRI_MACROS_BROKEN@
-# undef SCNiFAST32
+#if !defined SCNiFAST32
 # if INT_FAST32_MAX > INT32_MAX
 #  define SCNiFAST32 SCNi64
 # else
 #  define SCNiFAST32 "i"
 # endif
 #endif
-#if !defined SCNoFAST32 || @PRI_MACROS_BROKEN@
-# undef SCNoFAST32
+#if !defined SCNoFAST32
 # if UINT_FAST32_MAX > UINT32_MAX
 #  define SCNoFAST32 SCNo64
 # else
 #  define SCNoFAST32 "o"
 # endif
 #endif
-#if !defined SCNuFAST32 || @PRI_MACROS_BROKEN@
-# undef SCNuFAST32
+#if !defined SCNuFAST32
 # if UINT_FAST32_MAX > UINT32_MAX
 #  define SCNuFAST32 SCNu64
 # else
 #  define SCNuFAST32 "u"
 # endif
 #endif
-#if !defined SCNxFAST32 || @PRI_MACROS_BROKEN@
-# undef SCNxFAST32
+#if !defined SCNxFAST32
 # if UINT_FAST32_MAX > UINT32_MAX
 #  define SCNxFAST32 SCNx64
 # else
 # endif
 #endif
 #ifdef INT64_MAX
-# if !defined SCNdFAST64 || @PRI_MACROS_BROKEN@
-#  undef SCNdFAST64
+# if !defined SCNdFAST64
 #  define SCNdFAST64 SCNd64
 # endif
-# if !defined SCNiFAST64 || @PRI_MACROS_BROKEN@
-#  undef SCNiFAST64
+# if !defined SCNiFAST64
 #  define SCNiFAST64 SCNi64
 # endif
 #endif
 #ifdef UINT64_MAX
-# if !defined SCNoFAST64 || @PRI_MACROS_BROKEN@
-#  undef SCNoFAST64
+# if !defined SCNoFAST64
 #  define SCNoFAST64 SCNo64
 # endif
-# if !defined SCNuFAST64 || @PRI_MACROS_BROKEN@
-#  undef SCNuFAST64
+# if !defined SCNuFAST64
 #  define SCNuFAST64 SCNu64
 # endif
-# if !defined SCNxFAST64 || @PRI_MACROS_BROKEN@
-#  undef SCNxFAST64
+# if !defined SCNxFAST64
 #  define SCNxFAST64 SCNx64
 # endif
 #endif
 
-#if !defined SCNdMAX || @PRI_MACROS_BROKEN@
-# undef SCNdMAX
+#if !defined SCNdMAX
 # if @INT32_MAX_LT_INTMAX_MAX@
 #  define SCNdMAX SCNd64
 # else
 #  define SCNdMAX "ld"
 # endif
 #endif
-#if !defined SCNiMAX || @PRI_MACROS_BROKEN@
-# undef SCNiMAX
+#if !defined SCNiMAX
 # if @INT32_MAX_LT_INTMAX_MAX@
 #  define SCNiMAX SCNi64
 # else
 #  define SCNiMAX "li"
 # endif
 #endif
-#if !defined SCNoMAX || @PRI_MACROS_BROKEN@
-# undef SCNoMAX
+#if !defined SCNoMAX
 # if @UINT32_MAX_LT_UINTMAX_MAX@
 #  define SCNoMAX SCNo64
 # else
 #  define SCNoMAX "lo"
 # endif
 #endif
-#if !defined SCNuMAX || @PRI_MACROS_BROKEN@
-# undef SCNuMAX
+#if !defined SCNuMAX
 # if @UINT32_MAX_LT_UINTMAX_MAX@
 #  define SCNuMAX SCNu64
 # else
 #  define SCNuMAX "lu"
 # endif
 #endif
-#if !defined SCNxMAX || @PRI_MACROS_BROKEN@
-# undef SCNxMAX
+#if !defined SCNxMAX
 # if @UINT32_MAX_LT_UINTMAX_MAX@
 #  define SCNxMAX SCNx64
 # else
 # endif
 #endif
 
-#if !defined SCNdPTR || @PRI_MACROS_BROKEN@
-# undef SCNdPTR
+#if !defined SCNdPTR
 # ifdef INTPTR_MAX
 #  define SCNdPTR @PRIPTR_PREFIX@ "d"
 # endif
 #endif
-#if !defined SCNiPTR || @PRI_MACROS_BROKEN@
-# undef SCNiPTR
+#if !defined SCNiPTR
 # ifdef INTPTR_MAX
 #  define SCNiPTR @PRIPTR_PREFIX@ "i"
 # endif
 #endif
-#if !defined SCNoPTR || @PRI_MACROS_BROKEN@
-# undef SCNoPTR
+#if !defined SCNoPTR
 # ifdef UINTPTR_MAX
 #  define SCNoPTR @PRIPTR_PREFIX@ "o"
 # endif
 #endif
-#if !defined SCNuPTR || @PRI_MACROS_BROKEN@
-# undef SCNuPTR
+#if !defined SCNuPTR
 # ifdef UINTPTR_MAX
 #  define SCNuPTR @PRIPTR_PREFIX@ "u"
 # endif
 #endif
-#if !defined SCNxPTR || @PRI_MACROS_BROKEN@
-# undef SCNxPTR
+#if !defined SCNxPTR
 # ifdef UINTPTR_MAX
 #  define SCNxPTR @PRIPTR_PREFIX@ "x"
 # endif
@@ -1067,11 +915,13 @@ _GL_WARN_ON_USE (imaxabs, "imaxabs is unportable - "
 #endif
 
 #if @GNULIB_IMAXDIV@
-# if !@HAVE_DECL_IMAXDIV@
+# if !@HAVE_IMAXDIV_T@
 #  if !GNULIB_defined_imaxdiv_t
 typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
 #   define GNULIB_defined_imaxdiv_t 1
 #  endif
+# endif
+# if !@HAVE_DECL_IMAXDIV@
 extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -1089,15 +939,19 @@ _GL_WARN_ON_USE (imaxdiv, "imaxdiv is unportable - "
 #   define strtoimax rpl_strtoimax
 #  endif
 _GL_FUNCDECL_RPL (strtoimax, intmax_t,
-                  (const char *, char **, int) _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (strtoimax, intmax_t, (const char *, char **, int));
+                  (const char *restrict, char **restrict, int)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoimax, intmax_t,
+                  (const char *restrict, char **restrict, int));
 # else
 #  if !@HAVE_DECL_STRTOIMAX@
 #   undef strtoimax
 _GL_FUNCDECL_SYS (strtoimax, intmax_t,
-                  (const char *, char **, int) _GL_ARG_NONNULL ((1)));
+                  (const char *restrict, char **restrict, int)
+                  _GL_ARG_NONNULL ((1)));
 #  endif
-_GL_CXXALIAS_SYS (strtoimax, intmax_t, (const char *, char **, int));
+_GL_CXXALIAS_SYS (strtoimax, intmax_t,
+                  (const char *restrict, char **restrict, int));
 # endif
 _GL_CXXALIASWARN (strtoimax);
 #elif defined GNULIB_POSIXCHECK
@@ -1115,15 +969,19 @@ _GL_WARN_ON_USE (strtoimax, "strtoimax is unportable - "
 #   define strtoumax rpl_strtoumax
 #  endif
 _GL_FUNCDECL_RPL (strtoumax, uintmax_t,
-                  (const char *, char **, int) _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (strtoumax, uintmax_t, (const char *, char **, int));
+                  (const char *restrict, char **restrict, int)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoumax, uintmax_t,
+                  (const char *restrict, char **restrict, int));
 # else
 #  if !@HAVE_DECL_STRTOUMAX@
 #   undef strtoumax
 _GL_FUNCDECL_SYS (strtoumax, uintmax_t,
-                  (const char *, char **, int) _GL_ARG_NONNULL ((1)));
+                  (const char *restrict, char **restrict, int)
+                  _GL_ARG_NONNULL ((1)));
 #  endif
-_GL_CXXALIAS_SYS (strtoumax, uintmax_t, (const char *, char **, int));
+_GL_CXXALIAS_SYS (strtoumax, uintmax_t,
+                  (const char *restrict, char **restrict, int));
 # endif
 _GL_CXXALIASWARN (strtoumax);
 #elif defined GNULIB_POSIXCHECK
index e1e57b2..434e5df 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index dc47264..c299130 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if HAVE_ISNAND_IN_LIBC
 /* Get declaration of isnan macro.  */
 # include <math.h>
-# if __GNUC__ >= 4
-   /* GCC 4.0 and newer provides three built-ins for isnan.  */
+# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+   /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.  */
 #  undef isnand
 #  define isnand(x) __builtin_isnan ((double)(x))
 # else
index 405b23a..3c7e8e8 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
index 4e68cad..28a8db6 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if HAVE_ISNANF_IN_LIBC
 /* Get declaration of isnan macro or (older) isnanf function.  */
 # include <math.h>
-# if __GNUC__ >= 4
-   /* GCC 4.0 and newer provides three built-ins for isnan.  */
+# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+   /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
+      GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't.  */
 #  undef isnanf
-#  define isnanf(x) __builtin_isnanf ((float)(x))
+#  define isnanf(x) __builtin_isnan ((float)(x))
 # elif defined isnan
 #  undef isnanf
 #  define isnanf(x) isnan ((float)(x))
index d1e3fe9..a8f3879 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index efd9199..f9f5efd 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if HAVE_ISNANL_IN_LIBC
 /* Get declaration of isnan macro or (older) isnanl function.  */
 # include <math.h>
-# if __GNUC__ >= 4
-   /* GCC 4.0 and newer provides three built-ins for isnan.  */
+# if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+   /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
+      GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't.  */
 #  undef isnanl
-#  define isnanl(x) __builtin_isnanl ((long double)(x))
+#  define isnanl(x) __builtin_isnan ((long double)(x))
 # elif defined isnan
 #  undef isnanl
 #  define isnanl(x) isnan ((long double)(x))
index 67d39d1..5dc9cb7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for NaN that does not need libm.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
diff --git a/lib/iswblank.c b/lib/iswblank.c
new file mode 100644 (file)
index 0000000..01f21ce
--- /dev/null
@@ -0,0 +1,26 @@
+/* Test wide character for being blank.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <wctype.h>
+
+int
+iswblank (wint_t wc)
+{
+  return wc == ' ' || wc == '\t';
+}
diff --git a/lib/iswdigit.c b/lib/iswdigit.c
new file mode 100644 (file)
index 0000000..1b011ce
--- /dev/null
@@ -0,0 +1,26 @@
+/* Test wide character for being a digit.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <wctype.h>
+
+int
+iswdigit (wint_t wc)
+{
+  return wc >= '0' && wc <= '9';
+}
diff --git a/lib/iswxdigit.c b/lib/iswxdigit.c
new file mode 100644 (file)
index 0000000..1ae925f
--- /dev/null
@@ -0,0 +1,33 @@
+/* Test wide character for being a hexadecimal digit.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <wctype.h>
+
+int
+iswxdigit (wint_t wc)
+{
+  return ((wc >= '0' && wc <= '9')
+#if 'A' == 0x41 && 'a' == 0x61
+          /* Optimization, assuming ASCII */
+          || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')
+#else
+          || (wc >= 'A' && wc <= 'F') || (wc >= 'a' && wc <= 'f')
+#endif
+         );
+}
index 5533392..9a6682d 100644 (file)
@@ -1,5 +1,5 @@
 /* Replacement for 'int' to 'long double' conversion routine.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index e11617c..52d5b29 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <langinfo.h>.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /*
  * POSIX <langinfo.h> for platforms that lack it or have an incomplete one.
- * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/langinfo.h.html>
  */
 
 #ifndef _@GUARD_PREFIX@_LANGINFO_H
@@ -86,6 +86,18 @@ typedef int nl_item;
 # define MON_10      (MON_1 + 9)
 # define MON_11      (MON_1 + 10)
 # define MON_12      (MON_1 + 11)
+# define ALTMON_1    10200
+# define ALTMON_2    (ALTMON_1 + 1)
+# define ALTMON_3    (ALTMON_1 + 2)
+# define ALTMON_4    (ALTMON_1 + 3)
+# define ALTMON_5    (ALTMON_1 + 4)
+# define ALTMON_6    (ALTMON_1 + 5)
+# define ALTMON_7    (ALTMON_1 + 6)
+# define ALTMON_8    (ALTMON_1 + 7)
+# define ALTMON_9    (ALTMON_1 + 8)
+# define ALTMON_10   (ALTMON_1 + 9)
+# define ALTMON_11   (ALTMON_1 + 10)
+# define ALTMON_12   (ALTMON_1 + 11)
 # define ABMON_1     10035
 # define ABMON_2     (ABMON_1 + 1)
 # define ABMON_3     (ABMON_1 + 2)
@@ -138,6 +150,22 @@ typedef int nl_item;
 #  define GNULIB_defined_T_FMT_AMPM 1
 # endif
 
+# if !@HAVE_LANGINFO_ALTMON@
+#  define ALTMON_1    10200
+#  define ALTMON_2    (ALTMON_1 + 1)
+#  define ALTMON_3    (ALTMON_1 + 2)
+#  define ALTMON_4    (ALTMON_1 + 3)
+#  define ALTMON_5    (ALTMON_1 + 4)
+#  define ALTMON_6    (ALTMON_1 + 5)
+#  define ALTMON_7    (ALTMON_1 + 6)
+#  define ALTMON_8    (ALTMON_1 + 7)
+#  define ALTMON_9    (ALTMON_1 + 8)
+#  define ALTMON_10   (ALTMON_1 + 9)
+#  define ALTMON_11   (ALTMON_1 + 10)
+#  define ALTMON_12   (ALTMON_1 + 11)
+#  define GNULIB_defined_ALTMON 1
+# endif
+
 # if !@HAVE_LANGINFO_ERA@
 #  define ERA         10047
 #  define ERA_D_FMT   10048
diff --git a/lib/lc-charset-dispatch.c b/lib/lc-charset-dispatch.c
new file mode 100644 (file)
index 0000000..5c63c4b
--- /dev/null
@@ -0,0 +1,82 @@
+/* Dispatching based on the current locale's character encoding.
+   Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2018.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "lc-charset-dispatch.h"
+
+#if GNULIB_defined_mbstate_t
+
+# include "localcharset.h"
+# include "streq.h"
+
+# if GNULIB_WCHAR_SINGLE_LOCALE
+/* When we know that the locale does not change, provide a speedup by
+   caching the value of locale_encoding_classification.  */
+#  define locale_encoding_classification_cached locale_encoding_classification
+# else
+/* By default, don't make assumptions, hence no caching.  */
+#  define locale_encoding_classification_uncached locale_encoding_classification
+# endif
+
+# if GNULIB_WCHAR_SINGLE_LOCALE
+static inline
+# endif
+enc_t
+locale_encoding_classification_uncached (void)
+{
+  const char *encoding = locale_charset ();
+  if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
+    return enc_utf8;
+  if (STREQ_OPT (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
+    return enc_eucjp;
+  if (STREQ_OPT (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+      || STREQ_OPT (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
+      || STREQ_OPT (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
+    return enc_94;
+  if (STREQ_OPT (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
+    return enc_euctw;
+  if (STREQ_OPT (encoding, "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
+    return enc_gb18030;
+  if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
+    return enc_sjis;
+  return enc_other;
+}
+
+# if GNULIB_WCHAR_SINGLE_LOCALE
+
+static int cached_locale_enc = -1;
+
+enc_t
+locale_encoding_classification_cached (void)
+{
+  if (cached_locale_enc < 0)
+    cached_locale_enc = locale_encoding_classification_uncached ();
+  return cached_locale_enc;
+}
+
+# endif
+
+#else
+
+/* This declaration is solely to ensure that after preprocessing
+   this file is never empty.  */
+typedef int dummy;
+
+#endif
diff --git a/lib/lc-charset-dispatch.h b/lib/lc-charset-dispatch.h
new file mode 100644 (file)
index 0000000..9c308fe
--- /dev/null
@@ -0,0 +1,40 @@
+/* Dispatching based on the current locale's character encoding.
+   Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2018.  */
+
+#include <wchar.h>
+
+#if GNULIB_defined_mbstate_t
+
+/* A classification of special values of the encoding of the current locale.  */
+typedef enum
+  {
+    enc_other,      /* other */
+    enc_utf8,       /* UTF-8 */
+    enc_eucjp,      /* EUC-JP */
+    enc_94,         /* EUC-KR, GB2312, BIG5 */
+    enc_euctw,      /* EUC-TW */
+    enc_gb18030,    /* GB18030 */
+    enc_sjis        /* SJIS */
+  }
+  enc_t;
+
+/* Returns a classification of special values of the encoding of the current
+   locale.  */
+extern enc_t locale_encoding_classification (void);
+
+#endif
diff --git a/lib/libc-config.h b/lib/libc-config.h
new file mode 100644 (file)
index 0000000..23d1790
--- /dev/null
@@ -0,0 +1,185 @@
+/* System definitions for code taken from the GNU C Library
+
+   Copyright 2017-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with this program; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+/* This is intended to be a good-enough substitute for glibc system
+   macros like those defined in <sys/cdefs.h>, so that Gnulib code
+   shared with glibc can do this as the first #include:
+
+     #ifndef _LIBC
+     # include <libc-config.h>
+     #endif
+
+   When compiled as part of glibc this is a no-op; when compiled as
+   part of Gnulib this includes Gnulib's <config.h> and defines macros
+   that glibc library code would normally assume.  */
+
+#include <config.h>
+
+/* On glibc this includes <features.h> and <sys/cdefs.h> and #defines
+   _FEATURES_H, __WORDSIZE, and __set_errno.  On FreeBSD 11 and
+   DragonFlyBSD 5.9 it includes <sys/cdefs.h> which defines __nonnull.
+   Elsewhere it is harmless.  */
+#include <errno.h>
+
+/* From glibc <errno.h>.  */
+#ifndef __set_errno
+# define __set_errno(val) (errno = (val))
+#endif
+
+/* From glibc <features.h>.  */
+
+#ifndef __GNUC_PREREQ
+# if defined __GNUC__ && defined __GNUC_MINOR__
+#  define __GNUC_PREREQ(maj, min) ((maj) < __GNUC__ + ((min) <= __GNUC_MINOR__))
+# else
+#  define __GNUC_PREREQ(maj, min) 0
+# endif
+#endif
+
+#ifndef __glibc_clang_prereq
+# if defined __clang_major__ && defined __clang_minor__
+#  ifdef __apple_build_version__
+/* Apple for some reason renumbers __clang_major__ and __clang_minor__.
+   Gnulib code uses only __glibc_clang_prereq (3, 5); map it to
+   6000000 <= __apple_build_version__.  Support for other calls to
+   __glibc_clang_prereq can be added here as needed.  */
+#   define __glibc_clang_prereq(maj, min) \
+      ((maj) == 3 && (min) == 5 ? 6000000 <= __apple_build_version__ : 0)
+#  else
+#   define __glibc_clang_prereq(maj, min) \
+      ((maj) < __clang_major__ + ((min) <= __clang_minor__))
+#  endif
+# else
+#  define __glibc_clang_prereq(maj, min) 0
+# endif
+#endif
+
+#ifndef __attribute_nonnull__
+/* <sys/cdefs.h> either does not exist, or is too old for Gnulib.
+   Prepare to include <cdefs.h>, which is Gnulib's version of a
+   more-recent glibc <sys/cdefs.h>.  */
+
+/* Define _FEATURES_H so that <cdefs.h> does not include <features.h>.  */
+# ifndef _FEATURES_H
+#  define _FEATURES_H 1
+# endif
+/* Define __GNULIB_CDEFS so that <cdefs.h> does not attempt to include
+   nonexistent files.  */
+# define __GNULIB_CDEFS
+/* Undef the macros unconditionally defined by our copy of glibc
+   <sys/cdefs.h>, so that they do not clash with any system-defined
+   versions.  */
+# undef _SYS_CDEFS_H
+# undef __ASMNAME
+# undef __ASMNAME2
+# undef __BEGIN_DECLS
+# undef __CONCAT
+# undef __END_DECLS
+# undef __HAVE_GENERIC_SELECTION
+# undef __LDBL_COMPAT
+# undef __LDBL_REDIR
+# undef __LDBL_REDIR1
+# undef __LDBL_REDIR1_DECL
+# undef __LDBL_REDIR1_NTH
+# undef __LDBL_REDIR2_DECL
+# undef __LDBL_REDIR_DECL
+# undef __LDBL_REDIR_NTH
+# undef __LEAF
+# undef __LEAF_ATTR
+# undef __NTH
+# undef __NTHNL
+# undef __REDIRECT
+# undef __REDIRECT_LDBL
+# undef __REDIRECT_NTH
+# undef __REDIRECT_NTHNL
+# undef __REDIRECT_NTH_LDBL
+# undef __STRING
+# undef __THROW
+# undef __THROWNL
+# undef __attr_access
+# undef __attribute__
+# undef __attribute_alloc_size__
+# undef __attribute_artificial__
+# undef __attribute_const__
+# undef __attribute_deprecated__
+# undef __attribute_deprecated_msg__
+# undef __attribute_format_arg__
+# undef __attribute_format_strfmon__
+# undef __attribute_malloc__
+# undef __attribute_noinline__
+# undef __attribute_nonstring__
+# undef __attribute_pure__
+# undef __attribute_returns_twice__
+# undef __attribute_used__
+# undef __attribute_warn_unused_result__
+# undef __bos
+# undef __bos0
+# undef __errordecl
+# undef __extension__
+# undef __extern_always_inline
+# undef __extern_inline
+# undef __flexarr
+# undef __fortify_function
+# undef __glibc_c99_flexarr_available
+# undef __glibc_has_attribute
+# undef __glibc_has_builtin
+# undef __glibc_has_extension
+# undef __glibc_macro_warning
+# undef __glibc_macro_warning1
+# undef __glibc_objsize
+# undef __glibc_objsize0
+# undef __glibc_unlikely
+# undef __inline
+# undef __ptr_t
+# undef __restrict
+# undef __restrict_arr
+# undef __va_arg_pack
+# undef __va_arg_pack_len
+# undef __warnattr
+
+/* Include our copy of glibc <sys/cdefs.h>.  */
+# include <cdefs.h>
+
+/* <cdefs.h> __inline is too pessimistic for non-GCC.  */
+# undef __inline
+# ifndef HAVE___INLINE
+#  if 199901 <= __STDC_VERSION__ || defined inline
+#   define __inline inline
+#  else
+#   define __inline
+#  endif
+# endif
+
+#endif /* defined __glibc_likely */
+
+
+/* A substitute for glibc <libc-symbols.h>, good enough for Gnulib.  */
+#define attribute_hidden
+#define libc_hidden_proto(name)
+#define libc_hidden_def(name)
+#define libc_hidden_weak(name)
+#define libc_hidden_ver(local, name)
+#define strong_alias(name, aliasname)
+#define weak_alias(name, aliasname)
+
+/* A substitute for glibc <shlib-compat.h>, good enough for Gnulib.  */
+#define SHLIB_COMPAT(lib, introduced, obsoleted) 0
+#define compat_symbol(lib, local, symbol, version) extern int dummy
+#define versioned_symbol(lib, local, symbol, version) extern int dummy
index a1eae02..076ab9e 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <limits.h>.
 
-   Copyright 2016 Free Software Foundation, Inc.
+   Copyright 2016-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef _@GUARD_PREFIX@_LIMITS_H
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 @PRAGMA_COLUMNS@
 
-/* The include_next requires a split double-inclusion guard.  */
+#if defined _GL_ALREADY_INCLUDING_LIMITS_H
+/* Special invocation convention:
+   On Haiku/x86_64, we have a sequence of nested includes
+   <limits.h> -> <syslimits.h> -> <limits.h>.
+   In this situation, LONG_MAX and INT_MAX are not yet defined,
+   therefore we should not attempt to define LONG_BIT.  */
+
 #@INCLUDE_NEXT@ @NEXT_LIMITS_H@
 
+#else
+/* Normal invocation convention.  */
+
+#ifndef _@GUARD_PREFIX@_LIMITS_H
+
+# define _GL_ALREADY_INCLUDING_LIMITS_H
+
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_LIMITS_H@
+
+# undef _GL_ALREADY_INCLUDING_LIMITS_H
+
 #ifndef _@GUARD_PREFIX@_LIMITS_H
 #define _@GUARD_PREFIX@_LIMITS_H
 
+#ifndef LLONG_MIN
+# if defined LONG_LONG_MIN /* HP-UX 11.31 */
+#  define LLONG_MIN LONG_LONG_MIN
+# elif defined LONGLONG_MIN /* IRIX 6.5 */
+#  define LLONG_MIN LONGLONG_MIN
+# elif defined __GNUC__
+#  define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL)
+# endif
+#endif
+#ifndef LLONG_MAX
+# if defined LONG_LONG_MAX /* HP-UX 11.31 */
+#  define LLONG_MAX LONG_LONG_MAX
+# elif defined LONGLONG_MAX /* IRIX 6.5 */
+#  define LLONG_MAX LONGLONG_MAX
+# elif defined __GNUC__
+#  define LLONG_MAX __LONG_LONG_MAX__
+# endif
+#endif
+#ifndef ULLONG_MAX
+# if defined ULONG_LONG_MAX /* HP-UX 11.31 */
+#  define ULLONG_MAX ULONG_LONG_MAX
+# elif defined ULONGLONG_MAX /* IRIX 6.5 */
+#  define ULLONG_MAX ULONGLONG_MAX
+# elif defined __GNUC__
+#  define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL)
+# endif
+#endif
+
 /* The number of usable bits in an unsigned or signed integer type
    with minimum value MIN and maximum value MAX, as an int expression
    suitable in #if.  Cover all known practical hosts.  This
 #define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
 #define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))
 
+#ifndef WORD_BIT
+/* Assume 'int' is 32 bits wide.  */
+# define WORD_BIT 32
+#endif
+#ifndef LONG_BIT
+/* Assume 'long' is 32 or 64 bits wide.  */
+# if LONG_MAX == INT_MAX
+#  define LONG_BIT 32
+# else
+#  define LONG_BIT 64
+# endif
+#endif
+
 /* Macros specified by ISO/IEC TS 18661-1:2014.  */
 
 #if (! defined ULLONG_WIDTH                                             \
 
 #endif /* _@GUARD_PREFIX@_LIMITS_H */
 #endif /* _@GUARD_PREFIX@_LIMITS_H */
+#endif
index fa5fcbc..cba0e2b 100644 (file)
@@ -1,6 +1,6 @@
 /* Determine a canonical name for the current locale's character encoding.
 
-   Copyright (C) 2000-2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>.  */
 
@@ -22,7 +22,6 @@
 /* Specification.  */
 #include "localcharset.h"
 
-#include <fcntl.h>
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
@@ -32,7 +31,7 @@
 # define DARWIN7 /* Darwin 7 or newer, i.e. Mac OS X 10.3 or newer */
 #endif
 
-#if defined _WIN32 || defined __WIN32__
+#if defined _WIN32 && !defined __CYGWIN__
 # define WINDOWS_NATIVE
 # include <locale.h>
 #endif
 #endif
 
 #if !defined WINDOWS_NATIVE
-# include <unistd.h>
 # if HAVE_LANGINFO_CODESET
 #  include <langinfo.h>
 # else
-#  if 0 /* see comment below */
+#  if 0 /* see comment regarding use of setlocale(), below */
 #   include <locale.h>
 #  endif
 # endif
@@ -60,6 +58,9 @@
 #elif defined WINDOWS_NATIVE
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
+  /* For the use of setlocale() below, the Gnulib override in setlocale.c is
+     not needed; see the platform lists in setlocale_null.m4.  */
+# undef setlocale
 #endif
 #if defined OS2
 # define INCL_DOS
 # include <xlocale.h>
 #endif
 
-#if ENABLE_RELOCATABLE
-# include "relocatable.h"
-#else
-# define relocate(pathname) (pathname)
-#endif
 
-/* Get LIBDIR.  */
-#ifndef LIBDIR
-# include "configmake.h"
-#endif
+#if HAVE_LANGINFO_CODESET || defined WINDOWS_NATIVE || defined OS2
 
-/* Define O_NOFOLLOW to 0 on platforms where it does not exist.  */
-#ifndef O_NOFOLLOW
-# define O_NOFOLLOW 0
-#endif
+/* On these platforms, we use a mapping from non-canonical encoding name
+   to GNU canonical encoding name.  */
 
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
-  /* Native Windows, Cygwin, OS/2, DOS */
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-#endif
-
-#ifndef DIRECTORY_SEPARATOR
-# define DIRECTORY_SEPARATOR '/'
-#endif
-
-#ifndef ISSLASH
-# define ISSLASH(C) ((C) == DIRECTORY_SEPARATOR)
-#endif
+/* With glibc-2.1 or newer, we don't need any canonicalization,
+   because glibc has iconv and both glibc and libiconv support all
+   GNU canonical names directly.  */
+# if !((defined __GNU_LIBRARY__ && __GLIBC__ >= 2) || defined __UCLIBC__)
 
-#if HAVE_DECL_GETC_UNLOCKED
-# undef getc
-# define getc getc_unlocked
-#endif
-
-/* The following static variable is declared 'volatile' to avoid a
-   possible multithread problem in the function get_charset_aliases. If we
-   are running in a threaded environment, and if two threads initialize
-   'charset_aliases' simultaneously, both will produce the same value,
-   and everything will be ok if the two assignments to 'charset_aliases'
-   are atomic. But I don't know what will happen if the two assignments mix.  */
-#if __STDC__ != 1
-# define volatile /* empty */
-#endif
-/* Pointer to the contents of the charset.alias file, if it has already been
-   read, else NULL.  Its format is:
-   ALIAS_1 '\0' CANONICAL_1 '\0' ... ALIAS_n '\0' CANONICAL_n '\0' '\0'  */
-static const char * volatile charset_aliases;
-
-/* Return a pointer to the contents of the charset.alias file.  */
-static const char *
-get_charset_aliases (void)
+struct table_entry
 {
-  const char *cp;
-
-  cp = charset_aliases;
-  if (cp == NULL)
-    {
-#if !(defined DARWIN7 || defined VMS || defined WINDOWS_NATIVE || defined __CYGWIN__ || defined OS2)
-      const char *dir;
-      const char *base = "charset.alias";
-      char *file_name;
-
-      /* Make it possible to override the charset.alias location.  This is
-         necessary for running the testsuite before "make install".  */
-      dir = getenv ("CHARSETALIASDIR");
-      if (dir == NULL || dir[0] == '\0')
-        dir = relocate (LIBDIR);
-
-      /* Concatenate dir and base into freshly allocated file_name.  */
-      {
-        size_t dir_len = strlen (dir);
-        size_t base_len = strlen (base);
-        int add_slash = (dir_len > 0 && !ISSLASH (dir[dir_len - 1]));
-        file_name = (char *) malloc (dir_len + add_slash + base_len + 1);
-        if (file_name != NULL)
-          {
-            memcpy (file_name, dir, dir_len);
-            if (add_slash)
-              file_name[dir_len] = DIRECTORY_SEPARATOR;
-            memcpy (file_name + dir_len + add_slash, base, base_len + 1);
-          }
-      }
-
-      if (file_name == NULL)
-        /* Out of memory.  Treat the file as empty.  */
-        cp = "";
-      else
-        {
-          int fd;
-
-          /* Open the file.  Reject symbolic links on platforms that support
-             O_NOFOLLOW.  This is a security feature.  Without it, an attacker
-             could retrieve parts of the contents (namely, the tail of the
-             first line that starts with "* ") of an arbitrary file by placing
-             a symbolic link to that file under the name "charset.alias" in
-             some writable directory and defining the environment variable
-             CHARSETALIASDIR to point to that directory.  */
-          fd = open (file_name,
-                     O_RDONLY | (HAVE_WORKING_O_NOFOLLOW ? O_NOFOLLOW : 0));
-          if (fd < 0)
-            /* File not found.  Treat it as empty.  */
-            cp = "";
-          else
-            {
-              FILE *fp;
-
-              fp = fdopen (fd, "r");
-              if (fp == NULL)
-                {
-                  /* Out of memory.  Treat the file as empty.  */
-                  close (fd);
-                  cp = "";
-                }
-              else
-                {
-                  /* Parse the file's contents.  */
-                  char *res_ptr = NULL;
-                  size_t res_size = 0;
-
-                  for (;;)
-                    {
-                      int c;
-                      char buf1[50+1];
-                      char buf2[50+1];
-                      size_t l1, l2;
-                      char *old_res_ptr;
-
-                      c = getc (fp);
-                      if (c == EOF)
-                        break;
-                      if (c == '\n' || c == ' ' || c == '\t')
-                        continue;
-                      if (c == '#')
-                        {
-                          /* Skip comment, to end of line.  */
-                          do
-                            c = getc (fp);
-                          while (!(c == EOF || c == '\n'));
-                          if (c == EOF)
-                            break;
-                          continue;
-                        }
-                      ungetc (c, fp);
-                      if (fscanf (fp, "%50s %50s", buf1, buf2) < 2)
-                        break;
-                      l1 = strlen (buf1);
-                      l2 = strlen (buf2);
-                      old_res_ptr = res_ptr;
-                      if (res_size == 0)
-                        {
-                          res_size = l1 + 1 + l2 + 1;
-                          res_ptr = (char *) malloc (res_size + 1);
-                        }
-                      else
-                        {
-                          res_size += l1 + 1 + l2 + 1;
-                          res_ptr = (char *) realloc (res_ptr, res_size + 1);
-                        }
-                      if (res_ptr == NULL)
-                        {
-                          /* Out of memory. */
-                          res_size = 0;
-                          free (old_res_ptr);
-                          break;
-                        }
-                      strcpy (res_ptr + res_size - (l2 + 1) - (l1 + 1), buf1);
-                      strcpy (res_ptr + res_size - (l2 + 1), buf2);
-                    }
-                  fclose (fp);
-                  if (res_size == 0)
-                    cp = "";
-                  else
-                    {
-                      *(res_ptr + res_size) = '\0';
-                      cp = res_ptr;
-                    }
-                }
-            }
+  const char alias[11+1];
+  const char canonical[11+1];
+};
+
+/* Table of platform-dependent mappings, sorted in ascending order.  */
+static const struct table_entry alias_table[] =
+  {
+#  if defined __FreeBSD__                                   /* FreeBSD */
+  /*{ "ARMSCII-8",  "ARMSCII-8" },*/
+    { "Big5",       "BIG5" },
+    { "C",          "ASCII" },
+  /*{ "CP1131",     "CP1131" },*/
+  /*{ "CP1251",     "CP1251" },*/
+  /*{ "CP866",      "CP866" },*/
+  /*{ "GB18030",    "GB18030" },*/
+  /*{ "GB2312",     "GB2312" },*/
+  /*{ "GBK",        "GBK" },*/
+  /*{ "ISCII-DEV",  "?" },*/
+    { "ISO8859-1",  "ISO-8859-1" },
+    { "ISO8859-13", "ISO-8859-13" },
+    { "ISO8859-15", "ISO-8859-15" },
+    { "ISO8859-2",  "ISO-8859-2" },
+    { "ISO8859-5",  "ISO-8859-5" },
+    { "ISO8859-7",  "ISO-8859-7" },
+    { "ISO8859-9",  "ISO-8859-9" },
+  /*{ "KOI8-R",     "KOI8-R" },*/
+  /*{ "KOI8-U",     "KOI8-U" },*/
+    { "SJIS",       "SHIFT_JIS" },
+    { "US-ASCII",   "ASCII" },
+    { "eucCN",      "GB2312" },
+    { "eucJP",      "EUC-JP" },
+    { "eucKR",      "EUC-KR" }
+#   define alias_table_defined
+#  endif
+#  if defined __NetBSD__                                    /* NetBSD */
+    { "646",        "ASCII" },
+  /*{ "ARMSCII-8",  "ARMSCII-8" },*/
+  /*{ "BIG5",       "BIG5" },*/
+    { "Big5-HKSCS", "BIG5-HKSCS" },
+  /*{ "CP1251",     "CP1251" },*/
+  /*{ "CP866",      "CP866" },*/
+  /*{ "GB18030",    "GB18030" },*/
+  /*{ "GB2312",     "GB2312" },*/
+    { "ISO8859-1",  "ISO-8859-1" },
+    { "ISO8859-13", "ISO-8859-13" },
+    { "ISO8859-15", "ISO-8859-15" },
+    { "ISO8859-2",  "ISO-8859-2" },
+    { "ISO8859-4",  "ISO-8859-4" },
+    { "ISO8859-5",  "ISO-8859-5" },
+    { "ISO8859-7",  "ISO-8859-7" },
+  /*{ "KOI8-R",     "KOI8-R" },*/
+  /*{ "KOI8-U",     "KOI8-U" },*/
+  /*{ "PT154",      "PT154" },*/
+    { "SJIS",       "SHIFT_JIS" },
+    { "eucCN",      "GB2312" },
+    { "eucJP",      "EUC-JP" },
+    { "eucKR",      "EUC-KR" },
+    { "eucTW",      "EUC-TW" }
+#   define alias_table_defined
+#  endif
+#  if defined __OpenBSD__                                   /* OpenBSD */
+    { "646",        "ASCII" },
+    { "ISO8859-1",  "ISO-8859-1" },
+    { "ISO8859-13", "ISO-8859-13" },
+    { "ISO8859-15", "ISO-8859-15" },
+    { "ISO8859-2",  "ISO-8859-2" },
+    { "ISO8859-4",  "ISO-8859-4" },
+    { "ISO8859-5",  "ISO-8859-5" },
+    { "ISO8859-7",  "ISO-8859-7" },
+    { "US-ASCII",   "ASCII" }
+#   define alias_table_defined
+#  endif
+#  if defined __APPLE__ && defined __MACH__                 /* Mac OS X */
+    /* Darwin 7.5 has nl_langinfo(CODESET), but sometimes its value is
+       useless:
+       - It returns the empty string when LANG is set to a locale of the
+         form ll_CC, although ll_CC/LC_CTYPE is a symlink to an UTF-8
+         LC_CTYPE file.
+       - The environment variables LANG, LC_CTYPE, LC_ALL are not set by
+         the system; nl_langinfo(CODESET) returns "US-ASCII" in this case.
+       - The documentation says:
+           "... all code that calls BSD system routines should ensure
+            that the const *char parameters of these routines are in UTF-8
+            encoding. All BSD system functions expect their string
+            parameters to be in UTF-8 encoding and nothing else."
+         It also says
+           "An additional caveat is that string parameters for files,
+            paths, and other file-system entities must be in canonical
+            UTF-8. In a canonical UTF-8 Unicode string, all decomposable
+            characters are decomposed ..."
+         but this is not true: You can pass non-decomposed UTF-8 strings
+         to file system functions, and it is the OS which will convert
+         them to decomposed UTF-8 before accessing the file system.
+       - The Apple Terminal application displays UTF-8 by default.
+       - However, other applications are free to use different encodings:
+         - xterm uses ISO-8859-1 by default.
+         - TextEdit uses MacRoman by default.
+       We prefer UTF-8 over decomposed UTF-8-MAC because one should
+       minimize the use of decomposed Unicode. Unfortunately, through the
+       Darwin file system, decomposed UTF-8 strings are leaked into user
+       space nevertheless.
+       Then there are also the locales with encodings other than US-ASCII
+       and UTF-8. These locales can be occasionally useful to users (e.g.
+       when grepping through ISO-8859-1 encoded text files), when all their
+       file names are in US-ASCII.
+     */
+    { "ARMSCII-8",  "ARMSCII-8" },
+    { "Big5",       "BIG5" },
+    { "Big5HKSCS",  "BIG5-HKSCS" },
+    { "CP1131",     "CP1131" },
+    { "CP1251",     "CP1251" },
+    { "CP866",      "CP866" },
+    { "CP949",      "CP949" },
+    { "GB18030",    "GB18030" },
+    { "GB2312",     "GB2312" },
+    { "GBK",        "GBK" },
+  /*{ "ISCII-DEV",  "?" },*/
+    { "ISO8859-1",  "ISO-8859-1" },
+    { "ISO8859-13", "ISO-8859-13" },
+    { "ISO8859-15", "ISO-8859-15" },
+    { "ISO8859-2",  "ISO-8859-2" },
+    { "ISO8859-4",  "ISO-8859-4" },
+    { "ISO8859-5",  "ISO-8859-5" },
+    { "ISO8859-7",  "ISO-8859-7" },
+    { "ISO8859-9",  "ISO-8859-9" },
+    { "KOI8-R",     "KOI8-R" },
+    { "KOI8-U",     "KOI8-U" },
+    { "PT154",      "PT154" },
+    { "SJIS",       "SHIFT_JIS" },
+    { "eucCN",      "GB2312" },
+    { "eucJP",      "EUC-JP" },
+    { "eucKR",      "EUC-KR" }
+#   define alias_table_defined
+#  endif
+#  if defined _AIX                                          /* AIX */
+  /*{ "GBK",        "GBK" },*/
+    { "IBM-1046",   "CP1046" },
+    { "IBM-1124",   "CP1124" },
+    { "IBM-1129",   "CP1129" },
+    { "IBM-1252",   "CP1252" },
+    { "IBM-850",    "CP850" },
+    { "IBM-856",    "CP856" },
+    { "IBM-921",    "ISO-8859-13" },
+    { "IBM-922",    "CP922" },
+    { "IBM-932",    "CP932" },
+    { "IBM-943",    "CP943" },
+    { "IBM-eucCN",  "GB2312" },
+    { "IBM-eucJP",  "EUC-JP" },
+    { "IBM-eucKR",  "EUC-KR" },
+    { "IBM-eucTW",  "EUC-TW" },
+    { "ISO8859-1",  "ISO-8859-1" },
+    { "ISO8859-15", "ISO-8859-15" },
+    { "ISO8859-2",  "ISO-8859-2" },
+    { "ISO8859-5",  "ISO-8859-5" },
+    { "ISO8859-6",  "ISO-8859-6" },
+    { "ISO8859-7",  "ISO-8859-7" },
+    { "ISO8859-8",  "ISO-8859-8" },
+    { "ISO8859-9",  "ISO-8859-9" },
+    { "TIS-620",    "TIS-620" },
+  /*{ "UTF-8",      "UTF-8" },*/
+    { "big5",       "BIG5" }
+#   define alias_table_defined
+#  endif
+#  if defined __hpux                                        /* HP-UX */
+    { "SJIS",      "SHIFT_JIS" },
+    { "arabic8",   "HP-ARABIC8" },
+    { "big5",      "BIG5" },
+    { "cp1251",    "CP1251" },
+    { "eucJP",     "EUC-JP" },
+    { "eucKR",     "EUC-KR" },
+    { "eucTW",     "EUC-TW" },
+    { "gb18030",   "GB18030" },
+    { "greek8",    "HP-GREEK8" },
+    { "hebrew8",   "HP-HEBREW8" },
+    { "hkbig5",    "BIG5-HKSCS" },
+    { "hp15CN",    "GB2312" },
+    { "iso88591",  "ISO-8859-1" },
+    { "iso885913", "ISO-8859-13" },
+    { "iso885915", "ISO-8859-15" },
+    { "iso88592",  "ISO-8859-2" },
+    { "iso88594",  "ISO-8859-4" },
+    { "iso88595",  "ISO-8859-5" },
+    { "iso88596",  "ISO-8859-6" },
+    { "iso88597",  "ISO-8859-7" },
+    { "iso88598",  "ISO-8859-8" },
+    { "iso88599",  "ISO-8859-9" },
+    { "kana8",     "HP-KANA8" },
+    { "koi8r",     "KOI8-R" },
+    { "roman8",    "HP-ROMAN8" },
+    { "tis620",    "TIS-620" },
+    { "turkish8",  "HP-TURKISH8" },
+    { "utf8",      "UTF-8" }
+#   define alias_table_defined
+#  endif
+#  if defined __sgi                                         /* IRIX */
+    { "ISO8859-1",  "ISO-8859-1" },
+    { "ISO8859-15", "ISO-8859-15" },
+    { "ISO8859-2",  "ISO-8859-2" },
+    { "ISO8859-5",  "ISO-8859-5" },
+    { "ISO8859-7",  "ISO-8859-7" },
+    { "ISO8859-9",  "ISO-8859-9" },
+    { "eucCN",      "GB2312" },
+    { "eucJP",      "EUC-JP" },
+    { "eucKR",      "EUC-KR" },
+    { "eucTW",      "EUC-TW" }
+#   define alias_table_defined
+#  endif
+#  if defined __osf__                                       /* OSF/1 */
+  /*{ "GBK",        "GBK" },*/
+    { "ISO8859-1",  "ISO-8859-1" },
+    { "ISO8859-15", "ISO-8859-15" },
+    { "ISO8859-2",  "ISO-8859-2" },
+    { "ISO8859-4",  "ISO-8859-4" },
+    { "ISO8859-5",  "ISO-8859-5" },
+    { "ISO8859-7",  "ISO-8859-7" },
+    { "ISO8859-8",  "ISO-8859-8" },
+    { "ISO8859-9",  "ISO-8859-9" },
+    { "KSC5601",    "CP949" },
+    { "SJIS",       "SHIFT_JIS" },
+    { "TACTIS",     "TIS-620" },
+  /*{ "UTF-8",      "UTF-8" },*/
+    { "big5",       "BIG5" },
+    { "cp850",      "CP850" },
+    { "dechanyu",   "DEC-HANYU" },
+    { "dechanzi",   "GB2312" },
+    { "deckanji",   "DEC-KANJI" },
+    { "deckorean",  "EUC-KR" },
+    { "eucJP",      "EUC-JP" },
+    { "eucKR",      "EUC-KR" },
+    { "eucTW",      "EUC-TW" },
+    { "sdeckanji",  "EUC-JP" }
+#   define alias_table_defined
+#  endif
+#  if defined __sun                                         /* Solaris */
+    { "5601",        "EUC-KR" },
+    { "646",         "ASCII" },
+  /*{ "BIG5",        "BIG5" },*/
+    { "Big5-HKSCS",  "BIG5-HKSCS" },
+    { "GB18030",     "GB18030" },
+  /*{ "GBK",         "GBK" },*/
+    { "ISO8859-1",   "ISO-8859-1" },
+    { "ISO8859-11",  "TIS-620" },
+    { "ISO8859-13",  "ISO-8859-13" },
+    { "ISO8859-15",  "ISO-8859-15" },
+    { "ISO8859-2",   "ISO-8859-2" },
+    { "ISO8859-3",   "ISO-8859-3" },
+    { "ISO8859-4",   "ISO-8859-4" },
+    { "ISO8859-5",   "ISO-8859-5" },
+    { "ISO8859-6",   "ISO-8859-6" },
+    { "ISO8859-7",   "ISO-8859-7" },
+    { "ISO8859-8",   "ISO-8859-8" },
+    { "ISO8859-9",   "ISO-8859-9" },
+    { "PCK",         "SHIFT_JIS" },
+    { "TIS620.2533", "TIS-620" },
+  /*{ "UTF-8",       "UTF-8" },*/
+    { "ansi-1251",   "CP1251" },
+    { "cns11643",    "EUC-TW" },
+    { "eucJP",       "EUC-JP" },
+    { "gb2312",      "GB2312" },
+    { "koi8-r",      "KOI8-R" }
+#   define alias_table_defined
+#  endif
+#  if defined __minix                                       /* Minix */
+    { "646", "ASCII" }
+#   define alias_table_defined
+#  endif
+#  if defined WINDOWS_NATIVE || defined __CYGWIN__          /* Windows */
+    { "CP1361",  "JOHAB" },
+    { "CP20127", "ASCII" },
+    { "CP20866", "KOI8-R" },
+    { "CP20936", "GB2312" },
+    { "CP21866", "KOI8-RU" },
+    { "CP28591", "ISO-8859-1" },
+    { "CP28592", "ISO-8859-2" },
+    { "CP28593", "ISO-8859-3" },
+    { "CP28594", "ISO-8859-4" },
+    { "CP28595", "ISO-8859-5" },
+    { "CP28596", "ISO-8859-6" },
+    { "CP28597", "ISO-8859-7" },
+    { "CP28598", "ISO-8859-8" },
+    { "CP28599", "ISO-8859-9" },
+    { "CP28605", "ISO-8859-15" },
+    { "CP38598", "ISO-8859-8" },
+    { "CP51932", "EUC-JP" },
+    { "CP51936", "GB2312" },
+    { "CP51949", "EUC-KR" },
+    { "CP51950", "EUC-TW" },
+    { "CP54936", "GB18030" },
+    { "CP65001", "UTF-8" },
+    { "CP936",   "GBK" }
+#   define alias_table_defined
+#  endif
+#  if defined OS2                                           /* OS/2 */
+    /* The list of encodings is taken from "List of OS/2 Codepages"
+       by Alex Taylor:
+       <http://altsan.org/os2/toolkits/uls/index.html#codepages>.
+       See also "__convcp() of kLIBC":
+       <https://github.com/bitwiseworks/libc/blob/master/src/emx/src/lib/locale/__convcp.c>.  */
+    { "CP1004",        "CP1252" },
+  /*{ "CP1041",        "CP943" },*/
+  /*{ "CP1088",        "CP949" },*/
+    { "CP1089",        "ISO-8859-6" },
+  /*{ "CP1114",        "CP950" },*/
+  /*{ "CP1115",        "GB2312" },*/
+    { "CP1208",        "UTF-8" },
+  /*{ "CP1380",        "GB2312" },*/
+    { "CP1381",        "GB2312" },
+    { "CP1383",        "GB2312" },
+    { "CP1386",        "GBK" },
+  /*{ "CP301",         "CP943" },*/
+    { "CP3372",        "EUC-JP" },
+    { "CP4946",        "CP850" },
+  /*{ "CP5048",        "JIS_X0208-1990" },*/
+  /*{ "CP5049",        "JIS_X0212-1990" },*/
+  /*{ "CP5067",        "KS_C_5601-1987" },*/
+    { "CP813",         "ISO-8859-7" },
+    { "CP819",         "ISO-8859-1" },
+    { "CP878",         "KOI8-R" },
+  /*{ "CP897",         "CP943" },*/
+    { "CP912",         "ISO-8859-2" },
+    { "CP913",         "ISO-8859-3" },
+    { "CP914",         "ISO-8859-4" },
+    { "CP915",         "ISO-8859-5" },
+    { "CP916",         "ISO-8859-8" },
+    { "CP920",         "ISO-8859-9" },
+    { "CP921",         "ISO-8859-13" },
+    { "CP923",         "ISO-8859-15" },
+  /*{ "CP941",         "CP943" },*/
+  /*{ "CP947",         "CP950" },*/
+  /*{ "CP951",         "CP949" },*/
+  /*{ "CP952",         "JIS_X0208-1990" },*/
+  /*{ "CP953",         "JIS_X0212-1990" },*/
+    { "CP954",         "EUC-JP" },
+    { "CP964",         "EUC-TW" },
+    { "CP970",         "EUC-KR" },
+  /*{ "CP971",         "KS_C_5601-1987" },*/
+    { "IBM-1004",      "CP1252" },
+  /*{ "IBM-1006",      "?" },*/
+  /*{ "IBM-1008",      "?" },*/
+  /*{ "IBM-1041",      "CP943" },*/
+  /*{ "IBM-1051",      "?" },*/
+  /*{ "IBM-1088",      "CP949" },*/
+    { "IBM-1089",      "ISO-8859-6" },
+  /*{ "IBM-1098",      "?" },*/
+  /*{ "IBM-1114",      "CP950" },*/
+  /*{ "IBM-1115",      "GB2312" },*/
+  /*{ "IBM-1116",      "?" },*/
+  /*{ "IBM-1117",      "?" },*/
+  /*{ "IBM-1118",      "?" },*/
+  /*{ "IBM-1119",      "?" },*/
+    { "IBM-1124",      "CP1124" },
+    { "IBM-1125",      "CP1125" },
+    { "IBM-1131",      "CP1131" },
+    { "IBM-1208",      "UTF-8" },
+    { "IBM-1250",      "CP1250" },
+    { "IBM-1251",      "CP1251" },
+    { "IBM-1252",      "CP1252" },
+    { "IBM-1253",      "CP1253" },
+    { "IBM-1254",      "CP1254" },
+    { "IBM-1255",      "CP1255" },
+    { "IBM-1256",      "CP1256" },
+    { "IBM-1257",      "CP1257" },
+  /*{ "IBM-1275",      "?" },*/
+  /*{ "IBM-1276",      "?" },*/
+  /*{ "IBM-1277",      "?" },*/
+  /*{ "IBM-1280",      "?" },*/
+  /*{ "IBM-1281",      "?" },*/
+  /*{ "IBM-1282",      "?" },*/
+  /*{ "IBM-1283",      "?" },*/
+  /*{ "IBM-1380",      "GB2312" },*/
+    { "IBM-1381",      "GB2312" },
+    { "IBM-1383",      "GB2312" },
+    { "IBM-1386",      "GBK" },
+  /*{ "IBM-301",       "CP943" },*/
+    { "IBM-3372",      "EUC-JP" },
+    { "IBM-367",       "ASCII" },
+    { "IBM-437",       "CP437" },
+    { "IBM-4946",      "CP850" },
+  /*{ "IBM-5048",      "JIS_X0208-1990" },*/
+  /*{ "IBM-5049",      "JIS_X0212-1990" },*/
+  /*{ "IBM-5067",      "KS_C_5601-1987" },*/
+    { "IBM-813",       "ISO-8859-7" },
+    { "IBM-819",       "ISO-8859-1" },
+    { "IBM-850",       "CP850" },
+  /*{ "IBM-851",       "?" },*/
+    { "IBM-852",       "CP852" },
+    { "IBM-855",       "CP855" },
+    { "IBM-856",       "CP856" },
+    { "IBM-857",       "CP857" },
+  /*{ "IBM-859",       "?" },*/
+    { "IBM-860",       "CP860" },
+    { "IBM-861",       "CP861" },
+    { "IBM-862",       "CP862" },
+    { "IBM-863",       "CP863" },
+    { "IBM-864",       "CP864" },
+    { "IBM-865",       "CP865" },
+    { "IBM-866",       "CP866" },
+  /*{ "IBM-868",       "?" },*/
+    { "IBM-869",       "CP869" },
+    { "IBM-874",       "CP874" },
+    { "IBM-878",       "KOI8-R" },
+  /*{ "IBM-895",       "?" },*/
+  /*{ "IBM-897",       "CP943" },*/
+  /*{ "IBM-907",       "?" },*/
+  /*{ "IBM-909",       "?" },*/
+    { "IBM-912",       "ISO-8859-2" },
+    { "IBM-913",       "ISO-8859-3" },
+    { "IBM-914",       "ISO-8859-4" },
+    { "IBM-915",       "ISO-8859-5" },
+    { "IBM-916",       "ISO-8859-8" },
+    { "IBM-920",       "ISO-8859-9" },
+    { "IBM-921",       "ISO-8859-13" },
+    { "IBM-922",       "CP922" },
+    { "IBM-923",       "ISO-8859-15" },
+    { "IBM-932",       "CP932" },
+  /*{ "IBM-941",       "CP943" },*/
+  /*{ "IBM-942",       "?" },*/
+    { "IBM-943",       "CP943" },
+  /*{ "IBM-947",       "CP950" },*/
+    { "IBM-949",       "CP949" },
+    { "IBM-950",       "CP950" },
+  /*{ "IBM-951",       "CP949" },*/
+  /*{ "IBM-952",       "JIS_X0208-1990" },*/
+  /*{ "IBM-953",       "JIS_X0212-1990" },*/
+    { "IBM-954",       "EUC-JP" },
+  /*{ "IBM-955",       "?" },*/
+    { "IBM-964",       "EUC-TW" },
+    { "IBM-970",       "EUC-KR" },
+  /*{ "IBM-971",       "KS_C_5601-1987" },*/
+    { "IBM-eucCN",     "GB2312" },
+    { "IBM-eucJP",     "EUC-JP" },
+    { "IBM-eucKR",     "EUC-KR" },
+    { "IBM-eucTW",     "EUC-TW" },
+    { "IBM33722",      "EUC-JP" },
+    { "ISO8859-1",     "ISO-8859-1" },
+    { "ISO8859-2",     "ISO-8859-2" },
+    { "ISO8859-3",     "ISO-8859-3" },
+    { "ISO8859-4",     "ISO-8859-4" },
+    { "ISO8859-5",     "ISO-8859-5" },
+    { "ISO8859-6",     "ISO-8859-6" },
+    { "ISO8859-7",     "ISO-8859-7" },
+    { "ISO8859-8",     "ISO-8859-8" },
+    { "ISO8859-9",     "ISO-8859-9" },
+  /*{ "JISX0201-1976", "JISX0201-1976" },*/
+  /*{ "JISX0208-1978", "?" },*/
+  /*{ "JISX0208-1983", "JIS_X0208-1983" },*/
+  /*{ "JISX0208-1990", "JIS_X0208-1990" },*/
+  /*{ "JISX0212-1990", "JIS_X0212-1990" },*/
+  /*{ "KSC5601-1987",  "KS_C_5601-1987" },*/
+    { "SJIS-1",        "CP943" },
+    { "SJIS-2",        "CP943" },
+    { "eucJP",         "EUC-JP" },
+    { "eucKR",         "EUC-KR" },
+    { "eucTW-1993",    "EUC-TW" }
+#   define alias_table_defined
+#  endif
+#  if defined VMS                                           /* OpenVMS */
+    /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
+       "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
+       section 10.7 "Handling Different Character Sets".  */
+    { "DECHANYU",  "DEC-HANYU" },
+    { "DECHANZI",  "GB2312" },
+    { "DECKANJI",  "DEC-KANJI" },
+    { "DECKOREAN", "EUC-KR" },
+    { "ISO8859-1", "ISO-8859-1" },
+    { "ISO8859-2", "ISO-8859-2" },
+    { "ISO8859-5", "ISO-8859-5" },
+    { "ISO8859-7", "ISO-8859-7" },
+    { "ISO8859-8", "ISO-8859-8" },
+    { "ISO8859-9", "ISO-8859-9" },
+    { "SDECKANJI", "EUC-JP" },
+    { "SJIS",      "SHIFT_JIS" },
+    { "eucJP",     "EUC-JP" },
+    { "eucTW",     "EUC-TW" }
+#   define alias_table_defined
+#  endif
+#  ifndef alias_table_defined
+    /* Just a dummy entry, to avoid a C syntax error.  */
+    { "", "" }
+#  endif
+  };
 
-          free (file_name);
-        }
+# endif
 
 #else
 
-# if defined DARWIN7
-      /* To avoid the trouble of installing a file that is shared by many
-         GNU packages -- many packaging systems have problems with this --,
-         simply inline the aliases here.  */
-      cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
-           "ISO8859-2" "\0" "ISO-8859-2" "\0"
-           "ISO8859-4" "\0" "ISO-8859-4" "\0"
-           "ISO8859-5" "\0" "ISO-8859-5" "\0"
-           "ISO8859-7" "\0" "ISO-8859-7" "\0"
-           "ISO8859-9" "\0" "ISO-8859-9" "\0"
-           "ISO8859-13" "\0" "ISO-8859-13" "\0"
-           "ISO8859-15" "\0" "ISO-8859-15" "\0"
-           "KOI8-R" "\0" "KOI8-R" "\0"
-           "KOI8-U" "\0" "KOI8-U" "\0"
-           "CP866" "\0" "CP866" "\0"
-           "CP949" "\0" "CP949" "\0"
-           "CP1131" "\0" "CP1131" "\0"
-           "CP1251" "\0" "CP1251" "\0"
-           "eucCN" "\0" "GB2312" "\0"
-           "GB2312" "\0" "GB2312" "\0"
-           "eucJP" "\0" "EUC-JP" "\0"
-           "eucKR" "\0" "EUC-KR" "\0"
-           "Big5" "\0" "BIG5" "\0"
-           "Big5HKSCS" "\0" "BIG5-HKSCS" "\0"
-           "GBK" "\0" "GBK" "\0"
-           "GB18030" "\0" "GB18030" "\0"
-           "SJIS" "\0" "SHIFT_JIS" "\0"
-           "ARMSCII-8" "\0" "ARMSCII-8" "\0"
-           "PT154" "\0" "PT154" "\0"
-         /*"ISCII-DEV" "\0" "?" "\0"*/
-           "*" "\0" "UTF-8" "\0";
-# endif
+/* On these platforms, we use a mapping from locale name to GNU canonical
+   encoding name.  */
 
-# if defined VMS
-      /* To avoid the troubles of an extra file charset.alias_vms in the
-         sources of many GNU packages, simply inline the aliases here.  */
-      /* The list of encodings is taken from the OpenVMS 7.3-1 documentation
-         "Compaq C Run-Time Library Reference Manual for OpenVMS systems"
-         section 10.7 "Handling Different Character Sets".  */
-      cp = "ISO8859-1" "\0" "ISO-8859-1" "\0"
-           "ISO8859-2" "\0" "ISO-8859-2" "\0"
-           "ISO8859-5" "\0" "ISO-8859-5" "\0"
-           "ISO8859-7" "\0" "ISO-8859-7" "\0"
-           "ISO8859-8" "\0" "ISO-8859-8" "\0"
-           "ISO8859-9" "\0" "ISO-8859-9" "\0"
-           /* Japanese */
-           "eucJP" "\0" "EUC-JP" "\0"
-           "SJIS" "\0" "SHIFT_JIS" "\0"
-           "DECKANJI" "\0" "DEC-KANJI" "\0"
-           "SDECKANJI" "\0" "EUC-JP" "\0"
-           /* Chinese */
-           "eucTW" "\0" "EUC-TW" "\0"
-           "DECHANYU" "\0" "DEC-HANYU" "\0"
-           "DECHANZI" "\0" "GB2312" "\0"
-           /* Korean */
-           "DECKOREAN" "\0" "EUC-KR" "\0";
+struct table_entry
+{
+  const char locale[17+1];
+  const char canonical[11+1];
+};
+
+/* Table of platform-dependent mappings, sorted in ascending order.  */
+static const struct table_entry locale_table[] =
+  {
+# if defined __FreeBSD__                                    /* FreeBSD 4.2 */
+    { "cs_CZ.ISO_8859-2",  "ISO-8859-2" },
+    { "da_DK.DIS_8859-15", "ISO-8859-15" },
+    { "da_DK.ISO_8859-1",  "ISO-8859-1" },
+    { "de_AT.DIS_8859-15", "ISO-8859-15" },
+    { "de_AT.ISO_8859-1",  "ISO-8859-1" },
+    { "de_CH.DIS_8859-15", "ISO-8859-15" },
+    { "de_CH.ISO_8859-1",  "ISO-8859-1" },
+    { "de_DE.DIS_8859-15", "ISO-8859-15" },
+    { "de_DE.ISO_8859-1",  "ISO-8859-1" },
+    { "en_AU.DIS_8859-15", "ISO-8859-15" },
+    { "en_AU.ISO_8859-1",  "ISO-8859-1" },
+    { "en_CA.DIS_8859-15", "ISO-8859-15" },
+    { "en_CA.ISO_8859-1",  "ISO-8859-1" },
+    { "en_GB.DIS_8859-15", "ISO-8859-15" },
+    { "en_GB.ISO_8859-1",  "ISO-8859-1" },
+    { "en_US.DIS_8859-15", "ISO-8859-15" },
+    { "en_US.ISO_8859-1",  "ISO-8859-1" },
+    { "es_ES.DIS_8859-15", "ISO-8859-15" },
+    { "es_ES.ISO_8859-1",  "ISO-8859-1" },
+    { "fi_FI.DIS_8859-15", "ISO-8859-15" },
+    { "fi_FI.ISO_8859-1",  "ISO-8859-1" },
+    { "fr_BE.DIS_8859-15", "ISO-8859-15" },
+    { "fr_BE.ISO_8859-1",  "ISO-8859-1" },
+    { "fr_CA.DIS_8859-15", "ISO-8859-15" },
+    { "fr_CA.ISO_8859-1",  "ISO-8859-1" },
+    { "fr_CH.DIS_8859-15", "ISO-8859-15" },
+    { "fr_CH.ISO_8859-1",  "ISO-8859-1" },
+    { "fr_FR.DIS_8859-15", "ISO-8859-15" },
+    { "fr_FR.ISO_8859-1",  "ISO-8859-1" },
+    { "hr_HR.ISO_8859-2",  "ISO-8859-2" },
+    { "hu_HU.ISO_8859-2",  "ISO-8859-2" },
+    { "is_IS.DIS_8859-15", "ISO-8859-15" },
+    { "is_IS.ISO_8859-1",  "ISO-8859-1" },
+    { "it_CH.DIS_8859-15", "ISO-8859-15" },
+    { "it_CH.ISO_8859-1",  "ISO-8859-1" },
+    { "it_IT.DIS_8859-15", "ISO-8859-15" },
+    { "it_IT.ISO_8859-1",  "ISO-8859-1" },
+    { "ja_JP.EUC",         "EUC-JP" },
+    { "ja_JP.SJIS",        "SHIFT_JIS" },
+    { "ja_JP.Shift_JIS",   "SHIFT_JIS" },
+    { "ko_KR.EUC",         "EUC-KR" },
+    { "la_LN.ASCII",       "ASCII" },
+    { "la_LN.DIS_8859-15", "ISO-8859-15" },
+    { "la_LN.ISO_8859-1",  "ISO-8859-1" },
+    { "la_LN.ISO_8859-2",  "ISO-8859-2" },
+    { "la_LN.ISO_8859-4",  "ISO-8859-4" },
+    { "lt_LN.ASCII",       "ASCII" },
+    { "lt_LN.DIS_8859-15", "ISO-8859-15" },
+    { "lt_LN.ISO_8859-1",  "ISO-8859-1" },
+    { "lt_LN.ISO_8859-2",  "ISO-8859-2" },
+    { "lt_LT.ISO_8859-4",  "ISO-8859-4" },
+    { "nl_BE.DIS_8859-15", "ISO-8859-15" },
+    { "nl_BE.ISO_8859-1",  "ISO-8859-1" },
+    { "nl_NL.DIS_8859-15", "ISO-8859-15" },
+    { "nl_NL.ISO_8859-1",  "ISO-8859-1" },
+    { "no_NO.DIS_8859-15", "ISO-8859-15" },
+    { "no_NO.ISO_8859-1",  "ISO-8859-1" },
+    { "pl_PL.ISO_8859-2",  "ISO-8859-2" },
+    { "pt_PT.DIS_8859-15", "ISO-8859-15" },
+    { "pt_PT.ISO_8859-1",  "ISO-8859-1" },
+    { "ru_RU.CP866",       "CP866" },
+    { "ru_RU.ISO_8859-5",  "ISO-8859-5" },
+    { "ru_RU.KOI8-R",      "KOI8-R" },
+    { "ru_SU.CP866",       "CP866" },
+    { "ru_SU.ISO_8859-5",  "ISO-8859-5" },
+    { "ru_SU.KOI8-R",      "KOI8-R" },
+    { "sl_SI.ISO_8859-2",  "ISO-8859-2" },
+    { "sv_SE.DIS_8859-15", "ISO-8859-15" },
+    { "sv_SE.ISO_8859-1",  "ISO-8859-1" },
+    { "uk_UA.KOI8-U",      "KOI8-U" },
+    { "zh_CN.EUC",         "GB2312" },
+    { "zh_TW.BIG5",        "BIG5" },
+    { "zh_TW.Big5",        "BIG5" }
+#  define locale_table_defined
 # endif
-
-# if defined WINDOWS_NATIVE || defined __CYGWIN__
-      /* To avoid the troubles of installing a separate file in the same
-         directory as the DLL and of retrieving the DLL's directory at
-         runtime, simply inline the aliases here.  */
-
-      cp = "CP936" "\0" "GBK" "\0"
-           "CP1361" "\0" "JOHAB" "\0"
-           "CP20127" "\0" "ASCII" "\0"
-           "CP20866" "\0" "KOI8-R" "\0"
-           "CP20936" "\0" "GB2312" "\0"
-           "CP21866" "\0" "KOI8-RU" "\0"
-           "CP28591" "\0" "ISO-8859-1" "\0"
-           "CP28592" "\0" "ISO-8859-2" "\0"
-           "CP28593" "\0" "ISO-8859-3" "\0"
-           "CP28594" "\0" "ISO-8859-4" "\0"
-           "CP28595" "\0" "ISO-8859-5" "\0"
-           "CP28596" "\0" "ISO-8859-6" "\0"
-           "CP28597" "\0" "ISO-8859-7" "\0"
-           "CP28598" "\0" "ISO-8859-8" "\0"
-           "CP28599" "\0" "ISO-8859-9" "\0"
-           "CP28605" "\0" "ISO-8859-15" "\0"
-           "CP38598" "\0" "ISO-8859-8" "\0"
-           "CP51932" "\0" "EUC-JP" "\0"
-           "CP51936" "\0" "GB2312" "\0"
-           "CP51949" "\0" "EUC-KR" "\0"
-           "CP51950" "\0" "EUC-TW" "\0"
-           "CP54936" "\0" "GB18030" "\0"
-           "CP65001" "\0" "UTF-8" "\0";
+# if defined __DJGPP__                                      /* DOS / DJGPP 2.03 */
+    /* The encodings given here may not all be correct.
+       If you find that the encoding given for your language and
+       country is not the one your DOS machine actually uses, just
+       correct it in this file, and send a mail to
+       Juan Manuel Guerrero <juan.guerrero@gmx.de>
+       and <bug-gnulib@gnu.org>.  */
+    { "C",     "ASCII" },
+    { "ar",    "CP864" },
+    { "ar_AE", "CP864" },
+    { "ar_DZ", "CP864" },
+    { "ar_EG", "CP864" },
+    { "ar_IQ", "CP864" },
+    { "ar_IR", "CP864" },
+    { "ar_JO", "CP864" },
+    { "ar_KW", "CP864" },
+    { "ar_MA", "CP864" },
+    { "ar_OM", "CP864" },
+    { "ar_QA", "CP864" },
+    { "ar_SA", "CP864" },
+    { "ar_SY", "CP864" },
+    { "be",    "CP866" },
+    { "be_BE", "CP866" },
+    { "bg",    "CP866" }, /* not CP855 ?? */
+    { "bg_BG", "CP866" }, /* not CP855 ?? */
+    { "ca",    "CP850" },
+    { "ca_ES", "CP850" },
+    { "cs",    "CP852" },
+    { "cs_CZ", "CP852" },
+    { "da",    "CP865" }, /* not CP850 ?? */
+    { "da_DK", "CP865" }, /* not CP850 ?? */
+    { "de",    "CP850" },
+    { "de_AT", "CP850" },
+    { "de_CH", "CP850" },
+    { "de_DE", "CP850" },
+    { "el",    "CP869" },
+    { "el_GR", "CP869" },
+    { "en",    "CP850" },
+    { "en_AU", "CP850" }, /* not CP437 ?? */
+    { "en_CA", "CP850" },
+    { "en_GB", "CP850" },
+    { "en_NZ", "CP437" },
+    { "en_US", "CP437" },
+    { "en_ZA", "CP850" }, /* not CP437 ?? */
+    { "eo",    "CP850" },
+    { "eo_EO", "CP850" },
+    { "es",    "CP850" },
+    { "es_AR", "CP850" },
+    { "es_BO", "CP850" },
+    { "es_CL", "CP850" },
+    { "es_CO", "CP850" },
+    { "es_CR", "CP850" },
+    { "es_CU", "CP850" },
+    { "es_DO", "CP850" },
+    { "es_EC", "CP850" },
+    { "es_ES", "CP850" },
+    { "es_GT", "CP850" },
+    { "es_HN", "CP850" },
+    { "es_MX", "CP850" },
+    { "es_NI", "CP850" },
+    { "es_PA", "CP850" },
+    { "es_PE", "CP850" },
+    { "es_PY", "CP850" },
+    { "es_SV", "CP850" },
+    { "es_UY", "CP850" },
+    { "es_VE", "CP850" },
+    { "et",    "CP850" },
+    { "et_EE", "CP850" },
+    { "eu",    "CP850" },
+    { "eu_ES", "CP850" },
+    { "fi",    "CP850" },
+    { "fi_FI", "CP850" },
+    { "fr",    "CP850" },
+    { "fr_BE", "CP850" },
+    { "fr_CA", "CP850" },
+    { "fr_CH", "CP850" },
+    { "fr_FR", "CP850" },
+    { "ga",    "CP850" },
+    { "ga_IE", "CP850" },
+    { "gd",    "CP850" },
+    { "gd_GB", "CP850" },
+    { "gl",    "CP850" },
+    { "gl_ES", "CP850" },
+    { "he",    "CP862" },
+    { "he_IL", "CP862" },
+    { "hr",    "CP852" },
+    { "hr_HR", "CP852" },
+    { "hu",    "CP852" },
+    { "hu_HU", "CP852" },
+    { "id",    "CP850" }, /* not CP437 ?? */
+    { "id_ID", "CP850" }, /* not CP437 ?? */
+    { "is",    "CP861" }, /* not CP850 ?? */
+    { "is_IS", "CP861" }, /* not CP850 ?? */
+    { "it",    "CP850" },
+    { "it_CH", "CP850" },
+    { "it_IT", "CP850" },
+    { "ja",    "CP932" },
+    { "ja_JP", "CP932" },
+    { "kr",    "CP949" }, /* not CP934 ?? */
+    { "kr_KR", "CP949" }, /* not CP934 ?? */
+    { "lt",    "CP775" },
+    { "lt_LT", "CP775" },
+    { "lv",    "CP775" },
+    { "lv_LV", "CP775" },
+    { "mk",    "CP866" }, /* not CP855 ?? */
+    { "mk_MK", "CP866" }, /* not CP855 ?? */
+    { "mt",    "CP850" },
+    { "mt_MT", "CP850" },
+    { "nb",    "CP865" }, /* not CP850 ?? */
+    { "nb_NO", "CP865" }, /* not CP850 ?? */
+    { "nl",    "CP850" },
+    { "nl_BE", "CP850" },
+    { "nl_NL", "CP850" },
+    { "nn",    "CP865" }, /* not CP850 ?? */
+    { "nn_NO", "CP865" }, /* not CP850 ?? */
+    { "no",    "CP865" }, /* not CP850 ?? */
+    { "no_NO", "CP865" }, /* not CP850 ?? */
+    { "pl",    "CP852" },
+    { "pl_PL", "CP852" },
+    { "pt",    "CP850" },
+    { "pt_BR", "CP850" },
+    { "pt_PT", "CP850" },
+    { "ro",    "CP852" },
+    { "ro_RO", "CP852" },
+    { "ru",    "CP866" },
+    { "ru_RU", "CP866" },
+    { "sk",    "CP852" },
+    { "sk_SK", "CP852" },
+    { "sl",    "CP852" },
+    { "sl_SI", "CP852" },
+    { "sq",    "CP852" },
+    { "sq_AL", "CP852" },
+    { "sr",    "CP852" }, /* CP852 or CP866 or CP855 ?? */
+    { "sr_CS", "CP852" }, /* CP852 or CP866 or CP855 ?? */
+    { "sr_YU", "CP852" }, /* CP852 or CP866 or CP855 ?? */
+    { "sv",    "CP850" },
+    { "sv_SE", "CP850" },
+    { "th",    "CP874" },
+    { "th_TH", "CP874" },
+    { "tr",    "CP857" },
+    { "tr_TR", "CP857" },
+    { "uk",    "CP1125" },
+    { "uk_UA", "CP1125" },
+    { "zh_CN", "GBK" },
+    { "zh_TW", "CP950" } /* not CP938 ?? */
+#  define locale_table_defined
 # endif
-# if defined OS2
-      /* To avoid the troubles of installing a separate file in the same
-         directory as the DLL and of retrieving the DLL's directory at
-         runtime, simply inline the aliases here.  */
-
-      /* The list of encodings is taken from "List of OS/2 Codepages"
-         by Alex Taylor:
-         <http://altsan.org/os2/toolkits/uls/index.html#codepages>.
-         See also "IBM Globalization - Code page identifiers":
-         <http://www-01.ibm.com/software/globalization/cp/cp_cpgid.html>.  */
-      cp = "CP813" "\0" "ISO-8859-7" "\0"
-           "CP878" "\0" "KOI8-R" "\0"
-           "CP819" "\0" "ISO-8859-1" "\0"
-           "CP912" "\0" "ISO-8859-2" "\0"
-           "CP913" "\0" "ISO-8859-3" "\0"
-           "CP914" "\0" "ISO-8859-4" "\0"
-           "CP915" "\0" "ISO-8859-5" "\0"
-           "CP916" "\0" "ISO-8859-8" "\0"
-           "CP920" "\0" "ISO-8859-9" "\0"
-           "CP921" "\0" "ISO-8859-13" "\0"
-           "CP923" "\0" "ISO-8859-15" "\0"
-           "CP954" "\0" "EUC-JP" "\0"
-           "CP964" "\0" "EUC-TW" "\0"
-           "CP970" "\0" "EUC-KR" "\0"
-           "CP1089" "\0" "ISO-8859-6" "\0"
-           "CP1208" "\0" "UTF-8" "\0"
-           "CP1381" "\0" "GB2312" "\0"
-           "CP1386" "\0" "GBK" "\0"
-           "CP3372" "\0" "EUC-JP" "\0";
+# ifndef locale_table_defined
+    /* Just a dummy entry, to avoid a C syntax error.  */
+    { "", "" }
 # endif
+  };
+
 #endif
 
-      charset_aliases = cp;
-    }
-
-  return cp;
-}
 
 /* Determine the current locale's character encoding, and canonicalize it
-   into one of the canonical names listed in config.charset.
-   The result must not be freed; it is statically allocated.
+   into one of the canonical names listed below.
+   The result must not be freed; it is statically allocated.  The result
+   becomes invalid when setlocale() is used to change the global locale, or
+   when the value of one of the environment variables LC_ALL, LC_CTYPE, LANG
+   is changed; threads in multithreaded programs should not do this.
    If the canonical name cannot be determined, the result is a non-canonical
    name.  */
 
@@ -393,9 +831,15 @@ const char *
 locale_charset (void)
 {
   const char *codeset;
-  const char *aliases;
 
-#if !(defined WINDOWS_NATIVE || defined OS2)
+  /* This function must be multithread-safe.  To achieve this without using
+     thread-local storage, we use a simple strcpy or memcpy to fill this static
+     buffer.  Filling it through, for example, strcpy + strcat would not be
+     guaranteed to leave the buffer's contents intact if another thread is
+     currently accessing it.  If necessary, the contents is first assembled in
+     a stack-allocated buffer.  */
+
+#if HAVE_LANGINFO_CODESET || defined WINDOWS_NATIVE || defined OS2
 
 # if HAVE_LANGINFO_CODESET
 
@@ -409,7 +853,7 @@ locale_charset (void)
   if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0)
     {
       const char *locale;
-      static char buf[2 + 10 + 1];
+      static char resultbuf[2 + 10 + 1];
 
       locale = getenv ("LC_ALL");
       if (locale == NULL || locale[0] == '\0')
@@ -433,11 +877,12 @@ locale_charset (void)
               modifier = strchr (dot, '@');
               if (modifier == NULL)
                 return dot;
-              if (modifier - dot < sizeof (buf))
+              if (modifier - dot < sizeof (resultbuf))
                 {
-                  memcpy (buf, dot, modifier - dot);
-                  buf [modifier - dot] = '\0';
-                  return buf;
+                  /* This way of filling resultbuf is multithread-safe.  */
+                  memcpy (resultbuf, dot, modifier - dot);
+                  resultbuf [modifier - dot] = '\0';
+                  return resultbuf;
                 }
             }
         }
@@ -453,79 +898,60 @@ locale_charset (void)
          converting to GetConsoleOutputCP().  This leads to correct results,
          except when SetConsoleOutputCP has been called and a raster font is
          in use.  */
-      sprintf (buf, "CP%u", GetACP ());
-      codeset = buf;
-    }
-#  endif
-
-# else
-
-  /* On old systems which lack it, use setlocale or getenv.  */
-  const char *locale = NULL;
+      {
+        char buf[2 + 10 + 1];
 
-  /* But most old systems don't have a complete set of locales.  Some
-     (like SunOS 4 or DJGPP) have only the C locale.  Therefore we don't
-     use setlocale here; it would return "C" when it doesn't support the
-     locale name the user has set.  */
-#  if 0
-  locale = setlocale (LC_CTYPE, NULL);
-#  endif
-  if (locale == NULL || locale[0] == '\0')
-    {
-      locale = getenv ("LC_ALL");
-      if (locale == NULL || locale[0] == '\0')
-        {
-          locale = getenv ("LC_CTYPE");
-          if (locale == NULL || locale[0] == '\0')
-            locale = getenv ("LANG");
-        }
+        sprintf (buf, "CP%u", GetACP ());
+        strcpy (resultbuf, buf);
+        codeset = resultbuf;
+      }
     }
+#  endif
 
-  /* On some old systems, one used to set locale = "iso8859_1". On others,
-     you set it to "language_COUNTRY.charset". In any case, we resolve it
-     through the charset.alias file.  */
-  codeset = locale;
-
-# endif
+  if (codeset == NULL)
+    /* The canonical name cannot be determined.  */
+    codeset = "";
 
-#elif defined WINDOWS_NATIVE
+# elif defined WINDOWS_NATIVE
 
-  static char buf[2 + 10 + 1];
+  char buf[2 + 10 + 1];
+  static char resultbuf[2 + 10 + 1];
 
   /* The Windows API has a function returning the locale's codepage as
      a number, but the value doesn't change according to what the
      'setlocale' call specified.  So we use it as a last resort, in
      case the string returned by 'setlocale' doesn't specify the
      codepage.  */
-  char *current_locale = setlocale (LC_ALL, NULL);
-  char *pdot;
+  char *current_locale = setlocale (LC_CTYPE, NULL);
+  char *pdot = strrchr (current_locale, '.');
 
-  /* If they set different locales for different categories,
-     'setlocale' will return a semi-colon separated list of locale
-     values.  To make sure we use the correct one, we choose LC_CTYPE.  */
-  if (strchr (current_locale, ';'))
-    current_locale = setlocale (LC_CTYPE, NULL);
-
-  pdot = strrchr (current_locale, '.');
   if (pdot && 2 + strlen (pdot + 1) + 1 <= sizeof (buf))
     sprintf (buf, "CP%s", pdot + 1);
   else
     {
       /* The Windows API has a function returning the locale's codepage as a
-        number: GetACP().
-        When the output goes to a console window, it needs to be provided in
-        GetOEMCP() encoding if the console is using a raster font, or in
-        GetConsoleOutputCP() encoding if it is using a TrueType font.
-        But in GUI programs and for output sent to files and pipes, GetACP()
-        encoding is the best bet.  */
+         number: GetACP().
+         When the output goes to a console window, it needs to be provided in
+         GetOEMCP() encoding if the console is using a raster font, or in
+         GetConsoleOutputCP() encoding if it is using a TrueType font.
+         But in GUI programs and for output sent to files and pipes, GetACP()
+         encoding is the best bet.  */
       sprintf (buf, "CP%u", GetACP ());
     }
-  codeset = buf;
+  /* For a locale name such as "French_France.65001", in Windows 10,
+     setlocale now returns "French_France.utf8" instead.  */
+  if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0)
+    codeset = "UTF-8";
+  else
+    {
+      strcpy (resultbuf, buf);
+      codeset = resultbuf;
+    }
 
-#elif defined OS2
+# elif defined OS2
 
   const char *locale;
-  static char buf[2 + 10 + 1];
+  static char resultbuf[2 + 10 + 1];
   ULONG cp[3];
   ULONG cplen;
 
@@ -554,11 +980,12 @@ locale_charset (void)
           modifier = strchr (dot, '@');
           if (modifier == NULL)
             return dot;
-          if (modifier - dot < sizeof (buf))
+          if (modifier - dot < sizeof (resultbuf))
             {
-              memcpy (buf, dot, modifier - dot);
-              buf [modifier - dot] = '\0';
-              return buf;
+              /* This way of filling resultbuf is multithread-safe.  */
+              memcpy (resultbuf, dot, modifier - dot);
+              resultbuf [modifier - dot] = '\0';
+              return resultbuf;
             }
         }
 
@@ -574,33 +1001,152 @@ locale_charset (void)
         codeset = "";
       else
         {
+          char buf[2 + 10 + 1];
+
           sprintf (buf, "CP%u", cp[0]);
-          codeset = buf;
+          strcpy (resultbuf, buf);
+          codeset = resultbuf;
         }
     }
 
-#endif
+# else
 
-  if (codeset == NULL)
-    /* The canonical name cannot be determined.  */
-    codeset = "";
+#  error "Add code for other platforms here."
+
+# endif
+
+  /* Resolve alias.  */
+  {
+# ifdef alias_table_defined
+    /* On some platforms, UTF-8 locales are the most frequently used ones.
+       Speed up the common case and slow down the less common cases by
+       testing for this case first.  */
+#  if defined __OpenBSD__ || (defined __APPLE__ && defined __MACH__) || defined __sun || defined __CYGWIN__
+    if (strcmp (codeset, "UTF-8") == 0)
+      goto done_table_lookup;
+    else
+#  endif
+      {
+        const struct table_entry * const table = alias_table;
+        size_t const table_size =
+          sizeof (alias_table) / sizeof (struct table_entry);
+        /* The table is sorted.  Perform a binary search.  */
+        size_t hi = table_size;
+        size_t lo = 0;
+        while (lo < hi)
+          {
+            /* Invariant:
+               for i < lo, strcmp (table[i].alias, codeset) < 0,
+               for i >= hi, strcmp (table[i].alias, codeset) > 0.  */
+            size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+            int cmp = strcmp (table[mid].alias, codeset);
+            if (cmp < 0)
+              lo = mid + 1;
+            else if (cmp > 0)
+              hi = mid;
+            else
+              {
+                /* Found an i with
+                     strcmp (table[i].alias, codeset) == 0.  */
+                codeset = table[mid].canonical;
+                goto done_table_lookup;
+              }
+          }
+      }
+    if (0)
+      done_table_lookup: ;
+    else
+# endif
+      {
+        /* Did not find it in the table.  */
+        /* On Mac OS X, all modern locales use the UTF-8 encoding.
+           BeOS and Haiku have a single locale, and it has UTF-8 encoding.  */
+# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__
+        codeset = "UTF-8";
+# else
+        /* Don't return an empty string.  GNU libc and GNU libiconv interpret
+           the empty string as denoting "the locale's character encoding",
+           thus GNU libiconv would call this function a second time.  */
+        if (codeset[0] == '\0')
+          codeset = "ASCII";
+# endif
+      }
+  }
 
-  /* Resolve alias. */
-  for (aliases = get_charset_aliases ();
-       *aliases != '\0';
-       aliases += strlen (aliases) + 1, aliases += strlen (aliases) + 1)
-    if (strcmp (codeset, aliases) == 0
-        || (aliases[0] == '*' && aliases[1] == '\0'))
+#else
+
+  /* On old systems which lack it, use setlocale or getenv.  */
+  const char *locale = NULL;
+
+  /* But most old systems don't have a complete set of locales.  Some
+     (like DJGPP) have only the C locale.  Therefore we don't use setlocale
+     here; it would return "C" when it doesn't support the locale name the
+     user has set.  */
+# if 0
+  locale = setlocale (LC_CTYPE, NULL);
+# endif
+  if (locale == NULL || locale[0] == '\0')
+    {
+      locale = getenv ("LC_ALL");
+      if (locale == NULL || locale[0] == '\0')
+        {
+          locale = getenv ("LC_CTYPE");
+          if (locale == NULL || locale[0] == '\0')
+            locale = getenv ("LANG");
+            if (locale == NULL)
+              locale = "";
+        }
+    }
+
+  /* Map locale name to canonical encoding name.  */
+  {
+# ifdef locale_table_defined
+    const struct table_entry * const table = locale_table;
+    size_t const table_size =
+      sizeof (locale_table) / sizeof (struct table_entry);
+    /* The table is sorted.  Perform a binary search.  */
+    size_t hi = table_size;
+    size_t lo = 0;
+    while (lo < hi)
+      {
+        /* Invariant:
+           for i < lo, strcmp (table[i].locale, locale) < 0,
+           for i >= hi, strcmp (table[i].locale, locale) > 0.  */
+        size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+        int cmp = strcmp (table[mid].locale, locale);
+        if (cmp < 0)
+          lo = mid + 1;
+        else if (cmp > 0)
+          hi = mid;
+        else
+          {
+            /* Found an i with
+                 strcmp (table[i].locale, locale) == 0.  */
+            codeset = table[mid].canonical;
+            goto done_table_lookup;
+          }
+      }
+    if (0)
+      done_table_lookup: ;
+    else
+# endif
       {
-        codeset = aliases + strlen (aliases) + 1;
-        break;
+        /* Did not find it in the table.  */
+        /* On Mac OS X, all modern locales use the UTF-8 encoding.
+           BeOS and Haiku have a single locale, and it has UTF-8 encoding.  */
+# if (defined __APPLE__ && defined __MACH__) || defined __BEOS__ || defined __HAIKU__
+        codeset = "UTF-8";
+# else
+        /* The canonical name cannot be determined.  */
+        /* Don't return an empty string.  GNU libc and GNU libiconv interpret
+           the empty string as denoting "the locale's character encoding",
+           thus GNU libiconv would call this function a second time.  */
+        codeset = "ASCII";
+# endif
       }
+  }
 
-  /* Don't return an empty string.  GNU libc and GNU libiconv interpret
-     the empty string as denoting "the locale's character encoding",
-     thus GNU libiconv would call this function a second time.  */
-  if (codeset[0] == '\0')
-    codeset = "ASCII";
+#endif
 
 #ifdef DARWIN7
   /* Mac OS X sets MB_CUR_MAX to 1 when LC_ALL=C, and "UTF-8"
index 915182e..6e66494 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine a canonical name for the current locale's character encoding.
-   Copyright (C) 2000-2003, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2003, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU CHARSET Library.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _LOCALCHARSET_H
 #define _LOCALCHARSET_H
@@ -25,12 +25,109 @@ extern "C" {
 
 
 /* Determine the current locale's character encoding, and canonicalize it
-   into one of the canonical names listed in config.charset.
-   The result must not be freed; it is statically allocated.
+   into one of the canonical names listed below.
+   The result must not be freed; it is statically allocated.  The result
+   becomes invalid when setlocale() is used to change the global locale, or
+   when the value of one of the environment variables LC_ALL, LC_CTYPE, LANG
+   is changed; threads in multithreaded programs should not do this.
    If the canonical name cannot be determined, the result is a non-canonical
    name.  */
 extern const char * locale_charset (void);
 
+/* About GNU canonical names for character encodings:
+
+   Every canonical name must be supported by GNU libiconv.  Support by GNU libc
+   is also desirable.
+
+   The name is case insensitive.  Usually an upper case MIME charset name is
+   preferred.
+
+   The current list of these GNU canonical names is:
+
+       name              MIME?             used by which systems
+                                    (darwin = Mac OS X, windows = native Windows)
+
+   ASCII, ANSI_X3.4-1968       glibc solaris freebsd netbsd darwin minix cygwin
+   ISO-8859-1              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+   ISO-8859-2              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+   ISO-8859-3              Y   glibc solaris cygwin
+   ISO-8859-4              Y   hpux osf solaris freebsd netbsd openbsd darwin
+   ISO-8859-5              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+   ISO-8859-6              Y   glibc aix hpux solaris cygwin
+   ISO-8859-7              Y   glibc aix hpux irix osf solaris freebsd netbsd openbsd darwin cygwin zos
+   ISO-8859-8              Y   glibc aix hpux osf solaris cygwin zos
+   ISO-8859-9              Y   glibc aix hpux irix osf solaris freebsd darwin cygwin zos
+   ISO-8859-13                 glibc hpux solaris freebsd netbsd openbsd darwin cygwin
+   ISO-8859-14                 glibc cygwin
+   ISO-8859-15                 glibc aix irix osf solaris freebsd netbsd openbsd darwin cygwin
+   KOI8-R                  Y   glibc hpux solaris freebsd netbsd openbsd darwin
+   KOI8-U                  Y   glibc freebsd netbsd openbsd darwin cygwin
+   KOI8-T                      glibc
+   CP437                       dos
+   CP775                       dos
+   CP850                       aix osf dos
+   CP852                       dos
+   CP855                       dos
+   CP856                       aix
+   CP857                       dos
+   CP861                       dos
+   CP862                       dos
+   CP864                       dos
+   CP865                       dos
+   CP866                       freebsd netbsd openbsd darwin dos
+   CP869                       dos
+   CP874                       windows dos
+   CP922                       aix
+   CP932                       aix cygwin windows dos
+   CP943                       aix zos
+   CP949                       osf darwin windows dos
+   CP950                       windows dos
+   CP1046                      aix
+   CP1124                      aix
+   CP1125                      dos
+   CP1129                      aix
+   CP1131                      freebsd darwin
+   CP1250                      windows
+   CP1251                      glibc hpux solaris freebsd netbsd openbsd darwin cygwin windows
+   CP1252                      aix windows
+   CP1253                      windows
+   CP1254                      windows
+   CP1255                      glibc windows
+   CP1256                      windows
+   CP1257                      windows
+   GB2312                  Y   glibc aix hpux irix solaris freebsd netbsd darwin cygwin zos
+   EUC-JP                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin
+   EUC-KR                  Y   glibc aix hpux irix osf solaris freebsd netbsd darwin cygwin zos
+   EUC-TW                      glibc aix hpux irix osf solaris netbsd
+   BIG5                    Y   glibc aix hpux osf solaris freebsd netbsd darwin cygwin zos
+   BIG5-HKSCS                  glibc hpux solaris netbsd darwin
+   GBK                         glibc aix osf solaris freebsd darwin cygwin windows dos
+   GB18030                     glibc hpux solaris freebsd netbsd darwin
+   SHIFT_JIS               Y   hpux osf solaris freebsd netbsd darwin
+   JOHAB                       glibc solaris windows
+   TIS-620                     glibc aix hpux osf solaris cygwin zos
+   VISCII                  Y   glibc
+   TCVN5712-1                  glibc
+   ARMSCII-8                   glibc freebsd netbsd darwin
+   GEORGIAN-PS                 glibc cygwin
+   PT154                       glibc netbsd cygwin
+   HP-ROMAN8                   hpux
+   HP-ARABIC8                  hpux
+   HP-GREEK8                   hpux
+   HP-HEBREW8                  hpux
+   HP-TURKISH8                 hpux
+   HP-KANA8                    hpux
+   DEC-KANJI                   osf
+   DEC-HANYU                   osf
+   UTF-8                   Y   glibc aix hpux osf solaris netbsd darwin cygwin zos
+
+   Note: Names which are not marked as being a MIME name should not be used in
+   Internet protocols for information interchange (mail, news, etc.).
+
+   Note: ASCII and ANSI_X3.4-1968 are synonymous canonical names.  Applications
+   must understand both names and treat them as equivalent.
+ */
+
 
 #ifdef __cplusplus
 }
index 4083507..13d1cf2 100644 (file)
@@ -1,5 +1,5 @@
 /* A POSIX <locale.h>.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 @PRAGMA_COLUMNS@
 
-#ifdef _GL_ALREADY_INCLUDING_LOCALE_H
+#if (defined _WIN32 && !defined __CYGWIN__ && defined __need_locale_t) \
+    || defined _GL_ALREADY_INCLUDING_LOCALE_H
 
-/* Special invocation conventions to handle Solaris header files
-   (through Solaris 10) when combined with gettext's libintl.h.  */
+/* Special invocation convention:
+   - Inside mingw header files,
+   - To handle Solaris header files (through Solaris 10) when combined
+     with gettext's libintl.h.  */
 
 #@INCLUDE_NEXT@ @NEXT_LOCALE_H@
 
 # define LC_MESSAGES 1729
 #endif
 
+/* On native Windows with MSVC, 'struct lconv' lacks the members int_p_* and
+   int_n_*.  Instead of overriding 'struct lconv', merely define these member
+   names as macros.  This avoids trouble in C++ mode.  */
+#if defined _MSC_VER
+# define int_p_cs_precedes   p_cs_precedes
+# define int_p_sign_posn     p_sign_posn
+# define int_p_sep_by_space  p_sep_by_space
+# define int_n_cs_precedes   n_cs_precedes
+# define int_n_sign_posn     n_sign_posn
+# define int_n_sep_by_space  n_sep_by_space
+#endif
+
 /* Bionic libc's 'struct lconv' is just a dummy.  */
 #if @REPLACE_STRUCT_LCONV@
 # define lconv rpl_lconv
@@ -69,7 +84,7 @@ struct lconv
   /* All 'char *' are actually 'const char *'.  */
 
   /* Members that depend on the LC_NUMERIC category of the locale.  See
-     <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */
+     <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_04> */
 
   /* Symbol used as decimal point.  */
   char *decimal_point;
@@ -81,7 +96,7 @@ struct lconv
   char *grouping;
 
   /* Members that depend on the LC_MONETARY category of the locale.  See
-     <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */
+     <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html#tag_07_03_03> */
 
   /* Symbol used as decimal point.  */
   char *mon_decimal_point;
@@ -153,7 +168,9 @@ _GL_CXXALIAS_RPL (localeconv, struct lconv *, (void));
 # else
 _GL_CXXALIAS_SYS (localeconv, struct lconv *, (void));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (localeconv);
+# endif
 #elif @REPLACE_STRUCT_LCONV@
 # undef localeconv
 # define localeconv localeconv_used_without_requesting_gnulib_module_localeconv
@@ -178,7 +195,9 @@ _GL_CXXALIAS_RPL (setlocale, char *, (int category, const char *locale));
 # else
 _GL_CXXALIAS_SYS (setlocale, char *, (int category, const char *locale));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (setlocale);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef setlocale
 # if HAVE_RAW_DECL_SETLOCALE
@@ -187,11 +206,50 @@ _GL_WARN_ON_USE (setlocale, "setlocale works differently on native Windows - "
 # endif
 #endif
 
-#if @GNULIB_DUPLOCALE@
+#if @GNULIB_SETLOCALE_NULL@
+/* Included here for convenience.  */
+# include "setlocale_null.h"
+#endif
+
+#if /*@GNULIB_NEWLOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_NEWLOCALE@)
+# if @REPLACE_NEWLOCALE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef newlocale
+#   define newlocale rpl_newlocale
+#   define GNULIB_defined_newlocale 1
+#  endif
+_GL_FUNCDECL_RPL (newlocale, locale_t,
+                  (int category_mask, const char *name, locale_t base)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (newlocale, locale_t,
+                  (int category_mask, const char *name, locale_t base));
+# else
+#  if @HAVE_NEWLOCALE@
+_GL_CXXALIAS_SYS (newlocale, locale_t,
+                  (int category_mask, const char *name, locale_t base));
+#  endif
+# endif
+# if @HAVE_NEWLOCALE@
+_GL_CXXALIASWARN (newlocale);
+# endif
+# if @HAVE_NEWLOCALE@ || @REPLACE_NEWLOCALE@
+#  ifndef HAVE_WORKING_NEWLOCALE
+#   define HAVE_WORKING_NEWLOCALE 1
+#  endif
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef newlocale
+# if HAVE_RAW_DECL_NEWLOCALE
+_GL_WARN_ON_USE (newlocale, "newlocale is not portable");
+# endif
+#endif
+
+#if @GNULIB_DUPLOCALE@ || (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_DUPLOCALE@)
 # if @REPLACE_DUPLOCALE@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef duplocale
 #   define duplocale rpl_duplocale
+#   define GNULIB_defined_duplocale 1
 #  endif
 _GL_FUNCDECL_RPL (duplocale, locale_t, (locale_t locale) _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (duplocale, locale_t, (locale_t locale));
@@ -203,6 +261,11 @@ _GL_CXXALIAS_SYS (duplocale, locale_t, (locale_t locale));
 # if @HAVE_DUPLOCALE@
 _GL_CXXALIASWARN (duplocale);
 # endif
+# if @HAVE_DUPLOCALE@ || @REPLACE_DUPLOCALE@
+#  ifndef HAVE_WORKING_DUPLOCALE
+#   define HAVE_WORKING_DUPLOCALE 1
+#  endif
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef duplocale
 # if HAVE_RAW_DECL_DUPLOCALE
@@ -211,6 +274,32 @@ _GL_WARN_ON_USE (duplocale, "duplocale is buggy on some glibc systems - "
 # endif
 #endif
 
+#if /*@GNULIB_FREELOCALE@ ||*/ (@GNULIB_LOCALENAME@ && @LOCALENAME_ENHANCE_LOCALE_FUNCS@ && @HAVE_FREELOCALE@)
+# if @REPLACE_FREELOCALE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef freelocale
+#   define freelocale rpl_freelocale
+#   define GNULIB_defined_freelocale 1
+#  endif
+_GL_FUNCDECL_RPL (freelocale, void, (locale_t locale) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (freelocale, void, (locale_t locale));
+# else
+#  if @HAVE_FREELOCALE@
+/* Need to cast, because on FreeBSD and Mac OS X 10.13, the return type is
+                                   int.  */
+_GL_CXXALIAS_SYS_CAST (freelocale, void, (locale_t locale));
+#  endif
+# endif
+# if @HAVE_FREELOCALE@
+_GL_CXXALIASWARN (freelocale);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef freelocale
+# if HAVE_RAW_DECL_FREELOCALE
+_GL_WARN_ON_USE (freelocale, "freelocale is not portable");
+# endif
+#endif
+
 #endif /* _@GUARD_PREFIX@_LOCALE_H */
-#endif /* ! _GL_ALREADY_INCLUDING_LOCALE_H */
 #endif /* _@GUARD_PREFIX@_LOCALE_H */
+#endif /* !(__need_locale_t || _GL_ALREADY_INCLUDING_LOCALE_H) */
index 8a1d6d7..8ecd391 100644 (file)
@@ -1,5 +1,5 @@
 /* Query locale dependent information for formatting numbers.
-   Copyright (C) 2012-2016 Free Software Foundation, Inc.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/lib/localename-table.c b/lib/localename-table.c
new file mode 100644 (file)
index 0000000..c7a3d0b
--- /dev/null
@@ -0,0 +1,48 @@
+/* Table that maps a locale object to the names of the locale categories.
+   Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2018.  */
+
+#include <config.h>
+
+#if HAVE_WORKING_USELOCALE && HAVE_NAMELESS_LOCALES
+
+/* Specification.  */
+#include "localename-table.h"
+
+#include <stdint.h>
+
+/* A hash function for pointers.  */
+size_t _GL_ATTRIBUTE_CONST
+locale_hash_function (locale_t x)
+{
+  uintptr_t p = (uintptr_t) x;
+  size_t h = ((p % 4177) << 12) + ((p % 79) << 6) + (p % 61);
+  return h;
+}
+
+struct locale_hash_node * locale_hash_table[LOCALE_HASH_TABLE_SIZE]
+  /* = { NULL, ..., NULL } */;
+
+gl_rwlock_define_initialized(, locale_lock)
+
+#else
+
+/* This declaration is solely to ensure that after preprocessing
+   this file is never empty.  */
+typedef int dummy;
+
+#endif
diff --git a/lib/localename-table.h b/lib/localename-table.h
new file mode 100644 (file)
index 0000000..b4377c2
--- /dev/null
@@ -0,0 +1,73 @@
+/* Table that maps a locale object to the names of the locale categories.
+   Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2018.  */
+
+#if HAVE_WORKING_USELOCALE && HAVE_NAMELESS_LOCALES
+
+# include <stddef.h>
+# include <locale.h>
+
+# ifdef IN_LIBINTL
+#  include "lock.h"
+# else
+#  include "glthread/lock.h"
+# endif
+
+struct locale_categories_names
+  {
+    /* Locale category -> name (allocated with indefinite extent).  */
+    const char *category_name[6];
+  };
+
+/* A hash table of fixed size.  Multiple threads can access it read-only
+   simultaneously, but only one thread can insert into it or remove from it
+   at the same time.
+   This hash table has global scope, so that when an application uses both
+   GNU libintl and gnulib, the application sees only one hash table.  (When
+   linking statically with libintl, the fact that localename-table.c is a
+   separate compilation unit resolves the duplicate symbol conflict.  When
+   linking with libintl as a shared library, we rely on ELF and the symbol
+   conflict resolution implemented in the ELF dynamic loader here.)
+   Both the libintl overrides and the gnulib overrides of the functions
+   newlocale, duplocale, freelocale see the same hash table (and the same lock).
+   For this reason, the internal layout of the hash table and the hash function
+   MUST NEVER CHANGE.  If you need to change the internal layout or the hash
+   function, introduce versioning by appending a version suffix to the symbols
+   at the linker level.  */
+# define locale_hash_function libintl_locale_hash_function
+# define locale_hash_table libintl_locale_hash_table
+# define locale_lock libintl_locale_lock
+
+extern size_t _GL_ATTRIBUTE_CONST locale_hash_function (locale_t x);
+
+/* A node in a hash bucket collision list.  */
+struct locale_hash_node
+  {
+    struct locale_hash_node *next;
+    locale_t locale;
+    struct locale_categories_names names;
+  };
+
+# define LOCALE_HASH_TABLE_SIZE 101
+extern struct locale_hash_node * locale_hash_table[LOCALE_HASH_TABLE_SIZE];
+
+/* This lock protects the locale_hash_table against multiple simultaneous
+   accesses (except that multiple simultaneous read accesses are allowed).  */
+
+gl_rwlock_define(extern, locale_lock)
+
+#endif
similarity index 79%
rename from tests/localename.c
rename to lib/localename.c
index 849e2d9..5e393a2 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine name of the currently selected locale.
-   Copyright (C) 1995-2016 Free Software Foundation, Inc.
+   Copyright (C) 1995-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Ulrich Drepper <drepper@gnu.org>, 1995.  */
 /* Native Windows code written by Tor Lillqvist <tml@iki.fi>.  */
 #endif
 
 #include <limits.h>
+#include <stdbool.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <locale.h>
 #include <string.h>
 
 #include "flexmember.h"
+#include "setlocale_null.h"
+#include "thread-optim.h"
 
-#if HAVE_USELOCALE
+#if HAVE_GOOD_USELOCALE
 /* Mac OS X 10.5 defines the locale_t type in <xlocale.h>.  */
 # if defined __APPLE__ && defined __MACH__
 #  include <xlocale.h>
 # endif
-# if __GLIBC__ >= 2 && !defined __UCLIBC__
+# if (__GLIBC__ >= 2 && !defined __UCLIBC__) || (defined __linux__ && HAVE_LANGINFO_H) || defined __CYGWIN__
 #  include <langinfo.h>
 # endif
 # if !defined IN_LIBINTL
 #  include "glthread/lock.h"
 # endif
-# if defined __sun && HAVE_GETLOCALENAME_L
+# if defined __sun
+#  if HAVE_GETLOCALENAME_L
 /* Solaris >= 12.  */
 extern char * getlocalename_l(int, locale_t);
+#  elif HAVE_SOLARIS114_LOCALES
+#   include <sys/localedef.h>
+#  endif
+# endif
+# if HAVE_NAMELESS_LOCALES
+#  include "localename-table.h"
 # endif
 #endif
 
-#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
+#if HAVE_CFPREFERENCESCOPYAPPVALUE
 # include <CoreFoundation/CFString.h>
-# if HAVE_CFLOCALECOPYCURRENT
-#  include <CoreFoundation/CFLocale.h>
-# elif HAVE_CFPREFERENCESCOPYAPPVALUE
-#  include <CoreFoundation/CFPreferences.h>
-# endif
+# include <CoreFoundation/CFPreferences.h>
 #endif
 
-#if defined _WIN32 || defined __WIN32__
+#if defined _WIN32 && !defined __CYGWIN__
 # define WINDOWS_NATIVE
 # if !defined IN_LIBINTL
 #  include "glthread/lock.h"
@@ -1139,11 +1145,20 @@ extern char * getlocalename_l(int, locale_t);
 # ifndef LOCALE_NAME_MAX_LENGTH
 # define LOCALE_NAME_MAX_LENGTH 85
 # endif
+/* Don't assume that UNICODE is not defined.  */
+# undef GetLocaleInfo
+# define GetLocaleInfo GetLocaleInfoA
+# undef EnumSystemLocales
+# define EnumSystemLocales EnumSystemLocalesA
 #endif
 
+/* We want to use the system's setlocale() function here, not the gnulib
+   override.  */
+#undef setlocale
 
-#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
-/* Mac OS X 10.2 or newer */
+
+#if HAVE_CFPREFERENCESCOPYAPPVALUE
+/* Mac OS X 10.4 or newer */
 
 /* Canonicalize a Mac OS X locale name to a Unix locale name.
    NAME is a sufficiently large buffer.
@@ -1157,7 +1172,7 @@ gl_locale_name_canonicalize (char *name)
 {
   /* This conversion is based on a posting by
      Deborah GoldSmith <goldsmit@apple.com> on 2005-03-08,
-     http://lists.apple.com/archives/carbon-dev/2005/Mar/msg00293.html */
+     https://lists.apple.com/archives/carbon-dev/2005/Mar/msg00293.html */
 
   /* Convert legacy (NeXTstep inherited) English names to Unix (ISO 639 and
      ISO 3166) names.  Prior to Mac OS X 10.3, there is no API for doing this.
@@ -1308,22 +1323,44 @@ gl_locale_name_canonicalize (char *name)
     /* Mac OS X has "az-Arab", "az-Cyrl", "az-Latn".
        The default script for az on Unix is Latin.  */
     { "az-Latn", "az" },
+    /* Mac OS X has "bs-Cyrl", "bs-Latn".
+       The default script for bs on Unix is Latin.  */
+    { "bs-Latn", "bs" },
     /* Mac OS X has "ga-dots".  Does not yet exist on Unix.  */
     { "ga-dots", "ga" },
-    /* Mac OS X has "kk-Cyrl".  Does not yet exist on Unix.  */
+    /* Mac OS X has "kk-Cyrl".
+       The default script for kk on Unix is Cyrillic.  */
+    { "kk-Cyrl", "kk" },
     /* Mac OS X has "mn-Cyrl", "mn-Mong".
        The default script for mn on Unix is Cyrillic.  */
     { "mn-Cyrl", "mn" },
     /* Mac OS X has "ms-Arab", "ms-Latn".
        The default script for ms on Unix is Latin.  */
     { "ms-Latn", "ms" },
+    /* Mac OS X has "pa-Arab", "pa-Guru".
+       Country codes are used to distinguish these on Unix.  */
+    { "pa-Arab", "pa_PK" },
+    { "pa-Guru", "pa_IN" },
+    /* Mac OS X has "shi-Latn", "shi-Tfng".  Does not yet exist on Unix.  */
+    /* Mac OS X has "sr-Cyrl", "sr-Latn".
+       The default script for sr on Unix is Cyrillic.  */
+    { "sr-Cyrl", "sr" },
     /* Mac OS X has "tg-Cyrl".
        The default script for tg on Unix is Cyrillic.  */
     { "tg-Cyrl", "tg" },
-    /* Mac OS X has "tk-Cyrl".  Does not yet exist on Unix.  */
+    /* Mac OS X has "tk-Cyrl".
+       The default script for tk on Unix is Cyrillic.  */
+    { "tk-Cyrl", "tk" },
     /* Mac OS X has "tt-Cyrl".
        The default script for tt on Unix is Cyrillic.  */
     { "tt-Cyrl", "tt" },
+    /* Mac OS X has "uz-Arab", "uz-Cyrl", "uz-Latn".
+       The default script for uz on Unix is Latin.  */
+    { "uz-Latn", "uz" },
+    /* Mac OS X has "vai-Latn", "vai-Vaii".  Does not yet exist on Unix.  */
+    /* Mac OS X has "yue-Hans", "yue-Hant".
+       The default script for yue on Unix is Simplified Han.  */
+    { "yue-Hans", "yue" },
     /* Mac OS X has "zh-Hans", "zh-Hant".
        Country codes are used to distinguish these on Unix.  */
     { "zh-Hans", "zh_CN" },
@@ -1331,12 +1368,13 @@ gl_locale_name_canonicalize (char *name)
   };
 
   /* Convert script names (ISO 15924) to Unix conventions.
-     See http://www.unicode.org/iso15924/iso15924-codes.html  */
+     See https://www.unicode.org/iso15924/iso15924-codes.html  */
   typedef struct { const char script[4+1]; const char unixy[9+1]; }
           script_entry;
   static const script_entry script_table[] = {
     { "Arab", "arabic" },
     { "Cyrl", "cyrillic" },
+    { "Latn", "latin" },
     { "Mong", "mongolian" }
   };
 
@@ -1492,8 +1530,8 @@ gl_locale_name_from_win32_LANGID (LANGID langid)
     sub = SUBLANGID (langid);
 
     /* Dispatch on language.
-       See also http://www.unicode.org/unicode/onlinedat/languages.html .
-       For details about languages, see http://www.ethnologue.com/ .  */
+       See also https://www.unicode.org/unicode/onlinedat/languages.html .
+       For details about languages, see https://www.ethnologue.com/ .  */
     switch (primary)
       {
       case LANG_AFRIKAANS:
@@ -2259,10 +2297,10 @@ gl_locale_name_from_win32_LANGID (LANGID langid)
           }
         return "wen";
       case LANG_SOTHO:
-        /* <http://www.microsoft.com/globaldev/reference/lcid-all.mspx> calls
-           it "Sepedi"; according to
-           <http://www.ethnologue.com/show_language.asp?code=nso>
-           <http://www.ethnologue.com/show_language.asp?code=sot>
+        /* <https://docs.microsoft.com/en-us/windows/desktop/Intl/language-identifier-constants-and-strings>
+           calls it "Sesotho sa Leboa"; according to
+           <https://www.ethnologue.com/show_language.asp?code=nso>
+           <https://www.ethnologue.com/show_language.asp?code=sot>
            it's the same as Northern Sotho.  */
         switch (sub)
           {
@@ -2526,7 +2564,7 @@ static char lname[LC_MAX * (LOCALE_NAME_MAX_LENGTH + 1) + 1];
 
 /* Callback function for EnumLocales.  */
 static BOOL CALLBACK
-enum_locales_fn (LPTSTR locale_num_str)
+enum_locales_fn (LPSTR locale_num_str)
 {
   char *endp;
   char locval[2 * LOCALE_NAME_MAX_LENGTH + 1 + 1];
@@ -2592,7 +2630,8 @@ get_lcid (const char *locale_name)
 #endif
 
 
-#if HAVE_USELOCALE /* glibc, Solaris >= 12 or Mac OS X */
+#if HAVE_GOOD_USELOCALE /* glibc, Mac OS X, FreeBSD >= 9.1, Cygwin >= 2.6,
+                           Solaris 11 OpenIndiana, or Solaris >= 11.4  */
 
 /* Simple hash set of strings.  We don't want to drag in lots of hash table
    code here.  */
@@ -2601,7 +2640,7 @@ get_lcid (const char *locale_name)
 
 /* A hash function for NUL-terminated char* strings using
    the method described by Bruno Haible.
-   See http://www.haible.de/bruno/hashfunc.html.  */
+   See https://www.haible.de/bruno/hashfunc.html.  */
 static size_t _GL_ATTRIBUTE_PURE
 string_hash (const void *x)
 {
@@ -2618,14 +2657,14 @@ string_hash (const void *x)
    simultaneously, but only one thread can insert into it at the same time.  */
 
 /* A node in a hash bucket collision list.  */
-struct hash_node
+struct struniq_hash_node
   {
-    struct hash_node * volatile next;
+    struct struniq_hash_node * volatile next;
     char contents[FLEXIBLE_ARRAY_MEMBER];
   };
 
-# define HASH_TABLE_SIZE 257
-static struct hash_node * volatile struniq_hash_table[HASH_TABLE_SIZE]
+# define STRUNIQ_HASH_TABLE_SIZE 257
+static struct struniq_hash_node * volatile struniq_hash_table[STRUNIQ_HASH_TABLE_SIZE]
   /* = { NULL, ..., NULL } */;
 
 /* This lock protects the struniq_hash_table against multiple simultaneous
@@ -2638,46 +2677,425 @@ static const char *
 struniq (const char *string)
 {
   size_t hashcode = string_hash (string);
-  size_t slot = hashcode % HASH_TABLE_SIZE;
+  size_t slot = hashcode % STRUNIQ_HASH_TABLE_SIZE;
   size_t size;
-  struct hash_node *new_node;
-  struct hash_node *p;
+  struct struniq_hash_node *new_node;
+  struct struniq_hash_node *p;
   for (p = struniq_hash_table[slot]; p != NULL; p = p->next)
     if (strcmp (p->contents, string) == 0)
       return p->contents;
   size = strlen (string) + 1;
   new_node =
-    (struct hash_node *)
-    malloc (FLEXSIZEOF (struct hash_node, contents, size));
+    (struct struniq_hash_node *)
+    malloc (FLEXSIZEOF (struct struniq_hash_node, contents, size));
   if (new_node == NULL)
     /* Out of memory.  Return a statically allocated string.  */
     return "C";
   memcpy (new_node->contents, string, size);
-  /* Lock while inserting new_node.  */
-  gl_lock_lock (struniq_lock);
-  /* Check whether another thread already added the string while we were
-     waiting on the lock.  */
-  for (p = struniq_hash_table[slot]; p != NULL; p = p->next)
-    if (strcmp (p->contents, string) == 0)
+  {
+    bool mt = gl_multithreaded ();
+    /* Lock while inserting new_node.  */
+    if (mt) gl_lock_lock (struniq_lock);
+    /* Check whether another thread already added the string while we were
+       waiting on the lock.  */
+    for (p = struniq_hash_table[slot]; p != NULL; p = p->next)
+      if (strcmp (p->contents, string) == 0)
+        {
+          free (new_node);
+          new_node = p;
+          goto done;
+        }
+    /* Really insert new_node into the hash table.  Fill new_node entirely
+       first, because other threads may be iterating over the linked list.  */
+    new_node->next = struniq_hash_table[slot];
+    struniq_hash_table[slot] = new_node;
+   done:
+    /* Unlock after new_node is inserted.  */
+    if (mt) gl_lock_unlock (struniq_lock);
+  }
+  return new_node->contents;
+}
+
+#endif
+
+
+#if LOCALENAME_ENHANCE_LOCALE_FUNCS
+
+/* The 'locale_t' object does not contain the names of the locale categories.
+   We have to associate them with the object through a hash table.
+   The hash table is defined in localename-table.[hc].  */
+
+/* Returns the name of a given locale category in a given locale_t object,
+   allocated as a string with indefinite extent.  */
+static const char *
+get_locale_t_name (int category, locale_t locale)
+{
+  if (locale == LC_GLOBAL_LOCALE)
+    {
+      /* Query the global locale.  */
+      const char *name = setlocale_null (category);
+      if (name != NULL)
+        return struniq (name);
+      else
+        /* Should normally not happen.  */
+        return "";
+    }
+  else
+    {
+      /* Look up the names in the hash table.  */
+      size_t hashcode = locale_hash_function (locale);
+      size_t slot = hashcode % LOCALE_HASH_TABLE_SIZE;
+      /* If the locale was not found in the table, return "".  This can
+         happen if the application uses the original newlocale()/duplocale()
+         functions instead of the overridden ones.  */
+      const char *name = "";
+      struct locale_hash_node *p;
+      /* Lock while looking up the hash node.  */
+      gl_rwlock_rdlock (locale_lock);
+      for (p = locale_hash_table[slot]; p != NULL; p = p->next)
+        if (p->locale == locale)
+          {
+            name = p->names.category_name[category];
+            break;
+          }
+      gl_rwlock_unlock (locale_lock);
+      return name;
+    }
+}
+
+# if !(defined newlocale && defined duplocale && defined freelocale)
+#  error "newlocale, duplocale, freelocale not being replaced as expected!"
+# endif
+
+/* newlocale() override.  */
+locale_t
+newlocale (int category_mask, const char *name, locale_t base)
+#undef newlocale
+{
+  struct locale_categories_names names;
+  struct locale_hash_node *node;
+  locale_t result;
+
+  /* Make sure name has indefinite extent.  */
+  if (((LC_CTYPE_MASK | LC_NUMERIC_MASK | LC_TIME_MASK | LC_COLLATE_MASK
+        | LC_MONETARY_MASK | LC_MESSAGES_MASK)
+       & category_mask) != 0)
+    name = struniq (name);
+
+  /* Determine the category names of the result.  */
+  if (((LC_CTYPE_MASK | LC_NUMERIC_MASK | LC_TIME_MASK | LC_COLLATE_MASK
+        | LC_MONETARY_MASK | LC_MESSAGES_MASK)
+       & ~category_mask) == 0)
+    {
+      /* Use name, ignore base.  */
+      int category;
+
+      name = struniq (name);
+      for (category = 0; category < 6; category++)
+        names.category_name[category] = name;
+    }
+  else
+    {
+      /* Use base, possibly also name.  */
+      if (base == NULL)
+        {
+          int category;
+
+          for (category = 0; category < 6; category++)
+            {
+              int mask;
+
+              switch (category)
+                {
+                case LC_CTYPE:
+                  mask = LC_CTYPE_MASK;
+                  break;
+                case LC_NUMERIC:
+                  mask = LC_NUMERIC_MASK;
+                  break;
+                case LC_TIME:
+                  mask = LC_TIME_MASK;
+                  break;
+                case LC_COLLATE:
+                  mask = LC_COLLATE_MASK;
+                  break;
+                case LC_MONETARY:
+                  mask = LC_MONETARY_MASK;
+                  break;
+                case LC_MESSAGES:
+                  mask = LC_MESSAGES_MASK;
+                  break;
+                default:
+                  abort ();
+                }
+              names.category_name[category] =
+                ((mask & category_mask) != 0 ? name : "C");
+            }
+        }
+      else if (base == LC_GLOBAL_LOCALE)
+        {
+          int category;
+
+          for (category = 0; category < 6; category++)
+            {
+              int mask;
+
+              switch (category)
+                {
+                case LC_CTYPE:
+                  mask = LC_CTYPE_MASK;
+                  break;
+                case LC_NUMERIC:
+                  mask = LC_NUMERIC_MASK;
+                  break;
+                case LC_TIME:
+                  mask = LC_TIME_MASK;
+                  break;
+                case LC_COLLATE:
+                  mask = LC_COLLATE_MASK;
+                  break;
+                case LC_MONETARY:
+                  mask = LC_MONETARY_MASK;
+                  break;
+                case LC_MESSAGES:
+                  mask = LC_MESSAGES_MASK;
+                  break;
+                default:
+                  abort ();
+                }
+              names.category_name[category] =
+                ((mask & category_mask) != 0
+                 ? name
+                 : get_locale_t_name (category, LC_GLOBAL_LOCALE));
+            }
+        }
+      else
+        {
+          /* Look up the names of base in the hash table.  Like multiple calls
+             of get_locale_t_name, but locking only once.  */
+          struct locale_hash_node *p;
+          int category;
+
+          /* Lock while looking up the hash node.  */
+          gl_rwlock_rdlock (locale_lock);
+          for (p = locale_hash_table[locale_hash_function (base) % LOCALE_HASH_TABLE_SIZE];
+               p != NULL;
+               p = p->next)
+            if (p->locale == base)
+              break;
+
+          for (category = 0; category < 6; category++)
+            {
+              int mask;
+
+              switch (category)
+                {
+                case LC_CTYPE:
+                  mask = LC_CTYPE_MASK;
+                  break;
+                case LC_NUMERIC:
+                  mask = LC_NUMERIC_MASK;
+                  break;
+                case LC_TIME:
+                  mask = LC_TIME_MASK;
+                  break;
+                case LC_COLLATE:
+                  mask = LC_COLLATE_MASK;
+                  break;
+                case LC_MONETARY:
+                  mask = LC_MONETARY_MASK;
+                  break;
+                case LC_MESSAGES:
+                  mask = LC_MESSAGES_MASK;
+                  break;
+                default:
+                  abort ();
+                }
+              names.category_name[category] =
+                ((mask & category_mask) != 0
+                 ? name
+                 : (p != NULL ? p->names.category_name[category] : ""));
+            }
+
+          gl_rwlock_unlock (locale_lock);
+        }
+    }
+
+  node = (struct locale_hash_node *) malloc (sizeof (struct locale_hash_node));
+  if (node == NULL)
+    /* errno is set to ENOMEM.  */
+    return NULL;
+
+  result = newlocale (category_mask, name, base);
+  if (result == NULL)
+    {
+      free (node);
+      return NULL;
+    }
+
+  /* Fill the hash node.  */
+  node->locale = result;
+  node->names = names;
+
+  /* Insert it in the hash table.  */
+  {
+    size_t hashcode = locale_hash_function (result);
+    size_t slot = hashcode % LOCALE_HASH_TABLE_SIZE;
+    struct locale_hash_node *p;
+
+    /* Lock while inserting the new node.  */
+    gl_rwlock_wrlock (locale_lock);
+    for (p = locale_hash_table[slot]; p != NULL; p = p->next)
+      if (p->locale == result)
+        {
+          /* This can happen if the application uses the original freelocale()
+             function instead of the overridden one.  */
+          p->names = node->names;
+          break;
+        }
+    if (p == NULL)
       {
-        free (new_node);
-        new_node = p;
-        goto done;
+        node->next = locale_hash_table[slot];
+        locale_hash_table[slot] = node;
       }
-  /* Really insert new_node into the hash table.  Fill new_node entirely first,
-     because other threads may be iterating over the linked list.  */
-  new_node->next = struniq_hash_table[slot];
-  struniq_hash_table[slot] = new_node;
- done:
-  /* Unlock after new_node is inserted.  */
-  gl_lock_unlock (struniq_lock);
-  return new_node->contents;
+
+    gl_rwlock_unlock (locale_lock);
+
+    if (p != NULL)
+      free (node);
+  }
+
+  return result;
+}
+
+/* duplocale() override.  */
+locale_t
+duplocale (locale_t locale)
+#undef duplocale
+{
+  struct locale_hash_node *node;
+  locale_t result;
+
+  if (locale == NULL)
+    /* Invalid argument.  */
+    abort ();
+
+  node = (struct locale_hash_node *) malloc (sizeof (struct locale_hash_node));
+  if (node == NULL)
+    /* errno is set to ENOMEM.  */
+    return NULL;
+
+  result = duplocale (locale);
+  if (result == NULL)
+    {
+      free (node);
+      return NULL;
+    }
+
+  /* Fill the hash node.  */
+  node->locale = result;
+  if (locale == LC_GLOBAL_LOCALE)
+    {
+      int category;
+
+      for (category = 0; category < 6; category++)
+        node->names.category_name[category] =
+          get_locale_t_name (category, LC_GLOBAL_LOCALE);
+
+      /* Lock before inserting the new node.  */
+      gl_rwlock_wrlock (locale_lock);
+    }
+  else
+    {
+      struct locale_hash_node *p;
+
+      /* Lock once, for the lookup and the insertion.  */
+      gl_rwlock_wrlock (locale_lock);
+
+      for (p = locale_hash_table[locale_hash_function (locale) % LOCALE_HASH_TABLE_SIZE];
+           p != NULL;
+           p = p->next)
+        if (p->locale == locale)
+          break;
+      if (p != NULL)
+        node->names = p->names;
+      else
+        {
+          /* This can happen if the application uses the original
+             newlocale()/duplocale() functions instead of the overridden
+             ones.  */
+          int category;
+
+          for (category = 0; category < 6; category++)
+            node->names.category_name[category] = "";
+        }
+    }
+
+  /* Insert it in the hash table.  */
+  {
+    size_t hashcode = locale_hash_function (result);
+    size_t slot = hashcode % LOCALE_HASH_TABLE_SIZE;
+    struct locale_hash_node *p;
+
+    for (p = locale_hash_table[slot]; p != NULL; p = p->next)
+      if (p->locale == result)
+        {
+          /* This can happen if the application uses the original freelocale()
+             function instead of the overridden one.  */
+          p->names = node->names;
+          break;
+        }
+    if (p == NULL)
+      {
+        node->next = locale_hash_table[slot];
+        locale_hash_table[slot] = node;
+      }
+
+    gl_rwlock_unlock (locale_lock);
+
+    if (p != NULL)
+      free (node);
+  }
+
+  return result;
+}
+
+/* freelocale() override.  */
+void
+freelocale (locale_t locale)
+#undef freelocale
+{
+  if (locale == NULL || locale == LC_GLOBAL_LOCALE)
+    /* Invalid argument.  */
+    abort ();
+
+  {
+    size_t hashcode = locale_hash_function (locale);
+    size_t slot = hashcode % LOCALE_HASH_TABLE_SIZE;
+    struct locale_hash_node *found;
+    struct locale_hash_node **p;
+
+    found = NULL;
+    /* Lock while removing the hash node.  */
+    gl_rwlock_wrlock (locale_lock);
+    for (p = &locale_hash_table[slot]; *p != NULL; p = &(*p)->next)
+      if ((*p)->locale == locale)
+        {
+          found = *p;
+          *p = (*p)->next;
+          break;
+        }
+    gl_rwlock_unlock (locale_lock);
+    free (found);
+  }
+
+  freelocale (locale);
 }
 
 #endif
 
 
-#if defined IN_LIBINTL || HAVE_USELOCALE
+#if defined IN_LIBINTL || HAVE_GOOD_USELOCALE
 
 /* Like gl_locale_name_thread, except that the result is not in storage of
    indefinite extent.  */
@@ -2685,9 +3103,9 @@ struniq (const char *string)
 static
 # endif
 const char *
-gl_locale_name_thread_unsafe (int category, const char *categoryname)
+gl_locale_name_thread_unsafe (int category, const char *categoryname _GL_UNUSED)
 {
-# if HAVE_USELOCALE
+# if HAVE_GOOD_USELOCALE
   {
     locale_t thread_locale = uselocale (NULL);
     if (thread_locale != LC_GLOBAL_LOCALE)
@@ -2695,7 +3113,7 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
 #  if __GLIBC__ >= 2 && !defined __UCLIBC__
         /* Work around an incorrect definition of the _NL_LOCALE_NAME macro in
            glibc < 2.12.
-           See <http://sourceware.org/bugzilla/show_bug.cgi?id=10968>.  */
+           See <https://sourceware.org/bugzilla/show_bug.cgi?id=10968>.  */
         const char *name =
           nl_langinfo (_NL_ITEM ((category), _NL_ITEM_INDEX (-1)));
         if (name[0] == '\0')
@@ -2703,7 +3121,10 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
              nl_langinfo (_NL_LOCALE_NAME (category)).  */
           name = thread_locale->__names[category];
         return name;
-#  elif defined __FreeBSD__ || (defined __APPLE__ && defined __MACH__)
+#  elif defined __linux__ && HAVE_LANGINFO_H && defined NL_LOCALE_NAME
+        /* musl libc */
+        return nl_langinfo_l (NL_LOCALE_NAME (category), thread_locale);
+#  elif (defined __FreeBSD__ || defined __DragonFly__) || (defined __APPLE__ && defined __MACH__)
         /* FreeBSD, Mac OS X */
         int mask;
 
@@ -2731,9 +3152,60 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
             return "";
           }
         return querylocale (mask, thread_locale);
-#  elif defined __sun && HAVE_GETLOCALENAME_L
+#  elif defined __sun
+#   if HAVE_GETLOCALENAME_L
         /* Solaris >= 12.  */
         return getlocalename_l (category, thread_locale);
+#   elif HAVE_SOLARIS114_LOCALES
+        /* Solaris >= 11.4.  */
+        void *lcp = (*thread_locale)->core.data->lcp;
+        if (lcp != NULL)
+          switch (category)
+            {
+            case LC_CTYPE:
+            case LC_NUMERIC:
+            case LC_TIME:
+            case LC_COLLATE:
+            case LC_MONETARY:
+            case LC_MESSAGES:
+              return ((const char * const *) lcp)[category];
+            default: /* We shouldn't get here.  */
+              return "";
+            }
+#   elif HAVE_NAMELESS_LOCALES
+        return get_locale_t_name (category, thread_locale);
+#   else
+        /* Solaris 11 OpenIndiana.
+           For the internal structure of locale objects, see
+           https://github.com/OpenIndiana/illumos-gate/blob/master/usr/src/lib/libc/port/locale/localeimpl.h  */
+        switch (category)
+          {
+          case LC_CTYPE:
+          case LC_NUMERIC:
+          case LC_TIME:
+          case LC_COLLATE:
+          case LC_MONETARY:
+          case LC_MESSAGES:
+            return ((const char * const *) thread_locale)[category];
+          default: /* We shouldn't get here.  */
+            return "";
+          }
+#   endif
+#  elif defined _AIX && HAVE_NAMELESS_LOCALES
+        return get_locale_t_name (category, thread_locale);
+#  elif defined __CYGWIN__
+        /* Cygwin < 2.6 lacks uselocale and thread-local locales altogether.
+           Cygwin <= 2.6.1 lacks NL_LOCALE_NAME, requiring peeking inside
+           an opaque struct.  */
+#   ifdef NL_LOCALE_NAME
+        return nl_langinfo_l (NL_LOCALE_NAME (category), thread_locale);
+#   else
+        /* FIXME: Remove when we can assume new-enough Cygwin.  */
+        struct __locale_t {
+          char categories[7][32];
+        };
+        return ((struct __locale_t *) thread_locale)->categories[category];
+#   endif
 #  elif defined __ANDROID__
         return MB_CUR_MAX == 4 ? "C.UTF-8" : "C";
 #  endif
@@ -2746,34 +3218,16 @@ gl_locale_name_thread_unsafe (int category, const char *categoryname)
 #endif
 
 const char *
-gl_locale_name_thread (int category, const char *categoryname)
+gl_locale_name_thread (int category, const char *categoryname _GL_UNUSED)
 {
-#if HAVE_USELOCALE
+#if HAVE_GOOD_USELOCALE
   const char *name = gl_locale_name_thread_unsafe (category, categoryname);
   if (name != NULL)
     return struniq (name);
-#elif defined WINDOWS_NATIVE
-  if (LC_MIN <= category && category <= LC_MAX)
-    {
-      char *locname = setlocale (category, NULL);
-      LCID lcid = 0;
-
-      /* If CATEGORY is LC_ALL, the result might be a semi-colon
-        separated list of locales.  We need only one, so we take the
-        one corresponding to LC_CTYPE, as the most important for
-        character translations.  */
-      if (strchr (locname, ';'))
-       locname = setlocale (LC_CTYPE, NULL);
-
-      /* Convert locale name to LCID.  We don't want to use
-         LocaleNameToLCID because (a) it is only available since Vista,
-         and (b) it doesn't accept locale names returned by 'setlocale'.  */
-      lcid = get_lcid (locname);
-
-      if (lcid > 0)
-        return gl_locale_name_from_win32_LCID (lcid);
-    }
 #endif
+  /* On WINDOWS_NATIVE, don't use GetThreadLocale() here, because when
+     SetThreadLocale has not been called - which is a very frequent case -
+     the value of GetThreadLocale() ignores past calls to 'setlocale'.  */
   return NULL;
 }
 
@@ -2788,36 +3242,72 @@ gl_locale_name_thread (int category, const char *categoryname)
 #endif
 
 const char *
-gl_locale_name_posix (int category, const char *categoryname)
+gl_locale_name_posix (int category, const char *categoryname _GL_UNUSED)
 {
-  /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
-     On some systems this can be done by the 'setlocale' function itself.  */
-#if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
-  return setlocale (category, NULL);
+#if defined WINDOWS_NATIVE
+  if (LC_MIN <= category && category <= LC_MAX)
+    {
+      const char *locname =
+        /* setlocale_null (category) is identical to setlocale (category, NULL)
+           on this platform.  */
+        setlocale (category, NULL);
+
+      /* Convert locale name to LCID.  We don't want to use
+         LocaleNameToLCID because (a) it is only available since Vista,
+         and (b) it doesn't accept locale names returned by 'setlocale'.  */
+      LCID lcid = get_lcid (locname);
+
+      if (lcid > 0)
+        return gl_locale_name_from_win32_LCID (lcid);
+    }
+#endif
+  {
+    const char *locname;
+
+    /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
+       On some systems this can be done by the 'setlocale' function itself.  */
+#if defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
+    locname = setlocale_null (category);
 #else
-  /* On other systems we ignore what setlocale reports and instead look at the
-     environment variables directly.  This is necessary
-       1. on systems which have a facility for customizing the default locale
-          (Mac OS X, native Windows, Cygwin) and where the system's setlocale()
-          function ignores this default locale (Mac OS X, Cygwin), in two cases:
-          a. when the user missed to use the setlocale() override from libintl
-             (for example by not including <libintl.h>),
-          b. when setlocale supports only the "C" locale, such as on Cygwin
-             1.5.x.  In this case even the override from libintl cannot help.
-       2. on all systems where setlocale supports only the "C" locale.  */
-  /* Strictly speaking, it is a POSIX violation to look at the environment
-     variables regardless whether setlocale has been called or not.  POSIX
-     says:
-         "For C-language programs, the POSIX locale shall be the
-          default locale when the setlocale() function is not called."
-     But we assume that all programs that use internationalized APIs call
-     setlocale (LC_ALL, "").  */
-  return gl_locale_name_environ (category, categoryname);
+    /* On other systems we ignore what setlocale reports and instead look at the
+       environment variables directly.  This is necessary
+         1. on systems which have a facility for customizing the default locale
+            (Mac OS X, native Windows, Cygwin) and where the system's setlocale()
+            function ignores this default locale (Mac OS X, Cygwin), in two cases:
+            a. when the user missed to use the setlocale() override from libintl
+               (for example by not including <libintl.h>),
+            b. when setlocale supports only the "C" locale, such as on Cygwin
+               1.5.x.  In this case even the override from libintl cannot help.
+         2. on all systems where setlocale supports only the "C" locale.  */
+    /* Strictly speaking, it is a POSIX violation to look at the environment
+       variables regardless whether setlocale has been called or not.  POSIX
+       says:
+           "For C-language programs, the POSIX locale shall be the
+            default locale when the setlocale() function is not called."
+       But we assume that all programs that use internationalized APIs call
+       setlocale (LC_ALL, "").  */
+    locname = gl_locale_name_environ (category, categoryname);
+#endif
+    /* Convert the locale name from the format returned by setlocale() or found
+       in the environment variables to the XPG syntax.  */
+#if defined WINDOWS_NATIVE
+    if (locname != NULL)
+      {
+        /* Convert locale name to LCID.  We don't want to use
+           LocaleNameToLCID because (a) it is only available since Vista,
+           and (b) it doesn't accept locale names returned by 'setlocale'.  */
+        LCID lcid = get_lcid (locname);
+
+        if (lcid > 0)
+          return gl_locale_name_from_win32_LCID (lcid);
+      }
 #endif
+    return locname;
+  }
 }
 
 const char *
-gl_locale_name_environ (int category, const char *categoryname)
+gl_locale_name_environ (int category _GL_UNUSED, const char *categoryname)
 {
   const char *retval;
 
@@ -2833,7 +3323,7 @@ gl_locale_name_environ (int category, const char *categoryname)
   retval = getenv ("LANG");
   if (retval != NULL && retval[0] != '\0')
     {
-#if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
+#if HAVE_CFPREFERENCESCOPYAPPVALUE
       /* Mac OS X 10.2 or newer.
          Ignore invalid LANG value set by the Terminal application.  */
       if (strcmp (retval, "UTF-8") != 0)
@@ -2880,7 +3370,7 @@ gl_locale_name_default (void)
          "C.UTF-8" locale, which operates in the same way as the "C" locale.
   */
 
-#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE || defined WINDOWS_NATIVE || defined __CYGWIN__)
+#if !(HAVE_CFPREFERENCESCOPYAPPVALUE || defined WINDOWS_NATIVE || defined __CYGWIN__)
 
   /* The system does not have a way of setting the locale, other than the
      POSIX specified environment variables.  We use C as default locale.  */
@@ -2893,8 +3383,17 @@ gl_locale_name_default (void)
      context, because message catalogs are not specific to a single
      codeset.  */
 
-# if HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE
-  /* Mac OS X 10.2 or newer */
+# if HAVE_CFPREFERENCESCOPYAPPVALUE
+  /* Mac OS X 10.4 or newer */
+  /* Don't use the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
+     because in macOS 10.13.4 it has the following behaviour:
+     When two or more languages are specified in the
+     "System Preferences > Language & Region > Preferred Languages" panel,
+     it returns en_CC where CC is the territory (even when English is not among
+     the preferred languages!).  What we want instead is what
+     CFLocaleCopyCurrent returned in earlier macOS releases and what
+     CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
+     first among the preferred languages and CC is the territory.  */
   {
     /* Cache the locale name, since CoreFoundation calls are expensive.  */
     static const char *cached_localename;
@@ -2902,31 +3401,20 @@ gl_locale_name_default (void)
     if (cached_localename == NULL)
       {
         char namebuf[256];
-#  if HAVE_CFLOCALECOPYCURRENT /* Mac OS X 10.3 or newer */
-        CFLocaleRef locale = CFLocaleCopyCurrent ();
-        CFStringRef name = CFLocaleGetIdentifier (locale);
-
-        if (CFStringGetCString (name, namebuf, sizeof (namebuf),
-                                kCFStringEncodingASCII))
-          {
-            gl_locale_name_canonicalize (namebuf);
-            cached_localename = strdup (namebuf);
-          }
-        CFRelease (locale);
-#  elif HAVE_CFPREFERENCESCOPYAPPVALUE /* Mac OS X 10.2 or newer */
         CFTypeRef value =
           CFPreferencesCopyAppValue (CFSTR ("AppleLocale"),
                                      kCFPreferencesCurrentApplication);
-        if (value != NULL
-            && CFGetTypeID (value) == CFStringGetTypeID ()
-            && CFStringGetCString ((CFStringRef)value,
-                                   namebuf, sizeof (namebuf),
-                                   kCFStringEncodingASCII))
+        if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ())
           {
-            gl_locale_name_canonicalize (namebuf);
-            cached_localename = strdup (namebuf);
+            CFStringRef name = (CFStringRef)value;
+
+            if (CFStringGetCString (name, namebuf, sizeof (namebuf),
+                                    kCFStringEncodingASCII))
+              {
+                gl_locale_name_canonicalize (namebuf);
+                cached_localename = strdup (namebuf);
+              }
           }
-#  endif
         if (cached_localename == NULL)
           cached_localename = "C";
       }
similarity index 94%
rename from tests/localename.h
rename to lib/localename.h
index 17f0d85..dab1d0b 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine name of the currently selected locale.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_LOCALENAME_H
 #define _GL_LOCALENAME_H
@@ -86,8 +86,7 @@ extern const char * gl_locale_name_environ (int category, const char *categoryna
 
    The result must not be freed; it is statically allocated.  */
 extern const char * gl_locale_name_default (void)
-#if !(HAVE_CFLOCALECOPYCURRENT || HAVE_CFPREFERENCESCOPYAPPVALUE \
-      || defined _WIN32 || defined __WIN32__ || defined __CYGWIN__)
+#if !(HAVE_CFPREFERENCESCOPYAPPVALUE || defined _WIN32 || defined __CYGWIN__)
   _GL_ATTRIBUTE_CONST
 #endif
   ;
index 2a95a07..5727ce8 100644 (file)
@@ -1,5 +1,5 @@
 /* An lseek() function that detects pipes.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 /* Specification.  */
 #include <unistd.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Windows platforms.  */
 /* Get GetFileType.  */
 # include <windows.h>
 /* Get _get_osfhandle.  */
-# include "msvc-nothrow.h"
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
 #else
 # include <sys/stat.h>
 #endif
@@ -35,7 +39,7 @@
 off_t
 rpl_lseek (int fd, off_t offset, int whence)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* mingw lseek mistakenly succeeds on pipes, sockets, and terminals.  */
   HANDLE h = (HANDLE) _get_osfhandle (fd);
   if (h == INVALID_HANDLE_VALUE)
@@ -59,7 +63,7 @@ rpl_lseek (int fd, off_t offset, int whence)
       return -1;
     }
 #endif
-#if _GL_WINDOWS_64_BIT_OFF_T
+#if _GL_WINDOWS_64_BIT_OFF_T || (defined __MINGW32__ && defined _FILE_OFFSET_BITS && (_FILE_OFFSET_BITS == 64))
   return _lseeki64 (fd, offset, whence);
 #else
   return lseek (fd, offset, whence);
index 03b0634..a584c6a 100644 (file)
@@ -1,6 +1,6 @@
 /* Work around a bug of lstat on some systems
 
-   Copyright (C) 1997-2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 1997-2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* written by Jim Meyering */
 
@@ -42,10 +42,16 @@ orig_lstat (const char *filename, struct stat *buf)
 }
 
 /* Specification.  */
+# ifdef __osf__
 /* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
    eliminates this include because of the preliminary #include <sys/stat.h>
    above.  */
-# include "sys/stat.h"
+#  include "sys/stat.h"
+# else
+#  include <sys/stat.h>
+# endif
+
+# include "stat-time.h"
 
 # include <string.h>
 # include <errno.h>
@@ -66,32 +72,33 @@ orig_lstat (const char *filename, struct stat *buf)
 int
 rpl_lstat (const char *file, struct stat *sbuf)
 {
-  size_t len;
-  int lstat_result = orig_lstat (file, sbuf);
-
-  if (lstat_result != 0)
-    return lstat_result;
+  int result = orig_lstat (file, sbuf);
 
   /* This replacement file can blindly check against '/' rather than
      using the ISSLASH macro, because all platforms with '\\' either
      lack symlinks (mingw) or have working lstat (cygwin) and thus do
      not compile this file.  0 len should have already been filtered
      out above, with a failure return of ENOENT.  */
-  len = strlen (file);
-  if (file[len - 1] != '/' || S_ISDIR (sbuf->st_mode))
-    return 0;
-
-  /* At this point, a trailing slash is only permitted on
-     symlink-to-dir; but it should have found information on the
-     directory, not the symlink.  Call stat() to get info about the
-     link's referent.  Our replacement stat guarantees valid results,
-     even if the symlink is not pointing to a directory.  */
-  if (!S_ISLNK (sbuf->st_mode))
+  if (result == 0)
     {
-      errno = ENOTDIR;
-      return -1;
+      if (S_ISDIR (sbuf->st_mode) || file[strlen (file) - 1] != '/')
+        result = stat_time_normalize (result, sbuf);
+      else
+        {
+          /* At this point, a trailing slash is permitted only on
+             symlink-to-dir; but it should have found information on the
+             directory, not the symlink.  Call 'stat' to get info about the
+             link's referent.  Our replacement stat guarantees valid results,
+             even if the symlink is not pointing to a directory.  */
+          if (!S_ISLNK (sbuf->st_mode))
+            {
+              errno = ENOTDIR;
+              return -1;
+            }
+          result = stat (file, sbuf);
+        }
     }
-  return stat (file, sbuf);
+  return result;
 }
 
 #endif /* HAVE_LSTAT */
index e9b01d2..95d98f2 100644 (file)
@@ -1,6 +1,6 @@
 /* malloc() function that is glibc compatible.
 
-   Copyright (C) 1997-1998, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1997-1998, 2006-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* written by Jim Meyering and Bruno Haible */
 
 #define _GL_USE_STDLIB_ALLOC 1
 #include <config.h>
-/* Only the AC_FUNC_MALLOC macro defines 'malloc' already in config.h.  */
-#ifdef malloc
-# define NEED_MALLOC_GNU 1
-# undef malloc
-/* Whereas the gnulib module 'malloc-gnu' defines HAVE_MALLOC_GNU.  */
-#elif GNULIB_MALLOC_GNU && !HAVE_MALLOC_GNU
-# define NEED_MALLOC_GNU 1
-#endif
 
 #include <stdlib.h>
 
 #include <errno.h>
 
-/* Allocate an N-byte block of memory from the heap.
-   If N is zero, allocate a 1-byte block.  */
+#include "xalloc-oversized.h"
+
+/* Allocate an N-byte block of memory from the heap, even if N is 0.  */
 
 void *
 rpl_malloc (size_t n)
 {
-  void *result;
-
-#if NEED_MALLOC_GNU
   if (n == 0)
     n = 1;
-#endif
 
-  result = malloc (n);
+  if (xalloc_oversized (n, 1))
+    {
+      errno = ENOMEM;
+      return NULL;
+    }
+
+  void *result = malloc (n);
 
 #if !HAVE_MALLOC_POSIX
   if (result == NULL)
diff --git a/lib/malloc/dynarray-skeleton.c b/lib/malloc/dynarray-skeleton.c
new file mode 100644 (file)
index 0000000..de65653
--- /dev/null
@@ -0,0 +1,528 @@
+/* Type-safe arrays which grow dynamically.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* Pre-processor macros which act as parameters:
+
+   DYNARRAY_STRUCT
+      The struct tag of dynamic array to be defined.
+   DYNARRAY_ELEMENT
+      The type name of the element type.  Elements are copied
+      as if by memcpy, and can change address as the dynamic
+      array grows.
+   DYNARRAY_PREFIX
+      The prefix of the functions which are defined.
+
+   The following parameters are optional:
+
+   DYNARRAY_ELEMENT_FREE
+      DYNARRAY_ELEMENT_FREE (E) is evaluated to deallocate the
+      contents of elements. E is of type  DYNARRAY_ELEMENT *.
+   DYNARRAY_ELEMENT_INIT
+      DYNARRAY_ELEMENT_INIT (E) is evaluated to initialize a new
+      element.  E is of type  DYNARRAY_ELEMENT *.
+      If DYNARRAY_ELEMENT_FREE but not DYNARRAY_ELEMENT_INIT is
+      defined, new elements are automatically zero-initialized.
+      Otherwise, new elements have undefined contents.
+   DYNARRAY_INITIAL_SIZE
+      The size of the statically allocated array (default:
+      at least 2, more elements if they fit into 128 bytes).
+      Must be a preprocessor constant.  If DYNARRAY_INITIAL_SIZE is 0,
+      there is no statically allocated array at, and all non-empty
+      arrays are heap-allocated.
+   DYNARRAY_FINAL_TYPE
+      The name of the type which holds the final array.  If not
+      defined, is PREFIX##finalize not provided.  DYNARRAY_FINAL_TYPE
+      must be a struct type, with members of type DYNARRAY_ELEMENT and
+      size_t at the start (in this order).
+
+   These macros are undefined after this header file has been
+   included.
+
+   The following types are provided (their members are private to the
+   dynarray implementation):
+
+     struct DYNARRAY_STRUCT
+
+   The following functions are provided:
+
+     void DYNARRAY_PREFIX##init (struct DYNARRAY_STRUCT *);
+     void DYNARRAY_PREFIX##free (struct DYNARRAY_STRUCT *);
+     bool DYNARRAY_PREFIX##has_failed (const struct DYNARRAY_STRUCT *);
+     void DYNARRAY_PREFIX##mark_failed (struct DYNARRAY_STRUCT *);
+     size_t DYNARRAY_PREFIX##size (const struct DYNARRAY_STRUCT *);
+     DYNARRAY_ELEMENT *DYNARRAY_PREFIX##begin (const struct DYNARRAY_STRUCT *);
+     DYNARRAY_ELEMENT *DYNARRAY_PREFIX##end (const struct DYNARRAY_STRUCT *);
+     DYNARRAY_ELEMENT *DYNARRAY_PREFIX##at (struct DYNARRAY_STRUCT *, size_t);
+     void DYNARRAY_PREFIX##add (struct DYNARRAY_STRUCT *, DYNARRAY_ELEMENT);
+     DYNARRAY_ELEMENT *DYNARRAY_PREFIX##emplace (struct DYNARRAY_STRUCT *);
+     bool DYNARRAY_PREFIX##resize (struct DYNARRAY_STRUCT *, size_t);
+     void DYNARRAY_PREFIX##remove_last (struct DYNARRAY_STRUCT *);
+     void DYNARRAY_PREFIX##clear (struct DYNARRAY_STRUCT *);
+
+   The following functions are provided are provided if the
+   prerequisites are met:
+
+     bool DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *,
+                                     DYNARRAY_FINAL_TYPE *);
+       (if DYNARRAY_FINAL_TYPE is defined)
+     DYNARRAY_ELEMENT *DYNARRAY_PREFIX##finalize (struct DYNARRAY_STRUCT *,
+                                                  size_t *);
+       (if DYNARRAY_FINAL_TYPE is not defined)
+*/
+
+#include <malloc/dynarray.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#ifndef DYNARRAY_STRUCT
+# error "DYNARRAY_STRUCT must be defined"
+#endif
+
+#ifndef DYNARRAY_ELEMENT
+# error "DYNARRAY_ELEMENT must be defined"
+#endif
+
+#ifndef DYNARRAY_PREFIX
+# error "DYNARRAY_PREFIX must be defined"
+#endif
+
+#ifdef DYNARRAY_INITIAL_SIZE
+# if DYNARRAY_INITIAL_SIZE < 0
+#  error "DYNARRAY_INITIAL_SIZE must be non-negative"
+# endif
+# if DYNARRAY_INITIAL_SIZE > 0
+#  define DYNARRAY_HAVE_SCRATCH 1
+# else
+#  define DYNARRAY_HAVE_SCRATCH 0
+# endif
+#else
+/* Provide a reasonable default which limits the size of
+   DYNARRAY_STRUCT.  */
+# define DYNARRAY_INITIAL_SIZE \
+  (sizeof (DYNARRAY_ELEMENT) > 64 ? 2 : 128 / sizeof (DYNARRAY_ELEMENT))
+# define DYNARRAY_HAVE_SCRATCH 1
+#endif
+
+/* Public type definitions.  */
+
+/* All fields of this struct are private to the implementation.  */
+struct DYNARRAY_STRUCT
+{
+  union
+  {
+    struct dynarray_header dynarray_abstract;
+    struct
+    {
+      /* These fields must match struct dynarray_header.  */
+      size_t used;
+      size_t allocated;
+      DYNARRAY_ELEMENT *array;
+    } dynarray_header;
+  } u;
+
+#if DYNARRAY_HAVE_SCRATCH
+  /* Initial inline allocation.  */
+  DYNARRAY_ELEMENT scratch[DYNARRAY_INITIAL_SIZE];
+#endif
+};
+
+/* Internal use only: Helper macros.  */
+
+/* Ensure macro-expansion of DYNARRAY_PREFIX.  */
+#define DYNARRAY_CONCAT0(prefix, name) prefix##name
+#define DYNARRAY_CONCAT1(prefix, name) DYNARRAY_CONCAT0(prefix, name)
+#define DYNARRAY_NAME(name) DYNARRAY_CONCAT1(DYNARRAY_PREFIX, name)
+
+/* Use DYNARRAY_FREE instead of DYNARRAY_NAME (free),
+   so that Gnulib does not change 'free' to 'rpl_free'.  */
+#define DYNARRAY_FREE DYNARRAY_CONCAT1 (DYNARRAY_NAME (f), ree)
+
+/* Address of the scratch buffer if any.  */
+#if DYNARRAY_HAVE_SCRATCH
+# define DYNARRAY_SCRATCH(list) (list)->scratch
+#else
+# define DYNARRAY_SCRATCH(list) NULL
+#endif
+
+/* Internal use only: Helper functions.  */
+
+/* Internal function.  Call DYNARRAY_ELEMENT_FREE with the array
+   elements.  Name mangling needed due to the DYNARRAY_ELEMENT_FREE
+   macro expansion.  */
+static inline void
+DYNARRAY_NAME (free__elements__) (DYNARRAY_ELEMENT *__dynarray_array,
+                                  size_t __dynarray_used)
+{
+#ifdef DYNARRAY_ELEMENT_FREE
+  for (size_t __dynarray_i = 0; __dynarray_i < __dynarray_used; ++__dynarray_i)
+    DYNARRAY_ELEMENT_FREE (&__dynarray_array[__dynarray_i]);
+#endif /* DYNARRAY_ELEMENT_FREE */
+}
+
+/* Internal function.  Free the non-scratch array allocation.  */
+static inline void
+DYNARRAY_NAME (free__array__) (struct DYNARRAY_STRUCT *list)
+{
+#if DYNARRAY_HAVE_SCRATCH
+  if (list->u.dynarray_header.array != list->scratch)
+    free (list->u.dynarray_header.array);
+#else
+  free (list->u.dynarray_header.array);
+#endif
+}
+
+/* Public functions.  */
+
+/* Initialize a dynamic array object.  This must be called before any
+   use of the object.  */
+__attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (init) (struct DYNARRAY_STRUCT *list)
+{
+  list->u.dynarray_header.used = 0;
+  list->u.dynarray_header.allocated = DYNARRAY_INITIAL_SIZE;
+  list->u.dynarray_header.array = DYNARRAY_SCRATCH (list);
+}
+
+/* Deallocate the dynamic array and its elements.  */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static void
+DYNARRAY_FREE (struct DYNARRAY_STRUCT *list)
+{
+  DYNARRAY_NAME (free__elements__)
+    (list->u.dynarray_header.array, list->u.dynarray_header.used);
+  DYNARRAY_NAME (free__array__) (list);
+  DYNARRAY_NAME (init) (list);
+}
+
+/* Return true if the dynamic array is in an error state.  */
+__attribute_nonnull__ ((1))
+static inline bool
+DYNARRAY_NAME (has_failed) (const struct DYNARRAY_STRUCT *list)
+{
+  return list->u.dynarray_header.allocated == __dynarray_error_marker ();
+}
+
+/* Mark the dynamic array as failed.  All elements are deallocated as
+   a side effect.  */
+__attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (mark_failed) (struct DYNARRAY_STRUCT *list)
+{
+  DYNARRAY_NAME (free__elements__)
+    (list->u.dynarray_header.array, list->u.dynarray_header.used);
+  DYNARRAY_NAME (free__array__) (list);
+  list->u.dynarray_header.array = DYNARRAY_SCRATCH (list);
+  list->u.dynarray_header.used = 0;
+  list->u.dynarray_header.allocated = __dynarray_error_marker ();
+}
+
+/* Return the number of elements which have been added to the dynamic
+   array.  */
+__attribute_nonnull__ ((1))
+static inline size_t
+DYNARRAY_NAME (size) (const struct DYNARRAY_STRUCT *list)
+{
+  return list->u.dynarray_header.used;
+}
+
+/* Return a pointer to the array element at INDEX.  Terminate the
+   process if INDEX is out of bounds.  */
+__attribute_nonnull__ ((1))
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (at) (struct DYNARRAY_STRUCT *list, size_t index)
+{
+  if (__glibc_unlikely (index >= DYNARRAY_NAME (size) (list)))
+    __libc_dynarray_at_failure (DYNARRAY_NAME (size) (list), index);
+  return list->u.dynarray_header.array + index;
+}
+
+/* Return a pointer to the first array element, if any.  For a
+   zero-length array, the pointer can be NULL even though the dynamic
+   array has not entered the failure state.  */
+__attribute_nonnull__ ((1))
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (begin) (struct DYNARRAY_STRUCT *list)
+{
+  return list->u.dynarray_header.array;
+}
+
+/* Return a pointer one element past the last array element.  For a
+   zero-length array, the pointer can be NULL even though the dynamic
+   array has not entered the failure state.  */
+__attribute_nonnull__ ((1))
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (end) (struct DYNARRAY_STRUCT *list)
+{
+  return list->u.dynarray_header.array + list->u.dynarray_header.used;
+}
+
+/* Internal function.  Slow path for the add function below.  */
+static void
+DYNARRAY_NAME (add__) (struct DYNARRAY_STRUCT *list, DYNARRAY_ELEMENT item)
+{
+  if (__glibc_unlikely
+      (!__libc_dynarray_emplace_enlarge (&list->u.dynarray_abstract,
+                                         DYNARRAY_SCRATCH (list),
+                                         sizeof (DYNARRAY_ELEMENT))))
+    {
+      DYNARRAY_NAME (mark_failed) (list);
+      return;
+    }
+
+  /* Copy the new element and increase the array length.  */
+  list->u.dynarray_header.array[list->u.dynarray_header.used++] = item;
+}
+
+/* Add ITEM at the end of the array, enlarging it by one element.
+   Mark *LIST as failed if the dynamic array allocation size cannot be
+   increased.  */
+__attribute_nonnull__ ((1))
+static inline void
+DYNARRAY_NAME (add) (struct DYNARRAY_STRUCT *list, DYNARRAY_ELEMENT item)
+{
+  /* Do nothing in case of previous error.  */
+  if (DYNARRAY_NAME (has_failed) (list))
+    return;
+
+  /* Enlarge the array if necessary.  */
+  if (__glibc_unlikely (list->u.dynarray_header.used
+                        == list->u.dynarray_header.allocated))
+    {
+      DYNARRAY_NAME (add__) (list, item);
+      return;
+    }
+
+  /* Copy the new element and increase the array length.  */
+  list->u.dynarray_header.array[list->u.dynarray_header.used++] = item;
+}
+
+/* Internal function.  Building block for the emplace functions below.
+   Assumes space for one more element in *LIST.  */
+static inline DYNARRAY_ELEMENT *
+DYNARRAY_NAME (emplace__tail__) (struct DYNARRAY_STRUCT *list)
+{
+  DYNARRAY_ELEMENT *result
+    = &list->u.dynarray_header.array[list->u.dynarray_header.used];
+  ++list->u.dynarray_header.used;
+#if defined (DYNARRAY_ELEMENT_INIT)
+  DYNARRAY_ELEMENT_INIT (result);
+#elif defined (DYNARRAY_ELEMENT_FREE)
+  memset (result, 0, sizeof (*result));
+#endif
+  return result;
+}
+
+/* Internal function.  Slow path for the emplace function below.  */
+static DYNARRAY_ELEMENT *
+DYNARRAY_NAME (emplace__) (struct DYNARRAY_STRUCT *list)
+{
+  if (__glibc_unlikely
+      (!__libc_dynarray_emplace_enlarge (&list->u.dynarray_abstract,
+                                         DYNARRAY_SCRATCH (list),
+                                         sizeof (DYNARRAY_ELEMENT))))
+    {
+      DYNARRAY_NAME (mark_failed) (list);
+      return NULL;
+    }
+  return DYNARRAY_NAME (emplace__tail__) (list);
+}
+
+/* Allocate a place for a new element in *LIST and return a pointer to
+   it.  The pointer can be NULL if the dynamic array cannot be
+   enlarged due to a memory allocation failure.  */
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1))
+static
+/* Avoid inlining with the larger initialization code.  */
+#if !(defined (DYNARRAY_ELEMENT_INIT) || defined (DYNARRAY_ELEMENT_FREE))
+inline
+#endif
+DYNARRAY_ELEMENT *
+DYNARRAY_NAME (emplace) (struct DYNARRAY_STRUCT *list)
+{
+  /* Do nothing in case of previous error.  */
+  if (DYNARRAY_NAME (has_failed) (list))
+    return NULL;
+
+  /* Enlarge the array if necessary.  */
+  if (__glibc_unlikely (list->u.dynarray_header.used
+                        == list->u.dynarray_header.allocated))
+    return (DYNARRAY_NAME (emplace__) (list));
+  return DYNARRAY_NAME (emplace__tail__) (list);
+}
+
+/* Change the size of *LIST to SIZE.  If SIZE is larger than the
+   existing size, new elements are added (which can be initialized).
+   Otherwise, the list is truncated, and elements are freed.  Return
+   false on memory allocation failure (and mark *LIST as failed).  */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static bool
+DYNARRAY_NAME (resize) (struct DYNARRAY_STRUCT *list, size_t size)
+{
+  if (size > list->u.dynarray_header.used)
+    {
+      bool ok;
+#if defined (DYNARRAY_ELEMENT_INIT)
+      /* The new elements have to be initialized.  */
+      size_t old_size = list->u.dynarray_header.used;
+      ok = __libc_dynarray_resize (&list->u.dynarray_abstract,
+                                   size, DYNARRAY_SCRATCH (list),
+                                   sizeof (DYNARRAY_ELEMENT));
+      if (ok)
+        for (size_t i = old_size; i < size; ++i)
+          {
+            DYNARRAY_ELEMENT_INIT (&list->u.dynarray_header.array[i]);
+          }
+#elif defined (DYNARRAY_ELEMENT_FREE)
+      /* Zero initialization is needed so that the elements can be
+         safely freed.  */
+      ok = __libc_dynarray_resize_clear
+        (&list->u.dynarray_abstract, size,
+         DYNARRAY_SCRATCH (list), sizeof (DYNARRAY_ELEMENT));
+#else
+      ok =  __libc_dynarray_resize (&list->u.dynarray_abstract,
+                                    size, DYNARRAY_SCRATCH (list),
+                                    sizeof (DYNARRAY_ELEMENT));
+#endif
+      if (__glibc_unlikely (!ok))
+        DYNARRAY_NAME (mark_failed) (list);
+      return ok;
+    }
+  else
+    {
+      /* The list has shrunk in size.  Free the removed elements.  */
+      DYNARRAY_NAME (free__elements__)
+        (list->u.dynarray_header.array + size,
+         list->u.dynarray_header.used - size);
+      list->u.dynarray_header.used = size;
+      return true;
+    }
+}
+
+/* Remove the last element of LIST if it is present.  */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (remove_last) (struct DYNARRAY_STRUCT *list)
+{
+  /* used > 0 implies that the array is the non-failed state.  */
+  if (list->u.dynarray_header.used > 0)
+    {
+      size_t new_length = list->u.dynarray_header.used - 1;
+#ifdef DYNARRAY_ELEMENT_FREE
+      DYNARRAY_ELEMENT_FREE (&list->u.dynarray_header.array[new_length]);
+#endif
+      list->u.dynarray_header.used = new_length;
+    }
+}
+
+/* Remove all elements from the list.  The elements are freed, but the
+   list itself is not.  */
+__attribute_maybe_unused__ __attribute_nonnull__ ((1))
+static void
+DYNARRAY_NAME (clear) (struct DYNARRAY_STRUCT *list)
+{
+  /* free__elements__ does nothing if the list is in the failed
+     state.  */
+  DYNARRAY_NAME (free__elements__)
+    (list->u.dynarray_header.array, list->u.dynarray_header.used);
+  list->u.dynarray_header.used = 0;
+}
+
+#ifdef DYNARRAY_FINAL_TYPE
+/* Transfer the dynamic array to a permanent location at *RESULT.
+   Returns true on success on false on allocation failure.  In either
+   case, *LIST is re-initialized and can be reused.  A NULL pointer is
+   stored in *RESULT if LIST refers to an empty list.  On success, the
+   pointer in *RESULT is heap-allocated and must be deallocated using
+   free.  */
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1, 2))
+static bool
+DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list,
+                          DYNARRAY_FINAL_TYPE *result)
+{
+  struct dynarray_finalize_result res;
+  if (__libc_dynarray_finalize (&list->u.dynarray_abstract,
+                                DYNARRAY_SCRATCH (list),
+                                sizeof (DYNARRAY_ELEMENT), &res))
+    {
+      /* On success, the result owns all the data.  */
+      DYNARRAY_NAME (init) (list);
+      *result = (DYNARRAY_FINAL_TYPE) { res.array, res.length };
+      return true;
+    }
+  else
+    {
+      /* On error, we need to free all data.  */
+      DYNARRAY_FREE (list);
+      errno = ENOMEM;
+      return false;
+    }
+}
+#else /* !DYNARRAY_FINAL_TYPE */
+/* Transfer the dynamic array to a heap-allocated array and return a
+   pointer to it.  The pointer is NULL if memory allocation fails, or
+   if the array is empty, so this function should be used only for
+   arrays which are known not be empty (usually because they always
+   have a sentinel at the end).  If LENGTHP is not NULL, the array
+   length is written to *LENGTHP.  *LIST is re-initialized and can be
+   reused.  */
+__attribute_maybe_unused__ __attribute_warn_unused_result__
+__attribute_nonnull__ ((1))
+static DYNARRAY_ELEMENT *
+DYNARRAY_NAME (finalize) (struct DYNARRAY_STRUCT *list, size_t *lengthp)
+{
+  struct dynarray_finalize_result res;
+  if (__libc_dynarray_finalize (&list->u.dynarray_abstract,
+                                DYNARRAY_SCRATCH (list),
+                                sizeof (DYNARRAY_ELEMENT), &res))
+    {
+      /* On success, the result owns all the data.  */
+      DYNARRAY_NAME (init) (list);
+      if (lengthp != NULL)
+        *lengthp = res.length;
+      return res.array;
+    }
+  else
+    {
+      /* On error, we need to free all data.  */
+      DYNARRAY_FREE (list);
+      errno = ENOMEM;
+      return NULL;
+    }
+}
+#endif /* !DYNARRAY_FINAL_TYPE */
+
+/* Undo macro definitions.  */
+
+#undef DYNARRAY_CONCAT0
+#undef DYNARRAY_CONCAT1
+#undef DYNARRAY_NAME
+#undef DYNARRAY_SCRATCH
+#undef DYNARRAY_HAVE_SCRATCH
+
+#undef DYNARRAY_STRUCT
+#undef DYNARRAY_ELEMENT
+#undef DYNARRAY_PREFIX
+#undef DYNARRAY_ELEMENT_FREE
+#undef DYNARRAY_ELEMENT_INIT
+#undef DYNARRAY_INITIAL_SIZE
+#undef DYNARRAY_FINAL_TYPE
diff --git a/lib/malloc/dynarray.h b/lib/malloc/dynarray.h
new file mode 100644 (file)
index 0000000..84e4394
--- /dev/null
@@ -0,0 +1,178 @@
+/* Type-safe arrays which grow dynamically.  Shared definitions.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* To use the dynarray facility, you need to include
+   <malloc/dynarray-skeleton.c> and define the parameter macros
+   documented in that file.
+
+   A minimal example which provides a growing list of integers can be
+   defined like this:
+
+     struct int_array
+     {
+       // Pointer to result array followed by its length,
+       // as required by DYNARRAY_FINAL_TYPE.
+       int *array;
+       size_t length;
+     };
+
+     #define DYNARRAY_STRUCT dynarray_int
+     #define DYNARRAY_ELEMENT int
+     #define DYNARRAY_PREFIX dynarray_int_
+     #define DYNARRAY_FINAL_TYPE struct int_array
+     #include <malloc/dynarray-skeleton.c>
+
+   To create a three-element array with elements 1, 2, 3, use this
+   code:
+
+     struct dynarray_int dyn;
+     dynarray_int_init (&dyn);
+     for (int i = 1; i <= 3; ++i)
+       {
+         int *place = dynarray_int_emplace (&dyn);
+         assert (place != NULL);
+         *place = i;
+       }
+     struct int_array result;
+     bool ok = dynarray_int_finalize (&dyn, &result);
+     assert (ok);
+     assert (result.length == 3);
+     assert (result.array[0] == 1);
+     assert (result.array[1] == 2);
+     assert (result.array[2] == 3);
+     free (result.array);
+
+   If the elements contain resources which must be freed, define
+   DYNARRAY_ELEMENT_FREE appropriately, like this:
+
+     struct str_array
+     {
+       char **array;
+       size_t length;
+     };
+
+     #define DYNARRAY_STRUCT dynarray_str
+     #define DYNARRAY_ELEMENT char *
+     #define DYNARRAY_ELEMENT_FREE(ptr) free (*ptr)
+     #define DYNARRAY_PREFIX dynarray_str_
+     #define DYNARRAY_FINAL_TYPE struct str_array
+     #include <malloc/dynarray-skeleton.c>
+
+   Compared to scratch buffers, dynamic arrays have the following
+   features:
+
+   - They have an element type, and are not just an untyped buffer of
+     bytes.
+
+   - When growing, previously stored elements are preserved.  (It is
+     expected that scratch_buffer_grow_preserve and
+     scratch_buffer_set_array_size eventually go away because all
+     current users are moved to dynamic arrays.)
+
+   - Scratch buffers have a more aggressive growth policy because
+     growing them typically means a retry of an operation (across an
+     NSS service module boundary), which is expensive.
+
+   - For the same reason, scratch buffers have a much larger initial
+     stack allocation.  */
+
+#ifndef _DYNARRAY_H
+#define _DYNARRAY_H
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+
+struct dynarray_header
+{
+  size_t used;
+  size_t allocated;
+  void *array;
+};
+
+/* Marker used in the allocated member to indicate that an error was
+   encountered.  */
+static inline size_t
+__dynarray_error_marker (void)
+{
+  return -1;
+}
+
+/* Internal function.  See the has_failed function in
+   dynarray-skeleton.c.  */
+static inline bool
+__dynarray_error (struct dynarray_header *list)
+{
+  return list->allocated == __dynarray_error_marker ();
+}
+
+/* Internal function.  Enlarge the dynamically allocated area of the
+   array to make room for one more element.  SCRATCH is a pointer to
+   the scratch area (which is not heap-allocated and must not be
+   freed).  ELEMENT_SIZE is the size, in bytes, of one element.
+   Return false on failure, true on success.  */
+bool __libc_dynarray_emplace_enlarge (struct dynarray_header *,
+                                      void *scratch, size_t element_size);
+
+/* Internal function.  Enlarge the dynamically allocated area of the
+   array to make room for at least SIZE elements (which must be larger
+   than the existing used part of the dynamic array).  SCRATCH is a
+   pointer to the scratch area (which is not heap-allocated and must
+   not be freed).  ELEMENT_SIZE is the size, in bytes, of one element.
+   Return false on failure, true on success.  */
+bool __libc_dynarray_resize (struct dynarray_header *, size_t size,
+                             void *scratch, size_t element_size);
+
+/* Internal function.  Like __libc_dynarray_resize, but clear the new
+   part of the dynamic array.  */
+bool __libc_dynarray_resize_clear (struct dynarray_header *, size_t size,
+                                   void *scratch, size_t element_size);
+
+/* Internal type.  */
+struct dynarray_finalize_result
+{
+  void *array;
+  size_t length;
+};
+
+/* Internal function.  Copy the dynamically-allocated area to an
+   explicitly-sized heap allocation.  SCRATCH is a pointer to the
+   embedded scratch space.  ELEMENT_SIZE is the size, in bytes, of the
+   element type.  On success, true is returned, and pointer and length
+   are written to *RESULT.  On failure, false is returned.  The caller
+   has to take care of some of the memory management; this function is
+   expected to be called from dynarray-skeleton.c.  */
+bool __libc_dynarray_finalize (struct dynarray_header *list, void *scratch,
+                               size_t element_size,
+                               struct dynarray_finalize_result *result);
+
+
+/* Internal function.  Terminate the process after an index error.
+   SIZE is the number of elements of the dynamic array.  INDEX is the
+   lookup index which triggered the failure.  */
+_Noreturn void __libc_dynarray_at_failure (size_t size, size_t index);
+
+#ifndef _ISOMAC
+libc_hidden_proto (__libc_dynarray_emplace_enlarge)
+libc_hidden_proto (__libc_dynarray_resize)
+libc_hidden_proto (__libc_dynarray_resize_clear)
+libc_hidden_proto (__libc_dynarray_finalize)
+libc_hidden_proto (__libc_dynarray_at_failure)
+#endif
+
+#endif /* _DYNARRAY_H */
diff --git a/lib/malloc/dynarray_at_failure.c b/lib/malloc/dynarray_at_failure.c
new file mode 100644 (file)
index 0000000..d96d597
--- /dev/null
@@ -0,0 +1,39 @@
+/* Report an dynamic array index out of bounds condition.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+void
+__libc_dynarray_at_failure (size_t size, size_t index)
+{
+#ifdef _LIBC
+  char buf[200];
+  __snprintf (buf, sizeof (buf), "Fatal glibc error: "
+              "array index %zu not less than array length %zu\n",
+              index, size);
+#else
+ abort ();
+#endif
+}
+libc_hidden_def (__libc_dynarray_at_failure)
diff --git a/lib/malloc/dynarray_emplace_enlarge.c b/lib/malloc/dynarray_emplace_enlarge.c
new file mode 100644 (file)
index 0000000..ac5814b
--- /dev/null
@@ -0,0 +1,77 @@
+/* Increase the size of a dynamic array in preparation of an emplace operation.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <errno.h>
+#include <intprops.h>
+#include <stdlib.h>
+#include <string.h>
+
+bool
+__libc_dynarray_emplace_enlarge (struct dynarray_header *list,
+                                 void *scratch, size_t element_size)
+{
+  size_t new_allocated;
+  if (list->allocated == 0)
+    {
+      /* No scratch buffer provided.  Choose a reasonable default
+         size.  */
+      if (element_size < 4)
+        new_allocated = 16;
+      else if (element_size < 8)
+        new_allocated = 8;
+      else
+        new_allocated = 4;
+    }
+  else
+    /* Increase the allocated size, using an exponential growth
+       policy.  */
+    {
+      new_allocated = list->allocated + list->allocated / 2 + 1;
+      if (new_allocated <= list->allocated)
+        {
+          /* Overflow.  */
+          __set_errno (ENOMEM);
+          return false;
+        }
+    }
+
+  size_t new_size;
+  if (INT_MULTIPLY_WRAPV (new_allocated, element_size, &new_size))
+    return false;
+  void *new_array;
+  if (list->array == scratch)
+    {
+      /* The previous array was not heap-allocated.  */
+      new_array = malloc (new_size);
+      if (new_array != NULL && list->array != NULL)
+        memcpy (new_array, list->array, list->used * element_size);
+    }
+  else
+    new_array = realloc (list->array, new_size);
+  if (new_array == NULL)
+    return false;
+  list->array = new_array;
+  list->allocated = new_allocated;
+  return true;
+}
+libc_hidden_def (__libc_dynarray_emplace_enlarge)
diff --git a/lib/malloc/dynarray_finalize.c b/lib/malloc/dynarray_finalize.c
new file mode 100644 (file)
index 0000000..8c3335c
--- /dev/null
@@ -0,0 +1,66 @@
+/* Copy the dynamically-allocated area to an explicitly-sized heap allocation.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <stdlib.h>
+#include <string.h>
+
+bool
+__libc_dynarray_finalize (struct dynarray_header *list,
+                          void *scratch, size_t element_size,
+                          struct dynarray_finalize_result *result)
+{
+  if (__dynarray_error (list))
+    /* The caller will reported the deferred error.  */
+    return false;
+
+  size_t used = list->used;
+
+  /* Empty list.  */
+  if (used == 0)
+    {
+      /* An empty list could still be backed by a heap-allocated
+         array.  Free it if necessary.  */
+      if (list->array != scratch)
+        free (list->array);
+      *result = (struct dynarray_finalize_result) { NULL, 0 };
+      return true;
+    }
+
+  size_t allocation_size = used * element_size;
+  void *heap_array = malloc (allocation_size);
+  if (heap_array != NULL)
+    {
+      /* The new array takes ownership of the strings.  */
+      if (list->array != NULL)
+        memcpy (heap_array, list->array, allocation_size);
+      if (list->array != scratch)
+        free (list->array);
+      *result = (struct dynarray_finalize_result)
+        { .array = heap_array, .length = used };
+      return true;
+    }
+  else
+    /* The caller will perform the freeing operation.  */
+    return false;
+}
+libc_hidden_def (__libc_dynarray_finalize)
diff --git a/lib/malloc/dynarray_resize.c b/lib/malloc/dynarray_resize.c
new file mode 100644 (file)
index 0000000..bc34b42
--- /dev/null
@@ -0,0 +1,68 @@
+/* Increase the size of a dynamic array.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <errno.h>
+#include <intprops.h>
+#include <stdlib.h>
+#include <string.h>
+
+bool
+__libc_dynarray_resize (struct dynarray_header *list, size_t size,
+                        void *scratch, size_t element_size)
+{
+  /* The existing allocation provides sufficient room.  */
+  if (size <= list->allocated)
+    {
+      list->used = size;
+      return true;
+    }
+
+  /* Otherwise, use size as the new allocation size.  The caller is
+     expected to provide the final size of the array, so there is no
+     over-allocation here.  */
+
+  size_t new_size_bytes;
+  if (INT_MULTIPLY_WRAPV (size, element_size, &new_size_bytes))
+    {
+      /* Overflow.  */
+      __set_errno (ENOMEM);
+      return false;
+    }
+  void *new_array;
+  if (list->array == scratch)
+    {
+      /* The previous array was not heap-allocated.  */
+      new_array = malloc (new_size_bytes);
+      if (new_array != NULL && list->array != NULL)
+        memcpy (new_array, list->array, list->used * element_size);
+    }
+  else
+    new_array = realloc (list->array, new_size_bytes);
+  if (new_array == NULL)
+    return false;
+  list->array = new_array;
+  list->allocated = size;
+  list->used = size;
+  return true;
+}
+libc_hidden_def (__libc_dynarray_resize)
diff --git a/lib/malloc/dynarray_resize_clear.c b/lib/malloc/dynarray_resize_clear.c
new file mode 100644 (file)
index 0000000..4e67bce
--- /dev/null
@@ -0,0 +1,39 @@
+/* Increase the size of a dynamic array and clear the new part.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <dynarray.h>
+#include <string.h>
+
+bool
+__libc_dynarray_resize_clear (struct dynarray_header *list, size_t size,
+                              void *scratch, size_t element_size)
+{
+  size_t old_size = list->used;
+  if (!__libc_dynarray_resize (list, size, scratch, element_size))
+    return false;
+  /* __libc_dynarray_resize already checked for overflow.  */
+  char *array = list->array;
+  memset (array + (old_size * element_size), 0,
+          (size - old_size) * element_size);
+  return true;
+}
+libc_hidden_def (__libc_dynarray_resize_clear)
diff --git a/lib/malloc/scratch_buffer.h b/lib/malloc/scratch_buffer.h
new file mode 100644 (file)
index 0000000..26e3062
--- /dev/null
@@ -0,0 +1,151 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2015-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SCRATCH_BUFFER_H
+#define _SCRATCH_BUFFER_H
+
+/* Scratch buffers with a default stack allocation and fallback to
+   heap allocation.  It is expected that this function is used in this
+   way:
+
+     struct scratch_buffer tmpbuf;
+     scratch_buffer_init (&tmpbuf);
+
+     while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+       if (!scratch_buffer_grow (&tmpbuf))
+        return -1;
+
+     scratch_buffer_free (&tmpbuf);
+     return 0;
+
+   The allocation functions (scratch_buffer_grow,
+   scratch_buffer_grow_preserve, scratch_buffer_set_array_size) make
+   sure that the heap allocation, if any, is freed, so that the code
+   above does not have a memory leak.  The buffer still remains in a
+   state that can be deallocated using scratch_buffer_free, so a loop
+   like this is valid as well:
+
+     struct scratch_buffer tmpbuf;
+     scratch_buffer_init (&tmpbuf);
+
+     while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+       if (!scratch_buffer_grow (&tmpbuf))
+        break;
+
+     scratch_buffer_free (&tmpbuf);
+
+   scratch_buffer_grow and scratch_buffer_grow_preserve are guaranteed
+   to grow the buffer by at least 512 bytes.  This means that when
+   using the scratch buffer as a backing store for a non-character
+   array whose element size, in bytes, is 512 or smaller, the scratch
+   buffer only has to grow once to make room for at least one more
+   element.
+*/
+
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+/* Scratch buffer.  Must be initialized with scratch_buffer_init
+   before its use.  */
+struct scratch_buffer {
+  void *data;    /* Pointer to the beginning of the scratch area.  */
+  size_t length; /* Allocated space at the data pointer, in bytes.  */
+  union { max_align_t __align; char __c[1024]; } __space;
+};
+
+/* Initializes *BUFFER so that BUFFER->data points to BUFFER->__space
+   and BUFFER->length reflects the available space.  */
+static inline void
+scratch_buffer_init (struct scratch_buffer *buffer)
+{
+  buffer->data = buffer->__space.__c;
+  buffer->length = sizeof (buffer->__space);
+}
+
+/* Deallocates *BUFFER (if it was heap-allocated).  */
+static inline void
+scratch_buffer_free (struct scratch_buffer *buffer)
+{
+  if (buffer->data != buffer->__space.__c)
+    free (buffer->data);
+}
+
+/* Grow *BUFFER by some arbitrary amount.  The buffer contents is NOT
+   preserved.  Return true on success, false on allocation failure (in
+   which case the old buffer is freed).  On success, the new buffer is
+   larger than the previous size.  On failure, *BUFFER is deallocated,
+   but remains in a free-able state, and errno is set.  */
+bool __libc_scratch_buffer_grow (struct scratch_buffer *buffer);
+libc_hidden_proto (__libc_scratch_buffer_grow)
+
+/* Alias for __libc_scratch_buffer_grow.  */
+static __always_inline bool
+scratch_buffer_grow (struct scratch_buffer *buffer)
+{
+  return __glibc_likely (__libc_scratch_buffer_grow (buffer));
+}
+
+/* Like __libc_scratch_buffer_grow, but preserve the old buffer
+   contents on success, as a prefix of the new buffer.  */
+bool __libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer);
+libc_hidden_proto (__libc_scratch_buffer_grow_preserve)
+
+/* Alias for __libc_scratch_buffer_grow_preserve.  */
+static __always_inline bool
+scratch_buffer_grow_preserve (struct scratch_buffer *buffer)
+{
+  return __glibc_likely (__libc_scratch_buffer_grow_preserve (buffer));
+}
+
+/* Grow *BUFFER so that it can store at least NELEM elements of SIZE
+   bytes.  The buffer contents are NOT preserved.  Both NELEM and SIZE
+   can be zero.  Return true on success, false on allocation failure
+   (in which case the old buffer is freed, but *BUFFER remains in a
+   free-able state, and errno is set).  It is unspecified whether this
+   function can reduce the array size.  */
+bool __libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+                                          size_t nelem, size_t size);
+libc_hidden_proto (__libc_scratch_buffer_set_array_size)
+
+/* Alias for __libc_scratch_set_array_size.  */
+static __always_inline bool
+scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+                              size_t nelem, size_t size)
+{
+  return __glibc_likely (__libc_scratch_buffer_set_array_size
+                        (buffer, nelem, size));
+}
+
+/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
+   deallocating *BUFFER if it was heap-allocated.  SIZE must be at
+   most *BUFFER's size.  Return NULL (setting errno) on memory
+   exhaustion.  */
+void *__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer,
+                                     size_t size);
+libc_hidden_proto (__libc_scratch_buffer_dupfree)
+
+/* Alias for __libc_scratch_dupfree.  */
+static __always_inline void *
+scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
+{
+  void *r = __libc_scratch_buffer_dupfree (buffer, size);
+  return __glibc_likely (r != NULL) ? r : NULL;
+}
+
+#endif /* _SCRATCH_BUFFER_H */
diff --git a/lib/malloc/scratch_buffer_dupfree.c b/lib/malloc/scratch_buffer_dupfree.c
new file mode 100644 (file)
index 0000000..775bff5
--- /dev/null
@@ -0,0 +1,41 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <string.h>
+
+void *
+__libc_scratch_buffer_dupfree (struct scratch_buffer *buffer, size_t size)
+{
+  void *data = buffer->data;
+  if (data == buffer->__space.__c)
+    {
+      void *copy = malloc (size);
+      return copy != NULL ? memcpy (copy, data, size) : NULL;
+    }
+  else
+    {
+      void *copy = realloc (data, size);
+      return copy != NULL ? copy : data;
+    }
+}
+libc_hidden_def (__libc_scratch_buffer_dupfree)
diff --git a/lib/malloc/scratch_buffer_grow.c b/lib/malloc/scratch_buffer_grow.c
new file mode 100644 (file)
index 0000000..e7606d8
--- /dev/null
@@ -0,0 +1,56 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2015-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <errno.h>
+
+bool
+__libc_scratch_buffer_grow (struct scratch_buffer *buffer)
+{
+  void *new_ptr;
+  size_t new_length = buffer->length * 2;
+
+  /* Discard old buffer.  */
+  scratch_buffer_free (buffer);
+
+  /* Check for overflow.  */
+  if (__glibc_likely (new_length >= buffer->length))
+    new_ptr = malloc (new_length);
+  else
+    {
+      __set_errno (ENOMEM);
+      new_ptr = NULL;
+    }
+
+  if (__glibc_unlikely (new_ptr == NULL))
+    {
+      /* Buffer must remain valid to free.  */
+      scratch_buffer_init (buffer);
+      return false;
+    }
+
+  /* Install new heap-based buffer.  */
+  buffer->data = new_ptr;
+  buffer->length = new_length;
+  return true;
+}
+libc_hidden_def (__libc_scratch_buffer_grow)
diff --git a/lib/malloc/scratch_buffer_grow_preserve.c b/lib/malloc/scratch_buffer_grow_preserve.c
new file mode 100644 (file)
index 0000000..59f8c71
--- /dev/null
@@ -0,0 +1,67 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2015-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <errno.h>
+#include <string.h>
+
+bool
+__libc_scratch_buffer_grow_preserve (struct scratch_buffer *buffer)
+{
+  size_t new_length = 2 * buffer->length;
+  void *new_ptr;
+
+  if (buffer->data == buffer->__space.__c)
+    {
+      /* Move buffer to the heap.  No overflow is possible because
+        buffer->length describes a small buffer on the stack.  */
+      new_ptr = malloc (new_length);
+      if (new_ptr == NULL)
+       return false;
+      memcpy (new_ptr, buffer->__space.__c, buffer->length);
+    }
+  else
+    {
+      /* Buffer was already on the heap.  Check for overflow.  */
+      if (__glibc_likely (new_length >= buffer->length))
+       new_ptr = realloc (buffer->data, new_length);
+      else
+       {
+         __set_errno (ENOMEM);
+         new_ptr = NULL;
+       }
+
+      if (__glibc_unlikely (new_ptr == NULL))
+       {
+         /* Deallocate, but buffer must remain valid to free.  */
+         free (buffer->data);
+         scratch_buffer_init (buffer);
+         return false;
+       }
+    }
+
+  /* Install new heap-based buffer.  */
+  buffer->data = new_ptr;
+  buffer->length = new_length;
+  return true;
+}
+libc_hidden_def (__libc_scratch_buffer_grow_preserve)
diff --git a/lib/malloc/scratch_buffer_set_array_size.c b/lib/malloc/scratch_buffer_set_array_size.c
new file mode 100644 (file)
index 0000000..e2b9f31
--- /dev/null
@@ -0,0 +1,64 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2015-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#ifndef _LIBC
+# include <libc-config.h>
+#endif
+
+#include <scratch_buffer.h>
+#include <errno.h>
+#include <limits.h>
+
+bool
+__libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+                                     size_t nelem, size_t size)
+{
+  size_t new_length = nelem * size;
+
+  /* Avoid overflow check if both values are small. */
+  if ((nelem | size) >> (sizeof (size_t) * CHAR_BIT / 2) != 0
+      && nelem != 0 && size != new_length / nelem)
+    {
+      /* Overflow.  Discard the old buffer, but it must remain valid
+        to free.  */
+      scratch_buffer_free (buffer);
+      scratch_buffer_init (buffer);
+      __set_errno (ENOMEM);
+      return false;
+    }
+
+  if (new_length <= buffer->length)
+    return true;
+
+  /* Discard old buffer.  */
+  scratch_buffer_free (buffer);
+
+  char *new_ptr = malloc (new_length);
+  if (new_ptr == NULL)
+    {
+      /* Buffer must remain valid to free.  */
+      scratch_buffer_init (buffer);
+      return false;
+    }
+
+  /* Install new heap-based buffer.  */
+  buffer->data = new_ptr;
+  buffer->length = new_length;
+  return true;
+}
+libc_hidden_def (__libc_scratch_buffer_set_array_size)
index a613277..7c795fb 100644 (file)
@@ -1,6 +1,6 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003, 2006-2007, 2009-2016 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2003.
+   Copyright (C) 2003, 2006-2007, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2003, 2018.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #define _GL_USE_STDLIB_ALLOC 1
 #include <config.h>
 /* Specification.  */
 #include "malloca.h"
 
-#include <stdint.h>
-
+#include "idx.h"
+#include "intprops.h"
 #include "verify.h"
 
 /* The speed critical point in this file is freea() applied to an alloca()
    result: it must be fast, to match the speed of alloca().  The speed of
    mmalloca() and freea() in the other case are not critical, because they
-   are only invoked for big memory sizes.  */
-
-#if HAVE_ALLOCA
-
-/* Store the mmalloca() results in a hash table.  This is needed to reliably
-   distinguish a mmalloca() result and an alloca() result.
-
-   Although it is possible that the same pointer is returned by alloca() and
-   by mmalloca() at different times in the same application, it does not lead
-   to a bug in freea(), because:
-     - Before a pointer returned by alloca() can point into malloc()ed memory,
-       the function must return, and once this has happened the programmer must
-       not call freea() on it anyway.
-     - Before a pointer returned by mmalloca() can point into the stack, it
-       must be freed.  The only function that can free it is freea(), and
-       when freea() frees it, it also removes it from the hash table.  */
-
-#define MAGIC_NUMBER 0x1415fb4a
-#define MAGIC_SIZE sizeof (int)
-/* This is how the header info would look like without any alignment
-   considerations.  */
-struct preliminary_header { void *next; int magic; };
-/* But the header's size must be a multiple of sa_alignment_max.  */
-#define HEADER_SIZE \
-  (((sizeof (struct preliminary_header) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max)
-union header {
-  void *next;
-  struct {
-    char room[HEADER_SIZE - MAGIC_SIZE];
-    int word;
-  } magic;
-};
-verify (HEADER_SIZE == sizeof (union header));
-/* We make the hash table quite big, so that during lookups the probability
-   of empty hash buckets is quite high.  There is no need to make the hash
-   table resizable, because when the hash table gets filled so much that the
-   lookup becomes slow, it means that the application has memory leaks.  */
-#define HASH_TABLE_SIZE 257
-static void * mmalloca_results[HASH_TABLE_SIZE];
-
-#endif
+   are only invoked for big memory sizes.
+   Here we use a bit in the address as an indicator, an idea by Ondřej Bílka.
+   malloca() can return three types of pointers:
+     - Pointers ≡ 0 mod 2*sa_alignment_max come from stack allocation.
+     - Pointers ≡ sa_alignment_max mod 2*sa_alignment_max come from heap
+       allocation.
+     - NULL comes from a failed heap allocation.  */
+
+/* Type for holding very small pointer differences.  */
+typedef unsigned char small_t;
+/* Verify that it is wide enough.  */
+verify (2 * sa_alignment_max - 1 <= (small_t) -1);
 
 void *
 mmalloca (size_t n)
 {
 #if HAVE_ALLOCA
-  /* Allocate one more word, that serves as an indicator for malloc()ed
-     memory, so that freea() of an alloca() result is fast.  */
-  size_t nplus = n + HEADER_SIZE;
-
-  if (nplus >= n)
+  /* Allocate one more word, used to determine the address to pass to freea(),
+     and room for the alignment ≡ sa_alignment_max mod 2*sa_alignment_max.  */
+  int plus = sizeof (small_t) + 2 * sa_alignment_max - 1;
+  idx_t nplus;
+  if (!INT_ADD_WRAPV (n, plus, &nplus) && !xalloc_oversized (nplus, 1))
     {
-      void *p = malloc (nplus);
+      char *mem = (char *) malloc (nplus);
 
-      if (p != NULL)
+      if (mem != NULL)
         {
-          size_t slot;
-          union header *h = p;
-
-          p = h + 1;
-
-          /* Put a magic number into the indicator word.  */
-          h->magic.word = MAGIC_NUMBER;
-
-          /* Enter p into the hash table.  */
-          slot = (uintptr_t) p % HASH_TABLE_SIZE;
-          h->next = mmalloca_results[slot];
-          mmalloca_results[slot] = p;
-
+          char *p =
+            (char *)((((uintptr_t)mem + sizeof (small_t) + sa_alignment_max - 1)
+                      & ~(uintptr_t)(2 * sa_alignment_max - 1))
+                     + sa_alignment_max);
+          /* Here p >= mem + sizeof (small_t),
+             and p <= mem + sizeof (small_t) + 2 * sa_alignment_max - 1
+             hence p + n <= mem + nplus.
+             So, the memory range [p, p+n) lies in the allocated memory range
+             [mem, mem + nplus).  */
+          ((small_t *) p)[-1] = p - mem;
+          /* p ≡ sa_alignment_max mod 2*sa_alignment_max.  */
           return p;
         }
     }
@@ -115,35 +84,24 @@ mmalloca (size_t n)
 void
 freea (void *p)
 {
-  /* mmalloca() may have returned NULL.  */
-  if (p != NULL)
+  /* Check argument.  */
+  if ((uintptr_t) p & (sa_alignment_max - 1))
     {
-      /* Attempt to quickly distinguish the mmalloca() result - which has
-         a magic indicator word - and the alloca() result - which has an
-         uninitialized indicator word.  It is for this test that sa_increment
-         additional bytes are allocated in the alloca() case.  */
-      if (((int *) p)[-1] == MAGIC_NUMBER)
-        {
-          /* Looks like a mmalloca() result.  To see whether it really is one,
-             perform a lookup in the hash table.  */
-          size_t slot = (uintptr_t) p % HASH_TABLE_SIZE;
-          void **chain = &mmalloca_results[slot];
-          for (; *chain != NULL;)
-            {
-              union header *h = p;
-              if (*chain == p)
-                {
-                  /* Found it.  Remove it from the hash table and free it.  */
-                  union header *p_begin = h - 1;
-                  *chain = p_begin->next;
-                  free (p_begin);
-                  return;
-                }
-              h = *chain;
-              chain = &h[-1].next;
-            }
-        }
-      /* At this point, we know it was not a mmalloca() result.  */
+      /* p was not the result of a malloca() call.  Invalid argument.  */
+      abort ();
+    }
+  /* Determine whether p was a non-NULL pointer returned by mmalloca().  */
+  if ((uintptr_t) p & sa_alignment_max)
+    {
+      void *mem = (char *) p - ((small_t *) p)[-1];
+      free (mem);
     }
 }
 #endif
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
index 7996d1b..6b6a52c 100644 (file)
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _MALLOCA_H
 #define _MALLOCA_H
@@ -56,8 +56,10 @@ extern "C" {
    the function returns.  Upon failure, it returns NULL.  */
 #if HAVE_ALLOCA
 # define malloca(N) \
-  ((N) < 4032 - sa_increment                                        \
-   ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \
+  ((N) < 4032 - (2 * sa_alignment_max - 1)                                   \
+   ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
+                + (2 * sa_alignment_max - 1))                                \
+               & ~(uintptr_t)(2 * sa_alignment_max - 1))                     \
    : mmalloca (N))
 #else
 # define malloca(N) \
@@ -74,9 +76,10 @@ extern void freea (void *p);
 
 /* nmalloca(N,S) is an overflow-safe variant of malloca (N * S).
    It allocates an array of N objects, each with S bytes of memory,
-   on the stack.  S must be positive and N must be nonnegative.
+   on the stack.  N and S should be nonnegative and free of side effects.
    The array must be freed using freea() before the function returns.  */
-#define nmalloca(n, s) (xalloc_oversized (n, s) ? NULL : malloca ((n) * (s)))
+#define nmalloca(n, s) \
+  (xalloc_oversized (n, s) ? NULL : malloca ((n) * (size_t) (s)))
 
 
 #ifdef __cplusplus
@@ -87,7 +90,7 @@ extern void freea (void *p);
 /* ------------------- Auxiliary, non-public definitions ------------------- */
 
 /* Determine the alignment of a type at compile time.  */
-#if defined __GNUC__ || defined __IBM__ALIGNOF__
+#if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
 # define sa_alignof __alignof__
 #elif defined __cplusplus
   template <class type> struct sa_alignof_helper { char __slot1; type __slot2; };
@@ -110,19 +113,12 @@ enum
    among all elementary types.  */
   sa_alignment_long = sa_alignof (long),
   sa_alignment_double = sa_alignof (double),
-#if HAVE_LONG_LONG_INT
   sa_alignment_longlong = sa_alignof (long long),
-#endif
   sa_alignment_longdouble = sa_alignof (long double),
   sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1)
-#if HAVE_LONG_LONG_INT
                       | (sa_alignment_longlong - 1)
-#endif
                       | (sa_alignment_longdouble - 1)
-                     ) + 1,
-/* The increment that guarantees room for a magic word must be >= sizeof (int)
-   and a multiple of sa_alignment_max.  */
-  sa_increment = ((sizeof (int) + sa_alignment_max - 1) / sa_alignment_max) * sa_alignment_max
+                     ) + 1
 };
 
 #endif /* _MALLOCA_H */
diff --git a/lib/malloca.valgrind b/lib/malloca.valgrind
deleted file mode 100644 (file)
index 52f0a50..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# Suppress a valgrind message about use of uninitialized memory in freea().
-# This use is OK because it provides only a speedup.
-{
-    freea
-    Memcheck:Cond
-    fun:freea
-}
index 494432f..bbe86ad 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <math.h>.
 
-   Copyright (C) 2002-2003, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _@GUARD_PREFIX@_MATH_H
 
 #endif
 @PRAGMA_COLUMNS@
 
+#if defined _GL_INCLUDING_MATH_H
+/* Special invocation convention:
+   - On FreeBSD 12.2 we have a sequence of nested includes
+     <math.h> -> <stdlib.h> -> <sys/wait.h> -> <sys/types.h> -> <sys/select.h>
+       -> <signal.h> -> <pthread.h> -> <stdlib.h> -> <math.h>
+     In this situation, the functions are not yet declared, therefore we cannot
+     provide the C++ aliases.  */
+
+#@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+
+#else
+/* Normal invocation convention.  */
+
 /* The include_next requires a split double-inclusion guard.  */
+#define _GL_INCLUDING_MATH_H
 #@INCLUDE_NEXT_AS_FIRST_DIRECTIVE@ @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+#undef _GL_INCLUDING_MATH_H
 
 #ifndef _@GUARD_PREFIX@_MATH_H
 #define _@GUARD_PREFIX@_MATH_H
 
+/* On OpenVMS, NAN, INFINITY, and HUGEVAL macros are defined in <fp.h>.  */
+#if defined __VMS && ! defined NAN
+# include <fp.h>
+#endif
+
 #ifndef _GL_INLINE_HEADER_BEGIN
  #error "Please include config.h first."
 #endif
@@ -62,20 +82,20 @@ _gl_cxx_ ## func ## l (long double l)                               \
 {                                                                   \
   return func (l);                                                  \
 }
-# define _GL_MATH_CXX_REAL_FLOATING_DECL_2(func) \
+# define _GL_MATH_CXX_REAL_FLOATING_DECL_2(func,rpl_func,rettype) \
 _GL_BEGIN_NAMESPACE                                                 \
-inline int                                                          \
-func (float f)                                                      \
+inline rettype                                                      \
+rpl_func (float f)                                                  \
 {                                                                   \
   return _gl_cxx_ ## func ## f (f);                                 \
 }                                                                   \
-inline int                                                          \
-func (double d)                                                     \
+inline rettype                                                      \
+rpl_func (double d)                                                 \
 {                                                                   \
   return _gl_cxx_ ## func ## d (d);                                 \
 }                                                                   \
-inline int                                                          \
-func (long double l)                                                \
+inline rettype                                                      \
+rpl_func (long double l)                                            \
 {                                                                   \
   return _gl_cxx_ ## func ## l (l);                                 \
 }                                                                   \
@@ -87,27 +107,27 @@ _GL_END_NAMESPACE
    classification macros with an argument of real-floating (that is,
    one of float, double, or long double).  */
 #define _GL_WARN_REAL_FLOATING_DECL(func) \
-_GL_MATH_INLINE int                                                 \
-rpl_ ## func ## f (float f)                                         \
-{                                                                   \
-  return func (f);                                                  \
-}                                                                   \
-_GL_MATH_INLINE int                                                 \
-rpl_ ## func ## d (double d)                                        \
-{                                                                   \
-  return func (d);                                                  \
-}                                                                   \
-_GL_MATH_INLINE int                                                 \
-rpl_ ## func ## l (long double l)                                   \
-{                                                                   \
-  return func (l);                                                  \
-}                                                                   \
-_GL_WARN_ON_USE (rpl_ ## func ## f, #func " is unportable - "       \
-                 "use gnulib module " #func " for portability");    \
-_GL_WARN_ON_USE (rpl_ ## func ## d, #func " is unportable - "       \
-                 "use gnulib module " #func " for portability");    \
-_GL_WARN_ON_USE (rpl_ ## func ## l, #func " is unportable - "       \
-                 "use gnulib module " #func " for portability")
+_GL_MATH_INLINE int                                                       \
+_GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - "                      \
+                           "use gnulib module " #func " for portability") \
+rpl_ ## func ## f (float f)                                               \
+{                                                                         \
+  return func (f);                                                        \
+}                                                                         \
+_GL_MATH_INLINE int                                                       \
+_GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - "                      \
+                           "use gnulib module " #func " for portability") \
+rpl_ ## func ## d (double d)                                              \
+{                                                                         \
+  return func (d);                                                        \
+}                                                                         \
+_GL_MATH_INLINE int                                                       \
+_GL_WARN_ON_USE_ATTRIBUTE (#func " is unportable - "                      \
+                           "use gnulib module " #func " for portability") \
+rpl_ ## func ## l (long double l)                                         \
+{                                                                         \
+  return func (l);                                                        \
+}
 #define _GL_WARN_REAL_FLOATING_IMPL(func, value) \
   (sizeof (value) == sizeof (float) ? rpl_ ## func ## f (value)     \
    : sizeof (value) == sizeof (double) ? rpl_ ## func ## d (value)  \
@@ -189,8 +209,17 @@ _NaN ()
 #endif
 
 
-/* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined.  */
-#if !(defined FP_ILOGB0 && defined FP_ILOGBNAN)
+#if defined FP_ILOGB0 && defined FP_ILOGBNAN
+ /* Ensure FP_ILOGB0 and FP_ILOGBNAN are correct.  */
+# if defined __HAIKU__
+  /* Haiku: match what ilogb() does */
+#  undef FP_ILOGB0
+#  undef FP_ILOGBNAN
+#  define FP_ILOGB0   (- 2147483647 - 1) /* INT_MIN */
+#  define FP_ILOGBNAN (- 2147483647 - 1) /* INT_MIN */
+# endif
+#else
+ /* Ensure FP_ILOGB0 and FP_ILOGBNAN are defined.  */
 # if defined __NetBSD__ || defined __sgi
   /* NetBSD, IRIX 6.5: match what ilogb() does */
 #  define FP_ILOGB0   (- 2147483647 - 1) /* INT_MIN */
@@ -241,7 +270,9 @@ _GL_WARN_ON_USE (acosf, "acosf is unportable - "
 _GL_FUNCDECL_SYS (acosl, long double, (long double x));
 # endif
 _GL_CXXALIAS_SYS (acosl, long double, (long double x));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (acosl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef acosl
 # if HAVE_RAW_DECL_ACOSL
@@ -281,7 +312,9 @@ _GL_WARN_ON_USE (asinf, "asinf is unportable - "
 _GL_FUNCDECL_SYS (asinl, long double, (long double x));
 # endif
 _GL_CXXALIAS_SYS (asinl, long double, (long double x));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (asinl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef asinl
 # if HAVE_RAW_DECL_ASINL
@@ -321,7 +354,9 @@ _GL_WARN_ON_USE (atanf, "atanf is unportable - "
 _GL_FUNCDECL_SYS (atanl, long double, (long double x));
 # endif
 _GL_CXXALIAS_SYS (atanl, long double, (long double x));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (atanl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef atanl
 # if HAVE_RAW_DECL_ATANL
@@ -384,7 +419,9 @@ _GL_WARN_ON_USE (cbrtf, "cbrtf is unportable - "
 _GL_FUNCDECL_SYS (cbrt, double, (double x));
 # endif
 _GL_CXXALIAS_SYS (cbrt, double, (double x));
-_GL_CXXALIASWARN (cbrt);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (cbrt, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef cbrt
 # if HAVE_RAW_DECL_CBRT
@@ -452,7 +489,9 @@ _GL_CXXALIAS_RPL (ceil, double, (double x));
 # else
 _GL_CXXALIAS_SYS (ceil, double, (double x));
 # endif
-_GL_CXXALIASWARN (ceil);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (ceil, double, (double x));
+# endif
 #endif
 
 #if @GNULIB_CEILL@
@@ -470,7 +509,9 @@ _GL_FUNCDECL_SYS (ceill, long double, (long double x));
 #  endif
 _GL_CXXALIAS_SYS (ceill, long double, (long double x));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (ceill);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef ceill
 # if HAVE_RAW_DECL_CEILL
@@ -482,6 +523,7 @@ _GL_WARN_ON_USE (ceill, "ceill is unportable - "
 
 #if @GNULIB_COPYSIGNF@
 # if !@HAVE_DECL_COPYSIGNF@
+#  undef copysignf
 _GL_FUNCDECL_SYS (copysignf, float, (float x, float y));
 # endif
 _GL_CXXALIAS_SYS (copysignf, float, (float x, float y));
@@ -499,7 +541,9 @@ _GL_WARN_ON_USE (copysignf, "copysignf is unportable - "
 _GL_FUNCDECL_SYS (copysign, double, (double x, double y));
 # endif
 _GL_CXXALIAS_SYS (copysign, double, (double x, double y));
-_GL_CXXALIASWARN (copysign);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (copysign, double, (double x, double y));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef copysign
 # if HAVE_RAW_DECL_COPYSIGN
@@ -553,7 +597,9 @@ _GL_WARN_ON_USE (cosf, "cosf is unportable - "
 _GL_FUNCDECL_SYS (cosl, long double, (long double x));
 # endif
 _GL_CXXALIAS_SYS (cosl, long double, (long double x));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (cosl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef cosl
 # if HAVE_RAW_DECL_COSL
@@ -613,12 +659,23 @@ _GL_WARN_ON_USE (expf, "expf is unportable - "
 #endif
 
 #if @GNULIB_EXPL@
-# if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
-#  undef expl
+# if @REPLACE_EXPL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef expl
+#   define expl rpl_expl
+#  endif
+_GL_FUNCDECL_RPL (expl, long double, (long double x));
+_GL_CXXALIAS_RPL (expl, long double, (long double x));
+# else
+#  if !@HAVE_EXPL@ || !@HAVE_DECL_EXPL@
+#   undef expl
 _GL_FUNCDECL_SYS (expl, long double, (long double x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (expl, long double, (long double x));
+# endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (expl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef expl
 # if HAVE_RAW_DECL_EXPL
@@ -656,7 +713,9 @@ _GL_FUNCDECL_SYS (exp2, double, (double x));
 #  endif
 _GL_CXXALIAS_SYS (exp2, double, (double x));
 # endif
-_GL_CXXALIASWARN (exp2);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (exp2, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef exp2
 # if HAVE_RAW_DECL_EXP2
@@ -727,7 +786,9 @@ _GL_FUNCDECL_SYS (expm1, double, (double x));
 #  endif
 _GL_CXXALIAS_SYS (expm1, double, (double x));
 # endif
-_GL_CXXALIASWARN (expm1);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (expm1, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef expm1
 # if HAVE_RAW_DECL_EXPM1
@@ -737,11 +798,22 @@ _GL_WARN_ON_USE (expm1, "expm1 is unportable - "
 #endif
 
 #if @GNULIB_EXPM1L@
-# if !@HAVE_DECL_EXPM1L@
-#  undef expm1l
+# if @REPLACE_EXPM1L@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef expm1l
+#   define expm1l rpl_expm1l
+#  endif
+_GL_FUNCDECL_RPL (expm1l, long double, (long double x));
+_GL_CXXALIAS_RPL (expm1l, long double, (long double x));
+# else
+#  if !@HAVE_DECL_EXPM1L@
+#   undef expm1l
+#   if !(defined __cplusplus && defined _AIX)
 _GL_FUNCDECL_SYS (expm1l, long double, (long double x));
-# endif
+#   endif
+#  endif
 _GL_CXXALIAS_SYS (expm1l, long double, (long double x));
+# endif
 _GL_CXXALIASWARN (expm1l);
 #elif defined GNULIB_POSIXCHECK
 # undef expm1l
@@ -758,7 +830,9 @@ _GL_WARN_ON_USE (expm1l, "expm1l is unportable - "
 _GL_FUNCDECL_SYS (fabsf, float, (float x));
 # endif
 _GL_CXXALIAS_SYS (fabsf, float, (float x));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fabsf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fabsf
 # if HAVE_RAW_DECL_FABSF
@@ -782,7 +856,9 @@ _GL_FUNCDECL_SYS (fabsl, long double, (long double x));
 #  endif
 _GL_CXXALIAS_SYS (fabsl, long double, (long double x));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fabsl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fabsl
 # if HAVE_RAW_DECL_FABSL
@@ -827,7 +903,9 @@ _GL_CXXALIAS_RPL (floor, double, (double x));
 # else
 _GL_CXXALIAS_SYS (floor, double, (double x));
 # endif
-_GL_CXXALIASWARN (floor);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (floor, double, (double x));
+# endif
 #endif
 
 #if @GNULIB_FLOORL@
@@ -845,7 +923,9 @@ _GL_FUNCDECL_SYS (floorl, long double, (long double x));
 #  endif
 _GL_CXXALIAS_SYS (floorl, long double, (long double x));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (floorl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef floorl
 # if HAVE_RAW_DECL_FLOORL
@@ -865,6 +945,7 @@ _GL_FUNCDECL_RPL (fmaf, float, (float x, float y, float z));
 _GL_CXXALIAS_RPL (fmaf, float, (float x, float y, float z));
 # else
 #  if !@HAVE_FMAF@
+#   undef fmaf
 _GL_FUNCDECL_SYS (fmaf, float, (float x, float y, float z));
 #  endif
 _GL_CXXALIAS_SYS (fmaf, float, (float x, float y, float z));
@@ -888,11 +969,14 @@ _GL_FUNCDECL_RPL (fma, double, (double x, double y, double z));
 _GL_CXXALIAS_RPL (fma, double, (double x, double y, double z));
 # else
 #  if !@HAVE_FMA@
+#   undef fma
 _GL_FUNCDECL_SYS (fma, double, (double x, double y, double z));
 #  endif
 _GL_CXXALIAS_SYS (fma, double, (double x, double y, double z));
 # endif
-_GL_CXXALIASWARN (fma);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (fma, double, (double x, double y, double z));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fma
 # if HAVE_RAW_DECL_FMA
@@ -914,8 +998,10 @@ _GL_CXXALIAS_RPL (fmal, long double,
 # else
 #  if !@HAVE_FMAL@
 #   undef fmal
+#   if !(defined __cplusplus && defined _AIX)
 _GL_FUNCDECL_SYS (fmal, long double,
                   (long double x, long double y, long double z));
+#   endif
 #  endif
 _GL_CXXALIAS_SYS (fmal, long double,
                   (long double x, long double y, long double z));
@@ -965,7 +1051,9 @@ _GL_CXXALIAS_RPL (fmod, double, (double x, double y));
 # else
 _GL_CXXALIAS_SYS (fmod, double, (double x, double y));
 # endif
-_GL_CXXALIASWARN (fmod);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (fmod, double, (double x, double y));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fmod
 # if HAVE_RAW_DECL_FMOD
@@ -989,7 +1077,9 @@ _GL_FUNCDECL_SYS (fmodl, long double, (long double x, long double y));
 #  endif
 _GL_CXXALIAS_SYS (fmodl, long double, (long double x, long double y));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fmodl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fmodl
 # if HAVE_RAW_DECL_FMODL
@@ -1021,7 +1111,9 @@ _GL_FUNCDECL_SYS (frexpf, float, (float x, int *expptr) _GL_ARG_NONNULL ((2)));
 #  endif
 _GL_CXXALIAS_SYS (frexpf, float, (float x, int *expptr));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (frexpf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef frexpf
 # if HAVE_RAW_DECL_FREXPF
@@ -1048,7 +1140,9 @@ _GL_CXXALIAS_RPL (frexp, double, (double x, int *expptr));
 # else
 _GL_CXXALIAS_SYS (frexp, double, (double x, int *expptr));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN1 (frexp, double, (double x, int *expptr));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef frexp
 /* Assume frexp is always declared.  */
@@ -1081,7 +1175,9 @@ _GL_CXXALIAS_SYS (frexpl, long double, (long double x, int *expptr));
 # endif
 #endif
 #if @GNULIB_FREXPL@ && !(@REPLACE_FREXPL@ && !@HAVE_DECL_FREXPL@)
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (frexpl);
+# endif
 #endif
 #if !@GNULIB_FREXPL@ && defined GNULIB_POSIXCHECK
 # undef frexpl
@@ -1107,7 +1203,9 @@ _GL_FUNCDECL_SYS (hypotf, float, (float x, float y));
 #  endif
 _GL_CXXALIAS_SYS (hypotf, float, (float x, float y));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (hypotf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef hypotf
 # if HAVE_RAW_DECL_HYPOTF
@@ -1128,7 +1226,9 @@ _GL_CXXALIAS_RPL (hypot, double, (double x, double y));
 # else
 _GL_CXXALIAS_SYS (hypot, double, (double x, double y));
 # endif
-_GL_CXXALIASWARN (hypot);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (hypot, double, (double x, double y));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef hypot
 # if HAVE_RAW_DECL_HYPOT
@@ -1152,7 +1252,9 @@ _GL_FUNCDECL_SYS (hypotl, long double, (long double x, long double y));
 #  endif
 _GL_CXXALIAS_SYS (hypotl, long double, (long double x, long double y));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (hypotl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef hypotl
 # if HAVE_RAW_DECL_HYPOTL
@@ -1199,7 +1301,9 @@ _GL_FUNCDECL_SYS (ilogb, int, (double x));
 #  endif
 _GL_CXXALIAS_SYS (ilogb, int, (double x));
 # endif
-_GL_CXXALIASWARN (ilogb);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (ilogb, int, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef ilogb
 # if HAVE_RAW_DECL_ILOGB
@@ -1209,10 +1313,20 @@ _GL_WARN_ON_USE (ilogb, "ilogb is unportable - "
 #endif
 
 #if @GNULIB_ILOGBL@
-# if !@HAVE_ILOGBL@
+# if @REPLACE_ILOGBL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ilogbl
+#   define ilogbl rpl_ilogbl
+#  endif
+_GL_FUNCDECL_RPL (ilogbl, int, (long double x));
+_GL_CXXALIAS_RPL (ilogbl, int, (long double x));
+# else
+#  if !@HAVE_ILOGBL@
+#   undef ilogbl
 _GL_FUNCDECL_SYS (ilogbl, int, (long double x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (ilogbl, int, (long double x));
+# endif
 _GL_CXXALIASWARN (ilogbl);
 #elif defined GNULIB_POSIXCHECK
 # undef ilogbl
@@ -1223,6 +1337,55 @@ _GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - "
 #endif
 
 
+#if @GNULIB_MDA_J0@
+/* On native Windows, map 'j0' to '_j0', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::j0 always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef j0
+#   define j0 _j0
+#  endif
+_GL_CXXALIAS_MDA (j0, double, (double x));
+# else
+_GL_CXXALIAS_SYS (j0, double, (double x));
+# endif
+_GL_CXXALIASWARN (j0);
+#endif
+
+#if @GNULIB_MDA_J1@
+/* On native Windows, map 'j1' to '_j1', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::j1 always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef j1
+#   define j1 _j1
+#  endif
+_GL_CXXALIAS_MDA (j1, double, (double x));
+# else
+_GL_CXXALIAS_SYS (j1, double, (double x));
+# endif
+_GL_CXXALIASWARN (j1);
+#endif
+
+#if @GNULIB_MDA_JN@
+/* On native Windows, map 'jn' to '_jn', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::jn always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef jn
+#   define jn _jn
+#  endif
+_GL_CXXALIAS_MDA (jn, double, (int n, double x));
+# else
+_GL_CXXALIAS_SYS (jn, double, (int n, double x));
+# endif
+_GL_CXXALIASWARN (jn);
+#endif
+
+
 /* Return x * 2^exp.  */
 #if @GNULIB_LDEXPF@
 # if !@HAVE_LDEXPF@
@@ -1230,7 +1393,9 @@ _GL_WARN_ON_USE (ilogbl, "ilogbl is unportable - "
 _GL_FUNCDECL_SYS (ldexpf, float, (float x, int exp));
 # endif
 _GL_CXXALIAS_SYS (ldexpf, float, (float x, int exp));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (ldexpf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef ldexpf
 # if HAVE_RAW_DECL_LDEXPF
@@ -1256,7 +1421,9 @@ _GL_CXXALIAS_SYS (ldexpl, long double, (long double x, int exp));
 # endif
 #endif
 #if @GNULIB_LDEXPL@
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (ldexpl);
+# endif
 #endif
 #if !@GNULIB_LDEXPL@ && defined GNULIB_POSIXCHECK
 # undef ldexpl
@@ -1302,7 +1469,9 @@ _GL_CXXALIAS_RPL (log, double, (double x));
 # else
 _GL_CXXALIAS_SYS (log, double, (double x));
 # endif
-_GL_CXXALIASWARN (log);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (log, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef log
 # if HAVE_RAW_DECL_LOG
@@ -1326,7 +1495,9 @@ _GL_FUNCDECL_SYS (logl, long double, (long double x));
 #  endif
 _GL_CXXALIAS_SYS (logl, long double, (long double x));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (logl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef logl
 # if HAVE_RAW_DECL_LOGL
@@ -1371,7 +1542,9 @@ _GL_CXXALIAS_RPL (log10, double, (double x));
 # else
 _GL_CXXALIAS_SYS (log10, double, (double x));
 # endif
-_GL_CXXALIASWARN (log10);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (log10, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef log10
 # if HAVE_RAW_DECL_LOG10
@@ -1395,7 +1568,9 @@ _GL_FUNCDECL_SYS (log10l, long double, (long double x));
 #  endif
 _GL_CXXALIAS_SYS (log10l, long double, (long double x));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (log10l);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef log10l
 # if HAVE_RAW_DECL_LOG10L
@@ -1442,7 +1617,9 @@ _GL_FUNCDECL_SYS (log1p, double, (double x));
 #  endif
 _GL_CXXALIAS_SYS (log1p, double, (double x));
 # endif
-_GL_CXXALIASWARN (log1p);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (log1p, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef log1p
 # if HAVE_RAW_DECL_LOG1P
@@ -1514,7 +1691,9 @@ _GL_FUNCDECL_SYS (log2, double, (double x));
 #  endif
 _GL_CXXALIAS_SYS (log2, double, (double x));
 # endif
-_GL_CXXALIASWARN (log2);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (log2, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef log2
 # if HAVE_RAW_DECL_LOG2
@@ -1584,7 +1763,9 @@ _GL_FUNCDECL_SYS (logb, double, (double x));
 #  endif
 _GL_CXXALIAS_SYS (logb, double, (double x));
 # endif
-_GL_CXXALIASWARN (logb);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (logb, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef logb
 # if HAVE_RAW_DECL_LOGB
@@ -1652,7 +1833,9 @@ _GL_CXXALIAS_RPL (modf, double, (double x, double *iptr));
 # else
 _GL_CXXALIAS_SYS (modf, double, (double x, double *iptr));
 # endif
-_GL_CXXALIASWARN (modf);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (modf, double, (double x, double *iptr));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef modf
 # if HAVE_RAW_DECL_MODF
@@ -1678,7 +1861,9 @@ _GL_FUNCDECL_SYS (modfl, long double, (long double x, long double *iptr)
 #  endif
 _GL_CXXALIAS_SYS (modfl, long double, (long double x, long double *iptr));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (modfl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef modfl
 # if HAVE_RAW_DECL_MODFL
@@ -1741,7 +1926,9 @@ _GL_FUNCDECL_SYS (remainder, double, (double x, double y));
 #  endif
 _GL_CXXALIAS_SYS (remainder, double, (double x, double y));
 # endif
-_GL_CXXALIASWARN (remainder);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (remainder, double, (double x, double y));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef remainder
 # if HAVE_RAW_DECL_REMAINDER
@@ -1761,7 +1948,9 @@ _GL_CXXALIAS_RPL (remainderl, long double, (long double x, long double y));
 # else
 #  if !@HAVE_DECL_REMAINDERL@
 #   undef remainderl
+#   if !(defined __cplusplus && defined _AIX)
 _GL_FUNCDECL_SYS (remainderl, long double, (long double x, long double y));
+#   endif
 #  endif
 _GL_CXXALIAS_SYS (remainderl, long double, (long double x, long double y));
 # endif
@@ -1794,7 +1983,9 @@ _GL_WARN_ON_USE (rintf, "rintf is unportable - "
 _GL_FUNCDECL_SYS (rint, double, (double x));
 # endif
 _GL_CXXALIAS_SYS (rint, double, (double x));
-_GL_CXXALIASWARN (rint);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (rint, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef rint
 # if HAVE_RAW_DECL_RINT
@@ -1804,10 +1995,19 @@ _GL_WARN_ON_USE (rint, "rint is unportable - "
 #endif
 
 #if @GNULIB_RINTL@
-# if !@HAVE_RINTL@
+# if @REPLACE_RINTL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef rintl
+#   define rintl rpl_rintl
+#  endif
+_GL_FUNCDECL_RPL (rintl, long double, (long double x));
+_GL_CXXALIAS_RPL (rintl, long double, (long double x));
+# else
+#  if !@HAVE_RINTL@
 _GL_FUNCDECL_SYS (rintl, long double, (long double x));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (rintl, long double, (long double x));
+# endif
 _GL_CXXALIASWARN (rintl);
 #elif defined GNULIB_POSIXCHECK
 # undef rintl
@@ -1855,7 +2055,9 @@ _GL_FUNCDECL_SYS (round, double, (double x));
 #  endif
 _GL_CXXALIAS_SYS (round, double, (double x));
 # endif
-_GL_CXXALIASWARN (round);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (round, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef round
 # if HAVE_RAW_DECL_ROUND
@@ -1875,7 +2077,9 @@ _GL_CXXALIAS_RPL (roundl, long double, (long double x));
 # else
 #  if !@HAVE_DECL_ROUNDL@
 #   undef roundl
+#   if !(defined __cplusplus && defined _AIX)
 _GL_FUNCDECL_SYS (roundl, long double, (long double x));
+#   endif
 #  endif
 _GL_CXXALIAS_SYS (roundl, long double, (long double x));
 # endif
@@ -1899,7 +2103,7 @@ _GL_FUNCDECL_RPL (sinf, float, (float x));
 _GL_CXXALIAS_RPL (sinf, float, (float x));
 # else
 #  if !@HAVE_SINF@
- #  undef sinf
+  undef sinf
 _GL_FUNCDECL_SYS (sinf, float, (float x));
 #  endif
 _GL_CXXALIAS_SYS (sinf, float, (float x));
@@ -1919,7 +2123,9 @@ _GL_WARN_ON_USE (sinf, "sinf is unportable - "
 _GL_FUNCDECL_SYS (sinl, long double, (long double x));
 # endif
 _GL_CXXALIAS_SYS (sinl, long double, (long double x));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (sinl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef sinl
 # if HAVE_RAW_DECL_SINL
@@ -1993,7 +2199,9 @@ _GL_FUNCDECL_SYS (sqrtl, long double, (long double x));
 #  endif
 _GL_CXXALIAS_SYS (sqrtl, long double, (long double x));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (sqrtl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef sqrtl
 # if HAVE_RAW_DECL_SQRTL
@@ -2033,7 +2241,9 @@ _GL_WARN_ON_USE (tanf, "tanf is unportable - "
 _GL_FUNCDECL_SYS (tanl, long double, (long double x));
 # endif
 _GL_CXXALIAS_SYS (tanl, long double, (long double x));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (tanl);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef tanl
 # if HAVE_RAW_DECL_TANL
@@ -2105,7 +2315,9 @@ _GL_FUNCDECL_SYS (trunc, double, (double x));
 #  endif
 _GL_CXXALIAS_SYS (trunc, double, (double x));
 # endif
-_GL_CXXALIASWARN (trunc);
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN1 (trunc, double, (double x));
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef trunc
 # if HAVE_RAW_DECL_TRUNC
@@ -2138,6 +2350,55 @@ _GL_WARN_ON_USE (truncl, "truncl is unportable - "
 #endif
 
 
+#if @GNULIB_MDA_Y0@
+/* On native Windows, map 'y0' to '_y0', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::y0 always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef y0
+#   define y0 _y0
+#  endif
+_GL_CXXALIAS_MDA (y0, double, (double x));
+# else
+_GL_CXXALIAS_SYS (y0, double, (double x));
+# endif
+_GL_CXXALIASWARN (y0);
+#endif
+
+#if @GNULIB_MDA_Y1@
+/* On native Windows, map 'y1' to '_y1', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::y1 always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef y1
+#   define y1 _y1
+#  endif
+_GL_CXXALIAS_MDA (y1, double, (double x));
+# else
+_GL_CXXALIAS_SYS (y1, double, (double x));
+# endif
+_GL_CXXALIASWARN (y1);
+#endif
+
+#if @GNULIB_MDA_YN@
+/* On native Windows, map 'yn' to '_yn', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::yn always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef yn
+#   define yn _yn
+#  endif
+_GL_CXXALIAS_MDA (yn, double, (int n, double x));
+# else
+_GL_CXXALIAS_SYS (yn, double, (int n, double x));
+# endif
+_GL_CXXALIASWARN (yn);
+#endif
+
+
 /* Definitions of function-like macros come here, after the function
    declarations.  */
 
@@ -2157,7 +2418,14 @@ _GL_EXTERN_C int gl_isfinitel (long double x);
 #  if defined isfinite || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isfinite)
 #   undef isfinite
-_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite)
+#   if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__)))
+  /* This platform's <cmath> possibly defines isfinite through a set of inline
+     functions.  */
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, rpl_isfinite, bool)
+#    define isfinite rpl_isfinite
+#   else
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isfinite, isfinite, bool)
+#   endif
 #  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -2184,7 +2452,14 @@ _GL_EXTERN_C int gl_isinfl (long double x);
 #  if defined isinf || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isinf)
 #   undef isinf
-_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf)
+#   if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__)))
+  /* This platform's <cmath> possibly defines isinf through a set of inline
+     functions.  */
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf, rpl_isinf, bool)
+#    define isinf rpl_isinf
+#   else
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isinf, isinf, bool)
+#   endif
 #  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -2201,10 +2476,11 @@ _GL_WARN_REAL_FLOATING_DECL (isinf);
 # if @HAVE_ISNANF@
 /* The original <math.h> included above provides a declaration of isnan macro
    or (older) isnanf function.  */
-#  if __GNUC__ >= 4
-    /* GCC 4.0 and newer provides three built-ins for isnan.  */
+#  if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+    /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
+       GCC >= 4.0 also provides __builtin_isnanf, but clang doesn't.  */
 #   undef isnanf
-#   define isnanf(x) __builtin_isnanf ((float)(x))
+#   define isnanf(x) __builtin_isnan ((float)(x))
 #  elif defined isnan
 #   undef isnanf
 #   define isnanf(x) isnan ((float)(x))
@@ -2224,8 +2500,8 @@ _GL_EXTERN_C int isnanf (float x);
 # if @HAVE_ISNAND@
 /* The original <math.h> included above provides a declaration of isnan
    macro.  */
-#  if __GNUC__ >= 4
-    /* GCC 4.0 and newer provides three built-ins for isnan.  */
+#  if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+    /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.  */
 #   undef isnand
 #   define isnand(x) __builtin_isnan ((double)(x))
 #  else
@@ -2245,10 +2521,11 @@ _GL_EXTERN_C int isnand (double x);
 # if @HAVE_ISNANL@
 /* The original <math.h> included above provides a declaration of isnan
    macro or (older) isnanl function.  */
-#  if __GNUC__ >= 4
-    /* GCC 4.0 and newer provides three built-ins for isnan.  */
+#  if (__GNUC__ >= 4) || (__clang_major__ >= 4)
+    /* GCC >= 4.0 and clang provide a type-generic built-in for isnan.
+       GCC >= 4.0 also provides __builtin_isnanl, but clang doesn't.  */
 #   undef isnanl
-#   define isnanl(x) __builtin_isnanl ((long double)(x))
+#   define isnanl(x) __builtin_isnan ((long double)(x))
 #  elif defined isnan
 #   undef isnanl
 #   define isnanl(x) isnan ((long double)(x))
@@ -2268,20 +2545,20 @@ _GL_EXTERN_C int isnanl (long double x) _GL_ATTRIBUTE_CONST;
    isnanf.h (e.g.) here, because those may end up being macros
    that recursively expand back to isnan.  So use the gnulib
    replacements for them directly. */
-#  if @HAVE_ISNANF@ && __GNUC__ >= 4
-#   define gl_isnan_f(x) __builtin_isnanf ((float)(x))
+#  if @HAVE_ISNANF@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
+#   define gl_isnan_f(x) __builtin_isnan ((float)(x))
 #  else
 _GL_EXTERN_C int rpl_isnanf (float x);
 #   define gl_isnan_f(x) rpl_isnanf (x)
 #  endif
-#  if @HAVE_ISNAND@ && __GNUC__ >= 4
+#  if @HAVE_ISNAND@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
 #   define gl_isnan_d(x) __builtin_isnan ((double)(x))
 #  else
 _GL_EXTERN_C int rpl_isnand (double x);
 #   define gl_isnan_d(x) rpl_isnand (x)
 #  endif
-#  if @HAVE_ISNANL@ && __GNUC__ >= 4
-#   define gl_isnan_l(x) __builtin_isnanl ((long double)(x))
+#  if @HAVE_ISNANL@ && (__GNUC__ >= 4) || (__clang_major__ >= 4)
+#   define gl_isnan_l(x) __builtin_isnan ((long double)(x))
 #  else
 _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
 #   define gl_isnan_l(x) rpl_isnanl (x)
@@ -2291,18 +2568,25 @@ _GL_EXTERN_C int rpl_isnanl (long double x) _GL_ATTRIBUTE_CONST;
    (sizeof (x) == sizeof (long double) ? gl_isnan_l (x) : \
     sizeof (x) == sizeof (double) ? gl_isnan_d (x) : \
     gl_isnan_f (x))
-# elif __GNUC__ >= 4
+# elif (__GNUC__ >= 4) || (__clang_major__ >= 4)
 #  undef isnan
 #  define isnan(x) \
-   (sizeof (x) == sizeof (long double) ? __builtin_isnanl ((long double)(x)) : \
+   (sizeof (x) == sizeof (long double) ? __builtin_isnan ((long double)(x)) : \
     sizeof (x) == sizeof (double) ? __builtin_isnan ((double)(x)) : \
-    __builtin_isnanf ((float)(x)))
+    __builtin_isnan ((float)(x)))
 # endif
 # ifdef __cplusplus
 #  if defined isnan || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (isnan)
 #   undef isnan
-_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan)
+#   if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__ && __clang_major__ < 12) || (defined __FreeBSD__ && __clang_major__ < 7) || defined __OpenBSD__ || (defined _WIN32 && !defined __CYGWIN__)))
+  /* This platform's <cmath> possibly defines isnan through a set of inline
+     functions.  */
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, rpl_isnan, bool)
+#    define isnan rpl_isnan
+#   else
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (isnan, isnan, bool)
+#   endif
 #  endif
 # else
 /* Ensure isnan is a macro.  */
@@ -2320,21 +2604,21 @@ _GL_WARN_REAL_FLOATING_DECL (isnan);
 
 
 #if @GNULIB_SIGNBIT@
-# if (@REPLACE_SIGNBIT_USING_GCC@ \
+# if (@REPLACE_SIGNBIT_USING_BUILTINS@ \
       && (!defined __cplusplus || __cplusplus < 201103))
 #  undef signbit
-   /* GCC 4.0 and newer provides three built-ins for signbit.  */
+   /* GCC >= 4.0 and clang provide three built-ins for signbit.  */
 #  define signbit(x) \
    (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
     sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
     __builtin_signbitf (x))
 # endif
-# if @REPLACE_SIGNBIT@
+# if @REPLACE_SIGNBIT@ && !GNULIB_defined_signbit
 #  undef signbit
 _GL_EXTERN_C int gl_signbitf (float arg);
 _GL_EXTERN_C int gl_signbitd (double arg);
 _GL_EXTERN_C int gl_signbitl (long double arg);
-#  if __GNUC__ >= 2 && !defined __STRICT_ANSI__
+#  if (__GNUC__ >= 2 || defined __clang__) && !defined __STRICT_ANSI__
 #   define _GL_NUM_UINT_WORDS(type) \
       ((sizeof (type) + sizeof (unsigned int) - 1) / sizeof (unsigned int))
 #   if defined FLT_SIGNBIT_WORD && defined FLT_SIGNBIT_BIT && !defined gl_signbitf
@@ -2372,12 +2656,20 @@ _GL_EXTERN_C int gl_signbitl (long double arg);
    (sizeof (x) == sizeof (long double) ? gl_signbitl (x) : \
     sizeof (x) == sizeof (double) ? gl_signbitd (x) : \
     gl_signbitf (x))
+#  define GNULIB_defined_signbit 1
 # endif
 # ifdef __cplusplus
 #  if defined signbit || defined GNULIB_NAMESPACE
 _GL_MATH_CXX_REAL_FLOATING_DECL_1 (signbit)
 #   undef signbit
-_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit)
+#   if __GNUC__ >= 6 || (defined __clang__ && !((defined __APPLE__ && defined __MACH__) || defined __FreeBSD__ || defined __OpenBSD__ || defined _AIX || (defined _WIN32 && !defined __CYGWIN__)))
+  /* This platform's <cmath> possibly defines signbit through a set of inline
+     functions.  */
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit, rpl_signbit, bool)
+#    define signbit rpl_signbit
+#   else
+_GL_MATH_CXX_REAL_FLOATING_DECL_2 (signbit, signbit, bool)
+#   endif
 #  endif
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -2391,4 +2683,5 @@ _GL_WARN_REAL_FLOATING_DECL (signbit);
 _GL_INLINE_HEADER_END
 
 #endif /* _@GUARD_PREFIX@_MATH_H */
+#endif /* _GL_INCLUDING_MATH_H */
 #endif /* _@GUARD_PREFIX@_MATH_H */
diff --git a/lib/mbchar.c b/lib/mbchar.c
new file mode 100644 (file)
index 0000000..a6c113c
--- /dev/null
@@ -0,0 +1,37 @@
+/* Copyright (C) 2001, 2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+
+#include <config.h>
+
+#define MBCHAR_INLINE _GL_EXTERN_INLINE
+
+#include <limits.h>
+
+#include "mbchar.h"
+
+#if IS_BASIC_ASCII
+
+/* Bit table of characters in the ISO C "basic character set".  */
+const unsigned int is_basic_table [UCHAR_MAX / 32 + 1] =
+{
+  0x00001a00,           /* '\t' '\v' '\f' */
+  0xffffffef,           /* ' '...'#' '%'...'?' */
+  0xfffffffe,           /* 'A'...'Z' '[' '\\' ']' '^' '_' */
+  0x7ffffffe            /* 'a'...'z' '{' '|' '}' '~' */
+  /* The remaining bits are 0.  */
+};
+
+#endif /* IS_BASIC_ASCII */
diff --git a/lib/mbchar.h b/lib/mbchar.h
new file mode 100644 (file)
index 0000000..a63a7f3
--- /dev/null
@@ -0,0 +1,353 @@
+/* Multibyte character data type.
+   Copyright (C) 2001, 2005-2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>.  */
+
+/* A multibyte character is a short subsequence of a char* string,
+   representing a single wide character.
+
+   We use multibyte characters instead of wide characters because of
+   the following goals:
+   1) correct multibyte handling, i.e. operate according to the LC_CTYPE
+      locale,
+   2) ease of maintenance, i.e. the maintainer needs not know all details
+      of the ISO C 99 standard,
+   3) don't fail grossly if the input is not in the encoding set by the
+      locale, because often different encodings are in use in the same
+      countries (ISO-8859-1/UTF-8, EUC-JP/Shift_JIS, ...),
+   4) fast in the case of ASCII characters,
+   5) portability, i.e. don't make unportable assumptions about wchar_t.
+
+   Multibyte characters are only accessed through the mb* macros.
+
+   mb_ptr (mbc)
+     return a pointer to the beginning of the multibyte sequence.
+
+   mb_len (mbc)
+     returns the number of bytes occupied by the multibyte sequence.
+     Always > 0.
+
+   mb_iseq (mbc, sc)
+     returns true if mbc is the standard ASCII character sc.
+
+   mb_isnul (mbc)
+     returns true if mbc is the nul character.
+
+   mb_cmp (mbc1, mbc2)
+     returns a positive, zero, or negative value depending on whether mbc1
+     sorts after, same or before mbc2.
+
+   mb_casecmp (mbc1, mbc2)
+     returns a positive, zero, or negative value depending on whether mbc1
+     sorts after, same or before mbc2, modulo upper/lowercase conversion.
+
+   mb_equal (mbc1, mbc2)
+     returns true if mbc1 and mbc2 are equal.
+
+   mb_caseequal (mbc1, mbc2)
+     returns true if mbc1 and mbc2 are equal modulo upper/lowercase conversion.
+
+   mb_isalnum (mbc)
+     returns true if mbc is alphanumeric.
+
+   mb_isalpha (mbc)
+     returns true if mbc is alphabetic.
+
+   mb_isascii(mbc)
+     returns true if mbc is plain ASCII.
+
+   mb_isblank (mbc)
+     returns true if mbc is a blank.
+
+   mb_iscntrl (mbc)
+     returns true if mbc is a control character.
+
+   mb_isdigit (mbc)
+     returns true if mbc is a decimal digit.
+
+   mb_isgraph (mbc)
+     returns true if mbc is a graphic character.
+
+   mb_islower (mbc)
+     returns true if mbc is lowercase.
+
+   mb_isprint (mbc)
+     returns true if mbc is a printable character.
+
+   mb_ispunct (mbc)
+     returns true if mbc is a punctuation character.
+
+   mb_isspace (mbc)
+     returns true if mbc is a space character.
+
+   mb_isupper (mbc)
+     returns true if mbc is uppercase.
+
+   mb_isxdigit (mbc)
+     returns true if mbc is a hexadecimal digit.
+
+   mb_width (mbc)
+     returns the number of columns on the output device occupied by mbc.
+     Always >= 0.
+
+   mb_putc (mbc, stream)
+     outputs mbc on stream, a byte oriented FILE stream opened for output.
+
+   mb_setascii (&mbc, sc)
+     assigns the standard ASCII character sc to mbc.
+
+   mb_copy (&destmbc, &srcmbc)
+     copies srcmbc to destmbc.
+
+   Here are the function prototypes of the macros.
+
+   extern const char *  mb_ptr (const mbchar_t mbc);
+   extern size_t        mb_len (const mbchar_t mbc);
+   extern bool          mb_iseq (const mbchar_t mbc, char sc);
+   extern bool          mb_isnul (const mbchar_t mbc);
+   extern int           mb_cmp (const mbchar_t mbc1, const mbchar_t mbc2);
+   extern int           mb_casecmp (const mbchar_t mbc1, const mbchar_t mbc2);
+   extern bool          mb_equal (const mbchar_t mbc1, const mbchar_t mbc2);
+   extern bool          mb_caseequal (const mbchar_t mbc1, const mbchar_t mbc2);
+   extern bool          mb_isalnum (const mbchar_t mbc);
+   extern bool          mb_isalpha (const mbchar_t mbc);
+   extern bool          mb_isascii (const mbchar_t mbc);
+   extern bool          mb_isblank (const mbchar_t mbc);
+   extern bool          mb_iscntrl (const mbchar_t mbc);
+   extern bool          mb_isdigit (const mbchar_t mbc);
+   extern bool          mb_isgraph (const mbchar_t mbc);
+   extern bool          mb_islower (const mbchar_t mbc);
+   extern bool          mb_isprint (const mbchar_t mbc);
+   extern bool          mb_ispunct (const mbchar_t mbc);
+   extern bool          mb_isspace (const mbchar_t mbc);
+   extern bool          mb_isupper (const mbchar_t mbc);
+   extern bool          mb_isxdigit (const mbchar_t mbc);
+   extern int           mb_width (const mbchar_t mbc);
+   extern void          mb_putc (const mbchar_t mbc, FILE *stream);
+   extern void          mb_setascii (mbchar_t *new, char sc);
+   extern void          mb_copy (mbchar_t *new, const mbchar_t *old);
+ */
+
+#ifndef _MBCHAR_H
+#define _MBCHAR_H 1
+
+#include <stdbool.h>
+#include <string.h>
+#include <wchar.h>
+#include <wctype.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef MBCHAR_INLINE
+# define MBCHAR_INLINE _GL_INLINE
+#endif
+
+#define MBCHAR_BUF_SIZE 24
+
+struct mbchar
+{
+  const char *ptr;      /* pointer to current character */
+  size_t bytes;         /* number of bytes of current character, > 0 */
+  bool wc_valid;        /* true if wc is a valid wide character */
+  wchar_t wc;           /* if wc_valid: the current character */
+  char buf[MBCHAR_BUF_SIZE]; /* room for the bytes, used for file input only */
+};
+
+/* EOF (not a real character) is represented with bytes = 0 and
+   wc_valid = false.  */
+
+typedef struct mbchar mbchar_t;
+
+/* Access the current character.  */
+#define mb_ptr(mbc) ((mbc).ptr)
+#define mb_len(mbc) ((mbc).bytes)
+
+/* Comparison of characters.  */
+#define mb_iseq(mbc, sc) ((mbc).wc_valid && (mbc).wc == (sc))
+#define mb_isnul(mbc) ((mbc).wc_valid && (mbc).wc == 0)
+#define mb_cmp(mbc1, mbc2) \
+  ((mbc1).wc_valid                                                      \
+   ? ((mbc2).wc_valid                                                   \
+      ? (int) (mbc1).wc - (int) (mbc2).wc                               \
+      : -1)                                                             \
+   : ((mbc2).wc_valid                                                   \
+      ? 1                                                               \
+      : (mbc1).bytes == (mbc2).bytes                                    \
+        ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes)                 \
+        : (mbc1).bytes < (mbc2).bytes                                   \
+          ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \
+          : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1)))
+#define mb_casecmp(mbc1, mbc2) \
+  ((mbc1).wc_valid                                                      \
+   ? ((mbc2).wc_valid                                                   \
+      ? (int) towlower ((mbc1).wc) - (int) towlower ((mbc2).wc)         \
+      : -1)                                                             \
+   : ((mbc2).wc_valid                                                   \
+      ? 1                                                               \
+      : (mbc1).bytes == (mbc2).bytes                                    \
+        ? memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes)                 \
+        : (mbc1).bytes < (mbc2).bytes                                   \
+          ? (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) > 0 ? 1 : -1) \
+          : (memcmp ((mbc1).ptr, (mbc2).ptr, (mbc2).bytes) >= 0 ? 1 : -1)))
+#define mb_equal(mbc1, mbc2) \
+  ((mbc1).wc_valid && (mbc2).wc_valid                                   \
+   ? (mbc1).wc == (mbc2).wc                                             \
+   : (mbc1).bytes == (mbc2).bytes                                       \
+     && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0)
+#define mb_caseequal(mbc1, mbc2) \
+  ((mbc1).wc_valid && (mbc2).wc_valid                                   \
+   ? towlower ((mbc1).wc) == towlower ((mbc2).wc)                       \
+   : (mbc1).bytes == (mbc2).bytes                                       \
+     && memcmp ((mbc1).ptr, (mbc2).ptr, (mbc1).bytes) == 0)
+
+/* <ctype.h>, <wctype.h> classification.  */
+#define mb_isascii(mbc) \
+  ((mbc).wc_valid && (mbc).wc >= 0 && (mbc).wc <= 127)
+#define mb_isalnum(mbc) ((mbc).wc_valid && iswalnum ((mbc).wc))
+#define mb_isalpha(mbc) ((mbc).wc_valid && iswalpha ((mbc).wc))
+#define mb_isblank(mbc) ((mbc).wc_valid && iswblank ((mbc).wc))
+#define mb_iscntrl(mbc) ((mbc).wc_valid && iswcntrl ((mbc).wc))
+#define mb_isdigit(mbc) ((mbc).wc_valid && iswdigit ((mbc).wc))
+#define mb_isgraph(mbc) ((mbc).wc_valid && iswgraph ((mbc).wc))
+#define mb_islower(mbc) ((mbc).wc_valid && iswlower ((mbc).wc))
+#define mb_isprint(mbc) ((mbc).wc_valid && iswprint ((mbc).wc))
+#define mb_ispunct(mbc) ((mbc).wc_valid && iswpunct ((mbc).wc))
+#define mb_isspace(mbc) ((mbc).wc_valid && iswspace ((mbc).wc))
+#define mb_isupper(mbc) ((mbc).wc_valid && iswupper ((mbc).wc))
+#define mb_isxdigit(mbc) ((mbc).wc_valid && iswxdigit ((mbc).wc))
+
+/* Extra <wchar.h> function.  */
+
+/* Unprintable characters appear as a small box of width 1.  */
+#define MB_UNPRINTABLE_WIDTH 1
+
+MBCHAR_INLINE int
+mb_width_aux (wint_t wc)
+{
+  int w = wcwidth (wc);
+  /* For unprintable characters, arbitrarily return 0 for control characters
+     and MB_UNPRINTABLE_WIDTH otherwise.  */
+  return (w >= 0 ? w : iswcntrl (wc) ? 0 : MB_UNPRINTABLE_WIDTH);
+}
+
+#define mb_width(mbc) \
+  ((mbc).wc_valid ? mb_width_aux ((mbc).wc) : MB_UNPRINTABLE_WIDTH)
+
+/* Output.  */
+#define mb_putc(mbc, stream)  fwrite ((mbc).ptr, 1, (mbc).bytes, (stream))
+
+/* Assignment.  */
+#define mb_setascii(mbc, sc) \
+  ((mbc)->ptr = (mbc)->buf, (mbc)->bytes = 1, (mbc)->wc_valid = 1, \
+   (mbc)->wc = (mbc)->buf[0] = (sc))
+
+/* Copying a character.  */
+MBCHAR_INLINE void
+mb_copy (mbchar_t *new_mbc, const mbchar_t *old_mbc)
+{
+  if (old_mbc->ptr == &old_mbc->buf[0])
+    {
+      memcpy (&new_mbc->buf[0], &old_mbc->buf[0], old_mbc->bytes);
+      new_mbc->ptr = &new_mbc->buf[0];
+    }
+  else
+    new_mbc->ptr = old_mbc->ptr;
+  new_mbc->bytes = old_mbc->bytes;
+  if ((new_mbc->wc_valid = old_mbc->wc_valid))
+    new_mbc->wc = old_mbc->wc;
+}
+
+
+/* is_basic(c) tests whether the single-byte character c is in the
+   ISO C "basic character set".
+   This is a convenience function, and is in this file only to share code
+   between mbiter_multi.h and mbfile_multi.h.  */
+#if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
+    && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
+    && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
+    && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
+    && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
+    && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
+    && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
+    && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
+    && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
+    && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
+    && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
+    && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
+    && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
+    && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
+    && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
+    && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
+    && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
+    && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
+    && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
+    && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
+    && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
+    && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
+    && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126)
+/* The character set is ISO-646, not EBCDIC. */
+# define IS_BASIC_ASCII 1
+
+extern const unsigned int is_basic_table[];
+
+MBCHAR_INLINE bool
+is_basic (char c)
+{
+  return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31))
+         & 1;
+}
+
+#else
+
+MBCHAR_INLINE bool
+is_basic (char c)
+{
+  switch (c)
+    {
+    case '\t': case '\v': case '\f':
+    case ' ': case '!': case '"': case '#': case '%':
+    case '&': case '\'': case '(': case ')': case '*':
+    case '+': case ',': case '-': case '.': case '/':
+    case '0': case '1': case '2': case '3': case '4':
+    case '5': case '6': case '7': case '8': case '9':
+    case ':': case ';': case '<': case '=': case '>':
+    case '?':
+    case 'A': case 'B': case 'C': case 'D': case 'E':
+    case 'F': case 'G': case 'H': case 'I': case 'J':
+    case 'K': case 'L': case 'M': case 'N': case 'O':
+    case 'P': case 'Q': case 'R': case 'S': case 'T':
+    case 'U': case 'V': case 'W': case 'X': case 'Y':
+    case 'Z':
+    case '[': case '\\': case ']': case '^': case '_':
+    case 'a': case 'b': case 'c': case 'd': case 'e':
+    case 'f': case 'g': case 'h': case 'i': case 'j':
+    case 'k': case 'l': case 'm': case 'n': case 'o':
+    case 'p': case 'q': case 'r': case 's': case 't':
+    case 'u': case 'v': case 'w': case 'x': case 'y':
+    case 'z': case '{': case '|': case '}': case '~':
+      return 1;
+    default:
+      return 0;
+    }
+}
+
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _MBCHAR_H */
diff --git a/lib/mbiter.c b/lib/mbiter.c
new file mode 100644 (file)
index 0000000..22a1ff8
--- /dev/null
@@ -0,0 +1,3 @@
+#include <config.h>
+#define MBITER_INLINE _GL_EXTERN_INLINE
+#include "mbiter.h"
diff --git a/lib/mbiter.h b/lib/mbiter.h
new file mode 100644 (file)
index 0000000..22ccdef
--- /dev/null
@@ -0,0 +1,218 @@
+/* Iterating through multibyte strings: macros for multi-byte encodings.
+   Copyright (C) 2001, 2005, 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>.  */
+
+/* The macros in this file implement forward iteration through a
+   multi-byte string.
+
+   With these macros, an iteration loop that looks like
+
+      char *iter;
+      for (iter = buf; iter < buf + buflen; iter++)
+        {
+          do_something (*iter);
+        }
+
+   becomes
+
+      mbi_iterator_t iter;
+      for (mbi_init (iter, buf, buflen); mbi_avail (iter); mbi_advance (iter))
+        {
+          do_something (mbi_cur_ptr (iter), mb_len (mbi_cur (iter)));
+        }
+
+   The benefit of these macros over plain use of mbrtowc is:
+   - Handling of invalid multibyte sequences is possible without
+     making the code more complicated, while still preserving the
+     invalid multibyte sequences.
+
+   mbi_iterator_t
+     is a type usable for variable declarations.
+
+   mbi_init (iter, startptr, length)
+     initializes the iterator, starting at startptr and crossing length bytes.
+
+   mbi_avail (iter)
+     returns true if there are more multibyte characters available before
+     the end of string is reached. In this case, mbi_cur (iter) is
+     initialized to the next multibyte character.
+
+   mbi_advance (iter)
+     advances the iterator by one multibyte character.
+
+   mbi_cur (iter)
+     returns the current multibyte character, of type mbchar_t.  All the
+     macros defined in mbchar.h can be used on it.
+
+   mbi_cur_ptr (iter)
+     return a pointer to the beginning of the current multibyte character.
+
+   mbi_reloc (iter, ptrdiff)
+     relocates iterator when the string is moved by ptrdiff bytes.
+
+   mbi_copy (&destiter, &srciter)
+     copies srciter to destiter.
+
+   Here are the function prototypes of the macros.
+
+   extern void          mbi_init (mbi_iterator_t iter,
+                                  const char *startptr, size_t length);
+   extern bool          mbi_avail (mbi_iterator_t iter);
+   extern void          mbi_advance (mbi_iterator_t iter);
+   extern mbchar_t      mbi_cur (mbi_iterator_t iter);
+   extern const char *  mbi_cur_ptr (mbi_iterator_t iter);
+   extern void          mbi_reloc (mbi_iterator_t iter, ptrdiff_t ptrdiff);
+   extern void          mbi_copy (mbi_iterator_t *new, const mbi_iterator_t *old);
+ */
+
+#ifndef _MBITER_H
+#define _MBITER_H 1
+
+#include <assert.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <string.h>
+#include <wchar.h>
+
+#include "mbchar.h"
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef MBITER_INLINE
+# define MBITER_INLINE _GL_INLINE
+#endif
+
+struct mbiter_multi
+{
+  const char *limit;    /* pointer to end of string */
+  bool in_shift;        /* true if next byte may not be interpreted as ASCII */
+  mbstate_t state;      /* if in_shift: current shift state */
+  bool next_done;       /* true if mbi_avail has already filled the following */
+  struct mbchar cur;    /* the current character:
+        const char *cur.ptr             pointer to current character
+        The following are only valid after mbi_avail.
+        size_t cur.bytes                number of bytes of current character
+        bool cur.wc_valid               true if wc is a valid wide character
+        wchar_t cur.wc                  if wc_valid: the current character
+        */
+};
+
+MBITER_INLINE void
+mbiter_multi_next (struct mbiter_multi *iter)
+{
+  if (iter->next_done)
+    return;
+  if (iter->in_shift)
+    goto with_shift;
+  /* Handle most ASCII characters quickly, without calling mbrtowc().  */
+  if (is_basic (*iter->cur.ptr))
+    {
+      /* These characters are part of the basic character set.  ISO C 99
+         guarantees that their wide character code is identical to their
+         char code.  */
+      iter->cur.bytes = 1;
+      iter->cur.wc = *iter->cur.ptr;
+      iter->cur.wc_valid = true;
+    }
+  else
+    {
+      assert (mbsinit (&iter->state));
+      iter->in_shift = true;
+    with_shift:
+      iter->cur.bytes = mbrtowc (&iter->cur.wc, iter->cur.ptr,
+                                 iter->limit - iter->cur.ptr, &iter->state);
+      if (iter->cur.bytes == (size_t) -1)
+        {
+          /* An invalid multibyte sequence was encountered.  */
+          iter->cur.bytes = 1;
+          iter->cur.wc_valid = false;
+          /* Whether to set iter->in_shift = false and reset iter->state
+             or not is not very important; the string is bogus anyway.  */
+        }
+      else if (iter->cur.bytes == (size_t) -2)
+        {
+          /* An incomplete multibyte character at the end.  */
+          iter->cur.bytes = iter->limit - iter->cur.ptr;
+          iter->cur.wc_valid = false;
+          /* Whether to set iter->in_shift = false and reset iter->state
+             or not is not important; the string end is reached anyway.  */
+        }
+      else
+        {
+          if (iter->cur.bytes == 0)
+            {
+              /* A null wide character was encountered.  */
+              iter->cur.bytes = 1;
+              assert (*iter->cur.ptr == '\0');
+              assert (iter->cur.wc == 0);
+            }
+          iter->cur.wc_valid = true;
+
+          /* When in the initial state, we can go back treating ASCII
+             characters more quickly.  */
+          if (mbsinit (&iter->state))
+            iter->in_shift = false;
+        }
+    }
+  iter->next_done = true;
+}
+
+MBITER_INLINE void
+mbiter_multi_reloc (struct mbiter_multi *iter, ptrdiff_t ptrdiff)
+{
+  iter->cur.ptr += ptrdiff;
+  iter->limit += ptrdiff;
+}
+
+MBITER_INLINE void
+mbiter_multi_copy (struct mbiter_multi *new_iter, const struct mbiter_multi *old_iter)
+{
+  new_iter->limit = old_iter->limit;
+  if ((new_iter->in_shift = old_iter->in_shift))
+    memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t));
+  else
+    memset (&new_iter->state, 0, sizeof (mbstate_t));
+  new_iter->next_done = old_iter->next_done;
+  mb_copy (&new_iter->cur, &old_iter->cur);
+}
+
+/* Iteration macros.  */
+typedef struct mbiter_multi mbi_iterator_t;
+#define mbi_init(iter, startptr, length) \
+  ((iter).cur.ptr = (startptr), (iter).limit = (iter).cur.ptr + (length), \
+   (iter).in_shift = false, memset (&(iter).state, '\0', sizeof (mbstate_t)), \
+   (iter).next_done = false)
+#define mbi_avail(iter) \
+  ((iter).cur.ptr < (iter).limit && (mbiter_multi_next (&(iter)), true))
+#define mbi_advance(iter) \
+  ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done = false)
+
+/* Access to the current character.  */
+#define mbi_cur(iter) (iter).cur
+#define mbi_cur_ptr(iter) (iter).cur.ptr
+
+/* Relocation.  */
+#define mbi_reloc(iter, ptrdiff) mbiter_multi_reloc (&iter, ptrdiff)
+
+/* Copying an iterator.  */
+#define mbi_copy mbiter_multi_copy
+
+_GL_INLINE_HEADER_END
+
+#endif /* _MBITER_H */
diff --git a/lib/mbrtowc-impl-utf8.h b/lib/mbrtowc-impl-utf8.h
new file mode 100644 (file)
index 0000000..58006d3
--- /dev/null
@@ -0,0 +1,138 @@
+/* Convert multibyte character to wide character.
+   Copyright (C) 1999-2002, 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
+
+/* This file contains the part of the body of the mbrtowc and mbrtoc32 functions
+   that handles the special case of the UTF-8 encoding.  */
+
+        /* Cf. unistr/u8-mbtouc.c.  */
+        unsigned char c = (unsigned char) p[0];
+
+        if (c < 0x80)
+          {
+            if (pwc != NULL)
+              *pwc = c;
+            res = (c == 0 ? 0 : 1);
+            goto success;
+          }
+        if (c >= 0xc2)
+          {
+            if (c < 0xe0)
+              {
+                if (m == 1)
+                  goto incomplete;
+                else /* m >= 2 */
+                  {
+                    unsigned char c2 = (unsigned char) p[1];
+
+                    if ((c2 ^ 0x80) < 0x40)
+                      {
+                        if (pwc != NULL)
+                          *pwc = ((unsigned int) (c & 0x1f) << 6)
+                                 | (unsigned int) (c2 ^ 0x80);
+                        res = 2;
+                        goto success;
+                      }
+                  }
+              }
+            else if (c < 0xf0)
+              {
+                if (m == 1)
+                  goto incomplete;
+                else
+                  {
+                    unsigned char c2 = (unsigned char) p[1];
+
+                    if ((c2 ^ 0x80) < 0x40
+                        && (c >= 0xe1 || c2 >= 0xa0)
+                        && (c != 0xed || c2 < 0xa0))
+                      {
+                        if (m == 2)
+                          goto incomplete;
+                        else /* m >= 3 */
+                          {
+                            unsigned char c3 = (unsigned char) p[2];
+
+                            if ((c3 ^ 0x80) < 0x40)
+                              {
+                                unsigned int wc =
+                                  (((unsigned int) (c & 0x0f) << 12)
+                                   | ((unsigned int) (c2 ^ 0x80) << 6)
+                                   | (unsigned int) (c3 ^ 0x80));
+
+                                if (FITS_IN_CHAR_TYPE (wc))
+                                  {
+                                    if (pwc != NULL)
+                                      *pwc = wc;
+                                    res = 3;
+                                    goto success;
+                                  }
+                              }
+                          }
+                      }
+                  }
+              }
+            else if (c <= 0xf4)
+              {
+                if (m == 1)
+                  goto incomplete;
+                else
+                  {
+                    unsigned char c2 = (unsigned char) p[1];
+
+                    if ((c2 ^ 0x80) < 0x40
+                        && (c >= 0xf1 || c2 >= 0x90)
+                        && (c < 0xf4 || (/* c == 0xf4 && */ c2 < 0x90)))
+                      {
+                        if (m == 2)
+                          goto incomplete;
+                        else
+                          {
+                            unsigned char c3 = (unsigned char) p[2];
+
+                            if ((c3 ^ 0x80) < 0x40)
+                              {
+                                if (m == 3)
+                                  goto incomplete;
+                                else /* m >= 4 */
+                                  {
+                                    unsigned char c4 = (unsigned char) p[3];
+
+                                    if ((c4 ^ 0x80) < 0x40)
+                                      {
+                                        unsigned int wc =
+                                          (((unsigned int) (c & 0x07) << 18)
+                                           | ((unsigned int) (c2 ^ 0x80) << 12)
+                                           | ((unsigned int) (c3 ^ 0x80) << 6)
+                                           | (unsigned int) (c4 ^ 0x80));
+
+                                        if (FITS_IN_CHAR_TYPE (wc))
+                                          {
+                                            if (pwc != NULL)
+                                              *pwc = wc;
+                                            res = 4;
+                                            goto success;
+                                          }
+                                      }
+                                  }
+                              }
+                          }
+                      }
+                  }
+              }
+          }
+        goto invalid;
diff --git a/lib/mbrtowc-impl.h b/lib/mbrtowc-impl.h
new file mode 100644 (file)
index 0000000..eab0416
--- /dev/null
@@ -0,0 +1,262 @@
+/* Convert multibyte character to wide character.
+   Copyright (C) 1999-2002, 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
+
+/* This file contains the body of the mbrtowc and mbrtoc32 functions,
+   when GNULIB_defined_mbstate_t is defined.  */
+
+  char *pstate = (char *)ps;
+
+  if (s == NULL)
+    {
+      pwc = NULL;
+      s = "";
+      n = 1;
+    }
+
+  if (n == 0)
+    return (size_t)(-2);
+
+  /* Here n > 0.  */
+
+  if (pstate == NULL)
+    pstate = internal_state;
+
+  {
+    size_t nstate = pstate[0];
+    char buf[4];
+    const char *p;
+    size_t m;
+    enc_t enc;
+    int res;
+
+    switch (nstate)
+      {
+      case 0:
+        p = s;
+        m = n;
+        break;
+      case 3:
+        buf[2] = pstate[3];
+        FALLTHROUGH;
+      case 2:
+        buf[1] = pstate[2];
+        FALLTHROUGH;
+      case 1:
+        buf[0] = pstate[1];
+        p = buf;
+        m = nstate;
+        buf[m++] = s[0];
+        if (n >= 2 && m < 4)
+          {
+            buf[m++] = s[1];
+            if (n >= 3 && m < 4)
+              buf[m++] = s[2];
+          }
+        break;
+      default:
+        errno = EINVAL;
+        return (size_t)(-1);
+      }
+
+    /* Here m > 0.  */
+
+    enc = locale_encoding_classification ();
+
+    if (enc == enc_utf8) /* UTF-8 */
+      {
+        /* Achieve
+             - multi-thread safety and
+             - the ability to produce wide character values > WCHAR_MAX
+           by not calling mbtowc() at all.  */
+#include "mbrtowc-impl-utf8.h"
+      }
+    else
+      {
+        /* The hidden internal state of mbtowc would make this function not
+           multi-thread safe.  Achieve multi-thread safety through a lock.  */
+        wchar_t wc;
+        res = mbtowc_with_lock (&wc, p, m);
+
+        if (res >= 0)
+          {
+            if ((wc == 0) != (res == 0))
+              abort ();
+            if (pwc != NULL)
+              *pwc = wc;
+            goto success;
+          }
+
+        /* mbtowc does not distinguish between invalid and incomplete multibyte
+           sequences.  But mbrtowc needs to make this distinction.
+           There are two possible approaches:
+             - Use iconv() and its return value.
+             - Use built-in knowledge about the possible encodings.
+           Given the low quality of implementation of iconv() on the systems
+           that lack mbrtowc(), we use the second approach.
+           The possible encodings are:
+             - 8-bit encodings,
+             - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS,
+             - UTF-8 (already handled above).
+           Use specialized code for each.  */
+        if (m >= 4 || m >= MB_CUR_MAX)
+          goto invalid;
+        /* Here MB_CUR_MAX > 1 and 0 < m < 4.  */
+        switch (enc)
+          {
+          /* As a reference for this code, you can use the GNU libiconv
+             implementation.  Look for uses of the RET_TOOFEW macro.  */
+
+          case enc_eucjp: /* EUC-JP */
+            {
+              if (m == 1)
+                {
+                  unsigned char c = (unsigned char) p[0];
+
+                  if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f)
+                    goto incomplete;
+                }
+              if (m == 2)
+                {
+                  unsigned char c = (unsigned char) p[0];
+
+                  if (c == 0x8f)
+                    {
+                      unsigned char c2 = (unsigned char) p[1];
+
+                      if (c2 >= 0xa1 && c2 < 0xff)
+                        goto incomplete;
+                    }
+                }
+              goto invalid;
+            }
+
+          case enc_94: /* EUC-KR, GB2312, BIG5 */
+            {
+              if (m == 1)
+                {
+                  unsigned char c = (unsigned char) p[0];
+
+                  if (c >= 0xa1 && c < 0xff)
+                    goto incomplete;
+                }
+              goto invalid;
+            }
+
+          case enc_euctw: /* EUC-TW */
+            {
+              if (m == 1)
+                {
+                  unsigned char c = (unsigned char) p[0];
+
+                  if ((c >= 0xa1 && c < 0xff) || c == 0x8e)
+                    goto incomplete;
+                }
+              else /* m == 2 || m == 3 */
+                {
+                  unsigned char c = (unsigned char) p[0];
+
+                  if (c == 0x8e)
+                    goto incomplete;
+                }
+              goto invalid;
+            }
+
+          case enc_gb18030: /* GB18030 */
+            {
+              if (m == 1)
+                {
+                  unsigned char c = (unsigned char) p[0];
+
+                  if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe))
+                    goto incomplete;
+                }
+              else /* m == 2 || m == 3 */
+                {
+                  unsigned char c = (unsigned char) p[0];
+
+                  if (c >= 0x90 && c <= 0xe3)
+                    {
+                      unsigned char c2 = (unsigned char) p[1];
+
+                      if (c2 >= 0x30 && c2 <= 0x39)
+                        {
+                          if (m == 2)
+                            goto incomplete;
+                          else /* m == 3 */
+                            {
+                              unsigned char c3 = (unsigned char) p[2];
+
+                              if (c3 >= 0x81 && c3 <= 0xfe)
+                                goto incomplete;
+                            }
+                        }
+                    }
+                }
+              goto invalid;
+            }
+
+          case enc_sjis: /* SJIS */
+            {
+              if (m == 1)
+                {
+                  unsigned char c = (unsigned char) p[0];
+
+                  if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)
+                      || (c >= 0xf0 && c <= 0xf9))
+                    goto incomplete;
+                }
+              goto invalid;
+            }
+
+          default:
+            /* An unknown multibyte encoding.  */
+            goto incomplete;
+          }
+      }
+
+   success:
+    /* res >= 0 is the corrected return value of
+       mbtowc_with_lock (&wc, p, m).  */
+    if (nstate >= (res > 0 ? res : 1))
+      abort ();
+    res -= nstate;
+    pstate[0] = 0;
+    return res;
+
+   incomplete:
+    {
+      size_t k = nstate;
+      /* Here 0 <= k < m < 4.  */
+      pstate[++k] = s[0];
+      if (k < m)
+        {
+          pstate[++k] = s[1];
+          if (k < m)
+            pstate[++k] = s[2];
+        }
+      if (k != m)
+        abort ();
+    }
+    pstate[0] = m;
+    return (size_t)(-2);
+
+   invalid:
+    errno = EILSEQ;
+    /* The conversion state is undefined, says POSIX.  */
+    return (size_t)(-1);
+  }
index cdd874b..caf7cb6 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 1999-2002, 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999-2002, 2005-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 /* Specification.  */
 #include <wchar.h>
 
-#if C_LOCALE_MAYBE_EILSEQ
-# include "hard-locale.h"
-# include <locale.h>
-#endif
-
 #if GNULIB_defined_mbstate_t
-/* Implement mbrtowc() on top of mbtowc().  */
+/* Implement mbrtowc() on top of mbtowc() for the non-UTF-8 locales
+   and directly for the UTF-8 locales.  */
 
 # include <errno.h>
+# include <stdint.h>
 # include <stdlib.h>
 
-# include "localcharset.h"
-# include "streq.h"
-# include "verify.h"
-
-
-verify (sizeof (mbstate_t) >= 4);
-
-static char internal_state[4];
-
-size_t
-mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
-{
-  char *pstate = (char *)ps;
+# if defined _WIN32 && !defined __CYGWIN__
 
-  if (s == NULL)
-    {
-      pwc = NULL;
-      s = "";
-      n = 1;
-    }
+#  define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#  include <windows.h>
 
-  if (n == 0)
-    return (size_t)(-2);
+# elif HAVE_PTHREAD_API
 
-  /* Here n > 0.  */
+#  include <pthread.h>
+#  if HAVE_THREADS_H && HAVE_WEAK_SYMBOLS
+#   include <threads.h>
+#   pragma weak thrd_exit
+#   define c11_threads_in_use() (thrd_exit != NULL)
+#  else
+#   define c11_threads_in_use() 0
+#  endif
 
-  if (pstate == NULL)
-    pstate = internal_state;
+# elif HAVE_THREADS_H
 
-  {
-    size_t nstate = pstate[0];
-    char buf[4];
-    const char *p;
-    size_t m;
+#  include <threads.h>
 
-    switch (nstate)
-      {
-      case 0:
-        p = s;
-        m = n;
-        break;
-      case 3:
-        buf[2] = pstate[3];
-        /*FALLTHROUGH*/
-      case 2:
-        buf[1] = pstate[2];
-        /*FALLTHROUGH*/
-      case 1:
-        buf[0] = pstate[1];
-        p = buf;
-        m = nstate;
-        buf[m++] = s[0];
-        if (n >= 2 && m < 4)
-          {
-            buf[m++] = s[1];
-            if (n >= 3 && m < 4)
-              buf[m++] = s[2];
-          }
-        break;
-      default:
-        errno = EINVAL;
-        return (size_t)(-1);
-      }
-
-    /* Here m > 0.  */
-
-# if __GLIBC__ || defined __UCLIBC__
-    /* Work around bug <http://sourceware.org/bugzilla/show_bug.cgi?id=9674> */
-    mbtowc (NULL, NULL, 0);
 # endif
-    {
-      int res = mbtowc (pwc, p, m);
-
-      if (res >= 0)
-        {
-          if (pwc != NULL && ((*pwc == 0) != (res == 0)))
-            abort ();
-          if (nstate >= (res > 0 ? res : 1))
-            abort ();
-          res -= nstate;
-          pstate[0] = 0;
-          return res;
-        }
-
-      /* mbtowc does not distinguish between invalid and incomplete multibyte
-         sequences.  But mbrtowc needs to make this distinction.
-         There are two possible approaches:
-           - Use iconv() and its return value.
-           - Use built-in knowledge about the possible encodings.
-         Given the low quality of implementation of iconv() on the systems that
-         lack mbrtowc(), we use the second approach.
-         The possible encodings are:
-           - 8-bit encodings,
-           - EUC-JP, EUC-KR, GB2312, EUC-TW, BIG5, GB18030, SJIS,
-           - UTF-8.
-         Use specialized code for each.  */
-      if (m >= 4 || m >= MB_CUR_MAX)
-        goto invalid;
-      /* Here MB_CUR_MAX > 1 and 0 < m < 4.  */
-      {
-        const char *encoding = locale_charset ();
-
-        if (STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0))
-          {
-            /* Cf. unistr/u8-mblen.c.  */
-            unsigned char c = (unsigned char) p[0];
-
-            if (c >= 0xc2)
-              {
-                if (c < 0xe0)
-                  {
-                    if (m == 1)
-                      goto incomplete;
-                  }
-                else if (c < 0xf0)
-                  {
-                    if (m == 1)
-                      goto incomplete;
-                    if (m == 2)
-                      {
-                        unsigned char c2 = (unsigned char) p[1];
-
-                        if ((c2 ^ 0x80) < 0x40
-                            && (c >= 0xe1 || c2 >= 0xa0)
-                            && (c != 0xed || c2 < 0xa0))
-                          goto incomplete;
-                      }
-                  }
-                else if (c <= 0xf4)
-                  {
-                    if (m == 1)
-                      goto incomplete;
-                    else /* m == 2 || m == 3 */
-                      {
-                        unsigned char c2 = (unsigned char) p[1];
-
-                        if ((c2 ^ 0x80) < 0x40
-                            && (c >= 0xf1 || c2 >= 0x90)
-                            && (c < 0xf4 || (c == 0xf4 && c2 < 0x90)))
-                          {
-                            if (m == 2)
-                              goto incomplete;
-                            else /* m == 3 */
-                              {
-                                unsigned char c3 = (unsigned char) p[2];
-
-                                if ((c3 ^ 0x80) < 0x40)
-                                  goto incomplete;
-                              }
-                          }
-                      }
-                  }
-              }
-            goto invalid;
-          }
-
-        /* As a reference for this code, you can use the GNU libiconv
-           implementation.  Look for uses of the RET_TOOFEW macro.  */
-
-        if (STREQ_OPT (encoding,
-                       "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0xa1 && c < 0xff) || c == 0x8e || c == 0x8f)
-                  goto incomplete;
-              }
-            if (m == 2)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c == 0x8f)
-                  {
-                    unsigned char c2 = (unsigned char) p[1];
-
-                    if (c2 >= 0xa1 && c2 < 0xff)
-                      goto incomplete;
-                  }
-              }
-            goto invalid;
-          }
-        if (STREQ_OPT (encoding,
-                       "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
-            || STREQ_OPT (encoding,
-                          "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
-            || STREQ_OPT (encoding,
-                          "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c >= 0xa1 && c < 0xff)
-                  goto incomplete;
-              }
-            goto invalid;
-          }
-        if (STREQ_OPT (encoding,
-                       "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0xa1 && c < 0xff) || c == 0x8e)
-                  goto incomplete;
-              }
-            else /* m == 2 || m == 3 */
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c == 0x8e)
-                  goto incomplete;
-              }
-            goto invalid;
-          }
-        if (STREQ_OPT (encoding,
-                       "GB18030", 'G', 'B', '1', '8', '0', '3', '0', 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
 
-                if ((c >= 0x90 && c <= 0xe3) || (c >= 0xf8 && c <= 0xfe))
-                  goto incomplete;
-              }
-            else /* m == 2 || m == 3 */
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if (c >= 0x90 && c <= 0xe3)
-                  {
-                    unsigned char c2 = (unsigned char) p[1];
-
-                    if (c2 >= 0x30 && c2 <= 0x39)
-                      {
-                        if (m == 2)
-                          goto incomplete;
-                        else /* m == 3 */
-                          {
-                            unsigned char c3 = (unsigned char) p[2];
-
-                            if (c3 >= 0x81 && c3 <= 0xfe)
-                              goto incomplete;
-                          }
-                      }
-                  }
-              }
-            goto invalid;
-          }
-        if (STREQ_OPT (encoding, "SJIS", 'S', 'J', 'I', 'S', 0, 0, 0, 0, 0))
-          {
-            if (m == 1)
-              {
-                unsigned char c = (unsigned char) p[0];
-
-                if ((c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xea)
-                    || (c >= 0xf0 && c <= 0xf9))
-                  goto incomplete;
-              }
-            goto invalid;
-          }
-
-        /* An unknown multibyte encoding.  */
-        goto incomplete;
-      }
+# include "attribute.h"
+# include "verify.h"
+# include "lc-charset-dispatch.h"
+# include "mbtowc-lock.h"
 
-     incomplete:
-      {
-        size_t k = nstate;
-        /* Here 0 <= k < m < 4.  */
-        pstate[++k] = s[0];
-        if (k < m)
-          {
-            pstate[++k] = s[1];
-            if (k < m)
-              pstate[++k] = s[2];
-          }
-        if (k != m)
-          abort ();
-      }
-      pstate[0] = m;
-      return (size_t)(-2);
+verify (sizeof (mbstate_t) >= 4);
+static char internal_state[4];
 
-     invalid:
-      errno = EILSEQ;
-      /* The conversion state is undefined, says POSIX.  */
-      return (size_t)(-1);
-    }
-  }
+size_t
+mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
+{
+# define FITS_IN_CHAR_TYPE(wc)  ((wc) <= WCHAR_MAX)
+# include "mbrtowc-impl.h"
 }
 
 #else
 /* Override the system's mbrtowc() function.  */
 
+# if MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ
+#  include "hard-locale.h"
+#  include <locale.h>
+# endif
+
 # undef mbrtowc
 
 size_t
@@ -385,14 +130,20 @@ rpl_mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps)
   }
 # endif
 
+# if MBRTOWC_STORES_INCOMPLETE_BUG
+  ret = mbrtowc (&wc, s, n, ps);
+  if (ret < (size_t) -2 && pwc != NULL)
+    *pwc = wc;
+# else
   ret = mbrtowc (pwc, s, n, ps);
+# endif
 
 # if MBRTOWC_NUL_RETVAL_BUG
   if (ret < (size_t) -2 && !*pwc)
     return 0;
 # endif
 
-# if C_LOCALE_MAYBE_EILSEQ
+# if MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ
   if ((size_t) -2 <= ret && n != 0 && ! hard_locale (LC_CTYPE))
     {
       unsigned char uc = *s;
index 372b523..b6e9841 100644 (file)
@@ -1,5 +1,5 @@
 /* Test for initial conversion state.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 
 #include "verify.h"
 
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
-
-/* On native Windows, 'mbstate_t' is defined as 'int'.  */
-
-int
-mbsinit (const mbstate_t *ps)
-{
-  return ps == NULL || *ps == 0;
-}
-
-#else
+#if GNULIB_defined_mbstate_t
 
 /* Platforms that lack mbsinit() also lack mbrlen(), mbrtowc(), mbsrtowcs()
    and wcrtomb(), wcsrtombs().
@@ -45,6 +35,7 @@ mbsinit (const mbstate_t *ps)
    We define the meaning of mbstate_t as follows:
      - In mb -> wc direction, mbstate_t's first byte contains the number of
        buffered bytes (in the range 0..3), followed by up to 3 buffered bytes.
+       See mbrtowc.c.
      - In wc -> mb direction, mbstate_t contains no information. In other
        words, it is always in the initial state.  */
 
@@ -58,4 +49,22 @@ mbsinit (const mbstate_t *ps)
   return pstate == NULL || pstate[0] == 0;
 }
 
+#else
+
+int
+mbsinit (const mbstate_t *ps)
+{
+# if defined _WIN32 && !defined __CYGWIN__
+  /* Native Windows.  */
+  /* MSVC defines 'mbstate_t' as an 8-byte struct; the first 4 bytes matter.
+     On mingw, 'mbstate_t' is sometimes defined as 'int', sometimes defined as
+     an 8-byte struct, of which the first 4 bytes matter.  */
+  return ps == NULL || *(const unsigned int *)ps == 0;
+# else
+  /* Minix, HP-UX 11.00, Solaris 2.6, Interix, ...  */
+  /* Maybe this definition works, maybe not...  */
+  return ps == NULL || *(const char *)ps == 0;
+# endif
+}
+
 #endif
diff --git a/lib/mbslen.c b/lib/mbslen.c
new file mode 100644 (file)
index 0000000..7672052
--- /dev/null
@@ -0,0 +1,44 @@
+/* Counting the multibyte characters in a string.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2007.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <string.h>
+
+#include <stdlib.h>
+
+#include "mbuiter.h"
+
+/* Return the number of multibyte characters in the character string STRING.  */
+size_t
+mbslen (const char *string)
+{
+  if (MB_CUR_MAX > 1)
+    {
+      size_t count;
+      mbui_iterator_t iter;
+
+      count = 0;
+      for (mbui_init (iter, string); mbui_avail (iter); mbui_advance (iter))
+        count++;
+
+      return count;
+    }
+  else
+    return strlen (string);
+}
diff --git a/lib/mbsstr.c b/lib/mbsstr.c
new file mode 100644 (file)
index 0000000..b1f12ce
--- /dev/null
@@ -0,0 +1,385 @@
+/* Searching in a string.  -*- coding: utf-8 -*-
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2005.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <string.h>
+
+#include <stdbool.h>
+#include <stddef.h>  /* for NULL, in case a nonstandard string.h lacks it */
+#include <stdlib.h>
+
+#include "malloca.h"
+#include "mbuiter.h"
+
+/* Knuth-Morris-Pratt algorithm.  */
+#define UNIT unsigned char
+#define CANON_ELEMENT(c) c
+#include "str-kmp.h"
+
+/* Knuth-Morris-Pratt algorithm.
+   See https://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm
+   Return a boolean indicating success:
+   Return true and set *RESULTP if the search was completed.
+   Return false if it was aborted because not enough memory was available.  */
+static bool
+knuth_morris_pratt_multibyte (const char *haystack, const char *needle,
+                              const char **resultp)
+{
+  size_t m = mbslen (needle);
+  mbchar_t *needle_mbchars;
+  size_t *table;
+
+  /* Allocate room for needle_mbchars and the table.  */
+  void *memory = nmalloca (m, sizeof (mbchar_t) + sizeof (size_t));
+  void *table_memory;
+  if (memory == NULL)
+    return false;
+  needle_mbchars = memory;
+  table_memory = needle_mbchars + m;
+  table = table_memory;
+
+  /* Fill needle_mbchars.  */
+  {
+    mbui_iterator_t iter;
+    size_t j;
+
+    j = 0;
+    for (mbui_init (iter, needle); mbui_avail (iter); mbui_advance (iter), j++)
+      mb_copy (&needle_mbchars[j], &mbui_cur (iter));
+  }
+
+  /* Fill the table.
+     For 0 < i < m:
+       0 < table[i] <= i is defined such that
+       forall 0 < x < table[i]: needle[x..i-1] != needle[0..i-1-x],
+       and table[i] is as large as possible with this property.
+     This implies:
+     1) For 0 < i < m:
+          If table[i] < i,
+          needle[table[i]..i-1] = needle[0..i-1-table[i]].
+     2) For 0 < i < m:
+          rhaystack[0..i-1] == needle[0..i-1]
+          and exists h, i <= h < m: rhaystack[h] != needle[h]
+          implies
+          forall 0 <= x < table[i]: rhaystack[x..x+m-1] != needle[0..m-1].
+     table[0] remains uninitialized.  */
+  {
+    size_t i, j;
+
+    /* i = 1: Nothing to verify for x = 0.  */
+    table[1] = 1;
+    j = 0;
+
+    for (i = 2; i < m; i++)
+      {
+        /* Here: j = i-1 - table[i-1].
+           The inequality needle[x..i-1] != needle[0..i-1-x] is known to hold
+           for x < table[i-1], by induction.
+           Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1].  */
+        mbchar_t *b = &needle_mbchars[i - 1];
+
+        for (;;)
+          {
+            /* Invariants: The inequality needle[x..i-1] != needle[0..i-1-x]
+               is known to hold for x < i-1-j.
+               Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1].  */
+            if (mb_equal (*b, needle_mbchars[j]))
+              {
+                /* Set table[i] := i-1-j.  */
+                table[i] = i - ++j;
+                break;
+              }
+            /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds
+               for x = i-1-j, because
+                 needle[i-1] != needle[j] = needle[i-1-x].  */
+            if (j == 0)
+              {
+                /* The inequality holds for all possible x.  */
+                table[i] = i;
+                break;
+              }
+            /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds
+               for i-1-j < x < i-1-j+table[j], because for these x:
+                 needle[x..i-2]
+                 = needle[x-(i-1-j)..j-1]
+                 != needle[0..j-1-(x-(i-1-j))]  (by definition of table[j])
+                    = needle[0..i-2-x],
+               hence needle[x..i-1] != needle[0..i-1-x].
+               Furthermore
+                 needle[i-1-j+table[j]..i-2]
+                 = needle[table[j]..j-1]
+                 = needle[0..j-1-table[j]]  (by definition of table[j]).  */
+            j = j - table[j];
+          }
+        /* Here: j = i - table[i].  */
+      }
+  }
+
+  /* Search, using the table to accelerate the processing.  */
+  {
+    size_t j;
+    mbui_iterator_t rhaystack;
+    mbui_iterator_t phaystack;
+
+    *resultp = NULL;
+    j = 0;
+    mbui_init (rhaystack, haystack);
+    mbui_init (phaystack, haystack);
+    /* Invariant: phaystack = rhaystack + j.  */
+    while (mbui_avail (phaystack))
+      if (mb_equal (needle_mbchars[j], mbui_cur (phaystack)))
+        {
+          j++;
+          mbui_advance (phaystack);
+          if (j == m)
+            {
+              /* The entire needle has been found.  */
+              *resultp = mbui_cur_ptr (rhaystack);
+              break;
+            }
+        }
+      else if (j > 0)
+        {
+          /* Found a match of needle[0..j-1], mismatch at needle[j].  */
+          size_t count = table[j];
+          j -= count;
+          for (; count > 0; count--)
+            {
+              if (!mbui_avail (rhaystack))
+                abort ();
+              mbui_advance (rhaystack);
+            }
+        }
+      else
+        {
+          /* Found a mismatch at needle[0] already.  */
+          if (!mbui_avail (rhaystack))
+            abort ();
+          mbui_advance (rhaystack);
+          mbui_advance (phaystack);
+        }
+  }
+
+  freea (memory);
+  return true;
+}
+
+/* Find the first occurrence of the character string NEEDLE in the character
+   string HAYSTACK.  Return NULL if NEEDLE is not found in HAYSTACK.  */
+char *
+mbsstr (const char *haystack, const char *needle)
+{
+  /* Be careful not to look at the entire extent of haystack or needle
+     until needed.  This is useful because of these two cases:
+       - haystack may be very long, and a match of needle found early,
+       - needle may be very long, and not even a short initial segment of
+         needle may be found in haystack.  */
+  if (MB_CUR_MAX > 1)
+    {
+      mbui_iterator_t iter_needle;
+
+      mbui_init (iter_needle, needle);
+      if (mbui_avail (iter_needle))
+        {
+          /* Minimizing the worst-case complexity:
+             Let n = mbslen(haystack), m = mbslen(needle).
+             The naïve algorithm is O(n*m) worst-case.
+             The Knuth-Morris-Pratt algorithm is O(n) worst-case but it needs a
+             memory allocation.
+             To achieve linear complexity and yet amortize the cost of the
+             memory allocation, we activate the Knuth-Morris-Pratt algorithm
+             only once the naïve algorithm has already run for some time; more
+             precisely, when
+               - the outer loop count is >= 10,
+               - the average number of comparisons per outer loop is >= 5,
+               - the total number of comparisons is >= m.
+             But we try it only once.  If the memory allocation attempt failed,
+             we don't retry it.  */
+          bool try_kmp = true;
+          size_t outer_loop_count = 0;
+          size_t comparison_count = 0;
+          size_t last_ccount = 0;                  /* last comparison count */
+          mbui_iterator_t iter_needle_last_ccount; /* = needle + last_ccount */
+
+          mbui_iterator_t iter_haystack;
+
+          mbui_init (iter_needle_last_ccount, needle);
+          mbui_init (iter_haystack, haystack);
+          for (;; mbui_advance (iter_haystack))
+            {
+              if (!mbui_avail (iter_haystack))
+                /* No match.  */
+                return NULL;
+
+              /* See whether it's advisable to use an asymptotically faster
+                 algorithm.  */
+              if (try_kmp
+                  && outer_loop_count >= 10
+                  && comparison_count >= 5 * outer_loop_count)
+                {
+                  /* See if needle + comparison_count now reaches the end of
+                     needle.  */
+                  size_t count = comparison_count - last_ccount;
+                  for (;
+                       count > 0 && mbui_avail (iter_needle_last_ccount);
+                       count--)
+                    mbui_advance (iter_needle_last_ccount);
+                  last_ccount = comparison_count;
+                  if (!mbui_avail (iter_needle_last_ccount))
+                    {
+                      /* Try the Knuth-Morris-Pratt algorithm.  */
+                      const char *result;
+                      bool success =
+                        knuth_morris_pratt_multibyte (haystack, needle,
+                                                      &result);
+                      if (success)
+                        return (char *) result;
+                      try_kmp = false;
+                    }
+                }
+
+              outer_loop_count++;
+              comparison_count++;
+              if (mb_equal (mbui_cur (iter_haystack), mbui_cur (iter_needle)))
+                /* The first character matches.  */
+                {
+                  mbui_iterator_t rhaystack;
+                  mbui_iterator_t rneedle;
+
+                  memcpy (&rhaystack, &iter_haystack, sizeof (mbui_iterator_t));
+                  mbui_advance (rhaystack);
+
+                  mbui_init (rneedle, needle);
+                  if (!mbui_avail (rneedle))
+                    abort ();
+                  mbui_advance (rneedle);
+
+                  for (;; mbui_advance (rhaystack), mbui_advance (rneedle))
+                    {
+                      if (!mbui_avail (rneedle))
+                        /* Found a match.  */
+                        return (char *) mbui_cur_ptr (iter_haystack);
+                      if (!mbui_avail (rhaystack))
+                        /* No match.  */
+                        return NULL;
+                      comparison_count++;
+                      if (!mb_equal (mbui_cur (rhaystack), mbui_cur (rneedle)))
+                        /* Nothing in this round.  */
+                        break;
+                    }
+                }
+            }
+        }
+      else
+        return (char *) haystack;
+    }
+  else
+    {
+      if (*needle != '\0')
+        {
+          /* Minimizing the worst-case complexity:
+             Let n = strlen(haystack), m = strlen(needle).
+             The naïve algorithm is O(n*m) worst-case.
+             The Knuth-Morris-Pratt algorithm is O(n) worst-case but it needs a
+             memory allocation.
+             To achieve linear complexity and yet amortize the cost of the
+             memory allocation, we activate the Knuth-Morris-Pratt algorithm
+             only once the naïve algorithm has already run for some time; more
+             precisely, when
+               - the outer loop count is >= 10,
+               - the average number of comparisons per outer loop is >= 5,
+               - the total number of comparisons is >= m.
+             But we try it only once.  If the memory allocation attempt failed,
+             we don't retry it.  */
+          bool try_kmp = true;
+          size_t outer_loop_count = 0;
+          size_t comparison_count = 0;
+          size_t last_ccount = 0;                  /* last comparison count */
+          const char *needle_last_ccount = needle; /* = needle + last_ccount */
+
+          /* Speed up the following searches of needle by caching its first
+             character.  */
+          char b = *needle++;
+
+          for (;; haystack++)
+            {
+              if (*haystack == '\0')
+                /* No match.  */
+                return NULL;
+
+              /* See whether it's advisable to use an asymptotically faster
+                 algorithm.  */
+              if (try_kmp
+                  && outer_loop_count >= 10
+                  && comparison_count >= 5 * outer_loop_count)
+                {
+                  /* See if needle + comparison_count now reaches the end of
+                     needle.  */
+                  if (needle_last_ccount != NULL)
+                    {
+                      needle_last_ccount +=
+                        strnlen (needle_last_ccount,
+                                 comparison_count - last_ccount);
+                      if (*needle_last_ccount == '\0')
+                        needle_last_ccount = NULL;
+                      last_ccount = comparison_count;
+                    }
+                  if (needle_last_ccount == NULL)
+                    {
+                      /* Try the Knuth-Morris-Pratt algorithm.  */
+                      const unsigned char *result;
+                      bool success =
+                        knuth_morris_pratt ((const unsigned char *) haystack,
+                                            (const unsigned char *) (needle - 1),
+                                            strlen (needle - 1),
+                                            &result);
+                      if (success)
+                        return (char *) result;
+                      try_kmp = false;
+                    }
+                }
+
+              outer_loop_count++;
+              comparison_count++;
+              if (*haystack == b)
+                /* The first character matches.  */
+                {
+                  const char *rhaystack = haystack + 1;
+                  const char *rneedle = needle;
+
+                  for (;; rhaystack++, rneedle++)
+                    {
+                      if (*rneedle == '\0')
+                        /* Found a match.  */
+                        return (char *) haystack;
+                      if (*rhaystack == '\0')
+                        /* No match.  */
+                        return NULL;
+                      comparison_count++;
+                      if (*rhaystack != *rneedle)
+                        /* Nothing in this round.  */
+                        break;
+                    }
+                }
+            }
+        }
+      else
+        return (char *) haystack;
+    }
+}
index 4be2994..bfcf5cc 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* We don't need a static internal state, because the encoding is not state
    dependent, and when mbrtowc returns (size_t)(-2). we throw the result
diff --git a/lib/mbtowc-lock.c b/lib/mbtowc-lock.c
new file mode 100644 (file)
index 0000000..27b1643
--- /dev/null
@@ -0,0 +1,150 @@
+/* Return the internal lock used by mbrtowc and mbrtoc32.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019-2020.  */
+
+#include <config.h>
+
+/* When it is known that the gl_get_mbtowc_lock function is defined
+   by a dependency library, it should not be defined here.  */
+#if OMIT_MBTOWC_LOCK
+
+/* This declaration is solely to ensure that after preprocessing
+   this file is never empty.  */
+typedef int dummy;
+
+#else
+
+/* This file defines the internal lock used by mbrtowc and mbrtoc32.
+   It is a separate compilation unit, so that only one copy of it is
+   present when linking statically.  */
+
+/* Prohibit renaming this symbol.  */
+# undef gl_get_mbtowc_lock
+
+/* Macro for exporting a symbol (function, not variable) defined in this file,
+   when compiled into a shared library.  */
+# ifndef DLL_EXPORTED
+#  if HAVE_VISIBILITY
+  /* Override the effect of the compiler option '-fvisibility=hidden'.  */
+#   define DLL_EXPORTED __attribute__((__visibility__("default")))
+#  elif defined _WIN32 || defined __CYGWIN__
+#   define DLL_EXPORTED __declspec(dllexport)
+#  else
+#   define DLL_EXPORTED
+#  endif
+# endif
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+#  define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#  include <windows.h>
+
+#  include "windows-initguard.h"
+
+/* The return type is a 'CRITICAL_SECTION *', not a 'glwthread_mutex_t *',
+   because the latter is not guaranteed to be a stable ABI in the future.  */
+
+/* Make sure the function gets exported from DLLs.  */
+DLL_EXPORTED CRITICAL_SECTION *gl_get_mbtowc_lock (void);
+
+static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
+static CRITICAL_SECTION lock;
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32.  */
+CRITICAL_SECTION *
+gl_get_mbtowc_lock (void)
+{
+  if (!guard.done)
+    {
+      if (InterlockedIncrement (&guard.started) == 0)
+        {
+          /* This thread is the first one to need the lock.  Initialize it.  */
+          InitializeCriticalSection (&lock);
+          guard.done = 1;
+        }
+      else
+        {
+          /* Don't let guard.started grow and wrap around.  */
+          InterlockedDecrement (&guard.started);
+          /* Yield the CPU while waiting for another thread to finish
+             initializing this mutex.  */
+          while (!guard.done)
+            Sleep (0);
+        }
+    }
+  return &lock;
+}
+
+# elif HAVE_PTHREAD_API
+
+#  include <pthread.h>
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* Make sure the function gets exported from shared libraries.  */
+DLL_EXPORTED pthread_mutex_t *gl_get_mbtowc_lock (void);
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32.  */
+pthread_mutex_t *
+gl_get_mbtowc_lock (void)
+{
+  return &mutex;
+}
+
+# elif HAVE_THREADS_H
+
+#  include <threads.h>
+#  include <stdlib.h>
+
+static int volatile init_needed = 1;
+static once_flag init_once = ONCE_FLAG_INIT;
+static mtx_t mutex;
+
+static void
+atomic_init (void)
+{
+  if (mtx_init (&mutex, mtx_plain) != thrd_success)
+    abort ();
+  init_needed = 0;
+}
+
+/* Make sure the function gets exported from shared libraries.  */
+DLL_EXPORTED mtx_t *gl_get_mbtowc_lock (void);
+
+/* Returns the internal lock used by mbrtowc and mbrtoc32.  */
+mtx_t *
+gl_get_mbtowc_lock (void)
+{
+  if (init_needed)
+    call_once (&init_once, atomic_init);
+  return &mutex;
+}
+
+# endif
+
+# if (defined _WIN32 || defined __CYGWIN__) && !defined _MSC_VER
+/* Make sure the '__declspec(dllimport)' in mbrtowc.c and mbrtoc32.c does not
+   cause a link failure when no DLLs are involved.  */
+#  if defined _WIN64 || defined _LP64
+#   define IMP(x) __imp_##x
+#  else
+#   define IMP(x) _imp__##x
+#  endif
+void * IMP(gl_get_mbtowc_lock) = &gl_get_mbtowc_lock;
+# endif
+
+#endif
diff --git a/lib/mbtowc-lock.h b/lib/mbtowc-lock.h
new file mode 100644 (file)
index 0000000..3b6f5f9
--- /dev/null
@@ -0,0 +1,125 @@
+/* Use the internal lock used by mbrtowc and mbrtoc32.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019-2020.  */
+
+/* Use a lock, so that no two threads can invoke mbtowc at the same time.  */
+
+static inline int
+mbtowc_unlocked (wchar_t *pwc, const char *p, size_t m)
+{
+  /* Put the hidden internal state of mbtowc into its initial state.
+     This is needed at least with glibc, uClibc, and MSVC CRT.
+     See <https://sourceware.org/bugzilla/show_bug.cgi?id=9674>.  */
+  mbtowc (NULL, NULL, 0);
+
+  return mbtowc (pwc, p, m);
+}
+
+/* Prohibit renaming this symbol.  */
+#undef gl_get_mbtowc_lock
+
+#if GNULIB_MBRTOWC_SINGLE_THREAD
+
+/* All uses of this function are in a single thread.  No locking needed.  */
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+  return mbtowc_unlocked (pwc, p, m);
+}
+
+#elif defined _WIN32 && !defined __CYGWIN__
+
+extern __declspec(dllimport) CRITICAL_SECTION *gl_get_mbtowc_lock (void);
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+  CRITICAL_SECTION *lock = gl_get_mbtowc_lock ();
+  int ret;
+
+  EnterCriticalSection (lock);
+  ret = mbtowc_unlocked (pwc, p, m);
+  LeaveCriticalSection (lock);
+
+  return ret;
+}
+
+#elif HAVE_PTHREAD_API /* AIX, IRIX, Cygwin */
+
+extern
+# if defined _WIN32 || defined __CYGWIN__
+  __declspec(dllimport)
+# endif
+  pthread_mutex_t *gl_get_mbtowc_lock (void);
+
+# if HAVE_WEAK_SYMBOLS /* IRIX */
+
+   /* Avoid the need to link with '-lpthread'.  */
+#  pragma weak pthread_mutex_lock
+#  pragma weak pthread_mutex_unlock
+
+   /* Determine whether libpthread is in use.  */
+#  pragma weak pthread_mutexattr_gettype
+   /* See the comments in lock.h.  */
+#  define pthread_in_use() \
+     (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+
+# else
+#  define pthread_in_use() 1
+# endif
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+  if (pthread_in_use())
+    {
+      pthread_mutex_t *lock = gl_get_mbtowc_lock ();
+      int ret;
+
+      if (pthread_mutex_lock (lock))
+        abort ();
+      ret = mbtowc_unlocked (pwc, p, m);
+      if (pthread_mutex_unlock (lock))
+        abort ();
+
+      return ret;
+    }
+  else
+    return mbtowc_unlocked (pwc, p, m);
+}
+
+#elif HAVE_THREADS_H
+
+extern mtx_t *gl_get_mbtowc_lock (void);
+
+static int
+mbtowc_with_lock (wchar_t *pwc, const char *p, size_t m)
+{
+  mtx_t *lock = gl_get_mbtowc_lock ();
+  int ret;
+
+  if (mtx_lock (lock) != thrd_success)
+    abort ();
+  ret = mbtowc_unlocked (pwc, p, m);
+  if (mtx_unlock (lock) != thrd_success)
+    abort ();
+
+  return ret;
+}
+
+#endif
index fb2b651..ef217c6 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert multibyte character to wide character.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/lib/mbuiter.c b/lib/mbuiter.c
new file mode 100644 (file)
index 0000000..9167580
--- /dev/null
@@ -0,0 +1,3 @@
+#include <config.h>
+#define MBUITER_INLINE _GL_EXTERN_INLINE
+#include "mbuiter.h"
diff --git a/lib/mbuiter.h b/lib/mbuiter.h
new file mode 100644 (file)
index 0000000..5b1320b
--- /dev/null
@@ -0,0 +1,225 @@
+/* Iterating through multibyte strings: macros for multi-byte encodings.
+   Copyright (C) 2001, 2005, 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>.  */
+
+/* The macros in this file implement forward iteration through a
+   multi-byte string, without knowing its length a-priori.
+
+   With these macros, an iteration loop that looks like
+
+      char *iter;
+      for (iter = buf; *iter != '\0'; iter++)
+        {
+          do_something (*iter);
+        }
+
+   becomes
+
+      mbui_iterator_t iter;
+      for (mbui_init (iter, buf); mbui_avail (iter); mbui_advance (iter))
+        {
+          do_something (mbui_cur_ptr (iter), mb_len (mbui_cur (iter)));
+        }
+
+   The benefit of these macros over plain use of mbrtowc is:
+   - Handling of invalid multibyte sequences is possible without
+     making the code more complicated, while still preserving the
+     invalid multibyte sequences.
+
+   Compared to mbiter.h, the macros here don't need to know the string's
+   length a-priori.  The downside is that at each step, the look-ahead
+   that guards against overrunning the terminating '\0' is more expensive.
+   The mbui_* macros are therefore suitable when there is a high probability
+   that only the first few multibyte characters need to be inspected.
+   Whereas the mbi_* macros are better if usually the iteration runs
+   through the entire string.
+
+   mbui_iterator_t
+     is a type usable for variable declarations.
+
+   mbui_init (iter, startptr)
+     initializes the iterator, starting at startptr.
+
+   mbui_avail (iter)
+     returns true if there are more multibyte characters available before
+     the end of string is reached. In this case, mbui_cur (iter) is
+     initialized to the next multibyte character.
+
+   mbui_advance (iter)
+     advances the iterator by one multibyte character.
+
+   mbui_cur (iter)
+     returns the current multibyte character, of type mbchar_t.  All the
+     macros defined in mbchar.h can be used on it.
+
+   mbui_cur_ptr (iter)
+     return a pointer to the beginning of the current multibyte character.
+
+   mbui_reloc (iter, ptrdiff)
+     relocates iterator when the string is moved by ptrdiff bytes.
+
+   mbui_copy (&destiter, &srciter)
+     copies srciter to destiter.
+
+   Here are the function prototypes of the macros.
+
+   extern void          mbui_init (mbui_iterator_t iter, const char *startptr);
+   extern bool          mbui_avail (mbui_iterator_t iter);
+   extern void          mbui_advance (mbui_iterator_t iter);
+   extern mbchar_t      mbui_cur (mbui_iterator_t iter);
+   extern const char *  mbui_cur_ptr (mbui_iterator_t iter);
+   extern void          mbui_reloc (mbui_iterator_t iter, ptrdiff_t ptrdiff);
+   extern void          mbui_copy (mbui_iterator_t *new, const mbui_iterator_t *old);
+ */
+
+#ifndef _MBUITER_H
+#define _MBUITER_H 1
+
+#include <assert.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+
+#include "mbchar.h"
+#include "strnlen1.h"
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef MBUITER_INLINE
+# define MBUITER_INLINE _GL_INLINE
+#endif
+
+struct mbuiter_multi
+{
+  bool in_shift;        /* true if next byte may not be interpreted as ASCII */
+  mbstate_t state;      /* if in_shift: current shift state */
+  bool next_done;       /* true if mbui_avail has already filled the following */
+  struct mbchar cur;    /* the current character:
+        const char *cur.ptr             pointer to current character
+        The following are only valid after mbui_avail.
+        size_t cur.bytes                number of bytes of current character
+        bool cur.wc_valid               true if wc is a valid wide character
+        wchar_t cur.wc                  if wc_valid: the current character
+        */
+};
+
+MBUITER_INLINE void
+mbuiter_multi_next (struct mbuiter_multi *iter)
+{
+  if (iter->next_done)
+    return;
+  if (iter->in_shift)
+    goto with_shift;
+  /* Handle most ASCII characters quickly, without calling mbrtowc().  */
+  if (is_basic (*iter->cur.ptr))
+    {
+      /* These characters are part of the basic character set.  ISO C 99
+         guarantees that their wide character code is identical to their
+         char code.  */
+      iter->cur.bytes = 1;
+      iter->cur.wc = *iter->cur.ptr;
+      iter->cur.wc_valid = true;
+    }
+  else
+    {
+      assert (mbsinit (&iter->state));
+      iter->in_shift = true;
+    with_shift:
+      iter->cur.bytes = mbrtowc (&iter->cur.wc, iter->cur.ptr,
+                                 strnlen1 (iter->cur.ptr, MB_CUR_MAX),
+                                 &iter->state);
+      if (iter->cur.bytes == (size_t) -1)
+        {
+          /* An invalid multibyte sequence was encountered.  */
+          iter->cur.bytes = 1;
+          iter->cur.wc_valid = false;
+          /* Whether to set iter->in_shift = false and reset iter->state
+             or not is not very important; the string is bogus anyway.  */
+        }
+      else if (iter->cur.bytes == (size_t) -2)
+        {
+          /* An incomplete multibyte character at the end.  */
+          iter->cur.bytes = strlen (iter->cur.ptr);
+          iter->cur.wc_valid = false;
+          /* Whether to set iter->in_shift = false and reset iter->state
+             or not is not important; the string end is reached anyway.  */
+        }
+      else
+        {
+          if (iter->cur.bytes == 0)
+            {
+              /* A null wide character was encountered.  */
+              iter->cur.bytes = 1;
+              assert (*iter->cur.ptr == '\0');
+              assert (iter->cur.wc == 0);
+            }
+          iter->cur.wc_valid = true;
+
+          /* When in the initial state, we can go back treating ASCII
+             characters more quickly.  */
+          if (mbsinit (&iter->state))
+            iter->in_shift = false;
+        }
+    }
+  iter->next_done = true;
+}
+
+MBUITER_INLINE void
+mbuiter_multi_reloc (struct mbuiter_multi *iter, ptrdiff_t ptrdiff)
+{
+  iter->cur.ptr += ptrdiff;
+}
+
+MBUITER_INLINE void
+mbuiter_multi_copy (struct mbuiter_multi *new_iter, const struct mbuiter_multi *old_iter)
+{
+  if ((new_iter->in_shift = old_iter->in_shift))
+    memcpy (&new_iter->state, &old_iter->state, sizeof (mbstate_t));
+  else
+    memset (&new_iter->state, 0, sizeof (mbstate_t));
+  new_iter->next_done = old_iter->next_done;
+  mb_copy (&new_iter->cur, &old_iter->cur);
+}
+
+/* Iteration macros.  */
+typedef struct mbuiter_multi mbui_iterator_t;
+#define mbui_init(iter, startptr) \
+  ((iter).cur.ptr = (startptr), \
+   (iter).in_shift = false, memset (&(iter).state, '\0', sizeof (mbstate_t)), \
+   (iter).next_done = false)
+#define mbui_avail(iter) \
+  (mbuiter_multi_next (&(iter)), !mb_isnul ((iter).cur))
+#define mbui_advance(iter) \
+  ((iter).cur.ptr += (iter).cur.bytes, (iter).next_done = false)
+
+/* Access to the current character.  */
+#define mbui_cur(iter) (iter).cur
+#define mbui_cur_ptr(iter) (iter).cur.ptr
+
+/* Relocation.  */
+#define mbui_reloc(iter, ptrdiff) mbuiter_multi_reloc (&iter, ptrdiff)
+
+/* Copying an iterator.  */
+#define mbui_copy mbuiter_multi_copy
+
+_GL_INLINE_HEADER_END
+
+#endif /* _MBUITER_H */
index b565542..cacaf18 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2016
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2021
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
@@ -21,7 +21,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
 # include <config.h>
index 60f247e..c0a53db 100644 (file)
@@ -1,4 +1,20 @@
 # Suppress a valgrind message about use of uninitialized memory in memchr().
+
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
 # POSIX states that when the character is found, memchr must not read extra
 # bytes in an overestimated length (for example, where memchr is used to
 # implement strnlen).  However, we use a safe word read to provide a speedup.
index 66a217d..923bb15 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2016
+/* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2021
    Free Software Foundation, Inc.
 
    Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
@@ -19,7 +19,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 27f2c86..4cec4bb 100644 (file)
@@ -1,5 +1,5 @@
 /* Scan memory for the first of two bytes.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <stddef.h>
 
index 778fe86..fb5207a 100644 (file)
@@ -1,4 +1,20 @@
 # Suppress a valgrind message about use of uninitialized memory in memchr2().
+
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
 # Like memchr, it is safe to overestimate the length when the terminator
 # is guaranteed to be found.  In this case, we may end up reading a word
 # that is partially uninitialized, but this use is OK for a speedup.
diff --git a/lib/mempcpy.c b/lib/mempcpy.c
new file mode 100644 (file)
index 0000000..d700cc1
--- /dev/null
@@ -0,0 +1,33 @@
+/* Copy memory area and return pointer after last written byte.
+   Copyright (C) 2003, 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <string.h>
+
+/* A function definition is only needed if HAVE_MEMPCPY is not defined.  */
+#if !HAVE_MEMPCPY
+
+/* Copy N bytes of SRC to DEST, return pointer to bytes after the
+   last written byte.  */
+void *
+mempcpy (void *dest, const void *src, size_t n)
+{
+  return (char *) memcpy (dest, src, n) + n;
+}
+
+#endif
diff --git a/lib/memrchr.c b/lib/memrchr.c
new file mode 100644 (file)
index 0000000..dcd24fa
--- /dev/null
@@ -0,0 +1,161 @@
+/* memrchr -- find the last occurrence of a byte in a memory block
+
+   Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2021 Free Software
+   Foundation, Inc.
+
+   Based on strlen implementation by Torbjorn Granlund (tege@sics.se),
+   with help from Dan Sahlin (dan@sics.se) and
+   commentary by Jim Blandy (jimb@ai.mit.edu);
+   adaptation to memchr suggested by Dick Karpinski (dick@cca.ucsf.edu),
+   and implemented by Roland McGrath (roland@ai.mit.edu).
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#if defined _LIBC
+# include <memcopy.h>
+#else
+# include <config.h>
+# define reg_char char
+#endif
+
+#include <string.h>
+#include <limits.h>
+
+#undef __memrchr
+#ifdef _LIBC
+# undef memrchr
+#endif
+
+#ifndef weak_alias
+# define __memrchr memrchr
+#endif
+
+/* Search no more than N bytes of S for C.  */
+void *
+__memrchr (void const *s, int c_in, size_t n)
+{
+  /* On 32-bit hardware, choosing longword to be a 32-bit unsigned
+     long instead of a 64-bit uintmax_t tends to give better
+     performance.  On 64-bit hardware, unsigned long is generally 64
+     bits already.  Change this typedef to experiment with
+     performance.  */
+  typedef unsigned long int longword;
+
+  const unsigned char *char_ptr;
+  const longword *longword_ptr;
+  longword repeated_one;
+  longword repeated_c;
+  unsigned reg_char c;
+
+  c = (unsigned char) c_in;
+
+  /* Handle the last few bytes by reading one byte at a time.
+     Do this until CHAR_PTR is aligned on a longword boundary.  */
+  for (char_ptr = (const unsigned char *) s + n;
+       n > 0 && (size_t) char_ptr % sizeof (longword) != 0;
+       --n)
+    if (*--char_ptr == c)
+      return (void *) char_ptr;
+
+  longword_ptr = (const void *) char_ptr;
+
+  /* All these elucidatory comments refer to 4-byte longwords,
+     but the theory applies equally well to any size longwords.  */
+
+  /* Compute auxiliary longword values:
+     repeated_one is a value which has a 1 in every byte.
+     repeated_c has c in every byte.  */
+  repeated_one = 0x01010101;
+  repeated_c = c | (c << 8);
+  repeated_c |= repeated_c << 16;
+  if (0xffffffffU < (longword) -1)
+    {
+      repeated_one |= repeated_one << 31 << 1;
+      repeated_c |= repeated_c << 31 << 1;
+      if (8 < sizeof (longword))
+        {
+          size_t i;
+
+          for (i = 64; i < sizeof (longword) * 8; i *= 2)
+            {
+              repeated_one |= repeated_one << i;
+              repeated_c |= repeated_c << i;
+            }
+        }
+    }
+
+  /* Instead of the traditional loop which tests each byte, we will test a
+     longword at a time.  The tricky part is testing if *any of the four*
+     bytes in the longword in question are equal to c.  We first use an xor
+     with repeated_c.  This reduces the task to testing whether *any of the
+     four* bytes in longword1 is zero.
+
+     We compute tmp =
+       ((longword1 - repeated_one) & ~longword1) & (repeated_one << 7).
+     That is, we perform the following operations:
+       1. Subtract repeated_one.
+       2. & ~longword1.
+       3. & a mask consisting of 0x80 in every byte.
+     Consider what happens in each byte:
+       - If a byte of longword1 is zero, step 1 and 2 transform it into 0xff,
+         and step 3 transforms it into 0x80.  A carry can also be propagated
+         to more significant bytes.
+       - If a byte of longword1 is nonzero, let its lowest 1 bit be at
+         position k (0 <= k <= 7); so the lowest k bits are 0.  After step 1,
+         the byte ends in a single bit of value 0 and k bits of value 1.
+         After step 2, the result is just k bits of value 1: 2^k - 1.  After
+         step 3, the result is 0.  And no carry is produced.
+     So, if longword1 has only non-zero bytes, tmp is zero.
+     Whereas if longword1 has a zero byte, call j the position of the least
+     significant zero byte.  Then the result has a zero at positions 0, ...,
+     j-1 and a 0x80 at position j.  We cannot predict the result at the more
+     significant bytes (positions j+1..3), but it does not matter since we
+     already have a non-zero bit at position 8*j+7.
+
+     So, the test whether any byte in longword1 is zero is equivalent to
+     testing whether tmp is nonzero.  */
+
+  while (n >= sizeof (longword))
+    {
+      longword longword1 = *--longword_ptr ^ repeated_c;
+
+      if ((((longword1 - repeated_one) & ~longword1)
+           & (repeated_one << 7)) != 0)
+        {
+          longword_ptr++;
+          break;
+        }
+      n -= sizeof (longword);
+    }
+
+  char_ptr = (const unsigned char *) longword_ptr;
+
+  /* At this point, we know that either n < sizeof (longword), or one of the
+     sizeof (longword) bytes starting at char_ptr is == c.  On little-endian
+     machines, we could determine the first such byte without any further
+     memory accesses, just by looking at the tmp result from the last loop
+     iteration.  But this does not work on big-endian machines.  Choose code
+     that works in both cases.  */
+
+  while (n-- > 0)
+    {
+      if (*--char_ptr == c)
+        return (void *) char_ptr;
+    }
+
+  return NULL;
+}
+#ifdef weak_alias
+weak_alias (__memrchr, memrchr)
+#endif
index be6b321..eb9fb09 100644 (file)
@@ -1,5 +1,5 @@
 /* MIN, MAX macros.
-   Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2016 Free Software
+   Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _MINMAX_H
 #define _MINMAX_H
diff --git a/lib/mkdir.c b/lib/mkdir.c
new file mode 100644 (file)
index 0000000..d508db6
--- /dev/null
@@ -0,0 +1,93 @@
+/* On some systems, mkdir ("foo/", 0700) fails because of the trailing
+   slash.  On those systems, this wrapper removes the trailing slash.
+
+   Copyright (C) 2001, 2003, 2006, 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering */
+
+#include <config.h>
+
+/* Specification.  */
+#include <sys/stat.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "dirname.h"
+
+/* Disable the definition of mkdir to rpl_mkdir (from the <sys/stat.h>
+   substitute) in this file.  Otherwise, we'd get an endless recursion.  */
+#undef mkdir
+
+/* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
+   Additionally, it declares _mkdir (and depending on compile flags, an
+   alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
+   which are included in the <sys/stat.h> override.  */
+#if defined _WIN32 && ! defined __CYGWIN__
+# define mkdir(name,mode) _mkdir (name)
+# define maybe_unused _GL_UNUSED
+#else
+# define maybe_unused /* empty */
+#endif
+
+/* This function is required at least for NetBSD 1.5.2.  */
+
+int
+rpl_mkdir (char const *dir, mode_t mode maybe_unused)
+{
+  int ret_val;
+  char *tmp_dir;
+  size_t len = strlen (dir);
+
+  if (len && dir[len - 1] == '/')
+    {
+      tmp_dir = strdup (dir);
+      if (!tmp_dir)
+        {
+          /* Rather than rely on strdup-posix, we set errno ourselves.  */
+          errno = ENOMEM;
+          return -1;
+        }
+      strip_trailing_slashes (tmp_dir);
+    }
+  else
+    {
+      tmp_dir = (char *) dir;
+    }
+#if FUNC_MKDIR_DOT_BUG
+  /* Additionally, cygwin 1.5 mistakenly creates a directory "d/./".  */
+  {
+    char *last = last_component (tmp_dir);
+    if (*last == '.' && (last[1] == '\0'
+                         || (last[1] == '.' && last[2] == '\0')))
+      {
+        struct stat st;
+        if (stat (tmp_dir, &st) == 0 || errno == EOVERFLOW)
+          errno = EEXIST;
+        return -1;
+      }
+  }
+#endif /* FUNC_MKDIR_DOT_BUG */
+
+  ret_val = mkdir (tmp_dir, mode);
+
+  if (tmp_dir != dir)
+    free (tmp_dir);
+
+  return ret_val;
+}
index c1b05fd..8ed805b 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2016 Free Software
+/* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2021 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Extracted from misc/mkdtemp.c.  */
 
index c800904..1decf59 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke mkstemp, but avoid some glitches.
 
-   Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
index 90ed78e..ed09f3f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2016 Free Software
+/* Copyright (C) 1998-1999, 2001, 2005-2007, 2009-2021 Free Software
    Foundation, Inc.
    This file is derived from the one in the GNU C Library.
 
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if !_LIBC
 # include <config.h>
index baaf39e..658c4e3 100644 (file)
@@ -1,5 +1,5 @@
 /* Invalid parameter handler for MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 027c949..46404ae 100644 (file)
@@ -1,5 +1,5 @@
 /* Invalid parameter handler for MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _MSVC_INVAL_H
 #define _MSVC_INVAL_H
@@ -95,7 +95,7 @@ extern void gl_msvc_inval_ensure_handler (void);
 
 /* Gnulib can define its own status codes, as described in the page
    "Raising Software Exceptions" on microsoft.com
-   <http://msdn.microsoft.com/en-us/library/het71c37.aspx>.
+   <https://docs.microsoft.com/en-us/cpp/cpp/raising-software-exceptions>.
    Our status codes are composed of
      - 0xE0000000, mandatory for all user-defined status codes,
      - 0x474E550, a API identifier ("GNU"),
@@ -106,7 +106,7 @@ extern void gl_msvc_inval_ensure_handler (void);
 #  if defined _MSC_VER
 /* A compiler that supports __try/__except, as described in the page
    "try-except statement" on microsoft.com
-   <http://msdn.microsoft.com/en-us/library/s58ftw19.aspx>.
+   <https://docs.microsoft.com/en-us/cpp/cpp/try-except-statement>.
    With __try/__except, we can use the multithread-safe exception handling.  */
 
 #   ifdef __cplusplus
index ba75bbf..e893ed6 100644 (file)
@@ -1,6 +1,6 @@
 /* Wrappers that don't throw invalid parameter notifications
    with MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -24,7 +24,9 @@
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
-#include "msvc-inval.h"
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
 
 #undef _get_osfhandle
 
index 3493b84..a1979dd 100644 (file)
@@ -1,6 +1,6 @@
 /* Wrappers that don't throw invalid parameter notifications
    with MSVC runtime libraries.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _MSVC_NOTHROW_H
 #define _MSVC_NOTHROW_H
@@ -25,7 +25,7 @@
    This file defines wrappers that turn such an invalid parameter notification
    into an error code.  */
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 /* Get original declaration of _get_osfhandle.  */
 # include <io.h>
diff --git a/lib/nl_langinfo-lock.c b/lib/nl_langinfo-lock.c
new file mode 100644 (file)
index 0000000..0299f5b
--- /dev/null
@@ -0,0 +1,150 @@
+/* Return the internal lock used by nl_langinfo.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019-2020.  */
+
+#include <config.h>
+
+/* When it is known that the gl_get_nl_langinfo_lock function is defined
+   by a dependency library, it should not be defined here.  */
+#if OMIT_NL_LANGINFO_LOCK
+
+/* This declaration is solely to ensure that after preprocessing
+   this file is never empty.  */
+typedef int dummy;
+
+#else
+
+/* This file defines the internal lock used by nl_langinfo.
+   It is a separate compilation unit, so that only one copy of it is
+   present when linking statically.  */
+
+/* Prohibit renaming this symbol.  */
+# undef gl_get_nl_langinfo_lock
+
+/* Macro for exporting a symbol (function, not variable) defined in this file,
+   when compiled into a shared library.  */
+# ifndef DLL_EXPORTED
+#  if HAVE_VISIBILITY
+  /* Override the effect of the compiler option '-fvisibility=hidden'.  */
+#   define DLL_EXPORTED __attribute__((__visibility__("default")))
+#  elif defined _WIN32 || defined __CYGWIN__
+#   define DLL_EXPORTED __declspec(dllexport)
+#  else
+#   define DLL_EXPORTED
+#  endif
+# endif
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+#  define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#  include <windows.h>
+
+#  include "windows-initguard.h"
+
+/* The return type is a 'CRITICAL_SECTION *', not a 'glwthread_mutex_t *',
+   because the latter is not guaranteed to be a stable ABI in the future.  */
+
+/* Make sure the function gets exported from DLLs.  */
+DLL_EXPORTED CRITICAL_SECTION *gl_get_nl_langinfo_lock (void);
+
+static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
+static CRITICAL_SECTION lock;
+
+/* Returns the internal lock used by nl_langinfo.  */
+CRITICAL_SECTION *
+gl_get_nl_langinfo_lock (void)
+{
+  if (!guard.done)
+    {
+      if (InterlockedIncrement (&guard.started) == 0)
+        {
+          /* This thread is the first one to need the lock.  Initialize it.  */
+          InitializeCriticalSection (&lock);
+          guard.done = 1;
+        }
+      else
+        {
+          /* Don't let guard.started grow and wrap around.  */
+          InterlockedDecrement (&guard.started);
+          /* Yield the CPU while waiting for another thread to finish
+             initializing this mutex.  */
+          while (!guard.done)
+            Sleep (0);
+        }
+    }
+  return &lock;
+}
+
+# elif HAVE_PTHREAD_API
+
+#  include <pthread.h>
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* Make sure the function gets exported from shared libraries.  */
+DLL_EXPORTED pthread_mutex_t *gl_get_nl_langinfo_lock (void);
+
+/* Returns the internal lock used by nl_langinfo.  */
+pthread_mutex_t *
+gl_get_nl_langinfo_lock (void)
+{
+  return &mutex;
+}
+
+# elif HAVE_THREADS_H
+
+#  include <threads.h>
+#  include <stdlib.h>
+
+static int volatile init_needed = 1;
+static once_flag init_once = ONCE_FLAG_INIT;
+static mtx_t mutex;
+
+static void
+atomic_init (void)
+{
+  if (mtx_init (&mutex, mtx_plain) != thrd_success)
+    abort ();
+  init_needed = 0;
+}
+
+/* Make sure the function gets exported from shared libraries.  */
+DLL_EXPORTED mtx_t *gl_get_nl_langinfo_lock (void);
+
+/* Returns the internal lock used by nl_langinfo.  */
+mtx_t *
+gl_get_nl_langinfo_lock (void)
+{
+  if (init_needed)
+    call_once (&init_once, atomic_init);
+  return &mutex;
+}
+
+# endif
+
+# if (defined _WIN32 || defined __CYGWIN__) && !defined _MSC_VER
+/* Make sure the '__declspec(dllimport)' in nl_langinfo.c does not cause
+   a link failure when no DLLs are involved.  */
+#  if defined _WIN64 || defined _LP64
+#   define IMP(x) __imp_##x
+#  else
+#   define IMP(x) _imp__##x
+#  endif
+void * IMP(gl_get_nl_langinfo_lock) = &gl_get_nl_langinfo_lock;
+# endif
+
+#endif
index 11da646..0acd849 100644 (file)
@@ -1,6 +1,6 @@
 /* nl_langinfo() replacement: query locale dependent information.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include <langinfo.h>
 
 #include <locale.h>
+#include <stdlib.h>
 #include <string.h>
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 # include <stdio.h>
 #endif
 
+#if REPLACE_NL_LANGINFO && !NL_LANGINFO_MTSAFE
+# if defined _WIN32 && !defined __CYGWIN__
+
+#  define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#  include <windows.h>
+
+# elif HAVE_PTHREAD_API
+
+#  include <pthread.h>
+#  if HAVE_THREADS_H && HAVE_WEAK_SYMBOLS
+#   include <threads.h>
+#   pragma weak thrd_exit
+#   define c11_threads_in_use() (thrd_exit != NULL)
+#  else
+#   define c11_threads_in_use() 0
+#  endif
+
+# elif HAVE_THREADS_H
+
+#  include <threads.h>
+
+# endif
+#endif
+
+/* nl_langinfo() must be multithread-safe.  To achieve this without using
+   thread-local storage:
+     1. We use a specific static buffer for each possible argument.
+        So that different threads can call nl_langinfo with different arguments,
+        without interfering.
+     2. We use a simple strcpy or memcpy to fill this static buffer.  Filling it
+        through, for example, strcpy + strcat would not be guaranteed to leave
+        the buffer's contents intact if another thread is currently accessing
+        it.  If necessary, the contents is first assembled in a stack-allocated
+        buffer.  */
+
+#if !REPLACE_NL_LANGINFO || GNULIB_defined_CODESET
 /* Return the codeset of the current locale, if this is easily deducible.
    Otherwise, return "".  */
 static char *
 ctype_codeset (void)
 {
-  static char buf[2 + 10 + 1];
-  char const *locale = setlocale (LC_CTYPE, NULL);
-  char *codeset = buf;
+  static char result[2 + 10 + 1];
+  char buf[2 + 10 + 1];
+  char locale[SETLOCALE_NULL_MAX];
+  char *codeset;
   size_t codesetlen;
+
+  if (setlocale_null_r (LC_CTYPE, locale, sizeof (locale)))
+    locale[0] = '\0';
+
+  codeset = buf;
   codeset[0] = '\0';
 
-  if (locale && locale[0])
+  if (locale[0])
     {
       /* If the locale name contains an encoding after the dot, return it.  */
       char *dot = strchr (locale, '.');
@@ -64,7 +107,7 @@ ctype_codeset (void)
         }
     }
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
   /* If setlocale is successful, it returns the number of the
      codepage, as a string.  Otherwise, fall back on Windows API
      GetACP, which returns the locale's codepage as a number (although
@@ -75,10 +118,22 @@ ctype_codeset (void)
     memmove (buf + 2, codeset, codesetlen + 1);
   else
     sprintf (buf + 2, "%u", GetACP ());
-  codeset = memcpy (buf, "CP", 2);
+  /* For a locale name such as "French_France.65001", in Windows 10,
+     setlocale now returns "French_France.utf8" instead.  */
+  if (strcmp (buf + 2, "65001") == 0 || strcmp (buf + 2, "utf8") == 0)
+    return (char *) "UTF-8";
+  else
+    {
+      memcpy (buf, "CP", 2);
+      strcpy (result, buf);
+      return result;
+    }
+# else
+  strcpy (result, codeset);
+  return result;
 #endif
-  return codeset;
 }
+#endif
 
 
 #if REPLACE_NL_LANGINFO
@@ -87,6 +142,137 @@ ctype_codeset (void)
 
 # undef nl_langinfo
 
+/* Without locking, on Solaris 11.3, test-nl_langinfo-mt fails, with message
+   "thread5 disturbed by threadN!", even when threadN invokes only
+      nl_langinfo (CODESET);
+      nl_langinfo (CRNCYSTR);
+   Similarly on Solaris 10.  */
+
+# if !NL_LANGINFO_MTSAFE /* Solaris */
+
+#  define ITEMS (MAXSTRMSG + 1)
+#  define MAX_RESULT_LEN 80
+
+static char *
+nl_langinfo_unlocked (nl_item item)
+{
+  static char result[ITEMS][MAX_RESULT_LEN];
+
+  /* The result of nl_langinfo is in storage that can be overwritten by
+     other calls to nl_langinfo.  */
+  char *tmp = nl_langinfo (item);
+  if (item >= 0 && item < ITEMS && tmp != NULL)
+    {
+      size_t tmp_len = strlen (tmp);
+      if (tmp_len < MAX_RESULT_LEN)
+        strcpy (result[item], tmp);
+      else
+        {
+          /* Produce a truncated result.  Oh well...  */
+          result[item][MAX_RESULT_LEN - 1] = '\0';
+          memcpy (result[item], tmp, MAX_RESULT_LEN - 1);
+        }
+      return result[item];
+    }
+  else
+    return tmp;
+}
+
+/* Use a lock, so that no two threads can invoke nl_langinfo_unlocked
+   at the same time.  */
+
+/* Prohibit renaming this symbol.  */
+#  undef gl_get_nl_langinfo_lock
+
+#  if defined _WIN32 && !defined __CYGWIN__
+
+extern __declspec(dllimport) CRITICAL_SECTION *gl_get_nl_langinfo_lock (void);
+
+static char *
+nl_langinfo_with_lock (nl_item item)
+{
+  CRITICAL_SECTION *lock = gl_get_nl_langinfo_lock ();
+  char *ret;
+
+  EnterCriticalSection (lock);
+  ret = nl_langinfo_unlocked (item);
+  LeaveCriticalSection (lock);
+
+  return ret;
+}
+
+#  elif HAVE_PTHREAD_API
+
+extern
+#   if defined _WIN32 || defined __CYGWIN__
+  __declspec(dllimport)
+#   endif
+  pthread_mutex_t *gl_get_nl_langinfo_lock (void);
+
+#   if HAVE_WEAK_SYMBOLS /* musl libc, FreeBSD, NetBSD, OpenBSD, Haiku */
+
+     /* Avoid the need to link with '-lpthread'.  */
+#    pragma weak pthread_mutex_lock
+#    pragma weak pthread_mutex_unlock
+
+     /* Determine whether libpthread is in use.  */
+#    pragma weak pthread_mutexattr_gettype
+     /* See the comments in lock.h.  */
+#    define pthread_in_use() \
+       (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+
+#   else
+#    define pthread_in_use() 1
+#   endif
+
+static char *
+nl_langinfo_with_lock (nl_item item)
+{
+  if (pthread_in_use())
+    {
+      pthread_mutex_t *lock = gl_get_nl_langinfo_lock ();
+      char *ret;
+
+      if (pthread_mutex_lock (lock))
+        abort ();
+      ret = nl_langinfo_unlocked (item);
+      if (pthread_mutex_unlock (lock))
+        abort ();
+
+      return ret;
+    }
+  else
+    return nl_langinfo_unlocked (item);
+}
+
+#  elif HAVE_THREADS_H
+
+extern mtx_t *gl_get_nl_langinfo_lock (void);
+
+static char *
+nl_langinfo_with_lock (nl_item item)
+{
+  mtx_t *lock = gl_get_nl_langinfo_lock ();
+  char *ret;
+
+  if (mtx_lock (lock) != thrd_success)
+    abort ();
+  ret = nl_langinfo_unlocked (item);
+  if (mtx_unlock (lock) != thrd_success)
+    abort ();
+
+  return ret;
+}
+
+#  endif
+
+# else
+
+/* On other platforms, no lock is needed.  */
+#  define nl_langinfo_with_lock nl_langinfo
+
+# endif
+
 char *
 rpl_nl_langinfo (nl_item item)
 {
@@ -100,6 +286,24 @@ rpl_nl_langinfo (nl_item item)
     case T_FMT_AMPM:
       return (char *) "%I:%M:%S %p";
 # endif
+# if GNULIB_defined_ALTMON
+    case ALTMON_1:
+    case ALTMON_2:
+    case ALTMON_3:
+    case ALTMON_4:
+    case ALTMON_5:
+    case ALTMON_6:
+    case ALTMON_7:
+    case ALTMON_8:
+    case ALTMON_9:
+    case ALTMON_10:
+    case ALTMON_11:
+    case ALTMON_12:
+      /* We don't ship the appropriate localizations with gnulib.  Therefore,
+         treat ALTMON_i like MON_i.  */
+      item = item - ALTMON_1 + MON_1;
+      break;
+# endif
 # if GNULIB_defined_ERA
     case ERA:
       /* The format is not standardized.  In glibc it is a sequence of strings
@@ -135,7 +339,7 @@ rpl_nl_langinfo (nl_item item)
     default:
       break;
     }
-  return nl_langinfo (item);
+  return nl_langinfo_with_lock (item);
 }
 
 #else
@@ -149,7 +353,7 @@ rpl_nl_langinfo (nl_item item)
 char *
 nl_langinfo (nl_item item)
 {
-  static char nlbuf[100];
+  char buf[100];
   struct tm tmm = { 0 };
 
   switch (item)
@@ -171,8 +375,10 @@ nl_langinfo (nl_item item)
       return localeconv () ->decimal_point;
     case THOUSEP:
       return localeconv () ->thousands_sep;
+# ifdef GROUPING
     case GROUPING:
       return localeconv () ->grouping;
+# endif
     /* nl_langinfo items of the LC_TIME category.
        TODO: Really use the locale.  */
     case D_T_FMT:
@@ -187,14 +393,22 @@ nl_langinfo (nl_item item)
     case T_FMT_AMPM:
       return (char *) "%I:%M:%S %p";
     case AM_STR:
-      if (!strftime (nlbuf, sizeof nlbuf, "%p", &tmm))
-        return (char *) "AM";
-      return nlbuf;
+      {
+        static char result[80];
+        if (!strftime (buf, sizeof result, "%p", &tmm))
+          return (char *) "AM";
+        strcpy (result, buf);
+        return result;
+      }
     case PM_STR:
-      tmm.tm_hour = 12;
-      if (!strftime (nlbuf, sizeof nlbuf, "%p", &tmm))
-        return (char *) "PM";
-      return nlbuf;
+      {
+        static char result[80];
+        tmm.tm_hour = 12;
+        if (!strftime (buf, sizeof result, "%p", &tmm))
+          return (char *) "PM";
+        strcpy (result, buf);
+        return result;
+      }
     case DAY_1:
     case DAY_2:
     case DAY_3:
@@ -203,14 +417,16 @@ nl_langinfo (nl_item item)
     case DAY_6:
     case DAY_7:
       {
+        static char result[7][50];
         static char const days[][sizeof "Wednesday"] = {
           "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday",
           "Friday", "Saturday"
         };
         tmm.tm_wday = item - DAY_1;
-        if (!strftime (nlbuf, sizeof nlbuf, "%A", &tmm))
+        if (!strftime (buf, sizeof result[0], "%A", &tmm))
           return (char *) days[item - DAY_1];
-        return nlbuf;
+        strcpy (result[item - DAY_1], buf);
+        return result[item - DAY_1];
       }
     case ABDAY_1:
     case ABDAY_2:
@@ -220,36 +436,67 @@ nl_langinfo (nl_item item)
     case ABDAY_6:
     case ABDAY_7:
       {
+        static char result[7][30];
         static char const abdays[][sizeof "Sun"] = {
           "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
         };
         tmm.tm_wday = item - ABDAY_1;
-        if (!strftime (nlbuf, sizeof nlbuf, "%a", &tmm))
+        if (!strftime (buf, sizeof result[0], "%a", &tmm))
           return (char *) abdays[item - ABDAY_1];
-        return nlbuf;
-      }
-    case MON_1:
-    case MON_2:
-    case MON_3:
-    case MON_4:
-    case MON_5:
-    case MON_6:
-    case MON_7:
-    case MON_8:
-    case MON_9:
-    case MON_10:
-    case MON_11:
-    case MON_12:
-      {
-        static char const months[][sizeof "September"] = {
-          "January", "February", "March", "April", "May", "June", "July",
-          "September", "October", "November", "December"
-        };
-        tmm.tm_mon = item - MON_1;
-        if (!strftime (nlbuf, sizeof nlbuf, "%B", &tmm))
-          return (char *) months[item - MON_1];
-        return nlbuf;
+        strcpy (result[item - ABDAY_1], buf);
+        return result[item - ABDAY_1];
       }
+    {
+      static char const months[][sizeof "September"] = {
+        "January", "February", "March", "April", "May", "June", "July",
+        "September", "October", "November", "December"
+      };
+      case MON_1:
+      case MON_2:
+      case MON_3:
+      case MON_4:
+      case MON_5:
+      case MON_6:
+      case MON_7:
+      case MON_8:
+      case MON_9:
+      case MON_10:
+      case MON_11:
+      case MON_12:
+        {
+          static char result[12][50];
+          tmm.tm_mon = item - MON_1;
+          if (!strftime (buf, sizeof result[0], "%B", &tmm))
+            return (char *) months[item - MON_1];
+          strcpy (result[item - MON_1], buf);
+          return result[item - MON_1];
+        }
+      case ALTMON_1:
+      case ALTMON_2:
+      case ALTMON_3:
+      case ALTMON_4:
+      case ALTMON_5:
+      case ALTMON_6:
+      case ALTMON_7:
+      case ALTMON_8:
+      case ALTMON_9:
+      case ALTMON_10:
+      case ALTMON_11:
+      case ALTMON_12:
+        {
+          static char result[12][50];
+          tmm.tm_mon = item - ALTMON_1;
+          /* The platforms without nl_langinfo() don't support strftime with
+             %OB.  We don't even need to try.  */
+          #if 0
+          if (!strftime (buf, sizeof result[0], "%OB", &tmm))
+          #endif
+            if (!strftime (buf, sizeof result[0], "%B", &tmm))
+              return (char *) months[item - ALTMON_1];
+          strcpy (result[item - ALTMON_1], buf);
+          return result[item - ALTMON_1];
+        }
+    }
     case ABMON_1:
     case ABMON_2:
     case ABMON_3:
@@ -263,14 +510,16 @@ nl_langinfo (nl_item item)
     case ABMON_11:
     case ABMON_12:
       {
+        static char result[12][30];
         static char const abmonths[][sizeof "Jan"] = {
           "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul",
           "Sep", "Oct", "Nov", "Dec"
         };
         tmm.tm_mon = item - ABMON_1;
-        if (!strftime (nlbuf, sizeof nlbuf, "%b", &tmm))
+        if (!strftime (buf, sizeof result[0], "%b", &tmm))
           return (char *) abmonths[item - ABMON_1];
-        return nlbuf;
+        strcpy (result[item - ABMON_1], buf);
+        return result[item - ABMON_1];
       }
     case ERA:
       return (char *) "";
@@ -279,6 +528,7 @@ nl_langinfo (nl_item item)
     /* nl_langinfo items of the LC_MONETARY category.  */
     case CRNCYSTR:
       return localeconv () ->currency_symbol;
+# ifdef INT_CURR_SYMBOL
     case INT_CURR_SYMBOL:
       return localeconv () ->int_curr_symbol;
     case MON_DECIMAL_POINT:
@@ -307,6 +557,7 @@ nl_langinfo (nl_item item)
       return & localeconv () ->p_sign_posn;
     case N_SIGN_POSN:
       return & localeconv () ->n_sign_posn;
+# endif
     /* nl_langinfo items of the LC_MESSAGES category
        TODO: Really use the locale. */
     case YESEXPR:
index 6e7b52c..033b596 100644 (file)
@@ -1,5 +1,5 @@
 /* obstack.c - subroutines used implicitly by object stack macros
-   Copyright (C) 1988-2016 Free Software Foundation, Inc.
+   Copyright (C) 1988-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@
 
    You should have received a copy of the GNU General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 
 #ifdef _LIBC
@@ -326,7 +326,7 @@ int obstack_exit_failure = EXIT_FAILURE;
 #   include <libio/iolibio.h>
 #  endif
 
-static _Noreturn void
+static __attribute_noreturn__ void
 print_and_abort (void)
 {
   /* Don't change any of these strings.  Yes, it would be possible to add
index e558133..d6e03a6 100644 (file)
@@ -1,5 +1,5 @@
 /* obstack.h - object stack macros
-   Copyright (C) 1988-2016 Free Software Foundation, Inc.
+   Copyright (C) 1988-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@
 
    You should have received a copy of the GNU General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 /* Summary:
 
 #include <stddef.h>             /* For size_t and ptrdiff_t.  */
 #include <string.h>             /* For __GNU_LIBRARY__, and memcpy.  */
 
-#if __STDC_VERSION__ < 199901L
+#if __STDC_VERSION__ < 199901L || defined __HP_cc
 # define __FLEXIBLE_ARRAY_MEMBER 1
 #else
 # define __FLEXIBLE_ARRAY_MEMBER
 
 /* Not the same as _Noreturn, since it also works with function pointers.  */
 #ifndef __attribute_noreturn__
-# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || 0x5110 <= __SUNPRO_C
+# if 2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ || 0x5110 <= __SUNPRO_C
 #  define __attribute_noreturn__ __attribute__ ((__noreturn__))
 # else
 #  define __attribute_noreturn__
@@ -283,8 +283,9 @@ extern int obstack_exit_failure;
 
 #define obstack_memory_used(h) _obstack_memory_used (h)
 
-#if defined __GNUC__
-# if !defined __GNUC_MINOR__ || __GNUC__ * 1000 + __GNUC_MINOR__ < 2008
+#if defined __GNUC__ || defined __clang__
+# if !(defined __GNUC_MINOR__ && __GNUC__ * 1000 + __GNUC_MINOR__ >= 2008 \
+       || defined __clang__)
 #  define __extension__
 # endif
 
index e9c3120..8599185 100644 (file)
@@ -1,5 +1,5 @@
 /* Open a descriptor to a file.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
 static int
 orig_open (const char *filename, int flags, mode_t mode)
 {
+#if defined _WIN32 && !defined __CYGWIN__
+  return _open (filename, flags, mode);
+#else
   return open (filename, flags, mode);
+#endif
 }
 
 /* Specification.  */
@@ -38,6 +42,8 @@ orig_open (const char *filename, int flags, mode_t mode)
    this include because of the preliminary #include <fcntl.h> above.  */
 #include "fcntl.h"
 
+#include "cloexec.h"
+
 #include <errno.h>
 #include <stdarg.h>
 #include <string.h>
@@ -52,6 +58,13 @@ orig_open (const char *filename, int flags, mode_t mode)
 int
 open (const char *filename, int flags, ...)
 {
+  /* 0 = unknown, 1 = yes, -1 = no.  */
+#if GNULIB_defined_O_CLOEXEC
+  int have_cloexec = -1;
+#else
+  static int have_cloexec;
+#endif
+
   mode_t mode;
   int fd;
 
@@ -77,34 +90,33 @@ open (const char *filename, int flags, ...)
   flags &= ~O_NONBLOCK;
 #endif
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   if (strcmp (filename, "/dev/null") == 0)
     filename = "NUL";
 #endif
 
 #if OPEN_TRAILING_SLASH_BUG
-  /* If the filename ends in a slash and one of O_CREAT, O_WRONLY, O_RDWR
-     is specified, then fail.
-     Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html>
-     says that
-       "A pathname that contains at least one non-slash character and that
-        ends with one or more trailing slashes shall be resolved as if a
-        single dot character ( '.' ) were appended to the pathname."
-     and
-       "The special filename dot shall refer to the directory specified by
-        its predecessor."
+  /* Fail if one of O_CREAT, O_WRONLY, O_RDWR is specified and the filename
+     ends in a slash, as POSIX says such a filename must name a directory
+     <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+       "A pathname that contains at least one non-<slash> character and that
+        ends with one or more trailing <slash> characters shall not be resolved
+        successfully unless the last pathname component before the trailing
+        <slash> characters names an existing directory"
      If the named file already exists as a directory, then
        - if O_CREAT is specified, open() must fail because of the semantics
          of O_CREAT,
        - if O_WRONLY or O_RDWR is specified, open() must fail because POSIX
-         <http://www.opengroup.org/susv3/functions/open.html> says that it
-         fails with errno = EISDIR in this case.
+         <https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html>
+         says that it fails with errno = EISDIR in this case.
      If the named file does not exist or does not name a directory, then
        - if O_CREAT is specified, open() must fail since open() cannot create
          directories,
        - if O_WRONLY or O_RDWR is specified, open() must fail because the
          file does not contain a '.' directory.  */
-  if (flags & (O_CREAT | O_WRONLY | O_RDWR))
+  if ((flags & O_CREAT)
+      || (flags & O_ACCMODE) == O_RDWR
+      || (flags & O_ACCMODE) == O_WRONLY)
     {
       size_t len = strlen (filename);
       if (len > 0 && filename[len - 1] == '/')
@@ -115,7 +127,25 @@ open (const char *filename, int flags, ...)
     }
 #endif
 
-  fd = orig_open (filename, flags, mode);
+  fd = orig_open (filename,
+                  flags & ~(have_cloexec < 0 ? O_CLOEXEC : 0), mode);
+
+  if (flags & O_CLOEXEC)
+    {
+      if (! have_cloexec)
+        {
+          if (0 <= fd)
+            have_cloexec = 1;
+          else if (errno == EINVAL)
+            {
+              fd = orig_open (filename, flags & ~O_CLOEXEC, mode);
+              have_cloexec = -1;
+            }
+        }
+      if (have_cloexec < 0 && 0 <= fd)
+        set_cloexec_flag (fd, true);
+    }
+
 
 #if REPLACE_FCHDIR
   /* Implementing fchdir and fdopendir requires the ability to open a
@@ -144,14 +174,12 @@ open (const char *filename, int flags, ...)
 #if OPEN_TRAILING_SLASH_BUG
   /* If the filename ends in a slash and fd does not refer to a directory,
      then fail.
-     Rationale: POSIX <http://www.opengroup.org/susv3/basedefs/xbd_chap04.html>
-     says that
-       "A pathname that contains at least one non-slash character and that
-        ends with one or more trailing slashes shall be resolved as if a
-        single dot character ( '.' ) were appended to the pathname."
-     and
-       "The special filename dot shall refer to the directory specified by
-        its predecessor."
+     Rationale: POSIX says such a filename must name a directory
+     <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+       "A pathname that contains at least one non-<slash> character and that
+        ends with one or more trailing <slash> characters shall not be resolved
+        successfully unless the last pathname component before the trailing
+        <slash> characters names an existing directory"
      If the named file without the slash is not a directory, open() must fail
      with ENOTDIR.  */
   if (fd >= 0)
diff --git a/lib/openat-die.c b/lib/openat-die.c
new file mode 100644 (file)
index 0000000..f30e210
--- /dev/null
@@ -0,0 +1,62 @@
+/* Report a save- or restore-cwd failure in our openat replacement and then exit.
+
+   Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "openat.h"
+
+#include <stdlib.h>
+
+#ifndef GNULIB_LIBPOSIX
+# include "error.h"
+#endif
+
+#include "exitfail.h"
+
+#include "gettext.h"
+#define _(msgid) gettext (msgid)
+
+_Noreturn void
+openat_save_fail (int errnum)
+{
+#ifndef GNULIB_LIBPOSIX
+  error (exit_failure, errnum,
+         _("unable to record current working directory"));
+#endif
+  /* _Noreturn cannot be applied to error, since it returns
+     when its first argument is 0.  To help compilers understand that this
+     function does not return, call abort.  Also, the abort is a
+     safety feature if exit_failure is 0 (which shouldn't happen).  */
+  abort ();
+}
+
+
+/* Exit with an error about failure to restore the working directory
+   during an openat emulation.  The caller must ensure that fd 2 is
+   not a just-opened fd, even when openat_safer is not in use.  */
+
+_Noreturn void
+openat_restore_fail (int errnum)
+{
+#ifndef GNULIB_LIBPOSIX
+  error (exit_failure, errnum,
+         _("failed to return to initial working directory"));
+#endif
+
+  /* As above.  */
+  abort ();
+}
diff --git a/lib/openat-priv.h b/lib/openat-priv.h
new file mode 100644 (file)
index 0000000..5c42d03
--- /dev/null
@@ -0,0 +1,64 @@
+/* Internals for openat-like functions.
+
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering */
+
+#ifndef _GL_HEADER_OPENAT_PRIV
+#define _GL_HEADER_OPENAT_PRIV
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+/* Maximum number of bytes that it is safe to allocate as a single
+   array on the stack, and that is known as a compile-time constant.
+   The assumption is that we'll touch the array very quickly, or a
+   temporary very near the array, provoking an out-of-memory trap.  On
+   some operating systems, there is only one guard page for the stack,
+   and a page size can be as small as 4096 bytes.  Subtract 64 in the
+   hope that this will let the compiler touch a nearby temporary and
+   provoke a trap.  */
+#define SAFER_ALLOCA_MAX (4096 - 64)
+
+#define SAFER_ALLOCA(m) ((m) < SAFER_ALLOCA_MAX ? (m) : SAFER_ALLOCA_MAX)
+
+#if defined PATH_MAX
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (PATH_MAX)
+#elif defined _XOPEN_PATH_MAX
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (_XOPEN_PATH_MAX)
+#else
+# define OPENAT_BUFFER_SIZE SAFER_ALLOCA (1024)
+#endif
+
+char *openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file);
+
+/* Trying to access a BUILD_PROC_NAME file will fail on systems without
+   /proc support, and even on systems *with* ProcFS support.  Return
+   nonzero if the failure may be legitimate, e.g., because /proc is not
+   readable, or the particular .../fd/N directory is not present.  */
+#define EXPECTED_ERRNO(Errno)                   \
+  ((Errno) == ENOTDIR || (Errno) == ENOENT      \
+   || (Errno) == EPERM || (Errno) == EACCES     \
+   || (Errno) == ENOSYS /* Solaris 8 */         \
+   || (Errno) == EOPNOTSUPP /* FreeBSD */)
+
+/* Wrapper function shared among linkat and renameat.  */
+int at_func2 (int fd1, char const *file1,
+              int fd2, char const *file2,
+              int (*func) (char const *file1, char const *file2));
+
+#endif /* _GL_HEADER_OPENAT_PRIV */
diff --git a/lib/openat-proc.c b/lib/openat-proc.c
new file mode 100644 (file)
index 0000000..4f8be90
--- /dev/null
@@ -0,0 +1,135 @@
+/* Create /proc/self/fd-related names for subfiles of open directories.
+
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#include "openat-priv.h"
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#ifdef __KLIBC__
+# include <InnoTekLIBC/backend.h>
+#endif
+
+#include "intprops.h"
+
+/* Set BUF to the name of the subfile of the directory identified by
+   FD, where the subfile is named FILE.  If successful, return BUF if
+   the result fits in BUF, dynamically allocated memory otherwise.
+   Return NULL (setting errno) on error.  */
+char *
+openat_proc_name (char buf[OPENAT_BUFFER_SIZE], int fd, char const *file)
+{
+  char *result = buf;
+  int dirlen;
+
+  /* Make sure the caller gets ENOENT when appropriate.  */
+  if (!*file)
+    {
+      buf[0] = '\0';
+      return buf;
+    }
+
+#ifndef __KLIBC__
+# define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/"
+  {
+    enum {
+      PROC_SELF_FD_DIR_SIZE_BOUND
+        = (sizeof PROC_SELF_FD_FORMAT - (sizeof "%d" - 1)
+           + INT_STRLEN_BOUND (int))
+    };
+
+    static int proc_status = 0;
+    if (! proc_status)
+      {
+        /* Set PROC_STATUS to a positive value if /proc/self/fd is
+           reliable, and a negative value otherwise.  Solaris 10
+           /proc/self/fd mishandles "..", and any file name might expand
+           to ".." after symbolic link expansion, so avoid /proc/self/fd
+           if it mishandles "..".  Solaris 10 has openat, but this
+           problem is exhibited on code that built on Solaris 8 and
+           running on Solaris 10.  */
+
+        int proc_self_fd =
+          open ("/proc/self/fd",
+                O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK | O_CLOEXEC);
+        if (proc_self_fd < 0)
+          proc_status = -1;
+        else
+          {
+            /* Detect whether /proc/self/fd/%i/../fd exists, where %i is the
+               number of a file descriptor open on /proc/self/fd.  On Linux,
+               that name resolves to /proc/self/fd, which was opened above.
+               However, on Solaris, it may resolve to /proc/self/fd/fd, which
+               cannot exist, since all names in /proc/self/fd are numeric.  */
+            char dotdot_buf[PROC_SELF_FD_DIR_SIZE_BOUND + sizeof "../fd" - 1];
+            sprintf (dotdot_buf, PROC_SELF_FD_FORMAT "../fd", proc_self_fd);
+            proc_status = access (dotdot_buf, F_OK) ? -1 : 1;
+            close (proc_self_fd);
+          }
+      }
+
+    if (proc_status < 0)
+      return NULL;
+    else
+      {
+        size_t bufsize = PROC_SELF_FD_DIR_SIZE_BOUND + strlen (file);
+        if (OPENAT_BUFFER_SIZE < bufsize)
+          {
+            result = malloc (bufsize);
+            if (! result)
+              return NULL;
+          }
+
+        dirlen = sprintf (result, PROC_SELF_FD_FORMAT, fd);
+      }
+  }
+#else
+  /* OS/2 kLIBC provides a function to retrieve a path from a fd.  */
+  {
+    char dir[_MAX_PATH];
+    size_t bufsize;
+
+    if (__libc_Back_ioFHToPath (fd, dir, sizeof dir))
+      return NULL;
+
+    dirlen = strlen (dir);
+    bufsize = dirlen + 1 + strlen (file) + 1; /* 1 for '/', 1 for null */
+    if (OPENAT_BUFFER_SIZE < bufsize)
+      {
+        result = malloc (bufsize);
+        if (! result)
+          return NULL;
+      }
+
+    strcpy (result, dir);
+    result[dirlen++] = '/';
+  }
+#endif
+
+  strcpy (result + dirlen, file);
+  return result;
+}
diff --git a/lib/openat.c b/lib/openat.c
new file mode 100644 (file)
index 0000000..ac92374
--- /dev/null
@@ -0,0 +1,312 @@
+/* provide a replacement openat function
+   Copyright (C) 2004-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering */
+
+/* If the user's config.h happens to include <fcntl.h>, let it include only
+   the system's <fcntl.h> here, so that orig_openat doesn't recurse to
+   rpl_openat.  */
+#define __need_system_fcntl_h
+#include <config.h>
+
+/* Get the original definition of open.  It might be defined as a macro.  */
+#include <fcntl.h>
+#include <sys/types.h>
+#undef __need_system_fcntl_h
+
+#if HAVE_OPENAT
+static int
+orig_openat (int fd, char const *filename, int flags, mode_t mode)
+{
+  return openat (fd, filename, flags, mode);
+}
+#endif
+
+/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates
+   this include because of the preliminary #include <fcntl.h> above.  */
+#include "fcntl.h"
+
+#include "openat.h"
+
+#include "cloexec.h"
+
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <errno.h>
+
+#if HAVE_OPENAT
+
+/* Like openat, but support O_CLOEXEC and work around Solaris 9 bugs
+   with trailing slash.  */
+int
+rpl_openat (int dfd, char const *filename, int flags, ...)
+{
+  /* 0 = unknown, 1 = yes, -1 = no.  */
+#if GNULIB_defined_O_CLOEXEC
+  int have_cloexec = -1;
+#else
+  static int have_cloexec;
+#endif
+
+  mode_t mode;
+  int fd;
+
+  mode = 0;
+  if (flags & O_CREAT)
+    {
+      va_list arg;
+      va_start (arg, flags);
+
+      /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
+         creates crashing code when 'mode_t' is smaller than 'int'.  */
+      mode = va_arg (arg, PROMOTED_MODE_T);
+
+      va_end (arg);
+    }
+
+# if OPEN_TRAILING_SLASH_BUG
+  /* Fail if one of O_CREAT, O_WRONLY, O_RDWR is specified and the filename
+     ends in a slash, as POSIX says such a filename must name a directory
+     <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+       "A pathname that contains at least one non-<slash> character and that
+        ends with one or more trailing <slash> characters shall not be resolved
+        successfully unless the last pathname component before the trailing
+        <slash> characters names an existing directory"
+     If the named file already exists as a directory, then
+       - if O_CREAT is specified, open() must fail because of the semantics
+         of O_CREAT,
+       - if O_WRONLY or O_RDWR is specified, open() must fail because POSIX
+         <https://pubs.opengroup.org/onlinepubs/9699919799/functions/openat.html>
+         says that it fails with errno = EISDIR in this case.
+     If the named file does not exist or does not name a directory, then
+       - if O_CREAT is specified, open() must fail since open() cannot create
+         directories,
+       - if O_WRONLY or O_RDWR is specified, open() must fail because the
+         file does not contain a '.' directory.  */
+  if ((flags & O_CREAT)
+      || (flags & O_ACCMODE) == O_RDWR
+      || (flags & O_ACCMODE) == O_WRONLY)
+    {
+      size_t len = strlen (filename);
+      if (len > 0 && filename[len - 1] == '/')
+        {
+          errno = EISDIR;
+          return -1;
+        }
+    }
+# endif
+
+  fd = orig_openat (dfd, filename,
+                    flags & ~(have_cloexec < 0 ? O_CLOEXEC : 0), mode);
+
+  if (flags & O_CLOEXEC)
+    {
+      if (! have_cloexec)
+        {
+          if (0 <= fd)
+            have_cloexec = 1;
+          else if (errno == EINVAL)
+            {
+              fd = orig_openat (dfd, filename, flags & ~O_CLOEXEC, mode);
+              have_cloexec = -1;
+            }
+        }
+      if (have_cloexec < 0 && 0 <= fd)
+        set_cloexec_flag (fd, true);
+    }
+
+
+# if OPEN_TRAILING_SLASH_BUG
+  /* If the filename ends in a slash and fd does not refer to a directory,
+     then fail.
+     Rationale: POSIX says such a filename must name a directory
+     <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+       "A pathname that contains at least one non-<slash> character and that
+        ends with one or more trailing <slash> characters shall not be resolved
+        successfully unless the last pathname component before the trailing
+        <slash> characters names an existing directory"
+     If the named file without the slash is not a directory, open() must fail
+     with ENOTDIR.  */
+  if (fd >= 0)
+    {
+      /* We know len is positive, since open did not fail with ENOENT.  */
+      size_t len = strlen (filename);
+      if (filename[len - 1] == '/')
+        {
+          struct stat statbuf;
+
+          if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode))
+            {
+              close (fd);
+              errno = ENOTDIR;
+              return -1;
+            }
+        }
+    }
+# endif
+
+  return fd;
+}
+
+#else /* !HAVE_OPENAT */
+
+# include "filename.h" /* solely for definition of IS_ABSOLUTE_FILE_NAME */
+# include "openat-priv.h"
+# include "save-cwd.h"
+
+/* Replacement for Solaris' openat function.
+   <https://www.google.com/search?q=openat+site:docs.oracle.com>
+   First, try to simulate it via open ("/proc/self/fd/FD/FILE").
+   Failing that, simulate it by doing save_cwd/fchdir/open/restore_cwd.
+   If either the save_cwd or the restore_cwd fails (relatively unlikely),
+   then give a diagnostic and exit nonzero.
+   Otherwise, upon failure, set errno and return -1, as openat does.
+   Upon successful completion, return a file descriptor.  */
+int
+openat (int fd, char const *file, int flags, ...)
+{
+  mode_t mode = 0;
+
+  if (flags & O_CREAT)
+    {
+      va_list arg;
+      va_start (arg, flags);
+
+      /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
+         creates crashing code when 'mode_t' is smaller than 'int'.  */
+      mode = va_arg (arg, PROMOTED_MODE_T);
+
+      va_end (arg);
+    }
+
+  return openat_permissive (fd, file, flags, mode, NULL);
+}
+
+/* Like openat (FD, FILE, FLAGS, MODE), but if CWD_ERRNO is
+   nonnull, set *CWD_ERRNO to an errno value if unable to save
+   or restore the initial working directory.  This is needed only
+   the first time remove.c's remove_dir opens a command-line
+   directory argument.
+
+   If a previous attempt to restore the current working directory
+   failed, then we must not even try to access a '.'-relative name.
+   It is the caller's responsibility not to call this function
+   in that case.  */
+
+int
+openat_permissive (int fd, char const *file, int flags, mode_t mode,
+                   int *cwd_errno)
+{
+  struct saved_cwd saved_cwd;
+  int saved_errno;
+  int err;
+  bool save_ok;
+
+  if (fd == AT_FDCWD || IS_ABSOLUTE_FILE_NAME (file))
+    return open (file, flags, mode);
+
+  {
+    char buf[OPENAT_BUFFER_SIZE];
+    char *proc_file = openat_proc_name (buf, fd, file);
+    if (proc_file)
+      {
+        int open_result = open (proc_file, flags, mode);
+        int open_errno = errno;
+        if (proc_file != buf)
+          free (proc_file);
+        /* If the syscall succeeds, or if it fails with an unexpected
+           errno value, then return right away.  Otherwise, fall through
+           and resort to using save_cwd/restore_cwd.  */
+        if (0 <= open_result || ! EXPECTED_ERRNO (open_errno))
+          {
+            errno = open_errno;
+            return open_result;
+          }
+      }
+  }
+
+  save_ok = (save_cwd (&saved_cwd) == 0);
+  if (! save_ok)
+    {
+      if (! cwd_errno)
+        openat_save_fail (errno);
+      *cwd_errno = errno;
+    }
+  if (0 <= fd && fd == saved_cwd.desc)
+    {
+      /* If saving the working directory collides with the user's
+         requested fd, then the user's fd must have been closed to
+         begin with.  */
+      free_cwd (&saved_cwd);
+      errno = EBADF;
+      return -1;
+    }
+
+  err = fchdir (fd);
+  saved_errno = errno;
+
+  if (! err)
+    {
+      err = open (file, flags, mode);
+      saved_errno = errno;
+      if (save_ok && restore_cwd (&saved_cwd) != 0)
+        {
+          if (! cwd_errno)
+            {
+              /* Don't write a message to just-created fd 2.  */
+              saved_errno = errno;
+              if (err == STDERR_FILENO)
+                close (err);
+              openat_restore_fail (saved_errno);
+            }
+          *cwd_errno = errno;
+        }
+    }
+
+  free_cwd (&saved_cwd);
+  errno = saved_errno;
+  return err;
+}
+
+/* Return true if our openat implementation must resort to
+   using save_cwd and restore_cwd.  */
+bool
+openat_needs_fchdir (void)
+{
+  bool needs_fchdir = true;
+  int fd = open ("/", O_SEARCH | O_CLOEXEC);
+
+  if (0 <= fd)
+    {
+      char buf[OPENAT_BUFFER_SIZE];
+      char *proc_file = openat_proc_name (buf, fd, ".");
+      if (proc_file)
+        {
+          needs_fchdir = false;
+          if (proc_file != buf)
+            free (proc_file);
+        }
+      close (fd);
+    }
+
+  return needs_fchdir;
+}
+
+#endif /* !HAVE_OPENAT */
diff --git a/lib/openat.h b/lib/openat.h
new file mode 100644 (file)
index 0000000..7098124
--- /dev/null
@@ -0,0 +1,123 @@
+/* provide a replacement openat function
+   Copyright (C) 2004-2006, 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering */
+
+#ifndef _GL_HEADER_OPENAT
+#define _GL_HEADER_OPENAT
+
+#include <fcntl.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <stdbool.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+
+#if !HAVE_OPENAT
+
+int openat_permissive (int fd, char const *file, int flags, mode_t mode,
+                       int *cwd_errno);
+bool openat_needs_fchdir (void);
+
+#else
+
+# define openat_permissive(Fd, File, Flags, Mode, Cwd_errno) \
+    openat (Fd, File, Flags, Mode)
+# define openat_needs_fchdir() false
+
+#endif
+
+_Noreturn void openat_restore_fail (int);
+_Noreturn void openat_save_fail (int);
+
+/* Using these function names makes application code
+   slightly more readable than it would be with
+   fchownat (..., 0) or fchownat (..., AT_SYMLINK_NOFOLLOW).  */
+
+#if GNULIB_CHOWNAT
+
+# ifndef CHOWNAT_INLINE
+#  define CHOWNAT_INLINE _GL_INLINE
+# endif
+
+CHOWNAT_INLINE int
+chownat (int fd, char const *file, uid_t owner, gid_t group)
+{
+  return fchownat (fd, file, owner, group, 0);
+}
+
+CHOWNAT_INLINE int
+lchownat (int fd, char const *file, uid_t owner, gid_t group)
+{
+  return fchownat (fd, file, owner, group, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+#if GNULIB_CHMODAT
+
+# ifndef CHMODAT_INLINE
+#  define CHMODAT_INLINE _GL_INLINE
+# endif
+
+CHMODAT_INLINE int
+chmodat (int fd, char const *file, mode_t mode)
+{
+  return fchmodat (fd, file, mode, 0);
+}
+
+CHMODAT_INLINE int
+lchmodat (int fd, char const *file, mode_t mode)
+{
+  return fchmodat (fd, file, mode, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+#if GNULIB_STATAT
+
+# ifndef STATAT_INLINE
+#  define STATAT_INLINE _GL_INLINE
+# endif
+
+STATAT_INLINE int
+statat (int fd, char const *name, struct stat *st)
+{
+  return fstatat (fd, name, st, 0);
+}
+
+STATAT_INLINE int
+lstatat (int fd, char const *name, struct stat *st)
+{
+  return fstatat (fd, name, st, AT_SYMLINK_NOFOLLOW);
+}
+
+#endif
+
+/* For now, there are no wrappers named laccessat or leuidaccessat,
+   since gnulib doesn't support faccessat(,AT_SYMLINK_NOFOLLOW) and
+   since access rights on symlinks are of limited utility.  Likewise,
+   wrappers are not provided for accessat or euidaccessat, so as to
+   avoid dragging in -lgen on some platforms.  */
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GL_HEADER_OPENAT */
similarity index 89%
rename from tests/opendir.c
rename to lib/opendir.c
index a135fd8..480b96b 100644 (file)
@@ -1,5 +1,5 @@
 /* Start reading the entries of a directory.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 # include <fcntl.h>
 #endif
 
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Don't assume that UNICODE is not defined.  */
+# undef WIN32_FIND_DATA
+# define WIN32_FIND_DATA WIN32_FIND_DATAA
+# undef GetFullPathName
+# define GetFullPathName GetFullPathNameA
+# undef FindFirstFile
+# define FindFirstFile FindFirstFileA
+#endif
+
 DIR *
 opendir (const char *dir_name)
 {
diff --git a/lib/os2-spawn.c b/lib/os2-spawn.c
new file mode 100644 (file)
index 0000000..d877bc6
--- /dev/null
@@ -0,0 +1,155 @@
+/* Auxiliary functions for the creation of subprocesses.  OS/2 kLIBC API.
+   Copyright (C) 2001, 2003-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "os2-spawn.h"
+
+/* Get _open_osfhandle().  */
+#include <io.h>
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "cloexec.h"
+#include "error.h"
+#include "gettext.h"
+
+#define _(str) gettext (str)
+
+
+/* Duplicates a file handle, making the copy uninheritable.
+   Returns -1 for a file handle that is equivalent to closed.  */
+static int
+dup_noinherit (int fd)
+{
+  fd = dup_cloexec (fd);
+  if (fd < 0 && errno == EMFILE)
+    error (EXIT_FAILURE, errno, _("_open_osfhandle failed"));
+
+  return fd;
+}
+
+/* Returns a file descriptor equivalent to FD, except that the resulting file
+   descriptor is none of STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO.
+   FD must be open and non-inheritable.  The result will be non-inheritable as
+   well.
+   If FD < 0, FD itself is returned.  */
+static int
+fd_safer_noinherit (int fd)
+{
+  if (STDIN_FILENO <= fd && fd <= STDERR_FILENO)
+    {
+      /* The recursion depth is at most 3.  */
+      int nfd = fd_safer_noinherit (dup_noinherit (fd));
+      int saved_errno = errno;
+      close (fd);
+      errno = saved_errno;
+      return nfd;
+    }
+  return fd;
+}
+
+int
+dup_safer_noinherit (int fd)
+{
+  return fd_safer_noinherit (dup_noinherit (fd));
+}
+
+void
+undup_safer_noinherit (int tempfd, int origfd)
+{
+  if (tempfd >= 0)
+    {
+      if (dup2 (tempfd, origfd) < 0)
+        error (EXIT_FAILURE, errno, _("cannot restore fd %d: dup2 failed"),
+               origfd);
+      close (tempfd);
+    }
+  else
+    {
+      /* origfd was closed or open to no handle at all.  Set it to a closed
+         state.  This is (nearly) equivalent to the original state.  */
+      close (origfd);
+    }
+}
+
+const char **
+prepare_spawn (const char * const *argv, char **mem_to_free)
+{
+  size_t argc;
+  const char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = (const char **) malloc ((1 + argc + 1) * sizeof (const char *));
+  if (new_argv == NULL)
+    return NULL;
+
+  /* Add an element upfront that can be used when argv[0] turns out to be a
+     script, not a program.
+     On Unix, this would be "/bin/sh".  */
+  new_argv[0] = "sh.exe";
+
+  /* Put quoted arguments into the new argument vector.  */
+  size_t needed_size = 0;
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+      const char *quoted_string = (string[0] == '\0' ? "\"\"" : string);
+      size_t length = strlen (quoted_string);
+      needed_size += length + 1;
+    }
+
+  char *mem;
+  if (needed_size == 0)
+    mem = NULL;
+  else
+    {
+      mem = (char *) malloc (needed_size);
+      if (mem == NULL)
+        {
+          /* Memory allocation failure.  */
+          free (new_argv);
+          errno = ENOMEM;
+          return NULL;
+        }
+    }
+  *mem_to_free = mem;
+
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      new_argv[1 + i] = mem;
+      const char *quoted_string = (string[0] == '\0' ? "\"\"" : string);
+      size_t length = strlen (quoted_string);
+      memcpy (mem, quoted_string, length + 1);
+      mem += length + 1;
+    }
+  new_argv[1 + argc] = NULL;
+
+  return new_argv;
+}
diff --git a/lib/os2-spawn.h b/lib/os2-spawn.h
new file mode 100644 (file)
index 0000000..761e260
--- /dev/null
@@ -0,0 +1,33 @@
+/* Auxiliary functions for the creation of subprocesses.  OS/2 kLIBC API.
+   Copyright (C) 2001, 2003-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _OS2_SPAWN_H
+#define _OS2_SPAWN_H
+
+/* Duplicates a file handle, making the copy uninheritable and ensuring the
+   result is none of STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO.
+   Returns -1 for a file handle that is equivalent to closed.  */
+extern int dup_safer_noinherit (int fd);
+
+/* Undoes the effect of TEMPFD = dup_safer_noinherit (ORIGFD);  */
+extern void undup_safer_noinherit (int tempfd, int origfd);
+
+/* Prepares an argument vector before calling spawn().  */
+extern const char ** prepare_spawn (const char * const *argv,
+                                    char **mem_to_free);
+
+#endif /* _OS2_SPAWN_H */
index aee22f8..49cf462 100644 (file)
@@ -1,5 +1,5 @@
 /* Define PATH_MAX somehow.  Requires sys/types.h.
-   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2016 Free Software
+   Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _PATHMAX_H
 # define _PATHMAX_H
 
 /* POSIX:2008 defines PATH_MAX to be the maximum number of bytes in a filename,
    including the terminating NUL byte.
-   <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html>
+   <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html>
    PATH_MAX is not defined on systems which have no limit on filename length,
    such as GNU/Hurd.
 
 #  define PATH_MAX 1024
 # endif
 
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 /* The page "Naming Files, Paths, and Namespaces" on msdn.microsoft.com,
    section "Maximum Path Length Limitation",
-   <http://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx#maxpath>
+   <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file#maximum-path-length-limitation>
    explains that the maximum size of a filename, including the terminating
    NUL byte, is 260 = 3 + 256 + 1.
    This is the same value as
index fc6144e..efa4bd6 100644 (file)
@@ -1,5 +1,5 @@
 /* Invoke pipe, but avoid some glitches.
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering.  */
 
@@ -30,7 +30,6 @@
 int
 pipe_safer (int fd[2])
 {
-#if HAVE_PIPE
   if (pipe (fd) == 0)
     {
       int i;
@@ -39,18 +38,15 @@ pipe_safer (int fd[2])
           fd[i] = fd_safer (fd[i]);
           if (fd[i] < 0)
             {
-              int e = errno;
+              int saved_errno = errno;
               close (fd[1 - i]);
-              errno = e;
+              errno = saved_errno;
               return -1;
             }
         }
 
       return 0;
     }
-#else
-  errno = ENOSYS;
-#endif
 
   return -1;
 }
diff --git a/lib/pipe.c b/lib/pipe.c
new file mode 100644 (file)
index 0000000..584965a
--- /dev/null
@@ -0,0 +1,50 @@
+/* Create a pipe.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <unistd.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Native Windows API.  */
+
+/* Get _pipe().  */
+# include <io.h>
+
+/* Get _O_BINARY.  */
+# include <fcntl.h>
+
+int
+pipe (int fd[2])
+{
+  /* Mingw changes fd to {-1,-1} on failure, but this violates
+     http://austingroupbugs.net/view.php?id=467 */
+  int tmp[2];
+  int result = _pipe (tmp, 4096, _O_BINARY);
+  if (!result)
+    {
+      fd[0] = tmp[0];
+      fd[1] = tmp[1];
+    }
+  return result;
+}
+
+#else
+
+# error "This platform lacks a pipe function, and Gnulib doesn't provide a replacement. This is a bug in Gnulib."
+
+#endif
index 4b7084f..c17f4d5 100644 (file)
@@ -1,5 +1,5 @@
 /* Invoke pipe2, but avoid some glitches.
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
index f8912f2..41493aa 100644 (file)
@@ -1,5 +1,5 @@
 /* Create a pipe, with specific opening flags.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -29,7 +29,7 @@
 # include "nonblocking.h"
 #endif
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Native Windows API.  */
 
 # include <io.h>
@@ -73,7 +73,7 @@ pipe2 (int fd[2], int flags)
       return -1;
     }
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Native Windows API.  */
 
   if (_pipe (fd, 4096, flags & ~O_NONBLOCK) < 0)
@@ -107,7 +107,7 @@ pipe2 (int fd[2], int flags)
   if (pipe (fd) < 0)
     return -1;
 
-  /* POSIX <http://www.opengroup.org/onlinepubs/9699919799/functions/pipe.html>
+  /* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pipe.html>
      says that initially, the O_NONBLOCK and FD_CLOEXEC flags are cleared on
      both fd[0] and fd[1].  */
 
@@ -152,8 +152,7 @@ pipe2 (int fd[2], int flags)
 
 #endif
 
-#if GNULIB_defined_O_NONBLOCK || \
-  !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if GNULIB_defined_O_NONBLOCK || !(defined _WIN32 && ! defined __CYGWIN__)
  fail:
   {
     int saved_errno = errno;
index cfaed99..606adf6 100644 (file)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* This file can be parametrized with the following macros:
      ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
@@ -65,14 +65,12 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
       case TYPE_ULONGINT:
         ap->a.a_ulongint = va_arg (args, unsigned long int);
         break;
-#if HAVE_LONG_LONG_INT
       case TYPE_LONGLONGINT:
         ap->a.a_longlongint = va_arg (args, long long int);
         break;
       case TYPE_ULONGLONGINT:
         ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
         break;
-#endif
       case TYPE_DOUBLE:
         ap->a.a_double = va_arg (args, double);
         break;
@@ -135,11 +133,9 @@ PRINTF_FETCHARGS (va_list args, arguments *a)
       case TYPE_COUNT_LONGINT_POINTER:
         ap->a.a_count_longint_pointer = va_arg (args, long int *);
         break;
-#if HAVE_LONG_LONG_INT
       case TYPE_COUNT_LONGLONGINT_POINTER:
         ap->a.a_count_longlongint_pointer = va_arg (args, long long int *);
         break;
-#endif
 #if ENABLE_UNISTDIO
       /* The unistdio extensions.  */
       case TYPE_U8_STRING:
index 256c413..c0db483 100644 (file)
@@ -1,5 +1,5 @@
 /* Decomposed printf argument list.
-   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _PRINTF_ARGS_H
 #define _PRINTF_ARGS_H
@@ -57,10 +57,8 @@ typedef enum
   TYPE_UINT,
   TYPE_LONGINT,
   TYPE_ULONGINT,
-#if HAVE_LONG_LONG_INT
   TYPE_LONGLONGINT,
   TYPE_ULONGLONGINT,
-#endif
   TYPE_DOUBLE,
   TYPE_LONGDOUBLE,
   TYPE_CHAR,
@@ -75,10 +73,8 @@ typedef enum
   TYPE_COUNT_SCHAR_POINTER,
   TYPE_COUNT_SHORT_POINTER,
   TYPE_COUNT_INT_POINTER,
-  TYPE_COUNT_LONGINT_POINTER
-#if HAVE_LONG_LONG_INT
-, TYPE_COUNT_LONGLONGINT_POINTER
-#endif
+  TYPE_COUNT_LONGINT_POINTER,
+  TYPE_COUNT_LONGLONGINT_POINTER
 #if ENABLE_UNISTDIO
   /* The unistdio extensions.  */
 , TYPE_U8_STRING
@@ -101,10 +97,8 @@ typedef struct
     unsigned int                a_uint;
     long int                    a_longint;
     unsigned long int           a_ulongint;
-#if HAVE_LONG_LONG_INT
     long long int               a_longlongint;
     unsigned long long int      a_ulonglongint;
-#endif
     float                       a_float;
     double                      a_double;
     long double                 a_longdouble;
@@ -121,9 +115,7 @@ typedef struct
     short *                     a_count_short_pointer;
     int *                       a_count_int_pointer;
     long int *                  a_count_longint_pointer;
-#if HAVE_LONG_LONG_INT
     long long int *             a_count_longlongint_pointer;
-#endif
 #if ENABLE_UNISTDIO
     /* The unistdio extensions.  */
     const uint8_t *             a_u8_string;
index 1841b86..11988fd 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a double into fraction and mantissa, for hexadecimal printf.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if ! defined USE_LONG_DOUBLE
 # include <config.h>
index ec75c60..ee6f326 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a double into fraction and mantissa, for hexadecimal printf.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Write a finite, positive number x as
      x = mantissa * 2^exp
index 3d0ce9b..ee34fd3 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a 'long double' into fraction and mantissa, for hexadecimal printf.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 344f37a..1fbce84 100644 (file)
@@ -1,5 +1,5 @@
 /* Split a 'long double' into fraction and mantissa, for hexadecimal printf.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Write a finite, positive number x as
      x = mantissa * 2^exp
index fad5d3d..fe3481b 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999-2000, 2002-2003, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999-2000, 2002-2003, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* This file can be parametrized with the following macros:
      CHAR_T             The element type of the format string.
@@ -419,7 +419,7 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                       cp++;
                     }
 #endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
                   /* On native Windows, PRIdMAX is defined as "I64d".
                      We cannot change it to "lld" because PRIdMAX must also
                      be understood by the system's printf routines.  */
@@ -447,14 +447,12 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
               switch (c)
                 {
                 case 'd': case 'i':
-#if HAVE_LONG_LONG_INT
-                  /* If 'long long' exists and is larger than 'long':  */
+                  /* If 'long long' is larger than 'long':  */
                   if (flags >= 16 || (flags & 4))
                     type = TYPE_LONGLONGINT;
                   else
-#endif
-                  /* If 'long long' exists and is the same as 'long', we parse
-                     "lld" into TYPE_LONGINT.  */
+                  /* If 'long long' is the same as 'long', we parse "lld" into
+                     TYPE_LONGINT.  */
                   if (flags >= 8)
                     type = TYPE_LONGINT;
                   else if (flags & 2)
@@ -465,14 +463,12 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                     type = TYPE_INT;
                   break;
                 case 'o': case 'u': case 'x': case 'X':
-#if HAVE_LONG_LONG_INT
-                  /* If 'long long' exists and is larger than 'long':  */
+                  /* If 'unsigned long long' is larger than 'unsigned long':  */
                   if (flags >= 16 || (flags & 4))
                     type = TYPE_ULONGLONGINT;
                   else
-#endif
-                  /* If 'unsigned long long' exists and is the same as
-                     'unsigned long', we parse "llu" into TYPE_ULONGINT.  */
+                  /* If 'unsigned long long' is the same as 'unsigned long', we
+                     parse "llu" into TYPE_ULONGINT.  */
                   if (flags >= 8)
                     type = TYPE_ULONGINT;
                   else if (flags & 2)
@@ -525,14 +521,12 @@ PRINTF_PARSE (const CHAR_T *format, DIRECTIVES *d, arguments *a)
                   type = TYPE_POINTER;
                   break;
                 case 'n':
-#if HAVE_LONG_LONG_INT
-                  /* If 'long long' exists and is larger than 'long':  */
+                  /* If 'long long' is larger than 'long':  */
                   if (flags >= 16 || (flags & 4))
                     type = TYPE_COUNT_LONGLONGINT_POINTER;
                   else
-#endif
-                  /* If 'long long' exists and is the same as 'long', we parse
-                     "lln" into TYPE_COUNT_LONGINT_POINTER.  */
+                  /* If 'long long' is the same as 'long', we parse "lln" into
+                     TYPE_COUNT_LONGINT_POINTER.  */
                   if (flags >= 8)
                     type = TYPE_COUNT_LONGINT_POINTER;
                   else if (flags & 2)
index a46d946..e7d0f82 100644 (file)
@@ -1,5 +1,5 @@
 /* Parse printf format string.
-   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2016 Free Software
+   Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _PRINTF_PARSE_H
 #define _PRINTF_PARSE_H
index debb760..fd7acae 100644 (file)
@@ -1,5 +1,5 @@
 /* Program name management.
-   Copyright (C) 2001-2003, 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
 #include <config.h>
index 0a57407..bf3513d 100644 (file)
@@ -1,5 +1,5 @@
 /* Program name management.
-   Copyright (C) 2001-2004, 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _PROGNAME_H
 #define _PROGNAME_H
diff --git a/lib/propername.c b/lib/propername.c
new file mode 100644 (file)
index 0000000..561566b
--- /dev/null
@@ -0,0 +1,318 @@
+/* Localization of proper names.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Without this pragma, gcc 4.7.0 20111124 mistakenly suggests that
+   the proper_name function might be candidate for attribute 'const'  */
+#if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wsuggest-attribute=const"
+#endif
+
+#include <config.h>
+
+/* Specification.  */
+#include "propername.h"
+
+#include <ctype.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#if HAVE_ICONV
+# include <iconv.h>
+#endif
+
+#include "trim.h"
+#include "mbchar.h"
+#include "mbuiter.h"
+#include "localcharset.h"
+#include "c-strcase.h"
+#include "xstriconv.h"
+#include "xalloc.h"
+#include "gettext.h"
+
+
+/* Tests whether STRING contains trim (SUB), starting and ending at word
+   boundaries.
+   Here, instead of implementing Unicode Standard Annex #29 for determining
+   word boundaries, we assume that trim (SUB) starts and ends with words and
+   only test whether the part before it ends with a non-word and the part
+   after it starts with a non-word.  */
+static bool
+mbsstr_trimmed_wordbounded (const char *string, const char *sub)
+{
+  char *tsub = trim (sub);
+  bool found = false;
+
+  for (; *string != '\0';)
+    {
+      const char *tsub_in_string = mbsstr (string, tsub);
+      if (tsub_in_string == NULL)
+        break;
+      else
+        {
+          if (MB_CUR_MAX > 1)
+            {
+              mbui_iterator_t string_iter;
+              bool word_boundary_before;
+              bool word_boundary_after;
+
+              mbui_init (string_iter, string);
+              word_boundary_before = true;
+              if (mbui_cur_ptr (string_iter) < tsub_in_string)
+                {
+                  mbchar_t last_char_before_tsub;
+                  do
+                    {
+                      if (!mbui_avail (string_iter))
+                        abort ();
+                      last_char_before_tsub = mbui_cur (string_iter);
+                      mbui_advance (string_iter);
+                    }
+                  while (mbui_cur_ptr (string_iter) < tsub_in_string);
+                  if (mb_isalnum (last_char_before_tsub))
+                    word_boundary_before = false;
+                }
+
+              mbui_init (string_iter, tsub_in_string);
+              {
+                mbui_iterator_t tsub_iter;
+
+                for (mbui_init (tsub_iter, tsub);
+                     mbui_avail (tsub_iter);
+                     mbui_advance (tsub_iter))
+                  {
+                    if (!mbui_avail (string_iter))
+                      abort ();
+                    mbui_advance (string_iter);
+                  }
+              }
+              word_boundary_after = true;
+              if (mbui_avail (string_iter))
+                {
+                  mbchar_t first_char_after_tsub = mbui_cur (string_iter);
+                  if (mb_isalnum (first_char_after_tsub))
+                    word_boundary_after = false;
+                }
+
+              if (word_boundary_before && word_boundary_after)
+                {
+                  found = true;
+                  break;
+                }
+
+              mbui_init (string_iter, tsub_in_string);
+              if (!mbui_avail (string_iter))
+                break;
+              string = tsub_in_string + mb_len (mbui_cur (string_iter));
+            }
+          else
+            {
+              bool word_boundary_before;
+              const char *p;
+              bool word_boundary_after;
+
+              word_boundary_before = true;
+              if (string < tsub_in_string)
+                if (isalnum ((unsigned char) tsub_in_string[-1]))
+                  word_boundary_before = false;
+
+              p = tsub_in_string + strlen (tsub);
+              word_boundary_after = true;
+              if (*p != '\0')
+                if (isalnum ((unsigned char) *p))
+                  word_boundary_after = false;
+
+              if (word_boundary_before && word_boundary_after)
+                {
+                  found = true;
+                  break;
+                }
+
+              if (*tsub_in_string == '\0')
+                break;
+              string = tsub_in_string + 1;
+            }
+        }
+    }
+  free (tsub);
+  return found;
+}
+
+/* Return the localization of NAME.  NAME is written in ASCII.  */
+
+const char *
+proper_name (const char *name)
+{
+  /* See whether there is a translation.   */
+  const char *translation = gettext (name);
+
+  if (translation != name)
+    {
+      /* See whether the translation contains the original name.  */
+      if (mbsstr_trimmed_wordbounded (translation, name))
+        return translation;
+      else
+        {
+          /* Return "TRANSLATION (NAME)".  */
+          char *result =
+            XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);
+
+          sprintf (result, "%s (%s)", translation, name);
+          return result;
+        }
+    }
+  else
+    return name;
+}
+
+/* Return the localization of a name whose original writing is not ASCII.
+   NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal
+   escape sequences.  NAME_ASCII is a fallback written only with ASCII
+   characters.  */
+
+const char *
+proper_name_utf8 (const char *name_ascii, const char *name_utf8)
+{
+  /* See whether there is a translation.   */
+  const char *translation = gettext (name_ascii);
+
+  /* Try to convert NAME_UTF8 to the locale encoding.  */
+  const char *locale_code = locale_charset ();
+  char *alloc_name_converted = NULL;
+  char *alloc_name_converted_translit = NULL;
+  const char *name_converted = NULL;
+  const char *name_converted_translit = NULL;
+  const char *name;
+
+  if (c_strcasecmp (locale_code, "UTF-8") != 0)
+    {
+#if HAVE_ICONV
+      name_converted = alloc_name_converted =
+        xstr_iconv (name_utf8, "UTF-8", locale_code);
+
+# if (((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2) || __GLIBC__ > 2) \
+      && !defined __UCLIBC__) \
+     || _LIBICONV_VERSION >= 0x0105
+      {
+        char *converted_translit;
+
+        size_t len = strlen (locale_code);
+        char *locale_code_translit = XNMALLOC (len + 10 + 1, char);
+        memcpy (locale_code_translit, locale_code, len);
+        memcpy (locale_code_translit + len, "//TRANSLIT", 10 + 1);
+
+        converted_translit =
+          xstr_iconv (name_utf8, "UTF-8", locale_code_translit);
+
+        free (locale_code_translit);
+
+        if (converted_translit != NULL)
+          {
+#  if !_LIBICONV_VERSION
+            /* Don't use the transliteration if it added question marks.
+               glibc's transliteration falls back to question marks; libiconv's
+               transliteration does not.
+               mbschr is equivalent to strchr in this case.  */
+            if (strchr (converted_translit, '?') != NULL)
+              free (converted_translit);
+            else
+#  endif
+              name_converted_translit = alloc_name_converted_translit =
+                converted_translit;
+          }
+      }
+# endif
+#endif
+    }
+  else
+    {
+      name_converted = name_utf8;
+      name_converted_translit = name_utf8;
+    }
+
+  /* The name in locale encoding.  */
+  name = (name_converted != NULL ? name_converted :
+          name_converted_translit != NULL ? name_converted_translit :
+          name_ascii);
+
+  /* See whether we have a translation.  Some translators have not understood
+     that they should use the UTF-8 form of the name, if possible.  So if the
+     translator provided a no-op translation, we ignore it.  */
+  if (strcmp (translation, name_ascii) != 0)
+    {
+      /* See whether the translation contains the original name.  */
+      if (mbsstr_trimmed_wordbounded (translation, name_ascii)
+          || (name_converted != NULL
+              && mbsstr_trimmed_wordbounded (translation, name_converted))
+          || (name_converted_translit != NULL
+              && mbsstr_trimmed_wordbounded (translation, name_converted_translit)))
+        {
+          if (alloc_name_converted != NULL)
+            free (alloc_name_converted);
+          if (alloc_name_converted_translit != NULL)
+            free (alloc_name_converted_translit);
+          return translation;
+        }
+      else
+        {
+          /* Return "TRANSLATION (NAME)".  */
+          char *result =
+            XNMALLOC (strlen (translation) + 2 + strlen (name) + 1 + 1, char);
+
+          sprintf (result, "%s (%s)", translation, name);
+
+          if (alloc_name_converted != NULL)
+            free (alloc_name_converted);
+          if (alloc_name_converted_translit != NULL)
+            free (alloc_name_converted_translit);
+          return result;
+        }
+    }
+  else
+    {
+      if (alloc_name_converted != NULL && alloc_name_converted != name)
+        free (alloc_name_converted);
+      if (alloc_name_converted_translit != NULL
+          && alloc_name_converted_translit != name)
+        free (alloc_name_converted_translit);
+      return name;
+    }
+}
+
+#ifdef TEST1
+# include <locale.h>
+int
+main (int argc, char *argv[])
+{
+  setlocale (LC_ALL, "");
+  if (mbsstr_trimmed_wordbounded (argv[1], argv[2]))
+    printf("found\n");
+  return 0;
+}
+#endif
+
+#ifdef TEST2
+# include <locale.h>
+# include <stdio.h>
+int
+main (int argc, char *argv[])
+{
+  setlocale (LC_ALL, "");
+  printf ("%s\n", proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard"));
+  return 0;
+}
+#endif
diff --git a/lib/propername.h b/lib/propername.h
new file mode 100644 (file)
index 0000000..8037de7
--- /dev/null
@@ -0,0 +1,106 @@
+/* Localization of proper names.  -*- coding: utf-8 -*-
+   Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* INTRODUCTION
+
+   What do
+
+      Torbjörn Granlund    (coreutils)
+      François Pinard      (coreutils)
+      Danilo Šegan         (gettext)
+
+   have in common?
+
+   A non-ASCII name. This causes trouble in the --version output. The simple
+   "solution" unfortunately mutilates the name.
+
+     $ du --version | grep Granlund
+     Écrit par Torbjorn Granlund, David MacKenzie, Paul Eggert et Jim Meyering.
+
+     $ ptx --version | grep Pinard
+     Écrit par F. Pinard.
+
+   What is desirable, is to print the full name if the output character set
+   allows it, and the ASCIIfied name only as a fallback.
+
+     $ recode-sr-latin --version
+     ...
+     Written by Danilo Šegan and Bruno Haible.
+
+     $ LC_ALL=C recode-sr-latin --version
+     ...
+     Written by Danilo Segan and Bruno Haible.
+
+   The 'propername' module does exactly this. Plus, for languages that use
+   a different writing system than the Latin alphabet, it allows a translator
+   to write the name using that different writing system. In that case the
+   output will look like this:
+      <translated name> (<original name in English>)
+
+   To use the 'propername' module requires three simple steps:
+
+     1) Add it to the list of gnulib modules to import,
+
+     2) Change the arguments of version_etc(),
+
+          from "Paul Eggert"
+          to   proper_name ("Paul Eggert")
+
+          from "Torbjorn Granlund"
+          to   proper_name_utf8 ("Torbjorn Granlund", "Torbj\303\266rn Granlund")
+
+          from "F. Pinard"
+          to   proper_name_utf8 ("Franc,ois Pinard", "Fran\303\247ois Pinard")
+
+        (Optionally, here you can also add / * TRANSLATORS: ... * / comments
+        explaining how the name is written or pronounced.)
+
+     3) If you are using GNU gettext version 0.16.1 or older, in po/Makevars,
+        in the definition of the XGETTEXT_OPTIONS variable, add:
+
+           --keyword='proper_name:1,"This is a proper name. See the gettext manual, section Names."'
+           --keyword='proper_name_utf8:1,"This is a proper name. See the gettext manual, section Names."'
+
+        This specifies automatic comments for the translator. (Requires
+        xgettext >= 0.15. The double-quotes inside the quoted string are on
+        purpose: they are part of the --keyword argument syntax.)
+ */
+
+#ifndef _PROPERNAME_H
+#define _PROPERNAME_H
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Return the localization of NAME.  NAME is written in ASCII.  */
+extern const char * proper_name (const char *name) /* NOT attribute const */;
+
+/* Return the localization of a name whose original writing is not ASCII.
+   NAME_UTF8 is the real name, written in UTF-8 with octal or hexadecimal
+   escape sequences.  NAME_ASCII is a fallback written only with ASCII
+   characters.  */
+extern const char * proper_name_utf8 (const char *name_ascii,
+                                      const char *name_utf8);
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _PROPERNAME_H */
index b53d0ea..3204997 100644 (file)
@@ -1,6 +1,6 @@
 /* quote.h - prototypes for quote.c
 
-   Copyright (C) 1998-2001, 2003, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-2001, 2003, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef QUOTE_H_
 # define QUOTE_H_ 1
index 07658b2..5704689 100644 (file)
@@ -1,6 +1,6 @@
 /* quotearg.c - quote arguments for output
 
-   Copyright (C) 1998-2002, 2004-2016 Free Software Foundation, Inc.
+   Copyright (C) 1998-2002, 2004-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert <eggert@twinsun.com> */
 
@@ -29,6 +29,7 @@
 #include "quotearg.h"
 #include "quote.h"
 
+#include "attribute.h"
 #include "minmax.h"
 #include "xalloc.h"
 #include "c-strcaseeq.h"
@@ -310,7 +311,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
     case c_maybe_quoting_style:
       quoting_style = c_quoting_style;
       elide_outer_quotes = true;
-      /* Fall through.  */
+      FALLTHROUGH;
     case c_quoting_style:
       if (!elide_outer_quotes)
         STORE ('"');
@@ -349,7 +350,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
                for your locale.
 
                If you don't know what to put here, please see
-               <http://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+               <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
                and use glyphs suitable for your language.  */
             left_quote = gettext_quote (N_("`"), quoting_style);
             right_quote = gettext_quote (N_("'"), quoting_style);
@@ -365,14 +366,14 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
 
     case shell_escape_quoting_style:
       backslash_escapes = true;
-      /* Fall through.  */
+      FALLTHROUGH;
     case shell_quoting_style:
       elide_outer_quotes = true;
-      /* Fall through.  */
+      FALLTHROUGH;
     case shell_escape_always_quoting_style:
       if (!elide_outer_quotes)
         backslash_escapes = true;
-      /* Fall through.  */
+      FALLTHROUGH;
     case shell_always_quoting_style:
       quoting_style = shell_always_quoting_style;
       if (!elide_outer_quotes)
@@ -505,7 +506,7 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
           if (quoting_style == shell_always_quoting_style
               && elide_outer_quotes)
             goto force_outer_quoting_style;
-          /* Fall through.  */
+          /* fall through */
         c_escape:
           if (backslash_escapes)
             {
@@ -517,14 +518,14 @@ quotearg_buffer_restyled (char *buffer, size_t buffersize,
         case '{': case '}': /* sometimes special if isolated */
           if (! (argsize == SIZE_MAX ? arg[1] == '\0' : argsize == 1))
             break;
-          /* Fall through.  */
+          FALLTHROUGH;
         case '#': case '~':
           if (i != 0)
             break;
-          /* Fall through.  */
+          FALLTHROUGH;
         case ' ':
           c_and_shell_quote_compat = true;
-          /* Fall through.  */
+          FALLTHROUGH;
         case '!': /* special in bash */
         case '"': case '$': case '&':
         case '(': case ')': case '*': case ';':
@@ -863,7 +864,8 @@ quotearg_free (void)
    OPTIONS specifies the quoting options.
    The returned value points to static storage that can be
    reused by the next call to this function with the same value of N.
-   N must be nonnegative.  N is deliberately declared with type "int"
+   N must be nonnegative; it is typically small, and must be
+   less than MIN (INT_MAX, IDX_MAX).  The type of N is signed
    to allow for future extensions (using negative values).  */
 static char *
 quotearg_n_options (int n, char const *arg, size_t argsize,
@@ -873,21 +875,21 @@ quotearg_n_options (int n, char const *arg, size_t argsize,
 
   struct slotvec *sv = slotvec;
 
-  if (n < 0)
+  int nslots_max = MIN (INT_MAX, IDX_MAX);
+  if (! (0 <= n && n < nslots_max))
     abort ();
 
   if (nslots <= n)
     {
       bool preallocated = (sv == &slotvec0);
+      idx_t new_nslots = nslots;
 
-      if (MIN (INT_MAX, MIN (PTRDIFF_MAX, SIZE_MAX) / sizeof *sv) <= n)
-        xalloc_die ();
-
-      slotvec = sv = xrealloc (preallocated ? NULL : sv, (n + 1) * sizeof *sv);
+      slotvec = sv = xpalloc (preallocated ? NULL : sv, &new_nslots,
+                              n - nslots + 1, nslots_max, sizeof *sv);
       if (preallocated)
         *sv = slotvec0;
-      memset (sv + nslots, 0, (n + 1 - nslots) * sizeof *sv);
-      nslots = n + 1;
+      memset (sv + nslots, 0, (new_nslots - nslots) * sizeof *sv);
+      nslots = new_nslots;
     }
 
   {
@@ -1071,3 +1073,10 @@ quote (char const *arg)
 {
   return quote_n (0, arg);
 }
+
+/*
+ * Hey Emacs!
+ * Local Variables:
+ * coding: utf-8
+ * End:
+ */
index bc29052..bfc2642 100644 (file)
@@ -1,6 +1,6 @@
 /* quotearg.h - quote arguments for output
 
-   Copyright (C) 1998-2002, 2004, 2006, 2008-2016 Free Software Foundation,
+   Copyright (C) 1998-2002, 2004, 2006, 2008-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert <eggert@twinsun.com> */
 
@@ -323,7 +323,7 @@ void set_custom_quoting (struct quoting_options *o,
    On output, BUFFER might contain embedded null bytes if ARGSIZE was
    not -1, the style of O does not use backslash escapes, and the
    flags of O do not request elision of null bytes.*/
-size_t quotearg_buffer (char *buffer, size_t buffersize,
+size_t quotearg_buffer (char *restrict buffer, size_t buffersize,
                         char const *arg, size_t argsize,
                         struct quoting_options const *o);
 
index bf24c3e..e1dda1d 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide a non-threads replacement for the POSIX raise function.
 
-   Copyright (C) 2002-2003, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* written by Jim Meyering and Bruno Haible */
 
 
 # include <errno.h>
 
-# include "msvc-inval.h"
-
-# undef raise
-
 # if HAVE_MSVC_INVALID_PARAMETER_HANDLER
-static int
-raise_nothrow (int sig)
-{
-  int result;
-
-  TRY_MSVC_INVAL
-    {
-      result = raise (sig);
-    }
-  CATCH_MSVC_INVAL
-    {
-      result = -1;
-      errno = EINVAL;
-    }
-  DONE_MSVC_INVAL;
+#  include "msvc-inval.h"
+# endif
 
-  return result;
-}
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+/* Forward declaration.  */
+static int raise_nothrow (int sig);
 # else
 #  define raise_nothrow raise
 # endif
@@ -59,12 +43,11 @@ raise_nothrow (int sig)
 
 # include <unistd.h>
 
-# define rpl_raise raise
-
 #endif
 
 int
-rpl_raise (int sig)
+raise (int sig)
+#undef raise
 {
 #if GNULIB_defined_signal_blocking && GNULIB_defined_SIGPIPE
   if (sig == SIGPIPE)
@@ -77,3 +60,24 @@ rpl_raise (int sig)
   return kill (getpid (), sig);
 #endif
 }
+
+#if HAVE_RAISE && HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static int
+raise_nothrow (int sig)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = raise (sig);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = -1;
+      errno = EINVAL;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#endif
index dbe01bd..f4d5030 100644 (file)
@@ -1,5 +1,5 @@
 /* Searching in a string.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 /* Specification.  */
 #include <string.h>
 
+/* A function definition is only needed if HAVE_RAWMEMCHR is not defined.  */
+#if !HAVE_RAWMEMCHR
+
 /* Find the first occurrence of C in S.  */
 void *
 rawmemchr (const void *s, int c_in)
@@ -134,3 +137,5 @@ rawmemchr (const void *s, int c_in)
     char_ptr++;
   return (void *) char_ptr;
 }
+
+#endif
index 6363923..087d5e4 100644 (file)
@@ -1,4 +1,20 @@
 # Suppress a valgrind message about use of uninitialized memory in rawmemchr().
+
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
 # This use is OK because it provides only a speedup.
 {
     rawmemchr-value4
similarity index 89%
rename from tests/readdir.c
rename to lib/readdir.c
index 76b7e9d..723198e 100644 (file)
@@ -1,5 +1,5 @@
 /* Read the next entry of a directory.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 
 #include "dirent-private.h"
 
+/* Don't assume that UNICODE is not defined.  */
+#undef FindNextFile
+#define FindNextFile FindNextFileA
+
 struct dirent *
 readdir (DIR *dirp)
 {
@@ -32,7 +36,7 @@ readdir (DIR *dirp)
 
   /* There is no need to add code to produce entries for "." and "..".
      According to the POSIX:2008 section "4.12 Pathname Resolution"
-     <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html>
+     <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html>
      "." and ".." are syntactic entities.
      POSIX also says:
        "If entries for dot or dot-dot exist, one entry shall be returned
index e6c3925..c4b635c 100644 (file)
@@ -1,5 +1,5 @@
-/* Stub for readlink().
-   Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc.
+/* Read the contents of a symbolic link.
+   Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -29,7 +29,7 @@
    such as DJGPP 2.03 and mingw32.  */
 
 ssize_t
-readlink (const char *name, char *buf _GL_UNUSED,
+readlink (char const *file, char *buf _GL_UNUSED,
           size_t bufsize _GL_UNUSED)
 {
   struct stat statbuf;
@@ -37,7 +37,7 @@ readlink (const char *name, char *buf _GL_UNUSED,
   /* In general we should use lstat() here, not stat().  But on platforms
      without symbolic links, lstat() - if it exists - would be equivalent to
      stat(), therefore we can use stat().  This saves us a configure check.  */
-  if (stat (name, &statbuf) >= 0)
+  if (stat (file, &statbuf) >= 0)
     errno = EINVAL;
   return -1;
 }
@@ -51,24 +51,54 @@ readlink (const char *name, char *buf _GL_UNUSED,
    for Solaris 9.  */
 
 ssize_t
-rpl_readlink (const char *name, char *buf, size_t bufsize)
+rpl_readlink (char const *file, char *buf, size_t bufsize)
 {
 # if READLINK_TRAILING_SLASH_BUG
-  size_t len = strlen (name);
-  if (len && name[len - 1] == '/')
+  size_t file_len = strlen (file);
+  if (file_len && file[file_len - 1] == '/')
     {
-      /* Even if name without the slash is a symlink to a directory,
+      /* Even if FILE without the slash is a symlink to a directory,
          both lstat() and stat() must resolve the trailing slash to
          the directory rather than the symlink.  We can therefore
          safely use stat() to distinguish between EINVAL and
          ENOTDIR/ENOENT, avoiding extra overhead of rpl_lstat().  */
       struct stat st;
-      if (stat (name, &st) == 0)
+      if (stat (file, &st) == 0 || errno == EOVERFLOW)
         errno = EINVAL;
       return -1;
     }
 # endif /* READLINK_TRAILING_SLASH_BUG */
-  return readlink (name, buf, bufsize);
+
+  ssize_t r = readlink (file, buf, bufsize);
+
+# if READLINK_TRUNCATE_BUG
+  if (r < 0 && errno == ERANGE)
+    {
+      /* Try again with a bigger buffer.  This is just for test cases;
+         real code invariably discards short reads.  */
+      char stackbuf[4032];
+      r = readlink (file, stackbuf, sizeof stackbuf);
+      if (r < 0)
+        {
+          if (errno == ERANGE)
+            {
+              /* Clear the buffer, which is good enough for real code.
+                 Thankfully, no test cases try short reads of enormous
+                 symlinks and what would be the point anyway?  */
+              r = bufsize;
+              memset (buf, 0, r);
+            }
+        }
+      else
+        {
+          if (bufsize < r)
+            r = bufsize;
+          memcpy (buf, stackbuf, r);
+        }
+    }
+# endif
+
+  return r;
 }
 
 #endif /* HAVE_READLINK */
diff --git a/lib/realloc.c b/lib/realloc.c
new file mode 100644 (file)
index 0000000..0c87d0d
--- /dev/null
@@ -0,0 +1,63 @@
+/* realloc() function that is glibc compatible.
+
+   Copyright (C) 1997, 2003-2004, 2006-2007, 2009-2021 Free Software
+   Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering and Bruno Haible */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+
+#include "xalloc-oversized.h"
+
+/* Call the system's realloc below.  This file does not define
+   _GL_USE_STDLIB_ALLOC because it needs Gnulib's malloc if present.  */
+#undef realloc
+
+/* Change the size of an allocated block of memory P to N bytes,
+   with error checking.  If P is NULL, use malloc.  Otherwise if N is zero,
+   free P and return NULL.  */
+
+void *
+rpl_realloc (void *p, size_t n)
+{
+  if (p == NULL)
+    return malloc (n);
+
+  if (n == 0)
+    {
+      free (p);
+      return NULL;
+    }
+
+  if (xalloc_oversized (n, 1))
+    {
+      errno = ENOMEM;
+      return NULL;
+    }
+
+  void *result = realloc (p, n);
+
+#if !HAVE_MALLOC_POSIX
+  if (result == NULL)
+    errno = ENOMEM;
+#endif
+
+  return result;
+}
diff --git a/lib/reallocarray.c b/lib/reallocarray.c
new file mode 100644 (file)
index 0000000..d5cfa05
--- /dev/null
@@ -0,0 +1,39 @@
+/* reallocarray function that is glibc compatible.
+
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Darshit Shah */
+
+#include <config.h>
+
+#include <stdlib.h>
+#include <errno.h>
+
+#include "intprops.h"
+
+void *
+reallocarray (void *ptr, size_t nmemb, size_t size)
+{
+  size_t nbytes;
+  if (INT_MULTIPLY_WRAPV (nmemb, size, &nbytes))
+    {
+      errno = ENOMEM;
+      return NULL;
+    }
+
+  /* Rely on the semantics of GNU realloc.  */
+  return realloc (ptr, nbytes);
+}
diff --git a/lib/ref-add.sin b/lib/ref-add.sin
deleted file mode 100644 (file)
index 42d3ab0..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-# Add this package to a list of references stored in a text file.
-#
-#   Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
-#
-#   This program is free software; you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 3, or (at your option)
-#   any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#   GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License along
-#   with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# Written by Bruno Haible <haible@clisp.cons.org>.
-#
-/^# Packages using this file: / {
-  s/# Packages using this file://
-  ta
-  :a
-  s/ @PACKAGE@ / @PACKAGE@ /
-  tb
-  s/ $/ @PACKAGE@ /
-  :b
-  s/^/# Packages using this file:/
-}
diff --git a/lib/ref-del.sin b/lib/ref-del.sin
deleted file mode 100644 (file)
index c77b33b..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-# Remove this package from a list of references stored in a text file.
-#
-#   Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
-#
-#   This program is free software; you can redistribute it and/or modify
-#   it under the terms of the GNU General Public License as published by
-#   the Free Software Foundation; either version 3, or (at your option)
-#   any later version.
-#
-#   This program is distributed in the hope that it will be useful,
-#   but WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#   GNU General Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License along
-#   with this program; if not, see <http://www.gnu.org/licenses/>.
-#
-# Written by Bruno Haible <haible@clisp.cons.org>.
-#
-/^# Packages using this file: / {
-  s/# Packages using this file://
-  s/ @PACKAGE@ / /
-  s/^/# Packages using this file:/
-}
index aaa66b9..de0e97a 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
@@ -15,7 +15,7 @@
 
    You should have received a copy of the GNU General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #ifdef _LIBC
 # include <locale/weight.h>
@@ -59,7 +59,7 @@ static reg_errcode_t calc_inveclosure (re_dfa_t *dfa);
 static Idx fetch_number (re_string_t *input, re_token_t *token,
                         reg_syntax_t syntax);
 static int peek_token (re_token_t *token, re_string_t *input,
-                       reg_syntax_t syntax) internal_function;
+                       reg_syntax_t syntax);
 static bin_tree_t *parse (re_string_t *regexp, regex_t *preg,
                          reg_syntax_t syntax, reg_errcode_t *err);
 static bin_tree_t *parse_reg_exp (re_string_t *regexp, regex_t *preg,
@@ -233,9 +233,7 @@ re_compile_pattern (const char *pattern, size_t length,
     return NULL;
   return gettext (__re_error_msgid + __re_error_msgid_idx[(int) ret]);
 }
-#ifdef _LIBC
 weak_alias (__re_compile_pattern, re_compile_pattern)
-#endif
 
 /* Set by 're_set_syntax' to the current regexp syntax to recognize.  Can
    also be assigned to arbitrarily: each pattern buffer stores its own
@@ -260,9 +258,7 @@ re_set_syntax (reg_syntax_t syntax)
   re_syntax_options = syntax;
   return ret;
 }
-#ifdef _LIBC
 weak_alias (__re_set_syntax, re_set_syntax)
-#endif
 
 int
 re_compile_fastmap (struct re_pattern_buffer *bufp)
@@ -281,9 +277,7 @@ re_compile_fastmap (struct re_pattern_buffer *bufp)
   bufp->fastmap_accurate = 1;
   return 0;
 }
-#ifdef _LIBC
 weak_alias (__re_compile_fastmap, re_compile_fastmap)
-#endif
 
 static inline void
 __attribute__ ((always_inline))
@@ -464,7 +458,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
    the return codes and their meanings.)  */
 
 int
-regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags)
+regcomp (regex_t *__restrict preg, const char *__restrict pattern, int cflags)
 {
   reg_errcode_t ret;
   reg_syntax_t syntax = ((cflags & REG_EXTENDED) ? RE_SYNTAX_POSIX_EXTENDED
@@ -476,7 +470,7 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags)
 
   /* Try to allocate space for the fastmap.  */
   preg->fastmap = re_malloc (char, SBC_MAX);
-  if (BE (preg->fastmap == NULL, 0))
+  if (__glibc_unlikely (preg->fastmap == NULL))
     return REG_ESPACE;
 
   syntax |= (cflags & REG_ICASE) ? RE_ICASE : 0;
@@ -502,7 +496,7 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags)
     ret = REG_EPAREN;
 
   /* We have already checked preg->fastmap != NULL.  */
-  if (BE (ret == REG_NOERROR, 1))
+  if (__glibc_likely (ret == REG_NOERROR))
     /* Compute the fastmap now, since regexec cannot modify the pattern
        buffer.  This function never fails in this implementation.  */
     (void) re_compile_fastmap (preg);
@@ -515,23 +509,21 @@ regcomp (regex_t *_Restrict_ preg, const char *_Restrict_ pattern, int cflags)
 
   return (int) ret;
 }
-#ifdef _LIBC
+libc_hidden_def (__regcomp)
 weak_alias (__regcomp, regcomp)
-#endif
 
 /* Returns a message corresponding to an error code, ERRCODE, returned
    from either regcomp or regexec.   We don't use PREG here.  */
 
 size_t
-regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf,
+regerror (int errcode, const regex_t *__restrict preg, char *__restrict errbuf,
          size_t errbuf_size)
 {
   const char *msg;
   size_t msg_size;
+  int nerrcodes = sizeof __re_error_msgid_idx / sizeof __re_error_msgid_idx[0];
 
-  if (BE (errcode < 0
-         || errcode >= (int) (sizeof (__re_error_msgid_idx)
-                              / sizeof (__re_error_msgid_idx[0])), 0))
+  if (__glibc_unlikely (errcode < 0 || errcode >= nerrcodes))
     /* Only error codes returned by the rest of the code should be passed
        to this routine.  If we are given anything else, or if other regex
        code generates an invalid error code, then the program has a bug.
@@ -542,10 +534,10 @@ regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf,
 
   msg_size = strlen (msg) + 1; /* Includes the null.  */
 
-  if (BE (errbuf_size != 0, 1))
+  if (__glibc_likely (errbuf_size != 0))
     {
       size_t cpy_size = msg_size;
-      if (BE (msg_size > errbuf_size, 0))
+      if (__glibc_unlikely (msg_size > errbuf_size))
        {
          cpy_size = errbuf_size - 1;
          errbuf[cpy_size] = '\0';
@@ -555,9 +547,7 @@ regerror (int errcode, const regex_t *_Restrict_ preg, char *_Restrict_ errbuf,
 
   return msg_size;
 }
-#ifdef _LIBC
 weak_alias (__regerror, regerror)
-#endif
 
 
 #ifdef RE_ENABLE_I18N
@@ -568,7 +558,7 @@ weak_alias (__regerror, regerror)
 static const bitset_t utf8_sb_map =
 {
   /* Set the first 128 bits.  */
-# if defined __GNUC__ && !defined __STRICT_ANSI__
+# if (defined __GNUC__ || __clang_major__ >= 4) && !defined __STRICT_ANSI__
   [0 ... 0x80 / BITSET_WORD_BITS - 1] = BITSET_WORD_MAX
 # else
 #  if 4 * BITSET_WORD_BITS < ASCII_CHARS
@@ -643,7 +633,7 @@ void
 regfree (regex_t *preg)
 {
   re_dfa_t *dfa = preg->buffer;
-  if (BE (dfa != NULL, 1))
+  if (__glibc_likely (dfa != NULL))
     {
       lock_fini (dfa->lock);
       free_dfa_content (dfa);
@@ -657,9 +647,8 @@ regfree (regex_t *preg)
   re_free (preg->translate);
   preg->translate = NULL;
 }
-#ifdef _LIBC
+libc_hidden_def (__regfree)
 weak_alias (__regfree, regfree)
-#endif
 \f
 /* Entry points compatible with 4.2 BSD regex library.  We don't define
    them unless specifically requested.  */
@@ -699,7 +688,7 @@ re_comp (const char *s)
 
   if (re_comp_buf.fastmap == NULL)
     {
-      re_comp_buf.fastmap = (char *) malloc (SBC_MAX);
+      re_comp_buf.fastmap = re_malloc (char, SBC_MAX);
       if (re_comp_buf.fastmap == NULL)
        return (char *) gettext (__re_error_msgid
                                 + __re_error_msgid_idx[(int) REG_ESPACE]);
@@ -752,7 +741,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length,
 
   /* Initialize the dfa.  */
   dfa = preg->buffer;
-  if (BE (preg->allocated < sizeof (re_dfa_t), 0))
+  if (__glibc_unlikely (preg->allocated < sizeof (re_dfa_t)))
     {
       /* If zero allocated, but buffer is non-null, try to realloc
         enough space.  This loses if buffer's address is bogus, but
@@ -767,9 +756,9 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length,
   preg->used = sizeof (re_dfa_t);
 
   err = init_dfa (dfa, length);
-  if (BE (err == REG_NOERROR && lock_init (dfa->lock) != 0, 0))
+  if (__glibc_unlikely (err == REG_NOERROR && lock_init (dfa->lock) != 0))
     err = REG_ESPACE;
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     {
       free_dfa_content (dfa);
       preg->buffer = NULL;
@@ -784,7 +773,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length,
 
   err = re_string_construct (&regexp, pattern, length, preg->translate,
                             (syntax & RE_ICASE) != 0, dfa);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     {
     re_compile_internal_free_return:
       free_workarea_compile (preg);
@@ -799,12 +788,12 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length,
   /* Parse the regular expression, and build a structure tree.  */
   preg->re_nsub = 0;
   dfa->str_tree = parse (&regexp, preg, syntax, &err);
-  if (BE (dfa->str_tree == NULL, 0))
+  if (__glibc_unlikely (dfa->str_tree == NULL))
     goto re_compile_internal_free_return;
 
   /* Analyze the tree and create the nfa.  */
   err = analyze (preg);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     goto re_compile_internal_free_return;
 
 #ifdef RE_ENABLE_I18N
@@ -820,7 +809,7 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length,
   free_workarea_compile (preg);
   re_string_destruct (&regexp);
 
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     {
       lock_fini (dfa->lock);
       free_dfa_content (dfa);
@@ -862,7 +851,8 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
      calculation below, and for similar doubling calculations
      elsewhere.  And it's <= rather than <, because some of the
      doubling calculations add 1 afterwards.  */
-  if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) / 2 <= pat_len, 0))
+  if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size) / 2
+                       <= pat_len))
     return REG_ESPACE;
 
   dfa->nodes_alloc = pat_len + 1;
@@ -906,7 +896,7 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
          int i, j, ch;
 
          dfa->sb_char = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
-         if (BE (dfa->sb_char == NULL, 0))
+         if (__glibc_unlikely (dfa->sb_char == NULL))
            return REG_ESPACE;
 
          /* Set the bits corresponding to single byte chars.  */
@@ -925,7 +915,7 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
     }
 #endif
 
-  if (BE (dfa->nodes == NULL || dfa->state_table == NULL, 0))
+  if (__glibc_unlikely (dfa->nodes == NULL || dfa->state_table == NULL))
     return REG_ESPACE;
   return REG_NOERROR;
 }
@@ -935,21 +925,23 @@ init_dfa (re_dfa_t *dfa, size_t pat_len)
    character used by some operators like "\<", "\>", etc.  */
 
 static void
-internal_function
 init_word_char (re_dfa_t *dfa)
 {
   int i = 0;
   int j;
   int ch = 0;
   dfa->word_ops_used = 1;
-  if (BE (dfa->map_notascii == 0, 1))
+  if (__glibc_likely (dfa->map_notascii == 0))
     {
+      /* Avoid uint32_t and uint64_t as some non-GCC platforms lack
+        them, an issue when this code is used in Gnulib.  */
       bitset_word_t bits0 = 0x00000000;
       bitset_word_t bits1 = 0x03ff0000;
       bitset_word_t bits2 = 0x87fffffe;
       bitset_word_t bits3 = 0x07fffffe;
       if (BITSET_WORD_BITS == 64)
        {
+         /* Pacify gcc -Woverflow on 32-bit platformns.  */
          dfa->word_char[0] = bits1 << 31 << 1 | bits0;
          dfa->word_char[1] = bits3 << 31 << 1 | bits2;
          i = 2;
@@ -966,7 +958,7 @@ init_word_char (re_dfa_t *dfa)
         goto general_case;
       ch = 128;
 
-      if (BE (dfa->is_utf8, 1))
+      if (__glibc_likely (dfa->is_utf8))
        {
          memset (&dfa->word_char[i], '\0', (SBC_MAX - ch) / 8);
          return;
@@ -1013,7 +1005,7 @@ create_initial_state (re_dfa_t *dfa)
   first = dfa->str_tree->first->node_idx;
   dfa->init_node = first;
   err = re_node_set_init_copy (&init_nodes, dfa->eclosures + first);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     return err;
 
   /* The back-references which are in initial states can epsilon transit,
@@ -1057,7 +1049,7 @@ create_initial_state (re_dfa_t *dfa)
   /* It must be the first time to invoke acquire_state.  */
   dfa->init_state = re_acquire_state_context (&err, dfa, &init_nodes, 0);
   /* We don't check ERR here, since the initial state must not be NULL.  */
-  if (BE (dfa->init_state == NULL, 0))
+  if (__glibc_unlikely (dfa->init_state == NULL))
     return err;
   if (dfa->init_state->has_constraint)
     {
@@ -1069,8 +1061,9 @@ create_initial_state (re_dfa_t *dfa)
                                                         &init_nodes,
                                                         CONTEXT_NEWLINE
                                                         | CONTEXT_BEGBUF);
-      if (BE (dfa->init_state_word == NULL || dfa->init_state_nl == NULL
-             || dfa->init_state_begbuf == NULL, 0))
+      if (__glibc_unlikely (dfa->init_state_word == NULL
+                           || dfa->init_state_nl == NULL
+                           || dfa->init_state_begbuf == NULL))
        return err;
     }
   else
@@ -1177,8 +1170,8 @@ analyze (regex_t *preg)
   dfa->org_indices = re_malloc (Idx, dfa->nodes_alloc);
   dfa->edests = re_malloc (re_node_set, dfa->nodes_alloc);
   dfa->eclosures = re_malloc (re_node_set, dfa->nodes_alloc);
-  if (BE (dfa->nexts == NULL || dfa->org_indices == NULL || dfa->edests == NULL
-         || dfa->eclosures == NULL, 0))
+  if (__glibc_unlikely (dfa->nexts == NULL || dfa->org_indices == NULL
+                       || dfa->edests == NULL || dfa->eclosures == NULL))
     return REG_ESPACE;
 
   dfa->subexp_map = re_malloc (Idx, preg->re_nsub);
@@ -1193,23 +1186,23 @@ analyze (regex_t *preg)
          break;
       if (i == preg->re_nsub)
        {
-         free (dfa->subexp_map);
+         re_free (dfa->subexp_map);
          dfa->subexp_map = NULL;
        }
     }
 
   ret = postorder (dfa->str_tree, lower_subexps, preg);
-  if (BE (ret != REG_NOERROR, 0))
+  if (__glibc_unlikely (ret != REG_NOERROR))
     return ret;
   ret = postorder (dfa->str_tree, calc_first, dfa);
-  if (BE (ret != REG_NOERROR, 0))
+  if (__glibc_unlikely (ret != REG_NOERROR))
     return ret;
   preorder (dfa->str_tree, calc_next, dfa);
   ret = preorder (dfa->str_tree, link_nfa_nodes, dfa);
-  if (BE (ret != REG_NOERROR, 0))
+  if (__glibc_unlikely (ret != REG_NOERROR))
     return ret;
   ret = calc_eclosure (dfa);
-  if (BE (ret != REG_NOERROR, 0))
+  if (__glibc_unlikely (ret != REG_NOERROR))
     return ret;
 
   /* We only need this during the prune_impossible_nodes pass in regexec.c;
@@ -1218,7 +1211,7 @@ analyze (regex_t *preg)
       || dfa->nbackref)
     {
       dfa->inveclosures = re_malloc (re_node_set, dfa->nodes_len);
-      if (BE (dfa->inveclosures == NULL, 0))
+      if (__glibc_unlikely (dfa->inveclosures == NULL))
        return REG_ESPACE;
       ret = calc_inveclosure (dfa);
     }
@@ -1248,7 +1241,7 @@ postorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
       do
        {
          reg_errcode_t err = fn (extra, node);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return err;
          if (node->parent == NULL)
            return REG_NOERROR;
@@ -1270,7 +1263,7 @@ preorder (bin_tree_t *root, reg_errcode_t (fn (void *, bin_tree_t *)),
   for (node = root; ; )
     {
       reg_errcode_t err = fn (extra, node);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        return err;
 
       /* Go to the left node, or up and to the right.  */
@@ -1371,7 +1364,8 @@ lower_subexp (reg_errcode_t *err, regex_t *preg, bin_tree_t *node)
   cls = create_tree (dfa, NULL, NULL, OP_CLOSE_SUBEXP);
   tree1 = body ? create_tree (dfa, body, cls, CONCAT) : cls;
   tree = create_tree (dfa, op, tree1, CONCAT);
-  if (BE (tree == NULL || tree1 == NULL || op == NULL || cls == NULL, 0))
+  if (__glibc_unlikely (tree == NULL || tree1 == NULL
+                       || op == NULL || cls == NULL))
     {
       *err = REG_ESPACE;
       return NULL;
@@ -1397,7 +1391,7 @@ calc_first (void *extra, bin_tree_t *node)
     {
       node->first = node;
       node->node_idx = re_dfa_add_node (dfa, node->token);
-      if (BE (node->node_idx == -1, 0))
+      if (__glibc_unlikely (node->node_idx == -1))
        return REG_ESPACE;
       if (node->token.type == ANCHOR)
        dfa->nodes[node->node_idx].constraint = node->token.opr.ctx_type;
@@ -1442,7 +1436,7 @@ link_nfa_nodes (void *extra, bin_tree_t *node)
       break;
 
     case END_OF_RE:
-      assert (node->next == NULL);
+      DEBUG_ASSERT (node->next == NULL);
       break;
 
     case OP_DUP_ASTERISK:
@@ -1458,8 +1452,8 @@ link_nfa_nodes (void *extra, bin_tree_t *node)
          right = node->right->first->node_idx;
        else
          right = node->next->node_idx;
-       assert (left > -1);
-       assert (right > -1);
+       DEBUG_ASSERT (left > -1);
+       DEBUG_ASSERT (right > -1);
        err = re_node_set_init_2 (dfa->edests + idx, left, right);
       }
       break;
@@ -1477,7 +1471,7 @@ link_nfa_nodes (void *extra, bin_tree_t *node)
       break;
 
     default:
-      assert (!IS_EPSILON_NODE (node->token.type));
+      DEBUG_ASSERT (!IS_EPSILON_NODE (node->token.type));
       dfa->nexts[idx] = node->next->node_idx;
       break;
     }
@@ -1490,7 +1484,6 @@ link_nfa_nodes (void *extra, bin_tree_t *node)
    to their own constraint.  */
 
 static reg_errcode_t
-internal_function
 duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
                        Idx root_node, unsigned int init_constraint)
 {
@@ -1509,11 +1502,11 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
          org_dest = dfa->nexts[org_node];
          re_node_set_empty (dfa->edests + clone_node);
          clone_dest = duplicate_node (dfa, org_dest, constraint);
-         if (BE (clone_dest == -1, 0))
+         if (__glibc_unlikely (clone_dest == -1))
            return REG_ESPACE;
          dfa->nexts[clone_node] = dfa->nexts[org_node];
          ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
-         if (BE (! ok, 0))
+         if (__glibc_unlikely (! ok))
            return REG_ESPACE;
        }
       else if (dfa->edests[org_node].nelem == 0)
@@ -1535,17 +1528,17 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
          if (org_node == root_node && clone_node != org_node)
            {
              ok = re_node_set_insert (dfa->edests + clone_node, org_dest);
-             if (BE (! ok, 0))
+             if (__glibc_unlikely (! ok))
                return REG_ESPACE;
              break;
            }
          /* In case the node has another constraint, append it.  */
          constraint |= dfa->nodes[org_node].constraint;
          clone_dest = duplicate_node (dfa, org_dest, constraint);
-         if (BE (clone_dest == -1, 0))
+         if (__glibc_unlikely (clone_dest == -1))
            return REG_ESPACE;
          ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
-         if (BE (! ok, 0))
+         if (__glibc_unlikely (! ok))
            return REG_ESPACE;
        }
       else /* dfa->edests[org_node].nelem == 2 */
@@ -1561,14 +1554,14 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
              /* There is no such duplicated node, create a new one.  */
              reg_errcode_t err;
              clone_dest = duplicate_node (dfa, org_dest, constraint);
-             if (BE (clone_dest == -1, 0))
+             if (__glibc_unlikely (clone_dest == -1))
                return REG_ESPACE;
              ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
-             if (BE (! ok, 0))
+             if (__glibc_unlikely (! ok))
                return REG_ESPACE;
              err = duplicate_node_closure (dfa, org_dest, clone_dest,
                                            root_node, constraint);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                return err;
            }
          else
@@ -1576,16 +1569,16 @@ duplicate_node_closure (re_dfa_t *dfa, Idx top_org_node, Idx top_clone_node,
              /* There is a duplicated node which satisfies the constraint,
                 use it to avoid infinite loop.  */
              ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
-             if (BE (! ok, 0))
+             if (__glibc_unlikely (! ok))
                return REG_ESPACE;
            }
 
          org_dest = dfa->edests[org_node].elems[1];
          clone_dest = duplicate_node (dfa, org_dest, constraint);
-         if (BE (clone_dest == -1, 0))
+         if (__glibc_unlikely (clone_dest == -1))
            return REG_ESPACE;
          ok = re_node_set_insert (dfa->edests + clone_node, clone_dest);
-         if (BE (! ok, 0))
+         if (__glibc_unlikely (! ok))
            return REG_ESPACE;
        }
       org_node = org_dest;
@@ -1619,7 +1612,7 @@ static Idx
 duplicate_node (re_dfa_t *dfa, Idx org_idx, unsigned int constraint)
 {
   Idx dup_idx = re_dfa_add_node (dfa, dfa->nodes[org_idx]);
-  if (BE (dup_idx != -1, 1))
+  if (__glibc_likely (dup_idx != -1))
     {
       dfa->nodes[dup_idx].constraint = constraint;
       dfa->nodes[dup_idx].constraint |= dfa->nodes[org_idx].constraint;
@@ -1645,7 +1638,7 @@ calc_inveclosure (re_dfa_t *dfa)
       for (idx = 0; idx < dfa->eclosures[src].nelem; ++idx)
        {
          ok = re_node_set_insert_last (dfa->inveclosures + elems[idx], src);
-         if (BE (! ok, 0))
+         if (__glibc_unlikely (! ok))
            return REG_ESPACE;
        }
     }
@@ -1660,9 +1653,7 @@ calc_eclosure (re_dfa_t *dfa)
 {
   Idx node_idx;
   bool incomplete;
-#ifdef DEBUG
-  assert (dfa->nodes_len > 0);
-#endif
+  DEBUG_ASSERT (dfa->nodes_len > 0);
   incomplete = false;
   /* For each nodes, calculate epsilon closure.  */
   for (node_idx = 0; ; ++node_idx)
@@ -1677,16 +1668,14 @@ calc_eclosure (re_dfa_t *dfa)
          node_idx = 0;
        }
 
-#ifdef DEBUG
-      assert (dfa->eclosures[node_idx].nelem != -1);
-#endif
+      DEBUG_ASSERT (dfa->eclosures[node_idx].nelem != -1);
 
       /* If we have already calculated, skip it.  */
       if (dfa->eclosures[node_idx].nelem != 0)
        continue;
       /* Calculate epsilon closure of 'node_idx'.  */
       err = calc_eclosure_iter (&eclosure_elem, dfa, node_idx, true);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        return err;
 
       if (dfa->eclosures[node_idx].nelem == 0)
@@ -1706,12 +1695,14 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
   reg_errcode_t err;
   Idx i;
   re_node_set eclosure;
-  bool ok;
   bool incomplete = false;
   err = re_node_set_alloc (&eclosure, dfa->edests[node].nelem + 1);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     return err;
 
+  /* An epsilon closure includes itself.  */
+  eclosure.elems[eclosure.nelem++] = node;
+
   /* This indicates that we are calculating this node now.
      We reference this value to avoid infinite loop.  */
   dfa->eclosures[node].nelem = -1;
@@ -1724,7 +1715,7 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
     {
       err = duplicate_node_closure (dfa, node, node, node,
                                    dfa->nodes[node].constraint);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        return err;
     }
 
@@ -1746,14 +1737,14 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
        if (dfa->eclosures[edest].nelem == 0)
          {
            err = calc_eclosure_iter (&eclosure_elem, dfa, edest, false);
-           if (BE (err != REG_NOERROR, 0))
+           if (__glibc_unlikely (err != REG_NOERROR))
              return err;
          }
        else
          eclosure_elem = dfa->eclosures[edest];
        /* Merge the epsilon closure of 'edest'.  */
        err = re_node_set_merge (&eclosure, &eclosure_elem);
-       if (BE (err != REG_NOERROR, 0))
+       if (__glibc_unlikely (err != REG_NOERROR))
          return err;
        /* If the epsilon closure of 'edest' is incomplete,
           the epsilon closure of this node is also incomplete.  */
@@ -1764,10 +1755,6 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
          }
       }
 
-  /* An epsilon closure includes itself.  */
-  ok = re_node_set_insert (&eclosure, node);
-  if (BE (! ok, 0))
-    return REG_ESPACE;
   if (incomplete && !root)
     dfa->eclosures[node].nelem = 0;
   else
@@ -1782,7 +1769,6 @@ calc_eclosure_iter (re_node_set *new_set, re_dfa_t *dfa, Idx node, bool root)
    We must not use this function inside bracket expressions.  */
 
 static void
-internal_function
 fetch_token (re_token_t *result, re_string_t *input, reg_syntax_t syntax)
 {
   re_string_skip_bytes (input, peek_token (result, input, syntax));
@@ -1792,7 +1778,6 @@ fetch_token (re_token_t *result, re_string_t *input, reg_syntax_t syntax)
    We must not use this function inside bracket expressions.  */
 
 static int
-internal_function
 peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
 {
   unsigned char c;
@@ -1809,8 +1794,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
   token->word_char = 0;
 #ifdef RE_ENABLE_I18N
   token->mb_partial = 0;
-  if (input->mb_cur_max > 1 &&
-      !re_string_first_byte (input, re_string_cur_idx (input)))
+  if (input->mb_cur_max > 1
+      && !re_string_first_byte (input, re_string_cur_idx (input)))
     {
       token->type = CHARACTER;
       token->mb_partial = 1;
@@ -1997,8 +1982,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
       token->type = OP_PERIOD;
       break;
     case '^':
-      if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE)) &&
-         re_string_cur_idx (input) != 0)
+      if (!(syntax & (RE_CONTEXT_INDEP_ANCHORS | RE_CARET_ANCHORS_HERE))
+         && re_string_cur_idx (input) != 0)
        {
          char prev = re_string_peek_byte (input, -1);
          if (!(syntax & RE_NEWLINE_ALT) || prev != '\n')
@@ -2008,8 +1993,8 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
       token->opr.ctx_type = LINE_FIRST;
       break;
     case '$':
-      if (!(syntax & RE_CONTEXT_INDEP_ANCHORS) &&
-         re_string_cur_idx (input) + 1 != re_string_length (input))
+      if (!(syntax & RE_CONTEXT_INDEP_ANCHORS)
+         && re_string_cur_idx (input) + 1 != re_string_length (input))
        {
          re_token_t next;
          re_string_skip_bytes (input, 1);
@@ -2031,7 +2016,6 @@ peek_token (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
    We must not use this function out of bracket expressions.  */
 
 static int
-internal_function
 peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
 {
   unsigned char c;
@@ -2044,8 +2028,8 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
   token->opr.c = c;
 
 #ifdef RE_ENABLE_I18N
-  if (input->mb_cur_max > 1 &&
-      !re_string_first_byte (input, re_string_cur_idx (input)))
+  if (input->mb_cur_max > 1
+      && !re_string_first_byte (input, re_string_cur_idx (input)))
     {
       token->type = CHARACTER;
       return 1;
@@ -2078,16 +2062,18 @@ peek_token_bracket (re_token_t *token, re_string_t *input, reg_syntax_t syntax)
        case '.':
          token->type = OP_OPEN_COLL_ELEM;
          break;
+
        case '=':
          token->type = OP_OPEN_EQUIV_CLASS;
          break;
+
        case ':':
          if (syntax & RE_CHAR_CLASSES)
            {
              token->type = OP_OPEN_CHAR_CLASS;
              break;
            }
-         /* else fall through.  */
+         FALLTHROUGH;
        default:
          token->type = CHARACTER;
          token->opr.c = c;
@@ -2137,14 +2123,14 @@ parse (re_string_t *regexp, regex_t *preg, reg_syntax_t syntax,
   dfa->syntax = syntax;
   fetch_token (&current_token, regexp, syntax | RE_CARET_ANCHORS_HERE);
   tree = parse_reg_exp (regexp, preg, &current_token, syntax, 0, err);
-  if (BE (*err != REG_NOERROR && tree == NULL, 0))
+  if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
     return NULL;
   eor = create_tree (dfa, NULL, NULL, END_OF_RE);
   if (tree != NULL)
     root = create_tree (dfa, tree, eor, CONCAT);
   else
     root = eor;
-  if (BE (eor == NULL || root == NULL, 0))
+  if (__glibc_unlikely (eor == NULL || root == NULL))
     {
       *err = REG_ESPACE;
       return NULL;
@@ -2169,7 +2155,7 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
   bin_tree_t *tree, *branch = NULL;
   bitset_word_t initial_bkref_map = dfa->completed_bkref_map;
   tree = parse_branch (regexp, preg, token, syntax, nest, err);
-  if (BE (*err != REG_NOERROR && tree == NULL, 0))
+  if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
     return NULL;
 
   while (token->type == OP_ALT)
@@ -2181,7 +2167,7 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
          bitset_word_t accumulated_bkref_map = dfa->completed_bkref_map;
          dfa->completed_bkref_map = initial_bkref_map;
          branch = parse_branch (regexp, preg, token, syntax, nest, err);
-         if (BE (*err != REG_NOERROR && branch == NULL, 0))
+         if (__glibc_unlikely (*err != REG_NOERROR && branch == NULL))
            {
              if (tree != NULL)
                postorder (tree, free_tree, NULL);
@@ -2192,7 +2178,7 @@ parse_reg_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
       else
        branch = NULL;
       tree = create_tree (dfa, tree, branch, OP_ALT);
-      if (BE (tree == NULL, 0))
+      if (__glibc_unlikely (tree == NULL))
        {
          *err = REG_ESPACE;
          return NULL;
@@ -2217,14 +2203,14 @@ parse_branch (re_string_t *regexp, regex_t *preg, re_token_t *token,
   bin_tree_t *tree, *expr;
   re_dfa_t *dfa = preg->buffer;
   tree = parse_expression (regexp, preg, token, syntax, nest, err);
-  if (BE (*err != REG_NOERROR && tree == NULL, 0))
+  if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
     return NULL;
 
   while (token->type != OP_ALT && token->type != END_OF_RE
         && (nest == 0 || token->type != OP_CLOSE_SUBEXP))
     {
       expr = parse_expression (regexp, preg, token, syntax, nest, err);
-      if (BE (*err != REG_NOERROR && expr == NULL, 0))
+      if (__glibc_unlikely (*err != REG_NOERROR && expr == NULL))
        {
          if (tree != NULL)
            postorder (tree, free_tree, NULL);
@@ -2265,7 +2251,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
     {
     case CHARACTER:
       tree = create_token_tree (dfa, NULL, NULL, token);
-      if (BE (tree == NULL, 0))
+      if (__glibc_unlikely (tree == NULL))
        {
          *err = REG_ESPACE;
          return NULL;
@@ -2280,7 +2266,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
              fetch_token (token, regexp, syntax);
              mbc_remain = create_token_tree (dfa, NULL, NULL, token);
              tree = create_tree (dfa, tree, mbc_remain, CONCAT);
-             if (BE (mbc_remain == NULL || tree == NULL, 0))
+             if (__glibc_unlikely (mbc_remain == NULL || tree == NULL))
                {
                  *err = REG_ESPACE;
                  return NULL;
@@ -2289,25 +2275,28 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
        }
 #endif
       break;
+
     case OP_OPEN_SUBEXP:
       tree = parse_sub_exp (regexp, preg, token, syntax, nest + 1, err);
-      if (BE (*err != REG_NOERROR && tree == NULL, 0))
+      if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
        return NULL;
       break;
+
     case OP_OPEN_BRACKET:
       tree = parse_bracket_exp (regexp, dfa, token, syntax, err);
-      if (BE (*err != REG_NOERROR && tree == NULL, 0))
+      if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
        return NULL;
       break;
+
     case OP_BACK_REF:
-      if (!BE (dfa->completed_bkref_map & (1 << token->opr.idx), 1))
+      if (!__glibc_likely (dfa->completed_bkref_map & (1 << token->opr.idx)))
        {
          *err = REG_ESUBREG;
          return NULL;
        }
       dfa->used_bkref_map |= 1 << token->opr.idx;
       tree = create_token_tree (dfa, NULL, NULL, token);
-      if (BE (tree == NULL, 0))
+      if (__glibc_unlikely (tree == NULL))
        {
          *err = REG_ESPACE;
          return NULL;
@@ -2315,13 +2304,14 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
       ++dfa->nbackref;
       dfa->has_mb_node = 1;
       break;
+
     case OP_OPEN_DUP_NUM:
       if (syntax & RE_CONTEXT_INVALID_DUP)
        {
          *err = REG_BADRPT;
          return NULL;
        }
-      /* FALLTHROUGH */
+      FALLTHROUGH;
     case OP_DUP_ASTERISK:
     case OP_DUP_PLUS:
     case OP_DUP_QUESTION:
@@ -2335,15 +2325,15 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
          fetch_token (token, regexp, syntax);
          return parse_expression (regexp, preg, token, syntax, nest, err);
        }
-      /* else fall through  */
+      FALLTHROUGH;
     case OP_CLOSE_SUBEXP:
-      if ((token->type == OP_CLOSE_SUBEXP) &&
-         !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD))
+      if ((token->type == OP_CLOSE_SUBEXP)
+         && !(syntax & RE_UNMATCHED_RIGHT_PAREN_ORD))
        {
          *err = REG_ERPAREN;
          return NULL;
        }
-      /* else fall through  */
+      FALLTHROUGH;
     case OP_CLOSE_DUP_NUM:
       /* We treat it as a normal character.  */
 
@@ -2352,12 +2342,13 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
       /* mb_partial and word_char bits should be initialized already
         by peek_token.  */
       tree = create_token_tree (dfa, NULL, NULL, token);
-      if (BE (tree == NULL, 0))
+      if (__glibc_unlikely (tree == NULL))
        {
          *err = REG_ESPACE;
          return NULL;
        }
       break;
+
     case ANCHOR:
       if ((token->opr.ctx_type
           & (WORD_DELIM | NOT_WORD_DELIM | WORD_FIRST | WORD_LAST))
@@ -2381,7 +2372,8 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
            }
          tree_last = create_token_tree (dfa, NULL, NULL, token);
          tree = create_tree (dfa, tree_first, tree_last, OP_ALT);
-         if (BE (tree_first == NULL || tree_last == NULL || tree == NULL, 0))
+         if (__glibc_unlikely (tree_first == NULL || tree_last == NULL
+                               || tree == NULL))
            {
              *err = REG_ESPACE;
              return NULL;
@@ -2390,7 +2382,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
       else
        {
          tree = create_token_tree (dfa, NULL, NULL, token);
-         if (BE (tree == NULL, 0))
+         if (__glibc_unlikely (tree == NULL))
            {
              *err = REG_ESPACE;
              return NULL;
@@ -2402,9 +2394,10 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
             it must not be "<ANCHOR(^)><REPEAT(*)>".  */
       fetch_token (token, regexp, syntax);
       return tree;
+
     case OP_PERIOD:
       tree = create_token_tree (dfa, NULL, NULL, token);
-      if (BE (tree == NULL, 0))
+      if (__glibc_unlikely (tree == NULL))
        {
          *err = REG_ESPACE;
          return NULL;
@@ -2412,35 +2405,38 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
       if (dfa->mb_cur_max > 1)
        dfa->has_mb_node = 1;
       break;
+
     case OP_WORD:
     case OP_NOTWORD:
       tree = build_charclass_op (dfa, regexp->trans,
                                 "alnum",
                                 "_",
                                 token->type == OP_NOTWORD, err);
-      if (BE (*err != REG_NOERROR && tree == NULL, 0))
+      if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
        return NULL;
       break;
+
     case OP_SPACE:
     case OP_NOTSPACE:
       tree = build_charclass_op (dfa, regexp->trans,
                                 "space",
                                 "",
                                 token->type == OP_NOTSPACE, err);
-      if (BE (*err != REG_NOERROR && tree == NULL, 0))
+      if (__glibc_unlikely (*err != REG_NOERROR && tree == NULL))
        return NULL;
       break;
+
     case OP_ALT:
     case END_OF_RE:
       return NULL;
+
     case BACK_SLASH:
       *err = REG_EESCAPE;
       return NULL;
+
     default:
       /* Must not happen?  */
-#ifdef DEBUG
-      assert (0);
-#endif
+      DEBUG_ASSERT (false);
       return NULL;
     }
   fetch_token (token, regexp, syntax);
@@ -2450,7 +2446,7 @@ parse_expression (re_string_t *regexp, regex_t *preg, re_token_t *token,
     {
       bin_tree_t *dup_tree = parse_dup_op (tree, regexp, dfa, token,
                                           syntax, err);
-      if (BE (*err != REG_NOERROR && dup_tree == NULL, 0))
+      if (__glibc_unlikely (*err != REG_NOERROR && dup_tree == NULL))
        {
          if (tree != NULL)
            postorder (tree, free_tree, NULL);
@@ -2496,13 +2492,14 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
   else
     {
       tree = parse_reg_exp (regexp, preg, token, syntax, nest, err);
-      if (BE (*err == REG_NOERROR && token->type != OP_CLOSE_SUBEXP, 0))
+      if (__glibc_unlikely (*err == REG_NOERROR
+                           && token->type != OP_CLOSE_SUBEXP))
        {
          if (tree != NULL)
            postorder (tree, free_tree, NULL);
          *err = REG_EPAREN;
        }
-      if (BE (*err != REG_NOERROR, 0))
+      if (__glibc_unlikely (*err != REG_NOERROR))
        return NULL;
     }
 
@@ -2510,7 +2507,7 @@ parse_sub_exp (re_string_t *regexp, regex_t *preg, re_token_t *token,
     dfa->completed_bkref_map |= 1 << cur_nsub;
 
   tree = create_tree (dfa, tree, NULL, SUBEXP);
-  if (BE (tree == NULL, 0))
+  if (__glibc_unlikely (tree == NULL))
     {
       *err = REG_ESPACE;
       return NULL;
@@ -2543,17 +2540,17 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
              return NULL;
            }
        }
-      if (BE (start != -2, 1))
+      if (__glibc_likely (start != -2))
        {
          /* We treat "{n}" as "{n,n}".  */
          end = ((token->type == OP_CLOSE_DUP_NUM) ? start
                 : ((token->type == CHARACTER && token->opr.c == ',')
                    ? fetch_number (regexp, token, syntax) : -2));
        }
-      if (BE (start == -2 || end == -2, 0))
+      if (__glibc_unlikely (start == -2 || end == -2))
        {
          /* Invalid sequence.  */
-         if (BE (!(syntax & RE_INVALID_INTERVAL_ORD), 0))
+         if (__glibc_unlikely (!(syntax & RE_INVALID_INTERVAL_ORD)))
            {
              if (token->type == END_OF_RE)
                *err = REG_EBRACE;
@@ -2572,15 +2569,15 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
          return elem;
        }
 
-      if (BE ((end != -1 && start > end)
-             || token->type != OP_CLOSE_DUP_NUM, 0))
+      if (__glibc_unlikely ((end != -1 && start > end)
+                           || token->type != OP_CLOSE_DUP_NUM))
        {
          /* First number greater than second.  */
          *err = REG_BADBR;
          return NULL;
        }
 
-      if (BE (RE_DUP_MAX < (end == -1 ? start : end), 0))
+      if (__glibc_unlikely (RE_DUP_MAX < (end == -1 ? start : end)))
        {
          *err = REG_ESIZE;
          return NULL;
@@ -2594,23 +2591,23 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
 
   fetch_token (token, regexp, syntax);
 
-  if (BE (elem == NULL, 0))
+  if (__glibc_unlikely (elem == NULL))
     return NULL;
-  if (BE (start == 0 && end == 0, 0))
+  if (__glibc_unlikely (start == 0 && end == 0))
     {
       postorder (elem, free_tree, NULL);
       return NULL;
     }
 
   /* Extract "<re>{n,m}" to "<re><re>...<re><re>{0,<m-n>}".  */
-  if (BE (start > 0, 0))
+  if (__glibc_unlikely (start > 0))
     {
       tree = elem;
       for (i = 2; i <= start; ++i)
        {
          elem = duplicate_tree (elem, dfa);
          tree = create_tree (dfa, tree, elem, CONCAT);
-         if (BE (elem == NULL || tree == NULL, 0))
+         if (__glibc_unlikely (elem == NULL || tree == NULL))
            goto parse_dup_op_espace;
        }
 
@@ -2619,7 +2616,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
 
       /* Duplicate ELEM before it is marked optional.  */
       elem = duplicate_tree (elem, dfa);
-      if (BE (elem == NULL, 0))
+      if (__glibc_unlikely (elem == NULL))
         goto parse_dup_op_espace;
       old_tree = tree;
     }
@@ -2634,13 +2631,9 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
 
   tree = create_tree (dfa, elem, NULL,
                      (end == -1 ? OP_DUP_ASTERISK : OP_ALT));
-  if (BE (tree == NULL, 0))
+  if (__glibc_unlikely (tree == NULL))
     goto parse_dup_op_espace;
 
-/* From gnulib's "intprops.h":
-   True if the arithmetic type T is signed.  */
-#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
-
   /* This loop is actually executed only when end != -1,
      to rewrite <re>{0,n} as (<re>(<re>...<re>?)?)?...  We have
      already created the start+1-th copy.  */
@@ -2649,11 +2642,11 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
       {
        elem = duplicate_tree (elem, dfa);
        tree = create_tree (dfa, tree, elem, CONCAT);
-       if (BE (elem == NULL || tree == NULL, 0))
+       if (__glibc_unlikely (elem == NULL || tree == NULL))
          goto parse_dup_op_espace;
 
        tree = create_tree (dfa, tree, NULL, OP_ALT);
-       if (BE (tree == NULL, 0))
+       if (__glibc_unlikely (tree == NULL))
          goto parse_dup_op_espace;
       }
 
@@ -2675,15 +2668,14 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
 
 # ifdef RE_ENABLE_I18N
 /* Convert the byte B to the corresponding wide character.  In a
-   unibyte locale, treat B as itself if it is an encoding error.
-   In a multibyte locale, return WEOF if B is an encoding error.  */
+   unibyte locale, treat B as itself.  In a multibyte locale, return
+   WEOF if B is an encoding error.  */
 static wint_t
 parse_byte (unsigned char b, re_charset_t *mbcset)
 {
-  wint_t wc = __btowc (b);
-  return wc == WEOF && !mbcset ? b : wc;
+  return mbcset == NULL ? b : __btowc (b);
 }
-#endif
+# endif
 
   /* Local function for parse_bracket_exp only used in case of NOT _LIBC.
      Build the range expression which starts from START_ELEM, and ends
@@ -2693,7 +2685,6 @@ parse_byte (unsigned char b, re_charset_t *mbcset)
      update it.  */
 
 static reg_errcode_t
-internal_function
 # ifdef RE_ENABLE_I18N
 build_range_exp (const reg_syntax_t syntax,
                  bitset_t sbcset,
@@ -2710,17 +2701,18 @@ build_range_exp (const reg_syntax_t syntax,
 {
   unsigned int start_ch, end_ch;
   /* Equivalence Classes and Character Classes can't be a range start/end.  */
-  if (BE (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS
-         || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS,
-         0))
+  if (__glibc_unlikely (start_elem->type == EQUIV_CLASS
+                       || start_elem->type == CHAR_CLASS
+                       || end_elem->type == EQUIV_CLASS
+                       || end_elem->type == CHAR_CLASS))
     return REG_ERANGE;
 
   /* We can handle no multi character collating elements without libc
      support.  */
-  if (BE ((start_elem->type == COLL_SYM
-          && strlen ((char *) start_elem->opr.name) > 1)
-         || (end_elem->type == COLL_SYM
-             && strlen ((char *) end_elem->opr.name) > 1), 0))
+  if (__glibc_unlikely ((start_elem->type == COLL_SYM
+                        && strlen ((char *) start_elem->opr.name) > 1)
+                       || (end_elem->type == COLL_SYM
+                           && strlen ((char *) end_elem->opr.name) > 1)))
     return REG_ECOLLATE;
 
 # ifdef RE_ENABLE_I18N
@@ -2741,7 +2733,8 @@ build_range_exp (const reg_syntax_t syntax,
              ? parse_byte (end_ch, mbcset) : end_elem->opr.wch);
     if (start_wc == WEOF || end_wc == WEOF)
       return REG_ECOLLATE;
-    else if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_wc > end_wc, 0))
+    else if (__glibc_unlikely ((syntax & RE_NO_EMPTY_RANGES)
+                              && start_wc > end_wc))
       return REG_ERANGE;
 
     /* Got valid collation sequence values, add them as a new entry.
@@ -2752,7 +2745,7 @@ build_range_exp (const reg_syntax_t syntax,
     if (mbcset)
       {
        /* Check the space of the arrays.  */
-       if (BE (*range_alloc == mbcset->nranges, 0))
+       if (__glibc_unlikely (*range_alloc == mbcset->nranges))
          {
            /* There is not enough space, need realloc.  */
            wchar_t *new_array_start, *new_array_end;
@@ -2767,7 +2760,8 @@ build_range_exp (const reg_syntax_t syntax,
            new_array_end = re_realloc (mbcset->range_ends, wchar_t,
                                        new_nranges);
 
-           if (BE (new_array_start == NULL || new_array_end == NULL, 0))
+           if (__glibc_unlikely (new_array_start == NULL
+                                 || new_array_end == NULL))
              {
                re_free (new_array_start);
                re_free (new_array_end);
@@ -2819,7 +2813,6 @@ build_range_exp (const reg_syntax_t syntax,
    pointer argument since we may update it.  */
 
 static reg_errcode_t
-internal_function
 # ifdef RE_ENABLE_I18N
 build_collating_symbol (bitset_t sbcset, re_charset_t *mbcset,
                        Idx *coll_sym_alloc, const unsigned char *name)
@@ -2828,7 +2821,7 @@ build_collating_symbol (bitset_t sbcset, const unsigned char *name)
 # endif /* not RE_ENABLE_I18N */
 {
   size_t name_len = strlen ((const char *) name);
-  if (BE (name_len != 1, 0))
+  if (__glibc_unlikely (name_len != 1))
     return REG_ECOLLATE;
   else
     {
@@ -2963,18 +2956,21 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
 
       /* Equivalence Classes and Character Classes can't be a range
         start/end.  */
-      if (BE (start_elem->type == EQUIV_CLASS || start_elem->type == CHAR_CLASS
-             || end_elem->type == EQUIV_CLASS || end_elem->type == CHAR_CLASS,
-             0))
+      if (__glibc_unlikely (start_elem->type == EQUIV_CLASS
+                           || start_elem->type == CHAR_CLASS
+                           || end_elem->type == EQUIV_CLASS
+                           || end_elem->type == CHAR_CLASS))
        return REG_ERANGE;
 
       /* FIXME: Implement rational ranges here, too.  */
       start_collseq = lookup_collation_sequence_value (start_elem);
       end_collseq = lookup_collation_sequence_value (end_elem);
       /* Check start/end collation sequence values.  */
-      if (BE (start_collseq == UINT_MAX || end_collseq == UINT_MAX, 0))
+      if (__glibc_unlikely (start_collseq == UINT_MAX
+                           || end_collseq == UINT_MAX))
        return REG_ECOLLATE;
-      if (BE ((syntax & RE_NO_EMPTY_RANGES) && start_collseq > end_collseq, 0))
+      if (__glibc_unlikely ((syntax & RE_NO_EMPTY_RANGES)
+                           && start_collseq > end_collseq))
        return REG_ERANGE;
 
       /* Got valid collation sequence values, add them as a new entry.
@@ -2984,7 +2980,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       if (nrules > 0 || dfa->mb_cur_max > 1)
        {
          /* Check the space of the arrays.  */
-         if (BE (*range_alloc == mbcset->nranges, 0))
+         if (__glibc_unlikely (*range_alloc == mbcset->nranges))
            {
              /* There is not enough space, need realloc.  */
              uint32_t *new_array_start;
@@ -2998,7 +2994,8 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
              new_array_end = re_realloc (mbcset->range_ends, uint32_t,
                                          new_nranges);
 
-             if (BE (new_array_start == NULL || new_array_end == NULL, 0))
+             if (__glibc_unlikely (new_array_start == NULL
+                                   || new_array_end == NULL))
                return REG_ESPACE;
 
              mbcset->range_starts = new_array_start;
@@ -3062,7 +3059,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
 
          /* Got valid collation sequence, add it as a new entry.  */
          /* Check the space of the arrays.  */
-         if (BE (*coll_sym_alloc == mbcset->ncoll_syms, 0))
+         if (__glibc_unlikely (*coll_sym_alloc == mbcset->ncoll_syms))
            {
              /* Not enough, realloc it.  */
              /* +1 in case of mbcset->ncoll_syms is 0.  */
@@ -3071,7 +3068,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
                 if *alloc == 0.  */
              int32_t *new_coll_syms = re_realloc (mbcset->coll_syms, int32_t,
                                                   new_coll_sym_alloc);
-             if (BE (new_coll_syms == NULL, 0))
+             if (__glibc_unlikely (new_coll_syms == NULL))
                return REG_ESPACE;
              mbcset->coll_syms = new_coll_syms;
              *coll_sym_alloc = new_coll_sym_alloc;
@@ -3081,7 +3078,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
        }
       else
        {
-         if (BE (name_len != 1, 0))
+         if (__glibc_unlikely (name_len != 1))
            return REG_ECOLLATE;
          else
            {
@@ -3125,9 +3122,9 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
   mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1);
 #endif /* RE_ENABLE_I18N */
 #ifdef RE_ENABLE_I18N
-  if (BE (sbcset == NULL || mbcset == NULL, 0))
+  if (__glibc_unlikely (sbcset == NULL || mbcset == NULL))
 #else
-  if (BE (sbcset == NULL, 0))
+  if (__glibc_unlikely (sbcset == NULL))
 #endif /* RE_ENABLE_I18N */
     {
       re_free (sbcset);
@@ -3139,7 +3136,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
     }
 
   token_len = peek_token_bracket (token, regexp, syntax);
-  if (BE (token->type == END_OF_RE, 0))
+  if (__glibc_unlikely (token->type == END_OF_RE))
     {
       *err = REG_BADPAT;
       goto parse_bracket_exp_free_return;
@@ -3154,7 +3151,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
        bitset_set (sbcset, '\n');
       re_string_skip_bytes (regexp, token_len); /* Skip a token.  */
       token_len = peek_token_bracket (token, regexp, syntax);
-      if (BE (token->type == END_OF_RE, 0))
+      if (__glibc_unlikely (token->type == END_OF_RE))
        {
          *err = REG_BADPAT;
          goto parse_bracket_exp_free_return;
@@ -3179,7 +3176,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       start_elem.type = COLL_SYM;
       ret = parse_bracket_element (&start_elem, regexp, token, token_len, dfa,
                                   syntax, first_round);
-      if (BE (ret != REG_NOERROR, 0))
+      if (__glibc_unlikely (ret != REG_NOERROR))
        {
          *err = ret;
          goto parse_bracket_exp_free_return;
@@ -3192,7 +3189,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       /* Do not check for ranges if we know they are not allowed.  */
       if (start_elem.type != CHAR_CLASS && start_elem.type != EQUIV_CLASS)
        {
-         if (BE (token->type == END_OF_RE, 0))
+         if (__glibc_unlikely (token->type == END_OF_RE))
            {
              *err = REG_EBRACK;
              goto parse_bracket_exp_free_return;
@@ -3201,7 +3198,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
            {
              re_string_skip_bytes (regexp, token_len); /* Skip '-'.  */
              token_len2 = peek_token_bracket (&token2, regexp, syntax);
-             if (BE (token2.type == END_OF_RE, 0))
+             if (__glibc_unlikely (token2.type == END_OF_RE))
                {
                  *err = REG_EBRACK;
                  goto parse_bracket_exp_free_return;
@@ -3223,7 +3220,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
          end_elem.type = COLL_SYM;
          ret = parse_bracket_element (&end_elem, regexp, &token2, token_len2,
                                       dfa, syntax, true);
-         if (BE (ret != REG_NOERROR, 0))
+         if (__glibc_unlikely (ret != REG_NOERROR))
            {
              *err = ret;
              goto parse_bracket_exp_free_return;
@@ -3243,7 +3240,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
          *err = build_range_exp (syntax, sbcset, &start_elem, &end_elem);
 # endif
 #endif /* RE_ENABLE_I18N */
-         if (BE (*err != REG_NOERROR, 0))
+         if (__glibc_unlikely (*err != REG_NOERROR))
            goto parse_bracket_exp_free_return;
        }
       else
@@ -3256,7 +3253,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
 #ifdef RE_ENABLE_I18N
            case MB_CHAR:
              /* Check whether the array has enough space.  */
-             if (BE (mbchar_alloc == mbcset->nmbchars, 0))
+             if (__glibc_unlikely (mbchar_alloc == mbcset->nmbchars))
                {
                  wchar_t *new_mbchars;
                  /* Not enough, realloc it.  */
@@ -3265,7 +3262,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
                  /* Use realloc since array is NULL if *alloc == 0.  */
                  new_mbchars = re_realloc (mbcset->mbchars, wchar_t,
                                            mbchar_alloc);
-                 if (BE (new_mbchars == NULL, 0))
+                 if (__glibc_unlikely (new_mbchars == NULL))
                    goto parse_bracket_exp_espace;
                  mbcset->mbchars = new_mbchars;
                }
@@ -3278,7 +3275,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
                                        mbcset, &equiv_class_alloc,
 #endif /* RE_ENABLE_I18N */
                                        start_elem.opr.name);
-             if (BE (*err != REG_NOERROR, 0))
+             if (__glibc_unlikely (*err != REG_NOERROR))
                goto parse_bracket_exp_free_return;
              break;
            case COLL_SYM:
@@ -3287,7 +3284,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
                                             mbcset, &coll_sym_alloc,
 #endif /* RE_ENABLE_I18N */
                                             start_elem.opr.name);
-             if (BE (*err != REG_NOERROR, 0))
+             if (__glibc_unlikely (*err != REG_NOERROR))
                goto parse_bracket_exp_free_return;
              break;
            case CHAR_CLASS:
@@ -3297,15 +3294,15 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
 #endif /* RE_ENABLE_I18N */
                                      (const char *) start_elem.opr.name,
                                      syntax);
-             if (BE (*err != REG_NOERROR, 0))
+             if (__glibc_unlikely (*err != REG_NOERROR))
               goto parse_bracket_exp_free_return;
              break;
            default:
-             assert (0);
+             DEBUG_ASSERT (false);
              break;
            }
        }
-      if (BE (token->type == END_OF_RE, 0))
+      if (__glibc_unlikely (token->type == END_OF_RE))
        {
          *err = REG_EBRACK;
          goto parse_bracket_exp_free_return;
@@ -3336,7 +3333,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       br_token.type = COMPLEX_BRACKET;
       br_token.opr.mbcset = mbcset;
       mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token);
-      if (BE (mbc_tree == NULL, 0))
+      if (__glibc_unlikely (mbc_tree == NULL))
        goto parse_bracket_exp_espace;
       for (sbc_idx = 0; sbc_idx < BITSET_WORDS; ++sbc_idx)
        if (sbcset[sbc_idx])
@@ -3349,12 +3346,12 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
          br_token.type = SIMPLE_BRACKET;
          br_token.opr.sbcset = sbcset;
          work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
-         if (BE (work_tree == NULL, 0))
+         if (__glibc_unlikely (work_tree == NULL))
            goto parse_bracket_exp_espace;
 
          /* Then join them by ALT node.  */
          work_tree = create_tree (dfa, work_tree, mbc_tree, OP_ALT);
-         if (BE (work_tree == NULL, 0))
+         if (__glibc_unlikely (work_tree == NULL))
            goto parse_bracket_exp_espace;
        }
       else
@@ -3373,7 +3370,7 @@ parse_bracket_exp (re_string_t *regexp, re_dfa_t *dfa, re_token_t *token,
       br_token.type = SIMPLE_BRACKET;
       br_token.opr.sbcset = sbcset;
       work_tree = create_token_tree (dfa, NULL, NULL, &br_token);
-      if (BE (work_tree == NULL, 0))
+      if (__glibc_unlikely (work_tree == NULL))
        goto parse_bracket_exp_espace;
     }
   return work_tree;
@@ -3410,7 +3407,7 @@ parse_bracket_element (bracket_elem_t *elem, re_string_t *regexp,
   if (token->type == OP_OPEN_COLL_ELEM || token->type == OP_OPEN_CHAR_CLASS
       || token->type == OP_OPEN_EQUIV_CLASS)
     return parse_bracket_symbol (elem, regexp, token);
-  if (BE (token->type == OP_CHARSET_RANGE, 0) && !accept_hyphen)
+  if (__glibc_unlikely (token->type == OP_CHARSET_RANGE) && !accept_hyphen)
     {
       /* A '-' must only appear as anything but a range indicator before
         the closing bracket.  Everything else is an error.  */
@@ -3505,7 +3502,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
       indirect = (const int32_t *) _NL_CURRENT (LC_COLLATE,
                                                _NL_COLLATE_INDIRECTMB);
       idx1 = findidx (table, indirect, extra, &cp, -1);
-      if (BE (idx1 == 0 || *cp != '\0', 0))
+      if (__glibc_unlikely (idx1 == 0 || *cp != '\0'))
        /* This isn't a valid character.  */
        return REG_ECOLLATE;
 
@@ -3524,21 +3521,13 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
            continue;
          /* Compare only if the length matches and the collation rule
             index is the same.  */
-         if (len == weights[idx2 & 0xffffff] && (idx1 >> 24) == (idx2 >> 24))
-           {
-             int cnt = 0;
-
-             while (cnt <= len &&
-                    weights[(idx1 & 0xffffff) + 1 + cnt]
-                    == weights[(idx2 & 0xffffff) + 1 + cnt])
-               ++cnt;
-
-             if (cnt > len)
-               bitset_set (sbcset, ch);
-           }
+         if (len == weights[idx2 & 0xffffff] && (idx1 >> 24) == (idx2 >> 24)
+             && memcmp (weights + (idx1 & 0xffffff) + 1,
+                        weights + (idx2 & 0xffffff) + 1, len) == 0)
+           bitset_set (sbcset, ch);
        }
       /* Check whether the array has enough space.  */
-      if (BE (*equiv_class_alloc == mbcset->nequiv_classes, 0))
+      if (__glibc_unlikely (*equiv_class_alloc == mbcset->nequiv_classes))
        {
          /* Not enough, realloc it.  */
          /* +1 in case of mbcset->nequiv_classes is 0.  */
@@ -3547,7 +3536,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
          int32_t *new_equiv_classes = re_realloc (mbcset->equiv_classes,
                                                   int32_t,
                                                   new_equiv_class_alloc);
-         if (BE (new_equiv_classes == NULL, 0))
+         if (__glibc_unlikely (new_equiv_classes == NULL))
            return REG_ESPACE;
          mbcset->equiv_classes = new_equiv_classes;
          *equiv_class_alloc = new_equiv_class_alloc;
@@ -3557,7 +3546,7 @@ build_equiv_class (bitset_t sbcset, const unsigned char *name)
   else
 #endif /* _LIBC */
     {
-      if (BE (strlen ((const char *) name) != 1, 0))
+      if (__glibc_unlikely (strlen ((const char *) name) != 1))
        return REG_ECOLLATE;
       bitset_set (sbcset, *name);
     }
@@ -3591,7 +3580,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
 
 #ifdef RE_ENABLE_I18N
   /* Check the space of the arrays.  */
-  if (BE (*char_class_alloc == mbcset->nchar_classes, 0))
+  if (__glibc_unlikely (*char_class_alloc == mbcset->nchar_classes))
     {
       /* Not enough, realloc it.  */
       /* +1 in case of mbcset->nchar_classes is 0.  */
@@ -3599,7 +3588,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
       /* Use realloc since array is NULL if *alloc == 0.  */
       wctype_t *new_char_classes = re_realloc (mbcset->char_classes, wctype_t,
                                               new_char_class_alloc);
-      if (BE (new_char_classes == NULL, 0))
+      if (__glibc_unlikely (new_char_classes == NULL))
        return REG_ESPACE;
       mbcset->char_classes = new_char_classes;
       *char_class_alloc = new_char_class_alloc;
@@ -3609,7 +3598,7 @@ build_charclass (RE_TRANSLATE_TYPE trans, bitset_t sbcset,
 
 #define BUILD_CHARCLASS_LOOP(ctype_func)       \
   do {                                         \
-    if (BE (trans != NULL, 0))                 \
+    if (__glibc_unlikely (trans != NULL))                      \
       {                                                \
        for (i = 0; i < SBC_MAX; ++i)           \
          if (ctype_func (i))                   \
@@ -3665,18 +3654,17 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
   Idx alloc = 0;
 #endif /* not RE_ENABLE_I18N */
   reg_errcode_t ret;
-  re_token_t br_token;
   bin_tree_t *tree;
 
   sbcset = (re_bitset_ptr_t) calloc (sizeof (bitset_t), 1);
-  if (BE (sbcset == NULL, 0))
+  if (__glibc_unlikely (sbcset == NULL))
     {
       *err = REG_ESPACE;
       return NULL;
     }
 #ifdef RE_ENABLE_I18N
   mbcset = (re_charset_t *) calloc (sizeof (re_charset_t), 1);
-  if (BE (mbcset == NULL, 0))
+  if (__glibc_unlikely (mbcset == NULL))
     {
       re_free (sbcset);
       *err = REG_ESPACE;
@@ -3692,7 +3680,7 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
 #endif /* RE_ENABLE_I18N */
                         class_name, 0);
 
-  if (BE (ret != REG_NOERROR, 0))
+  if (__glibc_unlikely (ret != REG_NOERROR))
     {
       re_free (sbcset);
 #ifdef RE_ENABLE_I18N
@@ -3716,13 +3704,9 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
 #endif
 
   /* Build a tree for simple bracket.  */
-#if defined GCC_LINT || defined lint
-  memset (&br_token, 0, sizeof br_token);
-#endif
-  br_token.type = SIMPLE_BRACKET;
-  br_token.opr.sbcset = sbcset;
+  re_token_t br_token = { .type = SIMPLE_BRACKET, .opr.sbcset = sbcset };
   tree = create_token_tree (dfa, NULL, NULL, &br_token);
-  if (BE (tree == NULL, 0))
+  if (__glibc_unlikely (tree == NULL))
     goto build_word_op_espace;
 
 #ifdef RE_ENABLE_I18N
@@ -3734,11 +3718,11 @@ build_charclass_op (re_dfa_t *dfa, RE_TRANSLATE_TYPE trans,
       br_token.opr.mbcset = mbcset;
       dfa->has_mb_node = 1;
       mbc_tree = create_token_tree (dfa, NULL, NULL, &br_token);
-      if (BE (mbc_tree == NULL, 0))
+      if (__glibc_unlikely (mbc_tree == NULL))
        goto build_word_op_espace;
       /* Then join them by ALT node.  */
       tree = create_tree (dfa, tree, mbc_tree, OP_ALT);
-      if (BE (mbc_tree != NULL, 1))
+      if (__glibc_likely (mbc_tree != NULL))
        return tree;
     }
   else
@@ -3774,7 +3758,7 @@ fetch_number (re_string_t *input, re_token_t *token, reg_syntax_t syntax)
     {
       fetch_token (token, input, syntax);
       c = token->opr.c;
-      if (BE (token->type == END_OF_RE, 0))
+      if (__glibc_unlikely (token->type == END_OF_RE))
        return -2;
       if (token->type == OP_CLOSE_DUP_NUM || c == ',')
        break;
@@ -3795,9 +3779,9 @@ free_charset (re_charset_t *cset)
 # ifdef _LIBC
   re_free (cset->coll_syms);
   re_free (cset->equiv_classes);
+# endif
   re_free (cset->range_starts);
   re_free (cset->range_ends);
-# endif
   re_free (cset->char_classes);
   re_free (cset);
 }
@@ -3811,11 +3795,7 @@ static bin_tree_t *
 create_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
             re_token_type_t type)
 {
-  re_token_t t;
-#if defined GCC_LINT || defined lint
-  memset (&t, 0, sizeof t);
-#endif
-  t.type = type;
+  re_token_t t = { .type = type };
   return create_token_tree (dfa, left, right, &t);
 }
 
@@ -3824,7 +3804,7 @@ create_token_tree (re_dfa_t *dfa, bin_tree_t *left, bin_tree_t *right,
                   const re_token_t *token)
 {
   bin_tree_t *tree;
-  if (BE (dfa->str_tree_storage_idx == BIN_TREE_STORAGE_SIZE, 0))
+  if (__glibc_unlikely (dfa->str_tree_storage_idx == BIN_TREE_STORAGE_SIZE))
     {
       bin_tree_storage_t *storage = re_malloc (bin_tree_storage_t, 1);
 
index 432b465..f76a416 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
 
    You should have received a copy of the GNU General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
+
+#define __STDC_WANT_IEC_60559_BFP_EXT__
 
 #ifndef _LIBC
-# include <config.h>
+# include <libc-config.h>
 
-# if (__GNUC__ == 4 && 6 <= __GNUC_MINOR__) || 4 < __GNUC__
+# if __GNUC_PREREQ (4, 6)
 #  pragma GCC diagnostic ignored "-Wsuggest-attribute=pure"
 # endif
-# if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# if __GNUC_PREREQ (4, 3)
 #  pragma GCC diagnostic ignored "-Wold-style-definition"
 #  pragma GCC diagnostic ignored "-Wtype-limits"
 # endif
index b7496f9..d291e38 100644 (file)
@@ -1,7 +1,6 @@
 /* Definitions for data structures and routines for the regular
    expression library.
-   Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2016 Free Software
-   Foundation, Inc.
+   Copyright (C) 1985, 1989-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -16,7 +15,7 @@
 
    You should have received a copy of the GNU General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #ifndef _REGEX_H
 #define _REGEX_H 1
@@ -601,35 +600,40 @@ extern void re_set_registers (struct re_pattern_buffer *__buffer,
 #endif /* Use GNU */
 
 #if defined _REGEX_RE_COMP || (defined _LIBC && defined __USE_MISC)
-# ifndef _CRAY
 /* 4.2 bsd compatibility.  */
 extern char *re_comp (const char *);
 extern int re_exec (const char *);
-# endif
 #endif
 
-/* GCC 2.95 and later have "__restrict"; C99 compilers have
+/* For plain 'restrict', use glibc's __restrict if defined.
+   Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have
    "restrict", and "configure" may have defined "restrict".
    Other compilers use __restrict, __restrict__, and _Restrict, and
    'configure' might #define 'restrict' to those words, so pick a
    different name.  */
 #ifndef _Restrict_
-# if 199901L <= __STDC_VERSION__
-#  define _Restrict_ restrict
-# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
+# if defined __restrict \
+     || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
+     || __clang_major__ >= 3
 #  define _Restrict_ __restrict
+# elif 199901L <= __STDC_VERSION__ || defined restrict
+#  define _Restrict_ restrict
 # else
 #  define _Restrict_
 # endif
 #endif
-/* gcc 3.1 and up support the [restrict] syntax.  Don't trust
-   sys/cdefs.h's definition of __restrict_arr, though, as it
-   mishandles gcc -ansi -pedantic.  */
+/* For the ISO C99 syntax
+     array_name[restrict]
+   use glibc's __restrict_arr if available.
+   Otherwise, GCC 3.1 and clang support this syntax (but not in C++ mode).
+   Other ISO C99 compilers support it as well.  */
 #ifndef _Restrict_arr_
-# if ((199901L <= __STDC_VERSION__                                     \
-       || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__))    \
-          && !defined __STRICT_ANSI__))                                        \
-      && !defined __GNUG__)
+# ifdef __restrict_arr
+#  define _Restrict_arr_ __restrict_arr
+# elif ((199901L <= __STDC_VERSION__ \
+         || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+         || __clang_major__ >= 3) \
+        && !defined __cplusplus)
 #  define _Restrict_arr_ _Restrict_
 # else
 #  define _Restrict_arr_
index a3b10dd..6097f5d 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
 
    You should have received a copy of the GNU General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 static void re_string_construct_common (const char *str, Idx len,
                                        re_string_t *pstr,
                                        RE_TRANSLATE_TYPE trans, bool icase,
-                                       const re_dfa_t *dfa) internal_function;
+                                       const re_dfa_t *dfa);
 static re_dfastate_t *create_ci_newstate (const re_dfa_t *dfa,
                                          const re_node_set *nodes,
-                                         re_hashval_t hash) internal_function;
+                                         re_hashval_t hash);
 static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa,
                                          const re_node_set *nodes,
                                          unsigned int context,
-                                         re_hashval_t hash) internal_function;
+                                         re_hashval_t hash);
+static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
+                                               Idx new_buf_len);
+#ifdef RE_ENABLE_I18N
+static void build_wcs_buffer (re_string_t *pstr);
+static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr);
+#endif /* RE_ENABLE_I18N */
+static void build_upper_buffer (re_string_t *pstr);
+static void re_string_translate_buffer (re_string_t *pstr);
+static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
+                                         int eflags) __attribute__ ((pure));
 \f
 /* Functions for string operation.  */
 
@@ -35,7 +45,7 @@ static re_dfastate_t *create_cd_newstate (const re_dfa_t *dfa,
    re_string_reconstruct before using the object.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len,
                    RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa)
 {
@@ -49,7 +59,7 @@ re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len,
   re_string_construct_common (str, len, pstr, trans, icase, dfa);
 
   ret = re_string_realloc_buffers (pstr, init_buf_len);
-  if (BE (ret != REG_NOERROR, 0))
+  if (__glibc_unlikely (ret != REG_NOERROR))
     return ret;
 
   pstr->word_char = dfa->word_char;
@@ -63,7 +73,7 @@ re_string_allocate (re_string_t *pstr, const char *str, Idx len, Idx init_len,
 /* This function allocate the buffers, and initialize them.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_string_construct (re_string_t *pstr, const char *str, Idx len,
                     RE_TRANSLATE_TYPE trans, bool icase, const re_dfa_t *dfa)
 {
@@ -74,7 +84,7 @@ re_string_construct (re_string_t *pstr, const char *str, Idx len,
   if (len > 0)
     {
       ret = re_string_realloc_buffers (pstr, len + 1);
-      if (BE (ret != REG_NOERROR, 0))
+      if (__glibc_unlikely (ret != REG_NOERROR))
        return ret;
     }
   pstr->mbs = pstr->mbs_allocated ? pstr->mbs : (unsigned char *) str;
@@ -87,14 +97,14 @@ re_string_construct (re_string_t *pstr, const char *str, Idx len,
          while (1)
            {
              ret = build_wcs_upper_buffer (pstr);
-             if (BE (ret != REG_NOERROR, 0))
+             if (__glibc_unlikely (ret != REG_NOERROR))
                return ret;
              if (pstr->valid_raw_len >= len)
                break;
              if (pstr->bufs_len > pstr->valid_len + dfa->mb_cur_max)
                break;
              ret = re_string_realloc_buffers (pstr, pstr->bufs_len * 2);
-             if (BE (ret != REG_NOERROR, 0))
+             if (__glibc_unlikely (ret != REG_NOERROR))
                return ret;
            }
        }
@@ -126,7 +136,7 @@ re_string_construct (re_string_t *pstr, const char *str, Idx len,
 /* Helper functions for re_string_allocate, and re_string_construct.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len)
 {
 #ifdef RE_ENABLE_I18N
@@ -136,17 +146,18 @@ re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len)
 
       /* Avoid overflow in realloc.  */
       const size_t max_object_size = MAX (sizeof (wint_t), sizeof (Idx));
-      if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < new_buf_len, 0))
+      if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size)
+                           < new_buf_len))
        return REG_ESPACE;
 
       new_wcs = re_realloc (pstr->wcs, wint_t, new_buf_len);
-      if (BE (new_wcs == NULL, 0))
+      if (__glibc_unlikely (new_wcs == NULL))
        return REG_ESPACE;
       pstr->wcs = new_wcs;
       if (pstr->offsets != NULL)
        {
          Idx *new_offsets = re_realloc (pstr->offsets, Idx, new_buf_len);
-         if (BE (new_offsets == NULL, 0))
+         if (__glibc_unlikely (new_offsets == NULL))
            return REG_ESPACE;
          pstr->offsets = new_offsets;
        }
@@ -156,7 +167,7 @@ re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len)
     {
       unsigned char *new_mbs = re_realloc (pstr->mbs, unsigned char,
                                           new_buf_len);
-      if (BE (new_mbs == NULL, 0))
+      if (__glibc_unlikely (new_mbs == NULL))
        return REG_ESPACE;
       pstr->mbs = new_mbs;
     }
@@ -166,7 +177,6 @@ re_string_realloc_buffers (re_string_t *pstr, Idx new_buf_len)
 
 
 static void
-internal_function
 re_string_construct_common (const char *str, Idx len, re_string_t *pstr,
                            RE_TRANSLATE_TYPE trans, bool icase,
                            const re_dfa_t *dfa)
@@ -198,12 +208,11 @@ re_string_construct_common (const char *str, Idx len, re_string_t *pstr,
    built and starts from PSTR->VALID_LEN.  */
 
 static void
-internal_function
 build_wcs_buffer (re_string_t *pstr)
 {
 #ifdef _LIBC
   unsigned char buf[MB_LEN_MAX];
-  assert (MB_LEN_MAX >= pstr->mb_cur_max);
+  DEBUG_ASSERT (MB_LEN_MAX >= pstr->mb_cur_max);
 #else
   unsigned char buf[64];
 #endif
@@ -222,7 +231,7 @@ build_wcs_buffer (re_string_t *pstr)
       remain_len = end_idx - byte_idx;
       prev_st = pstr->cur_state;
       /* Apply the translation if we need.  */
-      if (BE (pstr->trans != NULL, 0))
+      if (__glibc_unlikely (pstr->trans != NULL))
        {
          int i, ch;
 
@@ -236,17 +245,18 @@ build_wcs_buffer (re_string_t *pstr)
       else
        p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + byte_idx;
       mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
-      if (BE (mbclen == (size_t) -1 || mbclen == 0
-             || (mbclen == (size_t) -2 && pstr->bufs_len >= pstr->len), 0))
+      if (__glibc_unlikely (mbclen == (size_t) -1 || mbclen == 0
+                           || (mbclen == (size_t) -2
+                               && pstr->bufs_len >= pstr->len)))
        {
          /* We treat these cases as a singlebyte character.  */
          mbclen = 1;
          wc = (wchar_t) pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
-         if (BE (pstr->trans != NULL, 0))
+         if (__glibc_unlikely (pstr->trans != NULL))
            wc = pstr->trans[wc];
          pstr->cur_state = prev_st;
        }
-      else if (BE (mbclen == (size_t) -2, 0))
+      else if (__glibc_unlikely (mbclen == (size_t) -2))
        {
          /* The buffer doesn't have enough space, finish to build.  */
          pstr->cur_state = prev_st;
@@ -267,7 +277,7 @@ build_wcs_buffer (re_string_t *pstr)
    but for REG_ICASE.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 build_wcs_upper_buffer (re_string_t *pstr)
 {
   mbstate_t prev_st;
@@ -275,7 +285,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
   size_t mbclen;
 #ifdef _LIBC
   char buf[MB_LEN_MAX];
-  assert (MB_LEN_MAX >= pstr->mb_cur_max);
+  DEBUG_ASSERT (pstr->mb_cur_max <= MB_LEN_MAX);
 #else
   char buf[64];
 #endif
@@ -290,18 +300,20 @@ build_wcs_upper_buffer (re_string_t *pstr)
       while (byte_idx < end_idx)
        {
          wchar_t wc;
+         unsigned char ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
 
-         if (isascii (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx])
-             && mbsinit (&pstr->cur_state))
+         if (isascii (ch) && mbsinit (&pstr->cur_state))
            {
-             /* In case of a singlebyte character.  */
-             pstr->mbs[byte_idx]
-               = toupper (pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx]);
              /* The next step uses the assumption that wchar_t is encoded
                 ASCII-safe: all ASCII values can be converted like this.  */
-             pstr->wcs[byte_idx] = (wchar_t) pstr->mbs[byte_idx];
-             ++byte_idx;
-             continue;
+             wchar_t wcu = __towupper (ch);
+             if (isascii (wcu))
+               {
+                 pstr->mbs[byte_idx] = wcu;
+                 pstr->wcs[byte_idx] = wcu;
+                 byte_idx++;
+                 continue;
+               }
            }
 
          remain_len = end_idx - byte_idx;
@@ -309,7 +321,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
          mbclen = __mbrtowc (&wc,
                              ((const char *) pstr->raw_mbs + pstr->raw_mbs_idx
                               + byte_idx), remain_len, &pstr->cur_state);
-         if (BE (mbclen < (size_t) -2, 1))
+         if (__glibc_likely (0 < mbclen && mbclen < (size_t) -2))
            {
              wchar_t wcu = __towupper (wc);
              if (wcu != wc)
@@ -317,7 +329,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
                  size_t mbcdlen;
 
                  mbcdlen = __wcrtomb (buf, wcu, &prev_st);
-                 if (BE (mbclen == mbcdlen, 1))
+                 if (__glibc_likely (mbclen == mbcdlen))
                    memcpy (pstr->mbs + byte_idx, buf, mbclen);
                  else
                    {
@@ -338,11 +350,10 @@ build_wcs_upper_buffer (re_string_t *pstr)
            {
              /* It is an invalid character, an incomplete character
                 at the end of the string, or '\0'.  Just use the byte.  */
-             int ch = pstr->raw_mbs[pstr->raw_mbs_idx + byte_idx];
              pstr->mbs[byte_idx] = ch;
              /* And also cast it to wide char.  */
              pstr->wcs[byte_idx++] = (wchar_t) ch;
-             if (BE (mbclen == (size_t) -1, 0))
+             if (__glibc_unlikely (mbclen == (size_t) -1))
                pstr->cur_state = prev_st;
            }
          else
@@ -364,7 +375,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
       offsets_needed:
        remain_len = end_idx - byte_idx;
        prev_st = pstr->cur_state;
-       if (BE (pstr->trans != NULL, 0))
+       if (__glibc_unlikely (pstr->trans != NULL))
          {
            int i, ch;
 
@@ -378,15 +389,15 @@ build_wcs_upper_buffer (re_string_t *pstr)
        else
          p = (const char *) pstr->raw_mbs + pstr->raw_mbs_idx + src_idx;
        mbclen = __mbrtowc (&wc, p, remain_len, &pstr->cur_state);
-       if (BE (mbclen < (size_t) -2, 1))
+       if (__glibc_likely (0 < mbclen && mbclen < (size_t) -2))
          {
            wchar_t wcu = __towupper (wc);
            if (wcu != wc)
              {
                size_t mbcdlen;
 
-               mbcdlen = wcrtomb ((char *) buf, wcu, &prev_st);
-               if (BE (mbclen == mbcdlen, 1))
+               mbcdlen = __wcrtomb ((char *) buf, wcu, &prev_st);
+               if (__glibc_likely (mbclen == mbcdlen))
                  memcpy (pstr->mbs + byte_idx, buf, mbclen);
                else if (mbcdlen != (size_t) -1)
                  {
@@ -436,7 +447,7 @@ build_wcs_upper_buffer (re_string_t *pstr)
            else
              memcpy (pstr->mbs + byte_idx, p, mbclen);
 
-           if (BE (pstr->offsets_needed != 0, 0))
+           if (__glibc_unlikely (pstr->offsets_needed != 0))
              {
                size_t i;
                for (i = 0; i < mbclen; ++i)
@@ -455,17 +466,17 @@ build_wcs_upper_buffer (re_string_t *pstr)
            /* It is an invalid character or '\0'.  Just use the byte.  */
            int ch = pstr->raw_mbs[pstr->raw_mbs_idx + src_idx];
 
-           if (BE (pstr->trans != NULL, 0))
+           if (__glibc_unlikely (pstr->trans != NULL))
              ch = pstr->trans [ch];
            pstr->mbs[byte_idx] = ch;
 
-           if (BE (pstr->offsets_needed != 0, 0))
+           if (__glibc_unlikely (pstr->offsets_needed != 0))
              pstr->offsets[byte_idx] = src_idx;
            ++src_idx;
 
            /* And also cast it to wide char.  */
            pstr->wcs[byte_idx++] = (wchar_t) ch;
-           if (BE (mbclen == (size_t) -1, 0))
+           if (__glibc_unlikely (mbclen == (size_t) -1))
              pstr->cur_state = prev_st;
          }
        else
@@ -484,7 +495,6 @@ build_wcs_upper_buffer (re_string_t *pstr)
    Return the index.  */
 
 static Idx
-internal_function
 re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc)
 {
   mbstate_t prev_st;
@@ -501,7 +511,8 @@ re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc)
       prev_st = pstr->cur_state;
       mbclen = __mbrtowc (&wc2, (const char *) pstr->raw_mbs + rawbuf_idx,
                          remain_len, &pstr->cur_state);
-      if (BE (mbclen == (size_t) -2 || mbclen == (size_t) -1 || mbclen == 0, 0))
+      if (__glibc_unlikely (mbclen == (size_t) -2 || mbclen == (size_t) -1
+                           || mbclen == 0))
        {
          /* We treat these cases as a single byte character.  */
          if (mbclen == 0 || remain_len == 0)
@@ -525,7 +536,6 @@ re_string_skip_chars (re_string_t *pstr, Idx new_raw_idx, wint_t *last_wc)
    This function is used in case of REG_ICASE.  */
 
 static void
-internal_function
 build_upper_buffer (re_string_t *pstr)
 {
   Idx char_idx, end_idx;
@@ -534,7 +544,7 @@ build_upper_buffer (re_string_t *pstr)
   for (char_idx = pstr->valid_len; char_idx < end_idx; ++char_idx)
     {
       int ch = pstr->raw_mbs[pstr->raw_mbs_idx + char_idx];
-      if (BE (pstr->trans != NULL, 0))
+      if (__glibc_unlikely (pstr->trans != NULL))
        ch = pstr->trans[ch];
       pstr->mbs[char_idx] = toupper (ch);
     }
@@ -545,7 +555,6 @@ build_upper_buffer (re_string_t *pstr)
 /* Apply TRANS to the buffer in PSTR.  */
 
 static void
-internal_function
 re_string_translate_buffer (re_string_t *pstr)
 {
   Idx buf_idx, end_idx;
@@ -566,12 +575,12 @@ re_string_translate_buffer (re_string_t *pstr)
    convert to upper case in case of REG_ICASE, apply translation.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
 {
   Idx offset;
 
-  if (BE (pstr->raw_mbs_idx <= idx, 0))
+  if (__glibc_unlikely (pstr->raw_mbs_idx <= idx))
     offset = idx - pstr->raw_mbs_idx;
   else
     {
@@ -593,14 +602,14 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
       offset = idx;
     }
 
-  if (BE (offset != 0, 1))
+  if (__glibc_likely (offset != 0))
     {
       /* Should the already checked characters be kept?  */
-      if (BE (offset < pstr->valid_raw_len, 1))
+      if (__glibc_likely (offset < pstr->valid_raw_len))
        {
          /* Yes, move them to the front of the buffer.  */
 #ifdef RE_ENABLE_I18N
-         if (BE (pstr->offsets_needed, 0))
+         if (__glibc_unlikely (pstr->offsets_needed))
            {
              Idx low = 0, high = pstr->valid_len, mid;
              do
@@ -672,14 +681,12 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
                memmove (pstr->wcs, pstr->wcs + offset,
                         (pstr->valid_len - offset) * sizeof (wint_t));
 #endif /* RE_ENABLE_I18N */
-             if (BE (pstr->mbs_allocated, 0))
+             if (__glibc_unlikely (pstr->mbs_allocated))
                memmove (pstr->mbs, pstr->mbs + offset,
                         pstr->valid_len - offset);
              pstr->valid_len -= offset;
              pstr->valid_raw_len -= offset;
-#if defined DEBUG && DEBUG
-             assert (pstr->valid_len > 0);
-#endif
+             DEBUG_ASSERT (pstr->valid_len > 0);
            }
        }
       else
@@ -688,7 +695,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
          /* No, skip all characters until IDX.  */
          Idx prev_valid_len = pstr->valid_len;
 
-         if (BE (pstr->offsets_needed, 0))
+         if (__glibc_unlikely (pstr->offsets_needed))
            {
              pstr->len = pstr->raw_len - idx + offset;
              pstr->stop = pstr->raw_stop - idx + offset;
@@ -716,7 +723,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
 #ifdef _LIBC
                  /* We know the wchar_t encoding is UCS4, so for the simple
                     case, ASCII characters, skip the conversion step.  */
-                 if (isascii (*p) && BE (pstr->trans == NULL, 1))
+                 if (isascii (*p) && __glibc_likely (pstr->trans == NULL))
                    {
                      memset (&pstr->cur_state, '\0', sizeof (mbstate_t));
                      /* pstr->valid_len = 0; */
@@ -734,7 +741,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
                          size_t mbclen;
 
                          const unsigned char *pp = p;
-                         if (BE (pstr->trans != NULL, 0))
+                         if (__glibc_unlikely (pstr->trans != NULL))
                            {
                              int i = mlen < 6 ? mlen : 6;
                              while (--i >= 0)
@@ -764,13 +771,13 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
                pstr->tip_context
                  = re_string_context_at (pstr, prev_valid_len - 1, eflags);
              else
-               pstr->tip_context = ((BE (pstr->word_ops_used != 0, 0)
+               pstr->tip_context = ((__glibc_unlikely (pstr->word_ops_used != 0)
                                      && IS_WIDE_WORD_CHAR (wc))
                                     ? CONTEXT_WORD
                                     : ((IS_WIDE_NEWLINE (wc)
                                         && pstr->newline_anchor)
                                        ? CONTEXT_NEWLINE : 0));
-             if (BE (pstr->valid_len, 0))
+             if (__glibc_unlikely (pstr->valid_len))
                {
                  for (wcs_idx = 0; wcs_idx < pstr->valid_len; ++wcs_idx)
                    pstr->wcs[wcs_idx] = WEOF;
@@ -792,7 +799,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
                                      ? CONTEXT_NEWLINE : 0));
            }
        }
-      if (!BE (pstr->mbs_allocated, 0))
+      if (!__glibc_unlikely (pstr->mbs_allocated))
        pstr->mbs += offset;
     }
   pstr->raw_mbs_idx = idx;
@@ -806,7 +813,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
       if (pstr->icase)
        {
          reg_errcode_t ret = build_wcs_upper_buffer (pstr);
-         if (BE (ret != REG_NOERROR, 0))
+         if (__glibc_unlikely (ret != REG_NOERROR))
            return ret;
        }
       else
@@ -814,7 +821,7 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
     }
   else
 #endif /* RE_ENABLE_I18N */
-    if (BE (pstr->mbs_allocated, 0))
+    if (__glibc_unlikely (pstr->mbs_allocated))
       {
        if (pstr->icase)
          build_upper_buffer (pstr);
@@ -829,14 +836,14 @@ re_string_reconstruct (re_string_t *pstr, Idx idx, int eflags)
 }
 
 static unsigned char
-internal_function __attribute__ ((pure))
+__attribute__ ((pure))
 re_string_peek_byte_case (const re_string_t *pstr, Idx idx)
 {
   int ch;
   Idx off;
 
   /* Handle the common (easiest) cases first.  */
-  if (BE (!pstr->mbs_allocated, 1))
+  if (__glibc_likely (!pstr->mbs_allocated))
     return re_string_peek_byte (pstr, idx);
 
 #ifdef RE_ENABLE_I18N
@@ -866,10 +873,9 @@ re_string_peek_byte_case (const re_string_t *pstr, Idx idx)
 }
 
 static unsigned char
-internal_function
 re_string_fetch_byte_case (re_string_t *pstr)
 {
-  if (BE (!pstr->mbs_allocated, 1))
+  if (__glibc_likely (!pstr->mbs_allocated))
     return re_string_fetch_byte (pstr);
 
 #ifdef RE_ENABLE_I18N
@@ -904,7 +910,6 @@ re_string_fetch_byte_case (re_string_t *pstr)
 }
 
 static void
-internal_function
 re_string_destruct (re_string_t *pstr)
 {
 #ifdef RE_ENABLE_I18N
@@ -918,15 +923,14 @@ re_string_destruct (re_string_t *pstr)
 /* Return the context at IDX in INPUT.  */
 
 static unsigned int
-internal_function
 re_string_context_at (const re_string_t *input, Idx idx, int eflags)
 {
   int c;
-  if (BE (idx < 0, 0))
+  if (__glibc_unlikely (idx < 0))
     /* In this case, we use the value stored in input->tip_context,
        since we can't know the character in input->mbs[-1] here.  */
     return input->tip_context;
-  if (BE (idx == input->len, 0))
+  if (__glibc_unlikely (idx == input->len))
     return ((eflags & REG_NOTEOL) ? CONTEXT_ENDBUF
            : CONTEXT_NEWLINE | CONTEXT_ENDBUF);
 #ifdef RE_ENABLE_I18N
@@ -936,16 +940,14 @@ re_string_context_at (const re_string_t *input, Idx idx, int eflags)
       Idx wc_idx = idx;
       while(input->wcs[wc_idx] == WEOF)
        {
-#if defined DEBUG && DEBUG
-         /* It must not happen.  */
-         assert (wc_idx >= 0);
-#endif
+         DEBUG_ASSERT (wc_idx >= 0);
          --wc_idx;
          if (wc_idx < 0)
            return input->tip_context;
        }
       wc = input->wcs[wc_idx];
-      if (BE (input->word_ops_used != 0, 0) && IS_WIDE_WORD_CHAR (wc))
+      if (__glibc_unlikely (input->word_ops_used != 0)
+         && IS_WIDE_WORD_CHAR (wc))
        return CONTEXT_WORD;
       return (IS_WIDE_NEWLINE (wc) && input->newline_anchor
              ? CONTEXT_NEWLINE : 0);
@@ -963,25 +965,26 @@ re_string_context_at (const re_string_t *input, Idx idx, int eflags)
 /* Functions for set operation.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_node_set_alloc (re_node_set *set, Idx size)
 {
   set->alloc = size;
   set->nelem = 0;
   set->elems = re_malloc (Idx, size);
-  if (BE (set->elems == NULL, 0) && (MALLOC_0_IS_NONNULL || size != 0))
+  if (__glibc_unlikely (set->elems == NULL)
+      && (MALLOC_0_IS_NONNULL || size != 0))
     return REG_ESPACE;
   return REG_NOERROR;
 }
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_node_set_init_1 (re_node_set *set, Idx elem)
 {
   set->alloc = 1;
   set->nelem = 1;
   set->elems = re_malloc (Idx, 1);
-  if (BE (set->elems == NULL, 0))
+  if (__glibc_unlikely (set->elems == NULL))
     {
       set->alloc = set->nelem = 0;
       return REG_ESPACE;
@@ -991,12 +994,12 @@ re_node_set_init_1 (re_node_set *set, Idx elem)
 }
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_node_set_init_2 (re_node_set *set, Idx elem1, Idx elem2)
 {
   set->alloc = 2;
   set->elems = re_malloc (Idx, 2);
-  if (BE (set->elems == NULL, 0))
+  if (__glibc_unlikely (set->elems == NULL))
     return REG_ESPACE;
   if (elem1 == elem2)
     {
@@ -1021,7 +1024,7 @@ re_node_set_init_2 (re_node_set *set, Idx elem1, Idx elem2)
 }
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_node_set_init_copy (re_node_set *dest, const re_node_set *src)
 {
   dest->nelem = src->nelem;
@@ -1029,7 +1032,7 @@ re_node_set_init_copy (re_node_set *dest, const re_node_set *src)
     {
       dest->alloc = dest->nelem;
       dest->elems = re_malloc (Idx, dest->alloc);
-      if (BE (dest->elems == NULL, 0))
+      if (__glibc_unlikely (dest->elems == NULL))
        {
          dest->alloc = dest->nelem = 0;
          return REG_ESPACE;
@@ -1046,7 +1049,7 @@ re_node_set_init_copy (re_node_set *dest, const re_node_set *src)
    Note: We assume dest->elems is NULL, when dest->alloc is 0.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1,
                           const re_node_set *src2)
 {
@@ -1060,7 +1063,7 @@ re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1,
     {
       Idx new_alloc = src1->nelem + src2->nelem + dest->alloc;
       Idx *new_elems = re_realloc (dest->elems, Idx, new_alloc);
-      if (BE (new_elems == NULL, 0))
+      if (__glibc_unlikely (new_elems == NULL))
        return REG_ESPACE;
       dest->elems = new_elems;
       dest->alloc = new_alloc;
@@ -1137,7 +1140,7 @@ re_node_set_add_intersect (re_node_set *dest, const re_node_set *src1,
    DEST. Return value indicate the error code or REG_NOERROR if succeeded.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_node_set_init_union (re_node_set *dest, const re_node_set *src1,
                        const re_node_set *src2)
 {
@@ -1146,7 +1149,7 @@ re_node_set_init_union (re_node_set *dest, const re_node_set *src1,
     {
       dest->alloc = src1->nelem + src2->nelem;
       dest->elems = re_malloc (Idx, dest->alloc);
-      if (BE (dest->elems == NULL, 0))
+      if (__glibc_unlikely (dest->elems == NULL))
        return REG_ESPACE;
     }
   else
@@ -1190,7 +1193,7 @@ re_node_set_init_union (re_node_set *dest, const re_node_set *src1,
    DEST. Return value indicate the error code or REG_NOERROR if succeeded.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_node_set_merge (re_node_set *dest, const re_node_set *src)
 {
   Idx is, id, sbase, delta;
@@ -1200,13 +1203,13 @@ re_node_set_merge (re_node_set *dest, const re_node_set *src)
     {
       Idx new_alloc = 2 * (src->nelem + dest->alloc);
       Idx *new_buffer = re_realloc (dest->elems, Idx, new_alloc);
-      if (BE (new_buffer == NULL, 0))
+      if (__glibc_unlikely (new_buffer == NULL))
        return REG_ESPACE;
       dest->elems = new_buffer;
       dest->alloc = new_alloc;
     }
 
-  if (BE (dest->nelem == 0, 0))
+  if (__glibc_unlikely (dest->nelem == 0))
     {
       dest->nelem = src->nelem;
       memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx));
@@ -1273,15 +1276,15 @@ re_node_set_merge (re_node_set *dest, const re_node_set *src)
    Return true if successful.  */
 
 static bool
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_node_set_insert (re_node_set *set, Idx elem)
 {
   Idx idx;
   /* In case the set is empty.  */
   if (set->alloc == 0)
-    return BE (re_node_set_init_1 (set, elem) == REG_NOERROR, 1);
+    return __glibc_likely (re_node_set_init_1 (set, elem) == REG_NOERROR);
 
-  if (BE (set->nelem, 0) == 0)
+  if (__glibc_unlikely (set->nelem) == 0)
     {
       /* We already guaranteed above that set->alloc != 0.  */
       set->elems[0] = elem;
@@ -1295,7 +1298,7 @@ re_node_set_insert (re_node_set *set, Idx elem)
       Idx *new_elems;
       set->alloc = set->alloc * 2;
       new_elems = re_realloc (set->elems, Idx, set->alloc);
-      if (BE (new_elems == NULL, 0))
+      if (__glibc_unlikely (new_elems == NULL))
        return false;
       set->elems = new_elems;
     }
@@ -1304,7 +1307,6 @@ re_node_set_insert (re_node_set *set, Idx elem)
      first element separately to skip a check in the inner loop.  */
   if (elem < set->elems[0])
     {
-      idx = 0;
       for (idx = set->nelem; idx > 0; idx--)
        set->elems[idx] = set->elems[idx - 1];
     }
@@ -1312,6 +1314,7 @@ re_node_set_insert (re_node_set *set, Idx elem)
     {
       for (idx = set->nelem; set->elems[idx - 1] > elem; idx--)
        set->elems[idx] = set->elems[idx - 1];
+      DEBUG_ASSERT (set->elems[idx - 1] < elem);
     }
 
   /* Insert the new element.  */
@@ -1325,7 +1328,7 @@ re_node_set_insert (re_node_set *set, Idx elem)
    Return true if successful.  */
 
 static bool
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_node_set_insert_last (re_node_set *set, Idx elem)
 {
   /* Realloc if we need.  */
@@ -1334,7 +1337,7 @@ re_node_set_insert_last (re_node_set *set, Idx elem)
       Idx *new_elems;
       set->alloc = (set->alloc + 1) * 2;
       new_elems = re_realloc (set->elems, Idx, set->alloc);
-      if (BE (new_elems == NULL, 0))
+      if (__glibc_unlikely (new_elems == NULL))
        return false;
       set->elems = new_elems;
     }
@@ -1348,7 +1351,7 @@ re_node_set_insert_last (re_node_set *set, Idx elem)
    Return true if SET1 and SET2 are equivalent.  */
 
 static bool
-internal_function __attribute__ ((pure))
+__attribute__ ((pure))
 re_node_set_compare (const re_node_set *set1, const re_node_set *set2)
 {
   Idx i;
@@ -1363,7 +1366,7 @@ re_node_set_compare (const re_node_set *set1, const re_node_set *set2)
 /* Return (idx + 1) if SET contains the element ELEM, return 0 otherwise.  */
 
 static Idx
-internal_function __attribute__ ((pure))
+__attribute__ ((pure))
 re_node_set_contains (const re_node_set *set, Idx elem)
 {
   __re_size_t idx, right, mid;
@@ -1385,7 +1388,6 @@ re_node_set_contains (const re_node_set *set, Idx elem)
 }
 
 static void
-internal_function
 re_node_set_remove_at (re_node_set *set, Idx idx)
 {
   if (idx < 0 || idx >= set->nelem)
@@ -1400,10 +1402,9 @@ re_node_set_remove_at (re_node_set *set, Idx idx)
    Or return -1 if an error occurred.  */
 
 static Idx
-internal_function
 re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
 {
-  if (BE (dfa->nodes_len >= dfa->nodes_alloc, 0))
+  if (__glibc_unlikely (dfa->nodes_len >= dfa->nodes_alloc))
     {
       size_t new_nodes_alloc = dfa->nodes_alloc * 2;
       Idx *new_nexts, *new_indices;
@@ -1414,19 +1415,20 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
       const size_t max_object_size = MAX (sizeof (re_token_t),
                                          MAX (sizeof (re_node_set),
                                               sizeof (Idx)));
-      if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < new_nodes_alloc, 0))
+      if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size)
+                           < new_nodes_alloc))
        return -1;
 
       new_nodes = re_realloc (dfa->nodes, re_token_t, new_nodes_alloc);
-      if (BE (new_nodes == NULL, 0))
+      if (__glibc_unlikely (new_nodes == NULL))
        return -1;
       dfa->nodes = new_nodes;
       new_nexts = re_realloc (dfa->nexts, Idx, new_nodes_alloc);
       new_indices = re_realloc (dfa->org_indices, Idx, new_nodes_alloc);
       new_edests = re_realloc (dfa->edests, re_node_set, new_nodes_alloc);
       new_eclosures = re_realloc (dfa->eclosures, re_node_set, new_nodes_alloc);
-      if (BE (new_nexts == NULL || new_indices == NULL
-             || new_edests == NULL || new_eclosures == NULL, 0))
+      if (__glibc_unlikely (new_nexts == NULL || new_indices == NULL
+                           || new_edests == NULL || new_eclosures == NULL))
        {
           re_free (new_nexts);
           re_free (new_indices);
@@ -1454,7 +1456,6 @@ re_dfa_add_node (re_dfa_t *dfa, re_token_t token)
 }
 
 static re_hashval_t
-internal_function
 calc_state_hash (const re_node_set *nodes, unsigned int context)
 {
   re_hashval_t hash = nodes->nelem + context;
@@ -1474,7 +1475,7 @@ calc_state_hash (const re_node_set *nodes, unsigned int context)
           optimization.  */
 
 static re_dfastate_t *
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa,
                  const re_node_set *nodes)
 {
@@ -1486,7 +1487,7 @@ re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa,
   /* Suppress bogus uninitialized-variable warnings.  */
   *err = REG_NOERROR;
 #endif
-  if (BE (nodes->nelem == 0, 0))
+  if (__glibc_unlikely (nodes->nelem == 0))
     {
       *err = REG_NOERROR;
       return NULL;
@@ -1505,7 +1506,7 @@ re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa,
 
   /* There are no appropriate state in the dfa, create the new one.  */
   new_state = create_ci_newstate (dfa, nodes, hash);
-  if (BE (new_state == NULL, 0))
+  if (__glibc_unlikely (new_state == NULL))
     *err = REG_ESPACE;
 
   return new_state;
@@ -1522,7 +1523,7 @@ re_acquire_state (reg_errcode_t *err, const re_dfa_t *dfa,
           optimization.  */
 
 static re_dfastate_t *
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa,
                          const re_node_set *nodes, unsigned int context)
 {
@@ -1552,7 +1553,7 @@ re_acquire_state_context (reg_errcode_t *err, const re_dfa_t *dfa,
     }
   /* There are no appropriate state in 'dfa', create the new one.  */
   new_state = create_cd_newstate (dfa, nodes, context, hash);
-  if (BE (new_state == NULL, 0))
+  if (__glibc_unlikely (new_state == NULL))
     *err = REG_ESPACE;
 
   return new_state;
@@ -1573,7 +1574,7 @@ register_state (const re_dfa_t *dfa, re_dfastate_t *newstate,
 
   newstate->hash = hash;
   err = re_node_set_alloc (&newstate->non_eps_nodes, newstate->nodes.nelem);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     return REG_ESPACE;
   for (i = 0; i < newstate->nodes.nelem; i++)
     {
@@ -1584,12 +1585,12 @@ register_state (const re_dfa_t *dfa, re_dfastate_t *newstate,
     }
 
   spot = dfa->state_table + (hash & dfa->state_hash_mask);
-  if (BE (spot->alloc <= spot->num, 0))
+  if (__glibc_unlikely (spot->alloc <= spot->num))
     {
       Idx new_alloc = 2 * spot->num + 2;
       re_dfastate_t **new_array = re_realloc (spot->array, re_dfastate_t *,
                                              new_alloc);
-      if (BE (new_array == NULL, 0))
+      if (__glibc_unlikely (new_array == NULL))
        return REG_ESPACE;
       spot->array = new_array;
       spot->alloc = new_alloc;
@@ -1618,7 +1619,7 @@ free_state (re_dfastate_t *state)
    Return the new state if succeeded, otherwise return NULL.  */
 
 static re_dfastate_t *
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
                    re_hashval_t hash)
 {
@@ -1627,10 +1628,10 @@ create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
   re_dfastate_t *newstate;
 
   newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1);
-  if (BE (newstate == NULL, 0))
+  if (__glibc_unlikely (newstate == NULL))
     return NULL;
   err = re_node_set_init_copy (&newstate->nodes, nodes);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     {
       re_free (newstate);
       return NULL;
@@ -1656,7 +1657,7 @@ create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
        newstate->has_constraint = 1;
     }
   err = register_state (dfa, newstate, hash);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     {
       free_state (newstate);
       newstate = NULL;
@@ -1668,7 +1669,7 @@ create_ci_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
    Return the new state if succeeded, otherwise return NULL.  */
 
 static re_dfastate_t *
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
                    unsigned int context, re_hashval_t hash)
 {
@@ -1677,10 +1678,10 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
   re_dfastate_t *newstate;
 
   newstate = (re_dfastate_t *) calloc (sizeof (re_dfastate_t), 1);
-  if (BE (newstate == NULL, 0))
+  if (__glibc_unlikely (newstate == NULL))
     return NULL;
   err = re_node_set_init_copy (&newstate->nodes, nodes);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     {
       re_free (newstate);
       return NULL;
@@ -1711,15 +1712,19 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
        {
          if (newstate->entrance_nodes == &newstate->nodes)
            {
-             newstate->entrance_nodes = re_malloc (re_node_set, 1);
-             if (BE (newstate->entrance_nodes == NULL, 0))
+             re_node_set *entrance_nodes = re_malloc (re_node_set, 1);
+             if (__glibc_unlikely (entrance_nodes == NULL))
                {
                  free_state (newstate);
                  return NULL;
                }
+             newstate->entrance_nodes = entrance_nodes;
              if (re_node_set_init_copy (newstate->entrance_nodes, nodes)
                  != REG_NOERROR)
-               return NULL;
+               {
+                 free_state (newstate);
+                 return NULL;
+               }
              nctx_nodes = 0;
              newstate->has_constraint = 1;
            }
@@ -1732,7 +1737,7 @@ create_cd_newstate (const re_dfa_t *dfa, const re_node_set *nodes,
        }
     }
   err = register_state (dfa, newstate, hash);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     {
       free_state (newstate);
       newstate = NULL;
index b61c638..affc4fe 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
 
    You should have received a copy of the GNU General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #ifndef _REGEX_INTERNAL_H
 #define _REGEX_INTERNAL_H 1
 
-#include <assert.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdbool.h>
 #include <stdint.h>
 
-#include "intprops.h"
+#ifndef _LIBC
+# include <dynarray.h>
+#endif
+
+#include <intprops.h>
+#include <verify.h>
+
+#if defined DEBUG && DEBUG != 0
+# include <assert.h>
+# define DEBUG_ASSERT(x) assert (x)
+#else
+# define DEBUG_ASSERT(x) assume (x)
+#endif
 
 #ifdef _LIBC
 # include <libc-lock.h>
 # define lock_define(name) __libc_lock_define (, name)
 # define lock_init(lock) (__libc_lock_init (lock), 0)
-# define lock_fini(lock) 0
+# define lock_fini(lock) ((void) 0)
 # define lock_lock(lock) __libc_lock_lock (lock)
 # define lock_unlock(lock) __libc_lock_unlock (lock)
-#elif defined GNULIB_LOCK && !defined USE_UNLOCKED_IO
+#elif defined GNULIB_LOCK && !defined GNULIB_REGEX_SINGLE_THREAD
 # include "glthread/lock.h"
-  /* Use gl_lock_define if empty macro arguments are known to work.
-     Otherwise, fall back on less-portable substitutes.  */
-# if ((defined __GNUC__ && !defined __STRICT_ANSI__) \
-      || (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__))
-#  define lock_define(name) gl_lock_define (, name)
-# elif USE_POSIX_THREADS
-#  define lock_define(name) pthread_mutex_t name;
-# elif USE_PTH_THREADS
-#  define lock_define(name) pth_mutex_t name;
-# elif USE_SOLARIS_THREADS
-#  define lock_define(name) mutex_t name;
-# elif USE_WINDOWS_THREADS
-#  define lock_define(name) gl_lock_t name;
-# else
-#  define lock_define(name)
-# endif
+# define lock_define(name) gl_lock_define (, name)
 # define lock_init(lock) glthread_lock_init (&(lock))
 # define lock_fini(lock) glthread_lock_destroy (&(lock))
 # define lock_lock(lock) glthread_lock_lock (&(lock))
 # define lock_unlock(lock) glthread_lock_unlock (&(lock))
-#elif defined GNULIB_PTHREAD && !defined USE_UNLOCKED_IO
+#elif defined GNULIB_PTHREAD && !defined GNULIB_REGEX_SINGLE_THREAD
 # include <pthread.h>
 # define lock_define(name) pthread_mutex_t name;
 # define lock_init(lock) pthread_mutex_init (&(lock), 0)
 # define isblank(ch) ((ch) == ' ' || (ch) == '\t')
 #endif
 
+/* regex code assumes isascii has its usual numeric meaning,
+   even if the portable character set uses EBCDIC encoding,
+   and even if wint_t is wider than int.  */
+#ifndef _LIBC
+# undef isascii
+# define isascii(c) (((c) & ~0x7f) == 0)
+#endif
+
 #ifdef _LIBC
 # ifndef _RE_DEFINE_LOCALE_FUNCTIONS
 #  define _RE_DEFINE_LOCALE_FUNCTIONS 1
   __dcgettext (_libc_intl_domainname, msgid, LC_MESSAGES)
 # endif
 #else
+# undef gettext
 # define gettext(msgid) (msgid)
 #endif
 
 # define RE_ENABLE_I18N
 #endif
 
-#define BE(expr, val) __builtin_expect (expr, val)
-
 /* Number of ASCII characters.  */
 #define ASCII_CHARS 0x80
 
 /* Rename to standard API for using out of glibc.  */
 #ifndef _LIBC
 # undef __wctype
+# undef __iswalnum
 # undef __iswctype
+# undef __towlower
+# undef __towupper
 # define __wctype wctype
 # define __iswalnum iswalnum
 # define __iswctype iswctype
 # define __mbrtowc mbrtowc
 # define __wcrtomb wcrtomb
 # define __regfree regfree
-# define attribute_hidden
 #endif /* not _LIBC */
 
-#if __GNUC__ < 3 + (__GNUC_MINOR__ < 1)
-# define __attribute__(arg)
-#endif
-
 #ifndef SSIZE_MAX
 # define SSIZE_MAX ((ssize_t) (SIZE_MAX / 2))
 #endif
+#ifndef ULONG_WIDTH
+# define ULONG_WIDTH REGEX_UINTEGER_WIDTH (ULONG_MAX)
+/* The number of usable bits in an unsigned integer type with maximum
+   value MAX, as an int expression suitable in #if.  Cover all known
+   practical hosts.  This implementation exploits the fact that MAX is
+   1 less than a power of 2, and merely counts the number of 1 bits in
+   MAX; "COBn" means "count the number of 1 bits in the low-order n bits".  */
+# define REGEX_UINTEGER_WIDTH(max) REGEX_COB128 (max)
+# define REGEX_COB128(n) (REGEX_COB64 ((n) >> 31 >> 31 >> 2) + REGEX_COB64 (n))
+# define REGEX_COB64(n) (REGEX_COB32 ((n) >> 31 >> 1) + REGEX_COB32 (n))
+# define REGEX_COB32(n) (REGEX_COB16 ((n) >> 16) + REGEX_COB16 (n))
+# define REGEX_COB16(n) (REGEX_COB8 ((n) >> 8) + REGEX_COB8 (n))
+# define REGEX_COB8(n) (REGEX_COB4 ((n) >> 4) + REGEX_COB4 (n))
+# define REGEX_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + ((n) & 1))
+# if ULONG_MAX / 2 + 1 != 1ul << (ULONG_WIDTH - 1)
+#  error "ULONG_MAX out of range"
+# endif
+#endif
 
 /* The type of indexes into strings.  This is signed, not size_t,
    since the API requires indexes to fit in regoff_t anyway, and using
@@ -175,36 +194,8 @@ typedef __re_size_t re_hashval_t;
 typedef unsigned long int bitset_word_t;
 /* All bits set in a bitset_word_t.  */
 #define BITSET_WORD_MAX ULONG_MAX
-
-/* Number of bits in a bitset_word_t.  For portability to hosts with
-   padding bits, do not use '(sizeof (bitset_word_t) * CHAR_BIT)';
-   instead, deduce it directly from BITSET_WORD_MAX.  Avoid
-   greater-than-32-bit integers and unconditional shifts by more than
-   31 bits, as they're not portable.  */
-#if BITSET_WORD_MAX == 0xffffffffUL
-# define BITSET_WORD_BITS 32
-#elif BITSET_WORD_MAX >> 31 >> 4 == 1
-# define BITSET_WORD_BITS 36
-#elif BITSET_WORD_MAX >> 31 >> 16 == 1
-# define BITSET_WORD_BITS 48
-#elif BITSET_WORD_MAX >> 31 >> 28 == 1
-# define BITSET_WORD_BITS 60
-#elif BITSET_WORD_MAX >> 31 >> 31 >> 1 == 1
-# define BITSET_WORD_BITS 64
-#elif BITSET_WORD_MAX >> 31 >> 31 >> 9 == 1
-# define BITSET_WORD_BITS 72
-#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 3 == 1
-# define BITSET_WORD_BITS 128
-#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 7 == 1
-# define BITSET_WORD_BITS 256
-#elif BITSET_WORD_MAX >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 31 >> 7 > 1
-# define BITSET_WORD_BITS 257 /* any value > SBC_MAX will do here */
-# if BITSET_WORD_BITS <= SBC_MAX
-#  error "Invalid SBC_MAX"
-# endif
-#else
-# error "Add case for new bitset_word_t size"
-#endif
+/* Number of bits in a bitset_word_t.  */
+#define BITSET_WORD_BITS ULONG_WIDTH
 
 /* Number of bitset_word_t values in a bitset_t.  */
 #define BITSET_WORDS ((SBC_MAX + BITSET_WORD_BITS - 1) / BITSET_WORD_BITS)
@@ -356,7 +347,7 @@ typedef struct
     Idx idx;                   /* for BACK_REF */
     re_context_type ctx_type;  /* for ANCHOR */
   } opr;
-#if __GNUC__ >= 2 && !defined __STRICT_ANSI__
+#if (__GNUC__ >= 2 || defined __clang__) && !defined __STRICT_ANSI__
   re_token_type_t type : 8;
 #else
   re_token_type_t type;
@@ -437,24 +428,9 @@ struct re_dfa_t;
 typedef struct re_dfa_t re_dfa_t;
 
 #ifndef _LIBC
-# define internal_function
 # define IS_IN(libc) false
 #endif
 
-static reg_errcode_t re_string_realloc_buffers (re_string_t *pstr,
-                                               Idx new_buf_len)
-     internal_function;
-#ifdef RE_ENABLE_I18N
-static void build_wcs_buffer (re_string_t *pstr) internal_function;
-static reg_errcode_t build_wcs_upper_buffer (re_string_t *pstr)
-  internal_function;
-#endif /* RE_ENABLE_I18N */
-static void build_upper_buffer (re_string_t *pstr) internal_function;
-static void re_string_translate_buffer (re_string_t *pstr) internal_function;
-static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
-                                         int eflags)
-     internal_function __attribute__ ((pure));
-
 #define re_string_peek_byte(pstr, offset) \
   ((pstr)->mbs[(pstr)->cur_idx + offset])
 #define re_string_fetch_byte(pstr) \
@@ -472,25 +448,6 @@ static unsigned int re_string_context_at (const re_string_t *input, Idx idx,
 #define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx))
 #define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx))
 
-#if defined _LIBC || HAVE_ALLOCA
-# include <alloca.h>
-#endif
-
-#ifndef _LIBC
-# if HAVE_ALLOCA
-/* The OS usually guarantees only one guard page at the bottom of the stack,
-   and a page size can be as small as 4096 bytes.  So we cannot safely
-   allocate anything larger than 4096 bytes.  Also care for the possibility
-   of a few compiler-allocated temporary stack slots.  */
-#  define __libc_use_alloca(n) ((n) < 4032)
-# else
-/* alloca is implemented with malloc, so just use malloc.  */
-#  define __libc_use_alloca(n) 0
-#  undef alloca
-#  define alloca(n) malloc (n)
-# endif
-#endif
-
 #ifdef _LIBC
 # define MALLOC_0_IS_NONNULL 1
 #elif !defined MALLOC_0_IS_NONNULL
@@ -627,20 +584,15 @@ struct re_backref_cache_entry
   Idx str_idx;
   Idx subexp_from;
   Idx subexp_to;
+  bitset_word_t eps_reachable_subexps_map;
   char more;
-  char unused;
-  unsigned short int eps_reachable_subexps_map;
 };
 
 typedef struct
 {
   /* The string object corresponding to the input string.  */
   re_string_t input;
-#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
   const re_dfa_t *const dfa;
-#else
-  const re_dfa_t *dfa;
-#endif
   /* EFLAGS of the argument of regexec.  */
   int eflags;
   /* Where the matching ends.  */
@@ -760,31 +712,31 @@ typedef struct
 
 /* Functions for bitset_t operation.  */
 
-static void
+static inline void
 bitset_set (bitset_t set, Idx i)
 {
   set[i / BITSET_WORD_BITS] |= (bitset_word_t) 1 << i % BITSET_WORD_BITS;
 }
 
-static void
+static inline void
 bitset_clear (bitset_t set, Idx i)
 {
   set[i / BITSET_WORD_BITS] &= ~ ((bitset_word_t) 1 << i % BITSET_WORD_BITS);
 }
 
-static bool
+static inline bool
 bitset_contain (const bitset_t set, Idx i)
 {
   return (set[i / BITSET_WORD_BITS] >> i % BITSET_WORD_BITS) & 1;
 }
 
-static void
+static inline void
 bitset_empty (bitset_t set)
 {
   memset (set, '\0', sizeof (bitset_t));
 }
 
-static void
+static inline void
 bitset_set_all (bitset_t set)
 {
   memset (set, -1, sizeof (bitset_word_t) * (SBC_MAX / BITSET_WORD_BITS));
@@ -793,13 +745,13 @@ bitset_set_all (bitset_t set)
       ((bitset_word_t) 1 << SBC_MAX % BITSET_WORD_BITS) - 1;
 }
 
-static void
+static inline void
 bitset_copy (bitset_t dest, const bitset_t src)
 {
   memcpy (dest, src, sizeof (bitset_t));
 }
 
-static void __attribute__ ((unused))
+static inline void
 bitset_not (bitset_t set)
 {
   int bitset_i;
@@ -811,7 +763,7 @@ bitset_not (bitset_t set)
        & ~set[BITSET_WORDS - 1]);
 }
 
-static void __attribute__ ((unused))
+static inline void
 bitset_merge (bitset_t dest, const bitset_t src)
 {
   int bitset_i;
@@ -819,7 +771,7 @@ bitset_merge (bitset_t dest, const bitset_t src)
     dest[bitset_i] |= src[bitset_i];
 }
 
-static void __attribute__ ((unused))
+static inline void
 bitset_mask (bitset_t dest, const bitset_t src)
 {
   int bitset_i;
@@ -830,7 +782,7 @@ bitset_mask (bitset_t dest, const bitset_t src)
 #ifdef RE_ENABLE_I18N
 /* Functions for re_string.  */
 static int
-internal_function __attribute__ ((pure, unused))
+__attribute__ ((pure, unused))
 re_string_char_size_at (const re_string_t *pstr, Idx idx)
 {
   int byte_idx;
@@ -843,7 +795,7 @@ re_string_char_size_at (const re_string_t *pstr, Idx idx)
 }
 
 static wint_t
-internal_function __attribute__ ((pure, unused))
+__attribute__ ((pure, unused))
 re_string_wchar_at (const re_string_t *pstr, Idx idx)
 {
   if (pstr->mb_cur_max == 1)
@@ -856,7 +808,7 @@ re_string_wchar_at (const re_string_t *pstr, Idx idx)
 # endif
 
 static int
-internal_function __attribute__ ((pure, unused))
+__attribute__ ((pure, unused))
 re_string_elem_size_at (const re_string_t *pstr, Idx idx)
 {
 # ifdef _LIBC
@@ -881,21 +833,14 @@ re_string_elem_size_at (const re_string_t *pstr, Idx idx)
 }
 #endif /* RE_ENABLE_I18N */
 
-#ifndef __GNUC_PREREQ
-# if defined __GNUC__ && defined __GNUC_MINOR__
-#  define __GNUC_PREREQ(maj, min) \
-         ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#ifdef _LIBC
+# if __GNUC__ >= 7
+#  define FALLTHROUGH __attribute__ ((__fallthrough__))
 # else
-#  define __GNUC_PREREQ(maj, min) 0
+#  define FALLTHROUGH ((void) 0)
 # endif
-#endif
-
-#if __GNUC_PREREQ (3,4)
-# undef __attribute_warn_unused_result__
-# define __attribute_warn_unused_result__ \
-   __attribute__ ((__warn_unused_result__))
 #else
-# define __attribute_warn_unused_result__ /* empty */
+# include "attribute.h"
 #endif
 
 #endif /*  _REGEX_INTERNAL_H */
index 895db82..35087ac 100644 (file)
@@ -1,5 +1,5 @@
 /* Extended regular expression matching and search library.
-   Copyright (C) 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
 
 
    You should have received a copy of the GNU General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 static reg_errcode_t match_ctx_init (re_match_context_t *cache, int eflags,
-                                    Idx n) internal_function;
-static void match_ctx_clean (re_match_context_t *mctx) internal_function;
-static void match_ctx_free (re_match_context_t *cache) internal_function;
+                                    Idx n);
+static void match_ctx_clean (re_match_context_t *mctx);
+static void match_ctx_free (re_match_context_t *cache);
 static reg_errcode_t match_ctx_add_entry (re_match_context_t *cache, Idx node,
-                                         Idx str_idx, Idx from, Idx to)
-     internal_function;
-static Idx search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
-     internal_function;
+                                         Idx str_idx, Idx from, Idx to);
+static Idx search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx);
 static reg_errcode_t match_ctx_add_subtop (re_match_context_t *mctx, Idx node,
-                                          Idx str_idx) internal_function;
+                                          Idx str_idx);
 static re_sub_match_last_t * match_ctx_add_sublast (re_sub_match_top_t *subtop,
-                                                   Idx node, Idx str_idx)
-     internal_function;
+                                                   Idx node, Idx str_idx);
 static void sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts,
                           re_dfastate_t **limited_sts, Idx last_node,
-                          Idx last_str_idx)
-     internal_function;
+                          Idx last_str_idx);
 static reg_errcode_t re_search_internal (const regex_t *preg,
                                         const char *string, Idx length,
                                         Idx start, Idx last_start, Idx stop,
                                         size_t nmatch, regmatch_t pmatch[],
-                                        int eflags) internal_function;
+                                        int eflags);
 static regoff_t re_search_2_stub (struct re_pattern_buffer *bufp,
                                  const char *string1, Idx length1,
                                  const char *string2, Idx length2,
                                  Idx start, regoff_t range,
                                  struct re_registers *regs,
-                                 Idx stop, bool ret_len) internal_function;
+                                 Idx stop, bool ret_len);
 static regoff_t re_search_stub (struct re_pattern_buffer *bufp,
                                const char *string, Idx length, Idx start,
                                regoff_t range, Idx stop,
                                struct re_registers *regs,
-                               bool ret_len) internal_function;
+                               bool ret_len);
 static unsigned re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
-                              Idx nregs, int regs_allocated) internal_function;
-static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx)
-     internal_function;
+                              Idx nregs, int regs_allocated);
+static reg_errcode_t prune_impossible_nodes (re_match_context_t *mctx);
 static Idx check_matching (re_match_context_t *mctx, bool fl_longest_match,
-                          Idx *p_match_first) internal_function;
+                          Idx *p_match_first);
 static Idx check_halt_state_context (const re_match_context_t *mctx,
-                                    const re_dfastate_t *state, Idx idx)
-     internal_function;
+                                    const re_dfastate_t *state, Idx idx);
 static void update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
                         regmatch_t *prev_idx_match, Idx cur_node,
-                        Idx cur_idx, Idx nmatch) internal_function;
+                        Idx cur_idx, Idx nmatch);
 static reg_errcode_t push_fail_stack (struct re_fail_stack_t *fs,
                                      Idx str_idx, Idx dest_node, Idx nregs,
-                                     regmatch_t *regs,
-                                     re_node_set *eps_via_nodes)
-     internal_function;
+                                     regmatch_t *regs, regmatch_t *prevregs,
+                                     re_node_set *eps_via_nodes);
 static reg_errcode_t set_regs (const regex_t *preg,
                               const re_match_context_t *mctx,
                               size_t nmatch, regmatch_t *pmatch,
-                              bool fl_backtrack) internal_function;
-static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs)
-     internal_function;
+                              bool fl_backtrack);
+static reg_errcode_t free_fail_stack_return (struct re_fail_stack_t *fs);
 
 #ifdef RE_ENABLE_I18N
 static int sift_states_iter_mb (const re_match_context_t *mctx,
                                re_sift_context_t *sctx,
-                               Idx node_idx, Idx str_idx, Idx max_str_idx)
-     internal_function;
+                               Idx node_idx, Idx str_idx, Idx max_str_idx);
 #endif /* RE_ENABLE_I18N */
 static reg_errcode_t sift_states_backward (const re_match_context_t *mctx,
-                                          re_sift_context_t *sctx)
-     internal_function;
+                                          re_sift_context_t *sctx);
 static reg_errcode_t build_sifted_states (const re_match_context_t *mctx,
                                          re_sift_context_t *sctx, Idx str_idx,
-                                         re_node_set *cur_dest)
-     internal_function;
+                                         re_node_set *cur_dest);
 static reg_errcode_t update_cur_sifted_state (const re_match_context_t *mctx,
                                              re_sift_context_t *sctx,
                                              Idx str_idx,
-                                             re_node_set *dest_nodes)
-     internal_function;
+                                             re_node_set *dest_nodes);
 static reg_errcode_t add_epsilon_src_nodes (const re_dfa_t *dfa,
                                            re_node_set *dest_nodes,
-                                           const re_node_set *candidates)
-     internal_function;
+                                           const re_node_set *candidates);
 static bool check_dst_limits (const re_match_context_t *mctx,
                              const re_node_set *limits,
                              Idx dst_node, Idx dst_idx, Idx src_node,
-                             Idx src_idx) internal_function;
+                             Idx src_idx);
 static int check_dst_limits_calc_pos_1 (const re_match_context_t *mctx,
                                        int boundaries, Idx subexp_idx,
-                                       Idx from_node, Idx bkref_idx)
-     internal_function;
+                                       Idx from_node, Idx bkref_idx);
 static int check_dst_limits_calc_pos (const re_match_context_t *mctx,
                                      Idx limit, Idx subexp_idx,
                                      Idx node, Idx str_idx,
-                                     Idx bkref_idx) internal_function;
+                                     Idx bkref_idx);
 static reg_errcode_t check_subexp_limits (const re_dfa_t *dfa,
                                          re_node_set *dest_nodes,
                                          const re_node_set *candidates,
                                          re_node_set *limits,
                                          struct re_backref_cache_entry *bkref_ents,
-                                         Idx str_idx) internal_function;
+                                         Idx str_idx);
 static reg_errcode_t sift_states_bkref (const re_match_context_t *mctx,
                                        re_sift_context_t *sctx,
-                                       Idx str_idx, const re_node_set *candidates)
-     internal_function;
+                                       Idx str_idx, const re_node_set *candidates);
 static reg_errcode_t merge_state_array (const re_dfa_t *dfa,
                                        re_dfastate_t **dst,
-                                       re_dfastate_t **src, Idx num)
-     internal_function;
+                                       re_dfastate_t **src, Idx num);
 static re_dfastate_t *find_recover_state (reg_errcode_t *err,
-                                        re_match_context_t *mctx) internal_function;
+                                        re_match_context_t *mctx);
 static re_dfastate_t *transit_state (reg_errcode_t *err,
                                     re_match_context_t *mctx,
-                                    re_dfastate_t *state) internal_function;
+                                    re_dfastate_t *state);
 static re_dfastate_t *merge_state_with_log (reg_errcode_t *err,
                                            re_match_context_t *mctx,
-                                           re_dfastate_t *next_state)
-     internal_function;
+                                           re_dfastate_t *next_state);
 static reg_errcode_t check_subexp_matching_top (re_match_context_t *mctx,
                                                re_node_set *cur_nodes,
-                                               Idx str_idx) internal_function;
+                                               Idx str_idx);
 #if 0
 static re_dfastate_t *transit_state_sb (reg_errcode_t *err,
                                        re_match_context_t *mctx,
-                                       re_dfastate_t *pstate)
-     internal_function;
+                                       re_dfastate_t *pstate);
 #endif
 #ifdef RE_ENABLE_I18N
 static reg_errcode_t transit_state_mb (re_match_context_t *mctx,
-                                      re_dfastate_t *pstate)
-     internal_function;
+                                      re_dfastate_t *pstate);
 #endif /* RE_ENABLE_I18N */
 static reg_errcode_t transit_state_bkref (re_match_context_t *mctx,
-                                         const re_node_set *nodes)
-     internal_function;
+                                         const re_node_set *nodes);
 static reg_errcode_t get_subexp (re_match_context_t *mctx,
-                                Idx bkref_node, Idx bkref_str_idx)
-     internal_function;
+                                Idx bkref_node, Idx bkref_str_idx);
 static reg_errcode_t get_subexp_sub (re_match_context_t *mctx,
                                     const re_sub_match_top_t *sub_top,
                                     re_sub_match_last_t *sub_last,
-                                    Idx bkref_node, Idx bkref_str)
-     internal_function;
+                                    Idx bkref_node, Idx bkref_str);
 static Idx find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
-                            Idx subexp_idx, int type) internal_function;
+                            Idx subexp_idx, int type);
 static reg_errcode_t check_arrival (re_match_context_t *mctx,
                                    state_array_t *path, Idx top_node,
                                    Idx top_str, Idx last_node, Idx last_str,
-                                   int type) internal_function;
+                                   int type);
 static reg_errcode_t check_arrival_add_next_nodes (re_match_context_t *mctx,
                                                   Idx str_idx,
                                                   re_node_set *cur_nodes,
-                                                  re_node_set *next_nodes)
-     internal_function;
+                                                  re_node_set *next_nodes);
 static reg_errcode_t check_arrival_expand_ecl (const re_dfa_t *dfa,
                                               re_node_set *cur_nodes,
-                                              Idx ex_subexp, int type)
-     internal_function;
+                                              Idx ex_subexp, int type);
 static reg_errcode_t check_arrival_expand_ecl_sub (const re_dfa_t *dfa,
                                                   re_node_set *dst_nodes,
                                                   Idx target, Idx ex_subexp,
-                                                  int type) internal_function;
+                                                  int type);
 static reg_errcode_t expand_bkref_cache (re_match_context_t *mctx,
                                         re_node_set *cur_nodes, Idx cur_str,
-                                        Idx subexp_num, int type)
-     internal_function;
-static bool build_trtable (const re_dfa_t *dfa,
-                          re_dfastate_t *state) internal_function;
+                                        Idx subexp_num, int type);
+static bool build_trtable (const re_dfa_t *dfa, re_dfastate_t *state);
 #ifdef RE_ENABLE_I18N
 static int check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
-                                   const re_string_t *input, Idx idx)
-     internal_function;
+                                   const re_string_t *input, Idx idx);
 # ifdef _LIBC
 static unsigned int find_collation_sequence_value (const unsigned char *mbs,
-                                                  size_t name_len)
-     internal_function;
+                                                  size_t name_len);
 # endif /* _LIBC */
 #endif /* RE_ENABLE_I18N */
 static Idx group_nodes_into_DFAstates (const re_dfa_t *dfa,
                                       const re_dfastate_t *state,
                                       re_node_set *states_node,
-                                      bitset_t *states_ch) internal_function;
+                                      bitset_t *states_ch);
 static bool check_node_accept (const re_match_context_t *mctx,
-                              const re_token_t *node, Idx idx)
-     internal_function;
-static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len)
-     internal_function;
+                              const re_token_t *node, Idx idx);
+static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len);
 \f
 /* Entry point for POSIX code.  */
 
@@ -216,10 +186,11 @@ static reg_errcode_t extend_buffers (re_match_context_t *mctx, int min_len)
    REG_NOTBOL is set, then ^ does not match at the beginning of the
    string; if REG_NOTEOL is set, then $ does not match at the end.
 
-   We return 0 if we find a match and REG_NOMATCH if not.  */
+   Return 0 if a match is found, REG_NOMATCH if not, REG_BADPAT if
+   EFLAGS is invalid.  */
 
 int
-regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string,
+regexec (const regex_t *__restrict preg, const char *__restrict string,
         size_t nmatch, regmatch_t pmatch[], int eflags)
 {
   reg_errcode_t err;
@@ -252,6 +223,8 @@ regexec (const regex_t *_Restrict_ preg, const char *_Restrict_ string,
 }
 
 #ifdef _LIBC
+libc_hidden_def (__regexec)
+
 # include <shlib-compat.h>
 versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
 
@@ -260,8 +233,8 @@ __typeof__ (__regexec) __compat_regexec;
 
 int
 attribute_compat_text_section
-__compat_regexec (const regex_t *_Restrict_ preg,
-                 const char *_Restrict_ string, size_t nmatch,
+__compat_regexec (const regex_t *__restrict preg,
+                 const char *__restrict string, size_t nmatch,
                  regmatch_t pmatch[], int eflags)
 {
   return regexec (preg, string, nmatch, pmatch,
@@ -297,8 +270,8 @@ compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0);
    strings.)
 
    On success, re_match* functions return the length of the match, re_search*
-   return the position of the start of the match.  Return value -1 means no
-   match was found and -2 indicates an internal error.  */
+   return the position of the start of the match.  They return -1 on
+   match failure, -2 on error.  */
 
 regoff_t
 re_match (struct re_pattern_buffer *bufp, const char *string, Idx length,
@@ -346,7 +319,6 @@ weak_alias (__re_search_2, re_search_2)
 #endif
 
 static regoff_t
-internal_function
 re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1,
                  Idx length1, const char *string2, Idx length2, Idx start,
                  regoff_t range, struct re_registers *regs,
@@ -357,9 +329,8 @@ re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1,
   Idx len;
   char *s = NULL;
 
-  if (BE ((length1 < 0 || length2 < 0 || stop < 0
-           || INT_ADD_WRAPV (length1, length2, &len)),
-          0))
+  if (__glibc_unlikely ((length1 < 0 || length2 < 0 || stop < 0
+                        || INT_ADD_WRAPV (length1, length2, &len))))
     return -2;
 
   /* Concatenate the strings.  */
@@ -368,7 +339,7 @@ re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1,
       {
        s = re_malloc (char, len);
 
-       if (BE (s == NULL, 0))
+       if (__glibc_unlikely (s == NULL))
          return -2;
 #ifdef _LIBC
        memcpy (__mempcpy (s, string1, length1), string2, length2);
@@ -395,7 +366,6 @@ re_search_2_stub (struct re_pattern_buffer *bufp, const char *string1,
    otherwise the position of the match is returned.  */
 
 static regoff_t
-internal_function
 re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length,
                Idx start, regoff_t range, Idx stop, struct re_registers *regs,
                bool ret_len)
@@ -409,11 +379,13 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length,
   Idx last_start = start + range;
 
   /* Check for out-of-range.  */
-  if (BE (start < 0 || start > length, 0))
+  if (__glibc_unlikely (start < 0 || start > length))
     return -1;
-  if (BE (length < last_start || (0 <= range && last_start < start), 0))
+  if (__glibc_unlikely (length < last_start
+                       || (0 <= range && last_start < start)))
     last_start = length;
-  else if (BE (last_start < 0 || (range < 0 && start <= last_start), 0))
+  else if (__glibc_unlikely (last_start < 0
+                            || (range < 0 && start <= last_start)))
     last_start = 0;
 
   lock_lock (dfa->lock);
@@ -425,17 +397,17 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length,
   if (start < last_start && bufp->fastmap != NULL && !bufp->fastmap_accurate)
     re_compile_fastmap (bufp);
 
-  if (BE (bufp->no_sub, 0))
+  if (__glibc_unlikely (bufp->no_sub))
     regs = NULL;
 
   /* We need at least 1 register.  */
   if (regs == NULL)
     nregs = 1;
-  else if (BE (bufp->regs_allocated == REGS_FIXED
-              && regs->num_regs <= bufp->re_nsub, 0))
+  else if (__glibc_unlikely (bufp->regs_allocated == REGS_FIXED
+                            && regs->num_regs <= bufp->re_nsub))
     {
       nregs = regs->num_regs;
-      if (BE (nregs < 1, 0))
+      if (__glibc_unlikely (nregs < 1))
        {
          /* Nothing can be copied to regs.  */
          regs = NULL;
@@ -445,7 +417,7 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length,
   else
     nregs = bufp->re_nsub + 1;
   pmatch = re_malloc (regmatch_t, nregs);
-  if (BE (pmatch == NULL, 0))
+  if (__glibc_unlikely (pmatch == NULL))
     {
       rval = -2;
       goto out;
@@ -464,15 +436,15 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length,
       /* If caller wants register contents data back, copy them.  */
       bufp->regs_allocated = re_copy_regs (regs, pmatch, nregs,
                                           bufp->regs_allocated);
-      if (BE (bufp->regs_allocated == REGS_UNALLOCATED, 0))
+      if (__glibc_unlikely (bufp->regs_allocated == REGS_UNALLOCATED))
        rval = -2;
     }
 
-  if (BE (rval == 0, 1))
+  if (__glibc_likely (rval == 0))
     {
       if (ret_len)
        {
-         assert (pmatch[0].rm_so == start);
+         DEBUG_ASSERT (pmatch[0].rm_so == start);
          rval = pmatch[0].rm_eo - start;
        }
       else
@@ -485,7 +457,6 @@ re_search_stub (struct re_pattern_buffer *bufp, const char *string, Idx length,
 }
 
 static unsigned
-internal_function
 re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs,
              int regs_allocated)
 {
@@ -499,10 +470,10 @@ re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs,
   if (regs_allocated == REGS_UNALLOCATED)
     { /* No.  So allocate them with malloc.  */
       regs->start = re_malloc (regoff_t, need_regs);
-      if (BE (regs->start == NULL, 0))
+      if (__glibc_unlikely (regs->start == NULL))
        return REGS_UNALLOCATED;
       regs->end = re_malloc (regoff_t, need_regs);
-      if (BE (regs->end == NULL, 0))
+      if (__glibc_unlikely (regs->end == NULL))
        {
          re_free (regs->start);
          return REGS_UNALLOCATED;
@@ -513,14 +484,14 @@ re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs,
     { /* Yes.  If we need more elements than were already
         allocated, reallocate them.  If we need fewer, just
         leave it alone.  */
-      if (BE (need_regs > regs->num_regs, 0))
+      if (__glibc_unlikely (need_regs > regs->num_regs))
        {
          regoff_t *new_start = re_realloc (regs->start, regoff_t, need_regs);
          regoff_t *new_end;
-         if (BE (new_start == NULL, 0))
+         if (__glibc_unlikely (new_start == NULL))
            return REGS_UNALLOCATED;
          new_end = re_realloc (regs->end, regoff_t, need_regs);
-         if (BE (new_end == NULL, 0))
+         if (__glibc_unlikely (new_end == NULL))
            {
              re_free (new_start);
              return REGS_UNALLOCATED;
@@ -532,9 +503,9 @@ re_copy_regs (struct re_registers *regs, regmatch_t *pmatch, Idx nregs,
     }
   else
     {
-      assert (regs_allocated == REGS_FIXED);
+      DEBUG_ASSERT (regs_allocated == REGS_FIXED);
       /* This function may not be called with REGS_FIXED and nregs too big.  */
-      assert (regs->num_regs >= nregs);
+      DEBUG_ASSERT (nregs <= regs->num_regs);
       rval = REGS_FIXED;
     }
 
@@ -611,7 +582,7 @@ re_exec (const char *s)
    (0 <= LAST_START && LAST_START <= LENGTH)  */
 
 static reg_errcode_t
-__attribute_warn_unused_result__ internal_function
+__attribute_warn_unused_result__
 re_search_internal (const regex_t *preg, const char *string, Idx length,
                    Idx start, Idx last_start, Idx stop, size_t nmatch,
                    regmatch_t pmatch[], int eflags)
@@ -627,34 +598,24 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
   Idx extra_nmatch;
   bool sb;
   int ch;
-#if defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L)
   re_match_context_t mctx = { .dfa = dfa };
-#else
-  re_match_context_t mctx;
-#endif
   char *fastmap = ((preg->fastmap != NULL && preg->fastmap_accurate
                    && start != last_start && !preg->can_be_null)
                   ? preg->fastmap : NULL);
   RE_TRANSLATE_TYPE t = preg->translate;
 
-#if !(defined _LIBC || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L))
-  memset (&mctx, '\0', sizeof (re_match_context_t));
-  mctx.dfa = dfa;
-#endif
-
   extra_nmatch = (nmatch > preg->re_nsub) ? nmatch - (preg->re_nsub + 1) : 0;
   nmatch -= extra_nmatch;
 
   /* Check if the DFA haven't been compiled.  */
-  if (BE (preg->used == 0 || dfa->init_state == NULL
-         || dfa->init_state_word == NULL || dfa->init_state_nl == NULL
-         || dfa->init_state_begbuf == NULL, 0))
+  if (__glibc_unlikely (preg->used == 0 || dfa->init_state == NULL
+                       || dfa->init_state_word == NULL
+                       || dfa->init_state_nl == NULL
+                       || dfa->init_state_begbuf == NULL))
     return REG_NOMATCH;
 
-#ifdef DEBUG
   /* We assume front-end functions already check them.  */
-  assert (0 <= last_start && last_start <= length);
-#endif
+  DEBUG_ASSERT (0 <= last_start && last_start <= length);
 
   /* If initial states with non-begbuf contexts have no elements,
      the regex must be anchored.  If preg->newline_anchor is set,
@@ -675,14 +636,14 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
   err = re_string_allocate (&mctx.input, string, length, dfa->nodes_len + 1,
                            preg->translate, (preg->syntax & RE_ICASE) != 0,
                            dfa);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     goto free_return;
   mctx.input.stop = stop;
   mctx.input.raw_stop = stop;
   mctx.input.newline_anchor = preg->newline_anchor;
 
   err = match_ctx_init (&mctx, eflags, dfa->nbackref * 2);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     goto free_return;
 
   /* We will log all the DFA states through which the dfa pass,
@@ -692,22 +653,20 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
   if (nmatch > 1 || dfa->has_mb_node)
     {
       /* Avoid overflow.  */
-      if (BE ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *))
-               <= mctx.input.bufs_len), 0))
+      if (__glibc_unlikely ((MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *))
+                            <= mctx.input.bufs_len)))
        {
          err = REG_ESPACE;
          goto free_return;
        }
 
       mctx.state_log = re_malloc (re_dfastate_t *, mctx.input.bufs_len + 1);
-      if (BE (mctx.state_log == NULL, 0))
+      if (__glibc_unlikely (mctx.state_log == NULL))
        {
          err = REG_ESPACE;
          goto free_return;
        }
     }
-  else
-    mctx.state_log = NULL;
 
   match_first = start;
   mctx.input.tip_context = (eflags & REG_NOTBOL) ? CONTEXT_BEGBUF
@@ -744,19 +703,19 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
 
        case 7:
          /* Fastmap with single-byte translation, match forward.  */
-         while (BE (match_first < right_lim, 1)
+         while (__glibc_likely (match_first < right_lim)
                 && !fastmap[t[(unsigned char) string[match_first]]])
            ++match_first;
          goto forward_match_found_start_or_reached_end;
 
        case 6:
          /* Fastmap without translation, match forward.  */
-         while (BE (match_first < right_lim, 1)
+         while (__glibc_likely (match_first < right_lim)
                 && !fastmap[(unsigned char) string[match_first]])
            ++match_first;
 
        forward_match_found_start_or_reached_end:
-         if (BE (match_first == right_lim, 0))
+         if (__glibc_unlikely (match_first == right_lim))
            {
              ch = match_first >= length
                       ? 0 : (unsigned char) string[match_first];
@@ -789,11 +748,12 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
              /* If MATCH_FIRST is out of the valid range, reconstruct the
                 buffers.  */
              __re_size_t offset = match_first - mctx.input.raw_mbs_idx;
-             if (BE (offset >= (__re_size_t) mctx.input.valid_raw_len, 0))
+             if (__glibc_unlikely (offset
+                                   >= (__re_size_t) mctx.input.valid_raw_len))
                {
                  err = re_string_reconstruct (&mctx.input, match_first,
                                               eflags);
-                 if (BE (err != REG_NOERROR, 0))
+                 if (__glibc_unlikely (err != REG_NOERROR))
                    goto free_return;
 
                  offset = match_first - mctx.input.raw_mbs_idx;
@@ -817,7 +777,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
       /* Reconstruct the buffers so that the matcher can assume that
         the matching starts from the beginning of the buffer.  */
       err = re_string_reconstruct (&mctx.input, match_first, eflags);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        goto free_return;
 
 #ifdef RE_ENABLE_I18N
@@ -834,7 +794,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
                                   start <= last_start ? &match_first : NULL);
       if (match_last != -1)
        {
-         if (BE (match_last == -2, 0))
+         if (__glibc_unlikely (match_last == -2))
            {
              err = REG_ESPACE;
              goto free_return;
@@ -854,7 +814,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
                  err = prune_impossible_nodes (&mctx);
                  if (err == REG_NOERROR)
                    break;
-                 if (BE (err != REG_NOMATCH, 0))
+                 if (__glibc_unlikely (err != REG_NOMATCH))
                    goto free_return;
                  match_last = -1;
                }
@@ -866,10 +826,8 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
       match_ctx_clean (&mctx);
     }
 
-#ifdef DEBUG
-  assert (match_last != -1);
-  assert (err == REG_NOERROR);
-#endif
+  DEBUG_ASSERT (match_last != -1);
+  DEBUG_ASSERT (err == REG_NOERROR);
 
   /* Set pmatch[] if we need.  */
   if (nmatch > 0)
@@ -891,7 +849,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
        {
          err = set_regs (preg, &mctx, nmatch, pmatch,
                          dfa->has_plural_match && dfa->nbackref > 0);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            goto free_return;
        }
 
@@ -902,7 +860,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
        if (pmatch[reg_idx].rm_so != -1)
          {
 #ifdef RE_ENABLE_I18N
-           if (BE (mctx.input.offsets_needed != 0, 0))
+           if (__glibc_unlikely (mctx.input.offsets_needed != 0))
              {
                pmatch[reg_idx].rm_so =
                  (pmatch[reg_idx].rm_so == mctx.input.valid_len
@@ -914,7 +872,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
                   : mctx.input.offsets[pmatch[reg_idx].rm_eo]);
              }
 #else
-           assert (mctx.input.offsets_needed == 0);
+           DEBUG_ASSERT (mctx.input.offsets_needed == 0);
 #endif
            pmatch[reg_idx].rm_so += match_first;
            pmatch[reg_idx].rm_eo += match_first;
@@ -945,7 +903,7 @@ re_search_internal (const regex_t *preg, const char *string, Idx length,
 }
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 prune_impossible_nodes (re_match_context_t *mctx)
 {
   const re_dfa_t *const dfa = mctx->dfa;
@@ -954,18 +912,17 @@ prune_impossible_nodes (re_match_context_t *mctx)
   re_dfastate_t **sifted_states;
   re_dfastate_t **lim_states = NULL;
   re_sift_context_t sctx;
-#ifdef DEBUG
-  assert (mctx->state_log != NULL);
-#endif
+  DEBUG_ASSERT (mctx->state_log != NULL);
   match_last = mctx->match_last;
   halt_node = mctx->last_node;
 
   /* Avoid overflow.  */
-  if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) <= match_last, 0))
+  if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *))
+                       <= match_last))
     return REG_ESPACE;
 
   sifted_states = re_malloc (re_dfastate_t *, match_last + 1);
-  if (BE (sifted_states == NULL, 0))
+  if (__glibc_unlikely (sifted_states == NULL))
     {
       ret = REG_ESPACE;
       goto free_return;
@@ -973,7 +930,7 @@ prune_impossible_nodes (re_match_context_t *mctx)
   if (dfa->nbackref)
     {
       lim_states = re_malloc (re_dfastate_t *, match_last + 1);
-      if (BE (lim_states == NULL, 0))
+      if (__glibc_unlikely (lim_states == NULL))
        {
          ret = REG_ESPACE;
          goto free_return;
@@ -986,7 +943,7 @@ prune_impossible_nodes (re_match_context_t *mctx)
                         match_last);
          ret = sift_states_backward (mctx, &sctx);
          re_node_set_free (&sctx.limits);
-         if (BE (ret != REG_NOERROR, 0))
+         if (__glibc_unlikely (ret != REG_NOERROR))
              goto free_return;
          if (sifted_states[0] != NULL || lim_states[0] != NULL)
            break;
@@ -1008,7 +965,7 @@ prune_impossible_nodes (re_match_context_t *mctx)
                               match_last + 1);
       re_free (lim_states);
       lim_states = NULL;
-      if (BE (ret != REG_NOERROR, 0))
+      if (__glibc_unlikely (ret != REG_NOERROR))
        goto free_return;
     }
   else
@@ -1016,7 +973,7 @@ prune_impossible_nodes (re_match_context_t *mctx)
       sift_ctx_init (&sctx, sifted_states, lim_states, halt_node, match_last);
       ret = sift_states_backward (mctx, &sctx);
       re_node_set_free (&sctx.limits);
-      if (BE (ret != REG_NOERROR, 0))
+      if (__glibc_unlikely (ret != REG_NOERROR))
        goto free_return;
       if (sifted_states[0] == NULL)
        {
@@ -1041,7 +998,7 @@ prune_impossible_nodes (re_match_context_t *mctx)
    since initial states may have constraints like "\<", "^", etc..  */
 
 static inline re_dfastate_t *
-__attribute__ ((always_inline)) internal_function
+__attribute__ ((always_inline))
 acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx,
                            Idx idx)
 {
@@ -1083,7 +1040,7 @@ acquire_init_state_context (reg_errcode_t *err, const re_match_context_t *mctx,
    index of the buffer.  */
 
 static Idx
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 check_matching (re_match_context_t *mctx, bool fl_longest_match,
                Idx *p_match_first)
 {
@@ -1099,9 +1056,9 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match,
   err = REG_NOERROR;
   cur_state = acquire_init_state_context (&err, mctx, cur_str_idx);
   /* An initial state must not be NULL (invalid).  */
-  if (BE (cur_state == NULL, 0))
+  if (__glibc_unlikely (cur_state == NULL))
     {
-      assert (err == REG_ESPACE);
+      DEBUG_ASSERT (err == REG_ESPACE);
       return -2;
     }
 
@@ -1111,24 +1068,24 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match,
 
       /* Check OP_OPEN_SUBEXP in the initial state in case that we use them
         later.  E.g. Processing back references.  */
-      if (BE (dfa->nbackref, 0))
+      if (__glibc_unlikely (dfa->nbackref))
        {
          at_init_state = false;
          err = check_subexp_matching_top (mctx, &cur_state->nodes, 0);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return err;
 
          if (cur_state->has_backref)
            {
              err = transit_state_bkref (mctx, &cur_state->nodes);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                return err;
            }
        }
     }
 
   /* If the RE accepts NULL string.  */
-  if (BE (cur_state->halt, 0))
+  if (__glibc_unlikely (cur_state->halt))
     {
       if (!cur_state->has_constraint
          || check_halt_state_context (mctx, cur_state, cur_str_idx))
@@ -1148,15 +1105,15 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match,
       re_dfastate_t *old_state = cur_state;
       Idx next_char_idx = re_string_cur_idx (&mctx->input) + 1;
 
-      if ((BE (next_char_idx >= mctx->input.bufs_len, 0)
+      if ((__glibc_unlikely (next_char_idx >= mctx->input.bufs_len)
           && mctx->input.bufs_len < mctx->input.len)
-         || (BE (next_char_idx >= mctx->input.valid_len, 0)
+         || (__glibc_unlikely (next_char_idx >= mctx->input.valid_len)
              && mctx->input.valid_len < mctx->input.len))
        {
          err = extend_buffers (mctx, next_char_idx + 1);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            {
-             assert (err == REG_ESPACE);
+             DEBUG_ASSERT (err == REG_ESPACE);
              return -2;
            }
        }
@@ -1170,7 +1127,7 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match,
          /* Reached the invalid state or an error.  Try to recover a valid
             state using the state log, if available and if we have not
             already found a valid (even if not the longest) match.  */
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return -2;
 
          if (mctx->state_log == NULL
@@ -1179,7 +1136,7 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match,
            break;
        }
 
-      if (BE (at_init_state, 0))
+      if (__glibc_unlikely (at_init_state))
        {
          if (old_state == cur_state)
            next_start_idx = next_char_idx;
@@ -1216,7 +1173,6 @@ check_matching (re_match_context_t *mctx, bool fl_longest_match,
 /* Check NODE match the current context.  */
 
 static bool
-internal_function
 check_halt_node_context (const re_dfa_t *dfa, Idx node, unsigned int context)
 {
   re_token_type_t type = dfa->nodes[node].type;
@@ -1235,15 +1191,12 @@ check_halt_node_context (const re_dfa_t *dfa, Idx node, unsigned int context)
    match the context, return the node.  */
 
 static Idx
-internal_function
 check_halt_state_context (const re_match_context_t *mctx,
                          const re_dfastate_t *state, Idx idx)
 {
   Idx i;
   unsigned int context;
-#ifdef DEBUG
-  assert (state->halt);
-#endif
+  DEBUG_ASSERT (state->halt);
   context = re_string_context_at (&mctx->input, idx, mctx->eflags);
   for (i = 0; i < state->nodes.nelem; ++i)
     if (check_halt_node_context (mctx->dfa, state->nodes.elems[i], context))
@@ -1254,28 +1207,26 @@ check_halt_state_context (const re_match_context_t *mctx,
 /* Compute the next node to which "NFA" transit from NODE("NFA" is a NFA
    corresponding to the DFA).
    Return the destination node, and update EPS_VIA_NODES;
-   return -1 in case of errors.  */
+   return -1 on match failure, -2 on error.  */
 
 static Idx
-internal_function
 proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
+                  regmatch_t *prevregs,
                   Idx *pidx, Idx node, re_node_set *eps_via_nodes,
                   struct re_fail_stack_t *fs)
 {
   const re_dfa_t *const dfa = mctx->dfa;
-  Idx i;
-  bool ok;
   if (IS_EPSILON_NODE (dfa->nodes[node].type))
     {
       re_node_set *cur_nodes = &mctx->state_log[*pidx]->nodes;
       re_node_set *edests = &dfa->edests[node];
-      Idx dest_node;
-      ok = re_node_set_insert (eps_via_nodes, node);
-      if (BE (! ok, 0))
+      bool ok = re_node_set_insert (eps_via_nodes, node);
+      if (__glibc_unlikely (! ok))
        return -2;
-      /* Pick up a valid destination, or return -1 if none
-        is found.  */
-      for (dest_node = -1, i = 0; i < edests->nelem; ++i)
+
+      /* Pick a valid destination, or return -1 if none is found.  */
+      Idx dest_node = -1;
+      for (Idx i = 0; i < edests->nelem; i++)
        {
          Idx candidate = edests->elems[i];
          if (!re_node_set_contains (cur_nodes, candidate))
@@ -1293,7 +1244,7 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
              /* Otherwise, push the second epsilon-transition on the fail stack.  */
              else if (fs != NULL
                       && push_fail_stack (fs, *pidx, candidate, nregs, regs,
-                                          eps_via_nodes))
+                                          prevregs, eps_via_nodes))
                return -2;
 
              /* We know we are going to exit.  */
@@ -1315,16 +1266,21 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
       if (type == OP_BACK_REF)
        {
          Idx subexp_idx = dfa->nodes[node].opr.idx + 1;
-         naccepted = regs[subexp_idx].rm_eo - regs[subexp_idx].rm_so;
+         if (subexp_idx < nregs)
+           naccepted = regs[subexp_idx].rm_eo - regs[subexp_idx].rm_so;
          if (fs != NULL)
            {
-             if (regs[subexp_idx].rm_so == -1 || regs[subexp_idx].rm_eo == -1)
+             if (subexp_idx >= nregs
+                 || regs[subexp_idx].rm_so == -1
+                 || regs[subexp_idx].rm_eo == -1)
                return -1;
              else if (naccepted)
                {
                  char *buf = (char *) re_string_get_buffer (&mctx->input);
-                 if (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
-                             naccepted) != 0)
+                 if (mctx->input.valid_len - *pidx < naccepted
+                     || (memcmp (buf + regs[subexp_idx].rm_so, buf + *pidx,
+                                 naccepted)
+                         != 0))
                    return -1;
                }
            }
@@ -1332,8 +1288,8 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
          if (naccepted == 0)
            {
              Idx dest_node;
-             ok = re_node_set_insert (eps_via_nodes, node);
-             if (BE (! ok, 0))
+             bool ok = re_node_set_insert (eps_via_nodes, node);
+             if (__glibc_unlikely (! ok))
                return -2;
              dest_node = dfa->edests[node].elems[0];
              if (re_node_set_contains (&mctx->state_log[*pidx]->nodes,
@@ -1359,17 +1315,18 @@ proceed_next_node (const re_match_context_t *mctx, Idx nregs, regmatch_t *regs,
 }
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node,
-                Idx nregs, regmatch_t *regs, re_node_set *eps_via_nodes)
+                Idx nregs, regmatch_t *regs, regmatch_t *prevregs,
+                re_node_set *eps_via_nodes)
 {
   reg_errcode_t err;
   Idx num = fs->num++;
   if (fs->num == fs->alloc)
     {
       struct re_fail_stack_ent_t *new_array;
-      new_array = realloc (fs->stack, (sizeof (struct re_fail_stack_ent_t)
-                                      * fs->alloc * 2));
+      new_array = re_realloc (fs->stack, struct re_fail_stack_ent_t,
+                              fs->alloc * 2);
       if (new_array == NULL)
        return REG_ESPACE;
       fs->alloc *= 2;
@@ -1377,36 +1334,46 @@ push_fail_stack (struct re_fail_stack_t *fs, Idx str_idx, Idx dest_node,
     }
   fs->stack[num].idx = str_idx;
   fs->stack[num].node = dest_node;
-  fs->stack[num].regs = re_malloc (regmatch_t, nregs);
+  fs->stack[num].regs = re_malloc (regmatch_t, 2 * nregs);
   if (fs->stack[num].regs == NULL)
     return REG_ESPACE;
   memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs);
+  memcpy (fs->stack[num].regs + nregs, prevregs, sizeof (regmatch_t) * nregs);
   err = re_node_set_init_copy (&fs->stack[num].eps_via_nodes, eps_via_nodes);
   return err;
 }
 
 static Idx
-internal_function
 pop_fail_stack (struct re_fail_stack_t *fs, Idx *pidx, Idx nregs,
-               regmatch_t *regs, re_node_set *eps_via_nodes)
+               regmatch_t *regs, regmatch_t *prevregs,
+               re_node_set *eps_via_nodes)
 {
+  if (fs == NULL || fs->num == 0)
+    return -1;
   Idx num = --fs->num;
-  assert (num >= 0);
   *pidx = fs->stack[num].idx;
   memcpy (regs, fs->stack[num].regs, sizeof (regmatch_t) * nregs);
+  memcpy (prevregs, fs->stack[num].regs + nregs, sizeof (regmatch_t) * nregs);
   re_node_set_free (eps_via_nodes);
   re_free (fs->stack[num].regs);
   *eps_via_nodes = fs->stack[num].eps_via_nodes;
+  DEBUG_ASSERT (0 <= fs->stack[num].node);
   return fs->stack[num].node;
 }
 
+
+#define DYNARRAY_STRUCT  regmatch_list
+#define DYNARRAY_ELEMENT regmatch_t
+#define DYNARRAY_PREFIX  regmatch_list_
+#include <malloc/dynarray-skeleton.c>
+
 /* Set the positions where the subexpressions are starts/ends to registers
    PMATCH.
    Note: We assume that pmatch[0] is already set, and
    pmatch[i].rm_so == pmatch[i].rm_eo == -1 for 0 < i < nmatch.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch,
          regmatch_t *pmatch, bool fl_backtrack)
 {
@@ -1415,13 +1382,11 @@ set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch,
   re_node_set eps_via_nodes;
   struct re_fail_stack_t *fs;
   struct re_fail_stack_t fs_body = { 0, 2, NULL };
-  regmatch_t *prev_idx_match;
-  bool prev_idx_match_malloced = false;
+  struct regmatch_list prev_match;
+  regmatch_list_init (&prev_match);
 
-#ifdef DEBUG
-  assert (nmatch > 1);
-  assert (mctx->state_log != NULL);
-#endif
+  DEBUG_ASSERT (nmatch > 1);
+  DEBUG_ASSERT (mctx->state_log != NULL);
   if (fl_backtrack)
     {
       fs = &fs_body;
@@ -1435,85 +1400,73 @@ set_regs (const regex_t *preg, const re_match_context_t *mctx, size_t nmatch,
   cur_node = dfa->init_node;
   re_node_set_init_empty (&eps_via_nodes);
 
-  if (__libc_use_alloca (nmatch * sizeof (regmatch_t)))
-    prev_idx_match = (regmatch_t *) alloca (nmatch * sizeof (regmatch_t));
-  else
+  if (!regmatch_list_resize (&prev_match, nmatch))
     {
-      prev_idx_match = re_malloc (regmatch_t, nmatch);
-      if (prev_idx_match == NULL)
-       {
-         free_fail_stack_return (fs);
-         return REG_ESPACE;
-       }
-      prev_idx_match_malloced = true;
+      regmatch_list_free (&prev_match);
+      free_fail_stack_return (fs);
+      return REG_ESPACE;
     }
+  regmatch_t *prev_idx_match = regmatch_list_begin (&prev_match);
   memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
 
   for (idx = pmatch[0].rm_so; idx <= pmatch[0].rm_eo ;)
     {
       update_regs (dfa, pmatch, prev_idx_match, cur_node, idx, nmatch);
 
-      if (idx == pmatch[0].rm_eo && cur_node == mctx->last_node)
+      if ((idx == pmatch[0].rm_eo && cur_node == mctx->last_node)
+         || re_node_set_contains (&eps_via_nodes, cur_node))
        {
          Idx reg_idx;
+         cur_node = -1;
          if (fs)
            {
              for (reg_idx = 0; reg_idx < nmatch; ++reg_idx)
                if (pmatch[reg_idx].rm_so > -1 && pmatch[reg_idx].rm_eo == -1)
-                 break;
-             if (reg_idx == nmatch)
-               {
-                 re_node_set_free (&eps_via_nodes);
-                 if (prev_idx_match_malloced)
-                   re_free (prev_idx_match);
-                 return free_fail_stack_return (fs);
-               }
-             cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
-                                        &eps_via_nodes);
+                 {
+                   cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
+                                              prev_idx_match, &eps_via_nodes);
+                   break;
+                 }
            }
-         else
+         if (cur_node < 0)
            {
              re_node_set_free (&eps_via_nodes);
-             if (prev_idx_match_malloced)
-               re_free (prev_idx_match);
-             return REG_NOERROR;
+             regmatch_list_free (&prev_match);
+             return free_fail_stack_return (fs);
            }
        }
 
       /* Proceed to next node.  */
-      cur_node = proceed_next_node (mctx, nmatch, pmatch, &idx, cur_node,
+      cur_node = proceed_next_node (mctx, nmatch, pmatch, prev_idx_match,
+                                   &idx, cur_node,
                                    &eps_via_nodes, fs);
 
-      if (BE (cur_node < 0, 0))
+      if (__glibc_unlikely (cur_node < 0))
        {
-         if (BE (cur_node == -2, 0))
+         if (__glibc_unlikely (cur_node == -2))
            {
              re_node_set_free (&eps_via_nodes);
-             if (prev_idx_match_malloced)
-               re_free (prev_idx_match);
+             regmatch_list_free (&prev_match);
              free_fail_stack_return (fs);
              return REG_ESPACE;
            }
-         if (fs)
-           cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
-                                      &eps_via_nodes);
-         else
+         cur_node = pop_fail_stack (fs, &idx, nmatch, pmatch,
+                                    prev_idx_match, &eps_via_nodes);
+         if (cur_node < 0)
            {
              re_node_set_free (&eps_via_nodes);
-             if (prev_idx_match_malloced)
-               re_free (prev_idx_match);
+             regmatch_list_free (&prev_match);
+             free_fail_stack_return (fs);
              return REG_NOMATCH;
            }
        }
     }
   re_node_set_free (&eps_via_nodes);
-  if (prev_idx_match_malloced)
-    re_free (prev_idx_match);
+  regmatch_list_free (&prev_match);
   return free_fail_stack_return (fs);
 }
 
 static reg_errcode_t
-internal_function
 free_fail_stack_return (struct re_fail_stack_t *fs)
 {
   if (fs)
@@ -1530,7 +1483,6 @@ free_fail_stack_return (struct re_fail_stack_t *fs)
 }
 
 static void
-internal_function
 update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
             regmatch_t *prev_idx_match, Idx cur_node, Idx cur_idx, Idx nmatch)
 {
@@ -1548,10 +1500,10 @@ update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
     }
   else if (type == OP_CLOSE_SUBEXP)
     {
+      /* We are at the last node of this sub expression.  */
       Idx reg_num = dfa->nodes[cur_node].opr.idx + 1;
       if (reg_num < nmatch)
        {
-         /* We are at the last node of this sub expression.  */
          if (pmatch[reg_num].rm_so < cur_idx)
            {
              pmatch[reg_num].rm_eo = cur_idx;
@@ -1602,7 +1554,6 @@ update_regs (const re_dfa_t *dfa, regmatch_t *pmatch,
   ((state) != NULL && re_node_set_contains (&(state)->nodes, node))
 
 static reg_errcode_t
-internal_function
 sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
 {
   reg_errcode_t err;
@@ -1610,17 +1561,15 @@ sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
   Idx str_idx = sctx->last_str_idx;
   re_node_set cur_dest;
 
-#ifdef DEBUG
-  assert (mctx->state_log != NULL && mctx->state_log[str_idx] != NULL);
-#endif
+  DEBUG_ASSERT (mctx->state_log != NULL && mctx->state_log[str_idx] != NULL);
 
   /* Build sifted state_log[str_idx].  It has the nodes which can epsilon
      transit to the last_node and the last_node itself.  */
   err = re_node_set_init_1 (&cur_dest, sctx->last_node);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     return err;
   err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     goto free_return;
 
   /* Then check each states in the state_log.  */
@@ -1641,7 +1590,7 @@ sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
       if (mctx->state_log[str_idx])
        {
          err = build_sifted_states (mctx, sctx, str_idx, &cur_dest);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            goto free_return;
        }
 
@@ -1650,7 +1599,7 @@ sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
         - It is in CUR_SRC.
         And update state_log.  */
       err = update_cur_sifted_state (mctx, sctx, str_idx, &cur_dest);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        goto free_return;
     }
   err = REG_NOERROR;
@@ -1660,7 +1609,7 @@ sift_states_backward (const re_match_context_t *mctx, re_sift_context_t *sctx)
 }
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx,
                     Idx str_idx, re_node_set *cur_dest)
 {
@@ -1680,11 +1629,8 @@ build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx,
       Idx prev_node = cur_src->elems[i];
       int naccepted = 0;
       bool ok;
+      DEBUG_ASSERT (!IS_EPSILON_NODE (dfa->nodes[prev_node].type));
 
-#ifdef DEBUG
-      re_token_type_t type = dfa->nodes[prev_node].type;
-      assert (!IS_EPSILON_NODE (type));
-#endif
 #ifdef RE_ENABLE_I18N
       /* If the node may accept "multi byte".  */
       if (dfa->nodes[prev_node].accept_mb)
@@ -1712,7 +1658,7 @@ build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx,
            continue;
        }
       ok = re_node_set_insert (cur_dest, prev_node);
-      if (BE (! ok, 0))
+      if (__glibc_unlikely (! ok))
        return REG_ESPACE;
     }
 
@@ -1722,7 +1668,6 @@ build_sifted_states (const re_match_context_t *mctx, re_sift_context_t *sctx,
 /* Helper functions.  */
 
 static reg_errcode_t
-internal_function
 clean_state_log_if_needed (re_match_context_t *mctx, Idx next_state_log_idx)
 {
   Idx top = mctx->state_log_top;
@@ -1734,7 +1679,7 @@ clean_state_log_if_needed (re_match_context_t *mctx, Idx next_state_log_idx)
     {
       reg_errcode_t err;
       err = extend_buffers (mctx, next_state_log_idx + 1);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        return err;
     }
 
@@ -1748,7 +1693,6 @@ clean_state_log_if_needed (re_match_context_t *mctx, Idx next_state_log_idx)
 }
 
 static reg_errcode_t
-internal_function
 merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst,
                   re_dfastate_t **src, Idx num)
 {
@@ -1763,11 +1707,11 @@ merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst,
          re_node_set merged_set;
          err = re_node_set_init_union (&merged_set, &dst[st_idx]->nodes,
                                        &src[st_idx]->nodes);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return err;
          dst[st_idx] = re_acquire_state (&err, dfa, &merged_set);
          re_node_set_free (&merged_set);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return err;
        }
     }
@@ -1775,7 +1719,6 @@ merge_state_array (const re_dfa_t *dfa, re_dfastate_t **dst,
 }
 
 static reg_errcode_t
-internal_function
 update_cur_sifted_state (const re_match_context_t *mctx,
                         re_sift_context_t *sctx, Idx str_idx,
                         re_node_set *dest_nodes)
@@ -1795,7 +1738,7 @@ update_cur_sifted_state (const re_match_context_t *mctx,
          /* At first, add the nodes which can epsilon transit to a node in
             DEST_NODE.  */
          err = add_epsilon_src_nodes (dfa, dest_nodes, candidates);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return err;
 
          /* Then, check the limitations in the current sift_context.  */
@@ -1803,27 +1746,27 @@ update_cur_sifted_state (const re_match_context_t *mctx,
            {
              err = check_subexp_limits (dfa, dest_nodes, candidates, &sctx->limits,
                                         mctx->bkref_ents, str_idx);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                return err;
            }
        }
 
       sctx->sifted_states[str_idx] = re_acquire_state (&err, dfa, dest_nodes);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        return err;
     }
 
   if (candidates && mctx->state_log[str_idx]->has_backref)
     {
       err = sift_states_bkref (mctx, sctx, str_idx, candidates);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        return err;
     }
   return REG_NOERROR;
 }
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes,
                       const re_node_set *candidates)
 {
@@ -1831,19 +1774,19 @@ add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes,
   Idx i;
 
   re_dfastate_t *state = re_acquire_state (&err, dfa, dest_nodes);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     return err;
 
   if (!state->inveclosure.alloc)
     {
       err = re_node_set_alloc (&state->inveclosure, dest_nodes->nelem);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        return REG_ESPACE;
       for (i = 0; i < dest_nodes->nelem; i++)
        {
          err = re_node_set_merge (&state->inveclosure,
                                   dfa->inveclosures + dest_nodes->elems[i]);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return REG_ESPACE;
        }
     }
@@ -1852,7 +1795,6 @@ add_epsilon_src_nodes (const re_dfa_t *dfa, re_node_set *dest_nodes,
 }
 
 static reg_errcode_t
-internal_function
 sub_epsilon_src_nodes (const re_dfa_t *dfa, Idx node, re_node_set *dest_nodes,
                       const re_node_set *candidates)
 {
@@ -1879,7 +1821,7 @@ sub_epsilon_src_nodes (const re_dfa_t *dfa, Idx node, re_node_set *dest_nodes,
              {
                err = re_node_set_add_intersect (&except_nodes, candidates,
                                                 dfa->inveclosures + cur_node);
-               if (BE (err != REG_NOERROR, 0))
+               if (__glibc_unlikely (err != REG_NOERROR))
                  {
                    re_node_set_free (&except_nodes);
                    return err;
@@ -1901,7 +1843,6 @@ sub_epsilon_src_nodes (const re_dfa_t *dfa, Idx node, re_node_set *dest_nodes,
 }
 
 static bool
-internal_function
 check_dst_limits (const re_match_context_t *mctx, const re_node_set *limits,
                  Idx dst_node, Idx dst_idx, Idx src_node, Idx src_idx)
 {
@@ -1937,7 +1878,6 @@ check_dst_limits (const re_match_context_t *mctx, const re_node_set *limits,
 }
 
 static int
-internal_function
 check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries,
                             Idx subexp_idx, Idx from_node, Idx bkref_idx)
 {
@@ -2019,7 +1959,6 @@ check_dst_limits_calc_pos_1 (const re_match_context_t *mctx, int boundaries,
 }
 
 static int
-internal_function
 check_dst_limits_calc_pos (const re_match_context_t *mctx, Idx limit,
                           Idx subexp_idx, Idx from_node, Idx str_idx,
                           Idx bkref_idx)
@@ -2049,7 +1988,6 @@ check_dst_limits_calc_pos (const re_match_context_t *mctx, Idx limit,
    which are against limitations from DEST_NODES. */
 
 static reg_errcode_t
-internal_function
 check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes,
                     const re_node_set *candidates, re_node_set *limits,
                     struct re_backref_cache_entry *bkref_ents, Idx str_idx)
@@ -2089,7 +2027,7 @@ check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes,
            {
              err = sub_epsilon_src_nodes (dfa, ops_node, dest_nodes,
                                           candidates);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                return err;
            }
 
@@ -2107,7 +2045,7 @@ check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes,
                       Remove it form the current sifted state.  */
                    err = sub_epsilon_src_nodes (dfa, node, dest_nodes,
                                                 candidates);
-                   if (BE (err != REG_NOERROR, 0))
+                   if (__glibc_unlikely (err != REG_NOERROR))
                      return err;
                    --node_idx;
                  }
@@ -2127,7 +2065,7 @@ check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes,
                     Remove it form the current sifted state.  */
                  err = sub_epsilon_src_nodes (dfa, node, dest_nodes,
                                               candidates);
-                 if (BE (err != REG_NOERROR, 0))
+                 if (__glibc_unlikely (err != REG_NOERROR))
                    return err;
                }
            }
@@ -2137,7 +2075,7 @@ check_subexp_limits (const re_dfa_t *dfa, re_node_set *dest_nodes,
 }
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx,
                   Idx str_idx, const re_node_set *candidates)
 {
@@ -2193,27 +2131,27 @@ sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx,
            {
              local_sctx = *sctx;
              err = re_node_set_init_copy (&local_sctx.limits, &sctx->limits);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                goto free_return;
            }
          local_sctx.last_node = node;
          local_sctx.last_str_idx = str_idx;
          ok = re_node_set_insert (&local_sctx.limits, enabled_idx);
-         if (BE (! ok, 0))
+         if (__glibc_unlikely (! ok))
            {
              err = REG_ESPACE;
              goto free_return;
            }
          cur_state = local_sctx.sifted_states[str_idx];
          err = sift_states_backward (mctx, &local_sctx);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            goto free_return;
          if (sctx->limited_states != NULL)
            {
              err = merge_state_array (dfa, sctx->limited_states,
                                       local_sctx.sifted_states,
                                       str_idx + 1);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                goto free_return;
            }
          local_sctx.sifted_states[str_idx] = cur_state;
@@ -2237,7 +2175,6 @@ sift_states_bkref (const re_match_context_t *mctx, re_sift_context_t *sctx,
 
 #ifdef RE_ENABLE_I18N
 static int
-internal_function
 sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
                     Idx node_idx, Idx str_idx, Idx max_str_idx)
 {
@@ -2245,12 +2182,12 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
   int naccepted;
   /* Check the node can accept "multi byte".  */
   naccepted = check_node_accept_bytes (dfa, node_idx, &mctx->input, str_idx);
-  if (naccepted > 0 && str_idx + naccepted <= max_str_idx &&
-      !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted],
-                           dfa->nexts[node_idx]))
+  if (naccepted > 0 && str_idx + naccepted <= max_str_idx
+      && !STATE_NODE_CONTAINS (sctx->sifted_states[str_idx + naccepted],
+                              dfa->nexts[node_idx]))
     /* The node can't accept the "multi byte", or the
        destination was already thrown away, then the node
-       could't accept the current input "multi byte".   */
+       couldn't accept the current input "multi byte".   */
     naccepted = 0;
   /* Otherwise, it is sure that the node could accept
      'naccepted' bytes input.  */
@@ -2263,11 +2200,12 @@ sift_states_iter_mb (const re_match_context_t *mctx, re_sift_context_t *sctx,
 
 /* Return the next state to which the current state STATE will transit by
    accepting the current input byte, and update STATE_LOG if necessary.
+   Return NULL on failure.
    If STATE can accept a multibyte char/collating element/back reference
    update the destination of STATE_LOG.  */
 
 static re_dfastate_t *
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 transit_state (reg_errcode_t *err, re_match_context_t *mctx,
               re_dfastate_t *state)
 {
@@ -2276,10 +2214,10 @@ transit_state (reg_errcode_t *err, re_match_context_t *mctx,
 
 #ifdef RE_ENABLE_I18N
   /* If the current state can accept multibyte.  */
-  if (BE (state->accept_mb, 0))
+  if (__glibc_unlikely (state->accept_mb))
     {
       *err = transit_state_mb (mctx, state);
-      if (BE (*err != REG_NOERROR, 0))
+      if (__glibc_unlikely (*err != REG_NOERROR))
        return NULL;
     }
 #endif /* RE_ENABLE_I18N */
@@ -2296,11 +2234,11 @@ transit_state (reg_errcode_t *err, re_match_context_t *mctx,
   for (;;)
     {
       trtable = state->trtable;
-      if (BE (trtable != NULL, 1))
+      if (__glibc_likely (trtable != NULL))
        return trtable[ch];
 
       trtable = state->word_trtable;
-      if (BE (trtable != NULL, 1))
+      if (__glibc_likely (trtable != NULL))
        {
          unsigned int context;
          context
@@ -2325,7 +2263,6 @@ transit_state (reg_errcode_t *err, re_match_context_t *mctx,
 
 /* Update the state_log if we need */
 static re_dfastate_t *
-internal_function
 merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
                      re_dfastate_t *next_state)
 {
@@ -2357,7 +2294,7 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
          table_nodes = next_state->entrance_nodes;
          *err = re_node_set_init_union (&next_nodes, table_nodes,
                                             log_nodes);
-         if (BE (*err != REG_NOERROR, 0))
+         if (__glibc_unlikely (*err != REG_NOERROR))
            return NULL;
        }
       else
@@ -2377,21 +2314,21 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
        re_node_set_free (&next_nodes);
     }
 
-  if (BE (dfa->nbackref, 0) && next_state != NULL)
+  if (__glibc_unlikely (dfa->nbackref) && next_state != NULL)
     {
       /* Check OP_OPEN_SUBEXP in the current state in case that we use them
         later.  We must check them here, since the back references in the
         next state might use them.  */
       *err = check_subexp_matching_top (mctx, &next_state->nodes,
                                        cur_idx);
-      if (BE (*err != REG_NOERROR, 0))
+      if (__glibc_unlikely (*err != REG_NOERROR))
        return NULL;
 
       /* If the next state has back references.  */
       if (next_state->has_backref)
        {
          *err = transit_state_bkref (mctx, &next_state->nodes);
-         if (BE (*err != REG_NOERROR, 0))
+         if (__glibc_unlikely (*err != REG_NOERROR))
            return NULL;
          next_state = mctx->state_log[cur_idx];
        }
@@ -2404,7 +2341,6 @@ merge_state_with_log (reg_errcode_t *err, re_match_context_t *mctx,
    multi-byte match, then look in the log for a state
    from which to restart matching.  */
 static re_dfastate_t *
-internal_function
 find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
 {
   re_dfastate_t *cur_state;
@@ -2435,7 +2371,6 @@ find_recover_state (reg_errcode_t *err, re_match_context_t *mctx)
    corresponding back references.  */
 
 static reg_errcode_t
-internal_function
 check_subexp_matching_top (re_match_context_t *mctx, re_node_set *cur_nodes,
                           Idx str_idx)
 {
@@ -2457,7 +2392,7 @@ check_subexp_matching_top (re_match_context_t *mctx, re_node_set *cur_nodes,
              & ((bitset_word_t) 1 << dfa->nodes[node].opr.idx)))
        {
          err = match_ctx_add_subtop (mctx, node, str_idx);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return err;
        }
     }
@@ -2466,7 +2401,7 @@ check_subexp_matching_top (re_match_context_t *mctx, re_node_set *cur_nodes,
 
 #if 0
 /* Return the next state to which the current state STATE will transit by
-   accepting the current input byte.  */
+   accepting the current input byte.  Return NULL on failure.  */
 
 static re_dfastate_t *
 transit_state_sb (reg_errcode_t *err, re_match_context_t *mctx,
@@ -2479,7 +2414,7 @@ transit_state_sb (reg_errcode_t *err, re_match_context_t *mctx,
   unsigned int context;
 
   *err = re_node_set_alloc (&next_nodes, state->nodes.nelem + 1);
-  if (BE (*err != REG_NOERROR, 0))
+  if (__glibc_unlikely (*err != REG_NOERROR))
     return NULL;
   for (node_cnt = 0; node_cnt < state->nodes.nelem; ++node_cnt)
     {
@@ -2488,7 +2423,7 @@ transit_state_sb (reg_errcode_t *err, re_match_context_t *mctx,
        {
          *err = re_node_set_merge (&next_nodes,
                                    dfa->eclosures + dfa->nexts[cur_node]);
-         if (BE (*err != REG_NOERROR, 0))
+         if (__glibc_unlikely (*err != REG_NOERROR))
            {
              re_node_set_free (&next_nodes);
              return NULL;
@@ -2508,7 +2443,6 @@ transit_state_sb (reg_errcode_t *err, re_match_context_t *mctx,
 
 #ifdef RE_ENABLE_I18N
 static reg_errcode_t
-internal_function
 transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
 {
   const re_dfa_t *const dfa = mctx->dfa;
@@ -2548,11 +2482,9 @@ transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
       mctx->max_mb_elem_len = ((mctx->max_mb_elem_len < naccepted) ? naccepted
                               : mctx->max_mb_elem_len);
       err = clean_state_log_if_needed (mctx, dest_idx);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        return err;
-#ifdef DEBUG
-      assert (dfa->nexts[cur_node_idx] != -1);
-#endif
+      DEBUG_ASSERT (dfa->nexts[cur_node_idx] != -1);
       new_nodes = dfa->eclosures + dfa->nexts[cur_node_idx];
 
       dest_state = mctx->state_log[dest_idx];
@@ -2562,7 +2494,7 @@ transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
        {
          err = re_node_set_init_union (&dest_nodes,
                                        dest_state->entrance_nodes, new_nodes);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return err;
        }
       context = re_string_context_at (&mctx->input, dest_idx - 1,
@@ -2571,7 +2503,8 @@ transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
        = re_acquire_state_context (&err, dfa, &dest_nodes, context);
       if (dest_state != NULL)
        re_node_set_free (&dest_nodes);
-      if (BE (mctx->state_log[dest_idx] == NULL && err != REG_NOERROR, 0))
+      if (__glibc_unlikely (mctx->state_log[dest_idx] == NULL
+                           && err != REG_NOERROR))
        return err;
     }
   return REG_NOERROR;
@@ -2579,7 +2512,6 @@ transit_state_mb (re_match_context_t *mctx, re_dfastate_t *pstate)
 #endif /* RE_ENABLE_I18N */
 
 static reg_errcode_t
-internal_function
 transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
 {
   const re_dfa_t *const dfa = mctx->dfa;
@@ -2611,14 +2543,12 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
         Check the substring which the substring matched.  */
       bkc_idx = mctx->nbkref_ents;
       err = get_subexp (mctx, node_idx, cur_str_idx);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        goto free_return;
 
       /* And add the epsilon closures (which is 'new_dest_nodes') of
         the backreference to appropriate state_log.  */
-#ifdef DEBUG
-      assert (dfa->nexts[node_idx] != -1);
-#endif
+      DEBUG_ASSERT (dfa->nexts[node_idx] != -1);
       for (; bkc_idx < mctx->nbkref_ents; ++bkc_idx)
        {
          Idx subexp_len;
@@ -2644,8 +2574,8 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
              mctx->state_log[dest_str_idx]
                = re_acquire_state_context (&err, dfa, new_dest_nodes,
                                            context);
-             if (BE (mctx->state_log[dest_str_idx] == NULL
-                     && err != REG_NOERROR, 0))
+             if (__glibc_unlikely (mctx->state_log[dest_str_idx] == NULL
+                                   && err != REG_NOERROR))
                goto free_return;
            }
          else
@@ -2654,7 +2584,7 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
              err = re_node_set_init_union (&dest_nodes,
                                            dest_state->entrance_nodes,
                                            new_dest_nodes);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                {
                  re_node_set_free (&dest_nodes);
                  goto free_return;
@@ -2662,8 +2592,8 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
              mctx->state_log[dest_str_idx]
                = re_acquire_state_context (&err, dfa, &dest_nodes, context);
              re_node_set_free (&dest_nodes);
-             if (BE (mctx->state_log[dest_str_idx] == NULL
-                     && err != REG_NOERROR, 0))
+             if (__glibc_unlikely (mctx->state_log[dest_str_idx] == NULL
+                                   && err != REG_NOERROR))
                goto free_return;
            }
          /* We need to check recursively if the backreference can epsilon
@@ -2673,10 +2603,10 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
            {
              err = check_subexp_matching_top (mctx, new_dest_nodes,
                                               cur_str_idx);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                goto free_return;
              err = transit_state_bkref (mctx, new_dest_nodes);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                goto free_return;
            }
        }
@@ -2693,7 +2623,7 @@ transit_state_bkref (re_match_context_t *mctx, const re_node_set *nodes)
    delay these checking for prune_impossible_nodes().  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
 {
   const re_dfa_t *const dfa = mctx->dfa;
@@ -2737,7 +2667,8 @@ get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
             at the back reference?  */
          if (sl_str_diff > 0)
            {
-             if (BE (bkref_str_off + sl_str_diff > mctx->input.valid_len, 0))
+             if (__glibc_unlikely (bkref_str_off + sl_str_diff
+                                   > mctx->input.valid_len))
                {
                  /* Not enough chars for a successful match.  */
                  if (bkref_str_off + sl_str_diff > mctx->input.len)
@@ -2746,7 +2677,7 @@ get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
                  err = clean_state_log_if_needed (mctx,
                                                   bkref_str_off
                                                   + sl_str_diff);
-                 if (BE (err != REG_NOERROR, 0))
+                 if (__glibc_unlikely (err != REG_NOERROR))
                    return err;
                  buf = (const char *) re_string_get_buffer (&mctx->input);
                }
@@ -2765,7 +2696,7 @@ get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
 
          if (err == REG_NOMATCH)
            continue;
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return err;
        }
 
@@ -2784,14 +2715,14 @@ get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
             at the back reference?  */
          if (sl_str_off > 0)
            {
-             if (BE (bkref_str_off >= mctx->input.valid_len, 0))
+             if (__glibc_unlikely (bkref_str_off >= mctx->input.valid_len))
                {
                  /* If we are at the end of the input, we cannot match.  */
                  if (bkref_str_off >= mctx->input.len)
                    break;
 
                  err = extend_buffers (mctx, bkref_str_off + 1);
-                 if (BE (err != REG_NOERROR, 0))
+                 if (__glibc_unlikely (err != REG_NOERROR))
                    return err;
 
                  buf = (const char *) re_string_get_buffer (&mctx->input);
@@ -2822,15 +2753,18 @@ get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
                               OP_CLOSE_SUBEXP);
          if (err == REG_NOMATCH)
              continue;
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
              return err;
          sub_last = match_ctx_add_sublast (sub_top, cls_node, sl_str);
-         if (BE (sub_last == NULL, 0))
+         if (__glibc_unlikely (sub_last == NULL))
            return REG_ESPACE;
          err = get_subexp_sub (mctx, sub_top, sub_last, bkref_node,
                                bkref_str_idx);
+         buf = (const char *) re_string_get_buffer (&mctx->input);
          if (err == REG_NOMATCH)
            continue;
+         if (__glibc_unlikely (err != REG_NOERROR))
+           return err;
        }
     }
   return REG_NOERROR;
@@ -2843,7 +2777,6 @@ get_subexp (re_match_context_t *mctx, Idx bkref_node, Idx bkref_str_idx)
    and SUB_LAST.  */
 
 static reg_errcode_t
-internal_function
 get_subexp_sub (re_match_context_t *mctx, const re_sub_match_top_t *sub_top,
                re_sub_match_last_t *sub_last, Idx bkref_node, Idx bkref_str)
 {
@@ -2857,7 +2790,7 @@ get_subexp_sub (re_match_context_t *mctx, const re_sub_match_top_t *sub_top,
     return err;
   err = match_ctx_add_entry (mctx, bkref_node, bkref_str, sub_top->str_idx,
                             sub_last->str_idx);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     return err;
   to_idx = bkref_str + sub_last->str_idx - sub_top->str_idx;
   return clean_state_log_if_needed (mctx, to_idx);
@@ -2872,7 +2805,6 @@ get_subexp_sub (re_match_context_t *mctx, const re_sub_match_top_t *sub_top,
         E.g. RE: (a){2}  */
 
 static Idx
-internal_function
 find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
                  Idx subexp_idx, int type)
 {
@@ -2891,10 +2823,11 @@ find_subexp_node (const re_dfa_t *dfa, const re_node_set *nodes,
 /* Check whether the node TOP_NODE at TOP_STR can arrive to the node
    LAST_NODE at LAST_STR.  We record the path onto PATH since it will be
    heavily reused.
-   Return REG_NOERROR if it can arrive, or REG_NOMATCH otherwise.  */
+   Return REG_NOERROR if it can arrive, REG_NOMATCH if it cannot,
+   REG_ESPACE if memory is exhausted.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
               Idx top_str, Idx last_node, Idx last_str, int type)
 {
@@ -2908,19 +2841,19 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
 
   subexp_num = dfa->nodes[top_node].opr.idx;
   /* Extend the buffer if we need.  */
-  if (BE (path->alloc < last_str + mctx->max_mb_elem_len + 1, 0))
+  if (__glibc_unlikely (path->alloc < last_str + mctx->max_mb_elem_len + 1))
     {
       re_dfastate_t **new_array;
       Idx old_alloc = path->alloc;
       Idx incr_alloc = last_str + mctx->max_mb_elem_len + 1;
       Idx new_alloc;
-      if (BE (IDX_MAX - old_alloc < incr_alloc, 0))
+      if (__glibc_unlikely (IDX_MAX - old_alloc < incr_alloc))
        return REG_ESPACE;
       new_alloc = old_alloc + incr_alloc;
-      if (BE (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc, 0))
+      if (__glibc_unlikely (SIZE_MAX / sizeof (re_dfastate_t *) < new_alloc))
        return REG_ESPACE;
       new_array = re_realloc (path->array, re_dfastate_t *, new_alloc);
-      if (BE (new_array == NULL, 0))
+      if (__glibc_unlikely (new_array == NULL))
        return REG_ESPACE;
       path->array = new_array;
       path->alloc = new_alloc;
@@ -2941,10 +2874,10 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
   if (str_idx == top_str)
     {
       err = re_node_set_init_1 (&next_nodes, top_node);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        return err;
       err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type);
-      if (BE (err != REG_NOERROR, 0))
+      if (__glibc_unlikely (err != REG_NOERROR))
        {
          re_node_set_free (&next_nodes);
          return err;
@@ -2956,7 +2889,7 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
       if (cur_state && cur_state->has_backref)
        {
          err = re_node_set_init_copy (&next_nodes, &cur_state->nodes);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return err;
        }
       else
@@ -2968,14 +2901,14 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
        {
          err = expand_bkref_cache (mctx, &next_nodes, str_idx,
                                    subexp_num, type);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            {
              re_node_set_free (&next_nodes);
              return err;
            }
        }
       cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context);
-      if (BE (cur_state == NULL && err != REG_NOERROR, 0))
+      if (__glibc_unlikely (cur_state == NULL && err != REG_NOERROR))
        {
          re_node_set_free (&next_nodes);
          return err;
@@ -2990,7 +2923,7 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
        {
          err = re_node_set_merge (&next_nodes,
                                   &mctx->state_log[str_idx + 1]->nodes);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            {
              re_node_set_free (&next_nodes);
              return err;
@@ -3001,7 +2934,7 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
          err = check_arrival_add_next_nodes (mctx, str_idx,
                                              &cur_state->non_eps_nodes,
                                              &next_nodes);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            {
              re_node_set_free (&next_nodes);
              return err;
@@ -3011,14 +2944,14 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
       if (next_nodes.nelem)
        {
          err = check_arrival_expand_ecl (dfa, &next_nodes, subexp_num, type);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            {
              re_node_set_free (&next_nodes);
              return err;
            }
          err = expand_bkref_cache (mctx, &next_nodes, str_idx,
                                    subexp_num, type);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            {
              re_node_set_free (&next_nodes);
              return err;
@@ -3026,7 +2959,7 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
        }
       context = re_string_context_at (&mctx->input, str_idx - 1, mctx->eflags);
       cur_state = re_acquire_state_context (&err, dfa, &next_nodes, context);
-      if (BE (cur_state == NULL && err != REG_NOERROR, 0))
+      if (__glibc_unlikely (cur_state == NULL && err != REG_NOERROR))
        {
          re_node_set_free (&next_nodes);
          return err;
@@ -3059,7 +2992,7 @@ check_arrival (re_match_context_t *mctx, state_array_t *path, Idx top_node,
         Can't we unify them?  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
                              re_node_set *cur_nodes, re_node_set *next_nodes)
 {
@@ -3075,10 +3008,8 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
     {
       int naccepted = 0;
       Idx cur_node = cur_nodes->elems[cur_idx];
-#ifdef DEBUG
-      re_token_type_t type = dfa->nodes[cur_node].type;
-      assert (!IS_EPSILON_NODE (type));
-#endif
+      DEBUG_ASSERT (!IS_EPSILON_NODE (dfa->nodes[cur_node].type));
+
 #ifdef RE_ENABLE_I18N
       /* If the node may accept "multi byte".  */
       if (dfa->nodes[cur_node].accept_mb)
@@ -3095,22 +3026,22 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
              if (dest_state)
                {
                  err = re_node_set_merge (&union_set, &dest_state->nodes);
-                 if (BE (err != REG_NOERROR, 0))
+                 if (__glibc_unlikely (err != REG_NOERROR))
                    {
                      re_node_set_free (&union_set);
                      return err;
                    }
                }
              ok = re_node_set_insert (&union_set, next_node);
-             if (BE (! ok, 0))
+             if (__glibc_unlikely (! ok))
                {
                  re_node_set_free (&union_set);
                  return REG_ESPACE;
                }
              mctx->state_log[next_idx] = re_acquire_state (&err, dfa,
                                                            &union_set);
-             if (BE (mctx->state_log[next_idx] == NULL
-                     && err != REG_NOERROR, 0))
+             if (__glibc_unlikely (mctx->state_log[next_idx] == NULL
+                                   && err != REG_NOERROR))
                {
                  re_node_set_free (&union_set);
                  return err;
@@ -3122,7 +3053,7 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
          || check_node_accept (mctx, dfa->nodes + cur_node, str_idx))
        {
          ok = re_node_set_insert (next_nodes, dfa->nexts[cur_node]);
-         if (BE (! ok, 0))
+         if (__glibc_unlikely (! ok))
            {
              re_node_set_free (&union_set);
              return REG_ESPACE;
@@ -3140,18 +3071,15 @@ check_arrival_add_next_nodes (re_match_context_t *mctx, Idx str_idx,
 */
 
 static reg_errcode_t
-internal_function
 check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes,
                          Idx ex_subexp, int type)
 {
   reg_errcode_t err;
   Idx idx, outside_node;
   re_node_set new_nodes;
-#ifdef DEBUG
-  assert (cur_nodes->nelem);
-#endif
+  DEBUG_ASSERT (cur_nodes->nelem);
   err = re_node_set_alloc (&new_nodes, cur_nodes->nelem);
-  if (BE (err != REG_NOERROR, 0))
+  if (__glibc_unlikely (err != REG_NOERROR))
     return err;
   /* Create a new node set NEW_NODES with the nodes which are epsilon
      closures of the node in CUR_NODES.  */
@@ -3165,7 +3093,7 @@ check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes,
        {
          /* There are no problematic nodes, just merge them.  */
          err = re_node_set_merge (&new_nodes, eclosure);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            {
              re_node_set_free (&new_nodes);
              return err;
@@ -3176,7 +3104,7 @@ check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes,
          /* There are problematic nodes, re-calculate incrementally.  */
          err = check_arrival_expand_ecl_sub (dfa, &new_nodes, cur_node,
                                              ex_subexp, type);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            {
              re_node_set_free (&new_nodes);
              return err;
@@ -3193,7 +3121,7 @@ check_arrival_expand_ecl (const re_dfa_t *dfa, re_node_set *cur_nodes,
    problematic append it to DST_NODES.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes,
                              Idx target, Idx ex_subexp, int type)
 {
@@ -3208,13 +3136,13 @@ check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes,
          if (type == OP_CLOSE_SUBEXP)
            {
              ok = re_node_set_insert (dst_nodes, cur_node);
-             if (BE (! ok, 0))
+             if (__glibc_unlikely (! ok))
                return REG_ESPACE;
            }
          break;
        }
       ok = re_node_set_insert (dst_nodes, cur_node);
-      if (BE (! ok, 0))
+      if (__glibc_unlikely (! ok))
        return REG_ESPACE;
       if (dfa->edests[cur_node].nelem == 0)
        break;
@@ -3224,7 +3152,7 @@ check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes,
          err = check_arrival_expand_ecl_sub (dfa, dst_nodes,
                                              dfa->edests[cur_node].elems[1],
                                              ex_subexp, type);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            return err;
        }
       cur_node = dfa->edests[cur_node].elems[0];
@@ -3238,7 +3166,7 @@ check_arrival_expand_ecl_sub (const re_dfa_t *dfa, re_node_set *dst_nodes,
    in MCTX->BKREF_ENTS.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes,
                    Idx cur_str, Idx subexp_num, int type)
 {
@@ -3276,8 +3204,8 @@ expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes,
          err2 = check_arrival_expand_ecl (dfa, &new_dests, subexp_num, type);
          err3 = re_node_set_merge (cur_nodes, &new_dests);
          re_node_set_free (&new_dests);
-         if (BE (err != REG_NOERROR || err2 != REG_NOERROR
-                 || err3 != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR || err2 != REG_NOERROR
+                               || err3 != REG_NOERROR))
            {
              err = (err != REG_NOERROR ? err
                     : (err2 != REG_NOERROR ? err2 : err3));
@@ -3299,7 +3227,7 @@ expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes,
              err = re_node_set_init_copy (&union_set,
                                           &mctx->state_log[to_idx]->nodes);
              ok = re_node_set_insert (&union_set, next_node);
-             if (BE (err != REG_NOERROR || ! ok, 0))
+             if (__glibc_unlikely (err != REG_NOERROR || ! ok))
                {
                  re_node_set_free (&union_set);
                  err = err != REG_NOERROR ? err : REG_ESPACE;
@@ -3309,13 +3237,13 @@ expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes,
          else
            {
              err = re_node_set_init_1 (&union_set, next_node);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                return err;
            }
          mctx->state_log[to_idx] = re_acquire_state (&err, dfa, &union_set);
          re_node_set_free (&union_set);
-         if (BE (mctx->state_log[to_idx] == NULL
-                 && err != REG_NOERROR, 0))
+         if (__glibc_unlikely (mctx->state_log[to_idx] == NULL
+                               && err != REG_NOERROR))
            return err;
        }
     }
@@ -3326,8 +3254,7 @@ expand_bkref_cache (re_match_context_t *mctx, re_node_set *cur_nodes,
 /* Build transition table for the state.
    Return true if successful.  */
 
-static bool
-internal_function
+static bool __attribute_noinline__
 build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
 {
   reg_errcode_t err;
@@ -3335,36 +3262,20 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
   int ch;
   bool need_word_trtable = false;
   bitset_word_t elem, mask;
-  bool dests_node_malloced = false;
-  bool dest_states_malloced = false;
   Idx ndests; /* Number of the destination states from 'state'.  */
   re_dfastate_t **trtable;
-  re_dfastate_t **dest_states = NULL, **dest_states_word, **dest_states_nl;
-  re_node_set follows, *dests_node;
-  bitset_t *dests_ch;
+  re_dfastate_t *dest_states[SBC_MAX];
+  re_dfastate_t *dest_states_word[SBC_MAX];
+  re_dfastate_t *dest_states_nl[SBC_MAX];
+  re_node_set follows;
   bitset_t acceptable;
 
-  struct dests_alloc
-  {
-    re_node_set dests_node[SBC_MAX];
-    bitset_t dests_ch[SBC_MAX];
-  } *dests_alloc;
-
   /* We build DFA states which corresponds to the destination nodes
      from 'state'.  'dests_node[i]' represents the nodes which i-th
      destination state contains, and 'dests_ch[i]' represents the
      characters which i-th destination state accepts.  */
-  if (__libc_use_alloca (sizeof (struct dests_alloc)))
-    dests_alloc = (struct dests_alloc *) alloca (sizeof (struct dests_alloc));
-  else
-    {
-      dests_alloc = re_malloc (struct dests_alloc, 1);
-      if (BE (dests_alloc == NULL, 0))
-       return false;
-      dests_node_malloced = true;
-    }
-  dests_node = dests_alloc->dests_node;
-  dests_ch = dests_alloc->dests_ch;
+  re_node_set dests_node[SBC_MAX];
+  bitset_t dests_ch[SBC_MAX];
 
   /* Initialize transition table.  */
   state->word_trtable = state->trtable = NULL;
@@ -3372,16 +3283,14 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
   /* At first, group all nodes belonging to 'state' into several
      destinations.  */
   ndests = group_nodes_into_DFAstates (dfa, state, dests_node, dests_ch);
-  if (BE (ndests <= 0, 0))
+  if (__glibc_unlikely (ndests <= 0))
     {
-      if (dests_node_malloced)
-       free (dests_alloc);
       /* Return false in case of an error, true otherwise.  */
       if (ndests == 0)
        {
          state->trtable = (re_dfastate_t **)
            calloc (sizeof (re_dfastate_t *), SBC_MAX);
-          if (BE (state->trtable == NULL, 0))
+          if (__glibc_unlikely (state->trtable == NULL))
             return false;
          return true;
        }
@@ -3389,40 +3298,15 @@ build_trtable (const re_dfa_t *dfa, re_dfastate_t *state)
     }
 
   err = re_node_set_alloc (&follows, ndests + 1);
-  if (BE (err != REG_NOERROR, 0))
-    goto out_free;
-
-  /* Avoid arithmetic overflow in size calculation.  */
-  if (BE ((((SIZE_MAX - (sizeof (re_node_set) + sizeof (bitset_t)) * SBC_MAX)
-           / (3 * sizeof (re_dfastate_t *)))
-          < ndests),
-         0))
-    goto out_free;
-
-  if (__libc_use_alloca ((sizeof (re_node_set) + sizeof (bitset_t)) * SBC_MAX
-                        + ndests * 3 * sizeof (re_dfastate_t *)))
-    dest_states = (re_dfastate_t **)
-      alloca (ndests * 3 * sizeof (re_dfastate_t *));
-  else
+  if (__glibc_unlikely (err != REG_NOERROR))
     {
-      dest_states = (re_dfastate_t **)
-       malloc (ndests * 3 * sizeof (re_dfastate_t *));
-      if (BE (dest_states == NULL, 0))
-       {
-out_free:
-         if (dest_states_malloced)
-           free (dest_states);
-         re_node_set_free (&follows);
-         for (i = 0; i < ndests; ++i)
-           re_node_set_free (dests_node + i);
-         if (dests_node_malloced)
-           free (dests_alloc);
-         return false;
-       }
-      dest_states_malloced = true;
+    out_free:
+      re_node_set_free (&follows);
+      for (i = 0; i < ndests; ++i)
+       re_node_set_free (dests_node + i);
+      return false;
     }
-  dest_states_word = dest_states + ndests;
-  dest_states_nl = dest_states_word + ndests;
+
   bitset_empty (acceptable);
 
   /* Then build the states for all destinations.  */
@@ -3437,12 +3321,12 @@ out_free:
          if (next_node != -1)
            {
              err = re_node_set_merge (&follows, dfa->eclosures + next_node);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                goto out_free;
            }
        }
       dest_states[i] = re_acquire_state_context (&err, dfa, &follows, 0);
-      if (BE (dest_states[i] == NULL && err != REG_NOERROR, 0))
+      if (__glibc_unlikely (dest_states[i] == NULL && err != REG_NOERROR))
        goto out_free;
       /* If the new state has context constraint,
         build appropriate states for these contexts.  */
@@ -3450,7 +3334,8 @@ out_free:
        {
          dest_states_word[i] = re_acquire_state_context (&err, dfa, &follows,
                                                          CONTEXT_WORD);
-         if (BE (dest_states_word[i] == NULL && err != REG_NOERROR, 0))
+         if (__glibc_unlikely (dest_states_word[i] == NULL
+                               && err != REG_NOERROR))
            goto out_free;
 
          if (dest_states[i] != dest_states_word[i] && dfa->mb_cur_max > 1)
@@ -3458,7 +3343,7 @@ out_free:
 
          dest_states_nl[i] = re_acquire_state_context (&err, dfa, &follows,
                                                        CONTEXT_NEWLINE);
-         if (BE (dest_states_nl[i] == NULL && err != REG_NOERROR, 0))
+         if (__glibc_unlikely (dest_states_nl[i] == NULL && err != REG_NOERROR))
            goto out_free;
        }
       else
@@ -3469,7 +3354,7 @@ out_free:
       bitset_merge (acceptable, dests_ch[i]);
     }
 
-  if (!BE (need_word_trtable, 0))
+  if (!__glibc_unlikely (need_word_trtable))
     {
       /* We don't care about whether the following character is a word
         character, or we are in a single-byte character set so we can
@@ -3477,7 +3362,7 @@ out_free:
         256-entry transition table.  */
       trtable = state->trtable =
        (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), SBC_MAX);
-      if (BE (trtable == NULL, 0))
+      if (__glibc_unlikely (trtable == NULL))
        goto out_free;
 
       /* For all characters ch...:  */
@@ -3485,7 +3370,7 @@ out_free:
        for (ch = i * BITSET_WORD_BITS, elem = acceptable[i], mask = 1;
             elem;
             mask <<= 1, elem >>= 1, ++ch)
-         if (BE (elem & 1, 0))
+         if (__glibc_unlikely (elem & 1))
            {
              /* There must be exactly one destination which accepts
                 character ch.  See group_nodes_into_DFAstates.  */
@@ -3508,7 +3393,7 @@ out_free:
         starting at trtable[SBC_MAX].  */
       trtable = state->word_trtable =
        (re_dfastate_t **) calloc (sizeof (re_dfastate_t *), 2 * SBC_MAX);
-      if (BE (trtable == NULL, 0))
+      if (__glibc_unlikely (trtable == NULL))
        goto out_free;
 
       /* For all characters ch...:  */
@@ -3516,7 +3401,7 @@ out_free:
        for (ch = i * BITSET_WORD_BITS, elem = acceptable[i], mask = 1;
             elem;
             mask <<= 1, elem >>= 1, ++ch)
-         if (BE (elem & 1, 0))
+         if (__glibc_unlikely (elem & 1))
            {
              /* There must be exactly one destination which accepts
                 character ch.  See group_nodes_into_DFAstates.  */
@@ -3546,26 +3431,19 @@ out_free:
          }
     }
 
-  if (dest_states_malloced)
-    free (dest_states);
-
   re_node_set_free (&follows);
   for (i = 0; i < ndests; ++i)
     re_node_set_free (dests_node + i);
-
-  if (dests_node_malloced)
-    free (dests_alloc);
-
   return true;
 }
 
 /* Group all nodes belonging to STATE into several destinations.
    Then for all destinations, set the nodes belonging to the destination
    to DESTS_NODE[i] and set the characters accepted by the destination
-   to DEST_CH[i].  This function return the number of destinations.  */
+   to DEST_CH[i].  Return the number of destinations if successful,
+   -1 on internal error.  */
 
 static Idx
-internal_function
 group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
                            re_node_set *dests_node, bitset_t *dests_ch)
 {
@@ -3716,14 +3594,14 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
              bitset_copy (dests_ch[ndests], remains);
              bitset_copy (dests_ch[j], intersec);
              err = re_node_set_init_copy (dests_node + ndests, &dests_node[j]);
-             if (BE (err != REG_NOERROR, 0))
+             if (__glibc_unlikely (err != REG_NOERROR))
                goto error_return;
              ++ndests;
            }
 
          /* Put the position in the current group. */
          ok = re_node_set_insert (&dests_node[j], cur_nodes->elems[i]);
-         if (BE (! ok, 0))
+         if (__glibc_unlikely (! ok))
            goto error_return;
 
          /* If all characters are consumed, go to next node. */
@@ -3735,12 +3613,13 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
        {
          bitset_copy (dests_ch[ndests], accepts);
          err = re_node_set_init_1 (dests_node + ndests, cur_nodes->elems[i]);
-         if (BE (err != REG_NOERROR, 0))
+         if (__glibc_unlikely (err != REG_NOERROR))
            goto error_return;
          ++ndests;
          bitset_empty (accepts);
        }
     }
+  assume (ndests <= SBC_MAX);
   return ndests;
  error_return:
   for (j = 0; j < ndests; ++j)
@@ -3762,7 +3641,6 @@ group_nodes_into_DFAstates (const re_dfa_t *dfa, const re_dfastate_t *state,
 # endif
 
 static int
-internal_function
 check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
                         const re_string_t *input, Idx str_idx)
 {
@@ -3770,10 +3648,10 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
   int char_len, elem_len;
   Idx i;
 
-  if (BE (node->type == OP_UTF8_PERIOD, 0))
+  if (__glibc_unlikely (node->type == OP_UTF8_PERIOD))
     {
       unsigned char c = re_string_byte_at (input, str_idx), d;
-      if (BE (c < 0xc2, 1))
+      if (__glibc_likely (c < 0xc2))
        return 0;
 
       if (str_idx + 2 > input->len)
@@ -3829,10 +3707,10 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
       /* FIXME: I don't think this if is needed, as both '\n'
         and '\0' are char_len == 1.  */
       /* '.' accepts any one character except the following two cases.  */
-      if ((!(dfa->syntax & RE_DOT_NEWLINE) &&
-          re_string_byte_at (input, str_idx) == '\n') ||
-         ((dfa->syntax & RE_DOT_NOT_NULL) &&
-          re_string_byte_at (input, str_idx) == '\0'))
+      if ((!(dfa->syntax & RE_DOT_NEWLINE)
+          && re_string_byte_at (input, str_idx) == '\n')
+         || ((dfa->syntax & RE_DOT_NOT_NULL)
+             && re_string_byte_at (input, str_idx) == '\0'))
        return 0;
       return char_len;
     }
@@ -3937,30 +3815,27 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
              indirect = (const int32_t *)
                _NL_CURRENT (LC_COLLATE, _NL_COLLATE_INDIRECTMB);
              int32_t idx = findidx (table, indirect, extra, &cp, elem_len);
+             int32_t rule = idx >> 24;
+             idx &= 0xffffff;
              if (idx > 0)
-               for (i = 0; i < cset->nequiv_classes; ++i)
-                 {
-                   int32_t equiv_class_idx = cset->equiv_classes[i];
-                   size_t weight_len = weights[idx & 0xffffff];
-                   if (weight_len == weights[equiv_class_idx & 0xffffff]
-                       && (idx >> 24) == (equiv_class_idx >> 24))
-                     {
-                       Idx cnt = 0;
-
-                       idx &= 0xffffff;
-                       equiv_class_idx &= 0xffffff;
-
-                       while (cnt <= weight_len
-                              && (weights[equiv_class_idx + 1 + cnt]
-                                  == weights[idx + 1 + cnt]))
-                         ++cnt;
-                       if (cnt > weight_len)
-                         {
-                           match_len = elem_len;
-                           goto check_node_accept_bytes_match;
-                         }
-                     }
-                 }
+               {
+                 size_t weight_len = weights[idx];
+                 for (i = 0; i < cset->nequiv_classes; ++i)
+                   {
+                     int32_t equiv_class_idx = cset->equiv_classes[i];
+                     int32_t equiv_class_rule = equiv_class_idx >> 24;
+                     equiv_class_idx &= 0xffffff;
+                     if (weights[equiv_class_idx] == weight_len
+                         && equiv_class_rule == rule
+                         && memcmp (weights + idx + 1,
+                                    weights + equiv_class_idx + 1,
+                                    weight_len) == 0)
+                       {
+                         match_len = elem_len;
+                         goto check_node_accept_bytes_match;
+                       }
+                   }
+               }
            }
        }
       else
@@ -3992,7 +3867,6 @@ check_node_accept_bytes (const re_dfa_t *dfa, Idx node_idx,
 
 # ifdef _LIBC
 static unsigned int
-internal_function
 find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
 {
   uint32_t nrules = _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
@@ -4056,7 +3930,6 @@ find_collation_sequence_value (const unsigned char *mbs, size_t mbs_len)
    byte of the INPUT.  */
 
 static bool
-internal_function
 check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
                   Idx idx)
 {
@@ -4078,7 +3951,7 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
     case OP_UTF8_PERIOD:
       if (ch >= ASCII_CHARS)
         return false;
-      /* FALLTHROUGH */
+      FALLTHROUGH;
 #endif
     case OP_PERIOD:
       if ((ch == '\n' && !(mctx->dfa->syntax & RE_DOT_NEWLINE))
@@ -4106,22 +3979,22 @@ check_node_accept (const re_match_context_t *mctx, const re_token_t *node,
 /* Extend the buffers, if the buffers have run out.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 extend_buffers (re_match_context_t *mctx, int min_len)
 {
   reg_errcode_t ret;
   re_string_t *pstr = &mctx->input;
 
   /* Avoid overflow.  */
-  if (BE (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) / 2
-          <= pstr->bufs_len, 0))
+  if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / sizeof (re_dfastate_t *)) / 2
+                       <= pstr->bufs_len))
     return REG_ESPACE;
 
   /* Double the lengths of the buffers, but allocate at least MIN_LEN.  */
   ret = re_string_realloc_buffers (pstr,
                                   MAX (min_len,
                                        MIN (pstr->len, pstr->bufs_len * 2)));
-  if (BE (ret != REG_NOERROR, 0))
+  if (__glibc_unlikely (ret != REG_NOERROR))
     return ret;
 
   if (mctx->state_log != NULL)
@@ -4132,7 +4005,7 @@ extend_buffers (re_match_context_t *mctx, int min_len)
         does not have the right size.  */
       re_dfastate_t **new_array = re_realloc (mctx->state_log, re_dfastate_t *,
                                              pstr->bufs_len + 1);
-      if (BE (new_array == NULL, 0))
+      if (__glibc_unlikely (new_array == NULL))
        return REG_ESPACE;
       mctx->state_log = new_array;
     }
@@ -4144,7 +4017,7 @@ extend_buffers (re_match_context_t *mctx, int min_len)
       if (pstr->mb_cur_max > 1)
        {
          ret = build_wcs_upper_buffer (pstr);
-         if (BE (ret != REG_NOERROR, 0))
+         if (__glibc_unlikely (ret != REG_NOERROR))
            return ret;
        }
       else
@@ -4172,7 +4045,7 @@ extend_buffers (re_match_context_t *mctx, int min_len)
 /* Initialize MCTX.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 match_ctx_init (re_match_context_t *mctx, int eflags, Idx n)
 {
   mctx->eflags = eflags;
@@ -4183,12 +4056,12 @@ match_ctx_init (re_match_context_t *mctx, int eflags, Idx n)
       size_t max_object_size =
        MAX (sizeof (struct re_backref_cache_entry),
             sizeof (re_sub_match_top_t *));
-      if (BE (MIN (IDX_MAX, SIZE_MAX / max_object_size) < n, 0))
+      if (__glibc_unlikely (MIN (IDX_MAX, SIZE_MAX / max_object_size) < n))
        return REG_ESPACE;
 
       mctx->bkref_ents = re_malloc (struct re_backref_cache_entry, n);
       mctx->sub_tops = re_malloc (re_sub_match_top_t *, n);
-      if (BE (mctx->bkref_ents == NULL || mctx->sub_tops == NULL, 0))
+      if (__glibc_unlikely (mctx->bkref_ents == NULL || mctx->sub_tops == NULL))
        return REG_ESPACE;
     }
   /* Already zero-ed by the caller.
@@ -4207,7 +4080,6 @@ match_ctx_init (re_match_context_t *mctx, int eflags, Idx n)
    of the input, or changes the input string.  */
 
 static void
-internal_function
 match_ctx_clean (re_match_context_t *mctx)
 {
   Idx st_idx;
@@ -4227,7 +4099,7 @@ match_ctx_clean (re_match_context_t *mctx)
          re_free (top->path->array);
          re_free (top->path);
        }
-      free (top);
+      re_free (top);
     }
 
   mctx->nsub_tops = 0;
@@ -4237,7 +4109,6 @@ match_ctx_clean (re_match_context_t *mctx)
 /* Free all the memory associated with MCTX.  */
 
 static void
-internal_function
 match_ctx_free (re_match_context_t *mctx)
 {
   /* First, free all the memory associated with MCTX->SUB_TOPS.  */
@@ -4252,7 +4123,7 @@ match_ctx_free (re_match_context_t *mctx)
 */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx, Idx from,
                     Idx to)
 {
@@ -4261,7 +4132,7 @@ match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx, Idx from,
       struct re_backref_cache_entry* new_entry;
       new_entry = re_realloc (mctx->bkref_ents, struct re_backref_cache_entry,
                              mctx->abkref_ents * 2);
-      if (BE (new_entry == NULL, 0))
+      if (__glibc_unlikely (new_entry == NULL))
        {
          re_free (mctx->bkref_ents);
          return REG_ESPACE;
@@ -4301,7 +4172,6 @@ match_ctx_add_entry (re_match_context_t *mctx, Idx node, Idx str_idx, Idx from,
    found.  Note that MCTX->BKREF_ENTS is already sorted by MCTX->STR_IDX.  */
 
 static Idx
-internal_function
 search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
 {
   Idx left, right, mid, last;
@@ -4324,26 +4194,24 @@ search_cur_bkref_entry (const re_match_context_t *mctx, Idx str_idx)
    at STR_IDX.  */
 
 static reg_errcode_t
-internal_function __attribute_warn_unused_result__
+__attribute_warn_unused_result__
 match_ctx_add_subtop (re_match_context_t *mctx, Idx node, Idx str_idx)
 {
-#ifdef DEBUG
-  assert (mctx->sub_tops != NULL);
-  assert (mctx->asub_tops > 0);
-#endif
-  if (BE (mctx->nsub_tops == mctx->asub_tops, 0))
+  DEBUG_ASSERT (mctx->sub_tops != NULL);
+  DEBUG_ASSERT (mctx->asub_tops > 0);
+  if (__glibc_unlikely (mctx->nsub_tops == mctx->asub_tops))
     {
       Idx new_asub_tops = mctx->asub_tops * 2;
       re_sub_match_top_t **new_array = re_realloc (mctx->sub_tops,
                                                   re_sub_match_top_t *,
                                                   new_asub_tops);
-      if (BE (new_array == NULL, 0))
+      if (__glibc_unlikely (new_array == NULL))
        return REG_ESPACE;
       mctx->sub_tops = new_array;
       mctx->asub_tops = new_asub_tops;
     }
   mctx->sub_tops[mctx->nsub_tops] = calloc (1, sizeof (re_sub_match_top_t));
-  if (BE (mctx->sub_tops[mctx->nsub_tops] == NULL, 0))
+  if (__glibc_unlikely (mctx->sub_tops[mctx->nsub_tops] == NULL))
     return REG_ESPACE;
   mctx->sub_tops[mctx->nsub_tops]->node = node;
   mctx->sub_tops[mctx->nsub_tops++]->str_idx = str_idx;
@@ -4351,26 +4219,26 @@ match_ctx_add_subtop (re_match_context_t *mctx, Idx node, Idx str_idx)
 }
 
 /* Register the node NODE, whose type is OP_CLOSE_SUBEXP, and which matches
-   at STR_IDX, whose corresponding OP_OPEN_SUBEXP is SUB_TOP.  */
+   at STR_IDX, whose corresponding OP_OPEN_SUBEXP is SUB_TOP.
+   Return the new entry if successful, NULL if memory is exhausted.  */
 
 static re_sub_match_last_t *
-internal_function
 match_ctx_add_sublast (re_sub_match_top_t *subtop, Idx node, Idx str_idx)
 {
   re_sub_match_last_t *new_entry;
-  if (BE (subtop->nlasts == subtop->alasts, 0))
+  if (__glibc_unlikely (subtop->nlasts == subtop->alasts))
     {
       Idx new_alasts = 2 * subtop->alasts + 1;
       re_sub_match_last_t **new_array = re_realloc (subtop->lasts,
                                                    re_sub_match_last_t *,
                                                    new_alasts);
-      if (BE (new_array == NULL, 0))
+      if (__glibc_unlikely (new_array == NULL))
        return NULL;
       subtop->lasts = new_array;
       subtop->alasts = new_alasts;
     }
   new_entry = calloc (1, sizeof (re_sub_match_last_t));
-  if (BE (new_entry != NULL, 1))
+  if (__glibc_likely (new_entry != NULL))
     {
       subtop->lasts[subtop->nlasts] = new_entry;
       new_entry->node = node;
@@ -4381,7 +4249,6 @@ match_ctx_add_sublast (re_sub_match_top_t *subtop, Idx node, Idx str_idx)
 }
 
 static void
-internal_function
 sift_ctx_init (re_sift_context_t *sctx, re_dfastate_t **sifted_sts,
               re_dfastate_t **limited_sts, Idx last_node, Idx last_str_idx)
 {
index e1d169a..7eae1c7 100644 (file)
@@ -1,6 +1,6 @@
 /* Work around rename bugs in some systems.
 
-   Copyright (C) 2001-2003, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Volker Borchert, Eric Blake.  */
 
@@ -23,7 +23,7 @@
 
 #undef rename
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* The mingw rename has problems with trailing slashes; it also
    requires use of native Windows calls to allow atomic renames over
    existing files.  */
 
 # include "dirname.h"
 
+/* Don't assume that UNICODE is not defined.  */
+# undef MoveFileEx
+# define MoveFileEx MoveFileExA
+
 /* Rename the file SRC to DST.  This replacement is necessary on
    Windows, on which the system rename function will not replace
    an existing DST.  */
@@ -161,10 +165,8 @@ rpl_rename (char const *src, char const *dst)
         }
       if (rmdir (dst))
         {
-          error = errno;
           free (src_temp);
           free (dst_temp);
-          errno = error;
           return -1;
         }
       free (src_temp);
diff --git a/lib/rewinddir.c b/lib/rewinddir.c
new file mode 100644 (file)
index 0000000..26fbbac
--- /dev/null
@@ -0,0 +1,53 @@
+/* Restart reading the entries of a directory from the beginning.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <dirent.h>
+
+#include <errno.h>
+
+#include "dirent-private.h"
+
+/* Don't assume that UNICODE is not defined.  */
+#undef FindFirstFile
+#define FindFirstFile FindFirstFileA
+
+void
+rewinddir (DIR *dirp)
+{
+  /* Like in closedir().  */
+  if (dirp->current != INVALID_HANDLE_VALUE)
+    FindClose (dirp->current);
+
+  /* Like in opendir().  */
+  dirp->status = -1;
+  dirp->current = FindFirstFile (dirp->dir_name_mask, &dirp->entry);
+  if (dirp->current == INVALID_HANDLE_VALUE)
+    {
+      switch (GetLastError ())
+        {
+        case ERROR_FILE_NOT_FOUND:
+          dirp->status = -2;
+          break;
+        default:
+          /* Save the error code for the next readdir() call.  */
+          dirp->status = ENOENT;
+          break;
+        }
+    }
+}
index 4949df2..3cca0ce 100644 (file)
@@ -1,6 +1,6 @@
 /* Work around rmdir bugs.
 
-   Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2016 Free Software
+   Copyright (C) 1988, 1990, 1999, 2003-2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include <errno.h>
 #include <string.h>
 
-#include "dosname.h"
+#include "filename.h"
 
 #undef rmdir
+#if defined _WIN32 && !defined __CYGWIN__
+# define rmdir _rmdir
+#endif
 
 /* Remove directory DIR.
    Return 0 if successful, -1 if not.  */
index c7a8fb5..cf1c96e 100644 (file)
@@ -1,6 +1,6 @@
 /* Determine whether two stat buffers are known to refer to the same file.
 
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef SAME_INODE_H
 # define SAME_INODE_H 1
 
-# ifdef __VMS
+# include <sys/types.h>
+
+# if defined __VMS && __CRTL_VER < 80200000
 #  define SAME_INODE(a, b)             \
     ((a).st_ino[0] == (b).st_ino[0]    \
      && (a).st_ino[1] == (b).st_ino[1] \
      && (a).st_ino[2] == (b).st_ino[2] \
      && (a).st_dev == (b).st_dev)
-# elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* On MinGW, struct stat lacks necessary info, so always return 0.
-   Callers can use !a.st_ino to deduce that the information is unknown.  */
-#  define SAME_INODE(a, b) 0
+# elif defined _WIN32 && ! defined __CYGWIN__
+   /* Native Windows.  */
+#  if _GL_WINDOWS_STAT_INODES
+    /* stat() and fstat() set st_dev and st_ino to 0 if information about
+       the inode is not available.  */
+#   define SAME_INODE(a, b) \
+     (!((a).st_ino == 0 && (a).st_dev == 0) \
+      && (a).st_ino == (b).st_ino && (a).st_dev == (b).st_dev)
+#  else
+    /* stat() and fstat() set st_ino to 0 always.  */
+#   define SAME_INODE(a, b) 0
+#  endif
 # else
 #  define SAME_INODE(a, b)    \
     ((a).st_ino == (b).st_ino \
diff --git a/lib/save-cwd.c b/lib/save-cwd.c
new file mode 100644 (file)
index 0000000..0a18bc5
--- /dev/null
@@ -0,0 +1,97 @@
+/* save-cwd.c -- Save and restore current working directory.
+
+   Copyright (C) 1995, 1997-1998, 2003-2006, 2009-2021 Free Software
+   Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering.  */
+
+#include <config.h>
+
+#include "save-cwd.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "chdir-long.h"
+#include "unistd--.h"
+
+#if GNULIB_FCNTL_SAFER
+# include "fcntl--.h"
+#else
+# define GNULIB_FCNTL_SAFER 0
+#endif
+
+/* Record the location of the current working directory in CWD so that
+   the program may change to other directories and later use restore_cwd
+   to return to the recorded location.  This function may allocate
+   space using malloc (via getcwd) or leave a file descriptor open;
+   use free_cwd to perform the necessary free or close.  Upon failure,
+   no memory is allocated, any locally opened file descriptors are
+   closed;  return non-zero -- in that case, free_cwd need not be
+   called, but doing so is ok.  Otherwise, return zero.
+
+   The _raison d'etre_ for this interface is that the working directory
+   is sometimes inaccessible, and getcwd is not robust or as efficient.
+   So, we prefer to use the open/fchdir approach, but fall back on
+   getcwd if necessary.  This module works for most cases with just
+   the getcwd-lgpl module, but to be truly robust, use the getcwd module.
+
+   Some systems lack fchdir altogether: e.g., OS/2, pre-2001 Cygwin,
+   SCO Xenix.  Also, SunOS 4 and Irix 5.3 provide the function, yet it
+   doesn't work for partitions on which auditing is enabled.  If
+   you're still using an obsolete system with these problems, please
+   send email to the maintainer of this code.  */
+
+int
+save_cwd (struct saved_cwd *cwd)
+{
+  cwd->name = NULL;
+
+  cwd->desc = open (".", O_SEARCH | O_CLOEXEC);
+  if (!GNULIB_FCNTL_SAFER)
+    cwd->desc = fd_safer_flag (cwd->desc, O_CLOEXEC);
+  if (cwd->desc < 0)
+    {
+      cwd->name = getcwd (NULL, 0);
+      return cwd->name ? 0 : -1;
+    }
+
+  return 0;
+}
+
+/* Change to recorded location, CWD, in directory hierarchy.
+   Upon failure, return -1 (errno is set by chdir or fchdir).
+   Upon success, return zero.  */
+
+int
+restore_cwd (const struct saved_cwd *cwd)
+{
+  if (0 <= cwd->desc)
+    return fchdir (cwd->desc);
+  else
+    return chdir_long (cwd->name);
+}
+
+void
+free_cwd (struct saved_cwd *cwd)
+{
+  if (cwd->desc >= 0)
+    close (cwd->desc);
+  free (cwd->name);
+}
diff --git a/lib/save-cwd.h b/lib/save-cwd.h
new file mode 100644 (file)
index 0000000..3cefba5
--- /dev/null
@@ -0,0 +1,34 @@
+/* Save and restore current working directory.
+
+   Copyright (C) 1995, 1997-1998, 2003, 2009-2021 Free Software Foundation,
+   Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering.  */
+
+#ifndef SAVE_CWD_H
+# define SAVE_CWD_H 1
+
+struct saved_cwd
+  {
+    int desc;
+    char *name;
+  };
+
+int save_cwd (struct saved_cwd *cwd);
+int restore_cwd (const struct saved_cwd *cwd);
+void free_cwd (struct saved_cwd *cwd);
+
+#endif /* SAVE_CWD_H */
index 63ac5bd..dfa29c7 100644 (file)
@@ -1,5 +1,5 @@
 /* A GNU-like <sched.h>.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _@GUARD_PREFIX@_SCHED_H
 
 
 /* Get pid_t.
    This is needed on glibc 2.11 (see
-   glibc bug <http://sourceware.org/bugzilla/show_bug.cgi?id=13198>)
+   glibc bug <https://sourceware.org/bugzilla/show_bug.cgi?id=13198>)
    and Mac OS X 10.5.  */
 #include <sys/types.h>
 
 #ifdef __KLIBC__
-
-/* On OS/2 kLIBC, struct sched_param is in spawn.h */
+/* On OS/2 kLIBC, struct sched_param is in spawn.h.  */
 # include <spawn.h>
+#endif
 
+#ifdef __VMS
+/* On OpenVMS, struct sched_param is in <pthread.h>.  */
+# include <pthread.h>
 #endif
 
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
 #if !@HAVE_STRUCT_SCHED_PARAM@
 
 # if !GNULIB_defined_struct_sched_param
@@ -63,5 +70,30 @@ struct sched_param
 # define SCHED_OTHER  0
 #endif
 
+#if @GNULIB_SCHED_YIELD@
+# if @REPLACE_SCHED_YIELD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef sched_yield
+#   define sched_yield rpl_sched_yield
+#  endif
+_GL_FUNCDECL_RPL (sched_yield, int, (void));
+_GL_CXXALIAS_RPL (sched_yield, int, (void));
+# else
+#  if !@HAVE_SCHED_YIELD@
+_GL_FUNCDECL_SYS (sched_yield, int, (void));
+#  endif
+_GL_CXXALIAS_SYS (sched_yield, int, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (sched_yield);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef sched_yield
+# if HAVE_RAW_DECL_SCHED_YIELD
+_GL_WARN_ON_USE (sched_yield, "sched_yield is not portable - "
+                 "use gnulib module sched_yield for portability");
+# endif
+#endif
+
 #endif /* _@GUARD_PREFIX@_SCHED_H */
 #endif /* _@GUARD_PREFIX@_SCHED_H */
diff --git a/lib/scratch_buffer.h b/lib/scratch_buffer.h
new file mode 100644 (file)
index 0000000..da4455d
--- /dev/null
@@ -0,0 +1,123 @@
+/* Variable-sized buffer with on-stack default allocation.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert, 2017.  */
+
+#ifndef _GL_SCRATCH_BUFFER_H
+#define _GL_SCRATCH_BUFFER_H
+
+/* Scratch buffers with a default stack allocation and fallback to
+   heap allocation.  It is expected that this function is used in this
+   way:
+
+     struct scratch_buffer tmpbuf;
+     scratch_buffer_init (&tmpbuf);
+
+     while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+       if (!scratch_buffer_grow (&tmpbuf))
+         return -1;
+
+     scratch_buffer_free (&tmpbuf);
+     return 0;
+
+   The allocation functions (scratch_buffer_grow,
+   scratch_buffer_grow_preserve, scratch_buffer_set_array_size) make
+   sure that the heap allocation, if any, is freed, so that the code
+   above does not have a memory leak.  The buffer still remains in a
+   state that can be deallocated using scratch_buffer_free, so a loop
+   like this is valid as well:
+
+     struct scratch_buffer tmpbuf;
+     scratch_buffer_init (&tmpbuf);
+
+     while (!function_that_uses_buffer (tmpbuf.data, tmpbuf.length))
+       if (!scratch_buffer_grow (&tmpbuf))
+         break;
+
+     scratch_buffer_free (&tmpbuf);
+
+   scratch_buffer_grow and scratch_buffer_grow_preserve are guaranteed
+   to grow the buffer by at least 512 bytes.  This means that when
+   using the scratch buffer as a backing store for a non-character
+   array whose element size, in bytes, is 512 or smaller, the scratch
+   buffer only has to grow once to make room for at least one more
+   element.
+*/
+
+/* Scratch buffer.  Must be initialized with scratch_buffer_init
+   before its use.  */
+struct scratch_buffer;
+
+/* Initializes *BUFFER so that BUFFER->data points to BUFFER->__space
+   and BUFFER->length reflects the available space.  */
+#if 0
+extern void scratch_buffer_init (struct scratch_buffer *buffer);
+#endif
+
+/* Deallocates *BUFFER (if it was heap-allocated).  */
+#if 0
+extern void scratch_buffer_free (struct scratch_buffer *buffer);
+#endif
+
+/* Grow *BUFFER by some arbitrary amount.  The buffer contents is NOT
+   preserved.  Return true on success, false on allocation failure (in
+   which case the old buffer is freed).  On success, the new buffer is
+   larger than the previous size.  On failure, *BUFFER is deallocated,
+   but remains in a free-able state, and errno is set.  */
+#if 0
+extern bool scratch_buffer_grow (struct scratch_buffer *buffer);
+#endif
+
+/* Like scratch_buffer_grow, but preserve the old buffer
+   contents on success, as a prefix of the new buffer.  */
+#if 0
+extern bool scratch_buffer_grow_preserve (struct scratch_buffer *buffer);
+#endif
+
+/* Grow *BUFFER so that it can store at least NELEM elements of SIZE
+   bytes.  The buffer contents are NOT preserved.  Both NELEM and SIZE
+   can be zero.  Return true on success, false on allocation failure
+   (in which case the old buffer is freed, but *BUFFER remains in a
+   free-able state, and errno is set).  It is unspecified whether this
+   function can reduce the array size.  */
+#if 0
+extern bool scratch_buffer_set_array_size (struct scratch_buffer *buffer,
+                                           size_t nelem, size_t size);
+#endif
+
+/* Return a copy of *BUFFER's first SIZE bytes as a heap-allocated block,
+   deallocating *BUFFER if it was heap-allocated.  SIZE must be at
+   most *BUFFER's size.  Return NULL (setting errno) on memory
+   exhaustion.  */
+#if 0
+extern void *scratch_buffer_dupfree (struct scratch_buffer *buffer,
+                                     size_t size);
+#endif
+
+
+/* The implementation is imported from glibc.  */
+
+#include <libc-config.h>
+
+/* Avoid possible conflicts with symbols exported by the GNU libc.  */
+#define __libc_scratch_buffer_dupfree gl_scratch_buffer_dupfree
+#define __libc_scratch_buffer_grow gl_scratch_buffer_grow
+#define __libc_scratch_buffer_grow_preserve gl_scratch_buffer_grow_preserve
+#define __libc_scratch_buffer_set_array_size gl_scratch_buffer_set_array_size
+
+#include <malloc/scratch_buffer.h>
+
+#endif /* _GL_SCRATCH_BUFFER_H */
index 88a60dc..504f99e 100644 (file)
@@ -1,6 +1,6 @@
 /* Look up an environment variable, returning NULL in insecure situations.
 
-   Copyright 2013-2016 Free Software Foundation, Inc.
+   Copyright 2013-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -13,7 +13,7 @@
    General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -38,7 +38,7 @@ secure_getenv (char const *name)
   if (geteuid () != getuid () || getegid () != getgid ())
     return NULL;
   return getenv (name);
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ /* native Windows */
+#elif defined _WIN32 && ! defined __CYGWIN__ /* native Windows */
   /* On native Windows, there is no such concept as setuid or setgid binaries.
      - Programs launched as system services have high privileges, but they don't
        inherit environment variables from a user.
diff --git a/lib/setlocale-lock.c b/lib/setlocale-lock.c
new file mode 100644 (file)
index 0000000..5474ae0
--- /dev/null
@@ -0,0 +1,150 @@
+/* Return the internal lock used by setlocale_null_r.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+/* When it is known that the gl_get_setlocale_null_lock function is defined
+   by a dependency library, it should not be defined here.  */
+#if OMIT_SETLOCALE_LOCK
+
+/* This declaration is solely to ensure that after preprocessing
+   this file is never empty.  */
+typedef int dummy;
+
+#else
+
+/* This file defines the internal lock used by setlocale_null_r.
+   It is a separate compilation unit, so that only one copy of it is
+   present when linking statically.  */
+
+/* Prohibit renaming this symbol.  */
+# undef gl_get_setlocale_null_lock
+
+/* Macro for exporting a symbol (function, not variable) defined in this file,
+   when compiled into a shared library.  */
+# ifndef DLL_EXPORTED
+#  if HAVE_VISIBILITY
+  /* Override the effect of the compiler option '-fvisibility=hidden'.  */
+#   define DLL_EXPORTED __attribute__((__visibility__("default")))
+#  elif defined _WIN32 || defined __CYGWIN__
+#   define DLL_EXPORTED __declspec(dllexport)
+#  else
+#   define DLL_EXPORTED
+#  endif
+# endif
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+#  define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#  include <windows.h>
+
+#  include "windows-initguard.h"
+
+/* The return type is a 'CRITICAL_SECTION *', not a 'glwthread_mutex_t *',
+   because the latter is not guaranteed to be a stable ABI in the future.  */
+
+/* Make sure the function gets exported from DLLs.  */
+DLL_EXPORTED CRITICAL_SECTION *gl_get_setlocale_null_lock (void);
+
+static glwthread_initguard_t guard = GLWTHREAD_INITGUARD_INIT;
+static CRITICAL_SECTION lock;
+
+/* Returns the internal lock used by setlocale_null_r.  */
+CRITICAL_SECTION *
+gl_get_setlocale_null_lock (void)
+{
+  if (!guard.done)
+    {
+      if (InterlockedIncrement (&guard.started) == 0)
+        {
+          /* This thread is the first one to need the lock.  Initialize it.  */
+          InitializeCriticalSection (&lock);
+          guard.done = 1;
+        }
+      else
+        {
+          /* Don't let guard.started grow and wrap around.  */
+          InterlockedDecrement (&guard.started);
+          /* Yield the CPU while waiting for another thread to finish
+             initializing this mutex.  */
+          while (!guard.done)
+            Sleep (0);
+        }
+    }
+  return &lock;
+}
+
+# elif HAVE_PTHREAD_API
+
+#  include <pthread.h>
+
+static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
+
+/* Make sure the function gets exported from shared libraries.  */
+DLL_EXPORTED pthread_mutex_t *gl_get_setlocale_null_lock (void);
+
+/* Returns the internal lock used by setlocale_null_r.  */
+pthread_mutex_t *
+gl_get_setlocale_null_lock (void)
+{
+  return &mutex;
+}
+
+# elif HAVE_THREADS_H
+
+#  include <threads.h>
+#  include <stdlib.h>
+
+static int volatile init_needed = 1;
+static once_flag init_once = ONCE_FLAG_INIT;
+static mtx_t mutex;
+
+static void
+atomic_init (void)
+{
+  if (mtx_init (&mutex, mtx_plain) != thrd_success)
+    abort ();
+  init_needed = 0;
+}
+
+/* Make sure the function gets exported from shared libraries.  */
+DLL_EXPORTED mtx_t *gl_get_setlocale_null_lock (void);
+
+/* Returns the internal lock used by setlocale_null_r.  */
+mtx_t *
+gl_get_setlocale_null_lock (void)
+{
+  if (init_needed)
+    call_once (&init_once, atomic_init);
+  return &mutex;
+}
+
+# endif
+
+# if (defined _WIN32 || defined __CYGWIN__) && !defined _MSC_VER
+/* Make sure the '__declspec(dllimport)' in setlocale_null.c does not cause
+   a link failure when no DLLs are involved.  */
+#  if defined _WIN64 || defined _LP64
+#   define IMP(x) __imp_##x
+#  else
+#   define IMP(x) _imp__##x
+#  endif
+void * IMP(gl_get_setlocale_null_lock) = &gl_get_setlocale_null_lock;
+# endif
+
+#endif
diff --git a/lib/setlocale.c b/lib/setlocale.c
new file mode 100644 (file)
index 0000000..0479ee5
--- /dev/null
@@ -0,0 +1,1673 @@
+/* Set the current locale.  -*- coding: utf-8 -*-
+   Copyright (C) 2009, 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
+
+#include <config.h>
+
+/* Override setlocale() so that when the default locale is requested
+   (locale = ""), the environment variables LC_ALL, LC_*, and LANG are
+   considered.
+   Also include all the functionality from libintl's setlocale() override.  */
+
+/* Please keep this file in sync with
+   gettext/gettext-runtime/intl/setlocale.c !  */
+
+/* Specification.  */
+#include <locale.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "localename.h"
+
+#if HAVE_CFLOCALECOPYPREFERREDLANGUAGES || HAVE_CFPREFERENCESCOPYAPPVALUE
+# if HAVE_CFLOCALECOPYPREFERREDLANGUAGES
+#  include <CoreFoundation/CFLocale.h>
+# elif HAVE_CFPREFERENCESCOPYAPPVALUE
+#  include <CoreFoundation/CFPreferences.h>
+# endif
+# include <CoreFoundation/CFPropertyList.h>
+# include <CoreFoundation/CFArray.h>
+# include <CoreFoundation/CFString.h>
+extern void gl_locale_name_canonicalize (char *name);
+#endif
+
+#if 1
+
+# undef setlocale
+
+/* Which of the replacements to activate?  */
+# if NEED_SETLOCALE_IMPROVED
+#  define setlocale_improved rpl_setlocale
+# elif NEED_SETLOCALE_MTSAFE
+#  define setlocale_mtsafe rpl_setlocale
+# else
+#  error "This file should only be compiled if NEED_SETLOCALE_IMPROVED || NEED_SETLOCALE_MTSAFE."
+# endif
+
+/* Like setlocale, but guaranteed to be multithread-safe if LOCALE == NULL.  */
+# if !SETLOCALE_NULL_ALL_MTSAFE || !SETLOCALE_NULL_ONE_MTSAFE /* i.e. if NEED_SETLOCALE_MTSAFE */
+
+#  if NEED_SETLOCALE_IMPROVED
+static
+#  endif
+char *
+setlocale_mtsafe (int category, const char *locale)
+{
+  if (locale == NULL)
+    return (char *) setlocale_null (category);
+  else
+    return setlocale (category, locale);
+}
+# else /* !NEED_SETLOCALE_MTSAFE */
+
+#  define setlocale_mtsafe setlocale
+
+# endif /* NEED_SETLOCALE_MTSAFE */
+
+# if NEED_SETLOCALE_IMPROVED
+
+/* Return string representation of locale category CATEGORY.  */
+static const char *
+category_to_name (int category)
+{
+  const char *retval;
+
+  switch (category)
+  {
+  case LC_COLLATE:
+    retval = "LC_COLLATE";
+    break;
+  case LC_CTYPE:
+    retval = "LC_CTYPE";
+    break;
+  case LC_MONETARY:
+    retval = "LC_MONETARY";
+    break;
+  case LC_NUMERIC:
+    retval = "LC_NUMERIC";
+    break;
+  case LC_TIME:
+    retval = "LC_TIME";
+    break;
+  case LC_MESSAGES:
+    retval = "LC_MESSAGES";
+    break;
+  default:
+    /* If you have a better idea for a default value let me know.  */
+    retval = "LC_XXX";
+  }
+
+  return retval;
+}
+
+#  if defined _WIN32 && ! defined __CYGWIN__
+
+/* The native Windows setlocale() function expects locale names of the form
+   "German" or "German_Germany" or "DEU", but not "de" or "de_DE".  We need
+   to convert the names from the form with ISO 639 language code and ISO 3166
+   country code to the form with English names or with three-letter identifier.
+   The three-letter identifiers known by a Windows XP SP2 or SP3 are:
+     AFK  Afrikaans_South Africa.1252
+     ARA  Arabic_Saudi Arabia.1256
+     ARB  Arabic_Lebanon.1256
+     ARE  Arabic_Egypt.1256
+     ARG  Arabic_Algeria.1256
+     ARH  Arabic_Bahrain.1256
+     ARI  Arabic_Iraq.1256
+     ARJ  Arabic_Jordan.1256
+     ARK  Arabic_Kuwait.1256
+     ARL  Arabic_Libya.1256
+     ARM  Arabic_Morocco.1256
+     ARO  Arabic_Oman.1256
+     ARQ  Arabic_Qatar.1256
+     ARS  Arabic_Syria.1256
+     ART  Arabic_Tunisia.1256
+     ARU  Arabic_U.A.E..1256
+     ARY  Arabic_Yemen.1256
+     AZE  Azeri (Latin)_Azerbaijan.1254
+     BEL  Belarusian_Belarus.1251
+     BGR  Bulgarian_Bulgaria.1251
+     BSB  Bosnian_Bosnia and Herzegovina.1250
+     BSC  Bosnian (Cyrillic)_Bosnia and Herzegovina.1250  (wrong encoding!)
+     CAT  Catalan_Spain.1252
+     CHH  Chinese_Hong Kong S.A.R..950
+     CHI  Chinese_Singapore.936
+     CHS  Chinese_People's Republic of China.936
+     CHT  Chinese_Taiwan.950
+     CSY  Czech_Czech Republic.1250
+     CYM  Welsh_United Kingdom.1252
+     DAN  Danish_Denmark.1252
+     DEA  German_Austria.1252
+     DEC  German_Liechtenstein.1252
+     DEL  German_Luxembourg.1252
+     DES  German_Switzerland.1252
+     DEU  German_Germany.1252
+     ELL  Greek_Greece.1253
+     ENA  English_Australia.1252
+     ENB  English_Caribbean.1252
+     ENC  English_Canada.1252
+     ENG  English_United Kingdom.1252
+     ENI  English_Ireland.1252
+     ENJ  English_Jamaica.1252
+     ENL  English_Belize.1252
+     ENP  English_Republic of the Philippines.1252
+     ENS  English_South Africa.1252
+     ENT  English_Trinidad and Tobago.1252
+     ENU  English_United States.1252
+     ENW  English_Zimbabwe.1252
+     ENZ  English_New Zealand.1252
+     ESA  Spanish_Panama.1252
+     ESB  Spanish_Bolivia.1252
+     ESC  Spanish_Costa Rica.1252
+     ESD  Spanish_Dominican Republic.1252
+     ESE  Spanish_El Salvador.1252
+     ESF  Spanish_Ecuador.1252
+     ESG  Spanish_Guatemala.1252
+     ESH  Spanish_Honduras.1252
+     ESI  Spanish_Nicaragua.1252
+     ESL  Spanish_Chile.1252
+     ESM  Spanish_Mexico.1252
+     ESN  Spanish_Spain.1252
+     ESO  Spanish_Colombia.1252
+     ESP  Spanish_Spain.1252
+     ESR  Spanish_Peru.1252
+     ESS  Spanish_Argentina.1252
+     ESU  Spanish_Puerto Rico.1252
+     ESV  Spanish_Venezuela.1252
+     ESY  Spanish_Uruguay.1252
+     ESZ  Spanish_Paraguay.1252
+     ETI  Estonian_Estonia.1257
+     EUQ  Basque_Spain.1252
+     FAR  Farsi_Iran.1256
+     FIN  Finnish_Finland.1252
+     FOS  Faroese_Faroe Islands.1252
+     FPO  Filipino_Philippines.1252
+     FRA  French_France.1252
+     FRB  French_Belgium.1252
+     FRC  French_Canada.1252
+     FRL  French_Luxembourg.1252
+     FRM  French_Principality of Monaco.1252
+     FRS  French_Switzerland.1252
+     FYN  Frisian_Netherlands.1252
+     GLC  Galician_Spain.1252
+     HEB  Hebrew_Israel.1255
+     HRB  Croatian_Bosnia and Herzegovina.1250
+     HRV  Croatian_Croatia.1250
+     HUN  Hungarian_Hungary.1250
+     IND  Indonesian_Indonesia.1252
+     IRE  Irish_Ireland.1252
+     ISL  Icelandic_Iceland.1252
+     ITA  Italian_Italy.1252
+     ITS  Italian_Switzerland.1252
+     IUK  Inuktitut (Latin)_Canada.1252
+     JPN  Japanese_Japan.932
+     KKZ  Kazakh_Kazakhstan.1251
+     KOR  Korean_Korea.949
+     KYR  Kyrgyz_Kyrgyzstan.1251
+     LBX  Luxembourgish_Luxembourg.1252
+     LTH  Lithuanian_Lithuania.1257
+     LVI  Latvian_Latvia.1257
+     MKI  FYRO Macedonian_Former Yugoslav Republic of Macedonia.1251
+     MON  Mongolian_Mongolia.1251
+     MPD  Mapudungun_Chile.1252
+     MSB  Malay_Brunei Darussalam.1252
+     MSL  Malay_Malaysia.1252
+     MWK  Mohawk_Canada.1252
+     NLB  Dutch_Belgium.1252
+     NLD  Dutch_Netherlands.1252
+     NON  Norwegian-Nynorsk_Norway.1252
+     NOR  Norwegian (Bokmål)_Norway.1252
+     NSO  Northern Sotho_South Africa.1252
+     PLK  Polish_Poland.1250
+     PTB  Portuguese_Brazil.1252
+     PTG  Portuguese_Portugal.1252
+     QUB  Quechua_Bolivia.1252
+     QUE  Quechua_Ecuador.1252
+     QUP  Quechua_Peru.1252
+     RMC  Romansh_Switzerland.1252
+     ROM  Romanian_Romania.1250
+     RUS  Russian_Russia.1251
+     SKY  Slovak_Slovakia.1250
+     SLV  Slovenian_Slovenia.1250
+     SMA  Sami (Southern)_Norway.1252
+     SMB  Sami (Southern)_Sweden.1252
+     SME  Sami (Northern)_Norway.1252
+     SMF  Sami (Northern)_Sweden.1252
+     SMG  Sami (Northern)_Finland.1252
+     SMJ  Sami (Lule)_Norway.1252
+     SMK  Sami (Lule)_Sweden.1252
+     SMN  Sami (Inari)_Finland.1252
+     SMS  Sami (Skolt)_Finland.1252
+     SQI  Albanian_Albania.1250
+     SRB  Serbian (Cyrillic)_Serbia and Montenegro.1251
+     SRL  Serbian (Latin)_Serbia and Montenegro.1250
+     SRN  Serbian (Cyrillic)_Bosnia and Herzegovina.1251
+     SRS  Serbian (Latin)_Bosnia and Herzegovina.1250
+     SVE  Swedish_Sweden.1252
+     SVF  Swedish_Finland.1252
+     SWK  Swahili_Kenya.1252
+     THA  Thai_Thailand.874
+     TRK  Turkish_Turkey.1254
+     TSN  Tswana_South Africa.1252
+     TTT  Tatar_Russia.1251
+     UKR  Ukrainian_Ukraine.1251
+     URD  Urdu_Islamic Republic of Pakistan.1256
+     USA  English_United States.1252
+     UZB  Uzbek (Latin)_Uzbekistan.1254
+     VIT  Vietnamese_Viet Nam.1258
+     XHO  Xhosa_South Africa.1252
+     ZHH  Chinese_Hong Kong S.A.R..950
+     ZHI  Chinese_Singapore.936
+     ZHM  Chinese_Macau S.A.R..950
+     ZUL  Zulu_South Africa.1252
+ */
+
+/* Table from ISO 639 language code, optionally with country or script suffix,
+   to English name.
+   Keep in sync with the gl_locale_name_from_win32_LANGID function in
+   localename.c!  */
+struct table_entry
+{
+  const char *code;
+  const char *english;
+};
+static const struct table_entry language_table[] =
+  {
+    { "af", "Afrikaans" },
+    { "am", "Amharic" },
+    { "ar", "Arabic" },
+    { "arn", "Mapudungun" },
+    { "as", "Assamese" },
+    { "az@cyrillic", "Azeri (Cyrillic)" },
+    { "az@latin", "Azeri (Latin)" },
+    { "ba", "Bashkir" },
+    { "be", "Belarusian" },
+    { "ber", "Tamazight" },
+    { "ber@arabic", "Tamazight (Arabic)" },
+    { "ber@latin", "Tamazight (Latin)" },
+    { "bg", "Bulgarian" },
+    { "bin", "Edo" },
+    { "bn", "Bengali" },
+    { "bn_BD", "Bengali (Bangladesh)" },
+    { "bn_IN", "Bengali (India)" },
+    { "bnt", "Sutu" },
+    { "bo", "Tibetan" },
+    { "br", "Breton" },
+    { "bs", "BSB" }, /* "Bosnian (Latin)" */
+    { "bs@cyrillic", "BSC" }, /* Bosnian (Cyrillic) */
+    { "ca", "Catalan" },
+    { "chr", "Cherokee" },
+    { "co", "Corsican" },
+    { "cpe", "Hawaiian" },
+    { "cs", "Czech" },
+    { "cy", "Welsh" },
+    { "da", "Danish" },
+    { "de", "German" },
+    { "dsb", "Lower Sorbian" },
+    { "dv", "Divehi" },
+    { "el", "Greek" },
+    { "en", "English" },
+    { "es", "Spanish" },
+    { "et", "Estonian" },
+    { "eu", "Basque" },
+    { "fa", "Farsi" },
+    { "ff", "Fulfulde" },
+    { "fi", "Finnish" },
+    { "fo", "Faroese" }, /* "Faeroese" does not work */
+    { "fr", "French" },
+    { "fy", "Frisian" },
+    { "ga", "IRE" }, /* Gaelic (Ireland) */
+    { "gd", "Gaelic (Scotland)" },
+    { "gd", "Scottish Gaelic" },
+    { "gl", "Galician" },
+    { "gn", "Guarani" },
+    { "gsw", "Alsatian" },
+    { "gu", "Gujarati" },
+    { "ha", "Hausa" },
+    { "he", "Hebrew" },
+    { "hi", "Hindi" },
+    { "hr", "Croatian" },
+    { "hsb", "Upper Sorbian" },
+    { "hu", "Hungarian" },
+    { "hy", "Armenian" },
+    { "id", "Indonesian" },
+    { "ig", "Igbo" },
+    { "ii", "Yi" },
+    { "is", "Icelandic" },
+    { "it", "Italian" },
+    { "iu", "IUK" }, /* Inuktitut */
+    { "ja", "Japanese" },
+    { "ka", "Georgian" },
+    { "kk", "Kazakh" },
+    { "kl", "Greenlandic" },
+    { "km", "Cambodian" },
+    { "km", "Khmer" },
+    { "kn", "Kannada" },
+    { "ko", "Korean" },
+    { "kok", "Konkani" },
+    { "kr", "Kanuri" },
+    { "ks", "Kashmiri" },
+    { "ks_IN", "Kashmiri_India" },
+    { "ks_PK", "Kashmiri (Arabic)_Pakistan" },
+    { "ky", "Kyrgyz" },
+    { "la", "Latin" },
+    { "lb", "Luxembourgish" },
+    { "lo", "Lao" },
+    { "lt", "Lithuanian" },
+    { "lv", "Latvian" },
+    { "mi", "Maori" },
+    { "mk", "FYRO Macedonian" },
+    { "mk", "Macedonian" },
+    { "ml", "Malayalam" },
+    { "mn", "Mongolian" },
+    { "mni", "Manipuri" },
+    { "moh", "Mohawk" },
+    { "mr", "Marathi" },
+    { "ms", "Malay" },
+    { "mt", "Maltese" },
+    { "my", "Burmese" },
+    { "nb", "NOR" }, /* Norwegian Bokmål */
+    { "ne", "Nepali" },
+    { "nic", "Ibibio" },
+    { "nl", "Dutch" },
+    { "nn", "NON" }, /* Norwegian Nynorsk */
+    { "no", "Norwegian" },
+    { "nso", "Northern Sotho" },
+    { "nso", "Sepedi" },
+    { "oc", "Occitan" },
+    { "om", "Oromo" },
+    { "or", "Oriya" },
+    { "pa", "Punjabi" },
+    { "pap", "Papiamentu" },
+    { "pl", "Polish" },
+    { "prs", "Dari" },
+    { "ps", "Pashto" },
+    { "pt", "Portuguese" },
+    { "qu", "Quechua" },
+    { "qut", "K'iche'" },
+    { "rm", "Romansh" },
+    { "ro", "Romanian" },
+    { "ru", "Russian" },
+    { "rw", "Kinyarwanda" },
+    { "sa", "Sanskrit" },
+    { "sah", "Yakut" },
+    { "sd", "Sindhi" },
+    { "se", "Sami (Northern)" },
+    { "se", "Northern Sami" },
+    { "si", "Sinhalese" },
+    { "sk", "Slovak" },
+    { "sl", "Slovenian" },
+    { "sma", "Sami (Southern)" },
+    { "sma", "Southern Sami" },
+    { "smj", "Sami (Lule)" },
+    { "smj", "Lule Sami" },
+    { "smn", "Sami (Inari)" },
+    { "smn", "Inari Sami" },
+    { "sms", "Sami (Skolt)" },
+    { "sms", "Skolt Sami" },
+    { "so", "Somali" },
+    { "sq", "Albanian" },
+    { "sr", "Serbian (Latin)" },
+    { "sr@cyrillic", "SRB" }, /* Serbian (Cyrillic) */
+    { "sv", "Swedish" },
+    { "sw", "Swahili" },
+    { "syr", "Syriac" },
+    { "ta", "Tamil" },
+    { "te", "Telugu" },
+    { "tg", "Tajik" },
+    { "th", "Thai" },
+    { "ti", "Tigrinya" },
+    { "tk", "Turkmen" },
+    { "tl", "Filipino" },
+    { "tn", "Tswana" },
+    { "tr", "Turkish" },
+    { "ts", "Tsonga" },
+    { "tt", "Tatar" },
+    { "ug", "Uighur" },
+    { "uk", "Ukrainian" },
+    { "ur", "Urdu" },
+    { "uz", "Uzbek" },
+    { "uz", "Uzbek (Latin)" },
+    { "uz@cyrillic", "Uzbek (Cyrillic)" },
+    { "ve", "Venda" },
+    { "vi", "Vietnamese" },
+    { "wen", "Sorbian" },
+    { "wo", "Wolof" },
+    { "xh", "Xhosa" },
+    { "yi", "Yiddish" },
+    { "yo", "Yoruba" },
+    { "zh", "Chinese" },
+    { "zu", "Zulu" }
+  };
+
+/* Table from ISO 3166 country code to English name.
+   Keep in sync with the gl_locale_name_from_win32_LANGID function in
+   localename.c!  */
+static const struct table_entry country_table[] =
+  {
+    { "AE", "U.A.E." },
+    { "AF", "Afghanistan" },
+    { "AL", "Albania" },
+    { "AM", "Armenia" },
+    { "AN", "Netherlands Antilles" },
+    { "AR", "Argentina" },
+    { "AT", "Austria" },
+    { "AU", "Australia" },
+    { "AZ", "Azerbaijan" },
+    { "BA", "Bosnia and Herzegovina" },
+    { "BD", "Bangladesh" },
+    { "BE", "Belgium" },
+    { "BG", "Bulgaria" },
+    { "BH", "Bahrain" },
+    { "BN", "Brunei Darussalam" },
+    { "BO", "Bolivia" },
+    { "BR", "Brazil" },
+    { "BT", "Bhutan" },
+    { "BY", "Belarus" },
+    { "BZ", "Belize" },
+    { "CA", "Canada" },
+    { "CG", "Congo" },
+    { "CH", "Switzerland" },
+    { "CI", "Cote d'Ivoire" },
+    { "CL", "Chile" },
+    { "CM", "Cameroon" },
+    { "CN", "People's Republic of China" },
+    { "CO", "Colombia" },
+    { "CR", "Costa Rica" },
+    { "CS", "Serbia and Montenegro" },
+    { "CZ", "Czech Republic" },
+    { "DE", "Germany" },
+    { "DK", "Denmark" },
+    { "DO", "Dominican Republic" },
+    { "DZ", "Algeria" },
+    { "EC", "Ecuador" },
+    { "EE", "Estonia" },
+    { "EG", "Egypt" },
+    { "ER", "Eritrea" },
+    { "ES", "Spain" },
+    { "ET", "Ethiopia" },
+    { "FI", "Finland" },
+    { "FO", "Faroe Islands" },
+    { "FR", "France" },
+    { "GB", "United Kingdom" },
+    { "GD", "Caribbean" },
+    { "GE", "Georgia" },
+    { "GL", "Greenland" },
+    { "GR", "Greece" },
+    { "GT", "Guatemala" },
+    { "HK", "Hong Kong" },
+    { "HK", "Hong Kong S.A.R." },
+    { "HN", "Honduras" },
+    { "HR", "Croatia" },
+    { "HT", "Haiti" },
+    { "HU", "Hungary" },
+    { "ID", "Indonesia" },
+    { "IE", "Ireland" },
+    { "IL", "Israel" },
+    { "IN", "India" },
+    { "IQ", "Iraq" },
+    { "IR", "Iran" },
+    { "IS", "Iceland" },
+    { "IT", "Italy" },
+    { "JM", "Jamaica" },
+    { "JO", "Jordan" },
+    { "JP", "Japan" },
+    { "KE", "Kenya" },
+    { "KG", "Kyrgyzstan" },
+    { "KH", "Cambodia" },
+    { "KR", "South Korea" },
+    { "KW", "Kuwait" },
+    { "KZ", "Kazakhstan" },
+    { "LA", "Laos" },
+    { "LB", "Lebanon" },
+    { "LI", "Liechtenstein" },
+    { "LK", "Sri Lanka" },
+    { "LT", "Lithuania" },
+    { "LU", "Luxembourg" },
+    { "LV", "Latvia" },
+    { "LY", "Libya" },
+    { "MA", "Morocco" },
+    { "MC", "Principality of Monaco" },
+    { "MD", "Moldava" },
+    { "MD", "Moldova" },
+    { "ME", "Montenegro" },
+    { "MK", "Former Yugoslav Republic of Macedonia" },
+    { "ML", "Mali" },
+    { "MM", "Myanmar" },
+    { "MN", "Mongolia" },
+    { "MO", "Macau S.A.R." },
+    { "MT", "Malta" },
+    { "MV", "Maldives" },
+    { "MX", "Mexico" },
+    { "MY", "Malaysia" },
+    { "NG", "Nigeria" },
+    { "NI", "Nicaragua" },
+    { "NL", "Netherlands" },
+    { "NO", "Norway" },
+    { "NP", "Nepal" },
+    { "NZ", "New Zealand" },
+    { "OM", "Oman" },
+    { "PA", "Panama" },
+    { "PE", "Peru" },
+    { "PH", "Philippines" },
+    { "PK", "Islamic Republic of Pakistan" },
+    { "PL", "Poland" },
+    { "PR", "Puerto Rico" },
+    { "PT", "Portugal" },
+    { "PY", "Paraguay" },
+    { "QA", "Qatar" },
+    { "RE", "Reunion" },
+    { "RO", "Romania" },
+    { "RS", "Serbia" },
+    { "RU", "Russia" },
+    { "RW", "Rwanda" },
+    { "SA", "Saudi Arabia" },
+    { "SE", "Sweden" },
+    { "SG", "Singapore" },
+    { "SI", "Slovenia" },
+    { "SK", "Slovak" },
+    { "SN", "Senegal" },
+    { "SO", "Somalia" },
+    { "SR", "Suriname" },
+    { "SV", "El Salvador" },
+    { "SY", "Syria" },
+    { "TH", "Thailand" },
+    { "TJ", "Tajikistan" },
+    { "TM", "Turkmenistan" },
+    { "TN", "Tunisia" },
+    { "TR", "Turkey" },
+    { "TT", "Trinidad and Tobago" },
+    { "TW", "Taiwan" },
+    { "TZ", "Tanzania" },
+    { "UA", "Ukraine" },
+    { "US", "United States" },
+    { "UY", "Uruguay" },
+    { "VA", "Vatican" },
+    { "VE", "Venezuela" },
+    { "VN", "Viet Nam" },
+    { "YE", "Yemen" },
+    { "ZA", "South Africa" },
+    { "ZW", "Zimbabwe" }
+  };
+
+/* Given a string STRING, find the set of indices i such that TABLE[i].code is
+   the given STRING.  It is a range [lo,hi-1].  */
+typedef struct { size_t lo; size_t hi; } range_t;
+static void
+search (const struct table_entry *table, size_t table_size, const char *string,
+        range_t *result)
+{
+  /* The table is sorted.  Perform a binary search.  */
+  size_t hi = table_size;
+  size_t lo = 0;
+  while (lo < hi)
+    {
+      /* Invariant:
+         for i < lo, strcmp (table[i].code, string) < 0,
+         for i >= hi, strcmp (table[i].code, string) > 0.  */
+      size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+      int cmp = strcmp (table[mid].code, string);
+      if (cmp < 0)
+        lo = mid + 1;
+      else if (cmp > 0)
+        hi = mid;
+      else
+        {
+          /* Found an i with
+               strcmp (language_table[i].code, string) == 0.
+             Find the entire interval of such i.  */
+          {
+            size_t i;
+
+            for (i = mid; i > lo; )
+              {
+                i--;
+                if (strcmp (table[i].code, string) < 0)
+                  {
+                    lo = i + 1;
+                    break;
+                  }
+              }
+          }
+          {
+            size_t i;
+
+            for (i = mid + 1; i < hi; i++)
+              {
+                if (strcmp (table[i].code, string) > 0)
+                  {
+                    hi = i;
+                    break;
+                  }
+              }
+          }
+          /* The set of i with
+               strcmp (language_table[i].code, string) == 0
+             is the interval [lo, hi-1].  */
+          break;
+        }
+    }
+  result->lo = lo;
+  result->hi = hi;
+}
+
+/* Like setlocale, but accept also locale names in the form ll or ll_CC,
+   where ll is an ISO 639 language code and CC is an ISO 3166 country code.  */
+static char *
+setlocale_unixlike (int category, const char *locale)
+{
+  char *result;
+  char llCC_buf[64];
+  char ll_buf[64];
+  char CC_buf[64];
+
+  /* The native Windows implementation of setlocale understands the special
+     locale name "C", but not "POSIX".  Therefore map "POSIX" to "C".  */
+  if (locale != NULL && strcmp (locale, "POSIX") == 0)
+    locale = "C";
+
+  /* First, try setlocale with the original argument unchanged.  */
+  result = setlocale_mtsafe (category, locale);
+  if (result != NULL)
+    return result;
+
+  /* Otherwise, assume the argument is in the form
+       language[_territory][.codeset][@modifier]
+     and try to map it using the tables.  */
+  if (strlen (locale) < sizeof (llCC_buf))
+    {
+      /* Second try: Remove the codeset part.  */
+      {
+        const char *p = locale;
+        char *q = llCC_buf;
+
+        /* Copy the part before the dot.  */
+        for (; *p != '\0' && *p != '.'; p++, q++)
+          *q = *p;
+        if (*p == '.')
+          /* Skip the part up to the '@', if any.  */
+          for (; *p != '\0' && *p != '@'; p++)
+            ;
+        /* Copy the part starting with '@', if any.  */
+        for (; *p != '\0'; p++, q++)
+          *q = *p;
+        *q = '\0';
+      }
+      /* llCC_buf now contains
+           language[_territory][@modifier]
+       */
+      if (strcmp (llCC_buf, locale) != 0)
+        {
+          result = setlocale (category, llCC_buf);
+          if (result != NULL)
+            return result;
+        }
+      /* Look it up in language_table.  */
+      {
+        range_t range;
+        size_t i;
+
+        search (language_table,
+                sizeof (language_table) / sizeof (language_table[0]),
+                llCC_buf,
+                &range);
+
+        for (i = range.lo; i < range.hi; i++)
+          {
+            /* Try the replacement in language_table[i].  */
+            result = setlocale (category, language_table[i].english);
+            if (result != NULL)
+              return result;
+          }
+      }
+      /* Split language[_territory][@modifier]
+         into  ll_buf = language[@modifier]
+         and   CC_buf = territory
+       */
+      {
+        const char *underscore = strchr (llCC_buf, '_');
+        if (underscore != NULL)
+          {
+            const char *territory_start = underscore + 1;
+            const char *territory_end = strchr (territory_start, '@');
+            if (territory_end == NULL)
+              territory_end = territory_start + strlen (territory_start);
+
+            memcpy (ll_buf, llCC_buf, underscore - llCC_buf);
+            strcpy (ll_buf + (underscore - llCC_buf), territory_end);
+
+            memcpy (CC_buf, territory_start, territory_end - territory_start);
+            CC_buf[territory_end - territory_start] = '\0';
+
+            {
+              /* Look up ll_buf in language_table
+                 and CC_buf in country_table.  */
+              range_t language_range;
+
+              search (language_table,
+                      sizeof (language_table) / sizeof (language_table[0]),
+                      ll_buf,
+                      &language_range);
+              if (language_range.lo < language_range.hi)
+                {
+                  range_t country_range;
+
+                  search (country_table,
+                          sizeof (country_table) / sizeof (country_table[0]),
+                          CC_buf,
+                          &country_range);
+                  if (country_range.lo < country_range.hi)
+                    {
+                      size_t i;
+                      size_t j;
+
+                      for (i = language_range.lo; i < language_range.hi; i++)
+                        for (j = country_range.lo; j < country_range.hi; j++)
+                          {
+                            /* Concatenate the replacements.  */
+                            const char *part1 = language_table[i].english;
+                            size_t part1_len = strlen (part1);
+                            const char *part2 = country_table[j].english;
+                            size_t part2_len = strlen (part2) + 1;
+                            char buf[64+64];
+
+                            if (!(part1_len + 1 + part2_len <= sizeof (buf)))
+                              abort ();
+                            memcpy (buf, part1, part1_len);
+                            buf[part1_len] = '_';
+                            memcpy (buf + part1_len + 1, part2, part2_len);
+
+                            /* Try the concatenated replacements.  */
+                            result = setlocale (category, buf);
+                            if (result != NULL)
+                              return result;
+                          }
+                    }
+
+                  /* Try omitting the country entirely.  This may set a locale
+                     corresponding to the wrong country, but is better than
+                     failing entirely.  */
+                  {
+                    size_t i;
+
+                    for (i = language_range.lo; i < language_range.hi; i++)
+                      {
+                        /* Try only the language replacement.  */
+                        result =
+                          setlocale (category, language_table[i].english);
+                        if (result != NULL)
+                          return result;
+                      }
+                  }
+                }
+            }
+          }
+      }
+    }
+
+  /* Failed.  */
+  return NULL;
+}
+
+#  elif defined __ANDROID__
+
+/* Like setlocale, but accept also the locale names "C" and "POSIX".  */
+static char *
+setlocale_unixlike (int category, const char *locale)
+{
+  char *result = setlocale_mtsafe (category, locale);
+  if (result == NULL)
+    switch (category)
+      {
+      case LC_CTYPE:
+      case LC_NUMERIC:
+      case LC_TIME:
+      case LC_COLLATE:
+      case LC_MONETARY:
+      case LC_MESSAGES:
+      case LC_ALL:
+      case LC_PAPER:
+      case LC_NAME:
+      case LC_ADDRESS:
+      case LC_TELEPHONE:
+      case LC_MEASUREMENT:
+        if (locale == NULL
+            || strcmp (locale, "C") == 0 || strcmp (locale, "POSIX") == 0)
+          result = (char *) "C";
+        break;
+      default:
+        break;
+      }
+  return result;
+}
+#   define setlocale setlocale_unixlike
+
+#  else
+#   define setlocale_unixlike setlocale_mtsafe
+#  endif
+
+#  if LC_MESSAGES == 1729
+
+/* The system does not store an LC_MESSAGES locale category.  Do it here.  */
+static char lc_messages_name[64] = "C";
+
+/* Like setlocale, but support also LC_MESSAGES.  */
+static char *
+setlocale_single (int category, const char *locale)
+{
+  if (category == LC_MESSAGES)
+    {
+      if (locale != NULL)
+        {
+          lc_messages_name[sizeof (lc_messages_name) - 1] = '\0';
+          strncpy (lc_messages_name, locale, sizeof (lc_messages_name) - 1);
+        }
+      return lc_messages_name;
+    }
+  else
+    return setlocale_unixlike (category, locale);
+}
+
+#  else
+#   define setlocale_single setlocale_unixlike
+#  endif
+
+#  if defined __APPLE__ && defined __MACH__
+
+/* Mapping from language to main territory where that language is spoken.  */
+static char const locales_with_principal_territory[][6 + 1] =
+  {
+                /* Language     Main territory */
+    "ace_ID",   /* Achinese     Indonesia */
+    "af_ZA",    /* Afrikaans    South Africa */
+    "ak_GH",    /* Akan         Ghana */
+    "am_ET",    /* Amharic      Ethiopia */
+    "an_ES",    /* Aragonese    Spain */
+    "ang_GB",   /* Old English  Britain */
+    "arn_CL",   /* Mapudungun   Chile */
+    "as_IN",    /* Assamese     India */
+    "ast_ES",   /* Asturian     Spain */
+    "av_RU",    /* Avaric       Russia */
+    "awa_IN",   /* Awadhi       India */
+    "az_AZ",    /* Azerbaijani  Azerbaijan */
+    "ban_ID",   /* Balinese     Indonesia */
+    "be_BY",    /* Belarusian   Belarus */
+    "bej_SD",   /* Beja         Sudan */
+    "bem_ZM",   /* Bemba        Zambia */
+    "bg_BG",    /* Bulgarian    Bulgaria */
+    "bho_IN",   /* Bhojpuri     India */
+    "bi_VU",    /* Bislama      Vanuatu */
+    "bik_PH",   /* Bikol        Philippines */
+    "bin_NG",   /* Bini         Nigeria */
+    "bm_ML",    /* Bambara      Mali */
+    "bn_IN",    /* Bengali      India */
+    "bo_CN",    /* Tibetan      China */
+    "br_FR",    /* Breton       France */
+    "bs_BA",    /* Bosnian      Bosnia */
+    "bug_ID",   /* Buginese     Indonesia */
+    "ca_ES",    /* Catalan      Spain */
+    "ce_RU",    /* Chechen      Russia */
+    "ceb_PH",   /* Cebuano      Philippines */
+    "co_FR",    /* Corsican     France */
+    "cr_CA",    /* Cree         Canada */
+    /* Don't put "crh_UZ" or "crh_UA" here.  That would be asking for fruitless
+       political discussion.  */
+    "cs_CZ",    /* Czech        Czech Republic */
+    "csb_PL",   /* Kashubian    Poland */
+    "cy_GB",    /* Welsh        Britain */
+    "da_DK",    /* Danish       Denmark */
+    "de_DE",    /* German       Germany */
+    "din_SD",   /* Dinka        Sudan */
+    "doi_IN",   /* Dogri        India */
+    "dsb_DE",   /* Lower Sorbian        Germany */
+    "dv_MV",    /* Divehi       Maldives */
+    "dz_BT",    /* Dzongkha     Bhutan */
+    "ee_GH",    /* Éwé          Ghana */
+    "el_GR",    /* Greek        Greece */
+    /* Don't put "en_GB" or "en_US" here.  That would be asking for fruitless
+       political discussion.  */
+    "es_ES",    /* Spanish      Spain */
+    "et_EE",    /* Estonian     Estonia */
+    "fa_IR",    /* Persian      Iran */
+    "fi_FI",    /* Finnish      Finland */
+    "fil_PH",   /* Filipino     Philippines */
+    "fj_FJ",    /* Fijian       Fiji */
+    "fo_FO",    /* Faroese      Faeroe Islands */
+    "fon_BJ",   /* Fon          Benin */
+    "fr_FR",    /* French       France */
+    "fur_IT",   /* Friulian     Italy */
+    "fy_NL",    /* Western Frisian      Netherlands */
+    "ga_IE",    /* Irish        Ireland */
+    "gd_GB",    /* Scottish Gaelic      Britain */
+    "gon_IN",   /* Gondi        India */
+    "gsw_CH",   /* Swiss German Switzerland */
+    "gu_IN",    /* Gujarati     India */
+    "he_IL",    /* Hebrew       Israel */
+    "hi_IN",    /* Hindi        India */
+    "hil_PH",   /* Hiligaynon   Philippines */
+    "hr_HR",    /* Croatian     Croatia */
+    "hsb_DE",   /* Upper Sorbian        Germany */
+    "ht_HT",    /* Haitian      Haiti */
+    "hu_HU",    /* Hungarian    Hungary */
+    "hy_AM",    /* Armenian     Armenia */
+    "id_ID",    /* Indonesian   Indonesia */
+    "ig_NG",    /* Igbo         Nigeria */
+    "ii_CN",    /* Sichuan Yi   China */
+    "ilo_PH",   /* Iloko        Philippines */
+    "is_IS",    /* Icelandic    Iceland */
+    "it_IT",    /* Italian      Italy */
+    "ja_JP",    /* Japanese     Japan */
+    "jab_NG",   /* Hyam         Nigeria */
+    "jv_ID",    /* Javanese     Indonesia */
+    "ka_GE",    /* Georgian     Georgia */
+    "kab_DZ",   /* Kabyle       Algeria */
+    "kaj_NG",   /* Jju          Nigeria */
+    "kam_KE",   /* Kamba        Kenya */
+    "kmb_AO",   /* Kimbundu     Angola */
+    "kcg_NG",   /* Tyap         Nigeria */
+    "kdm_NG",   /* Kagoma       Nigeria */
+    "kg_CD",    /* Kongo        Democratic Republic of Congo */
+    "kk_KZ",    /* Kazakh       Kazakhstan */
+    "kl_GL",    /* Kalaallisut  Greenland */
+    "km_KH",    /* Central Khmer        Cambodia */
+    "kn_IN",    /* Kannada      India */
+    "ko_KR",    /* Korean       Korea (South) */
+    "kok_IN",   /* Konkani      India */
+    "kr_NG",    /* Kanuri       Nigeria */
+    "kru_IN",   /* Kurukh       India */
+    "ky_KG",    /* Kyrgyz       Kyrgyzstan */
+    "lg_UG",    /* Ganda        Uganda */
+    "li_BE",    /* Limburgish   Belgium */
+    "lo_LA",    /* Laotian      Laos */
+    "lt_LT",    /* Lithuanian   Lithuania */
+    "lu_CD",    /* Luba-Katanga Democratic Republic of Congo */
+    "lua_CD",   /* Luba-Lulua   Democratic Republic of Congo */
+    "luo_KE",   /* Luo          Kenya */
+    "lv_LV",    /* Latvian      Latvia */
+    "mad_ID",   /* Madurese     Indonesia */
+    "mag_IN",   /* Magahi       India */
+    "mai_IN",   /* Maithili     India */
+    "mak_ID",   /* Makasar      Indonesia */
+    "man_ML",   /* Mandingo     Mali */
+    "men_SL",   /* Mende        Sierra Leone */
+    "mfe_MU",   /* Mauritian Creole     Mauritius */
+    "mg_MG",    /* Malagasy     Madagascar */
+    "mi_NZ",    /* Maori        New Zealand */
+    "min_ID",   /* Minangkabau  Indonesia */
+    "mk_MK",    /* Macedonian   North Macedonia */
+    "ml_IN",    /* Malayalam    India */
+    "mn_MN",    /* Mongolian    Mongolia */
+    "mni_IN",   /* Manipuri     India */
+    "mos_BF",   /* Mossi        Burkina Faso */
+    "mr_IN",    /* Marathi      India */
+    "ms_MY",    /* Malay        Malaysia */
+    "mt_MT",    /* Maltese      Malta */
+    "mwr_IN",   /* Marwari      India */
+    "my_MM",    /* Burmese      Myanmar */
+    "na_NR",    /* Nauru        Nauru */
+    "nah_MX",   /* Nahuatl      Mexico */
+    "nap_IT",   /* Neapolitan   Italy */
+    "nb_NO",    /* Norwegian Bokmål    Norway */
+    "nds_DE",   /* Low Saxon    Germany */
+    "ne_NP",    /* Nepali       Nepal */
+    "nl_NL",    /* Dutch        Netherlands */
+    "nn_NO",    /* Norwegian Nynorsk    Norway */
+    "no_NO",    /* Norwegian    Norway */
+    "nr_ZA",    /* South Ndebele        South Africa */
+    "nso_ZA",   /* Northern Sotho       South Africa */
+    "ny_MW",    /* Chichewa     Malawi */
+    "nym_TZ",   /* Nyamwezi     Tanzania */
+    "nyn_UG",   /* Nyankole     Uganda */
+    "oc_FR",    /* Occitan      France */
+    "oj_CA",    /* Ojibwa       Canada */
+    "or_IN",    /* Oriya        India */
+    "pa_IN",    /* Punjabi      India */
+    "pag_PH",   /* Pangasinan   Philippines */
+    "pam_PH",   /* Pampanga     Philippines */
+    "pap_AN",   /* Papiamento   Netherlands Antilles - this line can be removed in 2018 */
+    "pbb_CO",   /* Páez         Colombia */
+    "pl_PL",    /* Polish       Poland */
+    "ps_AF",    /* Pashto       Afghanistan */
+    "pt_PT",    /* Portuguese   Portugal */
+    "raj_IN",   /* Rajasthani   India */
+    "rm_CH",    /* Romansh      Switzerland */
+    "rn_BI",    /* Kirundi      Burundi */
+    "ro_RO",    /* Romanian     Romania */
+    "ru_RU",    /* Russian      Russia */
+    "rw_RW",    /* Kinyarwanda  Rwanda */
+    "sa_IN",    /* Sanskrit     India */
+    "sah_RU",   /* Yakut        Russia */
+    "sas_ID",   /* Sasak        Indonesia */
+    "sat_IN",   /* Santali      India */
+    "sc_IT",    /* Sardinian    Italy */
+    "scn_IT",   /* Sicilian     Italy */
+    "sg_CF",    /* Sango        Central African Republic */
+    "shn_MM",   /* Shan         Myanmar */
+    "si_LK",    /* Sinhala      Sri Lanka */
+    "sid_ET",   /* Sidamo       Ethiopia */
+    "sk_SK",    /* Slovak       Slovakia */
+    "sl_SI",    /* Slovenian    Slovenia */
+    "sm_WS",    /* Samoan       Samoa */
+    "smn_FI",   /* Inari Sami   Finland */
+    "sms_FI",   /* Skolt Sami   Finland */
+    "so_SO",    /* Somali       Somalia */
+    "sq_AL",    /* Albanian     Albania */
+    "sr_RS",    /* Serbian      Serbia */
+    "srr_SN",   /* Serer        Senegal */
+    "suk_TZ",   /* Sukuma       Tanzania */
+    "sus_GN",   /* Susu         Guinea */
+    "sv_SE",    /* Swedish      Sweden */
+    "te_IN",    /* Telugu       India */
+    "tem_SL",   /* Timne        Sierra Leone */
+    "tet_ID",   /* Tetum        Indonesia */
+    "tg_TJ",    /* Tajik        Tajikistan */
+    "th_TH",    /* Thai         Thailand */
+    "ti_ER",    /* Tigrinya     Eritrea */
+    "tiv_NG",   /* Tiv          Nigeria */
+    "tk_TM",    /* Turkmen      Turkmenistan */
+    "tl_PH",    /* Tagalog      Philippines */
+    "to_TO",    /* Tonga        Tonga */
+    "tpi_PG",   /* Tok Pisin    Papua New Guinea */
+    "tr_TR",    /* Turkish      Turkey */
+    "tum_MW",   /* Tumbuka      Malawi */
+    "ug_CN",    /* Uighur       China */
+    "uk_UA",    /* Ukrainian    Ukraine */
+    "umb_AO",   /* Umbundu      Angola */
+    "ur_PK",    /* Urdu         Pakistan */
+    "uz_UZ",    /* Uzbek        Uzbekistan */
+    "ve_ZA",    /* Venda        South Africa */
+    "vi_VN",    /* Vietnamese   Vietnam */
+    "wa_BE",    /* Walloon      Belgium */
+    "wal_ET",   /* Walamo       Ethiopia */
+    "war_PH",   /* Waray        Philippines */
+    "wen_DE",   /* Sorbian      Germany */
+    "yao_MW",   /* Yao          Malawi */
+    "zap_MX"    /* Zapotec      Mexico */
+  };
+
+/* Compare just the language part of two locale names.  */
+static int
+langcmp (const char *locale1, const char *locale2)
+{
+  size_t locale1_len;
+  size_t locale2_len;
+  int cmp;
+
+  {
+    const char *locale1_end = strchr (locale1, '_');
+    if (locale1_end != NULL)
+      locale1_len = locale1_end - locale1;
+    else
+      locale1_len = strlen (locale1);
+  }
+  {
+    const char *locale2_end = strchr (locale2, '_');
+    if (locale2_end != NULL)
+      locale2_len = locale2_end - locale2;
+    else
+      locale2_len = strlen (locale2);
+  }
+
+  if (locale1_len < locale2_len)
+    {
+      cmp = memcmp (locale1, locale2, locale1_len);
+      if (cmp == 0)
+        cmp = -1;
+    }
+  else
+    {
+      cmp = memcmp (locale1, locale2, locale2_len);
+      if (locale1_len > locale2_len && cmp == 0)
+        cmp = 1;
+    }
+
+  return cmp;
+}
+
+/* Given a locale name, return the main locale with the same language,
+   or NULL if not found.
+   For example: "fr_DE" -> "fr_FR".  */
+static const char *
+get_main_locale_with_same_language (const char *locale)
+{
+#   define table locales_with_principal_territory
+  /* The table is sorted.  Perform a binary search.  */
+  size_t hi = sizeof (table) / sizeof (table[0]);
+  size_t lo = 0;
+  while (lo < hi)
+    {
+      /* Invariant:
+         for i < lo, langcmp (table[i], locale) < 0,
+         for i >= hi, langcmp (table[i], locale) > 0.  */
+      size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+      int cmp = langcmp (table[mid], locale);
+      if (cmp < 0)
+        lo = mid + 1;
+      else if (cmp > 0)
+        hi = mid;
+      else
+        {
+          /* Found an i with
+               langcmp (language_table[i], locale) == 0.
+             Verify that it is the only such i.  */
+          if (mid > lo && langcmp (table[mid - 1], locale) >= 0)
+            abort ();
+          if (mid + 1 < hi && langcmp (table[mid + 1], locale) <= 0)
+            abort ();
+          return table[mid];
+        }
+    }
+#   undef table
+  return NULL;
+}
+
+/* Mapping from territory to main language that is spoken in that territory.  */
+static char const locales_with_principal_language[][6 + 1] =
+  {
+    /* This is based on the set of existing locales in glibc, with duplicates
+       removed, and on the Wikipedia pages named "Languages of <territory>".
+       If in doubt, use the locale that exists in macOS.  For example, the only
+       "*_IN" locale in macOS 10.13 is "hi_IN", so use that.  */
+    /* A useful shell function for producing a line of this table is:
+         func_line ()
+         {
+           # Usage: func_line ll_CC
+           ll=`echo "$1" | sed -e 's|_.*||'`
+           cc=`echo "$1" | sed -e 's|^.*_||'`
+           llx=`sed -n -e "s|^${ll} ||p" < gettext-tools/doc/ISO_639`
+           ccx=`expand gettext-tools/doc/ISO_3166 | sed -n -e "s|^${cc}  *||p"`
+           echo "    \"$1\",    /$X* ${llx} ${ccx} *$X/"
+         }
+     */
+              /* Main language  Territory */
+    "ca_AD",    /* Catalan      Andorra */
+    "ar_AE",    /* Arabic       United Arab Emirates */
+    "ps_AF",    /* Pashto       Afghanistan */
+    "en_AG",    /* English      Antigua and Barbuda */
+    "sq_AL",    /* Albanian     Albania */
+    "hy_AM",    /* Armenian     Armenia */
+    "pap_AN",   /* Papiamento   Netherlands Antilles - this line can be removed in 2018 */
+    "pt_AO",    /* Portuguese   Angola */
+    "es_AR",    /* Spanish      Argentina */
+    "de_AT",    /* German       Austria */
+    "en_AU",    /* English      Australia */
+    /* Aruba has two official languages: "nl_AW", "pap_AW".  */
+    "az_AZ",    /* Azerbaijani  Azerbaijan */
+    "bs_BA",    /* Bosnian      Bosnia */
+    "bn_BD",    /* Bengali      Bangladesh */
+    "nl_BE",    /* Dutch        Belgium */
+    "fr_BF",    /* French       Burkina Faso */
+    "bg_BG",    /* Bulgarian    Bulgaria */
+    "ar_BH",    /* Arabic       Bahrain */
+    "rn_BI",    /* Kirundi      Burundi */
+    "fr_BJ",    /* French       Benin */
+    "es_BO",    /* Spanish      Bolivia */
+    "pt_BR",    /* Portuguese   Brazil */
+    "dz_BT",    /* Dzongkha     Bhutan */
+    "en_BW",    /* English      Botswana */
+    "be_BY",    /* Belarusian   Belarus */
+    "en_CA",    /* English      Canada */
+    "fr_CD",    /* French       Democratic Republic of Congo */
+    "sg_CF",    /* Sango        Central African Republic */
+    "de_CH",    /* German       Switzerland */
+    "es_CL",    /* Spanish      Chile */
+    "zh_CN",    /* Chinese      China */
+    "es_CO",    /* Spanish      Colombia */
+    "es_CR",    /* Spanish      Costa Rica */
+    "es_CU",    /* Spanish      Cuba */
+    /* Curaçao has three official languages: "nl_CW", "pap_CW", "en_CW".  */
+    "el_CY",    /* Greek        Cyprus */
+    "cs_CZ",    /* Czech        Czech Republic */
+    "de_DE",    /* German       Germany */
+    /* Djibouti has two official languages: "ar_DJ" and "fr_DJ".  */
+    "da_DK",    /* Danish       Denmark */
+    "es_DO",    /* Spanish      Dominican Republic */
+    "ar_DZ",    /* Arabic       Algeria */
+    "es_EC",    /* Spanish      Ecuador */
+    "et_EE",    /* Estonian     Estonia */
+    "ar_EG",    /* Arabic       Egypt */
+    "ti_ER",    /* Tigrinya     Eritrea */
+    "es_ES",    /* Spanish      Spain */
+    "am_ET",    /* Amharic      Ethiopia */
+    "fi_FI",    /* Finnish      Finland */
+    /* Fiji has three official languages: "en_FJ", "fj_FJ", "hif_FJ".  */
+    "fo_FO",    /* Faroese      Faeroe Islands */
+    "fr_FR",    /* French       France */
+    "en_GB",    /* English      Britain */
+    "ka_GE",    /* Georgian     Georgia */
+    "en_GH",    /* English      Ghana */
+    "kl_GL",    /* Kalaallisut  Greenland */
+    "fr_GN",    /* French       Guinea */
+    "el_GR",    /* Greek        Greece */
+    "es_GT",    /* Spanish      Guatemala */
+    "zh_HK",    /* Chinese      Hong Kong */
+    "es_HN",    /* Spanish      Honduras */
+    "hr_HR",    /* Croatian     Croatia */
+    "ht_HT",    /* Haitian      Haiti */
+    "hu_HU",    /* Hungarian    Hungary */
+    "id_ID",    /* Indonesian   Indonesia */
+    "en_IE",    /* English      Ireland */
+    "he_IL",    /* Hebrew       Israel */
+    "hi_IN",    /* Hindi        India */
+    "ar_IQ",    /* Arabic       Iraq */
+    "fa_IR",    /* Persian      Iran */
+    "is_IS",    /* Icelandic    Iceland */
+    "it_IT",    /* Italian      Italy */
+    "ar_JO",    /* Arabic       Jordan */
+    "ja_JP",    /* Japanese     Japan */
+    "sw_KE",    /* Swahili      Kenya */
+    "ky_KG",    /* Kyrgyz       Kyrgyzstan */
+    "km_KH",    /* Central Khmer        Cambodia */
+    "ko_KR",    /* Korean       Korea (South) */
+    "ar_KW",    /* Arabic       Kuwait */
+    "kk_KZ",    /* Kazakh       Kazakhstan */
+    "lo_LA",    /* Laotian      Laos */
+    "ar_LB",    /* Arabic       Lebanon */
+    "de_LI",    /* German       Liechtenstein */
+    "si_LK",    /* Sinhala      Sri Lanka */
+    "lt_LT",    /* Lithuanian   Lithuania */
+    /* Luxembourg has three official languages: "lb_LU", "fr_LU", "de_LU".  */
+    "lv_LV",    /* Latvian      Latvia */
+    "ar_LY",    /* Arabic       Libya */
+    "ar_MA",    /* Arabic       Morocco */
+    "sr_ME",    /* Serbian      Montenegro */
+    "mg_MG",    /* Malagasy     Madagascar */
+    "mk_MK",    /* Macedonian   North Macedonia */
+    "fr_ML",    /* French       Mali */
+    "my_MM",    /* Burmese      Myanmar */
+    "mn_MN",    /* Mongolian    Mongolia */
+    "mt_MT",    /* Maltese      Malta */
+    "mfe_MU",   /* Mauritian Creole     Mauritius */
+    "dv_MV",    /* Divehi       Maldives */
+    "ny_MW",    /* Chichewa     Malawi */
+    "es_MX",    /* Spanish      Mexico */
+    "ms_MY",    /* Malay        Malaysia */
+    "en_NG",    /* English      Nigeria */
+    "es_NI",    /* Spanish      Nicaragua */
+    "nl_NL",    /* Dutch        Netherlands */
+    "no_NO",    /* Norwegian    Norway */
+    "ne_NP",    /* Nepali       Nepal */
+    "na_NR",    /* Nauru        Nauru */
+    "niu_NU",   /* Niuean       Niue */
+    "en_NZ",    /* English      New Zealand */
+    "ar_OM",    /* Arabic       Oman */
+    "es_PA",    /* Spanish      Panama */
+    "es_PE",    /* Spanish      Peru */
+    "tpi_PG",   /* Tok Pisin    Papua New Guinea */
+    "fil_PH",   /* Filipino     Philippines */
+    "pa_PK",    /* Punjabi      Pakistan */
+    "pl_PL",    /* Polish       Poland */
+    "es_PR",    /* Spanish      Puerto Rico */
+    "pt_PT",    /* Portuguese   Portugal */
+    "es_PY",    /* Spanish      Paraguay */
+    "ar_QA",    /* Arabic       Qatar */
+    "ro_RO",    /* Romanian     Romania */
+    "sr_RS",    /* Serbian      Serbia */
+    "ru_RU",    /* Russian      Russia */
+    "rw_RW",    /* Kinyarwanda  Rwanda */
+    "ar_SA",    /* Arabic       Saudi Arabia */
+    "en_SC",    /* English      Seychelles */
+    "ar_SD",    /* Arabic       Sudan */
+    "sv_SE",    /* Swedish      Sweden */
+    "en_SG",    /* English      Singapore */
+    "sl_SI",    /* Slovenian    Slovenia */
+    "sk_SK",    /* Slovak       Slovakia */
+    "en_SL",    /* English      Sierra Leone */
+    "fr_SN",    /* French       Senegal */
+    "so_SO",    /* Somali       Somalia */
+    "ar_SS",    /* Arabic       South Sudan */
+    "es_SV",    /* Spanish      El Salvador */
+    "ar_SY",    /* Arabic       Syria */
+    "th_TH",    /* Thai         Thailand */
+    "tg_TJ",    /* Tajik        Tajikistan */
+    "tk_TM",    /* Turkmen      Turkmenistan */
+    "ar_TN",    /* Arabic       Tunisia */
+    "to_TO",    /* Tonga        Tonga */
+    "tr_TR",    /* Turkish      Turkey */
+    "zh_TW",    /* Chinese      Taiwan */
+    "sw_TZ",    /* Swahili      Tanzania */
+    "uk_UA",    /* Ukrainian    Ukraine */
+    "lg_UG",    /* Ganda        Uganda */
+    "en_US",    /* English      United States of America */
+    "es_UY",    /* Spanish      Uruguay */
+    "uz_UZ",    /* Uzbek        Uzbekistan */
+    "es_VE",    /* Spanish      Venezuela */
+    "vi_VN",    /* Vietnamese   Vietnam */
+    "bi_VU",    /* Bislama      Vanuatu */
+    "sm_WS",    /* Samoan       Samoa */
+    "ar_YE",    /* Arabic       Yemen */
+    "en_ZA",    /* English      South Africa */
+    "en_ZM",    /* English      Zambia */
+    "en_ZW"     /* English      Zimbabwe */
+  };
+
+/* Compare just the territory part of two locale names.  */
+static int
+terrcmp (const char *locale1, const char *locale2)
+{
+  const char *territory1 = strrchr (locale1, '_') + 1;
+  const char *territory2 = strrchr (locale2, '_') + 1;
+
+  return strcmp (territory1, territory2);
+}
+
+/* Given a locale name, return the locale corresponding to the main language
+   with the same territory, or NULL if not found.
+   For example: "fr_DE" -> "de_DE".  */
+static const char *
+get_main_locale_with_same_territory (const char *locale)
+{
+  if (strrchr (locale, '_') != NULL)
+    {
+#   define table locales_with_principal_language
+      /* The table is sorted.  Perform a binary search.  */
+      size_t hi = sizeof (table) / sizeof (table[0]);
+      size_t lo = 0;
+      while (lo < hi)
+        {
+          /* Invariant:
+             for i < lo, terrcmp (table[i], locale) < 0,
+             for i >= hi, terrcmp (table[i], locale) > 0.  */
+          size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
+          int cmp = terrcmp (table[mid], locale);
+          if (cmp < 0)
+            lo = mid + 1;
+          else if (cmp > 0)
+            hi = mid;
+          else
+            {
+              /* Found an i with
+                   terrcmp (language_table[i], locale) == 0.
+                 Verify that it is the only such i.  */
+              if (mid > lo && terrcmp (table[mid - 1], locale) >= 0)
+                abort ();
+              if (mid + 1 < hi && terrcmp (table[mid + 1], locale) <= 0)
+                abort ();
+              return table[mid];
+            }
+        }
+#   undef table
+    }
+  return NULL;
+}
+
+#  endif
+
+char *
+setlocale_improved (int category, const char *locale)
+{
+  if (locale != NULL && locale[0] == '\0')
+    {
+      /* A request to the set the current locale to the default locale.  */
+      if (category == LC_ALL)
+        {
+          /* Set LC_CTYPE first.  Then the other categories.  */
+          static int const categories[] =
+            {
+              LC_CTYPE,
+              LC_NUMERIC,
+              LC_TIME,
+              LC_COLLATE,
+              LC_MONETARY,
+              LC_MESSAGES
+            };
+          char *saved_locale;
+          const char *base_name;
+          unsigned int i;
+
+          /* Back up the old locale, in case one of the steps fails.  */
+          saved_locale = setlocale (LC_ALL, NULL);
+          if (saved_locale == NULL)
+            return NULL;
+          saved_locale = strdup (saved_locale);
+          if (saved_locale == NULL)
+            return NULL;
+
+          /* Set LC_CTYPE category.  Set all other categories (except possibly
+             LC_MESSAGES) to the same value in the same call; this is likely to
+             save calls.  */
+          base_name =
+            gl_locale_name_environ (LC_CTYPE, category_to_name (LC_CTYPE));
+          if (base_name == NULL)
+            base_name = gl_locale_name_default ();
+
+          if (setlocale_unixlike (LC_ALL, base_name) != NULL)
+            {
+              /* LC_CTYPE category already set.  */
+              i = 1;
+            }
+          else
+            {
+              /* On Mac OS X, "UTF-8" is a valid locale name for LC_CTYPE but
+                 not for LC_ALL.  Therefore this call may fail.  So, try
+                 another base_name.  */
+              base_name = "C";
+              if (setlocale_unixlike (LC_ALL, base_name) == NULL)
+                goto fail;
+              i = 0;
+            }
+#  if defined _WIN32 && ! defined __CYGWIN__
+          /* On native Windows, setlocale(LC_ALL,...) may succeed but set the
+             LC_CTYPE category to an invalid value ("C") when it does not
+             support the specified encoding.  Report a failure instead.  */
+          if (strchr (base_name, '.') != NULL
+              && strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+            goto fail;
+#  endif
+
+          for (; i < sizeof (categories) / sizeof (categories[0]); i++)
+            {
+              int cat = categories[i];
+              const char *name;
+
+              name = gl_locale_name_environ (cat, category_to_name (cat));
+              if (name == NULL)
+                name = gl_locale_name_default ();
+
+              /* If name is the same as base_name, it has already been set
+                 through the setlocale call before the loop.  */
+              if (strcmp (name, base_name) != 0
+#  if LC_MESSAGES == 1729
+                  || cat == LC_MESSAGES
+#  endif
+                 )
+                if (setlocale_single (cat, name) == NULL)
+#  if defined __APPLE__ && defined __MACH__
+                  {
+                    /* On Mac OS X 10.13, some locales can be set through
+                       System Preferences > Language & Region, that are not
+                       supported by libc.  The system's setlocale() falls
+                       back to "C" for these locale categories.  We can do
+                       better, by trying an existing locale with the same
+                       language or an existing locale with the same territory.
+                       If we can't, print a warning, to limit user
+                       expectations.  */
+                    int warn = 0;
+
+                    if (cat == LC_CTYPE)
+                      warn = (setlocale_single (cat, "UTF-8") == NULL);
+                    else if (cat == LC_MESSAGES)
+                      {
+#   if HAVE_CFLOCALECOPYPREFERREDLANGUAGES || HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */
+                        /* Take the primary language preference.  */
+#    if HAVE_CFLOCALECOPYPREFERREDLANGUAGES /* MacOS X 10.5 or newer */
+                        CFArrayRef prefArray = CFLocaleCopyPreferredLanguages ();
+#    elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */
+                        CFTypeRef preferences =
+                          CFPreferencesCopyAppValue (CFSTR ("AppleLanguages"),
+                                                     kCFPreferencesCurrentApplication);
+                        if (preferences != NULL
+                            && CFGetTypeID (preferences) == CFArrayGetTypeID ())
+                          {
+                            CFArrayRef prefArray = (CFArrayRef)preferences;
+#    endif
+                            int n = CFArrayGetCount (prefArray);
+                            if (n > 0)
+                              {
+                                char buf[256];
+                                CFTypeRef element = CFArrayGetValueAtIndex (prefArray, 0);
+                                if (element != NULL
+                                    && CFGetTypeID (element) == CFStringGetTypeID ()
+                                    && CFStringGetCString ((CFStringRef)element,
+                                                           buf, sizeof (buf),
+                                                           kCFStringEncodingASCII))
+                                  {
+                                    /* Remove the country.
+                                       E.g. "zh-Hans-DE" -> "zh-Hans".  */
+                                    char *last_minus = strrchr (buf, '-');
+                                    if (last_minus != NULL)
+                                      *last_minus = '\0';
+
+                                    /* Convert to Unix locale name.
+                                       E.g. "zh-Hans" -> "zh_CN".  */
+                                    gl_locale_name_canonicalize (buf);
+
+                                    /* Try setlocale with this value.  */
+                                    if (setlocale_single (cat, buf) == NULL)
+                                      {
+                                        const char *last_try =
+                                          get_main_locale_with_same_language (buf);
+
+                                        if (last_try == NULL
+                                            || setlocale_single (cat, last_try) == NULL)
+                                          warn = 1;
+                                      }
+                                  }
+                              }
+#    if HAVE_CFLOCALECOPYPREFERREDLANGUAGES /* MacOS X 10.5 or newer */
+                        CFRelease (prefArray);
+#    elif HAVE_CFPREFERENCESCOPYAPPVALUE /* MacOS X 10.4 or newer */
+                          }
+#    endif
+#   else
+                        const char *last_try =
+                          get_main_locale_with_same_language (name);
+
+                        if (last_try == NULL
+                            || setlocale_single (cat, last_try) == NULL)
+                          warn = 1;
+#   endif
+                      }
+                    else
+                      {
+                        /* For LC_NUMERIC, the application should use the locale
+                           properties kCFLocaleDecimalSeparator,
+                           kCFLocaleGroupingSeparator.
+                           For LC_TIME, the application should use the locale
+                           property kCFLocaleCalendarIdentifier.
+                           For LC_COLLATE, the application should use the locale
+                           properties kCFLocaleCollationIdentifier,
+                           kCFLocaleCollatorIdentifier.
+                           For LC_MONETARY, the applicationshould use the locale
+                           properties kCFLocaleCurrencySymbol,
+                           kCFLocaleCurrencyCode.
+                           But since most applications don't have macOS specific
+                           code like this, try an existing locale with the same
+                           territory.  */
+                        const char *last_try =
+                          get_main_locale_with_same_territory (name);
+
+                        if (last_try == NULL
+                            || setlocale_single (cat, last_try) == NULL)
+                          warn = 1;
+                      }
+
+                    if (warn)
+                      {
+                        /* Warn only if the environment variable
+                           SETLOCALE_VERBOSE is set.  Otherwise these warnings
+                           are just annoyances, since normal users won't invoke
+                           'localedef'.  */
+                        const char *verbose = getenv ("SETLOCALE_VERBOSE");
+                        if (verbose != NULL && verbose[0] != '\0')
+                          fprintf (stderr,
+                                   "Warning: Failed to set locale category %s to %s.\n",
+                                   category_to_name (cat), name);
+                      }
+                  }
+#  else
+                  goto fail;
+#  endif
+            }
+
+          /* All steps were successful.  */
+          free (saved_locale);
+          return setlocale (LC_ALL, NULL);
+
+        fail:
+          if (saved_locale[0] != '\0') /* don't risk an endless recursion */
+            setlocale (LC_ALL, saved_locale);
+          free (saved_locale);
+          return NULL;
+        }
+      else
+        {
+          const char *name =
+            gl_locale_name_environ (category, category_to_name (category));
+          if (name == NULL)
+            name = gl_locale_name_default ();
+
+          return setlocale_single (category, name);
+        }
+    }
+  else
+    {
+#  if defined _WIN32 && ! defined __CYGWIN__
+      if (category == LC_ALL && locale != NULL && strchr (locale, '.') != NULL)
+        {
+          char *saved_locale;
+
+          /* Back up the old locale.  */
+          saved_locale = setlocale (LC_ALL, NULL);
+          if (saved_locale == NULL)
+            return NULL;
+          saved_locale = strdup (saved_locale);
+          if (saved_locale == NULL)
+            return NULL;
+
+          if (setlocale_unixlike (LC_ALL, locale) == NULL)
+            {
+              free (saved_locale);
+              return NULL;
+            }
+
+          /* On native Windows, setlocale(LC_ALL,...) may succeed but set the
+             LC_CTYPE category to an invalid value ("C") when it does not
+             support the specified encoding.  Report a failure instead.  */
+          if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
+            {
+              if (saved_locale[0] != '\0') /* don't risk an endless recursion */
+                setlocale (LC_ALL, saved_locale);
+              free (saved_locale);
+              return NULL;
+            }
+
+          /* It was really successful.  */
+          free (saved_locale);
+          return setlocale (LC_ALL, NULL);
+        }
+      else
+#  endif
+        return setlocale_single (category, locale);
+    }
+}
+
+# endif /* NEED_SETLOCALE_IMPROVED */
+
+#endif
diff --git a/lib/setlocale_null.c b/lib/setlocale_null.c
new file mode 100644 (file)
index 0000000..059af4e
--- /dev/null
@@ -0,0 +1,411 @@
+/* Query the name of the current global locale.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "setlocale_null.h"
+
+#include <errno.h>
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#if defined _WIN32 && !defined __CYGWIN__
+# include <wchar.h>
+#endif
+
+#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE)
+# if defined _WIN32 && !defined __CYGWIN__
+
+#  define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#  include <windows.h>
+
+# elif HAVE_PTHREAD_API
+
+#  include <pthread.h>
+#  if HAVE_THREADS_H && HAVE_WEAK_SYMBOLS
+#   include <threads.h>
+#   pragma weak thrd_exit
+#   define c11_threads_in_use() (thrd_exit != NULL)
+#  else
+#   define c11_threads_in_use() 0
+#  endif
+
+# elif HAVE_THREADS_H
+
+#  include <threads.h>
+
+# endif
+#endif
+
+/* Use the system's setlocale() function, not the gnulib override, here.  */
+#undef setlocale
+
+static const char *
+setlocale_null_androidfix (int category)
+{
+  const char *result = setlocale (category, NULL);
+
+#ifdef __ANDROID__
+  if (result == NULL)
+    switch (category)
+      {
+      case LC_CTYPE:
+      case LC_NUMERIC:
+      case LC_TIME:
+      case LC_COLLATE:
+      case LC_MONETARY:
+      case LC_MESSAGES:
+      case LC_ALL:
+      case LC_PAPER:
+      case LC_NAME:
+      case LC_ADDRESS:
+      case LC_TELEPHONE:
+      case LC_MEASUREMENT:
+        result = "C";
+        break;
+      default:
+        break;
+      }
+#endif
+
+  return result;
+}
+
+static int
+setlocale_null_unlocked (int category, char *buf, size_t bufsize)
+{
+#if defined _WIN32 && !defined __CYGWIN__ && defined _MSC_VER
+  /* On native Windows, nowadays, the setlocale() implementation is based
+     on _wsetlocale() and uses malloc() for the result.  We are better off
+     using _wsetlocale() directly.  */
+  const wchar_t *result = _wsetlocale (category, NULL);
+
+  if (result == NULL)
+    {
+      /* CATEGORY is invalid.  */
+      if (bufsize > 0)
+        /* Return an empty string in BUF.
+           This is a convenience for callers that don't want to write explicit
+           code for handling EINVAL.  */
+        buf[0] = '\0';
+      return EINVAL;
+    }
+  else
+    {
+      size_t length = wcslen (result);
+      if (length < bufsize)
+        {
+          size_t i;
+
+          /* Convert wchar_t[] -> char[], assuming plain ASCII.  */
+          for (i = 0; i <= length; i++)
+            buf[i] = result[i];
+
+          return 0;
+        }
+      else
+        {
+          if (bufsize > 0)
+            {
+              /* Return a truncated result in BUF.
+                 This is a convenience for callers that don't want to write
+                 explicit code for handling ERANGE.  */
+              size_t i;
+
+              /* Convert wchar_t[] -> char[], assuming plain ASCII.  */
+              for (i = 0; i < bufsize; i++)
+                buf[i] = result[i];
+              buf[bufsize - 1] = '\0';
+            }
+          return ERANGE;
+        }
+    }
+#else
+  const char *result = setlocale_null_androidfix (category);
+
+  if (result == NULL)
+    {
+      /* CATEGORY is invalid.  */
+      if (bufsize > 0)
+        /* Return an empty string in BUF.
+           This is a convenience for callers that don't want to write explicit
+           code for handling EINVAL.  */
+        buf[0] = '\0';
+      return EINVAL;
+    }
+  else
+    {
+      size_t length = strlen (result);
+      if (length < bufsize)
+        {
+          memcpy (buf, result, length + 1);
+          return 0;
+        }
+      else
+        {
+          if (bufsize > 0)
+            {
+              /* Return a truncated result in BUF.
+                 This is a convenience for callers that don't want to write
+                 explicit code for handling ERANGE.  */
+              memcpy (buf, result, bufsize - 1);
+              buf[bufsize - 1] = '\0';
+            }
+          return ERANGE;
+        }
+    }
+#endif
+}
+
+#if !(SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE) /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */
+
+/* Use a lock, so that no two threads can invoke setlocale_null_unlocked
+   at the same time.  */
+
+/* Prohibit renaming this symbol.  */
+# undef gl_get_setlocale_null_lock
+
+# if defined _WIN32 && !defined __CYGWIN__
+
+extern __declspec(dllimport) CRITICAL_SECTION *gl_get_setlocale_null_lock (void);
+
+static int
+setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+{
+  CRITICAL_SECTION *lock = gl_get_setlocale_null_lock ();
+  int ret;
+
+  EnterCriticalSection (lock);
+  ret = setlocale_null_unlocked (category, buf, bufsize);
+  LeaveCriticalSection (lock);
+
+  return ret;
+}
+
+# elif HAVE_PTHREAD_API /* musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin */
+
+extern
+#  if defined _WIN32 || defined __CYGWIN__
+  __declspec(dllimport)
+#  endif
+  pthread_mutex_t *gl_get_setlocale_null_lock (void);
+
+#  if HAVE_WEAK_SYMBOLS /* musl libc, FreeBSD, NetBSD, OpenBSD, Haiku */
+
+    /* Avoid the need to link with '-lpthread'.  */
+#   pragma weak pthread_mutex_lock
+#   pragma weak pthread_mutex_unlock
+
+    /* Determine whether libpthread is in use.  */
+#   pragma weak pthread_mutexattr_gettype
+    /* See the comments in lock.h.  */
+#   define pthread_in_use() \
+      (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+
+#  else
+#   define pthread_in_use() 1
+#  endif
+
+static int
+setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+{
+  if (pthread_in_use())
+    {
+      pthread_mutex_t *lock = gl_get_setlocale_null_lock ();
+      int ret;
+
+      if (pthread_mutex_lock (lock))
+        abort ();
+      ret = setlocale_null_unlocked (category, buf, bufsize);
+      if (pthread_mutex_unlock (lock))
+        abort ();
+
+      return ret;
+    }
+  else
+    return setlocale_null_unlocked (category, buf, bufsize);
+}
+
+# elif HAVE_THREADS_H
+
+extern mtx_t *gl_get_setlocale_null_lock (void);
+
+static int
+setlocale_null_with_lock (int category, char *buf, size_t bufsize)
+{
+  mtx_t *lock = gl_get_setlocale_null_lock ();
+  int ret;
+
+  if (mtx_lock (lock) != thrd_success)
+    abort ();
+  ret = setlocale_null_unlocked (category, buf, bufsize);
+  if (mtx_unlock (lock) != thrd_success)
+    abort ();
+
+  return ret;
+}
+
+# endif
+
+#endif
+
+int
+setlocale_null_r (int category, char *buf, size_t bufsize)
+{
+#if SETLOCALE_NULL_ALL_MTSAFE
+# if SETLOCALE_NULL_ONE_MTSAFE
+
+  return setlocale_null_unlocked (category, buf, bufsize);
+
+# else
+
+  if (category == LC_ALL)
+    return setlocale_null_unlocked (category, buf, bufsize);
+  else
+    return setlocale_null_with_lock (category, buf, bufsize);
+
+# endif
+#else
+# if SETLOCALE_NULL_ONE_MTSAFE
+
+  if (category == LC_ALL)
+    return setlocale_null_with_lock (category, buf, bufsize);
+  else
+    return setlocale_null_unlocked (category, buf, bufsize);
+
+# else
+
+  return setlocale_null_with_lock (category, buf, bufsize);
+
+# endif
+#endif
+}
+
+const char *
+setlocale_null (int category)
+{
+#if SETLOCALE_NULL_ALL_MTSAFE && SETLOCALE_NULL_ONE_MTSAFE
+  return setlocale_null_androidfix (category);
+#else
+
+  /* This call must be multithread-safe.  To achieve this without using
+     thread-local storage:
+       1. We use a specific static buffer for each possible CATEGORY
+          argument.  So that different threads can call setlocale_mtsafe
+          with different CATEGORY arguments, without interfering.
+       2. We use a simple strcpy or memcpy to fill this static buffer.
+          Filling it through, for example, strcpy + strcat would not be
+          guaranteed to leave the buffer's contents intact if another thread
+          is currently accessing it.  If necessary, the contents is first
+          assembled in a stack-allocated buffer.  */
+  if (category == LC_ALL)
+    {
+# if SETLOCALE_NULL_ALL_MTSAFE
+      return setlocale_null_androidfix (LC_ALL);
+# else
+      char buf[SETLOCALE_NULL_ALL_MAX];
+      static char resultbuf[SETLOCALE_NULL_ALL_MAX];
+
+      if (setlocale_null_r (LC_ALL, buf, sizeof (buf)))
+        return "C";
+      strcpy (resultbuf, buf);
+      return resultbuf;
+# endif
+    }
+  else
+    {
+# if SETLOCALE_NULL_ONE_MTSAFE
+      return setlocale_null_androidfix (category);
+# else
+      enum
+        {
+          LC_CTYPE_INDEX,
+          LC_NUMERIC_INDEX,
+          LC_TIME_INDEX,
+          LC_COLLATE_INDEX,
+          LC_MONETARY_INDEX,
+          LC_MESSAGES_INDEX,
+#  ifdef LC_PAPER
+          LC_PAPER_INDEX,
+#  endif
+#  ifdef LC_NAME
+          LC_NAME_INDEX,
+#  endif
+#  ifdef LC_ADDRESS
+          LC_ADDRESS_INDEX,
+#  endif
+#  ifdef LC_TELEPHONE
+          LC_TELEPHONE_INDEX,
+#  endif
+#  ifdef LC_MEASUREMENT
+          LC_MEASUREMENT_INDEX,
+#  endif
+#  ifdef LC_IDENTIFICATION
+          LC_IDENTIFICATION_INDEX,
+#  endif
+          LC_INDICES_COUNT
+        }
+        i;
+      char buf[SETLOCALE_NULL_MAX];
+      static char resultbuf[LC_INDICES_COUNT][SETLOCALE_NULL_MAX];
+      int err;
+
+      err = setlocale_null_r (category, buf, sizeof (buf));
+      if (err == EINVAL)
+        return NULL;
+      if (err)
+        return "C";
+
+      switch (category)
+        {
+        case LC_CTYPE:          i = LC_CTYPE_INDEX;          break;
+        case LC_NUMERIC:        i = LC_NUMERIC_INDEX;        break;
+        case LC_TIME:           i = LC_TIME_INDEX;           break;
+        case LC_COLLATE:        i = LC_COLLATE_INDEX;        break;
+        case LC_MONETARY:       i = LC_MONETARY_INDEX;       break;
+        case LC_MESSAGES:       i = LC_MESSAGES_INDEX;       break;
+#  ifdef LC_PAPER
+        case LC_PAPER:          i = LC_PAPER_INDEX;          break;
+#  endif
+#  ifdef LC_NAME
+        case LC_NAME:           i = LC_NAME_INDEX;           break;
+#  endif
+#  ifdef LC_ADDRESS
+        case LC_ADDRESS:        i = LC_ADDRESS_INDEX;        break;
+#  endif
+#  ifdef LC_TELEPHONE
+        case LC_TELEPHONE:      i = LC_TELEPHONE_INDEX;      break;
+#  endif
+#  ifdef LC_MEASUREMENT
+        case LC_MEASUREMENT:    i = LC_MEASUREMENT_INDEX;    break;
+#  endif
+#  ifdef LC_IDENTIFICATION
+        case LC_IDENTIFICATION: i = LC_IDENTIFICATION_INDEX; break;
+#  endif
+        default:
+          /* If you get here, a #ifdef LC_xxx is missing.  */
+          abort ();
+        }
+
+      strcpy (resultbuf[i], buf);
+      return resultbuf[i];
+# endif
+    }
+#endif
+}
diff --git a/lib/setlocale_null.h b/lib/setlocale_null.h
new file mode 100644 (file)
index 0000000..5f45856
--- /dev/null
@@ -0,0 +1,82 @@
+/* Query the name of the current global locale.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#ifndef _SETLOCALE_NULL_H
+#define _SETLOCALE_NULL_H
+
+#include <stddef.h>
+
+#include "arg-nonnull.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Recommended size of a buffer for a locale name for a single category.
+   On glibc systems, you can have locale names that are relative file names;
+   assume a maximum length 256.
+   In native Windows, in 2018 the longest locale name was of length 58
+   ("FYRO Macedonian_Former Yugoslav Republic of Macedonia.1251").  */
+#define SETLOCALE_NULL_MAX (256+1)
+
+/* Recommended size of a buffer for a locale name with all categories.
+   On glibc systems, you can have locale names that are relative file names;
+   assume maximum length 256 for each.  There are 12 categories; so, the
+   maximum total length is 148+12*256.
+   In native Windows, there are 5 categories, and the maximum total length is
+   55+5*58.  */
+#define SETLOCALE_NULL_ALL_MAX (148+12*256+1)
+
+/* setlocale_null_r (CATEGORY, BUF, BUFSIZE) is like setlocale (CATEGORY, NULL),
+   except that
+     - it is guaranteed to be multithread-safe,
+     - it returns the resulting locale category name or locale name in the
+       user-supplied buffer BUF, which must be BUFSIZE bytes long.
+   The recommended minimum buffer size is
+     - SETLOCALE_NULL_MAX for CATEGORY != LC_ALL, and
+     - SETLOCALE_NULL_ALL_MAX for CATEGORY == LC_ALL.
+   The return value is an error code: 0 if the call is successful, EINVAL if
+   CATEGORY is invalid, or ERANGE if BUFSIZE is smaller than the length needed
+   size (including the trailing NUL byte).  In the latter case, a truncated
+   result is returned in BUF, but still NUL-terminated if BUFSIZE > 0.
+   For this call to be multithread-safe, *all* calls to
+   setlocale (CATEGORY, NULL) in all other threads must have been converted
+   to use setlocale_null_r or setlocale_null as well, and the other threads
+   must not make other setlocale invocations (since changing the global locale
+   has side effects on all threads).  */
+extern int setlocale_null_r (int category, char *buf, size_t bufsize)
+  _GL_ARG_NONNULL ((2));
+
+/* setlocale_null (CATEGORY) is like setlocale (CATEGORY, NULL), except that
+   it is guaranteed to be multithread-safe.
+   The return value is NULL if CATEGORY is invalid.
+   For this call to be multithread-safe, *all* calls to
+   setlocale (CATEGORY, NULL) in all other threads must have been converted
+   to use setlocale_null_r or setlocale_null as well, and the other threads
+   must not make other setlocale invocations (since changing the global locale
+   has side effects on all threads).  */
+extern const char *setlocale_null (int category);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SETLOCALE_NULL_H */
index ad8c1dd..4253cc9 100644 (file)
@@ -1,6 +1,6 @@
 /* Convenience declarations when working with <signal.h>.
 
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_SIG_HANDLER_H
 #define _GL_SIG_HANDLER_H
@@ -37,15 +37,12 @@ typedef void (*sa_handler_t) (int);
 SIG_HANDLER_INLINE sa_handler_t _GL_ATTRIBUTE_PURE
 get_handler (struct sigaction const *a)
 {
-#ifdef SA_SIGINFO
   /* POSIX says that special values like SIG_IGN can only occur when
      action.sa_flags does not contain SA_SIGINFO.  But in Linux 2.4,
      for example, sa_sigaction and sa_handler are aliases and a signal
-     is ignored if sa_sigaction (after casting) equals SIG_IGN.  So
-     use (and cast) sa_sigaction in that case.  */
-  if (a->sa_flags & SA_SIGINFO)
-    return (sa_handler_t) a->sa_sigaction;
-#endif
+     is ignored if sa_sigaction (after casting) equals SIG_IGN.  In
+     this case, this implementation relies on the fact that the two
+     are aliases, and simply returns sa_handler.  */
   return a->sa_handler;
 }
 
index 529b612..05e7a11 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX compatible signal blocking.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
    Written by Eric Blake <ebb9@byu.net>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -67,7 +67,7 @@
 /* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
    for the signal SIGABRT.  Only one signal handler is stored for both
    SIGABRT and SIGABRT_COMPAT.  SIGABRT_COMPAT is not a signal of its own.  */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # undef SIGABRT_COMPAT
 # define SIGABRT_COMPAT 6
 #endif
index 7e1da0b..ed59071 100644 (file)
@@ -1,5 +1,5 @@
 /* Canonical list of all signal names.
-   Copyright (C) 1996-1999, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 1996-1999, 2008-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* This file should be usable for any platform, since it just associates
    the SIG* macros with text names and descriptions.  The actual values
index ab0a049..ed01d67 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <signal.h>.
 
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #ifndef _@GUARD_PREFIX@_SIGNAL_H
 #define _@GUARD_PREFIX@_SIGNAL_H
 
-/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android
-   declare pthread_sigmask in <pthread.h>, not in <signal.h>.
+/* Mac OS X 10.3, FreeBSD 6.4, OpenBSD 3.8, OSF/1 4.0, Solaris 2.6, Android,
+   OS/2 kLIBC declare pthread_sigmask in <pthread.h>, not in <signal.h>.
    But avoid namespace pollution on glibc systems.*/
 #if (@GNULIB_PTHREAD_SIGMASK@ || defined GNULIB_POSIXCHECK) \
     && ((defined __APPLE__ && defined __MACH__) \
         || defined __FreeBSD__ || defined __OpenBSD__ || defined __osf__ \
-        || defined __sun || defined __ANDROID__) \
+        || defined __sun || defined __ANDROID__ || defined __KLIBC__) \
     && ! defined __GLIBC__
 # include <pthread.h>
 #endif
@@ -133,18 +133,28 @@ typedef void (*sighandler_t) (int);
 #   define pthread_sigmask rpl_pthread_sigmask
 #  endif
 _GL_FUNCDECL_RPL (pthread_sigmask, int,
-                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+                  (int how,
+                   const sigset_t *restrict new_mask,
+                   sigset_t *restrict old_mask));
 _GL_CXXALIAS_RPL (pthread_sigmask, int,
-                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+                  (int how,
+                   const sigset_t *restrict new_mask,
+                   sigset_t *restrict old_mask));
 # else
-#  if !@HAVE_PTHREAD_SIGMASK@
+#  if !(@HAVE_PTHREAD_SIGMASK@ || defined pthread_sigmask)
 _GL_FUNCDECL_SYS (pthread_sigmask, int,
-                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+                  (int how,
+                   const sigset_t *restrict new_mask,
+                   sigset_t *restrict old_mask));
 #  endif
 _GL_CXXALIAS_SYS (pthread_sigmask, int,
-                  (int how, const sigset_t *new_mask, sigset_t *old_mask));
+                  (int how,
+                   const sigset_t *restrict new_mask,
+                   sigset_t *restrict old_mask));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (pthread_sigmask);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef pthread_sigmask
 # if HAVE_RAW_DECL_PTHREAD_SIGMASK
@@ -168,7 +178,9 @@ _GL_FUNCDECL_SYS (raise, int, (int sig));
 #  endif
 _GL_CXXALIAS_SYS (raise, int, (int sig));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (raise);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef raise
 /* Assume raise is always declared.  */
@@ -200,7 +212,7 @@ typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
 /* When also using extern inline, suppress the use of static inline in
    standard headers of problematic Apple configurations, as Libc at
    least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
-   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+   <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
    Perhaps Apple will fix this some day.  */
 #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
      && (defined __i386__ || defined __x86_64__))
@@ -291,10 +303,14 @@ _GL_CXXALIASWARN (sigpending);
 #  define SIG_SETMASK 1  /* blocked_set = *set; */
 #  define SIG_UNBLOCK 2  /* blocked_set = blocked_set & ~*set; */
 _GL_FUNCDECL_SYS (sigprocmask, int,
-                  (int operation, const sigset_t *set, sigset_t *old_set));
+                  (int operation,
+                   const sigset_t *restrict set,
+                   sigset_t *restrict old_set));
 # endif
 _GL_CXXALIAS_SYS (sigprocmask, int,
-                  (int operation, const sigset_t *set, sigset_t *old_set));
+                  (int operation,
+                   const sigset_t *restrict set,
+                   sigset_t *restrict old_set));
 _GL_CXXALIASWARN (sigprocmask);
 
 /* Install the handler FUNC for signal SIG, and return the previous
@@ -318,10 +334,18 @@ _GL_FUNCDECL_RPL (signal, _gl_function_taking_int_returning_void_t,
 _GL_CXXALIAS_RPL (signal, _gl_function_taking_int_returning_void_t,
                   (int sig, _gl_function_taking_int_returning_void_t func));
 # else
+/* On OpenBSD, the declaration of 'signal' may not be present at this point,
+   because it occurs in <sys/signal.h>, not <signal.h> directly.  */
+#  if defined __OpenBSD__
+_GL_FUNCDECL_SYS (signal, _gl_function_taking_int_returning_void_t,
+                  (int sig, _gl_function_taking_int_returning_void_t func));
+#  endif
 _GL_CXXALIAS_SYS (signal, _gl_function_taking_int_returning_void_t,
                   (int sig, _gl_function_taking_int_returning_void_t func));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (signal);
+# endif
 
 # if !@HAVE_POSIX_SIGNALBLOCKING@ && GNULIB_defined_SIGPIPE
 /* Raise signal SIGPIPE.  */
index 2de7ee6..2efb1ed 100644 (file)
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index e185971..7d855aa 100644 (file)
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 7dc0908..65e196e 100644 (file)
@@ -1,5 +1,5 @@
 /* signbit() macro: Determine the sign bit of a floating-point number.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index fcbf032..52a2325 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX compatible signal blocking.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -50,7 +50,7 @@
 /* On native Windows, as of 2008, the signal SIGABRT_COMPAT is an alias
    for the signal SIGABRT.  Only one signal handler is stored for both
    SIGABRT and SIGABRT_COMPAT.  SIGABRT_COMPAT is not a signal of its own.  */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # undef SIGABRT_COMPAT
 # define SIGABRT_COMPAT 6
 #endif
diff --git a/lib/sigsegv.c b/lib/sigsegv.c
new file mode 100644 (file)
index 0000000..696a152
--- /dev/null
@@ -0,0 +1,1372 @@
+/* Page fault handling library.
+   Copyright (C) 1993-2021  Bruno Haible <bruno@clisp.org>
+   Copyright (C) 2018  Nylon Chen <nylon7@andestech.com>
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "sigsegv.h"
+
+#include <errno.h>
+#include <stdio.h> /* declares perror */
+#include <stdint.h> /* defines uintptr_t */
+#include <stdlib.h>
+#include <signal.h>
+#if HAVE_GETRLIMIT
+# include <sys/resource.h> /* declares struct rlimit */
+#endif
+
+#ifdef __OpenBSD__
+# include <sys/param.h> /* defines macro OpenBSD */
+#endif
+
+
+/* Version number.  */
+int libsigsegv_version = LIBSIGSEGV_VERSION;
+
+
+/* ======================= Fault handler information ======================= */
+
+/* Define:
+
+     SIGSEGV_FAULT_HANDLER_ARGLIST
+          is the argument list for the actual fault handler.
+
+   and if available (optional):
+
+     SIGSEGV_FAULT_ADDRESS
+          is a macro for fetching the fault address.
+
+     SIGSEGV_FAULT_CONTEXT
+          is a macro giving a pointer to the entire fault context (i.e.
+          the register set etc.).
+
+     SIGSEGV_FAULT_STACKPOINTER
+          is a macro for fetching the stackpointer at the moment the fault
+          occurred.
+ */
+
+#if defined __linux__ || defined __ANDROID__ /* Linux */
+
+# define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, void *ucp
+# define SIGSEGV_FAULT_ADDRESS  sip->si_addr
+# define SIGSEGV_FAULT_CONTEXT  ((ucontext_t *) ucp)
+# define SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+
+# if defined __alpha__
+
+/* See glibc/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
+   and the 'struct sigcontext' defined in <asm/sigcontext.h>
+   are actually the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.sc_regs[30]
+
+# elif defined __arm64__ /* 64-bit */
+
+/* See glibc/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
+   and the 'struct sigcontext' defined in <asm/sigcontext.h>
+   are actually the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.sp
+
+# elif defined __arm__ || defined __armhf__ /* 32-bit */
+
+/* See glibc/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/arm/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/arm/sys/ucontext.h
+   and the 'struct sigcontext' defined in <asm/sigcontext.h>
+   are actually the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.arm_sp
+
+# elif defined __cris__
+
+/* See glibc-ports/sysdeps/unix/sysv/linux/cris/sys/ucontext.h.
+   Note that the 'mcontext_t' defined in
+   glibc-ports/sysdeps/unix/sysv/linux/cris/sys/ucontext.h
+   and the 'struct sigcontext' defined in <asm/sigcontext.h>
+   are actually the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.usp
+
+# elif defined __hppa__
+
+/* See glibc/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
+   and the 'struct sigcontext' defined in <asm/sigcontext.h>
+   are actually the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.sc_gr[30]
+
+# elif defined __x86_64__ /* 64 bit registers */
+
+/* See glibc/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
+   and the 'struct sigcontext' defined in
+   glibc/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
+   (see also <asm/sigcontext.h>)
+   are effectively the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.gregs[REG_RSP]
+
+# elif defined __i386__ /* 32 bit registers */
+
+/* See glibc/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/i386/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
+   and the 'struct sigcontext_ia32' defined in <asm/sigcontext32.h>
+   are effectively the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.gregs[REG_ESP]
+                     /* same value as ((ucontext_t *) ucp)->uc_mcontext.gregs[REG_UESP] */
+
+# elif defined __ia64__
+
+/* See glibc/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
+   and the 'struct sigcontext' defined in
+   glibc/sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h
+   (see also <asm/sigcontext.h>)
+   are actually the same.  */
+
+/* IA-64 has two stack pointers, one that grows down, called $r12, and one
+   that grows up, called $bsp/$bspstore.  */
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.sc_gr[12]
+
+/* It would be better to access $bspstore instead of $bsp but I don't know
+   where to find it in 'struct sigcontext'.  Anyway, it doesn't matter
+   because $bsp and $bspstore never differ by more than ca. 1 KB.  */
+#  define SIGSEGV_FAULT_BSP_POINTER  ((ucontext_t *) ucp)->uc_mcontext.sc_ar_bsp
+
+# elif defined __m68k__
+
+/* See glibc/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
+   and the 'struct sigcontext' defined in <asm/sigcontext.h>
+   are quite different types.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.gregs[R_SP]
+
+# elif defined __mips__ || defined __mipsn32__ || defined __mips64__
+
+/* See glibc/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/mips/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
+   and the 'struct sigcontext' defined in
+   glibc/sysdeps/unix/sysv/linux/mips/bits/sigcontext.h
+   (see also <asm/sigcontext.h>)
+   are effectively the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.gregs[29]
+
+# elif defined __nds32__
+
+/* See glibc/sysdeps/unix/sysv/linux/nds32/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/nds32/sigcontextinfo.h.
+   Both are found in <https://patches-gcc.linaro.org/cover/4409/> part 08/11
+   <https://sourceware.org/ml/libc-alpha/2018-05/msg00125.html>.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.nds32_sp
+
+# elif defined __powerpc__ || defined __powerpc64__ || defined __powerpc64_elfv2__
+
+/* See glibc/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h,
+   the 'struct sigcontext' defined in <asm/sigcontext.h>,
+   and the 'struct pt_regs' defined in <asm/ptrace.h>
+   are quite different types.  */
+
+#  if defined __powerpc64__ || defined __powerpc64_elfv2__ /* 64-bit */
+#   define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.gp_regs[1]
+#  else /* 32-bit */
+/* both should be equivalent */
+#   if 0
+#    define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.regs->gpr[1]
+#   else
+#    define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.uc_regs->gregs[1]
+#   endif
+#  endif
+
+# elif defined __riscv32__ || __riscv64__
+
+/* See glibc/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
+   and the 'struct sigcontext' defined in
+   glibc/sysdeps/unix/sysv/linux/riscv/bits/sigcontext.h
+   start with the same block of 32 general-purpose registers.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.__gregs[REG_SP]
+
+# elif defined __s390__ || defined __s390x__
+
+/* See glibc/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/s390/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/s390/sys/ucontext.h
+   and the '_sigregs' type, indirect part of 'struct sigcontext', defined
+   in <asm/sigcontext.h>, are effectively the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.gregs[15]
+
+# elif defined __sh__
+
+/* See glibc/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/sh/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/sh/sys/ucontext.h
+   and the 'struct sigcontext' defined in <asm/sigcontext.h>
+   are effectively the same.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.gregs[15]
+
+# elif defined __sparc__ || defined __sparc64__
+
+/* See glibc/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
+   and the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/sparc/{sparc32,sparc64}/sigcontextinfo.h.
+   Note that the 'mcontext_t' defined in
+   glibc/sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
+   and the 'struct sigcontext' defined in
+   glibc/sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h
+   (see also <asm/sigcontext.h>)
+   are quite different types.  */
+
+#  if defined __sparc64__/* 64-bit */
+/* From linux-4.8.1/arch/sparc/kernel/signal_64.c, function setup_rt_frame, we
+   see that ucp is not an 'ucontext_t *' but rather a 'struct sigcontext *'
+   that happens to have the same value as sip (which is possible because a
+   'struct sigcontext' starts with 128 bytes room for the siginfo_t).  */
+#   define SIGSEGV_FAULT_STACKPOINTER  (((struct sigcontext *) ucp)->sigc_regs.u_regs[14] + 2047)
+#  else /* 32-bit */
+/* From linux-4.8.1/arch/sparc/kernel/signal_32.c, function setup_rt_frame,
+   and linux-4.8.1/arch/sparc/kernel/signal32.c, function setup_rt_frame32, we
+   see that ucp is a 'struct pt_regs *' or 'struct pt_regs32 *', respectively.
+   In userland, this is a 'struct sigcontext *'.  */
+#   define SIGSEGV_FAULT_STACKPOINTER  ((struct sigcontext *) ucp)->si_regs.u_regs[14]
+#  endif
+
+/* The sip->si_addr field is correct for a normal fault, but unusable in case
+   of a stack overflow. What I observe (when running
+   tests/test-sigsegv-catch-stackoverflow1, with a printf right at the beginning
+   of sigsegv_handler) is that sip->si_addr is near 0:
+     - in 64-bit mode: sip->si_addr = 0x000000000000030F, and gdb shows me that
+       the fault occurs in an instruction 'stx %o3,[%fp+0x30f]' and %fp is 0.
+       In fact, all registers %l0..%l7 and %i0..%i7 are 0.
+     - in 32-bit mode: sip->si_addr = 0xFFFFFA64, and gdb shows me that
+       the fault occurs in an instruction 'st %g2,[%fp-1436]' and %fp is 0.
+       In fact, all registers %l0..%l7 and %i0..%i7 are 0.
+   Apparently when the stack overflow occurred, some trap has tried to move the
+   contents of the registers %l0..%l7 and %i0..%i7 (a "window" in SPARC
+   terminology) to the stack, did not succeed in doing this, replaced all these
+   register values with 0, and resumed execution at the fault location. This
+   time, due to %fp = 0, a different fault was triggered. Now it is impossible
+   to determine the real (previous) fault address because, even if know the
+   faulting instruction, the previous register values have been lost.  */
+#  define BOGUS_FAULT_ADDRESS_UPON_STACK_OVERFLOW
+
+# else
+
+/* When adding support for other CPUs here:  */
+
+/* For SIGSEGV_FAULT_HANDLER_ARGLIST, see the definition of SIGCONTEXT in
+   glibc/sysdeps/unix/sysv/linux/<cpu>/sigcontextinfo.h.  */
+
+/* For SIGSEGV_FAULT_STACKPOINTER, see the definition of GET_STACK in
+   glibc/sysdeps/unix/sysv/linux/<cpu>/sigcontextinfo.h.  */
+
+# endif
+
+#endif
+
+#if defined __GNU__ /* Hurd */
+
+# define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, int code, struct sigcontext *scp
+# define SIGSEGV_FAULT_ADDRESS  (unsigned long) code
+# define SIGSEGV_FAULT_CONTEXT  scp
+
+# if defined __i386__
+
+/* scp points to a 'struct sigcontext' (defined in
+   glibc/sysdeps/mach/hurd/i386/bits/sigcontext.h).
+   The registers of this struct get pushed on the stack through
+   gnumach/i386/i386/locore.S:trapall.  */
+/* Both sc_esp and sc_uesp appear to have the same value.
+   It appears more reliable to use sc_uesp because it is labelled as
+   "old esp, if trapped from user".  */
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_uesp
+
+# endif
+
+#endif
+
+#if defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ /* GNU/kFreeBSD, FreeBSD */
+
+# if defined __arm__ || defined __armhf__ || defined __arm64__
+
+#  define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, void *ucp
+#  define SIGSEGV_FAULT_ADDRESS  sip->si_addr
+#  define SIGSEGV_FAULT_CONTEXT  ((ucontext_t *) ucp)
+
+#  if defined __arm64__ /* 64-bit */
+
+/* See sys/arm64/include/ucontext.h.  */
+
+#   define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.mc_gpregs.gp_sp
+
+#  elif defined __arm__ || defined __armhf__ /* 32-bit */
+
+/* See sys/arm/include/ucontext.h.  */
+
+#   define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.__gregs[_REG_SP]
+
+#  endif
+
+# else
+
+/* On FreeBSD 12, both of these approaches work.  On FreeBSD derivatives, the
+   first one has more chances to work.  */
+#  if 1
+/* Use signal handlers without SA_SIGINFO.  */
+
+#   define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, int code, struct sigcontext *scp, void *addr
+#   define SIGSEGV_FAULT_ADDRESS  addr
+#   define SIGSEGV_FAULT_CONTEXT  scp
+
+/* See sys/x86/include/signal.h.  */
+
+#   if defined __x86_64__
+/* 64 bit registers */
+
+#    define SIGSEGV_FAULT_STACKPOINTER  scp->sc_rsp
+
+#   elif defined __i386__
+/* 32 bit registers */
+
+#    define SIGSEGV_FAULT_STACKPOINTER  scp->sc_esp
+
+#   endif
+
+#  else
+/* Use signal handlers with SA_SIGINFO.  */
+
+#   define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, void *scp
+#   define SIGSEGV_FAULT_ADDRESS  sip->si_addr
+#   define SIGSEGV_FAULT_CONTEXT  ((struct sigcontext *) scp)
+#   define SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+
+/* See sys/x86/include/signal.h.  */
+
+#   if defined __x86_64__
+/* 64 bit registers */
+
+#    define SIGSEGV_FAULT_STACKPOINTER  ((struct sigcontext *) scp)->sc_rsp
+
+#   elif defined __i386__
+/* 32 bit registers */
+
+#    define SIGSEGV_FAULT_STACKPOINTER  ((struct sigcontext *) scp)->sc_esp
+
+#   endif
+
+#  endif
+
+# endif
+
+#endif
+
+#if defined __NetBSD__ /* NetBSD */
+
+# define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, void *ucp
+# define SIGSEGV_FAULT_ADDRESS  sip->si_addr
+# define SIGSEGV_FAULT_CONTEXT  ((ucontext_t *) ucp)
+# define SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+
+/* _UC_MACHINE_SP is a platform independent macro.
+   Defined in <machine/mcontext.h>, see
+     http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/$arch/include/mcontext.h
+   Supported on alpha, amd64, i386, ia64, m68k, mips, powerpc, sparc since
+   NetBSD 2.0.
+   On i386, _UC_MACHINE_SP is the same as ->uc_mcontext.__gregs[_REG_UESP],
+   and apparently the same value as       ->uc_mcontext.__gregs[_REG_ESP]. */
+# ifdef _UC_MACHINE_SP
+#  define SIGSEGV_FAULT_STACKPOINTER  _UC_MACHINE_SP ((ucontext_t *) ucp)
+# endif
+
+#endif
+
+#if defined __OpenBSD__ /* OpenBSD */
+
+# define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, struct sigcontext *scp
+# define SIGSEGV_FAULT_ADDRESS  sip->si_addr
+# define SIGSEGV_FAULT_CONTEXT  scp
+# define SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+
+# if defined __alpha__
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/alpha/include/signal.h.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_regs[30]
+
+# elif defined __arm__ || defined __armhf__
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/arm/include/signal.h.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_usr_sp
+
+# elif defined __hppa__ || defined __hppa64__
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/hppa/include/signal.h
+   and
+   openbsd-src/sys/arch/hppa64/include/signal.h.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_regs[30]
+
+# elif defined __x86_64__
+/* 64 bit registers */
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/amd64/include/signal.h.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_rsp
+
+# elif defined __i386__
+/* 32 bit registers */
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/i386/include/signal.h.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_esp
+
+# elif defined __m68k__
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/m68k/include/signal.h.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_sp
+
+# elif defined __m88k__
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/m88k/include/signal.h
+   and the definition of 'struct reg' in
+   openbsd-src/sys/arch/m88k/include/reg.h.  */
+
+#  if OpenBSD >= 201211 /* OpenBSD version >= 5.2 */
+#   define SIGSEGV_FAULT_STACKPOINTER  scp->sc_regs[31]
+#  else
+#   define SIGSEGV_FAULT_STACKPOINTER  scp->sc_regs.r[31]
+#  endif
+
+# elif defined __mips__ || defined __mipsn32__ || defined __mips64__
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/mips64/include/signal.h.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_regs[29]
+
+# elif defined __powerpc__ || defined __powerpc64__
+
+/* See the definition of 'struct sigcontext' and 'struct trapframe' in
+   openbsd-src/sys/arch/powerpc/include/signal.h.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_frame.fixreg[1]
+
+# elif defined __sh__
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/sh/include/signal.h
+   and the definition of 'struct reg' in
+   openbsd-src/sys/arch/sh/include/reg.h.  */
+
+#  if OpenBSD >= 201211 /* OpenBSD version >= 5.2 */
+#   define SIGSEGV_FAULT_STACKPOINTER  scp->sc_reg[20-15]
+#  else
+#   define SIGSEGV_FAULT_STACKPOINTER  scp->sc_reg.r_r15
+#  endif
+
+# elif defined __sparc__ || defined __sparc64__
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/sparc/include/signal.h
+   and
+   openbsd-src/sys/arch/sparc64/include/signal.h.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_sp
+
+# elif defined __vax__
+
+/* See the definition of 'struct sigcontext' in
+   openbsd-src/sys/arch/vax/include/signal.h.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_sp
+
+# endif
+
+#endif
+
+#if (defined __APPLE__ && defined __MACH__) /* macOS */
+
+# define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, void *ucp
+# define SIGSEGV_FAULT_ADDRESS  sip->si_addr
+# define SIGSEGV_FAULT_CONTEXT  ((ucontext_t *) ucp)
+# define SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+
+# if defined __x86_64__
+
+/* See the definitions of
+     - 'ucontext_t' and 'struct __darwin_ucontext' in <sys/_types/_ucontext.h>,
+     - 'struct __darwin_mcontext64' in <i386/_mcontext.h>, and
+     - 'struct __darwin_x86_thread_state64' in <mach/i386/_structs.h>.  */
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext->__ss.__rsp
+
+# elif defined __i386__
+
+/* See the definitions of
+     - 'ucontext_t' and 'struct __darwin_ucontext' in <sys/_types/_ucontext.h>,
+     - 'struct __darwin_mcontext32' in <i386/_mcontext.h>, and
+     - 'struct __darwin_i386_thread_state' in <mach/i386/_structs.h>.  */
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext->__ss.__esp
+
+# elif defined __arm64__
+
+/* See the definitions of
+     - 'ucontext_t' and 'struct __darwin_ucontext' in <sys/_types/_ucontext.h>,
+     - 'struct __darwin_mcontext64' in <arm/_mcontext.h>, and
+     - 'struct __darwin_arm_thread_state64' in <mach/arm/_structs.h>.  */
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext->__ss.__sp
+
+# elif defined __powerpc__
+
+/* See the definitions of
+     - 'ucontext_t' and 'struct __darwin_ucontext' in <sys/_structs.h>,
+     - 'struct __darwin_mcontext' in <ppc/_structs.h>, and
+     - 'struct __darwin_ppc_thread_state' in <mach/ppc/_structs.h>.  */
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext->__ss.__r1
+
+# endif
+
+#endif
+
+#if defined _AIX /* AIX */
+
+# define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, void *ucp
+# define SIGSEGV_FAULT_ADDRESS  sip->si_addr
+# define SIGSEGV_FAULT_CONTEXT  ((ucontext_t *) ucp)
+# define SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+
+# if defined __powerpc__ || defined __powerpc64__
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.jmp_context.gpr[1]
+# endif
+
+#endif
+
+#if defined __sgi /* IRIX */
+
+# define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, int code, struct sigcontext *scp
+# define SIGSEGV_FAULT_ADDRESS  (unsigned long) scp->sc_badvaddr
+# define SIGSEGV_FAULT_CONTEXT  scp
+
+# if defined __mips__ || defined __mipsn32__ || defined __mips64__
+#  define SIGSEGV_FAULT_STACKPOINTER  scp->sc_regs[29]
+# endif
+
+#endif
+
+#if defined __sun /* Solaris */
+
+# define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, void *ucp
+# define SIGSEGV_FAULT_ADDRESS  sip->si_addr
+# define SIGSEGV_FAULT_CONTEXT  ((ucontext_t *) ucp)
+# define SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+
+# if defined __x86_64__
+/* 64 bit registers */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.gregs[REG_RSP]
+
+# elif defined __i386__
+/* 32 bit registers */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.gregs[ESP]
+
+# elif defined __sparc__ || defined __sparc64__
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.gregs[REG_O6]
+
+#  if SOLARIS11
+
+/* On Solaris 11.3/SPARC, both in 32-bit and 64-bit mode, when catching
+   stack overflow, the fault address is correct the first time, but is zero
+   or near zero the second time.
+   'truss tests/test-sigsegv-catch-stackoverflow1' shows it:
+
+   In 32-bit mode:
+
+    Incurred fault #6, FLTBOUNDS  %pc = 0x000116E8
+      siginfo: SIGSEGV SEGV_MAPERR addr=0xFFB00000
+    Received signal #11, SIGSEGV [caught]
+      siginfo: SIGSEGV SEGV_MAPERR addr=0xFFB00000
+   then
+    Incurred fault #6, FLTBOUNDS  %pc = 0x000116E8
+      siginfo: SIGSEGV SEGV_MAPERR addr=0x00000008
+    Received signal #11, SIGSEGV [caught]
+      siginfo: SIGSEGV SEGV_MAPERR addr=0x00000008
+
+   In 64-bit mode:
+
+    Incurred fault #6, FLTBOUNDS  %pc = 0x100001C58
+      siginfo: SIGSEGV SEGV_MAPERR addr=0xFFFFFFFF7FF00000
+    Received signal #11, SIGSEGV [caught]
+      siginfo: SIGSEGV SEGV_MAPERR addr=0xFFFFFFFF7FF00000
+   then
+    Incurred fault #6, FLTBOUNDS  %pc = 0x100001C58
+      siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
+    Received signal #11, SIGSEGV [caught]
+      siginfo: SIGSEGV SEGV_MAPERR addr=0x00000000
+ */
+#   define BOGUS_FAULT_ADDRESS_UPON_STACK_OVERFLOW
+
+#  endif
+
+# endif
+
+#endif
+
+#if defined __CYGWIN__ /* Cygwin */
+
+# define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, void *ucp
+# define SIGSEGV_FAULT_ADDRESS  sip->si_addr
+# define SIGSEGV_FAULT_CONTEXT  ((ucontext_t *) ucp)
+# define SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+
+/* See the definition of 'ucontext_t' in <sys/ucontext.h> and
+   of 'struct __mcontext' in <cygwin/signal.h>.  */
+# if defined __x86_64__
+/* 64 bit registers */
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.rsp
+# elif defined __i386__
+/* 32 bit registers */
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.esp
+# endif
+
+#endif
+
+#if defined __HAIKU__ /* Haiku */
+
+# define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, void *ucp
+# define SIGSEGV_FAULT_ADDRESS  sip->si_addr
+# define SIGSEGV_FAULT_CONTEXT  ((ucontext_t *) ucp)
+# define SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+
+# if defined __x86_64__
+/* 64 bit registers */
+
+/* See the definition of 'ucontext_t' in <signal.h> and
+   of 'struct vregs' in <arch/x86_64/signal.h>.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.rsp
+
+# elif defined __i386__
+/* 32 bit registers */
+
+/* See the definition of 'ucontext_t' in <signal.h> and
+   of 'struct vregs' in <arch/x86/signal.h>.  */
+
+#  define SIGSEGV_FAULT_STACKPOINTER  ((ucontext_t *) ucp)->uc_mcontext.esp
+
+# endif
+
+#endif
+
+/* ========================================================================== */
+
+/* List of signals that are sent when an invalid virtual memory address
+   is accessed, or when the stack overflows.  */
+#if defined __GNU__ \
+    || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ \
+    || defined __NetBSD__ || defined __OpenBSD__ \
+    || (defined __APPLE__ && defined __MACH__)
+# define SIGSEGV_FOR_ALL_SIGNALS(var,body) \
+    { int var; var = SIGSEGV; { body } var = SIGBUS; { body } }
+#else
+# define SIGSEGV_FOR_ALL_SIGNALS(var,body) \
+    { int var; var = SIGSEGV; { body } }
+#endif
+
+/* ========================================================================== */
+
+/* Determine the virtual memory area of a given address.  */
+#include "stackvma.h"
+
+/* ========================================================================== */
+
+/* On the average Unix platform, we define
+
+   HAVE_SIGSEGV_RECOVERY
+       if there is a fault-*.h include file which defines
+       SIGSEGV_FAULT_HANDLER_ARGLIST and SIGSEGV_FAULT_ADDRESS.
+
+   HAVE_STACK_OVERFLOW_RECOVERY
+       if HAVE_SIGALTSTACK is set and
+       at least two of the following are true:
+       A) There is a fault-*.h include file which defines
+          SIGSEGV_FAULT_HANDLER_ARGLIST and SIGSEGV_FAULT_ADDRESS.
+       B) There is a fault-*.h include file which defines
+          SIGSEGV_FAULT_HANDLER_ARGLIST and SIGSEGV_FAULT_STACKPOINTER.
+       C) There is a stackvma-*.c, other than stackvma-none.c, which
+          defines sigsegv_get_vma.
+
+   Why? Obviously, to catch stack overflow, we need an alternate signal
+   stack; this requires kernel support. But we also need to distinguish
+   (with a reasonable confidence) a stack overflow from a regular SIGSEGV.
+   If we have A) and B), we use the
+     Heuristic AB: If the fault address is near the stack pointer, it's a
+     stack overflow.
+   If we have A) and C), we use the
+     Heuristic AC: If the fault address is near and beyond the bottom of
+     the stack's virtual memory area, it's a stack overflow.
+   If we have B) and C), we use the
+     Heuristic BC: If the stack pointer is near the bottom of the stack's
+     virtual memory area, it's a stack overflow.
+     This heuristic comes in two flavours: On OSes which let the stack's
+     VMA grow continuously, we determine the bottom by use of getrlimit().
+     On OSes which preallocate the stack's VMA with its maximum size
+     (like BeOS), we use the stack's VMA directly.
+ */
+
+#if HAVE_SIGSEGV_RECOVERY \
+     && !(defined SIGSEGV_FAULT_HANDLER_ARGLIST && defined SIGSEGV_FAULT_ADDRESS)
+# error "You need to define SIGSEGV_FAULT_HANDLER_ARGLIST and SIGSEGV_FAULT_ADDRESS before you can define HAVE_SIGSEGV_RECOVERY."
+#endif
+#if !HAVE_SIGSEGV_RECOVERY \
+    && (defined SIGSEGV_FAULT_HANDLER_ARGLIST && defined SIGSEGV_FAULT_ADDRESS) \
+    && !(defined __FreeBSD__ && (defined __sparc__ || defined __sparc64__))
+# if __GNUC__ || (__clang_major__ >= 4)
+#  warning "You can define HAVE_SIGSEGV_RECOVERY on this platform."
+# else
+#  error "You can define HAVE_SIGSEGV_RECOVERY on this platform."
+# endif
+#endif
+
+#if HAVE_STACK_OVERFLOW_RECOVERY \
+    && !(defined SIGSEGV_FAULT_ADDRESS + defined SIGSEGV_FAULT_STACKPOINTER + HAVE_STACKVMA >= 2)
+# error "You need to define two of SIGSEGV_FAULT_ADDRESS, SIGSEGV_FAULT_STACKPOINTER, HAVE_STACKVMA, before you can define HAVE_STACK_OVERFLOW_RECOVERY."
+#endif
+#if !HAVE_STACK_OVERFLOW_RECOVERY \
+    && (defined SIGSEGV_FAULT_ADDRESS + defined SIGSEGV_FAULT_STACKPOINTER + HAVE_STACKVMA >= 2) \
+    && !(defined __FreeBSD__ && (defined __sparc__ || defined __sparc64__)) \
+    && !(defined __NetBSD__ && (defined __sparc__ || defined __sparc64__))
+# if __GNUC__ || (__clang_major__ >= 4)
+#  warning "You can define HAVE_STACK_OVERFLOW_RECOVERY on this platform."
+# else
+#  error "You can define HAVE_STACK_OVERFLOW_RECOVERY on this platform."
+# endif
+#endif
+
+/* ========================================================================== */
+
+#if HAVE_STACK_OVERFLOW_RECOVERY
+
+/* ======= Leaving a signal handler executing on the alternate stack ======= */
+
+/* Platform dependent:
+   Leaving a signal handler executing on the alternate stack.  */
+static void sigsegv_reset_onstack_flag (void);
+
+/* -------------------------- leave-sigaltstack.c -------------------------- */
+
+# if defined __GNU__ \
+     || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ \
+     || defined __NetBSD__ || defined __OpenBSD__
+
+static void
+sigsegv_reset_onstack_flag (void)
+{
+  stack_t ss;
+
+  if (sigaltstack (NULL, &ss) >= 0)
+    {
+      ss.ss_flags &= ~SS_ONSTACK;
+      sigaltstack (&ss, NULL);
+    }
+}
+
+/* --------------------------- leave-setcontext.c --------------------------- */
+
+# elif defined __sgi || defined __sun /* IRIX, Solaris */
+
+#  include <ucontext.h>
+
+static void
+sigsegv_reset_onstack_flag (void)
+{
+  ucontext_t uc;
+
+  if (getcontext (&uc) >= 0)
+    /* getcontext returns twice.  We are interested in the returned context
+       only the first time, i.e. when the SS_ONSTACK bit is set.  */
+    if (uc.uc_stack.ss_flags & SS_ONSTACK)
+      {
+        uc.uc_stack.ss_flags &= ~SS_ONSTACK;
+        /* Note that setcontext() does not refill uc.  Therefore if
+           setcontext() keeps SS_ONSTACK set in the kernel, either
+           setcontext() will return -1 or getcontext() will return a
+           second time, with the SS_ONSTACK bit being cleared.  */
+        setcontext (&uc);
+      }
+}
+
+/* ------------------------------ leave-nop.c ------------------------------ */
+
+# else
+
+static void
+sigsegv_reset_onstack_flag (void)
+{
+  /* Nothing to do. sigaltstack() simply looks at the stack pointer,
+     therefore SS_ONSTACK is not sticky.  */
+}
+
+# endif
+
+/* ========================================================================== */
+
+# if HAVE_STACKVMA
+
+/* Address of the last byte belonging to the stack vma.  */
+static uintptr_t stack_top = 0;
+
+/* Needs to be called once only.  */
+static void
+remember_stack_top (void *some_variable_on_stack)
+{
+  struct vma_struct vma;
+
+  if (sigsegv_get_vma ((uintptr_t) some_variable_on_stack, &vma) >= 0)
+    stack_top = vma.end - 1;
+}
+
+# endif /* HAVE_STACKVMA */
+
+static stackoverflow_handler_t stk_user_handler = (stackoverflow_handler_t)NULL;
+static uintptr_t stk_extra_stack;
+static size_t stk_extra_stack_size;
+
+#endif /* HAVE_STACK_OVERFLOW_RECOVERY */
+
+#if HAVE_SIGSEGV_RECOVERY
+
+/* User's SIGSEGV handler.  */
+static sigsegv_handler_t user_handler = (sigsegv_handler_t)NULL;
+
+#endif /* HAVE_SIGSEGV_RECOVERY */
+
+
+/* Our SIGSEGV handler, with OS dependent argument list.  */
+
+#if HAVE_SIGSEGV_RECOVERY
+
+static void
+sigsegv_handler (SIGSEGV_FAULT_HANDLER_ARGLIST)
+{
+  void *address = (void *) (SIGSEGV_FAULT_ADDRESS);
+
+# if HAVE_STACK_OVERFLOW_RECOVERY
+#  if !(HAVE_STACKVMA || defined SIGSEGV_FAULT_STACKPOINTER)
+#error "Insufficient heuristics for detecting a stack overflow.  Either define CFG_STACKVMA and HAVE_STACKVMA correctly, or define SIGSEGV_FAULT_STACKPOINTER correctly, or undefine HAVE_STACK_OVERFLOW_RECOVERY!"
+#  endif
+
+  /* Call user's handler.  */
+  if (user_handler && (*user_handler) (address, 0))
+    {
+      /* Handler successful.  */
+    }
+  else
+    {
+      /* Handler declined responsibility.  */
+
+      /* Did the user install a stack overflow handler?  */
+      if (stk_user_handler)
+        {
+          /* See whether it was a stack overflow. If so, longjump away.  */
+#  ifdef SIGSEGV_FAULT_STACKPOINTER
+          uintptr_t old_sp = (uintptr_t) (SIGSEGV_FAULT_STACKPOINTER);
+#   ifdef __ia64
+          uintptr_t old_bsp = (uintptr_t) (SIGSEGV_FAULT_BSP_POINTER);
+#   endif
+#  endif
+
+#  if HAVE_STACKVMA
+          /* Were we able to determine the stack top?  */
+          if (stack_top)
+            {
+              /* Determine stack bounds.  */
+              int saved_errno;
+              struct vma_struct vma;
+              int ret;
+
+              saved_errno = errno;
+              ret = sigsegv_get_vma (stack_top, &vma);
+              errno = saved_errno;
+              if (ret >= 0)
+                {
+#   ifndef BOGUS_FAULT_ADDRESS_UPON_STACK_OVERFLOW
+                  /* Heuristic AC: If the fault_address is nearer to the stack
+                     segment's [start,end] than to the previous segment, we
+                     consider it a stack overflow.
+                     In the case of IA-64, we know that the previous segment
+                     is the up-growing bsp segment, and either of the two
+                     stacks can overflow.  */
+                  uintptr_t addr = (uintptr_t) address;
+
+#    ifdef __ia64
+                  if (addr >= vma.prev_end && addr <= vma.end - 1)
+#    else
+#     if STACK_DIRECTION < 0
+                  if (addr >= vma.start
+                      ? (addr <= vma.end - 1)
+                      : vma.is_near_this (addr, &vma))
+#     else
+                  if (addr <= vma.end - 1
+                      ? (addr >= vma.start)
+                      : vma.is_near_this (addr, &vma))
+#     endif
+#    endif
+                    {
+#   else /* BOGUS_FAULT_ADDRESS_UPON_STACK_OVERFLOW */
+#    if HAVE_GETRLIMIT && defined RLIMIT_STACK
+                  /* Heuristic BC: If the stack size has reached its maximal size,
+                     and old_sp is near the low end, we consider it a stack
+                     overflow.  */
+                  struct rlimit rl;
+
+                  saved_errno = errno;
+                  ret = getrlimit (RLIMIT_STACK, &rl);
+                  errno = saved_errno;
+                  if (ret >= 0)
+                    {
+                      uintptr_t current_stack_size = vma.end - vma.start;
+                      uintptr_t max_stack_size = rl.rlim_cur;
+                      if (current_stack_size <= max_stack_size + 4096
+                          && max_stack_size <= current_stack_size + 4096
+#    else
+                    {
+                      if (1
+#    endif
+#    ifdef SIGSEGV_FAULT_STACKPOINTER
+                          /* Heuristic BC: If we know old_sp, and it is neither
+                             near the low end, nor in the alternate stack, then
+                             it's probably not a stack overflow.  */
+                          && ((old_sp >= stk_extra_stack
+                               && old_sp <= stk_extra_stack + stk_extra_stack_size)
+#     if STACK_DIRECTION < 0
+                              || (old_sp <= vma.start + 4096
+                                  && vma.start <= old_sp + 4096))
+#     else
+                              || (old_sp <= vma.end + 4096
+                                  && vma.end <= old_sp + 4096))
+#     endif
+#    endif
+                         )
+#   endif /* BOGUS_FAULT_ADDRESS_UPON_STACK_OVERFLOW */
+#  else /* !HAVE_STACKVMA */
+          /* Heuristic AB: If the fault address is near the stack pointer,
+             it's a stack overflow.  */
+          uintptr_t addr = (uintptr_t) address;
+
+          if ((addr <= old_sp + 4096 && old_sp <= addr + 4096)
+#   ifdef __ia64
+              || (addr <= old_bsp + 4096 && old_bsp <= addr + 4096)
+#   endif
+             )
+            {
+                {
+                    {
+#  endif /* !HAVE_STACKVMA */
+                        {
+#  ifdef SIGSEGV_FAULT_STACKPOINTER
+                          int emergency =
+                            (old_sp >= stk_extra_stack
+                             && old_sp <= stk_extra_stack + stk_extra_stack_size);
+                          stackoverflow_context_t context = (SIGSEGV_FAULT_CONTEXT);
+#  else
+                          int emergency = 0;
+                          stackoverflow_context_t context = (void *) 0;
+#  endif
+                          /* Call user's handler.  */
+                          (*stk_user_handler) (emergency, context);
+                        }
+                    }
+                }
+            }
+        }
+# endif /* HAVE_STACK_OVERFLOW_RECOVERY */
+
+      if (user_handler && (*user_handler) (address, 1))
+        {
+          /* Handler successful.  */
+        }
+      else
+        {
+          /* Handler declined responsibility for real.  */
+
+          /* Remove ourselves and dump core.  */
+          SIGSEGV_FOR_ALL_SIGNALS (sig, signal (sig, SIG_DFL);)
+        }
+
+# if HAVE_STACK_OVERFLOW_RECOVERY
+    }
+# endif /* HAVE_STACK_OVERFLOW_RECOVERY */
+}
+
+#elif HAVE_STACK_OVERFLOW_RECOVERY
+
+static void
+# ifdef SIGSEGV_FAULT_STACKPOINTER
+sigsegv_handler (SIGSEGV_FAULT_HANDLER_ARGLIST)
+# else
+sigsegv_handler (int sig)
+# endif
+{
+# if !((HAVE_GETRLIMIT && defined RLIMIT_STACK) || defined SIGSEGV_FAULT_STACKPOINTER)
+#  error "Insufficient heuristics for detecting a stack overflow.  Either define SIGSEGV_FAULT_STACKPOINTER correctly, or undefine HAVE_STACK_OVERFLOW_RECOVERY!"
+# endif
+
+  /* Did the user install a handler?  */
+  if (stk_user_handler)
+    {
+      /* See whether it was a stack overflow.  If so, longjump away.  */
+# ifdef SIGSEGV_FAULT_STACKPOINTER
+      uintptr_t old_sp = (uintptr_t) (SIGSEGV_FAULT_STACKPOINTER);
+# endif
+
+      /* Were we able to determine the stack top?  */
+      if (stack_top)
+        {
+          /* Determine stack bounds.  */
+          int saved_errno;
+          struct vma_struct vma;
+          int ret;
+
+          saved_errno = errno;
+          ret = sigsegv_get_vma (stack_top, &vma);
+          errno = saved_errno;
+          if (ret >= 0)
+            {
+# if HAVE_GETRLIMIT && defined RLIMIT_STACK
+              /* Heuristic BC: If the stack size has reached its maximal size,
+                 and old_sp is near the low end, we consider it a stack
+                 overflow.  */
+              struct rlimit rl;
+
+              saved_errno = errno;
+              ret = getrlimit (RLIMIT_STACK, &rl);
+              errno = saved_errno;
+              if (ret >= 0)
+                {
+                  uintptr_t current_stack_size = vma.end - vma.start;
+                  uintptr_t max_stack_size = rl.rlim_cur;
+                  if (current_stack_size <= max_stack_size + 4096
+                      && max_stack_size <= current_stack_size + 4096
+# else
+                {
+                  if (1
+# endif
+# ifdef SIGSEGV_FAULT_STACKPOINTER
+                      /* Heuristic BC: If we know old_sp, and it is neither
+                         near the low end, nor in the alternate stack, then
+                         it's probably not a stack overflow.  */
+                      && ((old_sp >= stk_extra_stack
+                           && old_sp <= stk_extra_stack + stk_extra_stack_size)
+#  if STACK_DIRECTION < 0
+                          || (old_sp <= vma.start + 4096
+                              && vma.start <= old_sp + 4096))
+#  else
+                          || (old_sp <= vma.end + 4096
+                              && vma.end <= old_sp + 4096))
+#  endif
+# endif
+                     )
+                    {
+# ifdef SIGSEGV_FAULT_STACKPOINTER
+                      int emergency =
+                        (old_sp >= stk_extra_stack
+                         && old_sp <= stk_extra_stack + stk_extra_stack_size);
+                      stackoverflow_context_t context = (SIGSEGV_FAULT_CONTEXT);
+# else
+                      int emergency = 0;
+                      stackoverflow_context_t context = (void *) 0;
+# endif
+                      /* Call user's handler.  */
+                      (*stk_user_handler)(emergency,context);
+                    }
+                }
+            }
+        }
+    }
+
+  /* Remove ourselves and dump core.  */
+  SIGSEGV_FOR_ALL_SIGNALS (sig, signal (sig, SIG_DFL);)
+}
+
+#endif
+
+
+#if HAVE_SIGSEGV_RECOVERY || HAVE_STACK_OVERFLOW_RECOVERY
+
+static void
+install_for (int sig)
+{
+  struct sigaction action;
+
+# ifdef SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+  action.sa_sigaction = &sigsegv_handler;
+# else
+  action.sa_handler = (void (*) (int)) &sigsegv_handler;
+# endif
+  /* Block most signals while SIGSEGV is being handled.  */
+  /* Signals SIGKILL, SIGSTOP cannot be blocked.  */
+  /* Signals SIGCONT, SIGTSTP, SIGTTIN, SIGTTOU are not blocked because
+     dealing with these signals seems dangerous.  */
+  /* Signals SIGILL, SIGABRT, SIGFPE, SIGSEGV, SIGTRAP, SIGIOT, SIGEMT, SIGBUS,
+     SIGSYS, SIGSTKFLT are not blocked because these are synchronous signals,
+     which may require immediate intervention, otherwise the process may
+     starve.  */
+  sigemptyset (&action.sa_mask);
+# ifdef SIGHUP
+  sigaddset (&action.sa_mask,SIGHUP);
+# endif
+# ifdef SIGINT
+  sigaddset (&action.sa_mask,SIGINT);
+# endif
+# ifdef SIGQUIT
+  sigaddset (&action.sa_mask,SIGQUIT);
+# endif
+# ifdef SIGPIPE
+  sigaddset (&action.sa_mask,SIGPIPE);
+# endif
+# ifdef SIGALRM
+  sigaddset (&action.sa_mask,SIGALRM);
+# endif
+# ifdef SIGTERM
+  sigaddset (&action.sa_mask,SIGTERM);
+# endif
+# ifdef SIGUSR1
+  sigaddset (&action.sa_mask,SIGUSR1);
+# endif
+# ifdef SIGUSR2
+  sigaddset (&action.sa_mask,SIGUSR2);
+# endif
+# ifdef SIGCHLD
+  sigaddset (&action.sa_mask,SIGCHLD);
+# endif
+# ifdef SIGCLD
+  sigaddset (&action.sa_mask,SIGCLD);
+# endif
+# ifdef SIGURG
+  sigaddset (&action.sa_mask,SIGURG);
+# endif
+# ifdef SIGIO
+  sigaddset (&action.sa_mask,SIGIO);
+# endif
+# ifdef SIGPOLL
+  sigaddset (&action.sa_mask,SIGPOLL);
+# endif
+# ifdef SIGXCPU
+  sigaddset (&action.sa_mask,SIGXCPU);
+# endif
+# ifdef SIGXFSZ
+  sigaddset (&action.sa_mask,SIGXFSZ);
+# endif
+# ifdef SIGVTALRM
+  sigaddset (&action.sa_mask,SIGVTALRM);
+# endif
+# ifdef SIGPROF
+  sigaddset (&action.sa_mask,SIGPROF);
+# endif
+# ifdef SIGPWR
+  sigaddset (&action.sa_mask,SIGPWR);
+# endif
+# ifdef SIGLOST
+  sigaddset (&action.sa_mask,SIGLOST);
+# endif
+# ifdef SIGWINCH
+  sigaddset (&action.sa_mask,SIGWINCH);
+# endif
+  /* Note that sigaction() implicitly adds sig itself to action.sa_mask.  */
+  /* Ask the OS to provide a structure siginfo_t to the handler.  */
+# ifdef SIGSEGV_FAULT_ADDRESS_FROM_SIGINFO
+  action.sa_flags = SA_SIGINFO;
+# else
+  action.sa_flags = 0;
+# endif
+# if HAVE_STACK_OVERFLOW_RECOVERY && HAVE_SIGALTSTACK /* not BeOS */
+  /* Work around Linux 2.2.5 bug: If SA_ONSTACK is specified but sigaltstack()
+     has not been called, the kernel will busy loop, eating CPU time.  So
+     avoid setting SA_ONSTACK until the user has requested stack overflow
+     handling.  */
+  if (stk_user_handler)
+    action.sa_flags |= SA_ONSTACK;
+# endif
+  sigaction (sig, &action, (struct sigaction *) NULL);
+}
+
+#endif /* HAVE_SIGSEGV_RECOVERY || HAVE_STACK_OVERFLOW_RECOVERY */
+
+int
+sigsegv_install_handler (sigsegv_handler_t handler)
+{
+#if HAVE_SIGSEGV_RECOVERY
+  user_handler = handler;
+
+  SIGSEGV_FOR_ALL_SIGNALS (sig, install_for (sig);)
+
+  return 0;
+#else
+  return -1;
+#endif
+}
+
+void
+sigsegv_deinstall_handler (void)
+{
+#if HAVE_SIGSEGV_RECOVERY
+  user_handler = (sigsegv_handler_t)NULL;
+
+# if HAVE_STACK_OVERFLOW_RECOVERY
+  if (!stk_user_handler)
+# endif
+    {
+      SIGSEGV_FOR_ALL_SIGNALS (sig, signal (sig, SIG_DFL);)
+    }
+#endif
+}
+
+int
+sigsegv_leave_handler (void (*continuation) (void*, void*, void*),
+                       void* cont_arg1, void* cont_arg2, void* cont_arg3)
+{
+#if HAVE_STACK_OVERFLOW_RECOVERY
+  /*
+   * Reset the system's knowledge that we are executing on the alternate
+   * stack. If we didn't do that, siglongjmp would be needed instead of
+   * longjmp to leave the signal handler.
+   */
+  sigsegv_reset_onstack_flag ();
+#endif
+  (*continuation) (cont_arg1, cont_arg2, cont_arg3);
+  return 1;
+}
+
+int
+stackoverflow_install_handler (stackoverflow_handler_t handler,
+                               void *extra_stack, size_t extra_stack_size)
+{
+#if HAVE_STACK_OVERFLOW_RECOVERY
+# if HAVE_STACKVMA
+  if (!stack_top)
+    {
+      int dummy;
+      remember_stack_top (&dummy);
+      if (!stack_top)
+        return -1;
+    }
+# endif
+
+  stk_user_handler = handler;
+  stk_extra_stack = (uintptr_t) extra_stack;
+  stk_extra_stack_size = extra_stack_size;
+  {
+    stack_t ss;
+# if SIGALTSTACK_SS_REVERSED
+    ss.ss_sp = (char *) extra_stack + extra_stack_size - sizeof (void *);
+    ss.ss_size = extra_stack_size - sizeof (void *);
+# else
+    ss.ss_sp = extra_stack;
+    ss.ss_size = extra_stack_size;
+# endif
+    ss.ss_flags = 0; /* no SS_DISABLE */
+    if (sigaltstack (&ss, (stack_t*)0) < 0)
+      return -1;
+  }
+
+  /* Install the signal handlers with SA_ONSTACK.  */
+  SIGSEGV_FOR_ALL_SIGNALS (sig, install_for (sig);)
+  return 0;
+#else
+  return -1;
+#endif
+}
+
+void
+stackoverflow_deinstall_handler (void)
+{
+#if HAVE_STACK_OVERFLOW_RECOVERY
+  stk_user_handler = (stackoverflow_handler_t) NULL;
+
+# if HAVE_SIGSEGV_RECOVERY
+  if (user_handler)
+    {
+      /* Reinstall the signal handlers without SA_ONSTACK, to avoid Linux
+         bug.  */
+      SIGSEGV_FOR_ALL_SIGNALS (sig, install_for (sig);)
+    }
+  else
+# endif
+    {
+      SIGSEGV_FOR_ALL_SIGNALS (sig, signal (sig, SIG_DFL);)
+    }
+
+  {
+    stack_t ss;
+    ss.ss_flags = SS_DISABLE;
+    if (sigaltstack (&ss, (stack_t *) 0) < 0)
+      perror ("gnulib sigsegv (stackoverflow_deinstall_handler)");
+  }
+#endif
+}
diff --git a/lib/sigsegv.in.h b/lib/sigsegv.in.h
new file mode 100644 (file)
index 0000000..5a55397
--- /dev/null
@@ -0,0 +1,242 @@
+/* Page fault handling library.
+   Copyright (C) 1998-2021  Bruno Haible <bruno@clisp.org>
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _SIGSEGV_H
+#define _SIGSEGV_H
+
+/* Get size_t.  */
+#include <stddef.h>
+
+/* Define the fault context structure.  */
+#if defined __linux__ || defined __ANDROID__ \
+    || (defined __FreeBSD__ && (defined __arm__ || defined __armhf__ || defined __arm64__)) \
+    || defined __NetBSD__ \
+    || defined _AIX || defined __sun \
+    || defined __CYGWIN__
+/* Linux, FreeBSD, NetBSD, AIX, Solaris, Cygwin */
+# include <ucontext.h>
+#elif (defined __APPLE__ && defined __MACH__)
+/* macOS */
+# include <sys/ucontext.h>
+#elif defined __HAIKU__
+/* Haiku */
+# include <signal.h>
+#endif
+
+/* Correct the value of SIGSTKSZ on some systems.
+   glibc >= 2.34: When _GNU_SOURCE is defined, SIGSTKSZ is no longer a
+   compile-time constant.  But most programs need a simple constant.
+   AIX 64-bit: original value 4096 is too small.
+   HP-UX: original value 8192 is too small.
+   Solaris 11/x86_64: original value 8192 is too small.  */
+#include <signal.h>
+#if __GLIBC__ >= 2
+# undef SIGSTKSZ
+# if defined __ia64__
+#  define SIGSTKSZ 262144
+# else
+#  define SIGSTKSZ 65536
+# endif
+#endif
+#if defined _AIX && defined _ARCH_PPC64
+# undef SIGSTKSZ
+# define SIGSTKSZ 8192
+#endif
+#if defined __hpux || (defined __sun && (defined __x86_64__ || defined __amd64__))
+# undef SIGSTKSZ
+# define SIGSTKSZ 16384
+#endif
+
+/* HAVE_SIGSEGV_RECOVERY
+   is defined if the system supports catching SIGSEGV.  */
+#if defined __linux__ || defined __ANDROID__ || defined __GNU__ \
+    || defined __FreeBSD_kernel__ || (defined __FreeBSD__ && !(defined __sparc__ || defined __sparc64__)) || defined __DragonFly__ \
+    || defined __NetBSD__ \
+    || defined __OpenBSD__ \
+    || (defined __APPLE__ && defined __MACH__) \
+    || defined _AIX || defined __sgi || defined __sun \
+    || defined __CYGWIN__ || defined __HAIKU__
+/* Linux, Hurd, GNU/kFreeBSD, FreeBSD, NetBSD, OpenBSD, macOS, AIX, IRIX, Solaris, Cygwin, Haiku */
+# define HAVE_SIGSEGV_RECOVERY 1
+#endif
+
+/* HAVE_STACK_OVERFLOW_RECOVERY
+   is defined if stack overflow can be caught.  */
+#if defined __linux__ || defined __ANDROID__ || defined __GNU__ \
+    || defined __FreeBSD_kernel__ || (defined __FreeBSD__ && !(defined __sparc__ || defined __sparc64__)) || defined __DragonFly__ \
+    || (defined __NetBSD__ && !(defined __sparc__ || defined __sparc64__)) \
+    || defined __OpenBSD__ \
+    || (defined __APPLE__ && defined __MACH__) \
+    || defined _AIX || defined __sgi || defined __sun \
+    || defined __CYGWIN__ || defined __HAIKU__
+/* Linux, Hurd, GNU/kFreeBSD, FreeBSD, NetBSD, OpenBSD, macOS, AIX, IRIX, Solaris, Cygwin, Haiku */
+# define HAVE_STACK_OVERFLOW_RECOVERY 1
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define LIBSIGSEGV_VERSION 0x020D    /* version number: (major<<8) + minor */
+extern int libsigsegv_version;       /* Likewise */
+
+/* -------------------------------------------------------------------------- */
+
+#if 1 /* really only HAVE_SIGSEGV_RECOVERY */
+
+/*
+ * The mask of bits that are set to zero in a fault address that gets passed
+ * to a global SIGSEGV handler.
+ * On some platforms, the precise fault address is not known, only the memory
+ * page into which the fault address falls. This is apparently allowed by POSIX:
+ * <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/signal.h.html>
+ * says: "For some implementations, the value of si_addr may be inaccurate."
+ * In this case, the returned fault address is rounded down to a multiple of
+ * getpagesize() = sysconf(_SC_PAGESIZE).
+ * On such platforms, we define SIGSEGV_FAULT_ADDRESS_ALIGNMENT to be an upper
+ * bound for getpagesize() (and, like getpagesize(), also a power of 2).
+ * On the platforms where the returned fault address is the precise one, we
+ * define SIGSEGV_FAULT_ADDRESS_ALIGNMENT to 1.
+ */
+# if defined __NetBSD__ && (defined __sparc__ || defined __sparc64__)
+  /* getpagesize () is 0x1000 or 0x2000, depending on hardware.  */
+#  define SIGSEGV_FAULT_ADDRESS_ALIGNMENT 0x2000UL
+# elif defined __linux__ && (defined __s390__ || defined __s390x__)
+  /* getpagesize () is 0x1000.  */
+#  define SIGSEGV_FAULT_ADDRESS_ALIGNMENT 0x1000UL
+# else
+#  define SIGSEGV_FAULT_ADDRESS_ALIGNMENT 1UL
+# endif
+
+/*
+ * The type of a global SIGSEGV handler.
+ * The fault address, with the bits (SIGSEGV_FAULT_ADDRESS_ALIGNMENT - 1)
+ * cleared, is passed as argument.
+ * The access type (read access or write access) is not passed; your handler
+ * has to know itself how to distinguish these two cases.
+ * The second argument is 0, meaning it could also be a stack overflow, or 1,
+ * meaning the handler should seriously try to fix the fault.
+ * The return value should be nonzero if the handler has done its job
+ * and no other handler should be called, or 0 if the handler declines
+ * responsibility for the given address.
+ *
+ * The handler is run at a moment when nothing about the global state of the
+ * program is known. Therefore it cannot use facilities that manipulate global
+ * variables or locks. In particular, it cannot use malloc(); use mmap()
+ * instead. It cannot use fopen(); use open() instead. Etc. All global
+ * variables that are accessed by the handler should be marked 'volatile'.
+ */
+typedef int (*sigsegv_handler_t) (void* fault_address, int serious);
+
+/*
+ * Installs a global SIGSEGV handler.
+ * This should be called once only, and it ignores any previously installed
+ * SIGSEGV handler.
+ * Returns 0 on success, or -1 if the system doesn't support catching SIGSEGV.
+ */
+extern int sigsegv_install_handler (sigsegv_handler_t handler);
+
+/*
+ * Deinstalls the global SIGSEGV handler.
+ * This goes back to the state where no SIGSEGV handler is installed.
+ */
+extern void sigsegv_deinstall_handler (void);
+
+/*
+ * Prepares leaving a SIGSEGV handler (through longjmp or similar means).
+ * Control is transferred by calling CONTINUATION with CONT_ARG1, CONT_ARG2,
+ * CONT_ARG3 as arguments.
+ * CONTINUATION must not return.
+ * The sigsegv_leave_handler function may return if called from a SIGSEGV
+ * handler; its return value should be used as the handler's return value.
+ * The sigsegv_leave_handler function does not return if called from a
+ * stack overflow handler.
+ */
+extern int sigsegv_leave_handler (void (*continuation) (void*, void*, void*), void* cont_arg1, void* cont_arg2, void* cont_arg3);
+
+#endif /* HAVE_SIGSEGV_RECOVERY */
+
+#if 1 /* really only HAVE_STACK_OVERFLOW_RECOVERY */
+
+/*
+ * The type of a context passed to a stack overflow handler.
+ * This type is system dependent; on some platforms it is an 'ucontext_t *',
+ * on some platforms it is a 'struct sigcontext *', on others merely an
+ * opaque 'void *'.
+ */
+# if defined __linux__ || defined __ANDROID__ \
+     || (defined __FreeBSD__ && (defined __arm__ || defined __armhf__ || defined __arm64__)) \
+     || defined __NetBSD__ \
+     || (defined __APPLE__ && defined __MACH__) \
+     || defined _AIX || defined __sun \
+     || defined __CYGWIN__ || defined __HAIKU__
+typedef ucontext_t *stackoverflow_context_t;
+# elif defined __GNU__ \
+       || defined __FreeBSD_kernel__ || (defined __FreeBSD__ && !(defined __sparc__ || defined __sparc64__)) \
+       || defined __OpenBSD__ || defined __sgi
+typedef struct sigcontext *stackoverflow_context_t;
+# else
+typedef void *stackoverflow_context_t;
+# endif
+
+/*
+ * The type of a stack overflow handler.
+ * Such a handler should perform a longjmp call in order to reduce the amount
+ * of stack needed. It must not return.
+ * The emergency argument is 0 when the stack could be repared, or 1 if the
+ * application should better save its state and exit now.
+ *
+ * The handler is run at a moment when nothing about the global state of the
+ * program is known. Therefore it cannot use facilities that manipulate global
+ * variables or locks. In particular, it cannot use malloc(); use mmap()
+ * instead. It cannot use fopen(); use open() instead. Etc. All global
+ * variables that are accessed by the handler should be marked 'volatile'.
+ */
+typedef void (*stackoverflow_handler_t) (int emergency, stackoverflow_context_t scp);
+
+/*
+ * Installs a stack overflow handler.
+ * The extra_stack argument is a pointer to a pre-allocated area used as a
+ * stack for executing the handler. It typically comes from a static variable
+ * or from heap-allocated memoty; placing it on the main stack may fail on
+ * some operating systems.
+ * Its size, passed in extra_stack_size, should be sufficiently large.  The
+ * following code determines an appropriate size:
+ *   #include <signal.h>
+ *   #ifndef SIGSTKSZ         / * glibc defines SIGSTKSZ for this purpose * /
+ *   # define SIGSTKSZ 16384  / * on most platforms, 16 KB are sufficient * /
+ *   #endif
+ * Returns 0 on success, or -1 if the system doesn't support catching stack
+ * overflow.
+ */
+extern int stackoverflow_install_handler (stackoverflow_handler_t handler,
+                                          void* extra_stack, size_t extra_stack_size);
+
+/*
+ * Deinstalls the stack overflow handler.
+ */
+extern void stackoverflow_deinstall_handler (void);
+
+#endif /* HAVE_STACK_OVERFLOW_RECOVERY */
+
+/* -------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _SIGSEGV_H */
index 2f2792c..16cfa09 100644 (file)
@@ -1,5 +1,5 @@
 /* size_max.h -- declare SIZE_MAX through system headers
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef GNULIB_SIZE_MAX_H
 #define GNULIB_SIZE_MAX_H
index 7cd89af..ac8f14a 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2006-2021 Free Software Foundation, Inc.
    Written by Simon Josefsson and Paul Eggert.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 87cebf7..cedd48a 100644 (file)
@@ -1,5 +1,5 @@
 /* Creation of subprocesses, communicating via pipes.
-   Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
+/* Tell clang not to warn about the 'child' variable, below.  */
+#if defined __clang__
+# pragma clang diagnostic ignored "-Wconditional-uninitialized"
+#endif
+
 #include <config.h>
 
 /* Specification.  */
 #include <signal.h>
 #include <unistd.h>
 
+#include "canonicalize.h"
 #include "error.h"
 #include "fatal-signal.h"
+#include "filename.h"
+#include "findprog.h"
 #include "unistd-safer.h"
 #include "wait-process.h"
+#include "xalloc.h"
 #include "gettext.h"
 
 #define _(str) gettext (str)
 
-#if (((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
-     || defined __KLIBC__)
+
+/* Choice of implementation for native Windows.
+   - Define to 0 to use the posix_spawn facility (modules 'posix_spawn' and
+     'posix_spawnp'), that is based on the module 'windows-spawn'.
+   - Define to 1 to use the older code, that uses the module 'windows-spawn'
+     directly.
+   You can set this macro from a Makefile or at configure time, from the
+   CPPFLAGS.  */
+#ifndef SPAWN_PIPE_IMPL_AVOID_POSIX_SPAWN
+# define SPAWN_PIPE_IMPL_AVOID_POSIX_SPAWN 0
+#endif
+
+
+#if (defined _WIN32 && !defined __CYGWIN__) && SPAWN_PIPE_IMPL_AVOID_POSIX_SPAWN
 
 /* Native Windows API.  */
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
+# include <process.h>
+# include "windows-spawn.h"
+
+#elif defined __KLIBC__
+
+/* OS/2 kLIBC API.  */
 # include <process.h>
-# include "w32spawn.h"
+# include "os2-spawn.h"
 
 #else
 
@@ -67,9 +99,10 @@ nonintr_close (int fd)
 
   return retval;
 }
+#undef close /* avoid warning related to gnulib module unistd */
 #define close nonintr_close
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if (defined _WIN32 && !defined __CYGWIN__) && SPAWN_PIPE_IMPL_AVOID_POSIX_SPAWN
 static int
 nonintr_open (const char *pathname, int oflag, mode_t mode)
 {
@@ -103,34 +136,81 @@ nonintr_open (const char *pathname, int oflag, mode_t mode)
  */
 static pid_t
 create_pipe (const char *progname,
-             const char *prog_path, char **prog_argv,
+             const char *prog_path,
+             const char * const *prog_argv,
+             const char *directory,
              bool pipe_stdin, bool pipe_stdout,
              const char *prog_stdin, const char *prog_stdout,
              bool null_stderr,
              bool slave_process, bool exit_on_error,
              int fd[2])
 {
-#if (((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
-     || defined __KLIBC__)
+  int saved_errno;
+  char *prog_path_to_free = NULL;
+
+  if (directory != NULL)
+    {
+      /* If a change of directory is requested, make sure PROG_PATH is absolute
+         before we do so.  This is needed because
+           - posix_spawn and posix_spawnp are required to resolve a relative
+             PROG_PATH *after* changing the directory.  See
+             <https://www.austingroupbugs.net/view.php?id=1208>:
+               "if this pathname does not start with a <slash> it shall be
+                interpreted relative to the working directory of the child
+                process _after_ all file_actions have been performed."
+             But this would be a surprising application behaviour, possibly
+             even security relevant.
+           - For the Windows CreateProcess() function, it is unspecified whether
+             a relative file name is interpreted to the parent's current
+             directory or to the specified directory.  See
+             <https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa>  */
+      if (! IS_ABSOLUTE_FILE_NAME (prog_path))
+        {
+          const char *resolved_prog =
+            find_in_given_path (prog_path, getenv ("PATH"), NULL, false);
+          if (resolved_prog == NULL)
+            goto fail_with_errno;
+          if (resolved_prog != prog_path)
+            prog_path_to_free = (char *) resolved_prog;
+          prog_path = resolved_prog;
+
+          if (! IS_ABSOLUTE_FILE_NAME (prog_path))
+            {
+              char *absolute_prog =
+                canonicalize_filename_mode (prog_path, CAN_MISSING | CAN_NOLINKS);
+              if (absolute_prog == NULL)
+                {
+                  free (prog_path_to_free);
+                  goto fail_with_errno;
+                }
+              free (prog_path_to_free);
+              prog_path_to_free = absolute_prog;
+              prog_path = absolute_prog;
+
+              if (! IS_ABSOLUTE_FILE_NAME (prog_path))
+                abort ();
+            }
+        }
+    }
+
+#if ((defined _WIN32 && !defined __CYGWIN__) && SPAWN_PIPE_IMPL_AVOID_POSIX_SPAWN) || defined __KLIBC__
 
   /* Native Windows API.
-     This uses _pipe(), dup2(), and spawnv().  It could also be implemented
+     This uses _pipe(), dup2(), and _spawnv().  It could also be implemented
      using the low-level functions CreatePipe(), DuplicateHandle(),
      CreateProcess() and _open_osfhandle(); see the GNU make and GNU clisp
      and cvs source code.  */
+  char *argv_mem_to_free;
   int ifd[2];
   int ofd[2];
-  int orig_stdin;
-  int orig_stdout;
-  int orig_stderr;
   int child;
   int nulloutfd;
   int stdinfd;
   int stdoutfd;
-  int saved_errno;
 
-  /* FIXME: Need to free memory allocated by prepare_spawn.  */
-  prog_argv = prepare_spawn (prog_argv);
+  const char **argv = prepare_spawn (prog_argv, &argv_mem_to_free);
+  if (argv == NULL)
+    xalloc_die ();
 
   if (pipe_stdout)
     if (pipe2_safer (ifd, O_BINARY | O_CLOEXEC) < 0)
@@ -147,6 +227,130 @@ create_pipe (const char *progname,
  *
  */
 
+  child = -1;
+
+# if (defined _WIN32 && !defined __CYGWIN__) && SPAWN_PIPE_IMPL_AVOID_POSIX_SPAWN
+  bool must_close_ifd1 = pipe_stdout;
+  bool must_close_ofd0 = pipe_stdin;
+
+  /* Create standard file handles of child process.  */
+  HANDLE stdin_handle = INVALID_HANDLE_VALUE;
+  HANDLE stdout_handle = INVALID_HANDLE_VALUE;
+  nulloutfd = -1;
+  stdinfd = -1;
+  stdoutfd = -1;
+  if ((!null_stderr
+       || (nulloutfd = open ("NUL", O_RDWR, 0)) >= 0)
+      && (pipe_stdin
+          || prog_stdin == NULL
+          || (stdinfd = open (prog_stdin, O_RDONLY, 0)) >= 0)
+      && (pipe_stdout
+          || prog_stdout == NULL
+          || (stdoutfd = open (prog_stdout, O_WRONLY, 0)) >= 0))
+    /* The child process doesn't inherit ifd[0], ifd[1], ofd[0], ofd[1],
+       but it inherits the three STD*_FILENO for which we pass the handles.  */
+    /* Pass the environment explicitly.  This is needed if the program has
+       modified the environment using putenv() or [un]setenv().  On Windows,
+       processes have two environments, one in the "environment block" of the
+       process and managed through SetEnvironmentVariable(), and one inside the
+       process, in the location retrieved by the 'environ' macro.  If we were
+       to pass NULL, the child process would inherit a copy of the environment
+       block - ignoring the effects of putenv() and [un]setenv().  */
+    {
+      stdin_handle =
+        (HANDLE) _get_osfhandle (pipe_stdin ? ofd[0] :
+                                 prog_stdin == NULL ? STDIN_FILENO : stdinfd);
+      if (pipe_stdin)
+        {
+          HANDLE curr_process = GetCurrentProcess ();
+          HANDLE duplicate;
+          if (!DuplicateHandle (curr_process, stdin_handle,
+                                curr_process, &duplicate,
+                                0, TRUE, DUPLICATE_SAME_ACCESS))
+            {
+              errno = EBADF; /* arbitrary */
+              goto failed;
+            }
+          must_close_ofd0 = false;
+          close (ofd[0]); /* implies CloseHandle (stdin_handle); */
+          stdin_handle = duplicate;
+        }
+      stdout_handle =
+        (HANDLE) _get_osfhandle (pipe_stdout ? ifd[1] :
+                                 prog_stdout == NULL ? STDOUT_FILENO : stdoutfd);
+      if (pipe_stdout)
+        {
+          HANDLE curr_process = GetCurrentProcess ();
+          HANDLE duplicate;
+          if (!DuplicateHandle (curr_process, stdout_handle,
+                                curr_process, &duplicate,
+                                0, TRUE, DUPLICATE_SAME_ACCESS))
+            {
+              errno = EBADF; /* arbitrary */
+              goto failed;
+            }
+          must_close_ifd1 = false;
+          close (ifd[1]); /* implies CloseHandle (stdout_handle); */
+          stdout_handle = duplicate;
+        }
+      HANDLE stderr_handle =
+        (HANDLE) _get_osfhandle (null_stderr ? nulloutfd : STDERR_FILENO);
+
+      child = spawnpvech (P_NOWAIT, prog_path, argv + 1,
+                          (const char * const *) environ, directory,
+                          stdin_handle, stdout_handle, stderr_handle);
+#  if 0 /* Executing arbitrary files as shell scripts is unsecure.  */
+      if (child == -1 && errno == ENOEXEC)
+        {
+          /* prog is not a native executable.  Try to execute it as a
+             shell script.  Note that prepare_spawn() has already prepended
+             a hidden element "sh.exe" to argv.  */
+          argv[1] = prog_path;
+          child = spawnpvech (P_NOWAIT, argv[0], argv,
+                              (const char * const *) environ, directory,
+                              stdin_handle, stdout_handle, stderr_handle);
+        }
+#  endif
+    }
+ failed:
+  if (child == -1)
+    saved_errno = errno;
+  if (stdinfd >= 0)
+    close (stdinfd);
+  if (stdoutfd >= 0)
+    close (stdoutfd);
+  if (nulloutfd >= 0)
+    close (nulloutfd);
+
+  if (pipe_stdin)
+    {
+      if (must_close_ofd0)
+        close (ofd[0]);
+      else
+        if (stdin_handle != INVALID_HANDLE_VALUE)
+          CloseHandle (stdin_handle);
+    }
+  if (pipe_stdout)
+    {
+      if (must_close_ifd1)
+        close (ifd[1]);
+      else
+        if (stdout_handle != INVALID_HANDLE_VALUE)
+          CloseHandle (stdout_handle);
+    }
+
+# else /* __KLIBC__ */
+  if (!(directory == NULL || strcmp (directory, ".") == 0))
+    {
+      /* A directory argument is not supported in this implementation.  */
+      saved_errno = EINVAL;
+      goto fail_with_saved_errno;
+    }
+
+  int orig_stdin;
+  int orig_stdout;
+  int orig_stderr;
+
   /* Save standard file handles of parent process.  */
   if (pipe_stdin || prog_stdin != NULL)
     orig_stdin = dup_safer_noinherit (STDIN_FILENO);
@@ -154,7 +358,6 @@ create_pipe (const char *progname,
     orig_stdout = dup_safer_noinherit (STDOUT_FILENO);
   if (null_stderr)
     orig_stderr = dup_safer_noinherit (STDERR_FILENO);
-  child = -1;
 
   /* Create standard file handles of child process.  */
   nulloutfd = -1;
@@ -182,26 +385,19 @@ create_pipe (const char *progname,
     /* The child process doesn't inherit ifd[0], ifd[1], ofd[0], ofd[1],
        but it inherits all open()ed or dup2()ed file handles (which is what
        we want in the case of STD*_FILENO).  */
-    /* Use spawnvpe and pass the environment explicitly.  This is needed if
-       the program has modified the environment using putenv() or [un]setenv().
-       On Windows, programs have two environments, one in the "environment
-       block" of the process and managed through SetEnvironmentVariable(), and
-       one inside the process, in the location retrieved by the 'environ'
-       macro.  When using spawnvp() without 'e', the child process inherits a
-       copy of the environment block - ignoring the effects of putenv() and
-       [un]setenv().  */
     {
-      child = spawnvpe (P_NOWAIT, prog_path, (const char **) prog_argv,
-                        (const char **) environ);
-      if (child < 0 && errno == ENOEXEC)
+      child = _spawnvpe (P_NOWAIT, prog_path, argv + 1,
+                         (const char **) environ);
+#  if 0 /* Executing arbitrary files as shell scripts is unsecure.  */
+      if (child == -1 && errno == ENOEXEC)
         {
           /* prog is not a native executable.  Try to execute it as a
              shell script.  Note that prepare_spawn() has already prepended
-             a hidden element "sh.exe" to prog_argv.  */
-          --prog_argv;
-          child = spawnvpe (P_NOWAIT, prog_argv[0], (const char **) prog_argv,
-                            (const char **) environ);
+             a hidden element "sh.exe" to argv.  */
+          child = _spawnvpe (P_NOWAIT, argv[0], argv,
+                             (const char **) environ);
         }
+#  endif
     }
   if (child == -1)
     saved_errno = errno;
@@ -224,17 +420,19 @@ create_pipe (const char *progname,
     close (ofd[0]);
   if (pipe_stdout)
     close (ifd[1]);
+# endif
+
+  free (argv);
+  free (argv_mem_to_free);
+  free (prog_path_to_free);
+
   if (child == -1)
     {
-      if (exit_on_error || !null_stderr)
-        error (exit_on_error ? EXIT_FAILURE : 0, saved_errno,
-               _("%s subprocess failed"), progname);
       if (pipe_stdout)
         close (ifd[0]);
       if (pipe_stdin)
         close (ofd[1]);
-      errno = saved_errno;
-      return -1;
+      goto fail_with_saved_errno;
     }
 
   if (pipe_stdout)
@@ -320,18 +518,33 @@ create_pipe (const char *progname,
                                                           prog_stdout, O_WRONLY,
                                                           0))
                  != 0)
+          || (directory != NULL
+              && (err = posix_spawn_file_actions_addchdir (&actions,
+                                                           directory)))
           || (slave_process
               && ((err = posix_spawnattr_init (&attrs)) != 0
                   || (attrs_allocated = true,
+# if defined _WIN32 && !defined __CYGWIN__
+                      (err = posix_spawnattr_setpgroup (&attrs, 0)) != 0
+                      || (err = posix_spawnattr_setflags (&attrs,
+                                                         POSIX_SPAWN_SETPGROUP))
+                         != 0
+# else
                       (err = posix_spawnattr_setsigmask (&attrs,
                                                          &blocked_signals))
                       != 0
                       || (err = posix_spawnattr_setflags (&attrs,
                                                         POSIX_SPAWN_SETSIGMASK))
-                         != 0)))
-          || (err = posix_spawnp (&child, prog_path, &actions,
-                                  attrs_allocated ? &attrs : NULL, prog_argv,
-                                  environ))
+                         != 0
+# endif
+             )   )   )
+          || (err = (directory != NULL
+                     ? posix_spawn (&child, prog_path, &actions,
+                                    attrs_allocated ? &attrs : NULL,
+                                    (char * const *) prog_argv, environ)
+                     : posix_spawnp (&child, prog_path, &actions,
+                                     attrs_allocated ? &attrs : NULL,
+                                     (char * const *) prog_argv, environ)))
              != 0))
     {
       if (actions_allocated)
@@ -340,9 +553,6 @@ create_pipe (const char *progname,
         posix_spawnattr_destroy (&attrs);
       if (slave_process)
         unblock_fatal_signals ();
-      if (exit_on_error || !null_stderr)
-        error (exit_on_error ? EXIT_FAILURE : 0, err,
-               _("%s subprocess failed"), progname);
       if (pipe_stdout)
         {
           close (ifd[0]);
@@ -353,8 +563,9 @@ create_pipe (const char *progname,
           close (ofd[0]);
           close (ofd[1]);
         }
-      errno = err;
-      return -1;
+      free (prog_path_to_free);
+      saved_errno = err;
+      goto fail_with_saved_errno;
     }
   posix_spawn_file_actions_destroy (&actions);
   if (attrs_allocated)
@@ -368,6 +579,7 @@ create_pipe (const char *progname,
     close (ofd[0]);
   if (pipe_stdout)
     close (ifd[1]);
+  free (prog_path_to_free);
 
   if (pipe_stdout)
     fd[0] = ifd[0];
@@ -376,6 +588,15 @@ create_pipe (const char *progname,
   return child;
 
 #endif
+
+ fail_with_errno:
+  saved_errno = errno;
+ fail_with_saved_errno:
+  if (exit_on_error || !null_stderr)
+    error (exit_on_error ? EXIT_FAILURE : 0, saved_errno,
+           _("%s subprocess failed"), progname);
+  errno = saved_errno;
+  return -1;
 }
 
 /* Open a bidirectional pipe.
@@ -388,12 +609,13 @@ create_pipe (const char *progname,
  */
 pid_t
 create_pipe_bidi (const char *progname,
-                  const char *prog_path, char **prog_argv,
+                  const char *prog_path, const char * const *prog_argv,
+                  const char *directory,
                   bool null_stderr,
                   bool slave_process, bool exit_on_error,
                   int fd[2])
 {
-  pid_t result = create_pipe (progname, prog_path, prog_argv,
+  pid_t result = create_pipe (progname, prog_path, prog_argv, directory,
                               true, true, NULL, NULL,
                               null_stderr, slave_process, exit_on_error,
                               fd);
@@ -409,13 +631,14 @@ create_pipe_bidi (const char *progname,
  */
 pid_t
 create_pipe_in (const char *progname,
-                const char *prog_path, char **prog_argv,
+                const char *prog_path, const char * const *prog_argv,
+                const char *directory,
                 const char *prog_stdin, bool null_stderr,
                 bool slave_process, bool exit_on_error,
                 int fd[1])
 {
   int iofd[2];
-  pid_t result = create_pipe (progname, prog_path, prog_argv,
+  pid_t result = create_pipe (progname, prog_path, prog_argv, directory,
                               false, true, prog_stdin, NULL,
                               null_stderr, slave_process, exit_on_error,
                               iofd);
@@ -433,13 +656,14 @@ create_pipe_in (const char *progname,
  */
 pid_t
 create_pipe_out (const char *progname,
-                 const char *prog_path, char **prog_argv,
+                 const char *prog_path, const char * const *prog_argv,
+                 const char *directory,
                  const char *prog_stdout, bool null_stderr,
                  bool slave_process, bool exit_on_error,
                  int fd[1])
 {
   int iofd[2];
-  pid_t result = create_pipe (progname, prog_path, prog_argv,
+  pid_t result = create_pipe (progname, prog_path, prog_argv, directory,
                               true, false, NULL, prog_stdout,
                               null_stderr, slave_process, exit_on_error,
                               iofd);
index 96e7beb..e3b6e04 100644 (file)
@@ -1,5 +1,5 @@
 /* Creation of subprocesses, communicating via pipes.
-   Copyright (C) 2001-2003, 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2006, 2008-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _SPAWN_PIPE_H
 #define _SPAWN_PIPE_H
@@ -42,6 +42,19 @@ extern "C" {
    After finishing communication, the caller should call wait_subprocess()
    to get rid of the subprocess in the process table.
 
+   progname is the name of the program to be executed by the subprocess, used
+   for error messages.
+   prog_path is the file name of the program to be executed by the subprocess.
+   If it contains no slashes, a search is conducted in $PATH.  An operating
+   system dependent suffix is added, if necessary.
+   prog_argv is the array of strings that the subprocess shall receive in
+   argv[].  It is a NULL-terminated array.  prog_argv[0] should normally be
+   identical to prog_path.
+
+   If directory is not NULL, the subprocess is started in that directory.  If
+   prog_path is a relative file name, it resolved before changing to that
+   directory.  The current directory of the current process remains unchanged.
+
    If slave_process is true, the child process will be terminated when its
    creator receives a catchable fatal signal or exits normally.  If
    slave_process is false, the child process will continue running in this
@@ -83,7 +96,9 @@ extern "C" {
  * signal and the EPIPE error code.
  */
 extern pid_t create_pipe_out (const char *progname,
-                              const char *prog_path, char **prog_argv,
+                              const char *prog_path,
+                              const char * const *prog_argv,
+                              const char *directory,
                               const char *prog_stdout, bool null_stderr,
                               bool slave_process, bool exit_on_error,
                               int fd[1]);
@@ -96,7 +111,9 @@ extern pid_t create_pipe_out (const char *progname,
  *
  */
 extern pid_t create_pipe_in (const char *progname,
-                             const char *prog_path, char **prog_argv,
+                             const char *prog_path,
+                             const char * const *prog_argv,
+                             const char *directory,
                              const char *prog_stdin, bool null_stderr,
                              bool slave_process, bool exit_on_error,
                              int fd[1]);
@@ -124,13 +141,15 @@ extern pid_t create_pipe_in (const char *progname,
  *    input.  But you are currently busy reading from it.
  */
 extern pid_t create_pipe_bidi (const char *progname,
-                               const char *prog_path, char **prog_argv,
+                               const char *prog_path,
+                               const char * const *prog_argv,
+                               const char *directory,
                                bool null_stderr,
                                bool slave_process, bool exit_on_error,
                                int fd[2]);
 
 /* The name of the "always silent" device.  */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Native Windows API.  */
 # define DEV_NULL "NUL"
 #else
diff --git a/lib/spawn.c b/lib/spawn.c
new file mode 100644 (file)
index 0000000..75afbbc
--- /dev/null
@@ -0,0 +1,34 @@
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <spawn.h>
+
+#include "spawn_int.h"
+
+/* Spawn a new process executing PATH with the attributes describes in *ATTRP.
+   Before running the process perform the actions described in FILE-ACTIONS. */
+int
+posix_spawn (pid_t *pid, const char *path,
+             const posix_spawn_file_actions_t *file_actions,
+             const posix_spawnattr_t *attrp, char *const argv[],
+             char *const envp[])
+{
+  return __spawni (pid, path, file_actions, attrp,
+                   (const char * const *) argv, (const char * const *) envp, 0);
+}
index 2f55098..35e78e6 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions for POSIX spawn interface.
-   Copyright (C) 2000, 2003-2004, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000, 2003-2004, 2008-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef _@GUARD_PREFIX@_SPAWN_H
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 @PRAGMA_COLUMNS@
 
+#if defined _GL_ALREADY_INCLUDING_SPAWN_H
+/* Special invocation convention:
+   On OS/2 kLIBC, <spawn.h> includes <signal.h>. Then <signal.h> ->
+   <pthread.h> -> <sched.h> -> <spawn.h> are included by GNULIB.
+   In this situation, struct sched_param is not yet defined.  */
+
+#@INCLUDE_NEXT@ @NEXT_SPAWN_H@
+
+#else
+
+#ifndef _@GUARD_PREFIX@_SPAWN_H
+/* Normal invocation convention.  */
+
 /* The include_next requires a split double-inclusion guard.  */
 #if @HAVE_SPAWN_H@
+
+# define _GL_ALREADY_INCLUDING_SPAWN_H
+
 # @INCLUDE_NEXT@ @NEXT_SPAWN_H@
+
+# define _GL_ALREADY_INCLUDING_SPAWN_H
+
 #endif
 
 #ifndef _@GUARD_PREFIX@_SPAWN_H
 # define __THROW
 #endif
 
-/* GCC 2.95 and later have "__restrict"; C99 compilers have
+/* For plain 'restrict', use glibc's __restrict if defined.
+   Otherwise, GCC 2.95 and later have "__restrict"; C99 compilers have
    "restrict", and "configure" may have defined "restrict".
    Other compilers use __restrict, __restrict__, and _Restrict, and
    'configure' might #define 'restrict' to those words, so pick a
    different name.  */
 #ifndef _Restrict_
-# if 199901L <= __STDC_VERSION__
-#  define _Restrict_ restrict
-# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
+# if defined __restrict \
+     || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
+     || __clang_major__ >= 3
 #  define _Restrict_ __restrict
+# elif 199901L <= __STDC_VERSION__ || defined restrict
+#  define _Restrict_ restrict
 # else
 #  define _Restrict_
 # endif
 #endif
-/* gcc 3.1 and up support the [restrict] syntax.  Don't trust
-   sys/cdefs.h's definition of __restrict_arr, though, as it
-   mishandles gcc -ansi -pedantic.  */
+/* For the ISO C99 syntax
+     array_name[restrict]
+   use glibc's __restrict_arr if available.
+   Otherwise, GCC 3.1 and clang support this syntax (but not in C++ mode).
+   Other ISO C99 compilers support it as well.  */
 #ifndef _Restrict_arr_
-# if ((199901L <= __STDC_VERSION__                                      \
-       || ((3 < __GNUC__ || (3 == __GNUC__ && 1 <= __GNUC_MINOR__))     \
-           && !defined __STRICT_ANSI__))                                        \
-      && !defined __GNUG__)
+# ifdef __restrict_arr
+#  define _Restrict_arr_ __restrict_arr
+# elif ((199901L <= __STDC_VERSION__ \
+         || 3 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+         || __clang_major__ >= 3) \
+        && !defined __cplusplus)
 #  define _Restrict_arr_ _Restrict_
 # else
 #  define _Restrict_arr_
 
 
 /* Data structure to contain attributes for thread creation.  */
-#if @REPLACE_POSIX_SPAWN@
+#if @REPLACE_POSIX_SPAWN@ || (@HAVE_POSIX_SPAWNATTR_T@ && !@HAVE_POSIX_SPAWN@)
 # define posix_spawnattr_t rpl_posix_spawnattr_t
 #endif
-#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@
+#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@ || !@HAVE_POSIX_SPAWN@
 # if !GNULIB_defined_posix_spawnattr_t
 typedef struct
 {
@@ -101,10 +125,10 @@ typedef struct
 
 /* Data structure to contain information about the actions to be
    performed in the new process with respect to file descriptors.  */
-#if @REPLACE_POSIX_SPAWN@
+#if @REPLACE_POSIX_SPAWN@ || (@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ && !@HAVE_POSIX_SPAWN@)
 # define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
 #endif
-#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
+#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@ || !@HAVE_POSIX_SPAWN@
 # if !GNULIB_defined_posix_spawn_file_actions_t
 typedef struct
 {
@@ -142,7 +166,8 @@ typedef struct
 # endif
 #endif
 /* A GNU extension.  Use the next free bit position.  */
-#define POSIX_SPAWN_USEVFORK \
+#ifndef POSIX_SPAWN_USEVFORK
+# define POSIX_SPAWN_USEVFORK \
   ((POSIX_SPAWN_RESETIDS | (POSIX_SPAWN_RESETIDS - 1)                     \
     | POSIX_SPAWN_SETPGROUP | (POSIX_SPAWN_SETPGROUP - 1)                 \
     | POSIX_SPAWN_SETSIGDEF | (POSIX_SPAWN_SETSIGDEF - 1)                 \
@@ -152,6 +177,7 @@ typedef struct
     | POSIX_SPAWN_SETSCHEDULER                                            \
     | (POSIX_SPAWN_SETSCHEDULER > 0 ? POSIX_SPAWN_SETSCHEDULER - 1 : 0))  \
    + 1)
+#endif
 #if !GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap
 typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
             [(((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
@@ -602,7 +628,9 @@ _GL_CXXALIAS_SYS (posix_spawnattr_getschedpolicy, int,
                   (const posix_spawnattr_t *_Restrict_ __attr,
                    int *_Restrict_ __schedpolicy));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawnattr_getschedpolicy);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawnattr_getschedpolicy
 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY
@@ -632,7 +660,9 @@ _GL_FUNCDECL_SYS (posix_spawnattr_setschedpolicy, int,
 _GL_CXXALIAS_SYS (posix_spawnattr_setschedpolicy, int,
                   (posix_spawnattr_t *__attr, int __schedpolicy));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawnattr_setschedpolicy);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawnattr_setschedpolicy
 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY
@@ -666,7 +696,9 @@ _GL_CXXALIAS_SYS (posix_spawnattr_getschedparam, int,
                   (const posix_spawnattr_t *_Restrict_ __attr,
                    struct sched_param *_Restrict_ __schedparam));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawnattr_getschedparam);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawnattr_getschedparam
 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM
@@ -700,7 +732,9 @@ _GL_CXXALIAS_SYS (posix_spawnattr_setschedparam, int,
                   (posix_spawnattr_t *_Restrict_ __attr,
                    const struct sched_param *_Restrict_ __schedparam));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawnattr_setschedparam);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawnattr_setschedparam
 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM
@@ -800,7 +834,9 @@ _GL_CXXALIAS_SYS (posix_spawn_file_actions_addopen, int,
                    int __fd,
                    const char *_Restrict_ __path, int __oflag, mode_t __mode));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawn_file_actions_addopen);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawn_file_actions_addopen
 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
@@ -831,7 +867,9 @@ _GL_FUNCDECL_SYS (posix_spawn_file_actions_addclose, int,
 _GL_CXXALIAS_SYS (posix_spawn_file_actions_addclose, int,
                   (posix_spawn_file_actions_t *__file_actions, int __fd));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawn_file_actions_addclose);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawn_file_actions_addclose
 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
@@ -866,7 +904,9 @@ _GL_CXXALIAS_SYS (posix_spawn_file_actions_adddup2, int,
                   (posix_spawn_file_actions_t *__file_actions,
                    int __fd, int __newfd));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawn_file_actions_adddup2);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawn_file_actions_adddup2
 # if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
@@ -876,6 +916,77 @@ _GL_WARN_ON_USE (posix_spawn_file_actions_adddup2,
 # endif
 #endif
 
+#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+/* Add an action to FILE-ACTIONS which tells the implementation to call
+   'chdir' to the given directory during the 'spawn' call.  */
+# if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define posix_spawn_file_actions_addchdir rpl_posix_spawn_file_actions_addchdir
+#  endif
+_GL_FUNCDECL_RPL (posix_spawn_file_actions_addchdir, int,
+                  (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+                   const char *_Restrict_ __path)
+                  __THROW _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (posix_spawn_file_actions_addchdir, int,
+                  (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+                   const char *_Restrict_ __path));
+# else
+#  if !@HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+_GL_FUNCDECL_SYS (posix_spawn_file_actions_addchdir, int,
+                  (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+                   const char *_Restrict_ __path)
+                  __THROW _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (posix_spawn_file_actions_addchdir, int,
+                  (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+                   const char *_Restrict_ __path));
+# endif
+_GL_CXXALIASWARN (posix_spawn_file_actions_addchdir);
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawn_file_actions_addchdir
+# if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
+_GL_WARN_ON_USE (posix_spawn_file_actions_addchdir,
+                 "posix_spawn_file_actions_addchdir is unportable - "
+                 "use gnulib module posix_spawn_file_actions_addchdir for portability");
+# endif
+#endif
+
+#if @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+/* Add an action to FILE-ACTIONS which tells the implementation to call
+   'fchdir' to the given directory during the 'spawn' call.  */
+# if @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define posix_spawn_file_actions_addfchdir rpl_posix_spawn_file_actions_addfchdir
+#  endif
+_GL_FUNCDECL_RPL (posix_spawn_file_actions_addfchdir, int,
+                  (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+                   int __fd)
+                  __THROW _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (posix_spawn_file_actions_addfchdir, int,
+                  (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+                   int __fd));
+# else
+#  if !@HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+_GL_FUNCDECL_SYS (posix_spawn_file_actions_addfchdir, int,
+                  (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+                   int __fd)
+                  __THROW _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (posix_spawn_file_actions_addfchdir, int,
+                  (posix_spawn_file_actions_t *_Restrict_ __file_actions,
+                   int __fd));
+# endif
+_GL_CXXALIASWARN (posix_spawn_file_actions_addfchdir);
+#elif defined GNULIB_POSIXCHECK
+# undef posix_spawn_file_actions_addfchdir
+# if HAVE_RAW_DECL_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
+_GL_WARN_ON_USE (posix_spawn_file_actions_addfchdir,
+                 "posix_spawn_file_actions_addfchdir is unportable - "
+                 "use gnulib module posix_spawn_file_actions_addfchdir for portability");
+# endif
+#endif
+
 
 #endif /* _@GUARD_PREFIX@_SPAWN_H */
 #endif /* _@GUARD_PREFIX@_SPAWN_H */
+#endif
diff --git a/lib/spawn_faction_addchdir.c b/lib/spawn_faction_addchdir.c
new file mode 100644 (file)
index 0000000..c8afecc
--- /dev/null
@@ -0,0 +1,70 @@
+/* Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <spawn.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if REPLACE_POSIX_SPAWN
+# include "spawn_int.h"
+#endif
+
+/* Add an action to FILE-ACTIONS which tells the implementation to call
+   'chdir' to the given directory during the 'spawn' call.  */
+int
+posix_spawn_file_actions_addchdir (posix_spawn_file_actions_t *file_actions,
+                                   const char *path)
+#undef posix_spawn_file_actions_addchdir
+{
+#if !REPLACE_POSIX_SPAWN
+  return posix_spawn_file_actions_addchdir_np (file_actions, path);
+#else
+  {
+    /* Copy PATH, because the caller may free it before calling posix_spawn()
+       or posix_spawnp().  */
+    char *path_copy = strdup (path);
+    if (path_copy == NULL)
+      return ENOMEM;
+
+    /* Allocate more memory if needed.  */
+    if (file_actions->_used == file_actions->_allocated
+        && __posix_spawn_file_actions_realloc (file_actions) != 0)
+      {
+        /* This can only mean we ran out of memory.  */
+        free (path_copy);
+        return ENOMEM;
+      }
+
+    {
+      struct __spawn_action *rec;
+
+      /* Add the new value.  */
+      rec = &file_actions->_actions[file_actions->_used];
+      rec->tag = spawn_do_chdir;
+      rec->action.chdir_action.path = path_copy;
+
+      /* Account for the new entry.  */
+      ++file_actions->_used;
+
+      return 0;
+    }
+  }
+#endif
+}
index 05449f3..3535540 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -26,7 +26,7 @@
 # define __sysconf(open_max) getdtablesize ()
 #endif
 
-#if !HAVE_WORKING_POSIX_SPAWN
+#if REPLACE_POSIX_SPAWN
 # include "spawn_int.h"
 #endif
 
@@ -43,7 +43,7 @@ posix_spawn_file_actions_addclose (posix_spawn_file_actions_t *file_actions,
   if (fd < 0 || fd >= maxfd)
     return EBADF;
 
-#if HAVE_WORKING_POSIX_SPAWN
+#if !REPLACE_POSIX_SPAWN
   return posix_spawn_file_actions_addclose (file_actions, fd);
 #else
   /* Allocate more memory if needed.  */
index a2b325e..e98a7ec 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -26,7 +26,7 @@
 # define __sysconf(open_max) getdtablesize ()
 #endif
 
-#if !HAVE_WORKING_POSIX_SPAWN
+#if REPLACE_POSIX_SPAWN
 # include "spawn_int.h"
 #endif
 
@@ -43,7 +43,7 @@ posix_spawn_file_actions_adddup2 (posix_spawn_file_actions_t *file_actions,
   if (fd < 0 || newfd < 0 || fd >= maxfd || newfd >= maxfd)
     return EBADF;
 
-#if HAVE_WORKING_POSIX_SPAWN
+#if !REPLACE_POSIX_SPAWN
   return posix_spawn_file_actions_adddup2 (file_actions, fd, newfd);
 #else
   /* Allocate more memory if needed.  */
index a29dd71..7cde33f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include <spawn.h>
 
 #include <errno.h>
+#include <stdlib.h>
+#include <string.h>
 #include <unistd.h>
 
 #if !_LIBC
 # define __sysconf(open_max) getdtablesize ()
 #endif
 
-#if !HAVE_WORKING_POSIX_SPAWN
+#if REPLACE_POSIX_SPAWN
 # include "spawn_int.h"
 #endif
 
@@ -44,30 +46,41 @@ posix_spawn_file_actions_addopen (posix_spawn_file_actions_t *file_actions,
   if (fd < 0 || fd >= maxfd)
     return EBADF;
 
-#if HAVE_WORKING_POSIX_SPAWN
+#if !REPLACE_POSIX_SPAWN
   return posix_spawn_file_actions_addopen (file_actions, fd, path, oflag, mode);
 #else
-  /* Allocate more memory if needed.  */
-  if (file_actions->_used == file_actions->_allocated
-      && __posix_spawn_file_actions_realloc (file_actions) != 0)
-    /* This can only mean we ran out of memory.  */
-    return ENOMEM;
-
   {
-    struct __spawn_action *rec;
+    /* Copy PATH, because the caller may free it before calling posix_spawn()
+       or posix_spawnp().  */
+    char *path_copy = strdup (path);
+    if (path_copy == NULL)
+      return ENOMEM;
+
+    /* Allocate more memory if needed.  */
+    if (file_actions->_used == file_actions->_allocated
+        && __posix_spawn_file_actions_realloc (file_actions) != 0)
+      {
+        /* This can only mean we ran out of memory.  */
+        free (path_copy);
+        return ENOMEM;
+      }
+
+    {
+      struct __spawn_action *rec;
 
-    /* Add the new value.  */
-    rec = &file_actions->_actions[file_actions->_used];
-    rec->tag = spawn_do_open;
-    rec->action.open_action.fd = fd;
-    rec->action.open_action.path = path;
-    rec->action.open_action.oflag = oflag;
-    rec->action.open_action.mode = mode;
+      /* Add the new value.  */
+      rec = &file_actions->_actions[file_actions->_used];
+      rec->tag = spawn_do_open;
+      rec->action.open_action.fd = fd;
+      rec->action.open_action.path = path_copy;
+      rec->action.open_action.oflag = oflag;
+      rec->action.open_action.mode = mode;
 
-    /* Account for the new entry.  */
-    ++file_actions->_used;
+      /* Account for the new entry.  */
+      ++file_actions->_used;
 
-    return 0;
+      return 0;
+    }
   }
 #endif
 }
index 642beb3..65bc7bf 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 
 #include <stdlib.h>
 
+#if REPLACE_POSIX_SPAWN
+# include "spawn_int.h"
+#endif
+
 /* Initialize data structure for file attribute for 'spawn' call.  */
 int
 posix_spawn_file_actions_destroy (posix_spawn_file_actions_t *file_actions)
+#undef posix_spawn_file_actions_destroy
 {
-  /* Free the memory allocated.  */
+#if !REPLACE_POSIX_SPAWN
+  return posix_spawn_file_actions_destroy (file_actions);
+#else
+  int i;
+
+  /* Free the paths in the open actions.  */
+  for (i = 0; i < file_actions->_used; ++i)
+    {
+      struct __spawn_action *sa = &file_actions->_actions[i];
+      switch (sa->tag)
+        {
+        case spawn_do_open:
+          free (sa->action.open_action.path);
+          break;
+        case spawn_do_chdir:
+          free (sa->action.chdir_action.path);
+          break;
+        default:
+          /* No cleanup required.  */
+          break;
+        }
+    }
+
+  /* Free the array of actions.  */
   free (file_actions->_actions);
+
   return 0;
+#endif
 }
index a60dd8c..e49f7c0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index bf73566..0ca7dcb 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2008-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2008-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <sys/types.h>
 
@@ -23,7 +23,9 @@ struct __spawn_action
   {
     spawn_do_close,
     spawn_do_dup2,
-    spawn_do_open
+    spawn_do_open,
+    spawn_do_chdir,
+    spawn_do_fchdir
   } tag;
 
   union
@@ -40,10 +42,18 @@ struct __spawn_action
     struct
     {
       int fd;
-      const char *path;
+      char *path;
       int oflag;
       mode_t mode;
     } open_action;
+    struct
+    {
+      char *path;
+    } chdir_action;
+    struct
+    {
+      int fd;
+    } fchdir_action;
   } action;
 };
 
@@ -58,5 +68,5 @@ extern int __posix_spawn_file_actions_realloc (posix_spawn_file_actions_t *
 #endif
 extern int __spawni (pid_t *pid, const char *path,
                      const posix_spawn_file_actions_t *file_actions,
-                     const posix_spawnattr_t *attrp, char *const argv[],
-                     char *const envp[], int use_path);
+                     const posix_spawnattr_t *attrp, const char *const argv[],
+                     const char *const envp[], int use_path);
index f7e84a0..9c76638 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 668a26a..b3ac4b5 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 97e4166..80cfb7a 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2004, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2004, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/lib/spawnattr_setpgroup.c b/lib/spawnattr_setpgroup.c
new file mode 100644 (file)
index 0000000..6829a12
--- /dev/null
@@ -0,0 +1,32 @@
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <spawn.h>
+
+#include <string.h>
+
+/* Store process group ID in the attribute structure.  */
+int
+posix_spawnattr_setpgroup (posix_spawnattr_t *attr, pid_t pgroup)
+{
+  /* Store the process group ID.  */
+  attr->_pgrp = pgroup;
+
+  return 0;
+}
index d9c6bd7..306e870 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 3451aa5..aad55f3 100644 (file)
@@ -1,5 +1,5 @@
 /* Guts of POSIX spawn interface.  Generic POSIX.1 version.
-   Copyright (C) 2000-2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2000-2006, 2008-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -32,7 +32,7 @@
 #if _LIBC || HAVE_PATHS_H
 # include <paths.h>
 #else
-# define _PATH_BSHELL "/bin/sh"
+# define _PATH_BSHELL BOURNE_SHELL
 #endif
 
 #include <signal.h>
@@ -75,9 +75,6 @@
 # define sigprocmask __sigprocmask
 # define strchrnul __strchrnul
 # define vfork __vfork
-#else
-# undef internal_function
-# define internal_function /* empty */
 #endif
 
 
 #define SPAWN_ERROR     127
 
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Native Windows API.  */
-int
-__spawni (pid_t *pid, const char *file,
-          const posix_spawn_file_actions_t *file_actions,
-          const posix_spawnattr_t *attrp, char *const argv[],
-          char *const envp[], int use_path)
+
+/* Get declarations of the native Windows API functions.  */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# include <stdbool.h>
+# include <stdio.h>
+
+# include "filename.h"
+# include "concat-filename.h"
+# include "findprog.h"
+# include "malloca.h"
+# include "windows-spawn.h"
+
+/* Don't assume that UNICODE is not defined.  */
+# undef CreateFile
+# define CreateFile CreateFileA
+# undef STARTUPINFO
+# define STARTUPINFO STARTUPINFOA
+# undef CreateProcess
+# define CreateProcess CreateProcessA
+
+/* Grows inh_handles->count so that it becomes > newfd.
+   Returns 0 upon success.  In case of failure, -1 is returned, with errno set.
+ */
+static int
+grow_inheritable_handles (struct inheritable_handles *inh_handles, int newfd)
 {
-  /* Not yet implemented.  */
-  return ENOSYS;
+  if (inh_handles->allocated <= newfd)
+    {
+      size_t new_allocated = 2 * inh_handles->allocated + 1;
+      if (new_allocated <= newfd)
+        new_allocated = newfd + 1;
+      HANDLE *new_handles_array =
+        (HANDLE *)
+        realloc (inh_handles->handles, new_allocated * sizeof (HANDLE));
+      if (new_handles_array == NULL)
+        {
+          errno = ENOMEM;
+          return -1;
+        }
+      unsigned char *new_flags_array =
+        (unsigned char *)
+        realloc (inh_handles->flags, new_allocated * sizeof (unsigned char));
+      if (new_flags_array == NULL)
+        {
+          free (new_handles_array);
+          errno = ENOMEM;
+          return -1;
+        }
+      inh_handles->allocated = new_allocated;
+      inh_handles->handles = new_handles_array;
+      inh_handles->flags = new_flags_array;
+    }
+
+  HANDLE *handles = inh_handles->handles;
+
+  for (; inh_handles->count <= newfd; inh_handles->count++)
+    handles[inh_handles->count] = INVALID_HANDLE_VALUE;
+
+  return 0;
 }
 
-#else
+/* Reduces inh_handles->count to the minimum needed.  */
+static void
+shrink_inheritable_handles (struct inheritable_handles *inh_handles)
+{
+  HANDLE *handles = inh_handles->handles;
 
+  while (inh_handles->count > 3
+         && handles[inh_handles->count - 1] == INVALID_HANDLE_VALUE)
+    inh_handles->count--;
+}
 
-/* The file is accessible but it is not an executable file.  Invoke
-   the shell to interpret it as a script.  */
+/* Closes all handles in inh_handles.  */
 static void
-internal_function
-script_execute (const char *file, char *const argv[], char *const envp[])
+close_inheritable_handles (struct inheritable_handles *inh_handles)
 {
-  /* Count the arguments.  */
-  int argc = 0;
-  while (argv[argc++])
-    ;
+  HANDLE *handles = inh_handles->handles;
+  size_t handles_count = inh_handles->count;
+  unsigned int fd;
 
-  /* Construct an argument list for the shell.  */
-  {
-    char **new_argv = (char **) alloca ((argc + 1) * sizeof (char *));
-    new_argv[0] = (char *) _PATH_BSHELL;
-    new_argv[1] = (char *) file;
-    while (argc > 1)
+  for (fd = 0; fd < handles_count; fd++)
+    {
+      HANDLE handle = handles[fd];
+
+      if (handle != INVALID_HANDLE_VALUE)
+        CloseHandle (handle);
+    }
+}
+
+/* Tests whether a memory region, starting at P and N bytes long, contains only
+   zeroes.  */
+static bool
+memiszero (const void *p, size_t n)
+{
+  const char *cp = p;
+  for (; n > 0; cp++, n--)
+    if (*cp != 0)
+      return 0;
+  return 1;
+}
+
+/* Tests whether *S contains no signals.  */
+static bool
+sigisempty (const sigset_t *s)
+{
+  return memiszero (s, sizeof (sigset_t));
+}
+
+/* Opens a HANDLE to a file.
+   Upon failure, returns INVALID_HANDLE_VALUE with errno set.  */
+static HANDLE
+open_handle (const char *name, int flags, mode_t mode)
+{
+  /* To ease portability.  Like in open.c.  */
+  if (strcmp (name, "/dev/null") == 0)
+    name = "NUL";
+
+  /* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>
+     specifies: "More than two leading <slash> characters shall be treated as
+     a single <slash> character."  */
+  if (ISSLASH (name[0]) && ISSLASH (name[1]) && ISSLASH (name[2]))
+    {
+      name += 2;
+      while (ISSLASH (name[1]))
+        name++;
+    }
+
+  size_t len = strlen (name);
+  size_t drive_prefix_len = (HAS_DEVICE (name) ? 2 : 0);
+
+  /* Remove trailing slashes (except the very first one, at position
+     drive_prefix_len), but remember their presence.  */
+  size_t rlen;
+  bool check_dir = false;
+
+  rlen = len;
+  while (rlen > drive_prefix_len && ISSLASH (name[rlen-1]))
+    {
+      check_dir = true;
+      if (rlen == drive_prefix_len + 1)
+        break;
+      rlen--;
+    }
+
+  /* Handle '' and 'C:'.  */
+  if (!check_dir && rlen == drive_prefix_len)
+    {
+      errno = ENOENT;
+      return INVALID_HANDLE_VALUE;
+    }
+
+  /* Handle '\\'.  */
+  if (rlen == 1 && ISSLASH (name[0]) && len >= 2)
+    {
+      errno = ENOENT;
+      return INVALID_HANDLE_VALUE;
+    }
+
+  const char *rname;
+  char *malloca_rname;
+  if (rlen == len)
+    {
+      rname = name;
+      malloca_rname = NULL;
+    }
+  else
+    {
+      malloca_rname = malloca (rlen + 1);
+      if (malloca_rname == NULL)
+        {
+          errno = ENOMEM;
+          return INVALID_HANDLE_VALUE;
+        }
+      memcpy (malloca_rname, name, rlen);
+      malloca_rname[rlen] = '\0';
+      rname = malloca_rname;
+    }
+
+  /* For the meaning of the flags, see
+     <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/open-wopen>  */
+  /* Open a handle to the file.
+     CreateFile
+     <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilea>
+     <https://docs.microsoft.com/en-us/windows/desktop/FileIO/creating-and-opening-files>  */
+  HANDLE handle =
+    CreateFile (rname,
+                ((flags & (O_WRONLY | O_RDWR)) != 0
+                 ? GENERIC_READ | GENERIC_WRITE
+                 : GENERIC_READ),
+                FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+                NULL,
+                ((flags & O_CREAT) != 0
+                 ? ((flags & O_EXCL) != 0
+                    ? CREATE_NEW
+                    : ((flags & O_TRUNC) != 0 ? CREATE_ALWAYS : OPEN_ALWAYS))
+                 : ((flags & O_TRUNC) != 0
+                    ? TRUNCATE_EXISTING
+                    : OPEN_EXISTING)),
+                /* FILE_FLAG_BACKUP_SEMANTICS is useful for opening directories,
+                   which is out-of-scope here.  */
+                /* FILE_FLAG_POSIX_SEMANTICS (treat file names that differ only
+                   in case as different) makes sense only when applied to *all*
+                   filesystem operations.  */
+                /* FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_POSIX_SEMANTICS */
+                FILE_ATTRIBUTE_NORMAL
+                | ((flags & O_TEMPORARY) != 0 ? FILE_FLAG_DELETE_ON_CLOSE : 0)
+                | ((flags & O_SEQUENTIAL ) != 0 ? FILE_FLAG_SEQUENTIAL_SCAN : 0)
+                | ((flags & O_RANDOM) != 0 ? FILE_FLAG_RANDOM_ACCESS : 0),
+                NULL);
+  if (handle == INVALID_HANDLE_VALUE)
+    switch (GetLastError ())
       {
-        new_argv[argc] = argv[argc - 1];
-        --argc;
+      /* Some of these errors probably cannot happen with the specific flags
+         that we pass to CreateFile.  But who knows...  */
+      case ERROR_FILE_NOT_FOUND: /* The last component of rname does not exist.  */
+      case ERROR_PATH_NOT_FOUND: /* Some directory component in rname does not exist.  */
+      case ERROR_BAD_PATHNAME:   /* rname is such as '\\server'.  */
+      case ERROR_BAD_NETPATH:    /* rname is such as '\\nonexistentserver\share'.  */
+      case ERROR_BAD_NET_NAME:   /* rname is such as '\\server\nonexistentshare'.  */
+      case ERROR_INVALID_NAME:   /* rname contains wildcards, misplaced colon, etc.  */
+      case ERROR_DIRECTORY:
+        errno = ENOENT;
+        break;
+
+      case ERROR_ACCESS_DENIED:  /* rname is such as 'C:\System Volume Information\foo'.  */
+      case ERROR_SHARING_VIOLATION: /* rname is such as 'C:\pagefile.sys'.  */
+                                    /* XXX map to EACCES or EPERM? */
+        errno = EACCES;
+        break;
+
+      case ERROR_OUTOFMEMORY:
+        errno = ENOMEM;
+        break;
+
+      case ERROR_WRITE_PROTECT:
+        errno = EROFS;
+        break;
+
+      case ERROR_WRITE_FAULT:
+      case ERROR_READ_FAULT:
+      case ERROR_GEN_FAILURE:
+        errno = EIO;
+        break;
+
+      case ERROR_BUFFER_OVERFLOW:
+      case ERROR_FILENAME_EXCED_RANGE:
+        errno = ENAMETOOLONG;
+        break;
+
+      case ERROR_DELETE_PENDING: /* XXX map to EACCES or EPERM? */
+        errno = EPERM;
+        break;
+
+      default:
+        errno = EINVAL;
+        break;
       }
 
-    /* Execute the shell.  */
-    execve (new_argv[0], new_argv, envp);
+  if (malloca_rname != NULL)
+    {
+      int saved_errno = errno;
+      freea (malloca_rname);
+      errno = saved_errno;
+    }
+  return handle;
+}
+
+/* Executes an 'open' action.
+   Returns 0 upon success.  In case of failure, -1 is returned, with errno set.
+ */
+static int
+do_open (struct inheritable_handles *inh_handles, int newfd,
+         const char *filename, const char *directory,
+         int flags, mode_t mode, HANDLE curr_process)
+{
+  if (!(newfd >= 0 && newfd < _getmaxstdio ()))
+    {
+      errno = EBADF;
+      return -1;
+    }
+  if (grow_inheritable_handles (inh_handles, newfd) < 0)
+    return -1;
+  if (inh_handles->handles[newfd] != INVALID_HANDLE_VALUE
+      && !CloseHandle (inh_handles->handles[newfd]))
+    {
+      errno = EIO;
+      return -1;
+    }
+  if (filename == NULL)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+  char *filename_to_free = NULL;
+  if (directory != NULL && IS_RELATIVE_FILE_NAME (filename))
+    {
+      char *real_filename = concatenated_filename (directory, filename, NULL);
+      if (real_filename == NULL)
+        {
+          errno = ENOMEM;
+          return -1;
+        }
+      filename = real_filename;
+      filename_to_free = real_filename;
+    }
+  HANDLE handle = open_handle (filename, flags, mode);
+  if (handle == INVALID_HANDLE_VALUE)
+    {
+      free (filename_to_free);
+      return -1;
+    }
+  free (filename_to_free);
+  /* Duplicate the handle, so that it becomes inheritable.  */
+  if (!DuplicateHandle (curr_process, handle,
+                        curr_process, &inh_handles->handles[newfd],
+                        0, TRUE,
+                        DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS))
+    {
+      errno = EBADF; /* arbitrary */
+      return -1;
+    }
+  inh_handles->flags[newfd] = ((flags & O_APPEND) != 0 ? 32 : 0);
+  return 0;
+}
+
+/* Executes a 'dup2' action.
+   Returns 0 upon success.  In case of failure, -1 is returned, with errno set.
+ */
+static int
+do_dup2 (struct inheritable_handles *inh_handles, int oldfd, int newfd,
+         HANDLE curr_process)
+{
+  if (!(oldfd >= 0 && oldfd < inh_handles->count
+        && inh_handles->handles[oldfd] != INVALID_HANDLE_VALUE))
+    {
+      errno = EBADF;
+      return -1;
+    }
+  if (!(newfd >= 0 && newfd < _getmaxstdio ()))
+    {
+      errno = EBADF;
+      return -1;
+    }
+  if (newfd != oldfd)
+    {
+      if (grow_inheritable_handles (inh_handles, newfd) < 0)
+        return -1;
+      if (inh_handles->handles[newfd] != INVALID_HANDLE_VALUE
+          && !CloseHandle (inh_handles->handles[newfd]))
+        {
+          errno = EIO;
+          return -1;
+        }
+      /* Duplicate the handle, so that it a forthcoming do_close action on oldfd
+         has no effect on newfd.  */
+      if (!DuplicateHandle (curr_process, inh_handles->handles[oldfd],
+                            curr_process, &inh_handles->handles[newfd],
+                            0, TRUE, DUPLICATE_SAME_ACCESS))
+        {
+          errno = EBADF; /* arbitrary */
+          return -1;
+        }
+      inh_handles->flags[newfd] = 0;
+    }
+  return 0;
+}
+
+/* Executes a 'close' action.
+   Returns 0 upon success.  In case of failure, -1 is returned, with errno set.
+ */
+static int
+do_close (struct inheritable_handles *inh_handles, int fd)
+{
+  if (!(fd >= 0 && fd < inh_handles->count
+        && inh_handles->handles[fd] != INVALID_HANDLE_VALUE))
+    {
+      errno = EBADF;
+      return -1;
+    }
+  if (!CloseHandle (inh_handles->handles[fd]))
+    {
+      errno = EIO;
+      return -1;
+    }
+  inh_handles->handles[fd] = INVALID_HANDLE_VALUE;
+  return 0;
+}
+
+int
+__spawni (pid_t *pid, const char *prog_filename,
+          const posix_spawn_file_actions_t *file_actions,
+          const posix_spawnattr_t *attrp, const char *const prog_argv[],
+          const char *const envp[], int use_path)
+{
+  /* Validate the arguments.  */
+  if (prog_filename == NULL
+      || (attrp != NULL
+          && ((attrp->_flags & ~POSIX_SPAWN_SETPGROUP) != 0
+              || attrp->_pgrp != 0
+              || ! sigisempty (&attrp->_sd)
+              || ! sigisempty (&attrp->_ss)
+              || attrp->_sp.sched_priority != 0
+              || attrp->_policy != 0)))
+    return EINVAL;
+
+  /* Process group handling:
+     Native Windows does not have the concept of process group, but it has the
+     concept of a console attached to a process.
+     So, we interpret the three cases as follows:
+       - Flag POSIX_SPAWN_SETPGROUP not set: Means, the child process is in the
+         same process group as the parent process.  We interpret this as a
+         request to reuse the same console.
+       - Flag POSIX_SPAWN_SETPGROUP set with attrp->_pgrp == 0: Means the child
+         process starts a process group of its own.  See
+         <https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnattr_getpgroup.html>
+         <https://pubs.opengroup.org/onlinepubs/9699919799/functions/setpgrp.html>
+         We interpret this as a request to detach from the current console.
+       - Flag POSIX_SPAWN_SETPGROUP set with attrp->_pgrp != 0: Means the child
+         process joins another, existing process group.  See
+         <https://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawnattr_getpgroup.html>
+         <https://pubs.opengroup.org/onlinepubs/9699919799/functions/setpgid.html>
+         We don't support this case; it produces error EINVAL above.  */
+  /* <https://docs.microsoft.com/en-us/windows/win32/procthread/process-creation-flags>  */
+  DWORD process_creation_flags =
+    (attrp != NULL && (attrp->_flags & POSIX_SPAWN_SETPGROUP) != 0 ? DETACHED_PROCESS : 0);
+
+  char *argv_mem_to_free;
+  const char **argv = prepare_spawn (prog_argv, &argv_mem_to_free);
+  if (argv == NULL)
+    return errno; /* errno is set here */
+  argv++;
+
+  /* Compose the command.  */
+  char *command = compose_command (argv);
+  if (command == NULL)
+    {
+      free (argv_mem_to_free);
+      return ENOMEM;
+    }
+
+  /* Copy *ENVP into a contiguous block of memory.  */
+  char *envblock;
+  if (envp == NULL)
+    envblock = NULL;
+  else
+    {
+      envblock = compose_envblock (envp);
+      if (envblock == NULL)
+        {
+          free (command);
+          free (argv_mem_to_free);
+          return ENOMEM;
+        }
+    }
+
+  /* Set up the array of handles to inherit.
+     Duplicate each handle, so that a spawn_do_close action (below) has no
+     effect on the file descriptors of the current process.  Alternatively,
+     we could store, for each handle, a bit that tells whether it is shared
+     with the current process.  But this is simpler.  */
+  struct inheritable_handles inh_handles;
+  if (init_inheritable_handles (&inh_handles, true) < 0)
+    goto failed_1;
+
+  /* Directory in which to execute the new process.  */
+  const char *directory = NULL;
+
+  /* Execute the file_actions, modifying the inh_handles instead of the
+     file descriptors of the current process.  */
+  if (file_actions != NULL)
+    {
+      HANDLE curr_process = GetCurrentProcess ();
+      int cnt;
+
+      for (cnt = 0; cnt < file_actions->_used; ++cnt)
+        {
+          struct __spawn_action *action = &file_actions->_actions[cnt];
+
+          switch (action->tag)
+            {
+            case spawn_do_close:
+              {
+                int fd = action->action.close_action.fd;
+                if (do_close (&inh_handles, fd) < 0)
+                  goto failed_2;
+              }
+              break;
+
+            case spawn_do_open:
+              {
+                int newfd = action->action.open_action.fd;
+                const char *filename = action->action.open_action.path;
+                int flags = action->action.open_action.oflag;
+                mode_t mode = action->action.open_action.mode;
+                if (do_open (&inh_handles, newfd, filename, directory,
+                             flags, mode, curr_process)
+                    < 0)
+                  goto failed_2;
+              }
+              break;
+
+            case spawn_do_dup2:
+              {
+                int oldfd = action->action.dup2_action.fd;
+                int newfd = action->action.dup2_action.newfd;
+                if (do_dup2 (&inh_handles, oldfd, newfd, curr_process) < 0)
+                  goto failed_2;
+              }
+              break;
+
+            case spawn_do_chdir:
+              {
+                char *newdir = action->action.chdir_action.path;
+                if (directory != NULL && IS_RELATIVE_FILE_NAME (newdir))
+                  {
+                    newdir = concatenated_filename (directory, newdir, NULL);
+                    if (newdir == NULL)
+                      {
+                        errno = ENOMEM;
+                        goto failed_2;
+                      }
+                  }
+                directory = newdir;
+              }
+              break;
+
+            case spawn_do_fchdir:
+              /* Not supported in this implementation.  */
+              errno = EINVAL;
+              goto failed_2;
+            }
+        }
+    }
+
+  /* Reduce inh_handles.count to the minimum needed.  */
+  shrink_inheritable_handles (&inh_handles);
+
+  /* CreateProcess
+     <https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa>  */
+  /* STARTUPINFO
+     <https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa>  */
+  STARTUPINFO sinfo;
+  sinfo.cb = sizeof (STARTUPINFO);
+  sinfo.lpReserved = NULL;
+  sinfo.lpDesktop = NULL;
+  sinfo.lpTitle = NULL;
+  if (compose_handles_block (&inh_handles, &sinfo) < 0)
+    goto failed_2;
+
+  /* Perform the PATH search now, considering the final DIRECTORY.  */
+  char *resolved_prog_filename_to_free = NULL;
+  {
+    const char *resolved_prog_filename =
+      find_in_given_path (prog_filename, use_path ? getenv ("PATH") : "",
+                          directory, false);
+    if (resolved_prog_filename == NULL)
+      goto failed_3;
+    if (resolved_prog_filename != prog_filename)
+      resolved_prog_filename_to_free = (char *) resolved_prog_filename;
+    prog_filename = resolved_prog_filename;
+  }
+
+  PROCESS_INFORMATION pinfo;
+  if (!CreateProcess (prog_filename, command, NULL, NULL, TRUE,
+                      process_creation_flags, envblock, directory, &sinfo,
+                      &pinfo))
+    {
+      DWORD error = GetLastError ();
+
+      free (resolved_prog_filename_to_free);
+      free (sinfo.lpReserved2);
+      close_inheritable_handles (&inh_handles);
+      free_inheritable_handles (&inh_handles);
+      free (envblock);
+      free (command);
+      free (argv_mem_to_free);
+
+      return convert_CreateProcess_error (error);
+    }
+
+  if (pinfo.hThread)
+    CloseHandle (pinfo.hThread);
+
+  free (resolved_prog_filename_to_free);
+  free (sinfo.lpReserved2);
+  close_inheritable_handles (&inh_handles);
+  free_inheritable_handles (&inh_handles);
+  free (envblock);
+  free (command);
+  free (argv_mem_to_free);
+
+  if (pid != NULL)
+    *pid = (intptr_t) pinfo.hProcess;
+  return 0;
+
+ failed_3:
+  {
+    int saved_errno = errno;
+    free (sinfo.lpReserved2);
+    close_inheritable_handles (&inh_handles);
+    free_inheritable_handles (&inh_handles);
+    free (envblock);
+    free (command);
+    free (argv_mem_to_free);
+    return saved_errno;
   }
+
+ failed_2:
+  {
+    int saved_errno = errno;
+    close_inheritable_handles (&inh_handles);
+    free_inheritable_handles (&inh_handles);
+    free (envblock);
+    free (command);
+    free (argv_mem_to_free);
+    return saved_errno;
+  }
+
+ failed_1:
+  free (envblock);
+  free (command);
+  free (argv_mem_to_free);
+  return errno;
 }
 
+#else
+
 
 /* Spawn a new process executing PATH with the attributes describes in *ATTRP.
    Before running the process perform the actions described in FILE-ACTIONS. */
 int
 __spawni (pid_t *pid, const char *file,
           const posix_spawn_file_actions_t *file_actions,
-          const posix_spawnattr_t *attrp, char *const argv[],
-          char *const envp[], int use_path)
+          const posix_spawnattr_t *attrp, const char *const argv[],
+          const char *const envp[], int use_path)
 {
   pid_t new_pid;
   char *path, *p, *name;
@@ -284,6 +869,18 @@ __spawni (pid_t *pid, const char *file,
                 /* The 'dup2' call failed.  */
                 _exit (SPAWN_ERROR);
               break;
+
+            case spawn_do_chdir:
+              if (chdir (action->action.chdir_action.path) < 0)
+                /* The 'chdir' call failed.  */
+                _exit (SPAWN_ERROR);
+              break;
+
+            case spawn_do_fchdir:
+              if (fchdir (action->action.fchdir_action.fd) < 0)
+                /* The 'fchdir' call failed.  */
+                _exit (SPAWN_ERROR);
+              break;
             }
         }
     }
@@ -291,10 +888,7 @@ __spawni (pid_t *pid, const char *file,
   if (! use_path || strchr (file, '/') != NULL)
     {
       /* The FILE parameter is actually a path.  */
-      execve (file, argv, envp);
-
-      if (errno == ENOEXEC)
-        script_execute (file, argv, envp);
+      execve (file, (char * const *) argv, (char * const *) envp);
 
       /* Oh, oh.  'execve' returns.  This is bad.  */
       _exit (SPAWN_ERROR);
@@ -342,10 +936,7 @@ __spawni (pid_t *pid, const char *file,
         startp = (char *) memcpy (name - (p - path), path, p - path);
 
       /* Try to execute this name.  If it works, execv will not return.  */
-      execve (startp, argv, envp);
-
-      if (errno == ENOEXEC)
-        script_execute (startp, argv, envp);
+      execve (startp, (char * const *) argv, (char * const *) envp);
 
       switch (errno)
         {
index 68cabf2..a1490a4 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2009-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -29,5 +29,6 @@ posix_spawnp (pid_t *pid, const char *file,
               const posix_spawnattr_t *attrp, char *const argv[],
               char *const envp[])
 {
-  return __spawni (pid, file, file_actions, attrp, argv, envp, 1);
+  return __spawni (pid, file, file_actions, attrp,
+                   (const char * const *) argv, (const char * const *) envp, 1);
 }
diff --git a/lib/stackvma.c b/lib/stackvma.c
new file mode 100644 (file)
index 0000000..6ad43b7
--- /dev/null
@@ -0,0 +1,2064 @@
+/* Determine the virtual memory area of a given address.
+   Copyright (C) 2002-2021  Bruno Haible <bruno@clisp.org>
+   Copyright (C) 2003-2006  Paolo Bonzini <bonzini@gnu.org>
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "stackvma.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+/* =========================== stackvma-simple.c =========================== */
+
+#if defined __linux__ || defined __ANDROID__ \
+    || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ \
+    || defined __NetBSD__ \
+    || (defined __APPLE__ && defined __MACH__) \
+    || defined __sgi || defined __sun \
+    || defined __CYGWIN__ || defined __HAIKU__
+
+/* This file contains the proximity test function for the simple cases, where
+   the OS has an API for enumerating the mapped ranges of virtual memory.  */
+
+# if STACK_DIRECTION < 0
+
+/* Info about the gap between this VMA and the previous one.
+   addr must be < vma->start.  */
+static int
+simple_is_near_this (uintptr_t addr, struct vma_struct *vma)
+{
+  return (vma->start - addr <= (vma->start - vma->prev_end) / 2);
+}
+
+# endif
+# if STACK_DIRECTION > 0
+
+/* Info about the gap between this VMA and the next one.
+   addr must be > vma->end - 1.  */
+static int
+simple_is_near_this (uintptr_t addr, struct vma_struct *vma)
+{
+  return (addr - vma->end < (vma->next_start - vma->end) / 2);
+}
+
+# endif
+
+#endif
+
+/* =========================== stackvma-rofile.c =========================== */
+/* Buffered read-only streams.  */
+
+#if defined __linux__ || defined __ANDROID__ \
+    || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ \
+    || defined __NetBSD__ \
+    || defined __CYGWIN__
+
+# include <errno.h> /* errno, EINTR */
+# include <fcntl.h> /* open, O_RDONLY */
+# include <stddef.h> /* size_t */
+# include <unistd.h> /* getpagesize, lseek, read, close */
+# include <sys/types.h>
+# include <sys/mman.h> /* mmap, munmap */
+
+# if defined __linux__ || defined __ANDROID__
+#  include <limits.h> /* PATH_MAX */
+# endif
+
+/* Buffered read-only streams.
+   We cannot use <stdio.h> here, because fopen() calls malloc(), and a malloc()
+   call may have been interrupted.
+   Also, we cannot use multiple read() calls, because if the buffer size is
+   smaller than the file's contents:
+     - On NetBSD, the second read() call would return 0, thus making the file
+       appear truncated.
+     - On DragonFly BSD, the first read() call would fail with errno = EFBIG.
+     - On all platforms, if some other thread is doing memory allocations or
+       deallocations between two read() calls, there is a high risk that the
+       result of these two read() calls don't fit together, and as a
+       consequence we will parse gargage and either omit some VMAs or return
+       VMAs with nonsensical addresses.
+   So use mmap(), and ignore the resulting VMA.
+   The stack-allocated buffer cannot be too large, because this can be called
+   when we are in the context of an alternate stack of just SIGSTKSZ bytes.  */
+
+# if defined __linux__ || defined __ANDROID__
+  /* On Linux, if the file does not entirely fit into the buffer, the read()
+     function stops before the line that would come out truncated.  The
+     maximum size of such a line is 73 + PATH_MAX bytes.  To be sure that we
+     have read everything, we must verify that at least that many bytes are
+     left when read() returned.  */
+#  define MIN_LEFTOVER (73 + PATH_MAX)
+# else
+#  define MIN_LEFTOVER 1
+# endif
+
+# if MIN_LEFTOVER < 1024
+#  define STACK_ALLOCATED_BUFFER_SIZE 1024
+# else
+  /* There is no point in using a stack-allocated buffer if it is too small
+     anyway.  */
+#  define STACK_ALLOCATED_BUFFER_SIZE 1
+# endif
+
+struct rofile
+  {
+    size_t position;
+    size_t filled;
+    int eof_seen;
+    /* These fields deal with allocation of the buffer.  */
+    char *buffer;
+    char *auxmap;
+    size_t auxmap_length;
+    uintptr_t auxmap_start;
+    uintptr_t auxmap_end;
+    char stack_allocated_buffer[STACK_ALLOCATED_BUFFER_SIZE];
+  };
+
+/* Open a read-only file stream.  */
+static int
+rof_open (struct rofile *rof, const char *filename)
+{
+  int fd;
+  uintptr_t pagesize;
+  size_t size;
+
+  fd = open (filename, O_RDONLY);
+  if (fd < 0)
+    return -1;
+  rof->position = 0;
+  rof->eof_seen = 0;
+  /* Try the static buffer first.  */
+  pagesize = 0;
+  rof->buffer = rof->stack_allocated_buffer;
+  size = sizeof (rof->stack_allocated_buffer);
+  rof->auxmap = NULL;
+  rof->auxmap_start = 0;
+  rof->auxmap_end = 0;
+  for (;;)
+    {
+      /* Attempt to read the contents in a single system call.  */
+      if (size > MIN_LEFTOVER)
+        {
+          int n = read (fd, rof->buffer, size);
+          if (n < 0 && errno == EINTR)
+            goto retry;
+# if defined __DragonFly__
+          if (!(n < 0 && errno == EFBIG))
+# endif
+            {
+              if (n <= 0)
+                /* Empty file.  */
+                goto fail1;
+              if (n + MIN_LEFTOVER <= size)
+                {
+                  /* The buffer was sufficiently large.  */
+                  rof->filled = n;
+# if defined __linux__ || defined __ANDROID__
+                  /* On Linux, the read() call may stop even if the buffer was
+                     large enough.  We need the equivalent of full_read().  */
+                  for (;;)
+                    {
+                      n = read (fd, rof->buffer + rof->filled, size - rof->filled);
+                      if (n < 0 && errno == EINTR)
+                        goto retry;
+                      if (n < 0)
+                        /* Some error.  */
+                        goto fail1;
+                      if (n + MIN_LEFTOVER > size - rof->filled)
+                        /* Allocate a larger buffer.  */
+                        break;
+                      if (n == 0)
+                        {
+                          /* Reached the end of file.  */
+                          close (fd);
+                          return 0;
+                        }
+                      rof->filled += n;
+                    }
+# else
+                  close (fd);
+                  return 0;
+# endif
+                }
+            }
+        }
+      /* Allocate a larger buffer.  */
+      if (pagesize == 0)
+        {
+          pagesize = getpagesize ();
+          size = pagesize;
+          while (size <= MIN_LEFTOVER)
+            size = 2 * size;
+        }
+      else
+        {
+          size = 2 * size;
+          if (size == 0)
+            /* Wraparound.  */
+            goto fail1;
+          if (rof->auxmap != NULL)
+            munmap (rof->auxmap, rof->auxmap_length);
+        }
+      rof->auxmap = (void *) mmap ((void *) 0, size, PROT_READ | PROT_WRITE,
+                                   MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+      if (rof->auxmap == (void *) -1)
+        {
+          close (fd);
+          return -1;
+        }
+      rof->auxmap_length = size;
+      rof->auxmap_start = (uintptr_t) rof->auxmap;
+      rof->auxmap_end = rof->auxmap_start + size;
+      rof->buffer = (char *) rof->auxmap;
+     retry:
+      /* Restart.  */
+      if (lseek (fd, 0, SEEK_SET) < 0)
+        {
+          close (fd);
+          fd = open (filename, O_RDONLY);
+          if (fd < 0)
+            goto fail2;
+        }
+    }
+ fail1:
+  close (fd);
+ fail2:
+  if (rof->auxmap != NULL)
+    munmap (rof->auxmap, rof->auxmap_length);
+  return -1;
+}
+
+/* Return the next byte from a read-only file stream without consuming it,
+   or -1 at EOF.  */
+static int
+rof_peekchar (struct rofile *rof)
+{
+  if (rof->position == rof->filled)
+    {
+      rof->eof_seen = 1;
+      return -1;
+    }
+  return (unsigned char) rof->buffer[rof->position];
+}
+
+/* Return the next byte from a read-only file stream, or -1 at EOF.  */
+static int
+rof_getchar (struct rofile *rof)
+{
+  int c = rof_peekchar (rof);
+  if (c >= 0)
+    rof->position++;
+  return c;
+}
+
+/* Parse an unsigned hexadecimal number from a read-only file stream.  */
+static int
+rof_scanf_lx (struct rofile *rof, uintptr_t *valuep)
+{
+  uintptr_t value = 0;
+  unsigned int numdigits = 0;
+  for (;;)
+    {
+      int c = rof_peekchar (rof);
+      if (c >= '0' && c <= '9')
+        value = (value << 4) + (c - '0');
+      else if (c >= 'A' && c <= 'F')
+        value = (value << 4) + (c - 'A' + 10);
+      else if (c >= 'a' && c <= 'f')
+        value = (value << 4) + (c - 'a' + 10);
+      else
+        break;
+      rof_getchar (rof);
+      numdigits++;
+    }
+  if (numdigits == 0)
+    return -1;
+  *valuep = value;
+  return 0;
+}
+
+/* Close a read-only file stream.  */
+static void
+rof_close (struct rofile *rof)
+{
+  if (rof->auxmap != NULL)
+    munmap (rof->auxmap, rof->auxmap_length);
+}
+
+#endif
+
+/* ========================== stackvma-vma-iter.c ========================== */
+/* Iterate through the virtual memory areas of the current process,
+   by reading from the /proc file system.  */
+
+/* This code is a simplied copy (no handling of protection flags) of the
+   code in gnulib's lib/vma-iter.c.  */
+
+#if defined __linux__ || defined __ANDROID__ \
+    || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ \
+    || defined __NetBSD__ \
+    || defined __CYGWIN__
+
+/* Forward declarations.  */
+struct callback_locals;
+static int callback (struct callback_locals *locals, uintptr_t start, uintptr_t end);
+
+# if defined __linux__ || defined __ANDROID__ || (defined __FreeBSD_kernel__ && !defined __FreeBSD__) || defined __CYGWIN__
+/* GNU/kFreeBSD mounts /proc as linprocfs, which looks like a Linux /proc
+   file system.  */
+
+static int
+vma_iterate_proc (struct callback_locals *locals)
+{
+  struct rofile rof;
+
+  /* Open the current process' maps file.  It describes one VMA per line.  */
+  if (rof_open (&rof, "/proc/self/maps") >= 0)
+    {
+      uintptr_t auxmap_start = rof.auxmap_start;
+      uintptr_t auxmap_end = rof.auxmap_end;
+
+      for (;;)
+        {
+          uintptr_t start, end;
+          int c;
+
+          /* Parse one line.  First start and end.  */
+          if (!(rof_scanf_lx (&rof, &start) >= 0
+                && rof_getchar (&rof) == '-'
+                && rof_scanf_lx (&rof, &end) >= 0))
+            break;
+          while (c = rof_getchar (&rof), c != -1 && c != '\n')
+            ;
+
+          if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+            {
+              /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+                 = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+              if (start < auxmap_start)
+                if (callback (locals, start, auxmap_start))
+                  break;
+              if (auxmap_end - 1 < end - 1)
+                if (callback (locals, auxmap_end, end))
+                  break;
+            }
+          else
+            {
+              if (callback (locals, start, end))
+                break;
+            }
+        }
+      rof_close (&rof);
+      return 0;
+    }
+
+  return -1;
+}
+
+# elif defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__
+
+static int
+vma_iterate_proc (struct callback_locals *locals)
+{
+  struct rofile rof;
+
+  /* Open the current process' maps file.  It describes one VMA per line.
+     On FreeBSD:
+       Cf. <https://www.freebsd.org/cgi/cvsweb.cgi/src/sys/fs/procfs/procfs_map.c?annotate=HEAD>
+     On NetBSD, there are two such files:
+       - /proc/curproc/map in near-FreeBSD syntax,
+       - /proc/curproc/maps in Linux syntax.
+       Cf. <http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/miscfs/procfs/procfs_map.c?rev=HEAD> */
+  if (rof_open (&rof, "/proc/curproc/map") >= 0)
+    {
+      uintptr_t auxmap_start = rof.auxmap_start;
+      uintptr_t auxmap_end = rof.auxmap_end;
+
+      for (;;)
+        {
+          uintptr_t start, end;
+          int c;
+
+          /* Parse one line.  First start.  */
+          if (!(rof_getchar (&rof) == '0'
+                && rof_getchar (&rof) == 'x'
+                && rof_scanf_lx (&rof, &start) >= 0))
+            break;
+          while (c = rof_peekchar (&rof), c == ' ' || c == '\t')
+            rof_getchar (&rof);
+          /* Then end.  */
+          if (!(rof_getchar (&rof) == '0'
+                && rof_getchar (&rof) == 'x'
+                && rof_scanf_lx (&rof, &end) >= 0))
+            break;
+          while (c = rof_getchar (&rof), c != -1 && c != '\n')
+            ;
+
+          if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+            {
+              /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+                 = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+              if (start < auxmap_start)
+                if (callback (locals, start, auxmap_start))
+                  break;
+              if (auxmap_end - 1 < end - 1)
+                if (callback (locals, auxmap_end, end))
+                  break;
+            }
+          else
+            {
+              if (callback (locals, start, end))
+                break;
+            }
+        }
+      rof_close (&rof);
+      return 0;
+    }
+
+  return -1;
+}
+
+# endif
+
+# if (defined __FreeBSD_kernel__ || defined __FreeBSD__) && defined KERN_PROC_VMMAP /* FreeBSD >= 7.1 */
+
+#  include <sys/user.h> /* struct kinfo_vmentry */
+#  include <sys/sysctl.h> /* sysctl */
+
+static int
+vma_iterate_bsd (struct callback_locals *locals)
+{
+  /* Documentation: https://www.freebsd.org/cgi/man.cgi?sysctl(3)  */
+  int info_path[] = { CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, getpid () };
+  size_t len;
+  size_t pagesize;
+  size_t memneed;
+  void *auxmap;
+  unsigned long auxmap_start;
+  unsigned long auxmap_end;
+  char *mem;
+  char *p;
+  char *p_end;
+
+  len = 0;
+  if (sysctl (info_path, 4, NULL, &len, NULL, 0) < 0)
+    return -1;
+  /* Allow for small variations over time.  In a multithreaded program
+     new VMAs can be allocated at any moment.  */
+  len = 2 * len + 200;
+  /* Allocate memneed bytes of memory.
+     We cannot use alloca here, because not much stack space is guaranteed.
+     We also cannot use malloc here, because a malloc() call may call mmap()
+     and thus pre-allocate available memory.
+     So use mmap(), and ignore the resulting VMA.  */
+  pagesize = getpagesize ();
+  memneed = len;
+  memneed = ((memneed - 1) / pagesize + 1) * pagesize;
+  auxmap = (void *) mmap ((void *) 0, memneed, PROT_READ | PROT_WRITE,
+                          MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+  if (auxmap == (void *) -1)
+    return -1;
+  auxmap_start = (unsigned long) auxmap;
+  auxmap_end = auxmap_start + memneed;
+  mem = (char *) auxmap;
+  if (sysctl (info_path, 4, mem, &len, NULL, 0) < 0)
+    {
+      munmap (auxmap, memneed);
+      return -1;
+    }
+  p = mem;
+  p_end = mem + len;
+  while (p < p_end)
+    {
+      struct kinfo_vmentry *kve = (struct kinfo_vmentry *) p;
+      unsigned long start = kve->kve_start;
+      unsigned long end = kve->kve_end;
+      if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+        {
+          /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+             = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+          if (start < auxmap_start)
+            if (callback (locals, start, auxmap_start))
+              break;
+          if (auxmap_end - 1 < end - 1)
+            if (callback (locals, auxmap_end, end))
+              break;
+        }
+      else
+        {
+          if (callback (locals, start, end))
+            break;
+        }
+      p += kve->kve_structsize;
+    }
+  munmap (auxmap, memneed);
+  return 0;
+}
+
+# else
+
+#  define vma_iterate_bsd(locals) (-1)
+
+# endif
+
+
+/* Iterate over the virtual memory areas of the current process.
+   If such iteration is supported, the callback is called once for every
+   virtual memory area, in ascending order, with the following arguments:
+     - LOCALS is the same argument as passed to vma_iterate.
+     - START is the address of the first byte in the area, page-aligned.
+     - END is the address of the last byte in the area plus 1, page-aligned.
+       Note that it may be 0 for the last area in the address space.
+   If the callback returns 0, the iteration continues.  If it returns 1,
+   the iteration terminates prematurely.
+   This function may open file descriptors, but does not call malloc().
+   Return 0 if all went well, or -1 in case of error.  */
+static int
+vma_iterate (struct callback_locals *locals)
+{
+# if defined __FreeBSD__
+  /* On FreeBSD with procfs (but not GNU/kFreeBSD, which uses linprocfs), the
+     function vma_iterate_proc does not return the virtual memory areas that
+     were created by anonymous mmap.  See
+     <https://svnweb.freebsd.org/base/head/sys/fs/procfs/procfs_map.c?view=markup>
+     So use vma_iterate_proc only as a fallback.  */
+  int retval = vma_iterate_bsd (locals);
+  if (retval == 0)
+      return 0;
+
+  return vma_iterate_proc (locals);
+# else
+  /* On the other platforms, try the /proc approach first, and the sysctl()
+     as a fallback.  */
+  int retval = vma_iterate_proc (locals);
+  if (retval == 0)
+      return 0;
+
+  return vma_iterate_bsd (locals);
+# endif
+}
+
+#endif
+
+/* =========================== stackvma-mincore.c =========================== */
+
+/* mincore() is a system call that allows to inquire the status of a
+   range of pages of virtual memory.  In particular, it allows to inquire
+   whether a page is mapped at all (except on Mac OS X, where mincore
+   returns 0 even for unmapped addresses).
+   As of 2006, mincore() is supported by:        possible bits:
+     - Linux,   since Linux 2.4 and glibc 2.2,   1
+     - Solaris, since Solaris 9,                 1
+     - MacOS X, since MacOS X 10.3 (at least),   1
+     - FreeBSD, since FreeBSD 6.0,               MINCORE_{INCORE,REFERENCED,MODIFIED}
+     - NetBSD,  since NetBSD 3.0 (at least),     1
+     - OpenBSD, since OpenBSD 2.6 (at least),    1
+     - AIX,     since AIX 5.3,                   1
+   As of 2019, also on
+     - Hurd.
+   However, while the API allows to easily determine the bounds of mapped
+   virtual memory, it does not make it easy to find the bounds of _unmapped_
+   virtual memory ranges.  We try to work around this, but it may still be
+   slow.  */
+
+#if defined __linux__ || defined __ANDROID__ \
+    || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ \
+    || defined __NetBSD__ /* || defined __OpenBSD__ */ \
+    /* || (defined __APPLE__ && defined __MACH__) */ \
+    || defined _AIX || defined __sun
+
+# include <unistd.h> /* getpagesize, mincore */
+# include <sys/types.h>
+# include <sys/mman.h> /* mincore */
+
+/* The AIX declaration of mincore() uses 'caddr_t', whereas the other platforms
+   use 'void *'. */
+# ifdef _AIX
+typedef caddr_t MINCORE_ADDR_T;
+# else
+typedef void* MINCORE_ADDR_T;
+# endif
+
+/* The glibc and musl declaration of mincore() uses 'unsigned char *', whereas
+   the BSD declaration uses 'char *'.  */
+# if __GLIBC__ >= 2 || defined __linux__ || defined __ANDROID__
+typedef unsigned char pageinfo_t;
+# else
+typedef char pageinfo_t;
+# endif
+
+/* Cache for getpagesize().  */
+static uintptr_t pagesize;
+
+/* Initialize pagesize.  */
+static void
+init_pagesize (void)
+{
+  pagesize = getpagesize ();
+}
+
+/* Test whether the page starting at ADDR is among the address range.
+   ADDR must be a multiple of pagesize.  */
+static int
+is_mapped (uintptr_t addr)
+{
+  pageinfo_t vec[1];
+  return mincore ((MINCORE_ADDR_T) addr, pagesize, vec) >= 0;
+}
+
+/* Assuming that the page starting at ADDR is among the address range,
+   return the start of its virtual memory range.
+   ADDR must be a multiple of pagesize.  */
+static uintptr_t
+mapped_range_start (uintptr_t addr)
+{
+  /* Use a moderately sized VEC here, small enough that it fits on the stack
+     (without requiring malloc).  */
+  pageinfo_t vec[1024];
+  uintptr_t stepsize = sizeof (vec);
+
+  for (;;)
+    {
+      uintptr_t max_remaining;
+
+      if (addr == 0)
+        return addr;
+
+      max_remaining = addr / pagesize;
+      if (stepsize > max_remaining)
+        stepsize = max_remaining;
+      if (mincore ((MINCORE_ADDR_T) (addr - stepsize * pagesize),
+                   stepsize * pagesize, vec) < 0)
+        /* Time to search in smaller steps.  */
+        break;
+      /* The entire range exists.  Continue searching in large steps.  */
+      addr -= stepsize * pagesize;
+    }
+  for (;;)
+    {
+      uintptr_t halfstepsize1;
+      uintptr_t halfstepsize2;
+
+      if (stepsize == 1)
+        return addr;
+
+      /* Here we know that less than stepsize pages exist starting at addr.  */
+      halfstepsize1 = (stepsize + 1) / 2;
+      halfstepsize2 = stepsize / 2;
+      /* halfstepsize1 + halfstepsize2 = stepsize.  */
+
+      if (mincore ((MINCORE_ADDR_T) (addr - halfstepsize1 * pagesize),
+                   halfstepsize1 * pagesize, vec) < 0)
+        stepsize = halfstepsize1;
+      else
+        {
+          addr -= halfstepsize1 * pagesize;
+          stepsize = halfstepsize2;
+        }
+    }
+}
+
+/* Assuming that the page starting at ADDR is among the address range,
+   return the end of its virtual memory range + 1.
+   ADDR must be a multiple of pagesize.  */
+static uintptr_t
+mapped_range_end (uintptr_t addr)
+{
+  /* Use a moderately sized VEC here, small enough that it fits on the stack
+     (without requiring malloc).  */
+  pageinfo_t vec[1024];
+  uintptr_t stepsize = sizeof (vec);
+
+  addr += pagesize;
+  for (;;)
+    {
+      uintptr_t max_remaining;
+
+      if (addr == 0) /* wrapped around? */
+        return addr;
+
+      max_remaining = (- addr) / pagesize;
+      if (stepsize > max_remaining)
+        stepsize = max_remaining;
+      if (mincore ((MINCORE_ADDR_T) addr, stepsize * pagesize, vec) < 0)
+        /* Time to search in smaller steps.  */
+        break;
+      /* The entire range exists.  Continue searching in large steps.  */
+      addr += stepsize * pagesize;
+    }
+  for (;;)
+    {
+      uintptr_t halfstepsize1;
+      uintptr_t halfstepsize2;
+
+      if (stepsize == 1)
+        return addr;
+
+      /* Here we know that less than stepsize pages exist starting at addr.  */
+      halfstepsize1 = (stepsize + 1) / 2;
+      halfstepsize2 = stepsize / 2;
+      /* halfstepsize1 + halfstepsize2 = stepsize.  */
+
+      if (mincore ((MINCORE_ADDR_T) addr, halfstepsize1 * pagesize, vec) < 0)
+        stepsize = halfstepsize1;
+      else
+        {
+          addr += halfstepsize1 * pagesize;
+          stepsize = halfstepsize2;
+        }
+    }
+}
+
+/* Determine whether an address range [ADDR1..ADDR2] is completely unmapped.
+   ADDR1 must be <= ADDR2.  */
+static int
+is_unmapped (uintptr_t addr1, uintptr_t addr2)
+{
+  uintptr_t count;
+  uintptr_t stepsize;
+
+  /* Round addr1 down.  */
+  addr1 = (addr1 / pagesize) * pagesize;
+  /* Round addr2 up and turn it into an exclusive bound.  */
+  addr2 = ((addr2 / pagesize) + 1) * pagesize;
+
+  /* This is slow: mincore() does not provide a way to determine the bounds
+     of the gaps directly.  So we have to use mincore() on individual pages
+     over and over again.  Only after we've verified that all pages are
+     unmapped, we know that the range is completely unmapped.
+     If we were to traverse the pages from bottom to top or from top to bottom,
+     it would be slow even in the average case.  To speed up the search, we
+     exploit the fact that mapped memory ranges are larger than one page on
+     average, therefore we have good chances of hitting a mapped area if we
+     traverse only every second, or only fourth page, etc.  This doesn't
+     decrease the worst-case runtime, only the average runtime.  */
+  count = (addr2 - addr1) / pagesize;
+  /* We have to test is_mapped (addr1 + i * pagesize) for 0 <= i < count.  */
+  for (stepsize = 1; stepsize < count; )
+    stepsize = 2 * stepsize;
+  for (;;)
+    {
+      uintptr_t addr_stepsize;
+      uintptr_t i;
+      uintptr_t addr;
+
+      stepsize = stepsize / 2;
+      if (stepsize == 0)
+        break;
+      addr_stepsize = stepsize * pagesize;
+      for (i = stepsize, addr = addr1 + addr_stepsize;
+           i < count;
+           i += 2 * stepsize, addr += 2 * addr_stepsize)
+        /* Here addr = addr1 + i * pagesize.  */
+        if (is_mapped (addr))
+          return 0;
+    }
+  return 1;
+}
+
+# if STACK_DIRECTION < 0
+
+/* Info about the gap between this VMA and the previous one.
+   addr must be < vma->start.  */
+static int
+mincore_is_near_this (uintptr_t addr, struct vma_struct *vma)
+{
+  /*   vma->start - addr <= (vma->start - vma->prev_end) / 2
+     is mathematically equivalent to
+       vma->prev_end <= 2 * addr - vma->start
+     <==> is_unmapped (2 * addr - vma->start, vma->start - 1).
+     But be careful about overflow: if 2 * addr - vma->start is negative,
+     we consider a tiny "guard page" mapping [0, 0] to be present around
+     NULL; it intersects the range (2 * addr - vma->start, vma->start - 1),
+     therefore return false.  */
+  uintptr_t testaddr = addr - (vma->start - addr);
+  if (testaddr > addr) /* overflow? */
+    return 0;
+  /* Here testaddr <= addr < vma->start.  */
+  return is_unmapped (testaddr, vma->start - 1);
+}
+
+# endif
+# if STACK_DIRECTION > 0
+
+/* Info about the gap between this VMA and the next one.
+   addr must be > vma->end - 1.  */
+static int
+mincore_is_near_this (uintptr_t addr, struct vma_struct *vma)
+{
+  /*   addr - vma->end < (vma->next_start - vma->end) / 2
+     is mathematically equivalent to
+       vma->next_start > 2 * addr - vma->end
+     <==> is_unmapped (vma->end, 2 * addr - vma->end).
+     But be careful about overflow: if 2 * addr - vma->end is > ~0UL,
+     we consider a tiny "guard page" mapping [0, 0] to be present around
+     NULL; it intersects the range (vma->end, 2 * addr - vma->end),
+     therefore return false.  */
+  uintptr_t testaddr = addr + (addr - vma->end);
+  if (testaddr < addr) /* overflow? */
+    return 0;
+  /* Here vma->end - 1 < addr <= testaddr.  */
+  return is_unmapped (vma->end, testaddr);
+}
+
+# endif
+
+static int
+mincore_get_vma (uintptr_t address, struct vma_struct *vma)
+{
+  if (pagesize == 0)
+    init_pagesize ();
+  address = (address / pagesize) * pagesize;
+  vma->start = mapped_range_start (address);
+  vma->end = mapped_range_end (address);
+  vma->is_near_this = mincore_is_near_this;
+  return 0;
+}
+
+#endif
+
+/* ========================================================================== */
+
+/* ---------------------------- stackvma-linux.c ---------------------------- */
+
+#if defined __linux__ || defined __ANDROID__ /* Linux */
+
+struct callback_locals
+{
+  uintptr_t address;
+  struct vma_struct *vma;
+# if STACK_DIRECTION < 0
+  uintptr_t prev;
+# else
+  int stop_at_next_vma;
+# endif
+  int retval;
+};
+
+static int
+callback (struct callback_locals *locals, uintptr_t start, uintptr_t end)
+{
+# if STACK_DIRECTION < 0
+  if (locals->address >= start && locals->address <= end - 1)
+    {
+      locals->vma->start = start;
+      locals->vma->end = end;
+      locals->vma->prev_end = locals->prev;
+      locals->retval = 0;
+      return 1;
+    }
+  locals->prev = end;
+# else
+  if (locals->stop_at_next_vma)
+    {
+      locals->vma->next_start = start;
+      locals->stop_at_next_vma = 0;
+      return 1;
+    }
+  if (locals->address >= start && locals->address <= end - 1)
+    {
+      locals->vma->start = start;
+      locals->vma->end = end;
+      locals->retval = 0;
+      locals->stop_at_next_vma = 1;
+      return 0;
+    }
+# endif
+  return 0;
+}
+
+int
+sigsegv_get_vma (uintptr_t address, struct vma_struct *vma)
+{
+  struct callback_locals locals;
+  locals.address = address;
+  locals.vma = vma;
+# if STACK_DIRECTION < 0
+  locals.prev = 0;
+# else
+  locals.stop_at_next_vma = 0;
+# endif
+  locals.retval = -1;
+
+  vma_iterate (&locals);
+  if (locals.retval == 0)
+    {
+# if !(STACK_DIRECTION < 0)
+      if (locals.stop_at_next_vma)
+        vma->next_start = 0;
+# endif
+      vma->is_near_this = simple_is_near_this;
+      return 0;
+    }
+
+  return mincore_get_vma (address, vma);
+}
+
+/* --------------------------- stackvma-freebsd.c --------------------------- */
+
+#elif defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ /* GNU/kFreeBSD, FreeBSD */
+
+struct callback_locals
+{
+  uintptr_t address;
+  struct vma_struct *vma;
+  /* The stack appears as multiple adjacents segments, therefore we
+     merge adjacent segments.  */
+  uintptr_t curr_start, curr_end;
+# if STACK_DIRECTION < 0
+  uintptr_t prev_end;
+# else
+  int stop_at_next_vma;
+# endif
+  int retval;
+};
+
+static int
+callback (struct callback_locals *locals, uintptr_t start, uintptr_t end)
+{
+  if (start == locals->curr_end)
+    {
+      /* Merge adjacent segments.  */
+      locals->curr_end = end;
+      return 0;
+    }
+# if STACK_DIRECTION < 0
+  if (locals->curr_start < locals->curr_end
+      && locals->address >= locals->curr_start
+      && locals->address <= locals->curr_end - 1)
+    {
+      locals->vma->start = locals->curr_start;
+      locals->vma->end = locals->curr_end;
+      locals->vma->prev_end = locals->prev_end;
+      locals->retval = 0;
+      return 1;
+    }
+  locals->prev_end = locals->curr_end;
+# else
+  if (locals->stop_at_next_vma)
+    {
+      locals->vma->next_start = locals->curr_start;
+      locals->stop_at_next_vma = 0;
+      return 1;
+    }
+  if (locals->curr_start < locals->curr_end
+      && locals->address >= locals->curr_start
+      && locals->address <= locals->curr_end - 1)
+    {
+      locals->vma->start = locals->curr_start;
+      locals->vma->end = locals->curr_end;
+      locals->retval = 0;
+      locals->stop_at_next_vma = 1;
+      return 0;
+    }
+# endif
+  locals->curr_start = start; locals->curr_end = end;
+  return 0;
+}
+
+int
+sigsegv_get_vma (uintptr_t address, struct vma_struct *vma)
+{
+  struct callback_locals locals;
+  locals.address = address;
+  locals.vma = vma;
+  locals.curr_start = 0;
+  locals.curr_end = 0;
+# if STACK_DIRECTION < 0
+  locals.prev_end = 0;
+# else
+  locals.stop_at_next_vma = 0;
+# endif
+  locals.retval = -1;
+
+  vma_iterate (&locals);
+  if (locals.retval < 0)
+    {
+      if (locals.curr_start < locals.curr_end
+          && address >= locals.curr_start && address <= locals.curr_end - 1)
+        {
+          vma->start = locals.curr_start;
+          vma->end = locals.curr_end;
+# if STACK_DIRECTION < 0
+          vma->prev_end = locals.prev_end;
+# else
+          vma->next_start = 0;
+# endif
+          locals.retval = 0;
+        }
+    }
+  if (locals.retval == 0)
+    {
+# if !(STACK_DIRECTION < 0)
+      if (locals.stop_at_next_vma)
+        vma->next_start = 0;
+# endif
+      vma->is_near_this = simple_is_near_this;
+      return 0;
+    }
+
+  /* FreeBSD 6.[01] doesn't allow to distinguish unmapped pages from
+     mapped but swapped-out pages.  See whether it's fixed.  */
+  if (!is_mapped (0))
+    /* OK, mincore() appears to work as expected.  */
+    return mincore_get_vma (address, vma);
+  return -1;
+}
+
+/* --------------------------- stackvma-netbsd.c --------------------------- */
+
+#elif defined __NetBSD__ /* NetBSD */
+
+struct callback_locals
+{
+  uintptr_t address;
+  struct vma_struct *vma;
+  /* The stack appears as multiple adjacents segments, therefore we
+     merge adjacent segments.  */
+  uintptr_t curr_start, curr_end;
+# if STACK_DIRECTION < 0
+  uintptr_t prev_end;
+# else
+  int stop_at_next_vma;
+# endif
+  int retval;
+};
+
+static int
+callback (struct callback_locals *locals, uintptr_t start, uintptr_t end)
+{
+  if (start == locals->curr_end)
+    {
+      /* Merge adjacent segments.  */
+      locals->curr_end = end;
+      return 0;
+    }
+# if STACK_DIRECTION < 0
+  if (locals->curr_start < locals->curr_end
+      && locals->address >= locals->curr_start
+      && locals->address <= locals->curr_end - 1)
+    {
+      locals->vma->start = locals->curr_start;
+      locals->vma->end = locals->curr_end;
+      locals->vma->prev_end = locals->prev_end;
+      locals->retval = 0;
+      return 1;
+    }
+  locals->prev_end = locals->curr_end;
+# else
+  if (locals->stop_at_next_vma)
+    {
+      locals->vma->next_start = locals->curr_start;
+      locals->stop_at_next_vma = 0;
+      return 1;
+    }
+  if (locals->curr_start < locals->curr_end
+      && locals->address >= locals->curr_start
+      && locals->address <= locals->curr_end - 1)
+    {
+      locals->vma->start = locals->curr_start;
+      locals->vma->end = locals->curr_end;
+      locals->retval = 0;
+      locals->stop_at_next_vma = 1;
+      return 0;
+    }
+# endif
+  locals->curr_start = start; locals->curr_end = end;
+  return 0;
+}
+
+int
+sigsegv_get_vma (uintptr_t address, struct vma_struct *vma)
+{
+  struct callback_locals locals;
+  locals.address = address;
+  locals.vma = vma;
+  locals.curr_start = 0;
+  locals.curr_end = 0;
+# if STACK_DIRECTION < 0
+  locals.prev_end = 0;
+# else
+  locals.stop_at_next_vma = 0;
+# endif
+  locals.retval = -1;
+
+  vma_iterate (&locals);
+  if (locals.retval < 0)
+    {
+      if (locals.curr_start < locals.curr_end
+          && address >= locals.curr_start && address <= locals.curr_end - 1)
+        {
+          vma->start = locals.curr_start;
+          vma->end = locals.curr_end;
+# if STACK_DIRECTION < 0
+          vma->prev_end = locals.prev_end;
+# else
+          vma->next_start = 0;
+# endif
+          locals.retval = 0;
+        }
+    }
+  if (locals.retval == 0)
+    {
+# if !(STACK_DIRECTION < 0)
+      if (locals.stop_at_next_vma)
+        vma->next_start = 0;
+# endif
+      vma->is_near_this = simple_is_near_this;
+      return 0;
+    }
+
+  return mincore_get_vma (address, vma);
+}
+
+/* --------------------------- stackvma-mquery.c --------------------------- */
+
+/* mquery() is a system call that allows to inquire the status of a
+   range of pages of virtual memory.  In particular, it allows to inquire
+   whether a page is mapped at all, and where is the next unmapped page
+   after a given address.
+   As of 2021, mquery() is supported by:
+     - OpenBSD, since OpenBSD 3.4.
+   Note that this file can give different results.  For example, on
+   OpenBSD 4.4 / i386 the stack segment (which starts around 0xcdbfe000)
+   ends at 0xcfbfdfff according to mincore, but at 0xffffffff according to
+   mquery.  */
+
+#elif defined __OpenBSD__ /* OpenBSD */
+
+# include <unistd.h> /* getpagesize, mincore */
+# include <sys/types.h>
+# include <sys/mman.h> /* mincore */
+
+/* Cache for getpagesize().  */
+static uintptr_t pagesize;
+
+/* Initialize pagesize.  */
+static void
+init_pagesize (void)
+{
+  pagesize = getpagesize ();
+}
+
+/* Test whether the page starting at ADDR is among the address range.
+   ADDR must be a multiple of pagesize.  */
+static int
+is_mapped (uintptr_t addr)
+{
+  /* Avoid calling mquery with a NULL first argument, because this argument
+     value has a specific meaning.  We know the NULL page is unmapped.  */
+  if (addr == 0)
+    return 0;
+  return mquery ((void *) addr, pagesize, 0, MAP_FIXED, -1, 0) == (void *) -1;
+}
+
+/* Assuming that the page starting at ADDR is among the address range,
+   return the start of its virtual memory range.
+   ADDR must be a multiple of pagesize.  */
+static uintptr_t
+mapped_range_start (uintptr_t addr)
+{
+  uintptr_t stepsize;
+  uintptr_t known_unmapped_page;
+
+  /* Look at smaller addresses, in larger and larger steps, to minimize the
+     number of mquery() calls.  */
+  stepsize = pagesize;
+  for (;;)
+    {
+      uintptr_t hole;
+
+      if (addr == 0)
+        abort ();
+
+      if (addr <= stepsize)
+        {
+          known_unmapped_page = 0;
+          break;
+        }
+
+      hole = (uintptr_t) mquery ((void *) (addr - stepsize), pagesize,
+                                     0, 0, -1, 0);
+      if (!(hole == (uintptr_t) (void *) -1 || hole >= addr))
+        {
+          /* Some part of [addr - stepsize, addr - 1] is unmapped.  */
+          known_unmapped_page = hole;
+          break;
+        }
+
+      /* The entire range [addr - stepsize, addr - 1] is mapped.  */
+      addr -= stepsize;
+
+      if (2 * stepsize > stepsize && 2 * stepsize < addr)
+        stepsize = 2 * stepsize;
+    }
+
+  /* Now reduce the step size again.
+     We know that the page at known_unmapped_page is unmapped and that
+     0 < addr - known_unmapped_page <= stepsize.  */
+  while (stepsize > pagesize && stepsize / 2 >= addr - known_unmapped_page)
+    stepsize = stepsize / 2;
+  /* Still 0 < addr - known_unmapped_page <= stepsize.  */
+  while (stepsize > pagesize)
+    {
+      uintptr_t hole;
+
+      stepsize = stepsize / 2;
+      hole = (uintptr_t) mquery ((void *) (addr - stepsize), pagesize,
+                                     0, 0, -1, 0);
+      if (!(hole == (uintptr_t) (void *) -1 || hole >= addr))
+        /* Some part of [addr - stepsize, addr - 1] is unmapped.  */
+        known_unmapped_page = hole;
+      else
+        /* The entire range [addr - stepsize, addr - 1] is mapped.  */
+        addr -= stepsize;
+      /* Still 0 < addr - known_unmapped_page <= stepsize.  */
+    }
+
+  return addr;
+}
+
+/* Assuming that the page starting at ADDR is among the address range,
+   return the end of its virtual memory range + 1.
+   ADDR must be a multiple of pagesize.  */
+static uintptr_t
+mapped_range_end (uintptr_t addr)
+{
+  uintptr_t end;
+
+  if (addr == 0)
+    abort ();
+
+  end = (uintptr_t) mquery ((void *) addr, pagesize, 0, 0, -1, 0);
+  if (end == (uintptr_t) (void *) -1)
+    end = 0; /* wrap around */
+  return end;
+}
+
+/* Determine whether an address range [ADDR1..ADDR2] is completely unmapped.
+   ADDR1 must be <= ADDR2.  */
+static int
+is_unmapped (uintptr_t addr1, uintptr_t addr2)
+{
+  /* Round addr1 down.  */
+  addr1 = (addr1 / pagesize) * pagesize;
+  /* Round addr2 up and turn it into an exclusive bound.  */
+  addr2 = ((addr2 / pagesize) + 1) * pagesize;
+
+  /* Avoid calling mquery with a NULL first argument, because this argument
+     value has a specific meaning.  We know the NULL page is unmapped.  */
+  if (addr1 == 0)
+    addr1 = pagesize;
+
+  if (addr1 < addr2)
+    {
+      if (mquery ((void *) addr1, addr2 - addr1, 0, MAP_FIXED, -1, 0)
+          == (void *) -1)
+        /* Not all the interval [addr1 .. addr2 - 1] is unmapped.  */
+        return 0;
+      else
+        /* The interval [addr1 .. addr2 - 1] is unmapped.  */
+        return 1;
+    }
+  return 1;
+}
+
+# if STACK_DIRECTION < 0
+
+/* Info about the gap between this VMA and the previous one.
+   addr must be < vma->start.  */
+static int
+mquery_is_near_this (uintptr_t addr, struct vma_struct *vma)
+{
+  /*   vma->start - addr <= (vma->start - vma->prev_end) / 2
+     is mathematically equivalent to
+       vma->prev_end <= 2 * addr - vma->start
+     <==> is_unmapped (2 * addr - vma->start, vma->start - 1).
+     But be careful about overflow: if 2 * addr - vma->start is negative,
+     we consider a tiny "guard page" mapping [0, 0] to be present around
+     NULL; it intersects the range (2 * addr - vma->start, vma->start - 1),
+     therefore return false.  */
+  uintptr_t testaddr = addr - (vma->start - addr);
+  if (testaddr > addr) /* overflow? */
+    return 0;
+  /* Here testaddr <= addr < vma->start.  */
+  return is_unmapped (testaddr, vma->start - 1);
+}
+
+# endif
+# if STACK_DIRECTION > 0
+
+/* Info about the gap between this VMA and the next one.
+   addr must be > vma->end - 1.  */
+static int
+mquery_is_near_this (uintptr_t addr, struct vma_struct *vma)
+{
+  /*   addr - vma->end < (vma->next_start - vma->end) / 2
+     is mathematically equivalent to
+       vma->next_start > 2 * addr - vma->end
+     <==> is_unmapped (vma->end, 2 * addr - vma->end).
+     But be careful about overflow: if 2 * addr - vma->end is > ~0UL,
+     we consider a tiny "guard page" mapping [0, 0] to be present around
+     NULL; it intersects the range (vma->end, 2 * addr - vma->end),
+     therefore return false.  */
+  uintptr_t testaddr = addr + (addr - vma->end);
+  if (testaddr < addr) /* overflow? */
+    return 0;
+  /* Here vma->end - 1 < addr <= testaddr.  */
+  return is_unmapped (vma->end, testaddr);
+}
+
+# endif
+
+int
+sigsegv_get_vma (uintptr_t address, struct vma_struct *vma)
+{
+  if (pagesize == 0)
+    init_pagesize ();
+  address = (address / pagesize) * pagesize;
+  vma->start = mapped_range_start (address);
+  vma->end = mapped_range_end (address);
+  vma->is_near_this = mquery_is_near_this;
+  return 0;
+}
+
+/* ---------------------------- stackvma-mach.c ---------------------------- */
+
+#elif (defined __APPLE__ && defined __MACH__) /* macOS */
+
+#include <libc.h>
+#include <nlist.h>
+#include <mach/mach.h>
+#include <mach/machine/vm_param.h>
+
+int
+sigsegv_get_vma (uintptr_t req_address, struct vma_struct *vma)
+{
+  uintptr_t prev_address = 0, prev_size = 0;
+  uintptr_t join_address = 0, join_size = 0;
+  int more = 1;
+  vm_address_t address;
+  vm_size_t size;
+  task_t task = mach_task_self ();
+
+  for (address = VM_MIN_ADDRESS; more; address += size)
+    {
+      mach_port_t object_name;
+      /* In MacOS X 10.5, the types vm_address_t, vm_offset_t, vm_size_t have
+         32 bits in 32-bit processes and 64 bits in 64-bit processes. Whereas
+         mach_vm_address_t and mach_vm_size_t are always 64 bits large.
+         MacOS X 10.5 has three vm_region like methods:
+           - vm_region. It has arguments that depend on whether the current
+             process is 32-bit or 64-bit. When linking dynamically, this
+             function exists only in 32-bit processes. Therefore we use it only
+             in 32-bit processes.
+           - vm_region_64. It has arguments that depend on whether the current
+             process is 32-bit or 64-bit. It interprets a flavor
+             VM_REGION_BASIC_INFO as VM_REGION_BASIC_INFO_64, which is
+             dangerous since 'struct vm_region_basic_info_64' is larger than
+             'struct vm_region_basic_info'; therefore let's write
+             VM_REGION_BASIC_INFO_64 explicitly.
+           - mach_vm_region. It has arguments that are 64-bit always. This
+             function is useful when you want to access the VM of a process
+             other than the current process.
+         In 64-bit processes, we could use vm_region_64 or mach_vm_region.
+         I choose vm_region_64 because it uses the same types as vm_region,
+         resulting in less conditional code.  */
+# if defined __aarch64__ || defined __ppc64__ || defined __x86_64__
+      struct vm_region_basic_info_64 info;
+      mach_msg_type_number_t info_count = VM_REGION_BASIC_INFO_COUNT_64;
+
+      more = (vm_region_64 (task, &address, &size, VM_REGION_BASIC_INFO_64,
+                            (vm_region_info_t)&info, &info_count, &object_name)
+              == KERN_SUCCESS);
+# else
+      struct vm_region_basic_info info;
+      mach_msg_type_number_t info_count = VM_REGION_BASIC_INFO_COUNT;
+
+      more = (vm_region (task, &address, &size, VM_REGION_BASIC_INFO,
+                         (vm_region_info_t)&info, &info_count, &object_name)
+              == KERN_SUCCESS);
+# endif
+      if (!more)
+        {
+          address = join_address + join_size;
+          size = 0;
+        }
+
+      if ((uintptr_t) address == join_address + join_size)
+        join_size += size;
+      else
+        {
+          prev_address = join_address;
+          prev_size = join_size;
+          join_address = (uintptr_t) address;
+          join_size = size;
+        }
+
+      if (object_name != MACH_PORT_NULL)
+        mach_port_deallocate (mach_task_self (), object_name);
+
+# if STACK_DIRECTION < 0
+      if (join_address <= req_address && join_address + join_size > req_address)
+        {
+          vma->start = join_address;
+          vma->end = join_address + join_size;
+          vma->prev_end = prev_address + prev_size;
+          vma->is_near_this = simple_is_near_this;
+          return 0;
+        }
+# else
+      if (prev_address <= req_address && prev_address + prev_size > req_address)
+        {
+          vma->start = prev_address;
+          vma->end = prev_address + prev_size;
+          vma->next_start = join_address;
+          vma->is_near_this = simple_is_near_this;
+          return 0;
+        }
+# endif
+    }
+
+# if STACK_DIRECTION > 0
+  if (join_address <= req_address && join_address + size > req_address)
+    {
+      vma->start = prev_address;
+      vma->end = prev_address + prev_size;
+      vma->next_start = ~0UL;
+      vma->is_near_this = simple_is_near_this;
+      return 0;
+    }
+# endif
+
+  return -1;
+}
+
+/* -------------------------------------------------------------------------- */
+
+#elif defined _AIX /* AIX */
+
+int
+sigsegv_get_vma (uintptr_t address, struct vma_struct *vma)
+{
+  return mincore_get_vma (address, vma);
+}
+
+/* --------------------------- stackvma-procfs.h --------------------------- */
+
+#elif defined __sgi || defined __sun /* IRIX, Solaris */
+
+# include <errno.h> /* errno, EINTR */
+# include <fcntl.h> /* open, O_RDONLY */
+# include <stddef.h> /* size_t */
+# include <unistd.h> /* getpagesize, getpid, read, close */
+# include <sys/types.h>
+# include <sys/mman.h> /* mmap, munmap */
+# include <sys/stat.h> /* fstat */
+# include <string.h> /* memcpy */
+
+/* Try to use the newer ("structured") /proc filesystem API, if supported.  */
+# define _STRUCTURED_PROC 1
+# include <sys/procfs.h> /* prmap_t, optionally PIOC* */
+
+# if !defined __sun
+
+/* Cache for getpagesize().  */
+static uintptr_t pagesize;
+
+/* Initialize pagesize.  */
+static void
+init_pagesize (void)
+{
+  pagesize = getpagesize ();
+}
+
+# endif
+
+struct callback_locals
+{
+  uintptr_t address;
+  struct vma_struct *vma;
+# if STACK_DIRECTION < 0
+  uintptr_t prev;
+# else
+  int stop_at_next_vma;
+# endif
+  int retval;
+};
+
+static int
+callback (struct callback_locals *locals, uintptr_t start, uintptr_t end)
+{
+# if STACK_DIRECTION < 0
+  if (locals->address >= start && locals->address <= end - 1)
+    {
+      locals->vma->start = start;
+      locals->vma->end = end;
+      locals->vma->prev_end = locals->prev;
+      locals->retval = 0;
+      return 1;
+    }
+  locals->prev = end;
+# else
+  if (locals->stop_at_next_vma)
+    {
+      locals->vma->next_start = start;
+      locals->stop_at_next_vma = 0;
+      return 1;
+    }
+  if (locals->address >= start && locals->address <= end - 1)
+    {
+      locals->vma->start = start;
+      locals->vma->end = end;
+      locals->retval = 0;
+      locals->stop_at_next_vma = 1;
+      return 0;
+    }
+# endif
+  return 0;
+}
+
+/* Iterate over the virtual memory areas of the current process.
+   If such iteration is supported, the callback is called once for every
+   virtual memory area, in ascending order, with the following arguments:
+     - LOCALS is the same argument as passed to vma_iterate.
+     - START is the address of the first byte in the area, page-aligned.
+     - END is the address of the last byte in the area plus 1, page-aligned.
+       Note that it may be 0 for the last area in the address space.
+   If the callback returns 0, the iteration continues.  If it returns 1,
+   the iteration terminates prematurely.
+   This function may open file descriptors, but does not call malloc().
+   Return 0 if all went well, or -1 in case of error.  */
+/* This code is a simplied copy (no handling of protection flags) of the
+   code in gnulib's lib/vma-iter.c.  */
+static int
+vma_iterate (struct callback_locals *locals)
+{
+  /* Note: Solaris <sys/procfs.h> defines a different type prmap_t with
+     _STRUCTURED_PROC than without! Here's a table of sizeof(prmap_t):
+                                  32-bit   64-bit
+         _STRUCTURED_PROC = 0       32       56
+         _STRUCTURED_PROC = 1       96      104
+     Therefore, if the include files provide the newer API, prmap_t has
+     the bigger size, and thus you MUST use the newer API.  And if the
+     include files provide the older API, prmap_t has the smaller size,
+     and thus you MUST use the older API.  */
+
+# if defined PIOCNMAP && defined PIOCMAP
+  /* We must use the older /proc interface.  */
+
+  char fnamebuf[6+10+1];
+  char *fname;
+  int fd;
+  int nmaps;
+  size_t memneed;
+#  if HAVE_MAP_ANONYMOUS
+#   define zero_fd -1
+#   define map_flags MAP_ANONYMOUS
+#  else /* !HAVE_MAP_ANONYMOUS */
+  int zero_fd;
+#   define map_flags 0
+#  endif
+  void *auxmap;
+  uintptr_t auxmap_start;
+  uintptr_t auxmap_end;
+  prmap_t* maps;
+  prmap_t* mp;
+
+  if (pagesize == 0)
+    init_pagesize ();
+
+  /* Construct fname = sprintf (fnamebuf+i, "/proc/%u", getpid ()).  */
+  fname = fnamebuf + sizeof (fnamebuf) - 1;
+  *fname = '\0';
+  {
+    unsigned int value = getpid ();
+    do
+      *--fname = (value % 10) + '0';
+    while ((value = value / 10) > 0);
+  }
+  fname -= 6;
+  memcpy (fname, "/proc/", 6);
+
+  fd = open (fname, O_RDONLY);
+  if (fd < 0)
+    return -1;
+
+  if (ioctl (fd, PIOCNMAP, &nmaps) < 0)
+    goto fail2;
+
+  memneed = (nmaps + 10) * sizeof (prmap_t);
+  /* Allocate memneed bytes of memory.
+     We cannot use alloca here, because not much stack space is guaranteed.
+     We also cannot use malloc here, because a malloc() call may call mmap()
+     and thus pre-allocate available memory.
+     So use mmap(), and ignore the resulting VMA.  */
+  memneed = ((memneed - 1) / pagesize + 1) * pagesize;
+#  if !HAVE_MAP_ANONYMOUS
+  zero_fd = open ("/dev/zero", O_RDONLY, 0644);
+  if (zero_fd < 0)
+    goto fail2;
+#  endif
+  auxmap = (void *) mmap ((void *) 0, memneed, PROT_READ | PROT_WRITE,
+                          map_flags | MAP_PRIVATE, zero_fd, 0);
+#  if !HAVE_MAP_ANONYMOUS
+  close (zero_fd);
+#  endif
+  if (auxmap == (void *) -1)
+    goto fail2;
+  auxmap_start = (uintptr_t) auxmap;
+  auxmap_end = auxmap_start + memneed;
+  maps = (prmap_t *) auxmap;
+
+  if (ioctl (fd, PIOCMAP, maps) < 0)
+    goto fail1;
+
+  for (mp = maps;;)
+    {
+      uintptr_t start, end;
+
+      start = (uintptr_t) mp->pr_vaddr;
+      end = start + mp->pr_size;
+      if (start == 0 && end == 0)
+        break;
+      mp++;
+      if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+        {
+          /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+             = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+          if (start < auxmap_start)
+            if (callback (locals, start, auxmap_start))
+              break;
+          if (auxmap_end - 1 < end - 1)
+            if (callback (locals, auxmap_end, end))
+              break;
+        }
+      else
+        {
+          if (callback (locals, start, end))
+            break;
+        }
+    }
+  munmap (auxmap, memneed);
+  close (fd);
+  return 0;
+
+ fail1:
+  munmap (auxmap, memneed);
+ fail2:
+  close (fd);
+  return -1;
+
+# else
+  /* We must use the newer /proc interface.
+     Documentation:
+     https://docs.oracle.com/cd/E23824_01/html/821-1473/proc-4.html
+     The contents of /proc/<pid>/map consists of records of type
+     prmap_t.  These are different in 32-bit and 64-bit processes,
+     but here we are fortunately accessing only the current process.  */
+
+  char fnamebuf[6+10+4+1];
+  char *fname;
+  int fd;
+  int nmaps;
+  size_t memneed;
+#  if HAVE_MAP_ANONYMOUS
+#   define zero_fd -1
+#   define map_flags MAP_ANONYMOUS
+#  else /* !HAVE_MAP_ANONYMOUS */
+  int zero_fd;
+#   define map_flags 0
+#  endif
+  void *auxmap;
+  uintptr_t auxmap_start;
+  uintptr_t auxmap_end;
+  prmap_t* maps;
+  prmap_t* maps_end;
+  prmap_t* mp;
+
+  if (pagesize == 0)
+    init_pagesize ();
+
+  /* Construct fname = sprintf (fnamebuf+i, "/proc/%u/map", getpid ()).  */
+  fname = fnamebuf + sizeof (fnamebuf) - 1 - 4;
+  memcpy (fname, "/map", 4 + 1);
+  {
+    unsigned int value = getpid ();
+    do
+      *--fname = (value % 10) + '0';
+    while ((value = value / 10) > 0);
+  }
+  fname -= 6;
+  memcpy (fname, "/proc/", 6);
+
+  fd = open (fname, O_RDONLY);
+  if (fd < 0)
+    return -1;
+
+  {
+    struct stat statbuf;
+    if (fstat (fd, &statbuf) < 0)
+      goto fail2;
+    nmaps = statbuf.st_size / sizeof (prmap_t);
+  }
+
+  memneed = (nmaps + 10) * sizeof (prmap_t);
+  /* Allocate memneed bytes of memory.
+     We cannot use alloca here, because not much stack space is guaranteed.
+     We also cannot use malloc here, because a malloc() call may call mmap()
+     and thus pre-allocate available memory.
+     So use mmap(), and ignore the resulting VMA.  */
+  memneed = ((memneed - 1) / pagesize + 1) * pagesize;
+#  if !HAVE_MAP_ANONYMOUS
+  zero_fd = open ("/dev/zero", O_RDONLY, 0644);
+  if (zero_fd < 0)
+    goto fail2;
+#  endif
+  auxmap = (void *) mmap ((void *) 0, memneed, PROT_READ | PROT_WRITE,
+                          map_flags | MAP_PRIVATE, zero_fd, 0);
+#  if !HAVE_MAP_ANONYMOUS
+  close (zero_fd);
+#  endif
+  if (auxmap == (void *) -1)
+    goto fail2;
+  auxmap_start = (uintptr_t) auxmap;
+  auxmap_end = auxmap_start + memneed;
+  maps = (prmap_t *) auxmap;
+
+  /* Read up to memneed bytes from fd into maps.  */
+  {
+    size_t remaining = memneed;
+    size_t total_read = 0;
+    char *ptr = (char *) maps;
+
+    do
+      {
+        size_t nread = read (fd, ptr, remaining);
+        if (nread == (size_t)-1)
+          {
+            if (errno == EINTR)
+              continue;
+            goto fail1;
+          }
+        if (nread == 0)
+          /* EOF */
+          break;
+        total_read += nread;
+        ptr += nread;
+        remaining -= nread;
+      }
+    while (remaining > 0);
+
+    nmaps = (memneed - remaining) / sizeof (prmap_t);
+    maps_end = maps + nmaps;
+  }
+
+  for (mp = maps; mp < maps_end; mp++)
+    {
+      uintptr_t start, end;
+
+      start = (uintptr_t) mp->pr_vaddr;
+      end = start + mp->pr_size;
+      if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+        {
+          /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+             = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+          if (start < auxmap_start)
+            if (callback (locals, start, auxmap_start))
+              break;
+          if (auxmap_end - 1 < end - 1)
+            if (callback (locals, auxmap_end, end))
+              break;
+        }
+      else
+        {
+          if (callback (locals, start, end))
+            break;
+        }
+    }
+  munmap (auxmap, memneed);
+  close (fd);
+  return 0;
+
+ fail1:
+  munmap (auxmap, memneed);
+ fail2:
+  close (fd);
+  return -1;
+
+# endif
+}
+
+int
+sigsegv_get_vma (uintptr_t address, struct vma_struct *vma)
+{
+  struct callback_locals locals;
+  locals.address = address;
+  locals.vma = vma;
+# if STACK_DIRECTION < 0
+  locals.prev = 0;
+# else
+  locals.stop_at_next_vma = 0;
+# endif
+  locals.retval = -1;
+
+  vma_iterate (&locals);
+  if (locals.retval == 0)
+    {
+# if !(STACK_DIRECTION < 0)
+      if (locals.stop_at_next_vma)
+        vma->next_start = 0;
+# endif
+      vma->is_near_this = simple_is_near_this;
+      return 0;
+    }
+
+# if defined __sun
+  return mincore_get_vma (address, vma);
+# else
+  return -1;
+# endif
+}
+
+/* -------------------------------------------------------------------------- */
+
+#elif defined __CYGWIN__ /* Cygwin */
+
+struct callback_locals
+{
+  uintptr_t address;
+  struct vma_struct *vma;
+  /* The stack appears as three adjacents segments, therefore we
+     merge adjacent segments.  */
+  uintptr_t curr_start, curr_end;
+# if STACK_DIRECTION < 0
+  uintptr_t prev_end;
+# else
+  int stop_at_next_vma;
+# endif
+  int retval;
+};
+
+static int
+callback (struct callback_locals *locals, uintptr_t start, uintptr_t end)
+{
+  if (start == locals->curr_end)
+    {
+      /* Merge adjacent segments.  */
+      locals->curr_end = end;
+      return 0;
+    }
+# if STACK_DIRECTION < 0
+  if (locals->curr_start < locals->curr_end
+      && locals->address >= locals->curr_start
+      && locals->address <= locals->curr_end - 1)
+    {
+      locals->vma->start = locals->curr_start;
+      locals->vma->end = locals->curr_end;
+      locals->vma->prev_end = locals->prev_end;
+      locals->retval = 0;
+      return 1;
+    }
+  locals->prev_end = locals->curr_end;
+# else
+  if (locals->stop_at_next_vma)
+    {
+      locals->vma->next_start = locals->curr_start;
+      locals->stop_at_next_vma = 0;
+      return 1;
+    }
+  if (locals->curr_start < locals->curr_end
+      && locals->address >= locals->curr_start
+      && locals->address <= locals->curr_end - 1)
+    {
+      locals->vma->start = locals->curr_start;
+      locals->vma->end = locals->curr_end;
+      locals->retval = 0;
+      locals->stop_at_next_vma = 1;
+      return 0;
+    }
+# endif
+  locals->curr_start = start; locals->curr_end = end;
+  return 0;
+}
+
+int
+sigsegv_get_vma (uintptr_t address, struct vma_struct *vma)
+{
+  struct callback_locals locals;
+  locals.address = address;
+  locals.vma = vma;
+  locals.curr_start = 0;
+  locals.curr_end = 0;
+# if STACK_DIRECTION < 0
+  locals.prev_end = 0;
+# else
+  locals.stop_at_next_vma = 0;
+# endif
+  locals.retval = -1;
+
+  vma_iterate (&locals);
+  if (locals.retval < 0)
+    {
+      if (locals.curr_start < locals.curr_end
+          && address >= locals.curr_start && address <= locals.curr_end - 1)
+        {
+          vma->start = locals.curr_start;
+          vma->end = locals.curr_end;
+# if STACK_DIRECTION < 0
+          vma->prev_end = locals.prev_end;
+# else
+          vma->next_start = 0;
+# endif
+          locals.retval = 0;
+        }
+    }
+  if (locals.retval == 0)
+    {
+# if !(STACK_DIRECTION < 0)
+      if (locals.stop_at_next_vma)
+        vma->next_start = 0;
+# endif
+      vma->is_near_this = simple_is_near_this;
+      return 0;
+    }
+
+  return -1;
+}
+
+/* ---------------------------- stackvma-beos.h ---------------------------- */
+
+#elif defined __HAIKU__ /* Haiku */
+
+# include <OS.h> /* get_next_area_info */
+
+struct callback_locals
+{
+  uintptr_t address;
+  struct vma_struct *vma;
+# if STACK_DIRECTION < 0
+  uintptr_t prev;
+# else
+  int stop_at_next_vma;
+# endif
+  int retval;
+};
+
+static int
+callback (struct callback_locals *locals, uintptr_t start, uintptr_t end)
+{
+# if STACK_DIRECTION < 0
+  if (locals->address >= start && locals->address <= end - 1)
+    {
+      locals->vma->start = start;
+      locals->vma->end = end;
+      locals->vma->prev_end = locals->prev;
+      locals->retval = 0;
+      return 1;
+    }
+  locals->prev = end;
+# else
+  if (locals->stop_at_next_vma)
+    {
+      locals->vma->next_start = start;
+      locals->stop_at_next_vma = 0;
+      return 1;
+    }
+  if (locals->address >= start && locals->address <= end - 1)
+    {
+      locals->vma->start = start;
+      locals->vma->end = end;
+      locals->retval = 0;
+      locals->stop_at_next_vma = 1;
+      return 0;
+    }
+# endif
+  return 0;
+}
+
+/* Iterate over the virtual memory areas of the current process.
+   If such iteration is supported, the callback is called once for every
+   virtual memory area, in ascending order, with the following arguments:
+     - LOCALS is the same argument as passed to vma_iterate.
+     - START is the address of the first byte in the area, page-aligned.
+     - END is the address of the last byte in the area plus 1, page-aligned.
+       Note that it may be 0 for the last area in the address space.
+   If the callback returns 0, the iteration continues.  If it returns 1,
+   the iteration terminates prematurely.
+   This function may open file descriptors, but does not call malloc().
+   Return 0 if all went well, or -1 in case of error.  */
+/* This code is a simplied copy (no handling of protection flags) of the
+   code in gnulib's lib/vma-iter.c.  */
+static int
+vma_iterate (struct callback_locals *locals)
+{
+  area_info info;
+  ssize_t cookie;
+
+  cookie = 0;
+  while (get_next_area_info (0, &cookie, &info) == B_OK)
+    {
+      uintptr_t start, end;
+
+      start = (uintptr_t) info.address;
+      end = start + info.size;
+
+      if (callback (locals, start, end))
+        break;
+    }
+  return 0;
+}
+
+int
+sigsegv_get_vma (uintptr_t address, struct vma_struct *vma)
+{
+  struct callback_locals locals;
+  locals.address = address;
+  locals.vma = vma;
+# if STACK_DIRECTION < 0
+  locals.prev = 0;
+# else
+  locals.stop_at_next_vma = 0;
+# endif
+  locals.retval = -1;
+
+  vma_iterate (&locals);
+  if (locals.retval == 0)
+    {
+# if !(STACK_DIRECTION < 0)
+      if (locals.stop_at_next_vma)
+        vma->next_start = 0;
+# endif
+      vma->is_near_this = simple_is_near_this;
+      return 0;
+    }
+  return -1;
+}
+
+/* -------------------------------------------------------------------------- */
+
+#else /* Hurd, Minix, ... */
+
+int
+sigsegv_get_vma (uintptr_t address, struct vma_struct *vma)
+{
+  /* No way.  */
+  return -1;
+}
+
+#endif
diff --git a/lib/stackvma.h b/lib/stackvma.h
new file mode 100644 (file)
index 0000000..6912488
--- /dev/null
@@ -0,0 +1,60 @@
+/* Determine the virtual memory area of a given address.
+   Copyright (C) 2002-2021  Bruno Haible <bruno@clisp.org>
+   Copyright (C) 2003-2006  Paolo Bonzini <bonzini@gnu.org>
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _STACKVMA_H
+#define _STACKVMA_H
+
+#include <stdint.h>
+
+/* Describes a virtual memory area, with some info about the gap between
+   it and the next or previous virtual memory area.  */
+struct vma_struct
+{
+  uintptr_t start;
+  uintptr_t end;
+#if STACK_DIRECTION < 0
+  /* Info about the gap between this VMA and the previous one.
+     addr must be < vma->start.  */
+  int (*is_near_this) (uintptr_t addr, struct vma_struct *vma);
+  /* Private field, not provided by all sigsegv_get_vma implementations.  */
+  uintptr_t prev_end;
+#endif
+#if STACK_DIRECTION > 0
+  /* Info about the gap between this VMA and the next one.
+     addr must be > vma->end - 1.  */
+  int (*is_near_this) (uintptr_t addr, struct vma_struct *vma);
+  /* Private field, not provided by all sigsegv_get_vma implementations.  */
+  uintptr_t next_start;
+#endif
+};
+
+/* Determines the virtual memory area to which a given address belongs,
+   and returns 0.  Returns -1 if it cannot be determined.
+   This function is used to determine the stack extent when a fault occurs.  */
+extern int sigsegv_get_vma (uintptr_t address, struct vma_struct *vma);
+
+/* Defined if sigsegv_get_vma actually works (i.e. does not always fail).  */
+#if defined __linux__ || defined __ANDROID__ \
+    || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ \
+    || defined __NetBSD__ || defined __OpenBSD__ \
+    || (defined __APPLE__ && defined __MACH__) \
+    || defined _AIX || defined __sgi || defined __sun \
+    || defined __CYGWIN__ || defined __HAIKU__
+# define HAVE_STACKVMA 1
+#endif
+
+#endif /* _STACKVMA_H */
diff --git a/lib/stat-time.c b/lib/stat-time.c
new file mode 100644 (file)
index 0000000..81b83dd
--- /dev/null
@@ -0,0 +1,3 @@
+#include <config.h>
+#define _GL_STAT_TIME_INLINE _GL_EXTERN_INLINE
+#include "stat-time.h"
diff --git a/lib/stat-time.h b/lib/stat-time.h
new file mode 100644 (file)
index 0000000..523ed21
--- /dev/null
@@ -0,0 +1,252 @@
+/* stat-related time functions.
+
+   Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#ifndef STAT_TIME_H
+#define STAT_TIME_H 1
+
+#include "intprops.h"
+
+#include <errno.h>
+#include <stddef.h>
+#include <sys/stat.h>
+#include <time.h>
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_STAT_TIME_INLINE
+# define _GL_STAT_TIME_INLINE _GL_INLINE
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* STAT_TIMESPEC (ST, ST_XTIM) is the ST_XTIM member for *ST of type
+   struct timespec, if available.  If not, then STAT_TIMESPEC_NS (ST,
+   ST_XTIM) is the nanosecond component of the ST_XTIM member for *ST,
+   if available.  ST_XTIM can be st_atim, st_ctim, st_mtim, or st_birthtim
+   for access, status change, data modification, or birth (creation)
+   time respectively.
+
+   These macros are private to stat-time.h.  */
+#if _GL_WINDOWS_STAT_TIMESPEC || defined HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
+# if _GL_WINDOWS_STAT_TIMESPEC || defined TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
+#  define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim)
+# else
+#  define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.tv_nsec)
+# endif
+#elif defined HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
+# define STAT_TIMESPEC(st, st_xtim) ((st)->st_xtim##espec)
+#elif defined HAVE_STRUCT_STAT_ST_ATIMENSEC
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim##ensec)
+#elif defined HAVE_STRUCT_STAT_ST_ATIM_ST__TIM_TV_NSEC
+# define STAT_TIMESPEC_NS(st, st_xtim) ((st)->st_xtim.st__tim.tv_nsec)
+#endif
+
+/* Return the nanosecond component of *ST's access time.  */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_atime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+  return STAT_TIMESPEC (st, st_atim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+  return STAT_TIMESPEC_NS (st, st_atim);
+# else
+  return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's status change time.  */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_ctime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+  return STAT_TIMESPEC (st, st_ctim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+  return STAT_TIMESPEC_NS (st, st_ctim);
+# else
+  return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's data modification time.  */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_mtime_ns (struct stat const *st)
+{
+# if defined STAT_TIMESPEC
+  return STAT_TIMESPEC (st, st_mtim).tv_nsec;
+# elif defined STAT_TIMESPEC_NS
+  return STAT_TIMESPEC_NS (st, st_mtim);
+# else
+  return 0;
+# endif
+}
+
+/* Return the nanosecond component of *ST's birth time.  */
+_GL_STAT_TIME_INLINE long int _GL_ATTRIBUTE_PURE
+get_stat_birthtime_ns (struct stat const *st _GL_UNUSED)
+{
+# if defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC
+  return STAT_TIMESPEC (st, st_birthtim).tv_nsec;
+# elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+  return STAT_TIMESPEC_NS (st, st_birthtim);
+# else
+  return 0;
+# endif
+}
+
+/* Return *ST's access time.  */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_atime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+  return STAT_TIMESPEC (st, st_atim);
+#else
+  struct timespec t;
+  t.tv_sec = st->st_atime;
+  t.tv_nsec = get_stat_atime_ns (st);
+  return t;
+#endif
+}
+
+/* Return *ST's status change time.  */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_ctime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+  return STAT_TIMESPEC (st, st_ctim);
+#else
+  struct timespec t;
+  t.tv_sec = st->st_ctime;
+  t.tv_nsec = get_stat_ctime_ns (st);
+  return t;
+#endif
+}
+
+/* Return *ST's data modification time.  */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_mtime (struct stat const *st)
+{
+#ifdef STAT_TIMESPEC
+  return STAT_TIMESPEC (st, st_mtim);
+#else
+  struct timespec t;
+  t.tv_sec = st->st_mtime;
+  t.tv_nsec = get_stat_mtime_ns (st);
+  return t;
+#endif
+}
+
+/* Return *ST's birth time, if available; otherwise return a value
+   with tv_sec and tv_nsec both equal to -1.  */
+_GL_STAT_TIME_INLINE struct timespec _GL_ATTRIBUTE_PURE
+get_stat_birthtime (struct stat const *st _GL_UNUSED)
+{
+  struct timespec t;
+
+#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
+     || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC)
+  t = STAT_TIMESPEC (st, st_birthtim);
+#elif defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC
+  t.tv_sec = st->st_birthtime;
+  t.tv_nsec = st->st_birthtimensec;
+#elif defined _WIN32 && ! defined __CYGWIN__
+  /* Native Windows platforms (but not Cygwin) put the "file creation
+     time" in st_ctime (!).  See
+     <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/stat-functions>.  */
+# if _GL_WINDOWS_STAT_TIMESPEC
+  t = st->st_ctim;
+# else
+  t.tv_sec = st->st_ctime;
+  t.tv_nsec = 0;
+# endif
+#else
+  /* Birth time is not supported.  */
+  t.tv_sec = -1;
+  t.tv_nsec = -1;
+#endif
+
+#if (defined HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC \
+     || defined HAVE_STRUCT_STAT_ST_BIRTHTIM_TV_NSEC \
+     || defined HAVE_STRUCT_STAT_ST_BIRTHTIMENSEC)
+  /* FreeBSD and NetBSD sometimes signal the absence of knowledge by
+     using zero.  Attempt to work around this problem.  Alas, this can
+     report failure even for valid timestamps.  Also, NetBSD
+     sometimes returns junk in the birth time fields; work around this
+     bug if it is detected.  */
+  if (! (t.tv_sec && 0 <= t.tv_nsec && t.tv_nsec < 1000000000))
+    {
+      t.tv_sec = -1;
+      t.tv_nsec = -1;
+    }
+#endif
+
+  return t;
+}
+
+/* If a stat-like function returned RESULT, normalize the timestamps
+   in *ST, in case this platform suffers from the Solaris 11 bug where
+   tv_nsec might be negative.  Return the adjusted RESULT, setting
+   errno to EOVERFLOW if normalization overflowed.  This function
+   is intended to be private to this .h file.  */
+_GL_STAT_TIME_INLINE int
+stat_time_normalize (int result, struct stat *st _GL_UNUSED)
+{
+#if defined __sun && defined STAT_TIMESPEC
+  if (result == 0)
+    {
+      long int timespec_hz = 1000000000;
+      short int const ts_off[] = { offsetof (struct stat, st_atim),
+                                   offsetof (struct stat, st_mtim),
+                                   offsetof (struct stat, st_ctim) };
+      int i;
+      for (i = 0; i < sizeof ts_off / sizeof *ts_off; i++)
+        {
+          struct timespec *ts = (struct timespec *) ((char *) st + ts_off[i]);
+          long int q = ts->tv_nsec / timespec_hz;
+          long int r = ts->tv_nsec % timespec_hz;
+          if (r < 0)
+            {
+              r += timespec_hz;
+              q--;
+            }
+          ts->tv_nsec = r;
+          /* Overflow is possible, as Solaris 11 stat can yield
+             tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -1000000000.
+             INT_ADD_WRAPV is OK, since time_t is signed on Solaris.  */
+          if (INT_ADD_WRAPV (q, ts->tv_sec, &ts->tv_sec))
+            {
+              errno = EOVERFLOW;
+              return -1;
+            }
+        }
+    }
+#endif
+  return result;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif
diff --git a/lib/stat-w32.c b/lib/stat-w32.c
new file mode 100644 (file)
index 0000000..914707e
--- /dev/null
@@ -0,0 +1,461 @@
+/* Core of implementation of fstat and stat for native Windows.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible.  */
+
+#include <config.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+
+/* Attempt to make <windows.h> define FILE_ID_INFO.
+   But ensure that the redefinition of _WIN32_WINNT does not make us assume
+   Windows Vista or newer when building for an older version of Windows.  */
+#if HAVE_SDKDDKVER_H
+# include <sdkddkver.h>
+# if _WIN32_WINNT >= _WIN32_WINNT_VISTA
+#  define WIN32_ASSUME_VISTA 1
+# else
+#  define WIN32_ASSUME_VISTA 0
+# endif
+# if !defined _WIN32_WINNT || (_WIN32_WINNT < _WIN32_WINNT_WIN8)
+#  undef _WIN32_WINNT
+#  define _WIN32_WINNT _WIN32_WINNT_WIN8
+# endif
+#else
+# define WIN32_ASSUME_VISTA (_WIN32_WINNT >= _WIN32_WINNT_VISTA)
+#endif
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <errno.h>
+#include <limits.h>
+#include <string.h>
+#include <unistd.h>
+#include <windows.h>
+
+/* Specification.  */
+#include "stat-w32.h"
+
+#include "pathmax.h"
+#include "verify.h"
+
+/* Don't assume that UNICODE is not defined.  */
+#undef LoadLibrary
+#define LoadLibrary LoadLibraryA
+#undef GetFinalPathNameByHandle
+#define GetFinalPathNameByHandle GetFinalPathNameByHandleA
+
+/* Older mingw headers do not define VOLUME_NAME_NONE.  */
+#ifndef VOLUME_NAME_NONE
+# define VOLUME_NAME_NONE 4
+#endif
+
+#if !WIN32_ASSUME_VISTA
+
+/* Avoid warnings from gcc -Wcast-function-type.  */
+# define GetProcAddress \
+   (void *) GetProcAddress
+
+# if _GL_WINDOWS_STAT_INODES == 2
+/* GetFileInformationByHandleEx was introduced only in Windows Vista.  */
+typedef DWORD (WINAPI * GetFileInformationByHandleExFuncType) (HANDLE hFile,
+                                                               FILE_INFO_BY_HANDLE_CLASS fiClass,
+                                                               LPVOID lpBuffer,
+                                                               DWORD dwBufferSize);
+static GetFileInformationByHandleExFuncType GetFileInformationByHandleExFunc = NULL;
+# endif
+/* GetFinalPathNameByHandle was introduced only in Windows Vista.  */
+typedef DWORD (WINAPI * GetFinalPathNameByHandleFuncType) (HANDLE hFile,
+                                                           LPSTR lpFilePath,
+                                                           DWORD lenFilePath,
+                                                           DWORD dwFlags);
+static GetFinalPathNameByHandleFuncType GetFinalPathNameByHandleFunc = NULL;
+static BOOL initialized = FALSE;
+
+static void
+initialize (void)
+{
+  HMODULE kernel32 = LoadLibrary ("kernel32.dll");
+  if (kernel32 != NULL)
+    {
+# if _GL_WINDOWS_STAT_INODES == 2
+      GetFileInformationByHandleExFunc =
+        (GetFileInformationByHandleExFuncType) GetProcAddress (kernel32, "GetFileInformationByHandleEx");
+# endif
+      GetFinalPathNameByHandleFunc =
+        (GetFinalPathNameByHandleFuncType) GetProcAddress (kernel32, "GetFinalPathNameByHandleA");
+    }
+  initialized = TRUE;
+}
+
+#else
+
+# define GetFileInformationByHandleExFunc GetFileInformationByHandleEx
+# define GetFinalPathNameByHandleFunc GetFinalPathNameByHandle
+
+#endif
+
+/* Converts a FILETIME to GMT time since 1970-01-01 00:00:00.  */
+#if _GL_WINDOWS_STAT_TIMESPEC
+struct timespec
+_gl_convert_FILETIME_to_timespec (const FILETIME *ft)
+{
+  struct timespec result;
+  /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+  unsigned long long since_1601 =
+    ((unsigned long long) ft->dwHighDateTime << 32)
+    | (unsigned long long) ft->dwLowDateTime;
+  if (since_1601 == 0)
+    {
+      result.tv_sec = 0;
+      result.tv_nsec = 0;
+    }
+  else
+    {
+      /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89
+         leap years, in total 134774 days.  */
+      unsigned long long since_1970 =
+        since_1601 - (unsigned long long) 134774 * (unsigned long long) 86400 * (unsigned long long) 10000000;
+      result.tv_sec = since_1970 / (unsigned long long) 10000000;
+      result.tv_nsec = (unsigned long) (since_1970 % (unsigned long long) 10000000) * 100;
+    }
+  return result;
+}
+#else
+time_t
+_gl_convert_FILETIME_to_POSIX (const FILETIME *ft)
+{
+  /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+  unsigned long long since_1601 =
+    ((unsigned long long) ft->dwHighDateTime << 32)
+    | (unsigned long long) ft->dwLowDateTime;
+  if (since_1601 == 0)
+    return 0;
+  else
+    {
+      /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89
+         leap years, in total 134774 days.  */
+      unsigned long long since_1970 =
+        since_1601 - (unsigned long long) 134774 * (unsigned long long) 86400 * (unsigned long long) 10000000;
+      return since_1970 / (unsigned long long) 10000000;
+    }
+}
+#endif
+
+/* Fill *BUF with information about the file designated by H.
+   PATH is the file name, if known, otherwise NULL.
+   Return 0 if successful, or -1 with errno set upon failure.  */
+int
+_gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf)
+{
+  /* GetFileType
+     <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfiletype> */
+  DWORD type = GetFileType (h);
+  if (type == FILE_TYPE_DISK)
+    {
+#if !WIN32_ASSUME_VISTA
+      if (!initialized)
+        initialize ();
+#endif
+
+      /* st_mode can be determined through
+         GetFileAttributesEx
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data>
+         or through
+         GetFileInformationByHandle
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+         or through
+         GetFileInformationByHandleEx with argument FileBasicInfo
+         <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_basic_info>
+         The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher.  */
+      BY_HANDLE_FILE_INFORMATION info;
+      if (! GetFileInformationByHandle (h, &info))
+        goto failed;
+
+      /* Test for error conditions before starting to fill *buf.  */
+      if (sizeof (buf->st_size) <= 4 && info.nFileSizeHigh > 0)
+        {
+          errno = EOVERFLOW;
+          return -1;
+        }
+
+#if _GL_WINDOWS_STAT_INODES
+      /* st_ino can be determined through
+         GetFileInformationByHandle
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+         as 64 bits, or through
+         GetFileInformationByHandleEx with argument FileIdInfo
+         <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_id_info>
+         as 128 bits.
+         The latter requires -D_WIN32_WINNT=_WIN32_WINNT_WIN8 or higher.  */
+      /* Experiments show that GetFileInformationByHandleEx does not provide
+         much more information than GetFileInformationByHandle:
+           * The dwVolumeSerialNumber from GetFileInformationByHandle is equal
+             to the low 32 bits of the 64-bit VolumeSerialNumber from
+             GetFileInformationByHandleEx, and is apparently sufficient for
+             identifying the device.
+           * The nFileIndex from GetFileInformationByHandle is equal to the low
+             64 bits of the 128-bit FileId from GetFileInformationByHandleEx,
+             and the high 64 bits of this 128-bit FileId are zero.
+           * On a FAT file system, GetFileInformationByHandleEx fails with error
+             ERROR_INVALID_PARAMETER, whereas GetFileInformationByHandle
+             succeeds.
+           * On a CIFS/SMB file system, GetFileInformationByHandleEx fails with
+             error ERROR_INVALID_LEVEL, whereas GetFileInformationByHandle
+             succeeds.  */
+# if _GL_WINDOWS_STAT_INODES == 2
+      if (GetFileInformationByHandleExFunc != NULL)
+        {
+          FILE_ID_INFO id;
+          if (GetFileInformationByHandleExFunc (h, FileIdInfo, &id, sizeof (id)))
+            {
+              buf->st_dev = id.VolumeSerialNumber;
+              verify (sizeof (ino_t) == sizeof (id.FileId));
+              memcpy (&buf->st_ino, &id.FileId, sizeof (ino_t));
+              goto ino_done;
+            }
+          else
+            {
+              switch (GetLastError ())
+                {
+                case ERROR_INVALID_PARAMETER: /* older Windows version, or FAT */
+                case ERROR_INVALID_LEVEL: /* CIFS/SMB file system */
+                  goto fallback;
+                default:
+                  goto failed;
+                }
+            }
+        }
+     fallback: ;
+      /* Fallback for older Windows versions.  */
+      buf->st_dev = info.dwVolumeSerialNumber;
+      buf->st_ino._gl_ino[0] = ((ULONGLONG) info.nFileIndexHigh << 32) | (ULONGLONG) info.nFileIndexLow;
+      buf->st_ino._gl_ino[1] = 0;
+     ino_done: ;
+# else /* _GL_WINDOWS_STAT_INODES == 1 */
+      buf->st_dev = info.dwVolumeSerialNumber;
+      buf->st_ino = ((ULONGLONG) info.nFileIndexHigh << 32) | (ULONGLONG) info.nFileIndexLow;
+# endif
+#else
+      /* st_ino is not wide enough for identifying a file on a device.
+         Without st_ino, st_dev is pointless.  */
+      buf->st_dev = 0;
+      buf->st_ino = 0;
+#endif
+
+      /* st_mode.  */
+      unsigned int mode =
+        /* XXX How to handle FILE_ATTRIBUTE_REPARSE_POINT ?  */
+        ((info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? _S_IFDIR | S_IEXEC_UGO : _S_IFREG)
+        | S_IREAD_UGO
+        | ((info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE_UGO);
+      if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
+        {
+          /* Determine whether the file is executable by looking at the file
+             name suffix.
+             If the file name is already known, use it. Otherwise, for
+             non-empty files, it can be determined through
+             GetFinalPathNameByHandle
+             <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfinalpathnamebyhandlea>
+             or through
+             GetFileInformationByHandleEx with argument FileNameInfo
+             <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+             <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_name_info>
+             Both require -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher.  */
+          if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0)
+            {
+              char fpath[PATH_MAX];
+              if (path != NULL
+                  || (GetFinalPathNameByHandleFunc != NULL
+                      && GetFinalPathNameByHandleFunc (h, fpath, sizeof (fpath), VOLUME_NAME_NONE)
+                         < sizeof (fpath)
+                      && (path = fpath, 1)))
+                {
+                  const char *last_dot = NULL;
+                  const char *p;
+                  for (p = path; *p != '\0'; p++)
+                    if (*p == '.')
+                      last_dot = p;
+                  if (last_dot != NULL)
+                    {
+                      const char *suffix = last_dot + 1;
+                      if (_stricmp (suffix, "exe") == 0
+                          || _stricmp (suffix, "bat") == 0
+                          || _stricmp (suffix, "cmd") == 0
+                          || _stricmp (suffix, "com") == 0)
+                        mode |= S_IEXEC_UGO;
+                    }
+                }
+              else
+                /* Cannot determine file name.  Pretend that it is executable.  */
+                mode |= S_IEXEC_UGO;
+            }
+        }
+      buf->st_mode = mode;
+
+      /* st_nlink can be determined through
+         GetFileInformationByHandle
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+         or through
+         GetFileInformationByHandleEx with argument FileStandardInfo
+         <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_standard_info>
+         The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher.  */
+      buf->st_nlink = (info.nNumberOfLinks > SHRT_MAX ? SHRT_MAX : info.nNumberOfLinks);
+
+      /* There's no easy way to map the Windows SID concept to an integer.  */
+      buf->st_uid = 0;
+      buf->st_gid = 0;
+
+      /* st_rdev is irrelevant for normal files and directories.  */
+      buf->st_rdev = 0;
+
+      /* st_size can be determined through
+         GetFileSizeEx
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfilesizeex>
+         or through
+         GetFileAttributesEx
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data>
+         or through
+         GetFileInformationByHandle
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+         or through
+         GetFileInformationByHandleEx with argument FileStandardInfo
+         <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_standard_info>
+         The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher.  */
+      if (sizeof (buf->st_size) <= 4)
+        /* Range check already done above.  */
+        buf->st_size = info.nFileSizeLow;
+      else
+        buf->st_size = ((long long) info.nFileSizeHigh << 32) | (long long) info.nFileSizeLow;
+
+      /* st_atime, st_mtime, st_ctime can be determined through
+         GetFileTime
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfiletime>
+         or through
+         GetFileAttributesEx
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileattributesexa>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_win32_file_attribute_data>
+         or through
+         GetFileInformationByHandle
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-getfileinformationbyhandle>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/ns-fileapi-_by_handle_file_information>
+         or through
+         GetFileInformationByHandleEx with argument FileBasicInfo
+         <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/nf-winbase-getfileinformationbyhandleex>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_file_basic_info>
+         The latter requires -D_WIN32_WINNT=_WIN32_WINNT_VISTA or higher.  */
+#if _GL_WINDOWS_STAT_TIMESPEC
+      buf->st_atim = _gl_convert_FILETIME_to_timespec (&info.ftLastAccessTime);
+      buf->st_mtim = _gl_convert_FILETIME_to_timespec (&info.ftLastWriteTime);
+      buf->st_ctim = _gl_convert_FILETIME_to_timespec (&info.ftCreationTime);
+#else
+      buf->st_atime = _gl_convert_FILETIME_to_POSIX (&info.ftLastAccessTime);
+      buf->st_mtime = _gl_convert_FILETIME_to_POSIX (&info.ftLastWriteTime);
+      buf->st_ctime = _gl_convert_FILETIME_to_POSIX (&info.ftCreationTime);
+#endif
+
+      return 0;
+    }
+  else if (type == FILE_TYPE_CHAR || type == FILE_TYPE_PIPE)
+    {
+      buf->st_dev = 0;
+#if _GL_WINDOWS_STAT_INODES == 2
+      buf->st_ino._gl_ino[0] = buf->st_ino._gl_ino[1] = 0;
+#else
+      buf->st_ino = 0;
+#endif
+      buf->st_mode = (type == FILE_TYPE_PIPE ? _S_IFIFO : _S_IFCHR);
+      buf->st_nlink = 1;
+      buf->st_uid = 0;
+      buf->st_gid = 0;
+      buf->st_rdev = 0;
+      if (type == FILE_TYPE_PIPE)
+        {
+          /* PeekNamedPipe
+             <https://msdn.microsoft.com/en-us/library/aa365779.aspx> */
+          DWORD bytes_available;
+          if (PeekNamedPipe (h, NULL, 0, NULL, &bytes_available, NULL))
+            buf->st_size = bytes_available;
+          else
+            buf->st_size = 0;
+        }
+      else
+        buf->st_size = 0;
+#if _GL_WINDOWS_STAT_TIMESPEC
+      buf->st_atim.tv_sec = 0; buf->st_atim.tv_nsec = 0;
+      buf->st_mtim.tv_sec = 0; buf->st_mtim.tv_nsec = 0;
+      buf->st_ctim.tv_sec = 0; buf->st_ctim.tv_nsec = 0;
+#else
+      buf->st_atime = 0;
+      buf->st_mtime = 0;
+      buf->st_ctime = 0;
+#endif
+      return 0;
+    }
+  else
+    {
+      errno = ENOENT;
+      return -1;
+    }
+
+ failed:
+  {
+    DWORD error = GetLastError ();
+    #if 0
+    fprintf (stderr, "_gl_fstat_by_handle error 0x%x\n", (unsigned int) error);
+    #endif
+    switch (error)
+      {
+      case ERROR_ACCESS_DENIED:
+      case ERROR_SHARING_VIOLATION:
+        errno = EACCES;
+        break;
+
+      case ERROR_OUTOFMEMORY:
+        errno = ENOMEM;
+        break;
+
+      case ERROR_WRITE_FAULT:
+      case ERROR_READ_FAULT:
+      case ERROR_GEN_FAILURE:
+        errno = EIO;
+        break;
+
+      default:
+        errno = EINVAL;
+        break;
+      }
+    return -1;
+  }
+}
+
+#else
+
+/* This declaration is solely to ensure that after preprocessing
+   this file is never empty.  */
+typedef int dummy;
+
+#endif
diff --git a/lib/stat-w32.h b/lib/stat-w32.h
new file mode 100644 (file)
index 0000000..27b4e47
--- /dev/null
@@ -0,0 +1,37 @@
+/* Core of implementation of fstat and stat for native Windows.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _STAT_W32_H
+#define _STAT_W32_H 1
+
+/* Converts a FILETIME to GMT time since 1970-01-01 00:00:00.  */
+#if _GL_WINDOWS_STAT_TIMESPEC
+extern struct timespec _gl_convert_FILETIME_to_timespec (const FILETIME *ft);
+#else
+extern time_t _gl_convert_FILETIME_to_POSIX (const FILETIME *ft);
+#endif
+
+/* Fill *BUF with information about the file designated by H.
+   PATH is the file name, if known, otherwise NULL.
+   Return 0 if successful, or -1 with errno set upon failure.  */
+extern int _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf);
+
+/* Bitmasks for st_mode.  */
+#define S_IREAD_UGO  (_S_IREAD | (_S_IREAD >> 3) | (_S_IREAD >> 6))
+#define S_IWRITE_UGO (_S_IWRITE | (_S_IWRITE >> 3) | (_S_IWRITE >> 6))
+#define S_IEXEC_UGO  (_S_IEXEC | (_S_IEXEC >> 3) | (_S_IEXEC >> 6))
+
+#endif /* _STAT_W32_H */
index 62e9e0b..505368f 100644 (file)
@@ -1,5 +1,5 @@
 /* Work around platform bugs in stat.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,9 +12,9 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-/* written by Eric Blake */
+/* Written by Eric Blake and Bruno Haible.  */
 
 /* If the user's config.h happens to include <sys/stat.h>, let it include only
    the system's <sys/stat.h> here, so that orig_stat doesn't recurse to
 #include <sys/stat.h>
 #undef __need_system_sys_stat_h
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-# if _GL_WINDOWS_64_BIT_ST_SIZE
-#  undef stat /* avoid warning on mingw64 with _FILE_OFFSET_BITS=64 */
-#  define stat _stati64
-#  define REPLACE_FUNC_STAT_DIR 1
-#  undef REPLACE_FUNC_STAT_FILE
-# elif REPLACE_FUNC_STAT_FILE
-/* mingw64 has a broken stat() function, based on _stat(), in libmingwex.a.
-   Bypass it.  */
-#  define stat _stat
-#  define REPLACE_FUNC_STAT_DIR 1
-#  undef REPLACE_FUNC_STAT_FILE
-# endif
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
 #endif
 
+#if !defined WINDOWS_NATIVE
+
 static int
 orig_stat (const char *filename, struct stat *buf)
 {
   return stat (filename, buf);
 }
 
+#endif
+
 /* Specification.  */
+#ifdef __osf__
 /* Write "sys/stat.h" here, not <sys/stat.h>, otherwise OSF/1 5.1 DTK cc
    eliminates this include because of the preliminary #include <sys/stat.h>
    above.  */
-#include "sys/stat.h"
+# include "sys/stat.h"
+#else
+# include <sys/stat.h>
+#endif
+
+#include "stat-time.h"
 
 #include <errno.h>
 #include <limits.h>
 #include <stdbool.h>
 #include <string.h>
-#include "dosname.h"
+#include "filename.h"
+#include "malloca.h"
 #include "verify.h"
 
-#if REPLACE_FUNC_STAT_DIR
-# include "pathmax.h"
-  /* The only known systems where REPLACE_FUNC_STAT_DIR is needed also
-     have a constant PATH_MAX.  */
-# ifndef PATH_MAX
-#  error "Please port this replacement to your platform"
-# endif
+#ifdef WINDOWS_NATIVE
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# include "stat-w32.h"
+/* Don't assume that UNICODE is not defined.  */
+# undef WIN32_FIND_DATA
+# define WIN32_FIND_DATA WIN32_FIND_DATAA
+# undef CreateFile
+# define CreateFile CreateFileA
+# undef FindFirstFile
+# define FindFirstFile FindFirstFileA
+#endif
+
+#ifdef WINDOWS_NATIVE
+/* Return TRUE if the given file name denotes an UNC root.  */
+static BOOL
+is_unc_root (const char *rname)
+{
+  /* Test whether it has the syntax '\\server\share'.  */
+  if (ISSLASH (rname[0]) && ISSLASH (rname[1]))
+    {
+      /* It starts with two slashes.  Find the next slash.  */
+      const char *p = rname + 2;
+      const char *q = p;
+      while (*q != '\0' && !ISSLASH (*q))
+        q++;
+      if (q > p && *q != '\0')
+        {
+          /* Found the next slash at q.  */
+          q++;
+          const char *r = q;
+          while (*r != '\0' && !ISSLASH (*r))
+            r++;
+          if (r > q && *r == '\0')
+            return TRUE;
+        }
+    }
+  return FALSE;
+}
 #endif
 
 /* Store information about NAME into ST.  Work around bugs with
@@ -77,62 +109,332 @@ orig_stat (const char *filename, struct stat *buf)
    correctly.  */
 
 int
-rpl_stat (char const *name, struct stat *st)
+rpl_stat (char const *name, struct stat *buf)
 {
-  int result = orig_stat (name, st);
-#if REPLACE_FUNC_STAT_FILE
-  /* Solaris 9 mistakenly succeeds when given a non-directory with a
-     trailing slash.  */
-  if (result == 0 && !S_ISDIR (st->st_mode))
+#ifdef WINDOWS_NATIVE
+  /* Fill the fields ourselves, because the original stat function returns
+     values for st_atime, st_mtime, st_ctime that depend on the current time
+     zone.  See
+     <https://lists.gnu.org/r/bug-gnulib/2017-04/msg00134.html>  */
+  /* XXX Should we convert to wchar_t* and prepend '\\?\', in order to work
+     around length limitations
+     <https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file> ?  */
+
+  /* POSIX <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>
+     specifies: "More than two leading <slash> characters shall be treated as
+     a single <slash> character."  */
+  if (ISSLASH (name[0]) && ISSLASH (name[1]) && ISSLASH (name[2]))
+    {
+      name += 2;
+      while (ISSLASH (name[1]))
+        name++;
+    }
+
+  size_t len = strlen (name);
+  size_t drive_prefix_len = (HAS_DEVICE (name) ? 2 : 0);
+
+  /* Remove trailing slashes (except the very first one, at position
+     drive_prefix_len), but remember their presence.  */
+  size_t rlen;
+  bool check_dir = false;
+
+  rlen = len;
+  while (rlen > drive_prefix_len && ISSLASH (name[rlen-1]))
+    {
+      check_dir = true;
+      if (rlen == drive_prefix_len + 1)
+        break;
+      rlen--;
+    }
+
+  /* Handle '' and 'C:'.  */
+  if (!check_dir && rlen == drive_prefix_len)
+    {
+      errno = ENOENT;
+      return -1;
+    }
+
+  /* Handle '\\'.  */
+  if (rlen == 1 && ISSLASH (name[0]) && len >= 2)
+    {
+      errno = ENOENT;
+      return -1;
+    }
+
+  const char *rname;
+  char *malloca_rname;
+  if (rlen == len)
     {
-      size_t len = strlen (name);
-      if (ISSLASH (name[len - 1]))
+      rname = name;
+      malloca_rname = NULL;
+    }
+  else
+    {
+      malloca_rname = malloca (rlen + 1);
+      if (malloca_rname == NULL)
         {
-          errno = ENOTDIR;
+          errno = ENOMEM;
           return -1;
         }
+      memcpy (malloca_rname, name, rlen);
+      malloca_rname[rlen] = '\0';
+      rname = malloca_rname;
     }
-#endif /* REPLACE_FUNC_STAT_FILE */
-#if REPLACE_FUNC_STAT_DIR
 
-  if (result == -1 && errno == ENOENT)
+  /* There are two ways to get at the requested information:
+       - by scanning the parent directory and examining the relevant
+         directory entry,
+       - by opening the file directly.
+     The first approach fails for root directories (e.g. 'C:\') and
+     UNC root directories (e.g. '\\server\share').
+     The second approach fails for some system files (e.g. 'C:\pagefile.sys'
+     and 'C:\hiberfil.sys'): ERROR_SHARING_VIOLATION.
+     The second approach gives more information (in particular, correct
+     st_dev, st_ino, st_nlink fields).
+     So we use the second approach and, as a fallback except for root and
+     UNC root directories, also the first approach.  */
+  {
+    int ret;
+
     {
-      /* Due to mingw's oddities, there are some directories (like
-         c:\) where stat() only succeeds with a trailing slash, and
-         other directories (like c:\windows) where stat() only
-         succeeds without a trailing slash.  But we want the two to be
-         synonymous, since chdir() manages either style.  Likewise, Mingw also
-         reports ENOENT for names longer than PATH_MAX, when we want
-         ENAMETOOLONG, and for stat("file/"), when we want ENOTDIR.
-         Fortunately, mingw PATH_MAX is small enough for stack
-         allocation.  */
-      char fixed_name[PATH_MAX + 1] = {0};
-      size_t len = strlen (name);
-      bool check_dir = false;
-      verify (PATH_MAX <= 4096);
-      if (PATH_MAX <= len)
-        errno = ENAMETOOLONG;
-      else if (len)
+      /* Approach based on the file.  */
+
+      /* Open a handle to the file.
+         CreateFile
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilea>
+         <https://docs.microsoft.com/en-us/windows/desktop/FileIO/creating-and-opening-files>  */
+      HANDLE h =
+        CreateFile (rname,
+                    FILE_READ_ATTRIBUTES,
+                    FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+                    NULL,
+                    OPEN_EXISTING,
+                    /* FILE_FLAG_POSIX_SEMANTICS (treat file names that differ only
+                       in case as different) makes sense only when applied to *all*
+                       filesystem operations.  */
+                    FILE_FLAG_BACKUP_SEMANTICS /* | FILE_FLAG_POSIX_SEMANTICS */,
+                    NULL);
+      if (h != INVALID_HANDLE_VALUE)
         {
-          strcpy (fixed_name, name);
-          if (ISSLASH (fixed_name[len - 1]))
+          ret = _gl_fstat_by_handle (h, rname, buf);
+          CloseHandle (h);
+          goto done;
+        }
+    }
+
+    /* Test for root and UNC root directories.  */
+    if ((rlen == drive_prefix_len + 1 && ISSLASH (rname[drive_prefix_len]))
+        || is_unc_root (rname))
+      goto failed;
+
+    /* Fallback.  */
+    {
+      /* Approach based on the directory entry.  */
+
+      if (strchr (rname, '?') != NULL || strchr (rname, '*') != NULL)
+        {
+          /* Other Windows API functions would fail with error
+             ERROR_INVALID_NAME.  */
+          if (malloca_rname != NULL)
+            freea (malloca_rname);
+          errno = ENOENT;
+          return -1;
+        }
+
+      /* Get the details about the directory entry.  This can be done through
+         FindFirstFile
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-_win32_find_dataa>
+         or through
+         FindFirstFileEx with argument FindExInfoBasic
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfileexa>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ne-minwinbase-findex_info_levels>
+         <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-_win32_find_dataa>  */
+      WIN32_FIND_DATA info;
+      HANDLE h = FindFirstFile (rname, &info);
+      if (h == INVALID_HANDLE_VALUE)
+        goto failed;
+
+      /* Test for error conditions before starting to fill *buf.  */
+      if (sizeof (buf->st_size) <= 4 && info.nFileSizeHigh > 0)
+        {
+          FindClose (h);
+          if (malloca_rname != NULL)
+            freea (malloca_rname);
+          errno = EOVERFLOW;
+          return -1;
+        }
+
+# if _GL_WINDOWS_STAT_INODES
+      buf->st_dev = 0;
+#  if _GL_WINDOWS_STAT_INODES == 2
+      buf->st_ino._gl_ino[0] = buf->st_ino._gl_ino[1] = 0;
+#  else /* _GL_WINDOWS_STAT_INODES == 1 */
+      buf->st_ino = 0;
+#  endif
+# else
+      /* st_ino is not wide enough for identifying a file on a device.
+         Without st_ino, st_dev is pointless.  */
+      buf->st_dev = 0;
+      buf->st_ino = 0;
+# endif
+
+      /* st_mode.  */
+      unsigned int mode =
+        /* XXX How to handle FILE_ATTRIBUTE_REPARSE_POINT ?  */
+        ((info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? _S_IFDIR | S_IEXEC_UGO : _S_IFREG)
+        | S_IREAD_UGO
+        | ((info.dwFileAttributes & FILE_ATTRIBUTE_READONLY) ? 0 : S_IWRITE_UGO);
+      if (!(info.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
+        {
+          /* Determine whether the file is executable by looking at the file
+             name suffix.  */
+          if (info.nFileSizeHigh > 0 || info.nFileSizeLow > 0)
             {
-              check_dir = true;
-              while (len && ISSLASH (fixed_name[len - 1]))
-                fixed_name[--len] = '\0';
-              if (!len)
-                fixed_name[0] = '/';
+              const char *last_dot = NULL;
+              const char *p;
+              for (p = info.cFileName; *p != '\0'; p++)
+                if (*p == '.')
+                  last_dot = p;
+              if (last_dot != NULL)
+                {
+                  const char *suffix = last_dot + 1;
+                  if (_stricmp (suffix, "exe") == 0
+                      || _stricmp (suffix, "bat") == 0
+                      || _stricmp (suffix, "cmd") == 0
+                      || _stricmp (suffix, "com") == 0)
+                    mode |= S_IEXEC_UGO;
+                }
             }
-          else
-            fixed_name[len++] = '/';
-          result = orig_stat (fixed_name, st);
-          if (result == 0 && check_dir && !S_ISDIR (st->st_mode))
+        }
+      buf->st_mode = mode;
+
+      /* st_nlink.  Ignore hard links here.  */
+      buf->st_nlink = 1;
+
+      /* There's no easy way to map the Windows SID concept to an integer.  */
+      buf->st_uid = 0;
+      buf->st_gid = 0;
+
+      /* st_rdev is irrelevant for normal files and directories.  */
+      buf->st_rdev = 0;
+
+      /* st_size.  */
+      if (sizeof (buf->st_size) <= 4)
+        /* Range check already done above.  */
+        buf->st_size = info.nFileSizeLow;
+      else
+        buf->st_size = ((long long) info.nFileSizeHigh << 32) | (long long) info.nFileSizeLow;
+
+      /* st_atime, st_mtime, st_ctime.  */
+# if _GL_WINDOWS_STAT_TIMESPEC
+      buf->st_atim = _gl_convert_FILETIME_to_timespec (&info.ftLastAccessTime);
+      buf->st_mtim = _gl_convert_FILETIME_to_timespec (&info.ftLastWriteTime);
+      buf->st_ctim = _gl_convert_FILETIME_to_timespec (&info.ftCreationTime);
+# else
+      buf->st_atime = _gl_convert_FILETIME_to_POSIX (&info.ftLastAccessTime);
+      buf->st_mtime = _gl_convert_FILETIME_to_POSIX (&info.ftLastWriteTime);
+      buf->st_ctime = _gl_convert_FILETIME_to_POSIX (&info.ftCreationTime);
+# endif
+
+      FindClose (h);
+
+      ret = 0;
+    }
+
+   done:
+    if (ret >= 0 && check_dir && !S_ISDIR (buf->st_mode))
+      {
+        errno = ENOTDIR;
+        ret = -1;
+      }
+    if (malloca_rname != NULL)
+      {
+        int saved_errno = errno;
+        freea (malloca_rname);
+        errno = saved_errno;
+      }
+    return ret;
+  }
+
+ failed:
+  {
+    DWORD error = GetLastError ();
+    #if 0
+    fprintf (stderr, "rpl_stat error 0x%x\n", (unsigned int) error);
+    #endif
+
+    if (malloca_rname != NULL)
+      freea (malloca_rname);
+
+    switch (error)
+      {
+      /* Some of these errors probably cannot happen with the specific flags
+         that we pass to CreateFile.  But who knows...  */
+      case ERROR_FILE_NOT_FOUND: /* The last component of rname does not exist.  */
+      case ERROR_PATH_NOT_FOUND: /* Some directory component in rname does not exist.  */
+      case ERROR_BAD_PATHNAME:   /* rname is such as '\\server'.  */
+      case ERROR_BAD_NET_NAME:   /* rname is such as '\\server\nonexistentshare'.  */
+      case ERROR_INVALID_NAME:   /* rname contains wildcards, misplaced colon, etc.  */
+      case ERROR_DIRECTORY:
+        errno = ENOENT;
+        break;
+
+      case ERROR_ACCESS_DENIED:  /* rname is such as 'C:\System Volume Information\foo'.  */
+      case ERROR_SHARING_VIOLATION: /* rname is such as 'C:\pagefile.sys' (second approach only).  */
+                                    /* XXX map to EACCES or EPERM? */
+        errno = EACCES;
+        break;
+
+      case ERROR_OUTOFMEMORY:
+        errno = ENOMEM;
+        break;
+
+      case ERROR_WRITE_PROTECT:
+        errno = EROFS;
+        break;
+
+      case ERROR_WRITE_FAULT:
+      case ERROR_READ_FAULT:
+      case ERROR_GEN_FAILURE:
+        errno = EIO;
+        break;
+
+      case ERROR_BUFFER_OVERFLOW:
+      case ERROR_FILENAME_EXCED_RANGE:
+        errno = ENAMETOOLONG;
+        break;
+
+      case ERROR_DELETE_PENDING: /* XXX map to EACCES or EPERM? */
+        errno = EPERM;
+        break;
+
+      default:
+        errno = EINVAL;
+        break;
+      }
+
+    return -1;
+  }
+#else
+  int result = orig_stat (name, buf);
+  if (result == 0)
+    {
+# if REPLACE_FUNC_STAT_FILE
+      /* Solaris 9 mistakenly succeeds when given a non-directory with a
+         trailing slash.  */
+      if (!S_ISDIR (buf->st_mode))
+        {
+          size_t len = strlen (name);
+          if (ISSLASH (name[len - 1]))
             {
-              result = -1;
               errno = ENOTDIR;
+              return -1;
             }
         }
+# endif /* REPLACE_FUNC_STAT_FILE */
+      result = stat_time_normalize (result, buf);
     }
-#endif /* REPLACE_FUNC_STAT_DIR */
   return result;
+#endif
 }
similarity index 78%
rename from tests/stdalign.in.h
rename to lib/stdalign.in.h
index 12f8a15..f522564 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C11 <stdalign.h>.
 
-   Copyright 2011-2016 Free Software Foundation, Inc.
+   Copyright 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert and Bruno Haible.  */
 
    requirement of a structure member (i.e., slot or field) that is of
    type TYPE, as an integer constant expression.
 
-   This differs from GCC's __alignof__ operator, which can yield a
-   better-performing alignment for an object of that type.  For
-   example, on x86 with GCC, __alignof__ (double) and __alignof__
-   (long long) are 8, whereas alignof (double) and alignof (long long)
-   are 4 unless the option '-malign-double' is used.
+   This differs from GCC's and clang's __alignof__ operator, which can
+   yield a better-performing alignment for an object of that type.  For
+   example, on x86 with GCC and on Linux/x86 with clang,
+   __alignof__ (double) and __alignof__ (long long) are 8, whereas
+   alignof (double) and alignof (long long) are 4 unless the option
+   '-malign-double' is used.
 
    The result cannot be used as a value for an 'enum' constant, if you
    want to be portable to HP-UX 10.20 cc and AIX 3.2.5 xlc.
 #undef _Alignof
 
 /* GCC releases before GCC 4.9 had a bug in _Alignof.  See GCC bug 52023
-   <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.  */
+   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.
+   clang versions < 8.0.0 have the same bug.  */
 #if (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112 \
-     || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9)))
+     || (defined __GNUC__ && __GNUC__ < 4 + (__GNUC_MINOR__ < 9) \
+         && !defined __clang__) \
+     || (defined __clang__ && __clang_major__ < 8))
 # ifdef __cplusplus
 #  if 201103 <= __cplusplus
 #   define _Alignof(type) alignof (type)
 #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
 # if defined __cplusplus && 201103 <= __cplusplus
 #  define _Alignas(a) alignas (a)
-# elif ((defined __APPLE__ && defined __MACH__                  \
-         ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__)                 \
-         : __GNUC__)                                            \
-        || 061200 <= __HP_cc || 061200 <= __HP_aCC                \
-        || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__)
+# elif (!defined __attribute__ \
+        && ((defined __APPLE__ && defined __MACH__ \
+             ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
+             : __GNUC__ && !defined __ibmxl__) \
+            || (4 <= __clang_major__) \
+            || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+            || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__))
 #  define _Alignas(a) __attribute__ ((__aligned__ (a)))
 # elif 1300 <= _MSC_VER
 #  define _Alignas(a) __declspec (align (a))
index 63371e2..faf4cb8 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <stdarg.h>.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _@GUARD_PREFIX@_STDARG_H
 
index 7ecf203..28e0a53 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2003, 2006-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2003, 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software; you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_STDBOOL_H
 #define _GL_STDBOOL_H
@@ -82,9 +82,9 @@ typedef bool _Bool;
    /* If @HAVE__BOOL@:
         Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
         the built-in _Bool type is used.  See
-          http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-          http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
-          http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+          https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+          https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
+          https://lists.gnu.org/r/bug-coreutils/2005-10/msg00086.html
         Similar bugs are likely with other compilers as well; this file
         wouldn't be used if <stdbool.h> was working.
         So we override the _Bool type.
index f4c4a10..d878b9d 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for POSIX 2008 <stddef.h>, for platforms that have issues.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
 /*
  * POSIX 2008 <stddef.h> for platforms that have issues.
- * <http://www.opengroup.org/susv3xbd/stddef.h.html>
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stddef.h.html>
  */
 
 #if __GNUC__ >= 3
 #   define _GL_STDDEF_WINT_T
 #  endif
 #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
+   /* On TinyCC, make sure that the macros that indicate the special invocation
+      convention get undefined.  */
+#  undef __need_wchar_t
+#  undef __need_size_t
+#  undef __need_ptrdiff_t
+#  undef __need_NULL
+#  undef __need_wint_t
 # endif
 
 #else
 
 # ifndef _@GUARD_PREFIX@_STDDEF_H
 
+/* On AIX 7.2, with xlc in 64-bit mode, <stddef.h> defines max_align_t to a
+   type with alignment 4, but 'long' has alignment 8.  */
+#  if defined _AIX && defined __LP64__
+#   if !GNULIB_defined_max_align_t
+#    ifdef _MAX_ALIGN_T
+/* /usr/include/stddef.h has already defined max_align_t.  Override it.  */
+typedef long rpl_max_align_t;
+#     define max_align_t rpl_max_align_t
+#    else
+/* Prevent /usr/include/stddef.h from defining max_align_t.  */
+typedef long max_align_t;
+#     define _MAX_ALIGN_T
+#    endif
+#    define GNULIB_defined_max_align_t 1
+#   endif
+#  endif
+
 /* The include_next requires a split double-inclusion guard.  */
 
 #  @INCLUDE_NEXT@ @NEXT_STDDEF_H@
 
 /* Some platforms lack max_align_t.  The check for _GCC_MAX_ALIGN_T is
    a hack in case the configure-time test was done with g++ even though
-   we are currently compiling with gcc.  */
-#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T)
+   we are currently compiling with gcc.
+   On MSVC, max_align_t is defined only in C++ mode, after <cstddef> was
+   included.  Its definition is good since it has an alignment of 8 (on x86
+   and x86_64).
+   Similarly on OS/2 kLIBC.  */
+#if (defined _MSC_VER || (defined __KLIBC__ && !defined __LIBCN__)) \
+    && defined __cplusplus
+# include <cstddef>
+#else
+# if ! (@HAVE_MAX_ALIGN_T@ || (defined _GCC_MAX_ALIGN_T && !defined __clang__))
+#  if !GNULIB_defined_max_align_t
 /* On the x86, the maximum storage alignment of double, long, etc. is 4,
    but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8,
    and the C11 standard allows this.  Work around this problem by
    using __alignof__ (which returns 8 for double) rather than _Alignof
    (which returns 4), and align each union member accordingly.  */
-# ifdef __GNUC__
-#  define _GL_STDDEF_ALIGNAS(type) \
-     __attribute__ ((__aligned__ (__alignof__ (type))))
-# else
-#  define _GL_STDDEF_ALIGNAS(type) /* */
-# endif
+#   if defined __GNUC__ || (__clang_major__ >= 4)
+#    define _GL_STDDEF_ALIGNAS(type) \
+       __attribute__ ((__aligned__ (__alignof__ (type))))
+#   else
+#    define _GL_STDDEF_ALIGNAS(type) /* */
+#   endif
 typedef union
 {
   char *__p _GL_STDDEF_ALIGNAS (char *);
   double __d _GL_STDDEF_ALIGNAS (double);
   long double __ld _GL_STDDEF_ALIGNAS (long double);
   long int __i _GL_STDDEF_ALIGNAS (long int);
-} max_align_t;
+} rpl_max_align_t;
+#   define max_align_t rpl_max_align_t
+#   define GNULIB_defined_max_align_t 1
+#  endif
+# endif
 #endif
 
 #  endif /* _@GUARD_PREFIX@_STDDEF_H */
index 566f8e8..1405992 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2002, 2004-2016 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2002, 2004-2021 Free Software Foundation, Inc.
    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
    This file is part of gnulib.
 
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /*
  * ISO C 99 <stdint.h> for platforms that lack it.
- * <http://www.opengroup.org/susv3xbd/stdint.h.html>
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/stdint.h.html>
  */
 
 #ifndef _@GUARD_PREFIX@_STDINT_H
@@ -85,7 +85,7 @@
 
 /* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
    wint_t.  */
-#if @GNULIB_OVERRIDES_WINT_T@
+#if @GNULIBHEADERS_OVERRIDE_WINT_T@
 # undef WINT_MIN
 # undef WINT_MAX
 # define WINT_MIN 0x0U
    Return an unspecified value if BITS == 0, adding a check to pacify
    picky compilers.  */
 
-# define _STDINT_MIN(signed, bits, zero) \
-    ((signed) ? ~ _STDINT_MAX (signed, bits, zero) : (zero))
+/* These are separate macros, because if you try to merge these macros into
+   a single one, HP-UX cc rejects the resulting expression in constant
+   expressions.  */
+# define _STDINT_UNSIGNED_MIN(bits, zero) \
+    (zero)
+# define _STDINT_SIGNED_MIN(bits, zero) \
+    (~ _STDINT_MAX (1, bits, zero))
 
 # define _STDINT_MAX(signed, bits, zero) \
     (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
@@ -183,7 +188,7 @@ typedef long int gl_int64_t;
 typedef __int64 gl_int64_t;
 #   define int64_t gl_int64_t
 #   define GL_INT64_T
-#  elif @HAVE_LONG_LONG_INT@
+#  else
 #   undef int64_t
 typedef long long int gl_int64_t;
 #   define int64_t gl_int64_t
@@ -204,7 +209,7 @@ typedef unsigned long int gl_uint64_t;
 typedef unsigned __int64 gl_uint64_t;
 #   define uint64_t gl_uint64_t
 #   define GL_UINT64_T
-#  elif @HAVE_UNSIGNED_LONG_LONG_INT@
+#  else
 #   undef uint64_t
 typedef unsigned long long int gl_uint64_t;
 #   define uint64_t gl_uint64_t
@@ -294,16 +299,25 @@ typedef gl_uint_fast32_t gl_uint_fast16_t;
 
 /* 7.18.1.4. Integer types capable of holding object pointers */
 
-/* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own
+/* kLIBC's <stdint.h> defines _INTPTR_T_DECLARED and needs its own
    definitions of intptr_t and uintptr_t (which use int and unsigned)
-   to avoid clashes with declarations of system functions like sbrk.  */
-# ifndef _INTPTR_T_DECLARED
-# undef intptr_t
-# undef uintptr_t
+   to avoid clashes with declarations of system functions like sbrk.
+   Similarly, MinGW WSL-5.4.1 <stdint.h> needs its own intptr_t and
+   uintptr_t to avoid conflicting declarations of system functions like
+   _findclose in <io.h>.  */
+# if !((defined __KLIBC__ && defined _INTPTR_T_DECLARED) \
+       || defined __MINGW32__)
+#  undef intptr_t
+#  undef uintptr_t
+#  ifdef _WIN64
+typedef long long int gl_intptr_t;
+typedef unsigned long long int gl_uintptr_t;
+#  else
 typedef long int gl_intptr_t;
 typedef unsigned long int gl_uintptr_t;
-# define intptr_t gl_intptr_t
-# define uintptr_t gl_uintptr_t
+#  endif
+#  define intptr_t gl_intptr_t
+#  define uintptr_t gl_uintptr_t
 # endif
 
 /* 7.18.1.5. Greatest-width integer types */
@@ -318,7 +332,7 @@ typedef unsigned long int gl_uintptr_t;
 # ifndef INTMAX_MAX
 #  undef INTMAX_C
 #  undef intmax_t
-#  if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#  if LONG_MAX >> 30 == 1
 typedef long long int gl_intmax_t;
 #   define intmax_t gl_intmax_t
 #  elif defined GL_INT64_T
@@ -332,7 +346,7 @@ typedef long int gl_intmax_t;
 # ifndef UINTMAX_MAX
 #  undef UINTMAX_C
 #  undef uintmax_t
-#  if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#  if ULONG_MAX >> 31 == 1
 typedef unsigned long long int gl_uintmax_t;
 #   define uintmax_t gl_uintmax_t
 #  elif defined GL_UINT64_T
@@ -480,9 +494,15 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 # undef INTPTR_MIN
 # undef INTPTR_MAX
 # undef UINTPTR_MAX
-# define INTPTR_MIN  LONG_MIN
-# define INTPTR_MAX  LONG_MAX
-# define UINTPTR_MAX  ULONG_MAX
+# ifdef _WIN64
+#  define INTPTR_MIN  LLONG_MIN
+#  define INTPTR_MAX  LLONG_MAX
+#  define UINTPTR_MAX  ULLONG_MAX
+# else
+#  define INTPTR_MIN  LONG_MIN
+#  define INTPTR_MAX  LONG_MAX
+#  define UINTPTR_MAX  ULONG_MAX
+# endif
 
 /* 7.18.2.5. Limits of greatest-width integer types */
 
@@ -512,15 +532,15 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 # undef PTRDIFF_MAX
 # if @APPLE_UNIVERSAL_BUILD@
 #  ifdef _LP64
-#   define PTRDIFF_MIN  _STDINT_MIN (1, 64, 0l)
+#   define PTRDIFF_MIN  _STDINT_SIGNED_MIN (64, 0l)
 #   define PTRDIFF_MAX  _STDINT_MAX (1, 64, 0l)
 #  else
-#   define PTRDIFF_MIN  _STDINT_MIN (1, 32, 0)
+#   define PTRDIFF_MIN  _STDINT_SIGNED_MIN (32, 0)
 #   define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)
 #  endif
 # else
 #  define PTRDIFF_MIN  \
-    _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
+    _STDINT_SIGNED_MIN (@BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
 #  define PTRDIFF_MAX  \
     _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
 # endif
@@ -528,9 +548,13 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 /* sig_atomic_t limits */
 # undef SIG_ATOMIC_MIN
 # undef SIG_ATOMIC_MAX
-# define SIG_ATOMIC_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
-                0@SIG_ATOMIC_T_SUFFIX@)
+# if @HAVE_SIGNED_SIG_ATOMIC_T@
+#  define SIG_ATOMIC_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
+# else
+#  define SIG_ATOMIC_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
+# endif
 # define SIG_ATOMIC_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
                 0@SIG_ATOMIC_T_SUFFIX@)
@@ -555,29 +579,38 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
    <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
    <stdint.h> and assumes its types are already defined.  */
 # if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
-  /* 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>
 #  define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
 #  include <wchar.h>
 #  undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
 # endif
 # undef WCHAR_MIN
 # undef WCHAR_MAX
-# define WCHAR_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+# if @HAVE_SIGNED_WCHAR_T@
+#  define WCHAR_MIN  \
+    _STDINT_SIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+# else
+#  define WCHAR_MIN  \
+    _STDINT_UNSIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
+# endif
 # define WCHAR_MAX  \
    _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
 
 /* wint_t limits */
-# undef WINT_MIN
-# undef WINT_MAX
-# define WINT_MIN  \
-   _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
-# define WINT_MAX  \
-   _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+/* If gnulib's <wchar.h> or <wctype.h> overrides wint_t, @WINT_T_SUFFIX@ is not
+   accurate, therefore use the definitions from above.  */
+# if !@GNULIBHEADERS_OVERRIDE_WINT_T@
+#  undef WINT_MIN
+#  undef WINT_MAX
+#  if @HAVE_SIGNED_WINT_T@
+#   define WINT_MIN  \
+     _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+#  else
+#   define WINT_MIN  \
+     _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+#  endif
+#  define WINT_MAX  \
+    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
+# endif
 
 /* 7.18.4. Macros for integer constants */
 
@@ -608,21 +641,21 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 #  define INT64_C(x) x##L
 # elif defined _MSC_VER
 #  define INT64_C(x) x##i64
-# elif @HAVE_LONG_LONG_INT@
+# else
 #  define INT64_C(x) x##LL
 # endif
 # if ULONG_MAX >> 31 >> 31 >> 1 == 1
 #  define UINT64_C(x) x##UL
 # elif defined _MSC_VER
 #  define UINT64_C(x) x##ui64
-# elif @HAVE_UNSIGNED_LONG_LONG_INT@
+# else
 #  define UINT64_C(x) x##ULL
 # endif
 
 /* 7.18.4.2. Macros for greatest-width integer constants */
 
 # ifndef INTMAX_C
-#  if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
+#  if LONG_MAX >> 30 == 1
 #   define INTMAX_C(x)   x##LL
 #  elif defined GL_INT64_T
 #   define INTMAX_C(x)   INT64_C(x)
@@ -632,7 +665,7 @@ typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
 # endif
 
 # ifndef UINTMAX_C
-#  if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
+#  if ULONG_MAX >> 31 == 1
 #   define UINTMAX_C(x)  x##ULL
 #  elif defined GL_UINT64_T
 #   define UINTMAX_C(x)  UINT64_C(x)
index 8e23817..bb931d7 100644 (file)
@@ -1,6 +1,6 @@
 /* Like stdio.h, but redefine some names to avoid glitches.
 
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
index 766d693..2a5db74 100644 (file)
@@ -1,5 +1,5 @@
 /* Implementation details of FILE streams.
-   Copyright (C) 2007-2008, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2008, 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Many stdio implementations have the same logic and therefore can share
    the same implementation of stdio extension API, except that some fields
    have different naming conventions, or their access requires some casts.  */
 
+/* Glibc 2.28 made _IO_UNBUFFERED and _IO_IN_BACKUP private.  For now, work
+   around this problem by defining them ourselves.  FIXME: Do not rely on glibc
+   internals.  */
+#if defined _IO_EOF_SEEN
+# if !defined _IO_UNBUFFERED
+#  define _IO_UNBUFFERED 0x2
+# endif
+# if !defined _IO_IN_BACKUP
+#  define _IO_IN_BACKUP 0x100
+# endif
+#endif
 
 /* BSD stdio derived implementations.  */
 
 #include <errno.h>                             /* For detecting Plan9.  */
 
 #if defined __sferror || defined __DragonFly__ || defined __ANDROID__
-  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Android */
+  /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin, Minix 3, Android */
 
 # if defined __DragonFly__          /* DragonFly */
-  /* See <http://www.dragonflybsd.org/cvsweb/src/lib/libc/stdio/priv_stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>.  */
+  /* See <https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/lib/libc/stdio/priv_stdio.h>.  */
 #  define fp_ ((struct { struct __FILE_public pub; \
                          struct { unsigned char *_base; int _size; } _bf; \
                          void *cookie; \
                          fpos_t _offset; \
                          /* More fields, not relevant here.  */ \
                        } *) fp)
-  /* See <http://www.dragonflybsd.org/cvsweb/src/include/stdio.h?rev=HEAD&content-type=text/x-cvsweb-markup>.  */
+  /* See <https://gitweb.dragonflybsd.org/dragonfly.git/blob_plain/HEAD:/include/stdio.h>.  */
 #  define _p pub._p
 #  define _flags pub._flags
 #  define _r pub._r
 #  define _w pub._w
+# elif defined __ANDROID__ /* Android */
+#  ifdef __LP64__
+#   define _gl_flags_file_t int
+#  else
+#   define _gl_flags_file_t short
+#  endif
+  /* Up to this commit from 2015-10-12
+     <https://android.googlesource.com/platform/bionic.git/+/f0141dfab10a4b332769d52fa76631a64741297a>
+     the innards of FILE were public, and fp_ub could be defined like for OpenBSD,
+     see <https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/fileext.h>
+     and <https://android.googlesource.com/platform/bionic.git/+/e78392637d5086384a5631ddfdfa8d7ec8326ee3/libc/stdio/local.h>.
+     After this commit, the innards of FILE are hidden.  */
+#  define fp_ ((struct { unsigned char *_p; \
+                         int _r; \
+                         int _w; \
+                         _gl_flags_file_t _flags; \
+                         _gl_flags_file_t _file; \
+                         struct { unsigned char *_base; size_t _size; } _bf; \
+                         int _lbfsize; \
+                         void *_cookie; \
+                         void *_close; \
+                         void *_read; \
+                         void *_seek; \
+                         void *_write; \
+                         struct { unsigned char *_base; size_t _size; } _ext; \
+                         unsigned char *_up; \
+                         int _ur; \
+                         unsigned char _ubuf[3]; \
+                         unsigned char _nbuf[1]; \
+                         struct { unsigned char *_base; size_t _size; } _lb; \
+                         int _blksize; \
+                         fpos_t _offset; \
+                         /* More fields, not relevant here.  */ \
+                       } *) fp)
 # else
 #  define fp_ fp
 # endif
 
-# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __ANDROID__ /* NetBSD >= 1.5ZA, OpenBSD, Android */
+# if (defined __NetBSD__ && __NetBSD_Version__ >= 105270000) || defined __OpenBSD__ || defined __minix /* NetBSD >= 1.5ZA, OpenBSD, Minix 3 */
   /* See <http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
-     and <http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup> */
+     and <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdio/fileext.h?rev=HEAD&content-type=text/x-cvsweb-markup>
+     and <https://github.com/Stichting-MINIX-Research-Foundation/minix/blob/master/lib/libc/stdio/fileext.h> */
   struct __sfileext
     {
       struct  __sbuf _ub; /* ungetc buffer */
       /* More fields, not relevant here.  */
     };
 #  define fp_ub ((struct __sfileext *) fp->_ext._base)->_ub
-# else                                         /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin, Android */
+# elif defined __ANDROID__                     /* Android */
+  struct __sfileext
+    {
+      struct { unsigned char *_base; size_t _size; } _ub; /* ungetc buffer */
+      /* More fields, not relevant here.  */
+    };
+#  define fp_ub ((struct __sfileext *) fp_->_ext._base)->_ub
+# else                                         /* FreeBSD, NetBSD <= 1.5Z, DragonFly, Mac OS X, Cygwin */
 #  define fp_ub fp_->_ub
 # endif
 
 # define HASUB(fp) (fp_ub._base != NULL)
 
+# if defined __ANDROID__ /* Android */
+  /* Needed after this commit from 2016-01-25
+     <https://android.googlesource.com/platform/bionic.git/+/e70e0e9267d069bf56a5078c99307e08a7280de7> */
+#  ifndef __SEOF
+#   define __SLBF 1
+#   define __SNBF 2
+#   define __SRD 4
+#   define __SWR 8
+#   define __SRW 0x10
+#   define __SEOF 0x20
+#   define __SERR 0x40
+#  endif
+#  ifndef __SOFF
+#   define __SOFF 0x1000
+#  endif
+# endif
+
 #endif
 
 
 #ifdef __TANDEM                     /* NonStop Kernel */
 # ifndef _IOERR
 /* These values were determined by the program 'stdioext-flags' at
-   <http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>.  */
+   <https://lists.gnu.org/r/bug-gnulib/2010-12/msg00165.html>.  */
 #  define _IOERR   0x40
 #  define _IOREAD  0x80
 #  define _IOWRT    0x4
                          int _file; \
                          unsigned int _flag; \
                        } *) fp)
+# elif defined __VMS                /* OpenVMS */
+#  define fp_ ((struct _iobuf *) fp)
 # else
 #  define fp_ fp
 # endif
 
-# if defined _SCO_DS                /* OpenServer */
+# if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__)  /* OpenServer 5, OpenServer 6, UnixWare 7 */
 #  define _cnt __cnt
 #  define _ptr __ptr
 #  define _base __base
 #  define _flag __flag
 # endif
 
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__  /* newer Windows with MSVC */
+#elif defined _WIN32 && ! defined __CYGWIN__  /* newer Windows with MSVC */
 
 /* <stdio.h> does not define the innards of FILE any more.  */
 # define WINDOWS_OPAQUE_FILE
@@ -130,7 +202,7 @@ struct _gl_real_FILE
 # define fp_ ((struct _gl_real_FILE *) fp)
 
 /* These values were determined by a program similar to the one at
-   <http://lists.gnu.org/archive/html/bug-gnulib/2010-12/msg00165.html>.  */
+   <https://lists.gnu.org/r/bug-gnulib/2010-12/msg00165.html>.  */
 # define _IOREAD   0x1
 # define _IOWRT    0x2
 # define _IORW     0x4
index 4231609..464ffcf 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke stdio functions, but avoid some glitches.
 
-   Copyright (C) 2001, 2003, 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
index 072e55b..b6a59e0 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX compatible FILE stream write function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -30,7 +30,7 @@
    error EINVAL.  This write() function is at the basis of the function
    which flushes the buffer of a FILE stream.  */
 
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 
 #  include <errno.h>
 #  include <signal.h>
 #  define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 #  include <windows.h>
 
-#  include "msvc-nothrow.h"
+#  if GNULIB_MSVC_NOTHROW
+#   include "msvc-nothrow.h"
+#  else
+#   include <io.h>
+#  endif
+
+/* Don't assume that UNICODE is not defined.  */
+#  undef GetNamedPipeHandleState
+#  define GetNamedPipeHandleState GetNamedPipeHandleStateA
 
 #  if GNULIB_NONBLOCKING
 #   define CLEAR_ERRNO \
index 5727452..65b5d7e 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdio.h>.
 
-   Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
    We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
    gnulib and libintl do '#define printf __printf__' when they override
    the 'printf' function.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#ifndef _GL_ATTRIBUTE_FORMAT
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7) || defined __clang__
+#  define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+# else
+#  define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+# endif
+#endif
+
+/* An __attribute__ __format__ specifier for a function that takes a format
+   string and arguments, where the format string directives are the ones
+   standardized by ISO C99 and POSIX.
+   _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD  */
+/* __gnu_printf__ is supported in GCC >= 4.4.  */
+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __gnu_printf__
+#else
+# define _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD __printf__
+#endif
+
+/* An __attribute__ __format__ specifier for a function that takes a format
+   string and arguments, where the format string directives are the ones of the
+   system printf(), rather than the ones standardized by ISO C99 and POSIX.
+   _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM  */
+/* On mingw, Gnulib sets __USE_MINGW_ANSI_STDIO in order to get closer to
+   the standards.  The macro GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU indicates
+   whether this change is effective.  On older mingw, it is not.  */
+#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
+# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD
 #else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+# define _GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM __printf__
 #endif
 
-/* _GL_ATTRIBUTE_FORMAT_PRINTF
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD
    indicates to GCC that the function takes a format string and arguments,
    where the format string directives are the ones standardized by ISO C99
    and POSIX.  */
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
-# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
-   _GL_ATTRIBUTE_FORMAT ((__gnu_printf__, formatstring_parameter, first_argument))
-#else
-# define _GL_ATTRIBUTE_FORMAT_PRINTF(formatstring_parameter, first_argument) \
-   _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
-#endif
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD(formatstring_parameter, first_argument) \
+  _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, formatstring_parameter, first_argument))
 
-/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF,
+/* _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM is like _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD,
    except that it indicates to GCC that the supported format string directives
    are the ones of the system printf(), rather than the ones standardized by
    ISO C99 and POSIX.  */
-#if GNULIB_PRINTF_ATTRIBUTE_FLAVOR_GNU
-# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
-  _GL_ATTRIBUTE_FORMAT_PRINTF (formatstring_parameter, first_argument)
-#else
-# define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
-  _GL_ATTRIBUTE_FORMAT ((__printf__, formatstring_parameter, first_argument))
-#endif
+#define _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM(formatstring_parameter, first_argument) \
+  _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, formatstring_parameter, first_argument))
 
 /* _GL_ATTRIBUTE_FORMAT_SCANF
    indicates to GCC that the function takes a format string and arguments,
 #define _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM(formatstring_parameter, first_argument) \
   _GL_ATTRIBUTE_FORMAT ((__scanf__, formatstring_parameter, first_argument))
 
-/* Solaris 10 declares renameat in <unistd.h>, not in <stdio.h>.  */
+/* Solaris 10 and NetBSD 7.0 declare renameat in <unistd.h>, not in <stdio.h>.  */
 /* But in any case avoid namespace pollution on glibc systems.  */
-#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __sun \
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && (defined __sun || defined __NetBSD__) \
     && ! defined __GLIBC__
 # include <unistd.h>
 #endif
 
+/* Android 4.3 declares renameat in <sys/stat.h>, not in <stdio.h>.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_RENAMEAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
+    && ! defined __GLIBC__
+# include <sys/stat.h>
+#endif
+
 /* MSVC declares 'perror' in <stdlib.h>, not in <stdio.h>.  We must include
    it before we  #define perror rpl_perror.  */
 /* But in any case avoid namespace pollution on glibc systems.  */
 #if (@GNULIB_PERROR@ || defined GNULIB_POSIXCHECK) \
-    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && (defined _WIN32 && ! defined __CYGWIN__) \
     && ! defined __GLIBC__
 # include <stdlib.h>
 #endif
    it before we  #define rename rpl_rename.  */
 /* But in any case avoid namespace pollution on glibc systems.  */
 #if (@GNULIB_REMOVE@ || @GNULIB_RENAME@ || defined GNULIB_POSIXCHECK) \
-    && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
+    && (defined _WIN32 && ! defined __CYGWIN__) \
     && ! defined __GLIBC__
 # include <io.h>
 #endif
 /* When also using extern inline, suppress the use of static inline in
    standard headers of problematic Apple configurations, as Libc at
    least through Libc-825.26 (2013-04-09) mishandles it; see, e.g.,
-   <http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html>.
+   <https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html>.
    Perhaps Apple will fix this some day.  */
 #if (defined _GL_EXTERN_INLINE_IN_USE && defined __APPLE__ \
      && defined __GNUC__ && defined __STDC__)
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define dprintf rpl_dprintf
 #  endif
-_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *format, ...)
-                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+_GL_FUNCDECL_RPL (dprintf, int, (int fd, const char *restrict format, ...)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                                 _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *format, ...));
+_GL_CXXALIAS_RPL (dprintf, int, (int fd, const char *restrict format, ...));
 # else
 #  if !@HAVE_DPRINTF@
-_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *format, ...)
-                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+_GL_FUNCDECL_SYS (dprintf, int, (int fd, const char *restrict format, ...)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                                 _GL_ARG_NONNULL ((2)));
 #  endif
-_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *format, ...));
+_GL_CXXALIAS_SYS (dprintf, int, (int fd, const char *restrict format, ...));
 # endif
 _GL_CXXALIASWARN (dprintf);
 #elif defined GNULIB_POSIXCHECK
@@ -196,7 +219,9 @@ _GL_CXXALIAS_RPL (fclose, int, (FILE *stream));
 # else
 _GL_CXXALIAS_SYS (fclose, int, (FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fclose);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fclose
 /* Assume fclose is always declared.  */
@@ -204,6 +229,31 @@ _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
                  "use gnulib module fclose for portable POSIX compliance");
 #endif
 
+#if @GNULIB_MDA_FCLOSEALL@
+/* On native Windows, map 'fcloseall' to '_fcloseall', so that -loldnames is
+   not required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::fcloseall on all platforms that have
+   it.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fcloseall
+#   define fcloseall _fcloseall
+#  endif
+_GL_CXXALIAS_MDA (fcloseall, int, (void));
+# else
+#  if @HAVE_DECL_FCLOSEALL@
+#   if defined __FreeBSD__ || defined __DragonFly__
+_GL_CXXALIAS_SYS (fcloseall, void, (void));
+#   else
+_GL_CXXALIAS_SYS (fcloseall, int, (void));
+#   endif
+#  endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCLOSEALL@
+_GL_CXXALIASWARN (fcloseall);
+# endif
+#endif
+
 #if @GNULIB_FDOPEN@
 # if @REPLACE_FDOPEN@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -213,6 +263,12 @@ _GL_WARN_ON_USE (fclose, "fclose is not always POSIX compliant - "
 _GL_FUNCDECL_RPL (fdopen, FILE *, (int fd, const char *mode)
                                   _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (fdopen, FILE *, (int fd, const char *mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fdopen
+#   define fdopen _fdopen
+#  endif
+_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
 # else
 _GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
 # endif
@@ -222,6 +278,20 @@ _GL_CXXALIASWARN (fdopen);
 /* Assume fdopen is always declared.  */
 _GL_WARN_ON_USE (fdopen, "fdopen on native Windows platforms is not POSIX compliant - "
                  "use gnulib module fdopen for portability");
+#elif @GNULIB_MDA_FDOPEN@
+/* On native Windows, map 'fdopen' to '_fdopen', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::fdopen always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fdopen
+#   define fdopen _fdopen
+#  endif
+_GL_CXXALIAS_MDA (fdopen, FILE *, (int fd, const char *mode));
+# else
+_GL_CXXALIAS_SYS (fdopen, FILE *, (int fd, const char *mode));
+# endif
+_GL_CXXALIASWARN (fdopen);
 #endif
 
 #if @GNULIB_FFLUSH@
@@ -240,7 +310,9 @@ _GL_CXXALIAS_RPL (fflush, int, (FILE *gl_stream));
 # else
 _GL_CXXALIAS_SYS (fflush, int, (FILE *gl_stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fflush);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fflush
 /* Assume fflush is always declared.  */
@@ -259,7 +331,9 @@ _GL_CXXALIAS_RPL (fgetc, int, (FILE *stream));
 # else
 _GL_CXXALIAS_SYS (fgetc, int, (FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fgetc);
+# endif
 #endif
 
 #if @GNULIB_FGETS@
@@ -268,13 +342,34 @@ _GL_CXXALIASWARN (fgetc);
 #   undef fgets
 #   define fgets rpl_fgets
 #  endif
-_GL_FUNCDECL_RPL (fgets, char *, (char *s, int n, FILE *stream)
-                                 _GL_ARG_NONNULL ((1, 3)));
-_GL_CXXALIAS_RPL (fgets, char *, (char *s, int n, FILE *stream));
+_GL_FUNCDECL_RPL (fgets, char *,
+                  (char *restrict s, int n, FILE *restrict stream)
+                  _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (fgets, char *,
+                  (char *restrict s, int n, FILE *restrict stream));
 # else
-_GL_CXXALIAS_SYS (fgets, char *, (char *s, int n, FILE *stream));
+_GL_CXXALIAS_SYS (fgets, char *,
+                  (char *restrict s, int n, FILE *restrict stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fgets);
+# endif
+#endif
+
+#if @GNULIB_MDA_FILENO@
+/* On native Windows, map 'fileno' to '_fileno', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::fileno always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fileno
+#   define fileno _fileno
+#  endif
+_GL_CXXALIAS_MDA (fileno, int, (FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (fileno, int, (FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (fileno);
 #endif
 
 #if @GNULIB_FOPEN@
@@ -283,13 +378,18 @@ _GL_CXXALIASWARN (fgets);
 #   undef fopen
 #   define fopen rpl_fopen
 #  endif
-_GL_FUNCDECL_RPL (fopen, FILE *, (const char *filename, const char *mode)
-                                 _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_RPL (fopen, FILE *, (const char *filename, const char *mode));
+_GL_FUNCDECL_RPL (fopen, FILE *,
+                  (const char *restrict filename, const char *restrict mode)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fopen, FILE *,
+                  (const char *restrict filename, const char *restrict mode));
 # else
-_GL_CXXALIAS_SYS (fopen, FILE *, (const char *filename, const char *mode));
+_GL_CXXALIAS_SYS (fopen, FILE *,
+                  (const char *restrict filename, const char *restrict mode));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fopen);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef fopen
 /* Assume fopen is always declared.  */
@@ -305,19 +405,25 @@ _GL_WARN_ON_USE (fopen, "fopen on native Windows platforms is not POSIX complian
 #  endif
 #  define GNULIB_overrides_fprintf 1
 #  if @GNULIB_FPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
-_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
-                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
-                                _GL_ARG_NONNULL ((1, 2)));
+_GL_FUNCDECL_RPL (fprintf, int,
+                  (FILE *restrict fp, const char *restrict format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+                  _GL_ARG_NONNULL ((1, 2)));
 #  else
-_GL_FUNCDECL_RPL (fprintf, int, (FILE *fp, const char *format, ...)
-                                _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
-                                _GL_ARG_NONNULL ((1, 2)));
+_GL_FUNCDECL_RPL (fprintf, int,
+                  (FILE *restrict fp, const char *restrict format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 3)
+                  _GL_ARG_NONNULL ((1, 2)));
 #  endif
-_GL_CXXALIAS_RPL (fprintf, int, (FILE *fp, const char *format, ...));
+_GL_CXXALIAS_RPL (fprintf, int,
+                  (FILE *restrict fp, const char *restrict format, ...));
 # else
-_GL_CXXALIAS_SYS (fprintf, int, (FILE *fp, const char *format, ...));
+_GL_CXXALIAS_SYS (fprintf, int,
+                  (FILE *restrict fp, const char *restrict format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fprintf);
+# endif
 #endif
 #if !@GNULIB_FPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 # if !GNULIB_overrides_fprintf
@@ -368,7 +474,9 @@ _GL_CXXALIAS_RPL (fputc, int, (int c, FILE *stream));
 # else
 _GL_CXXALIAS_SYS (fputc, int, (int c, FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fputc);
+# endif
 #endif
 
 #if @GNULIB_FPUTS@
@@ -377,13 +485,18 @@ _GL_CXXALIASWARN (fputc);
 #   undef fputs
 #   define fputs rpl_fputs
 #  endif
-_GL_FUNCDECL_RPL (fputs, int, (const char *string, FILE *stream)
-                              _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_RPL (fputs, int, (const char *string, FILE *stream));
+_GL_FUNCDECL_RPL (fputs, int,
+                  (const char *restrict string, FILE *restrict stream)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fputs, int,
+                  (const char *restrict string, FILE *restrict stream));
 # else
-_GL_CXXALIAS_SYS (fputs, int, (const char *string, FILE *stream));
+_GL_CXXALIAS_SYS (fputs, int,
+                  (const char *restrict string, FILE *restrict stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fputs);
+# endif
 #endif
 
 #if @GNULIB_FREAD@
@@ -392,13 +505,21 @@ _GL_CXXALIASWARN (fputs);
 #   undef fread
 #   define fread rpl_fread
 #  endif
-_GL_FUNCDECL_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream)
-                                 _GL_ARG_NONNULL ((4)));
-_GL_CXXALIAS_RPL (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
+_GL_FUNCDECL_RPL (fread, size_t,
+                  (void *restrict ptr, size_t s, size_t n,
+                   FILE *restrict stream)
+                  _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (fread, size_t,
+                  (void *restrict ptr, size_t s, size_t n,
+                   FILE *restrict stream));
 # else
-_GL_CXXALIAS_SYS (fread, size_t, (void *ptr, size_t s, size_t n, FILE *stream));
+_GL_CXXALIAS_SYS (fread, size_t,
+                  (void *restrict ptr, size_t s, size_t n,
+                   FILE *restrict stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fread);
+# endif
 #endif
 
 #if @GNULIB_FREOPEN@
@@ -408,15 +529,20 @@ _GL_CXXALIASWARN (fread);
 #   define freopen rpl_freopen
 #  endif
 _GL_FUNCDECL_RPL (freopen, FILE *,
-                  (const char *filename, const char *mode, FILE *stream)
+                  (const char *restrict filename, const char *restrict mode,
+                   FILE *restrict stream)
                   _GL_ARG_NONNULL ((2, 3)));
 _GL_CXXALIAS_RPL (freopen, FILE *,
-                  (const char *filename, const char *mode, FILE *stream));
+                  (const char *restrict filename, const char *restrict mode,
+                   FILE *restrict stream));
 # else
 _GL_CXXALIAS_SYS (freopen, FILE *,
-                  (const char *filename, const char *mode, FILE *stream));
+                  (const char *restrict filename, const char *restrict mode,
+                   FILE *restrict stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (freopen);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef freopen
 /* Assume freopen is always declared.  */
@@ -431,14 +557,19 @@ _GL_WARN_ON_USE (freopen,
 #   undef fscanf
 #   define fscanf rpl_fscanf
 #  endif
-_GL_FUNCDECL_RPL (fscanf, int, (FILE *stream, const char *format, ...)
-                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
-                               _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_RPL (fscanf, int, (FILE *stream, const char *format, ...));
+_GL_FUNCDECL_RPL (fscanf, int,
+                  (FILE *restrict stream, const char *restrict format, ...)
+                  _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 3)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (fscanf, int,
+                  (FILE *restrict stream, const char *restrict format, ...));
 # else
-_GL_CXXALIAS_SYS (fscanf, int, (FILE *stream, const char *format, ...));
+_GL_CXXALIAS_SYS (fscanf, int,
+                  (FILE *restrict stream, const char *restrict format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fscanf);
+# endif
 #endif
 
 
@@ -489,7 +620,9 @@ _GL_CXXALIAS_RPL (fseek, int, (FILE *fp, long offset, int whence));
 # else
 _GL_CXXALIAS_SYS (fseek, int, (FILE *fp, long offset, int whence));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fseek);
+# endif
 #endif
 
 #if @GNULIB_FSEEKO@
@@ -552,7 +685,9 @@ _GL_CXXALIAS_RPL (ftell, long, (FILE *fp));
 # else
 _GL_CXXALIAS_SYS (ftell, long, (FILE *fp));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (ftell);
+# endif
 #endif
 
 #if @GNULIB_FTELLO@
@@ -601,16 +736,19 @@ _GL_WARN_ON_USE (ftell, "ftell cannot handle files larger than 4 GB "
 #   define fwrite rpl_fwrite
 #  endif
 _GL_FUNCDECL_RPL (fwrite, size_t,
-                  (const void *ptr, size_t s, size_t n, FILE *stream)
+                  (const void *restrict ptr, size_t s, size_t n,
+                   FILE *restrict stream)
                   _GL_ARG_NONNULL ((1, 4)));
 _GL_CXXALIAS_RPL (fwrite, size_t,
-                  (const void *ptr, size_t s, size_t n, FILE *stream));
+                  (const void *restrict ptr, size_t s, size_t n,
+                   FILE *restrict stream));
 # else
 _GL_CXXALIAS_SYS (fwrite, size_t,
-                  (const void *ptr, size_t s, size_t n, FILE *stream));
+                  (const void *restrict ptr, size_t s, size_t n,
+                   FILE *restrict stream));
 
 /* Work around bug 11959 when fortifying glibc 2.4 through 2.15
-   <http://sources.redhat.com/bugzilla/show_bug.cgi?id=11959>,
+   <https://sourceware.org/bugzilla/show_bug.cgi?id=11959>,
    which sometimes causes an unwanted diagnostic for fwrite calls.
    This affects only function declaration attributes under certain
    versions of gcc and clang, and is not needed for C++.  */
@@ -632,7 +770,9 @@ extern size_t __REDIRECT (rpl_fwrite_unlocked,
 #   define fwrite_unlocked rpl_fwrite_unlocked
 #  endif
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fwrite);
+# endif
 #endif
 
 #if @GNULIB_GETC@
@@ -646,7 +786,9 @@ _GL_CXXALIAS_RPL_1 (getc, rpl_fgetc, int, (FILE *stream));
 # else
 _GL_CXXALIAS_SYS (getc, int, (FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (getc);
+# endif
 #endif
 
 #if @GNULIB_GETCHAR@
@@ -660,7 +802,9 @@ _GL_CXXALIAS_RPL (getchar, int, (void));
 # else
 _GL_CXXALIAS_SYS (getchar, int, (void));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (getchar);
+# endif
 #endif
 
 #if @GNULIB_GETDELIM@
@@ -676,22 +820,26 @@ _GL_CXXALIASWARN (getchar);
 #   define getdelim rpl_getdelim
 #  endif
 _GL_FUNCDECL_RPL (getdelim, ssize_t,
-                  (char **lineptr, size_t *linesize, int delimiter,
-                   FILE *stream)
+                  (char **restrict lineptr, size_t *restrict linesize,
+                   int delimiter,
+                   FILE *restrict stream)
                   _GL_ARG_NONNULL ((1, 2, 4)));
 _GL_CXXALIAS_RPL (getdelim, ssize_t,
-                  (char **lineptr, size_t *linesize, int delimiter,
-                   FILE *stream));
+                  (char **restrict lineptr, size_t *restrict linesize,
+                   int delimiter,
+                   FILE *restrict stream));
 # else
 #  if !@HAVE_DECL_GETDELIM@
 _GL_FUNCDECL_SYS (getdelim, ssize_t,
-                  (char **lineptr, size_t *linesize, int delimiter,
-                   FILE *stream)
+                  (char **restrict lineptr, size_t *restrict linesize,
+                   int delimiter,
+                   FILE *restrict stream)
                   _GL_ARG_NONNULL ((1, 2, 4)));
 #  endif
 _GL_CXXALIAS_SYS (getdelim, ssize_t,
-                  (char **lineptr, size_t *linesize, int delimiter,
-                   FILE *stream));
+                  (char **restrict lineptr, size_t *restrict linesize,
+                   int delimiter,
+                   FILE *restrict stream));
 # endif
 _GL_CXXALIASWARN (getdelim);
 #elif defined GNULIB_POSIXCHECK
@@ -715,18 +863,22 @@ _GL_WARN_ON_USE (getdelim, "getdelim is unportable - "
 #   define getline rpl_getline
 #  endif
 _GL_FUNCDECL_RPL (getline, ssize_t,
-                  (char **lineptr, size_t *linesize, FILE *stream)
+                  (char **restrict lineptr, size_t *restrict linesize,
+                   FILE *restrict stream)
                   _GL_ARG_NONNULL ((1, 2, 3)));
 _GL_CXXALIAS_RPL (getline, ssize_t,
-                  (char **lineptr, size_t *linesize, FILE *stream));
+                  (char **restrict lineptr, size_t *restrict linesize,
+                   FILE *restrict stream));
 # else
 #  if !@HAVE_DECL_GETLINE@
 _GL_FUNCDECL_SYS (getline, ssize_t,
-                  (char **lineptr, size_t *linesize, FILE *stream)
+                  (char **restrict lineptr, size_t *restrict linesize,
+                   FILE *restrict stream)
                   _GL_ARG_NONNULL ((1, 2, 3)));
 #  endif
 _GL_CXXALIAS_SYS (getline, ssize_t,
-                  (char **lineptr, size_t *linesize, FILE *stream));
+                  (char **restrict lineptr, size_t *restrict linesize,
+                   FILE *restrict stream));
 # endif
 # if @HAVE_DECL_GETLINE@
 _GL_CXXALIASWARN (getline);
@@ -747,6 +899,22 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
 _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
 #endif
 
+#if @GNULIB_MDA_GETW@
+/* On native Windows, map 'getw' to '_getw', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::getw always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getw
+#   define getw _getw
+#  endif
+_GL_CXXALIAS_MDA (getw, int, (FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (getw, int, (FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (getw);
+#endif
+
 #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@
 struct obstack;
 /* Grow an obstack with formatted output.  Return the number of
@@ -760,7 +928,7 @@ struct obstack;
 #  endif
 _GL_FUNCDECL_RPL (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...));
@@ -768,7 +936,7 @@ _GL_CXXALIAS_RPL (obstack_printf, int,
 #  if !@HAVE_DECL_OBSTACK_PRINTF@
 _GL_FUNCDECL_SYS (obstack_printf, int,
                   (struct obstack *obs, const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (obstack_printf, int,
@@ -781,7 +949,7 @@ _GL_CXXALIASWARN (obstack_printf);
 #  endif
 _GL_FUNCDECL_RPL (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args));
@@ -789,7 +957,7 @@ _GL_CXXALIAS_RPL (obstack_vprintf, int,
 #  if !@HAVE_DECL_OBSTACK_PRINTF@
 _GL_FUNCDECL_SYS (obstack_vprintf, int,
                   (struct obstack *obs, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (obstack_vprintf, int,
@@ -825,7 +993,9 @@ _GL_CXXALIAS_RPL (perror, void, (const char *string));
 # else
 _GL_CXXALIAS_SYS (perror, void, (const char *string));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (perror);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef perror
 /* Assume perror is always declared.  */
@@ -861,21 +1031,21 @@ _GL_WARN_ON_USE (popen, "popen is buggy on some platforms - "
 #if @GNULIB_PRINTF_POSIX@ || @GNULIB_PRINTF@
 # if (@GNULIB_PRINTF_POSIX@ && @REPLACE_PRINTF@) \
      || (@GNULIB_PRINTF@ && @REPLACE_STDIO_WRITE_FUNCS@ && (@GNULIB_STDIO_H_NONBLOCKING@ || @GNULIB_STDIO_H_SIGPIPE@))
-#  if defined __GNUC__
+#  if defined __GNUC__ || defined __clang__
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 /* Don't break __attribute__((format(printf,M,N))).  */
 #    define printf __printf__
 #   endif
 #   if @GNULIB_PRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
 _GL_FUNCDECL_RPL_1 (__printf__, int,
-                    (const char *format, ...)
+                    (const char *restrict format, ...)
                     __asm__ (@ASM_SYMBOL_PREFIX@
                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
-                    _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
+                    _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
                     _GL_ARG_NONNULL ((1)));
 #   else
 _GL_FUNCDECL_RPL_1 (__printf__, int,
-                    (const char *format, ...)
+                    (const char *restrict format, ...)
                     __asm__ (@ASM_SYMBOL_PREFIX@
                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_printf))
                     _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 2)
@@ -887,16 +1057,18 @@ _GL_CXXALIAS_RPL_1 (printf, __printf__, int, (const char *format, ...));
 #    define printf rpl_printf
 #   endif
 _GL_FUNCDECL_RPL (printf, int,
-                  (const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (1, 2)
+                  (const char *restrict format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 2)
                   _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (printf, int, (const char *format, ...));
+_GL_CXXALIAS_RPL (printf, int, (const char *restrict format, ...));
 #  endif
 #  define GNULIB_overrides_printf 1
 # else
-_GL_CXXALIAS_SYS (printf, int, (const char *format, ...));
+_GL_CXXALIAS_SYS (printf, int, (const char *restrict format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (printf);
+# endif
 #endif
 #if !@GNULIB_PRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 # if !GNULIB_overrides_printf
@@ -919,7 +1091,9 @@ _GL_CXXALIAS_RPL_1 (putc, rpl_fputc, int, (int c, FILE *stream));
 # else
 _GL_CXXALIAS_SYS (putc, int, (int c, FILE *stream));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (putc);
+# endif
 #endif
 
 #if @GNULIB_PUTCHAR@
@@ -933,7 +1107,9 @@ _GL_CXXALIAS_RPL (putchar, int, (int c));
 # else
 _GL_CXXALIAS_SYS (putchar, int, (int c));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (putchar);
+# endif
 #endif
 
 #if @GNULIB_PUTS@
@@ -947,7 +1123,25 @@ _GL_CXXALIAS_RPL (puts, int, (const char *string));
 # else
 _GL_CXXALIAS_SYS (puts, int, (const char *string));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (puts);
+# endif
+#endif
+
+#if @GNULIB_MDA_PUTW@
+/* On native Windows, map 'putw' to '_putw', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::putw always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putw
+#   define putw _putw
+#  endif
+_GL_CXXALIAS_MDA (putw, int, (int w, FILE *restrict stream));
+# else
+_GL_CXXALIAS_SYS (putw, int, (int w, FILE *restrict stream));
+# endif
+_GL_CXXALIASWARN (putw);
 #endif
 
 #if @GNULIB_REMOVE@
@@ -961,7 +1155,9 @@ _GL_CXXALIAS_RPL (remove, int, (const char *name));
 # else
 _GL_CXXALIAS_SYS (remove, int, (const char *name));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (remove);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef remove
 /* Assume remove is always declared.  */
@@ -984,7 +1180,9 @@ _GL_CXXALIAS_RPL (rename, int,
 _GL_CXXALIAS_SYS (rename, int,
                   (const char *old_filename, const char *new_filename));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (rename);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef rename
 /* Assume rename is always declared.  */
@@ -1023,33 +1221,35 @@ _GL_WARN_ON_USE (renameat, "renameat is not portable - "
 
 #if @GNULIB_SCANF@
 # if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
-#  if defined __GNUC__
+#  if defined __GNUC__ || defined __clang__
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #    undef scanf
 /* Don't break __attribute__((format(scanf,M,N))).  */
 #    define scanf __scanf__
 #   endif
 _GL_FUNCDECL_RPL_1 (__scanf__, int,
-                    (const char *format, ...)
+                    (const char *restrict format, ...)
                     __asm__ (@ASM_SYMBOL_PREFIX@
                              _GL_STDIO_MACROEXPAND_AND_STRINGIZE(rpl_scanf))
                     _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
                     _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *format, ...));
+_GL_CXXALIAS_RPL_1 (scanf, __scanf__, int, (const char *restrict format, ...));
 #  else
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #    undef scanf
 #    define scanf rpl_scanf
 #   endif
-_GL_FUNCDECL_RPL (scanf, int, (const char *format, ...)
+_GL_FUNCDECL_RPL (scanf, int, (const char *restrict format, ...)
                               _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 2)
                               _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (scanf, int, (const char *format, ...));
+_GL_CXXALIAS_RPL (scanf, int, (const char *restrict format, ...));
 #  endif
 # else
-_GL_CXXALIAS_SYS (scanf, int, (const char *format, ...));
+_GL_CXXALIAS_SYS (scanf, int, (const char *restrict format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (scanf);
+# endif
 #endif
 
 #if @GNULIB_SNPRINTF@
@@ -1058,22 +1258,28 @@ _GL_CXXALIASWARN (scanf);
 #   define snprintf rpl_snprintf
 #  endif
 _GL_FUNCDECL_RPL (snprintf, int,
-                  (char *str, size_t size, const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
+                  (char *restrict str, size_t size,
+                   const char *restrict format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
                   _GL_ARG_NONNULL ((3)));
 _GL_CXXALIAS_RPL (snprintf, int,
-                  (char *str, size_t size, const char *format, ...));
+                  (char *restrict str, size_t size,
+                   const char *restrict format, ...));
 # else
 #  if !@HAVE_DECL_SNPRINTF@
 _GL_FUNCDECL_SYS (snprintf, int,
-                  (char *str, size_t size, const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 4)
+                  (char *restrict str, size_t size,
+                   const char *restrict format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 4)
                   _GL_ARG_NONNULL ((3)));
 #  endif
 _GL_CXXALIAS_SYS (snprintf, int,
-                  (char *str, size_t size, const char *format, ...));
+                  (char *restrict str, size_t size,
+                   const char *restrict format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (snprintf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef snprintf
 # if HAVE_RAW_DECL_SNPRINTF
@@ -1096,14 +1302,19 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define sprintf rpl_sprintf
 #  endif
-_GL_FUNCDECL_RPL (sprintf, int, (char *str, const char *format, ...)
-                                _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
-                                _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_RPL (sprintf, int, (char *str, const char *format, ...));
+_GL_FUNCDECL_RPL (sprintf, int,
+                  (char *restrict str, const char *restrict format, ...)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (sprintf, int,
+                  (char *restrict str, const char *restrict format, ...));
 # else
-_GL_CXXALIAS_SYS (sprintf, int, (char *str, const char *format, ...));
+_GL_CXXALIAS_SYS (sprintf, int,
+                  (char *restrict str, const char *restrict format, ...));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (sprintf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef sprintf
 /* Assume sprintf is always declared.  */
@@ -1112,6 +1323,22 @@ _GL_WARN_ON_USE (sprintf, "sprintf is not always POSIX compliant - "
                  "POSIX compliance");
 #endif
 
+#if @GNULIB_MDA_TEMPNAM@
+/* On native Windows, map 'tempnam' to '_tempnam', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::tempnam always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef tempnam
+#   define tempnam _tempnam
+#  endif
+_GL_CXXALIAS_MDA (tempnam, char *, (const char *dir, const char *prefix));
+# else
+_GL_CXXALIAS_SYS (tempnam, char *, (const char *dir, const char *prefix));
+# endif
+_GL_CXXALIASWARN (tempnam);
+#endif
+
 #if @GNULIB_TMPFILE@
 # if @REPLACE_TMPFILE@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1122,7 +1349,9 @@ _GL_CXXALIAS_RPL (tmpfile, FILE *, (void));
 # else
 _GL_CXXALIAS_SYS (tmpfile, FILE *, (void));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (tmpfile);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef tmpfile
 # if HAVE_RAW_DECL_TMPFILE
@@ -1142,7 +1371,7 @@ _GL_WARN_ON_USE (tmpfile, "tmpfile is not usable on mingw - "
 #  endif
 _GL_FUNCDECL_RPL (asprintf, int,
                   (char **result, const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (asprintf, int,
                   (char **result, const char *format, ...));
@@ -1150,7 +1379,7 @@ _GL_CXXALIAS_RPL (asprintf, int,
 #  if !@HAVE_VASPRINTF@
 _GL_FUNCDECL_SYS (asprintf, int,
                   (char **result, const char *format, ...)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 3)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (asprintf, int,
@@ -1163,7 +1392,7 @@ _GL_CXXALIASWARN (asprintf);
 #  endif
 _GL_FUNCDECL_RPL (vasprintf, int,
                   (char **result, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vasprintf, int,
                   (char **result, const char *format, va_list args));
@@ -1171,7 +1400,7 @@ _GL_CXXALIAS_RPL (vasprintf, int,
 #  if !@HAVE_VASPRINTF@
 _GL_FUNCDECL_SYS (vasprintf, int,
                   (char **result, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (vasprintf, int,
@@ -1185,22 +1414,27 @@ _GL_CXXALIASWARN (vasprintf);
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define vdprintf rpl_vdprintf
 #  endif
-_GL_FUNCDECL_RPL (vdprintf, int, (int fd, const char *format, va_list args)
-                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
-                                 _GL_ARG_NONNULL ((2)));
-_GL_CXXALIAS_RPL (vdprintf, int, (int fd, const char *format, va_list args));
+_GL_FUNCDECL_RPL (vdprintf, int,
+                  (int fd, const char *restrict format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (vdprintf, int,
+                  (int fd, const char *restrict format, va_list args));
 # else
 #  if !@HAVE_VDPRINTF@
-_GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
-                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
-                                 _GL_ARG_NONNULL ((2)));
+_GL_FUNCDECL_SYS (vdprintf, int,
+                  (int fd, const char *restrict format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+                  _GL_ARG_NONNULL ((2)));
 #  endif
 /* Need to cast, because on Solaris, the third parameter will likely be
                                                     __va_list args.  */
 _GL_CXXALIAS_SYS_CAST (vdprintf, int,
-                       (int fd, const char *format, va_list args));
+                       (int fd, const char *restrict format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vdprintf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef vdprintf
 # if HAVE_RAW_DECL_VDPRINTF
@@ -1217,23 +1451,32 @@ _GL_WARN_ON_USE (vdprintf, "vdprintf is unportable - "
 #  endif
 #  define GNULIB_overrides_vfprintf 1
 #  if @GNULIB_VFPRINTF_POSIX@
-_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
-                                 _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
-                                 _GL_ARG_NONNULL ((1, 2)));
+_GL_FUNCDECL_RPL (vfprintf, int,
+                  (FILE *restrict fp,
+                   const char *restrict format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
+                  _GL_ARG_NONNULL ((1, 2)));
 #  else
-_GL_FUNCDECL_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args)
-                                 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
-                                 _GL_ARG_NONNULL ((1, 2)));
+_GL_FUNCDECL_RPL (vfprintf, int,
+                  (FILE *restrict fp,
+                   const char *restrict format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (2, 0)
+                  _GL_ARG_NONNULL ((1, 2)));
 #  endif
-_GL_CXXALIAS_RPL (vfprintf, int, (FILE *fp, const char *format, va_list args));
+_GL_CXXALIAS_RPL (vfprintf, int,
+                  (FILE *restrict fp,
+                   const char *restrict format, va_list args));
 # else
 /* Need to cast, because on Solaris, the third parameter is
                                                       __va_list args
    and GCC's fixincludes did not change this to __gnuc_va_list.  */
 _GL_CXXALIAS_SYS_CAST (vfprintf, int,
-                       (FILE *fp, const char *format, va_list args));
+                       (FILE *restrict fp,
+                        const char *restrict format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vfprintf);
+# endif
 #endif
 #if !@GNULIB_VFPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 # if !GNULIB_overrides_vfprintf
@@ -1252,16 +1495,21 @@ _GL_WARN_ON_USE (vfprintf, "vfprintf is not always POSIX compliant - "
 #   define vfscanf rpl_vfscanf
 #  endif
 _GL_FUNCDECL_RPL (vfscanf, int,
-                  (FILE *stream, const char *format, va_list args)
+                  (FILE *restrict stream,
+                   const char *restrict format, va_list args)
                   _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vfscanf, int,
-                  (FILE *stream, const char *format, va_list args));
+                  (FILE *restrict stream,
+                   const char *restrict format, va_list args));
 # else
 _GL_CXXALIAS_SYS (vfscanf, int,
-                  (FILE *stream, const char *format, va_list args));
+                  (FILE *restrict stream,
+                   const char *restrict format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vfscanf);
+# endif
 #endif
 
 #if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VPRINTF@
@@ -1272,22 +1520,25 @@ _GL_CXXALIASWARN (vfscanf);
 #  endif
 #  define GNULIB_overrides_vprintf 1
 #  if @GNULIB_VPRINTF_POSIX@ || @GNULIB_VFPRINTF_POSIX@
-_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
-                                _GL_ATTRIBUTE_FORMAT_PRINTF (1, 0)
+_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
+                                _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (1, 0)
                                 _GL_ARG_NONNULL ((1)));
 #  else
-_GL_FUNCDECL_RPL (vprintf, int, (const char *format, va_list args)
+_GL_FUNCDECL_RPL (vprintf, int, (const char *restrict format, va_list args)
                                 _GL_ATTRIBUTE_FORMAT_PRINTF_SYSTEM (1, 0)
                                 _GL_ARG_NONNULL ((1)));
 #  endif
-_GL_CXXALIAS_RPL (vprintf, int, (const char *format, va_list args));
+_GL_CXXALIAS_RPL (vprintf, int, (const char *restrict format, va_list args));
 # else
 /* Need to cast, because on Solaris, the second parameter is
                                                           __va_list args
    and GCC's fixincludes did not change this to __gnuc_va_list.  */
-_GL_CXXALIAS_SYS_CAST (vprintf, int, (const char *format, va_list args));
+_GL_CXXALIAS_SYS_CAST (vprintf, int,
+                       (const char *restrict format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vprintf);
+# endif
 #endif
 #if !@GNULIB_VPRINTF_POSIX@ && defined GNULIB_POSIXCHECK
 # if !GNULIB_overrides_vprintf
@@ -1305,14 +1556,16 @@ _GL_WARN_ON_USE (vprintf, "vprintf is not always POSIX compliant - "
 #   undef vscanf
 #   define vscanf rpl_vscanf
 #  endif
-_GL_FUNCDECL_RPL (vscanf, int, (const char *format, va_list args)
+_GL_FUNCDECL_RPL (vscanf, int, (const char *restrict format, va_list args)
                                _GL_ATTRIBUTE_FORMAT_SCANF_SYSTEM (1, 0)
                                _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (vscanf, int, (const char *format, va_list args));
+_GL_CXXALIAS_RPL (vscanf, int, (const char *restrict format, va_list args));
 # else
-_GL_CXXALIAS_SYS (vscanf, int, (const char *format, va_list args));
+_GL_CXXALIAS_SYS (vscanf, int, (const char *restrict format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vscanf);
+# endif
 #endif
 
 #if @GNULIB_VSNPRINTF@
@@ -1321,22 +1574,28 @@ _GL_CXXALIASWARN (vscanf);
 #   define vsnprintf rpl_vsnprintf
 #  endif
 _GL_FUNCDECL_RPL (vsnprintf, int,
-                  (char *str, size_t size, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
+                  (char *restrict str, size_t size,
+                   const char *restrict format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
                   _GL_ARG_NONNULL ((3)));
 _GL_CXXALIAS_RPL (vsnprintf, int,
-                  (char *str, size_t size, const char *format, va_list args));
+                  (char *restrict str, size_t size,
+                   const char *restrict format, va_list args));
 # else
 #  if !@HAVE_DECL_VSNPRINTF@
 _GL_FUNCDECL_SYS (vsnprintf, int,
-                  (char *str, size_t size, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (3, 0)
+                  (char *restrict str, size_t size,
+                   const char *restrict format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (3, 0)
                   _GL_ARG_NONNULL ((3)));
 #  endif
 _GL_CXXALIAS_SYS (vsnprintf, int,
-                  (char *str, size_t size, const char *format, va_list args));
+                  (char *restrict str, size_t size,
+                   const char *restrict format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vsnprintf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef vsnprintf
 # if HAVE_RAW_DECL_VSNPRINTF
@@ -1351,19 +1610,24 @@ _GL_WARN_ON_USE (vsnprintf, "vsnprintf is unportable - "
 #   define vsprintf rpl_vsprintf
 #  endif
 _GL_FUNCDECL_RPL (vsprintf, int,
-                  (char *str, const char *format, va_list args)
-                  _GL_ATTRIBUTE_FORMAT_PRINTF (2, 0)
+                  (char *restrict str,
+                   const char *restrict format, va_list args)
+                  _GL_ATTRIBUTE_FORMAT_PRINTF_STANDARD (2, 0)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (vsprintf, int,
-                  (char *str, const char *format, va_list args));
+                  (char *restrict str,
+                   const char *restrict format, va_list args));
 # else
 /* Need to cast, because on Solaris, the third parameter is
                                                        __va_list args
    and GCC's fixincludes did not change this to __gnuc_va_list.  */
 _GL_CXXALIAS_SYS_CAST (vsprintf, int,
-                       (char *str, const char *format, va_list args));
+                       (char *restrict str,
+                        const char *restrict format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vsprintf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef vsprintf
 /* Assume vsprintf is always declared.  */
index af83455..9f0d3f6 100644 (file)
@@ -1,6 +1,6 @@
 /* Like stdlib.h, but redefine some names to avoid glitches.
 
-   Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
index 91294f4..8ab7aa5 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke stdlib.h functions, but avoid some glitches.
 
-   Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
index db3253b..91079b1 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <stdlib.h>.
 
-   Copyright (C) 1995, 2001-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1995, 2001-2004, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 
 /* Solaris declares getloadavg() in <sys/loadavg.h>.  */
 #if (@GNULIB_GETLOADAVG@ || defined GNULIB_POSIXCHECK) && @HAVE_SYS_LOADAVG_H@
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+   <sys/loadavg.h>.  */
+# include <sys/time.h>
 # include <sys/loadavg.h>
 #endif
 
-/* Native Windows platforms declare mktemp() in <io.h>.  */
-#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+/* Native Windows platforms declare _mktemp() in <io.h>.  */
+#if defined _WIN32 && !defined __CYGWIN__
 # include <io.h>
 #endif
 
@@ -87,9 +90,10 @@ struct random_data
 # endif
 #endif
 
-#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if (@GNULIB_MKSTEMP@ || @GNULIB_MKSTEMPS@ || @GNULIB_MKOSTEMP@ || @GNULIB_MKOSTEMPS@ || @GNULIB_GETSUBOPT@ || defined GNULIB_POSIXCHECK) && ! defined __GLIBC__ && !(defined _WIN32 && ! defined __CYGWIN__)
 /* On Mac OS X 10.3, only <unistd.h> declares mkstemp.  */
 /* On Mac OS X 10.5, only <unistd.h> declares mkstemps.  */
+/* On Mac OS X 10.13, only <unistd.h> declares mkostemp and mkostemps.  */
 /* On Cygwin 1.7.1, only <unistd.h> declares getsubopt.  */
 /* But avoid namespace pollution on glibc systems and native Windows.  */
 # include <unistd.h>
@@ -97,10 +101,12 @@ struct random_data
 
 /* The __attribute__ feature is available in gcc versions 2.5 and later.
    The attribute __pure__ was added in gcc 2.96.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+#  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+#  define _GL_ATTRIBUTE_PURE /* empty */
+# endif
 #endif
 
 /* The definition of _Noreturn is copied here.  */
@@ -143,6 +149,31 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
 #endif
 
 
+/* Allocate memory with indefinite extent and specified alignment.  */
+#if @GNULIB_ALIGNED_ALLOC@
+# if @REPLACE_ALIGNED_ALLOC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef aligned_alloc
+#   define aligned_alloc rpl_aligned_alloc
+#  endif
+_GL_FUNCDECL_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
+_GL_CXXALIAS_RPL (aligned_alloc, void *, (size_t alignment, size_t size));
+# else
+#  if @HAVE_ALIGNED_ALLOC@
+_GL_CXXALIAS_SYS (aligned_alloc, void *, (size_t alignment, size_t size));
+#  endif
+# endif
+# if @HAVE_ALIGNED_ALLOC@
+_GL_CXXALIASWARN (aligned_alloc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef aligned_alloc
+# if HAVE_RAW_DECL_ALIGNED_ALLOC
+_GL_WARN_ON_USE (aligned_alloc, "aligned_alloc is not portable - "
+                 "use gnulib module aligned_alloc for portability");
+# endif
+#endif
+
 #if @GNULIB_ATOLL@
 /* Parse a signed decimal integer.
    Returns the value of the integer.  Errors are not detected.  */
@@ -172,7 +203,9 @@ _GL_CXXALIAS_RPL (calloc, void *, (size_t nmemb, size_t size));
 # else
 _GL_CXXALIAS_SYS (calloc, void *, (size_t nmemb, size_t size));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (calloc);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef calloc
 /* Assume calloc is always declared.  */
@@ -195,6 +228,10 @@ _GL_FUNCDECL_SYS (canonicalize_file_name, char *, (const char *name)
 #  endif
 _GL_CXXALIAS_SYS (canonicalize_file_name, char *, (const char *name));
 # endif
+# ifndef GNULIB_defined_canonicalize_file_name
+#  define GNULIB_defined_canonicalize_file_name \
+     (!@HAVE_CANONICALIZE_FILE_NAME@ || @REPLACE_CANONICALIZE_FILE_NAME@)
+# endif
 _GL_CXXALIASWARN (canonicalize_file_name);
 #elif defined GNULIB_POSIXCHECK
 # undef canonicalize_file_name
@@ -205,6 +242,94 @@ _GL_WARN_ON_USE (canonicalize_file_name,
 # endif
 #endif
 
+#if @GNULIB_MDA_ECVT@
+/* On native Windows, map 'ecvt' to '_ecvt', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::ecvt on all platforms that have
+   it.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ecvt
+#   define ecvt _ecvt
+#  endif
+_GL_CXXALIAS_MDA (ecvt, char *,
+                  (double number, int ndigits, int *decptp, int *signp));
+# else
+#  if @HAVE_DECL_ECVT@
+_GL_CXXALIAS_SYS (ecvt, char *,
+                  (double number, int ndigits, int *decptp, int *signp));
+#  endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_ECVT@
+_GL_CXXALIASWARN (ecvt);
+# endif
+#endif
+
+#if @GNULIB_MDA_FCVT@
+/* On native Windows, map 'fcvt' to '_fcvt', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::fcvt on all platforms that have
+   it.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fcvt
+#   define fcvt _fcvt
+#  endif
+_GL_CXXALIAS_MDA (fcvt, char *,
+                  (double number, int ndigits, int *decptp, int *signp));
+# else
+#  if @HAVE_DECL_FCVT@
+_GL_CXXALIAS_SYS (fcvt, char *,
+                  (double number, int ndigits, int *decptp, int *signp));
+#  endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_FCVT@
+_GL_CXXALIASWARN (fcvt);
+# endif
+#endif
+
+#if @GNULIB_FREE_POSIX@
+# if @REPLACE_FREE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef free
+#   define free rpl_free
+#  endif
+_GL_FUNCDECL_RPL (free, void, (void *ptr));
+_GL_CXXALIAS_RPL (free, void, (void *ptr));
+# else
+_GL_CXXALIAS_SYS (free, void, (void *ptr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (free);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef free
+/* Assume free is always declared.  */
+_GL_WARN_ON_USE (free, "free is not future POSIX compliant everywhere - "
+                 "use gnulib module free for portability");
+#endif
+
+#if @GNULIB_MDA_GCVT@
+/* On native Windows, map 'gcvt' to '_gcvt', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::gcvt on all platforms that have
+   it.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef gcvt
+#   define gcvt _gcvt
+#  endif
+_GL_CXXALIAS_MDA (gcvt, char *, (double number, int ndigits, char *buf));
+# else
+#  if @HAVE_DECL_GCVT@
+_GL_CXXALIAS_SYS (gcvt, char *, (double number, int ndigits, char *buf));
+#  endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_GCVT@
+_GL_CXXALIASWARN (gcvt);
+# endif
+#endif
+
 #if @GNULIB_GETLOADAVG@
 /* Store max(NELEM,3) load average numbers in LOADAVG[].
    The three numbers are the load average of the last 1 minute, the last 5
@@ -234,8 +359,8 @@ _GL_WARN_ON_USE (getloadavg, "getloadavg is not portable - "
        element (or NULL if it doesn't contain an "=" sign),
      - It returns the index of the "token" in the given array of tokens.
    Otherwise it returns -1, and *OPTIONP and *VALUEP are undefined.
-   For more details see the POSIX:2001 specification.
-   http://www.opengroup.org/susv3xsh/getsubopt.html */
+   For more details see the POSIX specification.
+   https://pubs.opengroup.org/onlinepubs/9699919799/functions/getsubopt.html */
 # if !@HAVE_GETSUBOPT@
 _GL_FUNCDECL_SYS (getsubopt, int,
                   (char **optionp, char *const *tokens, char **valuep)
@@ -284,7 +409,9 @@ _GL_CXXALIAS_RPL (malloc, void *, (size_t size));
 # else
 _GL_CXXALIAS_SYS (malloc, void *, (size_t size));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (malloc);
+# endif
 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
 # undef malloc
 /* Assume malloc is always declared.  */
@@ -299,12 +426,27 @@ _GL_WARN_ON_USE (malloc, "malloc is not POSIX compliant everywhere - "
 #   undef mbtowc
 #   define mbtowc rpl_mbtowc
 #  endif
-_GL_FUNCDECL_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
-_GL_CXXALIAS_RPL (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
+_GL_FUNCDECL_RPL (mbtowc, int,
+                  (wchar_t *restrict pwc, const char *restrict s, size_t n));
+_GL_CXXALIAS_RPL (mbtowc, int,
+                  (wchar_t *restrict pwc, const char *restrict s, size_t n));
 # else
-_GL_CXXALIAS_SYS (mbtowc, int, (wchar_t *pwc, const char *s, size_t n));
+#  if !@HAVE_MBTOWC@
+_GL_FUNCDECL_SYS (mbtowc, int,
+                  (wchar_t *restrict pwc, const char *restrict s, size_t n));
+#  endif
+_GL_CXXALIAS_SYS (mbtowc, int,
+                  (wchar_t *restrict pwc, const char *restrict s, size_t n));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (mbtowc);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef mbtowc
+# if HAVE_RAW_DECL_MBTOWC
+_GL_WARN_ON_USE (mbtowc, "mbtowc is not portable - "
+                 "use gnulib module mbtowc for portability");
+# endif
 #endif
 
 #if @GNULIB_MKDTEMP@
@@ -439,6 +581,51 @@ _GL_WARN_ON_USE (mkstemps, "mkstemps is unportable - "
 # endif
 #endif
 
+#if @GNULIB_MDA_MKTEMP@
+/* On native Windows, map 'mktemp' to '_mktemp', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::mktemp always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mktemp
+#   define mktemp _mktemp
+#  endif
+_GL_CXXALIAS_MDA (mktemp, char *, (char * /*template*/));
+# else
+_GL_CXXALIAS_SYS (mktemp, char *, (char * /*template*/));
+# endif
+_GL_CXXALIASWARN (mktemp);
+#endif
+
+/* Allocate memory with indefinite extent and specified alignment.  */
+#if @GNULIB_POSIX_MEMALIGN@
+# if @REPLACE_POSIX_MEMALIGN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef posix_memalign
+#   define posix_memalign rpl_posix_memalign
+#  endif
+_GL_FUNCDECL_RPL (posix_memalign, int,
+                  (void **memptr, size_t alignment, size_t size)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (posix_memalign, int,
+                  (void **memptr, size_t alignment, size_t size));
+# else
+#  if @HAVE_POSIX_MEMALIGN@
+_GL_CXXALIAS_SYS (posix_memalign, int,
+                  (void **memptr, size_t alignment, size_t size));
+#  endif
+# endif
+# if @HAVE_POSIX_MEMALIGN@
+_GL_CXXALIASWARN (posix_memalign);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef posix_memalign
+# if HAVE_RAW_DECL_POSIX_MEMALIGN
+_GL_WARN_ON_USE (posix_memalign, "posix_memalign is not portable - "
+                 "use gnulib module posix_memalign for portability");
+# endif
+#endif
+
 #if @GNULIB_POSIX_OPENPT@
 /* Return an FD open to the master side of a pseudo-terminal.  Flags should
    include O_RDWR, and may also include O_NOCTTY.  */
@@ -497,6 +684,9 @@ _GL_FUNCDECL_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
 #  endif
 _GL_CXXALIAS_SYS (ptsname_r, int, (int fd, char *buf, size_t len));
 # endif
+# ifndef GNULIB_defined_ptsname_r
+#  define GNULIB_defined_ptsname_r (!@HAVE_PTSNAME_R@ || @REPLACE_PTSNAME_R@)
+# endif
 _GL_CXXALIASWARN (ptsname_r);
 #elif defined GNULIB_POSIXCHECK
 # undef ptsname_r
@@ -514,6 +704,28 @@ _GL_WARN_ON_USE (ptsname_r, "ptsname_r is not portable - "
 #  endif
 _GL_FUNCDECL_RPL (putenv, int, (char *string) _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (putenv, int, (char *string));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putenv
+#   define putenv _putenv
+#  endif
+_GL_CXXALIAS_MDA (putenv, int, (char *string));
+# else
+_GL_CXXALIAS_SYS (putenv, int, (char *string));
+# endif
+_GL_CXXALIASWARN (putenv);
+#elif @GNULIB_MDA_PUTENV@
+/* On native Windows, map 'putenv' to '_putenv', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::putenv always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef putenv
+#   define putenv _putenv
+#  endif
+/* Need to cast, because on mingw, the parameter is either
+   'const char *string' or 'char *string'.  */
+_GL_CXXALIAS_MDA_CAST (putenv, int, (char *string));
 # else
 _GL_CXXALIAS_SYS (putenv, int, (char *string));
 # endif
@@ -569,10 +781,21 @@ _GL_WARN_ON_USE (qsort_r, "qsort_r is not portable - "
 
 
 #if @GNULIB_RANDOM@
-# if !@HAVE_RANDOM@
+# if @REPLACE_RANDOM@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef random
+#   define random rpl_random
+#  endif
+_GL_FUNCDECL_RPL (random, long, (void));
+_GL_CXXALIAS_RPL (random, long, (void));
+# else
+#  if !@HAVE_RANDOM@
 _GL_FUNCDECL_SYS (random, long, (void));
+#  endif
+/* Need to cast, because on Haiku, the return type is
+                               int.  */
+_GL_CXXALIAS_SYS_CAST (random, long, (void));
 # endif
-_GL_CXXALIAS_SYS (random, long, (void));
 _GL_CXXALIASWARN (random);
 #elif defined GNULIB_POSIXCHECK
 # undef random
@@ -583,10 +806,21 @@ _GL_WARN_ON_USE (random, "random is unportable - "
 #endif
 
 #if @GNULIB_RANDOM@
-# if !@HAVE_RANDOM@
+# if @REPLACE_RANDOM@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef srandom
+#   define srandom rpl_srandom
+#  endif
+_GL_FUNCDECL_RPL (srandom, void, (unsigned int seed));
+_GL_CXXALIAS_RPL (srandom, void, (unsigned int seed));
+# else
+#  if !@HAVE_RANDOM@
 _GL_FUNCDECL_SYS (srandom, void, (unsigned int seed));
+#  endif
+/* Need to cast, because on FreeBSD, the first parameter is
+                                       unsigned long seed.  */
+_GL_CXXALIAS_SYS_CAST (srandom, void, (unsigned int seed));
 # endif
-_GL_CXXALIAS_SYS (srandom, void, (unsigned int seed));
 _GL_CXXALIASWARN (srandom);
 #elif defined GNULIB_POSIXCHECK
 # undef srandom
@@ -597,31 +831,56 @@ _GL_WARN_ON_USE (srandom, "srandom is unportable - "
 #endif
 
 #if @GNULIB_RANDOM@
-# if !@HAVE_RANDOM@
+# if @REPLACE_INITSTATE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef initstate
+#   define initstate rpl_initstate
+#  endif
+_GL_FUNCDECL_RPL (initstate, char *,
+                  (unsigned int seed, char *buf, size_t buf_size)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (initstate, char *,
+                  (unsigned int seed, char *buf, size_t buf_size));
+# else
+#  if !@HAVE_INITSTATE@ || !@HAVE_DECL_INITSTATE@
 _GL_FUNCDECL_SYS (initstate, char *,
                   (unsigned int seed, char *buf, size_t buf_size)
                   _GL_ARG_NONNULL ((2)));
+#  endif
+/* Need to cast, because on FreeBSD, the first parameter is
+                        unsigned long seed.  */
+_GL_CXXALIAS_SYS_CAST (initstate, char *,
+                       (unsigned int seed, char *buf, size_t buf_size));
 # endif
-_GL_CXXALIAS_SYS (initstate, char *,
-                  (unsigned int seed, char *buf, size_t buf_size));
 _GL_CXXALIASWARN (initstate);
 #elif defined GNULIB_POSIXCHECK
 # undef initstate
-# if HAVE_RAW_DECL_INITSTATE_R
+# if HAVE_RAW_DECL_INITSTATE
 _GL_WARN_ON_USE (initstate, "initstate is unportable - "
                  "use gnulib module random for portability");
 # endif
 #endif
 
 #if @GNULIB_RANDOM@
-# if !@HAVE_RANDOM@
+# if @REPLACE_SETSTATE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef setstate
+#   define setstate rpl_setstate
+#  endif
+_GL_FUNCDECL_RPL (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (setstate, char *, (char *arg_state));
+# else
+#  if !@HAVE_SETSTATE@ || !@HAVE_DECL_SETSTATE@
 _GL_FUNCDECL_SYS (setstate, char *, (char *arg_state) _GL_ARG_NONNULL ((1)));
+#  endif
+/* Need to cast, because on Mac OS X 10.13, HP-UX, Solaris the first parameter
+   is                                     const char *arg_state.  */
+_GL_CXXALIAS_SYS_CAST (setstate, char *, (char *arg_state));
 # endif
-_GL_CXXALIAS_SYS (setstate, char *, (char *arg_state));
 _GL_CXXALIASWARN (setstate);
 #elif defined GNULIB_POSIXCHECK
 # undef setstate
-# if HAVE_RAW_DECL_SETSTATE_R
+# if HAVE_RAW_DECL_SETSTATE
 _GL_WARN_ON_USE (setstate, "setstate is unportable - "
                  "use gnulib module random for portability");
 # endif
@@ -702,9 +961,11 @@ _GL_FUNCDECL_SYS (initstate_r, int,
                    struct random_data *rand_state)
                   _GL_ARG_NONNULL ((2, 4)));
 #  endif
-_GL_CXXALIAS_SYS (initstate_r, int,
-                  (unsigned int seed, char *buf, size_t buf_size,
-                   struct random_data *rand_state));
+/* Need to cast, because on Haiku, the third parameter is
+                                                     unsigned long buf_size.  */
+_GL_CXXALIAS_SYS_CAST (initstate_r, int,
+                       (unsigned int seed, char *buf, size_t buf_size,
+                        struct random_data *rand_state));
 # endif
 _GL_CXXALIASWARN (initstate_r);
 #elif defined GNULIB_POSIXCHECK
@@ -732,8 +993,10 @@ _GL_FUNCDECL_SYS (setstate_r, int,
                   (char *arg_state, struct random_data *rand_state)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
-_GL_CXXALIAS_SYS (setstate_r, int,
-                  (char *arg_state, struct random_data *rand_state));
+/* Need to cast, because on Haiku, the first parameter is
+                        void *arg_state.  */
+_GL_CXXALIAS_SYS_CAST (setstate_r, int,
+                       (char *arg_state, struct random_data *rand_state));
 # endif
 _GL_CXXALIASWARN (setstate_r);
 #elif defined GNULIB_POSIXCHECK
@@ -757,7 +1020,9 @@ _GL_CXXALIAS_RPL (realloc, void *, (void *ptr, size_t size));
 # else
 _GL_CXXALIAS_SYS (realloc, void *, (void *ptr, size_t size));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (realloc);
+# endif
 #elif defined GNULIB_POSIXCHECK && !_GL_USE_STDLIB_ALLOC
 # undef realloc
 /* Assume realloc is always declared.  */
@@ -765,20 +1030,52 @@ _GL_WARN_ON_USE (realloc, "realloc is not POSIX compliant everywhere - "
                  "use gnulib module realloc-posix for portability");
 #endif
 
+
+#if @GNULIB_REALLOCARRAY@
+# if @REPLACE_REALLOCARRAY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef reallocarray
+#   define reallocarray rpl_reallocarray
+#  endif
+_GL_FUNCDECL_RPL (reallocarray, void *,
+                  (void *ptr, size_t nmemb, size_t size));
+_GL_CXXALIAS_RPL (reallocarray, void *,
+                  (void *ptr, size_t nmemb, size_t size));
+# else
+#  if ! @HAVE_REALLOCARRAY@
+_GL_FUNCDECL_SYS (reallocarray, void *,
+                  (void *ptr, size_t nmemb, size_t size));
+#  endif
+_GL_CXXALIAS_SYS (reallocarray, void *,
+                  (void *ptr, size_t nmemb, size_t size));
+# endif
+_GL_CXXALIASWARN (reallocarray);
+#elif defined GNULIB_POSIXCHECK
+# undef reallocarray
+# if HAVE_RAW_DECL_REALLOCARRAY
+_GL_WARN_ON_USE (reallocarray, "reallocarray is not portable - "
+                 "use gnulib module reallocarray for portability");
+# endif
+#endif
+
 #if @GNULIB_REALPATH@
 # if @REPLACE_REALPATH@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define realpath rpl_realpath
 #  endif
-_GL_FUNCDECL_RPL (realpath, char *, (const char *name, char *resolved)
-                                    _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (realpath, char *, (const char *name, char *resolved));
+_GL_FUNCDECL_RPL (realpath, char *,
+                  (const char *restrict name, char *restrict resolved)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (realpath, char *,
+                  (const char *restrict name, char *restrict resolved));
 # else
 #  if !@HAVE_REALPATH@
-_GL_FUNCDECL_SYS (realpath, char *, (const char *name, char *resolved)
-                                    _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (realpath, char *,
+                  (const char *restrict name, char *restrict resolved)
+                  _GL_ARG_NONNULL ((1)));
 #  endif
-_GL_CXXALIAS_SYS (realpath, char *, (const char *name, char *resolved));
+_GL_CXXALIAS_SYS (realpath, char *,
+                  (const char *restrict name, char *restrict resolved));
 # endif
 _GL_CXXALIASWARN (realpath);
 #elif defined GNULIB_POSIXCHECK
@@ -860,17 +1157,24 @@ _GL_WARN_ON_USE (setenv, "setenv is unportable - "
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define strtod rpl_strtod
 #  endif
-_GL_FUNCDECL_RPL (strtod, double, (const char *str, char **endp)
-                                  _GL_ARG_NONNULL ((1)));
-_GL_CXXALIAS_RPL (strtod, double, (const char *str, char **endp));
+#  define GNULIB_defined_strtod_function 1
+_GL_FUNCDECL_RPL (strtod, double,
+                  (const char *restrict str, char **restrict endp)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtod, double,
+                  (const char *restrict str, char **restrict endp));
 # else
 #  if !@HAVE_STRTOD@
-_GL_FUNCDECL_SYS (strtod, double, (const char *str, char **endp)
-                                  _GL_ARG_NONNULL ((1)));
+_GL_FUNCDECL_SYS (strtod, double,
+                  (const char *restrict str, char **restrict endp)
+                  _GL_ARG_NONNULL ((1)));
 #  endif
-_GL_CXXALIAS_SYS (strtod, double, (const char *str, char **endp));
+_GL_CXXALIAS_SYS (strtod, double,
+                  (const char *restrict str, char **restrict endp));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (strtod);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef strtod
 # if HAVE_RAW_DECL_STRTOD
@@ -879,6 +1183,77 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
 # endif
 #endif
 
+#if @GNULIB_STRTOLD@
+ /* Parse a 'long double' from STRING, updating ENDP if appropriate.  */
+# if @REPLACE_STRTOLD@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strtold rpl_strtold
+#  endif
+#  define GNULIB_defined_strtold_function 1
+_GL_FUNCDECL_RPL (strtold, long double,
+                  (const char *restrict str, char **restrict endp)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtold, long double,
+                  (const char *restrict str, char **restrict endp));
+# else
+#  if !@HAVE_STRTOLD@
+_GL_FUNCDECL_SYS (strtold, long double,
+                  (const char *restrict str, char **restrict endp)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strtold, long double,
+                  (const char *restrict str, char **restrict endp));
+# endif
+_GL_CXXALIASWARN (strtold);
+#elif defined GNULIB_POSIXCHECK
+# undef strtold
+# if HAVE_RAW_DECL_STRTOLD
+_GL_WARN_ON_USE (strtold, "strtold is unportable - "
+                 "use gnulib module strtold for portability");
+# endif
+#endif
+
+#if @GNULIB_STRTOL@
+/* Parse a signed integer whose textual representation starts at STRING.
+   The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
+   it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
+   "0x").
+   If ENDPTR is not NULL, the address of the first byte after the integer is
+   stored in *ENDPTR.
+   Upon overflow, the return value is LONG_MAX or LONG_MIN, and errno is set
+   to ERANGE.  */
+# if @REPLACE_STRTOL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strtol rpl_strtol
+#  endif
+#  define GNULIB_defined_strtol_function 1
+_GL_FUNCDECL_RPL (strtol, long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtol, long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base));
+# else
+#  if !@HAVE_STRTOL@
+_GL_FUNCDECL_SYS (strtol, long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strtol, long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base));
+# endif
+_GL_CXXALIASWARN (strtol);
+#elif defined GNULIB_POSIXCHECK
+# undef strtol
+# if HAVE_RAW_DECL_STRTOL
+_GL_WARN_ON_USE (strtol, "strtol is unportable - "
+                 "use gnulib module strtol for portability");
+# endif
+#endif
+
 #if @GNULIB_STRTOLL@
 /* Parse a signed integer whose textual representation starts at STRING.
    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
@@ -888,13 +1263,29 @@ _GL_WARN_ON_USE (strtod, "strtod is unportable - "
    stored in *ENDPTR.
    Upon overflow, the return value is LLONG_MAX or LLONG_MIN, and errno is set
    to ERANGE.  */
-# if !@HAVE_STRTOLL@
+# if @REPLACE_STRTOLL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strtoll rpl_strtoll
+#  endif
+#  define GNULIB_defined_strtoll_function 1
+_GL_FUNCDECL_RPL (strtoll, long long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoll, long long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base));
+# else
+#  if !@HAVE_STRTOLL@
 _GL_FUNCDECL_SYS (strtoll, long long,
-                  (const char *string, char **endptr, int base)
+                  (const char *restrict string, char **restrict endptr,
+                   int base)
                   _GL_ARG_NONNULL ((1)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (strtoll, long long,
-                  (const char *string, char **endptr, int base));
+                  (const char *restrict string, char **restrict endptr,
+                   int base));
+# endif
 _GL_CXXALIASWARN (strtoll);
 #elif defined GNULIB_POSIXCHECK
 # undef strtoll
@@ -904,6 +1295,46 @@ _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
 # endif
 #endif
 
+#if @GNULIB_STRTOUL@
+/* Parse an unsigned integer whose textual representation starts at STRING.
+   The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
+   it may be decimal or octal (with prefix "0") or hexadecimal (with prefix
+   "0x").
+   If ENDPTR is not NULL, the address of the first byte after the integer is
+   stored in *ENDPTR.
+   Upon overflow, the return value is ULONG_MAX, and errno is set to ERANGE.  */
+# if @REPLACE_STRTOUL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strtoul rpl_strtoul
+#  endif
+#  define GNULIB_defined_strtoul_function 1
+_GL_FUNCDECL_RPL (strtoul, unsigned long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoul, unsigned long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base));
+# else
+#  if !@HAVE_STRTOUL@
+_GL_FUNCDECL_SYS (strtoul, unsigned long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (strtoul, unsigned long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base));
+# endif
+_GL_CXXALIASWARN (strtoul);
+#elif defined GNULIB_POSIXCHECK
+# undef strtoul
+# if HAVE_RAW_DECL_STRTOUL
+_GL_WARN_ON_USE (strtoul, "strtoul is unportable - "
+                 "use gnulib module strtoul for portability");
+# endif
+#endif
+
 #if @GNULIB_STRTOULL@
 /* Parse an unsigned integer whose textual representation starts at STRING.
    The integer is expected to be in base BASE (2 <= BASE <= 36); if BASE == 0,
@@ -913,13 +1344,29 @@ _GL_WARN_ON_USE (strtoll, "strtoll is unportable - "
    stored in *ENDPTR.
    Upon overflow, the return value is ULLONG_MAX, and errno is set to
    ERANGE.  */
-# if !@HAVE_STRTOULL@
+# if @REPLACE_STRTOULL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define strtoull rpl_strtoull
+#  endif
+#  define GNULIB_defined_strtoull_function 1
+_GL_FUNCDECL_RPL (strtoull, unsigned long long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (strtoull, unsigned long long,
+                  (const char *restrict string, char **restrict endptr,
+                   int base));
+# else
+#  if !@HAVE_STRTOULL@
 _GL_FUNCDECL_SYS (strtoull, unsigned long long,
-                  (const char *string, char **endptr, int base)
+                  (const char *restrict string, char **restrict endptr,
+                   int base)
                   _GL_ARG_NONNULL ((1)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (strtoull, unsigned long long,
-                  (const char *string, char **endptr, int base));
+                  (const char *restrict string, char **restrict endptr,
+                   int base));
+# endif
 _GL_CXXALIASWARN (strtoull);
 #elif defined GNULIB_POSIXCHECK
 # undef strtoull
@@ -983,7 +1430,9 @@ _GL_CXXALIAS_RPL (wctomb, int, (char *s, wchar_t wc));
 # else
 _GL_CXXALIAS_SYS (wctomb, int, (char *s, wchar_t wc));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wctomb);
+# endif
 #endif
 
 
diff --git a/lib/stpcpy.c b/lib/stpcpy.c
new file mode 100644 (file)
index 0000000..a4165ba
--- /dev/null
@@ -0,0 +1,49 @@
+/* stpcpy.c -- copy a string and return pointer to end of new string
+   Copyright (C) 1992, 1995, 1997-1998, 2006, 2009-2021 Free Software
+   Foundation, Inc.
+
+   NOTE: The canonical source of this file is maintained with the GNU C Library.
+   Bugs can be reported to bug-glibc@prep.ai.mit.edu.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by the
+   Free Software Foundation; either version 3 of the License, or any
+   later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <string.h>
+
+#undef __stpcpy
+#ifdef _LIBC
+# undef stpcpy
+#endif
+
+#ifndef weak_alias
+# define __stpcpy stpcpy
+#endif
+
+/* Copy SRC to DEST, returning the address of the terminating '\0' in DEST.  */
+char *
+__stpcpy (char *dest, const char *src)
+{
+  register char *d = dest;
+  register const char *s = src;
+
+  do
+    *d++ = *s;
+  while (*s++ != '\0');
+
+  return d - 1;
+}
+#ifdef weak_alias
+weak_alias (__stpcpy, stpcpy)
+#endif
diff --git a/lib/str-kmp.h b/lib/str-kmp.h
new file mode 100644 (file)
index 0000000..d076dee
--- /dev/null
@@ -0,0 +1,153 @@
+/* Substring search in a NUL terminated string of UNIT elements,
+   using the Knuth-Morris-Pratt algorithm.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2005.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Before including this file, you need to define:
+     UNIT                    The element type of the needle and haystack.
+     CANON_ELEMENT(c)        A macro that canonicalizes an element right after
+                             it has been fetched from needle or haystack.
+                             The argument is of type UNIT; the result must be
+                             of type UNIT as well.  */
+
+/* Knuth-Morris-Pratt algorithm.
+   See https://en.wikipedia.org/wiki/Knuth-Morris-Pratt_algorithm
+   HAYSTACK is the NUL terminated string in which to search for.
+   NEEDLE is the string to search for in HAYSTACK, consisting of NEEDLE_LEN
+   units.
+   Return a boolean indicating success:
+   Return true and set *RESULTP if the search was completed.
+   Return false if it was aborted because not enough memory was available.  */
+static bool
+knuth_morris_pratt (const UNIT *haystack,
+                    const UNIT *needle, size_t needle_len,
+                    const UNIT **resultp)
+{
+  size_t m = needle_len;
+
+  /* Allocate the table.  */
+  size_t *table = (size_t *) nmalloca (m, sizeof (size_t));
+  if (table == NULL)
+    return false;
+  /* Fill the table.
+     For 0 < i < m:
+       0 < table[i] <= i is defined such that
+       forall 0 < x < table[i]: needle[x..i-1] != needle[0..i-1-x],
+       and table[i] is as large as possible with this property.
+     This implies:
+     1) For 0 < i < m:
+          If table[i] < i,
+          needle[table[i]..i-1] = needle[0..i-1-table[i]].
+     2) For 0 < i < m:
+          rhaystack[0..i-1] == needle[0..i-1]
+          and exists h, i <= h < m: rhaystack[h] != needle[h]
+          implies
+          forall 0 <= x < table[i]: rhaystack[x..x+m-1] != needle[0..m-1].
+     table[0] remains uninitialized.  */
+  {
+    size_t i, j;
+
+    /* i = 1: Nothing to verify for x = 0.  */
+    table[1] = 1;
+    j = 0;
+
+    for (i = 2; i < m; i++)
+      {
+        /* Here: j = i-1 - table[i-1].
+           The inequality needle[x..i-1] != needle[0..i-1-x] is known to hold
+           for x < table[i-1], by induction.
+           Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1].  */
+        UNIT b = CANON_ELEMENT (needle[i - 1]);
+
+        for (;;)
+          {
+            /* Invariants: The inequality needle[x..i-1] != needle[0..i-1-x]
+               is known to hold for x < i-1-j.
+               Furthermore, if j>0: needle[i-1-j..i-2] = needle[0..j-1].  */
+            if (b == CANON_ELEMENT (needle[j]))
+              {
+                /* Set table[i] := i-1-j.  */
+                table[i] = i - ++j;
+                break;
+              }
+            /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds
+               for x = i-1-j, because
+                 needle[i-1] != needle[j] = needle[i-1-x].  */
+            if (j == 0)
+              {
+                /* The inequality holds for all possible x.  */
+                table[i] = i;
+                break;
+              }
+            /* The inequality needle[x..i-1] != needle[0..i-1-x] also holds
+               for i-1-j < x < i-1-j+table[j], because for these x:
+                 needle[x..i-2]
+                 = needle[x-(i-1-j)..j-1]
+                 != needle[0..j-1-(x-(i-1-j))]  (by definition of table[j])
+                    = needle[0..i-2-x],
+               hence needle[x..i-1] != needle[0..i-1-x].
+               Furthermore
+                 needle[i-1-j+table[j]..i-2]
+                 = needle[table[j]..j-1]
+                 = needle[0..j-1-table[j]]  (by definition of table[j]).  */
+            j = j - table[j];
+          }
+        /* Here: j = i - table[i].  */
+      }
+  }
+
+  /* Search, using the table to accelerate the processing.  */
+  {
+    size_t j;
+    const UNIT *rhaystack;
+    const UNIT *phaystack;
+
+    *resultp = NULL;
+    j = 0;
+    rhaystack = haystack;
+    phaystack = haystack;
+    /* Invariant: phaystack = rhaystack + j.  */
+    while (*phaystack != 0)
+      if (CANON_ELEMENT (needle[j]) == CANON_ELEMENT (*phaystack))
+        {
+          j++;
+          phaystack++;
+          if (j == m)
+            {
+              /* The entire needle has been found.  */
+              *resultp = rhaystack;
+              break;
+            }
+        }
+      else if (j > 0)
+        {
+          /* Found a match of needle[0..j-1], mismatch at needle[j].  */
+          rhaystack += table[j];
+          j -= table[j];
+        }
+      else
+        {
+          /* Found a mismatch at needle[0] already.  */
+          rhaystack++;
+          phaystack++;
+        }
+  }
+
+  freea (table);
+  return true;
+}
+
+#undef CANON_ELEMENT
index 0fe3161..005a19f 100644 (file)
@@ -1,5 +1,5 @@
 /* Byte-wise substring search, using the Two-Way algorithm.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Written by Eric Blake <ebb9@byu.net>, 2008.
 
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Before including this file, you need to include <config.h> and
    <string.h>, and define:
-     RESULT_TYPE             A macro that expands to the return type.
+     RETURN_TYPE             A macro that expands to the return type.
      AVAILABLE(h, h_l, j, n_l)
                              A macro that returns nonzero if there are
                              at least N_L bytes left starting at H[J].
@@ -49,9 +49,9 @@
    character shift table similar to the Boyer-Moore algorithm to
    achieve improved (potentially sub-linear) performance.
 
-   See http://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260,
-   http://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm,
-   http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.34.6641&rep=rep1&type=pdf
+   See https://www-igm.univ-mlv.fr/~lecroq/string/node26.html#SECTION00260,
+   https://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm,
+   https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.34.6641&rep=rep1&type=pdf
 */
 
 /* Point at which computing a bad-byte shift table is likely to be
index 1482a77..3fed52a 100644 (file)
@@ -1,5 +1,5 @@
 /* Searching in a string.
-   Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index b14fa13..c71fd15 100644 (file)
@@ -1,4 +1,20 @@
 # Suppress a valgrind message about use of uninitialized memory in strchrnul().
+
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
 # This use is OK because it provides only a speedup.
 {
     strchrnul-value4
similarity index 88%
rename from tests/strdup.c
rename to lib/strdup.c
index 81eb226..1a00b9d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2016 Free Software
+/* Copyright (C) 1991, 1996-1998, 2002-2004, 2006-2007, 2009-2021 Free Software
    Foundation, Inc.
 
    This file is part of the GNU C Library.
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
 # include <config.h>
index 234f075..9b63e81 100644 (file)
@@ -1,5 +1,5 @@
 /* Optimized string comparison.
-   Copyright (C) 2001-2002, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -12,7 +12,7 @@
    General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>.  */
 
@@ -29,7 +29,7 @@
 
 /* Help GCC to generate good code for string comparisons with
    immediate strings. */
-#if defined (__GNUC__) && defined (__OPTIMIZE__)
+#if (defined __GNUC__ || defined __clang__) && defined __OPTIMIZE__
 
 static inline int
 streq9 (const char *s1, const char *s2)
index 9bc9b18..744714f 100644 (file)
@@ -1,6 +1,6 @@
 /* strerror-override.c --- POSIX compatible system error routine
 
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
index 5264fd5..009c560 100644 (file)
@@ -1,6 +1,6 @@
 /* strerror-override.h --- POSIX compatible system error routine
 
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_STRERROR_OVERRIDE_H
 # define _GL_STRERROR_OVERRIDE_H
index 8fff3bd..9a49725 100644 (file)
@@ -1,6 +1,6 @@
 /* strerror.c --- POSIX compatible system error routine
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/lib/striconv.c b/lib/striconv.c
new file mode 100644 (file)
index 0000000..fdfbe07
--- /dev/null
@@ -0,0 +1,451 @@
+/* Charset conversion.
+   Copyright (C) 2001-2007, 2010-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible and Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "striconv.h"
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#if HAVE_ICONV
+# include <iconv.h>
+/* Get MB_LEN_MAX, CHAR_BIT.  */
+# include <limits.h>
+#endif
+
+#include "c-strcase.h"
+
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
+
+
+#if HAVE_ICONV
+
+int
+mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
+              char **resultp, size_t *lengthp)
+{
+# define tmpbufsize 4096
+  size_t length;
+  char *result;
+
+  /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
+# if defined _LIBICONV_VERSION \
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
+  /* Set to the initial state.  */
+  iconv (cd, NULL, NULL, NULL, NULL);
+# endif
+
+  /* Determine the length we need.  */
+  {
+    size_t count = 0;
+    /* The alignment is needed when converting e.g. to glibc's WCHAR_T or
+       libiconv's UCS-4-INTERNAL encoding.  */
+    union { unsigned int align; char buf[tmpbufsize]; } tmp;
+# define tmpbuf tmp.buf
+    const char *inptr = src;
+    size_t insize = srclen;
+
+    while (insize > 0)
+      {
+        char *outptr = tmpbuf;
+        size_t outsize = tmpbufsize;
+        size_t res = iconv (cd,
+                            (ICONV_CONST char **) &inptr, &insize,
+                            &outptr, &outsize);
+
+        if (res == (size_t)(-1))
+          {
+            if (errno == E2BIG)
+              ;
+            else if (errno == EINVAL)
+              break;
+            else
+              return -1;
+          }
+# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+        /* Irix iconv() inserts a NUL byte if it cannot convert.
+           NetBSD iconv() inserts a question mark if it cannot convert.
+           Only GNU libiconv and GNU libc are known to prefer to fail rather
+           than doing a lossy conversion.  */
+        else if (res > 0)
+          {
+            errno = EILSEQ;
+            return -1;
+          }
+# endif
+        count += outptr - tmpbuf;
+      }
+    /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
+# if defined _LIBICONV_VERSION \
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
+    {
+      char *outptr = tmpbuf;
+      size_t outsize = tmpbufsize;
+      size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
+
+      if (res == (size_t)(-1))
+        return -1;
+      count += outptr - tmpbuf;
+    }
+# endif
+    length = count;
+# undef tmpbuf
+  }
+
+  if (length == 0)
+    {
+      *lengthp = 0;
+      return 0;
+    }
+  if (*resultp != NULL && *lengthp >= length)
+    result = *resultp;
+  else
+    {
+      result = (char *) malloc (length);
+      if (result == NULL)
+        {
+          errno = ENOMEM;
+          return -1;
+        }
+    }
+
+  /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
+# if defined _LIBICONV_VERSION \
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
+  /* Return to the initial state.  */
+  iconv (cd, NULL, NULL, NULL, NULL);
+# endif
+
+  /* Do the conversion for real.  */
+  {
+    const char *inptr = src;
+    size_t insize = srclen;
+    char *outptr = result;
+    size_t outsize = length;
+
+    while (insize > 0)
+      {
+        size_t res = iconv (cd,
+                            (ICONV_CONST char **) &inptr, &insize,
+                            &outptr, &outsize);
+
+        if (res == (size_t)(-1))
+          {
+            if (errno == EINVAL)
+              break;
+            else
+              goto fail;
+          }
+# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+        /* Irix iconv() inserts a NUL byte if it cannot convert.
+           NetBSD iconv() inserts a question mark if it cannot convert.
+           Only GNU libiconv and GNU libc are known to prefer to fail rather
+           than doing a lossy conversion.  */
+        else if (res > 0)
+          {
+            errno = EILSEQ;
+            goto fail;
+          }
+# endif
+      }
+    /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
+# if defined _LIBICONV_VERSION \
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
+    {
+      size_t res = iconv (cd, NULL, NULL, &outptr, &outsize);
+
+      if (res == (size_t)(-1))
+        goto fail;
+    }
+# endif
+    if (outsize != 0)
+      abort ();
+  }
+
+  *resultp = result;
+  *lengthp = length;
+
+  return 0;
+
+ fail:
+  {
+    if (result != *resultp)
+      free (result);
+    return -1;
+  }
+# undef tmpbufsize
+}
+
+char *
+str_cd_iconv (const char *src, iconv_t cd)
+{
+  /* For most encodings, a trailing NUL byte in the input will be converted
+     to a trailing NUL byte in the output.  But not for UTF-7.  So that this
+     function is usable for UTF-7, we have to exclude the NUL byte from the
+     conversion and add it by hand afterwards.  */
+# if !defined _LIBICONV_VERSION && !(defined __GLIBC__ && !defined __UCLIBC__)
+  /* Irix iconv() inserts a NUL byte if it cannot convert.
+     NetBSD iconv() inserts a question mark if it cannot convert.
+     Only GNU libiconv and GNU libc are known to prefer to fail rather
+     than doing a lossy conversion.  For other iconv() implementations,
+     we have to look at the number of irreversible conversions returned;
+     but this information is lost when iconv() returns for an E2BIG reason.
+     Therefore we cannot use the second, faster algorithm.  */
+
+  char *result = NULL;
+  size_t length = 0;
+  int retval = mem_cd_iconv (src, strlen (src), cd, &result, &length);
+  char *final_result;
+
+  if (retval < 0)
+    {
+      if (result != NULL)
+        abort ();
+      return NULL;
+    }
+
+  /* Add the terminating NUL byte.  */
+  final_result =
+    (result != NULL ? realloc (result, length + 1) : malloc (length + 1));
+  if (final_result == NULL)
+    {
+      free (result);
+      errno = ENOMEM;
+      return NULL;
+    }
+  final_result[length] = '\0';
+
+  return final_result;
+
+# else
+  /* This algorithm is likely faster than the one above.  But it may produce
+     iconv() returns for an E2BIG reason, when the output size guess is too
+     small.  Therefore it can only be used when we don't need the number of
+     irreversible conversions performed.  */
+  char *result;
+  size_t result_size;
+  size_t length;
+  const char *inptr = src;
+  size_t inbytes_remaining = strlen (src);
+
+  /* Make a guess for the worst-case output size, in order to avoid a
+     realloc.  It's OK if the guess is wrong as long as it is not zero and
+     doesn't lead to an integer overflow.  */
+  result_size = inbytes_remaining;
+  {
+    size_t approx_sqrt_SIZE_MAX = SIZE_MAX >> (sizeof (size_t) * CHAR_BIT / 2);
+    if (result_size <= approx_sqrt_SIZE_MAX / MB_LEN_MAX)
+      result_size *= MB_LEN_MAX;
+  }
+  result_size += 1; /* for the terminating NUL */
+
+  result = (char *) malloc (result_size);
+  if (result == NULL)
+    {
+      errno = ENOMEM;
+      return NULL;
+    }
+
+  /* Avoid glibc-2.1 bug and Solaris 2.7-2.9 bug.  */
+# if defined _LIBICONV_VERSION \
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
+  /* Set to the initial state.  */
+  iconv (cd, NULL, NULL, NULL, NULL);
+# endif
+
+  /* Do the conversion.  */
+  {
+    char *outptr = result;
+    size_t outbytes_remaining = result_size - 1;
+
+    for (;;)
+      {
+        /* Here inptr + inbytes_remaining = src + strlen (src),
+                outptr + outbytes_remaining = result + result_size - 1.  */
+        size_t res = iconv (cd,
+                            (ICONV_CONST char **) &inptr, &inbytes_remaining,
+                            &outptr, &outbytes_remaining);
+
+        if (res == (size_t)(-1))
+          {
+            if (errno == EINVAL)
+              break;
+            else if (errno == E2BIG)
+              {
+                size_t used = outptr - result;
+                size_t newsize = result_size * 2;
+                char *newresult;
+
+                if (!(newsize > result_size))
+                  {
+                    errno = ENOMEM;
+                    goto failed;
+                  }
+                newresult = (char *) realloc (result, newsize);
+                if (newresult == NULL)
+                  {
+                    errno = ENOMEM;
+                    goto failed;
+                  }
+                result = newresult;
+                result_size = newsize;
+                outptr = result + used;
+                outbytes_remaining = result_size - 1 - used;
+              }
+            else
+              goto failed;
+          }
+        else
+          break;
+      }
+    /* Avoid glibc-2.1 bug and Solaris 2.7 bug.  */
+# if defined _LIBICONV_VERSION \
+     || !(((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+          || defined __sun)
+    for (;;)
+      {
+        /* Here outptr + outbytes_remaining = result + result_size - 1.  */
+        size_t res = iconv (cd, NULL, NULL, &outptr, &outbytes_remaining);
+
+        if (res == (size_t)(-1))
+          {
+            if (errno == E2BIG)
+              {
+                size_t used = outptr - result;
+                size_t newsize = result_size * 2;
+                char *newresult;
+
+                if (!(newsize > result_size))
+                  {
+                    errno = ENOMEM;
+                    goto failed;
+                  }
+                newresult = (char *) realloc (result, newsize);
+                if (newresult == NULL)
+                  {
+                    errno = ENOMEM;
+                    goto failed;
+                  }
+                result = newresult;
+                result_size = newsize;
+                outptr = result + used;
+                outbytes_remaining = result_size - 1 - used;
+              }
+            else
+              goto failed;
+          }
+        else
+          break;
+      }
+# endif
+
+    /* Add the terminating NUL byte.  */
+    *outptr++ = '\0';
+
+    length = outptr - result;
+  }
+
+  /* Give away unused memory.  */
+  if (length < result_size)
+    {
+      char *smaller_result = (char *) realloc (result, length);
+
+      if (smaller_result != NULL)
+        result = smaller_result;
+    }
+
+  return result;
+
+ failed:
+  free (result);
+  return NULL;
+
+# endif
+}
+
+#endif
+
+char *
+str_iconv (const char *src, const char *from_codeset, const char *to_codeset)
+{
+  if (*src == '\0' || c_strcasecmp (from_codeset, to_codeset) == 0)
+    {
+      char *result = strdup (src);
+
+      if (result == NULL)
+        errno = ENOMEM;
+      return result;
+    }
+  else
+    {
+#if HAVE_ICONV
+      iconv_t cd;
+      char *result;
+
+      /* Avoid glibc-2.1 bug with EUC-KR.  */
+# if ((__GLIBC__ == 2 && __GLIBC_MINOR__ <= 1) && !defined __UCLIBC__) \
+     && !defined _LIBICONV_VERSION
+      if (c_strcasecmp (from_codeset, "EUC-KR") == 0
+          || c_strcasecmp (to_codeset, "EUC-KR") == 0)
+        {
+          errno = EINVAL;
+          return NULL;
+        }
+# endif
+      cd = iconv_open (to_codeset, from_codeset);
+      if (cd == (iconv_t) -1)
+        return NULL;
+
+      result = str_cd_iconv (src, cd);
+
+      if (result == NULL)
+        {
+          /* Close cd, but preserve the errno from str_cd_iconv.  */
+          int saved_errno = errno;
+          iconv_close (cd);
+          errno = saved_errno;
+        }
+      else
+        {
+          if (iconv_close (cd) < 0)
+            {
+              free (result);
+              return NULL;
+            }
+        }
+      return result;
+#else
+      /* This is a different error code than if iconv_open existed but didn't
+         support from_codeset and to_codeset, so that the caller can emit
+         an error message such as
+           "iconv() is not supported. Installing GNU libiconv and
+            then reinstalling this package would fix this."  */
+      errno = ENOSYS;
+      return NULL;
+#endif
+    }
+}
diff --git a/lib/striconv.h b/lib/striconv.h
new file mode 100644 (file)
index 0000000..652ef96
--- /dev/null
@@ -0,0 +1,75 @@
+/* Charset conversion.
+   Copyright (C) 2001-2004, 2006-2007, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible and Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _STRICONV_H
+#define _STRICONV_H
+
+#include <stddef.h>
+#if HAVE_ICONV
+#include <iconv.h>
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if HAVE_ICONV
+
+/* Convert an entire string from one encoding to another, using iconv.
+   The original string is at [SRC,...,SRC+SRCLEN-1].
+   The conversion descriptor is passed as CD.
+   *RESULTP and *LENGTH should initially be a scratch buffer and its size,
+   or *RESULTP can initially be NULL.
+   May erase the contents of the memory at *RESULTP.
+   Return value: 0 if successful, otherwise -1 and errno set.
+   If successful: The resulting string is stored in *RESULTP and its length
+   in *LENGTHP.  *RESULTP is set to a freshly allocated memory block, or is
+   unchanged if no dynamic memory allocation was necessary.  */
+extern int mem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
+                         char **resultp, size_t *lengthp);
+
+/* Convert an entire string from one encoding to another, using iconv.
+   The original string is the NUL-terminated string starting at SRC.
+   The conversion descriptor is passed as CD.  Both the "from" and the "to"
+   encoding must use a single NUL byte at the end of the string (i.e. not
+   UCS-2, UCS-4, UTF-16, UTF-32).
+   Allocate a malloced memory block for the result.
+   Return value: the freshly allocated resulting NUL-terminated string if
+   successful, otherwise NULL and errno set.  */
+extern char * str_cd_iconv (const char *src, iconv_t cd);
+
+#endif
+
+/* Convert an entire string from one encoding to another, using iconv.
+   The original string is the NUL-terminated string starting at SRC.
+   Both the "from" and the "to" encoding must use a single NUL byte at the
+   end of the string (i.e. not UCS-2, UCS-4, UTF-16, UTF-32).
+   Allocate a malloced memory block for the result.
+   Return value: the freshly allocated resulting NUL-terminated string if
+   successful, otherwise NULL and errno set.  */
+extern char * str_iconv (const char *src,
+                         const char *from_codeset, const char *to_codeset);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _STRICONV_H */
index b3213c4..c76c182 100644 (file)
@@ -1,6 +1,6 @@
 /* A GNU-like <string.h>.
 
-   Copyright (C) 1995-1996, 2001-2016 Free Software Foundation, Inc.
+   Copyright (C) 1995-1996, 2001-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 
 /* The __attribute__ feature is available in gcc versions 2.5 and later.
    The attribute __pure__ was added in gcc 2.96.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+#  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+#  define _GL_ATTRIBUTE_PURE /* empty */
+# endif
 #endif
 
 /* NetBSD 5.0 declares strsignal in <unistd.h>, not in <string.h>.  */
 # include <unistd.h>
 #endif
 
+/* AIX 7.2 declares ffsl and ffsll in <strings.h>, not in <string.h>.  */
+/* But in any case avoid namespace pollution on glibc systems.  */
+#if ((@GNULIB_FFSL@ || @GNULIB_FFSLL@ || defined GNULIB_POSIXCHECK) \
+     && defined _AIX) \
+    && ! defined __GLIBC__
+# include <strings.h>
+#endif
+
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
 /* The definition of _GL_ARG_NONNULL is copied here.  */
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 
+/* Clear a block of memory.  The compiler will not delete a call to
+   this function, even if the block is dead after the call.  */
+#if @GNULIB_EXPLICIT_BZERO@
+# if ! @HAVE_EXPLICIT_BZERO@
+_GL_FUNCDECL_SYS (explicit_bzero, void,
+                  (void *__dest, size_t __n) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIAS_SYS (explicit_bzero, void, (void *__dest, size_t __n));
+_GL_CXXALIASWARN (explicit_bzero);
+#elif defined GNULIB_POSIXCHECK
+# undef explicit_bzero
+# if HAVE_RAW_DECL_EXPLICIT_BZERO
+_GL_WARN_ON_USE (explicit_bzero, "explicit_bzero is unportable - "
+                 "use gnulib module explicit_bzero for portability");
+# endif
+#endif
+
 /* Find the index of the least-significant set bit.  */
 #if @GNULIB_FFSL@
 # if !@HAVE_FFSL@
@@ -91,10 +118,18 @@ _GL_WARN_ON_USE (ffsl, "ffsl is not portable - use the ffsl module");
 
 /* Find the index of the least-significant set bit.  */
 #if @GNULIB_FFSLL@
-# if !@HAVE_FFSLL@
+# if @REPLACE_FFSLL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define ffsll rpl_ffsll
+#  endif
+_GL_FUNCDECL_RPL (ffsll, int, (long long int i));
+_GL_CXXALIAS_RPL (ffsll, int, (long long int i));
+# else
+#  if !@HAVE_FFSLL@
 _GL_FUNCDECL_SYS (ffsll, int, (long long int i));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (ffsll, int, (long long int i));
+# endif
 _GL_CXXALIASWARN (ffsll);
 #elif defined GNULIB_POSIXCHECK
 # undef ffsll
@@ -104,10 +139,30 @@ _GL_WARN_ON_USE (ffsll, "ffsll is not portable - use the ffsll module");
 #endif
 
 
+#if @GNULIB_MDA_MEMCCPY@
+/* On native Windows, map 'memccpy' to '_memccpy', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::memccpy always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef memccpy
+#   define memccpy _memccpy
+#  endif
+_GL_CXXALIAS_MDA (memccpy, void *,
+                  (void *dest, const void *src, int c, size_t n));
+# else
+_GL_CXXALIAS_SYS (memccpy, void *,
+                  (void *dest, const void *src, int c, size_t n));
+# endif
+_GL_CXXALIASWARN (memccpy);
+#endif
+
+
 /* Return the first instance of C within N bytes of S, or NULL.  */
 #if @GNULIB_MEMCHR@
 # if @REPLACE_MEMCHR@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef memchr
 #   define memchr rpl_memchr
 #  endif
 _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
@@ -115,11 +170,6 @@ _GL_FUNCDECL_RPL (memchr, void *, (void const *__s, int __c, size_t __n)
                                   _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (memchr, void *, (void const *__s, int __c, size_t __n));
 # else
-#  if ! @HAVE_MEMCHR@
-_GL_FUNCDECL_SYS (memchr, void *, (void const *__s, int __c, size_t __n)
-                                  _GL_ATTRIBUTE_PURE
-                                  _GL_ARG_NONNULL ((1)));
-#  endif
   /* On some systems, this function is defined as an overloaded function:
        extern "C" { const void * std::memchr (const void *, int, size_t); }
        extern "C++" { void * std::memchr (void *, int, size_t); }  */
@@ -132,7 +182,7 @@ _GL_CXXALIAS_SYS_CAST2 (memchr,
 _GL_CXXALIASWARN1 (memchr, void *, (void *__s, int __c, size_t __n));
 _GL_CXXALIASWARN1 (memchr, void const *,
                    (void const *__s, int __c, size_t __n));
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (memchr);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -315,9 +365,11 @@ _GL_WARN_ON_USE (stpncpy, "stpncpy is unportable - "
    GB18030 and the character to be searched is a digit.  */
 # undef strchr
 /* Assume strchr is always declared.  */
-_GL_WARN_ON_USE (strchr, "strchr cannot work correctly on character strings "
-                 "in some multibyte locales - "
-                 "use mbschr if you care about internationalization");
+_GL_WARN_ON_USE_CXX (strchr,
+                     const char *, char *, (const char *, int),
+                     "strchr cannot work correctly on character strings "
+                     "in some multibyte locales - "
+                     "use mbschr if you care about internationalization");
 #endif
 
 /* Find the first occurrence of C in S or the final NUL byte.  */
@@ -368,6 +420,12 @@ _GL_WARN_ON_USE (strchrnul, "strchrnul is unportable - "
 #  endif
 _GL_FUNCDECL_RPL (strdup, char *, (char const *__s) _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (strdup, char *, (char const *__s));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strdup
+#   define strdup _strdup
+#  endif
+_GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
 # else
 #  if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
     /* strdup exists as a function and as a macro.  Get rid of the macro.  */
@@ -385,6 +443,23 @@ _GL_CXXALIASWARN (strdup);
 _GL_WARN_ON_USE (strdup, "strdup is unportable - "
                  "use gnulib module strdup for portability");
 # endif
+#elif @GNULIB_MDA_STRDUP@
+/* On native Windows, map 'creat' to '_creat', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::creat always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strdup
+#   define strdup _strdup
+#  endif
+_GL_CXXALIAS_MDA (strdup, char *, (char const *__s));
+# else
+#  if defined __cplusplus && defined GNULIB_NAMESPACE && defined strdup
+#   undef strdup
+#  endif
+_GL_CXXALIAS_SYS (strdup, char *, (char const *__s));
+# endif
+_GL_CXXALIASWARN (strdup);
 #endif
 
 /* Append no more than N characters from SRC onto DEST.  */
@@ -394,13 +469,18 @@ _GL_WARN_ON_USE (strdup, "strdup is unportable - "
 #   undef strncat
 #   define strncat rpl_strncat
 #  endif
-_GL_FUNCDECL_RPL (strncat, char *, (char *dest, const char *src, size_t n)
-                                   _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_RPL (strncat, char *, (char *dest, const char *src, size_t n));
+_GL_FUNCDECL_RPL (strncat, char *,
+                  (char *restrict dest, const char *restrict src, size_t n)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (strncat, char *,
+                  (char *restrict dest, const char *restrict src, size_t n));
 # else
-_GL_CXXALIAS_SYS (strncat, char *, (char *dest, const char *src, size_t n));
+_GL_CXXALIAS_SYS (strncat, char *,
+                  (char *restrict dest, const char *restrict src, size_t n));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (strncat);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef strncat
 # if HAVE_RAW_DECL_STRNCAT
@@ -495,7 +575,7 @@ _GL_CXXALIAS_SYS_CAST2 (strpbrk,
 _GL_CXXALIASWARN1 (strpbrk, char *, (char *__s, char const *__accept));
 _GL_CXXALIASWARN1 (strpbrk, char const *,
                    (char const *__s, char const *__accept));
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (strpbrk);
 # endif
 # if defined GNULIB_POSIXCHECK
@@ -504,15 +584,19 @@ _GL_CXXALIASWARN (strpbrk);
    locale encoding is GB18030 and one of the characters to be searched is a
    digit.  */
 #  undef strpbrk
-_GL_WARN_ON_USE (strpbrk, "strpbrk cannot work correctly on character strings "
-                 "in multibyte locales - "
-                 "use mbspbrk if you care about internationalization");
+_GL_WARN_ON_USE_CXX (strpbrk,
+                     const char *, char *, (const char *, const char *),
+                     "strpbrk cannot work correctly on character strings "
+                     "in multibyte locales - "
+                     "use mbspbrk if you care about internationalization");
 # endif
 #elif defined GNULIB_POSIXCHECK
 # undef strpbrk
 # if HAVE_RAW_DECL_STRPBRK
-_GL_WARN_ON_USE (strpbrk, "strpbrk is unportable - "
-                 "use gnulib module strpbrk for portability");
+_GL_WARN_ON_USE_CXX (strpbrk,
+                     const char *, char *, (const char *, const char *),
+                     "strpbrk is unportable - "
+                     "use gnulib module strpbrk for portability");
 # endif
 #endif
 
@@ -531,9 +615,11 @@ _GL_WARN_ON_USE (strspn, "strspn cannot work correctly on character strings "
    GB18030 and the character to be searched is a digit.  */
 # undef strrchr
 /* Assume strrchr is always declared.  */
-_GL_WARN_ON_USE (strrchr, "strrchr cannot work correctly on character strings "
-                 "in some multibyte locales - "
-                 "use mbsrchr if you care about internationalization");
+_GL_WARN_ON_USE_CXX (strrchr,
+                     const char *, char *, (const char *, int),
+                     "strrchr cannot work correctly on character strings "
+                     "in some multibyte locales - "
+                     "use mbsrchr if you care about internationalization");
 #endif
 
 /* Search the next delimiter (char listed in DELIM) starting at *STRINGP.
@@ -597,7 +683,7 @@ _GL_CXXALIAS_SYS_CAST2 (strstr,
 _GL_CXXALIASWARN1 (strstr, char *, (char *haystack, const char *needle));
 _GL_CXXALIASWARN1 (strstr, const char *,
                    (const char *haystack, const char *needle));
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (strstr);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -676,7 +762,7 @@ _GL_WARN_ON_USE (strcasestr, "strcasestr does work correctly on character "
    This is a variant of strtok() that is multithread-safe.
 
    For the POSIX documentation for this function, see:
-   http://www.opengroup.org/susv3xsh/strtok.html
+   https://pubs.opengroup.org/onlinepubs/9699919799/functions/strtok.html
 
    Caveat: It modifies the original string.
    Caveat: These functions cannot be used on constant strings.
@@ -947,7 +1033,8 @@ _GL_EXTERN_C char * mbssep (char **stringp, const char *delim)
    Caveat: The identity of the delimiting character is lost.
 
    See also mbssep().  */
-_GL_EXTERN_C char * mbstok_r (char *string, const char *delim, char **save_ptr)
+_GL_EXTERN_C char * mbstok_r (char *restrict string, const char *delim,
+                              char **save_ptr)
      _GL_ARG_NONNULL ((2, 3));
 #endif
 
@@ -963,7 +1050,9 @@ _GL_CXXALIAS_RPL (strerror, char *, (int));
 # else
 _GL_CXXALIAS_SYS (strerror, char *, (int));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (strerror);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef strerror
 /* Assume strerror is always declared.  */
@@ -1000,6 +1089,60 @@ _GL_WARN_ON_USE (strerror_r, "strerror_r is unportable - "
 # endif
 #endif
 
+/* Return the name of the system error code ERRNUM.  */
+#if @GNULIB_STRERRORNAME_NP@
+# if @REPLACE_STRERRORNAME_NP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef strerrorname_np
+#   define strerrorname_np rpl_strerrorname_np
+#  endif
+_GL_FUNCDECL_RPL (strerrorname_np, const char *, (int errnum));
+_GL_CXXALIAS_RPL (strerrorname_np, const char *, (int errnum));
+# else
+#  if !@HAVE_STRERRORNAME_NP@
+_GL_FUNCDECL_SYS (strerrorname_np, const char *, (int errnum));
+#  endif
+_GL_CXXALIAS_SYS (strerrorname_np, const char *, (int errnum));
+# endif
+_GL_CXXALIASWARN (strerrorname_np);
+#elif defined GNULIB_POSIXCHECK
+# undef strerrorname_np
+# if HAVE_RAW_DECL_STRERRORNAME_NP
+_GL_WARN_ON_USE (strerrorname_np, "strerrorname_np is unportable - "
+                 "use gnulib module strerrorname_np for portability");
+# endif
+#endif
+
+/* Return an abbreviation string for the signal number SIG.  */
+#if @GNULIB_SIGABBREV_NP@
+# if ! @HAVE_SIGABBREV_NP@
+_GL_FUNCDECL_SYS (sigabbrev_np, const char *, (int sig));
+# endif
+_GL_CXXALIAS_SYS (sigabbrev_np, const char *, (int sig));
+_GL_CXXALIASWARN (sigabbrev_np);
+#elif defined GNULIB_POSIXCHECK
+# undef sigabbrev_np
+# if HAVE_RAW_DECL_SIGABBREV_NP
+_GL_WARN_ON_USE (sigabbrev_np, "sigabbrev_np is unportable - "
+                 "use gnulib module sigabbrev_np for portability");
+# endif
+#endif
+
+/* Return an English description string for the signal number SIG.  */
+#if @GNULIB_SIGDESCR_NP@
+# if ! @HAVE_SIGDESCR_NP@
+_GL_FUNCDECL_SYS (sigdescr_np, const char *, (int sig));
+# endif
+_GL_CXXALIAS_SYS (sigdescr_np, const char *, (int sig));
+_GL_CXXALIASWARN (sigdescr_np);
+#elif defined GNULIB_POSIXCHECK
+# undef sigdescr_np
+# if HAVE_RAW_DECL_SIGDESCR_NP
+_GL_WARN_ON_USE (sigdescr_np, "sigdescr_np is unportable - "
+                 "use gnulib module sigdescr_np for portability");
+# endif
+#endif
+
 #if @GNULIB_STRSIGNAL@
 # if @REPLACE_STRSIGNAL@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
index 0453e36..f2cbcb5 100644 (file)
@@ -1,6 +1,6 @@
 /* stripslash.c -- remove redundant trailing slashes from a file name
 
-   Copyright (C) 1990, 2001, 2003-2006, 2009-2016 Free Software Foundation,
+   Copyright (C) 1990, 2001, 2003-2006, 2009-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 6250fcd..09dec62 100644 (file)
@@ -1,6 +1,6 @@
 /* A replacement function, for systems that lack strndup.
 
-   Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2016 Free Software
+   Copyright (C) 1996-1998, 2001-2003, 2005-2007, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify it
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 1bd7936..c27a039 100644 (file)
@@ -1,5 +1,5 @@
 /* Find the length of STRING, but scan at most MAXLEN characters.
-   Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc.
    Written by Simon Josefsson.
 
    This program is free software; you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/lib/strnlen1.c b/lib/strnlen1.c
new file mode 100644 (file)
index 0000000..d52811b
--- /dev/null
@@ -0,0 +1,35 @@
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "strnlen1.h"
+
+#include <string.h>
+
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
+   If no '\0' terminator is found in that many characters, return MAXLEN.  */
+/* This is the same as strnlen (string, maxlen - 1) + 1.  */
+size_t
+strnlen1 (const char *string, size_t maxlen)
+{
+  const char *end = (const char *) memchr (string, '\0', maxlen);
+  if (end != NULL)
+    return end - string + 1;
+  else
+    return maxlen;
+}
diff --git a/lib/strnlen1.h b/lib/strnlen1.h
new file mode 100644 (file)
index 0000000..da62073
--- /dev/null
@@ -0,0 +1,40 @@
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
+   Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _STRNLEN1_H
+#define _STRNLEN1_H
+
+#include <stddef.h>
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Find the length of STRING + 1, but scan at most MAXLEN bytes.
+   If no '\0' terminator is found in that many characters, return MAXLEN.  */
+/* This is the same as strnlen (string, maxlen - 1) + 1.  */
+extern size_t strnlen1 (const char *string, size_t maxlen)
+  _GL_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _STRNLEN1_H */
index 6b0d49d..7907cb9 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994-2002, 2005, 2008-2016 Free Software Foundation,
+/* Copyright (C) 1991, 1994-2002, 2005, 2008-2021 Free Software Foundation,
    Inc.
    This file is part of the GNU C Library.
 
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _LIBC
 # include <config.h>
index 0f2d4c0..50daaf6 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2016 Free Software
+/* Copyright (C) 1991-1994, 1996-1998, 2000, 2004, 2007-2021 Free Software
    Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* This particular implementation was written by Eric Blake, 2008.  */
 
index 7101d29..dfdc1fc 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1992, 1997, 1999, 2003, 2006, 2008-2016 Free Software
+/* Copyright (C) 1991-1992, 1997, 1999, 2003, 2006, 2008-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-#include <config.h>
+#if ! defined USE_LONG_DOUBLE
+# include <config.h>
+#endif
 
+/* Specification.  */
 #include <stdlib.h>
 
-#include <ctype.h>
+#include <ctype.h>      /* isspace() */
 #include <errno.h>
-#include <float.h>
-#include <limits.h>
-#include <math.h>
+#include <float.h>      /* {DBL,LDBL}_{MIN,MAX} */
+#include <limits.h>     /* LONG_{MIN,MAX} */
+#include <locale.h>     /* localeconv() */
+#include <math.h>       /* NAN */
 #include <stdbool.h>
-#include <string.h>
+#include <stdio.h>      /* sprintf() */
+#include <string.h>     /* strdup() */
+#if HAVE_NL_LANGINFO
+# include <langinfo.h>
+#endif
 
 #include "c-ctype.h"
 
-#ifndef HAVE_LDEXP_IN_LIBC
-#define HAVE_LDEXP_IN_LIBC 0
+#undef MIN
+#undef MAX
+#ifdef USE_LONG_DOUBLE
+# define STRTOD strtold
+# define LDEXP ldexpl
+# if defined __hpux && defined __hppa
+   /* We cannot call strtold on HP-UX/hppa, because its return type is a struct,
+      not a 'long double'.  */
+#  define HAVE_UNDERLYING_STRTOD 0
+# elif STRTOLD_HAS_UNDERFLOW_BUG
+   /* strtold would not set errno=ERANGE upon underflow.  */
+#  define HAVE_UNDERLYING_STRTOD 0
+# else
+#  define HAVE_UNDERLYING_STRTOD HAVE_STRTOLD
+# endif
+# define DOUBLE long double
+# define MIN LDBL_MIN
+# define MAX LDBL_MAX
+# define L_(literal) literal##L
+#else
+# define STRTOD strtod
+# define LDEXP ldexp
+# define HAVE_UNDERLYING_STRTOD 1
+# define DOUBLE double
+# define MIN DBL_MIN
+# define MAX DBL_MAX
+# define L_(literal) literal
+#endif
+
+#if (defined USE_LONG_DOUBLE ? HAVE_LDEXPM_IN_LIBC : HAVE_LDEXP_IN_LIBC)
+# define USE_LDEXP 1
+#else
+# define USE_LDEXP 0
 #endif
 
 /* Return true if C is a space in the current locale, avoiding
@@ -41,20 +80,43 @@ locale_isspace (char c)
   return isspace (uc) != 0;
 }
 
-#if !HAVE_LDEXP_IN_LIBC
- #define ldexp dummy_ldexp
+/* Determine the decimal-point character according to the current locale.  */
+static char
+decimal_point_char (void)
+{
+  const char *point;
+  /* Determine it in a multithread-safe way.  We know nl_langinfo is
+     multithread-safe on glibc systems and Mac OS X systems, but is not required
+     to be multithread-safe by POSIX.  sprintf(), however, is multithread-safe.
+     localeconv() is rarely multithread-safe.  */
+#if HAVE_NL_LANGINFO && (__GLIBC__ || defined __UCLIBC__ || (defined __APPLE__ && defined __MACH__))
+  point = nl_langinfo (RADIXCHAR);
+#elif 1
+  char pointbuf[5];
+  sprintf (pointbuf, "%#.0f", 1.0);
+  point = &pointbuf[1];
+#else
+  point = localeconv () -> decimal_point;
+#endif
+  /* The decimal point is always a single byte: either '.' or ','.  */
+  return (point[0] != '\0' ? point[0] : '.');
+}
+
+#if !USE_LDEXP
+ #undef LDEXP
+ #define LDEXP dummy_ldexp
  /* A dummy definition that will never be invoked.  */
- static double ldexp (double x _GL_UNUSED, int exponent _GL_UNUSED)
+ static DOUBLE LDEXP (DOUBLE x _GL_UNUSED, int exponent _GL_UNUSED)
  {
    abort ();
-   return 0.0;
+   return L_(0.0);
  }
 #endif
 
 /* Return X * BASE**EXPONENT.  Return an extreme value and set errno
    to ERANGE if underflow or overflow occurs.  */
-static double
-scale_radix_exp (double x, int radix, long int exponent)
+static DOUBLE
+scale_radix_exp (DOUBLE x, int radix, long int exponent)
 {
   /* If RADIX == 10, this code is neither precise nor fast; it is
      merely a straightforward and relatively portable approximation.
@@ -63,11 +125,11 @@ scale_radix_exp (double x, int radix, long int exponent)
 
   long int e = exponent;
 
-  if (HAVE_LDEXP_IN_LIBC && radix == 2)
-    return ldexp (x, e < INT_MIN ? INT_MIN : INT_MAX < e ? INT_MAX : e);
+  if (USE_LDEXP && radix == 2)
+    return LDEXP (x, e < INT_MIN ? INT_MIN : INT_MAX < e ? INT_MAX : e);
   else
     {
-      double r = x;
+      DOUBLE r = x;
 
       if (r != 0)
         {
@@ -87,12 +149,12 @@ scale_radix_exp (double x, int radix, long int exponent)
             {
               while (e-- != 0)
                 {
-                  if (r < -DBL_MAX / radix)
+                  if (r < -MAX / radix)
                     {
                       errno = ERANGE;
                       return -HUGE_VAL;
                     }
-                  else if (DBL_MAX / radix < r)
+                  else if (MAX / radix < r)
                     {
                       errno = ERANGE;
                       return HUGE_VAL;
@@ -111,63 +173,109 @@ scale_radix_exp (double x, int radix, long int exponent)
    except there are no leading spaces or signs or "0x", and ENDPTR is
    nonnull.  The number uses a base BASE (either 10 or 16) fraction, a
    radix RADIX (either 10 or 2) exponent, and exponent character
-   EXPCHAR.  To convert from a number of digits to a radix exponent,
-   multiply by RADIX_MULTIPLIER (either 1 or 4).  */
-static double
+   EXPCHAR.  BASE is RADIX**RADIX_MULTIPLIER.  */
+static DOUBLE
 parse_number (const char *nptr,
-              int base, int radix, int radix_multiplier, char expchar,
+              int base, int radix, int radix_multiplier, char radixchar,
+              char expchar,
               char **endptr)
 {
   const char *s = nptr;
-  bool got_dot = false;
-  long int exponent = 0;
-  double num = 0;
-
+  const char *digits_start;
+  const char *digits_end;
+  const char *radixchar_ptr;
+  long int exponent;
+  DOUBLE num;
+
+  /* First, determine the start and end of the digit sequence.  */
+  digits_start = s;
+  radixchar_ptr = NULL;
   for (;; ++s)
     {
-      int digit;
-      if (c_isdigit (*s))
-        digit = *s - '0';
-      else if (base == 16 && c_isxdigit (*s))
-        digit = c_tolower (*s) - ('a' - 10);
-      else if (! got_dot && *s == '.')
+      if (base == 16 ? c_isxdigit (*s) : c_isdigit (*s))
+        ;
+      else if (radixchar_ptr == NULL && *s == radixchar)
         {
           /* Record that we have found the decimal point.  */
-          got_dot = true;
-          continue;
+          radixchar_ptr = s;
         }
       else
-        /* Any other character terminates the number.  */
+        /* Any other character terminates the digit sequence.  */
         break;
+    }
+  digits_end = s;
+  /* Now radixchar_ptr == NULL or
+     digits_start <= radixchar_ptr < digits_end.  */
+
+  if (false)
+    { /* Unoptimized.  */
+      exponent =
+        (radixchar_ptr != NULL
+         ? - (long int) (digits_end - radixchar_ptr - 1)
+         : 0);
+    }
+  else
+    { /* Remove trailing zero digits.  This reduces rounding errors for
+         inputs such as 1.0000000000 or 10000000000e-10.  */
+      while (digits_end > digits_start)
+        {
+          if (digits_end - 1 == radixchar_ptr || *(digits_end - 1) == '0')
+            digits_end--;
+          else
+            break;
+        }
+      exponent =
+        (radixchar_ptr != NULL
+         ? (digits_end > radixchar_ptr
+            ? - (long int) (digits_end - radixchar_ptr - 1)
+            : (long int) (radixchar_ptr - digits_end))
+         : (long int) (s - digits_end));
+    }
 
-      /* Make sure that multiplication by base will not overflow.  */
-      if (num <= DBL_MAX / base)
-        num = num * base + digit;
-      else
+  /* Then, convert the digit sequence to a number.  */
+  {
+    const char *dp;
+    num = 0;
+    for (dp = digits_start; dp < digits_end; dp++)
+      if (dp != radixchar_ptr)
         {
-          /* The value of the digit doesn't matter, since we have already
-             gotten as many digits as can be represented in a 'double'.
-             This doesn't necessarily mean the result will overflow.
-             The exponent may reduce it to within range.
-
-             We just need to record that there was another
-             digit so that we can multiply by 10 later.  */
-          exponent += radix_multiplier;
+          int digit;
+
+          /* Make sure that multiplication by BASE will not overflow.  */
+          if (!(num <= MAX / base))
+            {
+              /* The value of the digit and all subsequent digits don't matter,
+                 since we have already gotten as many digits as can be
+                 represented in a 'DOUBLE'.  This doesn't necessarily mean that
+                 the result will overflow: The exponent may reduce it to within
+                 range.  */
+              exponent +=
+                (digits_end - dp)
+                - (radixchar_ptr >= dp && radixchar_ptr < digits_end ? 1 : 0);
+              break;
+            }
+
+          /* Eat the next digit.  */
+          if (c_isdigit (*dp))
+            digit = *dp - '0';
+          else if (base == 16 && c_isxdigit (*dp))
+            digit = c_tolower (*dp) - ('a' - 10);
+          else
+            abort ();
+          num = num * base + digit;
         }
+  }
 
-      /* Keep track of the number of digits after the decimal point.
-         If we just divided by base here, we might lose precision.  */
-      if (got_dot)
-        exponent -= radix_multiplier;
-    }
+  exponent = exponent * radix_multiplier;
 
+  /* Finally, parse the exponent.  */
   if (c_tolower (*s) == expchar && ! locale_isspace (s[1]))
     {
       /* Add any given exponent to the implicit one.  */
-      int save = errno;
+      int saved_errno = errno;
       char *end;
       long int value = strtol (s + 1, &end, 10);
-      errno = save;
+      errno = saved_errno;
 
       if (s + 1 != end)
         {
@@ -185,38 +293,51 @@ parse_number (const char *nptr,
   return scale_radix_exp (num, radix, exponent);
 }
 
-static double underlying_strtod (const char *, char **);
-
 /* HP cc on HP-UX 10.20 has a bug with the constant expression -0.0.
    ICC 10.0 has a bug when optimizing the expression -zero.
-   The expression -DBL_MIN * DBL_MIN does not work when cross-compiling
+   The expression -MIN * MIN does not work when cross-compiling
    to PowerPC on Mac OS X 10.5.  */
-#if defined __hpux || defined __sgi || defined __ICC
-static double
-compute_minus_zero (void)
+static DOUBLE
+minus_zero (void)
 {
-  return -DBL_MIN * DBL_MIN;
-}
-# define minus_zero compute_minus_zero ()
+#if defined __hpux || defined __sgi || defined __ICC
+  return -MIN * MIN;
 #else
-double minus_zero = -0.0;
+  return -0.0;
 #endif
+}
 
-/* Convert NPTR to a double.  If ENDPTR is not NULL, a pointer to the
+/* Convert NPTR to a DOUBLE.  If ENDPTR is not NULL, a pointer to the
    character after the last one used in the number is put in *ENDPTR.  */
-double
-strtod (const char *nptr, char **endptr)
+DOUBLE
+STRTOD (const char *nptr, char **endptr)
+#if HAVE_UNDERLYING_STRTOD
+# ifdef USE_LONG_DOUBLE
+#  undef strtold
+# else
+#  undef strtod
+# endif
+#else
+# undef STRTOD
+# define STRTOD(NPTR,ENDPTR) \
+   parse_number (NPTR, 10, 10, 1, radixchar, 'e', ENDPTR)
+#endif
+/* From here on, STRTOD refers to the underlying implementation.  It needs
+   to handle only finite unsigned decimal numbers with non-null ENDPTR.  */
 {
+  char radixchar;
   bool negative = false;
 
   /* The number so far.  */
-  double num;
+  DOUBLE num;
 
   const char *s = nptr;
   const char *end;
   char *endbuf;
   int saved_errno = errno;
 
+  radixchar = decimal_point_char ();
+
   /* Eat whitespace.  */
   while (locale_isspace (*s))
     ++s;
@@ -226,10 +347,10 @@ strtod (const char *nptr, char **endptr)
   if (*s == '-' || *s == '+')
     ++s;
 
-  num = underlying_strtod (s, &endbuf);
+  num = STRTOD (s, &endbuf);
   end = endbuf;
 
-  if (c_isdigit (s[*s == '.']))
+  if (c_isdigit (s[*s == radixchar]))
     {
       /* If a hex float was converted incorrectly, do it ourselves.
          If the string starts with "0x" but does not contain digits,
@@ -237,7 +358,7 @@ strtod (const char *nptr, char **endptr)
          'p' but no exponent, then adjust the end pointer.  */
       if (*s == '0' && c_tolower (s[1]) == 'x')
         {
-          if (! c_isxdigit (s[2 + (s[2] == '.')]))
+          if (! c_isxdigit (s[2 + (s[2] == radixchar)]))
             {
               end = s + 1;
 
@@ -246,7 +367,7 @@ strtod (const char *nptr, char **endptr)
             }
           else if (end <= s + 2)
             {
-              num = parse_number (s + 2, 16, 2, 4, 'p', &endbuf);
+              num = parse_number (s + 2, 16, 2, 4, radixchar, 'p', &endbuf);
               end = endbuf;
             }
           else
@@ -255,13 +376,32 @@ strtod (const char *nptr, char **endptr)
               while (p < end && c_tolower (*p) != 'p')
                 p++;
               if (p < end && ! c_isdigit (p[1 + (p[1] == '-' || p[1] == '+')]))
-                end = p;
+                {
+                  char *dup = strdup (s);
+                  errno = saved_errno;
+                  if (!dup)
+                    {
+                      /* Not really our day, is it.  Rounding errors are
+                         better than outright failure.  */
+                      num =
+                        parse_number (s + 2, 16, 2, 4, radixchar, 'p', &endbuf);
+                    }
+                  else
+                    {
+                      dup[p - s] = '\0';
+                      num = STRTOD (dup, &endbuf);
+                      saved_errno = errno;
+                      free (dup);
+                      errno = saved_errno;
+                    }
+                  end = p;
+                }
             }
         }
       else
         {
           /* If "1e 1" was misparsed as 10.0 instead of 1.0, re-do the
-             underlying strtod on a copy of the original string
+             underlying STRTOD on a copy of the original string
              truncated to avoid the bug.  */
           const char *e = s + 1;
           while (e < end && c_tolower (*e) != 'e')
@@ -274,12 +414,12 @@ strtod (const char *nptr, char **endptr)
                 {
                   /* Not really our day, is it.  Rounding errors are
                      better than outright failure.  */
-                  num = parse_number (s, 10, 10, 1, 'e', &endbuf);
+                  num = parse_number (s, 10, 10, 1, radixchar, 'e', &endbuf);
                 }
               else
                 {
                   dup[e - s] = '\0';
-                  num = underlying_strtod (dup, &endbuf);
+                  num = STRTOD (dup, &endbuf);
                   saved_errno = errno;
                   free (dup);
                   errno = saved_errno;
@@ -341,15 +481,6 @@ strtod (const char *nptr, char **endptr)
   /* Special case -0.0, since at least ICC miscompiles negation.  We
      can't use copysign(), as that drags in -lm on some platforms.  */
   if (!num && negative)
-    return minus_zero;
+    return minus_zero ();
   return negative ? -num : num;
 }
-
-/* The underlying strtod implementation.  This must be defined
-   after strtod because it #undefs strtod.  */
-static double
-underlying_strtod (const char *nptr, char **endptr)
-{
-#undef strtod
-  return strtod (nptr, endptr);
-}
diff --git a/lib/sys_random.in.h b/lib/sys_random.in.h
new file mode 100644 (file)
index 0000000..5b9280d
--- /dev/null
@@ -0,0 +1,96 @@
+/* Substitute for <sys/random.h>.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+# if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+# endif
+@PRAGMA_COLUMNS@
+
+#ifndef _@GUARD_PREFIX@_SYS_RANDOM_H
+
+#if @HAVE_SYS_RANDOM_H@
+
+/* On uClibc, <sys/random.h> assumes prior inclusion of <stddef.h>.  */
+# if defined __UCLIBC__
+#  include <stddef.h>
+# endif
+/* On Mac OS X 10.5, <sys/random.h> assumes prior inclusion of <sys/types.h>.
+   On Max OS X 10.13, <sys/random.h> assumes prior inclusion of a file that
+   includes <Availability.h>, such as <stdlib.h> or <unistd.h>.  */
+# if defined __APPLE__ && defined __MACH__                  /* Mac OS X */
+#  include <sys/types.h>
+#  include <stdlib.h>
+# endif
+
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_SYS_RANDOM_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_RANDOM_H
+#define _@GUARD_PREFIX@_SYS_RANDOM_H
+
+#include <sys/types.h>
+
+/* Define the GRND_* constants.  */
+#ifndef GRND_NONBLOCK
+# define GRND_NONBLOCK 1
+# define GRND_RANDOM 2
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
+/* Declare overridden functions.  */
+
+
+#if @GNULIB_GETRANDOM@
+/* Fill a buffer with random bytes.  */
+# if @REPLACE_GETRANDOM@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getrandom
+#   define getrandom rpl_getrandom
+#  endif
+_GL_FUNCDECL_RPL (getrandom, ssize_t,
+                  (void *buffer, size_t length, unsigned int flags)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getrandom, ssize_t,
+                  (void *buffer, size_t length, unsigned int flags));
+# else
+#  if !@HAVE_GETRANDOM@
+_GL_FUNCDECL_SYS (getrandom, ssize_t,
+                  (void *buffer, size_t length, unsigned int flags)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (getrandom, ssize_t,
+                  (void *buffer, size_t length, unsigned int flags));
+# endif
+_GL_CXXALIASWARN (getrandom);
+#elif defined GNULIB_POSIXCHECK
+# undef getrandom
+# if HAVE_RAW_DECL_GETRANDOM
+_GL_WARN_ON_USE (getrandom, "getrandom is unportable - "
+                 "use gnulib module getrandom for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_RANDOM_H */
+#endif /* _@GUARD_PREFIX@_SYS_RANDOM_H */
index 72d9537..13d1294 100644 (file)
@@ -1,5 +1,5 @@
-/* Provide a more complete sys/stat header file.
-   Copyright (C) 2005-2016 Free Software Foundation, Inc.
+/* Provide a more complete sys/stat.h header file.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake, Paul Eggert, and Jim Meyering.  */
 
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
+/* Before doing "#define mknod rpl_mknod" below, we need to include all
+   headers that may declare mknod().  OS/2 kLIBC declares mknod() in
+   <unistd.h>, not in <sys/stat.h>.  */
+#ifdef __KLIBC__
+# include <unistd.h>
+#endif
+
 /* Before doing "#define mkdir rpl_mkdir" below, we need to include all
    headers that may declare mkdir().  Native Windows platforms declare mkdir
-   in <io.h> and/or <direct.h>, not in <unistd.h>.  */
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+   in <io.h> and/or <direct.h>, not in <sys/stat.h>.  */
+#if defined _WIN32 && ! defined __CYGWIN__
 # include <io.h>     /* mingw32, mingw64 */
 # include <direct.h> /* mingw64, MSVC 9 */
 #endif
 
 /* Native Windows platforms declare umask() in <io.h>.  */
-#if 0 && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if 0 && (defined _WIN32 && ! defined __CYGWIN__)
 # include <io.h>
 #endif
 
 # define stat _stati64
 #endif
 
+/* Optionally, override 'struct stat' on native Windows.  */
+#if @GNULIB_OVERRIDES_STRUCT_STAT@
+
+# undef stat
+# if @GNULIB_STAT@
+#  define stat rpl_stat
+# else
+   /* Provoke a clear link error if stat() is used as a function and
+      module 'stat' is not in use.  */
+#  define stat stat_used_without_requesting_gnulib_module_stat
+# endif
+
+# if !GNULIB_defined_struct_stat
+struct stat
+{
+  dev_t st_dev;
+  ino_t st_ino;
+  mode_t st_mode;
+  nlink_t st_nlink;
+#  if 0
+  uid_t st_uid;
+#  else /* uid_t is not defined by default on native Windows.  */
+  short st_uid;
+#  endif
+#  if 0
+  gid_t st_gid;
+#  else /* gid_t is not defined by default on native Windows.  */
+  short st_gid;
+#  endif
+  dev_t st_rdev;
+  off_t st_size;
+#  if 0
+  blksize_t st_blksize;
+  blkcnt_t st_blocks;
+#  endif
+
+#  if @WINDOWS_STAT_TIMESPEC@
+  struct timespec st_atim;
+  struct timespec st_mtim;
+  struct timespec st_ctim;
+#  else
+  time_t st_atime;
+  time_t st_mtime;
+  time_t st_ctime;
+#  endif
+};
+#  if @WINDOWS_STAT_TIMESPEC@
+#   define st_atime st_atim.tv_sec
+#   define st_mtime st_mtim.tv_sec
+#   define st_ctime st_ctim.tv_sec
+    /* Indicator, for gnulib internal purposes.  */
+#   define _GL_WINDOWS_STAT_TIMESPEC 1
+#  endif
+#  define GNULIB_defined_struct_stat 1
+# endif
+
+/* Other possible values of st_mode.  */
+# if 0
+#  define _S_IFBLK  0x6000
+# endif
+# if 0
+#  define _S_IFLNK  0xA000
+# endif
+# if 0
+#  define _S_IFSOCK 0xC000
+# endif
+
+#endif
+
 #ifndef S_IFIFO
 # ifdef _S_IFIFO
 #  define S_IFIFO _S_IFIFO
 # define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH)
 #endif
 
-/* S_IXUGO is a common extension to POSIX.  */
+/* Although S_IXUGO and S_IRWXUGO are not specified by POSIX and are
+   not implemented in GNU/Linux, some Gnulib-using apps use the macros.  */
 #if !S_IXUGO
 # define S_IXUGO (S_IXUSR | S_IXGRP | S_IXOTH)
 #endif
-
 #ifndef S_IRWXUGO
 # define S_IRWXUGO (S_IRWXU | S_IRWXG | S_IRWXO)
 #endif
 #endif
 
 
+#if @GNULIB_MDA_CHMOD@
+/* On native Windows, map 'chmod' to '_chmod', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::chmod always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef chmod
+#   define chmod _chmod
+#  endif
+/* Need to cast, because in mingw the last argument is 'int mode'.  */
+_GL_CXXALIAS_MDA_CAST (chmod, int, (const char *filename, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (chmod, int, (const char *filename, mode_t mode));
+# endif
+_GL_CXXALIASWARN (chmod);
+#endif
+
+
 #if @GNULIB_FCHMODAT@
-# if !@HAVE_FCHMODAT@
+# if @REPLACE_FCHMODAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef fchmodat
+#   define fchmodat rpl_fchmodat
+#  endif
+_GL_FUNCDECL_RPL (fchmodat, int,
+                  (int fd, char const *file, mode_t mode, int flag)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (fchmodat, int,
+                  (int fd, char const *file, mode_t mode, int flag));
+# else
+#  if !@HAVE_FCHMODAT@
 _GL_FUNCDECL_SYS (fchmodat, int,
                   (int fd, char const *file, mode_t mode, int flag)
                   _GL_ARG_NONNULL ((2)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (fchmodat, int,
                   (int fd, char const *file, mode_t mode, int flag));
+# endif
 _GL_CXXALIASWARN (fchmodat);
 #elif defined GNULIB_POSIXCHECK
 # undef fchmodat
@@ -344,7 +450,12 @@ _GL_CXXALIAS_RPL (fstat, int, (int fd, struct stat *buf));
 # else
 _GL_CXXALIAS_SYS (fstat, int, (int fd, struct stat *buf));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (fstat);
+# endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef fstat
+# define fstat fstat_used_without_requesting_gnulib_module_fstat
 #elif @WINDOWS_64_BIT_ST_SIZE@
 /* Above, we define stat to _stati64.  */
 # define fstat _fstati64
@@ -364,20 +475,27 @@ _GL_WARN_ON_USE (fstat, "fstat has portability problems - "
 #   define fstatat rpl_fstatat
 #  endif
 _GL_FUNCDECL_RPL (fstatat, int,
-                  (int fd, char const *name, struct stat *st, int flags)
+                  (int fd, char const *restrict name, struct stat *restrict st,
+                   int flags)
                   _GL_ARG_NONNULL ((2, 3)));
 _GL_CXXALIAS_RPL (fstatat, int,
-                  (int fd, char const *name, struct stat *st, int flags));
+                  (int fd, char const *restrict name, struct stat *restrict st,
+                   int flags));
 # else
 #  if !@HAVE_FSTATAT@
 _GL_FUNCDECL_SYS (fstatat, int,
-                  (int fd, char const *name, struct stat *st, int flags)
+                  (int fd, char const *restrict name, struct stat *restrict st,
+                   int flags)
                   _GL_ARG_NONNULL ((2, 3)));
 #  endif
 _GL_CXXALIAS_SYS (fstatat, int,
-                  (int fd, char const *name, struct stat *st, int flags));
+                  (int fd, char const *restrict name, struct stat *restrict st,
+                   int flags));
 # endif
 _GL_CXXALIASWARN (fstatat);
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef fstatat
+# define fstatat fstatat_used_without_requesting_gnulib_module_fstatat
 #elif defined GNULIB_POSIXCHECK
 # undef fstatat
 # if HAVE_RAW_DECL_FSTATAT
@@ -417,34 +535,32 @@ _GL_WARN_ON_USE (futimens, "futimens is not portable - "
 #endif
 
 
+#if @GNULIB_GETUMASK@
+# if !@HAVE_GETUMASK@
+_GL_FUNCDECL_SYS (getumask, mode_t, (void));
+# endif
+_GL_CXXALIAS_SYS (getumask, mode_t, (void));
+# if @HAVE_GETUMASK@
+_GL_CXXALIASWARN (getumask);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef getumask
+# if HAVE_RAW_DECL_GETUMASK
+_GL_WARN_ON_USE (getumask, "getumask is not portable - "
+                 "use gnulib module getumask for portability");
+# endif
+#endif
+
+
 #if @GNULIB_LCHMOD@
 /* Change the mode of FILENAME to MODE, without dereferencing it if FILENAME
    denotes a symbolic link.  */
-# if !@HAVE_LCHMOD@
-/* The lchmod replacement follows symbolic links.  Callers should take
-   this into account; lchmod should be applied only to arguments that
-   are known to not be symbolic links.  On hosts that lack lchmod,
-   this can lead to race conditions between the check and the
-   invocation of lchmod, but we know of no workarounds that are
-   reliable in general.  You might try requesting support for lchmod
-   from your operating system supplier.  */
-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#   define lchmod chmod
-#  endif
-/* Need to cast, because on mingw, the second parameter of chmod is
-                                                int mode.  */
-_GL_CXXALIAS_RPL_CAST_1 (lchmod, chmod, int,
-                         (const char *filename, mode_t mode));
-# else
-#  if 0 /* assume already declared */
+# if !@HAVE_LCHMOD@ || defined __hpux
 _GL_FUNCDECL_SYS (lchmod, int, (const char *filename, mode_t mode)
                                _GL_ARG_NONNULL ((1)));
-#  endif
-_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
 # endif
-# if @HAVE_LCHMOD@
+_GL_CXXALIAS_SYS (lchmod, int, (const char *filename, mode_t mode));
 _GL_CXXALIASWARN (lchmod);
-# endif
 #elif defined GNULIB_POSIXCHECK
 # undef lchmod
 # if HAVE_RAW_DECL_LCHMOD
@@ -461,21 +577,28 @@ _GL_WARN_ON_USE (lchmod, "lchmod is unportable - "
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define lstat stat
 #  endif
-_GL_CXXALIAS_RPL_1 (lstat, stat, int, (const char *name, struct stat *buf));
+_GL_CXXALIAS_RPL_1 (lstat, stat, int,
+                    (const char *restrict name, struct stat *restrict buf));
 # elif @REPLACE_LSTAT@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef lstat
 #   define lstat rpl_lstat
 #  endif
-_GL_FUNCDECL_RPL (lstat, int, (const char *name, struct stat *buf)
-                              _GL_ARG_NONNULL ((1, 2)));
-_GL_CXXALIAS_RPL (lstat, int, (const char *name, struct stat *buf));
+_GL_FUNCDECL_RPL (lstat, int,
+                  (const char *restrict name, struct stat *restrict buf)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (lstat, int,
+                  (const char *restrict name, struct stat *restrict buf));
 # else
-_GL_CXXALIAS_SYS (lstat, int, (const char *name, struct stat *buf));
+_GL_CXXALIAS_SYS (lstat, int,
+                  (const char *restrict name, struct stat *restrict buf));
 # endif
 # if @HAVE_LSTAT@
 _GL_CXXALIASWARN (lstat);
 # endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+# undef lstat
+# define lstat lstat_used_without_requesting_gnulib_module_lstat
 #elif defined GNULIB_POSIXCHECK
 # undef lstat
 # if HAVE_RAW_DECL_LSTAT
@@ -485,21 +608,20 @@ _GL_WARN_ON_USE (lstat, "lstat is unportable - "
 #endif
 
 
-#if @REPLACE_MKDIR@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#  undef mkdir
-#  define mkdir rpl_mkdir
-# endif
+#if @GNULIB_MKDIR@
+# if @REPLACE_MKDIR@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mkdir
+#   define mkdir rpl_mkdir
+#  endif
 _GL_FUNCDECL_RPL (mkdir, int, (char const *name, mode_t mode)
-                              _GL_ARG_NONNULL ((1)));
+                               _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
-#else
+# elif defined _WIN32 && !defined __CYGWIN__
 /* mingw's _mkdir() function has 1 argument, but we pass 2 arguments.
    Additionally, it declares _mkdir (and depending on compile flags, an
    alias mkdir), only in the nonstandard includes <direct.h> and <io.h>,
    which are included above.  */
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-
 #  if !GNULIB_defined_rpl_mkdir
 static int
 rpl_mkdir (char const *name, mode_t mode)
@@ -508,16 +630,44 @@ rpl_mkdir (char const *name, mode_t mode)
 }
 #   define GNULIB_defined_rpl_mkdir 1
 #  endif
-
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mkdir
 #   define mkdir rpl_mkdir
 #  endif
 _GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
 # else
 _GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
 # endif
-#endif
 _GL_CXXALIASWARN (mkdir);
+#elif defined GNULIB_POSIXCHECK
+# undef mkdir
+# if HAVE_RAW_DECL_MKDIR
+_GL_WARN_ON_USE (mkdir, "mkdir does not always support two parameters - "
+                 "use gnulib module mkdir for portability");
+# endif
+#elif @GNULIB_MDA_MKDIR@
+/* On native Windows, map 'mkdir' to '_mkdir', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::mkdir always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !GNULIB_defined_rpl_mkdir
+static int
+rpl_mkdir (char const *name, mode_t mode)
+{
+  return _mkdir (name);
+}
+#   define GNULIB_defined_rpl_mkdir 1
+#  endif
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mkdir
+#   define mkdir rpl_mkdir
+#  endif
+_GL_CXXALIAS_RPL (mkdir, int, (char const *name, mode_t mode));
+# else
+_GL_CXXALIAS_SYS (mkdir, int, (char const *name, mode_t mode));
+# endif
+_GL_CXXALIASWARN (mkdir);
+#endif
 
 
 #if @GNULIB_MKDIRAT@
@@ -563,11 +713,21 @@ _GL_WARN_ON_USE (mkfifo, "mkfifo is not portable - "
 
 
 #if @GNULIB_MKFIFOAT@
-# if !@HAVE_MKFIFOAT@
+# if @REPLACE_MKFIFOAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mkfifoat
+#   define mkfifoat rpl_mkfifoat
+#  endif
+_GL_FUNCDECL_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode)
+                                 _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mkfifoat, int, (int fd, char const *file, mode_t mode));
+# else
+#  if !@HAVE_MKFIFOAT@
 _GL_FUNCDECL_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode)
                                  _GL_ARG_NONNULL ((2)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (mkfifoat, int, (int fd, char const *file, mode_t mode));
+# endif
 _GL_CXXALIASWARN (mkfifoat);
 #elif defined GNULIB_POSIXCHECK
 # undef mkfifoat
@@ -606,13 +766,25 @@ _GL_WARN_ON_USE (mknod, "mknod is not portable - "
 
 
 #if @GNULIB_MKNODAT@
-# if !@HAVE_MKNODAT@
+# if @REPLACE_MKNODAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef mknodat
+#   define mknodat rpl_mknodat
+#  endif
+_GL_FUNCDECL_RPL (mknodat, int,
+                  (int fd, char const *file, mode_t mode, dev_t dev)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (mknodat, int,
+                  (int fd, char const *file, mode_t mode, dev_t dev));
+# else
+#  if !@HAVE_MKNODAT@
 _GL_FUNCDECL_SYS (mknodat, int,
                   (int fd, char const *file, mode_t mode, dev_t dev)
                   _GL_ARG_NONNULL ((2)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (mknodat, int,
                   (int fd, char const *file, mode_t mode, dev_t dev));
+# endif
 _GL_CXXALIASWARN (mknodat);
 #elif defined GNULIB_POSIXCHECK
 # undef mknodat
@@ -625,63 +797,69 @@ _GL_WARN_ON_USE (mknodat, "mknodat is not portable - "
 
 #if @GNULIB_STAT@
 # if @REPLACE_STAT@
-/* We can't use the object-like #define stat rpl_stat, because of
-   struct stat.  This means that rpl_stat will not be used if the user
-   does (stat)(a,b).  Oh well.  */
-#  if defined _AIX && defined stat && defined _LARGE_FILES
-    /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
-       so we have to replace stat64() instead of stat(). */
-#   undef stat64
-#   define stat64(name, st) rpl_stat (name, st)
-#  elif @WINDOWS_64_BIT_ST_SIZE@
-    /* Above, we define stat to _stati64.  */
-#   if defined __MINGW32__ && defined _stati64
-#    ifndef _USE_32BIT_TIME_T
-      /* The system headers define _stati64 to _stat64.  */
-#     undef _stat64
-#     define _stat64(name, st) rpl_stat (name, st)
+#  if !@GNULIB_OVERRIDES_STRUCT_STAT@
+    /* We can't use the object-like #define stat rpl_stat, because of
+       struct stat.  This means that rpl_stat will not be used if the user
+       does (stat)(a,b).  Oh well.  */
+#   if defined _AIX && defined stat && defined _LARGE_FILES
+     /* With _LARGE_FILES defined, AIX (only) defines stat to stat64,
+        so we have to replace stat64() instead of stat(). */
+#    undef stat64
+#    define stat64(name, st) rpl_stat (name, st)
+#   elif @WINDOWS_64_BIT_ST_SIZE@
+     /* Above, we define stat to _stati64.  */
+#    if defined __MINGW32__ && defined _stati64
+#     ifndef _USE_32BIT_TIME_T
+       /* The system headers define _stati64 to _stat64.  */
+#      undef _stat64
+#      define _stat64(name, st) rpl_stat (name, st)
+#     endif
+#    elif defined _MSC_VER && defined _stati64
+#     ifdef _USE_32BIT_TIME_T
+       /* The system headers define _stati64 to _stat32i64.  */
+#      undef _stat32i64
+#      define _stat32i64(name, st) rpl_stat (name, st)
+#     else
+       /* The system headers define _stati64 to _stat64.  */
+#      undef _stat64
+#      define _stat64(name, st) rpl_stat (name, st)
+#     endif
+#    else
+#     undef _stati64
+#     define _stati64(name, st) rpl_stat (name, st)
 #    endif
-#   elif defined _MSC_VER && defined _stati64
+#   elif defined __MINGW32__ && defined stat
 #    ifdef _USE_32BIT_TIME_T
-      /* The system headers define _stati64 to _stat32i64.  */
+      /* The system headers define stat to _stat32i64.  */
 #     undef _stat32i64
 #     define _stat32i64(name, st) rpl_stat (name, st)
 #    else
-      /* The system headers define _stati64 to _stat64.  */
+      /* The system headers define stat to _stat64.  */
 #     undef _stat64
 #     define _stat64(name, st) rpl_stat (name, st)
 #    endif
-#   else
-#    undef _stati64
-#    define _stati64(name, st) rpl_stat (name, st)
-#   endif
-#  elif defined __MINGW32__ && defined stat
-#   ifdef _USE_32BIT_TIME_T
-     /* The system headers define stat to _stat32i64.  */
-#    undef _stat32i64
-#    define _stat32i64(name, st) rpl_stat (name, st)
-#   else
-     /* The system headers define stat to _stat64.  */
-#    undef _stat64
-#    define _stat64(name, st) rpl_stat (name, st)
-#   endif
-#  elif defined _MSC_VER && defined stat
-#   ifdef _USE_32BIT_TIME_T
-     /* The system headers define stat to _stat32.  */
-#    undef _stat32
-#    define _stat32(name, st) rpl_stat (name, st)
-#   else
-     /* The system headers define stat to _stat64i32.  */
-#    undef _stat64i32
-#    define _stat64i32(name, st) rpl_stat (name, st)
-#   endif
-#  else /* !(_AIX ||__MINGW32__ ||  _MSC_VER) */
-#   undef stat
-#   define stat(name, st) rpl_stat (name, st)
-#  endif /* !_LARGE_FILES */
-_GL_EXTERN_C int stat (const char *name, struct stat *buf)
+#   elif defined _MSC_VER && defined stat
+#    ifdef _USE_32BIT_TIME_T
+      /* The system headers define stat to _stat32.  */
+#     undef _stat32
+#     define _stat32(name, st) rpl_stat (name, st)
+#    else
+      /* The system headers define stat to _stat64i32.  */
+#     undef _stat64i32
+#     define _stat64i32(name, st) rpl_stat (name, st)
+#    endif
+#   else /* !(_AIX || __MINGW32__ || _MSC_VER) */
+#    undef stat
+#    define stat(name, st) rpl_stat (name, st)
+#   endif /* !_LARGE_FILES */
+#  endif /* !@GNULIB_OVERRIDES_STRUCT_STAT@ */
+_GL_EXTERN_C int stat (const char *restrict name, struct stat *restrict buf)
                       _GL_ARG_NONNULL ((1, 2));
 # endif
+#elif @GNULIB_OVERRIDES_STRUCT_STAT@
+/* see above:
+  #define stat stat_used_without_requesting_gnulib_module_stat
+ */
 #elif defined GNULIB_POSIXCHECK
 # undef stat
 # if HAVE_RAW_DECL_STAT
@@ -691,6 +869,24 @@ _GL_WARN_ON_USE (stat, "stat is unportable - "
 #endif
 
 
+#if @GNULIB_MDA_UMASK@
+/* On native Windows, map 'umask' to '_umask', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::umask always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef umask
+#   define umask _umask
+#  endif
+/* Need to cast, because in mingw the last argument is 'int mode'.  */
+_GL_CXXALIAS_MDA_CAST (umask, mode_t, (mode_t mask));
+# else
+_GL_CXXALIAS_SYS (umask, mode_t, (mode_t mask));
+# endif
+_GL_CXXALIASWARN (umask);
+#endif
+
+
 #if @GNULIB_UTIMENSAT@
 /* Use the rpl_ prefix also on Solaris <= 9, because on Solaris 9 our utimensat
    implementation relies on futimesat, which on Solaris 10 makes an invocation
index 8ab0545..654e803 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/types.h.
 
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 #endif
 @PRAGMA_COLUMNS@
 
+#if defined _WIN32 && !defined __CYGWIN__ \
+    && (defined __need_off_t || defined __need___off64_t \
+        || defined __need_ssize_t || defined __need_time_t)
+
+/* Special invocation convention inside mingw header files.  */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@
+
+#else
+/* Normal invocation convention.  */
+
 #ifndef _@GUARD_PREFIX@_SYS_TYPES_H
 
 /* The include_next requires a split double-inclusion guard.  */
 # define _GL_WINDOWS_64_BIT_OFF_T 1
 #endif
 
+/* Override dev_t and ino_t if distinguishable inodes support is requested
+   on native Windows.  */
+#if @WINDOWS_STAT_INODES@
+
+# if @WINDOWS_STAT_INODES@ == 2
+/* Experimental, not useful in Windows 10.  */
+
+/* Define dev_t to a 64-bit type.  */
+#  if !defined GNULIB_defined_dev_t
+typedef unsigned long long int rpl_dev_t;
+#   undef dev_t
+#   define dev_t rpl_dev_t
+#   define GNULIB_defined_dev_t 1
+#  endif
+
+/* Define ino_t to a 128-bit type.  */
+#  if !defined GNULIB_defined_ino_t
+/* MSVC does not have a 128-bit integer type.
+   GCC has a 128-bit integer type __int128, but only on 64-bit targets.  */
+typedef struct { unsigned long long int _gl_ino[2]; } rpl_ino_t;
+#   undef ino_t
+#   define ino_t rpl_ino_t
+#   define GNULIB_defined_ino_t 1
+#  endif
+
+# else /* @WINDOWS_STAT_INODES@ == 1 */
+
+/* Define ino_t to a 64-bit type.  */
+#  if !defined GNULIB_defined_ino_t
+typedef unsigned long long int rpl_ino_t;
+#   undef ino_t
+#   define ino_t rpl_ino_t
+#   define GNULIB_defined_ino_t 1
+#  endif
+
+# endif
+
+/* Indicator, for gnulib internal purposes.  */
+# define _GL_WINDOWS_STAT_INODES @WINDOWS_STAT_INODES@
+
+#endif
+
 /* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
-#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
-    && ! defined __GLIBC__
+#if (defined _WIN32 && ! defined __CYGWIN__) && ! defined __GLIBC__
 # include <stddef.h>
 #endif
 
 #endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
 #endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
+#endif /* __need_XXX */
index 3982b2b..25d25a0 100644 (file)
@@ -1,5 +1,5 @@
 /* A POSIX-like <sys/wait.h>.
-   Copyright (C) 2001-2003, 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 
 #ifndef _@GUARD_PREFIX@_SYS_WAIT_H
@@ -23,7 +23,7 @@
 @PRAGMA_COLUMNS@
 
 /* The include_next requires a split double-inclusion guard.  */
-#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if !(defined _WIN32 && ! defined __CYGWIN__)
 # @INCLUDE_NEXT@ @NEXT_SYS_WAIT_H@
 #endif
 
@@ -39,7 +39,7 @@
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
 
-#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if !(defined _WIN32 && ! defined __CYGWIN__)
 /* Unix API.  */
 
 /* The following macros apply to an argument x, that is a status of a process,
 /* Declarations of functions.  */
 
 #if @GNULIB_WAITPID@
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 _GL_FUNCDECL_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
 # endif
-_GL_CXXALIAS_SYS (waitpid, pid_t, (pid_t pid, int *statusp, int options));
+/* Need to cast, because on Cygwin, the second parameter is
+                                                __wait_status_ptr_t statusp.  */
+_GL_CXXALIAS_SYS_CAST (waitpid, pid_t, (pid_t pid, int *statusp, int options));
 _GL_CXXALIASWARN (waitpid);
 #elif defined GNULIB_POSIXCHECK
 # undef waitpid
index b1e9880..e243483 100644 (file)
@@ -1,34 +1,30 @@
-/* tempname.c - generate the name of a temporary file.
+/* Copyright (C) 1991-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
 
-   Copyright (C) 1991-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
 
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
+   The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
 
-/* Extracted from glibc sysdeps/posix/tempname.c.  See also tmpdir.c.  */
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #if !_LIBC
-# include <config.h>
+# include <libc-config.h>
 # include "tempname.h"
 #endif
 
 #include <sys/types.h>
 #include <assert.h>
+#include <stdbool.h>
 
 #include <errno.h>
-#ifndef __set_errno
-# define __set_errno(Val) errno = (Val)
-#endif
 
 #include <stdio.h>
 #ifndef P_tmpdir
 #include <string.h>
 
 #include <fcntl.h>
-#include <sys/time.h>
+#include <stdalign.h>
 #include <stdint.h>
-#include <unistd.h>
-
+#include <sys/random.h>
 #include <sys/stat.h>
+#include <time.h>
 
 #if _LIBC
 # define struct_stat64 struct stat64
+# define __secure_getenv __libc_secure_getenv
 #else
 # define struct_stat64 struct stat
-# define __try_tempname try_tempname
 # define __gen_tempname gen_tempname
-# define __getpid getpid
-# define __gettimeofday gettimeofday
 # define __mkdir mkdir
 # define __open open
-# define __lxstat64(version, file, buf) lstat (file, buf)
-# define __secure_getenv secure_getenv
+# define __lstat64(file, buf) lstat (file, buf)
+# define __stat64(file, buf) stat (file, buf)
+# define __getrandom getrandom
+# define __clock_gettime64 clock_gettime
+# define __timespec64 timespec
 #endif
 
-#ifdef _LIBC
-# include <hp-timing.h>
-# if HP_TIMING_AVAIL
-#  define RANDOM_BITS(Var) \
-  if (__builtin_expect (value == UINT64_C (0), 0))                            \
-    {                                                                         \
-      /* If this is the first time this function is used initialize           \
-         the variable we accumulate the value in to some somewhat             \
-         random value.  If we'd not do this programs at startup time          \
-         might have a reduced set of possible names, at least on slow         \
-         machines.  */                                                        \
-      struct timeval tv;                                                      \
-      __gettimeofday (&tv, NULL);                                             \
-      value = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;                      \
-    }                                                                         \
-  HP_TIMING_NOW (Var)
-# endif
-#endif
+/* Use getrandom if it works, falling back on a 64-bit linear
+   congruential generator that starts with Var's value
+   mixed in with a clock's low-order bits if available.  */
+typedef uint_fast64_t random_value;
+#define RANDOM_VALUE_MAX UINT_FAST64_MAX
+#define BASE_62_DIGITS 10 /* 62**10 < UINT_FAST64_MAX */
+#define BASE_62_POWER (62LL * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62 * 62)
 
-/* Use the widest available unsigned type if uint64_t is not
-   available.  The algorithm below extracts a number less than 62**6
-   (approximately 2**35.725) from uint64_t, so ancient hosts where
-   uintmax_t is only 32 bits lose about 3.725 bits of randomness,
-   which is better than not having mkstemp at all.  */
-#if !defined UINT64_MAX && !defined uint64_t
-# define uint64_t uintmax_t
+static random_value
+random_bits (random_value var, bool use_getrandom)
+{
+  random_value r;
+  /* Without GRND_NONBLOCK it can be blocked for minutes on some systems.  */
+  if (use_getrandom && __getrandom (&r, sizeof r, GRND_NONBLOCK) == sizeof r)
+    return r;
+#if _LIBC || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
+  /* Add entropy if getrandom did not work.  */
+  struct __timespec64 tv;
+  __clock_gettime64 (CLOCK_MONOTONIC, &tv);
+  var ^= tv.tv_nsec;
 #endif
+  return 2862933555777941757 * var + 3037000493;
+}
 
 #if _LIBC
 /* Return nonzero if DIR is an existent directory.  */
@@ -106,7 +99,7 @@ static int
 direxists (const char *dir)
 {
   struct_stat64 buf;
-  return __xstat64 (_STAT_VER, dir, &buf) == 0 && S_ISDIR (buf.st_mode);
+  return __stat64 (dir, &buf) == 0 && S_ISDIR (buf.st_mode);
 }
 
 /* Path search algorithm, for tmpnam, tmpfile, etc.  If DIR is
@@ -173,18 +166,80 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
 }
 #endif /* _LIBC */
 
+#if _LIBC
+static int try_tempname_len (char *, int, void *, int (*) (char *, void *),
+                             size_t);
+#endif
+
+static int
+try_file (char *tmpl, void *flags)
+{
+  int *openflags = flags;
+  return __open (tmpl,
+                 (*openflags & ~O_ACCMODE)
+                 | O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
+}
+
+static int
+try_dir (char *tmpl, void *flags _GL_UNUSED)
+{
+  return __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
+}
+
+static int
+try_nocreate (char *tmpl, void *flags _GL_UNUSED)
+{
+  struct_stat64 st;
+
+  if (__lstat64 (tmpl, &st) == 0 || errno == EOVERFLOW)
+    __set_errno (EEXIST);
+  return errno == ENOENT ? 0 : -1;
+}
+
 /* These are the characters used in temporary file names.  */
 static const char letters[] =
 "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
 
+/* Generate a temporary file name based on TMPL.  TMPL must match the
+   rules for mk[s]temp (i.e., end in at least X_SUFFIX_LEN "X"s,
+   possibly with a suffix).
+   The name constructed does not exist at the time of the call to
+   this function.  TMPL is overwritten with the result.
+
+   KIND may be one of:
+   __GT_NOCREATE:       simply verify that the name does not exist
+                        at the time of the call.
+   __GT_FILE:           create the file using open(O_CREAT|O_EXCL)
+                        and return a read-write fd.  The file is mode 0600.
+   __GT_DIR:            create a directory, which will be mode 0700.
+
+   We use a clever algorithm to get hard-to-predict names. */
+#ifdef _LIBC
+static
+#endif
 int
-__try_tempname (char *tmpl, int suffixlen, void *args,
-                int (*tryfunc) (char *, void *))
+gen_tempname_len (char *tmpl, int suffixlen, int flags, int kind,
+                  size_t x_suffix_len)
 {
-  int len;
+  static int (*const tryfunc[]) (char *, void *) =
+    {
+      [__GT_FILE] = try_file,
+      [__GT_DIR] = try_dir,
+      [__GT_NOCREATE] = try_nocreate
+    };
+  return try_tempname_len (tmpl, suffixlen, &flags, tryfunc[kind],
+                           x_suffix_len);
+}
+
+#ifdef _LIBC
+static
+#endif
+int
+try_tempname_len (char *tmpl, int suffixlen, void *args,
+                  int (*tryfunc) (char *, void *), size_t x_suffix_len)
+{
+  size_t len;
   char *XXXXXX;
-  static uint64_t value;
-  uint64_t random_time_bits;
   unsigned int count;
   int fd = -1;
   int save_errno = errno;
@@ -194,7 +249,8 @@ __try_tempname (char *tmpl, int suffixlen, void *args,
      can exist for a given template is 62**6.  It should never be
      necessary to try all of these combinations.  Instead if a reasonable
      number of names is tried (we define reasonable as 62**3) fail to
-     give the system administrator the chance to remove the problems.  */
+     give the system administrator the chance to remove the problems.
+     This value requires that X_SUFFIX_LEN be at least 3.  */
 #define ATTEMPTS_MIN (62 * 62 * 62)
 
   /* The number of times to attempt to generate a temporary file.  To
@@ -205,44 +261,58 @@ __try_tempname (char *tmpl, int suffixlen, void *args,
   unsigned int attempts = ATTEMPTS_MIN;
 #endif
 
+  /* A random variable.  The initial value is used only the for fallback path
+     on 'random_bits' on 'getrandom' failure.  Its initial value tries to use
+     some entropy from the ASLR and ignore possible bits from the stack
+     alignment.  */
+  random_value v = ((uintptr_t) &v) / alignof (max_align_t);
+
+  /* How many random base-62 digits can currently be extracted from V.  */
+  int vdigits = 0;
+
+  /* Whether to consume entropy when acquiring random bits.  On the
+     first try it's worth the entropy cost with __GT_NOCREATE, which
+     is inherently insecure and can use the entropy to make it a bit
+     less secure.  On the (rare) second and later attempts it might
+     help against DoS attacks.  */
+  bool use_getrandom = tryfunc == try_nocreate;
+
+  /* Least unfair value for V.  If V is less than this, V can generate
+     BASE_62_DIGITS digits fairly.  Otherwise it might be biased.  */
+  random_value const unfair_min
+    = RANDOM_VALUE_MAX - RANDOM_VALUE_MAX % BASE_62_POWER;
+
   len = strlen (tmpl);
-  if (len < 6 + suffixlen || memcmp (&tmpl[len - 6 - suffixlen], "XXXXXX", 6))
+  if (len < x_suffix_len + suffixlen
+      || strspn (&tmpl[len - x_suffix_len - suffixlen], "X") < x_suffix_len)
     {
       __set_errno (EINVAL);
       return -1;
     }
 
   /* This is where the Xs start.  */
-  XXXXXX = &tmpl[len - 6 - suffixlen];
-
-  /* Get some more or less random data.  */
-#ifdef RANDOM_BITS
-  RANDOM_BITS (random_time_bits);
-#else
-  {
-    struct timeval tv;
-    __gettimeofday (&tv, NULL);
-    random_time_bits = ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec;
-  }
-#endif
-  value += random_time_bits ^ __getpid ();
+  XXXXXX = &tmpl[len - x_suffix_len - suffixlen];
 
-  for (count = 0; count < attempts; value += 7777, ++count)
+  for (count = 0; count < attempts; ++count)
     {
-      uint64_t v = value;
-
-      /* Fill in the random bits.  */
-      XXXXXX[0] = letters[v % 62];
-      v /= 62;
-      XXXXXX[1] = letters[v % 62];
-      v /= 62;
-      XXXXXX[2] = letters[v % 62];
-      v /= 62;
-      XXXXXX[3] = letters[v % 62];
-      v /= 62;
-      XXXXXX[4] = letters[v % 62];
-      v /= 62;
-      XXXXXX[5] = letters[v % 62];
+      for (size_t i = 0; i < x_suffix_len; i++)
+        {
+          if (vdigits == 0)
+            {
+              do
+                {
+                  v = random_bits (v, use_getrandom);
+                  use_getrandom = true;
+                }
+              while (unfair_min <= v);
+
+              vdigits = BASE_62_DIGITS;
+            }
+
+          XXXXXX[i] = letters[v % 62];
+          v /= 62;
+          vdigits--;
+        }
 
       fd = tryfunc (tmpl, args);
       if (fd >= 0)
@@ -259,66 +329,17 @@ __try_tempname (char *tmpl, int suffixlen, void *args,
   return -1;
 }
 
-static int
-try_file (char *tmpl, void *flags)
-{
-  int *openflags = flags;
-  return __open (tmpl,
-                 (*openflags & ~O_ACCMODE)
-                 | O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR);
-}
-
-static int
-try_dir (char *tmpl, void *flags _GL_UNUSED)
-{
-  return __mkdir (tmpl, S_IRUSR | S_IWUSR | S_IXUSR);
-}
-
-static int
-try_nocreate (char *tmpl, void *flags _GL_UNUSED)
+int
+__gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
 {
-  struct_stat64 st;
-
-  if (__lxstat64 (_STAT_VER, tmpl, &st) == 0)
-    __set_errno (EEXIST);
-  return errno == ENOENT ? 0 : -1;
+  return gen_tempname_len (tmpl, suffixlen, flags, kind, 6);
 }
 
-/* Generate a temporary file name based on TMPL.  TMPL must match the
-   rules for mk[s]temp (i.e. end in "XXXXXX", possibly with a suffix).
-   The name constructed does not exist at the time of the call to
-   __gen_tempname.  TMPL is overwritten with the result.
-
-   KIND may be one of:
-   __GT_NOCREATE:       simply verify that the name does not exist
-                        at the time of the call.
-   __GT_FILE:           create the file using open(O_CREAT|O_EXCL)
-                        and return a read-write fd.  The file is mode 0600.
-   __GT_DIR:            create a directory, which will be mode 0700.
-
-   We use a clever algorithm to get hard-to-predict names. */
+#if !_LIBC
 int
-__gen_tempname (char *tmpl, int suffixlen, int flags, int kind)
+try_tempname (char *tmpl, int suffixlen, void *args,
+              int (*tryfunc) (char *, void *))
 {
-  int (*tryfunc) (char *, void *);
-
-  switch (kind)
-    {
-    case __GT_FILE:
-      tryfunc = try_file;
-      break;
-
-    case __GT_DIR:
-      tryfunc = try_dir;
-      break;
-
-    case __GT_NOCREATE:
-      tryfunc = try_nocreate;
-      break;
-
-    default:
-      assert (! "invalid KIND in __gen_tempname");
-      abort ();
-    }
-  return __try_tempname (tmpl, suffixlen, &flags, tryfunc);
+  return try_tempname_len (tmpl, suffixlen, args, tryfunc, 6);
 }
+#endif
index be01c51..a8681fc 100644 (file)
@@ -1,6 +1,6 @@
 /* Create a temporary file or directory.
 
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* header written by Eric Blake */
 
@@ -50,6 +50,9 @@ extern "C" {
 
    We use a clever algorithm to get hard-to-predict names. */
 extern int gen_tempname (char *tmpl, int suffixlen, int flags, int kind);
+/* Similar, except X_SUFFIX_LEN gives the number of Xs.  */
+extern int gen_tempname_len (char *tmpl, int suffixlen, int flags, int kind,
+                             size_t x_suffix_len);
 
 /* Similar to gen_tempname, but TRYFUNC is called for each temporary
    name to try.  If TRYFUNC returns a non-negative number, TRY_GEN_TEMPNAME
@@ -57,6 +60,10 @@ extern int gen_tempname (char *tmpl, int suffixlen, int flags, int kind);
    name is tried, or else TRY_GEN_TEMPNAME returns -1. */
 extern int try_tempname (char *tmpl, int suffixlen, void *args,
                          int (*tryfunc) (char *, void *));
+/* Similar, except X_SUFFIX_LEN gives the number of Xs.  */
+extern int try_tempname_len (char *tmpl, int suffixlen, void *args,
+                             int (*tryfunc) (char *, void *),
+                             size_t x_suffix_len);
 
 #ifdef __cplusplus
 }
diff --git a/lib/thread-optim.h b/lib/thread-optim.h
new file mode 100644 (file)
index 0000000..63915f9
--- /dev/null
@@ -0,0 +1,60 @@
+/* Optimization of multithreaded code.
+
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+#ifndef _THREAD_OPTIM_H
+#define _THREAD_OPTIM_H
+
+/* This file defines a way to optimize multithreaded code for the single-thread
+   case, based on the variable '__libc_single_threaded', defined in
+   glibc >= 2.32.  */
+
+/* Typical use: In a block or function, use
+
+     bool mt = gl_multithreaded ();
+     ...
+     if (mt)
+       if (pthread_mutex_lock (&lock)) abort ();
+     ...
+     if (mt)
+       if (pthread_mutex_unlock (&lock)) abort ();
+
+   The gl_multithreaded () invocation determines whether the program currently
+   is multithreaded.
+
+   if (mt) STATEMENT executes STATEMENT in the multithreaded case, and skips
+   it in the single-threaded case.
+
+   The code between the gl_multithreaded () invocation and any use of the
+   variable 'mt' must not create threads or invoke functions that may
+   indirectly create threads (e.g. 'dlopen' may, indirectly through C++
+   initializers of global variables in the shared library being opened,
+   create threads).
+
+   The lock here is meant to synchronize threads in the same process.  The
+   same optimization cannot be applied to locks that synchronize different
+   processes (e.g. through shared memory mappings).  */
+
+#if HAVE_SYS_SINGLE_THREADED_H /* glibc >= 2.32 */
+# include <sys/single_threaded.h>
+# define gl_multithreaded()  !__libc_single_threaded
+#else
+# define gl_multithreaded()  1
+#endif
+
+#endif /* _THREAD_OPTIM_H */
index 865c114..8d27ef4 100644 (file)
@@ -1,6 +1,6 @@
 /* A more-standard <time.h>.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #if __GNUC__ >= 3
 @PRAGMA_SYSTEM_HEADER@
 
 # define _@GUARD_PREFIX@_TIME_H
 
+/* mingw's <time.h> provides the functions asctime_r, ctime_r, gmtime_r,
+   localtime_r only if <unistd.h> or <pthread.h> has been included before.  */
+# if defined __MINGW32__
+#  include <unistd.h>
+# endif
+
 # @INCLUDE_NEXT@ @NEXT_TIME_H@
 
 /* NetBSD 5.0 mis-defines NULL.  */
@@ -48,7 +54,7 @@
 
 /* The definition of _GL_WARN_ON_USE is copied here.  */
 
-/* Some systems don't define struct timespec (e.g., AIX 4.1, Ultrix 4.3).
+/* Some systems don't define struct timespec (e.g., AIX 4.1).
    Or they define it with the wrong member names or define it in <sys/time.h>
    (e.g., FreeBSD circa 1997).  Stock Mingw prior to 3.0 does not define it,
    but the pthreads-win32 library defines it in <pthread.h>.  */
@@ -84,8 +90,8 @@ struct timespec
 # endif
 
 # if !GNULIB_defined_struct_time_t_must_be_integral
-/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires
-   time_t to be an integer type, even though C99 permits floating
+/* https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html
+   requires time_t to be an integer type, even though C99 permits floating
    point.  We don't know of any implementation that uses floating
    point, and it is much easier to write code that doesn't have to
    worry about that corner case, so we force the issue.  */
@@ -95,9 +101,28 @@ struct __time_t_must_be_integral {
 #  define GNULIB_defined_struct_time_t_must_be_integral 1
 # endif
 
+/* Define TIME_UTC, a positive integer constant used for timespec_get().  */
+# if ! @TIME_H_DEFINES_TIME_UTC@
+#  if !GNULIB_defined_TIME_UTC
+#   define TIME_UTC 1
+#   define GNULIB_defined_TIME_UTC 1
+#  endif
+# endif
+
+/* Set *TS to the current time, and return BASE.
+   Upon failure, return 0.  */
+# if @GNULIB_TIMESPEC_GET@
+#  if ! @HAVE_TIMESPEC_GET@
+_GL_FUNCDECL_SYS (timespec_get, int, (struct timespec *ts, int base)
+                                     _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (timespec_get, int, (struct timespec *ts, int base));
+_GL_CXXALIASWARN (timespec_get);
+# endif
+
 /* Sleep for at least RQTP seconds unless interrupted,  If interrupted,
    return -1 and store the remaining time into RMTP.  See
-   <http://www.opengroup.org/susv3xsh/nanosleep.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/nanosleep.html>.  */
 # if @GNULIB_NANOSLEEP@
 #  if @REPLACE_NANOSLEEP@
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -120,6 +145,41 @@ _GL_CXXALIAS_SYS (nanosleep, int,
 _GL_CXXALIASWARN (nanosleep);
 # endif
 
+/* Initialize time conversion information.  */
+# if @GNULIB_TZSET@
+#  if @REPLACE_TZSET@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef tzset
+#    define tzset rpl_tzset
+#   endif
+_GL_FUNCDECL_RPL (tzset, void, (void));
+_GL_CXXALIAS_RPL (tzset, void, (void));
+#  elif defined _WIN32 && !defined __CYGWIN__
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef tzset
+#    define tzset _tzset
+#   endif
+_GL_CXXALIAS_MDA (tzset, void, (void));
+#  else
+_GL_CXXALIAS_SYS (tzset, void, (void));
+#  endif
+_GL_CXXALIASWARN (tzset);
+# elif @GNULIB_MDA_TZSET@
+/* On native Windows, map 'tzset' to '_tzset', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::tzset always.  */
+#  if defined _WIN32 && !defined __CYGWIN__
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef tzset
+#    define tzset _tzset
+#   endif
+_GL_CXXALIAS_MDA (tzset, void, (void));
+#  else
+_GL_CXXALIAS_SYS (tzset, void, (void));
+#  endif
+_GL_CXXALIASWARN (tzset);
+# endif
+
 /* Return the 'time_t' representation of TP and normalize TP.  */
 # if @GNULIB_MKTIME@
 #  if @REPLACE_MKTIME@
@@ -131,12 +191,14 @@ _GL_CXXALIAS_RPL (mktime, time_t, (struct tm *__tp));
 #  else
 _GL_CXXALIAS_SYS (mktime, time_t, (struct tm *__tp));
 #  endif
+#  if __GLIBC__ >= 2
 _GL_CXXALIASWARN (mktime);
+#  endif
 # endif
 
 /* Convert TIMER to RESULT, assuming local time and UTC respectively.  See
-   <http://www.opengroup.org/susv3xsh/localtime_r.html> and
-   <http://www.opengroup.org/susv3xsh/gmtime_r.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/localtime_r.html> and
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gmtime_r.html>.  */
 # if @GNULIB_TIME_R@
 #  if @REPLACE_LOCALTIME_R@
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -185,24 +247,26 @@ _GL_CXXALIASWARN (gmtime_r);
 # endif
 
 /* Convert TIMER to RESULT, assuming local time and UTC respectively.  See
-   <http://www.opengroup.org/susv3xsh/localtime.html> and
-   <http://www.opengroup.org/susv3xsh/gmtime.html>.  */
-# if @GNULIB_GETTIMEOFDAY@
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/localtime.html> and
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/gmtime.html>.  */
+# if @GNULIB_LOCALTIME@ || @REPLACE_LOCALTIME@
 #  if @REPLACE_LOCALTIME@
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #    undef localtime
 #    define localtime rpl_localtime
 #   endif
 _GL_FUNCDECL_RPL (localtime, struct tm *, (time_t const *__timer)
-                                         _GL_ARG_NONNULL ((1)));
+                                          _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (localtime, struct tm *, (time_t const *__timer));
 #  else
 _GL_CXXALIAS_SYS (localtime, struct tm *, (time_t const *__timer));
 #  endif
+#  if __GLIBC__ >= 2
 _GL_CXXALIASWARN (localtime);
+#  endif
 # endif
 
-# if @GNULIB_GETTIMEOFDAY@
+# if 0 || @REPLACE_GMTIME@
 #  if @REPLACE_GMTIME@
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #    undef gmtime
@@ -217,9 +281,9 @@ _GL_CXXALIAS_SYS (gmtime, struct tm *, (time_t const *__timer));
 _GL_CXXALIASWARN (gmtime);
 # endif
 
-/* Parse BUF as a time stamp, assuming FORMAT specifies its layout, and store
+/* Parse BUF as a timestamp, assuming FORMAT specifies its layout, and store
    the resulting broken-down time into TM.  See
-   <http://www.opengroup.org/susv3xsh/strptime.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/strptime.html>.  */
 # if @GNULIB_STRPTIME@
 #  if ! @HAVE_STRPTIME@
 _GL_FUNCDECL_SYS (strptime, char *, (char const *restrict __buf,
@@ -233,23 +297,103 @@ _GL_CXXALIAS_SYS (strptime, char *, (char const *restrict __buf,
 _GL_CXXALIASWARN (strptime);
 # endif
 
+/* Convert *TP to a date and time string.  See
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ctime.html>.  */
+# if @GNULIB_CTIME@
+#  if @REPLACE_CTIME@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define ctime rpl_ctime
+#   endif
+_GL_FUNCDECL_RPL (ctime, char *, (time_t const *__tp)
+                                 _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (ctime, char *, (time_t const *__tp));
+#  else
+_GL_CXXALIAS_SYS (ctime, char *, (time_t const *__tp));
+#  endif
+#  if __GLIBC__ >= 2
+_GL_CXXALIASWARN (ctime);
+#  endif
+# endif
+
+/* Convert *TP to a date and time string.  See
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html>.  */
+# if @GNULIB_STRFTIME@
+#  if @REPLACE_STRFTIME@
+#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    define strftime rpl_strftime
+#   endif
+_GL_FUNCDECL_RPL (strftime, size_t,
+                  (char *restrict __buf, size_t __bufsize,
+                   const char *restrict __fmt, const struct tm *restrict __tp)
+                  _GL_ARG_NONNULL ((1, 3, 4)));
+_GL_CXXALIAS_RPL (strftime, size_t,
+                  (char *restrict __buf, size_t __bufsize,
+                   const char *restrict __fmt, const struct tm *restrict __tp));
+#  else
+_GL_CXXALIAS_SYS (strftime, size_t,
+                  (char *restrict __buf, size_t __bufsize,
+                   const char *restrict __fmt, const struct tm *restrict __tp));
+#  endif
+#  if __GLIBC__ >= 2
+_GL_CXXALIASWARN (strftime);
+#  endif
+# endif
+
 # if defined _GNU_SOURCE && @GNULIB_TIME_RZ@ && ! @HAVE_TIMEZONE_T@
+/* Functions that use a first-class time zone data type, instead of
+   relying on an implicit global time zone.
+   Inspired by NetBSD.  */
+
+/* Represents a time zone.
+   (timezone_t) NULL stands for UTC.  */
 typedef struct tm_zone *timezone_t;
+
+/* tzalloc (name)
+   Returns a time zone object for the given time zone NAME.  This object
+   represents the time zone that other functions would use it the TZ
+   environment variable was set to NAME.
+   If NAME is NULL, the result represents the time zone that other functions
+   would use it the TZ environment variable was unset.
+   May return NULL if NAME is invalid (this is platform dependent) or
+   upon memory allocation failure.  */
 _GL_FUNCDECL_SYS (tzalloc, timezone_t, (char const *__name));
 _GL_CXXALIAS_SYS (tzalloc, timezone_t, (char const *__name));
+
+/* tzfree (tz)
+   Frees a time zone object.
+   The argument must have been returned by tzalloc().  */
 _GL_FUNCDECL_SYS (tzfree, void, (timezone_t __tz));
 _GL_CXXALIAS_SYS (tzfree, void, (timezone_t __tz));
+
+/* localtime_rz (tz, &t, &result)
+   Converts an absolute time T to a broken-down time RESULT, assuming the
+   time zone TZ.
+   This function is like 'localtime_r', but relies on the argument TZ instead
+   of an implicit global time zone.  */
 _GL_FUNCDECL_SYS (localtime_rz, struct tm *,
                   (timezone_t __tz, time_t const *restrict __timer,
                    struct tm *restrict __result) _GL_ARG_NONNULL ((2, 3)));
 _GL_CXXALIAS_SYS (localtime_rz, struct tm *,
                   (timezone_t __tz, time_t const *restrict __timer,
                    struct tm *restrict __result));
+
+/* mktime_z (tz, &tm)
+   Normalizes the broken-down time TM and converts it to an absolute time,
+   assuming the time zone TZ.  Returns the absolute time.
+   This function is like 'mktime', but relies on the argument TZ instead
+   of an implicit global time zone.  */
 _GL_FUNCDECL_SYS (mktime_z, time_t,
-                  (timezone_t __tz, struct tm *restrict __result)
+                  (timezone_t __tz, struct tm *restrict __tm)
                   _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_SYS (mktime_z, time_t,
-                  (timezone_t __tz, struct tm *restrict __result));
+                  (timezone_t __tz, struct tm *restrict __tm));
+
+/* Time zone abbreviation strings (returned by 'localtime_rz' or 'mktime_z'
+   in the 'tm_zone' member of 'struct tm') are valid as long as
+     - the 'struct tm' argument is not destroyed or overwritten,
+   and
+     - the 'timezone_t' argument is not freed through tzfree().  */
+
 # endif
 
 /* Convert TM to a time_t value, assuming UTC.  */
@@ -280,17 +424,17 @@ _GL_WARN_ON_USE (asctime, "asctime can overrun buffers in some cases - "
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef asctime_r
-_GL_WARN_ON_USE (asctime, "asctime_r can overrun buffers in some cases - "
+_GL_WARN_ON_USE (asctime_r, "asctime_r can overrun buffers in some cases - "
                  "better use strftime (or even sprintf) instead");
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef ctime
-_GL_WARN_ON_USE (asctime, "ctime can overrun buffers in some cases - "
+_GL_WARN_ON_USE (ctime, "ctime can overrun buffers in some cases - "
                  "better use strftime (or even sprintf) instead");
 # endif
 # if defined GNULIB_POSIXCHECK
 #  undef ctime_r
-_GL_WARN_ON_USE (asctime, "ctime_r can overrun buffers in some cases - "
+_GL_WARN_ON_USE (ctime_r, "ctime_r can overrun buffers in some cases - "
                  "better use strftime (or even sprintf) instead");
 # endif
 
index 1cc01fb..637c267 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2001-2002, 2006, 2009-2016 Free Software Foundation,
+/* Copyright (C) 1999, 2001-2002, 2006, 2009-2021 Free Software Foundation,
    Inc.
    This file is part of the GNU C Library.
 
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Extracted from sysdeps/posix/tempname.c.  */
 
 
 #include <sys/stat.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 #endif
 
 #include "pathmax.h"
 
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Don't assume that UNICODE is not defined.  */
+# undef GetTempPath
+# define GetTempPath GetTempPathA
+#endif
+
 #if _LIBC
 # define struct_stat64 struct stat64
 #else
@@ -60,7 +66,7 @@
 /* Pathname support.
    ISSLASH(C)           tests whether C is a directory separator character.
  */
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
   /* Native Windows, Cygwin, OS/2, DOS */
 # define ISSLASH(C) ((C) == '/' || (C) == '\\')
 #else
@@ -115,7 +121,7 @@ path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
     }
   if (dir == NULL)
     {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
       char dirbuf[PATH_MAX];
       DWORD retval;
 
index ef615fc..c0fbb91 100644 (file)
@@ -1,5 +1,5 @@
 /* Determine a temporary directory.
-   Copyright (C) 2001-2002, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <stdbool.h>
 #include <stddef.h>
diff --git a/lib/trim.c b/lib/trim.c
new file mode 100644 (file)
index 0000000..30e7d5b
--- /dev/null
@@ -0,0 +1,129 @@
+/* Removes leading and/or trailing whitespaces
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Davide Angelocola <davide.angelocola@gmail.com> */
+
+#include <config.h>
+
+/* Specification.  */
+#include "trim.h"
+
+#include <ctype.h>
+#include <string.h>
+#include <stddef.h>
+#include <stdlib.h>
+
+#include "mbchar.h"
+#include "mbiter.h"
+#include "xalloc.h"
+
+/* Use this to suppress gcc's "...may be used before initialized" warnings. */
+#if defined GCC_LINT || defined lint
+# define IF_LINT(Code) Code
+#else
+# define IF_LINT(Code) /* empty */
+#endif
+
+char *
+trim2 (const char *s, int how)
+{
+  char *d;
+
+  d = strdup (s);
+
+  if (!d)
+    xalloc_die ();
+
+  if (MB_CUR_MAX > 1)
+    {
+      mbi_iterator_t i;
+
+      /* Trim leading whitespaces. */
+      if (how != TRIM_TRAILING)
+        {
+          mbi_init (i, d, strlen (d));
+
+          for (; mbi_avail (i) && mb_isspace (mbi_cur (i)); mbi_advance (i))
+            ;
+
+          memmove (d, mbi_cur_ptr (i), strlen (mbi_cur_ptr (i)) + 1);
+        }
+
+      /* Trim trailing whitespaces. */
+      if (how != TRIM_LEADING)
+        {
+          unsigned int state = 0;
+          char *r IF_LINT (= NULL); /* used only while state = 2 */
+
+          mbi_init (i, d, strlen (d));
+
+          for (; mbi_avail (i); mbi_advance (i))
+            {
+              if (state == 0 && mb_isspace (mbi_cur (i)))
+                continue;
+
+              if (state == 0 && !mb_isspace (mbi_cur (i)))
+                {
+                  state = 1;
+                  continue;
+                }
+
+              if (state == 1 && !mb_isspace (mbi_cur (i)))
+                continue;
+
+              if (state == 1 && mb_isspace (mbi_cur (i)))
+                {
+                  state = 2;
+                  r = (char *) mbi_cur_ptr (i);
+                }
+              else if (state == 2 && mb_isspace (mbi_cur (i)))
+                {
+                  /* empty */
+                }
+              else
+                {
+                  state = 1;
+                }
+            }
+
+          if (state == 2)
+            *r = '\0';
+        }
+    }
+  else
+    {
+      char *p;
+
+      /* Trim leading whitespaces. */
+      if (how != TRIM_TRAILING)
+        {
+          for (p = d; *p && isspace ((unsigned char) *p); p++)
+            ;
+
+          memmove (d, p, strlen (p) + 1);
+        }
+
+      /* Trim trailing whitespaces. */
+      if (how != TRIM_LEADING)
+        {
+          for (p = d + strlen (d) - 1;
+               p >= d && isspace ((unsigned char) *p); p--)
+            *p = '\0';
+        }
+    }
+
+  return d;
+}
diff --git a/lib/trim.h b/lib/trim.h
new file mode 100644 (file)
index 0000000..dc886e5
--- /dev/null
@@ -0,0 +1,33 @@
+/* Removes leading and/or trailing whitespaces
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Davide Angelocola <davide.angelocola@gmail.com> */
+
+/* Trim mode. */
+#define TRIM_TRAILING 0
+#define TRIM_LEADING 1
+#define TRIM_BOTH 2
+
+/* Removes trailing and leading whitespaces. */
+#define trim(s) trim2(s, TRIM_BOTH)
+
+/* Removes trailing whitespaces. */
+#define trim_trailing(s) trim2(s, TRIM_TRAILING)
+
+/* Removes leading whitespaces. */
+#define trim_leading(s) trim2(s, TRIM_LEADING)
+
+char *trim2 (const char *, int);
index bd1d0fb..5e6ecb0 100644 (file)
@@ -1,6 +1,6 @@
 /* Like unistd.h, but redefine some names to avoid glitches.
 
-   Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
index c8179ce..541bafe 100644 (file)
@@ -1,6 +1,6 @@
 /* Invoke unistd-like functions, but avoid some glitches.
 
-   Copyright (C) 2001, 2003, 2005, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001, 2003, 2005, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert and Eric Blake.  */
 
index 3aa0b03..5e9b47d 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitute for and wrapper around <unistd.h>.
-   Copyright (C) 2003-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _@GUARD_PREFIX@_UNISTD_H
 
@@ -21,7 +21,7 @@
 #endif
 @PRAGMA_COLUMNS@
 
-#ifdef _GL_INCLUDING_UNISTD_H
+#if @HAVE_UNISTD_H@ && defined _GL_INCLUDING_UNISTD_H
 /* Special invocation convention:
    - On Mac OS X 10.3.9 we have a sequence of nested includes
      <unistd.h> -> <signal.h> -> <pthread.h> -> <unistd.h>
 #define _@GUARD_PREFIX@_UNISTD_H
 
 /* NetBSD 5.0 mis-defines NULL.  Also get size_t.  */
-#include <stddef.h>
+/* But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <stddef.h>
+#endif
 
 /* mingw doesn't define the SEEK_* or *_FILENO macros in <unistd.h>.  */
 /* MSVC declares 'unlink' in <stdio.h>, not in <unistd.h>.  We must include
 /* But avoid namespace pollution on glibc systems.  */
 #if (!(defined SEEK_CUR && defined SEEK_END && defined SEEK_SET) \
      || ((@GNULIB_UNLINK@ || defined GNULIB_POSIXCHECK) \
-         && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)) \
+         && (defined _WIN32 && ! defined __CYGWIN__)) \
      || ((@GNULIB_SYMLINKAT@ || defined GNULIB_POSIXCHECK) \
          && defined __CYGWIN__)) \
     && ! defined __GLIBC__
 # include <stdio.h>
 #endif
 
-/* Cygwin 1.7.1 declares unlinkat in <fcntl.h>, not in <unistd.h>.  */
+/* Cygwin 1.7.1 and Android 4.3 declare unlinkat in <fcntl.h>, not in
+   <unistd.h>.  */
 /* But avoid namespace pollution on glibc systems.  */
-#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) && defined __CYGWIN__ \
+#if (@GNULIB_UNLINKAT@ || defined GNULIB_POSIXCHECK) \
+    && (defined __CYGWIN__ || defined __ANDROID__) \
     && ! defined __GLIBC__
 # include <fcntl.h>
 #endif
 # undef __need_system_stdlib_h
 #endif
 
-/* Native Windows platforms declare chdir, getcwd, rmdir in
+/* Native Windows platforms declare _chdir, _getcwd, _rmdir in
    <io.h> and/or <direct.h>, not in <unistd.h>.
-   They also declare access(), chmod(), close(), dup(), dup2(), isatty(),
-   lseek(), read(), unlink(), write() in <io.h>.  */
-#if ((@GNULIB_CHDIR@ || @GNULIB_GETCWD@ || @GNULIB_RMDIR@ \
-      || defined GNULIB_POSIXCHECK) \
-     && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
-# include <io.h>     /* mingw32, mingw64 */
-# include <direct.h> /* mingw64, MSVC 9 */
-#elif (@GNULIB_CLOSE@ || @GNULIB_DUP@ || @GNULIB_DUP2@ || @GNULIB_ISATTY@ \
-       || @GNULIB_LSEEK@ || @GNULIB_READ@ || @GNULIB_UNLINK@ || @GNULIB_WRITE@ \
-       || defined GNULIB_POSIXCHECK) \
-      && ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+   They also declare _access(), _chmod(), _close(), _dup(), _dup2(), _isatty(),
+   _lseek(), _read(), _unlink(), _write() in <io.h>.  */
+#if defined _WIN32 && !defined __CYGWIN__
 # include <io.h>
+# include <direct.h>
+#endif
+
+/* Native Windows platforms declare _execl*, _execv* in <process.h>.  */
+#if defined _WIN32 && !defined __CYGWIN__
+# include <process.h>
 #endif
 
 /* AIX and OSF/1 5.1 declare getdomainname in <netdb.h>, not in <unistd.h>.
 # include <netdb.h>
 #endif
 
-/* MSVC defines off_t in <sys/types.h>.
-   May also define off_t to a 64-bit type on native Windows.  */
-#if !@HAVE_UNISTD_H@ || @WINDOWS_64_BIT_OFF_T@
-/* Get off_t.  */
-# include <sys/types.h>
+/* Mac OS X 10.13, Solaris 11.4, and Android 9.0 declare getentropy in
+   <sys/random.h>, not in <unistd.h>.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_GETENTROPY@ || defined GNULIB_POSIXCHECK) \
+    && ((defined __APPLE__ && defined __MACH__) || defined __sun \
+        || defined __ANDROID__) \
+    && @UNISTD_H_HAVE_SYS_RANDOM_H@ \
+    && !defined __GLIBC__
+# include <sys/random.h>
 #endif
 
-#if (@GNULIB_READ@ || @GNULIB_WRITE@ \
-     || @GNULIB_READLINK@ || @GNULIB_READLINKAT@ \
-     || @GNULIB_PREAD@ || @GNULIB_PWRITE@ || defined GNULIB_POSIXCHECK)
-/* Get ssize_t.  */
-# include <sys/types.h>
+/* Android 4.3 declares fchownat in <sys/stat.h>, not in <unistd.h>.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if (@GNULIB_FCHOWNAT@ || defined GNULIB_POSIXCHECK) && defined __ANDROID__ \
+    && !defined __GLIBC__
+# include <sys/stat.h>
 #endif
 
-/* Get getopt(), optarg, optind, opterr, optopt.
-   But avoid namespace pollution on glibc systems.  */
-#if @GNULIB_UNISTD_H_GETOPT@ && !defined __GLIBC__ && !defined _GL_SYSTEM_GETOPT
-# define __need_getopt
-# include <getopt.h>
+/* MSVC defines off_t in <sys/types.h>.
+   May also define off_t to a 64-bit type on native Windows.  */
+/* Get off_t, ssize_t, mode_t.  */
+#include <sys/types.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
+/* Get getopt(), optarg, optind, opterr, optopt.  */
+#if @GNULIB_GETOPT_POSIX@ && @GNULIB_UNISTD_H_GETOPT@ && !defined _GL_SYSTEM_GETOPT
+# include <getopt-cdefs.h>
+# include <getopt-pfx-core.h>
 #endif
 
 #ifndef _GL_INLINE_HEADER_BEGIN
@@ -142,13 +160,6 @@ _GL_INLINE_HEADER_BEGIN
 # define _GL_UNISTD_INLINE _GL_INLINE
 #endif
 
-/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
-
-/* The definition of _GL_ARG_NONNULL is copied here.  */
-
-/* The definition of _GL_WARN_ON_USE is copied here.  */
-
-
 /* Hide some function declarations from <winsock2.h>.  */
 
 #if @GNULIB_GETHOSTNAME@ && @UNISTD_H_HAVE_WINSOCK2_H@
@@ -248,15 +259,61 @@ _GL_INLINE_HEADER_BEGIN
 /* Declare overridden functions.  */
 
 
-#if defined GNULIB_POSIXCHECK
+#if @GNULIB_ACCESS@
+# if @REPLACE_ACCESS@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef access
+#   define access rpl_access
+#  endif
+_GL_FUNCDECL_RPL (access, int, (const char *file, int mode)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (access, int, (const char *file, int mode));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef access
+#   define access _access
+#  endif
+_GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
+# else
+_GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
+# endif
+_GL_CXXALIASWARN (access);
+#elif defined GNULIB_POSIXCHECK
+# undef access
+# if HAVE_RAW_DECL_ACCESS
 /* The access() function is a security risk.  */
-_GL_WARN_ON_USE (access, "the access function is a security risk - "
+_GL_WARN_ON_USE (access, "access does not always support X_OK - "
+                 "use gnulib module access for portability; "
+                 "also, this function is a security risk - "
                  "use the gnulib module faccessat instead");
+# endif
+#elif @GNULIB_MDA_ACCESS@
+/* On native Windows, map 'access' to '_access', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::access always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef access
+#   define access _access
+#  endif
+_GL_CXXALIAS_MDA (access, int, (const char *file, int mode));
+# else
+_GL_CXXALIAS_SYS (access, int, (const char *file, int mode));
+# endif
+_GL_CXXALIASWARN (access);
 #endif
 
 
 #if @GNULIB_CHDIR@
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef chdir
+#   define chdir _chdir
+#  endif
+_GL_CXXALIAS_MDA (chdir, int, (const char *file));
+# else
 _GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
+# endif
 _GL_CXXALIASWARN (chdir);
 #elif defined GNULIB_POSIXCHECK
 # undef chdir
@@ -264,6 +321,20 @@ _GL_CXXALIASWARN (chdir);
 _GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
                  "use gnulib module chdir for portability");
 # endif
+#elif @GNULIB_MDA_CHDIR@
+/* On native Windows, map 'chdir' to '_chdir', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::chdir always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef chdir
+#   define chdir _chdir
+#  endif
+_GL_CXXALIAS_MDA (chdir, int, (const char *file));
+# else
+_GL_CXXALIAS_SYS (chdir, int, (const char *file) _GL_ARG_NONNULL ((1)));
+# endif
+_GL_CXXALIASWARN (chdir);
 #endif
 
 
@@ -272,7 +343,7 @@ _GL_WARN_ON_USE (chown, "chdir is not always in <unistd.h> - "
    to GID (if GID is not -1).  Follow symbolic links.
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html.  */
 # if @REPLACE_CHOWN@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef chown
@@ -308,6 +379,12 @@ _GL_WARN_ON_USE (chown, "chown fails to follow symlinks on some systems and "
 #  endif
 _GL_FUNCDECL_RPL (close, int, (int fd));
 _GL_CXXALIAS_RPL (close, int, (int fd));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef close
+#   define close _close
+#  endif
+_GL_CXXALIAS_MDA (close, int, (int fd));
 # else
 _GL_CXXALIAS_SYS (close, int, (int fd));
 # endif
@@ -320,6 +397,39 @@ _GL_CXXALIASWARN (close);
 /* Assume close is always declared.  */
 _GL_WARN_ON_USE (close, "close does not portably work on sockets - "
                  "use gnulib module close for portability");
+#elif @GNULIB_MDA_CLOSE@
+/* On native Windows, map 'close' to '_close', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::close always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef close
+#   define close _close
+#  endif
+_GL_CXXALIAS_MDA (close, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (close, int, (int fd));
+# endif
+_GL_CXXALIASWARN (close);
+#endif
+
+
+#if @GNULIB_COPY_FILE_RANGE@
+# if !@HAVE_COPY_FILE_RANGE@
+_GL_FUNCDECL_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
+                                             int ofd, off_t *opos,
+                                             size_t len, unsigned flags));
+_GL_CXXALIAS_SYS (copy_file_range, ssize_t, (int ifd, off_t *ipos,
+                                             int ofd, off_t *opos,
+                                             size_t len, unsigned flags));
+# endif
+_GL_CXXALIASWARN (copy_file_range);
+#elif defined GNULIB_POSIXCHECK
+# if HAVE_RAW_DECL_COPY_FILE_RANGE
+_GL_WARN_ON_USE (copy_file_range,
+                 "copy_file_range is unportable - "
+                 "use gnulib module copy_file_range for portability");
+# endif
 #endif
 
 
@@ -330,6 +440,12 @@ _GL_WARN_ON_USE (close, "close does not portably work on sockets - "
 #  endif
 _GL_FUNCDECL_RPL (dup, int, (int oldfd));
 _GL_CXXALIAS_RPL (dup, int, (int oldfd));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef dup
+#   define dup _dup
+#  endif
+_GL_CXXALIAS_MDA (dup, int, (int oldfd));
 # else
 _GL_CXXALIAS_SYS (dup, int, (int oldfd));
 # endif
@@ -340,6 +456,20 @@ _GL_CXXALIASWARN (dup);
 _GL_WARN_ON_USE (dup, "dup is unportable - "
                  "use gnulib module dup for portability");
 # endif
+#elif @GNULIB_MDA_DUP@
+/* On native Windows, map 'dup' to '_dup', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::dup always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef dup
+#   define dup _dup
+#  endif
+_GL_CXXALIAS_MDA (dup, int, (int oldfd));
+# else
+_GL_CXXALIAS_SYS (dup, int, (int oldfd));
+# endif
+_GL_CXXALIASWARN (dup);
 #endif
 
 
@@ -348,17 +478,20 @@ _GL_WARN_ON_USE (dup, "dup is unportable - "
    NEWFD = OLDFD, otherwise close NEWFD first if it is open.
    Return newfd if successful, otherwise -1 and errno set.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/dup2.html>.  */
 # if @REPLACE_DUP2@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define dup2 rpl_dup2
 #  endif
 _GL_FUNCDECL_RPL (dup2, int, (int oldfd, int newfd));
 _GL_CXXALIAS_RPL (dup2, int, (int oldfd, int newfd));
-# else
-#  if !@HAVE_DUP2@
-_GL_FUNCDECL_SYS (dup2, int, (int oldfd, int newfd));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef dup2
+#   define dup2 _dup2
 #  endif
+_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
+# else
 _GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
 # endif
 _GL_CXXALIASWARN (dup2);
@@ -368,6 +501,20 @@ _GL_CXXALIASWARN (dup2);
 _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
                  "use gnulib module dup2 for portability");
 # endif
+#elif @GNULIB_MDA_DUP2@
+/* On native Windows, map 'dup2' to '_dup2', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::dup2 always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef dup2
+#   define dup2 _dup2
+#  endif
+_GL_CXXALIAS_MDA (dup2, int, (int oldfd, int newfd));
+# else
+_GL_CXXALIAS_SYS (dup2, int, (int oldfd, int newfd));
+# endif
+_GL_CXXALIASWARN (dup2);
 #endif
 
 
@@ -379,7 +526,7 @@ _GL_WARN_ON_USE (dup2, "dup2 is unportable - "
    Close NEWFD first if it is open.
    Return newfd if successful, otherwise -1 and errno set.
    See the Linux man page at
-   <http://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>.  */
+   <https://www.kernel.org/doc/man-pages/online/pages/man2/dup3.2.html>.  */
 # if @HAVE_DUP3@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define dup3 rpl_dup3
@@ -401,6 +548,13 @@ _GL_WARN_ON_USE (dup3, "dup3 is unportable - "
 
 
 #if @GNULIB_ENVIRON@
+# if defined __CYGWIN__ && !defined __i386__
+/* The 'environ' variable is defined in a DLL. Therefore its declaration needs
+   the '__declspec(dllimport)' attribute, but the system's <unistd.h> lacks it.
+   This leads to a link error on 64-bit Cygwin when the option
+   -Wl,--disable-auto-import is in use.  */
+_GL_EXTERN_C __declspec(dllimport) char **environ;
+# endif
 # if !@HAVE_DECL_ENVIRON@
 /* Set of environment variables and values.  An array of strings of the form
    "VARIABLE=VALUE", terminated with a NULL.  */
@@ -426,12 +580,12 @@ extern char **environ;
 #elif defined GNULIB_POSIXCHECK
 # if HAVE_RAW_DECL_ENVIRON
 _GL_UNISTD_INLINE char ***
+_GL_WARN_ON_USE_ATTRIBUTE ("environ is unportable - "
+                           "use gnulib module environ for portability")
 rpl_environ (void)
 {
   return &environ;
 }
-_GL_WARN_ON_USE (rpl_environ, "environ is unportable - "
-                 "use gnulib module environ for portability");
 #  undef environ
 #  define environ (*rpl_environ ())
 # endif
@@ -461,14 +615,302 @@ _GL_WARN_ON_USE (euidaccess, "euidaccess is unportable - "
 #endif
 
 
+#if @GNULIB_EXECL@
+# if @REPLACE_EXECL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execl
+#   define execl rpl_execl
+#  endif
+_GL_FUNCDECL_RPL (execl, int, (const char *program, const char *arg, ...)
+                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execl, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execl);
+#elif defined GNULIB_POSIXCHECK
+# undef execl
+# if HAVE_RAW_DECL_EXECL
+_GL_WARN_ON_USE (execl, "execl behaves very differently on mingw - "
+                 "use gnulib module execl for portability");
+# endif
+#elif @GNULIB_MDA_EXECL@
+/* On native Windows, map 'execl' to '_execl', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execl always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execl
+#   define execl _execl
+#  endif
+_GL_CXXALIAS_MDA (execl, intptr_t, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execl, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execl);
+#endif
+
+#if @GNULIB_EXECLE@
+# if @REPLACE_EXECLE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execle
+#   define execle rpl_execle
+#  endif
+_GL_FUNCDECL_RPL (execle, int, (const char *program, const char *arg, ...)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execle, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execle);
+#elif defined GNULIB_POSIXCHECK
+# undef execle
+# if HAVE_RAW_DECL_EXECLE
+_GL_WARN_ON_USE (execle, "execle behaves very differently on mingw - "
+                 "use gnulib module execle for portability");
+# endif
+#elif @GNULIB_MDA_EXECLE@
+/* On native Windows, map 'execle' to '_execle', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execle always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execle
+#   define execle _execle
+#  endif
+_GL_CXXALIAS_MDA (execle, intptr_t,
+                  (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execle, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execle);
+#endif
+
+#if @GNULIB_EXECLP@
+# if @REPLACE_EXECLP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execlp
+#   define execlp rpl_execlp
+#  endif
+_GL_FUNCDECL_RPL (execlp, int, (const char *program, const char *arg, ...)
+                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (execlp, int, (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execlp);
+#elif defined GNULIB_POSIXCHECK
+# undef execlp
+# if HAVE_RAW_DECL_EXECLP
+_GL_WARN_ON_USE (execlp, "execlp behaves very differently on mingw - "
+                 "use gnulib module execlp for portability");
+# endif
+#elif @GNULIB_MDA_EXECLP@
+/* On native Windows, map 'execlp' to '_execlp', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execlp always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execlp
+#   define execlp _execlp
+#  endif
+_GL_CXXALIAS_MDA (execlp, intptr_t,
+                  (const char *program, const char *arg, ...));
+# else
+_GL_CXXALIAS_SYS (execlp, int, (const char *program, const char *arg, ...));
+# endif
+_GL_CXXALIASWARN (execlp);
+#endif
+
+
+#if @GNULIB_EXECV@
+# if @REPLACE_EXECV@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execv
+#   define execv rpl_execv
+#  endif
+_GL_FUNCDECL_RPL (execv, int, (const char *program, char * const *argv)
+                              _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execv, int, (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execv);
+#elif defined GNULIB_POSIXCHECK
+# undef execv
+# if HAVE_RAW_DECL_EXECV
+_GL_WARN_ON_USE (execv, "execv behaves very differently on mingw - "
+                 "use gnulib module execv for portability");
+# endif
+#elif @GNULIB_MDA_EXECV@
+/* On native Windows, map 'execv' to '_execv', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execv always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execv
+#   define execv _execv
+#  endif
+_GL_CXXALIAS_MDA_CAST (execv, intptr_t,
+                       (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execv, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execv);
+#endif
+
+#if @GNULIB_EXECVE@
+# if @REPLACE_EXECVE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execve
+#   define execve rpl_execve
+#  endif
+_GL_FUNCDECL_RPL (execve, int,
+                  (const char *program, char * const *argv, char * const *env)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execve, int,
+                  (const char *program, char * const *argv, char * const *env));
+# else
+_GL_CXXALIAS_SYS (execve, int,
+                  (const char *program, char * const *argv, char * const *env));
+# endif
+_GL_CXXALIASWARN (execve);
+#elif defined GNULIB_POSIXCHECK
+# undef execve
+# if HAVE_RAW_DECL_EXECVE
+_GL_WARN_ON_USE (execve, "execve behaves very differently on mingw - "
+                 "use gnulib module execve for portability");
+# endif
+#elif @GNULIB_MDA_EXECVE@
+/* On native Windows, map 'execve' to '_execve', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execve always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execve
+#   define execve _execve
+#  endif
+_GL_CXXALIAS_MDA_CAST (execve, intptr_t,
+                       (const char *program, char * const *argv,
+                        char * const *env));
+# else
+_GL_CXXALIAS_SYS (execve, int,
+                  (const char *program, char * const *argv, char * const *env));
+# endif
+_GL_CXXALIASWARN (execve);
+#endif
+
+#if @GNULIB_EXECVP@
+# if @REPLACE_EXECVP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execvp
+#   define execvp rpl_execvp
+#  endif
+_GL_FUNCDECL_RPL (execvp, int, (const char *program, char * const *argv)
+                               _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execvp, int, (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execvp);
+#elif defined GNULIB_POSIXCHECK
+# undef execvp
+# if HAVE_RAW_DECL_EXECVP
+_GL_WARN_ON_USE (execvp, "execvp behaves very differently on mingw - "
+                 "use gnulib module execvp for portability");
+# endif
+#elif @GNULIB_MDA_EXECVP@
+/* On native Windows, map 'execvp' to '_execvp', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execvp always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execvp
+#   define execvp _execvp
+#  endif
+_GL_CXXALIAS_MDA_CAST (execvp, intptr_t,
+                       (const char *program, char * const *argv));
+# else
+_GL_CXXALIAS_SYS (execvp, int, (const char *program, char * const *argv));
+# endif
+_GL_CXXALIASWARN (execvp);
+#endif
+
+#if @GNULIB_EXECVPE@
+# if @REPLACE_EXECVPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execvpe
+#   define execvpe rpl_execvpe
+#  endif
+_GL_FUNCDECL_RPL (execvpe, int,
+                  (const char *program, char * const *argv, char * const *env)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (execvpe, int,
+                  (const char *program, char * const *argv, char * const *env));
+# else
+#  if !@HAVE_DECL_EXECVPE@
+_GL_FUNCDECL_SYS (execvpe, int,
+                  (const char *program, char * const *argv, char * const *env)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (execvpe, int,
+                  (const char *program, char * const *argv, char * const *env));
+# endif
+_GL_CXXALIASWARN (execvpe);
+#elif defined GNULIB_POSIXCHECK
+# undef execvpe
+# if HAVE_RAW_DECL_EXECVPE
+_GL_WARN_ON_USE (execvpe, "execvpe behaves very differently on mingw - "
+                 "use gnulib module execvpe for portability");
+# endif
+#elif @GNULIB_MDA_EXECVPE@
+/* On native Windows, map 'execvpe' to '_execvpe', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::execvpe on all platforms that have
+   it.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef execvpe
+#   define execvpe _execvpe
+#  endif
+_GL_CXXALIAS_MDA_CAST (execvpe, intptr_t,
+                       (const char *program, char * const *argv,
+                        char * const *env));
+# elif @HAVE_EXECVPE@
+#  if !@HAVE_DECL_EXECVPE@
+_GL_FUNCDECL_SYS (execvpe, int,
+                  (const char *program, char * const *argv, char * const *env)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (execvpe, int,
+                  (const char *program, char * const *argv, char * const *env));
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_EXECVPE@
+_GL_CXXALIASWARN (execvpe);
+# endif
+#endif
+
+
 #if @GNULIB_FACCESSAT@
-# if !@HAVE_FACCESSAT@
+# if @REPLACE_FACCESSAT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef faccessat
+#   define faccessat rpl_faccessat
+#  endif
+_GL_FUNCDECL_RPL (faccessat, int,
+                  (int fd, char const *name, int mode, int flag)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (faccessat, int,
+                  (int fd, char const *name, int mode, int flag));
+# else
+#  if !@HAVE_FACCESSAT@
 _GL_FUNCDECL_SYS (faccessat, int,
                   (int fd, char const *file, int mode, int flag)
                   _GL_ARG_NONNULL ((2)));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (faccessat, int,
                   (int fd, char const *file, int mode, int flag));
+# endif
 _GL_CXXALIASWARN (faccessat);
 #elif defined GNULIB_POSIXCHECK
 # undef faccessat
@@ -484,7 +926,7 @@ _GL_WARN_ON_USE (faccessat, "faccessat is not portable - "
    the given file descriptor is open.
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fchdir.html>.  */
 # if ! @HAVE_FCHDIR@
 _GL_FUNCDECL_SYS (fchdir, int, (int /*fd*/));
 
@@ -536,7 +978,7 @@ _GL_CXXALIASWARN (fchownat);
 # undef fchownat
 # if HAVE_RAW_DECL_FCHOWNAT
 _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
-                 "use gnulib module openat for portability");
+                 "use gnulib module fchownat for portability");
 # endif
 #endif
 
@@ -545,7 +987,7 @@ _GL_WARN_ON_USE (fchownat, "fchownat is not portable - "
 /* Synchronize changes to a file.
    Return 0 if successful, otherwise -1 and errno set.
    See POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fdatasync.html>.  */
 # if !@HAVE_FDATASYNC@ || !@HAVE_DECL_FDATASYNC@
 _GL_FUNCDECL_SYS (fdatasync, int, (int fd));
 # endif
@@ -564,7 +1006,7 @@ _GL_WARN_ON_USE (fdatasync, "fdatasync is unportable - "
 /* Synchronize changes, including metadata, to a file.
    Return 0 if successful, otherwise -1 and errno set.
    See POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html>.  */
 # if !@HAVE_FSYNC@
 _GL_FUNCDECL_SYS (fsync, int, (int fd));
 # endif
@@ -583,7 +1025,7 @@ _GL_WARN_ON_USE (fsync, "fsync is unportable - "
 /* Change the size of the file to which FD is opened to become equal to LENGTH.
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/ftruncate.html>.  */
 # if @REPLACE_FTRUNCATE@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef ftruncate
@@ -613,7 +1055,7 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
    Return BUF if successful, or NULL if the directory couldn't be determined
    or SIZE was too small.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getcwd.html>.
    Additionally, the gnulib module 'getcwd' guarantees the following GNU
    extension: If BUF is NULL, an array is allocated with 'malloc'; the array
    is SIZE bytes long, unless SIZE == 0, in which case it is as big as
@@ -624,6 +1066,12 @@ _GL_WARN_ON_USE (ftruncate, "ftruncate is unportable - "
 #  endif
 _GL_FUNCDECL_RPL (getcwd, char *, (char *buf, size_t size));
 _GL_CXXALIAS_RPL (getcwd, char *, (char *buf, size_t size));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getcwd
+#   define getcwd _getcwd
+#  endif
+_GL_CXXALIAS_MDA (getcwd, char *, (char *buf, size_t size));
 # else
 /* Need to cast, because on mingw, the second parameter is
                                                    int size.  */
@@ -636,6 +1084,22 @@ _GL_CXXALIASWARN (getcwd);
 _GL_WARN_ON_USE (getcwd, "getcwd is unportable - "
                  "use gnulib module getcwd for portability");
 # endif
+#elif @GNULIB_MDA_GETCWD@
+/* On native Windows, map 'getcwd' to '_getcwd', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::getcwd always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getcwd
+#   define getcwd _getcwd
+#  endif
+/* Need to cast, because on mingw, the second parameter is either
+   'int size' or 'size_t size'.  */
+_GL_CXXALIAS_MDA_CAST (getcwd, char *, (char *buf, size_t size));
+# else
+_GL_CXXALIAS_SYS_CAST (getcwd, char *, (char *buf, size_t size));
+# endif
+_GL_CXXALIASWARN (getcwd);
 #endif
 
 
@@ -689,7 +1153,9 @@ _GL_CXXALIAS_RPL (getdtablesize, int, (void));
 #  if !@HAVE_GETDTABLESIZE@
 _GL_FUNCDECL_SYS (getdtablesize, int, (void));
 #  endif
-_GL_CXXALIAS_SYS (getdtablesize, int, (void));
+/* Need to cast, because on AIX, the parameter list is
+                                           (...).  */
+_GL_CXXALIAS_SYS_CAST (getdtablesize, int, (void));
 # endif
 _GL_CXXALIASWARN (getdtablesize);
 #elif defined GNULIB_POSIXCHECK
@@ -701,6 +1167,22 @@ _GL_WARN_ON_USE (getdtablesize, "getdtablesize is unportable - "
 #endif
 
 
+#if @GNULIB_GETENTROPY@
+/* Fill a buffer with random bytes.  */
+# if !@HAVE_GETENTROPY@
+_GL_FUNCDECL_SYS (getentropy, int, (void *buffer, size_t length));
+# endif
+_GL_CXXALIAS_SYS (getentropy, int, (void *buffer, size_t length));
+_GL_CXXALIASWARN (getentropy);
+#elif defined GNULIB_POSIXCHECK
+# undef getentropy
+# if HAVE_RAW_DECL_GETENTROPY
+_GL_WARN_ON_USE (getentropy, "getentropy is unportable - "
+                 "use gnulib module getentropy for portability");
+# endif
+#endif
+
+
 #if @GNULIB_GETGROUPS@
 /* Return the supplemental groups that the current process belongs to.
    It is unspecified whether the effective group id is in the list.
@@ -773,7 +1255,7 @@ _GL_WARN_ON_USE (gethostname, "gethostname is unportable - "
 /* Returns the user's login name, or NULL if it cannot be found.  Upon error,
    returns NULL with errno set.
 
-   See <http://www.opengroup.org/susv3xsh/getlogin.html>.
+   See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
 
    Most programs don't need to use this function, because the information is
    available through environment variables:
@@ -802,7 +1284,7 @@ _GL_WARN_ON_USE (getlogin, "getlogin is unportable - "
    the case that the login name cannot be found but no specific error is
    provided (this case is hopefully rare but is left open by the POSIX spec).
 
-   See <http://www.opengroup.org/susv3xsh/getlogin.html>.
+   See <https://pubs.opengroup.org/onlinepubs/9699919799/functions/getlogin.html>.
 
    Most programs don't need to use this function, because the information is
    available through environment variables:
@@ -843,6 +1325,11 @@ _GL_WARN_ON_USE (getlogin_r, "getlogin_r is unportable - "
 _GL_FUNCDECL_RPL (getpagesize, int, (void));
 _GL_CXXALIAS_RPL (getpagesize, int, (void));
 # else
+/* On HP-UX, getpagesize exists, but it is not declared in <unistd.h> even if
+   the compiler options -D_HPUX_SOURCE -D_XOPEN_SOURCE=600 are used.  */
+#  if defined __hpux
+_GL_FUNCDECL_SYS (getpagesize, int, (void));
+#  endif
 #  if !@HAVE_GETPAGESIZE@
 #   if !defined getpagesize
 /* This is for POSIX systems.  */
@@ -917,6 +1404,53 @@ _GL_WARN_ON_USE (getpagesize, "getpagesize is unportable - "
 #endif
 
 
+#if @GNULIB_GETPASS@
+/* Function getpass() from module 'getpass':
+     Read a password from /dev/tty or stdin.
+   Function getpass() from module 'getpass-gnu':
+     Read a password of arbitrary length from /dev/tty or stdin.  */
+# if @REPLACE_GETPASS@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getpass
+#   define getpass rpl_getpass
+#  endif
+_GL_FUNCDECL_RPL (getpass, char *, (const char *prompt)
+                                   _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (getpass, char *, (const char *prompt));
+# else
+#  if !@HAVE_GETPASS@
+_GL_FUNCDECL_SYS (getpass, char *, (const char *prompt)
+                                   _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (getpass, char *, (const char *prompt));
+# endif
+_GL_CXXALIASWARN (getpass);
+#elif defined GNULIB_POSIXCHECK
+# undef getpass
+# if HAVE_RAW_DECL_GETPASS
+_GL_WARN_ON_USE (getpass, "getpass is unportable - "
+                 "use gnulib module getpass or getpass-gnu for portability");
+# endif
+#endif
+
+
+#if @GNULIB_MDA_GETPID@
+/* On native Windows, map 'getpid' to '_getpid', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::getpid always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getpid
+#   define getpid _getpid
+#  endif
+_GL_CXXALIAS_MDA (getpid, int, (void));
+# else
+_GL_CXXALIAS_SYS (getpid, pid_t, (void));
+# endif
+_GL_CXXALIASWARN (getpid);
+#endif
+
+
 #if @GNULIB_GETUSERSHELL@
 /* Return the next valid login shell on the system, or NULL when the end of
    the list has been reached.  */
@@ -989,6 +1523,12 @@ _GL_WARN_ON_USE (group_member, "group_member is unportable - "
 #  endif
 _GL_FUNCDECL_RPL (isatty, int, (int fd));
 _GL_CXXALIAS_RPL (isatty, int, (int fd));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef isatty
+#   define isatty _isatty
+#  endif
+_GL_CXXALIAS_MDA (isatty, int, (int fd));
 # else
 _GL_CXXALIAS_SYS (isatty, int, (int fd));
 # endif
@@ -999,6 +1539,20 @@ _GL_CXXALIASWARN (isatty);
 _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
                  "use gnulib module isatty for portability");
 # endif
+#elif @GNULIB_MDA_ISATTY@
+/* On native Windows, map 'isatty' to '_isatty', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::isatty always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef isatty
+#   define isatty _isatty
+#  endif
+_GL_CXXALIAS_MDA (isatty, int, (int fd));
+# else
+_GL_CXXALIAS_SYS (isatty, int, (int fd));
+# endif
+_GL_CXXALIASWARN (isatty);
 #endif
 
 
@@ -1007,7 +1561,7 @@ _GL_WARN_ON_USE (isatty, "isatty has portability problems on native Windows - "
    to GID (if GID is not -1).  Do not follow symbolic links.
    Return 0 if successful, otherwise -1 and errno set.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lchown.html>.  */
 # if @REPLACE_LCHOWN@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef lchown
@@ -1037,7 +1591,7 @@ _GL_WARN_ON_USE (lchown, "lchown is unportable to pre-POSIX.1-2001 systems - "
 /* Create a new hard link for an existing file.
    Return 0 if successful, otherwise -1 and errno set.
    See POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html>.  */
 # if @REPLACE_LINK@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define link rpl_link
@@ -1103,13 +1657,19 @@ _GL_WARN_ON_USE (linkat, "linkat is unportable - "
 /* Set the offset of FD relative to SEEK_SET, SEEK_CUR, or SEEK_END.
    Return the new offset if successful, otherwise -1 and errno set.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/lseek.html>.  */
 # if @REPLACE_LSEEK@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define lseek rpl_lseek
 #  endif
 _GL_FUNCDECL_RPL (lseek, off_t, (int fd, off_t offset, int whence));
 _GL_CXXALIAS_RPL (lseek, off_t, (int fd, off_t offset, int whence));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef lseek
+#   define lseek _lseek
+#  endif
+_GL_CXXALIAS_MDA (lseek, off_t, (int fd, off_t offset, int whence));
 # else
 _GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
 # endif
@@ -1120,6 +1680,20 @@ _GL_CXXALIASWARN (lseek);
 _GL_WARN_ON_USE (lseek, "lseek does not fail with ESPIPE on pipes on some "
                  "systems - use gnulib module lseek for portability");
 # endif
+#elif @GNULIB_MDA_LSEEK@
+/* On native Windows, map 'lseek' to '_lseek', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::lseek always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef lseek
+#   define lseek _lseek
+#  endif
+_GL_CXXALIAS_MDA (lseek, long, (int fd, long offset, int whence));
+# else
+_GL_CXXALIAS_SYS (lseek, off_t, (int fd, off_t offset, int whence));
+# endif
+_GL_CXXALIASWARN (lseek);
 #endif
 
 
@@ -1149,7 +1723,7 @@ _GL_WARN_ON_USE (pipe, "pipe is unportable - "
    Store the read-end as fd[0] and the write-end as fd[1].
    Return 0 upon success, or -1 with errno set upon failure.
    See also the Linux man page at
-   <http://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>.  */
+   <https://www.kernel.org/doc/man-pages/online/pages/man2/pipe2.2.html>.  */
 # if @HAVE_PIPE2@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define pipe2 rpl_pipe2
@@ -1175,7 +1749,7 @@ _GL_WARN_ON_USE (pipe2, "pipe2 is unportable - "
    Return the number of bytes placed into BUF if successful, otherwise
    set errno and return -1.  0 indicates EOF.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pread.html>.  */
 # if @REPLACE_PREAD@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef pread
@@ -1210,7 +1784,7 @@ _GL_WARN_ON_USE (pread, "pread is unportable - "
    Return the number of bytes written if successful, otherwise
    set errno and return -1.  0 indicates nothing written.  See the
    POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/pwrite.html>.  */
 # if @REPLACE_PWRITE@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef pwrite
@@ -1243,7 +1817,7 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
 #if @GNULIB_READ@
 /* Read up to COUNT bytes from file descriptor FD into the buffer starting
    at BUF.  See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/read.html>.  */
 # if @REPLACE_READ@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef read
@@ -1252,11 +1826,32 @@ _GL_WARN_ON_USE (pwrite, "pwrite is unportable - "
 _GL_FUNCDECL_RPL (read, ssize_t, (int fd, void *buf, size_t count)
                                  _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (read, ssize_t, (int fd, void *buf, size_t count));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef read
+#   define read _read
+#  endif
+_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, size_t count));
+# else
+_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (read);
+#elif @GNULIB_MDA_READ@
+/* On native Windows, map 'read' to '_read', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::read always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef read
+#   define read _read
+#  endif
+#  ifdef __MINGW32__
+_GL_CXXALIAS_MDA (read, int, (int fd, void *buf, unsigned int count));
+#  else
+_GL_CXXALIAS_MDA (read, ssize_t, (int fd, void *buf, unsigned int count));
+#  endif
 # else
-/* Need to cast, because on mingw, the third parameter is
-                                                          unsigned int count
-   and the return type is 'int'.  */
-_GL_CXXALIAS_SYS_CAST (read, ssize_t, (int fd, void *buf, size_t count));
+_GL_CXXALIAS_SYS (read, ssize_t, (int fd, void *buf, size_t count));
 # endif
 _GL_CXXALIASWARN (read);
 #endif
@@ -1267,24 +1862,28 @@ _GL_CXXALIASWARN (read);
    bytes of it into BUF.  Return the number of bytes placed into BUF if
    successful, otherwise -1 and errno set.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/readlink.html>.  */
 # if @REPLACE_READLINK@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   define readlink rpl_readlink
 #  endif
 _GL_FUNCDECL_RPL (readlink, ssize_t,
-                  (const char *file, char *buf, size_t bufsize)
+                  (const char *restrict file,
+                   char *restrict buf, size_t bufsize)
                   _GL_ARG_NONNULL ((1, 2)));
 _GL_CXXALIAS_RPL (readlink, ssize_t,
-                  (const char *file, char *buf, size_t bufsize));
+                  (const char *restrict file,
+                   char *restrict buf, size_t bufsize));
 # else
 #  if !@HAVE_READLINK@
 _GL_FUNCDECL_SYS (readlink, ssize_t,
-                  (const char *file, char *buf, size_t bufsize)
+                  (const char *restrict file,
+                   char *restrict buf, size_t bufsize)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
 _GL_CXXALIAS_SYS (readlink, ssize_t,
-                  (const char *file, char *buf, size_t bufsize));
+                  (const char *restrict file,
+                   char *restrict buf, size_t bufsize));
 # endif
 _GL_CXXALIASWARN (readlink);
 #elif defined GNULIB_POSIXCHECK
@@ -1302,18 +1901,22 @@ _GL_WARN_ON_USE (readlink, "readlink is unportable - "
 #   define readlinkat rpl_readlinkat
 #  endif
 _GL_FUNCDECL_RPL (readlinkat, ssize_t,
-                  (int fd, char const *file, char *buf, size_t len)
+                  (int fd, char const *restrict file,
+                   char *restrict buf, size_t len)
                   _GL_ARG_NONNULL ((2, 3)));
 _GL_CXXALIAS_RPL (readlinkat, ssize_t,
-                  (int fd, char const *file, char *buf, size_t len));
+                  (int fd, char const *restrict file,
+                   char *restrict buf, size_t len));
 # else
 #  if !@HAVE_READLINKAT@
 _GL_FUNCDECL_SYS (readlinkat, ssize_t,
-                  (int fd, char const *file, char *buf, size_t len)
+                  (int fd, char const *restrict file,
+                   char *restrict buf, size_t len)
                   _GL_ARG_NONNULL ((2, 3)));
 #  endif
 _GL_CXXALIAS_SYS (readlinkat, ssize_t,
-                  (int fd, char const *file, char *buf, size_t len));
+                  (int fd, char const *restrict file,
+                   char *restrict buf, size_t len));
 # endif
 _GL_CXXALIASWARN (readlinkat);
 #elif defined GNULIB_POSIXCHECK
@@ -1333,6 +1936,12 @@ _GL_WARN_ON_USE (readlinkat, "readlinkat is not portable - "
 #  endif
 _GL_FUNCDECL_RPL (rmdir, int, (char const *name) _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (rmdir, int, (char const *name));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef rmdir
+#   define rmdir _rmdir
+#  endif
+_GL_CXXALIAS_MDA (rmdir, int, (char const *name));
 # else
 _GL_CXXALIAS_SYS (rmdir, int, (char const *name));
 # endif
@@ -1343,6 +1952,20 @@ _GL_CXXALIASWARN (rmdir);
 _GL_WARN_ON_USE (rmdir, "rmdir is unportable - "
                  "use gnulib module rmdir for portability");
 # endif
+#elif @GNULIB_MDA_RMDIR@
+/* On native Windows, map 'rmdir' to '_rmdir', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::rmdir always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef rmdir
+#   define rmdir _rmdir
+#  endif
+_GL_CXXALIAS_MDA (rmdir, int, (char const *name));
+# else
+_GL_CXXALIAS_SYS (rmdir, int, (char const *name));
+# endif
+_GL_CXXALIASWARN (rmdir);
 #endif
 
 
@@ -1377,7 +2000,7 @@ _GL_WARN_ON_USE (sethostname, "sethostname is unportable - "
 /* Pause the execution of the current thread for N seconds.
    Returns the number of seconds left to sleep.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/sleep.html>.  */
 # if @REPLACE_SLEEP@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef sleep
@@ -1401,6 +2024,23 @@ _GL_WARN_ON_USE (sleep, "sleep is unportable - "
 #endif
 
 
+#if @GNULIB_MDA_SWAB@
+/* On native Windows, map 'swab' to '_swab', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::creat always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef swab
+#   define swab _swab
+#  endif
+_GL_CXXALIAS_MDA (swab, void, (char *from, char *to, int n));
+# else
+_GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));
+# endif
+_GL_CXXALIASWARN (swab);
+#endif
+
+
 #if @GNULIB_SYMLINK@
 # if @REPLACE_SYMLINK@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
@@ -1457,6 +2097,36 @@ _GL_WARN_ON_USE (symlinkat, "symlinkat is not portable - "
 #endif
 
 
+#if @GNULIB_TRUNCATE@
+/* Change the size of the file designated by FILENAME to become equal to LENGTH.
+   Return 0 if successful, otherwise -1 and errno set.
+   See the POSIX:2008 specification
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/truncate.html>.  */
+# if @REPLACE_TRUNCATE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef truncate
+#   define truncate rpl_truncate
+#  endif
+_GL_FUNCDECL_RPL (truncate, int, (const char *filename, off_t length)
+                                 _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (truncate, int, (const char *filename, off_t length));
+# else
+#  if !@HAVE_DECL_TRUNCATE@
+_GL_FUNCDECL_SYS (truncate, int, (const char *filename, off_t length)
+                                 _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (truncate, int, (const char *filename, off_t length));
+# endif
+_GL_CXXALIASWARN (truncate);
+#elif defined GNULIB_POSIXCHECK
+# undef truncate
+# if HAVE_RAW_DECL_TRUNCATE
+_GL_WARN_ON_USE (truncate, "truncate is unportable - "
+                 "use gnulib module truncate for portability");
+# endif
+#endif
+
+
 #if @GNULIB_TTYNAME_R@
 /* Store at most BUFLEN characters of the pathname of the terminal FD is
    open on in BUF.  Return 0 on success, otherwise an error number.  */
@@ -1495,6 +2165,12 @@ _GL_WARN_ON_USE (ttyname_r, "ttyname_r is not portable - "
 #  endif
 _GL_FUNCDECL_RPL (unlink, int, (char const *file) _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (unlink, int, (char const *file));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef unlink
+#   define unlink _unlink
+#  endif
+_GL_CXXALIAS_MDA (unlink, int, (char const *file));
 # else
 _GL_CXXALIAS_SYS (unlink, int, (char const *file));
 # endif
@@ -1505,6 +2181,20 @@ _GL_CXXALIASWARN (unlink);
 _GL_WARN_ON_USE (unlink, "unlink is not portable - "
                  "use gnulib module unlink for portability");
 # endif
+#elif @GNULIB_MDA_UNLINK@
+/* On native Windows, map 'unlink' to '_unlink', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::unlink always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef unlink
+#   define unlink _unlink
+#  endif
+_GL_CXXALIAS_MDA (unlink, int, (char const *file));
+# else
+_GL_CXXALIAS_SYS (unlink, int, (char const *file));
+# endif
+_GL_CXXALIASWARN (unlink);
 #endif
 
 
@@ -1529,7 +2219,7 @@ _GL_CXXALIASWARN (unlinkat);
 # undef unlinkat
 # if HAVE_RAW_DECL_UNLINKAT
 _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
-                 "use gnulib module openat for portability");
+                 "use gnulib module unlinkat for portability");
 # endif
 #endif
 
@@ -1538,7 +2228,7 @@ _GL_WARN_ON_USE (unlinkat, "unlinkat is not portable - "
 /* Pause the execution of the current thread for N microseconds.
    Returns 0 on completion, or -1 on range error.
    See the POSIX:2001 specification
-   <http://www.opengroup.org/susv3xsh/usleep.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/009695399/functions/usleep.html>.  */
 # if @REPLACE_USLEEP@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef usleep
@@ -1550,7 +2240,9 @@ _GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
 #  if !@HAVE_USLEEP@
 _GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
 #  endif
-_GL_CXXALIAS_SYS (usleep, int, (useconds_t n));
+/* Need to cast, because on Haiku, the first parameter is
+                                     unsigned int n.  */
+_GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n));
 # endif
 _GL_CXXALIASWARN (usleep);
 #elif defined GNULIB_POSIXCHECK
@@ -1565,7 +2257,7 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - "
 #if @GNULIB_WRITE@
 /* Write up to COUNT bytes starting at BUF to file descriptor FD.
    See the POSIX:2008 specification
-   <http://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>.  */
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/write.html>.  */
 # if @REPLACE_WRITE@
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef write
@@ -1574,11 +2266,32 @@ _GL_WARN_ON_USE (usleep, "usleep is unportable - "
 _GL_FUNCDECL_RPL (write, ssize_t, (int fd, const void *buf, size_t count)
                                   _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (write, ssize_t, (int fd, const void *buf, size_t count));
+# elif defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef write
+#   define write _write
+#  endif
+_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, size_t count));
+# else
+_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
+# endif
+_GL_CXXALIASWARN (write);
+#elif @GNULIB_MDA_WRITE@
+/* On native Windows, map 'write' to '_write', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::write always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef write
+#   define write _write
+#  endif
+#  ifdef __MINGW32__
+_GL_CXXALIAS_MDA (write, int, (int fd, const void *buf, unsigned int count));
+#  else
+_GL_CXXALIAS_MDA (write, ssize_t, (int fd, const void *buf, unsigned int count));
+#  endif
 # else
-/* Need to cast, because on mingw, the third parameter is
-                                                             unsigned int count
-   and the return type is 'int'.  */
-_GL_CXXALIAS_SYS_CAST (write, ssize_t, (int fd, const void *buf, size_t count));
+_GL_CXXALIAS_SYS (write, ssize_t, (int fd, const void *buf, size_t count));
 # endif
 _GL_CXXALIASWARN (write);
 #endif
diff --git a/lib/unistr.in.h b/lib/unistr.in.h
new file mode 100644 (file)
index 0000000..f60e529
--- /dev/null
@@ -0,0 +1,749 @@
+/* Elementary Unicode string functions.
+   Copyright (C) 2001-2002, 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _UNISTR_H
+#define _UNISTR_H
+
+#include "unitypes.h"
+
+/* Get common macros for C.  */
+#include "unused-parameter.h"
+
+/* Get bool.  */
+#include <stdbool.h>
+
+/* Get size_t, ptrdiff_t.  */
+#include <stddef.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Conventions:
+
+   All functions prefixed with u8_ operate on UTF-8 encoded strings.
+   Their unit is an uint8_t (1 byte).
+
+   All functions prefixed with u16_ operate on UTF-16 encoded strings.
+   Their unit is an uint16_t (a 2-byte word).
+
+   All functions prefixed with u32_ operate on UCS-4 encoded strings.
+   Their unit is an uint32_t (a 4-byte word).
+
+   All argument pairs (s, n) denote a Unicode string s[0..n-1] with exactly
+   n units.
+
+   All arguments starting with "str" and the arguments of functions starting
+   with u8_str/u16_str/u32_str denote a NUL terminated string, i.e. a string
+   which terminates at the first NUL unit.  This termination unit is
+   considered part of the string for all memory allocation purposes, but
+   is not considered part of the string for all other logical purposes.
+
+   Functions returning a string result take a (resultbuf, lengthp) argument
+   pair.  If resultbuf is not NULL and the result fits into *lengthp units,
+   it is put in resultbuf, and resultbuf is returned.  Otherwise, a freshly
+   allocated string is returned.  In both cases, *lengthp is set to the
+   length (number of units) of the returned string.  In case of error,
+   NULL is returned and errno is set.  */
+
+
+/* Elementary string checks.  */
+
+/* Check whether an UTF-8 string is well-formed.
+   Return NULL if valid, or a pointer to the first invalid unit otherwise.  */
+extern const uint8_t *
+       u8_check (const uint8_t *s, size_t n)
+       _UC_ATTRIBUTE_PURE;
+
+/* Check whether an UTF-16 string is well-formed.
+   Return NULL if valid, or a pointer to the first invalid unit otherwise.  */
+extern const uint16_t *
+       u16_check (const uint16_t *s, size_t n)
+       _UC_ATTRIBUTE_PURE;
+
+/* Check whether an UCS-4 string is well-formed.
+   Return NULL if valid, or a pointer to the first invalid unit otherwise.  */
+extern const uint32_t *
+       u32_check (const uint32_t *s, size_t n)
+       _UC_ATTRIBUTE_PURE;
+
+
+/* Elementary string conversions.  */
+
+/* Convert an UTF-8 string to an UTF-16 string.  */
+extern uint16_t *
+       u8_to_u16 (const uint8_t *s, size_t n, uint16_t *resultbuf,
+                  size_t *lengthp);
+
+/* Convert an UTF-8 string to an UCS-4 string.  */
+extern uint32_t *
+       u8_to_u32 (const uint8_t *s, size_t n, uint32_t *resultbuf,
+                  size_t *lengthp);
+
+/* Convert an UTF-16 string to an UTF-8 string.  */
+extern uint8_t *
+       u16_to_u8 (const uint16_t *s, size_t n, uint8_t *resultbuf,
+                  size_t *lengthp);
+
+/* Convert an UTF-16 string to an UCS-4 string.  */
+extern uint32_t *
+       u16_to_u32 (const uint16_t *s, size_t n, uint32_t *resultbuf,
+                   size_t *lengthp);
+
+/* Convert an UCS-4 string to an UTF-8 string.  */
+extern uint8_t *
+       u32_to_u8 (const uint32_t *s, size_t n, uint8_t *resultbuf,
+                  size_t *lengthp);
+
+/* Convert an UCS-4 string to an UTF-16 string.  */
+extern uint16_t *
+       u32_to_u16 (const uint32_t *s, size_t n, uint16_t *resultbuf,
+                   size_t *lengthp);
+
+
+/* Elementary string functions.  */
+
+/* Return the length (number of units) of the first character in S, which is
+   no longer than N.  Return 0 if it is the NUL character.  Return -1 upon
+   failure.  */
+/* Similar to mblen(), except that s must not be NULL.  */
+extern int
+       u8_mblen (const uint8_t *s, size_t n)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u16_mblen (const uint16_t *s, size_t n)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u32_mblen (const uint32_t *s, size_t n)
+       _UC_ATTRIBUTE_PURE;
+
+/* Return the length (number of units) of the first character in S, putting
+   its 'ucs4_t' representation in *PUC.  Upon failure, *PUC is set to 0xfffd,
+   and an appropriate number of units is returned.
+   The number of available units, N, must be > 0.  */
+/* Similar to mbtowc(), except that puc and s must not be NULL, n must be > 0,
+   and the NUL character is not treated specially.  */
+/* The variants with _unsafe suffix are for backward compatibility with
+   libunistring versions < 0.9.7.  */
+
+#if GNULIB_UNISTR_U8_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+       u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n);
+# else
+extern int
+       u8_mbtouc_unsafe_aux (ucs4_t *puc, const uint8_t *s, size_t n);
+static inline int
+u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n)
+{
+  uint8_t c = *s;
+
+  if (c < 0x80)
+    {
+      *puc = c;
+      return 1;
+    }
+  else
+    return u8_mbtouc_unsafe_aux (puc, s, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U16_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+       u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n);
+# else
+extern int
+       u16_mbtouc_unsafe_aux (ucs4_t *puc, const uint16_t *s, size_t n);
+static inline int
+u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n)
+{
+  uint16_t c = *s;
+
+  if (c < 0xd800 || c >= 0xe000)
+    {
+      *puc = c;
+      return 1;
+    }
+  else
+    return u16_mbtouc_unsafe_aux (puc, s, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U32_MBTOUC_UNSAFE || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+       u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n);
+# else
+static inline int
+u32_mbtouc_unsafe (ucs4_t *puc,
+                   const uint32_t *s, size_t n _GL_UNUSED_PARAMETER)
+{
+  uint32_t c = *s;
+
+  if (c < 0xd800 || (c >= 0xe000 && c < 0x110000))
+    *puc = c;
+  else
+    /* invalid multibyte character */
+    *puc = 0xfffd;
+  return 1;
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U8_MBTOUC || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+       u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n);
+# else
+extern int
+       u8_mbtouc_aux (ucs4_t *puc, const uint8_t *s, size_t n);
+static inline int
+u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n)
+{
+  uint8_t c = *s;
+
+  if (c < 0x80)
+    {
+      *puc = c;
+      return 1;
+    }
+  else
+    return u8_mbtouc_aux (puc, s, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U16_MBTOUC || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+       u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n);
+# else
+extern int
+       u16_mbtouc_aux (ucs4_t *puc, const uint16_t *s, size_t n);
+static inline int
+u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n)
+{
+  uint16_t c = *s;
+
+  if (c < 0xd800 || c >= 0xe000)
+    {
+      *puc = c;
+      return 1;
+    }
+  else
+    return u16_mbtouc_aux (puc, s, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U32_MBTOUC || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+       u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n);
+# else
+static inline int
+u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n _GL_UNUSED_PARAMETER)
+{
+  uint32_t c = *s;
+
+  if (c < 0xd800 || (c >= 0xe000 && c < 0x110000))
+    *puc = c;
+  else
+    /* invalid multibyte character */
+    *puc = 0xfffd;
+  return 1;
+}
+# endif
+#endif
+
+/* Return the length (number of units) of the first character in S, putting
+   its 'ucs4_t' representation in *PUC.  Upon failure, *PUC is set to 0xfffd,
+   and -1 is returned for an invalid sequence of units, -2 is returned for an
+   incomplete sequence of units.
+   The number of available units, N, must be > 0.  */
+/* Similar to u*_mbtouc(), except that the return value gives more details
+   about the failure, similar to mbrtowc().  */
+
+#if GNULIB_UNISTR_U8_MBTOUCR || HAVE_LIBUNISTRING
+extern int
+       u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n);
+#endif
+
+#if GNULIB_UNISTR_U16_MBTOUCR || HAVE_LIBUNISTRING
+extern int
+       u16_mbtoucr (ucs4_t *puc, const uint16_t *s, size_t n);
+#endif
+
+#if GNULIB_UNISTR_U32_MBTOUCR || HAVE_LIBUNISTRING
+extern int
+       u32_mbtoucr (ucs4_t *puc, const uint32_t *s, size_t n);
+#endif
+
+/* Put the multibyte character represented by UC in S, returning its
+   length.  Return -1 upon failure, -2 if the number of available units, N,
+   is too small.  The latter case cannot occur if N >= 6/2/1, respectively.  */
+/* Similar to wctomb(), except that s must not be NULL, and the argument n
+   must be specified.  */
+
+#if GNULIB_UNISTR_U8_UCTOMB || HAVE_LIBUNISTRING
+/* Auxiliary function, also used by u8_chr, u8_strchr, u8_strrchr.  */
+extern int
+       u8_uctomb_aux (uint8_t *s, ucs4_t uc, ptrdiff_t n);
+# if !HAVE_INLINE
+extern int
+       u8_uctomb (uint8_t *s, ucs4_t uc, ptrdiff_t n);
+# else
+static inline int
+u8_uctomb (uint8_t *s, ucs4_t uc, ptrdiff_t n)
+{
+  if (uc < 0x80 && n > 0)
+    {
+      s[0] = uc;
+      return 1;
+    }
+  else
+    return u8_uctomb_aux (s, uc, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U16_UCTOMB || HAVE_LIBUNISTRING
+/* Auxiliary function, also used by u16_chr, u16_strchr, u16_strrchr.  */
+extern int
+       u16_uctomb_aux (uint16_t *s, ucs4_t uc, ptrdiff_t n);
+# if !HAVE_INLINE
+extern int
+       u16_uctomb (uint16_t *s, ucs4_t uc, ptrdiff_t n);
+# else
+static inline int
+u16_uctomb (uint16_t *s, ucs4_t uc, ptrdiff_t n)
+{
+  if (uc < 0xd800 && n > 0)
+    {
+      s[0] = uc;
+      return 1;
+    }
+  else
+    return u16_uctomb_aux (s, uc, n);
+}
+# endif
+#endif
+
+#if GNULIB_UNISTR_U32_UCTOMB || HAVE_LIBUNISTRING
+# if !HAVE_INLINE
+extern int
+       u32_uctomb (uint32_t *s, ucs4_t uc, ptrdiff_t n);
+# else
+static inline int
+u32_uctomb (uint32_t *s, ucs4_t uc, ptrdiff_t n)
+{
+  if (uc < 0xd800 || (uc >= 0xe000 && uc < 0x110000))
+    {
+      if (n > 0)
+        {
+          *s = uc;
+          return 1;
+        }
+      else
+        return -2;
+    }
+  else
+    return -1;
+}
+# endif
+#endif
+
+/* Copy N units from SRC to DEST.  */
+/* Similar to memcpy().  */
+extern uint8_t *
+       u8_cpy (uint8_t *_UC_RESTRICT dest, const uint8_t *src, size_t n);
+extern uint16_t *
+       u16_cpy (uint16_t *_UC_RESTRICT dest, const uint16_t *src, size_t n);
+extern uint32_t *
+       u32_cpy (uint32_t *_UC_RESTRICT dest, const uint32_t *src, size_t n);
+
+/* Copy N units from SRC to DEST, guaranteeing correct behavior for
+   overlapping memory areas.  */
+/* Similar to memmove().  */
+extern uint8_t *
+       u8_move (uint8_t *dest, const uint8_t *src, size_t n);
+extern uint16_t *
+       u16_move (uint16_t *dest, const uint16_t *src, size_t n);
+extern uint32_t *
+       u32_move (uint32_t *dest, const uint32_t *src, size_t n);
+
+/* Set the first N characters of S to UC.  UC should be a character that
+   occupies only 1 unit.  */
+/* Similar to memset().  */
+extern uint8_t *
+       u8_set (uint8_t *s, ucs4_t uc, size_t n);
+extern uint16_t *
+       u16_set (uint16_t *s, ucs4_t uc, size_t n);
+extern uint32_t *
+       u32_set (uint32_t *s, ucs4_t uc, size_t n);
+
+/* Compare S1 and S2, each of length N.  */
+/* Similar to memcmp().  */
+extern int
+       u8_cmp (const uint8_t *s1, const uint8_t *s2, size_t n)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u16_cmp (const uint16_t *s1, const uint16_t *s2, size_t n)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u32_cmp (const uint32_t *s1, const uint32_t *s2, size_t n)
+       _UC_ATTRIBUTE_PURE;
+
+/* Compare S1 and S2.  */
+/* Similar to the gnulib function memcmp2().  */
+extern int
+       u8_cmp2 (const uint8_t *s1, size_t n1, const uint8_t *s2, size_t n2)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u16_cmp2 (const uint16_t *s1, size_t n1, const uint16_t *s2, size_t n2)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u32_cmp2 (const uint32_t *s1, size_t n1, const uint32_t *s2, size_t n2)
+       _UC_ATTRIBUTE_PURE;
+
+/* Search the string at S for UC.  */
+/* Similar to memchr().  */
+extern uint8_t *
+       u8_chr (const uint8_t *s, size_t n, ucs4_t uc)
+       _UC_ATTRIBUTE_PURE;
+extern uint16_t *
+       u16_chr (const uint16_t *s, size_t n, ucs4_t uc)
+       _UC_ATTRIBUTE_PURE;
+extern uint32_t *
+       u32_chr (const uint32_t *s, size_t n, ucs4_t uc)
+       _UC_ATTRIBUTE_PURE;
+
+/* Count the number of Unicode characters in the N units from S.  */
+/* Similar to mbsnlen().  */
+extern size_t
+       u8_mbsnlen (const uint8_t *s, size_t n)
+       _UC_ATTRIBUTE_PURE;
+extern size_t
+       u16_mbsnlen (const uint16_t *s, size_t n)
+       _UC_ATTRIBUTE_PURE;
+extern size_t
+       u32_mbsnlen (const uint32_t *s, size_t n)
+       _UC_ATTRIBUTE_PURE;
+
+/* Elementary string functions with memory allocation.  */
+
+/* Make a freshly allocated copy of S, of length N.  */
+extern uint8_t *
+       u8_cpy_alloc (const uint8_t *s, size_t n);
+extern uint16_t *
+       u16_cpy_alloc (const uint16_t *s, size_t n);
+extern uint32_t *
+       u32_cpy_alloc (const uint32_t *s, size_t n);
+
+/* Elementary string functions on NUL terminated strings.  */
+
+/* Return the length (number of units) of the first character in S.
+   Return 0 if it is the NUL character.  Return -1 upon failure.  */
+extern int
+       u8_strmblen (const uint8_t *s)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u16_strmblen (const uint16_t *s)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u32_strmblen (const uint32_t *s)
+       _UC_ATTRIBUTE_PURE;
+
+/* Return the length (number of units) of the first character in S, putting
+   its 'ucs4_t' representation in *PUC.  Return 0 if it is the NUL
+   character.  Return -1 upon failure.  */
+extern int
+       u8_strmbtouc (ucs4_t *puc, const uint8_t *s);
+extern int
+       u16_strmbtouc (ucs4_t *puc, const uint16_t *s);
+extern int
+       u32_strmbtouc (ucs4_t *puc, const uint32_t *s);
+
+/* Forward iteration step.  Advances the pointer past the next character,
+   or returns NULL if the end of the string has been reached.  Puts the
+   character's 'ucs4_t' representation in *PUC.  */
+extern const uint8_t *
+       u8_next (ucs4_t *puc, const uint8_t *s);
+extern const uint16_t *
+       u16_next (ucs4_t *puc, const uint16_t *s);
+extern const uint32_t *
+       u32_next (ucs4_t *puc, const uint32_t *s);
+
+/* Backward iteration step.  Advances the pointer to point to the previous
+   character, or returns NULL if the beginning of the string had been reached.
+   Puts the character's 'ucs4_t' representation in *PUC.  */
+extern const uint8_t *
+       u8_prev (ucs4_t *puc, const uint8_t *s, const uint8_t *start);
+extern const uint16_t *
+       u16_prev (ucs4_t *puc, const uint16_t *s, const uint16_t *start);
+extern const uint32_t *
+       u32_prev (ucs4_t *puc, const uint32_t *s, const uint32_t *start);
+
+/* Return the number of units in S.  */
+/* Similar to strlen(), wcslen().  */
+extern size_t
+       u8_strlen (const uint8_t *s)
+       _UC_ATTRIBUTE_PURE;
+extern size_t
+       u16_strlen (const uint16_t *s)
+       _UC_ATTRIBUTE_PURE;
+extern size_t
+       u32_strlen (const uint32_t *s)
+       _UC_ATTRIBUTE_PURE;
+
+/* Return the number of units in S, but at most MAXLEN.  */
+/* Similar to strnlen(), wcsnlen().  */
+extern size_t
+       u8_strnlen (const uint8_t *s, size_t maxlen)
+       _UC_ATTRIBUTE_PURE;
+extern size_t
+       u16_strnlen (const uint16_t *s, size_t maxlen)
+       _UC_ATTRIBUTE_PURE;
+extern size_t
+       u32_strnlen (const uint32_t *s, size_t maxlen)
+       _UC_ATTRIBUTE_PURE;
+
+/* Copy SRC to DEST.  */
+/* Similar to strcpy(), wcscpy().  */
+extern uint8_t *
+       u8_strcpy (uint8_t *_UC_RESTRICT dest, const uint8_t *src);
+extern uint16_t *
+       u16_strcpy (uint16_t *_UC_RESTRICT dest, const uint16_t *src);
+extern uint32_t *
+       u32_strcpy (uint32_t *_UC_RESTRICT dest, const uint32_t *src);
+
+/* Copy SRC to DEST, returning the address of the terminating NUL in DEST.  */
+/* Similar to stpcpy().  */
+extern uint8_t *
+       u8_stpcpy (uint8_t *_UC_RESTRICT dest, const uint8_t *src);
+extern uint16_t *
+       u16_stpcpy (uint16_t *_UC_RESTRICT dest, const uint16_t *src);
+extern uint32_t *
+       u32_stpcpy (uint32_t *_UC_RESTRICT dest, const uint32_t *src);
+
+/* Copy no more than N units of SRC to DEST.  */
+/* Similar to strncpy(), wcsncpy().  */
+extern uint8_t *
+       u8_strncpy (uint8_t *_UC_RESTRICT dest, const uint8_t *src, size_t n);
+extern uint16_t *
+       u16_strncpy (uint16_t *_UC_RESTRICT dest, const uint16_t *src, size_t n);
+extern uint32_t *
+       u32_strncpy (uint32_t *_UC_RESTRICT dest, const uint32_t *src, size_t n);
+
+/* Copy no more than N units of SRC to DEST.  Return a pointer past the last
+   non-NUL unit written into DEST.  */
+/* Similar to stpncpy().  */
+extern uint8_t *
+       u8_stpncpy (uint8_t *_UC_RESTRICT dest, const uint8_t *src, size_t n);
+extern uint16_t *
+       u16_stpncpy (uint16_t *_UC_RESTRICT dest, const uint16_t *src, size_t n);
+extern uint32_t *
+       u32_stpncpy (uint32_t *_UC_RESTRICT dest, const uint32_t *src, size_t n);
+
+/* Append SRC onto DEST.  */
+/* Similar to strcat(), wcscat().  */
+extern uint8_t *
+       u8_strcat (uint8_t *_UC_RESTRICT dest, const uint8_t *src);
+extern uint16_t *
+       u16_strcat (uint16_t *_UC_RESTRICT dest, const uint16_t *src);
+extern uint32_t *
+       u32_strcat (uint32_t *_UC_RESTRICT dest, const uint32_t *src);
+
+/* Append no more than N units of SRC onto DEST.  */
+/* Similar to strncat(), wcsncat().  */
+extern uint8_t *
+       u8_strncat (uint8_t *_UC_RESTRICT dest, const uint8_t *src, size_t n);
+extern uint16_t *
+       u16_strncat (uint16_t *_UC_RESTRICT dest, const uint16_t *src, size_t n);
+extern uint32_t *
+       u32_strncat (uint32_t *_UC_RESTRICT dest, const uint32_t *src, size_t n);
+
+/* Compare S1 and S2.  */
+/* Similar to strcmp(), wcscmp().  */
+#ifdef __sun
+/* Avoid a collision with the u8_strcmp() function in Solaris 11 libc.  */
+extern int
+       u8_strcmp_gnu (const uint8_t *s1, const uint8_t *s2)
+       _UC_ATTRIBUTE_PURE;
+# define u8_strcmp u8_strcmp_gnu
+#else
+extern int
+       u8_strcmp (const uint8_t *s1, const uint8_t *s2)
+       _UC_ATTRIBUTE_PURE;
+#endif
+extern int
+       u16_strcmp (const uint16_t *s1, const uint16_t *s2)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u32_strcmp (const uint32_t *s1, const uint32_t *s2)
+       _UC_ATTRIBUTE_PURE;
+
+/* Compare S1 and S2 using the collation rules of the current locale.
+   Return -1 if S1 < S2, 0 if S1 = S2, 1 if S1 > S2.
+   Upon failure, set errno and return any value.  */
+/* Similar to strcoll(), wcscoll().  */
+extern int
+       u8_strcoll (const uint8_t *s1, const uint8_t *s2);
+extern int
+       u16_strcoll (const uint16_t *s1, const uint16_t *s2);
+extern int
+       u32_strcoll (const uint32_t *s1, const uint32_t *s2);
+
+/* Compare no more than N units of S1 and S2.  */
+/* Similar to strncmp(), wcsncmp().  */
+extern int
+       u8_strncmp (const uint8_t *s1, const uint8_t *s2, size_t n)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u16_strncmp (const uint16_t *s1, const uint16_t *s2, size_t n)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u32_strncmp (const uint32_t *s1, const uint32_t *s2, size_t n)
+       _UC_ATTRIBUTE_PURE;
+
+/* Duplicate S, returning an identical malloc'd string.  */
+/* Similar to strdup(), wcsdup().  */
+extern uint8_t *
+       u8_strdup (const uint8_t *s);
+extern uint16_t *
+       u16_strdup (const uint16_t *s);
+extern uint32_t *
+       u32_strdup (const uint32_t *s);
+
+/* Find the first occurrence of UC in STR.  */
+/* Similar to strchr(), wcschr().  */
+extern uint8_t *
+       u8_strchr (const uint8_t *str, ucs4_t uc)
+       _UC_ATTRIBUTE_PURE;
+extern uint16_t *
+       u16_strchr (const uint16_t *str, ucs4_t uc)
+       _UC_ATTRIBUTE_PURE;
+extern uint32_t *
+       u32_strchr (const uint32_t *str, ucs4_t uc)
+       _UC_ATTRIBUTE_PURE;
+
+/* Find the last occurrence of UC in STR.  */
+/* Similar to strrchr(), wcsrchr().  */
+extern uint8_t *
+       u8_strrchr (const uint8_t *str, ucs4_t uc)
+       _UC_ATTRIBUTE_PURE;
+extern uint16_t *
+       u16_strrchr (const uint16_t *str, ucs4_t uc)
+       _UC_ATTRIBUTE_PURE;
+extern uint32_t *
+       u32_strrchr (const uint32_t *str, ucs4_t uc)
+       _UC_ATTRIBUTE_PURE;
+
+/* Return the length of the initial segment of STR which consists entirely
+   of Unicode characters not in REJECT.  */
+/* Similar to strcspn(), wcscspn().  */
+extern size_t
+       u8_strcspn (const uint8_t *str, const uint8_t *reject)
+       _UC_ATTRIBUTE_PURE;
+extern size_t
+       u16_strcspn (const uint16_t *str, const uint16_t *reject)
+       _UC_ATTRIBUTE_PURE;
+extern size_t
+       u32_strcspn (const uint32_t *str, const uint32_t *reject)
+       _UC_ATTRIBUTE_PURE;
+
+/* Return the length of the initial segment of STR which consists entirely
+   of Unicode characters in ACCEPT.  */
+/* Similar to strspn(), wcsspn().  */
+extern size_t
+       u8_strspn (const uint8_t *str, const uint8_t *accept)
+       _UC_ATTRIBUTE_PURE;
+extern size_t
+       u16_strspn (const uint16_t *str, const uint16_t *accept)
+       _UC_ATTRIBUTE_PURE;
+extern size_t
+       u32_strspn (const uint32_t *str, const uint32_t *accept)
+       _UC_ATTRIBUTE_PURE;
+
+/* Find the first occurrence in STR of any character in ACCEPT.  */
+/* Similar to strpbrk(), wcspbrk().  */
+extern uint8_t *
+       u8_strpbrk (const uint8_t *str, const uint8_t *accept)
+       _UC_ATTRIBUTE_PURE;
+extern uint16_t *
+       u16_strpbrk (const uint16_t *str, const uint16_t *accept)
+       _UC_ATTRIBUTE_PURE;
+extern uint32_t *
+       u32_strpbrk (const uint32_t *str, const uint32_t *accept)
+       _UC_ATTRIBUTE_PURE;
+
+/* Find the first occurrence of NEEDLE in HAYSTACK.  */
+/* Similar to strstr(), wcsstr().  */
+extern uint8_t *
+       u8_strstr (const uint8_t *haystack, const uint8_t *needle)
+       _UC_ATTRIBUTE_PURE;
+extern uint16_t *
+       u16_strstr (const uint16_t *haystack, const uint16_t *needle)
+       _UC_ATTRIBUTE_PURE;
+extern uint32_t *
+       u32_strstr (const uint32_t *haystack, const uint32_t *needle)
+       _UC_ATTRIBUTE_PURE;
+
+/* Test whether STR starts with PREFIX.  */
+extern bool
+       u8_startswith (const uint8_t *str, const uint8_t *prefix)
+       _UC_ATTRIBUTE_PURE;
+extern bool
+       u16_startswith (const uint16_t *str, const uint16_t *prefix)
+       _UC_ATTRIBUTE_PURE;
+extern bool
+       u32_startswith (const uint32_t *str, const uint32_t *prefix)
+       _UC_ATTRIBUTE_PURE;
+
+/* Test whether STR ends with SUFFIX.  */
+extern bool
+       u8_endswith (const uint8_t *str, const uint8_t *suffix)
+       _UC_ATTRIBUTE_PURE;
+extern bool
+       u16_endswith (const uint16_t *str, const uint16_t *suffix)
+       _UC_ATTRIBUTE_PURE;
+extern bool
+       u32_endswith (const uint32_t *str, const uint32_t *suffix)
+       _UC_ATTRIBUTE_PURE;
+
+/* Divide STR into tokens separated by characters in DELIM.
+   This interface is actually more similar to wcstok than to strtok.  */
+/* Similar to strtok_r(), wcstok().  */
+extern uint8_t *
+       u8_strtok (uint8_t *_UC_RESTRICT str, const uint8_t *delim,
+                  uint8_t **ptr);
+extern uint16_t *
+       u16_strtok (uint16_t *_UC_RESTRICT str, const uint16_t *delim,
+                   uint16_t **ptr);
+extern uint32_t *
+       u32_strtok (uint32_t *_UC_RESTRICT str, const uint32_t *delim,
+                   uint32_t **ptr);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _UNISTR_H */
diff --git a/lib/unistr/u8-mbtoucr.c b/lib/unistr/u8-mbtoucr.c
new file mode 100644 (file)
index 0000000..efca1df
--- /dev/null
@@ -0,0 +1,142 @@
+/* Look at first character in UTF-8 string, returning an error code.
+   Copyright (C) 1999-2002, 2006-2007, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2001.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "unistr.h"
+
+int
+u8_mbtoucr (ucs4_t *puc, const uint8_t *s, size_t n)
+{
+  uint8_t c = *s;
+
+  if (c < 0x80)
+    {
+      *puc = c;
+      return 1;
+    }
+  else if (c >= 0xc2)
+    {
+      if (c < 0xe0)
+        {
+          if (n >= 2)
+            {
+              if ((s[1] ^ 0x80) < 0x40)
+                {
+                  *puc = ((unsigned int) (c & 0x1f) << 6)
+                         | (unsigned int) (s[1] ^ 0x80);
+                  return 2;
+                }
+              /* invalid multibyte character */
+            }
+          else
+            {
+              /* incomplete multibyte character */
+              *puc = 0xfffd;
+              return -2;
+            }
+        }
+      else if (c < 0xf0)
+        {
+          if (n >= 2)
+            {
+              if ((s[1] ^ 0x80) < 0x40
+                  && (c >= 0xe1 || s[1] >= 0xa0)
+                  && (c != 0xed || s[1] < 0xa0))
+                {
+                  if (n >= 3)
+                    {
+                      if ((s[2] ^ 0x80) < 0x40)
+                        {
+                          *puc = ((unsigned int) (c & 0x0f) << 12)
+                                 | ((unsigned int) (s[1] ^ 0x80) << 6)
+                                 | (unsigned int) (s[2] ^ 0x80);
+                          return 3;
+                        }
+                      /* invalid multibyte character */
+                    }
+                  else
+                    {
+                      /* incomplete multibyte character */
+                      *puc = 0xfffd;
+                      return -2;
+                    }
+                }
+              /* invalid multibyte character */
+            }
+          else
+            {
+              /* incomplete multibyte character */
+              *puc = 0xfffd;
+              return -2;
+            }
+        }
+      else if (c < 0xf8)
+        {
+          if (n >= 2)
+            {
+              if ((s[1] ^ 0x80) < 0x40
+                  && (c >= 0xf1 || s[1] >= 0x90)
+                  && (c < 0xf4 || (c == 0xf4 && s[1] < 0x90)))
+                {
+                  if (n >= 3)
+                    {
+                      if ((s[2] ^ 0x80) < 0x40)
+                        {
+                          if (n >= 4)
+                            {
+                              if ((s[3] ^ 0x80) < 0x40)
+                                {
+                                  *puc = ((unsigned int) (c & 0x07) << 18)
+                                         | ((unsigned int) (s[1] ^ 0x80) << 12)
+                                         | ((unsigned int) (s[2] ^ 0x80) << 6)
+                                         | (unsigned int) (s[3] ^ 0x80);
+                                  return 4;
+                                }
+                              /* invalid multibyte character */
+                            }
+                          else
+                            {
+                              /* incomplete multibyte character */
+                              *puc = 0xfffd;
+                              return -2;
+                            }
+                        }
+                      /* invalid multibyte character */
+                    }
+                  else
+                    {
+                      /* incomplete multibyte character */
+                      *puc = 0xfffd;
+                      return -2;
+                    }
+                }
+              /* invalid multibyte character */
+            }
+          else
+            {
+              /* incomplete multibyte character */
+              *puc = 0xfffd;
+              return -2;
+            }
+        }
+    }
+  /* invalid multibyte character */
+  *puc = 0xfffd;
+  return -1;
+}
diff --git a/lib/unistr/u8-uctomb-aux.c b/lib/unistr/u8-uctomb-aux.c
new file mode 100644 (file)
index 0000000..cb5fa0a
--- /dev/null
@@ -0,0 +1,60 @@
+/* Conversion UCS-4 to UTF-8.
+   Copyright (C) 2002, 2006-2007, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2002.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "unistr.h"
+
+#include "attribute.h"
+
+int
+u8_uctomb_aux (uint8_t *s, ucs4_t uc, ptrdiff_t n)
+{
+  int count;
+
+  if (uc < 0x80)
+    /* The case n >= 1 is already handled by the caller.  */
+    return -2;
+  else if (uc < 0x800)
+    count = 2;
+  else if (uc < 0x10000)
+    {
+      if (uc < 0xd800 || uc >= 0xe000)
+        count = 3;
+      else
+        return -1;
+    }
+  else if (uc < 0x110000)
+    count = 4;
+  else
+    return -1;
+
+  if (n < count)
+    return -2;
+
+  switch (count) /* note: code falls through cases! */
+    {
+    case 4: s[3] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x10000;
+      FALLTHROUGH;
+    case 3: s[2] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x800;
+      FALLTHROUGH;
+    case 2: s[1] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0xc0;
+  /*case 1:*/ s[0] = uc;
+    }
+  return count;
+}
diff --git a/lib/unistr/u8-uctomb.c b/lib/unistr/u8-uctomb.c
new file mode 100644 (file)
index 0000000..28500cd
--- /dev/null
@@ -0,0 +1,79 @@
+/* Store a character in UTF-8 string.
+   Copyright (C) 2002, 2005-2006, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2002.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#if defined IN_LIBUNISTRING
+/* Tell unistr.h to declare u8_uctomb as 'extern', not 'static inline'.  */
+# include "unistring-notinline.h"
+#endif
+
+/* Specification.  */
+#include "unistr.h"
+
+#include "attribute.h"
+
+#if !HAVE_INLINE
+
+int
+u8_uctomb (uint8_t *s, ucs4_t uc, ptrdiff_t n)
+{
+  if (uc < 0x80)
+    {
+      if (n > 0)
+        {
+          s[0] = uc;
+          return 1;
+        }
+      /* else return -2, below.  */
+    }
+  else
+    {
+      int count;
+
+      if (uc < 0x800)
+        count = 2;
+      else if (uc < 0x10000)
+        {
+          if (uc < 0xd800 || uc >= 0xe000)
+            count = 3;
+          else
+            return -1;
+        }
+      else if (uc < 0x110000)
+        count = 4;
+      else
+        return -1;
+
+      if (n >= count)
+        {
+          switch (count) /* note: code falls through cases! */
+            {
+            case 4: s[3] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x10000;
+              FALLTHROUGH;
+            case 3: s[2] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0x800;
+              FALLTHROUGH;
+            case 2: s[1] = 0x80 | (uc & 0x3f); uc = uc >> 6; uc |= 0xc0;
+          /*case 1:*/ s[0] = uc;
+            }
+          return count;
+        }
+    }
+  return -2;
+}
+
+#endif
diff --git a/lib/unitypes.in.h b/lib/unitypes.in.h
new file mode 100644 (file)
index 0000000..3988e23
--- /dev/null
@@ -0,0 +1,61 @@
+/* Elementary types and macros for the GNU UniString library.
+   Copyright (C) 2002, 2005-2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _UNITYPES_H
+#define _UNITYPES_H
+
+/* Get uint8_t, uint16_t, uint32_t.  */
+#include <stdint.h>
+
+/* Type representing a Unicode character.  */
+typedef uint32_t ucs4_t;
+
+/* Attribute of a function whose result depends only on the arguments
+   (not pointers!) and which has no side effects.  */
+#ifndef _UC_ATTRIBUTE_CONST
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) || defined __clang__
+#  define _UC_ATTRIBUTE_CONST __attribute__ ((__const__))
+# else
+#  define _UC_ATTRIBUTE_CONST
+# endif
+#endif
+
+/* Attribute of a function whose result depends only on the arguments
+   (possibly pointers) and global memory, and which has no side effects.  */
+#ifndef _UC_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+#  define _UC_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+#  define _UC_ATTRIBUTE_PURE
+# endif
+#endif
+
+/* Qualifier in a function declaration, that asserts that the caller must
+   pass a pointer to a different object in the specified pointer argument
+   than in the other pointer arguments.  */
+#ifndef _UC_RESTRICT
+# if defined __restrict \
+     || 2 < __GNUC__ + (95 <= __GNUC_MINOR__) \
+     || __clang_major__ >= 3
+#  define _UC_RESTRICT __restrict
+# elif 199901L <= __STDC_VERSION__ || defined restrict
+#  define _UC_RESTRICT restrict
+# else
+#  define _UC_RESTRICT
+# endif
+#endif
+
+#endif /* _UNITYPES_H */
diff --git a/lib/uniwidth.in.h b/lib/uniwidth.in.h
new file mode 100644 (file)
index 0000000..57e17c8
--- /dev/null
@@ -0,0 +1,72 @@
+/* Display width functions.
+   Copyright (C) 2001-2002, 2005, 2007, 2009-2021 Free Software Foundation,
+   Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _UNIWIDTH_H
+#define _UNIWIDTH_H
+
+#include "unitypes.h"
+
+/* Get size_t.  */
+#include <stddef.h>
+
+/* Get locale_charset() declaration.  */
+#include "localcharset.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Display width.  */
+
+/* These functions are locale dependent.  The encoding argument identifies
+   the encoding (e.g. "ISO-8859-2" for Polish).  */
+
+/* Determine number of column positions required for UC.  */
+extern int
+       uc_width (ucs4_t uc, const char *encoding)
+       _UC_ATTRIBUTE_PURE;
+
+/* Determine number of column positions required for first N units
+   (or fewer if S ends before this) in S.  */
+extern int
+       u8_width (const uint8_t *s, size_t n, const char *encoding)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u16_width (const uint16_t *s, size_t n, const char *encoding)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u32_width (const uint32_t *s, size_t n, const char *encoding)
+       _UC_ATTRIBUTE_PURE;
+
+/* Determine number of column positions required for S.  */
+extern int
+       u8_strwidth (const uint8_t *s, const char *encoding)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u16_strwidth (const uint16_t *s, const char *encoding)
+       _UC_ATTRIBUTE_PURE;
+extern int
+       u32_strwidth (const uint32_t *s, const char *encoding)
+       _UC_ATTRIBUTE_PURE;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _UNIWIDTH_H */
diff --git a/lib/uniwidth/cjk.h b/lib/uniwidth/cjk.h
new file mode 100644 (file)
index 0000000..c069dc5
--- /dev/null
@@ -0,0 +1,37 @@
+/* Test for CJK encoding.
+   Copyright (C) 2001-2002, 2005-2007, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2002.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include "streq.h"
+
+static int
+is_cjk_encoding (const char *encoding)
+{
+  if (0
+      /* Legacy Japanese encodings */
+      || STREQ_OPT (encoding, "EUC-JP", 'E', 'U', 'C', '-', 'J', 'P', 0, 0, 0)
+      /* Legacy Chinese encodings */
+      || STREQ_OPT (encoding, "GB2312", 'G', 'B', '2', '3', '1', '2', 0, 0, 0)
+      || STREQ_OPT (encoding, "GBK", 'G', 'B', 'K', 0, 0, 0, 0, 0, 0)
+      || STREQ_OPT (encoding, "EUC-TW", 'E', 'U', 'C', '-', 'T', 'W', 0, 0, 0)
+      || STREQ_OPT (encoding, "BIG5", 'B', 'I', 'G', '5', 0, 0, 0, 0, 0)
+      /* Legacy Korean encodings */
+      || STREQ_OPT (encoding, "EUC-KR", 'E', 'U', 'C', '-', 'K', 'R', 0, 0, 0)
+      || STREQ_OPT (encoding, "CP949", 'C', 'P', '9', '4', '9', 0, 0, 0, 0)
+      || STREQ_OPT (encoding, "JOHAB", 'J', 'O', 'H', 'A', 'B', 0, 0, 0, 0))
+    return 1;
+  return 0;
+}
diff --git a/lib/uniwidth/width.c b/lib/uniwidth/width.c
new file mode 100644 (file)
index 0000000..2bab39b
--- /dev/null
@@ -0,0 +1,468 @@
+/* Determine display width of Unicode character.
+   Copyright (C) 2001-2002, 2006-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2002.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "uniwidth.h"
+
+#include "cjk.h"
+
+/*
+ * Non-spacing attribute table.
+ * Consists of:
+ * - Non-spacing characters; generated from PropList.txt or
+ *   "grep '^[^;]*;[^;]*;[^;]*;[^;]*;NSM;' UnicodeData.txt"
+ * - Format control characters; generated from
+ *   "grep '^[^;]*;[^;]*;Cf;' UnicodeData.txt"
+ * - Zero width characters; generated from
+ *   "grep '^[^;]*;ZERO WIDTH ' UnicodeData.txt"
+ */
+static const unsigned char nonspacing_table_data[38*64] = {
+  /* 0x0000-0x01ff */
+  0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, /* 0x0000-0x003f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x0040-0x007f */
+  0xff, 0xff, 0xff, 0xff, 0x00, 0x20, 0x00, 0x00, /* 0x0080-0x00bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x00c0-0x00ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0100-0x013f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0140-0x017f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0180-0x01bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x01c0-0x01ff */
+  /* 0x0200-0x03ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0200-0x023f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0240-0x027f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0280-0x02bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x02c0-0x02ff */
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x0300-0x033f */
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, /* 0x0340-0x037f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0380-0x03bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x03c0-0x03ff */
+  /* 0x0400-0x05ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0400-0x043f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0440-0x047f */
+  0xf8, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0480-0x04bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x04c0-0x04ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0500-0x053f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0540-0x057f */
+  0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xbf, /* 0x0580-0x05bf */
+  0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x05c0-0x05ff */
+  /* 0x0600-0x07ff */
+  0x3f, 0x00, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, /* 0x0600-0x063f */
+  0x00, 0xf8, 0xff, 0xff, 0x00, 0x00, 0x01, 0x00, /* 0x0640-0x067f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0680-0x06bf */
+  0x00, 0x00, 0xc0, 0xbf, 0x9f, 0x3d, 0x00, 0x00, /* 0x06c0-0x06ff */
+  0x00, 0x80, 0x02, 0x00, 0x00, 0x00, 0xff, 0xff, /* 0x0700-0x073f */
+  0xff, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0740-0x077f */
+  0x00, 0x00, 0x00, 0x00, 0xc0, 0xff, 0x01, 0x00, /* 0x0780-0x07bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, /* 0x07c0-0x07ff */
+  /* 0x0800-0x09ff */
+  0x00, 0x00, 0xc0, 0xfb, 0xef, 0x3e, 0x00, 0x00, /* 0x0800-0x083f */
+  0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, /* 0x0840-0x087f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0880-0x08bf */
+  0x00, 0x00, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, /* 0x08c0-0x08ff */
+  0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, /* 0x0900-0x093f */
+  0xfe, 0x21, 0xfe, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0940-0x097f */
+  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0980-0x09bf */
+  0x1e, 0x20, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x09c0-0x09ff */
+  /* 0x0a00-0x0bff */
+  0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0a00-0x0a3f */
+  0x86, 0x39, 0x02, 0x00, 0x00, 0x00, 0x23, 0x00, /* 0x0a40-0x0a7f */
+  0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0a80-0x0abf */
+  0xbe, 0x21, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0ac0-0x0aff */
+  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, /* 0x0b00-0x0b3f */
+  0x1e, 0x20, 0x40, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0b40-0x0b7f */
+  0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0b80-0x0bbf */
+  0x01, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0bc0-0x0bff */
+  /* 0x0c00-0x0dff */
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, /* 0x0c00-0x0c3f */
+  0xc1, 0x3d, 0x60, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0c40-0x0c7f */
+  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x0c80-0x0cbf */
+  0x00, 0x30, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0cc0-0x0cff */
+  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0d00-0x0d3f */
+  0x1e, 0x20, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, /* 0x0d40-0x0d7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0d80-0x0dbf */
+  0x00, 0x04, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0dc0-0x0dff */
+  /* 0x0e00-0x0fff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x07, /* 0x0e00-0x0e3f */
+  0x80, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0e40-0x0e7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf2, 0x1b, /* 0x0e80-0x0ebf */
+  0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0ec0-0x0eff */
+  0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0xa0, 0x02, /* 0x0f00-0x0f3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, /* 0x0f40-0x0f7f */
+  0xdf, 0xe0, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x1f, /* 0x0f80-0x0fbf */
+  0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x0fc0-0x0fff */
+  /* 0x1000-0x11ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0xfd, 0x66, /* 0x1000-0x103f */
+  0x00, 0x00, 0x00, 0xc3, 0x01, 0x00, 0x1e, 0x00, /* 0x1040-0x107f */
+  0x64, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, /* 0x1080-0x10bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10c0-0x10ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1100-0x113f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1140-0x117f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1180-0x11bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11c0-0x11ff */
+  /* 0x1200-0x13ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1200-0x123f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1240-0x127f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1280-0x12bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x12c0-0x12ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1300-0x133f */
+  0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x00, 0x00, /* 0x1340-0x137f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1380-0x13bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x13c0-0x13ff */
+  /* 0x1600-0x17ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1600-0x163f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1640-0x167f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1680-0x16bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16c0-0x16ff */
+  0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x1c, 0x00, /* 0x1700-0x173f */
+  0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x0c, 0x00, /* 0x1740-0x177f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0x3f, /* 0x1780-0x17bf */
+  0x40, 0xfe, 0x0f, 0x20, 0x00, 0x00, 0x00, 0x00, /* 0x17c0-0x17ff */
+  /* 0x1800-0x19ff */
+  0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1800-0x183f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1840-0x187f */
+  0x60, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, /* 0x1880-0x18bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18c0-0x18ff */
+  0x00, 0x00, 0x00, 0x00, 0x87, 0x01, 0x04, 0x0e, /* 0x1900-0x193f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1940-0x197f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1980-0x19bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x19c0-0x19ff */
+  /* 0x1a00-0x1bff */
+  0x00, 0x00, 0x80, 0x09, 0x00, 0x00, 0x00, 0x00, /* 0x1a00-0x1a3f */
+  0x00, 0x00, 0x40, 0x7f, 0xe5, 0x1f, 0xf8, 0x9f, /* 0x1a40-0x1a7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, /* 0x1a80-0x1abf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1ac0-0x1aff */
+  0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x17, /* 0x1b00-0x1b3f */
+  0x04, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x0f, 0x00, /* 0x1b40-0x1b7f */
+  0x03, 0x00, 0x00, 0x00, 0x3c, 0x3b, 0x00, 0x00, /* 0x1b80-0x1bbf */
+  0x00, 0x00, 0x00, 0x00, 0x40, 0xa3, 0x03, 0x00, /* 0x1bc0-0x1bff */
+  /* 0x1c00-0x1dff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0xcf, 0x00, /* 0x1c00-0x1c3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1c40-0x1c7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1c80-0x1cbf */
+  0x00, 0x00, 0xf7, 0xff, 0xfd, 0x21, 0x10, 0x03, /* 0x1cc0-0x1cff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d00-0x1d3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d40-0x1d7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d80-0x1dbf */
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xf8, /* 0x1dc0-0x1dff */
+  /* 0x2000-0x21ff */
+  0x00, 0xf8, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, /* 0x2000-0x203f */
+  0x00, 0x00, 0x00, 0x00, 0xdf, 0xff, 0x00, 0x00, /* 0x2040-0x207f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2080-0x20bf */
+  0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, /* 0x20c0-0x20ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2100-0x213f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2140-0x217f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2180-0x21bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x21c0-0x21ff */
+  /* 0x2c00-0x2dff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c00-0x2c3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c40-0x2c7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2c80-0x2cbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0x00, /* 0x2cc0-0x2cff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2d00-0x2d3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x2d40-0x2d7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x2d80-0x2dbf */
+  0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, /* 0x2dc0-0x2dff */
+  /* 0x3000-0x31ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* 0x3000-0x303f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3040-0x307f */
+  0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, /* 0x3080-0x30bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30c0-0x30ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3100-0x313f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3140-0x317f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x3180-0x31bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x31c0-0x31ff */
+  /* 0xa600-0xa7ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa600-0xa63f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xf7, 0x3f, /* 0xa640-0xa67f */
+  0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00, /* 0xa680-0xa6bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, /* 0xa6c0-0xa6ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa700-0xa73f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa740-0xa77f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa780-0xa7bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa7c0-0xa7ff */
+  /* 0xa800-0xa9ff */
+  0x44, 0x08, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, /* 0xa800-0xa83f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa840-0xa87f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa880-0xa8bf */
+  0x30, 0x00, 0x00, 0x00, 0xff, 0xff, 0x03, 0x00, /* 0xa8c0-0xa8ff */
+  0x00, 0x00, 0x00, 0x00, 0xc0, 0x3f, 0x00, 0x00, /* 0xa900-0xa93f */
+  0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xa940-0xa97f */
+  0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc8, 0x13, /* 0xa980-0xa9bf */
+  0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, /* 0xa9c0-0xa9ff */
+  /* 0xaa00-0xabff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x66, 0x00, /* 0xaa00-0xaa3f */
+  0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0xaa40-0xaa7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9d, 0xc1, /* 0xaa80-0xaabf */
+  0x02, 0x00, 0x00, 0x00, 0x00, 0x30, 0x40, 0x00, /* 0xaac0-0xaaff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab00-0xab3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab40-0xab7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xab80-0xabbf */
+  0x00, 0x00, 0x00, 0x00, 0x20, 0x21, 0x00, 0x00, /* 0xabc0-0xabff */
+  /* 0xfa00-0xfbff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa00-0xfa3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa40-0xfa7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfa80-0xfabf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfac0-0xfaff */
+  0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, /* 0xfb00-0xfb3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfb40-0xfb7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfb80-0xfbbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfbc0-0xfbff */
+  /* 0xfe00-0xffff */
+  0xff, 0xff, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, /* 0xfe00-0xfe3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfe40-0xfe7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xfe80-0xfebf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0xfec0-0xfeff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff00-0xff3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff40-0xff7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xff80-0xffbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, /* 0xffc0-0xffff */
+  /* 0x10000-0x101ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10000-0x1003f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10040-0x1007f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10080-0x100bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x100c0-0x100ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10100-0x1013f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10140-0x1017f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10180-0x101bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, /* 0x101c0-0x101ff */
+  /* 0x10200-0x103ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10200-0x1023f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10240-0x1027f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10280-0x102bf */
+  0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, /* 0x102c0-0x102ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10300-0x1033f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x07, /* 0x10340-0x1037f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10380-0x103bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x103c0-0x103ff */
+  /* 0x10a00-0x10bff */
+  0x6e, 0xf0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x87, /* 0x10a00-0x10a3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10a40-0x10a7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10a80-0x10abf */
+  0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, /* 0x10ac0-0x10aff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b00-0x10b3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b40-0x10b7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10b80-0x10bbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10bc0-0x10bff */
+  /* 0x11000-0x111ff */
+  0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0x11000-0x1103f */
+  0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* 0x11040-0x1107f */
+  0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x26, /* 0x11080-0x110bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x110c0-0x110ff */
+  0x07, 0x00, 0x00, 0x00, 0x80, 0xef, 0x1f, 0x00, /* 0x11100-0x1113f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, /* 0x11140-0x1117f */
+  0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x7f, /* 0x11180-0x111bf */
+  0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x111c0-0x111ff */
+  /* 0x11200-0x113ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xd3, 0x40, /* 0x11200-0x1123f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11240-0x1127f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11280-0x112bf */
+  0x00, 0x00, 0x00, 0x80, 0xf8, 0x07, 0x00, 0x00, /* 0x112c0-0x112ff */
+  0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, /* 0x11300-0x1133f */
+  0x01, 0x00, 0x00, 0x00, 0xc0, 0x1f, 0x1f, 0x00, /* 0x11340-0x1137f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11380-0x113bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x113c0-0x113ff */
+  /* 0x11400-0x115ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, /* 0x11400-0x1143f */
+  0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11440-0x1147f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x85, /* 0x11480-0x114bf */
+  0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x114c0-0x114ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11500-0x1153f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11540-0x1157f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3c, 0xb0, /* 0x11580-0x115bf */
+  0x01, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, /* 0x115c0-0x115ff */
+  /* 0x11600-0x117ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0xa7, /* 0x11600-0x1163f */
+  0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11640-0x1167f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0xbf, 0x00, /* 0x11680-0x116bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x116c0-0x116ff */
+  0x00, 0x00, 0x00, 0xe0, 0xbc, 0x0f, 0x00, 0x00, /* 0x11700-0x1173f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11740-0x1177f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11780-0x117bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x117c0-0x117ff */
+  /* 0x11c00-0x11dff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x3f, /* 0x11c00-0x11c3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11c40-0x11c7f */
+  0x00, 0x00, 0xfc, 0xff, 0xff, 0xfc, 0x6d, 0x00, /* 0x11c80-0x11cbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11cc0-0x11cff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11d00-0x11d3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11d40-0x11d7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11d80-0x11dbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x11dc0-0x11dff */
+  /* 0x16a00-0x16bff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16a00-0x16a3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16a40-0x16a7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16a80-0x16abf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, /* 0x16ac0-0x16aff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x00, /* 0x16b00-0x16b3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16b40-0x16b7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16b80-0x16bbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16bc0-0x16bff */
+  /* 0x16e00-0x16fff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16e00-0x16e3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16e40-0x16e7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16e80-0x16ebf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16ec0-0x16eff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16f00-0x16f3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16f40-0x16f7f */
+  0x00, 0x80, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16f80-0x16fbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x16fc0-0x16fff */
+  /* 0x1bc00-0x1bdff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bc00-0x1bc3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bc40-0x1bc7f */
+  0x00, 0x00, 0x00, 0x60, 0x0f, 0x00, 0x00, 0x00, /* 0x1bc80-0x1bcbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bcc0-0x1bcff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bd00-0x1bd3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bd40-0x1bd7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bd80-0x1bdbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1bdc0-0x1bdff */
+  /* 0x1d000-0x1d1ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d000-0x1d03f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d040-0x1d07f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d080-0x1d0bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d0c0-0x1d0ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d100-0x1d13f */
+  0x00, 0x00, 0x00, 0x00, 0x80, 0x03, 0xf8, 0xff, /* 0x1d140-0x1d17f */
+  0xe7, 0x0f, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, /* 0x1d180-0x1d1bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d1c0-0x1d1ff */
+  /* 0x1d200-0x1d3ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d200-0x1d23f */
+  0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d240-0x1d27f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d280-0x1d2bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d2c0-0x1d2ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d300-0x1d33f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d340-0x1d37f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d380-0x1d3bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1d3c0-0x1d3ff */
+  /* 0x1da00-0x1dbff */
+  0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f, 0xf8, /* 0x1da00-0x1da3f */
+  0xff, 0xff, 0xff, 0xff, 0xff, 0x1f, 0x20, 0x00, /* 0x1da40-0x1da7f */
+  0x10, 0x00, 0x00, 0xf8, 0xfe, 0xff, 0x00, 0x00, /* 0x1da80-0x1dabf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1dac0-0x1daff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db00-0x1db3f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db40-0x1db7f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1db80-0x1dbbf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1dbc0-0x1dbff */
+  /* 0x1e000-0x1e1ff */
+  0x7f, 0xff, 0xff, 0xf9, 0xdb, 0x07, 0x00, 0x00, /* 0x1e000-0x1e03f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e040-0x1e07f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e080-0x1e0bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e0c0-0x1e0ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e100-0x1e13f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e140-0x1e17f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e180-0x1e1bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e1c0-0x1e1ff */
+  /* 0x1e800-0x1e9ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e800-0x1e83f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e840-0x1e87f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e880-0x1e8bf */
+  0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e8c0-0x1e8ff */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e900-0x1e93f */
+  0xf0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e940-0x1e97f */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x1e980-0x1e9bf */
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00  /* 0x1e9c0-0x1e9ff */
+};
+static const signed char nonspacing_table_ind[248] = {
+   0,  1,  2,  3,  4,  5,  6,  7, /* 0x0000-0x0fff */
+   8,  9, -1, 10, 11, 12, 13, -1, /* 0x1000-0x1fff */
+  14, -1, -1, -1, -1, -1, 15, -1, /* 0x2000-0x2fff */
+  16, -1, -1, -1, -1, -1, -1, -1, /* 0x3000-0x3fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x4000-0x4fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x5000-0x5fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x6000-0x6fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x7000-0x7fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x8000-0x8fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x9000-0x9fff */
+  -1, -1, -1, 17, 18, 19, -1, -1, /* 0xa000-0xafff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0xb000-0xbfff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0xc000-0xcfff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0xd000-0xdfff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0xe000-0xefff */
+  -1, -1, -1, -1, -1, 20, -1, 21, /* 0xf000-0xffff */
+  22, 23, -1, -1, -1, 24, -1, -1, /* 0x10000-0x10fff */
+  25, 26, 27, 28, -1, -1, 29, -1, /* 0x11000-0x11fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x12000-0x12fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x13000-0x13fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x14000-0x14fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x15000-0x15fff */
+  -1, -1, -1, -1, -1, 30, -1, 31, /* 0x16000-0x16fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x17000-0x17fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x18000-0x18fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x19000-0x19fff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1a000-0x1afff */
+  -1, -1, -1, -1, -1, -1, 32, -1, /* 0x1b000-0x1bfff */
+  -1, -1, -1, -1, -1, -1, -1, -1, /* 0x1c000-0x1cfff */
+  33, 34, -1, -1, -1, 35, -1, -1, /* 0x1d000-0x1dfff */
+  36, -1, -1, -1, 37, -1, -1, -1  /* 0x1e000-0x1efff */
+};
+
+/* Determine number of column positions required for UC.  */
+int
+uc_width (ucs4_t uc, const char *encoding)
+{
+  /* Test for non-spacing or control character.  */
+  if ((uc >> 9) < 248)
+    {
+      int ind = nonspacing_table_ind[uc >> 9];
+      if (ind >= 0)
+        if ((nonspacing_table_data[64*ind + ((uc >> 3) & 63)] >> (uc & 7)) & 1)
+          {
+            if (uc > 0 && uc < 0xa0)
+              return -1;
+            else
+              return 0;
+          }
+    }
+  else if ((uc >> 9) == (0xe0000 >> 9))
+    {
+      if (uc >= 0xe0100)
+        {
+          if (uc <= 0xe01ef)
+            return 0;
+        }
+      else
+        {
+          if (uc >= 0xe0020 ? uc <= 0xe007f : uc == 0xe0001)
+            return 0;
+        }
+    }
+  /* Test for double-width character.
+   * Generated from "grep '^[^;]\{4,5\};[WF]' EastAsianWidth.txt"
+   * and            "grep '^[^;]\{4,5\};[^WF]' EastAsianWidth.txt"
+   */
+  if (uc >= 0x1100
+      && ((uc < 0x1160) /* Hangul Jamo */
+          || (uc >= 0x2329 && uc < 0x232b) /* Angle Brackets */
+          || (uc >= 0x2e80 && uc < 0xa4d0  /* CJK ... Yi */
+              && !(uc == 0x303f) && !(uc >= 0x4dc0 && uc < 0x4e00))
+          || (uc >= 0xac00 && uc < 0xd7a4) /* Hangul Syllables */
+          || (uc >= 0xf900 && uc < 0xfb00) /* CJK Compatibility Ideographs */
+          || (uc >= 0xfe10 && uc < 0xfe20) /* Presentation Forms for Vertical */
+          || (uc >= 0xfe30 && uc < 0xfe70) /* CJK Compatibility Forms */
+          || (uc >= 0xff00 && uc < 0xff61) /* Fullwidth Forms */
+          || (uc >= 0xffe0 && uc < 0xffe7) /* Fullwidth Signs */
+          || (uc >= 0x20000 && uc <= 0x2ffff) /* Supplementary Ideographic Plane */
+          || (uc >= 0x30000 && uc <= 0x3ffff) /* Tertiary Ideographic Plane */
+     )   )
+    return 2;
+  /* In ancient CJK encodings, Cyrillic and most other characters are
+     double-width as well.  */
+  if (uc >= 0x00A1 && uc < 0xFF61 && uc != 0x20A9
+      && is_cjk_encoding (encoding))
+    return 2;
+  return 1;
+}
index c0ece50..ca184b3 100644 (file)
@@ -1,6 +1,6 @@
 /* Prefer faster, non-thread-safe stdio functions if available.
 
-   Copyright (C) 2001-2004, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2004, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering.  */
 
 
 # include <stdio.h>
 
-# if HAVE_DECL_CLEARERR_UNLOCKED
+# if HAVE_DECL_CLEARERR_UNLOCKED || defined clearerr_unlocked
 #  undef clearerr
 #  define clearerr(x) clearerr_unlocked (x)
 # else
 #  define clearerr_unlocked(x) clearerr (x)
 # endif
 
-# if HAVE_DECL_FEOF_UNLOCKED
+# if HAVE_DECL_FEOF_UNLOCKED || defined feof_unlocked
 #  undef feof
 #  define feof(x) feof_unlocked (x)
 # else
 #  define feof_unlocked(x) feof (x)
 # endif
 
-# if HAVE_DECL_FERROR_UNLOCKED
+# if HAVE_DECL_FERROR_UNLOCKED || defined ferror_unlocked
 #  undef ferror
 #  define ferror(x) ferror_unlocked (x)
 # else
 #  define ferror_unlocked(x) ferror (x)
 # endif
 
-# if HAVE_DECL_FFLUSH_UNLOCKED
+# if HAVE_DECL_FFLUSH_UNLOCKED || defined fflush_unlocked
 #  undef fflush
 #  define fflush(x) fflush_unlocked (x)
 # else
 #  define fflush_unlocked(x) fflush (x)
 # endif
 
-# if HAVE_DECL_FGETS_UNLOCKED
+# if HAVE_DECL_FGETS_UNLOCKED || defined fgets_unlocked
 #  undef fgets
 #  define fgets(x,y,z) fgets_unlocked (x,y,z)
 # else
 #  define fgets_unlocked(x,y,z) fgets (x,y,z)
 # endif
 
-# if HAVE_DECL_FPUTC_UNLOCKED
+# if HAVE_DECL_FPUTC_UNLOCKED || defined fputc_unlocked
 #  undef fputc
 #  define fputc(x,y) fputc_unlocked (x,y)
 # else
 #  define fputc_unlocked(x,y) fputc (x,y)
 # endif
 
-# if HAVE_DECL_FPUTS_UNLOCKED
+# if HAVE_DECL_FPUTS_UNLOCKED || defined fputs_unlocked
 #  undef fputs
 #  define fputs(x,y) fputs_unlocked (x,y)
 # else
 #  define fputs_unlocked(x,y) fputs (x,y)
 # endif
 
-# if HAVE_DECL_FREAD_UNLOCKED
+# if HAVE_DECL_FREAD_UNLOCKED || defined fread_unlocked
 #  undef fread
 #  define fread(w,x,y,z) fread_unlocked (w,x,y,z)
 # else
 #  define fread_unlocked(w,x,y,z) fread (w,x,y,z)
 # endif
 
-# if HAVE_DECL_FWRITE_UNLOCKED
+# if HAVE_DECL_FWRITE_UNLOCKED || defined fwrite_unlocked
 #  undef fwrite
 #  define fwrite(w,x,y,z) fwrite_unlocked (w,x,y,z)
 # else
 #  define fwrite_unlocked(w,x,y,z) fwrite (w,x,y,z)
 # endif
 
-# if HAVE_DECL_GETC_UNLOCKED
+# if HAVE_DECL_GETC_UNLOCKED || defined get_unlocked
 #  undef getc
 #  define getc(x) getc_unlocked (x)
 # else
 #  define getc_unlocked(x) getc (x)
 # endif
 
-# if HAVE_DECL_GETCHAR_UNLOCKED
+# if HAVE_DECL_GETCHAR_UNLOCKED || defined getchar_unlocked
 #  undef getchar
 #  define getchar() getchar_unlocked ()
 # else
 #  define getchar_unlocked() getchar ()
 # endif
 
-# if HAVE_DECL_PUTC_UNLOCKED
+# if HAVE_DECL_PUTC_UNLOCKED || defined putc_unlocked
 #  undef putc
 #  define putc(x,y) putc_unlocked (x,y)
 # else
 #  define putc_unlocked(x,y) putc (x,y)
 # endif
 
-# if HAVE_DECL_PUTCHAR_UNLOCKED
+# if HAVE_DECL_PUTCHAR_UNLOCKED || defined putchar_unlocked
 #  undef putchar
 #  define putchar(x) putchar_unlocked (x)
 # else
similarity index 80%
rename from build-aux/snippet/unused-parameter.h
rename to lib/unused-parameter.h
index 843db76..5da19c5 100644 (file)
@@ -1,5 +1,5 @@
 /* A C macro for declaring that specific function parameters are not used.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published
@@ -12,7 +12,7 @@
    General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* _GL_UNUSED_PARAMETER is a marker that can be appended to function parameter
    declarations for parameters that are not used.  This helps to reduce
@@ -28,9 +28,5 @@
        _GL_UNUSED_PARAMETER int *(*param)(void)
  */
 #ifndef _GL_UNUSED_PARAMETER
-# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-#  define _GL_UNUSED_PARAMETER __attribute__ ((__unused__))
-# else
-#  define _GL_UNUSED_PARAMETER
-# endif
+# define _GL_UNUSED_PARAMETER _GL_ATTRIBUTE_MAYBE_UNUSED
 #endif
index f85c69d..a3e0cd1 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 1999, 2002-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* This file can be parametrized with the following macros:
      VASNPRINTF         The name of the function being defined.
      DCHAR_CONV_FROM_ENCODING A function to convert from char[] to DCHAR[].
      DCHAR_IS_UINT8_T   Set to 1 if DCHAR_T is uint8_t.
      DCHAR_IS_UINT16_T  Set to 1 if DCHAR_T is uint16_t.
-     DCHAR_IS_UINT32_T  Set to 1 if DCHAR_T is uint32_t.  */
+     DCHAR_IS_UINT32_T  Set to 1 if DCHAR_T is uint32_t.
+     ENABLE_UNISTDIO    Set to 1 to enable the unistdio extensions.
+     ENABLE_WCHAR_FALLBACK  Set to 1 to avoid EILSEQ during conversion of wide
+                        characters (wchar_t) and wide character strings
+                        (wchar_t[]) to multibyte sequences.  The fallback is the
+                        hexadecimal escape syntax (\unnnn or \Unnnnnnnn) or,
+                        if wchar_t is not Unicode encoded, \wnnnn or \Wnnnnnnnn.
+ */
 
 /* Tell glibc's <stdio.h> to provide a prototype for snprintf().
    This must come before <config.h> because <config.h> may include
@@ -87,6 +94,7 @@
 /* Checked size_t computations.  */
 #include "xsize.h"
 
+#include "attribute.h"
 #include "verify.h"
 
 #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
 #   define SNPRINTF snwprintf
 #  else
 #   define SNPRINTF _snwprintf
+#   define USE_MSVC__SNPRINTF 1
 #  endif
 # else
    /* Unix.  */
     /* Here we need to call the native snprintf, not rpl_snprintf.  */
 #   undef snprintf
 #  else
+    /* MSVC versions < 14 did not have snprintf, only _snprintf.  */
 #   define SNPRINTF _snprintf
+#   define USE_MSVC__SNPRINTF 1
 #  endif
 # else
    /* Unix.  */
 #undef remainder
 #define remainder rem
 
-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && !WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && !WIDE_CHAR_VERSION
 # if (HAVE_STRNLEN && !defined _AIX)
 #  define local_strnlen strnlen
 # else
@@ -224,7 +235,7 @@ local_strnlen (const char *string, size_t maxlen)
 # endif
 #endif
 
-#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T
+#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && WIDE_CHAR_VERSION) || ((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && !WIDE_CHAR_VERSION && DCHAR_IS_TCHAR)) && HAVE_WCHAR_T
 # if HAVE_WCSLEN
 #  define local_wcslen wcslen
 # else
@@ -247,7 +258,7 @@ local_wcslen (const wchar_t *s)
 # endif
 #endif
 
-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99) && HAVE_WCHAR_T && WIDE_CHAR_VERSION
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF) && HAVE_WCHAR_T && WIDE_CHAR_VERSION
 # if HAVE_WCSNLEN
 #  define local_wcsnlen wcsnlen
 # else
@@ -266,6 +277,74 @@ local_wcsnlen (const wchar_t *s, size_t maxlen)
 # endif
 #endif
 
+#if (((!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T) || (ENABLE_WCHAR_FALLBACK && HAVE_WINT_T)) && !WIDE_CHAR_VERSION
+# if ENABLE_WCHAR_FALLBACK
+static size_t
+wctomb_fallback (char *s, wchar_t wc)
+{
+  static char hex[16] = "0123456789ABCDEF";
+
+  s[0] = '\\';
+  if (sizeof (wchar_t) > 2 && wc > 0xffff)
+    {
+#  if __STDC_ISO_10646__ || (__GLIBC__ >= 2) || (defined _WIN32 || defined __CYGWIN__)
+      s[1] = 'U';
+#  else
+      s[1] = 'W';
+#  endif
+      s[2] = hex[(wc & 0xf0000000U) >> 28];
+      s[3] = hex[(wc & 0xf000000U) >> 24];
+      s[4] = hex[(wc & 0xf00000U) >> 20];
+      s[5] = hex[(wc & 0xf0000U) >> 16];
+      s[6] = hex[(wc & 0xf000U) >> 12];
+      s[7] = hex[(wc & 0xf00U) >> 8];
+      s[8] = hex[(wc & 0xf0U) >> 4];
+      s[9] = hex[wc & 0xfU];
+      return 10;
+    }
+  else
+    {
+#  if __STDC_ISO_10646__ || (__GLIBC__ >= 2) || (defined _WIN32 || defined __CYGWIN__)
+      s[1] = 'u';
+#  else
+      s[1] = 'w';
+#  endif
+      s[2] = hex[(wc & 0xf000U) >> 12];
+      s[3] = hex[(wc & 0xf00U) >> 8];
+      s[4] = hex[(wc & 0xf0U) >> 4];
+      s[5] = hex[wc & 0xfU];
+      return 6;
+    }
+}
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+static size_t
+local_wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
+{
+  size_t count = wcrtomb (s, wc, ps);
+  if (count == (size_t)(-1))
+    count = wctomb_fallback (s, wc);
+  return count;
+}
+#  else
+static int
+local_wctomb (char *s, wchar_t wc)
+{
+  int count = wctomb (s, wc);
+  if (count < 0)
+    count = wctomb_fallback (s, wc);
+  return count;
+}
+#   define local_wcrtomb(S, WC, PS)  local_wctomb ((S), (WC))
+#  endif
+# else
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+#   define local_wcrtomb(S, WC, PS)  wcrtomb ((S), (WC), (PS))
+#  else
+#   define local_wcrtomb(S, WC, PS)  wctomb ((S), (WC))
+#  endif
+# endif
+#endif
+
 #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
 /* Determine the decimal-point character according to the current locale.  */
 # ifndef decimal_point_char_defined
@@ -554,7 +633,8 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
         mp_limb_t msd = b_ptr[b_len - 1]; /* = b[n-1], > 0 */
         /* Determine s = GMP_LIMB_BITS - integer_length (msd).
            Code copied from gnulib's integer_length.c.  */
-# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) \
+     || (__clang_major__ >= 4)
         s = __builtin_clz (msd);
 # else
 #  if defined DBL_EXPBIT0_WORD && defined DBL_EXPBIT0_BIT
@@ -849,7 +929,9 @@ convert_to_decimal (mpn_t a, size_t extra_zeroes)
   size_t a_len = a.nlimbs;
   /* 0.03345 is slightly larger than log(2)/(9*log(10)).  */
   size_t c_len = 9 * ((size_t)(a_len * (GMP_LIMB_BITS * 0.03345f)) + 1);
-  char *c_ptr = (char *) malloc (xsum (c_len, extra_zeroes));
+  /* We need extra_zeroes bytes for zeroes, followed by c_len bytes for the
+     digits of a, followed by 1 byte for the terminating NUL.  */
+  char *c_ptr = (char *) malloc (xsum (xsum (extra_zeroes, c_len), 1));
   if (c_ptr != NULL)
     {
       char *d_ptr = c_ptr;
@@ -1517,7 +1599,7 @@ is_borderline (const char *digits, size_t precision)
 
 #endif
 
-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
 
 /* Use a different function name, to make it possible that the 'wchar_t'
    parametrization and the 'char' parametrization get compiled in the same
@@ -1540,16 +1622,13 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
   switch (conversion)
     {
     case 'd': case 'i': case 'u':
-# if HAVE_LONG_LONG_INT
       if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
         tmp_length =
           (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
                           * 0.30103 /* binary -> decimal */
                          )
           + 1; /* turn floor into ceil */
-      else
-# endif
-      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+      else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
         tmp_length =
           (unsigned int) (sizeof (unsigned long) * CHAR_BIT
                           * 0.30103 /* binary -> decimal */
@@ -1570,16 +1649,13 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
       break;
 
     case 'o':
-# if HAVE_LONG_LONG_INT
       if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
         tmp_length =
           (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
                           * 0.333334 /* binary -> octal */
                          )
           + 1; /* turn floor into ceil */
-      else
-# endif
-      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+      else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
         tmp_length =
           (unsigned int) (sizeof (unsigned long) * CHAR_BIT
                           * 0.333334 /* binary -> octal */
@@ -1598,16 +1674,13 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
       break;
 
     case 'x': case 'X':
-# if HAVE_LONG_LONG_INT
       if (type == TYPE_LONGLONGINT || type == TYPE_ULONGLONGINT)
         tmp_length =
           (unsigned int) (sizeof (unsigned long long) * CHAR_BIT
                           * 0.25 /* binary -> hexadecimal */
                          )
           + 1; /* turn floor into ceil */
-      else
-# endif
-      if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
+      else if (type == TYPE_LONGINT || type == TYPE_ULONGINT)
         tmp_length =
           (unsigned int) (sizeof (unsigned long) * CHAR_BIT
                           * 0.25 /* binary -> hexadecimal */
@@ -1673,7 +1746,13 @@ MAX_ROOM_NEEDED (const arguments *ap, size_t arg_index, FCHAR_T conversion,
     case 'c':
 # if HAVE_WINT_T && !WIDE_CHAR_VERSION
       if (type == TYPE_WIDE_CHAR)
-        tmp_length = MB_CUR_MAX;
+        {
+          tmp_length = MB_CUR_MAX;
+#  if ENABLE_WCHAR_FALLBACK
+          if (tmp_length < (sizeof (wchar_t) > 2 ? 10 : 6))
+            tmp_length = (sizeof (wchar_t) > 2 ? 10 : 6);
+#  endif
+        }
       else
 # endif
         tmp_length = 1;
@@ -1780,6 +1859,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
     /* errno is already set.  */
     return NULL;
 
+  /* Frees the memory allocated by this function.  Preserves errno.  */
 #define CLEANUP() \
   if (d.dir != d.direct_alloc_dir)                                      \
     free (d.dir);                                                       \
@@ -1926,11 +2006,9 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   case TYPE_COUNT_LONGINT_POINTER:
                     *a.arg[dp->arg_index].a.a_count_longint_pointer = length;
                     break;
-#if HAVE_LONG_LONG_INT
                   case TYPE_COUNT_LONGLONGINT_POINTER:
                     *a.arg[dp->arg_index].a.a_count_longlongint_pointer = length;
                     break;
-#endif
                   default:
                     abort ();
                   }
@@ -2106,13 +2184,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #  endif
                         if (converted == NULL)
                           {
-                            int saved_errno = errno;
                             if (!(result == resultbuf || result == NULL))
                               free (result);
                             if (buf_malloced != NULL)
                               free (buf_malloced);
                             CLEANUP ();
-                            errno = saved_errno;
                             return NULL;
                           }
                         if (converted != result + length)
@@ -2232,13 +2308,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #  endif
                         if (converted == NULL)
                           {
-                            int saved_errno = errno;
                             if (!(result == resultbuf || result == NULL))
                               free (result);
                             if (buf_malloced != NULL)
                               free (buf_malloced);
                             CLEANUP ();
-                            errno = saved_errno;
                             return NULL;
                           }
                         if (converted != result + length)
@@ -2358,13 +2432,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #  endif
                         if (converted == NULL)
                           {
-                            int saved_errno = errno;
                             if (!(result == resultbuf || result == NULL))
                               free (result);
                             if (buf_malloced != NULL)
                               free (buf_malloced);
                             CLEANUP ();
-                            errno = saved_errno;
                             return NULL;
                           }
                         if (converted != result + length)
@@ -2392,7 +2464,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   }
               }
 #endif
-#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL)) && HAVE_WCHAR_T
+#if (!USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || (NEED_PRINTF_DIRECTIVE_LS && !defined IN_LIBINTL) || ENABLE_WCHAR_FALLBACK) && HAVE_WCHAR_T
             else if (dp->conversion == 's'
 # if WIDE_CHAR_VERSION
                      && a.arg[dp->arg_index].type != TYPE_WIDE_STRING
@@ -2667,11 +2739,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                           if (*arg_end == 0)
                             /* Found the terminating null wide character.  */
                             break;
-#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
-                          count = wcrtomb (cbuf, *arg_end, &state);
-#  else
-                          count = wctomb (cbuf, *arg_end);
-#  endif
+                          count = local_wcrtomb (cbuf, *arg_end, &state);
                           if (count < 0)
                             {
                               /* Cannot convert.  */
@@ -2683,7 +2751,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                               errno = EILSEQ;
                               return NULL;
                             }
-                          if (precision < count)
+                          if (precision < (unsigned int) count)
                             break;
                           arg_end++;
                           characters += count;
@@ -2712,11 +2780,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                           if (*arg_end == 0)
                             /* Found the terminating null wide character.  */
                             break;
-#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
-                          count = wcrtomb (cbuf, *arg_end, &state);
-#  else
-                          count = wctomb (cbuf, *arg_end);
-#  endif
+                          count = local_wcrtomb (cbuf, *arg_end, &state);
                           if (count < 0)
                             {
                               /* Cannot convert.  */
@@ -2761,11 +2825,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 
                         if (*arg == 0)
                           abort ();
-#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
-                        count = wcrtomb (cbuf, *arg, &state);
-#   else
-                        count = wctomb (cbuf, *arg);
-#   endif
+                        count = local_wcrtomb (cbuf, *arg, &state);
                         if (count <= 0)
                           /* Inconsistency.  */
                           abort ();
@@ -2787,14 +2847,12 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                               NULL, &tmpdst_len);
                   if (tmpdst == NULL)
                     {
-                      int saved_errno = errno;
                       free (tmpsrc);
                       if (!(result == resultbuf || result == NULL))
                         free (result);
                       if (buf_malloced != NULL)
                         free (buf_malloced);
                       CLEANUP ();
-                      errno = saved_errno;
                       return NULL;
                     }
                   free (tmpsrc);
@@ -2842,11 +2900,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 
                           if (*arg == 0)
                             abort ();
-#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
-                          count = wcrtomb (cbuf, *arg, &state);
-#   else
-                          count = wctomb (cbuf, *arg);
-#   endif
+                          count = local_wcrtomb (cbuf, *arg, &state);
                           if (count <= 0)
                             /* Inconsistency.  */
                             abort ();
@@ -2871,11 +2925,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 
                           if (*arg == 0)
                             abort ();
-#   if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
-                          count = wcrtomb (cbuf, *arg, &state);
-#   else
-                          count = wctomb (cbuf, *arg);
-#   endif
+                          count = local_wcrtomb (cbuf, *arg, &state);
                           if (count <= 0)
                             {
                               /* Cannot convert.  */
@@ -2911,6 +2961,208 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 # endif
               }
 #endif
+#if ENABLE_WCHAR_FALLBACK && HAVE_WINT_T && !WIDE_CHAR_VERSION
+            else if (dp->conversion == 'c'
+                     && a.arg[dp->arg_index].type == TYPE_WIDE_CHAR)
+              {
+                /* Implement the 'lc' directive ourselves, in order to provide
+                   the fallback that avoids EILSEQ.  */
+                int flags = dp->flags;
+                int has_width;
+                size_t width;
+
+                has_width = 0;
+                width = 0;
+                if (dp->width_start != dp->width_end)
+                  {
+                    if (dp->width_arg_index != ARG_NONE)
+                      {
+                        int arg;
+
+                        if (!(a.arg[dp->width_arg_index].type == TYPE_INT))
+                          abort ();
+                        arg = a.arg[dp->width_arg_index].a.a_int;
+                        width = arg;
+                        if (arg < 0)
+                          {
+                            /* "A negative field width is taken as a '-' flag
+                                followed by a positive field width."  */
+                            flags |= FLAG_LEFT;
+                            width = -width;
+                          }
+                      }
+                    else
+                      {
+                        const FCHAR_T *digitp = dp->width_start;
+
+                        do
+                          width = xsum (xtimes (width, 10), *digitp++ - '0');
+                        while (digitp != dp->width_end);
+                      }
+                    has_width = 1;
+                  }
+
+                /* %lc in vasnprintf.  See the specification of fprintf.  */
+                {
+                  wchar_t arg = (wchar_t) a.arg[dp->arg_index].a.a_wide_char;
+                  size_t characters;
+# if !DCHAR_IS_TCHAR
+                  /* This code assumes that TCHAR_T is 'char'.  */
+                  verify (sizeof (TCHAR_T) == 1);
+                  TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64.  */
+                  DCHAR_T *tmpdst;
+                  size_t tmpdst_len;
+# endif
+                  size_t w;
+
+# if DCHAR_IS_TCHAR
+                  if (has_width)
+# endif
+                    {
+                      /* Count the number of bytes.  */
+                      characters = 0;
+                      if (arg != 0)
+                        {
+                          char cbuf[64]; /* Assume MB_CUR_MAX <= 64.  */
+                          int count;
+# if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                          mbstate_t state;
+                          memset (&state, '\0', sizeof (mbstate_t));
+# endif
+
+                          count = local_wcrtomb (cbuf, arg, &state);
+                          if (count < 0)
+                            /* Inconsistency.  */
+                            abort ();
+                          characters = count;
+                        }
+                    }
+# if DCHAR_IS_TCHAR
+                  else
+                    {
+                      /* The number of bytes doesn't matter.  */
+                      characters = 0;
+                    }
+# endif
+
+# if !DCHAR_IS_TCHAR
+                  /* Convert the string into a piece of temporary memory.  */
+                  if (characters > 0) /* implies arg != 0 */
+                    {
+                      char cbuf[64]; /* Assume MB_CUR_MAX <= 64.  */
+                      int count;
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                      mbstate_t state;
+                      memset (&state, '\0', sizeof (mbstate_t));
+#  endif
+
+                      count = local_wcrtomb (cbuf, arg, &state);
+                      if (count <= 0)
+                        /* Inconsistency.  */
+                        abort ();
+                      memcpy (tmpsrc, cbuf, count);
+                    }
+
+                  /* Convert from TCHAR_T[] to DCHAR_T[].  */
+                  tmpdst =
+                    DCHAR_CONV_FROM_ENCODING (locale_charset (),
+                                              iconveh_question_mark,
+                                              tmpsrc, characters,
+                                              NULL,
+                                              NULL, &tmpdst_len);
+                  if (tmpdst == NULL)
+                    {
+                      if (!(result == resultbuf || result == NULL))
+                        free (result);
+                      if (buf_malloced != NULL)
+                        free (buf_malloced);
+                      CLEANUP ();
+                      return NULL;
+                    }
+# endif
+
+                  if (has_width)
+                    {
+# if ENABLE_UNISTDIO
+                      /* Outside POSIX, it's preferable to compare the width
+                         against the number of _characters_ of the converted
+                         value.  */
+                      w = DCHAR_MBSNLEN (result + length, characters);
+# else
+                      /* The width is compared against the number of _bytes_
+                         of the converted value, says POSIX.  */
+                      w = characters;
+# endif
+                    }
+                  else
+                    /* w doesn't matter.  */
+                    w = 0;
+
+                  if (w < width && !(dp->flags & FLAG_LEFT))
+                    {
+                      size_t n = width - w;
+                      ENSURE_ALLOCATION (xsum (length, n));
+                      DCHAR_SET (result + length, ' ', n);
+                      length += n;
+                    }
+
+# if DCHAR_IS_TCHAR
+                  if (has_width)
+                    {
+                      /* We know the number of bytes in advance.  */
+                      ENSURE_ALLOCATION (xsum (length, characters));
+                      if (characters > 0) /* implies arg != 0 */
+                        {
+                          int count;
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                          mbstate_t state;
+                          memset (&state, '\0', sizeof (mbstate_t));
+#  endif
+
+                          count = local_wcrtomb (result + length, arg, &state);
+                          if (count <= 0)
+                            /* Inconsistency.  */
+                            abort ();
+                          length += count;
+                        }
+                    }
+                  else
+                    {
+                      if (arg != 0)
+                        {
+                          char cbuf[64]; /* Assume MB_CUR_MAX <= 64.  */
+                          int count;
+#  if HAVE_WCRTOMB && !defined GNULIB_defined_mbstate_t
+                          mbstate_t state;
+                          memset (&state, '\0', sizeof (mbstate_t));
+#  endif
+
+                          count = local_wcrtomb (cbuf, arg, &state);
+                          if (count <= 0)
+                            /* Inconsistency.  */
+                            abort ();
+                          ENSURE_ALLOCATION (xsum (length, count));
+                          memcpy (result + length, cbuf, count);
+                          length += count;
+                        }
+                    }
+# else
+                  ENSURE_ALLOCATION (xsum (length, tmpdst_len));
+                  DCHAR_CPY (result + length, tmpdst, tmpdst_len);
+                  free (tmpdst);
+                  length += tmpdst_len;
+# endif
+
+                  if (w < width && (dp->flags & FLAG_LEFT))
+                    {
+                      size_t n = width - w;
+                      ENSURE_ALLOCATION (xsum (length, n));
+                      DCHAR_SET (result + length, ' ', n);
+                      length += n;
+                    }
+                }
+              }
+#endif
 #if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE) && !defined IN_LIBINTL
             else if ((dp->conversion == 'a' || dp->conversion == 'A')
 # if !(NEED_PRINTF_DIRECTIVE_A || (NEED_PRINTF_LONG_DOUBLE && NEED_PRINTF_DOUBLE))
@@ -4232,7 +4484,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                   static const wchar_t decimal_format[] =
                                     /* Produce the same number of exponent digits
                                        as the native printf implementation.  */
-#    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#    if defined _WIN32 && ! defined __CYGWIN__
                                     { '%', '+', '.', '3', 'd', '\0' };
 #    else
                                     { '%', '+', '.', '2', 'd', '\0' };
@@ -4246,7 +4498,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                   static const char decimal_format[] =
                                     /* Produce the same number of exponent digits
                                        as the native printf implementation.  */
-#    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#    if defined _WIN32 && ! defined __CYGWIN__
                                     "%+.3d";
 #    else
                                     "%+.2d";
@@ -4425,7 +4677,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                           static const wchar_t decimal_format[] =
                                             /* Produce the same number of exponent digits
                                                as the native printf implementation.  */
-#    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#    if defined _WIN32 && ! defined __CYGWIN__
                                             { '%', '+', '.', '3', 'd', '\0' };
 #    else
                                             { '%', '+', '.', '2', 'd', '\0' };
@@ -4439,7 +4691,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                           static const char decimal_format[] =
                                             /* Produce the same number of exponent digits
                                                as the native printf implementation.  */
-#    if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#    if defined _WIN32 && ! defined __CYGWIN__
                                             "%+.3d";
 #    else
                                             "%+.2d";
@@ -4497,7 +4749,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                 *p++ = '+';
                                 /* Produce the same number of exponent digits as
                                    the native printf implementation.  */
-#   if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#   if defined _WIN32 && ! defined __CYGWIN__
                                 *p++ = '0';
 #   endif
                                 *p++ = '0';
@@ -4591,10 +4843,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
                 int has_width;
 #endif
-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
                 size_t width;
 #endif
-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
                 int has_precision;
                 size_t precision;
 #endif
@@ -4623,7 +4875,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #if !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
                 has_width = 0;
 #endif
-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || !DCHAR_IS_TCHAR || ENABLE_UNISTDIO || NEED_PRINTF_FLAG_LEFTADJUST || NEED_PRINTF_FLAG_ZERO || NEED_PRINTF_UNBOUNDED_PRECISION
                 width = 0;
                 if (dp->width_start != dp->width_end)
                   {
@@ -4657,7 +4909,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   }
 #endif
 
-#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || NEED_PRINTF_UNBOUNDED_PRECISION
+#if !USE_SNPRINTF || !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF || NEED_PRINTF_UNBOUNDED_PRECISION
                 has_precision = 0;
                 precision = 6;
                 if (dp->precision_start != dp->precision_end)
@@ -4822,19 +5074,17 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 
                 switch (type)
                   {
-#if HAVE_LONG_LONG_INT
                   case TYPE_LONGLONGINT:
                   case TYPE_ULONGLONGINT:
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
                     *fbp++ = 'I';
                     *fbp++ = '6';
                     *fbp++ = '4';
                     break;
-# else
+#else
                     *fbp++ = 'l';
-# endif
 #endif
-                    /*FALLTHROUGH*/
+                    FALLTHROUGH;
                   case TYPE_LONGINT:
                   case TYPE_ULONGINT:
 #if HAVE_WINT_T
@@ -4858,20 +5108,32 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 #endif
                   *fbp = dp->conversion;
 #if USE_SNPRINTF
-# if !(((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) && !defined __UCLIBC__) || ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__))
-                fbp[1] = '%';
-                fbp[2] = 'n';
-                fbp[3] = '\0';
-# else
-                /* On glibc2 systems from glibc >= 2.3 - probably also older
-                   ones - we know that snprintf's return value conforms to
-                   ISO C 99: the tests gl_SNPRINTF_RETVAL_C99 and
-                   gl_SNPRINTF_TRUNCATION_C99 pass.
-                   Therefore we can avoid using %n in this situation.
-                   On glibc2 systems from 2004-10-18 or newer, the use of %n
-                   in format strings in writable memory may crash the program
-                   (if compiled with _FORTIFY_SOURCE=2), so we should avoid it
-                   in this situation.  */
+# if ((HAVE_SNPRINTF_RETVAL_C99 && HAVE_SNPRINTF_TRUNCATION_C99)            \
+      || ((__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3))       \
+          && !defined __UCLIBC__)                                           \
+      || (defined __APPLE__ && defined __MACH__)                            \
+      || defined __ANDROID__                                                \
+      || (defined _WIN32 && ! defined __CYGWIN__))
+                /* On systems where we know that snprintf's return value
+                   conforms to ISO C 99 (HAVE_SNPRINTF_RETVAL_C99) and that
+                   snprintf always produces NUL-terminated strings
+                   (HAVE_SNPRINTF_TRUNCATION_C99), it is possible to avoid
+                   using %n.  And it is desirable to do so, because more and
+                   more platforms no longer support %n, for "security reasons".
+                   In particular, the following platforms:
+                     - On glibc2 systems from 2004-10-18 or newer, the use of
+                       %n in format strings in writable memory may crash the
+                       program (if compiled with _FORTIFY_SOURCE=2).
+                     - On Mac OS X 10.13 or newer, the use of %n in format
+                       strings in writable memory by default crashes the
+                       program.
+                     - On Android, starting on 2018-03-07, the use of %n in
+                       format strings produces a fatal error (see
+                       <https://android.googlesource.com/platform/bionic/+/41398d03b7e8e0dfb951660ae713e682e9fc0336>).
+                   On these platforms, HAVE_SNPRINTF_RETVAL_C99 and
+                   HAVE_SNPRINTF_TRUNCATION_C99 are 1. We have listed them
+                   explicitly in the condition above, in case of cross-
+                   compilation (just to be sure).  */
                 /* On native Windows systems (such as mingw), we can avoid using
                    %n because:
                      - Although the gl_SNPRINTF_TRUNCATION_C99 test fails,
@@ -4884,10 +5146,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                    On native Windows systems (such as mingw) where the OS is
                    Windows Vista, the use of %n in format strings by default
                    crashes the program. See
-                     <http://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
-                     <http://msdn2.microsoft.com/en-us/library/ms175782(VS.80).aspx>
+                     <https://gcc.gnu.org/ml/gcc/2007-06/msg00122.html> and
+                     <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-printf-count-output>
                    So we should avoid %n in this situation.  */
                 fbp[1] = '\0';
+# else           /* AIX <= 5.1, HP-UX, IRIX, OSF/1, Solaris <= 9, BeOS */
+                fbp[1] = '%';
+                fbp[2] = 'n';
+                fbp[3] = '\0';
 # endif
 #else
                 fbp[1] = '\0';
@@ -5031,7 +5297,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                           SNPRINTF_BUF (arg);
                         }
                         break;
-#if HAVE_LONG_LONG_INT
                       case TYPE_LONGLONGINT:
                         {
                           long long int arg = a.arg[dp->arg_index].a.a_longlongint;
@@ -5044,7 +5309,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                           SNPRINTF_BUF (arg);
                         }
                         break;
-#endif
                       case TYPE_DOUBLE:
                         {
                           double arg = a.arg[dp->arg_index].a.a_double;
@@ -5104,7 +5368,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                       {
                         /* Verify that snprintf() has NUL-terminated its
                            result.  */
-                        if (count < maxlen
+                        if ((unsigned int) count < maxlen
                             && ((TCHAR_T *) (result + length)) [count] != '\0')
                           abort ();
                         /* Portability hack.  */
@@ -5127,7 +5391,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                             /* Look at the snprintf() return value.  */
                             if (retcount < 0)
                               {
-# if !HAVE_SNPRINTF_RETVAL_C99
+# if !HAVE_SNPRINTF_RETVAL_C99 || USE_MSVC__SNPRINTF
                                 /* HP-UX 10.20 snprintf() is doubly deficient:
                                    It doesn't understand the '%n' directive,
                                    *and* it returns -1 (rather than the length
@@ -5176,15 +5440,14 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                     /* Attempt to handle failure.  */
                     if (count < 0)
                       {
-                        /* SNPRINTF or sprintf failed.  Save and use the errno
-                           that it has set, if any.  */
-                        int saved_errno = errno;
-                        if (saved_errno == 0)
+                        /* SNPRINTF or sprintf failed.  Use the errno that it
+                           has set, if any.  */
+                        if (errno == 0)
                           {
                             if (dp->conversion == 'c' || dp->conversion == 's')
-                              saved_errno = EILSEQ;
+                              errno = EILSEQ;
                             else
-                              saved_errno = EINVAL;
+                              errno = EINVAL;
                           }
 
                         if (!(result == resultbuf || result == NULL))
@@ -5193,7 +5456,6 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                           free (buf_malloced);
                         CLEANUP ();
 
-                        errno = saved_errno;
                         return NULL;
                       }
 
@@ -5329,13 +5591,11 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                                                     NULL, &tmpdst_len);
                         if (tmpdst == NULL)
                           {
-                            int saved_errno = errno;
                             if (!(result == resultbuf || result == NULL))
                               free (result);
                             if (buf_malloced != NULL)
                               free (buf_malloced);
                             CLEANUP ();
-                            errno = saved_errno;
                             return NULL;
                           }
                         ENSURE_ALLOCATION (xsum (length, tmpdst_len));
index 8e9d84f..863bde9 100644 (file)
@@ -1,5 +1,5 @@
 /* vsprintf with automatic memory allocation.
-   Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _VASNPRINTF_H
 #define _VASNPRINTF_H
 /* Get size_t.  */
 #include <stddef.h>
 
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
-   The __-protected variants of the attributes 'format' and 'printf' are
-   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
-   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
-   gnulib and libintl do '#define printf __printf__' when they override
-   the 'printf' function.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD.  */
+#include <stdio.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -67,10 +58,12 @@ extern "C" {
 # define asnprintf rpl_asnprintf
 # define vasnprintf rpl_vasnprintf
 #endif
-extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...)
-       _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 4));
-extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args)
-       _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0));
+extern char * asnprintf (char *restrict resultbuf, size_t *lengthp,
+                         const char *format, ...)
+       _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 4));
+extern char * vasnprintf (char *restrict resultbuf, size_t *lengthp,
+                          const char *format, va_list args)
+       _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
 
 #ifdef __cplusplus
 }
index a5dc1be..df1a2c2 100644 (file)
@@ -1,5 +1,5 @@
 /* Formatted output to strings.
-   Copyright (C) 1999, 2002, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 5c8381d..65514c3 100644 (file)
@@ -1,6 +1,6 @@
 /* Compile-time assert-like macros.
 
-   Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert, Bruno Haible, and Jim Meyering.  */
 
 #define _GL_VERIFY_H
 
 
-/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert works as per C11.
-   This is supported by GCC 4.6.0 and later, in C mode, and its use
-   here generates easier-to-read diagnostics when verify (R) fails.
+/* Define _GL_HAVE__STATIC_ASSERT to 1 if _Static_assert (R, DIAGNOSTIC)
+   works as per C11.  This is supported by GCC 4.6.0+ and by clang 4+.
 
-   Define _GL_HAVE_STATIC_ASSERT to 1 if static_assert works as per C++11.
-   This will likely be supported by future GCC versions, in C++ mode.
+   Define _GL_HAVE__STATIC_ASSERT1 to 1 if _Static_assert (R) works as
+   per C2X.  This is supported by GCC 9.1+.
 
-   Use this only with GCC.  If we were willing to slow 'configure'
-   down we could also use it with other compilers, but since this
-   affects only the quality of diagnostics, why bother?  */
-#if (4 < __GNUC__ + (6 <= __GNUC_MINOR__) \
-     && (201112L <= __STDC_VERSION__  || !defined __STRICT_ANSI__) \
-     && !defined __cplusplus)
-# define _GL_HAVE__STATIC_ASSERT 1
-#endif
-/* The condition (99 < __GNUC__) is temporary, until we know about the
-   first G++ release that supports static_assert.  */
-#if (99 < __GNUC__) && defined __cplusplus
-# define _GL_HAVE_STATIC_ASSERT 1
+   Support compilers claiming conformance to the relevant standard,
+   and also support GCC when not pedantic.  If we were willing to slow
+   'configure' down we could also use it with other compilers, but
+   since this affects only the quality of diagnostics, why bother?  */
+#ifndef __cplusplus
+# if (201112L <= __STDC_VERSION__ \
+      || (!defined __STRICT_ANSI__ \
+          && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 4 <= __clang_major__)))
+#  define _GL_HAVE__STATIC_ASSERT 1
+# endif
+# if (202000L <= __STDC_VERSION__ \
+      || (!defined __STRICT_ANSI__ && 9 <= __GNUC__))
+#  define _GL_HAVE__STATIC_ASSERT1 1
+# endif
 #endif
 
 /* FreeBSD 9.1 <sys/cdefs.h>, included by <stddef.h> and lots of other
    system headers, defines a conflicting _Static_assert that is no
    better than ours; override it.  */
-#ifndef _GL_HAVE_STATIC_ASSERT
+#ifndef _GL_HAVE__STATIC_ASSERT
 # include <stddef.h>
 # undef _Static_assert
 #endif
      which do not support _Static_assert, also do not warn about the
      last declaration mentioned above.
 
-   * GCC warns if -Wnested-externs is enabled and verify() is used
+   * GCC warns if -Wnested-externs is enabled and 'verify' is used
      within a function body; but inside a function, you can always
-     arrange to use verify_expr() instead.
+     arrange to use verify_expr instead.
 
    * In C++, any struct definition inside sizeof is invalid.
      Use a template type to work around the problem.  */
@@ -197,48 +198,63 @@ template <int w>
 #endif
 
 /* Verify requirement R at compile-time, as a declaration without a
-   trailing ';'.  If R is false, fail at compile-time, preferably
-   with a diagnostic that includes the string-literal DIAGNOSTIC.
+   trailing ';'.  If R is false, fail at compile-time.
+
+   This macro requires three or more arguments but uses at most the first
+   two, so that the _Static_assert macro optionally defined below supports
+   both the C11 two-argument syntax and the C2X one-argument syntax.
 
    Unfortunately, unlike C11, this implementation must appear as an
    ordinary declaration, and cannot appear inside struct { ... }.  */
 
-#ifdef _GL_HAVE__STATIC_ASSERT
-# define _GL_VERIFY _Static_assert
+#if 200410 <= __cpp_static_assert
+# define _GL_VERIFY(R, DIAGNOSTIC, ...) static_assert (R, DIAGNOSTIC)
+#elif defined _GL_HAVE__STATIC_ASSERT
+# define _GL_VERIFY(R, DIAGNOSTIC, ...) _Static_assert (R, DIAGNOSTIC)
 #else
-# define _GL_VERIFY(R, DIAGNOSTIC)                                    \
+# define _GL_VERIFY(R, DIAGNOSTIC, ...)                                \
     extern int (*_GL_GENSYM (_gl_verify_function) (void))             \
       [_GL_VERIFY_TRUE (R, DIAGNOSTIC)]
 #endif
 
 /* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h.  */
 #ifdef _GL_STATIC_ASSERT_H
-# if !defined _GL_HAVE__STATIC_ASSERT && !defined _Static_assert
-#  define _Static_assert(R, DIAGNOSTIC) _GL_VERIFY (R, DIAGNOSTIC)
+# if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
+#  define _Static_assert(...) \
+     _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
 # endif
-# if !defined _GL_HAVE_STATIC_ASSERT && !defined static_assert
+# if __cpp_static_assert < 201411 && !defined static_assert
 #  define static_assert _Static_assert /* C11 requires this #define.  */
 # endif
 #endif
 
 /* @assert.h omit start@  */
 
+#if 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))
+# define _GL_HAS_BUILTIN_TRAP 1
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_TRAP __has_builtin (__builtin_trap)
+#else
+# define _GL_HAS_BUILTIN_TRAP 0
+#endif
+
+#if 4 < __GNUC__ + (5 <= __GNUC_MINOR__)
+# define _GL_HAS_BUILTIN_UNREACHABLE 1
+#elif defined __has_builtin
+# define _GL_HAS_BUILTIN_UNREACHABLE __has_builtin (__builtin_unreachable)
+#else
+# define _GL_HAS_BUILTIN_UNREACHABLE 0
+#endif
+
 /* Each of these macros verifies that its argument R is nonzero.  To
    be portable, R should be an integer constant expression.  Unlike
    assert (R), there is no run-time overhead.
 
    There are two macros, since no single macro can be used in all
-   contexts in C.  verify_true (R) is for scalar contexts, including
+   contexts in C.  verify_expr (R, E) is for scalar contexts, including
    integer constant expression contexts.  verify (R) is for declaration
    contexts, e.g., the top level.  */
 
-/* Verify requirement R at compile-time, as an integer constant expression.
-   Return 1.  This is equivalent to verify_expr (R, 1).
-
-   verify_true is obsolescent; please use verify_expr instead.  */
-
-#define verify_true(R) _GL_VERIFY_TRUE (R, "verify_true (" #R ")")
-
 /* Verify requirement R at compile-time.  Return the value of the
    expression E.  */
 
@@ -246,32 +262,52 @@ template <int w>
    (_GL_VERIFY_TRUE (R, "verify_expr (" #R ", " #E ")") ? (E) : (E))
 
 /* Verify requirement R at compile-time, as a declaration without a
-   trailing ';'.  */
-
-#define verify(R) _GL_VERIFY (R, "verify (" #R ")")
+   trailing ';'.  verify (R) acts like static_assert (R) except that
+   it is portable to C11/C++14 and earlier, it can issue better
+   diagnostics, and its name is shorter and may be more convenient.  */
 
-#ifndef __has_builtin
-# define __has_builtin(x) 0
+#ifdef __PGI
+/* PGI barfs if R is long.  */
+# define verify(R) _GL_VERIFY (R, "verify (...)", -)
+#else
+# define verify(R) _GL_VERIFY (R, "verify (" #R ")", -)
 #endif
 
-/* Assume that R always holds.  This lets the compiler optimize
-   accordingly.  R should not have side-effects; it may or may not be
-   evaluated.  Behavior is undefined if R is false.  */
+/* Assume that R always holds.  Behavior is undefined if R is false,
+   fails to evaluate, or has side effects.
+
+   'assume (R)' is a directive from the programmer telling the
+   compiler that R is true so the compiler needn't generate code to
+   test R.  This is why 'assume' is in verify.h: it's related to
+   static checking (in this case, static checking done by the
+   programmer), not dynamic checking.
+
+   'assume (R)' can affect compilation of all the code, not just code
+   that happens to be executed after the assume (R) is "executed".
+   For example, if the code mistakenly does 'assert (R); assume (R);'
+   the compiler is entitled to optimize away the 'assert (R)'.
+
+   Although assuming R can help a compiler generate better code or
+   diagnostics, performance can suffer if R uses hard-to-optimize
+   features such as function calls not inlined by the compiler.
+
+   Avoid Clang's __builtin_assume, as it breaks GNU Emacs master
+   as of 2020-08-23T21:09:49Z!eggert@cs.ucla.edu; see
+   <https://bugs.gnu.org/43152#71>.  It's not known whether this breakage
+   is a Clang bug or an Emacs bug; play it safe for now.  */
 
-#if (__has_builtin (__builtin_unreachable) \
-     || 4 < __GNUC__ + (5 <= __GNUC_MINOR__))
+#if _GL_HAS_BUILTIN_UNREACHABLE
 # define assume(R) ((R) ? (void) 0 : __builtin_unreachable ())
 #elif 1200 <= _MSC_VER
 # define assume(R) __assume (R)
-#elif ((defined GCC_LINT || defined lint) \
-       && (__has_builtin (__builtin_trap) \
-           || 3 < __GNUC__ + (3 < __GNUC_MINOR__ + (4 <= __GNUC_PATCHLEVEL__))))
+#elif (defined GCC_LINT || defined lint) && _GL_HAS_BUILTIN_TRAP
   /* Doing it this way helps various packages when configured with
      --enable-gcc-warnings, which compiles with -Dlint.  It's nicer
      when 'assume' silences warnings even with older GCCs.  */
 # define assume(R) ((R) ? (void) 0 : __builtin_trap ())
 #else
-# define assume(R) ((void) (0 && (R)))
+  /* Some tools grok NOTREACHED, e.g., Oracle Studio 12.6.  */
+# define assume(R) ((R) ? (void) 0 : /*NOTREACHED*/ (void) 0)
 #endif
 
 /* @assert.h omit end@  */
index 1abf3fe..5217029 100644 (file)
@@ -1,5 +1,5 @@
 /* va_list error handler for noninteractive utilities
-   Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
 #include <config.h>
 
+/* Specification.  */
 #include "verror.h"
-#include "xvasprintf.h"
 
 #include <errno.h>
 #include <stdarg.h>
 #include <stdlib.h>
 
+#include "error.h"
+#include "xvasprintf.h"
+
 #if ENABLE_NLS
 # include "gettext.h"
 # define _(msgid) gettext (msgid)
@@ -58,7 +61,7 @@ verror_at_line (int status, int errnum, const char *file,
   char *message = xvasprintf (format, args);
   if (message)
     {
-      /* Until http://sourceware.org/bugzilla/show_bug.cgi?id=2997 is fixed,
+      /* Until https://sourceware.org/bugzilla/show_bug.cgi?id=2997 is fixed,
          glibc violates GNU Coding Standards when the file argument to
          error_at_line is NULL.  */
       if (file)
index 6d5123a..e952d8a 100644 (file)
@@ -1,5 +1,5 @@
 /* Declaration for va_list error-reporting function
-   Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _VERROR_H
 #define _VERROR_H 1
 
 #include <stdarg.h>
 
-#include "error.h" /* for _GL_ATTRIBUTE_FORMAT */
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD.  */
+#include <stdio.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -33,7 +34,7 @@ extern "C" {
 
 extern void verror (int __status, int __errnum, const char *__format,
                     va_list __args)
-     _GL_ATTRIBUTE_FORMAT ((__printf__, 3, 0));
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 3, 0));
 
 /* Print a message with 'vfprintf (stderr, FORMAT, ARGS)';
    if ERRNUM is nonzero, follow it with ": " and strerror (ERRNUM).
@@ -45,7 +46,7 @@ extern void verror (int __status, int __errnum, const char *__format,
 extern void verror_at_line (int __status, int __errnum, const char *__fname,
                             unsigned int __lineno, const char *__format,
                             va_list __args)
-     _GL_ATTRIBUTE_FORMAT ((__printf__, 5, 0));
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 5, 0));
 
 #ifdef __cplusplus
 }
index baaebb6..4d03f56 100644 (file)
@@ -1,5 +1,5 @@
 /* Variable with FSF copyright information, for version-etc.
-   Copyright (C) 1999-2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999-2006, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering. */
 
index a9a0fdb..525691d 100644 (file)
@@ -1,5 +1,5 @@
 /* Print --version and bug-reporting information in a consistent format.
-   Copyright (C) 1999-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering. */
 
@@ -23,7 +23,6 @@
 
 #include <stdarg.h>
 #include <stdio.h>
-#include <stdlib.h>
 
 #if USE_UNLOCKED_IO
 # include "unlocked-io.h"
@@ -38,7 +37,7 @@
 # define PACKAGE PACKAGE_TARNAME
 #endif
 
-enum { COPYRIGHT_YEAR = 2016 };
+enum { COPYRIGHT_YEAR = 2021 };
 
 /* The three functions below display the --version information the
    standard way.
@@ -83,20 +82,24 @@ version_etc_arn (FILE *stream,
      locale.  Otherwise, do not translate "(C)"; leave it as-is.  */
   fprintf (stream, version_etc_copyright, _("(C)"), COPYRIGHT_YEAR);
 
-  fputs (_("\
-\n\
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n\
+  fputs ("\n", stream);
+
+  /* TRANSLATORS: The %s placeholder is the web address of the GPL license.  */
+  fprintf (stream, _("\
+License GPLv3+: GNU GPL version 3 or later <%s>.\n\
 This is free software: you are free to change and redistribute it.\n\
 There is NO WARRANTY, to the extent permitted by law.\n\
-\n\
 "),
-         stream);
+           "https://gnu.org/licenses/gpl.html");
+
+  fputs ("\n", stream);
 
   switch (n_authors)
     {
     case 0:
-      /* The caller must provide at least one author name.  */
-      abort ();
+      /* No authors are given.  The caller should output authorship
+         info after calling this function.  */
+      break;
     case 1:
       /* TRANSLATORS: %s denotes an author name.  */
       fprintf (stream, _("Written by %s.\n"), authors[0]);
@@ -238,11 +241,12 @@ version_etc (FILE *stream,
 void
 emit_bug_reporting_address (void)
 {
+  fputs ("\n", stdout);
   /* TRANSLATORS: The placeholder indicates the bug-reporting address
      for this package.  Please add _another line_ saying
      "Report translation bugs to <...>\n" with the address for translation
      bugs (typically your translation team's web or email address).  */
-  printf (_("\nReport bugs to: %s\n"), PACKAGE_BUGREPORT);
+  printf (_("Report bugs to: %s\n"), PACKAGE_BUGREPORT);
 #ifdef PACKAGE_PACKAGER_BUG_REPORTS
   printf (_("Report %s bugs to: %s\n"), PACKAGE_PACKAGER,
           PACKAGE_PACKAGER_BUG_REPORTS);
@@ -250,9 +254,9 @@ emit_bug_reporting_address (void)
 #ifdef PACKAGE_URL
   printf (_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
 #else
-  printf (_("%s home page: <http://www.gnu.org/software/%s/>\n"),
-          PACKAGE_NAME, PACKAGE);
+  printf (_("%s home page: <%s>\n"),
+          PACKAGE_NAME, "https://www.gnu.org/software/" PACKAGE "/");
 #endif
-  fputs (_("General help using GNU software: <http://www.gnu.org/gethelp/>\n"),
-         stdout);
+  printf (_("General help using GNU software: <%s>\n"),
+          "https://www.gnu.org/gethelp/");
 }
index 1a5f603..2b4ee2c 100644 (file)
@@ -1,5 +1,5 @@
 /* Print --version and bug-reporting information in a consistent format.
-   Copyright (C) 1999, 2003, 2005, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2003, 2005, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering. */
 
 # include <stdarg.h>
 # include <stdio.h>
 
-/* The 'sentinel' attribute was added in gcc 4.0.  */
-#ifndef _GL_ATTRIBUTE_SENTINEL
-# if 4 <= __GNUC__
-#  define _GL_ATTRIBUTE_SENTINEL __attribute__ ((__sentinel__))
-# else
-#  define _GL_ATTRIBUTE_SENTINEL /* empty */
-# endif
-#endif
-
 extern const char version_etc_copyright[];
 
 /* The three functions below display the --version information in the
@@ -70,7 +61,7 @@ extern void version_etc (FILE *stream,
                          const char *command_name, const char *package,
                          const char *version,
                          /* const char *author1, ..., NULL */ ...)
-  _GL_ATTRIBUTE_SENTINEL;
+  _GL_ATTRIBUTE_SENTINEL ((0));
 
 /* Display the usual "Report bugs to" stanza.  */
 extern void emit_bug_reporting_address (void);
diff --git a/lib/w32spawn.h b/lib/w32spawn.h
deleted file mode 100644 (file)
index 389054a..0000000
+++ /dev/null
@@ -1,229 +0,0 @@
-/* Auxiliary functions for the creation of subprocesses.  Native Windows API.
-   Copyright (C) 2001, 2003-2016 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2003.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef __KLIBC__
-/* Get declarations of the native Windows API functions.  */
-# define WIN32_LEAN_AND_MEAN
-# include <windows.h>
-#endif
-
-/* Get _open_osfhandle().  */
-#include <io.h>
-
-#include <stdbool.h>
-#include <string.h>
-#include <unistd.h>
-#include <errno.h>
-
-/* Get _get_osfhandle().  */
-#include "msvc-nothrow.h"
-
-#include "cloexec.h"
-#include "xalloc.h"
-
-/* Duplicates a file handle, making the copy uninheritable.
-   Returns -1 for a file handle that is equivalent to closed.  */
-static int
-dup_noinherit (int fd)
-{
-  fd = dup_cloexec (fd);
-  if (fd < 0 && errno == EMFILE)
-    error (EXIT_FAILURE, errno, _("_open_osfhandle failed"));
-
-  return fd;
-}
-
-/* Returns a file descriptor equivalent to FD, except that the resulting file
-   descriptor is none of STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO.
-   FD must be open and non-inheritable.  The result will be non-inheritable as
-   well.
-   If FD < 0, FD itself is returned.  */
-static int
-fd_safer_noinherit (int fd)
-{
-  if (STDIN_FILENO <= fd && fd <= STDERR_FILENO)
-    {
-      /* The recursion depth is at most 3.  */
-      int nfd = fd_safer_noinherit (dup_noinherit (fd));
-      int saved_errno = errno;
-      close (fd);
-      errno = saved_errno;
-      return nfd;
-    }
-  return fd;
-}
-
-/* Duplicates a file handle, making the copy uninheritable and ensuring the
-   result is none of STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO.
-   Returns -1 for a file handle that is equivalent to closed.  */
-static int
-dup_safer_noinherit (int fd)
-{
-  return fd_safer_noinherit (dup_noinherit (fd));
-}
-
-/* Undoes the effect of TEMPFD = dup_safer_noinherit (ORIGFD);  */
-static void
-undup_safer_noinherit (int tempfd, int origfd)
-{
-  if (tempfd >= 0)
-    {
-      if (dup2 (tempfd, origfd) < 0)
-        error (EXIT_FAILURE, errno, _("cannot restore fd %d: dup2 failed"),
-               origfd);
-      close (tempfd);
-    }
-  else
-    {
-      /* origfd was closed or open to no handle at all.  Set it to a closed
-         state.  This is (nearly) equivalent to the original state.  */
-      close (origfd);
-    }
-}
-
-/* Prepares an argument vector before calling spawn().
-   Note that spawn() does not by itself call the command interpreter
-     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
-      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-         GetVersionEx(&v);
-         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
-      }) ? "cmd.exe" : "command.com").
-   Instead it simply concatenates the arguments, separated by ' ', and calls
-   CreateProcess().  We must quote the arguments since Windows CreateProcess()
-   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
-   special way:
-   - Space and tab are interpreted as delimiters. They are not treated as
-     delimiters if they are surrounded by double quotes: "...".
-   - Unescaped double quotes are removed from the input. Their only effect is
-     that within double quotes, space and tab are treated like normal
-     characters.
-   - Backslashes not followed by double quotes are not special.
-   - But 2*n+1 backslashes followed by a double quote become
-     n backslashes followed by a double quote (n >= 0):
-       \" -> "
-       \\\" -> \"
-       \\\\\" -> \\"
-   - '*', '?' characters may get expanded through wildcard expansion in the
-     callee: By default, in the callee, the initialization code before main()
-     takes the result of GetCommandLine(), wildcard-expands it, and passes it
-     to main(). The exceptions to this rule are:
-       - programs that inspect GetCommandLine() and ignore argv,
-       - mingw programs that have a global variable 'int _CRT_glob = 0;',
-       - Cygwin programs, when invoked from a Cygwin program.
- */
-#ifndef __KLIBC__
-# define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037*?"
-# define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
-#else
-# define SHELL_SPECIAL_CHARS ""
-# define SHELL_SPACE_CHARS ""
-#endif
-static char **
-prepare_spawn (char **argv)
-{
-  size_t argc;
-  char **new_argv;
-  size_t i;
-
-  /* Count number of arguments.  */
-  for (argc = 0; argv[argc] != NULL; argc++)
-    ;
-
-  /* Allocate new argument vector.  */
-  new_argv = XNMALLOC (1 + argc + 1, char *);
-
-  /* Add an element upfront that can be used when argv[0] turns out to be a
-     script, not a program.
-     On Unix, this would be "/bin/sh". On native Windows, "sh" is actually
-     "sh.exe".  We have to omit the directory part and rely on the search in
-     PATH, because the mingw "mount points" are not visible inside Windows
-     CreateProcess().  */
-  *new_argv++ = "sh.exe";
-
-  /* Put quoted arguments into the new argument vector.  */
-  for (i = 0; i < argc; i++)
-    {
-      const char *string = argv[i];
-
-      if (string[0] == '\0')
-        new_argv[i] = xstrdup ("\"\"");
-      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
-        {
-          bool quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
-          size_t length;
-          unsigned int backslashes;
-          const char *s;
-          char *quoted_string;
-          char *p;
-
-          length = 0;
-          backslashes = 0;
-          if (quote_around)
-            length++;
-          for (s = string; *s != '\0'; s++)
-            {
-              char c = *s;
-              if (c == '"')
-                length += backslashes + 1;
-              length++;
-              if (c == '\\')
-                backslashes++;
-              else
-                backslashes = 0;
-            }
-          if (quote_around)
-            length += backslashes + 1;
-
-          quoted_string = (char *) xmalloc (length + 1);
-
-          p = quoted_string;
-          backslashes = 0;
-          if (quote_around)
-            *p++ = '"';
-          for (s = string; *s != '\0'; s++)
-            {
-              char c = *s;
-              if (c == '"')
-                {
-                  unsigned int j;
-                  for (j = backslashes + 1; j > 0; j--)
-                    *p++ = '\\';
-                }
-              *p++ = c;
-              if (c == '\\')
-                backslashes++;
-              else
-                backslashes = 0;
-            }
-          if (quote_around)
-            {
-              unsigned int j;
-              for (j = backslashes; j > 0; j--)
-                *p++ = '\\';
-              *p++ = '"';
-            }
-          *p = '\0';
-
-          new_argv[i] = quoted_string;
-        }
-      else
-        new_argv[i] = (char *) string;
-    }
-  new_argv[argc] = NULL;
-
-  return new_argv;
-}
index d081385..bbf5de2 100644 (file)
@@ -1,5 +1,5 @@
 /* Waiting for a subprocess to finish.
-   Copyright (C) 2001-2003, 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
 #include <config.h>
 #define SIZEOF(a) (sizeof(a) / sizeof(a[0]))
 
 
-#if defined _MSC_VER || defined __MINGW32__
+#if defined _WIN32 && ! defined __CYGWIN__
 
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
 
-/* The return value of spawnvp() is really a process handle as returned
+/* The return value of _spawnvp() is really a process handle as returned
    by CreateProcess().  Therefore we can kill it using TerminateProcess.  */
-#define kill(pid,sig) TerminateProcess ((HANDLE) (pid), sig)
+# define kill(pid,sig) TerminateProcess ((HANDLE) (pid), sig)
 
 #endif
 
@@ -80,7 +80,7 @@ static size_t slaves_allocated = SIZEOF (static_slaves);
 #endif
 
 /* The cleanup action.  It gets called asynchronously.  */
-static void
+static _GL_ASYNC_SAFE void
 cleanup_slaves (void)
 {
   for (;;)
@@ -102,6 +102,14 @@ cleanup_slaves (void)
     }
 }
 
+/* The cleanup action, taking a signal argument.
+   It gets called asynchronously.  */
+static _GL_ASYNC_SAFE void
+cleanup_slaves_action (int sig _GL_UNUSED)
+{
+  cleanup_slaves ();
+}
+
 /* Register a subprocess as being a slave process.  This means that the
    subprocess will be terminated when its creator receives a catchable fatal
    signal or exits normally.  Registration ends when wait_subprocess()
@@ -113,7 +121,8 @@ register_slave_subprocess (pid_t child)
   if (!cleanup_slaves_registered)
     {
       atexit (cleanup_slaves);
-      at_fatal_signal (cleanup_slaves);
+      if (at_fatal_signal (cleanup_slaves_action) < 0)
+        xalloc_die ();
       cleanup_slaves_registered = true;
     }
 
index 50dbb89..1a3567a 100644 (file)
@@ -1,5 +1,5 @@
 /* Waiting for a subprocess to finish.
-   Copyright (C) 2001-2003, 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2006, 2008-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _WAIT_PROCESS_H
 #define _WAIT_PROCESS_H
index 162ade8..f0311f0 100644 (file)
@@ -1,5 +1,5 @@
 /* Wait for process state change.
-   Copyright (C) 2001-2003, 2005-2016 Free Software Foundation, Inc.
+   Copyright (C) 2001-2003, 2005-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/lib/warn-on-use.h b/lib/warn-on-use.h
new file mode 100644 (file)
index 0000000..5d5b17f
--- /dev/null
@@ -0,0 +1,149 @@
+/* A C macro for emitting warnings if a function is used.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
+   for FUNCTION which will then trigger a compiler warning containing
+   the text of "literal string" anywhere that function is called, if
+   supported by the compiler.  If the compiler does not support this
+   feature, the macro expands to an unused extern declaration.
+
+   _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
+   attribute used in _GL_WARN_ON_USE.  If the compiler does not support
+   this feature, it expands to empty.
+
+   These macros are useful for marking a function as a potential
+   portability trap, with the intent that "literal string" include
+   instructions on the replacement function that should be used
+   instead.
+   _GL_WARN_ON_USE is for functions with 'extern' linkage.
+   _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
+   linkage.
+
+   However, one of the reasons that a function is a portability trap is
+   if it has the wrong signature.  Declaring FUNCTION with a different
+   signature in C is a compilation error, so this macro must use the
+   same type as any existing declaration so that programs that avoid
+   the problematic FUNCTION do not fail to compile merely because they
+   included a header that poisoned the function.  But this implies that
+   _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
+   have a declaration.  Use of this macro implies that there must not
+   be any other macro hiding the declaration of FUNCTION; but
+   undefining FUNCTION first is part of the poisoning process anyway
+   (although for symbols that are provided only via a macro, the result
+   is a compilation error rather than a warning containing
+   "literal string").  Also note that in C++, it is only safe to use if
+   FUNCTION has no overloads.
+
+   For an example, it is possible to poison 'getline' by:
+   - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
+     [getline]) in configure.ac, which potentially defines
+     HAVE_RAW_DECL_GETLINE
+   - adding this code to a header that wraps the system <stdio.h>:
+     #undef getline
+     #if HAVE_RAW_DECL_GETLINE
+     _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
+       "not universally present; use the gnulib module getline");
+     #endif
+
+   It is not possible to directly poison global variables.  But it is
+   possible to write a wrapper accessor function, and poison that
+   (less common usage, like &environ, will cause a compilation error
+   rather than issue the nice warning, but the end result of informing
+   the developer about their portability problem is still achieved):
+     #if HAVE_RAW_DECL_ENVIRON
+     static char ***
+     rpl_environ (void) { return &environ; }
+     _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
+     # undef environ
+     # define environ (*rpl_environ ())
+     #endif
+   or better (avoiding contradictory use of 'static' and 'extern'):
+     #if HAVE_RAW_DECL_ENVIRON
+     static char ***
+     _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
+     rpl_environ (void) { return &environ; }
+     # undef environ
+     # define environ (*rpl_environ ())
+     #endif
+   */
+#ifndef _GL_WARN_ON_USE
+
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
+  __attribute__ ((__warning__ (message)))
+# elif __clang_major__ >= 4
+/* Another compiler attribute is available in clang.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function \
+  __attribute__ ((__diagnose_if__ (1, message, "warning")))
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
+  __attribute__ ((__diagnose_if__ (1, message, "warning")))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message)
+# else /* Unsupported.  */
+#  define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message)
+# endif
+#endif
+
+/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
+   is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
+   function is declared with the given prototype, consisting of return type,
+   parameters, and attributes.
+   This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
+   not work in this case.  */
+#ifndef _GL_WARN_ON_USE_CXX
+# if !defined __cplusplus
+#  define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+     _GL_WARN_ON_USE (function, msg)
+# else
+#  if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
+#   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_gcc function parameters_and_attributes \
+  __attribute__ ((__warning__ (msg)))
+#  elif __clang_major__ >= 4
+/* Another compiler attribute is available in clang.  */
+#   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_clang function parameters_and_attributes \
+  __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+#  elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function.  */
+#   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_gcc function parameters_and_attributes
+#  else /* Unsupported.  */
+#   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+#  endif
+# endif
+#endif
+
+/* _GL_WARN_EXTERN_C declaration;
+   performs the declaration with C linkage.  */
+#ifndef _GL_WARN_EXTERN_C
+# if defined __cplusplus
+#  define _GL_WARN_EXTERN_C extern "C"
+# else
+#  define _GL_WARN_EXTERN_C extern
+# endif
+#endif
index 07dbdcb..d2cd489 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wchar.h>, for platforms that have issues.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
 /*
  * ISO C 99 <wchar.h> for platforms that have issues.
- * <http://www.opengroup.org/susv3xbd/wchar.h.html>
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wchar.h.html>
  *
  * For now, this just ensures proper prerequisite inclusion order and
  * the declaration of wcwidth().
 @PRAGMA_COLUMNS@
 
 #if (((defined __need_mbstate_t || defined __need_wint_t)               \
-      && !defined __MINGW32__ && !defined __KLIBC__)                    \
+      && !defined __MINGW32__)                                          \
      || (defined __hpux                                                 \
-         && ((defined _INTTYPES_INCLUDED && !defined strtoimax)         \
+         && ((defined _INTTYPES_INCLUDED                                \
+              && !defined _GL_FINISHED_INCLUDING_SYSTEM_INTTYPES_H)     \
              || defined _GL_JUST_INCLUDE_SYSTEM_WCHAR_H))               \
      || (defined __MINGW32__ && defined __STRING_H_SOURCED__)           \
      || defined _GL_ALREADY_INCLUDING_WCHAR_H)
 # include <features.h> /* for __GLIBC__ */
 #endif
 
-/* 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>.
-   In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
+/* In some builds of uClibc, <wchar.h> is nonexistent and wchar_t is defined
    by <stddef.h>.
    But avoid namespace pollution on glibc systems.  */
 #if !(defined __GLIBC__ && !defined __UCLIBC__)
 # include <stddef.h>
 #endif
-#ifndef __GLIBC__
-# include <stdio.h>
-# include <time.h>
-#endif
 
 /* Include the original <wchar.h> if it exists.
    Some builds of uClibc lack it.  */
 
 /* The __attribute__ feature is available in gcc versions 2.5 and later.
    The attribute __pure__ was added in gcc 2.96.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
-#else
-# define _GL_ATTRIBUTE_PURE /* empty */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96) || defined __clang__
+#  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+#  define _GL_ATTRIBUTE_PURE /* empty */
+# endif
 #endif
 
 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 #  define WEOF -1
 # endif
 #else
-/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h>.
-   This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
-   "unchanged by default argument promotions".  Override it.  */
-# if @GNULIB_OVERRIDES_WINT_T@
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
+   <stddef.h>.  This is too small: ISO C 99 section 7.24.1.(2) says that
+   wint_t must be "unchanged by default argument promotions".  Override it.  */
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
 #  if !GNULIB_defined_wint_t
-#   include <crtdefs.h>
+#   if @HAVE_CRTDEFS_H@
+#    include <crtdefs.h>
+#   else
+#    include <stddef.h>
+#   endif
 typedef unsigned int rpl_wint_t;
 #   undef wint_t
 #   define wint_t rpl_wint_t
@@ -133,12 +132,16 @@ typedef unsigned int rpl_wint_t;
 
 /* Override mbstate_t if it is too small.
    On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
-   implementing mbrtowc for encodings like UTF-8.  */
-#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+   implementing mbrtowc for encodings like UTF-8.
+   On AIX and MSVC, mbrtowc needs to be overridden, but mbstate_t exists and is
+   large enough and overriding it would cause problems in C++ mode.  */
+#if !(((defined _WIN32 && !defined __CYGWIN__) || @HAVE_MBSINIT@) && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
 # if !GNULIB_defined_mbstate_t
+#  if !(defined _AIX || defined _MSC_VER)
 typedef int rpl_mbstate_t;
-#  undef mbstate_t
-#  define mbstate_t rpl_mbstate_t
+#   undef mbstate_t
+#   define mbstate_t rpl_mbstate_t
+#  endif
 #  define GNULIB_defined_mbstate_t 1
 # endif
 #endif
@@ -157,9 +160,12 @@ _GL_CXXALIAS_RPL (btowc, wint_t, (int c));
 #  if !@HAVE_BTOWC@
 _GL_FUNCDECL_SYS (btowc, wint_t, (int c) _GL_ATTRIBUTE_PURE);
 #  endif
-_GL_CXXALIAS_SYS (btowc, wint_t, (int c));
+/* Need to cast, because on mingw, the return type is 'unsigned short'.  */
+_GL_CXXALIAS_SYS_CAST (btowc, wint_t, (int c));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (btowc);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef btowc
 # if HAVE_RAW_DECL_BTOWC
@@ -185,7 +191,9 @@ _GL_FUNCDECL_SYS (wctob, int, (wint_t wc) _GL_ATTRIBUTE_PURE);
 #  endif
 _GL_CXXALIAS_SYS (wctob, int, (wint_t wc));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wctob);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wctob
 # if HAVE_RAW_DECL_WCTOB
@@ -210,7 +218,9 @@ _GL_FUNCDECL_SYS (mbsinit, int, (const mbstate_t *ps));
 #  endif
 _GL_CXXALIAS_SYS (mbsinit, int, (const mbstate_t *ps));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (mbsinit);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbsinit
 # if HAVE_RAW_DECL_MBSINIT
@@ -228,18 +238,24 @@ _GL_WARN_ON_USE (mbsinit, "mbsinit is unportable - "
 #   define mbrtowc rpl_mbrtowc
 #  endif
 _GL_FUNCDECL_RPL (mbrtowc, size_t,
-                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+                  (wchar_t *restrict pwc, const char *restrict s, size_t n,
+                   mbstate_t *restrict ps));
 _GL_CXXALIAS_RPL (mbrtowc, size_t,
-                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+                  (wchar_t *restrict pwc, const char *restrict s, size_t n,
+                   mbstate_t *restrict ps));
 # else
 #  if !@HAVE_MBRTOWC@
 _GL_FUNCDECL_SYS (mbrtowc, size_t,
-                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+                  (wchar_t *restrict pwc, const char *restrict s, size_t n,
+                   mbstate_t *restrict ps));
 #  endif
 _GL_CXXALIAS_SYS (mbrtowc, size_t,
-                  (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps));
+                  (wchar_t *restrict pwc, const char *restrict s, size_t n,
+                   mbstate_t *restrict ps));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (mbrtowc);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbrtowc
 # if HAVE_RAW_DECL_MBRTOWC
@@ -256,15 +272,21 @@ _GL_WARN_ON_USE (mbrtowc, "mbrtowc is unportable - "
 #   undef mbrlen
 #   define mbrlen rpl_mbrlen
 #  endif
-_GL_FUNCDECL_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
-_GL_CXXALIAS_RPL (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+_GL_FUNCDECL_RPL (mbrlen, size_t,
+                  (const char *restrict s, size_t n, mbstate_t *restrict ps));
+_GL_CXXALIAS_RPL (mbrlen, size_t,
+                  (const char *restrict s, size_t n, mbstate_t *restrict ps));
 # else
 #  if !@HAVE_MBRLEN@
-_GL_FUNCDECL_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+_GL_FUNCDECL_SYS (mbrlen, size_t,
+                  (const char *restrict s, size_t n, mbstate_t *restrict ps));
 #  endif
-_GL_CXXALIAS_SYS (mbrlen, size_t, (const char *s, size_t n, mbstate_t *ps));
+_GL_CXXALIAS_SYS (mbrlen, size_t,
+                  (const char *restrict s, size_t n, mbstate_t *restrict ps));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (mbrlen);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbrlen
 # if HAVE_RAW_DECL_MBRLEN
@@ -282,22 +304,30 @@ _GL_WARN_ON_USE (mbrlen, "mbrlen is unportable - "
 #   define mbsrtowcs rpl_mbsrtowcs
 #  endif
 _GL_FUNCDECL_RPL (mbsrtowcs, size_t,
-                  (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
+                  (wchar_t *restrict dest,
+                   const char **restrict srcp, size_t len,
+                   mbstate_t *restrict ps)
                   _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (mbsrtowcs, size_t,
-                  (wchar_t *dest, const char **srcp, size_t len,
-                   mbstate_t *ps));
+                  (wchar_t *restrict dest,
+                   const char **restrict srcp, size_t len,
+                   mbstate_t *restrict ps));
 # else
 #  if !@HAVE_MBSRTOWCS@
 _GL_FUNCDECL_SYS (mbsrtowcs, size_t,
-                  (wchar_t *dest, const char **srcp, size_t len, mbstate_t *ps)
+                  (wchar_t *restrict dest,
+                   const char **restrict srcp, size_t len,
+                   mbstate_t *restrict ps)
                   _GL_ARG_NONNULL ((2)));
 #  endif
 _GL_CXXALIAS_SYS (mbsrtowcs, size_t,
-                  (wchar_t *dest, const char **srcp, size_t len,
-                   mbstate_t *ps));
+                  (wchar_t *restrict dest,
+                   const char **restrict srcp, size_t len,
+                   mbstate_t *restrict ps));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (mbsrtowcs);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef mbsrtowcs
 # if HAVE_RAW_DECL_MBSRTOWCS
@@ -315,22 +345,26 @@ _GL_WARN_ON_USE (mbsrtowcs, "mbsrtowcs is unportable - "
 #   define mbsnrtowcs rpl_mbsnrtowcs
 #  endif
 _GL_FUNCDECL_RPL (mbsnrtowcs, size_t,
-                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
-                   mbstate_t *ps)
+                  (wchar_t *restrict dest,
+                   const char **restrict srcp, size_t srclen, size_t len,
+                   mbstate_t *restrict ps)
                   _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (mbsnrtowcs, size_t,
-                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
-                   mbstate_t *ps));
+                  (wchar_t *restrict dest,
+                   const char **restrict srcp, size_t srclen, size_t len,
+                   mbstate_t *restrict ps));
 # else
 #  if !@HAVE_MBSNRTOWCS@
 _GL_FUNCDECL_SYS (mbsnrtowcs, size_t,
-                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
-                   mbstate_t *ps)
+                  (wchar_t *restrict dest,
+                   const char **restrict srcp, size_t srclen, size_t len,
+                   mbstate_t *restrict ps)
                   _GL_ARG_NONNULL ((2)));
 #  endif
 _GL_CXXALIAS_SYS (mbsnrtowcs, size_t,
-                  (wchar_t *dest, const char **srcp, size_t srclen, size_t len,
-                   mbstate_t *ps));
+                  (wchar_t *restrict dest,
+                   const char **restrict srcp, size_t srclen, size_t len,
+                   mbstate_t *restrict ps));
 # endif
 _GL_CXXALIASWARN (mbsnrtowcs);
 #elif defined GNULIB_POSIXCHECK
@@ -349,15 +383,21 @@ _GL_WARN_ON_USE (mbsnrtowcs, "mbsnrtowcs is unportable - "
 #   undef wcrtomb
 #   define wcrtomb rpl_wcrtomb
 #  endif
-_GL_FUNCDECL_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
-_GL_CXXALIAS_RPL (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+_GL_FUNCDECL_RPL (wcrtomb, size_t,
+                  (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
+_GL_CXXALIAS_RPL (wcrtomb, size_t,
+                  (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
 # else
 #  if !@HAVE_WCRTOMB@
-_GL_FUNCDECL_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+_GL_FUNCDECL_SYS (wcrtomb, size_t,
+                  (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
 #  endif
-_GL_CXXALIAS_SYS (wcrtomb, size_t, (char *s, wchar_t wc, mbstate_t *ps));
+_GL_CXXALIAS_SYS (wcrtomb, size_t,
+                  (char *restrict s, wchar_t wc, mbstate_t *restrict ps));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcrtomb);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcrtomb
 # if HAVE_RAW_DECL_WCRTOMB
@@ -375,22 +415,30 @@ _GL_WARN_ON_USE (wcrtomb, "wcrtomb is unportable - "
 #   define wcsrtombs rpl_wcsrtombs
 #  endif
 _GL_FUNCDECL_RPL (wcsrtombs, size_t,
-                  (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
+                  (char *restrict dest, const wchar_t **restrict srcp,
+                   size_t len,
+                   mbstate_t *restrict ps)
                   _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (wcsrtombs, size_t,
-                  (char *dest, const wchar_t **srcp, size_t len,
-                   mbstate_t *ps));
+                  (char *restrict dest, const wchar_t **restrict srcp,
+                   size_t len,
+                   mbstate_t *restrict ps));
 # else
 #  if !@HAVE_WCSRTOMBS@
 _GL_FUNCDECL_SYS (wcsrtombs, size_t,
-                  (char *dest, const wchar_t **srcp, size_t len, mbstate_t *ps)
+                  (char *restrict dest, const wchar_t **restrict srcp,
+                   size_t len,
+                   mbstate_t *restrict ps)
                   _GL_ARG_NONNULL ((2)));
 #  endif
 _GL_CXXALIAS_SYS (wcsrtombs, size_t,
-                  (char *dest, const wchar_t **srcp, size_t len,
-                   mbstate_t *ps));
+                  (char *restrict dest, const wchar_t **restrict srcp,
+                   size_t len,
+                   mbstate_t *restrict ps));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcsrtombs);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsrtombs
 # if HAVE_RAW_DECL_WCSRTOMBS
@@ -408,24 +456,34 @@ _GL_WARN_ON_USE (wcsrtombs, "wcsrtombs is unportable - "
 #   define wcsnrtombs rpl_wcsnrtombs
 #  endif
 _GL_FUNCDECL_RPL (wcsnrtombs, size_t,
-                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
-                   mbstate_t *ps)
+                  (char *restrict dest,
+                   const wchar_t **restrict srcp, size_t srclen,
+                   size_t len,
+                   mbstate_t *restrict ps)
                   _GL_ARG_NONNULL ((2)));
 _GL_CXXALIAS_RPL (wcsnrtombs, size_t,
-                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
-                   mbstate_t *ps));
+                  (char *restrict dest,
+                   const wchar_t **restrict srcp, size_t srclen,
+                   size_t len,
+                   mbstate_t *restrict ps));
 # else
-#  if !@HAVE_WCSNRTOMBS@
+#  if !@HAVE_WCSNRTOMBS@ || (defined __cplusplus && defined __sun)
 _GL_FUNCDECL_SYS (wcsnrtombs, size_t,
-                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
-                   mbstate_t *ps)
+                  (char *restrict dest,
+                   const wchar_t **restrict srcp, size_t srclen,
+                   size_t len,
+                   mbstate_t *restrict ps)
                   _GL_ARG_NONNULL ((2)));
 #  endif
 _GL_CXXALIAS_SYS (wcsnrtombs, size_t,
-                  (char *dest, const wchar_t **srcp, size_t srclen, size_t len,
-                   mbstate_t *ps));
+                  (char *restrict dest,
+                   const wchar_t **restrict srcp, size_t srclen,
+                   size_t len,
+                   mbstate_t *restrict ps));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcsnrtombs);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsnrtombs
 # if HAVE_RAW_DECL_WCSNRTOMBS
@@ -448,15 +506,12 @@ _GL_CXXALIAS_RPL (wcwidth, int, (wchar_t));
 #  if !@HAVE_DECL_WCWIDTH@
 /* wcwidth exists but is not declared.  */
 _GL_FUNCDECL_SYS (wcwidth, int, (wchar_t) _GL_ATTRIBUTE_PURE);
-#  elif defined __KLIBC__
-/* On OS/2 kLIBC, wcwidth is a macro that expands to the name of a
-   static inline function.  The implementation of wcwidth in wcwidth.c
-   causes a "conflicting types" error. */
-#   undef wcwidth
 #  endif
 _GL_CXXALIAS_SYS (wcwidth, int, (wchar_t));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcwidth);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcwidth
 # if HAVE_RAW_DECL_WCWIDTH
@@ -485,7 +540,7 @@ _GL_CXXALIAS_SYS_CAST2 (wmemchr,
 _GL_CXXALIASWARN1 (wmemchr, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
 _GL_CXXALIASWARN1 (wmemchr, const wchar_t *,
                    (const wchar_t *s, wchar_t c, size_t n));
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (wmemchr);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -506,7 +561,9 @@ _GL_FUNCDECL_SYS (wmemcmp, int,
 # endif
 _GL_CXXALIAS_SYS (wmemcmp, int,
                   (const wchar_t *s1, const wchar_t *s2, size_t n));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wmemcmp);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wmemcmp
 # if HAVE_RAW_DECL_WMEMCMP
@@ -520,11 +577,15 @@ _GL_WARN_ON_USE (wmemcmp, "wmemcmp is unportable - "
 #if @GNULIB_WMEMCPY@
 # if !@HAVE_WMEMCPY@
 _GL_FUNCDECL_SYS (wmemcpy, wchar_t *,
-                  (wchar_t *dest, const wchar_t *src, size_t n));
+                  (wchar_t *restrict dest,
+                   const wchar_t *restrict src, size_t n));
 # endif
 _GL_CXXALIAS_SYS (wmemcpy, wchar_t *,
-                  (wchar_t *dest, const wchar_t *src, size_t n));
+                  (wchar_t *restrict dest,
+                   const wchar_t *restrict src, size_t n));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wmemcpy);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wmemcpy
 # if HAVE_RAW_DECL_WMEMCPY
@@ -543,7 +604,9 @@ _GL_FUNCDECL_SYS (wmemmove, wchar_t *,
 # endif
 _GL_CXXALIAS_SYS (wmemmove, wchar_t *,
                   (wchar_t *dest, const wchar_t *src, size_t n));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wmemmove);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wmemmove
 # if HAVE_RAW_DECL_WMEMMOVE
@@ -553,13 +616,38 @@ _GL_WARN_ON_USE (wmemmove, "wmemmove is unportable - "
 #endif
 
 
+/* Copy N wide characters of SRC to DEST.
+   Return pointer to wide characters after the last written wide character.  */
+#if @GNULIB_WMEMPCPY@
+# if !@HAVE_WMEMPCPY@
+_GL_FUNCDECL_SYS (wmempcpy, wchar_t *,
+                  (wchar_t *restrict dest,
+                   const wchar_t *restrict src, size_t n));
+# endif
+_GL_CXXALIAS_SYS (wmempcpy, wchar_t *,
+                  (wchar_t *restrict dest,
+                   const wchar_t *restrict src, size_t n));
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wmempcpy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wmempcpy
+# if HAVE_RAW_DECL_WMEMPCPY
+_GL_WARN_ON_USE (wmempcpy, "wmempcpy is unportable - "
+                 "use gnulib module wmempcpy for portability");
+# endif
+#endif
+
+
 /* Set N wide characters of S to C.  */
 #if @GNULIB_WMEMSET@
 # if !@HAVE_WMEMSET@
 _GL_FUNCDECL_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
 # endif
 _GL_CXXALIAS_SYS (wmemset, wchar_t *, (wchar_t *s, wchar_t c, size_t n));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wmemset);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wmemset
 # if HAVE_RAW_DECL_WMEMSET
@@ -575,7 +663,9 @@ _GL_WARN_ON_USE (wmemset, "wmemset is unportable - "
 _GL_FUNCDECL_SYS (wcslen, size_t, (const wchar_t *s) _GL_ATTRIBUTE_PURE);
 # endif
 _GL_CXXALIAS_SYS (wcslen, size_t, (const wchar_t *s));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcslen);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcslen
 # if HAVE_RAW_DECL_WCSLEN
@@ -605,10 +695,14 @@ _GL_WARN_ON_USE (wcsnlen, "wcsnlen is unportable - "
 /* Copy SRC to DEST.  */
 #if @GNULIB_WCSCPY@
 # if !@HAVE_WCSCPY@
-_GL_FUNCDECL_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_FUNCDECL_SYS (wcscpy, wchar_t *,
+                  (wchar_t *restrict dest, const wchar_t *restrict src));
 # endif
-_GL_CXXALIAS_SYS (wcscpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIAS_SYS (wcscpy, wchar_t *,
+                  (wchar_t *restrict dest, const wchar_t *restrict src));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcscpy);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcscpy
 # if HAVE_RAW_DECL_WCSCPY
@@ -621,9 +715,11 @@ _GL_WARN_ON_USE (wcscpy, "wcscpy is unportable - "
 /* Copy SRC to DEST, returning the address of the terminating L'\0' in DEST.  */
 #if @GNULIB_WCPCPY@
 # if !@HAVE_WCPCPY@
-_GL_FUNCDECL_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_FUNCDECL_SYS (wcpcpy, wchar_t *,
+                  (wchar_t *restrict dest, const wchar_t *restrict src));
 # endif
-_GL_CXXALIAS_SYS (wcpcpy, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIAS_SYS (wcpcpy, wchar_t *,
+                  (wchar_t *restrict dest, const wchar_t *restrict src));
 _GL_CXXALIASWARN (wcpcpy);
 #elif defined GNULIB_POSIXCHECK
 # undef wcpcpy
@@ -638,11 +734,15 @@ _GL_WARN_ON_USE (wcpcpy, "wcpcpy is unportable - "
 #if @GNULIB_WCSNCPY@
 # if !@HAVE_WCSNCPY@
 _GL_FUNCDECL_SYS (wcsncpy, wchar_t *,
-                  (wchar_t *dest, const wchar_t *src, size_t n));
+                  (wchar_t *restrict dest,
+                   const wchar_t *restrict src, size_t n));
 # endif
 _GL_CXXALIAS_SYS (wcsncpy, wchar_t *,
-                  (wchar_t *dest, const wchar_t *src, size_t n));
+                  (wchar_t *restrict dest,
+                   const wchar_t *restrict src, size_t n));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcsncpy);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsncpy
 # if HAVE_RAW_DECL_WCSNCPY
@@ -657,10 +757,12 @@ _GL_WARN_ON_USE (wcsncpy, "wcsncpy is unportable - "
 #if @GNULIB_WCPNCPY@
 # if !@HAVE_WCPNCPY@
 _GL_FUNCDECL_SYS (wcpncpy, wchar_t *,
-                  (wchar_t *dest, const wchar_t *src, size_t n));
+                  (wchar_t *restrict dest,
+                   const wchar_t *restrict src, size_t n));
 # endif
 _GL_CXXALIAS_SYS (wcpncpy, wchar_t *,
-                  (wchar_t *dest, const wchar_t *src, size_t n));
+                  (wchar_t *restrict dest,
+                   const wchar_t *restrict src, size_t n));
 _GL_CXXALIASWARN (wcpncpy);
 #elif defined GNULIB_POSIXCHECK
 # undef wcpncpy
@@ -674,10 +776,14 @@ _GL_WARN_ON_USE (wcpncpy, "wcpncpy is unportable - "
 /* Append SRC onto DEST.  */
 #if @GNULIB_WCSCAT@
 # if !@HAVE_WCSCAT@
-_GL_FUNCDECL_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_FUNCDECL_SYS (wcscat, wchar_t *,
+                  (wchar_t *restrict dest, const wchar_t *restrict src));
 # endif
-_GL_CXXALIAS_SYS (wcscat, wchar_t *, (wchar_t *dest, const wchar_t *src));
+_GL_CXXALIAS_SYS (wcscat, wchar_t *,
+                  (wchar_t *restrict dest, const wchar_t *restrict src));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcscat);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcscat
 # if HAVE_RAW_DECL_WCSCAT
@@ -691,11 +797,15 @@ _GL_WARN_ON_USE (wcscat, "wcscat is unportable - "
 #if @GNULIB_WCSNCAT@
 # if !@HAVE_WCSNCAT@
 _GL_FUNCDECL_SYS (wcsncat, wchar_t *,
-                  (wchar_t *dest, const wchar_t *src, size_t n));
+                  (wchar_t *restrict dest, const wchar_t *restrict src,
+                   size_t n));
 # endif
 _GL_CXXALIAS_SYS (wcsncat, wchar_t *,
-                  (wchar_t *dest, const wchar_t *src, size_t n));
+                  (wchar_t *restrict dest, const wchar_t *restrict src,
+                   size_t n));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcsncat);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsncat
 # if HAVE_RAW_DECL_WCSNCAT
@@ -712,7 +822,9 @@ _GL_FUNCDECL_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2)
                                _GL_ATTRIBUTE_PURE);
 # endif
 _GL_CXXALIAS_SYS (wcscmp, int, (const wchar_t *s1, const wchar_t *s2));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcscmp);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcscmp
 # if HAVE_RAW_DECL_WCSCMP
@@ -731,7 +843,9 @@ _GL_FUNCDECL_SYS (wcsncmp, int,
 # endif
 _GL_CXXALIAS_SYS (wcsncmp, int,
                   (const wchar_t *s1, const wchar_t *s2, size_t n));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcsncmp);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsncmp
 # if HAVE_RAW_DECL_WCSNCMP
@@ -784,7 +898,9 @@ _GL_WARN_ON_USE (wcsncasecmp, "wcsncasecmp is unportable - "
 _GL_FUNCDECL_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
 # endif
 _GL_CXXALIAS_SYS (wcscoll, int, (const wchar_t *s1, const wchar_t *s2));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcscoll);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcscoll
 # if HAVE_RAW_DECL_WCSCOLL
@@ -799,10 +915,14 @@ _GL_WARN_ON_USE (wcscoll, "wcscoll is unportable - "
    original strings.  */
 #if @GNULIB_WCSXFRM@
 # if !@HAVE_WCSXFRM@
-_GL_FUNCDECL_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_FUNCDECL_SYS (wcsxfrm, size_t,
+                  (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
 # endif
-_GL_CXXALIAS_SYS (wcsxfrm, size_t, (wchar_t *s1, const wchar_t *s2, size_t n));
+_GL_CXXALIAS_SYS (wcsxfrm, size_t,
+                  (wchar_t *restrict s1, const wchar_t *restrict s2, size_t n));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcsxfrm);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsxfrm
 # if HAVE_RAW_DECL_WCSXFRM
@@ -814,10 +934,18 @@ _GL_WARN_ON_USE (wcsxfrm, "wcsxfrm is unportable - "
 
 /* Duplicate S, returning an identical malloc'd string.  */
 #if @GNULIB_WCSDUP@
-# if !@HAVE_WCSDUP@
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcsdup
+#   define wcsdup _wcsdup
+#  endif
+_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
+# else
+#  if !@HAVE_WCSDUP@
 _GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+# endif
 _GL_CXXALIASWARN (wcsdup);
 #elif defined GNULIB_POSIXCHECK
 # undef wcsdup
@@ -825,6 +953,25 @@ _GL_CXXALIASWARN (wcsdup);
 _GL_WARN_ON_USE (wcsdup, "wcsdup is unportable - "
                  "use gnulib module wcsdup for portability");
 # endif
+#elif @GNULIB_MDA_WCSDUP@
+/* On native Windows, map 'wcsdup' to '_wcsdup', so that -loldnames is not
+   required.  In C++ with GNULIB_NAMESPACE, avoid differences between
+   platforms by defining GNULIB_NAMESPACE::wcsdup always.  */
+# if defined _WIN32 && !defined __CYGWIN__
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcsdup
+#   define wcsdup _wcsdup
+#  endif
+_GL_CXXALIAS_MDA (wcsdup, wchar_t *, (const wchar_t *s));
+# else
+_GL_FUNCDECL_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+#  if @HAVE_DECL_WCSDUP@
+_GL_CXXALIAS_SYS (wcsdup, wchar_t *, (const wchar_t *s));
+#  endif
+# endif
+# if (defined _WIN32 && !defined __CYGWIN__) || @HAVE_DECL_WCSDUP@
+_GL_CXXALIASWARN (wcsdup);
+# endif
 #endif
 
 
@@ -846,7 +993,7 @@ _GL_CXXALIAS_SYS_CAST2 (wcschr,
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (wcschr, wchar_t *, (wchar_t *wcs, wchar_t wc));
 _GL_CXXALIASWARN1 (wcschr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcschr);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -876,7 +1023,7 @@ _GL_CXXALIAS_SYS_CAST2 (wcsrchr,
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (wcsrchr, wchar_t *, (wchar_t *wcs, wchar_t wc));
 _GL_CXXALIASWARN1 (wcsrchr, const wchar_t *, (const wchar_t *wcs, wchar_t wc));
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcsrchr);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -896,7 +1043,9 @@ _GL_FUNCDECL_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject)
                                    _GL_ATTRIBUTE_PURE);
 # endif
 _GL_CXXALIAS_SYS (wcscspn, size_t, (const wchar_t *wcs, const wchar_t *reject));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcscspn);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcscspn
 # if HAVE_RAW_DECL_WCSCSPN
@@ -914,7 +1063,9 @@ _GL_FUNCDECL_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept)
                                   _GL_ATTRIBUTE_PURE);
 # endif
 _GL_CXXALIAS_SYS (wcsspn, size_t, (const wchar_t *wcs, const wchar_t *accept));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcsspn);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcsspn
 # if HAVE_RAW_DECL_WCSSPN
@@ -945,7 +1096,7 @@ _GL_CXXALIASWARN1 (wcspbrk, wchar_t *,
                    (wchar_t *wcs, const wchar_t *accept));
 _GL_CXXALIASWARN1 (wcspbrk, const wchar_t *,
                    (const wchar_t *wcs, const wchar_t *accept));
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcspbrk);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -961,7 +1112,8 @@ _GL_WARN_ON_USE (wcspbrk, "wcspbrk is unportable - "
 #if @GNULIB_WCSSTR@
 # if !@HAVE_WCSSTR@
 _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
-                  (const wchar_t *haystack, const wchar_t *needle)
+                  (const wchar_t *restrict haystack,
+                   const wchar_t *restrict needle)
                   _GL_ATTRIBUTE_PURE);
 # endif
   /* On some systems, this function is defined as an overloaded function:
@@ -970,15 +1122,19 @@ _GL_FUNCDECL_SYS (wcsstr, wchar_t *,
          wchar_t * std::wcsstr (wchar_t *, const wchar_t *);
        }  */
 _GL_CXXALIAS_SYS_CAST2 (wcsstr,
-                        wchar_t *, (const wchar_t *, const wchar_t *),
-                        const wchar_t *, (const wchar_t *, const wchar_t *));
+                        wchar_t *,
+                        (const wchar_t *restrict, const wchar_t *restrict),
+                        const wchar_t *,
+                        (const wchar_t *restrict, const wchar_t *restrict));
 # if ((__GLIBC__ == 2 && __GLIBC_MINOR__ >= 10) && !defined __UCLIBC__) \
      && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
 _GL_CXXALIASWARN1 (wcsstr, wchar_t *,
-                   (wchar_t *haystack, const wchar_t *needle));
+                   (wchar_t *restrict haystack,
+                    const wchar_t *restrict needle));
 _GL_CXXALIASWARN1 (wcsstr, const wchar_t *,
-                   (const wchar_t *haystack, const wchar_t *needle));
-# else
+                   (const wchar_t *restrict haystack,
+                    const wchar_t *restrict needle));
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcsstr);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -992,13 +1148,30 @@ _GL_WARN_ON_USE (wcsstr, "wcsstr is unportable - "
 
 /* Divide WCS into tokens separated by characters in DELIM.  */
 #if @GNULIB_WCSTOK@
-# if !@HAVE_WCSTOK@
+# if @REPLACE_WCSTOK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcstok
+#   define wcstok rpl_wcstok
+#  endif
+_GL_FUNCDECL_RPL (wcstok, wchar_t *,
+                  (wchar_t *restrict wcs, const wchar_t *restrict delim,
+                   wchar_t **restrict ptr));
+_GL_CXXALIAS_RPL (wcstok, wchar_t *,
+                  (wchar_t *restrict wcs, const wchar_t *restrict delim,
+                   wchar_t **restrict ptr));
+# else
+#  if !@HAVE_WCSTOK@
 _GL_FUNCDECL_SYS (wcstok, wchar_t *,
-                  (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
-# endif
+                  (wchar_t *restrict wcs, const wchar_t *restrict delim,
+                   wchar_t **restrict ptr));
+#  endif
 _GL_CXXALIAS_SYS (wcstok, wchar_t *,
-                  (wchar_t *wcs, const wchar_t *delim, wchar_t **ptr));
+                  (wchar_t *restrict wcs, const wchar_t *restrict delim,
+                   wchar_t **restrict ptr));
+# endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcstok);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcstok
 # if HAVE_RAW_DECL_WCSTOK
@@ -1026,7 +1199,9 @@ _GL_FUNCDECL_SYS (wcswidth, int, (const wchar_t *s, size_t n)
 #  endif
 _GL_CXXALIAS_SYS (wcswidth, int, (const wchar_t *s, size_t n));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wcswidth);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wcswidth
 # if HAVE_RAW_DECL_WCSWIDTH
@@ -1036,6 +1211,48 @@ _GL_WARN_ON_USE (wcswidth, "wcswidth is unportable - "
 #endif
 
 
+/* Convert *TP to a date and time wide string.  See
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/wcsftime.html>.  */
+#if @GNULIB_WCSFTIME@
+# if @REPLACE_WCSFTIME@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef wcsftime
+#   define wcsftime rpl_wcsftime
+#  endif
+_GL_FUNCDECL_RPL (wcsftime, size_t,
+                  (wchar_t *restrict __buf, size_t __bufsize,
+                   const wchar_t *restrict __fmt,
+                   const struct tm *restrict __tp)
+                  _GL_ARG_NONNULL ((1, 3, 4)));
+_GL_CXXALIAS_RPL (wcsftime, size_t,
+                  (wchar_t *restrict __buf, size_t __bufsize,
+                   const wchar_t *restrict __fmt,
+                   const struct tm *restrict __tp));
+# else
+#  if !@HAVE_WCSFTIME@
+_GL_FUNCDECL_SYS (wcsftime, size_t,
+                  (wchar_t *restrict __buf, size_t __bufsize,
+                   const wchar_t *restrict __fmt,
+                   const struct tm *restrict __tp)
+                  _GL_ARG_NONNULL ((1, 3, 4)));
+#  endif
+_GL_CXXALIAS_SYS (wcsftime, size_t,
+                  (wchar_t *restrict __buf, size_t __bufsize,
+                   const wchar_t *restrict __fmt,
+                   const struct tm *restrict __tp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (wcsftime);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef wcsftime
+# if HAVE_RAW_DECL_WCSFTIME
+_GL_WARN_ON_USE (wcsftime, "wcsftime is unportable - "
+                 "use gnulib module wcsftime for portability");
+# endif
+#endif
+
+
 #endif /* _@GUARD_PREFIX@_WCHAR_H */
 #endif /* _@GUARD_PREFIX@_WCHAR_H */
 #endif
index b931ee9..4ad5346 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert wide character to multibyte character.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 
 size_t
 wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
+#undef wcrtomb
 {
-  /* This implementation of wcrtomb on top of wctomb() supports only
-     stateless encodings.  ps must be in the initial state.  */
+  /* This implementation of wcrtomb supports only stateless encodings.
+     ps must be in the initial state.  */
   if (ps != NULL && !mbsinit (ps))
     {
       errno = EINVAL;
       return (size_t)(-1);
     }
 
+#if !HAVE_WCRTOMB                       /* IRIX 6.5 */ \
+    || WCRTOMB_RETVAL_BUG               /* Solaris 11.3, MSVC */ \
+    || WCRTOMB_C_LOCALE_BUG             /* Android */
   if (s == NULL)
     /* We know the NUL wide character corresponds to the NUL character.  */
     return 1;
   else
+#endif
     {
+#if HAVE_WCRTOMB
+# if WCRTOMB_C_LOCALE_BUG               /* Android */
+      /* Implement consistently with mbrtowc(): through a 1:1 correspondence,
+         as in ISO-8859-1.  */
+      if (wc >= 0 && wc <= 0xff)
+        {
+          *s = (unsigned char) wc;
+          return 1;
+        }
+      else
+        {
+          errno = EILSEQ;
+          return (size_t)(-1);
+        }
+# else
+      return wcrtomb (s, wc, ps);
+# endif
+#else                                   /* IRIX 6.5 */
+      /* Fallback for platforms that don't have wcrtomb().
+         Implement on top of wctomb().
+         This code is not multithread-safe.  */
       int ret = wctomb (s, wc);
 
       if (ret >= 0)
@@ -49,5 +75,6 @@ wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
           errno = EILSEQ;
           return (size_t)(-1);
         }
+#endif
     }
 }
index be7c14c..f6ae624 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <wctype.h>, for platforms that lack it.
 
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible and Paul Eggert.  */
 
 /*
  * ISO C 99 <wctype.h> for platforms that lack it.
- * <http://www.opengroup.org/susv3xbd/wctype.h.html>
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/wctype.h.html>
  *
  * iswctype, towctrans, towlower, towupper, wctrans, wctype,
  * wctrans_t, and wctype_t are not yet implemented.
 #ifndef _@GUARD_PREFIX@_WCTYPE_H
 
 #if @HAVE_WINT_T@
-/* Solaris 2.5 has a bug: <wchar.h> must be included before <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>
+/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>.  */
 # include <wchar.h>
 #endif
 
-/* mingw has declarations of towupper and towlower in <ctype.h> as
-   well <wctype.h>.  Include <ctype.h> in advance to avoid rpl_ prefix
-   being added to the declarations.  */
-#ifdef __MINGW32__
+/* Native Windows (mingw, MSVC) have declarations of towupper, towlower, and
+   isw* functions in <ctype.h>, <wchar.h> as well as in <wctype.h>.  Include
+   <ctype.h>, <wchar.h> in advance to avoid rpl_ prefix being added to the
+   declarations.  */
+#if defined _WIN32 && ! defined __CYGWIN__
 # include <ctype.h>
+# include <wchar.h>
 #endif
 
 /* Include the original <wctype.h> if it exists.
@@ -105,12 +100,16 @@ _GL_INLINE_HEADER_BEGIN
 #  define WEOF -1
 # endif
 #else
-/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h>.
-   This is too small: ISO C 99 section 7.24.1.(2) says that wint_t must be
-   "unchanged by default argument promotions".  Override it.  */
-# if @GNULIB_OVERRIDES_WINT_T@
+/* mingw and MSVC define wint_t as 'unsigned short' in <crtdefs.h> or
+   <stddef.h>.  This is too small: ISO C 99 section 7.24.1.(2) says that
+   wint_t must be "unchanged by default argument promotions".  Override it.  */
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
 #  if !GNULIB_defined_wint_t
-#   include <crtdefs.h>
+#   if @HAVE_CRTDEFS_H@
+#    include <crtdefs.h>
+#   else
+#    include <stddef.h>
+#   endif
 typedef unsigned int rpl_wint_t;
 #   undef wint_t
 #   define wint_t rpl_wint_t
@@ -127,33 +126,116 @@ typedef unsigned int rpl_wint_t;
 
 /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
    Linux libc5 has <wctype.h> and the functions but they are broken.
+   mingw and MSVC have <wctype.h> and the functions but they take a wchar_t
+   as argument, not an rpl_wint_t.
    Assume all 11 functions (all isw* except iswblank) are implemented the
    same way, or not at all.  */
 # if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
 
-/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
-   undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
-   refer to system functions like _iswctype that are not in the
-   standard C library.  Rather than try to get ancient buggy
-   implementations like this to work, just disable them.  */
-#  undef iswalnum
-#  undef iswalpha
-#  undef iswblank
-#  undef iswcntrl
-#  undef iswdigit
-#  undef iswgraph
-#  undef iswlower
-#  undef iswprint
-#  undef iswpunct
-#  undef iswspace
-#  undef iswupper
-#  undef iswxdigit
-#  undef towlower
-#  undef towupper
+#  if @GNULIBHEADERS_OVERRIDE_WINT_T@ /* implies @REPLACE_ISWCNTRL@ */
+
+_GL_WCTYPE_INLINE int
+rpl_iswalnum (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? iswalnum ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswalpha (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? iswalpha ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswblank (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? iswblank ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswcntrl (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? iswcntrl ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswdigit (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? wc >= '0' && wc <= '9' : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswgraph (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? iswgraph ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswlower (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? iswlower ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswprint (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? iswprint ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswpunct (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? iswpunct ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswspace (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? iswspace ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswupper (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? iswupper ((wchar_t) wc) : 0);
+}
+
+_GL_WCTYPE_INLINE int
+rpl_iswxdigit (wint_t wc)
+{
+  return ((wchar_t) wc == wc
+          ? (wc >= '0' && wc <= '9')
+            || ((wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'F')
+          : 0);
+}
+
+_GL_WCTYPE_INLINE wint_t
+rpl_towlower (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? (wchar_t) towlower ((wchar_t) wc) : wc);
+}
+
+_GL_WCTYPE_INLINE wint_t
+rpl_towupper (wint_t wc)
+{
+  return ((wchar_t) wc == wc ? (wchar_t) towupper ((wchar_t) wc) : wc);
+}
 
-/* Linux libc5 has <wctype.h> and the functions but they are broken.  */
-#  if @REPLACE_ISWCNTRL@
 #   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#    undef iswalnum
+#    undef iswalpha
+#    undef iswblank
+#    undef iswcntrl
+#    undef iswdigit
+#    undef iswgraph
+#    undef iswlower
+#    undef iswprint
+#    undef iswpunct
+#    undef iswspace
+#    undef iswupper
+#    undef iswxdigit
+#    undef towlower
+#    undef towupper
 #    define iswalnum rpl_iswalnum
 #    define iswalpha rpl_iswalpha
 #    define iswblank rpl_iswblank
@@ -166,21 +248,62 @@ typedef unsigned int rpl_wint_t;
 #    define iswspace rpl_iswspace
 #    define iswupper rpl_iswupper
 #    define iswxdigit rpl_iswxdigit
-#   endif
-#  endif
-#  if @REPLACE_TOWLOWER@
-#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #    define towlower rpl_towlower
 #    define towupper rpl_towupper
 #   endif
-#  endif
+
+#  else
+
+/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
+   undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
+   refer to system functions like _iswctype that are not in the
+   standard C library.  Rather than try to get ancient buggy
+   implementations like this to work, just disable them.  */
+#   undef iswalnum
+#   undef iswalpha
+#   undef iswblank
+#   undef iswcntrl
+#   undef iswdigit
+#   undef iswgraph
+#   undef iswlower
+#   undef iswprint
+#   undef iswpunct
+#   undef iswspace
+#   undef iswupper
+#   undef iswxdigit
+#   undef towlower
+#   undef towupper
+
+/* Linux libc5 has <wctype.h> and the functions but they are broken.  */
+#   if @REPLACE_ISWCNTRL@
+#    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#     define iswalnum rpl_iswalnum
+#     define iswalpha rpl_iswalpha
+#     define iswblank rpl_iswblank
+#     define iswcntrl rpl_iswcntrl
+#     define iswdigit rpl_iswdigit
+#     define iswgraph rpl_iswgraph
+#     define iswlower rpl_iswlower
+#     define iswprint rpl_iswprint
+#     define iswpunct rpl_iswpunct
+#     define iswspace rpl_iswspace
+#     define iswupper rpl_iswupper
+#     define iswxdigit rpl_iswxdigit
+#    endif
+#   endif
+#   if @REPLACE_TOWLOWER@
+#    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#     define towlower rpl_towlower
+#     define towupper rpl_towupper
+#    endif
+#   endif
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWCNTRL@
 rpl_iswalnum
-#  else
+#   else
 iswalnum
-#  endif
+#   endif
          (wint_t wc)
 {
   return ((wc >= '0' && wc <= '9')
@@ -188,88 +311,88 @@ iswalnum
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWCNTRL@
 rpl_iswalpha
-#  else
+#   else
 iswalpha
-#  endif
+#   endif
          (wint_t wc)
 {
   return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWCNTRL@
 rpl_iswblank
-#  else
+#   else
 iswblank
-#  endif
+#   endif
          (wint_t wc)
 {
   return wc == ' ' || wc == '\t';
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWCNTRL@
 rpl_iswcntrl
-#  else
+#   else
 iswcntrl
-#  endif
+#   endif
         (wint_t wc)
 {
   return (wc & ~0x1f) == 0 || wc == 0x7f;
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWDIGIT@
 rpl_iswdigit
-#  else
+#   else
 iswdigit
-#  endif
+#   endif
          (wint_t wc)
 {
   return wc >= '0' && wc <= '9';
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWCNTRL@
 rpl_iswgraph
-#  else
+#   else
 iswgraph
-#  endif
+#   endif
          (wint_t wc)
 {
   return wc >= '!' && wc <= '~';
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWCNTRL@
 rpl_iswlower
-#  else
+#   else
 iswlower
-#  endif
+#   endif
          (wint_t wc)
 {
   return wc >= 'a' && wc <= 'z';
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWCNTRL@
 rpl_iswprint
-#  else
+#   else
 iswprint
-#  endif
+#   endif
          (wint_t wc)
 {
   return wc >= ' ' && wc <= '~';
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWCNTRL@
 rpl_iswpunct
-#  else
+#   else
 iswpunct
-#  endif
+#   endif
          (wint_t wc)
 {
   return (wc >= '!' && wc <= '~'
@@ -278,11 +401,11 @@ iswpunct
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWCNTRL@
 rpl_iswspace
-#  else
+#   else
 iswspace
-#  endif
+#   endif
          (wint_t wc)
 {
   return (wc == ' ' || wc == '\t'
@@ -290,22 +413,22 @@ iswspace
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWCNTRL@
 rpl_iswupper
-#  else
+#   else
 iswupper
-#  endif
+#   endif
          (wint_t wc)
 {
   return wc >= 'A' && wc <= 'Z';
 }
 
 _GL_WCTYPE_INLINE int
-#  if @REPLACE_ISWCNTRL@
+#   if @REPLACE_ISWXDIGIT@
 rpl_iswxdigit
-#  else
+#   else
 iswxdigit
-#  endif
+#   endif
           (wint_t wc)
 {
   return ((wc >= '0' && wc <= '9')
@@ -313,42 +436,67 @@ iswxdigit
 }
 
 _GL_WCTYPE_INLINE wint_t
-#  if @REPLACE_TOWLOWER@
+#   if @REPLACE_TOWLOWER@
 rpl_towlower
-#  else
+#   else
 towlower
-#  endif
+#   endif
          (wint_t wc)
 {
   return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
 }
 
 _GL_WCTYPE_INLINE wint_t
-#  if @REPLACE_TOWLOWER@
+#   if @REPLACE_TOWLOWER@
 rpl_towupper
-#  else
+#   else
 towupper
-#  endif
+#   endif
          (wint_t wc)
 {
   return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
 }
 
-# elif @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
-/* Only the iswblank function is missing.  */
+#  endif
 
-#  if @REPLACE_ISWBLANK@
-#   if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-#    define iswblank rpl_iswblank
-#   endif
+# else
+/* Only some of the functions are missing or broken.  */
+
+#  if @GNULIB_ISWBLANK@ && (! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@)
+/* Only the iswblank function is missing.  */
+#   if @REPLACE_ISWBLANK@
+#    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#     define iswblank rpl_iswblank
+#    endif
 _GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
-#  else
+#   else
 _GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
+#   endif
+#  endif
+
+#  if @GNULIB_ISWDIGIT@
+#   if @REPLACE_ISWDIGIT@
+#    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#     undef iswdigit
+#     define iswdigit rpl_iswdigit
+#    endif
+_GL_FUNCDECL_RPL (iswdigit, int, (wint_t wc));
+#   endif
+#  endif
+
+#  if @GNULIB_ISWXDIGIT@
+#   if @REPLACE_ISWXDIGIT@
+#    if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#     undef iswxdigit
+#     define iswxdigit rpl_iswxdigit
+#    endif
+_GL_FUNCDECL_RPL (iswxdigit, int, (wint_t wc));
+#   endif
 #  endif
 
 # endif
 
-# if defined __MINGW32__
+# if defined __MINGW32__ && !@GNULIBHEADERS_OVERRIDE_WINT_T@
 
 /* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
    The functions towlower and towupper are implemented in the MSVCRT library
@@ -381,36 +529,71 @@ rpl_towupper (wint_t wc)
 #   define towupper rpl_towupper
 #  endif
 
-# endif /* __MINGW32__ */
+# endif /* __MINGW32__ && !@GNULIBHEADERS_OVERRIDE_WINT_T@ */
 
 # define GNULIB_defined_wctype_functions 1
 #endif
 
 #if @REPLACE_ISWCNTRL@
 _GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
-_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
 #else
 _GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswalpha, int, (wint_t wc));
+#else
 _GL_CXXALIAS_SYS (iswalpha, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswcntrl, int, (wint_t wc));
+#else
 _GL_CXXALIAS_SYS (iswcntrl, int, (wint_t wc));
+#endif
+#if @GNULIB_ISWDIGIT@
+# if @REPLACE_ISWDIGIT@
+_GL_CXXALIAS_RPL (iswdigit, int, (wint_t wc));
+# else
 _GL_CXXALIAS_SYS (iswdigit, int, (wint_t wc));
+# endif
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswgraph, int, (wint_t wc));
+#else
 _GL_CXXALIAS_SYS (iswgraph, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswlower, int, (wint_t wc));
+#else
 _GL_CXXALIAS_SYS (iswlower, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswprint, int, (wint_t wc));
+#else
 _GL_CXXALIAS_SYS (iswprint, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswpunct, int, (wint_t wc));
+#else
 _GL_CXXALIAS_SYS (iswpunct, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswspace, int, (wint_t wc));
+#else
 _GL_CXXALIAS_SYS (iswspace, int, (wint_t wc));
+#endif
+#if @REPLACE_ISWCNTRL@
+_GL_CXXALIAS_RPL (iswupper, int, (wint_t wc));
+#else
 _GL_CXXALIAS_SYS (iswupper, int, (wint_t wc));
+#endif
+#if @GNULIB_ISWXDIGIT@
+# if @REPLACE_ISWXDIGIT@
+_GL_CXXALIAS_RPL (iswxdigit, int, (wint_t wc));
+# else
 _GL_CXXALIAS_SYS (iswxdigit, int, (wint_t wc));
+# endif
 #endif
+#if __GLIBC__ >= 2
 _GL_CXXALIASWARN (iswalnum);
 _GL_CXXALIASWARN (iswalpha);
 _GL_CXXALIASWARN (iswcntrl);
@@ -422,6 +605,7 @@ _GL_CXXALIASWARN (iswpunct);
 _GL_CXXALIASWARN (iswspace);
 _GL_CXXALIASWARN (iswupper);
 _GL_CXXALIASWARN (iswxdigit);
+#endif
 
 #if @GNULIB_ISWBLANK@
 # if @REPLACE_ISWCNTRL@ || @REPLACE_ISWBLANK@
@@ -429,7 +613,9 @@ _GL_CXXALIAS_RPL (iswblank, int, (wint_t wc));
 # else
 _GL_CXXALIAS_SYS (iswblank, int, (wint_t wc));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (iswblank);
+# endif
 #endif
 
 #if !@HAVE_WCTYPE_T@
@@ -445,7 +631,9 @@ typedef void * wctype_t;
 _GL_FUNCDECL_SYS (wctype, wctype_t, (const char *name));
 # endif
 _GL_CXXALIAS_SYS (wctype, wctype_t, (const char *name));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wctype);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wctype
 # if HAVE_RAW_DECL_WCTYPE
@@ -458,11 +646,22 @@ _GL_WARN_ON_USE (wctype, "wctype is unportable - "
    The argument WC must be either a wchar_t value or WEOF.
    The argument DESC must have been returned by the wctype() function.  */
 #if @GNULIB_ISWCTYPE@
-# if !@HAVE_WCTYPE_T@
+# if @GNULIBHEADERS_OVERRIDE_WINT_T@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef iswctype
+#   define iswctype rpl_iswctype
+#  endif
+_GL_FUNCDECL_RPL (iswctype, int, (wint_t wc, wctype_t desc));
+_GL_CXXALIAS_RPL (iswctype, int, (wint_t wc, wctype_t desc));
+# else
+#  if !@HAVE_WCTYPE_T@
 _GL_FUNCDECL_SYS (iswctype, int, (wint_t wc, wctype_t desc));
-# endif
+#  endif
 _GL_CXXALIAS_SYS (iswctype, int, (wint_t wc, wctype_t desc));
+# endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (iswctype);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef iswctype
 # if HAVE_RAW_DECL_ISWCTYPE
@@ -478,8 +677,10 @@ _GL_CXXALIAS_RPL (towupper, wint_t, (wint_t wc));
 _GL_CXXALIAS_SYS (towlower, wint_t, (wint_t wc));
 _GL_CXXALIAS_SYS (towupper, wint_t, (wint_t wc));
 #endif
+#if __GLIBC__ >= 2
 _GL_CXXALIASWARN (towlower);
 _GL_CXXALIASWARN (towupper);
+#endif
 
 #if !@HAVE_WCTRANS_T@
 # if !GNULIB_defined_wctrans_t
@@ -494,7 +695,9 @@ typedef void * wctrans_t;
 _GL_FUNCDECL_SYS (wctrans, wctrans_t, (const char *name));
 # endif
 _GL_CXXALIAS_SYS (wctrans, wctrans_t, (const char *name));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (wctrans);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef wctrans
 # if HAVE_RAW_DECL_WCTRANS
@@ -511,7 +714,9 @@ _GL_WARN_ON_USE (wctrans, "wctrans is unportable - "
 _GL_FUNCDECL_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
 # endif
 _GL_CXXALIAS_SYS (towctrans, wint_t, (wint_t wc, wctrans_t desc));
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (towctrans);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef towctrans
 # if HAVE_RAW_DECL_TOWCTRANS
diff --git a/lib/wcwidth.c b/lib/wcwidth.c
new file mode 100644 (file)
index 0000000..8d85082
--- /dev/null
@@ -0,0 +1,73 @@
+/* Determine the number of screen columns needed for a character.
+   Copyright (C) 2006-2007, 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <wchar.h>
+
+/* Get iswprint.  */
+#include <wctype.h>
+
+#include "localcharset.h"
+#include "streq.h"
+#include "uniwidth.h"
+
+/* Returns 1 if the current locale is an UTF-8 locale, 0 otherwise.  */
+static inline int
+is_locale_utf8 (void)
+{
+  const char *encoding = locale_charset ();
+  return STREQ_OPT (encoding, "UTF-8", 'U', 'T', 'F', '-', '8', 0, 0, 0, 0);
+}
+
+#if GNULIB_WCHAR_SINGLE_LOCALE
+/* When we know that the locale does not change, provide a speedup by
+   caching the value of is_locale_utf8.  */
+static int cached_is_locale_utf8 = -1;
+static inline int
+is_locale_utf8_cached (void)
+{
+  if (cached_is_locale_utf8 < 0)
+    cached_is_locale_utf8 = is_locale_utf8 ();
+  return cached_is_locale_utf8;
+}
+#else
+/* By default, don't make assumptions, hence no caching.  */
+# define is_locale_utf8_cached is_locale_utf8
+#endif
+
+int
+wcwidth (wchar_t wc)
+#undef wcwidth
+{
+  /* In UTF-8 locales, use a Unicode aware width function.  */
+  if (is_locale_utf8_cached ())
+    {
+      /* We assume that in a UTF-8 locale, a wide character is the same as a
+         Unicode character.  */
+      return uc_width (wc, "UTF-8");
+    }
+  else
+    {
+      /* Otherwise, fall back to the system's wcwidth function.  */
+#if HAVE_WCWIDTH
+      return wcwidth (wc);
+#else
+      return wc == 0 ? 0 : iswprint (wc) ? 1 : -1;
+#endif
+    }
+}
diff --git a/lib/windows-initguard.h b/lib/windows-initguard.h
new file mode 100644 (file)
index 0000000..afdd8e7
--- /dev/null
@@ -0,0 +1,35 @@
+/* Init guards, somewhat like spinlocks (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#ifndef _WINDOWS_INITGUARD_H
+#define _WINDOWS_INITGUARD_H
+
+#define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#include <windows.h>
+
+typedef struct
+        {
+          volatile int done;
+          volatile LONG started;
+        }
+        glwthread_initguard_t;
+
+#define GLWTHREAD_INITGUARD_INIT { 0, -1 }
+
+#endif /* _WINDOWS_INITGUARD_H */
diff --git a/lib/windows-mutex.c b/lib/windows-mutex.c
new file mode 100644 (file)
index 0000000..b86c829
--- /dev/null
@@ -0,0 +1,95 @@
+/* Plain mutexes (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "windows-mutex.h"
+
+#include <errno.h>
+
+void
+glwthread_mutex_init (glwthread_mutex_t *mutex)
+{
+  InitializeCriticalSection (&mutex->lock);
+  mutex->guard.done = 1;
+}
+
+int
+glwthread_mutex_lock (glwthread_mutex_t *mutex)
+{
+  if (!mutex->guard.done)
+    {
+      if (InterlockedIncrement (&mutex->guard.started) == 0)
+        /* This thread is the first one to need this mutex.  Initialize it.  */
+        glwthread_mutex_init (mutex);
+      else
+        {
+          /* Don't let mutex->guard.started grow and wrap around.  */
+          InterlockedDecrement (&mutex->guard.started);
+          /* Yield the CPU while waiting for another thread to finish
+             initializing this mutex.  */
+          while (!mutex->guard.done)
+            Sleep (0);
+        }
+    }
+  EnterCriticalSection (&mutex->lock);
+  return 0;
+}
+
+int
+glwthread_mutex_trylock (glwthread_mutex_t *mutex)
+{
+  if (!mutex->guard.done)
+    {
+      if (InterlockedIncrement (&mutex->guard.started) == 0)
+        /* This thread is the first one to need this mutex.  Initialize it.  */
+        glwthread_mutex_init (mutex);
+      else
+        {
+          /* Don't let mutex->guard.started grow and wrap around.  */
+          InterlockedDecrement (&mutex->guard.started);
+          /* Let another thread finish initializing this mutex, and let it also
+             lock this mutex.  */
+          return EBUSY;
+        }
+    }
+  if (!TryEnterCriticalSection (&mutex->lock))
+    return EBUSY;
+  return 0;
+}
+
+int
+glwthread_mutex_unlock (glwthread_mutex_t *mutex)
+{
+  if (!mutex->guard.done)
+    return EINVAL;
+  LeaveCriticalSection (&mutex->lock);
+  return 0;
+}
+
+int
+glwthread_mutex_destroy (glwthread_mutex_t *mutex)
+{
+  if (!mutex->guard.done)
+    return EINVAL;
+  DeleteCriticalSection (&mutex->lock);
+  mutex->guard.done = 0;
+  return 0;
+}
diff --git a/lib/windows-mutex.h b/lib/windows-mutex.h
new file mode 100644 (file)
index 0000000..6300035
--- /dev/null
@@ -0,0 +1,51 @@
+/* Plain mutexes (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#ifndef _WINDOWS_MUTEX_H
+#define _WINDOWS_MUTEX_H
+
+#define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#include <windows.h>
+
+#include "windows-initguard.h"
+
+typedef struct
+        {
+          glwthread_initguard_t guard; /* protects the initialization */
+          CRITICAL_SECTION lock;
+        }
+        glwthread_mutex_t;
+
+#define GLWTHREAD_MUTEX_INIT { GLWTHREAD_INITGUARD_INIT }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_mutex_init (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_lock (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_trylock (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_unlock (glwthread_mutex_t *mutex);
+extern int glwthread_mutex_destroy (glwthread_mutex_t *mutex);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_MUTEX_H */
diff --git a/lib/windows-once.c b/lib/windows-once.c
new file mode 100644 (file)
index 0000000..3c4a386
--- /dev/null
@@ -0,0 +1,62 @@
+/* Once-only control (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "windows-once.h"
+
+#include <stdlib.h>
+
+void
+glwthread_once (glwthread_once_t *once_control, void (*initfunction) (void))
+{
+  if (once_control->inited <= 0)
+    {
+      if (InterlockedIncrement (&once_control->started) == 0)
+        {
+          /* This thread is the first one to come to this once_control.  */
+          InitializeCriticalSection (&once_control->lock);
+          EnterCriticalSection (&once_control->lock);
+          once_control->inited = 0;
+          initfunction ();
+          once_control->inited = 1;
+          LeaveCriticalSection (&once_control->lock);
+        }
+      else
+        {
+          /* Don't let once_control->started grow and wrap around.  */
+          InterlockedDecrement (&once_control->started);
+          /* Some other thread has already started the initialization.
+             Yield the CPU while waiting for the other thread to finish
+             initializing and taking the lock.  */
+          while (once_control->inited < 0)
+            Sleep (0);
+          if (once_control->inited <= 0)
+            {
+              /* Take the lock.  This blocks until the other thread has
+                 finished calling the initfunction.  */
+              EnterCriticalSection (&once_control->lock);
+              LeaveCriticalSection (&once_control->lock);
+              if (!(once_control->inited > 0))
+                abort ();
+            }
+        }
+    }
+}
diff --git a/lib/windows-once.h b/lib/windows-once.h
new file mode 100644 (file)
index 0000000..9dfbf3f
--- /dev/null
@@ -0,0 +1,47 @@
+/* Once-only control (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#ifndef _WINDOWS_ONCE_H
+#define _WINDOWS_ONCE_H
+
+#define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#include <windows.h>
+
+typedef struct
+        {
+          volatile int inited;
+          volatile LONG started;
+          CRITICAL_SECTION lock;
+        }
+        glwthread_once_t;
+
+#define GLWTHREAD_ONCE_INIT { -1, -1 }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_once (glwthread_once_t *once_control,
+                            void (*initfunction) (void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_ONCE_H */
diff --git a/lib/windows-recmutex.c b/lib/windows-recmutex.c
new file mode 100644 (file)
index 0000000..8e2bd14
--- /dev/null
@@ -0,0 +1,127 @@
+/* Plain recursive mutexes (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "windows-recmutex.h"
+
+#include <errno.h>
+
+void
+glwthread_recmutex_init (glwthread_recmutex_t *mutex)
+{
+  mutex->owner = 0;
+  mutex->depth = 0;
+  InitializeCriticalSection (&mutex->lock);
+  mutex->guard.done = 1;
+}
+
+int
+glwthread_recmutex_lock (glwthread_recmutex_t *mutex)
+{
+  if (!mutex->guard.done)
+    {
+      if (InterlockedIncrement (&mutex->guard.started) == 0)
+        /* This thread is the first one to need this mutex.  Initialize it.  */
+        glwthread_recmutex_init (mutex);
+      else
+        {
+          /* Don't let mutex->guard.started grow and wrap around.  */
+          InterlockedDecrement (&mutex->guard.started);
+          /* Yield the CPU while waiting for another thread to finish
+             initializing this mutex.  */
+          while (!mutex->guard.done)
+            Sleep (0);
+        }
+    }
+  {
+    DWORD self = GetCurrentThreadId ();
+    if (mutex->owner != self)
+      {
+        EnterCriticalSection (&mutex->lock);
+        mutex->owner = self;
+      }
+    if (++(mutex->depth) == 0) /* wraparound? */
+      {
+        mutex->depth--;
+        return EAGAIN;
+      }
+  }
+  return 0;
+}
+
+int
+glwthread_recmutex_trylock (glwthread_recmutex_t *mutex)
+{
+  if (!mutex->guard.done)
+    {
+      if (InterlockedIncrement (&mutex->guard.started) == 0)
+        /* This thread is the first one to need this mutex.  Initialize it.  */
+        glwthread_recmutex_init (mutex);
+      else
+        {
+          /* Don't let mutex->guard.started grow and wrap around.  */
+          InterlockedDecrement (&mutex->guard.started);
+          /* Let another thread finish initializing this mutex, and let it also
+             lock this mutex.  */
+          return EBUSY;
+        }
+    }
+  {
+    DWORD self = GetCurrentThreadId ();
+    if (mutex->owner != self)
+      {
+        if (!TryEnterCriticalSection (&mutex->lock))
+          return EBUSY;
+        mutex->owner = self;
+      }
+    if (++(mutex->depth) == 0) /* wraparound? */
+      {
+        mutex->depth--;
+        return EAGAIN;
+      }
+  }
+  return 0;
+}
+
+int
+glwthread_recmutex_unlock (glwthread_recmutex_t *mutex)
+{
+  if (mutex->owner != GetCurrentThreadId ())
+    return EPERM;
+  if (mutex->depth == 0)
+    return EINVAL;
+  if (--(mutex->depth) == 0)
+    {
+      mutex->owner = 0;
+      LeaveCriticalSection (&mutex->lock);
+    }
+  return 0;
+}
+
+int
+glwthread_recmutex_destroy (glwthread_recmutex_t *mutex)
+{
+  if (mutex->owner != 0)
+    return EBUSY;
+  DeleteCriticalSection (&mutex->lock);
+  mutex->guard.done = 0;
+  return 0;
+}
diff --git a/lib/windows-recmutex.h b/lib/windows-recmutex.h
new file mode 100644 (file)
index 0000000..d3a8f47
--- /dev/null
@@ -0,0 +1,57 @@
+/* Plain recursive mutexes (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#ifndef _WINDOWS_RECMUTEX_H
+#define _WINDOWS_RECMUTEX_H
+
+#define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#include <windows.h>
+
+#include "windows-initguard.h"
+
+/* The native Windows documentation says that CRITICAL_SECTION already
+   implements a recursive lock.  But we need not rely on it: It's easy to
+   implement a recursive lock without this assumption.  */
+
+typedef struct
+        {
+          glwthread_initguard_t guard; /* protects the initialization */
+          DWORD owner;
+          unsigned long depth;
+          CRITICAL_SECTION lock;
+        }
+        glwthread_recmutex_t;
+
+#define GLWTHREAD_RECMUTEX_INIT { GLWTHREAD_INITGUARD_INIT, 0, 0 }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_recmutex_init (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_lock (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_trylock (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_unlock (glwthread_recmutex_t *mutex);
+extern int glwthread_recmutex_destroy (glwthread_recmutex_t *mutex);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_RECMUTEX_H */
diff --git a/lib/windows-rwlock.c b/lib/windows-rwlock.c
new file mode 100644 (file)
index 0000000..2c3f922
--- /dev/null
@@ -0,0 +1,377 @@
+/* Read-write locks (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "windows-rwlock.h"
+
+#include <errno.h>
+#include <stdlib.h>
+
+/* Don't assume that UNICODE is not defined.  */
+#undef CreateEvent
+#define CreateEvent CreateEventA
+
+/* In this file, the waitqueues are implemented as circular arrays.  */
+#define glwthread_waitqueue_t glwthread_carray_waitqueue_t
+
+static void
+glwthread_waitqueue_init (glwthread_waitqueue_t *wq)
+{
+  wq->array = NULL;
+  wq->count = 0;
+  wq->alloc = 0;
+  wq->offset = 0;
+}
+
+/* Enqueues the current thread, represented by an event, in a wait queue.
+   Returns INVALID_HANDLE_VALUE if an allocation failure occurs.  */
+static HANDLE
+glwthread_waitqueue_add (glwthread_waitqueue_t *wq)
+{
+  HANDLE event;
+  unsigned int index;
+
+  if (wq->count == wq->alloc)
+    {
+      unsigned int new_alloc = 2 * wq->alloc + 1;
+      HANDLE *new_array =
+        (HANDLE *) realloc (wq->array, new_alloc * sizeof (HANDLE));
+      if (new_array == NULL)
+        /* No more memory.  */
+        return INVALID_HANDLE_VALUE;
+      /* Now is a good opportunity to rotate the array so that its contents
+         starts at offset 0.  */
+      if (wq->offset > 0)
+        {
+          unsigned int old_count = wq->count;
+          unsigned int old_alloc = wq->alloc;
+          unsigned int old_offset = wq->offset;
+          unsigned int i;
+          if (old_offset + old_count > old_alloc)
+            {
+              unsigned int limit = old_offset + old_count - old_alloc;
+              for (i = 0; i < limit; i++)
+                new_array[old_alloc + i] = new_array[i];
+            }
+          for (i = 0; i < old_count; i++)
+            new_array[i] = new_array[old_offset + i];
+          wq->offset = 0;
+        }
+      wq->array = new_array;
+      wq->alloc = new_alloc;
+    }
+  /* Whether the created event is a manual-reset one or an auto-reset one,
+     does not matter, since we will wait on it only once.  */
+  event = CreateEvent (NULL, TRUE, FALSE, NULL);
+  if (event == INVALID_HANDLE_VALUE)
+    /* No way to allocate an event.  */
+    return INVALID_HANDLE_VALUE;
+  index = wq->offset + wq->count;
+  if (index >= wq->alloc)
+    index -= wq->alloc;
+  wq->array[index] = event;
+  wq->count++;
+  return event;
+}
+
+/* Notifies the first thread from a wait queue and dequeues it.  */
+static void
+glwthread_waitqueue_notify_first (glwthread_waitqueue_t *wq)
+{
+  SetEvent (wq->array[wq->offset + 0]);
+  wq->offset++;
+  wq->count--;
+  if (wq->count == 0 || wq->offset == wq->alloc)
+    wq->offset = 0;
+}
+
+/* Notifies all threads from a wait queue and dequeues them all.  */
+static void
+glwthread_waitqueue_notify_all (glwthread_waitqueue_t *wq)
+{
+  unsigned int i;
+
+  for (i = 0; i < wq->count; i++)
+    {
+      unsigned int index = wq->offset + i;
+      if (index >= wq->alloc)
+        index -= wq->alloc;
+      SetEvent (wq->array[index]);
+    }
+  wq->count = 0;
+  wq->offset = 0;
+}
+
+void
+glwthread_rwlock_init (glwthread_rwlock_t *lock)
+{
+  InitializeCriticalSection (&lock->lock);
+  glwthread_waitqueue_init (&lock->waiting_readers);
+  glwthread_waitqueue_init (&lock->waiting_writers);
+  lock->runcount = 0;
+  lock->guard.done = 1;
+}
+
+int
+glwthread_rwlock_rdlock (glwthread_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glwthread_rwlock_init (lock);
+      else
+        {
+          /* Don't let lock->guard.started grow and wrap around.  */
+          InterlockedDecrement (&lock->guard.started);
+          /* Yield the CPU while waiting for another thread to finish
+             initializing this lock.  */
+          while (!lock->guard.done)
+            Sleep (0);
+        }
+    }
+  EnterCriticalSection (&lock->lock);
+  /* Test whether only readers are currently running, and whether the runcount
+     field will not overflow, and whether no writer is waiting.  The latter
+     condition is because POSIX recommends that "write locks shall take
+     precedence over read locks", to avoid "writer starvation".  */
+  if (!(lock->runcount + 1 > 0 && lock->waiting_writers.count == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+         waiting_readers.  */
+      HANDLE event = glwthread_waitqueue_add (&lock->waiting_readers);
+      if (event != INVALID_HANDLE_VALUE)
+        {
+          DWORD result;
+          LeaveCriticalSection (&lock->lock);
+          /* Wait until another thread signals this event.  */
+          result = WaitForSingleObject (event, INFINITE);
+          if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+            abort ();
+          CloseHandle (event);
+          /* The thread which signalled the event already did the bookkeeping:
+             removed us from the waiting_readers, incremented lock->runcount.  */
+          if (!(lock->runcount > 0))
+            abort ();
+          return 0;
+        }
+      else
+        {
+          /* Allocation failure.  Weird.  */
+          do
+            {
+              LeaveCriticalSection (&lock->lock);
+              Sleep (1);
+              EnterCriticalSection (&lock->lock);
+            }
+          while (!(lock->runcount + 1 > 0));
+        }
+    }
+  lock->runcount++;
+  LeaveCriticalSection (&lock->lock);
+  return 0;
+}
+
+int
+glwthread_rwlock_wrlock (glwthread_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glwthread_rwlock_init (lock);
+      else
+        {
+          /* Don't let lock->guard.started grow and wrap around.  */
+          InterlockedDecrement (&lock->guard.started);
+          /* Yield the CPU while waiting for another thread to finish
+             initializing this lock.  */
+          while (!lock->guard.done)
+            Sleep (0);
+        }
+    }
+  EnterCriticalSection (&lock->lock);
+  /* Test whether no readers or writers are currently running.  */
+  if (!(lock->runcount == 0))
+    {
+      /* This thread has to wait for a while.  Enqueue it among the
+         waiting_writers.  */
+      HANDLE event = glwthread_waitqueue_add (&lock->waiting_writers);
+      if (event != INVALID_HANDLE_VALUE)
+        {
+          DWORD result;
+          LeaveCriticalSection (&lock->lock);
+          /* Wait until another thread signals this event.  */
+          result = WaitForSingleObject (event, INFINITE);
+          if (result == WAIT_FAILED || result == WAIT_TIMEOUT)
+            abort ();
+          CloseHandle (event);
+          /* The thread which signalled the event already did the bookkeeping:
+             removed us from the waiting_writers, set lock->runcount = -1.  */
+          if (!(lock->runcount == -1))
+            abort ();
+          return 0;
+        }
+      else
+        {
+          /* Allocation failure.  Weird.  */
+          do
+            {
+              LeaveCriticalSection (&lock->lock);
+              Sleep (1);
+              EnterCriticalSection (&lock->lock);
+            }
+          while (!(lock->runcount == 0));
+        }
+    }
+  lock->runcount--; /* runcount becomes -1 */
+  LeaveCriticalSection (&lock->lock);
+  return 0;
+}
+
+int
+glwthread_rwlock_tryrdlock (glwthread_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glwthread_rwlock_init (lock);
+      else
+        {
+          /* Don't let lock->guard.started grow and wrap around.  */
+          InterlockedDecrement (&lock->guard.started);
+          /* Yield the CPU while waiting for another thread to finish
+             initializing this lock.  */
+          while (!lock->guard.done)
+            Sleep (0);
+        }
+    }
+  /* It's OK to wait for this critical section, because it is never taken for a
+     long time.  */
+  EnterCriticalSection (&lock->lock);
+  /* Test whether only readers are currently running, and whether the runcount
+     field will not overflow, and whether no writer is waiting.  The latter
+     condition is because POSIX recommends that "write locks shall take
+     precedence over read locks", to avoid "writer starvation".  */
+  if (!(lock->runcount + 1 > 0 && lock->waiting_writers.count == 0))
+    {
+      /* This thread would have to wait for a while.  Return instead.  */
+      LeaveCriticalSection (&lock->lock);
+      return EBUSY;
+    }
+  lock->runcount++;
+  LeaveCriticalSection (&lock->lock);
+  return 0;
+}
+
+int
+glwthread_rwlock_trywrlock (glwthread_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    {
+      if (InterlockedIncrement (&lock->guard.started) == 0)
+        /* This thread is the first one to need this lock.  Initialize it.  */
+        glwthread_rwlock_init (lock);
+      else
+        {
+          /* Don't let lock->guard.started grow and wrap around.  */
+          InterlockedDecrement (&lock->guard.started);
+          /* Yield the CPU while waiting for another thread to finish
+             initializing this lock.  */
+          while (!lock->guard.done)
+            Sleep (0);
+        }
+    }
+  /* It's OK to wait for this critical section, because it is never taken for a
+     long time.  */
+  EnterCriticalSection (&lock->lock);
+  /* Test whether no readers or writers are currently running.  */
+  if (!(lock->runcount == 0))
+    {
+      /* This thread would have to wait for a while.  Return instead.  */
+      LeaveCriticalSection (&lock->lock);
+      return EBUSY;
+    }
+  lock->runcount--; /* runcount becomes -1 */
+  LeaveCriticalSection (&lock->lock);
+  return 0;
+}
+
+int
+glwthread_rwlock_unlock (glwthread_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    return EINVAL;
+  EnterCriticalSection (&lock->lock);
+  if (lock->runcount < 0)
+    {
+      /* Drop a writer lock.  */
+      if (!(lock->runcount == -1))
+        abort ();
+      lock->runcount = 0;
+    }
+  else
+    {
+      /* Drop a reader lock.  */
+      if (!(lock->runcount > 0))
+        {
+          LeaveCriticalSection (&lock->lock);
+          return EPERM;
+        }
+      lock->runcount--;
+    }
+  if (lock->runcount == 0)
+    {
+      /* POSIX recommends that "write locks shall take precedence over read
+         locks", to avoid "writer starvation".  */
+      if (lock->waiting_writers.count > 0)
+        {
+          /* Wake up one of the waiting writers.  */
+          lock->runcount--;
+          glwthread_waitqueue_notify_first (&lock->waiting_writers);
+        }
+      else
+        {
+          /* Wake up all waiting readers.  */
+          lock->runcount += lock->waiting_readers.count;
+          glwthread_waitqueue_notify_all (&lock->waiting_readers);
+        }
+    }
+  LeaveCriticalSection (&lock->lock);
+  return 0;
+}
+
+int
+glwthread_rwlock_destroy (glwthread_rwlock_t *lock)
+{
+  if (!lock->guard.done)
+    return EINVAL;
+  if (lock->runcount != 0)
+    return EBUSY;
+  DeleteCriticalSection (&lock->lock);
+  if (lock->waiting_readers.array != NULL)
+    free (lock->waiting_readers.array);
+  if (lock->waiting_writers.array != NULL)
+    free (lock->waiting_writers.array);
+  lock->guard.done = 0;
+  return 0;
+}
diff --git a/lib/windows-rwlock.h b/lib/windows-rwlock.h
new file mode 100644 (file)
index 0000000..7198c1e
--- /dev/null
@@ -0,0 +1,68 @@
+/* Read-write locks (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#ifndef _WINDOWS_RWLOCK_H
+#define _WINDOWS_RWLOCK_H
+
+#define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#include <windows.h>
+
+#include "windows-initguard.h"
+
+/* It is impossible to implement read-write locks using plain locks, without
+   introducing an extra thread dedicated to managing read-write locks.
+   Therefore here we need to use the low-level Event type.  */
+
+typedef struct
+        {
+          HANDLE *array; /* array of waiting threads, each represented by an event */
+          unsigned int count; /* number of waiting threads */
+          unsigned int alloc; /* length of allocated array */
+          unsigned int offset; /* index of first waiting thread in array */
+        }
+        glwthread_carray_waitqueue_t;
+typedef struct
+        {
+          glwthread_initguard_t guard; /* protects the initialization */
+          CRITICAL_SECTION lock; /* protects the remaining fields */
+          glwthread_carray_waitqueue_t waiting_readers; /* waiting readers */
+          glwthread_carray_waitqueue_t waiting_writers; /* waiting writers */
+          int runcount; /* number of readers running, or -1 when a writer runs */
+        }
+        glwthread_rwlock_t;
+
+#define GLWTHREAD_RWLOCK_INIT { GLWTHREAD_INITGUARD_INIT }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_rwlock_init (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_rdlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_wrlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_tryrdlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_trywrlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_unlock (glwthread_rwlock_t *lock);
+extern int glwthread_rwlock_destroy (glwthread_rwlock_t *lock);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_RWLOCK_H */
diff --git a/lib/windows-spawn.c b/lib/windows-spawn.c
new file mode 100644 (file)
index 0000000..49cbf3e
--- /dev/null
@@ -0,0 +1,727 @@
+/* Auxiliary functions for the creation of subprocesses.  Native Windows API.
+   Copyright (C) 2001, 2003-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "windows-spawn.h"
+
+/* Get declarations of the native Windows API functions.  */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+
+/* Get _get_osfhandle().  */
+#if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+#else
+# include <io.h>
+#endif
+#include <process.h>
+
+#include "findprog.h"
+
+/* Don't assume that UNICODE is not defined.  */
+#undef STARTUPINFO
+#define STARTUPINFO STARTUPINFOA
+#undef CreateProcess
+#define CreateProcess CreateProcessA
+
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037*?"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+
+/* Returns the length of a quoted argument string.  */
+static size_t
+quoted_arg_length (const char *string)
+{
+  bool quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+  size_t length;
+  unsigned int backslashes;
+  const char *s;
+
+  length = 0;
+  backslashes = 0;
+  if (quote_around)
+    length++;
+  for (s = string; *s != '\0'; s++)
+    {
+      char c = *s;
+      if (c == '"')
+        length += backslashes + 1;
+      length++;
+      if (c == '\\')
+        backslashes++;
+      else
+        backslashes = 0;
+    }
+  if (quote_around)
+    length += backslashes + 1;
+
+  return length;
+}
+
+/* Produces a quoted argument string.
+   Stores exactly quoted_arg_length (STRING) + 1 bytes, including the final
+   NUL byte, at MEM.
+   Returns a pointer past the stored quoted argument string.  */
+static char *
+quoted_arg_string (const char *string, char *mem)
+{
+  bool quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+  char *p;
+  unsigned int backslashes;
+  const char *s;
+
+  p = mem;
+  backslashes = 0;
+  if (quote_around)
+    *p++ = '"';
+  for (s = string; *s != '\0'; s++)
+    {
+      char c = *s;
+      if (c == '"')
+        {
+          unsigned int j;
+          for (j = backslashes + 1; j > 0; j--)
+            *p++ = '\\';
+        }
+      *p++ = c;
+      if (c == '\\')
+        backslashes++;
+      else
+        backslashes = 0;
+    }
+  if (quote_around)
+    {
+      unsigned int j;
+      for (j = backslashes; j > 0; j--)
+        *p++ = '\\';
+      *p++ = '"';
+    }
+  *p++ = '\0';
+
+  return p;
+}
+
+const char **
+prepare_spawn (const char * const *argv, char **mem_to_free)
+{
+  size_t argc;
+  const char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = (const char **) malloc ((1 + argc + 1) * sizeof (const char *));
+
+  /* Add an element upfront that can be used when argv[0] turns out to be a
+     script, not a program.
+     On Unix, this would be "/bin/sh". On native Windows, "sh" is actually
+     "sh.exe".  We have to omit the directory part and rely on the search in
+     PATH, because the mingw "mount points" are not visible inside Windows
+     CreateProcess().  */
+  new_argv[0] = "sh.exe";
+
+  /* Put quoted arguments into the new argument vector.  */
+  size_t needed_size = 0;
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+      size_t length;
+
+      if (string[0] == '\0')
+        length = strlen ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+        length = quoted_arg_length (string);
+      else
+        length = strlen (string);
+      needed_size += length + 1;
+    }
+
+  char *mem;
+  if (needed_size == 0)
+    mem = NULL;
+  else
+    {
+      mem = (char *) malloc (needed_size);
+      if (mem == NULL)
+        {
+          /* Memory allocation failure.  */
+          free (new_argv);
+          errno = ENOMEM;
+          return NULL;
+        }
+    }
+  *mem_to_free = mem;
+
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      new_argv[1 + i] = mem;
+      if (string[0] == '\0')
+        {
+          size_t length = strlen ("\"\"");
+          memcpy (mem, "\"\"", length + 1);
+          mem += length + 1;
+        }
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+        {
+          mem = quoted_arg_string (string, mem);
+        }
+      else
+        {
+          size_t length = strlen (string);
+          memcpy (mem, string, length + 1);
+          mem += length + 1;
+        }
+    }
+  new_argv[1 + argc] = NULL;
+
+  return new_argv;
+}
+
+char *
+compose_command (const char * const *argv)
+{
+  /* Just concatenate the argv[] strings, separated by spaces.  */
+  char *command;
+
+  /* Determine the size of the needed block of memory.  */
+  size_t total_size = 0;
+  const char * const *ap;
+  const char *p;
+  for (ap = argv; (p = *ap) != NULL; ap++)
+    total_size += strlen (p) + 1;
+  size_t command_size = (total_size > 0 ? total_size : 1);
+
+  /* Allocate the block of memory.  */
+  command = (char *) malloc (command_size);
+  if (command == NULL)
+    {
+      errno = ENOMEM;
+      return NULL;
+    }
+
+  /* Fill it.  */
+  if (total_size > 0)
+    {
+      char *cp = command;
+      for (ap = argv; (p = *ap) != NULL; ap++)
+        {
+          size_t size = strlen (p) + 1;
+          memcpy (cp, p, size - 1);
+          cp += size;
+          cp[-1] = ' ';
+        }
+      cp[-1] = '\0';
+    }
+  else
+    *command = '\0';
+
+  return command;
+}
+
+char *
+compose_envblock (const char * const *envp)
+{
+  /* This is a bit hairy, because we don't have a lock that would prevent other
+     threads from making modifications in ENVP.  So, just make sure we don't
+     crash; but if other threads are making modifications, part of the result
+     may be wrong.  */
+ retry:
+  {
+    /* Guess the size of the needed block of memory.
+       The guess will be exact if other threads don't make modifications.  */
+    size_t total_size = 0;
+    const char * const *ep;
+    const char *p;
+    for (ep = envp; (p = *ep) != NULL; ep++)
+      total_size += strlen (p) + 1;
+    size_t envblock_size = total_size;
+
+    /* Allocate the block of memory.  */
+    char *envblock = (char *) malloc (envblock_size + 1);
+    if (envblock == NULL)
+      {
+        errno = ENOMEM;
+        return NULL;
+      }
+    size_t envblock_used = 0;
+    for (ep = envp; (p = *ep) != NULL; ep++)
+      {
+        size_t size = strlen (p) + 1;
+        if (envblock_used + size > envblock_size)
+          {
+            /* Other threads did modifications.  Need more memory.  */
+            envblock_size += envblock_size / 2;
+            if (envblock_used + size > envblock_size)
+              envblock_size = envblock_used + size;
+
+            char *new_envblock = (char *) realloc (envblock, envblock_size + 1);
+            if (new_envblock == NULL)
+              {
+                free (envblock);
+                errno = ENOMEM;
+                return NULL;
+              }
+            envblock = new_envblock;
+          }
+        memcpy (envblock + envblock_used, p, size);
+        envblock_used += size;
+        if (envblock[envblock_used - 1] != '\0')
+          {
+            /* Other threads did modifications.  Restart.  */
+            free (envblock);
+            goto retry;
+          }
+      }
+    envblock[envblock_used] = '\0';
+    return envblock;
+  }
+}
+
+int
+init_inheritable_handles (struct inheritable_handles *inh_handles,
+                          bool duplicate)
+{
+  /* Determine the minimal count of handles we need to care about.  */
+  size_t handles_count;
+  {
+    /* _getmaxstdio
+       <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/getmaxstdio>
+       Default value is 512.  */
+    unsigned int fdmax = _getmaxstdio ();
+    if (fdmax < 3)
+      fdmax = 3;
+    for (; fdmax > 3; fdmax--)
+      {
+        unsigned int fd = fdmax - 1;
+        /* _get_osfhandle
+           <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle>  */
+        HANDLE handle = (HANDLE) _get_osfhandle (fd);
+        if (handle != INVALID_HANDLE_VALUE)
+          {
+            DWORD hflags;
+            /* GetHandleInformation
+               <https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation>  */
+            if (GetHandleInformation (handle, &hflags))
+              {
+                if ((hflags & HANDLE_FLAG_INHERIT) != 0)
+                  /* fd denotes an inheritable descriptor.  */
+                  break;
+              }
+          }
+      }
+    handles_count = fdmax;
+  }
+  /* Note: handles_count >= 3.  */
+
+  /* Allocate the arrays.  */
+  size_t handles_allocated = handles_count;
+  HANDLE *handles_array =
+    (HANDLE *) malloc (handles_allocated * sizeof (HANDLE));
+  if (handles_array == NULL)
+    {
+      errno = ENOMEM;
+      return -1;
+    }
+  unsigned char *flags_array =
+    (unsigned char *) malloc (handles_allocated * sizeof (unsigned char));
+  if (flags_array == NULL)
+    {
+      free (handles_array);
+      errno = ENOMEM;
+      return -1;
+    }
+
+  /* Fill in the two arrays.  */
+  {
+    HANDLE curr_process = (duplicate ? GetCurrentProcess () : INVALID_HANDLE_VALUE);
+    unsigned int fd;
+    for (fd = 0; fd < handles_count; fd++)
+      {
+        handles_array[fd] = INVALID_HANDLE_VALUE;
+        /* _get_osfhandle
+           <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/get-osfhandle>  */
+        HANDLE handle = (HANDLE) _get_osfhandle (fd);
+        if (handle != INVALID_HANDLE_VALUE)
+          {
+            DWORD hflags;
+            /* GetHandleInformation
+               <https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation>  */
+            if (GetHandleInformation (handle, &hflags))
+              {
+                if ((hflags & HANDLE_FLAG_INHERIT) != 0)
+                  {
+                    /* fd denotes an inheritable descriptor.  */
+                    if (duplicate)
+                      {
+                        if (!DuplicateHandle (curr_process, handle,
+                                              curr_process, &handles_array[fd],
+                                              0, TRUE, DUPLICATE_SAME_ACCESS))
+                          {
+                            unsigned int i;
+                            for (i = 0; i < fd; i++)
+                              if (handles_array[i] != INVALID_HANDLE_VALUE)
+                                CloseHandle (handles_array[i]);
+                            free (flags_array);
+                            free (handles_array);
+                            errno = EBADF; /* arbitrary */
+                            return -1;
+                          }
+                      }
+                    else
+                      handles_array[fd] = handle;
+
+                    flags_array[fd] = 0;
+                  }
+              }
+          }
+      }
+  }
+
+  /* Return the result.  */
+  inh_handles->count = handles_count;
+  inh_handles->allocated = handles_allocated;
+  inh_handles->handles = handles_array;
+  inh_handles->flags = flags_array;
+  return 0;
+}
+
+int
+compose_handles_block (const struct inheritable_handles *inh_handles,
+                       STARTUPINFO *sinfo)
+{
+  /* STARTUPINFO
+     <https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa>  */
+  sinfo->dwFlags = STARTF_USESTDHANDLES;
+  sinfo->hStdInput  = inh_handles->handles[0];
+  sinfo->hStdOutput = inh_handles->handles[1];
+  sinfo->hStdError  = inh_handles->handles[2];
+
+  /* On newer versions of Windows, more file descriptors / handles than the
+     first three can be passed.
+     The format is as follows: Let N be an exclusive upper bound for the file
+     descriptors to be passed. Two arrays are constructed in memory:
+       - flags[0..N-1], of element type 'unsigned char',
+       - handles[0..N-1], of element type 'HANDLE' or 'intptr_t'.
+     For used entries, handles[i] is the handle, and flags[i] is a set of flags,
+     a combination of:
+        1 for open file descriptors,
+       64 for handles of type FILE_TYPE_CHAR,
+        8 for handles of type FILE_TYPE_PIPE,
+       32 for O_APPEND.
+     For unused entries - this may include any of the first three, since they
+     are already passed above -, handles[i] is INVALID_HANDLE_VALUE and flags[i]
+     is zero.
+     lpReserved2 now is a pointer to the concatenation (without padding) of:
+       - an 'unsigned int' whose value is N,
+       - the contents of the flags[0..N-1] array,
+       - the contents of the handles[0..N-1] array.
+     cbReserved2 is the size (in bytes) of the object at lpReserved2.  */
+
+  size_t handles_count = inh_handles->count;
+
+  sinfo->cbReserved2 =
+    sizeof (unsigned int)
+    + handles_count * sizeof (unsigned char)
+    + handles_count * sizeof (HANDLE);
+  /* Add some padding, so that we can work with a properly aligned HANDLE
+     array.  */
+  char *hblock = (char *) malloc (sinfo->cbReserved2 + (sizeof (HANDLE) - 1));
+  if (hblock == NULL)
+    {
+      errno = ENOMEM;
+      return -1;
+    }
+  unsigned char *flags = (unsigned char *) (hblock + sizeof (unsigned int));
+  char *handles = (char *) (flags + handles_count);
+  HANDLE *handles_aligned =
+    (HANDLE *) (((uintptr_t) handles + (sizeof (HANDLE) - 1))
+                & - (uintptr_t) sizeof (HANDLE));
+
+  * (unsigned int *) hblock = handles_count;
+  {
+    unsigned int fd;
+    for (fd = 0; fd < handles_count; fd++)
+      {
+        handles_aligned[fd] = INVALID_HANDLE_VALUE;
+        flags[fd] = 0;
+
+        HANDLE handle = inh_handles->handles[fd];
+        if (handle != INVALID_HANDLE_VALUE
+            /* The first three are possibly already passed above.
+               But they need to passed here as well, if they have some flags.  */
+            && (fd >= 3 || inh_handles->flags[fd] != 0))
+          {
+            DWORD hflags;
+            /* GetHandleInformation
+               <https://docs.microsoft.com/en-us/windows/win32/api/handleapi/nf-handleapi-gethandleinformation>  */
+            if (GetHandleInformation (handle, &hflags))
+              {
+                if ((hflags & HANDLE_FLAG_INHERIT) != 0)
+                  {
+                    /* fd denotes an inheritable descriptor.  */
+                    handles_aligned[fd] = handle;
+                    /* On Microsoft Windows, it would be sufficient to set
+                       flags[fd] = 1.  But on ReactOS or Wine, adding the bit
+                       that indicates the handle type may be necessary.  So,
+                       just do it everywhere.  */
+                    flags[fd] = 1 | inh_handles->flags[fd];
+                    switch (GetFileType (handle))
+                      {
+                      case FILE_TYPE_CHAR:
+                        flags[fd] |= 64;
+                        break;
+                      case FILE_TYPE_PIPE:
+                        flags[fd] |= 8;
+                        break;
+                      default:
+                        break;
+                      }
+                  }
+                else
+                  /* We shouldn't have any non-inheritable handles in
+                     inh_handles->handles.  */
+                  abort ();
+              }
+          }
+      }
+  }
+  if (handles != (char *) handles_aligned)
+    memmove (handles, (char *) handles_aligned, handles_count * sizeof (HANDLE));
+
+  sinfo->lpReserved2 = (BYTE *) hblock;
+
+  return 0;
+}
+
+void
+free_inheritable_handles (struct inheritable_handles *inh_handles)
+{
+  free (inh_handles->flags);
+  free (inh_handles->handles);
+}
+
+int
+convert_CreateProcess_error (DWORD error)
+{
+  /* Some of these errors probably cannot happen.  But who knows...  */
+  switch (error)
+    {
+    case ERROR_FILE_NOT_FOUND:
+    case ERROR_PATH_NOT_FOUND:
+    case ERROR_BAD_PATHNAME:
+    case ERROR_BAD_NET_NAME:
+    case ERROR_INVALID_NAME:
+    case ERROR_DIRECTORY:
+      return ENOENT;
+      break;
+
+    case ERROR_ACCESS_DENIED:
+    case ERROR_SHARING_VIOLATION:
+      return EACCES;
+      break;
+
+    case ERROR_OUTOFMEMORY:
+      return ENOMEM;
+      break;
+
+    case ERROR_BUFFER_OVERFLOW:
+    case ERROR_FILENAME_EXCED_RANGE:
+      return ENAMETOOLONG;
+      break;
+
+    case ERROR_BAD_FORMAT:
+    case ERROR_BAD_EXE_FORMAT:
+      return ENOEXEC;
+      break;
+
+    default:
+      return EINVAL;
+      break;
+    }
+}
+
+intptr_t
+spawnpvech (int mode,
+            const char *progname, const char * const *argv,
+            const char * const *envp,
+            const char *currdir,
+            HANDLE stdin_handle, HANDLE stdout_handle, HANDLE stderr_handle)
+{
+  /* Validate the arguments.  */
+  if (!(mode == P_WAIT
+        || mode == P_NOWAIT
+        || mode == P_DETACH
+        || mode == P_OVERLAY)
+      || progname == NULL || argv == NULL)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+
+  /* Implement the 'p' letter: search for PROGNAME in getenv ("PATH").  */
+  const char *resolved_progname =
+    find_in_given_path (progname, getenv ("PATH"), NULL, false);
+  if (resolved_progname == NULL)
+    return -1;
+
+  /* Compose the command.  */
+  char *command = compose_command (argv);
+  if (command == NULL)
+    goto out_of_memory_1;
+
+  /* Copy *ENVP into a contiguous block of memory.  */
+  char *envblock;
+  if (envp == NULL)
+    envblock = NULL;
+  else
+    {
+      envblock = compose_envblock (envp);
+      if (envblock == NULL)
+        goto out_of_memory_2;
+    }
+
+  /* Collect the inheritable handles.  */
+  struct inheritable_handles inh_handles;
+  if (init_inheritable_handles (&inh_handles, false) < 0)
+    {
+      int saved_errno = errno;
+      if (envblock != NULL)
+        free (envblock);
+      free (command);
+      if (resolved_progname != progname)
+        free ((char *) resolved_progname);
+      errno = saved_errno;
+      return -1;
+    }
+  inh_handles.handles[0] = stdin_handle;  inh_handles.flags[0] = 0;
+  inh_handles.handles[1] = stdout_handle; inh_handles.flags[1] = 0;
+  inh_handles.handles[2] = stderr_handle; inh_handles.flags[2] = 0;
+
+  /* CreateProcess
+     <https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessa>  */
+  /* <https://docs.microsoft.com/en-us/windows/win32/procthread/process-creation-flags>  */
+  DWORD process_creation_flags = (mode == P_DETACH ? DETACHED_PROCESS : 0);
+  /* STARTUPINFO
+     <https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/ns-processthreadsapi-startupinfoa>  */
+  STARTUPINFO sinfo;
+  sinfo.cb = sizeof (STARTUPINFO);
+  sinfo.lpReserved = NULL;
+  sinfo.lpDesktop = NULL;
+  sinfo.lpTitle = NULL;
+  if (compose_handles_block (&inh_handles, &sinfo) < 0)
+    {
+      int saved_errno = errno;
+      free_inheritable_handles (&inh_handles);
+      if (envblock != NULL)
+        free (envblock);
+      free (command);
+      if (resolved_progname != progname)
+        free ((char *) resolved_progname);
+      errno = saved_errno;
+      return -1;
+    }
+
+  PROCESS_INFORMATION pinfo;
+  if (!CreateProcess (resolved_progname, command, NULL, NULL, TRUE,
+                      process_creation_flags, envblock, currdir, &sinfo,
+                      &pinfo))
+    {
+      DWORD error = GetLastError ();
+
+      free (sinfo.lpReserved2);
+      free_inheritable_handles (&inh_handles);
+      if (envblock != NULL)
+        free (envblock);
+      free (command);
+      if (resolved_progname != progname)
+        free ((char *) resolved_progname);
+
+      errno = convert_CreateProcess_error (error);
+      return -1;
+    }
+
+  if (pinfo.hThread)
+    CloseHandle (pinfo.hThread);
+  free (sinfo.lpReserved2);
+  free_inheritable_handles (&inh_handles);
+  if (envblock != NULL)
+    free (envblock);
+  free (command);
+  if (resolved_progname != progname)
+    free ((char *) resolved_progname);
+
+  switch (mode)
+    {
+    case P_WAIT:
+      {
+        /* Wait until it terminates.  Then get its exit status code.  */
+        switch (WaitForSingleObject (pinfo.hProcess, INFINITE))
+          {
+          case WAIT_OBJECT_0:
+            break;
+          case WAIT_FAILED:
+            errno = ECHILD;
+            return -1;
+          default:
+            abort ();
+          }
+
+        DWORD exit_code;
+        if (!GetExitCodeProcess (pinfo.hProcess, &exit_code))
+          {
+            errno = ECHILD;
+            return -1;
+          }
+        CloseHandle (pinfo.hProcess);
+        return exit_code;
+      }
+
+    case P_NOWAIT:
+      /* Return pinfo.hProcess, not pinfo.dwProcessId.  */
+      return (intptr_t) pinfo.hProcess;
+
+    case P_DETACH:
+    case P_OVERLAY:
+      CloseHandle (pinfo.hProcess);
+      return 0;
+
+    default:
+      /* Already checked above.  */
+      abort ();
+    }
+
+  /*NOTREACHED*/
+ out_of_memory_2:
+  free (command);
+ out_of_memory_1:
+  if (resolved_progname != progname)
+    free ((char *) resolved_progname);
+  errno = ENOMEM;
+  return -1;
+}
diff --git a/lib/windows-spawn.h b/lib/windows-spawn.h
new file mode 100644 (file)
index 0000000..9bcfb1c
--- /dev/null
@@ -0,0 +1,154 @@
+/* Auxiliary functions for the creation of subprocesses.  Native Windows API.
+   Copyright (C) 2001, 2003-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2003.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _WINDOWS_SPAWN_H
+#define _WINDOWS_SPAWN_H
+
+#include <stdbool.h>
+#include <stdint.h>
+
+/* Get declarations of the native Windows API functions.  */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+
+/* Prepares an argument vector before calling spawn().
+
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Windows CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+   - '*', '?' characters may get expanded through wildcard expansion in the
+     callee: By default, in the callee, the initialization code before main()
+     takes the result of GetCommandLine(), wildcard-expands it, and passes it
+     to main(). The exceptions to this rule are:
+       - programs that inspect GetCommandLine() and ignore argv,
+       - mingw programs that have a global variable 'int _CRT_glob = 0;',
+       - Cygwin programs, when invoked from a Cygwin program.
+
+   prepare_spawn creates and returns a new argument vector, where the arguments
+   are appropriately quoted and an additional argument "sh.exe" has been added
+   at the beginning.  The new argument vector is freshly allocated.  The memory
+   for all its elements is allocated within *MEM_TO_FREE, which is freshly
+   allocated as well.  In case of memory allocation failure, NULL is returned,
+   with errno set.
+ */
+extern const char ** prepare_spawn (const char * const *argv,
+                                    char **mem_to_free);
+
+/* Composes the command to be passed to CreateProcess().
+   ARGV must contain appropriately quoted arguments, as returned by
+   prepare_spawn.
+   Returns a freshly allocated string.  In case of memory allocation failure,
+   NULL is returned, with errno set.  */
+extern char * compose_command (const char * const *argv);
+
+/* Composes the block of memory that contains the environment variables.
+   ENVP must contain an environment (a NULL-terminated array of string of the
+   form VARIABLE=VALUE).
+   Returns a freshly allocated block of memory.  In case of memory allocation
+   failure, NULL is returned, with errno set.  */
+extern char * compose_envblock (const char * const *envp);
+
+
+/* This struct keeps track of which handles to pass to a subprocess, and with
+   which flags.  All of the handles here are inheritable.
+   Regarding handle inheritance, see
+   <https://docs.microsoft.com/en-us/windows/win32/sysinfo/handle-inheritance>  */
+struct inheritable_handles
+{
+  /* The number of occupied entries in the two arrays below.
+     3 <= count <= allocated.  */
+  size_t count;
+  /* The number of allocated entries in the two arrays below.  */
+  size_t allocated;
+  /* handles[0..count-1] are the occupied entries.
+     handles[fd] is either INVALID_HANDLE_VALUE or an inheritable handle.  */
+  HANDLE *handles;
+  /* flags[0..count-1] are the occupied entries.
+     flags[fd] is only relevant if handles[fd] != INVALID_HANDLE_VALUE.
+     It is a bit mask consisting of:
+       - 32 for O_APPEND.
+   */
+  unsigned char *flags;
+};
+
+/* Initializes a set of inheritable handles, filling in all inheritable handles
+   assigned to file descriptors.
+   If DUPLICATE is true, the handles stored in the set are duplicates.
+   Returns 0 upon success.  In case of failure, -1 is returned, with errno set.
+ */
+extern int init_inheritable_handles (struct inheritable_handles *inh_handles,
+                                     bool duplicate);
+
+/* Fills a set of inheritable handles into a STARTUPINFO for CreateProcess().
+   Returns 0 upon success.  In case of failure, -1 is returned, with errno set.
+ */
+extern int compose_handles_block (const struct inheritable_handles *inh_handles,
+                                  STARTUPINFOA *sinfo);
+
+/* Frees the memory held by a set of inheritable handles.  */
+extern void free_inheritable_handles (struct inheritable_handles *inh_handles);
+
+
+/* Converts a CreateProcess() error code (retrieved through GetLastError()) to
+   an errno value.  */
+extern int convert_CreateProcess_error (DWORD error);
+
+
+/* Creates a subprocess.
+   MODE is either P_WAIT or P_NOWAIT.
+   PROGNAME is the program to invoke.
+   ARGV is the NULL-terminated array of arguments, ARGV[0] being PROGNAME by
+   convention.
+   ENVP is the NULL-terminated set of environment variable assignments, or NULL
+   to inherit the initial environ variable assignments from the caller and
+   ignore all calls to putenv(), setenv(), unsetenv() done in the caller.
+   CURRDIR is the directory in which to start the program, or NULL to inherit
+   the working directory from the caller.
+   STDIN_HANDLE, STDOUT_HANDLE, STDERR_HANDLE are the handles to use for the
+   first three file descriptors in the callee process.
+   Returns
+     - 0 for success (if MODE is P_WAIT), or
+     - a handle that be passed to _cwait (on Windows) or waitpid (on OS/2), or
+     - -1 upon error, with errno set.
+ */
+extern intptr_t spawnpvech (int mode,
+                            const char *progname, const char * const *argv,
+                            const char * const *envp,
+                            const char *currdir,
+                            HANDLE stdin_handle, HANDLE stdout_handle,
+                            HANDLE stderr_handle);
+
+#endif /* _WINDOWS_SPAWN_H */
diff --git a/lib/windows-spin.c b/lib/windows-spin.c
new file mode 100644 (file)
index 0000000..822baff
--- /dev/null
@@ -0,0 +1,70 @@
+/* Spin locks (native Windows implementation).
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "windows-spin.h"
+
+#include <errno.h>
+
+void
+glwthread_spin_init (glwthread_spinlock_t *lock)
+{
+  lock->word = 0;
+  MemoryBarrier ();
+}
+
+int
+glwthread_spin_lock (glwthread_spinlock_t *lock)
+{
+  /* Wait until lock->word becomes 0, then replace it with 1.  */
+  /* InterlockedCompareExchange
+     <https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-interlockedcompareexchange> */
+  while (InterlockedCompareExchange (&lock->word, 1, 0))
+    ;
+  return 0;
+}
+
+int
+glwthread_spin_trylock (glwthread_spinlock_t *lock)
+{
+  /* If lock->word is 0, then replace it with 1.  */
+  /* InterlockedCompareExchange
+     <https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-interlockedcompareexchange> */
+  if (InterlockedCompareExchange (&lock->word, 1, 0))
+    return EBUSY;
+  return 0;
+}
+
+int
+glwthread_spin_unlock (glwthread_spinlock_t *lock)
+{
+  /* If lock->word is 1, then replace it with 0.  */
+  /* InterlockedCompareExchange
+     <https://docs.microsoft.com/en-us/windows/win32/api/winnt/nf-winnt-interlockedcompareexchange> */
+  if (!InterlockedCompareExchange (&lock->word, 0, 1))
+    return EINVAL;
+  return 0;
+}
+
+int
+glwthread_spin_destroy (glwthread_spinlock_t *lock)
+{
+  return 0;
+}
diff --git a/lib/windows-spin.h b/lib/windows-spin.h
new file mode 100644 (file)
index 0000000..3902830
--- /dev/null
@@ -0,0 +1,47 @@
+/* Spin locks (native Windows implementation).
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#ifndef _WINDOWS_SPIN_H
+#define _WINDOWS_SPIN_H
+
+#define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#include <windows.h>
+
+typedef struct
+        {
+          LONG volatile word;
+        }
+        glwthread_spinlock_t;
+
+#define GLWTHREAD_SPIN_INIT { 0 }
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void glwthread_spin_init (glwthread_spinlock_t *lock);
+extern int glwthread_spin_lock (glwthread_spinlock_t *lock);
+extern int glwthread_spin_trylock (glwthread_spinlock_t *lock);
+extern int glwthread_spin_unlock (glwthread_spinlock_t *lock);
+extern int glwthread_spin_destroy (glwthread_spinlock_t *lock);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_SPIN_H */
diff --git a/lib/windows-tls.c b/lib/windows-tls.c
new file mode 100644 (file)
index 0000000..55c77a4
--- /dev/null
@@ -0,0 +1,339 @@
+/* Thread-local storage (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "windows-tls.h"
+
+#include <errno.h>
+#include <limits.h>
+#include <stdlib.h>
+
+#include "windows-once.h"
+
+void *
+glwthread_tls_get (glwthread_tls_key_t key)
+{
+  return TlsGetValue (key);
+}
+
+int
+glwthread_tls_set (glwthread_tls_key_t key, void *value)
+{
+  if (!TlsSetValue (key, value))
+    return EINVAL;
+  return 0;
+}
+
+/* The following variables keep track of TLS keys with non-NULL destructor.  */
+
+static glwthread_once_t dtor_table_init_once = GLWTHREAD_ONCE_INIT;
+
+static CRITICAL_SECTION dtor_table_lock;
+
+struct dtor { glwthread_tls_key_t key; void (*destructor) (void *); };
+
+/* The table of dtors.  */
+static struct dtor *dtor_table;
+/* Number of active entries in the dtor_table.  */
+static unsigned int dtors_count;
+/* Valid indices into dtor_table are 0..dtors_used-1.  */
+static unsigned int dtors_used;
+/* Allocation size of dtor_table.  */
+static unsigned int dtors_allocated;
+/* Invariant: 0 <= dtors_count <= dtors_used <= dtors_allocated.  */
+
+/* Number of threads that are currently processing destructors.  */
+static unsigned int dtor_processing_threads;
+
+static void
+dtor_table_initialize (void)
+{
+  InitializeCriticalSection (&dtor_table_lock);
+  /* The other variables are already initialized to NULL or 0, respectively.  */
+}
+
+static void
+dtor_table_ensure_initialized (void)
+{
+  glwthread_once (&dtor_table_init_once, dtor_table_initialize);
+}
+
+/* Shrinks dtors_used down to dtors_count, by replacing inactive entries
+   with active ones.  */
+static void
+dtor_table_shrink_used (void)
+{
+  unsigned int i = 0;
+  unsigned int j = dtors_used;
+
+  for (;;)
+    {
+      BOOL i_found = FALSE;
+      BOOL j_found = FALSE;
+      /* Find the next inactive entry, from the left.  */
+      for (; i < dtors_count;)
+        {
+          if (dtor_table[i].destructor == NULL)
+            {
+              i_found = TRUE;
+              break;
+            }
+          i++;
+        }
+
+      /* Find the next active entry, from the right.  */
+      for (; j > dtors_count;)
+        {
+          j--;
+          if (dtor_table[j].destructor != NULL)
+            {
+              j_found = TRUE;
+              break;
+            }
+        }
+
+      if (i_found != j_found)
+        /* dtors_count was apparently wrong.  */
+        abort ();
+
+      if (!i_found)
+        break;
+
+      /* i_found and j_found are TRUE.  Swap the two entries.  */
+      dtor_table[i] = dtor_table[j];
+
+      i++;
+    }
+
+  dtors_used = dtors_count;
+}
+
+void
+glwthread_tls_process_destructors (void)
+{
+  unsigned int repeat;
+
+  dtor_table_ensure_initialized ();
+
+  EnterCriticalSection (&dtor_table_lock);
+  if (dtor_processing_threads == 0)
+    {
+      /* Now it's the appropriate time for shrinking dtors_used.  */
+      if (dtors_used > dtors_count)
+        dtor_table_shrink_used ();
+    }
+  dtor_processing_threads++;
+
+  for (repeat = GLWTHREAD_DESTRUCTOR_ITERATIONS; repeat > 0; repeat--)
+    {
+      unsigned int destructors_run = 0;
+
+      /* Iterate across dtor_table.  We don't need to make a copy of dtor_table,
+         because
+           * When another thread calls glwthread_tls_key_create with a non-NULL
+             destructor argument, this will possibly reallocate the dtor_table
+             array and increase dtors_allocated as well as dtors_used and
+             dtors_count, but it will not change dtors_used nor the contents of
+             the first dtors_used entries of dtor_table.
+           * When another thread calls glwthread_tls_key_delete, this will
+             possibly set some 'destructor' member to NULL, thus marking an
+             entry as inactive, but it will not otherwise change dtors_used nor
+             the contents of the first dtors_used entries of dtor_table.  */
+      unsigned int i_limit = dtors_used;
+      unsigned int i;
+
+      for (i = 0; i < i_limit; i++)
+        {
+          struct dtor current = dtor_table[i];
+          if (current.destructor != NULL)
+            {
+              /* The current dtor has not been deleted yet.  */
+              void *current_value = glwthread_tls_get (current.key);
+              if (current_value != NULL)
+                {
+                  /* The current value is non-NULL.  Run the destructor.  */
+                  glwthread_tls_set (current.key, NULL);
+                  LeaveCriticalSection (&dtor_table_lock);
+                  current.destructor (current_value);
+                  EnterCriticalSection (&dtor_table_lock);
+                  destructors_run++;
+                }
+            }
+        }
+
+      /* When all TLS values were already NULL, no further iterations are
+         needed.  */
+      if (destructors_run == 0)
+        break;
+    }
+
+  dtor_processing_threads--;
+  LeaveCriticalSection (&dtor_table_lock);
+}
+
+int
+glwthread_tls_key_create (glwthread_tls_key_t *keyp, void (*destructor) (void *))
+{
+  if (destructor != NULL)
+    {
+      dtor_table_ensure_initialized ();
+
+      EnterCriticalSection (&dtor_table_lock);
+      if (dtor_processing_threads == 0)
+        {
+          /* Now it's the appropriate time for shrinking dtors_used.  */
+          if (dtors_used > dtors_count)
+            dtor_table_shrink_used ();
+        }
+
+      while (dtors_used == dtors_allocated)
+        {
+          /* Need to grow the dtor_table.  */
+          unsigned int new_allocated = 2 * dtors_allocated + 1;
+          if (new_allocated < 7)
+            new_allocated = 7;
+          if (new_allocated <= dtors_allocated) /* overflow? */
+            new_allocated = UINT_MAX;
+
+          LeaveCriticalSection (&dtor_table_lock);
+          {
+            struct dtor *new_table =
+              (struct dtor *) malloc (new_allocated * sizeof (struct dtor));
+            if (new_table == NULL)
+              return ENOMEM;
+            EnterCriticalSection (&dtor_table_lock);
+            /* Attention! dtors_used, dtors_allocated may have changed!  */
+            if (dtors_used < new_allocated)
+              {
+                if (dtors_allocated < new_allocated)
+                  {
+                    /* The new_table is useful.  */
+                    memcpy (new_table, dtor_table,
+                            dtors_used * sizeof (struct dtor));
+                    dtor_table = new_table;
+                    dtors_allocated = new_allocated;
+                  }
+                else
+                  {
+                    /* The new_table is not useful, since another thread
+                       meanwhile allocated a drop_table that is at least
+                       as large.  */
+                    free (new_table);
+                  }
+                break;
+              }
+            /* The new_table is not useful, since other threads increased
+               dtors_used.  Free it any retry.  */
+            free (new_table);
+          }
+        }
+      /* Here dtors_used < dtors_allocated.  */
+      {
+        /* Allocate a new key.  */
+        glwthread_tls_key_t key = TlsAlloc ();
+        if (key == (DWORD)-1)
+          {
+            LeaveCriticalSection (&dtor_table_lock);
+            return EAGAIN;
+          }
+        /* Store the new dtor in the dtor_table, after all used entries.
+           Do not overwrite inactive entries with indices < dtors_used, in order
+           not to disturb glwthread_tls_process_destructors invocations that may
+           be executing in other threads.  */
+        dtor_table[dtors_used].key = key;
+        dtor_table[dtors_used].destructor = destructor;
+        dtors_used++;
+        dtors_count++;
+        LeaveCriticalSection (&dtor_table_lock);
+        *keyp = key;
+      }
+    }
+  else
+    {
+      /* Allocate a new key.  */
+      glwthread_tls_key_t key = TlsAlloc ();
+      if (key == (DWORD)-1)
+        return EAGAIN;
+      *keyp = key;
+    }
+  return 0;
+}
+
+int
+glwthread_tls_key_delete (glwthread_tls_key_t key)
+{
+  /* Should the destructor be called for all threads that are currently running?
+     Probably not, because
+       - ISO C does not specify when the destructor is to be invoked at all.
+       - In POSIX, the destructor functions specified with pthread_key_create()
+         are invoked at thread exit.
+       - It would be hard to implement, because there are no primitives for
+         accessing thread-specific values from a different thread.  */
+  dtor_table_ensure_initialized ();
+
+  EnterCriticalSection (&dtor_table_lock);
+  if (dtor_processing_threads == 0)
+    {
+      /* Now it's the appropriate time for shrinking dtors_used.  */
+      if (dtors_used > dtors_count)
+        dtor_table_shrink_used ();
+      /* Here dtors_used == dtors_count.  */
+
+      /* Find the key in dtor_table.  */
+      {
+        unsigned int i_limit = dtors_used;
+        unsigned int i;
+
+        for (i = 0; i < i_limit; i++)
+          if (dtor_table[i].key == key)
+            {
+              if (i < dtors_used - 1)
+                /* Swap the entries i and dtors_used - 1.  */
+                dtor_table[i] = dtor_table[dtors_used - 1];
+              dtors_count = dtors_used = dtors_used - 1;
+              break;
+            }
+      }
+    }
+  else
+    {
+      /* Be careful not to disturb the glwthread_tls_process_destructors
+         invocations that are executing in other threads.  */
+      unsigned int i_limit = dtors_used;
+      unsigned int i;
+
+      for (i = 0; i < i_limit; i++)
+        if (dtor_table[i].destructor != NULL /* skip inactive entries */
+            && dtor_table[i].key == key)
+          {
+            /* Mark this entry as inactive.  */
+            dtor_table[i].destructor = NULL;
+            dtors_count = dtors_count - 1;
+            break;
+          }
+    }
+  LeaveCriticalSection (&dtor_table_lock);
+  /* Now we have ensured that glwthread_tls_process_destructors will no longer
+     use this key.  */
+
+  if (!TlsFree (key))
+    return EINVAL;
+  return 0;
+}
diff --git a/lib/windows-tls.h b/lib/windows-tls.h
new file mode 100644 (file)
index 0000000..2f7f662
--- /dev/null
@@ -0,0 +1,42 @@
+/* Thread-local storage (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
+
+#ifndef _WINDOWS_TLS_H
+#define _WINDOWS_TLS_H
+
+#define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#include <windows.h>
+
+typedef DWORD glwthread_tls_key_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int glwthread_tls_key_create (glwthread_tls_key_t *keyp, void (*destructor) (void *));
+extern void *glwthread_tls_get (glwthread_tls_key_t key);
+extern int glwthread_tls_set (glwthread_tls_key_t key, void *value);
+extern int glwthread_tls_key_delete (glwthread_tls_key_t key);
+extern void glwthread_tls_process_destructors (void);
+#define GLWTHREAD_DESTRUCTOR_ITERATIONS 4
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_TLS_H */
index 4c7994b..1bf0a9e 100644 (file)
@@ -1,6 +1,6 @@
 /* Report a memory allocation failure and exit.
 
-   Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2016 Free Software
+   Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2021 Free Software
    Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 503bb37..dbaee4a 100644 (file)
@@ -1,6 +1,6 @@
 /* xalloc-oversized.h -- memory allocation size checking
 
-   Copyright (C) 1990-2000, 2003-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1990-2000, 2003-2004, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef XALLOC_OVERSIZED_H_
 #define XALLOC_OVERSIZED_H_
 #include <stddef.h>
 #include <stdint.h>
 
-/* Default for (non-Clang) compilers that lack __has_builtin.  */
-#ifndef __has_builtin
-# define __has_builtin(x) 0
-#endif
-
-/* True if N * S would overflow in a size_t calculation,
-   or would generate a value larger than PTRDIFF_MAX.
+/* True if N * S does not fit into both ptrdiff_t and size_t.
+   N and S should be nonnegative and free of side effects.
    This expands to a constant expression if N and S are both constants.
-   By gnulib convention, SIZE_MAX represents overflow in size
+   By gnulib convention, SIZE_MAX represents overflow in size_t
    calculations, so the conservative size_t-based dividend to use here
    is SIZE_MAX - 1.  */
 #define __xalloc_oversized(n, s) \
-  ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) < (n))
+  ((s) != 0 \
+   && ((size_t) (PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX - 1) / (s) \
+       < (n)))
 
-#if PTRDIFF_MAX < SIZE_MAX
-typedef ptrdiff_t __xalloc_count_type;
-#else
-typedef size_t __xalloc_count_type;
-#endif
+/* Return 1 if and only if an array of N objects, each of size S,
+   cannot exist reliably because its total size in bytes would exceed
+   MIN (PTRDIFF_MAX, SIZE_MAX - 1).
+
+   N and S should be nonnegative and free of side effects.
 
-/* Return 1 if an array of N objects, each of size S, cannot exist
-   reliably due to size or ptrdiff_t arithmetic overflow.  S must be
-   positive and N must be nonnegative.  This is a macro, not a
-   function, so that it works correctly even when SIZE_MAX < N.  */
+   Warning: (xalloc_oversized (N, S) ? NULL : malloc (N * S)) can
+   misbehave if N and S are both narrower than ptrdiff_t and size_t,
+   and can be rewritten as (xalloc_oversized (N, S) ?  NULL
+   : malloc (N * (size_t) S)).
 
-#if 7 <= __GNUC__ || __has_builtin (__builtin_add_overflow_p)
+   This is a macro, not a function, so that it works even if an
+   argument exceeds MAX (PTRDIFF_MAX, SIZE_MAX).  */
+#if 7 <= __GNUC__ && !defined __clang__ && PTRDIFF_MAX < SIZE_MAX
 # define xalloc_oversized(n, s) \
-   __builtin_mul_overflow_p (n, s, (__xalloc_count_type) 1)
-#elif ((5 <= __GNUC__ \
-        || (__has_builtin (__builtin_mul_overflow) \
-            && __has_builtin (__builtin_constant_p))) \
-       && !__STRICT_ANSI__)
+   __builtin_mul_overflow_p (n, s, (ptrdiff_t) 1)
+#elif (5 <= __GNUC__ && !defined __ICC && !__STRICT_ANSI__ \
+       && PTRDIFF_MAX < SIZE_MAX)
 # define xalloc_oversized(n, s) \
    (__builtin_constant_p (n) && __builtin_constant_p (s) \
     ? __xalloc_oversized (n, s) \
-    : ({ __xalloc_count_type __xalloc_count; \
+    : ({ ptrdiff_t __xalloc_count; \
          __builtin_mul_overflow (n, s, &__xalloc_count); }))
 
 /* Other compilers use integer division; this may be slower but is
index 3aad4e3..6cd7a68 100644 (file)
@@ -1,6 +1,6 @@
 /* xalloc.h -- malloc with out-of-memory checking
 
-   Copyright (C) 1990-2000, 2003-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1990-2000, 2003-2004, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef XALLOC_H_
 #define XALLOC_H_
 #include <stddef.h>
 #include <stdint.h>
 
-#include "xalloc-oversized.h"
+#if GNULIB_XALLOC
+# include "idx.h"
+# include "intprops.h"
+#endif
 
 #ifndef _GL_INLINE_HEADER_BEGIN
  #error "Please include config.h first."
@@ -31,30 +34,24 @@ _GL_INLINE_HEADER_BEGIN
 # define XALLOC_INLINE _GL_INLINE
 #endif
 
+
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 
-#if __GNUC__ >= 3
-# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
-#else
-# define _GL_ATTRIBUTE_MALLOC
-#endif
-
-#if ! defined __clang__ && \
-    (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
-# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
-#else
-# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
-#endif
+#if GNULIB_XALLOC_DIE
 
 /* This function is always triggered when memory is exhausted.
    It must be defined by the application, either explicitly
    or by using gnulib's xalloc-die module.  This is the
    function to call when one wants the program to die because of a
    memory allocation failure.  */
-extern _Noreturn void xalloc_die (void);
+/*extern*/ _Noreturn void xalloc_die (void);
+
+#endif /* GNULIB_XALLOC_DIE */
+
+#if GNULIB_XALLOC
 
 void *xmalloc (size_t s)
       _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1));
@@ -64,7 +61,11 @@ void *xcalloc (size_t n, size_t s)
       _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_ALLOC_SIZE ((1, 2));
 void *xrealloc (void *p, size_t s)
       _GL_ATTRIBUTE_ALLOC_SIZE ((2));
+void *xreallocarray (void *p, size_t n, size_t s)
+      _GL_ATTRIBUTE_ALLOC_SIZE ((2, 3));
 void *x2realloc (void *p, size_t *pn);
+void *xpalloc (void *pa, idx_t *nitems, idx_t nitems_incr_min,
+               ptrdiff_t nitems_max, idx_t item_size);
 void *xmemdup (void const *p, size_t s)
       _GL_ATTRIBUTE_ALLOC_SIZE ((2));
 char *xstrdup (char const *str)
@@ -77,23 +78,23 @@ char *xstrdup (char const *str)
 
 /* Allocate an object of type T dynamically, with error checking.  */
 /* extern t *XMALLOC (typename t); */
-#define XMALLOC(t) ((t *) xmalloc (sizeof (t)))
+# define XMALLOC(t) ((t *) xmalloc (sizeof (t)))
 
 /* Allocate memory for N elements of type T, with error checking.  */
 /* extern t *XNMALLOC (size_t n, typename t); */
-#define XNMALLOC(n, t) \
-   ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t))))
+# define XNMALLOC(n, t) \
+    ((t *) (sizeof (t) == 1 ? xmalloc (n) : xnmalloc (n, sizeof (t))))
 
 /* Allocate an object of type T dynamically, with error checking,
    and zero it.  */
 /* extern t *XZALLOC (typename t); */
-#define XZALLOC(t) ((t *) xzalloc (sizeof (t)))
+# define XZALLOC(t) ((t *) xzalloc (sizeof (t)))
 
 /* Allocate memory for N elements of type T, with error checking,
    and zero it.  */
 /* extern t *XCALLOC (size_t n, typename t); */
-#define XCALLOC(n, t) \
-   ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t))))
+# define XCALLOC(n, t) \
+    ((t *) (sizeof (t) == 1 ? xzalloc (n) : xcalloc (n, sizeof (t))))
 
 
 /* Allocate an array of N objects, each with S bytes of memory,
@@ -104,11 +105,10 @@ XALLOC_INLINE void *xnmalloc (size_t n, size_t s)
 XALLOC_INLINE void *
 xnmalloc (size_t n, size_t s)
 {
-  if (xalloc_oversized (n, s))
-    xalloc_die ();
-  return xmalloc (n * s);
+  return xreallocarray (NULL, n, s);
 }
 
+/* FIXME: Deprecate this in favor of xreallocarray?  */
 /* Change the size of an allocated block of memory P to an array of N
    objects each of S bytes, with error checking.  S must be nonzero.  */
 
@@ -117,9 +117,7 @@ XALLOC_INLINE void *xnrealloc (void *p, size_t n, size_t s)
 XALLOC_INLINE void *
 xnrealloc (void *p, size_t n, size_t s)
 {
-  if (xalloc_oversized (n, s))
-    xalloc_die ();
-  return xrealloc (p, n * s);
+  return xreallocarray (p, n, s);
 }
 
 /* If P is null, allocate a block of at least *PN such objects;
@@ -197,18 +195,14 @@ x2nrealloc (void *p, size_t *pn, size_t s)
     }
   else
     {
-      /* Set N = floor (1.5 * N) + 1 so that progress is made even if N == 0.
-         Check for overflow, so that N * S stays in both ptrdiff_t and
-         size_t range.  The check may be slightly conservative, but an
-         exact check isn't worth the trouble.  */
-      if ((PTRDIFF_MAX < SIZE_MAX ? PTRDIFF_MAX : SIZE_MAX) / 3 * 2 / s
-          <= n)
+      /* Set N = floor (1.5 * N) + 1 to make progress even if N == 0.  */
+      if (INT_ADD_WRAPV (n, (n >> 1) + 1, &n))
         xalloc_die ();
-      n += n / 2 + 1;
     }
 
+  p = xreallocarray (p, n, s);
   *pn = n;
-  return xrealloc (p, n * s);
+  return p;
 }
 
 /* Return a pointer to a new buffer of N bytes.  This is like xmalloc,
@@ -222,8 +216,15 @@ xcharalloc (size_t n)
   return XNMALLOC (n, char);
 }
 
+#endif /* GNULIB_XALLOC */
+
+
 #ifdef __cplusplus
 }
+#endif
+
+
+#if GNULIB_XALLOC && defined __cplusplus
 
 /* C++ does not allow conversions from void * to other pointer types
    without a cast.  Use templates to work around the problem when
@@ -236,9 +237,16 @@ xrealloc (T *p, size_t s)
 }
 
 template <typename T> inline T *
+xreallocarray (T *p, size_t n, size_t s)
+{
+  return (T *) xreallocarray ((void *) p, n, s);
+}
+
+/* FIXME: Deprecate this in favor of xreallocarray?  */
+template <typename T> inline T *
 xnrealloc (T *p, size_t n, size_t s)
 {
-  return (T *) xnrealloc ((void *) p, n, s);
+  return xreallocarray (p, n, s);
 }
 
 template <typename T> inline T *
@@ -259,7 +267,8 @@ xmemdup (T const *p, size_t s)
   return (T *) xmemdup ((void const *) p, s);
 }
 
-#endif
+#endif /* GNULIB_XALLOC && C++ */
+
 
 _GL_INLINE_HEADER_END
 
index e9e83ef..3a893d2 100644 (file)
@@ -1,5 +1,5 @@
 /* vasprintf and asprintf with out-of-memory checking.
-   Copyright (C) 1999, 2002-2004, 2006, 2009-2016 Free Software Foundation,
+   Copyright (C) 1999, 2002-2004, 2006, 2009-2021 Free Software Foundation,
    Inc.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 7d9c077..88698fa 100644 (file)
@@ -1,6 +1,6 @@
 /* xmalloc.c -- malloc with out of memory checking
 
-   Copyright (C) 1990-2000, 2002-2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 1990-2000, 2002-2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 
 #include "xalloc.h"
 
+#include "intprops.h"
+#include "minmax.h"
+
 #include <stdlib.h>
 #include <string.h>
 
-/* 1 if calloc is known to be compatible with GNU calloc.  This
-   matters if we are not also using the calloc module, which defines
-   HAVE_CALLOC_GNU and supports the GNU API even on non-GNU platforms.  */
-#if defined HAVE_CALLOC_GNU || (defined __GLIBC__ && !defined __UCLIBC__)
-enum { HAVE_GNU_CALLOC = 1 };
-#else
-enum { HAVE_GNU_CALLOC = 0 };
-#endif
-
 /* Allocate N bytes of memory dynamically, with error checking.  */
 
 void *
 xmalloc (size_t n)
 {
   void *p = malloc (n);
-  if (!p && n != 0)
+  if (!p)
     xalloc_die ();
   return p;
 }
@@ -50,18 +44,22 @@ xmalloc (size_t n)
 void *
 xrealloc (void *p, size_t n)
 {
-  if (!n && p)
-    {
-      /* The GNU and C99 realloc behaviors disagree here.  Act like
-         GNU, even if the underlying realloc is C99.  */
-      free (p);
-      return NULL;
-    }
+  void *r = realloc (p, n);
+  if (!r && (!p || n))
+    xalloc_die ();
+  return r;
+}
+
+/* Change the size of an allocated block of memory P to an array of N
+   objects each of S bytes, with error checking.  */
 
-  p = realloc (p, n);
-  if (!p && n)
+void *
+xreallocarray (void *p, size_t n, size_t s)
+{
+  void *r = reallocarray (p, n, s);
+  if (!r && (!p || (n && s)))
     xalloc_die ();
-  return p;
+  return r;
 }
 
 /* If P is null, allocate a block of at least *PN bytes; otherwise,
@@ -76,14 +74,83 @@ x2realloc (void *p, size_t *pn)
   return x2nrealloc (p, pn, 1);
 }
 
-/* Allocate S bytes of zeroed memory dynamically, with error checking.
+/* Grow PA, which points to an array of *NITEMS items, and return the
+   location of the reallocated array, updating *NITEMS to reflect its
+   new size.  The new array will contain at least NITEMS_INCR_MIN more
+   items, but will not contain more than NITEMS_MAX items total.
+   ITEM_SIZE is the size of each item, in bytes.
+
+   ITEM_SIZE and NITEMS_INCR_MIN must be positive.  *NITEMS must be
+   nonnegative.  If NITEMS_MAX is -1, it is treated as if it were
+   infinity.
+
+   If PA is null, then allocate a new array instead of reallocating
+   the old one.
+
+   Thus, to grow an array A without saving its old contents, do
+   { free (A); A = xpalloc (NULL, &AITEMS, ...); }.  */
+
+void *
+xpalloc (void *pa, idx_t *nitems, idx_t nitems_incr_min,
+         ptrdiff_t nitems_max, idx_t item_size)
+{
+  idx_t n0 = *nitems;
+
+  /* The approximate size to use for initial small allocation
+     requests.  This is the largest "small" request for the GNU C
+     library malloc.  */
+  enum { DEFAULT_MXFAST = 64 * sizeof (size_t) / 4 };
+
+  /* If the array is tiny, grow it to about (but no greater than)
+     DEFAULT_MXFAST bytes.  Otherwise, grow it by about 50%.
+     Adjust the growth according to three constraints: NITEMS_INCR_MIN,
+     NITEMS_MAX, and what the C language can represent safely.  */
+
+  idx_t n;
+  if (INT_ADD_WRAPV (n0, n0 >> 1, &n))
+    n = IDX_MAX;
+  if (0 <= nitems_max && nitems_max < n)
+    n = nitems_max;
+
+  /* NBYTES is of a type suitable for holding the count of bytes in an object.
+     This is typically idx_t, but it should be size_t on (theoretical?)
+     platforms where SIZE_MAX < IDX_MAX so xpalloc does not pass
+     values greater than SIZE_MAX to xrealloc.  */
+#if IDX_MAX <= SIZE_MAX
+  idx_t nbytes;
+#else
+  size_t nbytes;
+#endif
+  idx_t adjusted_nbytes
+    = (INT_MULTIPLY_WRAPV (n, item_size, &nbytes)
+       ? MIN (IDX_MAX, SIZE_MAX)
+       : nbytes < DEFAULT_MXFAST ? DEFAULT_MXFAST : 0);
+  if (adjusted_nbytes)
+    {
+      n = adjusted_nbytes / item_size;
+      nbytes = adjusted_nbytes - adjusted_nbytes % item_size;
+    }
+
+  if (! pa)
+    *nitems = 0;
+  if (n - n0 < nitems_incr_min
+      && (INT_ADD_WRAPV (n0, nitems_incr_min, &n)
+          || (0 <= nitems_max && nitems_max < n)
+          || INT_MULTIPLY_WRAPV (n, item_size, &nbytes)))
+    xalloc_die ();
+  pa = xrealloc (pa, nbytes);
+  *nitems = n;
+  return pa;
+}
+
+/* Allocate N bytes of zeroed memory dynamically, with error checking.
    There's no need for xnzalloc (N, S), since it would be equivalent
    to xcalloc (N, S).  */
 
 void *
-xzalloc (size_t s)
+xzalloc (size_t n)
 {
-  return memset (xmalloc (s), 0, s);
+  return xcalloc (n, 1);
 }
 
 /* Allocate zeroed memory for N elements of S bytes, with error
@@ -92,13 +159,8 @@ xzalloc (size_t s)
 void *
 xcalloc (size_t n, size_t s)
 {
-  void *p;
-  /* Test for overflow, since objects with size greater than
-     PTRDIFF_MAX cause pointer subtraction to go awry.  Omit size-zero
-     tests if HAVE_GNU_CALLOC, since GNU calloc never returns NULL if
-     successful.  */
-  if (xalloc_oversized (n, s)
-      || (! (p = calloc (n, s)) && (HAVE_GNU_CALLOC || n != 0)))
+  void *p = calloc (n, s);
+  if (!p)
     xalloc_die ();
   return p;
 }
index bcbed77..82db671 100644 (file)
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation with out of memory checking.
-   Copyright (C) 2003, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index f90fa9f..dbc6486 100644 (file)
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation with out of memory checking.
-   Copyright (C) 2003, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2005, 2007, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _XMALLOCA_H
 #define _XMALLOCA_H
 
 #include "malloca.h"
 #include "xalloc.h"
+#include "xalloc-oversized.h"
 
 
 #ifdef __cplusplus
@@ -29,11 +30,14 @@ extern "C" {
 
 /* xmalloca(N) is a checking safe variant of alloca(N).  It allocates N bytes
    of memory allocated on the stack, that must be freed using freea() before
-   the function returns.  Upon failure, it exits with an error message.  */
+   the function returns.  N should not have side effects.
+   Upon failure, it exits with an error message.  */
 #if HAVE_ALLOCA
 # define xmalloca(N) \
-  ((N) < 4032 - sa_increment                                        \
-   ? (void *) ((char *) alloca ((N) + sa_increment) + sa_increment) \
+  ((N) < 4032 - (2 * sa_alignment_max - 1)                                   \
+   ? (void *) (((uintptr_t) (char *) alloca ((N) + 2 * sa_alignment_max - 1) \
+                + (2 * sa_alignment_max - 1))                                \
+               & ~(uintptr_t)(2 * sa_alignment_max - 1))                     \
    : xmmalloca (N))
 extern void * xmmalloca (size_t n);
 #else
@@ -43,16 +47,17 @@ extern void * xmmalloca (size_t n);
 
 /* xnmalloca(N,S) is an overflow-safe variant of xmalloca (N * S).
    It allocates an array of N objects, each with S bytes of memory,
-   on the stack.  S must be positive and N must be nonnegative.
+   on the stack.  S must be positive and N must be nonnegative,
+   and S and N should not have side effects.
    The array must be freed using freea() before the function returns.
    Upon failure, it exits with an error message.  */
 #if HAVE_ALLOCA
 /* Rely on xmalloca (SIZE_MAX) calling xalloc_die ().  */
 # define xnmalloca(n, s) \
-    xmalloca (xalloc_oversized ((n), (s)) ? (size_t) (-1) : (n) * (s))
+    xmalloca (xalloc_oversized (n, s) ? (size_t) (-1) : (n) * (size_t) (s))
 #else
 # define xnmalloca(n, s) \
-    xnmalloc ((n), (s))
+    xnmalloc (n, s)
 #endif
 
 
index eed2269..d8d6b33 100644 (file)
@@ -1,5 +1,5 @@
 /* printf wrappers that fail immediately for non-file-related errors
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 31ae6f9..f28669e 100644 (file)
@@ -1,5 +1,5 @@
 /* printf wrappers that fail immediately for non-file-related errors
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _XPRINTF_H
 #define _XPRINTF_H
 #include <stdarg.h>
 #include <stdio.h>
 
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
-   The __-protected variants of the attributes 'format' and 'printf' are
-   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
-   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
-   gnulib and libintl do '#define printf __printf__' when they override
-   the 'printf' function.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+extern int xprintf (char const *restrict format, ...)
+#if GNULIB_VPRINTF_POSIX
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 1, 2))
 #else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 1, 2))
 #endif
+     ;
 
-extern int xprintf (char const *restrict format, ...)
-  _GL_ATTRIBUTE_FORMAT ((__printf__, 1, 2));
 extern int xvprintf (char const *restrict format, va_list args)
-  _GL_ATTRIBUTE_FORMAT ((__printf__, 1, 0));
+#if GNULIB_VPRINTF_POSIX
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 1, 0))
+#else
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 1, 0))
+#endif
+     ;
+
 extern int xfprintf (FILE *restrict stream, char const *restrict format, ...)
-  _GL_ATTRIBUTE_FORMAT ((__printf__, 2, 3));
+#if GNULIB_VFPRINTF_POSIX
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 2, 3))
+#else
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 2, 3))
+#endif
+     ;
+
 extern int xvfprintf (FILE *restrict stream, char const *restrict format,
                       va_list args)
-  _GL_ATTRIBUTE_FORMAT ((__printf__, 2, 0));
+#if GNULIB_VFPRINTF_POSIX
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 2, 0))
+#else
+     _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM, 2, 0))
+#endif
+     ;
 
 #endif
index 202a87e..b69bafc 100644 (file)
@@ -1,6 +1,6 @@
 /* xsize.h -- Checked size_t computations.
 
-   Copyright (C) 2003, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _XSIZE_H
 #define _XSIZE_H
@@ -27,6 +27,9 @@
 # include <stdint.h>
 #endif
 
+/* Get ATTRIBUTE_PURE.  */
+#include "attribute.h"
+
 #ifndef _GL_INLINE_HEADER_BEGIN
  #error "Please include config.h first."
 #endif
@@ -56,10 +59,7 @@ _GL_INLINE_HEADER_BEGIN
   ((N) <= SIZE_MAX ? (size_t) (N) : SIZE_MAX)
 
 /* Sum of two sizes, with overflow check.  */
-XSIZE_INLINE size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
+XSIZE_INLINE size_t ATTRIBUTE_PURE
 xsum (size_t size1, size_t size2)
 {
   size_t sum = size1 + size2;
@@ -67,30 +67,21 @@ xsum (size_t size1, size_t size2)
 }
 
 /* Sum of three sizes, with overflow check.  */
-XSIZE_INLINE size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
+XSIZE_INLINE size_t ATTRIBUTE_PURE
 xsum3 (size_t size1, size_t size2, size_t size3)
 {
   return xsum (xsum (size1, size2), size3);
 }
 
 /* Sum of four sizes, with overflow check.  */
-XSIZE_INLINE size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
+XSIZE_INLINE size_t ATTRIBUTE_PURE
 xsum4 (size_t size1, size_t size2, size_t size3, size_t size4)
 {
   return xsum (xsum (xsum (size1, size2), size3), size4);
 }
 
 /* Maximum of two sizes, with overflow check.  */
-XSIZE_INLINE size_t
-#if __GNUC__ >= 3
-__attribute__ ((__pure__))
-#endif
+XSIZE_INLINE size_t ATTRIBUTE_PURE
 xmax (size_t size1, size_t size2)
 {
   /* No explicit check is needed here, because for any n:
diff --git a/lib/xstriconv.c b/lib/xstriconv.c
new file mode 100644 (file)
index 0000000..687a00b
--- /dev/null
@@ -0,0 +1,62 @@
+/* Charset conversion with out-of-memory checking.
+   Copyright (C) 2001-2004, 2006, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "xstriconv.h"
+
+#include <errno.h>
+
+#include "striconv.h"
+#include "xalloc.h"
+
+
+#if HAVE_ICONV
+
+int
+xmem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
+               char **resultp, size_t *lengthp)
+{
+  int retval = mem_cd_iconv (src, srclen, cd, resultp, lengthp);
+
+  if (retval < 0 && errno == ENOMEM)
+    xalloc_die ();
+  return retval;
+}
+
+char *
+xstr_cd_iconv (const char *src, iconv_t cd)
+{
+  char *result = str_cd_iconv (src, cd);
+
+  if (result == NULL && errno == ENOMEM)
+    xalloc_die ();
+  return result;
+}
+
+#endif
+
+char *
+xstr_iconv (const char *src, const char *from_codeset, const char *to_codeset)
+{
+  char *result = str_iconv (src, from_codeset, to_codeset);
+
+  if (result == NULL && errno == ENOMEM)
+    xalloc_die ();
+  return result;
+}
diff --git a/lib/xstriconv.h b/lib/xstriconv.h
new file mode 100644 (file)
index 0000000..1f69fa3
--- /dev/null
@@ -0,0 +1,78 @@
+/* Charset conversion with out-of-memory checking.
+   Copyright (C) 2001-2004, 2006-2007, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible and Simon Josefsson.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _XSTRICONV_H
+#define _XSTRICONV_H
+
+#include <stddef.h>
+#if HAVE_ICONV
+#include <iconv.h>
+#endif
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#if HAVE_ICONV
+
+/* Convert an entire string from one encoding to another, using iconv.
+   The original string is at [SRC,...,SRC+SRCLEN-1].
+   The conversion descriptor is passed as CD.
+   *RESULTP and *LENGTH should initially be a scratch buffer and its size,
+   or *RESULTP can initially be NULL.
+   May erase the contents of the memory at *RESULTP.
+   Upon memory allocation failure, report the error and exit.
+   Return value: 0 if successful, otherwise -1 and errno set.
+   If successful: The resulting string is stored in *RESULTP and its length
+   in *LENGTHP.  *RESULTP is set to a freshly allocated memory block, or is
+   unchanged if no dynamic memory allocation was necessary.  */
+extern int xmem_cd_iconv (const char *src, size_t srclen, iconv_t cd,
+                          char **resultp, size_t *lengthp);
+
+/* Convert an entire string from one encoding to another, using iconv.
+   The original string is the NUL-terminated string starting at SRC.
+   The conversion descriptor is passed as CD.  Both the "from" and the "to"
+   encoding must use a single NUL byte at the end of the string (i.e. not
+   UCS-2, UCS-4, UTF-16, UTF-32).
+   Allocate a malloced memory block for the result.
+   Upon memory allocation failure, report the error and exit.
+   Return value: the freshly allocated resulting NUL-terminated string if
+   successful, otherwise NULL and errno set.  */
+extern char * xstr_cd_iconv (const char *src, iconv_t cd);
+
+#endif
+
+/* Convert an entire string from one encoding to another, using iconv.
+   The original string is the NUL-terminated string starting at SRC.
+   Both the "from" and the "to" encoding must use a single NUL byte at the
+   end of the string (i.e. not UCS-2, UCS-4, UTF-16, UTF-32).
+   Allocate a malloced memory block for the result.
+   Upon memory allocation failure, report the error and exit.
+   Return value: the freshly allocated resulting NUL-terminated string if
+   successful, otherwise NULL and errno set.  */
+extern char * xstr_iconv (const char *src,
+                          const char *from_codeset, const char *to_codeset);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif /* _XSTRICONV_H */
index 3d605ef..9cf22be 100644 (file)
@@ -1,6 +1,6 @@
 /* Duplicate a bounded initial segment of a string, with out-of-memory
    checking.
-   Copyright (C) 2003, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2006-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 0d3021c..7fbbf2c 100644 (file)
@@ -1,6 +1,6 @@
 /* Duplicate a bounded initial segment of a string, with out-of-memory
    checking.
-   Copyright (C) 2003, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <stddef.h>
 
 /* Return a newly allocated copy of at most N bytes of STRING.
    In other words, return a copy of the initial segment of length N of
    STRING.  */
-extern char *xstrndup (const char *string, size_t n);
+extern char *xstrndup (const char *string, size_t n) _GL_ATTRIBUTE_MALLOC;
index 9deaad0..7bf9c09 100644 (file)
@@ -1,5 +1,5 @@
 /* vasprintf and asprintf with out-of-memory checking.
-   Copyright (C) 1999, 2002-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002-2004, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index d62d7b7..4da42c6 100644 (file)
@@ -1,5 +1,5 @@
 /* vasprintf and asprintf with out-of-memory checking.
-   Copyright (C) 2002-2004, 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _XVASPRINTF_H
 #define _XVASPRINTF_H
 /* Get va_list.  */
 #include <stdarg.h>
 
-/* The __attribute__ feature is available in gcc versions 2.5 and later.
-   The __-protected variants of the attributes 'format' and 'printf' are
-   accepted by gcc versions 2.6.4 (effectively 2.7) and later.
-   We enable _GL_ATTRIBUTE_FORMAT only if these are supported too, because
-   gnulib and libintl do '#define printf __printf__' when they override
-   the 'printf' function.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
-#else
-# define _GL_ATTRIBUTE_FORMAT(spec) /* empty */
-#endif
+/* Get _GL_ATTRIBUTE_SPEC_PRINTF_STANDARD.  */
+#include <stdio.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -44,9 +35,9 @@ extern "C" {
      - [EILSEQ] error during conversion between wide and multibyte characters,
    return NULL.  */
 extern char *xasprintf (const char *format, ...)
-       _GL_ATTRIBUTE_FORMAT ((__printf__, 1, 2));
+       _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 1, 2));
 extern char *xvasprintf (const char *format, va_list args)
-       _GL_ATTRIBUTE_FORMAT ((__printf__, 1, 0));
+       _GL_ATTRIBUTE_FORMAT ((_GL_ATTRIBUTE_SPEC_PRINTF_STANDARD, 1, 0));
 
 #ifdef __cplusplus
 }
index bb37e32..9ba1743 100644 (file)
@@ -1,43 +1,82 @@
-# 00gnulib.m4 serial 3
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# 00gnulib.m4 serial 8
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl This file must be named something that sorts before all other
-dnl gnulib-provided .m4 files.  It is needed until such time as we can
-dnl assume Autoconf 2.64, with its improved AC_DEFUN_ONCE and
-dnl m4_divert semantics.
+dnl gnulib-provided .m4 files.  It is needed until the clang fix has
+dnl been included in Autoconf.
 
-# Until autoconf 2.63, handling of the diversion stack required m4_init
-# to be called first; but this does not happen with aclocal.  Wrapping
-# the entire execution in another layer of the diversion stack fixes this.
-# Worse, prior to autoconf 2.62, m4_wrap depended on the underlying m4
-# for whether it was FIFO or LIFO; in order to properly balance with
-# m4_init, we need to undo our push just before anything wrapped within
-# the m4_init body.  The way to ensure this is to wrap both sides of
-# m4_init with a one-shot macro that does the pop at the right time.
-m4_ifndef([_m4_divert_diversion],
-[m4_divert_push([KILL])
-m4_define([gl_divert_fixup], [m4_divert_pop()m4_define([$0])])
-m4_define([m4_init],
-  [gl_divert_fixup()]m4_defn([m4_init])[gl_divert_fixup()])])
-
-
-# AC_DEFUN_ONCE([NAME], VALUE)
-# ----------------------------
-# Define NAME to expand to VALUE on the first use (whether by direct
-# expansion, or by AC_REQUIRE), and to nothing on all subsequent uses.
-# Avoid bugs in AC_REQUIRE in Autoconf 2.63 and earlier.  This
-# definition is slower than the version in Autoconf 2.64, because it
-# can only use interfaces that existed since 2.59; but it achieves the
-# same effect.  Quoting is necessary to avoid confusing Automake.
-m4_version_prereq([2.63.263], [],
-[m4_define([AC][_DEFUN_ONCE],
-  [AC][_DEFUN([$1],
-    [AC_REQUIRE([_gl_DEFUN_ONCE([$1])],
-      [m4_indir([_gl_DEFUN_ONCE([$1])])])])]dnl
-[AC][_DEFUN([_gl_DEFUN_ONCE([$1])], [$2])])])
+# The following definitions arrange to use a compiler option
+# -Werror=implicit-function-declaration in AC_CHECK_DECL, when the
+# compiler is clang.  Without it, clang implicitly declares "known"
+# library functions in C mode, but not in C++ mode, which would cause
+# Gnulib to omit a declaration and thus later produce an error in C++
+# mode.  As of clang 9.0, these "known" functions are identified through
+# LIBBUILTIN invocations in the LLVM source file
+# llvm/tools/clang/include/clang/Basic/Builtins.def.
+# It's not possible to AC_REQUIRE the extra tests from AC_CHECK_DECL,
+# because AC_CHECK_DECL, like other Autoconf built-ins, is not supposed
+# to AC_REQUIRE anything: some configure.ac files have their first
+# AC_CHECK_DECL executed conditionally.  Therefore append the extra tests
+# to AC_PROG_CC.
+AC_DEFUN([gl_COMPILER_CLANG],
+[
+dnl AC_REQUIRE([AC_PROG_CC])
+  AC_CACHE_CHECK([whether the compiler is clang],
+    [gl_cv_compiler_clang],
+    [dnl Use _AC_COMPILE_IFELSE instead of AC_EGREP_CPP, to avoid error
+     dnl "circular dependency of AC_LANG_COMPILER(C)" if AC_PROG_CC has
+     dnl not yet been invoked.
+     _AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[
+           #ifdef __clang__
+           barfbarf
+           #endif
+           ]],[[]])
+        ],
+        [gl_cv_compiler_clang=no],
+        [gl_cv_compiler_clang=yes])
+    ])
+])
+AC_DEFUN([gl_COMPILER_PREPARE_CHECK_DECL],
+[
+dnl AC_REQUIRE([AC_PROG_CC])
+dnl AC_REQUIRE([gl_COMPILER_CLANG])
+  AC_CACHE_CHECK([for compiler option needed when checking for declarations],
+    [gl_cv_compiler_check_decl_option],
+    [if test $gl_cv_compiler_clang = yes; then
+       dnl Test whether the compiler supports the option
+       dnl '-Werror=implicit-function-declaration'.
+       save_ac_compile="$ac_compile"
+       ac_compile="$ac_compile -Werror=implicit-function-declaration"
+       dnl Use _AC_COMPILE_IFELSE instead of AC_COMPILE_IFELSE, to avoid a
+       dnl warning "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
+       _AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]],[[]])],
+         [gl_cv_compiler_check_decl_option='-Werror=implicit-function-declaration'],
+         [gl_cv_compiler_check_decl_option=none])
+       ac_compile="$save_ac_compile"
+     else
+       gl_cv_compiler_check_decl_option=none
+     fi
+    ])
+  if test "x$gl_cv_compiler_check_decl_option" != xnone; then
+    ac_compile_for_check_decl="$ac_compile $gl_cv_compiler_check_decl_option"
+  else
+    ac_compile_for_check_decl="$ac_compile"
+  fi
+])
+dnl Redefine _AC_CHECK_DECL_BODY so that it references ac_compile_for_check_decl
+dnl instead of ac_compile.  If, for whatever reason, the override of AC_PROG_CC
+dnl in zzgnulib.m4 is inactive, use the original ac_compile.
+m4_define([_AC_CHECK_DECL_BODY],
+[  ac_save_ac_compile="$ac_compile"
+  if test -n "$ac_compile_for_check_decl"; then
+    ac_compile="$ac_compile_for_check_decl"
+  fi]
+m4_defn([_AC_CHECK_DECL_BODY])[  ac_compile="$ac_save_ac_compile"
+])
 
 # gl_00GNULIB
 # -----------
diff --git a/m4/__inline.m4 b/m4/__inline.m4
new file mode 100644 (file)
index 0000000..b28cc6a
--- /dev/null
@@ -0,0 +1,22 @@
+# Test for __inline keyword
+dnl Copyright 2017-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl___INLINE],
+[
+  AC_CACHE_CHECK([whether the compiler supports the __inline keyword],
+    [gl_cv_c___inline],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+         [[typedef int foo_t;
+           static __inline foo_t foo (void) { return 0; }]],
+         [[return foo ();]])],
+       [gl_cv_c___inline=yes],
+       [gl_cv_c___inline=no])])
+  if test $gl_cv_c___inline = yes; then
+    AC_DEFINE([HAVE___INLINE], [1],
+      [Define to 1 if the compiler supports the keyword '__inline'.])
+  fi
+])
index 7ffc38d..52d80d0 100644 (file)
@@ -1,5 +1,5 @@
-# absolute-header.m4 serial 16
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+# absolute-header.m4 serial 17
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -22,23 +22,21 @@ dnl From Derek Price.
 AC_DEFUN([gl_ABSOLUTE_HEADER],
 [AC_REQUIRE([AC_CANONICAL_HOST])
 AC_LANG_PREPROC_REQUIRE()dnl
-dnl FIXME: gl_absolute_header and ac_header_exists must be used unquoted
-dnl until we can assume autoconf 2.64 or newer.
 m4_foreach_w([gl_HEADER_NAME], [$1],
   [AS_VAR_PUSHDEF([gl_absolute_header],
                   [gl_cv_absolute_]m4_defn([gl_HEADER_NAME]))dnl
   AC_CACHE_CHECK([absolute name of <]m4_defn([gl_HEADER_NAME])[>],
-    m4_defn([gl_absolute_header]),
+    [gl_absolute_header],
     [AS_VAR_PUSHDEF([ac_header_exists],
                     [ac_cv_header_]m4_defn([gl_HEADER_NAME]))dnl
     AC_CHECK_HEADERS_ONCE(m4_defn([gl_HEADER_NAME]))dnl
-    if test AS_VAR_GET(ac_header_exists) = yes; then
+    if test AS_VAR_GET([ac_header_exists]) = yes; then
       gl_ABSOLUTE_HEADER_ONE(m4_defn([gl_HEADER_NAME]))
     fi
     AS_VAR_POPDEF([ac_header_exists])dnl
     ])dnl
   AC_DEFINE_UNQUOTED(AS_TR_CPP([ABSOLUTE_]m4_defn([gl_HEADER_NAME])),
-                     ["AS_VAR_GET(gl_absolute_header)"],
+                     ["AS_VAR_GET([gl_absolute_header])"],
                      [Define this to an absolute name of <]m4_defn([gl_HEADER_NAME])[>.])
   AS_VAR_POPDEF([gl_absolute_header])dnl
 ])dnl
diff --git a/m4/access.m4 b/m4/access.m4
new file mode 100644 (file)
index 0000000..1194114
--- /dev/null
@@ -0,0 +1,16 @@
+# access.m4 serial 1
+dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ACCESS],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  dnl On native Windows, access (= _access) does not support the X_OK mode.
+  dnl It works by chance on some versions of mingw.
+  case "$host_os" in
+    mingw*) REPLACE_ACCESS=1 ;;
+  esac
+])
index 2382ff1..ba2f679 100644 (file)
@@ -1,5 +1,5 @@
-# alloca.m4 serial 14
-dnl Copyright (C) 2002-2004, 2006-2007, 2009-2016 Free Software Foundation,
+# alloca.m4 serial 20
+dnl Copyright (C) 2002-2004, 2006-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -37,19 +37,26 @@ AC_DEFUN([gl_FUNC_ALLOCA],
   fi
   AC_SUBST([ALLOCA_H])
   AM_CONDITIONAL([GL_GENERATE_ALLOCA_H], [test -n "$ALLOCA_H"])
+
+  if test $ac_cv_working_alloca_h = yes; then
+    HAVE_ALLOCA_H=1
+  else
+    HAVE_ALLOCA_H=0
+  fi
+  AC_SUBST([HAVE_ALLOCA_H])
 ])
 
 # Prerequisites of lib/alloca.c.
 # STACK_DIRECTION is already handled by AC_FUNC_ALLOCA.
 AC_DEFUN([gl_PREREQ_ALLOCA], [:])
 
-# This works around a bug in autoconf <= 2.68.
-# See <http://lists.gnu.org/archive/html/bug-gnulib/2011-06/msg00277.html>.
+m4_version_prereq([2.70], [], [
 
-m4_version_prereq([2.69], [] ,[
-
-# This is taken from the following Autoconf patch:
-# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+# This works around a bug in autoconf <= 2.68 and has simplifications
+# from 2.70.  See:
+# https://lists.gnu.org/r/bug-gnulib/2011-06/msg00277.html
+# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6cd9f12520b0d6f76d3230d7565feba1ecf29497
+# https://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=15edf7fd8094fd14a89d9891dd72a9624762597a
 
 # _AC_LIBOBJ_ALLOCA
 # -----------------
@@ -65,26 +72,6 @@ AC_LIBSOURCES(alloca.c)
 AC_SUBST([ALLOCA], [\${LIBOBJDIR}alloca.$ac_objext])dnl
 AC_DEFINE(C_ALLOCA, 1, [Define to 1 if using 'alloca.c'.])
 
-AC_CACHE_CHECK(whether 'alloca.c' needs Cray hooks, ac_cv_os_cray,
-[AC_EGREP_CPP(webecray,
-[#if defined CRAY && ! defined CRAY2
-webecray
-#else
-wenotbecray
-#endif
-], ac_cv_os_cray=yes, ac_cv_os_cray=no)])
-if test $ac_cv_os_cray = yes; then
-  for ac_func in _getb67 GETB67 getb67; do
-    AC_CHECK_FUNC($ac_func,
-                  [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func,
-                                      [Define to one of '_getb67', 'GETB67',
-                                       'getb67' for Cray-2 and Cray-YMP
-                                       systems. This function is required for
-                                       'alloca.c' support on those systems.])
-    break])
-  done
-fi
-
 AC_CACHE_CHECK([stack direction for C alloca],
                [ac_cv_c_stack_direction],
 [AC_RUN_IFELSE([AC_LANG_SOURCE(
@@ -115,7 +102,7 @@ AH_VERBATIM([STACK_DIRECTION],
         STACK_DIRECTION > 0 => grows toward higher addresses
         STACK_DIRECTION < 0 => grows toward lower addresses
         STACK_DIRECTION = 0 => direction of growth unknown */
-@%:@undef STACK_DIRECTION])dnl
+#undef STACK_DIRECTION])dnl
 AC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction)
 ])# _AC_LIBOBJ_ALLOCA
 ])
index a3d1e0b..31f140a 100644 (file)
@@ -1,5 +1,5 @@
-# ansi-c++.m4 serial 9
-dnl Copyright (C) 2002-2003, 2005, 2010-2016 Free Software Foundation, Inc.
+# ansi-c++.m4 serial 12
+dnl Copyright (C) 2002-2003, 2005, 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -122,7 +122,31 @@ EOF
     dnl /usr/local/share/automake-1.11/am/depend2.am:   The usual way to define 'am__fastdepCXX' is to add 'AC_PROG_CXX'
     dnl /usr/local/share/automake-1.11/am/depend2.am:   to 'configure.ac' and run 'aclocal' and 'autoconf' again.
     _AM_DEPENDENCIES([CXX])
+    dnl Determine a good default for the CXXFLAGS variable.
+    AC_LANG_PUSH([C++])
+    _AC_LANG_COMPILER_GNU
+    if test $ac_compiler_gnu = yes; then
+      GXX=yes
+    else
+      GXX=
+    fi
+    _AC_PROG_CXX_G
+    AC_LANG_POP([C++])
   else
     AM_CONDITIONAL([am__fastdepCXX], [false])
   fi
 ])
+
+# gl_ANSI_CXX
+# Sets CXX to the name of a sufficiently ANSI C++ compliant compiler, or to
+# "no" if none is found.
+# Defines the Automake condition ANSICXX to true if such a compiler was found,
+# or to false if not.
+AC_DEFUN([gl_ANSI_CXX],
+[
+  gl_PROG_ANSI_CXX([CXX], [ANSICXX])
+  dnl This line is needed in order to avoid trouble with Autoconf.  It makes
+  dnl sure that Autoconf does not insert expansions of AC_PROG_CXX at random
+  dnl places.  See <https://savannah.gnu.org/support/?110294>.
+  m4_provide([AC_PROG_CXX])
+])
diff --git a/m4/arpa_inet_h.m4 b/m4/arpa_inet_h.m4
new file mode 100644 (file)
index 0000000..a3ba256
--- /dev/null
@@ -0,0 +1,74 @@
+# arpa_inet_h.m4 serial 17
+dnl Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Simon Josefsson and Bruno Haible
+
+AC_DEFUN_ONCE([gl_ARPA_INET_H],
+[
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
+  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+
+  AC_CHECK_HEADERS_ONCE([arpa/inet.h])
+  if test $ac_cv_header_arpa_inet_h = yes; then
+    HAVE_ARPA_INET_H=1
+  else
+    HAVE_ARPA_INET_H=0
+  fi
+  AC_SUBST([HAVE_ARPA_INET_H])
+  dnl <arpa/inet.h> is always overridden, because of GNULIB_POSIXCHECK.
+  gl_CHECK_NEXT_HEADERS([arpa/inet.h])
+
+  AC_REQUIRE([gl_FEATURES_H])
+
+  gl_PREREQ_SYS_H_WS2TCPIP
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* On some systems, this header is not self-consistent.  */
+#if !(defined __GLIBC__ || defined __UCLIBC__)
+# include <sys/socket.h>
+#endif
+#ifdef __TANDEM
+# include <netdb.h>
+#endif
+#include <arpa/inet.h>
+    ]], [inet_ntop inet_pton])
+])
+
+# gl_ARPA_INET_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_ARPA_INET_MODULE_INDICATOR],
+[
+  dnl Ensure to expand the default settings once only.
+  gl_ARPA_INET_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_ARPA_INET_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_ARPA_INET_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_INET_NTOP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_INET_PTON])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_ARPA_INET_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_ARPA_INET_H_DEFAULTS],
+[
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_DECL_INET_NTOP=1;  AC_SUBST([HAVE_DECL_INET_NTOP])
+  HAVE_DECL_INET_PTON=1;  AC_SUBST([HAVE_DECL_INET_PTON])
+  REPLACE_INET_NTOP=0;    AC_SUBST([REPLACE_INET_NTOP])
+  REPLACE_INET_PTON=0;    AC_SUBST([REPLACE_INET_PTON])
+])
index feca18d..93b98be 100644 (file)
@@ -1,5 +1,5 @@
-# asm-underscore.m4 serial 3
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+# asm-underscore.m4 serial 5
+dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -14,6 +14,7 @@ dnl From Bruno Haible. Based on as-underscore.m4 in GNU clisp.
 
 AC_DEFUN([gl_ASM_SYMBOL_PREFIX],
 [
+  AC_REQUIRE([AC_PROG_EGREP])
   dnl We don't use GCC's __USER_LABEL_PREFIX__ here, because
   dnl 1. It works only for GCC.
   dnl 2. It is incorrectly defined on some platforms, in some GCC versions.
@@ -29,7 +30,7 @@ int foo(void) { return 0; }
 EOF
      # Look for the assembly language name in the .s file.
      AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
-     if LC_ALL=C grep -E '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then
+     if LC_ALL=C $EGREP '(^|[[^a-zA-Z0-9_]])_foo([[^a-zA-Z0-9_]]|$)' conftest.$gl_asmext >/dev/null; then
        gl_cv_prog_as_underscore=yes
      else
        gl_cv_prog_as_underscore=no
@@ -62,8 +63,19 @@ AC_DEFUN([gl_C_ASM],
 MicrosoftCompiler
 #endif
     ],
-    [gl_asmext='asm'
-     gl_c_asm_opt='-c -Fa'
+    [dnl Microsoft's 'cl' and 'clang-cl' produce an .asm file, whereas 'clang'
+     dnl produces a .s file. Need to distinguish 'clang' and 'clang-cl'.
+     rm -f conftest*
+     echo 'int dummy;' > conftest.c
+     AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS -c conftest.c) >/dev/null 2>&1
+     if test -f conftest.o; then
+       gl_asmext='s'
+       gl_c_asm_opt='-S'
+     else
+       gl_asmext='asm'
+       gl_c_asm_opt='-c -Fa'
+     fi
+     rm -f conftest*
     ],
     [gl_asmext='s'
      gl_c_asm_opt='-S'
index 054b163..b5e56d7 100644 (file)
@@ -1,6 +1,6 @@
 #serial 7
 
-# Copyright (C) 1998-1999, 2001, 2004, 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 1998-1999, 2001, 2004, 2008-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
index 66b183b..d931c7d 100644 (file)
@@ -1,5 +1,5 @@
-# autobuild.m4 serial 7
-dnl Copyright (C) 2004, 2006-2016 Free Software Foundation, Inc.
+# autobuild.m4 serial 8
+dnl Copyright (C) 2004, 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -27,7 +27,7 @@ AC_DEFUN([AB_INIT],
     AC_MSG_NOTICE([autobuild hostname... $hostname])
   fi
 
-  ifelse([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
+  m4_if([$1],[],,[AC_MSG_NOTICE([autobuild mode... $1])])
 
   date=`TZ=UTC0 date +%Y%m%dT%H%M%SZ`
   if test "$?" != 0; then
index 47e8fd8..d2b2fe8 100644 (file)
@@ -1,5 +1,5 @@
-# btowc.m4 serial 10
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# btowc.m4 serial 12
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,7 +10,7 @@ AC_DEFUN([gl_FUNC_BTOWC],
 
   dnl Check whether <wchar.h> is usable at all, first. Otherwise the test
   dnl program below may lead to an endless loop. See
-  dnl <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
+  dnl <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>.
   AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
 
   AC_CHECK_FUNCS_ONCE([btowc])
@@ -28,14 +28,6 @@ AC_DEFUN([gl_FUNC_BTOWC],
       [
         AC_RUN_IFELSE(
           [AC_LANG_SOURCE([[
-#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 ()
 {
@@ -50,6 +42,8 @@ changequote(,)dnl
            case "$host_os" in
                       # Guess no on Cygwin.
              cygwin*) gl_cv_func_btowc_nul="guessing no" ;;
+                      # Guess yes on native Windows.
+             mingw*)  gl_cv_func_btowc_nul="guessing yes" ;;
                       # Guess yes otherwise.
              *)       gl_cv_func_btowc_nul="guessing yes" ;;
            esac
@@ -65,24 +59,19 @@ changequote([,])dnl
         dnl is present.
 changequote(,)dnl
         case "$host_os" in
-                 # Guess no on IRIX.
-          irix*) gl_cv_func_btowc_eof="guessing no" ;;
-                 # Guess yes otherwise.
-          *)     gl_cv_func_btowc_eof="guessing yes" ;;
+                  # Guess no on IRIX.
+          irix*)  gl_cv_func_btowc_eof="guessing no" ;;
+                  # Guess yes on native Windows.
+          mingw*) gl_cv_func_btowc_eof="guessing yes" ;;
+                  # Guess yes otherwise.
+          *)      gl_cv_func_btowc_eof="guessing yes" ;;
         esac
 changequote([,])dnl
         if test $LOCALE_FR != none; then
           AC_RUN_IFELSE(
             [AC_LANG_SOURCE([[
 #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 ()
 {
index e448066..c584116 100644 (file)
@@ -1,6 +1,6 @@
 dnl Check for __builtin_expect.
 
-dnl Copyright 2016 Free Software Foundation, Inc.
+dnl Copyright 2016-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index aa9895e..7cccb06 100644 (file)
 # Check prerequisites for compiling lib/c-stack.c.
 
-# Copyright (C) 2002-2004, 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2004, 2008-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 # Written by Paul Eggert.
 
-# serial 15
-
-AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
-  [
-   AC_REQUIRE([AC_CANONICAL_HOST])
-   AC_CHECK_FUNCS_ONCE([setrlimit])
-   AC_CHECK_HEADERS_ONCE([ucontext.h])
-
-   dnl List of signals that are sent when an invalid virtual memory address
-   dnl is accessed, or when the stack overflows.
-   dnl Either { SIGSEGV } or { SIGSEGV, SIGBUS }.
-   case "$host_os" in
-     sunos4* | freebsd* | dragonfly* | openbsd* | mirbsd* | netbsd* | kfreebsd* | knetbsd*) # BSD systems
-       FAULT_YIELDS_SIGBUS=1 ;;
-     hpux*) # HP-UX
-       FAULT_YIELDS_SIGBUS=1 ;;
-     macos* | darwin*) # Mac OS X
-       FAULT_YIELDS_SIGBUS=1 ;;
-     gnu*) # Hurd
-       FAULT_YIELDS_SIGBUS=1 ;;
-     *)
-       FAULT_YIELDS_SIGBUS=0 ;;
-   esac
-   AC_DEFINE_UNQUOTED([FAULT_YIELDS_SIGBUS], [$FAULT_YIELDS_SIGBUS],
-     [Define to 1 if an invalid memory address access may yield a SIGBUS.])
-
-   AC_CACHE_CHECK([for working C stack overflow detection],
-     [ac_cv_sys_stack_overflow_works],
-     [AC_RUN_IFELSE([AC_LANG_SOURCE(
-           [[
-            #include <unistd.h>
-            #include <signal.h>
-            #if HAVE_SETRLIMIT
-            # include <sys/types.h>
-            # include <sys/time.h>
-            # include <sys/resource.h>
-            #endif
-            #ifndef SIGSTKSZ
-            # define SIGSTKSZ 16384
-            #endif
-
-            static union
-            {
-              char buffer[2 * SIGSTKSZ];
-              long double ld;
-              long u;
-              void *p;
-            } alternate_signal_stack;
-
-            static void
-            segv_handler (int signo)
-            {
-              _exit (0);
-            }
-
-            static int
-            c_stack_action ()
-            {
-              stack_t st;
-              struct sigaction act;
-              int r;
-
-              st.ss_flags = 0;
-              /* Use the midpoint to avoid Irix sigaltstack bug.  */
-              st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
-              st.ss_size = SIGSTKSZ;
-              r = sigaltstack (&st, 0);
-              if (r != 0)
-                return 1;
-
-              sigemptyset (&act.sa_mask);
-              act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND;
-              act.sa_handler = segv_handler;
-              #if FAULT_YIELDS_SIGBUS
-              if (sigaction (SIGBUS, &act, 0) < 0)
-                return 2;
-              #endif
-              if (sigaction (SIGSEGV, &act, 0) < 0)
-                return 3;
-              return 0;
-            }
-            static volatile int *
-            recurse_1 (volatile int n, volatile int *p)
-            {
-              if (n >= 0)
-                *recurse_1 (n + 1, p) += n;
-              return p;
-            }
-            static int
-            recurse (volatile int n)
-            {
-              int sum = 0;
-              return *recurse_1 (n, &sum);
-            }
-            int
-            main ()
-            {
-              int result;
-              #if HAVE_SETRLIMIT && defined RLIMIT_STACK
-              /* Before starting the endless recursion, try to be friendly
-                 to the user's machine.  On some Linux 2.2.x systems, there
-                 is no stack limit for user processes at all.  We don't want
-                 to kill such systems.  */
-              struct rlimit rl;
-              rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
-              setrlimit (RLIMIT_STACK, &rl);
-              #endif
-
-              result = c_stack_action ();
-              if (result != 0)
-                return result;
-              return recurse (0);
-            }
-           ]])],
-        [ac_cv_sys_stack_overflow_works=yes],
-        [ac_cv_sys_stack_overflow_works=no],
-        [ac_cv_sys_stack_overflow_works=cross-compiling])])
-
-  if test $ac_cv_sys_stack_overflow_works = yes; then
-   AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], [1],
-     [Define to 1 if extending the stack slightly past the limit causes
-      a SIGSEGV which can be handled on an alternate stack established
-      with sigaltstack.])
-
-    dnl The ss_sp field of a stack_t is, according to POSIX, the lowest address
-    dnl of the memory block designated as an alternate stack. But IRIX 5.3
-    dnl interprets it as the highest address!
-    AC_CACHE_CHECK([for correct stack_t interpretation],
-      [gl_cv_sigaltstack_low_base], [
-      AC_RUN_IFELSE([
-        AC_LANG_SOURCE([[
-#include <stdlib.h>
-#include <signal.h>
-#if HAVE_SYS_SIGNAL_H
-# include <sys/signal.h>
-#endif
-#ifndef SIGSTKSZ
-# define SIGSTKSZ 16384
-#endif
-volatile char *stack_lower_bound;
-volatile char *stack_upper_bound;
-static void check_stack_location (volatile char *addr)
-{
-  if (addr >= stack_lower_bound && addr <= stack_upper_bound)
-    exit (0);
-  else
-    exit (1);
-}
-static void stackoverflow_handler (int sig)
-{
-  char dummy;
-  check_stack_location (&dummy);
-}
-int main ()
-{
-  char mystack[2 * SIGSTKSZ];
-  stack_t altstack;
-  struct sigaction action;
-  /* Install the alternate stack.  */
-  altstack.ss_sp = mystack + SIGSTKSZ;
-  altstack.ss_size = SIGSTKSZ;
-  stack_lower_bound = (char *) altstack.ss_sp;
-  stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1;
-  altstack.ss_flags = 0; /* no SS_DISABLE */
-  if (sigaltstack (&altstack, NULL) < 0)
-    exit (2);
-  /* Install the SIGSEGV handler.  */
-  sigemptyset (&action.sa_mask);
-  action.sa_handler = &stackoverflow_handler;
-  action.sa_flags = SA_ONSTACK;
-  if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0)
-    exit(3);
-  /* Provoke a SIGSEGV.  */
-  raise (SIGSEGV);
-  exit (4);
-}]])],
-      [gl_cv_sigaltstack_low_base=yes],
-      [gl_cv_sigaltstack_low_base=no],
-      [gl_cv_sigaltstack_low_base=cross-compiling])])
-   if test "$gl_cv_sigaltstack_low_base" = no; then
-      AC_DEFINE([SIGALTSTACK_SS_REVERSED], [1],
-        [Define if sigaltstack() interprets the stack_t.ss_sp field
-         incorrectly, as the highest address of the alternate stack range
-         rather than as the lowest address.])
-    fi
-
-   AC_CACHE_CHECK([for precise C stack overflow detection],
-     ac_cv_sys_xsi_stack_overflow_heuristic,
-     [AC_RUN_IFELSE([AC_LANG_SOURCE(
-           [[
-            #include <unistd.h>
-            #include <signal.h>
-            #if HAVE_UCONTEXT_H
-            # include <ucontext.h>
-            #endif
-            #if HAVE_SETRLIMIT
-            # include <sys/types.h>
-            # include <sys/time.h>
-            # include <sys/resource.h>
-            #endif
-            #ifndef SIGSTKSZ
-            # define SIGSTKSZ 16384
-            #endif
-
-            static union
-            {
-              char buffer[2 * SIGSTKSZ];
-              long double ld;
-              long u;
-              void *p;
-            } alternate_signal_stack;
-
-            #if STACK_DIRECTION
-            # define find_stack_direction(ptr) STACK_DIRECTION
-            #else
-            static int
-            find_stack_direction (char const *addr)
-            {
-              char dummy;
-              return (! addr ? find_stack_direction (&dummy)
-                      : addr < &dummy ? 1 : -1);
-            }
-            #endif
-
-            static void
-            segv_handler (int signo, siginfo_t *info, void *context)
-            {
-              if (0 < info->si_code)
-                {
-                  /* For XSI heuristics to work, we need uc_stack to describe
-                     the interrupted stack (as on Solaris), and not the
-                     currently executing stack (as on Linux).  */
-                  ucontext_t const *user_context = context;
-                  char const *stack_min = user_context->uc_stack.ss_sp;
-                  size_t stack_size = user_context->uc_stack.ss_size;
-                  char const *faulting_address = info->si_addr;
-                  size_t s = faulting_address - stack_min;
-                  size_t page_size = sysconf (_SC_PAGESIZE);
-                  if (find_stack_direction (0) < 0)
-                    s += page_size;
-                  if (s < stack_size + page_size)
-                    _exit (0);
-                  _exit (4);
-                }
-              _exit (5);
-            }
-
-            static int
-            c_stack_action ()
-            {
-              stack_t st;
-              struct sigaction act;
-              int r;
-
-              st.ss_flags = 0;
-              /* Use the midpoint to avoid Irix sigaltstack bug.  */
-              st.ss_sp = alternate_signal_stack.buffer + SIGSTKSZ;
-              st.ss_size = SIGSTKSZ;
-              r = sigaltstack (&st, 0);
-              if (r != 0)
-                return 1;
-
-              sigemptyset (&act.sa_mask);
-              act.sa_flags = SA_NODEFER | SA_ONSTACK | SA_RESETHAND | SA_SIGINFO;
-              act.sa_sigaction = segv_handler;
-              #if FAULT_YIELDS_SIGBUS
-              if (sigaction (SIGBUS, &act, 0) < 0)
-                return 2;
-              #endif
-              if (sigaction (SIGSEGV, &act, 0) < 0)
-                return 3;
-              return 0;
-            }
-            static volatile int *
-            recurse_1 (volatile int n, volatile int *p)
-            {
-              if (n >= 0)
-                *recurse_1 (n + 1, p) += n;
-              return p;
-            }
-            static int
-            recurse (volatile int n)
-            {
-              int sum = 0;
-              return *recurse_1 (n, &sum);
-            }
-            int
-            main ()
-            {
-              int result;
-              #if HAVE_SETRLIMIT && defined RLIMIT_STACK
-              /* Before starting the endless recursion, try to be friendly
-                 to the user's machine.  On some Linux 2.2.x systems, there
-                 is no stack limit for user processes at all.  We don't want
-                 to kill such systems.  */
-              struct rlimit rl;
-              rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
-              setrlimit (RLIMIT_STACK, &rl);
-              #endif
-
-              result = c_stack_action ();
-              if (result != 0)
-                return result;
-              return recurse (0);
-            }
-           ]])],
-        [ac_cv_sys_xsi_stack_overflow_heuristic=yes],
-        [ac_cv_sys_xsi_stack_overflow_heuristic=no],
-        [ac_cv_sys_xsi_stack_overflow_heuristic=cross-compiling])])
-
-   if test $ac_cv_sys_xsi_stack_overflow_heuristic = yes; then
-     AC_DEFINE([HAVE_XSI_STACK_OVERFLOW_HEURISTIC], [1],
-       [Define to 1 if extending the stack slightly past the limit causes
-        a SIGSEGV, and an alternate stack can be established with sigaltstack,
-        and the signal handler is passed a context that specifies the
-        run time stack.  This behavior is defined by POSIX 1003.1-2001
-        with the X/Open System Interface (XSI) option
-        and is a standardized way to implement a SEGV-based stack
-        overflow detection heuristic.])
-   fi
-  fi])
-
-
-AC_DEFUN([gl_PREREQ_C_STACK],
-  [AC_REQUIRE([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC])
-   AC_REQUIRE([gl_LIBSIGSEGV])
-
-   # for STACK_DIRECTION
-   AC_REQUIRE([AC_FUNC_ALLOCA])
-
-   AC_CHECK_FUNCS_ONCE([sigaltstack])
-   AC_CHECK_DECLS([sigaltstack], , , [[#include <signal.h>]])
-
-   AC_CHECK_HEADERS_ONCE([unistd.h ucontext.h])
-
-   AC_CHECK_TYPES([stack_t], , , [#include <signal.h>])
-
-   dnl c-stack does not need -lsigsegv if the system has XSI heuristics.
-   if test "$gl_cv_lib_sigsegv" = yes \
-       && test $"ac_cv_sys_xsi_stack_overflow_heuristic" != yes ; then
-     AC_SUBST([LIBCSTACK], [$LIBSIGSEGV])
-     AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV])
-   fi
-])
+# serial 23
 
 AC_DEFUN([gl_C_STACK],
 [
-  dnl Prerequisites of lib/c-stack.c.
-  gl_PREREQ_C_STACK
+  dnl 'c-stack' needs -lsigsegv if and only if the 'sigsegv' module needs it.
+  if test "$with_libsigsegv" = yes; then
+    if test "$gl_cv_lib_sigsegv" = yes; then
+      AC_SUBST([LIBCSTACK], [$LIBSIGSEGV])
+      AC_SUBST([LTLIBCSTACK], [$LTLIBSIGSEGV])
+    fi
+  fi
 ])
diff --git a/m4/calloc.m4 b/m4/calloc.m4
new file mode 100644 (file)
index 0000000..fe12b15
--- /dev/null
@@ -0,0 +1,82 @@
+# calloc.m4 serial 27
+
+# Copyright (C) 2004-2021 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Jim Meyering.
+
+# Determine whether calloc (N, S) returns non-NULL when N*S is zero,
+# and returns NULL when N*S overflows.
+# If so, define HAVE_CALLOC.  Otherwise, define calloc to rpl_calloc
+# and arrange to use a calloc wrapper function that does work in that case.
+
+# _AC_FUNC_CALLOC_IF([IF-WORKS], [IF-NOT])
+# -------------------------------------
+# If calloc is compatible with GNU calloc, run IF-WORKS, otherwise, IF-NOT.
+AC_DEFUN([_AC_FUNC_CALLOC_IF],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CACHE_CHECK([whether calloc (0, n) and calloc (n, 0) return nonnull],
+    [ac_cv_func_calloc_0_nonnull],
+    [if test $cross_compiling != yes; then
+       ac_cv_func_calloc_0_nonnull=yes
+       AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(
+            [AC_INCLUDES_DEFAULT],
+            [[int result = 0;
+              char * volatile p = calloc (0, 0);
+              if (!p)
+                result |= 1;
+              free (p);
+              return result;
+            ]])],
+         [],
+         [ac_cv_func_calloc_0_nonnull=no])
+     else
+       case "$host_os" in
+                        # Guess yes on glibc systems.
+         *-gnu* | gnu*) ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+                        # Guess yes on musl systems.
+         *-musl*)       ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+                        # Guess yes on native Windows.
+         mingw*)        ac_cv_func_calloc_0_nonnull="guessing yes" ;;
+                        # If we don't know, obey --enable-cross-guesses.
+         *)             ac_cv_func_calloc_0_nonnull="$gl_cross_guess_normal" ;;
+       esac
+     fi
+    ])
+  AS_CASE([$ac_cv_func_calloc_0_nonnull], [*yes], [$1], [$2])
+])
+
+
+# gl_FUNC_CALLOC_GNU
+# ------------------
+# Replace calloc if it is not compatible with GNU libc.
+AC_DEFUN([gl_FUNC_CALLOC_GNU],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_CALLOC_POSIX])
+  if test $REPLACE_CALLOC = 0; then
+    _AC_FUNC_CALLOC_IF([], [REPLACE_CALLOC=1])
+  fi
+])# gl_FUNC_CALLOC_GNU
+
+# gl_FUNC_CALLOC_POSIX
+# --------------------
+# Test whether 'calloc' is POSIX compliant (sets errno to ENOMEM when it
+# fails, and doesn't mess up with ptrdiff_t or size_t overflow),
+# and replace calloc if it is not.
+AC_DEFUN([gl_FUNC_CALLOC_POSIX],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+  if test $REPLACE_MALLOC = 1; then
+    REPLACE_CALLOC=1
+  fi
+  dnl Although in theory we should also test for size_t overflow,
+  dnl in practice testing for ptrdiff_t overflow suffices
+  dnl since PTRDIFF_MAX <= SIZE_MAX on all known Gnulib porting targets.
+  dnl A separate size_t test would slow down 'configure'.
+])
index cbbf3e2..0dfb2da 100644 (file)
@@ -1,6 +1,6 @@
-# canonicalize.m4 serial 28
+# canonicalize.m4 serial 37
 
-dnl Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc.
 
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,8 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_CANONICALIZE_FILENAME_MODE],
 [
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  AC_CHECK_FUNCS_ONCE([canonicalize_file_name])
+  AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+  AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
   AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
   AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
   if test $ac_cv_func_canonicalize_file_name = no; then
@@ -35,8 +36,8 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
       HAVE_REALPATH=0
     else
       case "$gl_cv_func_realpath_works" in
-       *yes) ;;
-       *)    REPLACE_REALPATH=1 ;;
+        *yes) ;;
+        *)    REPLACE_REALPATH=1 ;;
       esac
     fi
   else
@@ -56,7 +57,17 @@ AC_DEFUN([gl_CANONICALIZE_LGPL],
 AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
 [
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
-  AC_CHECK_FUNCS_ONCE([canonicalize_file_name getcwd readlink])
+  AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+  AC_CHECK_FUNCS_ONCE([canonicalize_file_name faccessat])
+
+  dnl On native Windows, we use _getcwd(), regardless whether getcwd() is
+  dnl available through the linker option '-loldnames'.
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*) ;;
+    *)      AC_CHECK_FUNCS([getcwd]) ;;
+  esac
+
   AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
   AC_REQUIRE([gl_FUNC_REALPATH_WORKS])
   AC_CHECK_HEADERS_ONCE([sys/param.h])
@@ -67,63 +78,106 @@ AC_DEFUN([gl_CANONICALIZE_LGPL_SEPARATE],
 # so is the latter.
 AC_DEFUN([gl_FUNC_REALPATH_WORKS],
 [
-  AC_CHECK_FUNCS_ONCE([realpath])
+  AC_CHECK_FUNCS_ONCE([realpath lstat])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether realpath works], [gl_cv_func_realpath_works], [
+    rm -rf conftest.a conftest.d
     touch conftest.a
+    # Assume that if we have lstat, we can also check symlinks.
+    if test $ac_cv_func_lstat = yes; then
+      ln -s conftest.a conftest.l
+    fi
     mkdir conftest.d
     AC_RUN_IFELSE([
       AC_LANG_PROGRAM([[
         ]GL_NOCRASH[
+        #include <errno.h>
         #include <stdlib.h>
         #include <string.h>
       ]], [[
         int result = 0;
+        /* This test fails on Solaris 10.  */
         {
           char *name = realpath ("conftest.a", NULL);
           if (!(name && *name == '/'))
             result |= 1;
           free (name);
         }
+        /* This test fails on older versions of Cygwin.  */
         {
           char *name = realpath ("conftest.b/../conftest.a", NULL);
           if (name != NULL)
             result |= 2;
           free (name);
         }
+        /* This test fails on Cygwin 2.9.  */
+        #if HAVE_LSTAT
+        {
+          char *name = realpath ("conftest.l/../conftest.a", NULL);
+          if (name != NULL || errno != ENOTDIR)
+            result |= 4;
+          free (name);
+        }
+        #endif
+        /* This test fails on Mac OS X 10.13, OpenBSD 6.0.  */
         {
           char *name = realpath ("conftest.a/", NULL);
           if (name != NULL)
-            result |= 4;
+            result |= 8;
           free (name);
         }
+        /* This test fails on AIX 7, Solaris 10.  */
         {
           char *name1 = realpath (".", NULL);
           char *name2 = realpath ("conftest.d//./..", NULL);
           if (! name1 || ! name2 || strcmp (name1, name2))
-            result |= 8;
+            result |= 16;
           free (name1);
           free (name2);
         }
+        #ifdef __linux__
+        /* On Linux, // is the same as /. See also double-slash-root.m4.
+           realpath() should respect this.
+           This test fails on musl libc 1.2.2.  */
+        {
+          char *name = realpath ("//", NULL);
+          if (! name || strcmp (name, "/"))
+            result |= 32;
+          free (name);
+        }
+        #endif
         return result;
       ]])
      ],
      [gl_cv_func_realpath_works=yes],
-     [gl_cv_func_realpath_works=no],
+     [case $? in
+        32) gl_cv_func_realpath_works=nearly ;;
+        *)  gl_cv_func_realpath_works=no ;;
+      esac
+     ],
      [case "$host_os" in
                        # Guess yes on glibc systems.
         *-gnu* | gnu*) gl_cv_func_realpath_works="guessing yes" ;;
-                       # If we don't know, assume the worst.
-        *)             gl_cv_func_realpath_works="guessing no" ;;
+                       # Guess 'nearly' on musl systems.
+        *-musl*)       gl_cv_func_realpath_works="guessing nearly" ;;
+                       # Guess no on Cygwin.
+        cygwin*)       gl_cv_func_realpath_works="guessing no" ;;
+                       # Guess no on native Windows.
+        mingw*)        gl_cv_func_realpath_works="guessing no" ;;
+                       # If we don't know, obey --enable-cross-guesses.
+        *)             gl_cv_func_realpath_works="$gl_cross_guess_normal" ;;
       esac
      ])
-    rm -rf conftest.a conftest.d
+    rm -rf conftest.a conftest.l conftest.d
   ])
   case "$gl_cv_func_realpath_works" in
     *yes)
-      AC_DEFINE([FUNC_REALPATH_WORKS], [1], [Define to 1 if realpath()
-        can malloc memory, always gives an absolute path, and handles
-        trailing slash correctly.])
+      AC_DEFINE([FUNC_REALPATH_WORKS], [1],
+        [Define to 1 if realpath() can malloc memory, always gives an absolute path, and handles leading slashes and a trailing slash correctly.])
+      ;;
+    *nearly)
+      AC_DEFINE([FUNC_REALPATH_NEARLY_WORKS], [1],
+        [Define to 1 if realpath() can malloc memory, always gives an absolute path, and handles a trailing slash correctly.])
       ;;
   esac
 ])
diff --git a/m4/chdir-long.m4 b/m4/chdir-long.m4
new file mode 100644 (file)
index 0000000..e5cd8df
--- /dev/null
@@ -0,0 +1,30 @@
+#serial 17
+
+# Use Gnulib's robust chdir function.
+# It can handle arbitrarily long directory names, which means
+# that when it is given the name of an existing directory, it
+# never fails with ENAMETOOLONG.
+# Arrange to compile chdir-long.c only on systems that define PATH_MAX.
+
+dnl Copyright (C) 2004-2007, 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Written by Jim Meyering.
+
+AC_DEFUN([gl_FUNC_CHDIR_LONG],
+[
+  AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ])
+  AC_CACHE_CHECK([whether this system supports file names of any length],
+    [gl_cv_have_unlimited_file_name_length],
+    [AC_EGREP_CPP([have_arbitrary_file_name_length_limit],
+                  gl_PATHMAX_SNIPPET[
+#ifdef PATH_MAX
+have_arbitrary_file_name_length_limit
+#endif],
+    [gl_cv_have_unlimited_file_name_length=no],
+    [gl_cv_have_unlimited_file_name_length=yes])])
+])
+
+AC_DEFUN([gl_PREREQ_CHDIR_LONG], [:])
diff --git a/m4/clock_time.m4 b/m4/clock_time.m4
new file mode 100644 (file)
index 0000000..c3b9e7e
--- /dev/null
@@ -0,0 +1,31 @@
+# clock_time.m4 serial 10
+dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Check for clock_gettime and clock_settime, and set LIB_CLOCK_GETTIME.
+# For a program named, say foo, you should add a line like the following
+# in the corresponding Makefile.am file:
+# foo_LDADD = $(LDADD) $(LIB_CLOCK_GETTIME)
+
+AC_DEFUN([gl_CLOCK_TIME],
+[
+  dnl Persuade glibc and Solaris <time.h> to declare these functions.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  # Solaris 2.5.1 needs -lposix4 to get the clock_gettime function.
+  # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
+
+  # Save and restore LIBS so e.g., -lrt, isn't added to it.  Otherwise, *all*
+  # programs in the package would end up linked with that potentially-shared
+  # library, inducing unnecessary run-time overhead.
+  LIB_CLOCK_GETTIME=
+  AC_SUBST([LIB_CLOCK_GETTIME])
+  gl_saved_libs=$LIBS
+    AC_SEARCH_LIBS([clock_gettime], [rt posix4],
+                   [test "$ac_cv_search_clock_gettime" = "none required" ||
+                    LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
+    AC_CHECK_FUNCS([clock_gettime clock_settime])
+  LIBS=$gl_saved_libs
+])
index 310f076..77a5047 100644 (file)
@@ -1,5 +1,5 @@
-# close.m4 serial 8
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# close.m4 serial 9
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,10 +7,12 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_CLOSE],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  AC_REQUIRE([gl_MSVC_INVAL])
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-    REPLACE_CLOSE=1
-  fi
+  m4_ifdef([gl_MSVC_INVAL], [
+    AC_REQUIRE([gl_MSVC_INVAL])
+    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+      REPLACE_CLOSE=1
+    fi
+  ])
   m4_ifdef([gl_PREREQ_SYS_H_WINSOCK2], [
     gl_PREREQ_SYS_H_WINSOCK2
     if test $UNISTD_H_HAVE_WINSOCK2_H = 1; then
index 0c9fd82..fc55a21 100644 (file)
@@ -1,5 +1,5 @@
-# closedir.m4 serial 5
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# closedir.m4 serial 6
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_CLOSEDIR],
 [
   AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
   AC_CHECK_FUNCS([closedir])
   if test $ac_cv_func_closedir = no; then
index bc98201..629f4ee 100644 (file)
@@ -1,6 +1,6 @@
 # codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016 Free Software Foundation,
-dnl Inc.
+dnl Copyright (C) 2000-2002, 2006, 2008-2014, 2016, 2019-2021 Free Software
+dnl Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index d6664b7..b3be47b 100644 (file)
@@ -1,6 +1,6 @@
 # Say that -DHAVE_CONFIG_H is not needed.
 
-dnl Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 80b9254..d4f20ee 100644 (file)
@@ -1,55 +1,27 @@
-# configmake.m4 serial 2
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+# configmake.m4 serial 4
+dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+AC_PREREQ([2.60])
+
 # gl_CONFIGMAKE_PREP
 # ------------------
 # Guarantee all of the standard directory variables, even when used with
-# autoconf 2.59 (datarootdir wasn't supported until 2.59c, and runstatedir
-# in 2.70) or automake 1.9.6 (pkglibexecdir wasn't supported until 1.10b,
-# and runstatedir in 1.14.1).
+# autoconf 2.64 (runstatedir wasn't supported before 2.70) or
+# automake 1.11 (runstatedir isn't supported even in 1.16.1).
 AC_DEFUN([gl_CONFIGMAKE_PREP],
 [
-  dnl Technically, datadir should default to datarootdir.  But if
-  dnl autoconf is too old to provide datarootdir, then reversing the
-  dnl definition is a reasonable compromise.  Only AC_SUBST a variable
-  dnl if it was not already defined earlier by autoconf.
-  if test "x$datarootdir" = x; then
-    AC_SUBST([datarootdir], ['${datadir}'])
-  fi
-  dnl Copy the approach used in autoconf 2.60.
-  if test "x$docdir" = x; then
-    AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME],
-      ['${datarootdir}/doc/${PACKAGE_TARNAME}'],
-      ['${datarootdir}/doc/${PACKAGE}'])])
-  fi
-  dnl The remaining variables missing from autoconf 2.59 are easier.
-  if test "x$htmldir" = x; then
-    AC_SUBST([htmldir], ['${docdir}'])
-  fi
-  if test "x$dvidir" = x; then
-    AC_SUBST([dvidir], ['${docdir}'])
-  fi
-  if test "x$pdfdir" = x; then
-    AC_SUBST([pdfdir], ['${docdir}'])
-  fi
-  if test "x$psdir" = x; then
-    AC_SUBST([psdir], ['${docdir}'])
-  fi
   if test "x$lispdir" = x; then
     AC_SUBST([lispdir], ['${datarootdir}/emacs/site-lisp'])
   fi
-  if test "x$localedir" = x; then
-    AC_SUBST([localedir], ['${datarootdir}/locale'])
-  fi
-  dnl Added in autoconf 2.70
+  dnl Added in autoconf 2.70.
   if test "x$runstatedir" = x; then
     AC_SUBST([runstatedir], ['${localstatedir}/run'])
   fi
 
-  dnl Automake 1.9.6 only lacks pkglibexecdir; and since 1.11 merely
-  dnl provides it without AC_SUBST, this blind use of AC_SUBST is safe.
+  dnl Automake 1.11 provides pkglibexecdir merely without AC_SUBST.
+  dnl This blind use of AC_SUBST is safe.
   AC_SUBST([pkglibexecdir], ['${libexecdir}/${PACKAGE}'])
 ])
diff --git a/m4/creat.m4 b/m4/creat.m4
new file mode 100644 (file)
index 0000000..0d07a15
--- /dev/null
@@ -0,0 +1,23 @@
+# creat.m4 serial 1
+dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_CREAT],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      REPLACE_CREAT=1
+      ;;
+    *)
+      gl_OPEN_TRAILING_SLASH_BUG
+      case "$gl_cv_func_open_slash" in
+        *no)
+          REPLACE_CREAT=1
+          ;;
+      esac
+      ;;
+  esac
+])
diff --git a/m4/ctype.m4 b/m4/ctype.m4
deleted file mode 100644 (file)
index a2165aa..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-# ctype_h.m4 serial 6
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_CTYPE_H],
-[
-  AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
-
-  dnl <ctype.h> is always overridden, because of GNULIB_POSIXCHECK.
-  gl_NEXT_HEADERS([ctype.h])
-
-  dnl Check for declarations of anything we want to poison if the
-  dnl corresponding gnulib module is not in use.
-  gl_WARN_ON_USE_PREPARE([[#include <ctype.h>
-    ]], [isblank])
-])
-
-AC_DEFUN([gl_CTYPE_MODULE_INDICATOR],
-[
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
-  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
-])
-
-AC_DEFUN([gl_CTYPE_H_DEFAULTS],
-[
-  GNULIB_ISBLANK=0; AC_SUBST([GNULIB_ISBLANK])
-  dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_ISBLANK=1;   AC_SUBST([HAVE_ISBLANK])
-])
diff --git a/m4/ctype_h.m4 b/m4/ctype_h.m4
new file mode 100644 (file)
index 0000000..efdae45
--- /dev/null
@@ -0,0 +1,47 @@
+# ctype_h.m4 serial 9
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_CTYPE_H],
+[
+  AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+
+  dnl <ctype.h> is always overridden, because of GNULIB_POSIXCHECK.
+  gl_NEXT_HEADERS([ctype.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <ctype.h>
+    ]], [isblank])
+])
+
+# gl_CTYPE_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_CTYPE_MODULE_INDICATOR],
+[
+  dnl Ensure to expand the default settings once only.
+  gl_CTYPE_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_CTYPE_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_CTYPE_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISBLANK])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_CTYPE_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_CTYPE_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_CTYPE_H_DEFAULTS],
+[
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_ISBLANK=1;   AC_SUBST([HAVE_ISBLANK])
+])
diff --git a/m4/d-ino.m4 b/m4/d-ino.m4
new file mode 100644 (file)
index 0000000..e4dcfeb
--- /dev/null
@@ -0,0 +1,60 @@
+# serial 20
+
+dnl From Jim Meyering.
+dnl
+dnl Check whether struct dirent has a member named d_ino.
+dnl
+
+# Copyright (C) 1997, 1999-2001, 2003-2004, 2006-2007, 2009-2021 Free Software
+# Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_CHECK_TYPE_STRUCT_DIRENT_D_INO],
+  [AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+   AC_CACHE_CHECK([for d_ino member in directory struct],
+                  [gl_cv_struct_dirent_d_ino],
+     [AC_RUN_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[#include <sys/types.h>
+             #include <sys/stat.h>
+             #include <dirent.h>
+           ]],
+           [[DIR *dp = opendir (".");
+             struct dirent *e;
+             struct stat st;
+             if (! dp)
+               return 1;
+             e = readdir (dp);
+             if (! e)
+               { closedir (dp); return 2; }
+             if (lstat (e->d_name, &st) != 0)
+               { closedir (dp); return 3; }
+             if (e->d_ino != st.st_ino)
+               { closedir (dp); return 4; }
+             closedir (dp);
+             return 0;
+           ]])],
+           [gl_cv_struct_dirent_d_ino=yes],
+           [gl_cv_struct_dirent_d_ino=no],
+           [case "$host_os" in
+                            # Guess yes on glibc systems with Linux kernel.
+              linux*-gnu*)  gl_cv_struct_dirent_d_ino="guessing yes" ;;
+                            # Guess yes on musl systems with Linux kernel.
+              linux*-musl*) gl_cv_struct_dirent_d_ino="guessing yes" ;;
+                            # Guess no on native Windows.
+              mingw*)       gl_cv_struct_dirent_d_ino="guessing no" ;;
+                            # If we don't know, obey --enable-cross-guesses.
+              *)            gl_cv_struct_dirent_d_ino="$gl_cross_guess_normal" ;;
+            esac
+           ])])
+   case "$gl_cv_struct_dirent_d_ino" in
+     *yes)
+       AC_DEFINE([D_INO_IN_DIRENT], [1],
+         [Define if struct dirent has a member d_ino that actually works.])
+       ;;
+   esac
+  ]
+)
index 68836a4..17e2a20 100644 (file)
@@ -1,15 +1,15 @@
-# dirent_h.m4 serial 16
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# dirent_h.m4 serial 19
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Bruno Haible.
 
-AC_DEFUN([gl_DIRENT_H],
+AC_DEFUN_ONCE([gl_DIRENT_H],
 [
-  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
-  dnl once only, before all statements that occur in other macros.
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
   AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
 
   dnl <dirent.h> is always overridden, because of GNULIB_POSIXCHECK.
@@ -27,26 +27,41 @@ AC_DEFUN([gl_DIRENT_H],
     ]], [alphasort closedir dirfd fdopendir opendir readdir rewinddir scandir])
 ])
 
+# gl_DIRENT_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_DIRENT_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_DIRENT_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_DIRENT_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_DIRENT_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_UNISTD_H_REQUIRE_DEFAULTS dnl for REPLACE_FCHDIR
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REWINDDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CLOSEDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DIRFD])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPENDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ALPHASORT])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_DIRENT_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_DIRENT_H_DEFAULTS],
 [
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
-  GNULIB_OPENDIR=0;     AC_SUBST([GNULIB_OPENDIR])
-  GNULIB_READDIR=0;     AC_SUBST([GNULIB_READDIR])
-  GNULIB_REWINDDIR=0;   AC_SUBST([GNULIB_REWINDDIR])
-  GNULIB_CLOSEDIR=0;    AC_SUBST([GNULIB_CLOSEDIR])
-  GNULIB_DIRFD=0;       AC_SUBST([GNULIB_DIRFD])
-  GNULIB_FDOPENDIR=0;   AC_SUBST([GNULIB_FDOPENDIR])
-  GNULIB_SCANDIR=0;     AC_SUBST([GNULIB_SCANDIR])
-  GNULIB_ALPHASORT=0;   AC_SUBST([GNULIB_ALPHASORT])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_OPENDIR=1;       AC_SUBST([HAVE_OPENDIR])
   HAVE_READDIR=1;       AC_SUBST([HAVE_READDIR])
index 1d7cb08..3c9ce5d 100644 (file)
@@ -1,8 +1,8 @@
-# serial 24   -*- Autoconf -*-
+# serial 26   -*- Autoconf -*-
 
 dnl Find out how to get the file descriptor associated with an open DIR*.
 
-# Copyright (C) 2001-2006, 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001-2006, 2008-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -12,6 +12,7 @@ dnl From Jim Meyering
 AC_DEFUN([gl_FUNC_DIRFD],
 [
   AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
   dnl Persuade glibc <dirent.h> to declare dirfd().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
@@ -25,15 +26,15 @@ AC_DEFUN([gl_FUNC_DIRFD],
   fi
 
   AC_CACHE_CHECK([whether dirfd is a macro],
-    gl_cv_func_dirfd_macro,
+    [gl_cv_func_dirfd_macro],
     [AC_EGREP_CPP([dirent_header_defines_dirfd], [
 #include <sys/types.h>
 #include <dirent.h>
 #ifdef dirfd
  dirent_header_defines_dirfd
 #endif],
-       gl_cv_func_dirfd_macro=yes,
-       gl_cv_func_dirfd_macro=no)])
+       [gl_cv_func_dirfd_macro=yes],
+       [gl_cv_func_dirfd_macro=no])])
 
   # Use the replacement if we have no function or macro with that name,
   # or if OS/2 kLIBC whose dirfd() does not work.
diff --git a/m4/dirname.m4 b/m4/dirname.m4
deleted file mode 100644 (file)
index 6f8bec3..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#serial 10   -*- autoconf -*-
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_DIRNAME],
-[
-  AC_REQUIRE([gl_DIRNAME_LGPL])
-])
-
-AC_DEFUN([gl_DIRNAME_LGPL],
-[
-  dnl Prerequisites of lib/dirname.h.
-  AC_REQUIRE([gl_DOUBLE_SLASH_ROOT])
-
-  dnl No prerequisites of lib/basename-lgpl.c, lib/dirname-lgpl.c,
-  dnl lib/stripslash.c.
-])
index dfd3921..c9bbcef 100644 (file)
@@ -1,5 +1,5 @@
 # double-slash-root.m4 serial 4   -*- Autoconf -*-
-dnl Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index e30348c..433a466 100644 (file)
--- a/m4/dup.m4
+++ b/m4/dup.m4
@@ -1,5 +1,5 @@
-# dup.m4 serial 4
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# dup.m4 serial 7
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,10 +7,13 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_DUP],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  AC_REQUIRE([gl_MSVC_INVAL])
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-    REPLACE_DUP=1
-  fi
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  m4_ifdef([gl_MSVC_INVAL], [
+    AC_REQUIRE([gl_MSVC_INVAL])
+    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+      REPLACE_DUP=1
+    fi
+  ])
   dnl Replace dup() for supporting the gnulib-defined fchdir() function,
   dnl to keep fchdir's bookkeeping up-to-date.
   m4_ifdef([gl_FUNC_FCHDIR], [
@@ -23,7 +26,8 @@ AC_DEFUN([gl_FUNC_DUP],
     [AC_RUN_IFELSE(
       [AC_LANG_PROGRAM([[#include <unistd.h>
                          #include <fcntl.h>
-                         #include <errno.h>]],
+                         #include <errno.h>
+                       ]GL_MDA_DEFINES],
          [[/* On OS/2 kLIBC, dup does not work on a directory fd.  */
            int fd = open (".", O_RDONLY);
            return fd < 0 ? 1 : dup (fd) < 0 ? 2 : 0;
@@ -31,7 +35,12 @@ AC_DEFUN([gl_FUNC_DUP],
       ],
       [gl_cv_func_dup_works=yes],
       [gl_cv_func_dup_works=no],
-      [gl_cv_func_dup_works='guessing yes'])
+      [case "$host_os" in
+                 # Guess no on native Windows.
+         mingw*) gl_cv_func_dup_works="guessing no" ;;
+         *)      gl_cv_func_dup_works="guessing yes" ;;
+       esac
+      ])
     ])
   case "$gl_cv_func_dup_works" in
     *yes) ;;
index 5b68312..0753a32 100644 (file)
@@ -1,5 +1,5 @@
-#serial 25
-dnl Copyright (C) 2002, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+#serial 27
+dnl Copyright (C) 2002, 2005, 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,107 +8,95 @@ AC_DEFUN([gl_FUNC_DUP2],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
-  m4_ifdef([gl_FUNC_DUP2_OBSOLETE], [
-    AC_CHECK_FUNCS_ONCE([dup2])
-    if test $ac_cv_func_dup2 = no; then
-      HAVE_DUP2=0
-    fi
-  ], [
-    AC_DEFINE([HAVE_DUP2], [1], [Define to 1 if you have the 'dup2' function.])
-  ])
-  if test $HAVE_DUP2 = 1; then
-    AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
-      [AC_RUN_IFELSE([
-         AC_LANG_PROGRAM(
-           [[#include <errno.h>
-             #include <fcntl.h>
-             #include <limits.h>
-             #include <sys/resource.h>
-             #include <unistd.h>
-             #ifndef RLIM_SAVED_CUR
-             # define RLIM_SAVED_CUR RLIM_INFINITY
-             #endif
-             #ifndef RLIM_SAVED_MAX
-             # define RLIM_SAVED_MAX RLIM_INFINITY
-             #endif
-           ]],
-           [[int result = 0;
-             int bad_fd = INT_MAX;
-             struct rlimit rlim;
-             if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
-                 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
-                 && rlim.rlim_cur != RLIM_INFINITY
-                 && rlim.rlim_cur != RLIM_SAVED_MAX
-                 && rlim.rlim_cur != RLIM_SAVED_CUR)
-               bad_fd = rlim.rlim_cur;
-             #ifdef FD_CLOEXEC
-               if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
-                 result |= 1;
-             #endif
-             if (dup2 (1, 1) != 1)
-               result |= 2;
-             #ifdef FD_CLOEXEC
-               if (fcntl (1, F_GETFD) != FD_CLOEXEC)
-                 result |= 4;
-             #endif
-             close (0);
-             if (dup2 (0, 0) != -1)
-               result |= 8;
-             /* Many gnulib modules require POSIX conformance of EBADF.  */
-             if (dup2 (2, bad_fd) == -1 && errno != EBADF)
-               result |= 16;
-             /* Flush out some cygwin core dumps.  */
-             if (dup2 (2, -1) != -1 || errno != EBADF)
-               result |= 32;
-             dup2 (2, 255);
-             dup2 (2, 256);
-             /* On OS/2 kLIBC, dup2() does not work on a directory fd.  */
-             {
-               int fd = open (".", O_RDONLY);
-               if (fd == -1)
-                 result |= 64;
-               else if (dup2 (fd, fd + 1) == -1)
-                 result |= 128;
-
-               close (fd);
-             }
-             return result;]])
-        ],
-        [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
-        [case "$host_os" in
-           mingw*) # on this platform, dup2 always returns 0 for success
-             gl_cv_func_dup2_works="guessing no" ;;
-           cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
-             gl_cv_func_dup2_works="guessing no" ;;
-           aix* | freebsd*)
-                   # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
-                   # not EBADF.
-             gl_cv_func_dup2_works="guessing no" ;;
-           haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
-             gl_cv_func_dup2_works="guessing no" ;;
-           *-android*) # implemented using dup3(), which fails if oldfd == newfd
-             gl_cv_func_dup2_works="guessing no" ;;
-           os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
-             gl_cv_func_dup2_works="guessing no" ;;
-           *) gl_cv_func_dup2_works="guessing yes" ;;
-         esac])
-      ])
-    case "$gl_cv_func_dup2_works" in
-      *yes) ;;
-      *)
-        REPLACE_DUP2=1
-        AC_CHECK_FUNCS([setdtablesize])
-        ;;
-    esac
-  fi
+  AC_CACHE_CHECK([whether dup2 works], [gl_cv_func_dup2_works],
+    [AC_RUN_IFELSE([
+       AC_LANG_PROGRAM(
+         [[#include <errno.h>
+           #include <fcntl.h>
+           #include <limits.h>
+           #include <sys/resource.h>
+           #include <unistd.h>
+           ]GL_MDA_DEFINES[
+           #ifndef RLIM_SAVED_CUR
+           # define RLIM_SAVED_CUR RLIM_INFINITY
+           #endif
+           #ifndef RLIM_SAVED_MAX
+           # define RLIM_SAVED_MAX RLIM_INFINITY
+           #endif
+         ]],
+         [[int result = 0;
+           int bad_fd = INT_MAX;
+           struct rlimit rlim;
+           if (getrlimit (RLIMIT_NOFILE, &rlim) == 0
+               && 0 <= rlim.rlim_cur && rlim.rlim_cur <= INT_MAX
+               && rlim.rlim_cur != RLIM_INFINITY
+               && rlim.rlim_cur != RLIM_SAVED_MAX
+               && rlim.rlim_cur != RLIM_SAVED_CUR)
+             bad_fd = rlim.rlim_cur;
+           #ifdef FD_CLOEXEC
+             if (fcntl (1, F_SETFD, FD_CLOEXEC) == -1)
+               result |= 1;
+           #endif
+           if (dup2 (1, 1) != 1)
+             result |= 2;
+           #ifdef FD_CLOEXEC
+             if (fcntl (1, F_GETFD) != FD_CLOEXEC)
+               result |= 4;
+           #endif
+           close (0);
+           if (dup2 (0, 0) != -1)
+             result |= 8;
+           /* Many gnulib modules require POSIX conformance of EBADF.  */
+           if (dup2 (2, bad_fd) == -1 && errno != EBADF)
+             result |= 16;
+           /* Flush out some cygwin core dumps.  */
+           if (dup2 (2, -1) != -1 || errno != EBADF)
+             result |= 32;
+           dup2 (2, 255);
+           dup2 (2, 256);
+           /* On OS/2 kLIBC, dup2() does not work on a directory fd.  */
+           {
+             int fd = open (".", O_RDONLY);
+             if (fd == -1)
+               result |= 64;
+             else if (dup2 (fd, fd + 1) == -1)
+               result |= 128;
+             close (fd);
+           }
+           return result;]])
+      ],
+      [gl_cv_func_dup2_works=yes], [gl_cv_func_dup2_works=no],
+      [case "$host_os" in
+         mingw*) # on this platform, dup2 always returns 0 for success
+           gl_cv_func_dup2_works="guessing no" ;;
+         cygwin*) # on cygwin 1.5.x, dup2(1,1) returns 0
+           gl_cv_func_dup2_works="guessing no" ;;
+         aix* | freebsd*)
+                 # on AIX 7.1 and FreeBSD 6.1, dup2 (1,toobig) gives EMFILE,
+                 # not EBADF.
+           gl_cv_func_dup2_works="guessing no" ;;
+         haiku*) # on Haiku alpha 2, dup2(1, 1) resets FD_CLOEXEC.
+           gl_cv_func_dup2_works="guessing no" ;;
+         *-android*) # implemented using dup3(), which fails if oldfd == newfd
+           gl_cv_func_dup2_works="guessing no" ;;
+         os2*) # on OS/2 kLIBC, dup2() does not work on a directory fd.
+           gl_cv_func_dup2_works="guessing no" ;;
+         *) gl_cv_func_dup2_works="guessing yes" ;;
+       esac])
+    ])
+  case "$gl_cv_func_dup2_works" in
+    *yes) ;;
+    *)
+      REPLACE_DUP2=1
+      AC_CHECK_FUNCS([setdtablesize])
+      ;;
+  esac
   dnl Replace dup2() for supporting the gnulib-defined fchdir() function,
   dnl to keep fchdir's bookkeeping up-to-date.
   m4_ifdef([gl_FUNC_FCHDIR], [
     gl_TEST_FCHDIR
     if test $HAVE_FCHDIR = 0; then
-      if test $HAVE_DUP2 = 1; then
-        REPLACE_DUP2=1
-      fi
+      REPLACE_DUP2=1
     fi
   ])
 ])
diff --git a/m4/eaccess.m4 b/m4/eaccess.m4
new file mode 100644 (file)
index 0000000..924eacb
--- /dev/null
@@ -0,0 +1,12 @@
+# eaccess.m4 serial 2
+dnl Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_EACCESS],
+[
+  AC_CHECK_FUNC([eaccess], ,
+    [AC_DEFINE([eaccess], [access],
+       [Define as 'access' if you don't have the eaccess() function.])])
+])
index 63d74de..002f0c8 100644 (file)
@@ -1,5 +1,5 @@
 # eealloc.m4 serial 3
-dnl Copyright (C) 2003, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 9a0ea7e..d971770 100644 (file)
@@ -1,5 +1,5 @@
-# environ.m4 serial 6
-dnl Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc.
+# environ.m4 serial 7
+dnl Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -29,16 +29,14 @@ AC_DEFUN_ONCE([gl_ENVIRON],
 AC_DEFUN([gt_CHECK_VAR_DECL],
 [
   define([gt_cv_var], [gt_cv_var_]$2[_declaration])
-  AC_MSG_CHECKING([if $2 is properly declared])
-  AC_CACHE_VAL([gt_cv_var], [
-    AC_COMPILE_IFELSE(
-      [AC_LANG_PROGRAM(
-         [[$1
-           extern struct { int foo; } $2;]],
-         [[$2.foo = 1;]])],
-      [gt_cv_var=no],
-      [gt_cv_var=yes])])
-  AC_MSG_RESULT([$gt_cv_var])
+  AC_CACHE_CHECK([if $2 is properly declared], [gt_cv_var],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[$1
+            extern struct { int foo; } $2;]],
+          [[$2.foo = 1;]])],
+       [gt_cv_var=no],
+       [gt_cv_var=yes])])
   if test $gt_cv_var = yes; then
     AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
               [Define if you have the declaration of $2.])
index b111fce..51dfe92 100644 (file)
@@ -1,9 +1,11 @@
-# errno_h.m4 serial 12
-dnl Copyright (C) 2004, 2006, 2008-2016 Free Software Foundation, Inc.
+# errno_h.m4 serial 13
+dnl Copyright (C) 2004, 2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+AC_PREREQ([2.61])
+
 AC_DEFUN_ONCE([gl_HEADER_ERRNO_H],
 [
   AC_REQUIRE([AC_PROG_CC])
@@ -129,9 +131,3 @@ yes
     AC_SUBST($1[_VALUE])
   fi
 ])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
-  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
index f772bcf..77f67f7 100644 (file)
@@ -1,6 +1,6 @@
 #serial 14
 
-# Copyright (C) 1996-1998, 2001-2004, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 1996-1998, 2001-2004, 2009-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
index 4a57b89..b5eab80 100644 (file)
@@ -1,5 +1,5 @@
 # execute.m4 serial 5
-dnl Copyright (C) 2003, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/explicit_bzero.m4 b/m4/explicit_bzero.m4
new file mode 100644 (file)
index 0000000..8c86d69
--- /dev/null
@@ -0,0 +1,23 @@
+dnl Copyright 2017-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_EXPLICIT_BZERO],
+[
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
+
+  dnl Persuade glibc <string.h> to declare explicit_bzero.
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  AC_CHECK_FUNCS_ONCE([explicit_bzero])
+  if test $ac_cv_func_explicit_bzero = no; then
+    HAVE_EXPLICIT_BZERO=0
+  fi
+])
+
+AC_DEFUN([gl_PREREQ_EXPLICIT_BZERO],
+[
+  AC_CHECK_FUNCS([explicit_memset])
+  AC_CHECK_FUNCS_ONCE([memset_s])
+])
index 7869a7d..fb136f4 100644 (file)
@@ -1,5 +1,5 @@
 # exponentd.m4 serial 3
-dnl Copyright (C) 2007-2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index d4298f2..308d023 100644 (file)
@@ -1,5 +1,5 @@
 # exponentf.m4 serial 2
-dnl Copyright (C) 2007-2008, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2008, 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index c49cf2c..508fe93 100644 (file)
@@ -1,11 +1,12 @@
-# exponentl.m4 serial 3
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# exponentl.m4 serial 5
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_LONG_DOUBLE_EXPONENT_LOCATION],
 [
   AC_REQUIRE([gl_BIGENDIAN])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([where to find the exponent in a 'long double'],
     [gl_cv_cc_long_double_expbit0],
     [
@@ -21,14 +22,14 @@ typedef union { long double value; unsigned int word[NWORDS]; }
         memory_long_double;
 static unsigned int ored_words[NWORDS];
 static unsigned int anded_words[NWORDS];
-static void add_to_ored_words (long double x)
+static void add_to_ored_words (long double *x)
 {
   memory_long_double m;
   size_t i;
   /* Clear it first, in case
      sizeof (long double) < sizeof (memory_long_double).  */
   memset (&m, 0, sizeof (memory_long_double));
-  m.value = x;
+  m.value = *x;
   for (i = 0; i < NWORDS; i++)
     {
       ored_words[i] |= m.word[i];
@@ -37,17 +38,15 @@ static void add_to_ored_words (long double x)
 }
 int main ()
 {
+  static long double samples[5] = { 0.25L, 0.5L, 1.0L, 2.0L, 4.0L };
   size_t j;
   FILE *fp = fopen ("conftest.out", "w");
   if (fp == NULL)
     return 1;
   for (j = 0; j < NWORDS; j++)
     anded_words[j] = ~ (unsigned int) 0;
-  add_to_ored_words (0.25L);
-  add_to_ored_words (0.5L);
-  add_to_ored_words (1.0L);
-  add_to_ored_words (2.0L);
-  add_to_ored_words (4.0L);
+  for (j = 0; j < 5; j++)
+    add_to_ored_words (&samples[j]);
   /* Remove bits that are common (e.g. if representation of the first mantissa
      bit is explicit).  */
   for (j = 0; j < NWORDS; j++)
@@ -79,9 +78,24 @@ int main ()
         [gl_cv_cc_long_double_expbit0=`cat conftest.out`],
         [gl_cv_cc_long_double_expbit0="unknown"],
         [
-          dnl When cross-compiling, we don't know. It depends on the
+          dnl When cross-compiling, in general we don't know. It depends on the
           dnl ABI and compiler version. There are too many cases.
           gl_cv_cc_long_double_expbit0="unknown"
+          case "$host_os" in
+            mingw*) # On native Windows (little-endian), we know the result
+                    # in two cases: mingw, MSVC.
+              AC_EGREP_CPP([Known], [
+#ifdef __MINGW32__
+ Known
+#endif
+                ], [gl_cv_cc_long_double_expbit0="word 2 bit 0"])
+              AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+                ], [gl_cv_cc_long_double_expbit0="word 1 bit 20"])
+              ;;
+          esac
         ])
       rm -f conftest.out
     ])
index e114a6f..5792a95 100644 (file)
@@ -1,14 +1,19 @@
-# serial 15  -*- Autoconf -*-
+# serial 22  -*- Autoconf -*-
 # Enable extensions on systems that normally disable them.
 
-# Copyright (C) 2003, 2006-2016 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2006-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+dnl Define to empty for the benefit of Autoconf 2.69 and earlier, so that
+dnl AC_USE_SYSTEM_EXTENSIONS (below) can be used unchanged from Autoconf 2.70+.
+m4_ifndef([AC_CHECK_INCLUDES_DEFAULT],
+  [AC_DEFUN([AC_CHECK_INCLUDES_DEFAULT], [])])
+
 # This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from git
 # Autoconf.  Perhaps we can remove this once we can assume Autoconf
-# 2.70 or later everywhere, but since Autoconf mutates rapidly
+# is recent-enough everywhere, but since Autoconf mutates rapidly
 # enough in this area it's likely we'll need to redefine
 # AC_USE_SYSTEM_EXTENSIONS for quite some time.
 
 #      its dependencies. This will ensure that the gl_USE_SYSTEM_EXTENSIONS
 #      invocation occurs in gl_EARLY, not in gl_INIT.
 
+m4_version_prereq([2.70.1], [], [
+
 # AC_USE_SYSTEM_EXTENSIONS
 # ------------------------
 # Enable extensions on systems that normally disable them,
 # typically due to standards-conformance issues.
-#
-# Remember that #undef in AH_VERBATIM gets replaced with #define by
-# AC_DEFINE.  The goal here is to define all known feature-enabling
-# macros, then, if reports of conflicts are made, disable macros that
-# cause problems on some platforms (such as __EXTENSIONS__).
+# We unconditionally define as many of the known feature-enabling
+# as possible, reserving conditional behavior for macros that are
+# known to cause problems on some platforms (such as __EXTENSIONS__).
 AC_DEFUN_ONCE([AC_USE_SYSTEM_EXTENSIONS],
-[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+[AC_BEFORE([$0], [AC_PREPROC_IFELSE])dnl
+AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
+AC_BEFORE([$0], [AC_LINK_IFELSE])dnl
 AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
-
-  AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
-  if test "$MINIX" = yes; then
-    AC_DEFINE([_POSIX_SOURCE], [1],
-      [Define to 1 if you need to in order for 'stat' and other
-       things to work.])
-    AC_DEFINE([_POSIX_1_SOURCE], [2],
-      [Define to 2 if the system does not provide POSIX.1 features
-       except with this defined.])
-    AC_DEFINE([_MINIX], [1],
-      [Define to 1 if on MINIX.])
-    AC_DEFINE([_NETBSD_SOURCE], [1],
-      [Define to 1 to make NetBSD features available.  MINIX 3 needs this.])
-  fi
-
+AC_BEFORE([$0], [AC_CHECK_INCLUDES_DEFAULT])dnl
+dnl #undef in AH_VERBATIM gets replaced with #define by AC_DEFINE.
 dnl Use a different key than __EXTENSIONS__, as that name broke existing
 dnl configure.ac when using autoheader 2.62.
-  AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
+dnl The macros below are in alphabetical order ignoring leading _ or __
+dnl prefixes.
+AH_VERBATIM([USE_SYSTEM_EXTENSIONS],
 [/* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
@@ -64,11 +60,44 @@ dnl configure.ac when using autoheader 2.62.
 #ifndef _DARWIN_C_SOURCE
 # undef _DARWIN_C_SOURCE
 #endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
-/* Enable threading extensions on Solaris.  */
+/* Enable X/Open compliant socket functions that do not require linking
+   with -lxnet on HP-UX 11.11.  */
+#ifndef _HPUX_ALT_XOPEN_SOCKET_API
+# undef _HPUX_ALT_XOPEN_SOCKET_API
+#endif
+/* Identify the host operating system as Minix.
+   This macro does not affect the system headers' behavior.
+   A future release of Autoconf may stop defining this macro.  */
+#ifndef _MINIX
+# undef _MINIX
+#endif
+/* Enable general extensions on NetBSD.
+   Enable NetBSD compatibility extensions on Minix.  */
+#ifndef _NETBSD_SOURCE
+# undef _NETBSD_SOURCE
+#endif
+/* Enable OpenBSD compatibility extensions on NetBSD.
+   Oddly enough, this does nothing on OpenBSD.  */
+#ifndef _OPENBSD_SOURCE
+# undef _OPENBSD_SOURCE
+#endif
+/* Define to 1 if needed for POSIX-compatible behavior.  */
+#ifndef _POSIX_SOURCE
+# undef _POSIX_SOURCE
+#endif
+/* Define to 2 if needed for POSIX-compatible behavior.  */
+#ifndef _POSIX_1_SOURCE
+# undef _POSIX_1_SOURCE
+#endif
+/* Enable POSIX-compatible threading on Solaris.  */
 #ifndef _POSIX_PTHREAD_SEMANTICS
 # undef _POSIX_PTHREAD_SEMANTICS
 #endif
@@ -104,17 +133,19 @@ dnl configure.ac when using autoheader 2.62.
 #ifndef _TANDEM_SOURCE
 # undef _TANDEM_SOURCE
 #endif
-/* Enable X/Open extensions if necessary.  HP-UX 11.11 defines
-   mbstate_t only if _XOPEN_SOURCE is defined to 500, regardless of
-   whether compiling with -Ae or -D_HPUX_SOURCE=1.  */
+/* Enable X/Open extensions.  Define to 500 only if necessary
+   to make mbstate_t available.  */
 #ifndef _XOPEN_SOURCE
 # undef _XOPEN_SOURCE
 #endif
-/* Enable general extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-])
+])dnl
+
+  AC_REQUIRE([AC_CHECK_INCLUDES_DEFAULT])dnl
+  _AC_CHECK_HEADER_ONCE([wchar.h])
+  _AC_CHECK_HEADER_ONCE([minix/config.h])
+
+dnl Defining __EXTENSIONS__ may break the system headers on some systems.
+dnl (FIXME: Which ones?)
   AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
     [ac_cv_safe_to_define___extensions__],
     [AC_COMPILE_IFELSE(
@@ -123,11 +154,35 @@ dnl configure.ac when using autoheader 2.62.
           ]AC_INCLUDES_DEFAULT])],
        [ac_cv_safe_to_define___extensions__=yes],
        [ac_cv_safe_to_define___extensions__=no])])
-  test $ac_cv_safe_to_define___extensions__ = yes &&
-    AC_DEFINE([__EXTENSIONS__])
+
+dnl HP-UX 11.11 defines mbstate_t only if _XOPEN_SOURCE is defined to
+dnl 500, regardless of whether compiling with -Ae or -D_HPUX_SOURCE=1.
+dnl But defining _XOPEN_SOURCE may turn *off* extensions on platforms
+dnl not covered by turn-on-extensions macros (notably Dragonfly, Free,
+dnl and OpenBSD, which don't have any equivalent of _NETBSD_SOURCE) so
+dnl it should only be defined when necessary.
+  AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
+    [ac_cv_should_define__xopen_source],
+    [ac_cv_should_define__xopen_source=no
+    AS_IF([test $ac_cv_header_wchar_h = yes],
+      [AC_COMPILE_IFELSE(
+        [AC_LANG_PROGRAM([[
+          #include <wchar.h>
+          mbstate_t x;]])],
+        [],
+        [AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM([[
+            #define _XOPEN_SOURCE 500
+            #include <wchar.h>
+            mbstate_t x;]])],
+          [ac_cv_should_define__xopen_source=yes])])])])
+
   AC_DEFINE([_ALL_SOURCE])
   AC_DEFINE([_DARWIN_C_SOURCE])
   AC_DEFINE([_GNU_SOURCE])
+  AC_DEFINE([_HPUX_ALT_XOPEN_SOCKET_API])
+  AC_DEFINE([_NETBSD_SOURCE])
+  AC_DEFINE([_OPENBSD_SOURCE])
   AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
   AC_DEFINE([__STDC_WANT_IEC_60559_ATTRIBS_EXT__])
   AC_DEFINE([__STDC_WANT_IEC_60559_BFP_EXT__])
@@ -137,23 +192,18 @@ dnl configure.ac when using autoheader 2.62.
   AC_DEFINE([__STDC_WANT_LIB_EXT2__])
   AC_DEFINE([__STDC_WANT_MATH_SPEC_FUNCS__])
   AC_DEFINE([_TANDEM_SOURCE])
-  AC_CACHE_CHECK([whether _XOPEN_SOURCE should be defined],
-    [ac_cv_should_define__xopen_source],
-    [ac_cv_should_define__xopen_source=no
-     AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM([[
-          #include <wchar.h>
-          mbstate_t x;]])],
-       [],
-       [AC_COMPILE_IFELSE(
-          [AC_LANG_PROGRAM([[
-             #define _XOPEN_SOURCE 500
-             #include <wchar.h>
-             mbstate_t x;]])],
-          [ac_cv_should_define__xopen_source=yes])])])
-  test $ac_cv_should_define__xopen_source = yes &&
-    AC_DEFINE([_XOPEN_SOURCE], [500])
+  AS_IF([test $ac_cv_header_minix_config_h = yes],
+    [MINIX=yes
+    AC_DEFINE([_MINIX])
+    AC_DEFINE([_POSIX_SOURCE])
+    AC_DEFINE([_POSIX_1_SOURCE], [2])],
+    [MINIX=])
+  AS_IF([test $ac_cv_safe_to_define___extensions__ = yes],
+    [AC_DEFINE([__EXTENSIONS__])])
+  AS_IF([test $ac_cv_should_define__xopen_source = yes],
+    [AC_DEFINE([_XOPEN_SOURCE], [500])])
 ])# AC_USE_SYSTEM_EXTENSIONS
+])
 
 # gl_USE_SYSTEM_EXTENSIONS
 # ------------------------
@@ -161,13 +211,17 @@ dnl configure.ac when using autoheader 2.62.
 # typically due to standards-conformance issues.
 AC_DEFUN_ONCE([gl_USE_SYSTEM_EXTENSIONS],
 [
-  dnl Require this macro before AC_USE_SYSTEM_EXTENSIONS.
-  dnl gnulib does not need it. But if it gets required by third-party macros
-  dnl after AC_USE_SYSTEM_EXTENSIONS is required, autoconf 2.62..2.63 emit a
-  dnl warning: "AC_COMPILE_IFELSE was called before AC_USE_SYSTEM_EXTENSIONS".
-  dnl Note: We can do this only for one of the macros AC_AIX, AC_GNU_SOURCE,
-  dnl AC_MINIX. If people still use AC_AIX or AC_MINIX, they are out of luck.
-  AC_REQUIRE([AC_GNU_SOURCE])
-
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  dnl On OpenBSD 6.8 with GCC, the include files contain a couple of
+  dnl definitions that are only activated with an explicit -D_ISOC11_SOURCE.
+  dnl That's because this version of GCC (4.2.1) supports the option
+  dnl '-std=gnu99' but not the option '-std=gnu11'.
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    openbsd*)
+      AC_DEFINE([_ISOC11_SOURCE], [1],
+        [Define to enable the declarations of ISO C 11 types and functions.])
+      ;;
+  esac
 ])
index 1e578f3..a2acf12 100644 (file)
@@ -1,6 +1,6 @@
 dnl 'extern inline' a la ISO C99.
 
-dnl Copyright 2012-2016 Free Software Foundation, Inc.
+dnl Copyright 2012-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,7 +11,7 @@ AC_DEFUN([gl_EXTERN_INLINE],
 [/* Please see the Gnulib manual for how to use these macros.
 
    Suppress extern inline with HP-UX cc, as it appears to be broken; see
-   <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+   <https://lists.gnu.org/r/bug-texinfo/2013-02/msg00030.html>.
 
    Suppress extern inline with Sun C in standards-conformance mode, as it
    mishandles inline functions that call each other.  E.g., for 'inline void f
@@ -25,20 +25,32 @@ AC_DEFUN([gl_EXTERN_INLINE],
    if isdigit is mistakenly implemented via a static inline function,
    a program containing an extern inline function that calls isdigit
    may not work since the C standard prohibits extern inline functions
-   from calling static functions.  This bug is known to occur on:
+   from calling static functions (ISO C 99 section 6.7.4.(3).
+   This bug is known to occur on:
 
      OS X 10.8 and earlier; see:
-     http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+     https://lists.gnu.org/r/bug-gnulib/2012-12/msg00023.html
 
      DragonFly; see
-     http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+     http://muscles.dragonflybsd.org/bulk/clang-master-potential/20141111_102002/logs/ah-tty-0.3.12.log
 
      FreeBSD; see:
-     http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
+     https://lists.gnu.org/r/bug-gnulib/2014-07/msg00104.html
 
    OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
-   for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
-   Assume DragonFly and FreeBSD will be similar.  */
+   for clang but remains for g++; see <https://trac.macports.org/ticket/41033>.
+   Assume DragonFly and FreeBSD will be similar.
+
+   GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+   inline semantics, unless -fgnu89-inline is used.  It defines a macro
+   __GNUC_STDC_INLINE__ to indicate this situation or a macro
+   __GNUC_GNU_INLINE__ to indicate the opposite situation.
+   GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
+   semantics but warns, unless -fgnu89-inline is used:
+     warning: C99 inline functions are not supported; using GNU89
+     warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
+   It defines a macro __GNUC_GNU_INLINE__ to indicate this situation.
+ */
 #if (((defined __APPLE__ && defined __MACH__) \
       || defined __DragonFly__ || defined __FreeBSD__) \
      && (defined __header_inline \
index 6f2e56b..7c69c69 100644 (file)
@@ -1,5 +1,5 @@
 # fatal-signal.m4 serial 9
-dnl Copyright (C) 2003-2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/fchdir.m4 b/m4/fchdir.m4
new file mode 100644 (file)
index 0000000..5d2fab7
--- /dev/null
@@ -0,0 +1,68 @@
+# fchdir.m4 serial 26
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FCHDIR],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+  AC_CHECK_DECLS_ONCE([fchdir])
+  if test $ac_cv_have_decl_fchdir = no; then
+    HAVE_DECL_FCHDIR=0
+  fi
+
+  AC_REQUIRE([gl_TEST_FCHDIR])
+  if test $HAVE_FCHDIR = 0; then
+    AC_LIBOBJ([fchdir])
+    gl_PREREQ_FCHDIR
+    AC_DEFINE([REPLACE_FCHDIR], [1],
+      [Define to 1 if gnulib's fchdir() replacement is used.])
+    dnl We must also replace anything that can manipulate a directory fd,
+    dnl to keep our bookkeeping up-to-date.  We don't have to replace
+    dnl fstatat, since no platform has fstatat but lacks fchdir.
+    AC_CACHE_CHECK([whether open can visit directories],
+      [gl_cv_func_open_directory_works],
+      [AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#include <fcntl.h>
+            ]GL_MDA_DEFINES],
+            [[return open(".", O_RDONLY) < 0;]])],
+         [gl_cv_func_open_directory_works=yes],
+         [gl_cv_func_open_directory_works=no],
+         [case "$host_os" in
+                             # Guess yes on Linux systems.
+            linux-* | linux) gl_cv_func_open_directory_works="guessing yes" ;;
+                             # Guess yes on glibc systems.
+            *-gnu* | gnu*)   gl_cv_func_open_directory_works="guessing yes" ;;
+                             # Guess no on native Windows.
+            mingw*)          gl_cv_func_open_directory_works="guessing no" ;;
+                             # If we don't know, obey --enable-cross-guesses.
+            *)               gl_cv_func_open_directory_works="$gl_cross_guess_normal" ;;
+          esac
+         ])])
+    case "$gl_cv_func_open_directory_works" in
+      *yes) ;;
+      *)
+        AC_DEFINE([REPLACE_OPEN_DIRECTORY], [1], [Define to 1 if open() should
+work around the inability to open a directory.])
+        ;;
+    esac
+  fi
+])
+
+# Determine whether to use the overrides in lib/fchdir.c.
+AC_DEFUN([gl_TEST_FCHDIR],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([fchdir])
+  if test $ac_cv_func_fchdir = no; then
+    HAVE_FCHDIR=0
+  fi
+])
+
+# Prerequisites of lib/fchdir.c.
+AC_DEFUN([gl_PREREQ_FCHDIR], [:])
index 3fa25b1..dec2208 100644 (file)
@@ -1,5 +1,5 @@
-# fclose.m4 serial 7
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# fclose.m4 serial 9
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,9 +10,10 @@ AC_DEFUN([gl_FUNC_FCLOSE],
   AC_REQUIRE([AC_CANONICAL_HOST])
 
   gl_FUNC_FFLUSH_STDIN
-  if test $gl_cv_func_fflush_stdin != yes; then
-    REPLACE_FCLOSE=1
-  fi
+  case "$gl_cv_func_fflush_stdin" in
+    *yes) ;;
+    *) REPLACE_FCLOSE=1 ;;
+  esac
 
   AC_REQUIRE([gl_FUNC_CLOSE])
   if test $REPLACE_CLOSE = 1; then
@@ -22,4 +23,76 @@ AC_DEFUN([gl_FUNC_FCLOSE],
   case "$host_os" in
     openedition) REPLACE_FCLOSE=1 ;;
   esac
+
+  if test $REPLACE_FCLOSE = 0; then
+    gl_FUNC_FCLOSE_STDIN
+    case "$gl_cv_func_fclose_stdin" in
+      *yes) ;;
+      *) REPLACE_FCLOSE=1 ;;
+    esac
+  fi
+])
+
+dnl Determine whether fclose works on input streams.
+dnl Sets gl_cv_func_fclose_stdin.
+
+AC_DEFUN([gl_FUNC_FCLOSE_STDIN],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  AC_CACHE_CHECK([whether fclose works on input streams],
+    [gl_cv_func_fclose_stdin],
+    [echo hello world > conftest.txt
+     AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <fcntl.h>
+            #include <stdio.h>
+            #if HAVE_UNISTD_H
+            # include <unistd.h>
+            #else /* on Windows with MSVC */
+            # include <io.h>
+            #endif
+           ]GL_MDA_DEFINES],
+          [[int fd;
+            int fd2;
+            FILE *fp;
+            fd = open ("conftest.txt", O_RDONLY);
+            if (fd < 0)
+              return 1;
+            if (lseek (fd, 1, SEEK_SET) != 1)
+              return 2;
+            fd2 = dup (fd);
+            if (fd2 < 0)
+              return 3;
+            fp = fdopen (fd2, "r");
+            if (fp == NULL)
+              return 4;
+            if (fgetc (fp) != 'e')
+              { fclose (fp); return 5; }
+            /* This fclose() call should reposition the underlying file
+               descriptor.  */
+            if (fclose (fp) != 0)
+              return 6;
+            if (lseek (fd2, 0, SEEK_CUR) != -1) /* should fail with EBADF */
+              return 7;
+            /* Verify the file position.  */
+            if (lseek (fd, 0, SEEK_CUR) != 2)
+              return 8;
+            return 0;
+          ]])],
+       [gl_cv_func_fclose_stdin=yes],
+       [gl_cv_func_fclose_stdin=no],
+       [case "$host_os" in
+                         # Guess no on glibc systems.
+          *-gnu* | gnu*) gl_cv_func_fclose_stdin="guessing no" ;;
+                         # Guess yes on musl systems.
+          *-musl*)       gl_cv_func_fclose_stdin="guessing yes" ;;
+                         # Guess no on native Windows.
+          mingw*)        gl_cv_func_fclose_stdin="guessing no" ;;
+                         # If we don't know, obey --enable-cross-guesses.
+          *)             gl_cv_func_fclose_stdin="$gl_cross_guess_normal" ;;
+        esac
+       ])
+     rm conftest.txt
+    ])
 ])
index 24fcf88..7c459ad 100644 (file)
@@ -1,23 +1,22 @@
-# fcntl-o.m4 serial 4
-dnl Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+# fcntl-o.m4 serial 7
+dnl Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Paul Eggert.
 
+AC_PREREQ([2.60])
+
 # Test whether the flags O_NOATIME and O_NOFOLLOW actually work.
 # Define HAVE_WORKING_O_NOATIME to 1 if O_NOATIME works, or to 0 otherwise.
 # Define HAVE_WORKING_O_NOFOLLOW to 1 if O_NOFOLLOW works, or to 0 otherwise.
 AC_DEFUN([gl_FCNTL_O_FLAGS],
 [
   dnl Persuade glibc <fcntl.h> to define O_NOATIME and O_NOFOLLOW.
-  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
-  dnl AC_GNU_SOURCE.
-  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
-    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
-    [AC_REQUIRE([AC_GNU_SOURCE])])
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CHECK_HEADERS_ONCE([unistd.h])
   AC_CHECK_FUNCS_ONCE([symlink])
   AC_CACHE_CHECK([for working fcntl.h], [gl_cv_header_working_fcntl_h],
@@ -33,6 +32,7 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
            # defined sleep(n) _sleep ((n) * 1000)
            #endif
            #include <fcntl.h>
+           ]GL_MDA_DEFINES[
            #ifndef O_NOATIME
             #define O_NOATIME 0
            #endif
@@ -116,7 +116,13 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
         68) gl_cv_header_working_fcntl_h='no (bad O_NOATIME, O_NOFOLLOW)';; #(
          *) gl_cv_header_working_fcntl_h='no';;
         esac],
-       [gl_cv_header_working_fcntl_h=cross-compiling])])
+       [case "$host_os" in
+                  # Guess 'no' on native Windows.
+          mingw*) gl_cv_header_working_fcntl_h='no' ;;
+          *)      gl_cv_header_working_fcntl_h=cross-compiling ;;
+        esac
+       ])
+    ])
 
   case $gl_cv_header_working_fcntl_h in #(
   *O_NOATIME* | no | cross-compiling) ac_val=0;; #(
index bb61470..f626434 100644 (file)
@@ -1,5 +1,5 @@
-# fcntl.m4 serial 9
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# fcntl.m4 serial 11
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -34,6 +34,7 @@ AC_DEFUN([gl_FUNC_FCNTL],
               #include <limits.h>
               #include <sys/resource.h>
               #include <unistd.h>
+              ]GL_MDA_DEFINES[
               #ifndef RLIM_SAVED_CUR
               # define RLIM_SAVED_CUR RLIM_INFINITY
               #endif
@@ -80,15 +81,29 @@ AC_DEFUN([gl_FUNC_FCNTL],
           behavior does not match POSIX]) ;;
     esac
 
-    dnl Many systems lack F_DUPFD_CLOEXEC
+    dnl Many systems lack F_DUPFD_CLOEXEC.
+    dnl NetBSD 9.0 declares F_DUPFD_CLOEXEC but it works only like F_DUPFD.
     AC_CACHE_CHECK([whether fcntl understands F_DUPFD_CLOEXEC],
       [gl_cv_func_fcntl_f_dupfd_cloexec],
-      [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#include <fcntl.h>
-#ifndef F_DUPFD_CLOEXEC
-choke me
-#endif
-         ]])],
+      [AC_RUN_IFELSE(
+         [AC_LANG_SOURCE(
+            [[#include <fcntl.h>
+              #include <unistd.h>
+              int main (int argc, char *argv[])
+              {
+                if (argc == 1)
+                  /* parent process */
+                  {
+                    if (fcntl (1, F_DUPFD_CLOEXEC, 10) < 0)
+                      return 1;
+                    return execl ("./conftest", "./conftest", "child", NULL);
+                  }
+                else
+                  /* child process */
+                  return (fcntl (10, F_GETFL) < 0 ? 0 : 42);
+              }
+            ]])
+         ],
          [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #ifdef __linux__
 /* The Linux kernel only added F_DUPFD_CLOEXEC in 2.6.24, so we always replace
@@ -97,12 +112,22 @@ choke me
 #endif
            ]])],
            [gl_cv_func_fcntl_f_dupfd_cloexec=yes],
-           [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])],
-         [gl_cv_func_fcntl_f_dupfd_cloexec=no])])
-    if test "$gl_cv_func_fcntl_f_dupfd_cloexec" != yes; then
-      gl_REPLACE_FCNTL
-      dnl No witness macro needed for this bug.
-    fi
+           [gl_cv_func_fcntl_f_dupfd_cloexec="needs runtime check"])
+         ],
+         [gl_cv_func_fcntl_f_dupfd_cloexec=no],
+         [case "$host_os" in
+                     # Guess no on NetBSD.
+            netbsd*) gl_cv_func_fcntl_f_dupfd_cloexec="guessing no" ;;
+            *)       gl_cv_func_fcntl_f_dupfd_cloexec="$gl_cross_guess_normal" ;;
+          esac
+         ])
+      ])
+    case "$gl_cv_func_fcntl_f_dupfd_cloexec" in
+      *yes) ;;
+      *)    gl_REPLACE_FCNTL
+            dnl No witness macro needed for this bug.
+            ;;
+    esac
   fi
   dnl Replace fcntl() for supporting the gnulib-defined fchdir() function,
   dnl to keep fchdir's bookkeeping up-to-date.
index ef0d78d..aba4473 100644 (file)
@@ -1,13 +1,13 @@
-# serial 15
+# serial 20
 # Configure fcntl.h.
-dnl Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Paul Eggert.
 
-AC_DEFUN([gl_FCNTL_H],
+AC_DEFUN_ONCE([gl_FCNTL_H],
 [
   AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
   AC_REQUIRE([gl_FCNTL_O_FLAGS])
@@ -26,24 +26,44 @@ AC_DEFUN([gl_FCNTL_H],
     ]], [fcntl openat])
 ])
 
+# gl_FCNTL_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_FCNTL_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_FCNTL_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_FCNTL_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CREAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCNTL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NONBLOCKING])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OPENAT])
+    dnl Support Microsoft deprecated alias function names by default.
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CREAT], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_OPEN], [1])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_FCNTL_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_FCNTL_H_DEFAULTS],
 [
-  GNULIB_FCNTL=0;        AC_SUBST([GNULIB_FCNTL])
-  GNULIB_NONBLOCKING=0;  AC_SUBST([GNULIB_NONBLOCKING])
-  GNULIB_OPEN=0;         AC_SUBST([GNULIB_OPEN])
-  GNULIB_OPENAT=0;       AC_SUBST([GNULIB_OPENAT])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_FCNTL=1;          AC_SUBST([HAVE_FCNTL])
   HAVE_OPENAT=1;         AC_SUBST([HAVE_OPENAT])
+  REPLACE_CREAT=0;       AC_SUBST([REPLACE_CREAT])
   REPLACE_FCNTL=0;       AC_SUBST([REPLACE_FCNTL])
   REPLACE_OPEN=0;        AC_SUBST([REPLACE_OPEN])
   REPLACE_OPENAT=0;      AC_SUBST([REPLACE_OPENAT])
index 685a1bb..e41ed63 100644 (file)
@@ -1,5 +1,5 @@
-# fdopen.m4 serial 3
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# fdopen.m4 serial 5
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,10 +8,13 @@ AC_DEFUN([gl_FUNC_FDOPEN],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_REQUIRE([gl_MSVC_INVAL])
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-    REPLACE_FDOPEN=1
-  else
+  m4_ifdef([gl_MSVC_INVAL], [
+    AC_REQUIRE([gl_MSVC_INVAL])
+    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+      REPLACE_FDOPEN=1
+    fi
+  ])
+  if test $REPLACE_FDOPEN = 0; then
     dnl Test whether fdopen() sets errno when it fails due to a bad fd argument.
     AC_CACHE_CHECK([whether fdopen sets errno], [gl_cv_func_fdopen_works],
       [
@@ -19,6 +22,7 @@ AC_DEFUN([gl_FUNC_FDOPEN],
           [AC_LANG_SOURCE([[
 #include <stdio.h>
 #include <errno.h>
+]GL_MDA_DEFINES[
 int
 main (void)
 {
diff --git a/m4/fdopendir.m4 b/m4/fdopendir.m4
new file mode 100644 (file)
index 0000000..d428380
--- /dev/null
@@ -0,0 +1,67 @@
+# serial 14
+# See if we need to provide fdopendir.
+
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Written by Eric Blake.
+
+AC_DEFUN([gl_FUNC_FDOPENDIR],
+[
+  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  dnl FreeBSD 7.3 has the function, but failed to declare it.
+  AC_CHECK_DECLS([fdopendir], [], [HAVE_DECL_FDOPENDIR=0], [[
+#include <dirent.h>
+    ]])
+  AC_CHECK_FUNCS_ONCE([fdopendir])
+  if test $ac_cv_func_fdopendir = no; then
+    HAVE_FDOPENDIR=0
+  else
+    AC_CACHE_CHECK([whether fdopendir works],
+      [gl_cv_func_fdopendir_works],
+      [AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM([[
+#include <dirent.h>
+#include <fcntl.h>
+#include <unistd.h>
+]GL_MDA_DEFINES[
+#if !HAVE_DECL_FDOPENDIR
+extern
+# ifdef __cplusplus
+"C"
+# endif
+DIR *fdopendir (int);
+#endif
+]],
+            [[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;
+            ]])],
+         [gl_cv_func_fdopendir_works=yes],
+         [gl_cv_func_fdopendir_works=no],
+         [case "$host_os" in
+                     # Guess yes on glibc systems.
+            *-gnu*)  gl_cv_func_fdopendir_works="guessing yes" ;;
+                     # Guess yes on musl systems.
+            *-musl*) gl_cv_func_fdopendir_works="guessing yes" ;;
+                     # If we don't know, obey --enable-cross-guesses.
+            *)       gl_cv_func_fdopendir_works="$gl_cross_guess_normal" ;;
+          esac
+         ])])
+    case "$gl_cv_func_fdopendir_works" in
+      *yes) ;;
+      *)
+        REPLACE_FDOPENDIR=1
+        ;;
+    esac
+  fi
+])
index 6bb6d5a..43266ef 100644 (file)
@@ -1,6 +1,6 @@
-# fflush.m4 serial 15
+# fflush.m4 serial 18
 
-# Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# Copyright (C) 2007-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -14,9 +14,10 @@ AC_DEFUN([gl_FUNC_FFLUSH],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   gl_FUNC_FFLUSH_STDIN
-  if test $gl_cv_func_fflush_stdin != yes; then
-    REPLACE_FFLUSH=1
-  fi
+  case "$gl_cv_func_fflush_stdin" in
+    *yes) ;;
+    *) REPLACE_FFLUSH=1 ;;
+  esac
 ])
 
 dnl Determine whether fflush works on input streams.
@@ -24,6 +25,7 @@ dnl Sets gl_cv_func_fflush_stdin.
 
 AC_DEFUN([gl_FUNC_FFLUSH_STDIN],
 [
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CHECK_HEADERS_ONCE([unistd.h])
   AC_CACHE_CHECK([whether fflush works on input streams],
     [gl_cv_func_fflush_stdin],
@@ -36,7 +38,8 @@ AC_DEFUN([gl_FUNC_FFLUSH_STDIN],
 #else /* on Windows with MSVC */
 # include <io.h>
 #endif
-       ]], [[FILE *f = fopen ("conftest.txt", "r");
+       ]GL_MDA_DEFINES],
+       [[FILE *f = fopen ("conftest.txt", "r");
          char buffer[10];
          int fd;
          int c;
@@ -44,41 +47,49 @@ AC_DEFUN([gl_FUNC_FFLUSH_STDIN],
            return 1;
          fd = fileno (f);
          if (fd < 0 || fread (buffer, 1, 5, f) != 5)
-           return 2;
+           { fclose (f); return 2; }
          /* For deterministic results, ensure f read a bigger buffer.  */
          if (lseek (fd, 0, SEEK_CUR) == 5)
-           return 3;
+           { fclose (f); return 3; }
          /* POSIX requires fflush-fseek to set file offset of fd.  This fails
             on BSD systems and on mingw.  */
          if (fflush (f) != 0 || fseek (f, 0, SEEK_CUR) != 0)
-           return 4;
+           { fclose (f); return 4; }
          if (lseek (fd, 0, SEEK_CUR) != 5)
-           return 5;
+           { fclose (f); return 5; }
          /* Verify behaviour of fflush after ungetc. See
-            <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
+            <https://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>  */
          /* Verify behaviour of fflush after a backup ungetc.  This fails on
             mingw.  */
          c = fgetc (f);
          ungetc (c, f);
          fflush (f);
          if (fgetc (f) != c)
-           return 6;
+           { fclose (f); return 6; }
          /* Verify behaviour of fflush after a non-backup ungetc.  This fails
             on glibc 2.8 and on BSD systems.  */
          c = fgetc (f);
          ungetc ('@', f);
          fflush (f);
          if (fgetc (f) != c)
-           return 7;
+           { fclose (f); return 7; }
+         fclose (f);
          return 0;
-       ]])], [gl_cv_func_fflush_stdin=yes], [gl_cv_func_fflush_stdin=no],
-     [gl_cv_func_fflush_stdin=cross])
+       ]])],
+       [gl_cv_func_fflush_stdin=yes],
+       [gl_cv_func_fflush_stdin=no],
+       [case "$host_os" in
+                  # Guess no on native Windows.
+          mingw*) gl_cv_func_fflush_stdin="guessing no" ;;
+          *)      gl_cv_func_fflush_stdin=cross ;;
+        esac
+       ])
      rm conftest.txt
     ])
-  case $gl_cv_func_fflush_stdin in
-    yes) gl_func_fflush_stdin=1 ;;
-    no)  gl_func_fflush_stdin=0 ;;
-    *)   gl_func_fflush_stdin='(-1)' ;;
+  case "$gl_cv_func_fflush_stdin" in
+    *yes) gl_func_fflush_stdin=1 ;;
+    *no)  gl_func_fflush_stdin=0 ;;
+    *)    gl_func_fflush_stdin='(-1)' ;;
   esac
   AC_DEFINE_UNQUOTED([FUNC_FFLUSH_STDIN], [$gl_func_fflush_stdin],
     [Define to 1 if fflush is known to work on stdin as per POSIX.1-2008,
index b794880..e6eac12 100644 (file)
@@ -1,5 +1,5 @@
 # filenamecat.m4 serial 11
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
similarity index 51%
rename from m4/closeout.m4
rename to m4/findprog-in.m4
index 6f4dd43..3ee6579 100644 (file)
@@ -1,12 +1,11 @@
-# closeout.m4 serial 6
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2016 Free Software Foundation,
-dnl Inc.
+# findprog-in.m4 serial 1
+dnl Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl Prerequisites of lib/closeout.c.
-AC_DEFUN([gl_CLOSEOUT],
+AC_DEFUN([gl_FINDPROG_IN],
 [
-  :
+  dnl Prerequisites of lib/findprog-in.c.
+  AC_REQUIRE([gl_FUNC_EACCESS])
 ])
similarity index 52%
rename from m4/closein.m4
rename to m4/findprog.m4
index 57456da..e41afff 100644 (file)
@@ -1,11 +1,11 @@
-# closein.m4 serial 2
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# findprog.m4 serial 3
+dnl Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl Prerequisites of lib/closein.c.
-AC_DEFUN([gl_CLOSEIN],
+AC_DEFUN([gl_FINDPROG],
 [
-  :
+  dnl Prerequisites of lib/findprog.c.
+  AC_REQUIRE([gl_FUNC_EACCESS])
 ])
index 155ae9b..49b1c75 100644 (file)
@@ -1,7 +1,7 @@
-# serial 4
+# serial 5
 # Check for flexible array member support.
 
-# Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -17,12 +17,15 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
           [[#include <stdlib.h>
             #include <stdio.h>
             #include <stddef.h>
-            struct s { int n; double d[]; };]],
+            struct m { struct m *next, **list; char name[]; };
+            struct s { struct s *p; struct m *m; int n; double d[]; };]],
           [[int m = getchar ();
             size_t nbytes = offsetof (struct s, d) + m * sizeof (double);
             nbytes += sizeof (struct s) - 1;
             nbytes -= nbytes % sizeof (struct s);
             struct s *p = malloc (nbytes);
+            p->p = p;
+            p->m = NULL;
             p->d[0] = 0.0;
             return p->d != (double *) NULL;]])],
        [ac_cv_c_flexmember=yes],
@@ -31,12 +34,10 @@ AC_DEFUN([AC_C_FLEXIBLE_ARRAY_MEMBER],
     AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [],
       [Define to nothing if C supports flexible array members, and to
        1 if it does not.  That way, with a declaration like 'struct s
-       { int n; double d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
+       { int n; short d@<:@FLEXIBLE_ARRAY_MEMBER@:>@; };', the struct hack
        can be used with pre-C99 compilers.
-       When computing the size of such an object, don't use 'sizeof (struct s)'
-       as it overestimates the size.  Use 'offsetof (struct s, d)' instead.
-       Don't use 'offsetof (struct s, d@<:@0@:>@)', as this doesn't work with
-       MSVC and with C++ compilers.])
+       Use 'FLEXSIZEOF (struct s, d, N * sizeof (short))' to calculate
+       the size in bytes of such a struct containing an N-element array.])
   else
     AC_DEFINE([FLEXIBLE_ARRAY_MEMBER], [1])
   fi
index e2887eb..ba38a28 100644 (file)
@@ -1,5 +1,5 @@
-# float_h.m4 serial 9
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# float_h.m4 serial 12
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -14,7 +14,7 @@ AC_DEFUN([gl_FLOAT_H],
     aix* | beos* | openbsd* | mirbsd* | irix*)
       FLOAT_H=float.h
       ;;
-    freebsd*)
+    freebsd* | dragonfly*)
       case "$host_cpu" in
 changequote(,)dnl
         i[34567]86 )
@@ -24,10 +24,14 @@ changequote([,])dnl
         x86_64 )
           # On x86_64 systems, the C compiler may still be generating
           # 32-bit code.
-          AC_EGREP_CPP([yes],
-            [#if defined __LP64__ || defined __x86_64__ || defined __amd64__
-             yes
-             #endif],
+          AC_COMPILE_IFELSE(
+            [AC_LANG_SOURCE(
+               [[#if defined __LP64__ || defined __x86_64__ || defined __amd64__
+                  int ok;
+                 #else
+                  error fail
+                 #endif
+               ]])],
             [],
             [FLOAT_H=float.h])
           ;;
@@ -42,7 +46,7 @@ changequote([,])dnl
       ;;
   esac
   case "$host_os" in
-    aix* | freebsd* | linux*)
+    aix* | freebsd* | dragonfly* | linux*)
       if test -n "$FLOAT_H"; then
         REPLACE_FLOAT_LDBL=1
       fi
@@ -69,14 +73,20 @@ int main ()
         [gl_cv_func_itold_works=no],
         [case "$host" in
            sparc*-*-linux*)
-             AC_EGREP_CPP([yes],
-               [#if defined __LP64__ || defined __arch64__
-                yes
-                #endif],
+             AC_COMPILE_IFELSE(
+               [AC_LANG_SOURCE(
+                 [[#if defined __LP64__ || defined __arch64__
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
                [gl_cv_func_itold_works="guessing no"],
                [gl_cv_func_itold_works="guessing yes"])
              ;;
-           *) gl_cv_func_itold_works="guessing yes" ;;
+                   # Guess yes on native Windows.
+           mingw*) gl_cv_func_itold_works="guessing yes" ;;
+           *)      gl_cv_func_itold_works="guessing yes" ;;
          esac
         ])
     ])
index 0183076..4ed7dce 100644 (file)
@@ -1,5 +1,5 @@
-# fopen.m4 serial 9
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# fopen.m4 serial 12
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -27,7 +27,11 @@ AC_DEFUN([gl_FUNC_FOPEN],
 #include <stdio.h>
 int main ()
 {
-  return fopen ("conftest.sl/", "w") != NULL;
+  FILE *fp = fopen ("conftest.sl/", "w");
+  int result = (fp != NULL);
+  if (fp != NULL)
+    fclose (fp);
+  return result;
 }]])],
             [gl_cv_func_fopen_slash=yes],
             [gl_cv_func_fopen_slash=no],
@@ -54,5 +58,91 @@ changequote([,])dnl
   esac
 ])
 
+AC_DEFUN([gl_FUNC_FOPEN_GNU],
+[
+  AC_REQUIRE([gl_FUNC_FOPEN])
+  AC_CACHE_CHECK([whether fopen supports the mode character 'x'],
+    [gl_cv_func_fopen_mode_x],
+    [rm -f conftest.x
+     AC_RUN_IFELSE(
+       [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <errno.h>
+int main ()
+{
+  FILE *fp;
+  fp = fopen ("conftest.x", "w");
+  fclose (fp);
+  fp = fopen ("conftest.x", "wx");
+  if (fp != NULL)
+    /* 'x' ignored */
+    return 1;
+  else if (errno == EEXIST)
+    return 0;
+  else
+    /* 'x' rejected */
+    return 2;
+}]])],
+       [gl_cv_func_fopen_mode_x=yes],
+       [gl_cv_func_fopen_mode_x=no],
+       [case "$host_os" in
+          # Guess yes on glibc and musl systems.
+          linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*)
+            gl_cv_func_fopen_mode_x="guessing yes" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *)
+            gl_cv_func_fopen_mode_x="$gl_cross_guess_normal" ;;
+        esac
+       ])
+     rm -f conftest.x
+    ])
+  AC_CACHE_CHECK([whether fopen supports the mode character 'e'],
+    [gl_cv_func_fopen_mode_e],
+    [echo foo > conftest.x
+     AC_RUN_IFELSE(
+       [AC_LANG_SOURCE([[
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+]GL_MDA_DEFINES[
+int main ()
+{
+  FILE *fp = fopen ("conftest.x", "re");
+  if (fp != NULL)
+    {
+      if (fcntl (fileno (fp), F_GETFD) & FD_CLOEXEC)
+        return 0;
+      else
+        /* 'e' ignored */
+        return 1;
+    }
+  else
+    /* 'e' rejected */
+    return 2;
+}]])],
+       [gl_cv_func_fopen_mode_e=yes],
+       [gl_cv_func_fopen_mode_e=no],
+       [case "$host_os" in
+          # Guess yes on glibc and musl systems.
+          linux*-gnu* | gnu* | kfreebsd*-gnu | *-musl*)
+            gl_cv_func_fopen_mode_e="guessing yes" ;;
+          # Guess no on native Windows.
+          mingw*)
+            gl_cv_func_fopen_mode_e="guessing no" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *)
+            gl_cv_func_fopen_mode_e="$gl_cross_guess_normal" ;;
+        esac
+       ])
+     rm -f conftest.x
+    ])
+  case "$gl_cv_func_fopen_mode_x" in
+    *no) REPLACE_FOPEN=1 ;;
+  esac
+  case "$gl_cv_func_fopen_mode_e" in
+    *no) REPLACE_FOPEN=1 ;;
+  esac
+])
+
 # Prerequisites of lib/fopen.c.
 AC_DEFUN([gl_PREREQ_FOPEN], [:])
index f6776a8..131356a 100644 (file)
@@ -1,6 +1,6 @@
-# serial 22
+# serial 23
 
-# Copyright (C) 2000-2001, 2004-2016 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2004-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -25,7 +25,7 @@ AC_DEFUN([gl_FUNC_FPENDING],
   AC_CACHE_CHECK([for __fpending], [gl_cv_func___fpending],
     [
       AC_LINK_IFELSE(
-        [AC_LANG_PROGRAM([$fp_headers],
+        [AC_LANG_PROGRAM([[$fp_headers]],
            [[return ! __fpending (stdin);]])],
         [gl_cv_func___fpending=yes],
         [gl_cv_func___fpending=no])
index e11ac9f..3f16957 100644 (file)
@@ -1,5 +1,5 @@
 # fpieee.m4 serial 2  -*- coding: utf-8 -*-
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -33,7 +33,7 @@ AC_DEFUN([gl_FP_IEEE],
     alpha*)
       # On Alpha systems, a compiler option provides the behaviour.
       # See the ieee(3) manual page, also available at
-      # <http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/0600____.HTM>
+      # <https://backdrift.org/man/tru64/man3/ieee.3.html>
       if test -n "$GCC"; then
         # GCC has the option -mieee.
         # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
index 0dd19f3..275c9d0 100644 (file)
@@ -1,5 +1,5 @@
-# fpurge.m4 serial 7
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# fpurge.m4 serial 12
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,35 +7,63 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_FPURGE],
 [
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CHECK_HEADERS_ONCE([stdio_ext.h])
   AC_CHECK_FUNCS_ONCE([fpurge])
   AC_CHECK_FUNCS_ONCE([__fpurge])
   AC_CHECK_DECLS([fpurge], , , [[#include <stdio.h>]])
   if test "x$ac_cv_func_fpurge" = xyes; then
     HAVE_FPURGE=1
-    # Detect BSD bug.  Only cygwin 1.7 is known to be immune.
+    # Detect BSD bug.  Only cygwin 1.7 and musl are known to be immune.
     AC_CACHE_CHECK([whether fpurge works], [gl_cv_func_fpurge_works],
-      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
-]], [FILE *f = fopen ("conftest.txt", "w+");
-        if (!f) return 1;
-        if (fputc ('a', f) != 'a') return 2;
-        rewind (f);
-        if (fgetc (f) != 'a') return 3;
-        if (fgetc (f) != EOF) return 4;
-        if (fpurge (f) != 0) return 5;
-        if (putc ('b', f) != 'b') return 6;
-        if (fclose (f) != 0) return 7;
-        if ((f = fopen ("conftest.txt", "r")) == NULL) return 8;
-        if (fgetc (f) != 'a') return 9;
-        if (fgetc (f) != 'b') return 10;
-        if (fgetc (f) != EOF) return 11;
-        if (fclose (f) != 0) return 12;
-        if (remove ("conftest.txt") != 0) return 13;
-        return 0;])],
-      [gl_cv_func_fpurge_works=yes], [gl_cv_func_fpurge_works=no],
-      [gl_cv_func_fpurge_works='guessing no'])])
-    if test "x$gl_cv_func_fpurge_works" != xyes; then
-      REPLACE_FPURGE=1
-    fi
+      [AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#include <stdio.h>
+]],
+            [[FILE *f = fopen ("conftest.txt", "w+");
+              if (!f)
+                return 1;
+              if (fputc ('a', f) != 'a')
+                { fclose (f); return 2; }
+              rewind (f);
+              if (fgetc (f) != 'a')
+                { fclose (f); return 3; }
+              if (fgetc (f) != EOF)
+                { fclose (f); return 4; }
+              if (fpurge (f) != 0)
+                { fclose (f); return 5; }
+              if (putc ('b', f) != 'b')
+                { fclose (f); return 6; }
+              if (fclose (f) != 0)
+                return 7;
+              if ((f = fopen ("conftest.txt", "r")) == NULL)
+                return 8;
+              if (fgetc (f) != 'a')
+                { fclose (f); return 9; }
+              if (fgetc (f) != 'b')
+                { fclose (f); return 10; }
+              if (fgetc (f) != EOF)
+                { fclose (f); return 11; }
+              if (fclose (f) != 0)
+                return 12;
+              if (remove ("conftest.txt") != 0)
+                return 13;
+              return 0;
+            ]])],
+         [gl_cv_func_fpurge_works=yes],
+         [gl_cv_func_fpurge_works=no],
+         [case "$host_os" in
+                     # Guess yes on musl systems.
+            *-musl*) gl_cv_func_fpurge_works="guessing yes" ;;
+                     # Otherwise obey --enable-cross-guesses.
+            *)       gl_cv_func_fpurge_works="$gl_cross_guess_normal" ;;
+          esac
+         ])
+      ])
+    case "$gl_cv_func_fpurge_works" in
+      *yes) ;;
+      *) REPLACE_FPURGE=1 ;;
+    esac
   else
     HAVE_FPURGE=0
   fi
index 1f2288d..9beb03d 100644 (file)
@@ -1,5 +1,5 @@
 # freadahead.m4 serial 1
-dnl Copyright (C) 2012-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 52495b7..6cc660f 100644 (file)
@@ -1,10 +1,11 @@
-# freading.m4 serial 1
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# freading.m4 serial 2
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_FREADING],
 [
+  AC_CHECK_HEADERS_ONCE([stdio_ext.h])
   AC_CHECK_FUNCS_ONCE([__freading])
 ])
diff --git a/m4/free.m4 b/m4/free.m4
new file mode 100644 (file)
index 0000000..a7923b9
--- /dev/null
@@ -0,0 +1,52 @@
+# free.m4 serial 6
+# Copyright (C) 2003-2005, 2009-2021 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Written by Paul Eggert and Bruno Haible.
+
+AC_DEFUN([gl_FUNC_FREE],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+
+  dnl In the next release of POSIX, free must preserve errno.
+  dnl https://www.austingroupbugs.net/view.php?id=385
+  dnl https://sourceware.org/bugzilla/show_bug.cgi?id=17924
+  dnl So far, we know of three platforms that do this:
+  dnl * glibc >= 2.33, thanks to the fix for this bug:
+  dnl   <https://sourceware.org/bugzilla/show_bug.cgi?id=17924>
+  dnl * OpenBSD >= 4.5, thanks to this commit:
+  dnl   <https://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/malloc.c.diff?r1=1.100&r2=1.101&f=h>
+  dnl * Solaris, because its malloc() implementation is based on brk(),
+  dnl   not mmap(); hence its free() implementation makes no system calls.
+  dnl For other platforms, you can only be sure if they state it in their
+  dnl documentation, or by code inspection of the free() implementation in libc.
+  AC_CACHE_CHECK([whether free is known to preserve errno],
+    [gl_cv_func_free_preserves_errno],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stdlib.h>
+          ]],
+          [[#if 2 < __GLIBC__ + (33 <= __GLIBC_MINOR__)
+            #elif defined __OpenBSD__
+            #elif defined __sun
+            #else
+              #error "'free' is not known to preserve errno"
+            #endif
+          ]])],
+       [gl_cv_func_free_preserves_errno=yes],
+       [gl_cv_func_free_preserves_errno=no])
+    ])
+
+  case $gl_cv_func_free_preserves_errno in
+   *yes)
+    AC_DEFINE([HAVE_FREE_POSIX], [1],
+      [Define if the 'free' function is guaranteed to preserve errno.])
+    ;;
+   *) REPLACE_FREE=1 ;;
+  esac
+])
+
+# Prerequisites of lib/free.c.
+AC_DEFUN([gl_PREREQ_FREE], [:])
diff --git a/m4/freopen.m4 b/m4/freopen.m4
new file mode 100644 (file)
index 0000000..d5a3512
--- /dev/null
@@ -0,0 +1,40 @@
+# freopen.m4 serial 7
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FREOPEN],
+[
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw* | pw* | os2*)
+      REPLACE_FREOPEN=1
+      ;;
+    *)
+      AC_CACHE_CHECK([whether freopen works on closed fds],
+        [gl_cv_func_freopen_works_on_closed],
+        [AC_RUN_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <stdio.h>
+                #include <unistd.h>
+              ]GL_MDA_DEFINES],
+              [[close (0);
+                return !(freopen ("/dev/null", "r", stdin)
+                         && getchar () == EOF
+                         && !ferror (stdin) && feof (stdin));]])],
+           [gl_cv_func_freopen_works_on_closed=yes],
+           [gl_cv_func_freopen_works_on_closed=no],
+           [case $host_os in
+              *gnu*) gl_cv_func_freopen_works_on_closed="guessing no" ;;
+              *)     gl_cv_func_freopen_works_on_closed="guessing yes";;
+            esac])])
+      case $gl_cv_func_freopen_works_on_closed in
+        *no) REPLACE_FREOPEN=1;;
+      esac
+  esac
+])
+
+# Prerequisites of lib/freopen.c.
+AC_DEFUN([gl_PREREQ_FREOPEN], [:])
index 23f5821..04248b0 100644 (file)
@@ -1,5 +1,5 @@
-# frexp.m4 serial 15
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# frexp.m4 serial 16
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -164,8 +164,17 @@ int main()
         [gl_cv_func_frexp_works=yes],
         [gl_cv_func_frexp_works=no],
         [case "$host_os" in
-           netbsd* | irix* | mingw*) gl_cv_func_frexp_works="guessing no";;
-           *)                        gl_cv_func_frexp_works="guessing yes";;
+           netbsd* | irix*) gl_cv_func_frexp_works="guessing no" ;;
+           mingw*) # Guess yes with MSVC, no with mingw.
+             AC_EGREP_CPP([Good], [
+#ifdef _MSC_VER
+ Good
+#endif
+               ],
+               [gl_cv_func_frexp_works="guessing yes"],
+               [gl_cv_func_frexp_works="guessing no"])
+             ;;
+           *) gl_cv_func_frexp_works="guessing yes" ;;
          esac
         ])
     ])
index 0bc6afe..32f1eac 100644 (file)
@@ -1,5 +1,5 @@
-# frexpl.m4 serial 20
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# frexpl.m4 serial 22
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -131,7 +131,7 @@ AC_DEFUN([gl_FUNC_FREXPL_WORKS],
 # undef LDBL_MIN_EXP
 # define LDBL_MIN_EXP    (-16381)
 #endif
-#if defined __i386__ && defined __FreeBSD__
+#if defined __i386__ && (defined __FreeBSD__ || defined __DragonFly__)
 # undef LDBL_MIN_EXP
 # define LDBL_MIN_EXP    (-16381)
 #endif
@@ -150,6 +150,7 @@ extern
 "C"
 #endif
 long double frexpl (long double, int *);
+long double zero = 0.0L;
 int main()
 {
   int result = 0;
@@ -207,7 +208,8 @@ int main()
       }
   }
   /* Test on infinite numbers.  */
-  x = 1.0L / 0.0L;
+  /* The Microsoft MSVC 14 compiler chokes on the expression 1.0 / 0.0.  */
+  x = 1.0L / zero;
   {
     int exp;
     long double y = frexpl (x, &exp);
index 5ec8d00..2e90afc 100644 (file)
@@ -1,5 +1,5 @@
 # fseek.m4 serial 4
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 6c7f551..531e442 100644 (file)
@@ -1,5 +1,5 @@
-# fseeko.m4 serial 17
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# fseeko.m4 serial 20
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_FSEEKO],
   AC_CACHE_CHECK([for fseeko], [gl_cv_func_fseeko],
     [
       AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
-]], [fseeko (stdin, 0, 0);])],
+]], [[fseeko (stdin, 0, 0);]])],
         [gl_cv_func_fseeko=yes], [gl_cv_func_fseeko=no])
     ])
 
@@ -37,9 +37,10 @@ AC_DEFUN([gl_FUNC_FSEEKO],
     fi
     m4_ifdef([gl_FUNC_FFLUSH_STDIN], [
       gl_FUNC_FFLUSH_STDIN
-      if test $gl_cv_func_fflush_stdin != yes; then
-        REPLACE_FSEEKO=1
-      fi
+      case "$gl_cv_func_fflush_stdin" in
+        *yes) ;;
+        *) REPLACE_FSEEKO=1 ;;
+      esac
     ])
   fi
 ])
@@ -67,7 +68,10 @@ AC_DEFUN([gl_STDIN_LARGE_OFFSET],
 # Prerequisites of lib/fseeko.c.
 AC_DEFUN([gl_PREREQ_FSEEKO],
 [
-  dnl Native Windows has the function _fseeki64. mingw hides it, but mingw64
-  dnl makes it usable again.
+  dnl Native Windows has the function _fseeki64. mingw hides it in some
+  dnl circumstances, but mingw64 makes it usable again.
   AC_CHECK_FUNCS([_fseeki64])
+  if test $ac_cv_func__fseeki64 = yes; then
+    AC_CHECK_DECLS([_fseeki64])
+  fi
 ])
index 29f9b81..cdaca80 100644 (file)
@@ -1,22 +1,22 @@
-# fstat.m4 serial 4
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# fstat.m4 serial 8
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_FSTAT],
 [
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
 
-  AC_REQUIRE([gl_MSVC_INVAL])
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-    REPLACE_FSTAT=1
-  fi
-
-  AC_REQUIRE([gl_HEADER_SYS_STAT_H])
-  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
-    REPLACE_FSTAT=1
-  fi
+  case "$host_os" in
+    mingw* | solaris*)
+      dnl On MinGW, the original stat() returns st_atime, st_mtime,
+      dnl st_ctime values that are affected by the time zone.
+      dnl Solaris stat can return a negative tv_nsec.
+      REPLACE_FSTAT=1
+      ;;
+  esac
 
   dnl Replace fstat() for supporting the gnulib-defined open() on directories.
   m4_ifdef([gl_FUNC_FCHDIR], [
@@ -32,5 +32,9 @@ AC_DEFUN([gl_FUNC_FSTAT],
   ])
 ])
 
-# Prerequisites of lib/fstat.c.
-AC_DEFUN([gl_PREREQ_FSTAT], [:])
+# Prerequisites of lib/fstat.c and lib/stat-w32.c.
+AC_DEFUN([gl_PREREQ_FSTAT], [
+  AC_REQUIRE([gl_SYS_STAT_H])
+  AC_REQUIRE([gl_PREREQ_STAT_W32])
+  :
+])
diff --git a/m4/fstatat.m4 b/m4/fstatat.m4
new file mode 100644 (file)
index 0000000..d730e46
--- /dev/null
@@ -0,0 +1,65 @@
+# fstatat.m4 serial 4
+dnl Copyright (C) 2004-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Written by Jim Meyering.
+
+# If we have the fstatat function, and it has the bug (in AIX 7.1)
+# that it does not fill in st_size correctly, use the replacement function.
+AC_DEFUN([gl_FUNC_FSTATAT],
+[
+  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CHECK_FUNCS_ONCE([fstatat])
+
+  if test $ac_cv_func_fstatat = no; then
+    HAVE_FSTATAT=0
+  else
+    dnl Test for an AIX 7.1 bug; see
+    dnl <https://lists.gnu.org/r/bug-tar/2011-09/msg00015.html>.
+    AC_CACHE_CHECK([whether fstatat (..., 0) works],
+      [gl_cv_func_fstatat_zero_flag],
+      [AC_RUN_IFELSE(
+         [AC_LANG_SOURCE(
+            [[
+              #include <fcntl.h>
+              #include <sys/stat.h>
+              int
+              main (void)
+              {
+                struct stat a;
+                return fstatat (AT_FDCWD, ".", &a, 0) != 0;
+              }
+            ]])],
+         [gl_cv_func_fstatat_zero_flag=yes],
+         [gl_cv_func_fstatat_zero_flag=no],
+         [case "$host_os" in
+            aix*) gl_cv_func_fstatat_zero_flag="guessing no";;
+            *)    gl_cv_func_fstatat_zero_flag="guessing yes";;
+          esac
+         ])
+      ])
+
+    case $gl_cv_func_fstatat_zero_flag+$gl_cv_func_lstat_dereferences_slashed_symlink in
+    *yes+*yes) ;;
+    *) REPLACE_FSTATAT=1 ;;
+    esac
+
+    case $host_os in
+      solaris*)
+        REPLACE_FSTATAT=1 ;;
+    esac
+
+    case $REPLACE_FSTATAT,$gl_cv_func_fstatat_zero_flag in
+      1,*yes)
+         AC_DEFINE([HAVE_WORKING_FSTATAT_ZERO_FLAG], [1],
+           [Define to 1 if fstatat (..., 0) works.
+            For example, it does not work in AIX 7.1.])
+         ;;
+    esac
+  fi
+])
index 6701f0a..f9cc619 100644 (file)
@@ -1,5 +1,5 @@
 # ftell.m4 serial 3
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 3f4808b..65bec39 100644 (file)
@@ -1,5 +1,5 @@
-# ftello.m4 serial 11
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# ftello.m4 serial 14
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -53,6 +53,8 @@ changequote(,)dnl
           case "$host_os" in
                       # Guess no on Solaris.
             solaris*) gl_cv_func_ftello_works="guessing no" ;;
+                      # Guess yes on native Windows.
+            mingw*)   gl_cv_func_ftello_works="guessing yes" ;;
                       # Guess yes otherwise.
             *)        gl_cv_func_ftello_works="guessing yes" ;;
           esac
@@ -73,7 +75,7 @@ main (void)
   if (fp == NULL)
     return 70;
   if (fwrite ("foogarsh", 1, 8, fp) < 8)
-    return 71;
+    { fclose (fp); return 71; }
   if (fclose (fp))
     return 72;
 
@@ -84,19 +86,19 @@ main (void)
   if (fp == NULL)
     return 73;
   if (fseek (fp, -1, SEEK_END))
-    return 74;
+    { fclose (fp); return 74; }
   if (!(getc (fp) == 'h'))
-    return 1;
+    { fclose (fp); return 1; }
   if (!(getc (fp) == EOF))
-    return 2;
+    { fclose (fp); return 2; }
   if (!(ftell (fp) == 8))
-    return 3;
+    { fclose (fp); return 3; }
   if (!(ftell (fp) == 8))
-    return 4;
+    { fclose (fp); return 4; }
   if (!(putc ('!', fp) == '!'))
-    return 5;
+    { fclose (fp); return 5; }
   if (!(ftell (fp) == 9))
-    return 6;
+    { fclose (fp); return 6; }
   if (!(fclose (fp) == 0))
     return 7;
   fp = fopen (TESTFILE, "r");
@@ -105,9 +107,9 @@ main (void)
   {
     char buf[10];
     if (!(fread (buf, 1, 10, fp) == 9))
-      return 10;
+      { fclose (fp); return 10; }
     if (!(memcmp (buf, "foogarsh!", 9) == 0))
-      return 11;
+      { fclose (fp); return 11; }
   }
   if (!(fclose (fp) == 0))
     return 12;
@@ -128,6 +130,15 @@ main (void)
           ;;
       esac
     fi
+    if test $REPLACE_FTELLO = 0; then
+      dnl Detect bug on macOS >= 10.15.
+      gl_FUNC_UNGETC_WORKS
+      if test $gl_ftello_broken_after_ungetc = yes; then
+        REPLACE_FTELLO=1
+        AC_DEFINE([FTELLO_BROKEN_AFTER_UNGETC], [1],
+          [Define to 1 if the system's ftello function has the macOS bug.])
+      fi
+    fi
   fi
 ])
 
diff --git a/m4/ftruncate.m4 b/m4/ftruncate.m4
new file mode 100644 (file)
index 0000000..4a3eca6
--- /dev/null
@@ -0,0 +1,40 @@
+# serial 21
+
+# See if we need to emulate a missing ftruncate function using _chsize.
+
+# Copyright (C) 2000-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_FTRUNCATE],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([ftruncate])
+  if test $ac_cv_func_ftruncate = yes; then
+    m4_ifdef([gl_LARGEFILE], [
+      AC_REQUIRE([AC_CANONICAL_HOST])
+      case "$host_os" in
+        mingw*)
+          dnl Native Windows, and Large File Support is requested.
+          dnl The MSVCRT _chsize() function only accepts a 32-bit file size,
+          dnl and the mingw64 ftruncate64() function is unreliable (it may
+          dnl delete the file, see
+          dnl <https://web.archive.org/web/20160425005423/http://mingw-w64.sourcearchive.com/documentation/2.0-1/ftruncate64_8c_source.html>).
+          dnl Use gnulib's ftruncate() implementation instead.
+          REPLACE_FTRUNCATE=1
+          ;;
+      esac
+    ], [
+      :
+    ])
+  else
+    HAVE_FTRUNCATE=0
+  fi
+])
+
+# Prerequisites of lib/ftruncate.c.
+AC_DEFUN([gl_PREREQ_FTRUNCATE],
+[
+  AC_CHECK_FUNCS([_chsize])
+])
diff --git a/m4/getcwd-abort-bug.m4 b/m4/getcwd-abort-bug.m4
new file mode 100644 (file)
index 0000000..bd32de1
--- /dev/null
@@ -0,0 +1,158 @@
+# serial 16
+# Determine whether getcwd aborts when the length of the working directory
+# name is unusually large.  Any length between 4k and 16k trigger the bug
+# when using glibc-2.4.90-9 or older.
+
+# Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# From Jim Meyering
+
+# gl_FUNC_GETCWD_ABORT_BUG([ACTION-IF-BUGGY[, ACTION-IF-WORKS]])
+AC_DEFUN([gl_FUNC_GETCWD_ABORT_BUG],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CHECK_DECLS_ONCE([getcwd])
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ])
+
+  gl_CHECK_FUNC_GETPAGESIZE
+  if test $gl_cv_func_getpagesize = yes; then
+    AC_DEFINE_UNQUOTED([HAVE_GETPAGESIZE], [1],
+      [Define to 1 if the system has the 'getpagesize' function.])
+  fi
+
+  AC_CACHE_CHECK([whether getcwd succeeds when 4k < cwd_length < 16k],
+    [gl_cv_func_getcwd_succeeds_beyond_4k],
+    [# Remove any remnants of a previous test.
+     rm -rf confdir-14B---
+     # Arrange for deletion of the temporary directory this test creates.
+     ac_clean_files="$ac_clean_files confdir-14B---"
+     dnl Please keep this in sync with tests/test-getcwd.c.
+     AC_RUN_IFELSE(
+       [AC_LANG_SOURCE(
+          [[
+#include <errno.h>
+#include <stdlib.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else /* on Windows with MSVC */
+# include <direct.h>
+#endif
+#include <string.h>
+#include <sys/stat.h>
+
+]gl_PATHMAX_SNIPPET[
+]GL_MDA_DEFINES[
+
+#ifndef S_IRWXU
+# define S_IRWXU 0700
+#endif
+
+/* FIXME: skip the run-test altogether on systems without getpagesize.  */
+#if ! HAVE_GETPAGESIZE
+# define getpagesize() 0
+#endif
+
+/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
+   the 16kB pagesize on ia64 linux.  Those conditions make the code below
+   trigger a bug in glibc's getcwd implementation before 2.4.90-10.  */
+#define TARGET_LEN (5 * 1024)
+
+int
+main ()
+{
+  char *cwd;
+  size_t initial_cwd_len;
+  int fail = 0;
+
+  /* The bug is triggered when PATH_MAX < getpagesize (), so skip
+     this relatively expensive and invasive test if that's not true.  */
+#ifdef PATH_MAX
+  int bug_possible = PATH_MAX < getpagesize ();
+#else
+  int bug_possible = 0;
+#endif
+  if (! bug_possible)
+    return 0;
+
+  cwd = getcwd (NULL, 0);
+  if (cwd == NULL)
+    return 2;
+
+  initial_cwd_len = strlen (cwd);
+  free (cwd);
+
+  if (1)
+    {
+      static char const dir_name[] = "confdir-14B---";
+      size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
+                              / sizeof dir_name);
+      size_t d;
+      for (d = 0; d < desired_depth; d++)
+        {
+          if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
+            {
+              if (! (errno == ERANGE || errno == ENAMETOOLONG
+                     || errno == ENOENT))
+                fail = 3; /* Unable to construct deep hierarchy.  */
+              break;
+            }
+        }
+
+      /* If libc has the bug in question, this invocation of getcwd
+         results in a failed assertion.  */
+      cwd = getcwd (NULL, 0);
+      if (cwd == NULL)
+        fail = 4; /* getcwd didn't assert, but it failed for a long name
+                     where the answer could have been learned.  */
+      free (cwd);
+
+      /* Call rmdir first, in case the above chdir failed.  */
+      rmdir (dir_name);
+      while (0 < d--)
+        {
+          if (chdir ("..") < 0)
+            {
+              fail = 5;
+              break;
+            }
+          rmdir (dir_name);
+        }
+    }
+
+  return fail;
+}
+          ]])],
+       [gl_cv_func_getcwd_succeeds_beyond_4k=yes],
+       [dnl An abort will provoke an exit code of something like 134 (128 + 6).
+        dnl An exit code of 4 can also occur (for example in
+        dnl musl libc 1.2.2/powerpc64le, NetBSD 9.0, OpenBSD 6.7:
+        dnl getcwd (NULL, 0) fails rather than returning a string longer than
+        dnl PATH_MAX.  This may be POSIX compliant (in some interpretations of
+        dnl POSIX).  But gnulib's getcwd module wants to provide a non-NULL
+        dnl value in this case.
+        ret=$?
+        if test $ret -ge 128 || test $ret = 4; then
+          gl_cv_func_getcwd_succeeds_beyond_4k=no
+        else
+          gl_cv_func_getcwd_succeeds_beyond_4k=yes
+        fi
+       ],
+       [case "$host_os" in
+             # Guess no otherwise, even on glibc systems and musl systems.
+          *) gl_cv_func_getcwd_succeeds_beyond_4k="guessing no"
+        esac
+       ])
+    ])
+  case "$gl_cv_func_getcwd_succeeds_beyond_4k" in
+    *no)
+      $1
+      ;;
+    *)
+      $2
+      ;;
+  esac
+])
diff --git a/m4/getcwd-path-max.m4 b/m4/getcwd-path-max.m4
new file mode 100644 (file)
index 0000000..4238ae7
--- /dev/null
@@ -0,0 +1,236 @@
+# serial 25
+# Check for several getcwd bugs with long file names.
+# If so, arrange to compile the wrapper function.
+
+# This is necessary for at least GNU libc on linux-2.4.19 and 2.4.20.
+# I've heard that this is due to a Linux kernel bug, and that it has
+# been fixed between 2.4.21-pre3 and 2.4.21-pre4.
+
+# Copyright (C) 2003-2007, 2009-2021 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# From Jim Meyering
+
+AC_DEFUN([gl_FUNC_GETCWD_PATH_MAX],
+[
+  AC_CHECK_DECLS_ONCE([getcwd])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  AC_REQUIRE([gl_PATHMAX_SNIPPET_PREREQ])
+  AC_CACHE_CHECK([whether getcwd handles long file names properly],
+    [gl_cv_func_getcwd_path_max],
+    [# Arrange for deletion of the temporary directory this test creates.
+     ac_clean_files="$ac_clean_files confdir3"
+     dnl Please keep this in sync with tests/test-getcwd.c.
+     AC_RUN_IFELSE(
+       [AC_LANG_SOURCE(
+          [[
+#include <errno.h>
+#include <stdlib.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#else
+# include <direct.h>
+#endif
+#include <string.h>
+#include <limits.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <fcntl.h>
+
+]gl_PATHMAX_SNIPPET[
+
+#ifndef AT_FDCWD
+# define AT_FDCWD 0
+#endif
+#ifdef ENAMETOOLONG
+# define is_ENAMETOOLONG(x) ((x) == ENAMETOOLONG)
+#else
+# define is_ENAMETOOLONG(x) 0
+#endif
+
+/* Use the getcwd function, not any macro.  */
+#undef getcwd
+
+]GL_MDA_DEFINES[
+
+#ifndef S_IRWXU
+# define S_IRWXU 0700
+#endif
+
+/* The length of this name must be 8.  */
+#define DIR_NAME "confdir3"
+#define DIR_NAME_LEN 8
+#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
+
+/* The length of "../".  */
+#define DOTDOTSLASH_LEN 3
+
+/* Leftover bytes in the buffer, to work around library or OS bugs.  */
+#define BUF_SLOP 20
+
+int
+main ()
+{
+#ifndef PATH_MAX
+  /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
+     at least not on a local file system.  And if we were to start worrying
+     about remote file systems, we'd have to enable the wrapper function
+     all of the time, just to be safe.  That's not worth the cost.  */
+  exit (0);
+#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
+        - DIR_NAME_SIZE - BUF_SLOP) \
+       <= PATH_MAX)
+  /* FIXME: Assuming there's a system for which this is true,
+     this should be done in a compile test.  */
+  exit (0);
+#else
+  char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
+           + DIR_NAME_SIZE + BUF_SLOP];
+  char *cwd = getcwd (buf, PATH_MAX);
+  size_t initial_cwd_len;
+  size_t cwd_len;
+  int fail = 0;
+  size_t n_chdirs = 0;
+
+  if (cwd == NULL)
+    exit (10);
+
+  cwd_len = initial_cwd_len = strlen (cwd);
+
+  while (1)
+    {
+      size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
+      char *c = NULL;
+
+      cwd_len += DIR_NAME_SIZE;
+      /* If mkdir or chdir fails, it could be that this system cannot create
+         any file with an absolute name longer than PATH_MAX, such as cygwin.
+         If so, leave fail as 0, because the current working directory can't
+         be too long for getcwd if it can't even be created.  On Linux with
+         the 9p file system, mkdir fails with error EINVAL when cwd_len gets
+         too long; ignore this failure because the getcwd() system call
+         produces good results whereas the gnulib substitute calls getdents64
+         which fails with error EPROTO.
+         For other errors, be pessimistic and consider that as a failure,
+         too.  */
+      if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
+        {
+          if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
+            #ifdef __linux__
+            if (! (errno == EINVAL))
+            #endif
+              fail = 20;
+          break;
+        }
+
+      if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
+        {
+          struct stat sb;
+
+          c = getcwd (buf, PATH_MAX);
+          if (!c && errno == ENOENT)
+            {
+              fail = 11;
+              break;
+            }
+          if (c)
+            {
+              fail = 31;
+              break;
+            }
+          if (! (errno == ERANGE || is_ENAMETOOLONG (errno)))
+            {
+              fail = 21;
+              break;
+            }
+
+          /* Our replacement needs to be able to stat() long ../../paths,
+             so generate a path larger than PATH_MAX to check,
+             avoiding the replacement if we can't stat().  */
+          c = getcwd (buf, cwd_len + 1);
+          if (c && !AT_FDCWD && stat (c, &sb) != 0 && is_ENAMETOOLONG (errno))
+            {
+              fail = 32;
+              break;
+            }
+        }
+
+      if (dotdot_max <= cwd_len - initial_cwd_len)
+        {
+          if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
+            break;
+          c = getcwd (buf, cwd_len + 1);
+          if (!c)
+            {
+              if (! (errno == ERANGE || errno == ENOENT
+                     || is_ENAMETOOLONG (errno)))
+                {
+                  fail = 22;
+                  break;
+                }
+              if (AT_FDCWD || errno == ERANGE || errno == ENOENT)
+                {
+                  fail = 12;
+                  break;
+                }
+            }
+        }
+
+      if (c && strlen (c) != cwd_len)
+        {
+          fail = 23;
+          break;
+        }
+      ++n_chdirs;
+    }
+
+  /* Leaving behind such a deep directory is not polite.
+     So clean up here, right away, even though the driving
+     shell script would also clean up.  */
+  {
+    size_t i;
+
+    /* Try rmdir first, in case the chdir failed.  */
+    rmdir (DIR_NAME);
+    for (i = 0; i <= n_chdirs; i++)
+      {
+        if (chdir ("..") < 0)
+          break;
+        if (rmdir (DIR_NAME) != 0)
+          break;
+      }
+  }
+
+  exit (fail);
+#endif
+}
+          ]])],
+       [gl_cv_func_getcwd_path_max=yes],
+       [case $? in
+        10|11|12) gl_cv_func_getcwd_path_max='no, but it is partly working';;
+        31) gl_cv_func_getcwd_path_max='no, it has the AIX bug';;
+        32) gl_cv_func_getcwd_path_max='yes, but with shorter paths';;
+        *) gl_cv_func_getcwd_path_max=no;;
+        esac],
+       [# Cross-compilation guesses:
+        case "$host_os" in
+          aix*) # On AIX, it has the AIX bug.
+            gl_cv_func_getcwd_path_max='guessing no, it has the AIX bug' ;;
+          gnu*) # On Hurd, it is 'yes'.
+            gl_cv_func_getcwd_path_max='guessing yes' ;;
+          linux* | kfreebsd*)
+            # On older Linux+glibc it's 'no, but it is partly working',
+            # on newer Linux+glibc it's 'yes'.
+            # On Linux+musl libc, it's 'no, but it is partly working'.
+            # On kFreeBSD+glibc, it's 'no, but it is partly working'.
+            gl_cv_func_getcwd_path_max='guessing no, but it is partly working' ;;
+          *) # If we don't know, obey --enable-cross-guesses.
+            gl_cv_func_getcwd_path_max="$gl_cross_guess_normal" ;;
+        esac
+       ])
+    ])
+])
index 566c3c1..6ec7a94 100644 (file)
@@ -1,12 +1,12 @@
 # getcwd.m4 - check for working getcwd that is compatible with glibc
 
-# Copyright (C) 2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003-2007, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 # Written by Paul Eggert.
-# serial 13
+# serial 19
 
 AC_DEFUN([gl_FUNC_GETCWD_NULL],
   [
@@ -21,12 +21,13 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
 #        else /* on Windows with MSVC */
 #         include <direct.h>
 #        endif
+         ]GL_MDA_DEFINES[
 #        ifndef getcwd
          char *getcwd ();
 #        endif
 ]], [[
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-/* mingw cwd does not start with '/', but getcwd does allocate.
+#if defined _WIN32 && ! defined __CYGWIN__
+/* mingw cwd does not start with '/', but _getcwd does allocate.
    However, mingw fails to honor non-zero size.  */
 #else
            if (chdir ("/") != 0)
@@ -37,9 +38,9 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
                if (! f)
                  return 2;
                if (f[0] != '/')
-                 return 3;
+                 { free (f); return 3; }
                if (f[1] != '\0')
-                 return 4;
+                 { free (f); return 4; }
                free (f);
                return 0;
              }
@@ -48,12 +49,14 @@ AC_DEFUN([gl_FUNC_GETCWD_NULL],
         [gl_cv_func_getcwd_null=yes],
         [gl_cv_func_getcwd_null=no],
         [[case "$host_os" in
-                     # Guess yes on glibc systems.
-            *-gnu*)  gl_cv_func_getcwd_null="guessing yes";;
-                     # Guess yes on Cygwin.
-            cygwin*) gl_cv_func_getcwd_null="guessing yes";;
-                     # If we don't know, assume the worst.
-            *)       gl_cv_func_getcwd_null="guessing no";;
+                           # Guess yes on glibc systems.
+            *-gnu* | gnu*) gl_cv_func_getcwd_null="guessing yes";;
+                           # Guess yes on musl systems.
+            *-musl*)       gl_cv_func_getcwd_null="guessing yes";;
+                           # Guess yes on Cygwin.
+            cygwin*)       gl_cv_func_getcwd_null="guessing yes";;
+                           # If we don't know, obey --enable-cross-guesses.
+            *)             gl_cv_func_getcwd_null="$gl_cross_guess_normal";;
           esac
         ]])])
 ])
@@ -64,7 +67,8 @@ AC_DEFUN([gl_FUNC_GETCWD_SIGNATURE],
     [gl_cv_func_getcwd_posix_signature],
     [AC_COMPILE_IFELSE(
       [AC_LANG_PROGRAM(
-         [[#include <unistd.h>]],
+         [[#include <unistd.h>
+         ]GL_MDA_DEFINES],
          [[extern
            #ifdef __cplusplus
            "C"
@@ -125,7 +129,7 @@ AC_DEFUN([gl_FUNC_GETCWD],
   dnl Define HAVE_MINIMALLY_WORKING_GETCWD and HAVE_PARTLY_WORKING_GETCWD
   dnl if appropriate.
   case "$gl_cv_func_getcwd_path_max" in
-    "no"|"no, it has the AIX bug") ;;
+    *"no" | *"no, it has the AIX bug") ;;
     *)
       AC_DEFINE([HAVE_MINIMALLY_WORKING_GETCWD], [1],
         [Define to 1 if getcwd minimally works, that is, its result can be
@@ -133,12 +137,12 @@ AC_DEFUN([gl_FUNC_GETCWD],
       ;;
   esac
   case "$gl_cv_func_getcwd_path_max" in
-    "no, but it is partly working")
+    *"no, but it is partly working")
       AC_DEFINE([HAVE_PARTLY_WORKING_GETCWD], [1],
         [Define to 1 if getcwd works, except it sometimes fails when it
          shouldn't, setting errno to ERANGE, ENAMETOOLONG, or ENOENT.])
       ;;
-    "yes, but with shorter paths")
+    *"yes, but with shorter paths")
       AC_DEFINE([HAVE_GETCWD_SHORTER], [1],
         [Define to 1 if getcwd works, but with shorter paths
          than is generally tested with the replacement.])
index 1bf4db0..8fbc941 100644 (file)
@@ -1,5 +1,5 @@
-# getdtablesize.m4 serial 6
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# getdtablesize.m4 serial 8
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,29 +12,46 @@ AC_DEFUN([gl_FUNC_GETDTABLESIZE],
   AC_CHECK_DECLS_ONCE([getdtablesize])
   if test $ac_cv_func_getdtablesize = yes &&
      test $ac_cv_have_decl_getdtablesize = yes; then
-    # Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft limit
-    # up to an unchangeable hard limit; all other platforms correctly
-    # require setrlimit before getdtablesize() can report a larger value.
     AC_CACHE_CHECK([whether getdtablesize works],
       [gl_cv_func_getdtablesize_works],
-      [AC_RUN_IFELSE([
-        AC_LANG_PROGRAM([[#include <unistd.h>]],
-          [int size = getdtablesize();
-           if (dup2 (0, getdtablesize()) != -1)
-             return 1;
-           if (size != getdtablesize())
-             return 2;
-          ])],
-        [gl_cv_func_getdtablesize_works=yes],
-        [gl_cv_func_getdtablesize_works=no],
-        [case "$host_os" in
-          cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
-            gl_cv_func_getdtablesize_works="guessing no" ;;
-          *) gl_cv_func_getdtablesize_works="guessing yes" ;;
-         esac])
+      [dnl There are two concepts: the "maximum possible file descriptor value + 1"
+       dnl and the "maximum number of open file descriptors in a process".
+       dnl Per SUSv2 and POSIX, getdtablesize() should return the first one.
+       dnl On most platforms, the first and the second concept are the same.
+       dnl On OpenVMS, however, they are different and getdtablesize() returns
+       dnl the second one; thus the test below fails. But we don't care
+       dnl because there's no good way to write a replacement getdtablesize().
+       case "$host_os" in
+         vms*) gl_cv_func_getdtablesize_works="no (limitation)" ;;
+         *)
+           dnl Cygwin 1.7.25 automatically increases the RLIMIT_NOFILE soft
+           dnl limit up to an unchangeable hard limit; all other platforms
+           dnl correctly require setrlimit before getdtablesize() can report
+           dnl a larger value.
+           AC_RUN_IFELSE([
+             AC_LANG_PROGRAM(
+               [[#include <unistd.h>]
+                GL_MDA_DEFINES
+               ],
+               [[int size = getdtablesize();
+                 if (dup2 (0, getdtablesize()) != -1)
+                   return 1;
+                 if (size != getdtablesize())
+                   return 2;
+               ]])],
+             [gl_cv_func_getdtablesize_works=yes],
+             [gl_cv_func_getdtablesize_works=no],
+             [case "$host_os" in
+                cygwin*) # on cygwin 1.5.25, getdtablesize() automatically grows
+                  gl_cv_func_getdtablesize_works="guessing no" ;;
+                *) gl_cv_func_getdtablesize_works="guessing yes" ;;
+              esac
+             ])
+           ;;
+       esac
       ])
     case "$gl_cv_func_getdtablesize_works" in
-      *yes) ;;
+      *yes | "no (limitation)") ;;
       *) REPLACE_GETDTABLESIZE=1 ;;
     esac
   else
index ce6ec67..bb95c5e 100644 (file)
@@ -1,5 +1,5 @@
-# getopt.m4 serial 44
-dnl Copyright (C) 2002-2006, 2008-2016 Free Software Foundation, Inc.
+# getopt.m4 serial 47
+dnl Copyright (C) 2002-2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -32,9 +32,16 @@ AC_DEFUN([gl_FUNC_GETOPT_POSIX],
 # getopt_long_only.
 AC_DEFUN([gl_FUNC_GETOPT_GNU],
 [
+  dnl Set the variable gl_getopt_required, so that all invocations of
+  dnl gl_GETOPT_CHECK_HEADERS in the scope of the current configure file
+  dnl will check for getopt with GNU extensions.
+  dnl This means that if one gnulib-tool invocation requests getopt-posix
+  dnl and another gnulib-tool invocation requests getopt-gnu, it is as if
+  dnl both had requested getopt-gnu.
   m4_divert_text([INIT_PREPARE], [gl_getopt_required=GNU])
 
-  AC_REQUIRE([gl_FUNC_GETOPT_POSIX])
+  dnl No need to invoke gl_FUNC_GETOPT_POSIX here; this is automatically
+  dnl done through the module dependency getopt-gnu -> getopt-posix.
 ])
 
 # Determine whether to replace the entire getopt facility.
@@ -295,8 +302,10 @@ dnl is ambiguous with environment values that contain newlines.
            ]])],
         [gl_cv_func_getopt_gnu=yes],
         [gl_cv_func_getopt_gnu=no],
-        [dnl Cross compiling. Assume the worst, even on glibc platforms.
-         gl_cv_func_getopt_gnu="guessing no"
+        [dnl Cross compiling.
+         dnl Assume the worst, even on glibc platforms.
+         dnl But obey --enable-cross-guesses.
+         gl_cv_func_getopt_gnu="$gl_cross_guess_normal"
         ])
        case $gl_had_POSIXLY_CORRECT in
          exported) ;;
@@ -354,15 +363,19 @@ dnl is ambiguous with environment values that contain newlines.
 
 AC_DEFUN([gl_GETOPT_SUBSTITUTE_HEADER],
 [
-  GETOPT_H=getopt.h
+  AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
+  if test $ac_cv_header_sys_cdefs_h = yes; then
+    HAVE_SYS_CDEFS_H=1
+  else
+    HAVE_SYS_CDEFS_H=0
+  fi
+  AC_SUBST([HAVE_SYS_CDEFS_H])
+
   AC_DEFINE([__GETOPT_PREFIX], [[rpl_]],
     [Define to rpl_ if the getopt replacement functions and variables
      should be used.])
+  GETOPT_H=getopt.h
+  GETOPT_CDEFS_H=getopt-cdefs.h
   AC_SUBST([GETOPT_H])
-])
-
-# Prerequisites of lib/getopt*.
-AC_DEFUN([gl_PREREQ_GETOPT],
-[
-  AC_CHECK_DECLS_ONCE([getenv])
+  AC_SUBST([GETOPT_CDEFS_H])
 ])
index 8902b7b..7e61801 100644 (file)
@@ -1,5 +1,5 @@
-# getpagesize.m4 serial 9
-dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2016 Free Software Foundation,
+# getpagesize.m4 serial 10
+dnl Copyright (C) 2002, 2004-2005, 2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -9,8 +9,8 @@ AC_DEFUN([gl_FUNC_GETPAGESIZE],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_CHECK_FUNCS([getpagesize])
-  if test $ac_cv_func_getpagesize = no; then
+  gl_CHECK_FUNC_GETPAGESIZE
+  if test $gl_cv_func_getpagesize = no; then
     HAVE_GETPAGESIZE=0
     AC_CHECK_HEADERS([OS.h])
     if test $ac_cv_header_OS_h = yes; then
@@ -30,3 +30,20 @@ AC_DEFUN([gl_FUNC_GETPAGESIZE],
   dnl mingw has getpagesize() in libgcc.a but doesn't declare it.
   AC_CHECK_DECL([getpagesize], , [HAVE_DECL_GETPAGESIZE=0])
 ])
+
+dnl Tests whether the function getpagesize() exists.
+dnl Sets gl_cv_func_getpagesize.
+AC_DEFUN([gl_CHECK_FUNC_GETPAGESIZE],
+[
+  dnl We can't use AC_CHECK_FUNC here, because getpagesize() is defined as a
+  dnl static inline function when compiling for Android 4.4 or older.
+  AC_CACHE_CHECK([for getpagesize], [gl_cv_func_getpagesize],
+    [AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <unistd.h>]],
+          [[return getpagesize();]])
+       ],
+       [gl_cv_func_getpagesize=yes],
+       [gl_cv_func_getpagesize=no])
+    ])
+])
index f027037..65917d6 100644 (file)
@@ -1,6 +1,6 @@
 # getprogname.m4 - check for getprogname or replacements for it
 
-# Copyright (C) 2016 Free Software Foundation, Inc.
+# Copyright (C) 2016-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/getrandom.m4 b/m4/getrandom.m4
new file mode 100644 (file)
index 0000000..5f174dc
--- /dev/null
@@ -0,0 +1,68 @@
+# getrandom.m4 serial 8
+dnl Copyright 2020-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Paul Eggert.
+
+AC_DEFUN([gl_FUNC_GETRANDOM],
+[
+  AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([getrandom])
+  if test "$ac_cv_func_getrandom" != yes; then
+    HAVE_GETRANDOM=0
+  else
+    dnl On Solaris 11.4 the return type is 'int', not 'ssize_t'.
+    AC_CACHE_CHECK([whether getrandom is compatible with its GNU+BSD signature],
+      [gl_cv_func_getrandom_ok],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[/* Additional includes are needed before <sys/random.h> on uClibc
+                 and Mac OS X.  */
+              #include <sys/types.h>
+              #include <stdlib.h>
+              #include <sys/random.h>
+              ssize_t getrandom (void *, size_t, unsigned int);
+            ]],
+            [[]])
+         ],
+         [gl_cv_func_getrandom_ok=yes],
+         [gl_cv_func_getrandom_ok=no])
+      ])
+    if test $gl_cv_func_getrandom_ok = no; then
+      REPLACE_GETRANDOM=1
+    fi
+  fi
+
+  case "$host_os" in
+    mingw*)
+      AC_CHECK_HEADERS([bcrypt.h], [], [],
+        [[#include <windows.h>
+        ]])
+      AC_CACHE_CHECK([whether the bcrypt library is guaranteed to be present],
+        [gl_cv_lib_assume_bcrypt],
+        [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <windows.h>]],
+              [[#if !(_WIN32_WINNT >= _WIN32_WINNT_WIN7)
+                  cannot assume it
+                #endif
+              ]])
+           ],
+           [gl_cv_lib_assume_bcrypt=yes],
+           [gl_cv_lib_assume_bcrypt=no])
+        ])
+      if test $gl_cv_lib_assume_bcrypt = yes; then
+        AC_DEFINE([HAVE_LIB_BCRYPT], [1],
+          [Define to 1 if the bcrypt library is guaranteed to be present.])
+        LIB_GETRANDOM='-lbcrypt'
+      else
+        LIB_GETRANDOM='-ladvapi32'
+      fi
+      ;;
+    *)
+      LIB_GETRANDOM= ;;
+  esac
+  AC_SUBST([LIB_GETRANDOM])
+])
diff --git a/m4/gettext.m4 b/m4/gettext.m4
new file mode 100644 (file)
index 0000000..be247bf
--- /dev/null
@@ -0,0 +1,401 @@
+# gettext.m4 serial 66 (gettext-0.18.2)
+dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2006, 2008-2010.
+
+dnl Macro to add for using GNU gettext.
+
+dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]).
+dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The
+dnl    default (if it is not specified or empty) is 'no-libtool'.
+dnl    INTLSYMBOL should be 'external' for packages with no intl directory,
+dnl    and 'no-libtool' or 'use-libtool' for packages with an intl directory.
+dnl    If INTLSYMBOL is 'use-libtool', then a libtool library
+dnl    $(top_builddir)/intl/libintl.la will be created (shared and/or static,
+dnl    depending on --{enable,disable}-{shared,static} and on the presence of
+dnl    AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library
+dnl    $(top_builddir)/intl/libintl.a will be created.
+dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
+dnl    implementations (in libc or libintl) without the ngettext() function
+dnl    will be ignored.  If NEEDSYMBOL is specified and is
+dnl    'need-formatstring-macros', then GNU gettext implementations that don't
+dnl    support the ISO C 99 <inttypes.h> formatstring macros will be ignored.
+dnl INTLDIR is used to find the intl libraries.  If empty,
+dnl    the value '$(top_builddir)/intl/' is used.
+dnl
+dnl The result of the configuration is one of three cases:
+dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
+dnl    and used.
+dnl    Catalog format: GNU --> install in $(datadir)
+dnl    Catalog extension: .mo after installation, .gmo in source tree
+dnl 2) GNU gettext has been found in the system's C library.
+dnl    Catalog format: GNU --> install in $(datadir)
+dnl    Catalog extension: .mo after installation, .gmo in source tree
+dnl 3) No internationalization, always use English msgid.
+dnl    Catalog format: none
+dnl    Catalog extension: none
+dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur.
+dnl The use of .gmo is historical (it was needed to avoid overwriting the
+dnl GNU format catalogs when building on a platform with an X/Open gettext),
+dnl but we keep it in order not to force irrelevant filename changes on the
+dnl maintainers.
+dnl
+AC_DEFUN([AM_GNU_GETTEXT],
+[
+  dnl Argument checking.
+  ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], ,
+    [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT
+])])])])])
+  ifelse(ifelse([$1], [], [old])[]ifelse([$1], [no-libtool], [old]), [old],
+    [AC_DIAGNOSE([obsolete], [Use of AM_GNU_GETTEXT without [external] argument is deprecated.])])
+  ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], ,
+    [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT
+])])])])
+  define([gt_included_intl],
+    ifelse([$1], [external],
+      ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]),
+      [yes]))
+  define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], []))
+  gt_NEEDS_INIT
+  AM_GNU_GETTEXT_NEED([$2])
+
+  AC_REQUIRE([AM_PO_SUBDIRS])dnl
+  ifelse(gt_included_intl, yes, [
+    AC_REQUIRE([AM_INTL_SUBDIR])dnl
+  ])
+
+  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+
+  dnl Sometimes libintl requires libiconv, so first search for libiconv.
+  dnl Ideally we would do this search only after the
+  dnl      if test "$USE_NLS" = "yes"; then
+  dnl        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+  dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT
+  dnl the configure script would need to contain the same shell code
+  dnl again, outside any 'if'. There are two solutions:
+  dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'.
+  dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE.
+  dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not
+  dnl documented, we avoid it.
+  ifelse(gt_included_intl, yes, , [
+    AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+  ])
+
+  dnl Sometimes, on Mac OS X, libintl requires linking with CoreFoundation.
+  gt_INTL_MACOSX
+
+  dnl Set USE_NLS.
+  AC_REQUIRE([AM_NLS])
+
+  ifelse(gt_included_intl, yes, [
+    BUILD_INCLUDED_LIBINTL=no
+    USE_INCLUDED_LIBINTL=no
+  ])
+  LIBINTL=
+  LTLIBINTL=
+  POSUB=
+
+  dnl Add a version number to the cache macros.
+  case " $gt_needs " in
+    *" need-formatstring-macros "*) gt_api_version=3 ;;
+    *" need-ngettext "*) gt_api_version=2 ;;
+    *) gt_api_version=1 ;;
+  esac
+  gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc"
+  gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl"
+
+  dnl If we use NLS figure out what method
+  if test "$USE_NLS" = "yes"; then
+    gt_use_preinstalled_gnugettext=no
+    ifelse(gt_included_intl, yes, [
+      AC_MSG_CHECKING([whether included gettext is requested])
+      AC_ARG_WITH([included-gettext],
+        [  --with-included-gettext use the GNU gettext library included here],
+        nls_cv_force_use_gnu_gettext=$withval,
+        nls_cv_force_use_gnu_gettext=no)
+      AC_MSG_RESULT([$nls_cv_force_use_gnu_gettext])
+
+      nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
+      if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
+    ])
+        dnl User does not insist on using GNU NLS library.  Figure out what
+        dnl to use.  If GNU gettext is available we use this.  Else we have
+        dnl to fall back to GNU NLS library.
+
+        if test $gt_api_version -ge 3; then
+          gt_revision_test_code='
+#ifndef __GNU_GETTEXT_SUPPORTED_REVISION
+#define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1)
+#endif
+changequote(,)dnl
+typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1];
+changequote([,])dnl
+'
+        else
+          gt_revision_test_code=
+        fi
+        if test $gt_api_version -ge 2; then
+          gt_expression_test_code=' + * ngettext ("", "", 0)'
+        else
+          gt_expression_test_code=
+        fi
+
+        AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc],
+         [AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern int *_nl_domain_bindings;
+               ]],
+               [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings
+               ]])],
+            [eval "$gt_func_gnugettext_libc=yes"],
+            [eval "$gt_func_gnugettext_libc=no"])])
+
+        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then
+          dnl Sometimes libintl requires libiconv, so first search for libiconv.
+          ifelse(gt_included_intl, yes, , [
+            AM_ICONV_LINK
+          ])
+          dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL
+          dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv])
+          dnl because that would add "-liconv" to LIBINTL and LTLIBINTL
+          dnl even if libiconv doesn't exist.
+          AC_LIB_LINKFLAGS_BODY([intl])
+          AC_CACHE_CHECK([for GNU gettext in libintl],
+            [$gt_func_gnugettext_libintl],
+           [gt_save_CPPFLAGS="$CPPFLAGS"
+            CPPFLAGS="$CPPFLAGS $INCINTL"
+            gt_save_LIBS="$LIBS"
+            LIBS="$LIBS $LIBINTL"
+            dnl Now see whether libintl exists and does not depend on libiconv.
+            AC_LINK_IFELSE(
+              [AC_LANG_PROGRAM(
+                 [[
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+                 ]],
+                 [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+                 ]])],
+              [eval "$gt_func_gnugettext_libintl=yes"],
+              [eval "$gt_func_gnugettext_libintl=no"])
+            dnl Now see whether libintl exists and depends on libiconv.
+            if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then
+              LIBS="$LIBS $LIBICONV"
+              AC_LINK_IFELSE(
+                [AC_LANG_PROGRAM(
+                   [[
+#include <libintl.h>
+$gt_revision_test_code
+extern int _nl_msg_cat_cntr;
+extern
+#ifdef __cplusplus
+"C"
+#endif
+const char *_nl_expand_alias (const char *);
+                   ]],
+                   [[
+bindtextdomain ("", "");
+return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")
+                   ]])],
+                [LIBINTL="$LIBINTL $LIBICONV"
+                 LTLIBINTL="$LTLIBINTL $LTLIBICONV"
+                 eval "$gt_func_gnugettext_libintl=yes"
+                ])
+            fi
+            CPPFLAGS="$gt_save_CPPFLAGS"
+            LIBS="$gt_save_LIBS"])
+        fi
+
+        dnl If an already present or preinstalled GNU gettext() is found,
+        dnl use it.  But if this macro is used in GNU gettext, and GNU
+        dnl gettext is already preinstalled in libintl, we update this
+        dnl libintl.  (Cf. the install rule in intl/Makefile.in.)
+        if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \
+           || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \
+                && test "$PACKAGE" != gettext-runtime \
+                && test "$PACKAGE" != gettext-tools; }; then
+          gt_use_preinstalled_gnugettext=yes
+        else
+          dnl Reset the values set by searching for libintl.
+          LIBINTL=
+          LTLIBINTL=
+          INCINTL=
+        fi
+
+    ifelse(gt_included_intl, yes, [
+        if test "$gt_use_preinstalled_gnugettext" != "yes"; then
+          dnl GNU gettext is not found in the C library.
+          dnl Fall back on included GNU gettext library.
+          nls_cv_use_gnu_gettext=yes
+        fi
+      fi
+
+      if test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions used to generate GNU NLS library.
+        BUILD_INCLUDED_LIBINTL=yes
+        USE_INCLUDED_LIBINTL=yes
+        LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD"
+        LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD"
+        LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
+      fi
+
+      CATOBJEXT=
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Mark actions to use GNU gettext tools.
+        CATOBJEXT=.gmo
+      fi
+    ])
+
+    if test -n "$INTL_MACOSX_LIBS"; then
+      if test "$gt_use_preinstalled_gnugettext" = "yes" \
+         || test "$nls_cv_use_gnu_gettext" = "yes"; then
+        dnl Some extra flags are needed during linking.
+        LIBINTL="$LIBINTL $INTL_MACOSX_LIBS"
+        LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS"
+      fi
+    fi
+
+    if test "$gt_use_preinstalled_gnugettext" = "yes" \
+       || test "$nls_cv_use_gnu_gettext" = "yes"; then
+      AC_DEFINE([ENABLE_NLS], [1],
+        [Define to 1 if translation of program messages to the user's native language
+   is requested.])
+    else
+      USE_NLS=no
+    fi
+  fi
+
+  AC_MSG_CHECKING([whether to use NLS])
+  AC_MSG_RESULT([$USE_NLS])
+  if test "$USE_NLS" = "yes"; then
+    AC_MSG_CHECKING([where the gettext function comes from])
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+        gt_source="external libintl"
+      else
+        gt_source="libc"
+      fi
+    else
+      gt_source="included intl directory"
+    fi
+    AC_MSG_RESULT([$gt_source])
+  fi
+
+  if test "$USE_NLS" = "yes"; then
+
+    if test "$gt_use_preinstalled_gnugettext" = "yes"; then
+      if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then
+        AC_MSG_CHECKING([how to link with libintl])
+        AC_MSG_RESULT([$LIBINTL])
+        AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL])
+      fi
+
+      dnl For backward compatibility. Some packages may be using this.
+      AC_DEFINE([HAVE_GETTEXT], [1],
+       [Define if the GNU gettext() function is already present or preinstalled.])
+      AC_DEFINE([HAVE_DCGETTEXT], [1],
+       [Define if the GNU dcgettext() function is already present or preinstalled.])
+    fi
+
+    dnl We need to process the po/ directory.
+    POSUB=po
+  fi
+
+  ifelse(gt_included_intl, yes, [
+    dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
+    dnl to 'yes' because some of the testsuite requires it.
+    if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then
+      BUILD_INCLUDED_LIBINTL=yes
+    fi
+
+    dnl Make all variables we use known to autoconf.
+    AC_SUBST([BUILD_INCLUDED_LIBINTL])
+    AC_SUBST([USE_INCLUDED_LIBINTL])
+    AC_SUBST([CATOBJEXT])
+
+    dnl For backward compatibility. Some configure.ins may be using this.
+    nls_cv_header_intl=
+    nls_cv_header_libgt=
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    DATADIRNAME=share
+    AC_SUBST([DATADIRNAME])
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    INSTOBJEXT=.mo
+    AC_SUBST([INSTOBJEXT])
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    GENCAT=gencat
+    AC_SUBST([GENCAT])
+
+    dnl For backward compatibility. Some Makefiles may be using this.
+    INTLOBJS=
+    if test "$USE_INCLUDED_LIBINTL" = yes; then
+      INTLOBJS="\$(GETTOBJS)"
+    fi
+    AC_SUBST([INTLOBJS])
+
+    dnl Enable libtool support if the surrounding package wishes it.
+    INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix
+    AC_SUBST([INTL_LIBTOOL_SUFFIX_PREFIX])
+  ])
+
+  dnl For backward compatibility. Some Makefiles may be using this.
+  INTLLIBS="$LIBINTL"
+  AC_SUBST([INTLLIBS])
+
+  dnl Make all documented variables known to autoconf.
+  AC_SUBST([LIBINTL])
+  AC_SUBST([LTLIBINTL])
+  AC_SUBST([POSUB])
+])
+
+
+dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized.
+m4_define([gt_NEEDS_INIT],
+[
+  m4_divert_text([DEFAULTS], [gt_needs=])
+  m4_define([gt_NEEDS_INIT], [])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL])
+AC_DEFUN([AM_GNU_GETTEXT_NEED],
+[
+  m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"])
+])
+
+
+dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
index 4ae5d63..37c5440 100644 (file)
@@ -1,6 +1,6 @@
-# serial 21
+# serial 29
 
-# Copyright (C) 2001-2003, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001-2003, 2005, 2007, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -9,16 +9,16 @@ dnl From Jim Meyering.
 
 AC_DEFUN([gl_FUNC_GETTIMEOFDAY],
 [
+  AC_REQUIRE([gl_SYS_TIME_H_DEFAULTS])
   AC_REQUIRE([AC_C_RESTRICT])
-  AC_REQUIRE([gl_HEADER_SYS_TIME_H])
-  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_SYS_TIME_H])
   AC_CHECK_FUNCS_ONCE([gettimeofday])
 
   gl_gettimeofday_timezone=void
   if test $ac_cv_func_gettimeofday != yes; then
     HAVE_GETTIMEOFDAY=0
   else
-    gl_FUNC_GETTIMEOFDAY_CLOBBER
     AC_CACHE_CHECK([for gettimeofday with POSIX signature],
       [gl_cv_func_gettimeofday_posix_signature],
       [AC_COMPILE_IFELSE(
@@ -54,85 +54,16 @@ int gettimeofday (struct timeval *restrict, struct timezone *restrict);
     if test $REPLACE_STRUCT_TIMEVAL = 1; then
       REPLACE_GETTIMEOFDAY=1
     fi
-    m4_ifdef([gl_FUNC_TZSET_CLOBBER], [
-      gl_FUNC_TZSET_CLOBBER
-      case "$gl_cv_func_tzset_clobber" in
-        *yes)
-          REPLACE_GETTIMEOFDAY=1
-          gl_GETTIMEOFDAY_REPLACE_LOCALTIME
-          AC_DEFINE([tzset], [rpl_tzset],
-            [Define to rpl_tzset if the wrapper function should be used.])
-          AC_DEFINE([TZSET_CLOBBERS_LOCALTIME], [1],
-            [Define if tzset clobbers localtime's static buffer.])
-          ;;
-      esac
-    ])
+    dnl On mingw, the original gettimeofday has only a precision of 15.6
+    dnl milliseconds. So override it.
+    case "$host_os" in
+      mingw*) REPLACE_GETTIMEOFDAY=1 ;;
+    esac
   fi
   AC_DEFINE_UNQUOTED([GETTIMEOFDAY_TIMEZONE], [$gl_gettimeofday_timezone],
     [Define this to 'void' or 'struct timezone' to match the system's
      declaration of the second argument to gettimeofday.])
 ])
 
-
-dnl See if gettimeofday clobbers the static buffer that localtime uses
-dnl for its return value.  The gettimeofday function from Mac OS X 10.0.4
-dnl (i.e., Darwin 1.3.7) has this problem.
-dnl
-dnl If it does, then arrange to use gettimeofday and localtime only via
-dnl the wrapper functions that work around the problem.
-
-AC_DEFUN([gl_FUNC_GETTIMEOFDAY_CLOBBER],
-[
- AC_REQUIRE([gl_HEADER_SYS_TIME_H])
- AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-
- AC_CACHE_CHECK([whether gettimeofday clobbers localtime buffer],
-  [gl_cv_func_gettimeofday_clobber],
-  [AC_RUN_IFELSE(
-     [AC_LANG_PROGRAM(
-        [[#include <string.h>
-          #include <sys/time.h>
-          #include <time.h>
-          #include <stdlib.h>
-        ]],
-        [[
-          time_t t = 0;
-          struct tm *lt;
-          struct tm saved_lt;
-          struct timeval tv;
-          lt = localtime (&t);
-          saved_lt = *lt;
-          gettimeofday (&tv, NULL);
-          return memcmp (lt, &saved_lt, sizeof (struct tm)) != 0;
-        ]])],
-     [gl_cv_func_gettimeofday_clobber=no],
-     [gl_cv_func_gettimeofday_clobber=yes],
-     [# When cross-compiling:
-      case "$host_os" in
-                # Guess all is fine on glibc systems.
-        *-gnu*) gl_cv_func_gettimeofday_clobber="guessing no" ;;
-                # If we don't know, assume the worst.
-        *)      gl_cv_func_gettimeofday_clobber="guessing yes" ;;
-      esac
-     ])])
-
- case "$gl_cv_func_gettimeofday_clobber" in
-   *yes)
-     REPLACE_GETTIMEOFDAY=1
-     gl_GETTIMEOFDAY_REPLACE_LOCALTIME
-     AC_DEFINE([GETTIMEOFDAY_CLOBBERS_LOCALTIME], [1],
-       [Define if gettimeofday clobbers the localtime buffer.])
-     ;;
- esac
-])
-
-AC_DEFUN([gl_GETTIMEOFDAY_REPLACE_LOCALTIME], [
-  REPLACE_GMTIME=1
-  REPLACE_LOCALTIME=1
-])
-
 # Prerequisites of lib/gettimeofday.c.
-AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [
-  AC_CHECK_HEADERS([sys/timeb.h])
-  AC_CHECK_FUNCS([_ftime])
-])
+AC_DEFUN([gl_PREREQ_GETTIMEOFDAY], [:])
diff --git a/m4/glibc21.m4 b/m4/glibc21.m4
deleted file mode 100644 (file)
index dafebf5..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-# glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2016 Free Software Foundation,
-dnl Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Test for the GNU C Library, version 2.1 or newer, or uClibc.
-# From Bruno Haible.
-
-AC_DEFUN([gl_GLIBC21],
-  [
-    AC_CACHE_CHECK([whether we are using the GNU C Library >= 2.1 or uClibc],
-      [ac_cv_gnu_library_2_1],
-      [AC_EGREP_CPP([Lucky],
-        [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-  Lucky GNU user
- #endif
-#endif
-#ifdef __UCLIBC__
- Lucky user
-#endif
-        ],
-        [ac_cv_gnu_library_2_1=yes],
-        [ac_cv_gnu_library_2_1=no])
-      ]
-    )
-    AC_SUBST([GLIBC21])
-    GLIBC21="$ac_cv_gnu_library_2_1"
-  ]
-)
index ede6dbf..5ba60b5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+# along with this file.  If not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License,
 # this file may be distributed as part of a program that
 
 
 # Specification in the form of a command-line invocation:
-#   gnulib-tool --import --local-dir=gl --lib=libm4 --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --with-tests --with-c++-tests --avoid=lock-tests --avoid=tls-tests --makefile-name=gnulib.mk --no-conditional-dependencies --no-libtool --macro-prefix=M4 announce-gen assert autobuild avltree-oset binary-io c-stack clean-temp cloexec close-stream closein config-h dirname do-release-commit-and-tag error execute fclose fdl-1.3 fflush filenamecat fopen fopen-safer fseeko gendocs getopt-gnu git-version-gen gitlog-to-changelog gnu-web-doc-update gnumakefile gnupload gpl-3.0 ignore-value intprops maintainer-makefile manywarnings memchr2 mkstemp obstack progname regex rename sigaction sigpipe spawn-pipe stdbool stdint stdlib-safer strsignal strstr strtod unlocked-io update-copyright vc-list-files verror version-etc version-etc-fsf wait-process xalloc xoset xprintf xvasprintf-posix
+# gnulib-tool --import --local-dir=gl \
+#  --lib=libm4 \
+#  --source-base=lib \
+#  --m4-base=m4 \
+#  --doc-base=doc \
+#  --tests-base=tests \
+#  --aux-dir=build-aux \
+#  --with-tests \
+#  --with-c++-tests \
+#  --makefile-name=gnulib.mk \
+#  --no-conditional-dependencies \
+#  --no-libtool \
+#  --macro-prefix=M4 \
+#  --avoid=getopt-posix-tests \
+#  --avoid=lock-tests \
+#  --avoid=tls-tests \
+#  announce-gen \
+#  assert \
+#  attribute \
+#  autobuild \
+#  avltree-oset \
+#  binary-io \
+#  c-ctype \
+#  c-stack \
+#  clean-temp \
+#  close-stream \
+#  closein \
+#  config-h \
+#  configmake \
+#  dirname \
+#  do-release-commit-and-tag \
+#  error \
+#  execute \
+#  fclose \
+#  fdl-1.3 \
+#  fflush \
+#  filenamecat \
+#  fopen-gnu \
+#  fopen-safer \
+#  fseeko \
+#  gendocs \
+#  getopt-gnu \
+#  gettext-h \
+#  git-version-gen \
+#  gitlog-to-changelog \
+#  gnu-web-doc-update \
+#  gnumakefile \
+#  gnupload \
+#  gpl-3.0 \
+#  ignore-value \
+#  intprops \
+#  maintainer-makefile \
+#  manywarnings \
+#  memchr2 \
+#  mkstemp \
+#  obstack \
+#  progname \
+#  propername \
+#  regex \
+#  rename \
+#  setlocale \
+#  sigaction \
+#  sigpipe \
+#  spawn-pipe \
+#  stdbool \
+#  stdint \
+#  stdlib-safer \
+#  strsignal \
+#  strstr \
+#  strtod \
+#  unlocked-io \
+#  update-copyright \
+#  vc-list-files \
+#  verify \
+#  verror \
+#  version-etc \
+#  version-etc-fsf \
+#  wait-process \
+#  xalloc \
+#  xoset \
+#  xprintf \
+#  xvasprintf-posix
 
 # Specification in the form of a few gnulib-tool.m4 macro invocations:
 gl_LOCAL_DIR([gl])
 gl_MODULES([
   announce-gen
   assert
+  attribute
   autobuild
   avltree-oset
   binary-io
+  c-ctype
   c-stack
   clean-temp
-  cloexec
   close-stream
   closein
   config-h
+  configmake
   dirname
   do-release-commit-and-tag
   error
@@ -51,11 +134,12 @@ gl_MODULES([
   fdl-1.3
   fflush
   filenamecat
-  fopen
+  fopen-gnu
   fopen-safer
   fseeko
   gendocs
   getopt-gnu
+  gettext-h
   git-version-gen
   gitlog-to-changelog
   gnu-web-doc-update
@@ -70,8 +154,10 @@ gl_MODULES([
   mkstemp
   obstack
   progname
+  propername
   regex
   rename
+  setlocale
   sigaction
   sigpipe
   spawn-pipe
@@ -84,6 +170,7 @@ gl_MODULES([
   unlocked-io
   update-copyright
   vc-list-files
+  verify
   verror
   version-etc
   version-etc-fsf
@@ -94,7 +181,7 @@ gl_MODULES([
   xvasprintf-posix
 ])
 gl_WITH_CXX_TESTS
-gl_AVOID([lock-tests tls-tests])
+gl_AVOID([getopt-posix-tests lock-tests tls-tests])
 gl_SOURCE_BASE([lib])
 gl_M4_BASE([m4])
 gl_PO_BASE([])
index f8454c8..7db4be1 100644 (file)
@@ -1,25 +1,54 @@
-# gnulib-common.m4 serial 36
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# gnulib-common.m4 serial 65
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
+AC_PREREQ([2.62])
+
 # gl_COMMON
 # is expanded unconditionally through gnulib-tool magic.
 AC_DEFUN([gl_COMMON], [
   dnl Use AC_REQUIRE here, so that the code is expanded once only.
   AC_REQUIRE([gl_00GNULIB])
   AC_REQUIRE([gl_COMMON_BODY])
+  AC_REQUIRE([gl_ZZGNULIB])
 ])
 AC_DEFUN([gl_COMMON_BODY], [
+  AH_VERBATIM([_GL_GNUC_PREREQ],
+[/* True if the compiler says it groks GNU C version MAJOR.MINOR.  */
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define _GL_GNUC_PREREQ(major, minor) \
+    ((major) < __GNUC__ + ((minor) <= __GNUC_MINOR__))
+#else
+# define _GL_GNUC_PREREQ(major, minor) 0
+#endif
+])
   AH_VERBATIM([_Noreturn],
 [/* The _Noreturn keyword of C11.  */
-#if ! (defined _Noreturn \
-       || (defined __STDC_VERSION__ && 201112 <= __STDC_VERSION__))
-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
-      || 0x5110 <= __SUNPRO_C)
+#ifndef _Noreturn
+# if (defined __cplusplus \
+      && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+          || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+      && 0)
+    /* [[noreturn]] is not practically usable, because with it the syntax
+         extern _Noreturn void func (...);
+       would not be valid; such a declaration would only be valid with 'extern'
+       and '_Noreturn' swapped, or without the 'extern' keyword.  However, some
+       AIX system header files and several gnulib header files use precisely
+       this syntax with 'extern'.  */
+#  define _Noreturn [[noreturn]]
+# elif ((!defined __cplusplus || defined __clang__) \
+        && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+            || (!defined __STRICT_ANSI__ \
+                && (_GL_GNUC_PREREQ (4, 7) \
+                    || (defined __apple_build_version__ \
+                        ? 6000000 <= __apple_build_version__ \
+                        : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+   /* _Noreturn works as-is.  */
+# elif _GL_GNUC_PREREQ (2, 8) || defined __clang__ || 0x5110 <= __SUNPRO_C
 #  define _Noreturn __attribute__ ((__noreturn__))
-# elif defined _MSC_VER && 1200 <= _MSC_VER
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
 #  define _Noreturn __declspec (noreturn)
 # else
 #  define _Noreturn
@@ -36,43 +65,290 @@ AC_DEFUN([gl_COMMON_BODY], [
 #if defined __APPLE__ && defined __MACH__ && __APPLE_CC__ >= 5465 && !defined __cplusplus && __STDC_VERSION__ >= 199901L && !defined __GNUC_STDC_INLINE__
 # define __GNUC_STDC_INLINE__ 1
 #endif])
-  AH_VERBATIM([unused_parameter],
-[/* Define as a marker that can be attached to declarations that might not
-    be used.  This helps to reduce warnings, such as from
-    GCC -Wunused-parameter.  */
-#if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
-# define _GL_UNUSED __attribute__ ((__unused__))
+  AH_VERBATIM([attribute],
+[/* Attributes.  */
+#if (defined __has_attribute \
+     && (!defined __clang_minor__ \
+         || 3 < __clang_major__ + (5 <= __clang_minor__)))
+# define _GL_HAS_ATTRIBUTE(attr) __has_attribute (__##attr##__)
 #else
-# define _GL_UNUSED
+# define _GL_HAS_ATTRIBUTE(attr) _GL_ATTR_##attr
+# define _GL_ATTR_alloc_size _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_always_inline _GL_GNUC_PREREQ (3, 2)
+# define _GL_ATTR_artificial _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_cold _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_const _GL_GNUC_PREREQ (2, 95)
+# define _GL_ATTR_deprecated _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_diagnose_if 0
+# define _GL_ATTR_error _GL_GNUC_PREREQ (4, 3)
+# define _GL_ATTR_externally_visible _GL_GNUC_PREREQ (4, 1)
+# define _GL_ATTR_fallthrough _GL_GNUC_PREREQ (7, 0)
+# define _GL_ATTR_format _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_leaf _GL_GNUC_PREREQ (4, 6)
+# ifdef _ICC
+#  define _GL_ATTR_may_alias 0
+# else
+#  define _GL_ATTR_may_alias _GL_GNUC_PREREQ (3, 3)
+# endif
+# define _GL_ATTR_malloc _GL_GNUC_PREREQ (3, 0)
+# define _GL_ATTR_noinline _GL_GNUC_PREREQ (3, 1)
+# define _GL_ATTR_nonnull _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_nonstring _GL_GNUC_PREREQ (8, 0)
+# define _GL_ATTR_nothrow _GL_GNUC_PREREQ (3, 3)
+# define _GL_ATTR_packed _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_pure _GL_GNUC_PREREQ (2, 96)
+# define _GL_ATTR_returns_nonnull _GL_GNUC_PREREQ (4, 9)
+# define _GL_ATTR_sentinel _GL_GNUC_PREREQ (4, 0)
+# define _GL_ATTR_unused _GL_GNUC_PREREQ (2, 7)
+# define _GL_ATTR_warn_unused_result _GL_GNUC_PREREQ (3, 4)
 #endif
-/* The name _UNUSED_PARAMETER_ is an earlier spelling, although the name
-   is a misnomer outside of parameter lists.  */
-#define _UNUSED_PARAMETER_ _GL_UNUSED
-
-/* gcc supports the "unused" attribute on possibly unused labels, and
-   g++ has since version 4.5.  Note to support C++ as well as C,
-   _GL_UNUSED_LABEL should be used with a trailing ;  */
-#if !defined __cplusplus || __GNUC__ > 4 \
-    || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)
-# define _GL_UNUSED_LABEL _GL_UNUSED
+
+]dnl There is no _GL_ATTRIBUTE_ALIGNED; use stdalign's _Alignas instead.
+[
+#if _GL_HAS_ATTRIBUTE (alloc_size)
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args) __attribute__ ((__alloc_size__ args))
 #else
-# define _GL_UNUSED_LABEL
+# define _GL_ATTRIBUTE_ALLOC_SIZE(args)
 #endif
 
-/* The __pure__ attribute was added in gcc 2.96.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
-# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#if _GL_HAS_ATTRIBUTE (always_inline)
+# define _GL_ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__))
+#else
+# define _GL_ATTRIBUTE_ALWAYS_INLINE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (artificial)
+# define _GL_ATTRIBUTE_ARTIFICIAL __attribute__ ((__artificial__))
 #else
-# define _GL_ATTRIBUTE_PURE /* empty */
+# define _GL_ATTRIBUTE_ARTIFICIAL
 #endif
 
-/* The __const__ attribute was added in gcc 2.95.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
+   <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
+   Also, Oracle Studio 12.6 requires 'cold' not '__cold__'.  */
+#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
+# ifndef __SUNPRO_C
+#  define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# else
+#  define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+# endif
+#else
+# define _GL_ATTRIBUTE_COLD
+#endif
+
+#if _GL_HAS_ATTRIBUTE (const)
 # define _GL_ATTRIBUTE_CONST __attribute__ ((__const__))
 #else
-# define _GL_ATTRIBUTE_CONST /* empty */
+# define _GL_ATTRIBUTE_CONST
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_DEPRECATED [[__deprecated__]]
+#elif _GL_HAS_ATTRIBUTE (deprecated)
+# define _GL_ATTRIBUTE_DEPRECATED __attribute__ ((__deprecated__))
+#else
+# define _GL_ATTRIBUTE_DEPRECATED
+#endif
+
+#if _GL_HAS_ATTRIBUTE (error)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__error__ (msg)))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__warning__ (msg)))
+#elif _GL_HAS_ATTRIBUTE (diagnose_if)
+# define _GL_ATTRIBUTE_ERROR(msg) __attribute__ ((__diagnose_if__ (1, msg, "error")))
+# define _GL_ATTRIBUTE_WARNING(msg) __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+#else
+# define _GL_ATTRIBUTE_ERROR(msg)
+# define _GL_ATTRIBUTE_WARNING(msg)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (externally_visible)
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((externally_visible))
+#else
+# define _GL_ATTRIBUTE_EXTERNALLY_VISIBLE
+#endif
+
+/* FALLTHROUGH is special, because it always expands to something.  */
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_FALLTHROUGH [[__fallthrough__]]
+#elif _GL_HAS_ATTRIBUTE (fallthrough)
+# define _GL_ATTRIBUTE_FALLTHROUGH __attribute__ ((__fallthrough__))
+#else
+# define _GL_ATTRIBUTE_FALLTHROUGH ((void) 0)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (format)
+# define _GL_ATTRIBUTE_FORMAT(spec) __attribute__ ((__format__ spec))
+#else
+# define _GL_ATTRIBUTE_FORMAT(spec)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (leaf)
+# define _GL_ATTRIBUTE_LEAF __attribute__ ((__leaf__))
+#else
+# define _GL_ATTRIBUTE_LEAF
+#endif
+
+/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK.  */
+#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
+# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
+#else
+# define _GL_ATTRIBUTE_MAY_ALIAS
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_MAYBE_UNUSED [[__maybe_unused__]]
+#elif _GL_HAS_ATTRIBUTE (unused)
+# define _GL_ATTRIBUTE_MAYBE_UNUSED __attribute__ ((__unused__))
+#else
+# define _GL_ATTRIBUTE_MAYBE_UNUSED
+#endif
+/* Earlier spellings of this macro.  */
+#define _GL_UNUSED _GL_ATTRIBUTE_MAYBE_UNUSED
+#define _UNUSED_PARAMETER_ _GL_ATTRIBUTE_MAYBE_UNUSED
+
+#if _GL_HAS_ATTRIBUTE (malloc)
+# define _GL_ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+#else
+# define _GL_ATTRIBUTE_MALLOC
+#endif
+
+#if 201710L < __STDC_VERSION__
+# define _GL_ATTRIBUTE_NODISCARD [[__nodiscard__]]
+#elif _GL_HAS_ATTRIBUTE (warn_unused_result)
+# define _GL_ATTRIBUTE_NODISCARD __attribute__ ((__warn_unused_result__))
+#else
+# define _GL_ATTRIBUTE_NODISCARD
+#endif
+
+#if _GL_HAS_ATTRIBUTE (noinline)
+# define _GL_ATTRIBUTE_NOINLINE __attribute__ ((__noinline__))
+#else
+# define _GL_ATTRIBUTE_NOINLINE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (nonnull)
+# define _GL_ATTRIBUTE_NONNULL(args) __attribute__ ((__nonnull__ args))
+#else
+# define _GL_ATTRIBUTE_NONNULL(args)
+#endif
+
+#if _GL_HAS_ATTRIBUTE (nonstring)
+# define _GL_ATTRIBUTE_NONSTRING __attribute__ ((__nonstring__))
+#else
+# define _GL_ATTRIBUTE_NONSTRING
+#endif
+
+/* There is no _GL_ATTRIBUTE_NORETURN; use _Noreturn instead.  */
+
+#if _GL_HAS_ATTRIBUTE (nothrow) && !defined __cplusplus
+# define _GL_ATTRIBUTE_NOTHROW __attribute__ ((__nothrow__))
+#else
+# define _GL_ATTRIBUTE_NOTHROW
+#endif
+
+#if _GL_HAS_ATTRIBUTE (packed)
+# define _GL_ATTRIBUTE_PACKED __attribute__ ((__packed__))
+#else
+# define _GL_ATTRIBUTE_PACKED
+#endif
+
+#if _GL_HAS_ATTRIBUTE (pure)
+# define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+#else
+# define _GL_ATTRIBUTE_PURE
+#endif
+
+#if _GL_HAS_ATTRIBUTE (returns_nonnull)
+# define _GL_ATTRIBUTE_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+#else
+# define _GL_ATTRIBUTE_RETURNS_NONNULL
+#endif
+
+#if _GL_HAS_ATTRIBUTE (sentinel)
+# define _GL_ATTRIBUTE_SENTINEL(pos) __attribute__ ((__sentinel__ pos))
+#else
+# define _GL_ATTRIBUTE_SENTINEL(pos)
+#endif
+
+]dnl There is no _GL_ATTRIBUTE_VISIBILITY; see m4/visibility.m4 instead.
+[
+/* To support C++ as well as C, use _GL_UNUSED_LABEL with trailing ';'.  */
+#if !defined __cplusplus || _GL_GNUC_PREREQ (4, 5)
+# define _GL_UNUSED_LABEL _GL_ATTRIBUTE_MAYBE_UNUSED
+#else
+# define _GL_UNUSED_LABEL
 #endif
 ])
+  AH_VERBATIM([async_safe],
+[/* The _GL_ASYNC_SAFE marker should be attached to functions that are
+   signal handlers (for signals other than SIGABRT, SIGPIPE) or can be
+   invoked from such signal handlers.  Such functions have some restrictions:
+     * All functions that it calls should be marked _GL_ASYNC_SAFE as well,
+       or should be listed as async-signal-safe in POSIX
+       <https://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04>
+       section 2.4.3.  Note that malloc(), sprintf(), and fwrite(), in
+       particular, are NOT async-signal-safe.
+     * All memory locations (variables and struct fields) that these functions
+       access must be marked 'volatile'.  This holds for both read and write
+       accesses.  Otherwise the compiler might optimize away stores to and
+       reads from such locations that occur in the program, depending on its
+       data flow analysis.  For example, when the program contains a loop
+       that is intended to inspect a variable set from within a signal handler
+           while (!signal_occurred)
+             ;
+       the compiler is allowed to transform this into an endless loop if the
+       variable 'signal_occurred' is not declared 'volatile'.
+   Additionally, recall that:
+     * A signal handler should not modify errno (except if it is a handler
+       for a fatal signal and ends by raising the same signal again, thus
+       provoking the termination of the process).  If it invokes a function
+       that may clobber errno, it needs to save and restore the value of
+       errno.  */
+#define _GL_ASYNC_SAFE
+])
+  AH_VERBATIM([micro_optimizations],
+[/* _GL_CMP (n1, n2) performs a three-valued comparison on n1 vs. n2, where
+   n1 and n2 are expressions without side effects, that evaluate to real
+   numbers (excluding NaN).
+   It returns
+     1  if n1 > n2
+     0  if n1 == n2
+     -1 if n1 < n2
+   The naïve code   (n1 > n2 ? 1 : n1 < n2 ? -1 : 0)  produces a conditional
+   jump with nearly all GCC versions up to GCC 10.
+   This variant     (n1 < n2 ? -1 : n1 > n2)  produces a conditional with many
+   GCC versions up to GCC 9.
+   The better code  (n1 > n2) - (n1 < n2)  from Hacker's Delight § 2-9
+   avoids conditional jumps in all GCC versions >= 3.4.  */
+#define _GL_CMP(n1, n2) (((n1) > (n2)) - ((n1) < (n2)))
+])
+  dnl Hint which direction to take regarding cross-compilation guesses:
+  dnl When a user installs a program on a platform they are not intimately
+  dnl familiar with, --enable-cross-guesses=conservative is the appropriate
+  dnl choice.  It implements the "If we don't know, assume the worst" principle.
+  dnl However, when an operating system developer (on a platform which is not
+  dnl yet known to gnulib) builds packages for their platform, they want to
+  dnl expose, not hide, possible platform bugs; in this case,
+  dnl --enable-cross-guesses=risky is the appropriate choice.
+  dnl Sets the variables
+  dnl gl_cross_guess_normal    (to be used when 'yes' is good and 'no' is bad),
+  dnl gl_cross_guess_inverted  (to be used when 'no' is good and 'yes' is bad).
+  AC_ARG_ENABLE([cross-guesses],
+    [AS_HELP_STRING([--enable-cross-guesses={conservative|risky}],
+       [specify policy for cross-compilation guesses])],
+    [if test "x$enableval" != xconservative && test "x$enableval" != xrisky; then
+       AC_MSG_WARN([invalid argument supplied to --enable-cross-guesses])
+       enableval=conservative
+     fi
+     gl_cross_guesses="$enableval"],
+    [gl_cross_guesses=conservative])
+  if test $gl_cross_guesses = risky; then
+    gl_cross_guess_normal="guessing yes"
+    gl_cross_guess_inverted="guessing no"
+  else
+    gl_cross_guess_normal="guessing no"
+    gl_cross_guess_inverted="guessing yes"
+  fi
   dnl Preparation for running test programs:
   dnl Tell glibc to write diagnostics from -D_FORTIFY_SOURCE=2 to stderr, not
   dnl to /dev/tty, so they can be redirected to log files.  Such diagnostics
@@ -81,6 +357,16 @@ AC_DEFUN([gl_COMMON_BODY], [
   export LIBC_FATAL_STDERR_
 ])
 
+# gl_MODULE_INDICATOR_INIT_VARIABLE([variablename])
+# gl_MODULE_INDICATOR_INIT_VARIABLE([variablename], [initialvalue])
+# initializes the shell variable that indicates the presence of the given module
+# as a C preprocessor expression.
+AC_DEFUN([gl_MODULE_INDICATOR_INIT_VARIABLE],
+[
+  GL_MODULE_INDICATOR_PREFIX[]_[$1]=m4_if([$2], , [0], [$2])
+  AC_SUBST(GL_MODULE_INDICATOR_PREFIX[]_[$1])
+])
+
 # gl_MODULE_INDICATOR_CONDITION
 # expands to a C preprocessor expression that evaluates to 1 or 0, depending
 # whether a gnulib module that has been requested shall be considered present
@@ -93,9 +379,9 @@ m4_define([gl_MODULE_INDICATOR_CONDITION], [1])
 AC_DEFUN([gl_MODULE_INDICATOR_SET_VARIABLE],
 [
   gl_MODULE_INDICATOR_SET_VARIABLE_AUX(
-    [GNULIB_[]m4_translit([[$1]],
-                          [abcdefghijklmnopqrstuvwxyz./-],
-                          [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
+    [GL_MODULE_INDICATOR_PREFIX[]_GNULIB_[]m4_translit([[$1]],
+                                                       [abcdefghijklmnopqrstuvwxyz./-],
+                                                       [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])],
     [gl_MODULE_INDICATOR_CONDITION])
 ])
 
@@ -207,42 +493,20 @@ AC_DEFUN([gl_FEATURES_H],
   AC_SUBST([HAVE_FEATURES_H])
 ])
 
-# m4_foreach_w
-# is a backport of autoconf-2.59c's m4_foreach_w.
-# Remove this macro when we can assume autoconf >= 2.60.
-m4_ifndef([m4_foreach_w],
-  [m4_define([m4_foreach_w],
-    [m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])])])
-
-# AS_VAR_IF(VAR, VALUE, [IF-MATCH], [IF-NOT-MATCH])
-# ----------------------------------------------------
-# Backport of autoconf-2.63b's macro.
-# Remove this macro when we can assume autoconf >= 2.64.
-m4_ifndef([AS_VAR_IF],
-[m4_define([AS_VAR_IF],
-[AS_IF([test x"AS_VAR_GET([$1])" = x""$2], [$3], [$4])])])
-
 # gl_PROG_CC_C99
 # Modifies the value of the shell variable CC in an attempt to make $CC
 # understand ISO C99 source code.
-# This is like AC_PROG_CC_C99, except that
-# - AC_PROG_CC_C99 did not exist in Autoconf versions < 2.60,
-# - AC_PROG_CC_C99 does not mix well with AC_PROG_CC_STDC
-#   <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00367.html>,
-#   but many more packages use AC_PROG_CC_STDC than AC_PROG_CC_C99
-#   <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00441.html>.
-# Remaining problems:
-# - When AC_PROG_CC_STDC is invoked twice, it adds the C99 enabling options
-#   to CC twice
-#   <http://lists.gnu.org/archive/html/bug-gnulib/2011-09/msg00431.html>.
-# - AC_PROG_CC_STDC is likely to change now that C11 is an ISO standard.
 AC_DEFUN([gl_PROG_CC_C99],
 [
-  dnl Change that version number to the minimum Autoconf version that supports
-  dnl mixing AC_PROG_CC_C99 calls with AC_PROG_CC_STDC calls.
-  m4_version_prereq([9.0],
-    [AC_REQUIRE([AC_PROG_CC_C99])],
-    [AC_REQUIRE([AC_PROG_CC_STDC])])
+  dnl Just use AC_PROG_CC_C99.
+  dnl When AC_PROG_CC_C99 and AC_PROG_CC_STDC are used together, the substituted
+  dnl value of CC will contain the C99 enabling options twice. But this is only
+  dnl a cosmetic problem.
+  dnl With Autoconf >= 2.70, use AC_PROG_CC since it implies AC_PROG_CC_C99;
+  dnl this avoids a "warning: The macro `AC_PROG_CC_C99' is obsolete."
+  m4_version_prereq([2.70],
+    [AC_REQUIRE([AC_PROG_CC])],
+    [AC_REQUIRE([AC_PROG_CC_C99])])
 ])
 
 # gl_PROG_AR_RANLIB
@@ -256,7 +520,8 @@ AC_DEFUN([gl_PROG_AR_RANLIB],
   dnl library formats. In particular, the GNU binutils programs ar and ranlib
   dnl produce libraries that work only with gcc, not with cc.
   AC_REQUIRE([AC_PROG_CC])
-  AC_BEFORE([$0], [AM_PROG_AR])
+  dnl The '][' hides this use from 'aclocal'.
+  AC_BEFORE([$0], [A][M_PROG_AR])
   AC_CACHE_CHECK([for Minix Amsterdam compiler], [gl_cv_c_amsterdam_compiler],
     [
       AC_EGREP_CPP([Amsterdam],
@@ -288,7 +553,9 @@ Amsterdam
     dnl __ACK__.  It may seem like its easier to avoid calling the macro here,
     dnl but we need to AC_SUBST both AR/ARFLAGS (thus those must have some good
     dnl default value and automake should usually know them).
-    m4_ifdef([AM_PROG_AR], [AM_PROG_AR], [:])
+    dnl
+    dnl The '][' hides this use from 'aclocal'.
+    m4_ifdef([A][M_PROG_AR], [A][M_PROG_AR], [:])
   fi
 
   dnl In case the code above has not helped with setting AR/ARFLAGS, use
@@ -312,48 +579,29 @@ Amsterdam
   AC_SUBST([RANLIB])
 ])
 
-# AC_PROG_MKDIR_P
-# is a backport of autoconf-2.60's AC_PROG_MKDIR_P, with a fix
-# for interoperability with automake-1.9.6 from autoconf-2.62.
-# Remove this macro when we can assume autoconf >= 2.62 or
-# autoconf >= 2.60 && automake >= 1.10.
-# AC_AUTOCONF_VERSION was introduced in 2.62, so use that as the witness.
-m4_ifndef([AC_AUTOCONF_VERSION],[
-m4_ifdef([AC_PROG_MKDIR_P], [
-  dnl For automake-1.9.6 && autoconf < 2.62: Ensure MKDIR_P is AC_SUBSTed.
-  m4_define([AC_PROG_MKDIR_P],
-    m4_defn([AC_PROG_MKDIR_P])[
-    AC_SUBST([MKDIR_P])])], [
-  dnl For autoconf < 2.60: Backport of AC_PROG_MKDIR_P.
-  AC_DEFUN_ONCE([AC_PROG_MKDIR_P],
-    [AC_REQUIRE([AM_PROG_MKDIR_P])dnl defined by automake
-     MKDIR_P='$(mkdir_p)'
-     AC_SUBST([MKDIR_P])])])
-])
-
 # AC_C_RESTRICT
-# This definition is copied from post-2.69 Autoconf and overrides the
-# AC_C_RESTRICT macro from autoconf 2.60..2.69.  It can be removed
-# once autoconf >= 2.70 can be assumed.  It's painful to check version
-# numbers, and in practice this macro is more up-to-date than Autoconf
-# is, so override Autoconf unconditionally.
+# This definition is copied from post-2.70 Autoconf and overrides the
+# AC_C_RESTRICT macro from autoconf 2.60..2.70.
+m4_version_prereq([2.70.1], [], [
 AC_DEFUN([AC_C_RESTRICT],
 [AC_CACHE_CHECK([for C/C++ restrict keyword], [ac_cv_c_restrict],
   [ac_cv_c_restrict=no
-   # The order here caters to the fact that C++ does not require restrict.
-   for ac_kw in __restrict __restrict__ _Restrict restrict; do
+   # Put '__restrict__' first, to avoid problems with glibc and non-GCC; see:
+   # https://lists.gnu.org/archive/html/bug-autoconf/2016-02/msg00006.html
+   # Put 'restrict' last, because C++ lacks it.
+   for ac_kw in __restrict__ __restrict _Restrict restrict; do
      AC_COMPILE_IFELSE(
       [AC_LANG_PROGRAM(
-        [[typedef int *int_ptr;
-          int foo (int_ptr $ac_kw ip) { return ip[0]; }
-          int bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
-          int bar (int ip[$ac_kw]) { return ip[0]; }
-        ]],
-        [[int s[1];
-          int *$ac_kw t = s;
-          t[0] = 0;
-          return foo (t) + bar (t);
-        ]])],
+         [[typedef int *int_ptr;
+           int foo (int_ptr $ac_kw ip) { return ip[0]; }
+           int bar (int [$ac_kw]); /* Catch GCC bug 14050.  */
+           int bar (int ip[$ac_kw]) { return ip[0]; }
+         ]],
+         [[int s[1];
+           int *$ac_kw t = s;
+           t[0] = 0;
+           return foo (t) + bar (t);
+         ]])],
       [ac_cv_c_restrict=$ac_kw])
      test "$ac_cv_c_restrict" != no && break
    done
@@ -361,14 +609,15 @@ AC_DEFUN([AC_C_RESTRICT],
  AH_VERBATIM([restrict],
 [/* Define to the equivalent of the C99 'restrict' keyword, or to
    nothing if this is not supported.  Do not define if restrict is
-   supported directly.  */
+   supported only directly.  */
 #undef restrict
-/* Work around a bug in Sun C++: it does not support _Restrict or
-   __restrict__, even though the corresponding Sun C compiler ends up with
-   "#define restrict _Restrict" or "#define restrict __restrict__" in the
-   previous line.  Perhaps some future version of Sun C++ will work with
-   restrict; if so, hopefully it defines __RESTRICT like Sun C does.  */
-#if defined __SUNPRO_CC && !defined __RESTRICT
+/* Work around a bug in older versions of Sun C++, which did not
+   #define __restrict__ or support _Restrict or __restrict__
+   even though the corresponding Sun C compiler ended up with
+   "#define restrict _Restrict" or "#define restrict __restrict__"
+   in the previous line.  This workaround can be removed once
+   we assume Oracle Developer Studio 12.5 (2016) or later.  */
+#if defined __SUNPRO_CC && !defined __RESTRICT && !defined __restrict__
 # define _Restrict
 # define __restrict__
 #endif])
@@ -378,6 +627,7 @@ AC_DEFUN([AC_C_RESTRICT],
    *)  AC_DEFINE_UNQUOTED([restrict], [$ac_cv_c_restrict]) ;;
  esac
 ])# AC_C_RESTRICT
+])
 
 # gl_BIGENDIAN
 # is like AC_C_BIGENDIAN, except that it can be AC_REQUIREd.
@@ -388,6 +638,22 @@ AC_DEFUN([gl_BIGENDIAN],
   AC_C_BIGENDIAN
 ])
 
+# A temporary file descriptor.
+# Must be less than 10, because dash 0.5.8 does not support redirections
+# with multi-digit file descriptors.
+m4_define([GL_TMP_FD], 9)
+
+# gl_SILENT(command)
+# executes command, but without the normal configure output.
+# This is useful when you want to invoke AC_CACHE_CHECK (or AC_CHECK_FUNC etc.)
+# inside another AC_CACHE_CHECK.
+AC_DEFUN([gl_SILENT],
+[
+  exec GL_TMP_FD>&AS_MESSAGE_FD AS_MESSAGE_FD>/dev/null
+  $1
+  exec AS_MESSAGE_FD>&GL_TMP_FD GL_TMP_FD>&-
+])
+
 # gl_CACHE_VAL_SILENT(cache-id, command-to-set-it)
 # is like AC_CACHE_VAL(cache-id, command-to-set-it), except that it does not
 # output a spurious "(cached)" mark in the midst of other configure output.
@@ -395,68 +661,77 @@ AC_DEFUN([gl_BIGENDIAN],
 # by an AC_MSG_CHECKING/AC_MSG_RESULT pair.
 AC_DEFUN([gl_CACHE_VAL_SILENT],
 [
-  saved_as_echo_n="$as_echo_n"
-  as_echo_n=':'
-  AC_CACHE_VAL([$1], [$2])
-  as_echo_n="$saved_as_echo_n"
+  gl_SILENT([
+    AC_CACHE_VAL([$1], [$2])
+  ])
 ])
 
-# AS_VAR_COPY was added in autoconf 2.63b
-m4_define_default([AS_VAR_COPY],
-[AS_LITERAL_IF([$1[]$2], [$1=$$2], [eval $1=\$$2])])
-
-# AC_PROG_SED was added in autoconf 2.59b
-m4_ifndef([AC_PROG_SED],
-[AC_DEFUN([AC_PROG_SED],
-[AC_CACHE_CHECK([for a sed that does not truncate output], ac_cv_path_SED,
-    [dnl ac_script should not contain more than 99 commands (for HP-UX sed),
-     dnl but more than about 7000 bytes, to catch a limit in Solaris 8 /usr/ucb/sed.
-     ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
-     for ac_i in 1 2 3 4 5 6 7; do
-       ac_script="$ac_script$as_nl$ac_script"
-     done
-     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
-     AS_UNSET([ac_script])
-     if test -z "$SED"; then
-       ac_path_SED_found=false
-       _AS_PATH_WALK([], [
-         for ac_prog in sed gsed; do
-           for ac_exec_ext in '' $ac_executable_extensions; do
-             ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
-             AS_EXECUTABLE_P(["$ac_path_SED"]) || continue
-             case `"$ac_path_SED" --version 2>&1` in
-               *GNU*) ac_cv_path_SED=$ac_path_SED ac_path_SED_found=:;;
-               *)
-                 ac_count=0
-                 _AS_ECHO_N([0123456789]) >conftest.in
-                 while :
-                 do
-                   cat conftest.in conftest.in >conftest.tmp
-                   mv conftest.tmp conftest.in
-                   cp conftest.in conftest.nl
-                   echo >> conftest.nl
-                   "$ac_path_SED" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
-                   diff conftest.out conftest.nl >/dev/null 2>&1 || break
-                   ac_count=`expr $ac_count + 1`
-                   if test $ac_count -gt ${ac_path_SED_max-0}; then
-                     # Best so far, but keep looking for better
-                     ac_cv_path_SED=$ac_path_SED
-                     ac_path_SED_max=$ac_count
-                   fi
-                   test $ac_count -gt 10 && break
-                 done
-                 rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-             esac
-             $ac_path_SED_found && break 3
-           done
-         done])
-       if test -z "$ac_cv_path_SED"; then
-         AC_ERROR([no acceptable sed could be found in \$PATH])
-       fi
-     else
-       ac_cv_path_SED=$SED
-     fi
- SED="$ac_cv_path_SED"
- AC_SUBST([SED])dnl
- rm -f conftest.sed
-])])])
+dnl Expands to some code for use in .c programs that, on native Windows, defines
+dnl the Microsoft deprecated alias function names to the underscore-prefixed
+dnl actual function names. With this macro, these function names are available
+dnl without linking with '-loldnames' and without generating warnings.
+dnl Usage: Use it after all system header files are included.
+dnl          #include <...>
+dnl          #include <...>
+dnl          ]GL_MDA_DEFINES[
+dnl          ...
+AC_DEFUN([GL_MDA_DEFINES],[
+AC_REQUIRE([_GL_MDA_DEFINES])
+[$gl_mda_defines]
+])
+AC_DEFUN([_GL_MDA_DEFINES],
+[gl_mda_defines='
+#if defined _WIN32 && !defined __CYGWIN__
+#define access    _access
+#define chdir     _chdir
+#define chmod     _chmod
+#define close     _close
+#define creat     _creat
+#define dup       _dup
+#define dup2      _dup2
+#define ecvt      _ecvt
+#define execl     _execl
+#define execle    _execle
+#define execlp    _execlp
+#define execv     _execv
+#define execve    _execve
+#define execvp    _execvp
+#define execvpe   _execvpe
+#define fcloseall _fcloseall
+#define fcvt      _fcvt
+#define fdopen    _fdopen
+#define fileno    _fileno
+#define gcvt      _gcvt
+#define getcwd    _getcwd
+#define getpid    _getpid
+#define getw      _getw
+#define isatty    _isatty
+#define j0        _j0
+#define j1        _j1
+#define jn        _jn
+#define lfind     _lfind
+#define lsearch   _lsearch
+#define lseek     _lseek
+#define memccpy   _memccpy
+#define mkdir     _mkdir
+#define mktemp    _mktemp
+#define open      _open
+#define putenv    _putenv
+#define putw      _putw
+#define read      _read
+#define rmdir     _rmdir
+#define strdup    _strdup
+#define swab      _swab
+#define tempnam   _tempnam
+#define tzset     _tzset
+#define umask     _umask
+#define unlink    _unlink
+#define utime     _utime
+#define wcsdup    _wcsdup
+#define write     _write
+#define y0        _y0
+#define y1        _y1
+#define yn        _yn
+#endif
+'
+])
index 037d9aa..fccda9a 100644 (file)
@@ -1,5 +1,5 @@
 # DO NOT EDIT! GENERATED AUTOMATICALLY!
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+# along with this file.  If not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License,
 # this file may be distributed as part of a program that
@@ -44,23 +44,42 @@ AC_DEFUN([M4_EARLY],
 
   AC_REQUIRE([AM_PROG_CC_C_O])
   # Code from module absolute-header:
+  # Code from module accept:
+  # Code from module accept-tests:
+  # Code from module access:
+  # Code from module access-tests:
   # Code from module alignof:
   # Code from module alignof-tests:
+  # Code from module alloca:
   # Code from module alloca-opt:
   # Code from module alloca-opt-tests:
   # Code from module announce-gen:
   # Code from module ansi-c++-opt:
+  AC_REQUIRE([gl_ANSI_CXX])
+  # Code from module arpa_inet:
+  # Code from module arpa_inet-c++-tests:
+  # Code from module arpa_inet-tests:
   # Code from module array-list:
   # Code from module array-list-tests:
   # Code from module array-oset:
   # Code from module array-oset-tests:
   # Code from module assert:
+  # Code from module assure:
+  # Code from module asyncsafe-spin:
+  # Code from module asyncsafe-spin-tests:
+  # Code from module at-internal:
+  # Code from module attribute:
   # Code from module autobuild:
   AB_INIT
   # Code from module avltree-oset:
   # Code from module avltree-oset-tests:
+  # Code from module basename-lgpl:
   # Code from module binary-io:
   # Code from module binary-io-tests:
+  # Code from module bind:
+  # Code from module bind-tests:
+  # Code from module bitrotate:
+  # Code from module bitrotate-tests:
   # Code from module btowc:
   # Code from module btowc-tests:
   # Code from module builtin-expect:
@@ -71,11 +90,20 @@ AC_DEFUN([M4_EARLY],
   # Code from module c-strcase:
   # Code from module c-strcase-tests:
   # Code from module c-strcaseeq:
+  # Code from module c99:
+  # Code from module calloc-gnu:
+  # Code from module calloc-gnu-tests:
+  # Code from module calloc-posix:
+  # Code from module canonicalize:
   # Code from module canonicalize-lgpl:
   # Code from module canonicalize-lgpl-tests:
+  # Code from module canonicalize-tests:
   # Code from module chdir:
+  # Code from module chdir-long:
   # Code from module chdir-tests:
   # Code from module clean-temp:
+  # Code from module clean-temp-simple:
+  # Code from module clock-time:
   # Code from module cloexec:
   # Code from module cloexec-tests:
   # Code from module close:
@@ -85,10 +113,17 @@ AC_DEFUN([M4_EARLY],
   # Code from module closein:
   # Code from module closein-tests:
   # Code from module closeout:
+  # Code from module concat-filename:
   # Code from module config-h:
   # Code from module configmake:
+  # Code from module connect:
+  # Code from module connect-tests:
+  # Code from module creat:
+  # Code from module creat-tests:
   # Code from module ctype:
+  # Code from module ctype-c++-tests:
   # Code from module ctype-tests:
+  # Code from module d-ino:
   # Code from module dirent:
   # Code from module dirent-c++-tests:
   # Code from module dirent-tests:
@@ -97,22 +132,30 @@ AC_DEFUN([M4_EARLY],
   # Code from module dirname-lgpl:
   # Code from module dirname-tests:
   # Code from module do-release-commit-and-tag:
-  # Code from module dosname:
   # Code from module double-slash-root:
   # Code from module dup:
   # Code from module dup-tests:
   # Code from module dup2:
   # Code from module dup2-tests:
+  # Code from module dynarray:
+  # Code from module dynarray-tests:
+  # Code from module eloop-threshold:
   # Code from module environ:
   # Code from module environ-tests:
   # Code from module errno:
+  # Code from module errno-c++-tests:
   # Code from module errno-tests:
   # Code from module error:
   # Code from module execute:
+  # Code from module execute-tests:
   # Code from module exitfail:
+  # Code from module explicit_bzero:
+  # Code from module explicit_bzero-tests:
   # Code from module extensions:
   # Code from module extern-inline:
   # Code from module fatal-signal:
+  # Code from module fchdir:
+  # Code from module fchdir-tests:
   # Code from module fclose:
   # Code from module fclose-tests:
   # Code from module fcntl:
@@ -125,18 +168,26 @@ AC_DEFUN([M4_EARLY],
   # Code from module fdl-1.3:
   # Code from module fdopen:
   # Code from module fdopen-tests:
+  # Code from module fdopendir:
+  # Code from module fdopendir-tests:
   # Code from module fflush:
-  AC_REQUIRE([AC_FUNC_FSEEKO])
+  AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
   # Code from module fflush-tests:
   # Code from module fgetc-tests:
+  # Code from module file-set:
   # Code from module filename:
   # Code from module filenamecat:
   # Code from module filenamecat-lgpl:
   # Code from module filenamecat-tests:
+  # Code from module findprog:
+  # Code from module findprog-in:
   # Code from module flexmember:
   # Code from module float:
+  # Code from module float-c++-tests:
   # Code from module float-tests:
   # Code from module fopen:
+  # Code from module fopen-gnu:
+  # Code from module fopen-gnu-tests:
   # Code from module fopen-safer:
   # Code from module fopen-safer-tests:
   # Code from module fopen-tests:
@@ -153,6 +204,10 @@ AC_DEFUN([M4_EARLY],
   # Code from module freadahead-tests:
   # Code from module freading:
   # Code from module freading-tests:
+  # Code from module free-posix:
+  # Code from module free-posix-tests:
+  # Code from module freopen:
+  # Code from module freopen-tests:
   # Code from module frexp-nolibm:
   # Code from module frexp-nolibm-tests:
   # Code from module frexpl-nolibm:
@@ -160,28 +215,35 @@ AC_DEFUN([M4_EARLY],
   # Code from module fseek:
   # Code from module fseek-tests:
   # Code from module fseeko:
-  AC_REQUIRE([AC_FUNC_FSEEKO])
+  AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
   # Code from module fseeko-tests:
   # Code from module fstat:
   # Code from module fstat-tests:
+  # Code from module fstatat:
+  # Code from module fstatat-tests:
   # Code from module ftell:
   # Code from module ftell-tests:
   # Code from module ftello:
-  AC_REQUIRE([AC_FUNC_FSEEKO])
+  AC_REQUIRE([gl_SET_LARGEFILE_SOURCE])
   # Code from module ftello-tests:
+  # Code from module ftruncate:
+  # Code from module ftruncate-tests:
   # Code from module fwrite-tests:
   # Code from module gendocs:
+  # Code from module getcwd:
   # Code from module getcwd-lgpl:
   # Code from module getcwd-lgpl-tests:
+  # Code from module getcwd-tests:
   # Code from module getdtablesize:
   # Code from module getdtablesize-tests:
   # Code from module getopt-gnu:
   # Code from module getopt-gnu-tests:
   # Code from module getopt-posix:
-  # Code from module getopt-posix-tests:
   # Code from module getpagesize:
   # Code from module getprogname:
   # Code from module getprogname-tests:
+  # Code from module getrandom:
+  # Code from module getrandom-tests:
   # Code from module gettext-h:
   # Code from module gettimeofday:
   # Code from module gettimeofday-tests:
@@ -190,17 +252,39 @@ AC_DEFUN([M4_EARLY],
   # Code from module gnu-web-doc-update:
   # Code from module gnumakefile:
   # Code from module gnupload:
+  # Code from module gperf:
   # Code from module gpl-3.0:
   # Code from module hard-locale:
+  # Code from module hard-locale-tests:
+  # Code from module hash:
+  # Code from module hash-pjw:
+  # Code from module hash-tests:
+  # Code from module hash-triple-simple:
   # Code from module havelib:
+  # Code from module host-cpu-c-abi:
+  # Code from module iconv:
+  # Code from module iconv-h:
+  # Code from module iconv-h-c++-tests:
+  # Code from module iconv-h-tests:
+  # Code from module iconv-tests:
+  # Code from module iconv_open:
+  # Code from module idx:
   # Code from module ignore-value:
   # Code from module ignore-value-tests:
   # Code from module include_next:
+  # Code from module inet_pton:
+  # Code from module inet_pton-tests:
+  # Code from module inline:
   # Code from module intprops:
   # Code from module intprops-tests:
+  # Code from module inttostr:
+  # Code from module inttostr-tests:
   # Code from module inttypes:
+  # Code from module inttypes-c++-tests:
   # Code from module inttypes-incomplete:
   # Code from module inttypes-tests:
+  # Code from module ioctl:
+  # Code from module ioctl-tests:
   # Code from module isblank:
   # Code from module isblank-tests:
   # Code from module isnand-nolibm:
@@ -209,20 +293,32 @@ AC_DEFUN([M4_EARLY],
   # Code from module isnanf-nolibm-tests:
   # Code from module isnanl-nolibm:
   # Code from module isnanl-nolibm-tests:
+  # Code from module iswblank:
+  # Code from module iswblank-tests:
+  # Code from module iswdigit:
+  # Code from module iswdigit-tests:
+  # Code from module iswxdigit:
+  # Code from module iswxdigit-tests:
   # Code from module langinfo:
   # Code from module langinfo-c++-tests:
   # Code from module langinfo-tests:
   # Code from module largefile:
   AC_REQUIRE([AC_SYS_LARGEFILE])
-  # Code from module libsigsegv:
+  # Code from module libc-config:
   # Code from module limits-h:
+  # Code from module limits-h-c++-tests:
   # Code from module limits-h-tests:
   # Code from module link:
   # Code from module link-tests:
+  # Code from module linked-list:
+  # Code from module linked-list-tests:
   # Code from module linkedhash-list:
   # Code from module linkedhash-list-tests:
   # Code from module list:
+  # Code from module listen:
+  # Code from module listen-tests:
   # Code from module localcharset:
+  # Code from module localcharset-tests:
   # Code from module locale:
   # Code from module locale-c++-tests:
   # Code from module locale-tests:
@@ -236,6 +332,8 @@ AC_DEFUN([M4_EARLY],
   # Code from module lstat:
   # Code from module lstat-tests:
   # Code from module maintainer-makefile:
+  # Code from module malloc-gnu:
+  # Code from module malloc-gnu-tests:
   # Code from module malloc-posix:
   # Code from module malloca:
   # Code from module malloca-tests:
@@ -243,35 +341,62 @@ AC_DEFUN([M4_EARLY],
   # Code from module math:
   # Code from module math-c++-tests:
   # Code from module math-tests:
+  # Code from module mbchar:
+  # Code from module mbiter:
   # Code from module mbrtowc:
   # Code from module mbrtowc-tests:
   # Code from module mbsinit:
   # Code from module mbsinit-tests:
+  # Code from module mbslen:
+  # Code from module mbsstr:
+  # Code from module mbsstr-tests:
   # Code from module mbtowc:
+  # Code from module mbuiter:
   # Code from module memchr:
   # Code from module memchr-tests:
   # Code from module memchr2:
   # Code from module memchr2-tests:
+  # Code from module mempcpy:
+  # Code from module memrchr:
+  # Code from module memrchr-tests:
   # Code from module minmax:
+  # Code from module mkdir:
+  # Code from module mkdir-tests:
   # Code from module mkdtemp:
   # Code from module mkstemp:
   # Code from module msvc-inval:
   # Code from module msvc-nothrow:
   # Code from module multiarch:
+  # Code from module nanosleep:
+  # Code from module nanosleep-tests:
+  # Code from module netinet_in:
+  # Code from module netinet_in-tests:
   # Code from module nl_langinfo:
   # Code from module nl_langinfo-tests:
   # Code from module nocrash:
   # Code from module obstack:
   # Code from module open:
   # Code from module open-tests:
+  # Code from module openat:
+  # Code from module openat-die:
+  # Code from module openat-h:
+  # Code from module openat-tests:
   # Code from module opendir:
   # Code from module oset:
   # Code from module pathmax:
   # Code from module pathmax-tests:
+  # Code from module perror:
+  # Code from module perror-tests:
+  # Code from module pipe-posix:
+  # Code from module pipe-posix-tests:
   # Code from module pipe2:
   # Code from module pipe2-safer:
   # Code from module pipe2-tests:
+  # Code from module posix_spawn:
   # Code from module posix_spawn-internal:
+  # Code from module posix_spawn-tests:
+  # Code from module posix_spawn_file_actions_addchdir:
+  # Code from module posix_spawn_file_actions_addchdir-tests:
   # Code from module posix_spawn_file_actions_addclose:
   # Code from module posix_spawn_file_actions_addclose-tests:
   # Code from module posix_spawn_file_actions_adddup2:
@@ -283,6 +408,7 @@ AC_DEFUN([M4_EARLY],
   # Code from module posix_spawnattr_destroy:
   # Code from module posix_spawnattr_init:
   # Code from module posix_spawnattr_setflags:
+  # Code from module posix_spawnattr_setpgroup:
   # Code from module posix_spawnattr_setsigmask:
   # Code from module posix_spawnp:
   # Code from module posix_spawnp-tests:
@@ -292,6 +418,15 @@ AC_DEFUN([M4_EARLY],
   # Code from module printf-frexpl-tests:
   # Code from module printf-safe:
   # Code from module progname:
+  # Code from module propername:
+  # Code from module pthread-h:
+  gl_ANYTHREADLIB_EARLY
+  # Code from module pthread-h-c++-tests:
+  # Code from module pthread-h-tests:
+  # Code from module pthread-thread:
+  # Code from module pthread-thread-tests:
+  # Code from module pthread_sigmask:
+  # Code from module pthread_sigmask-tests:
   # Code from module putenv:
   # Code from module quotearg:
   # Code from module quotearg-simple:
@@ -300,23 +435,43 @@ AC_DEFUN([M4_EARLY],
   # Code from module raise-tests:
   # Code from module rawmemchr:
   # Code from module rawmemchr-tests:
+  # Code from module read-file:
+  # Code from module read-file-tests:
   # Code from module readdir:
   # Code from module readlink:
   # Code from module readlink-tests:
+  # Code from module realloc-gnu:
+  # Code from module realloc-gnu-tests:
+  # Code from module realloc-posix:
+  # Code from module reallocarray:
+  # Code from module reallocarray-tests:
   # Code from module regex:
   # Code from module regex-tests:
   # Code from module rename:
   # Code from module rename-tests:
+  # Code from module rewinddir:
   # Code from module rmdir:
   # Code from module rmdir-tests:
+  # Code from module root-uid:
   # Code from module same-inode:
+  # Code from module save-cwd:
   # Code from module sched:
   # Code from module sched-tests:
+  # Code from module sched_yield:
+  # Code from module scratch_buffer:
+  # Code from module scratch_buffer-tests:
   # Code from module secure_getenv:
+  # Code from module select:
+  # Code from module select-tests:
   # Code from module setenv:
   # Code from module setenv-tests:
   # Code from module setlocale:
+  # Code from module setlocale-null:
+  # Code from module setlocale-null-tests:
   # Code from module setlocale-tests:
+  # Code from module setsockopt:
+  # Code from module setsockopt-tests:
+  # Code from module sh-filename:
   # Code from module sigaction:
   # Code from module sigaction-tests:
   # Code from module signal-h:
@@ -328,6 +483,8 @@ AC_DEFUN([M4_EARLY],
   # Code from module sigpipe-tests:
   # Code from module sigprocmask:
   # Code from module sigprocmask-tests:
+  # Code from module sigsegv:
+  # Code from module sigsegv-tests:
   # Code from module size_max:
   # Code from module sleep:
   # Code from module sleep-tests:
@@ -338,6 +495,13 @@ AC_DEFUN([M4_EARLY],
   # Code from module snippet/warn-on-use:
   # Code from module snprintf:
   # Code from module snprintf-tests:
+  # Code from module socket:
+  # Code from module socketlib:
+  # Code from module sockets:
+  # Code from module sockets-tests:
+  # Code from module socklen:
+  # Code from module sparcv8+:
+  gl_SPARC_V8PLUS
   # Code from module spawn:
   # Code from module spawn-c++-tests:
   # Code from module spawn-pipe:
@@ -346,19 +510,24 @@ AC_DEFUN([M4_EARLY],
   # Code from module ssize_t:
   # Code from module stat:
   # Code from module stat-tests:
+  # Code from module stat-time:
+  # Code from module stat-time-tests:
+  # Code from module std-gnu11:
   # Code from module stdalign:
   # Code from module stdalign-tests:
   # Code from module stdarg:
   dnl Some compilers (e.g., AIX 5.3 cc) need to be in c99 mode
-  dnl for the builtin va_copy to work.  With Autoconf 2.60 or later,
-  dnl gl_PROG_CC_C99 arranges for this.  With older Autoconf gl_PROG_CC_C99
-  dnl shouldn't hurt, though installers are on their own to set c99 mode.
+  dnl for the builtin va_copy to work.  gl_PROG_CC_C99 arranges for this.
   gl_PROG_CC_C99
+  # Code from module stdarg-tests:
   # Code from module stdbool:
+  # Code from module stdbool-c++-tests:
   # Code from module stdbool-tests:
   # Code from module stddef:
+  # Code from module stddef-c++-tests:
   # Code from module stddef-tests:
   # Code from module stdint:
+  # Code from module stdint-c++-tests:
   # Code from module stdint-tests:
   # Code from module stdio:
   # Code from module stdio-c++-tests:
@@ -367,6 +536,7 @@ AC_DEFUN([M4_EARLY],
   # Code from module stdlib-c++-tests:
   # Code from module stdlib-safer:
   # Code from module stdlib-tests:
+  # Code from module stpcpy:
   # Code from module strchrnul:
   # Code from module strchrnul-tests:
   # Code from module strdup-posix:
@@ -374,12 +544,17 @@ AC_DEFUN([M4_EARLY],
   # Code from module strerror:
   # Code from module strerror-override:
   # Code from module strerror-tests:
+  # Code from module strerror_r-posix:
+  # Code from module strerror_r-posix-tests:
+  # Code from module striconv:
+  # Code from module striconv-tests:
   # Code from module string:
   # Code from module string-c++-tests:
   # Code from module string-tests:
   # Code from module strndup:
   # Code from module strnlen:
   # Code from module strnlen-tests:
+  # Code from module strnlen1:
   # Code from module strsignal:
   # Code from module strsignal-tests:
   # Code from module strstr:
@@ -389,6 +564,18 @@ AC_DEFUN([M4_EARLY],
   # Code from module strtod-tests:
   # Code from module symlink:
   # Code from module symlink-tests:
+  # Code from module sys_ioctl:
+  # Code from module sys_ioctl-c++-tests:
+  # Code from module sys_ioctl-tests:
+  # Code from module sys_random:
+  # Code from module sys_random-c++-tests:
+  # Code from module sys_random-tests:
+  # Code from module sys_select:
+  # Code from module sys_select-c++-tests:
+  # Code from module sys_select-tests:
+  # Code from module sys_socket:
+  # Code from module sys_socket-c++-tests:
+  # Code from module sys_socket-tests:
   # Code from module sys_stat:
   # Code from module sys_stat-c++-tests:
   # Code from module sys_stat-tests:
@@ -398,12 +585,17 @@ AC_DEFUN([M4_EARLY],
   # Code from module sys_types:
   # Code from module sys_types-c++-tests:
   # Code from module sys_types-tests:
+  # Code from module sys_uio:
+  # Code from module sys_uio-tests:
   # Code from module sys_wait:
   # Code from module sys_wait-c++-tests:
   # Code from module sys_wait-tests:
   # Code from module tempname:
   # Code from module test-framework-sh:
   # Code from module test-framework-sh-tests:
+  # Code from module thread:
+  # Code from module thread-optim:
+  # Code from module thread-tests:
   # Code from module threadlib:
   gl_THREADLIB_EARLY
   # Code from module time:
@@ -411,12 +603,23 @@ AC_DEFUN([M4_EARLY],
   # Code from module time-tests:
   # Code from module tls:
   # Code from module tmpdir:
+  # Code from module trim:
   # Code from module unistd:
   # Code from module unistd-c++-tests:
   # Code from module unistd-safer:
   # Code from module unistd-safer-tests:
   # Code from module unistd-tests:
+  # Code from module unistr/base:
+  # Code from module unistr/u8-mbtoucr:
+  # Code from module unistr/u8-mbtoucr-tests:
+  # Code from module unistr/u8-uctomb:
+  # Code from module unistr/u8-uctomb-tests:
+  # Code from module unitypes:
+  # Code from module uniwidth/base:
+  # Code from module uniwidth/width:
+  # Code from module uniwidth/width-tests:
   # Code from module unlocked-io:
+  # Code from module unlocked-io-internal:
   # Code from module unsetenv:
   # Code from module unsetenv-tests:
   # Code from module update-copyright:
@@ -436,6 +639,7 @@ AC_DEFUN([M4_EARLY],
   # Code from module version-etc:
   # Code from module version-etc-fsf:
   # Code from module version-etc-tests:
+  # Code from module vma-iter:
   # Code from module wait-process:
   # Code from module waitpid:
   # Code from module warnings:
@@ -449,21 +653,34 @@ AC_DEFUN([M4_EARLY],
   # Code from module wctype-h:
   # Code from module wctype-h-c++-tests:
   # Code from module wctype-h-tests:
+  # Code from module wcwidth:
+  # Code from module wcwidth-tests:
+  # Code from module windows-mutex:
+  # Code from module windows-once:
+  # Code from module windows-recmutex:
+  # Code from module windows-rwlock:
+  # Code from module windows-spawn:
+  # Code from module windows-spin:
+  # Code from module windows-thread:
+  # Code from module windows-tls:
   # Code from module write:
   # Code from module write-tests:
   # Code from module xalloc:
   # Code from module xalloc-die:
   # Code from module xalloc-die-tests:
   # Code from module xalloc-oversized:
+  # Code from module xconcat-filename:
   # Code from module xlist:
   # Code from module xmalloca:
   # Code from module xoset:
   # Code from module xprintf:
   # Code from module xsize:
+  # Code from module xstriconv:
   # Code from module xstrndup:
   # Code from module xvasprintf:
   # Code from module xvasprintf-posix:
   # Code from module xvasprintf-tests:
+  # Code from module yield:
 ])
 
 # This macro should be invoked from ./configure.ac, in the section
@@ -480,10 +697,21 @@ AC_DEFUN([M4_INIT],
   m4_pushdef([AC_LIBSOURCES], m4_defn([M4_LIBSOURCES]))
   m4_pushdef([M4_LIBSOURCES_LIST], [])
   m4_pushdef([M4_LIBSOURCES_DIR], [])
+  m4_pushdef([GL_MACRO_PREFIX], [M4])
+  m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL_M4])
   gl_COMMON
   gl_source_base='lib'
+  gl_FUNC_ACCESS
+  if test $REPLACE_ACCESS = 1; then
+    AC_LIBOBJ([access])
+  fi
+  gl_UNISTD_MODULE_INDICATOR([access])
   gl_FUNC_ALLOCA
   gl_ASSERT
+  AC_REQUIRE([AC_C_INLINE])
+  AC_CHECK_HEADERS_ONCE([pthread.h])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([AC_C_INLINE])
   gl_FUNC_BTOWC
   if test $HAVE_BTOWC = 0 || test $REPLACE_BTOWC = 1; then
     AC_LIBOBJ([btowc])
@@ -492,6 +720,19 @@ AC_DEFUN([M4_INIT],
   gl_WCHAR_MODULE_INDICATOR([btowc])
   gl___BUILTIN_EXPECT
   gl_C_STACK
+  gl_FUNC_CALLOC_GNU
+  if test $REPLACE_CALLOC = 1; then
+    AC_LIBOBJ([calloc])
+  fi
+  gl_FUNC_CALLOC_POSIX
+  if test $REPLACE_CALLOC = 1; then
+    AC_LIBOBJ([calloc])
+  fi
+  gl_STDLIB_MODULE_INDICATOR([calloc-posix])
+  gl_FUNC_CANONICALIZE_FILENAME_MODE
+  gl_MODULE_INDICATOR([canonicalize])
+  gl_MODULE_INDICATOR_FOR_TESTS([canonicalize])
+  gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
   gl_CANONICALIZE_LGPL
   if test $HAVE_CANONICALIZE_FILE_NAME = 0 || test $REPLACE_CANONICALIZE_FILE_NAME = 1; then
     AC_LIBOBJ([canonicalize-lgpl])
@@ -500,25 +741,47 @@ AC_DEFUN([M4_INIT],
   gl_STDLIB_MODULE_INDICATOR([canonicalize_file_name])
   gl_STDLIB_MODULE_INDICATOR([realpath])
   gl_UNISTD_MODULE_INDICATOR([chdir])
+  gl_FUNC_CHDIR_LONG
+  if test $gl_cv_have_unlimited_file_name_length = no; then
+    AC_LIBOBJ([chdir-long])
+    gl_PREREQ_CHDIR_LONG
+  fi
   AC_DEFINE([SIGNAL_SAFE_LIST], [1], [Define if lists must be signal-safe.])
+  gl_CLOCK_TIME
   gl_MODULE_INDICATOR_FOR_TESTS([cloexec])
   gl_FUNC_CLOSE
   if test $REPLACE_CLOSE = 1; then
     AC_LIBOBJ([close])
   fi
   gl_UNISTD_MODULE_INDICATOR([close])
-  gl_CLOSE_STREAM
   gl_MODULE_INDICATOR([close-stream])
-  gl_CLOSEIN
-  gl_CLOSEOUT
+  gl_FUNC_CLOSEDIR
+  if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
+    AC_LIBOBJ([closedir])
+  fi
+  gl_DIRENT_MODULE_INDICATOR([closedir])
   gl_CONFIG_H
   gl_CONFIGMAKE_PREP
-  gl_DIRNAME
+  gl_CHECK_TYPE_STRUCT_DIRENT_D_INO
+  gl_DIRENT_H
+  gl_DIRENT_H_REQUIRE_DEFAULTS
+  gl_FUNC_DIRFD
+  if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
+     || test $REPLACE_DIRFD = 1; then
+    AC_LIBOBJ([dirfd])
+    gl_PREREQ_DIRFD
+  fi
+  gl_DIRENT_MODULE_INDICATOR([dirfd])
   gl_MODULE_INDICATOR([dirname])
-  gl_DIRNAME_LGPL
   gl_DOUBLE_SLASH_ROOT
+  gl_FUNC_DUP
+  if test $REPLACE_DUP = 1; then
+    AC_LIBOBJ([dup])
+    gl_PREREQ_DUP
+  fi
+  gl_UNISTD_MODULE_INDICATOR([dup])
   gl_FUNC_DUP2
-  if test $HAVE_DUP2 = 0 || test $REPLACE_DUP2 = 1; then
+  if test $REPLACE_DUP2 = 1; then
     AC_LIBOBJ([dup2])
     gl_PREREQ_DUP2
   fi
@@ -537,6 +800,8 @@ AC_DEFUN([M4_INIT],
   gl_EXECUTE
   AC_REQUIRE([gl_EXTERN_INLINE])
   gl_FATAL_SIGNAL
+  gl_FUNC_FCHDIR
+  gl_UNISTD_MODULE_INDICATOR([fchdir])
   gl_FUNC_FCLOSE
   if test $REPLACE_FCLOSE = 1; then
     AC_LIBOBJ([fclose])
@@ -548,7 +813,14 @@ AC_DEFUN([M4_INIT],
   fi
   gl_FCNTL_MODULE_INDICATOR([fcntl])
   gl_FCNTL_H
+  gl_FCNTL_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR([fd-safer-flag])
+  gl_FUNC_FDOPENDIR
+  if test $HAVE_FDOPENDIR = 0 || test $REPLACE_FDOPENDIR = 1; then
+    AC_LIBOBJ([fdopendir])
+  fi
+  gl_DIRENT_MODULE_INDICATOR([fdopendir])
+  gl_MODULE_INDICATOR([fdopendir])
   gl_FUNC_FFLUSH
   if test $REPLACE_FFLUSH = 1; then
     AC_LIBOBJ([fflush])
@@ -559,6 +831,8 @@ AC_DEFUN([M4_INIT],
   gl_FILE_NAME_CONCAT
   gl_MODULE_INDICATOR([filenamecat])
   gl_FILE_NAME_CONCAT_LGPL
+  gl_FINDPROG_IN
+  AC_C_FLEXIBLE_ARRAY_MEMBER
   gl_FLOAT_H
   if test $REPLACE_FLOAT_LDBL = 1; then
     AC_LIBOBJ([float])
@@ -572,6 +846,12 @@ AC_DEFUN([M4_INIT],
     gl_PREREQ_FOPEN
   fi
   gl_STDIO_MODULE_INDICATOR([fopen])
+  gl_FUNC_FOPEN_GNU
+  if test $REPLACE_FOPEN = 1; then
+    AC_LIBOBJ([fopen])
+    gl_PREREQ_FOPEN
+  fi
+  gl_MODULE_INDICATOR([fopen-gnu])
   gl_MODULE_INDICATOR([fopen-safer])
   gl_FUNC_FPENDING
   if test $gl_cv_func___fpending = no; then
@@ -587,6 +867,12 @@ AC_DEFUN([M4_INIT],
     AC_LIBOBJ([freadahead])
   fi
   gl_FUNC_FREADING
+  gl_FUNC_FREE
+  if test $REPLACE_FREE = 1; then
+    AC_LIBOBJ([free])
+    gl_PREREQ_FREE
+  fi
+  gl_STDLIB_MODULE_INDICATOR([free-posix])
   gl_FUNC_FREXP_NO_LIBM
   if test $gl_func_frexp_no_libm != yes; then
     AC_LIBOBJ([frexp])
@@ -611,9 +897,19 @@ AC_DEFUN([M4_INIT],
   gl_FUNC_FSTAT
   if test $REPLACE_FSTAT = 1; then
     AC_LIBOBJ([fstat])
+    case "$host_os" in
+      mingw*)
+        AC_LIBOBJ([stat-w32])
+        ;;
+    esac
     gl_PREREQ_FSTAT
   fi
   gl_SYS_STAT_MODULE_INDICATOR([fstat])
+  gl_FUNC_FSTATAT
+  if test $HAVE_FSTATAT = 0 || test $REPLACE_FSTATAT = 1; then
+    AC_LIBOBJ([fstatat])
+  fi
+  gl_SYS_STAT_MODULE_INDICATOR([fstatat])
   gl_FUNC_FTELL
   if test $REPLACE_FTELL = 1; then
     AC_LIBOBJ([ftell])
@@ -625,6 +921,18 @@ AC_DEFUN([M4_INIT],
     gl_PREREQ_FTELLO
   fi
   gl_STDIO_MODULE_INDICATOR([ftello])
+  gl_FUNC_GETCWD
+  if test $REPLACE_GETCWD = 1; then
+    AC_LIBOBJ([getcwd])
+    gl_PREREQ_GETCWD
+  fi
+  gl_MODULE_INDICATOR([getcwd])
+  gl_UNISTD_MODULE_INDICATOR([getcwd])
+  gl_FUNC_GETCWD_LGPL
+  if test $REPLACE_GETCWD = 1; then
+    AC_LIBOBJ([getcwd-lgpl])
+  fi
+  gl_UNISTD_MODULE_INDICATOR([getcwd])
   gl_FUNC_GETDTABLESIZE
   if test $HAVE_GETDTABLESIZE = 0 || test $REPLACE_GETDTABLESIZE = 1; then
     AC_LIBOBJ([getdtablesize])
@@ -632,32 +940,32 @@ AC_DEFUN([M4_INIT],
   fi
   gl_UNISTD_MODULE_INDICATOR([getdtablesize])
   gl_FUNC_GETOPT_GNU
-  if test $REPLACE_GETOPT = 1; then
-    AC_LIBOBJ([getopt])
-    AC_LIBOBJ([getopt1])
-    gl_PREREQ_GETOPT
-    dnl Arrange for unistd.h to include getopt.h.
-    GNULIB_GL_M4_UNISTD_H_GETOPT=1
-  fi
-  AC_SUBST([GNULIB_GL_M4_UNISTD_H_GETOPT])
+  dnl Because of the way gl_FUNC_GETOPT_GNU is implemented (the gl_getopt_required
+  dnl mechanism), there is no need to do any AC_LIBOBJ or AC_SUBST here; they are
+  dnl done in the getopt-posix module.
   gl_FUNC_GETOPT_POSIX
   if test $REPLACE_GETOPT = 1; then
     AC_LIBOBJ([getopt])
     AC_LIBOBJ([getopt1])
-    gl_PREREQ_GETOPT
     dnl Arrange for unistd.h to include getopt.h.
     GNULIB_GL_M4_UNISTD_H_GETOPT=1
   fi
   AC_SUBST([GNULIB_GL_M4_UNISTD_H_GETOPT])
+  gl_UNISTD_MODULE_INDICATOR([getopt-posix])
+  gl_FUNC_GETPAGESIZE
+  if test $REPLACE_GETPAGESIZE = 1; then
+    AC_LIBOBJ([getpagesize])
+  fi
+  gl_UNISTD_MODULE_INDICATOR([getpagesize])
   gl_FUNC_GETPROGNAME
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  gl_FUNC_GETRANDOM
+  if test $HAVE_GETRANDOM = 0 || test $REPLACE_GETRANDOM = 1; then
+    AC_LIBOBJ([getrandom])
+  fi
+  gl_SYS_RANDOM_MODULE_INDICATOR([getrandom])
   AC_SUBST([LIBINTL])
   AC_SUBST([LTLIBINTL])
-  gl_FUNC_GETTIMEOFDAY
-  if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
-    AC_LIBOBJ([gettimeofday])
-    gl_PREREQ_GETTIMEOFDAY
-  fi
-  gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
   # Autoconf 2.61a.99 and earlier don't support linking a file only
   # in VPATH builds.  But since GNUmakefile is for maintainer use
   # only, it does not matter if we skip the link with older autoconf.
@@ -668,7 +976,27 @@ AC_DEFUN([M4_INIT],
           m4_defn([m4_PACKAGE_VERSION])), [1], [],
         [AC_CONFIG_LINKS([$GNUmakefile:$GNUmakefile], [],
           [GNUmakefile=$GNUmakefile])])
-  gl_HARD_LOCALE
+  AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
+  LIB_HARD_LOCALE="$LIB_SETLOCALE_NULL"
+  AC_SUBST([LIB_HARD_LOCALE])
+  AC_DEFUN([gl_HAVE_MODULE_HAVELIB])
+  AC_REQUIRE([gl_HOST_CPU_C_ABI])
+  AM_ICONV
+  m4_ifdef([gl_ICONV_MODULE_INDICATOR],
+    [gl_ICONV_MODULE_INDICATOR([iconv])])
+  gl_ICONV_H
+  gl_ICONV_H_REQUIRE_DEFAULTS
+  gl_FUNC_ICONV_OPEN
+  if test $REPLACE_ICONV_OPEN = 1; then
+    AC_LIBOBJ([iconv_open])
+  fi
+  if test $REPLACE_ICONV = 1; then
+    AC_LIBOBJ([iconv])
+    AC_LIBOBJ([iconv_close])
+  fi
+  gl_INLINE
+  gl_INTTYPES_INCOMPLETE
+  gl_INTTYPES_H_REQUIRE_DEFAULTS
   gl_FUNC_ISNAND_NO_LIBM
   if test $gl_func_isnand_no_libm != yes; then
     AC_LIBOBJ([isnand])
@@ -684,20 +1012,52 @@ AC_DEFUN([M4_INIT],
     AC_LIBOBJ([isnanl])
     gl_PREREQ_ISNANL
   fi
+  gl_FUNC_ISWBLANK
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+    :
+  else
+    if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
+      AC_LIBOBJ([iswblank])
+    fi
+  fi
+  gl_WCTYPE_MODULE_INDICATOR([iswblank])
+  gl_FUNC_ISWDIGIT
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+    :
+  else
+    if test $REPLACE_ISWDIGIT = 1; then
+      AC_LIBOBJ([iswdigit])
+    fi
+  fi
+  gl_WCTYPE_MODULE_INDICATOR([iswdigit])
+  gl_FUNC_ISWXDIGIT
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+    :
+  else
+    if test $REPLACE_ISWXDIGIT = 1; then
+      AC_LIBOBJ([iswxdigit])
+    fi
+  fi
+  gl_WCTYPE_MODULE_INDICATOR([iswxdigit])
   gl_LANGINFO_H
+  gl_LANGINFO_H_REQUIRE_DEFAULTS
   AC_REQUIRE([gl_LARGEFILE])
-  gl_LIBSIGSEGV
+  gl___INLINE
   gl_LIMITS_H
   gl_LOCALCHARSET
-  LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
+  dnl For backward compatibility. Some packages still use this.
+  LOCALCHARSET_TESTS_ENVIRONMENT=
   AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
   gl_LOCALE_H
+  gl_LOCALE_H_REQUIRE_DEFAULTS
   gl_FUNC_LOCALECONV
   if test $REPLACE_LOCALECONV = 1; then
     AC_LIBOBJ([localeconv])
     gl_PREREQ_LOCALECONV
   fi
   gl_LOCALE_MODULE_INDICATOR([localeconv])
+  gl_LOCALENAME
+  gl_LOCALE_MODULE_INDICATOR([localename])
   gl_LOCK
   gl_MODULE_INDICATOR([lock])
   gl_FUNC_LSEEK
@@ -714,16 +1074,29 @@ AC_DEFUN([M4_INIT],
   AC_CONFIG_COMMANDS_PRE([m4_ifdef([AH_HEADER],
     [AC_SUBST([CONFIG_INCLUDE], m4_defn([AH_HEADER]))])])
   AC_REQUIRE([AC_PROG_SED])
-  gl_FUNC_MALLOC_POSIX
+  AC_REQUIRE([AC_PROG_GREP])
+  gl_FUNC_MALLOC_GNU
+  if test $REPLACE_MALLOC = 1; then
+    AC_LIBOBJ([malloc])
+  fi
+  AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
   if test $REPLACE_MALLOC = 1; then
     AC_LIBOBJ([malloc])
   fi
   gl_STDLIB_MODULE_INDICATOR([malloc-posix])
   gl_MALLOCA
   gl_MATH_H
+  gl_MATH_H_REQUIRE_DEFAULTS
+  gl_MBCHAR
+  gl_MBITER
   gl_FUNC_MBRTOWC
   if test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; then
     AC_LIBOBJ([mbrtowc])
+    if test $REPLACE_MBSTATE_T = 1; then
+      AC_LIBOBJ([lc-charset-dispatch])
+      AC_LIBOBJ([mbtowc-lock])
+      gl_PREREQ_MBTOWC_LOCK
+    fi
     gl_PREREQ_MBRTOWC
   fi
   gl_WCHAR_MODULE_INDICATOR([mbrtowc])
@@ -733,19 +1106,40 @@ AC_DEFUN([M4_INIT],
     gl_PREREQ_MBSINIT
   fi
   gl_WCHAR_MODULE_INDICATOR([mbsinit])
+  gl_FUNC_MBSLEN
+  gl_STRING_MODULE_INDICATOR([mbslen])
+  gl_STRING_MODULE_INDICATOR([mbsstr])
   gl_FUNC_MBTOWC
-  if test $REPLACE_MBTOWC = 1; then
+  if test $HAVE_MBTOWC = 0 || test $REPLACE_MBTOWC = 1; then
     AC_LIBOBJ([mbtowc])
     gl_PREREQ_MBTOWC
   fi
   gl_STDLIB_MODULE_INDICATOR([mbtowc])
+  gl_MBITER
   gl_FUNC_MEMCHR
-  if test $HAVE_MEMCHR = 0 || test $REPLACE_MEMCHR = 1; then
+  if test $REPLACE_MEMCHR = 1; then
     AC_LIBOBJ([memchr])
     gl_PREREQ_MEMCHR
   fi
   gl_STRING_MODULE_INDICATOR([memchr])
+  gl_FUNC_MEMPCPY
+  if test $HAVE_MEMPCPY = 0; then
+    AC_LIBOBJ([mempcpy])
+    gl_PREREQ_MEMPCPY
+  fi
+  gl_STRING_MODULE_INDICATOR([mempcpy])
+  gl_FUNC_MEMRCHR
+  if test $ac_cv_func_memrchr = no; then
+    AC_LIBOBJ([memrchr])
+    gl_PREREQ_MEMRCHR
+  fi
+  gl_STRING_MODULE_INDICATOR([memrchr])
   gl_MINMAX
+  gl_FUNC_MKDIR
+  if test $REPLACE_MKDIR = 1; then
+    AC_LIBOBJ([mkdir])
+  fi
+  gl_SYS_STAT_MODULE_INDICATOR([mkdir])
   gl_FUNC_MKDTEMP
   if test $HAVE_MKDTEMP = 0; then
     AC_LIBOBJ([mkdtemp])
@@ -766,11 +1160,16 @@ AC_DEFUN([M4_INIT],
   if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
     AC_LIBOBJ([msvc-nothrow])
   fi
+  gl_MODULE_INDICATOR([msvc-nothrow])
   gl_MULTIARCH
   gl_FUNC_NL_LANGINFO
   if test $HAVE_NL_LANGINFO = 0 || test $REPLACE_NL_LANGINFO = 1; then
     AC_LIBOBJ([nl_langinfo])
   fi
+  if test $REPLACE_NL_LANGINFO = 1 && test $NL_LANGINFO_MTSAFE = 0; then
+    AC_LIBOBJ([nl_langinfo-lock])
+    gl_PREREQ_NL_LANGINFO_LOCK
+  fi
   gl_LANGINFO_MODULE_INDICATOR([nl_langinfo])
   AC_FUNC_OBSTACK
   dnl Note: AC_FUNC_OBSTACK does AC_LIBSOURCES([obstack.h, obstack.c]).
@@ -780,22 +1179,54 @@ AC_DEFUN([M4_INIT],
     gl_PREREQ_OPEN
   fi
   gl_FCNTL_MODULE_INDICATOR([open])
+  gl_FUNC_OPENAT
+  if test $HAVE_OPENAT = 0 || test $REPLACE_OPENAT = 1; then
+    AC_LIBOBJ([openat])
+    gl_PREREQ_OPENAT
+  fi
+  gl_MODULE_INDICATOR([openat]) dnl for lib/getcwd.c
+  gl_FCNTL_MODULE_INDICATOR([openat])
+  gl_FUNC_OPENDIR
+  if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
+    AC_LIBOBJ([opendir])
+  fi
+  gl_DIRENT_MODULE_INDICATOR([opendir])
   gl_PATHMAX
+  gl_FUNC_PIPE
+  if test $HAVE_PIPE = 0; then
+    AC_LIBOBJ([pipe])
+  fi
+  gl_UNISTD_MODULE_INDICATOR([pipe])
   gl_FUNC_PIPE2
   gl_UNISTD_MODULE_INDICATOR([pipe2])
   gl_MODULE_INDICATOR([pipe2-safer])
+  gl_POSIX_SPAWN
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
+    AC_LIBOBJ([spawn])
+  fi
+  gl_SPAWN_MODULE_INDICATOR([posix_spawn])
+  gl_POSIX_SPAWN
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
+    AC_LIBOBJ([spawni])
+    gl_PREREQ_POSIX_SPAWN_INTERNAL
+  fi
+  gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = 1; then
+    AC_LIBOBJ([spawn_faction_addchdir])
+  fi
+  gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addchdir])
   gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = 1; then
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = 1; then
     AC_LIBOBJ([spawn_faction_addclose])
   fi
   gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addclose])
   gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = 1; then
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = 1; then
     AC_LIBOBJ([spawn_faction_adddup2])
   fi
   gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_adddup2])
   gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN
-  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = 1; then
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1 || test $REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = 1; then
     AC_LIBOBJ([spawn_faction_addopen])
   fi
   gl_SPAWN_MODULE_INDICATOR([posix_spawn_file_actions_addopen])
@@ -826,14 +1257,17 @@ AC_DEFUN([M4_INIT],
   gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setflags])
   gl_POSIX_SPAWN
   if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
+    AC_LIBOBJ([spawnattr_setpgroup])
+  fi
+  gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setpgroup])
+  gl_POSIX_SPAWN
+  if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
     AC_LIBOBJ([spawnattr_setsigmask])
   fi
   gl_SPAWN_MODULE_INDICATOR([posix_spawnattr_setsigmask])
   gl_POSIX_SPAWN
   if test $HAVE_POSIX_SPAWN = 0 || test $REPLACE_POSIX_SPAWN = 1; then
     AC_LIBOBJ([spawnp])
-    AC_LIBOBJ([spawni])
-    gl_PREREQ_POSIX_SPAWN_INTERNAL
   fi
   gl_SPAWN_MODULE_INDICATOR([posix_spawnp])
   gl_FUNC_PRINTF_FREXP
@@ -841,6 +1275,9 @@ AC_DEFUN([M4_INIT],
   m4_divert_text([INIT_PREPARE], [gl_printf_safe=yes])
   AC_CHECK_DECLS([program_invocation_name], [], [], [#include <errno.h>])
   AC_CHECK_DECLS([program_invocation_short_name], [], [], [#include <errno.h>])
+  m4_ifdef([AM_XGETTEXT_OPTION],
+    [AM_][XGETTEXT_OPTION([--keyword='proper_name:1,\"This is a proper name. See the gettext manual, section Names.\"'])
+     AM_][XGETTEXT_OPTION([--keyword='proper_name_utf8:1,\"This is a proper name. See the gettext manual, section Names.\"'])])
   gl_QUOTEARG
   gl_FUNC_RAISE
   if test $HAVE_RAISE = 0 || test $REPLACE_RAISE = 1; then
@@ -854,12 +1291,33 @@ AC_DEFUN([M4_INIT],
     gl_PREREQ_RAWMEMCHR
   fi
   gl_STRING_MODULE_INDICATOR([rawmemchr])
+  gl_FUNC_READDIR
+  if test $HAVE_READDIR = 0; then
+    AC_LIBOBJ([readdir])
+  fi
+  gl_DIRENT_MODULE_INDICATOR([readdir])
   gl_FUNC_READLINK
   if test $HAVE_READLINK = 0 || test $REPLACE_READLINK = 1; then
     AC_LIBOBJ([readlink])
     gl_PREREQ_READLINK
   fi
   gl_UNISTD_MODULE_INDICATOR([readlink])
+  gl_FUNC_REALLOC_GNU
+  if test $REPLACE_REALLOC = 1; then
+    AC_LIBOBJ([realloc])
+  fi
+  gl_FUNC_REALLOC_POSIX
+  if test $REPLACE_REALLOC = 1; then
+    AC_LIBOBJ([realloc])
+  fi
+  gl_STDLIB_MODULE_INDICATOR([realloc-posix])
+  gl_FUNC_REALLOCARRAY
+  if test $HAVE_REALLOCARRAY = 0 || test $REPLACE_REALLOCARRAY = 1; then
+    AC_LIBOBJ([reallocarray])
+    gl_PREREQ_REALLOCARRAY
+  fi
+  gl_MODULE_INDICATOR([reallocarray])
+  gl_STDLIB_MODULE_INDICATOR([reallocarray])
   gl_REGEX
   if test $ac_use_included_regex = yes; then
     AC_LIBOBJ([regex])
@@ -870,18 +1328,38 @@ AC_DEFUN([M4_INIT],
     AC_LIBOBJ([rename])
   fi
   gl_STDIO_MODULE_INDICATOR([rename])
+  gl_FUNC_REWINDDIR
+  if test $HAVE_REWINDDIR = 0; then
+    AC_LIBOBJ([rewinddir])
+  fi
+  gl_DIRENT_MODULE_INDICATOR([rewinddir])
   gl_FUNC_RMDIR
   if test $REPLACE_RMDIR = 1; then
     AC_LIBOBJ([rmdir])
   fi
   gl_UNISTD_MODULE_INDICATOR([rmdir])
+  gl_SAVE_CWD
   gl_SCHED_H
+  gl_SCHED_H_REQUIRE_DEFAULTS
   gl_FUNC_SECURE_GETENV
   if test $HAVE_SECURE_GETENV = 0; then
     AC_LIBOBJ([secure_getenv])
     gl_PREREQ_SECURE_GETENV
   fi
   gl_STDLIB_MODULE_INDICATOR([secure_getenv])
+  gl_FUNC_SETLOCALE
+  if test $REPLACE_SETLOCALE = 1; then
+    AC_LIBOBJ([setlocale])
+    gl_PREREQ_SETLOCALE
+  fi
+  gl_LOCALE_MODULE_INDICATOR([setlocale])
+  gl_FUNC_SETLOCALE_NULL
+  if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+    AC_LIBOBJ([setlocale-lock])
+    gl_PREREQ_SETLOCALE_LOCK
+  fi
+  gl_LOCALE_MODULE_INDICATOR([setlocale_null])
+  gl_SH_FILENAME
   gl_SIGACTION
   if test $HAVE_SIGACTION = 0; then
     AC_LIBOBJ([sigaction])
@@ -889,6 +1367,7 @@ AC_DEFUN([M4_INIT],
   fi
   gl_SIGNAL_MODULE_INDICATOR([sigaction])
   gl_SIGNAL_H
+  gl_SIGNAL_H_REQUIRE_DEFAULTS
   gl_SIGNBIT
   if test $REPLACE_SIGNBIT = 1; then
     AC_LIBOBJ([signbitf])
@@ -900,46 +1379,133 @@ AC_DEFUN([M4_INIT],
   dnl Define the C macro GNULIB_SIGPIPE to 1.
   gl_MODULE_INDICATOR([sigpipe])
   dnl Define the substituted variable GNULIB_SIGNAL_H_SIGPIPE to 1.
-  AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
-  GNULIB_SIGNAL_H_SIGPIPE=1
+  gl_SIGNAL_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNAL_H_SIGPIPE], [1])
   dnl Define the substituted variable GNULIB_STDIO_H_SIGPIPE to 1.
-  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  gl_STDIO_H_REQUIRE_DEFAULTS
   AC_REQUIRE([gl_ASM_SYMBOL_PREFIX])
-  GNULIB_STDIO_H_SIGPIPE=1
+  gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE], [1])
   dnl Define the substituted variable GNULIB_UNISTD_H_SIGPIPE to 1.
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  GNULIB_UNISTD_H_SIGPIPE=1
+  gl_UNISTD_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_SIGPIPE], [1])
   gl_SIGNALBLOCKING
   if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
     AC_LIBOBJ([sigprocmask])
     gl_PREREQ_SIGPROCMASK
   fi
   gl_SIGNAL_MODULE_INDICATOR([sigprocmask])
+  AC_ARG_WITH([libsigsegv],
+    [AS_HELP_STRING([--with-libsigsegv],
+       [use the GNU libsigsegv library, when present, instead of the gnulib module 'sigsegv'])])
+  SIGSEGV_H=sigsegv.h
+  if test "$with_libsigsegv" = yes; then
+    gl_LIBSIGSEGV
+    if test "$gl_cv_lib_sigsegv" = yes; then
+      SIGSEGV_H=
+    fi
+  fi
+  AC_SUBST([SIGSEGV_H])
+  AM_CONDITIONAL([GL_GENERATE_SIGSEGV_H], [test -n "$SIGSEGV_H"])
+  if test -n "$SIGSEGV_H"; then
+    dnl Persuade glibc <sys/ucontext.h> to declare macros designating register
+    dnl indices: REG_RSP on x86_64, REG_ESP on i386.
+    dnl Persuade Solaris OpenIndiana <ucontext.h> to include <sys/regset.h>,
+    dnl which declares macros designating register indices, such as ESP on i386.
+    dnl Persuade Solaris OpenIndiana <unistd.h> to declare mincore().
+    AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+    AC_REQUIRE([AC_CANONICAL_HOST])
+    case "$host_os" in
+      solaris2.11)
+        AC_DEFINE([SOLARIS11], [1], [Define on Solaris 11 and its derivates.])
+        ;;
+    esac
+    gl_FUNC_MMAP_ANON
+    dnl Stack direction.
+    SV_STACK_DIRECTION
+    dnl Catching stack overflow requires an alternate signal stack.
+    dnl The old "install a guard page" trick would be unreliable, because
+    dnl we don't know where exactly to place the guard page.
+    SV_SIGALTSTACK
+    AC_CHECK_FUNCS_ONCE([getrlimit])
+  fi
   gl_SIZE_MAX
   gl_FUNC_SNPRINTF
   gl_STDIO_MODULE_INDICATOR([snprintf])
   gl_MODULE_INDICATOR([snprintf])
   gl_SPAWN_H
+  gl_SPAWN_H_REQUIRE_DEFAULTS
   gl_SPAWN_PIPE
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    os2*)
+      AC_LIBOBJ([os2-spawn])
+      ;;
+  esac
   gt_TYPE_SSIZE_T
   gl_FUNC_STAT
   if test $REPLACE_STAT = 1; then
     AC_LIBOBJ([stat])
+    case "$host_os" in
+      mingw*)
+        AC_LIBOBJ([stat-w32])
+        ;;
+    esac
     gl_PREREQ_STAT
   fi
   gl_SYS_STAT_MODULE_INDICATOR([stat])
+  gl_STAT_TIME
+  gl_STAT_BIRTHTIME
+  gl_STDALIGN_H
   gl_STDARG_H
   AM_STDBOOL_H
   gl_STDDEF_H
+  gl_STDDEF_H_REQUIRE_DEFAULTS
   gl_STDINT_H
   gl_STDIO_H
+  gl_STDIO_H_REQUIRE_DEFAULTS
+  dnl No need to create extra modules for these functions. Everyone who uses
+  dnl <stdio.h> likely needs them.
+  gl_STDIO_MODULE_INDICATOR([fscanf])
+  gl_MODULE_INDICATOR([fscanf])
+  gl_STDIO_MODULE_INDICATOR([scanf])
+  gl_MODULE_INDICATOR([scanf])
+  gl_STDIO_MODULE_INDICATOR([fgetc])
+  gl_STDIO_MODULE_INDICATOR([getc])
+  gl_STDIO_MODULE_INDICATOR([getchar])
+  gl_STDIO_MODULE_INDICATOR([fgets])
+  gl_STDIO_MODULE_INDICATOR([fread])
+  dnl No need to create extra modules for these functions. Everyone who uses
+  dnl <stdio.h> likely needs them.
+  gl_STDIO_MODULE_INDICATOR([fprintf])
+  gl_STDIO_MODULE_INDICATOR([printf])
+  gl_STDIO_MODULE_INDICATOR([vfprintf])
+  gl_STDIO_MODULE_INDICATOR([vprintf])
+  gl_STDIO_MODULE_INDICATOR([fputc])
+  gl_STDIO_MODULE_INDICATOR([putc])
+  gl_STDIO_MODULE_INDICATOR([putchar])
+  gl_STDIO_MODULE_INDICATOR([fputs])
+  gl_STDIO_MODULE_INDICATOR([puts])
+  gl_STDIO_MODULE_INDICATOR([fwrite])
   gl_STDLIB_H
+  gl_STDLIB_H_REQUIRE_DEFAULTS
+  gl_FUNC_STPCPY
+  if test $HAVE_STPCPY = 0; then
+    AC_LIBOBJ([stpcpy])
+    gl_PREREQ_STPCPY
+  fi
+  gl_STRING_MODULE_INDICATOR([stpcpy])
   gl_FUNC_STRCHRNUL
   if test $HAVE_STRCHRNUL = 0 || test $REPLACE_STRCHRNUL = 1; then
     AC_LIBOBJ([strchrnul])
     gl_PREREQ_STRCHRNUL
   fi
   gl_STRING_MODULE_INDICATOR([strchrnul])
+  gl_FUNC_STRDUP_POSIX
+  if test $REPLACE_STRDUP = 1; then
+    AC_LIBOBJ([strdup])
+    gl_PREREQ_STRDUP
+  fi
+  gl_STRING_MODULE_INDICATOR([strdup])
   gl_FUNC_STRERROR
   if test $REPLACE_STRERROR = 1; then
     AC_LIBOBJ([strerror])
@@ -952,7 +1518,12 @@ AC_DEFUN([M4_INIT],
     AC_LIBOBJ([strerror-override])
     gl_PREREQ_SYS_H_WINSOCK2
   fi
-  gl_HEADER_STRING_H
+  if test $gl_cond_libtool = false; then
+    gl_ltlibdeps="$gl_ltlibdeps $LTLIBICONV"
+    gl_libdeps="$gl_libdeps $LIBICONV"
+  fi
+  gl_STRING_H
+  gl_STRING_H_REQUIRE_DEFAULTS
   gl_FUNC_STRNDUP
   if test $HAVE_STRNDUP = 0 || test $REPLACE_STRNDUP = 1; then
     AC_LIBOBJ([strndup])
@@ -985,22 +1556,49 @@ AC_DEFUN([M4_INIT],
     gl_PREREQ_STRTOD
   fi
   gl_STDLIB_MODULE_INDICATOR([strtod])
-  gl_HEADER_SYS_STAT_H
+  gl_SYS_RANDOM_H
+  gl_SYS_RANDOM_H_REQUIRE_DEFAULTS
   AC_PROG_MKDIR_P
-  gl_HEADER_SYS_TIME_H
+  gl_SYS_STAT_H
+  gl_SYS_STAT_H_REQUIRE_DEFAULTS
   AC_PROG_MKDIR_P
   gl_SYS_TYPES_H
+  gl_SYS_TYPES_H_REQUIRE_DEFAULTS
   AC_PROG_MKDIR_P
   gl_SYS_WAIT_H
+  gl_SYS_WAIT_H_REQUIRE_DEFAULTS
   AC_PROG_MKDIR_P
   gl_FUNC_GEN_TEMPNAME
-  gl_THREADLIB
-  gl_HEADER_TIME_H
+  gl_MODULE_INDICATOR([tempname])
+  AC_CHECK_HEADERS([sys/single_threaded.h])
+  AC_REQUIRE([gl_THREADLIB])
+  gl_TIME_H
+  gl_TIME_H_REQUIRE_DEFAULTS
   gl_TLS
   gt_TMPDIR
   gl_UNISTD_H
+  gl_UNISTD_H_REQUIRE_DEFAULTS
   gl_UNISTD_SAFER
+  gl_LIBUNISTRING_LIBHEADER([0.9.11], [unistr.h])
+  gl_MODULE_INDICATOR([unistr/u8-mbtoucr])
+  gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-mbtoucr])
+  gl_MODULE_INDICATOR([unistr/u8-uctomb])
+  gl_LIBUNISTRING_MODULE([0.9], [unistr/u8-uctomb])
+  gl_LIBUNISTRING_LIBHEADER([0.9.11], [unitypes.h])
+  gl_LIBUNISTRING_LIBHEADER([0.9.11], [uniwidth.h])
+  gl_LIBUNISTRING_MODULE([0.9.8], [uniwidth/width])
+  AC_DEFINE([GNULIB_STDIO_SINGLE_THREAD], [1],
+    [Define to 1 if you want the FILE stream functions getc, putc, etc.
+     to use unlocked I/O if available, throughout the package.
+     Unlocked I/O can improve performance, sometimes dramatically.
+     But unlocked I/O is safe only in single-threaded programs,
+     as well as in multithreaded programs for which you can guarantee that
+     every FILE stream, including stdin, stdout, stderr, is used only
+     in a single thread.])
+  AC_DEFINE([USE_UNLOCKED_IO], [GNULIB_STDIO_SINGLE_THREAD],
+    [An alias of GNULIB_STDIO_SINGLE_THREAD.])
   gl_FUNC_GLIBC_UNLOCKED_IO
+  AC_REQUIRE([AC_C_RESTRICT])
   gl_FUNC_VASNPRINTF
   gl_FUNC_VASPRINTF
   gl_STDIO_MODULE_INDICATOR([vasprintf])
@@ -1019,6 +1617,7 @@ AC_DEFUN([M4_INIT],
   fi
   gl_SYS_WAIT_MODULE_INDICATOR([waitpid])
   gl_WCHAR_H
+  gl_WCHAR_H_REQUIRE_DEFAULTS
   gl_FUNC_WCRTOMB
   if test $HAVE_WCRTOMB = 0 || test $REPLACE_WCRTOMB = 1; then
     AC_LIBOBJ([wcrtomb])
@@ -1026,7 +1625,58 @@ AC_DEFUN([M4_INIT],
   fi
   gl_WCHAR_MODULE_INDICATOR([wcrtomb])
   gl_WCTYPE_H
+  gl_WCTYPE_H_REQUIRE_DEFAULTS
+  gl_FUNC_WCWIDTH
+  if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then
+    AC_LIBOBJ([wcwidth])
+    gl_PREREQ_WCWIDTH
+  fi
+  gl_WCHAR_MODULE_INDICATOR([wcwidth])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      AC_LIBOBJ([windows-mutex])
+      ;;
+  esac
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      AC_LIBOBJ([windows-once])
+      ;;
+  esac
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      AC_LIBOBJ([windows-recmutex])
+      ;;
+  esac
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      AC_LIBOBJ([windows-rwlock])
+      ;;
+  esac
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      AC_LIBOBJ([windows-spawn])
+      ;;
+  esac
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      AC_LIBOBJ([windows-spin])
+      ;;
+  esac
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      AC_LIBOBJ([windows-tls])
+      ;;
+  esac
   gl_XALLOC
+  gl_MODULE_INDICATOR([xalloc])
+  gl_MODULE_INDICATOR([xalloc-die])
   m4_ifdef([AM_XGETTEXT_OPTION],
     [AM_][XGETTEXT_OPTION([--flag=xprintf:1:c-format])
      AM_][XGETTEXT_OPTION([--flag=xvprintf:1:c-format])
@@ -1049,6 +1699,8 @@ AC_DEFUN([M4_INIT],
       m4_if(m4_sysval, [0], [],
         [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
   ])
+  m4_popdef([GL_MODULE_INDICATOR_PREFIX])
+  m4_popdef([GL_MACRO_PREFIX])
   m4_popdef([M4_LIBSOURCES_DIR])
   m4_popdef([M4_LIBSOURCES_LIST])
   m4_popdef([AC_LIBSOURCES])
@@ -1075,6 +1727,8 @@ AC_DEFUN([M4_INIT],
   m4_pushdef([AC_LIBSOURCES], m4_defn([M4tests_LIBSOURCES]))
   m4_pushdef([M4tests_LIBSOURCES_LIST], [])
   m4_pushdef([M4tests_LIBSOURCES_DIR], [])
+  m4_pushdef([GL_MACRO_PREFIX], [M4tests])
+  m4_pushdef([GL_MODULE_INDICATOR_PREFIX], [GL_M4])
   gl_COMMON
   gl_source_base='tests'
 changequote(,)dnl
@@ -1083,76 +1737,130 @@ changequote([, ])dnl
   AC_SUBST([M4tests_WITNESS])
   gl_module_indicator_condition=$M4tests_WITNESS
   m4_pushdef([gl_MODULE_INDICATOR_CONDITION], [$gl_module_indicator_condition])
-  gl_PROG_ANSI_CXX([CXX], [ANSICXX])
+  AC_REQUIRE([gl_SYS_SOCKET_H])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([accept])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([accept])
+  AC_CHECK_FUNCS_ONCE([geteuid])
+  gl_ARPA_INET_H
+  gl_ARPA_INET_H_REQUIRE_DEFAULTS
+  AC_PROG_MKDIR_P
+  AC_CHECK_HEADERS_ONCE([semaphore.h])
+  AC_CHECK_DECLS_ONCE([alarm])
+  AC_REQUIRE([gl_SEMAPHORE])
+  AC_REQUIRE([gl_SYS_SOCKET_H])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([bind])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([bind])
   gt_LOCALE_FR
   gt_LOCALE_FR_UTF8
   gt_LOCALE_FR
   gt_LOCALE_TR_UTF8
-  gl_FUNC_CLOSEDIR
-  if test $HAVE_CLOSEDIR = 0 || test $REPLACE_CLOSEDIR = 1; then
-    AC_LIBOBJ([closedir])
-  fi
-  gl_DIRENT_MODULE_INDICATOR([closedir])
-  gl_CTYPE_H
-  gl_DIRENT_H
-  gl_FUNC_DIRFD
-  if test $ac_cv_func_dirfd = no && test $gl_cv_func_dirfd_macro = no \
-     || test $REPLACE_DIRFD = 1; then
-    AC_LIBOBJ([dirfd])
-    gl_PREREQ_DIRFD
+  AC_REQUIRE([gl_SYS_SOCKET_H])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([connect])
   fi
-  gl_DIRENT_MODULE_INDICATOR([dirfd])
-  gl_FUNC_DUP
-  if test $REPLACE_DUP = 1; then
-    AC_LIBOBJ([dup])
-    gl_PREREQ_DUP
+  gl_SYS_SOCKET_MODULE_INDICATOR([connect])
+  gl_FUNC_CREAT
+  if test $REPLACE_CREAT = 1; then
+    AC_LIBOBJ([creat])
   fi
-  gl_UNISTD_MODULE_INDICATOR([dup])
+  gl_FCNTL_MODULE_INDICATOR([creat])
+  gl_CTYPE_H
+  gl_CTYPE_H_REQUIRE_DEFAULTS
+  dnl Test for Linux system call close_range(), declared in <unistd.h>.
+  AC_CHECK_FUNCS([close_range])
+  gl_FUNC_EXPLICIT_BZERO
+  if test $HAVE_EXPLICIT_BZERO = 0; then
+    AC_LIBOBJ([explicit_bzero])
+    gl_PREREQ_EXPLICIT_BZERO
+  fi
+  gl_STRING_MODULE_INDICATOR([explicit_bzero])
   gl_FUNC_FDOPEN
   if test $REPLACE_FDOPEN = 1; then
     AC_LIBOBJ([fdopen])
     gl_PREREQ_FDOPEN
   fi
   gl_STDIO_MODULE_INDICATOR([fdopen])
-  AC_C_FLEXIBLE_ARRAY_MEMBER
+  gl_FINDPROG
+  gl_FUNC_FREOPEN
+  if test $REPLACE_FREOPEN = 1; then
+    AC_LIBOBJ([freopen])
+    gl_PREREQ_FREOPEN
+  fi
+  gl_STDIO_MODULE_INDICATOR([freopen])
   gl_FUNC_UNGETC_WORKS
   gl_FUNC_UNGETC_WORKS
   gl_FUNC_UNGETC_WORKS
   gl_FUNC_UNGETC_WORKS
-  gl_FUNC_GETCWD_LGPL
-  if test $REPLACE_GETCWD = 1; then
-    AC_LIBOBJ([getcwd-lgpl])
+  gl_FUNC_FTRUNCATE
+  if test $HAVE_FTRUNCATE = 0 || test $REPLACE_FTRUNCATE = 1; then
+    AC_LIBOBJ([ftruncate])
+    gl_PREREQ_FTRUNCATE
   fi
-  gl_UNISTD_MODULE_INDICATOR([getcwd])
-  gl_FUNC_GETPAGESIZE
-  if test $REPLACE_GETPAGESIZE = 1; then
-    AC_LIBOBJ([getpagesize])
+  gl_UNISTD_MODULE_INDICATOR([ftruncate])
+  gl_FUNC_GETTIMEOFDAY
+  if test $HAVE_GETTIMEOFDAY = 0 || test $REPLACE_GETTIMEOFDAY = 1; then
+    AC_LIBOBJ([gettimeofday])
+    gl_PREREQ_GETTIMEOFDAY
   fi
-  gl_UNISTD_MODULE_INDICATOR([getpagesize])
+  gl_SYS_TIME_MODULE_INDICATOR([gettimeofday])
+  gl_MUSL_LIBC
+  dnl Distinguish OpenBSD >= 6.2 from OpenBSD < 6.2.
+  AC_CHECK_FUNCS_ONCE([duplocale])
+  gl_FUNC_INET_PTON
+  if test $HAVE_INET_PTON = 0 || test $REPLACE_INET_PTON = 1; then
+    AC_LIBOBJ([inet_pton])
+    gl_PREREQ_INET_PTON
+  fi
+  gl_ARPA_INET_MODULE_INDICATOR([inet_pton])
+  AC_C_BIGENDIAN
+  gl_INTTOSTR
   gl_INTTYPES_H
-  gl_INTTYPES_INCOMPLETE
+  gl_FUNC_IOCTL
+  if test $HAVE_IOCTL = 0 || test $REPLACE_IOCTL = 1; then
+    AC_LIBOBJ([ioctl])
+  fi
+  gl_SYS_IOCTL_MODULE_INDICATOR([ioctl])
   gl_FUNC_ISBLANK
   if test $HAVE_ISBLANK = 0; then
     AC_LIBOBJ([isblank])
   fi
+  gl_MODULE_INDICATOR([isblank])
   gl_CTYPE_MODULE_INDICATOR([isblank])
   gl_DOUBLE_EXPONENT_LOCATION
   gl_FLOAT_EXPONENT_LOCATION
   gl_LONG_DOUBLE_EXPONENT_LOCATION
   AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
+  gt_LOCALE_FR
+  gt_LOCALE_FR_UTF8
+  gt_LOCALE_JA
+  gt_LOCALE_ZH_CN
+  gt_LOCALE_FR
+  gt_LOCALE_FR_UTF8
+  gt_LOCALE_JA
+  gt_LOCALE_ZH_CN
   gl_FUNC_LINK
   if test $HAVE_LINK = 0 || test $REPLACE_LINK = 1; then
     AC_LIBOBJ([link])
   fi
   gl_UNISTD_MODULE_INDICATOR([link])
+  AC_REQUIRE([gl_SYS_SOCKET_H])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([listen])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([listen])
   AC_CHECK_FUNCS_ONCE([newlocale])
-  gl_LOCALENAME
   AC_CHECK_FUNCS_ONCE([newlocale])
   gt_LOCALE_FR
   gt_LOCALE_FR_UTF8
   gt_LOCALE_JA
   gt_LOCALE_ZH_CN
   gt_LOCALE_FR_UTF8
+  gt_LOCALE_FR_UTF8
+  gt_LOCALE_ZH_CN
   dnl Check for prerequisites for memory fence checks.
   gl_FUNC_MMAP_ANON
   AC_CHECK_HEADERS_ONCE([sys/mman.h])
@@ -1160,21 +1868,38 @@ changequote([, ])dnl
   gl_FUNC_MMAP_ANON
   AC_CHECK_HEADERS_ONCE([sys/mman.h])
   AC_CHECK_FUNCS_ONCE([mprotect])
+  gl_FUNC_MMAP_ANON
+  AC_CHECK_HEADERS_ONCE([sys/mman.h])
+  AC_CHECK_FUNCS_ONCE([mprotect])
+  gl_FUNC_NANOSLEEP
+  if test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1; then
+    AC_LIBOBJ([nanosleep])
+    gl_PREREQ_NANOSLEEP
+  fi
+  gl_TIME_MODULE_INDICATOR([nanosleep])
+  AC_CHECK_DECLS_ONCE([alarm])
+  gl_HEADER_NETINET_IN
+  AC_PROG_MKDIR_P
   gt_LOCALE_FR
   gt_LOCALE_FR_UTF8
-  gl_FUNC_OPENDIR
-  if test $HAVE_OPENDIR = 0 || test $REPLACE_OPENDIR = 1; then
-    AC_LIBOBJ([opendir])
-  fi
-  gl_DIRENT_MODULE_INDICATOR([opendir])
-  AC_EGREP_CPP([notposix], [[
-  #if defined _MSC_VER || defined __MINGW32__
-    notposix
-  #endif
-    ]],
-    [posix_spawn_ported=no],
-    [posix_spawn_ported=yes])
-  AM_CONDITIONAL([POSIX_SPAWN_PORTED], [test $posix_spawn_ported = yes])
+  gl_FUNC_PERROR
+  if test $REPLACE_PERROR = 1; then
+    AC_LIBOBJ([perror])
+  fi
+  gl_STRING_MODULE_INDICATOR([perror])
+  gl_PTHREAD_H
+  gl_PTHREAD_H_REQUIRE_DEFAULTS
+  gl_PTHREAD_THREAD
+  if test $HAVE_PTHREAD_CREATE = 0 || test $REPLACE_PTHREAD_CREATE = 1; then
+    AC_LIBOBJ([pthread-thread])
+  fi
+  gl_PTHREAD_MODULE_INDICATOR([pthread-thread])
+  gl_FUNC_PTHREAD_SIGMASK
+  if test $HAVE_PTHREAD_SIGMASK = 0 || test $REPLACE_PTHREAD_SIGMASK = 1; then
+    AC_LIBOBJ([pthread_sigmask])
+    gl_PREREQ_PTHREAD_SIGMASK
+  fi
+  gl_SIGNAL_MODULE_INDICATOR([pthread_sigmask])
   gl_FUNC_PUTENV
   if test $REPLACE_PUTENV = 1; then
     AC_LIBOBJ([putenv])
@@ -1190,44 +1915,70 @@ changequote([, ])dnl
   gl_FUNC_MMAP_ANON
   AC_CHECK_HEADERS_ONCE([sys/mman.h])
   AC_CHECK_FUNCS_ONCE([mprotect])
-  gl_FUNC_READDIR
-  if test $HAVE_READDIR = 0; then
-    AC_LIBOBJ([readdir])
-  fi
-  gl_DIRENT_MODULE_INDICATOR([readdir])
+  gl_PREREQ_READ_FILE
+  gl_FUNC_SCHED_YIELD
+  if test $HAVE_SCHED_YIELD = 0 || test $REPLACE_SCHED_YIELD = 1; then
+    AC_LIBOBJ([sched_yield])
+  fi
+  gl_SCHED_MODULE_INDICATOR([sched_yield])
+  gl_FUNC_SELECT
+  if test $REPLACE_SELECT = 1; then
+    AC_LIBOBJ([select])
+  fi
+  gl_SYS_SELECT_MODULE_INDICATOR([select])
+  AC_CHECK_HEADERS_ONCE([sys/wait.h])
   gl_FUNC_SETENV
   if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then
     AC_LIBOBJ([setenv])
   fi
   gl_STDLIB_MODULE_INDICATOR([setenv])
-  gl_FUNC_SETLOCALE
-  if test $REPLACE_SETLOCALE = 1; then
-    AC_LIBOBJ([setlocale])
-    gl_PREREQ_SETLOCALE
-  fi
-  gl_LOCALE_MODULE_INDICATOR([setlocale])
   gt_LOCALE_FR
   gt_LOCALE_FR_UTF8
   gt_LOCALE_JA
   gt_LOCALE_ZH_CN
+  AC_REQUIRE([gl_SYS_SOCKET_H])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([setsockopt])
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([setsockopt])
   AC_REQUIRE([gl_FLOAT_EXPONENT_LOCATION])
   AC_REQUIRE([gl_DOUBLE_EXPONENT_LOCATION])
   AC_REQUIRE([gl_LONG_DOUBLE_EXPONENT_LOCATION])
+  AC_CHECK_FUNCS_ONCE([setrlimit])
+  gl_FUNC_MMAP_ANON
   gl_FUNC_SLEEP
   if test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1; then
     AC_LIBOBJ([sleep])
   fi
   gl_UNISTD_MODULE_INDICATOR([sleep])
   AC_CHECK_DECLS_ONCE([alarm])
-  gl_STDALIGN_H
+  AC_REQUIRE([gl_SYS_SOCKET_H])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    AC_LIBOBJ([socket])
+  fi
+  # When this module is used, sockets may actually occur as file descriptors,
+  # hence it is worth warning if the modules 'close' and 'ioctl' are not used.
+  m4_ifdef([gl_UNISTD_H_DEFAULTS], [gl_UNISTD_H_REQUIRE_DEFAULTS])
+  m4_ifdef([gl_SYS_IOCTL_H_DEFAULTS], [gl_SYS_IOCTL_H_REQUIRE_DEFAULTS])
+  AC_REQUIRE([gl_PREREQ_SYS_H_WINSOCK2])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+    SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=1
+  fi
+  gl_SYS_SOCKET_MODULE_INDICATOR([socket])
+  AC_REQUIRE([gl_SOCKETLIB])
+  AC_REQUIRE([gl_SOCKETS])
+  gl_TYPE_SOCKLEN_T
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
-  gl_FUNC_STRDUP_POSIX
-  if test $ac_cv_func_strdup = no || test $REPLACE_STRDUP = 1; then
-    AC_LIBOBJ([strdup])
-    gl_PREREQ_STRDUP
-  fi
-  gl_STRING_MODULE_INDICATOR([strdup])
+  gl_FUNC_STRERROR_R
+  if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then
+    AC_LIBOBJ([strerror_r])
+    gl_PREREQ_STRERROR_R
+  fi
+  gl_STRING_MODULE_INDICATOR([strerror_r])
+  dnl For the modules argp, error.
+  gl_MODULE_INDICATOR([strerror_r-posix])
   dnl Check for prerequisites for memory fence checks.
   gl_FUNC_MMAP_ANON
   AC_CHECK_HEADERS_ONCE([sys/mman.h])
@@ -1236,11 +1987,30 @@ changequote([, ])dnl
   gl_FUNC_MMAP_ANON
   AC_CHECK_HEADERS_ONCE([sys/mman.h])
   AC_CHECK_FUNCS_ONCE([mprotect])
+  gt_LOCALE_FR
+  gt_LOCALE_FR_UTF8
   gl_FUNC_SYMLINK
   if test $HAVE_SYMLINK = 0 || test $REPLACE_SYMLINK = 1; then
     AC_LIBOBJ([symlink])
   fi
   gl_UNISTD_MODULE_INDICATOR([symlink])
+  gl_SYS_IOCTL_H
+  gl_SYS_IOCTL_H_REQUIRE_DEFAULTS
+  AC_PROG_MKDIR_P
+  gl_SYS_SELECT_H
+  gl_SYS_SELECT_H_REQUIRE_DEFAULTS
+  AC_PROG_MKDIR_P
+  gl_SYS_SOCKET_H
+  gl_SYS_SOCKET_H_REQUIRE_DEFAULTS
+  AC_PROG_MKDIR_P
+  AC_CHECK_FUNCS_ONCE([shutdown])
+  gl_SYS_TIME_H
+  gl_SYS_TIME_H_REQUIRE_DEFAULTS
+  AC_PROG_MKDIR_P
+  gl_SYS_UIO_H
+  gl_SYS_UIO_H_REQUIRE_DEFAULTS
+  AC_PROG_MKDIR_P
+  gl_THREAD
   gl_FUNC_UNSETENV
   if test $HAVE_UNSETENV = 0 || test $REPLACE_UNSETENV = 1; then
     AC_LIBOBJ([unsetenv])
@@ -1252,6 +2022,9 @@ changequote([, ])dnl
   AC_REQUIRE([gl_LONG_DOUBLE_VS_DOUBLE])
   abs_aux_dir=`cd "$ac_aux_dir"; pwd`
   AC_SUBST([abs_aux_dir])
+  gl_FUNC_MMAP_ANON
+  AC_REQUIRE([AC_C_INLINE])
+  AC_CHECK_FUNCS_ONCE([mquery pstat_getprocvm])
   gt_LOCALE_FR
   gt_LOCALE_FR_UTF8
   gt_LOCALE_JA
@@ -1268,12 +2041,19 @@ changequote([, ])dnl
     gl_PREREQ_WCTOMB
   fi
   gl_STDLIB_MODULE_INDICATOR([wctomb])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      AC_LIBOBJ([windows-thread])
+      ;;
+  esac
   gl_FUNC_WRITE
   if test $REPLACE_WRITE = 1; then
     AC_LIBOBJ([write])
     gl_PREREQ_WRITE
   fi
   gl_UNISTD_MODULE_INDICATOR([write])
+  AC_REQUIRE([gl_YIELD])
   m4_popdef([gl_MODULE_INDICATOR_CONDITION])
   m4_ifval(M4tests_LIBSOURCES_LIST, [
     m4_syscmd([test ! -d ]m4_defn([M4tests_LIBSOURCES_DIR])[ ||
@@ -1286,6 +2066,8 @@ changequote([, ])dnl
       m4_if(m4_sysval, [0], [],
         [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
   ])
+  m4_popdef([GL_MODULE_INDICATOR_PREFIX])
+  m4_popdef([GL_MACRO_PREFIX])
   m4_popdef([M4tests_LIBSOURCES_DIR])
   m4_popdef([M4tests_LIBSOURCES_LIST])
   m4_popdef([AC_LIBSOURCES])
@@ -1378,11 +2160,6 @@ AC_DEFUN([M4_FILE_LIST], [
   build-aux/gitlog-to-changelog
   build-aux/gnu-web-doc-update
   build-aux/gnupload
-  build-aux/snippet/_Noreturn.h
-  build-aux/snippet/arg-nonnull.h
-  build-aux/snippet/c++defs.h
-  build-aux/snippet/unused-parameter.h
-  build-aux/snippet/warn-on-use.h
   build-aux/update-copyright
   build-aux/useless-if-before-free
   build-aux/vc-list-files
@@ -1390,15 +2167,27 @@ AC_DEFUN([M4_FILE_LIST], [
   doc/gendocs_template
   doc/gendocs_template_min
   doc/gpl-3.0.texi
+  lib/_Noreturn.h
+  lib/access.c
   lib/alignof.h
   lib/alloca.in.h
+  lib/arg-nonnull.h
   lib/asnprintf.c
   lib/asprintf.c
+  lib/assure.h
+  lib/asyncsafe-spin.c
+  lib/asyncsafe-spin.h
+  lib/at-func.c
+  lib/attribute.h
   lib/basename-lgpl.c
+  lib/basename-lgpl.h
   lib/basename.c
   lib/binary-io.c
   lib/binary-io.h
+  lib/bitrotate.c
+  lib/bitrotate.h
   lib/btowc.c
+  lib/c++defs.h
   lib/c-ctype.c
   lib/c-ctype.h
   lib/c-stack.c
@@ -1407,7 +2196,16 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/c-strcasecmp.c
   lib/c-strcaseeq.h
   lib/c-strncasecmp.c
+  lib/calloc.c
   lib/canonicalize-lgpl.c
+  lib/canonicalize.c
+  lib/canonicalize.h
+  lib/cdefs.h
+  lib/chdir-long.c
+  lib/chdir-long.h
+  lib/clean-temp-private.h
+  lib/clean-temp-simple.c
+  lib/clean-temp-simple.h
   lib/clean-temp.c
   lib/clean-temp.h
   lib/cloexec.c
@@ -1415,18 +2213,25 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/close-stream.c
   lib/close-stream.h
   lib/close.c
+  lib/closedir.c
   lib/closein.c
   lib/closein.h
   lib/closeout.c
   lib/closeout.h
-  lib/config.charset
+  lib/concat-filename.c
+  lib/concat-filename.h
+  lib/dirent-private.h
+  lib/dirent.in.h
+  lib/dirfd.c
   lib/dirname-lgpl.c
   lib/dirname.c
   lib/dirname.h
-  lib/dosname.h
   lib/dup-safer-flag.c
   lib/dup-safer.c
+  lib/dup.c
   lib/dup2.c
+  lib/dynarray.h
+  lib/eloop-threshold.h
   lib/errno.in.h
   lib/error.c
   lib/error.h
@@ -1436,6 +2241,7 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/exitfail.h
   lib/fatal-signal.c
   lib/fatal-signal.h
+  lib/fchdir.c
   lib/fclose.c
   lib/fcntl.c
   lib/fcntl.in.h
@@ -1443,10 +2249,17 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/fd-hook.h
   lib/fd-safer-flag.c
   lib/fd-safer.c
+  lib/fdopendir.c
   lib/fflush.c
+  lib/file-set.c
+  lib/file-set.h
+  lib/filename.h
   lib/filenamecat-lgpl.c
   lib/filenamecat.c
   lib/filenamecat.h
+  lib/findprog-in.c
+  lib/findprog.h
+  lib/flexmember.h
   lib/float+.h
   lib/float.c
   lib/float.in.h
@@ -1460,29 +2273,43 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/freadahead.h
   lib/freading.c
   lib/freading.h
+  lib/free.c
   lib/frexp.c
   lib/frexpl.c
   lib/fseek.c
   lib/fseeko.c
   lib/fstat.c
+  lib/fstatat.c
   lib/ftell.c
   lib/ftello.c
+  lib/getcwd-lgpl.c
+  lib/getcwd.c
   lib/getdtablesize.c
+  lib/getopt-cdefs.in.h
+  lib/getopt-core.h
+  lib/getopt-ext.h
+  lib/getopt-pfx-core.h
+  lib/getopt-pfx-ext.h
   lib/getopt.c
   lib/getopt.in.h
   lib/getopt1.c
   lib/getopt_int.h
+  lib/getpagesize.c
   lib/getprogname.c
   lib/getprogname.h
+  lib/getrandom.c
   lib/gettext.h
-  lib/gettimeofday.c
-  lib/gl_anyhash_list1.h
-  lib/gl_anyhash_list2.h
+  lib/gl_anyhash1.h
+  lib/gl_anyhash2.h
+  lib/gl_anyhash_primes.h
   lib/gl_anylinked_list1.h
   lib/gl_anylinked_list2.h
   lib/gl_anytree_oset.h
+  lib/gl_avltree_ordered.h
   lib/gl_avltree_oset.c
   lib/gl_avltree_oset.h
+  lib/gl_linked_list.c
+  lib/gl_linked_list.h
   lib/gl_linkedhash_list.c
   lib/gl_linkedhash_list.h
   lib/gl_list.c
@@ -1500,8 +2327,26 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/glthread/tls.h
   lib/hard-locale.c
   lib/hard-locale.h
+  lib/hash-pjw.c
+  lib/hash-pjw.h
+  lib/hash-triple-simple.c
+  lib/hash-triple.h
+  lib/hash.c
+  lib/hash.h
+  lib/iconv.c
+  lib/iconv.in.h
+  lib/iconv_close.c
+  lib/iconv_open-aix.gperf
+  lib/iconv_open-hpux.gperf
+  lib/iconv_open-irix.gperf
+  lib/iconv_open-osf.gperf
+  lib/iconv_open-solaris.gperf
+  lib/iconv_open-zos.gperf
+  lib/iconv_open.c
+  lib/idx.h
   lib/ignore-value.h
   lib/intprops.h
+  lib/inttypes.in.h
   lib/isnan.c
   lib/isnand-nolibm.h
   lib/isnand.c
@@ -1509,31 +2354,67 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/isnanf.c
   lib/isnanl-nolibm.h
   lib/isnanl.c
+  lib/iswblank.c
+  lib/iswdigit.c
+  lib/iswxdigit.c
   lib/itold.c
   lib/langinfo.in.h
+  lib/lc-charset-dispatch.c
+  lib/lc-charset-dispatch.h
+  lib/libc-config.h
   lib/limits.in.h
   lib/localcharset.c
   lib/localcharset.h
   lib/locale.in.h
   lib/localeconv.c
+  lib/localename-table.c
+  lib/localename-table.h
+  lib/localename.c
+  lib/localename.h
   lib/lseek.c
   lib/lstat.c
   lib/malloc.c
+  lib/malloc/dynarray-skeleton.c
+  lib/malloc/dynarray.h
+  lib/malloc/dynarray_at_failure.c
+  lib/malloc/dynarray_emplace_enlarge.c
+  lib/malloc/dynarray_finalize.c
+  lib/malloc/dynarray_resize.c
+  lib/malloc/dynarray_resize_clear.c
+  lib/malloc/scratch_buffer.h
+  lib/malloc/scratch_buffer_dupfree.c
+  lib/malloc/scratch_buffer_grow.c
+  lib/malloc/scratch_buffer_grow_preserve.c
+  lib/malloc/scratch_buffer_set_array_size.c
   lib/malloca.c
   lib/malloca.h
-  lib/malloca.valgrind
   lib/math.c
   lib/math.in.h
+  lib/mbchar.c
+  lib/mbchar.h
+  lib/mbiter.c
+  lib/mbiter.h
+  lib/mbrtowc-impl-utf8.h
+  lib/mbrtowc-impl.h
   lib/mbrtowc.c
   lib/mbsinit.c
+  lib/mbslen.c
+  lib/mbsstr.c
   lib/mbtowc-impl.h
+  lib/mbtowc-lock.c
+  lib/mbtowc-lock.h
   lib/mbtowc.c
+  lib/mbuiter.c
+  lib/mbuiter.h
   lib/memchr.c
   lib/memchr.valgrind
   lib/memchr2.c
   lib/memchr2.h
   lib/memchr2.valgrind
+  lib/mempcpy.c
+  lib/memrchr.c
   lib/minmax.h
+  lib/mkdir.c
   lib/mkdtemp.c
   lib/mkstemp-safer.c
   lib/mkstemp.c
@@ -1541,12 +2422,22 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/msvc-inval.h
   lib/msvc-nothrow.c
   lib/msvc-nothrow.h
+  lib/nl_langinfo-lock.c
   lib/nl_langinfo.c
   lib/obstack.c
   lib/obstack.h
   lib/open.c
+  lib/openat-die.c
+  lib/openat-priv.h
+  lib/openat-proc.c
+  lib/openat.c
+  lib/openat.h
+  lib/opendir.c
+  lib/os2-spawn.c
+  lib/os2-spawn.h
   lib/pathmax.h
   lib/pipe-safer.c
+  lib/pipe.c
   lib/pipe2-safer.c
   lib/pipe2.c
   lib/printf-args.c
@@ -1559,15 +2450,18 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/printf-parse.h
   lib/progname.c
   lib/progname.h
+  lib/propername.c
+  lib/propername.h
   lib/quote.h
   lib/quotearg.c
   lib/quotearg.h
   lib/raise.c
   lib/rawmemchr.c
   lib/rawmemchr.valgrind
+  lib/readdir.c
   lib/readlink.c
-  lib/ref-add.sin
-  lib/ref-del.sin
+  lib/realloc.c
+  lib/reallocarray.c
   lib/regcomp.c
   lib/regex.c
   lib/regex.h
@@ -1575,10 +2469,18 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/regex_internal.h
   lib/regexec.c
   lib/rename.c
+  lib/rewinddir.c
   lib/rmdir.c
   lib/same-inode.h
+  lib/save-cwd.c
+  lib/save-cwd.h
   lib/sched.in.h
+  lib/scratch_buffer.h
   lib/secure_getenv.c
+  lib/setlocale-lock.c
+  lib/setlocale.c
+  lib/setlocale_null.c
+  lib/setlocale_null.h
   lib/sig-handler.c
   lib/sig-handler.h
   lib/sigaction.c
@@ -1588,11 +2490,15 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/signbitf.c
   lib/signbitl.c
   lib/sigprocmask.c
+  lib/sigsegv.c
+  lib/sigsegv.in.h
   lib/size_max.h
   lib/snprintf.c
   lib/spawn-pipe.c
   lib/spawn-pipe.h
+  lib/spawn.c
   lib/spawn.in.h
+  lib/spawn_faction_addchdir.c
   lib/spawn_faction_addclose.c
   lib/spawn_faction_adddup2.c
   lib/spawn_faction_addopen.c
@@ -1602,10 +2508,18 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/spawnattr_destroy.c
   lib/spawnattr_init.c
   lib/spawnattr_setflags.c
+  lib/spawnattr_setpgroup.c
   lib/spawnattr_setsigmask.c
   lib/spawni.c
   lib/spawnp.c
+  lib/stackvma.c
+  lib/stackvma.h
+  lib/stat-time.c
+  lib/stat-time.h
+  lib/stat-w32.c
+  lib/stat-w32.h
   lib/stat.c
+  lib/stdalign.in.h
   lib/stdarg.in.h
   lib/stdbool.in.h
   lib/stddef.in.h
@@ -1618,34 +2532,53 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/stdlib--.h
   lib/stdlib-safer.h
   lib/stdlib.in.h
+  lib/stpcpy.c
+  lib/str-kmp.h
   lib/str-two-way.h
   lib/strchrnul.c
   lib/strchrnul.valgrind
+  lib/strdup.c
   lib/streq.h
   lib/strerror-override.c
   lib/strerror-override.h
   lib/strerror.c
+  lib/striconv.c
+  lib/striconv.h
   lib/string.in.h
   lib/stripslash.c
   lib/strndup.c
   lib/strnlen.c
+  lib/strnlen1.c
+  lib/strnlen1.h
   lib/strsignal.c
   lib/strstr.c
   lib/strtod.c
+  lib/sys_random.in.h
   lib/sys_stat.in.h
-  lib/sys_time.in.h
   lib/sys_types.in.h
   lib/sys_wait.in.h
   lib/tempname.c
   lib/tempname.h
+  lib/thread-optim.h
   lib/time.in.h
   lib/tmpdir.c
   lib/tmpdir.h
+  lib/trim.c
+  lib/trim.h
   lib/unistd--.h
   lib/unistd-safer.h
   lib/unistd.c
   lib/unistd.in.h
+  lib/unistr.in.h
+  lib/unistr/u8-mbtoucr.c
+  lib/unistr/u8-uctomb-aux.c
+  lib/unistr/u8-uctomb.c
+  lib/unitypes.in.h
+  lib/uniwidth.in.h
+  lib/uniwidth/cjk.h
+  lib/uniwidth/width.c
   lib/unlocked-io.h
+  lib/unused-parameter.h
   lib/vasnprintf.c
   lib/vasnprintf.h
   lib/vasprintf.c
@@ -1655,14 +2588,30 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/version-etc-fsf.c
   lib/version-etc.c
   lib/version-etc.h
-  lib/w32spawn.h
   lib/wait-process.c
   lib/wait-process.h
   lib/waitpid.c
+  lib/warn-on-use.h
   lib/wchar.in.h
   lib/wcrtomb.c
   lib/wctype-h.c
   lib/wctype.in.h
+  lib/wcwidth.c
+  lib/windows-initguard.h
+  lib/windows-mutex.c
+  lib/windows-mutex.h
+  lib/windows-once.c
+  lib/windows-once.h
+  lib/windows-recmutex.c
+  lib/windows-recmutex.h
+  lib/windows-rwlock.c
+  lib/windows-rwlock.h
+  lib/windows-spawn.c
+  lib/windows-spawn.h
+  lib/windows-spin.c
+  lib/windows-spin.h
+  lib/windows-tls.c
+  lib/windows-tls.h
   lib/xalloc-die.c
   lib/xalloc-oversized.h
   lib/xalloc.h
@@ -1674,54 +2623,66 @@ AC_DEFUN([M4_FILE_LIST], [
   lib/xprintf.h
   lib/xsize.c
   lib/xsize.h
+  lib/xstriconv.c
+  lib/xstriconv.h
   lib/xstrndup.c
   lib/xstrndup.h
   lib/xvasprintf.c
   lib/xvasprintf.h
   m4/00gnulib.m4
+  m4/__inline.m4
   m4/absolute-header.m4
+  m4/access.m4
   m4/alloca.m4
   m4/ansi-c++.m4
+  m4/arpa_inet_h.m4
   m4/asm-underscore.m4
   m4/assert.m4
   m4/autobuild.m4
   m4/btowc.m4
   m4/builtin-expect.m4
   m4/c-stack.m4
+  m4/calloc.m4
   m4/canonicalize.m4
-  m4/close-stream.m4
+  m4/chdir-long.m4
+  m4/clock_time.m4
   m4/close.m4
   m4/closedir.m4
-  m4/closein.m4
-  m4/closeout.m4
   m4/codeset.m4
   m4/config-h.m4
   m4/configmake.m4
-  m4/ctype.m4
+  m4/creat.m4
+  m4/ctype_h.m4
+  m4/d-ino.m4
   m4/dirent_h.m4
   m4/dirfd.m4
-  m4/dirname.m4
   m4/double-slash-root.m4
   m4/dup.m4
   m4/dup2.m4
+  m4/eaccess.m4
   m4/eealloc.m4
   m4/environ.m4
   m4/errno_h.m4
   m4/error.m4
   m4/execute.m4
+  m4/explicit_bzero.m4
   m4/exponentd.m4
   m4/exponentf.m4
   m4/exponentl.m4
   m4/extensions.m4
   m4/extern-inline.m4
   m4/fatal-signal.m4
+  m4/fchdir.m4
   m4/fclose.m4
   m4/fcntl-o.m4
   m4/fcntl.m4
   m4/fcntl_h.m4
   m4/fdopen.m4
+  m4/fdopendir.m4
   m4/fflush.m4
   m4/filenamecat.m4
+  m4/findprog-in.m4
+  m4/findprog.m4
   m4/flexmember.m4
   m4/float_h.m4
   m4/fopen.m4
@@ -1730,32 +2691,48 @@ AC_DEFUN([M4_FILE_LIST], [
   m4/fpurge.m4
   m4/freadahead.m4
   m4/freading.m4
+  m4/free.m4
+  m4/freopen.m4
   m4/frexp.m4
   m4/frexpl.m4
   m4/fseek.m4
   m4/fseeko.m4
   m4/fstat.m4
+  m4/fstatat.m4
   m4/ftell.m4
   m4/ftello.m4
+  m4/ftruncate.m4
+  m4/getcwd-abort-bug.m4
+  m4/getcwd-path-max.m4
   m4/getcwd.m4
   m4/getdtablesize.m4
   m4/getopt.m4
   m4/getpagesize.m4
   m4/getprogname.m4
+  m4/getrandom.m4
   m4/gettimeofday.m4
-  m4/glibc21.m4
   m4/gnulib-common.m4
-  m4/hard-locale.m4
+  m4/host-cpu-c-abi.m4
+  m4/iconv.m4
+  m4/iconv_h.m4
+  m4/iconv_open.m4
   m4/include_next.m4
+  m4/inet_pton.m4
+  m4/inline.m4
+  m4/intl-thread-locale.m4
   m4/intlmacosx.m4
   m4/intmax_t.m4
-  m4/inttypes-pri.m4
+  m4/inttostr.m4
   m4/inttypes.m4
   m4/inttypes_h.m4
+  m4/ioctl.m4
   m4/isblank.m4
   m4/isnand.m4
   m4/isnanf.m4
   m4/isnanl.m4
+  m4/iswblank.m4
+  m4/iswdigit.m4
+  m4/iswxdigit.m4
   m4/langinfo_h.m4
   m4/largefile.m4
   m4/lcmessage.m4
@@ -1765,6 +2742,7 @@ AC_DEFUN([M4_FILE_LIST], [
   m4/lib-link.m4
   m4/lib-prefix.m4
   m4/libsigsegv.m4
+  m4/libunistring-base.m4
   m4/limits-h.m4
   m4/link.m4
   m4/localcharset.m4
@@ -1776,19 +2754,25 @@ AC_DEFUN([M4_FILE_LIST], [
   m4/localeconv.m4
   m4/localename.m4
   m4/lock.m4
-  m4/longlong.m4
   m4/lseek.m4
   m4/lstat.m4
   m4/malloc.m4
   m4/malloca.m4
+  m4/manywarnings-c++.m4
   m4/manywarnings.m4
   m4/math_h.m4
+  m4/mbchar.m4
+  m4/mbiter.m4
   m4/mbrtowc.m4
   m4/mbsinit.m4
+  m4/mbslen.m4
   m4/mbstate_t.m4
   m4/mbtowc.m4
   m4/memchr.m4
+  m4/mempcpy.m4
+  m4/memrchr.m4
   m4/minmax.m4
+  m4/mkdir.m4
   m4/mkdtemp.m4
   m4/mkstemp.m4
   m4/mmap-anon.m4
@@ -1796,33 +2780,58 @@ AC_DEFUN([M4_FILE_LIST], [
   m4/msvc-inval.m4
   m4/msvc-nothrow.m4
   m4/multiarch.m4
+  m4/musl.m4
+  m4/nanosleep.m4
+  m4/netinet_in_h.m4
   m4/nl_langinfo.m4
   m4/nocrash.m4
   m4/obstack.m4
   m4/off_t.m4
+  m4/open-cloexec.m4
+  m4/open-slash.m4
   m4/open.m4
+  m4/openat.m4
   m4/opendir.m4
   m4/pathmax.m4
+  m4/perror.m4
+  m4/pid_t.m4
+  m4/pipe.m4
   m4/pipe2.m4
   m4/posix_spawn.m4
+  m4/posix_spawn_faction_addchdir.m4
   m4/printf-frexp.m4
   m4/printf-frexpl.m4
   m4/printf.m4
+  m4/pthread-thread.m4
+  m4/pthread_h.m4
+  m4/pthread_rwlock_rdlock.m4
+  m4/pthread_sigmask.m4
   m4/putenv.m4
   m4/quotearg.m4
   m4/raise.m4
   m4/rawmemchr.m4
+  m4/read-file.m4
   m4/readdir.m4
   m4/readlink.m4
+  m4/realloc.m4
+  m4/reallocarray.m4
   m4/regex.m4
   m4/rename.m4
+  m4/rewinddir.m4
   m4/rmdir.m4
+  m4/save-cwd.m4
   m4/sched_h.m4
+  m4/sched_yield.m4
   m4/secure_getenv.m4
+  m4/select.m4
+  m4/semaphore.m4
   m4/setenv.m4
   m4/setlocale.m4
+  m4/setlocale_null.m4
+  m4/sh-filename.m4
   m4/sig_atomic_t.m4
   m4/sigaction.m4
+  m4/sigaltstack.m4
   m4/signal_h.m4
   m4/signalblocking.m4
   m4/signbit.m4
@@ -1830,10 +2839,18 @@ AC_DEFUN([M4_FILE_LIST], [
   m4/size_max.m4
   m4/sleep.m4
   m4/snprintf.m4
+  m4/socketlib.m4
+  m4/sockets.m4
+  m4/socklen.m4
+  m4/sockpfaf.m4
+  m4/sparcv8+.m4
   m4/spawn-pipe.m4
   m4/spawn_h.m4
   m4/ssize_t.m4
+  m4/stack-direction.m4
+  m4/stat-time.m4
   m4/stat.m4
+  m4/std-gnu11.m4
   m4/stdalign.m4
   m4/stdarg.m4
   m4/stdbool.m4
@@ -1842,9 +2859,11 @@ AC_DEFUN([M4_FILE_LIST], [
   m4/stdint_h.m4
   m4/stdio_h.m4
   m4/stdlib_h.m4
+  m4/stpcpy.m4
   m4/strchrnul.m4
   m4/strdup.m4
   m4/strerror.m4
+  m4/strerror_r.m4
   m4/string_h.m4
   m4/strndup.m4
   m4/strnlen.m4
@@ -1852,12 +2871,17 @@ AC_DEFUN([M4_FILE_LIST], [
   m4/strstr.m4
   m4/strtod.m4
   m4/symlink.m4
+  m4/sys_ioctl_h.m4
+  m4/sys_random_h.m4
+  m4/sys_select_h.m4
   m4/sys_socket_h.m4
   m4/sys_stat_h.m4
   m4/sys_time_h.m4
   m4/sys_types_h.m4
+  m4/sys_uio_h.m4
   m4/sys_wait_h.m4
   m4/tempname.m4
+  m4/thread.m4
   m4/threadlib.m4
   m4/time_h.m4
   m4/tls.m4
@@ -1870,6 +2894,7 @@ AC_DEFUN([M4_FILE_LIST], [
   m4/vasprintf-posix.m4
   m4/vasprintf.m4
   m4/version-etc.m4
+  m4/visibility.m4
   m4/wait-process.m4
   m4/waitpid.m4
   m4/warn-on-use.m4
@@ -1880,27 +2905,47 @@ AC_DEFUN([M4_FILE_LIST], [
   m4/wctob.m4
   m4/wctomb.m4
   m4/wctype_h.m4
+  m4/wcwidth.m4
   m4/wint_t.m4
   m4/write.m4
   m4/xalloc.m4
   m4/xsize.m4
   m4/xstrndup.m4
   m4/xvasprintf.m4
+  m4/yield.m4
+  m4/zzgnulib.m4
+  tests/altstack-util.h
+  tests/atomic-int-gnulib.h
+  tests/executable-script
+  tests/executable-script.sh
+  tests/executable-shell-script
   tests/infinity.h
   tests/init.sh
+  tests/locale.c
   tests/macros.h
   tests/minus-zero.h
+  tests/mmap-anon-util.h
   tests/nan.h
+  tests/nap.h
+  tests/null-ptr.h
   tests/randomd.c
   tests/randoml.c
   tests/signature.h
+  tests/test-accept.c
+  tests/test-access.c
   tests/test-alignof.c
   tests/test-alloca-opt.c
+  tests/test-arpa_inet-c++.cc
+  tests/test-arpa_inet.c
   tests/test-array_list.c
   tests/test-array_oset.c
+  tests/test-asyncsafe-spin1.c
+  tests/test-asyncsafe-spin2.c
   tests/test-avltree_oset.c
   tests/test-binary-io.c
   tests/test-binary-io.sh
+  tests/test-bind.c
+  tests/test-bitrotate.c
   tests/test-btowc.c
   tests/test-btowc1.sh
   tests/test-btowc2.sh
@@ -1911,12 +2956,18 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-c-strcase.sh
   tests/test-c-strcasecmp.c
   tests/test-c-strncasecmp.c
+  tests/test-calloc-gnu.c
   tests/test-canonicalize-lgpl.c
+  tests/test-canonicalize.c
   tests/test-chdir.c
   tests/test-cloexec.c
   tests/test-close.c
   tests/test-closein.c
   tests/test-closein.sh
+  tests/test-connect.c
+  tests/test-creat.c
+  tests/test-ctype-c++.cc
+  tests/test-ctype-c++2.cc
   tests/test-ctype.c
   tests/test-dirent-c++.cc
   tests/test-dirent.c
@@ -1924,19 +2975,32 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-dup-safer.c
   tests/test-dup.c
   tests/test-dup2.c
+  tests/test-dynarray.c
   tests/test-environ.c
+  tests/test-errno-c++.cc
+  tests/test-errno-c++2.cc
   tests/test-errno.c
+  tests/test-execute-child.c
+  tests/test-execute-main.c
+  tests/test-execute-script.c
+  tests/test-execute.sh
+  tests/test-explicit_bzero.c
+  tests/test-fchdir.c
   tests/test-fclose.c
   tests/test-fcntl-h-c++.cc
   tests/test-fcntl-h.c
   tests/test-fcntl.c
   tests/test-fdopen.c
+  tests/test-fdopendir.c
   tests/test-fflush.c
   tests/test-fflush2.c
   tests/test-fflush2.sh
   tests/test-fgetc.c
   tests/test-filenamecat.c
+  tests/test-float-c++.cc
+  tests/test-float-c++2.cc
   tests/test-float.c
+  tests/test-fopen-gnu.c
   tests/test-fopen-safer.c
   tests/test-fopen.c
   tests/test-fopen.h
@@ -1948,6 +3012,8 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-freadahead.c
   tests/test-freadahead.sh
   tests/test-freading.c
+  tests/test-free.c
+  tests/test-freopen.c
   tests/test-frexp.c
   tests/test-frexp.h
   tests/test-frexpl.c
@@ -1962,6 +3028,7 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-fseeko4.c
   tests/test-fseeko4.sh
   tests/test-fstat.c
+  tests/test-fstatat.c
   tests/test-ftell.c
   tests/test-ftell.sh
   tests/test-ftell2.sh
@@ -1972,20 +3039,34 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-ftello3.c
   tests/test-ftello4.c
   tests/test-ftello4.sh
+  tests/test-ftruncate.c
+  tests/test-ftruncate.sh
   tests/test-fwrite.c
   tests/test-getcwd-lgpl.c
+  tests/test-getcwd.c
+  tests/test-getcwd.sh
   tests/test-getdtablesize.c
   tests/test-getopt-gnu.c
   tests/test-getopt-main.h
-  tests/test-getopt-posix.c
   tests/test-getopt.h
   tests/test-getopt_long.h
   tests/test-getprogname.c
+  tests/test-getrandom.c
   tests/test-gettimeofday.c
+  tests/test-hard-locale.c
+  tests/test-hash.c
+  tests/test-iconv-h-c++.cc
+  tests/test-iconv-h.c
+  tests/test-iconv.c
   tests/test-ignore-value.c
+  tests/test-inet_pton.c
   tests/test-init.sh
   tests/test-intprops.c
+  tests/test-inttostr.c
+  tests/test-inttypes-c++.cc
+  tests/test-inttypes-c++2.cc
   tests/test-inttypes.c
+  tests/test-ioctl.c
   tests/test-isblank.c
   tests/test-isnand-nolibm.c
   tests/test-isnand.h
@@ -1993,12 +3074,22 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-isnanf.h
   tests/test-isnanl-nolibm.c
   tests/test-isnanl.h
+  tests/test-iswblank.c
+  tests/test-iswdigit.c
+  tests/test-iswdigit.sh
+  tests/test-iswxdigit.c
+  tests/test-iswxdigit.sh
   tests/test-langinfo-c++.cc
   tests/test-langinfo.c
+  tests/test-limits-h-c++.cc
+  tests/test-limits-h-c++2.cc
   tests/test-limits-h.c
   tests/test-link.c
   tests/test-link.h
+  tests/test-linked_list.c
   tests/test-linkedhash_list.c
+  tests/test-listen.c
+  tests/test-localcharset.c
   tests/test-locale-c++.cc
   tests/test-locale-c++2.cc
   tests/test-locale.c
@@ -2008,6 +3099,7 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-lseek.sh
   tests/test-lstat.c
   tests/test-lstat.h
+  tests/test-malloc-gnu.c
   tests/test-malloca.c
   tests/test-math-c++.cc
   tests/test-math-c++2.cc
@@ -2017,6 +3109,8 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-mbrtowc-w32-3.sh
   tests/test-mbrtowc-w32-4.sh
   tests/test-mbrtowc-w32-5.sh
+  tests/test-mbrtowc-w32-6.sh
+  tests/test-mbrtowc-w32-7.sh
   tests/test-mbrtowc-w32.c
   tests/test-mbrtowc.c
   tests/test-mbrtowc1.sh
@@ -2026,40 +3120,84 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-mbrtowc5.sh
   tests/test-mbsinit.c
   tests/test-mbsinit.sh
+  tests/test-mbsstr1.c
+  tests/test-mbsstr2.c
+  tests/test-mbsstr2.sh
+  tests/test-mbsstr3.c
+  tests/test-mbsstr3.sh
   tests/test-memchr.c
   tests/test-memchr2.c
+  tests/test-memrchr.c
+  tests/test-mkdir.c
+  tests/test-mkdir.h
+  tests/test-nanosleep.c
+  tests/test-netinet_in.c
+  tests/test-nl_langinfo-mt.c
   tests/test-nl_langinfo.c
   tests/test-nl_langinfo.sh
   tests/test-open.c
   tests/test-open.h
+  tests/test-openat.c
+  tests/test-oset-update.h
   tests/test-pathmax.c
+  tests/test-perror.c
+  tests/test-perror.sh
+  tests/test-perror2.c
+  tests/test-pipe.c
   tests/test-pipe2.c
-  tests/test-posix_spawn1.c
-  tests/test-posix_spawn1.in.sh
-  tests/test-posix_spawn2.c
-  tests/test-posix_spawn2.in.sh
+  tests/test-posix_spawn-chdir.c
+  tests/test-posix_spawn-dup2-stdin.c
+  tests/test-posix_spawn-dup2-stdin.in.sh
+  tests/test-posix_spawn-dup2-stdout.c
+  tests/test-posix_spawn-dup2-stdout.in.sh
+  tests/test-posix_spawn-inherit0.c
+  tests/test-posix_spawn-inherit1.c
+  tests/test-posix_spawn-open1.c
+  tests/test-posix_spawn-open2.c
+  tests/test-posix_spawn-script.c
+  tests/test-posix_spawn_file_actions_addchdir.c
   tests/test-posix_spawn_file_actions_addclose.c
   tests/test-posix_spawn_file_actions_adddup2.c
   tests/test-posix_spawn_file_actions_addopen.c
+  tests/test-posix_spawnp-script.c
   tests/test-printf-frexp.c
   tests/test-printf-frexpl.c
+  tests/test-pthread-c++.cc
+  tests/test-pthread-thread.c
+  tests/test-pthread.c
+  tests/test-pthread_sigmask1.c
+  tests/test-pthread_sigmask2.c
   tests/test-quotearg-simple.c
   tests/test-quotearg.h
   tests/test-raise.c
   tests/test-rawmemchr.c
+  tests/test-read-file.c
   tests/test-readlink.c
   tests/test-readlink.h
+  tests/test-realloc-gnu.c
+  tests/test-reallocarray.c
   tests/test-regex.c
   tests/test-rename.c
   tests/test-rename.h
   tests/test-rmdir.c
   tests/test-rmdir.h
   tests/test-sched.c
+  tests/test-scratch-buffer.c
+  tests/test-select-fd.c
+  tests/test-select-in.sh
+  tests/test-select-out.sh
+  tests/test-select-stdin.c
+  tests/test-select.c
+  tests/test-select.h
   tests/test-setenv.c
   tests/test-setlocale1.c
   tests/test-setlocale1.sh
   tests/test-setlocale2.c
   tests/test-setlocale2.sh
+  tests/test-setlocale_null-mt-all.c
+  tests/test-setlocale_null-mt-one.c
+  tests/test-setlocale_null.c
+  tests/test-setsockopt.c
   tests/test-sigaction.c
   tests/test-signal-h-c++.cc
   tests/test-signal-h-c++2.cc
@@ -2068,18 +3206,31 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-sigpipe.c
   tests/test-sigpipe.sh
   tests/test-sigprocmask.c
+  tests/test-sigsegv-catch-segv1.c
+  tests/test-sigsegv-catch-segv2.c
+  tests/test-sigsegv-catch-stackoverflow1.c
+  tests/test-sigsegv-catch-stackoverflow2.c
   tests/test-sleep.c
   tests/test-snprintf.c
+  tests/test-sockets.c
   tests/test-spawn-c++.cc
   tests/test-spawn-pipe-child.c
   tests/test-spawn-pipe-main.c
+  tests/test-spawn-pipe-script.c
   tests/test-spawn-pipe.sh
   tests/test-spawn.c
+  tests/test-stat-time.c
   tests/test-stat.c
   tests/test-stat.h
   tests/test-stdalign.c
+  tests/test-stdbool-c++.cc
+  tests/test-stdbool-c++2.cc
   tests/test-stdbool.c
+  tests/test-stddef-c++.cc
+  tests/test-stddef-c++2.cc
   tests/test-stddef.c
+  tests/test-stdint-c++.cc
+  tests/test-stdint-c++2.cc
   tests/test-stdint.c
   tests/test-stdio-c++.cc
   tests/test-stdio-c++2.cc
@@ -2089,6 +3240,8 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-stdlib.c
   tests/test-strchrnul.c
   tests/test-strerror.c
+  tests/test-strerror_r.c
+  tests/test-striconv.c
   tests/test-string-c++.cc
   tests/test-string-c++2.cc
   tests/test-string.c
@@ -2096,17 +3249,30 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-strsignal.c
   tests/test-strstr.c
   tests/test-strtod.c
+  tests/test-strtod1.c
+  tests/test-strtod1.sh
   tests/test-symlink.c
   tests/test-symlink.h
+  tests/test-sys_ioctl-c++.cc
+  tests/test-sys_ioctl.c
+  tests/test-sys_random-c++.cc
+  tests/test-sys_random.c
+  tests/test-sys_select-c++.cc
+  tests/test-sys_select.c
+  tests/test-sys_socket-c++.cc
+  tests/test-sys_socket.c
   tests/test-sys_stat-c++.cc
   tests/test-sys_stat.c
   tests/test-sys_time-c++.cc
   tests/test-sys_time.c
   tests/test-sys_types-c++.cc
   tests/test-sys_types.c
+  tests/test-sys_uio.c
   tests/test-sys_wait-c++.cc
   tests/test-sys_wait.c
   tests/test-sys_wait.h
+  tests/test-thread_create.c
+  tests/test-thread_self.c
   tests/test-time-c++.cc
   tests/test-time-c++2.cc
   tests/test-time.c
@@ -2119,61 +3285,115 @@ AC_DEFUN([M4_FILE_LIST], [
   tests/test-vasprintf.c
   tests/test-vc-list-files-cvs.sh
   tests/test-vc-list-files-git.sh
+  tests/test-verify-try.c
   tests/test-verify.c
   tests/test-verify.sh
   tests/test-version-etc.c
   tests/test-version-etc.sh
   tests/test-wchar-c++.cc
+  tests/test-wchar-c++2.cc
+  tests/test-wchar-c++3.cc
   tests/test-wchar.c
   tests/test-wcrtomb-w32-1.sh
   tests/test-wcrtomb-w32-2.sh
   tests/test-wcrtomb-w32-3.sh
   tests/test-wcrtomb-w32-4.sh
   tests/test-wcrtomb-w32-5.sh
+  tests/test-wcrtomb-w32-6.sh
+  tests/test-wcrtomb-w32-7.sh
   tests/test-wcrtomb-w32.c
   tests/test-wcrtomb.c
   tests/test-wcrtomb.sh
   tests/test-wctype-h-c++.cc
+  tests/test-wctype-h-c++2.cc
   tests/test-wctype-h.c
+  tests/test-wcwidth.c
   tests/test-write.c
   tests/test-xalloc-die.c
   tests/test-xalloc-die.sh
   tests/test-xvasprintf.c
+  tests/unistr/test-u8-mbtoucr.c
+  tests/unistr/test-u8-uctomb.c
+  tests/uniwidth/test-uc_width.c
+  tests/uniwidth/test-uc_width2.c
+  tests/uniwidth/test-uc_width2.sh
   tests/zerosize-ptr.h
-  tests=lib/closedir.c
+  tests=lib/_Noreturn.h
+  tests=lib/accept.c
+  tests=lib/alloca.c
+  tests=lib/anytostr.c
+  tests=lib/arg-nonnull.h
+  tests=lib/arpa_inet.in.h
+  tests=lib/bind.c
+  tests=lib/c++defs.h
+  tests=lib/concat-filename.h
+  tests=lib/connect.c
+  tests=lib/creat.c
   tests=lib/ctype.in.h
-  tests=lib/dirent-private.h
-  tests=lib/dirent.in.h
-  tests=lib/dirfd.c
-  tests=lib/dup.c
+  tests=lib/explicit_bzero.c
   tests=lib/fdopen.c
-  tests=lib/filename.h
-  tests=lib/flexmember.h
-  tests=lib/getcwd-lgpl.c
-  tests=lib/getpagesize.c
+  tests=lib/findprog.c
+  tests=lib/findprog.h
+  tests=lib/freopen.c
+  tests=lib/ftruncate.c
+  tests=lib/gettimeofday.c
   tests=lib/gl_array_list.c
   tests=lib/gl_array_list.h
   tests=lib/gl_array_oset.c
   tests=lib/gl_array_oset.h
-  tests=lib/inttypes.in.h
+  tests=lib/glthread/thread.c
+  tests=lib/glthread/thread.h
+  tests=lib/glthread/yield.h
+  tests=lib/imaxtostr.c
+  tests=lib/inet_pton.c
+  tests=lib/inttostr.c
+  tests=lib/inttostr.h
+  tests=lib/ioctl.c
   tests=lib/isblank.c
   tests=lib/link.c
-  tests=lib/localename.c
-  tests=lib/localename.h
-  tests=lib/opendir.c
+  tests=lib/listen.c
+  tests=lib/nanosleep.c
+  tests=lib/netinet_in.in.h
+  tests=lib/offtostr.c
+  tests=lib/perror.c
+  tests=lib/pthread-thread.c
+  tests=lib/pthread.in.h
+  tests=lib/pthread_sigmask.c
   tests=lib/putenv.c
-  tests=lib/readdir.c
+  tests=lib/read-file.c
+  tests=lib/read-file.h
+  tests=lib/root-uid.h
+  tests=lib/sched_yield.c
+  tests=lib/select.c
   tests=lib/setenv.c
-  tests=lib/setlocale.c
+  tests=lib/setsockopt.c
   tests=lib/sleep.c
-  tests=lib/stdalign.in.h
-  tests=lib/strdup.c
+  tests=lib/socket.c
+  tests=lib/sockets.c
+  tests=lib/sockets.h
+  tests=lib/strerror_r.c
   tests=lib/symlink.c
+  tests=lib/sys_ioctl.in.h
+  tests=lib/sys_select.in.h
+  tests=lib/sys_socket.c
+  tests=lib/sys_socket.in.h
+  tests=lib/sys_time.in.h
+  tests=lib/sys_uio.in.h
+  tests=lib/uinttostr.c
+  tests=lib/umaxtostr.c
   tests=lib/unsetenv.c
+  tests=lib/unused-parameter.h
+  tests=lib/vma-iter.c
+  tests=lib/vma-iter.h
+  tests=lib/w32sock.h
+  tests=lib/warn-on-use.h
   tests=lib/wctob.c
   tests=lib/wctomb-impl.h
   tests=lib/wctomb.c
+  tests=lib/windows-thread.c
+  tests=lib/windows-thread.h
   tests=lib/write.c
+  tests=lib/xconcat-filename.c
   top/GNUmakefile
   top/maint.mk
 ])
diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4
new file mode 100644 (file)
index 0000000..64e28b1
--- /dev/null
@@ -0,0 +1,675 @@
+# host-cpu-c-abi.m4 serial 14
+dnl Copyright (C) 2002-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible and Sam Steingold.
+
+dnl Sets the HOST_CPU variable to the canonical name of the CPU.
+dnl Sets the HOST_CPU_C_ABI variable to the canonical name of the CPU with its
+dnl C language ABI (application binary interface).
+dnl Also defines __${HOST_CPU}__ and __${HOST_CPU_C_ABI}__ as C macros in
+dnl config.h.
+dnl
+dnl This canonical name can be used to select a particular assembly language
+dnl source file that will interoperate with C code on the given host.
+dnl
+dnl For example:
+dnl * 'i386' and 'sparc' are different canonical names, because code for i386
+dnl   will not run on SPARC CPUs and vice versa. They have different
+dnl   instruction sets.
+dnl * 'sparc' and 'sparc64' are different canonical names, because code for
+dnl   'sparc' and code for 'sparc64' cannot be linked together: 'sparc' code
+dnl   contains 32-bit instructions, whereas 'sparc64' code contains 64-bit
+dnl   instructions. A process on a SPARC CPU can be in 32-bit mode or in 64-bit
+dnl   mode, but not both.
+dnl * 'mips' and 'mipsn32' are different canonical names, because they use
+dnl   different argument passing and return conventions for C functions, and
+dnl   although the instruction set of 'mips' is a large subset of the
+dnl   instruction set of 'mipsn32'.
+dnl * 'mipsn32' and 'mips64' are different canonical names, because they use
+dnl   different sizes for the C types like 'int' and 'void *', and although
+dnl   the instruction sets of 'mipsn32' and 'mips64' are the same.
+dnl * The same canonical name is used for different endiannesses. You can
+dnl   determine the endianness through preprocessor symbols:
+dnl   - 'arm': test __ARMEL__.
+dnl   - 'mips', 'mipsn32', 'mips64': test _MIPSEB vs. _MIPSEL.
+dnl   - 'powerpc64': test _BIG_ENDIAN vs. _LITTLE_ENDIAN.
+dnl * The same name 'i386' is used for CPUs of type i386, i486, i586
+dnl   (Pentium), AMD K7, Pentium II, Pentium IV, etc., because
+dnl   - Instructions that do not exist on all of these CPUs (cmpxchg,
+dnl     MMX, SSE, SSE2, 3DNow! etc.) are not frequently used. If your
+dnl     assembly language source files use such instructions, you will
+dnl     need to make the distinction.
+dnl   - Speed of execution of the common instruction set is reasonable across
+dnl     the entire family of CPUs. If you have assembly language source files
+dnl     that are optimized for particular CPU types (like GNU gmp has), you
+dnl     will need to make the distinction.
+dnl   See <https://en.wikipedia.org/wiki/X86_instruction_listings>.
+AC_DEFUN([gl_HOST_CPU_C_ABI],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_C_ASM])
+  AC_CACHE_CHECK([host CPU and C ABI], [gl_cv_host_cpu_c_abi],
+    [case "$host_cpu" in
+
+changequote(,)dnl
+       i[34567]86 )
+changequote([,])dnl
+         gl_cv_host_cpu_c_abi=i386
+         ;;
+
+       x86_64 )
+         # On x86_64 systems, the C compiler may be generating code in one of
+         # these ABIs:
+         # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+         # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+         #   with native Windows (mingw, MSVC).
+         # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if (defined __x86_64__ || defined __amd64__ \
+                     || defined _M_X64 || defined _M_AMD64)
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if defined __ILP32__ || defined _ILP32
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
+              [gl_cv_host_cpu_c_abi=x86_64-x32],
+              [gl_cv_host_cpu_c_abi=x86_64])],
+           [gl_cv_host_cpu_c_abi=i386])
+         ;;
+
+changequote(,)dnl
+       alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] )
+changequote([,])dnl
+         gl_cv_host_cpu_c_abi=alpha
+         ;;
+
+       arm* | aarch64 )
+         # Assume arm with EABI.
+         # On arm64 systems, the C compiler may be generating code in one of
+         # these ABIs:
+         # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+         # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+         # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#ifdef __aarch64__
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                [[#if defined __ILP32__ || defined _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+              [gl_cv_host_cpu_c_abi=arm64-ilp32],
+              [gl_cv_host_cpu_c_abi=arm64])],
+           [# Don't distinguish little-endian and big-endian arm, since they
+            # don't require different machine code for simple operations and
+            # since the user can distinguish them through the preprocessor
+            # defines __ARMEL__ vs. __ARMEB__.
+            # But distinguish arm which passes floating-point arguments and
+            # return values in integer registers (r0, r1, ...) - this is
+            # gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
+            # passes them in float registers (s0, s1, ...) and double registers
+            # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
+            # sets the preprocessor defines __ARM_PCS (for the first case) and
+            # __ARM_PCS_VFP (for the second case), but older GCC does not.
+            echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
+            # Look for a reference to the register d0 in the .s file.
+            AC_TRY_COMMAND(${CC-cc} $CFLAGS $CPPFLAGS $gl_c_asm_opt conftest.c) >/dev/null 2>&1
+            if LC_ALL=C grep 'd0,' conftest.$gl_asmext >/dev/null; then
+              gl_cv_host_cpu_c_abi=armhf
+            else
+              gl_cv_host_cpu_c_abi=arm
+            fi
+            rm -f conftest*
+           ])
+         ;;
+
+       hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+         # On hppa, the C compiler may be generating 32-bit code or 64-bit
+         # code. In the latter case, it defines _LP64 and __LP64__.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#ifdef __LP64__
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=hppa64],
+           [gl_cv_host_cpu_c_abi=hppa])
+         ;;
+
+       ia64* )
+         # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+         # 32-bit code. In the latter case, it defines _ILP32.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#ifdef _ILP32
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=ia64-ilp32],
+           [gl_cv_host_cpu_c_abi=ia64])
+         ;;
+
+       mips* )
+         # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+         # at 32.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=mips64],
+           [# In the n32 ABI, _ABIN32 is defined, _ABIO32 is not defined (but
+            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIN32.
+            # In the 32 ABI, _ABIO32 is defined, _ABIN32 is not defined (but
+            # may later get defined by <sgidefs.h>), and _MIPS_SIM == _ABIO32.
+            AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if (_MIPS_SIM == _ABIN32)
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
+              [gl_cv_host_cpu_c_abi=mipsn32],
+              [gl_cv_host_cpu_c_abi=mips])])
+         ;;
+
+       powerpc* )
+         # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+         # No need to distinguish them here; the caller may distinguish
+         # them based on the OS.
+         # On powerpc64 systems, the C compiler may still be generating
+         # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+         # be generating 64-bit code.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __powerpc64__ || defined __LP64__
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [# On powerpc64, there are two ABIs on Linux: The AIX compatible
+            # one and the ELFv2 one. The latter defines _CALL_ELF=2.
+            AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if defined _CALL_ELF && _CALL_ELF == 2
+                    int ok;
+                   #else
+                    error fail
+                   #endif
+                 ]])],
+              [gl_cv_host_cpu_c_abi=powerpc64-elfv2],
+              [gl_cv_host_cpu_c_abi=powerpc64])
+           ],
+           [gl_cv_host_cpu_c_abi=powerpc])
+         ;;
+
+       rs6000 )
+         gl_cv_host_cpu_c_abi=powerpc
+         ;;
+
+       riscv32 | riscv64 )
+         # There are 2 architectures (with variants): rv32* and rv64*.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if __riscv_xlen == 64
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [cpu=riscv64],
+           [cpu=riscv32])
+         # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+         # Size of 'long' and 'void *':
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __LP64__
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [main_abi=lp64],
+           [main_abi=ilp32])
+         # Float ABIs:
+         # __riscv_float_abi_double:
+         #   'float' and 'double' are passed in floating-point registers.
+         # __riscv_float_abi_single:
+         #   'float' are passed in floating-point registers.
+         # __riscv_float_abi_soft:
+         #   No values are passed in floating-point registers.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __riscv_float_abi_double
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [float_abi=d],
+           [AC_COMPILE_IFELSE(
+              [AC_LANG_SOURCE(
+                 [[#if defined __riscv_float_abi_single
+                     int ok;
+                   #else
+                     error fail
+                   #endif
+                 ]])],
+              [float_abi=f],
+              [float_abi=''])
+           ])
+         gl_cv_host_cpu_c_abi="${cpu}-${main_abi}${float_abi}"
+         ;;
+
+       s390* )
+         # On s390x, the C compiler may be generating 64-bit (= s390x) code
+         # or 31-bit (= s390) code.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __LP64__ || defined __s390x__
+                  int ok;
+                #else
+                  error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=s390x],
+           [gl_cv_host_cpu_c_abi=s390])
+         ;;
+
+       sparc | sparc64 )
+         # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+         # C compiler still generates 32-bit code.
+         AC_COMPILE_IFELSE(
+           [AC_LANG_SOURCE(
+              [[#if defined __sparcv9 || defined __arch64__
+                 int ok;
+                #else
+                 error fail
+                #endif
+              ]])],
+           [gl_cv_host_cpu_c_abi=sparc64],
+           [gl_cv_host_cpu_c_abi=sparc])
+         ;;
+
+       *)
+         gl_cv_host_cpu_c_abi="$host_cpu"
+         ;;
+     esac
+    ])
+
+  dnl In most cases, $HOST_CPU and $HOST_CPU_C_ABI are the same.
+  HOST_CPU=`echo "$gl_cv_host_cpu_c_abi" | sed -e 's/-.*//'`
+  HOST_CPU_C_ABI="$gl_cv_host_cpu_c_abi"
+  AC_SUBST([HOST_CPU])
+  AC_SUBST([HOST_CPU_C_ABI])
+
+  # This was
+  #   AC_DEFINE_UNQUOTED([__${HOST_CPU}__])
+  #   AC_DEFINE_UNQUOTED([__${HOST_CPU_C_ABI}__])
+  # earlier, but KAI C++ 3.2d doesn't like this.
+  sed -e 's/-/_/g' >> confdefs.h <<EOF
+#ifndef __${HOST_CPU}__
+#define __${HOST_CPU}__ 1
+#endif
+#ifndef __${HOST_CPU_C_ABI}__
+#define __${HOST_CPU_C_ABI}__ 1
+#endif
+EOF
+  AH_TOP([/* CPU and C ABI indicator */
+#ifndef __i386__
+#undef __i386__
+#endif
+#ifndef __x86_64_x32__
+#undef __x86_64_x32__
+#endif
+#ifndef __x86_64__
+#undef __x86_64__
+#endif
+#ifndef __alpha__
+#undef __alpha__
+#endif
+#ifndef __arm__
+#undef __arm__
+#endif
+#ifndef __armhf__
+#undef __armhf__
+#endif
+#ifndef __arm64_ilp32__
+#undef __arm64_ilp32__
+#endif
+#ifndef __arm64__
+#undef __arm64__
+#endif
+#ifndef __hppa__
+#undef __hppa__
+#endif
+#ifndef __hppa64__
+#undef __hppa64__
+#endif
+#ifndef __ia64_ilp32__
+#undef __ia64_ilp32__
+#endif
+#ifndef __ia64__
+#undef __ia64__
+#endif
+#ifndef __m68k__
+#undef __m68k__
+#endif
+#ifndef __mips__
+#undef __mips__
+#endif
+#ifndef __mipsn32__
+#undef __mipsn32__
+#endif
+#ifndef __mips64__
+#undef __mips64__
+#endif
+#ifndef __powerpc__
+#undef __powerpc__
+#endif
+#ifndef __powerpc64__
+#undef __powerpc64__
+#endif
+#ifndef __powerpc64_elfv2__
+#undef __powerpc64_elfv2__
+#endif
+#ifndef __riscv32__
+#undef __riscv32__
+#endif
+#ifndef __riscv64__
+#undef __riscv64__
+#endif
+#ifndef __riscv32_ilp32__
+#undef __riscv32_ilp32__
+#endif
+#ifndef __riscv32_ilp32f__
+#undef __riscv32_ilp32f__
+#endif
+#ifndef __riscv32_ilp32d__
+#undef __riscv32_ilp32d__
+#endif
+#ifndef __riscv64_ilp32__
+#undef __riscv64_ilp32__
+#endif
+#ifndef __riscv64_ilp32f__
+#undef __riscv64_ilp32f__
+#endif
+#ifndef __riscv64_ilp32d__
+#undef __riscv64_ilp32d__
+#endif
+#ifndef __riscv64_lp64__
+#undef __riscv64_lp64__
+#endif
+#ifndef __riscv64_lp64f__
+#undef __riscv64_lp64f__
+#endif
+#ifndef __riscv64_lp64d__
+#undef __riscv64_lp64d__
+#endif
+#ifndef __s390__
+#undef __s390__
+#endif
+#ifndef __s390x__
+#undef __s390x__
+#endif
+#ifndef __sh__
+#undef __sh__
+#endif
+#ifndef __sparc__
+#undef __sparc__
+#endif
+#ifndef __sparc64__
+#undef __sparc64__
+#endif
+])
+
+])
+
+
+dnl Sets the HOST_CPU_C_ABI_32BIT variable to 'yes' if the C language ABI
+dnl (application binary interface) is a 32-bit one, to 'no' if it is a 64-bit
+dnl one, or to 'unknown' if unknown.
+dnl This is a simplified variant of gl_HOST_CPU_C_ABI.
+AC_DEFUN([gl_HOST_CPU_C_ABI_32BIT],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([32-bit host C ABI], [gl_cv_host_cpu_c_abi_32bit],
+    [if test -n "$gl_cv_host_cpu_c_abi"; then
+       case "$gl_cv_host_cpu_c_abi" in
+         i386 | x86_64-x32 | arm | armhf | arm64-ilp32 | hppa | ia64-ilp32 | mips | mipsn32 | powerpc | riscv*-ilp32* | s390 | sparc)
+           gl_cv_host_cpu_c_abi_32bit=yes ;;
+         x86_64 | alpha | arm64 | hppa64 | ia64 | mips64 | powerpc64 | powerpc64-elfv2 | riscv*-lp64* | s390x | sparc64 )
+           gl_cv_host_cpu_c_abi_32bit=no ;;
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown ;;
+       esac
+     else
+       case "$host_cpu" in
+
+         # CPUs that only support a 32-bit ABI.
+         arc \
+         | bfin \
+         | cris* \
+         | csky \
+         | epiphany \
+         | ft32 \
+         | h8300 \
+         | m68k \
+         | microblaze | microblazeel \
+         | nds32 | nds32le | nds32be \
+         | nios2 | nios2eb | nios2el \
+         | or1k* \
+         | or32 \
+         | sh | sh[1234] | sh[1234]e[lb] \
+         | tic6x \
+         | xtensa* )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         # CPUs that only support a 64-bit ABI.
+changequote(,)dnl
+         alpha | alphaev[4-8] | alphaev56 | alphapca5[67] | alphaev6[78] \
+         | mmix )
+changequote([,])dnl
+           gl_cv_host_cpu_c_abi_32bit=no
+           ;;
+
+changequote(,)dnl
+         i[34567]86 )
+changequote([,])dnl
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         x86_64 )
+           # On x86_64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64.
+           # - 64-bit instruction set, 64-bit pointers, 32-bit 'long': x86_64
+           #   with native Windows (mingw, MSVC).
+           # - 64-bit instruction set, 32-bit pointers, 32-bit 'long': x86_64-x32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': i386.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if (defined __x86_64__ || defined __amd64__ \
+                       || defined _M_X64 || defined _M_AMD64) \
+                      && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         arm* | aarch64 )
+           # Assume arm with EABI.
+           # On arm64 systems, the C compiler may be generating code in one of
+           # these ABIs:
+           # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64.
+           # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32.
+           # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __aarch64__ && !(defined __ILP32__ || defined _ILP32)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         hppa1.0 | hppa1.1 | hppa2.0* | hppa64 )
+           # On hppa, the C compiler may be generating 32-bit code or 64-bit
+           # code. In the latter case, it defines _LP64 and __LP64__.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#ifdef __LP64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         ia64* )
+           # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+           # 32-bit code. In the latter case, it defines _ILP32.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#ifdef _ILP32
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=yes],
+             [gl_cv_host_cpu_c_abi_32bit=no])
+           ;;
+
+         mips* )
+           # We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
+           # at 32.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined _MIPS_SZLONG && (_MIPS_SZLONG == 64)
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         powerpc* )
+           # Different ABIs are in use on AIX vs. Mac OS X vs. Linux,*BSD.
+           # No need to distinguish them here; the caller may distinguish
+           # them based on the OS.
+           # On powerpc64 systems, the C compiler may still be generating
+           # 32-bit code. And on powerpc-ibm-aix systems, the C compiler may
+           # be generating 64-bit code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __powerpc64__ || defined __LP64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         rs6000 )
+           gl_cv_host_cpu_c_abi_32bit=yes
+           ;;
+
+         riscv32 | riscv64 )
+           # There are 6 ABIs: ilp32, ilp32f, ilp32d, lp64, lp64f, lp64d.
+           # Size of 'long' and 'void *':
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __LP64__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         s390* )
+           # On s390x, the C compiler may be generating 64-bit (= s390x) code
+           # or 31-bit (= s390) code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __LP64__ || defined __s390x__
+                    int ok;
+                  #else
+                    error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         sparc | sparc64 )
+           # UltraSPARCs running Linux have `uname -m` = "sparc64", but the
+           # C compiler still generates 32-bit code.
+           AC_COMPILE_IFELSE(
+             [AC_LANG_SOURCE(
+                [[#if defined __sparcv9 || defined __arch64__
+                   int ok;
+                  #else
+                   error fail
+                  #endif
+                ]])],
+             [gl_cv_host_cpu_c_abi_32bit=no],
+             [gl_cv_host_cpu_c_abi_32bit=yes])
+           ;;
+
+         *)
+           gl_cv_host_cpu_c_abi_32bit=unknown
+           ;;
+       esac
+     fi
+    ])
+
+  HOST_CPU_C_ABI_32BIT="$gl_cv_host_cpu_c_abi_32bit"
+])
diff --git a/m4/iconv.m4 b/m4/iconv.m4
new file mode 100644 (file)
index 0000000..d0e61de
--- /dev/null
@@ -0,0 +1,283 @@
+# iconv.m4 serial 24
+dnl Copyright (C) 2000-2002, 2007-2014, 2016-2021 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_PREREQ([2.64])
+
+dnl Note: AM_ICONV is documented in the GNU gettext manual
+dnl <https://www.gnu.org/software/gettext/manual/html_node/AM_005fICONV.html>.
+dnl Don't make changes that are incompatible with that documentation!
+
+AC_DEFUN([AM_ICONV_LINKFLAGS_BODY],
+[
+  dnl Prerequisites of AC_LIB_LINKFLAGS_BODY.
+  AC_REQUIRE([AC_LIB_PREPARE_PREFIX])
+  AC_REQUIRE([AC_LIB_RPATH])
+
+  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+  dnl accordingly.
+  AC_LIB_LINKFLAGS_BODY([iconv])
+])
+
+AC_DEFUN([AM_ICONV_LINK],
+[
+  dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
+  dnl those with the standalone portable GNU libiconv installed).
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+  dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV
+  dnl accordingly.
+  AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY])
+
+  dnl Add $INCICONV to CPPFLAGS before performing the following checks,
+  dnl because if the user has installed libiconv and not disabled its use
+  dnl via --without-libiconv-prefix, he wants to use it. The first
+  dnl AC_LINK_IFELSE will then fail, the second AC_LINK_IFELSE will succeed.
+  am_save_CPPFLAGS="$CPPFLAGS"
+  AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV])
+
+  AC_CACHE_CHECK([for iconv], [am_cv_func_iconv], [
+    am_cv_func_iconv="no, consider installing GNU libiconv"
+    am_cv_lib_iconv=no
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[
+#include <stdlib.h>
+#include <iconv.h>
+         ]],
+         [[iconv_t cd = iconv_open("","");
+           iconv(cd,NULL,NULL,NULL,NULL);
+           iconv_close(cd);]])],
+      [am_cv_func_iconv=yes])
+    if test "$am_cv_func_iconv" != yes; then
+      am_save_LIBS="$LIBS"
+      LIBS="$LIBS $LIBICONV"
+      AC_LINK_IFELSE(
+        [AC_LANG_PROGRAM(
+           [[
+#include <stdlib.h>
+#include <iconv.h>
+           ]],
+           [[iconv_t cd = iconv_open("","");
+             iconv(cd,NULL,NULL,NULL,NULL);
+             iconv_close(cd);]])],
+        [am_cv_lib_iconv=yes]
+        [am_cv_func_iconv=yes])
+      LIBS="$am_save_LIBS"
+    fi
+  ])
+  if test "$am_cv_func_iconv" = yes; then
+    AC_CACHE_CHECK([for working iconv], [am_cv_func_iconv_works], [
+      dnl This tests against bugs in AIX 5.1, AIX 6.1..7.1, HP-UX 11.11,
+      dnl Solaris 10.
+      am_save_LIBS="$LIBS"
+      if test $am_cv_lib_iconv = yes; then
+        LIBS="$LIBS $LIBICONV"
+      fi
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        AC_RUN_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[
+#include <iconv.h>
+#include <string.h>
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+             ]],
+             [[int result = 0;
+  /* Test against AIX 5.1...7.2 bug: Failures are not distinguishable from
+     successful returns.  This is even documented in
+     <https://www.ibm.com/support/knowledgecenter/ssw_aix_72/i_bostechref/iconv.html> */
+  {
+    iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
+    if (cd_utf8_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_utf8_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 1;
+        iconv_close (cd_utf8_to_88591);
+      }
+  }
+  /* Test against Solaris 10 bug: Failures are not distinguishable from
+     successful returns.  */
+  {
+    iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
+    if (cd_ascii_to_88591 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\263";
+        char buf[10];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_ascii_to_88591,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res == 0)
+          result |= 2;
+        iconv_close (cd_ascii_to_88591);
+      }
+  }
+  /* Test against AIX 6.1..7.1 bug: Buffer overrun.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304";
+        static char buf[2] = { (char)0xDE, (char)0xAD };
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = 1;
+        char *outptr = buf;
+        size_t outbytesleft = 1;
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
+          result |= 4;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#if 0 /* This bug could be worked around by the caller.  */
+  /* Test against HP-UX 11.11 bug: Positive return value instead of 0.  */
+  {
+    iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
+    if (cd_88591_to_utf8 != (iconv_t)(-1))
+      {
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        char buf[50];
+        ICONV_CONST char *inptr = input;
+        size_t inbytesleft = strlen (input);
+        char *outptr = buf;
+        size_t outbytesleft = sizeof (buf);
+        size_t res = iconv (cd_88591_to_utf8,
+                            &inptr, &inbytesleft,
+                            &outptr, &outbytesleft);
+        if ((int)res > 0)
+          result |= 8;
+        iconv_close (cd_88591_to_utf8);
+      }
+  }
+#endif
+  /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is
+     provided.  */
+  {
+    /* Try standardized names.  */
+    iconv_t cd1 = iconv_open ("UTF-8", "EUC-JP");
+    /* Try IRIX, OSF/1 names.  */
+    iconv_t cd2 = iconv_open ("UTF-8", "eucJP");
+    /* Try AIX names.  */
+    iconv_t cd3 = iconv_open ("UTF-8", "IBM-eucJP");
+    /* Try HP-UX names.  */
+    iconv_t cd4 = iconv_open ("utf8", "eucJP");
+    if (cd1 == (iconv_t)(-1) && cd2 == (iconv_t)(-1)
+        && cd3 == (iconv_t)(-1) && cd4 == (iconv_t)(-1))
+      result |= 16;
+    if (cd1 != (iconv_t)(-1))
+      iconv_close (cd1);
+    if (cd2 != (iconv_t)(-1))
+      iconv_close (cd2);
+    if (cd3 != (iconv_t)(-1))
+      iconv_close (cd3);
+    if (cd4 != (iconv_t)(-1))
+      iconv_close (cd4);
+  }
+  return result;
+]])],
+          [am_cv_func_iconv_works=yes], ,
+          [case "$host_os" in
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac])
+        test "$am_cv_func_iconv_works" = no || break
+      done
+      LIBS="$am_save_LIBS"
+    ])
+    case "$am_cv_func_iconv_works" in
+      *no) am_func_iconv=no am_cv_lib_iconv=no ;;
+      *)   am_func_iconv=yes ;;
+    esac
+  else
+    am_func_iconv=no am_cv_lib_iconv=no
+  fi
+  if test "$am_func_iconv" = yes; then
+    AC_DEFINE([HAVE_ICONV], [1],
+      [Define if you have the iconv() function and it works.])
+  fi
+  if test "$am_cv_lib_iconv" = yes; then
+    AC_MSG_CHECKING([how to link with libiconv])
+    AC_MSG_RESULT([$LIBICONV])
+  else
+    dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV
+    dnl either.
+    CPPFLAGS="$am_save_CPPFLAGS"
+    LIBICONV=
+    LTLIBICONV=
+  fi
+  AC_SUBST([LIBICONV])
+  AC_SUBST([LTLIBICONV])
+])
+
+dnl Define AM_ICONV using AC_DEFUN_ONCE, in order to avoid warnings like
+dnl "warning: AC_REQUIRE: `AM_ICONV' was expanded before it was required".
+dnl This is tricky because of the way 'aclocal' is implemented:
+dnl - It requires defining an auxiliary macro whose name ends in AC_DEFUN.
+dnl   Otherwise aclocal's initial scan pass would miss the macro definition.
+dnl - It requires a line break inside the AC_DEFUN_ONCE and AC_DEFUN expansions.
+dnl   Otherwise aclocal would emit many "Use of uninitialized value $1"
+dnl   warnings.
+AC_DEFUN_ONCE([AM_ICONV],
+[
+  AM_ICONV_LINK
+  if test "$am_cv_func_iconv" = yes; then
+    AC_CACHE_CHECK([whether iconv is compatible with its POSIX signature],
+      [gl_cv_iconv_nonconst],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[
+#include <stdlib.h>
+#include <iconv.h>
+extern
+#ifdef __cplusplus
+"C"
+#endif
+size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
+            ]],
+            [[]])],
+         [gl_cv_iconv_nonconst=yes],
+         [gl_cv_iconv_nonconst=no])
+      ])
+  else
+    dnl When compiling GNU libiconv on a system that does not have iconv yet,
+    dnl pick the POSIX compliant declaration without 'const'.
+    gl_cv_iconv_nonconst=yes
+  fi
+  if test $gl_cv_iconv_nonconst = yes; then
+    iconv_arg1=""
+  else
+    iconv_arg1="const"
+  fi
+  AC_DEFINE_UNQUOTED([ICONV_CONST], [$iconv_arg1],
+    [Define as const if the declaration of iconv() needs const.])
+  dnl Also substitute ICONV_CONST in the gnulib generated <iconv.h>.
+  m4_ifdef([gl_ICONV_H_DEFAULTS],
+    [AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+     if test $gl_cv_iconv_nonconst != yes; then
+       ICONV_CONST="const"
+     fi
+    ])
+])
diff --git a/m4/iconv_h.m4 b/m4/iconv_h.m4
new file mode 100644 (file)
index 0000000..2940988
--- /dev/null
@@ -0,0 +1,72 @@
+# iconv_h.m4 serial 15
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_ICONV_H],
+[
+  AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+
+  dnl Execute this unconditionally, because ICONV_H may be set by other
+  dnl modules, after this code is executed.
+  gl_CHECK_NEXT_HEADERS([iconv.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, and which is not
+  dnl guaranteed by C89.
+  gl_WARN_ON_USE_PREPARE([[#include <iconv.h>
+    ]], [iconv iconv_open])
+
+  AC_REQUIRE([AC_C_RESTRICT])
+])
+
+dnl Unconditionally enables the replacement of <iconv.h>.
+AC_DEFUN([gl_REPLACE_ICONV_H],
+[
+  gl_ICONV_H_REQUIRE_DEFAULTS
+  ICONV_H='iconv.h'
+  AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"])
+])
+
+# gl_ICONV_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_ICONV_MODULE_INDICATOR],
+[
+  dnl Ensure to expand the default settings once only.
+  gl_ICONV_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_ICONV_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_ICONV_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ICONV])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_ICONV_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_ICONV_H_DEFAULTS],
+[
+  m4_ifdef([gl_ANSI_CXX], [AC_REQUIRE([gl_ANSI_CXX])])
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  ICONV_CONST=;         AC_SUBST([ICONV_CONST])
+  REPLACE_ICONV=0;      AC_SUBST([REPLACE_ICONV])
+  REPLACE_ICONV_OPEN=0; AC_SUBST([REPLACE_ICONV_OPEN])
+  REPLACE_ICONV_UTF=0;  AC_SUBST([REPLACE_ICONV_UTF])
+  ICONV_H='';           AC_SUBST([ICONV_H])
+  m4_ifdef([gl_POSIXCHECK],
+    [ICONV_H='iconv.h'],
+    [if m4_ifdef([gl_ANSI_CXX], [test "$CXX" != no], [false]); then
+       dnl Override <fnmatch.h> always, to support the C++ GNULIB_NAMESPACE.
+       ICONV_H='iconv.h'
+     fi
+    ])
+  AM_CONDITIONAL([GL_GENERATE_ICONV_H], [test -n "$ICONV_H"])
+])
diff --git a/m4/iconv_open.m4 b/m4/iconv_open.m4
new file mode 100644 (file)
index 0000000..61b6af4
--- /dev/null
@@ -0,0 +1,60 @@
+# iconv_open.m4 serial 16
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ICONV_OPEN],
+[
+  AC_REQUIRE([AM_ICONV])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_ICONV_H_DEFAULTS])
+  if test "$am_cv_func_iconv" = yes; then
+    dnl Provide the <iconv.h> override, for the sake of the C++ aliases.
+    gl_REPLACE_ICONV_H
+    dnl Test whether iconv_open accepts standardized encoding names.
+    dnl We know that GNU libiconv and GNU libc do.
+    AC_EGREP_CPP([gnu_iconv], [
+      #include <iconv.h>
+      #if defined _LIBICONV_VERSION || (defined __GLIBC__ && !defined __UCLIBC__)
+       gnu_iconv
+      #endif
+      ], [gl_func_iconv_gnu=yes], [gl_func_iconv_gnu=no])
+    if test $gl_func_iconv_gnu = no; then
+      iconv_flavor=
+      case "$host_os" in
+        aix*)         iconv_flavor=ICONV_FLAVOR_AIX ;;
+        irix*)        iconv_flavor=ICONV_FLAVOR_IRIX ;;
+        hpux*)        iconv_flavor=ICONV_FLAVOR_HPUX ;;
+        osf*)         iconv_flavor=ICONV_FLAVOR_OSF ;;
+        solaris*)     iconv_flavor=ICONV_FLAVOR_SOLARIS ;;
+        openedition*) iconv_flavor=ICONV_FLAVOR_ZOS ;;
+      esac
+      if test -n "$iconv_flavor"; then
+        AC_DEFINE_UNQUOTED([ICONV_FLAVOR], [$iconv_flavor],
+          [Define to a symbolic name denoting the flavor of iconv_open()
+           implementation.])
+        gl_REPLACE_ICONV_OPEN
+      fi
+    fi
+    m4_ifdef([gl_FUNC_ICONV_OPEN_UTF_SUPPORT], [
+      gl_FUNC_ICONV_OPEN_UTF_SUPPORT
+      case "$gl_cv_func_iconv_supports_utf" in
+        *yes) ;;
+        *)
+          REPLACE_ICONV_UTF=1
+          AC_DEFINE([REPLACE_ICONV_UTF], [1],
+            [Define if the iconv() functions are enhanced to handle the UTF-{16,32}{BE,LE} encodings.])
+          REPLACE_ICONV=1
+          gl_REPLACE_ICONV_OPEN
+          ;;
+      esac
+    ])
+  fi
+])
+
+AC_DEFUN([gl_REPLACE_ICONV_OPEN],
+[
+  gl_REPLACE_ICONV_H
+  REPLACE_ICONV_OPEN=1
+])
index db0f2c0..bdd542b 100644 (file)
@@ -1,12 +1,13 @@
-# include_next.m4 serial 23
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+# include_next.m4 serial 26
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Paul Eggert and Derek Price.
 
-dnl Sets INCLUDE_NEXT and PRAGMA_SYSTEM_HEADER.
+dnl Sets INCLUDE_NEXT, INCLUDE_NEXT_AS_FIRST_DIRECTIVE, PRAGMA_SYSTEM_HEADER,
+dnl and PRAGMA_COLUMNS.
 dnl
 dnl INCLUDE_NEXT expands to 'include_next' if the compiler supports it, or to
 dnl 'include' otherwise.
@@ -105,19 +106,21 @@ dnl We intentionally avoid using AC_LANG_SOURCE here.
   AC_SUBST([INCLUDE_NEXT])
   AC_SUBST([INCLUDE_NEXT_AS_FIRST_DIRECTIVE])
   AC_SUBST([PRAGMA_SYSTEM_HEADER])
-  AC_CACHE_CHECK([whether system header files limit the line length],
-    [gl_cv_pragma_columns],
-    [dnl HP NonStop systems, which define __TANDEM, have this misfeature.
-     AC_EGREP_CPP([choke me],
+
+  dnl HP NonStop systems, which define __TANDEM, limit the line length
+  dnl after including some system header files.
+  AC_CACHE_CHECK([whether source code line length is unlimited],
+    [gl_cv_source_line_length_unlimited],
+    [AC_EGREP_CPP([choke me],
        [
 #ifdef __TANDEM
 choke me
 #endif
        ],
-       [gl_cv_pragma_columns=yes],
-       [gl_cv_pragma_columns=no])
+       [gl_cv_source_line_length_unlimited=no],
+       [gl_cv_source_line_length_unlimited=yes])
     ])
-  if test $gl_cv_pragma_columns = yes; then
+  if test $gl_cv_source_line_length_unlimited = no; then
     PRAGMA_COLUMNS="#pragma COLUMNS 10000"
   else
     PRAGMA_COLUMNS=
@@ -175,42 +178,40 @@ AC_DEFUN([gl_NEXT_HEADERS_INTERNAL],
     [AC_CHECK_HEADERS_ONCE([$1])
     ])
 
-dnl FIXME: gl_next_header and gl_header_exists must be used unquoted
-dnl until we can assume autoconf 2.64 or newer.
   m4_foreach_w([gl_HEADER_NAME], [$1],
     [AS_VAR_PUSHDEF([gl_next_header],
                     [gl_cv_next_]m4_defn([gl_HEADER_NAME]))
      if test $gl_cv_have_include_next = yes; then
-       AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
+       AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
      else
        AC_CACHE_CHECK(
          [absolute name of <]m4_defn([gl_HEADER_NAME])[>],
-         m4_defn([gl_next_header]),
+         [gl_next_header],
          [m4_if([$2], [check],
             [AS_VAR_PUSHDEF([gl_header_exists],
                             [ac_cv_header_]m4_defn([gl_HEADER_NAME]))
-             if test AS_VAR_GET(gl_header_exists) = yes; then
+             if test AS_VAR_GET([gl_header_exists]) = yes; then
              AS_VAR_POPDEF([gl_header_exists])
             ])
            gl_ABSOLUTE_HEADER_ONE(gl_HEADER_NAME)
            AS_VAR_COPY([gl_header], [gl_cv_absolute_]AS_TR_SH(gl_HEADER_NAME))
-           AS_VAR_SET(gl_next_header, ['"'$gl_header'"'])
+           AS_VAR_SET([gl_next_header], ['"'$gl_header'"'])
           m4_if([$2], [check],
             [else
-               AS_VAR_SET(gl_next_header, ['<'gl_HEADER_NAME'>'])
+               AS_VAR_SET([gl_next_header], ['<'gl_HEADER_NAME'>'])
              fi
             ])
          ])
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_]m4_defn([gl_HEADER_NAME])),
-       [AS_VAR_GET(gl_next_header)])
+       [AS_VAR_GET([gl_next_header])])
      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='<'gl_HEADER_NAME'>'
      else
        # INCLUDE_NEXT_AS_FIRST_DIRECTIVE='include'
-       gl_next_as_first_directive=AS_VAR_GET(gl_next_header)
+       gl_next_as_first_directive=AS_VAR_GET([gl_next_header])
      fi
      AC_SUBST(
        AS_TR_CPP([NEXT_AS_FIRST_DIRECTIVE_]m4_defn([gl_HEADER_NAME])),
diff --git a/m4/inet_pton.m4 b/m4/inet_pton.m4
new file mode 100644 (file)
index 0000000..1979179
--- /dev/null
@@ -0,0 +1,70 @@
+# inet_pton.m4 serial 19
+dnl Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_INET_PTON],
+[
+  AC_REQUIRE([gl_ARPA_INET_H_DEFAULTS])
+
+  dnl Persuade Solaris <arpa/inet.h> to declare inet_pton.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  AC_REQUIRE([AC_C_RESTRICT])
+
+  dnl Most platforms that provide inet_pton define it in libc.
+  dnl Solaris 8..10 provide inet_pton in libnsl instead.
+  dnl Solaris 2.6..7 provide inet_pton in libresolv instead.
+  dnl Haiku provides it in -lnetwork.
+  dnl Native Windows provides it in -lws2_32 instead, with a declaration in
+  dnl <ws2tcpip.h>, and it uses stdcall calling convention, not cdecl
+  dnl (hence we cannot use AC_CHECK_FUNCS, AC_SEARCH_LIBS to find it).
+  HAVE_INET_PTON=1
+  INET_PTON_LIB=
+  gl_PREREQ_SYS_H_WINSOCK2
+  if test $HAVE_WINSOCK2_H = 1; then
+    dnl It needs to be overridden, because the stdcall calling convention
+    dnl is not compliant with POSIX.  Set REPLACE_INET_PTON in order to avoid
+    dnl a name conflict at the linker level, even though the header file
+    dnl <ws2tcpip.h> declares inet_pton only if _WIN32_WINNT >= 0x0600.
+    REPLACE_INET_PTON=1
+    AC_CHECK_DECLS([inet_pton],,, [[#include <ws2tcpip.h>]])
+    if test $ac_cv_have_decl_inet_pton = yes; then
+      INET_PTON_LIB="-lws2_32"
+    else
+      HAVE_DECL_INET_PTON=0
+    fi
+  else
+    gl_save_LIBS=$LIBS
+    AC_SEARCH_LIBS([inet_pton], [nsl resolv network], [],
+      [AC_CHECK_FUNCS([inet_pton])
+       if test $ac_cv_func_inet_pton = no; then
+         HAVE_INET_PTON=0
+       fi
+      ])
+    LIBS=$gl_save_LIBS
+
+    if test "$ac_cv_search_inet_pton" != "no" \
+       && test "$ac_cv_search_inet_pton" != "none required"; then
+      INET_PTON_LIB="$ac_cv_search_inet_pton"
+    fi
+
+    AC_CHECK_HEADERS_ONCE([netdb.h])
+    AC_CHECK_DECLS([inet_pton],,,
+      [[#include <arpa/inet.h>
+        #if HAVE_NETDB_H
+        # include <netdb.h>
+        #endif
+      ]])
+    if test $ac_cv_have_decl_inet_pton = no; then
+      HAVE_DECL_INET_PTON=0
+    fi
+  fi
+  AC_SUBST([INET_PTON_LIB])
+])
+
+# Prerequisites of lib/inet_pton.c.
+AC_DEFUN([gl_PREREQ_INET_PTON], [
+  AC_REQUIRE([gl_SOCKET_FAMILIES])
+])
diff --git a/m4/inline.m4 b/m4/inline.m4
new file mode 100644 (file)
index 0000000..04fc774
--- /dev/null
@@ -0,0 +1,40 @@
+# inline.m4 serial 4
+dnl Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Test for the 'inline' keyword or equivalent.
+dnl Define 'inline' to a supported equivalent, or to nothing if not supported,
+dnl like AC_C_INLINE does.  Also, define HAVE_INLINE if 'inline' or an
+dnl equivalent is effectively supported, i.e. if the compiler is likely to
+dnl drop unused 'static inline' functions.
+AC_DEFUN([gl_INLINE],
+[
+  AC_REQUIRE([AC_C_INLINE])
+  AC_CACHE_CHECK([whether the compiler generally respects inline],
+    [gl_cv_c_inline_effective],
+    [if test $ac_cv_c_inline = no; then
+       gl_cv_c_inline_effective=no
+     else
+       dnl GCC defines __NO_INLINE__ if not optimizing or if -fno-inline is
+       dnl specified.
+       dnl Use AC_COMPILE_IFELSE here, not AC_EGREP_CPP, because the result
+       dnl depends on optimization flags, which can be in CFLAGS.
+       dnl (AC_EGREP_CPP looks only at the CPPFLAGS.)
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[]],
+           [[#ifdef __NO_INLINE__
+               #error "inline is not effective"
+             #endif]])],
+         [gl_cv_c_inline_effective=yes],
+         [gl_cv_c_inline_effective=no])
+     fi
+    ])
+  if test $gl_cv_c_inline_effective = yes; then
+    AC_DEFINE([HAVE_INLINE], [1],
+      [Define to 1 if the compiler supports one of the keywords
+       'inline', '__inline__', '__inline' and effectively inlines
+       functions marked as such.])
+  fi
+])
diff --git a/m4/intl-thread-locale.m4 b/m4/intl-thread-locale.m4
new file mode 100644 (file)
index 0000000..890fec0
--- /dev/null
@@ -0,0 +1,219 @@
+# intl-thread-locale.m4 serial 9
+dnl Copyright (C) 2015-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Lesser General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Lesser General Public License, and the rest of the GNU
+dnl gettext package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Check how to retrieve the name of a per-thread locale (POSIX locale_t).
+dnl Sets gt_nameless_locales.
+AC_DEFUN([gt_INTL_THREAD_LOCALE_NAME],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+
+  dnl Persuade Solaris <locale.h> to define 'locale_t'.
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  dnl Test whether uselocale() exists and works at all.
+  gt_FUNC_USELOCALE
+
+  dnl On OpenBSD >= 6.2, the locale_t type and the uselocale(), newlocale(),
+  dnl duplocale(), freelocale() functions exist but are effectively useless,
+  dnl because the locale_t value depends only on the LC_CTYPE category of the
+  dnl locale and furthermore contains only one bit of information (it
+  dnl distinguishes the "C" locale from the *.UTF-8 locales). See
+  dnl <https://cvsweb.openbsd.org/src/lib/libc/locale/newlocale.c?rev=1.1&content-type=text/x-cvsweb-markup>.
+  dnl In the setlocale() implementation they have thought about the programs
+  dnl that use the API ("Even though only LC_CTYPE has any effect in the
+  dnl OpenBSD base system, store complete information about the global locale,
+  dnl such that third-party software can access it"), but for uselocale()
+  dnl they did not think about the programs.
+  dnl In this situation, even the HAVE_NAMELESS_LOCALES support does not work.
+  dnl So, define HAVE_FAKE_LOCALES and disable all locale_t support.
+  case "$gt_cv_func_uselocale_works" in
+    *yes)
+      AC_CHECK_HEADERS_ONCE([xlocale.h])
+      AC_CACHE_CHECK([for fake locale system (OpenBSD)],
+        [gt_cv_locale_fake],
+        [AC_RUN_IFELSE(
+           [AC_LANG_SOURCE([[
+#include <locale.h>
+#if HAVE_XLOCALE_H
+# include <xlocale.h>
+#endif
+int main ()
+{
+  locale_t loc1, loc2;
+  if (setlocale (LC_ALL, "de_DE.UTF-8") == NULL) return 1;
+  if (setlocale (LC_ALL, "fr_FR.UTF-8") == NULL) return 1;
+  loc1 = newlocale (LC_ALL_MASK, "de_DE.UTF-8", (locale_t)0);
+  loc2 = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", (locale_t)0);
+  return !(loc1 == loc2);
+}]])],
+           [gt_cv_locale_fake=yes],
+           [gt_cv_locale_fake=no],
+           [dnl Guess the locale system is fake only on OpenBSD.
+            case "$host_os" in
+              openbsd*) gt_cv_locale_fake="guessing yes" ;;
+              *)        gt_cv_locale_fake="guessing no" ;;
+            esac
+           ])
+        ])
+      ;;
+    *) gt_cv_locale_fake=no ;;
+  esac
+  case "$gt_cv_locale_fake" in
+    *yes)
+      gt_fake_locales=yes
+      AC_DEFINE([HAVE_FAKE_LOCALES], [1],
+        [Define if the locale_t type contains insufficient information, as on OpenBSD.])
+      ;;
+    *)
+      gt_fake_locales=no
+      ;;
+  esac
+
+  case "$gt_cv_func_uselocale_works" in
+    *yes)
+      AC_CACHE_CHECK([for Solaris 11.4 locale system],
+        [gt_cv_locale_solaris114],
+        [case "$host_os" in
+           solaris*)
+             dnl Test whether <locale.h> defines locale_t as a typedef of
+             dnl 'struct _LC_locale_t **' (whereas Illumos defines it as a
+             dnl typedef of 'struct _locale *').
+             dnl Another possible test would be to include <sys/localedef.h>
+             dnl and test whether it defines the _LC_core_data_locale_t type.
+             dnl This type was added in Solaris 11.4.
+             AC_COMPILE_IFELSE(
+               [AC_LANG_PROGRAM([[
+                  #include <locale.h>
+                  struct _LC_locale_t *x;
+                  locale_t y;
+                ]],
+                [[*y = x;]])],
+               [gt_cv_locale_solaris114=yes],
+               [gt_cv_locale_solaris114=no])
+             ;;
+           *) gt_cv_locale_solaris114=no ;;
+         esac
+        ])
+      ;;
+    *) gt_cv_locale_solaris114=no ;;
+  esac
+  if test $gt_cv_locale_solaris114 = yes; then
+    AC_DEFINE([HAVE_SOLARIS114_LOCALES], [1],
+      [Define if the locale_t type is as on Solaris 11.4.])
+  fi
+
+  dnl Solaris 12 will maybe provide getlocalename_l.  If it does, it will
+  dnl improve the implementation of gl_locale_name_thread(), by removing
+  dnl the use of undocumented structures.
+  case "$gt_cv_func_uselocale_works" in
+    *yes)
+      AC_CHECK_FUNCS([getlocalename_l])
+      ;;
+  esac
+
+  dnl This code is for platforms where the locale_t type does not provide access
+  dnl to the name of each locale category.  This code has the drawback that it
+  dnl requires the gnulib overrides of 'newlocale', 'duplocale', 'freelocale',
+  dnl which is a problem for GNU libunistring.  Therefore try hard to avoid
+  dnl enabling this code!
+  gt_nameless_locales=no
+  case "$host_os" in
+    dnl It's needed on AIX 7.2.
+    aix*)
+      gt_nameless_locales=yes
+      AC_DEFINE([HAVE_NAMELESS_LOCALES], [1],
+        [Define if the locale_t type does not contain the name of each locale category.])
+      ;;
+  esac
+
+  dnl We cannot support uselocale() on platforms where the locale_t type is
+  dnl fake.  So, set
+  dnl   gt_good_uselocale = gt_working_uselocale && !gt_fake_locales.
+  if test $gt_working_uselocale = yes && test $gt_fake_locales = no; then
+    gt_good_uselocale=yes
+    AC_DEFINE([HAVE_GOOD_USELOCALE], [1],
+      [Define if the uselocale exists, may be safely called, and returns sufficient information.])
+  else
+    gt_good_uselocale=no
+  fi
+
+  dnl Set gt_localename_enhances_locale_funcs to indicate whether localename.c
+  dnl overrides newlocale(), duplocale(), freelocale() to keep track of locale
+  dnl names.
+  if test $gt_good_uselocale = yes && test $gt_nameless_locales = yes; then
+    gt_localename_enhances_locale_funcs=yes
+    LOCALENAME_ENHANCE_LOCALE_FUNCS=1
+    AC_DEFINE([LOCALENAME_ENHANCE_LOCALE_FUNCS], [1],
+      [Define if localename.c overrides newlocale(), duplocale(), freelocale().])
+  else
+    gt_localename_enhances_locale_funcs=no
+  fi
+])
+
+dnl Tests whether uselocale() exists and is usable.
+dnl Sets gt_working_uselocale and defines HAVE_WORKING_USELOCALE.
+AC_DEFUN([gt_FUNC_USELOCALE],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+  dnl Persuade glibc and Solaris <locale.h> to define 'locale_t'.
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  AC_CHECK_FUNCS_ONCE([uselocale])
+
+  dnl On AIX 7.2, the uselocale() function is not documented and leads to
+  dnl crashes in subsequent setlocale() invocations.
+  dnl In 2019, some versions of z/OS lack the locale_t type and have a broken
+  dnl uselocale function.
+  if test $ac_cv_func_uselocale = yes; then
+    AC_CHECK_HEADERS_ONCE([xlocale.h])
+    AC_CACHE_CHECK([whether uselocale works],
+      [gt_cv_func_uselocale_works],
+      [AC_RUN_IFELSE(
+         [AC_LANG_SOURCE([[
+#include <locale.h>
+#if HAVE_XLOCALE_H
+# include <xlocale.h>
+#endif
+locale_t loc1;
+int main ()
+{
+  uselocale (NULL);
+  setlocale (LC_ALL, "en_US.UTF-8");
+  return 0;
+}]])],
+         [gt_cv_func_uselocale_works=yes],
+         [gt_cv_func_uselocale_works=no],
+         [# Guess no on AIX and z/OS, yes otherwise.
+          case "$host_os" in
+            aix* | openedition*) gt_cv_func_uselocale_works="guessing no" ;;
+            *)                   gt_cv_func_uselocale_works="guessing yes" ;;
+          esac
+         ])
+      ])
+  else
+    gt_cv_func_uselocale_works=no
+  fi
+  case "$gt_cv_func_uselocale_works" in
+    *yes)
+      gt_working_uselocale=yes
+      AC_DEFINE([HAVE_WORKING_USELOCALE], [1],
+        [Define if the uselocale function exists and may safely be called.])
+      ;;
+    *)
+      gt_working_uselocale=no
+      ;;
+  esac
+])
index aca924c..4ae0d12 100644 (file)
@@ -1,15 +1,15 @@
-# intlmacosx.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2004-2014, 2016 Free Software Foundation, Inc.
+# intlmacosx.m4 serial 8 (gettext-0.20.2)
+dnl Copyright (C) 2004-2014, 2016, 2019-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
 dnl This file can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
+dnl by the GNU Lesser General Public License, and the rest of the GNU
 dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
@@ -17,7 +17,7 @@ dnl Checks for special options needed on Mac OS X.
 dnl Defines INTL_MACOSX_LIBS.
 AC_DEFUN([gt_INTL_MACOSX],
 [
-  dnl Check for API introduced in Mac OS X 10.2.
+  dnl Check for API introduced in Mac OS X 10.4.
   AC_CACHE_CHECK([for CFPreferencesCopyAppValue],
     [gt_cv_func_CFPreferencesCopyAppValue],
     [gt_save_LIBS="$LIBS"
@@ -33,23 +33,32 @@ AC_DEFUN([gt_INTL_MACOSX],
     AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], [1],
       [Define to 1 if you have the Mac OS X function CFPreferencesCopyAppValue in the CoreFoundation framework.])
   fi
-  dnl Check for API introduced in Mac OS X 10.3.
-  AC_CACHE_CHECK([for CFLocaleCopyCurrent], [gt_cv_func_CFLocaleCopyCurrent],
+  dnl Don't check for the API introduced in Mac OS X 10.5, CFLocaleCopyCurrent,
+  dnl because in macOS 10.13.4 it has the following behaviour:
+  dnl When two or more languages are specified in the
+  dnl "System Preferences > Language & Region > Preferred Languages" panel,
+  dnl it returns en_CC where CC is the territory (even when English is not among
+  dnl the preferred languages!).  What we want instead is what
+  dnl CFLocaleCopyCurrent returned in earlier macOS releases and what
+  dnl CFPreferencesCopyAppValue still returns, namely ll_CC where ll is the
+  dnl first among the preferred languages and CC is the territory.
+  AC_CACHE_CHECK([for CFLocaleCopyPreferredLanguages], [gt_cv_func_CFLocaleCopyPreferredLanguages],
     [gt_save_LIBS="$LIBS"
      LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation"
      AC_LINK_IFELSE(
        [AC_LANG_PROGRAM(
           [[#include <CoreFoundation/CFLocale.h>]],
-          [[CFLocaleCopyCurrent();]])],
-       [gt_cv_func_CFLocaleCopyCurrent=yes],
-       [gt_cv_func_CFLocaleCopyCurrent=no])
+          [[CFLocaleCopyPreferredLanguages();]])],
+       [gt_cv_func_CFLocaleCopyPreferredLanguages=yes],
+       [gt_cv_func_CFLocaleCopyPreferredLanguages=no])
      LIBS="$gt_save_LIBS"])
-  if test $gt_cv_func_CFLocaleCopyCurrent = yes; then
-    AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], [1],
-      [Define to 1 if you have the Mac OS X function CFLocaleCopyCurrent in the CoreFoundation framework.])
+  if test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
+    AC_DEFINE([HAVE_CFLOCALECOPYPREFERREDLANGUAGES], [1],
+      [Define to 1 if you have the Mac OS X function CFLocaleCopyPreferredLanguages in the CoreFoundation framework.])
   fi
   INTL_MACOSX_LIBS=
-  if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then
+  if test $gt_cv_func_CFPreferencesCopyAppValue = yes \
+     || test $gt_cv_func_CFLocaleCopyPreferredLanguages = yes; then
     INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation"
   fi
   AC_SUBST([INTL_MACOSX_LIBS])
index 9559acc..63c4b41 100644 (file)
@@ -1,5 +1,5 @@
-# intmax_t.m4 serial 8
-dnl Copyright (C) 1997-2004, 2006-2007, 2009-2016 Free Software Foundation,
+# intmax_t.m4 serial 9
+dnl Copyright (C) 1997-2004, 2006-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -19,11 +19,7 @@ AC_DEFUN([gl_AC_TYPE_INTMAX_T],
   AC_REQUIRE([gl_AC_HEADER_INTTYPES_H])
   AC_REQUIRE([gl_AC_HEADER_STDINT_H])
   if test $gl_cv_header_inttypes_h = no && test $gl_cv_header_stdint_h = no; then
-    AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
-    test $ac_cv_type_long_long_int = yes \
-      && ac_type='long long' \
-      || ac_type='long'
-    AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
+    AC_DEFINE_UNQUOTED([intmax_t], [long long],
      [Define to long or long long if <inttypes.h> and <stdint.h> don't define.])
   else
     AC_DEFINE([HAVE_INTMAX_T], [1],
@@ -57,11 +53,7 @@ AC_DEFUN([gt_AC_TYPE_INTMAX_T],
     AC_DEFINE([HAVE_INTMAX_T], [1],
       [Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>.])
   else
-    AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
-    test $ac_cv_type_long_long_int = yes \
-      && ac_type='long long' \
-      || ac_type='long'
-    AC_DEFINE_UNQUOTED([intmax_t], [$ac_type],
+    AC_DEFINE_UNQUOTED([intmax_t], [long long],
      [Define to long or long long if <stdint.h> and <inttypes.h> don't define.])
   fi
 ])
diff --git a/m4/inttostr.m4 b/m4/inttostr.m4
new file mode 100644 (file)
index 0000000..8a50d50
--- /dev/null
@@ -0,0 +1,32 @@
+#serial 8
+dnl Copyright (C) 2004-2006, 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_INTTOSTR],
+[
+  gl_PREREQ_INTTOSTR
+  gl_PREREQ_IMAXTOSTR
+  gl_PREREQ_OFFTOSTR
+  gl_PREREQ_UMAXTOSTR
+  gl_PREREQ_UINTTOSTR
+])
+
+# Prerequisites of lib/inttostr.h.
+AC_DEFUN([gl_PREREQ_INTTOSTR], [
+  AC_REQUIRE([AC_TYPE_OFF_T])
+  :
+])
+
+# Prerequisites of lib/imaxtostr.c.
+AC_DEFUN([gl_PREREQ_IMAXTOSTR], [:])
+
+# Prerequisites of lib/offtostr.c.
+AC_DEFUN([gl_PREREQ_OFFTOSTR], [:])
+
+# Prerequisites of lib/umaxtostr.c.
+AC_DEFUN([gl_PREREQ_UMAXTOSTR], [:])
+
+# Prerequisites of lib/uinttostr.c.
+AC_DEFUN([gl_PREREQ_UINTTOSTR], [:])
diff --git a/m4/inttypes-pri.m4 b/m4/inttypes-pri.m4
deleted file mode 100644 (file)
index ae20183..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-# inttypes-pri.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1997-2002, 2006, 2008-2016 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-dnl From Bruno Haible.
-
-AC_PREREQ([2.53])
-
-# Define PRI_MACROS_BROKEN if <inttypes.h> exists and defines the PRI*
-# macros to non-string values.  This is the case on AIX 4.3.3.
-
-AC_DEFUN([gt_INTTYPES_PRI],
-[
-  AC_CHECK_HEADERS([inttypes.h])
-  if test $ac_cv_header_inttypes_h = yes; then
-    AC_CACHE_CHECK([whether the inttypes.h PRIxNN macros are broken],
-      [gt_cv_inttypes_pri_broken],
-      [
-        AC_COMPILE_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[
-#include <inttypes.h>
-#ifdef PRId32
-char *p = PRId32;
-#endif
-             ]],
-             [[]])],
-          [gt_cv_inttypes_pri_broken=no],
-          [gt_cv_inttypes_pri_broken=yes])
-      ])
-  fi
-  if test "$gt_cv_inttypes_pri_broken" = yes; then
-    AC_DEFINE_UNQUOTED([PRI_MACROS_BROKEN], [1],
-      [Define if <inttypes.h> exists and defines unusable PRI* macros.])
-    PRI_MACROS_BROKEN=1
-  else
-    PRI_MACROS_BROKEN=0
-  fi
-  AC_SUBST([PRI_MACROS_BROKEN])
-])
index 61cdb1a..64b1de5 100644 (file)
@@ -1,5 +1,5 @@
-# inttypes.m4 serial 26
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+# inttypes.m4 serial 35
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 dnl From Derek Price, Bruno Haible.
 dnl Test whether <inttypes.h> is supported or must be substituted.
 
-AC_DEFUN([gl_INTTYPES_H],
+AC_DEFUN_ONCE([gl_INTTYPES_H],
 [
   AC_REQUIRE([gl_INTTYPES_INCOMPLETE])
   gl_INTTYPES_PRI_SCN
@@ -28,17 +28,26 @@ AC_DEFUN_ONCE([gl_INTTYPES_INCOMPLETE],
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[#include <inttypes.h>
     ]], [imaxabs imaxdiv strtoimax strtoumax])
+
+  AC_REQUIRE([AC_C_RESTRICT])
 ])
 
 # Ensure that the PRI* and SCN* macros are defined appropriately.
 AC_DEFUN([gl_INTTYPES_PRI_SCN],
 [
-  AC_REQUIRE([gt_INTTYPES_PRI])
-
   PRIPTR_PREFIX=
   if test -n "$STDINT_H"; then
-    dnl Using the gnulib <stdint.h>. It always defines intptr_t to 'long'.
-    PRIPTR_PREFIX='"l"'
+    dnl Using the gnulib <stdint.h>. It defines intptr_t to 'long' or
+    dnl 'long long', depending on _WIN64.
+    AC_COMPILE_IFELSE(
+      [AC_LANG_PROGRAM([[
+         #ifdef _WIN64
+         LLP64
+         #endif
+         ]])
+      ],
+      [PRIPTR_PREFIX='"l"'],
+      [PRIPTR_PREFIX='"ll"'])
   else
     dnl Using the system's <stdint.h>.
     for glpfx in '' l ll I64; do
@@ -113,10 +122,8 @@ AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
 
             #if $2
              #define CONDITION ($3)
-            #elif HAVE_LONG_LONG_INT
-             #define CONDITION ($4)
             #else
-             #define CONDITION 0
+             #define CONDITION ($4)
             #endif
             int test[CONDITION ? 1 : -1];]])],
        [gl_cv_test_$1=yes],
@@ -129,29 +136,44 @@ AC_DEFUN([gl_INTTYPES_CHECK_LONG_LONG_INT_CONDITION],
   AC_SUBST([$1])
 ])
 
+# gl_INTTYPES_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_INTTYPES_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_INTTYPES_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_INTTYPES_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IMAXABS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IMAXDIV])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOIMAX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOUMAX])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_INTTYPES_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_INTTYPES_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_INTTYPES_H_DEFAULTS],
 [
-  GNULIB_IMAXABS=0;      AC_SUBST([GNULIB_IMAXABS])
-  GNULIB_IMAXDIV=0;      AC_SUBST([GNULIB_IMAXDIV])
-  GNULIB_STRTOIMAX=0;    AC_SUBST([GNULIB_STRTOIMAX])
-  GNULIB_STRTOUMAX=0;    AC_SUBST([GNULIB_STRTOUMAX])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_IMAXABS=1;   AC_SUBST([HAVE_DECL_IMAXABS])
   HAVE_DECL_IMAXDIV=1;   AC_SUBST([HAVE_DECL_IMAXDIV])
   HAVE_DECL_STRTOIMAX=1; AC_SUBST([HAVE_DECL_STRTOIMAX])
   HAVE_DECL_STRTOUMAX=1; AC_SUBST([HAVE_DECL_STRTOUMAX])
+  HAVE_IMAXDIV_T=1;      AC_SUBST([HAVE_IMAXDIV_T])
   REPLACE_STRTOIMAX=0;   AC_SUBST([REPLACE_STRTOIMAX])
   REPLACE_STRTOUMAX=0;   AC_SUBST([REPLACE_STRTOUMAX])
   INT32_MAX_LT_INTMAX_MAX=1;  AC_SUBST([INT32_MAX_LT_INTMAX_MAX])
   INT64_MAX_EQ_LONG_MAX='defined _LP64';  AC_SUBST([INT64_MAX_EQ_LONG_MAX])
-  PRI_MACROS_BROKEN=0;   AC_SUBST([PRI_MACROS_BROKEN])
   PRIPTR_PREFIX=__PRIPTR_PREFIX;  AC_SUBST([PRIPTR_PREFIX])
   UINT32_MAX_LT_UINTMAX_MAX=1;  AC_SUBST([UINT32_MAX_LT_UINTMAX_MAX])
   UINT64_MAX_EQ_ULONG_MAX='defined _LP64';  AC_SUBST([UINT64_MAX_EQ_ULONG_MAX])
index 7657119..672a93e 100644 (file)
@@ -1,5 +1,5 @@
 # inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/ioctl.m4 b/m4/ioctl.m4
new file mode 100644 (file)
index 0000000..efd29f3
--- /dev/null
@@ -0,0 +1,44 @@
+# ioctl.m4 serial 6
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_IOCTL],
+[
+  AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
+  AC_REQUIRE([gl_SYS_SOCKET_H])
+  HAVE_IOCTL=1
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    dnl Even if the 'socket' module is not used here, another part of the
+    dnl application may use it and pass file descriptors that refer to
+    dnl sockets to the ioctl() function. So enable the support for sockets.
+    HAVE_IOCTL=0
+  else
+    AC_CHECK_FUNCS([ioctl])
+    dnl On glibc systems, the second parameter is 'unsigned long int request',
+    dnl not 'int request'. We cannot simply cast the function pointer, but
+    dnl instead need a wrapper.
+    AC_CACHE_CHECK([for ioctl with POSIX signature],
+      [gl_cv_func_ioctl_posix_signature],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#include <sys/ioctl.h>
+              /* On some platforms, ioctl() is declared in <unistd.h>.  */
+              #include <unistd.h>
+            ]],
+            [[extern
+              #ifdef __cplusplus
+              "C"
+              #endif
+              int ioctl (int, int, ...);
+            ]])
+         ],
+         [gl_cv_func_ioctl_posix_signature=yes],
+         [gl_cv_func_ioctl_posix_signature=no])
+      ])
+    if test $gl_cv_func_ioctl_posix_signature != yes; then
+      REPLACE_IOCTL=1
+    fi
+  fi
+])
index 63d4a39..e77e1a8 100644 (file)
@@ -1,5 +1,5 @@
 # isblank.m4 serial 3
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index bcf3840..fc79f0b 100644 (file)
@@ -1,5 +1,5 @@
-# isnand.m4 serial 11
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# isnand.m4 serial 12
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -58,7 +58,7 @@ AC_DEFUN([gl_HAVE_ISNAND_IN_LIBM],
       AC_LINK_IFELSE(
         [AC_LANG_PROGRAM(
            [[#include <math.h>
-             #if __GNUC__ >= 4
+             #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
              # undef isnand
              # define isnand(x) __builtin_isnan ((double)(x))
              #elif defined isnan
@@ -81,7 +81,7 @@ AC_DEFUN([gl_HAVE_ISNAND_NO_LIBM],
       AC_LINK_IFELSE(
         [AC_LANG_PROGRAM(
            [[#include <math.h>
-             #if __GNUC__ >= 4
+             #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
              # undef isnand
              # define isnand(x) __builtin_isnan ((double)(x))
              #else
index f49d20c..d0f6a56 100644 (file)
@@ -1,5 +1,5 @@
-# isnanf.m4 serial 14
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# isnanf.m4 serial 18
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -74,9 +74,9 @@ AC_DEFUN([gl_HAVE_ISNANF_NO_LIBM],
       AC_LINK_IFELSE(
         [AC_LANG_PROGRAM(
            [[#include <math.h>
-             #if __GNUC__ >= 4
+             #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
              # undef isnanf
-             # define isnanf(x) __builtin_isnanf ((float)(x))
+             # define isnanf(x) __builtin_isnan ((float)(x))
              #elif defined isnan
              # undef isnanf
              # define isnanf(x) isnan ((float)(x))
@@ -99,9 +99,9 @@ AC_DEFUN([gl_HAVE_ISNANF_IN_LIBM],
       AC_LINK_IFELSE(
         [AC_LANG_PROGRAM(
            [[#include <math.h>
-             #if __GNUC__ >= 4
+             #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
              # undef isnanf
-             # define isnanf(x) __builtin_isnanf ((float)(x))
+             # define isnanf(x) __builtin_isnan ((float)(x))
              #elif defined isnan
              # undef isnanf
              # define isnanf(x) isnan ((float)(x))
@@ -127,9 +127,9 @@ AC_DEFUN([gl_ISNANF_WORKS],
       AC_RUN_IFELSE(
         [AC_LANG_SOURCE([[
 #include <math.h>
-#if __GNUC__ >= 4
+#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
 # undef isnanf
-# define isnanf(x) __builtin_isnanf ((float)(x))
+# define isnanf(x) __builtin_isnan ((float)(x))
 #elif defined isnan
 # undef isnanf
 # define isnanf(x) isnan ((float)(x))
@@ -169,7 +169,7 @@ int main()
       m.value = NaN ();
       /* Set the bits below the exponent to 01111...111.  */
       m.word[0] &= -1U << FLT_EXPBIT0_BIT;
-      m.word[0] |= 1U << (FLT_EXPBIT0_BIT - 1) - 1;
+      m.word[0] |= (1U << (FLT_EXPBIT0_BIT - 1)) - 1;
       if (!isnanf (m.value))
         result |= 4;
     }
@@ -180,8 +180,17 @@ int main()
         [gl_cv_func_isnanf_works=yes],
         [gl_cv_func_isnanf_works=no],
         [case "$host_os" in
-           irix* | solaris*) gl_cv_func_isnanf_works="guessing no";;
-           *)                gl_cv_func_isnanf_works="guessing yes";;
+           irix* | solaris*) gl_cv_func_isnanf_works="guessing no" ;;
+           mingw*) # Guess yes on mingw, no on MSVC.
+             AC_EGREP_CPP([Known], [
+#ifdef __MINGW32__
+ Known
+#endif
+               ],
+               [gl_cv_func_isnanf_works="guessing yes"],
+               [gl_cv_func_isnanf_works="guessing no"])
+             ;;
+           *) gl_cv_func_isnanf_works="guessing yes" ;;
          esac
         ])
     ])
index 9766e47..1ef16f5 100644 (file)
@@ -1,5 +1,5 @@
-# isnanl.m4 serial 19
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# isnanl.m4 serial 22
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -68,9 +68,9 @@ AC_DEFUN([gl_HAVE_ISNANL_NO_LIBM],
       AC_LINK_IFELSE(
         [AC_LANG_PROGRAM(
            [[#include <math.h>
-             #if __GNUC__ >= 4
+             #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
              # undef isnanl
-             # define isnanl(x) __builtin_isnanl ((long double)(x))
+             # define isnanl(x) __builtin_isnan ((long double)(x))
              #elif defined isnan
              # undef isnanl
              # define isnanl(x) isnan ((long double)(x))
@@ -93,9 +93,9 @@ AC_DEFUN([gl_HAVE_ISNANL_IN_LIBM],
       AC_LINK_IFELSE(
         [AC_LANG_PROGRAM(
            [[#include <math.h>
-             #if __GNUC__ >= 4
+             #if (__GNUC__ >= 4) || (__clang_major__ >= 4)
              # undef isnanl
-             # define isnanl(x) __builtin_isnanl ((long double)(x))
+             # define isnanl(x) __builtin_isnan ((long double)(x))
              #elif defined isnan
              # undef isnanl
              # define isnanl(x) isnan ((long double)(x))
@@ -123,9 +123,9 @@ AC_DEFUN([gl_FUNC_ISNANL_WORKS],
 #include <float.h>
 #include <limits.h>
 #include <math.h>
-#if __GNUC__ >= 4
+#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
 # undef isnanl
-# define isnanl(x) __builtin_isnanl ((long double)(x))
+# define isnanl(x) __builtin_isnan ((long double)(x))
 #elif defined isnan
 # undef isnanl
 # define isnanl(x) isnan ((long double)(x))
@@ -231,6 +231,18 @@ int main ()
 }]])],
         [gl_cv_func_isnanl_works=yes],
         [gl_cv_func_isnanl_works=no],
-        [gl_cv_func_isnanl_works="guessing yes"])
+        [case "$host_os" in
+           mingw*) # Guess yes on mingw, no on MSVC.
+             AC_EGREP_CPP([Known], [
+#ifdef __MINGW32__
+ Known
+#endif
+               ],
+               [gl_cv_func_isnanl_works="guessing yes"],
+               [gl_cv_func_isnanl_works="guessing no"])
+             ;;
+           *) gl_cv_func_isnanl_works="guessing yes" ;;
+         esac
+        ])
     ])
 ])
diff --git a/m4/iswblank.m4 b/m4/iswblank.m4
new file mode 100644 (file)
index 0000000..84fd838
--- /dev/null
@@ -0,0 +1,34 @@
+# iswblank.m4 serial 5
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ISWBLANK],
+[
+  AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+  AC_REQUIRE([gl_WCTYPE_H])
+  dnl Persuade glibc <wctype.h> to declare iswblank().
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_CHECK_FUNCS_ONCE([iswblank])
+  AC_CHECK_DECLS([iswblank], , , [[
+    #include <wchar.h>
+    #include <wctype.h>
+  ]])
+  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
+    dnl Redefine all of iswcntrl, ..., towupper in <wctype.h>.
+    :
+  else
+    if test $HAVE_ISWBLANK = 0 || test $REPLACE_ISWBLANK = 1; then
+      dnl Redefine only iswblank.
+      :
+    fi
+  fi
+
+])
diff --git a/m4/iswdigit.m4 b/m4/iswdigit.m4
new file mode 100644 (file)
index 0000000..de4ffce
--- /dev/null
@@ -0,0 +1,115 @@
+# iswdigit.m4 serial 3
+dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ISWDIGIT],
+[
+  AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+  AC_REQUIRE([gl_WCTYPE_H])
+  AC_REQUIRE([gt_LOCALE_FR])
+  AC_REQUIRE([gt_LOCALE_JA])
+  AC_REQUIRE([gt_LOCALE_FR_UTF8])
+  AC_REQUIRE([gt_LOCALE_ZH_CN])
+
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+    dnl <wctype.h> redefines iswdigit already.
+    REPLACE_ISWDIGIT="$REPLACE_ISWCNTRL"
+  else
+    AC_CACHE_CHECK([whether iswdigit is ISO C compliant],
+      [gl_cv_func_iswdigit_works],
+      [
+       dnl Initial guess, used when cross-compiling or when no suitable locale
+       dnl is present.
+changequote(,)dnl
+       case "$host_os" in
+         # Guess no on FreeBSD, NetBSD, Solaris, native Windows.
+         freebsd* | dragonfly* | netbsd* | solaris* | mingw*)
+           gl_cv_func_iswdigit_works="guessing no" ;;
+         # Guess yes otherwise.
+         *) gl_cv_func_iswdigit_works="guessing yes" ;;
+       esac
+changequote([,])dnl
+       if test $LOCALE_FR != none || test $LOCALE_JA != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_ZH_CN != none; then
+         AC_RUN_IFELSE(
+           [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+#include <wctype.h>
+
+/* Returns the value of iswdigit for the multibyte character s[0..n-1].  */
+static int
+for_character (const char *s, size_t n)
+{
+  mbstate_t state;
+  wchar_t wc;
+  size_t ret;
+
+  memset (&state, '\0', sizeof (mbstate_t));
+  wc = (wchar_t) 0xBADFACE;
+  ret = mbrtowc (&wc, s, n, &state);
+  if (ret != n)
+    abort ();
+
+  return iswdigit (wc);
+}
+
+int
+main (int argc, char *argv[])
+{
+  int is;
+  int result = 0;
+
+  if (setlocale (LC_ALL, "$LOCALE_FR") != NULL)
+    {
+      /* This fails on mingw, MSVC 14.  */
+      /* U+00B2 SUPERSCRIPT TWO */
+      is = for_character ("\262", 1);
+      if (!(is == 0))
+        result |= 1;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      /* This fails on NetBSD 8.0.  */
+      /* U+FF11 FULLWIDTH DIGIT ONE */
+      is = for_character ("\243\261", 2);
+      if (!(is == 0))
+        result |= 2;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      /* This fails on FreeBSD 13.0, NetBSD 8.0, MSVC 14.  */
+      /* U+0663 ARABIC-INDIC DIGIT THREE */
+      is = for_character ("\331\243", 2);
+      if (!(is == 0))
+        result |= 4;
+      /* This fails on FreeBSD 13.0, NetBSD 8.0, MSVC 14.  */
+      /* U+FF11 FULLWIDTH DIGIT ONE */
+      is = for_character ("\357\274\221", 3);
+      if (!(is == 0))
+        result |= 8;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      /* This fails on NetBSD 8.0, Solaris 10, Solaris 11.4.  */
+      /* U+FF11 FULLWIDTH DIGIT ONE */
+      is = for_character ("\243\261", 2);
+      if (!(is == 0))
+        result |= 16;
+    }
+  return result;
+}]])],
+           [gl_cv_func_iswdigit_works=yes],
+           [gl_cv_func_iswdigit_works=no],
+           [:])
+       fi
+      ])
+    case "$gl_cv_func_iswdigit_works" in
+      *yes) ;;
+      *) REPLACE_ISWDIGIT=1 ;;
+    esac
+  fi
+])
diff --git a/m4/iswxdigit.m4 b/m4/iswxdigit.m4
new file mode 100644 (file)
index 0000000..f96d735
--- /dev/null
@@ -0,0 +1,106 @@
+# iswxdigit.m4 serial 3
+dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_ISWXDIGIT],
+[
+  AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+  AC_REQUIRE([gl_WCTYPE_H])
+  AC_REQUIRE([gt_LOCALE_JA])
+  AC_REQUIRE([gt_LOCALE_FR_UTF8])
+  AC_REQUIRE([gt_LOCALE_ZH_CN])
+
+  if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
+    dnl <wctype.h> redefines iswxdigit already.
+    REPLACE_ISWXDIGIT="$REPLACE_ISWCNTRL"
+  else
+    AC_CACHE_CHECK([whether iswxdigit is ISO C compliant],
+      [gl_cv_func_iswxdigit_works],
+      [
+       dnl Initial guess, used when cross-compiling or when no suitable locale
+       dnl is present.
+changequote(,)dnl
+       case "$host_os" in
+         # Guess no on FreeBSD, NetBSD, Solaris, native Windows.
+         freebsd* | dragonfly* | netbsd* | solaris* | mingw*)
+           gl_cv_func_iswxdigit_works="guessing no" ;;
+         # Guess yes otherwise.
+         *) gl_cv_func_iswxdigit_works="guessing yes" ;;
+       esac
+changequote([,])dnl
+       if test $LOCALE_JA != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_ZH_CN != none; then
+         AC_RUN_IFELSE(
+           [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+#include <wctype.h>
+
+/* Returns the value of iswxdigit for the multibyte character s[0..n-1].  */
+static int
+for_character (const char *s, size_t n)
+{
+  mbstate_t state;
+  wchar_t wc;
+  size_t ret;
+
+  memset (&state, '\0', sizeof (mbstate_t));
+  wc = (wchar_t) 0xBADFACE;
+  ret = mbrtowc (&wc, s, n, &state);
+  if (ret != n)
+    abort ();
+
+  return iswxdigit (wc);
+}
+
+int
+main (int argc, char *argv[])
+{
+  int is;
+  int result = 0;
+
+  if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
+    {
+      /* This fails on NetBSD 8.0.  */
+      /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
+      is = for_character ("\243\301", 2);
+      if (!(is == 0))
+        result |= 1;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      /* This fails on FreeBSD 13.0.  */
+      /* U+0663 ARABIC-INDIC DIGIT THREE */
+      is = for_character ("\331\243", 2);
+      if (!(is == 0))
+        result |= 2;
+      /* This fails on MSVC 14.  */
+      /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
+      is = for_character ("\357\274\241", 3);
+      if (!(is == 0))
+        result |= 4;
+    }
+  if (setlocale (LC_ALL, "$LOCALE_ZH_CN") != NULL)
+    {
+      /* This fails on Solaris 10, Solaris 11.4.  */
+      /* U+FF11 FULLWIDTH DIGIT ONE */
+      is = for_character ("\243\261", 2);
+      if (!(is == 0))
+        result |= 8;
+    }
+  return result;
+}]])],
+           [gl_cv_func_iswxdigit_works=yes],
+           [gl_cv_func_iswxdigit_works=no],
+           [:])
+       fi
+      ])
+    case "$gl_cv_func_iswxdigit_works" in
+      *yes) ;;
+      *) REPLACE_ISWXDIGIT=1 ;;
+    esac
+  fi
+])
index edbbe76..87959f7 100644 (file)
@@ -1,10 +1,10 @@
-# langinfo_h.m4 serial 7
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# langinfo_h.m4 serial 12
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_LANGINFO_H],
+AC_DEFUN_ONCE([gl_LANGINFO_H],
 [
   AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
 
@@ -17,13 +17,17 @@ AC_DEFUN([gl_LANGINFO_H],
   dnl Determine whether <langinfo.h> exists. It is missing on mingw and BeOS.
   HAVE_LANGINFO_CODESET=0
   HAVE_LANGINFO_T_FMT_AMPM=0
+  HAVE_LANGINFO_ALTMON=0
   HAVE_LANGINFO_ERA=0
   HAVE_LANGINFO_YESEXPR=0
   AC_CHECK_HEADERS_ONCE([langinfo.h])
   if test $ac_cv_header_langinfo_h = yes; then
     HAVE_LANGINFO_H=1
-    dnl Determine what <langinfo.h> defines. CODESET and ERA etc. are missing
-    dnl on OpenBSD 3.8. T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
+    dnl Determine what <langinfo.h> defines.
+    dnl CODESET is missing on OpenBSD 3.8.
+    dnl ERA etc. are missing on OpenBSD 6.7.
+    dnl T_FMT_AMPM and YESEXPR, NOEXPR are missing on IRIX 5.3.
+    dnl ALTMON_* are missing on glibc 2.26 and many other systems.
     AC_CACHE_CHECK([whether langinfo.h defines CODESET],
       [gl_cv_header_langinfo_codeset],
       [AC_COMPILE_IFELSE(
@@ -48,6 +52,18 @@ int a = T_FMT_AMPM;
     if test $gl_cv_header_langinfo_t_fmt_ampm = yes; then
       HAVE_LANGINFO_T_FMT_AMPM=1
     fi
+    AC_CACHE_CHECK([whether langinfo.h defines ALTMON_1],
+      [gl_cv_header_langinfo_altmon],
+      [AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[#include <langinfo.h>
+int a = ALTMON_1;
+]])],
+         [gl_cv_header_langinfo_altmon=yes],
+         [gl_cv_header_langinfo_altmon=no])
+      ])
+    if test $gl_cv_header_langinfo_altmon = yes; then
+      HAVE_LANGINFO_ALTMON=1
+    fi
     AC_CACHE_CHECK([whether langinfo.h defines ERA],
       [gl_cv_header_langinfo_era],
       [AC_COMPILE_IFELSE(
@@ -78,6 +94,7 @@ int a = YESEXPR;
   AC_SUBST([HAVE_LANGINFO_H])
   AC_SUBST([HAVE_LANGINFO_CODESET])
   AC_SUBST([HAVE_LANGINFO_T_FMT_AMPM])
+  AC_SUBST([HAVE_LANGINFO_ALTMON])
   AC_SUBST([HAVE_LANGINFO_ERA])
   AC_SUBST([HAVE_LANGINFO_YESEXPR])
 
@@ -87,18 +104,33 @@ int a = YESEXPR;
     ]], [nl_langinfo])
 ])
 
+# gl_LANGINFO_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_LANGINFO_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_LANGINFO_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_LANGINFO_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_LANGINFO_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NL_LANGINFO])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_LANGINFO_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_LANGINFO_H_DEFAULTS],
 [
-  GNULIB_NL_LANGINFO=0;  AC_SUBST([GNULIB_NL_LANGINFO])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_NL_LANGINFO=1;    AC_SUBST([HAVE_NL_LANGINFO])
   REPLACE_NL_LANGINFO=0; AC_SUBST([REPLACE_NL_LANGINFO])
index 8bbdfaa..cadb16d 100644 (file)
@@ -1,24 +1,41 @@
 # Enable large files on systems where this is not the default.
+# Enable support for files on Linux file systems with 64-bit inode numbers.
 
-# Copyright 1992-1996, 1998-2016 Free Software Foundation, Inc.
+# Copyright 1992-1996, 1998-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
+# The following macro works around a problem in Autoconf's AC_FUNC_FSEEKO:
+# It does not set _LARGEFILE_SOURCE=1 on HP-UX/ia64 32-bit, although this
+# setting of _LARGEFILE_SOURCE is needed so that <stdio.h> declares fseeko
+# and ftello in C++ mode as well.
+AC_DEFUN([gl_SET_LARGEFILE_SOURCE],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_FUNC_FSEEKO
+  case "$host_os" in
+    hpux*)
+      AC_DEFINE([_LARGEFILE_SOURCE], [1],
+        [Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).])
+      ;;
+  esac
+])
+
 # The following implementation works around a problem in autoconf <= 2.69;
 # AC_SYS_LARGEFILE does not configure for large inodes on Mac OS X 10.5,
 # or configures them incorrectly in some cases.
-m4_version_prereq([2.70], [] ,[
+m4_version_prereq([2.70], [][
 
 # _AC_SYS_LARGEFILE_TEST_INCLUDES
 # -------------------------------
 m4_define([_AC_SYS_LARGEFILE_TEST_INCLUDES],
-[@%:@include <sys/types.h>
+[#include <sys/types.h>
  /* Check that off_t can represent 2**63 - 1 correctly.
     We can't simply define LARGE_OFF_T to be 9223372036854775807,
     since some C++ compilers masquerading as C compilers
     incorrectly reject 9223372036854775807.  */
-@%:@define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31))
   int off_t_is_large[[(LARGE_OFF_T % 2147483629 == 721
                        && LARGE_OFF_T % 2147483647 == 1)
                       ? 1 : -1]];[]dnl
@@ -37,7 +54,7 @@ m4_define([_AC_SYS_LARGEFILE_MACRO_VALUE],
     [AC_LANG_PROGRAM([$5], [$6])],
     [$3=no; break])
   m4_ifval([$6], [AC_LINK_IFELSE], [AC_COMPILE_IFELSE])(
-    [AC_LANG_PROGRAM([@%:@define $1 $2
+    [AC_LANG_PROGRAM([#define $1 $2
 $5], [$6])],
     [$3=$2; break])
   $3=unknown
@@ -56,7 +73,10 @@ rm -rf conftest*[]dnl
 # By default, many hosts won't let programs access large files;
 # one must use special compiler options to get large-file access to work.
 # For more details about this brain damage please see:
-# http://www.unix-systems.org/version2/whatsnew/lfs20mar.html
+# http://www.unix.org/version2/whatsnew/lfs20mar.html
+# Additionally, on Linux file systems with 64-bit inodes a file that happens
+# to have a 64-bit inode number cannot be accessed by 32-bit applications on
+# Linux x86/x86_64.  This can occur with file systems such as XFS and NFS.
 AC_DEFUN([AC_SYS_LARGEFILE],
 [AC_ARG_ENABLE(largefile,
                [  --disable-largefile     omit support for large files])
@@ -93,9 +113,6 @@ if test "$enable_largefile" != no; then
       [Define for large files, on AIX-style hosts.],
       [_AC_SYS_LARGEFILE_TEST_INCLUDES])
   fi
-
-  AC_DEFINE([_DARWIN_USE_64_BIT_INODE], [1],
-    [Enable large inode numbers on Mac OS X 10.5.])
 fi
 ])# AC_SYS_LARGEFILE
 ])# m4_version_prereq 2.70
@@ -126,9 +143,24 @@ AC_DEFUN([gl_LARGEFILE],
       else
         WINDOWS_64_BIT_OFF_T=0
       fi
-      dnl But all native Windows platforms (including mingw64) have a 32-bit
-      dnl st_size member in 'struct stat'.
-      WINDOWS_64_BIT_ST_SIZE=1
+      dnl Some mingw versions define, if _FILE_OFFSET_BITS=64, 'struct stat'
+      dnl to 'struct _stat32i64' or 'struct _stat64' (depending on
+      dnl _USE_32BIT_TIME_T), which has a 32-bit st_size member.
+      AC_CACHE_CHECK([for 64-bit st_size], [gl_cv_member_st_size_64],
+        [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <sys/types.h>
+                struct stat buf;
+                int verify_st_size_size[sizeof (buf.st_size) >= 8 ? 1 : -1];
+              ]],
+              [[]])],
+           [gl_cv_member_st_size_64=yes], [gl_cv_member_st_size_64=no])
+        ])
+      if test $gl_cv_member_st_size_64 = no; then
+        WINDOWS_64_BIT_ST_SIZE=1
+      else
+        WINDOWS_64_BIT_ST_SIZE=0
+      fi
       ;;
     *)
       dnl Nothing to do on gnulib's side.
index 1c24d6d..a52700e 100644 (file)
@@ -1,16 +1,16 @@
-# lcmessage.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014, 2016 Free Software
-dnl Foundation, Inc.
+# lcmessage.m4 serial 8
+dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014, 2016, 2019-2021 Free
+dnl Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
 dnl This file can be used in projects which are not available under
-dnl the GNU General Public License or the GNU Library General Public
+dnl the GNU General Public License or the GNU Lesser General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
-dnl by the GNU Library General Public License, and the rest of the GNU
+dnl by the GNU Lesser General Public License, and the rest of the GNU
 dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
index 596dede..cb7ce64 100644 (file)
@@ -1,5 +1,5 @@
 # ldexp.m4 serial 1
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 8597c29..5dabf76 100644 (file)
@@ -1,5 +1,5 @@
-# ldexpl.m4 serial 16
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# ldexpl.m4 serial 17
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -124,8 +124,10 @@ int main()
         [
 changequote(,)dnl
          case "$host_os" in
-           aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no";;
-           *)               gl_cv_func_ldexpl_works="guessing yes";;
+           aix | aix[3-6]*) gl_cv_func_ldexpl_works="guessing no" ;;
+                            # Guess yes on native Windows.
+           mingw*)          gl_cv_func_ldexpl_works="guessing yes" ;;
+           *)               gl_cv_func_ldexpl_works="guessing yes" ;;
          esac
 changequote([,])dnl
         ])
index 6209de6..076358d 100644 (file)
@@ -1,5 +1,5 @@
-# lib-ld.m4 serial 6
-dnl Copyright (C) 1996-2003, 2009-2016 Free Software Foundation, Inc.
+# lib-ld.m4 serial 10
+dnl Copyright (C) 1996-2003, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -47,73 +47,122 @@ if test "${PATH_SEPARATOR+set}" != set; then
        }
 fi
 
-ac_prog=ld
-if test "$GCC" = yes; then
-  # Check if gcc -print-prog-name=ld gives a path.
+if test -n "$LD"; then
+  AC_MSG_CHECKING([for ld])
+elif test "$GCC" = yes; then
   AC_MSG_CHECKING([for ld used by $CC])
-  case $host in
-  *-*-mingw*)
-    # gcc leaves a trailing carriage return which upsets mingw
-    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
-  *)
-    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
-  esac
-  case $ac_prog in
-    # Accept absolute paths.
-    [[\\/]]* | ?:[[\\/]]*)
-      re_direlt='/[[^/]][[^/]]*/\.\./'
-      # Canonicalize the pathname of ld
-      ac_prog=`echo "$ac_prog"| sed 's%\\\\%/%g'`
-      while echo "$ac_prog" | grep "$re_direlt" > /dev/null 2>&1; do
-        ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
-      done
-      test -z "$LD" && LD="$ac_prog"
-      ;;
-  "")
-    # If it fails, then pretend we aren't using GCC.
-    ac_prog=ld
-    ;;
-  *)
-    # If it is relative, then search for the first ld in PATH.
-    with_gnu_ld=unknown
-    ;;
-  esac
 elif test "$with_gnu_ld" = yes; then
   AC_MSG_CHECKING([for GNU ld])
 else
   AC_MSG_CHECKING([for non-GNU ld])
 fi
-AC_CACHE_VAL([acl_cv_path_LD],
-[if test -z "$LD"; then
-  acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
-  for ac_dir in $PATH; do
-    IFS="$acl_save_ifs"
-    test -z "$ac_dir" && ac_dir=.
-    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
-      acl_cv_path_LD="$ac_dir/$ac_prog"
-      # Check to see if the program is GNU ld.  I'd rather use --version,
-      # but apparently some variants of GNU ld only accept -v.
-      # Break only if it was the GNU/non-GNU ld that we prefer.
-      case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
-      *GNU* | *'with BFD'*)
-        test "$with_gnu_ld" != no && break
-        ;;
-      *)
-        test "$with_gnu_ld" != yes && break
-        ;;
+if test -n "$LD"; then
+  # Let the user override the test with a path.
+  :
+else
+  AC_CACHE_VAL([acl_cv_path_LD],
+  [
+    acl_cv_path_LD= # Final result of this test
+    ac_prog=ld # Program to search in $PATH
+    if test "$GCC" = yes; then
+      # Check if gcc -print-prog-name=ld gives a path.
+      case $host in
+        *-*-mingw*)
+          # gcc leaves a trailing carriage return which upsets mingw
+          acl_output=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+        *)
+          acl_output=`($CC -print-prog-name=ld) 2>&5` ;;
+      esac
+      case $acl_output in
+        # Accept absolute paths.
+        [[\\/]]* | ?:[[\\/]]*)
+          re_direlt='/[[^/]][[^/]]*/\.\./'
+          # Canonicalize the pathname of ld
+          acl_output=`echo "$acl_output" | sed 's%\\\\%/%g'`
+          while echo "$acl_output" | grep "$re_direlt" > /dev/null 2>&1; do
+            acl_output=`echo $acl_output | sed "s%$re_direlt%/%"`
+          done
+          # Got the pathname. No search in PATH is needed.
+          acl_cv_path_LD="$acl_output"
+          ac_prog=
+          ;;
+        "")
+          # If it fails, then pretend we aren't using GCC.
+          ;;
+        *)
+          # If it is relative, then search for the first ld in PATH.
+          with_gnu_ld=unknown
+          ;;
       esac
     fi
-  done
-  IFS="$acl_save_ifs"
-else
-  acl_cv_path_LD="$LD" # Let the user override the test with a path.
-fi])
-LD="$acl_cv_path_LD"
+    if test -n "$ac_prog"; then
+      # Search for $ac_prog in $PATH.
+      acl_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+      for ac_dir in $PATH; do
+        IFS="$acl_save_ifs"
+        test -z "$ac_dir" && ac_dir=.
+        if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+          acl_cv_path_LD="$ac_dir/$ac_prog"
+          # Check to see if the program is GNU ld.  I'd rather use --version,
+          # but apparently some variants of GNU ld only accept -v.
+          # Break only if it was the GNU/non-GNU ld that we prefer.
+          case `"$acl_cv_path_LD" -v 2>&1 </dev/null` in
+            *GNU* | *'with BFD'*)
+              test "$with_gnu_ld" != no && break
+              ;;
+            *)
+              test "$with_gnu_ld" != yes && break
+              ;;
+          esac
+        fi
+      done
+      IFS="$acl_save_ifs"
+    fi
+    case $host in
+      *-*-aix*)
+        AC_COMPILE_IFELSE(
+          [AC_LANG_SOURCE(
+             [[#if defined __powerpc64__ || defined __LP64__
+                int ok;
+               #else
+                error fail
+               #endif
+             ]])],
+          [# The compiler produces 64-bit code. Add option '-b64' so that the
+           # linker groks 64-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -b64 "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -b64" ;;
+           esac
+          ], [])
+        ;;
+      sparc64-*-netbsd*)
+        AC_COMPILE_IFELSE(
+          [AC_LANG_SOURCE(
+             [[#if defined __sparcv9 || defined __arch64__
+                int ok;
+               #else
+                error fail
+               #endif
+             ]])],
+          [],
+          [# The compiler produces 32-bit code. Add option '-m elf32_sparc'
+           # so that the linker groks 32-bit object files.
+           case "$acl_cv_path_LD " in
+             *" -m elf32_sparc "*) ;;
+             *) acl_cv_path_LD="$acl_cv_path_LD -m elf32_sparc" ;;
+           esac
+          ])
+        ;;
+    esac
+  ])
+  LD="$acl_cv_path_LD"
+fi
 if test -n "$LD"; then
   AC_MSG_RESULT([$LD])
 else
   AC_MSG_RESULT([no])
+  AC_MSG_ERROR([no acceptable ld found in \$PATH])
 fi
-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
 AC_LIB_PROG_LD_GNU
 ])
index 2f51855..787efab 100644 (file)
@@ -1,12 +1,12 @@
-# lib-link.m4 serial 26 (gettext-0.18.2)
-dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
+# lib-link.m4 serial 32
+dnl Copyright (C) 2001-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
-AC_PREREQ([2.54])
+AC_PREREQ([2.61])
 
 dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and
 dnl the libraries corresponding to explicit and implicit dependencies.
@@ -124,8 +124,8 @@ dnl   acl_hardcode_direct,
 dnl   acl_hardcode_minus_L.
 AC_DEFUN([AC_LIB_RPATH],
 [
-  dnl Tell automake >= 1.10 to complain if config.rpath is missing.
-  m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])])
+  dnl Complain if config.rpath is missing.
+  AC_REQUIRE_AUX_FILE([config.rpath])
   AC_REQUIRE([AC_PROG_CC])                dnl we use $CC, $GCC, $LDFLAGS
   AC_REQUIRE([AC_LIB_PROG_LD])            dnl we use $LD, $with_gnu_ld
   AC_REQUIRE([AC_CANONICAL_HOST])         dnl we use $host
@@ -187,17 +187,17 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
   pushdef([PACKUP],[m4_translit(PACK,[abcdefghijklmnopqrstuvwxyz./+-],
                                      [ABCDEFGHIJKLMNOPQRSTUVWXYZ____])])
   pushdef([PACKLIBS],[m4_ifdef([acl_frompackage_]NAME, [acl_libsinpackage_]PACKUP, lib[$1])])
-  dnl Autoconf >= 2.61 supports dots in --with options.
-  pushdef([P_A_C_K],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[m4_translit(PACK,[.],[_])],PACK)])
   dnl By default, look in $includedir and $libdir.
   use_additional=yes
   AC_LIB_WITH_FINAL_PREFIX([
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
+    eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+    eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
   ])
-  AC_ARG_WITH(P_A_C_K[-prefix],
-[[  --with-]]P_A_C_K[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
-  --without-]]P_A_C_K[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
+  AC_ARG_WITH(PACK[-prefix],
+[[  --with-]]PACK[[-prefix[=DIR]  search for ]PACKLIBS[ in DIR/include and DIR/lib
+  --without-]]PACK[[-prefix     don't search for ]PACKLIBS[ in includedir and libdir]],
 [
     if test "X$withval" = "Xno"; then
       use_additional=no
@@ -206,17 +206,23 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
         AC_LIB_WITH_FINAL_PREFIX([
           eval additional_includedir=\"$includedir\"
           eval additional_libdir=\"$libdir\"
+          eval additional_libdir2=\"$exec_prefix/$acl_libdirstem2\"
+          eval additional_libdir3=\"$exec_prefix/$acl_libdirstem3\"
         ])
       else
         additional_includedir="$withval/include"
         additional_libdir="$withval/$acl_libdirstem"
-        if test "$acl_libdirstem2" != "$acl_libdirstem" \
-           && ! test -d "$withval/$acl_libdirstem"; then
-          additional_libdir="$withval/$acl_libdirstem2"
-        fi
+        additional_libdir2="$withval/$acl_libdirstem2"
+        additional_libdir3="$withval/$acl_libdirstem3"
       fi
     fi
 ])
+  if test "X$additional_libdir2" = "X$additional_libdir"; then
+    additional_libdir2=
+  fi
+  if test "X$additional_libdir3" = "X$additional_libdir"; then
+    additional_libdir3=
+  fi
   dnl Search the library and its dependencies in $additional_libdir and
   dnl $LDFLAGS. Using breadth-first-seach.
   LIB[]NAME=
@@ -272,48 +278,54 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
             shrext=
           fi
           if test $use_additional = yes; then
-            dir="$additional_libdir"
-            dnl The same code as in the loop below:
-            dnl First look for a shared library.
-            if test -n "$acl_shlibext"; then
-              if test -f "$dir/$libname$shrext"; then
-                found_dir="$dir"
-                found_so="$dir/$libname$shrext"
-              else
-                if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
-                  ver=`(cd "$dir" && \
-                        for f in "$libname$shrext".*; do echo "$f"; done \
-                        | sed -e "s,^$libname$shrext\\\\.,," \
-                        | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
-                        | sed 1q ) 2>/dev/null`
-                  if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
-                    found_dir="$dir"
-                    found_so="$dir/$libname$shrext.$ver"
+            for additional_libdir_variable in additional_libdir additional_libdir2 additional_libdir3; do
+              if test "X$found_dir" = "X"; then
+                eval dir=\$$additional_libdir_variable
+                if test -n "$dir"; then
+                  dnl The same code as in the loop below:
+                  dnl First look for a shared library.
+                  if test -n "$acl_shlibext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
+                      found_dir="$dir"
+                      found_so="$dir/$libname$shrext"
+                    else
+                      if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then
+                        ver=`(cd "$dir" && \
+                              for f in "$libname$shrext".*; do echo "$f"; done \
+                              | sed -e "s,^$libname$shrext\\\\.,," \
+                              | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
+                              | sed 1q ) 2>/dev/null`
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
+                          found_dir="$dir"
+                          found_so="$dir/$libname$shrext.$ver"
+                        fi
+                      else
+                        eval library_names=\"$acl_library_names_spec\"
+                        for f in $library_names; do
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
+                            found_dir="$dir"
+                            found_so="$dir/$f"
+                            break
+                          fi
+                        done
+                      fi
+                    fi
                   fi
-                else
-                  eval library_names=\"$acl_library_names_spec\"
-                  for f in $library_names; do
-                    if test -f "$dir/$f"; then
+                  dnl Then look for a static library.
+                  if test "X$found_dir" = "X"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
                       found_dir="$dir"
-                      found_so="$dir/$f"
-                      break
+                      found_a="$dir/$libname.$acl_libext"
                     fi
-                  done
+                  fi
+                  if test "X$found_dir" != "X"; then
+                    if test -f "$dir/$libname.la"; then
+                      found_la="$dir/$libname.la"
+                    fi
+                  fi
                 fi
               fi
-            fi
-            dnl Then look for a static library.
-            if test "X$found_dir" = "X"; then
-              if test -f "$dir/$libname.$acl_libext"; then
-                found_dir="$dir"
-                found_a="$dir/$libname.$acl_libext"
-              fi
-            fi
-            if test "X$found_dir" != "X"; then
-              if test -f "$dir/$libname.la"; then
-                found_la="$dir/$libname.la"
-              fi
-            fi
+            done
           fi
           if test "X$found_dir" = "X"; then
             for x in $LDFLAGS $LTLIB[]NAME; do
@@ -323,7 +335,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                   dir=`echo "X$x" | sed -e 's/^X-L//'`
                   dnl First look for a shared library.
                   if test -n "$acl_shlibext"; then
-                    if test -f "$dir/$libname$shrext"; then
+                    if test -f "$dir/$libname$shrext" && acl_is_expected_elfclass < "$dir/$libname$shrext"; then
                       found_dir="$dir"
                       found_so="$dir/$libname$shrext"
                     else
@@ -333,14 +345,14 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                               | sed -e "s,^$libname$shrext\\\\.,," \
                               | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \
                               | sed 1q ) 2>/dev/null`
-                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then
+                        if test -n "$ver" && test -f "$dir/$libname$shrext.$ver" && acl_is_expected_elfclass < "$dir/$libname$shrext.$ver"; then
                           found_dir="$dir"
                           found_so="$dir/$libname$shrext.$ver"
                         fi
                       else
                         eval library_names=\"$acl_library_names_spec\"
                         for f in $library_names; do
-                          if test -f "$dir/$f"; then
+                          if test -f "$dir/$f" && acl_is_expected_elfclass < "$dir/$f"; then
                             found_dir="$dir"
                             found_so="$dir/$f"
                             break
@@ -351,7 +363,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                   fi
                   dnl Then look for a static library.
                   if test "X$found_dir" = "X"; then
-                    if test -f "$dir/$libname.$acl_libext"; then
+                    if test -f "$dir/$libname.$acl_libext" && ${AR-ar} -p "$dir/$libname.$acl_libext" | acl_is_expected_elfclass; then
                       found_dir="$dir"
                       found_a="$dir/$libname.$acl_libext"
                     fi
@@ -377,7 +389,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
               dnl standard /usr/lib.
               if test "$enable_rpath" = no \
                  || test "X$found_dir" = "X/usr/$acl_libdirstem" \
-                 || test "X$found_dir" = "X/usr/$acl_libdirstem2"; then
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem2" \
+                 || test "X$found_dir" = "X/usr/$acl_libdirstem3"; then
                 dnl No hardcoding is needed.
                 LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so"
               else
@@ -477,6 +490,13 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                 fi
                 additional_includedir="$basedir/include"
                 ;;
+              */$acl_libdirstem3 | */$acl_libdirstem3/)
+                basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem3/"'*$,,'`
+                if test "$name" = '$1'; then
+                  LIB[]NAME[]_PREFIX="$basedir"
+                fi
+                additional_includedir="$basedir/include"
+                ;;
             esac
             if test "X$additional_includedir" != "X"; then
               dnl Potentially add $additional_includedir to $INCNAME.
@@ -527,19 +547,21 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
               for dep in $dependency_libs; do
                 case "$dep" in
                   -L*)
-                    additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
-                    dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME.
+                    dependency_libdir=`echo "X$dep" | sed -e 's/^X-L//'`
+                    dnl Potentially add $dependency_libdir to $LIBNAME and $LTLIBNAME.
                     dnl But don't add it
                     dnl   1. if it's the standard /usr/lib,
                     dnl   2. if it's /usr/local/lib and we are using GCC on Linux,
                     dnl   3. if it's already present in $LDFLAGS or the already
                     dnl      constructed $LIBNAME,
                     dnl   4. if it doesn't exist as a directory.
-                    if test "X$additional_libdir" != "X/usr/$acl_libdirstem" \
-                       && test "X$additional_libdir" != "X/usr/$acl_libdirstem2"; then
+                    if test "X$dependency_libdir" != "X/usr/$acl_libdirstem" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem2" \
+                       && test "X$dependency_libdir" != "X/usr/$acl_libdirstem3"; then
                       haveit=
-                      if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem" \
-                         || test "X$additional_libdir" = "X/usr/local/$acl_libdirstem2"; then
+                      if test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem2" \
+                         || test "X$dependency_libdir" = "X/usr/local/$acl_libdirstem3"; then
                         if test -n "$GCC"; then
                           case $host_os in
                             linux* | gnu* | k*bsd*-gnu) haveit=yes;;
@@ -550,29 +572,29 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                         haveit=
                         for x in $LDFLAGS $LIB[]NAME; do
                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LIBNAME.
-                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                            dnl Really add $dependency_libdir to $LIBNAME.
+                            LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$dependency_libdir"
                           fi
                         fi
                         haveit=
                         for x in $LDFLAGS $LTLIB[]NAME; do
                           AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"])
-                          if test "X$x" = "X-L$additional_libdir"; then
+                          if test "X$x" = "X-L$dependency_libdir"; then
                             haveit=yes
                             break
                           fi
                         done
                         if test -z "$haveit"; then
-                          if test -d "$additional_libdir"; then
-                            dnl Really add $additional_libdir to $LTLIBNAME.
-                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir"
+                          if test -d "$dependency_libdir"; then
+                            dnl Really add $dependency_libdir to $LTLIBNAME.
+                            LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$dependency_libdir"
                           fi
                         fi
                       fi
@@ -609,7 +631,20 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
                     ;;
                   -l*)
                     dnl Handle this in the next round.
-                    names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'`
+                    dnl But on GNU systems, ignore -lc options, because
+                    dnl   - linking with libc is the default anyway,
+                    dnl   - linking with libc.a may produce an error
+                    dnl     "/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie"
+                    dnl     or may produce an executable that always crashes, see
+                    dnl     <https://lists.gnu.org/archive/html/grep-devel/2020-09/msg00052.html>.
+                    dep=`echo "X$dep" | sed -e 's/^X-l//'`
+                    if test "X$dep" != Xc \
+                       || case $host_os in
+                            linux* | gnu* | k*bsd*-gnu) false ;;
+                            *)                          true ;;
+                          esac; then
+                      names_next_round="$names_next_round $dep"
+                    fi
                     ;;
                   *.la)
                     dnl Handle this in the next round. Throw away the .la's
@@ -670,7 +705,6 @@ AC_DEFUN([AC_LIB_LINKFLAGS_BODY],
       LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir"
     done
   fi
-  popdef([P_A_C_K])
   popdef([PACKLIBS])
   popdef([PACKUP])
   popdef([PACK])
@@ -721,7 +755,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
           dir="$next"
           dnl No need to hardcode the standard /usr/lib.
           if test "X$dir" != "X/usr/$acl_libdirstem" \
-             && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+             && test "X$dir" != "X/usr/$acl_libdirstem2" \
+             && test "X$dir" != "X/usr/$acl_libdirstem3"; then
             rpathdirs="$rpathdirs $dir"
           fi
           next=
@@ -731,7 +766,8 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
             -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'`
                  dnl No need to hardcode the standard /usr/lib.
                  if test "X$dir" != "X/usr/$acl_libdirstem" \
-                    && test "X$dir" != "X/usr/$acl_libdirstem2"; then
+                    && test "X$dir" != "X/usr/$acl_libdirstem2" \
+                    && test "X$dir" != "X/usr/$acl_libdirstem3"; then
                    rpathdirs="$rpathdirs $dir"
                  fi
                  next= ;;
index 6851031..3c94db0 100644 (file)
@@ -1,18 +1,11 @@
-# lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2016 Free Software Foundation, Inc.
+# lib-prefix.m4 serial 19
+dnl Copyright (C) 2001-2005, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
-dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and
-dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't
-dnl require excessive bracketing.
-ifdef([AC_HELP_STRING],
-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])],
-[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])])
-
 dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed
 dnl to access previously installed libraries. The basic assumption is that
 dnl a user will want packages to use other packages he previously installed
@@ -32,9 +25,9 @@ AC_DEFUN([AC_LIB_PREFIX],
     eval additional_includedir=\"$includedir\"
     eval additional_libdir=\"$libdir\"
   ])
-  AC_LIB_ARG_WITH([lib-prefix],
-[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
-  --without-lib-prefix    don't search for libraries in includedir and libdir],
+  AC_ARG_WITH([lib-prefix],
+[[  --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib
+  --without-lib-prefix    don't search for libraries in includedir and libdir]],
 [
     if test "X$withval" = "Xno"; then
       use_additional=no
@@ -154,71 +147,177 @@ AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX],
 ])
 
 dnl AC_LIB_PREPARE_MULTILIB creates
-dnl - a variable acl_libdirstem, containing the basename of the libdir, either
-dnl   "lib" or "lib64" or "lib/64",
-dnl - a variable acl_libdirstem2, as a secondary possible value for
-dnl   acl_libdirstem, either the same as acl_libdirstem or "lib/sparcv9" or
-dnl   "lib/amd64".
+dnl - a function acl_is_expected_elfclass, that tests whether standard input
+dn;   has a 32-bit or 64-bit ELF header, depending on the host CPU ABI,
+dnl - 3 variables acl_libdirstem, acl_libdirstem2, acl_libdirstem3, containing
+dnl   the basename of the libdir to try in turn, either "lib" or "lib64" or
+dnl   "lib/64" or "lib32" or "lib/sparcv9" or "lib/amd64" or similar.
 AC_DEFUN([AC_LIB_PREPARE_MULTILIB],
 [
-  dnl There is no formal standard regarding lib and lib64.
-  dnl On glibc systems, the current practice is that on a system supporting
+  dnl There is no formal standard regarding lib, lib32, and lib64.
+  dnl On most glibc systems, the current practice is that on a system supporting
   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
-  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. We determine
-  dnl the compiler's default mode by looking at the compiler's library search
-  dnl path. If at least one of its elements ends in /lib64 or points to a
-  dnl directory whose absolute pathname ends in /lib64, we assume a 64-bit ABI.
-  dnl Otherwise we use the default, namely "lib".
+  dnl $prefix/lib64 and 32-bit libraries go under $prefix/lib. However, on
+  dnl Arch Linux based distributions, it's the opposite: 32-bit libraries go
+  dnl under $prefix/lib32 and 64-bit libraries go under $prefix/lib.
+  dnl We determine the compiler's default mode by looking at the compiler's
+  dnl library search path. If at least one of its elements ends in /lib64 or
+  dnl points to a directory whose absolute pathname ends in /lib64, we use that
+  dnl for 64-bit ABIs. Similarly for 32-bit ABIs. Otherwise we use the default,
+  dnl namely "lib".
   dnl On Solaris systems, the current practice is that on a system supporting
   dnl 32-bit and 64-bit instruction sets or ABIs, 64-bit libraries go under
   dnl $prefix/lib/64 (which is a symlink to either $prefix/lib/sparcv9 or
   dnl $prefix/lib/amd64) and 32-bit libraries go under $prefix/lib.
   AC_REQUIRE([AC_CANONICAL_HOST])
-  acl_libdirstem=lib
-  acl_libdirstem2=
-  case "$host_os" in
-    solaris*)
-      dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
-      dnl <http://docs.sun.com/app/docs/doc/816-5138/dev-env?l=en&a=view>.
-      dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
-      dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
-      dnl symlink is missing, so we set acl_libdirstem2 too.
-      AC_CACHE_CHECK([for 64-bit host], [gl_cv_solaris_64bit],
-        [AC_EGREP_CPP([sixtyfour bits], [
-#ifdef _LP64
-sixtyfour bits
-#endif
-           ], [gl_cv_solaris_64bit=yes], [gl_cv_solaris_64bit=no])
-        ])
-      if test $gl_cv_solaris_64bit = yes; then
-        acl_libdirstem=lib/64
-        case "$host_cpu" in
-          sparc*)        acl_libdirstem2=lib/sparcv9 ;;
-          i*86 | x86_64) acl_libdirstem2=lib/amd64 ;;
-        esac
-      fi
-      ;;
-    *)
-      searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
-      if test -n "$searchpath"; then
-        acl_save_IFS="${IFS=   }"; IFS=":"
-        for searchdir in $searchpath; do
-          if test -d "$searchdir"; then
-            case "$searchdir" in
-              */lib64/ | */lib64 ) acl_libdirstem=lib64 ;;
-              */../ | */.. )
-                # Better ignore directories of this form. They are misleading.
-                ;;
-              *) searchdir=`cd "$searchdir" && pwd`
-                 case "$searchdir" in
-                   */lib64 ) acl_libdirstem=lib64 ;;
-                 esac ;;
-            esac
-          fi
-        done
-        IFS="$acl_save_IFS"
-      fi
-      ;;
-  esac
-  test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+  AC_REQUIRE([gl_HOST_CPU_C_ABI_32BIT])
+
+  AC_CACHE_CHECK([for ELF binary format], [gl_cv_elf],
+    [AC_EGREP_CPP([Extensible Linking Format],
+       [#ifdef __ELF__
+        Extensible Linking Format
+        #endif
+       ],
+       [gl_cv_elf=yes],
+       [gl_cv_elf=no])
+    ])
+  if test $gl_cv_elf = yes; then
+    # Extract the ELF class of a file (5th byte) in decimal.
+    # Cf. https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
+    if od -A x < /dev/null >/dev/null 2>/dev/null; then
+      # Use POSIX od.
+      func_elfclass ()
+      {
+        od -A n -t d1 -j 4 -N 1
+      }
+    else
+      # Use BSD hexdump.
+      func_elfclass ()
+      {
+        dd bs=1 count=1 skip=4 2>/dev/null | hexdump -e '1/1 "%3d "'
+        echo
+      }
+    fi
+    # Use 'expr', not 'test', to compare the values of func_elfclass, because on
+    # Solaris 11 OpenIndiana and Solaris 11 OmniOS, the result is 001 or 002,
+    # not 1 or 2.
+changequote(,)dnl
+    case $HOST_CPU_C_ABI_32BIT in
+      yes)
+        # 32-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          expr "`func_elfclass | sed -e 's/[   ]//g'`" = 1 > /dev/null
+        }
+        ;;
+      no)
+        # 64-bit ABI.
+        acl_is_expected_elfclass ()
+        {
+          expr "`func_elfclass | sed -e 's/[   ]//g'`" = 2 > /dev/null
+        }
+        ;;
+      *)
+        # Unknown.
+        acl_is_expected_elfclass ()
+        {
+          :
+        }
+        ;;
+    esac
+changequote([,])dnl
+  else
+    acl_is_expected_elfclass ()
+    {
+      :
+    }
+  fi
+
+  dnl Allow the user to override the result by setting acl_cv_libdirstems.
+  AC_CACHE_CHECK([for the common suffixes of directories in the library search path],
+    [acl_cv_libdirstems],
+    [dnl Try 'lib' first, because that's the default for libdir in GNU, see
+     dnl <https://www.gnu.org/prep/standards/html_node/Directory-Variables.html>.
+     acl_libdirstem=lib
+     acl_libdirstem2=
+     acl_libdirstem3=
+     case "$host_os" in
+       solaris*)
+         dnl See Solaris 10 Software Developer Collection > Solaris 64-bit Developer's Guide > The Development Environment
+         dnl <https://docs.oracle.com/cd/E19253-01/816-5138/dev-env/index.html>.
+         dnl "Portable Makefiles should refer to any library directories using the 64 symbolic link."
+         dnl But we want to recognize the sparcv9 or amd64 subdirectory also if the
+         dnl symlink is missing, so we set acl_libdirstem2 too.
+         if test $HOST_CPU_C_ABI_32BIT = no; then
+           acl_libdirstem2=lib/64
+           case "$host_cpu" in
+             sparc*)        acl_libdirstem3=lib/sparcv9 ;;
+             i*86 | x86_64) acl_libdirstem3=lib/amd64 ;;
+           esac
+         fi
+         ;;
+       *)
+         dnl If $CC generates code for a 32-bit ABI, the libraries are
+         dnl surely under $prefix/lib or $prefix/lib32, not $prefix/lib64.
+         dnl Similarly, if $CC generates code for a 64-bit ABI, the libraries
+         dnl are surely under $prefix/lib or $prefix/lib64, not $prefix/lib32.
+         dnl Find the compiler's search path. However, non-system compilers
+         dnl sometimes have odd library search paths. But we can't simply invoke
+         dnl '/usr/bin/gcc -print-search-dirs' because that would not take into
+         dnl account the -m32/-m31 or -m64 options from the $CC or $CFLAGS.
+         searchpath=`(LC_ALL=C $CC $CPPFLAGS $CFLAGS -print-search-dirs) 2>/dev/null \
+                     | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'`
+         if test $HOST_CPU_C_ABI_32BIT != no; then
+           # 32-bit or unknown ABI.
+           if test -d /usr/lib32; then
+             acl_libdirstem2=lib32
+           fi
+         fi
+         if test $HOST_CPU_C_ABI_32BIT != yes; then
+           # 64-bit or unknown ABI.
+           if test -d /usr/lib64; then
+             acl_libdirstem3=lib64
+           fi
+         fi
+         if test -n "$searchpath"; then
+           acl_save_IFS="${IFS=        }"; IFS=":"
+           for searchdir in $searchpath; do
+             if test -d "$searchdir"; then
+               case "$searchdir" in
+                 */lib32/ | */lib32 ) acl_libdirstem2=lib32 ;;
+                 */lib64/ | */lib64 ) acl_libdirstem3=lib64 ;;
+                 */../ | */.. )
+                   # Better ignore directories of this form. They are misleading.
+                   ;;
+                 *) searchdir=`cd "$searchdir" && pwd`
+                    case "$searchdir" in
+                      */lib32 ) acl_libdirstem2=lib32 ;;
+                      */lib64 ) acl_libdirstem3=lib64 ;;
+                    esac ;;
+               esac
+             fi
+           done
+           IFS="$acl_save_IFS"
+           if test $HOST_CPU_C_ABI_32BIT = yes; then
+             # 32-bit ABI.
+             acl_libdirstem3=
+           fi
+           if test $HOST_CPU_C_ABI_32BIT = no; then
+             # 64-bit ABI.
+             acl_libdirstem2=
+           fi
+         fi
+         ;;
+     esac
+     test -n "$acl_libdirstem2" || acl_libdirstem2="$acl_libdirstem"
+     test -n "$acl_libdirstem3" || acl_libdirstem3="$acl_libdirstem"
+     acl_cv_libdirstems="$acl_libdirstem,$acl_libdirstem2,$acl_libdirstem3"
+    ])
+  dnl Decompose acl_cv_libdirstems into acl_libdirstem, acl_libdirstem2, and
+  dnl acl_libdirstem3.
+changequote(,)dnl
+  acl_libdirstem=`echo "$acl_cv_libdirstems" | sed -e 's/,.*//'`
+  acl_libdirstem2=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,//' -e 's/,.*//'`
+  acl_libdirstem3=`echo "$acl_cv_libdirstems" | sed -e 's/^[^,]*,[^,]*,//' -e 's/,.*//'`
+changequote([,])dnl
 ])
index 5bfa092..3255235 100644 (file)
@@ -1,5 +1,5 @@
 # libsigsegv.m4 serial 4
-dnl Copyright (C) 2002-2003, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/libunistring-base.m4 b/m4/libunistring-base.m4
new file mode 100644 (file)
index 0000000..657bc0d
--- /dev/null
@@ -0,0 +1,141 @@
+# libunistring-base.m4 serial 5
+dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Paolo Bonzini and Bruno Haible.
+
+dnl gl_LIBUNISTRING_MODULE([VERSION], [Module])
+dnl Declares that the source files of Module should be compiled, unless we
+dnl are linking with libunistring and its version is >= the given VERSION.
+dnl Defines an automake conditional LIBUNISTRING_COMPILE_$MODULE that is
+dnl true if the source files of Module should be compiled.
+dnl This macro is to be used for public libunistring API, not for
+dnl undocumented API.
+dnl
+dnl You have to bump the VERSION argument to the next projected version
+dnl number each time you make a change that affects the behaviour of the
+dnl functions defined in Module (even if the sources of Module itself do not
+dnl change).
+
+AC_DEFUN([gl_LIBUNISTRING_MODULE],
+[
+  AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE])
+  dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from
+  dnl gl_LIBUNISTRING_CORE if that macro has been run.
+  AM_CONDITIONAL(AS_TR_CPP([LIBUNISTRING_COMPILE_$2]),
+    [gl_LIBUNISTRING_VERSION_CMP([$1])])
+])
+
+dnl gl_LIBUNISTRING_LIBHEADER([VERSION], [HeaderFile])
+dnl Declares that HeaderFile should be created, unless we are linking
+dnl with libunistring and its version is >= the given VERSION.
+dnl HeaderFile should be relative to the lib directory and end in '.h'.
+dnl Prepares for substituting LIBUNISTRING_HEADERFILE (to HeaderFile or empty).
+dnl
+dnl When we are linking with the already installed libunistring and its version
+dnl is < VERSION, we create HeaderFile here, because we may compile functions
+dnl (via gl_LIBUNISTRING_MODULE above) that are not contained in the installed
+dnl version.
+dnl When we are linking with the already installed libunistring and its version
+dnl is > VERSION, we don't create HeaderFile here: it could cause compilation
+dnl errors in other libunistring header files if some types are missing.
+dnl
+dnl You have to bump the VERSION argument to the next projected version
+dnl number each time you make a non-comment change to the HeaderFile.
+
+AC_DEFUN([gl_LIBUNISTRING_LIBHEADER],
+[
+  AC_REQUIRE([gl_LIBUNISTRING_LIB_PREPARE])
+  dnl Use the variables HAVE_LIBUNISTRING, LIBUNISTRING_VERSION from
+  dnl gl_LIBUNISTRING_CORE if that macro has been run.
+  if gl_LIBUNISTRING_VERSION_CMP([$1]); then
+    LIBUNISTRING_[]AS_TR_CPP([$2])='$2'
+  else
+    LIBUNISTRING_[]AS_TR_CPP([$2])=
+  fi
+  AC_SUBST([LIBUNISTRING_]AS_TR_CPP([$2]))
+])
+
+dnl Miscellaneous preparations/initializations.
+
+AC_DEFUN([gl_LIBUNISTRING_LIB_PREPARE],
+[
+  dnl Ensure that HAVE_LIBUNISTRING is fully determined at this point.
+  m4_ifdef([gl_LIBUNISTRING], [AC_REQUIRE([gl_LIBUNISTRING])])
+
+  AC_REQUIRE([AC_PROG_AWK])
+
+dnl Sed expressions to extract the parts of a version number.
+changequote(,)
+gl_libunistring_sed_extract_major='/^[0-9]/{s/^\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+gl_libunistring_sed_extract_minor='/^[0-9][0-9]*[.][0-9]/{s/^[0-9]*[.]\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+gl_libunistring_sed_extract_subminor='/^[0-9][0-9]*[.][0-9][0-9]*[.][0-9]/{s/^[0-9]*[.][0-9]*[.]\([0-9]*\).*/\1/p;q;}
+i\
+0
+q
+'
+changequote([,])
+
+  if test "$HAVE_LIBUNISTRING" = yes; then
+    LIBUNISTRING_VERSION_MAJOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_major"`
+    LIBUNISTRING_VERSION_MINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_minor"`
+    LIBUNISTRING_VERSION_SUBMINOR=`echo "$LIBUNISTRING_VERSION" | sed -n -e "$gl_libunistring_sed_extract_subminor"`
+  fi
+])
+
+dnl gl_LIBUNISTRING_VERSION_CMP([VERSION])
+dnl Expands to a shell statement that evaluates to true if LIBUNISTRING_VERSION
+dnl is less than the VERSION argument.
+AC_DEFUN([gl_LIBUNISTRING_VERSION_CMP],
+[ { test "$HAVE_LIBUNISTRING" != yes \
+    || {
+         dnl AS_LITERAL_IF exists and works fine since autoconf-2.59 at least.
+         AS_LITERAL_IF([$1],
+           [dnl This is the optimized variant, that assumes the argument is a literal:
+            m4_pushdef([requested_version_major],
+              [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^\([0-9]*\).*], [\1]), [])])
+            m4_pushdef([requested_version_minor],
+              [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.]\([0-9]*\).*], [\1]), [$1])])
+            m4_pushdef([requested_version_subminor],
+              [gl_LIBUNISTRING_ARG_OR_ZERO(m4_bpatsubst([$1], [^[0-9]*[.][0-9]*[.]\([0-9]*\).*], [\1]), [$1])])
+            test $LIBUNISTRING_VERSION_MAJOR -lt requested_version_major \
+            || { test $LIBUNISTRING_VERSION_MAJOR -eq requested_version_major \
+                 && { test $LIBUNISTRING_VERSION_MINOR -lt requested_version_minor \
+                      || { test $LIBUNISTRING_VERSION_MINOR -eq requested_version_minor \
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt requested_version_subminor
+                         }
+                    }
+               }
+            m4_popdef([requested_version_subminor])
+            m4_popdef([requested_version_minor])
+            m4_popdef([requested_version_major])
+           ],
+           [dnl This is the unoptimized variant:
+            requested_version_major=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_major"`
+            requested_version_minor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_minor"`
+            requested_version_subminor=`echo '$1' | sed -n -e "$gl_libunistring_sed_extract_subminor"`
+            test $LIBUNISTRING_VERSION_MAJOR -lt $requested_version_major \
+            || { test $LIBUNISTRING_VERSION_MAJOR -eq $requested_version_major \
+                 && { test $LIBUNISTRING_VERSION_MINOR -lt $requested_version_minor \
+                      || { test $LIBUNISTRING_VERSION_MINOR -eq $requested_version_minor \
+                           && test $LIBUNISTRING_VERSION_SUBMINOR -lt $requested_version_subminor
+                         }
+                    }
+               }
+           ])
+       }
+  }])
+
+dnl gl_LIBUNISTRING_ARG_OR_ZERO([ARG], [ORIG]) expands to ARG if it is not the
+dnl same as ORIG, otherwise to 0.
+m4_define([gl_LIBUNISTRING_ARG_OR_ZERO], [m4_if([$1], [$2], [0], [$1])])
index 31fdf0a..70dbb7d 100644 (file)
@@ -1,6 +1,6 @@
 dnl Check whether limits.h has needed features.
 
-dnl Copyright 2016 Free Software Foundation, Inc.
+dnl Copyright 2016-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,14 +11,18 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
 [
   gl_CHECK_NEXT_HEADERS([limits.h])
 
-  AC_CACHE_CHECK([whether limits.h has ULLONG_WIDTH etc.],
+  AC_CACHE_CHECK([whether limits.h has LLONG_MAX, WORD_BIT, ULLONG_WIDTH etc.],
     [gl_cv_header_limits_width],
     [AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM([[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
-                           #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
-                          #endif
-                          #include <limits.h>
-                          int ullw = ULLONG_WIDTH;]])],
+       [AC_LANG_PROGRAM(
+          [[#ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+             #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+            #endif
+            #include <limits.h>
+            long long llm = LLONG_MAX;
+            int wb = WORD_BIT;
+            int ullw = ULLONG_WIDTH;
+          ]])],
        [gl_cv_header_limits_width=yes],
        [gl_cv_header_limits_width=no])])
   if test "$gl_cv_header_limits_width" = yes; then
@@ -29,3 +33,11 @@ AC_DEFUN_ONCE([gl_LIMITS_H],
   AC_SUBST([LIMITS_H])
   AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
 ])
+
+dnl Unconditionally enables the replacement of <limits.h>.
+AC_DEFUN([gl_REPLACE_LIMITS_H],
+[
+  AC_REQUIRE([gl_LIMITS_H])
+  LIMITS_H='limits.h'
+  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+])
index 34e7708..55a8a8d 100644 (file)
@@ -1,5 +1,5 @@
-# link.m4 serial 8
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# link.m4 serial 11
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -39,10 +39,12 @@ AC_DEFUN([gl_FUNC_LINK],
            ]])],
          [gl_cv_func_link_works=yes], [gl_cv_func_link_works=no],
          [case "$host_os" in
-                    # Guess yes on glibc systems.
-            *-gnu*) gl_cv_func_link_works="guessing yes" ;;
-                    # If we don't know, assume the worst.
-            *)      gl_cv_func_link_works="guessing no" ;;
+                             # Guess yes on Linux systems.
+            linux-* | linux) gl_cv_func_link_works="guessing yes" ;;
+                             # Guess yes on glibc systems.
+            *-gnu* | gnu*)   gl_cv_func_link_works="guessing yes" ;;
+                             # If we don't know, obey --enable-cross-guesses.
+            *)               gl_cv_func_link_works="$gl_cross_guess_normal" ;;
           esac
          ])
        rm -f conftest.a conftest.b conftest.lnk])
index 22c311b..04389fc 100644 (file)
@@ -1,5 +1,5 @@
-# localcharset.m4 serial 7
-dnl Copyright (C) 2002, 2004, 2006, 2009-2016 Free Software Foundation, Inc.
+# localcharset.m4 serial 8
+dnl Copyright (C) 2002, 2004, 2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,10 +8,4 @@ AC_DEFUN([gl_LOCALCHARSET],
 [
   dnl Prerequisites of lib/localcharset.c.
   AC_REQUIRE([AM_LANGINFO_CODESET])
-  AC_REQUIRE([gl_FCNTL_O_FLAGS])
-  AC_CHECK_DECLS_ONCE([getc_unlocked])
-
-  dnl Prerequisites of the lib/Makefile.am snippet.
-  AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([gl_GLIBC21])
 ])
index 92896a0..b61df7e 100644 (file)
@@ -1,5 +1,5 @@
-# locale-fr.m4 serial 17
-dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc.
+# locale-fr.m4 serial 20
+dnl Copyright (C) 2003, 2005-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_FR],
   AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([AM_LANGINFO_CODESET])
   AC_CACHE_CHECK([for a traditional french locale], [gt_cv_locale_fr], [
-    AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
+    AC_LANG_CONFTEST([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <time.h>
 #if HAVE_LANGINFO_CODESET
@@ -24,8 +23,14 @@ changequote(,)dnl
 struct tm t;
 char buf[16];
 int main () {
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
   /* Check whether the given locale name is recognized by the system.  */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
   /* On native Windows, setlocale(category, "") looks at the system settings,
      not at the environment variables.  Also, when an encoding suffix such
      as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -33,9 +38,9 @@ int main () {
   if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
       || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
     return 1;
-#else
+# else
   if (setlocale (LC_ALL, "") == NULL) return 1;
-#endif
+# endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On Mac OS 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.
@@ -44,35 +49,35 @@ int main () {
      some unit tests fail.
      On MirBSD 10, when an unsupported locale is specified, setlocale()
      succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
+# if HAVE_LANGINFO_CODESET
   {
     const char *cs = nl_langinfo (CODESET);
     if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
         || strcmp (cs, "UTF-8") == 0)
       return 1;
   }
-#endif
-#ifdef __CYGWIN__
+# endif
+# ifdef __CYGWIN__
   /* On Cygwin, avoid locale names without encoding suffix, because the
      locale_charset() function relies on the encoding suffix.  Note that
      LC_ALL is set on the command line.  */
   if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
+# endif
   /* Check whether in the abbreviation of the second month, the second
      character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is only
      one byte long. This excludes the UTF-8 encoding.  */
   t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
   if (strftime (buf, sizeof (buf), "%b", &t) < 3 || buf[2] != 'v') return 1;
-#if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
+# if !defined __BIONIC__ /* Bionic libc's 'struct lconv' is just a dummy.  */
   /* Check whether the decimal separator is a comma.
      On NetBSD 3.0 in the fr_FR.ISO8859-1 locale, localeconv()->decimal_point
      are nl_langinfo(RADIXCHAR) are both ".".  */
   if (localeconv () ->decimal_point[0] != ',') return 1;
-#endif
+# endif
   return 0;
+#endif
 }
-changequote([,])dnl
-      ])])
+      ]])])
     if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
       case "$host_os" in
         # Handle native Windows specially, because there setlocale() interprets
@@ -136,8 +141,7 @@ AC_DEFUN([gt_LOCALE_FR_UTF8],
 [
   AC_REQUIRE([AM_LANGINFO_CODESET])
   AC_CACHE_CHECK([for a french Unicode locale], [gt_cv_locale_fr_utf8], [
-    AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
+    AC_LANG_CONFTEST([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <time.h>
 #if HAVE_LANGINFO_CODESET
@@ -153,7 +157,7 @@ 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__
+# if defined _WIN32 && !defined __CYGWIN__
   /* On native Windows, setlocale(category, "") looks at the system settings,
      not at the environment variables.  Also, when an encoding suffix such
      as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -199,8 +203,7 @@ int main () {
 #endif
   return 0;
 }
-changequote([,])dnl
-      ])])
+      ]])])
     if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
       case "$host_os" in
         # Handle native Windows specially, because there setlocale() interprets
index f222a08..cd94288 100644 (file)
@@ -1,5 +1,5 @@
-# locale-ja.m4 serial 12
-dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc.
+# locale-ja.m4 serial 15
+dnl Copyright (C) 2003, 2005-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_JA],
   AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([AM_LANGINFO_CODESET])
   AC_CACHE_CHECK([for a traditional japanese locale], [gt_cv_locale_ja], [
-    AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
+    AC_LANG_CONFTEST([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <time.h>
 #if HAVE_LANGINFO_CODESET
@@ -25,9 +24,14 @@ struct tm t;
 char buf[16];
 int main ()
 {
-  const char *p;
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
   /* Check whether the given locale name is recognized by the system.  */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
   /* On native Windows, setlocale(category, "") looks at the system settings,
      not at the environment variables.  Also, when an encoding suffix such
      as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -35,9 +39,9 @@ int main ()
   if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
       || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
     return 1;
-#else
+# else
   if (setlocale (LC_ALL, "") == NULL) return 1;
-#endif
+# endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On Mac OS 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.
@@ -46,35 +50,38 @@ int main ()
      some unit tests fail.
      On MirBSD 10, when an unsupported locale is specified, setlocale()
      succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
+# if HAVE_LANGINFO_CODESET
   {
     const char *cs = nl_langinfo (CODESET);
     if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
         || strcmp (cs, "UTF-8") == 0)
       return 1;
   }
-#endif
-#ifdef __CYGWIN__
+# endif
+# ifdef __CYGWIN__
   /* On Cygwin, avoid locale names without encoding suffix, because the
      locale_charset() function relies on the encoding suffix.  Note that
      LC_ALL is set on the command line.  */
   if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
+# endif
   /* Check whether MB_CUR_MAX is > 1.  This excludes the dysfunctional locales
      on Cygwin 1.5.x.  */
   if (MB_CUR_MAX == 1)
     return 1;
   /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
      This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
   return 0;
+#endif
 }
-changequote([,])dnl
-      ])])
+      ]])])
     if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
       case "$host_os" in
         # Handle native Windows specially, because there setlocale() interprets
index 75aa295..ecb8b60 100644 (file)
@@ -1,5 +1,5 @@
-# locale-tr.m4 serial 10
-dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc.
+# locale-tr.m4 serial 13
+dnl Copyright (C) 2003, 2005-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_TR_UTF8],
   AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([AM_LANGINFO_CODESET])
   AC_CACHE_CHECK([for a turkish Unicode locale], [gt_cv_locale_tr_utf8], [
-    AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
+    AC_LANG_CONFTEST([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <time.h>
 #if HAVE_LANGINFO_CODESET
@@ -21,6 +20,7 @@ changequote(,)dnl
 #endif
 #include <stdlib.h>
 #include <string.h>
+#include <wctype.h>
 struct tm t;
 char buf[16];
 int main () {
@@ -30,7 +30,7 @@ int main () {
      implement the Turkish upper-/lowercase mappings.  Therefore, let this
      program return 1 on BeOS.  */
   /* Check whether the given locale name is recognized by the system.  */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
   /* On native Windows, setlocale(category, "") looks at the system settings,
      not at the environment variables.  Also, when an encoding suffix such
      as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -74,8 +74,7 @@ int main () {
     return 1;
   return 0;
 }
-changequote([,])dnl
-      ])])
+      ]])])
     if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
       case "$host_os" in
         # Handle native Windows specially, because there setlocale() interprets
index 2271f77..1228be8 100644 (file)
@@ -1,5 +1,5 @@
-# locale-zh.m4 serial 12
-dnl Copyright (C) 2003, 2005-2016 Free Software Foundation, Inc.
+# locale-zh.m4 serial 15
+dnl Copyright (C) 2003, 2005-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,8 +12,7 @@ AC_DEFUN([gt_LOCALE_ZH_CN],
   AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([AM_LANGINFO_CODESET])
   AC_CACHE_CHECK([for a transitional chinese locale], [gt_cv_locale_zh_CN], [
-    AC_LANG_CONFTEST([AC_LANG_SOURCE([
-changequote(,)dnl
+    AC_LANG_CONFTEST([AC_LANG_SOURCE([[
 #include <locale.h>
 #include <stdlib.h>
 #include <time.h>
@@ -26,9 +25,14 @@ struct tm t;
 char buf[16];
 int main ()
 {
-  const char *p;
+  /* On BeOS and Haiku, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if defined __BEOS__ || defined __HAIKU__
+  return 1;
+#else
   /* Check whether the given locale name is recognized by the system.  */
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+# if defined _WIN32 && !defined __CYGWIN__
   /* On native Windows, setlocale(category, "") looks at the system settings,
      not at the environment variables.  Also, when an encoding suffix such
      as ".65001" or ".54936" is specified, it succeeds but sets the LC_CTYPE
@@ -36,9 +40,9 @@ int main ()
   if (setlocale (LC_ALL, getenv ("LC_ALL")) == NULL
       || strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
     return 1;
-#else
+# else
   if (setlocale (LC_ALL, "") == NULL) return 1;
-#endif
+# endif
   /* Check whether nl_langinfo(CODESET) is nonempty and not "ASCII" or "646".
      On Mac OS 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.
@@ -47,35 +51,38 @@ int main ()
      some unit tests fail.
      On MirBSD 10, when an unsupported locale is specified, setlocale()
      succeeds but then nl_langinfo(CODESET) is "UTF-8".  */
-#if HAVE_LANGINFO_CODESET
+# if HAVE_LANGINFO_CODESET
   {
     const char *cs = nl_langinfo (CODESET);
     if (cs[0] == '\0' || strcmp (cs, "ASCII") == 0 || strcmp (cs, "646") == 0
         || strcmp (cs, "UTF-8") == 0)
       return 1;
   }
-#endif
-#ifdef __CYGWIN__
+# endif
+# ifdef __CYGWIN__
   /* On Cygwin, avoid locale names without encoding suffix, because the
      locale_charset() function relies on the encoding suffix.  Note that
      LC_ALL is set on the command line.  */
   if (strchr (getenv ("LC_ALL"), '.') == NULL) return 1;
-#endif
+# endif
   /* Check whether in a month name, no byte in the range 0x80..0x9F occurs.
      This excludes the UTF-8 encoding (except on MirBSD).  */
-  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
-  if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
-  for (p = buf; *p != '\0'; p++)
-    if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
-      return 1;
+  {
+    const char *p;
+    t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+    if (strftime (buf, sizeof (buf), "%B", &t) < 2) return 1;
+    for (p = buf; *p != '\0'; p++)
+      if ((unsigned char) *p >= 0x80 && (unsigned char) *p < 0xa0)
+        return 1;
+  }
   /* Check whether a typical GB18030 multibyte sequence is recognized as a
      single wide character.  This excludes the GB2312 and GBK encodings.  */
   if (mblen ("\203\062\332\066", 5) != 4)
     return 1;
   return 0;
+#endif
 }
-changequote([,])dnl
-      ])])
+      ]])])
     if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
       case "$host_os" in
         # Handle native Windows specially, because there setlocale() interprets
index 563f8f8..444a381 100644 (file)
@@ -1,13 +1,13 @@
-# locale_h.m4 serial 19
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# locale_h.m4 serial 28
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_LOCALE_H],
+AC_DEFUN_ONCE([gl_LOCALE_H],
 [
-  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
-  dnl once only, before all statements that occur in other macros.
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
   AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
 
   dnl Persuade glibc <locale.h> to define locale_t and the int_p_*, int_n_*
@@ -17,7 +17,9 @@ AC_DEFUN([gl_LOCALE_H],
   dnl If <stddef.h> is replaced, then <locale.h> must also be replaced.
   AC_REQUIRE([gl_STDDEF_H])
 
-  dnl Solaris 11 2011-11 defines the int_p_*, int_n_* members of 'struct lconv'
+  AC_REQUIRE([gl_LOCALE_T])
+
+  dnl Solaris 11.0 defines the int_p_*, int_n_* members of 'struct lconv'
   dnl only if _LCONV_C99 is defined.
   AC_REQUIRE([AC_CANONICAL_HOST])
   case "$host_os" in
@@ -37,34 +39,6 @@ AC_DEFUN([gl_LOCALE_H],
        [gl_cv_header_locale_h_posix2001=yes],
        [gl_cv_header_locale_h_posix2001=no])])
 
-  dnl Check for <xlocale.h>.
-  AC_CHECK_HEADERS_ONCE([xlocale.h])
-  if test $ac_cv_header_xlocale_h = yes; then
-    HAVE_XLOCALE_H=1
-    dnl Check whether use of locale_t requires inclusion of <xlocale.h>,
-    dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by
-    dnl itself, we assume that <xlocale.h> will do so.
-    AC_CACHE_CHECK([whether locale.h defines locale_t],
-      [gl_cv_header_locale_has_locale_t],
-      [AC_COMPILE_IFELSE(
-         [AC_LANG_PROGRAM(
-            [[#include <locale.h>
-              locale_t x;]],
-            [[]])],
-         [gl_cv_header_locale_has_locale_t=yes],
-         [gl_cv_header_locale_has_locale_t=no])
-      ])
-    if test $gl_cv_header_locale_has_locale_t = yes; then
-      gl_cv_header_locale_h_needs_xlocale_h=no
-    else
-      gl_cv_header_locale_h_needs_xlocale_h=yes
-    fi
-  else
-    HAVE_XLOCALE_H=0
-    gl_cv_header_locale_h_needs_xlocale_h=no
-  fi
-  AC_SUBST([HAVE_XLOCALE_H])
-
   dnl Check whether 'struct lconv' is complete.
   dnl Bionic libc's 'struct lconv' is just a dummy.
   dnl On OpenBSD 4.9, HP-UX 11, IRIX 6.5, OSF/1 5.1, Solaris 9, Cygwin 1.5.x,
@@ -82,7 +56,20 @@ AC_DEFUN([gl_LOCALE_H],
        [gl_cv_sys_struct_lconv_ok=no])
     ])
   if test $gl_cv_sys_struct_lconv_ok = no; then
-    REPLACE_STRUCT_LCONV=1
+    dnl On native Windows with MSVC, merely define these member names as macros.
+    dnl This avoids trouble in C++ mode.
+    case "$host_os" in
+      mingw*)
+        AC_EGREP_CPP([Special], [
+#ifdef _MSC_VER
+ Special
+#endif
+          ],
+          [],
+          [REPLACE_STRUCT_LCONV=1])
+        ;;
+      *) REPLACE_STRUCT_LCONV=1 ;;
+    esac
   fi
 
   dnl <locale.h> is always overridden, because of GNULIB_POSIXCHECK.
@@ -96,27 +83,92 @@ AC_DEFUN([gl_LOCALE_H],
 # include <xlocale.h>
 #endif
     ]],
-    [setlocale duplocale])
+    [setlocale newlocale duplocale freelocale])
+])
+
+dnl Checks to determine whether the system has the locale_t type,
+dnl and how to obtain it.
+AC_DEFUN([gl_LOCALE_T],
+[
+  dnl Persuade glibc and Solaris <locale.h> to define locale_t.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  dnl Check whether use of locale_t requires inclusion of <xlocale.h>,
+  dnl e.g. on Mac OS X 10.5. If <locale.h> does not define locale_t by
+  dnl itself, we assume that <xlocale.h> will do so.
+  AC_CACHE_CHECK([whether locale.h defines locale_t],
+    [gl_cv_header_locale_has_locale_t],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <locale.h>
+            locale_t x;]],
+          [[]])],
+       [gl_cv_header_locale_has_locale_t=yes],
+       [gl_cv_header_locale_has_locale_t=no])
+    ])
+
+  dnl Check for <xlocale.h>.
+  AC_CHECK_HEADERS_ONCE([xlocale.h])
+  if test $ac_cv_header_xlocale_h = yes; then
+    HAVE_XLOCALE_H=1
+    if test $gl_cv_header_locale_has_locale_t = yes; then
+      gl_cv_header_locale_h_needs_xlocale_h=no
+    else
+      gl_cv_header_locale_h_needs_xlocale_h=yes
+    fi
+    HAVE_LOCALE_T=1
+  else
+    HAVE_XLOCALE_H=0
+    gl_cv_header_locale_h_needs_xlocale_h=no
+    if test $gl_cv_header_locale_has_locale_t = yes; then
+      HAVE_LOCALE_T=1
+    else
+      HAVE_LOCALE_T=0
+    fi
+  fi
+  AC_SUBST([HAVE_XLOCALE_H])
 ])
 
+# gl_LOCALE_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_LOCALE_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_LOCALE_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_LOCALE_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALECONV])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETLOCALE_NULL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUPLOCALE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALENAME])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_LOCALE_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_LOCALE_H_DEFAULTS],
 [
-  GNULIB_LOCALECONV=0; AC_SUBST([GNULIB_LOCALECONV])
-  GNULIB_SETLOCALE=0;  AC_SUBST([GNULIB_SETLOCALE])
-  GNULIB_DUPLOCALE=0;  AC_SUBST([GNULIB_DUPLOCALE])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_NEWLOCALE=1;       AC_SUBST([HAVE_NEWLOCALE])
   HAVE_DUPLOCALE=1;       AC_SUBST([HAVE_DUPLOCALE])
+  HAVE_FREELOCALE=1;      AC_SUBST([HAVE_FREELOCALE])
   REPLACE_LOCALECONV=0;   AC_SUBST([REPLACE_LOCALECONV])
   REPLACE_SETLOCALE=0;    AC_SUBST([REPLACE_SETLOCALE])
+  REPLACE_NEWLOCALE=0;    AC_SUBST([REPLACE_NEWLOCALE])
   REPLACE_DUPLOCALE=0;    AC_SUBST([REPLACE_DUPLOCALE])
+  REPLACE_FREELOCALE=0;   AC_SUBST([REPLACE_FREELOCALE])
   REPLACE_STRUCT_LCONV=0; AC_SUBST([REPLACE_STRUCT_LCONV])
+  LOCALENAME_ENHANCE_LOCALE_FUNCS=0; AC_SUBST([LOCALENAME_ENHANCE_LOCALE_FUNCS])
 ])
index 6e1dbf1..e29c7c3 100644 (file)
@@ -1,5 +1,5 @@
 # localeconv.m4 serial 1
-dnl Copyright (C) 2012-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index fc1d3ea..2bff33d 100644 (file)
@@ -1,17 +1,41 @@
-# localename.m4 serial 2
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# localename.m4 serial 8
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_LOCALENAME],
 [
+  AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+  AC_REQUIRE([gl_LOCALE_T])
   AC_REQUIRE([gt_LC_MESSAGES])
+  AC_REQUIRE([gt_INTL_THREAD_LOCALE_NAME])
   AC_REQUIRE([gt_INTL_MACOSX])
-  AC_CHECK_FUNCS([setlocale uselocale])
-  dnl Solaris 12 provides getlocalename_l, while Illumos doesn't have
-  dnl it nor the equivalent.
-  if test $ac_cv_func_uselocale = yes; then
-    AC_CHECK_FUNCS([getlocalename_l])
+  AC_CHECK_HEADERS_ONCE([langinfo.h])
+  if test $HAVE_LOCALE_T = 1; then
+    AC_CHECK_FUNCS_ONCE([newlocale duplocale freelocale])
+    gl_func_newlocale="$ac_cv_func_newlocale"
+    gl_func_duplocale="$ac_cv_func_duplocale"
+    gl_func_freelocale="$ac_cv_func_freelocale"
+  else
+    dnl In 2019, some versions of z/OS lack the locale_t type and have broken
+    dnl newlocale, duplocale, freelocale functions.
+    gl_func_newlocale=no
+    gl_func_duplocale=no
+    gl_func_freelocale=no
+  fi
+  if test $gl_func_newlocale != yes; then
+    HAVE_NEWLOCALE=0
+  fi
+  if test $gl_func_duplocale != yes; then
+    HAVE_DUPLOCALE=0
+  fi
+  if test $gl_func_freelocale != yes; then
+    HAVE_FREELOCALE=0
+  fi
+  if test $gt_localename_enhances_locale_funcs = yes; then
+    REPLACE_NEWLOCALE=1
+    REPLACE_DUPLOCALE=1
+    REPLACE_FREELOCALE=1
   fi
 ])
index 1e83e23..d68c12d 100644 (file)
@@ -1,5 +1,5 @@
-# lock.m4 serial 13 (gettext-0.18.2)
-dnl Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# lock.m4 serial 14
+dnl Copyright (C) 2005-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -12,11 +12,16 @@ AC_DEFUN([gl_LOCK],
   if test "$gl_threads_api" = posix; then
     # OSF/1 4.0 and Mac OS X 10.1 lack the pthread_rwlock_t type and the
     # pthread_rwlock_* functions.
+    has_rwlock=false
     AC_CHECK_TYPE([pthread_rwlock_t],
-      [AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
+      [has_rwlock=true
+       AC_DEFINE([HAVE_PTHREAD_RWLOCK], [1],
          [Define if the POSIX multithreading library has read/write locks.])],
       [],
       [#include <pthread.h>])
+    if $has_rwlock; then
+      gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER
+    fi
     # glibc defines PTHREAD_MUTEX_RECURSIVE as enum, not as a macro.
     AC_COMPILE_IFELSE([
       AC_LANG_PROGRAM(
index 36d8b12..eefb37c 100644 (file)
@@ -1,5 +1,5 @@
 # longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 4a95440..0af6378 100644 (file)
@@ -1,5 +1,5 @@
-# lseek.m4 serial 10
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# lseek.m4 serial 11
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -32,7 +32,8 @@ AC_DEFUN([gl_FUNC_LSEEK],
 #else /* on Windows with MSVC */
 # include <io.h>
 #endif
-]], [[
+]GL_MDA_DEFINES],
+[[
   /* Exit with success only if stdin is seekable.  */
   return lseek (0, (off_t)0, SEEK_CUR) < 0;
 ]])],
index e143d5c..62e9db2 100644 (file)
@@ -1,6 +1,6 @@
-# serial 27
+# serial 33
 
-# Copyright (C) 1997-2001, 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 1997-2001, 2003-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -10,14 +10,15 @@ dnl From Jim Meyering.
 
 AC_DEFUN([gl_FUNC_LSTAT],
 [
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
   dnl If lstat does not exist, the replacement <sys/stat.h> does
   dnl "#define lstat stat", and lstat.c is a no-op.
   AC_CHECK_FUNCS_ONCE([lstat])
   if test $ac_cv_func_lstat = yes; then
     AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
-    case "$gl_cv_func_lstat_dereferences_slashed_symlink" in
-      *no)
+    case $host_os,$gl_cv_func_lstat_dereferences_slashed_symlink in
+      solaris* | *no)
         REPLACE_LSTAT=1
         ;;
     esac
@@ -33,6 +34,7 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
 [
   dnl We don't use AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK any more, because it
   dnl is no longer maintained in Autoconf and because it invokes AC_LIBOBJ.
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether lstat correctly handles trailing slash],
     [gl_cv_func_lstat_dereferences_slashed_symlink],
     [rm -f conftest.sym conftest.file
@@ -51,12 +53,18 @@ AC_DEFUN([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
        [gl_cv_func_lstat_dereferences_slashed_symlink=yes],
        [gl_cv_func_lstat_dereferences_slashed_symlink=no],
        [case "$host_os" in
-          *-gnu*)
+          linux-* | linux)
+            # Guess yes on Linux systems.
+            gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
+          *-gnu* | gnu*)
             # Guess yes on glibc systems.
             gl_cv_func_lstat_dereferences_slashed_symlink="guessing yes" ;;
-          *)
-            # If we don't know, assume the worst.
+          mingw*)
+            # Guess no on native Windows.
             gl_cv_func_lstat_dereferences_slashed_symlink="guessing no" ;;
+          *)
+            # If we don't know, obey --enable-cross-guesses.
+            gl_cv_func_lstat_dereferences_slashed_symlink="$gl_cross_guess_normal" ;;
         esac
        ])
      rm -f conftest.sym conftest.file
index c393690..972e808 100644 (file)
@@ -1,29 +1,21 @@
-# malloc.m4 serial 15
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# malloc.m4 serial 27
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-m4_version_prereq([2.70], [] ,[
-
 # This is adapted with modifications from upstream Autoconf here:
-# http://git.savannah.gnu.org/cgit/autoconf.git/commit/?id=04be2b7a29d65d9a08e64e8e56e594c91749598c
+# https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/functions.m4?id=v2.70#n949
 AC_DEFUN([_AC_FUNC_MALLOC_IF],
 [
-  AC_REQUIRE([AC_HEADER_STDC])dnl
   AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
-  AC_CHECK_HEADERS([stdlib.h])
-  AC_CACHE_CHECK([for GNU libc compatible malloc],
+  AC_CACHE_CHECK([whether malloc (0) returns nonnull],
     [ac_cv_func_malloc_0_nonnull],
     [AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
-          [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
-            # include <stdlib.h>
-            #else
-            char *malloc ();
-            #endif
+          [[#include <stdlib.h>
           ]],
-          [[char *p = malloc (0);
+          [[void *p = malloc (0);
             int result = !p;
             free (p);
             return result;]])
@@ -32,70 +24,151 @@ AC_DEFUN([_AC_FUNC_MALLOC_IF],
        [ac_cv_func_malloc_0_nonnull=no],
        [case "$host_os" in
           # Guess yes on platforms where we know the result.
-          *-gnu* | freebsd* | netbsd* | openbsd* \
-          | hpux* | solaris* | cygwin* | mingw*)
-            ac_cv_func_malloc_0_nonnull=yes ;;
-          # If we don't know, assume the worst.
-          *) ac_cv_func_malloc_0_nonnull=no ;;
+          *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+          | gnu* | *-musl* | midnightbsd* \
+          | hpux* | solaris* | cygwin* | mingw* | msys* )
+            ac_cv_func_malloc_0_nonnull="guessing yes" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *) ac_cv_func_malloc_0_nonnull="$gl_cross_guess_normal" ;;
         esac
        ])
     ])
-  AS_IF([test $ac_cv_func_malloc_0_nonnull = yes], [$1], [$2])
+  AS_CASE([$ac_cv_func_malloc_0_nonnull], [*yes], [$1], [$2])
 ])# _AC_FUNC_MALLOC_IF
 
-])
-
 # gl_FUNC_MALLOC_GNU
 # ------------------
-# Test whether 'malloc (0)' is handled like in GNU libc, and replace malloc if
-# it is not.
+# Replace malloc if it is not compatible with GNU libc.
 AC_DEFUN([gl_FUNC_MALLOC_GNU],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
-  dnl _AC_FUNC_MALLOC_IF is defined in Autoconf.
-  _AC_FUNC_MALLOC_IF(
-    [AC_DEFINE([HAVE_MALLOC_GNU], [1],
-               [Define to 1 if your system has a GNU libc compatible 'malloc'
-                function, and to 0 otherwise.])],
-    [AC_DEFINE([HAVE_MALLOC_GNU], [0])
-     REPLACE_MALLOC=1
+  AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+  if test $REPLACE_MALLOC = 0; then
+    _AC_FUNC_MALLOC_IF([], [REPLACE_MALLOC=1])
+  fi
+])
+
+# gl_FUNC_MALLOC_PTRDIFF
+# ----------------------
+# Test whether malloc (N) reliably fails when N exceeds PTRDIFF_MAX,
+# and replace malloc otherwise.
+AC_DEFUN([gl_FUNC_MALLOC_PTRDIFF],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF])
+  test "$gl_cv_malloc_ptrdiff" = yes || REPLACE_MALLOC=1
+])
+
+# Test whether malloc, realloc, calloc refuse to create objects
+# larger than what can be expressed in ptrdiff_t.
+# Set gl_cv_func_malloc_gnu to yes or no accordingly.
+AC_DEFUN([gl_CHECK_MALLOC_PTRDIFF],
+[
+  AC_CACHE_CHECK([whether malloc is ptrdiff_t safe],
+    [gl_cv_malloc_ptrdiff],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stdint.h>
+          ]],
+          [[/* 64-bit ptrdiff_t is so wide that no practical platform
+               can exceed it.  */
+            #define WIDE_PTRDIFF (PTRDIFF_MAX >> 31 >> 31 != 0)
+
+            /* On rare machines where size_t fits in ptrdiff_t there
+               is no problem.  */
+            #define NARROW_SIZE (SIZE_MAX <= PTRDIFF_MAX)
+
+            /* glibc 2.30 and later malloc refuses to exceed ptrdiff_t
+               bounds even on 32-bit platforms.  We don't know which
+               non-glibc systems are safe.  */
+            #define KNOWN_SAFE (2 < __GLIBC__ + (30 <= __GLIBC_MINOR__))
+
+            #if WIDE_PTRDIFF || NARROW_SIZE || KNOWN_SAFE
+              return 0;
+            #else
+              #error "malloc might not be ptrdiff_t safe"
+              syntax error
+            #endif
+          ]])],
+       [gl_cv_malloc_ptrdiff=yes],
+       [gl_cv_malloc_ptrdiff=no])
     ])
 ])
 
 # gl_FUNC_MALLOC_POSIX
 # --------------------
 # Test whether 'malloc' is POSIX compliant (sets errno to ENOMEM when it
-# fails), and replace malloc if it is not.
+# fails, and doesn't mess up with ptrdiff_t overflow), and replace
+# malloc if it is not.
 AC_DEFUN([gl_FUNC_MALLOC_POSIX],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_MALLOC_PTRDIFF])
   AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
-  if test $gl_cv_func_malloc_posix = yes; then
+  if test "$gl_cv_func_malloc_posix" = yes; then
     AC_DEFINE([HAVE_MALLOC_POSIX], [1],
-      [Define if the 'malloc' function is POSIX compliant.])
+      [Define if malloc, realloc, and calloc set errno on allocation failure.])
   else
     REPLACE_MALLOC=1
   fi
 ])
 
-# Test whether malloc, realloc, calloc are POSIX compliant,
+# Test whether malloc, realloc, calloc set errno to ENOMEM on failure.
 # Set gl_cv_func_malloc_posix to yes or no accordingly.
 AC_DEFUN([gl_CHECK_MALLOC_POSIX],
 [
-  AC_CACHE_CHECK([whether malloc, realloc, calloc are POSIX compliant],
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([whether malloc, realloc, calloc set errno on failure],
     [gl_cv_func_malloc_posix],
     [
       dnl It is too dangerous to try to allocate a large amount of memory:
       dnl some systems go to their knees when you do that. So assume that
-      dnl all Unix implementations of the function are POSIX compliant.
-      AC_COMPILE_IFELSE(
-        [AC_LANG_PROGRAM(
-           [[]],
-           [[#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-             choke me
-             #endif
-            ]])],
-        [gl_cv_func_malloc_posix=yes],
-        [gl_cv_func_malloc_posix=no])
+      dnl all Unix implementations of the function set errno on failure,
+      dnl except on those platforms where we have seen 'test-malloc-gnu',
+      dnl 'test-realloc-gnu', 'test-calloc-gnu' fail.
+      case "$host_os" in
+        mingw*)
+          gl_cv_func_malloc_posix=no ;;
+        irix* | solaris*)
+          dnl On IRIX 6.5, the three functions return NULL with errno unset
+          dnl when the argument is larger than PTRDIFF_MAX.
+          dnl On Solaris 11.3, the three functions return NULL with errno set
+          dnl to EAGAIN, not ENOMEM, when the argument is larger than
+          dnl PTRDIFF_MAX.
+          dnl Here is a test program:
+m4_divert_push([KILL])
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#define ptrdiff_t long
+#ifndef PTRDIFF_MAX
+# define PTRDIFF_MAX ((ptrdiff_t) ((1UL << (8 * sizeof (ptrdiff_t) - 1)) - 1))
+#endif
+
+int main ()
+{
+  void *p;
+
+  fprintf (stderr, "PTRDIFF_MAX = %lu\n", (unsigned long) PTRDIFF_MAX);
+
+  errno = 0;
+  p = malloc ((unsigned long) PTRDIFF_MAX + 1);
+  fprintf (stderr, "p=%p errno=%d\n", p, errno);
+
+  errno = 0;
+  p = calloc (PTRDIFF_MAX / 2 + 1, 2);
+  fprintf (stderr, "p=%p errno=%d\n", p, errno);
+
+  errno = 0;
+  p = realloc (NULL, (unsigned long) PTRDIFF_MAX + 1);
+  fprintf (stderr, "p=%p errno=%d\n", p, errno);
+
+  return 0;
+}
+m4_divert_pop([KILL])
+          gl_cv_func_malloc_posix=no ;;
+        *)
+          gl_cv_func_malloc_posix=yes ;;
+      esac
     ])
 ])
index b368b20..06ed2c6 100644 (file)
@@ -1,5 +1,5 @@
-# malloca.m4 serial 1
-dnl Copyright (C) 2003-2004, 2006-2007, 2009-2016 Free Software Foundation,
+# malloca.m4 serial 2
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,5 +11,4 @@ AC_DEFUN([gl_MALLOCA],
   dnl @ALLOCA@ and @LTALLOCA@.
   dnl gl_FUNC_ALLOCA   dnl Already brought in by the module dependencies.
   AC_REQUIRE([gl_EEMALLOC])
-  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
 ])
index 4f701f4..53ab153 100644 (file)
@@ -1,5 +1,5 @@
-# manywarnings.m4 serial 8
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# manywarnings.m4 serial 21
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -21,7 +21,7 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT],
       *" $gl_warn_item "*)
         ;;
       *)
-        gl_warn_set="$gl_warn_set $gl_warn_item"
+        gl_AS_VAR_APPEND([gl_warn_set], [" $gl_warn_item"])
         ;;
     esac
   done
@@ -33,63 +33,70 @@ AC_DEFUN([gl_MANYWARN_COMPLEMENT],
 # Add all documented GCC warning parameters to variable VARIABLE.
 # Note that you need to test them using gl_WARN_ADD if you want to
 # make sure your gcc understands it.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
 AC_DEFUN([gl_MANYWARN_ALL_GCC],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# Specialization for _AC_LANG = C.
+AC_DEFUN([gl_MANYWARN_ALL_GCC(C)],
 [
+  AC_LANG_PUSH([C])
+
   dnl First, check for some issues that only occur when combining multiple
   dnl gcc warning categories.
   AC_REQUIRE([AC_PROG_CC])
   if test -n "$GCC"; then
 
-    dnl Check if -W -Werror -Wno-missing-field-initializers is supported
+    dnl Check if -Wextra -Werror -Wno-missing-field-initializers is supported
     dnl with the current $CC $CFLAGS $CPPFLAGS.
-    AC_MSG_CHECKING([whether -Wno-missing-field-initializers is supported])
-    AC_CACHE_VAL([gl_cv_cc_nomfi_supported], [
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -W -Werror -Wno-missing-field-initializers"
-      AC_COMPILE_IFELSE(
-        [AC_LANG_PROGRAM([[]], [[]])],
-        [gl_cv_cc_nomfi_supported=yes],
-        [gl_cv_cc_nomfi_supported=no])
-      CFLAGS="$gl_save_CFLAGS"])
-    AC_MSG_RESULT([$gl_cv_cc_nomfi_supported])
+    AC_CACHE_CHECK([whether -Wno-missing-field-initializers is supported],
+      [gl_cv_cc_nomfi_supported],
+      [gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Wextra -Werror -Wno-missing-field-initializers"
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[]], [[]])],
+         [gl_cv_cc_nomfi_supported=yes],
+         [gl_cv_cc_nomfi_supported=no])
+       CFLAGS="$gl_save_CFLAGS"
+      ])
 
     if test "$gl_cv_cc_nomfi_supported" = yes; then
       dnl Now check whether -Wno-missing-field-initializers is needed
       dnl for the { 0, } construct.
-      AC_MSG_CHECKING([whether -Wno-missing-field-initializers is needed])
-      AC_CACHE_VAL([gl_cv_cc_nomfi_needed], [
-        gl_save_CFLAGS="$CFLAGS"
-        CFLAGS="$CFLAGS -W -Werror"
-        AC_COMPILE_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[int f (void)
-               {
-                 typedef struct { int a; int b; } s_t;
-                 s_t s1 = { 0, };
-                 return s1.b;
-               }
-             ]],
-             [[]])],
-          [gl_cv_cc_nomfi_needed=no],
-          [gl_cv_cc_nomfi_needed=yes])
-        CFLAGS="$gl_save_CFLAGS"
-      ])
-      AC_MSG_RESULT([$gl_cv_cc_nomfi_needed])
+      AC_CACHE_CHECK([whether -Wno-missing-field-initializers is needed],
+        [gl_cv_cc_nomfi_needed],
+        [gl_save_CFLAGS="$CFLAGS"
+         CFLAGS="$CFLAGS -Wextra -Werror"
+         AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[int f (void)
+                {
+                  typedef struct { int a; int b; } s_t;
+                  s_t s1 = { 0, };
+                  return s1.b;
+                }
+              ]],
+              [[]])],
+           [gl_cv_cc_nomfi_needed=no],
+           [gl_cv_cc_nomfi_needed=yes])
+         CFLAGS="$gl_save_CFLAGS"
+        ])
     fi
 
     dnl Next, check if -Werror -Wuninitialized is useful with the
     dnl user's choice of $CFLAGS; some versions of gcc warn that it
     dnl has no effect if -O is not also used
-    AC_MSG_CHECKING([whether -Wuninitialized is supported])
-    AC_CACHE_VAL([gl_cv_cc_uninitialized_supported], [
-      gl_save_CFLAGS="$CFLAGS"
-      CFLAGS="$CFLAGS -Werror -Wuninitialized"
-      AC_COMPILE_IFELSE(
-        [AC_LANG_PROGRAM([[]], [[]])],
-        [gl_cv_cc_uninitialized_supported=yes],
-        [gl_cv_cc_uninitialized_supported=no])
-      CFLAGS="$gl_save_CFLAGS"])
-    AC_MSG_RESULT([$gl_cv_cc_uninitialized_supported])
+    AC_CACHE_CHECK([whether -Wuninitialized is supported],
+      [gl_cv_cc_uninitialized_supported],
+      [gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Werror -Wuninitialized"
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[]], [[]])],
+         [gl_cv_cc_uninitialized_supported=yes],
+         [gl_cv_cc_uninitialized_supported=no])
+       CFLAGS="$gl_save_CFLAGS"
+      ])
 
   fi
 
@@ -97,180 +104,112 @@ AC_DEFUN([gl_MANYWARN_ALL_GCC],
   # To compare this list to your installed GCC's, run this Bash command:
   #
   # comm -3 \
-  #  <(sed -n 's/^  *\(-[^ ]*\) .*/\1/p' manywarnings.m4 | sort) \
-  #  <(gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort |
-  #      grep -v -x -f <(
-  #         awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec))
+  #  <((sed -n 's/^  *\(-[^ 0-9][^ ]*\).*/\1/p' manywarnings.m4; \
+  #     awk '/^[^#]/ {print $1}' ../build-aux/gcc-warning.spec) | sort) \
+  #  <(LC_ALL=C gcc --help=warnings | sed -n 's/^  \(-[^ ]*\) .*/\1/p' | sort)
 
-  gl_manywarn_set=
-  for gl_manywarn_item in \
-    -fno-common \
-    -W \
-    -Wabi \
-    -Waddress \
-    -Waggressive-loop-optimizations \
+  $1=
+  for gl_manywarn_item in -fanalyzer -fno-common \
     -Wall \
-    -Wattributes \
+    -Warith-conversion \
     -Wbad-function-cast \
-    -Wbool-compare \
-    -Wbuiltin-macro-redefined \
-    -Wcast-align \
-    -Wchar-subscripts \
-    -Wchkp \
-    -Wclobbered \
-    -Wcomment \
-    -Wcomments \
-    -Wcoverage-mismatch \
-    -Wcpp \
+    -Wcast-align=strict \
     -Wdate-time \
-    -Wdeprecated \
-    -Wdeprecated-declarations \
-    -Wdesignated-init \
     -Wdisabled-optimization \
-    -Wdiscarded-array-qualifiers \
-    -Wdiscarded-qualifiers \
-    -Wdiv-by-zero \
     -Wdouble-promotion \
+    -Wduplicated-branches \
     -Wduplicated-cond \
-    -Wempty-body \
-    -Wendif-labels \
-    -Wenum-compare \
     -Wextra \
-    -Wformat-contains-nul \
-    -Wformat-extra-args \
-    -Wformat-nonliteral \
-    -Wformat-security \
     -Wformat-signedness \
-    -Wformat-y2k \
-    -Wformat-zero-length \
-    -Wframe-address \
-    -Wfree-nonheap-object \
-    -Whsa \
-    -Wignored-attributes \
-    -Wignored-qualifiers \
-    -Wimplicit \
-    -Wimplicit-function-declaration \
-    -Wimplicit-int \
-    -Wincompatible-pointer-types \
     -Winit-self \
     -Winline \
-    -Wint-conversion \
-    -Wint-to-pointer-cast \
-    -Winvalid-memory-model \
     -Winvalid-pch \
-    -Wjump-misses-init \
-    -Wlogical-not-parentheses \
     -Wlogical-op \
-    -Wmain \
-    -Wmaybe-uninitialized \
-    -Wmemset-transposed-args \
-    -Wmisleading-indentation \
-    -Wmissing-braces \
     -Wmissing-declarations \
-    -Wmissing-field-initializers \
     -Wmissing-include-dirs \
-    -Wmissing-parameter-type \
     -Wmissing-prototypes \
-    -Wmultichar \
-    -Wnarrowing \
     -Wnested-externs \
-    -Wnonnull \
-    -Wnonnull-compare \
     -Wnull-dereference \
-    -Wodr \
-    -Wold-style-declaration \
     -Wold-style-definition \
     -Wopenmp-simd \
-    -Woverflow \
     -Woverlength-strings \
-    -Woverride-init \
     -Wpacked \
-    -Wpacked-bitfield-compat \
-    -Wparentheses \
     -Wpointer-arith \
-    -Wpointer-sign \
-    -Wpointer-to-int-cast \
-    -Wpragmas \
-    -Wreturn-local-addr \
-    -Wreturn-type \
-    -Wscalar-storage-order \
-    -Wsequence-point \
     -Wshadow \
-    -Wshift-count-negative \
-    -Wshift-count-overflow \
-    -Wshift-negative-value \
-    -Wsizeof-array-argument \
-    -Wsizeof-pointer-memaccess \
     -Wstack-protector \
-    -Wstrict-aliasing \
     -Wstrict-overflow \
     -Wstrict-prototypes \
+    -Wsuggest-attribute=cold \
     -Wsuggest-attribute=const \
     -Wsuggest-attribute=format \
+    -Wsuggest-attribute=malloc \
     -Wsuggest-attribute=noreturn \
     -Wsuggest-attribute=pure \
     -Wsuggest-final-methods \
     -Wsuggest-final-types \
-    -Wswitch \
-    -Wswitch-bool \
-    -Wswitch-default \
     -Wsync-nand \
     -Wsystem-headers \
-    -Wtautological-compare \
     -Wtrampolines \
-    -Wtrigraphs \
-    -Wtype-limits \
     -Wuninitialized \
     -Wunknown-pragmas \
     -Wunsafe-loop-optimizations \
-    -Wunused \
-    -Wunused-but-set-parameter \
-    -Wunused-but-set-variable \
-    -Wunused-function \
-    -Wunused-label \
-    -Wunused-local-typedefs \
     -Wunused-macros \
-    -Wunused-parameter \
-    -Wunused-result \
-    -Wunused-value \
-    -Wunused-variable \
-    -Wvarargs \
     -Wvariadic-macros \
     -Wvector-operation-performance \
     -Wvla \
-    -Wvolatile-register-var \
     -Wwrite-strings \
     \
     ; do
-    gl_manywarn_set="$gl_manywarn_set $gl_manywarn_item"
+    gl_AS_VAR_APPEND([$1], [" $gl_manywarn_item"])
   done
 
   # gcc --help=warnings outputs an unusual form for these options; list
   # them here so that the above 'comm' command doesn't report a false match.
-  gl_manywarn_set="$gl_manywarn_set -Warray-bounds=2"
-  gl_manywarn_set="$gl_manywarn_set -Wnormalized=nfc"
-  gl_manywarn_set="$gl_manywarn_set -Wshift-overflow=2"
-  gl_manywarn_set="$gl_manywarn_set -Wunused-const-variable=2"
+  gl_AS_VAR_APPEND([$1], [' -Warray-bounds=2'])
+  gl_AS_VAR_APPEND([$1], [' -Wattribute-alias=2'])
+  gl_AS_VAR_APPEND([$1], [' -Wformat-overflow=2'])
+  gl_AS_VAR_APPEND([$1], [' -Wformat=2'])
+  gl_AS_VAR_APPEND([$1], [' -Wformat-truncation=2'])
+  gl_AS_VAR_APPEND([$1], [' -Wimplicit-fallthrough=5'])
+  gl_AS_VAR_APPEND([$1], [' -Wshift-overflow=2'])
+  gl_AS_VAR_APPEND([$1], [' -Wunused-const-variable=2'])
+  gl_AS_VAR_APPEND([$1], [' -Wvla-larger-than=4031'])
 
   # These are needed for older GCC versions.
   if test -n "$GCC"; then
     case `($CC --version) 2>/dev/null` in
       'gcc (GCC) '[[0-3]].* | \
       'gcc (GCC) '4.[[0-7]].*)
-        gl_manywarn_set="$gl_manywarn_set -fdiagnostics-show-option"
-        gl_manywarn_set="$gl_manywarn_set -funit-at-a-time"
+        gl_AS_VAR_APPEND([$1], [' -fdiagnostics-show-option'])
+        gl_AS_VAR_APPEND([$1], [' -funit-at-a-time'])
           ;;
     esac
   fi
 
   # Disable specific options as needed.
   if test "$gl_cv_cc_nomfi_needed" = yes; then
-    gl_manywarn_set="$gl_manywarn_set -Wno-missing-field-initializers"
+    gl_AS_VAR_APPEND([$1], [' -Wno-missing-field-initializers'])
   fi
 
   if test "$gl_cv_cc_uninitialized_supported" = no; then
-    gl_manywarn_set="$gl_manywarn_set -Wno-uninitialized"
+    gl_AS_VAR_APPEND([$1], [' -Wno-uninitialized'])
   fi
 
-  $1=$gl_manywarn_set
+  # Some warnings have too many false alarms in GCC 10.1.
+  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93695
+  gl_AS_VAR_APPEND([$1], [' -Wno-analyzer-double-free'])
+  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94458
+  gl_AS_VAR_APPEND([$1], [' -Wno-analyzer-malloc-leak'])
+  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94851
+  gl_AS_VAR_APPEND([$1], [' -Wno-analyzer-null-dereference'])
+  # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95758
+  gl_AS_VAR_APPEND([$1], [' -Wno-analyzer-use-after-free'])
+
+  AC_LANG_POP([C])
+])
+
+# Specialization for _AC_LANG = C++.
+AC_DEFUN([gl_MANYWARN_ALL_GCC(C++)],
+[
+  gl_MANYWARN_ALL_GCC_CXX_IMPL([$1])
 ])
index d427b9b..b3a10c3 100644 (file)
@@ -1,16 +1,16 @@
-# math_h.m4 serial 115
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# math_h.m4 serial 125
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_MATH_H],
+AC_DEFUN_ONCE([gl_MATH_H],
 [
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
   gl_CHECK_NEXT_HEADERS([math.h])
 
   AC_CACHE_CHECK([whether NAN macro works], [gl_cv_header_math_nan_works],
-    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]],
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
       [[/* Solaris 10 has a broken definition of NAN.  Other platforms
         fail to provide NAN, or provide it only in C99 mode; this
         test only needs to fail when NAN is provided but wrong.  */
@@ -25,7 +25,7 @@ AC_DEFUN([gl_MATH_H],
     REPLACE_NAN=1
   fi
   AC_CACHE_CHECK([whether HUGE_VAL works], [gl_cv_header_math_huge_val_works],
-    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[@%:@include <math.h>]],
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <math.h>]],
       [[/* Solaris 10 has a broken definition of HUGE_VAL.  */
          double d = HUGE_VAL;
          return d == 0;]])],
@@ -53,284 +53,310 @@ AC_DEFUN([gl_MATH_H],
      tanf tanl tanhf trunc truncf truncl])
 ])
 
+# gl_MATH_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_MATH_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_MATH_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_MATH_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_MATH_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACOSL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ASINL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATANL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATAN2F])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CBRTL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEIL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CEILL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPYSIGNL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COSHF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2F])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXP2L])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1F])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPM1L])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FABSL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOOR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FLOORL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMA])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMAL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMOD])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FMODL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREXPL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_HYPOTL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGB])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ILOGBL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISFINITE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISINF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNAND])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISNANL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LDEXPL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10F])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG10L])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1P])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG1PL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2F])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOG2L])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGB])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOGBL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MODFL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POWF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDER])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMAINDERL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RINTL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUND])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ROUNDL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNBIT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SINHF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SQRTL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TANHF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCL])
+    dnl Support Microsoft deprecated alias function names by default.
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J0], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_J1], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_JN], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y0], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_Y1], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_YN], [1])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_MATH_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_MATH_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_MATH_H_DEFAULTS],
 [
-  GNULIB_ACOSF=0;      AC_SUBST([GNULIB_ACOSF])
-  GNULIB_ACOSL=0;      AC_SUBST([GNULIB_ACOSL])
-  GNULIB_ASINF=0;      AC_SUBST([GNULIB_ASINF])
-  GNULIB_ASINL=0;      AC_SUBST([GNULIB_ASINL])
-  GNULIB_ATANF=0;      AC_SUBST([GNULIB_ATANF])
-  GNULIB_ATANL=0;      AC_SUBST([GNULIB_ATANL])
-  GNULIB_ATAN2F=0;     AC_SUBST([GNULIB_ATAN2F])
-  GNULIB_CBRT=0;       AC_SUBST([GNULIB_CBRT])
-  GNULIB_CBRTF=0;      AC_SUBST([GNULIB_CBRTF])
-  GNULIB_CBRTL=0;      AC_SUBST([GNULIB_CBRTL])
-  GNULIB_CEIL=0;       AC_SUBST([GNULIB_CEIL])
-  GNULIB_CEILF=0;      AC_SUBST([GNULIB_CEILF])
-  GNULIB_CEILL=0;      AC_SUBST([GNULIB_CEILL])
-  GNULIB_COPYSIGN=0;   AC_SUBST([GNULIB_COPYSIGN])
-  GNULIB_COPYSIGNF=0;  AC_SUBST([GNULIB_COPYSIGNF])
-  GNULIB_COPYSIGNL=0;  AC_SUBST([GNULIB_COPYSIGNL])
-  GNULIB_COSF=0;       AC_SUBST([GNULIB_COSF])
-  GNULIB_COSL=0;       AC_SUBST([GNULIB_COSL])
-  GNULIB_COSHF=0;      AC_SUBST([GNULIB_COSHF])
-  GNULIB_EXPF=0;       AC_SUBST([GNULIB_EXPF])
-  GNULIB_EXPL=0;       AC_SUBST([GNULIB_EXPL])
-  GNULIB_EXP2=0;       AC_SUBST([GNULIB_EXP2])
-  GNULIB_EXP2F=0;      AC_SUBST([GNULIB_EXP2F])
-  GNULIB_EXP2L=0;      AC_SUBST([GNULIB_EXP2L])
-  GNULIB_EXPM1=0;      AC_SUBST([GNULIB_EXPM1])
-  GNULIB_EXPM1F=0;     AC_SUBST([GNULIB_EXPM1F])
-  GNULIB_EXPM1L=0;     AC_SUBST([GNULIB_EXPM1L])
-  GNULIB_FABSF=0;      AC_SUBST([GNULIB_FABSF])
-  GNULIB_FABSL=0;      AC_SUBST([GNULIB_FABSL])
-  GNULIB_FLOOR=0;      AC_SUBST([GNULIB_FLOOR])
-  GNULIB_FLOORF=0;     AC_SUBST([GNULIB_FLOORF])
-  GNULIB_FLOORL=0;     AC_SUBST([GNULIB_FLOORL])
-  GNULIB_FMA=0;        AC_SUBST([GNULIB_FMA])
-  GNULIB_FMAF=0;       AC_SUBST([GNULIB_FMAF])
-  GNULIB_FMAL=0;       AC_SUBST([GNULIB_FMAL])
-  GNULIB_FMOD=0;       AC_SUBST([GNULIB_FMOD])
-  GNULIB_FMODF=0;      AC_SUBST([GNULIB_FMODF])
-  GNULIB_FMODL=0;      AC_SUBST([GNULIB_FMODL])
-  GNULIB_FREXPF=0;     AC_SUBST([GNULIB_FREXPF])
-  GNULIB_FREXP=0;      AC_SUBST([GNULIB_FREXP])
-  GNULIB_FREXPL=0;     AC_SUBST([GNULIB_FREXPL])
-  GNULIB_HYPOT=0;      AC_SUBST([GNULIB_HYPOT])
-  GNULIB_HYPOTF=0;     AC_SUBST([GNULIB_HYPOTF])
-  GNULIB_HYPOTL=0;     AC_SUBST([GNULIB_HYPOTL])
-  GNULIB_ILOGB=0;      AC_SUBST([GNULIB_ILOGB])
-  GNULIB_ILOGBF=0;     AC_SUBST([GNULIB_ILOGBF])
-  GNULIB_ILOGBL=0;     AC_SUBST([GNULIB_ILOGBL])
-  GNULIB_ISFINITE=0;   AC_SUBST([GNULIB_ISFINITE])
-  GNULIB_ISINF=0;      AC_SUBST([GNULIB_ISINF])
-  GNULIB_ISNAN=0;      AC_SUBST([GNULIB_ISNAN])
-  GNULIB_ISNANF=0;     AC_SUBST([GNULIB_ISNANF])
-  GNULIB_ISNAND=0;     AC_SUBST([GNULIB_ISNAND])
-  GNULIB_ISNANL=0;     AC_SUBST([GNULIB_ISNANL])
-  GNULIB_LDEXPF=0;     AC_SUBST([GNULIB_LDEXPF])
-  GNULIB_LDEXPL=0;     AC_SUBST([GNULIB_LDEXPL])
-  GNULIB_LOG=0;        AC_SUBST([GNULIB_LOG])
-  GNULIB_LOGF=0;       AC_SUBST([GNULIB_LOGF])
-  GNULIB_LOGL=0;       AC_SUBST([GNULIB_LOGL])
-  GNULIB_LOG10=0;      AC_SUBST([GNULIB_LOG10])
-  GNULIB_LOG10F=0;     AC_SUBST([GNULIB_LOG10F])
-  GNULIB_LOG10L=0;     AC_SUBST([GNULIB_LOG10L])
-  GNULIB_LOG1P=0;      AC_SUBST([GNULIB_LOG1P])
-  GNULIB_LOG1PF=0;     AC_SUBST([GNULIB_LOG1PF])
-  GNULIB_LOG1PL=0;     AC_SUBST([GNULIB_LOG1PL])
-  GNULIB_LOG2=0;       AC_SUBST([GNULIB_LOG2])
-  GNULIB_LOG2F=0;      AC_SUBST([GNULIB_LOG2F])
-  GNULIB_LOG2L=0;      AC_SUBST([GNULIB_LOG2L])
-  GNULIB_LOGB=0;       AC_SUBST([GNULIB_LOGB])
-  GNULIB_LOGBF=0;      AC_SUBST([GNULIB_LOGBF])
-  GNULIB_LOGBL=0;      AC_SUBST([GNULIB_LOGBL])
-  GNULIB_MODF=0;       AC_SUBST([GNULIB_MODF])
-  GNULIB_MODFF=0;      AC_SUBST([GNULIB_MODFF])
-  GNULIB_MODFL=0;      AC_SUBST([GNULIB_MODFL])
-  GNULIB_POWF=0;       AC_SUBST([GNULIB_POWF])
-  GNULIB_REMAINDER=0;  AC_SUBST([GNULIB_REMAINDER])
-  GNULIB_REMAINDERF=0; AC_SUBST([GNULIB_REMAINDERF])
-  GNULIB_REMAINDERL=0; AC_SUBST([GNULIB_REMAINDERL])
-  GNULIB_RINT=0;       AC_SUBST([GNULIB_RINT])
-  GNULIB_RINTF=0;      AC_SUBST([GNULIB_RINTF])
-  GNULIB_RINTL=0;      AC_SUBST([GNULIB_RINTL])
-  GNULIB_ROUND=0;      AC_SUBST([GNULIB_ROUND])
-  GNULIB_ROUNDF=0;     AC_SUBST([GNULIB_ROUNDF])
-  GNULIB_ROUNDL=0;     AC_SUBST([GNULIB_ROUNDL])
-  GNULIB_SIGNBIT=0;    AC_SUBST([GNULIB_SIGNBIT])
-  GNULIB_SINF=0;       AC_SUBST([GNULIB_SINF])
-  GNULIB_SINL=0;       AC_SUBST([GNULIB_SINL])
-  GNULIB_SINHF=0;      AC_SUBST([GNULIB_SINHF])
-  GNULIB_SQRTF=0;      AC_SUBST([GNULIB_SQRTF])
-  GNULIB_SQRTL=0;      AC_SUBST([GNULIB_SQRTL])
-  GNULIB_TANF=0;       AC_SUBST([GNULIB_TANF])
-  GNULIB_TANL=0;       AC_SUBST([GNULIB_TANL])
-  GNULIB_TANHF=0;      AC_SUBST([GNULIB_TANHF])
-  GNULIB_TRUNC=0;      AC_SUBST([GNULIB_TRUNC])
-  GNULIB_TRUNCF=0;     AC_SUBST([GNULIB_TRUNCF])
-  GNULIB_TRUNCL=0;     AC_SUBST([GNULIB_TRUNCL])
   dnl Assume proper GNU behavior unless another module says otherwise.
-  HAVE_ACOSF=1;                AC_SUBST([HAVE_ACOSF])
-  HAVE_ACOSL=1;                AC_SUBST([HAVE_ACOSL])
-  HAVE_ASINF=1;                AC_SUBST([HAVE_ASINF])
-  HAVE_ASINL=1;                AC_SUBST([HAVE_ASINL])
-  HAVE_ATANF=1;                AC_SUBST([HAVE_ATANF])
-  HAVE_ATANL=1;                AC_SUBST([HAVE_ATANL])
-  HAVE_ATAN2F=1;               AC_SUBST([HAVE_ATAN2F])
-  HAVE_CBRT=1;                 AC_SUBST([HAVE_CBRT])
-  HAVE_CBRTF=1;                AC_SUBST([HAVE_CBRTF])
-  HAVE_CBRTL=1;                AC_SUBST([HAVE_CBRTL])
-  HAVE_COPYSIGN=1;             AC_SUBST([HAVE_COPYSIGN])
-  HAVE_COPYSIGNL=1;            AC_SUBST([HAVE_COPYSIGNL])
-  HAVE_COSF=1;                 AC_SUBST([HAVE_COSF])
-  HAVE_COSL=1;                 AC_SUBST([HAVE_COSL])
-  HAVE_COSHF=1;                AC_SUBST([HAVE_COSHF])
-  HAVE_EXPF=1;                 AC_SUBST([HAVE_EXPF])
-  HAVE_EXPL=1;                 AC_SUBST([HAVE_EXPL])
-  HAVE_EXPM1=1;                AC_SUBST([HAVE_EXPM1])
-  HAVE_EXPM1F=1;               AC_SUBST([HAVE_EXPM1F])
-  HAVE_FABSF=1;                AC_SUBST([HAVE_FABSF])
-  HAVE_FABSL=1;                AC_SUBST([HAVE_FABSL])
-  HAVE_FMA=1;                  AC_SUBST([HAVE_FMA])
-  HAVE_FMAF=1;                 AC_SUBST([HAVE_FMAF])
-  HAVE_FMAL=1;                 AC_SUBST([HAVE_FMAL])
-  HAVE_FMODF=1;                AC_SUBST([HAVE_FMODF])
-  HAVE_FMODL=1;                AC_SUBST([HAVE_FMODL])
-  HAVE_FREXPF=1;               AC_SUBST([HAVE_FREXPF])
-  HAVE_HYPOTF=1;               AC_SUBST([HAVE_HYPOTF])
-  HAVE_HYPOTL=1;               AC_SUBST([HAVE_HYPOTL])
-  HAVE_ILOGB=1;                AC_SUBST([HAVE_ILOGB])
-  HAVE_ILOGBF=1;               AC_SUBST([HAVE_ILOGBF])
-  HAVE_ILOGBL=1;               AC_SUBST([HAVE_ILOGBL])
-  HAVE_ISNANF=1;               AC_SUBST([HAVE_ISNANF])
-  HAVE_ISNAND=1;               AC_SUBST([HAVE_ISNAND])
-  HAVE_ISNANL=1;               AC_SUBST([HAVE_ISNANL])
-  HAVE_LDEXPF=1;               AC_SUBST([HAVE_LDEXPF])
-  HAVE_LOGF=1;                 AC_SUBST([HAVE_LOGF])
-  HAVE_LOGL=1;                 AC_SUBST([HAVE_LOGL])
-  HAVE_LOG10F=1;               AC_SUBST([HAVE_LOG10F])
-  HAVE_LOG10L=1;               AC_SUBST([HAVE_LOG10L])
-  HAVE_LOG1P=1;                AC_SUBST([HAVE_LOG1P])
-  HAVE_LOG1PF=1;               AC_SUBST([HAVE_LOG1PF])
-  HAVE_LOG1PL=1;               AC_SUBST([HAVE_LOG1PL])
-  HAVE_LOGBF=1;                AC_SUBST([HAVE_LOGBF])
-  HAVE_LOGBL=1;                AC_SUBST([HAVE_LOGBL])
-  HAVE_MODFF=1;                AC_SUBST([HAVE_MODFF])
-  HAVE_MODFL=1;                AC_SUBST([HAVE_MODFL])
-  HAVE_POWF=1;                 AC_SUBST([HAVE_POWF])
-  HAVE_REMAINDER=1;            AC_SUBST([HAVE_REMAINDER])
-  HAVE_REMAINDERF=1;           AC_SUBST([HAVE_REMAINDERF])
-  HAVE_RINT=1;                 AC_SUBST([HAVE_RINT])
-  HAVE_RINTL=1;                AC_SUBST([HAVE_RINTL])
-  HAVE_SINF=1;                 AC_SUBST([HAVE_SINF])
-  HAVE_SINL=1;                 AC_SUBST([HAVE_SINL])
-  HAVE_SINHF=1;                AC_SUBST([HAVE_SINHF])
-  HAVE_SQRTF=1;                AC_SUBST([HAVE_SQRTF])
-  HAVE_SQRTL=1;                AC_SUBST([HAVE_SQRTL])
-  HAVE_TANF=1;                 AC_SUBST([HAVE_TANF])
-  HAVE_TANL=1;                 AC_SUBST([HAVE_TANL])
-  HAVE_TANHF=1;                AC_SUBST([HAVE_TANHF])
-  HAVE_DECL_ACOSL=1;           AC_SUBST([HAVE_DECL_ACOSL])
-  HAVE_DECL_ASINL=1;           AC_SUBST([HAVE_DECL_ASINL])
-  HAVE_DECL_ATANL=1;           AC_SUBST([HAVE_DECL_ATANL])
-  HAVE_DECL_CBRTF=1;           AC_SUBST([HAVE_DECL_CBRTF])
-  HAVE_DECL_CBRTL=1;           AC_SUBST([HAVE_DECL_CBRTL])
-  HAVE_DECL_CEILF=1;           AC_SUBST([HAVE_DECL_CEILF])
-  HAVE_DECL_CEILL=1;           AC_SUBST([HAVE_DECL_CEILL])
-  HAVE_DECL_COPYSIGNF=1;       AC_SUBST([HAVE_DECL_COPYSIGNF])
-  HAVE_DECL_COSL=1;            AC_SUBST([HAVE_DECL_COSL])
-  HAVE_DECL_EXPL=1;            AC_SUBST([HAVE_DECL_EXPL])
-  HAVE_DECL_EXP2=1;            AC_SUBST([HAVE_DECL_EXP2])
-  HAVE_DECL_EXP2F=1;           AC_SUBST([HAVE_DECL_EXP2F])
-  HAVE_DECL_EXP2L=1;           AC_SUBST([HAVE_DECL_EXP2L])
-  HAVE_DECL_EXPM1L=1;          AC_SUBST([HAVE_DECL_EXPM1L])
-  HAVE_DECL_FLOORF=1;          AC_SUBST([HAVE_DECL_FLOORF])
-  HAVE_DECL_FLOORL=1;          AC_SUBST([HAVE_DECL_FLOORL])
-  HAVE_DECL_FREXPL=1;          AC_SUBST([HAVE_DECL_FREXPL])
-  HAVE_DECL_LDEXPL=1;          AC_SUBST([HAVE_DECL_LDEXPL])
-  HAVE_DECL_LOGL=1;            AC_SUBST([HAVE_DECL_LOGL])
-  HAVE_DECL_LOG10L=1;          AC_SUBST([HAVE_DECL_LOG10L])
-  HAVE_DECL_LOG2=1;            AC_SUBST([HAVE_DECL_LOG2])
-  HAVE_DECL_LOG2F=1;           AC_SUBST([HAVE_DECL_LOG2F])
-  HAVE_DECL_LOG2L=1;           AC_SUBST([HAVE_DECL_LOG2L])
-  HAVE_DECL_LOGB=1;            AC_SUBST([HAVE_DECL_LOGB])
-  HAVE_DECL_REMAINDER=1;       AC_SUBST([HAVE_DECL_REMAINDER])
-  HAVE_DECL_REMAINDERL=1;      AC_SUBST([HAVE_DECL_REMAINDERL])
-  HAVE_DECL_RINTF=1;           AC_SUBST([HAVE_DECL_RINTF])
-  HAVE_DECL_ROUND=1;           AC_SUBST([HAVE_DECL_ROUND])
-  HAVE_DECL_ROUNDF=1;          AC_SUBST([HAVE_DECL_ROUNDF])
-  HAVE_DECL_ROUNDL=1;          AC_SUBST([HAVE_DECL_ROUNDL])
-  HAVE_DECL_SINL=1;            AC_SUBST([HAVE_DECL_SINL])
-  HAVE_DECL_SQRTL=1;           AC_SUBST([HAVE_DECL_SQRTL])
-  HAVE_DECL_TANL=1;            AC_SUBST([HAVE_DECL_TANL])
-  HAVE_DECL_TRUNC=1;           AC_SUBST([HAVE_DECL_TRUNC])
-  HAVE_DECL_TRUNCF=1;          AC_SUBST([HAVE_DECL_TRUNCF])
-  HAVE_DECL_TRUNCL=1;          AC_SUBST([HAVE_DECL_TRUNCL])
-  REPLACE_ACOSF=0;             AC_SUBST([REPLACE_ACOSF])
-  REPLACE_ASINF=0;             AC_SUBST([REPLACE_ASINF])
-  REPLACE_ATANF=0;             AC_SUBST([REPLACE_ATANF])
-  REPLACE_ATAN2F=0;            AC_SUBST([REPLACE_ATAN2F])
-  REPLACE_CBRTF=0;             AC_SUBST([REPLACE_CBRTF])
-  REPLACE_CBRTL=0;             AC_SUBST([REPLACE_CBRTL])
-  REPLACE_CEIL=0;              AC_SUBST([REPLACE_CEIL])
-  REPLACE_CEILF=0;             AC_SUBST([REPLACE_CEILF])
-  REPLACE_CEILL=0;             AC_SUBST([REPLACE_CEILL])
-  REPLACE_COSF=0;              AC_SUBST([REPLACE_COSF])
-  REPLACE_COSHF=0;             AC_SUBST([REPLACE_COSHF])
-  REPLACE_EXPF=0;              AC_SUBST([REPLACE_EXPF])
-  REPLACE_EXPM1=0;             AC_SUBST([REPLACE_EXPM1])
-  REPLACE_EXPM1F=0;            AC_SUBST([REPLACE_EXPM1F])
-  REPLACE_EXP2=0;              AC_SUBST([REPLACE_EXP2])
-  REPLACE_EXP2L=0;             AC_SUBST([REPLACE_EXP2L])
-  REPLACE_FABSL=0;             AC_SUBST([REPLACE_FABSL])
-  REPLACE_FLOOR=0;             AC_SUBST([REPLACE_FLOOR])
-  REPLACE_FLOORF=0;            AC_SUBST([REPLACE_FLOORF])
-  REPLACE_FLOORL=0;            AC_SUBST([REPLACE_FLOORL])
-  REPLACE_FMA=0;               AC_SUBST([REPLACE_FMA])
-  REPLACE_FMAF=0;              AC_SUBST([REPLACE_FMAF])
-  REPLACE_FMAL=0;              AC_SUBST([REPLACE_FMAL])
-  REPLACE_FMOD=0;              AC_SUBST([REPLACE_FMOD])
-  REPLACE_FMODF=0;             AC_SUBST([REPLACE_FMODF])
-  REPLACE_FMODL=0;             AC_SUBST([REPLACE_FMODL])
-  REPLACE_FREXPF=0;            AC_SUBST([REPLACE_FREXPF])
-  REPLACE_FREXP=0;             AC_SUBST([REPLACE_FREXP])
-  REPLACE_FREXPL=0;            AC_SUBST([REPLACE_FREXPL])
-  REPLACE_HUGE_VAL=0;          AC_SUBST([REPLACE_HUGE_VAL])
-  REPLACE_HYPOT=0;             AC_SUBST([REPLACE_HYPOT])
-  REPLACE_HYPOTF=0;            AC_SUBST([REPLACE_HYPOTF])
-  REPLACE_HYPOTL=0;            AC_SUBST([REPLACE_HYPOTL])
-  REPLACE_ILOGB=0;             AC_SUBST([REPLACE_ILOGB])
-  REPLACE_ILOGBF=0;            AC_SUBST([REPLACE_ILOGBF])
-  REPLACE_ISFINITE=0;          AC_SUBST([REPLACE_ISFINITE])
-  REPLACE_ISINF=0;             AC_SUBST([REPLACE_ISINF])
-  REPLACE_ISNAN=0;             AC_SUBST([REPLACE_ISNAN])
-  REPLACE_LDEXPL=0;            AC_SUBST([REPLACE_LDEXPL])
-  REPLACE_LOG=0;               AC_SUBST([REPLACE_LOG])
-  REPLACE_LOGF=0;              AC_SUBST([REPLACE_LOGF])
-  REPLACE_LOGL=0;              AC_SUBST([REPLACE_LOGL])
-  REPLACE_LOG10=0;             AC_SUBST([REPLACE_LOG10])
-  REPLACE_LOG10F=0;            AC_SUBST([REPLACE_LOG10F])
-  REPLACE_LOG10L=0;            AC_SUBST([REPLACE_LOG10L])
-  REPLACE_LOG1P=0;             AC_SUBST([REPLACE_LOG1P])
-  REPLACE_LOG1PF=0;            AC_SUBST([REPLACE_LOG1PF])
-  REPLACE_LOG1PL=0;            AC_SUBST([REPLACE_LOG1PL])
-  REPLACE_LOG2=0;              AC_SUBST([REPLACE_LOG2])
-  REPLACE_LOG2F=0;             AC_SUBST([REPLACE_LOG2F])
-  REPLACE_LOG2L=0;             AC_SUBST([REPLACE_LOG2L])
-  REPLACE_LOGB=0;              AC_SUBST([REPLACE_LOGB])
-  REPLACE_LOGBF=0;             AC_SUBST([REPLACE_LOGBF])
-  REPLACE_LOGBL=0;             AC_SUBST([REPLACE_LOGBL])
-  REPLACE_MODF=0;              AC_SUBST([REPLACE_MODF])
-  REPLACE_MODFF=0;             AC_SUBST([REPLACE_MODFF])
-  REPLACE_MODFL=0;             AC_SUBST([REPLACE_MODFL])
-  REPLACE_NAN=0;               AC_SUBST([REPLACE_NAN])
-  REPLACE_REMAINDER=0;         AC_SUBST([REPLACE_REMAINDER])
-  REPLACE_REMAINDERF=0;        AC_SUBST([REPLACE_REMAINDERF])
-  REPLACE_REMAINDERL=0;        AC_SUBST([REPLACE_REMAINDERL])
-  REPLACE_ROUND=0;             AC_SUBST([REPLACE_ROUND])
-  REPLACE_ROUNDF=0;            AC_SUBST([REPLACE_ROUNDF])
-  REPLACE_ROUNDL=0;            AC_SUBST([REPLACE_ROUNDL])
-  REPLACE_SIGNBIT=0;           AC_SUBST([REPLACE_SIGNBIT])
-  REPLACE_SIGNBIT_USING_GCC=0; AC_SUBST([REPLACE_SIGNBIT_USING_GCC])
-  REPLACE_SINF=0;              AC_SUBST([REPLACE_SINF])
-  REPLACE_SINHF=0;             AC_SUBST([REPLACE_SINHF])
-  REPLACE_SQRTF=0;             AC_SUBST([REPLACE_SQRTF])
-  REPLACE_SQRTL=0;             AC_SUBST([REPLACE_SQRTL])
-  REPLACE_TANF=0;              AC_SUBST([REPLACE_TANF])
-  REPLACE_TANHF=0;             AC_SUBST([REPLACE_TANHF])
-  REPLACE_TRUNC=0;             AC_SUBST([REPLACE_TRUNC])
-  REPLACE_TRUNCF=0;            AC_SUBST([REPLACE_TRUNCF])
-  REPLACE_TRUNCL=0;            AC_SUBST([REPLACE_TRUNCL])
+  HAVE_ACOSF=1;                     AC_SUBST([HAVE_ACOSF])
+  HAVE_ACOSL=1;                     AC_SUBST([HAVE_ACOSL])
+  HAVE_ASINF=1;                     AC_SUBST([HAVE_ASINF])
+  HAVE_ASINL=1;                     AC_SUBST([HAVE_ASINL])
+  HAVE_ATANF=1;                     AC_SUBST([HAVE_ATANF])
+  HAVE_ATANL=1;                     AC_SUBST([HAVE_ATANL])
+  HAVE_ATAN2F=1;                    AC_SUBST([HAVE_ATAN2F])
+  HAVE_CBRT=1;                      AC_SUBST([HAVE_CBRT])
+  HAVE_CBRTF=1;                     AC_SUBST([HAVE_CBRTF])
+  HAVE_CBRTL=1;                     AC_SUBST([HAVE_CBRTL])
+  HAVE_COPYSIGN=1;                  AC_SUBST([HAVE_COPYSIGN])
+  HAVE_COPYSIGNL=1;                 AC_SUBST([HAVE_COPYSIGNL])
+  HAVE_COSF=1;                      AC_SUBST([HAVE_COSF])
+  HAVE_COSL=1;                      AC_SUBST([HAVE_COSL])
+  HAVE_COSHF=1;                     AC_SUBST([HAVE_COSHF])
+  HAVE_EXPF=1;                      AC_SUBST([HAVE_EXPF])
+  HAVE_EXPL=1;                      AC_SUBST([HAVE_EXPL])
+  HAVE_EXPM1=1;                     AC_SUBST([HAVE_EXPM1])
+  HAVE_EXPM1F=1;                    AC_SUBST([HAVE_EXPM1F])
+  HAVE_FABSF=1;                     AC_SUBST([HAVE_FABSF])
+  HAVE_FABSL=1;                     AC_SUBST([HAVE_FABSL])
+  HAVE_FMA=1;                       AC_SUBST([HAVE_FMA])
+  HAVE_FMAF=1;                      AC_SUBST([HAVE_FMAF])
+  HAVE_FMAL=1;                      AC_SUBST([HAVE_FMAL])
+  HAVE_FMODF=1;                     AC_SUBST([HAVE_FMODF])
+  HAVE_FMODL=1;                     AC_SUBST([HAVE_FMODL])
+  HAVE_FREXPF=1;                    AC_SUBST([HAVE_FREXPF])
+  HAVE_HYPOTF=1;                    AC_SUBST([HAVE_HYPOTF])
+  HAVE_HYPOTL=1;                    AC_SUBST([HAVE_HYPOTL])
+  HAVE_ILOGB=1;                     AC_SUBST([HAVE_ILOGB])
+  HAVE_ILOGBF=1;                    AC_SUBST([HAVE_ILOGBF])
+  HAVE_ILOGBL=1;                    AC_SUBST([HAVE_ILOGBL])
+  HAVE_ISNANF=1;                    AC_SUBST([HAVE_ISNANF])
+  HAVE_ISNAND=1;                    AC_SUBST([HAVE_ISNAND])
+  HAVE_ISNANL=1;                    AC_SUBST([HAVE_ISNANL])
+  HAVE_LDEXPF=1;                    AC_SUBST([HAVE_LDEXPF])
+  HAVE_LOGF=1;                      AC_SUBST([HAVE_LOGF])
+  HAVE_LOGL=1;                      AC_SUBST([HAVE_LOGL])
+  HAVE_LOG10F=1;                    AC_SUBST([HAVE_LOG10F])
+  HAVE_LOG10L=1;                    AC_SUBST([HAVE_LOG10L])
+  HAVE_LOG1P=1;                     AC_SUBST([HAVE_LOG1P])
+  HAVE_LOG1PF=1;                    AC_SUBST([HAVE_LOG1PF])
+  HAVE_LOG1PL=1;                    AC_SUBST([HAVE_LOG1PL])
+  HAVE_LOGBF=1;                     AC_SUBST([HAVE_LOGBF])
+  HAVE_LOGBL=1;                     AC_SUBST([HAVE_LOGBL])
+  HAVE_MODFF=1;                     AC_SUBST([HAVE_MODFF])
+  HAVE_MODFL=1;                     AC_SUBST([HAVE_MODFL])
+  HAVE_POWF=1;                      AC_SUBST([HAVE_POWF])
+  HAVE_REMAINDER=1;                 AC_SUBST([HAVE_REMAINDER])
+  HAVE_REMAINDERF=1;                AC_SUBST([HAVE_REMAINDERF])
+  HAVE_RINT=1;                      AC_SUBST([HAVE_RINT])
+  HAVE_RINTL=1;                     AC_SUBST([HAVE_RINTL])
+  HAVE_SINF=1;                      AC_SUBST([HAVE_SINF])
+  HAVE_SINL=1;                      AC_SUBST([HAVE_SINL])
+  HAVE_SINHF=1;                     AC_SUBST([HAVE_SINHF])
+  HAVE_SQRTF=1;                     AC_SUBST([HAVE_SQRTF])
+  HAVE_SQRTL=1;                     AC_SUBST([HAVE_SQRTL])
+  HAVE_TANF=1;                      AC_SUBST([HAVE_TANF])
+  HAVE_TANL=1;                      AC_SUBST([HAVE_TANL])
+  HAVE_TANHF=1;                     AC_SUBST([HAVE_TANHF])
+  HAVE_DECL_ACOSL=1;                AC_SUBST([HAVE_DECL_ACOSL])
+  HAVE_DECL_ASINL=1;                AC_SUBST([HAVE_DECL_ASINL])
+  HAVE_DECL_ATANL=1;                AC_SUBST([HAVE_DECL_ATANL])
+  HAVE_DECL_CBRTF=1;                AC_SUBST([HAVE_DECL_CBRTF])
+  HAVE_DECL_CBRTL=1;                AC_SUBST([HAVE_DECL_CBRTL])
+  HAVE_DECL_CEILF=1;                AC_SUBST([HAVE_DECL_CEILF])
+  HAVE_DECL_CEILL=1;                AC_SUBST([HAVE_DECL_CEILL])
+  HAVE_DECL_COPYSIGNF=1;            AC_SUBST([HAVE_DECL_COPYSIGNF])
+  HAVE_DECL_COSL=1;                 AC_SUBST([HAVE_DECL_COSL])
+  HAVE_DECL_EXPL=1;                 AC_SUBST([HAVE_DECL_EXPL])
+  HAVE_DECL_EXP2=1;                 AC_SUBST([HAVE_DECL_EXP2])
+  HAVE_DECL_EXP2F=1;                AC_SUBST([HAVE_DECL_EXP2F])
+  HAVE_DECL_EXP2L=1;                AC_SUBST([HAVE_DECL_EXP2L])
+  HAVE_DECL_EXPM1L=1;               AC_SUBST([HAVE_DECL_EXPM1L])
+  HAVE_DECL_FLOORF=1;               AC_SUBST([HAVE_DECL_FLOORF])
+  HAVE_DECL_FLOORL=1;               AC_SUBST([HAVE_DECL_FLOORL])
+  HAVE_DECL_FREXPL=1;               AC_SUBST([HAVE_DECL_FREXPL])
+  HAVE_DECL_LDEXPL=1;               AC_SUBST([HAVE_DECL_LDEXPL])
+  HAVE_DECL_LOGL=1;                 AC_SUBST([HAVE_DECL_LOGL])
+  HAVE_DECL_LOG10L=1;               AC_SUBST([HAVE_DECL_LOG10L])
+  HAVE_DECL_LOG2=1;                 AC_SUBST([HAVE_DECL_LOG2])
+  HAVE_DECL_LOG2F=1;                AC_SUBST([HAVE_DECL_LOG2F])
+  HAVE_DECL_LOG2L=1;                AC_SUBST([HAVE_DECL_LOG2L])
+  HAVE_DECL_LOGB=1;                 AC_SUBST([HAVE_DECL_LOGB])
+  HAVE_DECL_REMAINDER=1;            AC_SUBST([HAVE_DECL_REMAINDER])
+  HAVE_DECL_REMAINDERL=1;           AC_SUBST([HAVE_DECL_REMAINDERL])
+  HAVE_DECL_RINTF=1;                AC_SUBST([HAVE_DECL_RINTF])
+  HAVE_DECL_ROUND=1;                AC_SUBST([HAVE_DECL_ROUND])
+  HAVE_DECL_ROUNDF=1;               AC_SUBST([HAVE_DECL_ROUNDF])
+  HAVE_DECL_ROUNDL=1;               AC_SUBST([HAVE_DECL_ROUNDL])
+  HAVE_DECL_SINL=1;                 AC_SUBST([HAVE_DECL_SINL])
+  HAVE_DECL_SQRTL=1;                AC_SUBST([HAVE_DECL_SQRTL])
+  HAVE_DECL_TANL=1;                 AC_SUBST([HAVE_DECL_TANL])
+  HAVE_DECL_TRUNC=1;                AC_SUBST([HAVE_DECL_TRUNC])
+  HAVE_DECL_TRUNCF=1;               AC_SUBST([HAVE_DECL_TRUNCF])
+  HAVE_DECL_TRUNCL=1;               AC_SUBST([HAVE_DECL_TRUNCL])
+  REPLACE_ACOSF=0;                  AC_SUBST([REPLACE_ACOSF])
+  REPLACE_ASINF=0;                  AC_SUBST([REPLACE_ASINF])
+  REPLACE_ATANF=0;                  AC_SUBST([REPLACE_ATANF])
+  REPLACE_ATAN2F=0;                 AC_SUBST([REPLACE_ATAN2F])
+  REPLACE_CBRTF=0;                  AC_SUBST([REPLACE_CBRTF])
+  REPLACE_CBRTL=0;                  AC_SUBST([REPLACE_CBRTL])
+  REPLACE_CEIL=0;                   AC_SUBST([REPLACE_CEIL])
+  REPLACE_CEILF=0;                  AC_SUBST([REPLACE_CEILF])
+  REPLACE_CEILL=0;                  AC_SUBST([REPLACE_CEILL])
+  REPLACE_COSF=0;                   AC_SUBST([REPLACE_COSF])
+  REPLACE_COSHF=0;                  AC_SUBST([REPLACE_COSHF])
+  REPLACE_EXPF=0;                   AC_SUBST([REPLACE_EXPF])
+  REPLACE_EXPL=0;                   AC_SUBST([REPLACE_EXPL])
+  REPLACE_EXPM1=0;                  AC_SUBST([REPLACE_EXPM1])
+  REPLACE_EXPM1F=0;                 AC_SUBST([REPLACE_EXPM1F])
+  REPLACE_EXPM1L=0;                 AC_SUBST([REPLACE_EXPM1L])
+  REPLACE_EXP2=0;                   AC_SUBST([REPLACE_EXP2])
+  REPLACE_EXP2L=0;                  AC_SUBST([REPLACE_EXP2L])
+  REPLACE_FABSL=0;                  AC_SUBST([REPLACE_FABSL])
+  REPLACE_FLOOR=0;                  AC_SUBST([REPLACE_FLOOR])
+  REPLACE_FLOORF=0;                 AC_SUBST([REPLACE_FLOORF])
+  REPLACE_FLOORL=0;                 AC_SUBST([REPLACE_FLOORL])
+  REPLACE_FMA=0;                    AC_SUBST([REPLACE_FMA])
+  REPLACE_FMAF=0;                   AC_SUBST([REPLACE_FMAF])
+  REPLACE_FMAL=0;                   AC_SUBST([REPLACE_FMAL])
+  REPLACE_FMOD=0;                   AC_SUBST([REPLACE_FMOD])
+  REPLACE_FMODF=0;                  AC_SUBST([REPLACE_FMODF])
+  REPLACE_FMODL=0;                  AC_SUBST([REPLACE_FMODL])
+  REPLACE_FREXPF=0;                 AC_SUBST([REPLACE_FREXPF])
+  REPLACE_FREXP=0;                  AC_SUBST([REPLACE_FREXP])
+  REPLACE_FREXPL=0;                 AC_SUBST([REPLACE_FREXPL])
+  REPLACE_HUGE_VAL=0;               AC_SUBST([REPLACE_HUGE_VAL])
+  REPLACE_HYPOT=0;                  AC_SUBST([REPLACE_HYPOT])
+  REPLACE_HYPOTF=0;                 AC_SUBST([REPLACE_HYPOTF])
+  REPLACE_HYPOTL=0;                 AC_SUBST([REPLACE_HYPOTL])
+  REPLACE_ILOGB=0;                  AC_SUBST([REPLACE_ILOGB])
+  REPLACE_ILOGBF=0;                 AC_SUBST([REPLACE_ILOGBF])
+  REPLACE_ILOGBL=0;                 AC_SUBST([REPLACE_ILOGBL])
+  REPLACE_ISFINITE=0;               AC_SUBST([REPLACE_ISFINITE])
+  REPLACE_ISINF=0;                  AC_SUBST([REPLACE_ISINF])
+  REPLACE_ISNAN=0;                  AC_SUBST([REPLACE_ISNAN])
+  REPLACE_LDEXPL=0;                 AC_SUBST([REPLACE_LDEXPL])
+  REPLACE_LOG=0;                    AC_SUBST([REPLACE_LOG])
+  REPLACE_LOGF=0;                   AC_SUBST([REPLACE_LOGF])
+  REPLACE_LOGL=0;                   AC_SUBST([REPLACE_LOGL])
+  REPLACE_LOG10=0;                  AC_SUBST([REPLACE_LOG10])
+  REPLACE_LOG10F=0;                 AC_SUBST([REPLACE_LOG10F])
+  REPLACE_LOG10L=0;                 AC_SUBST([REPLACE_LOG10L])
+  REPLACE_LOG1P=0;                  AC_SUBST([REPLACE_LOG1P])
+  REPLACE_LOG1PF=0;                 AC_SUBST([REPLACE_LOG1PF])
+  REPLACE_LOG1PL=0;                 AC_SUBST([REPLACE_LOG1PL])
+  REPLACE_LOG2=0;                   AC_SUBST([REPLACE_LOG2])
+  REPLACE_LOG2F=0;                  AC_SUBST([REPLACE_LOG2F])
+  REPLACE_LOG2L=0;                  AC_SUBST([REPLACE_LOG2L])
+  REPLACE_LOGB=0;                   AC_SUBST([REPLACE_LOGB])
+  REPLACE_LOGBF=0;                  AC_SUBST([REPLACE_LOGBF])
+  REPLACE_LOGBL=0;                  AC_SUBST([REPLACE_LOGBL])
+  REPLACE_MODF=0;                   AC_SUBST([REPLACE_MODF])
+  REPLACE_MODFF=0;                  AC_SUBST([REPLACE_MODFF])
+  REPLACE_MODFL=0;                  AC_SUBST([REPLACE_MODFL])
+  REPLACE_NAN=0;                    AC_SUBST([REPLACE_NAN])
+  REPLACE_REMAINDER=0;              AC_SUBST([REPLACE_REMAINDER])
+  REPLACE_REMAINDERF=0;             AC_SUBST([REPLACE_REMAINDERF])
+  REPLACE_REMAINDERL=0;             AC_SUBST([REPLACE_REMAINDERL])
+  REPLACE_RINTL=0;                  AC_SUBST([REPLACE_RINTL])
+  REPLACE_ROUND=0;                  AC_SUBST([REPLACE_ROUND])
+  REPLACE_ROUNDF=0;                 AC_SUBST([REPLACE_ROUNDF])
+  REPLACE_ROUNDL=0;                 AC_SUBST([REPLACE_ROUNDL])
+  REPLACE_SIGNBIT=0;                AC_SUBST([REPLACE_SIGNBIT])
+  REPLACE_SIGNBIT_USING_BUILTINS=0; AC_SUBST([REPLACE_SIGNBIT_USING_BUILTINS])
+  REPLACE_SINF=0;                   AC_SUBST([REPLACE_SINF])
+  REPLACE_SINHF=0;                  AC_SUBST([REPLACE_SINHF])
+  REPLACE_SQRTF=0;                  AC_SUBST([REPLACE_SQRTF])
+  REPLACE_SQRTL=0;                  AC_SUBST([REPLACE_SQRTL])
+  REPLACE_TANF=0;                   AC_SUBST([REPLACE_TANF])
+  REPLACE_TANHF=0;                  AC_SUBST([REPLACE_TANHF])
+  REPLACE_TRUNC=0;                  AC_SUBST([REPLACE_TRUNC])
+  REPLACE_TRUNCF=0;                 AC_SUBST([REPLACE_TRUNCF])
+  REPLACE_TRUNCL=0;                 AC_SUBST([REPLACE_TRUNCL])
 ])
 
 # gl_LONG_DOUBLE_VS_DOUBLE
diff --git a/m4/mbchar.m4 b/m4/mbchar.m4
new file mode 100644 (file)
index 0000000..b6842bb
--- /dev/null
@@ -0,0 +1,13 @@
+# mbchar.m4 serial 9
+dnl Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl autoconf tests required for use of mbchar.m4
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_MBCHAR],
+[
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+])
diff --git a/m4/mbiter.m4 b/m4/mbiter.m4
new file mode 100644 (file)
index 0000000..0d57379
--- /dev/null
@@ -0,0 +1,14 @@
+# mbiter.m4 serial 7
+dnl Copyright (C) 2005, 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl autoconf tests required for use of mbiter.h
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_MBITER],
+[
+  AC_REQUIRE([AC_TYPE_MBSTATE_T])
+  :
+])
index 5edf08b..1d4e73d 100644 (file)
@@ -1,5 +1,5 @@
-# mbrtowc.m4 serial 27  -*- coding: utf-8 -*-
-dnl Copyright (C) 2001-2002, 2004-2005, 2008-2016 Free Software Foundation,
+# mbrtowc.m4 serial 38  -*- coding: utf-8 -*-
+dnl Copyright (C) 2001-2002, 2004-2005, 2008-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,6 +8,8 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_MBRTOWC],
 [
   AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  AC_REQUIRE([gl_PTHREADLIB])
+  AC_CHECK_HEADERS_ONCE([threads.h])
 
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   gl_MBSTATE_T_BROKEN
@@ -16,15 +18,8 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
   if test $ac_cv_func_mbrtowc = no; then
     HAVE_MBRTOWC=0
     AC_CHECK_DECLS([mbrtowc],,, [[
-/* 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 <wchar.h>
+    ]])
     if test $ac_cv_have_decl_mbrtowc = yes; then
       dnl On Minix 3.1.8, the system's <wchar.h> declares mbrtowc() although
       dnl it does not have the function. Avoid a collision with gnulib's
@@ -39,6 +34,7 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
       gl_MBRTOWC_NULL_ARG2
       gl_MBRTOWC_RETVAL
       gl_MBRTOWC_NUL_RETVAL
+      gl_MBRTOWC_STORES_INCOMPLETE
       gl_MBRTOWC_EMPTY_INPUT
       gl_MBRTOWC_C_LOCALE
       case "$gl_cv_func_mbrtowc_null_arg1" in
@@ -69,6 +65,13 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
            REPLACE_MBRTOWC=1
            ;;
       esac
+      case "$gl_cv_func_mbrtowc_stores_incomplete" in
+        *no) ;;
+        *) AC_DEFINE([MBRTOWC_STORES_INCOMPLETE_BUG], [1],
+             [Define if the mbrtowc function stores a wide character when reporting incomplete input.])
+           REPLACE_MBRTOWC=1
+           ;;
+      esac
       case "$gl_cv_func_mbrtowc_empty_input" in
         *yes) ;;
         *) AC_DEFINE([MBRTOWC_EMPTY_INPUT_BUG], [1],
@@ -77,15 +80,32 @@ AC_DEFUN([gl_FUNC_MBRTOWC],
            REPLACE_MBRTOWC=1
            ;;
       esac
-      case $gl_cv_C_locale_sans_EILSEQ in
+      case "$gl_cv_func_mbrtowc_C_locale_sans_EILSEQ" in
         *yes) ;;
-        *) AC_DEFINE([C_LOCALE_MAYBE_EILSEQ], [1],
-             [Define to 1 if the C locale may have encoding errors.])
+        *) AC_DEFINE([MBRTOWC_IN_C_LOCALE_MAYBE_EILSEQ], [1],
+             [Define if the mbrtowc function may signal encoding errors in the C locale.])
            REPLACE_MBRTOWC=1
            ;;
       esac
     fi
   fi
+  if test $REPLACE_MBSTATE_T = 1; then
+    case "$host_os" in
+      mingw*) LIB_MBRTOWC= ;;
+      *)
+        gl_WEAK_SYMBOLS
+        case "$gl_cv_have_weak" in
+          *yes) LIB_MBRTOWC= ;;
+          *)    LIB_MBRTOWC="$LIBPTHREAD" ;;
+        esac
+        ;;
+    esac
+  else
+    LIB_MBRTOWC=
+  fi
+  dnl LIB_MBRTOWC is expected to be '-pthread' or '-lpthread' on AIX
+  dnl with gcc or xlc, and empty otherwise.
+  AC_SUBST([LIB_MBRTOWC])
 ])
 
 dnl Test whether mbsinit() and mbrtowc() need to be overridden in a way that
@@ -97,11 +117,19 @@ dnl avoid inconsistencies.
 AC_DEFUN([gl_MBSTATE_T_BROKEN],
 [
   AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST])
 
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   AC_CHECK_FUNCS_ONCE([mbsinit])
   AC_CHECK_FUNCS_ONCE([mbrtowc])
-  if test $ac_cv_func_mbsinit = yes && test $ac_cv_func_mbrtowc = yes; then
+  dnl On native Windows, we know exactly how mbsinit() behaves and don't need
+  dnl to override it, even if - like on MSVC - mbsinit() is only defined as
+  dnl an inline function, not as a global function.
+  if case "$host_os" in
+       mingw*) true ;;
+       *) test $ac_cv_func_mbsinit = yes ;;
+     esac \
+    && test $ac_cv_func_mbrtowc = yes; then
     gl_MBRTOWC_INCOMPLETE_STATE
     gl_MBRTOWC_SANITYCHECK
     REPLACE_MBSTATE_T=0
@@ -126,6 +154,7 @@ AC_DEFUN([gl_MBRTOWC_INCOMPLETE_STATE],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([gt_LOCALE_JA])
+  AC_REQUIRE([gt_LOCALE_FR_UTF8])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether mbrtowc handles incomplete characters],
     [gl_cv_func_mbrtowc_incomplete_state],
@@ -145,13 +174,6 @@ changequote([,])dnl
           [AC_LANG_SOURCE([[
 #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 ()
 {
@@ -171,6 +193,32 @@ int main ()
           [gl_cv_func_mbrtowc_incomplete_state=yes],
           [gl_cv_func_mbrtowc_incomplete_state=no],
           [:])
+      else
+        if test $LOCALE_FR_UTF8 != none; then
+          AC_RUN_IFELSE(
+            [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      const char input[] = "B\303\274\303\237er"; /* "Büßer" */
+      mbstate_t state;
+      wchar_t wc;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, input + 1, 1, &state) == (size_t)(-2))
+        if (mbsinit (&state))
+          return 2;
+    }
+  return 0;
+}]])],
+          [gl_cv_func_mbrtowc_incomplete_state=yes],
+          [gl_cv_func_mbrtowc_incomplete_state=no],
+          [:])
+        fi
       fi
     ])
 ])
@@ -202,13 +250,6 @@ changequote([,])dnl
 #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 ()
 {
@@ -262,13 +303,6 @@ changequote([,])dnl
 #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 ()
 {
@@ -331,13 +365,6 @@ changequote([,])dnl
           [AC_LANG_SOURCE([[
 #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 ()
 {
@@ -393,13 +420,6 @@ changequote([,])dnl
           [AC_LANG_SOURCE([[
 #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 ()
 {
@@ -521,13 +541,6 @@ changequote([,])dnl
           [AC_LANG_SOURCE([[
 #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 ()
 {
@@ -550,6 +563,112 @@ int main ()
     ])
 ])
 
+dnl Test whether mbrtowc stores a wide character when reporting incomplete
+dnl input.
+
+AC_DEFUN([gl_MBRTOWC_STORES_INCOMPLETE],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CACHE_CHECK([whether mbrtowc stores incomplete characters],
+    [gl_cv_func_mbrtowc_stores_incomplete],
+    [
+     dnl Initial guess, used when cross-compiling or when no suitable locale
+     dnl is present.
+changequote(,)dnl
+     case "$host_os" in
+               # Guess yes on native Windows.
+       mingw*) gl_cv_func_mbrtowc_stores_incomplete="guessing yes" ;;
+       *)      gl_cv_func_mbrtowc_stores_incomplete="guessing no" ;;
+     esac
+changequote([,])dnl
+     case "$host_os" in
+       mingw*)
+         AC_RUN_IFELSE(
+           [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  int result = 0;
+  if (setlocale (LC_ALL, "French_France.65001") != NULL)
+    {
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      mbstate_t state;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+          && wc != (wchar_t) 0xBADFACE)
+        result |= 1;
+    }
+  if (setlocale (LC_ALL, "Japanese_Japan.932") != NULL)
+    {
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      mbstate_t state;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\226", 1, &state) == (size_t)(-2)
+          && wc != (wchar_t) 0xBADFACE)
+        result |= 2;
+    }
+  if (setlocale (LC_ALL, "Chinese_Taiwan.950") != NULL)
+    {
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      mbstate_t state;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\245", 1, &state) == (size_t)(-2)
+          && wc != (wchar_t) 0xBADFACE)
+        result |= 4;
+    }
+  if (setlocale (LC_ALL, "Chinese_China.936") != NULL)
+    {
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      mbstate_t state;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\261", 1, &state) == (size_t)(-2)
+          && wc != (wchar_t) 0xBADFACE)
+        result |= 8;
+    }
+  return result;
+}]])],
+           [gl_cv_func_mbrtowc_stores_incomplete=no],
+           [gl_cv_func_mbrtowc_stores_incomplete=yes],
+           [:])
+         ;;
+       *)
+         AC_REQUIRE([gt_LOCALE_FR_UTF8])
+         if test $LOCALE_FR_UTF8 != none; then
+           AC_RUN_IFELSE(
+             [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <string.h>
+#include <wchar.h>
+int main ()
+{
+  if (setlocale (LC_ALL, "$LOCALE_FR_UTF8") != NULL)
+    {
+      wchar_t wc = (wchar_t) 0xBADFACE;
+      mbstate_t state;
+
+      memset (&state, '\0', sizeof (mbstate_t));
+      if (mbrtowc (&wc, "\303", 1, &state) == (size_t)(-2)
+          && wc != (wchar_t) 0xBADFACE)
+        return 1;
+    }
+  return 0;
+}]])],
+             [gl_cv_func_mbrtowc_stores_incomplete=no],
+             [gl_cv_func_mbrtowc_stores_incomplete=yes],
+             [:])
+         fi
+         ;;
+     esac
+    ])
+])
+
 dnl Test whether mbrtowc returns the correct value on empty input.
 
 AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
@@ -563,10 +682,11 @@ AC_DEFUN([gl_MBRTOWC_EMPTY_INPUT],
       dnl is present.
 changequote(,)dnl
       case "$host_os" in
-                     # Guess no on AIX and glibc systems.
-        aix* | *-gnu*)
-                    gl_cv_func_mbrtowc_empty_input="guessing no" ;;
-        *)          gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+                              # Guess no on AIX and glibc systems.
+        aix* | *-gnu* | gnu*) gl_cv_func_mbrtowc_empty_input="guessing no" ;;
+                              # Guess yes on native Windows.
+        mingw*)               gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
+        *)                    gl_cv_func_mbrtowc_empty_input="guessing yes" ;;
       esac
 changequote([,])dnl
       AC_RUN_IFELSE(
@@ -592,12 +712,13 @@ dnl https://sourceware.org/bugzilla/show_bug.cgi?id=19932
 
 AC_DEFUN([gl_MBRTOWC_C_LOCALE],
 [
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([whether the C locale is free of encoding errors],
-    [gl_cv_C_locale_sans_EILSEQ],
+    [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ],
     [
      dnl Initial guess, used when cross-compiling or when no suitable locale
      dnl is present.
-     gl_cv_C_locale_sans_EILSEQ="guessing no"
+     gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="$gl_cross_guess_normal"
 
      AC_RUN_IFELSE(
        [AC_LANG_PROGRAM(
@@ -620,16 +741,28 @@ AC_DEFUN([gl_MBRTOWC_C_LOCALE],
               }
             return 0;
           ]])],
-      [gl_cv_C_locale_sans_EILSEQ=yes],
-      [gl_cv_C_locale_sans_EILSEQ=no],
-      [:])])
+      [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=yes],
+      [gl_cv_func_mbrtowc_C_locale_sans_EILSEQ=no],
+      [case "$host_os" in
+                 # Guess yes on native Windows.
+         mingw*) gl_cv_func_mbrtowc_C_locale_sans_EILSEQ="guessing yes" ;;
+       esac
+      ])
+    ])
 ])
 
-# Prerequisites of lib/mbrtowc.c.
+# Prerequisites of lib/mbrtowc.c and lib/lc-charset-dispatch.c.
 AC_DEFUN([gl_PREREQ_MBRTOWC], [
+  AC_REQUIRE([AC_C_INLINE])
   :
 ])
 
+# Prerequisites of lib/mbtowc-lock.c.
+AC_DEFUN([gl_PREREQ_MBTOWC_LOCK],
+[
+  gl_VISIBILITY
+])
+
 
 dnl From Paul Eggert
 
@@ -639,24 +772,17 @@ AC_DEFUN([AC_FUNC_MBRTOWC],
 [
   dnl Same as AC_FUNC_MBRTOWC in autoconf-2.60.
   AC_CACHE_CHECK([whether mbrtowc and mbstate_t are properly declared],
-    gl_cv_func_mbrtowc,
+    [gl_cv_func_mbrtowc],
     [AC_LINK_IFELSE(
        [AC_LANG_PROGRAM(
-            [[/* 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 <wchar.h>]],
             [[wchar_t wc;
               char const s[] = "";
               size_t n = 1;
               mbstate_t state;
               return ! (sizeof state && (mbrtowc) (&wc, s, n, &state));]])],
-       gl_cv_func_mbrtowc=yes,
-       gl_cv_func_mbrtowc=no)])
+       [gl_cv_func_mbrtowc=yes],
+       [gl_cv_func_mbrtowc=no])])
   if test $gl_cv_func_mbrtowc = yes; then
     AC_DEFINE([HAVE_MBRTOWC], [1],
       [Define to 1 if mbrtowc and mbstate_t are properly declared.])
index 88f0836..dc6e10d 100644 (file)
@@ -1,5 +1,5 @@
-# mbsinit.m4 serial 8
-dnl Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+# mbsinit.m4 serial 9
+dnl Copyright (C) 2008, 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -16,15 +16,8 @@ AC_DEFUN([gl_FUNC_MBSINIT],
   if test $ac_cv_func_mbsinit = no; then
     HAVE_MBSINIT=0
     AC_CHECK_DECLS([mbsinit],,, [[
-/* 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 <wchar.h>
+    ]])
     if test $ac_cv_have_decl_mbsinit = yes; then
       dnl On Minix 3.1.8, the system's <wchar.h> declares mbsinit() although
       dnl it does not have the function. Avoid a collision with gnulib's
diff --git a/m4/mbslen.m4 b/m4/mbslen.m4
new file mode 100644 (file)
index 0000000..0801fdf
--- /dev/null
@@ -0,0 +1,16 @@
+# mbslen.m4 serial 3
+dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MBSLEN],
+[
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
+  AC_CHECK_FUNCS_ONCE([mbslen])
+  if test $ac_cv_func_mbslen = yes; then
+    HAVE_MBSLEN=1
+  else
+    HAVE_MBSLEN=0
+  fi
+])
index 0a8eae2..e7fe358 100644 (file)
@@ -1,5 +1,5 @@
-# mbstate_t.m4 serial 13
-dnl Copyright (C) 2000-2002, 2008-2016 Free Software Foundation, Inc.
+# mbstate_t.m4 serial 14
+dnl Copyright (C) 2000-2002, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -20,14 +20,7 @@ AC_DEFUN([AC_TYPE_MBSTATE_T],
      [AC_COMPILE_IFELSE(
         [AC_LANG_PROGRAM(
            [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>]],
+             #include <wchar.h>]],
            [[mbstate_t x; return sizeof x;]])],
         [ac_cv_type_mbstate_t=yes],
         [ac_cv_type_mbstate_t=no])])
index e770bbf..7fc74c9 100644 (file)
@@ -1,5 +1,5 @@
-# mbtowc.m4 serial 2
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# mbtowc.m4 serial 3
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,8 +8,13 @@ AC_DEFUN([gl_FUNC_MBTOWC],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
 
-  if false; then
-    REPLACE_MBTOWC=1
+  AC_CHECK_FUNCS([mbtowc])
+  if test $ac_cv_func_mbtowc = no; then
+    HAVE_MBTOWC=0
+  else
+    if false; then
+      REPLACE_MBTOWC=1
+    fi
   fi
 ])
 
index 25d32f0..ca08192 100644 (file)
@@ -1,35 +1,30 @@
-# memchr.m4 serial 12
-dnl Copyright (C) 2002-2004, 2009-2016 Free Software Foundation, Inc.
+# memchr.m4 serial 18
+dnl Copyright (C) 2002-2004, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
 [
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
   dnl Check for prerequisites for memory fence checks.
   gl_FUNC_MMAP_ANON
   AC_CHECK_HEADERS_ONCE([sys/mman.h])
   AC_CHECK_FUNCS_ONCE([mprotect])
 
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  m4_ifdef([gl_FUNC_MEMCHR_OBSOLETE], [
-    dnl These days, we assume memchr is present.  But if support for old
-    dnl platforms is desired:
-    AC_CHECK_FUNCS_ONCE([memchr])
-    if test $ac_cv_func_memchr = no; then
-      HAVE_MEMCHR=0
-    fi
-  ])
-  if test $HAVE_MEMCHR = 1; then
-    # Detect platform-specific bugs in some versions of glibc:
-    # memchr should not dereference anything with length 0
-    #   http://bugzilla.redhat.com/499689
-    # memchr should not dereference overestimated length after a match
-    #   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
-    #   http://sourceware.org/bugzilla/show_bug.cgi?id=10162
-    # Assume that memchr works on platforms that lack mprotect.
-    AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
-      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
+  # Detect platform-specific bugs in some versions of glibc:
+  # memchr should not dereference anything with length 0
+  #   https://bugzilla.redhat.com/show_bug.cgi?id=499689
+  # memchr should not dereference overestimated length after a match
+  #   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737
+  #   https://sourceware.org/bugzilla/show_bug.cgi?id=10162
+  # memchr should cast the second argument to 'unsigned char'.
+  #   This bug exists in Android 4.3.
+  # Assume that memchr works on platforms that lack mprotect.
+  AC_CACHE_CHECK([whether memchr works], [gl_cv_func_memchr_works],
+    [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <string.h>
 #if HAVE_SYS_MMAN_H
 # include <fcntl.h>
@@ -64,6 +59,7 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
 #endif
   if (fence)
     {
+      /* Test against bugs on glibc systems.  */
       if (memchr (fence, 0, 0))
         result |= 1;
       strcpy (fence - 9, "12345678");
@@ -71,15 +67,37 @@ AC_DEFUN_ONCE([gl_FUNC_MEMCHR],
         result |= 2;
       if (memchr (fence - 1, 0, 3) != fence - 1)
         result |= 4;
+      /* Test against bug on AIX 7.2.  */
+      if (memchr (fence - 4, '6', 16) != fence - 4)
+        result |= 8;
     }
+  /* Test against bug on Android 4.3.  */
+  {
+    char input[3];
+    input[0] = 'a';
+    input[1] = 'b';
+    input[2] = 'c';
+    if (memchr (input, 0x789abc00 | 'b', 3) != input + 1)
+      result |= 16;
+  }
   return result;
-]])], [gl_cv_func_memchr_works=yes], [gl_cv_func_memchr_works=no],
-      [dnl Be pessimistic for now.
-       gl_cv_func_memchr_works="guessing no"])])
-    if test "$gl_cv_func_memchr_works" != yes; then
-      REPLACE_MEMCHR=1
-    fi
-  fi
+]])],
+       [gl_cv_func_memchr_works=yes],
+       [gl_cv_func_memchr_works=no],
+       [case "$host_os" in
+                           # Guess no on Android.
+          linux*-android*) gl_cv_func_memchr_works="guessing no" ;;
+                           # Guess yes on native Windows.
+          mingw*)          gl_cv_func_memchr_works="guessing yes" ;;
+                           # If we don't know, obey --enable-cross-guesses.
+          *)               gl_cv_func_memchr_works="$gl_cross_guess_normal" ;;
+        esac
+       ])
+    ])
+  case "$gl_cv_func_memchr_works" in
+    *yes) ;;
+    *) REPLACE_MEMCHR=1 ;;
+  esac
 ])
 
 # Prerequisites of lib/memchr.c.
diff --git a/m4/mempcpy.m4 b/m4/mempcpy.m4
new file mode 100644 (file)
index 0000000..f9d9ec8
--- /dev/null
@@ -0,0 +1,26 @@
+# mempcpy.m4 serial 12
+dnl Copyright (C) 2003-2004, 2006-2007, 2009-2021 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MEMPCPY],
+[
+  dnl Persuade glibc <string.h> to declare mempcpy().
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  dnl The mempcpy() declaration in lib/string.in.h uses 'restrict'.
+  AC_REQUIRE([AC_C_RESTRICT])
+
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
+  AC_CHECK_FUNCS([mempcpy])
+  if test $ac_cv_func_mempcpy = no; then
+    HAVE_MEMPCPY=0
+  fi
+])
+
+# Prerequisites of lib/mempcpy.c.
+AC_DEFUN([gl_PREREQ_MEMPCPY], [
+  :
+])
diff --git a/m4/memrchr.m4 b/m4/memrchr.m4
new file mode 100644 (file)
index 0000000..40f61c5
--- /dev/null
@@ -0,0 +1,23 @@
+# memrchr.m4 serial 11
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_MEMRCHR],
+[
+  dnl Persuade glibc <string.h> to declare memrchr().
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
+  AC_CHECK_DECLS_ONCE([memrchr])
+  if test $ac_cv_have_decl_memrchr = no; then
+    HAVE_DECL_MEMRCHR=0
+  fi
+
+  AC_CHECK_FUNCS([memrchr])
+])
+
+# Prerequisites of lib/memrchr.c.
+AC_DEFUN([gl_PREREQ_MEMRCHR], [:])
index 9c43e64..e21a687 100644 (file)
@@ -1,5 +1,5 @@
 # minmax.m4 serial 4
-dnl Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/mkdir.m4 b/m4/mkdir.m4
new file mode 100644 (file)
index 0000000..031fd29
--- /dev/null
@@ -0,0 +1,87 @@
+# serial 17
+
+# Copyright (C) 2001, 2003-2004, 2006, 2008-2021 Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# On some systems, mkdir ("foo/", 0700) fails because of the trailing slash.
+# On others, mkdir ("foo/./", 0700) mistakenly succeeds.
+# On such systems, arrange to use a wrapper function.
+AC_DEFUN([gl_FUNC_MKDIR],
+[dnl
+  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CHECK_HEADERS_ONCE([unistd.h])
+  AC_CACHE_CHECK([whether mkdir handles trailing slash],
+    [gl_cv_func_mkdir_trailing_slash_works],
+    [rm -rf conftest.dir
+     AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM([[
+          #include <sys/types.h>
+          #include <sys/stat.h>
+          ]GL_MDA_DEFINES],
+          [[return mkdir ("conftest.dir/", 0700);]])],
+       [gl_cv_func_mkdir_trailing_slash_works=yes],
+       [gl_cv_func_mkdir_trailing_slash_works=no],
+       [case "$host_os" in
+                           # Guess yes on Linux systems.
+          linux-* | linux) gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+                           # Guess yes on glibc systems.
+          *-gnu* | gnu*)   gl_cv_func_mkdir_trailing_slash_works="guessing yes" ;;
+                           # Guess yes on MSVC, no on mingw.
+          mingw*)          AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+                             ],
+                             [gl_cv_func_mkdir_trailing_slash_works="guessing yes"],
+                             [gl_cv_func_mkdir_trailing_slash_works="guessing no"])
+                           ;;
+                           # If we don't know, obey --enable-cross-guesses.
+          *)               gl_cv_func_mkdir_trailing_slash_works="$gl_cross_guess_normal" ;;
+        esac
+       ])
+     rm -rf conftest.dir
+    ])
+  case "$gl_cv_func_mkdir_trailing_slash_works" in
+    *yes) ;;
+    *)
+      REPLACE_MKDIR=1
+      ;;
+  esac
+
+  AC_CACHE_CHECK([whether mkdir handles trailing dot],
+    [gl_cv_func_mkdir_trailing_dot_works],
+    [rm -rf conftest.dir
+     AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM([[
+          #include <sys/types.h>
+          #include <sys/stat.h>
+          ]GL_MDA_DEFINES],
+          [[return !mkdir ("conftest.dir/./", 0700);]])],
+       [gl_cv_func_mkdir_trailing_dot_works=yes],
+       [gl_cv_func_mkdir_trailing_dot_works=no],
+       [case "$host_os" in
+                         # Guess yes on glibc systems.
+          *-gnu* | gnu*) gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
+                         # Guess yes on musl systems.
+          *-musl*)       gl_cv_func_mkdir_trailing_dot_works="guessing yes" ;;
+                         # Guess no on native Windows.
+          mingw*)        gl_cv_func_mkdir_trailing_dot_works="guessing no" ;;
+                         # If we don't know, obey --enable-cross-guesses.
+          *)             gl_cv_func_mkdir_trailing_dot_works="$gl_cross_guess_normal" ;;
+        esac
+       ])
+     rm -rf conftest.dir
+    ]
+  )
+  case "$gl_cv_func_mkdir_trailing_dot_works" in
+    *yes) ;;
+    *)
+      REPLACE_MKDIR=1
+      AC_DEFINE([FUNC_MKDIR_DOT_BUG], [1], [Define to 1 if mkdir mistakenly
+        creates a directory given with a trailing dot component.])
+      ;;
+  esac
+])
index a2edd39..9f4816c 100644 (file)
@@ -1,5 +1,5 @@
 # mkdtemp.m4 serial 8
-dnl Copyright (C) 2001-2003, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2001-2003, 2006-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index 131e4a7..9318fa6 100644 (file)
@@ -1,6 +1,6 @@
-#serial 23
+#serial 28
 
-# Copyright (C) 2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003-2007, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -26,7 +26,8 @@ AC_DEFUN([gl_FUNC_MKSTEMP],
         mkdir conftest.mkstemp
         AC_RUN_IFELSE(
           [AC_LANG_PROGRAM(
-            [AC_INCLUDES_DEFAULT],
+            [AC_INCLUDES_DEFAULT
+             GL_MDA_DEFINES],
             [[int result = 0;
               int i;
               off_t large = (off_t) 4294967295u;
@@ -57,10 +58,14 @@ AC_DEFUN([gl_FUNC_MKSTEMP],
           [gl_cv_func_working_mkstemp=yes],
           [gl_cv_func_working_mkstemp=no],
           [case "$host_os" in
-                     # Guess yes on glibc systems.
-             *-gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
-                     # If we don't know, assume the worst.
-             *)      gl_cv_func_working_mkstemp="guessing no" ;;
+                            # Guess yes on glibc systems.
+             *-gnu* | gnu*) gl_cv_func_working_mkstemp="guessing yes" ;;
+                            # Guess yes on musl systems.
+             *-musl*)       gl_cv_func_working_mkstemp="guessing yes" ;;
+                            # Guess no on native Windows.
+             mingw*)        gl_cv_func_working_mkstemp="guessing no" ;;
+                            # If we don't know, obey --enable-cross-guesses.
+             *)             gl_cv_func_working_mkstemp="$gl_cross_guess_normal" ;;
            esac
           ])
         rm -rf conftest.mkstemp
index 853c89d..e47aa2d 100644 (file)
@@ -1,5 +1,5 @@
-# mmap-anon.m4 serial 10
-dnl Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+# mmap-anon.m4 serial 12
+dnl Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,11 +9,11 @@ dnl with or without modifications, as long as this notice is preserved.
 # - On Linux, AIX, OSF/1, Solaris, Cygwin, Interix, Haiku, both MAP_ANONYMOUS
 #   and MAP_ANON exist and have the same value.
 # - On HP-UX, only MAP_ANONYMOUS exists.
-# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, only MAP_ANON exists.
+# - On Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, only MAP_ANON exists.
 # - On IRIX, neither exists, and a file descriptor opened to /dev/zero must be
 #   used.
 
-AC_DEFUN([gl_FUNC_MMAP_ANON],
+AC_DEFUN_ONCE([gl_FUNC_MMAP_ANON],
 [
   dnl Persuade glibc <sys/mman.h> to define MAP_ANONYMOUS.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
index 0cd40db..3bd4b89 100644 (file)
@@ -1,5 +1,5 @@
 # mode_t.m4 serial 2
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index f5e4c89..3ba5b4e 100644 (file)
@@ -1,5 +1,5 @@
 # msvc-inval.m4 serial 1
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 58f5c0b..aae25ce 100644 (file)
@@ -1,5 +1,5 @@
 # msvc-nothrow.m4 serial 1
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 43b5d05..f1678d9 100644 (file)
@@ -1,5 +1,5 @@
-# multiarch.m4 serial 7
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# multiarch.m4 serial 9
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -21,37 +21,40 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN_ONCE([gl_MULTIARCH],
 [
   dnl Code similar to autoconf-2.63 AC_C_BIGENDIAN.
-  gl_cv_c_multiarch=no
-  AC_COMPILE_IFELSE(
-    [AC_LANG_SOURCE(
-      [[#ifndef __APPLE_CC__
-         not a universal capable compiler
-        #endif
-        typedef int dummy;
-      ]])],
-    [
-     dnl Check for potential -arch flags.  It is not universal unless
-     dnl there are at least two -arch flags with different values.
-     arch=
-     prev=
-     for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
-       if test -n "$prev"; then
-         case $word in
-           i?86 | x86_64 | ppc | ppc64)
-             if test -z "$arch" || test "$arch" = "$word"; then
-               arch="$word"
-             else
-               gl_cv_c_multiarch=yes
-             fi
-             ;;
-         esac
-         prev=
-       else
-         if test "x$word" = "x-arch"; then
-           prev=arch
-         fi
-       fi
-     done
+  AC_CACHE_CHECK([whether the compiler produces multi-arch binaries],
+    [gl_cv_c_multiarch],
+    [gl_cv_c_multiarch=no
+     AC_COMPILE_IFELSE(
+       [AC_LANG_SOURCE(
+         [[#ifndef __APPLE_CC__
+            not a universal capable compiler
+           #endif
+           typedef int dummy;
+         ]])],
+       [
+        dnl Check for potential -arch flags.  It is not universal unless
+        dnl there are at least two -arch flags with different values.
+        arch=
+        prev=
+        for word in ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}; do
+          if test -n "$prev"; then
+            case $word in
+              i?86 | x86_64 | ppc | ppc64 | arm | arm64)
+                if test -z "$arch" || test "$arch" = "$word"; then
+                  arch="$word"
+                else
+                  gl_cv_c_multiarch=yes
+                fi
+                ;;
+            esac
+            prev=
+          else
+            if test "x$word" = "x-arch"; then
+              prev=arch
+            fi
+          fi
+        done
+       ])
     ])
   if test $gl_cv_c_multiarch = yes; then
     APPLE_UNIVERSAL_BUILD=1
diff --git a/m4/musl.m4 b/m4/musl.m4
new file mode 100644 (file)
index 0000000..60bd62a
--- /dev/null
@@ -0,0 +1,18 @@
+# musl.m4 serial 3
+dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Test for musl libc, despite the musl libc authors don't like it
+# <https://wiki.musl-libc.org/faq.html>
+# <https://lists.gnu.org/archive/html/bug-gnulib/2018-02/msg00079.html>.
+# From Bruno Haible.
+
+AC_DEFUN_ONCE([gl_MUSL_LIBC],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    *-musl*) AC_DEFINE([MUSL_LIBC], [1], [Define to 1 on musl libc.]) ;;
+  esac
+])
diff --git a/m4/nanosleep.m4 b/m4/nanosleep.m4
new file mode 100644 (file)
index 0000000..baebe88
--- /dev/null
@@ -0,0 +1,161 @@
+# serial 40
+
+dnl From Jim Meyering.
+dnl Check for the nanosleep function.
+dnl If not found, use the supplied replacement.
+dnl
+
+# Copyright (C) 1999-2001, 2003-2021 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_NANOSLEEP],
+[
+ AC_REQUIRE([gl_TIME_H_DEFAULTS])
+ AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+ dnl Persuade glibc and Solaris <time.h> to declare nanosleep.
+ AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+ AC_CHECK_HEADERS_ONCE([sys/time.h])
+ AC_REQUIRE([gl_FUNC_SELECT])
+
+ AC_CHECK_DECLS_ONCE([alarm])
+
+ nanosleep_save_libs=$LIBS
+
+ # Solaris 2.5.1 needs -lposix4 to get the nanosleep function.
+ # Solaris 7 prefers the library name -lrt to the obsolescent name -lposix4.
+ LIB_NANOSLEEP=
+ AC_SUBST([LIB_NANOSLEEP])
+ AC_SEARCH_LIBS([nanosleep], [rt posix4],
+                [test "$ac_cv_search_nanosleep" = "none required" ||
+                 LIB_NANOSLEEP=$ac_cv_search_nanosleep])
+ if test "x$ac_cv_search_nanosleep" != xno; then
+   dnl The system has a nanosleep function.
+
+   AC_REQUIRE([gl_MULTIARCH])
+   if test $APPLE_UNIVERSAL_BUILD = 1; then
+     # A universal build on Apple Mac OS X platforms.
+     # The test result would be 'no (mishandles large arguments)' in 64-bit
+     # mode but 'yes' in 32-bit mode. But we need a configuration result that
+     # is valid in both modes.
+     gl_cv_func_nanosleep='no (mishandles large arguments)'
+   fi
+
+   AC_CACHE_CHECK([for working nanosleep],
+    [gl_cv_func_nanosleep],
+    [
+     AC_RUN_IFELSE(
+       [AC_LANG_SOURCE([[
+          #include <errno.h>
+          #include <limits.h>
+          #include <signal.h>
+          #if HAVE_SYS_TIME_H
+           #include <sys/time.h>
+          #endif
+          #include <time.h>
+          #include <unistd.h>
+          #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+          #define TYPE_MAXIMUM(t) \
+            ((t) (! TYPE_SIGNED (t) \
+                  ? (t) -1 \
+                  : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1)))
+
+          #if HAVE_DECL_ALARM
+          static void
+          check_for_SIGALRM (int sig)
+          {
+            if (sig != SIGALRM)
+              _exit (1);
+          }
+          #endif
+
+          int
+          main ()
+          {
+            static struct timespec ts_sleep;
+            static struct timespec ts_remaining;
+            /* Test for major problems first.  */
+            if (! nanosleep)
+              return 2;
+            ts_sleep.tv_sec = 0;
+            ts_sleep.tv_nsec = 1;
+            #if HAVE_DECL_ALARM
+            {
+              static struct sigaction act;
+              act.sa_handler = check_for_SIGALRM;
+              sigemptyset (&act.sa_mask);
+              sigaction (SIGALRM, &act, NULL);
+              alarm (1);
+              if (nanosleep (&ts_sleep, NULL) != 0)
+                return 3;
+              /* Test for a minor problem: the handling of large arguments.  */
+              ts_sleep.tv_sec = TYPE_MAXIMUM (time_t);
+              ts_sleep.tv_nsec = 999999999;
+              alarm (1);
+              if (nanosleep (&ts_sleep, &ts_remaining) != -1)
+                return 4;
+              if (errno != EINTR)
+                return 5;
+              if (ts_remaining.tv_sec <= TYPE_MAXIMUM (time_t) - 10)
+                return 6;
+            }
+            #else /* A simpler test for native Windows.  */
+            if (nanosleep (&ts_sleep, &ts_remaining) < 0)
+              return 3;
+            #endif
+            return 0;
+          }]])],
+       [gl_cv_func_nanosleep=yes],
+       [case $? in dnl (
+        4|5|6) gl_cv_func_nanosleep='no (mishandles large arguments)';; dnl (
+        *)   gl_cv_func_nanosleep=no;;
+        esac],
+       [case "$host_os" in dnl ((
+          linux*) # Guess it halfway works when the kernel is Linux.
+            gl_cv_func_nanosleep='guessing no (mishandles large arguments)' ;;
+          mingw*) # Guess no on native Windows.
+            gl_cv_func_nanosleep='guessing no' ;;
+          *)      # If we don't know, obey --enable-cross-guesses.
+            gl_cv_func_nanosleep="$gl_cross_guess_normal" ;;
+        esac
+       ])
+    ])
+   case "$gl_cv_func_nanosleep" in
+     *yes)
+       REPLACE_NANOSLEEP=0
+       ;;
+     *)
+       REPLACE_NANOSLEEP=1
+       case "$gl_cv_func_nanosleep" in
+         *"mishandles large arguments"*)
+           AC_DEFINE([HAVE_BUG_BIG_NANOSLEEP], [1],
+             [Define to 1 if nanosleep mishandles large arguments.])
+           ;;
+         *)
+           # The replacement uses select(). Add $LIBSOCKET to $LIB_NANOSLEEP.
+           for ac_lib in $LIBSOCKET; do
+             case " $LIB_NANOSLEEP " in
+               *" $ac_lib "*) ;;
+               *) LIB_NANOSLEEP="$LIB_NANOSLEEP $ac_lib";;
+             esac
+           done
+           ;;
+       esac
+       ;;
+   esac
+ else
+   HAVE_NANOSLEEP=0
+ fi
+ LIBS=$nanosleep_save_libs
+])
+
+# Prerequisites of lib/nanosleep.c.
+AC_DEFUN([gl_PREREQ_NANOSLEEP],
+[
+  AC_CHECK_HEADERS_ONCE([sys/select.h])
+  gl_PREREQ_SIG_HANDLER_H
+])
diff --git a/m4/netinet_in_h.m4 b/m4/netinet_in_h.m4
new file mode 100644 (file)
index 0000000..c555596
--- /dev/null
@@ -0,0 +1,31 @@
+# netinet_in_h.m4 serial 5
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_HEADER_NETINET_IN],
+[
+  AC_CACHE_CHECK([whether <netinet/in.h> is self-contained],
+    [gl_cv_header_netinet_in_h_selfcontained],
+    [
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>]], [[]])],
+        [gl_cv_header_netinet_in_h_selfcontained=yes],
+        [gl_cv_header_netinet_in_h_selfcontained=no])
+    ])
+  if test $gl_cv_header_netinet_in_h_selfcontained = yes; then
+    NETINET_IN_H=''
+  else
+    NETINET_IN_H='netinet/in.h'
+    AC_CHECK_HEADERS([netinet/in.h])
+    gl_CHECK_NEXT_HEADERS([netinet/in.h])
+    if test $ac_cv_header_netinet_in_h = yes; then
+      HAVE_NETINET_IN_H=1
+    else
+      HAVE_NETINET_IN_H=0
+    fi
+    AC_SUBST([HAVE_NETINET_IN_H])
+  fi
+  AC_SUBST([NETINET_IN_H])
+  AM_CONDITIONAL([GL_GENERATE_NETINET_IN_H], [test -n "$NETINET_IN_H"])
+])
index a2f7196..6ad32c8 100644 (file)
@@ -1,5 +1,5 @@
-# nl_langinfo.m4 serial 5
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# nl_langinfo.m4 serial 8
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,10 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
   AC_REQUIRE([gl_LANGINFO_H_DEFAULTS])
   AC_REQUIRE([gl_LANGINFO_H])
   AC_CHECK_FUNCS_ONCE([nl_langinfo])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
+  AC_REQUIRE([gl_PTHREADLIB])
+  AC_CHECK_HEADERS_ONCE([threads.h])
   if test $ac_cv_func_nl_langinfo = yes; then
     # On Irix 6.5, YESEXPR is defined, but nl_langinfo(YESEXPR) is broken.
     AC_CACHE_CHECK([whether YESEXPR works],
@@ -36,8 +39,19 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
     AC_DEFINE_UNQUOTED([FUNC_NL_LANGINFO_YESEXPR_WORKS],
       [$FUNC_NL_LANGINFO_YESEXPR_WORKS],
       [Define to 1 if nl_langinfo (YESEXPR) returns a non-empty string.])
-    if test $HAVE_LANGINFO_CODESET = 1 && test $HAVE_LANGINFO_ERA = 1 \
-        && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1; then
+    # On Solaris 10 and Solaris 11.3, nl_langinfo is not multithread-safe.
+    case "$host_os" in
+      solaris*) NL_LANGINFO_MTSAFE=0 ;;
+      *)        NL_LANGINFO_MTSAFE=1 ;;
+    esac
+    AC_DEFINE_UNQUOTED([NL_LANGINFO_MTSAFE], [$NL_LANGINFO_MTSAFE],
+      [Define to 1 if nl_langinfo is multithread-safe.])
+    if test $HAVE_LANGINFO_CODESET = 1 \
+       && test $HAVE_LANGINFO_T_FMT_AMPM = 1 \
+       && test $HAVE_LANGINFO_ALTMON = 1 \
+       && test $HAVE_LANGINFO_ERA = 1 \
+       && test $FUNC_NL_LANGINFO_YESEXPR_WORKS = 1 \
+       && test $NL_LANGINFO_MTSAFE = 1; then
       :
     else
       REPLACE_NL_LANGINFO=1
@@ -47,4 +61,17 @@ AC_DEFUN([gl_FUNC_NL_LANGINFO],
   else
     HAVE_NL_LANGINFO=0
   fi
+  if test $HAVE_NL_LANGINFO = 0 || test $HAVE_LANGINFO_CODESET = 0; then
+    LIB_NL_LANGINFO="$LIB_SETLOCALE_NULL"
+  else
+    LIB_NL_LANGINFO=
+  fi
+  dnl LIB_NL_LANGINFO is expected to be empty everywhere.
+  AC_SUBST([LIB_NL_LANGINFO])
+])
+
+# Prerequisites of lib/nl_langinfo-lock.c.
+AC_DEFUN([gl_PREREQ_NL_LANGINFO_LOCK],
+[
+  gl_VISIBILITY
 ])
diff --git a/m4/nls.m4 b/m4/nls.m4
new file mode 100644 (file)
index 0000000..53cdc8b
--- /dev/null
+++ b/m4/nls.m4
@@ -0,0 +1,32 @@
+# nls.m4 serial 5 (gettext-0.18)
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation,
+dnl Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ([2.50])
+
+AC_DEFUN([AM_NLS],
+[
+  AC_MSG_CHECKING([whether NLS is requested])
+  dnl Default is enabled NLS
+  AC_ARG_ENABLE([nls],
+    [  --disable-nls           do not use Native Language Support],
+    USE_NLS=$enableval, USE_NLS=yes)
+  AC_MSG_RESULT([$USE_NLS])
+  AC_SUBST([USE_NLS])
+])
index d8dd8f1..27412cd 100644 (file)
@@ -1,5 +1,5 @@
-# nocrash.m4 serial 4
-dnl Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+# nocrash.m4 serial 5
+dnl Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -53,7 +53,7 @@ nocrash_init (void)
   /* Allocate a port on which the thread shall listen for exceptions.  */
   if (mach_port_allocate (self, MACH_PORT_RIGHT_RECEIVE, &our_exception_port)
       == KERN_SUCCESS) {
-    /* See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
+    /* See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/mach_port_insert_right.html.  */
     if (mach_port_insert_right (self, our_exception_port, our_exception_port,
                                 MACH_MSG_TYPE_MAKE_SEND)
         == KERN_SUCCESS) {
@@ -72,14 +72,14 @@ nocrash_init (void)
            for a particular thread.  This has the effect that when our exception
            port gets the message, the thread specific exception port has already
            been asked, and we don't need to bother about it.
-           See http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
+           See https://web.mit.edu/darwin/src/modules/xnu/osfmk/man/task_set_exception_ports.html.  */
         task_set_exception_ports (self, mask, our_exception_port,
                                   EXCEPTION_DEFAULT, MACHINE_THREAD_STATE);
       }
     }
   }
 }
-#elif (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#elif defined _WIN32 && ! defined __CYGWIN__
 /* Avoid a crash on native Windows.  */
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
index 98ca5f9..e363d01 100644 (file)
@@ -1,6 +1,6 @@
 # See if we need to provide obstacks.
 
-dnl Copyright 1996-2016 Free Software Foundation, Inc.
+dnl Copyright 1996-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 282751b..bdec43c 100644 (file)
@@ -1,5 +1,5 @@
 # off_t.m4 serial 1
-dnl Copyright (C) 2012-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2012-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/open-cloexec.m4 b/m4/open-cloexec.m4
new file mode 100644 (file)
index 0000000..542a90f
--- /dev/null
@@ -0,0 +1,21 @@
+# Test whether O_CLOEXEC is defined.
+
+dnl Copyright 2017-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_PREPROC_O_CLOEXEC],
+[
+  AC_CACHE_CHECK([for O_CLOEXEC],
+    [gl_cv_macro_O_CLOEXEC],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM([[#include <fcntl.h>
+                          #ifndef O_CLOEXEC
+                            choke me;
+                          #endif
+                        ]],
+                        [[return O_CLOEXEC;]])],
+       [gl_cv_macro_O_CLOEXEC=yes],
+       [gl_cv_macro_O_CLOEXEC=no])])
+])
diff --git a/m4/open-slash.m4 b/m4/open-slash.m4
new file mode 100644 (file)
index 0000000..e619039
--- /dev/null
@@ -0,0 +1,60 @@
+# open-slash.m4 serial 2
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Tests whether open() and creat() recognize a trailing slash.
+dnl Sets gl_cv_func_open_slash.
+AC_DEFUN([gl_OPEN_TRAILING_SLASH_BUG],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  dnl open("foo/") should not create a file when the file name has a
+  dnl trailing slash.  FreeBSD only has the problem on symlinks.
+  AC_CHECK_FUNCS_ONCE([lstat])
+  AC_CACHE_CHECK([whether open recognizes a trailing slash],
+    [gl_cv_func_open_slash],
+    [# Assume that if we have lstat, we can also check symlinks.
+     if test $ac_cv_func_lstat = yes; then
+       touch conftest.tmp
+       ln -s conftest.tmp conftest.lnk
+     fi
+     AC_RUN_IFELSE(
+       [AC_LANG_SOURCE([[
+#include <fcntl.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+]GL_MDA_DEFINES[
+int main ()
+{
+  int result = 0;
+#if HAVE_LSTAT
+  if (open ("conftest.lnk/", O_RDONLY) != -1)
+    result |= 1;
+#endif
+  if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
+    result |= 2;
+  return result;
+}]])],
+       [gl_cv_func_open_slash=yes],
+       [gl_cv_func_open_slash=no],
+       [
+changequote(,)dnl
+        case "$host_os" in
+          freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
+            gl_cv_func_open_slash="guessing no" ;;
+          *)
+            gl_cv_func_open_slash="guessing yes" ;;
+        esac
+changequote([,])dnl
+       ])
+     rm -f conftest.sl conftest.tmp conftest.lnk
+    ])
+  case "$gl_cv_func_open_slash" in
+    *no)
+      AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
+        [Define to 1 if open() fails to recognize a trailing slash.])
+      ;;
+  esac
+])
index 53d3038..c634386 100644 (file)
@@ -1,5 +1,5 @@
-# open.m4 serial 14
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# open.m4 serial 15
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_OPEN],
 [
   AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_PREPROC_O_CLOEXEC])
   case "$host_os" in
     mingw* | pw*)
       REPLACE_OPEN=1
@@ -15,48 +16,12 @@ AC_DEFUN([gl_FUNC_OPEN],
       dnl open("foo/") should not create a file when the file name has a
       dnl trailing slash.  FreeBSD only has the problem on symlinks.
       AC_CHECK_FUNCS_ONCE([lstat])
-      AC_CACHE_CHECK([whether open recognizes a trailing slash],
-        [gl_cv_func_open_slash],
-        [# Assume that if we have lstat, we can also check symlinks.
-          if test $ac_cv_func_lstat = yes; then
-            touch conftest.tmp
-            ln -s conftest.tmp conftest.lnk
-          fi
-          AC_RUN_IFELSE(
-            [AC_LANG_SOURCE([[
-#include <fcntl.h>
-#if HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-int main ()
-{
-  int result = 0;
-#if HAVE_LSTAT
-  if (open ("conftest.lnk/", O_RDONLY) != -1)
-    result |= 1;
-#endif
-  if (open ("conftest.sl/", O_CREAT, 0600) >= 0)
-    result |= 2;
-  return result;
-}]])],
-            [gl_cv_func_open_slash=yes],
-            [gl_cv_func_open_slash=no],
-            [
-changequote(,)dnl
-             case "$host_os" in
-               freebsd* | aix* | hpux* | solaris2.[0-9] | solaris2.[0-9].*)
-                 gl_cv_func_open_slash="guessing no" ;;
-               *)
-                 gl_cv_func_open_slash="guessing yes" ;;
-             esac
-changequote([,])dnl
-            ])
-          rm -f conftest.sl conftest.tmp conftest.lnk
-        ])
+      if test "$gl_cv_macro_O_CLOEXEC" != yes; then
+        REPLACE_OPEN=1
+      fi
+      gl_OPEN_TRAILING_SLASH_BUG
       case "$gl_cv_func_open_slash" in
         *no)
-          AC_DEFINE([OPEN_TRAILING_SLASH_BUG], [1],
-            [Define to 1 if open() fails to recognize a trailing slash.])
           REPLACE_OPEN=1
           ;;
       esac
diff --git a/m4/openat.m4 b/m4/openat.m4
new file mode 100644 (file)
index 0000000..eba0f51
--- /dev/null
@@ -0,0 +1,38 @@
+# serial 46
+# See if we need to use our replacement for Solaris' openat et al functions.
+
+dnl Copyright (C) 2004-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Written by Jim Meyering.
+
+AC_DEFUN([gl_FUNC_OPENAT],
+[
+  AC_REQUIRE([gl_FCNTL_H_DEFAULTS])
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_CHECK_FUNCS_ONCE([openat])
+  AC_REQUIRE([gl_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK])
+  AC_REQUIRE([gl_PREPROC_O_CLOEXEC])
+  case $ac_cv_func_openat+$gl_cv_func_lstat_dereferences_slashed_symlink+$gl_cv_macro_O_CLOEXEC in
+  yes+*yes+yes)
+    ;;
+  yes+*)
+    # Solaris 10 lacks O_CLOEXEC.
+    # Solaris 9 has *at functions, but uniformly mishandles trailing
+    # slash in all of them.
+    REPLACE_OPENAT=1
+    ;;
+  *)
+    HAVE_OPENAT=0
+    ;;
+  esac
+])
+
+# Prerequisites of lib/openat.c.
+AC_DEFUN([gl_PREREQ_OPENAT],
+[
+  AC_REQUIRE([gl_PROMOTED_TYPE_MODE_T])
+  :
+])
index ffaa6ae..517edae 100644 (file)
@@ -1,5 +1,5 @@
-# opendir.m4 serial 4
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# opendir.m4 serial 5
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_OPENDIR],
 [
   AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
   AC_CHECK_FUNCS([opendir])
   if test $ac_cv_func_opendir = no; then
index 6f8e59a..e67c656 100644 (file)
@@ -1,5 +1,5 @@
-# pathmax.m4 serial 10
-dnl Copyright (C) 2002-2003, 2005-2006, 2009-2016 Free Software Foundation,
+# pathmax.m4 serial 11
+dnl Copyright (C) 2002-2003, 2005-2006, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -29,7 +29,7 @@ AC_DEFUN([gl_PATHMAX_SNIPPET], [[
 # undef PATH_MAX
 # define PATH_MAX 1024
 #endif
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # undef PATH_MAX
 # define PATH_MAX 260
 #endif
diff --git a/m4/perror.m4 b/m4/perror.m4
new file mode 100644 (file)
index 0000000..9f2ac2d
--- /dev/null
@@ -0,0 +1,71 @@
+# perror.m4 serial 9
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_PERROR],
+[
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  AC_REQUIRE([gl_HEADER_ERRNO_H])
+  AC_REQUIRE([gl_FUNC_STRERROR_R])
+  AC_REQUIRE([gl_FUNC_STRERROR_0])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  dnl We intentionally do not check for the broader REPLACE_STRERROR_R,
+  dnl since on glibc systems, strerror_r is replaced only for signature
+  dnl issues, and perror is just fine.  Rather, we only want to
+  dnl replace perror if strerror_r was replaced for a content fix.
+  if test "$ERRNO_H:$REPLACE_STRERROR_0" != :0; then
+    dnl The system's perror() cannot know about the new errno values we add
+    dnl to <errno.h>, or any fix for strerror(0). Replace it.
+    REPLACE_PERROR=1
+  fi
+  case ${gl_cv_func_strerror_r_works-unset} in
+    unset|*yes)
+      AC_CACHE_CHECK([whether perror matches strerror],
+        [gl_cv_func_perror_works],
+        [AC_RUN_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <errno.h>
+                #include <stdio.h>
+                #include <stdlib.h>
+                #include <string.h>
+              ]],
+              [[char *str = strerror (-1);
+                if (!getenv("CONFTEST_OUTPUT")) return 0;
+                if (!str) str = "";
+                puts (str);
+                errno = -1;
+                perror ("");
+                return 0;
+              ]])],
+           [if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \
+               && cmp conftest.txt1 conftest.txt2 >/dev/null; then
+              gl_cv_func_perror_works=yes
+            else
+              gl_cv_func_perror_works=no
+            fi
+            rm -rf conftest.txt1 conftest.txt2],
+           [gl_cv_func_perror_works=no],
+           [case "$host_os" in
+                       # Guess yes on musl systems.
+              *-musl*) gl_cv_func_perror_works="guessing yes" ;;
+                       # Guess yes on native Windows.
+              mingw*)  gl_cv_func_perror_works="guessing yes" ;;
+                       # Otherwise obey --enable-cross-guesses.
+              *)       gl_cv_func_perror_works="$gl_cross_guess_normal" ;;
+            esac
+           ])
+        ])
+      case "$gl_cv_func_perror_works" in
+        *yes) ;;
+        *) REPLACE_PERROR=1 ;;
+      esac
+      ;;
+    *)
+      dnl The system's perror() probably inherits the bugs in the
+      dnl system's strerror_r(). Replace it.
+      REPLACE_PERROR=1
+      ;;
+  esac
+])
diff --git a/m4/pipe.m4 b/m4/pipe.m4
new file mode 100644 (file)
index 0000000..89d666d
--- /dev/null
@@ -0,0 +1,15 @@
+# pipe.m4 serial 2
+dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_PIPE],
+[
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+
+  AC_CHECK_FUNCS_ONCE([pipe])
+  if test $ac_cv_func_pipe != yes; then
+    HAVE_PIPE=0
+  fi
+])
index c09fcee..43d547c 100644 (file)
@@ -1,5 +1,5 @@
 # pipe2.m4 serial 2
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/po.m4 b/m4/po.m4
new file mode 100644 (file)
index 0000000..84659ea
--- /dev/null
+++ b/m4/po.m4
@@ -0,0 +1,453 @@
+# po.m4 serial 22 (gettext-0.19)
+dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1995-2000.
+dnl   Bruno Haible <haible@clisp.cons.org>, 2000-2003.
+
+AC_PREREQ([2.60])
+
+dnl Checks for all prerequisites of the po subdirectory.
+AC_DEFUN([AM_PO_SUBDIRS],
+[
+  AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+  AC_REQUIRE([AC_PROG_INSTALL])dnl
+  AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+  AC_REQUIRE([AC_PROG_SED])dnl
+  AC_REQUIRE([AM_NLS])dnl
+
+  dnl Release version of the gettext macros. This is used to ensure that
+  dnl the gettext macros and po/Makefile.in.in are in sync.
+  AC_SUBST([GETTEXT_MACRO_VERSION], [0.19])
+
+  dnl Perform the following tests also if --disable-nls has been given,
+  dnl because they are needed for "make dist" to work.
+
+  dnl Search for GNU msgfmt in the PATH.
+  dnl The first test excludes Solaris msgfmt and early GNU msgfmt versions.
+  dnl The second test excludes FreeBSD msgfmt.
+  AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
+    [$ac_dir/$ac_word --statistics /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+     (if $ac_dir/$ac_word --statistics /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+    :)
+  AC_PATH_PROG([GMSGFMT], [gmsgfmt], [$MSGFMT])
+
+  dnl Test whether it is GNU msgfmt >= 0.15.
+changequote(,)dnl
+  case `$MSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) MSGFMT_015=: ;;
+    *) MSGFMT_015=$MSGFMT ;;
+  esac
+changequote([,])dnl
+  AC_SUBST([MSGFMT_015])
+changequote(,)dnl
+  case `$GMSGFMT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) GMSGFMT_015=: ;;
+    *) GMSGFMT_015=$GMSGFMT ;;
+  esac
+changequote([,])dnl
+  AC_SUBST([GMSGFMT_015])
+
+  dnl Search for GNU xgettext 0.12 or newer in the PATH.
+  dnl The first test excludes Solaris xgettext and early GNU xgettext versions.
+  dnl The second test excludes FreeBSD xgettext.
+  AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
+    [$ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1 &&
+     (if $ac_dir/$ac_word --omit-header --copyright-holder= --msgid-bugs-address= /dev/null 2>&1 >/dev/null | grep usage >/dev/null; then exit 1; else exit 0; fi)],
+    :)
+  dnl Remove leftover from FreeBSD xgettext call.
+  rm -f messages.po
+
+  dnl Test whether it is GNU xgettext >= 0.15.
+changequote(,)dnl
+  case `$XGETTEXT --version | sed 1q | sed -e 's,^[^0-9]*,,'` in
+    '' | 0.[0-9] | 0.[0-9].* | 0.1[0-4] | 0.1[0-4].*) XGETTEXT_015=: ;;
+    *) XGETTEXT_015=$XGETTEXT ;;
+  esac
+changequote([,])dnl
+  AC_SUBST([XGETTEXT_015])
+
+  dnl Search for GNU msgmerge 0.11 or newer in the PATH.
+  AM_PATH_PROG_WITH_TEST(MSGMERGE, msgmerge,
+    [$ac_dir/$ac_word --update -q /dev/null /dev/null >&]AS_MESSAGE_LOG_FD[ 2>&1], :)
+
+  dnl Installation directories.
+  dnl Autoconf >= 2.60 defines localedir. For older versions of autoconf, we
+  dnl have to define it here, so that it can be used in po/Makefile.
+  test -n "$localedir" || localedir='${datadir}/locale'
+  AC_SUBST([localedir])
+
+  dnl Support for AM_XGETTEXT_OPTION.
+  test -n "${XGETTEXT_EXTRA_OPTIONS+set}" || XGETTEXT_EXTRA_OPTIONS=
+  AC_SUBST([XGETTEXT_EXTRA_OPTIONS])
+
+  AC_CONFIG_COMMANDS([po-directories], [[
+    for ac_file in $CONFIG_FILES; do
+      # Support "outfile[:infile[:infile...]]"
+      case "$ac_file" in
+        *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+      esac
+      # PO directories have a Makefile.in generated from Makefile.in.in.
+      case "$ac_file" in */Makefile.in)
+        # Adjust a relative srcdir.
+        ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+        ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
+        ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+        # In autoconf-2.13 it is called $ac_given_srcdir.
+        # In autoconf-2.50 it is called $srcdir.
+        test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+        case "$ac_given_srcdir" in
+          .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+          /*) top_srcdir="$ac_given_srcdir" ;;
+          *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
+        esac
+        # Treat a directory as a PO directory if and only if it has a
+        # POTFILES.in file. This allows packages to have multiple PO
+        # directories under different names or in different locations.
+        if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
+          rm -f "$ac_dir/POTFILES"
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
+          gt_tab=`printf '\t'`
+          cat "$ac_given_srcdir/$ac_dir/POTFILES.in" | sed -e "/^#/d" -e "/^[ ${gt_tab}]*\$/d" -e "s,.*,     $top_srcdir/& \\\\," | sed -e "\$s/\(.*\) \\\\/\1/" > "$ac_dir/POTFILES"
+          POMAKEFILEDEPS="POTFILES.in"
+          # ALL_LINGUAS, POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES depend
+          # on $ac_dir but don't depend on user-specified configuration
+          # parameters.
+          if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+            # The LINGUAS file contains the set of available languages.
+            if test -n "$OBSOLETE_ALL_LINGUAS"; then
+              test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+            fi
+            ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+            # Hide the ALL_LINGUAS assignment from automake < 1.5.
+            eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+            POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+          else
+            # The set of available languages was given in configure.in.
+            # Hide the ALL_LINGUAS assignment from automake < 1.5.
+            eval 'ALL_LINGUAS''=$OBSOLETE_ALL_LINGUAS'
+          fi
+          # Compute POFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+          # Compute UPDATEPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+          # Compute DUMMYPOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+          # Compute GMOFILES
+          # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+          case "$ac_given_srcdir" in
+            .) srcdirpre= ;;
+            *) srcdirpre='$(srcdir)/' ;;
+          esac
+          POFILES=
+          UPDATEPOFILES=
+          DUMMYPOFILES=
+          GMOFILES=
+          for lang in $ALL_LINGUAS; do
+            POFILES="$POFILES $srcdirpre$lang.po"
+            UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+            DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+            GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+          done
+          # CATALOGS depends on both $ac_dir and the user's LINGUAS
+          # environment variable.
+          INST_LINGUAS=
+          if test -n "$ALL_LINGUAS"; then
+            for presentlang in $ALL_LINGUAS; do
+              useit=no
+              if test "%UNSET%" != "$LINGUAS"; then
+                desiredlanguages="$LINGUAS"
+              else
+                desiredlanguages="$ALL_LINGUAS"
+              fi
+              for desiredlang in $desiredlanguages; do
+                # Use the presentlang catalog if desiredlang is
+                #   a. equal to presentlang, or
+                #   b. a variant of presentlang (because in this case,
+                #      presentlang can be used as a fallback for messages
+                #      which are not translated in the desiredlang catalog).
+                case "$desiredlang" in
+                  "$presentlang"*) useit=yes;;
+                esac
+              done
+              if test $useit = yes; then
+                INST_LINGUAS="$INST_LINGUAS $presentlang"
+              fi
+            done
+          fi
+          CATALOGS=
+          if test -n "$INST_LINGUAS"; then
+            for lang in $INST_LINGUAS; do
+              CATALOGS="$CATALOGS $lang.gmo"
+            done
+          fi
+          test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile"
+          sed -e "/^POTFILES =/r $ac_dir/POTFILES" -e "/^# Makevars/r $ac_given_srcdir/$ac_dir/Makevars" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@POMAKEFILEDEPS@|$POMAKEFILEDEPS|g" "$ac_dir/Makefile.in" > "$ac_dir/Makefile"
+          for f in "$ac_given_srcdir/$ac_dir"/Rules-*; do
+            if test -f "$f"; then
+              case "$f" in
+                *.orig | *.bak | *~) ;;
+                *) cat "$f" >> "$ac_dir/Makefile" ;;
+              esac
+            fi
+          done
+        fi
+        ;;
+      esac
+    done]],
+   [# Capture the value of obsolete ALL_LINGUAS because we need it to compute
+    # POFILES, UPDATEPOFILES, DUMMYPOFILES, GMOFILES, CATALOGS. But hide it
+    # from automake < 1.5.
+    eval 'OBSOLETE_ALL_LINGUAS''="$ALL_LINGUAS"'
+    # Capture the value of LINGUAS because we need it to compute CATALOGS.
+    LINGUAS="${LINGUAS-%UNSET%}"
+   ])
+])
+
+dnl Postprocesses a Makefile in a directory containing PO files.
+AC_DEFUN([AM_POSTPROCESS_PO_MAKEFILE],
+[
+  # When this code is run, in config.status, two variables have already been
+  # set:
+  # - OBSOLETE_ALL_LINGUAS is the value of LINGUAS set in configure.in,
+  # - LINGUAS is the value of the environment variable LINGUAS at configure
+  #   time.
+
+changequote(,)dnl
+  # Adjust a relative srcdir.
+  ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
+  ac_dir_suffix=/`echo "$ac_dir"|sed 's%^\./%%'`
+  ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
+  # In autoconf-2.13 it is called $ac_given_srcdir.
+  # In autoconf-2.50 it is called $srcdir.
+  test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
+  case "$ac_given_srcdir" in
+    .)  top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
+    /*) top_srcdir="$ac_given_srcdir" ;;
+    *)  top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  # Find a way to echo strings without interpreting backslash.
+  if test "X`(echo '\t') 2>/dev/null`" = 'X\t'; then
+    gt_echo='echo'
+  else
+    if test "X`(printf '%s\n' '\t') 2>/dev/null`" = 'X\t'; then
+      gt_echo='printf %s\n'
+    else
+      echo_func () {
+        cat <<EOT
+$*
+EOT
+      }
+      gt_echo='echo_func'
+    fi
+  fi
+
+  # A sed script that extracts the value of VARIABLE from a Makefile.
+  tab=`printf '\t'`
+  sed_x_variable='
+# Test if the hold space is empty.
+x
+s/P/P/
+x
+ta
+# Yes it was empty. Look if we have the expected variable definition.
+/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=/{
+  # Seen the first line of the variable definition.
+  s/^['"${tab}"' ]*VARIABLE['"${tab}"' ]*=//
+  ba
+}
+bd
+:a
+# Here we are processing a line from the variable definition.
+# Remove comment, more precisely replace it with a space.
+s/#.*$/ /
+# See if the line ends in a backslash.
+tb
+:b
+s/\\$//
+# Print the line, without the trailing backslash.
+p
+tc
+# There was no trailing backslash. The end of the variable definition is
+# reached. Clear the hold space.
+s/^.*$//
+x
+bd
+:c
+# A trailing backslash means that the variable definition continues in the
+# next line. Put a nonempty string into the hold space to indicate this.
+s/^.*$/P/
+x
+:d
+'
+changequote([,])dnl
+
+  # Set POTFILES to the value of the Makefile variable POTFILES.
+  sed_x_POTFILES=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/POTFILES/g'`
+  POTFILES=`sed -n -e "$sed_x_POTFILES" < "$ac_file"`
+  # Compute POTFILES_DEPS as
+  #   $(foreach file, $(POTFILES), $(top_srcdir)/$(file))
+  POTFILES_DEPS=
+  for file in $POTFILES; do
+    POTFILES_DEPS="$POTFILES_DEPS "'$(top_srcdir)/'"$file"
+  done
+  POMAKEFILEDEPS=""
+
+  if test -n "$OBSOLETE_ALL_LINGUAS"; then
+    test -n "$as_me" && echo "$as_me: setting ALL_LINGUAS in configure.in is obsolete" || echo "setting ALL_LINGUAS in configure.in is obsolete"
+  fi
+  if test -f "$ac_given_srcdir/$ac_dir/LINGUAS"; then
+    # The LINGUAS file contains the set of available languages.
+    ALL_LINGUAS_=`sed -e "/^#/d" -e "s/#.*//" "$ac_given_srcdir/$ac_dir/LINGUAS"`
+    POMAKEFILEDEPS="$POMAKEFILEDEPS LINGUAS"
+  else
+    # Set ALL_LINGUAS to the value of the Makefile variable LINGUAS.
+    sed_x_LINGUAS=`$gt_echo "$sed_x_variable" | sed -e '/^ *#/d' -e 's/VARIABLE/LINGUAS/g'`
+    ALL_LINGUAS_=`sed -n -e "$sed_x_LINGUAS" < "$ac_file"`
+  fi
+  # Hide the ALL_LINGUAS assignment from automake < 1.5.
+  eval 'ALL_LINGUAS''=$ALL_LINGUAS_'
+  # Compute POFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).po)
+  # Compute UPDATEPOFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).po-update)
+  # Compute DUMMYPOFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(lang).nop)
+  # Compute GMOFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).gmo)
+  # Compute PROPERTIESFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).properties)
+  # Compute CLASSFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(top_srcdir)/$(DOMAIN)_$(lang).class)
+  # Compute QMFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(lang).qm)
+  # Compute MSGFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang)).msg)
+  # Compute RESOURCESDLLFILES
+  # as      $(foreach lang, $(ALL_LINGUAS), $(srcdir)/$(frob $(lang))/$(DOMAIN).resources.dll)
+  case "$ac_given_srcdir" in
+    .) srcdirpre= ;;
+    *) srcdirpre='$(srcdir)/' ;;
+  esac
+  POFILES=
+  UPDATEPOFILES=
+  DUMMYPOFILES=
+  GMOFILES=
+  PROPERTIESFILES=
+  CLASSFILES=
+  QMFILES=
+  MSGFILES=
+  RESOURCESDLLFILES=
+  for lang in $ALL_LINGUAS; do
+    POFILES="$POFILES $srcdirpre$lang.po"
+    UPDATEPOFILES="$UPDATEPOFILES $lang.po-update"
+    DUMMYPOFILES="$DUMMYPOFILES $lang.nop"
+    GMOFILES="$GMOFILES $srcdirpre$lang.gmo"
+    PROPERTIESFILES="$PROPERTIESFILES \$(top_srcdir)/\$(DOMAIN)_$lang.properties"
+    CLASSFILES="$CLASSFILES \$(top_srcdir)/\$(DOMAIN)_$lang.class"
+    QMFILES="$QMFILES $srcdirpre$lang.qm"
+    frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+    MSGFILES="$MSGFILES $srcdirpre$frobbedlang.msg"
+    frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+    RESOURCESDLLFILES="$RESOURCESDLLFILES $srcdirpre$frobbedlang/\$(DOMAIN).resources.dll"
+  done
+  # CATALOGS depends on both $ac_dir and the user's LINGUAS
+  # environment variable.
+  INST_LINGUAS=
+  if test -n "$ALL_LINGUAS"; then
+    for presentlang in $ALL_LINGUAS; do
+      useit=no
+      if test "%UNSET%" != "$LINGUAS"; then
+        desiredlanguages="$LINGUAS"
+      else
+        desiredlanguages="$ALL_LINGUAS"
+      fi
+      for desiredlang in $desiredlanguages; do
+        # Use the presentlang catalog if desiredlang is
+        #   a. equal to presentlang, or
+        #   b. a variant of presentlang (because in this case,
+        #      presentlang can be used as a fallback for messages
+        #      which are not translated in the desiredlang catalog).
+        case "$desiredlang" in
+          "$presentlang"*) useit=yes;;
+        esac
+      done
+      if test $useit = yes; then
+        INST_LINGUAS="$INST_LINGUAS $presentlang"
+      fi
+    done
+  fi
+  CATALOGS=
+  JAVACATALOGS=
+  QTCATALOGS=
+  TCLCATALOGS=
+  CSHARPCATALOGS=
+  if test -n "$INST_LINGUAS"; then
+    for lang in $INST_LINGUAS; do
+      CATALOGS="$CATALOGS $lang.gmo"
+      JAVACATALOGS="$JAVACATALOGS \$(DOMAIN)_$lang.properties"
+      QTCATALOGS="$QTCATALOGS $lang.qm"
+      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+      TCLCATALOGS="$TCLCATALOGS $frobbedlang.msg"
+      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+      CSHARPCATALOGS="$CSHARPCATALOGS $frobbedlang/\$(DOMAIN).resources.dll"
+    done
+  fi
+
+  sed -e "s|@POTFILES_DEPS@|$POTFILES_DEPS|g" -e "s|@POFILES@|$POFILES|g" -e "s|@UPDATEPOFILES@|$UPDATEPOFILES|g" -e "s|@DUMMYPOFILES@|$DUMMYPOFILES|g" -e "s|@GMOFILES@|$GMOFILES|g" -e "s|@PROPERTIESFILES@|$PROPERTIESFILES|g" -e "s|@CLASSFILES@|$CLASSFILES|g" -e "s|@QMFILES@|$QMFILES|g" -e "s|@MSGFILES@|$MSGFILES|g" -e "s|@RESOURCESDLLFILES@|$RESOURCESDLLFILES|g" -e "s|@CATALOGS@|$CATALOGS|g" -e "s|@JAVACATALOGS@|$JAVACATALOGS|g" -e "s|@QTCATALOGS@|$QTCATALOGS|g" -e "s|@TCLCATALOGS@|$TCLCATALOGS|g" -e "s|@CSHARPCATALOGS@|$CSHARPCATALOGS|g" -e 's,^#distdir:,distdir:,' < "$ac_file" > "$ac_file.tmp"
+  tab=`printf '\t'`
+  if grep -l '@TCLCATALOGS@' "$ac_file" > /dev/null; then
+    # Add dependencies that cannot be formulated as a simple suffix rule.
+    for lang in $ALL_LINGUAS; do
+      frobbedlang=`echo $lang | sed -e 's/\..*$//' -e 'y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'`
+      cat >> "$ac_file.tmp" <<EOF
+$frobbedlang.msg: $lang.po
+${tab}@echo "\$(MSGFMT) -c --tcl -d \$(srcdir) -l $lang $srcdirpre$lang.po"; \
+${tab}\$(MSGFMT) -c --tcl -d "\$(srcdir)" -l $lang $srcdirpre$lang.po || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+    done
+  fi
+  if grep -l '@CSHARPCATALOGS@' "$ac_file" > /dev/null; then
+    # Add dependencies that cannot be formulated as a simple suffix rule.
+    for lang in $ALL_LINGUAS; do
+      frobbedlang=`echo $lang | sed -e 's/_/-/g' -e 's/^sr-CS/sr-SP/' -e 's/@latin$/-Latn/' -e 's/@cyrillic$/-Cyrl/' -e 's/^sr-SP$/sr-SP-Latn/' -e 's/^uz-UZ$/uz-UZ-Latn/'`
+      cat >> "$ac_file.tmp" <<EOF
+$frobbedlang/\$(DOMAIN).resources.dll: $lang.po
+${tab}@echo "\$(MSGFMT) -c --csharp -d \$(srcdir) -l $lang $srcdirpre$lang.po -r \$(DOMAIN)"; \
+${tab}\$(MSGFMT) -c --csharp -d "\$(srcdir)" -l $lang $srcdirpre$lang.po -r "\$(DOMAIN)" || { rm -f "\$(srcdir)/$frobbedlang.msg"; exit 1; }
+EOF
+    done
+  fi
+  if test -n "$POMAKEFILEDEPS"; then
+    cat >> "$ac_file.tmp" <<EOF
+Makefile: $POMAKEFILEDEPS
+EOF
+  fi
+  mv "$ac_file.tmp" "$ac_file"
+])
+
+dnl Initializes the accumulator used by AM_XGETTEXT_OPTION.
+AC_DEFUN([AM_XGETTEXT_OPTION_INIT],
+[
+  XGETTEXT_EXTRA_OPTIONS=
+])
+
+dnl Registers an option to be passed to xgettext in the po subdirectory.
+AC_DEFUN([AM_XGETTEXT_OPTION],
+[
+  AC_REQUIRE([AM_XGETTEXT_OPTION_INIT])
+  XGETTEXT_EXTRA_OPTIONS="$XGETTEXT_EXTRA_OPTIONS $1"
+])
index c0418c4..b358da6 100644 (file)
@@ -1,5 +1,5 @@
-# posix_spawn.m4 serial 11
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# posix_spawn.m4 serial 22
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -32,46 +32,91 @@ AC_DEFUN([gl_POSIX_SPAWN_BODY],
   dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getsigmask])
   dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setsigmask])
   dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_destroy])
+  AC_CHECK_DECLS([posix_spawn], , , [[#include <spawn.h>]])
   if test $ac_cv_func_posix_spawn = yes; then
-    gl_POSIX_SPAWN_WORKS
-    case "$gl_cv_func_posix_spawn_works" in
-      *yes)
-        AC_DEFINE([HAVE_WORKING_POSIX_SPAWN], [1],
-          [Define if you have the posix_spawn and posix_spawnp functions and
-           they work.])
-        dnl Assume that these functions are available if POSIX_SPAWN_SETSCHEDULER
-        dnl evaluates to nonzero.
-        dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getschedpolicy])
-        dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setschedpolicy])
-        AC_CACHE_CHECK([whether posix_spawnattr_setschedpolicy is supported],
-          [gl_cv_func_spawnattr_setschedpolicy],
-          [AC_EGREP_CPP([POSIX scheduling supported], [
+    m4_ifdef([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR],
+      [dnl Module 'posix_spawn_file_actions_addchdir' is present.
+       AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addchdir_np])
+       if test $ac_cv_func_posix_spawn_file_actions_addchdir_np = no; then
+         dnl In order to implement the posix_spawn_file_actions_addchdir
+         dnl function, we need to replace the entire posix_spawn facility.
+         REPLACE_POSIX_SPAWN=1
+       fi
+      ])
+    m4_ifdef([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR],
+      [dnl Module 'posix_spawn_file_actions_addfchdir' is present.
+       AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addfchdir_np])
+       if test $ac_cv_func_posix_spawn_file_actions_addfchdir_np = no; then
+         dnl In order to implement the posix_spawn_file_actions_addfchdir
+         dnl function, we need to replace the entire posix_spawn facility.
+         REPLACE_POSIX_SPAWN=1
+       fi
+      ])
+    if test $REPLACE_POSIX_SPAWN = 0; then
+      gl_POSIX_SPAWN_WORKS
+      case "$gl_cv_func_posix_spawn_works" in
+        *yes) ;;
+        *) REPLACE_POSIX_SPAWN=1 ;;
+      esac
+    fi
+    if test $REPLACE_POSIX_SPAWN = 0; then
+      gl_POSIX_SPAWN_SECURE
+      case "$gl_cv_func_posix_spawn_secure_exec" in
+        *yes) ;;
+        *) REPLACE_POSIX_SPAWN=1 ;;
+      esac
+      case "$gl_cv_func_posix_spawnp_secure_exec" in
+        *yes) ;;
+        *) REPLACE_POSIX_SPAWN=1 ;;
+      esac
+    fi
+    if test $REPLACE_POSIX_SPAWN = 0; then
+      dnl Assume that these functions are available if POSIX_SPAWN_SETSCHEDULER
+      dnl evaluates to nonzero.
+      dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getschedpolicy])
+      dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setschedpolicy])
+      AC_CACHE_CHECK([whether posix_spawnattr_setschedpolicy is supported],
+        [gl_cv_func_spawnattr_setschedpolicy],
+        [AC_EGREP_CPP([POSIX scheduling supported], [
 #include <spawn.h>
 #if POSIX_SPAWN_SETSCHEDULER
  POSIX scheduling supported
 #endif
 ],
-             [gl_cv_func_spawnattr_setschedpolicy=yes],
-             [gl_cv_func_spawnattr_setschedpolicy=no])
-          ])
-        dnl Assume that these functions are available if POSIX_SPAWN_SETSCHEDPARAM
-        dnl evaluates to nonzero.
-        dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getschedparam])
-        dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setschedparam])
-        AC_CACHE_CHECK([whether posix_spawnattr_setschedparam is supported],
-          [gl_cv_func_spawnattr_setschedparam],
-          [AC_EGREP_CPP([POSIX scheduling supported], [
+           [gl_cv_func_spawnattr_setschedpolicy=yes],
+           [gl_cv_func_spawnattr_setschedpolicy=no])
+        ])
+      dnl Assume that these functions are available if POSIX_SPAWN_SETSCHEDPARAM
+      dnl evaluates to nonzero.
+      dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_getschedparam])
+      dnl AC_CHECK_FUNCS_ONCE([posix_spawnattr_setschedparam])
+      AC_CACHE_CHECK([whether posix_spawnattr_setschedparam is supported],
+        [gl_cv_func_spawnattr_setschedparam],
+        [AC_EGREP_CPP([POSIX scheduling supported], [
 #include <spawn.h>
 #if POSIX_SPAWN_SETSCHEDPARAM
  POSIX scheduling supported
 #endif
 ],
-             [gl_cv_func_spawnattr_setschedparam=yes],
-             [gl_cv_func_spawnattr_setschedparam=no])
-          ])
-        ;;
-      *) REPLACE_POSIX_SPAWN=1 ;;
-    esac
+           [gl_cv_func_spawnattr_setschedparam=yes],
+           [gl_cv_func_spawnattr_setschedparam=no])
+        ])
+    fi
+  else
+    dnl The system does not have the main function. Therefore we have to
+    dnl provide our own implementation. This implies to define our own
+    dnl posix_spawn_file_actions_t and posix_spawnattr_t types.
+    if test $ac_cv_have_decl_posix_spawn = yes; then
+      dnl The system declares posix_spawn() already. This declaration uses
+      dnl the original posix_spawn_file_actions_t and posix_spawnattr_t types.
+      dnl But we need a declaration with our own posix_spawn_file_actions_t and
+      dnl posix_spawnattr_t types.
+      REPLACE_POSIX_SPAWN=1
+    fi
+  fi
+  if test $ac_cv_func_posix_spawn != yes || test $REPLACE_POSIX_SPAWN = 1; then
+    AC_DEFINE([REPLACE_POSIX_SPAWN], [1],
+      [Define if gnulib uses its own posix_spawn and posix_spawnp functions.])
   fi
 ])
 
@@ -102,6 +147,7 @@ AC_DEFUN([gl_POSIX_SPAWN_WORKS],
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+]GL_MDA_DEFINES[
 
 extern char **environ;
 
@@ -224,7 +270,7 @@ main ()
          [if test -s conftest$ac_exeext \
              && ./conftest$ac_exeext > conftest.out \
              && echo 'This should be seen only once.' > conftest.ok \
-             && cmp conftest.out conftest.ok > /dev/null; then
+             && cmp conftest.out conftest.ok >/dev/null 2>&1; then
             gl_cv_func_posix_spawn_works=yes
           else
             gl_cv_func_posix_spawn_works=no
@@ -245,6 +291,7 @@ main ()
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/wait.h>
+]GL_MDA_DEFINES[
 
 extern char **environ;
 
@@ -394,6 +441,114 @@ main (int argc, char *argv[])
     ])
 ])
 
+dnl Test whether posix_spawn and posix_spawnp are secure.
+AC_DEFUN([gl_POSIX_SPAWN_SECURE],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  dnl On many platforms, posix_spawn or posix_spawnp allow executing a
+  dnl script without a '#!' marker as a shell script. This is unsecure.
+  AC_CACHE_CHECK([whether posix_spawn rejects scripts without shebang],
+    [gl_cv_func_posix_spawn_secure_exec],
+    [echo ':' > conftest.scr
+     chmod a+x conftest.scr
+     AC_RUN_IFELSE([AC_LANG_SOURCE([[
+       #include <errno.h>
+       #include <spawn.h>
+       #include <stddef.h>
+       #include <sys/types.h>
+       #include <sys/wait.h>
+       int
+       main ()
+       {
+         const char *prog_path = "./conftest.scr";
+         const char *prog_argv[2] = { prog_path, NULL };
+         const char *environment[2] = { "PATH=.", NULL };
+         pid_t child;
+         int status;
+         int err = posix_spawn (&child, prog_path, NULL, NULL,
+                                (char **) prog_argv, (char **) environment);
+         if (err == ENOEXEC)
+           return 0;
+         if (err != 0)
+           return 1;
+         status = 0;
+         while (waitpid (child, &status, 0) != child)
+           ;
+         if (!WIFEXITED (status))
+           return 2;
+         if (WEXITSTATUS (status) != 127)
+           return 3;
+         return 0;
+       }
+       ]])],
+       [gl_cv_func_posix_spawn_secure_exec=yes],
+       [gl_cv_func_posix_spawn_secure_exec=no],
+       [case "$host_os" in
+          # Guess no on GNU/Hurd.
+          gnu*)
+            gl_cv_func_posix_spawn_secure_exec="guessing no" ;;
+          # Guess yes on all other platforms.
+          *)
+            gl_cv_func_posix_spawn_secure_exec="guessing yes" ;;
+        esac
+       ])
+     rm -f conftest.scr
+    ])
+  AC_CACHE_CHECK([whether posix_spawnp rejects scripts without shebang],
+    [gl_cv_func_posix_spawnp_secure_exec],
+    [echo ':' > conftest.scr
+     chmod a+x conftest.scr
+     AC_RUN_IFELSE([AC_LANG_SOURCE([[
+       #include <errno.h>
+       #include <spawn.h>
+       #include <stddef.h>
+       #include <sys/types.h>
+       #include <sys/wait.h>
+       int
+       main ()
+       {
+         const char *prog_path = "./conftest.scr";
+         const char *prog_argv[2] = { prog_path, NULL };
+         const char *environment[2] = { "PATH=.", NULL };
+         pid_t child;
+         int status;
+         int err = posix_spawnp (&child, prog_path, NULL, NULL,
+                                 (char **) prog_argv, (char **) environment);
+         if (err == ENOEXEC)
+           return 0;
+         if (err != 0)
+           return 1;
+         status = 0;
+         while (waitpid (child, &status, 0) != child)
+           ;
+         if (!WIFEXITED (status))
+           return 2;
+         if (WEXITSTATUS (status) != 127)
+           return 3;
+         return 0;
+       }
+       ]])],
+       [gl_cv_func_posix_spawnp_secure_exec=yes],
+       [gl_cv_func_posix_spawnp_secure_exec=no],
+       [case "$host_os" in
+          # Guess yes on glibc systems (glibc >= 2.15 actually) except GNU/Hurd,
+          # musl libc, NetBSD.
+          *-gnu* | *-musl* | netbsd*)
+            gl_cv_func_posix_spawnp_secure_exec="guessing yes" ;;
+          # Guess no on GNU/Hurd, macOS, FreeBSD, OpenBSD, AIX, Solaris, Cygwin.
+          gnu* | darwin* | freebsd* | dragonfly* | midnightbsd* | openbsd* | \
+          aix* | solaris* | cygwin*)
+            gl_cv_func_posix_spawnp_secure_exec="guessing no" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *)
+            gl_cv_func_posix_spawnp_secure_exec="$gl_cross_guess_normal" ;;
+        esac
+       ])
+     rm -f conftest.scr
+    ])
+])
+
 # Prerequisites of lib/spawni.c.
 AC_DEFUN([gl_PREREQ_POSIX_SPAWN_INTERNAL],
 [
@@ -410,8 +565,8 @@ AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE],
   if test $REPLACE_POSIX_SPAWN = 1; then
     REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=1
   else
-    dnl On Solaris 11 2011-11, posix_spawn_file_actions_addclose succeeds even
-    dnl if the fd argument is out of range.
+    dnl On musl libc, posix_spawn_file_actions_addclose succeeds even if the fd
+    dnl argument is negative.
     AC_CACHE_CHECK([whether posix_spawn_file_actions_addclose works],
       [gl_cv_func_posix_spawn_file_actions_addclose_works],
       [AC_RUN_IFELSE(
@@ -422,16 +577,19 @@ int main ()
   posix_spawn_file_actions_t actions;
   if (posix_spawn_file_actions_init (&actions) != 0)
     return 1;
-  if (posix_spawn_file_actions_addclose (&actions, 10000000) == 0)
+  if (posix_spawn_file_actions_addclose (&actions, -5) == 0)
     return 2;
   return 0;
 }]])],
          [gl_cv_func_posix_spawn_file_actions_addclose_works=yes],
          [gl_cv_func_posix_spawn_file_actions_addclose_works=no],
-         [# Guess no on Solaris, yes otherwise.
+         [# Guess no on musl libc and Solaris, yes otherwise.
           case "$host_os" in
-            solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no";;
-            *)        gl_cv_func_posix_spawn_file_actions_addclose_works="guessing yes";;
+            *-musl*)  gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;;
+            solaris*) gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;;
+                      # Guess no on native Windows.
+            mingw*)   gl_cv_func_posix_spawn_file_actions_addclose_works="guessing no" ;;
+            *)        gl_cv_func_posix_spawn_file_actions_addclose_works="guessing yes" ;;
           esac
          ])
       ])
@@ -451,8 +609,8 @@ AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2],
   if test $REPLACE_POSIX_SPAWN = 1; then
     REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=1
   else
-    dnl On Solaris 11 2011-11, posix_spawn_file_actions_adddup2 succeeds even
-    dnl if the fd argument is out of range.
+    dnl On musl libc and Solaris 11.0, posix_spawn_file_actions_adddup2
+    dnl succeeds even if the fd argument is out of range.
     AC_CACHE_CHECK([whether posix_spawn_file_actions_adddup2 works],
       [gl_cv_func_posix_spawn_file_actions_adddup2_works],
       [AC_RUN_IFELSE(
@@ -469,9 +627,12 @@ int main ()
 }]])],
          [gl_cv_func_posix_spawn_file_actions_adddup2_works=yes],
          [gl_cv_func_posix_spawn_file_actions_adddup2_works=no],
-         [# Guess no on Solaris, yes otherwise.
+         [# Guess no on musl libc and Solaris, yes otherwise.
           case "$host_os" in
+            *-musl*)  gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";;
             solaris*) gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no";;
+                      # Guess no on native Windows.
+            mingw*)   gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing no" ;;
             *)        gl_cv_func_posix_spawn_file_actions_adddup2_works="guessing yes";;
           esac
          ])
@@ -492,8 +653,8 @@ AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN],
   if test $REPLACE_POSIX_SPAWN = 1; then
     REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=1
   else
-    dnl On Solaris 11 2011-11, posix_spawn_file_actions_addopen succeeds even
-    dnl if the fd argument is out of range.
+    dnl On musl libc and Solaris 11.0, posix_spawn_file_actions_addopen
+    dnl succeeds even if the fd argument is out of range.
     AC_CACHE_CHECK([whether posix_spawn_file_actions_addopen works],
       [gl_cv_func_posix_spawn_file_actions_addopen_works],
       [AC_RUN_IFELSE(
@@ -512,9 +673,12 @@ int main ()
 }]])],
          [gl_cv_func_posix_spawn_file_actions_addopen_works=yes],
          [gl_cv_func_posix_spawn_file_actions_addopen_works=no],
-         [# Guess no on Solaris, yes otherwise.
+         [# Guess no on musl libc and Solaris, yes otherwise.
           case "$host_os" in
+            *-musl*)  gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";;
             solaris*) gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no";;
+                      # Guess no on native Windows.
+            mingw*)   gl_cv_func_posix_spawn_file_actions_addopen_works="guessing no" ;;
             *)        gl_cv_func_posix_spawn_file_actions_addopen_works="guessing yes";;
           esac
          ])
diff --git a/m4/posix_spawn_faction_addchdir.m4 b/m4/posix_spawn_faction_addchdir.m4
new file mode 100644 (file)
index 0000000..8ad40ed
--- /dev/null
@@ -0,0 +1,20 @@
+# posix_spawn_faction_addchdir.m4 serial 1
+dnl Copyright (C) 2018-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR],
+[
+  AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
+  AC_REQUIRE([AC_PROG_CC])
+  gl_POSIX_SPAWN
+  AC_CHECK_FUNCS_ONCE([posix_spawn_file_actions_addchdir posix_spawn_file_actions_addchdir_np])
+  if test $ac_cv_func_posix_spawn_file_actions_addchdir = yes; then
+    dnl This function is not yet standardized. Therefore override the
+    dnl system's implementation always.
+    REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=1
+  else
+    HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0
+  fi
+])
index e97dbb3..33bcc4a 100644 (file)
@@ -1,5 +1,5 @@
 # printf-frexp.m4 serial 5
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index e5ef4ac..c127a60 100644 (file)
@@ -1,5 +1,5 @@
 # printf-frexpl.m4 serial 10
-dnl Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index c7a14b2..284c7c5 100644 (file)
@@ -1,5 +1,5 @@
-# printf.m4 serial 52
-dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+# printf.m4 serial 73
+dnl Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -58,13 +58,16 @@ int main ()
         [gl_cv_func_printf_sizes_c99=yes],
         [gl_cv_func_printf_sizes_c99=no],
         [
-changequote(,)dnl
          case "$host_os" in
+changequote(,)dnl
                                  # Guess yes on glibc systems.
-           *-gnu*)               gl_cv_func_printf_sizes_c99="guessing yes";;
+           *-gnu* | gnu*)        gl_cv_func_printf_sizes_c99="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_printf_sizes_c99="guessing yes";;
                                  # Guess yes on FreeBSD >= 5.
            freebsd[1-4].*)       gl_cv_func_printf_sizes_c99="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_printf_sizes_c99="guessing yes";;
+           midnightbsd*)         gl_cv_func_printf_sizes_c99="guessing yes";;
                                  # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_printf_sizes_c99="guessing no";;
            darwin*)              gl_cv_func_printf_sizes_c99="guessing yes";;
@@ -79,10 +82,21 @@ changequote(,)dnl
            netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
                                  gl_cv_func_printf_sizes_c99="guessing no";;
            netbsd*)              gl_cv_func_printf_sizes_c99="guessing yes";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_printf_sizes_c99="guessing no";;
-         esac
+                                 # Guess yes on Android.
+           linux*-android*)      gl_cv_func_printf_sizes_c99="guessing yes";;
 changequote([,])dnl
+                                 # Guess yes on MSVC, no on mingw.
+           mingw*)               AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+                                   ],
+                                   [gl_cv_func_printf_sizes_c99="guessing yes"],
+                                   [gl_cv_func_printf_sizes_c99="guessing no"])
+                                 ;;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_printf_sizes_c99="$gl_cross_guess_normal";;
+         esac
         ])
     ])
 ])
@@ -122,14 +136,22 @@ int main ()
 }]])],
         [gl_cv_func_printf_long_double=yes],
         [gl_cv_func_printf_long_double=no],
-        [
-changequote(,)dnl
-         case "$host_os" in
-           beos*)        gl_cv_func_printf_long_double="guessing no";;
-           mingw* | pw*) gl_cv_func_printf_long_double="guessing no";;
-           *)            gl_cv_func_printf_long_double="guessing yes";;
+        [case "$host_os" in
+                            # Guess no on BeOS.
+           beos*)           gl_cv_func_printf_long_double="guessing no";;
+                            # Guess yes on Android.
+           linux*-android*) gl_cv_func_printf_long_double="guessing yes";;
+                            # Guess yes on MSVC, no on mingw.
+           mingw*)          AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+                              ],
+                              [gl_cv_func_printf_long_double="guessing yes"],
+                              [gl_cv_func_printf_long_double="guessing no"])
+                            ;;
+           *)               gl_cv_func_printf_long_double="guessing yes";;
          esac
-changequote([,])dnl
         ])
     ])
 ])
@@ -217,13 +239,16 @@ int main ()
         [gl_cv_func_printf_infinite=yes],
         [gl_cv_func_printf_infinite=no],
         [
-changequote(,)dnl
          case "$host_os" in
+changequote(,)dnl
                                  # Guess yes on glibc systems.
-           *-gnu*)               gl_cv_func_printf_infinite="guessing yes";;
+           *-gnu* | gnu*)        gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_printf_infinite="guessing yes";;
                                  # Guess yes on FreeBSD >= 6.
            freebsd[1-5].*)       gl_cv_func_printf_infinite="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_printf_infinite="guessing yes";;
+           midnightbsd*)         gl_cv_func_printf_infinite="guessing yes";;
                                  # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_printf_infinite="guessing no";;
            darwin*)              gl_cv_func_printf_infinite="guessing yes";;
@@ -234,12 +259,26 @@ changequote(,)dnl
            netbsd[1-2]* | netbsdelf[1-2]* | netbsdaout[1-2]* | netbsdcoff[1-2]*)
                                  gl_cv_func_printf_infinite="guessing no";;
            netbsd*)              gl_cv_func_printf_infinite="guessing yes";;
+                                 # Guess yes on OpenBSD >= 6.0.
+           openbsd[1-5].*)       gl_cv_func_printf_infinite="guessing no";;
+           openbsd*)             gl_cv_func_printf_infinite="guessing yes";;
                                  # Guess yes on BeOS.
            beos*)                gl_cv_func_printf_infinite="guessing yes";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_printf_infinite="guessing no";;
-         esac
+                                 # Guess no on Android.
+           linux*-android*)      gl_cv_func_printf_infinite="guessing no";;
 changequote([,])dnl
+                                 # Guess yes on MSVC, no on mingw.
+           mingw*)               AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+                                   ],
+                                   [gl_cv_func_printf_infinite="guessing yes"],
+                                   [gl_cv_func_printf_infinite="guessing no"])
+                                 ;;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_printf_infinite="$gl_cross_guess_normal";;
+         esac
         ])
     ])
 ])
@@ -419,27 +458,43 @@ int main ()
 }]])],
             [gl_cv_func_printf_infinite_long_double=yes],
             [gl_cv_func_printf_infinite_long_double=no],
-            [
-changequote(,)dnl
-             case "$host_cpu" in
+            [case "$host_cpu" in
                                      # Guess no on ia64, x86_64, i386.
                ia64 | x86_64 | i*86) gl_cv_func_printf_infinite_long_double="guessing no";;
                *)
                  case "$host_os" in
+changequote(,)dnl
                                          # Guess yes on glibc systems.
-                   *-gnu*)               gl_cv_func_printf_infinite_long_double="guessing yes";;
+                   *-gnu* | gnu*)        gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess yes on musl systems.
+                   *-musl*)              gl_cv_func_printf_infinite_long_double="guessing yes";;
                                          # Guess yes on FreeBSD >= 6.
                    freebsd[1-5].*)       gl_cv_func_printf_infinite_long_double="guessing no";;
                    freebsd* | kfreebsd*) gl_cv_func_printf_infinite_long_double="guessing yes";;
+                   midnightbsd*)         gl_cv_func_printf_infinite_long_double="guessing yes";;
                                          # Guess yes on HP-UX >= 11.
                    hpux[7-9]* | hpux10*) gl_cv_func_printf_infinite_long_double="guessing no";;
                    hpux*)                gl_cv_func_printf_infinite_long_double="guessing yes";;
-                                         # If we don't know, assume the worst.
-                   *)                    gl_cv_func_printf_infinite_long_double="guessing no";;
+                                         # Guess yes on OpenBSD >= 6.0.
+                   openbsd[1-5].*)       gl_cv_func_printf_infinite_long_double="guessing no";;
+                   openbsd*)             gl_cv_func_printf_infinite_long_double="guessing yes";;
+                                         # Guess no on Android.
+                   linux*-android*)      gl_cv_func_printf_infinite_long_double="guessing no";;
+changequote([,])dnl
+                                         # Guess yes on MSVC, no on mingw.
+                   mingw*)               AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+                                           ],
+                                           [gl_cv_func_printf_infinite_long_double="guessing yes"],
+                                           [gl_cv_func_printf_infinite_long_double="guessing no"])
+                                         ;;
+                                         # If we don't know, obey --enable-cross-guesses.
+                   *)                    gl_cv_func_printf_infinite_long_double="$gl_cross_guess_normal";;
                  esac
                  ;;
              esac
-changequote([,])dnl
             ])
         ])
       ;;
@@ -482,15 +537,22 @@ int main ()
           && strcmp (buf, "-0X6.488P-1 33") != 0
           && strcmp (buf, "-0XC.91P-2 33") != 0))
     result |= 2;
-  /* This catches a FreeBSD 6.1 bug: it doesn't round.  */
+  /* This catches a FreeBSD 13.0 bug: it doesn't round.  */
   if (sprintf (buf, "%.2a %d", 1.51, 33, 44, 55) < 0
       || (strcmp (buf, "0x1.83p+0 33") != 0
           && strcmp (buf, "0x3.05p-1 33") != 0
           && strcmp (buf, "0x6.0ap-2 33") != 0
           && strcmp (buf, "0xc.14p-3 33") != 0))
     result |= 4;
+  /* This catches a Mac OS X 10.12.4 (Darwin 16.5) bug: it doesn't round.  */
+  if (sprintf (buf, "%.0a %d", 1.51, 33, 44, 55) < 0
+      || (strcmp (buf, "0x2p+0 33") != 0
+          && strcmp (buf, "0x3p-1 33") != 0
+          && strcmp (buf, "0x6p-2 33") != 0
+          && strcmp (buf, "0xcp-3 33") != 0))
+    result |= 4;
   /* This catches a FreeBSD 6.1 bug.  See
-     <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
+     <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
   if (sprintf (buf, "%010a %d", 1.0 / zero, 33, 44, 55) < 0
       || buf[0] == '0')
     result |= 8;
@@ -502,7 +564,7 @@ int main ()
           && strcmp (buf, "0x8.0p-2") != 0))
     result |= 16;
   /* This catches the same Mac OS X 10.3.9 (Darwin 7.9) bug and also a
-     glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
+     glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
   if (sprintf (buf, "%.1La", 1.999L) < 0
       || (strcmp (buf, "0x1.0p+1") != 0
           && strcmp (buf, "0x2.0p+0") != 0
@@ -516,7 +578,7 @@ int main ()
         [
          case "$host_os" in
                                  # Guess yes on glibc >= 2.5 systems.
-           *-gnu*)
+           *-gnu* | gnu*)
              AC_EGREP_CPP([BZ2908], [
                #include <features.h>
                #ifdef __GNU_LIBRARY__
@@ -528,8 +590,14 @@ int main ()
                [gl_cv_func_printf_directive_a="guessing yes"],
                [gl_cv_func_printf_directive_a="guessing no"])
              ;;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_printf_directive_a="guessing no";;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_printf_directive_a="guessing yes";;
+                                 # Guess no on Android.
+           linux*-android*)      gl_cv_func_printf_directive_a="guessing no";;
+                                 # Guess no on native Windows.
+           mingw*)               gl_cv_func_printf_directive_a="guessing no";;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_printf_directive_a="$gl_cross_guess_normal";;
          esac
         ])
     ])
@@ -570,23 +638,40 @@ int main ()
         [gl_cv_func_printf_directive_f=yes],
         [gl_cv_func_printf_directive_f=no],
         [
-changequote(,)dnl
          case "$host_os" in
+changequote(,)dnl
                                  # Guess yes on glibc systems.
-           *-gnu*)               gl_cv_func_printf_directive_f="guessing yes";;
+           *-gnu* | gnu*)        gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_printf_directive_f="guessing yes";;
                                  # Guess yes on FreeBSD >= 6.
            freebsd[1-5].*)       gl_cv_func_printf_directive_f="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_printf_directive_f="guessing yes";;
+           midnightbsd*)         gl_cv_func_printf_directive_f="guessing yes";;
                                  # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_printf_directive_f="guessing no";;
            darwin*)              gl_cv_func_printf_directive_f="guessing yes";;
+                                 # Guess yes on OpenBSD >= 6.0.
+           openbsd[1-5].*)       gl_cv_func_printf_directive_f="guessing no";;
+           openbsd*)             gl_cv_func_printf_directive_f="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";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_printf_directive_f="guessing no";;
-         esac
+           solaris2.[1-9][0-9]*) gl_cv_func_printf_directive_f="guessing yes";;
+           solaris*)             gl_cv_func_printf_directive_f="guessing no";;
+                                 # Guess no on Android.
+           linux*-android*)      gl_cv_func_printf_directive_f="guessing no";;
 changequote([,])dnl
+                                 # Guess yes on MSVC, no on mingw.
+           mingw*)               AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+                                   ],
+                                   [gl_cv_func_printf_directive_f="guessing yes"],
+                                   [gl_cv_func_printf_directive_f="guessing no"])
+                                 ;;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_printf_directive_f="$gl_cross_guess_normal";;
+         esac
         ])
     ])
 ])
@@ -608,7 +693,10 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_N],
 #include <stdlib.h>
 #include <string.h>
 #ifdef _MSC_VER
-/* See page about "Parameter Validation" on msdn.microsoft.com.  */
+#include <inttypes.h>
+/* See page about "Parameter Validation" on msdn.microsoft.com.
+   <https://docs.microsoft.com/en-us/cpp/c-runtime-library/parameter-validation>
+   <https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-invalid-parameter-handler-set-thread-local-invalid-parameter-handler>  */
 static void cdecl
 invalid_parameter_handler (const wchar_t *expression,
                            const wchar_t *function,
@@ -638,13 +726,23 @@ int main ()
 }]])],
         [gl_cv_func_printf_directive_n=yes],
         [gl_cv_func_printf_directive_n=no],
-        [
-changequote(,)dnl
-         case "$host_os" in
-           mingw*) gl_cv_func_printf_directive_n="guessing no";;
-           *)      gl_cv_func_printf_directive_n="guessing yes";;
+        [case "$host_os" in
+                            # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+           *-gnu* | gnu*)   AC_COMPILE_IFELSE(
+                              [AC_LANG_SOURCE(
+                                 [[#if _FORTIFY_SOURCE >= 2
+                                    error fail
+                                   #endif
+                                 ]])],
+                              [gl_cv_func_printf_directive_n="guessing yes"],
+                              [gl_cv_func_printf_directive_n="guessing no"])
+                            ;;
+                            # Guess no on Android.
+           linux*-android*) gl_cv_func_printf_directive_n="guessing no";;
+                            # Guess no on native Windows.
+           mingw*)          gl_cv_func_printf_directive_n="guessing no";;
+           *)               gl_cv_func_printf_directive_n="guessing yes";;
          esac
-changequote([,])dnl
         ])
     ])
 ])
@@ -665,13 +763,7 @@ AC_DEFUN([gl_PRINTF_DIRECTIVE_LS],
     [
       AC_RUN_IFELSE(
         [AC_LANG_SOURCE([[
-/* 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 <string.h>
 int main ()
@@ -719,11 +811,17 @@ int main ()
         [
 changequote(,)dnl
          case "$host_os" in
-           openbsd*)        gl_cv_func_printf_directive_ls="guessing no";;
+                            # Guess yes on OpenBSD >= 6.0.
+           openbsd[1-5].*)  gl_cv_func_printf_directive_ls="guessing no";;
+           openbsd*)        gl_cv_func_printf_directive_ls="guessing yes";;
            irix*)           gl_cv_func_printf_directive_ls="guessing no";;
            solaris*)        gl_cv_func_printf_directive_ls="guessing no";;
            cygwin*)         gl_cv_func_printf_directive_ls="guessing no";;
            beos* | haiku*)  gl_cv_func_printf_directive_ls="guessing no";;
+                            # Guess no on Android.
+           linux*-android*) gl_cv_func_printf_directive_ls="guessing no";;
+                            # Guess yes on native Windows.
+           mingw*)          gl_cv_func_printf_directive_ls="guessing yes";;
            *)               gl_cv_func_printf_directive_ls="guessing yes";;
          esac
 changequote([,])dnl
@@ -761,10 +859,13 @@ int main ()
 changequote(,)dnl
          case "$host_os" in
            netbsd[1-3]* | netbsdelf[1-3]* | netbsdaout[1-3]* | netbsdcoff[1-3]*)
-                         gl_cv_func_printf_positions="guessing no";;
-           beos*)        gl_cv_func_printf_positions="guessing no";;
-           mingw* | pw*) gl_cv_func_printf_positions="guessing no";;
-           *)            gl_cv_func_printf_positions="guessing yes";;
+                            gl_cv_func_printf_positions="guessing no";;
+           beos*)           gl_cv_func_printf_positions="guessing no";;
+                            # Guess yes on Android.
+           linux*-android*) gl_cv_func_printf_positions="guessing yes";;
+                            # Guess no on native Windows.
+           mingw* | pw*)    gl_cv_func_printf_positions="guessing no";;
+           *)               gl_cv_func_printf_positions="guessing yes";;
          esac
 changequote([,])dnl
         ])
@@ -799,10 +900,13 @@ int main ()
         [
 changequote(,)dnl
          case "$host_os" in
-           cygwin*)      gl_cv_func_printf_flag_grouping="guessing no";;
-           netbsd*)      gl_cv_func_printf_flag_grouping="guessing no";;
-           mingw* | pw*) gl_cv_func_printf_flag_grouping="guessing no";;
-           *)            gl_cv_func_printf_flag_grouping="guessing yes";;
+           cygwin*)         gl_cv_func_printf_flag_grouping="guessing no";;
+           netbsd*)         gl_cv_func_printf_flag_grouping="guessing no";;
+                            # Guess no on Android.
+           linux*-android*) gl_cv_func_printf_flag_grouping="guessing no";;
+                            # Guess no on native Windows.
+           mingw* | pw*)    gl_cv_func_printf_flag_grouping="guessing no";;
+           *)               gl_cv_func_printf_flag_grouping="guessing yes";;
          esac
 changequote([,])dnl
         ])
@@ -811,7 +915,7 @@ changequote([,])dnl
 
 dnl Test whether the *printf family of functions supports the - flag correctly.
 dnl (ISO C99.) See
-dnl <http://lists.gnu.org/archive/html/bug-coreutils/2008-02/msg00035.html>
+dnl <https://lists.gnu.org/r/bug-coreutils/2008-02/msg00035.html>
 dnl Result is gl_cv_func_printf_flag_leftadjust.
 
 AC_DEFUN([gl_PRINTF_FLAG_LEFTADJUST],
@@ -839,12 +943,16 @@ int main ()
         [
 changequote(,)dnl
          case "$host_os" in
-                    # Guess yes on HP-UX 11.
-           hpux11*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
-                    # Guess no on HP-UX 10 and older.
-           hpux*)   gl_cv_func_printf_flag_leftadjust="guessing no";;
-                    # Guess yes otherwise.
-           *)       gl_cv_func_printf_flag_leftadjust="guessing yes";;
+                            # Guess yes on HP-UX 11.
+           hpux11*)         gl_cv_func_printf_flag_leftadjust="guessing yes";;
+                            # Guess no on HP-UX 10 and older.
+           hpux*)           gl_cv_func_printf_flag_leftadjust="guessing no";;
+                            # Guess yes on Android.
+           linux*-android*) gl_cv_func_printf_flag_leftadjust="guessing yes";;
+                            # Guess yes on native Windows.
+           mingw*)          gl_cv_func_printf_flag_leftadjust="guessing yes";;
+                            # Guess yes otherwise.
+           *)               gl_cv_func_printf_flag_leftadjust="guessing yes";;
          esac
 changequote([,])dnl
         ])
@@ -853,7 +961,7 @@ changequote([,])dnl
 
 dnl Test whether the *printf family of functions supports padding of non-finite
 dnl values with the 0 flag correctly. (ISO C99 + TC1 + TC2.) See
-dnl <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html>
+dnl <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html>
 dnl Result is gl_cv_func_printf_flag_zero.
 
 AC_DEFUN([gl_PRINTF_FLAG_ZERO],
@@ -882,12 +990,18 @@ int main ()
         [
 changequote(,)dnl
          case "$host_os" in
-                   # Guess yes on glibc systems.
-           *-gnu*) gl_cv_func_printf_flag_zero="guessing yes";;
-                   # Guess yes on BeOS.
-           beos*)  gl_cv_func_printf_flag_zero="guessing yes";;
-                   # If we don't know, assume the worst.
-           *)      gl_cv_func_printf_flag_zero="guessing no";;
+                            # Guess yes on glibc systems.
+           *-gnu* | gnu*)   gl_cv_func_printf_flag_zero="guessing yes";;
+                            # Guess yes on musl systems.
+           *-musl*)         gl_cv_func_printf_flag_zero="guessing yes";;
+                            # Guess yes on BeOS.
+           beos*)           gl_cv_func_printf_flag_zero="guessing yes";;
+                            # Guess no on Android.
+           linux*-android*) gl_cv_func_printf_flag_zero="guessing no";;
+                            # Guess no on native Windows.
+           mingw*)          gl_cv_func_printf_flag_zero="guessing no";;
+                            # If we don't know, obey --enable-cross-guesses.
+           *)               gl_cv_func_printf_flag_zero="$gl_cross_guess_normal";;
          esac
 changequote([,])dnl
         ])
@@ -940,10 +1054,12 @@ int main ()
 changequote(,)dnl
          case "$host_os" in
            # Guess no only on Solaris, native Windows, and BeOS systems.
-           solaris*)     gl_cv_func_printf_precision="guessing no" ;;
-           mingw* | pw*) gl_cv_func_printf_precision="guessing no" ;;
-           beos*)        gl_cv_func_printf_precision="guessing no" ;;
-           *)            gl_cv_func_printf_precision="guessing yes" ;;
+           solaris*)        gl_cv_func_printf_precision="guessing no" ;;
+           mingw* | pw*)    gl_cv_func_printf_precision="guessing no" ;;
+           beos*)           gl_cv_func_printf_precision="guessing no" ;;
+                            # Guess yes on Android.
+           linux*-android*) gl_cv_func_printf_precision="guessing yes" ;;
+           *)               gl_cv_func_printf_precision="guessing yes" ;;
          esac
 changequote([,])dnl
         ])
@@ -965,9 +1081,8 @@ AC_DEFUN([gl_PRINTF_ENOMEM],
       gl_cv_func_printf_enomem="guessing no"
       if test "$cross_compiling" = no; then
         if test $APPLE_UNIVERSAL_BUILD = 0; then
-          AC_LANG_CONFTEST([AC_LANG_SOURCE([
+          AC_LANG_CONFTEST([AC_LANG_SOURCE([[
 ]GL_NOCRASH[
-changequote(,)dnl
 #include <stdio.h>
 #include <sys/types.h>
 #include <sys/time.h>
@@ -1012,8 +1127,7 @@ int main()
   ret = printf ("%.5000000f", 1.0);
   return !(ret == 5000002 || (ret < 0 && errno == ENOMEM));
 }
-changequote([,])dnl
-          ])])
+          ]])])
           if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
             (./conftest 2>&AS_MESSAGE_LOG_FD
              result=$?
@@ -1040,28 +1154,30 @@ changequote([,])dnl
       if test "$gl_cv_func_printf_enomem" = "guessing no"; then
 changequote(,)dnl
         case "$host_os" in
-                    # Guess yes on glibc systems.
-          *-gnu*)   gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on Solaris.
-          solaris*) gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on AIX.
-          aix*)     gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on HP-UX/hppa.
-          hpux*)    case "$host_cpu" in
-                      hppa*) gl_cv_func_printf_enomem="guessing yes";;
-                      *)     gl_cv_func_printf_enomem="guessing no";;
-                    esac
-                    ;;
-                    # Guess yes on IRIX.
-          irix*)    gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on OSF/1.
-          osf*)     gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on BeOS.
-          beos*)    gl_cv_func_printf_enomem="guessing yes";;
-                    # Guess yes on Haiku.
-          haiku*)   gl_cv_func_printf_enomem="guessing yes";;
-                    # If we don't know, assume the worst.
-          *)        gl_cv_func_printf_enomem="guessing no";;
+                           # Guess yes on glibc systems.
+          *-gnu* | gnu*)   gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on Solaris.
+          solaris*)        gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on AIX.
+          aix*)            gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on HP-UX/hppa.
+          hpux*)           case "$host_cpu" in
+                             hppa*) gl_cv_func_printf_enomem="guessing yes";;
+                             *)     gl_cv_func_printf_enomem="guessing no";;
+                           esac
+                           ;;
+                           # Guess yes on IRIX.
+          irix*)           gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on OSF/1.
+          osf*)            gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on BeOS.
+          beos*)           gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess yes on Haiku.
+          haiku*)          gl_cv_func_printf_enomem="guessing yes";;
+                           # Guess no on Android.
+          linux*-android*) gl_cv_func_printf_enomem="guessing no";;
+                           # If we don't know, obey --enable-cross-guesses.
+          *)               gl_cv_func_printf_enomem="$gl_cross_guess_normal";;
         esac
 changequote([,])dnl
       fi
@@ -1080,7 +1196,7 @@ dnl Test whether the string produced by the snprintf function is always NUL
 dnl terminated. (ISO C99, POSIX:2001)
 dnl Result is gl_cv_func_snprintf_truncation_c99.
 
-AC_DEFUN([gl_SNPRINTF_TRUNCATION_C99],
+AC_DEFUN_ONCE([gl_SNPRINTF_TRUNCATION_C99],
 [
   AC_REQUIRE([AC_PROG_CC])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
@@ -1121,10 +1237,13 @@ int main ()
 changequote(,)dnl
          case "$host_os" in
                                  # Guess yes on glibc systems.
-           *-gnu*)               gl_cv_func_snprintf_truncation_c99="guessing yes";;
+           *-gnu* | gnu*)        gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
                                  # Guess yes on FreeBSD >= 5.
            freebsd[1-4].*)       gl_cv_func_snprintf_truncation_c99="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_snprintf_truncation_c99="guessing yes";;
+           midnightbsd*)         gl_cv_func_snprintf_truncation_c99="guessing yes";;
                                  # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_snprintf_truncation_c99="guessing no";;
            darwin*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
@@ -1153,8 +1272,12 @@ changequote(,)dnl
            netbsd*)              gl_cv_func_snprintf_truncation_c99="guessing yes";;
                                  # Guess yes on BeOS.
            beos*)                gl_cv_func_snprintf_truncation_c99="guessing yes";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_snprintf_truncation_c99="guessing no";;
+                                 # Guess yes on Android.
+           linux*-android*)      gl_cv_func_snprintf_truncation_c99="guessing yes";;
+                                 # Guess no on native Windows.
+           mingw*)               gl_cv_func_snprintf_truncation_c99="guessing no";;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_snprintf_truncation_c99="$gl_cross_guess_normal";;
          esac
 changequote([,])dnl
         ])
@@ -1216,14 +1339,16 @@ int main ()
 }]])],
         [gl_cv_func_snprintf_retval_c99=yes],
         [gl_cv_func_snprintf_retval_c99=no],
-        [
+        [case "$host_os" in
 changequote(,)dnl
-         case "$host_os" in
                                  # Guess yes on glibc systems.
-           *-gnu*)               gl_cv_func_snprintf_retval_c99="guessing yes";;
+           *-gnu* | gnu*)        gl_cv_func_snprintf_retval_c99="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              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";;
+           midnightbsd*)         gl_cv_func_snprintf_retval_c99="guessing yes";;
                                  # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_snprintf_retval_c99="guessing no";;
            darwin*)              gl_cv_func_snprintf_retval_c99="guessing yes";;
@@ -1243,10 +1368,21 @@ changequote(,)dnl
            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
+                                 # Guess yes on Android.
+           linux*-android*)      gl_cv_func_snprintf_retval_c99="guessing yes";;
 changequote([,])dnl
+                                 # Guess yes on MSVC, no on mingw.
+           mingw*)               AC_EGREP_CPP([Known], [
+#ifdef _MSC_VER
+ Known
+#endif
+                                   ],
+                                   [gl_cv_func_snprintf_retval_c99="guessing yes"],
+                                   [gl_cv_func_snprintf_retval_c99="guessing no"])
+                                 ;;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_snprintf_retval_c99="$gl_cross_guess_normal";;
+         esac
         ])
     ])
 ])
@@ -1298,13 +1434,24 @@ int main ()
         [gl_cv_func_snprintf_directive_n=yes],
         [gl_cv_func_snprintf_directive_n=no],
         [
-changequote(,)dnl
          case "$host_os" in
-                                 # Guess yes on glibc systems.
-           *-gnu*)               gl_cv_func_snprintf_directive_n="guessing yes";;
+                                 # Guess no on glibc when _FORTIFY_SOURCE >= 2.
+           *-gnu* | gnu*)        AC_COMPILE_IFELSE(
+                                   [AC_LANG_SOURCE(
+                                      [[#if _FORTIFY_SOURCE >= 2
+                                         error fail
+                                        #endif
+                                      ]])],
+                                   [gl_cv_func_snprintf_directive_n="guessing yes"],
+                                   [gl_cv_func_snprintf_directive_n="guessing no"])
+                                 ;;
+changequote(,)dnl
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_snprintf_directive_n="guessing yes";;
                                  # Guess yes on FreeBSD >= 5.
            freebsd[1-4].*)       gl_cv_func_snprintf_directive_n="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_snprintf_directive_n="guessing yes";;
+           midnightbsd*)         gl_cv_func_snprintf_directive_n="guessing yes";;
                                  # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_snprintf_directive_n="guessing no";;
            darwin*)              gl_cv_func_snprintf_directive_n="guessing yes";;
@@ -1326,10 +1473,14 @@ changequote(,)dnl
            netbsd*)              gl_cv_func_snprintf_directive_n="guessing yes";;
                                  # Guess yes on BeOS.
            beos*)                gl_cv_func_snprintf_directive_n="guessing yes";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_snprintf_directive_n="guessing no";;
-         esac
+                                 # Guess no on Android.
+           linux*-android*)      gl_cv_func_snprintf_directive_n="guessing no";;
+                                 # Guess no on native Windows.
+           mingw*)               gl_cv_func_snprintf_directive_n="guessing no";;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_snprintf_directive_n="$gl_cross_guess_normal";;
 changequote([,])dnl
+         esac
         ])
     ])
 ])
@@ -1342,6 +1493,7 @@ dnl Result is gl_cv_func_snprintf_size1.
 AC_DEFUN([gl_SNPRINTF_SIZE1],
 [
   AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_REQUIRE([gl_SNPRINTF_PRESENCE])
   AC_CACHE_CHECK([whether snprintf respects a size of 1],
     [gl_cv_func_snprintf_size1],
@@ -1371,7 +1523,14 @@ int main()
 }]])],
         [gl_cv_func_snprintf_size1=yes],
         [gl_cv_func_snprintf_size1=no],
-        [gl_cv_func_snprintf_size1="guessing yes"])
+        [case "$host_os" in
+                            # Guess yes on Android.
+           linux*-android*) gl_cv_func_snprintf_size1="guessing yes" ;;
+                            # Guess yes on native Windows.
+           mingw*)          gl_cv_func_snprintf_size1="guessing yes" ;;
+           *)               gl_cv_func_snprintf_size1="guessing yes" ;;
+         esac
+        ])
     ])
 ])
 
@@ -1443,10 +1602,13 @@ int main()
 changequote(,)dnl
          case "$host_os" in
                                  # Guess yes on glibc systems.
-           *-gnu*)               gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+           *-gnu* | gnu*)        gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on musl systems.
+           *-musl*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on FreeBSD >= 5.
            freebsd[1-4].*)       gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
            freebsd* | kfreebsd*) gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+           midnightbsd*)         gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on Mac OS X >= 10.3.
            darwin[1-6].*)        gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
            darwin*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
@@ -1467,10 +1629,12 @@ changequote(,)dnl
            netbsd*)              gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
                                  # Guess yes on BeOS.
            beos*)                gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                                 # Guess yes on mingw.
+                                 # Guess yes on Android.
+           linux*-android*)      gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
+                                 # Guess yes on native Windows.
            mingw* | pw*)         gl_cv_func_vsnprintf_zerosize_c99="guessing yes";;
-                                 # If we don't know, assume the worst.
-           *)                    gl_cv_func_vsnprintf_zerosize_c99="guessing no";;
+                                 # If we don't know, obey --enable-cross-guesses.
+           *)                    gl_cv_func_vsnprintf_zerosize_c99="$gl_cross_guess_normal";;
          esac
 changequote([,])dnl
         ])
@@ -1526,14 +1690,19 @@ dnl
 dnl                                  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
 dnl   glibc 2.5                      .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 dnl   glibc 2.3.6                    .  .  .  .  #  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
+dnl   FreeBSD 13.0                   .  .  .  .  #  .  .  .  .  .  .  .  .  #  .  .  .  .  .  .
 dnl   FreeBSD 5.4, 6.1               .  .  .  .  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
+dnl   Mac OS X 10.13.5               .  .  .  #  #  .  #  .  .  .  .  .  .  .  .  .  .  #  .  .
 dnl   Mac OS X 10.5.8                .  .  .  #  #  .  .  .  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Mac OS X 10.3.9                .  .  .  .  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
+dnl   OpenBSD 6.0, 6.7               .  .  .  .  #  .  .  .  .  .  .  .  .  #  .  .  .  .  .  .
 dnl   OpenBSD 3.9, 4.0               .  .  #  #  #  #  .  #  .  #  .  #  .  #  .  .  .  .  .  .
 dnl   Cygwin 1.7.0 (2009)            .  .  .  #  .  .  .  ?  .  .  .  .  .  ?  .  .  .  .  .  .
 dnl   Cygwin 1.5.25 (2008)           .  .  .  #  #  .  .  #  .  .  .  .  .  #  .  .  .  .  .  .
 dnl   Cygwin 1.5.19 (2006)           #  .  .  #  #  #  .  #  .  #  .  #  #  #  .  .  .  .  .  .
-dnl   Solaris 11 2011-11             .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   Solaris 11.4                   .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
+dnl   Solaris 11.3                   .  .  .  .  #  .  .  #  .  .  .  .  .  .  .  .  .  .  .  .
+dnl   Solaris 11.0                   .  .  #  #  #  .  .  #  .  .  .  #  .  .  .  .  .  .  .  .
 dnl   Solaris 10                     .  .  #  #  #  .  .  #  .  .  .  #  #  .  .  .  .  .  .  .
 dnl   Solaris 2.6 ... 9              #  .  #  #  #  #  .  #  .  .  .  #  #  .  .  .  #  .  .  .
 dnl   Solaris 2.5.1                  #  .  #  #  #  #  .  #  .  .  .  #  .  .  #  #  #  #  #  #
@@ -1546,11 +1715,13 @@ dnl   HP-UX 10.20                    #  .  #  .  #  #  .  ?  .  .  #  #  .  .  .
 dnl   IRIX 6.5                       #  .  #  #  #  #  .  #  .  .  .  #  .  .  .  .  #  .  .  .
 dnl   OSF/1 5.1                      #  .  #  #  #  #  .  .  .  .  .  #  .  .  .  .  #  .  .  #
 dnl   OSF/1 4.0d                     #  .  #  #  #  #  .  .  .  .  .  #  .  .  #  #  #  #  #  #
+dnl   NetBSD 9.0                     .  .  .  .  #  .  .  .  .  .  .  .  .  .  .  .  .  .  .  .
 dnl   NetBSD 5.0                     .  .  .  #  #  .  .  .  .  .  .  #  .  #  .  .  .  .  .  .
 dnl   NetBSD 4.0                     .  ?  ?  ?  ?  ?  .  ?  .  ?  ?  ?  ?  ?  .  .  .  ?  ?  ?
 dnl   NetBSD 3.0                     .  .  .  .  #  #  .  ?  #  #  ?  #  .  #  .  .  .  .  .  .
 dnl   Haiku                          .  .  .  #  #  #  .  #  .  .  .  .  .  ?  .  .  ?  .  .  .
 dnl   BeOS                           #  #  .  #  #  #  .  ?  #  .  ?  .  #  ?  .  .  ?  .  .  .
+dnl   Android 4.3                    .  .  #  #  #  #  #  #  .  #  .  #  .  #  .  .  .  #  .  .
 dnl   old mingw / msvcrt             #  #  #  #  #  #  .  .  #  #  .  #  #  ?  .  #  #  #  .  .
 dnl   MSVC 9                         #  #  #  #  #  #  #  .  #  #  .  #  #  ?  #  #  #  #  .  .
 dnl   mingw 2009-2011                .  #  .  #  .  .  .  .  #  #  .  .  .  ?  .  .  .  .  .  .
diff --git a/m4/progtest.m4 b/m4/progtest.m4
new file mode 100644 (file)
index 0000000..b499f79
--- /dev/null
@@ -0,0 +1,91 @@
+# progtest.m4 serial 7 (gettext-0.18.2)
+dnl Copyright (C) 1996-2003, 2005, 2008-2014 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl
+dnl This file can can be used in projects which are not available under
+dnl the GNU General Public License or the GNU Library General Public
+dnl License but which still want to provide support for the GNU gettext
+dnl functionality.
+dnl Please note that the actual code of the GNU gettext library is covered
+dnl by the GNU Library General Public License, and the rest of the GNU
+dnl gettext package package is covered by the GNU General Public License.
+dnl They are *not* in the public domain.
+
+dnl Authors:
+dnl   Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+AC_PREREQ([2.50])
+
+# Search path for a program which passes the given test.
+
+dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN([AM_PATH_PROG_WITH_TEST],
+[
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
+fi
+
+# Find out how to test for executable files. Don't use a zero-byte file,
+# as systems may use methods other than mode bits to determine executability.
+cat >conf$$.file <<_ASEOF
+#! /bin/sh
+exit 0
+_ASEOF
+chmod +x conf$$.file
+if test -x conf$$.file >/dev/null 2>&1; then
+  ac_executable_p="test -x"
+else
+  ac_executable_p="test -f"
+fi
+rm -f conf$$.file
+
+# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL([ac_cv_path_$1],
+[case "[$]$1" in
+  [[\\/]]* | ?:[[\\/]]*)
+    ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+    ;;
+  *)
+    ac_save_IFS="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in ifelse([$5], , $PATH, [$5]); do
+      IFS="$ac_save_IFS"
+      test -z "$ac_dir" && ac_dir=.
+      for ac_exec_ext in '' $ac_executable_extensions; do
+        if $ac_executable_p "$ac_dir/$ac_word$ac_exec_ext"; then
+          echo "$as_me: trying $ac_dir/$ac_word..." >&AS_MESSAGE_LOG_FD
+          if [$3]; then
+            ac_cv_path_$1="$ac_dir/$ac_word$ac_exec_ext"
+            break 2
+          fi
+        fi
+      done
+    done
+    IFS="$ac_save_IFS"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+    ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
+  AC_MSG_RESULT([$][$1])
+else
+  AC_MSG_RESULT([no])
+fi
+AC_SUBST([$1])dnl
+])
diff --git a/m4/pthread-thread.m4 b/m4/pthread-thread.m4
new file mode 100644 (file)
index 0000000..949186d
--- /dev/null
@@ -0,0 +1,69 @@
+# pthread-thread.m4 serial 2
+dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_PTHREAD_THREAD],
+[
+  AC_REQUIRE([gl_PTHREAD_H])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+
+  if { case "$host_os" in mingw*) true;; *) false;; esac; } \
+     && test $gl_threads_api = windows; then
+    dnl Choose function names that don't conflict with the mingw-w64 winpthreads
+    dnl library.
+    REPLACE_PTHREAD_CREATE=1
+    REPLACE_PTHREAD_ATTR_INIT=1
+    REPLACE_PTHREAD_ATTR_GETDETACHSTATE=1
+    REPLACE_PTHREAD_ATTR_SETDETACHSTATE=1
+    REPLACE_PTHREAD_ATTR_DESTROY=1
+    REPLACE_PTHREAD_SELF=1
+    REPLACE_PTHREAD_EQUAL=1
+    REPLACE_PTHREAD_DETACH=1
+    REPLACE_PTHREAD_JOIN=1
+    REPLACE_PTHREAD_EXIT=1
+  else
+    if test $HAVE_PTHREAD_H = 0; then
+      HAVE_PTHREAD_CREATE=0
+      HAVE_PTHREAD_ATTR_INIT=0
+      HAVE_PTHREAD_ATTR_GETDETACHSTATE=0
+      HAVE_PTHREAD_ATTR_SETDETACHSTATE=0
+      HAVE_PTHREAD_ATTR_DESTROY=0
+      HAVE_PTHREAD_SELF=0
+      HAVE_PTHREAD_EQUAL=0
+      HAVE_PTHREAD_DETACH=0
+      HAVE_PTHREAD_JOIN=0
+      HAVE_PTHREAD_EXIT=0
+    else
+      dnl On HP-UX 11.11, pthread_create() and pthread_attr_init() are only
+      dnl defined as inline functions.
+      AC_CACHE_CHECK([whether pthread_create exists as a global function],
+        [gl_cv_func_pthread_create],
+        [saved_LIBS="$LIBS"
+         LIBS="$LIBS $LIBPMULTITHREAD"
+         AC_LINK_IFELSE(
+           [AC_LANG_SOURCE(
+              [[extern
+                #ifdef __cplusplus
+                "C"
+                #endif
+                int pthread_create (void);
+                int main ()
+                {
+                  return pthread_create ();
+                }
+              ]])],
+           [gl_cv_func_pthread_create=yes],
+           [gl_cv_func_pthread_create=no])
+         LIBS="$saved_LIBS"
+        ])
+      if test $gl_cv_func_pthread_create = no; then
+        REPLACE_PTHREAD_CREATE=1
+        REPLACE_PTHREAD_ATTR_INIT=1
+        AC_DEFINE([PTHREAD_CREATE_IS_INLINE], [1],
+          [Define if pthread_create is an inline function.])
+      fi
+    fi
+  fi
+])
diff --git a/m4/pthread_h.m4 b/m4/pthread_h.m4
new file mode 100644 (file)
index 0000000..62a6ca8
--- /dev/null
@@ -0,0 +1,283 @@
+# pthread_h.m4 serial 8
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_PTHREAD_H],
+[
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
+  AC_REQUIRE([gl_PTHREAD_H_DEFAULTS])
+
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_PTHREADLIB])
+
+  gl_CHECK_NEXT_HEADERS([pthread.h])
+  if test $ac_cv_header_pthread_h = yes; then
+    HAVE_PTHREAD_H=1
+    dnl On mingw, if --enable-threads=windows or gl_AVOID_WINPTHREAD is used,
+    dnl ignore the <pthread.h> from the mingw-w64 winpthreads library.
+    m4_ifdef([gl_][THREADLIB], [
+      AC_REQUIRE([gl_][THREADLIB])
+      if { case "$host_os" in mingw*) true;; *) false;; esac; } \
+         && test $gl_threads_api = windows; then
+        HAVE_PTHREAD_H=0
+      fi
+    ])
+  else
+    HAVE_PTHREAD_H=0
+  fi
+  AC_SUBST([HAVE_PTHREAD_H])
+
+  AC_CHECK_TYPES([pthread_t, pthread_spinlock_t], [], [],
+    [AC_INCLUDES_DEFAULT[
+     #if HAVE_PTHREAD_H
+      #include <pthread.h>
+     #endif]])
+  if test $ac_cv_type_pthread_t != yes; then
+    HAVE_PTHREAD_T=0
+  fi
+  if test $ac_cv_type_pthread_spinlock_t != yes; then
+    HAVE_PTHREAD_SPINLOCK_T=0
+  fi
+
+  dnl Constants may be defined as C preprocessor macros or as enum items.
+
+  AC_CACHE_CHECK([for PTHREAD_CREATE_DETACHED],
+    [gl_cv_const_PTHREAD_CREATE_DETACHED],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <pthread.h>
+            int x = PTHREAD_CREATE_DETACHED;
+          ]],
+          [[]])],
+       [gl_cv_const_PTHREAD_CREATE_DETACHED=yes],
+       [gl_cv_const_PTHREAD_CREATE_DETACHED=no])
+    ])
+  if test $gl_cv_const_PTHREAD_CREATE_DETACHED != yes; then
+    HAVE_PTHREAD_CREATE_DETACHED=0
+  fi
+
+  AC_CACHE_CHECK([for PTHREAD_MUTEX_RECURSIVE],
+    [gl_cv_const_PTHREAD_MUTEX_RECURSIVE],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <pthread.h>
+            int x = PTHREAD_MUTEX_RECURSIVE;
+          ]],
+          [[]])],
+       [gl_cv_const_PTHREAD_MUTEX_RECURSIVE=yes],
+       [gl_cv_const_PTHREAD_MUTEX_RECURSIVE=no])
+    ])
+  if test $gl_cv_const_PTHREAD_MUTEX_RECURSIVE != yes; then
+    HAVE_PTHREAD_MUTEX_RECURSIVE=0
+  fi
+
+  AC_CACHE_CHECK([for PTHREAD_MUTEX_ROBUST],
+    [gl_cv_const_PTHREAD_MUTEX_ROBUST],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <pthread.h>
+            int x = PTHREAD_MUTEX_ROBUST;
+          ]],
+          [[]])],
+       [gl_cv_const_PTHREAD_MUTEX_ROBUST=yes],
+       [gl_cv_const_PTHREAD_MUTEX_ROBUST=no])
+    ])
+  if test $gl_cv_const_PTHREAD_MUTEX_ROBUST != yes; then
+    HAVE_PTHREAD_MUTEX_ROBUST=0
+  fi
+
+  AC_CACHE_CHECK([for PTHREAD_PROCESS_SHARED],
+    [gl_cv_const_PTHREAD_PROCESS_SHARED],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <pthread.h>
+            int x = PTHREAD_PROCESS_SHARED;
+          ]],
+          [[]])],
+       [gl_cv_const_PTHREAD_PROCESS_SHARED=yes],
+       [gl_cv_const_PTHREAD_PROCESS_SHARED=no])
+    ])
+  if test $gl_cv_const_PTHREAD_PROCESS_SHARED != yes; then
+    HAVE_PTHREAD_PROCESS_SHARED=0
+  fi
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, if it is not common
+  dnl enough to be declared everywhere.
+  gl_WARN_ON_USE_PREPARE([[#include <pthread.h>
+    ]], [
+    pthread_create pthread_attr_init pthread_attr_getdetachstate
+    pthread_attr_setdetachstate pthread_attr_destroy pthread_self pthread_equal
+    pthread_detach pthread_join pthread_exit
+    pthread_once
+    pthread_mutex_init pthread_mutexattr_init pthread_mutexattr_gettype
+    pthread_mutexattr_settype pthread_mutexattr_getrobust
+    pthread_mutexattr_setrobust pthread_mutexattr_destroy pthread_mutex_lock
+    pthread_mutex_trylock pthread_mutex_timedlock pthread_mutex_unlock
+    pthread_mutex_destroy
+    pthread_rwlock_init pthread_rwlockattr_init pthread_rwlockattr_destroy
+    pthread_rwlock_rdlock pthread_rwlock_wrlock pthread_rwlock_tryrdlock
+    pthread_rwlock_trywrlock pthread_rwlock_timedrdlock
+    pthread_rwlock_timedwrlock pthread_rwlock_unlock pthread_rwlock_destroy
+    pthread_cond_init pthread_condattr_init pthread_condattr_destroy
+    pthread_cond_wait pthread_cond_timedwait pthread_cond_signal
+    pthread_cond_broadcast pthread_cond_destroy
+    pthread_key_create pthread_setspecific pthread_getspecific
+    pthread_key_delete
+    pthread_spin_init pthread_spin_lock pthread_spin_trylock pthread_spin_unlock
+    pthread_spin_destroy])
+
+  AC_REQUIRE([AC_C_RESTRICT])
+
+  dnl For backward compatibility with gnulib versions <= 2019-07.
+  LIB_PTHREAD="$LIBPMULTITHREAD"
+  AC_SUBST([LIB_PTHREAD])
+])
+
+# gl_PTHREAD_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_PTHREAD_MODULE_INDICATOR],
+[
+  dnl Ensure to expand the default settings once only.
+  gl_PTHREAD_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_PTHREAD_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_PTHREAD_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_THREAD])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_ONCE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_MUTEX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_RWLOCK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_COND])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_TSS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_SPIN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_MUTEX_TIMEDLOCK])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_PTHREAD_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_PTHREAD_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_PTHREAD_H_DEFAULTS],
+[
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_PTHREAD_T=1;                      AC_SUBST([HAVE_PTHREAD_T])
+  HAVE_PTHREAD_SPINLOCK_T=1;             AC_SUBST([HAVE_PTHREAD_SPINLOCK_T])
+  HAVE_PTHREAD_CREATE_DETACHED=1;        AC_SUBST([HAVE_PTHREAD_CREATE_DETACHED])
+  HAVE_PTHREAD_MUTEX_RECURSIVE=1;        AC_SUBST([HAVE_PTHREAD_MUTEX_RECURSIVE])
+  HAVE_PTHREAD_MUTEX_ROBUST=1;           AC_SUBST([HAVE_PTHREAD_MUTEX_ROBUST])
+  HAVE_PTHREAD_PROCESS_SHARED=1;         AC_SUBST([HAVE_PTHREAD_PROCESS_SHARED])
+  HAVE_PTHREAD_CREATE=1;                 AC_SUBST([HAVE_PTHREAD_CREATE])
+  HAVE_PTHREAD_ATTR_INIT=1;              AC_SUBST([HAVE_PTHREAD_ATTR_INIT])
+  HAVE_PTHREAD_ATTR_GETDETACHSTATE=1;    AC_SUBST([HAVE_PTHREAD_ATTR_GETDETACHSTATE])
+  HAVE_PTHREAD_ATTR_SETDETACHSTATE=1;    AC_SUBST([HAVE_PTHREAD_ATTR_SETDETACHSTATE])
+  HAVE_PTHREAD_ATTR_DESTROY=1;           AC_SUBST([HAVE_PTHREAD_ATTR_DESTROY])
+  HAVE_PTHREAD_SELF=1;                   AC_SUBST([HAVE_PTHREAD_SELF])
+  HAVE_PTHREAD_EQUAL=1;                  AC_SUBST([HAVE_PTHREAD_EQUAL])
+  HAVE_PTHREAD_DETACH=1;                 AC_SUBST([HAVE_PTHREAD_DETACH])
+  HAVE_PTHREAD_JOIN=1;                   AC_SUBST([HAVE_PTHREAD_JOIN])
+  HAVE_PTHREAD_EXIT=1;                   AC_SUBST([HAVE_PTHREAD_EXIT])
+  HAVE_PTHREAD_ONCE=1;                   AC_SUBST([HAVE_PTHREAD_ONCE])
+  HAVE_PTHREAD_MUTEX_INIT=1;             AC_SUBST([HAVE_PTHREAD_MUTEX_INIT])
+  HAVE_PTHREAD_MUTEXATTR_INIT=1;         AC_SUBST([HAVE_PTHREAD_MUTEXATTR_INIT])
+  HAVE_PTHREAD_MUTEXATTR_GETTYPE=1;      AC_SUBST([HAVE_PTHREAD_MUTEXATTR_GETTYPE])
+  HAVE_PTHREAD_MUTEXATTR_SETTYPE=1;      AC_SUBST([HAVE_PTHREAD_MUTEXATTR_SETTYPE])
+  HAVE_PTHREAD_MUTEXATTR_GETROBUST=1;    AC_SUBST([HAVE_PTHREAD_MUTEXATTR_GETROBUST])
+  HAVE_PTHREAD_MUTEXATTR_SETROBUST=1;    AC_SUBST([HAVE_PTHREAD_MUTEXATTR_SETROBUST])
+  HAVE_PTHREAD_MUTEXATTR_DESTROY=1;      AC_SUBST([HAVE_PTHREAD_MUTEXATTR_DESTROY])
+  HAVE_PTHREAD_MUTEX_LOCK=1;             AC_SUBST([HAVE_PTHREAD_MUTEX_LOCK])
+  HAVE_PTHREAD_MUTEX_TRYLOCK=1;          AC_SUBST([HAVE_PTHREAD_MUTEX_TRYLOCK])
+  HAVE_PTHREAD_MUTEX_TIMEDLOCK=1;        AC_SUBST([HAVE_PTHREAD_MUTEX_TIMEDLOCK])
+  HAVE_PTHREAD_MUTEX_UNLOCK=1;           AC_SUBST([HAVE_PTHREAD_MUTEX_UNLOCK])
+  HAVE_PTHREAD_MUTEX_DESTROY=1;          AC_SUBST([HAVE_PTHREAD_MUTEX_DESTROY])
+  HAVE_PTHREAD_RWLOCK_INIT=1;            AC_SUBST([HAVE_PTHREAD_RWLOCK_INIT])
+  HAVE_PTHREAD_RWLOCKATTR_INIT=1;        AC_SUBST([HAVE_PTHREAD_RWLOCKATTR_INIT])
+  HAVE_PTHREAD_RWLOCKATTR_DESTROY=1;     AC_SUBST([HAVE_PTHREAD_RWLOCKATTR_DESTROY])
+  HAVE_PTHREAD_RWLOCK_RDLOCK=1;          AC_SUBST([HAVE_PTHREAD_RWLOCK_RDLOCK])
+  HAVE_PTHREAD_RWLOCK_WRLOCK=1;          AC_SUBST([HAVE_PTHREAD_RWLOCK_WRLOCK])
+  HAVE_PTHREAD_RWLOCK_TRYRDLOCK=1;       AC_SUBST([HAVE_PTHREAD_RWLOCK_TRYRDLOCK])
+  HAVE_PTHREAD_RWLOCK_TRYWRLOCK=1;       AC_SUBST([HAVE_PTHREAD_RWLOCK_TRYWRLOCK])
+  HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK=1;     AC_SUBST([HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK])
+  HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK=1;     AC_SUBST([HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK])
+  HAVE_PTHREAD_RWLOCK_UNLOCK=1;          AC_SUBST([HAVE_PTHREAD_RWLOCK_UNLOCK])
+  HAVE_PTHREAD_RWLOCK_DESTROY=1;         AC_SUBST([HAVE_PTHREAD_RWLOCK_DESTROY])
+  HAVE_PTHREAD_COND_INIT=1;              AC_SUBST([HAVE_PTHREAD_COND_INIT])
+  HAVE_PTHREAD_CONDATTR_INIT=1;          AC_SUBST([HAVE_PTHREAD_CONDATTR_INIT])
+  HAVE_PTHREAD_CONDATTR_DESTROY=1;       AC_SUBST([HAVE_PTHREAD_CONDATTR_DESTROY])
+  HAVE_PTHREAD_COND_WAIT=1;              AC_SUBST([HAVE_PTHREAD_COND_WAIT])
+  HAVE_PTHREAD_COND_TIMEDWAIT=1;         AC_SUBST([HAVE_PTHREAD_COND_TIMEDWAIT])
+  HAVE_PTHREAD_COND_SIGNAL=1;            AC_SUBST([HAVE_PTHREAD_COND_SIGNAL])
+  HAVE_PTHREAD_COND_BROADCAST=1;         AC_SUBST([HAVE_PTHREAD_COND_BROADCAST])
+  HAVE_PTHREAD_COND_DESTROY=1;           AC_SUBST([HAVE_PTHREAD_COND_DESTROY])
+  HAVE_PTHREAD_KEY_CREATE=1;             AC_SUBST([HAVE_PTHREAD_KEY_CREATE])
+  HAVE_PTHREAD_SETSPECIFIC=1;            AC_SUBST([HAVE_PTHREAD_SETSPECIFIC])
+  HAVE_PTHREAD_GETSPECIFIC=1;            AC_SUBST([HAVE_PTHREAD_GETSPECIFIC])
+  HAVE_PTHREAD_KEY_DELETE=1;             AC_SUBST([HAVE_PTHREAD_KEY_DELETE])
+  HAVE_PTHREAD_SPIN_INIT=1;              AC_SUBST([HAVE_PTHREAD_SPIN_INIT])
+  HAVE_PTHREAD_SPIN_LOCK=1;              AC_SUBST([HAVE_PTHREAD_SPIN_LOCK])
+  HAVE_PTHREAD_SPIN_TRYLOCK=1;           AC_SUBST([HAVE_PTHREAD_SPIN_TRYLOCK])
+  HAVE_PTHREAD_SPIN_UNLOCK=1;            AC_SUBST([HAVE_PTHREAD_SPIN_UNLOCK])
+  HAVE_PTHREAD_SPIN_DESTROY=1;           AC_SUBST([HAVE_PTHREAD_SPIN_DESTROY])
+  REPLACE_PTHREAD_CREATE=0;              AC_SUBST([REPLACE_PTHREAD_CREATE])
+  REPLACE_PTHREAD_ATTR_INIT=0;           AC_SUBST([REPLACE_PTHREAD_ATTR_INIT])
+  REPLACE_PTHREAD_ATTR_GETDETACHSTATE=0; AC_SUBST([REPLACE_PTHREAD_ATTR_GETDETACHSTATE])
+  REPLACE_PTHREAD_ATTR_SETDETACHSTATE=0; AC_SUBST([REPLACE_PTHREAD_ATTR_SETDETACHSTATE])
+  REPLACE_PTHREAD_ATTR_DESTROY=0;        AC_SUBST([REPLACE_PTHREAD_ATTR_DESTROY])
+  REPLACE_PTHREAD_SELF=0;                AC_SUBST([REPLACE_PTHREAD_SELF])
+  REPLACE_PTHREAD_EQUAL=0;               AC_SUBST([REPLACE_PTHREAD_EQUAL])
+  REPLACE_PTHREAD_DETACH=0;              AC_SUBST([REPLACE_PTHREAD_DETACH])
+  REPLACE_PTHREAD_JOIN=0;                AC_SUBST([REPLACE_PTHREAD_JOIN])
+  REPLACE_PTHREAD_EXIT=0;                AC_SUBST([REPLACE_PTHREAD_EXIT])
+  REPLACE_PTHREAD_ONCE=0;                AC_SUBST([REPLACE_PTHREAD_ONCE])
+  REPLACE_PTHREAD_MUTEX_INIT=0;          AC_SUBST([REPLACE_PTHREAD_MUTEX_INIT])
+  REPLACE_PTHREAD_MUTEXATTR_INIT=0;      AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_INIT])
+  REPLACE_PTHREAD_MUTEXATTR_GETTYPE=0;   AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_GETTYPE])
+  REPLACE_PTHREAD_MUTEXATTR_SETTYPE=0;   AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_SETTYPE])
+  REPLACE_PTHREAD_MUTEXATTR_GETROBUST=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_GETROBUST])
+  REPLACE_PTHREAD_MUTEXATTR_SETROBUST=0; AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_SETROBUST])
+  REPLACE_PTHREAD_MUTEXATTR_DESTROY=0;   AC_SUBST([REPLACE_PTHREAD_MUTEXATTR_DESTROY])
+  REPLACE_PTHREAD_MUTEX_LOCK=0;          AC_SUBST([REPLACE_PTHREAD_MUTEX_LOCK])
+  REPLACE_PTHREAD_MUTEX_TRYLOCK=0;       AC_SUBST([REPLACE_PTHREAD_MUTEX_TRYLOCK])
+  REPLACE_PTHREAD_MUTEX_TIMEDLOCK=0;     AC_SUBST([REPLACE_PTHREAD_MUTEX_TIMEDLOCK])
+  REPLACE_PTHREAD_MUTEX_UNLOCK=0;        AC_SUBST([REPLACE_PTHREAD_MUTEX_UNLOCK])
+  REPLACE_PTHREAD_MUTEX_DESTROY=0;       AC_SUBST([REPLACE_PTHREAD_MUTEX_DESTROY])
+  REPLACE_PTHREAD_RWLOCK_INIT=0;         AC_SUBST([REPLACE_PTHREAD_RWLOCK_INIT])
+  REPLACE_PTHREAD_RWLOCKATTR_INIT=0;     AC_SUBST([REPLACE_PTHREAD_RWLOCKATTR_INIT])
+  REPLACE_PTHREAD_RWLOCKATTR_DESTROY=0;  AC_SUBST([REPLACE_PTHREAD_RWLOCKATTR_DESTROY])
+  REPLACE_PTHREAD_RWLOCK_RDLOCK=0;       AC_SUBST([REPLACE_PTHREAD_RWLOCK_RDLOCK])
+  REPLACE_PTHREAD_RWLOCK_WRLOCK=0;       AC_SUBST([REPLACE_PTHREAD_RWLOCK_WRLOCK])
+  REPLACE_PTHREAD_RWLOCK_TRYRDLOCK=0;    AC_SUBST([REPLACE_PTHREAD_RWLOCK_TRYRDLOCK])
+  REPLACE_PTHREAD_RWLOCK_TRYWRLOCK=0;    AC_SUBST([REPLACE_PTHREAD_RWLOCK_TRYWRLOCK])
+  REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK=0;  AC_SUBST([REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK])
+  REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK=0;  AC_SUBST([REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK])
+  REPLACE_PTHREAD_RWLOCK_UNLOCK=0;       AC_SUBST([REPLACE_PTHREAD_RWLOCK_UNLOCK])
+  REPLACE_PTHREAD_RWLOCK_DESTROY=0;      AC_SUBST([REPLACE_PTHREAD_RWLOCK_DESTROY])
+  REPLACE_PTHREAD_COND_INIT=0;           AC_SUBST([REPLACE_PTHREAD_COND_INIT])
+  REPLACE_PTHREAD_CONDATTR_INIT=0;       AC_SUBST([REPLACE_PTHREAD_CONDATTR_INIT])
+  REPLACE_PTHREAD_CONDATTR_DESTROY=0;    AC_SUBST([REPLACE_PTHREAD_CONDATTR_DESTROY])
+  REPLACE_PTHREAD_COND_WAIT=0;           AC_SUBST([REPLACE_PTHREAD_COND_WAIT])
+  REPLACE_PTHREAD_COND_TIMEDWAIT=0;      AC_SUBST([REPLACE_PTHREAD_COND_TIMEDWAIT])
+  REPLACE_PTHREAD_COND_SIGNAL=0;         AC_SUBST([REPLACE_PTHREAD_COND_SIGNAL])
+  REPLACE_PTHREAD_COND_BROADCAST=0;      AC_SUBST([REPLACE_PTHREAD_COND_BROADCAST])
+  REPLACE_PTHREAD_COND_DESTROY=0;        AC_SUBST([REPLACE_PTHREAD_COND_DESTROY])
+  REPLACE_PTHREAD_KEY_CREATE=0;          AC_SUBST([REPLACE_PTHREAD_KEY_CREATE])
+  REPLACE_PTHREAD_SETSPECIFIC=0;         AC_SUBST([REPLACE_PTHREAD_SETSPECIFIC])
+  REPLACE_PTHREAD_GETSPECIFIC=0;         AC_SUBST([REPLACE_PTHREAD_GETSPECIFIC])
+  REPLACE_PTHREAD_KEY_DELETE=0;          AC_SUBST([REPLACE_PTHREAD_KEY_DELETE])
+  REPLACE_PTHREAD_SPIN_INIT=0;           AC_SUBST([REPLACE_PTHREAD_SPIN_INIT])
+  REPLACE_PTHREAD_SPIN_LOCK=0;           AC_SUBST([REPLACE_PTHREAD_SPIN_LOCK])
+  REPLACE_PTHREAD_SPIN_TRYLOCK=0;        AC_SUBST([REPLACE_PTHREAD_SPIN_TRYLOCK])
+  REPLACE_PTHREAD_SPIN_UNLOCK=0;         AC_SUBST([REPLACE_PTHREAD_SPIN_UNLOCK])
+  REPLACE_PTHREAD_SPIN_DESTROY=0;        AC_SUBST([REPLACE_PTHREAD_SPIN_DESTROY])
+])
diff --git a/m4/pthread_rwlock_rdlock.m4 b/m4/pthread_rwlock_rdlock.m4
new file mode 100644 (file)
index 0000000..a5fbead
--- /dev/null
@@ -0,0 +1,185 @@
+# pthread_rwlock_rdlock.m4 serial 4
+dnl Copyright (C) 2017-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+dnl Inspired by
+dnl https://github.com/linux-test-project/ltp/blob/master/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-2.c
+dnl by Intel Corporation.
+
+dnl Test whether in a situation where
+dnl   - an rwlock is taken by a reader and has a writer waiting,
+dnl   - an additional reader requests the lock,
+dnl   - the waiting writer and the requesting reader threads have the same
+dnl     priority,
+dnl the requesting reader thread gets blocked, so that at some point the
+dnl waiting writer can acquire the lock.
+dnl Without such a guarantee, when there a N readers and each of the readers
+dnl spends more than 1/Nth of the time with the lock held, there is a high
+dnl probability that the waiting writer will not get the lock in a given finite
+dnl time, a phenomenon called "writer starvation".
+dnl Without such a guarantee, applications have a hard time avoiding writer
+dnl starvation.
+dnl
+dnl POSIX:2017 makes this requirement only for implementations that support TPS
+dnl (Thread Priority Scheduling) and only for the scheduling policies SCHED_FIFO
+dnl and SCHED_RR, see
+dnl https://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html
+dnl but this test verifies the guarantee regardless of TPS and regardless of
+dnl scheduling policy.
+dnl Glibc does not provide this guarantee (and never will on Linux), see
+dnl https://sourceware.org/bugzilla/show_bug.cgi?id=13701
+dnl https://bugzilla.redhat.com/show_bug.cgi?id=1410052
+AC_DEFUN([gl_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER],
+[
+  AC_REQUIRE([gl_THREADLIB_EARLY])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_CACHE_CHECK([whether pthread_rwlock_rdlock prefers a writer to a reader],
+    [gl_cv_pthread_rwlock_rdlock_prefer_writer],
+    [save_LIBS="$LIBS"
+     LIBS="$LIBS $LIBMULTITHREAD"
+     AC_RUN_IFELSE(
+       [AC_LANG_SOURCE([[
+#include <errno.h>
+#include <pthread.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#define SUCCEED() exit (0)
+#define FAILURE() exit (1)
+#define UNEXPECTED(n) (exit (10 + (n)))
+
+/* The main thread creates the waiting writer and the requesting reader threads
+   in the default way; this guarantees that they have the same priority.
+   We can reuse the main thread as first reader thread.  */
+
+static pthread_rwlock_t lock;
+static pthread_t reader1;
+static pthread_t writer;
+static pthread_t reader2;
+static pthread_t timer;
+/* Used to pass control from writer to reader2 and from reader2 to timer,
+   as in a relay race.
+   Passing control from one running thread to another running thread
+   is most likely faster than to create the second thread.  */
+static pthread_mutex_t baton;
+
+static void *
+timer_func (void *ignored)
+{
+  /* Step 13 (can be before or after step 12):
+     The timer thread takes the baton, then waits a moment to make sure
+     it can tell whether the second reader thread is blocked at step 12.  */
+  if (pthread_mutex_lock (&baton))
+    UNEXPECTED (13);
+  usleep (100000);
+  /* By the time we get here, it's clear that the second reader thread is
+     blocked at step 12.  This is the desired behaviour.  */
+  SUCCEED ();
+}
+
+static void *
+reader2_func (void *ignored)
+{
+  int err;
+
+  /* Step 8 (can be before or after step 7):
+     The second reader thread takes the baton, then waits a moment to make sure
+     the writer thread has reached step 7.  */
+  if (pthread_mutex_lock (&baton))
+    UNEXPECTED (8);
+  usleep (100000);
+  /* Step 9: The second reader thread requests the lock.  */
+  err = pthread_rwlock_tryrdlock (&lock);
+  if (err == 0)
+    FAILURE ();
+  else if (err != EBUSY)
+    UNEXPECTED (9);
+  /* Step 10: Launch a timer, to test whether the next call blocks.  */
+  if (pthread_create (&timer, NULL, timer_func, NULL))
+    UNEXPECTED (10);
+  /* Step 11: Release the baton.  */
+  if (pthread_mutex_unlock (&baton))
+    UNEXPECTED (11);
+  /* Step 12: The second reader thread requests the lock.  */
+  err = pthread_rwlock_rdlock (&lock);
+  if (err == 0)
+    FAILURE ();
+  else
+    UNEXPECTED (12);
+}
+
+static void *
+writer_func (void *ignored)
+{
+  /* Step 4: Take the baton, so that the second reader thread does not go ahead
+     too early.  */
+  if (pthread_mutex_lock (&baton))
+    UNEXPECTED (4);
+  /* Step 5: Create the second reader thread.  */
+  if (pthread_create (&reader2, NULL, reader2_func, NULL))
+    UNEXPECTED (5);
+  /* Step 6: Release the baton.  */
+  if (pthread_mutex_unlock (&baton))
+    UNEXPECTED (6);
+  /* Step 7: The writer thread requests the lock.  */
+  if (pthread_rwlock_wrlock (&lock))
+    UNEXPECTED (7);
+  return NULL;
+}
+
+int
+main ()
+{
+  reader1 = pthread_self ();
+
+  /* Step 1: The main thread initializes the lock and the baton.  */
+  if (pthread_rwlock_init (&lock, NULL))
+    UNEXPECTED (1);
+  if (pthread_mutex_init (&baton, NULL))
+    UNEXPECTED (1);
+  /* Step 2: The main thread acquires the lock as a reader.  */
+  if (pthread_rwlock_rdlock (&lock))
+    UNEXPECTED (2);
+  /* Step 3: Create the writer thread.  */
+  if (pthread_create (&writer, NULL, writer_func, NULL))
+    UNEXPECTED (3);
+  /* Job done.  Go to sleep.  */
+  for (;;)
+    {
+      sleep (1);
+    }
+}
+]])],
+       [gl_cv_pthread_rwlock_rdlock_prefer_writer=yes],
+       [gl_cv_pthread_rwlock_rdlock_prefer_writer=no],
+       [case "$host_os" in
+                         # Guess no on glibc systems.
+          *-gnu* | gnu*) gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+                         # Guess no on musl systems.
+          *-musl*)       gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+                         # Guess no on bionic systems.
+          *-android*)    gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no" ;;
+                         # Guess yes on native Windows with the mingw-w64 winpthreads library.
+                         # Guess no on native Windows with the gnulib windows-rwlock module.
+          mingw*)        if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
+                           gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing yes"
+                         else
+                           gl_cv_pthread_rwlock_rdlock_prefer_writer="guessing no"
+                         fi
+                         ;;
+                         # If we don't know, obey --enable-cross-guesses.
+          *)             gl_cv_pthread_rwlock_rdlock_prefer_writer="$gl_cross_guess_normal" ;;
+         esac
+       ])
+     LIBS="$save_LIBS"
+    ])
+  case "$gl_cv_pthread_rwlock_rdlock_prefer_writer" in
+    *yes)
+      AC_DEFINE([HAVE_PTHREAD_RWLOCK_RDLOCK_PREFER_WRITER], [1],
+        [Define if the 'pthread_rwlock_rdlock' function prefers a writer to a reader.])
+      ;;
+  esac
+])
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4
new file mode 100644 (file)
index 0000000..ff7fa96
--- /dev/null
@@ -0,0 +1,274 @@
+# pthread_sigmask.m4 serial 21
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_PTHREAD_SIGMASK],
+[
+  AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+
+  AC_CHECK_FUNCS_ONCE([pthread_sigmask])
+
+  dnl On MinGW pthread_sigmask is just a macro which always returns 0.
+  dnl It does not exist as a real function, which is required by POSIX.
+  AC_CACHE_CHECK([whether pthread_sigmask is a macro],
+    [gl_cv_func_pthread_sigmask_macro],
+    [AC_EGREP_CPP([headers_define_pthread_sigmask], [
+#include <pthread.h>
+#include <signal.h>
+#ifdef pthread_sigmask
+ headers_define_pthread_sigmask
+#endif],
+       [gl_cv_func_pthread_sigmask_macro=yes],
+       [gl_cv_func_pthread_sigmask_macro=no])
+    ])
+
+  LIB_PTHREAD_SIGMASK=
+
+  if test $gl_cv_func_pthread_sigmask_macro = yes; then
+    dnl pthread_sigmask is a dummy macro.
+    HAVE_PTHREAD_SIGMASK=0
+    dnl Make sure to '#undef pthread_sigmask' before defining it.
+    REPLACE_PTHREAD_SIGMASK=1
+  else
+    dnl Test whether the gnulib module 'threadlib' is in use.
+    dnl Some packages like Emacs use --avoid=threadlib.
+    dnl Write the symbol in such a way that it does not cause 'aclocal' to pick
+    dnl the threadlib.m4 file that is installed in $PREFIX/share/aclocal/.
+    m4_ifdef([gl_][THREADLIB], [
+      AC_REQUIRE([gl_][THREADLIB])
+
+      if test "$gl_threads_api" = posix; then
+        if test $ac_cv_func_pthread_sigmask = yes; then
+          dnl pthread_sigmask is available without -lpthread.
+          :
+        else
+          if test -n "$LIBMULTITHREAD"; then
+            AC_CACHE_CHECK([for pthread_sigmask in $LIBMULTITHREAD],
+              [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD],
+              [gl_save_LIBS="$LIBS"
+               LIBS="$LIBS $LIBMULTITHREAD"
+               AC_LINK_IFELSE(
+                 [AC_LANG_PROGRAM(
+                    [[#include <pthread.h>
+                      #include <signal.h>
+                    ]],
+                    [[return pthread_sigmask (0, (sigset_t *) 0, (sigset_t *) 0);]])
+                 ],
+                 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=yes],
+                 [gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD=no])
+               LIBS="$gl_save_LIBS"
+              ])
+            if test $gl_cv_func_pthread_sigmask_in_LIBMULTITHREAD = yes; then
+              dnl pthread_sigmask is available with -pthread or -lpthread.
+              LIB_PTHREAD_SIGMASK="$LIBMULTITHREAD"
+            else
+              dnl pthread_sigmask is not available at all.
+              HAVE_PTHREAD_SIGMASK=0
+            fi
+          else
+            dnl pthread_sigmask is not available at all.
+            HAVE_PTHREAD_SIGMASK=0
+          fi
+        fi
+      else
+        dnl pthread_sigmask may exist but does not interoperate with the chosen
+        dnl multithreading facility.
+        if test $ac_cv_func_pthread_sigmask = yes; then
+          REPLACE_PTHREAD_SIGMASK=1
+        else
+          HAVE_PTHREAD_SIGMASK=0
+        fi
+      fi
+    ], [
+      dnl The module 'threadlib' is not in use, due to --avoid=threadlib being
+      dnl specified.
+      dnl The package either has prepared CPPFLAGS and LIBS for use of
+      dnl POSIX:2008 threads, or wants to build single-threaded programs.
+      if test $ac_cv_func_pthread_sigmask = yes; then
+        dnl pthread_sigmask exists and does not require extra libraries.
+        dnl Assume that it is declared.
+        :
+      else
+        dnl pthread_sigmask either does not exist or needs extra libraries.
+        HAVE_PTHREAD_SIGMASK=0
+        dnl Define the symbol rpl_pthread_sigmask, not pthread_sigmask,
+        dnl so as to not accidentally override the system's pthread_sigmask
+        dnl symbol from libpthread. This is necessary on IRIX 6.5.
+        REPLACE_PTHREAD_SIGMASK=1
+      fi
+    ])
+  fi
+
+  AC_SUBST([LIB_PTHREAD_SIGMASK])
+  dnl We don't need a variable LTLIB_PTHREAD_SIGMASK, because when
+  dnl "$gl_threads_api" = posix, $LTLIBMULTITHREAD and $LIBMULTITHREAD are the
+  dnl same.
+
+  dnl Now test for some bugs in the system function.
+  if test $HAVE_PTHREAD_SIGMASK = 1; then
+    AC_REQUIRE([AC_PROG_CC])
+    AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+    dnl On FreeBSD 13.0, MidnightBSD 1.1, HP-UX 11.31, Solaris 9, in programs
+    dnl that are not linked with -lpthread, the pthread_sigmask() function
+    dnl always returns 0 and has no effect.
+    if test -z "$LIB_PTHREAD_SIGMASK"; then
+      case " $LIBS " in
+        *' -pthread '*) ;;
+        *' -lpthread '*) ;;
+        *)
+          AC_CACHE_CHECK([whether pthread_sigmask works without -lpthread],
+            [gl_cv_func_pthread_sigmask_in_libc_works],
+            [
+              AC_RUN_IFELSE(
+                [AC_LANG_SOURCE([[
+                   #include <pthread.h>
+                   #include <signal.h>
+                   #include <stddef.h>
+                   int main ()
+                   {
+                     sigset_t set;
+                     sigemptyset (&set);
+                     return pthread_sigmask (1729, &set, NULL) != 0;
+                   }]])],
+                [gl_cv_func_pthread_sigmask_in_libc_works=no],
+                [gl_cv_func_pthread_sigmask_in_libc_works=yes],
+                [
+                 changequote(,)dnl
+                 case "$host_os" in
+                   freebsd* | midnightbsd* | hpux* | solaris | solaris2.[2-9]*)
+                     gl_cv_func_pthread_sigmask_in_libc_works="guessing no";;
+                   *)
+                     gl_cv_func_pthread_sigmask_in_libc_works="guessing yes";;
+                 esac
+                 changequote([,])dnl
+                ])
+            ])
+          case "$gl_cv_func_pthread_sigmask_in_libc_works" in
+            *no)
+              REPLACE_PTHREAD_SIGMASK=1
+              AC_DEFINE([PTHREAD_SIGMASK_INEFFECTIVE], [1],
+                [Define to 1 if pthread_sigmask may return 0 and have no effect.])
+              ;;
+          esac;;
+      esac
+    fi
+
+    dnl On Cygwin 1.7.5, the pthread_sigmask() has a wrong return value
+    dnl convention: Upon failure, it returns -1 and sets errno.
+    AC_CACHE_CHECK([whether pthread_sigmask returns error numbers],
+      [gl_cv_func_pthread_sigmask_return_works],
+      [
+        gl_save_LIBS="$LIBS"
+        LIBS="$LIBS $LIB_PTHREAD_SIGMASK"
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
+#include <pthread.h>
+#include <signal.h>
+#include <stddef.h>
+int main ()
+{
+  sigset_t set;
+  sigemptyset (&set);
+  if (pthread_sigmask (1729, &set, NULL) == -1)
+    return 1;
+  return 0;
+}]])],
+          [gl_cv_func_pthread_sigmask_return_works=yes],
+          [gl_cv_func_pthread_sigmask_return_works=no],
+          [case "$host_os" in
+             cygwin*)
+               gl_cv_func_pthread_sigmask_return_works="guessing no";;
+             *)
+               gl_cv_func_pthread_sigmask_return_works="guessing yes";;
+           esac
+          ])
+        LIBS="$gl_save_LIBS"
+      ])
+    case "$gl_cv_func_pthread_sigmask_return_works" in
+      *no)
+        REPLACE_PTHREAD_SIGMASK=1
+        AC_DEFINE([PTHREAD_SIGMASK_FAILS_WITH_ERRNO], [1],
+          [Define to 1 if pthread_sigmask(), when it fails, returns -1 and sets errno.])
+        ;;
+    esac
+
+    dnl On IRIX 6.5, in a single-threaded program, pending signals are not
+    dnl immediately delivered when they are unblocked through pthread_sigmask,
+    dnl only a little while later.
+    AC_CACHE_CHECK([whether pthread_sigmask unblocks signals correctly],
+      [gl_cv_func_pthread_sigmask_unblock_works],
+      [
+        case "$host_os" in
+          irix*)
+            gl_cv_func_pthread_sigmask_unblock_works="guessing no";;
+          *)
+            gl_cv_func_pthread_sigmask_unblock_works="guessing yes";;
+        esac
+        m4_ifdef([gl_][THREADLIB],
+          [dnl Link against $LIBMULTITHREAD, not only $LIB_PTHREAD_SIGMASK.
+           dnl Otherwise we get a false positive on those platforms where
+           dnl $gl_cv_func_pthread_sigmask_in_libc_works is "no".
+           gl_save_LIBS=$LIBS
+           LIBS="$LIBS $LIBMULTITHREAD"])
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
+#include <pthread.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+]GL_MDA_DEFINES[
+static volatile int sigint_occurred;
+static void
+sigint_handler (int sig)
+{
+  sigint_occurred++;
+}
+int main ()
+{
+  sigset_t set;
+  int pid = getpid ();
+  char command[80];
+  signal (SIGINT, sigint_handler);
+  sigemptyset (&set);
+  sigaddset (&set, SIGINT);
+  if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
+    return 1;
+  sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
+  if (!(system (command) == 0))
+    return 2;
+  sleep (2);
+  if (!(sigint_occurred == 0))
+    return 3;
+  if (!(pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0))
+    return 4;
+  if (!(sigint_occurred == 1)) /* This fails on IRIX.  */
+    return 5;
+  return 0;
+}]])],
+          [:],
+          [gl_cv_func_pthread_sigmask_unblock_works=no],
+          [:])
+        m4_ifdef([gl_][THREADLIB], [LIBS=$gl_save_LIBS])
+      ])
+    case "$gl_cv_func_pthread_sigmask_unblock_works" in
+      *no)
+        REPLACE_PTHREAD_SIGMASK=1
+        AC_DEFINE([PTHREAD_SIGMASK_UNBLOCK_BUG], [1],
+          [Define to 1 if pthread_sigmask() unblocks signals incorrectly.])
+        ;;
+    esac
+  fi
+])
+
+# Prerequisite of lib/pthread_sigmask.c.
+AC_DEFUN([gl_PREREQ_PTHREAD_SIGMASK],
+[
+  if test $HAVE_PTHREAD_SIGMASK = 1; then
+    AC_DEFINE([HAVE_PTHREAD_SIGMASK], [1],
+      [Define to 1 if the pthread_sigmask function can be used (despite bugs).])
+  fi
+])
index c3c30d8..919984d 100644 (file)
@@ -1,5 +1,5 @@
-# putenv.m4 serial 20
-dnl Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# putenv.m4 serial 25
+dnl Copyright (C) 2002-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -14,33 +14,41 @@ AC_DEFUN([gl_FUNC_PUTENV],
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_CACHE_CHECK([for putenv compatible with GNU and SVID],
-   [gl_cv_func_svid_putenv],
-   [AC_RUN_IFELSE([AC_LANG_PROGRAM([AC_INCLUDES_DEFAULT],[[
-    /* Put it in env.  */
-    if (putenv ("CONFTEST_putenv=val"))
-      return 1;
+    [gl_cv_func_svid_putenv],
+    [AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM(
+          [AC_INCLUDES_DEFAULT
+           GL_MDA_DEFINES],
+          [[
+            /* Put it in env.  */
+            if (putenv ("CONFTEST_putenv=val"))
+              return 1;
 
-    /* Try to remove it.  */
-    if (putenv ("CONFTEST_putenv"))
-      return 2;
+            /* Try to remove it.  */
+            if (putenv ("CONFTEST_putenv"))
+              return 2;
 
-    /* Make sure it was deleted.  */
-    if (getenv ("CONFTEST_putenv") != 0)
-      return 3;
+            /* Make sure it was deleted.  */
+            if (getenv ("CONFTEST_putenv") != 0)
+              return 3;
 
-    return 0;
-              ]])],
-             gl_cv_func_svid_putenv=yes,
-             gl_cv_func_svid_putenv=no,
-             dnl When crosscompiling, assume putenv is broken.
-             [case "$host_os" in
-                        # Guess yes on glibc systems.
-                *-gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
-                        # If we don't know, assume the worst.
-                *)      gl_cv_func_svid_putenv="guessing no" ;;
-              esac
-             ])
-   ])
+            return 0;
+          ]])],
+       [gl_cv_func_svid_putenv=yes],
+       [gl_cv_func_svid_putenv=no],
+       [dnl When crosscompiling, assume putenv is broken.
+        case "$host_os" in
+                         # Guess yes on glibc systems.
+          *-gnu* | gnu*) gl_cv_func_svid_putenv="guessing yes" ;;
+                         # Guess yes on musl systems.
+          *-musl*)       gl_cv_func_svid_putenv="guessing yes" ;;
+                         # Guess no on native Windows.
+          mingw*)        gl_cv_func_svid_putenv="guessing no" ;;
+                         # If we don't know, obey --enable-cross-guesses.
+          *)             gl_cv_func_svid_putenv="$gl_cross_guess_normal" ;;
+        esac
+       ])
+    ])
   case "$gl_cv_func_svid_putenv" in
     *yes) ;;
     *)
index 2562375..19067f5 100644 (file)
@@ -1,10 +1,11 @@
-# quotearg.m4 serial 9
-dnl Copyright (C) 2002, 2004-2016 Free Software Foundation, Inc.
+# quotearg.m4 serial 10
+dnl Copyright (C) 2002, 2004-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_QUOTEARG],
 [
+  AC_REQUIRE([AC_C_RESTRICT])
   :
 ])
index 71c1f4c..4bf0ca9 100644 (file)
@@ -1,5 +1,5 @@
-# raise.m4 serial 3
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# raise.m4 serial 4
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,14 +8,16 @@ AC_DEFUN([gl_FUNC_RAISE],
 [
   AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
-  AC_REQUIRE([gl_MSVC_INVAL])
   AC_CHECK_FUNCS([raise])
   if test $ac_cv_func_raise = no; then
     HAVE_RAISE=0
   else
-    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-      REPLACE_RAISE=1
-    fi
+    m4_ifdef([gl_MSVC_INVAL], [
+      AC_REQUIRE([gl_MSVC_INVAL])
+      if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+        REPLACE_RAISE=1
+      fi
+    ])
     m4_ifdef([gl_SIGNALBLOCKING], [
       gl_SIGNALBLOCKING
       if test $HAVE_POSIX_SIGNALBLOCKING = 0; then
index d3ccb7e..452fab1 100644 (file)
@@ -1,5 +1,5 @@
-# rawmemchr.m4 serial 2
-dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+# rawmemchr.m4 serial 3
+dnl Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_RAWMEMCHR],
   dnl Persuade glibc <string.h> to declare rawmemchr().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
   AC_CHECK_FUNCS([rawmemchr])
   if test $ac_cv_func_rawmemchr = no; then
     HAVE_RAWMEMCHR=0
similarity index 55%
rename from m4/close-stream.m4
rename to m4/read-file.m4
index ddda027..ef50622 100644 (file)
@@ -1,11 +1,8 @@
-#serial 4
-dnl Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+# read-file.m4 serial 3
+dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl Prerequisites of lib/close-stream.c.
-AC_DEFUN([gl_CLOSE_STREAM],
-[
-  :
-])
+# Prerequisites of lib/read-file.c.
+AC_DEFUN([gl_PREREQ_READ_FILE], [:])
index eda3acf..94dc99c 100644 (file)
@@ -1,5 +1,5 @@
 # readdir.m4 serial 1
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index ede0378..352788c 100644 (file)
@@ -1,5 +1,5 @@
-# readlink.m4 serial 12
-dnl Copyright (C) 2003, 2007, 2009-2016 Free Software Foundation, Inc.
+# readlink.m4 serial 16
+dnl Copyright (C) 2003, 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -23,7 +23,7 @@ AC_DEFUN([gl_FUNC_READLINK],
     dnl Solaris 9 ignores trailing slash.
     dnl FreeBSD 7.2 dereferences only one level of links with trailing slash.
     AC_CACHE_CHECK([whether readlink handles trailing slash correctly],
-      [gl_cv_func_readlink_works],
+      [gl_cv_func_readlink_trailing_slash],
       [# We have readlink, so assume ln -s works.
        ln -s conftest.no-such conftest.link
        ln -s conftest.link conftest.lnk2
@@ -32,16 +32,22 @@ AC_DEFUN([gl_FUNC_READLINK],
            [[#include <unistd.h>
 ]], [[char buf[20];
       return readlink ("conftest.lnk2/", buf, sizeof buf) != -1;]])],
-         [gl_cv_func_readlink_works=yes], [gl_cv_func_readlink_works=no],
+         [gl_cv_func_readlink_trailing_slash=yes],
+         [gl_cv_func_readlink_trailing_slash=no],
          [case "$host_os" in
-                    # Guess yes on glibc systems.
-            *-gnu*) gl_cv_func_readlink_works="guessing yes" ;;
-                    # If we don't know, assume the worst.
-            *)      gl_cv_func_readlink_works="guessing no" ;;
+            # Guess yes on Linux or glibc systems.
+            linux-* | linux | *-gnu* | gnu*)
+              gl_cv_func_readlink_trailing_slash="guessing yes" ;;
+            # Guess no on AIX or HP-UX.
+            aix* | hpux*)
+              gl_cv_func_readlink_trailing_slash="guessing no" ;;
+            # If we don't know, obey --enable-cross-guesses.
+            *)
+              gl_cv_func_readlink_trailing_slash="$gl_cross_guess_normal" ;;
           esac
          ])
       rm -f conftest.link conftest.lnk2])
-    case "$gl_cv_func_readlink_works" in
+    case "$gl_cv_func_readlink_trailing_slash" in
       *yes)
         if test "$gl_cv_decl_readlink_works" != yes; then
           REPLACE_READLINK=1
@@ -53,6 +59,43 @@ AC_DEFUN([gl_FUNC_READLINK],
         REPLACE_READLINK=1
         ;;
     esac
+
+    AC_CACHE_CHECK([whether readlink truncates results correctly],
+      [gl_cv_func_readlink_truncate],
+      [# We have readlink, so assume ln -s works.
+       ln -s ab conftest.link
+       AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM(
+           [[#include <unistd.h>
+]], [[char c;
+      return readlink ("conftest.link", &c, 1) != 1;]])],
+         [gl_cv_func_readlink_truncate=yes],
+         [gl_cv_func_readlink_truncate=no],
+         [case "$host_os" in
+            # Guess yes on Linux or glibc systems.
+            linux-* | linux | *-gnu* | gnu*)
+              gl_cv_func_readlink_truncate="guessing yes" ;;
+            # Guess no on AIX or HP-UX.
+            aix* | hpux*)
+              gl_cv_func_readlink_truncate="guessing no" ;;
+            # If we don't know, obey --enable-cross-guesses.
+            *)
+              gl_cv_func_readlink_truncate="$gl_cross_guess_normal" ;;
+          esac
+         ])
+      rm -f conftest.link conftest.lnk2])
+    case $gl_cv_func_readlink_truncate in
+      *yes)
+        if test "$gl_cv_decl_readlink_works" != yes; then
+          REPLACE_READLINK=1
+        fi
+        ;;
+      *)
+        AC_DEFINE([READLINK_TRUNCATE_BUG], [1], [Define to 1 if readlink
+          sets errno instead of truncating a too-long link.])
+        REPLACE_READLINK=1
+        ;;
+    esac
   fi
 ])
 
diff --git a/m4/realloc.m4 b/m4/realloc.m4
new file mode 100644 (file)
index 0000000..0abc418
--- /dev/null
@@ -0,0 +1,63 @@
+# realloc.m4 serial 24
+dnl Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# This is adapted with modifications from upstream Autoconf here:
+# https://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/functions.m4?id=v2.70#n1455
+AC_DEFUN([_AC_FUNC_REALLOC_IF],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])dnl for cross-compiles
+  AC_CACHE_CHECK([whether realloc (0, 0) returns nonnull],
+    [ac_cv_func_realloc_0_nonnull],
+    [AC_RUN_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stdlib.h>
+          ]],
+          [[void *p = realloc (0, 0);
+            int result = !p;
+            free (p);
+            return result;]])
+       ],
+       [ac_cv_func_realloc_0_nonnull=yes],
+       [ac_cv_func_realloc_0_nonnull=no],
+       [case "$host_os" in
+          # Guess yes on platforms where we know the result.
+          *-gnu* | freebsd* | netbsd* | openbsd* | bitrig* \
+          | gnu* | *-musl* | midnightbsd* \
+          | hpux* | solaris* | cygwin* | mingw* | msys* )
+            ac_cv_func_realloc_0_nonnull="guessing yes" ;;
+          # If we don't know, obey --enable-cross-guesses.
+          *) ac_cv_func_realloc_0_nonnull="$gl_cross_guess_normal" ;;
+        esac
+       ])
+    ])
+  AS_CASE([$ac_cv_func_realloc_0_nonnull], [*yes], [$1], [$2])
+])# AC_FUNC_REALLOC
+
+# gl_FUNC_REALLOC_GNU
+# -------------------
+# Replace realloc if it is not compatible with GNU libc.
+AC_DEFUN([gl_FUNC_REALLOC_GNU],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_REALLOC_POSIX])
+  if test $REPLACE_REALLOC = 0; then
+    _AC_FUNC_REALLOC_IF([], [REPLACE_REALLOC=1])
+  fi
+])# gl_FUNC_REALLOC_GNU
+
+# gl_FUNC_REALLOC_POSIX
+# ---------------------
+# Test whether 'realloc' is POSIX compliant (sets errno to ENOMEM when it
+# fails, and doesn't mess up with ptrdiff_t overflow),
+# and replace realloc if it is not.
+AC_DEFUN([gl_FUNC_REALLOC_POSIX],
+[
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_MALLOC_POSIX])
+  if test $REPLACE_MALLOC = 1; then
+    REPLACE_REALLOC=1
+  fi
+])
diff --git a/m4/reallocarray.m4 b/m4/reallocarray.m4
new file mode 100644 (file)
index 0000000..9d8a626
--- /dev/null
@@ -0,0 +1,23 @@
+# reallocarray.m4 serial 3
+dnl Copyright (C) 2017-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_REALLOCARRAY],
+[
+  dnl Persuade glibc <stdlib.h> to declare reallocarray.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([gl_CHECK_MALLOC_PTRDIFF])
+  AC_CHECK_FUNCS([reallocarray])
+  if test "$ac_cv_func_reallocarray" = no; then
+    HAVE_REALLOCARRAY=0
+  elif test "$gl_cv_malloc_ptrdiff" = no; then
+    REPLACE_REALLOCARRAY=1
+  fi
+])
+
+# Prerequisites of lib/reallocarray.c.
+AC_DEFUN([gl_PREREQ_REALLOCARRAY], [:])
index abfd262..850c572 100644 (file)
@@ -1,6 +1,6 @@
-# serial 66
+# serial 71
 
-# Copyright (C) 1996-2001, 2003-2016 Free Software Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -13,6 +13,7 @@ AC_PREREQ([2.50])
 
 AC_DEFUN([gl_REGEX],
 [
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   AC_ARG_WITH([included-regex],
     [AS_HELP_STRING([--without-included-regex],
                     [don't compile regex; this is the default on systems
@@ -75,7 +76,7 @@ AC_DEFUN([gl_REGEX],
             if (setlocale (LC_ALL, "en_US.UTF-8"))
               {
                 {
-                  /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
+                  /* https://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
@@ -89,17 +90,20 @@ AC_DEFUN([gl_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;
-                  regfree (&regex);
+                  else
+                    {
+                      if (re_search (&regex, data, sizeof data - 1,
+                                     0, sizeof data - 1, &regs)
+                          != -1)
+                        result |= 1;
+                      regfree (&regex);
+                    }
                 }
 
                 {
                   /* This test is from glibc bug 15078.
                      The test case is from Andreas Schwab in
-                     <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
+                     <https://sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
                      */
                   static char const pat[] = "[^x]x";
                   static char const data[] =
@@ -124,8 +128,8 @@ AC_DEFUN([gl_REGEX],
                                      0, sizeof data - 1, 0);
                       if (i != 0 && i != 21)
                         result |= 1;
+                      regfree (&regex);
                     }
-                  regfree (&regex);
                 }
 
                 if (! setlocale (LC_ALL, "C"))
@@ -138,9 +142,13 @@ AC_DEFUN([gl_REGEX],
             s = re_compile_pattern ("a[^x]b", 6, &regex);
             if (s)
               result |= 2;
-            /* This should fail, but succeeds for glibc-2.5.  */
-            else if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
-              result |= 2;
+            else
+              {
+                /* This should fail, but succeeds for glibc-2.5.  */
+                if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
+                  result |= 2;
+                regfree (&regex);
+              }
 
             /* This regular expression is from Spencer ere test number 75
                in grep-2.3.  */
@@ -152,7 +160,10 @@ AC_DEFUN([gl_REGEX],
             s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
             /* This should fail with _Invalid character class name_ error.  */
             if (!s)
-              result |= 4;
+              {
+                result |= 4;
+                regfree (&regex);
+              }
 
             /* Ensure that [b-a] is diagnosed as invalid, when
                using RE_NO_EMPTY_RANGES. */
@@ -160,13 +171,18 @@ AC_DEFUN([gl_REGEX],
             memset (&regex, 0, sizeof regex);
             s = re_compile_pattern ("a[b-a]", 6, &regex);
             if (s == 0)
-              result |= 8;
+              {
+                result |= 8;
+                regfree (&regex);
+              }
 
             /* 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)
               result |= 8;
+            else
+              regfree (&regex);
 
             /* The following example is derived from a problem report
                against gawk from Jorge Stolfi <stolfi@ic.unicamp.br>.  */
@@ -174,17 +190,35 @@ AC_DEFUN([gl_REGEX],
             s = re_compile_pattern ("[an\371]*n", 7, &regex);
             if (s)
               result |= 8;
-            /* This should match, but does not for glibc-2.2.1.  */
-            else if (re_match (&regex, "an", 2, 0, &regs) != 2)
-              result |= 8;
+            else
+              {
+                /* This should match, but does not for glibc-2.2.1.  */
+                if (re_match (&regex, "an", 2, 0, &regs) != 2)
+                  result |= 8;
+                else
+                  {
+                    free (regs.start);
+                    free (regs.end);
+                  }
+                regfree (&regex);
+              }
 
             memset (&regex, 0, sizeof regex);
             s = re_compile_pattern ("x", 1, &regex);
             if (s)
               result |= 8;
-            /* glibc-2.2.93 does not work with a negative RANGE argument.  */
-            else if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
-              result |= 8;
+            else
+              {
+                /* glibc-2.2.93 does not work with a negative RANGE argument.  */
+                if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
+                  result |= 8;
+                else
+                  {
+                    free (regs.start);
+                    free (regs.end);
+                  }
+                regfree (&regex);
+              }
 
             /* The version of regex.c in older versions of gnulib
                ignored RE_ICASE.  Detect that problem too.  */
@@ -193,11 +227,20 @@ AC_DEFUN([gl_REGEX],
             s = re_compile_pattern ("x", 1, &regex);
             if (s)
               result |= 16;
-            else if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
-              result |= 16;
+            else
+              {
+                if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
+                  result |= 16;
+                else
+                  {
+                    free (regs.start);
+                    free (regs.end);
+                  }
+                regfree (&regex);
+              }
 
             /* Catch a bug reported by Vin Shelton in
-               http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html
+               https://lists.gnu.org/r/bug-coreutils/2007-06/msg00089.html
                */
             re_set_syntax (RE_SYNTAX_POSIX_BASIC
                            & ~RE_CONTEXT_INVALID_DUP
@@ -206,12 +249,31 @@ AC_DEFUN([gl_REGEX],
             s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
             if (s)
               result |= 32;
+            else
+              regfree (&regex);
 
             /* REG_STARTEND was added to glibc on 2004-01-15.
                Reject older versions.  */
             if (! REG_STARTEND)
               result |= 64;
 
+            /* Matching with the compiled form of this regexp would provoke
+               an assertion failure prior to glibc-2.28:
+                 regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+               With glibc-2.28, compilation fails and reports the invalid
+               back reference.  */
+            re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+            memset (&regex, 0, sizeof regex);
+            s = re_compile_pattern ("0|()0|\\1|0", 10, &regex);
+            if (!s)
+              result |= 64;
+            else
+              {
+                if (strcmp (s, "Invalid back reference"))
+                  result |= 64;
+                regfree (&regex);
+              }
+
 #if 0
             /* It would be nice to reject hosts whose regoff_t values are too
                narrow (including glibc on hosts with 64-bit ptrdiff_t and
@@ -226,13 +288,19 @@ AC_DEFUN([gl_REGEX],
 
             return result;
           ]])],
-       [gl_cv_func_re_compile_pattern_working=yes],
-       [gl_cv_func_re_compile_pattern_working=no],
-       dnl When crosscompiling, assume it is not working.
-       [gl_cv_func_re_compile_pattern_working=no])])
-    case $gl_cv_func_re_compile_pattern_working in #(
-    yes) ac_use_included_regex=no;; #(
-    no) ac_use_included_regex=yes;;
+        [gl_cv_func_re_compile_pattern_working=yes],
+        [gl_cv_func_re_compile_pattern_working=no],
+        [case "$host_os" in
+                   # Guess no on native Windows.
+           mingw*) gl_cv_func_re_compile_pattern_working="guessing no" ;;
+                   # Otherwise obey --enable-cross-guesses.
+           *)      gl_cv_func_re_compile_pattern_working="$gl_cross_guess_normal" ;;
+         esac
+        ])
+      ])
+    case "$gl_cv_func_re_compile_pattern_working" in #(
+      *yes) ac_use_included_regex=no;; #(
+      *no) ac_use_included_regex=yes;;
     esac
     ;;
   *) AC_MSG_ERROR([Invalid value for --with-included-regex: $with_included_regex])
@@ -286,7 +354,6 @@ AC_DEFUN([gl_PREREQ_REGEX],
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([AC_TYPE_MBSTATE_T])
   AC_REQUIRE([gl_EEMALLOC])
-  AC_REQUIRE([gl_GLIBC21])
   AC_CHECK_HEADERS([libintl.h])
   AC_CHECK_FUNCS_ONCE([isblank iswctype])
   AC_CHECK_DECLS([isblank], [], [], [[#include <ctype.h>]])
index fbcc758..8a95b8a 100644 (file)
@@ -1,6 +1,6 @@
-# serial 26
+# serial 33
 
-# Copyright (C) 2001, 2003, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2003, 2005-2006, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
@@ -19,7 +19,7 @@ AC_DEFUN([gl_FUNC_RENAME],
   AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AC_CHECK_FUNCS_ONCE([lstat])
 
-  dnl Solaris 10, AIX 7.1 mistakenly allow rename("file","name/").
+  dnl Solaris 11.3, AIX 7.1 mistakenly allow rename("file","name/").
   dnl NetBSD 1.6 mistakenly forbids rename("dir","name/").
   dnl FreeBSD 7.2 mistakenly allows rename("file","link-to-file/").
   dnl The Solaris bug can be worked around without stripping
@@ -55,10 +55,14 @@ AC_DEFUN([gl_FUNC_RENAME],
       [gl_cv_func_rename_slash_dst_works=no],
       dnl When crosscompiling, assume rename is broken.
       [case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_rename_slash_dst_works="guessing no" ;;
+                          # Guess yes on Linux systems.
+         linux-* | linux) gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+                          # Guess yes on glibc systems.
+         *-gnu*)          gl_cv_func_rename_slash_dst_works="guessing yes" ;;
+                          # Guess no on native Windows.
+         mingw*)          gl_cv_func_rename_slash_dst_works="guessing no" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+         *)               gl_cv_func_rename_slash_dst_works="$gl_cross_guess_normal" ;;
        esac
       ])
     rm -rf conftest.f conftest.f1 conftest.f2 conftest.d1 conftest.d2 conftest.lnk
@@ -69,7 +73,7 @@ AC_DEFUN([gl_FUNC_RENAME],
       REPLACE_RENAME=1
       AC_DEFINE([RENAME_TRAILING_SLASH_DEST_BUG], [1],
         [Define if rename does not correctly handle slashes on the destination
-         argument, such as on Solaris 10 or NetBSD 1.6.])
+         argument, such as on Solaris 11 or NetBSD 1.6.])
       ;;
   esac
 
@@ -107,10 +111,14 @@ AC_DEFUN([gl_FUNC_RENAME],
       [gl_cv_func_rename_slash_src_works=no],
       dnl When crosscompiling, assume rename is broken.
       [case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_rename_slash_src_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_rename_slash_src_works="guessing no" ;;
+                          # Guess yes on Linux systems.
+         linux-* | linux) gl_cv_func_rename_slash_src_works="guessing yes" ;;
+                          # Guess yes on glibc systems.
+         *-gnu*)          gl_cv_func_rename_slash_src_works="guessing yes" ;;
+                          # Guess yes on native Windows.
+         mingw*)          gl_cv_func_rename_slash_src_works="guessing yes" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+         *)               gl_cv_func_rename_slash_src_works="$gl_cross_guess_normal" ;;
        esac
       ])
     rm -rf conftest.f conftest.f1 conftest.d1 conftest.d2 conftest.d3 conftest.lnk
@@ -132,40 +140,58 @@ AC_DEFUN([gl_FUNC_RENAME],
   AC_CACHE_CHECK([whether rename manages hard links correctly],
     [gl_cv_func_rename_link_works],
     [if test $ac_cv_func_link = yes; then
-       rm -rf conftest.f conftest.f1
-       if touch conftest.f && ln conftest.f conftest.f1 &&
-           set x `ls -i conftest.f conftest.f1` && test "$2" = "$4"; then
-         AC_RUN_IFELSE(
-           [AC_LANG_PROGRAM([[
-#             include <stdio.h>
-#             include <stdlib.h>
-#             include <unistd.h>
-              ]],
-              [[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;
-              ]])],
-           [gl_cv_func_rename_link_works=yes],
-           [gl_cv_func_rename_link_works=no],
-           dnl When crosscompiling, assume rename is broken.
-           [case "$host_os" in
-                      # Guess yes on glibc systems.
-              *-gnu*) gl_cv_func_rename_link_works="guessing yes" ;;
-                      # If we don't know, assume the worst.
-              *)      gl_cv_func_rename_link_works="guessing no" ;;
-            esac
-           ])
+       if test $cross_compiling != yes; then
+         rm -rf conftest.f conftest.f1 conftest.f2
+         if touch conftest.f conftest.f2 && ln conftest.f conftest.f1 &&
+             set x `ls -i conftest.f conftest.f1` && test "$2" = "$4"; then
+           AC_RUN_IFELSE(
+             [AC_LANG_PROGRAM([[
+#               include <errno.h>
+#               include <stdio.h>
+#               include <stdlib.h>
+#               include <unistd.h>
+                ]GL_MDA_DEFINES],
+                [[int result = 0;
+                  if (rename ("conftest.f", "conftest.f1"))
+                    result |= 1;
+                  if (unlink ("conftest.f1"))
+                    result |= 2;
+
+                  /* Allow either the POSIX-required behavior, where the
+                     previous rename kept conftest.f, or the (better) NetBSD
+                     behavior, where it removed conftest.f.  */
+                  if (rename ("conftest.f", "conftest.f") != 0
+                      && errno != ENOENT)
+                    result |= 4;
+
+                  if (rename ("conftest.f1", "conftest.f1") == 0)
+                    result |= 8;
+                  if (rename ("conftest.f2", "conftest.f2") != 0)
+                    result |= 16;
+                  return result;
+                ]])],
+             [gl_cv_func_rename_link_works=yes],
+             [gl_cv_func_rename_link_works=no],
+             [dnl We don't get here.
+              :
+             ])
+         else
+           gl_cv_func_rename_link_works="guessing no"
+         fi
+         rm -rf conftest.f conftest.f1 conftest.f2
        else
-         gl_cv_func_rename_link_works="guessing no"
+         dnl When crosscompiling, assume rename is broken.
+         case "$host_os" in
+                            # Guess yes on Linux systems.
+           linux-* | linux) gl_cv_func_rename_link_works="guessing yes" ;;
+                            # Guess yes on glibc systems.
+           *-gnu*)          gl_cv_func_rename_link_works="guessing yes" ;;
+                            # Guess yes on native Windows.
+           mingw*)          gl_cv_func_rename_link_works="guessing yes" ;;
+                            # If we don't know, obey --enable-cross-guesses.
+           *)               gl_cv_func_rename_link_works="$gl_cross_guess_normal" ;;
+         esac
        fi
-       rm -rf conftest.f conftest.f1
      else
        gl_cv_func_rename_link_works=yes
      fi
@@ -205,10 +231,14 @@ AC_DEFUN([gl_FUNC_RENAME],
       [gl_cv_func_rename_dest_works=no],
       dnl When crosscompiling, assume rename is broken.
       [case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_rename_dest_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_rename_dest_works="guessing no" ;;
+                          # Guess yes on Linux systems.
+         linux-* | linux) gl_cv_func_rename_dest_works="guessing yes" ;;
+                          # Guess yes on glibc systems.
+         *-gnu*)          gl_cv_func_rename_dest_works="guessing yes" ;;
+                          # Guess no on native Windows.
+         mingw*)          gl_cv_func_rename_dest_works="guessing no" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+         *)               gl_cv_func_rename_dest_works="$gl_cross_guess_normal" ;;
        esac
       ])
     rm -rf conftest.f conftest.d1 conftest.d2
diff --git a/m4/rewinddir.m4 b/m4/rewinddir.m4
new file mode 100644 (file)
index 0000000..ed25456
--- /dev/null
@@ -0,0 +1,15 @@
+# rewinddir.m4 serial 1
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_REWINDDIR],
+[
+  AC_REQUIRE([gl_DIRENT_H_DEFAULTS])
+
+  AC_CHECK_FUNCS([rewinddir])
+  if test $ac_cv_func_rewinddir = no; then
+    HAVE_REWINDDIR=0
+  fi
+])
index ebb3b5d..82b9ccc 100644 (file)
@@ -1,5 +1,5 @@
-# rmdir.m4 serial 13
-dnl Copyright (C) 2002, 2005, 2009-2016 Free Software Foundation, Inc.
+# rmdir.m4 serial 18
+dnl Copyright (C) 2002, 2005, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -22,21 +22,26 @@ AC_DEFUN([gl_FUNC_RMDIR],
            #else /* on Windows with MSVC */
            # include <direct.h>
            #endif
-]], [[int result = 0;
-      if (!rmdir ("conftest.file/"))
-        result |= 1;
-      else if (errno != ENOTDIR)
-        result |= 2;
-      if (!rmdir ("conftest.dir/./"))
-        result |= 4;
-      return result;
-    ]])],
+         ]GL_MDA_DEFINES],
+         [[int result = 0;
+           if (!rmdir ("conftest.file/"))
+             result |= 1;
+           else if (errno != ENOTDIR)
+             result |= 2;
+           if (!rmdir ("conftest.dir/./"))
+             result |= 4;
+           return result;
+         ]])],
        [gl_cv_func_rmdir_works=yes], [gl_cv_func_rmdir_works=no],
        [case "$host_os" in
-                  # Guess yes on glibc systems.
-          *-gnu*) gl_cv_func_rmdir_works="guessing yes" ;;
-                  # If we don't know, assume the worst.
-          *)      gl_cv_func_rmdir_works="guessing no" ;;
+                           # Guess yes on Linux systems.
+          linux-* | linux) gl_cv_func_rmdir_works="guessing yes" ;;
+                           # Guess yes on glibc systems.
+          *-gnu* | gnu*)   gl_cv_func_rmdir_works="guessing yes" ;;
+                           # Guess no on native Windows.
+          mingw*)          gl_cv_func_rmdir_works="guessing no" ;;
+                           # If we don't know, obey --enable-cross-guesses.
+          *)               gl_cv_func_rmdir_works="$gl_cross_guess_normal" ;;
         esac
        ])
      rm -rf conftest.dir conftest.file])
similarity index 54%
rename from m4/hard-locale.m4
rename to m4/save-cwd.m4
index 4661bfc..74cfe96 100644 (file)
@@ -1,11 +1,11 @@
-# hard-locale.m4 serial 8
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+# serial 10
+dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-dnl No prerequisites of lib/hard-locale.c.
-AC_DEFUN([gl_HARD_LOCALE],
+dnl Prerequisites for lib/save-cwd.c.
+AC_DEFUN([gl_SAVE_CWD],
 [
-  :
+  AC_CHECK_FUNCS_ONCE([fchdir])
 ])
index 147613b..a840e3d 100644 (file)
-# sched_h.m4 serial 9
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# sched_h.m4 serial 15
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Bruno Haible.
 
-AC_DEFUN([gl_SCHED_H],
+AC_DEFUN_ONCE([gl_SCHED_H],
 [
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
+  AC_REQUIRE([gl_SCHED_H_DEFAULTS])
+
+  AC_REQUIRE([AC_CANONICAL_HOST])
+
   AC_CHECK_HEADERS_ONCE([sys/cdefs.h])
-  AC_COMPILE_IFELSE(
-    [AC_LANG_PROGRAM([[
-       #include <sched.h>
-       struct sched_param a;
-       int b[] = { SCHED_FIFO, SCHED_RR, SCHED_OTHER };
-       pid_t t1;
-     ]])],
-    [SCHED_H=''],
-    [SCHED_H='sched.h'
-     AC_CHECK_HEADERS([sched.h], [], [],
-       [[#if HAVE_SYS_CDEFS_H
-          #include <sys/cdefs.h>
-         #endif
-       ]])
-     gl_NEXT_HEADERS([sched.h])
-
-     if test "$ac_cv_header_sched_h" = yes; then
-       HAVE_SCHED_H=1
-     else
-       HAVE_SCHED_H=0
-     fi
-     AC_SUBST([HAVE_SCHED_H])
-
-     if test "$HAVE_SCHED_H" = 1; then
-       AC_CHECK_TYPE([struct sched_param],
-         [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
-         [[#if HAVE_SYS_CDEFS_H
-            #include <sys/cdefs.h>
-           #endif
-           #include <sched.h>
-         ]])
-     else
-       dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
-       AC_CHECK_TYPE([struct sched_param],
-         [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
-         [#include <spawn.h>])
-     fi
-     AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
-
-     if test "$ac_cv_header_sys_cdefs_h" = yes; then
-       HAVE_SYS_CDEFS_H=1
-     else
-       HAVE_SYS_CDEFS_H=0
-     fi
-     AC_SUBST([HAVE_SYS_CDEFS_H])
-
-     dnl Ensure the type pid_t gets defined.
-     AC_REQUIRE([AC_TYPE_PID_T])
-    ])
-  AC_SUBST([SCHED_H])
-  AM_CONDITIONAL([GL_GENERATE_SCHED_H], [test -n "$SCHED_H"])
+  AC_CHECK_HEADERS([sched.h], [], [],
+    [[#if HAVE_SYS_CDEFS_H
+       #include <sys/cdefs.h>
+      #endif
+    ]])
+  gl_NEXT_HEADERS([sched.h])
+
+  if test "$ac_cv_header_sched_h" = yes; then
+    HAVE_SCHED_H=1
+  else
+    HAVE_SCHED_H=0
+  fi
+  AC_SUBST([HAVE_SCHED_H])
+
+  if test "$HAVE_SCHED_H" = 1; then
+    AC_CHECK_TYPE([struct sched_param],
+      [HAVE_STRUCT_SCHED_PARAM=1], [HAVE_STRUCT_SCHED_PARAM=0],
+      [[#if HAVE_SYS_CDEFS_H
+         #include <sys/cdefs.h>
+        #endif
+        #include <sched.h>
+      ]])
+  else
+    HAVE_STRUCT_SCHED_PARAM=0
+    case "$host_os" in
+      os2*)
+        dnl On OS/2 kLIBC, struct sched_param is in spawn.h.
+        AC_CHECK_TYPE([struct sched_param],
+          [HAVE_STRUCT_SCHED_PARAM=1], [],
+          [#include <spawn.h>])
+        ;;
+      vms)
+        dnl On OpenVMS 7.2 or newer, struct sched_param is in pthread.h.
+        AC_CHECK_TYPE([struct sched_param],
+          [HAVE_STRUCT_SCHED_PARAM=1], [],
+          [#include <pthread.h>])
+        ;;
+    esac
+  fi
+  AC_SUBST([HAVE_STRUCT_SCHED_PARAM])
+
+  if test "$ac_cv_header_sys_cdefs_h" = yes; then
+    HAVE_SYS_CDEFS_H=1
+  else
+    HAVE_SYS_CDEFS_H=0
+  fi
+  AC_SUBST([HAVE_SYS_CDEFS_H])
+
+  dnl Ensure the type pid_t gets defined.
+  AC_REQUIRE([AC_TYPE_PID_T])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use, if it is not common
+  dnl enough to be declared everywhere.
+  gl_WARN_ON_USE_PREPARE([[#include <sched.h>
+    ]], [sched_yield])
+])
+
+# gl_SCHED_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SCHED_MODULE_INDICATOR],
+[
+  dnl Ensure to expand the default settings once only.
+  gl_SCHED_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SCHED_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SCHED_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCHED_YIELD])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SCHED_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SCHED_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SCHED_H_DEFAULTS],
+[
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_SCHED_YIELD=1;    AC_SUBST([HAVE_SCHED_YIELD])
+  REPLACE_SCHED_YIELD=0; AC_SUBST([REPLACE_SCHED_YIELD])
 ])
diff --git a/m4/sched_yield.m4 b/m4/sched_yield.m4
new file mode 100644 (file)
index 0000000..5329b47
--- /dev/null
@@ -0,0 +1,22 @@
+# sched_yield.m4 serial 2
+dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SCHED_YIELD],
+[
+  AC_REQUIRE([gl_SCHED_H_DEFAULTS])
+  AC_REQUIRE([gl_PTHREADLIB])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+
+  if { case "$host_os" in mingw*) true;; *) false;; esac; } \
+     && test $gl_threads_api = windows; then
+    dnl Choose function names that don't conflict with the mingw-w64 winpthreads
+    dnl library.
+    REPLACE_SCHED_YIELD=1
+  else
+    AC_CHECK_DECL([sched_yield], , [HAVE_SCHED_YIELD=0],
+      [[#include <sched.h>]])
+  fi
+])
index 3983173..5140861 100644 (file)
@@ -1,5 +1,5 @@
 # Look up an environment variable more securely.
-dnl Copyright 2013-2016 Free Software Foundation, Inc.
+dnl Copyright 2013-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/select.m4 b/m4/select.m4
new file mode 100644 (file)
index 0000000..72c068f
--- /dev/null
@@ -0,0 +1,117 @@
+# select.m4 serial 13
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SELECT],
+[
+  AC_REQUIRE([gl_SYS_SELECT_H])
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_SOCKETS])
+  if test "$ac_cv_header_winsock2_h" = yes; then
+    REPLACE_SELECT=1
+  else
+    dnl On Interix 3.5, select(0, NULL, NULL, NULL, timeout) fails with error
+    dnl EFAULT.
+    AC_CHECK_HEADERS_ONCE([sys/select.h])
+    AC_CACHE_CHECK([whether select supports a 0 argument],
+      [gl_cv_func_select_supports0],
+      [
+        AC_RUN_IFELSE([AC_LANG_SOURCE([[
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+int main ()
+{
+  struct timeval timeout;
+  timeout.tv_sec = 0;
+  timeout.tv_usec = 5;
+  return select (0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &timeout) < 0;
+}]])], [gl_cv_func_select_supports0=yes], [gl_cv_func_select_supports0=no],
+          [
+changequote(,)dnl
+           case "$host_os" in
+                       # Guess no on Interix.
+             interix*) gl_cv_func_select_supports0="guessing no";;
+                       # Guess yes otherwise.
+             *)        gl_cv_func_select_supports0="guessing yes";;
+           esac
+changequote([,])dnl
+          ])
+      ])
+    case "$gl_cv_func_select_supports0" in
+      *yes) ;;
+      *) REPLACE_SELECT=1 ;;
+    esac
+
+    dnl On FreeBSD 8.2, select() doesn't always reject bad fds.
+    AC_CACHE_CHECK([whether select detects invalid fds],
+      [gl_cv_func_select_detects_ebadf],
+      [
+        AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/types.h>
+#include <sys/time.h>
+#if HAVE_SYS_SELECT_H
+# include <sys/select.h>
+#endif
+#include <unistd.h>
+#include <errno.h>
+]GL_MDA_DEFINES],
+[[
+  fd_set set;
+  dup2(0, 16);
+  FD_ZERO(&set);
+  FD_SET(16, &set);
+  close(16);
+  struct timeval timeout;
+  timeout.tv_sec = 0;
+  timeout.tv_usec = 5;
+  return select (17, &set, NULL, NULL, &timeout) != -1 || errno != EBADF;
+]])], [gl_cv_func_select_detects_ebadf=yes],
+      [gl_cv_func_select_detects_ebadf=no],
+          [
+           case "$host_os" in
+                             # Guess yes on Linux systems.
+            linux-* | linux) gl_cv_func_select_detects_ebadf="guessing yes" ;;
+                             # Guess yes on glibc systems.
+            *-gnu* | gnu*)   gl_cv_func_select_detects_ebadf="guessing yes" ;;
+                             # If we don't know, obey --enable-cross-guesses.
+            *)               gl_cv_func_select_detects_ebadf="$gl_cross_guess_normal" ;;
+           esac
+          ])
+      ])
+    case $gl_cv_func_select_detects_ebadf in
+      *yes) ;;
+      *) REPLACE_SELECT=1 ;;
+    esac
+  fi
+
+  dnl Determine the needed libraries.
+  LIB_SELECT="$LIBSOCKET"
+  if test $REPLACE_SELECT = 1; then
+    case "$host_os" in
+      mingw*)
+        dnl On the MSVC platform, the function MsgWaitForMultipleObjects
+        dnl (used in lib/select.c) requires linking with -luser32. On mingw,
+        dnl it is implicit.
+        AC_LINK_IFELSE(
+          [AC_LANG_SOURCE([[
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+int
+main ()
+{
+  MsgWaitForMultipleObjects (0, NULL, 0, 0, 0);
+  return 0;
+}]])],
+          [],
+          [LIB_SELECT="$LIB_SELECT -luser32"])
+        ;;
+    esac
+  fi
+  AC_SUBST([LIB_SELECT])
+])
diff --git a/m4/semaphore.m4 b/m4/semaphore.m4
new file mode 100644 (file)
index 0000000..dbaf9ee
--- /dev/null
@@ -0,0 +1,45 @@
+# semaphore.m4 serial 1
+dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Sets LIB_SEMAPHORE to the library needed, in addition to $(LIBMULTITHREAD),
+# for getting the <semaphore.h> functions.
+
+AC_DEFUN([gl_SEMAPHORE],
+[
+  AC_REQUIRE([gl_THREADLIB])
+  dnl sem_post is
+  dnl   - in libc on macOS, FreeBSD, AIX, IRIX, Solaris 11, Haiku, Cygwin,
+  dnl   - in libpthread on glibc systems, OpenBSD,
+  dnl   - in libpthread or librt on NetBSD,
+  dnl   - in librt on HP-UX 11, OSF/1, Solaris 10.
+  dnl On the platforms where -lpthread is needed, it is contained in
+  dnl $LIBMULTITHREAD. Therefore, the only library we need to test for is -lrt.
+  AC_CACHE_CHECK([for library needed for semaphore functions],
+    [gl_cv_semaphore_lib],
+    [save_LIBS="$LIBS"
+     LIBS="$LIBS $LIBMULTITHREAD"
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <semaphore.h>]],
+          [[sem_post ((sem_t *)0);]])],
+       [gl_cv_semaphore_lib=none],
+       [LIBS="$LIBS -lrt"
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[#include <semaphore.h>]],
+             [[sem_post ((sem_t *)0);]])],
+          [gl_cv_semaphore_lib='-lrt'],
+          [gl_cv_semaphore_lib=none])
+       ])
+     LIBS="$save_LIBS"
+    ])
+  if test "x$gl_cv_semaphore_lib" = xnone; then
+    LIB_SEMAPHORE=
+  else
+    LIB_SEMAPHORE="$gl_cv_semaphore_lib"
+  fi
+  AC_SUBST([LIB_SEMAPHORE])
+])
index 5d49aba..f79a278 100644 (file)
@@ -1,5 +1,5 @@
-# setenv.m4 serial 26
-dnl Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc.
+# setenv.m4 serial 30
+dnl Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -35,10 +35,12 @@ AC_DEFUN([gl_FUNC_SETENV],
       ]])],
       [gl_cv_func_setenv_works=yes], [gl_cv_func_setenv_works=no],
       [case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_setenv_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_setenv_works="guessing no" ;;
+                        # Guess yes on glibc systems.
+         *-gnu* | gnu*) gl_cv_func_setenv_works="guessing yes" ;;
+                        # Guess yes on musl systems.
+         *-musl*)       gl_cv_func_setenv_works="guessing yes" ;;
+                        # If we don't know, obey --enable-cross-guesses.
+         *)             gl_cv_func_setenv_works="$gl_cross_guess_normal" ;;
        esac
       ])])
     case "$gl_cv_func_setenv_works" in
@@ -104,35 +106,39 @@ int unsetenv (const char *name);
     dnl OpenBSD 4.7 unsetenv("") does not fail.
     AC_CACHE_CHECK([whether unsetenv obeys POSIX],
       [gl_cv_func_unsetenv_works],
-      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-       #include <stdlib.h>
-       #include <errno.h>
-       extern char **environ;
-      ]], [[
-       char entry1[] = "a=1";
-       char entry2[] = "b=2";
-       char *env[] = { entry1, entry2, NULL };
-       if (putenv ((char *) "a=1")) return 1;
-       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;
-      ]])],
-      [gl_cv_func_unsetenv_works=yes], [gl_cv_func_unsetenv_works=no],
-      [case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_unsetenv_works="guessing no" ;;
-       esac
-      ])])
+      [AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM([[
+            #include <stdlib.h>
+            #include <errno.h>
+            extern char **environ;
+           ]GL_MDA_DEFINES],
+           [[
+            char entry1[] = "a=1";
+            char entry2[] = "b=2";
+            char *env[] = { entry1, entry2, NULL };
+            if (putenv ((char *) "a=1")) return 1;
+            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;
+           ]])],
+         [gl_cv_func_unsetenv_works=yes],
+         [gl_cv_func_unsetenv_works=no],
+         [case "$host_os" in
+                    # Guess yes on glibc systems.
+            *-gnu*) gl_cv_func_unsetenv_works="guessing yes" ;;
+                    # If we don't know, obey --enable-cross-guesses.
+            *)      gl_cv_func_unsetenv_works="$gl_cross_guess_normal" ;;
+          esac
+         ])
+      ])
     case "$gl_cv_func_unsetenv_works" in
       *yes) ;;
       *)
index a359069..305dcaa 100644 (file)
@@ -1,5 +1,5 @@
-# setlocale.m4 serial 4
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# setlocale.m4 serial 7
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,23 +7,79 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_SETLOCALE],
 [
   AC_REQUIRE([gl_LOCALE_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_SETLOCALE_NULL])
   AC_REQUIRE([AC_CANONICAL_HOST])
+
+  dnl Test whether we need to improve on the general working of setlocale.
+  NEED_SETLOCALE_IMPROVED=0
   case "$host_os" in
     dnl On native Windows systems, setlocale(category,NULL) does not look at
     dnl the environment variables LC_ALL, category, and LANG.
-    mingw*) REPLACE_SETLOCALE=1 ;;
+    mingw*) NEED_SETLOCALE_IMPROVED=1 ;;
     dnl On Cygwin 1.5.x, setlocale always succeeds but setlocale(LC_CTYPE,NULL)
     dnl is then still "C".
     cygwin*)
       case `uname -r` in
-        1.5.*) REPLACE_SETLOCALE=1 ;;
+        1.5.*) NEED_SETLOCALE_IMPROVED=1 ;;
+      esac
+      ;;
+    dnl On Android 4.3, setlocale(category,"C") always fails.
+    *)
+      AC_CACHE_CHECK([whether setlocale supports the C locale],
+        [gl_cv_func_setlocale_works],
+        [AC_RUN_IFELSE(
+           [AC_LANG_SOURCE([[
+#include <locale.h>
+int main ()
+{
+  return setlocale (LC_ALL, "C") == NULL;
+}]])],
+           [gl_cv_func_setlocale_works=yes],
+           [gl_cv_func_setlocale_works=no],
+           [case "$host_os" in
+                               # Guess no on Android.
+              linux*-android*) gl_cv_func_setlocale_works="guessing no";;
+                               # Guess yes otherwise.
+              *)               gl_cv_func_setlocale_works="guessing yes";;
+            esac
+           ])
+        ])
+      case "$gl_cv_func_setlocale_works" in
+        *yes) ;;
+        *) NEED_SETLOCALE_IMPROVED=1 ;;
       esac
       ;;
   esac
+  AC_DEFINE_UNQUOTED([NEED_SETLOCALE_IMPROVED], [$NEED_SETLOCALE_IMPROVED],
+    [Define to 1 to enable general improvements of setlocale.])
+
+  dnl Test whether we need a multithread-safe setlocale(category,NULL).
+  NEED_SETLOCALE_MTSAFE=0
+  if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+    NEED_SETLOCALE_MTSAFE=1
+  fi
+  AC_DEFINE_UNQUOTED([NEED_SETLOCALE_MTSAFE], [$NEED_SETLOCALE_MTSAFE],
+    [Define to 1 to enable a multithread-safety fix of setlocale.])
+
+  if test $NEED_SETLOCALE_IMPROVED = 1 || test $NEED_SETLOCALE_MTSAFE = 1; then
+    REPLACE_SETLOCALE=1
+  fi
+
+  if test $NEED_SETLOCALE_MTSAFE = 1; then
+    LIB_SETLOCALE="$LIB_SETLOCALE_NULL"
+  else
+    LIB_SETLOCALE=
+  fi
+  dnl LIB_SETLOCALE is expected to be '-pthread' or '-lpthread' on AIX with gcc
+  dnl or xlc, and empty otherwise.
+  AC_SUBST([LIB_SETLOCALE])
 ])
 
 # Prerequisites of lib/setlocale.c.
 AC_DEFUN([gl_PREREQ_SETLOCALE],
 [
+  dnl No need to check for CFLocaleCopyPreferredLanguages and
+  dnl CFPreferencesCopyAppValue because lib/setlocale.c is not used on Mac OS X.
+  dnl (The Mac OS X specific code is only used in libintl.)
   :
 ])
diff --git a/m4/setlocale_null.m4 b/m4/setlocale_null.m4
new file mode 100644 (file)
index 0000000..2c958ed
--- /dev/null
@@ -0,0 +1,98 @@
+# setlocale_null.m4 serial 5
+dnl Copyright (C) 2019-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_SETLOCALE_NULL],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_REQUIRE([gl_PTHREADLIB])
+  AC_CHECK_HEADERS_ONCE([threads.h])
+
+  AC_CACHE_CHECK([whether setlocale (LC_ALL, NULL) is multithread-safe],
+    [gl_cv_func_setlocale_null_all_mtsafe],
+    [case "$host_os" in
+       # Guess no on musl libc, macOS, FreeBSD, NetBSD, OpenBSD, AIX, Haiku, Cygwin.
+       *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | openbsd* | aix* | haiku* | cygwin*)
+         gl_cv_func_setlocale_null_all_mtsafe=no ;;
+       # Guess yes on glibc, HP-UX, IRIX, Solaris, native Windows.
+       *-gnu* | gnu* | hpux* | irix* | solaris* | mingw*)
+         gl_cv_func_setlocale_null_all_mtsafe=yes ;;
+       # If we don't know, obey --enable-cross-guesses.
+       *)
+         gl_cv_func_setlocale_null_all_mtsafe="$gl_cross_guess_normal" ;;
+     esac
+    ])
+  dnl On platforms without multithreading, there is no issue.
+  case "$host_os" in
+    mingw*) ;;
+    *)
+      if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+        gl_cv_func_setlocale_null_all_mtsafe="trivially yes"
+      fi
+      ;;
+  esac
+  case "$gl_cv_func_setlocale_null_all_mtsafe" in
+    *yes) SETLOCALE_NULL_ALL_MTSAFE=1 ;;
+    *)    SETLOCALE_NULL_ALL_MTSAFE=0 ;;
+  esac
+  AC_DEFINE_UNQUOTED([SETLOCALE_NULL_ALL_MTSAFE], [$SETLOCALE_NULL_ALL_MTSAFE],
+    [Define to 1 if setlocale (LC_ALL, NULL) is multithread-safe.])
+
+  dnl This is about a single category (not LC_ALL).
+  AC_CACHE_CHECK([whether setlocale (category, NULL) is multithread-safe],
+    [gl_cv_func_setlocale_null_one_mtsafe],
+    [case "$host_os" in
+       # Guess no on OpenBSD, AIX.
+       openbsd* | aix*)
+         gl_cv_func_setlocale_null_one_mtsafe=no ;;
+       # Guess yes on glibc, musl libc, macOS, FreeBSD, NetBSD, HP-UX, IRIX, Solaris, Haiku, Cygwin, native Windows.
+       *-gnu* | gnu* | *-musl* | darwin* | freebsd* | midnightbsd* | netbsd* | hpux* | irix* | solaris* | haiku* | cygwin* | mingw*)
+         gl_cv_func_setlocale_null_one_mtsafe=yes ;;
+       # If we don't know, obey --enable-cross-guesses.
+       *)
+         gl_cv_func_setlocale_null_one_mtsafe="$gl_cross_guess_normal" ;;
+     esac
+    ])
+  dnl On platforms without multithreading, there is no issue.
+  case "$host_os" in
+    mingw*) ;;
+    *)
+      if test $gl_pthread_api = no && test $ac_cv_header_threads_h = no; then
+        gl_cv_func_setlocale_null_one_mtsafe="trivially yes"
+      fi
+      ;;
+  esac
+  case "$gl_cv_func_setlocale_null_one_mtsafe" in
+    *yes) SETLOCALE_NULL_ONE_MTSAFE=1 ;;
+    *)    SETLOCALE_NULL_ONE_MTSAFE=0 ;;
+  esac
+  AC_DEFINE_UNQUOTED([SETLOCALE_NULL_ONE_MTSAFE], [$SETLOCALE_NULL_ONE_MTSAFE],
+    [Define to 1 if setlocale (category, NULL) is multithread-safe.])
+
+  dnl Determine link dependencies of lib/setlocale_null.c and lib/setlocale-lock.c.
+  if test $SETLOCALE_NULL_ALL_MTSAFE = 0 || test $SETLOCALE_NULL_ONE_MTSAFE = 0; then
+    case "$host_os" in
+      mingw*) LIB_SETLOCALE_NULL= ;;
+      *)
+        gl_WEAK_SYMBOLS
+        case "$gl_cv_have_weak" in
+          *yes) LIB_SETLOCALE_NULL= ;;
+          *)    LIB_SETLOCALE_NULL="$LIBPTHREAD" ;;
+        esac
+        ;;
+    esac
+  else
+    LIB_SETLOCALE_NULL=
+  fi
+  dnl LIB_SETLOCALE_NULL is expected to be '-pthread' or '-lpthread' on AIX
+  dnl with gcc or xlc, and empty otherwise.
+  AC_SUBST([LIB_SETLOCALE_NULL])
+])
+
+# Prerequisites of lib/setlocale-lock.c.
+AC_DEFUN([gl_PREREQ_SETLOCALE_LOCK],
+[
+  gl_VISIBILITY
+])
diff --git a/m4/sh-filename.m4 b/m4/sh-filename.m4
new file mode 100644 (file)
index 0000000..b680fa1
--- /dev/null
@@ -0,0 +1,24 @@
+# sh-filename.m4 serial 3
+dnl Copyright (C) 2018-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_SH_FILENAME],
+[
+  AH_VERBATIM([SH_FILENAME],
+[/* File name of the Bourne shell.  */
+#if (defined _WIN32 && !defined __CYGWIN__) || defined __CYGWIN__ || defined __ANDROID__
+/* Omit the directory part because
+   - For native Windows programs in a Cygwin environment, the Cygwin mounts
+     are not visible.
+   - For 32-bit Cygwin programs in a 64-bit Cygwin environment, the Cygwin
+     mounts are not visible.
+   - On Android, /bin/sh does not exist. It's /system/bin/sh instead.  */
+# define BOURNE_SHELL "sh"
+#else
+# define BOURNE_SHELL "/bin/sh"
+#endif])
+])
index f1e2e59..5940faa 100644 (file)
@@ -1,5 +1,5 @@
 # sig_atomic_t.m4 serial 3
-dnl Copyright (C) 2003, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 9b43764..a8c1d15 100644 (file)
@@ -1,5 +1,5 @@
 # sigaction.m4 serial 7
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/sigaltstack.m4 b/m4/sigaltstack.m4
new file mode 100644 (file)
index 0000000..47e9000
--- /dev/null
@@ -0,0 +1,196 @@
+# sigaltstack.m4 serial 14
+dnl Copyright (C) 2002-2021 Bruno Haible <bruno@clisp.org>
+dnl Copyright (C) 2008 Eric Blake <ebb9@byu.net>
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+AC_DEFUN([SV_SIGALTSTACK],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+
+  AC_CHECK_FUNCS_ONCE([sigaltstack setrlimit])
+
+  if test "$ac_cv_func_sigaltstack" = yes; then
+    AC_CHECK_TYPE([stack_t], ,
+      [AC_DEFINE(stack_t, [struct sigaltstack],
+         [Define to 'struct sigaltstack' if that's the type of the argument to sigaltstack])
+      ],
+      [
+#include <signal.h>
+#if HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#endif
+      ])
+  fi
+
+  AC_CACHE_CHECK([for working sigaltstack], [sv_cv_sigaltstack], [
+    if test "$ac_cv_func_sigaltstack" = yes; then
+      case "$host_os" in
+        macos* | darwin[[6-9]]* | darwin[[1-9]][[0-9]]*)
+          # On MacOS X 10.2 or newer, just assume that if it compiles, it will
+          # work. If we were to perform the real test, 1 Crash Report dialog
+          # window would pop up.
+          AC_LINK_IFELSE([
+            AC_LANG_PROGRAM([[#include <signal.h>]],
+              [[int x = SA_ONSTACK; stack_t ss; sigaltstack ((stack_t*)0, &ss);]])],
+            [sv_cv_sigaltstack="guessing yes"],
+            [sv_cv_sigaltstack=no])
+          ;;
+        *)
+          AC_RUN_IFELSE([
+            AC_LANG_SOURCE([[
+#include <stdlib.h>
+#include <signal.h>
+#if HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#endif
+#if HAVE_SETRLIMIT
+# include <sys/types.h>
+# include <sys/time.h>
+# include <sys/resource.h>
+#endif
+void stackoverflow_handler (int sig)
+{
+  /* If we get here, the stack overflow was caught.  */
+  exit (0);
+}
+volatile int * recurse_1 (volatile int n, volatile int *p)
+{
+  if (n >= 0)
+    *recurse_1 (n + 1, p) += n;
+  return p;
+}
+int recurse (volatile int n)
+{
+  int sum = 0;
+  return *recurse_1 (n, &sum);
+}
+char mystack[2 * (1 << 24)];
+int main ()
+{
+  stack_t altstack;
+  struct sigaction action;
+#if defined HAVE_SETRLIMIT && defined RLIMIT_STACK
+  /* Before starting the endless recursion, try to be friendly to the user's
+     machine.  On some Linux 2.2.x systems, there is no stack limit for user
+     processes at all.  We don't want to kill such systems.  */
+  struct rlimit rl;
+  rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+  setrlimit (RLIMIT_STACK, &rl);
+#endif
+  /* Install the alternate stack.  Use the midpoint of mystack, to guard
+     against a buggy interpretation of ss_sp on IRIX.  */
+#ifdef SIGSTKSZ
+  if (sizeof mystack / 2 < SIGSTKSZ)
+    exit (3);
+#endif
+  altstack.ss_sp = mystack + sizeof mystack / 2;
+  altstack.ss_size = sizeof mystack / 2;
+  altstack.ss_flags = 0; /* no SS_DISABLE */
+  if (sigaltstack (&altstack, NULL) < 0)
+    exit (1);
+  /* Install the SIGSEGV handler.  */
+  sigemptyset (&action.sa_mask);
+  action.sa_handler = &stackoverflow_handler;
+  action.sa_flags = SA_ONSTACK;
+  sigaction (SIGSEGV, &action, (struct sigaction *) NULL);
+  sigaction (SIGBUS, &action, (struct sigaction *) NULL);
+  /* Provoke a stack overflow.  */
+  recurse (0);
+  exit (2);
+}]])],
+            [sv_cv_sigaltstack=yes],
+            [sv_cv_sigaltstack=no],
+            [
+              dnl FIXME: Put in some more known values here.
+              case "$host_os" in
+                *)
+                  AC_LINK_IFELSE([
+                    AC_LANG_PROGRAM([[#include <signal.h>]],
+                      [[int x = SA_ONSTACK; stack_t ss; sigaltstack ((stack_t*)0, &ss);]])],
+                    [sv_cv_sigaltstack="guessing yes"],
+                    [sv_cv_sigaltstack=no])
+                  ;;
+              esac
+            ])
+          ;;
+      esac
+    else
+      sv_cv_sigaltstack=no
+    fi
+  ])
+  if test "$sv_cv_sigaltstack" != no; then
+    AC_DEFINE([HAVE_WORKING_SIGALTSTACK], [1],
+      [Define if you have the sigaltstack() function and it works.])
+
+    dnl The ss_sp field of a stack_t is, according to POSIX, the lowest address
+    dnl of the memory block designated as an alternate stack. But IRIX 5.3
+    dnl interprets it as the highest address!
+    AC_CACHE_CHECK([for correct stack_t interpretation],
+      [sv_cv_sigaltstack_low_base], [
+      AC_RUN_IFELSE([
+        AC_LANG_SOURCE([[
+#include <stdlib.h>
+#include <signal.h>
+#if HAVE_SYS_SIGNAL_H
+# include <sys/signal.h>
+#endif
+volatile char *stack_lower_bound;
+volatile char *stack_upper_bound;
+static void check_stack_location (volatile char *addr)
+{
+  if (addr >= stack_lower_bound && addr <= stack_upper_bound)
+    exit (0);
+  else
+    exit (1);
+}
+static void stackoverflow_handler (int sig)
+{
+  char dummy;
+  check_stack_location (&dummy);
+}
+char mystack[2 * (1 << 24)];
+int main ()
+{
+  stack_t altstack;
+  struct sigaction action;
+  /* Install the alternate stack.  */
+  altstack.ss_sp = mystack + sizeof mystack / 2;
+  altstack.ss_size = sizeof mystack / 2;
+  stack_lower_bound = (char *) altstack.ss_sp;
+  stack_upper_bound = (char *) altstack.ss_sp + altstack.ss_size - 1;
+  altstack.ss_flags = 0; /* no SS_DISABLE */
+  if (sigaltstack (&altstack, NULL) < 0)
+    exit (2);
+  /* Install the SIGSEGV handler.  */
+  sigemptyset (&action.sa_mask);
+  action.sa_handler = &stackoverflow_handler;
+  action.sa_flags = SA_ONSTACK;
+  if (sigaction (SIGSEGV, &action, (struct sigaction *) NULL) < 0)
+    exit(3);
+  /* Provoke a SIGSEGV.  */
+  raise (SIGSEGV);
+  exit (3);
+}]])],
+      [sv_cv_sigaltstack_low_base=yes],
+      [sv_cv_sigaltstack_low_base=no],
+      [
+        dnl FIXME: Put in some more known values here.
+        case "$host_os" in
+          irix5*) sv_cv_sigaltstack_low_base="no" ;;
+          *)      sv_cv_sigaltstack_low_base="guessing yes" ;;
+        esac
+      ])
+    ])
+    if test "$sv_cv_sigaltstack_low_base" = no; then
+      AC_DEFINE([SIGALTSTACK_SS_REVERSED], [1],
+        [Define if sigaltstack() interprets the stack_t.ss_sp field incorrectly,
+         as the highest address of the alternate stack range rather than as the
+         lowest address.])
+    fi
+  fi
+])
index bcfd7b4..8b93880 100644 (file)
@@ -1,10 +1,10 @@
-# signal_h.m4 serial 18
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# signal_h.m4 serial 22
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_SIGNAL_H],
+AC_DEFUN_ONCE([gl_SIGNAL_H],
 [
   AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
@@ -34,6 +34,8 @@ AC_DEFUN([gl_SIGNAL_H],
     ]], [pthread_sigmask sigaction
     sigaddset sigdelset sigemptyset sigfillset sigismember
     sigpending sigprocmask])
+
+  AC_REQUIRE([AC_C_RESTRICT])
 ])
 
 AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
@@ -50,22 +52,37 @@ AC_DEFUN([gl_CHECK_TYPE_SIGSET_T],
   fi
 ])
 
+# gl_SIGNAL_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_SIGNAL_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_SIGNAL_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SIGNAL_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SIGNAL_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTHREAD_SIGMASK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAISE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGNAL_H_SIGPIPE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGPROCMASK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGACTION])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SIGNAL_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
 [
-  GNULIB_PTHREAD_SIGMASK=0;    AC_SUBST([GNULIB_PTHREAD_SIGMASK])
-  GNULIB_RAISE=0;              AC_SUBST([GNULIB_RAISE])
-  GNULIB_SIGNAL_H_SIGPIPE=0;   AC_SUBST([GNULIB_SIGNAL_H_SIGPIPE])
-  GNULIB_SIGPROCMASK=0;        AC_SUBST([GNULIB_SIGPROCMASK])
-  GNULIB_SIGACTION=0;          AC_SUBST([GNULIB_SIGACTION])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_POSIX_SIGNALBLOCKING=1; AC_SUBST([HAVE_POSIX_SIGNALBLOCKING])
   HAVE_PTHREAD_SIGMASK=1;      AC_SUBST([HAVE_PTHREAD_SIGMASK])
index 5197c50..bfd76b7 100644 (file)
@@ -1,5 +1,5 @@
-# signalblocking.m4 serial 14
-dnl Copyright (C) 2001-2002, 2006-2016 Free Software Foundation, Inc.
+# signalblocking.m4 serial 17
+dnl Copyright (C) 2001-2002, 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -13,11 +13,9 @@ AC_DEFUN([gl_SIGNALBLOCKING],
 [
   AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_TYPE_SIGSET_T])
-  if test $gl_cv_type_sigset_t = yes; then
-    AC_CHECK_FUNC([sigprocmask], [gl_cv_func_sigprocmask=1])
-  fi
-  if test -z "$gl_cv_func_sigprocmask"; then
-    HAVE_POSIX_SIGNALBLOCKING=0
+  HAVE_POSIX_SIGNALBLOCKING=0
+  if test "$gl_cv_type_sigset_t" = yes; then
+    AC_CHECK_FUNC([sigprocmask], [HAVE_POSIX_SIGNALBLOCKING=1])
   fi
 ])
 
index e42f183..6ec70ec 100644 (file)
@@ -1,5 +1,5 @@
-# signbit.m4 serial 13
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# signbit.m4 serial 20
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_SIGNBIT],
 [
   AC_REQUIRE([gl_MATH_H_DEFAULTS])
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_CACHE_CHECK([for signbit macro], [gl_cv_func_signbit],
     [
       AC_RUN_IFELSE(
@@ -29,22 +29,27 @@ AC_DEFUN([gl_SIGNBIT],
         [gl_cv_func_signbit=yes],
         [gl_cv_func_signbit=no],
         [case "$host_os" in
-                   # Guess yes on glibc systems.
-           *-gnu*) gl_cv_func_signbit="guessing yes" ;;
-                   # If we don't know, assume the worst.
-           *)      gl_cv_func_signbit="guessing no" ;;
+                          # Guess yes on glibc systems.
+           *-gnu* | gnu*) gl_cv_func_signbit="guessing yes" ;;
+                          # Guess yes on musl systems.
+           *-musl*)       gl_cv_func_signbit="guessing yes" ;;
+                          # Guess yes on native Windows.
+           mingw*)        gl_cv_func_signbit="guessing yes" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+           *)             gl_cv_func_signbit="$gl_cross_guess_normal" ;;
          esac
         ])
     ])
-  dnl GCC 4.0 and newer provides three built-ins for signbit.
+  dnl GCC >= 4.0 and clang provide three built-ins for signbit.
   dnl They can be used without warnings, also in C++, regardless of <math.h>.
   dnl But they may expand to calls to functions, which may or may not be in
   dnl libc.
-  AC_CACHE_CHECK([for signbit compiler built-ins], [gl_cv_func_signbit_gcc],
+  AC_CACHE_CHECK([for signbit compiler built-ins],
+    [gl_cv_func_signbit_builtins],
     [
       AC_RUN_IFELSE(
         [AC_LANG_SOURCE([[
-#if __GNUC__ >= 4
+#if (__GNUC__ >= 4) || (__clang_major__ >= 4)
 # define signbit(x) \
    (sizeof (x) == sizeof (long double) ? __builtin_signbitl (x) : \
     sizeof (x) == sizeof (double) ? __builtin_signbit (x) : \
@@ -55,21 +60,30 @@ AC_DEFUN([gl_SIGNBIT],
 #include <string.h>
 ]gl_SIGNBIT_TEST_PROGRAM
 ])],
-        [gl_cv_func_signbit_gcc=yes],
-        [gl_cv_func_signbit_gcc=no],
+        [gl_cv_func_signbit_builtins=yes],
+        [gl_cv_func_signbit_builtins=no],
         [case "$host_os" in
-                   # Guess yes on glibc systems.
-           *-gnu*) gl_cv_func_signbit_gcc="guessing yes" ;;
-                   # If we don't know, assume the worst.
-           *)      gl_cv_func_signbit_gcc="guessing no" ;;
+                          # Guess yes on glibc systems.
+           *-gnu* | gnu*) gl_cv_func_signbit_builtins="guessing yes" ;;
+                          # Guess yes on musl systems.
+           *-musl*)       gl_cv_func_signbit_builtins="guessing yes" ;;
+                          # Guess yes on mingw, no on MSVC.
+           mingw*)        if test -n "$GCC"; then
+                            gl_cv_func_signbit_builtins="guessing yes"
+                          else
+                            gl_cv_func_signbit_builtins="guessing no"
+                          fi
+                          ;;
+                          # If we don't know, obey --enable-cross-guesses.
+           *)             gl_cv_func_signbit_builtins="$gl_cross_guess_normal" ;;
          esac
         ])
     ])
   dnl Use the compiler built-ins whenever possible, because they are more
   dnl efficient than the system library functions (if they exist).
-  case "$gl_cv_func_signbit_gcc" in
+  case "$gl_cv_func_signbit_builtins" in
     *yes)
-      REPLACE_SIGNBIT_USING_GCC=1
+      REPLACE_SIGNBIT_USING_BUILTINS=1
       ;;
     *)
       case "$gl_cv_func_signbit" in
@@ -77,79 +91,90 @@ AC_DEFUN([gl_SIGNBIT],
         *)
           dnl REPLACE_SIGNBIT=1 makes sure the signbit[fdl] functions get built.
           REPLACE_SIGNBIT=1
-          gl_FLOAT_SIGN_LOCATION
-          gl_DOUBLE_SIGN_LOCATION
-          gl_LONG_DOUBLE_SIGN_LOCATION
-          if test "$gl_cv_cc_float_signbit" = unknown; then
-            dnl Test whether copysignf() is declared.
-            AC_CHECK_DECLS([copysignf], , , [[#include <math.h>]])
-            if test "$ac_cv_have_decl_copysignf" = yes; then
-              dnl Test whether copysignf() can be used without libm.
-              AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
-                [gl_cv_func_copysignf_no_libm],
-                [
-                  AC_LINK_IFELSE(
-                    [AC_LANG_PROGRAM(
-                       [[#include <math.h>
-                         float x, y;]],
-                       [[return copysignf (x, y) < 0;]])],
-                    [gl_cv_func_copysignf_no_libm=yes],
-                    [gl_cv_func_copysignf_no_libm=no])
-                ])
-              if test $gl_cv_func_copysignf_no_libm = yes; then
-                AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
-                  [Define if the copysignf function is declared in <math.h> and available in libc.])
-              fi
-            fi
-          fi
-          if test "$gl_cv_cc_double_signbit" = unknown; then
-            dnl Test whether copysign() is declared.
-            AC_CHECK_DECLS([copysign], , , [[#include <math.h>]])
-            if test "$ac_cv_have_decl_copysign" = yes; then
-              dnl Test whether copysign() can be used without libm.
-              AC_CACHE_CHECK([whether copysign can be used without linking with libm],
-                [gl_cv_func_copysign_no_libm],
-                [
-                  AC_LINK_IFELSE(
-                    [AC_LANG_PROGRAM(
-                       [[#include <math.h>
-                         double x, y;]],
-                       [[return copysign (x, y) < 0;]])],
-                    [gl_cv_func_copysign_no_libm=yes],
-                    [gl_cv_func_copysign_no_libm=no])
-                ])
-              if test $gl_cv_func_copysign_no_libm = yes; then
-                AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
-                  [Define if the copysign function is declared in <math.h> and available in libc.])
-              fi
-            fi
-          fi
-          if test "$gl_cv_cc_long_double_signbit" = unknown; then
-            dnl Test whether copysignl() is declared.
-            AC_CHECK_DECLS([copysignl], , , [[#include <math.h>]])
-            if test "$ac_cv_have_decl_copysignl" = yes; then
-              dnl Test whether copysignl() can be used without libm.
-              AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
-                [gl_cv_func_copysignl_no_libm],
-                [
-                  AC_LINK_IFELSE(
-                    [AC_LANG_PROGRAM(
-                       [[#include <math.h>
-                         long double x, y;]],
-                       [[return copysignl (x, y) < 0;]])],
-                    [gl_cv_func_copysignl_no_libm=yes],
-                    [gl_cv_func_copysignl_no_libm=no])
-                ])
-              if test $gl_cv_func_copysignl_no_libm = yes; then
-                AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
-                  [Define if the copysignl function is declared in <math.h> and available in libc.])
-              fi
-            fi
-          fi
           ;;
       esac
       ;;
   esac
+  dnl On Solaris 10, with CC in C++ mode, signbit is not available although
+  dnl is with cc in C mode. This cannot be worked around by defining
+  dnl _XOPEN_SOURCE=600, because the latter does not work in C++ mode on
+  dnl Solaris 11.0. Therefore use the replacement functions on Solaris.
+  case "$host_os" in
+    solaris*)
+      REPLACE_SIGNBIT=1
+      ;;
+  esac
+  if test $REPLACE_SIGNBIT = 1; then
+    gl_FLOAT_SIGN_LOCATION
+    gl_DOUBLE_SIGN_LOCATION
+    gl_LONG_DOUBLE_SIGN_LOCATION
+    if test "$gl_cv_cc_float_signbit" = unknown; then
+      dnl Test whether copysignf() is declared.
+      AC_CHECK_DECLS([copysignf], , , [[#include <math.h>]])
+      if test "$ac_cv_have_decl_copysignf" = yes; then
+        dnl Test whether copysignf() can be used without libm.
+        AC_CACHE_CHECK([whether copysignf can be used without linking with libm],
+          [gl_cv_func_copysignf_no_libm],
+          [
+            AC_LINK_IFELSE(
+              [AC_LANG_PROGRAM(
+                 [[#include <math.h>
+                   float x, y;]],
+                 [[return copysignf (x, y) < 0;]])],
+              [gl_cv_func_copysignf_no_libm=yes],
+              [gl_cv_func_copysignf_no_libm=no])
+          ])
+        if test $gl_cv_func_copysignf_no_libm = yes; then
+          AC_DEFINE([HAVE_COPYSIGNF_IN_LIBC], [1],
+            [Define if the copysignf function is declared in <math.h> and available in libc.])
+        fi
+      fi
+    fi
+    if test "$gl_cv_cc_double_signbit" = unknown; then
+      dnl Test whether copysign() is declared.
+      AC_CHECK_DECLS([copysign], , , [[#include <math.h>]])
+      if test "$ac_cv_have_decl_copysign" = yes; then
+        dnl Test whether copysign() can be used without libm.
+        AC_CACHE_CHECK([whether copysign can be used without linking with libm],
+          [gl_cv_func_copysign_no_libm],
+          [
+            AC_LINK_IFELSE(
+              [AC_LANG_PROGRAM(
+                 [[#include <math.h>
+                   double x, y;]],
+                 [[return copysign (x, y) < 0;]])],
+              [gl_cv_func_copysign_no_libm=yes],
+              [gl_cv_func_copysign_no_libm=no])
+          ])
+        if test $gl_cv_func_copysign_no_libm = yes; then
+          AC_DEFINE([HAVE_COPYSIGN_IN_LIBC], [1],
+            [Define if the copysign function is declared in <math.h> and available in libc.])
+        fi
+      fi
+    fi
+    if test "$gl_cv_cc_long_double_signbit" = unknown; then
+      dnl Test whether copysignl() is declared.
+      AC_CHECK_DECLS([copysignl], , , [[#include <math.h>]])
+      if test "$ac_cv_have_decl_copysignl" = yes; then
+        dnl Test whether copysignl() can be used without libm.
+        AC_CACHE_CHECK([whether copysignl can be used without linking with libm],
+          [gl_cv_func_copysignl_no_libm],
+          [
+            AC_LINK_IFELSE(
+              [AC_LANG_PROGRAM(
+                 [[#include <math.h>
+                   long double x, y;]],
+                 [[return copysignl (x, y) < 0;]])],
+              [gl_cv_func_copysignl_no_libm=yes],
+              [gl_cv_func_copysignl_no_libm=no])
+          ])
+        if test $gl_cv_func_copysignl_no_libm = yes; then
+          AC_DEFINE([HAVE_COPYSIGNL_IN_LIBC], [1],
+            [Define if the copysignl function is declared in <math.h> and available in libc.])
+        fi
+      fi
+    fi
+  fi
 ])
 
 AC_DEFUN([gl_SIGNBIT_TEST_PROGRAM], [[
@@ -272,6 +297,7 @@ int main ()
         {
           /* More than one bit difference.  */
           fprintf (fp, "unknown");
+          fclose (fp);
           return 2;
         }
       if (x)
@@ -284,6 +310,7 @@ int main ()
     {
       /* No difference.  */
       fprintf (fp, "unknown");
+      fclose (fp);
       return 3;
     }
   /* Now m = plus.word[k] ^ ~minus.word[k].  */
@@ -292,6 +319,7 @@ int main ()
       /* Oh? The sign bit is set in the positive and cleared in the negative
          numbers?  */
       fprintf (fp, "unknown");
+      fclose (fp);
       return 4;
     }
   for (i = 0; ; i++)
index 90f8ef1..3e0a5de 100644 (file)
@@ -1,5 +1,5 @@
-# sigpipe.m4 serial 2
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# sigpipe.m4 serial 3
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -8,8 +8,8 @@ dnl Tests whether SIGPIPE is provided by <signal.h>.
 dnl Sets gl_cv_header_signal_h_SIGPIPE.
 AC_DEFUN([gl_SIGNAL_SIGPIPE],
 [
-  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
-  dnl once only, before all statements that occur in other macros.
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
   AC_REQUIRE([gl_SIGNAL_SIGPIPE_BODY])
 ])
 
index de69025..1d41ce9 100644 (file)
@@ -1,17 +1,19 @@
-# size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2016 Free Software Foundation, Inc.
+# size_max.m4 serial 12
+dnl Copyright (C) 2003, 2005-2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
+AC_PREREQ([2.61])
+
 AC_DEFUN([gl_SIZE_MAX],
 [
   AC_CHECK_HEADERS([stdint.h])
   dnl First test whether the system already has SIZE_MAX.
   AC_CACHE_CHECK([for SIZE_MAX], [gl_cv_size_max], [
-    gl_cv_size_max=
+    gl_cv_size_max=no
     AC_EGREP_CPP([Found it], [
 #include <limits.h>
 #if HAVE_STDINT_H
@@ -21,7 +23,7 @@ AC_DEFUN([gl_SIZE_MAX],
 Found it
 #endif
 ], [gl_cv_size_max=yes])
-    if test -z "$gl_cv_size_max"; then
+    if test $gl_cv_size_max != yes; then
       dnl Define it ourselves. Here we assume that the type 'size_t' is not wider
       dnl than the type 'unsigned long'. Try hard to find a definition that can
       dnl be used in a preprocessor #if, i.e. doesn't contain a cast.
@@ -71,9 +73,3 @@ Found it
 # undef SIZE_MAX
 #endif])
 ])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
-  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
index 99de5ee..49a2dcb 100644 (file)
@@ -1,5 +1,5 @@
-# sleep.m4 serial 7
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# sleep.m4 serial 11
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -46,10 +46,14 @@ handle_alarm (int sig)
     ]])],
       [gl_cv_func_sleep_works=yes], [gl_cv_func_sleep_works=no],
       [case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_sleep_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_sleep_works="guessing no" ;;
+                        # Guess yes on glibc systems.
+         *-gnu* | gnu*) gl_cv_func_sleep_works="guessing yes" ;;
+                        # Guess yes on musl systems.
+         *-musl*)       gl_cv_func_sleep_works="guessing yes" ;;
+                        # Guess no on native Windows.
+         mingw*)        gl_cv_func_sleep_works="guessing no" ;;
+                        # If we don't know, obey --enable-cross-guesses.
+         *)             gl_cv_func_sleep_works="$gl_cross_guess_normal" ;;
        esac
       ])])
     case "$gl_cv_func_sleep_works" in
index 30aa25c..8520994 100644 (file)
@@ -1,5 +1,5 @@
 # snprintf.m4 serial 7
-dnl Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2004, 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/socketlib.m4 b/m4/socketlib.m4
new file mode 100644 (file)
index 0000000..0f8a082
--- /dev/null
@@ -0,0 +1,96 @@
+# socketlib.m4 serial 3
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl gl_SOCKETLIB
+dnl Determines the library to use for socket functions.
+dnl Sets and AC_SUBSTs LIBSOCKET.
+
+AC_DEFUN([gl_SOCKETLIB],
+[
+  gl_PREREQ_SYS_H_WINSOCK2 dnl for HAVE_WINSOCK2_H
+  LIBSOCKET=
+  if test $HAVE_WINSOCK2_H = 1; then
+    dnl Native Windows API (not Cygwin).
+    dnl If the function WSAStartup exists (declared in <winsock2.h> and
+    dnl defined through -lws2_32), we need to call it.
+    AC_CACHE_CHECK([for WSAStartup],
+      [gl_cv_func_wsastartup], [
+       gl_save_LIBS="$LIBS"
+       LIBS="$LIBS -lws2_32"
+       AC_LINK_IFELSE(
+         [AC_LANG_PROGRAM([[
+#ifdef HAVE_WINSOCK2_H
+# include <winsock2.h>
+#endif]], [[
+            WORD wVersionRequested = MAKEWORD(1, 1);
+            WSADATA wsaData;
+            int err = WSAStartup(wVersionRequested, &wsaData);
+            WSACleanup ();
+            ]])
+         ],
+         [gl_cv_func_wsastartup=yes],
+         [gl_cv_func_wsastartup=no])
+       LIBS="$gl_save_LIBS"
+      ])
+    if test "$gl_cv_func_wsastartup" = "yes"; then
+      AC_DEFINE([WINDOWS_SOCKETS], [1], [Define if WSAStartup is needed.])
+      LIBSOCKET='-lws2_32'
+    fi
+  else
+    dnl Unix API.
+    dnl Solaris has most socket functions in libsocket.
+    dnl Haiku has most socket functions in libnetwork.
+    dnl BeOS has most socket functions in libnet.
+    dnl On HP-UX, do NOT link with libxnet, because in 64-bit mode this would
+    dnl break code (e.g. in libraries) that invokes accept(), getpeername(),
+    dnl getsockname(), getsockopt(), or recvfrom() with a 32-bit addrlen. See
+    dnl "man xopen_networking" for details.
+    AC_CACHE_CHECK([for library containing setsockopt], [gl_cv_lib_socket], [
+      gl_cv_lib_socket=
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+        [],
+        [gl_save_LIBS="$LIBS"
+         LIBS="$gl_save_LIBS -lsocket"
+         AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+           [gl_cv_lib_socket="-lsocket"])
+         if test -z "$gl_cv_lib_socket"; then
+           LIBS="$gl_save_LIBS -lnetwork"
+           AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+             [gl_cv_lib_socket="-lnetwork"])
+           if test -z "$gl_cv_lib_socket"; then
+             LIBS="$gl_save_LIBS -lnet"
+             AC_LINK_IFELSE([AC_LANG_PROGRAM([[extern
+#ifdef __cplusplus
+"C"
+#endif
+char setsockopt();]], [[setsockopt();]])],
+               [gl_cv_lib_socket="-lnet"])
+           fi
+         fi
+         LIBS="$gl_save_LIBS"
+        ])
+      if test -z "$gl_cv_lib_socket"; then
+        gl_cv_lib_socket="none needed"
+      fi
+    ])
+    if test "$gl_cv_lib_socket" != "none needed"; then
+      LIBSOCKET="$gl_cv_lib_socket"
+    fi
+  fi
+  AC_SUBST([LIBSOCKET])
+])
diff --git a/m4/sockets.m4 b/m4/sockets.m4
new file mode 100644 (file)
index 0000000..02b43b6
--- /dev/null
@@ -0,0 +1,17 @@
+# sockets.m4 serial 7
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_SOCKETS],
+[
+  AC_REQUIRE([AC_C_INLINE])
+  AC_REQUIRE([gl_SOCKETLIB])
+  gl_PREREQ_SOCKETS
+])
+
+# Prerequisites of lib/sockets.c.
+AC_DEFUN([gl_PREREQ_SOCKETS], [
+  :
+])
diff --git a/m4/socklen.m4 b/m4/socklen.m4
new file mode 100644 (file)
index 0000000..eca1d1b
--- /dev/null
@@ -0,0 +1,76 @@
+# socklen.m4 serial 11
+dnl Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Albert Chin, Windows fixes from Simon Josefsson.
+
+dnl Check for socklen_t: historically on BSD it is an int, and in
+dnl POSIX 1g it is a type of its own, but some platforms use different
+dnl types for the argument to getsockopt, getpeername, etc.:
+dnl HP-UX 10.20, IRIX 6.5, OSF/1 4.0, Interix 3.5, BeOS.
+dnl So we have to test to find something that will work.
+
+AC_DEFUN([gl_TYPE_SOCKLEN_T],
+  [AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])dnl
+   AC_CHECK_TYPE([socklen_t], ,
+     [AC_CACHE_CHECK([for socklen_t equivalent],
+        [gl_cv_socklen_t_equiv],
+        [# Systems have either "struct sockaddr *" or
+         # "void *" as the second argument to getpeername
+         gl_cv_socklen_t_equiv=
+         for arg2 in "struct sockaddr" void; do
+           for t in int size_t "unsigned int" "long int" "unsigned long int"; do
+             AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+                 [[#include <sys/types.h>
+                   #include <sys/socket.h>
+
+                   int getpeername (int, $arg2 *, $t *);]],
+                 [[$t len;
+                  getpeername (0, 0, &len);]])],
+               [gl_cv_socklen_t_equiv="$t"])
+             test "$gl_cv_socklen_t_equiv" != "" && break
+           done
+           test "$gl_cv_socklen_t_equiv" != "" && break
+         done
+         if test "$gl_cv_socklen_t_equiv" = ""; then
+           AC_MSG_ERROR([Cannot find a type to use in place of socklen_t])
+         fi
+        ])
+      AC_DEFINE_UNQUOTED([socklen_t], [$gl_cv_socklen_t_equiv],
+        [type to use in place of socklen_t if not defined])],
+     [gl_SOCKET_HEADERS])])
+
+dnl On mingw32, socklen_t is in ws2tcpip.h ('int'), so we try to find
+dnl it there too.  But on Cygwin, wc2tcpip.h must not be included.  Users
+dnl of this module should use the same include pattern as gl_SOCKET_HEADERS.
+dnl When you change this macro, keep also in sync:
+dnl   - gl_CHECK_SOCKET_HEADERS,
+dnl   - the Include section of modules/socklen.
+AC_DEFUN([gl_SOCKET_HEADERS],
+[
+/* <sys/types.h> is not needed according to POSIX, but the
+   <sys/socket.h> in i386-unknown-freebsd4.10 and
+   powerpc-apple-darwin5.5 required it. */
+#include <sys/types.h>
+#if HAVE_SYS_SOCKET_H
+# include <sys/socket.h>
+#elif HAVE_WS2TCPIP_H
+# include <ws2tcpip.h>
+#endif
+])
+
+dnl Tests for the existence of the header for socket facilities.
+dnl Defines the C macros HAVE_SYS_SOCKET_H, HAVE_WS2TCPIP_H.
+dnl This macro must match gl_SOCKET_HEADERS.
+AC_DEFUN([gl_CHECK_SOCKET_HEADERS],
+  [AC_CHECK_HEADERS_ONCE([sys/socket.h])
+   if test $ac_cv_header_sys_socket_h = no; then
+     dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
+     dnl the check for those headers unconditional; yet cygwin reports
+     dnl that the headers are present but cannot be compiled (since on
+     dnl cygwin, all socket information should come from sys/socket.h).
+     AC_CHECK_HEADERS([ws2tcpip.h])
+   fi
+  ])
diff --git a/m4/sockpfaf.m4 b/m4/sockpfaf.m4
new file mode 100644 (file)
index 0000000..17e14c7
--- /dev/null
@@ -0,0 +1,84 @@
+# sockpfaf.m4 serial 10
+dnl Copyright (C) 2004, 2006, 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Test for some common socket protocol families (PF_INET, PF_INET6, ...)
+dnl and some common address families (AF_INET, AF_INET6, ...).
+dnl This test assumes that a system supports an address family if and only if
+dnl it supports the corresponding protocol family.
+
+dnl From Bruno Haible.
+
+AC_DEFUN([gl_SOCKET_FAMILIES],
+[
+  AC_REQUIRE([gl_SYS_SOCKET_H])
+  AC_CHECK_HEADERS_ONCE([netinet/in.h])
+
+  AC_CACHE_CHECK([for IPv4 sockets],
+    [gl_cv_socket_ipv4],
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif]],
+[[int x = AF_INET; struct in_addr y; struct sockaddr_in z;
+ if (&x && &y && &z) return 0;]])],
+       gl_cv_socket_ipv4=yes, gl_cv_socket_ipv4=no)])
+  if test $gl_cv_socket_ipv4 = yes; then
+    AC_DEFINE([HAVE_IPV4], [1], [Define to 1 if <sys/socket.h> defines AF_INET.])
+  fi
+
+  AC_CACHE_CHECK([for IPv6 sockets],
+    [gl_cv_socket_ipv6],
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_NETINET_IN_H
+#include <netinet/in.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif
+#ifdef HAVE_WS2TCPIP_H
+#include <ws2tcpip.h>
+#endif]],
+[[int x = AF_INET6; struct in6_addr y; struct sockaddr_in6 z;
+ if (&x && &y && &z) return 0;]])],
+       gl_cv_socket_ipv6=yes, gl_cv_socket_ipv6=no)])
+  if test $gl_cv_socket_ipv6 = yes; then
+    AC_DEFINE([HAVE_IPV6], [1], [Define to 1 if <sys/socket.h> defines AF_INET6.])
+  fi
+])
+
+AC_DEFUN([gl_SOCKET_FAMILY_UNIX],
+[
+  AC_REQUIRE([gl_SYS_SOCKET_H])
+  AC_CHECK_HEADERS_ONCE([sys/un.h])
+
+  AC_CACHE_CHECK([for UNIX domain sockets],
+    [gl_cv_socket_unix],
+    [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
+#ifdef HAVE_SYS_SOCKET_H
+#include <sys/socket.h>
+#endif
+#ifdef HAVE_SYS_UN_H
+#include <sys/un.h>
+#endif
+#ifdef HAVE_WINSOCK2_H
+#include <winsock2.h>
+#endif]],
+[[int x = AF_UNIX; struct sockaddr_un y;
+ if (&x && &y) return 0;]])],
+       gl_cv_socket_unix=yes, gl_cv_socket_unix=no)])
+  if test $gl_cv_socket_unix = yes; then
+    AC_DEFINE([HAVE_UNIXSOCKET], [1], [Define to 1 if <sys/socket.h> defines AF_UNIX.])
+  fi
+])
diff --git a/m4/sparcv8+.m4 b/m4/sparcv8+.m4
new file mode 100644 (file)
index 0000000..373cf60
--- /dev/null
@@ -0,0 +1,42 @@
+# sparcv8+.m4 serial 1
+dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl When compiling for SPARC in 32-bit mode, make sure that instructions for
+dnl SPARC v8+ are accepted.  This is necessary for multiprocessing (for
+dnl instructions like 'membar' or 'cas').  All SPARC CPUs made since 1993
+dnl support this instruction set.  But GCC in its default configuration, in
+dnl 32-bit mode (64-bit mode assumes SPARC v9 or newer), still defaults to
+dnl SPARC v7 instruction set: "By default (unless configured otherwise), GCC
+dnl generates code for the V7 variant of the SPARC architecture."  See
+dnl <https://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/SPARC-Options.html>
+dnl <https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/SPARC-Options.html>
+
+AC_DEFUN([gl_SPARC_V8PLUS],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+
+  case "$host_cpu" in
+    sparc*)
+      if test -n "$GCC"; then
+        AC_CACHE_CHECK([whether SPARC v8+ instructions are supported],
+          [gl_cv_sparc_v8plus],
+          [AC_COMPILE_IFELSE(
+             [AC_LANG_PROGRAM(
+                [[]],
+                [[asm volatile ("membar 2");]])],
+             [gl_cv_sparc_v8plus=yes],
+             [gl_cv_sparc_v8plus=no])
+          ])
+        if test $gl_cv_sparc_v8plus = no; then
+          dnl Strangely enough, '-mv8plus' does not have the desired effect.
+          dnl But '-mcpu=v9' does.
+          CC="$CC -mcpu=v9"
+          CXX="$CXX -mcpu=v9"
+        fi
+      fi
+      ;;
+  esac
+])
index efc34a8..67eb602 100644 (file)
@@ -1,5 +1,5 @@
 # spawn-pipe.m4 serial 2
-dnl Copyright (C) 2004, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2004, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 94e4ca1..134b7b9 100644 (file)
@@ -1,15 +1,15 @@
-# spawn_h.m4 serial 16
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# spawn_h.m4 serial 21
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Bruno Haible.
 
-AC_DEFUN([gl_SPAWN_H],
+AC_DEFUN_ONCE([gl_SPAWN_H],
 [
-  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
-  dnl once only, before all statements that occur in other macros.
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
   AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
 
   dnl <spawn.h> is always overridden, because of GNULIB_POSIXCHECK.
@@ -53,15 +53,16 @@ AC_DEFUN([gl_SPAWN_H],
     posix_spawnattr_getschedparam posix_spawnattr_setschedparam
     posix_spawn_file_actions_init posix_spawn_file_actions_destroy
     posix_spawn_file_actions_addopen posix_spawn_file_actions_addclose
-    posix_spawn_file_actions_adddup2])
+    posix_spawn_file_actions_adddup2 posix_spawn_file_actions_addchdir
+    posix_spawn_file_actions_addfchdir])
 ])
 
 dnl Checks whether the system has the functions posix_spawn.
 dnl Sets ac_cv_func_posix_spawn and HAVE_POSIX_SPAWN.
 AC_DEFUN([gl_HAVE_POSIX_SPAWN],
 [
-  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
-  dnl once only, before all statements that occur in other macros.
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
   AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
 
   LIB_POSIX_SPAWN=
@@ -78,48 +79,73 @@ AC_DEFUN([gl_HAVE_POSIX_SPAWN],
   fi
 ])
 
+# gl_SPAWN_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_SPAWN_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_SPAWN_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SPAWN_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SPAWN_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_INIT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_GETFLAGS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_SETFLAGS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_GETPGROUP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_SETPGROUP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_GETSIGMASK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_SETSIGMASK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_SPAWNATTR_DESTROY])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SPAWN_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SPAWN_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_SPAWN_H_DEFAULTS],
 [
-  GNULIB_POSIX_SPAWN=0;                       AC_SUBST([GNULIB_POSIX_SPAWN])
-  GNULIB_POSIX_SPAWNP=0;                      AC_SUBST([GNULIB_POSIX_SPAWNP])
-  GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT=0;     AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT])
-  GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0; AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE])
-  GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0;  AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2])
-  GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0;  AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN])
-  GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY=0;  AC_SUBST([GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY])
-  GNULIB_POSIX_SPAWNATTR_INIT=0;              AC_SUBST([GNULIB_POSIX_SPAWNATTR_INIT])
-  GNULIB_POSIX_SPAWNATTR_GETFLAGS=0;          AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETFLAGS])
-  GNULIB_POSIX_SPAWNATTR_SETFLAGS=0;          AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETFLAGS])
-  GNULIB_POSIX_SPAWNATTR_GETPGROUP=0;         AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETPGROUP])
-  GNULIB_POSIX_SPAWNATTR_SETPGROUP=0;         AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETPGROUP])
-  GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM=0;     AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM])
-  GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM=0;     AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM])
-  GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY=0;    AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY])
-  GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY=0;    AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY])
-  GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT=0;     AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT])
-  GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT=0;     AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT])
-  GNULIB_POSIX_SPAWNATTR_GETSIGMASK=0;        AC_SUBST([GNULIB_POSIX_SPAWNATTR_GETSIGMASK])
-  GNULIB_POSIX_SPAWNATTR_SETSIGMASK=0;        AC_SUBST([GNULIB_POSIX_SPAWNATTR_SETSIGMASK])
-  GNULIB_POSIX_SPAWNATTR_DESTROY=0;           AC_SUBST([GNULIB_POSIX_SPAWNATTR_DESTROY])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_POSIX_SPAWN=1;        AC_SUBST([HAVE_POSIX_SPAWN])
   HAVE_POSIX_SPAWNATTR_T=1;  AC_SUBST([HAVE_POSIX_SPAWNATTR_T])
   HAVE_POSIX_SPAWN_FILE_ACTIONS_T=1;
                              AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_T])
+  HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=1;
+                             AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR])
+  HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=1;
+                             AC_SUBST([HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR])
   REPLACE_POSIX_SPAWN=0;     AC_SUBST([REPLACE_POSIX_SPAWN])
+  REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR=0;
+                             AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR])
   REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE=0;
                              AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE])
   REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2=0;
                              AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2])
+  REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR=0;
+                             AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR])
   REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN=0;
                              AC_SUBST([REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN])
 ])
index 3e7b9e6..f0ed509 100644 (file)
@@ -1,5 +1,5 @@
 # ssize_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2001-2003, 2006, 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2003, 2006, 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/stack-direction.m4 b/m4/stack-direction.m4
new file mode 100644 (file)
index 0000000..c7a20a2
--- /dev/null
@@ -0,0 +1,104 @@
+# stack-direction.m4 serial 6
+dnl Copyright (C) 2002-2021 Bruno Haible <bruno@clisp.org>
+dnl Copyright (C) 2002-2021 Free Software Foundation, Inc.
+dnl This file is free software, distributed under the terms of the GNU
+dnl General Public License.  As a special exception to the GNU General
+dnl Public License, this file may be distributed as part of a program
+dnl that contains a configuration script generated by Autoconf, under
+dnl the same distribution terms as the rest of that program.
+
+# Determine the stack direction. Define the C macro STACK_DIRECTION.
+AC_DEFUN([SV_STACK_DIRECTION],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([for stack direction], [sv_cv_stack_direction_msg], [
+    case "$host_cpu" in
+      dnl See the #define STACK_GROWS_DOWNWARD in gcc-3.1/gcc/config/*/*.h.
+      a29k | \
+      aarch64* | \
+      alpha* | \
+      arc | \
+      arm* | strongarm* | xscale* | \
+      avr | avr32 | \
+      bfin | \
+      c1 | c2 | c32 | c34 | c38 | \
+      clipper | \
+      cris | \
+      d30v | \
+      elxsi | \
+      fr30 | \
+      h8300 | \
+      i?86 | x86_64 | \
+      i860 | \
+      ia64 | \
+      m32r | \
+      m68* | \
+      m88k | \
+      mcore | \
+      microblaze | \
+      mips* | \
+      mmix | \
+      mn10200 | \
+      mn10300 | \
+      nios2 | \
+      nds32* | \
+      ns32k | \
+      pdp11 | \
+      pj* | \
+      powerpc* | rs6000 | \
+      riscv* | \
+      romp | \
+      s390* | \
+      sh* | \
+      sparc* | \
+      v850 | \
+      vax | \
+      xtensa)
+        sv_cv_stack_direction=-1 ;;
+      c4x | \
+      dsp16xx | \
+      i960 | \
+      hppa* | parisc* | \
+      stormy16 | \
+      we32k)
+        sv_cv_stack_direction=1 ;;
+      *)
+        if test $cross_compiling = no; then
+          cat > conftest.c <<EOF
+#include <stdio.h>
+int
+find_stack_direction (int *addr, int depth)
+{
+  int dir, dummy = 0;
+  if (! addr)
+    addr = &dummy;
+  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+  return dir + dummy;
+}
+int
+main (int argc, char *argv[])
+{
+  printf ("%d\n", find_stack_direction (NULL, argc + 20));
+  return 0;
+}
+EOF
+          AC_TRY_EVAL([ac_link])
+          sv_cv_stack_direction=`./conftest`
+        else
+          sv_cv_stack_direction=0
+        fi
+        ;;
+    esac
+    case $sv_cv_stack_direction in
+      1)  sv_cv_stack_direction_msg="grows up";;
+      -1) sv_cv_stack_direction_msg="grows down";;
+      *)  sv_cv_stack_direction_msg="unknown";;
+    esac
+  ])
+  AC_DEFINE_UNQUOTED([STACK_DIRECTION], [$sv_cv_stack_direction],
+    [Define as the direction of stack growth for your system.
+     STACK_DIRECTION > 0 => grows toward higher addresses
+     STACK_DIRECTION < 0 => grows toward lower addresses
+     STACK_DIRECTION = 0 => spaghetti stack.])
+])
diff --git a/m4/stat-time.m4 b/m4/stat-time.m4
new file mode 100644 (file)
index 0000000..df1c2a7
--- /dev/null
@@ -0,0 +1,83 @@
+# Checks for stat-related time functions.
+
+# Copyright (C) 1998-1999, 2001, 2003, 2005-2007, 2009-2021 Free Software
+# Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+dnl From Paul Eggert.
+
+# st_atim.tv_nsec - Linux, Solaris, Cygwin
+# st_atimespec.tv_nsec - FreeBSD, NetBSD, if ! defined _POSIX_SOURCE
+# st_atimensec - FreeBSD, NetBSD, if defined _POSIX_SOURCE
+# st_atim.st__tim.tv_nsec - UnixWare (at least 2.1.2 through 7.1)
+
+# st_birthtimespec - FreeBSD, NetBSD (hidden on OpenBSD 3.9, anyway)
+# st_birthtim - Cygwin 1.7.0+
+
+AC_DEFUN([gl_STAT_TIME],
+[
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_CHECK_HEADERS_ONCE([sys/time.h])
+
+  AC_CHECK_MEMBERS([struct stat.st_atim.tv_nsec],
+    [AC_CACHE_CHECK([whether struct stat.st_atim is of type struct timespec],
+       [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec],
+       [AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+          [[
+            #include <sys/types.h>
+            #include <sys/stat.h>
+            #if HAVE_SYS_TIME_H
+            # include <sys/time.h>
+            #endif
+            #include <time.h>
+            struct timespec ts;
+            struct stat st;
+          ]],
+          [[
+            st.st_atim = ts;
+          ]])],
+          [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=yes],
+          [ac_cv_typeof_struct_stat_st_atim_is_struct_timespec=no])])
+     if test $ac_cv_typeof_struct_stat_st_atim_is_struct_timespec = yes; then
+       AC_DEFINE([TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC], [1],
+         [Define to 1 if the type of the st_atim member of a struct stat is
+          struct timespec.])
+     fi],
+    [AC_CHECK_MEMBERS([struct stat.st_atimespec.tv_nsec], [],
+       [AC_CHECK_MEMBERS([struct stat.st_atimensec], [],
+          [AC_CHECK_MEMBERS([struct stat.st_atim.st__tim.tv_nsec], [], [],
+             [#include <sys/types.h>
+              #include <sys/stat.h>])],
+          [#include <sys/types.h>
+           #include <sys/stat.h>])],
+       [#include <sys/types.h>
+        #include <sys/stat.h>])],
+    [#include <sys/types.h>
+     #include <sys/stat.h>])
+])
+
+# Check for st_birthtime, a feature from UFS2 (FreeBSD, NetBSD, OpenBSD, etc.)
+# and NTFS (Cygwin).
+# There was a time when this field was named st_createtime (21 June
+# 2002 to 16 July 2002) But that window is very small and applied only
+# to development code, so systems still using that configuration are
+# not supported.  See revisions 1.10 and 1.11 of FreeBSD's
+# src/sys/ufs/ufs/dinode.h.
+#
+AC_DEFUN([gl_STAT_BIRTHTIME],
+[
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+  AC_CHECK_HEADERS_ONCE([sys/time.h])
+  AC_CHECK_MEMBERS([struct stat.st_birthtimespec.tv_nsec], [],
+    [AC_CHECK_MEMBERS([struct stat.st_birthtimensec], [],
+      [AC_CHECK_MEMBERS([struct stat.st_birthtim.tv_nsec], [], [],
+         [#include <sys/types.h>
+          #include <sys/stat.h>])],
+       [#include <sys/types.h>
+        #include <sys/stat.h>])],
+    [#include <sys/types.h>
+     #include <sys/stat.h>])
+])
index a794975..9bcdb72 100644 (file)
@@ -1,6 +1,6 @@
-# serial 11
+# serial 18
 
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -8,64 +8,78 @@
 
 AC_DEFUN([gl_FUNC_STAT],
 [
-  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
   AC_CHECK_FUNCS_ONCE([lstat])
-  dnl mingw is the only known platform where stat(".") and stat("./") differ
-  AC_CACHE_CHECK([whether stat handles trailing slashes on directories],
-      [gl_cv_func_stat_dir_slash],
-      [AC_RUN_IFELSE(
-         [AC_LANG_PROGRAM(
-           [[#include <sys/stat.h>
-]], [[struct stat st; return stat (".", &st) != stat ("./", &st);]])],
-         [gl_cv_func_stat_dir_slash=yes], [gl_cv_func_stat_dir_slash=no],
-         [case $host_os in
-            mingw*) gl_cv_func_stat_dir_slash="guessing no";;
-            *) gl_cv_func_stat_dir_slash="guessing yes";;
-          esac])])
-  dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
-  dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
-  dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
-  AC_CACHE_CHECK([whether stat handles trailing slashes on files],
-      [gl_cv_func_stat_file_slash],
-      [touch conftest.tmp
-       # Assume that if we have lstat, we can also check symlinks.
-       if test $ac_cv_func_lstat = yes; then
-         ln -s conftest.tmp conftest.lnk
-       fi
-       AC_RUN_IFELSE(
-         [AC_LANG_PROGRAM(
-           [[#include <sys/stat.h>
+  case "$host_os" in
+    mingw*)
+      dnl On this platform, the original stat() returns st_atime, st_mtime,
+      dnl st_ctime values that are affected by the time zone.
+      REPLACE_STAT=1
+      ;;
+    *)
+      dnl AIX 7.1, Solaris 9, mingw64 mistakenly succeed on stat("file/").
+      dnl (For mingw, this is due to a broken stat() override in libmingwex.a.)
+      dnl FreeBSD 7.2 mistakenly succeeds on stat("link-to-file/").
+      AC_CACHE_CHECK([whether stat handles trailing slashes on files],
+        [gl_cv_func_stat_file_slash],
+        [touch conftest.tmp
+         # Assume that if we have lstat, we can also check symlinks.
+         if test $ac_cv_func_lstat = yes; then
+           ln -s conftest.tmp conftest.lnk
+         fi
+         AC_RUN_IFELSE(
+           [AC_LANG_PROGRAM(
+             [[#include <sys/stat.h>
 ]], [[int result = 0;
-      struct stat st;
-      if (!stat ("conftest.tmp/", &st))
-        result |= 1;
+               struct stat st;
+               if (!stat ("conftest.tmp/", &st))
+                 result |= 1;
 #if HAVE_LSTAT
-      if (!stat ("conftest.lnk/", &st))
-        result |= 2;
+               if (!stat ("conftest.lnk/", &st))
+                 result |= 2;
 #endif
-      return result;
-           ]])],
-         [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
-         [case "$host_os" in
-                    # Guess yes on glibc systems.
-            *-gnu*) gl_cv_func_stat_file_slash="guessing yes" ;;
-                    # If we don't know, assume the worst.
-            *)      gl_cv_func_stat_file_slash="guessing no" ;;
-          esac
-         ])
-       rm -f conftest.tmp conftest.lnk])
-  case $gl_cv_func_stat_dir_slash in
-    *no) REPLACE_STAT=1
-      AC_DEFINE([REPLACE_FUNC_STAT_DIR], [1], [Define to 1 if stat needs
-        help when passed a directory name with a trailing slash]);;
-  esac
-  case $gl_cv_func_stat_file_slash in
-    *no) REPLACE_STAT=1
-      AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
-        help when passed a file name with a trailing slash]);;
+               return result;
+             ]])],
+           [gl_cv_func_stat_file_slash=yes], [gl_cv_func_stat_file_slash=no],
+           [case "$host_os" in
+                               # Guess yes on Linux systems.
+              linux-* | linux) gl_cv_func_stat_file_slash="guessing yes" ;;
+                               # Guess yes on glibc systems.
+              *-gnu* | gnu*)   gl_cv_func_stat_file_slash="guessing yes" ;;
+                               # If we don't know, obey --enable-cross-guesses.
+              *)               gl_cv_func_stat_file_slash="$gl_cross_guess_normal" ;;
+            esac
+           ])
+         rm -f conftest.tmp conftest.lnk])
+      case $gl_cv_func_stat_file_slash in
+        *no)
+          REPLACE_STAT=1
+          AC_DEFINE([REPLACE_FUNC_STAT_FILE], [1], [Define to 1 if stat needs
+            help when passed a file name with a trailing slash]);;
+      esac
+      case $host_os in
+        dnl Solaris stat can return a negative tv_nsec.
+        solaris*)
+          REPLACE_FSTAT=1 ;;
+      esac
+      ;;
   esac
 ])
 
-# Prerequisites of lib/stat.c.
-AC_DEFUN([gl_PREREQ_STAT], [:])
+# Prerequisites of lib/stat.c and lib/stat-w32.c.
+AC_DEFUN([gl_PREREQ_STAT], [
+  AC_REQUIRE([gl_SYS_STAT_H])
+  AC_REQUIRE([gl_PREREQ_STAT_W32])
+  :
+])
+
+# Prerequisites of lib/stat-w32.c.
+AC_DEFUN([gl_PREREQ_STAT_W32], [
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  case "$host_os" in
+    mingw*)
+      AC_CHECK_HEADERS([sdkddkver.h])
+      ;;
+  esac
+])
index 49980cd..e22d7f7 100644 (file)
@@ -1,6 +1,6 @@
 # Check for stdalign.h that conforms to C11.
 
-dnl Copyright 2011-2016 Free Software Foundation, Inc.
+dnl Copyright 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -13,12 +13,13 @@ AC_DEFUN([gl_STDALIGN_H],
     [gl_cv_header_working_stdalign_h],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
-          [[#include <stdalign.h>
+          [[#include <stdint.h>
+            #include <stdalign.h>
             #include <stddef.h>
 
             /* Test that alignof yields a result consistent with offsetof.
                This catches GCC bug 52023
-               <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.  */
+               <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52023>.  */
             #ifdef __cplusplus
                template <class t> struct alignof_helper { char a; t b; };
             # define ao(type) offsetof (alignof_helper<type>, b)
@@ -32,11 +33,12 @@ AC_DEFUN([gl_STDALIGN_H],
             /* Test _Alignas only on platforms where gnulib can help.  */
             #if \
                 ((defined __cplusplus && 201103 <= __cplusplus) \
+                 || (__TINYC__ && defined __attribute__) \
                  || (defined __APPLE__ && defined __MACH__ \
                      ? 4 < __GNUC__ + (1 <= __GNUC_MINOR__) \
                      : __GNUC__) \
-                 || __HP_cc || __HP_aCC || __IBMC__ || __IBMCPP__ \
-                 || __ICC || 0x5110 <= __SUNPRO_C \
+                 || (__ia64 && (61200 <= __HP_cc || 61200 <= __HP_aCC)) \
+                 || __ICC || 0x590 <= __SUNPRO_C || 0x0600 <= __xlC__ \
                  || 1300 <= _MSC_VER)
               struct alignas_test { char c; char alignas (8) alignas_8; };
               char test_alignas[offsetof (struct alignas_test, alignas_8) == 8
index ab3e7f5..0b5fb63 100644 (file)
@@ -1,5 +1,5 @@
-# stdarg.m4 serial 6
-dnl Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
+# stdarg.m4 serial 7
+dnl Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -11,19 +11,19 @@ AC_DEFUN([gl_STDARG_H],
 [
   STDARG_H=''
   NEXT_STDARG_H='<stdarg.h>'
-  AC_MSG_CHECKING([for va_copy])
-  AC_CACHE_VAL([gl_cv_func_va_copy], [
-    AC_COMPILE_IFELSE(
-      [AC_LANG_PROGRAM(
-         [[#include <stdarg.h>]],
-         [[
+  AC_CACHE_CHECK([for va_copy],
+    [gl_cv_func_va_copy],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stdarg.h>]],
+          [[
 #ifndef va_copy
 void (*func) (va_list, va_list) = va_copy;
 #endif
-         ]])],
-      [gl_cv_func_va_copy=yes],
-      [gl_cv_func_va_copy=no])])
-  AC_MSG_RESULT([$gl_cv_func_va_copy])
+          ]])],
+       [gl_cv_func_va_copy=yes],
+       [gl_cv_func_va_copy=no])
+    ])
   if test $gl_cv_func_va_copy = no; then
     dnl Provide a substitute.
     dnl Usually a simple definition in <config.h> is enough. Not so on AIX 5
index 2a9b1db..3169779 100644 (file)
@@ -1,22 +1,36 @@
 # Check for stdbool.h that conforms to C99.
 
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-#serial 7
+#serial 8
 
 # Prepare for substituting <stdbool.h> if it is not supported.
 
 AC_DEFUN([AM_STDBOOL_H],
 [
   AC_REQUIRE([AC_CHECK_HEADER_STDBOOL])
+  AC_REQUIRE([AC_CANONICAL_HOST])
 
-  # Define two additional variables used in the Makefile substitution.
-
+  dnl On some platforms, <stdbool.h> does not exist or does not conform to C99.
+  dnl On Solaris 10 with CC=cc CXX=CC, <stdbool.h> exists but is not usable
+  dnl in C++ mode (and no <cstdbool> exists). In this case, we use our
+  dnl replacement, also in C mode (for binary compatibility between C and C++).
   if test "$ac_cv_header_stdbool_h" = yes; then
-    STDBOOL_H=''
+    case "$host_os" in
+      solaris*)
+        if test -z "$GCC"; then
+          STDBOOL_H='stdbool.h'
+        else
+          STDBOOL_H=''
+        fi
+        ;;
+      *)
+        STDBOOL_H=''
+        ;;
+    esac
   else
     STDBOOL_H='stdbool.h'
   fi
@@ -87,8 +101,8 @@ AC_DEFUN([AC_CHECK_HEADER_STDBOOL],
              char o[sizeof n == m * sizeof n[0] ? 1 : -1];
              char p[-1 - (Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
              /* Catch a bug in an HP-UX C compiler.  See
-                http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-                http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+                https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+                https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
               */
              Bool q = true;
              Bool *pq = &q;
index c045c65..1303d2e 100644 (file)
@@ -1,22 +1,54 @@
-dnl A placeholder for <stddef.h>, for platforms that have issues.
-# stddef_h.m4 serial 5
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# stddef_h.m4 serial 11
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_STDDEF_H],
+dnl A placeholder for <stddef.h>, for platforms that have issues.
+
+AC_DEFUN_ONCE([gl_STDDEF_H],
 [
   AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
+
+  dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
   STDDEF_H=
-  AC_CHECK_TYPE([max_align_t], [], [HAVE_MAX_ALIGN_T=0; STDDEF_H=stddef.h],
-    [[#include <stddef.h>
-    ]])
+
+  dnl Test whether the type max_align_t exists and whether its alignment
+  dnl "is as great as is supported by the implementation in all contexts".
+  AC_CACHE_CHECK([for good max_align_t],
+    [gl_cv_type_max_align_t],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <stddef.h>
+            unsigned int s = sizeof (max_align_t);
+            #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
+            int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1];
+            int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1];
+            #endif
+            typedef struct { char a; max_align_t b; } max_helper;
+            typedef struct { char a; long b; } long_helper;
+            typedef struct { char a; double b; } double_helper;
+            typedef struct { char a; long double b; } long_double_helper;
+            int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1];
+            int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1];
+            int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1];
+          ]])],
+       [gl_cv_type_max_align_t=yes],
+       [gl_cv_type_max_align_t=no])
+    ])
+  if test $gl_cv_type_max_align_t = no; then
+    HAVE_MAX_ALIGN_T=0
+    STDDEF_H=stddef.h
+  fi
+
   if test $gt_cv_c_wchar_t = no; then
     HAVE_WCHAR_T=0
     STDDEF_H=stddef.h
   fi
+
   AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
     [gl_cv_decl_null_works],
     [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
@@ -28,6 +60,7 @@ AC_DEFUN([gl_STDDEF_H],
     REPLACE_NULL=1
     STDDEF_H=stddef.h
   fi
+
   AC_SUBST([STDDEF_H])
   AM_CONDITIONAL([GL_GENERATE_STDDEF_H], [test -n "$STDDEF_H"])
   if test -n "$STDDEF_H"; then
@@ -35,13 +68,28 @@ AC_DEFUN([gl_STDDEF_H],
   fi
 ])
 
+# gl_STDDEF_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_STDDEF_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_STDDEF_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STDDEF_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS], [
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_STDDEF_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_STDDEF_H_DEFAULTS],
 [
   dnl Assume proper GNU behavior unless another module says otherwise.
index 1d0d951..2eb1652 100644 (file)
@@ -1,5 +1,5 @@
-# stdint.m4 serial 50
-dnl Copyright (C) 2001-2016 Free Software Foundation, Inc.
+# stdint.m4 serial 60
+dnl Copyright (C) 2001-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,28 +7,22 @@ dnl with or without modifications, as long as this notice is preserved.
 dnl From Paul Eggert and Bruno Haible.
 dnl Test whether <stdint.h> is supported or must be substituted.
 
+AC_PREREQ([2.61])
+
 AC_DEFUN_ONCE([gl_STDINT_H],
 [
   AC_PREREQ([2.59])dnl
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
   AC_REQUIRE([gl_LIMITS_H])
   AC_REQUIRE([gt_TYPE_WINT_T])
 
-  dnl Check for long long int and unsigned long long int.
-  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
-  if test $ac_cv_type_long_long_int = yes; then
-    HAVE_LONG_LONG_INT=1
-  else
-    HAVE_LONG_LONG_INT=0
-  fi
-  AC_SUBST([HAVE_LONG_LONG_INT])
-  AC_REQUIRE([AC_TYPE_UNSIGNED_LONG_LONG_INT])
-  if test $ac_cv_type_unsigned_long_long_int = yes; then
-    HAVE_UNSIGNED_LONG_LONG_INT=1
-  else
-    HAVE_UNSIGNED_LONG_LONG_INT=0
-  fi
-  AC_SUBST([HAVE_UNSIGNED_LONG_LONG_INT])
+  dnl For backward compatibility. Some packages may still be testing these
+  dnl macros.
+  AC_DEFINE([HAVE_LONG_LONG_INT], [1],
+    [Define to 1 if the system has the type 'long long int'.])
+  AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1],
+    [Define to 1 if the system has the type 'unsigned long long int'.])
 
   dnl Check for <wchar.h>, in the same way as gl_WCHAR_H does.
   AC_CHECK_HEADERS_ONCE([wchar.h])
@@ -40,7 +34,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
   AC_SUBST([HAVE_WCHAR_H])
 
   dnl Check for <inttypes.h>.
-  dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_inttypes_h.
+  AC_CHECK_HEADERS_ONCE([inttypes.h])
   if test $ac_cv_header_inttypes_h = yes; then
     HAVE_INTTYPES_H=1
   else
@@ -49,7 +43,7 @@ AC_DEFUN_ONCE([gl_STDINT_H],
   AC_SUBST([HAVE_INTTYPES_H])
 
   dnl Check for <sys/types.h>.
-  dnl AC_INCLUDES_DEFAULT defines $ac_cv_header_sys_types_h.
+  AC_CHECK_HEADERS_ONCE([sys/types.h])
   if test $ac_cv_header_sys_types_h = yes; then
     HAVE_SYS_TYPES_H=1
   else
@@ -158,7 +152,7 @@ uintmax_t j = UINTMAX_MAX;
 /* Check that SIZE_MAX has the correct type, if possible.  */
 #if 201112 <= __STDC_VERSION__
 int k = _Generic (SIZE_MAX, size_t: 0);
-#elif (2 <= __GNUC__ || defined __IBM__TYPEOF__ \
+#elif (2 <= __GNUC__ || 4 <= __clang_major__ || defined __IBM__TYPEOF__ \
        || (0x5110 <= __SUNPRO_C && !__STDC__))
 extern size_t k;
 extern __typeof__ (SIZE_MAX) k;
@@ -176,7 +170,7 @@ struct s {
       PTRDIFF_MIN == TYPE_MINIMUM (ptrdiff_t)
       && PTRDIFF_MAX == TYPE_MAXIMUM (ptrdiff_t)
       ? 1 : -1;
-  /* Detect bug in FreeBSD 6.0 / ia64.  */
+  /* Detect bug in FreeBSD 6.0/ia64 and FreeBSD 13.0/arm64.  */
   int check_SIG_ATOMIC:
       SIG_ATOMIC_MIN == TYPE_MINIMUM (sig_atomic_t)
       && SIG_ATOMIC_MAX == TYPE_MAXIMUM (sig_atomic_t)
@@ -288,8 +282,12 @@ static const char *macro_values[] =
 ]])],
               [gl_cv_header_working_stdint_h=yes],
               [],
-              [dnl When cross-compiling, assume it works.
-               gl_cv_header_working_stdint_h=yes
+              [case "$host_os" in
+                         # Guess yes on native Windows.
+                 mingw*) gl_cv_header_working_stdint_h="guessing yes" ;;
+                         # In general, assume it works.
+                 *)      gl_cv_header_working_stdint_h="guessing yes" ;;
+               esac
               ])
          ])
       ])
@@ -299,15 +297,17 @@ static const char *macro_values[] =
   HAVE_SYS_BITYPES_H=0
   HAVE_SYS_INTTYPES_H=0
   STDINT_H=stdint.h
-  if test "$gl_cv_header_working_stdint_h" = yes; then
-    HAVE_C99_STDINT_H=1
-    dnl Now see whether the system <stdint.h> works without
-    dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
-    AC_CACHE_CHECK([whether stdint.h predates C++11],
-      [gl_cv_header_stdint_predates_cxx11_h],
-      [gl_cv_header_stdint_predates_cxx11_h=yes
-       AC_COMPILE_IFELSE([
-         AC_LANG_PROGRAM([[
+  case "$gl_cv_header_working_stdint_h" in
+    *yes)
+      HAVE_C99_STDINT_H=1
+      dnl Now see whether the system <stdint.h> works without
+      dnl __STDC_CONSTANT_MACROS/__STDC_LIMIT_MACROS defined.
+      dnl If not, there would be problems when stdint.h is included from C++.
+      AC_CACHE_CHECK([whether stdint.h works without ISO C predefines],
+        [gl_cv_header_stdint_without_STDC_macros],
+        [gl_cv_header_stdint_without_STDC_macros=no
+         AC_COMPILE_IFELSE([
+           AC_LANG_PROGRAM([[
 #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
 #include <stdint.h>
 ]
@@ -315,49 +315,51 @@ gl_STDINT_INCLUDES
 [
 intmax_t im = INTMAX_MAX;
 int32_t i32 = INT32_C (0x7fffffff);
-         ]])],
-         [gl_cv_header_stdint_predates_cxx11_h=no])])
+           ]])],
+           [gl_cv_header_stdint_without_STDC_macros=yes])
+        ])
 
-    if test "$gl_cv_header_stdint_predates_cxx11_h" = yes; then
-      AC_DEFINE([__STDC_CONSTANT_MACROS], [1],
-                [Define to 1 if the system <stdint.h> predates C++11.])
-      AC_DEFINE([__STDC_LIMIT_MACROS], [1],
-                [Define to 1 if the system <stdint.h> predates C++11.])
-    fi
-    AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
-      [gl_cv_header_stdint_width],
-      [gl_cv_header_stdint_width=no
-       AC_COMPILE_IFELSE(
-         [AC_LANG_PROGRAM([[
-            /* Work if build is not clean.  */
-            #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
-            #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
-             #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
-            #endif
-            #include <stdint.h>
-            ]gl_STDINT_INCLUDES[
-            int iw = UINTMAX_WIDTH;
-            ]])],
-         [gl_cv_header_stdint_width=yes])])
-    if test "$gl_cv_header_stdint_width" = yes; then
-      STDINT_H=
-    fi
-  else
-    dnl Check for <sys/inttypes.h>, and for
-    dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
-    AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
-    if test $ac_cv_header_sys_inttypes_h = yes; then
-      HAVE_SYS_INTTYPES_H=1
-    fi
-    if test $ac_cv_header_sys_bitypes_h = yes; then
-      HAVE_SYS_BITYPES_H=1
-    fi
-    gl_STDINT_TYPE_PROPERTIES
-  fi
+      if test $gl_cv_header_stdint_without_STDC_macros = no; then
+        AC_DEFINE([__STDC_CONSTANT_MACROS], [1],
+          [Define to 1 if the system <stdint.h> predates C++11.])
+        AC_DEFINE([__STDC_LIMIT_MACROS], [1],
+          [Define to 1 if the system <stdint.h> predates C++11.])
+      fi
+      AC_CACHE_CHECK([whether stdint.h has UINTMAX_WIDTH etc.],
+        [gl_cv_header_stdint_width],
+        [gl_cv_header_stdint_width=no
+         AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM([[
+              /* Work if build is not clean.  */
+              #define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1
+              #ifndef __STDC_WANT_IEC_60559_BFP_EXT__
+               #define __STDC_WANT_IEC_60559_BFP_EXT__ 1
+              #endif
+              #include <stdint.h>
+              ]gl_STDINT_INCLUDES[
+              int iw = UINTMAX_WIDTH;
+              ]])],
+           [gl_cv_header_stdint_width=yes])])
+      if test "$gl_cv_header_stdint_width" = yes; then
+        STDINT_H=
+      fi
+      ;;
+    *)
+      dnl Check for <sys/inttypes.h>, and for
+      dnl <sys/bitypes.h> (used in Linux libc4 >= 4.6.7 and libc5).
+      AC_CHECK_HEADERS([sys/inttypes.h sys/bitypes.h])
+      if test $ac_cv_header_sys_inttypes_h = yes; then
+        HAVE_SYS_INTTYPES_H=1
+      fi
+      if test $ac_cv_header_sys_bitypes_h = yes; then
+        HAVE_SYS_BITYPES_H=1
+      fi
+      gl_STDINT_TYPE_PROPERTIES
+      ;;
+  esac
 
   dnl The substitute stdint.h needs the substitute limit.h's _GL_INTEGER_WIDTH.
-  LIMITS_H=limits.h
-  AM_CONDITIONAL([GL_GENERATE_LIMITS_H], [test -n "$LIMITS_H"])
+  gl_REPLACE_LIMITS_H
 
   AC_SUBST([HAVE_C99_STDINT_H])
   AC_SUBST([HAVE_SYS_BITYPES_H])
@@ -491,13 +493,9 @@ AC_DEFUN([gl_INTEGER_TYPE_SUFFIX],
 dnl gl_STDINT_INCLUDES
 AC_DEFUN([gl_STDINT_INCLUDES],
 [[
-  /* 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 <signal.h>
   #if HAVE_WCHAR_H
-  # include <stdio.h>
-  # include <time.h>
   # include <wchar.h>
   #endif
 ]])
@@ -529,13 +527,7 @@ AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
   dnl requirement that wint_t is "unchanged by default argument promotions".
   dnl In this case gnulib's <wchar.h> and <wctype.h> override wint_t.
   dnl Set the variable BITSIZEOF_WINT_T accordingly.
-  if test $GNULIB_OVERRIDES_WINT_T = 1; then
+  if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
     BITSIZEOF_WINT_T=32
   fi
 ])
-
-dnl Autoconf >= 2.61 has AC_COMPUTE_INT built-in.
-dnl Remove this when we can assume autoconf >= 2.61.
-m4_ifdef([AC_COMPUTE_INT], [], [
-  AC_DEFUN([AC_COMPUTE_INT], [_AC_COMPUTE_INT([$2],[$1],[$3],[$4])])
-])
index f823b94..18aa50a 100644 (file)
@@ -1,5 +1,5 @@
 # stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index eaa25a0..e704383 100644 (file)
@@ -1,11 +1,12 @@
-# stdio_h.m4 serial 48
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# stdio_h.m4 serial 56
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_STDIO_H],
+AC_DEFUN_ONCE([gl_STDIO_H],
 [
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   AH_VERBATIM([MINGW_ANSI_STDIO],
 [/* Use GNU style printf and scanf.  */
 #ifndef __USE_MINGW_ANSI_STDIO
@@ -13,7 +14,6 @@ AC_DEFUN([gl_STDIO_H],
 #endif
 ])
   AC_DEFINE([__USE_MINGW_ANSI_STDIO])
-  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
   gl_NEXT_HEADERS([stdio.h])
 
   dnl Determine whether __USE_MINGW_ANSI_STDIO makes printf and
@@ -28,7 +28,7 @@ AC_DEFUN([gl_STDIO_H],
        /* For non-mingw systems, compilation will trivially succeed.
           For mingw, compilation will succeed for older mingw (system
           printf, "I64d") and fail for newer mingw (gnu printf, "lld"). */
-       #if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) && \
+       #if (defined _WIN32 && ! defined __CYGWIN__) && \
          (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4))
        extern char PRIdMAX_probe[sizeof PRIdMAX == sizeof "I64d" ? 1 : -1];
        #endif
@@ -40,17 +40,6 @@ AC_DEFUN([gl_STDIO_H],
        attribute "__gnu_printf__" instead of "__printf__"])
   fi
 
-  dnl No need to create extra modules for these functions. Everyone who uses
-  dnl <stdio.h> likely needs them.
-  GNULIB_FSCANF=1
-  gl_MODULE_INDICATOR([fscanf])
-  GNULIB_SCANF=1
-  gl_MODULE_INDICATOR([scanf])
-  GNULIB_FGETC=1
-  GNULIB_GETC=1
-  GNULIB_GETCHAR=1
-  GNULIB_FGETS=1
-  GNULIB_FREAD=1
   dnl This ifdef is necessary to avoid an error "missing file lib/stdio-read.c"
   dnl "expected source file, required through AC_LIBSOURCES, not found". It is
   dnl also an optimization, to avoid performing a configure check whose result
@@ -64,18 +53,6 @@ AC_DEFUN([gl_STDIO_H],
     fi
   ])
 
-  dnl No need to create extra modules for these functions. Everyone who uses
-  dnl <stdio.h> likely needs them.
-  GNULIB_FPRINTF=1
-  GNULIB_PRINTF=1
-  GNULIB_VFPRINTF=1
-  GNULIB_VPRINTF=1
-  GNULIB_FPUTC=1
-  GNULIB_PUTC=1
-  GNULIB_PUTCHAR=1
-  GNULIB_FPUTS=1
-  GNULIB_PUTS=1
-  GNULIB_FWRITE=1
   dnl This ifdef is necessary to avoid an error "missing file lib/stdio-write.c"
   dnl "expected source file, required through AC_LIBSOURCES, not found". It is
   dnl also an optimization, to avoid performing a configure check whose result
@@ -107,73 +84,103 @@ AC_DEFUN([gl_STDIO_H],
   gl_WARN_ON_USE_PREPARE([[#include <stdio.h>
     ]], [dprintf fpurge fseeko ftello getdelim getline gets pclose popen
     renameat snprintf tmpfile vdprintf vsnprintf])
+
+  AC_REQUIRE([AC_C_RESTRICT])
+
+  AC_CHECK_DECLS_ONCE([fcloseall])
+  if test $ac_cv_have_decl_fcloseall = no; then
+    HAVE_DECL_FCLOSEALL=0
+  fi
 ])
 
+# gl_STDIO_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_STDIO_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_STDIO_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STDIO_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCLOSE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDOPEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFLUSH])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FGETS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FOPEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPRINTF_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPURGE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPUTC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FPUTS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREAD])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREOPEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSCANF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSEEK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSEEKO])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTELLO])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FWRITE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCHAR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDELIM])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLINE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OBSTACK_PRINTF_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PCLOSE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PERROR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POPEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PRINTF_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTCHAR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REMOVE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RENAMEAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SCANF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SNPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SPRINTF_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_NONBLOCKING])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STDIO_H_SIGPIPE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TMPFILE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VASPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFSCANF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSCANF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VDPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VFPRINTF_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VPRINTF_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSNPRINTF])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_VSPRINTF_POSIX])
+    dnl Support Microsoft deprecated alias function names by default.
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCLOSEALL], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FDOPEN], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FILENO], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETW], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_PUTW], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TEMPNAM], [1])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_STDIO_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_STDIO_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_STDIO_H_DEFAULTS],
 [
-  GNULIB_DPRINTF=0;              AC_SUBST([GNULIB_DPRINTF])
-  GNULIB_FCLOSE=0;               AC_SUBST([GNULIB_FCLOSE])
-  GNULIB_FDOPEN=0;               AC_SUBST([GNULIB_FDOPEN])
-  GNULIB_FFLUSH=0;               AC_SUBST([GNULIB_FFLUSH])
-  GNULIB_FGETC=0;                AC_SUBST([GNULIB_FGETC])
-  GNULIB_FGETS=0;                AC_SUBST([GNULIB_FGETS])
-  GNULIB_FOPEN=0;                AC_SUBST([GNULIB_FOPEN])
-  GNULIB_FPRINTF=0;              AC_SUBST([GNULIB_FPRINTF])
-  GNULIB_FPRINTF_POSIX=0;        AC_SUBST([GNULIB_FPRINTF_POSIX])
-  GNULIB_FPURGE=0;               AC_SUBST([GNULIB_FPURGE])
-  GNULIB_FPUTC=0;                AC_SUBST([GNULIB_FPUTC])
-  GNULIB_FPUTS=0;                AC_SUBST([GNULIB_FPUTS])
-  GNULIB_FREAD=0;                AC_SUBST([GNULIB_FREAD])
-  GNULIB_FREOPEN=0;              AC_SUBST([GNULIB_FREOPEN])
-  GNULIB_FSCANF=0;               AC_SUBST([GNULIB_FSCANF])
-  GNULIB_FSEEK=0;                AC_SUBST([GNULIB_FSEEK])
-  GNULIB_FSEEKO=0;               AC_SUBST([GNULIB_FSEEKO])
-  GNULIB_FTELL=0;                AC_SUBST([GNULIB_FTELL])
-  GNULIB_FTELLO=0;               AC_SUBST([GNULIB_FTELLO])
-  GNULIB_FWRITE=0;               AC_SUBST([GNULIB_FWRITE])
-  GNULIB_GETC=0;                 AC_SUBST([GNULIB_GETC])
-  GNULIB_GETCHAR=0;              AC_SUBST([GNULIB_GETCHAR])
-  GNULIB_GETDELIM=0;             AC_SUBST([GNULIB_GETDELIM])
-  GNULIB_GETLINE=0;              AC_SUBST([GNULIB_GETLINE])
-  GNULIB_OBSTACK_PRINTF=0;       AC_SUBST([GNULIB_OBSTACK_PRINTF])
-  GNULIB_OBSTACK_PRINTF_POSIX=0; AC_SUBST([GNULIB_OBSTACK_PRINTF_POSIX])
-  GNULIB_PCLOSE=0;               AC_SUBST([GNULIB_PCLOSE])
-  GNULIB_PERROR=0;               AC_SUBST([GNULIB_PERROR])
-  GNULIB_POPEN=0;                AC_SUBST([GNULIB_POPEN])
-  GNULIB_PRINTF=0;               AC_SUBST([GNULIB_PRINTF])
-  GNULIB_PRINTF_POSIX=0;         AC_SUBST([GNULIB_PRINTF_POSIX])
-  GNULIB_PUTC=0;                 AC_SUBST([GNULIB_PUTC])
-  GNULIB_PUTCHAR=0;              AC_SUBST([GNULIB_PUTCHAR])
-  GNULIB_PUTS=0;                 AC_SUBST([GNULIB_PUTS])
-  GNULIB_REMOVE=0;               AC_SUBST([GNULIB_REMOVE])
-  GNULIB_RENAME=0;               AC_SUBST([GNULIB_RENAME])
-  GNULIB_RENAMEAT=0;             AC_SUBST([GNULIB_RENAMEAT])
-  GNULIB_SCANF=0;                AC_SUBST([GNULIB_SCANF])
-  GNULIB_SNPRINTF=0;             AC_SUBST([GNULIB_SNPRINTF])
-  GNULIB_SPRINTF_POSIX=0;        AC_SUBST([GNULIB_SPRINTF_POSIX])
-  GNULIB_STDIO_H_NONBLOCKING=0;  AC_SUBST([GNULIB_STDIO_H_NONBLOCKING])
-  GNULIB_STDIO_H_SIGPIPE=0;      AC_SUBST([GNULIB_STDIO_H_SIGPIPE])
-  GNULIB_TMPFILE=0;              AC_SUBST([GNULIB_TMPFILE])
-  GNULIB_VASPRINTF=0;            AC_SUBST([GNULIB_VASPRINTF])
-  GNULIB_VFSCANF=0;              AC_SUBST([GNULIB_VFSCANF])
-  GNULIB_VSCANF=0;               AC_SUBST([GNULIB_VSCANF])
-  GNULIB_VDPRINTF=0;             AC_SUBST([GNULIB_VDPRINTF])
-  GNULIB_VFPRINTF=0;             AC_SUBST([GNULIB_VFPRINTF])
-  GNULIB_VFPRINTF_POSIX=0;       AC_SUBST([GNULIB_VFPRINTF_POSIX])
-  GNULIB_VPRINTF=0;              AC_SUBST([GNULIB_VPRINTF])
-  GNULIB_VPRINTF_POSIX=0;        AC_SUBST([GNULIB_VPRINTF_POSIX])
-  GNULIB_VSNPRINTF=0;            AC_SUBST([GNULIB_VSNPRINTF])
-  GNULIB_VSPRINTF_POSIX=0;       AC_SUBST([GNULIB_VSPRINTF_POSIX])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_DECL_FCLOSEALL=1;         AC_SUBST([HAVE_DECL_FCLOSEALL])
   HAVE_DECL_FPURGE=1;            AC_SUBST([HAVE_DECL_FPURGE])
   HAVE_DECL_FSEEKO=1;            AC_SUBST([HAVE_DECL_FSEEKO])
   HAVE_DECL_FTELLO=1;            AC_SUBST([HAVE_DECL_FTELLO])
index 3999068..9c1d1c7 100644 (file)
@@ -1,10 +1,10 @@
-# stdlib_h.m4 serial 43
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# stdlib_h.m4 serial 63
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_STDLIB_H],
+AC_DEFUN_ONCE([gl_STDLIB_H],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
   gl_NEXT_HEADERS([stdlib.h])
@@ -14,74 +14,130 @@ AC_DEFUN([gl_STDLIB_H],
   dnl guaranteed by C89.
   gl_WARN_ON_USE_PREPARE([[#include <stdlib.h>
 #if HAVE_SYS_LOADAVG_H
+/* OpenIndiana has a bug: <sys/time.h> must be included before
+   <sys/loadavg.h>.  */
+# include <sys/time.h>
 # include <sys/loadavg.h>
 #endif
 #if HAVE_RANDOM_H
 # include <random.h>
 #endif
-    ]], [_Exit atoll canonicalize_file_name getloadavg getsubopt grantpt
-    initstate initstate_r mkdtemp mkostemp mkostemps mkstemp mkstemps
-    posix_openpt ptsname ptsname_r qsort_r random random_r realpath rpmatch
-    secure_getenv setenv setstate setstate_r srandom srandom_r
-    strtod strtoll strtoull unlockpt unsetenv])
+    ]], [_Exit aligned_alloc atoll canonicalize_file_name free
+    getloadavg getsubopt grantpt
+    initstate initstate_r mbtowc mkdtemp mkostemp mkostemps mkstemp mkstemps
+    posix_memalign posix_openpt ptsname ptsname_r qsort_r
+    random random_r reallocarray realpath rpmatch secure_getenv setenv
+    setstate setstate_r srandom srandom_r
+    strtod strtol strtold strtoll strtoul strtoull unlockpt unsetenv])
+
+  AC_REQUIRE([AC_C_RESTRICT])
+
+  AC_CHECK_DECLS_ONCE([ecvt])
+  if test $ac_cv_have_decl_ecvt = no; then
+    HAVE_DECL_ECVT=0
+  fi
+  AC_CHECK_DECLS_ONCE([fcvt])
+  if test $ac_cv_have_decl_fcvt = no; then
+    HAVE_DECL_FCVT=0
+  fi
+  AC_CHECK_DECLS_ONCE([gcvt])
+  if test $ac_cv_have_decl_gcvt = no; then
+    HAVE_DECL_GCVT=0
+  fi
 ])
 
+# gl_STDLIB_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_STDLIB_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_STDLIB_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STDLIB_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB__EXIT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ALIGNED_ALLOC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ATOLL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CALLOC_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CANONICALIZE_FILE_NAME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FREE_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOADAVG])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSUBOPT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GRANTPT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MALLOC_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBTOWC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDTEMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKOSTEMPS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKSTEMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKSTEMPS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_MEMALIGN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_POSIX_OPENPT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PTSNAME_R])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PUTENV])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_QSORT_R])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RANDOM_R])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOCARRAY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALLOC_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_REALPATH])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RPMATCH])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SECURE_GETENV])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETENV])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOD])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLD])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOLL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOUL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOULL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYSTEM_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLOCKPT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNSETENV])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOMB])
+    dnl Support Microsoft deprecated alias function names by default.
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ECVT], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_FCVT], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GCVT], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MKTEMP], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_PUTENV], [1])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_STDLIB_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_STDLIB_H_DEFAULTS],
 [
-  GNULIB__EXIT=0;         AC_SUBST([GNULIB__EXIT])
-  GNULIB_ATOLL=0;         AC_SUBST([GNULIB_ATOLL])
-  GNULIB_CALLOC_POSIX=0;  AC_SUBST([GNULIB_CALLOC_POSIX])
-  GNULIB_CANONICALIZE_FILE_NAME=0;  AC_SUBST([GNULIB_CANONICALIZE_FILE_NAME])
-  GNULIB_GETLOADAVG=0;    AC_SUBST([GNULIB_GETLOADAVG])
-  GNULIB_GETSUBOPT=0;     AC_SUBST([GNULIB_GETSUBOPT])
-  GNULIB_GRANTPT=0;       AC_SUBST([GNULIB_GRANTPT])
-  GNULIB_MALLOC_POSIX=0;  AC_SUBST([GNULIB_MALLOC_POSIX])
-  GNULIB_MBTOWC=0;        AC_SUBST([GNULIB_MBTOWC])
-  GNULIB_MKDTEMP=0;       AC_SUBST([GNULIB_MKDTEMP])
-  GNULIB_MKOSTEMP=0;      AC_SUBST([GNULIB_MKOSTEMP])
-  GNULIB_MKOSTEMPS=0;     AC_SUBST([GNULIB_MKOSTEMPS])
-  GNULIB_MKSTEMP=0;       AC_SUBST([GNULIB_MKSTEMP])
-  GNULIB_MKSTEMPS=0;      AC_SUBST([GNULIB_MKSTEMPS])
-  GNULIB_POSIX_OPENPT=0;  AC_SUBST([GNULIB_POSIX_OPENPT])
-  GNULIB_PTSNAME=0;       AC_SUBST([GNULIB_PTSNAME])
-  GNULIB_PTSNAME_R=0;     AC_SUBST([GNULIB_PTSNAME_R])
-  GNULIB_PUTENV=0;        AC_SUBST([GNULIB_PUTENV])
-  GNULIB_QSORT_R=0;       AC_SUBST([GNULIB_QSORT_R])
-  GNULIB_RANDOM=0;        AC_SUBST([GNULIB_RANDOM])
-  GNULIB_RANDOM_R=0;      AC_SUBST([GNULIB_RANDOM_R])
-  GNULIB_REALLOC_POSIX=0; AC_SUBST([GNULIB_REALLOC_POSIX])
-  GNULIB_REALPATH=0;      AC_SUBST([GNULIB_REALPATH])
-  GNULIB_RPMATCH=0;       AC_SUBST([GNULIB_RPMATCH])
-  GNULIB_SECURE_GETENV=0; AC_SUBST([GNULIB_SECURE_GETENV])
-  GNULIB_SETENV=0;        AC_SUBST([GNULIB_SETENV])
-  GNULIB_STRTOD=0;        AC_SUBST([GNULIB_STRTOD])
-  GNULIB_STRTOLL=0;       AC_SUBST([GNULIB_STRTOLL])
-  GNULIB_STRTOULL=0;      AC_SUBST([GNULIB_STRTOULL])
-  GNULIB_SYSTEM_POSIX=0;  AC_SUBST([GNULIB_SYSTEM_POSIX])
-  GNULIB_UNLOCKPT=0;      AC_SUBST([GNULIB_UNLOCKPT])
-  GNULIB_UNSETENV=0;      AC_SUBST([GNULIB_UNSETENV])
-  GNULIB_WCTOMB=0;        AC_SUBST([GNULIB_WCTOMB])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE__EXIT=1;              AC_SUBST([HAVE__EXIT])
+  HAVE_ALIGNED_ALLOC=1;      AC_SUBST([HAVE_ALIGNED_ALLOC])
   HAVE_ATOLL=1;              AC_SUBST([HAVE_ATOLL])
   HAVE_CANONICALIZE_FILE_NAME=1;  AC_SUBST([HAVE_CANONICALIZE_FILE_NAME])
+  HAVE_DECL_ECVT=1;          AC_SUBST([HAVE_DECL_ECVT])
+  HAVE_DECL_FCVT=1;          AC_SUBST([HAVE_DECL_FCVT])
+  HAVE_DECL_GCVT=1;          AC_SUBST([HAVE_DECL_GCVT])
   HAVE_DECL_GETLOADAVG=1;    AC_SUBST([HAVE_DECL_GETLOADAVG])
   HAVE_GETSUBOPT=1;          AC_SUBST([HAVE_GETSUBOPT])
   HAVE_GRANTPT=1;            AC_SUBST([HAVE_GRANTPT])
+  HAVE_INITSTATE=1;          AC_SUBST([HAVE_INITSTATE])
+  HAVE_DECL_INITSTATE=1;     AC_SUBST([HAVE_DECL_INITSTATE])
+  HAVE_MBTOWC=1;             AC_SUBST([HAVE_MBTOWC])
   HAVE_MKDTEMP=1;            AC_SUBST([HAVE_MKDTEMP])
   HAVE_MKOSTEMP=1;           AC_SUBST([HAVE_MKOSTEMP])
   HAVE_MKOSTEMPS=1;          AC_SUBST([HAVE_MKOSTEMPS])
   HAVE_MKSTEMP=1;            AC_SUBST([HAVE_MKSTEMP])
   HAVE_MKSTEMPS=1;           AC_SUBST([HAVE_MKSTEMPS])
+  HAVE_POSIX_MEMALIGN=1;     AC_SUBST([HAVE_POSIX_MEMALIGN])
   HAVE_POSIX_OPENPT=1;       AC_SUBST([HAVE_POSIX_OPENPT])
   HAVE_PTSNAME=1;            AC_SUBST([HAVE_PTSNAME])
   HAVE_PTSNAME_R=1;          AC_SUBST([HAVE_PTSNAME_R])
@@ -89,32 +145,50 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS],
   HAVE_RANDOM=1;             AC_SUBST([HAVE_RANDOM])
   HAVE_RANDOM_H=1;           AC_SUBST([HAVE_RANDOM_H])
   HAVE_RANDOM_R=1;           AC_SUBST([HAVE_RANDOM_R])
+  HAVE_REALLOCARRAY=1;       AC_SUBST([HAVE_REALLOCARRAY])
   HAVE_REALPATH=1;           AC_SUBST([HAVE_REALPATH])
   HAVE_RPMATCH=1;            AC_SUBST([HAVE_RPMATCH])
   HAVE_SECURE_GETENV=1;      AC_SUBST([HAVE_SECURE_GETENV])
   HAVE_SETENV=1;             AC_SUBST([HAVE_SETENV])
   HAVE_DECL_SETENV=1;        AC_SUBST([HAVE_DECL_SETENV])
+  HAVE_SETSTATE=1;           AC_SUBST([HAVE_SETSTATE])
+  HAVE_DECL_SETSTATE=1;      AC_SUBST([HAVE_DECL_SETSTATE])
   HAVE_STRTOD=1;             AC_SUBST([HAVE_STRTOD])
+  HAVE_STRTOL=1;             AC_SUBST([HAVE_STRTOL])
+  HAVE_STRTOLD=1;            AC_SUBST([HAVE_STRTOLD])
   HAVE_STRTOLL=1;            AC_SUBST([HAVE_STRTOLL])
+  HAVE_STRTOUL=1;            AC_SUBST([HAVE_STRTOUL])
   HAVE_STRTOULL=1;           AC_SUBST([HAVE_STRTOULL])
   HAVE_STRUCT_RANDOM_DATA=1; AC_SUBST([HAVE_STRUCT_RANDOM_DATA])
   HAVE_SYS_LOADAVG_H=0;      AC_SUBST([HAVE_SYS_LOADAVG_H])
   HAVE_UNLOCKPT=1;           AC_SUBST([HAVE_UNLOCKPT])
   HAVE_DECL_UNSETENV=1;      AC_SUBST([HAVE_DECL_UNSETENV])
+  REPLACE_ALIGNED_ALLOC=0;   AC_SUBST([REPLACE_ALIGNED_ALLOC])
   REPLACE_CALLOC=0;          AC_SUBST([REPLACE_CALLOC])
   REPLACE_CANONICALIZE_FILE_NAME=0;  AC_SUBST([REPLACE_CANONICALIZE_FILE_NAME])
+  REPLACE_FREE=0;            AC_SUBST([REPLACE_FREE])
+  REPLACE_INITSTATE=0;       AC_SUBST([REPLACE_INITSTATE])
   REPLACE_MALLOC=0;          AC_SUBST([REPLACE_MALLOC])
   REPLACE_MBTOWC=0;          AC_SUBST([REPLACE_MBTOWC])
   REPLACE_MKSTEMP=0;         AC_SUBST([REPLACE_MKSTEMP])
+  REPLACE_POSIX_MEMALIGN=0;  AC_SUBST([REPLACE_POSIX_MEMALIGN])
   REPLACE_PTSNAME=0;         AC_SUBST([REPLACE_PTSNAME])
   REPLACE_PTSNAME_R=0;       AC_SUBST([REPLACE_PTSNAME_R])
   REPLACE_PUTENV=0;          AC_SUBST([REPLACE_PUTENV])
   REPLACE_QSORT_R=0;         AC_SUBST([REPLACE_QSORT_R])
+  REPLACE_RANDOM=0;          AC_SUBST([REPLACE_RANDOM])
   REPLACE_RANDOM_R=0;        AC_SUBST([REPLACE_RANDOM_R])
   REPLACE_REALLOC=0;         AC_SUBST([REPLACE_REALLOC])
+  REPLACE_REALLOCARRAY=0;    AC_SUBST([REPLACE_REALLOCARRAY])
   REPLACE_REALPATH=0;        AC_SUBST([REPLACE_REALPATH])
   REPLACE_SETENV=0;          AC_SUBST([REPLACE_SETENV])
+  REPLACE_SETSTATE=0;        AC_SUBST([REPLACE_SETSTATE])
   REPLACE_STRTOD=0;          AC_SUBST([REPLACE_STRTOD])
+  REPLACE_STRTOL=0;          AC_SUBST([REPLACE_STRTOL])
+  REPLACE_STRTOLD=0;         AC_SUBST([REPLACE_STRTOLD])
+  REPLACE_STRTOLL=0;         AC_SUBST([REPLACE_STRTOLL])
+  REPLACE_STRTOUL=0;         AC_SUBST([REPLACE_STRTOUL])
+  REPLACE_STRTOULL=0;        AC_SUBST([REPLACE_STRTOULL])
   REPLACE_UNSETENV=0;        AC_SUBST([REPLACE_UNSETENV])
   REPLACE_WCTOMB=0;          AC_SUBST([REPLACE_WCTOMB])
 ])
diff --git a/m4/stpcpy.m4 b/m4/stpcpy.m4
new file mode 100644 (file)
index 0000000..eb44f03
--- /dev/null
@@ -0,0 +1,25 @@
+# stpcpy.m4 serial 9
+dnl Copyright (C) 2002, 2007, 2009-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STPCPY],
+[
+  dnl Persuade glibc <string.h> to declare stpcpy().
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  dnl The stpcpy() declaration in lib/string.in.h uses 'restrict'.
+  AC_REQUIRE([AC_C_RESTRICT])
+
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
+  AC_CHECK_FUNCS([stpcpy])
+  if test $ac_cv_func_stpcpy = no; then
+    HAVE_STPCPY=0
+  fi
+])
+
+# Prerequisites of lib/stpcpy.c.
+AC_DEFUN([gl_PREREQ_STPCPY], [
+  :
+])
index ac5c211..ada3d15 100644 (file)
@@ -1,5 +1,5 @@
-# strchrnul.m4 serial 9
-dnl Copyright (C) 2003, 2007, 2009-2016 Free Software Foundation, Inc.
+# strchrnul.m4 serial 10
+dnl Copyright (C) 2003, 2007, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_STRCHRNUL],
   dnl Persuade glibc <string.h> to declare strchrnul().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
   AC_CHECK_FUNCS([strchrnul])
   if test $ac_cv_func_strchrnul = no; then
     HAVE_STRCHRNUL=0
index ff7060a..5b6018f 100644 (file)
@@ -1,6 +1,6 @@
-# strdup.m4 serial 13
+# strdup.m4 serial 15
 
-dnl Copyright (C) 2002-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -8,8 +8,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_STRDUP],
 [
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  AC_CHECK_FUNCS_ONCE([strdup])
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
   AC_CHECK_DECLS_ONCE([strdup])
   if test $ac_cv_have_decl_strdup = no; then
     HAVE_DECL_STRDUP=0
@@ -18,13 +17,10 @@ AC_DEFUN([gl_FUNC_STRDUP],
 
 AC_DEFUN([gl_FUNC_STRDUP_POSIX],
 [
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
   AC_REQUIRE([gl_CHECK_MALLOC_POSIX])
-  AC_CHECK_FUNCS_ONCE([strdup])
-  if test $ac_cv_func_strdup = yes; then
-    if test $gl_cv_func_malloc_posix != yes; then
-      REPLACE_STRDUP=1
-    fi
+  if test $gl_cv_func_malloc_posix != yes; then
+    REPLACE_STRDUP=1
   fi
   AC_CHECK_DECLS_ONCE([strdup])
   if test $ac_cv_have_decl_strdup = no; then
index e286594..438ba92 100644 (file)
@@ -1,12 +1,12 @@
-# strerror.m4 serial 17
-dnl Copyright (C) 2002, 2007-2016 Free Software Foundation, Inc.
+# strerror.m4 serial 22
+dnl Copyright (C) 2002, 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_STRERROR],
 [
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
   AC_REQUIRE([gl_HEADER_ERRNO_H])
   AC_REQUIRE([gl_FUNC_STRERROR_0])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
@@ -24,10 +24,12 @@ AC_DEFUN([gl_FUNC_STRERROR],
         [gl_cv_func_working_strerror=yes],
         [gl_cv_func_working_strerror=no],
         [case "$host_os" in
-                   # Guess yes on glibc systems.
-           *-gnu*) gl_cv_func_working_strerror="guessing yes" ;;
-                   # If we don't know, assume the worst.
-           *)      gl_cv_func_working_strerror="guessing no" ;;
+                          # Guess yes on glibc systems.
+           *-gnu* | gnu*) gl_cv_func_working_strerror="guessing yes" ;;
+                          # Guess yes on musl systems.
+           *-musl*)       gl_cv_func_working_strerror="guessing yes" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+           *)             gl_cv_func_working_strerror="$gl_cross_guess_normal" ;;
          esac
         ])
     ])
@@ -78,10 +80,14 @@ AC_DEFUN([gl_FUNC_STRERROR_0],
       [gl_cv_func_strerror_0_works=yes],
       [gl_cv_func_strerror_0_works=no],
       [case "$host_os" in
-                 # Guess yes on glibc systems.
-         *-gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
-                 # If we don't know, assume the worst.
-         *)      gl_cv_func_strerror_0_works="guessing no" ;;
+                        # Guess yes on glibc systems.
+         *-gnu* | gnu*) gl_cv_func_strerror_0_works="guessing yes" ;;
+                        # Guess yes on musl systems.
+         *-musl*)       gl_cv_func_strerror_0_works="guessing yes" ;;
+                        # Guess yes on native Windows.
+         mingw*)        gl_cv_func_strerror_0_works="guessing yes" ;;
+                        # If we don't know, obey --enable-cross-guesses.
+         *)             gl_cv_func_strerror_0_works="$gl_cross_guess_normal" ;;
        esac
       ])
   ])
diff --git a/m4/strerror_r.m4 b/m4/strerror_r.m4
new file mode 100644 (file)
index 0000000..0689e46
--- /dev/null
@@ -0,0 +1,173 @@
+# strerror_r.m4 serial 21
+dnl Copyright (C) 2002, 2007-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_STRERROR_R],
+[
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
+  AC_REQUIRE([gl_FUNC_STRERROR_R_WORKS])
+
+  dnl Persuade Solaris <string.h> to declare strerror_r().
+  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
+
+  dnl Some systems don't declare strerror_r() if _THREAD_SAFE and _REENTRANT
+  dnl are not defined.
+  AC_CHECK_DECLS_ONCE([strerror_r])
+  if test $ac_cv_have_decl_strerror_r = no; then
+    HAVE_DECL_STRERROR_R=0
+  fi
+
+  if test $ac_cv_func_strerror_r = yes; then
+    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+      if test $gl_cv_func_strerror_r_posix_signature = yes; then
+        case "$gl_cv_func_strerror_r_works" in
+          dnl The system's strerror_r has bugs.  Replace it.
+          *no) REPLACE_STRERROR_R=1 ;;
+        esac
+      else
+        dnl The system's strerror_r() has a wrong signature. Replace it.
+        REPLACE_STRERROR_R=1
+      fi
+    else
+      dnl The system's strerror_r() cannot know about the new errno values we
+      dnl add to <errno.h>, or any fix for strerror(0). Replace it.
+      REPLACE_STRERROR_R=1
+    fi
+  fi
+])
+
+# Prerequisites of lib/strerror_r.c.
+AC_DEFUN([gl_PREREQ_STRERROR_R], [
+  dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r.
+  AC_CHECK_FUNCS_ONCE([__xpg_strerror_r])
+  AC_CHECK_FUNCS_ONCE([catgets])
+  AC_CHECK_FUNCS_ONCE([snprintf])
+])
+
+# Detect if strerror_r works, but without affecting whether a replacement
+# strerror_r will be used.
+AC_DEFUN([gl_FUNC_STRERROR_R_WORKS],
+[
+  AC_REQUIRE([gl_HEADER_ERRNO_H])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+  AC_REQUIRE([gl_FUNC_STRERROR_0])
+
+  AC_CHECK_FUNCS_ONCE([strerror_r])
+  if test $ac_cv_func_strerror_r = yes; then
+    if test "$ERRNO_H:$REPLACE_STRERROR_0" = :0; then
+      dnl The POSIX prototype is:  int strerror_r (int, char *, size_t);
+      dnl glibc, Cygwin:           char *strerror_r (int, char *, size_t);
+      dnl AIX 5.1, OSF/1 5.1:      int strerror_r (int, char *, int);
+      AC_CACHE_CHECK([for strerror_r with POSIX signature],
+        [gl_cv_func_strerror_r_posix_signature],
+        [AC_COMPILE_IFELSE(
+           [AC_LANG_PROGRAM(
+              [[#include <string.h>
+                int strerror_r (int, char *, size_t);
+              ]],
+              [])],
+           [gl_cv_func_strerror_r_posix_signature=yes],
+           [gl_cv_func_strerror_r_posix_signature=no])
+        ])
+      if test $gl_cv_func_strerror_r_posix_signature = yes; then
+        dnl AIX 6.1 strerror_r fails by returning -1, not an error number.
+        dnl HP-UX 11.31 strerror_r always fails when the buffer length argument
+        dnl is less than 80.
+        dnl FreeBSD 8.s strerror_r claims failure on 0
+        dnl Mac OS X 10.5 strerror_r treats 0 like -1
+        dnl Solaris 10 strerror_r corrupts errno on failure
+        AC_CACHE_CHECK([whether strerror_r works],
+          [gl_cv_func_strerror_r_works],
+          [AC_RUN_IFELSE(
+             [AC_LANG_PROGRAM(
+                [[#include <errno.h>
+                  #include <string.h>
+                ]],
+                [[int result = 0;
+                  char buf[79];
+                  if (strerror_r (EACCES, buf, 0) < 0)
+                    result |= 1;
+                  errno = 0;
+                  if (strerror_r (EACCES, buf, sizeof buf) != 0)
+                    result |= 2;
+                  strcpy (buf, "Unknown");
+                  if (strerror_r (0, buf, sizeof buf) != 0)
+                    result |= 4;
+                  if (errno)
+                    result |= 8;
+                  if (strstr (buf, "nknown") || strstr (buf, "ndefined"))
+                    result |= 0x10;
+                  errno = 0;
+                  *buf = 0;
+                  if (strerror_r (-3, buf, sizeof buf) < 0)
+                    result |= 0x20;
+                  if (errno)
+                    result |= 0x40;
+                  if (!*buf)
+                    result |= 0x80;
+                  return result;
+                ]])],
+             [gl_cv_func_strerror_r_works=yes],
+             [gl_cv_func_strerror_r_works=no],
+             [
+changequote(,)dnl
+              case "$host_os" in
+                       # Guess no on AIX.
+                aix*)  gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess no on HP-UX.
+                hpux*) gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess no on BSD variants.
+                *bsd*)  gl_cv_func_strerror_r_works="guessing no";;
+                       # Guess yes otherwise.
+                *)     gl_cv_func_strerror_r_works="guessing yes";;
+              esac
+changequote([,])dnl
+             ])
+          ])
+      else
+        dnl The system's strerror() has a wrong signature.
+        dnl glibc >= 2.3.4 and cygwin 1.7.9 have a function __xpg_strerror_r.
+        AC_CHECK_FUNCS_ONCE([__xpg_strerror_r])
+        dnl In glibc < 2.14, __xpg_strerror_r does not populate buf on failure.
+        dnl In cygwin < 1.7.10, __xpg_strerror_r clobbers strerror's buffer.
+        if test $ac_cv_func___xpg_strerror_r = yes; then
+          AC_CACHE_CHECK([whether __xpg_strerror_r works],
+            [gl_cv_func_strerror_r_works],
+            [AC_RUN_IFELSE(
+               [AC_LANG_PROGRAM(
+                  [[#include <errno.h>
+                    #include <string.h>
+                    extern
+                    #ifdef __cplusplus
+                    "C"
+                    #endif
+                    int __xpg_strerror_r(int, char *, size_t);
+                  ]],
+                  [[int result = 0;
+                    char buf[256] = "^";
+                    char copy[256];
+                    char *str = strerror (-1);
+                    strcpy (copy, str);
+                    if (__xpg_strerror_r (-2, buf, 1) == 0)
+                      result |= 1;
+                    if (*buf)
+                      result |= 2;
+                    __xpg_strerror_r (-2, buf, 256);
+                    if (strcmp (str, copy))
+                      result |= 4;
+                    return result;
+                  ]])],
+               [gl_cv_func_strerror_r_works=yes],
+               [gl_cv_func_strerror_r_works=no],
+               [dnl Guess no on all platforms that have __xpg_strerror_r,
+                dnl at least until fixed glibc and cygwin are more common.
+                gl_cv_func_strerror_r_works="$gl_cross_guess_normal"
+               ])
+            ])
+        fi
+      fi
+    fi
+  fi
+])
index 0c5ec6f..80d1e58 100644 (file)
@@ -1,25 +1,19 @@
 # Configure a GNU-like replacement for <string.h>.
 
-# Copyright (C) 2007-2016 Free Software Foundation, Inc.
+# Copyright (C) 2007-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
-# serial 21
+# serial 32
 
 # Written by Paul Eggert.
 
-AC_DEFUN([gl_HEADER_STRING_H],
+AC_DEFUN_ONCE([gl_STRING_H],
 [
-  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
-  dnl once only, before all statements that occur in other macros.
-  AC_REQUIRE([gl_HEADER_STRING_H_BODY])
-])
-
-AC_DEFUN([gl_HEADER_STRING_H_BODY],
-[
-  AC_REQUIRE([AC_C_RESTRICT])
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
   gl_NEXT_HEADERS([string.h])
 
   dnl Check for declarations of anything we want to poison if the
@@ -29,62 +23,86 @@ AC_DEFUN([gl_HEADER_STRING_H_BODY],
     ]],
     [ffsl ffsll memmem mempcpy memrchr rawmemchr stpcpy stpncpy strchrnul
      strdup strncat strndup strnlen strpbrk strsep strcasestr strtok_r
-     strerror_r strsignal strverscmp])
+     strerror_r strerrorname_np sigabbrev_np sigdescr_np strsignal strverscmp])
+
+  AC_REQUIRE([AC_C_RESTRICT])
 ])
 
+# gl_STRING_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_STRING_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_STRING_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
-AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_STRING_H_REQUIRE_DEFAULTS],
 [
-  GNULIB_FFSL=0;        AC_SUBST([GNULIB_FFSL])
-  GNULIB_FFSLL=0;       AC_SUBST([GNULIB_FFSLL])
-  GNULIB_MEMCHR=0;      AC_SUBST([GNULIB_MEMCHR])
-  GNULIB_MEMMEM=0;      AC_SUBST([GNULIB_MEMMEM])
-  GNULIB_MEMPCPY=0;     AC_SUBST([GNULIB_MEMPCPY])
-  GNULIB_MEMRCHR=0;     AC_SUBST([GNULIB_MEMRCHR])
-  GNULIB_RAWMEMCHR=0;   AC_SUBST([GNULIB_RAWMEMCHR])
-  GNULIB_STPCPY=0;      AC_SUBST([GNULIB_STPCPY])
-  GNULIB_STPNCPY=0;     AC_SUBST([GNULIB_STPNCPY])
-  GNULIB_STRCHRNUL=0;   AC_SUBST([GNULIB_STRCHRNUL])
-  GNULIB_STRDUP=0;      AC_SUBST([GNULIB_STRDUP])
-  GNULIB_STRNCAT=0;     AC_SUBST([GNULIB_STRNCAT])
-  GNULIB_STRNDUP=0;     AC_SUBST([GNULIB_STRNDUP])
-  GNULIB_STRNLEN=0;     AC_SUBST([GNULIB_STRNLEN])
-  GNULIB_STRPBRK=0;     AC_SUBST([GNULIB_STRPBRK])
-  GNULIB_STRSEP=0;      AC_SUBST([GNULIB_STRSEP])
-  GNULIB_STRSTR=0;      AC_SUBST([GNULIB_STRSTR])
-  GNULIB_STRCASESTR=0;  AC_SUBST([GNULIB_STRCASESTR])
-  GNULIB_STRTOK_R=0;    AC_SUBST([GNULIB_STRTOK_R])
-  GNULIB_MBSLEN=0;      AC_SUBST([GNULIB_MBSLEN])
-  GNULIB_MBSNLEN=0;     AC_SUBST([GNULIB_MBSNLEN])
-  GNULIB_MBSCHR=0;      AC_SUBST([GNULIB_MBSCHR])
-  GNULIB_MBSRCHR=0;     AC_SUBST([GNULIB_MBSRCHR])
-  GNULIB_MBSSTR=0;      AC_SUBST([GNULIB_MBSSTR])
-  GNULIB_MBSCASECMP=0;  AC_SUBST([GNULIB_MBSCASECMP])
-  GNULIB_MBSNCASECMP=0; AC_SUBST([GNULIB_MBSNCASECMP])
-  GNULIB_MBSPCASECMP=0; AC_SUBST([GNULIB_MBSPCASECMP])
-  GNULIB_MBSCASESTR=0;  AC_SUBST([GNULIB_MBSCASESTR])
-  GNULIB_MBSCSPN=0;     AC_SUBST([GNULIB_MBSCSPN])
-  GNULIB_MBSPBRK=0;     AC_SUBST([GNULIB_MBSPBRK])
-  GNULIB_MBSSPN=0;      AC_SUBST([GNULIB_MBSSPN])
-  GNULIB_MBSSEP=0;      AC_SUBST([GNULIB_MBSSEP])
-  GNULIB_MBSTOK_R=0;    AC_SUBST([GNULIB_MBSTOK_R])
-  GNULIB_STRERROR=0;    AC_SUBST([GNULIB_STRERROR])
-  GNULIB_STRERROR_R=0;  AC_SUBST([GNULIB_STRERROR_R])
-  GNULIB_STRSIGNAL=0;   AC_SUBST([GNULIB_STRSIGNAL])
-  GNULIB_STRVERSCMP=0;  AC_SUBST([GNULIB_STRVERSCMP])
-  HAVE_MBSLEN=0;        AC_SUBST([HAVE_MBSLEN])
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXPLICIT_BZERO])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FFSLL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMCHR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMMEM])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMPCPY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MEMRCHR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RAWMEMCHR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPCPY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STPNCPY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCHRNUL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRDUP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNCAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNDUP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRNLEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPBRK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSEP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSTR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRCASESTR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRTOK_R])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSLEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNLEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCHR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRCHR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSTR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASECMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNCASECMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPCASECMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCASESTR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSCSPN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSPBRK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSPN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSSEP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSTOK_R])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERROR_R])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRERRORNAME_NP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGABBREV_NP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SIGDESCR_NP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRSIGNAL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRVERSCMP])
+    dnl Support Microsoft deprecated alias function names by default.
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MEMCCPY], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_STRDUP], [1])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_STRING_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_STRING_H_DEFAULTS],
+[
+  HAVE_MBSLEN=0;             AC_SUBST([HAVE_MBSLEN])
   dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_EXPLICIT_BZERO=1;        AC_SUBST([HAVE_EXPLICIT_BZERO])
   HAVE_FFSL=1;                  AC_SUBST([HAVE_FFSL])
   HAVE_FFSLL=1;                 AC_SUBST([HAVE_FFSLL])
-  HAVE_MEMCHR=1;                AC_SUBST([HAVE_MEMCHR])
   HAVE_DECL_MEMMEM=1;           AC_SUBST([HAVE_DECL_MEMMEM])
   HAVE_MEMPCPY=1;               AC_SUBST([HAVE_MEMPCPY])
   HAVE_DECL_MEMRCHR=1;          AC_SUBST([HAVE_DECL_MEMRCHR])
@@ -100,21 +118,26 @@ AC_DEFUN([gl_HEADER_STRING_H_DEFAULTS],
   HAVE_STRCASESTR=1;            AC_SUBST([HAVE_STRCASESTR])
   HAVE_DECL_STRTOK_R=1;         AC_SUBST([HAVE_DECL_STRTOK_R])
   HAVE_DECL_STRERROR_R=1;       AC_SUBST([HAVE_DECL_STRERROR_R])
+  HAVE_STRERRORNAME_NP=1;       AC_SUBST([HAVE_STRERRORNAME_NP])
+  HAVE_SIGABBREV_NP=1;          AC_SUBST([HAVE_SIGABBREV_NP])
+  HAVE_SIGDESCR_NP=1;           AC_SUBST([HAVE_SIGDESCR_NP])
   HAVE_DECL_STRSIGNAL=1;        AC_SUBST([HAVE_DECL_STRSIGNAL])
   HAVE_STRVERSCMP=1;            AC_SUBST([HAVE_STRVERSCMP])
+  REPLACE_FFSLL=0;              AC_SUBST([REPLACE_FFSLL])
   REPLACE_MEMCHR=0;             AC_SUBST([REPLACE_MEMCHR])
   REPLACE_MEMMEM=0;             AC_SUBST([REPLACE_MEMMEM])
   REPLACE_STPNCPY=0;            AC_SUBST([REPLACE_STPNCPY])
+  REPLACE_STRCHRNUL=0;          AC_SUBST([REPLACE_STRCHRNUL])
   REPLACE_STRDUP=0;             AC_SUBST([REPLACE_STRDUP])
+  REPLACE_STRNCAT=0;            AC_SUBST([REPLACE_STRNCAT])
+  REPLACE_STRNDUP=0;            AC_SUBST([REPLACE_STRNDUP])
+  REPLACE_STRNLEN=0;            AC_SUBST([REPLACE_STRNLEN])
   REPLACE_STRSTR=0;             AC_SUBST([REPLACE_STRSTR])
   REPLACE_STRCASESTR=0;         AC_SUBST([REPLACE_STRCASESTR])
-  REPLACE_STRCHRNUL=0;          AC_SUBST([REPLACE_STRCHRNUL])
+  REPLACE_STRTOK_R=0;           AC_SUBST([REPLACE_STRTOK_R])
   REPLACE_STRERROR=0;           AC_SUBST([REPLACE_STRERROR])
   REPLACE_STRERROR_R=0;         AC_SUBST([REPLACE_STRERROR_R])
-  REPLACE_STRNCAT=0;            AC_SUBST([REPLACE_STRNCAT])
-  REPLACE_STRNDUP=0;            AC_SUBST([REPLACE_STRNDUP])
-  REPLACE_STRNLEN=0;            AC_SUBST([REPLACE_STRNLEN])
+  REPLACE_STRERRORNAME_NP=0;    AC_SUBST([REPLACE_STRERRORNAME_NP])
   REPLACE_STRSIGNAL=0;          AC_SUBST([REPLACE_STRSIGNAL])
-  REPLACE_STRTOK_R=0;           AC_SUBST([REPLACE_STRTOK_R])
   UNDEFINE_STRTOK_R=0;          AC_SUBST([UNDEFINE_STRTOK_R])
 ])
index ac48a22..4c9ff6e 100644 (file)
@@ -1,5 +1,5 @@
-# strndup.m4 serial 22
-dnl Copyright (C) 2002-2003, 2005-2016 Free Software Foundation, Inc.
+# strndup.m4 serial 23
+dnl Copyright (C) 2002-2003, 2005-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -10,7 +10,7 @@ AC_DEFUN([gl_FUNC_STRNDUP],
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
   AC_CHECK_DECLS_ONCE([strndup])
   AC_CHECK_FUNCS_ONCE([strndup])
   if test $ac_cv_have_decl_strndup = no; then
index 67b3859..1d4f106 100644 (file)
@@ -1,5 +1,5 @@
-# strnlen.m4 serial 13
-dnl Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation,
+# strnlen.m4 serial 14
+dnl Copyright (C) 2002-2003, 2005-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_FUNC_STRNLEN],
 [
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
 
   dnl Persuade glibc <string.h> to declare strnlen().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
index 362fc85..5cd9f05 100644 (file)
@@ -1,5 +1,5 @@
-# strsignal.m4 serial 8
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# strsignal.m4 serial 10
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,7 +9,7 @@ AC_DEFUN([gl_FUNC_STRSIGNAL],
   dnl Persuade glibc <string.h> to declare strsignal().
   AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
 
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
 
   AC_CHECK_DECLS_ONCE([strsignal])
@@ -54,6 +54,6 @@ AC_DEFUN([gl_FUNC_STRSIGNAL],
 # Prerequisites of lib/strsignal.c.
 AC_DEFUN([gl_PREREQ_STRSIGNAL], [
   AC_CHECK_HEADERS_ONCE([unistd.h])
-  AC_REQUIRE([AC_DECL_SYS_SIGLIST])
+  AC_CHECK_DECLS([sys_siglist], [], [], [[#include <signal.h>]])
   AC_CHECK_DECLS([_sys_siglist], [], [], [[#include <signal.h>]])
 ])
index bfe4c85..9604fe2 100644 (file)
@@ -1,5 +1,5 @@
-# strstr.m4 serial 17
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# strstr.m4 serial 23
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,30 +7,39 @@ dnl with or without modifications, as long as this notice is preserved.
 dnl Check that strstr works.
 AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
 [
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
+  AC_REQUIRE([gl_STRING_H_DEFAULTS])
   AC_REQUIRE([gl_FUNC_MEMCHR])
-  if test "$gl_cv_func_memchr_works" != yes; then
+  if test $REPLACE_MEMCHR = 1; then
     REPLACE_STRSTR=1
   else
-    dnl Detect http://sourceware.org/bugzilla/show_bug.cgi?id=12092.
+    dnl Detect https://sourceware.org/bugzilla/show_bug.cgi?id=12092
+    dnl and https://sourceware.org/bugzilla/show_bug.cgi?id=23637.
     AC_CACHE_CHECK([whether strstr works],
       [gl_cv_func_strstr_works_always],
-      [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+      [AC_RUN_IFELSE(
+         [AC_LANG_PROGRAM([[
 #include <string.h> /* for strstr */
+#ifdef __GNU_LIBRARY__
+ #include <features.h>
+ #if __GLIBC__ == 2 && __GLIBC_MINOR__ == 28
+  Unlucky user
+ #endif
+#endif
 #define P "_EF_BF_BD"
 #define HAYSTACK "F_BD_CE_BD" P P P P "_C3_88_20" P P P "_C3_A7_20" P
 #define NEEDLE P P P P P
-]], [[return !!strstr (HAYSTACK, NEEDLE);
-    ]])],
-        [gl_cv_func_strstr_works_always=yes],
-        [gl_cv_func_strstr_works_always=no],
-        [dnl glibc 2.12 and cygwin 1.7.7 have a known bug.  uClibc is not
-         dnl affected, since it uses different source code for strstr than
-         dnl glibc.
-         dnl Assume that it works on all other platforms, even if it is not
-         dnl linear.
-         AC_EGREP_CPP([Lucky user],
-           [
+]],
+            [[return !!strstr (HAYSTACK, NEEDLE);
+            ]])],
+         [gl_cv_func_strstr_works_always=yes],
+         [gl_cv_func_strstr_works_always=no],
+         [dnl glibc 2.12 and cygwin 1.7.7 have a known bug.  uClibc is not
+          dnl affected, since it uses different source code for strstr than
+          dnl glibc.
+          dnl Assume that it works on all other platforms, even if it is not
+          dnl linear.
+          AC_EGREP_CPP([Lucky user],
+            [
 #ifdef __GNU_LIBRARY__
  #include <features.h>
  #if ((__GLIBC__ == 2 && __GLIBC_MINOR__ > 12) || (__GLIBC__ > 2)) \
@@ -45,10 +54,10 @@ AC_DEFUN([gl_FUNC_STRSTR_SIMPLE],
 #else
   Lucky user
 #endif
-           ],
-           [gl_cv_func_strstr_works_always="guessing yes"],
-           [gl_cv_func_strstr_works_always="guessing no"])
-        ])
+            ],
+            [gl_cv_func_strstr_works_always="guessing yes"],
+            [gl_cv_func_strstr_works_always="$gl_cross_guess_normal"])
+         ])
       ])
     case "$gl_cv_func_strstr_works_always" in
       *yes) ;;
@@ -99,6 +108,9 @@ static void quit (int sig) { _exit (sig + 128); }
         if (!strstr (haystack, needle))
           result |= 1;
       }
+    /* Free allocated memory, in case some sanitizer is watching.  */
+    free (haystack);
+    free (needle);
     return result;
     ]])],
         [gl_cv_func_strstr_linear=yes], [gl_cv_func_strstr_linear=no],
@@ -123,7 +135,7 @@ static void quit (int sig) { _exit (sig + 128); }
 #endif
            ],
            [gl_cv_func_strstr_linear="guessing yes"],
-           [gl_cv_func_strstr_linear="guessing no"])
+           [gl_cv_func_strstr_linear="$gl_cross_guess_normal"])
         ])
       ])
     case "$gl_cv_func_strstr_linear" in
index 33f4110..6edad33 100644 (file)
@@ -1,5 +1,5 @@
-# strtod.m4 serial 22
-dnl Copyright (C) 2002-2003, 2006-2016 Free Software Foundation, Inc.
+# strtod.m4 serial 26
+dnl Copyright (C) 2002-2003, 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_STRTOD],
 [
   AC_REQUIRE([gl_STDLIB_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
   m4_ifdef([gl_FUNC_STRTOD_OBSOLETE], [
     dnl Test whether strtod is declared.
     dnl Don't call AC_FUNC_STRTOD, because it does not have the right guess
@@ -113,7 +114,16 @@ numeric_equal (double x, double y)
 #endif
            ],
            [gl_cv_func_strtod_works="guessing yes"],
-           [gl_cv_func_strtod_works="guessing no"])])])
+           [case "$host_os" in
+                       # Guess yes on musl systems.
+              *-musl*) gl_cv_func_strtod_works="guessing yes" ;;
+                       # Guess yes on native Windows.
+              mingw*)  gl_cv_func_strtod_works="guessing yes" ;;
+              *)       gl_cv_func_strtod_works="$gl_cross_guess_normal" ;;
+            esac
+           ])
+        ])
+      ])
     case "$gl_cv_func_strtod_works" in
       *yes) ;;
       *)
@@ -130,4 +140,5 @@ AC_DEFUN([gl_PREREQ_STRTOD], [
     AC_DEFINE([HAVE_LDEXP_IN_LIBC], [1],
       [Define if the ldexp function is available in libc.])
   fi
+  AC_CHECK_FUNCS([nl_langinfo])
 ])
index d15d915..209dece 100644 (file)
@@ -1,7 +1,7 @@
-# serial 6
+# serial 9
 # See if we need to provide symlink replacement.
 
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -36,10 +36,12 @@ AC_DEFUN([gl_FUNC_SYMLINK],
            ]])],
          [gl_cv_func_symlink_works=yes], [gl_cv_func_symlink_works=no],
          [case "$host_os" in
-                    # Guess yes on glibc systems.
-            *-gnu*) gl_cv_func_symlink_works="guessing yes" ;;
-                    # If we don't know, assume the worst.
-            *)      gl_cv_func_symlink_works="guessing no" ;;
+                             # Guess yes on Linux systems.
+            linux-* | linux) gl_cv_func_symlink_works="guessing yes" ;;
+                             # Guess yes on glibc systems.
+            *-gnu* | gnu*)   gl_cv_func_symlink_works="guessing yes" ;;
+                             # If we don't know, obey --enable-cross-guesses.
+            *)               gl_cv_func_symlink_works="$gl_cross_guess_normal" ;;
           esac
          ])
       rm -f conftest.f conftest.link conftest.lnk2])
diff --git a/m4/sys_ioctl_h.m4 b/m4/sys_ioctl_h.m4
new file mode 100644 (file)
index 0000000..cd00410
--- /dev/null
@@ -0,0 +1,79 @@
+# sys_ioctl_h.m4 serial 15
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl Written by Bruno Haible.
+
+AC_DEFUN_ONCE([gl_SYS_IOCTL_H],
+[
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
+  AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
+
+  AC_CHECK_HEADERS_ONCE([sys/ioctl.h])
+  if test $ac_cv_header_sys_ioctl_h = yes; then
+    HAVE_SYS_IOCTL_H=1
+    dnl Test whether <sys/ioctl.h> declares ioctl(), or whether some other
+    dnl header file, such as <unistd.h> or <stropts.h>, is needed for that.
+    AC_CACHE_CHECK([whether <sys/ioctl.h> declares ioctl],
+      [gl_cv_decl_ioctl_in_sys_ioctl_h],
+      [dnl We cannot use AC_CHECK_DECL because it produces its own messages.
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[#include <sys/ioctl.h>]],
+            [[(void) ioctl;]])],
+         [gl_cv_decl_ioctl_in_sys_ioctl_h=yes],
+         [gl_cv_decl_ioctl_in_sys_ioctl_h=no])
+      ])
+  else
+    HAVE_SYS_IOCTL_H=0
+  fi
+  AC_SUBST([HAVE_SYS_IOCTL_H])
+  dnl <sys/ioctl.h> is always overridden, because of GNULIB_POSIXCHECK.
+  gl_CHECK_NEXT_HEADERS([sys/ioctl.h])
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[#include <sys/ioctl.h>
+/* Some platforms declare ioctl in the wrong header.  */
+#if !(defined __GLIBC__ && !defined __UCLIBC__)
+# include <unistd.h>
+#endif
+    ]], [ioctl])
+])
+
+# gl_SYS_IOCTL_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_IOCTL_MODULE_INDICATOR],
+[
+  dnl Ensure to expand the default settings once only.
+  gl_SYS_IOCTL_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_IOCTL_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_IOCTL_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_IOCTL])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_IOCTL_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SYS_IOCTL_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_IOCTL_H_DEFAULTS],
+[
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  SYS_IOCTL_H_HAVE_WINSOCK2_H=0; AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H])
+  SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
+                        AC_SUBST([SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
+  REPLACE_IOCTL=0;      AC_SUBST([REPLACE_IOCTL])
+])
diff --git a/m4/sys_random_h.m4 b/m4/sys_random_h.m4
new file mode 100644 (file)
index 0000000..37bc316
--- /dev/null
@@ -0,0 +1,68 @@
+# sys_random_h.m4 serial 8
+dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SYS_RANDOM_H],
+[
+  AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+  dnl <sys/random.h> is always overridden, because of GNULIB_POSIXCHECK.
+  gl_CHECK_NEXT_HEADERS([sys/random.h])
+  if test $ac_cv_header_sys_random_h = yes; then
+    HAVE_SYS_RANDOM_H=1
+  else
+    HAVE_SYS_RANDOM_H=0
+  fi
+  AC_SUBST([HAVE_SYS_RANDOM_H])
+
+  m4_ifdef([gl_UNISTD_H_DEFAULTS], [AC_REQUIRE([gl_UNISTD_H_DEFAULTS])])
+  if test $ac_cv_header_sys_random_h = yes; then
+    UNISTD_H_HAVE_SYS_RANDOM_H=1
+  fi
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+#if HAVE_SYS_RANDOM_H
+/* Additional includes are needed before <sys/random.h> on uClibc
+   and Mac OS X.  */
+# include <sys/types.h>
+# include <stdlib.h>
+# include <sys/random.h>
+#endif
+    ]],
+    [getrandom])
+])
+
+# gl_SYS_RANDOM_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_RANDOM_MODULE_INDICATOR],
+[
+  dnl Ensure to expand the default settings once only.
+  gl_SYS_RANDOM_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_RANDOM_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_RANDOM_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETRANDOM])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_RANDOM_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SYS_RANDOM_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_RANDOM_H_DEFAULTS],
+[
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_GETRANDOM=1;       AC_SUBST([HAVE_GETRANDOM])
+  REPLACE_GETRANDOM=0;    AC_SUBST([REPLACE_GETRANDOM])
+])
diff --git a/m4/sys_select_h.m4 b/m4/sys_select_h.m4
new file mode 100644 (file)
index 0000000..2e7d140
--- /dev/null
@@ -0,0 +1,110 @@
+# sys_select_h.m4 serial 23
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SYS_SELECT_H],
+[
+  AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS])
+  AC_REQUIRE([AC_C_RESTRICT])
+  AC_CACHE_CHECK([whether <sys/select.h> is self-contained],
+    [gl_cv_header_sys_select_h_selfcontained],
+    [
+      dnl Test against two bugs:
+      dnl 1. On many platforms, <sys/select.h> assumes prior inclusion of
+      dnl    <sys/types.h>.
+      dnl 2. On OSF/1 4.0, <sys/select.h> provides only a forward declaration
+      dnl    of 'struct timeval', and no definition of this type.
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/select.h>]],
+                                         [[struct timeval b;]])],
+        [gl_cv_header_sys_select_h_selfcontained=yes],
+        [gl_cv_header_sys_select_h_selfcontained=no])
+      dnl Test against another bug:
+      dnl 3. On Solaris 10, <sys/select.h> provides an FD_ZERO implementation
+      dnl    that relies on memset(), but without including <string.h>.
+      if test $gl_cv_header_sys_select_h_selfcontained = yes; then
+        AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM([[#include <sys/select.h>]],
+                           [[int memset; int bzero;]])
+          ],
+          [AC_LINK_IFELSE(
+             [AC_LANG_PROGRAM([[#include <sys/select.h>]], [[
+                  #undef memset
+                  #define memset nonexistent_memset
+                  extern
+                  #ifdef __cplusplus
+                  "C"
+                  #endif
+                  void *memset (void *, int, unsigned long);
+                  #undef bzero
+                  #define bzero nonexistent_bzero
+                  extern
+                  #ifdef __cplusplus
+                  "C"
+                  #endif
+                  void bzero (void *, unsigned long);
+                  fd_set fds;
+                  FD_ZERO (&fds);
+                ]])
+             ],
+             [],
+             [gl_cv_header_sys_select_h_selfcontained=no])
+          ])
+      fi
+    ])
+  dnl <sys/select.h> is always overridden, because of GNULIB_POSIXCHECK.
+  gl_CHECK_NEXT_HEADERS([sys/select.h])
+  if test $ac_cv_header_sys_select_h = yes; then
+    HAVE_SYS_SELECT_H=1
+  else
+    HAVE_SYS_SELECT_H=0
+  fi
+  AC_SUBST([HAVE_SYS_SELECT_H])
+  gl_PREREQ_SYS_H_WINSOCK2
+
+  dnl Check for declarations of anything we want to poison if the
+  dnl corresponding gnulib module is not in use.
+  gl_WARN_ON_USE_PREPARE([[
+/* Some systems require prerequisite headers.  */
+#include <sys/types.h>
+#if !(defined __GLIBC__ && !defined __UCLIBC__) && HAVE_SYS_TIME_H
+# include <sys/time.h>
+#endif
+#include <sys/select.h>
+    ]], [pselect select])
+])
+
+# gl_SYS_SELECT_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_SELECT_MODULE_INDICATOR],
+[
+  dnl Ensure to expand the default settings once only.
+  gl_SYS_SELECT_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_SELECT_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_SELECT_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PSELECT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SELECT])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_SELECT_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SYS_SELECT_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_SELECT_H_DEFAULTS],
+[
+  dnl Assume proper GNU behavior unless another module says otherwise.
+  HAVE_PSELECT=1; AC_SUBST([HAVE_PSELECT])
+  REPLACE_PSELECT=0; AC_SUBST([REPLACE_PSELECT])
+  REPLACE_SELECT=0; AC_SUBST([REPLACE_SELECT])
+])
index ae500c7..5676a0d 100644 (file)
@@ -1,12 +1,12 @@
-# sys_socket_h.m4 serial 23
-dnl Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# sys_socket_h.m4 serial 28
+dnl Copyright (C) 2005-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Simon Josefsson.
 
-AC_DEFUN([gl_HEADER_SYS_SOCKET],
+AC_DEFUN_ONCE([gl_SYS_SOCKET_H],
 [
   AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
   AC_REQUIRE([AC_CANONICAL_HOST])
@@ -95,6 +95,8 @@ AC_DEFUN([gl_HEADER_SYS_SOCKET],
 #include <sys/socket.h>
     ]], [socket connect accept bind getpeername getsockname getsockopt
     listen recv send recvfrom sendto setsockopt shutdown accept4])
+
+  AC_REQUIRE([AC_C_RESTRICT])
 ])
 
 AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
@@ -104,17 +106,11 @@ AC_DEFUN([gl_PREREQ_SYS_H_SOCKET],
   gl_CHECK_NEXT_HEADERS([sys/socket.h])
   if test $ac_cv_header_sys_socket_h = yes; then
     HAVE_SYS_SOCKET_H=1
-    HAVE_WS2TCPIP_H=0
   else
     HAVE_SYS_SOCKET_H=0
-    if test $ac_cv_header_ws2tcpip_h = yes; then
-      HAVE_WS2TCPIP_H=1
-    else
-      HAVE_WS2TCPIP_H=0
-    fi
   fi
   AC_SUBST([HAVE_SYS_SOCKET_H])
-  AC_SUBST([HAVE_WS2TCPIP_H])
+  gl_PREREQ_SYS_H_WS2TCPIP
 ])
 
 # Common prerequisites of the <sys/socket.h> replacement and of the
@@ -142,32 +138,65 @@ AC_DEFUN([gl_PREREQ_SYS_H_WINSOCK2],
   AC_SUBST([HAVE_WINSOCK2_H])
 ])
 
+# Common prerequisites of the <sys/socket.h> replacement and of the
+# <arpa/inet.h> replacement.
+# Sets and substitutes HAVE_WS2TCPIP_H.
+AC_DEFUN([gl_PREREQ_SYS_H_WS2TCPIP],
+[
+  AC_REQUIRE([gl_CHECK_SOCKET_HEADERS])
+  if test $ac_cv_header_sys_socket_h = yes; then
+    HAVE_WS2TCPIP_H=0
+  else
+    if test $ac_cv_header_ws2tcpip_h = yes; then
+      HAVE_WS2TCPIP_H=1
+    else
+      HAVE_WS2TCPIP_H=0
+    fi
+  fi
+  AC_SUBST([HAVE_WS2TCPIP_H])
+])
+
+# gl_SYS_SOCKET_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_SYS_SOCKET_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_SYS_SOCKET_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_SOCKET_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SOCKET])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CONNECT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCEPT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BIND])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPEERNAME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSOCKNAME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETSOCKOPT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LISTEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RECV])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SEND])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RECVFROM])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SENDTO])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETSOCKOPT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SHUTDOWN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCEPT4])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_SOCKET_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SYS_SOCKET_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_SYS_SOCKET_H_DEFAULTS],
 [
-  GNULIB_SOCKET=0;      AC_SUBST([GNULIB_SOCKET])
-  GNULIB_CONNECT=0;     AC_SUBST([GNULIB_CONNECT])
-  GNULIB_ACCEPT=0;      AC_SUBST([GNULIB_ACCEPT])
-  GNULIB_BIND=0;        AC_SUBST([GNULIB_BIND])
-  GNULIB_GETPEERNAME=0; AC_SUBST([GNULIB_GETPEERNAME])
-  GNULIB_GETSOCKNAME=0; AC_SUBST([GNULIB_GETSOCKNAME])
-  GNULIB_GETSOCKOPT=0;  AC_SUBST([GNULIB_GETSOCKOPT])
-  GNULIB_LISTEN=0;      AC_SUBST([GNULIB_LISTEN])
-  GNULIB_RECV=0;        AC_SUBST([GNULIB_RECV])
-  GNULIB_SEND=0;        AC_SUBST([GNULIB_SEND])
-  GNULIB_RECVFROM=0;    AC_SUBST([GNULIB_RECVFROM])
-  GNULIB_SENDTO=0;      AC_SUBST([GNULIB_SENDTO])
-  GNULIB_SETSOCKOPT=0;  AC_SUBST([GNULIB_SETSOCKOPT])
-  GNULIB_SHUTDOWN=0;    AC_SUBST([GNULIB_SHUTDOWN])
-  GNULIB_ACCEPT4=0;     AC_SUBST([GNULIB_ACCEPT4])
   HAVE_STRUCT_SOCKADDR_STORAGE=1; AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE])
   HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY=1;
                         AC_SUBST([HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY])
index 3d43b6f..ac91d42 100644 (file)
@@ -1,5 +1,5 @@
-# sys_stat_h.m4 serial 28   -*- Autoconf -*-
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+# sys_stat_h.m4 serial 41   -*- Autoconf -*-
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved.
 dnl From Eric Blake.
 dnl Provide a GNU-like <sys/stat.h>.
 
-AC_DEFUN([gl_HEADER_SYS_STAT_H],
+AC_DEFUN_ONCE([gl_SYS_STAT_H],
 [
   AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
 
@@ -19,18 +19,21 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
   dnl Ensure the type mode_t gets defined.
   AC_REQUIRE([AC_TYPE_MODE_T])
 
-  dnl Whether to override 'struct stat'.
+  dnl Whether to enable precise timestamps in 'struct stat'.
+  m4_ifdef([gl_WINDOWS_STAT_TIMESPEC], [
+    AC_REQUIRE([gl_WINDOWS_STAT_TIMESPEC])
+  ], [
+    WINDOWS_STAT_TIMESPEC=0
+  ])
+  AC_SUBST([WINDOWS_STAT_TIMESPEC])
+
+  dnl Whether to ensure that struct stat.st_size is 64-bit wide.
   m4_ifdef([gl_LARGEFILE], [
     AC_REQUIRE([gl_LARGEFILE])
   ], [
     WINDOWS_64_BIT_ST_SIZE=0
   ])
   AC_SUBST([WINDOWS_64_BIT_ST_SIZE])
-  if test $WINDOWS_64_BIT_ST_SIZE = 1; then
-    AC_DEFINE([_GL_WINDOWS_64_BIT_ST_SIZE], [1],
-      [Define to 1 if Gnulib overrides 'struct stat' on Windows so that
-       struct stat.st_size becomes 64-bit.])
-  fi
 
   dnl Define types that are supposed to be defined in <sys/types.h> or
   dnl <sys/stat.h>.
@@ -43,39 +46,64 @@ AC_DEFUN([gl_HEADER_SYS_STAT_H],
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[#include <sys/stat.h>
-    ]], [fchmodat fstat fstatat futimens lchmod lstat mkdirat mkfifo mkfifoat
-    mknod mknodat stat utimensat])
-]) # gl_HEADER_SYS_STAT_H
+    ]], [fchmodat fstat fstatat futimens getumask lchmod lstat
+    mkdirat mkfifo mkfifoat mknod mknodat stat utimensat])
 
+  AC_REQUIRE([AC_C_RESTRICT])
+])
+
+# gl_SYS_STAT_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_SYS_STAT_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_SYS_STAT_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_STAT_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_UNISTD_H_REQUIRE_DEFAULTS dnl for REPLACE_FCHDIR
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHMODAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSTATAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FUTIMENS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETUMASK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LCHMOD])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LSTAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKDIRAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKFIFO])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKFIFOAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKNOD])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKNODAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UTIMENSAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_OVERRIDES_STRUCT_STAT])
+    dnl Support Microsoft deprecated alias function names by default.
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CHMOD], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_MKDIR], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UMASK], [1])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_STAT_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SYS_STAT_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
 [
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) dnl for REPLACE_FCHDIR
-  GNULIB_FCHMODAT=0;    AC_SUBST([GNULIB_FCHMODAT])
-  GNULIB_FSTAT=0;       AC_SUBST([GNULIB_FSTAT])
-  GNULIB_FSTATAT=0;     AC_SUBST([GNULIB_FSTATAT])
-  GNULIB_FUTIMENS=0;    AC_SUBST([GNULIB_FUTIMENS])
-  GNULIB_LCHMOD=0;      AC_SUBST([GNULIB_LCHMOD])
-  GNULIB_LSTAT=0;       AC_SUBST([GNULIB_LSTAT])
-  GNULIB_MKDIRAT=0;     AC_SUBST([GNULIB_MKDIRAT])
-  GNULIB_MKFIFO=0;      AC_SUBST([GNULIB_MKFIFO])
-  GNULIB_MKFIFOAT=0;    AC_SUBST([GNULIB_MKFIFOAT])
-  GNULIB_MKNOD=0;       AC_SUBST([GNULIB_MKNOD])
-  GNULIB_MKNODAT=0;     AC_SUBST([GNULIB_MKNODAT])
-  GNULIB_STAT=0;        AC_SUBST([GNULIB_STAT])
-  GNULIB_UTIMENSAT=0;   AC_SUBST([GNULIB_UTIMENSAT])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_FCHMODAT=1;      AC_SUBST([HAVE_FCHMODAT])
   HAVE_FSTATAT=1;       AC_SUBST([HAVE_FSTATAT])
   HAVE_FUTIMENS=1;      AC_SUBST([HAVE_FUTIMENS])
+  HAVE_GETUMASK=1;      AC_SUBST([HAVE_GETUMASK])
   HAVE_LCHMOD=1;        AC_SUBST([HAVE_LCHMOD])
   HAVE_LSTAT=1;         AC_SUBST([HAVE_LSTAT])
   HAVE_MKDIRAT=1;       AC_SUBST([HAVE_MKDIRAT])
@@ -84,13 +112,16 @@ AC_DEFUN([gl_SYS_STAT_H_DEFAULTS],
   HAVE_MKNOD=1;         AC_SUBST([HAVE_MKNOD])
   HAVE_MKNODAT=1;       AC_SUBST([HAVE_MKNODAT])
   HAVE_UTIMENSAT=1;     AC_SUBST([HAVE_UTIMENSAT])
+  REPLACE_FCHMODAT=0;   AC_SUBST([REPLACE_FCHMODAT])
   REPLACE_FSTAT=0;      AC_SUBST([REPLACE_FSTAT])
   REPLACE_FSTATAT=0;    AC_SUBST([REPLACE_FSTATAT])
   REPLACE_FUTIMENS=0;   AC_SUBST([REPLACE_FUTIMENS])
   REPLACE_LSTAT=0;      AC_SUBST([REPLACE_LSTAT])
   REPLACE_MKDIR=0;      AC_SUBST([REPLACE_MKDIR])
   REPLACE_MKFIFO=0;     AC_SUBST([REPLACE_MKFIFO])
+  REPLACE_MKFIFOAT=0;   AC_SUBST([REPLACE_MKFIFOAT])
   REPLACE_MKNOD=0;      AC_SUBST([REPLACE_MKNOD])
+  REPLACE_MKNODAT=0;    AC_SUBST([REPLACE_MKNODAT])
   REPLACE_STAT=0;       AC_SUBST([REPLACE_STAT])
   REPLACE_UTIMENSAT=0;  AC_SUBST([REPLACE_UTIMENSAT])
 ])
index 3061a9c..c425a96 100644 (file)
@@ -1,25 +1,20 @@
 # Configure a replacement for <sys/time.h>.
-# serial 8
+# serial 12
 
-# Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
 
 # Written by Paul Eggert and Martin Lambers.
 
-AC_DEFUN([gl_HEADER_SYS_TIME_H],
+AC_DEFUN_ONCE([gl_SYS_TIME_H],
 [
   dnl Use AC_REQUIRE here, so that the REPLACE_GETTIMEOFDAY=0 statement
   dnl below is expanded once only, before all REPLACE_GETTIMEOFDAY=1
   dnl statements that occur in other macros.
-  AC_REQUIRE([gl_HEADER_SYS_TIME_H_BODY])
-])
-
-AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
-[
+  AC_REQUIRE([gl_SYS_TIME_H_DEFAULTS])
   AC_REQUIRE([AC_C_RESTRICT])
-  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
   AC_CHECK_HEADERS_ONCE([sys/time.h])
   gl_CHECK_NEXT_HEADERS([sys/time.h])
 
@@ -89,23 +84,37 @@ AC_DEFUN([gl_HEADER_SYS_TIME_H_BODY],
     ]], [gettimeofday])
 ])
 
+# gl_SYS_TIME_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_SYS_TIME_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_HEADER_SYS_TIME_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_SYS_TIME_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
-AC_DEFUN([gl_HEADER_SYS_TIME_H_DEFAULTS],
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_TIME_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TIME_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETTIMEOFDAY])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_TIME_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SYS_TIME_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_TIME_H_DEFAULTS],
 [
-  GNULIB_GETTIMEOFDAY=0;     AC_SUBST([GNULIB_GETTIMEOFDAY])
   dnl Assume POSIX behavior unless another module says otherwise.
   HAVE_GETTIMEOFDAY=1;       AC_SUBST([HAVE_GETTIMEOFDAY])
   HAVE_STRUCT_TIMEVAL=1;     AC_SUBST([HAVE_STRUCT_TIMEVAL])
   HAVE_SYS_TIME_H=1;         AC_SUBST([HAVE_SYS_TIME_H])
-  HAVE_TIMEZONE_T=0;         AC_SUBST([HAVE_TIMEZONE_T])
   REPLACE_GETTIMEOFDAY=0;    AC_SUBST([REPLACE_GETTIMEOFDAY])
   REPLACE_STRUCT_TIMEVAL=0;  AC_SUBST([REPLACE_STRUCT_TIMEVAL])
 ])
index 159b005..6dd6fee 100644 (file)
@@ -1,5 +1,5 @@
-# sys_types_h.m4 serial 6
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# sys_types_h.m4 serial 13
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,6 +7,10 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN_ONCE([gl_SYS_TYPES_H],
 [
   AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
+
+  dnl Use sane struct stat types in OpenVMS 8.2 and later.
+  AC_DEFINE([_USE_STD_STAT], 1, [For standard stat data types on VMS.])
+
   gl_NEXT_HEADERS([sys/types.h])
 
   dnl Ensure the type pid_t gets defined.
@@ -17,6 +21,25 @@ AC_DEFUN_ONCE([gl_SYS_TYPES_H],
 
   dnl Whether to override the 'off_t' type.
   AC_REQUIRE([gl_TYPE_OFF_T])
+
+  dnl Whether to override the 'dev_t' and 'ino_t' types.
+  m4_ifdef([gl_WINDOWS_STAT_INODES], [
+    AC_REQUIRE([gl_WINDOWS_STAT_INODES])
+  ], [
+    WINDOWS_STAT_INODES=0
+  ])
+  AC_SUBST([WINDOWS_STAT_INODES])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_TYPES_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS], [
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_TYPE_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SYS_TYPES_H_DEFAULTS])
 ])
 
 AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
@@ -24,26 +47,24 @@ AC_DEFUN([gl_SYS_TYPES_H_DEFAULTS],
 ])
 
 # This works around a buggy version in autoconf <= 2.69.
-# See <https://lists.gnu.org/archive/html/autoconf/2016-08/msg00014.html>
+# See <https://lists.gnu.org/r/autoconf/2016-08/msg00014.html>
+# The 2.70 version isn't quoted properly, so override it too.
 
-m4_version_prereq([2.70], [], [
-
-# This is taken from the following Autoconf patch:
-# http://git.sv.gnu.org/cgit/autoconf.git/commit/?id=e17a30e98
+m4_version_prereq([2.70.1], [], [
 
 m4_undefine([AC_HEADER_MAJOR])
 AC_DEFUN([AC_HEADER_MAJOR],
 [AC_CHECK_HEADERS_ONCE([sys/types.h])
 AC_CHECK_HEADER([sys/mkdev.h],
-  [AC_DEFINE([MAJOR_IN_MKDEV], [1],
-    [Define to 1 if `major', `minor', and `makedev' are declared in
-     <mkdev.h>.])])
+                [AC_DEFINE([MAJOR_IN_MKDEV], [1],
+                           [Define to 1 if `major', `minor', and `makedev' are
+                            declared in <mkdev.h>.])])
 if test $ac_cv_header_sys_mkdev_h = no; then
   AC_CHECK_HEADER([sys/sysmacros.h],
-    [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
-      [Define to 1 if `major', `minor', and `makedev' are declared in
-       <sysmacros.h>.])])
+                  [AC_DEFINE([MAJOR_IN_SYSMACROS], [1],
+                             [Define to 1 if `major', `minor', and `makedev'
+                              are declared in <sysmacros.h>.])])
 fi
-])
+])# AC_HEADER_MAJOR
 
 ])
diff --git a/m4/sys_uio_h.m4 b/m4/sys_uio_h.m4
new file mode 100644 (file)
index 0000000..fa176e0
--- /dev/null
@@ -0,0 +1,46 @@
+# sys_uio_h.m4 serial 3
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN_ONCE([gl_SYS_UIO_H],
+[
+  AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS])
+  dnl <sys/uio.h> is always overridden, because of GNULIB_POSIXCHECK.
+  gl_CHECK_NEXT_HEADERS([sys/uio.h])
+  if test $ac_cv_header_sys_uio_h = yes; then
+    HAVE_SYS_UIO_H=1
+  else
+    HAVE_SYS_UIO_H=0
+  fi
+  AC_SUBST([HAVE_SYS_UIO_H])
+])
+
+# gl_SYS_UIO_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
+AC_DEFUN([gl_SYS_UIO_MODULE_INDICATOR],
+[
+  dnl Ensure to expand the default settings once only.
+  gl_SYS_UIO_H_REQUIRE_DEFAULTS
+  gl_MODULE_INDICATOR_SET_VARIABLE([$1])
+  dnl Define it also as a C macro, for the benefit of the unit tests.
+  gl_MODULE_INDICATOR_FOR_TESTS([$1])
+])
+
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_UIO_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_UIO_H_MODULE_INDICATOR_DEFAULTS], [
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_UIO_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SYS_UIO_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_SYS_UIO_H_DEFAULTS],
+[
+])
index 69ca429..d7c412a 100644 (file)
@@ -1,10 +1,10 @@
-# sys_wait_h.m4 serial 6
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# sys_wait_h.m4 serial 9
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
-AC_DEFUN([gl_SYS_WAIT_H],
+AC_DEFUN_ONCE([gl_SYS_WAIT_H],
 [
   AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
 
@@ -20,17 +20,32 @@ AC_DEFUN([gl_SYS_WAIT_H],
     [waitpid])
 ])
 
+# gl_SYS_WAIT_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_SYS_WAIT_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_SYS_WAIT_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_SYS_WAIT_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_SYS_WAIT_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WAITPID])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_SYS_WAIT_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_SYS_WAIT_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_SYS_WAIT_H_DEFAULTS],
 [
-  GNULIB_WAITPID=0; AC_SUBST([GNULIB_WAITPID])
   dnl Assume proper GNU behavior unless another module says otherwise.
 ])
index acf4c8d..14c796d 100644 (file)
@@ -1,6 +1,6 @@
 #serial 5
 
-# Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/thread.m4 b/m4/thread.m4
new file mode 100644 (file)
index 0000000..8ec9cc3
--- /dev/null
@@ -0,0 +1,17 @@
+# thread.m4 serial 3
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_THREAD],
+[
+  AC_REQUIRE([gl_THREADLIB])
+
+  if test $gl_threads_api = posix; then
+    gl_save_LIBS="$LIBS"
+    LIBS="$LIBS $LIBMULTITHREAD"
+    AC_CHECK_FUNCS([pthread_atfork])
+    LIBS="$gl_save_LIBS"
+  fi
+])
index 2b6b6cf..8fc3dfd 100644 (file)
-# threadlib.m4 serial 12
-dnl Copyright (C) 2005-2016 Free Software Foundation, Inc.
+# threadlib.m4 serial 30
+dnl Copyright (C) 2005-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl From Bruno Haible.
 
+AC_PREREQ([2.60])
+
+dnl The general structure of the multithreading modules in gnulib is that we
+dnl have three set of modules:
+dnl
+dnl   * POSIX API:
+dnl     pthread, which combines
+dnl       pthread-h
+dnl       pthread-thread
+dnl       pthread-once
+dnl       pthread-mutex
+dnl       pthread-rwlock
+dnl       pthread-cond
+dnl       pthread-tss
+dnl       pthread-spin
+dnl     sched_yield
+dnl
+dnl   * ISO C API:
+dnl     threads, which combines
+dnl       threads-h
+dnl       thrd
+dnl       mtx
+dnl       cnd
+dnl       tss
+dnl
+dnl   * Gnulib API, with an implementation that can be chosen at configure
+dnl     time through the option --enable-threads=...
+dnl       thread
+dnl       lock
+dnl       cond
+dnl       tls
+dnl       yield
+dnl
+dnl They are independent, except for the fact that
+dnl   - the implementation of the ISO C API may use the POSIX (or some other
+dnl     platform dependent) API,
+dnl   - the implementation of the Gnulib API may use the POSIX or ISO C or
+dnl     some other platform dependent API, depending on the --enable-threads
+dnl     option.
+dnl
+dnl This file contains macros for all of these APIs!
+
+dnl ============================================================================
+dnl Macros for all thread APIs
+
+AC_DEFUN([gl_ANYTHREADLIB_EARLY],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  if test -z "$gl_anythreadlib_early_done"; then
+    case "$host_os" in
+      osf*)
+        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
+        # groks <pthread.h>. cc also understands the flag -pthread, but
+        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
+        # 2. putting a flag into CPPFLAGS that has an effect on the linker
+        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
+        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
+        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+        ;;
+    esac
+    # Some systems optimize for single-threaded programs by default, and
+    # need special flags to disable these optimizations. For example, the
+    # definition of 'errno' in <errno.h>.
+    case "$host_os" in
+      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
+      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
+    esac
+    gl_anythreadlib_early_done=done
+  fi
+])
+
+dnl Checks whether the compiler and linker support weak declarations of symbols.
+
+AC_DEFUN([gl_WEAK_SYMBOLS],
+[
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  AC_CACHE_CHECK([whether imported symbols can be declared weak],
+    [gl_cv_have_weak],
+    [gl_cv_have_weak=no
+     dnl First, test whether the compiler accepts it syntactically.
+     AC_LINK_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[extern void xyzzy ();
+#pragma weak xyzzy]],
+          [[xyzzy();]])],
+       [gl_cv_have_weak=maybe])
+     if test $gl_cv_have_weak = maybe; then
+       dnl Second, test whether it actually works. On Cygwin 1.7.2, with
+       dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
+       AC_RUN_IFELSE(
+         [AC_LANG_SOURCE([[
+#include <stdio.h>
+#pragma weak fputs
+int main ()
+{
+  return (fputs == NULL);
+}]])],
+         [gl_cv_have_weak=yes],
+         [gl_cv_have_weak=no],
+         [dnl When cross-compiling, assume that only ELF platforms support
+          dnl weak symbols.
+          AC_EGREP_CPP([Extensible Linking Format],
+            [#ifdef __ELF__
+             Extensible Linking Format
+             #endif
+            ],
+            [gl_cv_have_weak="guessing yes"],
+            [gl_cv_have_weak="guessing no"])
+         ])
+     fi
+     dnl But when linking statically, weak symbols don't work.
+     case " $LDFLAGS " in
+       *" -static "*) gl_cv_have_weak=no ;;
+     esac
+     dnl Test for a bug in FreeBSD 11: A link error occurs when using a weak
+     dnl symbol and linking against a shared library that has a dependency on
+     dnl the shared library that defines the symbol.
+     case "$gl_cv_have_weak" in
+       *yes)
+         case "$host_os" in
+           freebsd* | dragonfly* | midnightbsd*)
+             : > conftest1.c
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -fPIC -shared -o libempty.so conftest1.c -lpthread >&AS_MESSAGE_LOG_FD 2>&1
+             cat <<EOF > conftest2.c
+#include <pthread.h>
+#pragma weak pthread_mutexattr_gettype
+int main ()
+{
+  return (pthread_mutexattr_gettype != NULL);
+}
+EOF
+             $CC $CPPFLAGS $CFLAGS $LDFLAGS -o conftest conftest2.c libempty.so >&AS_MESSAGE_LOG_FD 2>&1 \
+               || gl_cv_have_weak=no
+             rm -f conftest1.c libempty.so conftest2.c conftest
+             ;;
+         esac
+         ;;
+     esac
+    ])
+  case "$gl_cv_have_weak" in
+    *yes)
+      AC_DEFINE([HAVE_WEAK_SYMBOLS], [1],
+        [Define to 1 if the compiler and linker support weak declarations of symbols.])
+      ;;
+  esac
+])
+
+dnl ============================================================================
+dnl Macros for the POSIX API
+
+dnl gl_PTHREADLIB
+dnl -------------
+dnl Tests for the libraries needs for using the POSIX threads API.
+dnl Sets the variable LIBPTHREAD to the linker options for use in a Makefile.
+dnl Sets the variable LIBPMULTITHREAD, for programs that really need
+dnl multithread functionality. The difference between LIBPTHREAD and
+dnl LIBPMULTITHREAD is that on platforms supporting weak symbols, typically
+dnl LIBPTHREAD is empty whereas LIBPMULTITHREAD is not.
+dnl Sets the variable LIB_SCHED_YIELD to the linker options needed to use the
+dnl sched_yield() function.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Defines the C macro HAVE_PTHREAD_API if (at least parts of) the POSIX
+dnl threads API is available.
+
+dnl The guts of gl_PTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_PTHREADLIB_BODY],
+[
+  AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+  if test -z "$gl_pthreadlib_body_done"; then
+    gl_pthread_api=no
+    LIBPTHREAD=
+    LIBPMULTITHREAD=
+    # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
+    # it groks <pthread.h>. It's added above, in gl_ANYTHREADLIB_EARLY.
+    AC_CHECK_HEADER([pthread.h],
+      [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
+    if test "$gl_have_pthread_h" = yes; then
+      # Other possible tests:
+      #   -lpthreads (FSU threads, PCthreads)
+      #   -lgthreads
+      # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
+      # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
+      # the second one only in libpthread, and lock.c needs it.
+      #
+      # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+      # needs -pthread for some reason.  See:
+      # https://lists.gnu.org/r/bug-gnulib/2014-09/msg00023.html
+      save_LIBS=$LIBS
+      for gl_pthread in '' '-pthread'; do
+        LIBS="$LIBS $gl_pthread"
+        AC_LINK_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[#include <pthread.h>
+               pthread_mutex_t m;
+               pthread_mutexattr_t ma;
+             ]],
+             [[pthread_mutex_lock (&m);
+               pthread_mutexattr_init (&ma);]])],
+          [gl_pthread_api=yes
+           LIBPTHREAD=$gl_pthread
+           LIBPMULTITHREAD=$gl_pthread])
+        LIBS=$save_LIBS
+        test $gl_pthread_api = yes && break
+      done
+
+      # Test for libpthread by looking for pthread_kill. (Not pthread_self,
+      # since it is defined as a macro on OSF/1.)
+      if test $gl_pthread_api = yes && test -z "$LIBPTHREAD"; then
+        # The program links fine without libpthread. But it may actually
+        # need to link with libpthread in order to create multiple threads.
+        AC_CHECK_LIB([pthread], [pthread_kill],
+          [LIBPMULTITHREAD=-lpthread
+           # On Solaris and HP-UX, most pthread functions exist also in libc.
+           # Therefore pthread_in_use() needs to actually try to create a
+           # thread: pthread_create from libc will fail, whereas
+           # pthread_create will actually create a thread.
+           # On Solaris 10 or newer, this test is no longer needed, because
+           # libc contains the fully functional pthread functions.
+           case "$host_os" in
+             solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
+               AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+                 [Define if the pthread_in_use() detection is hard.])
+           esac
+          ])
+      elif test $gl_pthread_api != yes; then
+        # Some library is needed. Try libpthread and libc_r.
+        AC_CHECK_LIB([pthread], [pthread_kill],
+          [gl_pthread_api=yes
+           LIBPTHREAD=-lpthread
+           LIBPMULTITHREAD=-lpthread])
+        if test $gl_pthread_api != yes; then
+          # For FreeBSD 4.
+          AC_CHECK_LIB([c_r], [pthread_kill],
+            [gl_pthread_api=yes
+             LIBPTHREAD=-lc_r
+             LIBPMULTITHREAD=-lc_r])
+        fi
+      fi
+    fi
+    AC_MSG_CHECKING([whether POSIX threads API is available])
+    AC_MSG_RESULT([$gl_pthread_api])
+    AC_SUBST([LIBPTHREAD])
+    AC_SUBST([LIBPMULTITHREAD])
+    if test $gl_pthread_api = yes; then
+      AC_DEFINE([HAVE_PTHREAD_API], [1],
+        [Define if you have the <pthread.h> header and the POSIX threads API.])
+    fi
+
+    dnl On some systems, sched_yield is in librt, rather than in libpthread.
+    AC_LINK_IFELSE(
+      [AC_LANG_PROGRAM(
+         [[#include <sched.h>]],
+         [[sched_yield ();]])],
+      [LIB_SCHED_YIELD=
+      ],
+      [dnl Solaris 7...10 has sched_yield in librt, not in libpthread or libc.
+       AC_CHECK_LIB([rt], [sched_yield], [LIB_SCHED_YIELD=-lrt],
+         [dnl Solaris 2.5.1, 2.6 has sched_yield in libposix4, not librt.
+          AC_CHECK_LIB([posix4], [sched_yield], [LIB_SCHED_YIELD=-lposix4])])
+      ])
+    AC_SUBST([LIB_SCHED_YIELD])
+
+    gl_pthreadlib_body_done=done
+  fi
+])
+
+AC_DEFUN([gl_PTHREADLIB],
+[
+  AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+  gl_PTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the ISO C API
+
+dnl gl_STDTHREADLIB
+dnl ---------------
+dnl Tests for the libraries needs for using the ISO C threads API.
+dnl Sets the variable LIBSTDTHREAD to the linker options for use in a Makefile.
+dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
+dnl multithread-safe programs.
+dnl Defines the C macro HAVE_THREADS_H if (at least parts of) the ISO C threads
+dnl API is available.
+
+dnl The guts of gl_STDTHREADLIB. Needs to be expanded only once.
+
+AC_DEFUN([gl_STDTHREADLIB_BODY],
+[
+  AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+  AC_REQUIRE([AC_CANONICAL_HOST])
+  if test -z "$gl_stdthreadlib_body_done"; then
+    AC_CHECK_HEADERS_ONCE([threads.h])
+
+    case "$host_os" in
+      mingw*)
+        LIBSTDTHREAD=
+        ;;
+      *)
+        gl_PTHREADLIB_BODY
+        if test $ac_cv_header_threads_h = yes; then
+          dnl glibc >= 2.29 has thrd_create in libpthread.
+          dnl FreeBSD >= 10 has thrd_create in libstdthreads; this library depends
+          dnl on libpthread (for the symbol 'pthread_mutexattr_gettype').
+          dnl AIX >= 7.1 and Solaris >= 11.4 have thrd_create in libc.
+          AC_CHECK_FUNCS([thrd_create])
+          if test $ac_cv_func_thrd_create = yes; then
+            LIBSTDTHREAD=
+          else
+            AC_CHECK_LIB([stdthreads], [thrd_create], [
+              LIBSTDTHREAD='-lstdthreads -lpthread'
+            ], [
+              dnl Guess that thrd_create is in libpthread.
+              LIBSTDTHREAD="$LIBPMULTITHREAD"
+            ])
+          fi
+        else
+          dnl Libraries needed by thrd.c, mtx.c, cnd.c, tss.c.
+          LIBSTDTHREAD="$LIBPMULTITHREAD $LIB_SCHED_YIELD"
+        fi
+        ;;
+    esac
+    AC_SUBST([LIBSTDTHREAD])
+
+    AC_MSG_CHECKING([whether ISO C threads API is available])
+    AC_MSG_RESULT([$ac_cv_header_threads_h])
+    gl_stdthreadlib_body_done=done
+  fi
+])
+
+AC_DEFUN([gl_STDTHREADLIB],
+[
+  AC_REQUIRE([gl_ANYTHREADLIB_EARLY])
+  gl_STDTHREADLIB_BODY
+])
+
+dnl ============================================================================
+dnl Macros for the Gnulib API
+
 dnl gl_THREADLIB
 dnl ------------
 dnl Tests for a multithreading library to be used.
@@ -14,8 +354,13 @@ dnl (it must be placed before the invocation of gl_THREADLIB_EARLY!), then the
 dnl default is 'no', otherwise it is system dependent. In both cases, the user
 dnl can change the choice through the options --enable-threads=choice or
 dnl --disable-threads.
-dnl Defines at most one of the macros USE_POSIX_THREADS, USE_SOLARIS_THREADS,
-dnl USE_PTH_THREADS, USE_WINDOWS_THREADS
+dnl Defines at most one of the macros USE_ISOC_THREADS, USE_POSIX_THREADS,
+dnl USE_ISOC_AND_POSIX_THREADS, USE_WINDOWS_THREADS.
+dnl The choice --enable-threads=isoc+posix is available only on platforms that
+dnl have both the ISO C and the POSIX threads APIs. It has the effect of using
+dnl the ISO C API for most things and the POSIX API only for creating and
+dnl controlling threads (because there is no equivalent to pthread_atfork in
+dnl the ISO C API).
 dnl Sets the variables LIBTHREAD and LTLIBTHREAD to the linker options for use
 dnl in a Makefile (LIBTHREAD for use without libtool, LTLIBTHREAD for use with
 dnl libtool).
@@ -25,6 +370,9 @@ dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
 dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not.
 dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
 dnl multithread-safe programs.
+dnl Since support for GNU pth was removed, $LTLIBTHREAD and $LIBTHREAD have the
+dnl same value, and similarly $LTLIBMULTITHREAD and $LIBMULTITHREAD have the
+dnl same value. Only system libraries are needed.
 
 AC_DEFUN([gl_THREADLIB_EARLY],
 [
@@ -43,18 +391,15 @@ AC_DEFUN([gl_THREADLIB_EARLY_BODY],
 
   AC_REQUIRE([AC_CANONICAL_HOST])
   dnl _GNU_SOURCE is needed for pthread_rwlock_t on glibc systems.
-  dnl AC_USE_SYSTEM_EXTENSIONS was introduced in autoconf 2.60 and obsoletes
-  dnl AC_GNU_SOURCE.
-  m4_ifdef([AC_USE_SYSTEM_EXTENSIONS],
-    [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])],
-    [AC_REQUIRE([AC_GNU_SOURCE])])
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
   dnl Check for multithreading.
   m4_ifdef([gl_THREADLIB_DEFAULT_NO],
     [m4_divert_text([DEFAULTS], [gl_use_threads_default=no])],
     [m4_divert_text([DEFAULTS], [gl_use_threads_default=])])
+  m4_divert_text([DEFAULTS], [gl_use_winpthreads_default=])
   AC_ARG_ENABLE([threads],
-AC_HELP_STRING([--enable-threads={posix|solaris|pth|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
-AC_HELP_STRING([--disable-threads], [build without multithread safety])]),
+AS_HELP_STRING([--enable-threads={isoc|posix|isoc+posix|windows}], [specify multithreading API])m4_ifdef([gl_THREADLIB_DEFAULT_NO], [], [
+AS_HELP_STRING([--disable-threads], [build without multithread safety])]),
     [gl_use_threads=$enableval],
     [if test -n "$gl_use_threads_default"; then
        gl_use_threads="$gl_use_threads_default"
@@ -64,41 +409,35 @@ changequote(,)dnl
          dnl Disable multithreading by default on OSF/1, because it interferes
          dnl with fork()/exec(): When msgexec is linked with -lpthread, its
          dnl child process gets an endless segmentation fault inside execvp().
+         osf*) gl_use_threads=no ;;
          dnl Disable multithreading by default on Cygwin 1.5.x, because it has
          dnl bugs that lead to endless loops or crashes. See
-         dnl <http://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
-         osf*) gl_use_threads=no ;;
+         dnl <https://cygwin.com/ml/cygwin/2009-08/msg00283.html>.
          cygwin*)
                case `uname -r` in
                  1.[0-5].*) gl_use_threads=no ;;
                  *)         gl_use_threads=yes ;;
                esac
                ;;
+         dnl Obey gl_AVOID_WINPTHREAD on mingw.
+         mingw*)
+               case "$gl_use_winpthreads_default" in
+                 yes) gl_use_threads=posix ;;
+                 no)  gl_use_threads=windows ;;
+                 *)   gl_use_threads=yes ;;
+               esac
+               ;;
          *)    gl_use_threads=yes ;;
        esac
 changequote([,])dnl
      fi
     ])
-  if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
-    # For using <pthread.h>:
-    case "$host_os" in
-      osf*)
-        # On OSF/1, the compiler needs the flag -D_REENTRANT so that it
-        # groks <pthread.h>. cc also understands the flag -pthread, but
-        # we don't use it because 1. gcc-2.95 doesn't understand -pthread,
-        # 2. putting a flag into CPPFLAGS that has an effect on the linker
-        # causes the AC_LINK_IFELSE test below to succeed unexpectedly,
-        # leading to wrong values of LIBTHREAD and LTLIBTHREAD.
-        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
-        ;;
-    esac
-    # Some systems optimize for single-threaded programs by default, and
-    # need special flags to disable these optimizations. For example, the
-    # definition of 'errno' in <errno.h>.
-    case "$host_os" in
-      aix* | freebsd*) CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" ;;
-      solaris*) CPPFLAGS="$CPPFLAGS -D_REENTRANT" ;;
-    esac
+  if test "$gl_use_threads" = yes \
+     || test "$gl_use_threads" = isoc \
+     || test "$gl_use_threads" = posix \
+     || test "$gl_use_threads" = isoc+posix; then
+    # For using <threads.h> or <pthread.h>:
+    gl_ANYTHREADLIB_EARLY
   fi
 ])
 
@@ -114,110 +453,31 @@ AC_DEFUN([gl_THREADLIB_BODY],
   LTLIBMULTITHREAD=
   if test "$gl_use_threads" != no; then
     dnl Check whether the compiler and linker support weak declarations.
-    AC_CACHE_CHECK([whether imported symbols can be declared weak],
-      [gl_cv_have_weak],
-      [gl_cv_have_weak=no
-       dnl First, test whether the compiler accepts it syntactically.
-       AC_LINK_IFELSE(
-         [AC_LANG_PROGRAM(
-            [[extern void xyzzy ();
-#pragma weak xyzzy]],
-            [[xyzzy();]])],
-         [gl_cv_have_weak=maybe])
-       if test $gl_cv_have_weak = maybe; then
-         dnl Second, test whether it actually works. On Cygwin 1.7.2, with
-         dnl gcc 4.3, symbols declared weak always evaluate to the address 0.
-         AC_RUN_IFELSE(
-           [AC_LANG_SOURCE([[
-#include <stdio.h>
-#pragma weak fputs
-int main ()
-{
-  return (fputs == NULL);
-}]])],
-           [gl_cv_have_weak=yes],
-           [gl_cv_have_weak=no],
-           [dnl When cross-compiling, assume that only ELF platforms support
-            dnl weak symbols.
-            AC_EGREP_CPP([Extensible Linking Format],
-              [#ifdef __ELF__
-               Extensible Linking Format
-               #endif
-              ],
-              [gl_cv_have_weak="guessing yes"],
-              [gl_cv_have_weak="guessing no"])
-           ])
-       fi
-      ])
-    if test "$gl_use_threads" = yes || test "$gl_use_threads" = posix; then
-      # On OSF/1, the compiler needs the flag -pthread or -D_REENTRANT so that
-      # it groks <pthread.h>. It's added above, in gl_THREADLIB_EARLY_BODY.
-      AC_CHECK_HEADER([pthread.h],
-        [gl_have_pthread_h=yes], [gl_have_pthread_h=no])
-      if test "$gl_have_pthread_h" = yes; then
-        # Other possible tests:
-        #   -lpthreads (FSU threads, PCthreads)
-        #   -lgthreads
-        gl_have_pthread=
-        # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
-        # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
-        # the second one only in libpthread, and lock.c needs it.
-        #
-        # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
-        # needs -pthread for some reason.  See:
-        # http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html
-        save_LIBS=$LIBS
-        for gl_pthread in '' '-pthread'; do
-          LIBS="$LIBS $gl_pthread"
-          AC_LINK_IFELSE(
-            [AC_LANG_PROGRAM(
-               [[#include <pthread.h>
-                 pthread_mutex_t m;
-                 pthread_mutexattr_t ma;
-               ]],
-               [[pthread_mutex_lock (&m);
-                 pthread_mutexattr_init (&ma);]])],
-            [gl_have_pthread=yes
-             LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread
-             LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread])
-          LIBS=$save_LIBS
-          test -n "$gl_have_pthread" && break
-        done
-
-        # Test for libpthread by looking for pthread_kill. (Not pthread_self,
-        # since it is defined as a macro on OSF/1.)
-        if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then
-          # The program links fine without libpthread. But it may actually
-          # need to link with libpthread in order to create multiple threads.
-          AC_CHECK_LIB([pthread], [pthread_kill],
-            [LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread
-             # On Solaris and HP-UX, most pthread functions exist also in libc.
-             # Therefore pthread_in_use() needs to actually try to create a
-             # thread: pthread_create from libc will fail, whereas
-             # pthread_create will actually create a thread.
-             # On Solaris 10 or newer, this test is no longer needed, because
-             # libc contains the fully functional pthread functions.
-             case "$host_os" in
-               solaris | solaris2.[1-9] | solaris2.[1-9].* | hpux*)
-                 AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
-                   [Define if the pthread_in_use() detection is hard.])
-             esac
-            ])
-        elif test -z "$gl_have_pthread"; then
-          # Some library is needed. Try libpthread and libc_r.
-          AC_CHECK_LIB([pthread], [pthread_kill],
-            [gl_have_pthread=yes
-             LIBTHREAD=-lpthread LTLIBTHREAD=-lpthread
-             LIBMULTITHREAD=-lpthread LTLIBMULTITHREAD=-lpthread])
-          if test -z "$gl_have_pthread"; then
-            # For FreeBSD 4.
-            AC_CHECK_LIB([c_r], [pthread_kill],
-              [gl_have_pthread=yes
-               LIBTHREAD=-lc_r LTLIBTHREAD=-lc_r
-               LIBMULTITHREAD=-lc_r LTLIBMULTITHREAD=-lc_r])
-          fi
-        fi
-        if test -n "$gl_have_pthread"; then
+    gl_WEAK_SYMBOLS
+    if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
+      dnl If we use weak symbols to implement pthread_in_use / pth_in_use /
+      dnl thread_in_use, we also need to test whether the ISO C 11 thrd_create
+      dnl facility is in use.
+      AC_CHECK_HEADERS_ONCE([threads.h])
+      :
+    fi
+    if test "$gl_use_threads" = isoc || test "$gl_use_threads" = isoc+posix; then
+      AC_CHECK_HEADERS_ONCE([threads.h])
+      gl_have_isoc_threads="$ac_cv_header_threads_h"
+    fi
+    if test "$gl_use_threads" = yes \
+       || test "$gl_use_threads" = posix \
+       || test "$gl_use_threads" = isoc+posix; then
+      gl_PTHREADLIB_BODY
+      LIBTHREAD=$LIBPTHREAD LTLIBTHREAD=$LIBPTHREAD
+      LIBMULTITHREAD=$LIBPMULTITHREAD LTLIBMULTITHREAD=$LIBPMULTITHREAD
+      if test $gl_pthread_api = yes; then
+        if test "$gl_use_threads" = isoc+posix && test "$gl_have_isoc_threads" = yes; then
+          gl_threads_api='isoc+posix'
+          AC_DEFINE([USE_ISOC_AND_POSIX_THREADS], [1],
+            [Define if the combination of the ISO C and POSIX multithreading APIs can be used.])
+          LIBTHREAD= LTLIBTHREAD=
+        else
           gl_threads_api=posix
           AC_DEFINE([USE_POSIX_THREADS], [1],
             [Define if the POSIX multithreading library can be used.])
@@ -225,75 +485,34 @@ int main ()
             if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
               AC_DEFINE([USE_POSIX_THREADS_WEAK], [1],
                 [Define if references to the POSIX multithreading library should be made weak.])
-              LIBTHREAD=
-              LTLIBTHREAD=
+              LIBTHREAD= LTLIBTHREAD=
+            else
+              case "$host_os" in
+                freebsd* | dragonfly* | midnightbsd*)
+                  if test "x$LIBTHREAD" != "x$LIBMULTITHREAD"; then
+                    dnl If weak symbols can't tell whether pthread_create(), pthread_key_create()
+                    dnl etc. will succeed, we need a runtime test.
+                    AC_DEFINE([PTHREAD_IN_USE_DETECTION_HARD], [1],
+                      [Define if the pthread_in_use() detection is hard.])
+                  fi
+                  ;;
+              esac
             fi
           fi
         fi
       fi
     fi
-    if test -z "$gl_have_pthread"; then
-      if test "$gl_use_threads" = yes || test "$gl_use_threads" = solaris; then
-        gl_have_solaristhread=
-        gl_save_LIBS="$LIBS"
-        LIBS="$LIBS -lthread"
-        AC_LINK_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[
-#include <thread.h>
-#include <synch.h>
-             ]],
-             [[thr_self();]])],
-          [gl_have_solaristhread=yes])
-        LIBS="$gl_save_LIBS"
-        if test -n "$gl_have_solaristhread"; then
-          gl_threads_api=solaris
-          LIBTHREAD=-lthread
-          LTLIBTHREAD=-lthread
-          LIBMULTITHREAD="$LIBTHREAD"
-          LTLIBMULTITHREAD="$LTLIBTHREAD"
-          AC_DEFINE([USE_SOLARIS_THREADS], [1],
-            [Define if the old Solaris multithreading library can be used.])
-          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
-            AC_DEFINE([USE_SOLARIS_THREADS_WEAK], [1],
-              [Define if references to the old Solaris multithreading library should be made weak.])
-            LIBTHREAD=
-            LTLIBTHREAD=
-          fi
-        fi
-      fi
-    fi
-    if test "$gl_use_threads" = pth; then
-      gl_save_CPPFLAGS="$CPPFLAGS"
-      AC_LIB_LINKFLAGS([pth])
-      gl_have_pth=
-      gl_save_LIBS="$LIBS"
-      LIBS="$LIBS $LIBPTH"
-      AC_LINK_IFELSE(
-        [AC_LANG_PROGRAM([[#include <pth.h>]], [[pth_self();]])],
-        [gl_have_pth=yes])
-      LIBS="$gl_save_LIBS"
-      if test -n "$gl_have_pth"; then
-        gl_threads_api=pth
-        LIBTHREAD="$LIBPTH"
-        LTLIBTHREAD="$LTLIBPTH"
-        LIBMULTITHREAD="$LIBTHREAD"
-        LTLIBMULTITHREAD="$LTLIBTHREAD"
-        AC_DEFINE([USE_PTH_THREADS], [1],
-          [Define if the GNU Pth multithreading library can be used.])
-        if test -n "$LIBMULTITHREAD" || test -n "$LTLIBMULTITHREAD"; then
-          if case "$gl_cv_have_weak" in *yes) true;; *) false;; esac; then
-            AC_DEFINE([USE_PTH_THREADS_WEAK], [1],
-              [Define if references to the GNU Pth multithreading library should be made weak.])
-            LIBTHREAD=
-            LTLIBTHREAD=
-          fi
-        fi
-      else
-        CPPFLAGS="$gl_save_CPPFLAGS"
+    if test $gl_threads_api = none; then
+      if test "$gl_use_threads" = isoc && test "$gl_have_isoc_threads" = yes; then
+        gl_STDTHREADLIB_BODY
+        LIBTHREAD=$LIBSTDTHREAD LTLIBTHREAD=$LIBSTDTHREAD
+        LIBMULTITHREAD=$LIBSTDTHREAD LTLIBMULTITHREAD=$LIBSTDTHREAD
+        gl_threads_api=isoc
+        AC_DEFINE([USE_ISOC_THREADS], [1],
+          [Define if the ISO C multithreading library can be used.])
       fi
     fi
-    if test -z "$gl_have_pthread"; then
+    if test $gl_threads_api = none; then
       case "$gl_use_threads" in
         yes | windows | win32) # The 'win32' is for backward compatibility.
           if { case "$host_os" in
@@ -335,6 +554,21 @@ AC_DEFUN([gl_DISABLE_THREADS], [
 ])
 
 
+dnl gl_AVOID_WINPTHREAD
+dnl -------------------
+dnl Sets the gl_THREADLIB default so that on mingw, a dependency to the
+dnl libwinpthread DLL (mingw-w64 winpthreads library) is avoided.
+dnl The user can still override it at installation time, by using the
+dnl configure option '--enable-threads'.
+
+AC_DEFUN([gl_AVOID_WINPTHREAD], [
+  m4_divert_text([INIT_PREPARE], [gl_use_winpthreads_default=no])
+])
+
+
+dnl ============================================================================
+
+
 dnl Survey of platforms:
 dnl
 dnl Platform           Available  Compiler    Supports   test-lock
@@ -364,7 +598,6 @@ dnl
 dnl Mac OS X 10.[123]  posix      -lpthread       Y      OK
 dnl
 dnl Solaris 7,8,9      posix      -lpthread       Y      Sol 7,8: 0.0; Sol 9: OK
-dnl                    solaris    -lthread        Y      Sol 7,8: 0.0; Sol 9: OK
 dnl
 dnl HP-UX 11           posix      -lpthread       N (cc) OK
 dnl                                               Y (gcc)
@@ -378,8 +611,6 @@ dnl                               -lpthread (gcc) Y
 dnl
 dnl Cygwin             posix      -lpthread       Y      OK
 dnl
-dnl Any of the above   pth        -lpth                  0.0
-dnl
 dnl Mingw              windows                    N      OK
 dnl
 dnl BeOS 5             --
index eb2a631..b57474b 100644 (file)
@@ -1,8 +1,8 @@
 # Configure a more-standard replacement for <time.h>.
 
-# Copyright (C) 2000-2001, 2003-2007, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2000-2001, 2003-2007, 2009-2021 Free Software Foundation, Inc.
 
-# serial 9
+# serial 18
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 
 # Written by Paul Eggert and Jim Meyering.
 
-AC_DEFUN([gl_HEADER_TIME_H],
+AC_DEFUN_ONCE([gl_TIME_H],
 [
-  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
-  dnl once only, before all statements that occur in other macros.
-  AC_REQUIRE([gl_HEADER_TIME_H_BODY])
-])
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
+  AC_REQUIRE([gl_TIME_H_DEFAULTS])
 
-AC_DEFUN([gl_HEADER_TIME_H_BODY],
-[
-  AC_REQUIRE([AC_C_RESTRICT])
-  AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
   gl_NEXT_HEADERS([time.h])
   AC_REQUIRE([gl_CHECK_TYPE_STRUCT_TIMESPEC])
+
+  AC_REQUIRE([AC_C_RESTRICT])
+
+  AC_CACHE_CHECK([for TIME_UTC in <time.h>],
+    [gl_cv_time_h_has_TIME_UTC],
+    [AC_COMPILE_IFELSE(
+       [AC_LANG_PROGRAM(
+          [[#include <time.h>
+          ]],
+          [[static int x = TIME_UTC; x++;]])],
+       [gl_cv_time_h_has_TIME_UTC=yes],
+       [gl_cv_time_h_has_TIME_UTC=no])])
+  if test $gl_cv_time_h_has_TIME_UTC = yes; then
+    TIME_H_DEFINES_TIME_UTC=1
+  else
+    TIME_H_DEFINES_TIME_UTC=0
+  fi
+  AC_SUBST([TIME_H_DEFINES_TIME_UTC])
 ])
 
 dnl Check whether 'struct timespec' is declared
@@ -93,35 +106,63 @@ AC_DEFUN([gl_CHECK_TYPE_STRUCT_TIMESPEC],
   AC_SUBST([UNISTD_H_DEFINES_STRUCT_TIMESPEC])
 ])
 
+# gl_TIME_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_TIME_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_HEADER_TIME_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_TIME_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
-AC_DEFUN([gl_HEADER_TIME_H_DEFAULTS],
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_TIME_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CTIME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MKTIME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LOCALTIME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_NANOSLEEP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRFTIME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_STRPTIME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMEGM])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIMESPEC_GET])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_R])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TIME_RZ])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TZSET])
+    dnl Support Microsoft deprecated alias function names by default.
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_TZSET], [1])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_TIME_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_TIME_H_DEFAULTS])
+])
+
+AC_DEFUN([gl_TIME_H_DEFAULTS],
 [
-  GNULIB_MKTIME=0;                       AC_SUBST([GNULIB_MKTIME])
-  GNULIB_NANOSLEEP=0;                    AC_SUBST([GNULIB_NANOSLEEP])
-  GNULIB_STRPTIME=0;                     AC_SUBST([GNULIB_STRPTIME])
-  GNULIB_TIMEGM=0;                       AC_SUBST([GNULIB_TIMEGM])
-  GNULIB_TIME_R=0;                       AC_SUBST([GNULIB_TIME_R])
-  GNULIB_TIME_RZ=0;                      AC_SUBST([GNULIB_TIME_RZ])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_DECL_LOCALTIME_R=1;               AC_SUBST([HAVE_DECL_LOCALTIME_R])
   HAVE_NANOSLEEP=1;                      AC_SUBST([HAVE_NANOSLEEP])
   HAVE_STRPTIME=1;                       AC_SUBST([HAVE_STRPTIME])
   HAVE_TIMEGM=1;                         AC_SUBST([HAVE_TIMEGM])
+  HAVE_TIMESPEC_GET=1;                   AC_SUBST([HAVE_TIMESPEC_GET])
+  dnl Even GNU libc does not have timezone_t yet.
+  HAVE_TIMEZONE_T=0;                     AC_SUBST([HAVE_TIMEZONE_T])
   dnl If another module says to replace or to not replace, do that.
   dnl Otherwise, replace only if someone compiles with -DGNULIB_PORTCHECK;
   dnl this lets maintainers check for portability.
+  REPLACE_CTIME=GNULIB_PORTCHECK;        AC_SUBST([REPLACE_CTIME])
   REPLACE_LOCALTIME_R=GNULIB_PORTCHECK;  AC_SUBST([REPLACE_LOCALTIME_R])
   REPLACE_MKTIME=GNULIB_PORTCHECK;       AC_SUBST([REPLACE_MKTIME])
   REPLACE_NANOSLEEP=GNULIB_PORTCHECK;    AC_SUBST([REPLACE_NANOSLEEP])
+  REPLACE_STRFTIME=GNULIB_PORTCHECK;     AC_SUBST([REPLACE_STRFTIME])
   REPLACE_TIMEGM=GNULIB_PORTCHECK;       AC_SUBST([REPLACE_TIMEGM])
+  REPLACE_TZSET=GNULIB_PORTCHECK;        AC_SUBST([REPLACE_TZSET])
 
   dnl Hack so that the time module doesn't depend on the sys_time module.
   dnl First, default GNULIB_GETTIMEOFDAY to 0 if sys_time is absent.
index 87a3d49..2ce6db8 100644 (file)
--- a/m4/tls.m4
+++ b/m4/tls.m4
@@ -1,5 +1,5 @@
 # tls.m4 serial 2 (gettext-0.18)
-dnl Copyright (C) 2005, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 6c8dc1d..3d0bdb3 100644 (file)
@@ -1,5 +1,5 @@
 # tmpdir.m4 serial 4
-dnl Copyright (C) 2001-2002, 2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2002, 2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index e5d10eb..dd5d1dd 100644 (file)
@@ -1,5 +1,5 @@
-# ungetc.m4 serial 3
-dnl Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# ungetc.m4 serial 10
+dnl Copyright (C) 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -13,35 +13,61 @@ AC_DEFUN_ONCE([gl_FUNC_UNGETC_WORKS],
     [gl_cv_func_ungetc_works],
     [AC_RUN_IFELSE([AC_LANG_PROGRAM([[
 #include <stdio.h>
-      ]], [FILE *f;
-           if (!(f = fopen ("conftest.tmp", "w+"))) return 1;
-           if (fputs ("abc", f) < 0) return 2;
-           rewind (f);
-           if (fgetc (f) != 'a') return 3;
-           if (fgetc (f) != 'b') return 4;
-           if (ungetc ('d', f) != 'd') return 5;
-           if (ftell (f) != 1) return 6;
-           if (fgetc (f) != 'd') return 7;
-           if (ftell (f) != 2) return 8;
-           if (fseek (f, 0, SEEK_CUR) != 0) return 9;
-           if (ftell (f) != 2) return 10;
-           if (fgetc (f) != 'c') return 11;
-           fclose (f); remove ("conftest.tmp");])],
+      ]], [[FILE *f;
+            if (!(f = fopen ("conftest.tmp", "w+")))
+              return 1;
+            if (fputs ("abc", f) < 0)
+              { fclose (f); return 2; }
+            rewind (f);
+            if (fgetc (f) != 'a')
+              { fclose (f); return 3; }
+            if (fgetc (f) != 'b')
+              { fclose (f); return 4; }
+            if (ungetc ('d', f) != 'd')
+              { fclose (f); return 5; }
+            if (ftell (f) != 1)
+              { fclose (f); return 6; }
+            if (fgetc (f) != 'd')
+              { fclose (f); return 7; }
+            if (ftell (f) != 2)
+              { fclose (f); return 8; }
+            if (fseek (f, 0, SEEK_CUR) != 0)
+              { fclose (f); return 9; }
+            if (ftell (f) != 2)
+              { fclose (f); return 10; }
+            if (fgetc (f) != 'c')
+              { fclose (f); return 11; }
+            fclose (f);
+            remove ("conftest.tmp");
+          ]])],
         [gl_cv_func_ungetc_works=yes], [gl_cv_func_ungetc_works=no],
         [case "$host_os" in
-                   # Guess yes on glibc and bionic systems.
-           *-gnu*|*-android*)
-                   gl_cv_func_ungetc_works="guessing yes" ;;
-                   # If we don't know, assume the worst.
-           *)      gl_cv_func_ungetc_works="guessing no" ;;
+                          # Guess yes on glibc systems.
+           *-gnu* | gnu*) gl_cv_func_ungetc_works="guessing yes" ;;
+                          # Guess yes on musl systems.
+           *-musl*)       gl_cv_func_ungetc_works="guessing yes" ;;
+                          # Guess yes on bionic systems.
+           *-android*)    gl_cv_func_ungetc_works="guessing yes" ;;
+                          # Guess yes on native Windows.
+           mingw*)        gl_cv_func_ungetc_works="guessing yes" ;;
+                          # If we don't know, obey --enable-cross-guesses.
+           *)             gl_cv_func_ungetc_works="$gl_cross_guess_normal" ;;
          esac
         ])
     ])
+  gl_ftello_broken_after_ungetc=no
   case "$gl_cv_func_ungetc_works" in
     *yes) ;;
     *)
-      AC_DEFINE([FUNC_UNGETC_BROKEN], [1],
-        [Define to 1 if ungetc is broken when used on arbitrary bytes.])
+      dnl On macOS >= 10.15, where the above program fails with exit code 6,
+      dnl we fix it through an ftello override.
+      case "$host_os" in
+        darwin*) gl_ftello_broken_after_ungetc=yes ;;
+        *)
+          AC_DEFINE([FUNC_UNGETC_BROKEN], [1],
+            [Define to 1 if ungetc is broken when used on arbitrary bytes.])
+          ;;
+      esac
       ;;
   esac
 ])
index ceb5cc6..c205446 100644 (file)
@@ -1,5 +1,5 @@
 #serial 9
-dnl Copyright (C) 2002, 2005-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2005-2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 46ff109..a40a41b 100644 (file)
@@ -1,15 +1,15 @@
-# unistd_h.m4 serial 69
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+# unistd_h.m4 serial 88
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Simon Josefsson, Bruno Haible.
 
-AC_DEFUN([gl_UNISTD_H],
+AC_DEFUN_ONCE([gl_UNISTD_H],
 [
-  dnl Use AC_REQUIRE here, so that the default behavior below is expanded
-  dnl once only, before all statements that occur in other macros.
+  dnl Ensure to expand the default settings once only, before all statements
+  dnl that occur in other macros.
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
 
   gl_CHECK_NEXT_HEADERS([unistd.h])
@@ -37,83 +37,143 @@ AC_DEFUN([gl_UNISTD_H],
 # include <fcntl.h>
 # include <stdio.h>
 # include <stdlib.h>
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 #  include <io.h>
 # endif
 #endif
-    ]], [chdir chown dup dup2 dup3 environ euidaccess faccessat fchdir fchownat
-    fdatasync fsync ftruncate getcwd getdomainname getdtablesize getgroups
-    gethostname getlogin getlogin_r getpagesize
+    ]], [access chdir chown copy_file_range dup dup2 dup3 environ euidaccess
+    execl execle execlp execv execve execvp execvpe
+    faccessat fchdir
+    fchownat fdatasync fsync ftruncate getcwd getdomainname getdtablesize
+    getentropy getgroups gethostname getlogin getlogin_r getpagesize getpass
     getusershell setusershell endusershell
     group_member isatty lchown link linkat lseek pipe pipe2 pread pwrite
-    readlink readlinkat rmdir sethostname sleep symlink symlinkat ttyname_r
-    unlink unlinkat usleep])
+    readlink readlinkat rmdir sethostname sleep symlink symlinkat
+    truncate ttyname_r unlink unlinkat usleep])
+
+  AC_REQUIRE([AC_C_RESTRICT])
+
+  AC_CHECK_DECLS_ONCE([execvpe])
+  if test $ac_cv_have_decl_execvpe = no; then
+    HAVE_DECL_EXECVPE=0
+  fi
 ])
 
+# gl_UNISTD_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_UNISTD_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_UNISTD_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_UNISTD_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ACCESS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CHOWN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_CLOSE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_COPY_FILE_RANGE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP2])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_DUP3])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ENVIRON])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EUIDACCESS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECLE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECLP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECV])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_EXECVPE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FACCESSAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FCHOWNAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FDATASYNC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FSYNC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_FTRUNCATE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETCWD])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDOMAINNAME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETDTABLESIZE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETENTROPY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETGROUPS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETHOSTNAME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOGIN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETLOGIN_R])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETOPT_POSIX])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPAGESIZE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETPASS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GETUSERSHELL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_GROUP_MEMBER])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISATTY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LCHOWN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LINK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LINKAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_LSEEK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PIPE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PIPE2])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PREAD])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_PWRITE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READ])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READLINK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_READLINKAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_RMDIR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SETHOSTNAME])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SLEEP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_SYMLINKAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TRUNCATE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TTYNAME_R])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_NONBLOCKING])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNISTD_H_SIGPIPE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_UNLINKAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_USLEEP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WRITE])
+    dnl Support Microsoft deprecated alias function names by default.
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ACCESS], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CHDIR], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_CLOSE], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_DUP], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_DUP2], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECL], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECLE], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECLP], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECV], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVE], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVP], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_EXECVPE], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETCWD], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_GETPID], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_ISATTY], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_LSEEK], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_READ], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_RMDIR], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_SWAB], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_UNLINK], [1])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WRITE], [1])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_UNISTD_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_UNISTD_H_DEFAULTS],
 [
-  GNULIB_CHDIR=0;                AC_SUBST([GNULIB_CHDIR])
-  GNULIB_CHOWN=0;                AC_SUBST([GNULIB_CHOWN])
-  GNULIB_CLOSE=0;                AC_SUBST([GNULIB_CLOSE])
-  GNULIB_DUP=0;                  AC_SUBST([GNULIB_DUP])
-  GNULIB_DUP2=0;                 AC_SUBST([GNULIB_DUP2])
-  GNULIB_DUP3=0;                 AC_SUBST([GNULIB_DUP3])
-  GNULIB_ENVIRON=0;              AC_SUBST([GNULIB_ENVIRON])
-  GNULIB_EUIDACCESS=0;           AC_SUBST([GNULIB_EUIDACCESS])
-  GNULIB_FACCESSAT=0;            AC_SUBST([GNULIB_FACCESSAT])
-  GNULIB_FCHDIR=0;               AC_SUBST([GNULIB_FCHDIR])
-  GNULIB_FCHOWNAT=0;             AC_SUBST([GNULIB_FCHOWNAT])
-  GNULIB_FDATASYNC=0;            AC_SUBST([GNULIB_FDATASYNC])
-  GNULIB_FSYNC=0;                AC_SUBST([GNULIB_FSYNC])
-  GNULIB_FTRUNCATE=0;            AC_SUBST([GNULIB_FTRUNCATE])
-  GNULIB_GETCWD=0;               AC_SUBST([GNULIB_GETCWD])
-  GNULIB_GETDOMAINNAME=0;        AC_SUBST([GNULIB_GETDOMAINNAME])
-  GNULIB_GETDTABLESIZE=0;        AC_SUBST([GNULIB_GETDTABLESIZE])
-  GNULIB_GETGROUPS=0;            AC_SUBST([GNULIB_GETGROUPS])
-  GNULIB_GETHOSTNAME=0;          AC_SUBST([GNULIB_GETHOSTNAME])
-  GNULIB_GETLOGIN=0;             AC_SUBST([GNULIB_GETLOGIN])
-  GNULIB_GETLOGIN_R=0;           AC_SUBST([GNULIB_GETLOGIN_R])
-  GNULIB_GETPAGESIZE=0;          AC_SUBST([GNULIB_GETPAGESIZE])
-  GNULIB_GETUSERSHELL=0;         AC_SUBST([GNULIB_GETUSERSHELL])
-  GNULIB_GROUP_MEMBER=0;         AC_SUBST([GNULIB_GROUP_MEMBER])
-  GNULIB_ISATTY=0;               AC_SUBST([GNULIB_ISATTY])
-  GNULIB_LCHOWN=0;               AC_SUBST([GNULIB_LCHOWN])
-  GNULIB_LINK=0;                 AC_SUBST([GNULIB_LINK])
-  GNULIB_LINKAT=0;               AC_SUBST([GNULIB_LINKAT])
-  GNULIB_LSEEK=0;                AC_SUBST([GNULIB_LSEEK])
-  GNULIB_PIPE=0;                 AC_SUBST([GNULIB_PIPE])
-  GNULIB_PIPE2=0;                AC_SUBST([GNULIB_PIPE2])
-  GNULIB_PREAD=0;                AC_SUBST([GNULIB_PREAD])
-  GNULIB_PWRITE=0;               AC_SUBST([GNULIB_PWRITE])
-  GNULIB_READ=0;                 AC_SUBST([GNULIB_READ])
-  GNULIB_READLINK=0;             AC_SUBST([GNULIB_READLINK])
-  GNULIB_READLINKAT=0;           AC_SUBST([GNULIB_READLINKAT])
-  GNULIB_RMDIR=0;                AC_SUBST([GNULIB_RMDIR])
-  GNULIB_SETHOSTNAME=0;          AC_SUBST([GNULIB_SETHOSTNAME])
-  GNULIB_SLEEP=0;                AC_SUBST([GNULIB_SLEEP])
-  GNULIB_SYMLINK=0;              AC_SUBST([GNULIB_SYMLINK])
-  GNULIB_SYMLINKAT=0;            AC_SUBST([GNULIB_SYMLINKAT])
-  GNULIB_TTYNAME_R=0;            AC_SUBST([GNULIB_TTYNAME_R])
-  GNULIB_UNISTD_H_NONBLOCKING=0; AC_SUBST([GNULIB_UNISTD_H_NONBLOCKING])
-  GNULIB_UNISTD_H_SIGPIPE=0;     AC_SUBST([GNULIB_UNISTD_H_SIGPIPE])
-  GNULIB_UNLINK=0;               AC_SUBST([GNULIB_UNLINK])
-  GNULIB_UNLINKAT=0;             AC_SUBST([GNULIB_UNLINKAT])
-  GNULIB_USLEEP=0;               AC_SUBST([GNULIB_USLEEP])
-  GNULIB_WRITE=0;                AC_SUBST([GNULIB_WRITE])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_CHOWN=1;           AC_SUBST([HAVE_CHOWN])
-  HAVE_DUP2=1;            AC_SUBST([HAVE_DUP2])
+  HAVE_COPY_FILE_RANGE=1; AC_SUBST([HAVE_COPY_FILE_RANGE])
   HAVE_DUP3=1;            AC_SUBST([HAVE_DUP3])
   HAVE_EUIDACCESS=1;      AC_SUBST([HAVE_EUIDACCESS])
+  HAVE_EXECVPE=1;         AC_SUBST([HAVE_EXECVPE])
   HAVE_FACCESSAT=1;       AC_SUBST([HAVE_FACCESSAT])
   HAVE_FCHDIR=1;          AC_SUBST([HAVE_FCHDIR])
   HAVE_FCHOWNAT=1;        AC_SUBST([HAVE_FCHOWNAT])
@@ -121,10 +181,12 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_FSYNC=1;           AC_SUBST([HAVE_FSYNC])
   HAVE_FTRUNCATE=1;       AC_SUBST([HAVE_FTRUNCATE])
   HAVE_GETDTABLESIZE=1;   AC_SUBST([HAVE_GETDTABLESIZE])
+  HAVE_GETENTROPY=1;      AC_SUBST([HAVE_GETENTROPY])
   HAVE_GETGROUPS=1;       AC_SUBST([HAVE_GETGROUPS])
   HAVE_GETHOSTNAME=1;     AC_SUBST([HAVE_GETHOSTNAME])
   HAVE_GETLOGIN=1;        AC_SUBST([HAVE_GETLOGIN])
   HAVE_GETPAGESIZE=1;     AC_SUBST([HAVE_GETPAGESIZE])
+  HAVE_GETPASS=1;         AC_SUBST([HAVE_GETPASS])
   HAVE_GROUP_MEMBER=1;    AC_SUBST([HAVE_GROUP_MEMBER])
   HAVE_LCHOWN=1;          AC_SUBST([HAVE_LCHOWN])
   HAVE_LINK=1;            AC_SUBST([HAVE_LINK])
@@ -142,6 +204,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_UNLINKAT=1;        AC_SUBST([HAVE_UNLINKAT])
   HAVE_USLEEP=1;          AC_SUBST([HAVE_USLEEP])
   HAVE_DECL_ENVIRON=1;    AC_SUBST([HAVE_DECL_ENVIRON])
+  HAVE_DECL_EXECVPE=1;    AC_SUBST([HAVE_DECL_EXECVPE])
   HAVE_DECL_FCHDIR=1;     AC_SUBST([HAVE_DECL_FCHDIR])
   HAVE_DECL_FDATASYNC=1;  AC_SUBST([HAVE_DECL_FDATASYNC])
   HAVE_DECL_GETDOMAINNAME=1; AC_SUBST([HAVE_DECL_GETDOMAINNAME])
@@ -150,13 +213,23 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   HAVE_DECL_GETPAGESIZE=1; AC_SUBST([HAVE_DECL_GETPAGESIZE])
   HAVE_DECL_GETUSERSHELL=1; AC_SUBST([HAVE_DECL_GETUSERSHELL])
   HAVE_DECL_SETHOSTNAME=1; AC_SUBST([HAVE_DECL_SETHOSTNAME])
+  HAVE_DECL_TRUNCATE=1;   AC_SUBST([HAVE_DECL_TRUNCATE])
   HAVE_DECL_TTYNAME_R=1;  AC_SUBST([HAVE_DECL_TTYNAME_R])
   HAVE_OS_H=0;            AC_SUBST([HAVE_OS_H])
   HAVE_SYS_PARAM_H=0;     AC_SUBST([HAVE_SYS_PARAM_H])
+  REPLACE_ACCESS=0;       AC_SUBST([REPLACE_ACCESS])
   REPLACE_CHOWN=0;        AC_SUBST([REPLACE_CHOWN])
   REPLACE_CLOSE=0;        AC_SUBST([REPLACE_CLOSE])
   REPLACE_DUP=0;          AC_SUBST([REPLACE_DUP])
   REPLACE_DUP2=0;         AC_SUBST([REPLACE_DUP2])
+  REPLACE_EXECL=0;        AC_SUBST([REPLACE_EXECL])
+  REPLACE_EXECLE=0;       AC_SUBST([REPLACE_EXECLE])
+  REPLACE_EXECLP=0;       AC_SUBST([REPLACE_EXECLP])
+  REPLACE_EXECV=0;        AC_SUBST([REPLACE_EXECV])
+  REPLACE_EXECVE=0;       AC_SUBST([REPLACE_EXECVE])
+  REPLACE_EXECVP=0;       AC_SUBST([REPLACE_EXECVP])
+  REPLACE_EXECVPE=0;      AC_SUBST([REPLACE_EXECVPE])
+  REPLACE_FACCESSAT=0;    AC_SUBST([REPLACE_FACCESSAT])
   REPLACE_FCHOWNAT=0;     AC_SUBST([REPLACE_FCHOWNAT])
   REPLACE_FTRUNCATE=0;    AC_SUBST([REPLACE_FTRUNCATE])
   REPLACE_GETCWD=0;       AC_SUBST([REPLACE_GETCWD])
@@ -165,6 +238,7 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_GETLOGIN_R=0;   AC_SUBST([REPLACE_GETLOGIN_R])
   REPLACE_GETGROUPS=0;    AC_SUBST([REPLACE_GETGROUPS])
   REPLACE_GETPAGESIZE=0;  AC_SUBST([REPLACE_GETPAGESIZE])
+  REPLACE_GETPASS=0;      AC_SUBST([REPLACE_GETPASS])
   REPLACE_ISATTY=0;       AC_SUBST([REPLACE_ISATTY])
   REPLACE_LCHOWN=0;       AC_SUBST([REPLACE_LCHOWN])
   REPLACE_LINK=0;         AC_SUBST([REPLACE_LINK])
@@ -179,11 +253,13 @@ AC_DEFUN([gl_UNISTD_H_DEFAULTS],
   REPLACE_SLEEP=0;        AC_SUBST([REPLACE_SLEEP])
   REPLACE_SYMLINK=0;      AC_SUBST([REPLACE_SYMLINK])
   REPLACE_SYMLINKAT=0;    AC_SUBST([REPLACE_SYMLINKAT])
+  REPLACE_TRUNCATE=0;     AC_SUBST([REPLACE_TRUNCATE])
   REPLACE_TTYNAME_R=0;    AC_SUBST([REPLACE_TTYNAME_R])
   REPLACE_UNLINK=0;       AC_SUBST([REPLACE_UNLINK])
   REPLACE_UNLINKAT=0;     AC_SUBST([REPLACE_UNLINKAT])
   REPLACE_USLEEP=0;       AC_SUBST([REPLACE_USLEEP])
   REPLACE_WRITE=0;        AC_SUBST([REPLACE_WRITE])
+  UNISTD_H_HAVE_SYS_RANDOM_H=0; AC_SUBST([UNISTD_H_HAVE_SYS_RANDOM_H])
   UNISTD_H_HAVE_WINSOCK2_H=0; AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H])
   UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS=0;
                            AC_SUBST([UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS])
index c29ec20..b689020 100644 (file)
@@ -1,6 +1,6 @@
-# unlocked-io.m4 serial 15
+# unlocked-io.m4 serial 16
 
-# Copyright (C) 1998-2006, 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 1998-2006, 2009-2021 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -16,11 +16,6 @@ dnl on Solaris 2.6).
 
 AC_DEFUN([gl_FUNC_GLIBC_UNLOCKED_IO],
 [
-  AC_DEFINE([USE_UNLOCKED_IO], [1],
-    [Define to 1 if you want getc etc. to use unlocked I/O if available.
-     Unlocked I/O can improve performance in unithreaded apps,
-     but it is not safe for multithreaded apps.])
-
   dnl Persuade glibc and Solaris <stdio.h> to declare
   dnl fgets_unlocked(), fputs_unlocked() etc.
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
index 2d4b463..483bba9 100644 (file)
@@ -1,5 +1,5 @@
-# vasnprintf.m4 serial 36
-dnl Copyright (C) 2002-2004, 2006-2016 Free Software Foundation, Inc.
+# vasnprintf.m4 serial 38
+dnl Copyright (C) 2002-2004, 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -32,7 +32,6 @@ AC_DEFUN([gl_REPLACE_VASNPRINTF],
 # Prerequisites of lib/printf-args.h, lib/printf-args.c.
 AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 [
-  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
 ])
@@ -41,7 +40,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_ARGS],
 AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
 [
   AC_REQUIRE([gl_FEATURES_H])
-  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
   AC_REQUIRE([AC_TYPE_SIZE_T])
@@ -56,7 +54,6 @@ AC_DEFUN([gl_PREREQ_PRINTF_PARSE],
 AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
 [
   AC_REQUIRE([AC_FUNC_ALLOCA])
-  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
   AC_REQUIRE([gt_TYPE_WINT_T])
   AC_CHECK_FUNCS([snprintf strnlen wcslen wcsnlen mbrtowc wcrtomb])
@@ -77,6 +74,16 @@ AC_DEFUN_ONCE([gl_PREREQ_VASNPRINTF],
          if the buffer had been large enough.])
       ;;
   esac
+  dnl Additionally, the use of %n can be eliminated by assuming that snprintf
+  dnl always produces NUL-terminated strings (no truncation).
+  AC_REQUIRE([gl_SNPRINTF_TRUNCATION_C99])
+  case "$gl_cv_func_snprintf_truncation_c99" in
+    *yes)
+      AC_DEFINE([HAVE_SNPRINTF_TRUNCATION_C99], [1],
+        [Define if the string produced by the snprintf function is always NUL
+         terminated.])
+      ;;
+  esac
 ])
 
 # Extra prerequisites of lib/vasnprintf.c for supporting 'long double'
index 34e7a69..8876dbf 100644 (file)
@@ -1,5 +1,5 @@
 # vasprintf-posix.m4 serial 13
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index d7866b1..a26de84 100644 (file)
@@ -1,5 +1,5 @@
 # vasprintf.m4 serial 6
-dnl Copyright (C) 2002-2003, 2006-2007, 2009-2016 Free Software Foundation,
+dnl Copyright (C) 2002-2003, 2006-2007, 2009-2021 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
index a719182..ca7fd24 100644 (file)
@@ -1,5 +1,5 @@
 # version-etc.m4 serial 1
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
 # with or without modifications, as long as this notice is preserved.
diff --git a/m4/visibility.m4 b/m4/visibility.m4
new file mode 100644 (file)
index 0000000..8f27a12
--- /dev/null
@@ -0,0 +1,78 @@
+# visibility.m4 serial 7
+dnl Copyright (C) 2005, 2008, 2010-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl Mac OS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+  AC_REQUIRE([AC_PROG_CC])
+  CFLAG_VISIBILITY=
+  HAVE_VISIBILITY=0
+  if test -n "$GCC"; then
+    dnl First, check whether -Werror can be added to the command line, or
+    dnl whether it leads to an error because of some other option that the
+    dnl user has put into $CC $CFLAGS $CPPFLAGS.
+    AC_CACHE_CHECK([whether the -Werror option is usable],
+      [gl_cv_cc_vis_werror],
+      [gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -Werror"
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM([[]], [[]])],
+         [gl_cv_cc_vis_werror=yes],
+         [gl_cv_cc_vis_werror=no])
+       CFLAGS="$gl_save_CFLAGS"
+      ])
+    dnl Now check whether visibility declarations are supported.
+    AC_CACHE_CHECK([for simple visibility declarations],
+      [gl_cv_cc_visibility],
+      [gl_save_CFLAGS="$CFLAGS"
+       CFLAGS="$CFLAGS -fvisibility=hidden"
+       dnl We use the option -Werror and a function dummyfunc, because on some
+       dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+       dnl "visibility attribute not supported in this configuration; ignored"
+       dnl at the first function definition in every compilation unit, and we
+       dnl don't want to use the option in this case.
+       if test $gl_cv_cc_vis_werror = yes; then
+         CFLAGS="$CFLAGS -Werror"
+       fi
+       AC_COMPILE_IFELSE(
+         [AC_LANG_PROGRAM(
+            [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+              extern __attribute__((__visibility__("default"))) int exportedvar;
+              extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+              extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+              void dummyfunc (void);
+              void dummyfunc (void) {}
+            ]],
+            [[]])],
+         [gl_cv_cc_visibility=yes],
+         [gl_cv_cc_visibility=no])
+       CFLAGS="$gl_save_CFLAGS"
+      ])
+    if test $gl_cv_cc_visibility = yes; then
+      CFLAG_VISIBILITY="-fvisibility=hidden"
+      HAVE_VISIBILITY=1
+    fi
+  fi
+  AC_SUBST([CFLAG_VISIBILITY])
+  AC_SUBST([HAVE_VISIBILITY])
+  AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+    [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
index 1c60e51..ea085df 100644 (file)
@@ -1,5 +1,5 @@
 # wait-process.m4 serial 6
-dnl Copyright (C) 2003, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 5680dca..53af56c 100644 (file)
@@ -1,5 +1,5 @@
 # waitpid.m4 serial 2
-dnl Copyright (C) 2010-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2010-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 924e21d..9e24d89 100644 (file)
@@ -1,5 +1,5 @@
-# warnings.m4 serial 11
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# warnings.m4 serial 16
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -20,10 +20,10 @@ m4_ifdef([AS_VAR_APPEND],
 # -----------------------------------------------------------------
 # Check if the compiler supports OPTION when compiling PROGRAM.
 #
-# FIXME: gl_Warn must be used unquoted until we can assume Autoconf
-# 2.64 or newer.
+# The effects of this macro depend on the current language (_AC_LANG).
 AC_DEFUN([gl_COMPILER_OPTION_IF],
-[AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
+[
+AS_VAR_PUSHDEF([gl_Warn], [gl_cv_warn_[]_AC_LANG_ABBREV[]_$1])dnl
 AS_VAR_PUSHDEF([gl_Flags], [_AC_LANG_PREFIX[]FLAGS])dnl
 AS_LITERAL_IF([$1],
   [m4_pushdef([gl_Positive], m4_bpatsubst([$1], [^-Wno-], [-W]))],
@@ -32,13 +32,13 @@ case $gl_positive in
   -Wno-*) gl_positive=-W`expr "X$gl_positive" : 'X-Wno-\(.*\)'` ;;
 esac
 m4_pushdef([gl_Positive], [$gl_positive])])dnl
-AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], m4_defn([gl_Warn]), [
+AC_CACHE_CHECK([whether _AC_LANG compiler handles $1], [gl_Warn], [
   gl_save_compiler_FLAGS="$gl_Flags"
   gl_AS_VAR_APPEND(m4_defn([gl_Flags]),
     [" $gl_unknown_warnings_are_errors ]m4_defn([gl_Positive])["])
-  AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([])])],
-                 [AS_VAR_SET(gl_Warn, [yes])],
-                 [AS_VAR_SET(gl_Warn, [no])])
+  AC_LINK_IFELSE([m4_default([$4], [AC_LANG_PROGRAM([[]])])],
+                 [AS_VAR_SET([gl_Warn], [yes])],
+                 [AS_VAR_SET([gl_Warn], [no])])
   gl_Flags="$gl_save_compiler_FLAGS"
 ])
 AS_VAR_IF(gl_Warn, [yes], [$2], [$3])
@@ -51,27 +51,58 @@ AS_VAR_POPDEF([gl_Warn])dnl
 # ------------------------------
 # Clang doesn't complain about unknown warning options unless one also
 # specifies -Wunknown-warning-option -Werror.  Detect this.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
 AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS],
+[_AC_LANG_DISPATCH([$0], _AC_LANG, $@)])
+
+# Specialization for _AC_LANG = C. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C)],
+[
+  AC_LANG_PUSH([C])
+  gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+  AC_LANG_POP([C])
+])
+
+# Specialization for _AC_LANG = C++. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(C++)],
+[
+  AC_LANG_PUSH([C++])
+  gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+  AC_LANG_POP([C++])
+])
+
+# Specialization for _AC_LANG = Objective C. This macro can be AC_REQUIREd.
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS(Objective C)],
+[
+  AC_LANG_PUSH([Objective C])
+  gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL
+  AC_LANG_POP([Objective C])
+])
+
+AC_DEFUN([gl_UNKNOWN_WARNINGS_ARE_ERRORS_IMPL],
 [gl_COMPILER_OPTION_IF([-Werror -Wunknown-warning-option],
    [gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror'],
    [gl_unknown_warnings_are_errors=])])
 
-# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS],
+# gl_WARN_ADD(OPTION, [VARIABLE = WARN_CFLAGS/WARN_CXXFLAGS],
 #             [PROGRAM = AC_LANG_PROGRAM()])
-# ---------------------------------------------
-# Adds parameter to WARN_CFLAGS if the compiler supports it when
-# compiling PROGRAM.  For example, gl_WARN_ADD([-Wparentheses]).
+# -----------------------------------------------------------
+# Adds parameter to WARN_CFLAGS/WARN_CXXFLAGS if the compiler supports it
+# when compiling PROGRAM.  For example, gl_WARN_ADD([-Wparentheses]).
 #
 # If VARIABLE is a variable name, AC_SUBST it.
+#
+# The effects of this macro depend on the current language (_AC_LANG).
 AC_DEFUN([gl_WARN_ADD],
-[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS])
+[AC_REQUIRE([gl_UNKNOWN_WARNINGS_ARE_ERRORS(]_AC_LANG[)])
 gl_COMPILER_OPTION_IF([$1],
-  [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_CFLAGS]], [[$2]]), [" $1"])],
+  [gl_AS_VAR_APPEND(m4_if([$2], [], [[WARN_]_AC_LANG_PREFIX[FLAGS]], [[$2]]), [" $1"])],
   [],
   [$3])
 m4_ifval([$2],
          [AS_LITERAL_IF([$2], [AC_SUBST([$2])])],
-         [AC_SUBST([WARN_CFLAGS])])dnl
+         [AC_SUBST([WARN_]_AC_LANG_PREFIX[FLAGS])])dnl
 ])
 
 # Local Variables:
index 16017a5..818b319 100644 (file)
@@ -1,15 +1,15 @@
 dnl A placeholder for ISO C99 <wchar.h>, for platforms that have issues.
 
-dnl Copyright (C) 2007-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Eric Blake.
 
-# wchar_h.m4 serial 40
+# wchar_h.m4 serial 53
 
-AC_DEFUN([gl_WCHAR_H],
+AC_DEFUN_ONCE([gl_WCHAR_H],
 [
   AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
   AC_REQUIRE([gl_WCHAR_H_INLINE_OK])
@@ -35,84 +35,82 @@ AC_DEFUN([gl_WCHAR_H],
   fi
   AC_SUBST([HAVE_WINT_T])
 
+  AC_REQUIRE([gl_TYPE_WINT_T_PREREQ])
+
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
-/* 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>
-#endif
-#include <wchar.h>
+      #include <wchar.h>
     ]],
     [btowc wctob mbsinit mbrtowc mbrlen mbsrtowcs mbsnrtowcs wcrtomb
-     wcsrtombs wcsnrtombs wcwidth wmemchr wmemcmp wmemcpy wmemmove wmemset
+     wcsrtombs wcsnrtombs wcwidth
+     wmemchr wmemcmp wmemcpy wmemmove wmempcpy wmemset
      wcslen wcsnlen wcscpy wcpcpy wcsncpy wcpncpy wcscat wcsncat wcscmp
      wcsncmp wcscasecmp wcsncasecmp wcscoll wcsxfrm wcsdup wcschr wcsrchr
-     wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth
+     wcscspn wcsspn wcspbrk wcsstr wcstok wcswidth wcsftime
     ])
+
+  AC_REQUIRE([AC_C_RESTRICT])
+
+  AC_CHECK_DECLS([wcsdup], [], [], [[
+      #include <wchar.h>
+    ]])
+  if test $ac_cv_have_decl_wcsdup = no; then
+    HAVE_DECL_WCSDUP=0
+  fi
 ])
 
 dnl Check whether <wchar.h> is usable at all.
 AC_DEFUN([gl_WCHAR_H_INLINE_OK],
 [
   dnl Test whether <wchar.h> suffers due to the transition from '__inline' to
-  dnl 'gnu_inline'. See <http://sourceware.org/bugzilla/show_bug.cgi?id=4022>
-  dnl and <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
+  dnl 'gnu_inline'. See <https://sourceware.org/bugzilla/show_bug.cgi?id=4022>
+  dnl and <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=42440>. In summary,
   dnl glibc version 2.5 or older, together with gcc version 4.3 or newer and
   dnl the option -std=c99 or -std=gnu99, leads to a broken <wchar.h>.
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_CACHE_CHECK([whether <wchar.h> uses 'inline' correctly],
     [gl_cv_header_wchar_h_correct_inline],
     [gl_cv_header_wchar_h_correct_inline=yes
-     AC_LANG_CONFTEST([
-       AC_LANG_SOURCE([[#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(); }
-]])])
-     dnl Do not rename the object file from conftest.$ac_objext to
-     dnl conftest1.$ac_objext, as this will cause the link to fail on
-     dnl z/OS when using the XPLINK object format (due to duplicate
-     dnl CSECT names). Instead, temporarily redefine $ac_compile so
-     dnl that the object file has the latter name from the start.
-     save_ac_compile="$ac_compile"
-     ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
-     if AC_TRY_EVAL([ac_compile]); then
-       AC_LANG_CONFTEST([
-         AC_LANG_SOURCE([[#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; }
-]])])
-       dnl See note above about renaming object files.
-       ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
-       if AC_TRY_EVAL([ac_compile]); then
-         if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
-           :
-         else
-           gl_cv_header_wchar_h_correct_inline=no
+     case "$host_os" in
+       *-gnu* | gnu*)
+         AC_LANG_CONFTEST([
+           AC_LANG_SOURCE([[
+             #define wcstod renamed_wcstod
+             #include <wchar.h>
+             extern int zero (void);
+             int main () { return zero(); }
+           ]])])
+         dnl Do not rename the object file from conftest.$ac_objext to
+         dnl conftest1.$ac_objext, as this will cause the link to fail on
+         dnl z/OS when using the XPLINK object format (due to duplicate
+         dnl CSECT names). Instead, temporarily redefine $ac_compile so
+         dnl that the object file has the latter name from the start.
+         save_ac_compile="$ac_compile"
+         ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest1/`
+         if echo '#include "conftest.c"' >conftest1.c \
+            && AC_TRY_EVAL([ac_compile]); then
+           AC_LANG_CONFTEST([
+             AC_LANG_SOURCE([[
+               #define wcstod renamed_wcstod
+               #include <wchar.h>
+               int zero (void) { return 0; }
+             ]])])
+           dnl See note above about renaming object files.
+           ac_compile=`echo "$save_ac_compile" | sed s/conftest/conftest2/`
+           if echo '#include "conftest.c"' >conftest2.c \
+              && AC_TRY_EVAL([ac_compile]); then
+             if $CC -o conftest$ac_exeext $CFLAGS $LDFLAGS conftest1.$ac_objext conftest2.$ac_objext $LIBS >&AS_MESSAGE_LOG_FD 2>&1; then
+               :
+             else
+               gl_cv_header_wchar_h_correct_inline=no
+             fi
+           fi
          fi
-       fi
-     fi
-     ac_compile="$save_ac_compile"
-     rm -f conftest1.$ac_objext conftest2.$ac_objext conftest$ac_exeext
+         ac_compile="$save_ac_compile"
+         rm -f conftest[12].c conftest[12].$ac_objext conftest$ac_exeext
+         ;;
+     esac
     ])
   if test $gl_cv_header_wchar_h_correct_inline = no; then
     AC_MSG_ERROR([<wchar.h> cannot be used with this compiler ($CC $CFLAGS $CPPFLAGS).
@@ -120,63 +118,82 @@ This is a known interoperability problem of glibc <= 2.5 with gcc >= 4.3 in
 C99 mode. You have four options:
   - Add the flag -fgnu89-inline to CC and reconfigure, or
   - Fix your include files, using parts of
-    <http://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
+    <https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=b037a293a48718af30d706c2e18c929d0e69a621>, or
   - Use a gcc version older than 4.3, or
   - Don't use the flags -std=c99 or -std=gnu99.
 Configuration aborted.])
   fi
 ])
 
+# gl_WCHAR_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_WCHAR_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_WCHAR_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_WCHAR_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_BTOWC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTOB])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSINIT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRTOWC])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBRLEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSRTOWCS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MBSNRTOWCS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCRTOMB])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSRTOMBS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNRTOMBS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCWIDTH])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCHR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMCPY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMMOVE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMPCPY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WMEMSET])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSLEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNLEN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCPY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCPCPY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCPY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCPNCPY])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCAT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCASECMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSNCASECMP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCOLL])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSXFRM])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSDUP])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCHR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSRCHR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSCSPN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSSPN])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSPBRK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSSTR])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSTOK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSWIDTH])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCSFTIME])
+    dnl Support Microsoft deprecated alias function names by default.
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_MDA_WCSDUP], [1])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_WCHAR_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_WCHAR_H_DEFAULTS],
 [
-  GNULIB_BTOWC=0;       AC_SUBST([GNULIB_BTOWC])
-  GNULIB_WCTOB=0;       AC_SUBST([GNULIB_WCTOB])
-  GNULIB_MBSINIT=0;     AC_SUBST([GNULIB_MBSINIT])
-  GNULIB_MBRTOWC=0;     AC_SUBST([GNULIB_MBRTOWC])
-  GNULIB_MBRLEN=0;      AC_SUBST([GNULIB_MBRLEN])
-  GNULIB_MBSRTOWCS=0;   AC_SUBST([GNULIB_MBSRTOWCS])
-  GNULIB_MBSNRTOWCS=0;  AC_SUBST([GNULIB_MBSNRTOWCS])
-  GNULIB_WCRTOMB=0;     AC_SUBST([GNULIB_WCRTOMB])
-  GNULIB_WCSRTOMBS=0;   AC_SUBST([GNULIB_WCSRTOMBS])
-  GNULIB_WCSNRTOMBS=0;  AC_SUBST([GNULIB_WCSNRTOMBS])
-  GNULIB_WCWIDTH=0;     AC_SUBST([GNULIB_WCWIDTH])
-  GNULIB_WMEMCHR=0;     AC_SUBST([GNULIB_WMEMCHR])
-  GNULIB_WMEMCMP=0;     AC_SUBST([GNULIB_WMEMCMP])
-  GNULIB_WMEMCPY=0;     AC_SUBST([GNULIB_WMEMCPY])
-  GNULIB_WMEMMOVE=0;    AC_SUBST([GNULIB_WMEMMOVE])
-  GNULIB_WMEMSET=0;     AC_SUBST([GNULIB_WMEMSET])
-  GNULIB_WCSLEN=0;      AC_SUBST([GNULIB_WCSLEN])
-  GNULIB_WCSNLEN=0;     AC_SUBST([GNULIB_WCSNLEN])
-  GNULIB_WCSCPY=0;      AC_SUBST([GNULIB_WCSCPY])
-  GNULIB_WCPCPY=0;      AC_SUBST([GNULIB_WCPCPY])
-  GNULIB_WCSNCPY=0;     AC_SUBST([GNULIB_WCSNCPY])
-  GNULIB_WCPNCPY=0;     AC_SUBST([GNULIB_WCPNCPY])
-  GNULIB_WCSCAT=0;      AC_SUBST([GNULIB_WCSCAT])
-  GNULIB_WCSNCAT=0;     AC_SUBST([GNULIB_WCSNCAT])
-  GNULIB_WCSCMP=0;      AC_SUBST([GNULIB_WCSCMP])
-  GNULIB_WCSNCMP=0;     AC_SUBST([GNULIB_WCSNCMP])
-  GNULIB_WCSCASECMP=0;  AC_SUBST([GNULIB_WCSCASECMP])
-  GNULIB_WCSNCASECMP=0; AC_SUBST([GNULIB_WCSNCASECMP])
-  GNULIB_WCSCOLL=0;     AC_SUBST([GNULIB_WCSCOLL])
-  GNULIB_WCSXFRM=0;     AC_SUBST([GNULIB_WCSXFRM])
-  GNULIB_WCSDUP=0;      AC_SUBST([GNULIB_WCSDUP])
-  GNULIB_WCSCHR=0;      AC_SUBST([GNULIB_WCSCHR])
-  GNULIB_WCSRCHR=0;     AC_SUBST([GNULIB_WCSRCHR])
-  GNULIB_WCSCSPN=0;     AC_SUBST([GNULIB_WCSCSPN])
-  GNULIB_WCSSPN=0;      AC_SUBST([GNULIB_WCSSPN])
-  GNULIB_WCSPBRK=0;     AC_SUBST([GNULIB_WCSPBRK])
-  GNULIB_WCSSTR=0;      AC_SUBST([GNULIB_WCSSTR])
-  GNULIB_WCSTOK=0;      AC_SUBST([GNULIB_WCSTOK])
-  GNULIB_WCSWIDTH=0;    AC_SUBST([GNULIB_WCSWIDTH])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_BTOWC=1;         AC_SUBST([HAVE_BTOWC])
   HAVE_MBSINIT=1;       AC_SUBST([HAVE_MBSINIT])
@@ -191,6 +208,7 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
   HAVE_WMEMCMP=1;       AC_SUBST([HAVE_WMEMCMP])
   HAVE_WMEMCPY=1;       AC_SUBST([HAVE_WMEMCPY])
   HAVE_WMEMMOVE=1;      AC_SUBST([HAVE_WMEMMOVE])
+  HAVE_WMEMPCPY=1;      AC_SUBST([HAVE_WMEMPCPY])
   HAVE_WMEMSET=1;       AC_SUBST([HAVE_WMEMSET])
   HAVE_WCSLEN=1;        AC_SUBST([HAVE_WCSLEN])
   HAVE_WCSNLEN=1;       AC_SUBST([HAVE_WCSNLEN])
@@ -215,7 +233,9 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
   HAVE_WCSSTR=1;        AC_SUBST([HAVE_WCSSTR])
   HAVE_WCSTOK=1;        AC_SUBST([HAVE_WCSTOK])
   HAVE_WCSWIDTH=1;      AC_SUBST([HAVE_WCSWIDTH])
+  HAVE_WCSFTIME=1;      AC_SUBST([HAVE_WCSFTIME])
   HAVE_DECL_WCTOB=1;    AC_SUBST([HAVE_DECL_WCTOB])
+  HAVE_DECL_WCSDUP=1;   AC_SUBST([HAVE_DECL_WCSDUP])
   HAVE_DECL_WCWIDTH=1;  AC_SUBST([HAVE_DECL_WCWIDTH])
   REPLACE_MBSTATE_T=0;  AC_SUBST([REPLACE_MBSTATE_T])
   REPLACE_BTOWC=0;      AC_SUBST([REPLACE_BTOWC])
@@ -230,4 +250,6 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS],
   REPLACE_WCSNRTOMBS=0; AC_SUBST([REPLACE_WCSNRTOMBS])
   REPLACE_WCWIDTH=0;    AC_SUBST([REPLACE_WCWIDTH])
   REPLACE_WCSWIDTH=0;   AC_SUBST([REPLACE_WCSWIDTH])
+  REPLACE_WCSFTIME=0;   AC_SUBST([REPLACE_WCSFTIME])
+  REPLACE_WCSTOK=0;     AC_SUBST([REPLACE_WCSTOK])
 ])
index 2db8c3f..34db10e 100644 (file)
@@ -1,5 +1,5 @@
 # wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 267b3c9..cd96f11 100644 (file)
@@ -1,5 +1,5 @@
-# wcrtomb.m4 serial 11
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# wcrtomb.m4 serial 17
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -15,15 +15,8 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
   if test $ac_cv_func_wcrtomb = no; then
     HAVE_WCRTOMB=0
     AC_CHECK_DECLS([wcrtomb],,, [[
-/* 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 <wchar.h>
+    ]])
     if test $ac_cv_have_decl_wcrtomb = yes; then
       dnl On Minix 3.1.8, the system's <wchar.h> declares wcrtomb() although
       dnl it does not have the function. Avoid a collision with gnulib's
@@ -31,17 +24,56 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
       REPLACE_WCRTOMB=1
     fi
   else
-    if test $REPLACE_MBSTATE_T = 1; then
-      REPLACE_WCRTOMB=1
-    else
-      dnl On AIX 4.3, OSF/1 5.1 and Solaris 10, wcrtomb (NULL, 0, NULL) sometimes
-      dnl returns 0 instead of 1.
+    dnl We don't actually need to override wcrtomb when redefining the semantics
+    dnl of the mbstate_t type. Tested on 32-bit AIX.
+    dnl if test $REPLACE_MBSTATE_T = 1; then
+    dnl   REPLACE_WCRTOMB=1
+    dnl fi
+    if test $REPLACE_WCRTOMB = 0; then
+      dnl On Android 4.3, wcrtomb produces wrong characters in the C locale.
+      dnl On AIX 4.3, OSF/1 5.1 and Solaris <= 11.3, wcrtomb (NULL, 0, NULL)
+      dnl sometimes returns 0 instead of 1.
       AC_REQUIRE([AC_PROG_CC])
       AC_REQUIRE([gt_LOCALE_FR])
       AC_REQUIRE([gt_LOCALE_FR_UTF8])
       AC_REQUIRE([gt_LOCALE_JA])
       AC_REQUIRE([gt_LOCALE_ZH_CN])
       AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+      AC_CACHE_CHECK([whether wcrtomb works in the C locale],
+        [gl_cv_func_wcrtomb_works],
+        [AC_RUN_IFELSE(
+           [AC_LANG_SOURCE([[
+#include <string.h>
+#include <stdlib.h>
+#include <wchar.h>
+int main ()
+{
+  mbstate_t state;
+  char out[64];
+  int count;
+  memset (&state, 0, sizeof (state));
+  out[0] = 'x';
+  count = wcrtomb (out, L'a', &state);
+  return !(count == 1 && out[0] == 'a');
+}]])],
+           [gl_cv_func_wcrtomb_works=yes],
+           [gl_cv_func_wcrtomb_works=no],
+           [case "$host_os" in
+                               # Guess no on Android.
+              linux*-android*) gl_cv_func_wcrtomb_works="guessing no";;
+                               # Guess yes otherwise.
+              *)               gl_cv_func_wcrtomb_works="guessing yes";;
+            esac
+           ])
+        ])
+      case "$gl_cv_func_wcrtomb_works" in
+        *yes) ;;
+        *) AC_DEFINE([WCRTOMB_C_LOCALE_BUG], [1],
+             [Define if the wcrtomb function does not work in the C locale.])
+           REPLACE_WCRTOMB=1 ;;
+      esac
+    fi
+    if test $REPLACE_WCRTOMB = 0; then
       AC_CACHE_CHECK([whether wcrtomb return value is correct],
         [gl_cv_func_wcrtomb_retval],
         [
@@ -49,10 +81,10 @@ AC_DEFUN([gl_FUNC_WCRTOMB],
           dnl is present.
 changequote(,)dnl
           case "$host_os" in
-                                     # Guess no on AIX 4, OSF/1 and Solaris.
-            aix4* | osf* | solaris*) gl_cv_func_wcrtomb_retval="guessing no" ;;
-                                     # Guess yes otherwise.
-            *)                       gl_cv_func_wcrtomb_retval="guessing yes" ;;
+            # Guess no on AIX 4, OSF/1, Solaris, native Windows.
+            aix4* | osf* | solaris* | mingw*) gl_cv_func_wcrtomb_retval="guessing no" ;;
+            # Guess yes otherwise.
+            *)                                gl_cv_func_wcrtomb_retval="guessing yes" ;;
           esac
 changequote([,])dnl
           if test $LOCALE_FR != none || test $LOCALE_FR_UTF8 != none || test $LOCALE_JA != none || test $LOCALE_ZH_CN != none; then
@@ -60,14 +92,8 @@ changequote([,])dnl
               [AC_LANG_SOURCE([[
 #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>
+#include <stdlib.h>
 int main ()
 {
   int result = 0;
@@ -80,6 +106,12 @@ int main ()
     {
       if (wcrtomb (NULL, 0, NULL) != 1)
         result |= 2;
+      {
+        wchar_t wc = (wchar_t) 0xBADFACE;
+        if (mbtowc (&wc, "\303\274", 2) == 2)
+          if (wcrtomb (NULL, wc, NULL) != 1)
+            result |= 2;
+      }
     }
   if (setlocale (LC_ALL, "$LOCALE_JA") != NULL)
     {
@@ -100,7 +132,9 @@ int main ()
         ])
       case "$gl_cv_func_wcrtomb_retval" in
         *yes) ;;
-        *) REPLACE_WCRTOMB=1 ;;
+        *) AC_DEFINE([WCRTOMB_RETVAL_BUG], [1],
+             [Define if the wcrtomb function has an incorrect return value.])
+           REPLACE_WCRTOMB=1 ;;
       esac
     fi
   fi
index bdb5299..159b609 100644 (file)
@@ -1,5 +1,5 @@
-# wctob.m4 serial 10
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# wctob.m4 serial 13
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -17,7 +17,7 @@ AC_DEFUN([gl_FUNC_WCTOB],
 
     dnl Solaris 9 has the wctob() function but it does not work.
     dnl Cygwin 1.7.2 has the wctob() function but it clobbers caller-owned
-    dnl registers, see <http://cygwin.com/ml/cygwin/2010-05/msg00015.html>.
+    dnl registers, see <https://cygwin.com/ml/cygwin/2010-05/msg00015.html>.
     AC_REQUIRE([AC_PROG_CC])
     AC_REQUIRE([gt_LOCALE_FR])
     AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
@@ -31,6 +31,9 @@ changequote(,)dnl
             # Guess no on Solaris <= 9 and Cygwin.
           solaris2.[1-9] | solaris2.[1-9].* | cygwin*)
             gl_cv_func_wctob_works="guessing no" ;;
+            # Guess no on native Windows.
+          mingw*)
+            gl_cv_func_wctob_works="guessing no" ;;
             # Guess yes otherwise.
           *) gl_cv_func_wctob_works="guessing yes" ;;
         esac
@@ -40,13 +43,6 @@ changequote([,])dnl
             AC_RUN_IFELSE(
               [AC_LANG_SOURCE([[
 #include <locale.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>
 
 register long global __asm__ ("%ebx");
@@ -71,14 +67,7 @@ int main ()
           AC_RUN_IFELSE(
             [AC_LANG_SOURCE([[
 #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 <stdlib.h>
 #include <wchar.h>
 int main ()
 {
@@ -105,15 +94,8 @@ int main ()
 
       dnl IRIX 6.5 has the wctob() function but does not declare it.
       AC_CHECK_DECLS([wctob], [], [], [[
-/* 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 <wchar.h>
+      ]])
       if test $ac_cv_have_decl_wctob != yes; then
         HAVE_DECL_WCTOB=0
       fi
index 7c8b3ef..2da8b26 100644 (file)
@@ -1,5 +1,5 @@
 # wctomb.m4 serial 2
-dnl Copyright (C) 2011-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2011-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index accc001..7d74212 100644 (file)
@@ -1,15 +1,15 @@
-# wctype_h.m4 serial 18
+# wctype_h.m4 serial 30
 
 dnl A placeholder for ISO C99 <wctype.h>, for platforms that lack it.
 
-dnl Copyright (C) 2006-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 
 dnl Written by Paul Eggert.
 
-AC_DEFUN([gl_WCTYPE_H],
+AC_DEFUN_ONCE([gl_WCTYPE_H],
 [
   AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
   AC_REQUIRE([AC_PROG_CC])
@@ -30,6 +30,8 @@ AC_DEFUN([gl_WCTYPE_H],
   fi
   AC_SUBST([HAVE_WINT_T])
 
+  AC_REQUIRE([gl_TYPE_WINT_T_PREREQ])
+
   gl_CHECK_NEXT_HEADERS([wctype.h])
   if test $ac_cv_header_wctype_h = yes; then
     if test $ac_cv_func_iswcntrl = yes; then
@@ -39,22 +41,16 @@ AC_DEFUN([gl_WCTYPE_H],
         [
           AC_RUN_IFELSE(
             [AC_LANG_SOURCE([[
-               /* 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; }
             ]])],
             [gl_cv_func_iswcntrl_works=yes], [gl_cv_func_iswcntrl_works=no],
-            [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
+            [dnl Guess no on Linux libc5, yes otherwise.
+             AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdlib.h>
                           #if __GNU_LIBRARY__ == 1
                           Linux libc5 i18n is broken.
-                          #endif]], [])],
+                          #endif]], [[]])],
               [gl_cv_func_iswcntrl_works="guessing yes"],
               [gl_cv_func_iswcntrl_works="guessing no"])
             ])
@@ -66,10 +62,14 @@ AC_DEFUN([gl_WCTYPE_H],
   fi
   AC_SUBST([HAVE_WCTYPE_H])
 
-  case "$gl_cv_func_iswcntrl_works" in
-    *yes) REPLACE_ISWCNTRL=0 ;;
-    *)    REPLACE_ISWCNTRL=1 ;;
-  esac
+  if test $GNULIBHEADERS_OVERRIDE_WINT_T = 1; then
+    REPLACE_ISWCNTRL=1
+  else
+    case "$gl_cv_func_iswcntrl_works" in
+      *yes) REPLACE_ISWCNTRL=0 ;;
+      *)    REPLACE_ISWCNTRL=1 ;;
+    esac
+  fi
   AC_SUBST([REPLACE_ISWCNTRL])
 
   if test $HAVE_ISWCNTRL = 0 || test $REPLACE_ISWCNTRL = 1; then
@@ -85,14 +85,7 @@ AC_DEFUN([gl_WCTYPE_H],
       REPLACE_TOWLOWER=0
     else
       AC_CHECK_DECLS([towlower],,,
-        [[/* 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 <wchar.h>
           #if HAVE_WCTYPE_H
           # include <wctype.h>
           #endif
@@ -121,14 +114,7 @@ AC_DEFUN([gl_WCTYPE_H],
   AC_CACHE_CHECK([for wctype_t], [gl_cv_type_wctype_t],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
-          [[/* 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 <wchar.h>
             #if HAVE_WCTYPE_H
             # include <wctype.h>
             #endif
@@ -147,14 +133,7 @@ AC_DEFUN([gl_WCTYPE_H],
   AC_CACHE_CHECK([for wctrans_t], [gl_cv_type_wctrans_t],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
-          [[/* 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 <wchar.h>
             #include <wctype.h>
             wctrans_t a;
           ]],
@@ -169,14 +148,7 @@ AC_DEFUN([gl_WCTYPE_H],
   dnl Check for declarations of anything we want to poison if the
   dnl corresponding gnulib module is not in use.
   gl_WARN_ON_USE_PREPARE([[
-/* 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>
@@ -185,25 +157,44 @@ AC_DEFUN([gl_WCTYPE_H],
     ])
 ])
 
+# gl_WCTYPE_MODULE_INDICATOR([modulename])
+# sets the shell variable that indicates the presence of the given module
+# to a C preprocessor expression that will evaluate to 1.
+# This macro invocation must not occur in macros that are AC_REQUIREd.
 AC_DEFUN([gl_WCTYPE_MODULE_INDICATOR],
 [
-  dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
-  AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+  dnl Ensure to expand the default settings once only.
+  gl_WCTYPE_H_REQUIRE_DEFAULTS
   gl_MODULE_INDICATOR_SET_VARIABLE([$1])
   dnl Define it also as a C macro, for the benefit of the unit tests.
   gl_MODULE_INDICATOR_FOR_TESTS([$1])
 ])
 
+# Initializes the default values for AC_SUBSTed shell variables.
+# This macro must not be AC_REQUIREd.  It must only be invoked, and only
+# outside of macros or in macros that are not AC_REQUIREd.
+AC_DEFUN([gl_WCTYPE_H_REQUIRE_DEFAULTS],
+[
+  m4_defun(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS], [
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWBLANK])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWDIGIT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWXDIGIT])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTYPE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_ISWCTYPE])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_WCTRANS])
+    gl_MODULE_INDICATOR_INIT_VARIABLE([GNULIB_TOWCTRANS])
+  ])
+  m4_require(GL_MODULE_INDICATOR_PREFIX[_WCTYPE_H_MODULE_INDICATOR_DEFAULTS])
+  AC_REQUIRE([gl_WCTYPE_H_DEFAULTS])
+])
+
 AC_DEFUN([gl_WCTYPE_H_DEFAULTS],
 [
-  GNULIB_ISWBLANK=0;    AC_SUBST([GNULIB_ISWBLANK])
-  GNULIB_WCTYPE=0;      AC_SUBST([GNULIB_WCTYPE])
-  GNULIB_ISWCTYPE=0;    AC_SUBST([GNULIB_ISWCTYPE])
-  GNULIB_WCTRANS=0;     AC_SUBST([GNULIB_WCTRANS])
-  GNULIB_TOWCTRANS=0;   AC_SUBST([GNULIB_TOWCTRANS])
   dnl Assume proper GNU behavior unless another module says otherwise.
   HAVE_ISWBLANK=1;      AC_SUBST([HAVE_ISWBLANK])
   HAVE_WCTYPE_T=1;      AC_SUBST([HAVE_WCTYPE_T])
   HAVE_WCTRANS_T=1;     AC_SUBST([HAVE_WCTRANS_T])
   REPLACE_ISWBLANK=0;   AC_SUBST([REPLACE_ISWBLANK])
+  REPLACE_ISWDIGIT=0;   AC_SUBST([REPLACE_ISWDIGIT])
+  REPLACE_ISWXDIGIT=0;  AC_SUBST([REPLACE_ISWXDIGIT])
 ])
diff --git a/m4/wcwidth.m4 b/m4/wcwidth.m4
new file mode 100644 (file)
index 0000000..2ac2a51
--- /dev/null
@@ -0,0 +1,115 @@
+# wcwidth.m4 serial 34
+dnl Copyright (C) 2006-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_FUNC_WCWIDTH],
+[
+  AC_REQUIRE([gl_WCHAR_H_DEFAULTS])
+  AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles
+
+  dnl Persuade glibc <wchar.h> to declare wcwidth().
+  AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
+
+  AC_REQUIRE([gt_TYPE_WCHAR_T])
+  AC_REQUIRE([gt_TYPE_WINT_T])
+
+  AC_CHECK_HEADERS_ONCE([wchar.h])
+  AC_CHECK_FUNCS_ONCE([wcwidth])
+
+  AC_CHECK_DECLS([wcwidth], [], [], [[
+    #include <wchar.h>
+  ]])
+  if test $ac_cv_have_decl_wcwidth != yes; then
+    HAVE_DECL_WCWIDTH=0
+  fi
+
+  if test $ac_cv_func_wcwidth != yes; then
+    AC_CACHE_CHECK([whether wcwidth is a macro],
+      [gl_cv_func_wcwidth_macro],
+      [AC_EGREP_CPP([wchar_header_defines_wcwidth], [
+#include <wchar.h>
+#ifdef wcwidth
+ wchar_header_defines_wcwidth
+#endif],
+         [gl_cv_func_wcwidth_macro=yes],
+         [gl_cv_func_wcwidth_macro=no])
+      ])
+  fi
+
+  if test $ac_cv_func_wcwidth = yes || test $gl_cv_func_wcwidth_macro = yes; then
+    HAVE_WCWIDTH=1
+    dnl On Mac OS X 10.3, wcwidth(0x0301) (COMBINING ACUTE ACCENT) returns 1.
+    dnl On NetBSD 9.0, OpenBSD 5.0, MidnightBSD 1.1,
+    dnl wcwidth(0x05B0) (HEBREW POINT SHEVA) returns 1.
+    dnl On NetBSD 9.0, MidnightBSD 1.1, OSF/1 5.1,
+    dnl wcwidth(0x200B) (ZERO WIDTH SPACE) returns 1.
+    dnl On OpenBSD 5.8, wcwidth(0xFF1A) (FULLWIDTH COLON) returns 0.
+    dnl This leads to bugs in 'ls' (coreutils).
+    dnl On Solaris 11.4, wcwidth(0x2202) (PARTIAL DIFFERENTIAL) returns 2,
+    dnl even in Western locales.
+    AC_CACHE_CHECK([whether wcwidth works reasonably in UTF-8 locales],
+      [gl_cv_func_wcwidth_works],
+      [
+        AC_RUN_IFELSE(
+          [AC_LANG_SOURCE([[
+#include <locale.h>
+#include <wchar.h>
+#if !HAVE_DECL_WCWIDTH
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int wcwidth (int);
+#endif
+int main ()
+{
+  int result = 0;
+  if (setlocale (LC_ALL, "en_US.UTF-8") != NULL)
+    {
+      if (wcwidth (0x0301) > 0)
+        result |= 1;
+      if (wcwidth (0x05B0) > 0)
+        result |= 2;
+      if (wcwidth (0x200B) > 0)
+        result |= 4;
+      if (wcwidth (0xFF1A) == 0)
+        result |= 8;
+      if (wcwidth (0x2202) > 1)
+        result |= 16;
+    }
+  return result;
+}]])],
+          [gl_cv_func_wcwidth_works=yes],
+          [gl_cv_func_wcwidth_works=no],
+          [
+changequote(,)dnl
+           case "$host_os" in
+                            # Guess yes on glibc systems.
+             *-gnu* | gnu*) gl_cv_func_wcwidth_works="guessing yes";;
+                            # Guess yes on musl systems.
+             *-musl*)       gl_cv_func_wcwidth_works="guessing yes";;
+                            # Guess yes on AIX 7 systems.
+             aix[7-9]*)     gl_cv_func_wcwidth_works="guessing yes";;
+             *)             gl_cv_func_wcwidth_works="$gl_cross_guess_normal";;
+           esac
+changequote([,])dnl
+          ])
+      ])
+    case "$gl_cv_func_wcwidth_works" in
+      *yes) ;;
+      *no) REPLACE_WCWIDTH=1 ;;
+    esac
+  else
+    HAVE_WCWIDTH=0
+  fi
+  dnl We don't substitute HAVE_WCWIDTH. We assume that if the system does not
+  dnl have the wcwidth function, then it does not declare it.
+])
+
+# Prerequisites of lib/wcwidth.c.
+AC_DEFUN([gl_PREREQ_WCWIDTH], [
+  AC_REQUIRE([AC_C_INLINE])
+  :
+])
index 59b22bf..a49c508 100644 (file)
@@ -1,5 +1,5 @@
-# wint_t.m4 serial 6
-dnl Copyright (C) 2003, 2007-2016 Free Software Foundation, Inc.
+# wint_t.m4 serial 11
+dnl Copyright (C) 2003, 2007-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,7 @@ AC_DEFUN([gt_TYPE_WINT_T],
   AC_CACHE_CHECK([for wint_t], [gt_cv_c_wint_t],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
-          [[
-/* 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 <wchar.h>
             wint_t foo = (wchar_t)'\0';]],
           [[]])],
        [gt_cv_c_wint_t=yes],
@@ -32,31 +24,34 @@ AC_DEFUN([gt_TYPE_WINT_T],
 
     dnl Determine whether gnulib's <wchar.h> or <wctype.h> would, if present,
     dnl override 'wint_t'.
-    AC_CACHE_CHECK([whether wint_t is too small],
-      [gl_cv_type_wint_t_too_small],
+    AC_CACHE_CHECK([whether wint_t is large enough],
+      [gl_cv_type_wint_t_large_enough],
       [AC_COMPILE_IFELSE(
-           [AC_LANG_PROGRAM([[
-/* 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>
-#endif
-#include <wchar.h>
+         [AC_LANG_PROGRAM(
+            [[#include <wchar.h>
               int verify[sizeof (wint_t) < sizeof (int) ? -1 : 1];
-              ]])],
-           [gl_cv_type_wint_t_too_small=no],
-           [gl_cv_type_wint_t_too_small=yes])])
-    if test $gl_cv_type_wint_t_too_small = yes; then
-      GNULIB_OVERRIDES_WINT_T=1
+            ]])],
+         [gl_cv_type_wint_t_large_enough=yes],
+         [gl_cv_type_wint_t_large_enough=no])])
+    if test $gl_cv_type_wint_t_large_enough = no; then
+      GNULIBHEADERS_OVERRIDE_WINT_T=1
     else
-      GNULIB_OVERRIDES_WINT_T=0
+      GNULIBHEADERS_OVERRIDE_WINT_T=0
     fi
   else
-    GNULIB_OVERRIDES_WINT_T=0
+    GNULIBHEADERS_OVERRIDE_WINT_T=0
   fi
-  AC_SUBST([GNULIB_OVERRIDES_WINT_T])
+  AC_SUBST([GNULIBHEADERS_OVERRIDE_WINT_T])
+])
+
+dnl Prerequisites of the 'wint_t' override.
+AC_DEFUN([gl_TYPE_WINT_T_PREREQ],
+[
+  AC_CHECK_HEADERS_ONCE([crtdefs.h])
+  if test $ac_cv_header_crtdefs_h = yes; then
+    HAVE_CRTDEFS_H=1
+  else
+    HAVE_CRTDEFS_H=0
+  fi
+  AC_SUBST([HAVE_CRTDEFS_H])
 ])
index d9b93f9..84400c5 100644 (file)
@@ -1,5 +1,5 @@
-# write.m4 serial 5
-dnl Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# write.m4 serial 6
+dnl Copyright (C) 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -7,10 +7,12 @@ dnl with or without modifications, as long as this notice is preserved.
 AC_DEFUN([gl_FUNC_WRITE],
 [
   AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
-  AC_REQUIRE([gl_MSVC_INVAL])
-  if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
-    REPLACE_WRITE=1
-  fi
+  m4_ifdef([gl_MSVC_INVAL], [
+    AC_REQUIRE([gl_MSVC_INVAL])
+    if test $HAVE_MSVC_INVALID_PARAMETER_HANDLER = 1; then
+      REPLACE_WRITE=1
+    fi
+  ])
   dnl This ifdef is just an optimization, to avoid performing a configure
   dnl check whose result is not used. It does not make the test of
   dnl GNULIB_UNISTD_H_SIGPIPE or GNULIB_SIGPIPE redundant.
index f4f540d..8fabf1c 100644 (file)
@@ -1,5 +1,5 @@
 # xalloc.m4 serial 18
-dnl Copyright (C) 2002-2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 16764e8..64e8a4f 100644 (file)
@@ -1,5 +1,5 @@
 # xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index 3511c80..cb05307 100644 (file)
@@ -1,5 +1,5 @@
 # xstrndup.m4 serial 2
-dnl Copyright (C) 2003, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
index dd01142..20a1a06 100644 (file)
@@ -1,5 +1,5 @@
 # xvasprintf.m4 serial 2
-dnl Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
diff --git a/m4/yield.m4 b/m4/yield.m4
new file mode 100644 (file)
index 0000000..97bbf38
--- /dev/null
@@ -0,0 +1,18 @@
+# yield.m4 serial 4
+dnl Copyright (C) 2005-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_YIELD],
+[
+  AC_REQUIRE([gl_PTHREADLIB])
+  AC_REQUIRE([gl_THREADLIB])
+
+  if test $gl_threads_api = posix; then
+    YIELD_LIB="$LIB_SCHED_YIELD"
+  else
+    YIELD_LIB=
+  fi
+  AC_SUBST([YIELD_LIB])
+])
diff --git a/m4/zzgnulib.m4 b/m4/zzgnulib.m4
new file mode 100644 (file)
index 0000000..b953384
--- /dev/null
@@ -0,0 +1,23 @@
+# zzgnulib.m4 serial 1
+dnl Copyright (C) 2020-2021 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This file must be named something that sorts after all other
+dnl package- or gnulib-provided .m4 files - at least for those packages
+dnl that redefine AC_PROG_CC.
+
+dnl Redefine AC_PROG_CC so that it ends with invocations of gl_COMPILER_CLANG
+dnl and gl_COMPILER_PREPARE_CHECK_DECL.
+m4_define([AC_PROG_CC],
+  m4_defn([AC_PROG_CC])[
+gl_COMPILER_CLANG
+gl_COMPILER_PREPARE_CHECK_DECL
+])
+
+# gl_ZZGNULIB
+# -----------
+# Witness macro that this file has been included.  Needed to force
+# Automake to include this file after all other gnulib .m4 files.
+AC_DEFUN([gl_ZZGNULIB])
index 46aea9b..ae3a817 100644 (file)
--- a/maint.mk
+++ b/maint.mk
@@ -2,7 +2,7 @@
 # This Makefile fragment tries to be general-purpose enough to be
 # used by many projects via the gnulib maintainer-makefile module.
 
-## Copyright (C) 2001-2016 Free Software Foundation, Inc.
+## Copyright (C) 2001-2021 Free Software Foundation, Inc.
 ##
 ## This program is free software: you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published by
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # This is reported not to work with make-3.79.1
 # ME := $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
 ME := maint.mk
 
+# These variables ought to be defined through the configure.ac section
+# of the module description. But some packages import this file directly,
+# ignoring the module description.
+AWK ?= awk
+GREP ?= grep
+SED ?= sed
+
 # Helper variables.
 _empty =
 _sp = $(_empty) $(_empty)
@@ -46,7 +53,7 @@ member-check =                                                                \
 # Do not save the original name or timestamp in the .tar.gz file.
 # Use --rsyncable if available.
 gzip_rsyncable := \
-  $(shell gzip --help 2>/dev/null|grep rsyncable >/dev/null \
+  $(shell gzip --help 2>/dev/null|$(GREP) rsyncable >/dev/null \
     && printf %s --rsyncable)
 GZIP_ENV = '--no-name --best $(gzip_rsyncable)'
 
@@ -57,7 +64,11 @@ VC_LIST = $(srcdir)/$(_build-aux)/vc-list-files -C $(srcdir)
 
 # You can override this variable in cfg.mk if your gnulib submodule lives
 # in a different location.
-gnulib_dir ?= $(srcdir)/gnulib
+gnulib_dir ?= $(shell if test -d $(srcdir)/gnulib; then \
+                       echo $(srcdir)/gnulib; \
+               else \
+                       echo ${GNULIB_SRCDIR}; \
+               fi)
 
 # You can override this variable in cfg.mk to set your own regexp
 # matching files to ignore.
@@ -83,9 +94,9 @@ _sc_excl = \
   $(or $(exclude_file_name_regexp--$@),^$$)
 VC_LIST_EXCEPT = \
   $(VC_LIST) | $(SED) 's|^$(_dot_escaped_srcdir)/||' \
-       | if test -f $(srcdir)/.x-$@; then grep -vEf $(srcdir)/.x-$@; \
-         else grep -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
-       | grep -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
+       | if test -f $(srcdir)/.x-$@; then $(GREP) -vEf $(srcdir)/.x-$@; \
+         else $(GREP) -Ev -e "$${VC_LIST_EXCEPT_DEFAULT-ChangeLog}"; fi \
+       | $(GREP) -Ev -e '($(VC_LIST_ALWAYS_EXCLUDE_REGEX)|$(_sc_excl))' \
        $(_prepend_srcdir_prefix)
 
 ifeq ($(origin prev_version_file), undefined)
@@ -130,8 +141,8 @@ gnu_ftp_host-stable = ftp.gnu.org
 gnu_rel_host ?= $(gnu_ftp_host-$(release-type))
 
 url_dir_list ?= $(if $(call _equal,$(gnu_rel_host),ftp.gnu.org),       \
-                     http://ftpmirror.gnu.org/$(PACKAGE),              \
-                     ftp://$(gnu_rel_host)/gnu/$(PACKAGE))
+                     https://ftpmirror.gnu.org/$(PACKAGE),             \
+                     https://$(gnu_rel_host)/gnu/$(PACKAGE))
 
 # Override this in cfg.mk if you are using a different format in your
 # NEWS file.
@@ -156,7 +167,7 @@ ifneq ($(_gl-Makefile),)
 _cfg_mk := $(wildcard $(srcdir)/cfg.mk)
 
 # Collect the names of rules starting with 'sc_'.
-syntax-check-rules := $(sort $(shell $(SED) -n \
+syntax-check-rules := $(sort $(shell env LC_ALL=C $(SED) -n \
    's/^\(sc_[a-zA-Z0-9_-]*\):.*/\1/p' $(srcdir)/$(ME) $(_cfg_mk)))
 .PHONY: $(syntax-check-rules)
 
@@ -184,7 +195,7 @@ $(sc_z_rules_): %.z: %
        @end=$$(date +%s.%N);                                           \
        start=$$(cat .sc-start-$*);                                     \
        rm -f .sc-start-$*;                                             \
-       awk -v s=$$start -v e=$$end                                     \
+       $(AWK) -v s=$$start -v e=$$end                                  \
          'END {printf "%.2f $(patsubst sc_%,%,$*)\n", e - s}' < /dev/null
 
 # The patsubst here is to replace each sc_% rule with its sc_%.z wrapper
@@ -292,42 +303,56 @@ define _sc_search_regexp
                                                                        \
    : Filter by file name;                                              \
    if test -n "$$in_files"; then                                       \
-     files=$$(find $(srcdir) | grep -E "$$in_files"                    \
-              | grep -Ev '$(_sc_excl)');                               \
+     files=$$(find $(srcdir) | $(GREP) -E "$$in_files"                 \
+              | $(GREP) -Ev '$(_sc_excl)');                            \
    else                                                                        \
      files=$$($(VC_LIST_EXCEPT));                                      \
      if test -n "$$in_vc_files"; then                                  \
-       files=$$(echo "$$files" | grep -E "$$in_vc_files");             \
+       files=$$(echo "$$files" | $(GREP) -E "$$in_vc_files");          \
      fi;                                                               \
    fi;                                                                 \
                                                                        \
    : Filter by content;                                                        \
-   test -n "$$files" && test -n "$$containing"                         \
-     && { files=$$(grep -l "$$containing" $$files); } || :;            \
-   test -n "$$files" && test -n "$$non_containing"                     \
-     && { files=$$(grep -vl "$$non_containing" $$files); } || :;       \
+   test -n "$$files"                                                   \
+     && test -n "$$containing"                                         \
+     && { files=$$(echo "$$files" | xargs $(GREP) -l "$$containing"); }        \
+     || :;                                                             \
+   test -n "$$files"                                                   \
+     && test -n "$$non_containing"                                     \
+     && { files=$$(echo "$$files" | xargs $(GREP) -vl "$$non_containing"); } \
+     || :;                                                             \
                                                                        \
    : Check for the construct;                                          \
    if test -n "$$files"; then                                          \
      if test -n "$$prohibit"; then                                     \
-       grep $$with_grep_options $(_ignore_case) -nE "$$prohibit" $$files \
-         | grep -vE "$${exclude:-^$$}"                                 \
-         && { msg="$$halt" $(_sc_say_and_exit) } || :;                 \
+       echo "$$files"                                                  \
+         | xargs $(GREP) $$with_grep_options $(_ignore_case) -nE       \
+               "$$prohibit" /dev/null                                  \
+         | $(GREP) -vE "$${exclude:-^$$}"                              \
+         && { msg="$$halt" $(_sc_say_and_exit) }                       \
+         || :;                                                         \
      else                                                              \
-       grep $$with_grep_options $(_ignore_case) -LE "$$require" $$files \
-           | grep .                                                    \
-         && { msg="$$halt" $(_sc_say_and_exit) } || :;                 \
+       echo "$$files"                                                  \
+         | xargs                                                       \
+             $(GREP) $$with_grep_options $(_ignore_case) -LE "$$require" \
+         | $(GREP) .                                                   \
+         && { msg="$$halt" $(_sc_say_and_exit) }                       \
+         || :;                                                         \
      fi                                                                        \
    else :;                                                             \
    fi || :;
 endef
 
 sc_avoid_if_before_free:
-       @$(srcdir)/$(_build-aux)/useless-if-before-free                 \
-               $(useless_free_options)                                 \
-           $$($(VC_LIST_EXCEPT) | grep -v useless-if-before-free) &&   \
-         { echo '$(ME): found useless "if" before "free" above' 1>&2;  \
-           exit 1; } || :
+       @$(VC_LIST_EXCEPT)                                              \
+         | $(GREP) -v useless-if-before-free                           \
+         | xargs                                                       \
+             $(srcdir)/$(_build-aux)/useless-if-before-free            \
+             $(useless_free_options)                                   \
+         && { printf '$(ME): found useless "if"'                       \
+                     ' before "free" above\n' 1>&2;                    \
+              exit 1; }                                                \
+         || :
 
 sc_cast_of_argument_to_free:
        @prohibit='\<free *\( *\(' halt="don't cast free argument"      \
@@ -388,6 +413,43 @@ sc_prohibit_magic_number_exit:
        halt='use EXIT_* values rather than magic number'               \
          $(_sc_search_regexp)
 
+# Check that we don't use $< in non-implicit Makefile rules.
+#
+# To find the Makefiles, trace AC_CONFIG_FILES.  Using VC_LIST would
+# miss the Makefiles that are not under VC control (e.g., symlinks
+# installed for gettext).  "Parsing" (recursive) uses of SUBDIRS seems
+# too delicate.
+#
+# Use GNU Make's --print-data-base to normalize the rules into some
+# easy to parse format: they are separated by two \n.  Look for the
+# "section" about non-pattern rules (marked with "# Files") inside
+# which there are still the POSIX Make like implicit rules (".c.o").
+sc_prohibit_gnu_make_extensions_awk_ =                                 \
+  BEGIN {                                                              \
+      RS = "\n\n";                                                     \
+      in_rules = 0;                                                    \
+  }                                                                    \
+  /^\# Files/ {                                                                \
+      in_rules = 1;                                                    \
+  }                                                                    \
+  /\$$</ && in_rules && $$0 !~ /^(.*\n)*\.\w+(\.\w+)?:/ {              \
+      print "Error: " file ": $$< in a non implicit rule\n" $$0;       \
+      status = 1;                                                      \
+  }                                                                    \
+  END {                                                                        \
+     exit status;                                                      \
+  }
+sc_prohibit_gnu_make_extensions:
+       @if $(AWK) --version | grep GNU >/dev/null 2>&1; then           \
+         (cd $(srcdir) && autoconf --trace AC_CONFIG_FILES:'$$1') |    \
+           tr ' ' '\n' |                                               \
+           $(SED) -ne '/Makefile/{s/\.in$$//;p;}' |                    \
+           while read m; do                                            \
+             $(MAKE) -qp -f $$m .DUMMY-TARGET 2>/dev/null |            \
+               $(AWK) -v file=$$m -e '$($@_awk_)' || exit 1;           \
+           done;                                                       \
+       fi
+
 # Using EXIT_SUCCESS as the first argument to error is misleading,
 # since when that parameter is 0, error does not exit.  Use '0' instead.
 sc_error_exit_success:
@@ -399,28 +461,35 @@ sc_error_exit_success:
 # "FATAL:" should be fully upper-cased in error messages
 # "WARNING:" should be fully upper-cased, or fully lower-cased
 sc_error_message_warn_fatal:
-       @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))              \
-           | grep -E '"Warning|"Fatal|"fatal' &&                       \
-         { echo '$(ME): use FATAL, WARNING or warning' 1>&2;           \
-           exit 1; } || :
+       @$(VC_LIST_EXCEPT)                                              \
+         | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null              \
+         | $(GREP) -E '"Warning|"Fatal|"fatal'                         \
+         && { echo '$(ME): use FATAL, WARNING or warning' 1>&2;        \
+              exit 1; }                                                \
+         || :
 
 # Error messages should not start with a capital letter
 sc_error_message_uppercase:
-       @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))              \
-           | grep -E '"[A-Z]'                                          \
-           | grep -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX' &&           \
-         { echo '$(ME): found capitalized error message' 1>&2;         \
-           exit 1; } || :
+       @$(VC_LIST_EXCEPT)                                              \
+         | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null              \
+         | $(GREP) -E '"[A-Z]'                                         \
+         | $(GREP) -vE '"FATAL|"WARNING|"Java|"C#|PRIuMAX'             \
+         && { echo '$(ME): found capitalized error message' 1>&2;      \
+              exit 1; }                                                \
+         || :
 
 # Error messages should not end with a period
 sc_error_message_period:
-       @grep -nEA2 '[^rp]error *\(' $$($(VC_LIST_EXCEPT))              \
-           | grep -E '[^."]\."' &&                                     \
-         { echo '$(ME): found error message ending in period' 1>&2;    \
-           exit 1; } || :
+       @$(VC_LIST_EXCEPT)                                              \
+         | xargs $(GREP) -nEA2 '[^rp]error *\(' /dev/null              \
+         | $(GREP) -E '[^."]\."'                                       \
+         && { echo '$(ME): found error message ending in period' 1>&2; \
+              exit 1; }                                                \
+         || :
 
 sc_file_system:
        @prohibit=file''system                                          \
+       exclude='/proc/filesystems'                                     \
        ignore_case=1                                                   \
        halt='found use of "file''system"; spell it "file system"'      \
          $(_sc_search_regexp)
@@ -458,8 +527,8 @@ perl_config_h_first_ =                                                      \
 # You must include <config.h> before including any other header file.
 # This can possibly be via a package-specific header, if given by cfg.mk.
 sc_require_config_h_first:
-       @if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then          \
-         files=$$($(VC_LIST_EXCEPT) | grep '\.c$$') &&                 \
+       @if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then       \
+         files=$$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$') &&              \
          perl -n $(perl_config_h_first_) $$files ||                    \
            { echo '$(ME): the above files include some other header'   \
                'before <config.h>' 1>&2; exit 1; } || :;               \
@@ -477,10 +546,10 @@ sc_prohibit_HAVE_MBRTOWC:
 define _sc_header_without_use
   dummy=; : so we do not need a semicolon before each use;             \
   h_esc=`echo '[<"]'"$$h"'[">]'|$(SED) 's/\./\\\\./g'`;                        \
-  if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then                        \
-    files=$$(grep -l '^# *include '"$$h_esc"                           \
-            $$($(VC_LIST_EXCEPT) | grep '\.c$$')) &&                   \
-    grep -LE "$$re" $$files | grep . &&                                        \
+  if $(VC_LIST_EXCEPT) | $(GREP) '\.c$$' > /dev/null; then             \
+    files=$$($(GREP) -l '^# *include '"$$h_esc"                                \
+            $$($(VC_LIST_EXCEPT) | $(GREP) '\.c$$')) &&                \
+    $(GREP) -LE "$$re" $$files | $(GREP) . &&                          \
       { echo "$(ME): the above files include $$h but don't use it"     \
        1>&2; exit 1; } || :;                                           \
   else :;                                                              \
@@ -510,7 +579,7 @@ sc_prohibit_quote_without_use:
 
 # Don't include this header unless you use one of its functions.
 sc_prohibit_long_options_without_use:
-       @h='long-options.h' re='\<parse_long_options *\(' \
+       @h='long-options.h' re='\<parse_(long_options|gnu_standard_options_only) *\(' \
          $(_sc_header_without_use)
 
 # Don't include this header unless you use one of its functions.
@@ -571,7 +640,7 @@ sc_prohibit_posixver_without_use:
        @h='posixver.h' re='\<posix2_version *\(' $(_sc_header_without_use)
 
 sc_prohibit_same_without_use:
-       @h='same.h' re='\<same_name *\(' $(_sc_header_without_use)
+       @h='same.h' re='\<same_name(at)? *\(' $(_sc_header_without_use)
 
 sc_prohibit_hash_pjw_without_use:
        @h='hash-pjw.h' \
@@ -584,7 +653,7 @@ sc_prohibit_safe_read_without_use:
 
 sc_prohibit_argmatch_without_use:
        @h='argmatch.h' \
-       re='(\<(ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \
+       re='(\<(ARGMATCH_DEFINE_GROUP|ARRAY_CARDINALITY|X?ARGMATCH(|_TO_ARGUMENT|_VERIFY))\>|\<(invalid_arg|argmatch(_exit_fn|_(in)?valid)?) *\()' \
          $(_sc_header_without_use)
 
 sc_prohibit_canonicalize_without_use:
@@ -696,7 +765,7 @@ sc_prohibit_dirent_without_use:
 # Prohibit the inclusion of verify.h without an actual use.
 sc_prohibit_verify_without_use:
        @h='verify.h'                                                   \
-       re='\<(verify(true|expr)?|static_assert) *\('                   \
+       re='\<(verify(true|expr)?|assume|static_assert) *\('            \
          $(_sc_header_without_use)
 
 # Don't include xfreopen.h unless you use one of its functions.
@@ -734,9 +803,9 @@ Exit_base := $(notdir $(Exit_witness_file))
 sc_require_test_exit_idiom:
        @if test -f $(srcdir)/$(Exit_witness_file); then                \
          die=0;                                                        \
-         for i in $$(grep -l -F 'srcdir/$(Exit_base)'                  \
+         for i in $$($(GREP) -l -F 'srcdir/$(Exit_base)'               \
                $$($(VC_LIST) tests)); do                               \
-           tail -n1 $$i | grep '^Exit .' > /dev/null                   \
+           tail -n1 $$i | $(GREP) '^Exit .' > /dev/null                \
              && : || { die=1; echo $$i; }                              \
          done;                                                         \
          test $$die = 1 &&                                             \
@@ -841,18 +910,23 @@ endef
 # Don't define macros that we already get from gnulib header files.
 sc_prohibit_always-defined_macros:
        @if test -d $(gnulib_dir); then                                 \
-         case $$(echo all: | grep -l -f - Makefile) in Makefile);; *)  \
+         case $$(echo all: | $(GREP) -l -f - Makefile) in Makefile);; *) \
            echo '$(ME): skipping $@: you lack GNU grep' 1>&2; exit 0;; \
          esac;                                                         \
-         $(def_sym_regex) | grep -E -f - $$($(VC_LIST_EXCEPT))         \
-           && { echo '$(ME): define the above via some gnulib .h file' \
-                 1>&2;  exit 1; } || :;                                \
+         regex=$$($(def_sym_regex)); export regex;                     \
+         $(VC_LIST_EXCEPT)                                             \
+           | xargs sh -c 'echo $$regex | $(GREP) -E -f - "$$@"'        \
+               dummy /dev/null                                         \
+           && { printf '$(ME): define the above'                       \
+                       ' via some gnulib .h file\n' 1>&2;              \
+                exit 1; }                                              \
+           || :;                                                       \
        fi
 # ==================================================================
 
 # Prohibit checked in backup files.
 sc_prohibit_backup_files:
-       @$(VC_LIST) | grep '~$$' &&                             \
+       @$(VC_LIST) | $(GREP) '~$$' &&                                  \
          { echo '$(ME): found version controlled backup file' 1>&2;    \
            exit 1; } || :
 
@@ -871,7 +945,7 @@ sc_GFDL_version:
          $(_sc_search_regexp)
 
 # Don't use Texinfo's @acronym{}.
-# http://lists.gnu.org/archive/html/bug-gnulib/2010-03/msg00321.html
+# https://lists.gnu.org/r/bug-gnulib/2010-03/msg00321.html
 texinfo_suffix_re_ ?= \.(txi|texi(nfo)?)$$
 sc_texinfo_acronym:
        @prohibit='@acronym\{'                                          \
@@ -926,9 +1000,11 @@ require_exactly_one_NL_at_EOF_ =                                  \
     }                                                                  \
   END { exit defined $$fail }
 sc_prohibit_empty_lines_at_EOF:
-       @perl -le '$(require_exactly_one_NL_at_EOF_)' $$($(VC_LIST_EXCEPT)) \
-         || { echo '$(ME): empty line(s) or no newline at EOF'         \
-               1>&2; exit 1; } || :
+       @$(VC_LIST_EXCEPT)                                              \
+         | xargs perl -le '$(require_exactly_one_NL_at_EOF_)'          \
+         || { echo '$(ME): empty line(s) or no newline at EOF' 1>&2;   \
+              exit 1; }                                                \
+         || :
 
 # Make sure we don't use st_blocks.  Use ST_NBLOCKS instead.
 # This is a bit of a kludge, since it prevents use of the string
@@ -971,9 +1047,12 @@ prohibit_doubled_word_ =                                          \
 ignore_doubled_word_match_RE_ ?= ^$$
 
 sc_prohibit_doubled_word:
-       @perl -n -0777 $(prohibit_doubled_word_) $$($(VC_LIST_EXCEPT))  \
-         | grep -vE '$(ignore_doubled_word_match_RE_)'                 \
-         | grep . && { echo '$(ME): doubled words' 1>&2; exit 1; } || :
+       @$(VC_LIST_EXCEPT)                                              \
+         | xargs perl -n -0777 $(prohibit_doubled_word_)               \
+         | $(GREP) -vE '$(ignore_doubled_word_match_RE_)'              \
+         | $(GREP) .                                                   \
+         && { echo '$(ME): doubled words' 1>&2; exit 1; }              \
+         || :
 
 # A regular expression matching undesirable combinations of words like
 # "can not"; this matches them even when the two words appear on different
@@ -983,10 +1062,11 @@ sc_prohibit_doubled_word:
 # Also prohibit a prefix matching "\w+ +".
 # @pxref gets the same see/also treatment and should be parenthesized;
 # presume it must *not* start a sentence.
+# POSIX spells it "timestamp" rather than "time\s+stamp", so we do, too.
 bad_xref_re_ ?= (?:[\w,:;] +|(?:see|also)\s+)\@xref\{
 bad_pxref_re_ ?= (?:[.!?]|(?:see|also))\s+\@pxref\{
 prohibit_undesirable_word_seq_RE_ ?=                                   \
-  /(?:\bcan\s+not\b|$(bad_xref_re_)|$(bad_pxref_re_))/gims
+  /(?:\bcan\s+not\b|\btime\s+stamps?\b|$(bad_xref_re_)|$(bad_pxref_re_))/gims
 prohibit_undesirable_word_seq_ =                                       \
     -e 'while ($(prohibit_undesirable_word_seq_RE_))'                  \
     $(perl_filename_lineno_text_)
@@ -996,10 +1076,12 @@ prohibit_undesirable_word_seq_ =                                 \
 ignore_undesirable_word_sequence_RE_ ?= ^$$
 
 sc_prohibit_undesirable_word_seq:
-       @perl -n -0777 $(prohibit_undesirable_word_seq_)                \
-            $$($(VC_LIST_EXCEPT))                                      \
-         | grep -vE '$(ignore_undesirable_word_sequence_RE_)' | grep . \
-         && { echo '$(ME): undesirable word sequence' >&2; exit 1; } || :
+       @$(VC_LIST_EXCEPT)                                              \
+         | xargs perl -n -0777 $(prohibit_undesirable_word_seq_)       \
+         | $(GREP) -vE '$(ignore_undesirable_word_sequence_RE_)'       \
+         | $(GREP) .                                                   \
+         && { echo '$(ME): undesirable word sequence' >&2; exit 1; }   \
+         || :
 
 # Except for shell files and for loops, double semicolon is probably a mistake
 sc_prohibit_double_semicolon:
@@ -1031,7 +1113,8 @@ sc_prohibit_test_double_equal:
 # definition of LDADD from the appropriate Makefile.am and exits 0
 # when it contains "ICONV".
 sc_proper_name_utf8_requires_ICONV:
-       @progs=$$(grep -l 'proper_name_utf8 ''("' $$($(VC_LIST_EXCEPT)));\
+       @progs=$$($(VC_LIST_EXCEPT)                                     \
+                   | xargs $(GREP) -l 'proper_name_utf8 ''("');        \
        if test "x$$progs" != x; then                                   \
          fail=0;                                                       \
          for p in $$progs; do                                          \
@@ -1040,7 +1123,7 @@ sc_proper_name_utf8_requires_ICONV:
              -ne 'exit !(/^LDADD =(.+?[^\\]\n)/ms && $$1 =~ /ICONV/)'  \
              $$dir/Makefile.am && continue;                            \
            base=$$(basename "$$p" .c);                                 \
-           grep "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null \
+           $(GREP) "$${base}_LDADD.*ICONV)" $$dir/Makefile.am > /dev/null      \
              || { fail=1; echo 1>&2 "$(ME): $$p uses proper_name_utf8"; }; \
          done;                                                         \
          test $$fail = 1 &&                                            \
@@ -1101,12 +1184,12 @@ sc_makefile_at_at_check:
           -e ' && !/(\w+)\s+=.*\@\1\@$$/'                              \
           -e ''$(_makefile_at_at_check_exceptions)                     \
          -e 'and (print "$$ARGV:$$.: $$_"), $$m=1; END {exit !$$m}'    \
-           $$($(VC_LIST_EXCEPT) | grep -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \
+           $$($(VC_LIST_EXCEPT) | $(GREP) -E '(^|/)(Makefile\.am|[^/]+\.mk)$$') \
          && { echo '$(ME): use $$(...), not @...@' 1>&2; exit 1; } || :
 
 news-check: NEWS
        $(AM_V_GEN)if $(SED) -n $(news-check-lines-spec)p $<            \
-           | grep -E $(news-check-regexp) >/dev/null; then             \
+           | $(GREP) -E $(news-check-regexp) >/dev/null; then          \
          :;                                                            \
        else                                                            \
          echo 'NEWS: $$(news-check-regexp) failed to match' 1>&2;      \
@@ -1151,12 +1234,13 @@ generated_files ?= $(srcdir)/lib/*.[ch]
 _gl_translatable_string_re ?= \b(N?_|gettext *)\([^)"]*("|$$)
 sc_po_check:
        @if test -f $(po_file); then                                    \
-         grep -E -v '^(#|$$)' $(po_file)                               \
-           | grep -v '^src/false\.c$$' | sort > $@-1;                  \
-         files=$$(perl $(perl_translatable_files_list_)                \
-           $$($(VC_LIST_EXCEPT)) $(generated_files));                  \
-         grep -E -l '$(_gl_translatable_string_re)' $$files            \
-           | $(SED) 's|^$(_dot_escaped_srcdir)/||' | sort -u > $@-2;   \
+         $(GREP) -E -v '^(#|$$)' $(po_file)                            \
+           | $(GREP) -v '^src/false\.c$$' | sort > $@-1;               \
+         { $(VC_LIST_EXCEPT); echo $(generated_files); }               \
+           | xargs perl $(perl_translatable_files_list_)               \
+           | xargs $(GREP) -E -l '$(_gl_translatable_string_re)'       \
+           | $(SED) 's|^$(_dot_escaped_srcdir)/||'                     \
+           | sort -u > $@-2;                                           \
          diff -u -L $(po_file) -L $(po_file) $@-1 $@-2                 \
            || { printf '$(ME): '$(fix_po_file_diag) 1>&2; exit 1; };   \
          rm -f $@-1 $@-2;                                              \
@@ -1220,18 +1304,21 @@ _hv_regex_weak ?= ^ *\. .*/init\.sh"
 _hv_regex_strong ?= ^ *\. "\$${srcdir=\.}/init\.sh"
 sc_cross_check_PATH_usage_in_tests:
        @if test -f $(_hv_file); then                                   \
-         grep -l 'VERSION mismatch' $(_hv_file) >/dev/null             \
+         $(GREP) -l 'VERSION mismatch' $(_hv_file) >/dev/null          \
            || { echo "$@: skipped: no such file: $(_hv_file)" 1>&2;    \
                 exit 0; };                                             \
-         grep -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null         \
+         $(GREP) -lE '$(_hv_regex_strong)' $(_hv_file) >/dev/null      \
            || { echo "$@: $(_hv_file) lacks conforming use of init.sh" 1>&2; \
                 exit 1; };                                             \
-         good=$$(grep -E '$(_hv_regex_strong)' $(_hv_file));           \
-         grep -LFx "$$good"                                            \
-               $$(grep -lE '$(_hv_regex_weak)' $$($(VC_LIST_EXCEPT)))  \
-             | grep . &&                                               \
-           { echo "$(ME): the above files use path_prepend_ inconsistently" \
-               1>&2; exit 1; } || :;                                   \
+         good=$$($(GREP) -E '$(_hv_regex_strong)' $(_hv_file));        \
+         $(VC_LIST_EXCEPT)                                             \
+           | xargs $(GREP) -lE '$(_hv_regex_weak)'                     \
+           | xargs $(GREP) -LFx "$$good"                               \
+           | $(GREP) .                                                 \
+           && { printf "$(ME): the above files use"                    \
+                       " path_prepend_ inconsistently\n" 1>&2;         \
+                exit 1; }                                              \
+           || :;                                                       \
        fi
 
 # BRE regex of file contents to identify a test script.
@@ -1268,7 +1355,7 @@ sc_vulnerable_makefile_CVE-2009-4029:
        halt=$$(printf '%s\n'                                           \
          'the above files are vulnerable; beware of running'           \
          '  "make dist*" rules, and upgrade to fixed automake'         \
-         '  see http://bugzilla.redhat.com/542609 for details')        \
+         '  see https://bugzilla.redhat.com/show_bug.cgi?id=542609 for details') \
          $(_sc_search_regexp)
 
 sc_vulnerable_makefile_CVE-2012-3386:
@@ -1277,7 +1364,7 @@ sc_vulnerable_makefile_CVE-2012-3386:
        halt=$$(printf '%s\n'                                           \
          'the above files are vulnerable; beware of running'           \
          '  "make distcheck", and upgrade to fixed automake'           \
-         '  see http://bugzilla.redhat.com/CVE-2012-3386 for details') \
+         '  see https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2012-3386 for details') \
          $(_sc_search_regexp)
 
 vc-diff-check:
@@ -1303,7 +1390,7 @@ gpg_key_ID ?=                                                             \
   $$(cd $(srcdir)                                                      \
      && git cat-file tag v$(VERSION)                                   \
         | $(gpgv) --status-fd 1 --keyring /dev/null - - 2>/dev/null    \
-        | awk '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
+        | $(AWK) '/^\[GNUPG:\] ERRSIG / {print $$3; exit}')
 
 translation_project_ ?= coordinator@translationproject.org
 
@@ -1352,8 +1439,8 @@ release-commit:
 ## Updating files.  ##
 ## ---------------- ##
 
-ftp-gnu = ftp://ftp.gnu.org/gnu
-www-gnu = http://www.gnu.org
+ftp-gnu = https://ftp.gnu.org/gnu
+www-gnu = https://www.gnu.org
 
 upload_dest_dir_ ?= $(PACKAGE)
 upload_command =                                               \
@@ -1424,7 +1511,7 @@ check: $(gl_public_submodule_commit)
 ALL_RECURSIVE_TARGETS += alpha beta stable
 alpha beta stable: $(local-check) writable-files $(submodule-checks)
        $(AM_V_GEN)test $@ = stable                                     \
-         && { echo $(VERSION) | grep -E '^[0-9]+(\.[0-9]+)+$$'         \
+         && { echo $(VERSION) | $(GREP) -E '^[0-9]+(\.[0-9]+)+$$'      \
               || { echo "invalid version string: $(VERSION)" 1>&2; exit 1;};}\
          || :
        $(AM_V_at)$(MAKE) vc-diff-check
@@ -1501,7 +1588,10 @@ gen-coverage:
                --highlight --frames --legend \
                --title "$(PACKAGE_NAME)"
 
-coverage: init-coverage build-coverage gen-coverage
+coverage:
+       $(MAKE) init-coverage
+       $(MAKE) build-coverage
+       $(MAKE) gen-coverage
 
 # Some projects carry local adjustments for gnulib modules via patches in
 # a gnulib patch directory whose default name is gl/ (defined in bootstrap
@@ -1519,7 +1609,7 @@ refresh-gnulib-patches:
               -e 'END{defined $$d and print $$d}' bootstrap.conf);     \
          test -n "$$t" && gl=$$t;                                      \
        fi;                                                             \
-       for diff in $$(cd $$gl; git ls-files | grep '\.diff$$'); do     \
+       for diff in $$(cd $$gl; git ls-files | $(GREP) '\.diff$$'); do  \
          b=$$(printf %s "$$diff"|$(SED) 's/\.diff$$//');               \
          VERSION_CONTROL=none                                          \
            patch "$(gnulib_dir)/$$b" "$$gl/$$diff" || exit 1;          \
@@ -1531,7 +1621,7 @@ refresh-gnulib-patches:
 # Update gettext files.
 PACKAGE ?= $(shell basename $(PWD))
 PO_DOMAIN ?= $(PACKAGE)
-POURL = http://translationproject.org/latest/$(PO_DOMAIN)/
+POURL = https://translationproject.org/latest/$(PO_DOMAIN)/
 PODIR ?= po
 refresh-po:
        rm -f $(PODIR)/*.po && \
@@ -1562,7 +1652,7 @@ update-copyright-env ?=
 # in the file .x-update-copyright.
 .PHONY: update-copyright
 update-copyright:
-       $(AM_V_GEN)grep -l -w Copyright                                  \
+       $(AM_V_GEN)$(GREP) -l -w Copyright                               \
          $$(export VC_LIST_EXCEPT_DEFAULT=COPYING && $(VC_LIST_EXCEPT)) \
          | $(update-copyright-env) xargs $(srcdir)/$(_build-aux)/$@
 
@@ -1576,9 +1666,9 @@ _gl_TS_dir ?= src
 ALL_RECURSIVE_TARGETS += sc_tight_scope
 sc_tight_scope: tight-scope.mk
        @fail=0;                                                        \
-       if ! grep '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk        \
+       if ! $(GREP) '^ *export _gl_TS_headers *=' $(srcdir)/cfg.mk     \
                > /dev/null                                             \
-          && ! grep -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \
+          && ! $(GREP) -w noinst_HEADERS $(srcdir)/$(_gl_TS_dir)/Makefile.am \
                > /dev/null 2>&1; then                                  \
            echo '$(ME): skipping $@';                                  \
        else                                                            \
@@ -1650,12 +1740,12 @@ _gl_tight_scope: $(bin_PROGRAMS)
        hdr=`for f in $(_gl_TS_headers); do                             \
               test -f $$f && d= || d=$(srcdir)/; echo $$d$$f; done`;   \
        ( printf '%s\n' '__.*' $(_gl_TS_unmarked_extern_functions);     \
-         grep -h -A1 '^extern .*[^;]$$' $$src                          \
-           | grep -vE '^(extern |--|#)' | $(SED) 's/ .*//; /^$$/d';    \
+         $(GREP) -h -A1 '^extern .*[^;]$$' $$src                       \
+           | $(GREP) -vE '^(extern |--|#)' | $(SED) 's/ .*//; /^$$/d'; \
          perl -lne                                                     \
             '$(_gl_TS_function_match) and print $$1' $$hdr;            \
        ) | sort -u | $(SED) "$$sed_wrap" > $$t;                        \
-       nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|grep -Ev -f $$t \
+       nm -g $(_gl_TS_obj_files)|$(SED) -n 's/.* T //p'|$(GREP) -Ev -f $$t \
          && { echo the above functions should have static scope >&2;   \
               exit 1; } || : ;                                         \
        ( printf '%s\n' '__.*' main $(_gl_TS_unmarked_extern_vars);     \
@@ -1663,7 +1753,7 @@ _gl_tight_scope: $(bin_PROGRAMS)
                $$hdr $(_gl_TS_other_headers)                           \
        ) | sort -u | $(SED) "$$sed_wrap" > $$t;                        \
        nm -g $(_gl_TS_obj_files) | $(SED) -n 's/.* [BCDGRS] //p'       \
-            | sort -u | grep -Ev -f $$t                                        \
+            | sort -u | $(GREP) -Ev -f $$t                             \
          && { echo the above variables should have static scope >&2;   \
               exit 1; } || :
 # TS-end
diff --git a/po/LINGUAS b/po/LINGUAS
new file mode 100644 (file)
index 0000000..d286c86
--- /dev/null
@@ -0,0 +1,26 @@
+bg
+cs
+da
+de
+el
+eo
+es
+fi
+fr
+ga
+gl
+hr
+id
+ja
+ko
+nl
+pl
+pt_BR
+ro
+ru
+sr
+sv
+uk
+vi
+zh_CN
+zh_TW
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
new file mode 100644 (file)
index 0000000..65184f6
--- /dev/null
@@ -0,0 +1,475 @@
+# Makefile for PO directory in any package using GNU gettext.
+# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
+#
+# This file can be copied and used freely without restrictions.  It can
+# be used in projects which are not available under the GNU General Public
+# License but which still want to provide support for the GNU gettext
+# functionality.
+# Please note that the actual code of GNU gettext is covered by the GNU
+# General Public License and is *not* in the public domain.
+#
+# Origin: gettext-0.19
+GETTEXT_MACRO_VERSION = 0.19
+
+PACKAGE = @PACKAGE@
+VERSION = @VERSION@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+
+SED = @SED@
+SHELL = /bin/sh
+@SET_MAKE@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+datarootdir = @datarootdir@
+datadir = @datadir@
+localedir = @localedir@
+gettextsrcdir = $(datadir)/gettext/po
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+# We use $(mkdir_p).
+# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
+# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
+# @install_sh@ does not start with $(SHELL), so we add it.
+# In automake >= 1.10, @mkdir_p@ is derived from ${MKDIR_P}, which is defined
+# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
+# versions, $(mkinstalldirs) and $(install_sh) are unused.
+mkinstalldirs = $(SHELL) @install_sh@ -d
+install_sh = $(SHELL) @install_sh@
+MKDIR_P = @MKDIR_P@
+mkdir_p = @mkdir_p@
+
+GMSGFMT_ = @GMSGFMT@
+GMSGFMT_no = @GMSGFMT@
+GMSGFMT_yes = @GMSGFMT_015@
+GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT))
+MSGFMT_ = @MSGFMT@
+MSGFMT_no = @MSGFMT@
+MSGFMT_yes = @MSGFMT_015@
+MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
+XGETTEXT_ = @XGETTEXT@
+XGETTEXT_no = @XGETTEXT@
+XGETTEXT_yes = @XGETTEXT_015@
+XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT))
+MSGMERGE = msgmerge
+MSGMERGE_UPDATE = @MSGMERGE@ --update
+MSGINIT = msginit
+MSGCONV = msgconv
+MSGFILTER = msgfilter
+
+POFILES = @POFILES@
+GMOFILES = @GMOFILES@
+UPDATEPOFILES = @UPDATEPOFILES@
+DUMMYPOFILES = @DUMMYPOFILES@
+DISTFILES.common = Makefile.in.in remove-potcdate.sin \
+$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
+DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \
+$(POFILES) $(GMOFILES) \
+$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
+
+POTFILES = \
+
+CATALOGS = @CATALOGS@
+
+POFILESDEPS_ = $(srcdir)/$(DOMAIN).pot
+POFILESDEPS_yes = $(POFILESDEPS_)
+POFILESDEPS_no =
+POFILESDEPS = $(POFILESDEPS_$(PO_DEPENDS_ON_POT))
+
+DISTFILESDEPS_ = update-po
+DISTFILESDEPS_yes = $(DISTFILESDEPS_)
+DISTFILESDEPS_no =
+DISTFILESDEPS = $(DISTFILESDEPS_$(DIST_DEPENDS_ON_UPDATE_PO))
+
+# Makevars gets inserted here. (Don't remove this line!)
+
+.SUFFIXES:
+.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
+
+.po.mo:
+       @echo "$(MSGFMT) -c -o $@ $<"; \
+       $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
+
+.po.gmo:
+       @lang=`echo $* | sed -e 's,.*/,,'`; \
+       test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+       echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
+       cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
+
+.sin.sed:
+       sed -e '/^#/d' $< > t-$@
+       mv t-$@ $@
+
+
+all: all-@USE_NLS@
+
+all-yes: stamp-po
+all-no:
+
+# Ensure that the gettext macros and this Makefile.in.in are in sync.
+CHECK_MACRO_VERSION = \
+       test "$(GETTEXT_MACRO_VERSION)" = "@GETTEXT_MACRO_VERSION@" \
+         || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version @GETTEXT_MACRO_VERSION@" 1>&2; \
+              exit 1; \
+            }
+
+# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
+# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
+# we don't want to bother translators with empty POT files). We assume that
+# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
+# In this case, stamp-po is a nop (i.e. a phony target).
+
+# stamp-po is a timestamp denoting the last time at which the CATALOGS have
+# been loosely updated. Its purpose is that when a developer or translator
+# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
+# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
+# invocations of "make" will do nothing. This timestamp would not be necessary
+# if updating the $(CATALOGS) would always touch them; however, the rule for
+# $(POFILES) has been designed to not touch files that don't need to be
+# changed.
+stamp-po: $(srcdir)/$(DOMAIN).pot
+       @$(CHECK_MACRO_VERSION)
+       test ! -f $(srcdir)/$(DOMAIN).pot || \
+         test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
+       @test ! -f $(srcdir)/$(DOMAIN).pot || { \
+         echo "touch stamp-po" && \
+         echo timestamp > stamp-poT && \
+         mv stamp-poT stamp-po; \
+       }
+
+# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
+# otherwise packages like GCC can not be built if only parts of the source
+# have been downloaded.
+
+# This target rebuilds $(DOMAIN).pot; it is an expensive operation.
+# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
+# The determination of whether the package xyz is a GNU one is based on the
+# heuristic whether some file in the top level directory mentions "GNU xyz".
+# If GNU 'find' is available, we avoid grepping through monster files.
+$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
+       package_gnu="$(PACKAGE_GNU)"; \
+       test -n "$$package_gnu" || { \
+         if { if (LC_ALL=C find --version) 2>/dev/null | grep GNU >/dev/null; then \
+                LC_ALL=C find -L $(top_srcdir) -maxdepth 1 -type f \
+                              -size -10000000c -exec grep 'GNU @PACKAGE@' \
+                              /dev/null '{}' ';' 2>/dev/null; \
+              else \
+                LC_ALL=C grep 'GNU @PACKAGE@' $(top_srcdir)/* 2>/dev/null; \
+              fi; \
+            } | grep -v 'libtool:' >/dev/null; then \
+            package_gnu=yes; \
+          else \
+            package_gnu=no; \
+          fi; \
+       }; \
+       if test "$$package_gnu" = "yes"; then \
+         package_prefix='GNU '; \
+       else \
+         package_prefix=''; \
+       fi; \
+       if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \
+         msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \
+       else \
+         msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \
+       fi; \
+       case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+         '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \
+           $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+             --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+             --files-from=$(srcdir)/POTFILES.in \
+             --copyright-holder='$(COPYRIGHT_HOLDER)' \
+             --msgid-bugs-address="$$msgid_bugs_address" \
+           ;; \
+         *) \
+           $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
+             --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) @XGETTEXT_EXTRA_OPTIONS@ \
+             --files-from=$(srcdir)/POTFILES.in \
+             --copyright-holder='$(COPYRIGHT_HOLDER)' \
+             --package-name="$${package_prefix}@PACKAGE@" \
+             --package-version='@VERSION@' \
+             --msgid-bugs-address="$$msgid_bugs_address" \
+           ;; \
+       esac
+       test ! -f $(DOMAIN).po || { \
+         if test -f $(srcdir)/$(DOMAIN).pot; then \
+           sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
+           sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
+           if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
+             rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
+           else \
+             rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
+             mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+           fi; \
+         else \
+           mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
+         fi; \
+       }
+
+# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
+# every "make" invocation, only create it when it is missing.
+# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
+$(srcdir)/$(DOMAIN).pot:
+       $(MAKE) $(DOMAIN).pot-update
+
+# This target rebuilds a PO file if $(DOMAIN).pot has changed.
+# Note that a PO file is not touched if it doesn't need to be changed.
+$(POFILES): $(POFILESDEPS)
+       @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
+       if test -f "$(srcdir)/$${lang}.po"; then \
+         test -f $(srcdir)/$(DOMAIN).pot || $(MAKE) $(srcdir)/$(DOMAIN).pot; \
+         test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+         echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
+         cd $(srcdir) \
+           && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+                  '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+                    $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \
+                  *) \
+                    $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \
+                esac; \
+              }; \
+       else \
+         $(MAKE) $${lang}.po-create; \
+       fi
+
+
+install: install-exec install-data
+install-exec:
+install-data: install-data-@USE_NLS@
+       if test "$(PACKAGE)" = "gettext-tools"; then \
+         $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+         for file in $(DISTFILES.common) Makevars.template; do \
+           $(INSTALL_DATA) $(srcdir)/$$file \
+                           $(DESTDIR)$(gettextsrcdir)/$$file; \
+         done; \
+         for file in Makevars; do \
+           rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+         done; \
+       else \
+         : ; \
+       fi
+install-data-no: all
+install-data-yes: all
+       @catalogs='$(CATALOGS)'; \
+       for cat in $$catalogs; do \
+         cat=`basename $$cat`; \
+         lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+         dir=$(localedir)/$$lang/LC_MESSAGES; \
+         $(mkdir_p) $(DESTDIR)$$dir; \
+         if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
+         $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
+         echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
+         for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+           if test -n "$$lc"; then \
+             if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+               link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+               mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+               mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+                for file in *; do \
+                  if test -f $$file; then \
+                    ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+                  fi; \
+                done); \
+               rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+             else \
+               if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+                 :; \
+               else \
+                 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+                 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               fi; \
+             fi; \
+             rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+             ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+             ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
+             cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+             echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
+           fi; \
+         done; \
+       done
+
+install-strip: install
+
+installdirs: installdirs-exec installdirs-data
+installdirs-exec:
+installdirs-data: installdirs-data-@USE_NLS@
+       if test "$(PACKAGE)" = "gettext-tools"; then \
+         $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \
+       else \
+         : ; \
+       fi
+installdirs-data-no:
+installdirs-data-yes:
+       @catalogs='$(CATALOGS)'; \
+       for cat in $$catalogs; do \
+         cat=`basename $$cat`; \
+         lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+         dir=$(localedir)/$$lang/LC_MESSAGES; \
+         $(mkdir_p) $(DESTDIR)$$dir; \
+         for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
+           if test -n "$$lc"; then \
+             if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
+               link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
+               mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+               mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
+                for file in *; do \
+                  if test -f $$file; then \
+                    ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
+                  fi; \
+                done); \
+               rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
+             else \
+               if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
+                 :; \
+               else \
+                 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
+                 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
+               fi; \
+             fi; \
+           fi; \
+         done; \
+       done
+
+# Define this as empty until I found a useful application.
+installcheck:
+
+uninstall: uninstall-exec uninstall-data
+uninstall-exec:
+uninstall-data: uninstall-data-@USE_NLS@
+       if test "$(PACKAGE)" = "gettext-tools"; then \
+         for file in $(DISTFILES.common) Makevars.template; do \
+           rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
+         done; \
+       else \
+         : ; \
+       fi
+uninstall-data-no:
+uninstall-data-yes:
+       catalogs='$(CATALOGS)'; \
+       for cat in $$catalogs; do \
+         cat=`basename $$cat`; \
+         lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
+         for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
+           rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
+         done; \
+       done
+
+check: all
+
+info dvi ps pdf html tags TAGS ctags CTAGS ID:
+
+mostlyclean:
+       rm -f remove-potcdate.sed
+       rm -f stamp-poT
+       rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
+       rm -fr *.o
+
+clean: mostlyclean
+
+distclean: clean
+       rm -f Makefile Makefile.in POTFILES *.mo
+
+maintainer-clean: distclean
+       @echo "This command is intended for maintainers to use;"
+       @echo "it deletes files that may require special tools to rebuild."
+       rm -f stamp-po $(GMOFILES)
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+dist distdir:
+       test -z "$(DISTFILESDEPS)" || $(MAKE) $(DISTFILESDEPS)
+       @$(MAKE) dist2
+# This is a separate target because 'update-po' must be executed before.
+dist2: stamp-po $(DISTFILES)
+       dists="$(DISTFILES)"; \
+       if test "$(PACKAGE)" = "gettext-tools"; then \
+         dists="$$dists Makevars.template"; \
+       fi; \
+       if test -f $(srcdir)/$(DOMAIN).pot; then \
+         dists="$$dists $(DOMAIN).pot stamp-po"; \
+       fi; \
+       if test -f $(srcdir)/ChangeLog; then \
+         dists="$$dists ChangeLog"; \
+       fi; \
+       for i in 0 1 2 3 4 5 6 7 8 9; do \
+         if test -f $(srcdir)/ChangeLog.$$i; then \
+           dists="$$dists ChangeLog.$$i"; \
+         fi; \
+       done; \
+       if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
+       for file in $$dists; do \
+         if test -f $$file; then \
+           cp -p $$file $(distdir) || exit 1; \
+         else \
+           cp -p $(srcdir)/$$file $(distdir) || exit 1; \
+         fi; \
+       done
+
+update-po: Makefile
+       $(MAKE) $(DOMAIN).pot-update
+       test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
+       $(MAKE) update-gmo
+
+# General rule for creating PO files.
+
+.nop.po-create:
+       @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
+       echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
+       exit 1
+
+# General rule for updating PO files.
+
+.nop.po-update:
+       @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
+       if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
+       tmpdir=`pwd`; \
+       echo "$$lang:"; \
+       test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
+       echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
+       cd $(srcdir); \
+       if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+              '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \
+                $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+              *) \
+                $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \
+            esac; \
+          }; then \
+         if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+           rm -f $$tmpdir/$$lang.new.po; \
+         else \
+           if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+             :; \
+           else \
+             echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+             exit 1; \
+           fi; \
+         fi; \
+       else \
+         echo "msgmerge for $$lang.po failed!" 1>&2; \
+         rm -f $$tmpdir/$$lang.new.po; \
+       fi
+
+$(DUMMYPOFILES):
+
+update-gmo: Makefile $(GMOFILES)
+       @:
+
+# Recreate Makefile by invoking config.status. Explicitly invoke the shell,
+# because execution permission bits may not work on the current file system.
+# Use @SHELL@, which is the shell determined by autoconf for the use by its
+# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
+Makefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@
+       cd $(top_builddir) \
+         && @SHELL@ ./config.status $(subdir)/$@.in po-directories
+
+force:
+
+# Tell versions [3.59,3.63) of GNU make not to export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/po/Makevars b/po/Makevars
new file mode 100644 (file)
index 0000000..1d8efab
--- /dev/null
@@ -0,0 +1,75 @@
+# Makefile variables for PO directory in any package using GNU gettext.
+
+# Usually the message domain is the same as the package name.
+DOMAIN = $(PACKAGE)
+
+# These two variables depend on the location of this directory.
+subdir = po
+top_builddir = ..
+
+# These options get passed to xgettext.
+XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ \
+                     --flag=_:1:pass-c-format \
+        --flag=N_:1:pass-c-format \
+             $${end_of_xgettext_options+}
+
+# This is the copyright holder that gets inserted into the header of the
+# $(DOMAIN).pot file.  Set this to the copyright holder of the surrounding
+# package.  (Note that the msgstr strings, extracted from the package's
+# sources, belong to the copyright holder of the package.)  Translators are
+# expected to transfer the copyright for their translations to this person
+# or entity, or to disclaim their copyright.  The empty string stands for
+# the public domain; in this case the translators are expected to disclaim
+# their copyright.
+COPYRIGHT_HOLDER = Free Software Foundation, Inc.
+
+# This tells whether or not to prepend "GNU " prefix to the package
+# name that gets inserted into the header of the $(DOMAIN).pot file.
+# Possible values are "yes", "no", or empty.  If it is empty, try to
+# detect it automatically by scanning the files in $(top_srcdir) for
+# "GNU packagename" string.
+PACKAGE_GNU =
+
+# This is the email address or URL to which the translators shall report
+# bugs in the untranslated strings:
+# - Strings which are not entire sentences, see the maintainer guidelines
+#   in the GNU gettext documentation, section 'Preparing Strings'.
+# - Strings which use unclear terms or require additional context to be
+#   understood.
+# - Strings which make invalid assumptions about notation of date, time or
+#   money.
+# - Pluralisation problems.
+# - Incorrect English spelling.
+# - Incorrect formatting.
+# It can be your email address, or a mailing list address where translators
+# can write to without being subscribed, or the URL of a web page through
+# which the translators can contact you.
+MSGID_BUGS_ADDRESS = bug-m4@gnu.org
+
+# This is the list of locale categories, beyond LC_MESSAGES, for which the
+# message catalogs shall be used.  It is usually empty.
+EXTRA_LOCALE_CATEGORIES =
+
+# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt'
+# context.  Possible values are "yes" and "no".  Set this to yes if the
+# package uses functions taking also a message context, like pgettext(), or
+# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument.
+USE_MSGCTXT = no
+
+# These options get passed to msgmerge.
+# Useful options are in particular:
+#   --previous            to keep previous msgids of translated messages,
+#   --quiet               to reduce the verbosity.
+MSGMERGE_OPTIONS =
+
+# This tells whether or not to regenerate a PO file when $(DOMAIN).pot
+# has changed.  Possible values are "yes" and "no".  Set this to no if
+# the POT file is checked in the repository and the version control
+# program ignores timestamps.
+PO_DEPENDS_ON_POT = yes
+
+# This tells whether or not to forcibly update $(DOMAIN).pot and
+# regenerate PO files on "make dist".  Possible values are "yes" and
+# "no".  Set this to no if the POT file and PO files are maintained
+# externally.
+DIST_DEPENDS_ON_UPDATE_PO = yes
diff --git a/po/POTFILES.in b/po/POTFILES.in
new file mode 100644 (file)
index 0000000..33bdc12
--- /dev/null
@@ -0,0 +1,49 @@
+# List of files containing translatable strings.
+
+# Copyright 2020-2021 Free Software Foundation, Inc.
+
+# This file is part of GNU M4.
+
+# GNU M4 is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# GNU M4 is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+lib/clean-temp.c
+lib/closein.c
+lib/closeout.c
+lib/c-stack.c
+lib/clean-temp-simple.c
+lib/error.c
+lib/execute.c
+lib/getopt.c
+lib/obstack.c
+lib/openat-die.c
+lib/os2-spawn.c
+lib/quotearg.c
+lib/regcomp.c
+lib/siglist.h
+lib/spawn-pipe.c
+lib/strsignal.c
+lib/verror.c
+lib/version-etc.c
+lib/wait-process.c
+lib/xalloc-die.c
+lib/xprintf.c
+src/builtin.c
+src/debug.c
+src/eval.c
+src/format.c
+src/freeze.c
+src/input.c
+src/m4.c
+src/macro.c
+src/output.c
diff --git a/po/Rules-quot b/po/Rules-quot
new file mode 100644 (file)
index 0000000..7b92c7e
--- /dev/null
@@ -0,0 +1,58 @@
+# This file, Rules-quot, can be copied and used freely without restrictions.
+# Special Makefile rules for English message catalogs with quotation marks.
+
+DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
+
+.SUFFIXES: .insert-header .po-update-en
+
+en@quot.po-create:
+       $(MAKE) en@quot.po-update
+en@boldquot.po-create:
+       $(MAKE) en@boldquot.po-update
+
+en@quot.po-update: en@quot.po-update-en
+en@boldquot.po-update: en@boldquot.po-update-en
+
+.insert-header.po-update-en:
+       @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
+       if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
+       tmpdir=`pwd`; \
+       echo "$$lang:"; \
+       ll=`echo $$lang | sed -e 's/@.*//'`; \
+       LC_ALL=C; export LC_ALL; \
+       cd $(srcdir); \
+       if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \
+          | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \
+          { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
+            '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \
+              $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \
+              ;; \
+            *) \
+              $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \
+              ;; \
+            esac } 2>/dev/null > $$tmpdir/$$lang.new.po \
+            ; then \
+         if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
+           rm -f $$tmpdir/$$lang.new.po; \
+         else \
+           if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
+             :; \
+           else \
+             echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
+             exit 1; \
+           fi; \
+         fi; \
+       else \
+         echo "creation of $$lang.po failed!" 1>&2; \
+         rm -f $$tmpdir/$$lang.new.po; \
+       fi
+
+en@quot.insert-header: insert-header.sin
+       sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
+
+en@boldquot.insert-header: insert-header.sin
+       sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
+
+mostlyclean: mostlyclean-quot
+mostlyclean-quot:
+       rm -f *.insert-header
diff --git a/po/bg.gmo b/po/bg.gmo
new file mode 100644 (file)
index 0000000..4660b39
Binary files /dev/null and b/po/bg.gmo differ
diff --git a/po/bg.po b/po/bg.po
new file mode 100644 (file)
index 0000000..3f0a03b
--- /dev/null
+++ b/po/bg.po
@@ -0,0 +1,1338 @@
+# Bulgarian translation of m4 po-file.
+# Copyright (C) 2019 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Alexander Shopov <ash@kambanaria.org>, 2019.
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2019-07-01 22:41+0200\n"
+"Last-Translator: Alexander Shopov <ash@kambanaria.org>\n"
+"Language-Team: Bulgarian <dict@ludost.net>\n"
+"Language: bg\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "ГРЕШКА: не може да се създаде временен файл за отвеждане"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Не може да се зададе файл за грешки „%s“"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: опцията „%s“ не е еднозначна\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: опцията „%s“ не е еднозначна\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: непозната опция „%c%s“\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: опцията „%c%s“ не приема аргумент\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: опцията „%s“ изисква аргумент\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: неправилна опция — „%c“\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: опцията изисква аргумент — %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "паметта е изчерпана"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Успех"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Няма съвпадения"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Неправилен регулярен израз"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Неправилен знак за подредба"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Неправилно име на клас знаци"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Самотна „\\“ накрая"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Неправилна препратка към съвпадение"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "„[“ или „[^“ без еш"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "„(“ или „\\(“ без еш"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "„\\{“ без еш"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Неправилно съдържание в „\\{\\}“"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Неправилен край на диапазон"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Паметта свърши"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Предхождащият регулярен израз е неправилен"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Ранен край на регулярен израз"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Регулярният израз е прекалено голям"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "„)“ или „\\)“ без еш"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Няма предхождащ регулярен израз"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Дали не е надвишен размерът на виртуалната памет (VMEM)?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Дали не е надвишен размерът на виртуалната памет (VMEM)?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Недефинирано име „%s“"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Недефинирано име „%s“"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Съобщавайте за програмни грешки на <bug-m4@gnu.org>.\n"
+"За грешки в българския превод на <dict@fsa-bg.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Неправилен регулярен израз: „%s“: „%s“"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "ПРЕДУПРЕЖДЕНИЕ: прекалено малко аргументи към вградената команда „%s“"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr ""
+"ПРЕДУПРЕЖДЕНИЕ: излишните аргументи към вградената команда „%s“ се прескачат"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Нечислов аргумент към вградената команда „%s“"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Нечислов аргумент към вградената команда „%s“"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Недефинирано име „%s“"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Недефинирано име „%s“"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "ПРЕДУПРЕЖДЕНИЕ: прекалено малко аргументи към вградената команда „%s“"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Изходът не може да се пренасочи към командата „%s“"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Изчисляване на отрицателна широчина"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Отвеждането на „%s“ не може да се прекрати"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Отвеждането на „%s“ не може да се прекрати"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "„%s“ не може да се отвори"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "ГРЕШКА: модул не може да се затвори: „%s“"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Изчистване на грешки: неправилни флагове: „%s“"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Не може да се зададе файл за грешки „%s“"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "ПРЕДУПРЕЖДЕНИЕ: „\\0“ ще изчезне, за замяна ползвайте „\\&“"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Неправилен регулярен израз: „%s“: „%s“"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Грешка при търсене чрез регулярен израз: „%s“"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Неправилен регулярен израз: „%s“: „%s“"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Неправилен израз за „eval“, липсва „)“: %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Неправилен израз в „eval“: „%s“"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Неправилен израз за „eval“, неправилен вход: „%s“"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Неправилен израз за „eval“, прекомерно дълъг вход: „%s“<"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Деление на 0 за „eval“: „%s“"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Деление на 0 за „eval“: „%s“"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Остатък при деление на 0 за „eval“: „%s“"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Неправилен израз в „eval“: „%s“"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Неправилен, нечислов аргумент за „%s“"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: непозната опция „%c%s“\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Очаква се нов ред в замразен файл"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Очаква се знак „%c“ в замразен файл"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Очаква се нов ред в замразен файл"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Ранен край на замразен файл"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "„%s“ не може да се отвори"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Неправилен замразен файл"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "ГРЕШКА: край на файл в низ"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "За повече информация изпълнете „%s --help“.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Употреба: %s [ОПЦИЯ]… [ФАЙЛ]…\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Ако ФАЙЛ няма или е „-“, се чете от стандартния вход.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=Р_ИЗР  използване на този Регулярен_ИЗРаз за синтаксиса "
+"на\n"
+"                           името на макроса\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Препроцесор:\n"
+"  -I, --include=ДИРЕКТОРИЯ\n"
+"                           търсене в тази ДИРЕКТОРИЯ на обекти за вмъкване\n"
+"  -D, --define=ИМЕ[=СТОЙНОСТ]\n"
+"                           задаване на тази СТОЙНОСТ (или празна такава) на\n"
+"                           това ИМЕ\n"
+"  -U, --undefine=ИМЕ       изтриване на вграденото ИМЕ\n"
+"  -s, --synclines          генериране на редове „#line № \"FILE\"“\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Ограничаване\n"
+"  -G, --traditional        изключване на всички разширения на GNU\n"
+"  -H, --hashsize=РАЗМЕР    РАЗМЕР на речника за символи, добре е да е просто "
+"число\n"
+"  -L, --nesting-limit=ЧИСЛО\n"
+"                           смяна на ограничението за влагане до това ЧИСЛО "
+"пъти\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Замразени файлове:\n"
+"  -F, --freeze-state=ФАЙЛ  създаване на замразен ФАЙЛ за състоянието\n"
+"                           в края на работата\n"
+"  -R, --reload-state=ФАЙЛ  изчитане на състоянието от замразен ФАЙЛ\n"
+"                           в началото на работата\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Изчистване на грешки:\n"
+"  -d, --debug=[ФЛАГОВЕ]    ниво за изчистване на грешки, без флагове е "
+"„aeq“\n"
+"  -t, --trace=ИМЕ          трасиране на ИМЕто при дефинирането му\n"
+"  -l, --arglength=РАЗМЕР   ограничаване на размера за изчистване на грешки\n"
+"                           на макроси\n"
+"  -o, --error-output=ФАЙЛ  ФАЙЛ, в който се извежда информацията за "
+"изчистване\n"
+"                           на грешки\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Неправилни флагове за изчистване на грешки: „%s“"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "ГРЕШКА: край на файл в списък с аргументи"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"ГРЕШКА: преминато е ограничението за рекурсия до %d пъти.  Може да го "
+"промените с „-L<N>“"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "ГРЕШКА: не може да се създаде временен файл за отвеждане"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "ГРЕШКА: не може да се създаде временен файл за отвеждане"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Не може да се получи информация със „stat“ за отвеждането"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "ГРЕШКА: не може да се създаде временен файл за отвеждане"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "ГРЕШКА: отвеждането не може да се запише във временен файл"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "ГРЕШКА: копиране на вмъкнат файл"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "ГРЕШКА: четене на вмъкнат файл"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Не може да се получи информация със „stat“ за отвеждането"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Отвеждането е твърде дълго"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: опцията „--%s“ не приема аргумент\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: непозната опция „--%s“\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: непозволена опция — %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: опцията „-W %s“ не е еднозначна\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: опцията „-W %s“ не приема аргумент\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr ""
+#~ "ВЪТРЕШНА ГРЕШКА: неправилен вид данни за лексема в „define_macro ()“"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr ""
+#~ "ВЪТРЕШНА ГРЕШКА: вградената команда липсва в таблицата за вградените "
+#~ "команди!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен вид данни за лексема в „m4_dumpdef ()“"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен вид символ в „m4_defn ()“"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Основата %d на числовата система е извън диапазона [2;36]"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Недефиниран синтактичен код „%c“"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "ВЪТРЕШНА ГРЕШКА: вградената команда липсва в таблицата с вградените "
+#~ "команди в „trace_pre ()“!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен вид данни за лексема в „trace_pre ()“"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен код за грешка в „evaluate ()“"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен оператор за сравнение в „cmp_term ()“"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr ""
+#~ "ВЪТРЕШНА ГРЕШКА: неправилен оператор за отместване в „shift_term ()“"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен оператор в „mult_term ()“"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr ""
+#~ "ВЪТРЕШНА ГРЕШКА: вградената команда липсва в таблицата с вградените "
+#~ "команди!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "ВЪТРЕШНА ГРЕШКА: неправилен вид данни за лексема в „freeze_one_symbol ()“"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "„%s“ от замразения файл липсва в таблицата за вградените команди!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Входът е върнат към „%s“, ред %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Входът се чете от „%s“"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: рекурсивен „push_string“!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилно извикване на „init_macro_token ()“"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: грешка във входния стек в „next_char ()“"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: грешка във входния стек в „peek_input ()“"
+
+#~ msgid "NONE"
+#~ msgstr "НЯМА"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "ГРЕШКА: препълване на стека.  (Дали не е безкрайна рекурсия?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Аргументите, задължителните или незадължителни за дългите опции, са "
+#~ "съответно задължителни или незадължителни и за кратките опции.\n"
+#~ "\n"
+#~ "Режими на работа:\n"
+#~ "      --help               извеждане на тази помощ и изход\n"
+#~ "      --version            извеждане на версията и изход\n"
+#~ "  -e, --interactive        без буфериране на изхода, пренебрегване\n"
+#~ "                           на прекъсванията\n"
+#~ "  -E, --fatal-warnings     спиране на изпълнението след първото "
+#~ "предупреждение\n"
+#~ "  -Q, --quiet, --silent    без някои от предупрежденията за вградените "
+#~ "команди\n"
+#~ "  -P, --prefix-builtins    добавяне на префикс `m4_' към всички вградени "
+#~ "команди\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Динамично зареждане:\n"
+#~ "  -m, --module-directory=ДИРЕКТОРИЯ\n"
+#~ "                           добавяне на тази ДИРЕКТОРИЯ към пътя за "
+#~ "търсене\n"
+#~ "                           на модули\n"
+#~ "  -M, --load-module=МОДУЛ  зареждане на този динамичен МОДУЛ от пътя от\n"
+#~ "                           „M4MODPATH“\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "ФЛАГОВЕТЕ са измежду:\n"
+#~ "  t   трасиране на всички извиквания на макроси\n"
+#~ "  a   извеждане на аргументите\n"
+#~ "  e   извеждане на заместванията\n"
+#~ "  q   цитиране на стойностите при необходимост при флаг „a“ или „e“\n"
+#~ "  c   извеждане преди сбиране, след сбиране и след извикване\n"
+#~ "  x   уникален идентификатор при извикване на макрос, полезно при флаг "
+#~ "„c“\n"
+#~ "  f   извеждане на текущия входен файл\n"
+#~ "  l   извеждане на текущия номер на ред\n"
+#~ "  p   резултати от търсенията в пътя\n"
+#~ "  i   промените във входните файлове\n"
+#~ "  V   всичко по-горе\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "ГРЕШКА: неуспешно добавяне на директорията за търсене „%s“"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "ГРЕШКА: неуспешно добавяне на директорията за търсене „%s“: „%s“"
+
+#~ msgid " (options:"
+#~ msgstr " (опции:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен код в отсрочените аргументи"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен вид лексема в „expand_token ()“"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен вид лексема в „expand_argument ()“"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен вид символ в „call_macro ()“"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ГРЕШКА: неуспешно инициализиране на модули: „%s“"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ГРЕШКА: липсващ модул: „%s“"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ГРЕШКА: липсващ модул: „%s“: „%s“"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ГРЕШКА: модулите не може да се затворят"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "ГРЕШКА: модулите не може да се затворят: „%s“"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "ГРЕШКА: модул не може да се затвори: „%s“: „%s“"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Търсенето по път за „%s“ върна „%s“"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Нарушаване на разделянето на паметта (SIGSEGV).  Или стекът е препълнен,\n"
+#~ "или има грешка в "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Проверете за безкрайна рекурсия (евентуално).\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "ВЪТРЕШНА ГРЕШКА: неправилен режим за „symbol_lookup ()“"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Непознато име: „%s“\n"
diff --git a/po/boldquot.sed b/po/boldquot.sed
new file mode 100644 (file)
index 0000000..4b937aa
--- /dev/null
@@ -0,0 +1,10 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
+s/“/“\e[1m/g
+s/”/\e[0m”/g
+s/‘/‘\e[1m/g
+s/’/\e[0m’/g
diff --git a/po/cs.gmo b/po/cs.gmo
new file mode 100644 (file)
index 0000000..937e265
Binary files /dev/null and b/po/cs.gmo differ
diff --git a/po/cs.po b/po/cs.po
new file mode 100644 (file)
index 0000000..68c773d
--- /dev/null
+++ b/po/cs.po
@@ -0,0 +1,1334 @@
+# Czech translation of the GNU m4.
+# Copyright (C) 1998 Free Software Foundation, Inc.
+# Jiøí Pavlovský <pavlovsk@ff.cuni.cz>, 1998-2001.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2000-08-08 23:19+0200\n"
+"Last-Translator: Jiøí Pavlovský <pavlovsk@ff.cuni.cz>\n"
+"Language-Team: Czech <cs@li.org>\n"
+"Language: cs\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "CHYBA: doèasný soubor pro ulo¾ení odlo¾eného výstupu nelze vytvoøit"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Chybový soubor %s nelze pou¾ít"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: pøepínaè `%s' není jednoznaèný\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: pøepínaè `%s' není jednoznaèný\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: neznámý pøepínaè `%c%s'\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: pøepínaè `%c%s' musí být zadán bez argumentu\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: pøepínaè `%s' vy¾aduje argument\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: neznámý pøepínaè -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: pøepínaè vy¾aduje argument -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "pamì» vyèerpána"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Úspìch"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Shoda nenalezena"
+
+# , c-format
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "©patný regulární výraz"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Chybný srovnávací znak"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Chybná tøída znakù"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Nadbyteèné zpìtné lomítko"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Chybný zpìtný odkaz"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Chybí uzavírající znak pro [ èi [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Chybí uzavírající znak pro ( èi \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Chybí uzavírající znak pro \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Chybný obsah \\{\\} výrazu"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Chybná specifikace intervalu"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Pamì» vyèerpána"
+
+# , c-format
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Chybný pøedchozí regulární výraz"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Pøedèasný konec regulárního výrazu"
+
+# , c-format
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Pøíli¹ veliký regulární výraz"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Chybí otevírající znak pro \\)"
+
+# , c-format
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Chybí pøedchozí regulární výraz"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Pøekroèen VMEM limit?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Pøekroèen VMEM limit?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Jméno %s není definováno"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Jméno %s není definováno"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Chyby v programu oznamujte na adrese <bug-m4@gnu.org> (anglicky).\n"
+"Pøipomínky k pøekladu zasílejte na adresu <cs@li.org> (èesky).\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "©patný regulární výraz `%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+# , c-format
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Varování: pøíli¹ málo argumentù pro vestavìné makro `%s'"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr ""
+"Varování: pøíli¹ mnoho argumentù pro vestavìné makro `%s' - budou ignorovány"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Neèíselný argument pro vestavìné makro `%s'"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Neèíselný argument pro vestavìné makro `%s'"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Jméno `%s' není definováno"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Jméno `%s' není definováno"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+# , c-format
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Varování: pøíli¹ málo argumentù pro vestavìné makro `%s'"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Rouru do pøíkazu `%s' nelze otevøít"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Záporná ¹íøka v makru eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Chyba pøi volání makra undivert pro %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Chyba pøi volání makra undivert pro %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "%s nelze otevøít"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "CHYBA: modul `%s' nelze deinicializovat"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Ladící mód: ¹patné ladící volby: `%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Chybový soubor %s nelze pou¾ít"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "VAROVÁNÍ: \\0 zmizí, pøi nahrazování pou¾ijte \\&"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "©patný regulární výraz `%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Chyba pøi porovnávání regulárního výrazu `%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "©patný regulární výraz `%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "©patný výraz v makru eval (chybí pravá závorka): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "©patný výraz v makru eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "©patný výraz v makru eval (¹patný vstup): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "©patný výraz v makru eval (nadbyteèný vstup): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Dìlení nulou v makru eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Dìlení nulou v makru eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulo nulou v makru eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "©patný výraz v makru eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Neèíselný argument pro %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: neznámý pøepínaè `%c%s'\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Ve zmrazeném souboru oèekáván LF"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Ve zmrazeném souboru oèekáván znak `%c'"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Ve zmrazeném souboru oèekáván LF"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Pøedèasný konec zmrazeného souboru"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "%s nelze otevøít"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "©patný formát zmrazeného souboru"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "CHYBA: EOF v øetìzci"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Více informací získáte pøíkazem `%s --help'.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Pou¾ití: %s [PØEPÍNAÈ]... [SOUBOR]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Jestli¾e SOUBOR není zadán, nebo je SOUBOR `-', pak je èten standardní "
+"vstup.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=REGVÝR        syntaxe jmen maker bude urèena pomocí "
+"REGVÝR\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Nastavení preprocesoru:\n"
+"  -I, --include=ADRESÁØ           ADRESÁØ bude druhý v poøadí pøi hledání\n"
+"                                  vlo¾ených souborù\n"
+"  -D, --define=MAKRO[=HODNOTA]    definuje MAKRO mající HODNOTU, mù¾e být\n"
+"                                  i prázdné\n"
+"  -U, --undefine=MAKRO            sma¾e vestavìné MAKRO\n"
+"  -s, --synclines                 vlo¾í øádky tvaru `#line ÈÍSLO \"SOUBOR"
+"\"'\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Nastavení limitù:\n"
+"  -G, --traditional               vypne GNU roz¹íøení\n"
+"  -H, --hashsize=PRVOÈÍSLO        velikost hash tabulky pro vyhledávání "
+"symbolù\n"
+"  -L, --nesting-limit=ÈÍSLO       nastaví limit pro vnoøená volání maker\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Zmrazené soubory:\n"
+"  -F, --freeze-state=SOUBOR       pøi ukonèení ulo¾í zmrazený stav do "
+"SOUBORU\n"
+"  -R, --reload-state=SOUBOR       pøi startu naète zmrazený stav ze SOUBORU\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Ladìní:\n"
+"  -d, --debug=[VOLBY]             nastaví úroveò ladìní (pokud nejsou VOLBY\n"
+"                                  zadány, pak implicitnì `aeq')\n"
+"  -t, --trace=MAKRO               sleduje MAKRO, kdy¾ je definováno\n"
+"  -l, --arglength=POÈET           reguluje poèet výstupních informací\n"
+"                                  ze sledování maker\n"
+"  -o, --error-output=SOUBOR       pøesmìruje výstup ladìní a sledování do "
+"SOUBORU\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "©patné ladící volby: `%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "CHYBA: EOF v seznamu argumentù"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "CHYBA: pøekroèen limit pro rekurzi (%d), zmìòte jej pomocí -L<N>"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "CHYBA: doèasný soubor pro ulo¾ení odlo¾eného výstupu nelze vytvoøit"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "CHYBA: doèasný soubor pro ulo¾ení odlo¾eného výstupu nelze vytvoøit"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Chyba pøi volání funkce stat pro soubor obsahující odlo¾ený výstup"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "CHYBA: doèasný soubor pro ulo¾ení odlo¾eného výstupu nelze vytvoøit"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "CHYBA: odlo¾ený výstup nelze zapsat do doèasného souboru"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "CHYBA: pøi zapisování vlo¾eného souboru"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "CHYBA: pøi ètení vlo¾eného souboru"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Chyba pøi volání funkce stat pro soubor obsahující odlo¾ený výstup"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Odlo¾ený výstup je pøíli¹ veliký."
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: pøepínaè `--%s' musí být zadán bez argumentu\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: neznámý pøepínaè `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: neznámý pøepínaè -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: pøepínaè `-W %s' není jednoznaèný\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: pøepínaè ` -W %s' musí být zadán bez argumentu\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný typ tokenu v define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr ""
+#~ "VNITØNÍ CHYBA: Vestavìné makro nenalezeno v tabulce vestavìných maker!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný typ tokenu v m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný typ symbolu v m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Základ v makru eval je mimo rozsah (základ = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Syntaktický kód %c není definován"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "VNITØNÍ CHYBA: vestavìné makro nenalezeno v tabulce vestavìných maker\n"
+#~ "(trace_pre ())!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný typ tokenu (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný chybový kód v evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný operátor porovnání v cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný operátor posunu v shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný operátor v mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr ""
+#~ "VNITØNÍ CHYBA: Vestavìné makro nenalezeno v tabulce vestavìných maker!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný typ tokenu ve freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "`%s' ze zmrazeného souboru nenalezeno v tabulce vestavìných maker!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Vstup èten z %s, øádku %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Vstup èten z %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "VNITØNÍ CHYBA: rekurzivní push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patné volání init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "VNITØNÍ CHYBA: chyba vstupního zásobníku v next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "VNITØNÍ CHYBA: chyba vstupního zásobníku v peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "®ÁDNÝ"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "CHYBA: Pøeteèení zásobníku. (nekoneèná rekurze makra define?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Povinné èi volitelné argumenty pro dlouhé pøepínaèe jsou povinné "
+#~ "respektive\n"
+#~ "volitelné i pro odpovídající pøepínaèe krátké.\n"
+#~ "\n"
+#~ "Chování programu:\n"
+#~ "      --help                      vypí¹e tuto nápovìdu a skonèí\n"
+#~ "      --version                   vypí¹e oznaèení verze a skonèí\n"
+#~ "  -e, --interactive               nebufferovaný výstup, ignoruje "
+#~ "pøeru¹ení\n"
+#~ "  -E, --fatal-warnings            skonèí po prvním varování\n"
+#~ "  -Q, --quiet, --silent           potlaèí nìkterá varování týkající se\n"
+#~ "                                  vestavìných maker\n"
+#~ "  -P, --prefix-builtins           v¹echna vestavìná makra budou mít "
+#~ "prefix `m4_'\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Nastavení dynamického zavádìní modulù:\n"
+#~ "  -m, --module-directory=ADRESÁØ  pøidá ADRESÁØ k seznamu adresáøù s "
+#~ "moduly\n"
+#~ "  -M, --load-module=MODUL         zavede dynamické MODUL z M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "VOLBOU mù¾e být cokoliv z:\n"
+#~ "  t   sleduje v¹echna makra, nejenom ta urèená pomocí traceon\n"
+#~ "  a   vypí¹e aktuální argumenty\n"
+#~ "  e   vypí¹e expanzi\n"
+#~ "  q   dle potøeby uzavøe hodnoty mezi apostrofy, s volbami a nebo e\n"
+#~ "  c   vypí¹e hodnoty pøed a po vyhodnocení argumentù a po volání makra\n"
+#~ "  x   bude vypisovat jedineèné ID volání makra, u¾iteèné s volbou c\n"
+#~ "  f   bude vypisovat název vstupního souboru\n"
+#~ "  l   bude vypisovat èíslo vstupního øádku\n"
+#~ "  p   vypí¹e informace o nalezení zadaného souboru\n"
+#~ "  i   vypí¹e informace o ka¾dé zmìnì vstupního souboru\n"
+#~ "  V   zkratka pro v¹echny vý¹e uvedené volby\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "CHYBA: `%s' nelze pøidat k seznamu prohledávaných adresáøù"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "CHYBA: `%s' nelze pøidat k seznamu prohledávaných adresáøù: %s"
+
+#~ msgid " (options:"
+#~ msgstr " (pøelo¾eno s volbami:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný kód v odlo¾ených argumentech"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný typ tokenu v expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný typ tokenu v expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný typ symbolu v call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "CHYBA: moduly nelze inicializovat: %s"
+
+# , c-format
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "CHYBA: modul `%s' nelze nalézt"
+
+# , c-format
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "CHYBA: modul `%s' nelze nalézt: %s"
+
+# , c-format
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "CHYBA: moduly nelze deinicializovat"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "CHYBA: moduly nelze deinicializovat: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "CHYBA: modul `%s' nelze deinicializovat: %s"
+
+# , c-format
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Hledán soubor `%s', nalezen soubor `%s'"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Neoprávnìný pøístup do pamìti (SIGSEGV). Jedná se buï o pøeteèení "
+#~ "zásobníku,\n"
+#~ "nebo o chybu "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Provìøte, zda se nejedná o nekoneènou rekurzi.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "VNITØNÍ CHYBA: ¹patný mód pro symbol_lookup ()"
+
+# , c-format
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Jméno `%s' není známo\n"
diff --git a/po/da.gmo b/po/da.gmo
new file mode 100644 (file)
index 0000000..f2f7da6
Binary files /dev/null and b/po/da.gmo differ
diff --git a/po/da.po b/po/da.po
new file mode 100644 (file)
index 0000000..68b8861
--- /dev/null
+++ b/po/da.po
@@ -0,0 +1,1313 @@
+# Danish version of GNU m4 strings.
+# Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+# Ole Laursen <olau@hardworking.dk>, 2000, 2001.
+#
+# Diversion er ikke oversat fordi det endnu ikke er lykkedes
+# at finde et passende dansk ord (hjælp modtages gerne :-).
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2001-06-14 23:09+02:00\n"
+"Last-Translator: Ole Laursen <olau@hardworking.dk>\n"
+"Language-Team: Danish <dansk@klid.dk>\n"
+"Language: da\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "FEJL: Kan ikke oprette midlertidig fil til diversion"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Kan ikke sætte fil %s til brug for fejl"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: tilvalget '%s' is flertydigt\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: tilvalget '%s' is flertydigt\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: ukendt tilvalg '%c%s'\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: tilvalget '%c%s' tager ikke en parameter\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: tilvalget '%s' skal have en parameter\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ugyldigt tilvalg - %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: tilvalg skal have en parameter - %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "løbet tør for hukommelse"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Succes"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Intet fundet"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ugyldigt regulært udtryk"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ugyldigt sorteringstegn"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Ugyldig tegnklassenavn"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Afsluttende omvendt skråstreg"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Ugyldig tilbagereference"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Uafbalanceret [ eller [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Uafbalanceret ( eller \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Uafbalanceret \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Ugyldigt indhold af \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Ugyldig intervalslutning"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Løbet tør for hukommelse"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Ugyldigt forudgående regulært udtryk"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "For tidlig afslutning på regulært udtryk"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regulært udtryk for stort"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Uafbalanceret ) eller \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Intet tidligere regulært udtryk"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "VMEM-grænsen overskredet?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "VMEM-grænsen overskredet?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Navnet '%s' ikke defineret"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Navnet '%s' ikke defineret"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Rapportér fejl (på engelsk) til <bug-m4@gnu.org> (oversættelsesfejl til "
+"<olau@hardworking.dk>).\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Ugyldigt regulært udtryk `%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Advarsel: For få parametre til indbygget `%s'"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Advarsel: Ekstra parametre til indbygget `%s' ignoreret"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Parameteren til indbygget `%s' er ikke et tal"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Parameteren til indbygget `%s' er ikke et tal"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Ikke-defineret navn '%s'"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Ikke-defineret navn '%s'"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Advarsel: For få parametre til indbygget `%s'"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Kan ikke åbne overførselsledning til kommando `%s'"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Negativ bredde i eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Kan ikke undivert %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Kan ikke undivert %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Kan ikke åbne %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "FEJL: Kan ikke lukke modul: '%s'"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Fejlretningstilstand: ugyldige fejlfindingsflag: `%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Kan ikke sætte fil %s til brug for fejl"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "ADVARSEL: \\0 vil forsvinde, brug \\& i stedet for i erstatninger"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Ugyldigt regulært udtryk `%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Fejl under søgning af regulært udtryk `%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Ugyldigt regulært udtryk `%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Ugyldigt udtryk i eval (manglende højreparantes): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Ugyldigt udtryk i eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Ugyldigt udtryk i eval (ugyldigt inddata): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Ugyldigt udtryk i eval (for stor mængde inddata): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Division med nul i eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Division med nul i eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulo med nul i eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Ugyldigt udtryk i eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Parameteren til %s er ikke et tal"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: ukendt tilvalg '%c%s'\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Forventede linieskift i fryst fil"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Forventede tegnet `%c' i fryst fil"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Forventede linieskift i fryst fil"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "For tidlig afslutning på fryst fil"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Kan ikke åbne %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Ugyldigt formatteret fryst fil"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "FEJL: EOF i tekststreng"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Prøv `%s --help' for mere information.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Brug: %s [TILVALG]... [FIL]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Standardinddata læses hvis FIL ikke specificeres eller hvis FIL er `-'.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr "  -W, --word-regexp=REGEXP     benyt REGEXP som makronavnssyntaks\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Forbehandlerfaciliteter:\n"
+"  -I, --include=MAPPE          led sekundært i denne mappe efter "
+"inkluderinger\n"
+"  -D, --define=NAVN[=VÆRDI]    indsæt NAVN med værdien tom eller VÆRDI\n"
+"  -U, --undefine=NAVN          slet indbygget NAVN\n"
+"  -s, --synclines              generér `#line NR \"FIL\"' linjer\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Regulering af grænser:\n"
+"  -G, --traditional            undertryk alle GNU-udvidelser\n"
+"  -H, --hashsize=PRIMTAL       sæt størrelsen på hashtabellen til "
+"symbolopslag\n"
+"  -L, --nesting-limit=NUMMER   sæt grænsen på strukturer inde i hinanden\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Fryste tilstandsfiler:\n"
+"  -F, --freeze-state=FIL       gem en fryst tilstand i FIL til slut\n"
+"  -R, --reload-state=FIL       hent en fryst tilstand fra FIL ved start\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Fejlretning:\n"
+"  -d, --debug=[FLAG]           sæt fejlretningsniveau (ingen flag medfører "
+"`aeq')\n"
+"  -t, --trace=NAVN             følg navn når det bliver defineret\n"
+"  -l, --arglength=NR           afgræns størrelsen af makrosporingens uddata\n"
+"  -o, --error-output=FIL       omdirigér fejlretnings- og sporingsuddata\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Ugyldige fejlretningsflag: `%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "FEJL: EOF i parameterliste"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"FEJL: Rekursionsgrænse på %d overskredet, -L<N> kan bruges til at ændre den"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "FEJL: Kan ikke oprette midlertidig fil til diversion"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "FEJL: Kan ikke oprette midlertidig fil til diversion"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Kan ikke finde filoplysninger om diversion"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "FEJL: Kan ikke oprette midlertidig fil til diversion"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "FEJL: Kan ikke hælde diversion ud i midlertidig fil"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "FEJL: Kopierer indsat fil"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "FEJL: Læser indsat fil"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Kan ikke finde filoplysninger om diversion"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Diversion for stor"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: tilvalget '--%s' tager ikke en parameter\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: ukendt tilvalg '--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: ulovligt tilvalg - %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: tilvalget '-W %s' er flertydigt\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: tilvalget '-W %s' tager ikke en parameter\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "INTERN FEJL: Ugyldig datatype i define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "INTERN FEJL: Indbygget ikke fundet i tabellen over indbyggede"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "INTERN FEJL: Ugyldig datatype i m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "INTERN FEJL: Ugyldig symboltype i m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr ""
+#~ "Grundtallet i eval ligger ikke i det gyldige interval (grundtal = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Syntakskode %c ikke defineret"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "INTERN FEJL: Indbygget ikke fundet i tabellen over indbyggede! (trace_pre "
+#~ "())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "INTERN FEJL: Ugyldig datatype (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "INTERN FEJL: Ugyldig fejlkode i evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "INTERN FEJL: Ugyldig sammenligningsoperator i cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "INTERN FEJL: Ugyldig skifteoperator i shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "INTERN FEJL: Ugyldig operator i mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "INTERN FEJL: Indbygget ikke fundet i tabellen over indbyggede"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "INTERN FEJL: Ugyldig datatype i freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "`%s' fra fryst fil ikke fundet i tabellen over indbyggede"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Inddata sendt tilbage til %s, linje %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Inddata læst fra %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "INTERN FEJL: Rekursiv push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "INTERN FEJL: Ugyldigt kald til init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "INTERN FEJL: Inddatastakken forkludret i next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "INTERN FEJL: Inddatastakken forkludret i peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "INTET"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "FEJL: Overfyldt stak. (Uendelig define rekursion?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Obligatoriske eller valgfri parametre til lange tilvalg er også\n"
+#~ "obligatoriske eller valgfri for de korte tilvalg\n"
+#~ "\n"
+#~ "Arbejdstilstande:\n"
+#~ "      --help                   vis denne hjælp og afslut\n"
+#~ "      --version                udskriv versionsinformation og afslut\n"
+#~ "  -e, --interactive            uddata ikke i buffer, ignorér afbrydelser\n"
+#~ "  -E, --fatal-warnings         stop efter den første advarsel\n"
+#~ "  -Q, --quiet, --silent        undertryk nogle advarsler for indbyggede\n"
+#~ "  -P, --prefix-builtins        sæt et `m4_'-præfix på alle indbyggede\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Dynamiske indlæsningsfaciliteter:\n"
+#~ "  -m, --module-directory=KATALOG    tilføj KATALOG til "
+#~ "modulsøgningsstien\n"
+#~ "  -M, --load-module=MODUL           indlæs dynamisk MODUL fra M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "FLAG er hvilken som helst af:\n"
+#~ "  t   følg alle makrokald, ikke kun dem med traceon\n"
+#~ "  a   vis aktuelle parametre\n"
+#~ "  e   vis makroudfoldelse\n"
+#~ "  q   anbring aktuelle parametre og udfoldelser mellem citationstegn\n"
+#~ "  c   vis før indsamling af parametre, efter indsamling og efter kald\n"
+#~ "  x   tilføj et unikt makrokald-id, nyttig med `c'-flaget\n"
+#~ "  f   vis nuværende inddatafilnavn\n"
+#~ "  l   vis nuværende inddatalinjenummer\n"
+#~ "  p   vis resultat af stisøgninger\n"
+#~ "  i   vis ændringer i inddatafiler\n"
+#~ "  V   forkortelse for alle ovenstående flag\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "FEJL: tilføjelse af søgningskataloget '%s' mislykkedes"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "FEJL: tilføjelse af søgningskataloget '%s' mislykkedes: %s"
+
+#~ msgid " (options:"
+#~ msgstr " (tilvalg:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "INTERN FEJL: Ugyldig kode i opsatte parametre"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "INTERN FEJL: Ugyldig type i expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "INTERN FEJL: Ugyldig type i expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "INTERN FEJL: Ugyldig symboltype i call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "FEJL: klargøring af moduler mislykkedes: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "FEJL: Kan ikke finde modul: '%s'"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "FEJL: kan ikke finde modul: '%s': %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "FEJL: Kan ikke lukke moduler"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "FEJL: kan ikke lukke moduler: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "FEJL: kan ikke lukke modul: '%s': %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Stisøgning efter '%s' fandt '%s'"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Overskridelse af hukommelsesgrænserne opdaget (SIGSEGV). Enten er "
+#~ "stakken\n"
+#~ "blevet overfyldt, eller der er en fejl i "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ". Se efter om der skulle være uendelige rekursioner.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "INTERN FEJL: Ulovlig tilstand til symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Navnet '%s' er ukendt\n"
diff --git a/po/de.gmo b/po/de.gmo
new file mode 100644 (file)
index 0000000..af52200
Binary files /dev/null and b/po/de.gmo differ
diff --git a/po/de.po b/po/de.po
new file mode 100644 (file)
index 0000000..6d583ca
--- /dev/null
+++ b/po/de.po
@@ -0,0 +1,1324 @@
+# German translation for the GNU m4 messages
+# Copyright (C) 1995, 1996, 1999, 2001 Free Software Foundation, Inc.
+# Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995
+# Martin von Löwis <martin@mira.isdn.cs.tu-berlin.de>, 1996, 1999, 2001
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2001-10-10 10:31+02:00\n"
+"Last-Translator: Martin von Löwis <martin@mira.isdn.cs.tu-berlin.de>\n"
+"Language-Team: German <de@li.org>\n"
+"Language: de\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "FEHLER: Kann keine temporäre Datei für Umleitung erzeugen"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Kann Fehlerdatei nicht vorbereiten: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: Die Option »%s« ist mehrdeutig.\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: Die Option »%s« ist mehrdeutig.\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "\"%s: Nicht erkannte Option »%c%s«.\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: Die Option »%c%s« erlaubt keinen Parameter.\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: Die Option »%s« verlangt einen Parameter.\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: Ungültige Option -- %c.\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: Option verlangt einen Parameter -- %c.\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "Virtueller Speicher erschöpft."
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Erfolg"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Keine Übereinstimmung"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ungültiger regulärer Ausdruck"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ungültiger Vergleichsbuchstabe"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Ungültiger Name für eine Zeichenklasse"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Angehängter Backslash (»\\«)"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Ungültiger Rückverweis"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "»[« oder »[^« ohne schließende Klammer"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "»(« oder »\\(« ohne schließende Klammer"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "»{« ohne schließende Klammer"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Ungültiger Inhalt von \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Ungültiges Bereichsende"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Kein Speicher mehr verfügbar"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Der vorherige reguläre Ausdruck ist nicht korrekt"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Unerwartetes Ende des regulären Ausdrucks"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regulärer Ausdruck zu groß"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "»)« order »\\)« ohne öffnende Klammer"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Kein vorangehender regulärer Ausdruck"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "VMEM Beschränkung überschritten?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "VMEM Beschränkung überschritten?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Name %s nicht definiert"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Name %s nicht definiert"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Probleme und Fehler an <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Falscher regulärer Ausdruck »%s«: %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Warnung: Zu wenig Argumente für eingebaute Funktion »%s«"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr ""
+"Warnung: Überschüssige Argumente für eingebaute Funktion »%s« ignoriert"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Nicht-numerisches Argument in eingebauter Funktion »%s«"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Nicht-numerisches Argument in eingebauter Funktion »%s«"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Undefinierter Name »%s«."
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Undefinierter Name »%s«."
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Warnung: Zu wenig Argumente für eingebaute Funktion »%s«"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Kann keine `pipe' für Kommando »%s« öffnen"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Negative Breite in `eval'"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Kann Umleitung %s nicht aufheben"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Kann Umleitung %s nicht aufheben"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Kann %s nicht öffnen"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "FEHLER: Kann Modul nicht schließen: »%s«"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Debugmodus: falsche Debug Flags: »%s«"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Kann Fehlerdatei nicht vorbereiten: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "WARNUNG: \\0 wird wegfallen, benutze \\& stattdessen"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Falscher regulärer Ausdruck »%s«: %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Fehler beim Erkennen des regulären Ausdrucks »%s«"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Falscher regulärer Ausdruck »%s«: %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Falscher Ausdruck in `eval' (fehlende rechte Klammer): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Falscher Ausdruck in `eval': %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Falscher Ausdruck in `eval' (falsche Eingabe): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Falscher Ausdruck in `eval' (zu große Eingabe): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Division durch Null in `eval': %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Division durch Null in `eval': %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulo Null in `eval': %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Falscher Ausdruck in `eval': %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Nicht-numerisches Argument in %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "\"%s: Nicht erkannte Option »%c%s«.\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Erwarte Zeilenumbruch in eingefrorener Datei"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Erwarte Zeichen »%c« in eingefrorener Datei"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Erwarte Zeilenumbruch in eingefrorener Datei"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Vorzeitiges Ende der eingefrorenen Datei"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Kann %s nicht öffnen"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Fehlerhafte eingefrorene Datei"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "FEHLER: Dateiende in Zeichenkette"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "»%s --help« zeigt weitere Informationen.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Aufruf: %s [OPTION]... [DATEI]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Ohne DATEI oder wenn DATEI `-' ist, wird die Standardeingabe gelesen\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr "  -W, --word-regexp=REGEXP     benutze REGEXP für Makronamensyntax\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Präprozessoreigenschaften:\n"
+"  -I, --include=VERZEICHNIS    durchsuche VERZEICHNIS als zweites bei "
+"`include'\n"
+"  -D, --define=NAME[=WERT]     füge NAME mit WERT (oder leer) ein\n"
+"  -U, --undefine=NAME          lösche eingebaute Funktion NAME\n"
+"  -s, --synclines              erzeuge `#line NR \"DATEI\"' Zeilen\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Setze Grenzen:\n"
+"  -G, --traditional            schalte alle GNU Erweiterungen aus\n"
+"  -H, --hashsize=PRIMZAHL      setze Größe der Symbol-Hashtabelle\n"
+"  -L, --nesting-limit=NUMMER   setze künstliche Grenze für "
+"Schachtelungstiefe\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Eingefrorene Dateien:\n"
+"  -F, --freeze-state=DATEI     erzeuge am Ende eine eingefrorene Form in "
+"DATEI\n"
+"  -R, --reload-state=DATEI     lade zu Beginn Zustand von eingefrorener "
+"DATEI\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Debugging:\n"
+"  -d, --debug=[FLAGS]          setze Debuglevel (keine FLAGS bedeutet "
+"`aeq')\\\n"
+"  -t, --trace=NAME             verfolge NAME, wenn er definiert wird\n"
+"  -l, --arglength=NUMMER       beschränke Größe bei Macroverfolgung\n"
+"  -o, --error-output=DATEI     leite Debug- und Verfolgungsausgaben nach "
+"DATEI\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Falsche Debug Flags: »%s«"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "FEHLER: Dateiende in Argumentliste"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"FEHLER: Grenze der Rekursion von %d überschritten, benutze -L<N> zur Änderung"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "FEHLER: Kann keine temporäre Datei für Umleitung erzeugen"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "FEHLER: Kann keine temporäre Datei für Umleitung erzeugen"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Kann `stat' nicht auf Umleitung anwenden"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "FEHLER: Kann keine temporäre Datei für Umleitung erzeugen"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "FEHLER: Kann Umleitung nicht in temporäre Datei ausgeben"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "FEHLER: Während Kopieren einer eingefügten Datei"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "FEHLER: Während Lesen einer eingefügten Datei"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Kann `stat' nicht auf Umleitung anwenden"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Die Umleitung (diversion) ist zu lang."
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: Die Option »--%s« erlaubt keinen Parameter.\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: Nicht erkannte Option »--%s«.\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: Ungültige Option -- %c.\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: Option »-W %s« ist zweideutig.\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: Option »-W %s« erlaubt keinen Parameter.\\\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "INTERNER FEHLER: Falscher Datentyp des Tokens in define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "INTERNER FEHLER: Eingebaute Funktion nicht in Tabelle gefunden!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "INTERNER FEHLER: Falscher Datentyp des Tokens in m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "INTERNER FEHLER: Falscher Symboltyp in m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Basis in `eval' nicht in den Grenzen (Basis = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Syntaxzeichen %c nicht definiert."
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "INTERNER FEHLER: Eingebaute Funktion nicht in Tabelle gefunden! "
+#~ "(trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "INTERNER FEHLER: Falscher Datentyp des Tokens (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "INTERNER FEHLER: Falscher Fehlerkode in evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "INTERNER FEHLER: Falscher Vergleichsoperator in cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "INTERNER FEHLER: Falscher Shift-Operator in shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "INTERNER FEHLER: Falscher Operator in mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "INTERNER FEHLER: Eingebaute Funktion nicht in Tabelle gefunden!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "INTERNER FEHLER: Falscher Datentyp des Tokens in freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr ""
+#~ "»%s« aus eingefrorener Datei nicht in Tabelle der eingebauten Funktionen "
+#~ "gefunden!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Eingabe zurückgenommen zu %s, Zeile %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Eingabe gelesen von %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "INTERNER FEHLER: Rekursives push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "INTERNER FEHLER: Falscher Aufruf von init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr ""
+#~ "INTERNER FEHLER: Kellerspeicher der Eingabe durcheinander in next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr ""
+#~ "INTERNER FEHLER: Kellerspeicher der Eingabe durcheinander in peek_input ()"
+
+# This is the name of the input file when there is no current input file.
+# Is this ever printed in a message?
+#~ msgid "NONE"
+#~ msgstr "NONE"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "FEHLER: Keller voll.  (Unendliche `define' Rekursion?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Notwendige bzw. optionale Argumente für Optionen der Langform sind auch \n"
+#~ "für die Kurform notwendig bzw. optional.\n"
+#~ "\n"
+#~ "Operationsmodi:\n"
+#~ "      --help                   zeige diese Hilfe an und beende\n"
+#~ "      --version                zeige Versionsinformation an und beende\n"
+#~ "  -e, --interactive            keine Ausgabepufferung, ignoriere "
+#~ "Interrupts\n"
+#~ "  -E, --fatal-warnings         beende Ausführung nach erster Warnung\n"
+#~ "  -Q, --quiet, --silent        unterdrücke Warnungen bei eingebauten "
+#~ "Funktionen\n"
+#~ "  -P, --prefix-builtins        erzwinge `m4_' Präfix für eingebaute "
+#~ "Funktionen\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Dynamisches Nachladen:\n"
+#~ "  -m, --module-directory=VERZEICHNIS VERZEICHNIS in den Modulsuchpfad "
+#~ "einfügen.\n"
+#~ "  -M, --load-module=MODUL            MODUL dynamisch vom M4MODPATH "
+#~ "laden.\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "FLAGS ist Kombination aus folgendem:\n"
+#~ "  t   verfolge alle Makroaufrufe, nicht nur die von `traceon'\n"
+#~ "  a   zeige aktuelle Argumente\n"
+#~ "  e   zeige Ausdehnung\n"
+#~ "  q   setze Werte in Anführungszeichen, wenn nötig, mit a- oder e-Flag\n"
+#~ "  c   zeige vor und nach `collect' und nach Aufruf an\n"
+#~ "  x   zeige für jeden Aufruf eindeutige Nummer an, hilfreich bei -c\n"
+#~ "  f   gebe Namen der aktuellen Eingabedatei aus\n"
+#~ "  l   gebe aktuelle Zeilennummer der Eingabezeile aus\n"
+#~ "  p   gebe Ergebnis der Pfadsuche aus\n"
+#~ "  i   gebe Veränderungen der Eingabedatei aus\n"
+#~ "  V   Kurzform für alle Flags oben zusammen\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "FEHLER: Suchverzeichnis »%s« konnte nicht eingefügt werden."
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "FEHLER: Suchverzeichnis »%s« konnte nicht eingefügt werden: %s."
+
+#~ msgid " (options:"
+#~ msgstr "(Optionen:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "INTERNER FEHLER: Falscher Kode in zurückgestellten Argumenten"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "INTERNER FEHLER: Falscher Datentyp des Tokens in expands_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "INTERNER FEHLER: Falscher Typ des Tokens in expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "INTERNER FEHLER: Falsche Symboltyp in call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "FEHLER: Kann Module nicht initialisieren: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "FEHLER: Kann Modul nicht finden: »%s«."
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "FEHLER: Kann Modul nicht finden: »%s«: %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "FEHLER: Kann Module nicht schließen."
+
+# XXX: Autor fragen, ob "cannot cannot" absicht ist.
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "FEHLER: Kann Module nicht schließen: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "FEHLER: Kann Modul nicht schließen: »%s«: %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Pfad für Suche nach »%s« hat »%s« gefunden"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Verletzung der Speichergrenzen festgestellt (SIGSEGV). Entweder ist ein\n"
+#~ "Stacküberlauf aufgetreten, oder es gibt einen Fehler in "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Untersuche auf mögliche unendliche Rekursion.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "INTERNER FEHLER: Illegaler Modus bei symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Name »%s« ist unbekannt\n"
diff --git a/po/el.gmo b/po/el.gmo
new file mode 100644 (file)
index 0000000..4e6443d
Binary files /dev/null and b/po/el.gmo differ
diff --git a/po/el.po b/po/el.po
new file mode 100644 (file)
index 0000000..a50e539
--- /dev/null
+++ b/po/el.po
@@ -0,0 +1,1293 @@
+# Greek messages for GNU m4.
+# Copyright (C) 1999 Free Software Foundation, Inc.
+# Simos Xenitellis <S.Xenitellis@rhbnc.ac.uk>, 1999.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU m4 1.4n\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 1999-06-24 00:25+0000\n"
+"Last-Translator: Simos Xenitellis <S.Xenitellis@rhbnc.ac.uk>\n"
+"Language-Team: Greek <nls@tux.hellug.gr>\n"
+"Language: el\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=iso-8859-7\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "ÓÖÁËÌÁ: Áäõíáìßá äçìéïõñãßáò ðñïóùñéíïý áñ÷åßïõ ãéá áëëáãÞ"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Áäõíáìßá ñýèìéóçò ôïõ áñ÷åßïõ óöáëìÜôùí: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr ""
+
+#: lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr ""
+
+#: lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr ""
+
+#: lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr ""
+
+#: lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr ""
+
+#: lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr ""
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr ""
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr ""
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr ""
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr ""
+
+#: lib/regcomp.c:141
+#, fuzzy
+msgid "Invalid regular expression"
+msgstr "ËÜèïò êáíïíéêÞ Ýêöñáóç `%s': %s"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr ""
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr ""
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr ""
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr ""
+
+#: lib/regcomp.c:156
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr ""
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr ""
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr ""
+
+#: lib/regcomp.c:174
+#, fuzzy
+msgid "Invalid preceding regular expression"
+msgstr "ÓöÜëìá óôï ôáßñéáóìá óôçí êáíïíéêÞ Ýêöñáóç `%s'"
+
+#: lib/regcomp.c:177
+#, fuzzy
+msgid "Premature end of regular expression"
+msgstr "Ðñüùñï ôÝëïò ðáãùìÝíïõ áñ÷åßïõ"
+
+#: lib/regcomp.c:180
+#, fuzzy
+msgid "Regular expression too big"
+msgstr "ËÜèïò êáíïíéêÞ Ýêöñáóç `%s': %s"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: lib/regcomp.c:676
+#, fuzzy
+msgid "No previous regular expression"
+msgstr "ÓöÜëìá óôï ôáßñéáóìá óôçí êáíïíéêÞ Ýêöñáóç `%s'"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Ôï üñéï ôçò åéêïíéêÞ ìíÞìçò åîáíôëÞèçêå;\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Ôï üñéï ôçò åéêïíéêÞ ìíÞìçò åîáíôëÞèçêå;\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Ìç ïñéóìÝíï üíïìá %s"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Ìç ïñéóìÝíï üíïìá %s"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"ÁíáöÝñáôå óöÜëìáôá óôï <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "ËÜèïò êáíïíéêÞ Ýêöñáóç `%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Ðñïåéäïðïßçóç: Ðïëý ëßãá ïñßóìáôá óôï åóùäïìçìÝíï `%s'"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Ðñïåéäïðïßçóç: ÅðéðëÝïí ïñßóìáôá óôï åóùäïìçìÝíï `%s' áãíïÞèçêáí"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Ìç-áñèìçôéêü üñéóìá óôï åóùäïìçìÝíï `%s'"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Ìç-áñèìçôéêü üñéóìá óôï åóùäïìçìÝíï `%s'"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Ìç ïñéóìÝíç ìáêñïåíôïëÞ `%s'"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Ìç ïñéóìÝíï üíïìá %s"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Ðñïåéäïðïßçóç: Ðïëý ëßãá ïñßóìáôá óôï åóùäïìçìÝíï `%s'"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Áäõíáìßá áíïßãìáôïò óùëÞíùóçò óôçí åíôïëÞ `%s'"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Áñíçôéêü ðëÜôïò óôçí áðïôßìçóç"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Áäõíáìßá åðáíáöïñÜò ôïõ %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Áäõíáìßá åðáíáöïñÜò ôïõ %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Áäõíáìßá áíïßãìáôïò ôïõ %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "ÓÖÁËÌÁ: áäõíáìßá åýñåóçò Üñèñùóçò `%s'"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "ÊáôÜóôáóç áðïóöáëìÜôùóçò: ëÜèïò óçìáßåò áðïóöáëìÜôùóçò: `%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Áäõíáìßá ñýèìéóçò ôïõ áñ÷åßïõ óöáëìÜôùí: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr ""
+"ÐÑÏÅÉÄÏÐÏÉÇÓÇ: Ôï \\0 èá åîáöáíéóôåß, êÜíåôå ÷ñÞóç ôïõ \\& áíôßèåôá óôéò "
+"áíôéêáôáóôÜóåéò"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "ËÜèïò êáíïíéêÞ Ýêöñáóç `%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "ÓöÜëìá óôï ôáßñéáóìá óôçí êáíïíéêÞ Ýêöñáóç `%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "ËÜèïò êáíïíéêÞ Ýêöñáóç `%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "ËÜèïò Ýêöñáóç óôçí áðïôßìçóç (ëåßðåé äåîéÜ ðáñÝíèåóç): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "ËÜèïò Ýêöñáóç óôçí áðïôßìçóç: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "ËÜèïò Ýêöñáóç óôçí áðïôßìçóç (ëÜèïò åßóïäïò): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "ËÜèïò Ýêöñáóç óôçí áðïôßìçóç (õðåñâïëéêÞ åßóïäïò): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Äéáßñåóç ìå ìçäÝí óôçí áðïôßìçóç: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Äéáßñåóç ìå ìçäÝí óôçí áðïôßìçóç: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Õðüëïéðï ìå ìçäÝí óôçí áðïôßìçóç: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "ËÜèïò Ýêöñáóç óôçí áðïôßìçóç: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Ìç áñéèìçôéêü üñéóìá óôï %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr ""
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Áíáìåíüôáí `line feed' óôï ðáãùìÝíï áñ÷åßï"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Áíáìåíüôáí ÷áñáêôÞñáò `%c' óôï ðáãùìÝíï áñ÷åßï"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Áíáìåíüôáí `line feed' óôï ðáãùìÝíï áñ÷åßï"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Ðñüùñï ôÝëïò ðáãùìÝíïõ áñ÷åßïõ"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Áäõíáìßá áíïßãìáôïò ôïõ %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Êáêü-ìïñöïðïéçìÝíï ðáãùìÝíï áñ÷åßï"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "ÓÖÁËÌÁ: EOF óôï áëöáñéèìçôéêü"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "ÄïêéìÜóôå `%s --help' ãéá ðåñéóóüôåñç âïÞèåéá.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "×ñÞóç: %s [ÅÐÉËÏÃÇ]... [ÁÑ×ÅÉÏ]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"×ùñßò ÁÑ×ÅÉÏ, Þ üôáí ôï áñ÷åßï åßíáé ôï -, áíÜãíùóç áðü ôçí êáíïíéêÞ "
+"åßóïäï.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"   -W --word-regexp=ÊÁÍÅÊÖ     ÷ñÞóç ÊÁÍïíéêÞò ¸ÊÖñáóçò óôï óõíôáêôéêü ôçò "
+"ìáêñïåíôïëÞò\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"×áñáêôçñéóôéêÜ ðñïåðåîåñãáóôÞ:\n"
+"  -I, --include=ÊÁÔÁËÏÃÏÓ      øÜîéìï ìåôÜ êáé óôï êáôÜëïãï áõôü ãéá "
+"ðåñéëáìâáíüìåíá\n"
+"  -D, --define=ÏÍÏÌÁ[=ÔÉÌÇ]    åéóáãùãÞ Ïͼìáôïò ìå ÔÉÌÇ, Þ êåíü\n"
+"  -U, --undefine=ÏÍÏÌÁ         äéáãñáöÞ åóùäïìçìÝíïõ ÏͼÌÁôïò\n"
+"  -s, --synclines              äçìéïõñãßá ãñáììþí `#line ÁÑÉÈÌÏÓ \"ÁÑ×ÅÉÏ"
+"\"'\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"¸ëåã÷ïò ðåñéïñéóìþí:\n"
+"  -G, --traditional            áðüêñõøç üëùí ôùí åðåêôÜóåùí GNU\n"
+"  -H, --hashsize=ÐÑÙÔÏÓ        ïñéóìüò ìåãÝèïõò ðßíáêá áíáæÞôçóçò óõìâüëïõ\n"
+"  -L, --nesting-limit=ÁÑÉÈÌÏÓ  áëëáãÞ ôå÷íçôïý ïñßïõ öùëéáóìþí\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Áñ÷åßá ðáãùìÝíçò êáôÜóôáóçò:\n"
+"  -F, --freeze-state=ARXEIO    äçìéïõñãßá ðáãùìÝíçò êáôÜóôáóçò óôï ÁÑ×ÅÉÏ "
+"óôï ôÝëïò\n"
+"  -R, --reload-state=ARXEIO    öüñôùìá îáíÜ ðáãùìÝíçò êáôÜóôáóçò áðü ÁÑ×ÅÉÏ "
+"óôçí åêêßíçóç\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"ÅêóöáëìÜôùóç:\n"
+"  -d, --debug=[ÓÇÌÁÉÅÓ]        ïñéóìüò åðéðÝäïõ åêóöáëìÜôùóçò (÷ùñßò ÓÇÌÁÉÅÓ "
+"õðïíïåß `aeq')\n"
+"  -t, --trace=ONOMA            áíß÷íåõóç ÏͼÌÁôïò üôáí áõôü èá ïñéóôåß\n"
+"  -l, --arglength=ÁÑÉÈÌ        ðåñéïñéóìüò ìåãÝèïõò áíß÷íåõóçò ìáêñïåíôïëÞò\n"
+"  -o, --error-output=ÁÑ×ÅÉÏ    åðáíáêáôåýèõíóç åîüäïõ åêóöáëìÜôùóçò êáé "
+"áíß÷íåõóçò\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "ËÜèïò óçìáßåò åêóöáëìÜôùóçò: `%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "ÓÖÁËÌÁ: EOF óôç ëßóôá ïñéóìÜôùí"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"ÓÖÁËÌÁ: Ôï üñéï áíáäñïìÞò %d îåðåñÜóôçêå, êÜíôå ÷ñÞóç ôïõ -L<N> ãéá íá ôï "
+"áëëÜîåôå"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "ÓÖÁËÌÁ: Áäõíáìßá äçìéïõñãßáò ðñïóùñéíïý áñ÷åßïõ ãéá áëëáãÞ"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "ÓÖÁËÌÁ: Áäõíáìßá äçìéïõñãßáò ðñïóùñéíïý áñ÷åßïõ ãéá áëëáãÞ"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Áäõíáìßá ðñïóðÝëáóçò ôïõ áñ÷åßïõ ôçò áëëáãÞò"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "ÓÖÁËÌÁ: Áäõíáìßá äçìéïõñãßáò ðñïóùñéíïý áñ÷åßïõ ãéá áëëáãÞ"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "ÓÖÁËÌÁ: Áäõíáìßá áðïóôïëÞò áëëáãÞò óôï ðñïóùñéíü áñ÷åßï"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "ÓÖÁËÌÁ: ÁíôéãñáãÞ åéóåñ÷ïìÝíïõ áñ÷åßïõ"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "ÓÖÁËÌÁ: ÁíÜãíùóç åéóåñ÷ïìÝíïõ áñ÷åßïõ"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Áäõíáìßá ðñïóðÝëáóçò ôïõ áñ÷åßïõ ôçò áëëáãÞò"
+
+#: src/output.c:987
+msgid "diversion too large"
+msgstr ""
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr ""
+#~ "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò ôýðïò äåäïìÝíïõ áíôéêåéìÝíïõ óôï define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ÅóùäïìçìÝíï äå âñÝèçêå óôï ðßíáêá åóùäïìçìÝíùí!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr ""
+#~ "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò ôýðïò äåäïìÝíïõ áíôéêåéìÝíïõ óôï m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò ôýðïò óõìâüëïõ óôï m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Ç âÜóç óôçí áðïôßìçóç åßíáé åêôüò ïñßïõ (âÜóç = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Ìç ïñéóìÝíïò êþäéêáò óýíôáîçò %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ÅóùäïìçìÝíï äåí âñÝèçêå óôï ðßíáêá åóùäïìçìÝíùí! "
+#~ "(trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò ôýðïò äåäïìÝíïõ áíôéêåéìÝíïõ (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò êþäéêáò óöÜëìáôïò óôçí evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò ôåëåóôÞò óýãêñéóçò óôï cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò ôåëåóôÞò ïëßóèçóçò óôï shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò ôåëåóôÞò óôï mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ÅóùäïìçìÝíï äå âñÝèçêå óôï ðßíáêá åóùäïìçìÝíùí!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò ôýðïò äåäïìÝíïõ áíôéêåéìÝíïõ óôï "
+#~ "freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "ôï `%s' áðü ðáãùìÝíï áñ÷åßï äå âñÝèçêå óôïí ðßíáêá åóùäïìçìÝíùí"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Ç åßóïäïò åðáíáöÝñèçêå óôï %s, ãñáììÞ %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Ç åßóïäïò áíáãíþóôçêå áðü ôï %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: Áíáäñïìéêü push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ÊáêÞ êëÞóç óôï init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: Áëëïßùóç óôïßâáò åéóüäïõ óôï next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: Áëëïßùóç óôïßâáò åéóüäïõ óôï peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "ÊÁÍÅÍÁ"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "ÓÖÁËÌÁ: Õðåñ÷åßëçóç óôïßâáò. (ÁíáäñïìÞ áðåßñïõ âÜèïõò;)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Õðï÷ñåùôéêÜ Þ ðñïáéñåôéêÜ ïñßóìáôá óå ìáêñÝò åðéëïãÝò åßíáé õðï÷ñåùôéêÜ Þ "
+#~ "ðñïáéñåôéêÜ\n"
+#~ "êáé ãéá ôçò óýíôïìåò åðéëïãÝò åðßóåéò.\n"
+#~ "\n"
+#~ "ÊáôáóôÜóåéò ëåéôïõñãßáò:\n"
+#~ "      --help                   åìöÜíéóç áõôÞò ôçò âïÞèåéáò êáé Ýîïäïò\n"
+#~ "      --version                åìöÜíéóç ðëçñïöïñéþí Ýêäïóçò êáé Ýîïäïò\n"
+#~ "  -e, --interactive            Ýîïäïò ÷ùñßò åíôáìéåõôÞ, áãíüçóç äéáêïðþí\n"
+#~ "  -E, --fatal-warnings         äéáêïðÞ åêôÝëåóçò ìåôÜ áðü ôç ðñþôç "
+#~ "ðñïåéäïðïßçóç\n"
+#~ "  -Q, --quiet, --silent        áðüêñõøç ìåñéêþí ðñïåéäïðïéÞóåùí óôá "
+#~ "åóùäïìçìÝíá\n"
+#~ "  -P, --prefix-builtins        åðéâïëÞ ðñïèÝìáôïò `m4_' óå üëá ôá "
+#~ "åóùäïìçìÝíá\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "ÓÇÌÁÉÅÓ ìðïñåß íá åßíáé ïðïéäÞðïôå áðü:\n"
+#~ "  t   áíß÷íåõóç üëùí ôùí êëÞóåùí ôùí ìáêñïåíôïëþí, ü÷é ìüíï áõôÝò ðïõ "
+#~ "Ý÷ïõí ïñéóôåß\n"
+#~ "  a   åìöÜíéóç ðñáãìáôéêþí ïñéóìÜôùí\n"
+#~ "  e   åìöÜíéóç áíÜðôõîçò\n"
+#~ "  q   ðáñÜèåóå ôéìÝò üðùò ÷ñåéÜæåôáé, ìå ôéò óçìáßåò a Þ e\n"
+#~ "  c   åìöÜíéóç ðñéí ôç óõëëïãÞ, ìåôÜ ôç óõëëïãÞ êáé ìåôÜ ôç êëÞóç\n"
+#~ "  x   ðñüóèåóç ìïíáäéêÞò ôáõôüôçôáò êëÞóçò ìáêñïåíôïëÞò, ÷ñÞóéìï ìå ôç "
+#~ "óçìáßá c\n"
+#~ "  f   åìöÜíéóç ôñÝ÷ïíôïò ïíüìáôïò áñ÷åßïõ åéóüäïõ\n"
+#~ "  l   åìöÜíéóç áñéèìü ôñå÷ïýóçò ãñáììÞò åéóüäïõ\n"
+#~ "  p   åìöÜíéóç áðïôåëåóìÜôùí áðü Ýñåõíåò óôï ìïíïðÜôé\n"
+#~ "  i   åìöÜíéóç áëëáãþí óôá áñ÷åßá åéóüäïõ\n"
+#~ "  V   óõíôïìïãñáößá ãéá üëåò ôéò ðáñáðÜíù óçìáßåò\n"
+
+#~ msgid " (options:"
+#~ msgstr " (åðéëïãÝò:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò êùäéêüò óôá áíáöåñüìåíá ïñßóìáôá"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò åßäïò áíôéêåéìÝíïõ óôï expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò åßäïò áíôéêåéìÝíïõ óôï expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ËÜèïò åßäïò óõìâüëïõ óôï call_macro ()"
+
+#, fuzzy, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ÓÖÁËÌÁ: áäõíáìßá åýñåóçò Üñèñùóçò `%s': %s"
+
+#, fuzzy, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ÓÖÁËÌÁ: áäõíáìßá åýñåóçò Üñèñùóçò `%s'"
+
+#, fuzzy, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ÓÖÁËÌÁ: áäõíáìßá åýñåóçò Üñèñùóçò `%s': %s"
+
+#, fuzzy
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ÓÖÁËÌÁ: áäõíáìßá åýñåóçò Üñèñùóçò `%s'"
+
+#, fuzzy, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "ÓÖÁËÌÁ: áäõíáìßá åýñåóçò Üñèñùóçò `%s': %s"
+
+#, fuzzy, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "ÓÖÁËÌÁ: áäõíáìßá åýñåóçò Üñèñùóçò `%s': %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Ï Ýëåã÷ïò ìïíïðáôéïý ãéá ôï `%s' âñÞêå `%s'"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Åíôïðßóôçêå ðáñÜâáóç ôùí ïñßùí ìíÞìçò (SIGSEGV). Åßôå Ýãéíå õðÝñâáóç "
+#~ "óôïßâáò\n"
+#~ "åßôå õðÜñ÷åé óöÜëìá ðñïãñÜììáôïò óôï "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  ÅëÝãîáôå ãéá ðéèáíÞ åð'Üðåéñï áíáäñïìÞ.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "ÅÓÙÔÅÑÉÊÏ ÓÖÁËÌÁ: ÁíôéêáíïíéêÞ êáôÜóôáóç óôï symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Ôï üíïìá `%s' åßíáé Üãíùóôï\n"
+
+#~ msgid "Module search for `%s' found `%s'"
+#~ msgstr "Ç Ýñåõíá Üñèñùóçò ãéá `%s' âñÞêå `%s'"
diff --git a/po/en@boldquot.header b/po/en@boldquot.header
new file mode 100644 (file)
index 0000000..fedb6a0
--- /dev/null
@@ -0,0 +1,25 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
+# This catalog furthermore displays the text between the quotation marks in
+# bold face, assuming the VT100/XTerm escape sequences.
+#
diff --git a/po/en@quot.header b/po/en@quot.header
new file mode 100644 (file)
index 0000000..a9647fc
--- /dev/null
@@ -0,0 +1,22 @@
+# All this catalog "translates" are quotation characters.
+# The msgids must be ASCII and therefore cannot contain real quotation
+# characters, only substitutes like grave accent (0x60), apostrophe (0x27)
+# and double quote (0x22). These substitutes look strange; see
+# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
+#
+# This catalog translates grave accent (0x60) and apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019).
+# It also translates pairs of apostrophe (0x27) to
+# left single quotation mark (U+2018) and right single quotation mark (U+2019)
+# and pairs of quotation mark (0x22) to
+# left double quotation mark (U+201C) and right double quotation mark (U+201D).
+#
+# When output to an UTF-8 terminal, the quotation characters appear perfectly.
+# When output to an ISO-8859-1 terminal, the single quotation marks are
+# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to
+# grave/acute accent (by libiconv), and the double quotation marks are
+# transliterated to 0x22.
+# When output to an ASCII terminal, the single quotation marks are
+# transliterated to apostrophes, and the double quotation marks are
+# transliterated to 0x22.
+#
diff --git a/po/eo.gmo b/po/eo.gmo
new file mode 100644 (file)
index 0000000..bbb7284
Binary files /dev/null and b/po/eo.gmo differ
diff --git a/po/eo.po b/po/eo.po
new file mode 100644 (file)
index 0000000..384153e
--- /dev/null
+++ b/po/eo.po
@@ -0,0 +1,1311 @@
+# m4: translation to Esperanto (eo)
+# Copyright (C) 2013 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Felipe Castro <fefcas@gmail.com>, 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2013-01-30 14:03-0300\n"
+"Last-Translator: Felipe Castro <fefcas@gmail.com>\n"
+"Language-Team: Esperanto <translation-team-eo@lists.sourceforge.net>\n"
+"Language: eo\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "ERARO: ne eblas krei provizoran dosieron por deturno"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Ne eblas difini erar-dosieron: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: modifilo '%s' estas plursenca\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: modifilo '%s' estas plursenca\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: nerekonata modifilo '%c%s'\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: modifilo '%c%s' ne permesas argumenton\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: modifilo '%s' postulas argumenton\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: malvalida modifilo -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: modifilo postulas argumenton -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoro estas plenigita"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Sukceso"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Neniu kongruo"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Malvalida regulesprimo"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Malvalida ordo-difina signo"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Malvalida signa klasnomo"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Vosta retroklino"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Malvalida retroreferenco"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Senpara [ aŭ [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Senpara ( aŭ \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Senpara \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Malvalida enhavo de \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Malvalida intervalofino"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memoro estas plenigita"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Malvalida antaŭa regulesprimo"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Tro frua fino de regulesprimo"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regulesprimo tro grandas"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Senpara ) aŭ \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Neniu antaŭa regulesprimo"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Ĉu VMEM-limo estis atingata?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Ĉu VMEM-limo estis atingata?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Nedifinita nomo %s"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Nedifinita nomo %s"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Raportu programajn misojn al <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Malĝusta regulesprimo '%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Averto: tro malmultaj argumentoj por la internaĵo '%s'"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Averto: troaj argumentoj por la internaĵo '%s' estas preteratentitaj"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Ne-cifera argumento por la internaĵo '%s'"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Ne-cifera argumento por la internaĵo '%s'"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Nedifinita nomo '%s'"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Nedifinita nomo '%s'"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Averto: tro malmultaj argumentoj por la internaĵo '%s'"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Ne eblas malfermi dukton al la komando '%s'"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Negativa larĝo por eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Ne eblas mal-deturnigi %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Ne eblas mal-deturnigi %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Ne eblas malfermi %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "ERARO: ne eblas fermi modulojn: '%s'"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Rafinreĝimo: malĝustaj rafinigaj flagoj: '%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Ne eblas difini erar-dosieron: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "AVERTO: \\0 malaperos, uzu \\& en anstataŭigoj"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Malĝusta regulesprimo '%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Eraro en kongruo de regulesprimo '%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Malĝusta regulesprimo '%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Malĝusta esprimo en eval (mankas dekstra kurb-krampo): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Malĝusta esprimo en eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Malĝusta esprimo en eval (malĝusta enigo): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Malĝusta esprimo en eval (troa enigo): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Divido per nulo en eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Divido per nulo en eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulo per nulo en eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Malĝusta esprimo en eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Ne-cifeca argumento por %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: nerekonata modifilo '%c%s'\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Estas atendata linisalto en frostigita dosiero"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Estas atendata signo '%c' en frostigita dosiero"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Estas atendata linisalto en frostigita dosiero"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Trofrua fino de frostigita dosiero"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Ne eblas malfermi %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Aĉe formata frostigita dosiero"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "ERARO: EOF en ĉeno"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Provu '%s --help' por pli da informoj.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Uzmaniero: %s [MODIFILO]... [DOSIERO]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Se mankas DOSIERO aŭ se DOSIERO estas '-', ĉefenigo estos legata.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr "  -W, --word-regexp=REGESP     uzi REGESP por makro-noma sintakso\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Antaŭprocezaj trajtoj:\n"
+"  -I, --include=DOSIERUJO      serĉi tiun ĉi dosierujon poste por "
+"inkluzivoj\n"
+"  -D, --define=NOMO[=VALORO]   enigi NOMOn havantan VALOROn, aŭ malplenan\n"
+"  -U, --undefine=NOMO          forigi la internaĵon NOMO\n"
+"  -s, --synclines              generi liniojn '#line NUM \"DOSIERO\"'\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Limig-kontrolo:\n"
+"  -G, --traditional            forigi ĉiujn aldonojn de GNU\n"
+"  -H, --hashsize=PRIMO         difini grandon de simbolserĉa haktabelo\n"
+"  -L, --nesting-limit=NUMERO   ŝanĝi artefarit-nestan limon\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Frostitaj stat-dosieroj:\n"
+"  -F, --freeze-state=DOSIERO   produkti frostitan staton ĉe la fino de "
+"DOSIERO\n"
+"  -R, --reload-state=DOSIERO   reŝargi frostitan staton ĉe la komenco de "
+"DOSIERO\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Rafinigo:\n"
+"  -d, --debug=[FLAGOJ]         difini rafinigan nivelon (sen FLAGOJ implicas "
+"'aeq')\n"
+"  -t, --trace=NOMO             spursekvi NOMOn kiam ĝi estos difinita\n"
+"  -l, --arglength=NUM          limigi kiom spursekvi makroojn\n"
+"  -o, --error-output=DOSIERO   alidirekti rafinigan kaj spursekvan eligon\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Malĝustaj rafinigaj flagoj: '%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "ERARO: EOF en argument-listo"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "ERARO: rekursiga limo de %d estis atingata, uzu -L<N> por ŝanĝi ĝin"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "ERARO: ne eblas krei provizoran dosieron por deturno"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "ERARO: ne eblas krei provizoran dosieron por deturno"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Ne eblas apliki stat en deturno"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "ERARO: ne eblas krei provizoran dosieron por deturno"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "ERARO: ne eblas elbufrigi deturnon al provizora dosiero"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "ERARO: kopio de enmetita dosiero"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "ERARO: lego de enmetita dosiero"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Ne eblas apliki stat en deturno"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Deturno tro larĝas"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: modifilo '--%s' ne permesas argumenton\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: nerekonata modifilo '--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: malpermesata modifilo -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: modifilo '-W %s' estas plursenca\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: modifilo '-W %s' ne permesas argumenton\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "INTERNA ERARO: malĝusta ĵetona datumartipo en define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "INTERNA ERARO: internaĵo ne estis trovata en internaĵ-tabelo!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "INTERNA ERARO: malĝusta ĵetona datumartipo en m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "INTERNA ERARO: malĝusta simboltipo en m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Bazo en eval estas for de intervalo (bazo = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Nedifinita sintaksa kodo %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "INTERNA ERARO: internaĵo ne estis trovata en internaĵ-tabelo! (trace_pre "
+#~ "())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "INTERNA ERARO: malĝusta ĵetona datumartipo (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "INTERNA ERARO: malĝusta erarkodo en evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "INTERNA ERARO: malĝusta kompara operatoro en cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "INTERNA ERARO: malĝusta ŝova operatoro en shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "INTERNA ERARO: malĝusta operatoro en mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "INTERNA ERARO: internaĵo ne estis trovata en internaĵ-tabelo!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "INTERNA ERARO: malĝusta ĵetona datumartipo en freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "'%s' el frostigita dosiero ne estis trovata en internaĵ-tabelo!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Enigo revenigita al %s, linio %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Enigo legata el %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "INTERNA ERARO: rekursiga push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "INTERNA ERARO: malĝusta voko al init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "INTERNA ERARO: Enig-staka fuŝo en next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "INTERNA ERARO: Enig-staka fuŝo en peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "NENIU"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "ERARO: Staka troigo.  (Ĉu senfina rekursigo de 'define'?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Argumentoj devigaj aŭ ne por longaj modifiloj ankaŭ estas devigaj aŭ ne\n"
+#~ "por la mallongaj modifiloj.\n"
+#~ "\n"
+#~ "Funkciadaj reĝimoj:\n"
+#~ "      --help                   montri tiun ĉi mesaĝon kaj eliri\n"
+#~ "      --version                eligi versi-informon kaj eliri\n"
+#~ "  -e, --interactive            malbufrigi eligon, preteratenti "
+#~ "interrompojn\n"
+#~ "  -E, --fatal-warnings         haltigi funkciadon post la unua averto\n"
+#~ "  -Q, --quiet, --silent        forigi kelkajn avertojn pri internaĵoj\n"
+#~ "  -P, --prefix-builtins        perforti prefikson 'm4_' al ĉiuj "
+#~ "internaĵoj\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Dinamika-ŝargaj trajtoj:\n"
+#~ "  -m, --module-directory=DOSIERUJO  aldoni DOSIERUJOn al la modula "
+#~ "serĉvojo\n"
+#~ "  -M, --load-module=MODULO          ŝargi la dinamikan MODULOn el "
+#~ "M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "FLAGOJ estas iu ajn el:\n"
+#~ "  t   spursekvi ĉiujn makro-vokojn, ne nur la spursekvendajn\n"
+#~ "  a   montri faktajn argumentojn\n"
+#~ "  e   montri rezultan etendigon\n"
+#~ "  q   citiligi la valorojn laŭ neceso, uzante flagojn a aŭ e\n"
+#~ "  c   montri antaŭ la kolekto, post la kolekto kaj post la voko\n"
+#~ "  x   aldoni unikan makroan vokan id, utilas kun la flago c\n"
+#~ "  f   almontri la nunan enigan dosiernomon\n"
+#~ "  l   almontri la nunan  enigan lininumeron\n"
+#~ "  p   montri rezultojn de vojserĉoj\n"
+#~ "  i   montri ŝanĝoj en enigaj dosieroj\n"
+#~ "  V   tujmaniero por kunmeti ĉiujn suprajn flagojn\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "ERARO: fiasko aldonante la serĉ-dosierujon '%s'"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "ERARO: fiasko aldonante la serĉ-dosierujon '%s': %s"
+
+#~ msgid " (options:"
+#~ msgstr " (modifiloj:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "INTERNA ERRAO: malĝusta kodo en nerektaj argumentoj"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "INTERNA ERRAO: malĝusta ĵeton-tipo en expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "INTERNA ERARO: malĝusta ĵeton-tipo en expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "INTERNA ERARO: malĝusta simbol-tipo en call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ERARO: fiaskis ekigo de moduloj: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ERARO: ne eblas trovi modulon: '%s'"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ERARO: ne eblas trovi modulon: '%s': %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ERARO: ne eblas fermi modulojn"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "ERARO: ne eblas fermi modulojn: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "ERARO: ne eblas fermi modulojn: '%s': %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Voj-serĉo por '%s' trovis '%s'"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Trapaso de memorlimo estis detektata (SIGSEGV).  Aŭ staka troigo\n"
+#~ "okazis, aŭ ekzistas miso en "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Kontrolu eblan senliman rekursigon.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "INTERNA ERARO: malpermesita reĝimo por symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "La nomo '%s' estas nekonata\n"
diff --git a/po/es.gmo b/po/es.gmo
new file mode 100644 (file)
index 0000000..8de490f
Binary files /dev/null and b/po/es.gmo differ
diff --git a/po/es.po b/po/es.po
new file mode 100644 (file)
index 0000000..e6a8888
--- /dev/null
+++ b/po/es.po
@@ -0,0 +1,1323 @@
+# Spanish translation of m4 1.4o package
+# Copyright (C) 2018 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Francisco Javier Serrador <fserrador@gmail.com>, 2018.
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2018-03-27 22:20+0200\n"
+"Last-Translator: Francisco Javier Serrador <fserrador@gmail.com>\n"
+"Language-Team: Spanish <es@tp.org.es>\n"
+"Language: es\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"X-Generator: Virtaal 0.7.1\n"
+"X-Poedit-SourceCharset: UTF-8\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "ERROR: no puede crear temporalmente un fichero de diversión"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "No puede establecer fichero de error: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: opción «%s» es ambigua\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: opción «%s» es ambigua\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: opción desconocida `%c%s'\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: opción «%c%s» no admite un argumento\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: opción «%s» precisa un argumento\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opción no válida -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opción requiere un argumento -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoria agotada"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Correcto"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Sin coincidencia"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Expresión regular no válida"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Carácter de ordenamiento inválido"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Carácter de nombre de clase no válido"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Diagonal invertida al final"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Referencia anterior no válida"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Sin pareja [ o [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Sin pareja ( o \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Sin pareja \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Contenido inválido de \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Final de rango no válido"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memoria agotada"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Expresión regular precedente inválida"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Final prematuro de expresión regular"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Expresión regular demasiado grande"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Sin pareja ) o \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Sin expresión regular previa"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "¿Límite VMEM excedido?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "¿Límite VMEM excedido?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Nombre %s sin definir"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Nombre %s sin definir"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Envíe defectos a <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Expresión regular equivocada «%s»: %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Cuidado: argumentos escasos para compilación interna «%s»"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Cuidado: argumentos excesivos para compilación interna «%s» ignorada"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Argumento no numérico a compilación interna «%s»"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Argumento no numérico a compilación interna «%s»"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Nombre «%s» indefinido"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Nombre «%s» indefinido"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Cuidado: argumentos escasos para compilación interna «%s»"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "No puede abrir una tubería a orden «%s»"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Anchura negativa a evaluar"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "No puede desdivertir %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "No puede desdivertir %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "No puede abrir %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "ERROR: no puede cerrar un módulo: «%s»"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Modo depurable: marcas depuradas equivocadas: «%s»"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "No puede establecer fichero de error: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "CUIDADO: \\0 desaparecerá, emplee \\& en su lugar en reubicaciones"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Expresión regular equivocada «%s»: %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Error coincidiendo expresión regular «%s»"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Expresión regular equivocada «%s»: %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Expresión equivocada en evaluación (faltando paréntesis derecho): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Expresión equivocada en evaluación: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Expresión equivocada en evaluación (entrada equivocada): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Expresión equivocada en evaluación (entrada excesiva): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Divide entre cero en evaluación: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Divide entre cero en evaluación: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Módulo entre cero en evaluación: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Expresión equivocada en evaluación: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Argumento no numérico a %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: opción desconocida `%c%s'\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Esperando línea alimentada en fichero congelado"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Esperando caracter `%c' en fichero congelado"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Esperando línea alimentada en fichero congelado"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Final prematuro de fichero congelado"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "No puede abrir %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Formato chapucero de fichero congelado"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "ERROR: FDL dentro de cadena textual"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Pruebe `%s --help' para más información.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr ""
+"Modo de empleo: %s [OPCIÓN]... [FICHERO]...\n"
+"\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Si ningún FICHERO o si fichero ES `.', entrada común es leída.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=REGEXP    utiliza EXPREG para nombre sintáctico de "
+"macro\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Caracterñisticas del preprocesador:\n"
+"  -I, --include=DIRECTORIO      busqueda de este segundo directorio para "
+"incluír\n"
+"  -D, --define=NOMBRE[=VALOR]   introduce NOMBRE ha tenido VALOR, o vacío\n"
+"  -U, --undefine=NOMBRE         borra compilación NOMBRE\n"
+"  -s, --synclines               genera líneas `#líne NO \"FILA\"'\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Limitación de control:\n"
+"  -G, --tradicional            suprime todas las extensiones de GNU\n"
+"  -H, --hashsize=PRIME         establece símbolo vista hash tabla tamaño\n"
+"  -L, --nesting-limit=NÚMERO   modifica límite de anidación artificial\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Ficheros de estado congelado:\n"
+"  -F, --freeze-state=FICHERO    produce un estado congelado en FICHERO al "
+"final\n"
+"  -R, --reload-state=FICHERO    recarga un estado congelado desde FICHERO al "
+"inicio\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Depuración:\n"
+"  -d, --debug=[MARCAS]    establece nivel depurador (sin MARCAS implica "
+"`aeq')\n"
+"  -t, --trace=NOMBRE        trazar NOMBRE cuando será definido\n"
+"  -L, --arglength=NUM     macro restricta trazando tamaño\n"
+"  -o, --error-output=FICHERO    redirige salida de depuración y traza\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Marcas depurativas equivocads: «%s»"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "ERROR: FDL dentro de listado argumental"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"ERROR: límite de recursión de %d excedido, emplee -L <N> para modificarlo"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "ERROR: no puede crear temporalmente un fichero de diversión"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "ERROR: no puede crear temporalmente un fichero de diversión"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "No puede obtener diversión"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "ERROR: no puede crear temporalmente un fichero de diversión"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "ERROR: no puede vaciar diversión a fichero temporal"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "ERROR: copiando fichero insertado"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "ERROR: leyendo fichero insertado"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "No puede obtener diversión"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Diversión demasiado grande"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: opción --%s no permite un argumento\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: opción desconocida `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opción ilegal -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: opción `-W %s' es ambigua\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: opción `-W %s' no permite un argumento\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "ERROR INTERNO: Tipo de marca equivocada en define_macro()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "ERROR INTERNO: ¡Compilación no encontrada en tabla compilada!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "ERROR INTERNO: Tipo de marca equivocada en in m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr ""
+#~ "ERROR INTERNO: tipo simbólico equivocado dentro de llamada m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Radio en evaluación fuera de rango (radio = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Código sintáctico indefinido %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "ERROR INTERNO: ¡Compilación no encontrada en tabla compilada! (trace_pre "
+#~ "())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "ERROR INTERNO: Tipo de datos equivocados (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr ""
+#~ "ERROR INTERNO: código de error equivocado dentro de evaluación evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "ERROR INTERNO: comparación de operador equivocada en cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "ERROR INTERNO: operador mayúsculo equivocado en shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "ERROR INTERNO: operador equivocado en mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "ERROR INTERNO: ¡Compilación interna no encontrada en tabla interna!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "ERROR INTERNO: Tipo de marca equivocada en freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr ""
+#~ "¡«%s» desde fichero congelado no encontrado en distribución interna!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Entrada revertida a %s, línea %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Entrada leída desde %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "ERROR INTERNO: ¡ función push_string recursiva!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "ERROR INTERNO: llamada equivocada a llamada init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "ERROR INTERNO: pila entrante chapucera en next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "ERROR INTERNO: pila entrante chapucera en peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "NINGUNO"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr ""
+#~ "ERROR: desbordamiento superior de pila.  (¿Infinito define recursión?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Argumento mandatorio u opcional para opciones largas son mandatorios u "
+#~ "opcionales para\n"
+#~ "opciones cortas también.\n"
+#~ "\n"
+#~ "Modos de operación:\n"
+#~ "        --help\t\t\tenseña esta ayuda y sale\n"
+#~ "        --version\t\tsaca información de versión y sale\n"
+#~ "   -e,  --interactive\t\tquitar búfer por salida, ignora interrupciones\n"
+#~ "   -E,  --fatal-warnings\tdetiene ejecución tras la primera advertencia\n"
+#~ "   -Q,  --quiet,  --silent      supereme algunos avisos para compilación\n"
+#~ "   -P,  --prefix-building       fuerza un prefijo `m4_' para todas las "
+#~ "compilaciones\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Cargando características dinámicas:\n"
+#~ "  -m, --module-direction=DIRECTORIO  añade DIRECTORIO a la ruta de "
+#~ "búsqueda modulada\n"
+#~ "  -M, --load-module=MODULO             carga dinámicamente MÓDULO desde "
+#~ "M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "MARCAS es cualquiera de:\n"
+#~ "  t  traza para todas llamadas macro, no solo trazadas\n"
+#~ "  a  muestra argumento actual\n"
+#~ "  e  muestra expansión\n"
+#~ "  q  entrecomilla valores tal como necesario, con marca ‘a’ o ‘e’\n"
+#~ "  c  muestra antes que recogerm tras recoger y después de llamar\n"
+#~ "  x  añade una llamada de id macro único, útil con marcas c\n"
+#~ "  f  dice el nombre del fichero de entrada actual\n"
+#~ "  l  dice el número de línea de entrada actual\n"
+#~ "  p  muestra resultados de ruta buscadas\n"
+#~ "  i  muestra modificaciones en ficheros entrantes\n"
+#~ "  V  muñeca para todas las marcas de arriba\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "ERROR: fallada para añadir directorio de búsqueda «%s»"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "ERROR: fallada para añadir directorio de búsqueda «%s»: %s"
+
+#~ msgid " (options:"
+#~ msgstr " (opciones:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "ERROR INTERNO: código equivocado dentro de argumentos diferidos"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "ERROR INTERNO: Tipo de marca equivocada en función expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "ERROR INTERNO: marca equivocado en expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr ""
+#~ "ERROR INTERNO: tipo simbólico equivocado dentro de llamada call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ERROR: fallado al inicializar módulos: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ERROR: no puede encontrar módulo: «%s»"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ERROR: no puede encontrar módulo «%s»: %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ERROR: no puede cerrar módulos"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "ERROR: no puede cerrar módulos: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "ERROR: no puede instalar el módulo: «%s»: %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Ruta de búsqueda para «%s» encontrada «%s»"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Detectada violación de límite de memoria (SIGSEGV).  O un sobredes-\n"
+#~ "bordamiento de pila ocurrido, o hay un defecto en "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Comprobar posible recursión infinita.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "ERROR INTERNO: modo ilegal a función simbólica symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Nombre «%s» es desconocido\n"
diff --git a/po/fi.gmo b/po/fi.gmo
new file mode 100644 (file)
index 0000000..d4d7b9c
Binary files /dev/null and b/po/fi.gmo differ
diff --git a/po/fi.po b/po/fi.po
new file mode 100644 (file)
index 0000000..4417e1a
--- /dev/null
+++ b/po/fi.po
@@ -0,0 +1,1326 @@
+# Finnish messages for m4.
+# Copyright © 2010 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Jorma Karvonen <karvonen.jorma@gmail.com>, 2010.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2010-03-02 22:05+0200\n"
+"Last-Translator: Jorma Karvonen <karvonen.jorma@gmail.com>\n"
+"Language-Team: Finnish <translation-team-fi@lists.sourceforge.net>\n"
+"Language: fi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "VIRHE: Ei voida luoda tilapäistä tiedostoa diversiota varten"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Ei voi asettaa virhetiedostoa: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: valitsin ”%s” ei ole yksiselitteinen\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: valitsin ”%s” ei ole yksiselitteinen\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: tunnistamaton valitsin ”%c%s”\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: valitsin ”%c%s” ei salli argumenttia\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: valitsin ”%s” vaatii argumentin\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: virheellinen valitsin -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: valitsin vaatii argumentin -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "muisti loppui"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Onnistui"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Ei täsmäystä"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Virheellinen säännöllinen lauseke"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Virheellinen tietojenkeräysmerkki"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Virheellinen merkkiluokkanimi"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Jälkikenoviiva"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Virheellinen paluuviite"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Pariton [ tai [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Pariton ( tai \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Pariton \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Virheellinen \\{\\}-sisältö"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Virheellinen alueen loppu"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Muisti loppui"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Virheellinen edeltävä säännöllinen lauseke"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Säännöllisen lausekkeen ennenaikainen loppu"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Säännöllinen lauseke on liian suuri"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Pariton ) tai \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Ei edellistä säännöllistä lauseketta"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "VMEM-raja ylitetty?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "VMEM-raja ylitetty?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Määrittelemätön nimi %s"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Määrittelemätön nimi %s"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Ilmoita virheistä (englanniksi) osoitteeseen <bug-m4@gnu.org>.\n"
+"Ilmoita suomennoksen virheistä osoitteeseen <translation-team-fi@lists."
+"sourceforge.net>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Virheellinen säännöllinen lauseke ”%s”: %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Varoitus: Liian harvoja argumenttia sisäänrakennetulle ”%s”"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Varoitus: Ei välitetä lisäargumenteista sisäänrakennetulle ”%s”"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Ei-numeerinen argumentti sisäänrakennettuun ”%s”"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Ei-numeerinen argumentti sisäänrakennettuun ”%s”"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Määrittelemätön nimi ”%s”"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Määrittelemätön nimi ”%s”"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Varoitus: Liian harvoja argumenttia sisäänrakennetulle ”%s”"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Ei voi avata putkea komentoon ”%s”"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Negatiivinen leveys kohteeseen eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Ei voida kääntää takaisin %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Ei voida kääntää takaisin %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Ei voi avata %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "VIRHE: ei voida sulkea moduulia: ”%s”"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Vianjäljitystila: väärät vianjäljitysliput: ”%s”"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Ei voi asettaa virhetiedostoa: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "VAROITUS: \\0 häviää, käytä sen sijaan merkintää \\& korvauksissa"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Virheellinen säännöllinen lauseke ”%s”: %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Virhe täsmättäessä säännöllistä lauseketta ”%s”"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Virheellinen säännöllinen lauseke ”%s”: %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Virheellinen lauseke kohteessa eval (oikea sulje puuttuu): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Virheellinen lauseke kohteessa eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Virheellinen lauseke kohteessa eval (virheellinen syöte): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Virheellinen lauseke kohteessa eval (lisäsyöte): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Jaa nollalla kohteessa eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Jaa nollalla kohteessa eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulo nollalla kohteessa eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Virheellinen lauseke kohteessa eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Ei-numeerinen argumentti kohteeseen %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: tunnistamaton valitsin ”%c%s”\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Odotetaan rivinvaihtoa jäätyneessä tiedostossa"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Odotetaan merkkiä ”%c” jäätyneessä tiedostossa"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Odotetaan rivinvaihtoa jäätyneessä tiedostossa"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Jäätyneen tiedoston ennenaikainen loppu"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Ei voi avata %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Vääränmuotoinen jäätynyt tiedosto"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "VIRHE: tiedoston loppumerkki EOF merkkijonossa"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Lisätietoja komennolla ”%s --help”.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Käyttö: %s [VALITSIN]... [TIEDOSTO]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Jos ei ole TIEDOSTOa tai TIEDOSTO on ”-”, luetaan vakiosyötteestä.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr "  -W, --word-regexp=REGEXP     käytä REGEXP makronimisyntaksille\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Esiprosessoriominaisuudet:\n"
+"  -I, --include=DIRECTORY      hae tämä hakemisto toisen kerran include-"
+"määrittelyjä varten\n"
+"  -D, --define=NIMI[=ARVO]     kirjoita NIMI, jolla on ARVO tai tyhjä\n"
+"  -U, --undefine=NIMI          poista builtin-NIMI\n"
+"  -s, --synclines              tuota ”#line NO \"FILE\"” rivit\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Rajoitusten valvonta:\n"
+"  -G, --traditional            estä kaikki GNU-laajennukset\n"
+"  -H, --hashsize=PRIME         aseta symbolin lookup hash-taulun koko\n"
+"  -L, --nesting-limit=NUMERO   vaihda keinotekoinen sisennysraja\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Jäädytetyn tilan tiedostot:\n"
+"  -F, --freeze-state=TIEDOSTO  tuota jäädytetty tila TIEDOSTOon lopussa\n"
+"  -R, --reload-state=TIEDOSTO  hae uudelleen jäädytetty tila TIEDOSTOsta "
+"alussa\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Vianjäljitys:\n"
+"  -d, --debug=[LIPUT]          aseta vianjäljitystaso (ilman LIPUT-"
+"määritystä\n"
+"                               sisältää ”aeq”)\n"
+"  -t, --trace=NIMI             jäljitä NIMI kun se määritellään\n"
+"  -l, --arglength=NUM          rajoita makrojäljityksen kokoa\n"
+"  -o, --error-output=TIEDOSTO  ohjaa edelleen vianjäljitys- ja "
+"jäljitystuloste\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Virheelliset vianjäljitysliput: ”%s”"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "VIRHE: Tiedostonloppumerkki EOF argumenttiluettelossa"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "VIRHE: Ylitettiin rekursioraja %d, käytä -L<N> sen muuttamiseen"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "VIRHE: Ei voida luoda tilapäistä tiedostoa diversiota varten"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "VIRHE: Ei voida luoda tilapäistä tiedostoa diversiota varten"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Ei voi suorittaa stat-diversiota"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "VIRHE: Ei voida luoda tilapäistä tiedostoa diversiota varten"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "VIRHE: Ei voida flush diversion tilapäiseen tiedostoon"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "VIRHE: Kopioidaan lisättyä tiedostoa"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "VIRHE: Luetaan lisättyä tiedostoa"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Ei voi suorittaa stat-diversiota"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Diversio on liian suuri"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: valitsin ”--%s” ei salli argumenttia\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: tunnistamaton valitsin ”--%s”\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: virheellinen valitsin -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: valitsin ”-W %s” ei ole yksiselitteinen\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: valitsin ”-W %s” ei salli argumenttia\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "SISÄINEN VIRHE: Väärä merkkijonodatatyyppi makrossa define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "SISÄINEN VIRHE: Builtin ei löytynyt builtin-taulussa!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "SISÄINEN VIRHE: Väärä merkkijonodatatyyppi funktiossa m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "SISÄINEN VIRHE: Väärä symbolityyppi funktiossa m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Kantaluku kohteessa eval alueen ulkopuolella (kantaluku = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Määrittelemätön syntaksikoodi %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "SISÄINEN VIRHE: Builtin ei löytynyt builtin-taulussa! (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "SISÄINEN VIRHE: Väärä merkkijonodatatyyppi (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "SISÄINEN VIRHE: Virheellinen koodi funktiossa evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr ""
+#~ "SISÄINEN VIRHE: Virheellinen vertailuoperaattori funktiossa cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr ""
+#~ "SISÄINEN VIRHE: Virheellinen siirto-operaattori funktiossa shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "SISÄINEN VIRHE: Virheellinen operaattori funktiossa mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "SISÄINEN VIRHE: Built-in ei löytynyt builtin-taulussa!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "SISÄINEN VIRHE: Virheellinen merkkijonodatatyyppi funktiossa "
+#~ "freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "”%s” jäätyneestä tiedostosta ei löytynyt builtin-taulua!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Syöte käänteisesti kohteeseen %s, rivi %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Syöte luettiin kohteesta %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "SISÄINEN VIRHE: Rekursiivinen push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "SISÄINEN VIRHE: Virheellinen kutsu funktioon init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "SISÄINEN VIRHE: Syötepino botch funktiossa next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "SISÄINEN VIRHE: Syötepino botch funktiossa peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "EI MITÄÄN"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "VIRHE: Pinon ylivuoto.  (Päättymätön define-rekursio?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Pakolliset tai valinnaiset argumentit pitkille valitsimille ovat "
+#~ "pakollisia\n"
+#~ "tai valinnaisia myös lyhyille valitsimille.\n"
+#~ "\n"
+#~ "Toimintotilat:\n"
+#~ "      --help                   näytä tämä ohje ja poistu\n"
+#~ "      --version                tulosta versiotiedot ja poistu\n"
+#~ "  -e, --interactive            puskuroimaton tuloste, älä välitä "
+#~ "keskeytyksistä\n"
+#~ "  -E, --fatal-warnings         pysäytä suoritus ensimmäisen varoituksen "
+#~ "jälkeen\n"
+#~ "  -Q, --quiet, --silent        estä jotkut varoitukset kohteelle "
+#~ "builtins\n"
+#~ "  -P, --prefix-builtins        pakota ”m4_”-etuliite kaikkiin builtins-"
+#~ "kohteisiin\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Dynaamiset latausominaisuudet:\n"
+#~ "  -m, --module-directory=DIRECTORY  lisää DIRECTORY-hakemisto moduulin "
+#~ "etsintäpolkuun\n"
+#~ "  -M, --load-module=MODULE          lataa dynaaminen MODULE-moduuli "
+#~ "kohteesta M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "LIPUT on mikä tahansa seuraavista:\n"
+#~ "  t   jäljitä kaikki makrokutsut, ei vain silloin kun jäljitys on päällä\n"
+#~ "  a   näytä todelliset argumentit\n"
+#~ "  e   näytä laajennus\n"
+#~ "  q   lainaa arvot milloin välttämätöntä, ”a”- tai ”e”-lipulla\n"
+#~ "  c   näytä ennen collect-toimintoa, sen jälkeen ja kutsun jälkeenl\n"
+#~ "  x   lisää uniikki makrokutsutunniste, hyödyllinen c-lipun kanssa\n"
+#~ "  f   sano nykyinen syötetiedostonimi\n"
+#~ "  l   sano nykyinen syöterivinumero\n"
+#~ "  p   näytä polkuetsinnän tulokset\n"
+#~ "  i   näytä muutokset syötetiedostoissa\n"
+#~ "  V   lyhenne kaikille yllä oleville lipuille\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "VIRHE: etsintähakemiston ”%s” lisäys epäonnistui"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "VIRHE: etsintähakemiston lisäys epäonnistui ”%s”: %s"
+
+#~ msgid " (options:"
+#~ msgstr " (valitsimet:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr ""
+#~ "SISÄINEN VIRHE: Virheellinen koodi uudelleenviitatuissa argumenteissa"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr ""
+#~ "SISÄINEN VIRHE: Virheellinen merkkijonotyyppi funktiossa expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr ""
+#~ "SISÄINEN VIRHE: Virheellinen merkkijonotyyppi funktiossa expand_argument "
+#~ "()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "SISÄINEN VIRHE: Virheellinen symbolityyppi funktiossa call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "VIRHE: moduulien alustus epäonnistui: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "VIRHE: ei löydy moduulia: ”%s”"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "VIRHE: ei löydy moduuleja: ”%s”: %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "VIRHE: ei voi sulkea moduuleja"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "VIRHE: ei voida sulkea moduuleja: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "VIRHE: ei voida sulkea moduulia: ”%s”: %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Polkuetsintä kohteelle ”%s” löysi ”%s”"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Muistirajojen ylittäminen havaittu (SIGSEGV).  Tapahtui joko pinon "
+#~ "ylivuoto\n"
+#~ "tai sitten on virhe kohteessa "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Tarkista mahdollinen päättymätön rekursiivisuus.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "SISÄINEN VIRHE: Virheellinen tila funktiolle symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Nimi ”%s” on tuntematon\n"
diff --git a/po/fr.gmo b/po/fr.gmo
new file mode 100644 (file)
index 0000000..1566e02
Binary files /dev/null and b/po/fr.gmo differ
diff --git a/po/fr.po b/po/fr.po
new file mode 100644 (file)
index 0000000..bc68f37
--- /dev/null
+++ b/po/fr.po
@@ -0,0 +1,1328 @@
+# Messages français pour GNU m4.
+# Copyright © 2004 Free Software Foundation, Inc.
+#
+# This file is distributed under the same license as the m4 package.
+#
+# Michel Robitaille <robitail@iro.umontreal.ca>, traducteur depuis/since 1996.
+# Stéphane Aulery <lkppo@free.fr>, 2015.
+#
+# Réencodage ISO-8859-1 => UTF-8 et typos, S. Aulery, 2015.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2015-04-11 21:05+0200\n"
+"Last-Translator: Stéphane Aulery <lkppo@free.fr>\n"
+"Language-Team: French <traduc@traduc.org>\n"
+"Language: fr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "ERREUR: Incapable de créer un fichier temporaire pour la diversion"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Incapable de préparer le fichier d'erreurs: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: l'option « %s » est ambiguë\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: l'option « %s » est ambiguë\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: option non reconnue « %c%s »\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: l'option « %c%s » ne permet pas un argument\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: l'option « %s » requiert un argument\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: option invalide -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: l'option requiert un argument -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "mémoire épuisée"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Succès"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Pas de concordance"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Mauvaise expression régulière"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Collation invalide de caractères"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nom invalide de classe de caractères"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Barre oblique inverse de queue"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Référence arrière invalide"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ ou [^ non  pairé"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( ou \\( non pairé"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ non pairé"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Contenu invalide de \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Borne finale invalide"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Mémoire épuisée"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Précédente expression régulière invalide"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Fin prématurée de l'expression régulière"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Expression régulière trop grande"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") ou \\) non pairé"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Pas d'expression régulière précédente"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Limit VMEM outrepassée?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Limit VMEM outrepassée?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Nom « %s » non-défini"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Nom « %s » non-défini"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Rapporter tout disfonctionnement à mailto:bug-m4@gnu.org; et rapporter les\n"
+"problèmes de francisation à mailto:traduc@traduc.org.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Mauvaise expression régulière « %s »: %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Attention: Trop peu d'arguments pour « %s » prédéfini"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Attention: Les arguments superflus pour « %s » prédéfini sont ignorés"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Argument non-numérique pour « %s » prédéfini"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Argument non-numérique pour « %s » prédéfini"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Nom « %s » non-défini"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Nom « %s » non-défini"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Attention: Trop peu d'arguments pour « %s » prédéfini"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Incapable d'ouvrir un « pipe » pour la commande « %s »"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Largeur négative dans « eval »"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Impossible de ramener la diversion %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Impossible de ramener la diversion %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Incapable d'ouvrir %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "ERREUR: ne peut fermer le module: « %s »"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Debugmode: mauvais indicateurs de mise-au-point: « %s »"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Incapable de préparer le fichier d'erreurs: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "ATTENTION: \\0 disparaîtra, utiliser \\& plutôt pour les remplacements"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Mauvaise expression régulière « %s »: %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Erreur d'appariement pour l'expression régulière « %s »"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Mauvaise expression régulière « %s »: %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Mauvaise expression dans « eval » (parenthèse droite manquante): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Mauvaise expression dans « eval »: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Mauvaise expression dans « eval » (mauvaise entrée): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Mauvaise expression dans « eval » (entrée superflue): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Division par zéro dans eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Division par zéro dans eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Module par zéro dans eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Mauvaise expression dans « eval »: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Argument non-numérique pour %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: option non reconnue « %c%s »\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Fin-de-ligne attendue du fichier figé"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Caractère « %c » attendu du fichier figé"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Fin-de-ligne attendue du fichier figé"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Fin prématurée de fichier figé"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Incapable d'ouvrir %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Fichier figé difforme"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "ERREUR: Fin-de-fichier dans la chaîne"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Pour plus d'information, essayez « %s --help ».\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Usage: %s [OPTION]... [FICHIER]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Si aucun FICHIER ou si FICHIER vaut « - », lit l'entrée standard.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=REGEXP     utiliser REGEXP pour les noms de macro\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Capacités de préprocesseur:\n"
+"  -I, --include=REPERTOIRE     ensuite fouiller ce répertoire d'inclusions\n"
+"  -D, --define=NOM[=VALEUR]    définir NOM comme ayant VALEUR (ou vide)\n"
+"  -U, --undefine=NOM           éliminer le NOM prédéfini\n"
+"  -s, --synclines              engendrer des lignes « #line NNN \"FICHIER\" "
+"»\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Contrôle des limites:\n"
+"  -G, --traditional            inhiber toutes les extensions GNU\n"
+"  -H, --hashsize=PREMIER       choisir la grandeur de la table de symboles\n"
+"  -L, --nesting-limit=NOMBRE   modifier la limite artificielle "
+"d'imbrication\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Fichiers d'état figé:\n"
+"  -F, --freeze-state=FICHIER   produire un FICHIER figé à la fin\n"
+"  -R, --reload-state=FICHIER   recharger un FICHIER figé au départ\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Mise-au-point:\n"
+"  -d, --debug=[INDICS]         niveau de mise-au-point (implicitement « aeq "
+"»)\n"
+"  -t, --trace=NOM              tracer NOM lorsqu'il sera défini\n"
+"  -l, --arglength=NOMBRE       restreindre la grandeur de trace des macros\n"
+"  -o, --error-output=FICHIER   rediriger la sortie de trace et mise-au-"
+"point\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Mauvais indicateurs de mise-au-point: « %s »"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "ERREUR: Fin-de-fichier dans la liste d'arguments"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "ERREUR: Limite de récursion %d dépassée, la changer par -L<N>"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "ERREUR: Incapable de créer un fichier temporaire pour la diversion"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "ERREUR: Incapable de créer un fichier temporaire pour la diversion"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Incapable d'opérer stat() pour la diversion"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "ERREUR: Incapable de créer un fichier temporaire pour la diversion"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "ERREUR: Incapable de vider la diversion sur un fichier temporaire"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "ERREUR: Pendant la copie du fichier inséré"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "ERREUR: Pendant la lecture d'un fichier inséré"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Incapable d'opérer stat() pour la diversion"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Diversion trop grande"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: l'option « --%s » ne permet pas un argument\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: option non reconnue « --%s »\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: option illégale -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: l'option « -W %s » est ambiguë\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: l'option « -W %s » ne permet pas un argument\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "ERREUR INTERNE: Mauvais type de lexème dans define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "ERREUR INTERNE: Prédéfini introuvable dans la table des prédéfinis!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr ""
+#~ "ERREUR INTERNE: Mauvais type de données pour lexème dans m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "ERREUR INTERNE: Mauvais type de symbole dans m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Base hors intervalle dans « eval » (base = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Code de syntaxe « %c » non-défini"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "ERREUR INTERNE: Prédéfini introuvable dans la table des prédéfinis! "
+#~ "(trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr ""
+#~ "ERREUR INTERNE: Mauvais type de donnée pour de lexème (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "ERREUR INTERNE: Mauvais code d'erreur dans evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "ERREUR INTERNE: Mauvais opérateur de comparaison dans cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "ERREUR INTERNE: Mauvais opérateur de décalage dans shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "ERREUR INTERNE: Mauvais opérateur dans mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "ERREUR INTERNE: Prédéfini introuvable dans la table des prédéfinis!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "ERREUR INTERNE: Mauvais type de donnée pour lexème dans freeze_one_symbol "
+#~ "()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr ""
+#~ "« %s » dans le fichier figé est introuvable dans la table des prédéfinis!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Entrée reprise de %s, ligne %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Entrée lue de %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "ERREUR INTERNE: Utilisation récursive de push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "ERREUR INTERNE: Mauvais appel à init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "ERREUR INTERNE: Pile d'entrée douteuse dans next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "ERREUR INTERNE: Pile d'entrée douteuse dans peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "AUCUN"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "ERREUR: Débordement de pile.  (Récursion sans fin sur « define »?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Les arguments obligatoires ou optionnels pour la forme longue des\n"
+#~ "options sont aussi obligatoires ou optionnels pour les formes courtes\n"
+#~ "qui leur correspondent.\n"
+#~ "\n"
+#~ "Modes d'opération:\n"
+#~ "      --help                   fournir ce message d'aide, puis terminer\n"
+#~ "      --version                identifier le programme, puis terminer\n"
+#~ "  -e, --interactive            ne pas tamponner, ignorer les "
+#~ "interruptions\n"
+#~ "  -E, --fatal-warnings         terminer l'exécution après le moindre "
+#~ "message\n"
+#~ "  -Q, --quiet, --silent        inhiber certains diagnostics prédéfinis\n"
+#~ "  -P, --prefix-builtins        préfixer tous les prédéfinis par « m4_ »\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Options de chargement dynamique:\n"
+#~ "  -m, --module-directory=RÉPERTOIRE ajouter le RÉPERTOIRE au module du "
+#~ "chemin de recherche\n"
+#~ "  -M, --load-module=MODULE          charger le MODULE dynamique depuis "
+#~ "M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "INDICS est une combinaison de:\n"
+#~ "  t   tracer tous les appels de macro, pas uniquement les « traceon »\n"
+#~ "  a   afficher les arguments véritables\n"
+#~ "  e   afficher le résultat de l'expansion\n"
+#~ "  q   mettre entre guillemets lorsque nécessaire, avec indics « a » ou « "
+#~ "e »\n"
+#~ "  c   afficher avant et après la collecte, puis après l'appel\n"
+#~ "  x   ajouter une identification unique, utile avec l'indicateur « c »\n"
+#~ "  f   donner le nom courant du fichier d'entrée\n"
+#~ "  l   donner le numéro de la ligne d'entrée\n"
+#~ "  p   afficher les résultats des fouilles de chemin\n"
+#~ "  i   afficher les modifications dans les fichiers d'entrée\n"
+#~ "  V   abréviation commode pour toutes les options précédentes à la fois\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "ERREUR: échec de l'ajout du répertoire de recherche « %s »"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "ERREUR: échec de l'ajout du répertoire de recherche « %s »: %s"
+
+#~ msgid " (options:"
+#~ msgstr " (options:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "ERREUR INTERNE: Mauvais code dans les arguments différés"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "ERREUR INTERNE: Mauvais type de lexème dans expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr ""
+#~ "ERREUR INTERNE: Mauvais type de données pour lexème dans expand_argument "
+#~ "()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "ERREUR INTERNE: Mauvais type de symbole dans call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ERREUR: ne peut initialiser le module: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ERREUR: ne peut trouver le module: « %s »"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ERREUR: ne peut trouver le module: « %s »: %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ERREUR: ne peut fermer les modules"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "ERREUR: ne peut fermer les module: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "ERREUR: ne peut fermer le module: « %s »: %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "La fouille du chemin pour « %s » trouve « %s »"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Les violations de mémoire sont détectées (SIGSEGV).  Ou bien la pile a\n"
+#~ "débordé, ou bien il y a un problème dans "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Vérifier une récursion hors contrôle.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "ERREUR INTERNE: Mode illégal dans symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Le nom « %s » est inconnu\n"
diff --git a/po/ga.gmo b/po/ga.gmo
new file mode 100644 (file)
index 0000000..0e671d2
Binary files /dev/null and b/po/ga.gmo differ
diff --git a/po/ga.po b/po/ga.po
new file mode 100644 (file)
index 0000000..ce8847b
--- /dev/null
+++ b/po/ga.po
@@ -0,0 +1,1320 @@
+# Irish translations for m4.
+# Copyright (C) 2005 Free Software Foundation, Inc.
+# Kevin Patrick Scannell <scannell@SLU.EDU>, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2005-02-09 11:27-0500\n"
+"Last-Translator: Kevin Patrick Scannell <scannell@SLU.EDU>\n"
+"Language-Team: Irish <ga@li.org>\n"
+"Language: ga\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "EARRÁID: Ní féidir comhad sealadach a chruthú le haghaidh atreoraithe"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Ní féidir an comhad earráide a shocrú: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: Tá an rogha `%s' débhríoch\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: Tá an rogha `%s' débhríoch\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: rogha anaithnid `%c%s'\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: ní cheadaítear argóint i ndiaidh na rogha `%c%s'\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: ní foláir argóint don rogha `%s'\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: rogha neamhbhailí -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: ní foláir argóint don rogha -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "cuimhne ídithe"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Bua!"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Níl a leithéid ann"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Slonn ionadaíochta neamhbhailí"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Carachtar neamhbhailí cóimheasa"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Aicme neamhbhailí charachtair"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Cúlslais ag deireadh"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Cúltagairt neamhbhailí"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ nó [^ corr"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( nó \\( corr"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ corr"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Ábhar neamhbhailí idir \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Deireadh raoin neamhbhailí"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Cuimhne ídithe"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Is neamhbhailí an slonn ionadaíochta roimhe seo"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Deireadh le slonn ionadaíochta gan choinne"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Slonn ionadaíochta rómhór"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") nó \\) corr"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Níl aon slonn ionadaíochta roimhe seo"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Teorainn VMEM sáraithe?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Teorainn VMEM sáraithe?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Ainm %s gan sainmhíniú"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Ainm %s gan sainmhíniú"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Seol tuairiscí fabhtanna chuig <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Slonn ionadaíochta neamhbhailí `%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Rabhadh: Níl go leor argóint ann don fheidhm insuite `%s'"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr ""
+"Rabhadh: ag déanamh neamhshuim ar argóintí breise don fheidhm insuite `%s'"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Argóint neamhuimhriúil don fheidhm insuite `%s'"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Argóint neamhuimhriúil don fheidhm insuite `%s'"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Ainm `%s' gan sainmhíniú"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Ainm `%s' gan sainmhíniú"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Rabhadh: Níl go leor argóint ann don fheidhm insuite `%s'"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Ní féidir píopa a oscailt go hordú `%s'"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Leithead diúltach i eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Ní féidir %s a dí-atreorú"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Ní féidir %s a dí-atreorú"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Ní féidir %s a oscailt"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "EARRÁID: ní féidir modúl a dhúnadh: `%s'"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Mód dífhabhtaithe: drochbhratacha dífhabhtaithe: `%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Ní féidir an comhad earráide a shocrú: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr ""
+"RABHADH: Rachaidh \\0 as radharc, úsáid \\& ina ionad i dteaghráin "
+"ionadaíochta"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Slonn ionadaíochta neamhbhailí `%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Earráid le linn cuardaigh ar shlonn ionadaíochta `%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Slonn ionadaíochta neamhbhailí `%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Slonn neamhbhailí i eval (lúibín deas ar iarraidh): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Slonn neamhbhailí i eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Slonn neamhbhailí i eval (droch-ionchur): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Slonn neamhbhailí i eval (ionchur sa bhreis): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Nialas san ainmneoir i eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Nialas san ainmneoir i eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulo le nialas i eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Slonn neamhbhailí i eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Argóint neamhuimhriúil chun %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: rogha anaithnid `%c%s'\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Ag súil le fotha líne i gcomhad sioctha"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Ag súil le carachtar `%c' i gcomhad sioctha"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Ag súil le fotha líne i gcomhad sioctha"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Comhadchríoch gan choinne i gcomhad sioctha"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Ní féidir %s a oscailt"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Comhad sioctha míchumtha"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "EARRÁID: EOF i dteaghrán"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Bain triail as `%s --help' chun tuilleadh eolais a fháil.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Úsáid: %s [ROGHA]... [COMHAD]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Mura bhfuil COMHAD ann, nó más `-' é, léigh ón ionchur caighdeánach.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=SLONN      úsáid SLONN do chomhréir na n-ainmneacha "
+"macra\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Gnéithe an réamhphróiseálaí:\n"
+"  -I, --include=COMHADLANN     cuardach COMHADLANN ar chomhaid cheanntáisc\n"
+"  -D, --define=AINM[=LUACH]    iontráil AINM le LUACH, is é sin nó folamh\n"
+"  -U, --undefine=AINM          scrios AINM insuite\n"
+"  -s, --synclines              gin línte `#line NO \"FILE\"'\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Rialú na dteorainneacha:\n"
+"  -G, --traditional            múch gach eisínteacht GNU\n"
+"  -H, --hashsize=PRÍOMHA       méid hais-tábla na siombailí\n"
+"  -L, --nesting-limit=UIMHIR   athraigh an teorainn shaorga neadaithe\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Comhaid shioctha:\n"
+"  -F, --freeze-state=COMHAD    déan staid shioctha ag deireadh COMHAD\n"
+"  -R, --reload-state=COMHAD    athluchtaigh staid shioctha ó thosach an "
+"CHOMHAID\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Dífhabhtú:\n"
+"  -d, --debug=[BRATACHA]       socraigh an leibhéal dífhabhtaithe (gan "
+"BRATACHA => `aeq')\n"
+"  -t, --trace=AINM             lorg AINM nuair atá sé sainmhínithe\n"
+"  -l, --arglength=UIMHIR       cuir teorainn le méid lorg macraí\n"
+"  -o, --error-output=COMHAD    athsheol an t-aschur dífhabhtaithe/loirg\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Bratacha neamhbhailí dífhabhtaithe: `%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "EARRÁID: EOF i liosta na n-argóintí"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"EARRÁID: Doimhneacht athchúrsála níos mó ná an t-uasmhéid %d, úsáid -L<N> "
+"chun é a athrú"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "EARRÁID: Ní féidir comhad sealadach a chruthú le haghaidh atreoraithe"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "EARRÁID: Ní féidir comhad sealadach a chruthú le haghaidh atreoraithe"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Ní féidir atreorú a `stat'"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "EARRÁID: Ní féidir comhad sealadach a chruthú le haghaidh atreoraithe"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "EARRÁID: Ní féidir atreorú a shruthlú go comhad sealadach"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "EARRÁID: Comhad ionsáite á chóipeáil"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "EARRÁID: Comhad ionsáite á léamh"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Ní féidir atreorú a `stat'"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Atreorú rómhór"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: ní cheadaítear argóint i ndiaidh na rogha `--%s'\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: rogha anaithnid `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: rogha neamhcheadaithe -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: Tá an rogha `-W %s' débhríoch\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: ní cheadaítear argóint i ndiaidh na rogha `-W %s'\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr ""
+#~ "EARRÁID INMHEÁNACH: Droch-chineál sonraí comhartha i define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "EARRÁID INMHEÁNACH: Níor aimsíodh feidhm insuite sa tábla insuite!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Droch-chineál sonraí comhartha i m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Droch-chineál siombaile i m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Bunuimhir as raon i eval (bunuimhir = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Cód comhréire %c gan sainmhíniú"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "EARRÁID INMHEÁNACH: Níor aimsíodh feidhm insuite sa tábla insuite! "
+#~ "(trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "EARRÁID INMHEÁNACH: Droch-chineál sonraí comhartha (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Droch-chód earráide i evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Drochoibreoir comparáide i cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Drochoibreoir iomlaoide i shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Drochoibreoir i mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "EARRÁID INMHEÁNACH: Níor aimsíodh feidhm insuite sa tábla insuite!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "EARRÁID INMHEÁNACH: Droch-chineál sonraí comhartha i freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "Níor aimsíodh `%s' as comhad sioctha sa tábla insuite!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "D'fhill an t-ionchur ar %s, líne %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Léadh an t-ionchur ó %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "EARRÁID INMHEÁNACH: push_string athchúrsach!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Drochghlao ar init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr ""
+#~ "EARRÁID INMHEÁNACH: Rinneadh praiseach den chruach ionchurtha i next_char "
+#~ "()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr ""
+#~ "EARRÁID INMHEÁNACH: Rinneadh praiseach den chruach ionchurtha i "
+#~ "peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "NEAMHNÍ"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "EARRÁID: Cruach thar maoil.  (Athchúrsáil `define' éigríochta?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Is riachtanach le rogha ghearr aon argóint atá riachtanach leis an rogha\n"
+#~ "fhada.  Mar an gcéanna le hargóintí roghnacha.\n"
+#~ "\n"
+#~ "Móid oibre:\n"
+#~ "      --help                   taispeáin an chabhair seo agus scoir\n"
+#~ "      --version                taispeáin eolas faoin leagan agus scoir\n"
+#~ "  -e, --interactive            aschur gan maolánú; gan idirbhristeacha\n"
+#~ "  -E, --fatal-warnings         stop i ndiaidh an chéad rabhaidh\n"
+#~ "  -Q, --quiet, --silent        ceil roinnt rabhaidh d'fheidhmeanna "
+#~ "insuite\n"
+#~ "  -P, --prefix-builtins        éiligh an réimír `m4_' ar gach feidhm "
+#~ "insuite\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Gnéithe maidir leis an luchtú beo:\n"
+#~ "  -m, --module-directory=COMHADLANN cuir COMHADLANN sa chonair chuardach "
+#~ "modúl\n"
+#~ "  -M, --load-module=MODÚL           luchtaigh MODÚL beo ó M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Is iad seo na BRATACHA:\n"
+#~ "  t   lorg gach glao macra, ní hamháin na cinn le `traceon'\n"
+#~ "  a   taispeáin na fíorargóintí\n"
+#~ "  e   taispeáin scaoileadh macra\n"
+#~ "  q   úsáid athfhriotal más gá, leis an bhrat `a' nó `e'\n"
+#~ "  c   taispeáin roimh `collect', tar éis `collect' agus tar éis `call'\n"
+#~ "  x   cuir aitheantas uathúil macra leis, úsáideach le `c'\n"
+#~ "  f   tabhair ainm an inchomhaid reatha\n"
+#~ "  l   tabhair an líne-uimhir reatha ionchuir\n"
+#~ "  p   taispeáin torthaí na gcuardach conairí\n"
+#~ "  i   taispeáin athruithe in inchomhaid\n"
+#~ "  V   gach ceann acu seo thuas\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "EARRÁID: theip ar chur comhadlann chuardaigh `%s' leis"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "EARRÁID: theip ar chur comhadlann chuardaigh `%s' leis: %s"
+
+#~ msgid " (options:"
+#~ msgstr " (roghanna:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "EARRÁID INMHEÁNACH: Droch-chód sna hargóintí iarchurtha"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Droch-chineál comhartha i expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Droch-chineál comhartha i expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Droch-chineál siombaile i call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "EARRÁID: theip ar thúsú modúil: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "EARRÁID: modúl gan aimsiú: `%s'"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "EARRÁID: modúl gan aimsiú: `%s': %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "EARRÁID: ní féidir modúil a dhúnadh"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "EARRÁID: ní féidir modúil a dhúnadh: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "EARRÁID: ní féidir modúl a dhúnadh: `%s': %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "D'aimsigh cuardach conaire ar `%s' seo a leanas: `%s'"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Sáraíodh teorainneacha cuimhne (SIGSEGV).  Tá cruach thar maoil, is\n"
+#~ "é sin nó tá fabht i "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Seiceáil nach bhfuil athchúrsáil éigríochta ann.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "EARRÁID INMHEÁNACH: Mód neamhcheadaithe i symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Ainm `%s' anaithnid\n"
diff --git a/po/gl.gmo b/po/gl.gmo
new file mode 100644 (file)
index 0000000..e57a571
Binary files /dev/null and b/po/gl.gmo differ
diff --git a/po/gl.po b/po/gl.po
new file mode 100644 (file)
index 0000000..a604b48
--- /dev/null
+++ b/po/gl.po
@@ -0,0 +1,1334 @@
+# Galician translation of GNU m4
+# This file is distributed under the same license as the m4 package.
+# Copyright (C) 2000 Free Software Foundation, Inc.
+# Copyright (C) 2012 Leandro Regueiro.
+#
+# Jacobo Tarrio <jtarrio@iname.com>, 2000.
+# Leandro Regueiro <leandro.regueiro@gmail.com>, 2012.
+#
+# Proxecto Trasno - Adaptación do software libre á lingua galega:  Se desexas
+# colaborar connosco, podes atopar máis información en http://www.trasno.net
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2012-11-10 19:02+0100\n"
+"Last-Translator: Leandro Regueiro <leandro.regueiro@gmail.com>\n"
+"Language-Team: Galician <proxecto@trasno.net>\n"
+"Language: gl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "ERRO: Non foi posíbel crear un ficheiro temporal para o desvío"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Non é posíbel definir o ficheiro de erros: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: a opción «%s» é ambigua\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: a opción «%s» é ambigua\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: opción «%c%s» non recoñecida\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: a opción «%c%s» non permite un argumento\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: a opción «%s» require un argumento\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opción incorrecta -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: a opción require un argumento -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memoria esgotada"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Éxito"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Non coincide nada"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Expresión regular non válida"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Carácter de ordenamento incorrecto"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nome de clase de caracteres non válido"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Barra invertida á fin da liña"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Referencia cara a atrás non válida"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ ou [^ non emparellado"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( ou \\( non emparellado"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ non emparellado"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Contido de \\{\\} non válido"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Fin de intervalo non válida"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memoria esgotada"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Expresión regular precedente non válida"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Fin prematura da expresión regular"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Expresión regular grande de máis"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") ou \\) non emparellado"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Non hai unha expresión regular anterior"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Límite de VMEM sobrepasado?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Límite de VMEM sobrepasado?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Nome %s non definido"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Nome %s non definido"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Envíe os informes de fallo a <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Expresión regular «%s» incorrecta: %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Aviso: Moi poucos parámetros para o «%s» predefinido"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Aviso: Os parámetros de máis para o «%s» predefinido foron ignorados"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Parámetro non numérico ao «%s» predefinido"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Parámetro non numérico ao «%s» predefinido"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Macro non definida `%s'"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Nome «%s» non definido"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Aviso: Moi poucos parámetros para o «%s» predefinido"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Non é posíbel abrir un cano á orde «%s»"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Ancho negativo en eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Non é posíbel endereitar %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Non é posíbel endereitar %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Non é posíbel abrir %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "ERRO: non foi posíbel pechar un módulo: «%s»"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Modo de depuración: modificadores de depuración incorrectos: «%s»"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Non é posíbel definir o ficheiro de erros: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "AVISO: \\0 ha desaparecer, empregue \\& no seu canto nas substitucións"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Expresión regular «%s» incorrecta: %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Produciuse un erro ao comparar a expresión regular «%s»"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Expresión regular «%s» incorrecta: %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Expresión incorrecta en eval (falla a paréntese dereita): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Expresión incorrecta en eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Expresión incorrecta en eval (entrada incorrecta): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Expresión incorrecta en eval (entrada excesiva): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "División por cero en eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "División por cero en eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Resto da división por cero en eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Expresión incorrecta en eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Parámetro non numérico para %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: opción «%c%s» non recoñecida\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Esperábase un salto de liña no ficheiro conxelado"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Esperábase o carácter «%c» no ficheiro conxelado"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Esperábase un salto de liña no ficheiro conxelado"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Fin prematura do ficheiro conxelado"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Non é posíbel abrir %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Ficheiro conxelado mal formatado"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "ERRO: fin de ficheiro na cadea"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Escriba «%s --help» para obter máis información.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Uso: %s [OPCIÓN]... [FICHEIRO]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Se non se indica un FICHEIRO ou se o FICHEIRO é «-», lese da entrada "
+"estándar.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=REGEXP     usar REGEXP para a sintaxe dos nomes das "
+"macros\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Características do preprocesador:\n"
+"  -I, --include=DIRECTORIO     buscar tamén neste directorio por ficheiros\n"
+"                                 a incluír\n"
+"  -D, --define=NOME[=VALOR]    introducir o NOME que contén o VALOR, ou "
+"baleiro\n"
+"  -U, --undefine=NOME          eliminar a predefinida NOME\n"
+"  -s, --synclines              xerar liñas `#line NÚM \"FICHEIRO\"\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Control de límites:\n"
+"  -G, --traditional            suprimir todas as extensións GNU\n"
+"  -H, --hashsize=PRIMO         definir o tamaño da táboa hash de símbolos\n"
+"  -L, --nesting-limit=NÚMERO   cambiar o límite artificial de aniñamento\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Ficheiros de estado conxelado:\n"
+"  -F, --freeze-state=FICHEIRO  producir un estado conxelado á fin do "
+"FICHEIRO\n"
+"  -R, --reload-state=FICHEIRO  cargar un estado conxelado desde o principio "
+"do\n"
+"                                 FICHEIRO\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Depuración:\n"
+"  -d, --debug=[OPCIÓNS]        definir o nivel de depuración (se non se\n"
+"                                 indican OPCIÓNS suponse «aeq»)\n"
+"  -t, --trace=NOME             seguir NOME cando estea definido\n"
+"  -l, --arglength=NÚM          restrinxir o tamaño do seguimento das macros\n"
+"  -o, --error-output=FICHEIRO  redirixir a saída de depuración e seguemento\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Opcións de depuración incorrectas: «%s»"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "ERRO: Fin de ficheiro na lista de parámetros"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"ERRO: Límite de %d recursións sobrepasado, empregue -L<N> para cambialo"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "ERRO: Non foi posíbel crear un ficheiro temporal para o desvío"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "ERRO: Non foi posíbel crear un ficheiro temporal para o desvío"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Non foi posíbel facer unha operación de stat sobre un desvío"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "ERRO: Non foi posíbel crear un ficheiro temporal para o desvío"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "ERRO: Non foi posíbel establecer o desvío a un ficheiro temporal"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "ERRO: Copiando o ficheiro insertado"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "ERRO: Lendo o ficheiro insertado"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Non foi posíbel facer unha operación de stat sobre un desvío"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Desvío grande de máis"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: a opción «--%s» non permite un argumento\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: opción «--%s» non recoñecida\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opción inaceptábel -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: a opción «-W %s» é ambigua\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: a opción «-W %s» non permite un argumento\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr ""
+#~ "ERRO INTERNO: Tipo de dato incorrecto no elemento en define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "ERRO INTERNO: Predefinida non atopada na táboa de predefinidas!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "ERRO INTERNO: Tipo de dato incorrecto no elemento en m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "ERRO INTERNO: Tipo de símbolo incorrecto en m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "A base está fóra dos límites en eval (base = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Código de sintaxe %c non definido"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "ERRO INTERNO: Predefinida non atopada na táboa de predefinidas! "
+#~ "(trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "ERRO INTERNO: Tipo de dato incorrecto no elemento (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "ERRO INTERNO: Código de erro incorrecto en evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "ERRO INTERNO: Operador de comparación incorrecto en cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "ERRO INTERNO: Operador de desprazamento incorrecto en shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "ERRO INTERNO: Operador incorrecto en mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "ERRO INTERNO: Predefinida non atopada na táboa de predefinidas!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "ERRO INTERNO: Tipo de dato incorrecto no elemento en freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "«%s» do ficheiro conxelado non se atopou na táboa de predefinidas!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "A entrada levouse a %s, liña %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Lese a entrada de %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "ERRO INTERNO: push_string recursivo!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "ERRO INTERNO: Chamada incorrecta a init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "ERRO INTERNO: Fallo na pila de entrada en next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "ERRO INTERNO: Fallo na pila de entrada en peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "NINGÚN"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "ERRO: Desbordamento da pila. (Recursión infinita de defines?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Os parámetros obrigatorios ou opcionais nas opcións longas son tamén\n"
+#~ "obrigatorios ou opcionais nas opcións curtas.\n"
+#~ "\n"
+#~ "Modos de funcionamento:\n"
+#~ "      --help                   mostrar esta axuda e saír\n"
+#~ "      --version                mostrar información sobre a versión e "
+#~ "saír\n"
+#~ "  -e, --interactive            non usar un búfer de saída, ignorar as\n"
+#~ "                                 interrupcións\n"
+#~ "  -E, --fatal-warnings         deter a execución tralo primeiro aviso\n"
+#~ "  -Q, --quiet, --silent        suprimir algúns avisos das predefinidas\n"
+#~ "  -P, --prefix-builtins        forzar un prefixo `m4_' en todas as "
+#~ "predefinidas\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Características de carga dinámica:\n"
+#~ "  -m, --module-directory=DIRECTORIO  engadir o DIRECTORIO á ruta de "
+#~ "busca\n"
+#~ "                                        de módulos\n"
+#~ "  -M, --load-module=MÓDULO           cargar o MÓDULO dinámico de "
+#~ "M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "OPCIÓNS é unha de:\n"
+#~ "  t   seguimento de toda as chamadas a macros, non só nas que teñen "
+#~ "traceon\n"
+#~ "  a   mostrar os parámetros\n"
+#~ "  e   mostrar a expansión\n"
+#~ "  q   citar os valores cando sexa preciso, coas opcións a ou e\n"
+#~ "  c   mostrar antes da obtención, despois da obtención e despois da "
+#~ "chamada\n"
+#~ "  x   engadir un identificador único de chamada á macro, útil coa opción "
+#~ "c\n"
+#~ "  f   dicir o nome do ficheiro de entrada actual\n"
+#~ "  l   dicir o número da liña de entrada actual\n"
+#~ "  p   mostrar os resultados das buscas nas rutas\n"
+#~ "  i   mostrar os cambios nos ficheiros de entrada\n"
+#~ "  V   forma curta de poñer todas as opcións de enriba\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "ERRO: non foi posíbel engadir o directorio de busca «%s»"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "ERRO: non foi posíbel engadir o directorio de busca «%s»: %s"
+
+#~ msgid " (options:"
+#~ msgstr " (opcións:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "ERRO INTERNO: Código incorrecto nos parámetros pospostos"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "ERRO INTERNO: Tipo de elemento incorrecto en expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "ERRO INTERNO: Tipo de elemento incorrecto en expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "ERRO INTERNO: Tipo de símbolo incorrecto en call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ERRO: non foi posíbel inicializar uns módulos: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ERRO: non foi posíbel atopar un módulo: «%s»"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ERRO: non foi posíbel atopar un módulo: «%s»: %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ERRO: non foi posíbel pechar os módulos"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "ERRO: non foi posíbel pechar uns módulos: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "ERRO: non foi posíbel pechar un módulo: «%s»: %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "A busca de rutas de «%s» atopou «%s»"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Violación dos límites de memoria detectada (SIGSEGV).  Ou ocorreu un\n"
+#~ "desbordamento de pila ou hai un fallo en "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Busque unha posíbel recursión infinita.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "ERRO INTERNO: Modo incorrecto para symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "O nome «%s» é descoñecido\n"
+
+#~ msgid "Module search for `%s' found `%s'"
+#~ msgstr "A búsqueda de módulo de `%s' atopou `%s'"
diff --git a/po/hr.gmo b/po/hr.gmo
new file mode 100644 (file)
index 0000000..3cd133c
Binary files /dev/null and b/po/hr.gmo differ
diff --git a/po/hr.po b/po/hr.po
new file mode 100644 (file)
index 0000000..51eb15b
--- /dev/null
+++ b/po/hr.po
@@ -0,0 +1,1248 @@
+# Translation of m4 to Croatian.
+# Copyright (C) 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+#
+# Tomislav Krznar <tomislav.krznar@gmail.com>, 2012.
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2012-09-28 15:54+0200\n"
+"Last-Translator: Tomislav Krznar <tomislav.krznar@gmail.com>\n"
+"Language-Team: Croatian <lokalizacija@linux.hr>\n"
+"Language: hr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: Lokalize 1.4\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "GREŠKA: Ne mogu napraviti privremenu datoteku za preusmjeravanje"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Ne mogu postaviti datoteku grešaka: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: opcija „%s” je višeznačna\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: opcija „%s” je višeznačna\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: neprepoznata opcija „%c%s”\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: opcija „%c%s” ne dozvoljava argument\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: opcija „%s” zahtijeva argument\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: neispravna opcija -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opcija zahtijeva argument -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memorija iscrpljena"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Uspjeh"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nema poklapanja"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Neispravan regularni izraz"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Neispravan znak razvrstavanja"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Neispravno ime razreda znakova"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Obrnuta kosa crta na kraju"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Neispravna povratna referenca"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Neuparena [ ili [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Neuparena ( ili \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Neuparena \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Neispravan sadržaj \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Neispravan kraj raspona"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memorija iscrpljena"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Neispravan prethodni regularni izraz"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Preuranjen kraj regularnog izraza"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regularni izraz je prevelik"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Neuparena ) ili \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Nedostaje prethodni regularni izraz"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "VMEM ograničenje prekoračeno?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "VMEM ograničenje prekoračeno?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Nedefinirano ime %s"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Nedefinirano ime %s"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Prijavite greške na <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Neispravan regularni izraz „%s”: %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Upozorenje: Premalo argumenata ugrađenom „%s”"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Upozorenje: Suvišni argumenti ugrađenom „%s” zanemareni"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Argument ugrađenom „%s” nije broj"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Argument ugrađenom „%s” nije broj"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Nedefinirano ime „%s”"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Nedefinirano ime „%s”"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Upozorenje: Premalo argumenata ugrađenom „%s”"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Ne mogu otvoriti cjevovod prema naredbi „%s”"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Negativna širina za eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Ne mogu ukloniti preusmjerenje %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Ne mogu ukloniti preusmjerenje %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Ne mogu otvoriti %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "GREŠKA: ne mogu zatvoriti modul: „%s”"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr ""
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Ne mogu postaviti datoteku grešaka: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "UPOZORENJE: \\0 će nestati, koristite \\& u zamjenama"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Neispravan regularni izraz „%s”: %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Greška traženja regularnog izraza „%s”"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Neispravan regularni izraz „%s”: %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Neispravan izraz u eval (nedostaje desna zagrada): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Neispravan izraz u eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Neispravan izraz u eval (neispravan unos): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Neispravan izraz u eval (suvišan unos): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Dijeljenje s nulom u eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Dijeljenje s nulom u eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Cjelobrojno dijeljenje s nulom u eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Neispravan izraz u eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Argument za %s nije broj"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: neprepoznata opcija „%c%s”\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Očekujem LF u zamrznutoj datoteci"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Očekujem znak „%c” u zamrznutoj datoteci"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Očekujem LF u zamrznutoj datoteci"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Preuranjen kraj zamrznute datoteke"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Ne mogu otvoriti %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Loše oblikovana zamrznuta datoteka"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "GREŠKA: EOF u znakovnom nizu"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Pokušajte „%s --help” za više informacija.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Uporaba: %s [OPCIJA]]... DATOTEKA...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Ako DATOTEKA nije navedena ili je „=”, čita se standardni ulaz.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+
+#: src/m4.c:247
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+
+#: src/m4.c:255
+#, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+
+#: src/m4.c:263
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+
+#: src/m4.c:269
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Neispravne zastavice debugiranja: „%s”"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "GREŠKA: EOF u popisu argumenata"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"GREŠKA: Ograničenje rekurzije %d je prekoračeno, koristite -L<N> za promjenu"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "GREŠKA: Ne mogu napraviti privremenu datoteku za preusmjeravanje"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "GREŠKA: Ne mogu napraviti privremenu datoteku za preusmjeravanje"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+msgid "cannot seek within diversion"
+msgstr ""
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "GREŠKA: Ne mogu napraviti privremenu datoteku za preusmjeravanje"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "GREŠKA: Ne mogu napraviti privremenu datoteku za preusmjeravanje"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "GREŠKA: Kopiram ubačenu datoteku"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "GREŠKA: Čitam ubačenu datoteku"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Ne mogu ukloniti preusmjerenje %s"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Preusmjerenje je preveliko"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: opcija „--%s” ne dozvoljava argument\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: neprepoznata opcija „--%s”\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: nedozvoljena opcija -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: opcija „-W %s” je višeznačna\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: opcija „-W %s” ne dozvoljava argument\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "INTERNA GREŠKA: Neispravna vrsta podataka simbola u define_macro()"
+
+# ???
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "INTERNA GREŠKA: Ugradnja nije pronađena u tablici ugradnji!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "INTERNA GREŠKA: Neispravna vrsta podataka simbola u m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "INTERNA GREŠKA: Neispravna vrsta simbola u m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Baza u eval je izvan granica (baza = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Nedefinirani sintaksni kod %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "INTERNA GREŠKA: Ugradnja nije pronađena u tablici ugradnji! (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "INTERNA GREŠKA: Neispravna vrsta podataka simbola (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "INTERNA GREŠKA: Neispravan kod greške u evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "INTERNA GREŠKA: Neispravan operator uspoređivanja u cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "INTERNA GREŠKA: Neispravan operator pomaka u shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "INTERNA GREŠKA: Neispravan operator u mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "INTERNA GREŠKA: Ugradnja nije pronađena u tablici ugradnji!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "INTERNA GREŠKA: Neispravna vrsta podataka simbola u freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "„%s” iz zaleđene datoteke nije pronađen u tablici ugradnji!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Ulaz vraćen u %s, redak %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Ulaz pročitan s %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "INTERNA GREŠKA: Rekurzivni push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "INTERNA GREŠKA: Neispravan poziv init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "INTERNA GREŠKA: Zakrpa ulaznog stoga u next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "INTERNA GREŠKA: Zakrpa ulaznog stoga u peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "NIJEDAN"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "GREŠKA: Preljev stoga. (Beskonačna rekurzija u definiciji?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Obavezni ili opcionalni argumenti dugačkih opcija također su obavezni "
+#~ "ili\n"
+#~ "opcionalni za odgovarajuće kratke opcije.\n"
+#~ "\n"
+#~ "Načini rada:\n"
+#~ "      --help                   prikaži ovu pomoć i izađi\n"
+#~ "      --version                prikaži informacije o inačici i izađi\n"
+#~ "  -e, --interactive            ukloni izlaz iz međuspremnika, zanemari "
+#~ "prekide\n"
+#~ "  -E, --fatal-warnings         zaustavi izvršavanje nakon prvog "
+#~ "upozorenja\n"
+#~ "  -Q, --quiet, --silent        izostavi neka upozorenja za ugradnje\n"
+#~ "  -P, --prefix-builtins        prisilno dodaj prefiks „m4_” svim "
+#~ "ugradnjama\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "GREŠKA: nisam uspio dodati direktorij za pretraživanje „%s”"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "GREŠKA: nisam uspio dodati direktorij za pretraživanje „%s”: %s"
+
+#~ msgid " (options:"
+#~ msgstr " (opcije:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "INTERNA GREŠKA: Neispravan kod u odgođenim argumentima"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "INTERNA GREŠKA: Neispravna vrsta simbola u expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "INTERNA GREŠKA: Neispravna vrsta simbola u expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "INTERNA GREŠKA: Neispravna vrsta simbola u call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "GREŠKA: nisam uspio inicijalizirati module: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "GREŠKA: ne mogu pronaći modul: „%s”"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "GREŠKA: ne mogu pronaći modul: „%s”: %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "GREŠKA: ne mogu zatvoriti module"
+
+# WTF?
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "GREŠKA: ne mogu ne zatvoriti module: %s"
+
+# WTF?
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "GREŠKA: ne mogu ne zatvoriti modul: „%s”: %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Pretraživanjem putanje za „%s” je pronađen „%s”"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Otkriveno je nepridržavanje granica memorije (SIGSEGV). Ili se dogodio\n"
+#~ "preljev stoga, ili postoji greška u "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Provjeri moguće beskonačne rekurzije.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "INTERNA GREŠKA: Neispravan mod za symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Ime „%s” je nepoznato\n"
diff --git a/po/id.gmo b/po/id.gmo
new file mode 100644 (file)
index 0000000..4e27509
Binary files /dev/null and b/po/id.gmo differ
diff --git a/po/id.po b/po/id.po
new file mode 100644 (file)
index 0000000..27410a5
--- /dev/null
+++ b/po/id.po
@@ -0,0 +1,1305 @@
+# m4-1.4o (Indonesian).
+# Copyright (C) 1998 Free Software Foundation, Inc.
+# Tedi Heriyanto <tedi_h@gmx.net>, 2000,2001,2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2002-07-24 21:21GMT+0700\n"
+"Last-Translator: Tedi Heriyanto <tedi_h@gmx.net>\n"
+"Language-Team: Indonesian <translation-team-id@lists.sourceforge.net>\n"
+"Language: id\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"X-Generator: KBabel 0.9.5\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "KESALAHAN: tidak dapat membuat file temporer untuk diversi"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Tidak dapat menset error file: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: option `%s' rancu\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: option `%s' rancu\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: option tidak dikenal `%c%s'\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: option `%c%s' tidak membolehkan sebuah argumen\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: option `%s' membutuhkan sebuah argumen\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: option tidak valid -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: option membutuhkan sebuah argumen -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memori habis"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Sukses"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Tidak ada kecocokan"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ekspresi Reguler tidak valid"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Karakter kolasi tidak valid"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nama kelas karakter tidak valid"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Trailing backslash"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Referensi balik tidak valid"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ atau [^ tidak cocok"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( atau \\( tidak cocok"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ tidak cocok"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Isi \\{\\} tidak valid"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Akhir range tidak valid"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memori habis"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Regular ekspresi sebelumnya tidak valid"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Akhir regular ekspresi yang prematur"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Regular ekspresi terlalu besar"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") atau \\) tidak cocok"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Tidak ada regular ekspresi sebelumnya"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Batas VMEM terlampaui?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Batas VMEM terlampaui?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Nama yang tak terdefinisi %s"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Nama yang tak terdefinisi %s"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Laporkan bug ke <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Ekspresi Reguler yang buruk `%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Peringatan: Argumen terlalu sedikit untuk built-in `%s'"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Peringatan: Argumen terlalu banyak untuk built-in `%s'"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Argumen non-numerik untuk built-in `%s'"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Argumen non-numerik untuk built-in `%s'"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Nama yang tak terdefinisi `%s'"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Nama yang tak terdefinisi `%s'"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Peringatan: Argumen terlalu sedikit untuk built-in `%s'"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Tidak dapat membuka pipe untuk perintah `%s'"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Lebar negatif untuk eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Tidak dapat mendivert %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Tidak dapat mendivert %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Tidak dapat membuka %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "ERROR: tidak dapat menutup modul: `%s'"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Debugmode: flag debug buruk: `%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Tidak dapat menset error file: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "PERINGATAN: \\0 akan hilang, gunakan \\& sebagai gantinya"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Ekspresi Reguler yang buruk `%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Kesalahan mencocokkan ekspresi reguler `%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Ekspresi Reguler yang buruk `%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Ekspresi buruk dalam eval (tanda kurung kanan tidak ada): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Ekspresi buruk dalam eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Ekspresi buruk dalam eval (input buruk): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Ekspresi buruk dalam eval (input berlebih): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Pembagian dengan nol dalam eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Pembagian dengan nol dalam eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulus dengan nol dalam eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Ekspresi buruk dalam eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Argumen non-numerik untuk %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: option tidak dikenal `%c%s'\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Mengharapkan line feed dalam frozen file"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Mengharapkan karakter `%c' dalam frozen file"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Mengharapkan line feed dalam frozen file"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Akhir frozen file prematur"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Tidak dapat membuka %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Frozen file dalam format buruk"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "KESALAHAN: EOF dalam string"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Coba `%s --help' untuk informasi lebih lanjut.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Pemakaian: %s [OPTION]... [FILE]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Jika tidak ada FILE atau jika FILE adalah `-', baca dari std input.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr "  -W, --word-regexp=REGEXP  gunakan REGEXP untuk sintaks nama makro\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Feature preprosesor:\n"
+"  -I, --include=DIREKTORI     cari direktori ini untuk include\n"
+"  -D, --define=NAMA[=NILAI]   masukkan NAMA yang bernilai NILAI, atau "
+"kosong\n"
+"  -U, --undefine=NAMA         hapus builtin NAMA\n"
+"  -s, --synclines             hasilkan baris `#line NO \"FILE\"\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Kendali batas:\n"
+"  -G, --traditional           tiadakan seluruh ekstensi GNU\n"
+"  -H, --hashsize=PRIME        set ukuran tabel simbol lookup hash\n"
+"  -L, --nesting-limit=NUMBER  rubah batas sarang buatan\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"File frozen state:\n"
+"  -F, --freeze-state=FILE    hasilkan frozen state pada FILE di akhir\n"
+"  -R, --reload-state=FILE    reload frozen state dari FILE di awal\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Debugging:\n"
+"  -d, --debug=[FLAGS]      set level debug (tidak ada FLAGS berarti `aeq')\n"
+"  -t, --trace=NAMA         trace NAMA ketika akan didefinisikan\n"
+"  -l, --arglength=NUM      batasi ukuran tracing makro\n"
+"  -o, --error-output=FILE  redireksi output debug dan trace\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Flag debug buruk: `%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "KESALAHAN: EOF dalam daftar argumen"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "KESALAHAN: batas rekursi %d terlampaui, gunakan -L<N> untuk merubahnya"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "KESALAHAN: tidak dapat membuat file temporer untuk diversi"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "KESALAHAN: tidak dapat membuat file temporer untuk diversi"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Tidak dapat mendiversi"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "KESALAHAN: tidak dapat membuat file temporer untuk diversi"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "KESALAHAN: tidak dapat memflush diversi ke file temporer"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "KESALAHAN: menyalinkan file yang disisipkan"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "KESALAHAN: membaca file yang disisipkan"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Tidak dapat mendiversi"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Diversi terlalu besar"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: option `--%s' tidak membolehkan sebuah argumen\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: option tidak dikenal `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: option ilegal -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: option `-W %s' rancu\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: option `-W %s' tidak membolehkan sebuah argumen\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "KESALAHAN INTERNAL: Tipe data token buruk dalam define_macro()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "KESALAHAN INTERNAL: Builtin tidak ditemukan dalam tabel builtin!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "KESALAHAN INTERNAL: tipe token data buruk dalam m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "KESALAHAN INTERNAL: tipe simbol buruk dalam m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Radix dalam eval di luar jangkauan (radix = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Kode sintaks %c tak terdefinisi"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "KESALAHAN INTERNAL: Builtin tidak ditemukan dalam tabel builtin! "
+#~ "(trace_pre())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "KESALAHAN INTERNAL: tipe data token buruk (trace_pre())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "KESALAHAN INTERNAL: Kode kesalahan buruk dalam evaluate()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "KESALAHAN INTERNAL: operator perbandingan buruk dalam cmp_term()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "KESALAHAN INTERNAL: operator shift buruk dalam shift_term()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "KESALAHAN INTERNAL: operator buruk dalam mult_term()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "KESALAHAN INTERNAL: builtin tidak ditemukan dalam tabel builtin"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "KESALAHAN INTERNAL: tipe data token buruk dalam freeze_one_symbol()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "`%s' dari frozen file tidak ditemukan dalam tabel builtin!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Input dikembalikan ke %s, baris %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Input membaca dari %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "KESALAHAN INTERNAL: push_string rekursif"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "KESALAHAN INTERNAL: panggilan buruk ke init_macro_token()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "KESALAHAN INTERNAL: stack input kacau dalam next_char()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "KESALAHAN INTERNAL: stack input kacau dalam peek_input()"
+
+#~ msgid "NONE"
+#~ msgstr "TIDAK ADA"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "KESALAHAN: stack overflow. (Rekursi tidak terbatas?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Argumen opsional atau mandatori untuk opsion panjang juga berlaku \n"
+#~ "untuk opsion pendek.\n"
+#~ "\n"
+#~ "Mode operasi:\n"
+#~ "      --help              menampilkan bantuan ini dan keluar\n"
+#~ "      --version           menampilkan informasi versi dan keluar\n"
+#~ "  -e, --interactive       output unbuffer, abaikan interrupt\n"
+#~ "  -E, --fatal-warnings    akhir eksekusi setelah peringatan pertama\n"
+#~ "  -Q, --quiet, --silent   hilangkan beberapa peringatan builtin\n"
+#~ "  -P, --prefix-builtins   paksa prefix `m4_' untuk seluruh builtin\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Fitur loading dinamis:\n"
+#~ "  -m, --module-directory=DIRECTORY  tambah DIRECTORY ke path pencarian "
+#~ "modul\n"
+#~ "  -M, --load-module=MODULE          muat MODULE dinamik dari M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "FLAGS adalah:\n"
+#~ "  t  trace seluruh panggilan makro, tidak hanya saat traceon\n"
+#~ "  a  tampilkan seluruh argumen aktual\n"
+#~ "  e  tampilkan ekspansi\n"
+#~ "  q  cuplik nilai seperlunya, dengan flag a atau e\n"
+#~ "  c  tampilkan sebelum, setelah koleksi dan setelah panggilan\n"
+#~ "  x  tambahkan id panggilan makro unik, berguna dengan flag c\n"
+#~ "  f  beritahu nama file input saat ini\n"
+#~ "  l  beritahu nomor baris file input saat ini\n"
+#~ "  p  tampilkan hasil pencarian path\n"
+#~ "  i  tampilkan perubahan dalam file input\n"
+#~ "  V  kependekan untuk seluruh flag di atas\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "ERROR: gagal menambah direktori pencarian `%s'"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "ERROR: gagal menambah direktori pencarian`%s': %s"
+
+#~ msgid " (options:"
+#~ msgstr " (opsi:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "KESALAHAN INTERNAL: tipe token buruk dalam deferred arguments"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "KESALAHAN INTERNAL: tipe token buruk dalam expand_token()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "KESALAHAN INTERNAL: tipe token buruk dalam expand_argumen()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "KESALAHAN INTERNAL: tipe simbol buruk dalam call_macro()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ERROR: gagal inisialisasi modul: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ERROR: tidak dapat menemukan modul: `%s'"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ERROR: tidak dapat menemukan modul `%s':%s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ERROR: tidak dapat menutup modul "
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "ERROR: tidak dapat menutup modul %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "ERROR: tidak dapat menutup modul: `%s': %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Mencari path untuk `%s' menemukan `%s'"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Pelanggaran batas memori terdeteksi (SIGSEGV). Mungkin terdapat stack\n"
+#~ "overflow atau terdapat bug di dalamnya "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Memeriksa kemungkinan rekursi tak terbatas.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "KESALAHAN INTERNAL: mode ilegal untuk symbol_lookup()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Nama `%s' tidak dikenal\n"
diff --git a/po/insert-header.sin b/po/insert-header.sin
new file mode 100644 (file)
index 0000000..b26de01
--- /dev/null
@@ -0,0 +1,23 @@
+# Sed script that inserts the file called HEADER before the header entry.
+#
+# At each occurrence of a line starting with "msgid ", we execute the following
+# commands. At the first occurrence, insert the file. At the following
+# occurrences, do nothing. The distinction between the first and the following
+# occurrences is achieved by looking at the hold space.
+/^msgid /{
+x
+# Test if the hold space is empty.
+s/m/m/
+ta
+# Yes it was empty. First occurrence. Read the file.
+r HEADER
+# Output the file's contents by reading the next line. But don't lose the
+# current line while doing this.
+g
+N
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/po/ja.gmo b/po/ja.gmo
new file mode 100644 (file)
index 0000000..c465436
Binary files /dev/null and b/po/ja.gmo differ
diff --git a/po/ja.po b/po/ja.po
new file mode 100644 (file)
index 0000000..14d8a8e
--- /dev/null
+++ b/po/ja.po
@@ -0,0 +1,1707 @@
+# Japanese messages for GNU m4.
+# Copyright (C) 2000, 2010 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Akiko Matsushita <matusita@sra.co.jp>, 1996.
+# Masahito Yamaga <yamaga@ipc.chiba-u.ac.jp>, 2002.
+# GOTO Masanori <gotom@debian.or.jp>, 2006.
+#  derived from the version by Yasuyuki Furukawa <yasu@on.cs.keio.ac.jp> 1998.
+#                              Jun Nishii <jun@flatout.org> 1999.
+#                              Daisuke Yamashita <yamad@mb.infoweb.ne.jp> 1999.
+# Yasuaki Taniguchi <yasuakit@gmail.com>, 2011.
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2011-10-23 08:32+0900\n"
+"Last-Translator: Yasuaki Taniguchi <yasuakit@gmail.com>\n"
+"Language-Team: Japanese <translation-team-ja@lists.sourceforge.net>\n"
+"Language: ja\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr "一時ディレクトリを作成できません。 $TMPDIR を設定してみてください"
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr "テンプレート \"%s\" を使用した一時ディレクトリを作成できません"
+
+#: lib/clean-temp.c:371
+#, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "一時ディレクトリ %s を削除できません"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr "ファイルクローズエラー"
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr "書き込みエラー"
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr "プログラムエラー"
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr "スタックオーバーフロー"
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "一時ディレクトリ %s を削除できません"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr "不明なシステムエラー"
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr "%s サブプロセスが失敗しました"
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: オプション `%s' は曖昧です\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: オプション `%s' は曖昧です\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: `%c%s' は認識されないオプションです\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: オプション `%c%s' は引数を取ることができません\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: オプション `%s' には引数が必要です\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: %c は無効なオプションです。\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: %c オプションには引数が必要です\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "メモリを使い果たしました"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "現在の作業ディレクトリを記録することができません"
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "初期作業ディレクトリに戻るのに失敗しました"
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr "_open_osfhandle に失敗しました"
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr "ファイル記述子 (fd) %d をリストアできません: dup2 に失敗しました"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr "`"
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr "'"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "成功です"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "一致しません"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "無効な正規表現です"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "無効な照合文字です"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "無効な文字クラス名です"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "終端のバックスラッシュ"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "無効な前方参照です"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ または [^ が不一致です"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( または \\( が不一致です"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ が不一致です"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} の中身が無効です"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "無効な範囲終了です"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "メモリを使い果たしました"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "無効な前方正規表現です"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "正規表現が途中で終了しました"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "正規表現が大きすぎます"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") または \\) が不一致です"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "以前に正規表現がありません"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr "Hangup"
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr "割り込み"
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr "終了"
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr "Illegal instruction"
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr "Trace/breakpoint trap"
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr "中止"
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr "浮動小数点例外"
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr "強制終了"
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr "バスエラー"
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr "Segmentation fault"
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr "Broken pipe"
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr "Alarm clock"
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr "Terminated"
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr "緊急 I/O 状態"
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr "停止 (シグナル)"
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr "停止"
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr "継続"
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr "子プロセス終了"
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr "停止 (tty 入力)"
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr "停止 (tty 出力)"
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr "I/O 可能"
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "ファイルサイズ制限を超過しました"
+
+#: lib/siglist.h:97
+msgid "File size limit exceeded"
+msgstr "ファイルサイズ制限を超過しました"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr "仮想タイマーが終了しました"
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr "プロファイリングタイマーが終了しました"
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr "Window が変更されました"
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "ユーザー定義シグナル2"
+
+#: lib/siglist.h:112
+msgid "User defined signal 2"
+msgstr "ユーザー定義シグナル2"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr "EMT トラップ"
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr "間違ったシステムコール"
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr "スタックエラー"
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr "情報要求"
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr "電源エラー"
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr "リソースが無くなりました"
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr "パイプを作成できません"
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr "リアルタイムシグナル %d"
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr "不明なシグナル %d"
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "エラーメッセージを表示できません"
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "パッケージ作成者: %s (%s)\n"
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "パッケージ作成者: %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr "(C)"
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, fuzzy, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+"\n"
+"ライセンス GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl."
+"html>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr "作者 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "作者 %s および %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "作者 %s、 %s、および %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"作者 %s、 %s、 %s、\n"
+"および %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"作者 %s、 %s、 %s、\n"
+"%s、および %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"作者 %s、 %s、 %s、\n"
+"%s、 %s、および %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"作者 %s、 %s、 %s、\n"
+"%s、 %s、 %s、および %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"作者 %s、 %s、 %s、\n"
+"%s、 %s、 %s、 %s、\n"
+"および %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"作者 %s、 %s、 %s、\n"
+"%s、 %s、 %s、 %s、\n"
+"%s、および %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"作者 %s、 %s、 %s、\n"
+"%s、 %s、 %s、 %s、\n"
+"%s、 %s、 および他の方々。\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"バグを発見したら <%s> に報告して下さい。\n"
+"翻訳に関するバグは<translation-team-ja@lists.sourceforge.net>に報告してくださ"
+"い。\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "%s のバグは <%s> に報告してください。\n"
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s のホームページ: <%s>\n"
+
+#: lib/version-etc.c:260
+#, fuzzy, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+"GNU ソフトウェアを使用する際の一般的なヘルプ: <http://www.gnu.org/gethelp/>\n"
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr "%s 子プロセス"
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr "%s 子プロセスが致命的なシグナル %d を受信しました"
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr "書式設定を行った出力を実行することができません"
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "正規表現 `%s' に誤りがあります: %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "警告: ビルトイン `%s' に対する引数が不足しています"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "警告: ビルトイン `%s' に対する引数が多すぎます (超過分は無視されます)"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "ビルトイン `%s' に非数字の引数が渡されています"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "ビルトイン `%s' に非数字の引数が渡されています"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "`%s' という名前は定義されていません"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "`%s' という名前は定義されていません"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "警告: ビルトイン `%s' に対する引数が不足しています"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "コマンド `%s' に対するパイプを開けません"
+
+#: src/builtin.c:1051
+#, fuzzy
+msgid "cannot read pipe"
+msgstr "パイプを作成できません"
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "eval の出力桁数が負数になっています"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "\"%s\"の書込み中にエラーが発生しました"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "%s を undivert できません"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "%s を開くことが出来ません"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "パイプを作成できません"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "デバッグモード: 誤ったデバッグフラグです: `%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "エラーファイルとして設定できません: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "警告: \\0 は廃止されます。置換の際には代わりに \\& を使用してください"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "正規表現 `%s' に誤りがあります: %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "正規表現 `%s' の一致処理に失敗しました"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "正規表現 `%s' に誤りがあります: %s"
+
+#: src/debug.c:136 src/debug.c:157
+#, fuzzy
+msgid "error writing to debug stream"
+msgstr "\"%s\"の書込み中にエラーが発生しました"
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "eval 中の計算式に誤りがあります (閉じる小括弧がありません): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "eval 中の計算式に誤りがあります: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "eval 中の計算式に誤りがあります (誤った入力): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "eval 中の計算式に誤りがあります (入力超過): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "eval 中に 0 による除算があります: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "eval 中に 0 による除算があります: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "eval 中に 0 による剰余計算があります: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "eval 中の計算式に誤りがあります: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "%s に数字でない引数が渡されています"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: `%c%s' は認識されないオプションです\n"
+
+#: src/freeze.c:156
+#, fuzzy
+msgid "unable to create frozen state"
+msgstr "\"%s\" の作成に失敗しました"
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "凍結ファイル内で改行が予期されます"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "凍結ファイル内で文字 `%c' が予期されます"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "凍結ファイル内で改行が予期されます"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "凍結ファイルのファイル終端 (EOF) が早すぎます"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "%s を開くことが出来ません"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "不正な書式の凍結ファイルです"
+
+#: src/freeze.c:385
+#, fuzzy
+msgid "unable to read frozen state"
+msgstr "エラーメッセージを表示できません"
+
+#: src/input.c:359
+#, fuzzy
+msgid "read error"
+msgstr "書き込みエラー"
+
+#: src/input.c:366
+#, fuzzy
+msgid "error reading file"
+msgstr "\"%s\"の読込み中にエラーが発生しました"
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "エラー: 文字列内でファイル終端 (EOF) に達しました"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "詳しくは `%s --help' を実行して下さい。\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "使用法: %s [OPTION]... [FILE]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"FILE が指定されていない場合および指定されたファイルが `-' の場合は\n"
+"        標準入力が読み込まれます。\n"
+
+#: src/m4.c:219
+#, fuzzy
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+"長い形式のオプションで必須または任意の引数は、それに対応する短い形式のオプ"
+"ションでも同様に必須または任意です。"
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=REGEXP     マクロ名の構文として正規表現 REGEXP\n"
+"                               を使用する\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"プリプロセッサ機能:\n"
+"  -I, --include=DIRECTORY      2番目のインクルードディレクトリとして "
+"DIRECTORY\n"
+"                               を検索する\n"
+"  -D, --define=NAME[=VALUE]    NAME の値を VALUE に設定する。省略した場合は\n"
+"                               空になる\n"
+"  -U, --undefine=NAME          NAME ビルトインを削除する\n"
+"  -s, --synclines              `#line NO \"FILE\"' 行を生成する\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"制限の制御:\n"
+"  -G, --traditional            全ての GNU 拡張を抑止する\n"
+"  -H, --hashsize=PRIME         シンボル検索のハッシュテーブルサイズを設定す"
+"る\n"
+"  -L, --nesting-limit=NUMBER   ネストの制限を人為的に NUMBER に変更する\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"凍結状態のファイル:\n"
+"   -F, --freeze-state=FILE      最後に指定された FILE を凍結状態にします。\n"
+"   -R, --reload-state=FILE      最初に指定された FILE から\n"
+"                                凍結された定義をロードします\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"デバッグ:\n"
+"  -d, --debug=[FLAGS]          デバッグレベルを設定する (FLAGS を指定しない\n"
+"                               場合は暗黙的に `aeq' となる)\n"
+"  -t, --trace=NAME             NAME が定義されたらトレースを行う\n"
+"  -l, --arglength=NUM          マクロのトレースサイズを NUM に制限する\n"
+"  -o, --error-output=FILE      デバッグとトレースの出力を FILE にリダイレ\n"
+"                               クトする\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "不正なデバッグフラグ: `%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr "標準エラー出力"
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "エラー: 引数リスト内にファイルの終端記号があります。"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"エラー:再帰的定義のネストが指定された値 %d を超えています。\n"
+"        -L<数字> オプションを用いてネスト数の上限を増やして下さい。"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "エラー: divert のためのテンポラリファイルが作成できません。"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "エラー: divert のためのテンポラリファイルが作成できません。"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr ""
+"divert のためのファイルのステータスを得ることができません。\n"
+"        (stat できません。)"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "エラー: divert のためのテンポラリファイルが作成できません。"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "エラー: テンポラリファイルに divert すべき内容を write できません。"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "エラー: 挿入されるべきファイルをコピー中です。"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "エラー: 挿入されるべきファイルをリード中です。"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr ""
+"divert のためのファイルのステータスを得ることができません。\n"
+"        (stat できません。)"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "divert が大きすぎます"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: オプション `--%s' は引数を取ることができません\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: --%s は認識されないオプションです\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: 不正なオプション -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: オプション '-W %s' は曖昧です\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: オプション '-W %s' は引数を取ることができません\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr ""
+#~ "内部エラー:関数 define_macro () 内のトークンデータの種類に誤りがあります"
+
+#, c-format
+#~ msgid "Undefined name %s"
+#~ msgstr "%s という名前は定義されていません"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "内部エラー:ビルトインテーブルにビルトインが見つかりません!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr ""
+#~ "内部エラー:関数 m4_dumpdef () 内のトークンデータの種類に誤りがあります"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "内部エラー:関数 m4_defn () 内のシンボルの種類に誤りがあります"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "eval の基数 ( %d 進法) の桁数が許容範囲外にあります"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "構文コード %c は定義されていません"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "内部エラー:ビルトインテーブルにビルトインが見つかりません! (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "内部エラー:トークンデータの種類に誤りがあります (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "内部エラー: evaluate () 内のエラーコードに誤りがあります"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "内部エラー: cmp_term () 内の比較演算子に誤りがあります"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "内部エラー: shift_term () 内のシフト演算子に誤りがあります"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "内部エラー: mult_term () 内の演算子に誤りがあります"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "内部エラー: ビルトインテーブルにビルトインが見つかりません!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "内部エラー: freeze_one_symbol () 内のトークンデータの種類に誤りがあります"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "凍結ファイルの `%s' がビルトインテーブル内にありません!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "入力が %s へ戻されました (行 %d)"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "%s から入力を読み込みます"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "内部エラー: 再帰的な push_string です!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "内部エラー: init_macro_token () の誤った呼び出しです"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "内部エラー: next_char () 内で入力スタックが壊れました"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "内部エラー: peek_input () 内で入力スタックが壊れました"
+
+#~ msgid "NONE"
+#~ msgstr "NONE"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr ""
+#~ "エラー: スタックオーバーフローです。(無限に再帰定義をしていませんか?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "長い形式のオプションで必須または任意の引数は、それに対応する短い形式の\n"
+#~ "オプションでも同様に必須または任意です。\n"
+#~ "\n"
+#~ "操作モード:\n"
+#~ "      --help                   オプション一覧を出力し、終了する\n"
+#~ "      --version                バージョン情報を出力し、終了する\n"
+#~ "  -e, --interactive            出力バッファリングせず、割り込みを無視す"
+#~ "る\n"
+#~ "  -E, --fatal-warnings         最初の警告で実行を中止する\n"
+#~ "  -Q, --quiet, --silent        ビルトインのいくつかの警告を抑止する\n"
+#~ "  -P, --prefix-builtins        全てのビルトインに `m4_' という接頭辞を\n"
+#~ "                               強制的に付加する\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "動的ローディング機能:\n"
+#~ "  -m, --module-directory=DIRECTORY  モジュール検索パスに DIRECTORY を加え"
+#~ "る\n"
+#~ "  -M, --load-module=MODULE          M4MODPATH から動的に MODULE をロードす"
+#~ "る\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "FLAG は以下のいずれかです:\n"
+#~ "  t   全てのマクロ呼びだしをトレースする\n"
+#~ "       (traceon によるものに限定しない)\n"
+#~ "  a   実際の引数を表示する\n"
+#~ "  e   展開されたものを表示する\n"
+#~ "  q   `a' または `e' と共に用い、必要に応じて値を引用符で囲む\n"
+#~ "  c   訂正前と訂正後、呼出後に表示する\n"
+#~ "  x   そのマクロコールに固有の ID を追加する。\n"
+#~ "       `c' と組み合わせると役に立つ\n"
+#~ "  f   現在の入力ファイル名を表示する\n"
+#~ "  l   現在の入力行数を表示する\n"
+#~ "  p   パス検索の結果を表示する\n"
+#~ "  i   入力ファイルの変化を表示する\n"
+#~ "  V   上記すべての FLAG の短縮形\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to <bug-m4@gnu.org>.\n"
+#~ msgstr ""
+#~ "\n"
+#~ "バグを発見したら <bug-m4@gnu.org> に報告して下さい。\n"
+#~ "翻訳に関するバグは<translation-team-ja@lists.sourceforge.net>に報告してく"
+#~ "ださい。\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "エラー: 検索ディレクトリ `%s' の追加に失敗しました"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "エラー: 検索ディレクトリ `%s' の追加に失敗しました: %s"
+
+#~ msgid " (options:"
+#~ msgstr " (オプション:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "内部エラー:オプションの後処理で、不正コードが検出されました。"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "内部エラー:関数 expand_token () 内のトークンの種類が不正です。"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "内部エラー:関数 expand_argument () のトークンの種類が不正です。"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "内部エラー:関数 call_macro () 内のシンボルの種類が不正です。"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ERROR: モジュールの初期化に失敗しました: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ERROR: モジュールが見つかりません: `%s'"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ERROR: モジュールが見つかりません: `%s': %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ERROR: モジュールを閉じることが出来ません"
+
+#, c-format
+#~ msgid "ERROR: cannot close module: `%s'"
+#~ msgstr "ERROR: モジュールを閉じることができません: `%s'"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "`%s' というディレクトリから `%s' というファイルを見つけました。"
+
+#~ msgid "VMEM limit exceeded?\n"
+#~ msgstr "リソース値 RLIMIT_VMEM を超えていませんか?\n"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "メモリ (セグメンテーション違反) が検出されました。\n"
+#~ "            スタックがオーバーフローしている、あるいはバグが存在する\n"
+#~ "            可能性があります。"
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  無限の再帰呼び出しが行われていないかどうかチェックして下さい。\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "内部エラー: symbol_lookup () に対するモードが不正です"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "`%s' という名前は不明です\n"
+
+#~ msgid "ambiguous argument %s for %s"
+#~ msgstr "%2$s に対する引数 %1$s が曖昧です"
+
+#~ msgid "Valid arguments are:"
+#~ msgstr "有効な引数:"
+
+#~ msgid "ARGP_HELP_FMT: %s value is less than or equal to %s"
+#~ msgstr "ARGP_HELP_FMT: %s の値は %s の値以下です"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter requires a value"
+#~ msgstr "%.*s: ARGP_HELP_FMT パラメータには値が必要です"
+
+#~ msgid "%.*s: ARGP_HELP_FMT parameter must be positive"
+#~ msgstr "%.*s: ARGP_HELP_FMT パラメータは正の値でなければいけません"
+
+#~ msgid "%.*s: Unknown ARGP_HELP_FMT parameter"
+#~ msgstr "%.*s: 不明な ARGP_HELP_FMT パラメータ"
+
+#~ msgid "Garbage in ARGP_HELP_FMT: %s"
+#~ msgstr "ARGP_HELP_FMT 中にごみがあります: %s"
+
+#~ msgid "Usage:"
+#~ msgstr "使用法:"
+
+#~ msgid "  or: "
+#~ msgstr "または: "
+
+#~ msgid " [OPTION...]"
+#~ msgstr " [OPTION...]"
+
+#~ msgid "give this help list"
+#~ msgstr "このヘルプを表示する"
+
+#~ msgid "give a short usage message"
+#~ msgstr "短い使用方法を表示する"
+
+#~ msgid "NAME"
+#~ msgstr "名前"
+
+#~ msgid "set the program name"
+#~ msgstr "プログラム名を設定する"
+
+#~ msgid "SECS"
+#~ msgstr "SECS"
+
+#~ msgid "hang for SECS seconds (default 3600)"
+#~ msgstr "SECS 秒でハング (デフォルト 3600)"
+
+#~ msgid "print program version"
+#~ msgstr "プログラムのバージョンを表示する"
+
+#~ msgid "(PROGRAM ERROR) No version known!?"
+#~ msgstr "(プログラムエラー) 不明なバージョン!?"
+
+#~ msgid "%s: Too many arguments\n"
+#~ msgstr "%s: 引数が多すぎます\n"
+
+#~ msgid "(PROGRAM ERROR) Option should have been recognized!?"
+#~ msgstr "(プログラムエラー) オプションは認識されているべきです!?"
+
+#~ msgid "preserving permissions for %s"
+#~ msgstr "%s のパーミッションを保存しています"
+
+#~ msgid "error while opening \"%s\" for reading"
+#~ msgstr "\"%s\"を読込むため開いている際にエラーが発生しました"
+
+#~ msgid "cannot open backup file \"%s\" for writing"
+#~ msgstr "書込み用バックアップファイル\"%s\"を開くことができません"
+
+#~ msgid "error after reading \"%s\""
+#~ msgstr "\"%s\"の読込み後にエラーが発生しました"
+
+#~ msgid "fdopen() failed"
+#~ msgstr "fdopen()に失敗しました"
+
+#~ msgid "C# compiler not found, try installing pnet"
+#~ msgstr "C# コンパイラが見つりません。pnet をインストールしてみてください"
+
+#~ msgid "C# virtual machine not found, try installing pnet"
+#~ msgstr "C# 仮想マシンが見つかりません。pnet をインストールしてみてください"
+
+#~ msgid "regular empty file"
+#~ msgstr "通常の空ファイル"
+
+#~ msgid "regular file"
+#~ msgstr "通常ファイル"
+
+#~ msgid "directory"
+#~ msgstr "ディレクトリ"
+
+#~ msgid "block special file"
+#~ msgstr "ブロックスペシャルファイル"
+
+#~ msgid "character special file"
+#~ msgstr "キャラクタスペシャルファイル"
+
+#~ msgid "fifo"
+#~ msgstr "fifo"
+
+#~ msgid "symbolic link"
+#~ msgstr "シンボリックリンク"
+
+#~ msgid "socket"
+#~ msgstr "ソケット"
+
+#~ msgid "message queue"
+#~ msgstr "メッセージキュー"
+
+#~ msgid "semaphore"
+#~ msgstr "セマフォ"
+
+#~ msgid "shared memory object"
+#~ msgstr "共有メモリオブジェクト"
+
+#~ msgid "typed memory object"
+#~ msgstr "型付メモリオブジェクト"
+
+#~ msgid "weird file"
+#~ msgstr "不明なファイル"
+
+#~ msgid "Address family for hostname not supported"
+#~ msgstr "ホスト名に対する Address family がサポートされていません"
+
+#~ msgid "Temporary failure in name resolution"
+#~ msgstr "名前解決に一時的に失敗しました"
+
+#~ msgid "Bad value for ai_flags"
+#~ msgstr "ai_flags に対する誤った値です"
+
+#~ msgid "Non-recoverable failure in name resolution"
+#~ msgstr "名前解決でリカバリできない失敗が発生しました"
+
+#~ msgid "ai_family not supported"
+#~ msgstr "ai_family はサポートされていません"
+
+#~ msgid "Memory allocation failure"
+#~ msgstr "メモリ配置に失敗しました"
+
+#~ msgid "No address associated with hostname"
+#~ msgstr "ホスト名にアドレスが割り当てられていません"
+
+#~ msgid "Servname not supported for ai_socktype"
+#~ msgstr "ai_socktype に対して Servname がサポートされていません"
+
+#~ msgid "ai_socktype not supported"
+#~ msgstr "ai_socktype はサポートされていません"
+
+#~ msgid "System error"
+#~ msgstr "システムエラー"
+
+#~ msgid "Argument buffer too small"
+#~ msgstr "引数バッファが小さすぎます"
+
+#~ msgid "Processing request in progress"
+#~ msgstr "要求された処理は実行中です"
+
+#~ msgid "Request canceled"
+#~ msgstr "要求がキャンセルされました"
+
+#~ msgid "Request not canceled"
+#~ msgstr "要求がキャンセルされませんでした"
+
+#~ msgid "All requests done"
+#~ msgstr "すべての要求が完了しました"
+
+#~ msgid "Interrupted by a signal"
+#~ msgstr "シグナル割り込みが発生しました"
+
+#~ msgid "Parameter string not correctly encoded"
+#~ msgstr "パラメーター文字列が正しくエンコードされていません"
+
+#~ msgid "Unknown error"
+#~ msgstr "不明なエラー"
+
+#~ msgid "invalid source_version argument to compile_java_class"
+#~ msgstr "compile_java_class への source_version 引数が無効です"
+
+#~ msgid "invalid target_version argument to compile_java_class"
+#~ msgstr "compile_java_class への target_version 引数が無効です"
+
+#~ msgid "error while writing \"%s\" file"
+#~ msgstr "\"%s\" ファイルの書き込み中にエラーが発生しました"
+
+#~ msgid "Java compiler not found, try installing gcj or set $JAVAC"
+#~ msgstr ""
+#~ "Java コンパイラが見つかりません。 gcj をインストールするか、またはt "
+#~ "$JAVAC を設定してみてください"
+
+#~ msgid "Java virtual machine not found, try installing gij or set $JAVA"
+#~ msgstr ""
+#~ "Java 仮想マシンが見つかりません。 gij をインストールするか、または $JAVA "
+#~ "を設定してみてください"
+
+#~ msgid "%s subprocess I/O error"
+#~ msgstr "%s サブプロセス I/O エラー"
+
+#~ msgid "cannot change permissions of %s"
+#~ msgstr "%s のパーミッションを変更できません"
+
+#~ msgid "cannot create directory %s"
+#~ msgstr "ディレクトリ %s を作成できません"
+
+#~ msgid "Failed to open /dev/zero for read"
+#~ msgstr "/dev/zeroを読込み用に開けません"
+
+#~ msgid "creation of reading thread failed"
+#~ msgstr "読み込みスレッドの作成に失敗しました"
+
+#~ msgid "cannot set up nonblocking I/O to %s subprocess"
+#~ msgstr "%s 子プロセスへ非ブロック I/O を設定できません"
+
+#~ msgid "communication with %s subprocess failed"
+#~ msgstr "%s 子プロセスとの通信に失敗しました"
+
+#~ msgid "write to %s subprocess failed"
+#~ msgstr "%s 子プロセスへの書き込みに失敗しました"
+
+#~ msgid "read from %s subprocess failed"
+#~ msgstr "%s 子プロセスからの読み込みに失敗しました"
+
+#~ msgid "subprocess %s terminated with exit code %d"
+#~ msgstr "子プロセス %s が終了コード %d で終了しました"
+
+#~ msgid "creation of threads failed"
+#~ msgstr "スレッドの作成に失敗しました"
+
+#~ msgid "%s subprocess terminated with exit code %d"
+#~ msgstr "%s 子プロセスが終了コード %d で終了しました"
+
+#~ msgid "^[yY]"
+#~ msgstr "^[yY]"
+
+#~ msgid "^[nN]"
+#~ msgstr "^[nN]"
+
+#~ msgid "setting permissions for %s"
+#~ msgstr "%s のパーミッションを設定します"
+
+#~ msgid "error writing to a closed pipe or socket"
+#~ msgstr "閉じたパイプまたはソケットへの書き込みでエラーが発生しました"
+
+#~ msgid "iconv function not usable"
+#~ msgstr "iconv 関数が使えません"
+
+#~ msgid "iconv function not available"
+#~ msgstr "iconv 関数が有効ではありません"
+
+#~ msgid "character out of range"
+#~ msgstr "範囲外の文字"
+
+#~ msgid "cannot convert U+%04X to local character set"
+#~ msgstr "U+%04X をローカル文字セットに変換できません"
+
+#~ msgid "cannot convert U+%04X to local character set: %s"
+#~ msgstr "U+%04X をローカル文字セット %s に変換できません"
+
+#~ msgid "invalid user"
+#~ msgstr "無効なユーザ"
+
+#~ msgid "invalid group"
+#~ msgstr "無効なグループ"
+
+#~ msgid "invalid spec"
+#~ msgstr "無効な指定"
+
+#~ msgid "%s home page: <http://www.gnu.org/software/%s/>\n"
+#~ msgstr "%s のホームページ: <http://www.gnu.org/software/%s/>\n"
+
+#~ msgid "stdin"
+#~ msgstr "標準入力"
+
+#~ msgid "stdout"
+#~ msgstr "標準出力"
+
+#~ msgid "unknown stream"
+#~ msgstr "不明なストリーム"
+
+#~ msgid "failed to reopen %s with mode %s"
+#~ msgstr "%s をモード %s で再度開くことに失敗しました"
+
+#~ msgid "string comparison failed"
+#~ msgstr "文字列の比較に失敗しました"
+
+#~ msgid "Set LC_ALL='C' to work around the problem."
+#~ msgstr "問題を回避するために LC_ALL='C' を指定してください."
+
+#~ msgid "The strings compared were %s and %s."
+#~ msgstr "比較した文字列は %s と %s です."
+
+#~ msgid "invalid %s%s argument `%s'"
+#~ msgstr "引数 `%3$s' に対して %1$s%2$s が無効です"
+
+#~ msgid "invalid suffix in %s%s argument `%s'"
+#~ msgstr "引数 `%3$s' に対して無効な接尾辞 %1$s%2$s です"
+
+#~ msgid "%s%s argument `%s' too large"
+#~ msgstr "引数 `%3$s' に対する %1$s%2$s が大きすぎます"
+
+#~ msgid "block size"
+#~ msgstr "ブロックサイズ"
+
+#~ msgid "%s exists but is not a directory"
+#~ msgstr "%s は存在しますがディレクトリではありません"
+
+#~ msgid "cannot change owner and/or group of %s"
+#~ msgstr "%s のオーナーとグループを変更できません"
+
+#~ msgid "cannot chdir to directory %s"
+#~ msgstr "ディレクトリ %s に移動できません"
+
+#~ msgid "cannot get the login group of a numeric UID"
+#~ msgstr "数字のUIDのログイングループを取得できません"
+
+#~ msgid ""
+#~ "\n"
+#~ "This is free software.  You may redistribute copies of it under the terms "
+#~ "of\n"
+#~ "the GNU General Public License <http://www.gnu.org/licenses/gpl.html>.\n"
+#~ "There is NO WARRANTY, to the extent permitted by law.\n"
+#~ "\n"
+#~ msgstr ""
+#~ "\n"
+#~ "本プログラムはフリーソフトウェアです. GNU一般公有使用許諾\n"
+#~ "<http://www.gnu.org/licenses/gpl.html> で定められた条項の下で本プログラ\n"
+#~ "ムのコピーを再配布できます. 適切な法が認る限りにおいて全くの無保証です.\n"
+#~ "\n"
diff --git a/po/ko.gmo b/po/ko.gmo
new file mode 100644 (file)
index 0000000..18f5fac
Binary files /dev/null and b/po/ko.gmo differ
diff --git a/po/ko.po b/po/ko.po
new file mode 100644 (file)
index 0000000..3547a93
--- /dev/null
+++ b/po/ko.po
@@ -0,0 +1,1098 @@
+# Korean translation of the GNU m4 package.
+# Copyright (C) 2021 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Seong-ho Cho <darkcircle.0426@gmail.com>, 2021.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU m4 1.4.18d\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2021-05-14 15:42+0900\n"
+"Last-Translator: Seong-ho Cho <darkcircle.0426@gmail.com>\n"
+"Language-Team: Korean <translation-team-ko@googlegroups.com>\n"
+"Language: ko\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"X-Generator: Poedit 2.2.1\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr "임시 디렉터리를 찾을 수 없습니다. $TMPDIR 변수를 설정해보십시오"
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr "\"%s\" 양식으로 임시 디렉터리를 만들 수 없습니다"
+
+#: lib/clean-temp.c:371
+#, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "%s 임시 디렉터리를 제거할 수 없습니다"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr "파일 닫는 중 오류"
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr "쓰기 오류"
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr "프로그램 오류"
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr "스택 넘침"
+
+#: lib/clean-temp-simple.c:297
+#, c-format
+msgid "cannot remove temporary file %s"
+msgstr "%s 임시 파일을 제거할 수 없습니다"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr "알 수 없는 시스템 오류"
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr "%s 하위 프로세스 처리 실패"
+
+#: lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: '%s%s' 옵션이 모호합니다\n"
+
+#: lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: '%s%s' 옵션이 모호합니다. 가능한 옵션:"
+
+#: lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: 인식할 수 없는 '%s%s' 옵션\n"
+
+#: lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: '%s%s' 옵션은 인자를 허용하지 않습니다\n"
+
+#: lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: '%s%s' 옵션에 인자가 필요합니다\n"
+
+#: lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: 부적절한 옵션 -- '%c'\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: 옵션에 인자가 필요합니다 -- '%c'\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "메모리가 바닥남"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "현재 작업 디렉터리를 기록할 수 없습니다"
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "초기 작업 디렉터리로 되돌아갈 수 없습니다"
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr "_open_osfhandle 실패"
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr "파일 서술자 %d번을 복원할 수 없음: dup2 실패"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr "`"
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr "'"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "성공"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "일치하지 않음"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "부적절한 정규 표현식"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "부적절한 조합 문자"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "부적절한 문자 클래스 이름"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "백 슬래시 문자가 따라옴"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "잘못된 후위 참조"
+
+#: lib/regcomp.c:156
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "일치하지 않는 [, [^, [:, [., [="
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "일치하지 않는 ( 또는 \\( 괄호"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "일치하지 않는 \\{ 괄호"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "부적절한 \\{\\} 내용"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "부적절한 범위 끝"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "메모리가 바닥남"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "부적절한 선행 정규 표현식"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "정규 표현식 마감 표현이 앞서있습니다"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "정규 표현식이 너무 깁니다"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "일치하지 않는 ) 또는 \\) 괄호"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "이전 정규 표현식이 없습니다"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr "끊어짐"
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr "인터럽트"
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr "나감"
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr "잘못된 인스트럭션"
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr "추적/중단점 트랩"
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr "중지함"
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr "부동 소숫점 예외"
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr "강제 종료함"
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr "버스 오류"
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr "세그먼테이션 오류"
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr "파이프 깨짐"
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr "알림 시계"
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr "중단함"
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr "긴급 입출력 상태"
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr "중단함 (시그널)"
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr "중단함"
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr "계속함"
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr "하위 프로세스 나감"
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr "중단함 (tty 입력)"
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr "중단함 (tty 출력)"
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr "입출력 가능"
+
+#: lib/siglist.h:94
+msgid "CPU time limit exceeded"
+msgstr "CPU 시간 제한 초과"
+
+#: lib/siglist.h:97
+msgid "File size limit exceeded"
+msgstr "파일 크기 제한 초과"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr "가상 타이머 초과"
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr "프로파일 타이머 초과"
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr "윈도우 전환함"
+
+#: lib/siglist.h:109
+msgid "User defined signal 1"
+msgstr "사용자 지정 시그널 1"
+
+#: lib/siglist.h:112
+msgid "User defined signal 2"
+msgstr "사용자 지정 시그널 2"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr "EMT 트랩"
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr "잘못된 시스템 호출"
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr "스택 실패"
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr "정보 요청"
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr "전원 고장"
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr "자원 분실"
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr "파이프를 만들 수 없습니다"
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr "실시간 시그널 %d"
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr "알 수 없는 시그널 %d"
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "오류 메시지를 표시할 수 없습니다"
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "%s(%s)(으)로 패키지 구성함\n"
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "%s(으)로 패키지 구성함\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr "(C)"
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+"GPLv3+ 라이선스: GNU GPL 버전 3 이상 <%s>.\n"
+"이 프로그램은 자유 소프트웨어입니다: 자유롭게 바꾸고 재배포할 수 있습니다.\n"
+"법률이 허용하는 모든 범위내의 보증은 없습니다.\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr "%s이(가) 작성함.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "%s, %s이(가) 작성함.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "%s, %s, %s이(가) 작성함.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"%s, %s, %s,\n"
+"%s이(가) 작성함.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"%s, %s, %s, %s,\n"
+"%s이(가) 작성함.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"%s, %s, %s, %s,\n"
+"%s, %s이(가) 작성함.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"%s, %s, %s, %s,\n"
+"%s, %s, %s이(가)\n"
+"작성함.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"%s, %s,%s, %s,\n"
+"%s, %s, %s, %s\n"
+"이(가) 작성함.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"%s, %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s이(가) 작성함.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"%s, %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s 등이 작성함.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, c-format
+msgid "Report bugs to: %s\n"
+msgstr "버그 보고 주소: %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "%s 버그 보고 주소: %s\n"
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s 홈페이지: <%s>\n"
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr "GNU 소프트웨어 활용 일반 도움말: <%s>\n"
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr "%s 하위 프로세스"
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr "%s 하위 프로세스에 치명적인 시그널 %d번이 나타났습니다"
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr "포매팅 출력을 수행할 수 없습니다"
+
+#: src/builtin.c:264
+#, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "--warn-macro-sequence: 잘못된 정규 표현식 `%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr "경고: `%s' 정의에 `%s' 시퀀스가 있습니다"
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr "`%s' 매크로의 --warn-macro-sequence 검사 중 오류"
+
+#: src/builtin.c:388
+#, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "경고: `%s' 내장 요소의 인자가 너무 적습니다"
+
+#: src/builtin.c:394
+#, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "경고: `%s' 내장요소의 갯수 초과 인자를 무시했습니다"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr "`%s' 내장 요소의 빈 문자열을 0값으로 취급합니다"
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "`%s' 내장 요소에 비 숫자 인자값이 있습니다"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr "`%s' 내장 요소에 뒤따라오는 공백 문자를 무시했습니다"
+
+#: src/builtin.c:435
+#, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "`%s' 내장 요소에 숫자값 넘침을 감지했습니다"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr "경고: %s: 부적절한 매크로 이름을 무시했습니다"
+
+#: src/builtin.c:752 src/builtin.c:864
+#, c-format
+msgid "undefined macro `%s'"
+msgstr "정의하지 않은 매크로 `%s'"
+
+#: src/builtin.c:823
+#, c-format
+msgid "undefined builtin `%s'"
+msgstr "정의하지 않은 내장요소 `%s'"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr "`%s' 내장 요소를 지원하지 않는 프리징 파일에서 요청했습니다"
+
+#: src/builtin.c:918
+#, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "경고: `%s' 내장요소를 결합할 수 없습니다"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, c-format
+msgid "cannot run command `%s'"
+msgstr "`%s' 명령을 실행할 수 없습니다"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr "파이프를 읽을 수 없습니다"
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr "`%2$s' 내장 요소의 기수 %1$d 번이 범위를 벗어났습니다"
+
+#: src/builtin.c:1108
+#, c-format
+msgid "negative width to builtin `%s'"
+msgstr "`%s' 내장 요소에 음수 너비 값"
+
+#: src/builtin.c:1252
+#, c-format
+msgid "error undiverting `%s'"
+msgstr "`%s' 우회 취소 오류"
+
+#: src/builtin.c:1256
+#, c-format
+msgid "cannot undivert `%s'"
+msgstr "`%s'을(를) 우회 취소할 수 없습니다"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, c-format
+msgid "cannot open `%s'"
+msgstr "`%s'을(를) 열 수 없습니다"
+
+#: src/builtin.c:1429
+#, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "%s: `%s' 임시 파일을 만들 수 없습니다"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr "대신 mkstamp 활용을 추천합니다"
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr "종료 코드 상태 값이 범위를 벗어났습니다: `%d'"
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "디버깅모드: 잘못된 디버깅 플래그: `%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, c-format
+msgid "cannot set debug file `%s'"
+msgstr "`%s' 디버깅 파일을 지정할 수 없습니다"
+
+#: src/builtin.c:1988
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "경고: \\0를 없앱니다, 대용으로 \\&를 대신 활용하십시오"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr "경고: %d 하위 표현식이 없습니다"
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr "경고: 뒤따라오는 문자를 \\ 대체 요소에서 무시했습니다"
+
+#: src/builtin.c:2079
+#, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "잘못된 정규 표현식: `%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, c-format
+msgid "error matching regular expression `%s'"
+msgstr "`%s' 정규 표현식 일치 오류"
+
+#: src/builtin.c:2139 src/input.c:792
+#, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "잘못된 정규 표현식 `%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr "디버깅 스트림 기록 오류"
+
+#: src/eval.c:318
+#, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "수식에 잘못된 표현식 (우측 괄호 빠짐): %s"
+
+#: src/eval.c:324
+#, c-format
+msgid "bad expression in eval: %s"
+msgstr "수식에 잘못된 표현식: %s"
+
+#: src/eval.c:329
+#, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "수식에 잘못된 표현식 (잘못된 입력): %s"
+
+#: src/eval.c:334
+#, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "수식에 잘못된 표현식 (입력양 초과): %s"
+
+#: src/eval.c:339
+#, c-format
+msgid "invalid operator in eval: %s"
+msgstr "수식에 부적절한 연산자: %s"
+
+#: src/eval.c:345
+#, c-format
+msgid "divide by zero in eval: %s"
+msgstr "수식에서 0 나누기 오류: %s"
+
+#: src/eval.c:350
+#, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "수식에 0 나누기 나머지 오류: %s"
+
+#: src/eval.c:355
+#, c-format
+msgid "negative exponent in eval: %s"
+msgstr "수식에 음수 지수: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr "경고: 등호 연산자에 = 이 아닌 == 을 추천합니다"
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr "빈 문자열을 0 값으로 취급합니다"
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, c-format
+msgid "non-numeric argument %s"
+msgstr "비 숫자 인자값 %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr "뒤 따라오는 공백문자 무시"
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr "숫자값 넘침을 발견했습니다"
+
+#: src/format.c:308
+#, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "경고: `%s'에서 인식하지 못한 지정자"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr "프리징 상태를 만들 수 없습니다"
+
+#: src/freeze.c:167
+msgid "expecting line feed in frozen file"
+msgstr "프리징 파일에 라인 피드가 필요합니다"
+
+#: src/freeze.c:169
+#, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "프리징 파일에 `%c' 문자가 필요합니다"
+
+#: src/freeze.c:215
+msgid "integer overflow in frozen file"
+msgstr "프리징 파일에 정수 넘침"
+
+#: src/freeze.c:257
+msgid "premature end of frozen file"
+msgstr "프리징 파일이 너무 빨리 끝났습니다"
+
+#: src/freeze.c:270
+#, c-format
+msgid "cannot open %s"
+msgstr "%s을(를) 열 수 없습니다"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr "프리징 파일 버전 %d번이 지원 버전 1보다 큽니다"
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr "잘못 구성한 프리징 파일. 버전 지시문이 필요합니다"
+
+#: src/freeze.c:297
+msgid "ill-formed frozen file"
+msgstr "잘못 구성한 프리징 파일"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr "프리징 상태를 읽을 수 없습니다"
+
+#: src/input.c:359
+msgid "read error"
+msgstr "읽기 오류"
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr "파일 읽는 중 오류"
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr "경고: 파일 끝을 개행 문자로 처리합니다"
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr "오류: 설명에 파일 끝 문자"
+
+#: src/input.c:1001
+msgid "ERROR: end of file in string"
+msgstr "오류: 문자열에 파일 끝 문자"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr "Rene' Seindal"
+
+#: src/m4.c:207
+#, c-format
+msgid "Try `%s --help' for more information."
+msgstr "자세한 정보는 `%s --help'를 입력하십시오."
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "사용법: %s [<옵션>]... [<파일>]...\n"
+
+#: src/m4.c:214
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"<파일>에 매크로를 처리합니다.  <파일>이 없거나 <파일>이 `-' 값이면\n"
+"표준 입력을 읽습니다.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+"긴 옵션의 필수 또는 선택 인자 값은 관련 단축 옵션에 대해서도\n"
+"필수 또는 선택입니다.\n"
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+"처리 모드:\n"
+"      --help                   이 도움말을 표시하고 나갑니다\n"
+"      --version                버전 정보를 출력하고 나갑니다\n"
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+"  -E, --fatal-warnings         한번: 오류에 대해 경고, 두번: 처음\n"
+"                                 오류가 발생하면 실행 중단\n"
+"  -i, --interactive            언버퍼 출력, 인터럽트 무시\n"
+"  -P, --prefix-builtins        모든 내장 요소에 대해 `m4_' 접두어 강제\n"
+"  -Q, --quiet, --silent        내장 요소에 대한 일부 경고 메시지를 숨깁니다\n"
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+"      --warn-macro-sequence[=<정규식>]\n"
+"                               매크로 정의가 <정규식>과 일치하면 경고.\n"
+"                                 기본값: %s\n"
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr "  -W, --word-regexp=<정규식>     매크로 이름 문법에 <정규식> 활용\n"
+
+#: src/m4.c:247
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"전처리 기능:\n"
+"  -D, --define=<이름>[=<값>]   <값>을 가진 <이름>을 지정하거나 값을 비워둡니"
+"다\n"
+"  -I, --include=<디렉터리>     경로를 넣은 <디렉터리>를 추가합니다\n"
+"  -s, --synclines              `#line <숫자> \"<파일>\"' 행 추가\n"
+"  -U, --undefine=<이름>        <이름> 정의 해제\n"
+
+#: src/m4.c:255
+#, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"한계 제어:\n"
+"  -g, --gnu                    -G 대신 적용하여 GNU 확장을 재적용\n"
+"  -G, --traditional            모든 GNU 확장을 숨깁니다\n"
+"  -H, --hashsize=<소수>        심볼 탐색 해시 테이블 크기 설정 [509]\n"
+"  -L, --nesting-limit=<숫자>   중첩 한계를 바꿉니다. 0 값은 무제한을 의미 "
+"[%d]\n"
+
+#: src/m4.c:263
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"프리징 상태 파일:\n"
+"  -F, --freeze-state=<파일>      <파일> 마지막 부분에 프리징 상태를 만들어"
+"냄\n"
+"  -R, --reload-state=<파일>      <파일> 시작 부분에 프리징 상태를 다시 불러"
+"옴\n"
+
+#: src/m4.c:269
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"디버깅:\n"
+"  -d, --debug[=<플래그>]          디버깅 수준 설정 (<플래그>가 겂다면  `aeq' "
+"생략)\n"
+"      --debugfile[=<파일>]       디버깅 및 추적 정보 출력을 <파일>로 내보냅니"
+"다\n"
+"                                 (기본값: stderr, 빈 문자열이면 무시)\n"
+"  -l, --arglength=<숫자>          매크로 추적 크기 제한\n"
+"  -t, --trace=<이름>             <이름>을 지정하면 해당 이름을 추적\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr "<플래그>는 다음 중 하나입니다\n"
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+"  l   현재 입력 행 번호 출력\n"
+"  p   경로 검색 결과 표시\n"
+"  q   필요할 경우 값에 e 플래그를 붙여 따옴표 표시\n"
+"  t   traceon 상태 뿐만 아닌 모든 매크로 호출 추적\n"
+"  x   c 플래그를 붙여 단일 매크로 호출 ID 추가\n"
+"  V   위 모든 플래그를 짧게 줄임\n"
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+"지정했을 경우, `M4PATH' 환경 변수는 `-I'로 지정한 값 다음에 붙을 콜론 분리 \n"
+"디렉터리 목록 입니다.\n"
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+"종료 상태 코드 0은 성공, 1은 실패, 63은 프리징 파일 버전 불일치, 그리고 기타 "
+"코드는 m4exit 매크로에 전달한 값입니다.\n"
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr "내부 에러 발견. <%s>에 버그를 보고하십시오"
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr "경고: `m4 -%c' 옵션은 다음 릴리스에서 제거 예정입니다"
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr "경고: `m4 %s' 옵션이 오래됐습니다"
+
+#: src/m4.c:572
+#, c-format
+msgid "bad debug flags: `%s'"
+msgstr "잘못된 디버깅 플래그: `%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr "경고: `m4 -e' 옵션이 오래되었으니 `-i'를 대신 사용하십시오"
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr "stderr"
+
+#: src/macro.c:196
+msgid "ERROR: end of file in argument list"
+msgstr "오류: 인자 목록에 파일 끝 문자"
+
+#: src/macro.c:332
+#, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "재귀 한계 단계 %d 번 초과. 바꾸려면 -L<N> 옵션을 사용하십시오"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+msgid "cannot clean temporary file for diversion"
+msgstr "우회 임시 파일을 지울 수 없습니다"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+msgid "cannot create temporary file for diversion"
+msgstr "우회 임시 파일을 만들 수 없습니다"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+msgid "cannot seek within diversion"
+msgstr "우회 값 범위를 탐색할 수 없습니다"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+msgid "cannot close temporary file for diversion"
+msgstr "우회용 임시 파일을 닫을 수 없습니다"
+
+#: src/output.c:474
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "오류: 임시 파일에 우회 값을 플러싱할 수 없습니다"
+
+#: src/output.c:568
+msgid "ERROR: copying inserted file"
+msgstr "오류: 추가 파일 복사 중"
+
+#: src/output.c:816
+msgid "error reading inserted file"
+msgstr "추가 파일 읽기 오류"
+
+#: src/output.c:983
+msgid "cannot stat diversion"
+msgstr "우회 상태 정보를 가져올 수 없습니다"
+
+#: src/output.c:987
+msgid "diversion too large"
+msgstr "우회 값이 너무 큽니다"
diff --git a/po/m4.pot b/po/m4.pot
new file mode 100644 (file)
index 0000000..32da9c6
--- /dev/null
+++ b/po/m4.pot
@@ -0,0 +1,1025 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR Free Software Foundation, Inc.
+# This file is distributed under the same license as the GNU m4 package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU m4 1.4.19\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, c-format
+msgid "cannot remove temporary directory %s"
+msgstr ""
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, c-format
+msgid "cannot remove temporary file %s"
+msgstr ""
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr ""
+
+#: lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr ""
+
+#: lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr ""
+
+#: lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr ""
+
+#: lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr ""
+
+#: lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr ""
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr ""
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr ""
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr ""
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr ""
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr ""
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr ""
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr ""
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr ""
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr ""
+
+#: lib/regcomp.c:156
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr ""
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr ""
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr ""
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr ""
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr ""
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr ""
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr ""
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr ""
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr ""
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ""
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr ""
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+msgid "CPU time limit exceeded"
+msgstr ""
+
+#: lib/siglist.h:97
+msgid "File size limit exceeded"
+msgstr ""
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+msgid "User defined signal 1"
+msgstr ""
+
+#: lib/siglist.h:112
+msgid "User defined signal 2"
+msgstr ""
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr ""
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:394
+#, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr ""
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, c-format
+msgid "undefined macro `%s'"
+msgstr ""
+
+#: src/builtin.c:823
+#, c-format
+msgid "undefined builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, c-format
+msgid "cannot run command `%s'"
+msgstr ""
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, c-format
+msgid "negative width to builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:1252
+#, c-format
+msgid "error undiverting `%s'"
+msgstr ""
+
+#: src/builtin.c:1256
+#, c-format
+msgid "cannot undivert `%s'"
+msgstr ""
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, c-format
+msgid "cannot open `%s'"
+msgstr ""
+
+#: src/builtin.c:1429
+#, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr ""
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr ""
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, c-format
+msgid "cannot set debug file `%s'"
+msgstr ""
+
+#: src/builtin.c:1988
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr ""
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr ""
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, c-format
+msgid "error matching regular expression `%s'"
+msgstr ""
+
+#: src/builtin.c:2139 src/input.c:792
+#, c-format
+msgid "bad regular expression `%s': %s"
+msgstr ""
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr ""
+
+#: src/eval.c:324
+#, c-format
+msgid "bad expression in eval: %s"
+msgstr ""
+
+#: src/eval.c:329
+#, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr ""
+
+#: src/eval.c:334
+#, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr ""
+
+#: src/eval.c:339
+#, c-format
+msgid "invalid operator in eval: %s"
+msgstr ""
+
+#: src/eval.c:345
+#, c-format
+msgid "divide by zero in eval: %s"
+msgstr ""
+
+#: src/eval.c:350
+#, c-format
+msgid "modulo by zero in eval: %s"
+msgstr ""
+
+#: src/eval.c:355
+#, c-format
+msgid "negative exponent in eval: %s"
+msgstr ""
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, c-format
+msgid "non-numeric argument %s"
+msgstr ""
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr ""
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+msgid "expecting line feed in frozen file"
+msgstr ""
+
+#: src/freeze.c:169
+#, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr ""
+
+#: src/freeze.c:215
+msgid "integer overflow in frozen file"
+msgstr ""
+
+#: src/freeze.c:257
+msgid "premature end of frozen file"
+msgstr ""
+
+#: src/freeze.c:270
+#, c-format
+msgid "cannot open %s"
+msgstr ""
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+msgid "ill-formed frozen file"
+msgstr ""
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+msgid "ERROR: end of file in string"
+msgstr ""
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, c-format
+msgid "Try `%s --help' for more information."
+msgstr ""
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr ""
+
+#: src/m4.c:214
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+
+#: src/m4.c:247
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+
+#: src/m4.c:255
+#, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+
+#: src/m4.c:263
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+
+#: src/m4.c:269
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, c-format
+msgid "bad debug flags: `%s'"
+msgstr ""
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+msgid "ERROR: end of file in argument list"
+msgstr ""
+
+#: src/macro.c:332
+#, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+msgid "cannot clean temporary file for diversion"
+msgstr ""
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+msgid "cannot create temporary file for diversion"
+msgstr ""
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+msgid "cannot seek within diversion"
+msgstr ""
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+msgid "cannot close temporary file for diversion"
+msgstr ""
+
+#: src/output.c:474
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr ""
+
+#: src/output.c:568
+msgid "ERROR: copying inserted file"
+msgstr ""
+
+#: src/output.c:816
+msgid "error reading inserted file"
+msgstr ""
+
+#: src/output.c:983
+msgid "cannot stat diversion"
+msgstr ""
+
+#: src/output.c:987
+msgid "diversion too large"
+msgstr ""
diff --git a/po/nl.gmo b/po/nl.gmo
new file mode 100644 (file)
index 0000000..443e39c
Binary files /dev/null and b/po/nl.gmo differ
diff --git a/po/nl.po b/po/nl.po
new file mode 100644 (file)
index 0000000..82a5007
--- /dev/null
+++ b/po/nl.po
@@ -0,0 +1,1245 @@
+# Dutch translations for GNU m4.
+# Copyright (C) 2021 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+#
+# « On ne peut pas avoir et le beurre, et l'argent du beurre,
+# et le sourire de la crémière. »
+#
+# Tijs van Bakel <smoke@casema.net>, 2000.
+# Benno Schulenberg <vertaling@coevern.nl> 2007, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4.18d\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2021-05-17 15:52+0200\n"
+"Last-Translator: Benno Schulenberg <vertaling@coevern.nl>\n"
+"Language-Team: Dutch <vertaling@vrijschrift.org>\n"
+"Language: nl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr "kan geen tijdelijke map vinden; zet $TMPDIR"
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr "kan met sjabloon '%s' geen tijdelijke map aanmaken"
+
+#: lib/clean-temp.c:371
+#, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "kan tijdelijke map '%s' niet verwijderen"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr "fout bij sluiten van bestand"
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr "schrijffout"
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr "programmafout"
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr "stack-overloop"
+
+#: lib/clean-temp-simple.c:297
+#, c-format
+msgid "cannot remove temporary file %s"
+msgstr "kan tijdelijk bestand %s niet verwijderen"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr "Onbekende systeemfout"
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr "subproces %s is mislukt"
+
+#: lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: optie '%s%s' is niet eenduidig\n"
+
+#: lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: optie '%s%s' is niet eenduidig; mogelijkheden zijn:"
+
+#: lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: onbekende optie '%s%s'\n"
+
+#: lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: optie '%s%s' staat geen argument toe\n"
+
+#: lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: optie '%s%s' vereist een argument\n"
+
+#: lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ongeldige optie -- '%c'\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: optie vereist een argument -- '%c'\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "onvoldoende geheugen beschikbaar"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "kan de huidige werkmap niet vastleggen"
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "kan niet terugkeren naar de oorspronkelijke werkmap"
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr "_open_osfhandle() is mislukt"
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr "kan bestandsdescriptor %d niet herstellen: dup2() is mislukt"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr "‘"
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr "’"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Gelukt"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Geen overeenkomsten"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ongeldige reguliere expressie"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ongeldig samengesteld teken"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Ongeldige tekenklassenaam"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Backslash aan het eind"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Ongeldige terugverwijzing"
+
+#: lib/regcomp.c:156
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Ongepaarde [, [^, [:, [., of [="
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Ongepaarde ( of \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Ongepaarde \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Ongeldige inhoud van \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Ongeldig bereikeinde"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Onvoldoende geheugen beschikbaar"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Ongeldige voorafgaande reguliere expressie"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Voortijdig einde van reguliere expressie"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Reguliere expressie is te groot"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Ongepaarde ) of \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Geen eerdere reguliere expressie"
+
+# Vroeger ging dit over het afsluiten van een modemverbinding,
+# tegenwoordig over het afsluiten van een pseudoterminal.
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr "Opgehangen"
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr "Onderbroken"
+
+# Verleden tijd, "Afgesloten", net als de andere actiesignaalnamen.
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr "Afgesloten"
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr "Ongeldige instructie"
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr "Traceer/breekpunt-instructie"
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr "Afgebroken"
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr "Drijvendekomma-berekeningsfout"
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr "Geëlimineerd"
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr "Busfout"
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr "Segmentatiefout"
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr "Gebroken pijp"
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr "Timersignaal"
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr "Beëindigd"
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr "Urgente in-/uitvoertoestand"
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr "Gepauzeerd (signaal)"
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr "Gepauzeerd"
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr "Doorgegaan"
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr "Dochter is afgesloten"
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr "Gepauzeerd (terminalinvoer)"
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr "Gepauzeerd (terminaluitvoer)"
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr "In-/uitvoer is mogelijk"
+
+#: lib/siglist.h:94
+msgid "CPU time limit exceeded"
+msgstr "Limiet op processortijd is overschreden"
+
+#: lib/siglist.h:97
+msgid "File size limit exceeded"
+msgstr "Limiet op bestandsgrootte is overschreden"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr "Virtuele timer is verlopen"
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr "Timer voor analyse is verlopen"
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr "Venster is veranderd"
+
+#: lib/siglist.h:109
+msgid "User defined signal 1"
+msgstr "Gebruikergedefinieerd signaal 1"
+
+#: lib/siglist.h:112
+msgid "User defined signal 2"
+msgstr "Gebruikergedefinieerd signaal 2"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr "EMT-instructie"
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr "Onjuiste systeemaanroep"
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr "Stack-fout"
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr "Verzoek om informatie"
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr "Stroomstoring"
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr "Hulpbron verloren"
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr "kan geen pijp aanmaken"
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr "Realtime-signaal %d"
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr "Onbekend signaal %d"
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "kan foutmelding niet tonen"
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "In pakketvorm gebracht door %s (%s)\n"
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "In pakketvorm gebracht door %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr "©"
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+"Dit is vrije software: u mag het vrijelijk wijzigen en verder verspreiden.\n"
+"De precieze licentie is GPL-3+: GNU General Public License versie 3 of "
+"later.\n"
+"Zie <%s> voor de volledige (Engelse) tekst.\n"
+"Deze software kent GEEN GARANTIE, voor zover de wet dit toestaat.\n"
+"\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Geschreven door %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Geschreven door %s en %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Geschreven door %s, %s en %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Geschreven door %s, %s, %s\n"
+"en %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Geschreven door %s, %s, %s,\n"
+"%s en %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Geschreven door %s, %s, %s,\n"
+"%s, %s en %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"Geschreven door %s, %s, %s,\n"
+"%s, %s, %s en %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Geschreven door %s, %s, %s,\n"
+"%s, %s, %s, %s\n"
+"en %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Geschreven door %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s en %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"Geschreven door %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s en anderen.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"Rapporteer gebreken in het programma aan %s;\n"
+"meld fouten in de vertaling aan <vertaling@vrijschrift.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+"Rapporteer gebreken in het programma '%s' aan <%s>;\n"
+"meld fouten in de vertaling aan <vertaling@vrijschrift.org>.\n"
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "Webpagina van %s: <%s>\n"
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr "Algemene hulp bij gebruik van GNU-software: <%s>\n"
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr "subproces %s"
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr "subproces %s ontving het fatale signaal %d"
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr "kan geen opgemaakte uitvoer aanmaken"
+
+#: src/builtin.c:264
+#, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "--warn-macro-sequence: foutieve reguliere expressie '%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr "Waarschuwing: definitie van '%s' bevat sequentie '%s'"
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr "fout bij controleren van --warn-macro-sequence voor macro '%s'"
+
+#: src/builtin.c:388
+#, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Waarschuwing: te weinig argumenten voor ingebouwde functie '%s'"
+
+#: src/builtin.c:394
+#, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr ""
+"Waarschuwing: overbodige argumenten voor ingebouwde functie '%s' worden "
+"genegeerd"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr "lege tekenreeks is behandeld als 0 in ingebouwde functie '%s'"
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "niet-numeriek argument van ingebouwde functie '%s'"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr "leidende witruimte wordt genegeerd in ingebouwde functie '%s'"
+
+#: src/builtin.c:435
+#, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "numerieke overloop gedetecteerd in ingebouwde functie '%s'"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr "Waarschuwing: %s: ongeldige macronaam wordt genegeerd"
+
+#: src/builtin.c:752 src/builtin.c:864
+#, c-format
+msgid "undefined macro `%s'"
+msgstr "ongedefinieerde macro '%s'"
+
+#: src/builtin.c:823
+#, c-format
+msgid "undefined builtin `%s'"
+msgstr "ongedefinieerde ingebouwde functie '%s'"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+"ingebouwde functie '%s' (gevraagd door bevroren bestand) wordt niet "
+"ondersteund"
+
+#: src/builtin.c:918
+#, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Waarschuwing: kan ingebouwde functie '%s' niet samenvoegen"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, c-format
+msgid "cannot run command `%s'"
+msgstr "kan opdracht '%s' niet uitvoeren"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr "kan pijp niet lezen"
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr "grondtal %d valt buiten bereik in ingebouwde functie '%s'"
+
+#: src/builtin.c:1108
+#, c-format
+msgid "negative width to builtin `%s'"
+msgstr "negatieve breedte voor ingebouwde functie '%s'"
+
+#: src/builtin.c:1252
+#, c-format
+msgid "error undiverting `%s'"
+msgstr "fout bij terugbuigen van '%s'"
+
+#: src/builtin.c:1256
+#, c-format
+msgid "cannot undivert `%s'"
+msgstr "kan '%s' niet terugbuigen"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, c-format
+msgid "cannot open `%s'"
+msgstr "kan '%s' niet openen"
+
+#: src/builtin.c:1429
+#, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "%s: kan tijdelijk bestand '%s' niet aanmaken"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr "gebruik van 'mkstemp' wordt aangeraden"
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr "afsluitwaarde valt buiten bereik: '%d'"
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Foutieve debug-opties: '%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, c-format
+msgid "cannot set debug file `%s'"
+msgstr "kan debug-bestand '%s' niet instellen"
+
+#: src/builtin.c:1988
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "Waarschuwing: \\0 zal verdwijnen; gebruik liever \\& in vervangingen"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr "Waarschuwing: subexpressie %d bestaat niet"
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr "Waarschuwing: een \\ aan het eind van een vervanging wordt genegeerd"
+
+#: src/builtin.c:2079
+#, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "foutieve reguliere expressie '%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, c-format
+msgid "error matching regular expression `%s'"
+msgstr "fout bij vergelijken van reguliere expressie '%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "foutieve reguliere expressie '%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr "fout bij schrijven naar debug-stroom"
+
+#: src/eval.c:318
+#, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "foutieve expressie in 'eval' (ontbrekend sluithaakje): %s"
+
+#: src/eval.c:324
+#, c-format
+msgid "bad expression in eval: %s"
+msgstr "foutieve expressie in 'eval': %s"
+
+#: src/eval.c:329
+#, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "foutieve expressie in 'eval' (foutieve invoer): %s"
+
+#: src/eval.c:334
+#, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "foutieve expressie in 'eval' (overvloedige invoer): %s"
+
+#: src/eval.c:339
+#, c-format
+msgid "invalid operator in eval: %s"
+msgstr "ongeldige operator in 'eval': %s"
+
+#: src/eval.c:345
+#, c-format
+msgid "divide by zero in eval: %s"
+msgstr "deling door nul in 'eval': %s"
+
+#: src/eval.c:350
+#, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "modulo nul in 'eval': %s"
+
+#: src/eval.c:355
+#, c-format
+msgid "negative exponent in eval: %s"
+msgstr "negatieve exponent in 'eval': %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr "Waarschuwing: als gelijkheidsoperator wordt == aangeraden, niet ="
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr "lege tekenreeks is behandeld als 0"
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, c-format
+msgid "non-numeric argument %s"
+msgstr "niet-numeriek argument %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr "leidende witruimte wordt genegeerd"
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr "numerieke overloop gedetecteerd"
+
+#: src/format.c:308
+#, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "Waarschuwing: onbekende stuurcode in '%s'"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr "kan geen bevroren toestand creëren"
+
+#: src/freeze.c:167
+msgid "expecting line feed in frozen file"
+msgstr "een regeleindeteken werd verwacht in bevroren bestand"
+
+#: src/freeze.c:169
+#, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "teken '%c' werd verwacht in bevroren bestand"
+
+#: src/freeze.c:215
+msgid "integer overflow in frozen file"
+msgstr "geheelgetaloverloop in bevroren bestand"
+
+#: src/freeze.c:257
+msgid "premature end of frozen file"
+msgstr "voortijdig einde van bevroren bestand"
+
+#: src/freeze.c:270
+#, c-format
+msgid "cannot open %s"
+msgstr "kan '%s' niet openen"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+"versienummer %d van bevroren bestand is groter dan wat ondersteund wordt (1)"
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr "foutief gevormd bevroren bestand, versiedirectief werd verwacht"
+
+#: src/freeze.c:297
+msgid "ill-formed frozen file"
+msgstr "foutief gevormd bevroren bestand"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr "kan bevroren toestand niet lezen"
+
+#: src/input.c:359
+msgid "read error"
+msgstr "fout bij lezen"
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr "fout bij lezen van bestand"
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr "Waarschuwing: einde van bestand wordt behandeld as regeleindeteken"
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr "FOUT: bestandseinde in commentaar"
+
+#: src/input.c:1001
+msgid "ERROR: end of file in string"
+msgstr "FOUT: bestandseinde in tekenreeks"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr "René Seindal"
+
+#: src/m4.c:207
+#, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Typ '%s --help' voor meer informatie."
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Gebruik:  %s [OPTIE]... [BESTAND]...\n"
+
+#: src/m4.c:214
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"Macros in bestanden verwerken.  Als er geen BESTAND gegeven is,\n"
+"of als BESTAND '-' is, wordt van standaardinvoer gelezen.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+"Een argument dat verplicht of optioneel is voor een lange optie, is dat\n"
+"ook voor de overeenkomstige korte optie.\n"
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+"Werkingsmodus:\n"
+"      --help                   deze hulptekst tonen en stoppen\n"
+"      --version                versie-informatie tonen en stoppen\n"
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+"  -E, --fatal-warnings         enkele optie: waarschuwingen worden fouten;\n"
+"                                 dubbele optie: stoppen bij de eerste fout\n"
+"  -i, --interactive            uitvoer niet bufferen, interrupts negeren\n"
+"  -P, --prefix-builtins        ingebouwde functies het voorvoegsel 'm4_' "
+"geven\n"
+"  -Q, --quiet, --silent        sommige waarschuwingen voor ingebouwde "
+"functies\n"
+"                                  onderdrukken\n"
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               waarschuwen als macrodefinitie overeenkomt\n"
+"                                 met REGEXP (standaard %s)\n"
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=REGEXP     deze reguliere expressie gebruiken voor\n"
+"                                 de syntax van macronamen\n"
+
+#: src/m4.c:247
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"Voorbewerkingsopties:\n"
+"  -D, --define=NAAM[=WAARDE]   NAAM definiëren (met gegeven beginwaarde)\n"
+"  -I, --include=MAP            ook in deze map naar insluitbestanden zoeken\n"
+"  -s, --synclines              '#line NR \"BESTAND\"'-regels genereren\n"
+"  -U, --undefine=NAAM          ingebouwde functie met deze naam verwijderen\n"
+
+#: src/m4.c:255
+#, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"Begrenzingen:\n"
+"  -g, --gnu                    -G negeren en GNU-uitbreidingen inschakelen\n"
+"  -G, --traditional            alle GNU-uitbreidingen uitschakelen\n"
+"  -H, --hashsize=PRIEM         grootte van hash-tabel voor symbolen  [509]\n"
+"  -L, --nesting-limit=GETAL    te gebruiken nestingsdiepte (0 voor "
+"onbegrensd)  [%d]\n"
+
+#: src/m4.c:263
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"Bevroren toestandsbestanden:\n"
+"  -F, --freeze-state=BESTAND   bij einde bevroren toestand in BESTAND "
+"opslaan\n"
+"  -R, --reload-state=BESTAND   bij begin bevroren toestand uit BESTAND "
+"inlezen\n"
+
+#: src/m4.c:269
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"Debuggen:\n"
+"  -d, --debug[=OPTIES]         debug-niveau (geen OPTIES impliceert 'aeq')\n"
+"      --debugfile[=BESTAND]    debug- en trace-uitvoer omleiden naar "
+"BESTAND\n"
+"                                 (standaard is standaardfoutuitvoer,\n"
+"                                 weggooien bij een lege tekenreeks)\n"
+"  -l, --arglength=GETAL        trace-grootte van macro's beperken\n"
+"  -t, --trace=NAAM             NAAM tracen zodra deze gedefinieerd wordt\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+"OPTIES is één of meer van:\n"
+"  a   de werkelijke argumenten tonen\n"
+"  c   toestand vóór en na verzamelen van argumenten tonen, en na aanroep\n"
+"  e   expansies tonen\n"
+"  f   het huidige invoerbestand vermelden\n"
+"  i   wijzigingen in invoerbestanden tonen\n"
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+"  l   het huidige regelnummer van de invoer vermelden\n"
+"  p   resultaten van pad-doorzoekingen tonen\n"
+"  q   waarden zonodig aanhalen (bij optie 'a' of 'e')\n"
+"  t   alle macro-aanroepen tracen, niet slechts die met 'traceon'\n"
+"  x   een uniek macro-nummer tonen (handig bij optie 'c')\n"
+"  V   alle bovenstaande opties samen\n"
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+"Omgevingsvariabele 'M4PATH' is, wanneer gedefinieerd, een lijst van mappen\n"
+"(gescheiden door dubbele punten) die doorzocht worden na die gegeven bij '-"
+"I'.\n"
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+"De afsluitwaarde is 0 voor succes, 1 voor fout, 63 voor niet-overeenkomende\n"
+"versie van bevroren bestand, of de waarde die aan 'm4exit' meegegeven werd.\n"
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr "*Interne fout*.  Deze fout graag rapporteren aan <%s>."
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr "waarschuwing: 'm4 -%c' kan verdwijnen in een toekomstige uitgave"
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr "waarschuwing: 'm4 %s' is verouderd"
+
+#: src/m4.c:572
+#, c-format
+msgid "bad debug flags: `%s'"
+msgstr "foutieve debug-opties: '%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr "waarschuwing: 'm4 -e' is verouderd; gebruik 'm4 -i'"
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr "standaardfoutuitvoer"
+
+#: src/macro.c:196
+msgid "ERROR: end of file in argument list"
+msgstr "FOUT: bestandseinde in argumentenlijst"
+
+#: src/macro.c:332
+#, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"recursiegrens %d is overschreden; gebruik -L<GETAL> om deze te veranderen"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+msgid "cannot clean temporary file for diversion"
+msgstr "kan tijdelijk bestand voor afbuiging niet opschonen"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+msgid "cannot create temporary file for diversion"
+msgstr "kan geen tijdelijk bestand maken voor afbuiging"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+msgid "cannot seek within diversion"
+msgstr "kan geen 'seek' doen binnen een afbuiging"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+msgid "cannot close temporary file for diversion"
+msgstr "kan tijdelijk bestand voor afbuiging niet sluiten"
+
+#: src/output.c:474
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "FOUT: kan afbuiging niet opslaan in tijdelijk bestand"
+
+#: src/output.c:568
+msgid "ERROR: copying inserted file"
+msgstr "fout bij kopiëren van ingevoegd bestand"
+
+#: src/output.c:816
+msgid "error reading inserted file"
+msgstr "fout bij lezen van ingevoegd bestand"
+
+#: src/output.c:983
+msgid "cannot stat diversion"
+msgstr "kan status van afbuiging niet opvragen"
+
+#: src/output.c:987
+msgid "diversion too large"
+msgstr "afbuiging is te groot"
+
+#~ msgid "Undefined name `%s'"
+#~ msgstr "Ongedefinieerde naam '%s'"
+
+#~ msgid "Cannot open %s"
+#~ msgstr "Kan %s niet openen"
+
+#~ msgid "Bad regular expression `%s': %s"
+#~ msgstr "Foutieve reguliere expressie '%s': %s"
+
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr ""
+#~ "'%s' uit bevroren bestand niet gevonden in tabel van ingebouwde functies!"
+
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Invoer is teruggekeerd naar %s, regel %d"
+
+#~ msgid "Input read from %s"
+#~ msgstr "Invoer gelezen van %s"
+
+#~ msgid "NONE"
+#~ msgstr "GEEN"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "FOUT: Stapeloverloop.  (Oneindige recursie van 'define'?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Een argument dat verplicht of optioneel is voor een lange optie, is dat\n"
+#~ "ook voor de overeenkomstige korte optie.\n"
+#~ "\n"
+#~ "Werkingsmodus:\n"
+#~ "        --help                  deze hulptekst tonen en stoppen\n"
+#~ "        --version               versie-informatie tonen en stoppen\n"
+#~ "  -e,   --interactive           uitvoer niet bufferen, onderbrekingen "
+#~ "negeren\n"
+#~ "  -E,   --fatal-warnings        stoppen na de eerste waarschuwing\n"
+#~ "  -Q,   --quiet, --silent       sommige waarschuwingen voor ingebouwde "
+#~ "functies\n"
+#~ "                                onderdrukken\n"
+#~ "  -P,   --prefix-builtins       ingebouwde functies het voorvoegsel 'm4_' "
+#~ "geven\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Dynamisch laden:\n"
+#~ "  -m, --module-directory=MAP    deze map aan het modules-zoekpad "
+#~ "toevoegen\n"
+#~ "  -M, --load-module=MODULE      deze module laden, zoekend in M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "OPTIES is één of meer van:\n"
+#~ "  t   alle macro-aanroepen tracen, niet slechts die met 'traceon'\n"
+#~ "  a   de werkelijke argumenten tonen\n"
+#~ "  e   expansies tonen\n"
+#~ "  q   waarden zonodig aanhalen (bij optie 'a' of 'e')\n"
+#~ "  c   toestand vóór en na verzamelen van argumenten tonen, en na aanroep\n"
+#~ "  x   een uniek macro-nummer tonen (handig bij optie 'c')\n"
+#~ "  f   het huidige invoerbestand vermelden\n"
+#~ "  l   het huidige regelnummer van de invoer vermelden\n"
+#~ "  p   resultaten van pad-doorzoekingen tonen\n"
+#~ "  i   wijzigingen in invoerbestanden tonen\n"
+#~ "  V   alle bovenstaande opties samen\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to <bug-m4@gnu.org>.\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Rapporteer gebreken in het programma aan <bug-m4@gnu.org>;\n"
+#~ "meld fouten in de vertaling aan <vertaling@vrijschrift.org>.\n"
+
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "FOUT: kan zoekmap '%s' niet toevoegen"
+
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "FOUT: Kan modules niet initialiseren: %s"
+
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "FOUT: Kan module '%s' niet vinden"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "FOUT: Kan modules niet sluiten"
+
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Naam '%s' is onbekend\n"
diff --git a/po/pl.gmo b/po/pl.gmo
new file mode 100644 (file)
index 0000000..55461a6
Binary files /dev/null and b/po/pl.gmo differ
diff --git a/po/pl.po b/po/pl.po
new file mode 100644 (file)
index 0000000..4e0fc69
--- /dev/null
+++ b/po/pl.po
@@ -0,0 +1,1319 @@
+# Polish translations for the GNU m4 messages.
+# Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Rafał Maszkowski <rzm@icm.edu.pl>, 1998-1999, 2001, 2003, 2010.
+# Thanks do Jakub Bogusz for corretions, 2003
+# my „smart" mutt needs this line
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2010-01-23 23:15+0100\n"
+"Last-Translator: Rafał Maszkowski <rzm@icm.edu.pl>\n"
+"Language-Team: Polish <translation-team-pl@lists.sourceforge.net>\n"
+"Language: pl\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8-bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "BŁĄD: Nie mogę utworzyć plików tymczasowych dla przetwarzania"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Nie mogę ustawić pliku błędów: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: opcja `%s' jest niejednoznaczna\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: opcja `%s' jest niejednoznaczna\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: nierozpoznana opcja `%c%s'\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: opcja `%c%s' nie może mieć argumentu\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: opcja `%s' musi mieć argument\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: błędna opcja -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opcja musi mieć argument -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "brak pamięci"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Wzorzec znaleziony"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Wzorca nie znaleziono"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Błędne wyrażenie regularne"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Znak błędny dla bieżącego uporządkowania"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Błędna nazwa klasy znaków"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Końcowy ukośnik odwrotny"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Błędne odwołanie"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Nie pasujące [ lub [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Nie pasujące ( lub \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Nie pasujący \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Błędna zawartość \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Błędny koniec zakresu"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Brak pamięci"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Błędne poprzedzające wyrażenie regularne"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Przedwczesny koniec pliku wyrażenia regularnego"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Za duże wyrażenie regularne"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Nie pasujące ) lub \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Brak poprzedniego wyrażenia regularnego"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "przekroczony limit VMEM\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "przekroczony limit VMEM\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Niezdefiniowana nazwa %s"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Niezdefiniowana nazwa %s"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Raporty o błędach wysyłaj do bug-m4@gnu.org.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Błędne wyrażenie regularne `%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Uwaga: Za mało argumentów dla wbudowanego `%s'"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Uwaga: Nadmiarowe argumenty do built-in `%s' zostały zignorowane"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Nienumeryczny argument do built-in `%s'"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Nienumeryczny argument do built-in `%s'"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Niezdefiniowana nazwa `%s'"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Niezdefiniowana nazwa `%s'"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Uwaga: Za mało argumentów dla wbudowanego `%s'"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Nie mogę otworzyć potoku do komendy `%s'"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Ujemna długość w eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Nie mogę przetworzyć z powrotem %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Nie mogę przetworzyć z powrotem %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Nie mogę otworzyć %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "BŁĄD: nie można zamknąć modułu `%s'"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Tryb debugowania: złe flagi debugowania: `%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Nie mogę ustawić pliku błędów: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "UWAGA: \\0 zniknie, w podstawieniach użyj zamiast tego \\&"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Błędne wyrażenie regularne `%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Błąd dopasowania do wyrażenia regularnego `%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Błędne wyrażenie regularne `%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Błędne wyrażenie w eval (brakujący prawy nawias): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Błędne wyrażenie w eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Błędne wyrażenie w eval (złe dane wejściowe): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Błędne wyrażenie w eval (nadmiarowe dane): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Dzielenie przez zero w eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Dzielenie przez zero w eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulo zero w eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Błędne wyrażenie w eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Nienumeryczny argument dla %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: nierozpoznana opcja `%c%s'\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Oczekiwany line feed w zamrożonym pliku stanu"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Oczekiwany znak `%c' w zamrożonym pliku stanu"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Oczekiwany line feed w zamrożonym pliku stanu"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Przedwczesny koniec zamrożonego pliku stanu"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Nie mogę otworzyć %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Źle sformatowany zamrożony pliku stanu"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "BŁĄD: EOF w łańcuchu"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Spróbuj `%s --help' żeby dowiedzieć się więcej.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Składnia: %s [OPCJA]... [PLIK]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Jeżeli brak PLIKu lub PLIK to `-', czytane jest std. wejście.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr "  -W, --word-regexp=WYR_REGUL  użycie WYR_REGUL w składni nazw makr\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Właściwości preprocesora:\n"
+"  -I, --include=KATALOG        szukanie includes w tym KATALOGU\n"
+"  -D, --define=NAZWA[=WARTOŚĆ] wprowadzenie NAZWY z WARTOŚCIĄ lub pustą\n"
+"  -U, --undefine=NAZWA         skasowanie wbudowanej NAZWY\n"
+"  -s, --synclines              generowanie linii `#line NR \"PLIK\"\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Sterowanie ograniczeniami:\n"
+"  -G, --traditional            wyłączenie wszystkich rozszerzeń GNU\n"
+"  -H, --hashzize=PIERWSZA      ustawienie rozmiaru tablicy mieszającej dla "
+"symboli\n"
+"  -L, --nesting-limit=LICZBA   zmiania sztucznego limitu zagłębień\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Zamrożone pliki stanu:\n"
+"  -F, --freeze-state=PLIK      zapisanie zamrożonego PLIKU stanu na końcu\n"
+"  -R, --reload-state=PLIK      załadowanie zamrożonego PLIKU stanu na "
+"początku\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Debugowanie:\n"
+"  -d, --debug=[FLAGI]          ustawienie poziomu debugowania (bez FLAG: "
+"`aeg')\n"
+"  -t, --trace=NAZWA            śledzenie NAZWY, kiedy będzie zdefiniowana\n"
+"  -l, --arglength=ILE          ograniczenie rozmiaru śledzenia makr\n"
+"  -o, --error-output=PLIK      przekierowanie wyników debugowania i "
+"śledzenia\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Błędne flagi debugowania: `%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "BŁĄD: EOF w liście argumentów"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "BŁĄD: Osiągnięty limit rekursji %d, użyj -L<N> żeby go zmienić"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "BŁĄD: Nie mogę utworzyć plików tymczasowych dla przetwarzania"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "BŁĄD: Nie mogę utworzyć plików tymczasowych dla przetwarzania"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Nie mogę zrobić stat na danych przetwarzanych"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "BŁĄD: Nie mogę utworzyć plików tymczasowych dla przetwarzania"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "BŁĄD: Nie mogę zapisać zmian przetwarzania do pliku tymczasowego"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "BŁĄD: Kopiowanie włożonego pliku"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "BŁĄD: Czytanie włożonego pliku"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Nie mogę zrobić stat na danych przetwarzanych"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Za duża zmiana"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: opcja `--%s' nie może mieć argumentu\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: nierozpoznana opcja `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: nielegalna opcja -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: opcja `-W %s' jest niejednoznaczna\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: opcja `-W %s' nie może mieć argumentu\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Zły typ danych tokenu w define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Wbudowane nie znalezione w tablicy wbudowanych!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Zły typ danych tokenu w m4_dumpref ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Zły typ symbolu w m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Baza w eval poza zakresem (radix = %d)"
+
+# hm - rzm
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Niezdefiniowany kod składniowy %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "BŁĄD WEWNĘTRZNY: Wbudowane nie znalezione w tablicy wbudowanych! "
+#~ "(trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Zły typ danych tokenu (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błędny kod błędu w evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błędny operator porównania w cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błędny operator przesunięcia w shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błędny operator w mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Wbudowane nie znalezione w tablicy wbudowanych!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błędny typ danych tokenu w freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr ""
+#~ "`%s' z zamrożonego pliku stanu nie znalezione w tablicy wbudowanych "
+#~ "poleceń!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Dane wejściowe wycofane do %s, linia %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Dane wejściowe przeczytane z %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Rekursywny push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błędne wywołanie init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błąd stosu wejściowego w next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błąd stosu wejściowego w peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "ŻADEN"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "BŁĄD: Przepełnienie stosu.  (Nieskończona rekursja definicji?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Argumenty obowiązkowe lub opcjonalne dla opcji długich są obowiązkowe "
+#~ "lub\n"
+#~ "opcjonalne również dla krótkich.\n"
+#~ "\n"
+#~ "Tryby pracy:\n"
+#~ "      --help                   wyświetlenie tego opisu i zakończenie\n"
+#~ "      --version                wyświetlenie informacji o wersji i "
+#~ "zakończenie\n"
+#~ "  -e, --intercative            bez buforowania wyjścia, ignorowanie "
+#~ "przerwań\n"
+#~ "  -E, --fatal-warnings         zatrzymanie się po pierwszym ostrzeżeniu\n"
+#~ "  -Q, --quiet, --silent        bez pokazywania niektórych ostrzeżeń dla\n"
+#~ "                                 wbudowanych poleceń\n"
+#~ "  -P, --prefix-builtins        dodanie zawsze `m4_' przed wszystkimi\n"
+#~ "                                 wbudowanymi poleceniami\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Parametry dynamicznego ładowania modułów:\n"
+#~ "  -m, --module-directory=KATALOG    dodanie KATALOGU do ścieżki szukania "
+#~ "modułów\n"
+#~ "  -M, --load-module=MODUŁ           dynamiczne załadowanie modułu z "
+#~ "M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "FLAGI mogą być następujące:\n"
+#~ "  t   śledzenie wszystkich wywołań makr, nie tylko tych z traceon\n"
+#~ "  a   pokazanie właściwych argumentów\n"
+#~ "  e   pokazanie rozwinięcia\n"
+#~ "  q   zabezpieczenie znaków specjalnych, z flagą a lub e\n"
+#~ "  c   pokazanie przez zebraniem, po zebraniu i po wywołaniu\n"
+#~ "  x   dodanie unikalnego identyfikatora wywołania makra, pożyteczne z "
+#~ "flagą c\n"
+#~ "  f   podanie nazwy bieżącego pliku wejściowego\n"
+#~ "  l   podanie numeru bieżącej linii\n"
+#~ "  p   pokazanie wyników przeszukiwań ścieżek\n"
+#~ "  i   pokazanie zmian w plikach wejściowych\n"
+#~ "  V   skrót do wszystkich powyższych flag\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "BŁĄD: nie udało się dodać katalogu do przeszukiwania `%s'"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "BŁĄD: nie udało się dodać katalogu do przeszukiwania `%s': %s"
+
+#~ msgid " (options:"
+#~ msgstr " (opcje:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błędny kod w odłożonych argumentach"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błędny typ tokena w expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błędny typ tokena w expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Błędny symbol w call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "BŁĄD: nie można zainicjalizować modułu: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "BŁĄD: nie można znaleźć modułu `%s'"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "BŁĄD: nie można znaleźć modułu `%s': %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "BŁĄD: nie można zamknąć modułów"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "BŁĄD: nie można zamknąć modułu: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "BŁĄD: nie można zamknąć modułu `%s': %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Przeszukanie ścieżki dla `%s' znalazło `%s'"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Wykryto pogwałcenie ograniczeń adresów pamięci (SIGSEGV). Albo doszło do\n"
+#~ "przepełnienia stosu albo jest błąd w "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Sprawdź czy nie doszło do nieskończonej rekursji.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "BŁĄD WEWNĘTRZNY: Nielegalny tryb w symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Nazwa `%s' jest nieznana\n"
diff --git a/po/pt_BR.gmo b/po/pt_BR.gmo
new file mode 100644 (file)
index 0000000..f10106f
Binary files /dev/null and b/po/pt_BR.gmo differ
diff --git a/po/pt_BR.po b/po/pt_BR.po
new file mode 100644 (file)
index 0000000..0ce9f7d
--- /dev/null
@@ -0,0 +1,1325 @@
+# Brazilian Portuguese translations for m4 package
+# Traduções em português brasileiro para o pacote m4
+# Copyright (C) 2017 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Alexandre Folle de Menezes <afmenez@terra.com.br>, 2002.
+#   based on the translation to Galician (gl) by
+#   Jacobo Tarrio <jtarrio@iname.com>, 2000.
+# Rafael Fontenelle <rafaelff@gnome.org>, 2017.
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2017-01-20 08:15-0200\n"
+"Last-Translator: Rafael Fontenelle <rafaelff@gnome.org>\n"
+"Language-Team: Brazilian Portuguese <ldpbr-translation@lists.sourceforge."
+"net>\n"
+"Language: pt_BR\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Plural-Forms: nplurals=2; plural=(n > 1);\n"
+"X-Generator: Virtaal 1.0.0-beta1\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "ERRO: Não foi possível criar um arquivo temporário para o desvio"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Não foi possível definir arquivo de erros: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: a opção \"%s\" é ambígua\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: a opção \"%s\" é ambígua\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: opção desconhecida \"%c%s\"\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: a opção \"%c%s\" não permite um argumento\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: a opção \"%s\" exige um argumento\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opção inválida -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: a opção exige um argumento -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "memória esgotada"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Sucesso"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nenhuma ocorrência do padrão"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Expressão regular inválida"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Caractere de combinação inválido"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nome inválido de classe de caracteres"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Barra invertida no final"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Retrorreferência inválida"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ ou [^ sem correspondente"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( ou \\( sem correspondente"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ sem correspondente"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Conteúdo inválido de \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Fim de intervalo inválido"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memória esgotada"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "A expressão regular precedente é inválida"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Fim prematuro da expressão regular"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Expressão regular grande demais"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") ou \\) sem correspondente"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Nenhuma expressão regular anterior"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Limite de VMEM excedido?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Limite de VMEM excedido?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Nome %s não definido"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Nome %s não definido"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Relate erros para <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Expressão regular \"%s\" incorreta: %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Aviso: Número insuficiente de argumentos para o \"%s\" predefinido"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Aviso: Argumentos excedentes para o \"%s\" predefinido foram ignorados"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Argumento não-numérico para o \"%s\" predefinido"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Argumento não-numérico para o \"%s\" predefinido"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Nome \"%s\" não definido"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Nome \"%s\" não definido"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Aviso: Número insuficiente de argumentos para o \"%s\" predefinido"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Impossível abrir um pipe para o comando \"%s\""
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Largura negativa para eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Impossível endireitar %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Impossível endireitar %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Impossível abrir %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "ERRO: não foi possível fechar módulo: \"%s\""
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Debugmode: sinalizadores de depuração incorretos: \"%s\""
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Não foi possível definir arquivo de erros: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "AVISO: \\0 irá desaparecer, use \\& no seu lugar nas substituições"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Expressão regular \"%s\" incorreta: %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Erro ao comparar expressão regular \"%s\""
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Expressão regular \"%s\" incorreta: %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Expressão incorreta em eval (falta o parênteses direito): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Expressão incorreta em eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Expressão incorreta em eval (entrada incorreta): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Expressão incorreta em eval (excesso de entrada): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Divisão por zero em eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Divisão por zero em eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Resto da divisão por zero em eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Expressão incorreta em eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Argumento não-numérico para %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: opção desconhecida \"%c%s\"\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Era esperado um salto de linha no arquivo congelado"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Era esperado o caractere \"%c\" no arquivo congelado"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Era esperado um salto de linha no arquivo congelado"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Fim prematuro do arquivo congelado"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Impossível abrir %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "arquivo congelado mal formatado"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "ERRO: Fim de arquivo na string"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Tente \"%s --help\" para obter mais informações.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Uso: %s [OPÇÃO]... [ARQUIVO]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Se não for indicado um ARQUIVO ou se o ARQUIVO é \"-\", a entrada padrão é "
+"usada.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=REGEXP     usa REGEXP para a sintaxe dos nomes das "
+"macros\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Características do pré-processador:\n"
+"  -I, --include=DIRETORIO      procura depois neste DIRETORIO por arquivos\n"
+"                                 a incluir\n"
+"  -D, --define=NOME[=VALOR]    define NOME contendo o VALOR, ou vazio\n"
+"  -U, --undefine=NOME          apaga a predefinida NOME\n"
+"  -s, --synclines              gera linhas \"#line NUM 'ARQUIVO'\"\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Control de limites:\n"
+"  -G, --traditional            suprime todas as extensões GNU\n"
+"  -H, --hashsize=PRIMO         estabelece o tamanho da tabela hash de "
+"símbolos\n"
+"  -L, --nesting-limit=NÚMERO   muda limite artificial de aninhamento\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Arquivos de estado congelado:\n"
+"  -F, --freeze-state=ARQ      produz um estado congelado em ARQ no final\n"
+"  -R, --reload-state=ARQ      recarrega um estado congelado de ARQ no "
+"início\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Depuração:\n"
+"  -d, --debug=[opções]        estabelece o nível de depuração (não indicar\n"
+"                                opções implica em \"aeq\")\n"
+"  -t, --trace=NOME            rastreia NOME quando ele será definido\n"
+"  -l, --arglength=NÚM         restringe tamanho do rastreamento das macros\n"
+"  -o, --error-output=arquivo  redireciona a saída de depuração e "
+"rastreamento\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Opções de depuração incorretas: \"%s\""
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "ERRO: Fim de arquivo na lista de argumentos"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "ERRO: Limite de %d recursões excedido, use -L<N> para mudá-lo"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "ERRO: Não foi possível criar um arquivo temporário para o desvio"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "ERRO: Não foi possível criar um arquivo temporário para o desvio"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Não foi possível obter o estado do desvio"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "ERRO: Não foi possível criar um arquivo temporário para o desvio"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "ERRO: Não foi possível descarregar desvio para um arquivo temporário"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "ERRO: Copiando o arquivo inserido"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "ERRO: Lendo o arquivo inserido"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Não foi possível obter o estado do desvio"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Desvio grande demais"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: a opção \"--%s\" não permite um argumento\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: opção desconhecida \"--%s\"\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opção ilegal -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: a opção \"-W %s\" é ambígua\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: a opção \"-W %s\" não permite um argumento\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "ERRO INTERNO: Tipo de dado incorreto no token em define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "ERRO INTERNO: Predefinida não encontrada na tabela de predefinidas!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "ERRO INTERNO: Tipo de dado incorreto no token em m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "ERRO INTERNO: Tipo de símbolo incorreto em m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "A base está fora dos limites em eval (base = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Código de sintaxe %c não definido"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "ERRO INTERNO: Predefinida não encontrada na tabela de predefinidas! "
+#~ "(trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "ERRO INTERNO: Tipo de dado incorreto no elemento (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "ERRO INTERNO: Código de erro incorreto em evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "ERRO INTERNO: Operador de comparação incorreto em cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "ERRO INTERNO: Operador de troca incorreto em shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "ERRO INTERNO: Operador incorreto em mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "ERRO INTERNO: Predefinida não encontrada na tabela de predefinidas!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "ERRO INTERNO: Tipo de dado incorreto no elemento em freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr ""
+#~ "\"%s\" do arquivo congelado não encontrado na tabela de predefinidas!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "A entrada reverteu para %s, linha %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Ler a entrada de %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "ERRO INTERNO: push_string recursivo!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "ERRO INTERNO: Chamada incorreta a init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "ERRO INTERNO: Erro na pilha de entrada em next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "ERRO INTERNO: Erro na pilha de entrada em peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "NENHUM"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "ERRO: Transbordamento da pilha.  (Recursão infinita de defines?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Os argumentos obrigatórios ou opcionais nas opções longas também o são "
+#~ "para\n"
+#~ "as opções curtas.\n"
+#~ "\n"
+#~ "Modos de funcionamento:\n"
+#~ "      --help                   exibe esta ajuda e sai\n"
+#~ "      --version                mostra informações da versão e sai\n"
+#~ "  -e, --interactive            saída sem buffer, ignora as interrupções\n"
+#~ "  -E, --fatal-warnings         interrompe a execução após o primeiro "
+#~ "aviso\n"
+#~ "  -Q, --quiet, --silent        suprime alguns avisos das predefinidas\n"
+#~ "  -P, --prefix-builtins        força um prefixo \"m4_\" em todas as "
+#~ "predefinidas\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Características de carga dinâmica:\n"
+#~ "  -m, --module-directory=DIR        adiciona DIR à rota de busca de "
+#~ "módulos\n"
+#~ "  -M, --load-module=MÓDULO          carrega MÓDULO dinâmico de M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "OPÇÕES é uma de:\n"
+#~ "  t   rastreamento de todas as chamadas de macro, e não apenas com "
+#~ "\"traceon\"\n"
+#~ "  a   mostra os argumentos reais\n"
+#~ "  e   mostra a expansão\n"
+#~ "  q   cita o valores quando seja preciso, com as opções a ou e\n"
+#~ "  c   mostra antes da obtenção, depois da obtenção e depois da chamada\n"
+#~ "  x   adiciona um identificador único de chamada à macro, útil com a "
+#~ "opção c\n"
+#~ "  f   diz nome do arquivo de entrada atual\n"
+#~ "  l   diz número da linha de entrada atual\n"
+#~ "  p   mostra o resultados das buscas nas rotas\n"
+#~ "  i   mostra mudanças nos arquivos de entrada\n"
+#~ "  V   forma curta para todas as opções acima\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "ERRO: falha ao adicionar diretório de busca \"%s\""
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "ERRO: não foi possível adicionar diretório de busca \"%s\": %s"
+
+#~ msgid " (options:"
+#~ msgstr " (opções:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "ERRO INTERNO: Código incorreto nos argumentos pospostos"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "ERRO INTERNO: Tipo de token incorreto em expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "ERRO INTERNO: Tipo de elemento incorreto em expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "ERRO INTERNO: Tipo de símbolo incorreto em call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ERRO: não foi possível inicializar módulos: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ERRO: não foi possível encontrar módulo: \"%s\""
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ERRO: não foi possível encontrar módulo: \"%s\": %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ERRO: não foi possível fechar módulos"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "ERRO: não foi possível fechar módulos: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "ERRO: não foi possível fechar módulo: \"%s\": %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "A busca de caminhos por \"%s\" encontrou \"%s\""
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Violação dos limites de memória detectada (SIGSEGV).  Ou ocorreu um\n"
+#~ "estouro de pilha, ou há um bug em "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Procure por uma possível recursão infinita.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "ERRO INTERNO: Modo ilegal para symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "O nome \"%s\" é desconhecido\n"
diff --git a/po/quot.sed b/po/quot.sed
new file mode 100644 (file)
index 0000000..0122c46
--- /dev/null
@@ -0,0 +1,6 @@
+s/"\([^"]*\)"/“\1”/g
+s/`\([^`']*\)'/‘\1’/g
+s/ '\([^`']*\)' / ‘\1’ /g
+s/ '\([^`']*\)'$/ ‘\1’/g
+s/^'\([^`']*\)' /‘\1’ /g
+s/“”/""/g
diff --git a/po/remove-potcdate.sin b/po/remove-potcdate.sin
new file mode 100644 (file)
index 0000000..2436c49
--- /dev/null
@@ -0,0 +1,19 @@
+# Sed script that remove the POT-Creation-Date line in the header entry
+# from a POT file.
+#
+# The distinction between the first and the following occurrences of the
+# pattern is achieved by looking at the hold space.
+/^"POT-Creation-Date: .*"$/{
+x
+# Test if the hold space is empty.
+s/P/P/
+ta
+# Yes it was empty. First occurrence. Remove the line.
+g
+d
+bb
+:a
+# The hold space was nonempty. Following occurrences. Do nothing.
+x
+:b
+}
diff --git a/po/ro.gmo b/po/ro.gmo
new file mode 100644 (file)
index 0000000..86abca1
Binary files /dev/null and b/po/ro.gmo differ
diff --git a/po/ro.po b/po/ro.po
new file mode 100644 (file)
index 0000000..6542757
--- /dev/null
+++ b/po/ro.po
@@ -0,0 +1,1315 @@
+# Mesajele în limba românã pentru m4.
+# Copyright (C) 2003 Free Software Foundation, Inc.
+# Acest fiºier este distribuit sub aceeaºi licenþã ca ºi pachetul m4.
+# Laurentiu Buzdugan <buzdugan@voyager.net>, 2003.
+#
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2003-04-26 18:00-05\n"
+"Last-Translator: Laurentiu Buzdugan <buzdugan@voyager.net>\n"
+"Language-Team: Romanian <translation-team-ro@lists.sourceforge.net>\n"
+"Language: ro\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-2\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "EROARE: Nu pot crea fiºier temporar pentru diversiune"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Nu pot seta eroare fiºier: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: opþiunea `%s' este ambiguã\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: opþiunea `%s' este ambiguã\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: opþiune nerecunoscutã `%c%s'\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: opþiunea `%c%s' nu permite un argument\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: opþiunea `%s' necesitã un argument\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: opþiune ilegalã -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: opþiunea necesitã un argument -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "Memorie epuizatã"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Succes"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Nici o potrivire"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Expresie regularã incorectã"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Colatare de caractere incorectã"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Nume de clasã de caractere incorect"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Backslash în coadã"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Referinþã înapoi incorectã"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[ sau [^ fãrã pereche"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "( sau \\( fãrã pereche"
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "\\{ fãrã pereche"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Conþinut incorect pentru \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Sfârºit de interval incorect"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Memorie epuizatã"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Expresie regularã precedentã incorectã"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Sfârºit prematur al expresiei regulare"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Expresie regularã prea mare"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr ") sau \\) fãrã pereche"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Nici o expresie regularã anterioarã"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Limitã VMEM depãºitã?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Limitã VMEM depãºitã?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Nume nedefinit %s"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Nume nedefinit %s"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Raportaþi bug-uri la <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Expresie regularã incorectã `%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Avertisment: Prea puþine argumente pentru built-in `%s'"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Avertisment: Argumente în exces pentru built-in `%s' ignorate"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Argumen non-numeric pentru `%s'"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Argumen non-numeric pentru `%s'"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Nume nedefinit `%s'"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Nume nedefinit `%s'"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Avertisment: Prea puþine argumente pentru built-in `%s'"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Nu pot deschide pipe cãtre comanda `%s'"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Lãþime negativã pentru eval"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Nu pot de-abate %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Nu pot de-abate %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Nu pot deschide %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "EROARE: nu pot închide modulul: `%s'"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Moddepanare: flag-uri depanare incorecte: `%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Nu pot seta eroare fiºier: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "AVERTISMENT: \\0 va dispare, folosiþi în schimb \\& în înlocuiri"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Expresie regularã incorectã `%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Eroare potrivire expresie regularã `%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Expresie regularã incorectã `%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Expresie incorectã în eval (lipseºte paranteza din dreapta): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Expresie incorectã în eval: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Expresie incorectã în eval (intrare incorectã): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Expresie incorectã în eval (prea multe intrãri): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Împãrþire cu zero în eval: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Împãrþire cu zero în eval: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulo cu zero în eval: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Expresie incorectã în eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Argument non-numeric pentru %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: opþiune nerecunoscutã `%c%s'\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Aºtept line feed în fiºier blocat"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Aºtept caracter `%c' în fiºier blocat"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Aºtept line feed în fiºier blocat"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Sfârºit prematur de fiºier blocat"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Nu pot deschide %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Fiºier blocat formatat incorect"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "EROARE: EOF în ºir"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Încercaþi `%s --help' pentru informaþii suplimentare.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Folosire: %s [OPÞIUNE]... FIªIER...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Dacã nici un FIªIER sau dacã FIªIER este `-', este cititã intrarea "
+"standard.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=REGEXP     foloseºte REGEXP pentru sintaxã nume macro\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Capabilitãþi preprocesor:\n"
+"  -I, --include=DIRECTOR       cautã ºi acest director pentru includeri\n"
+"  -D, --define=NUME[=VALOARE]  NUME definit ca având VALOARE, sau gol\n"
+"  -U, --undefine=NUME          ºterge builtin NUME\n"
+"  -s, --synclines              genereazã `#linie NO \"FIªIER\"' linii\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Control limite:\n"
+"  -G, --traditional           eliminã toate extensiile GNU\n"
+"  -H, --hashsize=PRIM         seteazã dimensiunea tabel de cãutare "
+"simboluri\n"
+"  -L, --nesting-limit=NUMÃR   schimbã limita artificialã de încuibare\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Fiºiere stare blocatã:\n"
+"  -F, --freeze-state=FIªIER  creazã o stare blocatã în FIªIER la sfârºit\n"
+"  -R, --reload-state=FIªIER  reîncarcã o stare blocatã din FIªIER la "
+"început\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Depanare:\n"
+"  -d, --debug=[FLAGS]          seteazã nivel depanare (nici un FLAG implicã "
+"`aeq')\n"
+"  -t, --trace=NUME             urmãreºte NUME când va fi definit\n"
+"  -l, --arglength=NUM          restricþioneazã dimensiune macro urmãrire\n"
+"  -o, --error-output=FIªIER    redirecteazã ieºire depanare ºi urmãrire\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Flag-uri depanare incorecte: `%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "EROARE: EOF în listã argumente"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"EROARE: Limita de %d chemãri recursive depãºitã, folosiþi -L<N> pentru a o "
+"schimba"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "EROARE: Nu pot crea fiºier temporar pentru diversiune"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "EROARE: Nu pot crea fiºier temporar pentru diversiune"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Nu pot afla statistici despre diversiune"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "EROARE: Nu pot crea fiºier temporar pentru diversiune"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "EROARE: Nu pot flush diversiunea în fiºier temporar"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "EROARE: Copiez fiºier inserat"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "EROARE: Citesc fiºier inserat"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Nu pot afla statistici despre diversiune"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Diversiune prea mare"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: opþiunea `--%s' nu permite un argument\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: opþiune nerecunoscutã `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: opþiune ilegalã -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: opþiunea `-W %s' este ambiguã\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: opþiunea `-W %s' nu permite un argument\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "EROARE INTERNÃ: Tip datã token incorect în define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "EROARE INTERNÃ: Builtin nu a fost gãsit în tabelul builtin!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "EROARE INTERNÃ: Tip datã token incorect în m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "EROARE INTERNÃ: Tip simbol incorect în m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Radix (bazã, rãdãcinã) în eval în afara intervalului (radix = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Cod sintaxã nedefinit %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "EROARE INTERNÃ: Builtin nu a fost gãsit în tabelul builtin! (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "EROARE INTERNÃ: Tip datã token incorect (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "EROARE INTERNÃ: Cod eroare incorect în evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "EROARE INTERNÃ: Operator comparaþie incorect în cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "EROARE INTERNÃ: Operator shift incorect în shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "EROARE INTERNÃ: Operator incorect în mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "EROARE INTERNÃ: Built-in nu a fost gãsit în tabelul builtin!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "EROARE INTERNÃ: Tip datã token incorect în freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "`%s' din fiºier blocat nu a fost gãsit în tabelul builtin!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Intrare reschimbatã ca %s, linia %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Intrare cititã de la %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "EROARE INTERNÃ: push_string recursiv!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "EROARE INTERNÃ: Apel incorect al funcþiei init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "EROARE INTERNÃ: Stivã intrare resolitã în next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "EROARE INTERNÃ: Stivã intrare rasolitã în peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "NIMIC"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "EROARE: Depãºire de stivã.  (definire recursivã infinitã?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Argumentele obligatorii sau opþionale pentru opþiunile lungi sunt "
+#~ "obligatorii sau opþionale ºi pentru opþiunile scurte.\n"
+#~ "\n"
+#~ "Moduri operare:\n"
+#~ "      --help                  afiºeazã acest mesaj ºi terminã\n"
+#~ "      --version               afiºeazã informaþie despre versiune ºi "
+#~ "terminã\n"
+#~ "  -e, --interactive           ieºire fãrã buffer, ignorã întreruperi\n"
+#~ "  -E, --fatal-warnings        opreºte execuþia dupã primul avertisment\n"
+#~ "  -Q, --quiet, --silent       eliminã câteva avertismente pentru "
+#~ "builtins\n"
+#~ "  -P, --prefix-builtins       forþeazã un prefix `m4_' pentru toate "
+#~ "builtins\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Capabilitãþi încãrcare dinamicã:\n"
+#~ "  -m, --module-directory=DIRECTOR   adaugã DIRECTOR la calea de cãutare "
+#~ "module\n"
+#~ "  -M, --load-module=MODUL           încarcã dinamic MODUL din M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "FLAGS este oricare din:\n"
+#~ "  t   urmãreºte orice apel macro, nu numai cele activate ca urmãrite\n"
+#~ "  a   aratã argumentele curente\n"
+#~ "  e   aratã expansiune\n"
+#~ "  q   pune ghilimele pentru valori, unde necesar, cu un flag a sau e\n"
+#~ "  c   aratã înainte de colectare, dupã colectare ºi dupã apel\n"
+#~ "  x   adaugã un id de apel unic pentru macro, util cu flag-ul c\n"
+#~ "  f   afiºeazã numele fiºierului de intrare curent\n"
+#~ "  l   afiºeazã numãrul liniei de intrare curente\n"
+#~ "  p   afiºeazã rezultatele cautãrilor în cãi (paths)\n"
+#~ "  i   afiºeazã schimbãrile în fiºierele de intrare\n"
+#~ "  V   scurtãturã pentru toate flag-urile de deasupra\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "EROARE: nu am reuºit sã adaug director cãutare `%s'"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "EROARE: nu am  reuºit sã adaug director cãutare `%s': %s"
+
+#~ msgid " (options:"
+#~ msgstr " (opþiuni:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "EROARE INTERNÃ: Cod incorect în argumente amânate"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "EROARE INTERNÃ: Tip token incorect în expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "EROARE INTERNÃ: tip token incorect în expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "EROARE INTERNÃ: tip simbol incorect în call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "EROARE: am eºuat sã iniþializez modulele: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "EROARE: nu pot gãsi modulul: `%s'"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "EROARE: nu pot gãsi modulul: `%s': %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "EROARE: nu pot închide modulul"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "EROARE: nu pot închide modulul: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "EROARE: nu pot închide modulul: `%s': %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Cale cãutare pentru `%s' a gãsit `%s'"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Violare limitã memorie detectatã (SIGSEGV).  Fie a avut loc o depãºire\n"
+#~ "de stivã, fie existã un bug în "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Verificaþi pentru o eventualã recursivitate infinitã.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "EROARE INTERNÃ: Mod ilegal pentru symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Nume `%s' este necunoscut\n"
diff --git a/po/ru.gmo b/po/ru.gmo
new file mode 100644 (file)
index 0000000..e5905db
Binary files /dev/null and b/po/ru.gmo differ
diff --git a/po/ru.po b/po/ru.po
new file mode 100644 (file)
index 0000000..82b3102
--- /dev/null
+++ b/po/ru.po
@@ -0,0 +1,1320 @@
+# ìÏËÁÌÉÚÁÃÉÑ m4-1.4n
+# Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+# Denis Perchine <dyp@perchine.com>, 1997, 1998, 1999, 2000, 2001, 2002.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2002-01-07 20:32GMT+06\n"
+"Last-Translator: Denis Perchine <dyp@perchine.com>\n"
+"Language-Team: Russian <ru@li.org>\n"
+"Language: ru\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=KOI8-R\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"X-Generator: KBabel 0.9.5\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr ""
+"ïûéâëá: ïÛÉÂËÁ ÓÏÚÄÁÎÉÑ ×ÒÅÍÅÎÎÏÇÏ ÆÁÊÌÁ ÄÌÑ ÒÁÚ×ÅÔ×ÌÅÎÉÑ ÍÁËÒÏÏÂÒÁÂÏÔËÉ"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÎÁÚÎÁÞÉÔØ ÆÁÊÌ ÏÛÉÂÏË %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: ÏÐÃÉÑ `%s' ÎÅÏÄÎÏÚÎÁÞÎÁ\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: ÏÐÃÉÑ `%s' ÎÅÏÄÎÏÚÎÁÞÎÁ\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: ÎÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ '%c%s'\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: Õ ÏÐÃÉÉ `%c%s' ÎÅ ÄÏÌÖÎÏ ÂÙÔØ ÁÒÇÕÍÅÎÔÏ×\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: Õ ÏÐÃÉÉ `%s' ÄÏÌÖÅΠÂÙÔØ ÁÒÇÕÍÅÎÔ\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ÎÅ×ÅÒÎÁÑ ÏÐÃÉÑ -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: ÏÐÃÉÉ ÎÅÏÂÈÏÄÉÍ ÁÒÇÕÍÅÎÔ -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "ÐÁÍÑÔØ ÉÓÞÅÒÐÁÎÁ"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "õÓÐÅÈ"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "óÏ×ÐÁÄÅÎÉÊ ÎÅÔ"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "îÅ×ÅÒÎÏÅ ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "îÅ×ÅÒÎÙÊ ÓÉÍ×ÏÌ ÓÒÁ×ÎÅÎÉÑ"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "îÅ×ÅÒÎÏÅ ÉÍÑ ËÌÁÓÓÁ ÓÉÍ×ÏÌÏ×"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "ïÂÒÁÔÎÙÊ ÓÌÜÛ × ËÏÎÃÅ"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "îÅ×ÅÒÎÁÑ ÓÓÙÌËÁ ÎÁÚÁÄ"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "îÅÔ ÚÁËÒÙ×ÁÀÝÅÊ [ ÉÌÉ [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "îÅ ÚÁËÒÙ×ÁÀÝÅÊ ( ÉÌÉ \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "îÅÔ ÚÁËÒÙ×ÁÀÝÅÊ \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "îÅ×ÅÒÎÏÅ ÓÏÄÅÒÖÁÎÉÅ \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "îÅ×ÅÒÎÙÊ ËÏÎÅàÉÎÔÅÒ×ÁÌÁ"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "ðÁÍÑÔØ ÉÓÞÅÒÐÁÎÁ"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "îÅ×ÅÒÎÏÅ ÐÒÅÄÛÅÄÓÔ×ÕÀÝÅÅ ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "îÅÏÖÉÄÁÎÎÙÊ ËÏÎÅàÐÒÅÄÛÅÄÓÔ×ÕÀÝÅÇÏ ÒÅÇÕÌÑÒÎÏÇÏ ×ÙÒÁÖÅÎÉÑ"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "òÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ ÓÌÉÛËÏÍ ×ÅÌÉËÏ"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "îÅ ÏÔËÒÙÔÁÑ ) ÉÌÉ \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "îÅÔ ÐÒÅÄÛÅÄÓÔ×ÕÀÝÅÇÏ ÒÅÇÕÌÑÒÎÏÇÏ ×ÙÒÁÖÅÎÉÑ"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "ëÏÎÞÉÌÁÓØ ×ÉÒÔÕÁÌØÎÁÑ ÐÁÍÑÔØ?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "ëÏÎÞÉÌÁÓØ ×ÉÒÔÕÁÌØÎÁÑ ÐÁÍÑÔØ?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "éÍÑ %s ÎÅÏÐÒÅÄÅÌÅÎÏ"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "éÍÑ %s ÎÅÏÐÒÅÄÅÌÅÎÏ"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"ðÏÓÙÌÁÊÔÅ ÏÔÞÅÔÙ Ï ÏÛÉÂËÁÈ ÎÁ <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "îÅ×ÅÒÎÏÅ ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ: '%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: óÌÉÛËÏÍ ÍÁÌÏ ÁÒÇÕÍÅÎÔÏ× ÄÌÑ ×ÓÔÒÏÅÎÎÏÊ ÌÅËÓÅÍÙ '%s'"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr ""
+"ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: éÚÂÙÔÏÞÎÙÅ ÁÒÇÕÍÅÎÔÙ ÄÌÑ ×ÓÔÒÏÅÎÎÏÊ ÌÅËÓÅÍÙ '%s' "
+"ÐÒÏÉÇÎÏÒÉÒÏ×ÁÎÙ"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "îÅ ÞÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ ÄÌÑ ×ÓÔÒÏÅÎÎÏÊ ÌÅËÓÅÍÙ '%s'"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "îÅ ÞÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ ÄÌÑ ×ÓÔÒÏÅÎÎÏÊ ÌÅËÓÅÍÙ '%s'"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "éÍÑ `%s' ÎÅÏÐÒÅÄÅÌÅÎÏ"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "éÍÑ `%s' ÎÅÏÐÒÅÄÅÌÅÎÏ"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "ðÒÅÄÕÐÒÅÖÄÅÎÉÅ: óÌÉÛËÏÍ ÍÁÌÏ ÁÒÇÕÍÅÎÔÏ× ÄÌÑ ×ÓÔÒÏÅÎÎÏÊ ÌÅËÓÅÍÙ '%s'"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ ËÁÎÁÌ ÄÌÑ ËÏÍÍÁÎÄÙ '%s'"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "ïÔÒÉÃÁÔÅÌØÎÁÑ ÛÉÒÉÎÁ"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ×ÅÒÎÕÔØ ×Ù×ÏÄ ÉÚ %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ×ÅÒÎÕÔØ ×Ù×ÏÄ ÉÚ %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "ïûéâëá: ÎÅ ÍÏÇÕ ÚÁËÒÙÔØ ÍÏÄÕÌØ: `%s'"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "òÅÖÉÍ ÏÔÌÁÄËÉ: ÎÅ×ÅÒÎÙÊ ÆÌÁÇ ÏÔÌÁÄËÉ: '%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÎÁÚÎÁÞÉÔØ ÆÁÊÌ ÏÛÉÂÏË %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "ðòåäõðòåöäåîéå: \\0 ÉÓÞÅÚÎÅÔ, ÉÓÐÏÌØÚÕÊÔÅ \\& × ÚÁÍÅÎÁÈ"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "îÅ×ÅÒÎÏÅ ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ: '%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "ïÛÉÂËÁ ÓÏÐÏÓÔÁ×ÌÅÎÉÑ ÒÅÇÕÌÑÒÎÏÇÏ ×ÙÒÁÖÅÎÉÑ '%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "îÅ×ÅÒÎÏÅ ÒÅÇÕÌÑÒÎÏÅ ×ÙÒÁÖÅÎÉÅ: '%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "îÅ×ÅÒÎÏÅ ×ÙÒÁÖÅÎÉÅ (ÏÔÓÕÔÓÔ×ÕÅÔ ÐÒÁ×ÙÅ ÓËÏÂËÉ): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "îÅ×ÅÒÎÏÅ ×ÙÒÁÖÅÎÉÅ: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "îÅ×ÅÒÎÏÅ ×ÙÒÁÖÅÎÉÅ (bad input): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "îÅ×ÅÒÎÏÅ ×ÙÒÁÖÅÎÉÅ (excess input): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "äÅÌÅÎÉÅ ÎÁ ÎÏÌØ × ×ÙÒÁÖÅÎÉÉ: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "äÅÌÅÎÉÅ ÎÁ ÎÏÌØ × ×ÙÒÁÖÅÎÉÉ: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "íÏÄÕÌØÎÏÅ ÄÅÌÅÎÉÅ ÎÁ ÎÏÌØ × ×ÙÒÁÖÅÎÉÉ: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "îÅ×ÅÒÎÏÅ ×ÙÒÁÖÅÎÉÅ: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "îÅÞÉÓÌÏ×ÏÊ ÁÒÇÕÍÅÎÔ ÄÌÑ %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: ÎÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ '%c%s'\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "ïÖÉÄÁÅÔÓÑ ÐÅÒÅ×ÏÄ ÓÔÒÏËÉ × ÆÁÊÌÅ-ÏÂÒÁÚÅ ÐÁÍÑÔÉ"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "ïÖÉÄÁÅÔÓÑ ÓÉÍ×ÏÌ '%c' × ÆÁÊÌÅ-ÏÂÒÁÚÅ ÐÁÍÑÔÉ"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "ïÖÉÄÁÅÔÓÑ ÐÅÒÅ×ÏÄ ÓÔÒÏËÉ × ÆÁÊÌÅ-ÏÂÒÁÚÅ ÐÁÍÑÔÉ"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "ðÒÅÖÄÅ×ÒÅÍÅÎÎÙÊ ËÏÎÅàÆÁÊÌÁ-ÏÂÒÁÚÁ ÐÁÍÑÔÉ"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÏÔËÒÙÔØ %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "îÅ×ÅÒÎÙÊ ÆÏÒÍÁÔ ÆÁÊÌÁ-ÏÂÒÁÚÁ ÐÁÍÑÔÉ"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "ïûéâëá: ëÏÎÅàÆÁÊÌÁ × ÓÔÒÏËÅ"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "ðÏÐÒÏÂÕÊÔÅ '%s --help' ÄÌÑ ÉÎÆÏÒÍÁÃÉÉ.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "éÓÐÏÌØÚÏ×ÁÎÉÅ: %s [OPTION]... [FILE]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"åÓÌÉ FILE ÎÅ ÓÕÝÅÓÔ×ÕÅÔ ÉÌÉ FILE ÜÔÏ `-', ÉÓÐÏÌØÚÕÅÔÓÑ ÓÔÁÎÄÁÒÔÎÙÊ ×ÈÏÄ.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=REGEXP     ÉÓÐÏÌØÚÏ×ÁÔØ REGEXP ÄÌÑ ÓÉÎÔÁËÓÉÓÁ ÉÍÅΠ"
+"ÍÁËÒÏÓÏ×\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"ïÐÃÉÉ ÐÒÅÐÒÏÃÅÓÓÏÒÁ:\n"
+"  -I, --include=DIRECTORY      ÉÓËÁÔØ × ÐÏÄËÁÔÁÌÏÇÅ ×ËÌÀÞÁÅÍÙÅ ÆÁÊÌÙ\n"
+"  -D, --define=NAME[=VALUE]    ÏÐÒÅÄÅÌÉÔØ, ÞÔÏ NAME ÉÍÅÅÔ VALUE, ÉÌÉ ÐÕÓÔ\n"
+"  -U, --undefine=NAME          ÕÄÁÌÉÔØ ×ÓÔÒÏÅÎÎÕÀ ÆÕÎËÃÉÀ NAME\n"
+"  -s, --synclines              ÇÅÎÅÒÉÒÏ×ÁÔØ ÓÔÒÏËÉ `#line NO \"FILE\"'\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"ïÇÒÁÎÉÞÅÎÉÑ:\n"
+"  -G, --traditional            ÐÏÄÁ×ÌÑÔØ ×ÓÅ GNU ÒÁÓÛÉÒÅÎÉÑ\n"
+"  -H, --hashsize=PRIME         ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ ÈÜÛ-ÔÁÂÌÉÃÙ ÄÌÑ ÐÏÉÓËÁ "
+"ÓÉÍ×ÏÌÏ×\n"
+"  -L, --nesting-limit=NUMBER   ÉÚÍÅÎÉÔØ ÐÒÅÄÅÌ ÇÌÕÂÉÎÙ ÉÎÔÅÌÅËÔÕÁÌØÎÏÇÏ "
+"ÐÏÉÓËÁ\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"âÌÏËÉÒÏ×ÁÎÎÙÅ ÆÁÊÌÙ:\n"
+"  -F, --freeze-state=FILE      × ËÏÎÃÅ ÓÏÚÄÁÔØ ÏÂÒÁÚ ÐÁÍÑÔÉ ÄÌÑ FILE\n"
+"  -R, --reload-state=FILE      × ÎÁÞÁÌÅ ÚÁÇÒÕÖÁÔØ ÏÂÒÁÚ ÐÁÍÑÔÉ ÄÌÑ FILE\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"ïÔÌÁÄËÁ:\n"
+"  -d, --debug=[FLAGS]          ÕÓÔÁÎÏ×ÉÔØ ÕÒÏ×ÅÎØ ÏÔÌÁÄËÉ (ÐÏ ÕÍÏÌÞÁÎÉÀ "
+"FLAGS=`aeq')\n"
+"  -t, --trace=NAME             ÔÒÁÓÓÉÒÏ×ÁÔØ NAME ËÏÇÄÁ ÏÎÏ ÂÕÄÅÔ ÏÐÒÅÄÅÌÅÎÏ\n"
+"  -l, --arglength=NUM          ÕÓÔÁÎÏ×ÉÔØ ÒÁÚÍÅÒ ÔÒÁÓÓÉÒÏ×ËÉ ÄÌÑ ÍÁËÒÏÓÁ\n"
+"  -o, --error-output=FILE      ÐÅÒÅÎÁÐÒÁ×ÉÔØ ÏÔÌÁÄÏÞÎÙÊ É ÔÒÁÓÓÉÒÏ×ÏÞÎÙÊ "
+"×Ù×ÏÄ × ÆÁÊÌ FILE\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "îÅ×ÅÒÎÙÊ ÆÌÁÇ ÏÔÌÁÄËÉ: '%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "ïûéâëá: ëÏÎÅàÆÁÊÌÁ × ÓÐÉÓËÅ ÁÒÇÕÍÅÎÔÏ×"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"ïûéâëá: ìÉÍÉÔ ÒÅËÕÒÓÉÉ %d ÉÓÞÅÒÐÁÎ, ÉÓÐÏÌØÚÕÊÔÅ -L<N> ÞÔÏÂÙ ÉÚÍÅÎÉÔØ ÅÇÏ"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr ""
+"ïûéâëá: ïÛÉÂËÁ ÓÏÚÄÁÎÉÑ ×ÒÅÍÅÎÎÏÇÏ ÆÁÊÌÁ ÄÌÑ ÒÁÚ×ÅÔ×ÌÅÎÉÑ ÍÁËÒÏÏÂÒÁÂÏÔËÉ"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr ""
+"ïûéâëá: ïÛÉÂËÁ ÓÏÚÄÁÎÉÑ ×ÒÅÍÅÎÎÏÇÏ ÆÁÊÌÁ ÄÌÑ ÒÁÚ×ÅÔ×ÌÅÎÉÑ ÍÁËÒÏÏÂÒÁÂÏÔËÉ"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÐÏÄÓÞÉÔÁÔØ ÒÁÚ×ÅÔ×ÌÅÎÉÑ"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr ""
+"ïûéâëá: ïÛÉÂËÁ ÓÏÚÄÁÎÉÑ ×ÒÅÍÅÎÎÏÇÏ ÆÁÊÌÁ ÄÌÑ ÒÁÚ×ÅÔ×ÌÅÎÉÑ ÍÁËÒÏÏÂÒÁÂÏÔËÉ"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "ïûéâëá: ïÛÉÂËÁ ÚÁÐÉÓÉ ÒÁÚ×ÅÔ×ÌÅÎÉÑ ×Ï ×ÒÅÍÅÎÎÙÊ ÆÁÊÌ"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "ïûéâëá: ëÏÐÉÒÕÀ ×ÓÔÁ×ÌÅÎÎÙÊ ÆÁÊÌ"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "ïûéâëá: þÉÔÁÀ ×ÓÔÁ×ÌÅÎÎÙÊ ÆÁÊÌ"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "îÅ×ÏÚÍÏÖÎÏ ÐÏÄÓÞÉÔÁÔØ ÒÁÚ×ÅÔ×ÌÅÎÉÑ"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "óÌÉÛËÏÍ ÂÏÌØÛÏÅ ÒÁÚ×ÅÔ×ÌÅÎÉÅ"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: Õ ÏÐÃÉÉ `--%s' ÎÅ ÄÏÌÖÎÏ ÂÙÔØ ÁÒÇÕÍÅÎÔÏ×\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: ÎÅÉÚ×ÅÓÔÎÁÑ ÏÐÃÉÑ `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: ÚÁÐÒÅÝÅÎÎÁÑ ÏÐÃÉÑ -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: ËÌÀÞ `-W %s' ÎÅÏÄÎÏÚÎÁÞÅÎ\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: Õ ËÌÀÞÁ `-W %s' ÎÅ ÄÏÌÖÎÏ ÂÙÔØ ÁÒÇÕÍÅÎÔÏ×\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ÔÉРÌÅËÓÅÍÙ × define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: ÷ÓÔÒÏÅÎÎÁÑ ÌÅËÓÅÍÁ ÎÅ ÎÁÊÄÅÎÁ!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ÔÉРÌÅËÓÅÍÙ × m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ÔÉРÓÉÍ×ÏÌÁ × m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "òÁÄÉËÓ × ×ÙÒÁÖÅÎÉÉ ×ÙÈÏÄÉÔ ÚÁ ÐÒÅÄÅÌÙ (radix = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "îÅÏÐÒÅÄÅÌÅÎÎÙÊ ÓÉÎÔÁËÓÉÞÅÓËÉÊ ËÏÄ %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: ÷ÓÔÒÏÅÎÎÁÑ ÌÅËÓÅÍÁ ÎÅ ÎÁÊÄÅÎÁ! (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ÔÉРÌÅËÓÅÍÙ (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ËÏÄ ÏÛÉÂËÉ × evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÏÅ ÓÒÁ×ÎÅÎÉÅ × cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ÏÐÅÒÁÔÏÒ ÓÄ×ÉÇÁ × shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ÏÐÅÒÁÔÏÒ × mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: ÷ÓÔÒÏÅÎÎÁÑ ÌÅËÓÅÍÁ ÎÅ ÎÁÊÄÅÎÁ!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ÔÉРÌÅËÓÅÍÙ × freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "'%s' ÉÚ ÆÁÊÌÁ-ÏÂÒÁÚÁ ÐÁÍÑÔÉ ÎÅ ÎÁÊÄÅÎÁ ×Ï ×ÓÔÒÏÅÎÎÏÊ ÔÁÂÌÉÃÅ!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "÷×ÏÄ ÐÅÒÅÎÁÐÒÁ×ÌÅΠנ%s , ÓÔÒÏËÁ %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "÷×ÏÄ ÉÚ %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: òÅËÕÒÓÉ×ÎÁÑ push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ×ÙÚÏ× init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: ïÛÉÂËÁ ×ÈÏÄÎÏÇÏ ÓÔÅËÁ × next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: ïÛÉÂËÁ ×ÈÏÄÎÏÇÏ ÓÔÅËÁ × peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "îéþåçï"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "ïûéâëá: ðÅÒÅÐÏÌÎÅÎÉÅ ÓÔÅËÁ. (âÅÓËÏÎÅÞÎÏÅ ÒÅËÕÒÓÉ×ÎÏÅ ÏÐÒÅÄÅÌÅÎÉÅ?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "ïÂÑÚÁÔÅÌØÎÙÅ ÉÌÉ ÎÅÏÂÑÚÁÔÅÌØÎÙÅ ÁÒÇÕÍÅÎÔÙ ÄÌÑ ÄÌÉÎÎÙÈ ÏÐÃÉÉ ÔÁËÏ×Ù É ÄÌÑ "
+#~ "ËÏÒÏÔËÉÈ\n"
+#~ "\n"
+#~ "òÅÖÉÍÙ ÒÁÂÏÔÙ:\n"
+#~ "      --help                   ÐÏËÁÚÁÔØ ÐÏÍÏÝØ É ×ÙÊÔÉ\n"
+#~ "      --version                ×Ù×ÅÓÔÉ ÉÎÆÏÒÍÁÃÉÀ Ï ×ÅÒÓÉÉ É ×ÙÊÔÉ\n"
+#~ "  -e, --interactive            ÎÅÂÕÆÅÒÉÚÏ×ÁÎÎÙÊ ×Ù×ÏÄ, ÉÇÎÏÒÉÒÏ×ÁÔØ "
+#~ "ÐÒÅÒÙ×ÁÎÉÑ\n"
+#~ "  -E, --fatal-warnings         ÏÓÔÁÎÏ×ÉÔØÓÑ ÐÏÓÌÅ ÐÅÒ×ÏÇÏ ÐÒÅÄÕÐÒÅÖÄÅÎÉÑ\n"
+#~ "  -Q, --quiet, --silent        ÐÏÄÁ×ÌÑÔØ ÐÒÅÄÕÐÒÅÖÄÅÎÉÑ ÄÌÑ ×ÓÔÒÏÅÎÎÙÈ "
+#~ "ÆÕÎËÃÉÊ\n"
+#~ "  -P, --prefix-builtins        ÄÏÂÁ×ÌÑÔØ ÐÒÅÆÉËÓ `m4_' ÄÌÑ ×ÓÅÈ "
+#~ "×ÓÔÒÏÅÎÎÙÈ ÆÕÎËÃÉÊ\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "÷ÏÚÍÏÖÎÏÓÔÉ ÄÉÎÁÍÉÞÅÓËÏÊ ÚÁÇÒÕÚËÉ:\n"
+#~ "  -m, --module-directory=DIRECTORY  ÄÏÂÁ×ÉÔØ ËÁÔÁÌÏÇ DIRECTORY × ÐÕÔÉ "
+#~ "ÐÏÉÓËÁ ÍÏÄÕÌÅÊ\n"
+#~ "  -M, --load-module=MODULE          ÚÁÇÒÕÚÉÔØ ÄÉÎÁÍÉÞÅÓËÉÊ ÍÏÄÕÌØ MODULE "
+#~ "ÉÚ M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   ÔÒÁÓÓÉÒÏ×ÁÔØ ×ÓÅ ×ÙÚÏ×Ù ÍÁËÒÏÓÏ×\n"
+#~ "  a   ÐÏËÁÚÁÔØ ÔÅËÕÝÉÅ ÁÒÇÕÍÅÎÔÙ\n"
+#~ "  e   ÐÏËÁÚÙ×ÁÔØ ÍÁËÒÏÒÁÓÛÉÒÅÎÉÅ\n"
+#~ "  q   ÚÁËÌÀÞÁÔØ ÚÎÁÞÅÎÉÑ × ËÁ×ÙÞËÉ ÐÏ ÎÅÏÂÈÏÄÉÍÏÓÔÉ, Ó a ÉÌÉ e ÆÌÁÇÁÍÉ\n"
+#~ "  c   ÐÏËÁÚÙ×ÁÔØ ÐÅÒÅÄ ÓÂÏÒÏÍ , ÐÏÓÌÅ ÓÂÏÒÁ É ÐÏÓÌÅ ×ÙÚÏ×Á\n"
+#~ "  x   ÄÏÂÁ×ÌÑÔØ ÕÎÉËÁÌØÎÙÊ ÉÄÅÎÔÉÆÉËÁÔÏÒ ×ÙÚÏ×Á ÍÁËÒÏÓÁ, ÉÓÐÏÌØÚÕÅÔÓÑ "
+#~ "×ÍÅÓÔÅ Ó ÆÌÁÇÏÍ c\n"
+#~ "  f   ×Ù×ÏÄÉÔØ ÔÅËÕÝÅÅ ÉÍÑ ×ÈÏÄÎÏÇÏ ÆÁÊÌÁ\n"
+#~ "  l   ×Ù×ÏÄÉÔØ ÎÏÍÅÒ ÔÅËÕÝÅÊ ÓÔÒÏÞËÉ\n"
+#~ "  p   ÐÏËÁÚÙ×ÁÔØ ÒÅÚÕÌØÔÁÔÙ ÐÏÉÓËÁ ÐÏ ÐÕÔÑÍ\n"
+#~ "  i   ÐÏËÁÚÙ×ÁÔØ ÉÚÍÅÎÅÎÉÑ ×Ï ×ÈÏÄÎÙÈ ÆÁÊÌÁÈ\n"
+#~ "  V   ÓÏËÒÁÝÅÎÉÅ ÄÌÑ ×ÓÅÈ ÆÌÁÇÏ× ×ÍÅÓÔÅ\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "ïûéâëá: ÎÅ ÍÏÇÕ ÄÏÂÁ×ÉÔØ ËÁÔÁÌÏÇ ÐÏÉÓËÁ `%s'"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "ïûéâëá: ÎÅ ÍÏÇÕ ÄÏÂÁ×ÉÔØ ËÁÔÁÌÏÇ ÐÏÉÓËÁ `%s': %s"
+
+#~ msgid " (options:"
+#~ msgstr " (ËÌÀÞÉ:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ËÏÄ × ËÏÓ×ÅÎÎÙÈ ÁÒÇÕÍÅÎÔÁÈ"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ÔÉРÌÅËÓÅÍÙ × expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ÔÉРÌÅËÓÅÍÙ × expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: îÅ×ÅÒÎÙÊ ÔÉРÓÉÍ×ÏÌÁ × call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ïûéâëá: ÏÛÉÂËÁ ÉÎÉÃÉÁÌÉÚÁÃÉÉ ÍÏÄÕÌÑ %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ïûéâëá: ÍÏÄÕÌØ `%s' ÎÅ ÎÁÊÄÅÎ"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ïûéâëá: ÍÏÄÕÌØ `%s' ÎÅ ÎÁÊÄÅÎ: %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ïûéâëá: ÎÅ ÍÏÇÕ ÚÁËÒÙÔØ ÍÏÄÕÌÑ"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "ïûéâëá: ÎÅ ÍÏÇÕ ÚÁËÒÙÔØ ÍÏÄÕÌÑ: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "ïûéâëá: ÎÅ ÍÏÇÕ ÚÁËÒÙÔØ ÍÏÄÕÌØ: `%s': %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "ðÕÔØ ÐÏÉÓËÁ ÄÌÑ `%s' ÎÁÊÄÅΠ`%s'"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "ïÂÎÁÒÕÖÅΠ×ÙÈÏÄ ÚÁ ÇÒÁÎÉÃÕ ÐÁÍÑÔÉ (SIGSEGV). üÔÏ ÌÉÂÏ ÐÅÒÅÐÏÌÎÅÎÉÅ ÓÔÅËÁ\n"
+#~ "ÉÌÉ ÏÛÉÂËÁ × "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ". ðÒÏ×ÅÒËÁ ÎÁ ×ÏÚÍÏÖÎÕÀ ÂÅÓËÏÎÅÞÎÕÀ ÒÅËÕÒÓÉÀ.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "÷îõôòåîîññ ïûéâëá: ÎÅ×ÅÒÎÙÊ ÒÅÖÉÍ ÄÌÑ symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "éÍÑ `%s' ÎÅÉÚ×ÅÓÔÎÏ\n"
diff --git a/po/sr.gmo b/po/sr.gmo
new file mode 100644 (file)
index 0000000..7248215
Binary files /dev/null and b/po/sr.gmo differ
diff --git a/po/sr.po b/po/sr.po
new file mode 100644 (file)
index 0000000..523cfee
--- /dev/null
+++ b/po/sr.po
@@ -0,0 +1,1326 @@
+# Serbian translation of m4.
+# Copyright (C) 2012 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Мирослав Николић <miroslavnikolic@rocketmail.com>, 2012.
+msgid ""
+msgstr ""
+"Project-Id-Version: m4-1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2012-05-23 09:15+0200\n"
+"Last-Translator: Мирослав Николић <miroslavnikolic@rocketmail.com>\n"
+"Language-Team: Serbian <gnu@prevod.org>\n"
+"Language: sr\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "ГРЕШКА: Не могу да направим привремену датотеку за размимоилажење"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Не могу да подесим датотеку грешке: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: опција „%s“ је нејасна\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: опција „%s“ је нејасна\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: непозната опција „%c%s“\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: опција „%c%s“ не дозвољава аргумент\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: опција „%s“ захтева аргумент\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: погрешна опција -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: опција захтева аргумент -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "меморија је потрошена"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Успешно"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Нема подударања"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Неисправан регуларан израз"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Неисправан знак поретка"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Неисправан назив класе знака"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Водећа контра коса црта"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Неисправна повратна референца"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Не одговара [ или [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Не одговара ( или \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Не одговара \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Неисправан садржај \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Неисправан крај опсега"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Меморија је потрошена"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Неисправан регуларан израз који претходи"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Прерани крај регуларног израза"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Регуларни израз је превелик"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Не одговара ) или \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Нема претходног регуларног израза"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "ВМЕМ ограничење је премашено?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "ВМЕМ ограничење је премашено?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Неодређени назив %s"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Неодређени назив %s"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Грешке пријавите на <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Лош регуларни израз „%s“: %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Упозорење: Премало аргумената за угради-у „%s“"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Упозорење: Премашење аргумената за угради-у „%s“ је занемарено"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Не бројевни аргумент за угради-у „%s“"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Не бројевни аргумент за угради-у „%s“"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Неодређени назив „%s“"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Неодређени назив „%s“"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Упозорење: Премало аргумената за угради-у „%s“"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Не могу да отворим спојку за наредбу „%s“"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Негативна ширина у процени"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Не могу да поништим скретање %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Не могу да поништим скретање %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Не могу да отворим „%s“"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "ГРЕШКА: не могу да затворим модул: „%s“"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Режим уклањања грешака: лоша опција уклањања грешака: „%s“"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Не могу да подесим датотеку грешке: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "УПОЗОРЕЊЕ: \\0 ће нестати, уместо тога користите \\& у заменама"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Лош регуларни израз „%s“: %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Грешка упоређивања регуларног израза „%s“"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Лош регуларни израз „%s“: %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Лош израз у процени (недостаје десна мала заграда): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Лош израз у процени: %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Лош израз у процени (лош улаз): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Лош израз у процени (превише улаза): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Дељење нулом у процени: %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Дељење нулом у процени: %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Основа нулом у процени: %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Лош израз у процени: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Не бројевни аргумент за „%s“"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: непозната опција „%c%s“\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Ишчекујем приток реда у замрзнутој датотеци"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Ишчекујем знак „%c“ у замрзнутој датотеци"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Ишчекујем приток реда у замрзнутој датотеци"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Превремен крај замрзнуте датотеке"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Не могу да отворим „%s“"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Рђаво форматирана замрзнута датотека"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "ГРЕШКА: крај датотеке у ниски"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Покушајте „%s --help“ за више података.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Употреба: %s [ОПЦИЈА]... [ДАТОТЕКА]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Ако нема ДАТОТЕКЕ или ако је ДАТОТЕКА „-“, чита се стандардни улаз.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=РЕГ. ИЗРАЗ         користи РЕГУЛАРНИ ИЗРАЗ за садржај "
+"назива макроа\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Функције претпроцесора:\n"
+"  -I, --include=ДИРЕКТОРИЈУМ           претражује овај директоријум за "
+"укључивањима\n"
+"  -D, --define=НАЗИВ[=ВРЕДНОСТ]        НАЗИВ уноса има имајућу ВРЕДНОСТ, или "
+"празно\n"
+"  -U, --undefine=НАЗИВ                 брише НАЗИВ уграђивања\n"
+"  -s, --synclines                      ствара редове „#line НЕМА "
+"'ДАТОТЕКА'“\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Управљање ограничењем:\n"
+"  -G, --traditional                    потискује сва ГНУ проширења\n"
+"  -H, --hashsize=PRIME                 подешава величину хеш табеле потраге "
+"симбола\n"
+"  -L, --nesting-limit=БРОЈ             мења ограничење вештачког "
+"угнежђавања\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Датотеке замрзнутог стања:\n"
+"  -F, --freeze-state=ДАТОТЕКА          производи замрзнуто стање на ДАТОТЕЦИ "
+"на крају\n"
+"  -R, --reload-state=ДАТОТЕКА          поново учитава замрзнуто стање из "
+"ДАТОТЕКЕ на почетку\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Уклањање грешака:\n"
+"  -d, --debug=[ОПЦИЈЕ]                 подешава ниво уклањања грешака "
+"(ниједна ОПЦИЈА не подразумева „aeq“)\n"
+"  -t, --trace=НАЗИВ                    прати НАЗИВ када ће бити одређен\n"
+"  -l, --arglength=БРОЈ                 ограничава величину праћења макроа\n"
+"  -o, --error-output=ДАТОТЕКА          преусмерава уклањање грешака и прати "
+"излаз\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Лоше опције прочишћавања: „%s“"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "ГРЕШКА: Крај датотеке у списку аргумента"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"ГРЕШКА: Ограничење дубачења од %d је премашено, употребите -L<N> да га "
+"измените"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "ГРЕШКА: Не могу да направим привремену датотеку за размимоилажење"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "ГРЕШКА: Не могу да направим привремену датотеку за размимоилажење"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Не могу да добавим податке размимоилажења"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "ГРЕШКА: Не могу да направим привремену датотеку за размимоилажење"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "ГРЕШКА: Не могу да преточим размимоилажење у привремену датотеку"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "ГРЕШКА: Умножавам уметнуту датотеку"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "ГРЕШКА: Читам уметнуту датотеку"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Не могу да добавим податке размимоилажења"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Размимоилажење је превелико"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: опција „--%s“ не дозвољава аргумент\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: непозната опција „--%s“\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: недозвољена опција -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: опција „-W %s“ је нејасна\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: опција „-W %s“ не дозвољава аргумент\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лоша врста података уметка у „define_macro ()“"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Уграђивање није пронађено у табели уграђивања!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лоша врста података уметка у „m4_dumpdef ()“"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лоша врста симбола у „m4_defn ()“"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Бројна основа у процени је изван опсега (основа = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Неодређени код садржаја %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "УНУТРАШЊА ГРЕШКА: Уграђивање није пронађено у табели уграђивања! "
+#~ "(trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лоша врста података уметка (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лош код грешке у „evaluate ()“"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лош оператор поређења у „cmp_term ()“"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лош оператор промене у „shift_term ()“"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лош оператор у „mult_term ()“"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Угради-у није пронађено у табели уграђивања!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "УНУТРАШЊА ГРЕШКА: Лоша врста података уметка у „freeze_one_symbol ()“"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "„%s“ из замрзнуте датотеке није пронађено у табели уграђивања"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Улаз је повраћен на %s, ред %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Читање улаза од %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Дубинско „push_string“!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лош позив за „init_macro_token ()“"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лоше одрађен улазни стек у „next_char ()“"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лоше одрађен улазни стек у „peek_input ()“"
+
+#~ msgid "NONE"
+#~ msgstr "НИШТА"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "ГРЕШКА: Прекорачење стека.  (Бескрајно одређено дубачење?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Обавезни или опционални аргументи за дуге опције су такође обавезни или\n"
+#~ "опционални и за кратке опције.\n"
+#~ "\n"
+#~ "Режими деловања:\n"
+#~ "      --help                           приказује ову помоћ и излази\n"
+#~ "      --version                        исписује податке о издању и "
+#~ "излази\n"
+#~ "  -e, --interactive                    вади излаз међумеморије, "
+#~ "занемарује прекиде\n"
+#~ "  -E, --fatal-warnings                 зауставља извршавање након првог "
+#~ "упозорења\n"
+#~ "  -Q, --quiet, --silent                потискује нека упозорења за "
+#~ "уграђивања\n"
+#~ "  -P, --prefix-builtins                приморава „m4_“ префикс свим "
+#~ "уграђивањима\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Функције динамичког учитавања:\n"
+#~ "  -m, --module-directory=ДИРЕКТОРИЈУМ  додаје ДИРЕКТОРИЈУМ у путању "
+#~ "претраге модула\n"
+#~ "  -M, --load-module=МОДУЛ              учитава динамички МОДУЛ из "
+#~ "М4ПУТАЊЕМОДУЛА\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "ОПЦИЈЕ is any of:\n"
+#~ "  t   прати све позиве макроа, не само испраћене\n"
+#~ "  a   приказује радне аргументе\n"
+#~ "  e   приказује ширење\n"
+#~ "  q   наводи вредности као што је потребно, уз опцију „a“ или „e“\n"
+#~ "  c   приказује пре прикупљања, након прикупљања и након позива\n"
+#~ "  x   додаје јединствени иб позива макроа, корисно уз опцију „c“\n"
+#~ "  f   даје назив текуће улазне датотеке\n"
+#~ "  l   даје број текућег улазног реда\n"
+#~ "  p   приказује резултате претрага путање\n"
+#~ "  i   приказује измене у улазним датотекама\n"
+#~ "  V   стенографија за све горње опције\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "ГРЕШКА: нисам успео да додам директоријум претраге „%s“"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "ГРЕШКА: нисам успео да додам директоријум претраге „%s“: %s"
+
+#~ msgid " (options:"
+#~ msgstr " (опције:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лош код у одложеним аргументима"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лоша врста уметка у „expand_token ()“"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лоша врста уметка у „expand_argument ()“"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Лоша врста симбола у „call_macro ()“"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "ГРЕШКА: нисам успео да покренем модуле: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "ГРЕШКА: не могу да пронађем модул: „%s“"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "ГРЕШКА: не могу да пронађем модул: „%s“: %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "ГРЕШКА: не могу да затворим модуле"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "ГРЕШКА: не могу да затворим модуле: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "ГРЕШКА: не могу да затворим модул: „%s“: %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Претрага путање за „%s“ је пронашла „%s“"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Откривено је кршење граница меморије (СИГСЕГВ).  Или је дошло до "
+#~ "преливања\n"
+#~ "стека, или постоји грешка у њему "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Проверава за могућим бесконачним дубачењем.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "УНУТРАШЊА ГРЕШКА: Неисправан режим за „symbol_lookup ()“"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Назив „%s“ је непознат\n"
diff --git a/po/stamp-po b/po/stamp-po
new file mode 100644 (file)
index 0000000..9788f70
--- /dev/null
@@ -0,0 +1 @@
+timestamp
diff --git a/po/sv.gmo b/po/sv.gmo
new file mode 100644 (file)
index 0000000..fe8f7b5
Binary files /dev/null and b/po/sv.gmo differ
diff --git a/po/sv.po b/po/sv.po
new file mode 100644 (file)
index 0000000..6253548
--- /dev/null
+++ b/po/sv.po
@@ -0,0 +1,1310 @@
+# Swedish messages for m4
+# Copyright © 1999, 2001, 2017 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Jan Djärv <Jan.Djarv@mbox200.swipnet.se>, 1999, 2001.
+# Anders Jonsson <anders.jonsson@norsjovallen.se>, 2017.
+# Revision: 1.13
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2017-06-10 11:24+0200\n"
+"Last-Translator: Anders Jonsson <anders.jonsson@norsjovallen.se>\n"
+"Language-Team: Swedish <tp-sv@listor.tp-sv.se>\n"
+"Language: sv\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=ISO-8859-1\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"X-Generator: Poedit 1.8.11\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "FEL: Kan inte skapa temporär fil för avledning"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Kan inte sätta felutskriftsfil: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: flaggan \"%s\" är tvetydig\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: flaggan \"%s\" är tvetydig\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: okänd flagga \"%c%s\"\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: flaggan \"%c%s\" tar inget argument\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: flaggan \"%s\" behöver ett argument\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: ogiltig flagga -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: flaggan behöver ett argument -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "minnet slut"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Lyckat"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Ingen träff"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Ogiltigt reguljäruttryck"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ogiltigt kollationeringstecken"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Ogiltigt teckenklassnamn"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Avslutande omvänt snedstreck"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Ogiltig bakåtreferens"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Obalanserade [ eller [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Obalanserade ( eller \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Obalanserad \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Ogiltigt innehåll i \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Ogiltigt intervallslut"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Minnet slut"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Ogiltigt föregående reguljäruttryck"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "För tidigt slut på reguljäruttryck"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Reguljäruttrycket är för stort"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Obalanserade ) eller \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Inget föregående reguljäruttryck"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Begränsning för VMEM överskriden?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Begränsning för VMEM överskriden?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Odefinierat namn \"%s\""
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Odefinierat namn \"%s\""
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Rapportera fel till <bug-m4@gnu.org>.\n"
+"Rapportera synpunkter på översättningen till\n"
+"<tp-sv@listor.tp-sv.se>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Otillåtet reguljäruttryck \"%s\": %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Varning: För få argument till inbyggt makro \"%s\""
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Varning: Överskottsargument till inbyggt makro \"%s\" ignorerade"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Ickenumeriskt argument till inbyggt makro \"%s\""
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Ickenumeriskt argument till inbyggt makro \"%s\""
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Odefinierat namn \"%s\""
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Odefinierat namn \"%s\""
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Varning: För få argument till inbyggt makro \"%s\""
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Kan inte skapa rör till kommandot \"%s\""
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Negativ bredd till \"eval\""
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Kan inte återleda %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Kan inte återleda %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Kan inte öppna %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "FEL: kan inte stänga modul: \"%s\""
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Felsökningsläge: okänd flagga: \"%s\""
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Kan inte sätta felutskriftsfil: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "VARNING: \\0 kommer att försvinna, använd \\& istället i ersättningar"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Otillåtet reguljäruttryck \"%s\": %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Fel när reguljäruttrycket \"%s\" matchades"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Otillåtet reguljäruttryck \"%s\": %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "Otillåtet uttryck i \"eval\" (högerparentes saknas): %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Otillåtet uttryck i \"eval\": %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "Otillåtet uttryck i \"eval\" (otillåtet indata): %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "Otillåtet uttryck i \"eval\" (för mycket indata): %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Division med noll i \"eval\": %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Division med noll i \"eval\": %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulo med noll i \"eval\": %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Otillåtet uttryck i \"eval\": %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "Ickenumeriskt argument till %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: okänd flagga \"%c%s\"\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Nyrad förväntas i fryst fil"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Tecknet \"%c\" förväntas i fryst fil"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Nyrad förväntas i fryst fil"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "För tidigt filslut i fryst fil"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Kan inte öppna %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Korrupt fryst fil"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "FEL: Filslut i sträng"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Försök med \"%s --help\" för mer information.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Användning: %s [FLAGGA]... [FIL]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Om ingen FIL anges eller om FIL är `-', så läses standard in.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr "  -W, --word-regexp=REGEXP     använd REGEXP som makronamnsyntax\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Förprocessorstyrning:\n"
+"  -I, --include=KATALOG        sök i katalog efter inkluderade filer\n"
+"  -D, --define=NAMN[=VÄRDE]    definiera NAMN som VÄRDE, eller tomt\n"
+"  -U, --undefine=NAMN          ta bort inbyggt makro\n"
+"  -s, --synclines              generera rader med '#line NNN \"FIL\"'\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Begränsningskontroll:\n"
+"  -G, --traditional            undertryck alla extra GNU-tillägg\n"
+"  -H, --hashsize=PRIMTAL       sätt storlek på symboltabellen\n"
+"  -L, --nesting-limit=ANTAL    ändra artificiell nästningsnivå\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Frysta tillståndsfiler:\n"
+"  -F, --freeze-state=FIL       spara fryst tillstånd i FIL vid avslut\n"
+"  -R, --reload-state=FIL       läs fryst tillstånd från FIL vid start\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Felsökning:\n"
+"  -d, --debug=[FLAGGOR]        sätt felsökningsnivå\n"
+"                               (inga FLAGGOR tolkas som \"aeq\")\n"
+"  -t, --trace=NAMN             spåra NAMN när den blir definierad\n"
+"  -l, --arglength=ANTAL        begränsa makrospårningsstorleken\n"
+"  -o, --error-output=FIL       avled felsöknings- och spårutskrifter till "
+"FIL\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Okänd felsökningsflagga \"%s\""
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "FEL: Filslut i argumentlistan"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "FEL: Rekursionsgräns %d överskriden, använd -L<N> för att ändra"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "FEL: Kan inte skapa temporär fil för avledning"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "FEL: Kan inte skapa temporär fil för avledning"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Kan inte ta status på avledningen"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "FEL: Kan inte skapa temporär fil för avledning"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "FEL: Kan inte skriva avledningen till temporär fil"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "FEL: Kopiering av insatt fil"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "FEL: Läsning av insatt fil"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Kan inte ta status på avledningen"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Avledning för stor"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: flaggan \"--%s\" tar inget argument\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: okänd flagga \"--%s\"\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: otillåten flagga -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: flaggan \"-W %s\" är tvetydig\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: flaggan \"-W %s\" tar inget argument\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "INTERNT FEL: Otillåten lexikalisk datatyp i define_macro ()"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "INTERNT FEL: Inbyggt makro finns inte i tabellen!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "INTERNT FEL: Otillåten lexikalisk datatyp i m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "INTERNT FEL: Otillåten symboltyp i m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Otillåten bas i \"eval\" (bas = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Odefinierad syntaxkod %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr "INTERNT FEL: Inbyggt makro finns inte i tabellen (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "INTERNT FEL: Otillåten lexikalisk datatyp (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "INTERNT FEL: Otillåten felkod i evaluate ()"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "INTERNT FEL: Otillåten jämförelseoperator i cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "INTERNT FEL: Otillåten skiftoperator i shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "INTERNT FEL: Otillåten operator i mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "INTERNT FEL: Inbyggt makro finns inte i tabellen!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "INTERNT FEL: Otillåten lexikalisk datatyp i freeze_one_symbol ()"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "\"%s\" från fryst fil hittades inte i tabellen för inbyggda makron!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Indata återgår till %s, rad %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Indata läses från %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "INTERNT FEL: Rekursiv push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "INTERNT FEL: Otillåtet anrop till init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "INTERNT FEL: Instacken havererade i next_char ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "INTERNT FEL: Instacken havererade i peek_input ()"
+
+#~ msgid "NONE"
+#~ msgstr "INGET"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "FEL: Stacken flödar över. (Oändlig definitionsrekursion?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Obligatoriska respektive valfria argument för långa flaggor är\n"
+#~ "obligatoriska respektive valfria även för korta.\n"
+#~ "\n"
+#~ "Körlägen:\n"
+#~ "      --help                   visa denna hjälptext och avsluta\n"
+#~ "      --version                visa versionsinformation och avsluta\n"
+#~ "  -e, --interactive            obuffrad utskrift, ignorera avbrott\n"
+#~ "  -E, --fatal-warnings         avsluta exekvering efter första varningen\n"
+#~ "  -Q, --quiet, --silent        undertryck vissa varningar om inbyggda "
+#~ "makron\n"
+#~ "  -P, --prefix-builtins        alla inbyggda makron börjar med `m4_'\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Dynamisk laddning:\n"
+#~ "  -m, --module-directory=KATALOG    sök moduler även i KATALOG\n"
+#~ "  -M, --load-module=MODUL           ladda MODUL från M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "FLAGGOR kan vara en eller flera av:\n"
+#~ "  t   spåra alla makroanrop, inte bara de som spåras med \"traceon\"\n"
+#~ "  a   visa aktuella argument\n"
+#~ "  e   visa expansioner\n"
+#~ "  q   sätt citationstecken där det behövs, gäller \"a\" och \"e\"\n"
+#~ "  c   visa före insamling, efter insamling och efter anrop\n"
+#~ "  x   lägg till en unik identifierare för makroanrop, användbart med \"c"
+#~ "\"\n"
+#~ "  f   visa namnet på aktuell infil\n"
+#~ "  l   visa raden i aktuell infil\n"
+#~ "  p   visa resultatet av sökvägssökningar\n"
+#~ "  i   visa byten av infil\n"
+#~ "  V   förkortning för alla ovanstående flaggor\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "FEL: misslyckades med att lägga till sökkatalog \"%s\""
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "FEL: misslyckades med att lägga till sökkatalog \"%s\": %s"
+
+#~ msgid " (options:"
+#~ msgstr " (tillägg:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "INTERNT FEL: Otillåten kod i argument"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "INTERNT FEL: Otillåten lexikalisk datatyp i expand_token ()"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "INTERNT FEL: Otillåten lexikalisk datatyp i expand_argument ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "INTERNT FEL: Otillåten symboltyp i call_macro ()"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "FEL: misslyckades med att initiera moduler: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "FEL: kan inte hitta modul: \"%s\""
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "FEL: kan inte hitta modul: \"%s\": %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "FEL: kan inte stänga moduler"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "FEL: kan inte stänga moduler: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "FEL: kan inte stänga modul: \"%s\": %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "\"%s\" hittades som \"%s\" i sökvägen"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Otillåten referens utanför minnesgränserna har upptäckts (SIGSEGV).\n"
+#~ "Antingen flödade stacken över eller så är det ett fel i "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Kontrollera om oändlig rekursion förekommer.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "INTERNT FEL: Otillåtet läge till symbol_lookup ()"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Namnet \"%s\" är okänt\n"
diff --git a/po/uk.gmo b/po/uk.gmo
new file mode 100644 (file)
index 0000000..26b6bbf
Binary files /dev/null and b/po/uk.gmo differ
diff --git a/po/uk.po b/po/uk.po
new file mode 100644 (file)
index 0000000..6501c24
--- /dev/null
+++ b/po/uk.po
@@ -0,0 +1,1122 @@
+# Ukrainian translation for m4.
+# Copyright (C) 2021 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+#
+# Yuri Chornoivan <yurchor@ukr.net>, 2021.
+msgid ""
+msgstr ""
+"Project-Id-Version: GNU m4 1.4.18d\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2021-05-13 15:59+0300\n"
+"Last-Translator: Yuri Chornoivan <yurchor@ukr.net>\n"
+"Language-Team: Ukrainian <trans-uk@lists.fedoraproject.org>\n"
+"Language: uk\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
+"X-Generator: Lokalize 20.12.0\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr "не вдалося знайти тимчасовий каталог, спробуйте встановити $TMPDIR"
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr "не вдалося створити тимчасовий каталог використовуючи шаблон \"%s\""
+
+#: lib/clean-temp.c:371
+#, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "не вдалося усунути тимчасовий каталог %s"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr "помилка закриття файлу"
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr "помилка запису"
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr "помилка програми"
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr "переповнення стосу"
+
+#: lib/clean-temp-simple.c:297
+#, c-format
+msgid "cannot remove temporary file %s"
+msgstr "не вдалося усунути тимчасовий файл %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr "Невідома системна помилка"
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr "нащадок %s зазнав невдачі"
+
+#: lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: параметр «%s%s» не є однозначним\n"
+
+#: lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: неоднозначний параметр «%s%s»; можливі варіанти:"
+
+#: lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: невідомий параметр «%s%s»\n"
+
+#: lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: додавання аргументів до параметра «%s%s» не передбачено\n"
+
+#: lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: до параметра «%s%s» слід додати аргумент\n"
+
+#: lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: Некоректний параметр -- '%c'\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: параметр вимагає аргументу -- '%c'\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "пам'ять вичерпано"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "не вдалося змінити поточний каталог"
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "не вдалося зберегти поточний каталог"
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr "помилка _open_osfhandle"
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr "не вдалося відновити дескриптор %d: помилка dup2"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr "`"
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr "'"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Успіх"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Брак збігів"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Некоректний формальний вираз"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Некоректний об'єднувальний символ"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Некоректна назва класу символів"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Зворотна похила риска наприкінці виразу"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Недійсне зворотнє посилання"
+
+#: lib/regcomp.c:156
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Вираз без парних [, [^, [:, [. або [="
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Незакрита ( або \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Незакрита \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "Некоректний вміст \\{\\}"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Некоректний кінець діапазону"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Пам'ять вичерпана"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Некоректний попередній формальний вираз"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Передчасне закінчення формального виразу"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Завеликий формальний вираз"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Неузгоджена ) або \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Не вказано попереднього формального виразу"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr "Відбій"
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr "Переривання"
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr "Вийти"
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr "Недійсна інструкція"
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr "Перехоплення трасування/контрольної точки"
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr "Аварійне завершення"
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr "Виняток операції з рухомою крапкою"
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr "Знищено"
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr "Помилка шини"
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr "Помилка сегментації"
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr "Розімкнений конвеєр"
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr "Таймер"
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr "Закінчено"
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr "Екстрена ситуація вводу-виводу"
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr "Припинення (сигнал)"
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr "Припинення"
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr "Продовження"
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr "Нащадок завершився"
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr "Припинення (ввід з консолі)"
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr "Припинення (вивід на консоль)"
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr "Можливий ввід-вивід"
+
+#: lib/siglist.h:94
+msgid "CPU time limit exceeded"
+msgstr "Перевищення ліміту часу ЦП"
+
+#: lib/siglist.h:97
+msgid "File size limit exceeded"
+msgstr "Перевищення ліміту розміру файлів"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr "Відлік віртуального таймера завершено"
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr "Відлік таймера профілювання завершено"
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr "Вікно змінилося"
+
+#: lib/siglist.h:109
+msgid "User defined signal 1"
+msgstr "Визначений користувачем сигнал 1"
+
+#: lib/siglist.h:112
+msgid "User defined signal 2"
+msgstr "Визначений користувачем сигнал 2"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr "Пастка EMT"
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr "Некоректний системний виклик"
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr "Збій стосу"
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr "Запит інформації"
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr "Аварія живлення"
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr "Втрата засобу"
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr "не вдалося створити конвеєр"
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr "Сигнал реального часу %d"
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr "Невідомий сигнал %d"
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "не вдалося вивести повідомлення про помилку"
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "Пакет створив %s (%s)\n"
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "Пакет створив %s\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr "©"
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+"Умови ліцензування викладено у GPLv3+: GNU GPL версії 3 або новішій, <%s>\n"
+"Це вільне програмне забезпечення: ви можете вільно змінювати і поширювати "
+"його.\n"
+"Вам не надається ЖОДНИХ ГАРАНТІЙ, окрім гарантій передбачених "
+"законодавством.\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr "Автор: %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "Автори: %s та %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "Автори: %s, %s та %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Автори: %s, %s, %s\n"
+"та %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Автори: %s, %s, %s\n"
+"%s, та %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"Автори: %s, %s, %s\n"
+"%s, %s та %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"Автори: %s, %s, %s\n"
+"%s, %s, %s та %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"Автори: %s, %s, %s\n"
+"%s, %s, %s, %s та %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"Автори: %s, %s, %s\n"
+"%s, %s, %s, %s,\n"
+"%s та %s.\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"Автори: %s, %s, %s\n"
+"%s, %s, %s, %s,\n"
+"%s, %s та інші.\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, c-format
+msgid "Report bugs to: %s\n"
+msgstr "Про помилки звітуйте на %s\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "Про помилки у програмі %s звітуйте на %s\n"
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "домашня сторінка %s: <%s>\n"
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+"Загальна довідкова інформація щодо використання програмного забезпечення "
+"GNU: <%s>\n"
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr "нащадок процесу %s"
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr "підпроцес %s отримав фатальний сигнал %d"
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr "неможливо здійснити форматований вивід"
+
+#: src/builtin.c:264
+#, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "--warn-macro-sequence: помилковий формальний вираз «%s»: %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr "Попередження: у визначенні «%s» міститься послідовність «%s»"
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr "помилка під час перевірки --warn-macro-sequence макросу «%s»"
+
+#: src/builtin.c:388
+#, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Попередження: замало аргументів для вбудованої «%s»"
+
+#: src/builtin.c:394
+#, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Попередження: зайві аргументи до вбудованої «%s» проігноровано"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr "порожній рядок, який обробляється як 0, у вбудованій «%s»"
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "нечисловий аргумент вбудованої «%s»"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr "проігноровано початкові пробіли у вбудованій «%s»"
+
+#: src/builtin.c:435
+#, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "виявлено переповнення числового значення у вбудованій «%s»"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr "Попередження: %s: проігноровано некоректну назву макросу"
+
+#: src/builtin.c:752 src/builtin.c:864
+#, c-format
+msgid "undefined macro `%s'"
+msgstr "невизначений макрос «%s»"
+
+#: src/builtin.c:823
+#, c-format
+msgid "undefined builtin `%s'"
+msgstr "невизначена вбудована «%s»"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+"підтримки вбудованої «%s» із запитом із файла заморожування не передбачено"
+
+#: src/builtin.c:918
+#, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Попередження: не вдалося з'єднати вбудовану «%s»"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, c-format
+msgid "cannot run command `%s'"
+msgstr "не вдалося запустити команду «%s»"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr "не вдалося прочитати конвеєр"
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr "основа %d у вбудованій «%s» поза припустимим діапазоном"
+
+#: src/builtin.c:1108
+#, c-format
+msgid "negative width to builtin `%s'"
+msgstr "від'ємна ширина у вбудованій «%s»"
+
+#: src/builtin.c:1252
+#, c-format
+msgid "error undiverting `%s'"
+msgstr "помилка під час спроби зведення «%s»"
+
+#: src/builtin.c:1256
+#, c-format
+msgid "cannot undivert `%s'"
+msgstr "не вдалося виконати зведення «%s»"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, c-format
+msgid "cannot open `%s'"
+msgstr "не вдалося відкрити «%s»"
+
+#: src/builtin.c:1429
+#, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "%s: не вдалося створити тимчасовий файл «%s»"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr "рекомендуємо скористатися mkstemp"
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr "стан виходу поза припустимим діапазоном: «%d»"
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Діагностичний режим: помилкові прапорці діагностики: «%s»"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, c-format
+msgid "cannot set debug file `%s'"
+msgstr "не вдалося встановити діагностичний файл «%s»"
+
+#: src/builtin.c:1988
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "Попередження: \\0 зникне, скористайтеся замість нього \\& у замінниках"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr "Попередження: немає підвиразу %d"
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr "Попередження: завершальне \\ у заміннику буде проігноровано"
+
+#: src/builtin.c:2079
+#, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "помилковий формальний вираз: «%s»: %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, c-format
+msgid "error matching regular expression `%s'"
+msgstr "помилка під час встановлення відповідності формальному виразу «%s»"
+
+#: src/builtin.c:2139 src/input.c:792
+#, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "помилковий формальний вираз «%s»: %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr "помилка під час спроби запису до діагностичного потоку даних"
+
+#: src/eval.c:318
+#, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "помилковий вираз в eval (пропущено праву дужку): %s"
+
+#: src/eval.c:324
+#, c-format
+msgid "bad expression in eval: %s"
+msgstr "помилковий вираз в eval: %s"
+
+#: src/eval.c:329
+#, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "помилковий вираз в eval (помилкові вхідні дані): %s"
+
+#: src/eval.c:334
+#, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "помилковий вираз в eval (зайві вхідні дані): %s"
+
+#: src/eval.c:339
+#, c-format
+msgid "invalid operator in eval: %s"
+msgstr "некоректний оператор в eval: %s"
+
+#: src/eval.c:345
+#, c-format
+msgid "divide by zero in eval: %s"
+msgstr "ділення на нуль в eval: %s"
+
+#: src/eval.c:350
+#, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "ділення націло на нуль в eval: %s"
+
+#: src/eval.c:355
+#, c-format
+msgid "negative exponent in eval: %s"
+msgstr "від'ємний степінь в eval: %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+"Попередження: рекомендуємо використовувати для оператора рівності ==, а не ="
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr "порожній рядок, який оброблено як 0"
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, c-format
+msgid "non-numeric argument %s"
+msgstr "нечисловий аргумент %s"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr "початкові пробіли проігноровано"
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr "виявлено переповнення числового значення"
+
+#: src/format.c:308
+#, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "Попередження: нерозпізнаний специфікатор у «%s»"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr "не вдалося створити заморожений стан"
+
+#: src/freeze.c:167
+msgid "expecting line feed in frozen file"
+msgstr "у файлі заморожування мало бути переведення рядка"
+
+#: src/freeze.c:169
+#, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "у файлі заморожування мав бути символ «%c»"
+
+#: src/freeze.c:215
+msgid "integer overflow in frozen file"
+msgstr "переповнення цілочисельного значення у файлі заморожування"
+
+#: src/freeze.c:257
+msgid "premature end of frozen file"
+msgstr "передчасне завершення файла заморожування"
+
+#: src/freeze.c:270
+#, c-format
+msgid "cannot open %s"
+msgstr "не вдалося відкрити %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr "версія файла заморожування %d перевищує максимальну підтримувану, 1"
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+"помилкове форматування файла заморожування, мала бути інструкція version"
+
+#: src/freeze.c:297
+msgid "ill-formed frozen file"
+msgstr "помилкове форматування файла заморожування"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr "не вдалося прочитати стан заморожування"
+
+#: src/input.c:359
+msgid "read error"
+msgstr "помилка під час читання"
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr "помилка під час зчитуванні файла"
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr "Попередження: символ кінця файла оброблено як символ нового рядка"
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr "ПОМИЛКА: символ кінця файла у коментарі"
+
+#: src/input.c:1001
+msgid "ERROR: end of file in string"
+msgstr "ПОМИЛКА: символ кінця файла у рядку"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr "Rene' Seindal"
+
+#: src/m4.c:207
+#, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Віддайте команду «%s --help», щоб дізнатися більше."
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Користування: %s [ПАРАМЕТР]... [ФАЙЛ]...\n"
+
+#: src/m4.c:214
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"Обробити макроси у ФАЙЛах. Якщо ФАЙЛ не вказано, або якщо ФАЙЛом є «-»,\n"
+"дані буде прочитано зі стандартного джерела.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+"Обов'язкові і додаткові аргументи до довгих форм запису параметрів є також\n"
+"обов'язковими для всіх відповідних скорочених форм запису.\n"
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+"Режими роботи:\n"
+"      --help                   вивести ці довідкові дані і завершити роботу\n"
+"      --version                вивести дані щодо версії і завершити роботу\n"
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+"  -E, --fatal-warnings         один раз: попередження стають помилками,\n"
+"                                 двічі: зупинити на першій помилці\n"
+"  -i, --interactive            не буферизувати виведення, ігнорувати "
+"переривання\n"
+"  -P, --prefix-builtins        примусово використовувати префікс «m4_» для "
+"усіх вбудованих\n"
+"  -Q, --quiet, --silent        придушити деякі попередження для вбудованих\n"
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+"      --warn-macro-sequence[=ФОРМАЛЬНИЙ_ВИРАЗ]\n"
+"                               попереджати, якщо визначення макросу "
+"відповідає виразу,\n"
+"                                 типове значення -- %s\n"
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=ВИРАЗ     використати формальний вираз для синтаксису "
+"назви макросу\n"
+
+#: src/m4.c:247
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"Можливості попередньої обробки:\n"
+"  -D, --define=НАЗВА[=ЗНАЧЕННЯ] визначити НАЗВУ як таку, що має ЗНАЧЕННЯ або "
+"порожню\n"
+"  -I, --include=КАТАЛОГ        дописати КАТАЛОГ до шляху включення\n"
+"  -s, --synclines              створювати рядки «#line ЧИСЛО \"ФАЙЛ\"»\n"
+"  -U, --undefine=НАЗВА         скасувати визначення НАЗВИ\n"
+
+#: src/m4.c:255
+#, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"Обмеження:\n"
+"  -g, --gnu                    перевизначити -G для уможливлення розширень "
+"GNU\n"
+"  -G, --traditional            придушити усі розширення GNU\n"
+"  -H, --hashsize=ОСНОВА        встановити розмір таблиці пошуку хешів [509]\n"
+"  -L, --nesting-limit=ЧИСЛО    змінити рівень вкладеності, 0 -- без обмежень "
+"[%d]\n"
+
+#: src/m4.c:263
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"Файли стану заморожування:\n"
+"  -F, --freeze-state=ФАЙЛ      створити стан заморожування у файлі "
+"наприкінці\n"
+"  -R, --reload-state=ФАЙЛ      перезавантажити стан заморожування з ФАЙЛа на "
+"початку\n"
+
+#: src/m4.c:269
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"Діагностика:\n"
+"  -d, --debug[=ПРАПОРЦІ]       встановити рівень діагностики (без ПРАПОРЦІв "
+"-- «aeq»)\n"
+"      --debugfile[=ФАЙЛ]       переспрямувати виведені діагностичні дані і "
+"трасування\n"
+"                                 до файла (типово stderr, відкинути, якщо "
+"вказано\n"
+"                                 порожній рядок)\n"
+"  -l, --arglength=ЧИСЛО        обмежити розмір трасування макросу\n"
+"  -t, --trace=НАЗВА            трасувати НАЗВА, якщо його визначено\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+"ПРАПОРЦІ:\n"
+"  a   показати справжні аргументи\n"
+"  c   показати до збирання, після збирання і після виклику\n"
+"  e   показати розгортання\n"
+"  f   вивести назву поточного файла вхідних даних\n"
+"  i   показати зміни у файлах вхідних даних\n"
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+"  l   виводити поточний номер рядка вхідних даних\n"
+"  p   показувати результати для пошуків шляху\n"
+"  q   вказувати, що значення є обов'язковими, з прапорцем a або e\n"
+"  t   трасувати усі виклики макросів, не лише з traceon\n"
+"  x   додавати унікальний ідентифікатор виклику макросу, корисно із "
+"прапорцем c\n"
+"  V   скорочення для усіх вказаних вище прапорців\n"
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+"Якщо її визначено, змінна середовища M4PATH є списком відокремлених\n"
+"двокрапкою каталогів, які включено після будь-яких, вказаних з «-I».\n"
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+"Станом виходу є 0 для успіху, 1 для помилки, 63 для невідповідності версії\n"
+"файла заморожування або будь-яке значення, яке передано макросу m4exit.\n"
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+"виявлено внутрішню помилку; будь ласка, повідомте про цю ваду на адресу <%s>"
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr "попередження: «m4 -%c» може бути вилучено у наступних випусках"
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr "попередження: «m4 %s» є застарілим"
+
+#: src/m4.c:572
+#, c-format
+msgid "bad debug flags: `%s'"
+msgstr "помилкові прапорці діагностики: «%s»"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr "попередження: «m4 -e» вважається застарілим, користуйтеся «-i»"
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr "stderr"
+
+#: src/macro.c:196
+msgid "ERROR: end of file in argument list"
+msgstr "ПОМИЛКА: символ кінця файла у списку аргументів"
+
+#: src/macro.c:332
+#, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr ""
+"перевищено обмеження на кількість рекурсій у %d, скористайтеся -L<N>, щоб "
+"змінити обмеження"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+msgid "cannot clean temporary file for diversion"
+msgstr "не вдалося спорожнити тимчасовий файл для відхилення"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+msgid "cannot create temporary file for diversion"
+msgstr "не вдалося створити тимчасовий файл для відхилення"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+msgid "cannot seek within diversion"
+msgstr "не вдалося виконати позиціювання у відхиленні"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+msgid "cannot close temporary file for diversion"
+msgstr "не вдалося закрити тимчасовий файл для відхилення"
+
+#: src/output.c:474
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "ПОМИЛКА: не вдалося спорожнити відхилення для тимчасового файла"
+
+#: src/output.c:568
+msgid "ERROR: copying inserted file"
+msgstr "ПОМИЛКА: копіюємо вставлений файл"
+
+#: src/output.c:816
+msgid "error reading inserted file"
+msgstr "помилка під час спроби читання вставленого файла"
+
+#: src/output.c:983
+msgid "cannot stat diversion"
+msgstr "не вдалося статистично обробити відхилення"
+
+#: src/output.c:987
+msgid "diversion too large"
+msgstr "надто велике відхилення"
diff --git a/po/vi.gmo b/po/vi.gmo
new file mode 100644 (file)
index 0000000..b893a60
Binary files /dev/null and b/po/vi.gmo differ
diff --git a/po/vi.po b/po/vi.po
new file mode 100644 (file)
index 0000000..dbbe638
--- /dev/null
+++ b/po/vi.po
@@ -0,0 +1,1343 @@
+#  Vietnamese Translation for m4-1.4o.
+#  Copyright (C) 2005 Free Software Foundation, Inc.
+#  Clytie Siddall <clytie@riverland.net.au>, 2005.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2005-02-11 20:51+1030\n"
+"Last-Translator: Clytie Siddall <clytie@riverland.net.au>\n"
+"Language-Team: Vietnamese <gnomevi-list@lists.sourceforge.net> \n"
+"Language: vi\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "LỖI: không tạo được tập tin tạm thời đối với sự trệch đi"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "Không lập được tập tin lỗi: %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s: tùy chọn `%s' mơ hồ\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s: tùy chọn `%s' mơ hồ\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s: không chấp nhận tùy chọn `%c%s'\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s: tùy chọn `%c%s' không cho phép đối số\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s: tùy chọn `%s' cần đến đối số\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s: tùy chọn không hợp lệ -- %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s: tùy chọn cần đến đối số -- %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "hết bộ nhớ"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "Thành công"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "Không khớp với gì"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "Biểu thức chính quy không hợp lệ"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "Ký tự đối hợp không hợp lệ"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "Tên loại ký tự không hợp lệ"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "Xuyệc ngược theo sau"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "Tham chiếu quay lui không hợp lệ"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "Chưa khớp ký tự [ hay [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "Chưa khớp ký tự ( hay \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "Chưa khớp ký tự \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} có nội bộ không hợp lệ"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "Kết thức miền không hợp lệ"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "Hết bộ nhớ"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "Biểu thức chính quy đi trước không hợp lệ"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "Biểu thức chính quy có kết thức quá sớm"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "Biểu thức chính quy quá lớn"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "Chưa khớp ký tự ) hay \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "Không có biểu thức chính quy trước này"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "Giới hạn VMEM bị vượt quá không?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "Giới hạn VMEM bị vượt quá không?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "Chưa định nghĩa tên %s"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "Chưa định nghĩa tên %s"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"Hãy thông báo lỗi cho <bug-m4@gnu.org>.\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "Biểu thức chính quy sai `%s': %s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "Cảnh báo: quá ít đối số đối với `%s' có sẵn"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "Cảnh báo: quá nhiều đối số đối với `%s' có sẵn bị bỏ qua"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "Có đối số không thuộc số đối với `%s' có sẵn"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "Có đối số không thuộc số đối với `%s' có sẵn"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "Chưa định nghĩa tên `%s'"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "Chưa định nghĩa tên `%s'"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "Cảnh báo: quá ít đối số đối với `%s' có sẵn"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "Không mở được đường ống đến lệnh `%s'"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "Eval (việc tính để kiểm tra) có độ dài âm"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "Không thể bỏ việc làm trệch hướng %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "Không thể bỏ việc làm trệch hướng %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "Không mở được %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "LÔI: không đóng được mô-đun: `%s'"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "Chế độ gỡ lỗi: cờ gỡ lỗi sai: `%s'"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "Không lập được tập tin lỗi: %s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "CẢNH BÁO: \\0 sẽ biến mất nên hãy sử dụng \\& khi thay thế"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "Biểu thức chính quy sai `%s': %s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "Gặp lỗi khi khớp với biểu thức chính quy `%s'"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "Biểu thức chính quy sai `%s': %s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr ""
+"Biểu thức sai trong eval (việc tính để kiểm tra) - thiếu ngoặc phải: %s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "Biểu thức sai trong eval (việc tính để kiểm tra): %s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr ""
+"Biểu thức sai trong eval (việc tính để kiểm tra) - dữ liệu nhập sai: %s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr ""
+"Biểu thức sai trong eval (việc tính để kiểm tra) - quá nhiều dữ liệu nhập: %s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "Chia cho số không trong eval (việc tính để kiểm tra): %s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "Chia cho số không trong eval (việc tính để kiểm tra): %s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "Modulo cho số không trong eval (việc tính để kiểm tra): %s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "Biểu thức sai trong eval (việc tính để kiểm tra): %s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "%s có đối số không thuộc số"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s: không chấp nhận tùy chọn `%c%s'\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "Ngờ ký tự ngắt dòng trong tập tin đông lạnh"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "Ngờ ký tự `%c' trong tập tin đông lạnh"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "Ngờ ký tự ngắt dòng trong tập tin đông lạnh"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "Tập tin đông lạnh có kết thức quá sớm"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "Không mở được %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "Tập tin đông lạnh có dạng khuyết tật"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "LỖI: gặp kết thức tập tin trong chuỗi"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "Hãy thử lệnh `%s --help' để tìm thấy thông tin thêm.\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "Cách sử dụng: %s [TÙY_CHỌN]... [TẬP_TIN]...\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"Nếu không có tập tin, hay nếu tập tin là `-', thì đọc dữ liệu nhập chuẩn.\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr ""
+"  -W, --word-regexp=BIỂU_THỨC_CHÍNH_QUY     sử dụng biểu thức chính quy ấy "
+"đối với cú pháp tên bô lệnh thay thế\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"Tính năng tiền xử lý:\n"
+"  -I, --include=THƯ_MỤC      tìm kiếm tập tin include (bao gồm) trong thư "
+"mục này thứ hai\n"
+"  -D, --define=TÊN[=TRỊ_SỐ]    nhập tên ấy có trị số ấy hay là trống (_định "
+"nghĩa_)\n"
+"  -U, --undefine=TÊN          xóa bỏ builtin (có sẵn) tên ấy (_bỏ định "
+"nghĩa_)\n"
+"  -s, --synclines              tạo dòng loại `#line NO \"FILE\"'\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"Điều kiện giới hạn:\n"
+"  -G, --traditional            thu hồi tất cả trình mở rộng GNU (_truyền "
+"thống_)\n"
+"  -H, --hashsize=SỐ_NGUYÊN_TỐ   lập _cỡ_ bảng _băm_ tra cứu ký hiệu\n"
+"  -L, --nesting-limit=SỐ  thay đổi _giới hạn lồng nhau_ nhân tạo\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"Tập tin tình trạng đông lạnh:\n"
+"  -F, --freeze-state=TẬP_TIN      _đông lạnh_ tập tin ấy khi xong (_tình "
+"trạng_)\n"
+"  -R, --reload-state=TẬP_TIN      _tải lại hình trạng_ đông lạnh từ tập tin "
+"ấy khi bắt đầu\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"Gỡ lỗi:\n"
+"  -d, --debug=[CỜ]         lập mức gỡ lỗi (khi không có cờ thì ngụ ý `aeq')\n"
+"  -t, --trace=TÊN            tìm thấy _dấu vết_ tên ấy khi nó sẽ được định "
+"nghĩa\n"
+"  -l, --arglength=SỐ      hạn chế cỡ bộ lệnh thay thế (macro) tìm thấy dấu "
+"vết\n"
+"(_độ dài đối số_)\n"
+"  -o, --error-output=TẬP_TIN          chuyển hướng _xuất_ dữ liệu gỡ _lỗi_\n"
+"và tìm thấy dấu vết\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "Cờ gỡ lỗi sai: `%s'"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "LỖI: gặp kêt thức tâp tin trong danh sách đối số"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "LỖI: giới hạn %d bị vượt quá nên hãy sử dụng -L<N> để thay đổi nó"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "LỖI: không tạo được tập tin tạm thời đối với sự trệch đi"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "LỖI: không tạo được tập tin tạm thời đối với sự trệch đi"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "Không thể gọi tất cả thông tin về (stat) sự trệch đi"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "LỖI: không tạo được tập tin tạm thời đối với sự trệch đi"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "LỖI: không chuyển hết sự trệch đi ra vào tập tin tạm thời"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "LỖI: sao chép tập tin đã chèn"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "LỖI: đọc tập tin đã chèn"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "Không thể gọi tất cả thông tin về (stat) sự trệch đi"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "Sự trệch đi quá lớn"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s: tùy chọn `--%s' không cho phép đối số\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s: không chấp nhận tùy chọn `--%s'\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s: không cho phép tùy chọn -- %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s: tùy chọn `-W %s' mơ hồ\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s: tùy chọn `-W %s' không cho phép đối số\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: loại dữ liệu hiệu bài sai trong define_macro () (định nghĩa "
+#~ "bộ lệnh thay thế)"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "LỖI NỘI BỘ: Chưa tìm điều builtin trong bảng builtin (có sẵn)"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "LỖI NỘI BỘ: loại dữ liệu hiệu bài sai trong m4_dumpdef ()"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "LỖI NỘI BỘ: loại ký hiệu sai trong m4_defn ()"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "Cơ số trong eval (việc tính để kiểm tra) ngoài miền (cơ số = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "Chưa định nghĩa mã cú pháp %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: Chưa tìm builtin (có sẵn) trong bảng builtin. (trace_pre ()) "
+#~ "(tìm thấy dấu vết trước)"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: loại dữ liệu hiệu bài sai (trace_pre ()) (tìm thấy dấu vết "
+#~ "trước)"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "LỖI NỘI BỘ: mã lỗi sai trong evaluate () "
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "LỖI NỘI BỘ: toán tử so sánh sai trong cmp_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: toán tử sử dụng phím tăng tốc là sai trong shift_term ()"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "LỖI NỘI BỘ: toán tử sai trong mult_term ()"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "LỖI NỘI BỘ: chưa tìm built-in (có sẵn) trong bảng builtin"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: loại dữ liệu hiệu bài sai trong freeze_one_symbol () (đông "
+#~ "lạnh một ky tự)"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "`%s' từ tập tin đông lạnh chưa được tìm trong bảng builtin (có sẵn)"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "Dữ liệu nhập trở lại %s, dòng %d"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "Đã đọc dữ liệu nhập từ %s"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "LỖI NỘI BỘ: push-string (đẩy-chuỗi) đệ qui."
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: việc gọi sai đến init_macro_token () (hiệu bàì bộ lệnh thay "
+#~ "thế)"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: lỗi ngăn xếp nhập (input stack) trong next_char () (ký tự tới)"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: lỗi ngăn xếp nhập (input stack) trong peek_input () (hé nhìn "
+#~ "nhâp)"
+
+#~ msgid "NONE"
+#~ msgstr "Không có"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "LỖI: ngăn xếp bị tràn. (Đệ qui định nghĩa có vô hạn không?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "Tất cả đối số bắt buộc hay tùy chọn đối với tùy chọn dài cũng bắt buộc \n"
+#~ "hay tùy chọn đối với tùy chọn ngắn\n"
+#~ "\n"
+#~ "Chế độ thi hành:\n"
+#~ "      --help                   hiển thị _trợ giúp_ này rồi thoát\n"
+#~ "      --version                xuất thông tin _phiên bản_ rồi thoát\n"
+#~ "  -e, --interactive            trừ dữ liệu xuất ra bộ đệm, bỏ qua các "
+#~ "lệnh ngắt (_tương tác_)\n"
+#~ "  -E, --fatal-warnings         thôi thi hành sau khi gặp _cảnh báo_ thứ "
+#~ "nhất (_nghiêm trọng_)\n"
+#~ "  -Q, --quiet, --silent        thu hồi một phần cảnh báo đối với builtin "
+#~ "(có sẵn) (_im_)\n"
+#~ "  -P, --prefix-builtins        buộc _tiền tố_ `m4_' đối với tất cả "
+#~ "builtin (có sẵn)\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Tính năng tải động:\n"
+#~ "  -m, --module-directory=THƯ_MỤC  thêm thư mục ấy vào đường dẫn tìm kiếm "
+#~ "mô-đun\n"
+#~ "  -M, --load-module=MÔ-ĐUN          tải mô-đun động từ dường dẫn "
+#~ "M4MODPATH\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "Những CỜ có thể:\n"
+#~ "  t   tìm thấy dấu vết tất cả việc gọi bô lệnh thay thế (macro),\n"
+#~ "không chỉ loại traceon\n"
+#~ "  a   hiển thị tất cả đối số thật\n"
+#~ "  e   hiển thị dạng mở rộng\n"
+#~ "  q   hiển thị trị số khi cần đến, với cờ a hay e\n"
+#~ "  c   hiển thị trước khi tập hợp (collect), sau khi tập hợp và sau khi "
+#~ "gọi\n"
+#~ "  x   thêm điều nhận biết việc gọi bô lệnh thay thế (macro) độc nhất,\n"
+#~ "có ích với cờ c\n"
+#~ "  f   nói tên tập tin nhập hiện\n"
+#~ "  l   nói số dòng nhập hiện\n"
+#~ "  p   hiển thị kết quả của các việc tìm kiếm đường dẫn\n"
+#~ "  i   hiển thị các sự thay đổi trong những tập tin nhập\n"
+#~ "  V   lời tắt cho tất cả cờ ở trên\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "LỖI: không thêm được thư mục tìm kiếm `%s'"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "LỖI: không thêm được thư mục tìm kiếm `%s': %s"
+
+#~ msgid " (options:"
+#~ msgstr " (tùy chọn:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "LỖI NỘI BỘ: mã sai trong đối số trì hoãn"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: loại hiệu bài sai trong expand_token () (mở rộng hiệu bài)"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: loại hiệu bài sai trong expand_argument () (mở rộng đối số)"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: loại ký hiệu sai trong call_macro () (gọi bộ lệnh thay thế)"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "LỖI: không khởi động mô-đun được: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "LỖI: không tìm được mô-đun: `%s'"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "LỖI: không tìm được mô-đun: `%s': %s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "LỖI: không đóng được mô-đun"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "LỖI: không đóng được mô-đun: %s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "LỖI: không đóng được mô-đun: `%s': %s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "Việc tìm kiếm đường dẫn `%s' thì tìm `%s'"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "Mới phát hiện việc vượt trội giới hạn bộ nhớ (SIGSEGV). \n"
+#~ "Hoặc ngăn xếp bị tràn hoặc có lỗi trong"
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  Kiểm tra đệ qui vô hạn có thê.\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr ""
+#~ "LỖI NỘI BỘ: không cho phép chế độ đối với symbol_lookup () (tra cứu ký "
+#~ "hiệu)"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "Chưa biết tên `%s'\n"
diff --git a/po/zh_CN.gmo b/po/zh_CN.gmo
new file mode 100644 (file)
index 0000000..60dcbed
Binary files /dev/null and b/po/zh_CN.gmo differ
diff --git a/po/zh_CN.po b/po/zh_CN.po
new file mode 100644 (file)
index 0000000..8402cea
--- /dev/null
@@ -0,0 +1,1358 @@
+# m4 的简体中文翻译。
+# This file is distributed under the same license as the m4 package.
+# Copyright (C) 2003, 2008 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Wang Li <charles@linux.net.cn>, 2003.
+# LI Daobing <lidaobing@gmail.com>, 2008.
+# Boyuan Yang <073plan@gmail.com>, 2021.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4.18d\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2021-05-13 15:07-0400\n"
+"Last-Translator: Boyuan Yang <073plan@gmail.com>\n"
+"Language-Team: Chinese (simplified) <i18n-zh@googlegroups.com>\n"
+"Language: zh_CN\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"X-Generator: Poedit 2.4.2\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr "无法找到临时目录,尝试设置 $TMPDIR"
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr "无法使用模板“%s”创建临时目录"
+
+#: lib/clean-temp.c:371
+#, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "无法移除临时目录 %s"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr "关闭文件出错"
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr "写错误"
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr "程序错误"
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr "栈溢出"
+
+#: lib/clean-temp-simple.c:297
+#, c-format
+msgid "cannot remove temporary file %s"
+msgstr "无法移除临时文件 %s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr "未知的系统错误"
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr "%s 子进程失败"
+
+#: lib/getopt.c:278
+#, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s:选项“%s%s”有歧义\n"
+
+#: lib/getopt.c:284
+#, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s:选项“%s%s”有歧义;可能原因:"
+
+#: lib/getopt.c:319
+#, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s:无法识别的选项“%s%s”\n"
+
+#: lib/getopt.c:345
+#, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s:选项“%s%s”不允许带参数\n"
+
+#: lib/getopt.c:360
+#, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s:选项“%s%s”需要一个参数\n"
+
+#: lib/getopt.c:621
+#, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s:无效选项 -- “%c”\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s:选项需要一个参数 -- “%c”\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "内存耗尽"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr "无法记录当前工作目录"
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr "无法返回起始工作目录"
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr "_open_osfhandle 失败"
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr "无法恢复文件描述符 %d:dup2 失败"
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr "‘"
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr "’"
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "成功"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "无匹配"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "无效的正规表达式"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "无效的 collation 字符"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "无效的字符类名"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "末尾的反斜线"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "无效的向后引用"
+
+#: lib/regcomp.c:156
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "[, [^, [:, [.或[= 不匹配"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "不匹配的 ( 或 \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "不匹配的 \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} 的内容无效"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "无效的范围结束"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "内存耗尽"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "无效的前置正规表达式"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "不完整的正规表达式"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "正规表达式过大"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "不匹配的 ) 或 \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "没有上一个正规表达式"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr "挂起"
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr "中断"
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr "退出"
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr "非法指令"
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr "追踪与中断点陷阱"
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr "已放弃"
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr "浮点数例外"
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr "已杀死"
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr "总线错误"
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr "段错误"
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr "断开的管道"
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr "闹钟"
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr "已终止"
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr "紧急的输入输出状态"
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr "停止(信号)"
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr "停止"
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr "继续"
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr "子进程已退出"
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr "停止 (tty 输入)"
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr "停止 (tty 输出)"
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr "I/O 可行"
+
+#: lib/siglist.h:94
+msgid "CPU time limit exceeded"
+msgstr "超出 CPU 时限"
+
+#: lib/siglist.h:97
+msgid "File size limit exceeded"
+msgstr "文件大小超出限制"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr "虚拟计时器超时"
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr "测速评估用的计时器已过期"
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr "窗口已改变"
+
+#: lib/siglist.h:109
+msgid "User defined signal 1"
+msgstr "用户定义信号 1"
+
+#: lib/siglist.h:112
+msgid "User defined signal 2"
+msgstr "用户定义信号 2"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr "EMT 陷阱"
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr "错误的系统调用"
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr "栈失效"
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr "信息请求"
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr "电源失效"
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr "资源丢失"
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr "无法创建管道"
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr "实时信号 %d"
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr "未知信号 %d"
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr "无法显示错误信息"
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr "由 %s (%s) 打包\n"
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr "由 %s 打包\n"
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr "©"
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+"GPLv3+ 许可证: GNU 通用公共许可证第三版或更高版本 <%s>。\n"
+"这是自由软件: 您可自由更改并重新分发它。\n"
+"在法律所允许的范围内,不附带任何担保条款。\n"
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr "作者 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr "作者 %s 和 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr "作者 %s, %s 及 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"作者 %s, %s, %s,\n"
+"及 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"作者 %s, %s, %s,\n"
+"%s, 及 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+"作者 %s, %s, %s,\n"
+"%s, %s, 及 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+"作者 %s, %s, %s,\n"
+"%s, %s, %s, 及 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+"作者 %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"及 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+"作者 %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, 及 %s。\n"
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+"作者 %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, 以及其他人。\n"
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, c-format
+msgid "Report bugs to: %s\n"
+msgstr "请将错误报告给:%s。翻译问题请报告至 <i18n-zh@googlegroups.com>。\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr "请将 %s 错误报告给: %s\n"
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr "%s 主页: <%s>\n"
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr "GNU 软件的通用帮助: <%s>\n"
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr "%s 子进程"
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr "%s 子进程收到了致命信号 %d"
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr "无法进行格式化输出"
+
+#: src/builtin.c:264
+#, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "--warn-macro-sequence:错误的正规表达式“%s”:%s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr "警告:“%s”的定义包含序列“%s”"
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr "为宏“%s”检查 --warn-macro-sequence 时出错"
+
+#: src/builtin.c:388
+#, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "警告:内置宏“%s”的参数不足"
+
+#: src/builtin.c:394
+#, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "警告:忽略内置宏“%s”的额外参数"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, fuzzy, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr "内置宏“%s”的非数值参数"
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "内置宏“%s”的非数值参数"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr "在内置“%s”中忽略行首空白符号"
+
+#: src/builtin.c:435
+#, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "在内置“%s”中探测到数值溢出"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr "警告:%s:忽略无效的宏名称"
+
+#: src/builtin.c:752 src/builtin.c:864
+#, c-format
+msgid "undefined macro `%s'"
+msgstr "未定义的宏“%s”"
+
+#: src/builtin.c:823
+#, c-format
+msgid "undefined builtin `%s'"
+msgstr "未定义的内置“%s”"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, fuzzy, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr "%s: 不支持嵌套条件"
+
+#: src/builtin.c:918
+#, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "警告:无法连接内置“%s”"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, c-format
+msgid "cannot run command `%s'"
+msgstr "无法运行命令“%s”"
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr "无法读取管道"
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, c-format
+msgid "negative width to builtin `%s'"
+msgstr "内置“%s”的负宽度"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "无法反转换 %s"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "无法反转换 %s"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, c-format
+msgid "cannot open `%s'"
+msgstr "无法打开“%s”"
+
+#: src/builtin.c:1429
+#, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "%s:无法创建临时文件“%s”"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr "推荐使用 mkstemp 作为替代"
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr "退出状态码超出范围:“%d”"
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "调试模式:错误的调试标志:“%s”"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, c-format
+msgid "cannot set debug file `%s'"
+msgstr "无法设置调试文件“%s”"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "警告:\\\\0 将消失,用 \\\\& 作为替代"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "错误的正规表达式“%s”:%s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, c-format
+msgid "error matching regular expression `%s'"
+msgstr "匹配正规表达式“%s”出错"
+
+#: src/builtin.c:2139 src/input.c:792
+#, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "错误的正规表达式“%s”:%s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr "写入调试流出错"
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "求值错误的表达式 (缺少右括号):%s"
+
+#: src/eval.c:324
+#, c-format
+msgid "bad expression in eval: %s"
+msgstr "求值中出现错误的表达式:%s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "求值错误的表达式 (错误的输入):%s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "求值错误的表达式 (过多的输入):%s"
+
+#: src/eval.c:339
+#, c-format
+msgid "invalid operator in eval: %s"
+msgstr "求值中出现无效操作符:%s"
+
+#: src/eval.c:345
+#, c-format
+msgid "divide by zero in eval: %s"
+msgstr "求值中出现除以零:%s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "求值中按零取模:%s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "求值错误的表达式:%s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr "警告:推荐使用 == 而不是 = 作为相等操作符"
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "%s 的非数值参数"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr "已忽略行首空白字符"
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr "探测到数值溢出"
+
+#: src/format.c:308
+#, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "警告:“%s”中无法识别的说明符"
+
+#: src/freeze.c:156
+#, fuzzy
+msgid "unable to create frozen state"
+msgstr "无法在服务器上创建进程"
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "在冻结文件中应为换行符"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "在冻结文件中应为字符“%c”"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "整数溢出"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "不完整的冻结文件"
+
+#: src/freeze.c:270
+#, c-format
+msgid "cannot open %s"
+msgstr "无法打开 %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "冻结文件的格式错误"
+
+#: src/freeze.c:385
+#, fuzzy
+msgid "unable to read frozen state"
+msgstr "无法释放参数"
+
+#: src/input.c:359
+msgid "read error"
+msgstr "写错误"
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr "读取文件出错"
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr "警告:EOF 视为新行"
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr "错误:注释中的 EOF"
+
+#: src/input.c:1001
+msgid "ERROR: end of file in string"
+msgstr "错误:字符串中的 EOF"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr "Rene' Seindal"
+
+#: src/m4.c:207
+#, c-format
+msgid "Try `%s --help' for more information."
+msgstr "尝试使用“%s --help”以获取更多信息。"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "用法:%s [选项]... [文件]...\n"
+
+#: src/m4.c:214
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"处理给定文件中的宏。如果未给定文件列表或“文件”为“-”,\n"
+"则从标准输入中读取。\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr "长选项的强制或可选参数对对应的短选项也是强制或可选的。\n"
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+"操作模式:\n"
+"      --help                   显示本帮助信息并退出\n"
+"      --version                输出版本信息并退出。\n"
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr "  -W, --word-regexp=正规表达式      将“正规表达式”作为宏名的语法\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"预处理器特征:\n"
+"  -I, --include=目录           在此目录中搜索引入文件\n"
+"  -D, --define=名字[=值]       将“名字”的值定义为“值”或空\n"
+"  -U, --undefine=名字          删除内置宏“名字”\n"
+"  -s, --synclines              生成 “#line NO \"FILE\"” 行\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"限止控制:\n"
+"  -G, --traditional            关闭所有 GNU 扩展\n"
+"  -H, --hashsize=PRIME         设置符号搜索杂凑表的大小\n"
+"  -L, --nesting-limit=NUMBER   改变手工嵌套限制\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"冻结状态文件:\n"
+"  -F, --freeze-state=文件      在结束时在“文件”中生成冻结状态\n"
+"  -R, --reload-state=文件      在启动是从“文件”中重新装入冻结状态\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"调试:\n"
+"  -d, --debug=[标志]           设定调试级别 (无“标志”表示“aeq”)\n"
+"  -t, --trace=名字             在定义了“名字”的时候跟踪它\n"
+"  -l, --arglength=长度         限止宏跟踪大小\n"
+"  -o, --error-output=文件      重定向调试和跟踪输出\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr "探测到内部错误:请将本问题报告至 <%s>"
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr "警告:“m4 -%c”可能在未来的版本中移除"
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr "警告:“m4 %s”已弃用"
+
+#: src/m4.c:572
+#, c-format
+msgid "bad debug flags: `%s'"
+msgstr "错误的调试标志:“%s”"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr "警告:“m4 -e”已弃用,请使用“-i”作为替代"
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+msgid "ERROR: end of file in argument list"
+msgstr "错误:参数列表中出现 EOF"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "错误:超出递归上限 %d,使用 -L<N> 以改变此上限"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "错误:无法为转换创建临时文件"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "错误:无法为转换创建临时文件"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "无法获取转换的状态"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "错误:无法为转换创建临时文件"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "错误:无法将转换刷新到临时文件"
+
+#: src/output.c:568
+msgid "ERROR: copying inserted file"
+msgstr "错误:复制已插入的文件"
+
+#: src/output.c:816
+msgid "error reading inserted file"
+msgstr "读取已插入的文件出错"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "无法获取转换的状态"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "转换过大"
+
+#~ msgid "%s: option `%s' is ambiguous\n"
+#~ msgstr "%s:选项“%s”有二义性\n"
+
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s:选项“--%s”不接受参数\n"
+
+#~ msgid "%s: option `%c%s' doesn't allow an argument\n"
+#~ msgstr "%s:选项“%c%s”不接受参数\n"
+
+#~ msgid "%s: option `%s' requires an argument\n"
+#~ msgstr "%s:选项“%s”需要一个参数\n"
+
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s:无法识别的选项“--%s”\n"
+
+#, fuzzy
+#~ msgid "%s: unrecognized option `%c%s'\n"
+#~ msgstr "%s:无法识别的选项“--%s”\n"
+
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s:非法的选项 -- %c\n"
+
+#~ msgid "%s: invalid option -- %c\n"
+#~ msgstr "%s:无效的选项 -- %c\n"
+
+#~ msgid "%s: option requires an argument -- %c\n"
+#~ msgstr "%s:选项需要一个参数 -- %c\n"
+
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s:选项“-W %s”有二义性\n"
+
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s:选项“-W %s”不接受参数\n"
+
+#~ msgid "Unmatched [ or [^"
+#~ msgstr "不匹配的 [ 或 [^"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "内部错误:define_marco () 中错误的标记数据类型"
+
+#~ msgid "Undefined name %s"
+#~ msgstr "未定义的名称 %s"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "内部错误:在内置宏表中找不到内置宏!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "内部错误:m4_dumpdef () 中错误的标记数据类型"
+
+#, fuzzy
+#~ msgid "Undefined name `%s'"
+#~ msgstr "未定义的名称 %s"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "内部错误:m4_defn () 中的错误符号类型"
+
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "求值中根超出范围 (根 = %d)"
+
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "未定义的语法编码 %c"
+
+#~ msgid "Cannot open %s"
+#~ msgstr "无法打开 %s"
+
+#~ msgid "Cannot set error file: %s"
+#~ msgstr "无法设置错误文件:%s"
+
+#, fuzzy
+#~ msgid "Bad regular expression `%s': %s"
+#~ msgstr "错误的正规表达式“%s”:%s"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr "内部错误:在内置宏表中找不到内置宏!(trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "内部错误:错误的标记数据类型 (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "内部错误:evaluate () 中错误的错误码"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "内部错误:cmp_term () 中错误的比较操作"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "内部错误:shift_term () 中错误的位移操作"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "内部错误:mult_term () 中错误的操作"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "内部错误:内置宏表中找不到内置宏!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "内部错误:freeze_one_symbol () 中错误的标记数据类型"
+
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "在内置宏表中找不到来自冻结文件的“%s”!"
+
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "输入退回到 %s 的第 %d 行"
+
+#~ msgid "Input read from %s"
+#~ msgstr "从 %s 中读取输入"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "内部错误:递归地 push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "内部错误:错误地调用 init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "内部错误:next_char () 中输入栈出错"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "内部错误:peek_input () 中输入栈出错"
+
+#~ msgid "NONE"
+#~ msgstr "无"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "错误:栈溢出。(无穷的定义递归?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "必须给出或可选的长选项对应的短选项同样是必须给出或可选的。\n"
+#~ "\n"
+#~ "操作模式:\n"
+#~ "      --help                   显示该求助信息并退出\n"
+#~ "      --version                输出版本信息并退出\n"
+#~ "  -e, --interactive            不缓冲输出,忽略中段\n"
+#~ "  -E, --fatal-warnings         在第一个警告后中止执行\n"
+#~ "  -Q, --quiet, --silent        关闭关于内置宏的某些警告\n"
+#~ "  -P, --prefix-builtins        为所有内置宏强制添加前缀“m4_”\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "动态加载特征:\n"
+#~ "  -m, --module-directory=目录       将“目录”添加到模块搜索路径中\n"
+#~ "  -M, --load-module=模块            从路径 M4MODPATH 中装入“模块”\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "“标志”是以下字符之一:\n"
+#~ "  t   跟踪所有的宏调用,而不仅仅是标为要跟踪的宏\n"
+#~ "  a   显示实际的参数\n"
+#~ "  e   显示扩展\n"
+#~ "  q   带 a 或 e 标志,按需要引用值\n"
+#~ "  c   在收集之前、收集之后和调用之后显示\n"
+#~ "  x   添加一个唯一的宏调用标识,使用 c 标志时有用\n"
+#~ "  f   输出当前输入文件名\n"
+#~ "  l   输出当前输入行行号\n"
+#~ "  p   显示路径搜索结果\n"
+#~ "  i   显示输入文件中的变化\n"
+#~ "  V   所有以上标志的缩写\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Report bugs to <bug-m4@gnu.org>.\n"
+#~ msgstr ""
+#~ "\n"
+#~ "将错误报告到 <bug-m4@gnu.org>。\n"
+
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "错误:添加搜索目录“%s”失败"
+
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "错误:添加搜索目录“%s”失败:%s"
+
+#~ msgid " (options:"
+#~ msgstr " (选项:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "内部错误:延迟参数中错误的代码"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "内部错误:expand_token () 中错误的标记类型"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "内部错误:expand_argument () 中错误的标记类型"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "内部错误:call_macro () 中错误的符号类型"
+
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "错误:初始化模块失败:%s"
+
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "错误:无法找到模块:“%s”"
+
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "错误:无法找到模块:“%s”:%s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "错误:无法关闭模块"
+
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "错误:无法关闭模块:%s"
+
+#~ msgid "ERROR: cannot close module: `%s'"
+#~ msgstr "错误:无法关闭模块:“%s”"
+
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "错误:无法关闭模块:“%s”:%s"
+
+#, fuzzy
+#~ msgid "ERROR: Cannot create temporary file for diversion"
+#~ msgstr "错误:无法为转换创建临时文件"
+
+#, fuzzy
+#~ msgid "ERROR: Reading inserted file"
+#~ msgstr "错误:复制已插入的文件"
+
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "搜索“%s”的路径找到“%s”"
+
+#~ msgid "VMEM limit exceeded?\n"
+#~ msgstr "超出 VMEM 限止?\n"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "检测到内存超界 (SIGSEGV)。\n"
+#~ "栈溢出或有 bug"
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr ".  检查可能的无限递归。\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "内部错误:symbol_lookup () 的非法模式"
+
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "名字“%s”是未知的\n"
diff --git a/po/zh_TW.gmo b/po/zh_TW.gmo
new file mode 100644 (file)
index 0000000..17eee19
Binary files /dev/null and b/po/zh_TW.gmo differ
diff --git a/po/zh_TW.po b/po/zh_TW.po
new file mode 100644 (file)
index 0000000..d59ea00
--- /dev/null
@@ -0,0 +1,1301 @@
+# Traditional Chinese Messages for m4.
+# Copyright (C) 2005 Free Software Foundation, Inc.
+# This file is distributed under the same license as the m4 package.
+# Wei-Lun Chao <bluebat@member.fsf.org>, 2005, 2013.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: m4 1.4o\n"
+"Report-Msgid-Bugs-To: bug-m4@gnu.org\n"
+"POT-Creation-Date: 2021-05-28 13:49-0500\n"
+"PO-Revision-Date: 2013-02-12 23:05+0800\n"
+"Last-Translator: Wei-Lun Chao <bluebat@member.fsf.org>\n"
+"Language-Team: Chinese (traditional) <zh-l10n@linux.org.tw>\n"
+"Language: zh_TW\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Bugs: Report translation errors to the Language-Team address.\n"
+"Plural-Forms: nplurals=1; plural=0;\n"
+
+#: lib/clean-temp.c:235
+#, c-format
+msgid "cannot find a temporary directory, try setting $TMPDIR"
+msgstr ""
+
+#: lib/clean-temp.c:250
+#, c-format
+msgid "cannot create a temporary directory using template \"%s\""
+msgstr ""
+
+#: lib/clean-temp.c:371
+#, fuzzy, c-format
+msgid "cannot remove temporary directory %s"
+msgstr "錯誤:無法建立轉移用的暫時檔案"
+
+#: lib/closein.c:100
+msgid "error closing file"
+msgstr ""
+
+#: lib/closeout.c:122
+msgid "write error"
+msgstr ""
+
+#: lib/c-stack.c:187
+msgid "program error"
+msgstr ""
+
+#: lib/c-stack.c:188
+msgid "stack overflow"
+msgstr ""
+
+#: lib/clean-temp-simple.c:297
+#, fuzzy, c-format
+msgid "cannot remove temporary file %s"
+msgstr "無法設置錯誤檔案:%s"
+
+#: lib/error.c:195
+msgid "Unknown system error"
+msgstr ""
+
+#: lib/execute.c:348 lib/spawn-pipe.c:597 lib/wait-process.c:291
+#: lib/wait-process.c:365
+#, c-format
+msgid "%s subprocess failed"
+msgstr ""
+
+#: lib/getopt.c:278
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous\n"
+msgstr "%s:選項‘%s’不明確\n"
+
+#: lib/getopt.c:284
+#, fuzzy, c-format
+msgid "%s: option '%s%s' is ambiguous; possibilities:"
+msgstr "%s:選項‘%s’不明確\n"
+
+#: lib/getopt.c:319
+#, fuzzy, c-format
+msgid "%s: unrecognized option '%s%s'\n"
+msgstr "%s:無法識別的選項‘%c%s’\n"
+
+#: lib/getopt.c:345
+#, fuzzy, c-format
+msgid "%s: option '%s%s' doesn't allow an argument\n"
+msgstr "%s:選項‘%c%s’不可配合引數使用\n"
+
+#: lib/getopt.c:360
+#, fuzzy, c-format
+msgid "%s: option '%s%s' requires an argument\n"
+msgstr "%s:選項‘%s’需要引數\n"
+
+#: lib/getopt.c:621
+#, fuzzy, c-format
+msgid "%s: invalid option -- '%c'\n"
+msgstr "%s:無效的選項 ─ %c\n"
+
+#: lib/getopt.c:636 lib/getopt.c:682
+#, fuzzy, c-format
+msgid "%s: option requires an argument -- '%c'\n"
+msgstr "%s:選項需要引數 ─ %c\n"
+
+#: lib/obstack.c:338 lib/obstack.c:340 lib/xalloc-die.c:34
+msgid "memory exhausted"
+msgstr "記憶體耗盡"
+
+#: lib/openat-die.c:38
+#, c-format
+msgid "unable to record current working directory"
+msgstr ""
+
+#: lib/openat-die.c:57
+#, c-format
+msgid "failed to return to initial working directory"
+msgstr ""
+
+#: lib/os2-spawn.c:46
+#, c-format
+msgid "_open_osfhandle failed"
+msgstr ""
+
+#: lib/os2-spawn.c:83
+#, c-format
+msgid "cannot restore fd %d: dup2 failed"
+msgstr ""
+
+#. TRANSLATORS:
+#. Get translations for open and closing quotation marks.
+#. The message catalog should translate "`" to a left
+#. quotation mark suitable for the locale, and similarly for
+#. "'".  For example, a French Unicode local should translate
+#. these to U+00AB (LEFT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), and U+00BB (RIGHT-POINTING DOUBLE ANGLE
+#. QUOTATION MARK), respectively.
+#.
+#. If the catalog has no translation, we will try to
+#. use Unicode U+2018 (LEFT SINGLE QUOTATION MARK) and
+#. Unicode U+2019 (RIGHT SINGLE QUOTATION MARK).  If the
+#. current locale is not Unicode, locale_quoting_style
+#. will quote 'like this', and clocale_quoting_style will
+#. quote "like this".  You should always include translations
+#. for "`" and "'" even if U+2018 and U+2019 are appropriate
+#. for your locale.
+#.
+#. If you don't know what to put here, please see
+#. <https://en.wikipedia.org/wiki/Quotation_marks_in_other_languages>
+#. and use glyphs suitable for your language.
+#: lib/quotearg.c:355
+msgid "`"
+msgstr ""
+
+#: lib/quotearg.c:356
+msgid "'"
+msgstr ""
+
+#: lib/regcomp.c:135
+msgid "Success"
+msgstr "成功"
+
+#: lib/regcomp.c:138
+msgid "No match"
+msgstr "沒有符合的字串"
+
+#: lib/regcomp.c:141
+msgid "Invalid regular expression"
+msgstr "無效的正規表示式"
+
+#: lib/regcomp.c:144
+msgid "Invalid collation character"
+msgstr "無效的 collation 字元"
+
+#: lib/regcomp.c:147
+msgid "Invalid character class name"
+msgstr "無效的字元種類名稱"
+
+#: lib/regcomp.c:150
+msgid "Trailing backslash"
+msgstr "末端有多餘的反斜號"
+
+#: lib/regcomp.c:153
+msgid "Invalid back reference"
+msgstr "無效的 back reference"
+
+#: lib/regcomp.c:156
+#, fuzzy
+msgid "Unmatched [, [^, [:, [., or [="
+msgstr "沒有對應的 [ 或 [^"
+
+#: lib/regcomp.c:159
+msgid "Unmatched ( or \\("
+msgstr "沒有對應的 ( 或 \\("
+
+#: lib/regcomp.c:162
+msgid "Unmatched \\{"
+msgstr "沒有對應的 \\{"
+
+#: lib/regcomp.c:165
+msgid "Invalid content of \\{\\}"
+msgstr "\\{\\} 中的內容無效"
+
+#: lib/regcomp.c:168
+msgid "Invalid range end"
+msgstr "範圍末端字元無效"
+
+#: lib/regcomp.c:171
+msgid "Memory exhausted"
+msgstr "記憶體耗盡"
+
+#: lib/regcomp.c:174
+msgid "Invalid preceding regular expression"
+msgstr "之前的正規表示式無效"
+
+#: lib/regcomp.c:177
+msgid "Premature end of regular expression"
+msgstr "正規表示式過早結束"
+
+#: lib/regcomp.c:180
+msgid "Regular expression too big"
+msgstr "正規表示式過長"
+
+#: lib/regcomp.c:183
+msgid "Unmatched ) or \\)"
+msgstr "沒有對應的 ) 或 \\)"
+
+#: lib/regcomp.c:676
+msgid "No previous regular expression"
+msgstr "之前沒有任何正規表示式"
+
+#: lib/siglist.h:31
+msgid "Hangup"
+msgstr ""
+
+#: lib/siglist.h:34
+msgid "Interrupt"
+msgstr ""
+
+#: lib/siglist.h:37
+msgid "Quit"
+msgstr ""
+
+#: lib/siglist.h:40
+msgid "Illegal instruction"
+msgstr ""
+
+#: lib/siglist.h:43
+msgid "Trace/breakpoint trap"
+msgstr ""
+
+#: lib/siglist.h:46
+msgid "Aborted"
+msgstr ""
+
+#: lib/siglist.h:49
+msgid "Floating point exception"
+msgstr ""
+
+#: lib/siglist.h:52
+msgid "Killed"
+msgstr ""
+
+#: lib/siglist.h:55
+msgid "Bus error"
+msgstr ""
+
+#: lib/siglist.h:58
+msgid "Segmentation fault"
+msgstr ""
+
+#: lib/siglist.h:61
+msgid "Broken pipe"
+msgstr ""
+
+#: lib/siglist.h:64
+msgid "Alarm clock"
+msgstr ""
+
+#: lib/siglist.h:67
+msgid "Terminated"
+msgstr ""
+
+#: lib/siglist.h:70
+msgid "Urgent I/O condition"
+msgstr ""
+
+#: lib/siglist.h:73
+msgid "Stopped (signal)"
+msgstr ""
+
+#: lib/siglist.h:76
+msgid "Stopped"
+msgstr ""
+
+#: lib/siglist.h:79
+msgid "Continued"
+msgstr ""
+
+#: lib/siglist.h:82
+msgid "Child exited"
+msgstr ""
+
+#: lib/siglist.h:85
+msgid "Stopped (tty input)"
+msgstr ""
+
+#: lib/siglist.h:88
+msgid "Stopped (tty output)"
+msgstr ""
+
+#: lib/siglist.h:91
+msgid "I/O possible"
+msgstr ""
+
+#: lib/siglist.h:94
+#, fuzzy
+msgid "CPU time limit exceeded"
+msgstr "超過 VMEM 限制?\n"
+
+#: lib/siglist.h:97
+#, fuzzy
+msgid "File size limit exceeded"
+msgstr "超過 VMEM 限制?\n"
+
+#: lib/siglist.h:100
+msgid "Virtual timer expired"
+msgstr ""
+
+#: lib/siglist.h:103
+msgid "Profiling timer expired"
+msgstr ""
+
+#: lib/siglist.h:106
+msgid "Window changed"
+msgstr ""
+
+#: lib/siglist.h:109
+#, fuzzy
+msgid "User defined signal 1"
+msgstr "未定義的名稱 %s"
+
+#: lib/siglist.h:112
+#, fuzzy
+msgid "User defined signal 2"
+msgstr "未定義的名稱 %s"
+
+#: lib/siglist.h:117
+msgid "EMT trap"
+msgstr ""
+
+#: lib/siglist.h:120
+msgid "Bad system call"
+msgstr ""
+
+#: lib/siglist.h:123
+msgid "Stack fault"
+msgstr ""
+
+#: lib/siglist.h:126
+msgid "Information request"
+msgstr ""
+
+#: lib/siglist.h:128
+msgid "Power failure"
+msgstr ""
+
+#: lib/siglist.h:131
+msgid "Resource lost"
+msgstr ""
+
+#: lib/spawn-pipe.c:217 lib/spawn-pipe.c:220 lib/spawn-pipe.c:459
+#: lib/spawn-pipe.c:462
+#, c-format
+msgid "cannot create pipe"
+msgstr ""
+
+#: lib/strsignal.c:114
+#, c-format
+msgid "Real-time signal %d"
+msgstr ""
+
+#: lib/strsignal.c:118
+#, c-format
+msgid "Unknown signal %d"
+msgstr ""
+
+#: lib/verror.c:76
+#, c-format
+msgid "unable to display error message"
+msgstr ""
+
+#: lib/version-etc.c:73
+#, c-format
+msgid "Packaged by %s (%s)\n"
+msgstr ""
+
+#: lib/version-etc.c:76
+#, c-format
+msgid "Packaged by %s\n"
+msgstr ""
+
+#. TRANSLATORS: Translate "(C)" to the copyright symbol
+#. (C-in-a-circle), if this symbol is available in the user's
+#. locale.  Otherwise, do not translate "(C)"; leave it as-is.
+#: lib/version-etc.c:83
+msgid "(C)"
+msgstr ""
+
+#. TRANSLATORS: The %s placeholder is the web address of the GPL license.
+#: lib/version-etc.c:88
+#, c-format
+msgid ""
+"License GPLv3+: GNU GPL version 3 or later <%s>.\n"
+"This is free software: you are free to change and redistribute it.\n"
+"There is NO WARRANTY, to the extent permitted by law.\n"
+msgstr ""
+
+#. TRANSLATORS: %s denotes an author name.
+#: lib/version-etc.c:105
+#, c-format
+msgid "Written by %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:109
+#, c-format
+msgid "Written by %s and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#: lib/version-etc.c:113
+#, c-format
+msgid "Written by %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:120
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:127
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:134
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:142
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:150
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:159
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, and %s.\n"
+msgstr ""
+
+#. TRANSLATORS: Each %s denotes an author name.
+#. You can use line breaks, estimating that each author name occupies
+#. ca. 16 screen columns and that a screen line has ca. 80 columns.
+#: lib/version-etc.c:170
+#, c-format
+msgid ""
+"Written by %s, %s, %s,\n"
+"%s, %s, %s, %s,\n"
+"%s, %s, and others.\n"
+msgstr ""
+
+#. TRANSLATORS: The placeholder indicates the bug-reporting address
+#. for this package.  Please add _another line_ saying
+#. "Report translation bugs to <...>\n" with the address for translation
+#. bugs (typically your translation team's web or email address).
+#: lib/version-etc.c:249
+#, fuzzy, c-format
+msgid "Report bugs to: %s\n"
+msgstr ""
+"\n"
+"請向 <bug-m4@gnu.org> 回報錯誤。\n"
+
+#: lib/version-etc.c:251
+#, c-format
+msgid "Report %s bugs to: %s\n"
+msgstr ""
+
+#: lib/version-etc.c:255 lib/version-etc.c:257
+#, c-format
+msgid "%s home page: <%s>\n"
+msgstr ""
+
+#: lib/version-etc.c:260
+#, c-format
+msgid "General help using GNU software: <%s>\n"
+msgstr ""
+
+#: lib/wait-process.c:232 lib/wait-process.c:264 lib/wait-process.c:326
+#, c-format
+msgid "%s subprocess"
+msgstr ""
+
+#: lib/wait-process.c:283 lib/wait-process.c:355
+#, c-format
+msgid "%s subprocess got fatal signal %d"
+msgstr ""
+
+#: lib/xprintf.c:50 lib/xprintf.c:76
+#, c-format
+msgid "cannot perform formatted output"
+msgstr ""
+
+#: src/builtin.c:264
+#, fuzzy, c-format
+msgid "--warn-macro-sequence: bad regular expression `%s': %s"
+msgstr "不當的正規表示式「%s」:%s"
+
+#: src/builtin.c:320
+#, c-format
+msgid "Warning: definition of `%s' contains sequence `%s'"
+msgstr ""
+
+#: src/builtin.c:327
+#, c-format
+msgid "error checking --warn-macro-sequence for macro `%s'"
+msgstr ""
+
+#: src/builtin.c:388
+#, fuzzy, c-format
+msgid "Warning: too few arguments to builtin `%s'"
+msgstr "警告:內建「%s」的引數太少"
+
+#: src/builtin.c:394
+#, fuzzy, c-format
+msgid "Warning: excess arguments to builtin `%s' ignored"
+msgstr "警告:內建「%s」的超額引數被忽略"
+
+#: src/builtin.c:415 src/builtin.c:1114
+#, c-format
+msgid "empty string treated as 0 in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:425 src/builtin.c:1243
+#, fuzzy, c-format
+msgid "non-numeric argument to builtin `%s'"
+msgstr "提供了非數值引數給內建「%s」"
+
+#: src/builtin.c:431
+#, c-format
+msgid "leading whitespace ignored in builtin `%s'"
+msgstr ""
+
+#: src/builtin.c:435
+#, fuzzy, c-format
+msgid "numeric overflow detected in builtin `%s'"
+msgstr "提供了非數值引數給內建「%s」"
+
+#: src/builtin.c:552 src/builtin.c:815 src/builtin.c:856
+#, c-format
+msgid "Warning: %s: invalid macro name ignored"
+msgstr ""
+
+#: src/builtin.c:752 src/builtin.c:864
+#, fuzzy, c-format
+msgid "undefined macro `%s'"
+msgstr "未定義的名稱「%s」"
+
+#: src/builtin.c:823
+#, fuzzy, c-format
+msgid "undefined builtin `%s'"
+msgstr "未定義的名稱「%s」"
+
+#: src/builtin.c:914 src/builtin.c:2208
+#, c-format
+msgid "builtin `%s' requested by frozen file is not supported"
+msgstr ""
+
+#: src/builtin.c:918
+#, fuzzy, c-format
+msgid "Warning: cannot concatenate builtin `%s'"
+msgstr "警告:內建「%s」的引數太少"
+
+#: src/builtin.c:978 src/builtin.c:1015 src/builtin.c:1028 src/builtin.c:1063
+#, fuzzy, c-format
+msgid "cannot run command `%s'"
+msgstr "無法開啟至命令「%s」 的管道."
+
+#: src/builtin.c:1051
+msgid "cannot read pipe"
+msgstr ""
+
+#: src/builtin.c:1098
+#, c-format
+msgid "radix %d in builtin `%s' out of range"
+msgstr ""
+
+#: src/builtin.c:1108
+#, fuzzy, c-format
+msgid "negative width to builtin `%s'"
+msgstr "求值寬度為負"
+
+#: src/builtin.c:1252
+#, fuzzy, c-format
+msgid "error undiverting `%s'"
+msgstr "無法反向轉移「%s」"
+
+#: src/builtin.c:1256
+#, fuzzy, c-format
+msgid "cannot undivert `%s'"
+msgstr "無法反向轉移「%s」"
+
+#: src/builtin.c:1366 src/freeze.c:115 src/m4.c:379
+#, fuzzy, c-format
+msgid "cannot open `%s'"
+msgstr "無法開啟 %s"
+
+#: src/builtin.c:1429
+#, fuzzy, c-format
+msgid "%s: cannot create tempfile `%s'"
+msgstr "錯誤:無法關閉模組:「%s」"
+
+#: src/builtin.c:1464
+msgid "recommend using mkstemp instead"
+msgstr ""
+
+#: src/builtin.c:1557
+#, c-format
+msgid "exit status out of range: `%d'"
+msgstr ""
+
+#: src/builtin.c:1681
+#, c-format
+msgid "Debugmode: bad debug flags: `%s'"
+msgstr "除錯模式:不當的除錯旗標:「%s」"
+
+#: src/builtin.c:1722 src/m4.c:625 src/m4.c:689
+#, fuzzy, c-format
+msgid "cannot set debug file `%s'"
+msgstr "無法設置錯誤檔案:%s"
+
+#: src/builtin.c:1988
+#, fuzzy
+msgid "Warning: \\0 will disappear, use \\& instead in replacements"
+msgstr "警告:\\0 將會消失,請於置換時使用 \\& 代替"
+
+#: src/builtin.c:2004
+#, c-format
+msgid "Warning: sub-expression %d not present"
+msgstr ""
+
+#: src/builtin.c:2013
+msgid "Warning: trailing \\ ignored in replacement"
+msgstr ""
+
+#: src/builtin.c:2079
+#, fuzzy, c-format
+msgid "bad regular expression: `%s': %s"
+msgstr "不當的正規表示式「%s」:%s"
+
+#: src/builtin.c:2091 src/builtin.c:2161
+#, fuzzy, c-format
+msgid "error matching regular expression `%s'"
+msgstr "對應正規表示式「%s」時出現錯誤"
+
+#: src/builtin.c:2139 src/input.c:792
+#, fuzzy, c-format
+msgid "bad regular expression `%s': %s"
+msgstr "不當的正規表示式「%s」:%s"
+
+#: src/debug.c:136 src/debug.c:157
+msgid "error writing to debug stream"
+msgstr ""
+
+#: src/eval.c:318
+#, fuzzy, c-format
+msgid "bad expression in eval (missing right parenthesis): %s"
+msgstr "求值時不當的表示式 (缺少右側括號):%s"
+
+#: src/eval.c:324
+#, fuzzy, c-format
+msgid "bad expression in eval: %s"
+msgstr "求值時不當的表示式:%s"
+
+#: src/eval.c:329
+#, fuzzy, c-format
+msgid "bad expression in eval (bad input): %s"
+msgstr "求值時不當的表示式 (不當的輸入):%s"
+
+#: src/eval.c:334
+#, fuzzy, c-format
+msgid "bad expression in eval (excess input): %s"
+msgstr "求值時不當的表示式 (超額的輸入):%s"
+
+#: src/eval.c:339
+#, fuzzy, c-format
+msgid "invalid operator in eval: %s"
+msgstr "求值時被零除:%s"
+
+#: src/eval.c:345
+#, fuzzy, c-format
+msgid "divide by zero in eval: %s"
+msgstr "求值時被零除:%s"
+
+#: src/eval.c:350
+#, fuzzy, c-format
+msgid "modulo by zero in eval: %s"
+msgstr "求值時計算除以零的餘數:%s"
+
+#: src/eval.c:355
+#, fuzzy, c-format
+msgid "negative exponent in eval: %s"
+msgstr "求值時不當的表示式:%s"
+
+#: src/eval.c:538
+msgid "Warning: recommend ==, not =, for equality operator"
+msgstr ""
+
+#: src/format.c:40 src/format.c:64 src/format.c:88
+msgid "empty string treated as 0"
+msgstr ""
+
+#: src/format.c:46 src/format.c:70 src/format.c:94
+#, fuzzy, c-format
+msgid "non-numeric argument %s"
+msgstr "%s 的引數非數值"
+
+#: src/format.c:48 src/format.c:72 src/format.c:96
+msgid "leading whitespace ignored"
+msgstr ""
+
+#: src/format.c:50 src/format.c:74 src/format.c:98
+msgid "numeric overflow detected"
+msgstr ""
+
+#: src/format.c:308
+#, fuzzy, c-format
+msgid "Warning: unrecognized specifier in `%s'"
+msgstr "%s:無法識別的選項‘%c%s’\n"
+
+#: src/freeze.c:156
+msgid "unable to create frozen state"
+msgstr ""
+
+#: src/freeze.c:167
+#, fuzzy
+msgid "expecting line feed in frozen file"
+msgstr "在凍結的檔案中期待有換列字元"
+
+#: src/freeze.c:169
+#, fuzzy, c-format
+msgid "expecting character `%c' in frozen file"
+msgstr "在凍結的檔案中期待有「%c」字元"
+
+#: src/freeze.c:215
+#, fuzzy
+msgid "integer overflow in frozen file"
+msgstr "在凍結的檔案中期待有換列字元"
+
+#: src/freeze.c:257
+#, fuzzy
+msgid "premature end of frozen file"
+msgstr "凍結檔案突然結束"
+
+#: src/freeze.c:270
+#, fuzzy, c-format
+msgid "cannot open %s"
+msgstr "無法開啟 %s"
+
+#: src/freeze.c:285
+#, c-format
+msgid "frozen file version %d greater than max supported of 1"
+msgstr ""
+
+#: src/freeze.c:288
+msgid "ill-formed frozen file, version directive expected"
+msgstr ""
+
+#: src/freeze.c:297
+#, fuzzy
+msgid "ill-formed frozen file"
+msgstr "不良格式的凍結檔案"
+
+#: src/freeze.c:385
+msgid "unable to read frozen state"
+msgstr ""
+
+#: src/input.c:359
+msgid "read error"
+msgstr ""
+
+#: src/input.c:366
+msgid "error reading file"
+msgstr ""
+
+#: src/input.c:589
+msgid "Warning: end of file treated as newline"
+msgstr ""
+
+#: src/input.c:881
+msgid "ERROR: end of file in comment"
+msgstr ""
+
+#: src/input.c:1001
+#, fuzzy
+msgid "ERROR: end of file in string"
+msgstr "錯誤:字串中有檔尾字元 (EOF)"
+
+#. TRANSLATORS: This is a non-ASCII name: The first name is (with
+#. Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".
+#. This is a proper name. See the gettext manual, section Names.
+#: src/m4.c:41
+msgid "Rene' Seindal"
+msgstr ""
+
+#: src/m4.c:207
+#, fuzzy, c-format
+msgid "Try `%s --help' for more information."
+msgstr "請嘗試執行「%s --help」來獲取更多資訊。\n"
+
+#: src/m4.c:213
+#, c-format
+msgid "Usage: %s [OPTION]... [FILE]...\n"
+msgstr "用法:%s [選項]… [檔案]…\n"
+
+#: src/m4.c:214
+#, fuzzy
+msgid ""
+"Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n"
+"is read.\n"
+msgstr ""
+"\n"
+"如果沒有指定 FILE 或 FILE 是 -,則由標準輸入讀取資料。\n"
+
+#: src/m4.c:219
+msgid ""
+"Mandatory or optional arguments to long options are mandatory or optional\n"
+"for short options too.\n"
+msgstr ""
+
+#: src/m4.c:224
+msgid ""
+"Operation modes:\n"
+"      --help                   display this help and exit\n"
+"      --version                output version information and exit\n"
+msgstr ""
+
+#: src/m4.c:229
+msgid ""
+"  -E, --fatal-warnings         once: warnings become errors, twice: stop\n"
+"                                 execution at first error\n"
+"  -i, --interactive            unbuffer output, ignore interrupts\n"
+"  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+"  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+msgstr ""
+
+#: src/m4.c:236
+#, c-format
+msgid ""
+"      --warn-macro-sequence[=REGEXP]\n"
+"                               warn if macro definition matches REGEXP,\n"
+"                                 default %s\n"
+msgstr ""
+
+#: src/m4.c:242
+msgid "  -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n"
+msgstr "  -W, --word-regexp=REGEXP     使用 REGEXP 做為巨集名稱語法\n"
+
+#: src/m4.c:247
+#, fuzzy
+msgid ""
+"Preprocessor features:\n"
+"  -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n"
+"  -I, --include=DIRECTORY      append DIRECTORY to include path\n"
+"  -s, --synclines              generate `#line NUM \"FILE\"' lines\n"
+"  -U, --undefine=NAME          undefine NAME\n"
+msgstr ""
+"\n"
+"前置處理器特殊功能:\n"
+"  -I, --include=DIRECTORY      搜尋此目錄做為含入的輔助\n"
+"  -D, --define=NAME[=VALUE]    輸入的 NAME 具有 VALUE,或是空值\n"
+"  -U, --undefine=NAME          刪除內建的 NAME\n"
+"  -s, --synclines              產生「#line NO \"FILE\"」的列\n"
+
+#: src/m4.c:255
+#, fuzzy, c-format
+msgid ""
+"Limits control:\n"
+"  -g, --gnu                    override -G to re-enable GNU extensions\n"
+"  -G, --traditional            suppress all GNU extensions\n"
+"  -H, --hashsize=PRIME         set symbol lookup hash table size [509]\n"
+"  -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n"
+msgstr ""
+"\n"
+"限制控制:\n"
+"  -G, --traditional            抑制所有 GNU 擴充功能\n"
+"  -H, --hashsize=PRIME         設定符號查找雜湊表大小\n"
+"  -L, --nesting-limit=NUMBER   改變人造巢狀迴圈限制\n"
+
+#: src/m4.c:263
+#, fuzzy
+msgid ""
+"Frozen state files:\n"
+"  -F, --freeze-state=FILE      produce a frozen state on FILE at end\n"
+"  -R, --reload-state=FILE      reload a frozen state from FILE at start\n"
+msgstr ""
+"\n"
+"凍結狀態檔案:\n"
+"  -F, --freeze-state=FILE      結束時於 FILE 產生凍結狀態\n"
+"  -R, --reload-state=FILE      開始時從 FILE 重新載入凍結狀態\n"
+
+#: src/m4.c:269
+#, fuzzy
+msgid ""
+"Debugging:\n"
+"  -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n"
+"      --debugfile[=FILE]       redirect debug and trace output to FILE\n"
+"                                 (default stderr, discard if empty string)\n"
+"  -l, --arglength=NUM          restrict macro tracing size\n"
+"  -t, --trace=NAME             trace NAME when it is defined\n"
+msgstr ""
+"\n"
+"除錯:\n"
+"  -d, --debug=[FLAGS]          設定除錯層級 (無 FLAGS 則表示「aeq」)\n"
+"  -t, --trace=NAME             當 NAME 將會被定義時追蹤它\n"
+"  -l, --arglength=NUM          限定巨集追蹤大小\n"
+"  -o, --error-output=FILE      重新導向除錯與追蹤的輸出\n"
+
+#: src/m4.c:278
+msgid ""
+"FLAGS is any of:\n"
+"  a   show actual arguments\n"
+"  c   show before collect, after collect and after call\n"
+"  e   show expansion\n"
+"  f   say current input file name\n"
+"  i   show changes in input files\n"
+msgstr ""
+
+#: src/m4.c:286
+msgid ""
+"  l   say current input line number\n"
+"  p   show results of path searches\n"
+"  q   quote values as necessary, with a or e flag\n"
+"  t   trace for all macro calls, not only traceon'ed\n"
+"  x   add a unique macro call id, useful with c flag\n"
+"  V   shorthand for all of the above flags\n"
+msgstr ""
+
+#: src/m4.c:295
+msgid ""
+"If defined, the environment variable `M4PATH' is a colon-separated list\n"
+"of directories included after any specified by `-I'.\n"
+msgstr ""
+
+#: src/m4.c:300
+msgid ""
+"Exit status is 0 for success, 1 for failure, 63 for frozen file version\n"
+"mismatch, or whatever value was passed to the m4exit macro.\n"
+msgstr ""
+
+#: src/m4.c:436
+#, c-format
+msgid "internal error detected; please report this bug to <%s>"
+msgstr ""
+
+#: src/m4.c:489
+#, c-format
+msgid "warning: `m4 -%c' may be removed in a future release"
+msgstr ""
+
+#: src/m4.c:496
+#, c-format
+msgid "warning: `m4 %s' is deprecated"
+msgstr ""
+
+#: src/m4.c:572
+#, fuzzy, c-format
+msgid "bad debug flags: `%s'"
+msgstr "不當的除錯旗標:「%s」"
+
+#: src/m4.c:578
+#, c-format
+msgid "warning: `m4 -e' is deprecated, use `-i' instead"
+msgstr ""
+
+#: src/m4.c:690
+msgid "stderr"
+msgstr ""
+
+#: src/macro.c:196
+#, fuzzy
+msgid "ERROR: end of file in argument list"
+msgstr "錯誤:引數串列中出現檔案結尾(EOF)"
+
+#: src/macro.c:332
+#, fuzzy, c-format
+msgid "recursion limit of %d exceeded, use -L<N> to change it"
+msgstr "錯誤:超出 %d 的遞迴限制,使用 -L<N> 來修正它"
+
+#: src/output.c:172 src/output.c:898 src/output.c:901
+#, fuzzy
+msgid "cannot clean temporary file for diversion"
+msgstr "錯誤:無法建立轉移用的暫時檔案"
+
+#: src/output.c:222 src/output.c:231 src/output.c:265 src/output.c:360
+#, fuzzy
+msgid "cannot create temporary file for diversion"
+msgstr "錯誤:無法建立轉移用的暫時檔案"
+
+#: src/output.c:250 src/output.c:257 src/output.c:269
+#, fuzzy
+msgid "cannot seek within diversion"
+msgstr "無法顯示轉移狀態"
+
+#: src/output.c:341 src/output.c:353 src/output.c:502 src/output.c:733
+#, fuzzy
+msgid "cannot close temporary file for diversion"
+msgstr "錯誤:無法建立轉移用的暫時檔案"
+
+#: src/output.c:474
+#, fuzzy
+msgid "ERROR: cannot flush diversion to temporary file"
+msgstr "錯誤:無法清空轉移資料至暫時檔案"
+
+#: src/output.c:568
+#, fuzzy
+msgid "ERROR: copying inserted file"
+msgstr "錯誤:複製已插入的檔案"
+
+#: src/output.c:816
+#, fuzzy
+msgid "error reading inserted file"
+msgstr "錯誤:讀取已插入的檔案"
+
+#: src/output.c:983
+#, fuzzy
+msgid "cannot stat diversion"
+msgstr "無法顯示轉移狀態"
+
+#: src/output.c:987
+#, fuzzy
+msgid "diversion too large"
+msgstr "轉移資料太大"
+
+#, c-format
+#~ msgid "%s: option `--%s' doesn't allow an argument\n"
+#~ msgstr "%s:選項‘--%s’不可配合引數使用\n"
+
+#, c-format
+#~ msgid "%s: unrecognized option `--%s'\n"
+#~ msgstr "%s:無法識別的選項‘--%s’\n"
+
+#, c-format
+#~ msgid "%s: illegal option -- %c\n"
+#~ msgstr "%s:不合法的選項 ─ %c\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' is ambiguous\n"
+#~ msgstr "%s:選項‘-W %s’不明確\n"
+
+#, c-format
+#~ msgid "%s: option `-W %s' doesn't allow an argument\n"
+#~ msgstr "%s:選項‘-W %s’不可配合引數使用\n"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in define_macro ()"
+#~ msgstr "內部錯誤:define_macro() 中不當的字組資料型態"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table!"
+#~ msgstr "內部錯誤:無法在內建表格中找到內建指令!"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in m4_dumpdef ()"
+#~ msgstr "內部錯誤:m4_dumpdef() 中不當的字組資料型態"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in m4_defn ()"
+#~ msgstr "內部錯誤:m4_defn() 中不當的符號型態"
+
+#, c-format
+#~ msgid "Radix in eval out of range (radix = %d)"
+#~ msgstr "求值時基數超出範圍 (基數 = %d)"
+
+#, c-format
+#~ msgid "Undefined syntax code %c"
+#~ msgstr "未定義的語法碼 %c"
+
+#~ msgid "INTERNAL ERROR: Builtin not found in builtin table! (trace_pre ())"
+#~ msgstr "內部錯誤:無法在內建表格中找到內建指令!(trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad token data type (trace_pre ())"
+#~ msgstr "內部錯誤:不當的字組資料型態 (trace_pre ())"
+
+#~ msgid "INTERNAL ERROR: Bad error code in evaluate ()"
+#~ msgstr "內部錯誤:evaluate () 中不當的錯誤碼"
+
+#~ msgid "INTERNAL ERROR: Bad comparison operator in cmp_term ()"
+#~ msgstr "內部錯誤:cmp_term () 中不當的比較運算子"
+
+#~ msgid "INTERNAL ERROR: Bad shift operator in shift_term ()"
+#~ msgstr "內部錯誤:shift_term () 中不當的位移運算子"
+
+#~ msgid "INTERNAL ERROR: Bad operator in mult_term ()"
+#~ msgstr "內部錯誤:mult_term () 中不當的運算子"
+
+#~ msgid "INTERNAL ERROR: Built-in not found in builtin table!"
+#~ msgstr "內部錯誤:內建表格中無法找到內建指令"
+
+#~ msgid "INTERNAL ERROR: Bad token data type in freeze_one_symbol ()"
+#~ msgstr "內部錯誤:freeze_one_symbol () 中不當的字組資料型態"
+
+#, c-format
+#~ msgid "`%s' from frozen file not found in builtin table!"
+#~ msgstr "來自凍結檔案的「%s」無法在內建表格中找到!"
+
+#, c-format
+#~ msgid "Input reverted to %s, line %d"
+#~ msgstr "輸入還原到 %s,第 %d 列"
+
+#, c-format
+#~ msgid "Input read from %s"
+#~ msgstr "輸入從 %s 讀取"
+
+#~ msgid "INTERNAL ERROR: Recursive push_string!"
+#~ msgstr "內部錯誤:遞迴的 push_string!"
+
+#~ msgid "INTERNAL ERROR: Bad call to init_macro_token ()"
+#~ msgstr "內部錯誤:不當呼叫 init_macro_token ()"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in next_char ()"
+#~ msgstr "內部錯誤:next_char () 中難看的輸入堆疊"
+
+#~ msgid "INTERNAL ERROR: Input stack botch in peek_input ()"
+#~ msgstr "內部錯誤:peek_input () 中難看的輸入堆疊"
+
+#~ msgid "NONE"
+#~ msgstr "NONE"
+
+#~ msgid "ERROR: Stack overflow.  (Infinite define recursion?)"
+#~ msgstr "錯誤:堆疊溢位。(無限的定義迴圈?)"
+
+#~ msgid ""
+#~ "Mandatory or optional arguments to long options are mandatory or "
+#~ "optional\n"
+#~ "for short options too.\n"
+#~ "\n"
+#~ "Operation modes:\n"
+#~ "      --help                   display this help and exit\n"
+#~ "      --version                output version information and exit\n"
+#~ "  -e, --interactive            unbuffer output, ignore interrupts\n"
+#~ "  -E, --fatal-warnings         stop execution after first warning\n"
+#~ "  -Q, --quiet, --silent        suppress some warnings for builtins\n"
+#~ "  -P, --prefix-builtins        force a `m4_' prefix to all builtins\n"
+#~ msgstr ""
+#~ "對於長選項是必要的或是選擇性的引數,也同樣對於短選項是必要的或是選擇性"
+#~ "的。\n"
+#~ "\n"
+#~ "作業模式:\n"
+#~ "      --help                   顯示此輔助訊息並離開\n"
+#~ "      --version                輸出版本資訊並離開\n"
+#~ "  -e, --interactive            輸出不使用緩衝區,忽略插斷訊號\n"
+#~ "  -E, --fatal-warnings         在首次警告之後停止執行\n"
+#~ "  -Q, --quiet, --silent        抑制某些關於內建指令的警告\n"
+#~ "  -P, --prefix-builtins        強迫所有內建指令加上「m4_」前置文字\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "Dynamic loading features:\n"
+#~ "  -m, --module-directory=DIRECTORY  add DIRECTORY to the module search "
+#~ "path\n"
+#~ "  -M, --load-module=MODULE          load dynamic MODULE from M4MODPATH\n"
+#~ msgstr ""
+#~ "\n"
+#~ "動態載入特殊功能:\n"
+#~ "  -m, --module-directory=DIRECTORY  加入 DIRECTORY 至模組搜尋路徑\n"
+#~ "  -M, --load-module=MODULE          從 M4MODPATH 載入動態 MODULE\n"
+
+#~ msgid ""
+#~ "\n"
+#~ "FLAGS is any of:\n"
+#~ "  t   trace for all macro calls, not only traceon'ed\n"
+#~ "  a   show actual arguments\n"
+#~ "  e   show expansion\n"
+#~ "  q   quote values as necessary, with a or e flag\n"
+#~ "  c   show before collect, after collect and after call\n"
+#~ "  x   add a unique macro call id, useful with c flag\n"
+#~ "  f   say current input file name\n"
+#~ "  l   say current input line number\n"
+#~ "  p   show results of path searches\n"
+#~ "  i   show changes in input files\n"
+#~ "  V   shorthand for all of the above flags\n"
+#~ msgstr ""
+#~ "\n"
+#~ "FLAGS 是下列任何組合:\n"
+#~ "  t   追蹤所有巨集呼叫,而非只有被標示追蹤者\n"
+#~ "  a   顯示實際引數\n"
+#~ "  e   顯示展開狀況\n"
+#~ "  q   必要時標示引數值,並加上旗標 a 或 e\n"
+#~ "  c   於收集之前、收集之後與呼叫之後顯示\n"
+#~ "  x   加上獨一的巨集呼叫識別號,常與旗標 c 同時使用\n"
+#~ "  f   指明目前輸入檔案名稱\n"
+#~ "  l   指明目前輸入列號\n"
+#~ "  p   顯示路徑搜尋結果\n"
+#~ "  i   顯示輸入檔案中的變更\n"
+#~ "  V   代表以上所有旗標的簡稱\n"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s'"
+#~ msgstr "錯誤:無法加入搜尋目錄「%s」"
+
+#, c-format
+#~ msgid "ERROR: failed to add search directory `%s': %s"
+#~ msgstr "錯誤:無法加入搜尋目錄「%s」:%s"
+
+#~ msgid " (options:"
+#~ msgstr "(選項:"
+
+#~ msgid "INTERNAL ERROR: Bad code in deferred arguments"
+#~ msgstr "內部錯誤:延遲的引數中有不當的碼"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_token ()"
+#~ msgstr "內部錯誤:expand_token () 中有不當的字組型態"
+
+#~ msgid "INTERNAL ERROR: Bad token type in expand_argument ()"
+#~ msgstr "內部錯誤:expand_argument () 中有不當的字組型態"
+
+#~ msgid "INTERNAL ERROR: Bad symbol type in call_macro ()"
+#~ msgstr "內部錯誤:call_macro () 中有不當的符號型態"
+
+#, c-format
+#~ msgid "ERROR: failed to initialise modules: %s"
+#~ msgstr "錯誤:模組啟始失敗:%s"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s'"
+#~ msgstr "錯誤:無法找到模組:「%s」"
+
+#, c-format
+#~ msgid "ERROR: cannot find module: `%s': %s"
+#~ msgstr "錯誤:無法找到模組:「%s」:%s"
+
+#~ msgid "ERROR: cannot close modules"
+#~ msgstr "錯誤:無法關閉模組"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close modules: %s"
+#~ msgstr "錯誤:無法關閉模組:%s"
+
+#, c-format
+#~ msgid "ERROR: cannot cannot close module: `%s': %s"
+#~ msgstr "錯誤:無法關閉模組:「%s」:%s"
+
+#, c-format
+#~ msgid "Path search for `%s' found `%s'"
+#~ msgstr "對於「%s」的路徑搜尋找到「%s」"
+
+#~ msgid ""
+#~ "Memory bounds violation detected (SIGSEGV).  Either a stack overflow\n"
+#~ "occurred, or there is a bug in "
+#~ msgstr ""
+#~ "偵測到違反記憶體邊界 (SIGSEGV)。可能是發生堆疊溢出,或是有程式錯誤於 "
+
+#~ msgid ".  Check for possible infinite recursion.\n"
+#~ msgstr "。檢查是否有可能的無限迴圈。\n"
+
+#~ msgid "INTERNAL ERROR: Illegal mode to symbol_lookup ()"
+#~ msgstr "內部錯誤:symbol_lookup () 的不正確模式"
+
+#, c-format
+#~ msgid "Name `%s' is unknown\n"
+#~ msgstr "未知的名稱「%s」\n"
index 943d94c..eaf6260 100644 (file)
@@ -1,6 +1,7 @@
 ## Makefile.am - template for generating Makefile via Automake
 ##
-## Copyright (C) 2006-2014, 2016 Free Software Foundation, Inc.
+## Copyright (C) 2006-2014, 2016-2017, 2020-2021 Free Software
+## Foundation, Inc.
 ##
 ## This file is part of GNU M4.
 ##
@@ -15,7 +16,7 @@
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 ##
 ## This file written by Eric Blake <ebb9@byu.net>
 
@@ -27,4 +28,8 @@ bin_PROGRAMS = m4
 noinst_HEADERS = m4.h
 m4_SOURCES = m4.c builtin.c debug.c eval.c format.c freeze.c input.c \
 macro.c output.c path.c symtab.c
-m4_LDADD = ../lib/libm4.a $(LIBM4_LIBDEPS) $(LIBCSTACK) $(LIBTHREAD)
+LDADD = ../lib/libm4.a $(LIBM4_LIBDEPS) \
+  $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) \
+  $(LIB_MBRTOWC) $(LIB_POSIX_SPAWN) $(LIB_SETLOCALE) $(LIB_SETLOCALE_NULL) \
+  $(LIBCSTACK) $(LIBICONV) $(LIBINTL) $(LIBTHREAD) $(LIBUNISTRING) \
+  $(INTL_MACOSX_LIBS)
index 3cd6f83..cb54a3e 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -92,54 +92,69 @@ bin_PROGRAMS = m4$(EXEEXT)
 subdir = src
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
-       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
-       $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/__inline.m4 \
+       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/access.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/arpa_inet_h.m4 \
        $(top_srcdir)/m4/asm-underscore.m4 $(top_srcdir)/m4/assert.m4 \
        $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \
        $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \
-       $(top_srcdir)/m4/canonicalize.m4 \
-       $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
-       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
-       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
-       $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
-       $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirent_h.m4 \
-       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/canonicalize.m4 \
+       $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/clock_time.m4 \
+       $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closedir.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \
+       $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/creat.m4 \
+       $(top_srcdir)/m4/ctype_h.m4 $(top_srcdir)/m4/d-ino.m4 \
+       $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
        $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
-       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
-       $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \
-       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/execute.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eaccess.m4 \
+       $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+       $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+       $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/explicit_bzero.m4 \
        $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \
        $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \
        $(top_srcdir)/m4/extern-inline.m4 \
-       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fclose.m4 \
-       $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl.m4 \
-       $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopen.m4 \
+       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fchdir.m4 \
+       $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+       $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+       $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/fdopendir.m4 \
        $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/findprog-in.m4 $(top_srcdir)/m4/findprog.m4 \
        $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
        $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \
        $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fpurge.m4 \
        $(top_srcdir)/m4/freadahead.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/freopen.m4 \
        $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
        $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
-       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
-       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \
+       $(top_srcdir)/m4/ftell.m4 $(top_srcdir)/m4/ftello.m4 \
+       $(top_srcdir)/m4/ftruncate.m4 \
+       $(top_srcdir)/m4/getcwd-abort-bug.m4 \
+       $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
        $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
        $(top_srcdir)/m4/getpagesize.m4 \
-       $(top_srcdir)/m4/getprogname.m4 \
-       $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
+       $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/getrandom.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
        $(top_srcdir)/m4/gnulib-common.m4 \
        $(top_srcdir)/m4/gnulib-comp.m4 \
-       $(top_srcdir)/m4/hard-locale.m4 \
-       $(top_srcdir)/m4/include_next.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+       $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+       $(top_srcdir)/m4/inline.m4 \
+       $(top_srcdir)/m4/intl-thread-locale.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \
-       $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
-       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isblank.m4 \
-       $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
-       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/langinfo_h.m4 \
+       $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes.m4 \
+       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+       $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/isnand.m4 \
+       $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
+       $(top_srcdir)/m4/iswblank.m4 $(top_srcdir)/m4/iswdigit.m4 \
+       $(top_srcdir)/m4/iswxdigit.m4 $(top_srcdir)/m4/langinfo_h.m4 \
        $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lcmessage.m4 \
        $(top_srcdir)/m4/ldexp.m4 $(top_srcdir)/m4/ldexpl.m4 \
        $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
        $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+       $(top_srcdir)/m4/libunistring-base.m4 \
        $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/link.m4 \
        $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
        $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
@@ -149,61 +164,93 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
        $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
        $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \
+       $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
        $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
-       $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
-       $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/minmax.m4 \
+       $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+       $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
+       $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
+       $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkdir.m4 \
        $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \
        $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
        $(top_srcdir)/m4/msvc-inval.m4 \
        $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
-       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nocrash.m4 \
-       $(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/off_t.m4 \
-       $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/opendir.m4 \
-       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/pipe2.m4 \
-       $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/musl.m4 $(top_srcdir)/m4/nanosleep.m4 \
+       $(top_srcdir)/m4/netinet_in_h.m4 \
+       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/obstack.m4 \
+       $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/open-cloexec.m4 \
+       $(top_srcdir)/m4/open-slash.m4 $(top_srcdir)/m4/open.m4 \
+       $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/opendir.m4 \
+       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perror.m4 \
+       $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/pipe2.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/posix_spawn_faction_addchdir.m4 \
        $(top_srcdir)/m4/printf-frexp.m4 \
        $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \
-       $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quotearg.m4 \
-       $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+       $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/pthread-thread.m4 \
+       $(top_srcdir)/m4/pthread_h.m4 \
+       $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
+       $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \
+       $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/raise.m4 \
+       $(top_srcdir)/m4/rawmemchr.m4 $(top_srcdir)/m4/read-file.m4 \
        $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/readlink.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/reallocarray.m4 \
        $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
-       $(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/sched_h.m4 \
-       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/setenv.m4 \
-       $(top_srcdir)/m4/setlocale.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \
-       $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/rewinddir.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/sched_h.m4 \
+       $(top_srcdir)/m4/sched_yield.m4 \
+       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+       $(top_srcdir)/m4/semaphore.m4 $(top_srcdir)/m4/setenv.m4 \
+       $(top_srcdir)/m4/setlocale.m4 \
+       $(top_srcdir)/m4/setlocale_null.m4 \
+       $(top_srcdir)/m4/sh-filename.m4 \
+       $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/sigaltstack.m4 $(top_srcdir)/m4/signal_h.m4 \
        $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \
        $(top_srcdir)/m4/sigpipe.m4 $(top_srcdir)/m4/size_max.m4 \
        $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/snprintf.m4 \
-       $(top_srcdir)/m4/spawn-pipe.m4 $(top_srcdir)/m4/spawn_h.m4 \
-       $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \
+       $(top_srcdir)/m4/socketlib.m4 $(top_srcdir)/m4/sockets.m4 \
+       $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \
+       $(top_srcdir)/m4/sparcv8+.m4 $(top_srcdir)/m4/spawn-pipe.m4 \
+       $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/ssize_t.m4 \
+       $(top_srcdir)/m4/stack-direction.m4 \
+       $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
        $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
        $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
        $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
        $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
-       $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \
-       $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \
+       $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
        $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
        $(top_srcdir)/m4/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \
        $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/symlink.m4 \
+       $(top_srcdir)/m4/sys_ioctl_h.m4 \
+       $(top_srcdir)/m4/sys_random_h.m4 \
+       $(top_srcdir)/m4/sys_select_h.m4 \
        $(top_srcdir)/m4/sys_socket_h.m4 \
        $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
-       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \
-       $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+       $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+       $(top_srcdir)/m4/thread.m4 $(top_srcdir)/m4/threadlib.m4 \
        $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/tls.m4 \
        $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/ungetc.m4 \
        $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
        $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \
        $(top_srcdir)/m4/vasprintf-posix.m4 \
        $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+       $(top_srcdir)/m4/visibility.m4 \
        $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \
        $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/m4/wchar_h.m4 \
        $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wcrtomb.m4 \
        $(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
-       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
-       $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \
-       $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \
-       $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \
+       $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \
+       $(top_srcdir)/m4/yield.m4 $(top_srcdir)/m4/zzgnulib.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
@@ -219,8 +266,14 @@ am_m4_OBJECTS = m4.$(OBJEXT) builtin.$(OBJEXT) debug.$(OBJEXT) \
        input.$(OBJEXT) macro.$(OBJEXT) output.$(OBJEXT) \
        path.$(OBJEXT) symtab.$(OBJEXT)
 m4_OBJECTS = $(am_m4_OBJECTS)
+m4_LDADD = $(LDADD)
 am__DEPENDENCIES_1 =
 m4_DEPENDENCIES = ../lib/libm4.a $(am__DEPENDENCIES_1) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
        $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -236,7 +289,12 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = 
 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/builtin.Po ./$(DEPDIR)/debug.Po \
+       ./$(DEPDIR)/eval.Po ./$(DEPDIR)/format.Po \
+       ./$(DEPDIR)/freeze.Po ./$(DEPDIR)/input.Po ./$(DEPDIR)/m4.Po \
+       ./$(DEPDIR)/macro.Po ./$(DEPDIR)/output.Po ./$(DEPDIR)/path.Po \
+       ./$(DEPDIR)/symtab.Po
 am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
@@ -302,6 +360,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CONFIG_INCLUDE = @CONFIG_INCLUDE@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
@@ -325,392 +384,519 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
 ERRNO_H = @ERRNO_H@
 EXEEXT = @EXEEXT@
 FLOAT_H = @FLOAT_H@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
 GETOPT_H = @GETOPT_H@
-GLIBC21 = @GLIBC21@
-GNULIB_ACOSF = @GNULIB_ACOSF@
-GNULIB_ACOSL = @GNULIB_ACOSL@
-GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
-GNULIB_ASINF = @GNULIB_ASINF@
-GNULIB_ASINL = @GNULIB_ASINL@
-GNULIB_ATAN2F = @GNULIB_ATAN2F@
-GNULIB_ATANF = @GNULIB_ATANF@
-GNULIB_ATANL = @GNULIB_ATANL@
-GNULIB_ATOLL = @GNULIB_ATOLL@
-GNULIB_BTOWC = @GNULIB_BTOWC@
-GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
-GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
-GNULIB_CBRT = @GNULIB_CBRT@
-GNULIB_CBRTF = @GNULIB_CBRTF@
-GNULIB_CBRTL = @GNULIB_CBRTL@
-GNULIB_CEIL = @GNULIB_CEIL@
-GNULIB_CEILF = @GNULIB_CEILF@
-GNULIB_CEILL = @GNULIB_CEILL@
-GNULIB_CHDIR = @GNULIB_CHDIR@
-GNULIB_CHOWN = @GNULIB_CHOWN@
-GNULIB_CLOSE = @GNULIB_CLOSE@
-GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
-GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
-GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
-GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
-GNULIB_COSF = @GNULIB_COSF@
-GNULIB_COSHF = @GNULIB_COSHF@
-GNULIB_COSL = @GNULIB_COSL@
-GNULIB_DIRFD = @GNULIB_DIRFD@
-GNULIB_DPRINTF = @GNULIB_DPRINTF@
-GNULIB_DUP = @GNULIB_DUP@
-GNULIB_DUP2 = @GNULIB_DUP2@
-GNULIB_DUP3 = @GNULIB_DUP3@
-GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
-GNULIB_ENVIRON = @GNULIB_ENVIRON@
-GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
-GNULIB_EXP2 = @GNULIB_EXP2@
-GNULIB_EXP2F = @GNULIB_EXP2F@
-GNULIB_EXP2L = @GNULIB_EXP2L@
-GNULIB_EXPF = @GNULIB_EXPF@
-GNULIB_EXPL = @GNULIB_EXPL@
-GNULIB_EXPM1 = @GNULIB_EXPM1@
-GNULIB_EXPM1F = @GNULIB_EXPM1F@
-GNULIB_EXPM1L = @GNULIB_EXPM1L@
-GNULIB_FABSF = @GNULIB_FABSF@
-GNULIB_FABSL = @GNULIB_FABSL@
-GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
-GNULIB_FCHDIR = @GNULIB_FCHDIR@
-GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
-GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
-GNULIB_FCLOSE = @GNULIB_FCLOSE@
-GNULIB_FCNTL = @GNULIB_FCNTL@
-GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
-GNULIB_FDOPEN = @GNULIB_FDOPEN@
-GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
-GNULIB_FFLUSH = @GNULIB_FFLUSH@
-GNULIB_FFSL = @GNULIB_FFSL@
-GNULIB_FFSLL = @GNULIB_FFSLL@
-GNULIB_FGETC = @GNULIB_FGETC@
-GNULIB_FGETS = @GNULIB_FGETS@
-GNULIB_FLOOR = @GNULIB_FLOOR@
-GNULIB_FLOORF = @GNULIB_FLOORF@
-GNULIB_FLOORL = @GNULIB_FLOORL@
-GNULIB_FMA = @GNULIB_FMA@
-GNULIB_FMAF = @GNULIB_FMAF@
-GNULIB_FMAL = @GNULIB_FMAL@
-GNULIB_FMOD = @GNULIB_FMOD@
-GNULIB_FMODF = @GNULIB_FMODF@
-GNULIB_FMODL = @GNULIB_FMODL@
-GNULIB_FOPEN = @GNULIB_FOPEN@
-GNULIB_FPRINTF = @GNULIB_FPRINTF@
-GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
-GNULIB_FPURGE = @GNULIB_FPURGE@
-GNULIB_FPUTC = @GNULIB_FPUTC@
-GNULIB_FPUTS = @GNULIB_FPUTS@
-GNULIB_FREAD = @GNULIB_FREAD@
-GNULIB_FREOPEN = @GNULIB_FREOPEN@
-GNULIB_FREXP = @GNULIB_FREXP@
-GNULIB_FREXPF = @GNULIB_FREXPF@
-GNULIB_FREXPL = @GNULIB_FREXPL@
-GNULIB_FSCANF = @GNULIB_FSCANF@
-GNULIB_FSEEK = @GNULIB_FSEEK@
-GNULIB_FSEEKO = @GNULIB_FSEEKO@
-GNULIB_FSTAT = @GNULIB_FSTAT@
-GNULIB_FSTATAT = @GNULIB_FSTATAT@
-GNULIB_FSYNC = @GNULIB_FSYNC@
-GNULIB_FTELL = @GNULIB_FTELL@
-GNULIB_FTELLO = @GNULIB_FTELLO@
-GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
-GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
-GNULIB_FWRITE = @GNULIB_FWRITE@
-GNULIB_GETC = @GNULIB_GETC@
-GNULIB_GETCHAR = @GNULIB_GETCHAR@
-GNULIB_GETCWD = @GNULIB_GETCWD@
-GNULIB_GETDELIM = @GNULIB_GETDELIM@
-GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
-GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
-GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
-GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
-GNULIB_GETLINE = @GNULIB_GETLINE@
-GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
-GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
-GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
-GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
-GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_M4_GNULIB_ACCEPT = @GL_M4_GNULIB_ACCEPT@
+GL_M4_GNULIB_ACCEPT4 = @GL_M4_GNULIB_ACCEPT4@
+GL_M4_GNULIB_ACCESS = @GL_M4_GNULIB_ACCESS@
+GL_M4_GNULIB_ACOSF = @GL_M4_GNULIB_ACOSF@
+GL_M4_GNULIB_ACOSL = @GL_M4_GNULIB_ACOSL@
+GL_M4_GNULIB_ALIGNED_ALLOC = @GL_M4_GNULIB_ALIGNED_ALLOC@
+GL_M4_GNULIB_ALPHASORT = @GL_M4_GNULIB_ALPHASORT@
+GL_M4_GNULIB_ASINF = @GL_M4_GNULIB_ASINF@
+GL_M4_GNULIB_ASINL = @GL_M4_GNULIB_ASINL@
+GL_M4_GNULIB_ATAN2F = @GL_M4_GNULIB_ATAN2F@
+GL_M4_GNULIB_ATANF = @GL_M4_GNULIB_ATANF@
+GL_M4_GNULIB_ATANL = @GL_M4_GNULIB_ATANL@
+GL_M4_GNULIB_ATOLL = @GL_M4_GNULIB_ATOLL@
+GL_M4_GNULIB_BIND = @GL_M4_GNULIB_BIND@
+GL_M4_GNULIB_BTOWC = @GL_M4_GNULIB_BTOWC@
+GL_M4_GNULIB_CALLOC_POSIX = @GL_M4_GNULIB_CALLOC_POSIX@
+GL_M4_GNULIB_CANONICALIZE_FILE_NAME = @GL_M4_GNULIB_CANONICALIZE_FILE_NAME@
+GL_M4_GNULIB_CBRT = @GL_M4_GNULIB_CBRT@
+GL_M4_GNULIB_CBRTF = @GL_M4_GNULIB_CBRTF@
+GL_M4_GNULIB_CBRTL = @GL_M4_GNULIB_CBRTL@
+GL_M4_GNULIB_CEIL = @GL_M4_GNULIB_CEIL@
+GL_M4_GNULIB_CEILF = @GL_M4_GNULIB_CEILF@
+GL_M4_GNULIB_CEILL = @GL_M4_GNULIB_CEILL@
+GL_M4_GNULIB_CHDIR = @GL_M4_GNULIB_CHDIR@
+GL_M4_GNULIB_CHOWN = @GL_M4_GNULIB_CHOWN@
+GL_M4_GNULIB_CLOSE = @GL_M4_GNULIB_CLOSE@
+GL_M4_GNULIB_CLOSEDIR = @GL_M4_GNULIB_CLOSEDIR@
+GL_M4_GNULIB_CONNECT = @GL_M4_GNULIB_CONNECT@
+GL_M4_GNULIB_COPYSIGN = @GL_M4_GNULIB_COPYSIGN@
+GL_M4_GNULIB_COPYSIGNF = @GL_M4_GNULIB_COPYSIGNF@
+GL_M4_GNULIB_COPYSIGNL = @GL_M4_GNULIB_COPYSIGNL@
+GL_M4_GNULIB_COPY_FILE_RANGE = @GL_M4_GNULIB_COPY_FILE_RANGE@
+GL_M4_GNULIB_COSF = @GL_M4_GNULIB_COSF@
+GL_M4_GNULIB_COSHF = @GL_M4_GNULIB_COSHF@
+GL_M4_GNULIB_COSL = @GL_M4_GNULIB_COSL@
+GL_M4_GNULIB_CREAT = @GL_M4_GNULIB_CREAT@
+GL_M4_GNULIB_CTIME = @GL_M4_GNULIB_CTIME@
+GL_M4_GNULIB_DIRFD = @GL_M4_GNULIB_DIRFD@
+GL_M4_GNULIB_DPRINTF = @GL_M4_GNULIB_DPRINTF@
+GL_M4_GNULIB_DUP = @GL_M4_GNULIB_DUP@
+GL_M4_GNULIB_DUP2 = @GL_M4_GNULIB_DUP2@
+GL_M4_GNULIB_DUP3 = @GL_M4_GNULIB_DUP3@
+GL_M4_GNULIB_DUPLOCALE = @GL_M4_GNULIB_DUPLOCALE@
+GL_M4_GNULIB_ENVIRON = @GL_M4_GNULIB_ENVIRON@
+GL_M4_GNULIB_EUIDACCESS = @GL_M4_GNULIB_EUIDACCESS@
+GL_M4_GNULIB_EXECL = @GL_M4_GNULIB_EXECL@
+GL_M4_GNULIB_EXECLE = @GL_M4_GNULIB_EXECLE@
+GL_M4_GNULIB_EXECLP = @GL_M4_GNULIB_EXECLP@
+GL_M4_GNULIB_EXECV = @GL_M4_GNULIB_EXECV@
+GL_M4_GNULIB_EXECVE = @GL_M4_GNULIB_EXECVE@
+GL_M4_GNULIB_EXECVP = @GL_M4_GNULIB_EXECVP@
+GL_M4_GNULIB_EXECVPE = @GL_M4_GNULIB_EXECVPE@
+GL_M4_GNULIB_EXP2 = @GL_M4_GNULIB_EXP2@
+GL_M4_GNULIB_EXP2F = @GL_M4_GNULIB_EXP2F@
+GL_M4_GNULIB_EXP2L = @GL_M4_GNULIB_EXP2L@
+GL_M4_GNULIB_EXPF = @GL_M4_GNULIB_EXPF@
+GL_M4_GNULIB_EXPL = @GL_M4_GNULIB_EXPL@
+GL_M4_GNULIB_EXPLICIT_BZERO = @GL_M4_GNULIB_EXPLICIT_BZERO@
+GL_M4_GNULIB_EXPM1 = @GL_M4_GNULIB_EXPM1@
+GL_M4_GNULIB_EXPM1F = @GL_M4_GNULIB_EXPM1F@
+GL_M4_GNULIB_EXPM1L = @GL_M4_GNULIB_EXPM1L@
+GL_M4_GNULIB_FABSF = @GL_M4_GNULIB_FABSF@
+GL_M4_GNULIB_FABSL = @GL_M4_GNULIB_FABSL@
+GL_M4_GNULIB_FACCESSAT = @GL_M4_GNULIB_FACCESSAT@
+GL_M4_GNULIB_FCHDIR = @GL_M4_GNULIB_FCHDIR@
+GL_M4_GNULIB_FCHMODAT = @GL_M4_GNULIB_FCHMODAT@
+GL_M4_GNULIB_FCHOWNAT = @GL_M4_GNULIB_FCHOWNAT@
+GL_M4_GNULIB_FCLOSE = @GL_M4_GNULIB_FCLOSE@
+GL_M4_GNULIB_FCNTL = @GL_M4_GNULIB_FCNTL@
+GL_M4_GNULIB_FDATASYNC = @GL_M4_GNULIB_FDATASYNC@
+GL_M4_GNULIB_FDOPEN = @GL_M4_GNULIB_FDOPEN@
+GL_M4_GNULIB_FDOPENDIR = @GL_M4_GNULIB_FDOPENDIR@
+GL_M4_GNULIB_FFLUSH = @GL_M4_GNULIB_FFLUSH@
+GL_M4_GNULIB_FFSL = @GL_M4_GNULIB_FFSL@
+GL_M4_GNULIB_FFSLL = @GL_M4_GNULIB_FFSLL@
+GL_M4_GNULIB_FGETC = @GL_M4_GNULIB_FGETC@
+GL_M4_GNULIB_FGETS = @GL_M4_GNULIB_FGETS@
+GL_M4_GNULIB_FLOOR = @GL_M4_GNULIB_FLOOR@
+GL_M4_GNULIB_FLOORF = @GL_M4_GNULIB_FLOORF@
+GL_M4_GNULIB_FLOORL = @GL_M4_GNULIB_FLOORL@
+GL_M4_GNULIB_FMA = @GL_M4_GNULIB_FMA@
+GL_M4_GNULIB_FMAF = @GL_M4_GNULIB_FMAF@
+GL_M4_GNULIB_FMAL = @GL_M4_GNULIB_FMAL@
+GL_M4_GNULIB_FMOD = @GL_M4_GNULIB_FMOD@
+GL_M4_GNULIB_FMODF = @GL_M4_GNULIB_FMODF@
+GL_M4_GNULIB_FMODL = @GL_M4_GNULIB_FMODL@
+GL_M4_GNULIB_FOPEN = @GL_M4_GNULIB_FOPEN@
+GL_M4_GNULIB_FPRINTF = @GL_M4_GNULIB_FPRINTF@
+GL_M4_GNULIB_FPRINTF_POSIX = @GL_M4_GNULIB_FPRINTF_POSIX@
+GL_M4_GNULIB_FPURGE = @GL_M4_GNULIB_FPURGE@
+GL_M4_GNULIB_FPUTC = @GL_M4_GNULIB_FPUTC@
+GL_M4_GNULIB_FPUTS = @GL_M4_GNULIB_FPUTS@
+GL_M4_GNULIB_FREAD = @GL_M4_GNULIB_FREAD@
+GL_M4_GNULIB_FREE_POSIX = @GL_M4_GNULIB_FREE_POSIX@
+GL_M4_GNULIB_FREOPEN = @GL_M4_GNULIB_FREOPEN@
+GL_M4_GNULIB_FREXP = @GL_M4_GNULIB_FREXP@
+GL_M4_GNULIB_FREXPF = @GL_M4_GNULIB_FREXPF@
+GL_M4_GNULIB_FREXPL = @GL_M4_GNULIB_FREXPL@
+GL_M4_GNULIB_FSCANF = @GL_M4_GNULIB_FSCANF@
+GL_M4_GNULIB_FSEEK = @GL_M4_GNULIB_FSEEK@
+GL_M4_GNULIB_FSEEKO = @GL_M4_GNULIB_FSEEKO@
+GL_M4_GNULIB_FSTAT = @GL_M4_GNULIB_FSTAT@
+GL_M4_GNULIB_FSTATAT = @GL_M4_GNULIB_FSTATAT@
+GL_M4_GNULIB_FSYNC = @GL_M4_GNULIB_FSYNC@
+GL_M4_GNULIB_FTELL = @GL_M4_GNULIB_FTELL@
+GL_M4_GNULIB_FTELLO = @GL_M4_GNULIB_FTELLO@
+GL_M4_GNULIB_FTRUNCATE = @GL_M4_GNULIB_FTRUNCATE@
+GL_M4_GNULIB_FUTIMENS = @GL_M4_GNULIB_FUTIMENS@
+GL_M4_GNULIB_FWRITE = @GL_M4_GNULIB_FWRITE@
+GL_M4_GNULIB_GETC = @GL_M4_GNULIB_GETC@
+GL_M4_GNULIB_GETCHAR = @GL_M4_GNULIB_GETCHAR@
+GL_M4_GNULIB_GETCWD = @GL_M4_GNULIB_GETCWD@
+GL_M4_GNULIB_GETDELIM = @GL_M4_GNULIB_GETDELIM@
+GL_M4_GNULIB_GETDOMAINNAME = @GL_M4_GNULIB_GETDOMAINNAME@
+GL_M4_GNULIB_GETDTABLESIZE = @GL_M4_GNULIB_GETDTABLESIZE@
+GL_M4_GNULIB_GETENTROPY = @GL_M4_GNULIB_GETENTROPY@
+GL_M4_GNULIB_GETGROUPS = @GL_M4_GNULIB_GETGROUPS@
+GL_M4_GNULIB_GETHOSTNAME = @GL_M4_GNULIB_GETHOSTNAME@
+GL_M4_GNULIB_GETLINE = @GL_M4_GNULIB_GETLINE@
+GL_M4_GNULIB_GETLOADAVG = @GL_M4_GNULIB_GETLOADAVG@
+GL_M4_GNULIB_GETLOGIN = @GL_M4_GNULIB_GETLOGIN@
+GL_M4_GNULIB_GETLOGIN_R = @GL_M4_GNULIB_GETLOGIN_R@
+GL_M4_GNULIB_GETOPT_POSIX = @GL_M4_GNULIB_GETOPT_POSIX@
+GL_M4_GNULIB_GETPAGESIZE = @GL_M4_GNULIB_GETPAGESIZE@
+GL_M4_GNULIB_GETPASS = @GL_M4_GNULIB_GETPASS@
+GL_M4_GNULIB_GETPEERNAME = @GL_M4_GNULIB_GETPEERNAME@
+GL_M4_GNULIB_GETRANDOM = @GL_M4_GNULIB_GETRANDOM@
+GL_M4_GNULIB_GETSOCKNAME = @GL_M4_GNULIB_GETSOCKNAME@
+GL_M4_GNULIB_GETSOCKOPT = @GL_M4_GNULIB_GETSOCKOPT@
+GL_M4_GNULIB_GETSUBOPT = @GL_M4_GNULIB_GETSUBOPT@
+GL_M4_GNULIB_GETTIMEOFDAY = @GL_M4_GNULIB_GETTIMEOFDAY@
+GL_M4_GNULIB_GETUMASK = @GL_M4_GNULIB_GETUMASK@
+GL_M4_GNULIB_GETUSERSHELL = @GL_M4_GNULIB_GETUSERSHELL@
+GL_M4_GNULIB_GRANTPT = @GL_M4_GNULIB_GRANTPT@
+GL_M4_GNULIB_GROUP_MEMBER = @GL_M4_GNULIB_GROUP_MEMBER@
+GL_M4_GNULIB_HYPOT = @GL_M4_GNULIB_HYPOT@
+GL_M4_GNULIB_HYPOTF = @GL_M4_GNULIB_HYPOTF@
+GL_M4_GNULIB_HYPOTL = @GL_M4_GNULIB_HYPOTL@
+GL_M4_GNULIB_ICONV = @GL_M4_GNULIB_ICONV@
+GL_M4_GNULIB_ILOGB = @GL_M4_GNULIB_ILOGB@
+GL_M4_GNULIB_ILOGBF = @GL_M4_GNULIB_ILOGBF@
+GL_M4_GNULIB_ILOGBL = @GL_M4_GNULIB_ILOGBL@
+GL_M4_GNULIB_IMAXABS = @GL_M4_GNULIB_IMAXABS@
+GL_M4_GNULIB_IMAXDIV = @GL_M4_GNULIB_IMAXDIV@
+GL_M4_GNULIB_INET_NTOP = @GL_M4_GNULIB_INET_NTOP@
+GL_M4_GNULIB_INET_PTON = @GL_M4_GNULIB_INET_PTON@
+GL_M4_GNULIB_IOCTL = @GL_M4_GNULIB_IOCTL@
+GL_M4_GNULIB_ISATTY = @GL_M4_GNULIB_ISATTY@
+GL_M4_GNULIB_ISBLANK = @GL_M4_GNULIB_ISBLANK@
+GL_M4_GNULIB_ISFINITE = @GL_M4_GNULIB_ISFINITE@
+GL_M4_GNULIB_ISINF = @GL_M4_GNULIB_ISINF@
+GL_M4_GNULIB_ISNAN = @GL_M4_GNULIB_ISNAN@
+GL_M4_GNULIB_ISNAND = @GL_M4_GNULIB_ISNAND@
+GL_M4_GNULIB_ISNANF = @GL_M4_GNULIB_ISNANF@
+GL_M4_GNULIB_ISNANL = @GL_M4_GNULIB_ISNANL@
+GL_M4_GNULIB_ISWBLANK = @GL_M4_GNULIB_ISWBLANK@
+GL_M4_GNULIB_ISWCTYPE = @GL_M4_GNULIB_ISWCTYPE@
+GL_M4_GNULIB_ISWDIGIT = @GL_M4_GNULIB_ISWDIGIT@
+GL_M4_GNULIB_ISWXDIGIT = @GL_M4_GNULIB_ISWXDIGIT@
+GL_M4_GNULIB_LCHMOD = @GL_M4_GNULIB_LCHMOD@
+GL_M4_GNULIB_LCHOWN = @GL_M4_GNULIB_LCHOWN@
+GL_M4_GNULIB_LDEXPF = @GL_M4_GNULIB_LDEXPF@
+GL_M4_GNULIB_LDEXPL = @GL_M4_GNULIB_LDEXPL@
+GL_M4_GNULIB_LINK = @GL_M4_GNULIB_LINK@
+GL_M4_GNULIB_LINKAT = @GL_M4_GNULIB_LINKAT@
+GL_M4_GNULIB_LISTEN = @GL_M4_GNULIB_LISTEN@
+GL_M4_GNULIB_LOCALECONV = @GL_M4_GNULIB_LOCALECONV@
+GL_M4_GNULIB_LOCALENAME = @GL_M4_GNULIB_LOCALENAME@
+GL_M4_GNULIB_LOCALTIME = @GL_M4_GNULIB_LOCALTIME@
+GL_M4_GNULIB_LOG = @GL_M4_GNULIB_LOG@
+GL_M4_GNULIB_LOG10 = @GL_M4_GNULIB_LOG10@
+GL_M4_GNULIB_LOG10F = @GL_M4_GNULIB_LOG10F@
+GL_M4_GNULIB_LOG10L = @GL_M4_GNULIB_LOG10L@
+GL_M4_GNULIB_LOG1P = @GL_M4_GNULIB_LOG1P@
+GL_M4_GNULIB_LOG1PF = @GL_M4_GNULIB_LOG1PF@
+GL_M4_GNULIB_LOG1PL = @GL_M4_GNULIB_LOG1PL@
+GL_M4_GNULIB_LOG2 = @GL_M4_GNULIB_LOG2@
+GL_M4_GNULIB_LOG2F = @GL_M4_GNULIB_LOG2F@
+GL_M4_GNULIB_LOG2L = @GL_M4_GNULIB_LOG2L@
+GL_M4_GNULIB_LOGB = @GL_M4_GNULIB_LOGB@
+GL_M4_GNULIB_LOGBF = @GL_M4_GNULIB_LOGBF@
+GL_M4_GNULIB_LOGBL = @GL_M4_GNULIB_LOGBL@
+GL_M4_GNULIB_LOGF = @GL_M4_GNULIB_LOGF@
+GL_M4_GNULIB_LOGL = @GL_M4_GNULIB_LOGL@
+GL_M4_GNULIB_LSEEK = @GL_M4_GNULIB_LSEEK@
+GL_M4_GNULIB_LSTAT = @GL_M4_GNULIB_LSTAT@
+GL_M4_GNULIB_MALLOC_POSIX = @GL_M4_GNULIB_MALLOC_POSIX@
+GL_M4_GNULIB_MBRLEN = @GL_M4_GNULIB_MBRLEN@
+GL_M4_GNULIB_MBRTOWC = @GL_M4_GNULIB_MBRTOWC@
+GL_M4_GNULIB_MBSCASECMP = @GL_M4_GNULIB_MBSCASECMP@
+GL_M4_GNULIB_MBSCASESTR = @GL_M4_GNULIB_MBSCASESTR@
+GL_M4_GNULIB_MBSCHR = @GL_M4_GNULIB_MBSCHR@
+GL_M4_GNULIB_MBSCSPN = @GL_M4_GNULIB_MBSCSPN@
+GL_M4_GNULIB_MBSINIT = @GL_M4_GNULIB_MBSINIT@
+GL_M4_GNULIB_MBSLEN = @GL_M4_GNULIB_MBSLEN@
+GL_M4_GNULIB_MBSNCASECMP = @GL_M4_GNULIB_MBSNCASECMP@
+GL_M4_GNULIB_MBSNLEN = @GL_M4_GNULIB_MBSNLEN@
+GL_M4_GNULIB_MBSNRTOWCS = @GL_M4_GNULIB_MBSNRTOWCS@
+GL_M4_GNULIB_MBSPBRK = @GL_M4_GNULIB_MBSPBRK@
+GL_M4_GNULIB_MBSPCASECMP = @GL_M4_GNULIB_MBSPCASECMP@
+GL_M4_GNULIB_MBSRCHR = @GL_M4_GNULIB_MBSRCHR@
+GL_M4_GNULIB_MBSRTOWCS = @GL_M4_GNULIB_MBSRTOWCS@
+GL_M4_GNULIB_MBSSEP = @GL_M4_GNULIB_MBSSEP@
+GL_M4_GNULIB_MBSSPN = @GL_M4_GNULIB_MBSSPN@
+GL_M4_GNULIB_MBSSTR = @GL_M4_GNULIB_MBSSTR@
+GL_M4_GNULIB_MBSTOK_R = @GL_M4_GNULIB_MBSTOK_R@
+GL_M4_GNULIB_MBTOWC = @GL_M4_GNULIB_MBTOWC@
+GL_M4_GNULIB_MDA_ACCESS = @GL_M4_GNULIB_MDA_ACCESS@
+GL_M4_GNULIB_MDA_CHDIR = @GL_M4_GNULIB_MDA_CHDIR@
+GL_M4_GNULIB_MDA_CHMOD = @GL_M4_GNULIB_MDA_CHMOD@
+GL_M4_GNULIB_MDA_CLOSE = @GL_M4_GNULIB_MDA_CLOSE@
+GL_M4_GNULIB_MDA_CREAT = @GL_M4_GNULIB_MDA_CREAT@
+GL_M4_GNULIB_MDA_DUP = @GL_M4_GNULIB_MDA_DUP@
+GL_M4_GNULIB_MDA_DUP2 = @GL_M4_GNULIB_MDA_DUP2@
+GL_M4_GNULIB_MDA_ECVT = @GL_M4_GNULIB_MDA_ECVT@
+GL_M4_GNULIB_MDA_EXECL = @GL_M4_GNULIB_MDA_EXECL@
+GL_M4_GNULIB_MDA_EXECLE = @GL_M4_GNULIB_MDA_EXECLE@
+GL_M4_GNULIB_MDA_EXECLP = @GL_M4_GNULIB_MDA_EXECLP@
+GL_M4_GNULIB_MDA_EXECV = @GL_M4_GNULIB_MDA_EXECV@
+GL_M4_GNULIB_MDA_EXECVE = @GL_M4_GNULIB_MDA_EXECVE@
+GL_M4_GNULIB_MDA_EXECVP = @GL_M4_GNULIB_MDA_EXECVP@
+GL_M4_GNULIB_MDA_EXECVPE = @GL_M4_GNULIB_MDA_EXECVPE@
+GL_M4_GNULIB_MDA_FCLOSEALL = @GL_M4_GNULIB_MDA_FCLOSEALL@
+GL_M4_GNULIB_MDA_FCVT = @GL_M4_GNULIB_MDA_FCVT@
+GL_M4_GNULIB_MDA_FDOPEN = @GL_M4_GNULIB_MDA_FDOPEN@
+GL_M4_GNULIB_MDA_FILENO = @GL_M4_GNULIB_MDA_FILENO@
+GL_M4_GNULIB_MDA_GCVT = @GL_M4_GNULIB_MDA_GCVT@
+GL_M4_GNULIB_MDA_GETCWD = @GL_M4_GNULIB_MDA_GETCWD@
+GL_M4_GNULIB_MDA_GETPID = @GL_M4_GNULIB_MDA_GETPID@
+GL_M4_GNULIB_MDA_GETW = @GL_M4_GNULIB_MDA_GETW@
+GL_M4_GNULIB_MDA_ISATTY = @GL_M4_GNULIB_MDA_ISATTY@
+GL_M4_GNULIB_MDA_J0 = @GL_M4_GNULIB_MDA_J0@
+GL_M4_GNULIB_MDA_J1 = @GL_M4_GNULIB_MDA_J1@
+GL_M4_GNULIB_MDA_JN = @GL_M4_GNULIB_MDA_JN@
+GL_M4_GNULIB_MDA_LSEEK = @GL_M4_GNULIB_MDA_LSEEK@
+GL_M4_GNULIB_MDA_MEMCCPY = @GL_M4_GNULIB_MDA_MEMCCPY@
+GL_M4_GNULIB_MDA_MKDIR = @GL_M4_GNULIB_MDA_MKDIR@
+GL_M4_GNULIB_MDA_MKTEMP = @GL_M4_GNULIB_MDA_MKTEMP@
+GL_M4_GNULIB_MDA_OPEN = @GL_M4_GNULIB_MDA_OPEN@
+GL_M4_GNULIB_MDA_PUTENV = @GL_M4_GNULIB_MDA_PUTENV@
+GL_M4_GNULIB_MDA_PUTW = @GL_M4_GNULIB_MDA_PUTW@
+GL_M4_GNULIB_MDA_READ = @GL_M4_GNULIB_MDA_READ@
+GL_M4_GNULIB_MDA_RMDIR = @GL_M4_GNULIB_MDA_RMDIR@
+GL_M4_GNULIB_MDA_STRDUP = @GL_M4_GNULIB_MDA_STRDUP@
+GL_M4_GNULIB_MDA_SWAB = @GL_M4_GNULIB_MDA_SWAB@
+GL_M4_GNULIB_MDA_TEMPNAM = @GL_M4_GNULIB_MDA_TEMPNAM@
+GL_M4_GNULIB_MDA_TZSET = @GL_M4_GNULIB_MDA_TZSET@
+GL_M4_GNULIB_MDA_UMASK = @GL_M4_GNULIB_MDA_UMASK@
+GL_M4_GNULIB_MDA_UNLINK = @GL_M4_GNULIB_MDA_UNLINK@
+GL_M4_GNULIB_MDA_WCSDUP = @GL_M4_GNULIB_MDA_WCSDUP@
+GL_M4_GNULIB_MDA_WRITE = @GL_M4_GNULIB_MDA_WRITE@
+GL_M4_GNULIB_MDA_Y0 = @GL_M4_GNULIB_MDA_Y0@
+GL_M4_GNULIB_MDA_Y1 = @GL_M4_GNULIB_MDA_Y1@
+GL_M4_GNULIB_MDA_YN = @GL_M4_GNULIB_MDA_YN@
+GL_M4_GNULIB_MEMCHR = @GL_M4_GNULIB_MEMCHR@
+GL_M4_GNULIB_MEMMEM = @GL_M4_GNULIB_MEMMEM@
+GL_M4_GNULIB_MEMPCPY = @GL_M4_GNULIB_MEMPCPY@
+GL_M4_GNULIB_MEMRCHR = @GL_M4_GNULIB_MEMRCHR@
+GL_M4_GNULIB_MKDIR = @GL_M4_GNULIB_MKDIR@
+GL_M4_GNULIB_MKDIRAT = @GL_M4_GNULIB_MKDIRAT@
+GL_M4_GNULIB_MKDTEMP = @GL_M4_GNULIB_MKDTEMP@
+GL_M4_GNULIB_MKFIFO = @GL_M4_GNULIB_MKFIFO@
+GL_M4_GNULIB_MKFIFOAT = @GL_M4_GNULIB_MKFIFOAT@
+GL_M4_GNULIB_MKNOD = @GL_M4_GNULIB_MKNOD@
+GL_M4_GNULIB_MKNODAT = @GL_M4_GNULIB_MKNODAT@
+GL_M4_GNULIB_MKOSTEMP = @GL_M4_GNULIB_MKOSTEMP@
+GL_M4_GNULIB_MKOSTEMPS = @GL_M4_GNULIB_MKOSTEMPS@
+GL_M4_GNULIB_MKSTEMP = @GL_M4_GNULIB_MKSTEMP@
+GL_M4_GNULIB_MKSTEMPS = @GL_M4_GNULIB_MKSTEMPS@
+GL_M4_GNULIB_MKTIME = @GL_M4_GNULIB_MKTIME@
+GL_M4_GNULIB_MODF = @GL_M4_GNULIB_MODF@
+GL_M4_GNULIB_MODFF = @GL_M4_GNULIB_MODFF@
+GL_M4_GNULIB_MODFL = @GL_M4_GNULIB_MODFL@
+GL_M4_GNULIB_NANOSLEEP = @GL_M4_GNULIB_NANOSLEEP@
+GL_M4_GNULIB_NL_LANGINFO = @GL_M4_GNULIB_NL_LANGINFO@
+GL_M4_GNULIB_NONBLOCKING = @GL_M4_GNULIB_NONBLOCKING@
+GL_M4_GNULIB_OBSTACK_PRINTF = @GL_M4_GNULIB_OBSTACK_PRINTF@
+GL_M4_GNULIB_OBSTACK_PRINTF_POSIX = @GL_M4_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_M4_GNULIB_OPEN = @GL_M4_GNULIB_OPEN@
+GL_M4_GNULIB_OPENAT = @GL_M4_GNULIB_OPENAT@
+GL_M4_GNULIB_OPENDIR = @GL_M4_GNULIB_OPENDIR@
+GL_M4_GNULIB_OVERRIDES_STRUCT_STAT = @GL_M4_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_M4_GNULIB_PCLOSE = @GL_M4_GNULIB_PCLOSE@
+GL_M4_GNULIB_PERROR = @GL_M4_GNULIB_PERROR@
+GL_M4_GNULIB_PIPE = @GL_M4_GNULIB_PIPE@
+GL_M4_GNULIB_PIPE2 = @GL_M4_GNULIB_PIPE2@
+GL_M4_GNULIB_POPEN = @GL_M4_GNULIB_POPEN@
+GL_M4_GNULIB_POSIX_MEMALIGN = @GL_M4_GNULIB_POSIX_MEMALIGN@
+GL_M4_GNULIB_POSIX_OPENPT = @GL_M4_GNULIB_POSIX_OPENPT@
+GL_M4_GNULIB_POSIX_SPAWN = @GL_M4_GNULIB_POSIX_SPAWN@
+GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY = @GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNATTR_INIT = @GL_M4_GNULIB_POSIX_SPAWNATTR_INIT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNP = @GL_M4_GNULIB_POSIX_SPAWNP@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
+GL_M4_GNULIB_POWF = @GL_M4_GNULIB_POWF@
+GL_M4_GNULIB_PREAD = @GL_M4_GNULIB_PREAD@
+GL_M4_GNULIB_PRINTF = @GL_M4_GNULIB_PRINTF@
+GL_M4_GNULIB_PRINTF_POSIX = @GL_M4_GNULIB_PRINTF_POSIX@
+GL_M4_GNULIB_PSELECT = @GL_M4_GNULIB_PSELECT@
+GL_M4_GNULIB_PTHREAD_COND = @GL_M4_GNULIB_PTHREAD_COND@
+GL_M4_GNULIB_PTHREAD_MUTEX = @GL_M4_GNULIB_PTHREAD_MUTEX@
+GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK = @GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK@
+GL_M4_GNULIB_PTHREAD_ONCE = @GL_M4_GNULIB_PTHREAD_ONCE@
+GL_M4_GNULIB_PTHREAD_RWLOCK = @GL_M4_GNULIB_PTHREAD_RWLOCK@
+GL_M4_GNULIB_PTHREAD_SIGMASK = @GL_M4_GNULIB_PTHREAD_SIGMASK@
+GL_M4_GNULIB_PTHREAD_SPIN = @GL_M4_GNULIB_PTHREAD_SPIN@
+GL_M4_GNULIB_PTHREAD_THREAD = @GL_M4_GNULIB_PTHREAD_THREAD@
+GL_M4_GNULIB_PTHREAD_TSS = @GL_M4_GNULIB_PTHREAD_TSS@
+GL_M4_GNULIB_PTSNAME = @GL_M4_GNULIB_PTSNAME@
+GL_M4_GNULIB_PTSNAME_R = @GL_M4_GNULIB_PTSNAME_R@
+GL_M4_GNULIB_PUTC = @GL_M4_GNULIB_PUTC@
+GL_M4_GNULIB_PUTCHAR = @GL_M4_GNULIB_PUTCHAR@
+GL_M4_GNULIB_PUTENV = @GL_M4_GNULIB_PUTENV@
+GL_M4_GNULIB_PUTS = @GL_M4_GNULIB_PUTS@
+GL_M4_GNULIB_PWRITE = @GL_M4_GNULIB_PWRITE@
+GL_M4_GNULIB_QSORT_R = @GL_M4_GNULIB_QSORT_R@
+GL_M4_GNULIB_RAISE = @GL_M4_GNULIB_RAISE@
+GL_M4_GNULIB_RANDOM = @GL_M4_GNULIB_RANDOM@
+GL_M4_GNULIB_RANDOM_R = @GL_M4_GNULIB_RANDOM_R@
+GL_M4_GNULIB_RAWMEMCHR = @GL_M4_GNULIB_RAWMEMCHR@
+GL_M4_GNULIB_READ = @GL_M4_GNULIB_READ@
+GL_M4_GNULIB_READDIR = @GL_M4_GNULIB_READDIR@
+GL_M4_GNULIB_READLINK = @GL_M4_GNULIB_READLINK@
+GL_M4_GNULIB_READLINKAT = @GL_M4_GNULIB_READLINKAT@
+GL_M4_GNULIB_REALLOCARRAY = @GL_M4_GNULIB_REALLOCARRAY@
+GL_M4_GNULIB_REALLOC_POSIX = @GL_M4_GNULIB_REALLOC_POSIX@
+GL_M4_GNULIB_REALPATH = @GL_M4_GNULIB_REALPATH@
+GL_M4_GNULIB_RECV = @GL_M4_GNULIB_RECV@
+GL_M4_GNULIB_RECVFROM = @GL_M4_GNULIB_RECVFROM@
+GL_M4_GNULIB_REMAINDER = @GL_M4_GNULIB_REMAINDER@
+GL_M4_GNULIB_REMAINDERF = @GL_M4_GNULIB_REMAINDERF@
+GL_M4_GNULIB_REMAINDERL = @GL_M4_GNULIB_REMAINDERL@
+GL_M4_GNULIB_REMOVE = @GL_M4_GNULIB_REMOVE@
+GL_M4_GNULIB_RENAME = @GL_M4_GNULIB_RENAME@
+GL_M4_GNULIB_RENAMEAT = @GL_M4_GNULIB_RENAMEAT@
+GL_M4_GNULIB_REWINDDIR = @GL_M4_GNULIB_REWINDDIR@
+GL_M4_GNULIB_RINT = @GL_M4_GNULIB_RINT@
+GL_M4_GNULIB_RINTF = @GL_M4_GNULIB_RINTF@
+GL_M4_GNULIB_RINTL = @GL_M4_GNULIB_RINTL@
+GL_M4_GNULIB_RMDIR = @GL_M4_GNULIB_RMDIR@
+GL_M4_GNULIB_ROUND = @GL_M4_GNULIB_ROUND@
+GL_M4_GNULIB_ROUNDF = @GL_M4_GNULIB_ROUNDF@
+GL_M4_GNULIB_ROUNDL = @GL_M4_GNULIB_ROUNDL@
+GL_M4_GNULIB_RPMATCH = @GL_M4_GNULIB_RPMATCH@
+GL_M4_GNULIB_SCANDIR = @GL_M4_GNULIB_SCANDIR@
+GL_M4_GNULIB_SCANF = @GL_M4_GNULIB_SCANF@
+GL_M4_GNULIB_SCHED_YIELD = @GL_M4_GNULIB_SCHED_YIELD@
+GL_M4_GNULIB_SECURE_GETENV = @GL_M4_GNULIB_SECURE_GETENV@
+GL_M4_GNULIB_SELECT = @GL_M4_GNULIB_SELECT@
+GL_M4_GNULIB_SEND = @GL_M4_GNULIB_SEND@
+GL_M4_GNULIB_SENDTO = @GL_M4_GNULIB_SENDTO@
+GL_M4_GNULIB_SETENV = @GL_M4_GNULIB_SETENV@
+GL_M4_GNULIB_SETHOSTNAME = @GL_M4_GNULIB_SETHOSTNAME@
+GL_M4_GNULIB_SETLOCALE = @GL_M4_GNULIB_SETLOCALE@
+GL_M4_GNULIB_SETLOCALE_NULL = @GL_M4_GNULIB_SETLOCALE_NULL@
+GL_M4_GNULIB_SETSOCKOPT = @GL_M4_GNULIB_SETSOCKOPT@
+GL_M4_GNULIB_SHUTDOWN = @GL_M4_GNULIB_SHUTDOWN@
+GL_M4_GNULIB_SIGABBREV_NP = @GL_M4_GNULIB_SIGABBREV_NP@
+GL_M4_GNULIB_SIGACTION = @GL_M4_GNULIB_SIGACTION@
+GL_M4_GNULIB_SIGDESCR_NP = @GL_M4_GNULIB_SIGDESCR_NP@
+GL_M4_GNULIB_SIGNAL_H_SIGPIPE = @GL_M4_GNULIB_SIGNAL_H_SIGPIPE@
+GL_M4_GNULIB_SIGNBIT = @GL_M4_GNULIB_SIGNBIT@
+GL_M4_GNULIB_SIGPROCMASK = @GL_M4_GNULIB_SIGPROCMASK@
+GL_M4_GNULIB_SINF = @GL_M4_GNULIB_SINF@
+GL_M4_GNULIB_SINHF = @GL_M4_GNULIB_SINHF@
+GL_M4_GNULIB_SINL = @GL_M4_GNULIB_SINL@
+GL_M4_GNULIB_SLEEP = @GL_M4_GNULIB_SLEEP@
+GL_M4_GNULIB_SNPRINTF = @GL_M4_GNULIB_SNPRINTF@
+GL_M4_GNULIB_SOCKET = @GL_M4_GNULIB_SOCKET@
+GL_M4_GNULIB_SPRINTF_POSIX = @GL_M4_GNULIB_SPRINTF_POSIX@
+GL_M4_GNULIB_SQRTF = @GL_M4_GNULIB_SQRTF@
+GL_M4_GNULIB_SQRTL = @GL_M4_GNULIB_SQRTL@
+GL_M4_GNULIB_STAT = @GL_M4_GNULIB_STAT@
+GL_M4_GNULIB_STDIO_H_NONBLOCKING = @GL_M4_GNULIB_STDIO_H_NONBLOCKING@
+GL_M4_GNULIB_STDIO_H_SIGPIPE = @GL_M4_GNULIB_STDIO_H_SIGPIPE@
+GL_M4_GNULIB_STPCPY = @GL_M4_GNULIB_STPCPY@
+GL_M4_GNULIB_STPNCPY = @GL_M4_GNULIB_STPNCPY@
+GL_M4_GNULIB_STRCASESTR = @GL_M4_GNULIB_STRCASESTR@
+GL_M4_GNULIB_STRCHRNUL = @GL_M4_GNULIB_STRCHRNUL@
+GL_M4_GNULIB_STRDUP = @GL_M4_GNULIB_STRDUP@
+GL_M4_GNULIB_STRERROR = @GL_M4_GNULIB_STRERROR@
+GL_M4_GNULIB_STRERRORNAME_NP = @GL_M4_GNULIB_STRERRORNAME_NP@
+GL_M4_GNULIB_STRERROR_R = @GL_M4_GNULIB_STRERROR_R@
+GL_M4_GNULIB_STRFTIME = @GL_M4_GNULIB_STRFTIME@
+GL_M4_GNULIB_STRNCAT = @GL_M4_GNULIB_STRNCAT@
+GL_M4_GNULIB_STRNDUP = @GL_M4_GNULIB_STRNDUP@
+GL_M4_GNULIB_STRNLEN = @GL_M4_GNULIB_STRNLEN@
+GL_M4_GNULIB_STRPBRK = @GL_M4_GNULIB_STRPBRK@
+GL_M4_GNULIB_STRPTIME = @GL_M4_GNULIB_STRPTIME@
+GL_M4_GNULIB_STRSEP = @GL_M4_GNULIB_STRSEP@
+GL_M4_GNULIB_STRSIGNAL = @GL_M4_GNULIB_STRSIGNAL@
+GL_M4_GNULIB_STRSTR = @GL_M4_GNULIB_STRSTR@
+GL_M4_GNULIB_STRTOD = @GL_M4_GNULIB_STRTOD@
+GL_M4_GNULIB_STRTOIMAX = @GL_M4_GNULIB_STRTOIMAX@
+GL_M4_GNULIB_STRTOK_R = @GL_M4_GNULIB_STRTOK_R@
+GL_M4_GNULIB_STRTOL = @GL_M4_GNULIB_STRTOL@
+GL_M4_GNULIB_STRTOLD = @GL_M4_GNULIB_STRTOLD@
+GL_M4_GNULIB_STRTOLL = @GL_M4_GNULIB_STRTOLL@
+GL_M4_GNULIB_STRTOUL = @GL_M4_GNULIB_STRTOUL@
+GL_M4_GNULIB_STRTOULL = @GL_M4_GNULIB_STRTOULL@
+GL_M4_GNULIB_STRTOUMAX = @GL_M4_GNULIB_STRTOUMAX@
+GL_M4_GNULIB_STRVERSCMP = @GL_M4_GNULIB_STRVERSCMP@
+GL_M4_GNULIB_SYMLINK = @GL_M4_GNULIB_SYMLINK@
+GL_M4_GNULIB_SYMLINKAT = @GL_M4_GNULIB_SYMLINKAT@
+GL_M4_GNULIB_SYSTEM_POSIX = @GL_M4_GNULIB_SYSTEM_POSIX@
+GL_M4_GNULIB_TANF = @GL_M4_GNULIB_TANF@
+GL_M4_GNULIB_TANHF = @GL_M4_GNULIB_TANHF@
+GL_M4_GNULIB_TANL = @GL_M4_GNULIB_TANL@
+GL_M4_GNULIB_TIMEGM = @GL_M4_GNULIB_TIMEGM@
+GL_M4_GNULIB_TIMESPEC_GET = @GL_M4_GNULIB_TIMESPEC_GET@
+GL_M4_GNULIB_TIME_R = @GL_M4_GNULIB_TIME_R@
+GL_M4_GNULIB_TIME_RZ = @GL_M4_GNULIB_TIME_RZ@
+GL_M4_GNULIB_TMPFILE = @GL_M4_GNULIB_TMPFILE@
+GL_M4_GNULIB_TOWCTRANS = @GL_M4_GNULIB_TOWCTRANS@
+GL_M4_GNULIB_TRUNC = @GL_M4_GNULIB_TRUNC@
+GL_M4_GNULIB_TRUNCATE = @GL_M4_GNULIB_TRUNCATE@
+GL_M4_GNULIB_TRUNCF = @GL_M4_GNULIB_TRUNCF@
+GL_M4_GNULIB_TRUNCL = @GL_M4_GNULIB_TRUNCL@
+GL_M4_GNULIB_TTYNAME_R = @GL_M4_GNULIB_TTYNAME_R@
+GL_M4_GNULIB_TZSET = @GL_M4_GNULIB_TZSET@
+GL_M4_GNULIB_UNISTD_H_NONBLOCKING = @GL_M4_GNULIB_UNISTD_H_NONBLOCKING@
+GL_M4_GNULIB_UNISTD_H_SIGPIPE = @GL_M4_GNULIB_UNISTD_H_SIGPIPE@
+GL_M4_GNULIB_UNLINK = @GL_M4_GNULIB_UNLINK@
+GL_M4_GNULIB_UNLINKAT = @GL_M4_GNULIB_UNLINKAT@
+GL_M4_GNULIB_UNLOCKPT = @GL_M4_GNULIB_UNLOCKPT@
+GL_M4_GNULIB_UNSETENV = @GL_M4_GNULIB_UNSETENV@
+GL_M4_GNULIB_USLEEP = @GL_M4_GNULIB_USLEEP@
+GL_M4_GNULIB_UTIMENSAT = @GL_M4_GNULIB_UTIMENSAT@
+GL_M4_GNULIB_VASPRINTF = @GL_M4_GNULIB_VASPRINTF@
+GL_M4_GNULIB_VDPRINTF = @GL_M4_GNULIB_VDPRINTF@
+GL_M4_GNULIB_VFPRINTF = @GL_M4_GNULIB_VFPRINTF@
+GL_M4_GNULIB_VFPRINTF_POSIX = @GL_M4_GNULIB_VFPRINTF_POSIX@
+GL_M4_GNULIB_VFSCANF = @GL_M4_GNULIB_VFSCANF@
+GL_M4_GNULIB_VPRINTF = @GL_M4_GNULIB_VPRINTF@
+GL_M4_GNULIB_VPRINTF_POSIX = @GL_M4_GNULIB_VPRINTF_POSIX@
+GL_M4_GNULIB_VSCANF = @GL_M4_GNULIB_VSCANF@
+GL_M4_GNULIB_VSNPRINTF = @GL_M4_GNULIB_VSNPRINTF@
+GL_M4_GNULIB_VSPRINTF_POSIX = @GL_M4_GNULIB_VSPRINTF_POSIX@
+GL_M4_GNULIB_WAITPID = @GL_M4_GNULIB_WAITPID@
+GL_M4_GNULIB_WCPCPY = @GL_M4_GNULIB_WCPCPY@
+GL_M4_GNULIB_WCPNCPY = @GL_M4_GNULIB_WCPNCPY@
+GL_M4_GNULIB_WCRTOMB = @GL_M4_GNULIB_WCRTOMB@
+GL_M4_GNULIB_WCSCASECMP = @GL_M4_GNULIB_WCSCASECMP@
+GL_M4_GNULIB_WCSCAT = @GL_M4_GNULIB_WCSCAT@
+GL_M4_GNULIB_WCSCHR = @GL_M4_GNULIB_WCSCHR@
+GL_M4_GNULIB_WCSCMP = @GL_M4_GNULIB_WCSCMP@
+GL_M4_GNULIB_WCSCOLL = @GL_M4_GNULIB_WCSCOLL@
+GL_M4_GNULIB_WCSCPY = @GL_M4_GNULIB_WCSCPY@
+GL_M4_GNULIB_WCSCSPN = @GL_M4_GNULIB_WCSCSPN@
+GL_M4_GNULIB_WCSDUP = @GL_M4_GNULIB_WCSDUP@
+GL_M4_GNULIB_WCSFTIME = @GL_M4_GNULIB_WCSFTIME@
+GL_M4_GNULIB_WCSLEN = @GL_M4_GNULIB_WCSLEN@
+GL_M4_GNULIB_WCSNCASECMP = @GL_M4_GNULIB_WCSNCASECMP@
+GL_M4_GNULIB_WCSNCAT = @GL_M4_GNULIB_WCSNCAT@
+GL_M4_GNULIB_WCSNCMP = @GL_M4_GNULIB_WCSNCMP@
+GL_M4_GNULIB_WCSNCPY = @GL_M4_GNULIB_WCSNCPY@
+GL_M4_GNULIB_WCSNLEN = @GL_M4_GNULIB_WCSNLEN@
+GL_M4_GNULIB_WCSNRTOMBS = @GL_M4_GNULIB_WCSNRTOMBS@
+GL_M4_GNULIB_WCSPBRK = @GL_M4_GNULIB_WCSPBRK@
+GL_M4_GNULIB_WCSRCHR = @GL_M4_GNULIB_WCSRCHR@
+GL_M4_GNULIB_WCSRTOMBS = @GL_M4_GNULIB_WCSRTOMBS@
+GL_M4_GNULIB_WCSSPN = @GL_M4_GNULIB_WCSSPN@
+GL_M4_GNULIB_WCSSTR = @GL_M4_GNULIB_WCSSTR@
+GL_M4_GNULIB_WCSTOK = @GL_M4_GNULIB_WCSTOK@
+GL_M4_GNULIB_WCSWIDTH = @GL_M4_GNULIB_WCSWIDTH@
+GL_M4_GNULIB_WCSXFRM = @GL_M4_GNULIB_WCSXFRM@
+GL_M4_GNULIB_WCTOB = @GL_M4_GNULIB_WCTOB@
+GL_M4_GNULIB_WCTOMB = @GL_M4_GNULIB_WCTOMB@
+GL_M4_GNULIB_WCTRANS = @GL_M4_GNULIB_WCTRANS@
+GL_M4_GNULIB_WCTYPE = @GL_M4_GNULIB_WCTYPE@
+GL_M4_GNULIB_WCWIDTH = @GL_M4_GNULIB_WCWIDTH@
+GL_M4_GNULIB_WMEMCHR = @GL_M4_GNULIB_WMEMCHR@
+GL_M4_GNULIB_WMEMCMP = @GL_M4_GNULIB_WMEMCMP@
+GL_M4_GNULIB_WMEMCPY = @GL_M4_GNULIB_WMEMCPY@
+GL_M4_GNULIB_WMEMMOVE = @GL_M4_GNULIB_WMEMMOVE@
+GL_M4_GNULIB_WMEMPCPY = @GL_M4_GNULIB_WMEMPCPY@
+GL_M4_GNULIB_WMEMSET = @GL_M4_GNULIB_WMEMSET@
+GL_M4_GNULIB_WRITE = @GL_M4_GNULIB_WRITE@
+GL_M4_GNULIB__EXIT = @GL_M4_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
-GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
 GNULIB_GL_M4_UNISTD_H_GETOPT = @GNULIB_GL_M4_UNISTD_H_GETOPT@
-GNULIB_GRANTPT = @GNULIB_GRANTPT@
-GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
-GNULIB_HYPOT = @GNULIB_HYPOT@
-GNULIB_HYPOTF = @GNULIB_HYPOTF@
-GNULIB_HYPOTL = @GNULIB_HYPOTL@
-GNULIB_ILOGB = @GNULIB_ILOGB@
-GNULIB_ILOGBF = @GNULIB_ILOGBF@
-GNULIB_ILOGBL = @GNULIB_ILOGBL@
-GNULIB_IMAXABS = @GNULIB_IMAXABS@
-GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
-GNULIB_ISATTY = @GNULIB_ISATTY@
-GNULIB_ISBLANK = @GNULIB_ISBLANK@
-GNULIB_ISFINITE = @GNULIB_ISFINITE@
-GNULIB_ISINF = @GNULIB_ISINF@
-GNULIB_ISNAN = @GNULIB_ISNAN@
-GNULIB_ISNAND = @GNULIB_ISNAND@
-GNULIB_ISNANF = @GNULIB_ISNANF@
-GNULIB_ISNANL = @GNULIB_ISNANL@
-GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
-GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
-GNULIB_LCHMOD = @GNULIB_LCHMOD@
-GNULIB_LCHOWN = @GNULIB_LCHOWN@
-GNULIB_LDEXPF = @GNULIB_LDEXPF@
-GNULIB_LDEXPL = @GNULIB_LDEXPL@
-GNULIB_LINK = @GNULIB_LINK@
-GNULIB_LINKAT = @GNULIB_LINKAT@
-GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
-GNULIB_LOG = @GNULIB_LOG@
-GNULIB_LOG10 = @GNULIB_LOG10@
-GNULIB_LOG10F = @GNULIB_LOG10F@
-GNULIB_LOG10L = @GNULIB_LOG10L@
-GNULIB_LOG1P = @GNULIB_LOG1P@
-GNULIB_LOG1PF = @GNULIB_LOG1PF@
-GNULIB_LOG1PL = @GNULIB_LOG1PL@
-GNULIB_LOG2 = @GNULIB_LOG2@
-GNULIB_LOG2F = @GNULIB_LOG2F@
-GNULIB_LOG2L = @GNULIB_LOG2L@
-GNULIB_LOGB = @GNULIB_LOGB@
-GNULIB_LOGBF = @GNULIB_LOGBF@
-GNULIB_LOGBL = @GNULIB_LOGBL@
-GNULIB_LOGF = @GNULIB_LOGF@
-GNULIB_LOGL = @GNULIB_LOGL@
-GNULIB_LSEEK = @GNULIB_LSEEK@
-GNULIB_LSTAT = @GNULIB_LSTAT@
-GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
-GNULIB_MBRLEN = @GNULIB_MBRLEN@
-GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
-GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
-GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
-GNULIB_MBSCHR = @GNULIB_MBSCHR@
-GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
-GNULIB_MBSINIT = @GNULIB_MBSINIT@
-GNULIB_MBSLEN = @GNULIB_MBSLEN@
-GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
-GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
-GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
-GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
-GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
-GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
-GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
-GNULIB_MBSSEP = @GNULIB_MBSSEP@
-GNULIB_MBSSPN = @GNULIB_MBSSPN@
-GNULIB_MBSSTR = @GNULIB_MBSSTR@
-GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
-GNULIB_MBTOWC = @GNULIB_MBTOWC@
-GNULIB_MEMCHR = @GNULIB_MEMCHR@
-GNULIB_MEMMEM = @GNULIB_MEMMEM@
-GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
-GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
-GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
-GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
-GNULIB_MKFIFO = @GNULIB_MKFIFO@
-GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
-GNULIB_MKNOD = @GNULIB_MKNOD@
-GNULIB_MKNODAT = @GNULIB_MKNODAT@
-GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
-GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
-GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
-GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
-GNULIB_MKTIME = @GNULIB_MKTIME@
-GNULIB_MODF = @GNULIB_MODF@
-GNULIB_MODFF = @GNULIB_MODFF@
-GNULIB_MODFL = @GNULIB_MODFL@
-GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
-GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
-GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
-GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
-GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
-GNULIB_OPEN = @GNULIB_OPEN@
-GNULIB_OPENAT = @GNULIB_OPENAT@
-GNULIB_OPENDIR = @GNULIB_OPENDIR@
-GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@
-GNULIB_PCLOSE = @GNULIB_PCLOSE@
-GNULIB_PERROR = @GNULIB_PERROR@
-GNULIB_PIPE = @GNULIB_PIPE@
-GNULIB_PIPE2 = @GNULIB_PIPE2@
-GNULIB_POPEN = @GNULIB_POPEN@
-GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
-GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@
-GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@
-GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
-GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
-GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@
-GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
-GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
-GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
-GNULIB_POWF = @GNULIB_POWF@
-GNULIB_PREAD = @GNULIB_PREAD@
-GNULIB_PRINTF = @GNULIB_PRINTF@
-GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
-GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
-GNULIB_PTSNAME = @GNULIB_PTSNAME@
-GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
-GNULIB_PUTC = @GNULIB_PUTC@
-GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
-GNULIB_PUTENV = @GNULIB_PUTENV@
-GNULIB_PUTS = @GNULIB_PUTS@
-GNULIB_PWRITE = @GNULIB_PWRITE@
-GNULIB_QSORT_R = @GNULIB_QSORT_R@
-GNULIB_RAISE = @GNULIB_RAISE@
-GNULIB_RANDOM = @GNULIB_RANDOM@
-GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
-GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
-GNULIB_READ = @GNULIB_READ@
-GNULIB_READDIR = @GNULIB_READDIR@
-GNULIB_READLINK = @GNULIB_READLINK@
-GNULIB_READLINKAT = @GNULIB_READLINKAT@
-GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
-GNULIB_REALPATH = @GNULIB_REALPATH@
-GNULIB_REMAINDER = @GNULIB_REMAINDER@
-GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
-GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
-GNULIB_REMOVE = @GNULIB_REMOVE@
-GNULIB_RENAME = @GNULIB_RENAME@
-GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
-GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
-GNULIB_RINT = @GNULIB_RINT@
-GNULIB_RINTF = @GNULIB_RINTF@
-GNULIB_RINTL = @GNULIB_RINTL@
-GNULIB_RMDIR = @GNULIB_RMDIR@
-GNULIB_ROUND = @GNULIB_ROUND@
-GNULIB_ROUNDF = @GNULIB_ROUNDF@
-GNULIB_ROUNDL = @GNULIB_ROUNDL@
-GNULIB_RPMATCH = @GNULIB_RPMATCH@
-GNULIB_SCANDIR = @GNULIB_SCANDIR@
-GNULIB_SCANF = @GNULIB_SCANF@
-GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
-GNULIB_SETENV = @GNULIB_SETENV@
-GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
-GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
-GNULIB_SIGACTION = @GNULIB_SIGACTION@
-GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
-GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
-GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
-GNULIB_SINF = @GNULIB_SINF@
-GNULIB_SINHF = @GNULIB_SINHF@
-GNULIB_SINL = @GNULIB_SINL@
-GNULIB_SLEEP = @GNULIB_SLEEP@
-GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
-GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
-GNULIB_SQRTF = @GNULIB_SQRTF@
-GNULIB_SQRTL = @GNULIB_SQRTL@
-GNULIB_STAT = @GNULIB_STAT@
-GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
-GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
-GNULIB_STPCPY = @GNULIB_STPCPY@
-GNULIB_STPNCPY = @GNULIB_STPNCPY@
-GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
-GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
-GNULIB_STRDUP = @GNULIB_STRDUP@
-GNULIB_STRERROR = @GNULIB_STRERROR@
-GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
-GNULIB_STRNCAT = @GNULIB_STRNCAT@
-GNULIB_STRNDUP = @GNULIB_STRNDUP@
-GNULIB_STRNLEN = @GNULIB_STRNLEN@
-GNULIB_STRPBRK = @GNULIB_STRPBRK@
-GNULIB_STRPTIME = @GNULIB_STRPTIME@
-GNULIB_STRSEP = @GNULIB_STRSEP@
-GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
-GNULIB_STRSTR = @GNULIB_STRSTR@
-GNULIB_STRTOD = @GNULIB_STRTOD@
-GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
-GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
-GNULIB_STRTOLL = @GNULIB_STRTOLL@
-GNULIB_STRTOULL = @GNULIB_STRTOULL@
-GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
-GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
-GNULIB_SYMLINK = @GNULIB_SYMLINK@
-GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
-GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
-GNULIB_TANF = @GNULIB_TANF@
-GNULIB_TANHF = @GNULIB_TANHF@
-GNULIB_TANL = @GNULIB_TANL@
-GNULIB_TIMEGM = @GNULIB_TIMEGM@
-GNULIB_TIME_R = @GNULIB_TIME_R@
-GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
-GNULIB_TMPFILE = @GNULIB_TMPFILE@
-GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
-GNULIB_TRUNC = @GNULIB_TRUNC@
-GNULIB_TRUNCF = @GNULIB_TRUNCF@
-GNULIB_TRUNCL = @GNULIB_TRUNCL@
-GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
-GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
-GNULIB_UNLINK = @GNULIB_UNLINK@
-GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
-GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
-GNULIB_UNSETENV = @GNULIB_UNSETENV@
-GNULIB_USLEEP = @GNULIB_USLEEP@
-GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
-GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
-GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
-GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
-GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
-GNULIB_VFSCANF = @GNULIB_VFSCANF@
-GNULIB_VPRINTF = @GNULIB_VPRINTF@
-GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
-GNULIB_VSCANF = @GNULIB_VSCANF@
-GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
-GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
-GNULIB_WAITPID = @GNULIB_WAITPID@
-GNULIB_WCPCPY = @GNULIB_WCPCPY@
-GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
-GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
-GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
-GNULIB_WCSCAT = @GNULIB_WCSCAT@
-GNULIB_WCSCHR = @GNULIB_WCSCHR@
-GNULIB_WCSCMP = @GNULIB_WCSCMP@
-GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
-GNULIB_WCSCPY = @GNULIB_WCSCPY@
-GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
-GNULIB_WCSDUP = @GNULIB_WCSDUP@
-GNULIB_WCSLEN = @GNULIB_WCSLEN@
-GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
-GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
-GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
-GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
-GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
-GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
-GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
-GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
-GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
-GNULIB_WCSSPN = @GNULIB_WCSSPN@
-GNULIB_WCSSTR = @GNULIB_WCSSTR@
-GNULIB_WCSTOK = @GNULIB_WCSTOK@
-GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
-GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
-GNULIB_WCTOB = @GNULIB_WCTOB@
-GNULIB_WCTOMB = @GNULIB_WCTOMB@
-GNULIB_WCTRANS = @GNULIB_WCTRANS@
-GNULIB_WCTYPE = @GNULIB_WCTYPE@
-GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
-GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
-GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
-GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
-GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
-GNULIB_WMEMSET = @GNULIB_WMEMSET@
-GNULIB_WRITE = @GNULIB_WRITE@
-GNULIB__EXIT = @GNULIB__EXIT@
 GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ACOSF = @HAVE_ACOSF@
 HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ASINF = @HAVE_ASINF@
 HAVE_ASINL = @HAVE_ASINL@
 HAVE_ATAN2F = @HAVE_ATAN2F@
@@ -727,9 +913,11 @@ HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
 HAVE_COPYSIGN = @HAVE_COPYSIGN@
 HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
 HAVE_COSF = @HAVE_COSF@
 HAVE_COSHF = @HAVE_COSHF@
 HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
 HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
 HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
 HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
@@ -740,13 +928,17 @@ HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
 HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
 HAVE_DECL_COSL = @HAVE_DECL_COSL@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
 HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
 HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
 HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
 HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
 HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
 HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
 HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
@@ -755,6 +947,7 @@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
 HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
@@ -765,6 +958,9 @@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
 HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
 HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
 HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
 HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
@@ -784,6 +980,7 @@ HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
 HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
 HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
 HAVE_DECL_SINL = @HAVE_DECL_SINL@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
@@ -797,21 +994,24 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TANL = @HAVE_DECL_TANL@
 HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
-HAVE_DUP2 = @HAVE_DUP2@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
 HAVE_EXPF = @HAVE_EXPF@
 HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
 HAVE_EXPM1 = @HAVE_EXPM1@
 HAVE_EXPM1F = @HAVE_EXPM1F@
 HAVE_FABSF = @HAVE_FABSF@
@@ -831,6 +1031,7 @@ HAVE_FMAF = @HAVE_FMAF@
 HAVE_FMAL = @HAVE_FMAL@
 HAVE_FMODF = @HAVE_FMODF@
 HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
 HAVE_FREXPF = @HAVE_FREXPF@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
@@ -839,13 +1040,17 @@ HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
 HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
 HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETRANDOM = @HAVE_GETRANDOM@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GETUMASK = @HAVE_GETUMASK@
 HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_HYPOTF = @HAVE_HYPOTF@
@@ -853,6 +1058,8 @@ HAVE_HYPOTL = @HAVE_HYPOTL@
 HAVE_ILOGB = @HAVE_ILOGB@
 HAVE_ILOGBF = @HAVE_ILOGBF@
 HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISNAND = @HAVE_ISNAND@
@@ -860,6 +1067,7 @@ HAVE_ISNANF = @HAVE_ISNANF@
 HAVE_ISNANL = @HAVE_ISNANL@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
 HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
 HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
 HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
@@ -880,7 +1088,6 @@ HAVE_LOGBF = @HAVE_LOGBF@
 HAVE_LOGBL = @HAVE_LOGBL@
 HAVE_LOGF = @HAVE_LOGF@
 HAVE_LOGL = @HAVE_LOGL@
-HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
 HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
 HAVE_MBRLEN = @HAVE_MBRLEN@
@@ -889,7 +1096,7 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
 HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
-HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MBTOWC = @HAVE_MBTOWC@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
 HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
@@ -905,6 +1112,8 @@ HAVE_MODFF = @HAVE_MODFF@
 HAVE_MODFL = @HAVE_MODFL@
 HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OPENDIR = @HAVE_OPENDIR@
@@ -913,14 +1122,76 @@ HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@
 HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PSELECT = @HAVE_PSELECT@
+HAVE_PTHREAD_ATTR_DESTROY = @HAVE_PTHREAD_ATTR_DESTROY@
+HAVE_PTHREAD_ATTR_GETDETACHSTATE = @HAVE_PTHREAD_ATTR_GETDETACHSTATE@
+HAVE_PTHREAD_ATTR_INIT = @HAVE_PTHREAD_ATTR_INIT@
+HAVE_PTHREAD_ATTR_SETDETACHSTATE = @HAVE_PTHREAD_ATTR_SETDETACHSTATE@
+HAVE_PTHREAD_CONDATTR_DESTROY = @HAVE_PTHREAD_CONDATTR_DESTROY@
+HAVE_PTHREAD_CONDATTR_INIT = @HAVE_PTHREAD_CONDATTR_INIT@
+HAVE_PTHREAD_COND_BROADCAST = @HAVE_PTHREAD_COND_BROADCAST@
+HAVE_PTHREAD_COND_DESTROY = @HAVE_PTHREAD_COND_DESTROY@
+HAVE_PTHREAD_COND_INIT = @HAVE_PTHREAD_COND_INIT@
+HAVE_PTHREAD_COND_SIGNAL = @HAVE_PTHREAD_COND_SIGNAL@
+HAVE_PTHREAD_COND_TIMEDWAIT = @HAVE_PTHREAD_COND_TIMEDWAIT@
+HAVE_PTHREAD_COND_WAIT = @HAVE_PTHREAD_COND_WAIT@
+HAVE_PTHREAD_CREATE = @HAVE_PTHREAD_CREATE@
+HAVE_PTHREAD_CREATE_DETACHED = @HAVE_PTHREAD_CREATE_DETACHED@
+HAVE_PTHREAD_DETACH = @HAVE_PTHREAD_DETACH@
+HAVE_PTHREAD_EQUAL = @HAVE_PTHREAD_EQUAL@
+HAVE_PTHREAD_EXIT = @HAVE_PTHREAD_EXIT@
+HAVE_PTHREAD_GETSPECIFIC = @HAVE_PTHREAD_GETSPECIFIC@
+HAVE_PTHREAD_H = @HAVE_PTHREAD_H@
+HAVE_PTHREAD_JOIN = @HAVE_PTHREAD_JOIN@
+HAVE_PTHREAD_KEY_CREATE = @HAVE_PTHREAD_KEY_CREATE@
+HAVE_PTHREAD_KEY_DELETE = @HAVE_PTHREAD_KEY_DELETE@
+HAVE_PTHREAD_MUTEXATTR_DESTROY = @HAVE_PTHREAD_MUTEXATTR_DESTROY@
+HAVE_PTHREAD_MUTEXATTR_GETROBUST = @HAVE_PTHREAD_MUTEXATTR_GETROBUST@
+HAVE_PTHREAD_MUTEXATTR_GETTYPE = @HAVE_PTHREAD_MUTEXATTR_GETTYPE@
+HAVE_PTHREAD_MUTEXATTR_INIT = @HAVE_PTHREAD_MUTEXATTR_INIT@
+HAVE_PTHREAD_MUTEXATTR_SETROBUST = @HAVE_PTHREAD_MUTEXATTR_SETROBUST@
+HAVE_PTHREAD_MUTEXATTR_SETTYPE = @HAVE_PTHREAD_MUTEXATTR_SETTYPE@
+HAVE_PTHREAD_MUTEX_DESTROY = @HAVE_PTHREAD_MUTEX_DESTROY@
+HAVE_PTHREAD_MUTEX_INIT = @HAVE_PTHREAD_MUTEX_INIT@
+HAVE_PTHREAD_MUTEX_LOCK = @HAVE_PTHREAD_MUTEX_LOCK@
+HAVE_PTHREAD_MUTEX_RECURSIVE = @HAVE_PTHREAD_MUTEX_RECURSIVE@
+HAVE_PTHREAD_MUTEX_ROBUST = @HAVE_PTHREAD_MUTEX_ROBUST@
+HAVE_PTHREAD_MUTEX_TIMEDLOCK = @HAVE_PTHREAD_MUTEX_TIMEDLOCK@
+HAVE_PTHREAD_MUTEX_TRYLOCK = @HAVE_PTHREAD_MUTEX_TRYLOCK@
+HAVE_PTHREAD_MUTEX_UNLOCK = @HAVE_PTHREAD_MUTEX_UNLOCK@
+HAVE_PTHREAD_ONCE = @HAVE_PTHREAD_ONCE@
+HAVE_PTHREAD_PROCESS_SHARED = @HAVE_PTHREAD_PROCESS_SHARED@
+HAVE_PTHREAD_RWLOCKATTR_DESTROY = @HAVE_PTHREAD_RWLOCKATTR_DESTROY@
+HAVE_PTHREAD_RWLOCKATTR_INIT = @HAVE_PTHREAD_RWLOCKATTR_INIT@
+HAVE_PTHREAD_RWLOCK_DESTROY = @HAVE_PTHREAD_RWLOCK_DESTROY@
+HAVE_PTHREAD_RWLOCK_INIT = @HAVE_PTHREAD_RWLOCK_INIT@
+HAVE_PTHREAD_RWLOCK_RDLOCK = @HAVE_PTHREAD_RWLOCK_RDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+HAVE_PTHREAD_RWLOCK_TRYRDLOCK = @HAVE_PTHREAD_RWLOCK_TRYRDLOCK@
+HAVE_PTHREAD_RWLOCK_TRYWRLOCK = @HAVE_PTHREAD_RWLOCK_TRYWRLOCK@
+HAVE_PTHREAD_RWLOCK_UNLOCK = @HAVE_PTHREAD_RWLOCK_UNLOCK@
+HAVE_PTHREAD_RWLOCK_WRLOCK = @HAVE_PTHREAD_RWLOCK_WRLOCK@
+HAVE_PTHREAD_SELF = @HAVE_PTHREAD_SELF@
+HAVE_PTHREAD_SETSPECIFIC = @HAVE_PTHREAD_SETSPECIFIC@
 HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
+HAVE_PTHREAD_SPINLOCK_T = @HAVE_PTHREAD_SPINLOCK_T@
+HAVE_PTHREAD_SPIN_DESTROY = @HAVE_PTHREAD_SPIN_DESTROY@
+HAVE_PTHREAD_SPIN_INIT = @HAVE_PTHREAD_SPIN_INIT@
+HAVE_PTHREAD_SPIN_LOCK = @HAVE_PTHREAD_SPIN_LOCK@
+HAVE_PTHREAD_SPIN_TRYLOCK = @HAVE_PTHREAD_SPIN_TRYLOCK@
+HAVE_PTHREAD_SPIN_UNLOCK = @HAVE_PTHREAD_SPIN_UNLOCK@
+HAVE_PTHREAD_T = @HAVE_PTHREAD_T@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
@@ -933,6 +1204,7 @@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READDIR = @HAVE_READDIR@
 HAVE_READLINK = @HAVE_READLINK@
 HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
 HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_REMAINDER = @HAVE_REMAINDER@
 HAVE_REMAINDERF = @HAVE_REMAINDERF@
@@ -942,12 +1214,17 @@ HAVE_RINT = @HAVE_RINT@
 HAVE_RINTL = @HAVE_RINTL@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SCHED_H = @HAVE_SCHED_H@
+HAVE_SCHED_YIELD = @HAVE_SCHED_YIELD@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
 HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
 HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
 HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
@@ -966,15 +1243,21 @@ HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
 HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRPTIME = @HAVE_STRPTIME@
 HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
 HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@
 HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -982,24 +1265,30 @@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@
+HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
 HAVE_TANF = @HAVE_TANF@
 HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
 HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
-HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
 HAVE_USLEEP = @HAVE_USLEEP@
 HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
 HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCPCPY = @HAVE_WCPCPY@
@@ -1013,6 +1302,7 @@ HAVE_WCSCOLL = @HAVE_WCSCOLL@
 HAVE_WCSCPY = @HAVE_WCSCPY@
 HAVE_WCSCSPN = @HAVE_WCSCSPN@
 HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
 HAVE_WCSLEN = @HAVE_WCSLEN@
 HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
 HAVE_WCSNCAT = @HAVE_WCSNCAT@
@@ -1037,12 +1327,19 @@ HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
 HAVE_WMEMCPY = @HAVE_WMEMCPY@
 HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
 HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
+HOST_CPU = @HOST_CPU@
+HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -1050,34 +1347,55 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
 INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LIBCSTACK = @LIBCSTACK@
+LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM4_LIBDEPS = @LIBM4_LIBDEPS@
 LIBM4_LTLIBDEPS = @LIBM4_LTLIBDEPS@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
-LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBSIGSEGV = @LIBSIGSEGV@
 LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
 LIBTHREAD = @LIBTHREAD@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_GETRANDOM = @LIB_GETRANDOM@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
 LIB_POSIX_SPAWN = @LIB_POSIX_SPAWN@
+LIB_PTHREAD = @LIB_PTHREAD@
+LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SELECT = @LIB_SELECT@
+LIB_SEMAPHORE = @LIB_SEMAPHORE@
+LIB_SETLOCALE = @LIB_SETLOCALE@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
 LIMITS_H = @LIMITS_H@
 LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
 LOCALE_FR = @LOCALE_FR@
 LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
 LOCALE_JA = @LOCALE_JA@
 LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
 LOCALE_ZH_CN = @LOCALE_ZH_CN@
 LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
-LTLIBPTH = @LTLIBPTH@
 LTLIBSIGSEGV = @LTLIBSIGSEGV@
 LTLIBTHREAD = @LTLIBTHREAD@
 M4_LIBOBJS = @M4_LIBOBJS@
@@ -1087,17 +1405,26 @@ M4tests_LTLIBOBJS = @M4tests_LTLIBOBJS@
 M4tests_WITNESS = @M4tests_WITNESS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
 NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@
 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H = @NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H@
 NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@
 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
 NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@
@@ -1107,9 +1434,14 @@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
 NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
@@ -1121,11 +1453,14 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FCNTL_H = @NEXT_FCNTL_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
 NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_PTHREAD_H = @NEXT_PTHREAD_H@
 NEXT_SCHED_H = @NEXT_SCHED_H@
 NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_SPAWN_H = @NEXT_SPAWN_H@
@@ -1135,9 +1470,14 @@ NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@
+NEXT_SYS_RANDOM_H = @NEXT_SYS_RANDOM_H@
+NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
 NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
 NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -1153,14 +1493,16 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
 PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
 PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PRIPTR_PREFIX = @PRIPTR_PREFIX@
-PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
 PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
+REPLACE_ACCESS = @REPLACE_ACCESS@
 REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
 REPLACE_ASINF = @REPLACE_ASINF@
 REPLACE_ATAN2F = @REPLACE_ATAN2F@
 REPLACE_ATANF = @REPLACE_ATANF@
@@ -1177,23 +1519,37 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
 REPLACE_COSF = @REPLACE_COSF@
 REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
 REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
 REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
 REPLACE_EXP2 = @REPLACE_EXP2@
 REPLACE_EXP2L = @REPLACE_EXP2L@
 REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
 REPLACE_EXPM1 = @REPLACE_EXPM1@
 REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
 REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
 REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
 REPLACE_FLOOR = @REPLACE_FLOOR@
 REPLACE_FLOORF = @REPLACE_FLOORF@
 REPLACE_FLOORL = @REPLACE_FLOORL@
@@ -1206,6 +1562,8 @@ REPLACE_FMODL = @REPLACE_FMODL@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FREXP = @REPLACE_FREXP@
 REPLACE_FREXPF = @REPLACE_FREXPF@
@@ -1226,20 +1584,32 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
 REPLACE_HYPOT = @REPLACE_HYPOT@
 REPLACE_HYPOTF = @REPLACE_HYPOTF@
 REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
 REPLACE_ILOGB = @REPLACE_ILOGB@
 REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_IOCTL = @REPLACE_IOCTL@
 REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISFINITE = @REPLACE_ISFINITE@
 REPLACE_ISINF = @REPLACE_ISINF@
 REPLACE_ISNAN = @REPLACE_ISNAN@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
 REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LDEXPL = @REPLACE_LDEXPL@
@@ -1277,7 +1647,9 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@
 REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
 REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
 REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
 REPLACE_MKTIME = @REPLACE_MKTIME@
 REPLACE_MODF = @REPLACE_MODF@
@@ -1285,6 +1657,7 @@ REPLACE_MODFF = @REPLACE_MODFF@
 REPLACE_MODFL = @REPLACE_MODFL@
 REPLACE_NAN = @REPLACE_NAN@
 REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
 REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
 REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
@@ -1293,24 +1666,81 @@ REPLACE_OPENAT = @REPLACE_OPENAT@
 REPLACE_OPENDIR = @REPLACE_OPENDIR@
 REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
 REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PSELECT = @REPLACE_PSELECT@
+REPLACE_PTHREAD_ATTR_DESTROY = @REPLACE_PTHREAD_ATTR_DESTROY@
+REPLACE_PTHREAD_ATTR_GETDETACHSTATE = @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@
+REPLACE_PTHREAD_ATTR_INIT = @REPLACE_PTHREAD_ATTR_INIT@
+REPLACE_PTHREAD_ATTR_SETDETACHSTATE = @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@
+REPLACE_PTHREAD_CONDATTR_DESTROY = @REPLACE_PTHREAD_CONDATTR_DESTROY@
+REPLACE_PTHREAD_CONDATTR_INIT = @REPLACE_PTHREAD_CONDATTR_INIT@
+REPLACE_PTHREAD_COND_BROADCAST = @REPLACE_PTHREAD_COND_BROADCAST@
+REPLACE_PTHREAD_COND_DESTROY = @REPLACE_PTHREAD_COND_DESTROY@
+REPLACE_PTHREAD_COND_INIT = @REPLACE_PTHREAD_COND_INIT@
+REPLACE_PTHREAD_COND_SIGNAL = @REPLACE_PTHREAD_COND_SIGNAL@
+REPLACE_PTHREAD_COND_TIMEDWAIT = @REPLACE_PTHREAD_COND_TIMEDWAIT@
+REPLACE_PTHREAD_COND_WAIT = @REPLACE_PTHREAD_COND_WAIT@
+REPLACE_PTHREAD_CREATE = @REPLACE_PTHREAD_CREATE@
+REPLACE_PTHREAD_DETACH = @REPLACE_PTHREAD_DETACH@
+REPLACE_PTHREAD_EQUAL = @REPLACE_PTHREAD_EQUAL@
+REPLACE_PTHREAD_EXIT = @REPLACE_PTHREAD_EXIT@
+REPLACE_PTHREAD_GETSPECIFIC = @REPLACE_PTHREAD_GETSPECIFIC@
+REPLACE_PTHREAD_JOIN = @REPLACE_PTHREAD_JOIN@
+REPLACE_PTHREAD_KEY_CREATE = @REPLACE_PTHREAD_KEY_CREATE@
+REPLACE_PTHREAD_KEY_DELETE = @REPLACE_PTHREAD_KEY_DELETE@
+REPLACE_PTHREAD_MUTEXATTR_DESTROY = @REPLACE_PTHREAD_MUTEXATTR_DESTROY@
+REPLACE_PTHREAD_MUTEXATTR_GETROBUST = @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_GETTYPE = @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@
+REPLACE_PTHREAD_MUTEXATTR_INIT = @REPLACE_PTHREAD_MUTEXATTR_INIT@
+REPLACE_PTHREAD_MUTEXATTR_SETROBUST = @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_SETTYPE = @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@
+REPLACE_PTHREAD_MUTEX_DESTROY = @REPLACE_PTHREAD_MUTEX_DESTROY@
+REPLACE_PTHREAD_MUTEX_INIT = @REPLACE_PTHREAD_MUTEX_INIT@
+REPLACE_PTHREAD_MUTEX_LOCK = @REPLACE_PTHREAD_MUTEX_LOCK@
+REPLACE_PTHREAD_MUTEX_TIMEDLOCK = @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@
+REPLACE_PTHREAD_MUTEX_TRYLOCK = @REPLACE_PTHREAD_MUTEX_TRYLOCK@
+REPLACE_PTHREAD_MUTEX_UNLOCK = @REPLACE_PTHREAD_MUTEX_UNLOCK@
+REPLACE_PTHREAD_ONCE = @REPLACE_PTHREAD_ONCE@
+REPLACE_PTHREAD_RWLOCKATTR_DESTROY = @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@
+REPLACE_PTHREAD_RWLOCKATTR_INIT = @REPLACE_PTHREAD_RWLOCKATTR_INIT@
+REPLACE_PTHREAD_RWLOCK_DESTROY = @REPLACE_PTHREAD_RWLOCK_DESTROY@
+REPLACE_PTHREAD_RWLOCK_INIT = @REPLACE_PTHREAD_RWLOCK_INIT@
+REPLACE_PTHREAD_RWLOCK_RDLOCK = @REPLACE_PTHREAD_RWLOCK_RDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYRDLOCK = @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYWRLOCK = @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@
+REPLACE_PTHREAD_RWLOCK_UNLOCK = @REPLACE_PTHREAD_RWLOCK_UNLOCK@
+REPLACE_PTHREAD_RWLOCK_WRLOCK = @REPLACE_PTHREAD_RWLOCK_WRLOCK@
+REPLACE_PTHREAD_SELF = @REPLACE_PTHREAD_SELF@
+REPLACE_PTHREAD_SETSPECIFIC = @REPLACE_PTHREAD_SETSPECIFIC@
 REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
+REPLACE_PTHREAD_SPIN_DESTROY = @REPLACE_PTHREAD_SPIN_DESTROY@
+REPLACE_PTHREAD_SPIN_INIT = @REPLACE_PTHREAD_SPIN_INIT@
+REPLACE_PTHREAD_SPIN_LOCK = @REPLACE_PTHREAD_SPIN_LOCK@
+REPLACE_PTHREAD_SPIN_TRYLOCK = @REPLACE_PTHREAD_SPIN_TRYLOCK@
+REPLACE_PTHREAD_SPIN_UNLOCK = @REPLACE_PTHREAD_SPIN_UNLOCK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
 REPLACE_RAISE = @REPLACE_RAISE@
+REPLACE_RANDOM = @REPLACE_RANDOM@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_READLINKAT = @REPLACE_READLINKAT@
 REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
 REPLACE_REALPATH = @REPLACE_REALPATH@
 REPLACE_REMAINDER = @REPLACE_REMAINDER@
 REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
@@ -1318,14 +1748,18 @@ REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
 REPLACE_REMOVE = @REPLACE_REMOVE@
 REPLACE_RENAME = @REPLACE_RENAME@
 REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
 REPLACE_RMDIR = @REPLACE_RMDIR@
 REPLACE_ROUND = @REPLACE_ROUND@
 REPLACE_ROUNDF = @REPLACE_ROUNDF@
 REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SCHED_YIELD = @REPLACE_SCHED_YIELD@
+REPLACE_SELECT = @REPLACE_SELECT@
 REPLACE_SETENV = @REPLACE_SETENV@
 REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
 REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
-REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
 REPLACE_SINF = @REPLACE_SINF@
 REPLACE_SINHF = @REPLACE_SINHF@
 REPLACE_SLEEP = @REPLACE_SLEEP@
@@ -1341,7 +1775,9 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
 REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
 REPLACE_STRNCAT = @REPLACE_STRNCAT@
 REPLACE_STRNDUP = @REPLACE_STRNDUP@
 REPLACE_STRNLEN = @REPLACE_STRNLEN@
@@ -1350,6 +1786,11 @@ REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
 REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
 REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
 REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
 REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
@@ -1361,9 +1802,11 @@ REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
 REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
 REPLACE_TRUNCF = @REPLACE_TRUNCF@
 REPLACE_TRUNCL = @REPLACE_TRUNCL@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
 REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -1376,17 +1819,19 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
 REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
 REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCTOMB = @REPLACE_WCTOMB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 REPLACE_WRITE = @REPLACE_WRITE@
-SCHED_H = @SCHED_H@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIGSEGV_H = @SIGSEGV_H@
 SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
 SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 STDALIGN_H = @STDALIGN_H@
@@ -1395,27 +1840,37 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
 UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
 UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
 WERROR_CFLAGS = @WERROR_CFLAGS@
 WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
 WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+YIELD_LIB = @YIELD_LIB@
 abs_aux_dir = @abs_aux_dir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 am__include = @am__include@
@@ -1473,7 +1928,12 @@ noinst_HEADERS = m4.h
 m4_SOURCES = m4.c builtin.c debug.c eval.c format.c freeze.c input.c \
 macro.c output.c path.c symtab.c
 
-m4_LDADD = ../lib/libm4.a $(LIBM4_LIBDEPS) $(LIBCSTACK) $(LIBTHREAD)
+LDADD = ../lib/libm4.a $(LIBM4_LIBDEPS) \
+  $(LIB_CLOCK_GETTIME) $(LIB_GETRANDOM) $(LIB_HARD_LOCALE) \
+  $(LIB_MBRTOWC) $(LIB_POSIX_SPAWN) $(LIB_SETLOCALE) $(LIB_SETLOCALE_NULL) \
+  $(LIBCSTACK) $(LIBICONV) $(LIBINTL) $(LIBTHREAD) $(LIBUNISTRING) \
+  $(INTL_MACOSX_LIBS)
+
 all: all-am
 
 .SUFFIXES:
@@ -1495,8 +1955,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 
 $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
@@ -1560,17 +2020,23 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/builtin.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freeze.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m4.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macro.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symtab.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/builtin.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eval.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/format.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freeze.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m4.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/macro.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/output.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symtab.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -1640,7 +2106,10 @@ cscopelist-am: $(am__tagged_files)
 distclean-tags:
        -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -1712,7 +2181,17 @@ clean: clean-am
 clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
 
 distclean: distclean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/builtin.Po
+       -rm -f ./$(DEPDIR)/debug.Po
+       -rm -f ./$(DEPDIR)/eval.Po
+       -rm -f ./$(DEPDIR)/format.Po
+       -rm -f ./$(DEPDIR)/freeze.Po
+       -rm -f ./$(DEPDIR)/input.Po
+       -rm -f ./$(DEPDIR)/m4.Po
+       -rm -f ./$(DEPDIR)/macro.Po
+       -rm -f ./$(DEPDIR)/output.Po
+       -rm -f ./$(DEPDIR)/path.Po
+       -rm -f ./$(DEPDIR)/symtab.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -1758,7 +2237,17 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/builtin.Po
+       -rm -f ./$(DEPDIR)/debug.Po
+       -rm -f ./$(DEPDIR)/eval.Po
+       -rm -f ./$(DEPDIR)/format.Po
+       -rm -f ./$(DEPDIR)/freeze.Po
+       -rm -f ./$(DEPDIR)/input.Po
+       -rm -f ./$(DEPDIR)/m4.Po
+       -rm -f ./$(DEPDIR)/macro.Po
+       -rm -f ./$(DEPDIR)/output.Po
+       -rm -f ./$(DEPDIR)/path.Po
+       -rm -f ./$(DEPDIR)/symtab.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -1778,7 +2267,7 @@ uninstall-am: uninstall-binPROGRAMS
 
 .MAKE: install-am install-strip
 
-.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
+.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-am clean \
        clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
        distclean distclean-compile distclean-generic distclean-tags \
        distdir dvi dvi-am html html-am info info-am install \
index 302a86a..5e36ab3 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2000, 2004, 2006-2014, 2016 Free Software
-   Foundation, Inc.
+   Copyright (C) 1989-1994, 2000, 2004, 2006-2014, 2016-2017, 2020-2021
+   Free Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 /* Code for all builtin macros, initialization of symbol table, and
@@ -174,7 +174,7 @@ static predefined const predefined_tab[] =
 | Find the builtin, which lives on ADDR.  |
 `----------------------------------------*/
 
-const builtin * M4_GNUC_PURE
+const builtin * ATTRIBUTE_PURE
 find_builtin_by_addr (builtin_func *func)
 {
   const builtin *bp;
@@ -192,7 +192,7 @@ find_builtin_by_addr (builtin_func *func)
 | placeholder builtin.                                      |
 `----------------------------------------------------------*/
 
-const builtin * M4_GNUC_PURE
+const builtin * ATTRIBUTE_PURE
 find_builtin_by_name (const char *name)
 {
   const builtin *bp;
@@ -261,11 +261,8 @@ set_macro_sequence (const char *regexp)
 
   msg = re_compile_pattern (regexp, strlen (regexp), &macro_sequence_buf);
   if (msg != NULL)
-    {
-      M4ERROR ((EXIT_FAILURE, 0,
-                "--warn-macro-sequence: bad regular expression `%s': %s",
-                regexp, msg));
-    }
+    m4_failure (0, _("--warn-macro-sequence: bad regular expression `%s': %s"),
+                regexp, msg);
   re_set_registers (&macro_sequence_buf, &macro_sequence_regs,
                     macro_sequence_regs.num_regs,
                     macro_sequence_regs.start, macro_sequence_regs.end);
@@ -320,14 +317,14 @@ define_user_macro (const char *name, const char *text, symbol_lookup mode)
               tmp = defn[offset];
               defn[offset] = '\0';
               M4ERROR ((warning_status, 0,
-                        "Warning: definition of `%s' contains sequence `%s'",
+                        _("Warning: definition of `%s' contains sequence `%s'"),
                         name, defn + macro_sequence_regs.start[0]));
               defn[offset] = tmp;
             }
         }
       if (offset == -2)
         M4ERROR ((warning_status, 0,
-                  "error checking --warn-macro-sequence for macro `%s'",
+                  _("error checking --warn-macro-sequence for macro `%s'"),
                   name));
     }
 }
@@ -388,13 +385,13 @@ bad_argc (token_data *name, int argc, int min, int max)
     {
       if (!suppress_warnings)
         M4ERROR ((warning_status, 0,
-                  "Warning: too few arguments to builtin `%s'",
+                  _("Warning: too few arguments to builtin `%s'"),
                   TOKEN_DATA_TEXT (name)));
       isbad = true;
     }
   else if (max > 0 && argc > max && !suppress_warnings)
     M4ERROR ((warning_status, 0,
-              "Warning: excess arguments to builtin `%s' ignored",
+              _("Warning: excess arguments to builtin `%s' ignored"),
               TOKEN_DATA_TEXT (name)));
 
   return isbad;
@@ -415,7 +412,7 @@ numeric_arg (token_data *macro, const char *arg, int *valuep)
     {
       *valuep = 0;
       M4ERROR ((warning_status, 0,
-                "empty string treated as 0 in builtin `%s'",
+                _("empty string treated as 0 in builtin `%s'"),
                 TOKEN_DATA_TEXT (macro)));
     }
   else
@@ -425,17 +422,17 @@ numeric_arg (token_data *macro, const char *arg, int *valuep)
       if (*endp != '\0')
         {
           M4ERROR ((warning_status, 0,
-                    "non-numeric argument to builtin `%s'",
+                    _("non-numeric argument to builtin `%s'"),
                     TOKEN_DATA_TEXT (macro)));
           return false;
         }
-      if (isspace (to_uchar (*arg)))
+      if (c_isspace (*arg))
         M4ERROR ((warning_status, 0,
-                  "leading whitespace ignored in builtin `%s'",
+                  _("leading whitespace ignored in builtin `%s'"),
                   TOKEN_DATA_TEXT (macro)));
       else if (errno == ERANGE)
         M4ERROR ((warning_status, 0,
-                  "numeric overflow detected in builtin `%s'",
+                  _("numeric overflow detected in builtin `%s'"),
                   TOKEN_DATA_TEXT (macro)));
     }
   return true;
@@ -552,7 +549,7 @@ define_macro (int argc, token_data **argv, symbol_lookup mode)
   if (TOKEN_DATA_TYPE (argv[1]) != TOKEN_TEXT)
     {
       M4ERROR ((warning_status, 0,
-                "Warning: %s: invalid macro name ignored", ARG (0)));
+                _("Warning: %s: invalid macro name ignored"), ARG (0)));
       return;
     }
 
@@ -585,13 +582,13 @@ define_macro (int argc, token_data **argv, symbol_lookup mode)
 }
 
 static void
-m4_define (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_define (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   define_macro (argc, argv, SYMBOL_INSERT);
 }
 
 static void
-m4_undefine (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_undefine (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   int i;
   if (bad_argc (argv[0], argc, 2, -1))
@@ -601,13 +598,13 @@ m4_undefine (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
 }
 
 static void
-m4_pushdef (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_pushdef (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   define_macro (argc, argv,  SYMBOL_PUSHDEF);
 }
 
 static void
-m4_popdef (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_popdef (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   int i;
   if (bad_argc (argv[0], argc, 2, -1))
@@ -703,7 +700,7 @@ static void
 dump_symbol (symbol *sym, void *arg)
 {
   struct dump_symbol_data *data = (struct dump_symbol_data *) arg;
-  if (!SYMBOL_SHADOWED (sym) && SYMBOL_TYPE (sym) != TOKEN_VOID)
+  if (SYMBOL_TYPE (sym) != TOKEN_VOID)
     {
       obstack_blank (data->obs, sizeof (symbol *));
       data->base = (symbol **) obstack_base (data->obs);
@@ -752,7 +749,7 @@ m4_dumpdef (struct obstack *obs, int argc, token_data **argv)
             dump_symbol (s, &data);
           else
             M4ERROR ((warning_status, 0,
-                      "undefined macro `%s'", TOKEN_DATA_TEXT (argv[i])));
+                      _("undefined macro `%s'"), TOKEN_DATA_TEXT (argv[i])));
         }
     }
 
@@ -815,7 +812,7 @@ m4_builtin (struct obstack *obs, int argc, token_data **argv)
   if (TOKEN_DATA_TYPE (argv[1]) != TOKEN_TEXT)
     {
       M4ERROR ((warning_status, 0,
-                "Warning: %s: invalid macro name ignored", ARG (0)));
+                _("Warning: %s: invalid macro name ignored"), ARG (0)));
       return;
     }
 
@@ -823,7 +820,7 @@ m4_builtin (struct obstack *obs, int argc, token_data **argv)
   bp = find_builtin_by_name (name);
   if (bp->func == m4_placeholder)
     M4ERROR ((warning_status, 0,
-              "undefined builtin `%s'", name));
+              _("undefined builtin `%s'"), name));
   else
     {
       int i;
@@ -856,7 +853,7 @@ m4_indir (struct obstack *obs, int argc, token_data **argv)
   if (TOKEN_DATA_TYPE (argv[1]) != TOKEN_TEXT)
     {
       M4ERROR ((warning_status, 0,
-                "Warning: %s: invalid macro name ignored", ARG (0)));
+                _("Warning: %s: invalid macro name ignored"), ARG (0)));
       return;
     }
 
@@ -864,7 +861,7 @@ m4_indir (struct obstack *obs, int argc, token_data **argv)
   s = lookup_symbol (name, SYMBOL_LOOKUP);
   if (s == NULL || SYMBOL_TYPE (s) == TOKEN_VOID)
     M4ERROR ((warning_status, 0,
-              "undefined macro `%s'", name));
+              _("undefined macro `%s'"), name));
   else
     {
       int i;
@@ -914,11 +911,11 @@ m4_defn (struct obstack *obs, int argc, token_data **argv)
         case TOKEN_FUNC:
           b = SYMBOL_FUNC (s);
           if (b == m4_placeholder)
-            M4ERROR ((warning_status, 0, "\
-builtin `%s' requested by frozen file is not supported", arg));
+            M4ERROR ((warning_status, 0, _("\
+builtin `%s' requested by frozen file is not supported"), arg));
           else if (argc != 2)
             M4ERROR ((warning_status, 0,
-                      "Warning: cannot concatenate builtin `%s'",
+                      _("Warning: cannot concatenate builtin `%s'"),
                       arg));
           else
             push_macro (b);
@@ -945,7 +942,7 @@ builtin `%s' requested by frozen file is not supported", arg));
 static int sysval;
 
 static void
-m4_syscmd (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_syscmd (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   const char *cmd = ARG (1);
   int status;
@@ -968,7 +965,7 @@ m4_syscmd (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
 #endif
   prog_args[2] = cmd;
   errno = 0;
-  status = execute (ARG (0), SYSCMD_SHELL, (char **) prog_args, false,
+  status = execute (ARG (0), SYSCMD_SHELL, prog_args, NULL, false,
                     false, false, false, true, false, &sig_status);
   if (sig_status)
     {
@@ -978,7 +975,7 @@ m4_syscmd (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
   else
     {
       if (status == 127 && errno)
-        M4ERROR ((warning_status, errno, "cannot run command `%s'", cmd));
+        M4ERROR ((warning_status, errno, _("cannot run command `%s'"), cmd));
       sysval = status;
     }
 }
@@ -1011,11 +1008,11 @@ m4_esyscmd (struct obstack *obs, int argc, token_data **argv)
 #endif
   prog_args[2] = cmd;
   errno = 0;
-  child = create_pipe_in (ARG (0), SYSCMD_SHELL, (char **) prog_args,
+  child = create_pipe_in (ARG (0), SYSCMD_SHELL, prog_args, NULL,
                           NULL, false, true, false, &fd);
   if (child == -1)
     {
-      M4ERROR ((warning_status, errno, "cannot run command `%s'", cmd));
+      M4ERROR ((warning_status, errno, _("cannot run command `%s'"), cmd));
       sysval = 127;
       return;
     }
@@ -1028,7 +1025,7 @@ m4_esyscmd (struct obstack *obs, int argc, token_data **argv)
 #endif
   if (pin == NULL)
     {
-      M4ERROR ((warning_status, errno, "cannot run command `%s'", cmd));
+      M4ERROR ((warning_status, errno, _("cannot run command `%s'"), cmd));
       sysval = 127;
       close (fd);
       return;
@@ -1051,7 +1048,7 @@ m4_esyscmd (struct obstack *obs, int argc, token_data **argv)
       obstack_blank_fast (obs, len);
     }
   if (ferror (pin) || fclose (pin))
-    M4ERROR ((EXIT_FAILURE, errno, "cannot read pipe"));
+    m4_failure (errno, _("cannot read pipe"));
   errno = 0;
   status = wait_subprocess (child, ARG (0), false, true, true, false,
                             &sig_status);
@@ -1063,14 +1060,14 @@ m4_esyscmd (struct obstack *obs, int argc, token_data **argv)
   else
     {
       if (status == 127 && errno)
-        M4ERROR ((warning_status, errno, "cannot run command `%s'", cmd));
+        M4ERROR ((warning_status, errno, _("cannot run command `%s'"), cmd));
       sysval = status;
     }
 }
 
 static void
-m4_sysval (struct obstack *obs, int argc M4_GNUC_UNUSED,
-           token_data **argv M4_GNUC_UNUSED)
+m4_sysval (struct obstack *obs, int argc MAYBE_UNUSED,
+           token_data **argv MAYBE_UNUSED)
 {
   shipout_int (obs, sysval);
 }
@@ -1098,7 +1095,7 @@ m4_eval (struct obstack *obs, int argc, token_data **argv)
   if (radix < 1 || radix > (int) strlen (digits))
     {
       M4ERROR ((warning_status, 0,
-                "radix %d in builtin `%s' out of range",
+                _("radix %d in builtin `%s' out of range"),
                 radix, ARG (0)));
       return;
     }
@@ -1108,13 +1105,13 @@ m4_eval (struct obstack *obs, int argc, token_data **argv)
   if (min < 0)
     {
       M4ERROR ((warning_status, 0,
-                "negative width to builtin `%s'", ARG (0)));
+                _("negative width to builtin `%s'"), ARG (0)));
       return;
     }
 
   if (!*ARG (1))
     M4ERROR ((warning_status, 0,
-              "empty string treated as 0 in builtin `%s'", ARG (0)));
+              _("empty string treated as 0 in builtin `%s'"), ARG (0)));
   else if (evaluate (ARG (1), &value))
     return;
 
@@ -1158,7 +1155,12 @@ m4_incr (struct obstack *obs, int argc, token_data **argv)
   if (!numeric_arg (argv[0], ARG (1), &value))
     return;
 
-  shipout_int (obs, value + 1);
+  /* Minimize undefined C behavior on overflow.  This code assumes
+     that the implementation-defined overflow when casting unsigned to
+     signed is a silent twos-complement wrap-around.  */
+  uint32_t v = value;
+  int32_t w = v + 1;
+  shipout_int (obs, w);
 }
 
 static void
@@ -1172,7 +1174,12 @@ m4_decr (struct obstack *obs, int argc, token_data **argv)
   if (!numeric_arg (argv[0], ARG (1), &value))
     return;
 
-  shipout_int (obs, value - 1);
+  /* Minimize undefined C behavior on overflow.  This code assumes
+     that the implementation-defined overflow when casting unsigned to
+     signed is a silent twos-complement wrap-around.  */
+  uint32_t v = value;
+  int32_t w = v - 1;
+  shipout_int (obs, w);
 }
 \f
 /* This section contains the macros "divert", "undivert" and "divnum" for
@@ -1184,7 +1191,7 @@ m4_decr (struct obstack *obs, int argc, token_data **argv)
 `-----------------------------------------------------------------*/
 
 static void
-m4_divert (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_divert (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   int i = 0;
 
@@ -1217,7 +1224,7 @@ m4_divnum (struct obstack *obs, int argc, token_data **argv)
 `------------------------------------------------------------------*/
 
 static void
-m4_undivert (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_undivert (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   int i, file;
   FILE *fp;
@@ -1229,11 +1236,11 @@ m4_undivert (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
     for (i = 1; i < argc; i++)
       {
         file = strtol (ARG (i), &endp, 10);
-        if (*endp == '\0' && !isspace (to_uchar (*ARG (i))))
+        if (*endp == '\0' && !c_isspace (*ARG (i)))
           insert_diversion (file);
         else if (no_gnu_extensions)
           M4ERROR ((warning_status, 0,
-                    "non-numeric argument to builtin `%s'", ARG (0)));
+                    _("non-numeric argument to builtin `%s'"), ARG (0)));
         else
           {
             fp = m4_path_search (ARG (i), NULL);
@@ -1242,11 +1249,11 @@ m4_undivert (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
                 insert_file (fp);
                 if (fclose (fp) == EOF)
                   M4ERROR ((warning_status, errno,
-                            "error undiverting `%s'", ARG (i)));
+                            _("error undiverting `%s'"), ARG (i)));
               }
             else
               M4ERROR ((warning_status, errno,
-                        "cannot undivert `%s'", ARG (i)));
+                        _("cannot undivert `%s'"), ARG (i)));
           }
       }
 }
@@ -1261,7 +1268,7 @@ m4_undivert (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
 `-----------------------------------------------------------*/
 
 static void
-m4_dnl (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_dnl (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   if (bad_argc (argv[0], argc, 1, 1))
     return;
@@ -1287,7 +1294,7 @@ m4_shift (struct obstack *obs, int argc, token_data **argv)
 `--------------------------------------------------------------------------*/
 
 static void
-m4_changequote (struct obstack *obs M4_GNUC_UNUSED, int argc,
+m4_changequote (struct obstack *obs MAYBE_UNUSED, int argc,
                 token_data **argv)
 {
   if (bad_argc (argv[0], argc, 1, 3))
@@ -1304,7 +1311,7 @@ m4_changequote (struct obstack *obs M4_GNUC_UNUSED, int argc,
 `-----------------------------------------------------------------*/
 
 static void
-m4_changecom (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_changecom (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   if (bad_argc (argv[0], argc, 1, 3))
     return;
@@ -1322,7 +1329,7 @@ m4_changecom (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
 `---------------------------------------------------------------*/
 
 static void
-m4_changeword (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_changeword (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   if (bad_argc (argv[0], argc, 2, 2))
     return;
@@ -1356,7 +1363,7 @@ include (int argc, token_data **argv, bool silent)
     {
       if (!silent)
         {
-          M4ERROR ((warning_status, errno, "cannot open `%s'", ARG (1)));
+          M4ERROR ((warning_status, errno, _("cannot open `%s'"), ARG (1)));
           retcode = EXIT_FAILURE;
         }
       return;
@@ -1371,7 +1378,7 @@ include (int argc, token_data **argv, bool silent)
 `------------------------------------------------*/
 
 static void
-m4_include (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_include (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   include (argc, argv, false);
 }
@@ -1381,7 +1388,7 @@ m4_include (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
 `----------------------------------*/
 
 static void
-m4_sinclude (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_sinclude (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   include (argc, argv, true);
 }
@@ -1419,7 +1426,7 @@ mkstemp_helper (struct obstack *obs, const char *me, const char *pattern,
   fd = mkstemp (name);
   if (fd < 0)
     {
-      M4ERROR ((0, errno, "%s: cannot create tempfile `%s'", me, pattern));
+      M4ERROR ((0, errno, _("%s: cannot create tempfile `%s'"), me, pattern));
       obstack_free (obs, obstack_finish (obs));
     }
   else
@@ -1454,7 +1461,7 @@ m4_maketemp (struct obstack *obs, int argc, token_data **argv)
       int i;
       int len2;
 
-      M4ERROR ((warning_status, 0, "recommend using mkstemp instead"));
+      M4ERROR ((warning_status, 0, _("recommend using mkstemp instead")));
       for (i = len; i > 1; i--)
         if (str[i - 1] != 'X')
           break;
@@ -1535,8 +1542,8 @@ m4___program__ (struct obstack *obs, int argc, token_data **argv)
 | argument, or 0 if no arguments are present.               |
 `----------------------------------------------------------*/
 
-static void M4_GNUC_NORETURN
-m4_m4exit (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+static void
+m4_m4exit (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   int exit_code = EXIT_SUCCESS;
 
@@ -1547,7 +1554,7 @@ m4_m4exit (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
   if (exit_code < 0 || exit_code > 255)
     {
       M4ERROR ((warning_status, 0,
-                "exit status out of range: `%d'", exit_code));
+                _("exit status out of range: `%d'"), exit_code));
       exit_code = EXIT_FAILURE;
     }
   /* Change debug stream back to stderr, to force flushing debug stream and
@@ -1623,7 +1630,7 @@ m4_traceon (struct obstack *obs, int argc, token_data **argv)
 `------------------------------------------------------------------------*/
 
 static void
-m4_traceoff (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_traceoff (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   symbol *s;
   int i;
@@ -1646,7 +1653,7 @@ m4_traceoff (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
 `------------------------------------------------------------------*/
 
 static void
-m4_debugmode (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_debugmode (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   int new_debug_level;
   int change_flag;
@@ -1671,7 +1678,7 @@ m4_debugmode (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
 
       if (new_debug_level < 0)
         M4ERROR ((warning_status, 0,
-                  "Debugmode: bad debug flags: `%s'", ARG (1)));
+                  _("Debugmode: bad debug flags: `%s'"), ARG (1)));
       else
         {
           switch (change_flag)
@@ -1703,7 +1710,7 @@ m4_debugmode (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
 `-------------------------------------------------------------------------*/
 
 static void
-m4_debugfile (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
+m4_debugfile (struct obstack *obs MAYBE_UNUSED, int argc, token_data **argv)
 {
   if (bad_argc (argv[0], argc, 1, 2))
     return;
@@ -1712,7 +1719,7 @@ m4_debugfile (struct obstack *obs M4_GNUC_UNUSED, int argc, token_data **argv)
     debug_set_output (NULL);
   else if (!debug_set_output (ARG (1)))
     M4ERROR ((warning_status, errno,
-              "cannot set debug file `%s'", ARG (1)));
+              _("cannot set debug file `%s'"), ARG (1)));
 }
 \f
 /* This section contains text processing macros: "len", "index",
@@ -1978,12 +1985,11 @@ substitute (struct obstack *obs, const char *victim, const char *repl,
         case '0':
           if (!substitute_warned)
             {
-              M4ERROR ((warning_status, 0, "\
-Warning: \\0 will disappear, use \\& instead in replacements"));
+              M4ERROR ((warning_status, 0, _("\
+Warning: \\0 will disappear, use \\& instead in replacements")));
               substitute_warned = 1;
             }
-          /* Fall through.  */
-
+          FALLTHROUGH;
         case '&':
           obstack_grow (obs, victim + regs->start[0],
                         regs->end[0] - regs->start[0]);
@@ -1995,7 +2001,7 @@ Warning: \\0 will disappear, use \\& instead in replacements"));
           ind = ch -= '0';
           if (regs->num_regs - 1 <= ind)
             M4ERROR ((warning_status, 0,
-                      "Warning: sub-expression %d not present", ch));
+                      _("Warning: sub-expression %d not present"), ch));
           else if (regs->end[ch] > 0)
             obstack_grow (obs, victim + regs->start[ch],
                           regs->end[ch] - regs->start[ch]);
@@ -2004,7 +2010,7 @@ Warning: \\0 will disappear, use \\& instead in replacements"));
 
         case '\0':
           M4ERROR ((warning_status, 0,
-                    "Warning: trailing \\ ignored in replacement"));
+                    _("Warning: trailing \\ ignored in replacement")));
           return;
 
         default:
@@ -2070,7 +2076,7 @@ m4_regexp (struct obstack *obs, int argc, token_data **argv)
   if (msg != NULL)
     {
       M4ERROR ((warning_status, 0,
-                "bad regular expression: `%s': %s", regexp, msg));
+                _("bad regular expression: `%s': %s"), regexp, msg));
       free_pattern_buffer (&buf, &regs);
       return;
     }
@@ -2082,7 +2088,7 @@ m4_regexp (struct obstack *obs, int argc, token_data **argv)
 
   if (startpos == -2)
     M4ERROR ((warning_status, 0,
-               "error matching regular expression `%s'", regexp));
+              _("error matching regular expression `%s'"), regexp));
   else if (argc == 3)
     shipout_int (obs, startpos);
   else if (startpos >= 0)
@@ -2130,7 +2136,7 @@ m4_patsubst (struct obstack *obs, int argc, token_data **argv)
   if (msg != NULL)
     {
       M4ERROR ((warning_status, 0,
-                "bad regular expression `%s': %s", regexp, msg));
+                _("bad regular expression `%s': %s"), regexp, msg));
       free (buf.buffer);
       return;
     }
@@ -2152,7 +2158,7 @@ m4_patsubst (struct obstack *obs, int argc, token_data **argv)
 
           if (matchpos == -2)
             M4ERROR ((warning_status, 0,
-                      "error matching regular expression `%s'", regexp));
+                      _("error matching regular expression `%s'"), regexp));
           else if (offset < length)
             obstack_grow (obs, victim + offset, length - offset);
           break;
@@ -2196,11 +2202,11 @@ m4_patsubst (struct obstack *obs, int argc, token_data **argv)
 `--------------------------------------------------------------------*/
 
 void
-m4_placeholder (struct obstack *obs M4_GNUC_UNUSED, int argc,
+m4_placeholder (struct obstack *obs MAYBE_UNUSED, int argc,
                 token_data **argv)
 {
-  M4ERROR ((warning_status, 0, "\
-builtin `%s' requested by frozen file is not supported", ARG (0)));
+  M4ERROR ((warning_status, 0, _("\
+builtin `%s' requested by frozen file is not supported"), ARG (0)));
 }
 \f
 /*-------------------------------------------------------------------.
@@ -2237,7 +2243,7 @@ expand_user_macro (struct obstack *obs, symbol *sym,
             }
           else
             {
-              for (i = 0; isdigit (to_uchar (*text)); text++)
+              for (i = 0; c_isdigit (*text); text++)
                 i = i*10 + (*text - '0');
             }
           if (i < argc)
index 70a5b80..47e589d 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1991-1994, 2004, 2006-2007, 2009-2014, 2016 Free
-   Software Foundation, Inc.
+   Copyright (C) 1991-1994, 2004, 2006-2007, 2009-2014, 2016-2017,
+   2020-2021 Free Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #include "m4.h"
@@ -133,7 +133,7 @@ debug_set_file (FILE *fp)
   if (debug != NULL && debug != stderr && debug != stdout
       && close_stream (debug) != 0)
     {
-      M4ERROR ((warning_status, errno, "error writing to debug stream"));
+      M4ERROR ((warning_status, errno, _("error writing to debug stream")));
       retcode = EXIT_FAILURE;
     }
   debug = fp;
@@ -154,7 +154,7 @@ debug_set_file (FILE *fp)
           if (debug != stderr && close_stream (debug) != 0)
             {
               M4ERROR ((warning_status, errno,
-                        "error writing to debug stream"));
+                        _("error writing to debug stream")));
               retcode = EXIT_FAILURE;
             }
           debug = stdout;
@@ -210,13 +210,9 @@ debug_set_output (const char *name)
     debug_set_file (NULL);
   else
     {
-      fp = fopen (name, "a");
+      fp = fopen (name, "ae");
       if (fp == NULL)
         return false;
-
-      if (set_cloexec_flag (fileno (fp), true) != 0)
-        M4ERROR ((warning_status, errno,
-                  "Warning: cannot protect debug file across forks"));
       debug_set_file (fp);
     }
   return true;
@@ -279,8 +275,7 @@ trace_format (const char *fmt, ...)
         {
         case 'S':
           maxlen = max_debug_argument_length;
-          /* fall through */
-
+          FALLTHROUGH;
         case 's':
           s = va_arg (args, const char *);
           break;
index 64b389a..18e3a34 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2006-2007, 2009-2014, 2016 Free Software
-   Foundation, Inc.
+   Copyright (C) 1989-1994, 2006-2007, 2009-2014, 2016-2017, 2020-2021
+   Free Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 /* This file contains the functions to evaluate integer expressions for
@@ -105,7 +105,7 @@ eval_undo (void)
 static eval_token
 eval_lex (int32_t *val)
 {
-  while (isspace (to_uchar (*eval_text)))
+  while (c_isspace (*eval_text))
     eval_text++;
 
   last_text = eval_text;
@@ -113,9 +113,13 @@ eval_lex (int32_t *val)
   if (*eval_text == '\0')
     return EOTEXT;
 
-  if (isdigit (to_uchar (*eval_text)))
+  if (c_isdigit (*eval_text))
     {
-      int base, digit;
+      unsigned int base, digit;
+      /* The documentation says that "overflow silently results in wraparound".
+         Therefore use an unsigned integer type to avoid undefined behaviour
+         when parsing '-2147483648'.  */
+      uint32_t value;
 
       if (*eval_text == '0')
         {
@@ -138,7 +142,7 @@ eval_lex (int32_t *val)
             case 'R':
               base = 0;
               eval_text++;
-              while (isdigit (to_uchar (*eval_text)) && base <= 36)
+              while (c_isdigit (*eval_text) && base <= 36)
                 base = 10 * base + *eval_text++ - '0';
               if (base == 0 || base > 36 || *eval_text != ':')
                 return ERROR;
@@ -152,15 +156,14 @@ eval_lex (int32_t *val)
       else
         base = 10;
 
-      /* FIXME - this calculation can overflow.  Consider xstrtol.  */
-      *val = 0;
+      value = 0;
       for (; *eval_text; eval_text++)
         {
-          if (isdigit (to_uchar (*eval_text)))
+          if (c_isdigit (*eval_text))
             digit = *eval_text - '0';
-          else if (islower (to_uchar (*eval_text)))
+          else if (c_islower (*eval_text))
             digit = *eval_text - 'a' + 10;
-          else if (isupper (to_uchar (*eval_text)))
+          else if (c_isupper (*eval_text))
             digit = *eval_text - 'A' + 10;
           else
             break;
@@ -168,8 +171,8 @@ eval_lex (int32_t *val)
           if (base == 1)
             {
               if (digit == 1)
-                (*val)++;
-              else if (digit == 0 && !*val)
+                value++;
+              else if (digit == 0 && value == 0)
                 continue;
               else
                 break;
@@ -177,8 +180,9 @@ eval_lex (int32_t *val)
           else if (digit >= base)
             break;
           else
-            *val = *val * base + digit;
+            value = value * base + digit;
         }
+      *val = value;
       return NUMBER;
     }
 
@@ -311,44 +315,44 @@ evaluate (const char *expr, int32_t *val)
 
     case MISSING_RIGHT:
       M4ERROR ((warning_status, 0,
-                "bad expression in eval (missing right parenthesis): %s",
+                _("bad expression in eval (missing right parenthesis): %s"),
                 expr));
       break;
 
     case SYNTAX_ERROR:
       M4ERROR ((warning_status, 0,
-                "bad expression in eval: %s", expr));
+                _("bad expression in eval: %s"), expr));
       break;
 
     case UNKNOWN_INPUT:
       M4ERROR ((warning_status, 0,
-                "bad expression in eval (bad input): %s", expr));
+                _("bad expression in eval (bad input): %s"), expr));
       break;
 
     case EXCESS_INPUT:
       M4ERROR ((warning_status, 0,
-                "bad expression in eval (excess input): %s", expr));
+                _("bad expression in eval (excess input): %s"), expr));
       break;
 
     case INVALID_OPERATOR:
       M4ERROR ((warning_status, 0,
-                "invalid operator in eval: %s", expr));
+                _("invalid operator in eval: %s"), expr));
       retcode = EXIT_FAILURE;
       break;
 
     case DIVIDE_ZERO:
       M4ERROR ((warning_status, 0,
-                "divide by zero in eval: %s", expr));
+                _("divide by zero in eval: %s"), expr));
       break;
 
     case MODULO_ZERO:
       M4ERROR ((warning_status, 0,
-                "modulo by zero in eval: %s", expr));
+                _("modulo by zero in eval: %s"), expr));
       break;
 
     case NEGATIVE_EXPONENT:
       M4ERROR ((warning_status, 0,
-                "negative exponent in eval: %s", expr));
+                _("negative exponent in eval: %s"), expr));
       break;
 
     default:
@@ -531,8 +535,8 @@ equality_term (eval_token et, int32_t *v1)
 
       if (op == ASSIGN)
       {
-        M4ERROR ((warning_status, 0, "\
-Warning: recommend ==, not =, for equality operator"));
+        M4ERROR ((warning_status, 0, _("\
+Warning: recommend ==, not =, for equality operator")));
         op = EQ;
       }
       *v1 = (op == EQ) == (*v1 == v2);
index 608ac72..6f1758f 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2006-2014, 2016 Free Software Foundation,
-   Inc.
+   Copyright (C) 1989-1994, 2006-2014, 2016-2017, 2020-2021 Free
+   Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 /* printf like formatting for m4.  */
@@ -44,7 +44,7 @@ arg_int (const char *str)
   value = strtol (str, &endp, 10);
   if (endp - str - len)
     M4ERROR ((warning_status, 0, _("non-numeric argument %s"), str));
-  else if (isspace (to_uchar (*str)))
+  else if (c_isspace (*str))
     M4ERROR ((warning_status, 0, _("leading whitespace ignored")));
   else if (errno == ERANGE || (int) value != value)
     M4ERROR ((warning_status, 0, _("numeric overflow detected")));
@@ -68,7 +68,7 @@ arg_long (const char *str)
   value = strtol (str, &endp, 10);
   if (endp - str - len)
     M4ERROR ((warning_status, 0, _("non-numeric argument %s"), str));
-  else if (isspace (to_uchar (*str)))
+  else if (c_isspace (*str))
     M4ERROR ((warning_status, 0, _("leading whitespace ignored")));
   else if (errno == ERANGE)
     M4ERROR ((warning_status, 0, _("numeric overflow detected")));
@@ -92,7 +92,7 @@ arg_double (const char *str)
   value = strtod (str, &endp);
   if (endp - str - len)
     M4ERROR ((warning_status, 0, _("non-numeric argument %s"), str));
-  else if (isspace (to_uchar (*str)))
+  else if (c_isspace (*str))
     M4ERROR ((warning_status, 0, _("leading whitespace ignored")));
   else if (errno == ERANGE)
     M4ERROR ((warning_status, 0, _("numeric overflow detected")));
@@ -250,7 +250,7 @@ expand_format (struct obstack *obs, int argc, token_data **argv)
           fmt++;
         }
       else
-        while (isdigit (to_uchar (*fmt)))
+        while (c_isdigit (*fmt))
           {
             width = 10 * width + *fmt - '0';
             fmt++;
@@ -272,7 +272,7 @@ expand_format (struct obstack *obs, int argc, token_data **argv)
           else
             {
               prec = 0;
-              while (isdigit (to_uchar (*fmt)))
+              while (c_isdigit (*fmt))
                 {
                   prec = 10 * prec + *fmt - '0';
                   fmt++;
@@ -305,7 +305,7 @@ expand_format (struct obstack *obs, int argc, token_data **argv)
       if (sizeof ok <= c || !ok[c])
         {
           M4ERROR ((warning_status, 0,
-                    "Warning: unrecognized specifier in `%s'", f));
+                    _("Warning: unrecognized specifier in `%s'"), f));
           if (c == '\0')
             fmt--;
           continue;
index fd7623d..94671c3 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2006-2014, 2016 Free Software Foundation,
-   Inc.
+   Copyright (C) 1989-1994, 2006-2014, 2016-2017, 2020-2021 Free Software
+   Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 /* This module handles frozen files.  */
@@ -36,14 +36,71 @@ reverse_symbol_list (symbol *sym)
   result = NULL;
   while (sym)
     {
-      next = SYMBOL_NEXT (sym);
-      SYMBOL_NEXT (sym) = result;
+      next = SYMBOL_STACK (sym);
+      SYMBOL_STACK (sym) = result;
       result = sym;
       sym = next;
     }
   return result;
 }
 
+static void
+freeze_symbol (symbol *sym, void *arg)
+{
+  symbol *s = sym;
+  FILE *file = arg;
+  const builtin *bp;
+
+  /* Process all entries in one stack, from the last to the first.
+     This order ensures that, at reload time, pushdef's will be
+     executed with the oldest definitions first.  */
+
+  s = reverse_symbol_list (s);
+  for (sym = s; sym; sym = SYMBOL_STACK (sym))
+    {
+      switch (SYMBOL_TYPE (sym))
+        {
+        case TOKEN_TEXT:
+          xfprintf (file, "T%d,%d\n",
+                    (int) strlen (SYMBOL_NAME (sym)),
+                    (int) strlen (SYMBOL_TEXT (sym)));
+          fputs (SYMBOL_NAME (sym), file);
+          fputs (SYMBOL_TEXT (sym), file);
+          fputc ('\n', file);
+          break;
+
+        case TOKEN_FUNC:
+          bp = find_builtin_by_addr (SYMBOL_FUNC (sym));
+          if (bp == NULL)
+            {
+              M4ERROR ((warning_status, 0, "\
+INTERNAL ERROR: builtin not found in builtin table!"));
+              abort ();
+            }
+          xfprintf (file, "F%d,%d\n",
+                    (int) strlen (SYMBOL_NAME (sym)),
+                    (int) strlen (bp->name));
+          fputs (SYMBOL_NAME (sym), file);
+          fputs (bp->name, file);
+          fputc ('\n', file);
+          break;
+
+        case TOKEN_VOID:
+          /* Ignore placeholder tokens that exist due to traceon.  */
+          break;
+
+        default:
+          M4ERROR ((warning_status, 0, "\
+INTERNAL ERROR: bad token data type in freeze_symbol ()"));
+          abort ();
+          break;
+        }
+    }
+
+  /* Reverse the stack once more, putting it back as it was.  */
+  reverse_symbol_list (s);
+}
+
 /*------------------------------------------------.
 | Produce a frozen state to the given file NAME.  |
 `------------------------------------------------*/
@@ -52,16 +109,10 @@ void
 produce_frozen_state (const char *name)
 {
   FILE *file;
-  size_t h;
-  symbol *sym;
-  const builtin *bp;
 
-  file = fopen (name, O_BINARY ? "wb" : "w");
+  file = fopen (name, O_BINARY ? "wbe" : "we");
   if (!file)
-    {
-      M4ERROR ((EXIT_FAILURE, errno, "cannot open `%s'", name));
-      return;
-    }
+    m4_failure (errno, _("cannot open `%s'"), name);
 
   /* Write a recognizable header.  */
 
@@ -91,59 +142,7 @@ produce_frozen_state (const char *name)
 
   /* Dump all symbols.  */
 
-  for (h = 0; h < hash_table_size; h++)
-    {
-
-      /* Process all entries in one bucket, from the last to the first.
-         This order ensures that, at reload time, pushdef's will be
-         executed with the oldest definitions first.  */
-
-      symtab[h] = reverse_symbol_list (symtab[h]);
-      for (sym = symtab[h]; sym; sym = SYMBOL_NEXT (sym))
-        {
-          switch (SYMBOL_TYPE (sym))
-            {
-            case TOKEN_TEXT:
-              xfprintf (file, "T%d,%d\n",
-                        (int) strlen (SYMBOL_NAME (sym)),
-                        (int) strlen (SYMBOL_TEXT (sym)));
-              fputs (SYMBOL_NAME (sym), file);
-              fputs (SYMBOL_TEXT (sym), file);
-              fputc ('\n', file);
-              break;
-
-            case TOKEN_FUNC:
-              bp = find_builtin_by_addr (SYMBOL_FUNC (sym));
-              if (bp == NULL)
-                {
-                  M4ERROR ((warning_status, 0, "\
-INTERNAL ERROR: builtin not found in builtin table!"));
-                  abort ();
-                }
-              xfprintf (file, "F%d,%d\n",
-                        (int) strlen (SYMBOL_NAME (sym)),
-                        (int) strlen (bp->name));
-              fputs (SYMBOL_NAME (sym), file);
-              fputs (bp->name, file);
-              fputc ('\n', file);
-              break;
-
-            case TOKEN_VOID:
-              /* Ignore placeholder tokens that exist due to traceon.  */
-              break;
-
-            default:
-              M4ERROR ((warning_status, 0, "\
-INTERNAL ERROR: bad token data type in freeze_one_symbol ()"));
-              abort ();
-              break;
-            }
-        }
-
-      /* Reverse the bucket once more, putting it back as it was.  */
-
-      symtab[h] = reverse_symbol_list (symtab[h]);
-    }
+  hack_all_symbols (freeze_symbol, file);
 
   /* Let diversions be issued from output.c module, its cleaner to have this
      piece of code there.  */
@@ -154,7 +153,7 @@ INTERNAL ERROR: bad token data type in freeze_one_symbol ()"));
 
   fputs ("# End of frozen state file\n", file);
   if (close_stream (file) != 0)
-    M4ERROR ((EXIT_FAILURE, errno, "unable to create frozen state"));
+    m4_failure (errno, _("unable to create frozen state"));
 }
 
 /*----------------------------------------------------------------------.
@@ -165,10 +164,9 @@ static void
 issue_expect_message (int expected)
 {
   if (expected == '\n')
-    M4ERROR ((EXIT_FAILURE, 0, "expecting line feed in frozen file"));
+    m4_failure (0, _("expecting line feed in frozen file"));
   else
-    M4ERROR ((EXIT_FAILURE, 0, "expecting character `%c' in frozen file",
-              expected));
+    m4_failure (0, _("expecting character `%c' in frozen file"), expected);
 }
 
 /*-------------------------------------------------.
@@ -207,15 +205,14 @@ reload_frozen_state (const char *name)
   do                                                            \
     {                                                           \
       unsigned int n = 0;                                       \
-      while (isdigit (character) && n <= INT_MAX / 10U)         \
+      while (c_isdigit (character) && n <= INT_MAX / 10U)       \
         {                                                       \
           n = 10 * n + character - '0';                         \
           GET_CHARACTER;                                        \
         }                                                       \
       if (((AllowNeg) ? INT_MIN : INT_MAX) + 0U < n             \
-          || isdigit (character))                               \
-        m4_error (EXIT_FAILURE, 0,                              \
-                  _("integer overflow in frozen file"));        \
+          || c_isdigit (character))                             \
+        m4_failure (0, _("integer overflow in frozen file"));   \
       (Number) = n;                                             \
     }                                                           \
   while (0)
@@ -257,8 +254,7 @@ reload_frozen_state (const char *name)
         }                                                               \
       if (number[(i)] > 0                                               \
           && !fread (string[(i)], (size_t) number[(i)], 1, file))       \
-        m4_error (EXIT_FAILURE, 0,                                      \
-                  _("premature end of frozen file"));                   \
+        m4_failure (0, _("premature end of frozen file"));              \
       string[(i)][number[(i)]] = '\0';                                  \
       p = string[(i)];                                                  \
       while ((tmp = memchr(p, '\n', number[(i)] - (p - string[(i)]))))  \
@@ -271,7 +267,7 @@ reload_frozen_state (const char *name)
 
   file = m4_path_search (name, NULL);
   if (file == NULL)
-    M4ERROR ((EXIT_FAILURE, errno, "cannot open %s", name));
+    m4_failure (errno, _("cannot open %s"), name);
   current_file = name;
 
   allocated[0] = 100;
@@ -286,11 +282,10 @@ reload_frozen_state (const char *name)
   GET_NUMBER (number[0], false);
   if (number[0] > 1)
     M4ERROR ((EXIT_MISMATCH, 0,
-              "frozen file version %d greater than max supported of 1",
+              _("frozen file version %d greater than max supported of 1"),
               number[0]));
   else if (number[0] < 1)
-    M4ERROR ((EXIT_FAILURE, 0,
-              "ill-formed frozen file, version directive expected"));
+    m4_failure (0, _("ill-formed frozen file, version directive expected"));
   VALIDATE ('\n');
 
   GET_DIRECTIVE;
@@ -299,7 +294,7 @@ reload_frozen_state (const char *name)
       switch (character)
         {
         default:
-          M4ERROR ((EXIT_FAILURE, 0, "ill-formed frozen file"));
+          m4_failure (0, _("ill-formed frozen file"));
 
         case 'C':
         case 'D':
@@ -387,7 +382,7 @@ reload_frozen_state (const char *name)
   free (string[0]);
   free (string[1]);
   if (close_stream (file) != 0)
-    m4_error (EXIT_FAILURE, errno, _("unable to read frozen state"));
+    m4_failure (errno, _("unable to read frozen state"));
   current_file = NULL;
   current_line = 0;
 
index 74891a0..727ac7f 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2004-2014, 2016 Free Software Foundation,
-   Inc.
+   Copyright (C) 1989-1994, 2004-2014, 2016-2017, 2020-2021 Free
+   Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 /* Handling of different input sources, and lexical analysis.  */
@@ -165,6 +165,9 @@ static struct re_registers regs;
 #ifdef DEBUG_INPUT
 static const char *token_type_string (token_type);
 #endif
+
+static void pop_input (void);
+
 \f
 
 /*-------------------------------------------------------------------.
@@ -250,6 +253,9 @@ push_string_init (void)
       abort ();
     }
 
+  /* Prefer reusing an older block, for tail-call optimization.  */
+  while (isp && isp->type == INPUT_STRING && !isp->u.u_s.string[0])
+    pop_input ();
   next = (input_block *) obstack_alloc (current_input,
                                         sizeof (struct input_block));
   next->type = INPUT_STRING;
@@ -350,14 +356,14 @@ pop_input (void)
 
       if (ferror (isp->u.u_f.fp))
         {
-          M4ERROR ((warning_status, 0, "read error"));
+          M4ERROR ((warning_status, 0, _("read error")));
           if (isp->u.u_f.close)
             fclose (isp->u.u_f.fp);
           retcode = EXIT_FAILURE;
         }
       else if (isp->u.u_f.close && fclose (isp->u.u_f.fp) == EOF)
         {
-          M4ERROR ((warning_status, errno, "error reading file"));
+          M4ERROR ((warning_status, errno, _("error reading file")));
           retcode = EXIT_FAILURE;
         }
       start_of_input_line = isp->u.u_f.advance;
@@ -580,7 +586,7 @@ skip_line (void)
     /* current_file changed to "" if we see CHAR_EOF, use the
        previous value we stored earlier.  */
     M4ERROR_AT_LINE ((warning_status, 0, file, line,
-                      "Warning: end of file treated as newline"));
+                      _("Warning: end of file treated as newline")));
   /* On the rare occasion that dnl crosses include file boundaries
      (either the input file did not end in a newline, or changeword
      was used), calling next_char can update current_file and
@@ -783,7 +789,7 @@ set_word_regexp (const char *regexp)
   if (msg != NULL)
     {
       M4ERROR ((warning_status, 0,
-                "bad regular expression `%s': %s", regexp, msg));
+                _("bad regular expression `%s': %s"), regexp, msg));
       return;
     }
 
@@ -872,15 +878,14 @@ next_token (token_data *td, int *line)
       else
         /* current_file changed to "" if we see CHAR_EOF, use the
            previous value we stored earlier.  */
-        M4ERROR_AT_LINE ((EXIT_FAILURE, 0, file, *line,
-                          "ERROR: end of file in comment"));
+        m4_failure_at_line (0, file, *line, _("ERROR: end of file in comment"));
 
       type = TOKEN_STRING;
     }
-  else if (default_word_regexp && (isalpha (ch) || ch == '_'))
+  else if (default_word_regexp && (c_isalpha (ch) || ch == '_'))
     {
       obstack_1grow (&token_stack, ch);
-      while ((ch = peek_input ()) != CHAR_EOF && (isalnum (ch) || ch == '_'))
+      while ((ch = peek_input ()) != CHAR_EOF && (c_isalnum (ch) || ch == '_'))
         {
           obstack_1grow (&token_stack, ch);
           next_char ();
@@ -992,8 +997,8 @@ next_token (token_data *td, int *line)
           if (ch == CHAR_EOF)
             /* current_file changed to "" if we see CHAR_EOF, use
                the previous value we stored earlier.  */
-            M4ERROR_AT_LINE ((EXIT_FAILURE, 0, file, *line,
-                              "ERROR: end of file in string"));
+            m4_failure_at_line (0, file, *line,
+                                _("ERROR: end of file in string"));
 
           if (MATCH (ch, rquote.string, true))
             {
@@ -1050,7 +1055,7 @@ peek_token (void)
     {
       result = TOKEN_STRING;
     }
-  else if ((default_word_regexp && (isalpha (ch) || ch == '_'))
+  else if ((default_word_regexp && (c_isalpha (ch) || ch == '_'))
 #ifdef ENABLE_CHANGEWORD
            || (! default_word_regexp && word_regexp.fastmap[ch])
 #endif /* ENABLE_CHANGEWORD */
@@ -1145,7 +1150,7 @@ print_token (const char *s, token_type t, token_data *td)
   xfprintf (stderr, "\t\"%s\"\n", TOKEN_DATA_TEXT (td));
 }
 
-static void M4_GNUC_UNUSED
+static void MAYBE_UNUSED
 lex_debug (void)
 {
   token_type t;
index 79946b9..2bd5775 100644 (file)
--- a/src/m4.c
+++ b/src/m4.c
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2004-2014, 2016 Free Software Foundation,
-   Inc.
+   Copyright (C) 1989-1994, 2004-2014, 2016-2017, 2020-2021 Free
+   Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #include "m4.h"
 #include <signal.h>
 
 #include "c-stack.h"
+#include "configmake.h"
 #include "ignore-value.h"
 #include "progname.h"
+#include "propername.h"
 #include "version-etc.h"
 
 #ifdef DEBUG_STKOVF
 # include "assert.h"
 #endif
 
-#define AUTHORS "Rene' Seindal"
+/* TRANSLATORS: This is a non-ASCII name: The first name is (with
+   Unicode escapes) "Ren\u00e9" or (with HTML entities) "Ren&eacute;".  */
+#define AUTHORS proper_name_utf8 ("Rene' Seindal", "Ren\xC3\xA9 Seindal")
 
-static void usage (int) M4_GNUC_NORETURN;
+static _Noreturn void usage (int);
 
 /* Enable sync output for /lib/cpp (-s).  */
 int sync_output = 0;
@@ -103,6 +107,16 @@ m4_error (int status, int errnum, const char *format, ...)
   va_end (args);
 }
 
+void
+m4_failure (int errnum, const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  verror_at_line (EXIT_FAILURE, errnum, current_line ? current_file : NULL,
+                  current_line, format, args);
+  assume (false);
+}
+
 /*-------------------------------.
 | Wrapper around error_at_line.  |
 `-------------------------------*/
@@ -119,6 +133,17 @@ m4_error_at_line (int status, int errnum, const char *file, int line,
   va_end (args);
 }
 
+void
+m4_failure_at_line (int errnum, const char *file, int line,
+                    const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  verror_at_line (EXIT_FAILURE, errnum, line ? file : NULL,
+                  line, format, args);
+  assume (false);
+}
+
 #ifndef SIGBUS
 # define SIGBUS SIGILL
 #endif
@@ -141,7 +166,7 @@ static const char * volatile signal_message[NSIG];
    must be aysnc-signal safe, since it is executed as a signal
    handler.  If SIGNO is zero, this represents a stack overflow; in
    that case, we return to allow c_stack_action to handle things.  */
-static void M4_GNUC_PURE
+static void
 fault_handler (int signo)
 {
   if (signo)
@@ -178,46 +203,54 @@ static void
 usage (int status)
 {
   if (status != EXIT_SUCCESS)
-    xfprintf (stderr, "Try `%s --help' for more information.\n", program_name);
+    {
+      xfprintf (stderr, _("Try `%s --help' for more information."),
+                program_name);
+      fputs ("\n", stderr);
+    }
   else
     {
-      xprintf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
-      fputs ("\
+      xprintf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
+      fputs (_("\
 Process macros in FILEs.  If no FILE or if FILE is `-', standard input\n\
 is read.\n\
-", stdout);
-      fputs ("\
-\n\
+"), stdout);
+      puts ("");
+      fputs (_("\
 Mandatory or optional arguments to long options are mandatory or optional\n\
 for short options too.\n\
-\n\
+"), stdout);
+      puts ("");
+      fputs (_("\
 Operation modes:\n\
       --help                   display this help and exit\n\
       --version                output version information and exit\n\
-", stdout);
-      xprintf ("\
+"), stdout);
+      fputs (_("\
   -E, --fatal-warnings         once: warnings become errors, twice: stop\n\
                                  execution at first error\n\
   -i, --interactive            unbuffer output, ignore interrupts\n\
   -P, --prefix-builtins        force a `m4_' prefix to all builtins\n\
   -Q, --quiet, --silent        suppress some warnings for builtins\n\
+"), stdout);
+      xprintf (_("\
       --warn-macro-sequence[=REGEXP]\n\
                                warn if macro definition matches REGEXP,\n\
                                  default %s\n\
-", DEFAULT_MACRO_SEQUENCE);
+"), DEFAULT_MACRO_SEQUENCE);
 #ifdef ENABLE_CHANGEWORD
-      fputs ("\
+      fputs (_("\
   -W, --word-regexp=REGEXP     use REGEXP for macro name syntax\n\
-", stdout);
+"), stdout);
 #endif
-      fputs ("\
-\n\
+      puts ("");
+      fputs (_("\
 Preprocessor features:\n\
   -D, --define=NAME[=VALUE]    define NAME as having VALUE, or empty\n\
   -I, --include=DIRECTORY      append DIRECTORY to include path\n\
   -s, --synclines              generate `#line NUM \"FILE\"' lines\n\
   -U, --undefine=NAME          undefine NAME\n\
-", stdout);
+"), stdout);
       puts ("");
       xprintf (_("\
 Limits control:\n\
@@ -227,45 +260,47 @@ Limits control:\n\
   -L, --nesting-limit=NUMBER   change nesting limit, 0 for unlimited [%d]\n\
 "), nesting_limit);
       puts ("");
-      fputs ("\
+      fputs (_("\
 Frozen state files:\n\
   -F, --freeze-state=FILE      produce a frozen state on FILE at end\n\
   -R, --reload-state=FILE      reload a frozen state from FILE at start\n\
-", stdout);
-      fputs ("\
-\n\
+"), stdout);
+      puts ("");
+      fputs (_("\
 Debugging:\n\
   -d, --debug[=FLAGS]          set debug level (no FLAGS implies `aeq')\n\
       --debugfile[=FILE]       redirect debug and trace output to FILE\n\
                                  (default stderr, discard if empty string)\n\
   -l, --arglength=NUM          restrict macro tracing size\n\
   -t, --trace=NAME             trace NAME when it is defined\n\
-", stdout);
-      fputs ("\
-\n\
+"), stdout);
+      puts ("");
+      fputs (_("\
 FLAGS is any of:\n\
   a   show actual arguments\n\
   c   show before collect, after collect and after call\n\
   e   show expansion\n\
   f   say current input file name\n\
   i   show changes in input files\n\
+"), stdout);
+      fputs (_("\
   l   say current input line number\n\
   p   show results of path searches\n\
   q   quote values as necessary, with a or e flag\n\
   t   trace for all macro calls, not only traceon'ed\n\
   x   add a unique macro call id, useful with c flag\n\
   V   shorthand for all of the above flags\n\
-", stdout);
-      fputs ("\
-\n\
+"), stdout);
+      puts ("");
+      fputs (_("\
 If defined, the environment variable `M4PATH' is a colon-separated list\n\
 of directories included after any specified by `-I'.\n\
-", stdout);
-      fputs ("\
-\n\
+"), stdout);
+      puts ("");
+      fputs (_("\
 Exit status is 0 for success, 1 for failure, 63 for frozen file version\n\
 mismatch, or whatever value was passed to the m4exit macro.\n\
-", stdout);
+"), stdout);
       emit_bug_reporting_address ();
     }
   exit (status);
@@ -383,6 +418,9 @@ main (int argc, char *const *argv)
 
   set_program_name (argv[0]);
   retcode = EXIT_SUCCESS;
+  setlocale (LC_ALL, "");
+  bindtextdomain (PACKAGE, LOCALEDIR);
+  textdomain (PACKAGE);
   atexit (close_stdin);
 
   include_init ();
@@ -538,7 +576,7 @@ main (int argc, char *const *argv)
 
       case 'e':
         error (0, 0, _("warning: `m4 -e' is deprecated, use `-i' instead"));
-        /* fall through */
+        FALLTHROUGH;
       case 'i':
         interactive = true;
         break;
@@ -584,7 +622,8 @@ main (int argc, char *const *argv)
 
   /* Do the basic initializations.  */
   if (debugfile && !debug_set_output (debugfile))
-    M4ERROR ((warning_status, errno, "cannot set debug file `%s'", debugfile));
+    M4ERROR ((warning_status, errno, _("cannot set debug file `%s'"),
+              debugfile));
 
   input_init ();
   output_init ();
@@ -647,7 +686,7 @@ main (int argc, char *const *argv)
 
         case DEBUGFILE_OPTION:
           if (!debug_set_output (defines->arg))
-            M4ERROR ((warning_status, errno, "cannot set debug file `%s'",
+            M4ERROR ((warning_status, errno, _("cannot set debug file `%s'"),
                       debugfile ? debugfile : _("stderr")));
           break;
 
index 9a13257..b9ee884 100644 (file)
--- a/src/m4.h
+++ b/src/m4.h
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2004-2014, 2016 Free Software Foundation,
-   Inc.
+   Copyright (C) 1989-1994, 2004-2014, 2016-2017, 2020-2021 Free Software
+   Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 /* We use <config.h> instead of "config.h" so that a compilation
 #include <config.h>
 
 #include <assert.h>
-#include <ctype.h>
+#include <c-ctype.h>
 #include <errno.h>
 #include <limits.h>
+#include <locale.h>
 #include <stdbool.h>
 #include <stdint.h>
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 
+#include "attribute.h"
 #include "binary-io.h"
 #include "clean-temp.h"
 #include "cloexec.h"
@@ -48,6 +50,7 @@
 #include "stdio--.h"
 #include "stdlib--.h"
 #include "unistd--.h"
+#include "verify.h"
 #include "verror.h"
 #include "xalloc.h"
 #include "xprintf.h"
 /* Used for version mismatch, when -R detects a frozen file it can't parse.  */
 #define EXIT_MISMATCH 63
 
-/* No-op, for future gettext compatibility.  */
-#define _(ARG) ARG
+/* NLS.  */
+
+#include "gettext.h"
+#if ! ENABLE_NLS
+# undef textdomain
+# define textdomain(Domainname) /* empty */
+# undef bindtextdomain
+# define bindtextdomain(Domainname, Dirname) /* empty */
+#endif
+
+#define _(msgid) gettext (msgid)
 \f
 /* Various declarations.  */
 
@@ -106,20 +118,6 @@ typedef bool bool_bitfield;
 #else
 typedef unsigned int bool_bitfield;
 #endif /* ! __GNUC__ */
-
-/* Take advantage of GNU C compiler source level optimization hints,
-   using portable macros.  */
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 6)
-# define M4_GNUC_ATTRIBUTE(args)        __attribute__ (args)
-#else
-# define M4_GNUC_ATTRIBUTE(args)
-#endif  /* __GNUC__ */
-
-#define M4_GNUC_UNUSED          M4_GNUC_ATTRIBUTE ((__unused__))
-#define M4_GNUC_PRINTF(fmt, arg)                        \
-  M4_GNUC_ATTRIBUTE ((__format__ (__printf__, fmt, arg)))
-#define M4_GNUC_NORETURN        M4_GNUC_ATTRIBUTE ((__noreturn__))
-#define M4_GNUC_PURE            M4_GNUC_ATTRIBUTE ((__pure__))
 \f
 /* File: m4.c  --- global definitions.  */
 
@@ -140,9 +138,15 @@ extern const char *user_word_regexp;    /* -W */
 /* Error handling.  */
 extern int retcode;
 
-extern void m4_error (int, int, const char *, ...) M4_GNUC_PRINTF(3, 4);
-extern void m4_error_at_line (int, int, const char *, int,
-                              const char *, ...) M4_GNUC_PRINTF(5, 6);
+extern void m4_error (int, int, const char *, ...)
+  ATTRIBUTE_FORMAT ((__printf__, 3, 4));
+extern void m4_error_at_line (int, int, const char *, int, const char *, ...)
+  ATTRIBUTE_FORMAT ((__printf__, 5, 6));
+extern _Noreturn void m4_failure (int, const char *, ...)
+  ATTRIBUTE_FORMAT ((__printf__, 2, 3));
+extern _Noreturn void m4_failure_at_line (int, const char *, int,
+                                          const char *, ...)
+  ATTRIBUTE_FORMAT ((__printf__, 4, 5));
 
 #define M4ERROR(Arglist) (m4_error Arglist)
 #define M4ERROR_AT_LINE(Arglist) (m4_error_at_line Arglist)
@@ -355,21 +359,21 @@ enum symbol_lookup
 /* Symbol table entry.  */
 struct symbol
 {
-  struct symbol *next;
+  struct symbol *stack; /* pushdef stack */
+  struct symbol *next; /* hash bucket chain */
   bool_bitfield traced : 1;
-  bool_bitfield shadowed : 1;
   bool_bitfield macro_args : 1;
   bool_bitfield blind_no_args : 1;
   bool_bitfield deleted : 1;
   int pending_expansions;
 
+  size_t hash;
   char *name;
   token_data data;
 };
 
-#define SYMBOL_NEXT(S)          ((S)->next)
+#define SYMBOL_STACK(S)         ((S)->stack)
 #define SYMBOL_TRACED(S)        ((S)->traced)
-#define SYMBOL_SHADOWED(S)      ((S)->shadowed)
 #define SYMBOL_MACRO_ARGS(S)    ((S)->macro_args)
 #define SYMBOL_BLIND_NO_ARGS(S) ((S)->blind_no_args)
 #define SYMBOL_DELETED(S)       ((S)->deleted)
@@ -383,9 +387,7 @@ typedef enum symbol_lookup symbol_lookup;
 typedef struct symbol symbol;
 typedef void hack_symbol (symbol *, void *);
 
-#define HASHMAX 509             /* default, overridden by -Hsize */
-
-extern symbol **symtab;
+#define HASHMAX 65537             /* default, overridden by -Hsize */
 
 extern void free_symbol (symbol *sym);
 extern void symtab_init (void);
index 81218e7..7359e43 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2006-2007, 2009-2014, 2016 Free Software
-   Foundation, Inc.
+   Copyright (C) 1989-1994, 2006-2007, 2009-2014, 2016-2017, 2020-2021
+   Free Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 /* This file contains the functions, that performs the basic argument
@@ -153,7 +153,7 @@ expand_argument (struct obstack *obs, token_data *argp)
     {
       t = next_token (&td, NULL);
     }
-  while (t == TOKEN_SIMPLE && isspace (to_uchar (*TOKEN_DATA_TEXT (&td))));
+  while (t == TOKEN_SIMPLE && c_isspace (*TOKEN_DATA_TEXT (&td)));
 
   paren_level = 0;
 
@@ -177,7 +177,7 @@ expand_argument (struct obstack *obs, token_data *argp)
                 }
               return t == TOKEN_COMMA;
             }
-          /* fallthru */
+          FALLTHROUGH;
         case TOKEN_OPEN:
         case TOKEN_SIMPLE:
           text = TOKEN_DATA_TEXT (&td);
@@ -192,9 +192,8 @@ expand_argument (struct obstack *obs, token_data *argp)
         case TOKEN_EOF:
           /* current_file changed to "" if we see TOKEN_EOF, use the
              previous value we stored earlier.  */
-          M4ERROR_AT_LINE ((EXIT_FAILURE, 0, file, line,
-                            "ERROR: end of file in argument list"));
-          break;
+          m4_failure_at_line (0, file, line,
+                              _("ERROR: end of file in argument list"));
 
         case TOKEN_WORD:
         case TOKEN_STRING:
@@ -330,9 +329,8 @@ expand_macro (symbol *sym)
   SYMBOL_PENDING_EXPANSIONS (sym)++;
   expansion_level++;
   if (nesting_limit > 0 && expansion_level > nesting_limit)
-    M4ERROR ((EXIT_FAILURE, 0,
-              "recursion limit of %d exceeded, use -L<N> to change it",
-              nesting_limit));
+    m4_failure (0, _("recursion limit of %d exceeded, use -L<N> to change it"),
+                nesting_limit);
 
   macro_call_id++;
   my_call_id = macro_call_id;
@@ -357,7 +355,7 @@ expand_macro (symbol *sym)
 
   argc = ((obstack_object_size (&argv_stack) - argv_base)
           / sizeof (token_data *));
-  argv = (token_data **) ((char *) obstack_base (&argv_stack) + argv_base);
+  argv = (token_data **) ((uintptr_t) obstack_base (&argv_stack) + argv_base);
 
   loc_close_file = current_file;
   loc_close_line = current_line;
index 9c916d9..6f148ce 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2004-2014, 2016 Free Software Foundation,
-   Inc.
+   Copyright (C) 1989-1994, 2004-2014, 2016-2017, 2020-2021 Free
+   Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 #include "m4.h"
@@ -169,7 +169,7 @@ cleanup_tmpfile (void)
               && close_stream_temp (diversion->u.file) != 0)
             {
               M4ERROR ((0, errno,
-                        "cannot clean temporary file for diversion"));
+                        _("cannot clean temporary file for diversion")));
               fail = true;
             }
         }
@@ -219,22 +219,17 @@ m4_tmpfile (int divnum)
     {
       output_temp_dir = create_temp_dir ("m4-", NULL, true);
       if (output_temp_dir == NULL)
-        M4ERROR ((EXIT_FAILURE, errno,
-                  "cannot create temporary file for diversion"));
+        m4_failure (errno, _("cannot create temporary file for diversion"));
       atexit (cleanup_tmpfile);
     }
   name = m4_tmpname (divnum);
   register_temp_file (output_temp_dir, name);
-  file = fopen_temp (name, O_BINARY ? "wb+" : "w+");
+  file = fopen_temp (name, O_BINARY ? "wb+e" : "w+e", false);
   if (file == NULL)
     {
       unregister_temp_file (output_temp_dir, name);
-      M4ERROR ((EXIT_FAILURE, errno,
-                "cannot create temporary file for diversion"));
+      m4_failure (errno, _("cannot create temporary file for diversion"));
     }
-  else if (set_cloexec_flag (fileno (file), true) != 0)
-    M4ERROR ((warning_status, errno,
-              "Warning: cannot protect diversion across forks"));
   return file;
 }
 
@@ -252,32 +247,26 @@ m4_tmpopen (int divnum, bool reread)
   if (tmp_file1_owner == divnum)
     {
       if (reread && fseeko (tmp_file1, 0, SEEK_SET) != 0)
-        m4_error (EXIT_FAILURE, errno,
-                  _("cannot seek within diversion"));
+        m4_failure (errno, _("cannot seek within diversion"));
       tmp_file2_recent = false;
       return tmp_file1;
     }
   else if (tmp_file2_owner == divnum)
     {
       if (reread && fseeko (tmp_file2, 0, SEEK_SET) != 0)
-        m4_error (EXIT_FAILURE, errno,
-                  _("cannot seek within diversion"));
+        m4_failure (errno, _("cannot seek within diversion"));
       tmp_file2_recent = true;
       return tmp_file2;
     }
   name = m4_tmpname (divnum);
   /* We need update mode, to avoid truncation.  */
-  file = fopen_temp (name, O_BINARY ? "rb+" : "r+");
+  file = fopen_temp (name, O_BINARY ? "rb+e" : "r+e", false);
   if (file == NULL)
-    M4ERROR ((EXIT_FAILURE, errno,
-              "cannot create temporary file for diversion"));
-  else if (set_cloexec_flag (fileno (file), true) != 0)
-    m4_error (0, errno, _("cannot protect diversion across forks"));
+    m4_failure (errno, _("cannot create temporary file for diversion"));
   /* Update mode starts at the beginning of the stream, but sometimes
      we want the end.  */
   else if (!reread && fseeko (file, 0, SEEK_END) != 0)
-    m4_error (EXIT_FAILURE, errno,
-              _("cannot seek within diversion"));
+    m4_failure (errno, _("cannot seek within diversion"));
   return file;
 }
 
@@ -349,8 +338,7 @@ m4_tmprename (int oldnum, int newnum)
       else
         {
           if (close_stream_temp (tmp_file1))
-            m4_error (EXIT_FAILURE, errno,
-                      _("cannot close temporary file for diversion"));
+            m4_failure (errno, _("cannot close temporary file for diversion"));
           tmp_file1_owner = 0;
         }
     }
@@ -362,16 +350,14 @@ m4_tmprename (int oldnum, int newnum)
       else
         {
           if (close_stream_temp (tmp_file2))
-            m4_error (EXIT_FAILURE, errno,
-                      _("cannot close temporary file for diversion"));
+            m4_failure (errno, _("cannot close temporary file for diversion"));
           tmp_file2_owner = 0;
         }
     }
   /* Either it is safe to rename an open file, or no one should have
      oldname open at this point.  */
   if (rename (oldname, newname))
-    m4_error (EXIT_FAILURE, errno,
-              _("cannot create temporary file for diversion"));
+    m4_failure (errno, _("cannot create temporary file for diversion"));
   unregister_temp_file (output_temp_dir, oldname);
   free (oldname);
   return m4_tmpopen (newnum, false);
@@ -484,8 +470,8 @@ make_room_for (int length)
           count = fwrite (selected_buffer, (size_t) selected_diversion->used,
                           1, selected_diversion->u.file);
           if (count != 1)
-            M4ERROR ((EXIT_FAILURE, errno,
-                      "ERROR: cannot flush diversion to temporary file"));
+            m4_failure (errno,
+                        _("ERROR: cannot flush diversion to temporary file"));
         }
 
       /* Reclaim the buffer space for other diversions.  */
@@ -579,7 +565,7 @@ output_text (const char *text, int length)
     {
       count = fwrite (text, length, 1, output_file);
       if (count != 1)
-        M4ERROR ((EXIT_FAILURE, errno, "ERROR: copying inserted file"));
+        m4_failure (errno, _("ERROR: copying inserted file"));
     }
   else
     {
@@ -631,14 +617,14 @@ shipout_text (struct obstack *obs, const char *text, int length, int line)
 
         /* In-line short texts.  */
 
-      case 8: OUTPUT_CHARACTER (*text); text++;
-      case 7: OUTPUT_CHARACTER (*text); text++;
-      case 6: OUTPUT_CHARACTER (*text); text++;
-      case 5: OUTPUT_CHARACTER (*text); text++;
-      case 4: OUTPUT_CHARACTER (*text); text++;
-      case 3: OUTPUT_CHARACTER (*text); text++;
-      case 2: OUTPUT_CHARACTER (*text); text++;
-      case 1: OUTPUT_CHARACTER (*text);
+      case 8: OUTPUT_CHARACTER (*text); text++; FALLTHROUGH;
+      case 7: OUTPUT_CHARACTER (*text); text++; FALLTHROUGH;
+      case 6: OUTPUT_CHARACTER (*text); text++; FALLTHROUGH;
+      case 5: OUTPUT_CHARACTER (*text); text++; FALLTHROUGH;
+      case 4: OUTPUT_CHARACTER (*text); text++; FALLTHROUGH;
+      case 3: OUTPUT_CHARACTER (*text); text++; FALLTHROUGH;
+      case 2: OUTPUT_CHARACTER (*text); text++; FALLTHROUGH;
+      case 1: OUTPUT_CHARACTER (*text); FALLTHROUGH;
       case 0:
         return;
 
@@ -827,7 +813,7 @@ insert_file (FILE *file)
     {
       length = fread (buffer, 1, sizeof buffer, file);
       if (ferror (file))
-        M4ERROR ((EXIT_FAILURE, errno, "error reading inserted file"));
+        m4_failure (errno, _("error reading inserted file"));
       if (length == 0)
         break;
       output_text (buffer, length);
@@ -912,7 +898,7 @@ insert_diversion_helper (m4_diversion *diversion)
                       _("cannot clean temporary file for diversion"));
         }
       if (m4_tmpremove (diversion->divnum) != 0)
-        M4ERROR ((0, errno, "cannot clean temporary file for diversion"));
+        M4ERROR ((0, errno, _("cannot clean temporary file for diversion")));
     }
   diversion->used = 0;
   gl_oset_remove (diversion_table, diversion);
@@ -994,11 +980,11 @@ freeze_diversions (FILE *file)
               struct stat file_stat;
               diversion->u.file = m4_tmpopen (diversion->divnum, true);
               if (fstat (fileno (diversion->u.file), &file_stat) < 0)
-                M4ERROR ((EXIT_FAILURE, errno, "cannot stat diversion"));
+                m4_failure (errno, _("cannot stat diversion"));
               if (file_stat.st_size < 0
                   || (file_stat.st_size + 0UL
                       != (unsigned long int) file_stat.st_size))
-                M4ERROR ((EXIT_FAILURE, 0, "diversion too large"));
+                m4_failure (0, _("diversion too large"));
               xfprintf (file, "D%d,%lu\n", diversion->divnum,
                         (unsigned long int) file_stat.st_size);
             }
index 88d2c81..71ccb3e 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1993, 2004, 2006-2014, 2016 Free Software
-   Foundation, Inc.
+   Copyright (C) 1989-1993, 2004, 2006-2014, 2016-2017, 2020-2021 Free
+   Software Foundation, Inc.
 
    This file is part of GNU M4.
 
@@ -16,7 +16,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 /* Handling of path search of included files via the builtins "include"
@@ -110,7 +110,7 @@ add_include_directory (const char *dir)
 static FILE *
 m4_fopen (const char *file)
 {
-  FILE *fp = fopen (file, "r");
+  FILE *fp = fopen (file, "re");
   if (fp)
     {
       struct stat st;
@@ -121,9 +121,6 @@ m4_fopen (const char *file)
           errno = EISDIR;
           return NULL;
         }
-      if (set_cloexec_flag (fd, true) != 0)
-        M4ERROR ((warning_status, errno,
-                  "Warning: cannot protect input file across forks"));
     }
   return fp;
 }
@@ -192,7 +189,7 @@ m4_path_search (const char *file, char **result)
 
 #ifdef DEBUG_INCL
 
-static void M4_GNUC_UNUSED
+static void MAYBE_UNUSED
 include_dump (void)
 {
   includes *incl;
index 26a722f..c5a8564 100644 (file)
@@ -1,7 +1,7 @@
 /* GNU m4 -- A simple macro processor
 
-   Copyright (C) 1989-1994, 2003, 2006-2014, 2016 Free Software
-   Foundation, Inc.
+   Copyright (C) 1989-1994, 2003, 2006-2014, 2016-2017, 2020-2021 Free
+   Software Foundation, Inc.
 
    This file is part of GNU M4.
 
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
 
 /* This file handles all the low level work around the symbol table.  The
    symbol table is a simple chained hash table.  Each symbol is described
    by a struct symbol, which is placed in the hash table based upon the
    symbol name.  Symbols that hash to the same entry in the table are
-   kept on a list, sorted by name.  As a special case, to facilitate the
+   kept on a list, sorted by hash.  As a special case, to facilitate the
    "pushdef" and "popdef" builtins, a symbol can be several times in the
    symbol table, one for each definition.  Since the name is the same,
    all the entries for the symbol will be on the same list, and will
@@ -93,7 +93,7 @@ profile_strcmp (const char *s1, const char *s2)
 `------------------------------------------------------------------*/
 
 /* Pointer to symbol table.  */
-symbol **symtab;
+static symbol **symtab;
 
 void
 symtab_init (void)
@@ -120,7 +120,7 @@ symtab_init (void)
 | Return a hashvalue for a string, from GNU-emacs.  |
 `--------------------------------------------------*/
 
-static size_t M4_GNUC_PURE
+static size_t ATTRIBUTE_PURE
 hash (const char *s)
 {
   register size_t val = 0;
@@ -144,7 +144,8 @@ free_symbol (symbol *sym)
     SYMBOL_DELETED (sym) = true;
   else
     {
-      free (SYMBOL_NAME (sym));
+      if (SYMBOL_STACK (sym) == NULL)
+        free (SYMBOL_NAME (sym));
       if (SYMBOL_TYPE (sym) == TOKEN_TEXT)
         free (SYMBOL_TEXT (sym));
       free (sym);
@@ -182,7 +183,9 @@ lookup_symbol (const char *name, symbol_lookup mode)
 
   for (prev = NULL; sym != NULL; prev = sym, sym = sym->next)
     {
-      cmp = strcmp (SYMBOL_NAME (sym), name);
+      cmp = (h > sym->hash) - (h < sym->hash);
+      if (cmp == 0)
+        cmp = strcmp (SYMBOL_NAME (sym), name);
       if (cmp >= 0)
         break;
     }
@@ -216,45 +219,52 @@ lookup_symbol (const char *name, symbol_lookup mode)
               sym = (symbol *) xmalloc (sizeof (symbol));
               SYMBOL_TYPE (sym) = TOKEN_VOID;
               SYMBOL_TRACED (sym) = SYMBOL_TRACED (old);
-              SYMBOL_NAME (sym) = xstrdup (name);
-              SYMBOL_SHADOWED (sym) = false;
+              sym->hash = h;
+              SYMBOL_NAME (sym) = old->name;
+              old->name = xstrdup (name);
               SYMBOL_MACRO_ARGS (sym) = false;
               SYMBOL_BLIND_NO_ARGS (sym) = false;
               SYMBOL_DELETED (sym) = false;
               SYMBOL_PENDING_EXPANSIONS (sym) = 0;
 
-              SYMBOL_NEXT (sym) = SYMBOL_NEXT (old);
-              SYMBOL_NEXT (old) = NULL;
-              (*spp) = sym;
+              SYMBOL_STACK (sym) = SYMBOL_STACK (old);
+              SYMBOL_STACK (old) = NULL;
+              sym->next = old->next;
+              old->next = NULL;
+              *spp = sym;
             }
           return sym;
         }
-      /* Fall through.  */
+      FALLTHROUGH;
 
     case SYMBOL_PUSHDEF:
 
       /* Insert a name in the symbol table.  If there is already a symbol
-         with the name, insert this in front of it, and mark the old
-         symbol as "shadowed".  */
+         with the name, insert this in front of it.  */
 
       sym = (symbol *) xmalloc (sizeof (symbol));
       SYMBOL_TYPE (sym) = TOKEN_VOID;
       SYMBOL_TRACED (sym) = false;
-      SYMBOL_NAME (sym) = xstrdup (name);
-      SYMBOL_SHADOWED (sym) = false;
+      sym->hash = h;
       SYMBOL_MACRO_ARGS (sym) = false;
       SYMBOL_BLIND_NO_ARGS (sym) = false;
       SYMBOL_DELETED (sym) = false;
       SYMBOL_PENDING_EXPANSIONS (sym) = 0;
 
-      SYMBOL_NEXT (sym) = *spp;
-      (*spp) = sym;
+      SYMBOL_STACK (sym) = NULL;
+      sym->next = *spp;
+      *spp = sym;
 
       if (mode == SYMBOL_PUSHDEF && cmp == 0)
         {
-          SYMBOL_SHADOWED (SYMBOL_NEXT (sym)) = true;
-          SYMBOL_TRACED (sym) = SYMBOL_TRACED (SYMBOL_NEXT (sym));
+          SYMBOL_STACK (sym) = sym->next;
+          sym->next = SYMBOL_STACK (sym)->next;
+          SYMBOL_STACK (sym)->next = NULL;
+          SYMBOL_TRACED (sym) = SYMBOL_TRACED (SYMBOL_STACK (sym));
+          SYMBOL_NAME (sym) = SYMBOL_NAME (SYMBOL_STACK (sym));
         }
+      else
+        SYMBOL_NAME (sym) = xstrdup (name);
       return sym;
 
     case SYMBOL_DELETE:
@@ -271,37 +281,41 @@ lookup_symbol (const char *name, symbol_lookup mode)
         return NULL;
       {
         bool traced = false;
-        if (SYMBOL_NEXT (sym) != NULL
-            && SYMBOL_SHADOWED (SYMBOL_NEXT (sym))
+        symbol *next;
+        if (SYMBOL_STACK (sym) != NULL
             && mode == SYMBOL_POPDEF)
           {
-            SYMBOL_SHADOWED (SYMBOL_NEXT (sym)) = false;
-            SYMBOL_TRACED (SYMBOL_NEXT (sym)) = SYMBOL_TRACED (sym);
+            SYMBOL_TRACED (SYMBOL_STACK (sym)) = SYMBOL_TRACED (sym);
+            SYMBOL_STACK (sym)->next = sym->next;
+            *spp = SYMBOL_STACK (sym);
           }
         else
-          traced = SYMBOL_TRACED (sym);
+          {
+            traced = SYMBOL_TRACED (sym);
+            *spp = sym->next;
+          }
         do
           {
-            *spp = SYMBOL_NEXT (sym);
+            next = SYMBOL_STACK (sym);
             free_symbol (sym);
-            sym = *spp;
+            sym = next;
           }
-        while (*spp != NULL && SYMBOL_SHADOWED (*spp)
-               && mode == SYMBOL_DELETE);
+        while (next != NULL && mode == SYMBOL_DELETE);
         if (traced)
           {
             sym = (symbol *) xmalloc (sizeof (symbol));
             SYMBOL_TYPE (sym) = TOKEN_VOID;
             SYMBOL_TRACED (sym) = true;
+            sym->hash = h;
             SYMBOL_NAME (sym) = xstrdup (name);
-            SYMBOL_SHADOWED (sym) = false;
             SYMBOL_MACRO_ARGS (sym) = false;
             SYMBOL_BLIND_NO_ARGS (sym) = false;
             SYMBOL_DELETED (sym) = false;
             SYMBOL_PENDING_EXPANSIONS (sym) = 0;
 
-            SYMBOL_NEXT (sym) = *spp;
-            (*spp) = sym;
+            SYMBOL_STACK (sym) = NULL;
+            sym->next = *spp;
+            *spp = sym;
           }
       }
       return NULL;
@@ -339,7 +353,7 @@ hack_all_symbols (hack_symbol *func, void *data)
          calling func.  */
       for (sym = symtab[h]; sym != NULL; sym = next)
         {
-          next = SYMBOL_NEXT (sym);
+          next = sym->next;
           func (sym, data);
         }
     }
@@ -349,7 +363,7 @@ hack_all_symbols (hack_symbol *func, void *data)
 
 static void symtab_print_list (int i);
 
-static void M4_GNUC_UNUSED
+static void MAYBE_UNUSED
 symtab_debug (void)
 {
   token_data td;
@@ -383,19 +397,21 @@ static void
 symtab_print_list (int i)
 {
   symbol *sym;
+  symbol *bucket;
   size_t h;
 
   xprintf ("Symbol dump #%d:\n", i);
   for (h = 0; h < hash_table_size; h++)
-    for (sym = symtab[h]; sym != NULL; sym = sym->next)
-      xprintf ("\tname %s, bucket %lu, addr %p, next %p, "
-               "flags%s%s%s, pending %d\n",
-               SYMBOL_NAME (sym),
-               (unsigned long int) h, sym, SYMBOL_NEXT (sym),
-               SYMBOL_TRACED (sym) ? " traced" : "",
-               SYMBOL_SHADOWED (sym) ? " shadowed" : "",
-               SYMBOL_DELETED (sym) ? " deleted" : "",
-               SYMBOL_PENDING_EXPANSIONS (sym));
+    for (bucket = symtab[h]; bucket != NULL; bucket = bucket->next)
+      for (sym = bucket; sym; sym = sym->stack)
+        xprintf ("\tname %s, hash %lu, bucket %lu, addr %p, stack %p, "
+                 "next %p, flags%s%s, pending %d\n",
+                 SYMBOL_NAME (sym), (unsigned long int) sym->hash,
+                 (unsigned long int) h, sym, SYMBOL_STACK (sym),
+                 sym->next,
+                 SYMBOL_TRACED (sym) ? " traced" : "",
+                 SYMBOL_DELETED (sym) ? " deleted" : "",
+                 SYMBOL_PENDING_EXPANSIONS (sym));
 }
 
 #endif /* DEBUG_SYM */
index ba5f188..2f580ea 100644 (file)
@@ -1,6 +1,7 @@
 ## Makefile.am - template for generating Makefile via Automake
 ##
-## Copyright (C) 2009-2014, 2016 Free Software Foundation, Inc.
+## Copyright (C) 2009-2014, 2016-2017, 2020-2021 Free Software
+## Foundation, Inc.
 ##
 ## This file is part of GNU M4.
 ##
@@ -15,6 +16,6 @@
 ## GNU General Public License for more details.
 ##
 ## You should have received a copy of the GNU General Public License
-## along with this program.  If not, see <http://www.gnu.org/licenses/>.
+## along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 include gnulib.mk
index 74666a1..64ce81c 100644 (file)
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.15 from Makefile.am.
+# Makefile.in generated by automake 1.16.3 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2014 Free Software Foundation, Inc.
+# Copyright (C) 1994-2020 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,7 @@
 
 @SET_MAKE@
 
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+# along with this file.  If not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License,
 # this file may be distributed as part of a program that
@@ -111,251 +111,402 @@ PRE_UNINSTALL = :
 POST_UNINSTALL = :
 build_triplet = @build@
 host_triplet = @host@
-TESTS = test-alignof$(EXEEXT) test-alloca-opt$(EXEEXT) \
-       test-array_list$(EXEEXT) test-array_oset$(EXEEXT) \
-       test-avltree_oset$(EXEEXT) test-binary-io.sh test-btowc1.sh \
-       test-btowc2.sh test-c-ctype$(EXEEXT) test-c-stack.sh \
-       test-c-stack2.sh test-c-strcase.sh \
-       test-canonicalize-lgpl$(EXEEXT) test-chdir$(EXEEXT) \
+TESTS = test-accept$(EXEEXT) test-access$(EXEEXT) \
+       test-alignof$(EXEEXT) test-alloca-opt$(EXEEXT) $(am__EXEEXT_1) \
+       test-arpa_inet$(EXEEXT) test-array_list$(EXEEXT) \
+       test-array_oset$(EXEEXT) test-asyncsafe-spin1$(EXEEXT) \
+       test-asyncsafe-spin2$(EXEEXT) test-avltree_oset$(EXEEXT) \
+       test-binary-io.sh test-bind$(EXEEXT) test-bitrotate$(EXEEXT) \
+       test-btowc1.sh test-btowc2.sh test-c-ctype$(EXEEXT) \
+       test-c-stack.sh test-c-stack2.sh test-c-strcase.sh \
+       test-calloc-gnu$(EXEEXT) test-canonicalize-lgpl$(EXEEXT) \
+       test-canonicalize$(EXEEXT) test-chdir$(EXEEXT) \
        test-cloexec$(EXEEXT) test-close$(EXEEXT) test-closein.sh \
-       test-ctype$(EXEEXT) $(am__EXEEXT_1) test-dirent$(EXEEXT) \
+       test-connect$(EXEEXT) test-creat$(EXEEXT) $(am__EXEEXT_2) \
+       test-ctype$(EXEEXT) $(am__EXEEXT_3) test-dirent$(EXEEXT) \
        test-dirname$(EXEEXT) test-dup$(EXEEXT) test-dup2$(EXEEXT) \
-       test-environ$(EXEEXT) test-errno$(EXEEXT) test-fclose$(EXEEXT) \
-       $(am__EXEEXT_2) test-fcntl-h$(EXEEXT) test-fcntl$(EXEEXT) \
-       test-fdopen$(EXEEXT) test-fflush$(EXEEXT) test-fflush2.sh \
-       test-fgetc$(EXEEXT) test-filenamecat$(EXEEXT) \
-       test-float$(EXEEXT) test-fopen-safer$(EXEEXT) \
-       test-fopen$(EXEEXT) test-fpending.sh test-fpurge$(EXEEXT) \
-       test-fputc$(EXEEXT) test-fread$(EXEEXT) test-freadahead.sh \
-       test-freading$(EXEEXT) test-frexp-nolibm$(EXEEXT) \
+       test-dynarray$(EXEEXT) test-environ$(EXEEXT) $(am__EXEEXT_4) \
+       test-errno$(EXEEXT) test-execute.sh \
+       test-execute-script$(EXEEXT) test-explicit_bzero$(EXEEXT) \
+       test-fchdir$(EXEEXT) test-fclose$(EXEEXT) $(am__EXEEXT_5) \
+       test-fcntl-h$(EXEEXT) test-fcntl$(EXEEXT) test-fdopen$(EXEEXT) \
+       test-fdopendir$(EXEEXT) test-fflush$(EXEEXT) test-fflush2.sh \
+       test-fgetc$(EXEEXT) test-filenamecat$(EXEEXT) $(am__EXEEXT_6) \
+       test-float$(EXEEXT) test-fopen-gnu$(EXEEXT) \
+       test-fopen-safer$(EXEEXT) test-fopen$(EXEEXT) test-fpending.sh \
+       test-fpurge$(EXEEXT) test-fputc$(EXEEXT) test-fread$(EXEEXT) \
+       test-freadahead.sh test-freading$(EXEEXT) test-free$(EXEEXT) \
+       test-freopen$(EXEEXT) test-frexp-nolibm$(EXEEXT) \
        test-frexpl-nolibm$(EXEEXT) test-fseek.sh test-fseek2.sh \
        test-fseeko.sh test-fseeko2.sh test-fseeko3.sh test-fseeko4.sh \
-       test-fstat$(EXEEXT) test-ftell.sh test-ftell2.sh \
-       test-ftell3$(EXEEXT) test-ftello.sh test-ftello2.sh \
-       test-ftello3$(EXEEXT) test-ftello4.sh test-fwrite$(EXEEXT) \
-       test-getcwd-lgpl$(EXEEXT) test-getdtablesize$(EXEEXT) \
-       test-getopt-gnu$(EXEEXT) test-getopt-posix$(EXEEXT) \
-       test-getprogname$(EXEEXT) test-gettimeofday$(EXEEXT) \
-       test-ignore-value$(EXEEXT) test-intprops$(EXEEXT) \
-       test-inttypes$(EXEEXT) test-isblank$(EXEEXT) \
+       test-fstat$(EXEEXT) test-fstatat$(EXEEXT) test-ftell.sh \
+       test-ftell2.sh test-ftell3$(EXEEXT) test-ftello.sh \
+       test-ftello2.sh test-ftello3$(EXEEXT) test-ftello4.sh \
+       test-ftruncate.sh test-fwrite$(EXEEXT) \
+       test-getcwd-lgpl$(EXEEXT) test-getcwd.sh \
+       test-getdtablesize$(EXEEXT) test-getopt-gnu$(EXEEXT) \
+       test-getprogname$(EXEEXT) test-getrandom$(EXEEXT) \
+       test-gettimeofday$(EXEEXT) test-hard-locale$(EXEEXT) \
+       test-hash$(EXEEXT) $(am__EXEEXT_7) test-iconv-h$(EXEEXT) \
+       test-iconv$(EXEEXT) test-ignore-value$(EXEEXT) \
+       test-inet_pton$(EXEEXT) test-intprops$(EXEEXT) \
+       test-inttostr$(EXEEXT) $(am__EXEEXT_8) test-inttypes$(EXEEXT) \
+       test-ioctl$(EXEEXT) test-isblank$(EXEEXT) \
        test-isnand-nolibm$(EXEEXT) test-isnanf-nolibm$(EXEEXT) \
-       test-isnanl-nolibm$(EXEEXT) $(am__EXEEXT_3) \
-       test-langinfo$(EXEEXT) test-limits-h$(EXEEXT) \
-       test-link$(EXEEXT) test-linkedhash_list$(EXEEXT) \
-       $(am__EXEEXT_4) test-locale$(EXEEXT) test-localeconv$(EXEEXT) \
+       test-isnanl-nolibm$(EXEEXT) test-iswblank$(EXEEXT) \
+       test-iswdigit.sh test-iswxdigit.sh $(am__EXEEXT_9) \
+       test-langinfo$(EXEEXT) $(am__EXEEXT_10) test-limits-h$(EXEEXT) \
+       test-link$(EXEEXT) test-linked_list$(EXEEXT) \
+       test-linkedhash_list$(EXEEXT) test-listen$(EXEEXT) \
+       $(am__EXEEXT_11) test-locale$(EXEEXT) test-localeconv$(EXEEXT) \
        test-localename$(EXEEXT) test-lseek.sh test-lstat$(EXEEXT) \
-       test-malloca$(EXEEXT) $(am__EXEEXT_5) test-math$(EXEEXT) \
-       test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh \
-       test-mbrtowc4.sh test-mbrtowc5.sh test-mbrtowc-w32-1.sh \
-       test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh \
-       test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh test-mbsinit.sh \
-       test-memchr$(EXEEXT) test-memchr2$(EXEEXT) test-nl_langinfo.sh \
-       test-open$(EXEEXT) test-pathmax$(EXEEXT) test-pipe2$(EXEEXT) \
+       test-malloc-gnu$(EXEEXT) test-malloca$(EXEEXT) \
+       $(am__EXEEXT_12) test-math$(EXEEXT) test-mbrtowc1.sh \
+       test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh \
+       test-mbrtowc5.sh test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh \
+       test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh \
+       test-mbrtowc-w32-5.sh test-mbrtowc-w32-6.sh \
+       test-mbrtowc-w32-7.sh test-mbsinit.sh test-mbsstr1$(EXEEXT) \
+       test-mbsstr2.sh test-mbsstr3.sh test-memchr$(EXEEXT) \
+       test-memchr2$(EXEEXT) test-memrchr$(EXEEXT) \
+       test-mkdir$(EXEEXT) test-nanosleep$(EXEEXT) \
+       test-netinet_in$(EXEEXT) test-nl_langinfo.sh \
+       test-nl_langinfo-mt$(EXEEXT) test-open$(EXEEXT) \
+       test-openat$(EXEEXT) test-pathmax$(EXEEXT) test-perror.sh \
+       test-perror2$(EXEEXT) test-pipe$(EXEEXT) test-pipe2$(EXEEXT) \
+       test-posix_spawn-open1$(EXEEXT) \
+       test-posix_spawn-open2$(EXEEXT) \
+       test-posix_spawn-inherit0$(EXEEXT) \
+       test-posix_spawn-inherit1$(EXEEXT) \
+       test-posix_spawn-script$(EXEEXT) \
+       test-posix_spawn_file_actions_addchdir$(EXEEXT) \
+       test-posix_spawn-chdir$(EXEEXT) \
        test-posix_spawn_file_actions_addclose$(EXEEXT) \
        test-posix_spawn_file_actions_adddup2$(EXEEXT) \
-       test-posix_spawn_file_actions_addopen$(EXEEXT) $(am__EXEEXT_6) \
-       test-printf-frexp$(EXEEXT) test-printf-frexpl$(EXEEXT) \
+       test-posix_spawn_file_actions_addopen$(EXEEXT) \
+       test-posix_spawn-dup2-stdout$(EXEEXT) \
+       test-posix_spawn-dup2-stdin$(EXEEXT) \
+       test-posix_spawnp-script$(EXEEXT) test-printf-frexp$(EXEEXT) \
+       test-printf-frexpl$(EXEEXT) $(am__EXEEXT_13) \
+       test-pthread$(EXEEXT) test-pthread-thread$(EXEEXT) \
+       test-pthread_sigmask1$(EXEEXT) test-pthread_sigmask2$(EXEEXT) \
        test-quotearg-simple$(EXEEXT) test-raise$(EXEEXT) \
-       test-rawmemchr$(EXEEXT) test-readlink$(EXEEXT) \
-       test-regex$(EXEEXT) test-rename$(EXEEXT) test-rmdir$(EXEEXT) \
-       test-sched$(EXEEXT) test-setenv$(EXEEXT) test-setlocale1.sh \
-       test-setlocale2.sh test-sigaction$(EXEEXT) $(am__EXEEXT_7) \
+       test-rawmemchr$(EXEEXT) test-read-file$(EXEEXT) \
+       test-readlink$(EXEEXT) test-realloc-gnu$(EXEEXT) \
+       test-reallocarray$(EXEEXT) test-regex$(EXEEXT) \
+       test-rename$(EXEEXT) test-rmdir$(EXEEXT) test-sched$(EXEEXT) \
+       test-scratch-buffer$(EXEEXT) test-select$(EXEEXT) \
+       test-select-in.sh test-select-out.sh test-setenv$(EXEEXT) \
+       test-setlocale_null$(EXEEXT) \
+       test-setlocale_null-mt-one$(EXEEXT) \
+       test-setlocale_null-mt-all$(EXEEXT) test-setlocale1.sh \
+       test-setlocale2.sh test-setsockopt$(EXEEXT) \
+       test-sigaction$(EXEEXT) $(am__EXEEXT_14) \
        test-signal-h$(EXEEXT) test-signbit$(EXEEXT) test-sigpipe.sh \
-       test-sigprocmask$(EXEEXT) test-sleep$(EXEEXT) \
-       test-snprintf$(EXEEXT) $(am__EXEEXT_8) test-spawn-pipe.sh \
-       test-spawn$(EXEEXT) test-stat$(EXEEXT) test-stdalign$(EXEEXT) \
-       test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \
-       test-stdint$(EXEEXT) $(am__EXEEXT_9) test-stdio$(EXEEXT) \
-       $(am__EXEEXT_10) test-stdlib$(EXEEXT) test-strchrnul$(EXEEXT) \
-       test-strerror$(EXEEXT) $(am__EXEEXT_11) test-string$(EXEEXT) \
+       test-sigprocmask$(EXEEXT) test-sigsegv-catch-segv1$(EXEEXT) \
+       test-sigsegv-catch-segv2$(EXEEXT) \
+       test-sigsegv-catch-stackoverflow1$(EXEEXT) \
+       test-sigsegv-catch-stackoverflow2$(EXEEXT) test-sleep$(EXEEXT) \
+       test-snprintf$(EXEEXT) test-sockets$(EXEEXT) $(am__EXEEXT_15) \
+       test-spawn-pipe.sh test-spawn-pipe-script$(EXEEXT) \
+       test-spawn$(EXEEXT) test-stat$(EXEEXT) test-stat-time$(EXEEXT) \
+       test-stdalign$(EXEEXT) $(am__EXEEXT_16) test-stdbool$(EXEEXT) \
+       $(am__EXEEXT_17) test-stddef$(EXEEXT) $(am__EXEEXT_18) \
+       test-stdint$(EXEEXT) $(am__EXEEXT_19) test-stdio$(EXEEXT) \
+       $(am__EXEEXT_20) test-stdlib$(EXEEXT) test-strchrnul$(EXEEXT) \
+       test-strerror$(EXEEXT) test-strerror_r$(EXEEXT) \
+       test-striconv$(EXEEXT) $(am__EXEEXT_21) test-string$(EXEEXT) \
        test-strnlen$(EXEEXT) test-strsignal$(EXEEXT) \
-       test-strstr$(EXEEXT) test-strtod$(EXEEXT) \
-       test-symlink$(EXEEXT) $(am__EXEEXT_12) test-sys_stat$(EXEEXT) \
-       $(am__EXEEXT_13) test-sys_time$(EXEEXT) $(am__EXEEXT_14) \
-       test-sys_types$(EXEEXT) $(am__EXEEXT_15) \
-       test-sys_wait$(EXEEXT) test-init.sh $(am__EXEEXT_16) \
-       test-time$(EXEEXT) $(am__EXEEXT_17) test-dup-safer$(EXEEXT) \
-       test-unistd$(EXEEXT) test-unsetenv$(EXEEXT) \
-       test-update-copyright.sh test-vasnprintf$(EXEEXT) \
-       test-vasprintf-posix$(EXEEXT) test-vasprintf$(EXEEXT) \
-       test-vc-list-files-git.sh test-vc-list-files-cvs.sh \
-       test-verify$(EXEEXT) test-verify.sh test-version-etc.sh \
-       $(am__EXEEXT_18) test-wchar$(EXEEXT) test-wcrtomb.sh \
-       test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh \
+       test-strstr$(EXEEXT) test-strtod$(EXEEXT) test-strtod1.sh \
+       test-symlink$(EXEEXT) $(am__EXEEXT_22) test-sys_ioctl$(EXEEXT) \
+       $(am__EXEEXT_23) test-sys_random$(EXEEXT) $(am__EXEEXT_24) \
+       test-sys_select$(EXEEXT) $(am__EXEEXT_25) \
+       test-sys_socket$(EXEEXT) $(am__EXEEXT_26) \
+       test-sys_stat$(EXEEXT) $(am__EXEEXT_27) test-sys_time$(EXEEXT) \
+       $(am__EXEEXT_28) test-sys_types$(EXEEXT) test-sys_uio$(EXEEXT) \
+       $(am__EXEEXT_29) test-sys_wait$(EXEEXT) test-init.sh \
+       test-thread_self$(EXEEXT) test-thread_create$(EXEEXT) \
+       $(am__EXEEXT_30) test-time$(EXEEXT) $(am__EXEEXT_31) \
+       test-dup-safer$(EXEEXT) test-unistd$(EXEEXT) \
+       test-u8-mbtoucr$(EXEEXT) test-u8-uctomb$(EXEEXT) \
+       test-uc_width$(EXEEXT) uniwidth/test-uc_width2.sh \
+       test-unsetenv$(EXEEXT) test-update-copyright.sh \
+       test-vasnprintf$(EXEEXT) test-vasprintf-posix$(EXEEXT) \
+       test-vasprintf$(EXEEXT) test-vc-list-files-git.sh \
+       test-vc-list-files-cvs.sh test-verify$(EXEEXT) test-verify.sh \
+       test-version-etc.sh $(am__EXEEXT_32) test-wchar$(EXEEXT) \
+       test-wcrtomb.sh test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh \
        test-wcrtomb-w32-3.sh test-wcrtomb-w32-4.sh \
-       test-wcrtomb-w32-5.sh $(am__EXEEXT_19) test-wctype-h$(EXEEXT) \
-       test-write$(EXEEXT) test-xalloc-die.sh \
+       test-wcrtomb-w32-5.sh test-wcrtomb-w32-6.sh \
+       test-wcrtomb-w32-7.sh $(am__EXEEXT_33) test-wctype-h$(EXEEXT) \
+       test-wcwidth$(EXEEXT) test-write$(EXEEXT) test-xalloc-die.sh \
        test-xvasprintf$(EXEEXT)
 XFAIL_TESTS =
-noinst_PROGRAMS =
-check_PROGRAMS = test-alignof$(EXEEXT) test-alloca-opt$(EXEEXT) \
-       test-array_list$(EXEEXT) test-array_oset$(EXEEXT) \
-       test-avltree_oset$(EXEEXT) test-binary-io$(EXEEXT) \
-       test-btowc$(EXEEXT) test-c-ctype$(EXEEXT) \
-       test-c-stack$(EXEEXT) test-c-strcasecmp$(EXEEXT) \
-       test-c-strncasecmp$(EXEEXT) test-canonicalize-lgpl$(EXEEXT) \
-       test-chdir$(EXEEXT) test-cloexec$(EXEEXT) test-close$(EXEEXT) \
-       test-closein$(EXEEXT) test-ctype$(EXEEXT) $(am__EXEEXT_1) \
-       test-dirent$(EXEEXT) test-dirname$(EXEEXT) test-dup$(EXEEXT) \
-       test-dup2$(EXEEXT) test-environ$(EXEEXT) test-errno$(EXEEXT) \
-       test-fclose$(EXEEXT) $(am__EXEEXT_2) test-fcntl-h$(EXEEXT) \
-       test-fcntl$(EXEEXT) test-fdopen$(EXEEXT) test-fflush$(EXEEXT) \
+noinst_PROGRAMS = current-locale$(EXEEXT) test-localcharset$(EXEEXT)
+check_PROGRAMS = test-accept$(EXEEXT) test-access$(EXEEXT) \
+       test-alignof$(EXEEXT) test-alloca-opt$(EXEEXT) $(am__EXEEXT_1) \
+       test-arpa_inet$(EXEEXT) test-array_list$(EXEEXT) \
+       test-array_oset$(EXEEXT) test-asyncsafe-spin1$(EXEEXT) \
+       test-asyncsafe-spin2$(EXEEXT) test-avltree_oset$(EXEEXT) \
+       test-binary-io$(EXEEXT) test-bind$(EXEEXT) \
+       test-bitrotate$(EXEEXT) test-btowc$(EXEEXT) \
+       test-c-ctype$(EXEEXT) test-c-stack$(EXEEXT) \
+       test-c-strcasecmp$(EXEEXT) test-c-strncasecmp$(EXEEXT) \
+       test-calloc-gnu$(EXEEXT) test-canonicalize-lgpl$(EXEEXT) \
+       test-canonicalize$(EXEEXT) test-chdir$(EXEEXT) \
+       test-cloexec$(EXEEXT) test-close$(EXEEXT) \
+       test-closein$(EXEEXT) test-connect$(EXEEXT) \
+       test-creat$(EXEEXT) $(am__EXEEXT_2) test-ctype$(EXEEXT) \
+       $(am__EXEEXT_3) test-dirent$(EXEEXT) test-dirname$(EXEEXT) \
+       test-dup$(EXEEXT) test-dup2$(EXEEXT) test-dynarray$(EXEEXT) \
+       test-environ$(EXEEXT) $(am__EXEEXT_4) test-errno$(EXEEXT) \
+       test-execute-main$(EXEEXT) test-execute-child$(EXEEXT) \
+       test-execute-script$(EXEEXT) test-explicit_bzero$(EXEEXT) \
+       test-fchdir$(EXEEXT) test-fclose$(EXEEXT) $(am__EXEEXT_5) \
+       test-fcntl-h$(EXEEXT) test-fcntl$(EXEEXT) test-fdopen$(EXEEXT) \
+       test-fdopendir$(EXEEXT) test-fflush$(EXEEXT) \
        test-fflush2$(EXEEXT) test-fgetc$(EXEEXT) \
-       test-filenamecat$(EXEEXT) test-float$(EXEEXT) \
-       test-fopen-safer$(EXEEXT) test-fopen$(EXEEXT) \
-       test-fpending$(EXEEXT) test-fpurge$(EXEEXT) \
-       test-fputc$(EXEEXT) test-fread$(EXEEXT) \
+       test-filenamecat$(EXEEXT) $(am__EXEEXT_6) test-float$(EXEEXT) \
+       test-fopen-gnu$(EXEEXT) test-fopen-safer$(EXEEXT) \
+       test-fopen$(EXEEXT) test-fpending$(EXEEXT) \
+       test-fpurge$(EXEEXT) test-fputc$(EXEEXT) test-fread$(EXEEXT) \
        test-freadahead$(EXEEXT) test-freading$(EXEEXT) \
+       test-free$(EXEEXT) test-freopen$(EXEEXT) \
        test-frexp-nolibm$(EXEEXT) test-frexpl-nolibm$(EXEEXT) \
        test-fseek$(EXEEXT) test-fseeko$(EXEEXT) test-fseeko3$(EXEEXT) \
-       test-fseeko4$(EXEEXT) test-fstat$(EXEEXT) test-ftell$(EXEEXT) \
-       test-ftell3$(EXEEXT) test-ftello$(EXEEXT) \
-       test-ftello3$(EXEEXT) test-ftello4$(EXEEXT) \
+       test-fseeko4$(EXEEXT) test-fstat$(EXEEXT) \
+       test-fstatat$(EXEEXT) test-ftell$(EXEEXT) test-ftell3$(EXEEXT) \
+       test-ftello$(EXEEXT) test-ftello3$(EXEEXT) \
+       test-ftello4$(EXEEXT) test-ftruncate$(EXEEXT) \
        test-fwrite$(EXEEXT) test-getcwd-lgpl$(EXEEXT) \
-       test-getdtablesize$(EXEEXT) test-getopt-gnu$(EXEEXT) \
-       test-getopt-posix$(EXEEXT) test-getprogname$(EXEEXT) \
-       test-gettimeofday$(EXEEXT) test-ignore-value$(EXEEXT) \
-       test-intprops$(EXEEXT) test-inttypes$(EXEEXT) \
+       test-getcwd$(EXEEXT) test-getdtablesize$(EXEEXT) \
+       test-getopt-gnu$(EXEEXT) test-getprogname$(EXEEXT) \
+       test-getrandom$(EXEEXT) test-gettimeofday$(EXEEXT) \
+       test-hard-locale$(EXEEXT) test-hash$(EXEEXT) $(am__EXEEXT_7) \
+       test-iconv-h$(EXEEXT) test-iconv$(EXEEXT) \
+       test-ignore-value$(EXEEXT) test-inet_pton$(EXEEXT) \
+       test-intprops$(EXEEXT) test-inttostr$(EXEEXT) $(am__EXEEXT_8) \
+       test-inttypes$(EXEEXT) test-ioctl$(EXEEXT) \
        test-isblank$(EXEEXT) test-isnand-nolibm$(EXEEXT) \
        test-isnanf-nolibm$(EXEEXT) test-isnanl-nolibm$(EXEEXT) \
-       $(am__EXEEXT_3) test-langinfo$(EXEEXT) test-limits-h$(EXEEXT) \
-       test-link$(EXEEXT) test-linkedhash_list$(EXEEXT) \
-       $(am__EXEEXT_4) test-locale$(EXEEXT) test-localeconv$(EXEEXT) \
-       test-localename$(EXEEXT) test-lseek$(EXEEXT) \
-       test-lstat$(EXEEXT) test-malloca$(EXEEXT) $(am__EXEEXT_5) \
-       test-math$(EXEEXT) test-mbrtowc$(EXEEXT) \
+       test-iswblank$(EXEEXT) test-iswdigit$(EXEEXT) \
+       test-iswxdigit$(EXEEXT) $(am__EXEEXT_9) test-langinfo$(EXEEXT) \
+       $(am__EXEEXT_10) test-limits-h$(EXEEXT) test-link$(EXEEXT) \
+       test-linked_list$(EXEEXT) test-linkedhash_list$(EXEEXT) \
+       test-listen$(EXEEXT) $(am__EXEEXT_11) test-locale$(EXEEXT) \
+       test-localeconv$(EXEEXT) test-localename$(EXEEXT) \
+       test-lseek$(EXEEXT) test-lstat$(EXEEXT) \
+       test-malloc-gnu$(EXEEXT) test-malloca$(EXEEXT) \
+       $(am__EXEEXT_12) test-math$(EXEEXT) test-mbrtowc$(EXEEXT) \
        test-mbrtowc-w32$(EXEEXT) test-mbsinit$(EXEEXT) \
-       test-memchr$(EXEEXT) test-memchr2$(EXEEXT) \
-       test-nl_langinfo$(EXEEXT) test-open$(EXEEXT) \
-       test-pathmax$(EXEEXT) test-pipe2$(EXEEXT) \
+       test-mbsstr1$(EXEEXT) test-mbsstr2$(EXEEXT) \
+       test-mbsstr3$(EXEEXT) test-memchr$(EXEEXT) \
+       test-memchr2$(EXEEXT) test-memrchr$(EXEEXT) \
+       test-mkdir$(EXEEXT) test-nanosleep$(EXEEXT) \
+       test-netinet_in$(EXEEXT) test-nl_langinfo$(EXEEXT) \
+       test-nl_langinfo-mt$(EXEEXT) test-open$(EXEEXT) \
+       test-openat$(EXEEXT) test-pathmax$(EXEEXT) \
+       test-perror$(EXEEXT) test-perror2$(EXEEXT) test-pipe$(EXEEXT) \
+       test-pipe2$(EXEEXT) test-posix_spawn-open1$(EXEEXT) \
+       test-posix_spawn-open2$(EXEEXT) \
+       test-posix_spawn-inherit0$(EXEEXT) \
+       test-posix_spawn-inherit1$(EXEEXT) \
+       test-posix_spawn-script$(EXEEXT) \
+       test-posix_spawn_file_actions_addchdir$(EXEEXT) \
+       test-posix_spawn-chdir$(EXEEXT) \
        test-posix_spawn_file_actions_addclose$(EXEEXT) \
        test-posix_spawn_file_actions_adddup2$(EXEEXT) \
-       test-posix_spawn_file_actions_addopen$(EXEEXT) $(am__EXEEXT_6) \
-       test-printf-frexp$(EXEEXT) test-printf-frexpl$(EXEEXT) \
+       test-posix_spawn_file_actions_addopen$(EXEEXT) \
+       test-posix_spawn-dup2-stdout$(EXEEXT) \
+       test-posix_spawn-dup2-stdin$(EXEEXT) \
+       test-posix_spawnp-script$(EXEEXT) test-printf-frexp$(EXEEXT) \
+       test-printf-frexpl$(EXEEXT) $(am__EXEEXT_13) \
+       test-pthread$(EXEEXT) test-pthread-thread$(EXEEXT) \
+       test-pthread_sigmask1$(EXEEXT) test-pthread_sigmask2$(EXEEXT) \
        test-quotearg-simple$(EXEEXT) test-raise$(EXEEXT) \
-       test-rawmemchr$(EXEEXT) test-readlink$(EXEEXT) \
-       test-regex$(EXEEXT) test-rename$(EXEEXT) test-rmdir$(EXEEXT) \
-       test-sched$(EXEEXT) test-setenv$(EXEEXT) \
-       test-setlocale1$(EXEEXT) test-setlocale2$(EXEEXT) \
-       test-sigaction$(EXEEXT) $(am__EXEEXT_7) test-signal-h$(EXEEXT) \
-       test-signbit$(EXEEXT) test-sigpipe$(EXEEXT) \
-       test-sigprocmask$(EXEEXT) test-sleep$(EXEEXT) \
-       test-snprintf$(EXEEXT) $(am__EXEEXT_8) \
+       test-rawmemchr$(EXEEXT) test-read-file$(EXEEXT) \
+       test-readlink$(EXEEXT) test-realloc-gnu$(EXEEXT) \
+       test-reallocarray$(EXEEXT) test-regex$(EXEEXT) \
+       test-rename$(EXEEXT) test-rmdir$(EXEEXT) test-sched$(EXEEXT) \
+       test-scratch-buffer$(EXEEXT) test-select$(EXEEXT) \
+       test-select-fd$(EXEEXT) test-select-stdin$(EXEEXT) \
+       test-setenv$(EXEEXT) test-setlocale_null$(EXEEXT) \
+       test-setlocale_null-mt-one$(EXEEXT) \
+       test-setlocale_null-mt-all$(EXEEXT) test-setlocale1$(EXEEXT) \
+       test-setlocale2$(EXEEXT) test-setsockopt$(EXEEXT) \
+       test-sigaction$(EXEEXT) $(am__EXEEXT_14) \
+       test-signal-h$(EXEEXT) test-signbit$(EXEEXT) \
+       test-sigpipe$(EXEEXT) test-sigprocmask$(EXEEXT) \
+       test-sigsegv-catch-segv1$(EXEEXT) \
+       test-sigsegv-catch-segv2$(EXEEXT) \
+       test-sigsegv-catch-stackoverflow1$(EXEEXT) \
+       test-sigsegv-catch-stackoverflow2$(EXEEXT) test-sleep$(EXEEXT) \
+       test-snprintf$(EXEEXT) test-sockets$(EXEEXT) $(am__EXEEXT_15) \
        test-spawn-pipe-main$(EXEEXT) test-spawn-pipe-child$(EXEEXT) \
-       test-spawn$(EXEEXT) test-stat$(EXEEXT) test-stdalign$(EXEEXT) \
-       test-stdbool$(EXEEXT) test-stddef$(EXEEXT) \
-       test-stdint$(EXEEXT) $(am__EXEEXT_9) test-stdio$(EXEEXT) \
-       $(am__EXEEXT_10) test-stdlib$(EXEEXT) test-strchrnul$(EXEEXT) \
-       test-strerror$(EXEEXT) $(am__EXEEXT_11) test-string$(EXEEXT) \
+       test-spawn-pipe-script$(EXEEXT) test-spawn$(EXEEXT) \
+       test-stat$(EXEEXT) test-stat-time$(EXEEXT) \
+       test-stdalign$(EXEEXT) $(am__EXEEXT_16) test-stdbool$(EXEEXT) \
+       $(am__EXEEXT_17) test-stddef$(EXEEXT) $(am__EXEEXT_18) \
+       test-stdint$(EXEEXT) $(am__EXEEXT_19) test-stdio$(EXEEXT) \
+       $(am__EXEEXT_20) test-stdlib$(EXEEXT) test-strchrnul$(EXEEXT) \
+       test-strerror$(EXEEXT) test-strerror_r$(EXEEXT) \
+       test-striconv$(EXEEXT) $(am__EXEEXT_21) test-string$(EXEEXT) \
        test-strnlen$(EXEEXT) test-strsignal$(EXEEXT) \
        test-strstr$(EXEEXT) test-strtod$(EXEEXT) \
-       test-symlink$(EXEEXT) $(am__EXEEXT_12) test-sys_stat$(EXEEXT) \
-       $(am__EXEEXT_13) test-sys_time$(EXEEXT) $(am__EXEEXT_14) \
-       test-sys_types$(EXEEXT) $(am__EXEEXT_15) \
-       test-sys_wait$(EXEEXT) $(am__EXEEXT_16) test-time$(EXEEXT) \
-       $(am__EXEEXT_17) test-dup-safer$(EXEEXT) test-unistd$(EXEEXT) \
+       test-strtod1$(EXEEXT) test-symlink$(EXEEXT) $(am__EXEEXT_22) \
+       test-sys_ioctl$(EXEEXT) $(am__EXEEXT_23) \
+       test-sys_random$(EXEEXT) $(am__EXEEXT_24) \
+       test-sys_select$(EXEEXT) $(am__EXEEXT_25) \
+       test-sys_socket$(EXEEXT) $(am__EXEEXT_26) \
+       test-sys_stat$(EXEEXT) $(am__EXEEXT_27) test-sys_time$(EXEEXT) \
+       $(am__EXEEXT_28) test-sys_types$(EXEEXT) test-sys_uio$(EXEEXT) \
+       $(am__EXEEXT_29) test-sys_wait$(EXEEXT) \
+       test-thread_self$(EXEEXT) test-thread_create$(EXEEXT) \
+       $(am__EXEEXT_30) test-time$(EXEEXT) $(am__EXEEXT_31) \
+       test-dup-safer$(EXEEXT) test-unistd$(EXEEXT) \
+       test-u8-mbtoucr$(EXEEXT) test-u8-uctomb$(EXEEXT) \
+       test-uc_width$(EXEEXT) test-uc_width2$(EXEEXT) \
        test-unsetenv$(EXEEXT) test-vasnprintf$(EXEEXT) \
        test-vasprintf-posix$(EXEEXT) test-vasprintf$(EXEEXT) \
        test-verify$(EXEEXT) test-version-etc$(EXEEXT) \
-       $(am__EXEEXT_18) test-wchar$(EXEEXT) test-wcrtomb$(EXEEXT) \
-       test-wcrtomb-w32$(EXEEXT) $(am__EXEEXT_19) \
-       test-wctype-h$(EXEEXT) test-write$(EXEEXT) \
-       test-xalloc-die$(EXEEXT) test-xvasprintf$(EXEEXT)
-@ANSICXX_TRUE@am__append_1 = test-dirent-c++
-@ANSICXX_TRUE@am__append_2 = test-dirent-c++
-@ANSICXX_TRUE@am__append_3 = test-fcntl-h-c++
-@ANSICXX_TRUE@am__append_4 = test-fcntl-h-c++
-@ANSICXX_TRUE@am__append_5 = test-langinfo-c++
-@ANSICXX_TRUE@am__append_6 = test-langinfo-c++
-@ANSICXX_TRUE@am__append_7 = test-locale-c++
-@ANSICXX_TRUE@am__append_8 = test-locale-c++
-@ANSICXX_TRUE@am__append_9 = test-math-c++
-@ANSICXX_TRUE@am__append_10 = test-math-c++
-@POSIX_SPAWN_PORTED_TRUE@am__append_11 = test-posix_spawn1 test-posix_spawn2
-@POSIX_SPAWN_PORTED_TRUE@am__append_12 = test-posix_spawn1 test-posix_spawn2
-@POSIX_SPAWN_PORTED_TRUE@am__append_13 = test-posix_spawn1.sh \
-@POSIX_SPAWN_PORTED_TRUE@      test-posix_spawn2.sh
-@POSIX_SPAWN_PORTED_TRUE@am__append_14 = test-posix_spawn1.sh \
-@POSIX_SPAWN_PORTED_TRUE@      test-posix_spawn1.sh-t \
-@POSIX_SPAWN_PORTED_TRUE@      test-posix_spawn2.sh \
-@POSIX_SPAWN_PORTED_TRUE@      test-posix_spawn2.sh-t
-@ANSICXX_TRUE@am__append_15 = test-signal-h-c++
-@ANSICXX_TRUE@am__append_16 = test-signal-h-c++
-@ANSICXX_TRUE@am__append_17 = test-spawn-c++
-@ANSICXX_TRUE@am__append_18 = test-spawn-c++
-@ANSICXX_TRUE@am__append_19 = test-stdio-c++
-@ANSICXX_TRUE@am__append_20 = test-stdio-c++
-@ANSICXX_TRUE@am__append_21 = test-stdlib-c++
-@ANSICXX_TRUE@am__append_22 = test-stdlib-c++
-@ANSICXX_TRUE@am__append_23 = test-string-c++
-@ANSICXX_TRUE@am__append_24 = test-string-c++
-@ANSICXX_TRUE@am__append_25 = test-sys_stat-c++
-@ANSICXX_TRUE@am__append_26 = test-sys_stat-c++
-@ANSICXX_TRUE@am__append_27 = test-sys_time-c++
-@ANSICXX_TRUE@am__append_28 = test-sys_time-c++
-@ANSICXX_TRUE@am__append_29 = test-sys_types-c++
-@ANSICXX_TRUE@am__append_30 = test-sys_types-c++
-@ANSICXX_TRUE@am__append_31 = test-sys_wait-c++
-@ANSICXX_TRUE@am__append_32 = test-sys_wait-c++
-@ANSICXX_TRUE@am__append_33 = test-time-c++
-@ANSICXX_TRUE@am__append_34 = test-time-c++
-@ANSICXX_TRUE@am__append_35 = test-unistd-c++
-@ANSICXX_TRUE@am__append_36 = test-unistd-c++
-@ANSICXX_TRUE@am__append_37 = test-wchar-c++
-@ANSICXX_TRUE@am__append_38 = test-wchar-c++
-@ANSICXX_TRUE@am__append_39 = test-wctype-h-c++
-@ANSICXX_TRUE@am__append_40 = test-wctype-h-c++
+       $(am__EXEEXT_32) test-wchar$(EXEEXT) test-wcrtomb$(EXEEXT) \
+       test-wcrtomb-w32$(EXEEXT) $(am__EXEEXT_33) \
+       test-wctype-h$(EXEEXT) test-wcwidth$(EXEEXT) \
+       test-write$(EXEEXT) test-xalloc-die$(EXEEXT) \
+       test-xvasprintf$(EXEEXT)
+EXTRA_PROGRAMS = test-verify-try$(EXEEXT)
+@ANSICXX_TRUE@am__append_1 = test-arpa_inet-c++
+@ANSICXX_TRUE@am__append_2 = test-arpa_inet-c++
+@ANSICXX_TRUE@am__append_3 = test-ctype-c++
+@ANSICXX_TRUE@am__append_4 = test-ctype-c++
+@ANSICXX_TRUE@am__append_5 = test-dirent-c++
+@ANSICXX_TRUE@am__append_6 = test-dirent-c++
+@ANSICXX_TRUE@am__append_7 = test-errno-c++
+@ANSICXX_TRUE@am__append_8 = test-errno-c++
+@ANSICXX_TRUE@am__append_9 = test-fcntl-h-c++
+@ANSICXX_TRUE@am__append_10 = test-fcntl-h-c++
+@ANSICXX_TRUE@am__append_11 = test-float-c++
+@ANSICXX_TRUE@am__append_12 = test-float-c++
+@ANSICXX_TRUE@am__append_13 = test-iconv-h-c++
+@ANSICXX_TRUE@am__append_14 = test-iconv-h-c++
+@ANSICXX_TRUE@am__append_15 = test-inttypes-c++
+@ANSICXX_TRUE@am__append_16 = test-inttypes-c++
+@ANSICXX_TRUE@am__append_17 = test-langinfo-c++
+@ANSICXX_TRUE@am__append_18 = test-langinfo-c++
+@ANSICXX_TRUE@am__append_19 = test-limits-h-c++
+@ANSICXX_TRUE@am__append_20 = test-limits-h-c++
+@ANSICXX_TRUE@am__append_21 = test-locale-c++
+@ANSICXX_TRUE@am__append_22 = test-locale-c++
+@ANSICXX_TRUE@am__append_23 = test-math-c++
+@ANSICXX_TRUE@am__append_24 = test-math-c++
+@ANSICXX_TRUE@am__append_25 = test-pthread-c++
+@ANSICXX_TRUE@am__append_26 = test-pthread-c++
+@ANSICXX_TRUE@am__append_27 = test-signal-h-c++
+@ANSICXX_TRUE@am__append_28 = test-signal-h-c++
+@ANSICXX_TRUE@am__append_29 = test-spawn-c++
+@ANSICXX_TRUE@am__append_30 = test-spawn-c++
+@ANSICXX_TRUE@am__append_31 = test-stdbool-c++
+@ANSICXX_TRUE@am__append_32 = test-stdbool-c++
+@ANSICXX_TRUE@am__append_33 = test-stddef-c++
+@ANSICXX_TRUE@am__append_34 = test-stddef-c++
+@ANSICXX_TRUE@am__append_35 = test-stdint-c++
+@ANSICXX_TRUE@am__append_36 = test-stdint-c++
+@ANSICXX_TRUE@am__append_37 = test-stdio-c++
+@ANSICXX_TRUE@am__append_38 = test-stdio-c++
+@ANSICXX_TRUE@am__append_39 = test-stdlib-c++
+@ANSICXX_TRUE@am__append_40 = test-stdlib-c++
+@ANSICXX_TRUE@am__append_41 = test-string-c++
+@ANSICXX_TRUE@am__append_42 = test-string-c++
+@ANSICXX_TRUE@am__append_43 = test-sys_ioctl-c++
+@ANSICXX_TRUE@am__append_44 = test-sys_ioctl-c++
+@ANSICXX_TRUE@am__append_45 = test-sys_random-c++
+@ANSICXX_TRUE@am__append_46 = test-sys_random-c++
+@ANSICXX_TRUE@am__append_47 = test-sys_select-c++
+@ANSICXX_TRUE@am__append_48 = test-sys_select-c++
+@ANSICXX_TRUE@am__append_49 = test-sys_socket-c++
+@ANSICXX_TRUE@am__append_50 = test-sys_socket-c++
+@ANSICXX_TRUE@am__append_51 = test-sys_stat-c++
+@ANSICXX_TRUE@am__append_52 = test-sys_stat-c++
+@ANSICXX_TRUE@am__append_53 = test-sys_time-c++
+@ANSICXX_TRUE@am__append_54 = test-sys_time-c++
+@ANSICXX_TRUE@am__append_55 = test-sys_types-c++
+@ANSICXX_TRUE@am__append_56 = test-sys_types-c++
+@ANSICXX_TRUE@am__append_57 = test-sys_wait-c++
+@ANSICXX_TRUE@am__append_58 = test-sys_wait-c++
+@ANSICXX_TRUE@am__append_59 = test-time-c++
+@ANSICXX_TRUE@am__append_60 = test-time-c++
+@ANSICXX_TRUE@am__append_61 = test-unistd-c++
+@ANSICXX_TRUE@am__append_62 = test-unistd-c++
+@ANSICXX_TRUE@am__append_63 = test-wchar-c++
+@ANSICXX_TRUE@am__append_64 = test-wchar-c++
+@ANSICXX_TRUE@am__append_65 = test-wctype-h-c++
+@ANSICXX_TRUE@am__append_66 = test-wctype-h-c++
 subdir = tests
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
-       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/alloca.m4 \
-       $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/__inline.m4 \
+       $(top_srcdir)/m4/absolute-header.m4 $(top_srcdir)/m4/access.m4 \
+       $(top_srcdir)/m4/alloca.m4 $(top_srcdir)/m4/ansi-c++.m4 \
+       $(top_srcdir)/m4/arpa_inet_h.m4 \
        $(top_srcdir)/m4/asm-underscore.m4 $(top_srcdir)/m4/assert.m4 \
        $(top_srcdir)/m4/autobuild.m4 $(top_srcdir)/m4/btowc.m4 \
        $(top_srcdir)/m4/builtin-expect.m4 $(top_srcdir)/m4/c-stack.m4 \
-       $(top_srcdir)/m4/canonicalize.m4 \
-       $(top_srcdir)/m4/close-stream.m4 $(top_srcdir)/m4/close.m4 \
-       $(top_srcdir)/m4/closedir.m4 $(top_srcdir)/m4/closein.m4 \
-       $(top_srcdir)/m4/closeout.m4 $(top_srcdir)/m4/codeset.m4 \
-       $(top_srcdir)/m4/config-h.m4 $(top_srcdir)/m4/configmake.m4 \
-       $(top_srcdir)/m4/ctype.m4 $(top_srcdir)/m4/dirent_h.m4 \
-       $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/dirname.m4 \
+       $(top_srcdir)/m4/calloc.m4 $(top_srcdir)/m4/canonicalize.m4 \
+       $(top_srcdir)/m4/chdir-long.m4 $(top_srcdir)/m4/clock_time.m4 \
+       $(top_srcdir)/m4/close.m4 $(top_srcdir)/m4/closedir.m4 \
+       $(top_srcdir)/m4/codeset.m4 $(top_srcdir)/m4/config-h.m4 \
+       $(top_srcdir)/m4/configmake.m4 $(top_srcdir)/m4/creat.m4 \
+       $(top_srcdir)/m4/ctype_h.m4 $(top_srcdir)/m4/d-ino.m4 \
+       $(top_srcdir)/m4/dirent_h.m4 $(top_srcdir)/m4/dirfd.m4 \
        $(top_srcdir)/m4/double-slash-root.m4 $(top_srcdir)/m4/dup.m4 \
-       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eealloc.m4 \
-       $(top_srcdir)/m4/environ.m4 $(top_srcdir)/m4/errno_h.m4 \
-       $(top_srcdir)/m4/error.m4 $(top_srcdir)/m4/execute.m4 \
+       $(top_srcdir)/m4/dup2.m4 $(top_srcdir)/m4/eaccess.m4 \
+       $(top_srcdir)/m4/eealloc.m4 $(top_srcdir)/m4/environ.m4 \
+       $(top_srcdir)/m4/errno_h.m4 $(top_srcdir)/m4/error.m4 \
+       $(top_srcdir)/m4/execute.m4 $(top_srcdir)/m4/explicit_bzero.m4 \
        $(top_srcdir)/m4/exponentd.m4 $(top_srcdir)/m4/exponentf.m4 \
        $(top_srcdir)/m4/exponentl.m4 $(top_srcdir)/m4/extensions.m4 \
        $(top_srcdir)/m4/extern-inline.m4 \
-       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fclose.m4 \
-       $(top_srcdir)/m4/fcntl-o.m4 $(top_srcdir)/m4/fcntl.m4 \
-       $(top_srcdir)/m4/fcntl_h.m4 $(top_srcdir)/m4/fdopen.m4 \
+       $(top_srcdir)/m4/fatal-signal.m4 $(top_srcdir)/m4/fchdir.m4 \
+       $(top_srcdir)/m4/fclose.m4 $(top_srcdir)/m4/fcntl-o.m4 \
+       $(top_srcdir)/m4/fcntl.m4 $(top_srcdir)/m4/fcntl_h.m4 \
+       $(top_srcdir)/m4/fdopen.m4 $(top_srcdir)/m4/fdopendir.m4 \
        $(top_srcdir)/m4/fflush.m4 $(top_srcdir)/m4/filenamecat.m4 \
+       $(top_srcdir)/m4/findprog-in.m4 $(top_srcdir)/m4/findprog.m4 \
        $(top_srcdir)/m4/flexmember.m4 $(top_srcdir)/m4/float_h.m4 \
        $(top_srcdir)/m4/fopen.m4 $(top_srcdir)/m4/fpending.m4 \
        $(top_srcdir)/m4/fpieee.m4 $(top_srcdir)/m4/fpurge.m4 \
        $(top_srcdir)/m4/freadahead.m4 $(top_srcdir)/m4/freading.m4 \
+       $(top_srcdir)/m4/free.m4 $(top_srcdir)/m4/freopen.m4 \
        $(top_srcdir)/m4/frexp.m4 $(top_srcdir)/m4/frexpl.m4 \
        $(top_srcdir)/m4/fseek.m4 $(top_srcdir)/m4/fseeko.m4 \
-       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/ftell.m4 \
-       $(top_srcdir)/m4/ftello.m4 $(top_srcdir)/m4/getcwd.m4 \
+       $(top_srcdir)/m4/fstat.m4 $(top_srcdir)/m4/fstatat.m4 \
+       $(top_srcdir)/m4/ftell.m4 $(top_srcdir)/m4/ftello.m4 \
+       $(top_srcdir)/m4/ftruncate.m4 \
+       $(top_srcdir)/m4/getcwd-abort-bug.m4 \
+       $(top_srcdir)/m4/getcwd-path-max.m4 $(top_srcdir)/m4/getcwd.m4 \
        $(top_srcdir)/m4/getdtablesize.m4 $(top_srcdir)/m4/getopt.m4 \
        $(top_srcdir)/m4/getpagesize.m4 \
-       $(top_srcdir)/m4/getprogname.m4 \
-       $(top_srcdir)/m4/gettimeofday.m4 $(top_srcdir)/m4/glibc21.m4 \
+       $(top_srcdir)/m4/getprogname.m4 $(top_srcdir)/m4/getrandom.m4 \
+       $(top_srcdir)/m4/gettext.m4 $(top_srcdir)/m4/gettimeofday.m4 \
        $(top_srcdir)/m4/gnulib-common.m4 \
        $(top_srcdir)/m4/gnulib-comp.m4 \
-       $(top_srcdir)/m4/hard-locale.m4 \
-       $(top_srcdir)/m4/include_next.m4 \
+       $(top_srcdir)/m4/host-cpu-c-abi.m4 $(top_srcdir)/m4/iconv.m4 \
+       $(top_srcdir)/m4/iconv_h.m4 $(top_srcdir)/m4/iconv_open.m4 \
+       $(top_srcdir)/m4/include_next.m4 $(top_srcdir)/m4/inet_pton.m4 \
+       $(top_srcdir)/m4/inline.m4 \
+       $(top_srcdir)/m4/intl-thread-locale.m4 \
        $(top_srcdir)/m4/intlmacosx.m4 $(top_srcdir)/m4/intmax_t.m4 \
-       $(top_srcdir)/m4/inttypes-pri.m4 $(top_srcdir)/m4/inttypes.m4 \
-       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/isblank.m4 \
-       $(top_srcdir)/m4/isnand.m4 $(top_srcdir)/m4/isnanf.m4 \
-       $(top_srcdir)/m4/isnanl.m4 $(top_srcdir)/m4/langinfo_h.m4 \
+       $(top_srcdir)/m4/inttostr.m4 $(top_srcdir)/m4/inttypes.m4 \
+       $(top_srcdir)/m4/inttypes_h.m4 $(top_srcdir)/m4/ioctl.m4 \
+       $(top_srcdir)/m4/isblank.m4 $(top_srcdir)/m4/isnand.m4 \
+       $(top_srcdir)/m4/isnanf.m4 $(top_srcdir)/m4/isnanl.m4 \
+       $(top_srcdir)/m4/iswblank.m4 $(top_srcdir)/m4/iswdigit.m4 \
+       $(top_srcdir)/m4/iswxdigit.m4 $(top_srcdir)/m4/langinfo_h.m4 \
        $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lcmessage.m4 \
        $(top_srcdir)/m4/ldexp.m4 $(top_srcdir)/m4/ldexpl.m4 \
        $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
        $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
+       $(top_srcdir)/m4/libunistring-base.m4 \
        $(top_srcdir)/m4/limits-h.m4 $(top_srcdir)/m4/link.m4 \
        $(top_srcdir)/m4/localcharset.m4 $(top_srcdir)/m4/locale-fr.m4 \
        $(top_srcdir)/m4/locale-ja.m4 $(top_srcdir)/m4/locale-tr.m4 \
@@ -365,61 +516,93 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/00gnulib.m4 \
        $(top_srcdir)/m4/lseek.m4 $(top_srcdir)/m4/lstat.m4 \
        $(top_srcdir)/m4/malloc.m4 $(top_srcdir)/m4/malloca.m4 \
        $(top_srcdir)/m4/manywarnings.m4 $(top_srcdir)/m4/math_h.m4 \
+       $(top_srcdir)/m4/mbchar.m4 $(top_srcdir)/m4/mbiter.m4 \
        $(top_srcdir)/m4/mbrtowc.m4 $(top_srcdir)/m4/mbsinit.m4 \
-       $(top_srcdir)/m4/mbstate_t.m4 $(top_srcdir)/m4/mbtowc.m4 \
-       $(top_srcdir)/m4/memchr.m4 $(top_srcdir)/m4/minmax.m4 \
+       $(top_srcdir)/m4/mbslen.m4 $(top_srcdir)/m4/mbstate_t.m4 \
+       $(top_srcdir)/m4/mbtowc.m4 $(top_srcdir)/m4/memchr.m4 \
+       $(top_srcdir)/m4/mempcpy.m4 $(top_srcdir)/m4/memrchr.m4 \
+       $(top_srcdir)/m4/minmax.m4 $(top_srcdir)/m4/mkdir.m4 \
        $(top_srcdir)/m4/mkdtemp.m4 $(top_srcdir)/m4/mkstemp.m4 \
        $(top_srcdir)/m4/mmap-anon.m4 $(top_srcdir)/m4/mode_t.m4 \
        $(top_srcdir)/m4/msvc-inval.m4 \
        $(top_srcdir)/m4/msvc-nothrow.m4 $(top_srcdir)/m4/multiarch.m4 \
-       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nocrash.m4 \
-       $(top_srcdir)/m4/obstack.m4 $(top_srcdir)/m4/off_t.m4 \
-       $(top_srcdir)/m4/open.m4 $(top_srcdir)/m4/opendir.m4 \
-       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/pipe2.m4 \
-       $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/musl.m4 $(top_srcdir)/m4/nanosleep.m4 \
+       $(top_srcdir)/m4/netinet_in_h.m4 \
+       $(top_srcdir)/m4/nl_langinfo.m4 $(top_srcdir)/m4/nls.m4 \
+       $(top_srcdir)/m4/nocrash.m4 $(top_srcdir)/m4/obstack.m4 \
+       $(top_srcdir)/m4/off_t.m4 $(top_srcdir)/m4/open-cloexec.m4 \
+       $(top_srcdir)/m4/open-slash.m4 $(top_srcdir)/m4/open.m4 \
+       $(top_srcdir)/m4/openat.m4 $(top_srcdir)/m4/opendir.m4 \
+       $(top_srcdir)/m4/pathmax.m4 $(top_srcdir)/m4/perror.m4 \
+       $(top_srcdir)/m4/pipe.m4 $(top_srcdir)/m4/pipe2.m4 \
+       $(top_srcdir)/m4/po.m4 $(top_srcdir)/m4/posix_spawn.m4 \
+       $(top_srcdir)/m4/posix_spawn_faction_addchdir.m4 \
        $(top_srcdir)/m4/printf-frexp.m4 \
        $(top_srcdir)/m4/printf-frexpl.m4 $(top_srcdir)/m4/printf.m4 \
-       $(top_srcdir)/m4/putenv.m4 $(top_srcdir)/m4/quotearg.m4 \
-       $(top_srcdir)/m4/raise.m4 $(top_srcdir)/m4/rawmemchr.m4 \
+       $(top_srcdir)/m4/progtest.m4 \
+       $(top_srcdir)/m4/pthread-thread.m4 \
+       $(top_srcdir)/m4/pthread_h.m4 \
+       $(top_srcdir)/m4/pthread_rwlock_rdlock.m4 \
+       $(top_srcdir)/m4/pthread_sigmask.m4 $(top_srcdir)/m4/putenv.m4 \
+       $(top_srcdir)/m4/quotearg.m4 $(top_srcdir)/m4/raise.m4 \
+       $(top_srcdir)/m4/rawmemchr.m4 $(top_srcdir)/m4/read-file.m4 \
        $(top_srcdir)/m4/readdir.m4 $(top_srcdir)/m4/readlink.m4 \
+       $(top_srcdir)/m4/realloc.m4 $(top_srcdir)/m4/reallocarray.m4 \
        $(top_srcdir)/m4/regex.m4 $(top_srcdir)/m4/rename.m4 \
-       $(top_srcdir)/m4/rmdir.m4 $(top_srcdir)/m4/sched_h.m4 \
-       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/setenv.m4 \
-       $(top_srcdir)/m4/setlocale.m4 $(top_srcdir)/m4/sig_atomic_t.m4 \
-       $(top_srcdir)/m4/sigaction.m4 $(top_srcdir)/m4/signal_h.m4 \
+       $(top_srcdir)/m4/rewinddir.m4 $(top_srcdir)/m4/rmdir.m4 \
+       $(top_srcdir)/m4/save-cwd.m4 $(top_srcdir)/m4/sched_h.m4 \
+       $(top_srcdir)/m4/sched_yield.m4 \
+       $(top_srcdir)/m4/secure_getenv.m4 $(top_srcdir)/m4/select.m4 \
+       $(top_srcdir)/m4/semaphore.m4 $(top_srcdir)/m4/setenv.m4 \
+       $(top_srcdir)/m4/setlocale.m4 \
+       $(top_srcdir)/m4/setlocale_null.m4 \
+       $(top_srcdir)/m4/sh-filename.m4 \
+       $(top_srcdir)/m4/sig_atomic_t.m4 $(top_srcdir)/m4/sigaction.m4 \
+       $(top_srcdir)/m4/sigaltstack.m4 $(top_srcdir)/m4/signal_h.m4 \
        $(top_srcdir)/m4/signalblocking.m4 $(top_srcdir)/m4/signbit.m4 \
        $(top_srcdir)/m4/sigpipe.m4 $(top_srcdir)/m4/size_max.m4 \
        $(top_srcdir)/m4/sleep.m4 $(top_srcdir)/m4/snprintf.m4 \
-       $(top_srcdir)/m4/spawn-pipe.m4 $(top_srcdir)/m4/spawn_h.m4 \
-       $(top_srcdir)/m4/ssize_t.m4 $(top_srcdir)/m4/stat.m4 \
+       $(top_srcdir)/m4/socketlib.m4 $(top_srcdir)/m4/sockets.m4 \
+       $(top_srcdir)/m4/socklen.m4 $(top_srcdir)/m4/sockpfaf.m4 \
+       $(top_srcdir)/m4/sparcv8+.m4 $(top_srcdir)/m4/spawn-pipe.m4 \
+       $(top_srcdir)/m4/spawn_h.m4 $(top_srcdir)/m4/ssize_t.m4 \
+       $(top_srcdir)/m4/stack-direction.m4 \
+       $(top_srcdir)/m4/stat-time.m4 $(top_srcdir)/m4/stat.m4 \
        $(top_srcdir)/m4/stdalign.m4 $(top_srcdir)/m4/stdarg.m4 \
        $(top_srcdir)/m4/stdbool.m4 $(top_srcdir)/m4/stddef_h.m4 \
        $(top_srcdir)/m4/stdint.m4 $(top_srcdir)/m4/stdint_h.m4 \
        $(top_srcdir)/m4/stdio_h.m4 $(top_srcdir)/m4/stdlib_h.m4 \
-       $(top_srcdir)/m4/strchrnul.m4 $(top_srcdir)/m4/strdup.m4 \
-       $(top_srcdir)/m4/strerror.m4 $(top_srcdir)/m4/string_h.m4 \
+       $(top_srcdir)/m4/stpcpy.m4 $(top_srcdir)/m4/strchrnul.m4 \
+       $(top_srcdir)/m4/strdup.m4 $(top_srcdir)/m4/strerror.m4 \
+       $(top_srcdir)/m4/strerror_r.m4 $(top_srcdir)/m4/string_h.m4 \
        $(top_srcdir)/m4/strndup.m4 $(top_srcdir)/m4/strnlen.m4 \
        $(top_srcdir)/m4/strsignal.m4 $(top_srcdir)/m4/strstr.m4 \
        $(top_srcdir)/m4/strtod.m4 $(top_srcdir)/m4/symlink.m4 \
+       $(top_srcdir)/m4/sys_ioctl_h.m4 \
+       $(top_srcdir)/m4/sys_random_h.m4 \
+       $(top_srcdir)/m4/sys_select_h.m4 \
        $(top_srcdir)/m4/sys_socket_h.m4 \
        $(top_srcdir)/m4/sys_stat_h.m4 $(top_srcdir)/m4/sys_time_h.m4 \
-       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_wait_h.m4 \
-       $(top_srcdir)/m4/tempname.m4 $(top_srcdir)/m4/threadlib.m4 \
+       $(top_srcdir)/m4/sys_types_h.m4 $(top_srcdir)/m4/sys_uio_h.m4 \
+       $(top_srcdir)/m4/sys_wait_h.m4 $(top_srcdir)/m4/tempname.m4 \
+       $(top_srcdir)/m4/thread.m4 $(top_srcdir)/m4/threadlib.m4 \
        $(top_srcdir)/m4/time_h.m4 $(top_srcdir)/m4/tls.m4 \
        $(top_srcdir)/m4/tmpdir.m4 $(top_srcdir)/m4/ungetc.m4 \
        $(top_srcdir)/m4/unistd-safer.m4 $(top_srcdir)/m4/unistd_h.m4 \
        $(top_srcdir)/m4/unlocked-io.m4 $(top_srcdir)/m4/vasnprintf.m4 \
        $(top_srcdir)/m4/vasprintf-posix.m4 \
        $(top_srcdir)/m4/vasprintf.m4 $(top_srcdir)/m4/version-etc.m4 \
+       $(top_srcdir)/m4/visibility.m4 \
        $(top_srcdir)/m4/wait-process.m4 $(top_srcdir)/m4/waitpid.m4 \
        $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/m4/wchar_h.m4 \
        $(top_srcdir)/m4/wchar_t.m4 $(top_srcdir)/m4/wcrtomb.m4 \
        $(top_srcdir)/m4/wctob.m4 $(top_srcdir)/m4/wctomb.m4 \
-       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wint_t.m4 \
-       $(top_srcdir)/m4/write.m4 $(top_srcdir)/m4/xalloc.m4 \
-       $(top_srcdir)/m4/xsize.m4 $(top_srcdir)/m4/xstrndup.m4 \
-       $(top_srcdir)/m4/xvasprintf.m4 $(top_srcdir)/acinclude.m4 \
-       $(top_srcdir)/configure.ac
+       $(top_srcdir)/m4/wctype_h.m4 $(top_srcdir)/m4/wcwidth.m4 \
+       $(top_srcdir)/m4/wint_t.m4 $(top_srcdir)/m4/write.m4 \
+       $(top_srcdir)/m4/xalloc.m4 $(top_srcdir)/m4/xsize.m4 \
+       $(top_srcdir)/m4/xstrndup.m4 $(top_srcdir)/m4/xvasprintf.m4 \
+       $(top_srcdir)/m4/yield.m4 $(top_srcdir)/m4/zzgnulib.m4 \
+       $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
        $(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
@@ -428,6 +611,40 @@ mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = $(top_builddir)/lib/config.h
 CONFIG_CLEAN_FILES =
 CONFIG_CLEAN_VPATH_FILES =
+@ANSICXX_TRUE@am__EXEEXT_1 = test-arpa_inet-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_2 = test-ctype-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_3 = test-dirent-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_4 = test-errno-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_5 = test-fcntl-h-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_6 = test-float-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_7 = test-iconv-h-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_8 = test-inttypes-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_9 = test-langinfo-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_10 = test-limits-h-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_11 = test-locale-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_12 = test-math-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_13 = test-pthread-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_14 = test-signal-h-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_15 = test-spawn-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_16 = test-stdbool-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_17 = test-stddef-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_18 = test-stdint-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_19 = test-stdio-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_20 = test-stdlib-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_21 = test-string-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_22 = test-sys_ioctl-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_23 = test-sys_random-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_24 = test-sys_select-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_25 = test-sys_socket-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_26 = test-sys_stat-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_27 = test-sys_time-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_28 = test-sys_types-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_29 = test-sys_wait-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_30 = test-time-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_31 = test-unistd-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_32 = test-wchar-c++$(EXEEXT)
+@ANSICXX_TRUE@am__EXEEXT_33 = test-wctype-h-c++$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
 LIBRARIES = $(noinst_LIBRARIES)
 AM_V_AR = $(am__v_AR_@AM_V@)
 am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
@@ -435,69 +652,90 @@ am__v_AR_0 = @echo "  AR      " $@;
 am__v_AR_1 = 
 libtests_a_AR = $(AR) $(ARFLAGS)
 am__DEPENDENCIES_1 =
+am__dirstamp = $(am__leading_dot)dirstamp
 am_libtests_a_OBJECTS = gl_array_list.$(OBJEXT) \
-       gl_array_oset.$(OBJEXT) localename.$(OBJEXT)
+       gl_array_oset.$(OBJEXT) findprog.$(OBJEXT) imaxtostr.$(OBJEXT) \
+       inttostr.$(OBJEXT) offtostr.$(OBJEXT) uinttostr.$(OBJEXT) \
+       umaxtostr.$(OBJEXT) read-file.$(OBJEXT) sockets.$(OBJEXT) \
+       sys_socket.$(OBJEXT) glthread/thread.$(OBJEXT) \
+       vma-iter.$(OBJEXT) xconcat-filename.$(OBJEXT)
 libtests_a_OBJECTS = $(am_libtests_a_OBJECTS)
-@ANSICXX_TRUE@am__EXEEXT_1 = test-dirent-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_2 = test-fcntl-h-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_3 = test-langinfo-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_4 = test-locale-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_5 = test-math-c++$(EXEEXT)
-@POSIX_SPAWN_PORTED_TRUE@am__EXEEXT_6 = test-posix_spawn1$(EXEEXT) \
-@POSIX_SPAWN_PORTED_TRUE@      test-posix_spawn2$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_7 = test-signal-h-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_8 = test-spawn-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_9 = test-stdio-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_10 = test-stdlib-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_11 = test-string-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_12 = test-sys_stat-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_13 = test-sys_time-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_14 = test-sys_types-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_15 = test-sys_wait-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_16 = test-time-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_17 = test-unistd-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_18 = test-wchar-c++$(EXEEXT)
-@ANSICXX_TRUE@am__EXEEXT_19 = test-wctype-h-c++$(EXEEXT)
-PROGRAMS = $(noinst_PROGRAMS)
+am_current_locale_OBJECTS = locale.$(OBJEXT)
+current_locale_OBJECTS = $(am_current_locale_OBJECTS)
+current_locale_LDADD = $(LDADD)
+current_locale_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_accept_SOURCES = test-accept.c
+test_accept_OBJECTS = test-accept.$(OBJEXT)
+am__DEPENDENCIES_2 = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_accept_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_access_SOURCES = test-access.c
+test_access_OBJECTS = test-access.$(OBJEXT)
+test_access_LDADD = $(LDADD)
+test_access_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_alignof_SOURCES = test-alignof.c
 test_alignof_OBJECTS = test-alignof.$(OBJEXT)
 test_alignof_LDADD = $(LDADD)
 test_alignof_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_alloca_opt_SOURCES = test-alloca-opt.c
 test_alloca_opt_OBJECTS = test-alloca-opt.$(OBJEXT)
 test_alloca_opt_LDADD = $(LDADD)
 test_alloca_opt_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_arpa_inet_SOURCES = test-arpa_inet.c
+test_arpa_inet_OBJECTS = test-arpa_inet.$(OBJEXT)
+test_arpa_inet_LDADD = $(LDADD)
+test_arpa_inet_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_arpa_inet_c___SOURCES_DIST = test-arpa_inet-c++.cc
+@ANSICXX_TRUE@am_test_arpa_inet_c___OBJECTS =  \
+@ANSICXX_TRUE@ test-arpa_inet-c++.$(OBJEXT)
+test_arpa_inet_c___OBJECTS = $(am_test_arpa_inet_c___OBJECTS)
+@ANSICXX_TRUE@test_arpa_inet_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_array_list_SOURCES = test-array_list.c
 test_array_list_OBJECTS = test-array_list.$(OBJEXT)
 test_array_list_LDADD = $(LDADD)
 test_array_list_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_array_oset_SOURCES = test-array_oset.c
 test_array_oset_OBJECTS = test-array_oset.$(OBJEXT)
-am__DEPENDENCIES_2 = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
 test_array_oset_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_asyncsafe_spin1_SOURCES = test-asyncsafe-spin1.c
+test_asyncsafe_spin1_OBJECTS = test-asyncsafe-spin1.$(OBJEXT)
+test_asyncsafe_spin1_LDADD = $(LDADD)
+test_asyncsafe_spin1_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_asyncsafe_spin2_SOURCES = test-asyncsafe-spin2.c
+test_asyncsafe_spin2_OBJECTS = test-asyncsafe-spin2.$(OBJEXT)
+test_asyncsafe_spin2_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_avltree_oset_SOURCES = test-avltree_oset.c
 test_avltree_oset_OBJECTS = test-avltree_oset.$(OBJEXT)
 test_avltree_oset_LDADD = $(LDADD)
 test_avltree_oset_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_binary_io_SOURCES = test-binary-io.c
 test_binary_io_OBJECTS = test-binary-io.$(OBJEXT)
 test_binary_io_LDADD = $(LDADD)
 test_binary_io_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_bind_SOURCES = test-bind.c
+test_bind_OBJECTS = test-bind.$(OBJEXT)
+test_bind_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_bitrotate_SOURCES = test-bitrotate.c
+test_bitrotate_OBJECTS = test-bitrotate.$(OBJEXT)
+test_bitrotate_LDADD = $(LDADD)
+test_bitrotate_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_btowc_SOURCES = test-btowc.c
 test_btowc_OBJECTS = test-btowc.$(OBJEXT)
-test_btowc_LDADD = $(LDADD)
-test_btowc_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+test_btowc_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
 test_c_ctype_SOURCES = test-c-ctype.c
 test_c_ctype_OBJECTS = test-c-ctype.$(OBJEXT)
-test_c_ctype_LDADD = $(LDADD)
-test_c_ctype_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+test_c_ctype_DEPENDENCIES = $(am__DEPENDENCIES_2) \
        $(am__DEPENDENCIES_1)
 test_c_stack_SOURCES = test-c-stack.c
 test_c_stack_OBJECTS = test-c-stack.$(OBJEXT)
@@ -505,52 +743,74 @@ test_c_stack_DEPENDENCIES = $(am__DEPENDENCIES_2) \
        $(am__DEPENDENCIES_1)
 test_c_strcasecmp_SOURCES = test-c-strcasecmp.c
 test_c_strcasecmp_OBJECTS = test-c-strcasecmp.$(OBJEXT)
-test_c_strcasecmp_LDADD = $(LDADD)
-test_c_strcasecmp_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+test_c_strcasecmp_DEPENDENCIES = $(am__DEPENDENCIES_2) \
        $(am__DEPENDENCIES_1)
 test_c_strncasecmp_SOURCES = test-c-strncasecmp.c
 test_c_strncasecmp_OBJECTS = test-c-strncasecmp.$(OBJEXT)
-test_c_strncasecmp_LDADD = $(LDADD)
-test_c_strncasecmp_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+test_c_strncasecmp_DEPENDENCIES = $(am__DEPENDENCIES_2) \
        $(am__DEPENDENCIES_1)
+test_calloc_gnu_SOURCES = test-calloc-gnu.c
+test_calloc_gnu_OBJECTS = test-calloc-gnu.$(OBJEXT)
+test_calloc_gnu_LDADD = $(LDADD)
+test_calloc_gnu_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_canonicalize_SOURCES = test-canonicalize.c
+test_canonicalize_OBJECTS = test-canonicalize.$(OBJEXT)
+test_canonicalize_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_canonicalize_lgpl_SOURCES = test-canonicalize-lgpl.c
 test_canonicalize_lgpl_OBJECTS = test-canonicalize-lgpl.$(OBJEXT)
-test_canonicalize_lgpl_LDADD = $(LDADD)
-test_canonicalize_lgpl_DEPENDENCIES = libtests.a ../lib/libm4.a \
-       libtests.a $(am__DEPENDENCIES_1)
+test_canonicalize_lgpl_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
 test_chdir_SOURCES = test-chdir.c
 test_chdir_OBJECTS = test-chdir.$(OBJEXT)
 test_chdir_LDADD = $(LDADD)
 test_chdir_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_cloexec_SOURCES = test-cloexec.c
 test_cloexec_OBJECTS = test-cloexec.$(OBJEXT)
 test_cloexec_LDADD = $(LDADD)
 test_cloexec_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_close_SOURCES = test-close.c
 test_close_OBJECTS = test-close.$(OBJEXT)
 test_close_LDADD = $(LDADD)
 test_close_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_closein_SOURCES = test-closein.c
 test_closein_OBJECTS = test-closein.$(OBJEXT)
-test_closein_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_closein_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_connect_SOURCES = test-connect.c
+test_connect_OBJECTS = test-connect.$(OBJEXT)
+test_connect_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_creat_SOURCES = test-creat.c
+test_creat_OBJECTS = test-creat.$(OBJEXT)
+test_creat_LDADD = $(LDADD)
+test_creat_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_ctype_SOURCES = test-ctype.c
 test_ctype_OBJECTS = test-ctype.$(OBJEXT)
 test_ctype_LDADD = $(LDADD)
 test_ctype_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_ctype_c___SOURCES_DIST = test-ctype-c++.cc test-ctype-c++2.cc
+@ANSICXX_TRUE@am_test_ctype_c___OBJECTS = test-ctype-c++.$(OBJEXT) \
+@ANSICXX_TRUE@ test-ctype-c++2.$(OBJEXT)
+test_ctype_c___OBJECTS = $(am_test_ctype_c___OBJECTS)
+test_ctype_c___LDADD = $(LDADD)
+test_ctype_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_dirent_SOURCES = test-dirent.c
 test_dirent_OBJECTS = test-dirent.$(OBJEXT)
 test_dirent_LDADD = $(LDADD)
 test_dirent_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_dirent_c___SOURCES_DIST = test-dirent-c++.cc
 @ANSICXX_TRUE@am_test_dirent_c___OBJECTS = test-dirent-c++.$(OBJEXT)
 test_dirent_c___OBJECTS = $(am_test_dirent_c___OBJECTS)
 @ANSICXX_TRUE@test_dirent_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
-@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_dirname_SOURCES = test-dirname.c
 test_dirname_OBJECTS = test-dirname.$(OBJEXT)
 test_dirname_DEPENDENCIES = $(am__DEPENDENCIES_2)
@@ -558,68 +818,104 @@ test_dup_SOURCES = test-dup.c
 test_dup_OBJECTS = test-dup.$(OBJEXT)
 test_dup_LDADD = $(LDADD)
 test_dup_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_dup_safer_SOURCES = test-dup-safer.c
 test_dup_safer_OBJECTS = test-dup-safer.$(OBJEXT)
 test_dup_safer_LDADD = $(LDADD)
 test_dup_safer_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_dup2_SOURCES = test-dup2.c
 test_dup2_OBJECTS = test-dup2.$(OBJEXT)
 test_dup2_LDADD = $(LDADD)
 test_dup2_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_dynarray_SOURCES = test-dynarray.c
+test_dynarray_OBJECTS = test-dynarray.$(OBJEXT)
+test_dynarray_LDADD = $(LDADD)
+test_dynarray_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_environ_SOURCES = test-environ.c
 test_environ_OBJECTS = test-environ.$(OBJEXT)
 test_environ_LDADD = $(LDADD)
 test_environ_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_errno_SOURCES = test-errno.c
 test_errno_OBJECTS = test-errno.$(OBJEXT)
 test_errno_LDADD = $(LDADD)
 test_errno_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_errno_c___SOURCES_DIST = test-errno-c++.cc test-errno-c++2.cc
+@ANSICXX_TRUE@am_test_errno_c___OBJECTS = test-errno-c++.$(OBJEXT) \
+@ANSICXX_TRUE@ test-errno-c++2.$(OBJEXT)
+test_errno_c___OBJECTS = $(am_test_errno_c___OBJECTS)
+test_errno_c___LDADD = $(LDADD)
+test_errno_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_execute_child_SOURCES = test-execute-child.c
+test_execute_child_OBJECTS = test-execute-child.$(OBJEXT)
+test_execute_child_DEPENDENCIES =
+test_execute_main_SOURCES = test-execute-main.c
+test_execute_main_OBJECTS = test-execute-main.$(OBJEXT)
+test_execute_main_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_execute_script_SOURCES = test-execute-script.c
+test_execute_script_OBJECTS =  \
+       test_execute_script-test-execute-script.$(OBJEXT)
+test_execute_script_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_explicit_bzero_SOURCES = test-explicit_bzero.c
+test_explicit_bzero_OBJECTS = test-explicit_bzero.$(OBJEXT)
+test_explicit_bzero_LDADD = $(LDADD)
+test_explicit_bzero_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_fchdir_SOURCES = test-fchdir.c
+test_fchdir_OBJECTS = test-fchdir.$(OBJEXT)
+test_fchdir_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
 test_fclose_SOURCES = test-fclose.c
 test_fclose_OBJECTS = test-fclose.$(OBJEXT)
 test_fclose_LDADD = $(LDADD)
 test_fclose_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fcntl_SOURCES = test-fcntl.c
 test_fcntl_OBJECTS = test-fcntl.$(OBJEXT)
 test_fcntl_LDADD = $(LDADD)
 test_fcntl_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fcntl_h_SOURCES = test-fcntl-h.c
 test_fcntl_h_OBJECTS = test-fcntl-h.$(OBJEXT)
 test_fcntl_h_LDADD = $(LDADD)
 test_fcntl_h_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_fcntl_h_c___SOURCES_DIST = test-fcntl-h-c++.cc
 @ANSICXX_TRUE@am_test_fcntl_h_c___OBJECTS =  \
 @ANSICXX_TRUE@ test-fcntl-h-c++.$(OBJEXT)
 test_fcntl_h_c___OBJECTS = $(am_test_fcntl_h_c___OBJECTS)
 @ANSICXX_TRUE@test_fcntl_h_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 @ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
 test_fdopen_SOURCES = test-fdopen.c
 test_fdopen_OBJECTS = test-fdopen.$(OBJEXT)
 test_fdopen_LDADD = $(LDADD)
 test_fdopen_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_fdopendir_SOURCES = test-fdopendir.c
+test_fdopendir_OBJECTS = test-fdopendir.$(OBJEXT)
+test_fdopendir_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_fflush_SOURCES = test-fflush.c
 test_fflush_OBJECTS = test-fflush.$(OBJEXT)
 test_fflush_LDADD = $(LDADD)
 test_fflush_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fflush2_SOURCES = test-fflush2.c
 test_fflush2_OBJECTS = test-fflush2.$(OBJEXT)
 test_fflush2_LDADD = $(LDADD)
 test_fflush2_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fgetc_SOURCES = test-fgetc.c
 test_fgetc_OBJECTS = test-fgetc.$(OBJEXT)
 test_fgetc_LDADD = $(LDADD)
 test_fgetc_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_filenamecat_SOURCES = test-filenamecat.c
 test_filenamecat_OBJECTS = test-filenamecat.$(OBJEXT)
 test_filenamecat_DEPENDENCIES = $(am__DEPENDENCIES_2)
@@ -627,113 +923,146 @@ test_float_SOURCES = test-float.c
 test_float_OBJECTS = test-float.$(OBJEXT)
 test_float_LDADD = $(LDADD)
 test_float_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_float_c___SOURCES_DIST = test-float-c++.cc test-float-c++2.cc
+@ANSICXX_TRUE@am_test_float_c___OBJECTS = test-float-c++.$(OBJEXT) \
+@ANSICXX_TRUE@ test-float-c++2.$(OBJEXT)
+test_float_c___OBJECTS = $(am_test_float_c___OBJECTS)
+test_float_c___LDADD = $(LDADD)
+test_float_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fopen_SOURCES = test-fopen.c
 test_fopen_OBJECTS = test-fopen.$(OBJEXT)
 test_fopen_LDADD = $(LDADD)
 test_fopen_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_fopen_gnu_SOURCES = test-fopen-gnu.c
+test_fopen_gnu_OBJECTS = test-fopen-gnu.$(OBJEXT)
+test_fopen_gnu_LDADD = $(LDADD)
+test_fopen_gnu_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fopen_safer_SOURCES = test-fopen-safer.c
 test_fopen_safer_OBJECTS = test-fopen-safer.$(OBJEXT)
 test_fopen_safer_LDADD = $(LDADD)
 test_fopen_safer_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fpending_SOURCES = test-fpending.c
 test_fpending_OBJECTS = test-fpending.$(OBJEXT)
 test_fpending_LDADD = $(LDADD)
 test_fpending_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fpurge_SOURCES = test-fpurge.c
 test_fpurge_OBJECTS = test-fpurge.$(OBJEXT)
 test_fpurge_LDADD = $(LDADD)
 test_fpurge_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fputc_SOURCES = test-fputc.c
 test_fputc_OBJECTS = test-fputc.$(OBJEXT)
 test_fputc_LDADD = $(LDADD)
 test_fputc_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fread_SOURCES = test-fread.c
 test_fread_OBJECTS = test-fread.$(OBJEXT)
 test_fread_LDADD = $(LDADD)
 test_fread_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_freadahead_SOURCES = test-freadahead.c
 test_freadahead_OBJECTS = test-freadahead.$(OBJEXT)
 test_freadahead_LDADD = $(LDADD)
 test_freadahead_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_freading_SOURCES = test-freading.c
 test_freading_OBJECTS = test-freading.$(OBJEXT)
 test_freading_LDADD = $(LDADD)
 test_freading_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_free_SOURCES = test-free.c
+test_free_OBJECTS = test-free.$(OBJEXT)
+test_free_LDADD = $(LDADD)
+test_free_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_freopen_SOURCES = test-freopen.c
+test_freopen_OBJECTS = test-freopen.$(OBJEXT)
+test_freopen_LDADD = $(LDADD)
+test_freopen_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am_test_frexp_nolibm_OBJECTS = test-frexp.$(OBJEXT) randomd.$(OBJEXT)
 test_frexp_nolibm_OBJECTS = $(am_test_frexp_nolibm_OBJECTS)
 test_frexp_nolibm_LDADD = $(LDADD)
 test_frexp_nolibm_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am_test_frexpl_nolibm_OBJECTS = test-frexpl.$(OBJEXT) \
        randoml.$(OBJEXT)
 test_frexpl_nolibm_OBJECTS = $(am_test_frexpl_nolibm_OBJECTS)
 test_frexpl_nolibm_LDADD = $(LDADD)
 test_frexpl_nolibm_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fseek_SOURCES = test-fseek.c
 test_fseek_OBJECTS = test-fseek.$(OBJEXT)
 test_fseek_LDADD = $(LDADD)
 test_fseek_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fseeko_SOURCES = test-fseeko.c
 test_fseeko_OBJECTS = test-fseeko.$(OBJEXT)
 test_fseeko_LDADD = $(LDADD)
 test_fseeko_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fseeko3_SOURCES = test-fseeko3.c
 test_fseeko3_OBJECTS = test-fseeko3.$(OBJEXT)
 test_fseeko3_LDADD = $(LDADD)
 test_fseeko3_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fseeko4_SOURCES = test-fseeko4.c
 test_fseeko4_OBJECTS = test-fseeko4.$(OBJEXT)
 test_fseeko4_LDADD = $(LDADD)
 test_fseeko4_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fstat_SOURCES = test-fstat.c
 test_fstat_OBJECTS = test-fstat.$(OBJEXT)
 test_fstat_LDADD = $(LDADD)
 test_fstat_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_fstatat_SOURCES = test-fstatat.c
+test_fstatat_OBJECTS = test-fstatat.$(OBJEXT)
+test_fstatat_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_ftell_SOURCES = test-ftell.c
 test_ftell_OBJECTS = test-ftell.$(OBJEXT)
 test_ftell_LDADD = $(LDADD)
 test_ftell_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_ftell3_SOURCES = test-ftell3.c
 test_ftell3_OBJECTS = test-ftell3.$(OBJEXT)
 test_ftell3_LDADD = $(LDADD)
 test_ftell3_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_ftello_SOURCES = test-ftello.c
 test_ftello_OBJECTS = test-ftello.$(OBJEXT)
 test_ftello_LDADD = $(LDADD)
 test_ftello_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_ftello3_SOURCES = test-ftello3.c
 test_ftello3_OBJECTS = test-ftello3.$(OBJEXT)
 test_ftello3_LDADD = $(LDADD)
 test_ftello3_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_ftello4_SOURCES = test-ftello4.c
 test_ftello4_OBJECTS = test-ftello4.$(OBJEXT)
 test_ftello4_LDADD = $(LDADD)
 test_ftello4_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_ftruncate_SOURCES = test-ftruncate.c
+test_ftruncate_OBJECTS = test-ftruncate.$(OBJEXT)
+test_ftruncate_LDADD = $(LDADD)
+test_ftruncate_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_fwrite_SOURCES = test-fwrite.c
 test_fwrite_OBJECTS = test-fwrite.$(OBJEXT)
 test_fwrite_LDADD = $(LDADD)
 test_fwrite_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_getcwd_SOURCES = test-getcwd.c
+test_getcwd_OBJECTS = test-getcwd.$(OBJEXT)
+test_getcwd_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_getcwd_lgpl_SOURCES = test-getcwd-lgpl.c
 test_getcwd_lgpl_OBJECTS = test-getcwd-lgpl.$(OBJEXT)
 test_getcwd_lgpl_DEPENDENCIES = $(am__DEPENDENCIES_2) \
@@ -742,127 +1071,210 @@ test_getdtablesize_SOURCES = test-getdtablesize.c
 test_getdtablesize_OBJECTS = test-getdtablesize.$(OBJEXT)
 test_getdtablesize_LDADD = $(LDADD)
 test_getdtablesize_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_getopt_gnu_SOURCES = test-getopt-gnu.c
 test_getopt_gnu_OBJECTS = test-getopt-gnu.$(OBJEXT)
 test_getopt_gnu_DEPENDENCIES = $(am__DEPENDENCIES_2) \
        $(am__DEPENDENCIES_1)
-test_getopt_posix_SOURCES = test-getopt-posix.c
-test_getopt_posix_OBJECTS = test-getopt-posix.$(OBJEXT)
-test_getopt_posix_DEPENDENCIES = $(am__DEPENDENCIES_2) \
-       $(am__DEPENDENCIES_1)
 test_getprogname_SOURCES = test-getprogname.c
 test_getprogname_OBJECTS = test-getprogname.$(OBJEXT)
 test_getprogname_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_getrandom_SOURCES = test-getrandom.c
+test_getrandom_OBJECTS = test-getrandom.$(OBJEXT)
+test_getrandom_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_gettimeofday_SOURCES = test-gettimeofday.c
 test_gettimeofday_OBJECTS = test-gettimeofday.$(OBJEXT)
 test_gettimeofday_LDADD = $(LDADD)
 test_gettimeofday_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_hard_locale_SOURCES = test-hard-locale.c
+test_hard_locale_OBJECTS = test-hard-locale.$(OBJEXT)
+test_hard_locale_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_hash_SOURCES = test-hash.c
+test_hash_OBJECTS = test-hash.$(OBJEXT)
+test_hash_LDADD = $(LDADD)
+test_hash_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_iconv_SOURCES = test-iconv.c
+test_iconv_OBJECTS = test-iconv.$(OBJEXT)
+test_iconv_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_iconv_h_SOURCES = test-iconv-h.c
+test_iconv_h_OBJECTS = test-iconv-h.$(OBJEXT)
+test_iconv_h_LDADD = $(LDADD)
+test_iconv_h_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_iconv_h_c___SOURCES_DIST = test-iconv-h-c++.cc
+@ANSICXX_TRUE@am_test_iconv_h_c___OBJECTS =  \
+@ANSICXX_TRUE@ test-iconv-h-c++.$(OBJEXT)
+test_iconv_h_c___OBJECTS = $(am_test_iconv_h_c___OBJECTS)
+@ANSICXX_TRUE@test_iconv_h_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
 test_ignore_value_SOURCES = test-ignore-value.c
 test_ignore_value_OBJECTS = test-ignore-value.$(OBJEXT)
 test_ignore_value_LDADD = $(LDADD)
 test_ignore_value_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_inet_pton_SOURCES = test-inet_pton.c
+test_inet_pton_OBJECTS = test-inet_pton.$(OBJEXT)
+test_inet_pton_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_intprops_SOURCES = test-intprops.c
 test_intprops_OBJECTS = test-intprops.$(OBJEXT)
 test_intprops_LDADD = $(LDADD)
 test_intprops_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_inttostr_SOURCES = test-inttostr.c
+test_inttostr_OBJECTS = test-inttostr.$(OBJEXT)
+test_inttostr_LDADD = $(LDADD)
+test_inttostr_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_inttypes_SOURCES = test-inttypes.c
 test_inttypes_OBJECTS = test-inttypes.$(OBJEXT)
 test_inttypes_LDADD = $(LDADD)
 test_inttypes_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_inttypes_c___SOURCES_DIST = test-inttypes-c++.cc \
+       test-inttypes-c++2.cc
+@ANSICXX_TRUE@am_test_inttypes_c___OBJECTS =  \
+@ANSICXX_TRUE@ test-inttypes-c++.$(OBJEXT) \
+@ANSICXX_TRUE@ test-inttypes-c++2.$(OBJEXT)
+test_inttypes_c___OBJECTS = $(am_test_inttypes_c___OBJECTS)
+test_inttypes_c___LDADD = $(LDADD)
+test_inttypes_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_ioctl_SOURCES = test-ioctl.c
+test_ioctl_OBJECTS = test-ioctl.$(OBJEXT)
+test_ioctl_LDADD = $(LDADD)
+test_ioctl_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_isblank_SOURCES = test-isblank.c
 test_isblank_OBJECTS = test-isblank.$(OBJEXT)
 test_isblank_LDADD = $(LDADD)
 test_isblank_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_isnand_nolibm_SOURCES = test-isnand-nolibm.c
 test_isnand_nolibm_OBJECTS = test-isnand-nolibm.$(OBJEXT)
 test_isnand_nolibm_LDADD = $(LDADD)
 test_isnand_nolibm_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_isnanf_nolibm_SOURCES = test-isnanf-nolibm.c
 test_isnanf_nolibm_OBJECTS = test-isnanf-nolibm.$(OBJEXT)
 test_isnanf_nolibm_LDADD = $(LDADD)
 test_isnanf_nolibm_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_isnanl_nolibm_SOURCES = test-isnanl-nolibm.c
 test_isnanl_nolibm_OBJECTS = test-isnanl-nolibm.$(OBJEXT)
 test_isnanl_nolibm_LDADD = $(LDADD)
 test_isnanl_nolibm_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_iswblank_SOURCES = test-iswblank.c
+test_iswblank_OBJECTS = test-iswblank.$(OBJEXT)
+test_iswblank_LDADD = $(LDADD)
+test_iswblank_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_iswdigit_SOURCES = test-iswdigit.c
+test_iswdigit_OBJECTS = test-iswdigit.$(OBJEXT)
+test_iswdigit_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_iswxdigit_SOURCES = test-iswxdigit.c
+test_iswxdigit_OBJECTS = test-iswxdigit.$(OBJEXT)
+test_iswxdigit_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_langinfo_SOURCES = test-langinfo.c
 test_langinfo_OBJECTS = test-langinfo.$(OBJEXT)
 test_langinfo_LDADD = $(LDADD)
 test_langinfo_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_langinfo_c___SOURCES_DIST = test-langinfo-c++.cc
 @ANSICXX_TRUE@am_test_langinfo_c___OBJECTS =  \
 @ANSICXX_TRUE@ test-langinfo-c++.$(OBJEXT)
 test_langinfo_c___OBJECTS = $(am_test_langinfo_c___OBJECTS)
 test_langinfo_c___LDADD = $(LDADD)
 test_langinfo_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_limits_h_SOURCES = test-limits-h.c
 test_limits_h_OBJECTS = test-limits-h.$(OBJEXT)
 test_limits_h_LDADD = $(LDADD)
 test_limits_h_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_limits_h_c___SOURCES_DIST = test-limits-h-c++.cc \
+       test-limits-h-c++2.cc
+@ANSICXX_TRUE@am_test_limits_h_c___OBJECTS =  \
+@ANSICXX_TRUE@ test-limits-h-c++.$(OBJEXT) \
+@ANSICXX_TRUE@ test-limits-h-c++2.$(OBJEXT)
+test_limits_h_c___OBJECTS = $(am_test_limits_h_c___OBJECTS)
+test_limits_h_c___LDADD = $(LDADD)
+test_limits_h_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_link_SOURCES = test-link.c
 test_link_OBJECTS = test-link.$(OBJEXT)
 test_link_LDADD = $(LDADD)
 test_link_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_linked_list_SOURCES = test-linked_list.c
+test_linked_list_OBJECTS = test-linked_list.$(OBJEXT)
+test_linked_list_LDADD = $(LDADD)
+test_linked_list_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_linkedhash_list_SOURCES = test-linkedhash_list.c
 test_linkedhash_list_OBJECTS = test-linkedhash_list.$(OBJEXT)
 test_linkedhash_list_LDADD = $(LDADD)
 test_linkedhash_list_DEPENDENCIES = libtests.a ../lib/libm4.a \
-       libtests.a $(am__DEPENDENCIES_1)
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_listen_SOURCES = test-listen.c
+test_listen_OBJECTS = test-listen.$(OBJEXT)
+test_listen_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_localcharset_SOURCES = test-localcharset.c
+test_localcharset_OBJECTS = test-localcharset.$(OBJEXT)
+test_localcharset_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
 test_locale_SOURCES = test-locale.c
 test_locale_OBJECTS = test-locale.$(OBJEXT)
 test_locale_LDADD = $(LDADD)
 test_locale_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_locale_c___SOURCES_DIST = test-locale-c++.cc \
        test-locale-c++2.cc
 @ANSICXX_TRUE@am_test_locale_c___OBJECTS = test-locale-c++.$(OBJEXT) \
 @ANSICXX_TRUE@ test-locale-c++2.$(OBJEXT)
 test_locale_c___OBJECTS = $(am_test_locale_c___OBJECTS)
-test_locale_c___LDADD = $(LDADD)
-test_locale_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+@ANSICXX_TRUE@test_locale_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
 test_localeconv_SOURCES = test-localeconv.c
 test_localeconv_OBJECTS = test-localeconv.$(OBJEXT)
 test_localeconv_LDADD = $(LDADD)
 test_localeconv_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_localename_SOURCES = test-localename.c
 test_localename_OBJECTS = test-localename.$(OBJEXT)
 test_localename_DEPENDENCIES = $(am__DEPENDENCIES_2) \
-       $(am__DEPENDENCIES_1)
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_lseek_SOURCES = test-lseek.c
 test_lseek_OBJECTS = test-lseek.$(OBJEXT)
 test_lseek_LDADD = $(LDADD)
 test_lseek_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_lstat_SOURCES = test-lstat.c
 test_lstat_OBJECTS = test-lstat.$(OBJEXT)
 test_lstat_LDADD = $(LDADD)
 test_lstat_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_malloc_gnu_SOURCES = test-malloc-gnu.c
+test_malloc_gnu_OBJECTS = test-malloc-gnu.$(OBJEXT)
+test_malloc_gnu_LDADD = $(LDADD)
+test_malloc_gnu_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_malloca_SOURCES = test-malloca.c
 test_malloca_OBJECTS = test-malloca.$(OBJEXT)
 test_malloca_LDADD = $(LDADD)
 test_malloca_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_math_SOURCES = test-math.c
 test_math_OBJECTS = test-math.$(OBJEXT)
 test_math_LDADD = $(LDADD)
 test_math_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_math_c___SOURCES_DIST = test-math-c++.cc test-math-c++2.cc
 @ANSICXX_TRUE@am_test_math_c___OBJECTS = test-math-c++.$(OBJEXT) \
 @ANSICXX_TRUE@ test-math-c++2.$(OBJEXT)
@@ -870,56 +1282,148 @@ test_math_c___OBJECTS = $(am_test_math_c___OBJECTS)
 @ANSICXX_TRUE@test_math_c___DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_mbrtowc_SOURCES = test-mbrtowc.c
 test_mbrtowc_OBJECTS = test-mbrtowc.$(OBJEXT)
-test_mbrtowc_LDADD = $(LDADD)
-test_mbrtowc_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+test_mbrtowc_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_mbrtowc_w32_SOURCES = test-mbrtowc-w32.c
 test_mbrtowc_w32_OBJECTS = test-mbrtowc-w32.$(OBJEXT)
 test_mbrtowc_w32_LDADD = $(LDADD)
 test_mbrtowc_w32_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_mbsinit_SOURCES = test-mbsinit.c
 test_mbsinit_OBJECTS = test-mbsinit.$(OBJEXT)
-test_mbsinit_LDADD = $(LDADD)
-test_mbsinit_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+test_mbsinit_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_mbsstr1_SOURCES = test-mbsstr1.c
+test_mbsstr1_OBJECTS = test-mbsstr1.$(OBJEXT)
+test_mbsstr1_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_mbsstr2_SOURCES = test-mbsstr2.c
+test_mbsstr2_OBJECTS = test-mbsstr2.$(OBJEXT)
+test_mbsstr2_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_mbsstr3_SOURCES = test-mbsstr3.c
+test_mbsstr3_OBJECTS = test-mbsstr3.$(OBJEXT)
+test_mbsstr3_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_memchr_SOURCES = test-memchr.c
 test_memchr_OBJECTS = test-memchr.$(OBJEXT)
 test_memchr_LDADD = $(LDADD)
 test_memchr_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_memchr2_SOURCES = test-memchr2.c
 test_memchr2_OBJECTS = test-memchr2.$(OBJEXT)
 test_memchr2_LDADD = $(LDADD)
 test_memchr2_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_memrchr_SOURCES = test-memrchr.c
+test_memrchr_OBJECTS = test-memrchr.$(OBJEXT)
+test_memrchr_LDADD = $(LDADD)
+test_memrchr_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_mkdir_SOURCES = test-mkdir.c
+test_mkdir_OBJECTS = test-mkdir.$(OBJEXT)
+test_mkdir_LDADD = $(LDADD)
+test_mkdir_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_nanosleep_SOURCES = test-nanosleep.c
+test_nanosleep_OBJECTS = test-nanosleep.$(OBJEXT)
+test_nanosleep_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_netinet_in_SOURCES = test-netinet_in.c
+test_netinet_in_OBJECTS = test-netinet_in.$(OBJEXT)
+test_netinet_in_LDADD = $(LDADD)
+test_netinet_in_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_nl_langinfo_SOURCES = test-nl_langinfo.c
 test_nl_langinfo_OBJECTS = test-nl_langinfo.$(OBJEXT)
-test_nl_langinfo_LDADD = $(LDADD)
-test_nl_langinfo_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+test_nl_langinfo_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_nl_langinfo_mt_SOURCES = test-nl_langinfo-mt.c
+test_nl_langinfo_mt_OBJECTS = test-nl_langinfo-mt.$(OBJEXT)
+test_nl_langinfo_mt_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
        $(am__DEPENDENCIES_1)
 test_open_SOURCES = test-open.c
 test_open_OBJECTS = test-open.$(OBJEXT)
 test_open_LDADD = $(LDADD)
 test_open_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_openat_SOURCES = test-openat.c
+test_openat_OBJECTS = test-openat.$(OBJEXT)
+test_openat_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_pathmax_SOURCES = test-pathmax.c
 test_pathmax_OBJECTS = test-pathmax.$(OBJEXT)
 test_pathmax_LDADD = $(LDADD)
 test_pathmax_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_perror_SOURCES = test-perror.c
+test_perror_OBJECTS = test-perror.$(OBJEXT)
+test_perror_LDADD = $(LDADD)
+test_perror_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_perror2_SOURCES = test-perror2.c
+test_perror2_OBJECTS = test-perror2.$(OBJEXT)
+test_perror2_LDADD = $(LDADD)
+test_perror2_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_pipe_SOURCES = test-pipe.c
+test_pipe_OBJECTS = test-pipe.$(OBJEXT)
+test_pipe_LDADD = $(LDADD)
+test_pipe_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_pipe2_SOURCES = test-pipe2.c
 test_pipe2_OBJECTS = test-pipe2.$(OBJEXT)
-test_pipe2_DEPENDENCIES = $(am__DEPENDENCIES_2)
-test_posix_spawn1_SOURCES = test-posix_spawn1.c
-test_posix_spawn1_OBJECTS = test-posix_spawn1.$(OBJEXT)
-test_posix_spawn1_LDADD = $(LDADD)
-test_posix_spawn1_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
-test_posix_spawn2_SOURCES = test-posix_spawn2.c
-test_posix_spawn2_OBJECTS = test-posix_spawn2.$(OBJEXT)
-test_posix_spawn2_LDADD = $(LDADD)
-test_posix_spawn2_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+test_pipe2_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_posix_spawn_chdir_SOURCES = test-posix_spawn-chdir.c
+test_posix_spawn_chdir_OBJECTS = test-posix_spawn-chdir.$(OBJEXT)
+test_posix_spawn_chdir_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_posix_spawn_dup2_stdin_SOURCES = test-posix_spawn-dup2-stdin.c
+test_posix_spawn_dup2_stdin_OBJECTS =  \
+       test-posix_spawn-dup2-stdin.$(OBJEXT)
+test_posix_spawn_dup2_stdin_LDADD = $(LDADD)
+test_posix_spawn_dup2_stdin_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_posix_spawn_dup2_stdout_SOURCES = test-posix_spawn-dup2-stdout.c
+test_posix_spawn_dup2_stdout_OBJECTS =  \
+       test-posix_spawn-dup2-stdout.$(OBJEXT)
+test_posix_spawn_dup2_stdout_LDADD = $(LDADD)
+test_posix_spawn_dup2_stdout_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_posix_spawn_inherit0_SOURCES = test-posix_spawn-inherit0.c
+test_posix_spawn_inherit0_OBJECTS =  \
+       test-posix_spawn-inherit0.$(OBJEXT)
+test_posix_spawn_inherit0_LDADD = $(LDADD)
+test_posix_spawn_inherit0_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_posix_spawn_inherit1_SOURCES = test-posix_spawn-inherit1.c
+test_posix_spawn_inherit1_OBJECTS =  \
+       test-posix_spawn-inherit1.$(OBJEXT)
+test_posix_spawn_inherit1_LDADD = $(LDADD)
+test_posix_spawn_inherit1_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_posix_spawn_open1_SOURCES = test-posix_spawn-open1.c
+test_posix_spawn_open1_OBJECTS = test-posix_spawn-open1.$(OBJEXT)
+test_posix_spawn_open1_LDADD = $(LDADD)
+test_posix_spawn_open1_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_posix_spawn_open2_SOURCES = test-posix_spawn-open2.c
+test_posix_spawn_open2_OBJECTS = test-posix_spawn-open2.$(OBJEXT)
+test_posix_spawn_open2_LDADD = $(LDADD)
+test_posix_spawn_open2_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_posix_spawn_script_SOURCES = test-posix_spawn-script.c
+test_posix_spawn_script_OBJECTS =  \
+       test_posix_spawn_script-test-posix_spawn-script.$(OBJEXT)
+test_posix_spawn_script_LDADD = $(LDADD)
+test_posix_spawn_script_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_posix_spawn_file_actions_addchdir_SOURCES =  \
+       test-posix_spawn_file_actions_addchdir.c
+test_posix_spawn_file_actions_addchdir_OBJECTS =  \
+       test-posix_spawn_file_actions_addchdir.$(OBJEXT)
+test_posix_spawn_file_actions_addchdir_LDADD = $(LDADD)
+test_posix_spawn_file_actions_addchdir_DEPENDENCIES = libtests.a \
+       ../lib/libm4.a libtests.a ../lib/libm4.a libtests.a \
        $(am__DEPENDENCIES_1)
 test_posix_spawn_file_actions_addclose_SOURCES =  \
        test-posix_spawn_file_actions_addclose.c
@@ -927,92 +1431,164 @@ test_posix_spawn_file_actions_addclose_OBJECTS =  \
        test-posix_spawn_file_actions_addclose.$(OBJEXT)
 test_posix_spawn_file_actions_addclose_LDADD = $(LDADD)
 test_posix_spawn_file_actions_addclose_DEPENDENCIES = libtests.a \
-       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a ../lib/libm4.a libtests.a \
+       $(am__DEPENDENCIES_1)
 test_posix_spawn_file_actions_adddup2_SOURCES =  \
        test-posix_spawn_file_actions_adddup2.c
 test_posix_spawn_file_actions_adddup2_OBJECTS =  \
        test-posix_spawn_file_actions_adddup2.$(OBJEXT)
 test_posix_spawn_file_actions_adddup2_LDADD = $(LDADD)
 test_posix_spawn_file_actions_adddup2_DEPENDENCIES = libtests.a \
-       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a ../lib/libm4.a libtests.a \
+       $(am__DEPENDENCIES_1)
 test_posix_spawn_file_actions_addopen_SOURCES =  \
        test-posix_spawn_file_actions_addopen.c
 test_posix_spawn_file_actions_addopen_OBJECTS =  \
        test-posix_spawn_file_actions_addopen.$(OBJEXT)
 test_posix_spawn_file_actions_addopen_LDADD = $(LDADD)
 test_posix_spawn_file_actions_addopen_DEPENDENCIES = libtests.a \
-       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a ../lib/libm4.a libtests.a \
+       $(am__DEPENDENCIES_1)
+test_posix_spawnp_script_SOURCES = test-posix_spawnp-script.c
+test_posix_spawnp_script_OBJECTS =  \
+       test_posix_spawnp_script-test-posix_spawnp-script.$(OBJEXT)
+test_posix_spawnp_script_LDADD = $(LDADD)
+test_posix_spawnp_script_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_printf_frexp_SOURCES = test-printf-frexp.c
 test_printf_frexp_OBJECTS = test-printf-frexp.$(OBJEXT)
 test_printf_frexp_LDADD = $(LDADD)
 test_printf_frexp_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_printf_frexpl_SOURCES = test-printf-frexpl.c
 test_printf_frexpl_OBJECTS = test-printf-frexpl.$(OBJEXT)
 test_printf_frexpl_LDADD = $(LDADD)
 test_printf_frexpl_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_pthread_SOURCES = test-pthread.c
+test_pthread_OBJECTS = test-pthread.$(OBJEXT)
+test_pthread_LDADD = $(LDADD)
+test_pthread_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_pthread_c___SOURCES_DIST = test-pthread-c++.cc
+@ANSICXX_TRUE@am_test_pthread_c___OBJECTS =  \
+@ANSICXX_TRUE@ test-pthread-c++.$(OBJEXT)
+test_pthread_c___OBJECTS = $(am_test_pthread_c___OBJECTS)
+@ANSICXX_TRUE@test_pthread_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
+test_pthread_thread_SOURCES = test-pthread-thread.c
+test_pthread_thread_OBJECTS = test-pthread-thread.$(OBJEXT)
+test_pthread_thread_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_pthread_sigmask1_SOURCES = test-pthread_sigmask1.c
+test_pthread_sigmask1_OBJECTS = test-pthread_sigmask1.$(OBJEXT)
+test_pthread_sigmask1_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_pthread_sigmask2_SOURCES = test-pthread_sigmask2.c
+test_pthread_sigmask2_OBJECTS = test-pthread_sigmask2.$(OBJEXT)
+test_pthread_sigmask2_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_quotearg_simple_SOURCES = test-quotearg-simple.c
 test_quotearg_simple_OBJECTS = test-quotearg-simple.$(OBJEXT)
-test_quotearg_simple_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_quotearg_simple_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
 test_raise_SOURCES = test-raise.c
 test_raise_OBJECTS = test-raise.$(OBJEXT)
 test_raise_LDADD = $(LDADD)
 test_raise_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_rawmemchr_SOURCES = test-rawmemchr.c
 test_rawmemchr_OBJECTS = test-rawmemchr.$(OBJEXT)
 test_rawmemchr_LDADD = $(LDADD)
 test_rawmemchr_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_read_file_SOURCES = test-read-file.c
+test_read_file_OBJECTS = test-read-file.$(OBJEXT)
+test_read_file_LDADD = $(LDADD)
+test_read_file_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_readlink_SOURCES = test-readlink.c
 test_readlink_OBJECTS = test-readlink.$(OBJEXT)
 test_readlink_LDADD = $(LDADD)
 test_readlink_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_realloc_gnu_SOURCES = test-realloc-gnu.c
+test_realloc_gnu_OBJECTS = test-realloc-gnu.$(OBJEXT)
+test_realloc_gnu_LDADD = $(LDADD)
+test_realloc_gnu_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_reallocarray_SOURCES = test-reallocarray.c
+test_reallocarray_OBJECTS = test-reallocarray.$(OBJEXT)
+test_reallocarray_LDADD = $(LDADD)
+test_reallocarray_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_regex_SOURCES = test-regex.c
 test_regex_OBJECTS = test-regex.$(OBJEXT)
-test_regex_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_regex_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_rename_SOURCES = test-rename.c
 test_rename_OBJECTS = test-rename.$(OBJEXT)
 test_rename_LDADD = $(LDADD)
 test_rename_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_rmdir_SOURCES = test-rmdir.c
 test_rmdir_OBJECTS = test-rmdir.$(OBJEXT)
 test_rmdir_LDADD = $(LDADD)
 test_rmdir_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_sched_SOURCES = test-sched.c
 test_sched_OBJECTS = test-sched.$(OBJEXT)
 test_sched_LDADD = $(LDADD)
 test_sched_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am_test_scratch_buffer_OBJECTS = test-scratch-buffer.$(OBJEXT)
+test_scratch_buffer_OBJECTS = $(am_test_scratch_buffer_OBJECTS)
+test_scratch_buffer_LDADD = $(LDADD)
+test_scratch_buffer_DEPENDENCIES = libtests.a ../lib/libm4.a \
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_select_SOURCES = test-select.c
+test_select_OBJECTS = test-select.$(OBJEXT)
+test_select_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_select_fd_SOURCES = test-select-fd.c
+test_select_fd_OBJECTS = test-select-fd.$(OBJEXT)
+test_select_fd_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_select_stdin_SOURCES = test-select-stdin.c
+test_select_stdin_OBJECTS = test-select-stdin.$(OBJEXT)
+test_select_stdin_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_setenv_SOURCES = test-setenv.c
 test_setenv_OBJECTS = test-setenv.$(OBJEXT)
 test_setenv_LDADD = $(LDADD)
 test_setenv_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_setlocale1_SOURCES = test-setlocale1.c
 test_setlocale1_OBJECTS = test-setlocale1.$(OBJEXT)
-test_setlocale1_LDADD = $(LDADD)
-test_setlocale1_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+test_setlocale1_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_setlocale2_SOURCES = test-setlocale2.c
 test_setlocale2_OBJECTS = test-setlocale2.$(OBJEXT)
-test_setlocale2_LDADD = $(LDADD)
-test_setlocale2_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+test_setlocale2_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_setlocale_null_SOURCES = test-setlocale_null.c
+test_setlocale_null_OBJECTS = test-setlocale_null.$(OBJEXT)
+test_setlocale_null_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_setlocale_null_mt_all_SOURCES = test-setlocale_null-mt-all.c
+test_setlocale_null_mt_all_OBJECTS =  \
+       test-setlocale_null-mt-all.$(OBJEXT)
+test_setlocale_null_mt_all_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_setlocale_null_mt_one_SOURCES = test-setlocale_null-mt-one.c
+test_setlocale_null_mt_one_OBJECTS =  \
+       test-setlocale_null-mt-one.$(OBJEXT)
+test_setlocale_null_mt_one_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_setsockopt_SOURCES = test-setsockopt.c
+test_setsockopt_OBJECTS = test-setsockopt.$(OBJEXT)
+test_setsockopt_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_sigaction_SOURCES = test-sigaction.c
 test_sigaction_OBJECTS = test-sigaction.$(OBJEXT)
 test_sigaction_LDADD = $(LDADD)
 test_sigaction_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_signal_h_SOURCES = test-signal-h.c
 test_signal_h_OBJECTS = test-signal-h.$(OBJEXT)
 test_signal_h_LDADD = $(LDADD)
 test_signal_h_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_signal_h_c___SOURCES_DIST = test-signal-h-c++.cc \
        test-signal-h-c++2.cc
 @ANSICXX_TRUE@am_test_signal_h_c___OBJECTS =  \
@@ -1020,121 +1596,190 @@ am__test_signal_h_c___SOURCES_DIST = test-signal-h-c++.cc \
 @ANSICXX_TRUE@ test-signal-h-c++2.$(OBJEXT)
 test_signal_h_c___OBJECTS = $(am_test_signal_h_c___OBJECTS)
 @ANSICXX_TRUE@test_signal_h_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 @ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
 test_signbit_SOURCES = test-signbit.c
 test_signbit_OBJECTS = test-signbit.$(OBJEXT)
 test_signbit_LDADD = $(LDADD)
 test_signbit_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_sigpipe_SOURCES = test-sigpipe.c
 test_sigpipe_OBJECTS = test-sigpipe.$(OBJEXT)
 test_sigpipe_LDADD = $(LDADD)
 test_sigpipe_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_sigprocmask_SOURCES = test-sigprocmask.c
 test_sigprocmask_OBJECTS = test-sigprocmask.$(OBJEXT)
 test_sigprocmask_LDADD = $(LDADD)
 test_sigprocmask_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_sigsegv_catch_segv1_SOURCES = test-sigsegv-catch-segv1.c
+test_sigsegv_catch_segv1_OBJECTS = test-sigsegv-catch-segv1.$(OBJEXT)
+test_sigsegv_catch_segv1_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_sigsegv_catch_segv2_SOURCES = test-sigsegv-catch-segv2.c
+test_sigsegv_catch_segv2_OBJECTS = test-sigsegv-catch-segv2.$(OBJEXT)
+test_sigsegv_catch_segv2_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_sigsegv_catch_stackoverflow1_SOURCES =  \
+       test-sigsegv-catch-stackoverflow1.c
+test_sigsegv_catch_stackoverflow1_OBJECTS =  \
+       test-sigsegv-catch-stackoverflow1.$(OBJEXT)
+test_sigsegv_catch_stackoverflow1_DEPENDENCIES =  \
+       $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_sigsegv_catch_stackoverflow2_SOURCES =  \
+       test-sigsegv-catch-stackoverflow2.c
+test_sigsegv_catch_stackoverflow2_OBJECTS =  \
+       test-sigsegv-catch-stackoverflow2.$(OBJEXT)
+test_sigsegv_catch_stackoverflow2_DEPENDENCIES =  \
+       $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
 test_sleep_SOURCES = test-sleep.c
 test_sleep_OBJECTS = test-sleep.$(OBJEXT)
 test_sleep_LDADD = $(LDADD)
 test_sleep_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_snprintf_SOURCES = test-snprintf.c
 test_snprintf_OBJECTS = test-snprintf.$(OBJEXT)
 test_snprintf_LDADD = $(LDADD)
 test_snprintf_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_sockets_SOURCES = test-sockets.c
+test_sockets_OBJECTS = test-sockets.$(OBJEXT)
+test_sockets_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_spawn_SOURCES = test-spawn.c
 test_spawn_OBJECTS = test-spawn.$(OBJEXT)
 test_spawn_LDADD = $(LDADD)
 test_spawn_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_spawn_c___SOURCES_DIST = test-spawn-c++.cc
 @ANSICXX_TRUE@am_test_spawn_c___OBJECTS = test-spawn-c++.$(OBJEXT)
 test_spawn_c___OBJECTS = $(am_test_spawn_c___OBJECTS)
 @ANSICXX_TRUE@test_spawn_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
-@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_spawn_pipe_child_SOURCES = test-spawn-pipe-child.c
 test_spawn_pipe_child_OBJECTS = test-spawn-pipe-child.$(OBJEXT)
 test_spawn_pipe_child_DEPENDENCIES =
 test_spawn_pipe_main_SOURCES = test-spawn-pipe-main.c
 test_spawn_pipe_main_OBJECTS = test-spawn-pipe-main.$(OBJEXT)
-test_spawn_pipe_main_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_spawn_pipe_main_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
+test_spawn_pipe_script_SOURCES = test-spawn-pipe-script.c
+test_spawn_pipe_script_OBJECTS =  \
+       test_spawn_pipe_script-test-spawn-pipe-script.$(OBJEXT)
+test_spawn_pipe_script_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
 test_stat_SOURCES = test-stat.c
 test_stat_OBJECTS = test-stat.$(OBJEXT)
 test_stat_DEPENDENCIES = $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_stat_time_SOURCES = test-stat-time.c
+test_stat_time_OBJECTS = test-stat-time.$(OBJEXT)
+test_stat_time_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
 test_stdalign_SOURCES = test-stdalign.c
 test_stdalign_OBJECTS = test-stdalign.$(OBJEXT)
 test_stdalign_LDADD = $(LDADD)
 test_stdalign_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_stdbool_SOURCES = test-stdbool.c
 test_stdbool_OBJECTS = test-stdbool.$(OBJEXT)
 test_stdbool_LDADD = $(LDADD)
 test_stdbool_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_stdbool_c___SOURCES_DIST = test-stdbool-c++.cc \
+       test-stdbool-c++2.cc
+@ANSICXX_TRUE@am_test_stdbool_c___OBJECTS =  \
+@ANSICXX_TRUE@ test-stdbool-c++.$(OBJEXT) \
+@ANSICXX_TRUE@ test-stdbool-c++2.$(OBJEXT)
+test_stdbool_c___OBJECTS = $(am_test_stdbool_c___OBJECTS)
+test_stdbool_c___LDADD = $(LDADD)
+test_stdbool_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_stddef_SOURCES = test-stddef.c
 test_stddef_OBJECTS = test-stddef.$(OBJEXT)
 test_stddef_LDADD = $(LDADD)
 test_stddef_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_stddef_c___SOURCES_DIST = test-stddef-c++.cc \
+       test-stddef-c++2.cc
+@ANSICXX_TRUE@am_test_stddef_c___OBJECTS = test-stddef-c++.$(OBJEXT) \
+@ANSICXX_TRUE@ test-stddef-c++2.$(OBJEXT)
+test_stddef_c___OBJECTS = $(am_test_stddef_c___OBJECTS)
+test_stddef_c___LDADD = $(LDADD)
+test_stddef_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_stdint_SOURCES = test-stdint.c
 test_stdint_OBJECTS = test-stdint.$(OBJEXT)
 test_stdint_LDADD = $(LDADD)
 test_stdint_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_stdint_c___SOURCES_DIST = test-stdint-c++.cc \
+       test-stdint-c++2.cc
+@ANSICXX_TRUE@am_test_stdint_c___OBJECTS = test-stdint-c++.$(OBJEXT) \
+@ANSICXX_TRUE@ test-stdint-c++2.$(OBJEXT)
+test_stdint_c___OBJECTS = $(am_test_stdint_c___OBJECTS)
+test_stdint_c___LDADD = $(LDADD)
+test_stdint_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_stdio_SOURCES = test-stdio.c
 test_stdio_OBJECTS = test-stdio.$(OBJEXT)
 test_stdio_LDADD = $(LDADD)
 test_stdio_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_stdio_c___SOURCES_DIST = test-stdio-c++.cc test-stdio-c++2.cc
 @ANSICXX_TRUE@am_test_stdio_c___OBJECTS = test-stdio-c++.$(OBJEXT) \
 @ANSICXX_TRUE@ test-stdio-c++2.$(OBJEXT)
 test_stdio_c___OBJECTS = $(am_test_stdio_c___OBJECTS)
 @ANSICXX_TRUE@test_stdio_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 @ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
 test_stdlib_SOURCES = test-stdlib.c
 test_stdlib_OBJECTS = test-stdlib.$(OBJEXT)
 test_stdlib_LDADD = $(LDADD)
 test_stdlib_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_stdlib_c___SOURCES_DIST = test-stdlib-c++.cc \
        test-stdlib-c++2.cc
 @ANSICXX_TRUE@am_test_stdlib_c___OBJECTS = test-stdlib-c++.$(OBJEXT) \
 @ANSICXX_TRUE@ test-stdlib-c++2.$(OBJEXT)
 test_stdlib_c___OBJECTS = $(am_test_stdlib_c___OBJECTS)
 @ANSICXX_TRUE@test_stdlib_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 @ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
 test_strchrnul_SOURCES = test-strchrnul.c
 test_strchrnul_OBJECTS = test-strchrnul.$(OBJEXT)
 test_strchrnul_LDADD = $(LDADD)
 test_strchrnul_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_strerror_SOURCES = test-strerror.c
 test_strerror_OBJECTS = test-strerror.$(OBJEXT)
 test_strerror_LDADD = $(LDADD)
 test_strerror_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_strerror_r_SOURCES = test-strerror_r.c
+test_strerror_r_OBJECTS = test-strerror_r.$(OBJEXT)
+test_strerror_r_LDADD = $(LDADD)
+test_strerror_r_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_striconv_SOURCES = test-striconv.c
+test_striconv_OBJECTS = test-striconv.$(OBJEXT)
+test_striconv_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_string_SOURCES = test-string.c
 test_string_OBJECTS = test-string.$(OBJEXT)
 test_string_LDADD = $(LDADD)
 test_string_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_string_c___SOURCES_DIST = test-string-c++.cc \
        test-string-c++2.cc
 @ANSICXX_TRUE@am_test_string_c___OBJECTS = test-string-c++.$(OBJEXT) \
 @ANSICXX_TRUE@ test-string-c++2.$(OBJEXT)
 test_string_c___OBJECTS = $(am_test_string_c___OBJECTS)
 @ANSICXX_TRUE@test_string_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
-@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_strnlen_SOURCES = test-strnlen.c
 test_strnlen_OBJECTS = test-strnlen.$(OBJEXT)
 test_strnlen_LDADD = $(LDADD)
 test_strnlen_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_strsignal_SOURCES = test-strsignal.c
 test_strsignal_OBJECTS = test-strsignal.$(OBJEXT)
 test_strsignal_DEPENDENCIES = $(am__DEPENDENCIES_2) \
@@ -1143,109 +1788,189 @@ test_strstr_SOURCES = test-strstr.c
 test_strstr_OBJECTS = test-strstr.$(OBJEXT)
 test_strstr_LDADD = $(LDADD)
 test_strstr_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_strtod_SOURCES = test-strtod.c
 test_strtod_OBJECTS = test-strtod.$(OBJEXT)
 test_strtod_LDADD = $(LDADD)
 test_strtod_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_strtod1_SOURCES = test-strtod1.c
+test_strtod1_OBJECTS = test-strtod1.$(OBJEXT)
+test_strtod1_DEPENDENCIES = $(am__DEPENDENCIES_2) \
        $(am__DEPENDENCIES_1)
 test_symlink_SOURCES = test-symlink.c
 test_symlink_OBJECTS = test-symlink.$(OBJEXT)
 test_symlink_LDADD = $(LDADD)
 test_symlink_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_sys_ioctl_SOURCES = test-sys_ioctl.c
+test_sys_ioctl_OBJECTS = test-sys_ioctl.$(OBJEXT)
+test_sys_ioctl_LDADD = $(LDADD)
+test_sys_ioctl_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_sys_ioctl_c___SOURCES_DIST = test-sys_ioctl-c++.cc
+@ANSICXX_TRUE@am_test_sys_ioctl_c___OBJECTS =  \
+@ANSICXX_TRUE@ test-sys_ioctl-c++.$(OBJEXT)
+test_sys_ioctl_c___OBJECTS = $(am_test_sys_ioctl_c___OBJECTS)
+@ANSICXX_TRUE@test_sys_ioctl_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
+test_sys_random_SOURCES = test-sys_random.c
+test_sys_random_OBJECTS = test-sys_random.$(OBJEXT)
+test_sys_random_LDADD = $(LDADD)
+test_sys_random_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_sys_random_c___SOURCES_DIST = test-sys_random-c++.cc
+@ANSICXX_TRUE@am_test_sys_random_c___OBJECTS =  \
+@ANSICXX_TRUE@ test-sys_random-c++.$(OBJEXT)
+test_sys_random_c___OBJECTS = $(am_test_sys_random_c___OBJECTS)
+@ANSICXX_TRUE@test_sys_random_c___DEPENDENCIES =  \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1)
+test_sys_select_SOURCES = test-sys_select.c
+test_sys_select_OBJECTS = test-sys_select.$(OBJEXT)
+test_sys_select_LDADD = $(LDADD)
+test_sys_select_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_sys_select_c___SOURCES_DIST = test-sys_select-c++.cc
+@ANSICXX_TRUE@am_test_sys_select_c___OBJECTS =  \
+@ANSICXX_TRUE@ test-sys_select-c++.$(OBJEXT)
+test_sys_select_c___OBJECTS = $(am_test_sys_select_c___OBJECTS)
+@ANSICXX_TRUE@test_sys_select_c___DEPENDENCIES =  \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_sys_socket_SOURCES = test-sys_socket.c
+test_sys_socket_OBJECTS = test-sys_socket.$(OBJEXT)
+test_sys_socket_LDADD = $(LDADD)
+test_sys_socket_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_sys_socket_c___SOURCES_DIST = test-sys_socket-c++.cc
+@ANSICXX_TRUE@am_test_sys_socket_c___OBJECTS =  \
+@ANSICXX_TRUE@ test-sys_socket-c++.$(OBJEXT)
+test_sys_socket_c___OBJECTS = $(am_test_sys_socket_c___OBJECTS)
+@ANSICXX_TRUE@test_sys_socket_c___DEPENDENCIES =  \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_sys_stat_SOURCES = test-sys_stat.c
 test_sys_stat_OBJECTS = test-sys_stat.$(OBJEXT)
 test_sys_stat_LDADD = $(LDADD)
 test_sys_stat_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_sys_stat_c___SOURCES_DIST = test-sys_stat-c++.cc
 @ANSICXX_TRUE@am_test_sys_stat_c___OBJECTS =  \
 @ANSICXX_TRUE@ test-sys_stat-c++.$(OBJEXT)
 test_sys_stat_c___OBJECTS = $(am_test_sys_stat_c___OBJECTS)
 @ANSICXX_TRUE@test_sys_stat_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
-@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_sys_time_SOURCES = test-sys_time.c
 test_sys_time_OBJECTS = test-sys_time.$(OBJEXT)
 test_sys_time_LDADD = $(LDADD)
 test_sys_time_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_sys_time_c___SOURCES_DIST = test-sys_time-c++.cc
 @ANSICXX_TRUE@am_test_sys_time_c___OBJECTS =  \
 @ANSICXX_TRUE@ test-sys_time-c++.$(OBJEXT)
 test_sys_time_c___OBJECTS = $(am_test_sys_time_c___OBJECTS)
 @ANSICXX_TRUE@test_sys_time_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
-@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
 test_sys_types_SOURCES = test-sys_types.c
 test_sys_types_OBJECTS = test-sys_types.$(OBJEXT)
 test_sys_types_LDADD = $(LDADD)
 test_sys_types_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_sys_types_c___SOURCES_DIST = test-sys_types-c++.cc
 @ANSICXX_TRUE@am_test_sys_types_c___OBJECTS =  \
 @ANSICXX_TRUE@ test-sys_types-c++.$(OBJEXT)
 test_sys_types_c___OBJECTS = $(am_test_sys_types_c___OBJECTS)
 test_sys_types_c___LDADD = $(LDADD)
 test_sys_types_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_sys_uio_SOURCES = test-sys_uio.c
+test_sys_uio_OBJECTS = test-sys_uio.$(OBJEXT)
+test_sys_uio_LDADD = $(LDADD)
+test_sys_uio_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_sys_wait_SOURCES = test-sys_wait.c
 test_sys_wait_OBJECTS = test-sys_wait.$(OBJEXT)
 test_sys_wait_LDADD = $(LDADD)
 test_sys_wait_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_sys_wait_c___SOURCES_DIST = test-sys_wait-c++.cc
 @ANSICXX_TRUE@am_test_sys_wait_c___OBJECTS =  \
 @ANSICXX_TRUE@ test-sys_wait-c++.$(OBJEXT)
 test_sys_wait_c___OBJECTS = $(am_test_sys_wait_c___OBJECTS)
 test_sys_wait_c___LDADD = $(LDADD)
 test_sys_wait_c___DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_thread_create_SOURCES = test-thread_create.c
+test_thread_create_OBJECTS = test-thread_create.$(OBJEXT)
+test_thread_create_DEPENDENCIES = $(am__DEPENDENCIES_2)
+test_thread_self_SOURCES = test-thread_self.c
+test_thread_self_OBJECTS = test-thread_self.$(OBJEXT)
+test_thread_self_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_time_SOURCES = test-time.c
 test_time_OBJECTS = test-time.$(OBJEXT)
 test_time_LDADD = $(LDADD)
 test_time_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_time_c___SOURCES_DIST = test-time-c++.cc test-time-c++2.cc
 @ANSICXX_TRUE@am_test_time_c___OBJECTS = test-time-c++.$(OBJEXT) \
 @ANSICXX_TRUE@ test-time-c++2.$(OBJEXT)
 test_time_c___OBJECTS = $(am_test_time_c___OBJECTS)
 @ANSICXX_TRUE@test_time_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
-@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_test_u8_mbtoucr_OBJECTS = unistr/test-u8-mbtoucr.$(OBJEXT)
+test_u8_mbtoucr_OBJECTS = $(am_test_u8_mbtoucr_OBJECTS)
+test_u8_mbtoucr_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_test_u8_uctomb_OBJECTS = unistr/test-u8-uctomb.$(OBJEXT)
+test_u8_uctomb_OBJECTS = $(am_test_u8_uctomb_OBJECTS)
+test_u8_uctomb_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_test_uc_width_OBJECTS = uniwidth/test-uc_width.$(OBJEXT)
+test_uc_width_OBJECTS = $(am_test_uc_width_OBJECTS)
+test_uc_width_DEPENDENCIES = $(am__DEPENDENCIES_2)
+am_test_uc_width2_OBJECTS = uniwidth/test-uc_width2.$(OBJEXT)
+test_uc_width2_OBJECTS = $(am_test_uc_width2_OBJECTS)
+test_uc_width2_DEPENDENCIES = $(am__DEPENDENCIES_2)
 test_unistd_SOURCES = test-unistd.c
 test_unistd_OBJECTS = test-unistd.$(OBJEXT)
 test_unistd_LDADD = $(LDADD)
 test_unistd_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 am__test_unistd_c___SOURCES_DIST = test-unistd-c++.cc
 @ANSICXX_TRUE@am_test_unistd_c___OBJECTS = test-unistd-c++.$(OBJEXT)
 test_unistd_c___OBJECTS = $(am_test_unistd_c___OBJECTS)
 @ANSICXX_TRUE@test_unistd_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 @ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
 test_unsetenv_SOURCES = test-unsetenv.c
 test_unsetenv_OBJECTS = test-unsetenv.$(OBJEXT)
 test_unsetenv_LDADD = $(LDADD)
 test_unsetenv_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_vasnprintf_SOURCES = test-vasnprintf.c
 test_vasnprintf_OBJECTS = test-vasnprintf.$(OBJEXT)
 test_vasnprintf_LDADD = $(LDADD)
 test_vasnprintf_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_vasprintf_SOURCES = test-vasprintf.c
 test_vasprintf_OBJECTS = test-vasprintf.$(OBJEXT)
 test_vasprintf_LDADD = $(LDADD)
 test_vasprintf_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_vasprintf_posix_SOURCES = test-vasprintf-posix.c
 test_vasprintf_posix_OBJECTS = test-vasprintf-posix.$(OBJEXT)
 test_vasprintf_posix_LDADD = $(LDADD)
 test_vasprintf_posix_DEPENDENCIES = libtests.a ../lib/libm4.a \
-       libtests.a $(am__DEPENDENCIES_1)
+       libtests.a ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_verify_SOURCES = test-verify.c
 test_verify_OBJECTS = test-verify.$(OBJEXT)
 test_verify_LDADD = $(LDADD)
 test_verify_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+test_verify_try_SOURCES = test-verify-try.c
+test_verify_try_OBJECTS = test-verify-try.$(OBJEXT)
+test_verify_try_LDADD = $(LDADD)
+test_verify_try_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_version_etc_SOURCES = test-version-etc.c
 test_version_etc_OBJECTS = test-version-etc.$(OBJEXT)
 test_version_etc_DEPENDENCIES = $(am__DEPENDENCIES_2)
@@ -1253,38 +1978,47 @@ test_wchar_SOURCES = test-wchar.c
 test_wchar_OBJECTS = test-wchar.$(OBJEXT)
 test_wchar_LDADD = $(LDADD)
 test_wchar_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
-am__test_wchar_c___SOURCES_DIST = test-wchar-c++.cc
-@ANSICXX_TRUE@am_test_wchar_c___OBJECTS = test-wchar-c++.$(OBJEXT)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_wchar_c___SOURCES_DIST = test-wchar-c++.cc test-wchar-c++2.cc \
+       test-wchar-c++3.cc
+@ANSICXX_TRUE@am_test_wchar_c___OBJECTS = test-wchar-c++.$(OBJEXT) \
+@ANSICXX_TRUE@ test-wchar-c++2.$(OBJEXT) \
+@ANSICXX_TRUE@ test-wchar-c++3.$(OBJEXT)
 test_wchar_c___OBJECTS = $(am_test_wchar_c___OBJECTS)
 @ANSICXX_TRUE@test_wchar_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
 @ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
 test_wcrtomb_SOURCES = test-wcrtomb.c
 test_wcrtomb_OBJECTS = test-wcrtomb.$(OBJEXT)
-test_wcrtomb_LDADD = $(LDADD)
-test_wcrtomb_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
+test_wcrtomb_DEPENDENCIES = $(am__DEPENDENCIES_2) \
        $(am__DEPENDENCIES_1)
 test_wcrtomb_w32_SOURCES = test-wcrtomb-w32.c
 test_wcrtomb_w32_OBJECTS = test-wcrtomb-w32.$(OBJEXT)
 test_wcrtomb_w32_LDADD = $(LDADD)
 test_wcrtomb_w32_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_wctype_h_SOURCES = test-wctype-h.c
 test_wctype_h_OBJECTS = test-wctype-h.$(OBJEXT)
 test_wctype_h_LDADD = $(LDADD)
 test_wctype_h_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
-am__test_wctype_h_c___SOURCES_DIST = test-wctype-h-c++.cc
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
+am__test_wctype_h_c___SOURCES_DIST = test-wctype-h-c++.cc \
+       test-wctype-h-c++2.cc
 @ANSICXX_TRUE@am_test_wctype_h_c___OBJECTS =  \
-@ANSICXX_TRUE@ test-wctype-h-c++.$(OBJEXT)
+@ANSICXX_TRUE@ test-wctype-h-c++.$(OBJEXT) \
+@ANSICXX_TRUE@ test-wctype-h-c++2.$(OBJEXT)
 test_wctype_h_c___OBJECTS = $(am_test_wctype_h_c___OBJECTS)
 @ANSICXX_TRUE@test_wctype_h_c___DEPENDENCIES = $(am__DEPENDENCIES_2) \
-@ANSICXX_TRUE@ $(am__DEPENDENCIES_1)
+@ANSICXX_TRUE@ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+test_wcwidth_SOURCES = test-wcwidth.c
+test_wcwidth_OBJECTS = test-wcwidth.$(OBJEXT)
+test_wcwidth_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+       $(am__DEPENDENCIES_1)
 test_write_SOURCES = test-write.c
 test_write_OBJECTS = test-write.$(OBJEXT)
 test_write_LDADD = $(LDADD)
 test_write_DEPENDENCIES = libtests.a ../lib/libm4.a libtests.a \
-       $(am__DEPENDENCIES_1)
+       ../lib/libm4.a libtests.a $(am__DEPENDENCIES_1)
 test_xalloc_die_SOURCES = test-xalloc-die.c
 test_xalloc_die_OBJECTS = test-xalloc-die.$(OBJEXT)
 test_xalloc_die_DEPENDENCIES = $(am__DEPENDENCIES_2)
@@ -1305,8 +2039,215 @@ am__v_at_0 = @
 am__v_at_1 = 
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/lib
 depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp
-am__depfiles_maybe = depfiles
+am__maybe_remake_depfiles = depfiles
+am__depfiles_remade = ./$(DEPDIR)/accept.Po ./$(DEPDIR)/alloca.Po \
+       ./$(DEPDIR)/anytostr.Po ./$(DEPDIR)/bind.Po \
+       ./$(DEPDIR)/connect.Po ./$(DEPDIR)/creat.Po \
+       ./$(DEPDIR)/explicit_bzero.Po ./$(DEPDIR)/fdopen.Po \
+       ./$(DEPDIR)/findprog.Po ./$(DEPDIR)/freopen.Po \
+       ./$(DEPDIR)/ftruncate.Po ./$(DEPDIR)/gettimeofday.Po \
+       ./$(DEPDIR)/gl_array_list.Po ./$(DEPDIR)/gl_array_oset.Po \
+       ./$(DEPDIR)/imaxtostr.Po ./$(DEPDIR)/inet_pton.Po \
+       ./$(DEPDIR)/inttostr.Po ./$(DEPDIR)/ioctl.Po \
+       ./$(DEPDIR)/isblank.Po ./$(DEPDIR)/link.Po \
+       ./$(DEPDIR)/listen.Po ./$(DEPDIR)/locale.Po \
+       ./$(DEPDIR)/nanosleep.Po ./$(DEPDIR)/offtostr.Po \
+       ./$(DEPDIR)/perror.Po ./$(DEPDIR)/pthread-thread.Po \
+       ./$(DEPDIR)/pthread_sigmask.Po ./$(DEPDIR)/putenv.Po \
+       ./$(DEPDIR)/randomd.Po ./$(DEPDIR)/randoml.Po \
+       ./$(DEPDIR)/read-file.Po ./$(DEPDIR)/sched_yield.Po \
+       ./$(DEPDIR)/select.Po ./$(DEPDIR)/setenv.Po \
+       ./$(DEPDIR)/setsockopt.Po ./$(DEPDIR)/sleep.Po \
+       ./$(DEPDIR)/socket.Po ./$(DEPDIR)/sockets.Po \
+       ./$(DEPDIR)/strerror_r.Po ./$(DEPDIR)/symlink.Po \
+       ./$(DEPDIR)/sys_socket.Po ./$(DEPDIR)/test-accept.Po \
+       ./$(DEPDIR)/test-access.Po ./$(DEPDIR)/test-alignof.Po \
+       ./$(DEPDIR)/test-alloca-opt.Po \
+       ./$(DEPDIR)/test-arpa_inet-c++.Po \
+       ./$(DEPDIR)/test-arpa_inet.Po ./$(DEPDIR)/test-array_list.Po \
+       ./$(DEPDIR)/test-array_oset.Po \
+       ./$(DEPDIR)/test-asyncsafe-spin1.Po \
+       ./$(DEPDIR)/test-asyncsafe-spin2.Po \
+       ./$(DEPDIR)/test-avltree_oset.Po ./$(DEPDIR)/test-binary-io.Po \
+       ./$(DEPDIR)/test-bind.Po ./$(DEPDIR)/test-bitrotate.Po \
+       ./$(DEPDIR)/test-btowc.Po ./$(DEPDIR)/test-c-ctype.Po \
+       ./$(DEPDIR)/test-c-stack.Po ./$(DEPDIR)/test-c-strcasecmp.Po \
+       ./$(DEPDIR)/test-c-strncasecmp.Po \
+       ./$(DEPDIR)/test-calloc-gnu.Po \
+       ./$(DEPDIR)/test-canonicalize-lgpl.Po \
+       ./$(DEPDIR)/test-canonicalize.Po ./$(DEPDIR)/test-chdir.Po \
+       ./$(DEPDIR)/test-cloexec.Po ./$(DEPDIR)/test-close.Po \
+       ./$(DEPDIR)/test-closein.Po ./$(DEPDIR)/test-connect.Po \
+       ./$(DEPDIR)/test-creat.Po ./$(DEPDIR)/test-ctype-c++.Po \
+       ./$(DEPDIR)/test-ctype-c++2.Po ./$(DEPDIR)/test-ctype.Po \
+       ./$(DEPDIR)/test-dirent-c++.Po ./$(DEPDIR)/test-dirent.Po \
+       ./$(DEPDIR)/test-dirname.Po ./$(DEPDIR)/test-dup-safer.Po \
+       ./$(DEPDIR)/test-dup.Po ./$(DEPDIR)/test-dup2.Po \
+       ./$(DEPDIR)/test-dynarray.Po ./$(DEPDIR)/test-environ.Po \
+       ./$(DEPDIR)/test-errno-c++.Po ./$(DEPDIR)/test-errno-c++2.Po \
+       ./$(DEPDIR)/test-errno.Po ./$(DEPDIR)/test-execute-child.Po \
+       ./$(DEPDIR)/test-execute-main.Po \
+       ./$(DEPDIR)/test-explicit_bzero.Po ./$(DEPDIR)/test-fchdir.Po \
+       ./$(DEPDIR)/test-fclose.Po ./$(DEPDIR)/test-fcntl-h-c++.Po \
+       ./$(DEPDIR)/test-fcntl-h.Po ./$(DEPDIR)/test-fcntl.Po \
+       ./$(DEPDIR)/test-fdopen.Po ./$(DEPDIR)/test-fdopendir.Po \
+       ./$(DEPDIR)/test-fflush.Po ./$(DEPDIR)/test-fflush2.Po \
+       ./$(DEPDIR)/test-fgetc.Po ./$(DEPDIR)/test-filenamecat.Po \
+       ./$(DEPDIR)/test-float-c++.Po ./$(DEPDIR)/test-float-c++2.Po \
+       ./$(DEPDIR)/test-float.Po ./$(DEPDIR)/test-fopen-gnu.Po \
+       ./$(DEPDIR)/test-fopen-safer.Po ./$(DEPDIR)/test-fopen.Po \
+       ./$(DEPDIR)/test-fpending.Po ./$(DEPDIR)/test-fpurge.Po \
+       ./$(DEPDIR)/test-fputc.Po ./$(DEPDIR)/test-fread.Po \
+       ./$(DEPDIR)/test-freadahead.Po ./$(DEPDIR)/test-freading.Po \
+       ./$(DEPDIR)/test-free.Po ./$(DEPDIR)/test-freopen.Po \
+       ./$(DEPDIR)/test-frexp.Po ./$(DEPDIR)/test-frexpl.Po \
+       ./$(DEPDIR)/test-fseek.Po ./$(DEPDIR)/test-fseeko.Po \
+       ./$(DEPDIR)/test-fseeko3.Po ./$(DEPDIR)/test-fseeko4.Po \
+       ./$(DEPDIR)/test-fstat.Po ./$(DEPDIR)/test-fstatat.Po \
+       ./$(DEPDIR)/test-ftell.Po ./$(DEPDIR)/test-ftell3.Po \
+       ./$(DEPDIR)/test-ftello.Po ./$(DEPDIR)/test-ftello3.Po \
+       ./$(DEPDIR)/test-ftello4.Po ./$(DEPDIR)/test-ftruncate.Po \
+       ./$(DEPDIR)/test-fwrite.Po ./$(DEPDIR)/test-getcwd-lgpl.Po \
+       ./$(DEPDIR)/test-getcwd.Po ./$(DEPDIR)/test-getdtablesize.Po \
+       ./$(DEPDIR)/test-getopt-gnu.Po ./$(DEPDIR)/test-getprogname.Po \
+       ./$(DEPDIR)/test-getrandom.Po ./$(DEPDIR)/test-gettimeofday.Po \
+       ./$(DEPDIR)/test-hard-locale.Po ./$(DEPDIR)/test-hash.Po \
+       ./$(DEPDIR)/test-iconv-h-c++.Po ./$(DEPDIR)/test-iconv-h.Po \
+       ./$(DEPDIR)/test-iconv.Po ./$(DEPDIR)/test-ignore-value.Po \
+       ./$(DEPDIR)/test-inet_pton.Po ./$(DEPDIR)/test-intprops.Po \
+       ./$(DEPDIR)/test-inttostr.Po ./$(DEPDIR)/test-inttypes-c++.Po \
+       ./$(DEPDIR)/test-inttypes-c++2.Po ./$(DEPDIR)/test-inttypes.Po \
+       ./$(DEPDIR)/test-ioctl.Po ./$(DEPDIR)/test-isblank.Po \
+       ./$(DEPDIR)/test-isnand-nolibm.Po \
+       ./$(DEPDIR)/test-isnanf-nolibm.Po \
+       ./$(DEPDIR)/test-isnanl-nolibm.Po ./$(DEPDIR)/test-iswblank.Po \
+       ./$(DEPDIR)/test-iswdigit.Po ./$(DEPDIR)/test-iswxdigit.Po \
+       ./$(DEPDIR)/test-langinfo-c++.Po ./$(DEPDIR)/test-langinfo.Po \
+       ./$(DEPDIR)/test-limits-h-c++.Po \
+       ./$(DEPDIR)/test-limits-h-c++2.Po ./$(DEPDIR)/test-limits-h.Po \
+       ./$(DEPDIR)/test-link.Po ./$(DEPDIR)/test-linked_list.Po \
+       ./$(DEPDIR)/test-linkedhash_list.Po ./$(DEPDIR)/test-listen.Po \
+       ./$(DEPDIR)/test-localcharset.Po \
+       ./$(DEPDIR)/test-locale-c++.Po ./$(DEPDIR)/test-locale-c++2.Po \
+       ./$(DEPDIR)/test-locale.Po ./$(DEPDIR)/test-localeconv.Po \
+       ./$(DEPDIR)/test-localename.Po ./$(DEPDIR)/test-lseek.Po \
+       ./$(DEPDIR)/test-lstat.Po ./$(DEPDIR)/test-malloc-gnu.Po \
+       ./$(DEPDIR)/test-malloca.Po ./$(DEPDIR)/test-math-c++.Po \
+       ./$(DEPDIR)/test-math-c++2.Po ./$(DEPDIR)/test-math.Po \
+       ./$(DEPDIR)/test-mbrtowc-w32.Po ./$(DEPDIR)/test-mbrtowc.Po \
+       ./$(DEPDIR)/test-mbsinit.Po ./$(DEPDIR)/test-mbsstr1.Po \
+       ./$(DEPDIR)/test-mbsstr2.Po ./$(DEPDIR)/test-mbsstr3.Po \
+       ./$(DEPDIR)/test-memchr.Po ./$(DEPDIR)/test-memchr2.Po \
+       ./$(DEPDIR)/test-memrchr.Po ./$(DEPDIR)/test-mkdir.Po \
+       ./$(DEPDIR)/test-nanosleep.Po ./$(DEPDIR)/test-netinet_in.Po \
+       ./$(DEPDIR)/test-nl_langinfo-mt.Po \
+       ./$(DEPDIR)/test-nl_langinfo.Po ./$(DEPDIR)/test-open.Po \
+       ./$(DEPDIR)/test-openat.Po ./$(DEPDIR)/test-pathmax.Po \
+       ./$(DEPDIR)/test-perror.Po ./$(DEPDIR)/test-perror2.Po \
+       ./$(DEPDIR)/test-pipe.Po ./$(DEPDIR)/test-pipe2.Po \
+       ./$(DEPDIR)/test-posix_spawn-chdir.Po \
+       ./$(DEPDIR)/test-posix_spawn-dup2-stdin.Po \
+       ./$(DEPDIR)/test-posix_spawn-dup2-stdout.Po \
+       ./$(DEPDIR)/test-posix_spawn-inherit0.Po \
+       ./$(DEPDIR)/test-posix_spawn-inherit1.Po \
+       ./$(DEPDIR)/test-posix_spawn-open1.Po \
+       ./$(DEPDIR)/test-posix_spawn-open2.Po \
+       ./$(DEPDIR)/test-posix_spawn_file_actions_addchdir.Po \
+       ./$(DEPDIR)/test-posix_spawn_file_actions_addclose.Po \
+       ./$(DEPDIR)/test-posix_spawn_file_actions_adddup2.Po \
+       ./$(DEPDIR)/test-posix_spawn_file_actions_addopen.Po \
+       ./$(DEPDIR)/test-printf-frexp.Po \
+       ./$(DEPDIR)/test-printf-frexpl.Po \
+       ./$(DEPDIR)/test-pthread-c++.Po \
+       ./$(DEPDIR)/test-pthread-thread.Po ./$(DEPDIR)/test-pthread.Po \
+       ./$(DEPDIR)/test-pthread_sigmask1.Po \
+       ./$(DEPDIR)/test-pthread_sigmask2.Po \
+       ./$(DEPDIR)/test-quotearg-simple.Po ./$(DEPDIR)/test-raise.Po \
+       ./$(DEPDIR)/test-rawmemchr.Po ./$(DEPDIR)/test-read-file.Po \
+       ./$(DEPDIR)/test-readlink.Po ./$(DEPDIR)/test-realloc-gnu.Po \
+       ./$(DEPDIR)/test-reallocarray.Po ./$(DEPDIR)/test-regex.Po \
+       ./$(DEPDIR)/test-rename.Po ./$(DEPDIR)/test-rmdir.Po \
+       ./$(DEPDIR)/test-sched.Po ./$(DEPDIR)/test-scratch-buffer.Po \
+       ./$(DEPDIR)/test-select-fd.Po ./$(DEPDIR)/test-select-stdin.Po \
+       ./$(DEPDIR)/test-select.Po ./$(DEPDIR)/test-setenv.Po \
+       ./$(DEPDIR)/test-setlocale1.Po ./$(DEPDIR)/test-setlocale2.Po \
+       ./$(DEPDIR)/test-setlocale_null-mt-all.Po \
+       ./$(DEPDIR)/test-setlocale_null-mt-one.Po \
+       ./$(DEPDIR)/test-setlocale_null.Po \
+       ./$(DEPDIR)/test-setsockopt.Po ./$(DEPDIR)/test-sigaction.Po \
+       ./$(DEPDIR)/test-signal-h-c++.Po \
+       ./$(DEPDIR)/test-signal-h-c++2.Po ./$(DEPDIR)/test-signal-h.Po \
+       ./$(DEPDIR)/test-signbit.Po ./$(DEPDIR)/test-sigpipe.Po \
+       ./$(DEPDIR)/test-sigprocmask.Po \
+       ./$(DEPDIR)/test-sigsegv-catch-segv1.Po \
+       ./$(DEPDIR)/test-sigsegv-catch-segv2.Po \
+       ./$(DEPDIR)/test-sigsegv-catch-stackoverflow1.Po \
+       ./$(DEPDIR)/test-sigsegv-catch-stackoverflow2.Po \
+       ./$(DEPDIR)/test-sleep.Po ./$(DEPDIR)/test-snprintf.Po \
+       ./$(DEPDIR)/test-sockets.Po ./$(DEPDIR)/test-spawn-c++.Po \
+       ./$(DEPDIR)/test-spawn-pipe-child.Po \
+       ./$(DEPDIR)/test-spawn-pipe-main.Po ./$(DEPDIR)/test-spawn.Po \
+       ./$(DEPDIR)/test-stat-time.Po ./$(DEPDIR)/test-stat.Po \
+       ./$(DEPDIR)/test-stdalign.Po ./$(DEPDIR)/test-stdbool-c++.Po \
+       ./$(DEPDIR)/test-stdbool-c++2.Po ./$(DEPDIR)/test-stdbool.Po \
+       ./$(DEPDIR)/test-stddef-c++.Po ./$(DEPDIR)/test-stddef-c++2.Po \
+       ./$(DEPDIR)/test-stddef.Po ./$(DEPDIR)/test-stdint-c++.Po \
+       ./$(DEPDIR)/test-stdint-c++2.Po ./$(DEPDIR)/test-stdint.Po \
+       ./$(DEPDIR)/test-stdio-c++.Po ./$(DEPDIR)/test-stdio-c++2.Po \
+       ./$(DEPDIR)/test-stdio.Po ./$(DEPDIR)/test-stdlib-c++.Po \
+       ./$(DEPDIR)/test-stdlib-c++2.Po ./$(DEPDIR)/test-stdlib.Po \
+       ./$(DEPDIR)/test-strchrnul.Po ./$(DEPDIR)/test-strerror.Po \
+       ./$(DEPDIR)/test-strerror_r.Po ./$(DEPDIR)/test-striconv.Po \
+       ./$(DEPDIR)/test-string-c++.Po ./$(DEPDIR)/test-string-c++2.Po \
+       ./$(DEPDIR)/test-string.Po ./$(DEPDIR)/test-strnlen.Po \
+       ./$(DEPDIR)/test-strsignal.Po ./$(DEPDIR)/test-strstr.Po \
+       ./$(DEPDIR)/test-strtod.Po ./$(DEPDIR)/test-strtod1.Po \
+       ./$(DEPDIR)/test-symlink.Po ./$(DEPDIR)/test-sys_ioctl-c++.Po \
+       ./$(DEPDIR)/test-sys_ioctl.Po \
+       ./$(DEPDIR)/test-sys_random-c++.Po \
+       ./$(DEPDIR)/test-sys_random.Po \
+       ./$(DEPDIR)/test-sys_select-c++.Po \
+       ./$(DEPDIR)/test-sys_select.Po \
+       ./$(DEPDIR)/test-sys_socket-c++.Po \
+       ./$(DEPDIR)/test-sys_socket.Po \
+       ./$(DEPDIR)/test-sys_stat-c++.Po ./$(DEPDIR)/test-sys_stat.Po \
+       ./$(DEPDIR)/test-sys_time-c++.Po ./$(DEPDIR)/test-sys_time.Po \
+       ./$(DEPDIR)/test-sys_types-c++.Po \
+       ./$(DEPDIR)/test-sys_types.Po ./$(DEPDIR)/test-sys_uio.Po \
+       ./$(DEPDIR)/test-sys_wait-c++.Po ./$(DEPDIR)/test-sys_wait.Po \
+       ./$(DEPDIR)/test-thread_create.Po \
+       ./$(DEPDIR)/test-thread_self.Po ./$(DEPDIR)/test-time-c++.Po \
+       ./$(DEPDIR)/test-time-c++2.Po ./$(DEPDIR)/test-time.Po \
+       ./$(DEPDIR)/test-unistd-c++.Po ./$(DEPDIR)/test-unistd.Po \
+       ./$(DEPDIR)/test-unsetenv.Po ./$(DEPDIR)/test-vasnprintf.Po \
+       ./$(DEPDIR)/test-vasprintf-posix.Po \
+       ./$(DEPDIR)/test-vasprintf.Po ./$(DEPDIR)/test-verify-try.Po \
+       ./$(DEPDIR)/test-verify.Po ./$(DEPDIR)/test-version-etc.Po \
+       ./$(DEPDIR)/test-wchar-c++.Po ./$(DEPDIR)/test-wchar-c++2.Po \
+       ./$(DEPDIR)/test-wchar-c++3.Po ./$(DEPDIR)/test-wchar.Po \
+       ./$(DEPDIR)/test-wcrtomb-w32.Po ./$(DEPDIR)/test-wcrtomb.Po \
+       ./$(DEPDIR)/test-wctype-h-c++.Po \
+       ./$(DEPDIR)/test-wctype-h-c++2.Po ./$(DEPDIR)/test-wctype-h.Po \
+       ./$(DEPDIR)/test-wcwidth.Po ./$(DEPDIR)/test-write.Po \
+       ./$(DEPDIR)/test-xalloc-die.Po ./$(DEPDIR)/test-xvasprintf.Po \
+       ./$(DEPDIR)/test_execute_script-test-execute-script.Po \
+       ./$(DEPDIR)/test_posix_spawn_script-test-posix_spawn-script.Po \
+       ./$(DEPDIR)/test_posix_spawnp_script-test-posix_spawnp-script.Po \
+       ./$(DEPDIR)/test_spawn_pipe_script-test-spawn-pipe-script.Po \
+       ./$(DEPDIR)/uinttostr.Po ./$(DEPDIR)/umaxtostr.Po \
+       ./$(DEPDIR)/unsetenv.Po ./$(DEPDIR)/vma-iter.Po \
+       ./$(DEPDIR)/wctob.Po ./$(DEPDIR)/wctomb.Po \
+       ./$(DEPDIR)/windows-thread.Po ./$(DEPDIR)/write.Po \
+       ./$(DEPDIR)/xconcat-filename.Po glthread/$(DEPDIR)/thread.Po \
+       unistr/$(DEPDIR)/test-u8-mbtoucr.Po \
+       unistr/$(DEPDIR)/test-u8-uctomb.Po \
+       uniwidth/$(DEPDIR)/test-uc_width.Po \
+       uniwidth/$(DEPDIR)/test-uc_width2.Po
 am__mv = mv -f
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 = 
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 AM_V_CC = $(am__v_CC_@AM_V@)
@@ -1333,119 +2274,214 @@ am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@)
 am__v_CXXLD_0 = @echo "  CXXLD   " $@;
 am__v_CXXLD_1 = 
 SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \
-       test-alignof.c test-alloca-opt.c test-array_list.c \
-       test-array_oset.c test-avltree_oset.c test-binary-io.c \
-       test-btowc.c test-c-ctype.c test-c-stack.c test-c-strcasecmp.c \
-       test-c-strncasecmp.c test-canonicalize-lgpl.c test-chdir.c \
-       test-cloexec.c test-close.c test-closein.c test-ctype.c \
-       test-dirent.c $(test_dirent_c___SOURCES) test-dirname.c \
-       test-dup.c test-dup-safer.c test-dup2.c test-environ.c \
-       test-errno.c test-fclose.c test-fcntl.c test-fcntl-h.c \
-       $(test_fcntl_h_c___SOURCES) test-fdopen.c test-fflush.c \
-       test-fflush2.c test-fgetc.c test-filenamecat.c test-float.c \
-       test-fopen.c test-fopen-safer.c test-fpending.c test-fpurge.c \
-       test-fputc.c test-fread.c test-freadahead.c test-freading.c \
+       $(current_locale_SOURCES) test-accept.c test-access.c \
+       test-alignof.c test-alloca-opt.c test-arpa_inet.c \
+       $(test_arpa_inet_c___SOURCES) test-array_list.c \
+       test-array_oset.c test-asyncsafe-spin1.c \
+       test-asyncsafe-spin2.c test-avltree_oset.c test-binary-io.c \
+       test-bind.c test-bitrotate.c test-btowc.c test-c-ctype.c \
+       test-c-stack.c test-c-strcasecmp.c test-c-strncasecmp.c \
+       test-calloc-gnu.c test-canonicalize.c test-canonicalize-lgpl.c \
+       test-chdir.c test-cloexec.c test-close.c test-closein.c \
+       test-connect.c test-creat.c test-ctype.c \
+       $(test_ctype_c___SOURCES) test-dirent.c \
+       $(test_dirent_c___SOURCES) test-dirname.c test-dup.c \
+       test-dup-safer.c test-dup2.c test-dynarray.c test-environ.c \
+       test-errno.c $(test_errno_c___SOURCES) test-execute-child.c \
+       test-execute-main.c test-execute-script.c \
+       test-explicit_bzero.c test-fchdir.c test-fclose.c test-fcntl.c \
+       test-fcntl-h.c $(test_fcntl_h_c___SOURCES) test-fdopen.c \
+       test-fdopendir.c test-fflush.c test-fflush2.c test-fgetc.c \
+       test-filenamecat.c test-float.c $(test_float_c___SOURCES) \
+       test-fopen.c test-fopen-gnu.c test-fopen-safer.c \
+       test-fpending.c test-fpurge.c test-fputc.c test-fread.c \
+       test-freadahead.c test-freading.c test-free.c test-freopen.c \
        $(test_frexp_nolibm_SOURCES) $(test_frexpl_nolibm_SOURCES) \
        test-fseek.c test-fseeko.c test-fseeko3.c test-fseeko4.c \
-       test-fstat.c test-ftell.c test-ftell3.c test-ftello.c \
-       test-ftello3.c test-ftello4.c test-fwrite.c test-getcwd-lgpl.c \
-       test-getdtablesize.c test-getopt-gnu.c test-getopt-posix.c \
-       test-getprogname.c test-gettimeofday.c test-ignore-value.c \
-       test-intprops.c test-inttypes.c test-isblank.c \
-       test-isnand-nolibm.c test-isnanf-nolibm.c test-isnanl-nolibm.c \
-       test-langinfo.c $(test_langinfo_c___SOURCES) test-limits-h.c \
-       test-link.c test-linkedhash_list.c test-locale.c \
-       $(test_locale_c___SOURCES) test-localeconv.c test-localename.c \
-       test-lseek.c test-lstat.c test-malloca.c test-math.c \
+       test-fstat.c test-fstatat.c test-ftell.c test-ftell3.c \
+       test-ftello.c test-ftello3.c test-ftello4.c test-ftruncate.c \
+       test-fwrite.c test-getcwd.c test-getcwd-lgpl.c \
+       test-getdtablesize.c test-getopt-gnu.c test-getprogname.c \
+       test-getrandom.c test-gettimeofday.c test-hard-locale.c \
+       test-hash.c test-iconv.c test-iconv-h.c \
+       $(test_iconv_h_c___SOURCES) test-ignore-value.c \
+       test-inet_pton.c test-intprops.c test-inttostr.c \
+       test-inttypes.c $(test_inttypes_c___SOURCES) test-ioctl.c \
+       test-isblank.c test-isnand-nolibm.c test-isnanf-nolibm.c \
+       test-isnanl-nolibm.c test-iswblank.c test-iswdigit.c \
+       test-iswxdigit.c test-langinfo.c $(test_langinfo_c___SOURCES) \
+       test-limits-h.c $(test_limits_h_c___SOURCES) test-link.c \
+       test-linked_list.c test-linkedhash_list.c test-listen.c \
+       test-localcharset.c test-locale.c $(test_locale_c___SOURCES) \
+       test-localeconv.c test-localename.c test-lseek.c test-lstat.c \
+       test-malloc-gnu.c test-malloca.c test-math.c \
        $(test_math_c___SOURCES) test-mbrtowc.c test-mbrtowc-w32.c \
-       test-mbsinit.c test-memchr.c test-memchr2.c test-nl_langinfo.c \
-       test-open.c test-pathmax.c test-pipe2.c test-posix_spawn1.c \
-       test-posix_spawn2.c test-posix_spawn_file_actions_addclose.c \
+       test-mbsinit.c test-mbsstr1.c test-mbsstr2.c test-mbsstr3.c \
+       test-memchr.c test-memchr2.c test-memrchr.c test-mkdir.c \
+       test-nanosleep.c test-netinet_in.c test-nl_langinfo.c \
+       test-nl_langinfo-mt.c test-open.c test-openat.c test-pathmax.c \
+       test-perror.c test-perror2.c test-pipe.c test-pipe2.c \
+       test-posix_spawn-chdir.c test-posix_spawn-dup2-stdin.c \
+       test-posix_spawn-dup2-stdout.c test-posix_spawn-inherit0.c \
+       test-posix_spawn-inherit1.c test-posix_spawn-open1.c \
+       test-posix_spawn-open2.c test-posix_spawn-script.c \
+       test-posix_spawn_file_actions_addchdir.c \
+       test-posix_spawn_file_actions_addclose.c \
        test-posix_spawn_file_actions_adddup2.c \
-       test-posix_spawn_file_actions_addopen.c test-printf-frexp.c \
-       test-printf-frexpl.c test-quotearg-simple.c test-raise.c \
-       test-rawmemchr.c test-readlink.c test-regex.c test-rename.c \
-       test-rmdir.c test-sched.c test-setenv.c test-setlocale1.c \
-       test-setlocale2.c test-sigaction.c test-signal-h.c \
+       test-posix_spawn_file_actions_addopen.c \
+       test-posix_spawnp-script.c test-printf-frexp.c \
+       test-printf-frexpl.c test-pthread.c \
+       $(test_pthread_c___SOURCES) test-pthread-thread.c \
+       test-pthread_sigmask1.c test-pthread_sigmask2.c \
+       test-quotearg-simple.c test-raise.c test-rawmemchr.c \
+       test-read-file.c test-readlink.c test-realloc-gnu.c \
+       test-reallocarray.c test-regex.c test-rename.c test-rmdir.c \
+       test-sched.c $(test_scratch_buffer_SOURCES) test-select.c \
+       test-select-fd.c test-select-stdin.c test-setenv.c \
+       test-setlocale1.c test-setlocale2.c test-setlocale_null.c \
+       test-setlocale_null-mt-all.c test-setlocale_null-mt-one.c \
+       test-setsockopt.c test-sigaction.c test-signal-h.c \
        $(test_signal_h_c___SOURCES) test-signbit.c test-sigpipe.c \
-       test-sigprocmask.c test-sleep.c test-snprintf.c test-spawn.c \
+       test-sigprocmask.c test-sigsegv-catch-segv1.c \
+       test-sigsegv-catch-segv2.c test-sigsegv-catch-stackoverflow1.c \
+       test-sigsegv-catch-stackoverflow2.c test-sleep.c \
+       test-snprintf.c test-sockets.c test-spawn.c \
        $(test_spawn_c___SOURCES) test-spawn-pipe-child.c \
-       test-spawn-pipe-main.c test-stat.c test-stdalign.c \
-       test-stdbool.c test-stddef.c test-stdint.c test-stdio.c \
+       test-spawn-pipe-main.c test-spawn-pipe-script.c test-stat.c \
+       test-stat-time.c test-stdalign.c test-stdbool.c \
+       $(test_stdbool_c___SOURCES) test-stddef.c \
+       $(test_stddef_c___SOURCES) test-stdint.c \
+       $(test_stdint_c___SOURCES) test-stdio.c \
        $(test_stdio_c___SOURCES) test-stdlib.c \
        $(test_stdlib_c___SOURCES) test-strchrnul.c test-strerror.c \
-       test-string.c $(test_string_c___SOURCES) test-strnlen.c \
-       test-strsignal.c test-strstr.c test-strtod.c test-symlink.c \
+       test-strerror_r.c test-striconv.c test-string.c \
+       $(test_string_c___SOURCES) test-strnlen.c test-strsignal.c \
+       test-strstr.c test-strtod.c test-strtod1.c test-symlink.c \
+       test-sys_ioctl.c $(test_sys_ioctl_c___SOURCES) \
+       test-sys_random.c $(test_sys_random_c___SOURCES) \
+       test-sys_select.c $(test_sys_select_c___SOURCES) \
+       test-sys_socket.c $(test_sys_socket_c___SOURCES) \
        test-sys_stat.c $(test_sys_stat_c___SOURCES) test-sys_time.c \
        $(test_sys_time_c___SOURCES) test-sys_types.c \
-       $(test_sys_types_c___SOURCES) test-sys_wait.c \
-       $(test_sys_wait_c___SOURCES) test-time.c \
-       $(test_time_c___SOURCES) test-unistd.c \
-       $(test_unistd_c___SOURCES) test-unsetenv.c test-vasnprintf.c \
-       test-vasprintf.c test-vasprintf-posix.c test-verify.c \
-       test-version-etc.c test-wchar.c $(test_wchar_c___SOURCES) \
-       test-wcrtomb.c test-wcrtomb-w32.c test-wctype-h.c \
-       $(test_wctype_h_c___SOURCES) test-write.c test-xalloc-die.c \
-       test-xvasprintf.c
+       $(test_sys_types_c___SOURCES) test-sys_uio.c test-sys_wait.c \
+       $(test_sys_wait_c___SOURCES) test-thread_create.c \
+       test-thread_self.c test-time.c $(test_time_c___SOURCES) \
+       $(test_u8_mbtoucr_SOURCES) $(test_u8_uctomb_SOURCES) \
+       $(test_uc_width_SOURCES) $(test_uc_width2_SOURCES) \
+       test-unistd.c $(test_unistd_c___SOURCES) test-unsetenv.c \
+       test-vasnprintf.c test-vasprintf.c test-vasprintf-posix.c \
+       test-verify.c test-verify-try.c test-version-etc.c \
+       test-wchar.c $(test_wchar_c___SOURCES) test-wcrtomb.c \
+       test-wcrtomb-w32.c test-wctype-h.c \
+       $(test_wctype_h_c___SOURCES) test-wcwidth.c test-write.c \
+       test-xalloc-die.c test-xvasprintf.c
 DIST_SOURCES = $(libtests_a_SOURCES) $(EXTRA_libtests_a_SOURCES) \
-       test-alignof.c test-alloca-opt.c test-array_list.c \
-       test-array_oset.c test-avltree_oset.c test-binary-io.c \
-       test-btowc.c test-c-ctype.c test-c-stack.c test-c-strcasecmp.c \
-       test-c-strncasecmp.c test-canonicalize-lgpl.c test-chdir.c \
-       test-cloexec.c test-close.c test-closein.c test-ctype.c \
-       test-dirent.c $(am__test_dirent_c___SOURCES_DIST) \
-       test-dirname.c test-dup.c test-dup-safer.c test-dup2.c \
-       test-environ.c test-errno.c test-fclose.c test-fcntl.c \
+       $(current_locale_SOURCES) test-accept.c test-access.c \
+       test-alignof.c test-alloca-opt.c test-arpa_inet.c \
+       $(am__test_arpa_inet_c___SOURCES_DIST) test-array_list.c \
+       test-array_oset.c test-asyncsafe-spin1.c \
+       test-asyncsafe-spin2.c test-avltree_oset.c test-binary-io.c \
+       test-bind.c test-bitrotate.c test-btowc.c test-c-ctype.c \
+       test-c-stack.c test-c-strcasecmp.c test-c-strncasecmp.c \
+       test-calloc-gnu.c test-canonicalize.c test-canonicalize-lgpl.c \
+       test-chdir.c test-cloexec.c test-close.c test-closein.c \
+       test-connect.c test-creat.c test-ctype.c \
+       $(am__test_ctype_c___SOURCES_DIST) test-dirent.c \
+       $(am__test_dirent_c___SOURCES_DIST) test-dirname.c test-dup.c \
+       test-dup-safer.c test-dup2.c test-dynarray.c test-environ.c \
+       test-errno.c $(am__test_errno_c___SOURCES_DIST) \
+       test-execute-child.c test-execute-main.c test-execute-script.c \
+       test-explicit_bzero.c test-fchdir.c test-fclose.c test-fcntl.c \
        test-fcntl-h.c $(am__test_fcntl_h_c___SOURCES_DIST) \
-       test-fdopen.c test-fflush.c test-fflush2.c test-fgetc.c \
-       test-filenamecat.c test-float.c test-fopen.c \
-       test-fopen-safer.c test-fpending.c test-fpurge.c test-fputc.c \
-       test-fread.c test-freadahead.c test-freading.c \
+       test-fdopen.c test-fdopendir.c test-fflush.c test-fflush2.c \
+       test-fgetc.c test-filenamecat.c test-float.c \
+       $(am__test_float_c___SOURCES_DIST) test-fopen.c \
+       test-fopen-gnu.c test-fopen-safer.c test-fpending.c \
+       test-fpurge.c test-fputc.c test-fread.c test-freadahead.c \
+       test-freading.c test-free.c test-freopen.c \
        $(test_frexp_nolibm_SOURCES) $(test_frexpl_nolibm_SOURCES) \
        test-fseek.c test-fseeko.c test-fseeko3.c test-fseeko4.c \
-       test-fstat.c test-ftell.c test-ftell3.c test-ftello.c \
-       test-ftello3.c test-ftello4.c test-fwrite.c test-getcwd-lgpl.c \
-       test-getdtablesize.c test-getopt-gnu.c test-getopt-posix.c \
-       test-getprogname.c test-gettimeofday.c test-ignore-value.c \
-       test-intprops.c test-inttypes.c test-isblank.c \
-       test-isnand-nolibm.c test-isnanf-nolibm.c test-isnanl-nolibm.c \
-       test-langinfo.c $(am__test_langinfo_c___SOURCES_DIST) \
-       test-limits-h.c test-link.c test-linkedhash_list.c \
-       test-locale.c $(am__test_locale_c___SOURCES_DIST) \
-       test-localeconv.c test-localename.c test-lseek.c test-lstat.c \
+       test-fstat.c test-fstatat.c test-ftell.c test-ftell3.c \
+       test-ftello.c test-ftello3.c test-ftello4.c test-ftruncate.c \
+       test-fwrite.c test-getcwd.c test-getcwd-lgpl.c \
+       test-getdtablesize.c test-getopt-gnu.c test-getprogname.c \
+       test-getrandom.c test-gettimeofday.c test-hard-locale.c \
+       test-hash.c test-iconv.c test-iconv-h.c \
+       $(am__test_iconv_h_c___SOURCES_DIST) test-ignore-value.c \
+       test-inet_pton.c test-intprops.c test-inttostr.c \
+       test-inttypes.c $(am__test_inttypes_c___SOURCES_DIST) \
+       test-ioctl.c test-isblank.c test-isnand-nolibm.c \
+       test-isnanf-nolibm.c test-isnanl-nolibm.c test-iswblank.c \
+       test-iswdigit.c test-iswxdigit.c test-langinfo.c \
+       $(am__test_langinfo_c___SOURCES_DIST) test-limits-h.c \
+       $(am__test_limits_h_c___SOURCES_DIST) test-link.c \
+       test-linked_list.c test-linkedhash_list.c test-listen.c \
+       test-localcharset.c test-locale.c \
+       $(am__test_locale_c___SOURCES_DIST) test-localeconv.c \
+       test-localename.c test-lseek.c test-lstat.c test-malloc-gnu.c \
        test-malloca.c test-math.c $(am__test_math_c___SOURCES_DIST) \
-       test-mbrtowc.c test-mbrtowc-w32.c test-mbsinit.c test-memchr.c \
-       test-memchr2.c test-nl_langinfo.c test-open.c test-pathmax.c \
-       test-pipe2.c test-posix_spawn1.c test-posix_spawn2.c \
+       test-mbrtowc.c test-mbrtowc-w32.c test-mbsinit.c \
+       test-mbsstr1.c test-mbsstr2.c test-mbsstr3.c test-memchr.c \
+       test-memchr2.c test-memrchr.c test-mkdir.c test-nanosleep.c \
+       test-netinet_in.c test-nl_langinfo.c test-nl_langinfo-mt.c \
+       test-open.c test-openat.c test-pathmax.c test-perror.c \
+       test-perror2.c test-pipe.c test-pipe2.c \
+       test-posix_spawn-chdir.c test-posix_spawn-dup2-stdin.c \
+       test-posix_spawn-dup2-stdout.c test-posix_spawn-inherit0.c \
+       test-posix_spawn-inherit1.c test-posix_spawn-open1.c \
+       test-posix_spawn-open2.c test-posix_spawn-script.c \
+       test-posix_spawn_file_actions_addchdir.c \
        test-posix_spawn_file_actions_addclose.c \
        test-posix_spawn_file_actions_adddup2.c \
-       test-posix_spawn_file_actions_addopen.c test-printf-frexp.c \
-       test-printf-frexpl.c test-quotearg-simple.c test-raise.c \
-       test-rawmemchr.c test-readlink.c test-regex.c test-rename.c \
-       test-rmdir.c test-sched.c test-setenv.c test-setlocale1.c \
-       test-setlocale2.c test-sigaction.c test-signal-h.c \
+       test-posix_spawn_file_actions_addopen.c \
+       test-posix_spawnp-script.c test-printf-frexp.c \
+       test-printf-frexpl.c test-pthread.c \
+       $(am__test_pthread_c___SOURCES_DIST) test-pthread-thread.c \
+       test-pthread_sigmask1.c test-pthread_sigmask2.c \
+       test-quotearg-simple.c test-raise.c test-rawmemchr.c \
+       test-read-file.c test-readlink.c test-realloc-gnu.c \
+       test-reallocarray.c test-regex.c test-rename.c test-rmdir.c \
+       test-sched.c $(test_scratch_buffer_SOURCES) test-select.c \
+       test-select-fd.c test-select-stdin.c test-setenv.c \
+       test-setlocale1.c test-setlocale2.c test-setlocale_null.c \
+       test-setlocale_null-mt-all.c test-setlocale_null-mt-one.c \
+       test-setsockopt.c test-sigaction.c test-signal-h.c \
        $(am__test_signal_h_c___SOURCES_DIST) test-signbit.c \
-       test-sigpipe.c test-sigprocmask.c test-sleep.c test-snprintf.c \
-       test-spawn.c $(am__test_spawn_c___SOURCES_DIST) \
-       test-spawn-pipe-child.c test-spawn-pipe-main.c test-stat.c \
-       test-stdalign.c test-stdbool.c test-stddef.c test-stdint.c \
-       test-stdio.c $(am__test_stdio_c___SOURCES_DIST) test-stdlib.c \
+       test-sigpipe.c test-sigprocmask.c test-sigsegv-catch-segv1.c \
+       test-sigsegv-catch-segv2.c test-sigsegv-catch-stackoverflow1.c \
+       test-sigsegv-catch-stackoverflow2.c test-sleep.c \
+       test-snprintf.c test-sockets.c test-spawn.c \
+       $(am__test_spawn_c___SOURCES_DIST) test-spawn-pipe-child.c \
+       test-spawn-pipe-main.c test-spawn-pipe-script.c test-stat.c \
+       test-stat-time.c test-stdalign.c test-stdbool.c \
+       $(am__test_stdbool_c___SOURCES_DIST) test-stddef.c \
+       $(am__test_stddef_c___SOURCES_DIST) test-stdint.c \
+       $(am__test_stdint_c___SOURCES_DIST) test-stdio.c \
+       $(am__test_stdio_c___SOURCES_DIST) test-stdlib.c \
        $(am__test_stdlib_c___SOURCES_DIST) test-strchrnul.c \
-       test-strerror.c test-string.c \
-       $(am__test_string_c___SOURCES_DIST) test-strnlen.c \
-       test-strsignal.c test-strstr.c test-strtod.c test-symlink.c \
-       test-sys_stat.c $(am__test_sys_stat_c___SOURCES_DIST) \
-       test-sys_time.c $(am__test_sys_time_c___SOURCES_DIST) \
-       test-sys_types.c $(am__test_sys_types_c___SOURCES_DIST) \
+       test-strerror.c test-strerror_r.c test-striconv.c \
+       test-string.c $(am__test_string_c___SOURCES_DIST) \
+       test-strnlen.c test-strsignal.c test-strstr.c test-strtod.c \
+       test-strtod1.c test-symlink.c test-sys_ioctl.c \
+       $(am__test_sys_ioctl_c___SOURCES_DIST) test-sys_random.c \
+       $(am__test_sys_random_c___SOURCES_DIST) test-sys_select.c \
+       $(am__test_sys_select_c___SOURCES_DIST) test-sys_socket.c \
+       $(am__test_sys_socket_c___SOURCES_DIST) test-sys_stat.c \
+       $(am__test_sys_stat_c___SOURCES_DIST) test-sys_time.c \
+       $(am__test_sys_time_c___SOURCES_DIST) test-sys_types.c \
+       $(am__test_sys_types_c___SOURCES_DIST) test-sys_uio.c \
        test-sys_wait.c $(am__test_sys_wait_c___SOURCES_DIST) \
-       test-time.c $(am__test_time_c___SOURCES_DIST) test-unistd.c \
+       test-thread_create.c test-thread_self.c test-time.c \
+       $(am__test_time_c___SOURCES_DIST) $(test_u8_mbtoucr_SOURCES) \
+       $(test_u8_uctomb_SOURCES) $(test_uc_width_SOURCES) \
+       $(test_uc_width2_SOURCES) test-unistd.c \
        $(am__test_unistd_c___SOURCES_DIST) test-unsetenv.c \
        test-vasnprintf.c test-vasprintf.c test-vasprintf-posix.c \
-       test-verify.c test-version-etc.c test-wchar.c \
-       $(am__test_wchar_c___SOURCES_DIST) test-wcrtomb.c \
+       test-verify.c test-verify-try.c test-version-etc.c \
+       test-wchar.c $(am__test_wchar_c___SOURCES_DIST) test-wcrtomb.c \
        test-wcrtomb-w32.c test-wctype-h.c \
-       $(am__test_wctype_h_c___SOURCES_DIST) test-write.c \
-       test-xalloc-die.c test-xvasprintf.c
+       $(am__test_wctype_h_c___SOURCES_DIST) test-wcwidth.c \
+       test-write.c test-xalloc-die.c test-xvasprintf.c
 RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
        ctags-recursive dvi-recursive html-recursive info-recursive \
        install-data-recursive install-dvi-recursive \
@@ -1467,7 +2503,7 @@ am__recursive_targets = \
   $(RECURSIVE_CLEAN_TARGETS) \
   $(am__extra_recursive_targets)
 AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
-       check recheck distdir
+       check recheck distdir distdir-am
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 # Read a list of newline-separated strings from the standard input,
 # and print each of them once, without duplicates.  Input order is
@@ -1669,6 +2705,7 @@ am__set_TESTS_bases = \
   bases='$(TEST_LOGS)'; \
   bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \
   bases=`echo $$bases`
+AM_TESTSUITE_SUMMARY_HEADER = ' for $(PACKAGE_STRING)'
 RECHECK_LOGS = $(TEST_LOGS)
 TEST_SUITE_LOG = test-suite.log
 TEST_EXTENSIONS = @EXEEXT@ .test
@@ -1693,7 +2730,7 @@ TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
 DIST_SUBDIRS = $(SUBDIRS)
 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/gnulib.mk \
        $(top_srcdir)/build-aux/depcomp \
-       $(top_srcdir)/build-aux/test-driver
+       $(top_srcdir)/build-aux/test-driver alloca.c
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -1742,6 +2779,7 @@ BITSIZEOF_WINT_T = @BITSIZEOF_WINT_T@
 CC = @CC@
 CCDEPMODE = @CCDEPMODE@
 CFLAGS = @CFLAGS@
+CFLAG_VISIBILITY = @CFLAG_VISIBILITY@
 CONFIG_INCLUDE = @CONFIG_INCLUDE@
 CPP = @CPP@
 CPPFLAGS = @CPPFLAGS@
@@ -1765,392 +2803,519 @@ EOVERFLOW_VALUE = @EOVERFLOW_VALUE@
 ERRNO_H = @ERRNO_H@
 EXEEXT = @EXEEXT@
 FLOAT_H = @FLOAT_H@
+GETOPT_CDEFS_H = @GETOPT_CDEFS_H@
 GETOPT_H = @GETOPT_H@
-GLIBC21 = @GLIBC21@
-GNULIB_ACOSF = @GNULIB_ACOSF@
-GNULIB_ACOSL = @GNULIB_ACOSL@
-GNULIB_ALPHASORT = @GNULIB_ALPHASORT@
-GNULIB_ASINF = @GNULIB_ASINF@
-GNULIB_ASINL = @GNULIB_ASINL@
-GNULIB_ATAN2F = @GNULIB_ATAN2F@
-GNULIB_ATANF = @GNULIB_ATANF@
-GNULIB_ATANL = @GNULIB_ATANL@
-GNULIB_ATOLL = @GNULIB_ATOLL@
-GNULIB_BTOWC = @GNULIB_BTOWC@
-GNULIB_CALLOC_POSIX = @GNULIB_CALLOC_POSIX@
-GNULIB_CANONICALIZE_FILE_NAME = @GNULIB_CANONICALIZE_FILE_NAME@
-GNULIB_CBRT = @GNULIB_CBRT@
-GNULIB_CBRTF = @GNULIB_CBRTF@
-GNULIB_CBRTL = @GNULIB_CBRTL@
-GNULIB_CEIL = @GNULIB_CEIL@
-GNULIB_CEILF = @GNULIB_CEILF@
-GNULIB_CEILL = @GNULIB_CEILL@
-GNULIB_CHDIR = @GNULIB_CHDIR@
-GNULIB_CHOWN = @GNULIB_CHOWN@
-GNULIB_CLOSE = @GNULIB_CLOSE@
-GNULIB_CLOSEDIR = @GNULIB_CLOSEDIR@
-GNULIB_COPYSIGN = @GNULIB_COPYSIGN@
-GNULIB_COPYSIGNF = @GNULIB_COPYSIGNF@
-GNULIB_COPYSIGNL = @GNULIB_COPYSIGNL@
-GNULIB_COSF = @GNULIB_COSF@
-GNULIB_COSHF = @GNULIB_COSHF@
-GNULIB_COSL = @GNULIB_COSL@
-GNULIB_DIRFD = @GNULIB_DIRFD@
-GNULIB_DPRINTF = @GNULIB_DPRINTF@
-GNULIB_DUP = @GNULIB_DUP@
-GNULIB_DUP2 = @GNULIB_DUP2@
-GNULIB_DUP3 = @GNULIB_DUP3@
-GNULIB_DUPLOCALE = @GNULIB_DUPLOCALE@
-GNULIB_ENVIRON = @GNULIB_ENVIRON@
-GNULIB_EUIDACCESS = @GNULIB_EUIDACCESS@
-GNULIB_EXP2 = @GNULIB_EXP2@
-GNULIB_EXP2F = @GNULIB_EXP2F@
-GNULIB_EXP2L = @GNULIB_EXP2L@
-GNULIB_EXPF = @GNULIB_EXPF@
-GNULIB_EXPL = @GNULIB_EXPL@
-GNULIB_EXPM1 = @GNULIB_EXPM1@
-GNULIB_EXPM1F = @GNULIB_EXPM1F@
-GNULIB_EXPM1L = @GNULIB_EXPM1L@
-GNULIB_FABSF = @GNULIB_FABSF@
-GNULIB_FABSL = @GNULIB_FABSL@
-GNULIB_FACCESSAT = @GNULIB_FACCESSAT@
-GNULIB_FCHDIR = @GNULIB_FCHDIR@
-GNULIB_FCHMODAT = @GNULIB_FCHMODAT@
-GNULIB_FCHOWNAT = @GNULIB_FCHOWNAT@
-GNULIB_FCLOSE = @GNULIB_FCLOSE@
-GNULIB_FCNTL = @GNULIB_FCNTL@
-GNULIB_FDATASYNC = @GNULIB_FDATASYNC@
-GNULIB_FDOPEN = @GNULIB_FDOPEN@
-GNULIB_FDOPENDIR = @GNULIB_FDOPENDIR@
-GNULIB_FFLUSH = @GNULIB_FFLUSH@
-GNULIB_FFSL = @GNULIB_FFSL@
-GNULIB_FFSLL = @GNULIB_FFSLL@
-GNULIB_FGETC = @GNULIB_FGETC@
-GNULIB_FGETS = @GNULIB_FGETS@
-GNULIB_FLOOR = @GNULIB_FLOOR@
-GNULIB_FLOORF = @GNULIB_FLOORF@
-GNULIB_FLOORL = @GNULIB_FLOORL@
-GNULIB_FMA = @GNULIB_FMA@
-GNULIB_FMAF = @GNULIB_FMAF@
-GNULIB_FMAL = @GNULIB_FMAL@
-GNULIB_FMOD = @GNULIB_FMOD@
-GNULIB_FMODF = @GNULIB_FMODF@
-GNULIB_FMODL = @GNULIB_FMODL@
-GNULIB_FOPEN = @GNULIB_FOPEN@
-GNULIB_FPRINTF = @GNULIB_FPRINTF@
-GNULIB_FPRINTF_POSIX = @GNULIB_FPRINTF_POSIX@
-GNULIB_FPURGE = @GNULIB_FPURGE@
-GNULIB_FPUTC = @GNULIB_FPUTC@
-GNULIB_FPUTS = @GNULIB_FPUTS@
-GNULIB_FREAD = @GNULIB_FREAD@
-GNULIB_FREOPEN = @GNULIB_FREOPEN@
-GNULIB_FREXP = @GNULIB_FREXP@
-GNULIB_FREXPF = @GNULIB_FREXPF@
-GNULIB_FREXPL = @GNULIB_FREXPL@
-GNULIB_FSCANF = @GNULIB_FSCANF@
-GNULIB_FSEEK = @GNULIB_FSEEK@
-GNULIB_FSEEKO = @GNULIB_FSEEKO@
-GNULIB_FSTAT = @GNULIB_FSTAT@
-GNULIB_FSTATAT = @GNULIB_FSTATAT@
-GNULIB_FSYNC = @GNULIB_FSYNC@
-GNULIB_FTELL = @GNULIB_FTELL@
-GNULIB_FTELLO = @GNULIB_FTELLO@
-GNULIB_FTRUNCATE = @GNULIB_FTRUNCATE@
-GNULIB_FUTIMENS = @GNULIB_FUTIMENS@
-GNULIB_FWRITE = @GNULIB_FWRITE@
-GNULIB_GETC = @GNULIB_GETC@
-GNULIB_GETCHAR = @GNULIB_GETCHAR@
-GNULIB_GETCWD = @GNULIB_GETCWD@
-GNULIB_GETDELIM = @GNULIB_GETDELIM@
-GNULIB_GETDOMAINNAME = @GNULIB_GETDOMAINNAME@
-GNULIB_GETDTABLESIZE = @GNULIB_GETDTABLESIZE@
-GNULIB_GETGROUPS = @GNULIB_GETGROUPS@
-GNULIB_GETHOSTNAME = @GNULIB_GETHOSTNAME@
-GNULIB_GETLINE = @GNULIB_GETLINE@
-GNULIB_GETLOADAVG = @GNULIB_GETLOADAVG@
-GNULIB_GETLOGIN = @GNULIB_GETLOGIN@
-GNULIB_GETLOGIN_R = @GNULIB_GETLOGIN_R@
-GNULIB_GETPAGESIZE = @GNULIB_GETPAGESIZE@
-GNULIB_GETSUBOPT = @GNULIB_GETSUBOPT@
+GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@
+GL_M4_GNULIB_ACCEPT = @GL_M4_GNULIB_ACCEPT@
+GL_M4_GNULIB_ACCEPT4 = @GL_M4_GNULIB_ACCEPT4@
+GL_M4_GNULIB_ACCESS = @GL_M4_GNULIB_ACCESS@
+GL_M4_GNULIB_ACOSF = @GL_M4_GNULIB_ACOSF@
+GL_M4_GNULIB_ACOSL = @GL_M4_GNULIB_ACOSL@
+GL_M4_GNULIB_ALIGNED_ALLOC = @GL_M4_GNULIB_ALIGNED_ALLOC@
+GL_M4_GNULIB_ALPHASORT = @GL_M4_GNULIB_ALPHASORT@
+GL_M4_GNULIB_ASINF = @GL_M4_GNULIB_ASINF@
+GL_M4_GNULIB_ASINL = @GL_M4_GNULIB_ASINL@
+GL_M4_GNULIB_ATAN2F = @GL_M4_GNULIB_ATAN2F@
+GL_M4_GNULIB_ATANF = @GL_M4_GNULIB_ATANF@
+GL_M4_GNULIB_ATANL = @GL_M4_GNULIB_ATANL@
+GL_M4_GNULIB_ATOLL = @GL_M4_GNULIB_ATOLL@
+GL_M4_GNULIB_BIND = @GL_M4_GNULIB_BIND@
+GL_M4_GNULIB_BTOWC = @GL_M4_GNULIB_BTOWC@
+GL_M4_GNULIB_CALLOC_POSIX = @GL_M4_GNULIB_CALLOC_POSIX@
+GL_M4_GNULIB_CANONICALIZE_FILE_NAME = @GL_M4_GNULIB_CANONICALIZE_FILE_NAME@
+GL_M4_GNULIB_CBRT = @GL_M4_GNULIB_CBRT@
+GL_M4_GNULIB_CBRTF = @GL_M4_GNULIB_CBRTF@
+GL_M4_GNULIB_CBRTL = @GL_M4_GNULIB_CBRTL@
+GL_M4_GNULIB_CEIL = @GL_M4_GNULIB_CEIL@
+GL_M4_GNULIB_CEILF = @GL_M4_GNULIB_CEILF@
+GL_M4_GNULIB_CEILL = @GL_M4_GNULIB_CEILL@
+GL_M4_GNULIB_CHDIR = @GL_M4_GNULIB_CHDIR@
+GL_M4_GNULIB_CHOWN = @GL_M4_GNULIB_CHOWN@
+GL_M4_GNULIB_CLOSE = @GL_M4_GNULIB_CLOSE@
+GL_M4_GNULIB_CLOSEDIR = @GL_M4_GNULIB_CLOSEDIR@
+GL_M4_GNULIB_CONNECT = @GL_M4_GNULIB_CONNECT@
+GL_M4_GNULIB_COPYSIGN = @GL_M4_GNULIB_COPYSIGN@
+GL_M4_GNULIB_COPYSIGNF = @GL_M4_GNULIB_COPYSIGNF@
+GL_M4_GNULIB_COPYSIGNL = @GL_M4_GNULIB_COPYSIGNL@
+GL_M4_GNULIB_COPY_FILE_RANGE = @GL_M4_GNULIB_COPY_FILE_RANGE@
+GL_M4_GNULIB_COSF = @GL_M4_GNULIB_COSF@
+GL_M4_GNULIB_COSHF = @GL_M4_GNULIB_COSHF@
+GL_M4_GNULIB_COSL = @GL_M4_GNULIB_COSL@
+GL_M4_GNULIB_CREAT = @GL_M4_GNULIB_CREAT@
+GL_M4_GNULIB_CTIME = @GL_M4_GNULIB_CTIME@
+GL_M4_GNULIB_DIRFD = @GL_M4_GNULIB_DIRFD@
+GL_M4_GNULIB_DPRINTF = @GL_M4_GNULIB_DPRINTF@
+GL_M4_GNULIB_DUP = @GL_M4_GNULIB_DUP@
+GL_M4_GNULIB_DUP2 = @GL_M4_GNULIB_DUP2@
+GL_M4_GNULIB_DUP3 = @GL_M4_GNULIB_DUP3@
+GL_M4_GNULIB_DUPLOCALE = @GL_M4_GNULIB_DUPLOCALE@
+GL_M4_GNULIB_ENVIRON = @GL_M4_GNULIB_ENVIRON@
+GL_M4_GNULIB_EUIDACCESS = @GL_M4_GNULIB_EUIDACCESS@
+GL_M4_GNULIB_EXECL = @GL_M4_GNULIB_EXECL@
+GL_M4_GNULIB_EXECLE = @GL_M4_GNULIB_EXECLE@
+GL_M4_GNULIB_EXECLP = @GL_M4_GNULIB_EXECLP@
+GL_M4_GNULIB_EXECV = @GL_M4_GNULIB_EXECV@
+GL_M4_GNULIB_EXECVE = @GL_M4_GNULIB_EXECVE@
+GL_M4_GNULIB_EXECVP = @GL_M4_GNULIB_EXECVP@
+GL_M4_GNULIB_EXECVPE = @GL_M4_GNULIB_EXECVPE@
+GL_M4_GNULIB_EXP2 = @GL_M4_GNULIB_EXP2@
+GL_M4_GNULIB_EXP2F = @GL_M4_GNULIB_EXP2F@
+GL_M4_GNULIB_EXP2L = @GL_M4_GNULIB_EXP2L@
+GL_M4_GNULIB_EXPF = @GL_M4_GNULIB_EXPF@
+GL_M4_GNULIB_EXPL = @GL_M4_GNULIB_EXPL@
+GL_M4_GNULIB_EXPLICIT_BZERO = @GL_M4_GNULIB_EXPLICIT_BZERO@
+GL_M4_GNULIB_EXPM1 = @GL_M4_GNULIB_EXPM1@
+GL_M4_GNULIB_EXPM1F = @GL_M4_GNULIB_EXPM1F@
+GL_M4_GNULIB_EXPM1L = @GL_M4_GNULIB_EXPM1L@
+GL_M4_GNULIB_FABSF = @GL_M4_GNULIB_FABSF@
+GL_M4_GNULIB_FABSL = @GL_M4_GNULIB_FABSL@
+GL_M4_GNULIB_FACCESSAT = @GL_M4_GNULIB_FACCESSAT@
+GL_M4_GNULIB_FCHDIR = @GL_M4_GNULIB_FCHDIR@
+GL_M4_GNULIB_FCHMODAT = @GL_M4_GNULIB_FCHMODAT@
+GL_M4_GNULIB_FCHOWNAT = @GL_M4_GNULIB_FCHOWNAT@
+GL_M4_GNULIB_FCLOSE = @GL_M4_GNULIB_FCLOSE@
+GL_M4_GNULIB_FCNTL = @GL_M4_GNULIB_FCNTL@
+GL_M4_GNULIB_FDATASYNC = @GL_M4_GNULIB_FDATASYNC@
+GL_M4_GNULIB_FDOPEN = @GL_M4_GNULIB_FDOPEN@
+GL_M4_GNULIB_FDOPENDIR = @GL_M4_GNULIB_FDOPENDIR@
+GL_M4_GNULIB_FFLUSH = @GL_M4_GNULIB_FFLUSH@
+GL_M4_GNULIB_FFSL = @GL_M4_GNULIB_FFSL@
+GL_M4_GNULIB_FFSLL = @GL_M4_GNULIB_FFSLL@
+GL_M4_GNULIB_FGETC = @GL_M4_GNULIB_FGETC@
+GL_M4_GNULIB_FGETS = @GL_M4_GNULIB_FGETS@
+GL_M4_GNULIB_FLOOR = @GL_M4_GNULIB_FLOOR@
+GL_M4_GNULIB_FLOORF = @GL_M4_GNULIB_FLOORF@
+GL_M4_GNULIB_FLOORL = @GL_M4_GNULIB_FLOORL@
+GL_M4_GNULIB_FMA = @GL_M4_GNULIB_FMA@
+GL_M4_GNULIB_FMAF = @GL_M4_GNULIB_FMAF@
+GL_M4_GNULIB_FMAL = @GL_M4_GNULIB_FMAL@
+GL_M4_GNULIB_FMOD = @GL_M4_GNULIB_FMOD@
+GL_M4_GNULIB_FMODF = @GL_M4_GNULIB_FMODF@
+GL_M4_GNULIB_FMODL = @GL_M4_GNULIB_FMODL@
+GL_M4_GNULIB_FOPEN = @GL_M4_GNULIB_FOPEN@
+GL_M4_GNULIB_FPRINTF = @GL_M4_GNULIB_FPRINTF@
+GL_M4_GNULIB_FPRINTF_POSIX = @GL_M4_GNULIB_FPRINTF_POSIX@
+GL_M4_GNULIB_FPURGE = @GL_M4_GNULIB_FPURGE@
+GL_M4_GNULIB_FPUTC = @GL_M4_GNULIB_FPUTC@
+GL_M4_GNULIB_FPUTS = @GL_M4_GNULIB_FPUTS@
+GL_M4_GNULIB_FREAD = @GL_M4_GNULIB_FREAD@
+GL_M4_GNULIB_FREE_POSIX = @GL_M4_GNULIB_FREE_POSIX@
+GL_M4_GNULIB_FREOPEN = @GL_M4_GNULIB_FREOPEN@
+GL_M4_GNULIB_FREXP = @GL_M4_GNULIB_FREXP@
+GL_M4_GNULIB_FREXPF = @GL_M4_GNULIB_FREXPF@
+GL_M4_GNULIB_FREXPL = @GL_M4_GNULIB_FREXPL@
+GL_M4_GNULIB_FSCANF = @GL_M4_GNULIB_FSCANF@
+GL_M4_GNULIB_FSEEK = @GL_M4_GNULIB_FSEEK@
+GL_M4_GNULIB_FSEEKO = @GL_M4_GNULIB_FSEEKO@
+GL_M4_GNULIB_FSTAT = @GL_M4_GNULIB_FSTAT@
+GL_M4_GNULIB_FSTATAT = @GL_M4_GNULIB_FSTATAT@
+GL_M4_GNULIB_FSYNC = @GL_M4_GNULIB_FSYNC@
+GL_M4_GNULIB_FTELL = @GL_M4_GNULIB_FTELL@
+GL_M4_GNULIB_FTELLO = @GL_M4_GNULIB_FTELLO@
+GL_M4_GNULIB_FTRUNCATE = @GL_M4_GNULIB_FTRUNCATE@
+GL_M4_GNULIB_FUTIMENS = @GL_M4_GNULIB_FUTIMENS@
+GL_M4_GNULIB_FWRITE = @GL_M4_GNULIB_FWRITE@
+GL_M4_GNULIB_GETC = @GL_M4_GNULIB_GETC@
+GL_M4_GNULIB_GETCHAR = @GL_M4_GNULIB_GETCHAR@
+GL_M4_GNULIB_GETCWD = @GL_M4_GNULIB_GETCWD@
+GL_M4_GNULIB_GETDELIM = @GL_M4_GNULIB_GETDELIM@
+GL_M4_GNULIB_GETDOMAINNAME = @GL_M4_GNULIB_GETDOMAINNAME@
+GL_M4_GNULIB_GETDTABLESIZE = @GL_M4_GNULIB_GETDTABLESIZE@
+GL_M4_GNULIB_GETENTROPY = @GL_M4_GNULIB_GETENTROPY@
+GL_M4_GNULIB_GETGROUPS = @GL_M4_GNULIB_GETGROUPS@
+GL_M4_GNULIB_GETHOSTNAME = @GL_M4_GNULIB_GETHOSTNAME@
+GL_M4_GNULIB_GETLINE = @GL_M4_GNULIB_GETLINE@
+GL_M4_GNULIB_GETLOADAVG = @GL_M4_GNULIB_GETLOADAVG@
+GL_M4_GNULIB_GETLOGIN = @GL_M4_GNULIB_GETLOGIN@
+GL_M4_GNULIB_GETLOGIN_R = @GL_M4_GNULIB_GETLOGIN_R@
+GL_M4_GNULIB_GETOPT_POSIX = @GL_M4_GNULIB_GETOPT_POSIX@
+GL_M4_GNULIB_GETPAGESIZE = @GL_M4_GNULIB_GETPAGESIZE@
+GL_M4_GNULIB_GETPASS = @GL_M4_GNULIB_GETPASS@
+GL_M4_GNULIB_GETPEERNAME = @GL_M4_GNULIB_GETPEERNAME@
+GL_M4_GNULIB_GETRANDOM = @GL_M4_GNULIB_GETRANDOM@
+GL_M4_GNULIB_GETSOCKNAME = @GL_M4_GNULIB_GETSOCKNAME@
+GL_M4_GNULIB_GETSOCKOPT = @GL_M4_GNULIB_GETSOCKOPT@
+GL_M4_GNULIB_GETSUBOPT = @GL_M4_GNULIB_GETSUBOPT@
+GL_M4_GNULIB_GETTIMEOFDAY = @GL_M4_GNULIB_GETTIMEOFDAY@
+GL_M4_GNULIB_GETUMASK = @GL_M4_GNULIB_GETUMASK@
+GL_M4_GNULIB_GETUSERSHELL = @GL_M4_GNULIB_GETUSERSHELL@
+GL_M4_GNULIB_GRANTPT = @GL_M4_GNULIB_GRANTPT@
+GL_M4_GNULIB_GROUP_MEMBER = @GL_M4_GNULIB_GROUP_MEMBER@
+GL_M4_GNULIB_HYPOT = @GL_M4_GNULIB_HYPOT@
+GL_M4_GNULIB_HYPOTF = @GL_M4_GNULIB_HYPOTF@
+GL_M4_GNULIB_HYPOTL = @GL_M4_GNULIB_HYPOTL@
+GL_M4_GNULIB_ICONV = @GL_M4_GNULIB_ICONV@
+GL_M4_GNULIB_ILOGB = @GL_M4_GNULIB_ILOGB@
+GL_M4_GNULIB_ILOGBF = @GL_M4_GNULIB_ILOGBF@
+GL_M4_GNULIB_ILOGBL = @GL_M4_GNULIB_ILOGBL@
+GL_M4_GNULIB_IMAXABS = @GL_M4_GNULIB_IMAXABS@
+GL_M4_GNULIB_IMAXDIV = @GL_M4_GNULIB_IMAXDIV@
+GL_M4_GNULIB_INET_NTOP = @GL_M4_GNULIB_INET_NTOP@
+GL_M4_GNULIB_INET_PTON = @GL_M4_GNULIB_INET_PTON@
+GL_M4_GNULIB_IOCTL = @GL_M4_GNULIB_IOCTL@
+GL_M4_GNULIB_ISATTY = @GL_M4_GNULIB_ISATTY@
+GL_M4_GNULIB_ISBLANK = @GL_M4_GNULIB_ISBLANK@
+GL_M4_GNULIB_ISFINITE = @GL_M4_GNULIB_ISFINITE@
+GL_M4_GNULIB_ISINF = @GL_M4_GNULIB_ISINF@
+GL_M4_GNULIB_ISNAN = @GL_M4_GNULIB_ISNAN@
+GL_M4_GNULIB_ISNAND = @GL_M4_GNULIB_ISNAND@
+GL_M4_GNULIB_ISNANF = @GL_M4_GNULIB_ISNANF@
+GL_M4_GNULIB_ISNANL = @GL_M4_GNULIB_ISNANL@
+GL_M4_GNULIB_ISWBLANK = @GL_M4_GNULIB_ISWBLANK@
+GL_M4_GNULIB_ISWCTYPE = @GL_M4_GNULIB_ISWCTYPE@
+GL_M4_GNULIB_ISWDIGIT = @GL_M4_GNULIB_ISWDIGIT@
+GL_M4_GNULIB_ISWXDIGIT = @GL_M4_GNULIB_ISWXDIGIT@
+GL_M4_GNULIB_LCHMOD = @GL_M4_GNULIB_LCHMOD@
+GL_M4_GNULIB_LCHOWN = @GL_M4_GNULIB_LCHOWN@
+GL_M4_GNULIB_LDEXPF = @GL_M4_GNULIB_LDEXPF@
+GL_M4_GNULIB_LDEXPL = @GL_M4_GNULIB_LDEXPL@
+GL_M4_GNULIB_LINK = @GL_M4_GNULIB_LINK@
+GL_M4_GNULIB_LINKAT = @GL_M4_GNULIB_LINKAT@
+GL_M4_GNULIB_LISTEN = @GL_M4_GNULIB_LISTEN@
+GL_M4_GNULIB_LOCALECONV = @GL_M4_GNULIB_LOCALECONV@
+GL_M4_GNULIB_LOCALENAME = @GL_M4_GNULIB_LOCALENAME@
+GL_M4_GNULIB_LOCALTIME = @GL_M4_GNULIB_LOCALTIME@
+GL_M4_GNULIB_LOG = @GL_M4_GNULIB_LOG@
+GL_M4_GNULIB_LOG10 = @GL_M4_GNULIB_LOG10@
+GL_M4_GNULIB_LOG10F = @GL_M4_GNULIB_LOG10F@
+GL_M4_GNULIB_LOG10L = @GL_M4_GNULIB_LOG10L@
+GL_M4_GNULIB_LOG1P = @GL_M4_GNULIB_LOG1P@
+GL_M4_GNULIB_LOG1PF = @GL_M4_GNULIB_LOG1PF@
+GL_M4_GNULIB_LOG1PL = @GL_M4_GNULIB_LOG1PL@
+GL_M4_GNULIB_LOG2 = @GL_M4_GNULIB_LOG2@
+GL_M4_GNULIB_LOG2F = @GL_M4_GNULIB_LOG2F@
+GL_M4_GNULIB_LOG2L = @GL_M4_GNULIB_LOG2L@
+GL_M4_GNULIB_LOGB = @GL_M4_GNULIB_LOGB@
+GL_M4_GNULIB_LOGBF = @GL_M4_GNULIB_LOGBF@
+GL_M4_GNULIB_LOGBL = @GL_M4_GNULIB_LOGBL@
+GL_M4_GNULIB_LOGF = @GL_M4_GNULIB_LOGF@
+GL_M4_GNULIB_LOGL = @GL_M4_GNULIB_LOGL@
+GL_M4_GNULIB_LSEEK = @GL_M4_GNULIB_LSEEK@
+GL_M4_GNULIB_LSTAT = @GL_M4_GNULIB_LSTAT@
+GL_M4_GNULIB_MALLOC_POSIX = @GL_M4_GNULIB_MALLOC_POSIX@
+GL_M4_GNULIB_MBRLEN = @GL_M4_GNULIB_MBRLEN@
+GL_M4_GNULIB_MBRTOWC = @GL_M4_GNULIB_MBRTOWC@
+GL_M4_GNULIB_MBSCASECMP = @GL_M4_GNULIB_MBSCASECMP@
+GL_M4_GNULIB_MBSCASESTR = @GL_M4_GNULIB_MBSCASESTR@
+GL_M4_GNULIB_MBSCHR = @GL_M4_GNULIB_MBSCHR@
+GL_M4_GNULIB_MBSCSPN = @GL_M4_GNULIB_MBSCSPN@
+GL_M4_GNULIB_MBSINIT = @GL_M4_GNULIB_MBSINIT@
+GL_M4_GNULIB_MBSLEN = @GL_M4_GNULIB_MBSLEN@
+GL_M4_GNULIB_MBSNCASECMP = @GL_M4_GNULIB_MBSNCASECMP@
+GL_M4_GNULIB_MBSNLEN = @GL_M4_GNULIB_MBSNLEN@
+GL_M4_GNULIB_MBSNRTOWCS = @GL_M4_GNULIB_MBSNRTOWCS@
+GL_M4_GNULIB_MBSPBRK = @GL_M4_GNULIB_MBSPBRK@
+GL_M4_GNULIB_MBSPCASECMP = @GL_M4_GNULIB_MBSPCASECMP@
+GL_M4_GNULIB_MBSRCHR = @GL_M4_GNULIB_MBSRCHR@
+GL_M4_GNULIB_MBSRTOWCS = @GL_M4_GNULIB_MBSRTOWCS@
+GL_M4_GNULIB_MBSSEP = @GL_M4_GNULIB_MBSSEP@
+GL_M4_GNULIB_MBSSPN = @GL_M4_GNULIB_MBSSPN@
+GL_M4_GNULIB_MBSSTR = @GL_M4_GNULIB_MBSSTR@
+GL_M4_GNULIB_MBSTOK_R = @GL_M4_GNULIB_MBSTOK_R@
+GL_M4_GNULIB_MBTOWC = @GL_M4_GNULIB_MBTOWC@
+GL_M4_GNULIB_MDA_ACCESS = @GL_M4_GNULIB_MDA_ACCESS@
+GL_M4_GNULIB_MDA_CHDIR = @GL_M4_GNULIB_MDA_CHDIR@
+GL_M4_GNULIB_MDA_CHMOD = @GL_M4_GNULIB_MDA_CHMOD@
+GL_M4_GNULIB_MDA_CLOSE = @GL_M4_GNULIB_MDA_CLOSE@
+GL_M4_GNULIB_MDA_CREAT = @GL_M4_GNULIB_MDA_CREAT@
+GL_M4_GNULIB_MDA_DUP = @GL_M4_GNULIB_MDA_DUP@
+GL_M4_GNULIB_MDA_DUP2 = @GL_M4_GNULIB_MDA_DUP2@
+GL_M4_GNULIB_MDA_ECVT = @GL_M4_GNULIB_MDA_ECVT@
+GL_M4_GNULIB_MDA_EXECL = @GL_M4_GNULIB_MDA_EXECL@
+GL_M4_GNULIB_MDA_EXECLE = @GL_M4_GNULIB_MDA_EXECLE@
+GL_M4_GNULIB_MDA_EXECLP = @GL_M4_GNULIB_MDA_EXECLP@
+GL_M4_GNULIB_MDA_EXECV = @GL_M4_GNULIB_MDA_EXECV@
+GL_M4_GNULIB_MDA_EXECVE = @GL_M4_GNULIB_MDA_EXECVE@
+GL_M4_GNULIB_MDA_EXECVP = @GL_M4_GNULIB_MDA_EXECVP@
+GL_M4_GNULIB_MDA_EXECVPE = @GL_M4_GNULIB_MDA_EXECVPE@
+GL_M4_GNULIB_MDA_FCLOSEALL = @GL_M4_GNULIB_MDA_FCLOSEALL@
+GL_M4_GNULIB_MDA_FCVT = @GL_M4_GNULIB_MDA_FCVT@
+GL_M4_GNULIB_MDA_FDOPEN = @GL_M4_GNULIB_MDA_FDOPEN@
+GL_M4_GNULIB_MDA_FILENO = @GL_M4_GNULIB_MDA_FILENO@
+GL_M4_GNULIB_MDA_GCVT = @GL_M4_GNULIB_MDA_GCVT@
+GL_M4_GNULIB_MDA_GETCWD = @GL_M4_GNULIB_MDA_GETCWD@
+GL_M4_GNULIB_MDA_GETPID = @GL_M4_GNULIB_MDA_GETPID@
+GL_M4_GNULIB_MDA_GETW = @GL_M4_GNULIB_MDA_GETW@
+GL_M4_GNULIB_MDA_ISATTY = @GL_M4_GNULIB_MDA_ISATTY@
+GL_M4_GNULIB_MDA_J0 = @GL_M4_GNULIB_MDA_J0@
+GL_M4_GNULIB_MDA_J1 = @GL_M4_GNULIB_MDA_J1@
+GL_M4_GNULIB_MDA_JN = @GL_M4_GNULIB_MDA_JN@
+GL_M4_GNULIB_MDA_LSEEK = @GL_M4_GNULIB_MDA_LSEEK@
+GL_M4_GNULIB_MDA_MEMCCPY = @GL_M4_GNULIB_MDA_MEMCCPY@
+GL_M4_GNULIB_MDA_MKDIR = @GL_M4_GNULIB_MDA_MKDIR@
+GL_M4_GNULIB_MDA_MKTEMP = @GL_M4_GNULIB_MDA_MKTEMP@
+GL_M4_GNULIB_MDA_OPEN = @GL_M4_GNULIB_MDA_OPEN@
+GL_M4_GNULIB_MDA_PUTENV = @GL_M4_GNULIB_MDA_PUTENV@
+GL_M4_GNULIB_MDA_PUTW = @GL_M4_GNULIB_MDA_PUTW@
+GL_M4_GNULIB_MDA_READ = @GL_M4_GNULIB_MDA_READ@
+GL_M4_GNULIB_MDA_RMDIR = @GL_M4_GNULIB_MDA_RMDIR@
+GL_M4_GNULIB_MDA_STRDUP = @GL_M4_GNULIB_MDA_STRDUP@
+GL_M4_GNULIB_MDA_SWAB = @GL_M4_GNULIB_MDA_SWAB@
+GL_M4_GNULIB_MDA_TEMPNAM = @GL_M4_GNULIB_MDA_TEMPNAM@
+GL_M4_GNULIB_MDA_TZSET = @GL_M4_GNULIB_MDA_TZSET@
+GL_M4_GNULIB_MDA_UMASK = @GL_M4_GNULIB_MDA_UMASK@
+GL_M4_GNULIB_MDA_UNLINK = @GL_M4_GNULIB_MDA_UNLINK@
+GL_M4_GNULIB_MDA_WCSDUP = @GL_M4_GNULIB_MDA_WCSDUP@
+GL_M4_GNULIB_MDA_WRITE = @GL_M4_GNULIB_MDA_WRITE@
+GL_M4_GNULIB_MDA_Y0 = @GL_M4_GNULIB_MDA_Y0@
+GL_M4_GNULIB_MDA_Y1 = @GL_M4_GNULIB_MDA_Y1@
+GL_M4_GNULIB_MDA_YN = @GL_M4_GNULIB_MDA_YN@
+GL_M4_GNULIB_MEMCHR = @GL_M4_GNULIB_MEMCHR@
+GL_M4_GNULIB_MEMMEM = @GL_M4_GNULIB_MEMMEM@
+GL_M4_GNULIB_MEMPCPY = @GL_M4_GNULIB_MEMPCPY@
+GL_M4_GNULIB_MEMRCHR = @GL_M4_GNULIB_MEMRCHR@
+GL_M4_GNULIB_MKDIR = @GL_M4_GNULIB_MKDIR@
+GL_M4_GNULIB_MKDIRAT = @GL_M4_GNULIB_MKDIRAT@
+GL_M4_GNULIB_MKDTEMP = @GL_M4_GNULIB_MKDTEMP@
+GL_M4_GNULIB_MKFIFO = @GL_M4_GNULIB_MKFIFO@
+GL_M4_GNULIB_MKFIFOAT = @GL_M4_GNULIB_MKFIFOAT@
+GL_M4_GNULIB_MKNOD = @GL_M4_GNULIB_MKNOD@
+GL_M4_GNULIB_MKNODAT = @GL_M4_GNULIB_MKNODAT@
+GL_M4_GNULIB_MKOSTEMP = @GL_M4_GNULIB_MKOSTEMP@
+GL_M4_GNULIB_MKOSTEMPS = @GL_M4_GNULIB_MKOSTEMPS@
+GL_M4_GNULIB_MKSTEMP = @GL_M4_GNULIB_MKSTEMP@
+GL_M4_GNULIB_MKSTEMPS = @GL_M4_GNULIB_MKSTEMPS@
+GL_M4_GNULIB_MKTIME = @GL_M4_GNULIB_MKTIME@
+GL_M4_GNULIB_MODF = @GL_M4_GNULIB_MODF@
+GL_M4_GNULIB_MODFF = @GL_M4_GNULIB_MODFF@
+GL_M4_GNULIB_MODFL = @GL_M4_GNULIB_MODFL@
+GL_M4_GNULIB_NANOSLEEP = @GL_M4_GNULIB_NANOSLEEP@
+GL_M4_GNULIB_NL_LANGINFO = @GL_M4_GNULIB_NL_LANGINFO@
+GL_M4_GNULIB_NONBLOCKING = @GL_M4_GNULIB_NONBLOCKING@
+GL_M4_GNULIB_OBSTACK_PRINTF = @GL_M4_GNULIB_OBSTACK_PRINTF@
+GL_M4_GNULIB_OBSTACK_PRINTF_POSIX = @GL_M4_GNULIB_OBSTACK_PRINTF_POSIX@
+GL_M4_GNULIB_OPEN = @GL_M4_GNULIB_OPEN@
+GL_M4_GNULIB_OPENAT = @GL_M4_GNULIB_OPENAT@
+GL_M4_GNULIB_OPENDIR = @GL_M4_GNULIB_OPENDIR@
+GL_M4_GNULIB_OVERRIDES_STRUCT_STAT = @GL_M4_GNULIB_OVERRIDES_STRUCT_STAT@
+GL_M4_GNULIB_PCLOSE = @GL_M4_GNULIB_PCLOSE@
+GL_M4_GNULIB_PERROR = @GL_M4_GNULIB_PERROR@
+GL_M4_GNULIB_PIPE = @GL_M4_GNULIB_PIPE@
+GL_M4_GNULIB_PIPE2 = @GL_M4_GNULIB_PIPE2@
+GL_M4_GNULIB_POPEN = @GL_M4_GNULIB_POPEN@
+GL_M4_GNULIB_POSIX_MEMALIGN = @GL_M4_GNULIB_POSIX_MEMALIGN@
+GL_M4_GNULIB_POSIX_OPENPT = @GL_M4_GNULIB_POSIX_OPENPT@
+GL_M4_GNULIB_POSIX_SPAWN = @GL_M4_GNULIB_POSIX_SPAWN@
+GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY = @GL_M4_GNULIB_POSIX_SPAWNATTR_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNATTR_INIT = @GL_M4_GNULIB_POSIX_SPAWNATTR_INIT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETFLAGS@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETPGROUP@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
+GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GL_M4_GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
+GL_M4_GNULIB_POSIX_SPAWNP = @GL_M4_GNULIB_POSIX_SPAWNP@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
+GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GL_M4_GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
+GL_M4_GNULIB_POWF = @GL_M4_GNULIB_POWF@
+GL_M4_GNULIB_PREAD = @GL_M4_GNULIB_PREAD@
+GL_M4_GNULIB_PRINTF = @GL_M4_GNULIB_PRINTF@
+GL_M4_GNULIB_PRINTF_POSIX = @GL_M4_GNULIB_PRINTF_POSIX@
+GL_M4_GNULIB_PSELECT = @GL_M4_GNULIB_PSELECT@
+GL_M4_GNULIB_PTHREAD_COND = @GL_M4_GNULIB_PTHREAD_COND@
+GL_M4_GNULIB_PTHREAD_MUTEX = @GL_M4_GNULIB_PTHREAD_MUTEX@
+GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK = @GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK@
+GL_M4_GNULIB_PTHREAD_ONCE = @GL_M4_GNULIB_PTHREAD_ONCE@
+GL_M4_GNULIB_PTHREAD_RWLOCK = @GL_M4_GNULIB_PTHREAD_RWLOCK@
+GL_M4_GNULIB_PTHREAD_SIGMASK = @GL_M4_GNULIB_PTHREAD_SIGMASK@
+GL_M4_GNULIB_PTHREAD_SPIN = @GL_M4_GNULIB_PTHREAD_SPIN@
+GL_M4_GNULIB_PTHREAD_THREAD = @GL_M4_GNULIB_PTHREAD_THREAD@
+GL_M4_GNULIB_PTHREAD_TSS = @GL_M4_GNULIB_PTHREAD_TSS@
+GL_M4_GNULIB_PTSNAME = @GL_M4_GNULIB_PTSNAME@
+GL_M4_GNULIB_PTSNAME_R = @GL_M4_GNULIB_PTSNAME_R@
+GL_M4_GNULIB_PUTC = @GL_M4_GNULIB_PUTC@
+GL_M4_GNULIB_PUTCHAR = @GL_M4_GNULIB_PUTCHAR@
+GL_M4_GNULIB_PUTENV = @GL_M4_GNULIB_PUTENV@
+GL_M4_GNULIB_PUTS = @GL_M4_GNULIB_PUTS@
+GL_M4_GNULIB_PWRITE = @GL_M4_GNULIB_PWRITE@
+GL_M4_GNULIB_QSORT_R = @GL_M4_GNULIB_QSORT_R@
+GL_M4_GNULIB_RAISE = @GL_M4_GNULIB_RAISE@
+GL_M4_GNULIB_RANDOM = @GL_M4_GNULIB_RANDOM@
+GL_M4_GNULIB_RANDOM_R = @GL_M4_GNULIB_RANDOM_R@
+GL_M4_GNULIB_RAWMEMCHR = @GL_M4_GNULIB_RAWMEMCHR@
+GL_M4_GNULIB_READ = @GL_M4_GNULIB_READ@
+GL_M4_GNULIB_READDIR = @GL_M4_GNULIB_READDIR@
+GL_M4_GNULIB_READLINK = @GL_M4_GNULIB_READLINK@
+GL_M4_GNULIB_READLINKAT = @GL_M4_GNULIB_READLINKAT@
+GL_M4_GNULIB_REALLOCARRAY = @GL_M4_GNULIB_REALLOCARRAY@
+GL_M4_GNULIB_REALLOC_POSIX = @GL_M4_GNULIB_REALLOC_POSIX@
+GL_M4_GNULIB_REALPATH = @GL_M4_GNULIB_REALPATH@
+GL_M4_GNULIB_RECV = @GL_M4_GNULIB_RECV@
+GL_M4_GNULIB_RECVFROM = @GL_M4_GNULIB_RECVFROM@
+GL_M4_GNULIB_REMAINDER = @GL_M4_GNULIB_REMAINDER@
+GL_M4_GNULIB_REMAINDERF = @GL_M4_GNULIB_REMAINDERF@
+GL_M4_GNULIB_REMAINDERL = @GL_M4_GNULIB_REMAINDERL@
+GL_M4_GNULIB_REMOVE = @GL_M4_GNULIB_REMOVE@
+GL_M4_GNULIB_RENAME = @GL_M4_GNULIB_RENAME@
+GL_M4_GNULIB_RENAMEAT = @GL_M4_GNULIB_RENAMEAT@
+GL_M4_GNULIB_REWINDDIR = @GL_M4_GNULIB_REWINDDIR@
+GL_M4_GNULIB_RINT = @GL_M4_GNULIB_RINT@
+GL_M4_GNULIB_RINTF = @GL_M4_GNULIB_RINTF@
+GL_M4_GNULIB_RINTL = @GL_M4_GNULIB_RINTL@
+GL_M4_GNULIB_RMDIR = @GL_M4_GNULIB_RMDIR@
+GL_M4_GNULIB_ROUND = @GL_M4_GNULIB_ROUND@
+GL_M4_GNULIB_ROUNDF = @GL_M4_GNULIB_ROUNDF@
+GL_M4_GNULIB_ROUNDL = @GL_M4_GNULIB_ROUNDL@
+GL_M4_GNULIB_RPMATCH = @GL_M4_GNULIB_RPMATCH@
+GL_M4_GNULIB_SCANDIR = @GL_M4_GNULIB_SCANDIR@
+GL_M4_GNULIB_SCANF = @GL_M4_GNULIB_SCANF@
+GL_M4_GNULIB_SCHED_YIELD = @GL_M4_GNULIB_SCHED_YIELD@
+GL_M4_GNULIB_SECURE_GETENV = @GL_M4_GNULIB_SECURE_GETENV@
+GL_M4_GNULIB_SELECT = @GL_M4_GNULIB_SELECT@
+GL_M4_GNULIB_SEND = @GL_M4_GNULIB_SEND@
+GL_M4_GNULIB_SENDTO = @GL_M4_GNULIB_SENDTO@
+GL_M4_GNULIB_SETENV = @GL_M4_GNULIB_SETENV@
+GL_M4_GNULIB_SETHOSTNAME = @GL_M4_GNULIB_SETHOSTNAME@
+GL_M4_GNULIB_SETLOCALE = @GL_M4_GNULIB_SETLOCALE@
+GL_M4_GNULIB_SETLOCALE_NULL = @GL_M4_GNULIB_SETLOCALE_NULL@
+GL_M4_GNULIB_SETSOCKOPT = @GL_M4_GNULIB_SETSOCKOPT@
+GL_M4_GNULIB_SHUTDOWN = @GL_M4_GNULIB_SHUTDOWN@
+GL_M4_GNULIB_SIGABBREV_NP = @GL_M4_GNULIB_SIGABBREV_NP@
+GL_M4_GNULIB_SIGACTION = @GL_M4_GNULIB_SIGACTION@
+GL_M4_GNULIB_SIGDESCR_NP = @GL_M4_GNULIB_SIGDESCR_NP@
+GL_M4_GNULIB_SIGNAL_H_SIGPIPE = @GL_M4_GNULIB_SIGNAL_H_SIGPIPE@
+GL_M4_GNULIB_SIGNBIT = @GL_M4_GNULIB_SIGNBIT@
+GL_M4_GNULIB_SIGPROCMASK = @GL_M4_GNULIB_SIGPROCMASK@
+GL_M4_GNULIB_SINF = @GL_M4_GNULIB_SINF@
+GL_M4_GNULIB_SINHF = @GL_M4_GNULIB_SINHF@
+GL_M4_GNULIB_SINL = @GL_M4_GNULIB_SINL@
+GL_M4_GNULIB_SLEEP = @GL_M4_GNULIB_SLEEP@
+GL_M4_GNULIB_SNPRINTF = @GL_M4_GNULIB_SNPRINTF@
+GL_M4_GNULIB_SOCKET = @GL_M4_GNULIB_SOCKET@
+GL_M4_GNULIB_SPRINTF_POSIX = @GL_M4_GNULIB_SPRINTF_POSIX@
+GL_M4_GNULIB_SQRTF = @GL_M4_GNULIB_SQRTF@
+GL_M4_GNULIB_SQRTL = @GL_M4_GNULIB_SQRTL@
+GL_M4_GNULIB_STAT = @GL_M4_GNULIB_STAT@
+GL_M4_GNULIB_STDIO_H_NONBLOCKING = @GL_M4_GNULIB_STDIO_H_NONBLOCKING@
+GL_M4_GNULIB_STDIO_H_SIGPIPE = @GL_M4_GNULIB_STDIO_H_SIGPIPE@
+GL_M4_GNULIB_STPCPY = @GL_M4_GNULIB_STPCPY@
+GL_M4_GNULIB_STPNCPY = @GL_M4_GNULIB_STPNCPY@
+GL_M4_GNULIB_STRCASESTR = @GL_M4_GNULIB_STRCASESTR@
+GL_M4_GNULIB_STRCHRNUL = @GL_M4_GNULIB_STRCHRNUL@
+GL_M4_GNULIB_STRDUP = @GL_M4_GNULIB_STRDUP@
+GL_M4_GNULIB_STRERROR = @GL_M4_GNULIB_STRERROR@
+GL_M4_GNULIB_STRERRORNAME_NP = @GL_M4_GNULIB_STRERRORNAME_NP@
+GL_M4_GNULIB_STRERROR_R = @GL_M4_GNULIB_STRERROR_R@
+GL_M4_GNULIB_STRFTIME = @GL_M4_GNULIB_STRFTIME@
+GL_M4_GNULIB_STRNCAT = @GL_M4_GNULIB_STRNCAT@
+GL_M4_GNULIB_STRNDUP = @GL_M4_GNULIB_STRNDUP@
+GL_M4_GNULIB_STRNLEN = @GL_M4_GNULIB_STRNLEN@
+GL_M4_GNULIB_STRPBRK = @GL_M4_GNULIB_STRPBRK@
+GL_M4_GNULIB_STRPTIME = @GL_M4_GNULIB_STRPTIME@
+GL_M4_GNULIB_STRSEP = @GL_M4_GNULIB_STRSEP@
+GL_M4_GNULIB_STRSIGNAL = @GL_M4_GNULIB_STRSIGNAL@
+GL_M4_GNULIB_STRSTR = @GL_M4_GNULIB_STRSTR@
+GL_M4_GNULIB_STRTOD = @GL_M4_GNULIB_STRTOD@
+GL_M4_GNULIB_STRTOIMAX = @GL_M4_GNULIB_STRTOIMAX@
+GL_M4_GNULIB_STRTOK_R = @GL_M4_GNULIB_STRTOK_R@
+GL_M4_GNULIB_STRTOL = @GL_M4_GNULIB_STRTOL@
+GL_M4_GNULIB_STRTOLD = @GL_M4_GNULIB_STRTOLD@
+GL_M4_GNULIB_STRTOLL = @GL_M4_GNULIB_STRTOLL@
+GL_M4_GNULIB_STRTOUL = @GL_M4_GNULIB_STRTOUL@
+GL_M4_GNULIB_STRTOULL = @GL_M4_GNULIB_STRTOULL@
+GL_M4_GNULIB_STRTOUMAX = @GL_M4_GNULIB_STRTOUMAX@
+GL_M4_GNULIB_STRVERSCMP = @GL_M4_GNULIB_STRVERSCMP@
+GL_M4_GNULIB_SYMLINK = @GL_M4_GNULIB_SYMLINK@
+GL_M4_GNULIB_SYMLINKAT = @GL_M4_GNULIB_SYMLINKAT@
+GL_M4_GNULIB_SYSTEM_POSIX = @GL_M4_GNULIB_SYSTEM_POSIX@
+GL_M4_GNULIB_TANF = @GL_M4_GNULIB_TANF@
+GL_M4_GNULIB_TANHF = @GL_M4_GNULIB_TANHF@
+GL_M4_GNULIB_TANL = @GL_M4_GNULIB_TANL@
+GL_M4_GNULIB_TIMEGM = @GL_M4_GNULIB_TIMEGM@
+GL_M4_GNULIB_TIMESPEC_GET = @GL_M4_GNULIB_TIMESPEC_GET@
+GL_M4_GNULIB_TIME_R = @GL_M4_GNULIB_TIME_R@
+GL_M4_GNULIB_TIME_RZ = @GL_M4_GNULIB_TIME_RZ@
+GL_M4_GNULIB_TMPFILE = @GL_M4_GNULIB_TMPFILE@
+GL_M4_GNULIB_TOWCTRANS = @GL_M4_GNULIB_TOWCTRANS@
+GL_M4_GNULIB_TRUNC = @GL_M4_GNULIB_TRUNC@
+GL_M4_GNULIB_TRUNCATE = @GL_M4_GNULIB_TRUNCATE@
+GL_M4_GNULIB_TRUNCF = @GL_M4_GNULIB_TRUNCF@
+GL_M4_GNULIB_TRUNCL = @GL_M4_GNULIB_TRUNCL@
+GL_M4_GNULIB_TTYNAME_R = @GL_M4_GNULIB_TTYNAME_R@
+GL_M4_GNULIB_TZSET = @GL_M4_GNULIB_TZSET@
+GL_M4_GNULIB_UNISTD_H_NONBLOCKING = @GL_M4_GNULIB_UNISTD_H_NONBLOCKING@
+GL_M4_GNULIB_UNISTD_H_SIGPIPE = @GL_M4_GNULIB_UNISTD_H_SIGPIPE@
+GL_M4_GNULIB_UNLINK = @GL_M4_GNULIB_UNLINK@
+GL_M4_GNULIB_UNLINKAT = @GL_M4_GNULIB_UNLINKAT@
+GL_M4_GNULIB_UNLOCKPT = @GL_M4_GNULIB_UNLOCKPT@
+GL_M4_GNULIB_UNSETENV = @GL_M4_GNULIB_UNSETENV@
+GL_M4_GNULIB_USLEEP = @GL_M4_GNULIB_USLEEP@
+GL_M4_GNULIB_UTIMENSAT = @GL_M4_GNULIB_UTIMENSAT@
+GL_M4_GNULIB_VASPRINTF = @GL_M4_GNULIB_VASPRINTF@
+GL_M4_GNULIB_VDPRINTF = @GL_M4_GNULIB_VDPRINTF@
+GL_M4_GNULIB_VFPRINTF = @GL_M4_GNULIB_VFPRINTF@
+GL_M4_GNULIB_VFPRINTF_POSIX = @GL_M4_GNULIB_VFPRINTF_POSIX@
+GL_M4_GNULIB_VFSCANF = @GL_M4_GNULIB_VFSCANF@
+GL_M4_GNULIB_VPRINTF = @GL_M4_GNULIB_VPRINTF@
+GL_M4_GNULIB_VPRINTF_POSIX = @GL_M4_GNULIB_VPRINTF_POSIX@
+GL_M4_GNULIB_VSCANF = @GL_M4_GNULIB_VSCANF@
+GL_M4_GNULIB_VSNPRINTF = @GL_M4_GNULIB_VSNPRINTF@
+GL_M4_GNULIB_VSPRINTF_POSIX = @GL_M4_GNULIB_VSPRINTF_POSIX@
+GL_M4_GNULIB_WAITPID = @GL_M4_GNULIB_WAITPID@
+GL_M4_GNULIB_WCPCPY = @GL_M4_GNULIB_WCPCPY@
+GL_M4_GNULIB_WCPNCPY = @GL_M4_GNULIB_WCPNCPY@
+GL_M4_GNULIB_WCRTOMB = @GL_M4_GNULIB_WCRTOMB@
+GL_M4_GNULIB_WCSCASECMP = @GL_M4_GNULIB_WCSCASECMP@
+GL_M4_GNULIB_WCSCAT = @GL_M4_GNULIB_WCSCAT@
+GL_M4_GNULIB_WCSCHR = @GL_M4_GNULIB_WCSCHR@
+GL_M4_GNULIB_WCSCMP = @GL_M4_GNULIB_WCSCMP@
+GL_M4_GNULIB_WCSCOLL = @GL_M4_GNULIB_WCSCOLL@
+GL_M4_GNULIB_WCSCPY = @GL_M4_GNULIB_WCSCPY@
+GL_M4_GNULIB_WCSCSPN = @GL_M4_GNULIB_WCSCSPN@
+GL_M4_GNULIB_WCSDUP = @GL_M4_GNULIB_WCSDUP@
+GL_M4_GNULIB_WCSFTIME = @GL_M4_GNULIB_WCSFTIME@
+GL_M4_GNULIB_WCSLEN = @GL_M4_GNULIB_WCSLEN@
+GL_M4_GNULIB_WCSNCASECMP = @GL_M4_GNULIB_WCSNCASECMP@
+GL_M4_GNULIB_WCSNCAT = @GL_M4_GNULIB_WCSNCAT@
+GL_M4_GNULIB_WCSNCMP = @GL_M4_GNULIB_WCSNCMP@
+GL_M4_GNULIB_WCSNCPY = @GL_M4_GNULIB_WCSNCPY@
+GL_M4_GNULIB_WCSNLEN = @GL_M4_GNULIB_WCSNLEN@
+GL_M4_GNULIB_WCSNRTOMBS = @GL_M4_GNULIB_WCSNRTOMBS@
+GL_M4_GNULIB_WCSPBRK = @GL_M4_GNULIB_WCSPBRK@
+GL_M4_GNULIB_WCSRCHR = @GL_M4_GNULIB_WCSRCHR@
+GL_M4_GNULIB_WCSRTOMBS = @GL_M4_GNULIB_WCSRTOMBS@
+GL_M4_GNULIB_WCSSPN = @GL_M4_GNULIB_WCSSPN@
+GL_M4_GNULIB_WCSSTR = @GL_M4_GNULIB_WCSSTR@
+GL_M4_GNULIB_WCSTOK = @GL_M4_GNULIB_WCSTOK@
+GL_M4_GNULIB_WCSWIDTH = @GL_M4_GNULIB_WCSWIDTH@
+GL_M4_GNULIB_WCSXFRM = @GL_M4_GNULIB_WCSXFRM@
+GL_M4_GNULIB_WCTOB = @GL_M4_GNULIB_WCTOB@
+GL_M4_GNULIB_WCTOMB = @GL_M4_GNULIB_WCTOMB@
+GL_M4_GNULIB_WCTRANS = @GL_M4_GNULIB_WCTRANS@
+GL_M4_GNULIB_WCTYPE = @GL_M4_GNULIB_WCTYPE@
+GL_M4_GNULIB_WCWIDTH = @GL_M4_GNULIB_WCWIDTH@
+GL_M4_GNULIB_WMEMCHR = @GL_M4_GNULIB_WMEMCHR@
+GL_M4_GNULIB_WMEMCMP = @GL_M4_GNULIB_WMEMCMP@
+GL_M4_GNULIB_WMEMCPY = @GL_M4_GNULIB_WMEMCPY@
+GL_M4_GNULIB_WMEMMOVE = @GL_M4_GNULIB_WMEMMOVE@
+GL_M4_GNULIB_WMEMPCPY = @GL_M4_GNULIB_WMEMPCPY@
+GL_M4_GNULIB_WMEMSET = @GL_M4_GNULIB_WMEMSET@
+GL_M4_GNULIB_WRITE = @GL_M4_GNULIB_WRITE@
+GL_M4_GNULIB__EXIT = @GL_M4_GNULIB__EXIT@
+GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
+GNULIBHEADERS_OVERRIDE_WINT_T = @GNULIBHEADERS_OVERRIDE_WINT_T@
 GNULIB_GETTIMEOFDAY = @GNULIB_GETTIMEOFDAY@
-GNULIB_GETUSERSHELL = @GNULIB_GETUSERSHELL@
 GNULIB_GL_M4_UNISTD_H_GETOPT = @GNULIB_GL_M4_UNISTD_H_GETOPT@
-GNULIB_GRANTPT = @GNULIB_GRANTPT@
-GNULIB_GROUP_MEMBER = @GNULIB_GROUP_MEMBER@
-GNULIB_HYPOT = @GNULIB_HYPOT@
-GNULIB_HYPOTF = @GNULIB_HYPOTF@
-GNULIB_HYPOTL = @GNULIB_HYPOTL@
-GNULIB_ILOGB = @GNULIB_ILOGB@
-GNULIB_ILOGBF = @GNULIB_ILOGBF@
-GNULIB_ILOGBL = @GNULIB_ILOGBL@
-GNULIB_IMAXABS = @GNULIB_IMAXABS@
-GNULIB_IMAXDIV = @GNULIB_IMAXDIV@
-GNULIB_ISATTY = @GNULIB_ISATTY@
-GNULIB_ISBLANK = @GNULIB_ISBLANK@
-GNULIB_ISFINITE = @GNULIB_ISFINITE@
-GNULIB_ISINF = @GNULIB_ISINF@
-GNULIB_ISNAN = @GNULIB_ISNAN@
-GNULIB_ISNAND = @GNULIB_ISNAND@
-GNULIB_ISNANF = @GNULIB_ISNANF@
-GNULIB_ISNANL = @GNULIB_ISNANL@
-GNULIB_ISWBLANK = @GNULIB_ISWBLANK@
-GNULIB_ISWCTYPE = @GNULIB_ISWCTYPE@
-GNULIB_LCHMOD = @GNULIB_LCHMOD@
-GNULIB_LCHOWN = @GNULIB_LCHOWN@
-GNULIB_LDEXPF = @GNULIB_LDEXPF@
-GNULIB_LDEXPL = @GNULIB_LDEXPL@
-GNULIB_LINK = @GNULIB_LINK@
-GNULIB_LINKAT = @GNULIB_LINKAT@
-GNULIB_LOCALECONV = @GNULIB_LOCALECONV@
-GNULIB_LOG = @GNULIB_LOG@
-GNULIB_LOG10 = @GNULIB_LOG10@
-GNULIB_LOG10F = @GNULIB_LOG10F@
-GNULIB_LOG10L = @GNULIB_LOG10L@
-GNULIB_LOG1P = @GNULIB_LOG1P@
-GNULIB_LOG1PF = @GNULIB_LOG1PF@
-GNULIB_LOG1PL = @GNULIB_LOG1PL@
-GNULIB_LOG2 = @GNULIB_LOG2@
-GNULIB_LOG2F = @GNULIB_LOG2F@
-GNULIB_LOG2L = @GNULIB_LOG2L@
-GNULIB_LOGB = @GNULIB_LOGB@
-GNULIB_LOGBF = @GNULIB_LOGBF@
-GNULIB_LOGBL = @GNULIB_LOGBL@
-GNULIB_LOGF = @GNULIB_LOGF@
-GNULIB_LOGL = @GNULIB_LOGL@
-GNULIB_LSEEK = @GNULIB_LSEEK@
-GNULIB_LSTAT = @GNULIB_LSTAT@
-GNULIB_MALLOC_POSIX = @GNULIB_MALLOC_POSIX@
-GNULIB_MBRLEN = @GNULIB_MBRLEN@
-GNULIB_MBRTOWC = @GNULIB_MBRTOWC@
-GNULIB_MBSCASECMP = @GNULIB_MBSCASECMP@
-GNULIB_MBSCASESTR = @GNULIB_MBSCASESTR@
-GNULIB_MBSCHR = @GNULIB_MBSCHR@
-GNULIB_MBSCSPN = @GNULIB_MBSCSPN@
-GNULIB_MBSINIT = @GNULIB_MBSINIT@
-GNULIB_MBSLEN = @GNULIB_MBSLEN@
-GNULIB_MBSNCASECMP = @GNULIB_MBSNCASECMP@
-GNULIB_MBSNLEN = @GNULIB_MBSNLEN@
-GNULIB_MBSNRTOWCS = @GNULIB_MBSNRTOWCS@
-GNULIB_MBSPBRK = @GNULIB_MBSPBRK@
-GNULIB_MBSPCASECMP = @GNULIB_MBSPCASECMP@
-GNULIB_MBSRCHR = @GNULIB_MBSRCHR@
-GNULIB_MBSRTOWCS = @GNULIB_MBSRTOWCS@
-GNULIB_MBSSEP = @GNULIB_MBSSEP@
-GNULIB_MBSSPN = @GNULIB_MBSSPN@
-GNULIB_MBSSTR = @GNULIB_MBSSTR@
-GNULIB_MBSTOK_R = @GNULIB_MBSTOK_R@
-GNULIB_MBTOWC = @GNULIB_MBTOWC@
-GNULIB_MEMCHR = @GNULIB_MEMCHR@
-GNULIB_MEMMEM = @GNULIB_MEMMEM@
-GNULIB_MEMPCPY = @GNULIB_MEMPCPY@
-GNULIB_MEMRCHR = @GNULIB_MEMRCHR@
-GNULIB_MKDIRAT = @GNULIB_MKDIRAT@
-GNULIB_MKDTEMP = @GNULIB_MKDTEMP@
-GNULIB_MKFIFO = @GNULIB_MKFIFO@
-GNULIB_MKFIFOAT = @GNULIB_MKFIFOAT@
-GNULIB_MKNOD = @GNULIB_MKNOD@
-GNULIB_MKNODAT = @GNULIB_MKNODAT@
-GNULIB_MKOSTEMP = @GNULIB_MKOSTEMP@
-GNULIB_MKOSTEMPS = @GNULIB_MKOSTEMPS@
-GNULIB_MKSTEMP = @GNULIB_MKSTEMP@
-GNULIB_MKSTEMPS = @GNULIB_MKSTEMPS@
-GNULIB_MKTIME = @GNULIB_MKTIME@
-GNULIB_MODF = @GNULIB_MODF@
-GNULIB_MODFF = @GNULIB_MODFF@
-GNULIB_MODFL = @GNULIB_MODFL@
-GNULIB_NANOSLEEP = @GNULIB_NANOSLEEP@
-GNULIB_NL_LANGINFO = @GNULIB_NL_LANGINFO@
-GNULIB_NONBLOCKING = @GNULIB_NONBLOCKING@
-GNULIB_OBSTACK_PRINTF = @GNULIB_OBSTACK_PRINTF@
-GNULIB_OBSTACK_PRINTF_POSIX = @GNULIB_OBSTACK_PRINTF_POSIX@
-GNULIB_OPEN = @GNULIB_OPEN@
-GNULIB_OPENAT = @GNULIB_OPENAT@
-GNULIB_OPENDIR = @GNULIB_OPENDIR@
-GNULIB_OVERRIDES_WINT_T = @GNULIB_OVERRIDES_WINT_T@
-GNULIB_PCLOSE = @GNULIB_PCLOSE@
-GNULIB_PERROR = @GNULIB_PERROR@
-GNULIB_PIPE = @GNULIB_PIPE@
-GNULIB_PIPE2 = @GNULIB_PIPE2@
-GNULIB_POPEN = @GNULIB_POPEN@
-GNULIB_POSIX_OPENPT = @GNULIB_POSIX_OPENPT@
-GNULIB_POSIX_SPAWN = @GNULIB_POSIX_SPAWN@
-GNULIB_POSIX_SPAWNATTR_DESTROY = @GNULIB_POSIX_SPAWNATTR_DESTROY@
-GNULIB_POSIX_SPAWNATTR_GETFLAGS = @GNULIB_POSIX_SPAWNATTR_GETFLAGS@
-GNULIB_POSIX_SPAWNATTR_GETPGROUP = @GNULIB_POSIX_SPAWNATTR_GETPGROUP@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_GETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_GETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_GETSIGMASK = @GNULIB_POSIX_SPAWNATTR_GETSIGMASK@
-GNULIB_POSIX_SPAWNATTR_INIT = @GNULIB_POSIX_SPAWNATTR_INIT@
-GNULIB_POSIX_SPAWNATTR_SETFLAGS = @GNULIB_POSIX_SPAWNATTR_SETFLAGS@
-GNULIB_POSIX_SPAWNATTR_SETPGROUP = @GNULIB_POSIX_SPAWNATTR_SETPGROUP@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPARAM@
-GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY = @GNULIB_POSIX_SPAWNATTR_SETSCHEDPOLICY@
-GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT = @GNULIB_POSIX_SPAWNATTR_SETSIGDEFAULT@
-GNULIB_POSIX_SPAWNATTR_SETSIGMASK = @GNULIB_POSIX_SPAWNATTR_SETSIGMASK@
-GNULIB_POSIX_SPAWNP = @GNULIB_POSIX_SPAWNP@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_DESTROY@
-GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT = @GNULIB_POSIX_SPAWN_FILE_ACTIONS_INIT@
-GNULIB_POWF = @GNULIB_POWF@
-GNULIB_PREAD = @GNULIB_PREAD@
-GNULIB_PRINTF = @GNULIB_PRINTF@
-GNULIB_PRINTF_POSIX = @GNULIB_PRINTF_POSIX@
-GNULIB_PTHREAD_SIGMASK = @GNULIB_PTHREAD_SIGMASK@
-GNULIB_PTSNAME = @GNULIB_PTSNAME@
-GNULIB_PTSNAME_R = @GNULIB_PTSNAME_R@
-GNULIB_PUTC = @GNULIB_PUTC@
-GNULIB_PUTCHAR = @GNULIB_PUTCHAR@
-GNULIB_PUTENV = @GNULIB_PUTENV@
-GNULIB_PUTS = @GNULIB_PUTS@
-GNULIB_PWRITE = @GNULIB_PWRITE@
-GNULIB_QSORT_R = @GNULIB_QSORT_R@
-GNULIB_RAISE = @GNULIB_RAISE@
-GNULIB_RANDOM = @GNULIB_RANDOM@
-GNULIB_RANDOM_R = @GNULIB_RANDOM_R@
-GNULIB_RAWMEMCHR = @GNULIB_RAWMEMCHR@
-GNULIB_READ = @GNULIB_READ@
-GNULIB_READDIR = @GNULIB_READDIR@
-GNULIB_READLINK = @GNULIB_READLINK@
-GNULIB_READLINKAT = @GNULIB_READLINKAT@
-GNULIB_REALLOC_POSIX = @GNULIB_REALLOC_POSIX@
-GNULIB_REALPATH = @GNULIB_REALPATH@
-GNULIB_REMAINDER = @GNULIB_REMAINDER@
-GNULIB_REMAINDERF = @GNULIB_REMAINDERF@
-GNULIB_REMAINDERL = @GNULIB_REMAINDERL@
-GNULIB_REMOVE = @GNULIB_REMOVE@
-GNULIB_RENAME = @GNULIB_RENAME@
-GNULIB_RENAMEAT = @GNULIB_RENAMEAT@
-GNULIB_REWINDDIR = @GNULIB_REWINDDIR@
-GNULIB_RINT = @GNULIB_RINT@
-GNULIB_RINTF = @GNULIB_RINTF@
-GNULIB_RINTL = @GNULIB_RINTL@
-GNULIB_RMDIR = @GNULIB_RMDIR@
-GNULIB_ROUND = @GNULIB_ROUND@
-GNULIB_ROUNDF = @GNULIB_ROUNDF@
-GNULIB_ROUNDL = @GNULIB_ROUNDL@
-GNULIB_RPMATCH = @GNULIB_RPMATCH@
-GNULIB_SCANDIR = @GNULIB_SCANDIR@
-GNULIB_SCANF = @GNULIB_SCANF@
-GNULIB_SECURE_GETENV = @GNULIB_SECURE_GETENV@
-GNULIB_SETENV = @GNULIB_SETENV@
-GNULIB_SETHOSTNAME = @GNULIB_SETHOSTNAME@
-GNULIB_SETLOCALE = @GNULIB_SETLOCALE@
-GNULIB_SIGACTION = @GNULIB_SIGACTION@
-GNULIB_SIGNAL_H_SIGPIPE = @GNULIB_SIGNAL_H_SIGPIPE@
-GNULIB_SIGNBIT = @GNULIB_SIGNBIT@
-GNULIB_SIGPROCMASK = @GNULIB_SIGPROCMASK@
-GNULIB_SINF = @GNULIB_SINF@
-GNULIB_SINHF = @GNULIB_SINHF@
-GNULIB_SINL = @GNULIB_SINL@
-GNULIB_SLEEP = @GNULIB_SLEEP@
-GNULIB_SNPRINTF = @GNULIB_SNPRINTF@
-GNULIB_SPRINTF_POSIX = @GNULIB_SPRINTF_POSIX@
-GNULIB_SQRTF = @GNULIB_SQRTF@
-GNULIB_SQRTL = @GNULIB_SQRTL@
-GNULIB_STAT = @GNULIB_STAT@
-GNULIB_STDIO_H_NONBLOCKING = @GNULIB_STDIO_H_NONBLOCKING@
-GNULIB_STDIO_H_SIGPIPE = @GNULIB_STDIO_H_SIGPIPE@
-GNULIB_STPCPY = @GNULIB_STPCPY@
-GNULIB_STPNCPY = @GNULIB_STPNCPY@
-GNULIB_STRCASESTR = @GNULIB_STRCASESTR@
-GNULIB_STRCHRNUL = @GNULIB_STRCHRNUL@
-GNULIB_STRDUP = @GNULIB_STRDUP@
-GNULIB_STRERROR = @GNULIB_STRERROR@
-GNULIB_STRERROR_R = @GNULIB_STRERROR_R@
-GNULIB_STRNCAT = @GNULIB_STRNCAT@
-GNULIB_STRNDUP = @GNULIB_STRNDUP@
-GNULIB_STRNLEN = @GNULIB_STRNLEN@
-GNULIB_STRPBRK = @GNULIB_STRPBRK@
-GNULIB_STRPTIME = @GNULIB_STRPTIME@
-GNULIB_STRSEP = @GNULIB_STRSEP@
-GNULIB_STRSIGNAL = @GNULIB_STRSIGNAL@
-GNULIB_STRSTR = @GNULIB_STRSTR@
-GNULIB_STRTOD = @GNULIB_STRTOD@
-GNULIB_STRTOIMAX = @GNULIB_STRTOIMAX@
-GNULIB_STRTOK_R = @GNULIB_STRTOK_R@
-GNULIB_STRTOLL = @GNULIB_STRTOLL@
-GNULIB_STRTOULL = @GNULIB_STRTOULL@
-GNULIB_STRTOUMAX = @GNULIB_STRTOUMAX@
-GNULIB_STRVERSCMP = @GNULIB_STRVERSCMP@
-GNULIB_SYMLINK = @GNULIB_SYMLINK@
-GNULIB_SYMLINKAT = @GNULIB_SYMLINKAT@
-GNULIB_SYSTEM_POSIX = @GNULIB_SYSTEM_POSIX@
-GNULIB_TANF = @GNULIB_TANF@
-GNULIB_TANHF = @GNULIB_TANHF@
-GNULIB_TANL = @GNULIB_TANL@
-GNULIB_TIMEGM = @GNULIB_TIMEGM@
-GNULIB_TIME_R = @GNULIB_TIME_R@
-GNULIB_TIME_RZ = @GNULIB_TIME_RZ@
-GNULIB_TMPFILE = @GNULIB_TMPFILE@
-GNULIB_TOWCTRANS = @GNULIB_TOWCTRANS@
-GNULIB_TRUNC = @GNULIB_TRUNC@
-GNULIB_TRUNCF = @GNULIB_TRUNCF@
-GNULIB_TRUNCL = @GNULIB_TRUNCL@
-GNULIB_TTYNAME_R = @GNULIB_TTYNAME_R@
-GNULIB_UNISTD_H_NONBLOCKING = @GNULIB_UNISTD_H_NONBLOCKING@
-GNULIB_UNISTD_H_SIGPIPE = @GNULIB_UNISTD_H_SIGPIPE@
-GNULIB_UNLINK = @GNULIB_UNLINK@
-GNULIB_UNLINKAT = @GNULIB_UNLINKAT@
-GNULIB_UNLOCKPT = @GNULIB_UNLOCKPT@
-GNULIB_UNSETENV = @GNULIB_UNSETENV@
-GNULIB_USLEEP = @GNULIB_USLEEP@
-GNULIB_UTIMENSAT = @GNULIB_UTIMENSAT@
-GNULIB_VASPRINTF = @GNULIB_VASPRINTF@
-GNULIB_VDPRINTF = @GNULIB_VDPRINTF@
-GNULIB_VFPRINTF = @GNULIB_VFPRINTF@
-GNULIB_VFPRINTF_POSIX = @GNULIB_VFPRINTF_POSIX@
-GNULIB_VFSCANF = @GNULIB_VFSCANF@
-GNULIB_VPRINTF = @GNULIB_VPRINTF@
-GNULIB_VPRINTF_POSIX = @GNULIB_VPRINTF_POSIX@
-GNULIB_VSCANF = @GNULIB_VSCANF@
-GNULIB_VSNPRINTF = @GNULIB_VSNPRINTF@
-GNULIB_VSPRINTF_POSIX = @GNULIB_VSPRINTF_POSIX@
-GNULIB_WAITPID = @GNULIB_WAITPID@
-GNULIB_WCPCPY = @GNULIB_WCPCPY@
-GNULIB_WCPNCPY = @GNULIB_WCPNCPY@
-GNULIB_WCRTOMB = @GNULIB_WCRTOMB@
-GNULIB_WCSCASECMP = @GNULIB_WCSCASECMP@
-GNULIB_WCSCAT = @GNULIB_WCSCAT@
-GNULIB_WCSCHR = @GNULIB_WCSCHR@
-GNULIB_WCSCMP = @GNULIB_WCSCMP@
-GNULIB_WCSCOLL = @GNULIB_WCSCOLL@
-GNULIB_WCSCPY = @GNULIB_WCSCPY@
-GNULIB_WCSCSPN = @GNULIB_WCSCSPN@
-GNULIB_WCSDUP = @GNULIB_WCSDUP@
-GNULIB_WCSLEN = @GNULIB_WCSLEN@
-GNULIB_WCSNCASECMP = @GNULIB_WCSNCASECMP@
-GNULIB_WCSNCAT = @GNULIB_WCSNCAT@
-GNULIB_WCSNCMP = @GNULIB_WCSNCMP@
-GNULIB_WCSNCPY = @GNULIB_WCSNCPY@
-GNULIB_WCSNLEN = @GNULIB_WCSNLEN@
-GNULIB_WCSNRTOMBS = @GNULIB_WCSNRTOMBS@
-GNULIB_WCSPBRK = @GNULIB_WCSPBRK@
-GNULIB_WCSRCHR = @GNULIB_WCSRCHR@
-GNULIB_WCSRTOMBS = @GNULIB_WCSRTOMBS@
-GNULIB_WCSSPN = @GNULIB_WCSSPN@
-GNULIB_WCSSTR = @GNULIB_WCSSTR@
-GNULIB_WCSTOK = @GNULIB_WCSTOK@
-GNULIB_WCSWIDTH = @GNULIB_WCSWIDTH@
-GNULIB_WCSXFRM = @GNULIB_WCSXFRM@
-GNULIB_WCTOB = @GNULIB_WCTOB@
-GNULIB_WCTOMB = @GNULIB_WCTOMB@
-GNULIB_WCTRANS = @GNULIB_WCTRANS@
-GNULIB_WCTYPE = @GNULIB_WCTYPE@
-GNULIB_WCWIDTH = @GNULIB_WCWIDTH@
-GNULIB_WMEMCHR = @GNULIB_WMEMCHR@
-GNULIB_WMEMCMP = @GNULIB_WMEMCMP@
-GNULIB_WMEMCPY = @GNULIB_WMEMCPY@
-GNULIB_WMEMMOVE = @GNULIB_WMEMMOVE@
-GNULIB_WMEMSET = @GNULIB_WMEMSET@
-GNULIB_WRITE = @GNULIB_WRITE@
-GNULIB__EXIT = @GNULIB__EXIT@
 GREP = @GREP@
+HAVE_ACCEPT4 = @HAVE_ACCEPT4@
 HAVE_ACOSF = @HAVE_ACOSF@
 HAVE_ACOSL = @HAVE_ACOSL@
+HAVE_ALIGNED_ALLOC = @HAVE_ALIGNED_ALLOC@
+HAVE_ALLOCA_H = @HAVE_ALLOCA_H@
 HAVE_ALPHASORT = @HAVE_ALPHASORT@
+HAVE_ARPA_INET_H = @HAVE_ARPA_INET_H@
 HAVE_ASINF = @HAVE_ASINF@
 HAVE_ASINL = @HAVE_ASINL@
 HAVE_ATAN2F = @HAVE_ATAN2F@
@@ -2167,9 +3332,11 @@ HAVE_CHOWN = @HAVE_CHOWN@
 HAVE_CLOSEDIR = @HAVE_CLOSEDIR@
 HAVE_COPYSIGN = @HAVE_COPYSIGN@
 HAVE_COPYSIGNL = @HAVE_COPYSIGNL@
+HAVE_COPY_FILE_RANGE = @HAVE_COPY_FILE_RANGE@
 HAVE_COSF = @HAVE_COSF@
 HAVE_COSHF = @HAVE_COSHF@
 HAVE_COSL = @HAVE_COSL@
+HAVE_CRTDEFS_H = @HAVE_CRTDEFS_H@
 HAVE_DECL_ACOSL = @HAVE_DECL_ACOSL@
 HAVE_DECL_ASINL = @HAVE_DECL_ASINL@
 HAVE_DECL_ATANL = @HAVE_DECL_ATANL@
@@ -2180,13 +3347,17 @@ HAVE_DECL_CEILL = @HAVE_DECL_CEILL@
 HAVE_DECL_COPYSIGNF = @HAVE_DECL_COPYSIGNF@
 HAVE_DECL_COSL = @HAVE_DECL_COSL@
 HAVE_DECL_DIRFD = @HAVE_DECL_DIRFD@
+HAVE_DECL_ECVT = @HAVE_DECL_ECVT@
 HAVE_DECL_ENVIRON = @HAVE_DECL_ENVIRON@
+HAVE_DECL_EXECVPE = @HAVE_DECL_EXECVPE@
 HAVE_DECL_EXP2 = @HAVE_DECL_EXP2@
 HAVE_DECL_EXP2F = @HAVE_DECL_EXP2F@
 HAVE_DECL_EXP2L = @HAVE_DECL_EXP2L@
 HAVE_DECL_EXPL = @HAVE_DECL_EXPL@
 HAVE_DECL_EXPM1L = @HAVE_DECL_EXPM1L@
 HAVE_DECL_FCHDIR = @HAVE_DECL_FCHDIR@
+HAVE_DECL_FCLOSEALL = @HAVE_DECL_FCLOSEALL@
+HAVE_DECL_FCVT = @HAVE_DECL_FCVT@
 HAVE_DECL_FDATASYNC = @HAVE_DECL_FDATASYNC@
 HAVE_DECL_FDOPENDIR = @HAVE_DECL_FDOPENDIR@
 HAVE_DECL_FLOORF = @HAVE_DECL_FLOORF@
@@ -2195,6 +3366,7 @@ HAVE_DECL_FPURGE = @HAVE_DECL_FPURGE@
 HAVE_DECL_FREXPL = @HAVE_DECL_FREXPL@
 HAVE_DECL_FSEEKO = @HAVE_DECL_FSEEKO@
 HAVE_DECL_FTELLO = @HAVE_DECL_FTELLO@
+HAVE_DECL_GCVT = @HAVE_DECL_GCVT@
 HAVE_DECL_GETDELIM = @HAVE_DECL_GETDELIM@
 HAVE_DECL_GETDOMAINNAME = @HAVE_DECL_GETDOMAINNAME@
 HAVE_DECL_GETLINE = @HAVE_DECL_GETLINE@
@@ -2205,6 +3377,9 @@ HAVE_DECL_GETPAGESIZE = @HAVE_DECL_GETPAGESIZE@
 HAVE_DECL_GETUSERSHELL = @HAVE_DECL_GETUSERSHELL@
 HAVE_DECL_IMAXABS = @HAVE_DECL_IMAXABS@
 HAVE_DECL_IMAXDIV = @HAVE_DECL_IMAXDIV@
+HAVE_DECL_INET_NTOP = @HAVE_DECL_INET_NTOP@
+HAVE_DECL_INET_PTON = @HAVE_DECL_INET_PTON@
+HAVE_DECL_INITSTATE = @HAVE_DECL_INITSTATE@
 HAVE_DECL_LDEXPL = @HAVE_DECL_LDEXPL@
 HAVE_DECL_LOCALTIME_R = @HAVE_DECL_LOCALTIME_R@
 HAVE_DECL_LOG10L = @HAVE_DECL_LOG10L@
@@ -2224,6 +3399,7 @@ HAVE_DECL_ROUNDF = @HAVE_DECL_ROUNDF@
 HAVE_DECL_ROUNDL = @HAVE_DECL_ROUNDL@
 HAVE_DECL_SETENV = @HAVE_DECL_SETENV@
 HAVE_DECL_SETHOSTNAME = @HAVE_DECL_SETHOSTNAME@
+HAVE_DECL_SETSTATE = @HAVE_DECL_SETSTATE@
 HAVE_DECL_SINL = @HAVE_DECL_SINL@
 HAVE_DECL_SNPRINTF = @HAVE_DECL_SNPRINTF@
 HAVE_DECL_SQRTL = @HAVE_DECL_SQRTL@
@@ -2237,21 +3413,24 @@ HAVE_DECL_STRTOK_R = @HAVE_DECL_STRTOK_R@
 HAVE_DECL_STRTOUMAX = @HAVE_DECL_STRTOUMAX@
 HAVE_DECL_TANL = @HAVE_DECL_TANL@
 HAVE_DECL_TRUNC = @HAVE_DECL_TRUNC@
+HAVE_DECL_TRUNCATE = @HAVE_DECL_TRUNCATE@
 HAVE_DECL_TRUNCF = @HAVE_DECL_TRUNCF@
 HAVE_DECL_TRUNCL = @HAVE_DECL_TRUNCL@
 HAVE_DECL_TTYNAME_R = @HAVE_DECL_TTYNAME_R@
 HAVE_DECL_UNSETENV = @HAVE_DECL_UNSETENV@
 HAVE_DECL_VSNPRINTF = @HAVE_DECL_VSNPRINTF@
+HAVE_DECL_WCSDUP = @HAVE_DECL_WCSDUP@
 HAVE_DECL_WCTOB = @HAVE_DECL_WCTOB@
 HAVE_DECL_WCWIDTH = @HAVE_DECL_WCWIDTH@
 HAVE_DIRENT_H = @HAVE_DIRENT_H@
 HAVE_DPRINTF = @HAVE_DPRINTF@
-HAVE_DUP2 = @HAVE_DUP2@
 HAVE_DUP3 = @HAVE_DUP3@
 HAVE_DUPLOCALE = @HAVE_DUPLOCALE@
 HAVE_EUIDACCESS = @HAVE_EUIDACCESS@
+HAVE_EXECVPE = @HAVE_EXECVPE@
 HAVE_EXPF = @HAVE_EXPF@
 HAVE_EXPL = @HAVE_EXPL@
+HAVE_EXPLICIT_BZERO = @HAVE_EXPLICIT_BZERO@
 HAVE_EXPM1 = @HAVE_EXPM1@
 HAVE_EXPM1F = @HAVE_EXPM1F@
 HAVE_FABSF = @HAVE_FABSF@
@@ -2271,6 +3450,7 @@ HAVE_FMAF = @HAVE_FMAF@
 HAVE_FMAL = @HAVE_FMAL@
 HAVE_FMODF = @HAVE_FMODF@
 HAVE_FMODL = @HAVE_FMODL@
+HAVE_FREELOCALE = @HAVE_FREELOCALE@
 HAVE_FREXPF = @HAVE_FREXPF@
 HAVE_FSEEKO = @HAVE_FSEEKO@
 HAVE_FSTATAT = @HAVE_FSTATAT@
@@ -2279,13 +3459,17 @@ HAVE_FTELLO = @HAVE_FTELLO@
 HAVE_FTRUNCATE = @HAVE_FTRUNCATE@
 HAVE_FUTIMENS = @HAVE_FUTIMENS@
 HAVE_GETDTABLESIZE = @HAVE_GETDTABLESIZE@
+HAVE_GETENTROPY = @HAVE_GETENTROPY@
 HAVE_GETGROUPS = @HAVE_GETGROUPS@
 HAVE_GETHOSTNAME = @HAVE_GETHOSTNAME@
 HAVE_GETLOGIN = @HAVE_GETLOGIN@
 HAVE_GETOPT_H = @HAVE_GETOPT_H@
 HAVE_GETPAGESIZE = @HAVE_GETPAGESIZE@
+HAVE_GETPASS = @HAVE_GETPASS@
+HAVE_GETRANDOM = @HAVE_GETRANDOM@
 HAVE_GETSUBOPT = @HAVE_GETSUBOPT@
 HAVE_GETTIMEOFDAY = @HAVE_GETTIMEOFDAY@
+HAVE_GETUMASK = @HAVE_GETUMASK@
 HAVE_GRANTPT = @HAVE_GRANTPT@
 HAVE_GROUP_MEMBER = @HAVE_GROUP_MEMBER@
 HAVE_HYPOTF = @HAVE_HYPOTF@
@@ -2293,6 +3477,8 @@ HAVE_HYPOTL = @HAVE_HYPOTL@
 HAVE_ILOGB = @HAVE_ILOGB@
 HAVE_ILOGBF = @HAVE_ILOGBF@
 HAVE_ILOGBL = @HAVE_ILOGBL@
+HAVE_IMAXDIV_T = @HAVE_IMAXDIV_T@
+HAVE_INITSTATE = @HAVE_INITSTATE@
 HAVE_INTTYPES_H = @HAVE_INTTYPES_H@
 HAVE_ISBLANK = @HAVE_ISBLANK@
 HAVE_ISNAND = @HAVE_ISNAND@
@@ -2300,6 +3486,7 @@ HAVE_ISNANF = @HAVE_ISNANF@
 HAVE_ISNANL = @HAVE_ISNANL@
 HAVE_ISWBLANK = @HAVE_ISWBLANK@
 HAVE_ISWCNTRL = @HAVE_ISWCNTRL@
+HAVE_LANGINFO_ALTMON = @HAVE_LANGINFO_ALTMON@
 HAVE_LANGINFO_CODESET = @HAVE_LANGINFO_CODESET@
 HAVE_LANGINFO_ERA = @HAVE_LANGINFO_ERA@
 HAVE_LANGINFO_H = @HAVE_LANGINFO_H@
@@ -2320,7 +3507,6 @@ HAVE_LOGBF = @HAVE_LOGBF@
 HAVE_LOGBL = @HAVE_LOGBL@
 HAVE_LOGF = @HAVE_LOGF@
 HAVE_LOGL = @HAVE_LOGL@
-HAVE_LONG_LONG_INT = @HAVE_LONG_LONG_INT@
 HAVE_LSTAT = @HAVE_LSTAT@
 HAVE_MAX_ALIGN_T = @HAVE_MAX_ALIGN_T@
 HAVE_MBRLEN = @HAVE_MBRLEN@
@@ -2329,7 +3515,7 @@ HAVE_MBSINIT = @HAVE_MBSINIT@
 HAVE_MBSLEN = @HAVE_MBSLEN@
 HAVE_MBSNRTOWCS = @HAVE_MBSNRTOWCS@
 HAVE_MBSRTOWCS = @HAVE_MBSRTOWCS@
-HAVE_MEMCHR = @HAVE_MEMCHR@
+HAVE_MBTOWC = @HAVE_MBTOWC@
 HAVE_MEMPCPY = @HAVE_MEMPCPY@
 HAVE_MKDIRAT = @HAVE_MKDIRAT@
 HAVE_MKDTEMP = @HAVE_MKDTEMP@
@@ -2345,6 +3531,8 @@ HAVE_MODFF = @HAVE_MODFF@
 HAVE_MODFL = @HAVE_MODFL@
 HAVE_MSVC_INVALID_PARAMETER_HANDLER = @HAVE_MSVC_INVALID_PARAMETER_HANDLER@
 HAVE_NANOSLEEP = @HAVE_NANOSLEEP@
+HAVE_NETINET_IN_H = @HAVE_NETINET_IN_H@
+HAVE_NEWLOCALE = @HAVE_NEWLOCALE@
 HAVE_NL_LANGINFO = @HAVE_NL_LANGINFO@
 HAVE_OPENAT = @HAVE_OPENAT@
 HAVE_OPENDIR = @HAVE_OPENDIR@
@@ -2353,14 +3541,76 @@ HAVE_PCLOSE = @HAVE_PCLOSE@
 HAVE_PIPE = @HAVE_PIPE@
 HAVE_PIPE2 = @HAVE_PIPE2@
 HAVE_POPEN = @HAVE_POPEN@
+HAVE_POSIX_MEMALIGN = @HAVE_POSIX_MEMALIGN@
 HAVE_POSIX_OPENPT = @HAVE_POSIX_OPENPT@
 HAVE_POSIX_SIGNALBLOCKING = @HAVE_POSIX_SIGNALBLOCKING@
 HAVE_POSIX_SPAWN = @HAVE_POSIX_SPAWN@
 HAVE_POSIX_SPAWNATTR_T = @HAVE_POSIX_SPAWNATTR_T@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
+HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @HAVE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 HAVE_POSIX_SPAWN_FILE_ACTIONS_T = @HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
 HAVE_POWF = @HAVE_POWF@
 HAVE_PREAD = @HAVE_PREAD@
+HAVE_PSELECT = @HAVE_PSELECT@
+HAVE_PTHREAD_ATTR_DESTROY = @HAVE_PTHREAD_ATTR_DESTROY@
+HAVE_PTHREAD_ATTR_GETDETACHSTATE = @HAVE_PTHREAD_ATTR_GETDETACHSTATE@
+HAVE_PTHREAD_ATTR_INIT = @HAVE_PTHREAD_ATTR_INIT@
+HAVE_PTHREAD_ATTR_SETDETACHSTATE = @HAVE_PTHREAD_ATTR_SETDETACHSTATE@
+HAVE_PTHREAD_CONDATTR_DESTROY = @HAVE_PTHREAD_CONDATTR_DESTROY@
+HAVE_PTHREAD_CONDATTR_INIT = @HAVE_PTHREAD_CONDATTR_INIT@
+HAVE_PTHREAD_COND_BROADCAST = @HAVE_PTHREAD_COND_BROADCAST@
+HAVE_PTHREAD_COND_DESTROY = @HAVE_PTHREAD_COND_DESTROY@
+HAVE_PTHREAD_COND_INIT = @HAVE_PTHREAD_COND_INIT@
+HAVE_PTHREAD_COND_SIGNAL = @HAVE_PTHREAD_COND_SIGNAL@
+HAVE_PTHREAD_COND_TIMEDWAIT = @HAVE_PTHREAD_COND_TIMEDWAIT@
+HAVE_PTHREAD_COND_WAIT = @HAVE_PTHREAD_COND_WAIT@
+HAVE_PTHREAD_CREATE = @HAVE_PTHREAD_CREATE@
+HAVE_PTHREAD_CREATE_DETACHED = @HAVE_PTHREAD_CREATE_DETACHED@
+HAVE_PTHREAD_DETACH = @HAVE_PTHREAD_DETACH@
+HAVE_PTHREAD_EQUAL = @HAVE_PTHREAD_EQUAL@
+HAVE_PTHREAD_EXIT = @HAVE_PTHREAD_EXIT@
+HAVE_PTHREAD_GETSPECIFIC = @HAVE_PTHREAD_GETSPECIFIC@
+HAVE_PTHREAD_H = @HAVE_PTHREAD_H@
+HAVE_PTHREAD_JOIN = @HAVE_PTHREAD_JOIN@
+HAVE_PTHREAD_KEY_CREATE = @HAVE_PTHREAD_KEY_CREATE@
+HAVE_PTHREAD_KEY_DELETE = @HAVE_PTHREAD_KEY_DELETE@
+HAVE_PTHREAD_MUTEXATTR_DESTROY = @HAVE_PTHREAD_MUTEXATTR_DESTROY@
+HAVE_PTHREAD_MUTEXATTR_GETROBUST = @HAVE_PTHREAD_MUTEXATTR_GETROBUST@
+HAVE_PTHREAD_MUTEXATTR_GETTYPE = @HAVE_PTHREAD_MUTEXATTR_GETTYPE@
+HAVE_PTHREAD_MUTEXATTR_INIT = @HAVE_PTHREAD_MUTEXATTR_INIT@
+HAVE_PTHREAD_MUTEXATTR_SETROBUST = @HAVE_PTHREAD_MUTEXATTR_SETROBUST@
+HAVE_PTHREAD_MUTEXATTR_SETTYPE = @HAVE_PTHREAD_MUTEXATTR_SETTYPE@
+HAVE_PTHREAD_MUTEX_DESTROY = @HAVE_PTHREAD_MUTEX_DESTROY@
+HAVE_PTHREAD_MUTEX_INIT = @HAVE_PTHREAD_MUTEX_INIT@
+HAVE_PTHREAD_MUTEX_LOCK = @HAVE_PTHREAD_MUTEX_LOCK@
+HAVE_PTHREAD_MUTEX_RECURSIVE = @HAVE_PTHREAD_MUTEX_RECURSIVE@
+HAVE_PTHREAD_MUTEX_ROBUST = @HAVE_PTHREAD_MUTEX_ROBUST@
+HAVE_PTHREAD_MUTEX_TIMEDLOCK = @HAVE_PTHREAD_MUTEX_TIMEDLOCK@
+HAVE_PTHREAD_MUTEX_TRYLOCK = @HAVE_PTHREAD_MUTEX_TRYLOCK@
+HAVE_PTHREAD_MUTEX_UNLOCK = @HAVE_PTHREAD_MUTEX_UNLOCK@
+HAVE_PTHREAD_ONCE = @HAVE_PTHREAD_ONCE@
+HAVE_PTHREAD_PROCESS_SHARED = @HAVE_PTHREAD_PROCESS_SHARED@
+HAVE_PTHREAD_RWLOCKATTR_DESTROY = @HAVE_PTHREAD_RWLOCKATTR_DESTROY@
+HAVE_PTHREAD_RWLOCKATTR_INIT = @HAVE_PTHREAD_RWLOCKATTR_INIT@
+HAVE_PTHREAD_RWLOCK_DESTROY = @HAVE_PTHREAD_RWLOCK_DESTROY@
+HAVE_PTHREAD_RWLOCK_INIT = @HAVE_PTHREAD_RWLOCK_INIT@
+HAVE_PTHREAD_RWLOCK_RDLOCK = @HAVE_PTHREAD_RWLOCK_RDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK = @HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+HAVE_PTHREAD_RWLOCK_TRYRDLOCK = @HAVE_PTHREAD_RWLOCK_TRYRDLOCK@
+HAVE_PTHREAD_RWLOCK_TRYWRLOCK = @HAVE_PTHREAD_RWLOCK_TRYWRLOCK@
+HAVE_PTHREAD_RWLOCK_UNLOCK = @HAVE_PTHREAD_RWLOCK_UNLOCK@
+HAVE_PTHREAD_RWLOCK_WRLOCK = @HAVE_PTHREAD_RWLOCK_WRLOCK@
+HAVE_PTHREAD_SELF = @HAVE_PTHREAD_SELF@
+HAVE_PTHREAD_SETSPECIFIC = @HAVE_PTHREAD_SETSPECIFIC@
 HAVE_PTHREAD_SIGMASK = @HAVE_PTHREAD_SIGMASK@
+HAVE_PTHREAD_SPINLOCK_T = @HAVE_PTHREAD_SPINLOCK_T@
+HAVE_PTHREAD_SPIN_DESTROY = @HAVE_PTHREAD_SPIN_DESTROY@
+HAVE_PTHREAD_SPIN_INIT = @HAVE_PTHREAD_SPIN_INIT@
+HAVE_PTHREAD_SPIN_LOCK = @HAVE_PTHREAD_SPIN_LOCK@
+HAVE_PTHREAD_SPIN_TRYLOCK = @HAVE_PTHREAD_SPIN_TRYLOCK@
+HAVE_PTHREAD_SPIN_UNLOCK = @HAVE_PTHREAD_SPIN_UNLOCK@
+HAVE_PTHREAD_T = @HAVE_PTHREAD_T@
 HAVE_PTSNAME = @HAVE_PTSNAME@
 HAVE_PTSNAME_R = @HAVE_PTSNAME_R@
 HAVE_PWRITE = @HAVE_PWRITE@
@@ -2373,6 +3623,7 @@ HAVE_RAWMEMCHR = @HAVE_RAWMEMCHR@
 HAVE_READDIR = @HAVE_READDIR@
 HAVE_READLINK = @HAVE_READLINK@
 HAVE_READLINKAT = @HAVE_READLINKAT@
+HAVE_REALLOCARRAY = @HAVE_REALLOCARRAY@
 HAVE_REALPATH = @HAVE_REALPATH@
 HAVE_REMAINDER = @HAVE_REMAINDER@
 HAVE_REMAINDERF = @HAVE_REMAINDERF@
@@ -2382,12 +3633,17 @@ HAVE_RINT = @HAVE_RINT@
 HAVE_RINTL = @HAVE_RINTL@
 HAVE_RPMATCH = @HAVE_RPMATCH@
 HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = @HAVE_SAME_LONG_DOUBLE_AS_DOUBLE@
+HAVE_SA_FAMILY_T = @HAVE_SA_FAMILY_T@
 HAVE_SCANDIR = @HAVE_SCANDIR@
 HAVE_SCHED_H = @HAVE_SCHED_H@
+HAVE_SCHED_YIELD = @HAVE_SCHED_YIELD@
 HAVE_SECURE_GETENV = @HAVE_SECURE_GETENV@
 HAVE_SETENV = @HAVE_SETENV@
 HAVE_SETHOSTNAME = @HAVE_SETHOSTNAME@
+HAVE_SETSTATE = @HAVE_SETSTATE@
+HAVE_SIGABBREV_NP = @HAVE_SIGABBREV_NP@
 HAVE_SIGACTION = @HAVE_SIGACTION@
+HAVE_SIGDESCR_NP = @HAVE_SIGDESCR_NP@
 HAVE_SIGHANDLER_T = @HAVE_SIGHANDLER_T@
 HAVE_SIGINFO_T = @HAVE_SIGINFO_T@
 HAVE_SIGNED_SIG_ATOMIC_T = @HAVE_SIGNED_SIG_ATOMIC_T@
@@ -2406,15 +3662,21 @@ HAVE_STPCPY = @HAVE_STPCPY@
 HAVE_STPNCPY = @HAVE_STPNCPY@
 HAVE_STRCASESTR = @HAVE_STRCASESTR@
 HAVE_STRCHRNUL = @HAVE_STRCHRNUL@
+HAVE_STRERRORNAME_NP = @HAVE_STRERRORNAME_NP@
 HAVE_STRPBRK = @HAVE_STRPBRK@
 HAVE_STRPTIME = @HAVE_STRPTIME@
 HAVE_STRSEP = @HAVE_STRSEP@
 HAVE_STRTOD = @HAVE_STRTOD@
+HAVE_STRTOL = @HAVE_STRTOL@
+HAVE_STRTOLD = @HAVE_STRTOLD@
 HAVE_STRTOLL = @HAVE_STRTOLL@
+HAVE_STRTOUL = @HAVE_STRTOUL@
 HAVE_STRTOULL = @HAVE_STRTOULL@
 HAVE_STRUCT_RANDOM_DATA = @HAVE_STRUCT_RANDOM_DATA@
 HAVE_STRUCT_SCHED_PARAM = @HAVE_STRUCT_SCHED_PARAM@
 HAVE_STRUCT_SIGACTION_SA_SIGACTION = @HAVE_STRUCT_SIGACTION_SA_SIGACTION@
+HAVE_STRUCT_SOCKADDR_STORAGE = @HAVE_STRUCT_SOCKADDR_STORAGE@
+HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY = @HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
 HAVE_STRUCT_TIMEVAL = @HAVE_STRUCT_TIMEVAL@
 HAVE_STRVERSCMP = @HAVE_STRVERSCMP@
 HAVE_SYMLINK = @HAVE_SYMLINK@
@@ -2422,24 +3684,30 @@ HAVE_SYMLINKAT = @HAVE_SYMLINKAT@
 HAVE_SYS_BITYPES_H = @HAVE_SYS_BITYPES_H@
 HAVE_SYS_CDEFS_H = @HAVE_SYS_CDEFS_H@
 HAVE_SYS_INTTYPES_H = @HAVE_SYS_INTTYPES_H@
+HAVE_SYS_IOCTL_H = @HAVE_SYS_IOCTL_H@
 HAVE_SYS_LOADAVG_H = @HAVE_SYS_LOADAVG_H@
 HAVE_SYS_PARAM_H = @HAVE_SYS_PARAM_H@
+HAVE_SYS_RANDOM_H = @HAVE_SYS_RANDOM_H@
+HAVE_SYS_SELECT_H = @HAVE_SYS_SELECT_H@
+HAVE_SYS_SOCKET_H = @HAVE_SYS_SOCKET_H@
 HAVE_SYS_TIME_H = @HAVE_SYS_TIME_H@
 HAVE_SYS_TYPES_H = @HAVE_SYS_TYPES_H@
+HAVE_SYS_UIO_H = @HAVE_SYS_UIO_H@
 HAVE_TANF = @HAVE_TANF@
 HAVE_TANHF = @HAVE_TANHF@
 HAVE_TANL = @HAVE_TANL@
 HAVE_TIMEGM = @HAVE_TIMEGM@
+HAVE_TIMESPEC_GET = @HAVE_TIMESPEC_GET@
 HAVE_TIMEZONE_T = @HAVE_TIMEZONE_T@
 HAVE_TYPE_VOLATILE_SIG_ATOMIC_T = @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
 HAVE_UNISTD_H = @HAVE_UNISTD_H@
 HAVE_UNLINKAT = @HAVE_UNLINKAT@
 HAVE_UNLOCKPT = @HAVE_UNLOCKPT@
-HAVE_UNSIGNED_LONG_LONG_INT = @HAVE_UNSIGNED_LONG_LONG_INT@
 HAVE_USLEEP = @HAVE_USLEEP@
 HAVE_UTIMENSAT = @HAVE_UTIMENSAT@
 HAVE_VASPRINTF = @HAVE_VASPRINTF@
 HAVE_VDPRINTF = @HAVE_VDPRINTF@
+HAVE_VISIBILITY = @HAVE_VISIBILITY@
 HAVE_WCHAR_H = @HAVE_WCHAR_H@
 HAVE_WCHAR_T = @HAVE_WCHAR_T@
 HAVE_WCPCPY = @HAVE_WCPCPY@
@@ -2453,6 +3721,7 @@ HAVE_WCSCOLL = @HAVE_WCSCOLL@
 HAVE_WCSCPY = @HAVE_WCSCPY@
 HAVE_WCSCSPN = @HAVE_WCSCSPN@
 HAVE_WCSDUP = @HAVE_WCSDUP@
+HAVE_WCSFTIME = @HAVE_WCSFTIME@
 HAVE_WCSLEN = @HAVE_WCSLEN@
 HAVE_WCSNCASECMP = @HAVE_WCSNCASECMP@
 HAVE_WCSNCAT = @HAVE_WCSNCAT@
@@ -2477,12 +3746,19 @@ HAVE_WMEMCHR = @HAVE_WMEMCHR@
 HAVE_WMEMCMP = @HAVE_WMEMCMP@
 HAVE_WMEMCPY = @HAVE_WMEMCPY@
 HAVE_WMEMMOVE = @HAVE_WMEMMOVE@
+HAVE_WMEMPCPY = @HAVE_WMEMPCPY@
 HAVE_WMEMSET = @HAVE_WMEMSET@
+HAVE_WS2TCPIP_H = @HAVE_WS2TCPIP_H@
 HAVE_XLOCALE_H = @HAVE_XLOCALE_H@
 HAVE__BOOL = @HAVE__BOOL@
 HAVE__EXIT = @HAVE__EXIT@
+HOST_CPU = @HOST_CPU@
+HOST_CPU_C_ABI = @HOST_CPU_C_ABI@
+ICONV_CONST = @ICONV_CONST@
+ICONV_H = @ICONV_H@
 INCLUDE_NEXT = @INCLUDE_NEXT@
 INCLUDE_NEXT_AS_FIRST_DIRECTIVE = @INCLUDE_NEXT_AS_FIRST_DIRECTIVE@
+INET_PTON_LIB = @INET_PTON_LIB@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
@@ -2490,34 +3766,55 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@
 INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
 INT32_MAX_LT_INTMAX_MAX = @INT32_MAX_LT_INTMAX_MAX@
 INT64_MAX_EQ_LONG_MAX = @INT64_MAX_EQ_LONG_MAX@
+INTLLIBS = @INTLLIBS@
 INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
 LDFLAGS = @LDFLAGS@
 LIBCSTACK = @LIBCSTACK@
+LIBICONV = @LIBICONV@
 LIBINTL = @LIBINTL@
 LIBM4_LIBDEPS = @LIBM4_LIBDEPS@
 LIBM4_LTLIBDEPS = @LIBM4_LTLIBDEPS@
 LIBMULTITHREAD = @LIBMULTITHREAD@
 LIBOBJS = @LIBOBJS@
-LIBPTH = @LIBPTH@
-LIBPTH_PREFIX = @LIBPTH_PREFIX@
+LIBPMULTITHREAD = @LIBPMULTITHREAD@
+LIBPTHREAD = @LIBPTHREAD@
 LIBS = @LIBS@
 LIBSIGSEGV = @LIBSIGSEGV@
 LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
+LIBSOCKET = @LIBSOCKET@
+LIBSTDTHREAD = @LIBSTDTHREAD@
 LIBTESTS_LIBDEPS = @LIBTESTS_LIBDEPS@
 LIBTHREAD = @LIBTHREAD@
+LIBUNISTRING_UNISTR_H = @LIBUNISTRING_UNISTR_H@
+LIBUNISTRING_UNITYPES_H = @LIBUNISTRING_UNITYPES_H@
+LIBUNISTRING_UNIWIDTH_H = @LIBUNISTRING_UNIWIDTH_H@
+LIB_CLOCK_GETTIME = @LIB_CLOCK_GETTIME@
+LIB_GETRANDOM = @LIB_GETRANDOM@
+LIB_HARD_LOCALE = @LIB_HARD_LOCALE@
+LIB_MBRTOWC = @LIB_MBRTOWC@
+LIB_NANOSLEEP = @LIB_NANOSLEEP@
+LIB_NL_LANGINFO = @LIB_NL_LANGINFO@
 LIB_POSIX_SPAWN = @LIB_POSIX_SPAWN@
+LIB_PTHREAD = @LIB_PTHREAD@
+LIB_PTHREAD_SIGMASK = @LIB_PTHREAD_SIGMASK@
+LIB_SCHED_YIELD = @LIB_SCHED_YIELD@
+LIB_SELECT = @LIB_SELECT@
+LIB_SEMAPHORE = @LIB_SEMAPHORE@
+LIB_SETLOCALE = @LIB_SETLOCALE@
+LIB_SETLOCALE_NULL = @LIB_SETLOCALE_NULL@
 LIMITS_H = @LIMITS_H@
 LOCALCHARSET_TESTS_ENVIRONMENT = @LOCALCHARSET_TESTS_ENVIRONMENT@
+LOCALENAME_ENHANCE_LOCALE_FUNCS = @LOCALENAME_ENHANCE_LOCALE_FUNCS@
 LOCALE_FR = @LOCALE_FR@
 LOCALE_FR_UTF8 = @LOCALE_FR_UTF8@
 LOCALE_JA = @LOCALE_JA@
 LOCALE_TR_UTF8 = @LOCALE_TR_UTF8@
 LOCALE_ZH_CN = @LOCALE_ZH_CN@
 LTLIBCSTACK = @LTLIBCSTACK@
+LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBMULTITHREAD = @LTLIBMULTITHREAD@
 LTLIBOBJS = @LTLIBOBJS@
-LTLIBPTH = @LTLIBPTH@
 LTLIBSIGSEGV = @LTLIBSIGSEGV@
 LTLIBTHREAD = @LTLIBTHREAD@
 M4_LIBOBJS = @M4_LIBOBJS@
@@ -2527,17 +3824,26 @@ M4tests_LTLIBOBJS = @M4tests_LTLIBOBJS@
 M4tests_WITNESS = @M4tests_WITNESS@
 MAKEINFO = @MAKEINFO@
 MKDIR_P = @MKDIR_P@
+MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
+MSGMERGE = @MSGMERGE@
+NETINET_IN_H = @NETINET_IN_H@
+NEXT_ARPA_INET_H = @NEXT_ARPA_INET_H@
+NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H = @NEXT_AS_FIRST_DIRECTIVE_ARPA_INET_H@
 NEXT_AS_FIRST_DIRECTIVE_CTYPE_H = @NEXT_AS_FIRST_DIRECTIVE_CTYPE_H@
 NEXT_AS_FIRST_DIRECTIVE_DIRENT_H = @NEXT_AS_FIRST_DIRECTIVE_DIRENT_H@
 NEXT_AS_FIRST_DIRECTIVE_ERRNO_H = @NEXT_AS_FIRST_DIRECTIVE_ERRNO_H@
 NEXT_AS_FIRST_DIRECTIVE_FCNTL_H = @NEXT_AS_FIRST_DIRECTIVE_FCNTL_H@
 NEXT_AS_FIRST_DIRECTIVE_FLOAT_H = @NEXT_AS_FIRST_DIRECTIVE_FLOAT_H@
 NEXT_AS_FIRST_DIRECTIVE_GETOPT_H = @NEXT_AS_FIRST_DIRECTIVE_GETOPT_H@
+NEXT_AS_FIRST_DIRECTIVE_ICONV_H = @NEXT_AS_FIRST_DIRECTIVE_ICONV_H@
 NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H = @NEXT_AS_FIRST_DIRECTIVE_INTTYPES_H@
 NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H = @NEXT_AS_FIRST_DIRECTIVE_LANGINFO_H@
 NEXT_AS_FIRST_DIRECTIVE_LIMITS_H = @NEXT_AS_FIRST_DIRECTIVE_LIMITS_H@
 NEXT_AS_FIRST_DIRECTIVE_LOCALE_H = @NEXT_AS_FIRST_DIRECTIVE_LOCALE_H@
 NEXT_AS_FIRST_DIRECTIVE_MATH_H = @NEXT_AS_FIRST_DIRECTIVE_MATH_H@
+NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H = @NEXT_AS_FIRST_DIRECTIVE_NETINET_IN_H@
+NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H = @NEXT_AS_FIRST_DIRECTIVE_PTHREAD_H@
 NEXT_AS_FIRST_DIRECTIVE_SCHED_H = @NEXT_AS_FIRST_DIRECTIVE_SCHED_H@
 NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H = @NEXT_AS_FIRST_DIRECTIVE_SIGNAL_H@
 NEXT_AS_FIRST_DIRECTIVE_SPAWN_H = @NEXT_AS_FIRST_DIRECTIVE_SPAWN_H@
@@ -2547,9 +3853,14 @@ NEXT_AS_FIRST_DIRECTIVE_STDINT_H = @NEXT_AS_FIRST_DIRECTIVE_STDINT_H@
 NEXT_AS_FIRST_DIRECTIVE_STDIO_H = @NEXT_AS_FIRST_DIRECTIVE_STDIO_H@
 NEXT_AS_FIRST_DIRECTIVE_STDLIB_H = @NEXT_AS_FIRST_DIRECTIVE_STDLIB_H@
 NEXT_AS_FIRST_DIRECTIVE_STRING_H = @NEXT_AS_FIRST_DIRECTIVE_STRING_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_IOCTL_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_RANDOM_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_SOCKET_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H@
+NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_UIO_H@
 NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H = @NEXT_AS_FIRST_DIRECTIVE_SYS_WAIT_H@
 NEXT_AS_FIRST_DIRECTIVE_TIME_H = @NEXT_AS_FIRST_DIRECTIVE_TIME_H@
 NEXT_AS_FIRST_DIRECTIVE_UNISTD_H = @NEXT_AS_FIRST_DIRECTIVE_UNISTD_H@
@@ -2561,11 +3872,14 @@ NEXT_ERRNO_H = @NEXT_ERRNO_H@
 NEXT_FCNTL_H = @NEXT_FCNTL_H@
 NEXT_FLOAT_H = @NEXT_FLOAT_H@
 NEXT_GETOPT_H = @NEXT_GETOPT_H@
+NEXT_ICONV_H = @NEXT_ICONV_H@
 NEXT_INTTYPES_H = @NEXT_INTTYPES_H@
 NEXT_LANGINFO_H = @NEXT_LANGINFO_H@
 NEXT_LIMITS_H = @NEXT_LIMITS_H@
 NEXT_LOCALE_H = @NEXT_LOCALE_H@
 NEXT_MATH_H = @NEXT_MATH_H@
+NEXT_NETINET_IN_H = @NEXT_NETINET_IN_H@
+NEXT_PTHREAD_H = @NEXT_PTHREAD_H@
 NEXT_SCHED_H = @NEXT_SCHED_H@
 NEXT_SIGNAL_H = @NEXT_SIGNAL_H@
 NEXT_SPAWN_H = @NEXT_SPAWN_H@
@@ -2575,9 +3889,14 @@ NEXT_STDINT_H = @NEXT_STDINT_H@
 NEXT_STDIO_H = @NEXT_STDIO_H@
 NEXT_STDLIB_H = @NEXT_STDLIB_H@
 NEXT_STRING_H = @NEXT_STRING_H@
+NEXT_SYS_IOCTL_H = @NEXT_SYS_IOCTL_H@
+NEXT_SYS_RANDOM_H = @NEXT_SYS_RANDOM_H@
+NEXT_SYS_SELECT_H = @NEXT_SYS_SELECT_H@
+NEXT_SYS_SOCKET_H = @NEXT_SYS_SOCKET_H@
 NEXT_SYS_STAT_H = @NEXT_SYS_STAT_H@
 NEXT_SYS_TIME_H = @NEXT_SYS_TIME_H@
 NEXT_SYS_TYPES_H = @NEXT_SYS_TYPES_H@
+NEXT_SYS_UIO_H = @NEXT_SYS_UIO_H@
 NEXT_SYS_WAIT_H = @NEXT_SYS_WAIT_H@
 NEXT_TIME_H = @NEXT_TIME_H@
 NEXT_UNISTD_H = @NEXT_UNISTD_H@
@@ -2593,14 +3912,16 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+POSUB = @POSUB@
 PRAGMA_COLUMNS = @PRAGMA_COLUMNS@
 PRAGMA_SYSTEM_HEADER = @PRAGMA_SYSTEM_HEADER@
 PRIPTR_PREFIX = @PRIPTR_PREFIX@
-PRI_MACROS_BROKEN = @PRI_MACROS_BROKEN@
 PTHREAD_H_DEFINES_STRUCT_TIMESPEC = @PTHREAD_H_DEFINES_STRUCT_TIMESPEC@
 PTRDIFF_T_SUFFIX = @PTRDIFF_T_SUFFIX@
 RANLIB = @RANLIB@
+REPLACE_ACCESS = @REPLACE_ACCESS@
 REPLACE_ACOSF = @REPLACE_ACOSF@
+REPLACE_ALIGNED_ALLOC = @REPLACE_ALIGNED_ALLOC@
 REPLACE_ASINF = @REPLACE_ASINF@
 REPLACE_ATAN2F = @REPLACE_ATAN2F@
 REPLACE_ATANF = @REPLACE_ATANF@
@@ -2617,23 +3938,37 @@ REPLACE_CLOSE = @REPLACE_CLOSE@
 REPLACE_CLOSEDIR = @REPLACE_CLOSEDIR@
 REPLACE_COSF = @REPLACE_COSF@
 REPLACE_COSHF = @REPLACE_COSHF@
+REPLACE_CREAT = @REPLACE_CREAT@
+REPLACE_CTIME = @REPLACE_CTIME@
 REPLACE_DIRFD = @REPLACE_DIRFD@
 REPLACE_DPRINTF = @REPLACE_DPRINTF@
 REPLACE_DUP = @REPLACE_DUP@
 REPLACE_DUP2 = @REPLACE_DUP2@
 REPLACE_DUPLOCALE = @REPLACE_DUPLOCALE@
+REPLACE_EXECL = @REPLACE_EXECL@
+REPLACE_EXECLE = @REPLACE_EXECLE@
+REPLACE_EXECLP = @REPLACE_EXECLP@
+REPLACE_EXECV = @REPLACE_EXECV@
+REPLACE_EXECVE = @REPLACE_EXECVE@
+REPLACE_EXECVP = @REPLACE_EXECVP@
+REPLACE_EXECVPE = @REPLACE_EXECVPE@
 REPLACE_EXP2 = @REPLACE_EXP2@
 REPLACE_EXP2L = @REPLACE_EXP2L@
 REPLACE_EXPF = @REPLACE_EXPF@
+REPLACE_EXPL = @REPLACE_EXPL@
 REPLACE_EXPM1 = @REPLACE_EXPM1@
 REPLACE_EXPM1F = @REPLACE_EXPM1F@
+REPLACE_EXPM1L = @REPLACE_EXPM1L@
 REPLACE_FABSL = @REPLACE_FABSL@
+REPLACE_FACCESSAT = @REPLACE_FACCESSAT@
+REPLACE_FCHMODAT = @REPLACE_FCHMODAT@
 REPLACE_FCHOWNAT = @REPLACE_FCHOWNAT@
 REPLACE_FCLOSE = @REPLACE_FCLOSE@
 REPLACE_FCNTL = @REPLACE_FCNTL@
 REPLACE_FDOPEN = @REPLACE_FDOPEN@
 REPLACE_FDOPENDIR = @REPLACE_FDOPENDIR@
 REPLACE_FFLUSH = @REPLACE_FFLUSH@
+REPLACE_FFSLL = @REPLACE_FFSLL@
 REPLACE_FLOOR = @REPLACE_FLOOR@
 REPLACE_FLOORF = @REPLACE_FLOORF@
 REPLACE_FLOORL = @REPLACE_FLOORL@
@@ -2646,6 +3981,8 @@ REPLACE_FMODL = @REPLACE_FMODL@
 REPLACE_FOPEN = @REPLACE_FOPEN@
 REPLACE_FPRINTF = @REPLACE_FPRINTF@
 REPLACE_FPURGE = @REPLACE_FPURGE@
+REPLACE_FREE = @REPLACE_FREE@
+REPLACE_FREELOCALE = @REPLACE_FREELOCALE@
 REPLACE_FREOPEN = @REPLACE_FREOPEN@
 REPLACE_FREXP = @REPLACE_FREXP@
 REPLACE_FREXPF = @REPLACE_FREXPF@
@@ -2666,20 +4003,32 @@ REPLACE_GETGROUPS = @REPLACE_GETGROUPS@
 REPLACE_GETLINE = @REPLACE_GETLINE@
 REPLACE_GETLOGIN_R = @REPLACE_GETLOGIN_R@
 REPLACE_GETPAGESIZE = @REPLACE_GETPAGESIZE@
+REPLACE_GETPASS = @REPLACE_GETPASS@
+REPLACE_GETRANDOM = @REPLACE_GETRANDOM@
 REPLACE_GETTIMEOFDAY = @REPLACE_GETTIMEOFDAY@
 REPLACE_GMTIME = @REPLACE_GMTIME@
 REPLACE_HUGE_VAL = @REPLACE_HUGE_VAL@
 REPLACE_HYPOT = @REPLACE_HYPOT@
 REPLACE_HYPOTF = @REPLACE_HYPOTF@
 REPLACE_HYPOTL = @REPLACE_HYPOTL@
+REPLACE_ICONV = @REPLACE_ICONV@
+REPLACE_ICONV_OPEN = @REPLACE_ICONV_OPEN@
+REPLACE_ICONV_UTF = @REPLACE_ICONV_UTF@
 REPLACE_ILOGB = @REPLACE_ILOGB@
 REPLACE_ILOGBF = @REPLACE_ILOGBF@
+REPLACE_ILOGBL = @REPLACE_ILOGBL@
+REPLACE_INET_NTOP = @REPLACE_INET_NTOP@
+REPLACE_INET_PTON = @REPLACE_INET_PTON@
+REPLACE_INITSTATE = @REPLACE_INITSTATE@
+REPLACE_IOCTL = @REPLACE_IOCTL@
 REPLACE_ISATTY = @REPLACE_ISATTY@
 REPLACE_ISFINITE = @REPLACE_ISFINITE@
 REPLACE_ISINF = @REPLACE_ISINF@
 REPLACE_ISNAN = @REPLACE_ISNAN@
 REPLACE_ISWBLANK = @REPLACE_ISWBLANK@
 REPLACE_ISWCNTRL = @REPLACE_ISWCNTRL@
+REPLACE_ISWDIGIT = @REPLACE_ISWDIGIT@
+REPLACE_ISWXDIGIT = @REPLACE_ISWXDIGIT@
 REPLACE_ITOLD = @REPLACE_ITOLD@
 REPLACE_LCHOWN = @REPLACE_LCHOWN@
 REPLACE_LDEXPL = @REPLACE_LDEXPL@
@@ -2717,7 +4066,9 @@ REPLACE_MEMCHR = @REPLACE_MEMCHR@
 REPLACE_MEMMEM = @REPLACE_MEMMEM@
 REPLACE_MKDIR = @REPLACE_MKDIR@
 REPLACE_MKFIFO = @REPLACE_MKFIFO@
+REPLACE_MKFIFOAT = @REPLACE_MKFIFOAT@
 REPLACE_MKNOD = @REPLACE_MKNOD@
+REPLACE_MKNODAT = @REPLACE_MKNODAT@
 REPLACE_MKSTEMP = @REPLACE_MKSTEMP@
 REPLACE_MKTIME = @REPLACE_MKTIME@
 REPLACE_MODF = @REPLACE_MODF@
@@ -2725,6 +4076,7 @@ REPLACE_MODFF = @REPLACE_MODFF@
 REPLACE_MODFL = @REPLACE_MODFL@
 REPLACE_NAN = @REPLACE_NAN@
 REPLACE_NANOSLEEP = @REPLACE_NANOSLEEP@
+REPLACE_NEWLOCALE = @REPLACE_NEWLOCALE@
 REPLACE_NL_LANGINFO = @REPLACE_NL_LANGINFO@
 REPLACE_NULL = @REPLACE_NULL@
 REPLACE_OBSTACK_PRINTF = @REPLACE_OBSTACK_PRINTF@
@@ -2733,24 +4085,81 @@ REPLACE_OPENAT = @REPLACE_OPENAT@
 REPLACE_OPENDIR = @REPLACE_OPENDIR@
 REPLACE_PERROR = @REPLACE_PERROR@
 REPLACE_POPEN = @REPLACE_POPEN@
+REPLACE_POSIX_MEMALIGN = @REPLACE_POSIX_MEMALIGN@
 REPLACE_POSIX_SPAWN = @REPLACE_POSIX_SPAWN@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDCLOSE@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2 = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDDUP2@
+REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR@
 REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN = @REPLACE_POSIX_SPAWN_FILE_ACTIONS_ADDOPEN@
 REPLACE_PREAD = @REPLACE_PREAD@
 REPLACE_PRINTF = @REPLACE_PRINTF@
+REPLACE_PSELECT = @REPLACE_PSELECT@
+REPLACE_PTHREAD_ATTR_DESTROY = @REPLACE_PTHREAD_ATTR_DESTROY@
+REPLACE_PTHREAD_ATTR_GETDETACHSTATE = @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@
+REPLACE_PTHREAD_ATTR_INIT = @REPLACE_PTHREAD_ATTR_INIT@
+REPLACE_PTHREAD_ATTR_SETDETACHSTATE = @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@
+REPLACE_PTHREAD_CONDATTR_DESTROY = @REPLACE_PTHREAD_CONDATTR_DESTROY@
+REPLACE_PTHREAD_CONDATTR_INIT = @REPLACE_PTHREAD_CONDATTR_INIT@
+REPLACE_PTHREAD_COND_BROADCAST = @REPLACE_PTHREAD_COND_BROADCAST@
+REPLACE_PTHREAD_COND_DESTROY = @REPLACE_PTHREAD_COND_DESTROY@
+REPLACE_PTHREAD_COND_INIT = @REPLACE_PTHREAD_COND_INIT@
+REPLACE_PTHREAD_COND_SIGNAL = @REPLACE_PTHREAD_COND_SIGNAL@
+REPLACE_PTHREAD_COND_TIMEDWAIT = @REPLACE_PTHREAD_COND_TIMEDWAIT@
+REPLACE_PTHREAD_COND_WAIT = @REPLACE_PTHREAD_COND_WAIT@
+REPLACE_PTHREAD_CREATE = @REPLACE_PTHREAD_CREATE@
+REPLACE_PTHREAD_DETACH = @REPLACE_PTHREAD_DETACH@
+REPLACE_PTHREAD_EQUAL = @REPLACE_PTHREAD_EQUAL@
+REPLACE_PTHREAD_EXIT = @REPLACE_PTHREAD_EXIT@
+REPLACE_PTHREAD_GETSPECIFIC = @REPLACE_PTHREAD_GETSPECIFIC@
+REPLACE_PTHREAD_JOIN = @REPLACE_PTHREAD_JOIN@
+REPLACE_PTHREAD_KEY_CREATE = @REPLACE_PTHREAD_KEY_CREATE@
+REPLACE_PTHREAD_KEY_DELETE = @REPLACE_PTHREAD_KEY_DELETE@
+REPLACE_PTHREAD_MUTEXATTR_DESTROY = @REPLACE_PTHREAD_MUTEXATTR_DESTROY@
+REPLACE_PTHREAD_MUTEXATTR_GETROBUST = @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_GETTYPE = @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@
+REPLACE_PTHREAD_MUTEXATTR_INIT = @REPLACE_PTHREAD_MUTEXATTR_INIT@
+REPLACE_PTHREAD_MUTEXATTR_SETROBUST = @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@
+REPLACE_PTHREAD_MUTEXATTR_SETTYPE = @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@
+REPLACE_PTHREAD_MUTEX_DESTROY = @REPLACE_PTHREAD_MUTEX_DESTROY@
+REPLACE_PTHREAD_MUTEX_INIT = @REPLACE_PTHREAD_MUTEX_INIT@
+REPLACE_PTHREAD_MUTEX_LOCK = @REPLACE_PTHREAD_MUTEX_LOCK@
+REPLACE_PTHREAD_MUTEX_TIMEDLOCK = @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@
+REPLACE_PTHREAD_MUTEX_TRYLOCK = @REPLACE_PTHREAD_MUTEX_TRYLOCK@
+REPLACE_PTHREAD_MUTEX_UNLOCK = @REPLACE_PTHREAD_MUTEX_UNLOCK@
+REPLACE_PTHREAD_ONCE = @REPLACE_PTHREAD_ONCE@
+REPLACE_PTHREAD_RWLOCKATTR_DESTROY = @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@
+REPLACE_PTHREAD_RWLOCKATTR_INIT = @REPLACE_PTHREAD_RWLOCKATTR_INIT@
+REPLACE_PTHREAD_RWLOCK_DESTROY = @REPLACE_PTHREAD_RWLOCK_DESTROY@
+REPLACE_PTHREAD_RWLOCK_INIT = @REPLACE_PTHREAD_RWLOCK_INIT@
+REPLACE_PTHREAD_RWLOCK_RDLOCK = @REPLACE_PTHREAD_RWLOCK_RDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK = @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYRDLOCK = @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@
+REPLACE_PTHREAD_RWLOCK_TRYWRLOCK = @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@
+REPLACE_PTHREAD_RWLOCK_UNLOCK = @REPLACE_PTHREAD_RWLOCK_UNLOCK@
+REPLACE_PTHREAD_RWLOCK_WRLOCK = @REPLACE_PTHREAD_RWLOCK_WRLOCK@
+REPLACE_PTHREAD_SELF = @REPLACE_PTHREAD_SELF@
+REPLACE_PTHREAD_SETSPECIFIC = @REPLACE_PTHREAD_SETSPECIFIC@
 REPLACE_PTHREAD_SIGMASK = @REPLACE_PTHREAD_SIGMASK@
+REPLACE_PTHREAD_SPIN_DESTROY = @REPLACE_PTHREAD_SPIN_DESTROY@
+REPLACE_PTHREAD_SPIN_INIT = @REPLACE_PTHREAD_SPIN_INIT@
+REPLACE_PTHREAD_SPIN_LOCK = @REPLACE_PTHREAD_SPIN_LOCK@
+REPLACE_PTHREAD_SPIN_TRYLOCK = @REPLACE_PTHREAD_SPIN_TRYLOCK@
+REPLACE_PTHREAD_SPIN_UNLOCK = @REPLACE_PTHREAD_SPIN_UNLOCK@
 REPLACE_PTSNAME = @REPLACE_PTSNAME@
 REPLACE_PTSNAME_R = @REPLACE_PTSNAME_R@
 REPLACE_PUTENV = @REPLACE_PUTENV@
 REPLACE_PWRITE = @REPLACE_PWRITE@
 REPLACE_QSORT_R = @REPLACE_QSORT_R@
 REPLACE_RAISE = @REPLACE_RAISE@
+REPLACE_RANDOM = @REPLACE_RANDOM@
 REPLACE_RANDOM_R = @REPLACE_RANDOM_R@
 REPLACE_READ = @REPLACE_READ@
 REPLACE_READLINK = @REPLACE_READLINK@
 REPLACE_READLINKAT = @REPLACE_READLINKAT@
 REPLACE_REALLOC = @REPLACE_REALLOC@
+REPLACE_REALLOCARRAY = @REPLACE_REALLOCARRAY@
 REPLACE_REALPATH = @REPLACE_REALPATH@
 REPLACE_REMAINDER = @REPLACE_REMAINDER@
 REPLACE_REMAINDERF = @REPLACE_REMAINDERF@
@@ -2758,14 +4167,18 @@ REPLACE_REMAINDERL = @REPLACE_REMAINDERL@
 REPLACE_REMOVE = @REPLACE_REMOVE@
 REPLACE_RENAME = @REPLACE_RENAME@
 REPLACE_RENAMEAT = @REPLACE_RENAMEAT@
+REPLACE_RINTL = @REPLACE_RINTL@
 REPLACE_RMDIR = @REPLACE_RMDIR@
 REPLACE_ROUND = @REPLACE_ROUND@
 REPLACE_ROUNDF = @REPLACE_ROUNDF@
 REPLACE_ROUNDL = @REPLACE_ROUNDL@
+REPLACE_SCHED_YIELD = @REPLACE_SCHED_YIELD@
+REPLACE_SELECT = @REPLACE_SELECT@
 REPLACE_SETENV = @REPLACE_SETENV@
 REPLACE_SETLOCALE = @REPLACE_SETLOCALE@
+REPLACE_SETSTATE = @REPLACE_SETSTATE@
 REPLACE_SIGNBIT = @REPLACE_SIGNBIT@
-REPLACE_SIGNBIT_USING_GCC = @REPLACE_SIGNBIT_USING_GCC@
+REPLACE_SIGNBIT_USING_BUILTINS = @REPLACE_SIGNBIT_USING_BUILTINS@
 REPLACE_SINF = @REPLACE_SINF@
 REPLACE_SINHF = @REPLACE_SINHF@
 REPLACE_SLEEP = @REPLACE_SLEEP@
@@ -2781,7 +4194,9 @@ REPLACE_STRCASESTR = @REPLACE_STRCASESTR@
 REPLACE_STRCHRNUL = @REPLACE_STRCHRNUL@
 REPLACE_STRDUP = @REPLACE_STRDUP@
 REPLACE_STRERROR = @REPLACE_STRERROR@
+REPLACE_STRERRORNAME_NP = @REPLACE_STRERRORNAME_NP@
 REPLACE_STRERROR_R = @REPLACE_STRERROR_R@
+REPLACE_STRFTIME = @REPLACE_STRFTIME@
 REPLACE_STRNCAT = @REPLACE_STRNCAT@
 REPLACE_STRNDUP = @REPLACE_STRNDUP@
 REPLACE_STRNLEN = @REPLACE_STRNLEN@
@@ -2790,6 +4205,11 @@ REPLACE_STRSTR = @REPLACE_STRSTR@
 REPLACE_STRTOD = @REPLACE_STRTOD@
 REPLACE_STRTOIMAX = @REPLACE_STRTOIMAX@
 REPLACE_STRTOK_R = @REPLACE_STRTOK_R@
+REPLACE_STRTOL = @REPLACE_STRTOL@
+REPLACE_STRTOLD = @REPLACE_STRTOLD@
+REPLACE_STRTOLL = @REPLACE_STRTOLL@
+REPLACE_STRTOUL = @REPLACE_STRTOUL@
+REPLACE_STRTOULL = @REPLACE_STRTOULL@
 REPLACE_STRTOUMAX = @REPLACE_STRTOUMAX@
 REPLACE_STRUCT_LCONV = @REPLACE_STRUCT_LCONV@
 REPLACE_STRUCT_TIMEVAL = @REPLACE_STRUCT_TIMEVAL@
@@ -2801,9 +4221,11 @@ REPLACE_TIMEGM = @REPLACE_TIMEGM@
 REPLACE_TMPFILE = @REPLACE_TMPFILE@
 REPLACE_TOWLOWER = @REPLACE_TOWLOWER@
 REPLACE_TRUNC = @REPLACE_TRUNC@
+REPLACE_TRUNCATE = @REPLACE_TRUNCATE@
 REPLACE_TRUNCF = @REPLACE_TRUNCF@
 REPLACE_TRUNCL = @REPLACE_TRUNCL@
 REPLACE_TTYNAME_R = @REPLACE_TTYNAME_R@
+REPLACE_TZSET = @REPLACE_TZSET@
 REPLACE_UNLINK = @REPLACE_UNLINK@
 REPLACE_UNLINKAT = @REPLACE_UNLINKAT@
 REPLACE_UNSETENV = @REPLACE_UNSETENV@
@@ -2816,17 +4238,19 @@ REPLACE_VPRINTF = @REPLACE_VPRINTF@
 REPLACE_VSNPRINTF = @REPLACE_VSNPRINTF@
 REPLACE_VSPRINTF = @REPLACE_VSPRINTF@
 REPLACE_WCRTOMB = @REPLACE_WCRTOMB@
+REPLACE_WCSFTIME = @REPLACE_WCSFTIME@
 REPLACE_WCSNRTOMBS = @REPLACE_WCSNRTOMBS@
 REPLACE_WCSRTOMBS = @REPLACE_WCSRTOMBS@
+REPLACE_WCSTOK = @REPLACE_WCSTOK@
 REPLACE_WCSWIDTH = @REPLACE_WCSWIDTH@
 REPLACE_WCTOB = @REPLACE_WCTOB@
 REPLACE_WCTOMB = @REPLACE_WCTOMB@
 REPLACE_WCWIDTH = @REPLACE_WCWIDTH@
 REPLACE_WRITE = @REPLACE_WRITE@
-SCHED_H = @SCHED_H@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIGSEGV_H = @SIGSEGV_H@
 SIG_ATOMIC_T_SUFFIX = @SIG_ATOMIC_T_SUFFIX@
 SIZE_T_SUFFIX = @SIZE_T_SUFFIX@
 STDALIGN_H = @STDALIGN_H@
@@ -2835,27 +4259,37 @@ STDBOOL_H = @STDBOOL_H@
 STDDEF_H = @STDDEF_H@
 STDINT_H = @STDINT_H@
 STRIP = @STRIP@
+SYS_IOCTL_H_HAVE_WINSOCK2_H = @SYS_IOCTL_H_HAVE_WINSOCK2_H@
+SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
 SYS_TIME_H_DEFINES_STRUCT_TIMESPEC = @SYS_TIME_H_DEFINES_STRUCT_TIMESPEC@
 TIME_H_DEFINES_STRUCT_TIMESPEC = @TIME_H_DEFINES_STRUCT_TIMESPEC@
+TIME_H_DEFINES_TIME_UTC = @TIME_H_DEFINES_TIME_UTC@
 UINT32_MAX_LT_UINTMAX_MAX = @UINT32_MAX_LT_UINTMAX_MAX@
 UINT64_MAX_EQ_ULONG_MAX = @UINT64_MAX_EQ_ULONG_MAX@
 UNDEFINE_STRTOK_R = @UNDEFINE_STRTOK_R@
 UNISTD_H_DEFINES_STRUCT_TIMESPEC = @UNISTD_H_DEFINES_STRUCT_TIMESPEC@
+UNISTD_H_HAVE_SYS_RANDOM_H = @UNISTD_H_HAVE_SYS_RANDOM_H@
 UNISTD_H_HAVE_WINSOCK2_H = @UNISTD_H_HAVE_WINSOCK2_H@
 UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS = @UNISTD_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+USE_NLS = @USE_NLS@
 VERSION = @VERSION@
 WARN_CFLAGS = @WARN_CFLAGS@
 WCHAR_T_SUFFIX = @WCHAR_T_SUFFIX@
 WERROR_CFLAGS = @WERROR_CFLAGS@
 WINDOWS_64_BIT_OFF_T = @WINDOWS_64_BIT_OFF_T@
 WINDOWS_64_BIT_ST_SIZE = @WINDOWS_64_BIT_ST_SIZE@
+WINDOWS_STAT_INODES = @WINDOWS_STAT_INODES@
+WINDOWS_STAT_TIMESPEC = @WINDOWS_STAT_TIMESPEC@
 WINT_T_SUFFIX = @WINT_T_SUFFIX@
+XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
+XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@
+YIELD_LIB = @YIELD_LIB@
 abs_aux_dir = @abs_aux_dir@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
 abs_top_builddir = @abs_top_builddir@
 abs_top_srcdir = @abs_top_srcdir@
-ac_ct_AR = @ac_ct_AR@
 ac_ct_CC = @ac_ct_CC@
 ac_ct_CXX = @ac_ct_CXX@
 am__include = @am__include@
@@ -2905,180 +4339,258 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-AUTOMAKE_OPTIONS = 1.9.6 foreign
+AUTOMAKE_OPTIONS = 1.11 foreign subdir-objects
 SUBDIRS = .
 TESTS_ENVIRONMENT = EXEEXT='@EXEEXT@' srcdir='$(srcdir)' \
        LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
        LIBSIGSEGV='@LIBSIGSEGV@' LOCALE_FR='@LOCALE_FR@' \
        LOCALE_TR_UTF8='@LOCALE_TR_UTF8@' LOCALE_FR='@LOCALE_FR@' \
        LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_JA='@LOCALE_JA@' \
+       LOCALE_ZH_CN='@LOCALE_ZH_CN@' LOCALE_FR='@LOCALE_FR@' \
+       LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_JA='@LOCALE_JA@' \
+       LOCALE_ZH_CN='@LOCALE_ZH_CN@' LOCALE_FR='@LOCALE_FR@' \
+       LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_JA='@LOCALE_JA@' \
        LOCALE_ZH_CN='@LOCALE_ZH_CN@' \
-       LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_FR='@LOCALE_FR@' \
+       LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+       LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+       LOCALE_ZH_CN='@LOCALE_ZH_CN@' LOCALE_FR='@LOCALE_FR@' \
        LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_FR='@LOCALE_FR@' \
        LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_JA='@LOCALE_JA@' \
-       LOCALE_ZH_CN='@LOCALE_ZH_CN@' abs_aux_dir='$(abs_aux_dir)' \
+       LOCALE_ZH_CN='@LOCALE_ZH_CN@' LOCALE_FR='@LOCALE_FR@' \
+       LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' abs_aux_dir='$(abs_aux_dir)' \
        abs_aux_dir='$(abs_aux_dir)' MAKE='$(MAKE)' \
        LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
        LOCALE_JA='@LOCALE_JA@' LOCALE_ZH_CN='@LOCALE_ZH_CN@'
 noinst_HEADERS = 
 noinst_LIBRARIES = 
 check_LIBRARIES = libtests.a
-EXTRA_DIST = test-alignof.c test-alloca-opt.c test-array_list.c \
-       macros.h test-array_oset.c macros.h test-avltree_oset.c \
-       macros.h test-binary-io.sh test-binary-io.c macros.h \
-       test-btowc1.sh test-btowc2.sh test-btowc.c signature.h \
-       macros.h test-c-ctype.c macros.h test-c-stack.c \
+EXTRA_DIST = accept.c w32sock.h test-accept.c signature.h macros.h \
+       test-access.c signature.h macros.h test-alignof.c alloca.c \
+       test-alloca-opt.c arpa_inet.in.h test-arpa_inet-c++.cc \
+       signature.h test-arpa_inet.c test-array_list.c macros.h \
+       test-array_oset.c test-oset-update.h macros.h \
+       test-asyncsafe-spin1.c test-asyncsafe-spin2.c \
+       atomic-int-gnulib.h test-avltree_oset.c test-oset-update.h \
+       macros.h test-binary-io.sh test-binary-io.c macros.h bind.c \
+       w32sock.h test-bind.c signature.h macros.h test-bitrotate.c \
+       macros.h test-btowc1.sh test-btowc2.sh test-btowc.c \
+       signature.h macros.h test-c-ctype.c macros.h test-c-stack.c \
        test-c-stack.sh test-c-stack2.sh macros.h test-c-strcase.sh \
        test-c-strcasecmp.c test-c-strncasecmp.c macros.h \
-       test-canonicalize-lgpl.c signature.h macros.h test-chdir.c \
-       signature.h macros.h test-cloexec.c macros.h test-close.c \
-       signature.h macros.h closedir.c dirent-private.h \
-       test-closein.sh test-closein.c ctype.in.h test-ctype.c \
-       dirent.in.h test-dirent-c++.cc signature.h test-dirent.c \
-       dirfd.c test-dirname.c dup.c test-dup.c signature.h macros.h \
-       test-dup2.c signature.h macros.h test-environ.c test-errno.c \
-       test-fclose.c test-fcntl-h-c++.cc signature.h test-fcntl-h.c \
-       test-fcntl.c signature.h macros.h fdopen.c test-fdopen.c \
+       test-calloc-gnu.c macros.h test-canonicalize-lgpl.c \
+       signature.h null-ptr.h macros.h test-canonicalize.c null-ptr.h \
+       macros.h test-chdir.c signature.h macros.h test-cloexec.c \
+       macros.h test-close.c signature.h macros.h test-closein.sh \
+       test-closein.c connect.c w32sock.h test-connect.c signature.h \
+       macros.h creat.c test-creat.c signature.h macros.h ctype.in.h \
+       test-ctype-c++.cc test-ctype-c++2.cc signature.h test-ctype.c \
+       test-dirent-c++.cc signature.h test-dirent.c test-dirname.c \
+       test-dup.c signature.h macros.h test-dup2.c signature.h \
+       macros.h test-dynarray.c macros.h test-environ.c \
+       test-errno-c++.cc test-errno-c++2.cc test-errno.c \
+       test-execute.sh test-execute-main.c test-execute-child.c \
+       test-execute-script.c executable-script executable-script.sh \
+       executable-shell-script macros.h explicit_bzero.c \
+       test-explicit_bzero.c signature.h macros.h test-fchdir.c \
+       signature.h macros.h test-fclose.c test-fcntl-h-c++.cc \
+       signature.h test-fcntl-h.c test-fcntl.c signature.h macros.h \
+       fdopen.c test-fdopen.c signature.h macros.h test-fdopendir.c \
        signature.h macros.h test-fflush.c test-fflush2.sh \
        test-fflush2.c signature.h macros.h test-fgetc.c signature.h \
-       macros.h filename.h test-filenamecat.c flexmember.h \
-       test-float.c macros.h test-fopen.h test-fopen-safer.c macros.h \
-       test-fopen.h test-fopen.c signature.h macros.h test-fpending.c \
+       macros.h test-filenamecat.c test-float-c++.cc \
+       test-float-c++2.cc test-float.c macros.h test-fopen-gnu.c \
+       macros.h test-fopen.h test-fopen-safer.c macros.h test-fopen.h \
+       test-fopen.c signature.h macros.h test-fpending.c \
        test-fpending.sh macros.h test-fpurge.c macros.h test-fputc.c \
        signature.h macros.h test-fread.c signature.h macros.h \
        test-freadahead.c test-freadahead.sh macros.h test-freading.c \
-       macros.h test-frexp.c test-frexp.h minus-zero.h infinity.h \
-       nan.h signature.h macros.h randomd.c test-frexpl.c \
+       macros.h test-free.c macros.h freopen.c test-freopen.c \
+       signature.h macros.h test-frexp.c test-frexp.h minus-zero.h \
+       infinity.h nan.h signature.h macros.h randomd.c test-frexpl.c \
        test-frexp.h minus-zero.h infinity.h nan.h signature.h \
        macros.h randoml.c test-fseek.c test-fseek.sh test-fseek2.sh \
        signature.h macros.h test-fseeko.c test-fseeko.sh \
        test-fseeko2.sh test-fseeko3.c test-fseeko3.sh test-fseeko4.c \
        test-fseeko4.sh signature.h macros.h test-fstat.c signature.h \
+       macros.h test-fstatat.c test-lstat.h test-stat.h signature.h \
        macros.h test-ftell.c test-ftell.sh test-ftell2.sh \
        test-ftell3.c signature.h macros.h test-ftello.c \
        test-ftello.sh test-ftello2.sh test-ftello3.c test-ftello4.c \
-       test-ftello4.sh signature.h macros.h test-fwrite.c signature.h \
-       macros.h getcwd-lgpl.c test-getcwd-lgpl.c signature.h macros.h \
+       test-ftello4.sh signature.h macros.h ftruncate.c \
+       test-ftruncate.c test-ftruncate.sh signature.h macros.h \
+       test-fwrite.c signature.h macros.h test-getcwd-lgpl.c \
+       signature.h macros.h test-getcwd.c test-getcwd.sh \
        test-getdtablesize.c signature.h macros.h macros.h signature.h \
        test-getopt-gnu.c test-getopt-main.h test-getopt.h \
-       test-getopt_long.h macros.h signature.h test-getopt-posix.c \
-       test-getopt-main.h test-getopt.h getpagesize.c \
-       test-getprogname.c signature.h test-gettimeofday.c \
-       test-ignore-value.c test-intprops.c macros.h inttypes.in.h \
-       test-inttypes.c isblank.c test-isblank.c signature.h macros.h \
-       test-isnand-nolibm.c test-isnand.h minus-zero.h infinity.h \
-       nan.h macros.h test-isnanf-nolibm.c test-isnanf.h minus-zero.h \
-       infinity.h nan.h macros.h test-isnanl-nolibm.c test-isnanl.h \
-       minus-zero.h infinity.h nan.h macros.h test-langinfo-c++.cc \
-       signature.h test-langinfo.c test-limits-h.c link.c test-link.h \
-       test-link.c signature.h macros.h test-linkedhash_list.c \
-       macros.h test-locale-c++.cc test-locale-c++2.cc signature.h \
-       test-locale.c test-localeconv.c signature.h macros.h \
-       localename.h test-localename.c macros.h test-lseek.c \
-       test-lseek.sh signature.h macros.h test-lstat.h test-lstat.c \
-       signature.h macros.h test-malloca.c test-math-c++.cc \
-       test-math-c++2.cc signature.h test-math.c macros.h \
-       test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh \
+       test-getopt_long.h test-getprogname.c test-getrandom.c \
+       signature.h macros.h gettimeofday.c signature.h \
+       test-gettimeofday.c test-hard-locale.c locale.c test-hash.c \
+       macros.h test-iconv-h-c++.cc signature.h test-iconv-h.c \
+       test-iconv.c signature.h macros.h test-ignore-value.c \
+       inet_pton.c test-inet_pton.c signature.h macros.h \
+       test-intprops.c macros.h anytostr.c inttostr.h macros.h \
+       test-inttostr.c test-inttypes-c++.cc test-inttypes-c++2.cc \
+       signature.h test-inttypes.c ioctl.c w32sock.h test-ioctl.c \
+       signature.h macros.h isblank.c test-isblank.c signature.h \
+       macros.h test-isnand-nolibm.c test-isnand.h minus-zero.h \
+       infinity.h nan.h macros.h test-isnanf-nolibm.c test-isnanf.h \
+       minus-zero.h infinity.h nan.h macros.h test-isnanl-nolibm.c \
+       test-isnanl.h minus-zero.h infinity.h nan.h macros.h \
+       test-iswblank.c macros.h test-iswdigit.sh test-iswdigit.c \
+       signature.h macros.h test-iswxdigit.sh test-iswxdigit.c \
+       signature.h macros.h test-langinfo-c++.cc signature.h \
+       test-langinfo.c test-limits-h-c++.cc test-limits-h-c++2.cc \
+       test-limits-h.c link.c test-link.h test-link.c signature.h \
+       macros.h test-linked_list.c macros.h test-linkedhash_list.c \
+       macros.h listen.c w32sock.h test-listen.c signature.h macros.h \
+       test-localcharset.c test-locale-c++.cc test-locale-c++2.cc \
+       signature.h test-locale.c test-localeconv.c signature.h \
+       macros.h test-localename.c macros.h test-lseek.c test-lseek.sh \
+       signature.h macros.h test-lstat.h test-lstat.c signature.h \
+       macros.h test-malloc-gnu.c macros.h test-malloca.c \
+       test-math-c++.cc test-math-c++2.cc signature.h test-math.c \
+       macros.h test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh \
        test-mbrtowc4.sh test-mbrtowc5.sh test-mbrtowc.c \
        test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh \
        test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh \
-       test-mbrtowc-w32-5.sh test-mbrtowc-w32.c signature.h macros.h \
+       test-mbrtowc-w32-5.sh test-mbrtowc-w32-6.sh \
+       test-mbrtowc-w32-7.sh test-mbrtowc-w32.c signature.h macros.h \
        test-mbsinit.sh test-mbsinit.c signature.h macros.h \
-       test-memchr.c zerosize-ptr.h signature.h macros.h \
-       test-memchr2.c zerosize-ptr.h macros.h test-nl_langinfo.sh \
-       test-nl_langinfo.c signature.h macros.h test-open.h \
-       test-open.c signature.h macros.h dirent-private.h opendir.c \
-       test-pathmax.c test-pipe2.c signature.h macros.h \
+       test-mbsstr1.c test-mbsstr2.sh test-mbsstr2.c test-mbsstr3.sh \
+       test-mbsstr3.c macros.h test-memchr.c zerosize-ptr.h \
+       signature.h macros.h test-memchr2.c zerosize-ptr.h macros.h \
+       test-memrchr.c zerosize-ptr.h signature.h macros.h \
+       test-mkdir.h test-mkdir.c signature.h macros.h nanosleep.c \
+       test-nanosleep.c signature.h macros.h netinet_in.in.h \
+       test-netinet_in.c test-nl_langinfo.sh test-nl_langinfo.c \
+       test-nl_langinfo-mt.c signature.h macros.h test-open.h \
+       test-open.c signature.h macros.h test-openat.c test-open.h \
+       signature.h macros.h test-pathmax.c perror.c macros.h \
+       signature.h test-perror.c test-perror2.c test-perror.sh \
+       test-pipe.c signature.h macros.h test-pipe2.c signature.h \
+       macros.h test-posix_spawn-open1.c test-posix_spawn-open2.c \
+       test-posix_spawn-inherit0.c test-posix_spawn-inherit1.c \
+       test-posix_spawn-script.c executable-script \
+       executable-script.sh executable-shell-script signature.h \
+       test-posix_spawn_file_actions_addchdir.c \
+       test-posix_spawn-chdir.c signature.h macros.h \
        test-posix_spawn_file_actions_addclose.c signature.h macros.h \
        test-posix_spawn_file_actions_adddup2.c signature.h macros.h \
        test-posix_spawn_file_actions_addopen.c signature.h macros.h \
-       test-posix_spawn1.c test-posix_spawn1.in.sh \
-       test-posix_spawn2.c test-posix_spawn2.in.sh signature.h \
-       test-printf-frexp.c macros.h test-printf-frexpl.c macros.h \
-       putenv.c test-quotearg-simple.c test-quotearg.h macros.h \
-       zerosize-ptr.h test-raise.c signature.h macros.h \
-       test-rawmemchr.c zerosize-ptr.h signature.h macros.h \
-       dirent-private.h readdir.c test-readlink.h test-readlink.c \
-       signature.h macros.h test-regex.c macros.h test-rename.h \
-       test-rename.c signature.h macros.h test-rmdir.h test-rmdir.c \
-       signature.h macros.h test-sched.c setenv.c test-setenv.c \
-       signature.h macros.h setlocale.c test-setlocale1.sh \
+       test-posix_spawn-dup2-stdout.c \
+       test-posix_spawn-dup2-stdout.in.sh \
+       test-posix_spawn-dup2-stdin.c \
+       test-posix_spawn-dup2-stdin.in.sh test-posix_spawnp-script.c \
+       executable-script executable-script.sh executable-shell-script \
+       signature.h test-printf-frexp.c macros.h test-printf-frexpl.c \
+       macros.h pthread.in.h test-pthread-c++.cc signature.h \
+       test-pthread.c pthread-thread.c test-pthread-thread.c macros.h \
+       pthread_sigmask.c test-pthread_sigmask1.c \
+       test-pthread_sigmask2.c signature.h macros.h putenv.c \
+       test-quotearg-simple.c test-quotearg.h macros.h zerosize-ptr.h \
+       test-raise.c signature.h macros.h test-rawmemchr.c \
+       zerosize-ptr.h signature.h macros.h read-file.h \
+       test-read-file.c macros.h test-readlink.h test-readlink.c \
+       signature.h macros.h test-realloc-gnu.c macros.h \
+       test-reallocarray.c signature.h macros.h test-regex.c macros.h \
+       test-rename.h test-rename.c signature.h macros.h test-rmdir.h \
+       test-rmdir.c signature.h macros.h root-uid.h test-sched.c \
+       sched_yield.c test-scratch-buffer.c macros.h select.c macros.h \
+       signature.h test-select.c test-select.h test-select-fd.c \
+       test-select-in.sh test-select-out.sh test-select-stdin.c \
+       setenv.c test-setenv.c signature.h macros.h \
+       test-setlocale_null.c test-setlocale_null-mt-one.c \
+       test-setlocale_null-mt-all.c test-setlocale1.sh \
        test-setlocale1.c test-setlocale2.sh test-setlocale2.c \
+       signature.h macros.h setsockopt.c w32sock.h test-setsockopt.c \
        signature.h macros.h test-sigaction.c signature.h macros.h \
        test-signal-h-c++.cc test-signal-h-c++2.cc signature.h \
        test-signal-h.c test-signbit.c minus-zero.h infinity.h \
-       macros.h test-sigpipe.c test-sigpipe.sh test-sigprocmask.c \
-       signature.h macros.h sleep.c test-sleep.c signature.h macros.h \
-       $(top_srcdir)/build-aux/snippet/_Noreturn.h \
-       $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
-       $(top_srcdir)/build-aux/snippet/c++defs.h \
-       $(top_srcdir)/build-aux/snippet/unused-parameter.h \
-       $(top_srcdir)/build-aux/snippet/warn-on-use.h test-snprintf.c \
-       signature.h macros.h test-spawn-c++.cc signature.h \
-       test-spawn-pipe.sh test-spawn-pipe-main.c \
-       test-spawn-pipe-child.c macros.h test-spawn.c test-stat.h \
-       test-stat.c signature.h macros.h stdalign.in.h test-stdalign.c \
-       macros.h test-stdbool.c test-stddef.c test-stdint.c \
-       test-stdio-c++.cc test-stdio-c++2.cc signature.h test-stdio.c \
-       test-stdlib-c++.cc test-stdlib-c++2.cc signature.h \
-       test-stdlib.c test-sys_wait.h test-strchrnul.c signature.h \
-       macros.h strdup.c test-strerror.c signature.h macros.h \
-       test-string-c++.cc test-string-c++2.cc signature.h \
-       test-string.c test-strnlen.c zerosize-ptr.h signature.h \
-       macros.h test-strsignal.c signature.h macros.h test-strstr.c \
-       zerosize-ptr.h signature.h macros.h test-strtod.c signature.h \
-       minus-zero.h macros.h symlink.c test-symlink.h test-symlink.c \
-       signature.h macros.h test-sys_stat-c++.cc signature.h \
-       test-sys_stat.c test-sys_time-c++.cc signature.h \
-       test-sys_time.c test-sys_types-c++.cc test-sys_types.c \
-       test-sys_wait-c++.cc signature.h test-sys_wait.c \
-       test-sys_wait.h init.sh test-init.sh test-time-c++.cc \
-       test-time-c++2.cc signature.h test-time.c test-unistd-c++.cc \
-       signature.h test-dup-safer.c macros.h test-unistd.c unsetenv.c \
-       test-unsetenv.c signature.h macros.h test-update-copyright.sh \
-       test-vasnprintf.c macros.h test-vasprintf-posix.c minus-zero.h \
-       infinity.h nan.h macros.h test-vasprintf.c signature.h \
-       macros.h test-vc-list-files-git.sh test-vc-list-files-cvs.sh \
-       test-verify.c test-verify.sh test-version-etc.c \
-       test-version-etc.sh test-wchar-c++.cc signature.h test-wchar.c \
-       test-wcrtomb.sh test-wcrtomb.c test-wcrtomb-w32-1.sh \
-       test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh \
-       test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32.c \
-       signature.h macros.h wctob.c wctomb-impl.h wctomb.c \
-       test-wctype-h-c++.cc signature.h test-wctype-h.c macros.h \
-       write.c test-write.c signature.h macros.h test-xalloc-die.c \
-       test-xalloc-die.sh test-xvasprintf.c macros.h
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-BUILT_SOURCES = ctype.h dirent.h inttypes.h $(am__append_13) \
-       arg-nonnull.h c++defs.h unused-parameter.h warn-on-use.h \
-       $(STDALIGN_H)
+       macros.h test-sigpipe.c test-sigpipe.sh macros.h \
+       test-sigprocmask.c signature.h macros.h \
+       test-sigsegv-catch-segv1.c test-sigsegv-catch-segv2.c \
+       test-sigsegv-catch-stackoverflow1.c \
+       test-sigsegv-catch-stackoverflow2.c altstack-util.h \
+       mmap-anon-util.h sleep.c test-sleep.c signature.h macros.h \
+       _Noreturn.h arg-nonnull.h c++defs.h unused-parameter.h \
+       warn-on-use.h test-snprintf.c signature.h macros.h socket.c \
+       w32sock.h w32sock.h test-sockets.c test-spawn-c++.cc \
+       signature.h test-spawn-pipe.sh test-spawn-pipe-main.c \
+       test-spawn-pipe-child.c test-spawn-pipe-script.c \
+       executable-script executable-script.sh executable-shell-script \
+       macros.h test-spawn.c test-stat.h test-stat.c signature.h \
+       macros.h test-stat-time.c macros.h nap.h test-stdalign.c \
+       macros.h test-stdbool-c++.cc test-stdbool-c++2.cc \
+       test-stdbool.c test-stddef-c++.cc test-stddef-c++2.cc \
+       test-stddef.c test-stdint-c++.cc test-stdint-c++2.cc \
+       test-stdint.c test-stdio-c++.cc test-stdio-c++2.cc signature.h \
+       test-stdio.c test-stdlib-c++.cc test-stdlib-c++2.cc \
+       signature.h test-stdlib.c test-sys_wait.h test-strchrnul.c \
+       signature.h macros.h test-strerror.c signature.h macros.h \
+       strerror_r.c test-strerror_r.c signature.h macros.h \
+       test-striconv.c macros.h test-string-c++.cc \
+       test-string-c++2.cc signature.h test-string.c test-strnlen.c \
+       zerosize-ptr.h signature.h macros.h test-strsignal.c \
+       signature.h macros.h test-strstr.c zerosize-ptr.h signature.h \
+       macros.h test-strtod.c test-strtod1.sh test-strtod1.c \
+       signature.h minus-zero.h macros.h symlink.c test-symlink.h \
+       test-symlink.c signature.h macros.h sys_ioctl.in.h \
+       test-sys_ioctl-c++.cc signature.h test-sys_ioctl.c \
+       test-sys_random-c++.cc signature.h test-sys_random.c \
+       sys_select.in.h test-sys_select-c++.cc signature.h \
+       test-sys_select.c signature.h sys_socket.in.h \
+       test-sys_socket-c++.cc signature.h test-sys_socket.c \
+       test-sys_stat-c++.cc signature.h test-sys_stat.c sys_time.in.h \
+       test-sys_time-c++.cc signature.h test-sys_time.c \
+       test-sys_types-c++.cc test-sys_types.c sys_uio.in.h \
+       test-sys_uio.c test-sys_wait-c++.cc signature.h \
+       test-sys_wait.c test-sys_wait.h init.sh test-init.sh \
+       test-thread_self.c test-thread_create.c macros.h \
+       test-time-c++.cc test-time-c++2.cc signature.h test-time.c \
+       test-unistd-c++.cc signature.h test-dup-safer.c macros.h \
+       test-unistd.c unistr/test-u8-mbtoucr.c macros.h \
+       unistr/test-u8-uctomb.c macros.h uniwidth/test-uc_width.c \
+       uniwidth/test-uc_width2.c uniwidth/test-uc_width2.sh macros.h \
+       unsetenv.c test-unsetenv.c signature.h macros.h \
+       test-update-copyright.sh test-vasnprintf.c macros.h \
+       test-vasprintf-posix.c minus-zero.h infinity.h nan.h macros.h \
+       test-vasprintf.c signature.h macros.h \
+       test-vc-list-files-git.sh test-vc-list-files-cvs.sh \
+       test-verify.c test-verify-try.c test-verify.sh \
+       test-version-etc.c test-version-etc.sh vma-iter.h \
+       test-wchar-c++.cc test-wchar-c++2.cc test-wchar-c++3.cc \
+       signature.h test-wchar.c test-wcrtomb.sh test-wcrtomb.c \
+       test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh \
+       test-wcrtomb-w32-3.sh test-wcrtomb-w32-4.sh \
+       test-wcrtomb-w32-5.sh test-wcrtomb-w32-6.sh \
+       test-wcrtomb-w32-7.sh test-wcrtomb-w32.c signature.h macros.h \
+       wctob.c wctomb-impl.h wctomb.c test-wctype-h-c++.cc \
+       test-wctype-h-c++2.cc signature.h test-wctype-h.c macros.h \
+       test-wcwidth.c signature.h macros.h windows-thread.c \
+       windows-thread.h write.c test-write.c signature.h macros.h \
+       test-xalloc-die.c test-xalloc-die.sh concat-filename.h \
+       test-xvasprintf.c macros.h
+BUILT_SOURCES = arpa/inet.h ctype.h $(NETINET_IN_H) \
+       test-posix_spawn-dup2-stdout.sh test-posix_spawn-dup2-stdin.sh \
+       pthread.h sys/ioctl.h sys/select.h sys/socket.h sys/time.h \
+       sys/uio.h
 SUFFIXES = 
 
-# This test expects compilation of test-verify.c to fail, and
+# This test expects compilation of test-verify-try.c to fail, and
 # each time it fails, the makefile rule does not perform the usual
 #  "mv -f $name.Tpo $name.po, so tell make clean to remove that file.
-MOSTLYCLEANFILES = core *.stackdump t-c-stack.tmp t-c-stack2.tmp \
-       ctype.h ctype.h-t dirent.h dirent.h-t test-fflush.txt \
+MOSTLYCLEANFILES = core *.stackdump arpa/inet.h arpa/inet.h-t \
+       t-c-stack.tmp t-c-stack2.tmp ctype.h ctype.h-t test-fflush.txt \
        test-fpending.t t-fpurge.tmp t-freading.tmp t-ftell3.tmp \
-       t-ftello3.tmp inttypes.h inttypes.h-t $(am__append_14) \
-       arg-nonnull.h arg-nonnull.h-t c++defs.h c++defs.h-t \
-       unused-parameter.h unused-parameter.h-t warn-on-use.h \
-       warn-on-use.h-t stdalign.h stdalign.h-t .deps/test-verify.Tpo
-MOSTLYCLEANDIRS = 
+       t-ftello3.tmp netinet/in.h netinet/in.h-t \
+       test-posix_spawn-dup2-stdout.sh \
+       test-posix_spawn-dup2-stdout.sh-t \
+       test-posix_spawn-dup2-stdin.sh \
+       test-posix_spawn-dup2-stdin.sh-t pthread.h pthread.h-t \
+       sys/ioctl.h sys/ioctl.h-t sys/select.h sys/select.h-t \
+       sys/socket.h sys/socket.h-t sys/time.h sys/time.h-t sys/uio.h \
+       sys/uio.h-t .deps/test-verify-try.Tpo
+MOSTLYCLEANDIRS = arpa netinet sys sys sys sys
 CLEANFILES = 
 DISTCLEANFILES = 
 MAINTAINERCLEANFILES = 
@@ -3088,81 +4600,206 @@ AM_CPPFLAGS = \
   -I.. -I$(srcdir)/.. \
   -I../lib -I$(srcdir)/../lib
 
-LDADD = libtests.a ../lib/libm4.a libtests.a $(LIBTESTS_LIBDEPS)
+LDADD = libtests.a ../lib/libm4.a libtests.a ../lib/libm4.a libtests.a $(LIBTESTS_LIBDEPS)
 libtests_a_SOURCES = gl_array_list.h gl_array_list.c gl_array_oset.h \
-       gl_array_oset.c localename.c
-libtests_a_LIBADD = $(M4tests_LIBOBJS)
-libtests_a_DEPENDENCIES = $(M4tests_LIBOBJS)
-EXTRA_libtests_a_SOURCES = closedir.c dirfd.c dup.c fdopen.c \
-       getcwd-lgpl.c getpagesize.c isblank.c link.c opendir.c \
-       putenv.c readdir.c setenv.c setlocale.c sleep.c strdup.c \
-       symlink.c unsetenv.c wctob.c wctomb.c write.c
+       gl_array_oset.c findprog.h findprog.c imaxtostr.c inttostr.c \
+       offtostr.c uinttostr.c umaxtostr.c read-file.c sockets.h \
+       sockets.c sys_socket.c glthread/thread.h glthread/thread.c \
+       vma-iter.c xconcat-filename.c glthread/yield.h
+libtests_a_LIBADD = $(M4tests_LIBOBJS) @ALLOCA@
+libtests_a_DEPENDENCIES = $(M4tests_LIBOBJS) @ALLOCA@
+EXTRA_libtests_a_SOURCES = accept.c alloca.c bind.c connect.c creat.c \
+       explicit_bzero.c fdopen.c freopen.c ftruncate.c gettimeofday.c \
+       inet_pton.c anytostr.c ioctl.c isblank.c link.c listen.c \
+       nanosleep.c perror.c pthread-thread.c pthread_sigmask.c \
+       putenv.c sched_yield.c select.c setenv.c setsockopt.c sleep.c \
+       socket.c strerror_r.c symlink.c unsetenv.c wctob.c wctomb.c \
+       windows-thread.c write.c
 AM_LIBTOOLFLAGS = --preserve-dup-deps
+test_accept_LDADD = $(LDADD) @LIBSOCKET@
+@ANSICXX_TRUE@test_arpa_inet_c___SOURCES = test-arpa_inet-c++.cc
+@ANSICXX_TRUE@test_arpa_inet_c___LDADD = $(LDADD) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET)
 test_array_oset_LDADD = $(LDADD) @LIBINTL@
+test_asyncsafe_spin2_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@ @LIB_SEMAPHORE@
+test_bind_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB)
+test_btowc_LDADD = $(LDADD) $(LIB_SETLOCALE)
+test_c_ctype_LDADD = $(LDADD) $(LIB_SETLOCALE)
 test_c_stack_LDADD = $(LDADD) $(LIBCSTACK) @LIBINTL@
-test_closein_LDADD = $(LDADD) @LIBINTL@
+test_c_strcasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE)
+test_c_strncasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE)
+test_canonicalize_lgpl_LDADD = $(LDADD) $(LIBINTL)
+test_canonicalize_LDADD = $(LDADD) @LIBINTL@
+test_closein_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
+test_connect_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB)
+@ANSICXX_TRUE@test_ctype_c___SOURCES = test-ctype-c++.cc test-ctype-c++2.cc
 @ANSICXX_TRUE@test_dirent_c___SOURCES = test-dirent-c++.cc
 @ANSICXX_TRUE@test_dirent_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP)
 test_dirname_LDADD = $(LDADD) @LIBINTL@
+@ANSICXX_TRUE@test_errno_c___SOURCES = test-errno-c++.cc test-errno-c++2.cc
+test_execute_main_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+# The test-execute-child program must be a real executable, not a libtool
+# wrapper script, and should link against as few libraries as possible.
+# Therefore don't link it against any libraries other than -lc.
+test_execute_child_LDADD = 
+test_execute_script_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_execute_script_CPPFLAGS = $(AM_CPPFLAGS) -DSRCDIR=\"$(srcdir)/\"
+test_fchdir_LDADD = $(LDADD) $(LIBINTL)
 @ANSICXX_TRUE@test_fcntl_h_c___SOURCES = test-fcntl-h-c++.cc
 @ANSICXX_TRUE@test_fcntl_h_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIBSOCKET)
+test_fdopendir_LDADD = $(LDADD) @LIBINTL@
 test_filenamecat_LDADD = $(LDADD) @LIBINTL@
+@ANSICXX_TRUE@test_float_c___SOURCES = test-float-c++.cc test-float-c++2.cc
 test_frexp_nolibm_SOURCES = test-frexp.c randomd.c
 test_frexpl_nolibm_SOURCES = test-frexpl.c randoml.c
+test_fstatat_LDADD = $(LDADD) @LIBINTL@
 test_getcwd_lgpl_LDADD = $(LDADD) $(LIBINTL)
+test_getcwd_LDADD = $(LDADD) @LIBINTL@
 test_getopt_gnu_LDADD = $(LDADD) $(LIBINTL)
-test_getopt_posix_LDADD = $(LDADD) $(LIBINTL)
 test_getprogname_LDADD = $(LDADD)
+test_getrandom_LDADD = $(LDADD) @LIB_GETRANDOM@
+GPERF = gperf
+V_GPERF = $(V_GPERF_@AM_V@)
+V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@)
+V_GPERF_0 = @echo "  GPERF   " $@;
+test_hard_locale_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIB_HARD_LOCALE@
+current_locale_SOURCES = locale.c
+@ANSICXX_TRUE@test_iconv_h_c___SOURCES = test-iconv-h-c++.cc
+@ANSICXX_TRUE@test_iconv_h_c___LDADD = $(LDADD) $(LIBINTL) $(LIBICONV) $(LIB_NANOSLEEP)
+test_iconv_LDADD = $(LDADD) @LIBICONV@
+test_inet_pton_LDADD = $(LDADD) @INET_PTON_LIB@
+@ANSICXX_TRUE@test_inttypes_c___SOURCES = test-inttypes-c++.cc test-inttypes-c++2.cc
+test_iswdigit_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+test_iswxdigit_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
 @ANSICXX_TRUE@test_langinfo_c___SOURCES = test-langinfo-c++.cc
+@ANSICXX_TRUE@test_limits_h_c___SOURCES = test-limits-h-c++.cc test-limits-h-c++2.cc
+test_listen_LDADD = $(LDADD) @LIBSOCKET@
+test_localcharset_LDADD = $(LDADD) $(LIB_SETLOCALE)
 @ANSICXX_TRUE@test_locale_c___SOURCES = test-locale-c++.cc test-locale-c++2.cc
-test_localename_LDADD = $(LDADD) @INTL_MACOSX_LIBS@ $(LIBTHREAD)
+@ANSICXX_TRUE@test_locale_c___LDADD = $(LDADD) $(LIB_SETLOCALE)
+test_localename_LDADD = $(LDADD) $(LIB_SETLOCALE) @INTL_MACOSX_LIBS@ $(LIBTHREAD)
 @ANSICXX_TRUE@test_math_c___SOURCES = test-math-c++.cc test-math-c++2.cc
 # These link dependencies are needed on IRIX 6.5 with cc.
 @ANSICXX_TRUE@test_math_c___LDADD = $(LDADD) $(COPYSIGNL_LIBM) $(RINT_LIBM) $(RINTL_LIBM)
+test_mbrtowc_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+test_mbsinit_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+test_mbsstr1_LDADD = $(LDADD) $(LIBUNISTRING) $(LIB_MBRTOWC)
+test_mbsstr2_LDADD = $(LDADD) $(LIBUNISTRING) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+test_mbsstr3_LDADD = $(LDADD) $(LIBUNISTRING) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+test_nanosleep_LDADD = $(LDADD) $(LIB_NANOSLEEP)
+test_nl_langinfo_LDADD = $(LDADD) $(LIB_SETLOCALE)
+test_nl_langinfo_mt_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBMULTITHREAD) $(LIB_NANOSLEEP)
+test_openat_LDADD = $(LDADD) @LIBINTL@
 test_pipe2_LDADD = $(LDADD) $(LIBSOCKET)
-test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@
-test_regex_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) $(LIB_PTHREAD)
+test_posix_spawn_script_CPPFLAGS = $(AM_CPPFLAGS) -DSRCDIR=\"$(srcdir)/\"
+test_posix_spawn_chdir_LDADD = $(LDADD) @LIBINTL@
+test_posix_spawnp_script_CPPFLAGS = $(AM_CPPFLAGS) -DSRCDIR=\"$(srcdir)/\"
+@ANSICXX_TRUE@test_pthread_c___SOURCES = test-pthread-c++.cc
+@ANSICXX_TRUE@test_pthread_c___LDADD = $(LDADD) $(LIBPMULTITHREAD)
+test_pthread_thread_LDADD = $(LDADD) @LIBPMULTITHREAD@
+test_pthread_sigmask1_LDADD = $(LDADD) @LIB_PTHREAD_SIGMASK@
+test_pthread_sigmask2_LDADD = $(LDADD) @LIB_PTHREAD_SIGMASK@ @LIBMULTITHREAD@
+test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
+test_regex_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC) @LIBINTL@ $(LIBTHREAD)
+test_scratch_buffer_SOURCES = test-scratch-buffer.c
+test_select_LDADD = $(LDADD) @LIB_SELECT@ @LIBSOCKET@ $(INET_PTON_LIB)
+test_select_fd_LDADD = $(LDADD) @LIB_SELECT@
+test_select_stdin_LDADD = $(LDADD) @LIB_SELECT@
+test_setlocale_null_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@
+test_setlocale_null_mt_one_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@ $(LIBMULTITHREAD) $(LIB_NANOSLEEP)
+test_setlocale_null_mt_all_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@ $(LIBMULTITHREAD) $(LIB_NANOSLEEP)
+test_setlocale1_LDADD = $(LDADD) @LIB_SETLOCALE@
+test_setlocale2_LDADD = $(LDADD) @LIB_SETLOCALE@
+test_setsockopt_LDADD = $(LDADD) @LIBSOCKET@
 @ANSICXX_TRUE@test_signal_h_c___SOURCES = test-signal-h-c++.cc test-signal-h-c++2.cc
 @ANSICXX_TRUE@test_signal_h_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_PTHREAD_SIGMASK)
+test_sigsegv_catch_segv1_LDADD = $(LDADD) $(LIBSIGSEGV)
+test_sigsegv_catch_segv2_LDADD = $(LDADD) $(LIBSIGSEGV)
+test_sigsegv_catch_stackoverflow1_LDADD = $(LDADD) $(LIBSIGSEGV)
+test_sigsegv_catch_stackoverflow2_LDADD = $(LDADD) $(LIBSIGSEGV)
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+_NORETURN_H = $(srcdir)/_Noreturn.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+ARG_NONNULL_H = $(srcdir)/arg-nonnull.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+CXXDEFS_H = $(srcdir)/c++defs.h
 
 # Because this Makefile snippet defines a variable used by other
-# gnulib Makefile snippets, it must be present in all Makefile.am that
+# gnulib Makefile snippets, it must be present in all makefiles that
 # need it. This is ensured by the applicability 'all' defined above.
-_NORETURN_H = $(top_srcdir)/build-aux/snippet/_Noreturn.h
-ARG_NONNULL_H = arg-nonnull.h
-CXXDEFS_H = c++defs.h
-UNUSED_PARAMETER_H = unused-parameter.h
-WARN_ON_USE_H = warn-on-use.h
+UNUSED_PARAMETER_H = $(srcdir)/unused-parameter.h
+
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
+WARN_ON_USE_H = $(srcdir)/warn-on-use.h
+test_sockets_LDADD = $(LDADD) @LIBSOCKET@
 @ANSICXX_TRUE@test_spawn_c___SOURCES = test-spawn-c++.cc
 @ANSICXX_TRUE@test_spawn_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP)
-test_spawn_pipe_main_LDADD = $(LDADD) @LIBINTL@
+test_spawn_pipe_main_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
 # The test-spawn-pipe-child program must be a real executable, not a libtool
 # wrapper script, and should link against as few libraries as possible.
 # Therefore don't link it against any libraries other than -lc.
 test_spawn_pipe_child_LDADD = 
+test_spawn_pipe_script_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_spawn_pipe_script_CPPFLAGS = $(AM_CPPFLAGS) -DSRCDIR=\"$(srcdir)/\"
 test_stat_LDADD = $(LDADD) $(LIBINTL)
+test_stat_time_LDADD = $(LDADD) $(LIB_NANOSLEEP)
+@ANSICXX_TRUE@test_stdbool_c___SOURCES = test-stdbool-c++.cc test-stdbool-c++2.cc
+@ANSICXX_TRUE@test_stddef_c___SOURCES = test-stddef-c++.cc test-stddef-c++2.cc
+@ANSICXX_TRUE@test_stdint_c___SOURCES = test-stdint-c++.cc test-stdint-c++2.cc
 @ANSICXX_TRUE@test_stdio_c___SOURCES = test-stdio-c++.cc test-stdio-c++2.cc
-@ANSICXX_TRUE@test_stdio_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS)
+@ANSICXX_TRUE@test_stdio_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) $(LIB_GETRANDOM)
 @ANSICXX_TRUE@test_stdlib_c___SOURCES = test-stdlib-c++.cc test-stdlib-c++2.cc
-@ANSICXX_TRUE@test_stdlib_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)
+@ANSICXX_TRUE@test_stdlib_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIB_GETRANDOM)
+test_striconv_LDADD = $(LDADD) @LIBICONV@
 @ANSICXX_TRUE@test_string_c___SOURCES = test-string-c++.cc test-string-c++2.cc
-@ANSICXX_TRUE@test_string_c___LDADD = $(LDADD) $(LIBINTL)
+@ANSICXX_TRUE@test_string_c___LDADD = $(LDADD) $(LIBINTL) $(LIBTHREAD)
 test_strsignal_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_strtod1_LDADD = $(LDADD) $(LIB_SETLOCALE)
+@ANSICXX_TRUE@test_sys_ioctl_c___SOURCES = test-sys_ioctl-c++.cc
+@ANSICXX_TRUE@test_sys_ioctl_c___LDADD = $(LDADD) $(LIBINTL) $(LIBSOCKET) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)
+@ANSICXX_TRUE@test_sys_random_c___SOURCES = test-sys_random-c++.cc
+@ANSICXX_TRUE@test_sys_random_c___LDADD = $(LDADD) $(LIB_GETRANDOM)
+@ANSICXX_TRUE@test_sys_select_c___SOURCES = test-sys_select-c++.cc
+@ANSICXX_TRUE@test_sys_select_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_SELECT) $(LIB_NANOSLEEP)
+@ANSICXX_TRUE@test_sys_socket_c___SOURCES = test-sys_socket-c++.cc
+@ANSICXX_TRUE@test_sys_socket_c___LDADD = $(LDADD) $(LIBINTL) $(LIBSOCKET) $(LIB_NANOSLEEP)
 @ANSICXX_TRUE@test_sys_stat_c___SOURCES = test-sys_stat-c++.cc
 @ANSICXX_TRUE@test_sys_stat_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME)
 @ANSICXX_TRUE@test_sys_time_c___SOURCES = test-sys_time-c++.cc
 @ANSICXX_TRUE@test_sys_time_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP)
 @ANSICXX_TRUE@test_sys_types_c___SOURCES = test-sys_types-c++.cc
 @ANSICXX_TRUE@test_sys_wait_c___SOURCES = test-sys_wait-c++.cc
+test_thread_self_LDADD = $(LDADD) @LIBTHREAD@
+test_thread_create_LDADD = $(LDADD) @LIBMULTITHREAD@
 @ANSICXX_TRUE@test_time_c___SOURCES = test-time-c++.cc test-time-c++2.cc
 @ANSICXX_TRUE@test_time_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP)
 @ANSICXX_TRUE@test_unistd_c___SOURCES = test-unistd-c++.cc
-@ANSICXX_TRUE@test_unistd_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIBSOCKET)
+@ANSICXX_TRUE@test_unistd_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIBSOCKET) $(LIB_GETLOGIN)
+test_u8_mbtoucr_SOURCES = unistr/test-u8-mbtoucr.c
+test_u8_mbtoucr_LDADD = $(LDADD) $(LIBUNISTRING)
+test_u8_uctomb_SOURCES = unistr/test-u8-uctomb.c
+test_u8_uctomb_LDADD = $(LDADD) $(LIBUNISTRING)
+test_uc_width_SOURCES = uniwidth/test-uc_width.c
+test_uc_width_LDADD = $(LDADD) $(LIBUNISTRING)
+test_uc_width2_SOURCES = uniwidth/test-uc_width2.c
+test_uc_width2_LDADD = $(LDADD) $(LIBUNISTRING)
 test_version_etc_LDADD = $(LDADD) @LIBINTL@
-@ANSICXX_TRUE@test_wchar_c___SOURCES = test-wchar-c++.cc
-@ANSICXX_TRUE@test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS)
-@ANSICXX_TRUE@test_wctype_h_c___SOURCES = test-wctype-h-c++.cc
+@ANSICXX_TRUE@test_wchar_c___SOURCES = test-wchar-c++.cc test-wchar-c++2.cc test-wchar-c++3.cc
+@ANSICXX_TRUE@test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) $(LIBTHREAD)
+test_wcrtomb_LDADD = $(LDADD) $(LIB_SETLOCALE)
+@ANSICXX_TRUE@test_wctype_h_c___SOURCES = test-wctype-h-c++.cc test-wctype-h-c++2.cc
 @ANSICXX_TRUE@test_wctype_h_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS)
+test_wcwidth_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBUNISTRING)
 test_xalloc_die_LDADD = $(LDADD) @LIBINTL@
 test_xvasprintf_LDADD = $(LDADD) @LIBINTL@
 all: $(BUILT_SOURCES)
@@ -3187,8 +4824,8 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
          *config.status*) \
            cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
          *) \
-           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
-           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \
        esac;
 $(srcdir)/gnulib.mk $(am__empty):
 
@@ -3201,22 +4838,42 @@ $(ACLOCAL_M4):  $(am__aclocal_m4_deps)
        cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
 $(am__aclocal_m4_deps):
 
+clean-checkPROGRAMS:
+       -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
+
+clean-noinstPROGRAMS:
+       -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+
 clean-checkLIBRARIES:
        -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES)
 
 clean-noinstLIBRARIES:
        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
+glthread/$(am__dirstamp):
+       @$(MKDIR_P) glthread
+       @: > glthread/$(am__dirstamp)
+glthread/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) glthread/$(DEPDIR)
+       @: > glthread/$(DEPDIR)/$(am__dirstamp)
+glthread/thread.$(OBJEXT): glthread/$(am__dirstamp) \
+       glthread/$(DEPDIR)/$(am__dirstamp)
 
 libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_DEPENDENCIES) 
        $(AM_V_at)-rm -f libtests.a
        $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD)
        $(AM_V_at)$(RANLIB) libtests.a
 
-clean-checkPROGRAMS:
-       -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS)
+current-locale$(EXEEXT): $(current_locale_OBJECTS) $(current_locale_DEPENDENCIES) $(EXTRA_current_locale_DEPENDENCIES) 
+       @rm -f current-locale$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(current_locale_OBJECTS) $(current_locale_LDADD) $(LIBS)
 
-clean-noinstPROGRAMS:
-       -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS)
+test-accept$(EXEEXT): $(test_accept_OBJECTS) $(test_accept_DEPENDENCIES) $(EXTRA_test_accept_DEPENDENCIES) 
+       @rm -f test-accept$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_accept_OBJECTS) $(test_accept_LDADD) $(LIBS)
+
+test-access$(EXEEXT): $(test_access_OBJECTS) $(test_access_DEPENDENCIES) $(EXTRA_test_access_DEPENDENCIES) 
+       @rm -f test-access$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_access_OBJECTS) $(test_access_LDADD) $(LIBS)
 
 test-alignof$(EXEEXT): $(test_alignof_OBJECTS) $(test_alignof_DEPENDENCIES) $(EXTRA_test_alignof_DEPENDENCIES) 
        @rm -f test-alignof$(EXEEXT)
@@ -3226,6 +4883,14 @@ test-alloca-opt$(EXEEXT): $(test_alloca_opt_OBJECTS) $(test_alloca_opt_DEPENDENC
        @rm -f test-alloca-opt$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_alloca_opt_OBJECTS) $(test_alloca_opt_LDADD) $(LIBS)
 
+test-arpa_inet$(EXEEXT): $(test_arpa_inet_OBJECTS) $(test_arpa_inet_DEPENDENCIES) $(EXTRA_test_arpa_inet_DEPENDENCIES) 
+       @rm -f test-arpa_inet$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_arpa_inet_OBJECTS) $(test_arpa_inet_LDADD) $(LIBS)
+
+test-arpa_inet-c++$(EXEEXT): $(test_arpa_inet_c___OBJECTS) $(test_arpa_inet_c___DEPENDENCIES) $(EXTRA_test_arpa_inet_c___DEPENDENCIES) 
+       @rm -f test-arpa_inet-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_arpa_inet_c___OBJECTS) $(test_arpa_inet_c___LDADD) $(LIBS)
+
 test-array_list$(EXEEXT): $(test_array_list_OBJECTS) $(test_array_list_DEPENDENCIES) $(EXTRA_test_array_list_DEPENDENCIES) 
        @rm -f test-array_list$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_array_list_OBJECTS) $(test_array_list_LDADD) $(LIBS)
@@ -3234,6 +4899,14 @@ test-array_oset$(EXEEXT): $(test_array_oset_OBJECTS) $(test_array_oset_DEPENDENC
        @rm -f test-array_oset$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_array_oset_OBJECTS) $(test_array_oset_LDADD) $(LIBS)
 
+test-asyncsafe-spin1$(EXEEXT): $(test_asyncsafe_spin1_OBJECTS) $(test_asyncsafe_spin1_DEPENDENCIES) $(EXTRA_test_asyncsafe_spin1_DEPENDENCIES) 
+       @rm -f test-asyncsafe-spin1$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_asyncsafe_spin1_OBJECTS) $(test_asyncsafe_spin1_LDADD) $(LIBS)
+
+test-asyncsafe-spin2$(EXEEXT): $(test_asyncsafe_spin2_OBJECTS) $(test_asyncsafe_spin2_DEPENDENCIES) $(EXTRA_test_asyncsafe_spin2_DEPENDENCIES) 
+       @rm -f test-asyncsafe-spin2$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_asyncsafe_spin2_OBJECTS) $(test_asyncsafe_spin2_LDADD) $(LIBS)
+
 test-avltree_oset$(EXEEXT): $(test_avltree_oset_OBJECTS) $(test_avltree_oset_DEPENDENCIES) $(EXTRA_test_avltree_oset_DEPENDENCIES) 
        @rm -f test-avltree_oset$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_avltree_oset_OBJECTS) $(test_avltree_oset_LDADD) $(LIBS)
@@ -3242,6 +4915,14 @@ test-binary-io$(EXEEXT): $(test_binary_io_OBJECTS) $(test_binary_io_DEPENDENCIES
        @rm -f test-binary-io$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_binary_io_OBJECTS) $(test_binary_io_LDADD) $(LIBS)
 
+test-bind$(EXEEXT): $(test_bind_OBJECTS) $(test_bind_DEPENDENCIES) $(EXTRA_test_bind_DEPENDENCIES) 
+       @rm -f test-bind$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_bind_OBJECTS) $(test_bind_LDADD) $(LIBS)
+
+test-bitrotate$(EXEEXT): $(test_bitrotate_OBJECTS) $(test_bitrotate_DEPENDENCIES) $(EXTRA_test_bitrotate_DEPENDENCIES) 
+       @rm -f test-bitrotate$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_bitrotate_OBJECTS) $(test_bitrotate_LDADD) $(LIBS)
+
 test-btowc$(EXEEXT): $(test_btowc_OBJECTS) $(test_btowc_DEPENDENCIES) $(EXTRA_test_btowc_DEPENDENCIES) 
        @rm -f test-btowc$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_btowc_OBJECTS) $(test_btowc_LDADD) $(LIBS)
@@ -3262,6 +4943,14 @@ test-c-strncasecmp$(EXEEXT): $(test_c_strncasecmp_OBJECTS) $(test_c_strncasecmp_
        @rm -f test-c-strncasecmp$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_c_strncasecmp_OBJECTS) $(test_c_strncasecmp_LDADD) $(LIBS)
 
+test-calloc-gnu$(EXEEXT): $(test_calloc_gnu_OBJECTS) $(test_calloc_gnu_DEPENDENCIES) $(EXTRA_test_calloc_gnu_DEPENDENCIES) 
+       @rm -f test-calloc-gnu$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_calloc_gnu_OBJECTS) $(test_calloc_gnu_LDADD) $(LIBS)
+
+test-canonicalize$(EXEEXT): $(test_canonicalize_OBJECTS) $(test_canonicalize_DEPENDENCIES) $(EXTRA_test_canonicalize_DEPENDENCIES) 
+       @rm -f test-canonicalize$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_canonicalize_OBJECTS) $(test_canonicalize_LDADD) $(LIBS)
+
 test-canonicalize-lgpl$(EXEEXT): $(test_canonicalize_lgpl_OBJECTS) $(test_canonicalize_lgpl_DEPENDENCIES) $(EXTRA_test_canonicalize_lgpl_DEPENDENCIES) 
        @rm -f test-canonicalize-lgpl$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_canonicalize_lgpl_OBJECTS) $(test_canonicalize_lgpl_LDADD) $(LIBS)
@@ -3282,10 +4971,22 @@ test-closein$(EXEEXT): $(test_closein_OBJECTS) $(test_closein_DEPENDENCIES) $(EX
        @rm -f test-closein$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_closein_OBJECTS) $(test_closein_LDADD) $(LIBS)
 
+test-connect$(EXEEXT): $(test_connect_OBJECTS) $(test_connect_DEPENDENCIES) $(EXTRA_test_connect_DEPENDENCIES) 
+       @rm -f test-connect$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_connect_OBJECTS) $(test_connect_LDADD) $(LIBS)
+
+test-creat$(EXEEXT): $(test_creat_OBJECTS) $(test_creat_DEPENDENCIES) $(EXTRA_test_creat_DEPENDENCIES) 
+       @rm -f test-creat$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_creat_OBJECTS) $(test_creat_LDADD) $(LIBS)
+
 test-ctype$(EXEEXT): $(test_ctype_OBJECTS) $(test_ctype_DEPENDENCIES) $(EXTRA_test_ctype_DEPENDENCIES) 
        @rm -f test-ctype$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_ctype_OBJECTS) $(test_ctype_LDADD) $(LIBS)
 
+test-ctype-c++$(EXEEXT): $(test_ctype_c___OBJECTS) $(test_ctype_c___DEPENDENCIES) $(EXTRA_test_ctype_c___DEPENDENCIES) 
+       @rm -f test-ctype-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_ctype_c___OBJECTS) $(test_ctype_c___LDADD) $(LIBS)
+
 test-dirent$(EXEEXT): $(test_dirent_OBJECTS) $(test_dirent_DEPENDENCIES) $(EXTRA_test_dirent_DEPENDENCIES) 
        @rm -f test-dirent$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_dirent_OBJECTS) $(test_dirent_LDADD) $(LIBS)
@@ -3310,6 +5011,10 @@ test-dup2$(EXEEXT): $(test_dup2_OBJECTS) $(test_dup2_DEPENDENCIES) $(EXTRA_test_
        @rm -f test-dup2$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_dup2_OBJECTS) $(test_dup2_LDADD) $(LIBS)
 
+test-dynarray$(EXEEXT): $(test_dynarray_OBJECTS) $(test_dynarray_DEPENDENCIES) $(EXTRA_test_dynarray_DEPENDENCIES) 
+       @rm -f test-dynarray$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_dynarray_OBJECTS) $(test_dynarray_LDADD) $(LIBS)
+
 test-environ$(EXEEXT): $(test_environ_OBJECTS) $(test_environ_DEPENDENCIES) $(EXTRA_test_environ_DEPENDENCIES) 
        @rm -f test-environ$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_environ_OBJECTS) $(test_environ_LDADD) $(LIBS)
@@ -3318,6 +5023,30 @@ test-errno$(EXEEXT): $(test_errno_OBJECTS) $(test_errno_DEPENDENCIES) $(EXTRA_te
        @rm -f test-errno$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_errno_OBJECTS) $(test_errno_LDADD) $(LIBS)
 
+test-errno-c++$(EXEEXT): $(test_errno_c___OBJECTS) $(test_errno_c___DEPENDENCIES) $(EXTRA_test_errno_c___DEPENDENCIES) 
+       @rm -f test-errno-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_errno_c___OBJECTS) $(test_errno_c___LDADD) $(LIBS)
+
+test-execute-child$(EXEEXT): $(test_execute_child_OBJECTS) $(test_execute_child_DEPENDENCIES) $(EXTRA_test_execute_child_DEPENDENCIES) 
+       @rm -f test-execute-child$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_execute_child_OBJECTS) $(test_execute_child_LDADD) $(LIBS)
+
+test-execute-main$(EXEEXT): $(test_execute_main_OBJECTS) $(test_execute_main_DEPENDENCIES) $(EXTRA_test_execute_main_DEPENDENCIES) 
+       @rm -f test-execute-main$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_execute_main_OBJECTS) $(test_execute_main_LDADD) $(LIBS)
+
+test-execute-script$(EXEEXT): $(test_execute_script_OBJECTS) $(test_execute_script_DEPENDENCIES) $(EXTRA_test_execute_script_DEPENDENCIES) 
+       @rm -f test-execute-script$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_execute_script_OBJECTS) $(test_execute_script_LDADD) $(LIBS)
+
+test-explicit_bzero$(EXEEXT): $(test_explicit_bzero_OBJECTS) $(test_explicit_bzero_DEPENDENCIES) $(EXTRA_test_explicit_bzero_DEPENDENCIES) 
+       @rm -f test-explicit_bzero$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_explicit_bzero_OBJECTS) $(test_explicit_bzero_LDADD) $(LIBS)
+
+test-fchdir$(EXEEXT): $(test_fchdir_OBJECTS) $(test_fchdir_DEPENDENCIES) $(EXTRA_test_fchdir_DEPENDENCIES) 
+       @rm -f test-fchdir$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_fchdir_OBJECTS) $(test_fchdir_LDADD) $(LIBS)
+
 test-fclose$(EXEEXT): $(test_fclose_OBJECTS) $(test_fclose_DEPENDENCIES) $(EXTRA_test_fclose_DEPENDENCIES) 
        @rm -f test-fclose$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_fclose_OBJECTS) $(test_fclose_LDADD) $(LIBS)
@@ -3338,6 +5067,10 @@ test-fdopen$(EXEEXT): $(test_fdopen_OBJECTS) $(test_fdopen_DEPENDENCIES) $(EXTRA
        @rm -f test-fdopen$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_fdopen_OBJECTS) $(test_fdopen_LDADD) $(LIBS)
 
+test-fdopendir$(EXEEXT): $(test_fdopendir_OBJECTS) $(test_fdopendir_DEPENDENCIES) $(EXTRA_test_fdopendir_DEPENDENCIES) 
+       @rm -f test-fdopendir$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_fdopendir_OBJECTS) $(test_fdopendir_LDADD) $(LIBS)
+
 test-fflush$(EXEEXT): $(test_fflush_OBJECTS) $(test_fflush_DEPENDENCIES) $(EXTRA_test_fflush_DEPENDENCIES) 
        @rm -f test-fflush$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_fflush_OBJECTS) $(test_fflush_LDADD) $(LIBS)
@@ -3358,10 +5091,18 @@ test-float$(EXEEXT): $(test_float_OBJECTS) $(test_float_DEPENDENCIES) $(EXTRA_te
        @rm -f test-float$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_float_OBJECTS) $(test_float_LDADD) $(LIBS)
 
+test-float-c++$(EXEEXT): $(test_float_c___OBJECTS) $(test_float_c___DEPENDENCIES) $(EXTRA_test_float_c___DEPENDENCIES) 
+       @rm -f test-float-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_float_c___OBJECTS) $(test_float_c___LDADD) $(LIBS)
+
 test-fopen$(EXEEXT): $(test_fopen_OBJECTS) $(test_fopen_DEPENDENCIES) $(EXTRA_test_fopen_DEPENDENCIES) 
        @rm -f test-fopen$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_fopen_OBJECTS) $(test_fopen_LDADD) $(LIBS)
 
+test-fopen-gnu$(EXEEXT): $(test_fopen_gnu_OBJECTS) $(test_fopen_gnu_DEPENDENCIES) $(EXTRA_test_fopen_gnu_DEPENDENCIES) 
+       @rm -f test-fopen-gnu$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_fopen_gnu_OBJECTS) $(test_fopen_gnu_LDADD) $(LIBS)
+
 test-fopen-safer$(EXEEXT): $(test_fopen_safer_OBJECTS) $(test_fopen_safer_DEPENDENCIES) $(EXTRA_test_fopen_safer_DEPENDENCIES) 
        @rm -f test-fopen-safer$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_fopen_safer_OBJECTS) $(test_fopen_safer_LDADD) $(LIBS)
@@ -3390,6 +5131,14 @@ test-freading$(EXEEXT): $(test_freading_OBJECTS) $(test_freading_DEPENDENCIES) $
        @rm -f test-freading$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_freading_OBJECTS) $(test_freading_LDADD) $(LIBS)
 
+test-free$(EXEEXT): $(test_free_OBJECTS) $(test_free_DEPENDENCIES) $(EXTRA_test_free_DEPENDENCIES) 
+       @rm -f test-free$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_free_OBJECTS) $(test_free_LDADD) $(LIBS)
+
+test-freopen$(EXEEXT): $(test_freopen_OBJECTS) $(test_freopen_DEPENDENCIES) $(EXTRA_test_freopen_DEPENDENCIES) 
+       @rm -f test-freopen$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_freopen_OBJECTS) $(test_freopen_LDADD) $(LIBS)
+
 test-frexp-nolibm$(EXEEXT): $(test_frexp_nolibm_OBJECTS) $(test_frexp_nolibm_DEPENDENCIES) $(EXTRA_test_frexp_nolibm_DEPENDENCIES) 
        @rm -f test-frexp-nolibm$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_frexp_nolibm_OBJECTS) $(test_frexp_nolibm_LDADD) $(LIBS)
@@ -3418,6 +5167,10 @@ test-fstat$(EXEEXT): $(test_fstat_OBJECTS) $(test_fstat_DEPENDENCIES) $(EXTRA_te
        @rm -f test-fstat$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_fstat_OBJECTS) $(test_fstat_LDADD) $(LIBS)
 
+test-fstatat$(EXEEXT): $(test_fstatat_OBJECTS) $(test_fstatat_DEPENDENCIES) $(EXTRA_test_fstatat_DEPENDENCIES) 
+       @rm -f test-fstatat$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_fstatat_OBJECTS) $(test_fstatat_LDADD) $(LIBS)
+
 test-ftell$(EXEEXT): $(test_ftell_OBJECTS) $(test_ftell_DEPENDENCIES) $(EXTRA_test_ftell_DEPENDENCIES) 
        @rm -f test-ftell$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_ftell_OBJECTS) $(test_ftell_LDADD) $(LIBS)
@@ -3438,10 +5191,18 @@ test-ftello4$(EXEEXT): $(test_ftello4_OBJECTS) $(test_ftello4_DEPENDENCIES) $(EX
        @rm -f test-ftello4$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_ftello4_OBJECTS) $(test_ftello4_LDADD) $(LIBS)
 
+test-ftruncate$(EXEEXT): $(test_ftruncate_OBJECTS) $(test_ftruncate_DEPENDENCIES) $(EXTRA_test_ftruncate_DEPENDENCIES) 
+       @rm -f test-ftruncate$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_ftruncate_OBJECTS) $(test_ftruncate_LDADD) $(LIBS)
+
 test-fwrite$(EXEEXT): $(test_fwrite_OBJECTS) $(test_fwrite_DEPENDENCIES) $(EXTRA_test_fwrite_DEPENDENCIES) 
        @rm -f test-fwrite$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_fwrite_OBJECTS) $(test_fwrite_LDADD) $(LIBS)
 
+test-getcwd$(EXEEXT): $(test_getcwd_OBJECTS) $(test_getcwd_DEPENDENCIES) $(EXTRA_test_getcwd_DEPENDENCIES) 
+       @rm -f test-getcwd$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_getcwd_OBJECTS) $(test_getcwd_LDADD) $(LIBS)
+
 test-getcwd-lgpl$(EXEEXT): $(test_getcwd_lgpl_OBJECTS) $(test_getcwd_lgpl_DEPENDENCIES) $(EXTRA_test_getcwd_lgpl_DEPENDENCIES) 
        @rm -f test-getcwd-lgpl$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_getcwd_lgpl_OBJECTS) $(test_getcwd_lgpl_LDADD) $(LIBS)
@@ -3454,30 +5215,66 @@ test-getopt-gnu$(EXEEXT): $(test_getopt_gnu_OBJECTS) $(test_getopt_gnu_DEPENDENC
        @rm -f test-getopt-gnu$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_getopt_gnu_OBJECTS) $(test_getopt_gnu_LDADD) $(LIBS)
 
-test-getopt-posix$(EXEEXT): $(test_getopt_posix_OBJECTS) $(test_getopt_posix_DEPENDENCIES) $(EXTRA_test_getopt_posix_DEPENDENCIES) 
-       @rm -f test-getopt-posix$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(test_getopt_posix_OBJECTS) $(test_getopt_posix_LDADD) $(LIBS)
-
 test-getprogname$(EXEEXT): $(test_getprogname_OBJECTS) $(test_getprogname_DEPENDENCIES) $(EXTRA_test_getprogname_DEPENDENCIES) 
        @rm -f test-getprogname$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_getprogname_OBJECTS) $(test_getprogname_LDADD) $(LIBS)
 
+test-getrandom$(EXEEXT): $(test_getrandom_OBJECTS) $(test_getrandom_DEPENDENCIES) $(EXTRA_test_getrandom_DEPENDENCIES) 
+       @rm -f test-getrandom$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_getrandom_OBJECTS) $(test_getrandom_LDADD) $(LIBS)
+
 test-gettimeofday$(EXEEXT): $(test_gettimeofday_OBJECTS) $(test_gettimeofday_DEPENDENCIES) $(EXTRA_test_gettimeofday_DEPENDENCIES) 
        @rm -f test-gettimeofday$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_gettimeofday_OBJECTS) $(test_gettimeofday_LDADD) $(LIBS)
 
+test-hard-locale$(EXEEXT): $(test_hard_locale_OBJECTS) $(test_hard_locale_DEPENDENCIES) $(EXTRA_test_hard_locale_DEPENDENCIES) 
+       @rm -f test-hard-locale$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_hard_locale_OBJECTS) $(test_hard_locale_LDADD) $(LIBS)
+
+test-hash$(EXEEXT): $(test_hash_OBJECTS) $(test_hash_DEPENDENCIES) $(EXTRA_test_hash_DEPENDENCIES) 
+       @rm -f test-hash$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_hash_OBJECTS) $(test_hash_LDADD) $(LIBS)
+
+test-iconv$(EXEEXT): $(test_iconv_OBJECTS) $(test_iconv_DEPENDENCIES) $(EXTRA_test_iconv_DEPENDENCIES) 
+       @rm -f test-iconv$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_iconv_OBJECTS) $(test_iconv_LDADD) $(LIBS)
+
+test-iconv-h$(EXEEXT): $(test_iconv_h_OBJECTS) $(test_iconv_h_DEPENDENCIES) $(EXTRA_test_iconv_h_DEPENDENCIES) 
+       @rm -f test-iconv-h$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_iconv_h_OBJECTS) $(test_iconv_h_LDADD) $(LIBS)
+
+test-iconv-h-c++$(EXEEXT): $(test_iconv_h_c___OBJECTS) $(test_iconv_h_c___DEPENDENCIES) $(EXTRA_test_iconv_h_c___DEPENDENCIES) 
+       @rm -f test-iconv-h-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_iconv_h_c___OBJECTS) $(test_iconv_h_c___LDADD) $(LIBS)
+
 test-ignore-value$(EXEEXT): $(test_ignore_value_OBJECTS) $(test_ignore_value_DEPENDENCIES) $(EXTRA_test_ignore_value_DEPENDENCIES) 
        @rm -f test-ignore-value$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_ignore_value_OBJECTS) $(test_ignore_value_LDADD) $(LIBS)
 
+test-inet_pton$(EXEEXT): $(test_inet_pton_OBJECTS) $(test_inet_pton_DEPENDENCIES) $(EXTRA_test_inet_pton_DEPENDENCIES) 
+       @rm -f test-inet_pton$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_inet_pton_OBJECTS) $(test_inet_pton_LDADD) $(LIBS)
+
 test-intprops$(EXEEXT): $(test_intprops_OBJECTS) $(test_intprops_DEPENDENCIES) $(EXTRA_test_intprops_DEPENDENCIES) 
        @rm -f test-intprops$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_intprops_OBJECTS) $(test_intprops_LDADD) $(LIBS)
 
+test-inttostr$(EXEEXT): $(test_inttostr_OBJECTS) $(test_inttostr_DEPENDENCIES) $(EXTRA_test_inttostr_DEPENDENCIES) 
+       @rm -f test-inttostr$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_inttostr_OBJECTS) $(test_inttostr_LDADD) $(LIBS)
+
 test-inttypes$(EXEEXT): $(test_inttypes_OBJECTS) $(test_inttypes_DEPENDENCIES) $(EXTRA_test_inttypes_DEPENDENCIES) 
        @rm -f test-inttypes$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_inttypes_OBJECTS) $(test_inttypes_LDADD) $(LIBS)
 
+test-inttypes-c++$(EXEEXT): $(test_inttypes_c___OBJECTS) $(test_inttypes_c___DEPENDENCIES) $(EXTRA_test_inttypes_c___DEPENDENCIES) 
+       @rm -f test-inttypes-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_inttypes_c___OBJECTS) $(test_inttypes_c___LDADD) $(LIBS)
+
+test-ioctl$(EXEEXT): $(test_ioctl_OBJECTS) $(test_ioctl_DEPENDENCIES) $(EXTRA_test_ioctl_DEPENDENCIES) 
+       @rm -f test-ioctl$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_ioctl_OBJECTS) $(test_ioctl_LDADD) $(LIBS)
+
 test-isblank$(EXEEXT): $(test_isblank_OBJECTS) $(test_isblank_DEPENDENCIES) $(EXTRA_test_isblank_DEPENDENCIES) 
        @rm -f test-isblank$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_isblank_OBJECTS) $(test_isblank_LDADD) $(LIBS)
@@ -3494,6 +5291,18 @@ test-isnanl-nolibm$(EXEEXT): $(test_isnanl_nolibm_OBJECTS) $(test_isnanl_nolibm_
        @rm -f test-isnanl-nolibm$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_isnanl_nolibm_OBJECTS) $(test_isnanl_nolibm_LDADD) $(LIBS)
 
+test-iswblank$(EXEEXT): $(test_iswblank_OBJECTS) $(test_iswblank_DEPENDENCIES) $(EXTRA_test_iswblank_DEPENDENCIES) 
+       @rm -f test-iswblank$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_iswblank_OBJECTS) $(test_iswblank_LDADD) $(LIBS)
+
+test-iswdigit$(EXEEXT): $(test_iswdigit_OBJECTS) $(test_iswdigit_DEPENDENCIES) $(EXTRA_test_iswdigit_DEPENDENCIES) 
+       @rm -f test-iswdigit$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_iswdigit_OBJECTS) $(test_iswdigit_LDADD) $(LIBS)
+
+test-iswxdigit$(EXEEXT): $(test_iswxdigit_OBJECTS) $(test_iswxdigit_DEPENDENCIES) $(EXTRA_test_iswxdigit_DEPENDENCIES) 
+       @rm -f test-iswxdigit$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_iswxdigit_OBJECTS) $(test_iswxdigit_LDADD) $(LIBS)
+
 test-langinfo$(EXEEXT): $(test_langinfo_OBJECTS) $(test_langinfo_DEPENDENCIES) $(EXTRA_test_langinfo_DEPENDENCIES) 
        @rm -f test-langinfo$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_langinfo_OBJECTS) $(test_langinfo_LDADD) $(LIBS)
@@ -3506,14 +5315,30 @@ test-limits-h$(EXEEXT): $(test_limits_h_OBJECTS) $(test_limits_h_DEPENDENCIES) $
        @rm -f test-limits-h$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_limits_h_OBJECTS) $(test_limits_h_LDADD) $(LIBS)
 
+test-limits-h-c++$(EXEEXT): $(test_limits_h_c___OBJECTS) $(test_limits_h_c___DEPENDENCIES) $(EXTRA_test_limits_h_c___DEPENDENCIES) 
+       @rm -f test-limits-h-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_limits_h_c___OBJECTS) $(test_limits_h_c___LDADD) $(LIBS)
+
 test-link$(EXEEXT): $(test_link_OBJECTS) $(test_link_DEPENDENCIES) $(EXTRA_test_link_DEPENDENCIES) 
        @rm -f test-link$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_link_OBJECTS) $(test_link_LDADD) $(LIBS)
 
+test-linked_list$(EXEEXT): $(test_linked_list_OBJECTS) $(test_linked_list_DEPENDENCIES) $(EXTRA_test_linked_list_DEPENDENCIES) 
+       @rm -f test-linked_list$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_linked_list_OBJECTS) $(test_linked_list_LDADD) $(LIBS)
+
 test-linkedhash_list$(EXEEXT): $(test_linkedhash_list_OBJECTS) $(test_linkedhash_list_DEPENDENCIES) $(EXTRA_test_linkedhash_list_DEPENDENCIES) 
        @rm -f test-linkedhash_list$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_linkedhash_list_OBJECTS) $(test_linkedhash_list_LDADD) $(LIBS)
 
+test-listen$(EXEEXT): $(test_listen_OBJECTS) $(test_listen_DEPENDENCIES) $(EXTRA_test_listen_DEPENDENCIES) 
+       @rm -f test-listen$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_listen_OBJECTS) $(test_listen_LDADD) $(LIBS)
+
+test-localcharset$(EXEEXT): $(test_localcharset_OBJECTS) $(test_localcharset_DEPENDENCIES) $(EXTRA_test_localcharset_DEPENDENCIES) 
+       @rm -f test-localcharset$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_localcharset_OBJECTS) $(test_localcharset_LDADD) $(LIBS)
+
 test-locale$(EXEEXT): $(test_locale_OBJECTS) $(test_locale_DEPENDENCIES) $(EXTRA_test_locale_DEPENDENCIES) 
        @rm -f test-locale$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_locale_OBJECTS) $(test_locale_LDADD) $(LIBS)
@@ -3538,6 +5363,10 @@ test-lstat$(EXEEXT): $(test_lstat_OBJECTS) $(test_lstat_DEPENDENCIES) $(EXTRA_te
        @rm -f test-lstat$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_lstat_OBJECTS) $(test_lstat_LDADD) $(LIBS)
 
+test-malloc-gnu$(EXEEXT): $(test_malloc_gnu_OBJECTS) $(test_malloc_gnu_DEPENDENCIES) $(EXTRA_test_malloc_gnu_DEPENDENCIES) 
+       @rm -f test-malloc-gnu$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_malloc_gnu_OBJECTS) $(test_malloc_gnu_LDADD) $(LIBS)
+
 test-malloca$(EXEEXT): $(test_malloca_OBJECTS) $(test_malloca_DEPENDENCIES) $(EXTRA_test_malloca_DEPENDENCIES) 
        @rm -f test-malloca$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_malloca_OBJECTS) $(test_malloca_LDADD) $(LIBS)
@@ -3562,6 +5391,18 @@ test-mbsinit$(EXEEXT): $(test_mbsinit_OBJECTS) $(test_mbsinit_DEPENDENCIES) $(EX
        @rm -f test-mbsinit$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_mbsinit_OBJECTS) $(test_mbsinit_LDADD) $(LIBS)
 
+test-mbsstr1$(EXEEXT): $(test_mbsstr1_OBJECTS) $(test_mbsstr1_DEPENDENCIES) $(EXTRA_test_mbsstr1_DEPENDENCIES) 
+       @rm -f test-mbsstr1$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_mbsstr1_OBJECTS) $(test_mbsstr1_LDADD) $(LIBS)
+
+test-mbsstr2$(EXEEXT): $(test_mbsstr2_OBJECTS) $(test_mbsstr2_DEPENDENCIES) $(EXTRA_test_mbsstr2_DEPENDENCIES) 
+       @rm -f test-mbsstr2$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_mbsstr2_OBJECTS) $(test_mbsstr2_LDADD) $(LIBS)
+
+test-mbsstr3$(EXEEXT): $(test_mbsstr3_OBJECTS) $(test_mbsstr3_DEPENDENCIES) $(EXTRA_test_mbsstr3_DEPENDENCIES) 
+       @rm -f test-mbsstr3$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_mbsstr3_OBJECTS) $(test_mbsstr3_LDADD) $(LIBS)
+
 test-memchr$(EXEEXT): $(test_memchr_OBJECTS) $(test_memchr_DEPENDENCIES) $(EXTRA_test_memchr_DEPENDENCIES) 
        @rm -f test-memchr$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_memchr_OBJECTS) $(test_memchr_LDADD) $(LIBS)
@@ -3570,29 +5411,93 @@ test-memchr2$(EXEEXT): $(test_memchr2_OBJECTS) $(test_memchr2_DEPENDENCIES) $(EX
        @rm -f test-memchr2$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_memchr2_OBJECTS) $(test_memchr2_LDADD) $(LIBS)
 
+test-memrchr$(EXEEXT): $(test_memrchr_OBJECTS) $(test_memrchr_DEPENDENCIES) $(EXTRA_test_memrchr_DEPENDENCIES) 
+       @rm -f test-memrchr$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_memrchr_OBJECTS) $(test_memrchr_LDADD) $(LIBS)
+
+test-mkdir$(EXEEXT): $(test_mkdir_OBJECTS) $(test_mkdir_DEPENDENCIES) $(EXTRA_test_mkdir_DEPENDENCIES) 
+       @rm -f test-mkdir$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_mkdir_OBJECTS) $(test_mkdir_LDADD) $(LIBS)
+
+test-nanosleep$(EXEEXT): $(test_nanosleep_OBJECTS) $(test_nanosleep_DEPENDENCIES) $(EXTRA_test_nanosleep_DEPENDENCIES) 
+       @rm -f test-nanosleep$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_nanosleep_OBJECTS) $(test_nanosleep_LDADD) $(LIBS)
+
+test-netinet_in$(EXEEXT): $(test_netinet_in_OBJECTS) $(test_netinet_in_DEPENDENCIES) $(EXTRA_test_netinet_in_DEPENDENCIES) 
+       @rm -f test-netinet_in$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_netinet_in_OBJECTS) $(test_netinet_in_LDADD) $(LIBS)
+
 test-nl_langinfo$(EXEEXT): $(test_nl_langinfo_OBJECTS) $(test_nl_langinfo_DEPENDENCIES) $(EXTRA_test_nl_langinfo_DEPENDENCIES) 
        @rm -f test-nl_langinfo$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_nl_langinfo_OBJECTS) $(test_nl_langinfo_LDADD) $(LIBS)
 
+test-nl_langinfo-mt$(EXEEXT): $(test_nl_langinfo_mt_OBJECTS) $(test_nl_langinfo_mt_DEPENDENCIES) $(EXTRA_test_nl_langinfo_mt_DEPENDENCIES) 
+       @rm -f test-nl_langinfo-mt$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_nl_langinfo_mt_OBJECTS) $(test_nl_langinfo_mt_LDADD) $(LIBS)
+
 test-open$(EXEEXT): $(test_open_OBJECTS) $(test_open_DEPENDENCIES) $(EXTRA_test_open_DEPENDENCIES) 
        @rm -f test-open$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_open_OBJECTS) $(test_open_LDADD) $(LIBS)
 
+test-openat$(EXEEXT): $(test_openat_OBJECTS) $(test_openat_DEPENDENCIES) $(EXTRA_test_openat_DEPENDENCIES) 
+       @rm -f test-openat$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_openat_OBJECTS) $(test_openat_LDADD) $(LIBS)
+
 test-pathmax$(EXEEXT): $(test_pathmax_OBJECTS) $(test_pathmax_DEPENDENCIES) $(EXTRA_test_pathmax_DEPENDENCIES) 
        @rm -f test-pathmax$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_pathmax_OBJECTS) $(test_pathmax_LDADD) $(LIBS)
 
+test-perror$(EXEEXT): $(test_perror_OBJECTS) $(test_perror_DEPENDENCIES) $(EXTRA_test_perror_DEPENDENCIES) 
+       @rm -f test-perror$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_perror_OBJECTS) $(test_perror_LDADD) $(LIBS)
+
+test-perror2$(EXEEXT): $(test_perror2_OBJECTS) $(test_perror2_DEPENDENCIES) $(EXTRA_test_perror2_DEPENDENCIES) 
+       @rm -f test-perror2$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_perror2_OBJECTS) $(test_perror2_LDADD) $(LIBS)
+
+test-pipe$(EXEEXT): $(test_pipe_OBJECTS) $(test_pipe_DEPENDENCIES) $(EXTRA_test_pipe_DEPENDENCIES) 
+       @rm -f test-pipe$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_pipe_OBJECTS) $(test_pipe_LDADD) $(LIBS)
+
 test-pipe2$(EXEEXT): $(test_pipe2_OBJECTS) $(test_pipe2_DEPENDENCIES) $(EXTRA_test_pipe2_DEPENDENCIES) 
        @rm -f test-pipe2$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_pipe2_OBJECTS) $(test_pipe2_LDADD) $(LIBS)
 
-test-posix_spawn1$(EXEEXT): $(test_posix_spawn1_OBJECTS) $(test_posix_spawn1_DEPENDENCIES) $(EXTRA_test_posix_spawn1_DEPENDENCIES) 
-       @rm -f test-posix_spawn1$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(test_posix_spawn1_OBJECTS) $(test_posix_spawn1_LDADD) $(LIBS)
+test-posix_spawn-chdir$(EXEEXT): $(test_posix_spawn_chdir_OBJECTS) $(test_posix_spawn_chdir_DEPENDENCIES) $(EXTRA_test_posix_spawn_chdir_DEPENDENCIES) 
+       @rm -f test-posix_spawn-chdir$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_posix_spawn_chdir_OBJECTS) $(test_posix_spawn_chdir_LDADD) $(LIBS)
+
+test-posix_spawn-dup2-stdin$(EXEEXT): $(test_posix_spawn_dup2_stdin_OBJECTS) $(test_posix_spawn_dup2_stdin_DEPENDENCIES) $(EXTRA_test_posix_spawn_dup2_stdin_DEPENDENCIES) 
+       @rm -f test-posix_spawn-dup2-stdin$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_posix_spawn_dup2_stdin_OBJECTS) $(test_posix_spawn_dup2_stdin_LDADD) $(LIBS)
 
-test-posix_spawn2$(EXEEXT): $(test_posix_spawn2_OBJECTS) $(test_posix_spawn2_DEPENDENCIES) $(EXTRA_test_posix_spawn2_DEPENDENCIES) 
-       @rm -f test-posix_spawn2$(EXEEXT)
-       $(AM_V_CCLD)$(LINK) $(test_posix_spawn2_OBJECTS) $(test_posix_spawn2_LDADD) $(LIBS)
+test-posix_spawn-dup2-stdout$(EXEEXT): $(test_posix_spawn_dup2_stdout_OBJECTS) $(test_posix_spawn_dup2_stdout_DEPENDENCIES) $(EXTRA_test_posix_spawn_dup2_stdout_DEPENDENCIES) 
+       @rm -f test-posix_spawn-dup2-stdout$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_posix_spawn_dup2_stdout_OBJECTS) $(test_posix_spawn_dup2_stdout_LDADD) $(LIBS)
+
+test-posix_spawn-inherit0$(EXEEXT): $(test_posix_spawn_inherit0_OBJECTS) $(test_posix_spawn_inherit0_DEPENDENCIES) $(EXTRA_test_posix_spawn_inherit0_DEPENDENCIES) 
+       @rm -f test-posix_spawn-inherit0$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_posix_spawn_inherit0_OBJECTS) $(test_posix_spawn_inherit0_LDADD) $(LIBS)
+
+test-posix_spawn-inherit1$(EXEEXT): $(test_posix_spawn_inherit1_OBJECTS) $(test_posix_spawn_inherit1_DEPENDENCIES) $(EXTRA_test_posix_spawn_inherit1_DEPENDENCIES) 
+       @rm -f test-posix_spawn-inherit1$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_posix_spawn_inherit1_OBJECTS) $(test_posix_spawn_inherit1_LDADD) $(LIBS)
+
+test-posix_spawn-open1$(EXEEXT): $(test_posix_spawn_open1_OBJECTS) $(test_posix_spawn_open1_DEPENDENCIES) $(EXTRA_test_posix_spawn_open1_DEPENDENCIES) 
+       @rm -f test-posix_spawn-open1$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_posix_spawn_open1_OBJECTS) $(test_posix_spawn_open1_LDADD) $(LIBS)
+
+test-posix_spawn-open2$(EXEEXT): $(test_posix_spawn_open2_OBJECTS) $(test_posix_spawn_open2_DEPENDENCIES) $(EXTRA_test_posix_spawn_open2_DEPENDENCIES) 
+       @rm -f test-posix_spawn-open2$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_posix_spawn_open2_OBJECTS) $(test_posix_spawn_open2_LDADD) $(LIBS)
+
+test-posix_spawn-script$(EXEEXT): $(test_posix_spawn_script_OBJECTS) $(test_posix_spawn_script_DEPENDENCIES) $(EXTRA_test_posix_spawn_script_DEPENDENCIES) 
+       @rm -f test-posix_spawn-script$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_posix_spawn_script_OBJECTS) $(test_posix_spawn_script_LDADD) $(LIBS)
+
+test-posix_spawn_file_actions_addchdir$(EXEEXT): $(test_posix_spawn_file_actions_addchdir_OBJECTS) $(test_posix_spawn_file_actions_addchdir_DEPENDENCIES) $(EXTRA_test_posix_spawn_file_actions_addchdir_DEPENDENCIES) 
+       @rm -f test-posix_spawn_file_actions_addchdir$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_posix_spawn_file_actions_addchdir_OBJECTS) $(test_posix_spawn_file_actions_addchdir_LDADD) $(LIBS)
 
 test-posix_spawn_file_actions_addclose$(EXEEXT): $(test_posix_spawn_file_actions_addclose_OBJECTS) $(test_posix_spawn_file_actions_addclose_DEPENDENCIES) $(EXTRA_test_posix_spawn_file_actions_addclose_DEPENDENCIES) 
        @rm -f test-posix_spawn_file_actions_addclose$(EXEEXT)
@@ -3606,6 +5511,10 @@ test-posix_spawn_file_actions_addopen$(EXEEXT): $(test_posix_spawn_file_actions_
        @rm -f test-posix_spawn_file_actions_addopen$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_posix_spawn_file_actions_addopen_OBJECTS) $(test_posix_spawn_file_actions_addopen_LDADD) $(LIBS)
 
+test-posix_spawnp-script$(EXEEXT): $(test_posix_spawnp_script_OBJECTS) $(test_posix_spawnp_script_DEPENDENCIES) $(EXTRA_test_posix_spawnp_script_DEPENDENCIES) 
+       @rm -f test-posix_spawnp-script$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_posix_spawnp_script_OBJECTS) $(test_posix_spawnp_script_LDADD) $(LIBS)
+
 test-printf-frexp$(EXEEXT): $(test_printf_frexp_OBJECTS) $(test_printf_frexp_DEPENDENCIES) $(EXTRA_test_printf_frexp_DEPENDENCIES) 
        @rm -f test-printf-frexp$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_printf_frexp_OBJECTS) $(test_printf_frexp_LDADD) $(LIBS)
@@ -3614,6 +5523,26 @@ test-printf-frexpl$(EXEEXT): $(test_printf_frexpl_OBJECTS) $(test_printf_frexpl_
        @rm -f test-printf-frexpl$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_printf_frexpl_OBJECTS) $(test_printf_frexpl_LDADD) $(LIBS)
 
+test-pthread$(EXEEXT): $(test_pthread_OBJECTS) $(test_pthread_DEPENDENCIES) $(EXTRA_test_pthread_DEPENDENCIES) 
+       @rm -f test-pthread$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_pthread_OBJECTS) $(test_pthread_LDADD) $(LIBS)
+
+test-pthread-c++$(EXEEXT): $(test_pthread_c___OBJECTS) $(test_pthread_c___DEPENDENCIES) $(EXTRA_test_pthread_c___DEPENDENCIES) 
+       @rm -f test-pthread-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_pthread_c___OBJECTS) $(test_pthread_c___LDADD) $(LIBS)
+
+test-pthread-thread$(EXEEXT): $(test_pthread_thread_OBJECTS) $(test_pthread_thread_DEPENDENCIES) $(EXTRA_test_pthread_thread_DEPENDENCIES) 
+       @rm -f test-pthread-thread$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_pthread_thread_OBJECTS) $(test_pthread_thread_LDADD) $(LIBS)
+
+test-pthread_sigmask1$(EXEEXT): $(test_pthread_sigmask1_OBJECTS) $(test_pthread_sigmask1_DEPENDENCIES) $(EXTRA_test_pthread_sigmask1_DEPENDENCIES) 
+       @rm -f test-pthread_sigmask1$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_pthread_sigmask1_OBJECTS) $(test_pthread_sigmask1_LDADD) $(LIBS)
+
+test-pthread_sigmask2$(EXEEXT): $(test_pthread_sigmask2_OBJECTS) $(test_pthread_sigmask2_DEPENDENCIES) $(EXTRA_test_pthread_sigmask2_DEPENDENCIES) 
+       @rm -f test-pthread_sigmask2$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_pthread_sigmask2_OBJECTS) $(test_pthread_sigmask2_LDADD) $(LIBS)
+
 test-quotearg-simple$(EXEEXT): $(test_quotearg_simple_OBJECTS) $(test_quotearg_simple_DEPENDENCIES) $(EXTRA_test_quotearg_simple_DEPENDENCIES) 
        @rm -f test-quotearg-simple$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_quotearg_simple_OBJECTS) $(test_quotearg_simple_LDADD) $(LIBS)
@@ -3626,10 +5555,22 @@ test-rawmemchr$(EXEEXT): $(test_rawmemchr_OBJECTS) $(test_rawmemchr_DEPENDENCIES
        @rm -f test-rawmemchr$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_rawmemchr_OBJECTS) $(test_rawmemchr_LDADD) $(LIBS)
 
+test-read-file$(EXEEXT): $(test_read_file_OBJECTS) $(test_read_file_DEPENDENCIES) $(EXTRA_test_read_file_DEPENDENCIES) 
+       @rm -f test-read-file$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_read_file_OBJECTS) $(test_read_file_LDADD) $(LIBS)
+
 test-readlink$(EXEEXT): $(test_readlink_OBJECTS) $(test_readlink_DEPENDENCIES) $(EXTRA_test_readlink_DEPENDENCIES) 
        @rm -f test-readlink$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_readlink_OBJECTS) $(test_readlink_LDADD) $(LIBS)
 
+test-realloc-gnu$(EXEEXT): $(test_realloc_gnu_OBJECTS) $(test_realloc_gnu_DEPENDENCIES) $(EXTRA_test_realloc_gnu_DEPENDENCIES) 
+       @rm -f test-realloc-gnu$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_realloc_gnu_OBJECTS) $(test_realloc_gnu_LDADD) $(LIBS)
+
+test-reallocarray$(EXEEXT): $(test_reallocarray_OBJECTS) $(test_reallocarray_DEPENDENCIES) $(EXTRA_test_reallocarray_DEPENDENCIES) 
+       @rm -f test-reallocarray$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_reallocarray_OBJECTS) $(test_reallocarray_LDADD) $(LIBS)
+
 test-regex$(EXEEXT): $(test_regex_OBJECTS) $(test_regex_DEPENDENCIES) $(EXTRA_test_regex_DEPENDENCIES) 
        @rm -f test-regex$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_regex_OBJECTS) $(test_regex_LDADD) $(LIBS)
@@ -3646,6 +5587,22 @@ test-sched$(EXEEXT): $(test_sched_OBJECTS) $(test_sched_DEPENDENCIES) $(EXTRA_te
        @rm -f test-sched$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_sched_OBJECTS) $(test_sched_LDADD) $(LIBS)
 
+test-scratch-buffer$(EXEEXT): $(test_scratch_buffer_OBJECTS) $(test_scratch_buffer_DEPENDENCIES) $(EXTRA_test_scratch_buffer_DEPENDENCIES) 
+       @rm -f test-scratch-buffer$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_scratch_buffer_OBJECTS) $(test_scratch_buffer_LDADD) $(LIBS)
+
+test-select$(EXEEXT): $(test_select_OBJECTS) $(test_select_DEPENDENCIES) $(EXTRA_test_select_DEPENDENCIES) 
+       @rm -f test-select$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_select_OBJECTS) $(test_select_LDADD) $(LIBS)
+
+test-select-fd$(EXEEXT): $(test_select_fd_OBJECTS) $(test_select_fd_DEPENDENCIES) $(EXTRA_test_select_fd_DEPENDENCIES) 
+       @rm -f test-select-fd$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_select_fd_OBJECTS) $(test_select_fd_LDADD) $(LIBS)
+
+test-select-stdin$(EXEEXT): $(test_select_stdin_OBJECTS) $(test_select_stdin_DEPENDENCIES) $(EXTRA_test_select_stdin_DEPENDENCIES) 
+       @rm -f test-select-stdin$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_select_stdin_OBJECTS) $(test_select_stdin_LDADD) $(LIBS)
+
 test-setenv$(EXEEXT): $(test_setenv_OBJECTS) $(test_setenv_DEPENDENCIES) $(EXTRA_test_setenv_DEPENDENCIES) 
        @rm -f test-setenv$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_setenv_OBJECTS) $(test_setenv_LDADD) $(LIBS)
@@ -3658,6 +5615,22 @@ test-setlocale2$(EXEEXT): $(test_setlocale2_OBJECTS) $(test_setlocale2_DEPENDENC
        @rm -f test-setlocale2$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_setlocale2_OBJECTS) $(test_setlocale2_LDADD) $(LIBS)
 
+test-setlocale_null$(EXEEXT): $(test_setlocale_null_OBJECTS) $(test_setlocale_null_DEPENDENCIES) $(EXTRA_test_setlocale_null_DEPENDENCIES) 
+       @rm -f test-setlocale_null$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_setlocale_null_OBJECTS) $(test_setlocale_null_LDADD) $(LIBS)
+
+test-setlocale_null-mt-all$(EXEEXT): $(test_setlocale_null_mt_all_OBJECTS) $(test_setlocale_null_mt_all_DEPENDENCIES) $(EXTRA_test_setlocale_null_mt_all_DEPENDENCIES) 
+       @rm -f test-setlocale_null-mt-all$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_setlocale_null_mt_all_OBJECTS) $(test_setlocale_null_mt_all_LDADD) $(LIBS)
+
+test-setlocale_null-mt-one$(EXEEXT): $(test_setlocale_null_mt_one_OBJECTS) $(test_setlocale_null_mt_one_DEPENDENCIES) $(EXTRA_test_setlocale_null_mt_one_DEPENDENCIES) 
+       @rm -f test-setlocale_null-mt-one$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_setlocale_null_mt_one_OBJECTS) $(test_setlocale_null_mt_one_LDADD) $(LIBS)
+
+test-setsockopt$(EXEEXT): $(test_setsockopt_OBJECTS) $(test_setsockopt_DEPENDENCIES) $(EXTRA_test_setsockopt_DEPENDENCIES) 
+       @rm -f test-setsockopt$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_setsockopt_OBJECTS) $(test_setsockopt_LDADD) $(LIBS)
+
 test-sigaction$(EXEEXT): $(test_sigaction_OBJECTS) $(test_sigaction_DEPENDENCIES) $(EXTRA_test_sigaction_DEPENDENCIES) 
        @rm -f test-sigaction$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_sigaction_OBJECTS) $(test_sigaction_LDADD) $(LIBS)
@@ -3682,6 +5655,22 @@ test-sigprocmask$(EXEEXT): $(test_sigprocmask_OBJECTS) $(test_sigprocmask_DEPEND
        @rm -f test-sigprocmask$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_sigprocmask_OBJECTS) $(test_sigprocmask_LDADD) $(LIBS)
 
+test-sigsegv-catch-segv1$(EXEEXT): $(test_sigsegv_catch_segv1_OBJECTS) $(test_sigsegv_catch_segv1_DEPENDENCIES) $(EXTRA_test_sigsegv_catch_segv1_DEPENDENCIES) 
+       @rm -f test-sigsegv-catch-segv1$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sigsegv_catch_segv1_OBJECTS) $(test_sigsegv_catch_segv1_LDADD) $(LIBS)
+
+test-sigsegv-catch-segv2$(EXEEXT): $(test_sigsegv_catch_segv2_OBJECTS) $(test_sigsegv_catch_segv2_DEPENDENCIES) $(EXTRA_test_sigsegv_catch_segv2_DEPENDENCIES) 
+       @rm -f test-sigsegv-catch-segv2$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sigsegv_catch_segv2_OBJECTS) $(test_sigsegv_catch_segv2_LDADD) $(LIBS)
+
+test-sigsegv-catch-stackoverflow1$(EXEEXT): $(test_sigsegv_catch_stackoverflow1_OBJECTS) $(test_sigsegv_catch_stackoverflow1_DEPENDENCIES) $(EXTRA_test_sigsegv_catch_stackoverflow1_DEPENDENCIES) 
+       @rm -f test-sigsegv-catch-stackoverflow1$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sigsegv_catch_stackoverflow1_OBJECTS) $(test_sigsegv_catch_stackoverflow1_LDADD) $(LIBS)
+
+test-sigsegv-catch-stackoverflow2$(EXEEXT): $(test_sigsegv_catch_stackoverflow2_OBJECTS) $(test_sigsegv_catch_stackoverflow2_DEPENDENCIES) $(EXTRA_test_sigsegv_catch_stackoverflow2_DEPENDENCIES) 
+       @rm -f test-sigsegv-catch-stackoverflow2$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sigsegv_catch_stackoverflow2_OBJECTS) $(test_sigsegv_catch_stackoverflow2_LDADD) $(LIBS)
+
 test-sleep$(EXEEXT): $(test_sleep_OBJECTS) $(test_sleep_DEPENDENCIES) $(EXTRA_test_sleep_DEPENDENCIES) 
        @rm -f test-sleep$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_sleep_OBJECTS) $(test_sleep_LDADD) $(LIBS)
@@ -3690,6 +5679,10 @@ test-snprintf$(EXEEXT): $(test_snprintf_OBJECTS) $(test_snprintf_DEPENDENCIES) $
        @rm -f test-snprintf$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_snprintf_OBJECTS) $(test_snprintf_LDADD) $(LIBS)
 
+test-sockets$(EXEEXT): $(test_sockets_OBJECTS) $(test_sockets_DEPENDENCIES) $(EXTRA_test_sockets_DEPENDENCIES) 
+       @rm -f test-sockets$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sockets_OBJECTS) $(test_sockets_LDADD) $(LIBS)
+
 test-spawn$(EXEEXT): $(test_spawn_OBJECTS) $(test_spawn_DEPENDENCIES) $(EXTRA_test_spawn_DEPENDENCIES) 
        @rm -f test-spawn$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_spawn_OBJECTS) $(test_spawn_LDADD) $(LIBS)
@@ -3706,10 +5699,18 @@ test-spawn-pipe-main$(EXEEXT): $(test_spawn_pipe_main_OBJECTS) $(test_spawn_pipe
        @rm -f test-spawn-pipe-main$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_spawn_pipe_main_OBJECTS) $(test_spawn_pipe_main_LDADD) $(LIBS)
 
+test-spawn-pipe-script$(EXEEXT): $(test_spawn_pipe_script_OBJECTS) $(test_spawn_pipe_script_DEPENDENCIES) $(EXTRA_test_spawn_pipe_script_DEPENDENCIES) 
+       @rm -f test-spawn-pipe-script$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_spawn_pipe_script_OBJECTS) $(test_spawn_pipe_script_LDADD) $(LIBS)
+
 test-stat$(EXEEXT): $(test_stat_OBJECTS) $(test_stat_DEPENDENCIES) $(EXTRA_test_stat_DEPENDENCIES) 
        @rm -f test-stat$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_stat_OBJECTS) $(test_stat_LDADD) $(LIBS)
 
+test-stat-time$(EXEEXT): $(test_stat_time_OBJECTS) $(test_stat_time_DEPENDENCIES) $(EXTRA_test_stat_time_DEPENDENCIES) 
+       @rm -f test-stat-time$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_stat_time_OBJECTS) $(test_stat_time_LDADD) $(LIBS)
+
 test-stdalign$(EXEEXT): $(test_stdalign_OBJECTS) $(test_stdalign_DEPENDENCIES) $(EXTRA_test_stdalign_DEPENDENCIES) 
        @rm -f test-stdalign$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_stdalign_OBJECTS) $(test_stdalign_LDADD) $(LIBS)
@@ -3718,14 +5719,26 @@ test-stdbool$(EXEEXT): $(test_stdbool_OBJECTS) $(test_stdbool_DEPENDENCIES) $(EX
        @rm -f test-stdbool$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_stdbool_OBJECTS) $(test_stdbool_LDADD) $(LIBS)
 
+test-stdbool-c++$(EXEEXT): $(test_stdbool_c___OBJECTS) $(test_stdbool_c___DEPENDENCIES) $(EXTRA_test_stdbool_c___DEPENDENCIES) 
+       @rm -f test-stdbool-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_stdbool_c___OBJECTS) $(test_stdbool_c___LDADD) $(LIBS)
+
 test-stddef$(EXEEXT): $(test_stddef_OBJECTS) $(test_stddef_DEPENDENCIES) $(EXTRA_test_stddef_DEPENDENCIES) 
        @rm -f test-stddef$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_stddef_OBJECTS) $(test_stddef_LDADD) $(LIBS)
 
+test-stddef-c++$(EXEEXT): $(test_stddef_c___OBJECTS) $(test_stddef_c___DEPENDENCIES) $(EXTRA_test_stddef_c___DEPENDENCIES) 
+       @rm -f test-stddef-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_stddef_c___OBJECTS) $(test_stddef_c___LDADD) $(LIBS)
+
 test-stdint$(EXEEXT): $(test_stdint_OBJECTS) $(test_stdint_DEPENDENCIES) $(EXTRA_test_stdint_DEPENDENCIES) 
        @rm -f test-stdint$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_stdint_OBJECTS) $(test_stdint_LDADD) $(LIBS)
 
+test-stdint-c++$(EXEEXT): $(test_stdint_c___OBJECTS) $(test_stdint_c___DEPENDENCIES) $(EXTRA_test_stdint_c___DEPENDENCIES) 
+       @rm -f test-stdint-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_stdint_c___OBJECTS) $(test_stdint_c___LDADD) $(LIBS)
+
 test-stdio$(EXEEXT): $(test_stdio_OBJECTS) $(test_stdio_DEPENDENCIES) $(EXTRA_test_stdio_DEPENDENCIES) 
        @rm -f test-stdio$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_stdio_OBJECTS) $(test_stdio_LDADD) $(LIBS)
@@ -3750,6 +5763,14 @@ test-strerror$(EXEEXT): $(test_strerror_OBJECTS) $(test_strerror_DEPENDENCIES) $
        @rm -f test-strerror$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_strerror_OBJECTS) $(test_strerror_LDADD) $(LIBS)
 
+test-strerror_r$(EXEEXT): $(test_strerror_r_OBJECTS) $(test_strerror_r_DEPENDENCIES) $(EXTRA_test_strerror_r_DEPENDENCIES) 
+       @rm -f test-strerror_r$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_strerror_r_OBJECTS) $(test_strerror_r_LDADD) $(LIBS)
+
+test-striconv$(EXEEXT): $(test_striconv_OBJECTS) $(test_striconv_DEPENDENCIES) $(EXTRA_test_striconv_DEPENDENCIES) 
+       @rm -f test-striconv$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_striconv_OBJECTS) $(test_striconv_LDADD) $(LIBS)
+
 test-string$(EXEEXT): $(test_string_OBJECTS) $(test_string_DEPENDENCIES) $(EXTRA_test_string_DEPENDENCIES) 
        @rm -f test-string$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_string_OBJECTS) $(test_string_LDADD) $(LIBS)
@@ -3774,10 +5795,46 @@ test-strtod$(EXEEXT): $(test_strtod_OBJECTS) $(test_strtod_DEPENDENCIES) $(EXTRA
        @rm -f test-strtod$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_strtod_OBJECTS) $(test_strtod_LDADD) $(LIBS)
 
+test-strtod1$(EXEEXT): $(test_strtod1_OBJECTS) $(test_strtod1_DEPENDENCIES) $(EXTRA_test_strtod1_DEPENDENCIES) 
+       @rm -f test-strtod1$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_strtod1_OBJECTS) $(test_strtod1_LDADD) $(LIBS)
+
 test-symlink$(EXEEXT): $(test_symlink_OBJECTS) $(test_symlink_DEPENDENCIES) $(EXTRA_test_symlink_DEPENDENCIES) 
        @rm -f test-symlink$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_symlink_OBJECTS) $(test_symlink_LDADD) $(LIBS)
 
+test-sys_ioctl$(EXEEXT): $(test_sys_ioctl_OBJECTS) $(test_sys_ioctl_DEPENDENCIES) $(EXTRA_test_sys_ioctl_DEPENDENCIES) 
+       @rm -f test-sys_ioctl$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sys_ioctl_OBJECTS) $(test_sys_ioctl_LDADD) $(LIBS)
+
+test-sys_ioctl-c++$(EXEEXT): $(test_sys_ioctl_c___OBJECTS) $(test_sys_ioctl_c___DEPENDENCIES) $(EXTRA_test_sys_ioctl_c___DEPENDENCIES) 
+       @rm -f test-sys_ioctl-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_sys_ioctl_c___OBJECTS) $(test_sys_ioctl_c___LDADD) $(LIBS)
+
+test-sys_random$(EXEEXT): $(test_sys_random_OBJECTS) $(test_sys_random_DEPENDENCIES) $(EXTRA_test_sys_random_DEPENDENCIES) 
+       @rm -f test-sys_random$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sys_random_OBJECTS) $(test_sys_random_LDADD) $(LIBS)
+
+test-sys_random-c++$(EXEEXT): $(test_sys_random_c___OBJECTS) $(test_sys_random_c___DEPENDENCIES) $(EXTRA_test_sys_random_c___DEPENDENCIES) 
+       @rm -f test-sys_random-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_sys_random_c___OBJECTS) $(test_sys_random_c___LDADD) $(LIBS)
+
+test-sys_select$(EXEEXT): $(test_sys_select_OBJECTS) $(test_sys_select_DEPENDENCIES) $(EXTRA_test_sys_select_DEPENDENCIES) 
+       @rm -f test-sys_select$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sys_select_OBJECTS) $(test_sys_select_LDADD) $(LIBS)
+
+test-sys_select-c++$(EXEEXT): $(test_sys_select_c___OBJECTS) $(test_sys_select_c___DEPENDENCIES) $(EXTRA_test_sys_select_c___DEPENDENCIES) 
+       @rm -f test-sys_select-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_sys_select_c___OBJECTS) $(test_sys_select_c___LDADD) $(LIBS)
+
+test-sys_socket$(EXEEXT): $(test_sys_socket_OBJECTS) $(test_sys_socket_DEPENDENCIES) $(EXTRA_test_sys_socket_DEPENDENCIES) 
+       @rm -f test-sys_socket$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sys_socket_OBJECTS) $(test_sys_socket_LDADD) $(LIBS)
+
+test-sys_socket-c++$(EXEEXT): $(test_sys_socket_c___OBJECTS) $(test_sys_socket_c___DEPENDENCIES) $(EXTRA_test_sys_socket_c___DEPENDENCIES) 
+       @rm -f test-sys_socket-c++$(EXEEXT)
+       $(AM_V_CXXLD)$(CXXLINK) $(test_sys_socket_c___OBJECTS) $(test_sys_socket_c___LDADD) $(LIBS)
+
 test-sys_stat$(EXEEXT): $(test_sys_stat_OBJECTS) $(test_sys_stat_DEPENDENCIES) $(EXTRA_test_sys_stat_DEPENDENCIES) 
        @rm -f test-sys_stat$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_sys_stat_OBJECTS) $(test_sys_stat_LDADD) $(LIBS)
@@ -3802,6 +5859,10 @@ test-sys_types-c++$(EXEEXT): $(test_sys_types_c___OBJECTS) $(test_sys_types_c___
        @rm -f test-sys_types-c++$(EXEEXT)
        $(AM_V_CXXLD)$(CXXLINK) $(test_sys_types_c___OBJECTS) $(test_sys_types_c___LDADD) $(LIBS)
 
+test-sys_uio$(EXEEXT): $(test_sys_uio_OBJECTS) $(test_sys_uio_DEPENDENCIES) $(EXTRA_test_sys_uio_DEPENDENCIES) 
+       @rm -f test-sys_uio$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_sys_uio_OBJECTS) $(test_sys_uio_LDADD) $(LIBS)
+
 test-sys_wait$(EXEEXT): $(test_sys_wait_OBJECTS) $(test_sys_wait_DEPENDENCIES) $(EXTRA_test_sys_wait_DEPENDENCIES) 
        @rm -f test-sys_wait$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_sys_wait_OBJECTS) $(test_sys_wait_LDADD) $(LIBS)
@@ -3810,6 +5871,14 @@ test-sys_wait-c++$(EXEEXT): $(test_sys_wait_c___OBJECTS) $(test_sys_wait_c___DEP
        @rm -f test-sys_wait-c++$(EXEEXT)
        $(AM_V_CXXLD)$(CXXLINK) $(test_sys_wait_c___OBJECTS) $(test_sys_wait_c___LDADD) $(LIBS)
 
+test-thread_create$(EXEEXT): $(test_thread_create_OBJECTS) $(test_thread_create_DEPENDENCIES) $(EXTRA_test_thread_create_DEPENDENCIES) 
+       @rm -f test-thread_create$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_thread_create_OBJECTS) $(test_thread_create_LDADD) $(LIBS)
+
+test-thread_self$(EXEEXT): $(test_thread_self_OBJECTS) $(test_thread_self_DEPENDENCIES) $(EXTRA_test_thread_self_DEPENDENCIES) 
+       @rm -f test-thread_self$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_thread_self_OBJECTS) $(test_thread_self_LDADD) $(LIBS)
+
 test-time$(EXEEXT): $(test_time_OBJECTS) $(test_time_DEPENDENCIES) $(EXTRA_test_time_DEPENDENCIES) 
        @rm -f test-time$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_time_OBJECTS) $(test_time_LDADD) $(LIBS)
@@ -3817,6 +5886,42 @@ test-time$(EXEEXT): $(test_time_OBJECTS) $(test_time_DEPENDENCIES) $(EXTRA_test_
 test-time-c++$(EXEEXT): $(test_time_c___OBJECTS) $(test_time_c___DEPENDENCIES) $(EXTRA_test_time_c___DEPENDENCIES) 
        @rm -f test-time-c++$(EXEEXT)
        $(AM_V_CXXLD)$(CXXLINK) $(test_time_c___OBJECTS) $(test_time_c___LDADD) $(LIBS)
+unistr/$(am__dirstamp):
+       @$(MKDIR_P) unistr
+       @: > unistr/$(am__dirstamp)
+unistr/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) unistr/$(DEPDIR)
+       @: > unistr/$(DEPDIR)/$(am__dirstamp)
+unistr/test-u8-mbtoucr.$(OBJEXT): unistr/$(am__dirstamp) \
+       unistr/$(DEPDIR)/$(am__dirstamp)
+
+test-u8-mbtoucr$(EXEEXT): $(test_u8_mbtoucr_OBJECTS) $(test_u8_mbtoucr_DEPENDENCIES) $(EXTRA_test_u8_mbtoucr_DEPENDENCIES) 
+       @rm -f test-u8-mbtoucr$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_u8_mbtoucr_OBJECTS) $(test_u8_mbtoucr_LDADD) $(LIBS)
+unistr/test-u8-uctomb.$(OBJEXT): unistr/$(am__dirstamp) \
+       unistr/$(DEPDIR)/$(am__dirstamp)
+
+test-u8-uctomb$(EXEEXT): $(test_u8_uctomb_OBJECTS) $(test_u8_uctomb_DEPENDENCIES) $(EXTRA_test_u8_uctomb_DEPENDENCIES) 
+       @rm -f test-u8-uctomb$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_u8_uctomb_OBJECTS) $(test_u8_uctomb_LDADD) $(LIBS)
+uniwidth/$(am__dirstamp):
+       @$(MKDIR_P) uniwidth
+       @: > uniwidth/$(am__dirstamp)
+uniwidth/$(DEPDIR)/$(am__dirstamp):
+       @$(MKDIR_P) uniwidth/$(DEPDIR)
+       @: > uniwidth/$(DEPDIR)/$(am__dirstamp)
+uniwidth/test-uc_width.$(OBJEXT): uniwidth/$(am__dirstamp) \
+       uniwidth/$(DEPDIR)/$(am__dirstamp)
+
+test-uc_width$(EXEEXT): $(test_uc_width_OBJECTS) $(test_uc_width_DEPENDENCIES) $(EXTRA_test_uc_width_DEPENDENCIES) 
+       @rm -f test-uc_width$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_uc_width_OBJECTS) $(test_uc_width_LDADD) $(LIBS)
+uniwidth/test-uc_width2.$(OBJEXT): uniwidth/$(am__dirstamp) \
+       uniwidth/$(DEPDIR)/$(am__dirstamp)
+
+test-uc_width2$(EXEEXT): $(test_uc_width2_OBJECTS) $(test_uc_width2_DEPENDENCIES) $(EXTRA_test_uc_width2_DEPENDENCIES) 
+       @rm -f test-uc_width2$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_uc_width2_OBJECTS) $(test_uc_width2_LDADD) $(LIBS)
 
 test-unistd$(EXEEXT): $(test_unistd_OBJECTS) $(test_unistd_DEPENDENCIES) $(EXTRA_test_unistd_DEPENDENCIES) 
        @rm -f test-unistd$(EXEEXT)
@@ -3846,6 +5951,10 @@ test-verify$(EXEEXT): $(test_verify_OBJECTS) $(test_verify_DEPENDENCIES) $(EXTRA
        @rm -f test-verify$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_verify_OBJECTS) $(test_verify_LDADD) $(LIBS)
 
+test-verify-try$(EXEEXT): $(test_verify_try_OBJECTS) $(test_verify_try_DEPENDENCIES) $(EXTRA_test_verify_try_DEPENDENCIES) 
+       @rm -f test-verify-try$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_verify_try_OBJECTS) $(test_verify_try_LDADD) $(LIBS)
+
 test-version-etc$(EXEEXT): $(test_version_etc_OBJECTS) $(test_version_etc_DEPENDENCIES) $(EXTRA_test_version_etc_DEPENDENCIES) 
        @rm -f test-version-etc$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_version_etc_OBJECTS) $(test_version_etc_LDADD) $(LIBS)
@@ -3874,6 +5983,10 @@ test-wctype-h-c++$(EXEEXT): $(test_wctype_h_c___OBJECTS) $(test_wctype_h_c___DEP
        @rm -f test-wctype-h-c++$(EXEEXT)
        $(AM_V_CXXLD)$(CXXLINK) $(test_wctype_h_c___OBJECTS) $(test_wctype_h_c___LDADD) $(LIBS)
 
+test-wcwidth$(EXEEXT): $(test_wcwidth_OBJECTS) $(test_wcwidth_DEPENDENCIES) $(EXTRA_test_wcwidth_DEPENDENCIES) 
+       @rm -f test-wcwidth$(EXEEXT)
+       $(AM_V_CCLD)$(LINK) $(test_wcwidth_OBJECTS) $(test_wcwidth_LDADD) $(LIBS)
+
 test-write$(EXEEXT): $(test_write_OBJECTS) $(test_write_DEPENDENCIES) $(EXTRA_test_write_DEPENDENCIES) 
        @rm -f test-write$(EXEEXT)
        $(AM_V_CCLD)$(LINK) $(test_write_OBJECTS) $(test_write_LDADD) $(LIBS)
@@ -3888,209 +6001,366 @@ test-xvasprintf$(EXEEXT): $(test_xvasprintf_OBJECTS) $(test_xvasprintf_DEPENDENC
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
+       -rm -f glthread/*.$(OBJEXT)
+       -rm -f unistr/*.$(OBJEXT)
+       -rm -f uniwidth/*.$(OBJEXT)
 
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/closedir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dirfd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdopen.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd-lgpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpagesize.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_array_list.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_array_oset.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isblank.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localename.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opendir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/putenv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randomd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randoml.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setenv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setlocale.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strdup.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-alignof.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-alloca-opt.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-array_list.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-array_oset.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-avltree_oset.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-binary-io.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-btowc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-ctype.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-stack.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-strcasecmp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-strncasecmp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-canonicalize-lgpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-chdir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cloexec.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-close.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-closein.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ctype.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dirent-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dirent.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dirname.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dup-safer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dup.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dup2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-environ.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-errno.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fclose.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl-h-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl-h.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fdopen.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fflush.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fflush2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fgetc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-filenamecat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-float.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fopen-safer.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fopen.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fpending.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fpurge.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fputc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fread.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-freadahead.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-freading.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-frexp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-frexpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fseek.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fseeko.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fseeko3.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fseeko4.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fstat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftell.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftell3.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftello.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftello3.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftello4.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fwrite.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getcwd-lgpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getdtablesize.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getopt-gnu.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getopt-posix.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getprogname.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-gettimeofday.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ignore-value.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-intprops.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttypes.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isblank.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isnand-nolibm.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isnanf-nolibm.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isnanl-nolibm.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-langinfo-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-langinfo.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-limits-h.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-link.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-linkedhash_list.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-locale-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-locale-c++2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-locale.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-localeconv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-localename.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lseek.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lstat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-malloca.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-math-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-math-c++2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-math.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbrtowc-w32.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbrtowc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsinit.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memchr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memchr2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nl_langinfo.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-open.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pathmax.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pipe2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn_file_actions_addclose.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn_file_actions_adddup2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn_file_actions_addopen.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-printf-frexp.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-printf-frexpl.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-quotearg-simple.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-raise.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rawmemchr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-readlink.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-regex.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rename.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rmdir.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sched.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setenv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale1.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigaction.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signal-h-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signal-h-c++2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signal-h.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signbit.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigpipe.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigprocmask.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sleep.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-snprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-spawn-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-spawn-pipe-child.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-spawn-pipe-main.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-spawn.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdalign.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdbool.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stddef.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdint.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdio-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdio-c++2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdio.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdlib-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdlib-c++2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdlib.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strchrnul.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strerror.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string-c++2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strnlen.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strsignal.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strstr.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strtod.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-symlink.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_stat-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_stat.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_time-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_time.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_types-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_types.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_wait-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_wait.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-time-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-time-c++2.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-time.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unistd-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unistd.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unsetenv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasnprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasprintf-posix.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-verify.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-version-etc.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcrtomb-w32.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcrtomb.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wctype-h-c++.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wctype-h.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-write.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xalloc-die.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xvasprintf.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsetenv.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctob.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctomb.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alloca.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/anytostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bind.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/connect.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/explicit_bzero.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/findprog.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettimeofday.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_array_list.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gl_array_oset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imaxtostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet_pton.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inttostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/isblank.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/locale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/offtostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread-thread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pthread_sigmask.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/putenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randomd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/randoml.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-file.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_yield.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setsockopt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socket.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockets.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strerror_r.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sys_socket.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-accept.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-access.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-alignof.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-alloca-opt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-arpa_inet-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-arpa_inet.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-array_list.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-array_oset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-asyncsafe-spin1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-asyncsafe-spin2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-avltree_oset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-binary-io.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-bind.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-bitrotate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-btowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-ctype.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-stack.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-strcasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-c-strncasecmp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-calloc-gnu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-canonicalize-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-canonicalize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-chdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-cloexec.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-close.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-closein.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-connect.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-creat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ctype-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ctype-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ctype.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dirent-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dirent.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dirname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dup-safer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dup.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dup2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dynarray.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-environ.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-errno-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-errno-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-errno.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-execute-child.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-execute-main.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-explicit_bzero.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fchdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fclose.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl-h-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fcntl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fdopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fdopendir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fflush.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fflush2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fgetc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-filenamecat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-float-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-float-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-float.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fopen-gnu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fopen-safer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fpending.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fpurge.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fputc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-freadahead.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-freading.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-free.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-freopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-frexp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-frexpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fseek.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fseeko.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fseeko3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fseeko4.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fstat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fstatat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftell.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftell3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftello.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftello3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftello4.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ftruncate.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-fwrite.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getcwd-lgpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getcwd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getdtablesize.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getopt-gnu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getprogname.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-getrandom.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-gettimeofday.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-hard-locale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-hash.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iconv-h-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iconv-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ignore-value.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inet_pton.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-intprops.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttypes-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttypes-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-inttypes.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-ioctl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isblank.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isnand-nolibm.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isnanf-nolibm.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-isnanl-nolibm.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iswblank.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iswdigit.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-iswxdigit.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-langinfo-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-langinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-limits-h-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-limits-h-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-limits-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-link.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-linked_list.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-linkedhash_list.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-listen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-localcharset.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-locale-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-locale-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-locale.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-localeconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-localename.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lseek.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-lstat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-malloc-gnu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-malloca.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-math-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-math-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-math.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbrtowc-w32.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbrtowc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsinit.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsstr1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsstr2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mbsstr3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memchr2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-memrchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-mkdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nanosleep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-netinet_in.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nl_langinfo-mt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-nl_langinfo.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-open.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-openat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pathmax.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-perror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-perror2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pipe.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pipe2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn-chdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn-dup2-stdin.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn-dup2-stdout.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn-inherit0.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn-inherit1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn-open1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn-open2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn_file_actions_addchdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn_file_actions_addclose.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn_file_actions_adddup2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-posix_spawn_file_actions_addopen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-printf-frexp.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-printf-frexpl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pthread-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pthread-thread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pthread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pthread_sigmask1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-pthread_sigmask2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-quotearg-simple.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-raise.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rawmemchr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-read-file.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-readlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-realloc-gnu.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-reallocarray.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-regex.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rename.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-rmdir.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sched.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-scratch-buffer.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select-fd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select-stdin.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-select.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale_null-mt-all.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale_null-mt-one.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setlocale_null.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-setsockopt.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigaction.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signal-h-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signal-h-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signal-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-signbit.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigpipe.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigprocmask.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigsegv-catch-segv1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigsegv-catch-segv2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigsegv-catch-stackoverflow1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sigsegv-catch-stackoverflow2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sleep.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-snprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sockets.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-spawn-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-spawn-pipe-child.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-spawn-pipe-main.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-spawn.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stat-time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdalign.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdbool-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdbool-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdbool.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stddef-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stddef-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stddef.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdint-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdint-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdint.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdio-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdio-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdio.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdlib-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdlib-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-stdlib.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strchrnul.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strerror.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strerror_r.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-striconv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-string.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strnlen.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strsignal.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strstr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strtod.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-strtod1.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-symlink.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_ioctl-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_ioctl.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_random-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_random.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_select-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_select.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_socket-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_socket.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_stat-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_stat.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_time-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_types-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_types.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_uio.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_wait-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-sys_wait.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-thread_create.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-thread_self.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-time-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-time-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-time.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unistd-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unistd.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-unsetenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasnprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasprintf-posix.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-vasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-verify-try.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-verify.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-version-etc.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar-c++3.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wchar.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcrtomb-w32.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcrtomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wctype-h-c++.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wctype-h-c++2.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wctype-h.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-wcwidth.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-write.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xalloc-die.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-xvasprintf.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_execute_script-test-execute-script.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_posix_spawn_script-test-posix_spawn-script.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_posix_spawnp_script-test-posix_spawnp-script.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_spawn_pipe_script-test-spawn-pipe-script.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uinttostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umaxtostr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unsetenv.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vma-iter.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctob.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wctomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/windows-thread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/write.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xconcat-filename.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@glthread/$(DEPDIR)/thread.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/test-u8-mbtoucr.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@unistr/$(DEPDIR)/test-u8-uctomb.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@uniwidth/$(DEPDIR)/test-uc_width.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@uniwidth/$(DEPDIR)/test-uc_width2.Po@am__quote@ # am--include-marker
+
+$(am__depfiles_remade):
+       @$(MKDIR_P) $(@D)
+       @echo '# dummy' >$@-t && $(am__mv) $@-t $@
+
+am--depfiles: $(am__depfiles_remade)
 
 .c.o:
 @am__fastdepCC_TRUE@   $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
@@ -4108,6 +6378,62 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
 
+test_execute_script-test-execute-script.o: test-execute-script.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_execute_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_execute_script-test-execute-script.o -MD -MP -MF $(DEPDIR)/test_execute_script-test-execute-script.Tpo -c -o test_execute_script-test-execute-script.o `test -f 'test-execute-script.c' || echo '$(srcdir)/'`test-execute-script.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/test_execute_script-test-execute-script.Tpo $(DEPDIR)/test_execute_script-test-execute-script.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test-execute-script.c' object='test_execute_script-test-execute-script.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_execute_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_execute_script-test-execute-script.o `test -f 'test-execute-script.c' || echo '$(srcdir)/'`test-execute-script.c
+
+test_execute_script-test-execute-script.obj: test-execute-script.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_execute_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_execute_script-test-execute-script.obj -MD -MP -MF $(DEPDIR)/test_execute_script-test-execute-script.Tpo -c -o test_execute_script-test-execute-script.obj `if test -f 'test-execute-script.c'; then $(CYGPATH_W) 'test-execute-script.c'; else $(CYGPATH_W) '$(srcdir)/test-execute-script.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/test_execute_script-test-execute-script.Tpo $(DEPDIR)/test_execute_script-test-execute-script.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test-execute-script.c' object='test_execute_script-test-execute-script.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_execute_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_execute_script-test-execute-script.obj `if test -f 'test-execute-script.c'; then $(CYGPATH_W) 'test-execute-script.c'; else $(CYGPATH_W) '$(srcdir)/test-execute-script.c'; fi`
+
+test_posix_spawn_script-test-posix_spawn-script.o: test-posix_spawn-script.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_posix_spawn_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_posix_spawn_script-test-posix_spawn-script.o -MD -MP -MF $(DEPDIR)/test_posix_spawn_script-test-posix_spawn-script.Tpo -c -o test_posix_spawn_script-test-posix_spawn-script.o `test -f 'test-posix_spawn-script.c' || echo '$(srcdir)/'`test-posix_spawn-script.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/test_posix_spawn_script-test-posix_spawn-script.Tpo $(DEPDIR)/test_posix_spawn_script-test-posix_spawn-script.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test-posix_spawn-script.c' object='test_posix_spawn_script-test-posix_spawn-script.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_posix_spawn_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_posix_spawn_script-test-posix_spawn-script.o `test -f 'test-posix_spawn-script.c' || echo '$(srcdir)/'`test-posix_spawn-script.c
+
+test_posix_spawn_script-test-posix_spawn-script.obj: test-posix_spawn-script.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_posix_spawn_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_posix_spawn_script-test-posix_spawn-script.obj -MD -MP -MF $(DEPDIR)/test_posix_spawn_script-test-posix_spawn-script.Tpo -c -o test_posix_spawn_script-test-posix_spawn-script.obj `if test -f 'test-posix_spawn-script.c'; then $(CYGPATH_W) 'test-posix_spawn-script.c'; else $(CYGPATH_W) '$(srcdir)/test-posix_spawn-script.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/test_posix_spawn_script-test-posix_spawn-script.Tpo $(DEPDIR)/test_posix_spawn_script-test-posix_spawn-script.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test-posix_spawn-script.c' object='test_posix_spawn_script-test-posix_spawn-script.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_posix_spawn_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_posix_spawn_script-test-posix_spawn-script.obj `if test -f 'test-posix_spawn-script.c'; then $(CYGPATH_W) 'test-posix_spawn-script.c'; else $(CYGPATH_W) '$(srcdir)/test-posix_spawn-script.c'; fi`
+
+test_posix_spawnp_script-test-posix_spawnp-script.o: test-posix_spawnp-script.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_posix_spawnp_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_posix_spawnp_script-test-posix_spawnp-script.o -MD -MP -MF $(DEPDIR)/test_posix_spawnp_script-test-posix_spawnp-script.Tpo -c -o test_posix_spawnp_script-test-posix_spawnp-script.o `test -f 'test-posix_spawnp-script.c' || echo '$(srcdir)/'`test-posix_spawnp-script.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/test_posix_spawnp_script-test-posix_spawnp-script.Tpo $(DEPDIR)/test_posix_spawnp_script-test-posix_spawnp-script.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test-posix_spawnp-script.c' object='test_posix_spawnp_script-test-posix_spawnp-script.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_posix_spawnp_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_posix_spawnp_script-test-posix_spawnp-script.o `test -f 'test-posix_spawnp-script.c' || echo '$(srcdir)/'`test-posix_spawnp-script.c
+
+test_posix_spawnp_script-test-posix_spawnp-script.obj: test-posix_spawnp-script.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_posix_spawnp_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_posix_spawnp_script-test-posix_spawnp-script.obj -MD -MP -MF $(DEPDIR)/test_posix_spawnp_script-test-posix_spawnp-script.Tpo -c -o test_posix_spawnp_script-test-posix_spawnp-script.obj `if test -f 'test-posix_spawnp-script.c'; then $(CYGPATH_W) 'test-posix_spawnp-script.c'; else $(CYGPATH_W) '$(srcdir)/test-posix_spawnp-script.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/test_posix_spawnp_script-test-posix_spawnp-script.Tpo $(DEPDIR)/test_posix_spawnp_script-test-posix_spawnp-script.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test-posix_spawnp-script.c' object='test_posix_spawnp_script-test-posix_spawnp-script.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_posix_spawnp_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_posix_spawnp_script-test-posix_spawnp-script.obj `if test -f 'test-posix_spawnp-script.c'; then $(CYGPATH_W) 'test-posix_spawnp-script.c'; else $(CYGPATH_W) '$(srcdir)/test-posix_spawnp-script.c'; fi`
+
+test_spawn_pipe_script-test-spawn-pipe-script.o: test-spawn-pipe-script.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_spawn_pipe_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_spawn_pipe_script-test-spawn-pipe-script.o -MD -MP -MF $(DEPDIR)/test_spawn_pipe_script-test-spawn-pipe-script.Tpo -c -o test_spawn_pipe_script-test-spawn-pipe-script.o `test -f 'test-spawn-pipe-script.c' || echo '$(srcdir)/'`test-spawn-pipe-script.c
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/test_spawn_pipe_script-test-spawn-pipe-script.Tpo $(DEPDIR)/test_spawn_pipe_script-test-spawn-pipe-script.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test-spawn-pipe-script.c' object='test_spawn_pipe_script-test-spawn-pipe-script.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_spawn_pipe_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_spawn_pipe_script-test-spawn-pipe-script.o `test -f 'test-spawn-pipe-script.c' || echo '$(srcdir)/'`test-spawn-pipe-script.c
+
+test_spawn_pipe_script-test-spawn-pipe-script.obj: test-spawn-pipe-script.c
+@am__fastdepCC_TRUE@   $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_spawn_pipe_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_spawn_pipe_script-test-spawn-pipe-script.obj -MD -MP -MF $(DEPDIR)/test_spawn_pipe_script-test-spawn-pipe-script.Tpo -c -o test_spawn_pipe_script-test-spawn-pipe-script.obj `if test -f 'test-spawn-pipe-script.c'; then $(CYGPATH_W) 'test-spawn-pipe-script.c'; else $(CYGPATH_W) '$(srcdir)/test-spawn-pipe-script.c'; fi`
+@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) $(DEPDIR)/test_spawn_pipe_script-test-spawn-pipe-script.Tpo $(DEPDIR)/test_spawn_pipe_script-test-spawn-pipe-script.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='test-spawn-pipe-script.c' object='test_spawn_pipe_script-test-spawn-pipe-script.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_spawn_pipe_script_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_spawn_pipe_script-test-spawn-pipe-script.obj `if test -f 'test-spawn-pipe-script.c'; then $(CYGPATH_W) 'test-spawn-pipe-script.c'; else $(CYGPATH_W) '$(srcdir)/test-spawn-pipe-script.c'; fi`
+
 .cc.o:
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
 @am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
@@ -4330,7 +6656,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
          test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG);               \
        fi;                                                             \
        echo "$${col}$$br$${std}";                                      \
-       echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}";   \
+       echo "$${col}Testsuite summary"$(AM_TESTSUITE_SUMMARY_HEADER)"$${std}"; \
        echo "$${col}$$br$${std}";                                      \
        create_testsuite_report --maybe-color;                          \
        echo "$$col$$br$$std";                                          \
@@ -4343,7 +6669,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
        fi;                                                             \
        $$success || exit 1
 
-check-TESTS:
+check-TESTS: $(check_PROGRAMS) $(check_LIBRARIES)
        @list='$(RECHECK_LOGS)';           test -z "$$list" || rm -f $$list
        @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list
        @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
@@ -4353,7 +6679,7 @@ check-TESTS:
        log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
        $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \
        exit $$?;
-recheck: all $(check_LIBRARIES) $(check_PROGRAMS)
+recheck: all $(check_PROGRAMS) $(check_LIBRARIES)
        @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
        @set +e; $(am__set_TESTS_bases); \
        bases=`for i in $$bases; do echo $$i; done \
@@ -4364,6 +6690,20 @@ recheck: all $(check_LIBRARIES) $(check_PROGRAMS)
                am__force_recheck=am--force-recheck \
                TEST_LOGS="$$log_list"; \
        exit $$?
+test-accept.log: test-accept$(EXEEXT)
+       @p='test-accept$(EXEEXT)'; \
+       b='test-accept'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-access.log: test-access$(EXEEXT)
+       @p='test-access$(EXEEXT)'; \
+       b='test-access'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-alignof.log: test-alignof$(EXEEXT)
        @p='test-alignof$(EXEEXT)'; \
        b='test-alignof'; \
@@ -4378,6 +6718,20 @@ test-alloca-opt.log: test-alloca-opt$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-arpa_inet-c++.log: test-arpa_inet-c++$(EXEEXT)
+       @p='test-arpa_inet-c++$(EXEEXT)'; \
+       b='test-arpa_inet-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-arpa_inet.log: test-arpa_inet$(EXEEXT)
+       @p='test-arpa_inet$(EXEEXT)'; \
+       b='test-arpa_inet'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-array_list.log: test-array_list$(EXEEXT)
        @p='test-array_list$(EXEEXT)'; \
        b='test-array_list'; \
@@ -4392,6 +6746,20 @@ test-array_oset.log: test-array_oset$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-asyncsafe-spin1.log: test-asyncsafe-spin1$(EXEEXT)
+       @p='test-asyncsafe-spin1$(EXEEXT)'; \
+       b='test-asyncsafe-spin1'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-asyncsafe-spin2.log: test-asyncsafe-spin2$(EXEEXT)
+       @p='test-asyncsafe-spin2$(EXEEXT)'; \
+       b='test-asyncsafe-spin2'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-avltree_oset.log: test-avltree_oset$(EXEEXT)
        @p='test-avltree_oset$(EXEEXT)'; \
        b='test-avltree_oset'; \
@@ -4406,6 +6774,20 @@ test-binary-io.sh.log: test-binary-io.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-bind.log: test-bind$(EXEEXT)
+       @p='test-bind$(EXEEXT)'; \
+       b='test-bind'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-bitrotate.log: test-bitrotate$(EXEEXT)
+       @p='test-bitrotate$(EXEEXT)'; \
+       b='test-bitrotate'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-btowc1.sh.log: test-btowc1.sh
        @p='test-btowc1.sh'; \
        b='test-btowc1.sh'; \
@@ -4448,6 +6830,13 @@ test-c-strcase.sh.log: test-c-strcase.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-calloc-gnu.log: test-calloc-gnu$(EXEEXT)
+       @p='test-calloc-gnu$(EXEEXT)'; \
+       b='test-calloc-gnu'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-canonicalize-lgpl.log: test-canonicalize-lgpl$(EXEEXT)
        @p='test-canonicalize-lgpl$(EXEEXT)'; \
        b='test-canonicalize-lgpl'; \
@@ -4455,6 +6844,13 @@ test-canonicalize-lgpl.log: test-canonicalize-lgpl$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-canonicalize.log: test-canonicalize$(EXEEXT)
+       @p='test-canonicalize$(EXEEXT)'; \
+       b='test-canonicalize'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-chdir.log: test-chdir$(EXEEXT)
        @p='test-chdir$(EXEEXT)'; \
        b='test-chdir'; \
@@ -4483,6 +6879,27 @@ test-closein.sh.log: test-closein.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-connect.log: test-connect$(EXEEXT)
+       @p='test-connect$(EXEEXT)'; \
+       b='test-connect'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-creat.log: test-creat$(EXEEXT)
+       @p='test-creat$(EXEEXT)'; \
+       b='test-creat'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ctype-c++.log: test-ctype-c++$(EXEEXT)
+       @p='test-ctype-c++$(EXEEXT)'; \
+       b='test-ctype-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-ctype.log: test-ctype$(EXEEXT)
        @p='test-ctype$(EXEEXT)'; \
        b='test-ctype'; \
@@ -4525,6 +6942,13 @@ test-dup2.log: test-dup2$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-dynarray.log: test-dynarray$(EXEEXT)
+       @p='test-dynarray$(EXEEXT)'; \
+       b='test-dynarray'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-environ.log: test-environ$(EXEEXT)
        @p='test-environ$(EXEEXT)'; \
        b='test-environ'; \
@@ -4532,6 +6956,13 @@ test-environ.log: test-environ$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-errno-c++.log: test-errno-c++$(EXEEXT)
+       @p='test-errno-c++$(EXEEXT)'; \
+       b='test-errno-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-errno.log: test-errno$(EXEEXT)
        @p='test-errno$(EXEEXT)'; \
        b='test-errno'; \
@@ -4539,6 +6970,34 @@ test-errno.log: test-errno$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-execute.sh.log: test-execute.sh
+       @p='test-execute.sh'; \
+       b='test-execute.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-execute-script.log: test-execute-script$(EXEEXT)
+       @p='test-execute-script$(EXEEXT)'; \
+       b='test-execute-script'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-explicit_bzero.log: test-explicit_bzero$(EXEEXT)
+       @p='test-explicit_bzero$(EXEEXT)'; \
+       b='test-explicit_bzero'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fchdir.log: test-fchdir$(EXEEXT)
+       @p='test-fchdir$(EXEEXT)'; \
+       b='test-fchdir'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-fclose.log: test-fclose$(EXEEXT)
        @p='test-fclose$(EXEEXT)'; \
        b='test-fclose'; \
@@ -4574,6 +7033,13 @@ test-fdopen.log: test-fdopen$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fdopendir.log: test-fdopendir$(EXEEXT)
+       @p='test-fdopendir$(EXEEXT)'; \
+       b='test-fdopendir'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-fflush.log: test-fflush$(EXEEXT)
        @p='test-fflush$(EXEEXT)'; \
        b='test-fflush'; \
@@ -4602,6 +7068,13 @@ test-filenamecat.log: test-filenamecat$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-float-c++.log: test-float-c++$(EXEEXT)
+       @p='test-float-c++$(EXEEXT)'; \
+       b='test-float-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-float.log: test-float$(EXEEXT)
        @p='test-float$(EXEEXT)'; \
        b='test-float'; \
@@ -4609,6 +7082,13 @@ test-float.log: test-float$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fopen-gnu.log: test-fopen-gnu$(EXEEXT)
+       @p='test-fopen-gnu$(EXEEXT)'; \
+       b='test-fopen-gnu'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-fopen-safer.log: test-fopen-safer$(EXEEXT)
        @p='test-fopen-safer$(EXEEXT)'; \
        b='test-fopen-safer'; \
@@ -4665,6 +7145,20 @@ test-freading.log: test-freading$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-free.log: test-free$(EXEEXT)
+       @p='test-free$(EXEEXT)'; \
+       b='test-free'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-freopen.log: test-freopen$(EXEEXT)
+       @p='test-freopen$(EXEEXT)'; \
+       b='test-freopen'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-frexp-nolibm.log: test-frexp-nolibm$(EXEEXT)
        @p='test-frexp-nolibm$(EXEEXT)'; \
        b='test-frexp-nolibm'; \
@@ -4728,6 +7222,13 @@ test-fstat.log: test-fstat$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-fstatat.log: test-fstatat$(EXEEXT)
+       @p='test-fstatat$(EXEEXT)'; \
+       b='test-fstatat'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-ftell.sh.log: test-ftell.sh
        @p='test-ftell.sh'; \
        b='test-ftell.sh'; \
@@ -4777,6 +7278,13 @@ test-ftello4.sh.log: test-ftello4.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ftruncate.sh.log: test-ftruncate.sh
+       @p='test-ftruncate.sh'; \
+       b='test-ftruncate.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-fwrite.log: test-fwrite$(EXEEXT)
        @p='test-fwrite$(EXEEXT)'; \
        b='test-fwrite'; \
@@ -4791,6 +7299,13 @@ test-getcwd-lgpl.log: test-getcwd-lgpl$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-getcwd.sh.log: test-getcwd.sh
+       @p='test-getcwd.sh'; \
+       b='test-getcwd.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-getdtablesize.log: test-getdtablesize$(EXEEXT)
        @p='test-getdtablesize$(EXEEXT)'; \
        b='test-getdtablesize'; \
@@ -4805,16 +7320,16 @@ test-getopt-gnu.log: test-getopt-gnu$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
-test-getopt-posix.log: test-getopt-posix$(EXEEXT)
-       @p='test-getopt-posix$(EXEEXT)'; \
-       b='test-getopt-posix'; \
+test-getprogname.log: test-getprogname$(EXEEXT)
+       @p='test-getprogname$(EXEEXT)'; \
+       b='test-getprogname'; \
        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
-test-getprogname.log: test-getprogname$(EXEEXT)
-       @p='test-getprogname$(EXEEXT)'; \
-       b='test-getprogname'; \
+test-getrandom.log: test-getrandom$(EXEEXT)
+       @p='test-getrandom$(EXEEXT)'; \
+       b='test-getrandom'; \
        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
@@ -4826,6 +7341,41 @@ test-gettimeofday.log: test-gettimeofday$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-hard-locale.log: test-hard-locale$(EXEEXT)
+       @p='test-hard-locale$(EXEEXT)'; \
+       b='test-hard-locale'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-hash.log: test-hash$(EXEEXT)
+       @p='test-hash$(EXEEXT)'; \
+       b='test-hash'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-iconv-h-c++.log: test-iconv-h-c++$(EXEEXT)
+       @p='test-iconv-h-c++$(EXEEXT)'; \
+       b='test-iconv-h-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-iconv-h.log: test-iconv-h$(EXEEXT)
+       @p='test-iconv-h$(EXEEXT)'; \
+       b='test-iconv-h'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-iconv.log: test-iconv$(EXEEXT)
+       @p='test-iconv$(EXEEXT)'; \
+       b='test-iconv'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-ignore-value.log: test-ignore-value$(EXEEXT)
        @p='test-ignore-value$(EXEEXT)'; \
        b='test-ignore-value'; \
@@ -4833,6 +7383,13 @@ test-ignore-value.log: test-ignore-value$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-inet_pton.log: test-inet_pton$(EXEEXT)
+       @p='test-inet_pton$(EXEEXT)'; \
+       b='test-inet_pton'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-intprops.log: test-intprops$(EXEEXT)
        @p='test-intprops$(EXEEXT)'; \
        b='test-intprops'; \
@@ -4840,6 +7397,20 @@ test-intprops.log: test-intprops$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-inttostr.log: test-inttostr$(EXEEXT)
+       @p='test-inttostr$(EXEEXT)'; \
+       b='test-inttostr'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-inttypes-c++.log: test-inttypes-c++$(EXEEXT)
+       @p='test-inttypes-c++$(EXEEXT)'; \
+       b='test-inttypes-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-inttypes.log: test-inttypes$(EXEEXT)
        @p='test-inttypes$(EXEEXT)'; \
        b='test-inttypes'; \
@@ -4847,6 +7418,13 @@ test-inttypes.log: test-inttypes$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-ioctl.log: test-ioctl$(EXEEXT)
+       @p='test-ioctl$(EXEEXT)'; \
+       b='test-ioctl'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-isblank.log: test-isblank$(EXEEXT)
        @p='test-isblank$(EXEEXT)'; \
        b='test-isblank'; \
@@ -4875,6 +7453,27 @@ test-isnanl-nolibm.log: test-isnanl-nolibm$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-iswblank.log: test-iswblank$(EXEEXT)
+       @p='test-iswblank$(EXEEXT)'; \
+       b='test-iswblank'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-iswdigit.sh.log: test-iswdigit.sh
+       @p='test-iswdigit.sh'; \
+       b='test-iswdigit.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-iswxdigit.sh.log: test-iswxdigit.sh
+       @p='test-iswxdigit.sh'; \
+       b='test-iswxdigit.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-langinfo-c++.log: test-langinfo-c++$(EXEEXT)
        @p='test-langinfo-c++$(EXEEXT)'; \
        b='test-langinfo-c++'; \
@@ -4889,6 +7488,13 @@ test-langinfo.log: test-langinfo$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-limits-h-c++.log: test-limits-h-c++$(EXEEXT)
+       @p='test-limits-h-c++$(EXEEXT)'; \
+       b='test-limits-h-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-limits-h.log: test-limits-h$(EXEEXT)
        @p='test-limits-h$(EXEEXT)'; \
        b='test-limits-h'; \
@@ -4903,6 +7509,13 @@ test-link.log: test-link$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-linked_list.log: test-linked_list$(EXEEXT)
+       @p='test-linked_list$(EXEEXT)'; \
+       b='test-linked_list'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-linkedhash_list.log: test-linkedhash_list$(EXEEXT)
        @p='test-linkedhash_list$(EXEEXT)'; \
        b='test-linkedhash_list'; \
@@ -4910,6 +7523,13 @@ test-linkedhash_list.log: test-linkedhash_list$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-listen.log: test-listen$(EXEEXT)
+       @p='test-listen$(EXEEXT)'; \
+       b='test-listen'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-locale-c++.log: test-locale-c++$(EXEEXT)
        @p='test-locale-c++$(EXEEXT)'; \
        b='test-locale-c++'; \
@@ -4952,6 +7572,13 @@ test-lstat.log: test-lstat$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-malloc-gnu.log: test-malloc-gnu$(EXEEXT)
+       @p='test-malloc-gnu$(EXEEXT)'; \
+       b='test-malloc-gnu'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-malloca.log: test-malloca$(EXEEXT)
        @p='test-malloca$(EXEEXT)'; \
        b='test-malloca'; \
@@ -5043,6 +7670,20 @@ test-mbrtowc-w32-5.sh.log: test-mbrtowc-w32-5.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc-w32-6.sh.log: test-mbrtowc-w32-6.sh
+       @p='test-mbrtowc-w32-6.sh'; \
+       b='test-mbrtowc-w32-6.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbrtowc-w32-7.sh.log: test-mbrtowc-w32-7.sh
+       @p='test-mbrtowc-w32-7.sh'; \
+       b='test-mbrtowc-w32-7.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-mbsinit.sh.log: test-mbsinit.sh
        @p='test-mbsinit.sh'; \
        b='test-mbsinit.sh'; \
@@ -5050,6 +7691,27 @@ test-mbsinit.sh.log: test-mbsinit.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsstr1.log: test-mbsstr1$(EXEEXT)
+       @p='test-mbsstr1$(EXEEXT)'; \
+       b='test-mbsstr1'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsstr2.sh.log: test-mbsstr2.sh
+       @p='test-mbsstr2.sh'; \
+       b='test-mbsstr2.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mbsstr3.sh.log: test-mbsstr3.sh
+       @p='test-mbsstr3.sh'; \
+       b='test-mbsstr3.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-memchr.log: test-memchr$(EXEEXT)
        @p='test-memchr$(EXEEXT)'; \
        b='test-memchr'; \
@@ -5064,6 +7726,34 @@ test-memchr2.log: test-memchr2$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-memrchr.log: test-memrchr$(EXEEXT)
+       @p='test-memrchr$(EXEEXT)'; \
+       b='test-memrchr'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-mkdir.log: test-mkdir$(EXEEXT)
+       @p='test-mkdir$(EXEEXT)'; \
+       b='test-mkdir'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-nanosleep.log: test-nanosleep$(EXEEXT)
+       @p='test-nanosleep$(EXEEXT)'; \
+       b='test-nanosleep'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-netinet_in.log: test-netinet_in$(EXEEXT)
+       @p='test-netinet_in$(EXEEXT)'; \
+       b='test-netinet_in'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-nl_langinfo.sh.log: test-nl_langinfo.sh
        @p='test-nl_langinfo.sh'; \
        b='test-nl_langinfo.sh'; \
@@ -5071,6 +7761,13 @@ test-nl_langinfo.sh.log: test-nl_langinfo.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-nl_langinfo-mt.log: test-nl_langinfo-mt$(EXEEXT)
+       @p='test-nl_langinfo-mt$(EXEEXT)'; \
+       b='test-nl_langinfo-mt'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-open.log: test-open$(EXEEXT)
        @p='test-open$(EXEEXT)'; \
        b='test-open'; \
@@ -5078,6 +7775,13 @@ test-open.log: test-open$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-openat.log: test-openat$(EXEEXT)
+       @p='test-openat$(EXEEXT)'; \
+       b='test-openat'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-pathmax.log: test-pathmax$(EXEEXT)
        @p='test-pathmax$(EXEEXT)'; \
        b='test-pathmax'; \
@@ -5085,6 +7789,27 @@ test-pathmax.log: test-pathmax$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-perror.sh.log: test-perror.sh
+       @p='test-perror.sh'; \
+       b='test-perror.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-perror2.log: test-perror2$(EXEEXT)
+       @p='test-perror2$(EXEEXT)'; \
+       b='test-perror2'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-pipe.log: test-pipe$(EXEEXT)
+       @p='test-pipe$(EXEEXT)'; \
+       b='test-pipe'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-pipe2.log: test-pipe2$(EXEEXT)
        @p='test-pipe2$(EXEEXT)'; \
        b='test-pipe2'; \
@@ -5092,51 +7817,142 @@ test-pipe2.log: test-pipe2$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
-test-posix_spawn_file_actions_addclose.log: test-posix_spawn_file_actions_addclose$(EXEEXT)
-       @p='test-posix_spawn_file_actions_addclose$(EXEEXT)'; \
-       b='test-posix_spawn_file_actions_addclose'; \
+test-posix_spawn-open1.log: test-posix_spawn-open1$(EXEEXT)
+       @p='test-posix_spawn-open1$(EXEEXT)'; \
+       b='test-posix_spawn-open1'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn-open2.log: test-posix_spawn-open2$(EXEEXT)
+       @p='test-posix_spawn-open2$(EXEEXT)'; \
+       b='test-posix_spawn-open2'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn-inherit0.log: test-posix_spawn-inherit0$(EXEEXT)
+       @p='test-posix_spawn-inherit0$(EXEEXT)'; \
+       b='test-posix_spawn-inherit0'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn-inherit1.log: test-posix_spawn-inherit1$(EXEEXT)
+       @p='test-posix_spawn-inherit1$(EXEEXT)'; \
+       b='test-posix_spawn-inherit1'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn-script.log: test-posix_spawn-script$(EXEEXT)
+       @p='test-posix_spawn-script$(EXEEXT)'; \
+       b='test-posix_spawn-script'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn_file_actions_addchdir.log: test-posix_spawn_file_actions_addchdir$(EXEEXT)
+       @p='test-posix_spawn_file_actions_addchdir$(EXEEXT)'; \
+       b='test-posix_spawn_file_actions_addchdir'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn-chdir.log: test-posix_spawn-chdir$(EXEEXT)
+       @p='test-posix_spawn-chdir$(EXEEXT)'; \
+       b='test-posix_spawn-chdir'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn_file_actions_addclose.log: test-posix_spawn_file_actions_addclose$(EXEEXT)
+       @p='test-posix_spawn_file_actions_addclose$(EXEEXT)'; \
+       b='test-posix_spawn_file_actions_addclose'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn_file_actions_adddup2.log: test-posix_spawn_file_actions_adddup2$(EXEEXT)
+       @p='test-posix_spawn_file_actions_adddup2$(EXEEXT)'; \
+       b='test-posix_spawn_file_actions_adddup2'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn_file_actions_addopen.log: test-posix_spawn_file_actions_addopen$(EXEEXT)
+       @p='test-posix_spawn_file_actions_addopen$(EXEEXT)'; \
+       b='test-posix_spawn_file_actions_addopen'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn-dup2-stdout.log: test-posix_spawn-dup2-stdout$(EXEEXT)
+       @p='test-posix_spawn-dup2-stdout$(EXEEXT)'; \
+       b='test-posix_spawn-dup2-stdout'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawn-dup2-stdin.log: test-posix_spawn-dup2-stdin$(EXEEXT)
+       @p='test-posix_spawn-dup2-stdin$(EXEEXT)'; \
+       b='test-posix_spawn-dup2-stdin'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-posix_spawnp-script.log: test-posix_spawnp-script$(EXEEXT)
+       @p='test-posix_spawnp-script$(EXEEXT)'; \
+       b='test-posix_spawnp-script'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-printf-frexp.log: test-printf-frexp$(EXEEXT)
+       @p='test-printf-frexp$(EXEEXT)'; \
+       b='test-printf-frexp'; \
        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
-test-posix_spawn_file_actions_adddup2.log: test-posix_spawn_file_actions_adddup2$(EXEEXT)
-       @p='test-posix_spawn_file_actions_adddup2$(EXEEXT)'; \
-       b='test-posix_spawn_file_actions_adddup2'; \
+test-printf-frexpl.log: test-printf-frexpl$(EXEEXT)
+       @p='test-printf-frexpl$(EXEEXT)'; \
+       b='test-printf-frexpl'; \
        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
-test-posix_spawn_file_actions_addopen.log: test-posix_spawn_file_actions_addopen$(EXEEXT)
-       @p='test-posix_spawn_file_actions_addopen$(EXEEXT)'; \
-       b='test-posix_spawn_file_actions_addopen'; \
+test-pthread-c++.log: test-pthread-c++$(EXEEXT)
+       @p='test-pthread-c++$(EXEEXT)'; \
+       b='test-pthread-c++'; \
        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
-test-posix_spawn1.log: test-posix_spawn1$(EXEEXT)
-       @p='test-posix_spawn1$(EXEEXT)'; \
-       b='test-posix_spawn1'; \
+test-pthread.log: test-pthread$(EXEEXT)
+       @p='test-pthread$(EXEEXT)'; \
+       b='test-pthread'; \
        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
-test-posix_spawn2.log: test-posix_spawn2$(EXEEXT)
-       @p='test-posix_spawn2$(EXEEXT)'; \
-       b='test-posix_spawn2'; \
+test-pthread-thread.log: test-pthread-thread$(EXEEXT)
+       @p='test-pthread-thread$(EXEEXT)'; \
+       b='test-pthread-thread'; \
        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
-test-printf-frexp.log: test-printf-frexp$(EXEEXT)
-       @p='test-printf-frexp$(EXEEXT)'; \
-       b='test-printf-frexp'; \
+test-pthread_sigmask1.log: test-pthread_sigmask1$(EXEEXT)
+       @p='test-pthread_sigmask1$(EXEEXT)'; \
+       b='test-pthread_sigmask1'; \
        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
-test-printf-frexpl.log: test-printf-frexpl$(EXEEXT)
-       @p='test-printf-frexpl$(EXEEXT)'; \
-       b='test-printf-frexpl'; \
+test-pthread_sigmask2.log: test-pthread_sigmask2$(EXEEXT)
+       @p='test-pthread_sigmask2$(EXEEXT)'; \
+       b='test-pthread_sigmask2'; \
        $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
@@ -5162,6 +7978,13 @@ test-rawmemchr.log: test-rawmemchr$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-read-file.log: test-read-file$(EXEEXT)
+       @p='test-read-file$(EXEEXT)'; \
+       b='test-read-file'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-readlink.log: test-readlink$(EXEEXT)
        @p='test-readlink$(EXEEXT)'; \
        b='test-readlink'; \
@@ -5169,6 +7992,20 @@ test-readlink.log: test-readlink$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-realloc-gnu.log: test-realloc-gnu$(EXEEXT)
+       @p='test-realloc-gnu$(EXEEXT)'; \
+       b='test-realloc-gnu'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-reallocarray.log: test-reallocarray$(EXEEXT)
+       @p='test-reallocarray$(EXEEXT)'; \
+       b='test-reallocarray'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-regex.log: test-regex$(EXEEXT)
        @p='test-regex$(EXEEXT)'; \
        b='test-regex'; \
@@ -5197,6 +8034,34 @@ test-sched.log: test-sched$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-scratch-buffer.log: test-scratch-buffer$(EXEEXT)
+       @p='test-scratch-buffer$(EXEEXT)'; \
+       b='test-scratch-buffer'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-select.log: test-select$(EXEEXT)
+       @p='test-select$(EXEEXT)'; \
+       b='test-select'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-select-in.sh.log: test-select-in.sh
+       @p='test-select-in.sh'; \
+       b='test-select-in.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-select-out.sh.log: test-select-out.sh
+       @p='test-select-out.sh'; \
+       b='test-select-out.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-setenv.log: test-setenv$(EXEEXT)
        @p='test-setenv$(EXEEXT)'; \
        b='test-setenv'; \
@@ -5204,6 +8069,27 @@ test-setenv.log: test-setenv$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-setlocale_null.log: test-setlocale_null$(EXEEXT)
+       @p='test-setlocale_null$(EXEEXT)'; \
+       b='test-setlocale_null'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-setlocale_null-mt-one.log: test-setlocale_null-mt-one$(EXEEXT)
+       @p='test-setlocale_null-mt-one$(EXEEXT)'; \
+       b='test-setlocale_null-mt-one'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-setlocale_null-mt-all.log: test-setlocale_null-mt-all$(EXEEXT)
+       @p='test-setlocale_null-mt-all$(EXEEXT)'; \
+       b='test-setlocale_null-mt-all'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-setlocale1.sh.log: test-setlocale1.sh
        @p='test-setlocale1.sh'; \
        b='test-setlocale1.sh'; \
@@ -5218,6 +8104,13 @@ test-setlocale2.sh.log: test-setlocale2.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-setsockopt.log: test-setsockopt$(EXEEXT)
+       @p='test-setsockopt$(EXEEXT)'; \
+       b='test-setsockopt'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-sigaction.log: test-sigaction$(EXEEXT)
        @p='test-sigaction$(EXEEXT)'; \
        b='test-sigaction'; \
@@ -5260,6 +8153,34 @@ test-sigprocmask.log: test-sigprocmask$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sigsegv-catch-segv1.log: test-sigsegv-catch-segv1$(EXEEXT)
+       @p='test-sigsegv-catch-segv1$(EXEEXT)'; \
+       b='test-sigsegv-catch-segv1'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sigsegv-catch-segv2.log: test-sigsegv-catch-segv2$(EXEEXT)
+       @p='test-sigsegv-catch-segv2$(EXEEXT)'; \
+       b='test-sigsegv-catch-segv2'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sigsegv-catch-stackoverflow1.log: test-sigsegv-catch-stackoverflow1$(EXEEXT)
+       @p='test-sigsegv-catch-stackoverflow1$(EXEEXT)'; \
+       b='test-sigsegv-catch-stackoverflow1'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sigsegv-catch-stackoverflow2.log: test-sigsegv-catch-stackoverflow2$(EXEEXT)
+       @p='test-sigsegv-catch-stackoverflow2$(EXEEXT)'; \
+       b='test-sigsegv-catch-stackoverflow2'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-sleep.log: test-sleep$(EXEEXT)
        @p='test-sleep$(EXEEXT)'; \
        b='test-sleep'; \
@@ -5274,6 +8195,13 @@ test-snprintf.log: test-snprintf$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sockets.log: test-sockets$(EXEEXT)
+       @p='test-sockets$(EXEEXT)'; \
+       b='test-sockets'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-spawn-c++.log: test-spawn-c++$(EXEEXT)
        @p='test-spawn-c++$(EXEEXT)'; \
        b='test-spawn-c++'; \
@@ -5288,6 +8216,13 @@ test-spawn-pipe.sh.log: test-spawn-pipe.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-spawn-pipe-script.log: test-spawn-pipe-script$(EXEEXT)
+       @p='test-spawn-pipe-script$(EXEEXT)'; \
+       b='test-spawn-pipe-script'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-spawn.log: test-spawn$(EXEEXT)
        @p='test-spawn$(EXEEXT)'; \
        b='test-spawn'; \
@@ -5302,6 +8237,13 @@ test-stat.log: test-stat$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stat-time.log: test-stat-time$(EXEEXT)
+       @p='test-stat-time$(EXEEXT)'; \
+       b='test-stat-time'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-stdalign.log: test-stdalign$(EXEEXT)
        @p='test-stdalign$(EXEEXT)'; \
        b='test-stdalign'; \
@@ -5309,6 +8251,13 @@ test-stdalign.log: test-stdalign$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stdbool-c++.log: test-stdbool-c++$(EXEEXT)
+       @p='test-stdbool-c++$(EXEEXT)'; \
+       b='test-stdbool-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-stdbool.log: test-stdbool$(EXEEXT)
        @p='test-stdbool$(EXEEXT)'; \
        b='test-stdbool'; \
@@ -5316,6 +8265,13 @@ test-stdbool.log: test-stdbool$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stddef-c++.log: test-stddef-c++$(EXEEXT)
+       @p='test-stddef-c++$(EXEEXT)'; \
+       b='test-stddef-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-stddef.log: test-stddef$(EXEEXT)
        @p='test-stddef$(EXEEXT)'; \
        b='test-stddef'; \
@@ -5323,6 +8279,13 @@ test-stddef.log: test-stddef$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-stdint-c++.log: test-stdint-c++$(EXEEXT)
+       @p='test-stdint-c++$(EXEEXT)'; \
+       b='test-stdint-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-stdint.log: test-stdint$(EXEEXT)
        @p='test-stdint$(EXEEXT)'; \
        b='test-stdint'; \
@@ -5372,6 +8335,20 @@ test-strerror.log: test-strerror$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-strerror_r.log: test-strerror_r$(EXEEXT)
+       @p='test-strerror_r$(EXEEXT)'; \
+       b='test-strerror_r'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-striconv.log: test-striconv$(EXEEXT)
+       @p='test-striconv$(EXEEXT)'; \
+       b='test-striconv'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-string-c++.log: test-string-c++$(EXEEXT)
        @p='test-string-c++$(EXEEXT)'; \
        b='test-string-c++'; \
@@ -5414,6 +8391,13 @@ test-strtod.log: test-strtod$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-strtod1.sh.log: test-strtod1.sh
+       @p='test-strtod1.sh'; \
+       b='test-strtod1.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-symlink.log: test-symlink$(EXEEXT)
        @p='test-symlink$(EXEEXT)'; \
        b='test-symlink'; \
@@ -5421,6 +8405,62 @@ test-symlink.log: test-symlink$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_ioctl-c++.log: test-sys_ioctl-c++$(EXEEXT)
+       @p='test-sys_ioctl-c++$(EXEEXT)'; \
+       b='test-sys_ioctl-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_ioctl.log: test-sys_ioctl$(EXEEXT)
+       @p='test-sys_ioctl$(EXEEXT)'; \
+       b='test-sys_ioctl'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_random-c++.log: test-sys_random-c++$(EXEEXT)
+       @p='test-sys_random-c++$(EXEEXT)'; \
+       b='test-sys_random-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_random.log: test-sys_random$(EXEEXT)
+       @p='test-sys_random$(EXEEXT)'; \
+       b='test-sys_random'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_select-c++.log: test-sys_select-c++$(EXEEXT)
+       @p='test-sys_select-c++$(EXEEXT)'; \
+       b='test-sys_select-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_select.log: test-sys_select$(EXEEXT)
+       @p='test-sys_select$(EXEEXT)'; \
+       b='test-sys_select'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_socket-c++.log: test-sys_socket-c++$(EXEEXT)
+       @p='test-sys_socket-c++$(EXEEXT)'; \
+       b='test-sys_socket-c++'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_socket.log: test-sys_socket$(EXEEXT)
+       @p='test-sys_socket$(EXEEXT)'; \
+       b='test-sys_socket'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-sys_stat-c++.log: test-sys_stat-c++$(EXEEXT)
        @p='test-sys_stat-c++$(EXEEXT)'; \
        b='test-sys_stat-c++'; \
@@ -5463,6 +8503,13 @@ test-sys_types.log: test-sys_types$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-sys_uio.log: test-sys_uio$(EXEEXT)
+       @p='test-sys_uio$(EXEEXT)'; \
+       b='test-sys_uio'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-sys_wait-c++.log: test-sys_wait-c++$(EXEEXT)
        @p='test-sys_wait-c++$(EXEEXT)'; \
        b='test-sys_wait-c++'; \
@@ -5484,6 +8531,20 @@ test-init.sh.log: test-init.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-thread_self.log: test-thread_self$(EXEEXT)
+       @p='test-thread_self$(EXEEXT)'; \
+       b='test-thread_self'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-thread_create.log: test-thread_create$(EXEEXT)
+       @p='test-thread_create$(EXEEXT)'; \
+       b='test-thread_create'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-time-c++.log: test-time-c++$(EXEEXT)
        @p='test-time-c++$(EXEEXT)'; \
        b='test-time-c++'; \
@@ -5519,6 +8580,34 @@ test-unistd.log: test-unistd$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-u8-mbtoucr.log: test-u8-mbtoucr$(EXEEXT)
+       @p='test-u8-mbtoucr$(EXEEXT)'; \
+       b='test-u8-mbtoucr'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-u8-uctomb.log: test-u8-uctomb$(EXEEXT)
+       @p='test-u8-uctomb$(EXEEXT)'; \
+       b='test-u8-uctomb'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-uc_width.log: test-uc_width$(EXEEXT)
+       @p='test-uc_width$(EXEEXT)'; \
+       b='test-uc_width'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+uniwidth/test-uc_width2.sh.log: uniwidth/test-uc_width2.sh
+       @p='uniwidth/test-uc_width2.sh'; \
+       b='uniwidth/test-uc_width2.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-unsetenv.log: test-unsetenv$(EXEEXT)
        @p='test-unsetenv$(EXEEXT)'; \
        b='test-unsetenv'; \
@@ -5645,6 +8734,20 @@ test-wcrtomb-w32-5.sh.log: test-wcrtomb-w32-5.sh
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wcrtomb-w32-6.sh.log: test-wcrtomb-w32-6.sh
+       @p='test-wcrtomb-w32-6.sh'; \
+       b='test-wcrtomb-w32-6.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wcrtomb-w32-7.sh.log: test-wcrtomb-w32-7.sh
+       @p='test-wcrtomb-w32-7.sh'; \
+       b='test-wcrtomb-w32-7.sh'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-wctype-h-c++.log: test-wctype-h-c++$(EXEEXT)
        @p='test-wctype-h-c++$(EXEEXT)'; \
        b='test-wctype-h-c++'; \
@@ -5659,6 +8762,13 @@ test-wctype-h.log: test-wctype-h$(EXEEXT)
        --log-file $$b.log --trs-file $$b.trs \
        $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
        "$$tst" $(AM_TESTS_FD_REDIRECT)
+test-wcwidth.log: test-wcwidth$(EXEEXT)
+       @p='test-wcwidth$(EXEEXT)'; \
+       b='test-wcwidth'; \
+       $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \
+       --log-file $$b.log --trs-file $$b.trs \
+       $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \
+       "$$tst" $(AM_TESTS_FD_REDIRECT)
 test-write.log: test-write$(EXEEXT)
        @p='test-write$(EXEEXT)'; \
        b='test-write'; \
@@ -5695,7 +8805,10 @@ test-xvasprintf.log: test-xvasprintf$(EXEEXT)
 @am__EXEEXT_TRUE@      $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \
 @am__EXEEXT_TRUE@      "$$tst" $(AM_TESTS_FD_REDIRECT)
 
-distdir: $(DISTFILES)
+distdir: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) distdir-am
+
+distdir-am: $(DISTFILES)
        @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
        list='$(DISTFILES)'; \
@@ -5751,16 +8864,17 @@ distdir: $(DISTFILES)
          fi; \
        done
 check-am: all-am
-       $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS)
+       $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_LIBRARIES)
        $(MAKE) $(AM_MAKEFLAGS) check-TESTS
 check: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) check-recursive
-all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(HEADERS)
+all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(HEADERS)
 installdirs: installdirs-recursive
 installdirs-am:
 install: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) install-recursive
-install-exec: install-exec-recursive
+install-exec: $(BUILT_SOURCES)
+       $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive
 install-data: install-data-recursive
 uninstall: uninstall-recursive
 
@@ -5790,6 +8904,12 @@ clean-generic:
 distclean-generic:
        -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
        -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+       -rm -f glthread/$(DEPDIR)/$(am__dirstamp)
+       -rm -f glthread/$(am__dirstamp)
+       -rm -f unistr/$(DEPDIR)/$(am__dirstamp)
+       -rm -f unistr/$(am__dirstamp)
+       -rm -f uniwidth/$(DEPDIR)/$(am__dirstamp)
+       -rm -f uniwidth/$(am__dirstamp)
        -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
 
 maintainer-clean-generic:
@@ -5804,7 +8924,353 @@ clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \
        mostlyclean-am
 
 distclean: distclean-recursive
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/accept.Po
+       -rm -f ./$(DEPDIR)/alloca.Po
+       -rm -f ./$(DEPDIR)/anytostr.Po
+       -rm -f ./$(DEPDIR)/bind.Po
+       -rm -f ./$(DEPDIR)/connect.Po
+       -rm -f ./$(DEPDIR)/creat.Po
+       -rm -f ./$(DEPDIR)/explicit_bzero.Po
+       -rm -f ./$(DEPDIR)/fdopen.Po
+       -rm -f ./$(DEPDIR)/findprog.Po
+       -rm -f ./$(DEPDIR)/freopen.Po
+       -rm -f ./$(DEPDIR)/ftruncate.Po
+       -rm -f ./$(DEPDIR)/gettimeofday.Po
+       -rm -f ./$(DEPDIR)/gl_array_list.Po
+       -rm -f ./$(DEPDIR)/gl_array_oset.Po
+       -rm -f ./$(DEPDIR)/imaxtostr.Po
+       -rm -f ./$(DEPDIR)/inet_pton.Po
+       -rm -f ./$(DEPDIR)/inttostr.Po
+       -rm -f ./$(DEPDIR)/ioctl.Po
+       -rm -f ./$(DEPDIR)/isblank.Po
+       -rm -f ./$(DEPDIR)/link.Po
+       -rm -f ./$(DEPDIR)/listen.Po
+       -rm -f ./$(DEPDIR)/locale.Po
+       -rm -f ./$(DEPDIR)/nanosleep.Po
+       -rm -f ./$(DEPDIR)/offtostr.Po
+       -rm -f ./$(DEPDIR)/perror.Po
+       -rm -f ./$(DEPDIR)/pthread-thread.Po
+       -rm -f ./$(DEPDIR)/pthread_sigmask.Po
+       -rm -f ./$(DEPDIR)/putenv.Po
+       -rm -f ./$(DEPDIR)/randomd.Po
+       -rm -f ./$(DEPDIR)/randoml.Po
+       -rm -f ./$(DEPDIR)/read-file.Po
+       -rm -f ./$(DEPDIR)/sched_yield.Po
+       -rm -f ./$(DEPDIR)/select.Po
+       -rm -f ./$(DEPDIR)/setenv.Po
+       -rm -f ./$(DEPDIR)/setsockopt.Po
+       -rm -f ./$(DEPDIR)/sleep.Po
+       -rm -f ./$(DEPDIR)/socket.Po
+       -rm -f ./$(DEPDIR)/sockets.Po
+       -rm -f ./$(DEPDIR)/strerror_r.Po
+       -rm -f ./$(DEPDIR)/symlink.Po
+       -rm -f ./$(DEPDIR)/sys_socket.Po
+       -rm -f ./$(DEPDIR)/test-accept.Po
+       -rm -f ./$(DEPDIR)/test-access.Po
+       -rm -f ./$(DEPDIR)/test-alignof.Po
+       -rm -f ./$(DEPDIR)/test-alloca-opt.Po
+       -rm -f ./$(DEPDIR)/test-arpa_inet-c++.Po
+       -rm -f ./$(DEPDIR)/test-arpa_inet.Po
+       -rm -f ./$(DEPDIR)/test-array_list.Po
+       -rm -f ./$(DEPDIR)/test-array_oset.Po
+       -rm -f ./$(DEPDIR)/test-asyncsafe-spin1.Po
+       -rm -f ./$(DEPDIR)/test-asyncsafe-spin2.Po
+       -rm -f ./$(DEPDIR)/test-avltree_oset.Po
+       -rm -f ./$(DEPDIR)/test-binary-io.Po
+       -rm -f ./$(DEPDIR)/test-bind.Po
+       -rm -f ./$(DEPDIR)/test-bitrotate.Po
+       -rm -f ./$(DEPDIR)/test-btowc.Po
+       -rm -f ./$(DEPDIR)/test-c-ctype.Po
+       -rm -f ./$(DEPDIR)/test-c-stack.Po
+       -rm -f ./$(DEPDIR)/test-c-strcasecmp.Po
+       -rm -f ./$(DEPDIR)/test-c-strncasecmp.Po
+       -rm -f ./$(DEPDIR)/test-calloc-gnu.Po
+       -rm -f ./$(DEPDIR)/test-canonicalize-lgpl.Po
+       -rm -f ./$(DEPDIR)/test-canonicalize.Po
+       -rm -f ./$(DEPDIR)/test-chdir.Po
+       -rm -f ./$(DEPDIR)/test-cloexec.Po
+       -rm -f ./$(DEPDIR)/test-close.Po
+       -rm -f ./$(DEPDIR)/test-closein.Po
+       -rm -f ./$(DEPDIR)/test-connect.Po
+       -rm -f ./$(DEPDIR)/test-creat.Po
+       -rm -f ./$(DEPDIR)/test-ctype-c++.Po
+       -rm -f ./$(DEPDIR)/test-ctype-c++2.Po
+       -rm -f ./$(DEPDIR)/test-ctype.Po
+       -rm -f ./$(DEPDIR)/test-dirent-c++.Po
+       -rm -f ./$(DEPDIR)/test-dirent.Po
+       -rm -f ./$(DEPDIR)/test-dirname.Po
+       -rm -f ./$(DEPDIR)/test-dup-safer.Po
+       -rm -f ./$(DEPDIR)/test-dup.Po
+       -rm -f ./$(DEPDIR)/test-dup2.Po
+       -rm -f ./$(DEPDIR)/test-dynarray.Po
+       -rm -f ./$(DEPDIR)/test-environ.Po
+       -rm -f ./$(DEPDIR)/test-errno-c++.Po
+       -rm -f ./$(DEPDIR)/test-errno-c++2.Po
+       -rm -f ./$(DEPDIR)/test-errno.Po
+       -rm -f ./$(DEPDIR)/test-execute-child.Po
+       -rm -f ./$(DEPDIR)/test-execute-main.Po
+       -rm -f ./$(DEPDIR)/test-explicit_bzero.Po
+       -rm -f ./$(DEPDIR)/test-fchdir.Po
+       -rm -f ./$(DEPDIR)/test-fclose.Po
+       -rm -f ./$(DEPDIR)/test-fcntl-h-c++.Po
+       -rm -f ./$(DEPDIR)/test-fcntl-h.Po
+       -rm -f ./$(DEPDIR)/test-fcntl.Po
+       -rm -f ./$(DEPDIR)/test-fdopen.Po
+       -rm -f ./$(DEPDIR)/test-fdopendir.Po
+       -rm -f ./$(DEPDIR)/test-fflush.Po
+       -rm -f ./$(DEPDIR)/test-fflush2.Po
+       -rm -f ./$(DEPDIR)/test-fgetc.Po
+       -rm -f ./$(DEPDIR)/test-filenamecat.Po
+       -rm -f ./$(DEPDIR)/test-float-c++.Po
+       -rm -f ./$(DEPDIR)/test-float-c++2.Po
+       -rm -f ./$(DEPDIR)/test-float.Po
+       -rm -f ./$(DEPDIR)/test-fopen-gnu.Po
+       -rm -f ./$(DEPDIR)/test-fopen-safer.Po
+       -rm -f ./$(DEPDIR)/test-fopen.Po
+       -rm -f ./$(DEPDIR)/test-fpending.Po
+       -rm -f ./$(DEPDIR)/test-fpurge.Po
+       -rm -f ./$(DEPDIR)/test-fputc.Po
+       -rm -f ./$(DEPDIR)/test-fread.Po
+       -rm -f ./$(DEPDIR)/test-freadahead.Po
+       -rm -f ./$(DEPDIR)/test-freading.Po
+       -rm -f ./$(DEPDIR)/test-free.Po
+       -rm -f ./$(DEPDIR)/test-freopen.Po
+       -rm -f ./$(DEPDIR)/test-frexp.Po
+       -rm -f ./$(DEPDIR)/test-frexpl.Po
+       -rm -f ./$(DEPDIR)/test-fseek.Po
+       -rm -f ./$(DEPDIR)/test-fseeko.Po
+       -rm -f ./$(DEPDIR)/test-fseeko3.Po
+       -rm -f ./$(DEPDIR)/test-fseeko4.Po
+       -rm -f ./$(DEPDIR)/test-fstat.Po
+       -rm -f ./$(DEPDIR)/test-fstatat.Po
+       -rm -f ./$(DEPDIR)/test-ftell.Po
+       -rm -f ./$(DEPDIR)/test-ftell3.Po
+       -rm -f ./$(DEPDIR)/test-ftello.Po
+       -rm -f ./$(DEPDIR)/test-ftello3.Po
+       -rm -f ./$(DEPDIR)/test-ftello4.Po
+       -rm -f ./$(DEPDIR)/test-ftruncate.Po
+       -rm -f ./$(DEPDIR)/test-fwrite.Po
+       -rm -f ./$(DEPDIR)/test-getcwd-lgpl.Po
+       -rm -f ./$(DEPDIR)/test-getcwd.Po
+       -rm -f ./$(DEPDIR)/test-getdtablesize.Po
+       -rm -f ./$(DEPDIR)/test-getopt-gnu.Po
+       -rm -f ./$(DEPDIR)/test-getprogname.Po
+       -rm -f ./$(DEPDIR)/test-getrandom.Po
+       -rm -f ./$(DEPDIR)/test-gettimeofday.Po
+       -rm -f ./$(DEPDIR)/test-hard-locale.Po
+       -rm -f ./$(DEPDIR)/test-hash.Po
+       -rm -f ./$(DEPDIR)/test-iconv-h-c++.Po
+       -rm -f ./$(DEPDIR)/test-iconv-h.Po
+       -rm -f ./$(DEPDIR)/test-iconv.Po
+       -rm -f ./$(DEPDIR)/test-ignore-value.Po
+       -rm -f ./$(DEPDIR)/test-inet_pton.Po
+       -rm -f ./$(DEPDIR)/test-intprops.Po
+       -rm -f ./$(DEPDIR)/test-inttostr.Po
+       -rm -f ./$(DEPDIR)/test-inttypes-c++.Po
+       -rm -f ./$(DEPDIR)/test-inttypes-c++2.Po
+       -rm -f ./$(DEPDIR)/test-inttypes.Po
+       -rm -f ./$(DEPDIR)/test-ioctl.Po
+       -rm -f ./$(DEPDIR)/test-isblank.Po
+       -rm -f ./$(DEPDIR)/test-isnand-nolibm.Po
+       -rm -f ./$(DEPDIR)/test-isnanf-nolibm.Po
+       -rm -f ./$(DEPDIR)/test-isnanl-nolibm.Po
+       -rm -f ./$(DEPDIR)/test-iswblank.Po
+       -rm -f ./$(DEPDIR)/test-iswdigit.Po
+       -rm -f ./$(DEPDIR)/test-iswxdigit.Po
+       -rm -f ./$(DEPDIR)/test-langinfo-c++.Po
+       -rm -f ./$(DEPDIR)/test-langinfo.Po
+       -rm -f ./$(DEPDIR)/test-limits-h-c++.Po
+       -rm -f ./$(DEPDIR)/test-limits-h-c++2.Po
+       -rm -f ./$(DEPDIR)/test-limits-h.Po
+       -rm -f ./$(DEPDIR)/test-link.Po
+       -rm -f ./$(DEPDIR)/test-linked_list.Po
+       -rm -f ./$(DEPDIR)/test-linkedhash_list.Po
+       -rm -f ./$(DEPDIR)/test-listen.Po
+       -rm -f ./$(DEPDIR)/test-localcharset.Po
+       -rm -f ./$(DEPDIR)/test-locale-c++.Po
+       -rm -f ./$(DEPDIR)/test-locale-c++2.Po
+       -rm -f ./$(DEPDIR)/test-locale.Po
+       -rm -f ./$(DEPDIR)/test-localeconv.Po
+       -rm -f ./$(DEPDIR)/test-localename.Po
+       -rm -f ./$(DEPDIR)/test-lseek.Po
+       -rm -f ./$(DEPDIR)/test-lstat.Po
+       -rm -f ./$(DEPDIR)/test-malloc-gnu.Po
+       -rm -f ./$(DEPDIR)/test-malloca.Po
+       -rm -f ./$(DEPDIR)/test-math-c++.Po
+       -rm -f ./$(DEPDIR)/test-math-c++2.Po
+       -rm -f ./$(DEPDIR)/test-math.Po
+       -rm -f ./$(DEPDIR)/test-mbrtowc-w32.Po
+       -rm -f ./$(DEPDIR)/test-mbrtowc.Po
+       -rm -f ./$(DEPDIR)/test-mbsinit.Po
+       -rm -f ./$(DEPDIR)/test-mbsstr1.Po
+       -rm -f ./$(DEPDIR)/test-mbsstr2.Po
+       -rm -f ./$(DEPDIR)/test-mbsstr3.Po
+       -rm -f ./$(DEPDIR)/test-memchr.Po
+       -rm -f ./$(DEPDIR)/test-memchr2.Po
+       -rm -f ./$(DEPDIR)/test-memrchr.Po
+       -rm -f ./$(DEPDIR)/test-mkdir.Po
+       -rm -f ./$(DEPDIR)/test-nanosleep.Po
+       -rm -f ./$(DEPDIR)/test-netinet_in.Po
+       -rm -f ./$(DEPDIR)/test-nl_langinfo-mt.Po
+       -rm -f ./$(DEPDIR)/test-nl_langinfo.Po
+       -rm -f ./$(DEPDIR)/test-open.Po
+       -rm -f ./$(DEPDIR)/test-openat.Po
+       -rm -f ./$(DEPDIR)/test-pathmax.Po
+       -rm -f ./$(DEPDIR)/test-perror.Po
+       -rm -f ./$(DEPDIR)/test-perror2.Po
+       -rm -f ./$(DEPDIR)/test-pipe.Po
+       -rm -f ./$(DEPDIR)/test-pipe2.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-chdir.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-dup2-stdin.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-dup2-stdout.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-inherit0.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-inherit1.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-open1.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-open2.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn_file_actions_addchdir.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn_file_actions_addclose.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn_file_actions_adddup2.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn_file_actions_addopen.Po
+       -rm -f ./$(DEPDIR)/test-printf-frexp.Po
+       -rm -f ./$(DEPDIR)/test-printf-frexpl.Po
+       -rm -f ./$(DEPDIR)/test-pthread-c++.Po
+       -rm -f ./$(DEPDIR)/test-pthread-thread.Po
+       -rm -f ./$(DEPDIR)/test-pthread.Po
+       -rm -f ./$(DEPDIR)/test-pthread_sigmask1.Po
+       -rm -f ./$(DEPDIR)/test-pthread_sigmask2.Po
+       -rm -f ./$(DEPDIR)/test-quotearg-simple.Po
+       -rm -f ./$(DEPDIR)/test-raise.Po
+       -rm -f ./$(DEPDIR)/test-rawmemchr.Po
+       -rm -f ./$(DEPDIR)/test-read-file.Po
+       -rm -f ./$(DEPDIR)/test-readlink.Po
+       -rm -f ./$(DEPDIR)/test-realloc-gnu.Po
+       -rm -f ./$(DEPDIR)/test-reallocarray.Po
+       -rm -f ./$(DEPDIR)/test-regex.Po
+       -rm -f ./$(DEPDIR)/test-rename.Po
+       -rm -f ./$(DEPDIR)/test-rmdir.Po
+       -rm -f ./$(DEPDIR)/test-sched.Po
+       -rm -f ./$(DEPDIR)/test-scratch-buffer.Po
+       -rm -f ./$(DEPDIR)/test-select-fd.Po
+       -rm -f ./$(DEPDIR)/test-select-stdin.Po
+       -rm -f ./$(DEPDIR)/test-select.Po
+       -rm -f ./$(DEPDIR)/test-setenv.Po
+       -rm -f ./$(DEPDIR)/test-setlocale1.Po
+       -rm -f ./$(DEPDIR)/test-setlocale2.Po
+       -rm -f ./$(DEPDIR)/test-setlocale_null-mt-all.Po
+       -rm -f ./$(DEPDIR)/test-setlocale_null-mt-one.Po
+       -rm -f ./$(DEPDIR)/test-setlocale_null.Po
+       -rm -f ./$(DEPDIR)/test-setsockopt.Po
+       -rm -f ./$(DEPDIR)/test-sigaction.Po
+       -rm -f ./$(DEPDIR)/test-signal-h-c++.Po
+       -rm -f ./$(DEPDIR)/test-signal-h-c++2.Po
+       -rm -f ./$(DEPDIR)/test-signal-h.Po
+       -rm -f ./$(DEPDIR)/test-signbit.Po
+       -rm -f ./$(DEPDIR)/test-sigpipe.Po
+       -rm -f ./$(DEPDIR)/test-sigprocmask.Po
+       -rm -f ./$(DEPDIR)/test-sigsegv-catch-segv1.Po
+       -rm -f ./$(DEPDIR)/test-sigsegv-catch-segv2.Po
+       -rm -f ./$(DEPDIR)/test-sigsegv-catch-stackoverflow1.Po
+       -rm -f ./$(DEPDIR)/test-sigsegv-catch-stackoverflow2.Po
+       -rm -f ./$(DEPDIR)/test-sleep.Po
+       -rm -f ./$(DEPDIR)/test-snprintf.Po
+       -rm -f ./$(DEPDIR)/test-sockets.Po
+       -rm -f ./$(DEPDIR)/test-spawn-c++.Po
+       -rm -f ./$(DEPDIR)/test-spawn-pipe-child.Po
+       -rm -f ./$(DEPDIR)/test-spawn-pipe-main.Po
+       -rm -f ./$(DEPDIR)/test-spawn.Po
+       -rm -f ./$(DEPDIR)/test-stat-time.Po
+       -rm -f ./$(DEPDIR)/test-stat.Po
+       -rm -f ./$(DEPDIR)/test-stdalign.Po
+       -rm -f ./$(DEPDIR)/test-stdbool-c++.Po
+       -rm -f ./$(DEPDIR)/test-stdbool-c++2.Po
+       -rm -f ./$(DEPDIR)/test-stdbool.Po
+       -rm -f ./$(DEPDIR)/test-stddef-c++.Po
+       -rm -f ./$(DEPDIR)/test-stddef-c++2.Po
+       -rm -f ./$(DEPDIR)/test-stddef.Po
+       -rm -f ./$(DEPDIR)/test-stdint-c++.Po
+       -rm -f ./$(DEPDIR)/test-stdint-c++2.Po
+       -rm -f ./$(DEPDIR)/test-stdint.Po
+       -rm -f ./$(DEPDIR)/test-stdio-c++.Po
+       -rm -f ./$(DEPDIR)/test-stdio-c++2.Po
+       -rm -f ./$(DEPDIR)/test-stdio.Po
+       -rm -f ./$(DEPDIR)/test-stdlib-c++.Po
+       -rm -f ./$(DEPDIR)/test-stdlib-c++2.Po
+       -rm -f ./$(DEPDIR)/test-stdlib.Po
+       -rm -f ./$(DEPDIR)/test-strchrnul.Po
+       -rm -f ./$(DEPDIR)/test-strerror.Po
+       -rm -f ./$(DEPDIR)/test-strerror_r.Po
+       -rm -f ./$(DEPDIR)/test-striconv.Po
+       -rm -f ./$(DEPDIR)/test-string-c++.Po
+       -rm -f ./$(DEPDIR)/test-string-c++2.Po
+       -rm -f ./$(DEPDIR)/test-string.Po
+       -rm -f ./$(DEPDIR)/test-strnlen.Po
+       -rm -f ./$(DEPDIR)/test-strsignal.Po
+       -rm -f ./$(DEPDIR)/test-strstr.Po
+       -rm -f ./$(DEPDIR)/test-strtod.Po
+       -rm -f ./$(DEPDIR)/test-strtod1.Po
+       -rm -f ./$(DEPDIR)/test-symlink.Po
+       -rm -f ./$(DEPDIR)/test-sys_ioctl-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_ioctl.Po
+       -rm -f ./$(DEPDIR)/test-sys_random-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_random.Po
+       -rm -f ./$(DEPDIR)/test-sys_select-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_select.Po
+       -rm -f ./$(DEPDIR)/test-sys_socket-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_socket.Po
+       -rm -f ./$(DEPDIR)/test-sys_stat-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_stat.Po
+       -rm -f ./$(DEPDIR)/test-sys_time-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_time.Po
+       -rm -f ./$(DEPDIR)/test-sys_types-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_types.Po
+       -rm -f ./$(DEPDIR)/test-sys_uio.Po
+       -rm -f ./$(DEPDIR)/test-sys_wait-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_wait.Po
+       -rm -f ./$(DEPDIR)/test-thread_create.Po
+       -rm -f ./$(DEPDIR)/test-thread_self.Po
+       -rm -f ./$(DEPDIR)/test-time-c++.Po
+       -rm -f ./$(DEPDIR)/test-time-c++2.Po
+       -rm -f ./$(DEPDIR)/test-time.Po
+       -rm -f ./$(DEPDIR)/test-unistd-c++.Po
+       -rm -f ./$(DEPDIR)/test-unistd.Po
+       -rm -f ./$(DEPDIR)/test-unsetenv.Po
+       -rm -f ./$(DEPDIR)/test-vasnprintf.Po
+       -rm -f ./$(DEPDIR)/test-vasprintf-posix.Po
+       -rm -f ./$(DEPDIR)/test-vasprintf.Po
+       -rm -f ./$(DEPDIR)/test-verify-try.Po
+       -rm -f ./$(DEPDIR)/test-verify.Po
+       -rm -f ./$(DEPDIR)/test-version-etc.Po
+       -rm -f ./$(DEPDIR)/test-wchar-c++.Po
+       -rm -f ./$(DEPDIR)/test-wchar-c++2.Po
+       -rm -f ./$(DEPDIR)/test-wchar-c++3.Po
+       -rm -f ./$(DEPDIR)/test-wchar.Po
+       -rm -f ./$(DEPDIR)/test-wcrtomb-w32.Po
+       -rm -f ./$(DEPDIR)/test-wcrtomb.Po
+       -rm -f ./$(DEPDIR)/test-wctype-h-c++.Po
+       -rm -f ./$(DEPDIR)/test-wctype-h-c++2.Po
+       -rm -f ./$(DEPDIR)/test-wctype-h.Po
+       -rm -f ./$(DEPDIR)/test-wcwidth.Po
+       -rm -f ./$(DEPDIR)/test-write.Po
+       -rm -f ./$(DEPDIR)/test-xalloc-die.Po
+       -rm -f ./$(DEPDIR)/test-xvasprintf.Po
+       -rm -f ./$(DEPDIR)/test_execute_script-test-execute-script.Po
+       -rm -f ./$(DEPDIR)/test_posix_spawn_script-test-posix_spawn-script.Po
+       -rm -f ./$(DEPDIR)/test_posix_spawnp_script-test-posix_spawnp-script.Po
+       -rm -f ./$(DEPDIR)/test_spawn_pipe_script-test-spawn-pipe-script.Po
+       -rm -f ./$(DEPDIR)/uinttostr.Po
+       -rm -f ./$(DEPDIR)/umaxtostr.Po
+       -rm -f ./$(DEPDIR)/unsetenv.Po
+       -rm -f ./$(DEPDIR)/vma-iter.Po
+       -rm -f ./$(DEPDIR)/wctob.Po
+       -rm -f ./$(DEPDIR)/wctomb.Po
+       -rm -f ./$(DEPDIR)/windows-thread.Po
+       -rm -f ./$(DEPDIR)/write.Po
+       -rm -f ./$(DEPDIR)/xconcat-filename.Po
+       -rm -f glthread/$(DEPDIR)/thread.Po
+       -rm -f unistr/$(DEPDIR)/test-u8-mbtoucr.Po
+       -rm -f unistr/$(DEPDIR)/test-u8-uctomb.Po
+       -rm -f uniwidth/$(DEPDIR)/test-uc_width.Po
+       -rm -f uniwidth/$(DEPDIR)/test-uc_width2.Po
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-tags
@@ -5850,7 +9316,353 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-recursive
-       -rm -rf ./$(DEPDIR)
+               -rm -f ./$(DEPDIR)/accept.Po
+       -rm -f ./$(DEPDIR)/alloca.Po
+       -rm -f ./$(DEPDIR)/anytostr.Po
+       -rm -f ./$(DEPDIR)/bind.Po
+       -rm -f ./$(DEPDIR)/connect.Po
+       -rm -f ./$(DEPDIR)/creat.Po
+       -rm -f ./$(DEPDIR)/explicit_bzero.Po
+       -rm -f ./$(DEPDIR)/fdopen.Po
+       -rm -f ./$(DEPDIR)/findprog.Po
+       -rm -f ./$(DEPDIR)/freopen.Po
+       -rm -f ./$(DEPDIR)/ftruncate.Po
+       -rm -f ./$(DEPDIR)/gettimeofday.Po
+       -rm -f ./$(DEPDIR)/gl_array_list.Po
+       -rm -f ./$(DEPDIR)/gl_array_oset.Po
+       -rm -f ./$(DEPDIR)/imaxtostr.Po
+       -rm -f ./$(DEPDIR)/inet_pton.Po
+       -rm -f ./$(DEPDIR)/inttostr.Po
+       -rm -f ./$(DEPDIR)/ioctl.Po
+       -rm -f ./$(DEPDIR)/isblank.Po
+       -rm -f ./$(DEPDIR)/link.Po
+       -rm -f ./$(DEPDIR)/listen.Po
+       -rm -f ./$(DEPDIR)/locale.Po
+       -rm -f ./$(DEPDIR)/nanosleep.Po
+       -rm -f ./$(DEPDIR)/offtostr.Po
+       -rm -f ./$(DEPDIR)/perror.Po
+       -rm -f ./$(DEPDIR)/pthread-thread.Po
+       -rm -f ./$(DEPDIR)/pthread_sigmask.Po
+       -rm -f ./$(DEPDIR)/putenv.Po
+       -rm -f ./$(DEPDIR)/randomd.Po
+       -rm -f ./$(DEPDIR)/randoml.Po
+       -rm -f ./$(DEPDIR)/read-file.Po
+       -rm -f ./$(DEPDIR)/sched_yield.Po
+       -rm -f ./$(DEPDIR)/select.Po
+       -rm -f ./$(DEPDIR)/setenv.Po
+       -rm -f ./$(DEPDIR)/setsockopt.Po
+       -rm -f ./$(DEPDIR)/sleep.Po
+       -rm -f ./$(DEPDIR)/socket.Po
+       -rm -f ./$(DEPDIR)/sockets.Po
+       -rm -f ./$(DEPDIR)/strerror_r.Po
+       -rm -f ./$(DEPDIR)/symlink.Po
+       -rm -f ./$(DEPDIR)/sys_socket.Po
+       -rm -f ./$(DEPDIR)/test-accept.Po
+       -rm -f ./$(DEPDIR)/test-access.Po
+       -rm -f ./$(DEPDIR)/test-alignof.Po
+       -rm -f ./$(DEPDIR)/test-alloca-opt.Po
+       -rm -f ./$(DEPDIR)/test-arpa_inet-c++.Po
+       -rm -f ./$(DEPDIR)/test-arpa_inet.Po
+       -rm -f ./$(DEPDIR)/test-array_list.Po
+       -rm -f ./$(DEPDIR)/test-array_oset.Po
+       -rm -f ./$(DEPDIR)/test-asyncsafe-spin1.Po
+       -rm -f ./$(DEPDIR)/test-asyncsafe-spin2.Po
+       -rm -f ./$(DEPDIR)/test-avltree_oset.Po
+       -rm -f ./$(DEPDIR)/test-binary-io.Po
+       -rm -f ./$(DEPDIR)/test-bind.Po
+       -rm -f ./$(DEPDIR)/test-bitrotate.Po
+       -rm -f ./$(DEPDIR)/test-btowc.Po
+       -rm -f ./$(DEPDIR)/test-c-ctype.Po
+       -rm -f ./$(DEPDIR)/test-c-stack.Po
+       -rm -f ./$(DEPDIR)/test-c-strcasecmp.Po
+       -rm -f ./$(DEPDIR)/test-c-strncasecmp.Po
+       -rm -f ./$(DEPDIR)/test-calloc-gnu.Po
+       -rm -f ./$(DEPDIR)/test-canonicalize-lgpl.Po
+       -rm -f ./$(DEPDIR)/test-canonicalize.Po
+       -rm -f ./$(DEPDIR)/test-chdir.Po
+       -rm -f ./$(DEPDIR)/test-cloexec.Po
+       -rm -f ./$(DEPDIR)/test-close.Po
+       -rm -f ./$(DEPDIR)/test-closein.Po
+       -rm -f ./$(DEPDIR)/test-connect.Po
+       -rm -f ./$(DEPDIR)/test-creat.Po
+       -rm -f ./$(DEPDIR)/test-ctype-c++.Po
+       -rm -f ./$(DEPDIR)/test-ctype-c++2.Po
+       -rm -f ./$(DEPDIR)/test-ctype.Po
+       -rm -f ./$(DEPDIR)/test-dirent-c++.Po
+       -rm -f ./$(DEPDIR)/test-dirent.Po
+       -rm -f ./$(DEPDIR)/test-dirname.Po
+       -rm -f ./$(DEPDIR)/test-dup-safer.Po
+       -rm -f ./$(DEPDIR)/test-dup.Po
+       -rm -f ./$(DEPDIR)/test-dup2.Po
+       -rm -f ./$(DEPDIR)/test-dynarray.Po
+       -rm -f ./$(DEPDIR)/test-environ.Po
+       -rm -f ./$(DEPDIR)/test-errno-c++.Po
+       -rm -f ./$(DEPDIR)/test-errno-c++2.Po
+       -rm -f ./$(DEPDIR)/test-errno.Po
+       -rm -f ./$(DEPDIR)/test-execute-child.Po
+       -rm -f ./$(DEPDIR)/test-execute-main.Po
+       -rm -f ./$(DEPDIR)/test-explicit_bzero.Po
+       -rm -f ./$(DEPDIR)/test-fchdir.Po
+       -rm -f ./$(DEPDIR)/test-fclose.Po
+       -rm -f ./$(DEPDIR)/test-fcntl-h-c++.Po
+       -rm -f ./$(DEPDIR)/test-fcntl-h.Po
+       -rm -f ./$(DEPDIR)/test-fcntl.Po
+       -rm -f ./$(DEPDIR)/test-fdopen.Po
+       -rm -f ./$(DEPDIR)/test-fdopendir.Po
+       -rm -f ./$(DEPDIR)/test-fflush.Po
+       -rm -f ./$(DEPDIR)/test-fflush2.Po
+       -rm -f ./$(DEPDIR)/test-fgetc.Po
+       -rm -f ./$(DEPDIR)/test-filenamecat.Po
+       -rm -f ./$(DEPDIR)/test-float-c++.Po
+       -rm -f ./$(DEPDIR)/test-float-c++2.Po
+       -rm -f ./$(DEPDIR)/test-float.Po
+       -rm -f ./$(DEPDIR)/test-fopen-gnu.Po
+       -rm -f ./$(DEPDIR)/test-fopen-safer.Po
+       -rm -f ./$(DEPDIR)/test-fopen.Po
+       -rm -f ./$(DEPDIR)/test-fpending.Po
+       -rm -f ./$(DEPDIR)/test-fpurge.Po
+       -rm -f ./$(DEPDIR)/test-fputc.Po
+       -rm -f ./$(DEPDIR)/test-fread.Po
+       -rm -f ./$(DEPDIR)/test-freadahead.Po
+       -rm -f ./$(DEPDIR)/test-freading.Po
+       -rm -f ./$(DEPDIR)/test-free.Po
+       -rm -f ./$(DEPDIR)/test-freopen.Po
+       -rm -f ./$(DEPDIR)/test-frexp.Po
+       -rm -f ./$(DEPDIR)/test-frexpl.Po
+       -rm -f ./$(DEPDIR)/test-fseek.Po
+       -rm -f ./$(DEPDIR)/test-fseeko.Po
+       -rm -f ./$(DEPDIR)/test-fseeko3.Po
+       -rm -f ./$(DEPDIR)/test-fseeko4.Po
+       -rm -f ./$(DEPDIR)/test-fstat.Po
+       -rm -f ./$(DEPDIR)/test-fstatat.Po
+       -rm -f ./$(DEPDIR)/test-ftell.Po
+       -rm -f ./$(DEPDIR)/test-ftell3.Po
+       -rm -f ./$(DEPDIR)/test-ftello.Po
+       -rm -f ./$(DEPDIR)/test-ftello3.Po
+       -rm -f ./$(DEPDIR)/test-ftello4.Po
+       -rm -f ./$(DEPDIR)/test-ftruncate.Po
+       -rm -f ./$(DEPDIR)/test-fwrite.Po
+       -rm -f ./$(DEPDIR)/test-getcwd-lgpl.Po
+       -rm -f ./$(DEPDIR)/test-getcwd.Po
+       -rm -f ./$(DEPDIR)/test-getdtablesize.Po
+       -rm -f ./$(DEPDIR)/test-getopt-gnu.Po
+       -rm -f ./$(DEPDIR)/test-getprogname.Po
+       -rm -f ./$(DEPDIR)/test-getrandom.Po
+       -rm -f ./$(DEPDIR)/test-gettimeofday.Po
+       -rm -f ./$(DEPDIR)/test-hard-locale.Po
+       -rm -f ./$(DEPDIR)/test-hash.Po
+       -rm -f ./$(DEPDIR)/test-iconv-h-c++.Po
+       -rm -f ./$(DEPDIR)/test-iconv-h.Po
+       -rm -f ./$(DEPDIR)/test-iconv.Po
+       -rm -f ./$(DEPDIR)/test-ignore-value.Po
+       -rm -f ./$(DEPDIR)/test-inet_pton.Po
+       -rm -f ./$(DEPDIR)/test-intprops.Po
+       -rm -f ./$(DEPDIR)/test-inttostr.Po
+       -rm -f ./$(DEPDIR)/test-inttypes-c++.Po
+       -rm -f ./$(DEPDIR)/test-inttypes-c++2.Po
+       -rm -f ./$(DEPDIR)/test-inttypes.Po
+       -rm -f ./$(DEPDIR)/test-ioctl.Po
+       -rm -f ./$(DEPDIR)/test-isblank.Po
+       -rm -f ./$(DEPDIR)/test-isnand-nolibm.Po
+       -rm -f ./$(DEPDIR)/test-isnanf-nolibm.Po
+       -rm -f ./$(DEPDIR)/test-isnanl-nolibm.Po
+       -rm -f ./$(DEPDIR)/test-iswblank.Po
+       -rm -f ./$(DEPDIR)/test-iswdigit.Po
+       -rm -f ./$(DEPDIR)/test-iswxdigit.Po
+       -rm -f ./$(DEPDIR)/test-langinfo-c++.Po
+       -rm -f ./$(DEPDIR)/test-langinfo.Po
+       -rm -f ./$(DEPDIR)/test-limits-h-c++.Po
+       -rm -f ./$(DEPDIR)/test-limits-h-c++2.Po
+       -rm -f ./$(DEPDIR)/test-limits-h.Po
+       -rm -f ./$(DEPDIR)/test-link.Po
+       -rm -f ./$(DEPDIR)/test-linked_list.Po
+       -rm -f ./$(DEPDIR)/test-linkedhash_list.Po
+       -rm -f ./$(DEPDIR)/test-listen.Po
+       -rm -f ./$(DEPDIR)/test-localcharset.Po
+       -rm -f ./$(DEPDIR)/test-locale-c++.Po
+       -rm -f ./$(DEPDIR)/test-locale-c++2.Po
+       -rm -f ./$(DEPDIR)/test-locale.Po
+       -rm -f ./$(DEPDIR)/test-localeconv.Po
+       -rm -f ./$(DEPDIR)/test-localename.Po
+       -rm -f ./$(DEPDIR)/test-lseek.Po
+       -rm -f ./$(DEPDIR)/test-lstat.Po
+       -rm -f ./$(DEPDIR)/test-malloc-gnu.Po
+       -rm -f ./$(DEPDIR)/test-malloca.Po
+       -rm -f ./$(DEPDIR)/test-math-c++.Po
+       -rm -f ./$(DEPDIR)/test-math-c++2.Po
+       -rm -f ./$(DEPDIR)/test-math.Po
+       -rm -f ./$(DEPDIR)/test-mbrtowc-w32.Po
+       -rm -f ./$(DEPDIR)/test-mbrtowc.Po
+       -rm -f ./$(DEPDIR)/test-mbsinit.Po
+       -rm -f ./$(DEPDIR)/test-mbsstr1.Po
+       -rm -f ./$(DEPDIR)/test-mbsstr2.Po
+       -rm -f ./$(DEPDIR)/test-mbsstr3.Po
+       -rm -f ./$(DEPDIR)/test-memchr.Po
+       -rm -f ./$(DEPDIR)/test-memchr2.Po
+       -rm -f ./$(DEPDIR)/test-memrchr.Po
+       -rm -f ./$(DEPDIR)/test-mkdir.Po
+       -rm -f ./$(DEPDIR)/test-nanosleep.Po
+       -rm -f ./$(DEPDIR)/test-netinet_in.Po
+       -rm -f ./$(DEPDIR)/test-nl_langinfo-mt.Po
+       -rm -f ./$(DEPDIR)/test-nl_langinfo.Po
+       -rm -f ./$(DEPDIR)/test-open.Po
+       -rm -f ./$(DEPDIR)/test-openat.Po
+       -rm -f ./$(DEPDIR)/test-pathmax.Po
+       -rm -f ./$(DEPDIR)/test-perror.Po
+       -rm -f ./$(DEPDIR)/test-perror2.Po
+       -rm -f ./$(DEPDIR)/test-pipe.Po
+       -rm -f ./$(DEPDIR)/test-pipe2.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-chdir.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-dup2-stdin.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-dup2-stdout.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-inherit0.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-inherit1.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-open1.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn-open2.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn_file_actions_addchdir.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn_file_actions_addclose.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn_file_actions_adddup2.Po
+       -rm -f ./$(DEPDIR)/test-posix_spawn_file_actions_addopen.Po
+       -rm -f ./$(DEPDIR)/test-printf-frexp.Po
+       -rm -f ./$(DEPDIR)/test-printf-frexpl.Po
+       -rm -f ./$(DEPDIR)/test-pthread-c++.Po
+       -rm -f ./$(DEPDIR)/test-pthread-thread.Po
+       -rm -f ./$(DEPDIR)/test-pthread.Po
+       -rm -f ./$(DEPDIR)/test-pthread_sigmask1.Po
+       -rm -f ./$(DEPDIR)/test-pthread_sigmask2.Po
+       -rm -f ./$(DEPDIR)/test-quotearg-simple.Po
+       -rm -f ./$(DEPDIR)/test-raise.Po
+       -rm -f ./$(DEPDIR)/test-rawmemchr.Po
+       -rm -f ./$(DEPDIR)/test-read-file.Po
+       -rm -f ./$(DEPDIR)/test-readlink.Po
+       -rm -f ./$(DEPDIR)/test-realloc-gnu.Po
+       -rm -f ./$(DEPDIR)/test-reallocarray.Po
+       -rm -f ./$(DEPDIR)/test-regex.Po
+       -rm -f ./$(DEPDIR)/test-rename.Po
+       -rm -f ./$(DEPDIR)/test-rmdir.Po
+       -rm -f ./$(DEPDIR)/test-sched.Po
+       -rm -f ./$(DEPDIR)/test-scratch-buffer.Po
+       -rm -f ./$(DEPDIR)/test-select-fd.Po
+       -rm -f ./$(DEPDIR)/test-select-stdin.Po
+       -rm -f ./$(DEPDIR)/test-select.Po
+       -rm -f ./$(DEPDIR)/test-setenv.Po
+       -rm -f ./$(DEPDIR)/test-setlocale1.Po
+       -rm -f ./$(DEPDIR)/test-setlocale2.Po
+       -rm -f ./$(DEPDIR)/test-setlocale_null-mt-all.Po
+       -rm -f ./$(DEPDIR)/test-setlocale_null-mt-one.Po
+       -rm -f ./$(DEPDIR)/test-setlocale_null.Po
+       -rm -f ./$(DEPDIR)/test-setsockopt.Po
+       -rm -f ./$(DEPDIR)/test-sigaction.Po
+       -rm -f ./$(DEPDIR)/test-signal-h-c++.Po
+       -rm -f ./$(DEPDIR)/test-signal-h-c++2.Po
+       -rm -f ./$(DEPDIR)/test-signal-h.Po
+       -rm -f ./$(DEPDIR)/test-signbit.Po
+       -rm -f ./$(DEPDIR)/test-sigpipe.Po
+       -rm -f ./$(DEPDIR)/test-sigprocmask.Po
+       -rm -f ./$(DEPDIR)/test-sigsegv-catch-segv1.Po
+       -rm -f ./$(DEPDIR)/test-sigsegv-catch-segv2.Po
+       -rm -f ./$(DEPDIR)/test-sigsegv-catch-stackoverflow1.Po
+       -rm -f ./$(DEPDIR)/test-sigsegv-catch-stackoverflow2.Po
+       -rm -f ./$(DEPDIR)/test-sleep.Po
+       -rm -f ./$(DEPDIR)/test-snprintf.Po
+       -rm -f ./$(DEPDIR)/test-sockets.Po
+       -rm -f ./$(DEPDIR)/test-spawn-c++.Po
+       -rm -f ./$(DEPDIR)/test-spawn-pipe-child.Po
+       -rm -f ./$(DEPDIR)/test-spawn-pipe-main.Po
+       -rm -f ./$(DEPDIR)/test-spawn.Po
+       -rm -f ./$(DEPDIR)/test-stat-time.Po
+       -rm -f ./$(DEPDIR)/test-stat.Po
+       -rm -f ./$(DEPDIR)/test-stdalign.Po
+       -rm -f ./$(DEPDIR)/test-stdbool-c++.Po
+       -rm -f ./$(DEPDIR)/test-stdbool-c++2.Po
+       -rm -f ./$(DEPDIR)/test-stdbool.Po
+       -rm -f ./$(DEPDIR)/test-stddef-c++.Po
+       -rm -f ./$(DEPDIR)/test-stddef-c++2.Po
+       -rm -f ./$(DEPDIR)/test-stddef.Po
+       -rm -f ./$(DEPDIR)/test-stdint-c++.Po
+       -rm -f ./$(DEPDIR)/test-stdint-c++2.Po
+       -rm -f ./$(DEPDIR)/test-stdint.Po
+       -rm -f ./$(DEPDIR)/test-stdio-c++.Po
+       -rm -f ./$(DEPDIR)/test-stdio-c++2.Po
+       -rm -f ./$(DEPDIR)/test-stdio.Po
+       -rm -f ./$(DEPDIR)/test-stdlib-c++.Po
+       -rm -f ./$(DEPDIR)/test-stdlib-c++2.Po
+       -rm -f ./$(DEPDIR)/test-stdlib.Po
+       -rm -f ./$(DEPDIR)/test-strchrnul.Po
+       -rm -f ./$(DEPDIR)/test-strerror.Po
+       -rm -f ./$(DEPDIR)/test-strerror_r.Po
+       -rm -f ./$(DEPDIR)/test-striconv.Po
+       -rm -f ./$(DEPDIR)/test-string-c++.Po
+       -rm -f ./$(DEPDIR)/test-string-c++2.Po
+       -rm -f ./$(DEPDIR)/test-string.Po
+       -rm -f ./$(DEPDIR)/test-strnlen.Po
+       -rm -f ./$(DEPDIR)/test-strsignal.Po
+       -rm -f ./$(DEPDIR)/test-strstr.Po
+       -rm -f ./$(DEPDIR)/test-strtod.Po
+       -rm -f ./$(DEPDIR)/test-strtod1.Po
+       -rm -f ./$(DEPDIR)/test-symlink.Po
+       -rm -f ./$(DEPDIR)/test-sys_ioctl-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_ioctl.Po
+       -rm -f ./$(DEPDIR)/test-sys_random-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_random.Po
+       -rm -f ./$(DEPDIR)/test-sys_select-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_select.Po
+       -rm -f ./$(DEPDIR)/test-sys_socket-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_socket.Po
+       -rm -f ./$(DEPDIR)/test-sys_stat-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_stat.Po
+       -rm -f ./$(DEPDIR)/test-sys_time-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_time.Po
+       -rm -f ./$(DEPDIR)/test-sys_types-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_types.Po
+       -rm -f ./$(DEPDIR)/test-sys_uio.Po
+       -rm -f ./$(DEPDIR)/test-sys_wait-c++.Po
+       -rm -f ./$(DEPDIR)/test-sys_wait.Po
+       -rm -f ./$(DEPDIR)/test-thread_create.Po
+       -rm -f ./$(DEPDIR)/test-thread_self.Po
+       -rm -f ./$(DEPDIR)/test-time-c++.Po
+       -rm -f ./$(DEPDIR)/test-time-c++2.Po
+       -rm -f ./$(DEPDIR)/test-time.Po
+       -rm -f ./$(DEPDIR)/test-unistd-c++.Po
+       -rm -f ./$(DEPDIR)/test-unistd.Po
+       -rm -f ./$(DEPDIR)/test-unsetenv.Po
+       -rm -f ./$(DEPDIR)/test-vasnprintf.Po
+       -rm -f ./$(DEPDIR)/test-vasprintf-posix.Po
+       -rm -f ./$(DEPDIR)/test-vasprintf.Po
+       -rm -f ./$(DEPDIR)/test-verify-try.Po
+       -rm -f ./$(DEPDIR)/test-verify.Po
+       -rm -f ./$(DEPDIR)/test-version-etc.Po
+       -rm -f ./$(DEPDIR)/test-wchar-c++.Po
+       -rm -f ./$(DEPDIR)/test-wchar-c++2.Po
+       -rm -f ./$(DEPDIR)/test-wchar-c++3.Po
+       -rm -f ./$(DEPDIR)/test-wchar.Po
+       -rm -f ./$(DEPDIR)/test-wcrtomb-w32.Po
+       -rm -f ./$(DEPDIR)/test-wcrtomb.Po
+       -rm -f ./$(DEPDIR)/test-wctype-h-c++.Po
+       -rm -f ./$(DEPDIR)/test-wctype-h-c++2.Po
+       -rm -f ./$(DEPDIR)/test-wctype-h.Po
+       -rm -f ./$(DEPDIR)/test-wcwidth.Po
+       -rm -f ./$(DEPDIR)/test-write.Po
+       -rm -f ./$(DEPDIR)/test-xalloc-die.Po
+       -rm -f ./$(DEPDIR)/test-xvasprintf.Po
+       -rm -f ./$(DEPDIR)/test_execute_script-test-execute-script.Po
+       -rm -f ./$(DEPDIR)/test_posix_spawn_script-test-posix_spawn-script.Po
+       -rm -f ./$(DEPDIR)/test_posix_spawnp_script-test-posix_spawnp-script.Po
+       -rm -f ./$(DEPDIR)/test_spawn_pipe_script-test-spawn-pipe-script.Po
+       -rm -f ./$(DEPDIR)/uinttostr.Po
+       -rm -f ./$(DEPDIR)/umaxtostr.Po
+       -rm -f ./$(DEPDIR)/unsetenv.Po
+       -rm -f ./$(DEPDIR)/vma-iter.Po
+       -rm -f ./$(DEPDIR)/wctob.Po
+       -rm -f ./$(DEPDIR)/wctomb.Po
+       -rm -f ./$(DEPDIR)/windows-thread.Po
+       -rm -f ./$(DEPDIR)/write.Po
+       -rm -f ./$(DEPDIR)/xconcat-filename.Po
+       -rm -f glthread/$(DEPDIR)/thread.Po
+       -rm -f unistr/$(DEPDIR)/test-u8-mbtoucr.Po
+       -rm -f unistr/$(DEPDIR)/test-u8-uctomb.Po
+       -rm -f uniwidth/$(DEPDIR)/test-uc_width.Po
+       -rm -f uniwidth/$(DEPDIR)/test-uc_width2.Po
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
@@ -5870,27 +9682,54 @@ ps-am:
 uninstall-am:
 
 .MAKE: $(am__recursive_targets) all check check-am install install-am \
-       install-strip
-
-.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
-       check-TESTS check-am clean clean-checkLIBRARIES \
-       clean-checkPROGRAMS clean-generic clean-local \
-       clean-noinstLIBRARIES clean-noinstPROGRAMS cscopelist-am ctags \
-       ctags-am distclean distclean-compile distclean-generic \
-       distclean-tags distdir dvi dvi-am html html-am info info-am \
-       install install-am install-data install-data-am install-dvi \
-       install-dvi-am install-exec install-exec-am install-html \
-       install-html-am install-info install-info-am install-man \
-       install-pdf install-pdf-am install-ps install-ps-am \
-       install-strip installcheck installcheck-am installdirs \
-       installdirs-am maintainer-clean maintainer-clean-generic \
-       mostlyclean mostlyclean-compile mostlyclean-generic \
-       mostlyclean-local pdf pdf-am ps ps-am recheck tags tags-am \
-       uninstall uninstall-am
+       install-exec install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
+       am--depfiles check check-TESTS check-am clean \
+       clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \
+       clean-local clean-noinstLIBRARIES clean-noinstPROGRAMS \
+       cscopelist-am ctags ctags-am distclean distclean-compile \
+       distclean-generic distclean-tags distdir dvi dvi-am html \
+       html-am info info-am install install-am install-data \
+       install-data-am install-dvi install-dvi-am install-exec \
+       install-exec-am install-html install-html-am install-info \
+       install-info-am install-man install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs installdirs-am maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-compile \
+       mostlyclean-generic mostlyclean-local pdf pdf-am ps ps-am \
+       recheck tags tags-am uninstall uninstall-am
 
 .PRECIOUS: Makefile
 
 
+# We need the following in order to create <arpa/inet.h> when the system
+# doesn't have one.
+arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) arpa
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
+             -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
+             -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
+             -e 's/@''GNULIB_INET_NTOP''@/$(GL_M4_GNULIB_INET_NTOP)/g' \
+             -e 's/@''GNULIB_INET_PTON''@/$(GL_M4_GNULIB_INET_PTON)/g' \
+             -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+             -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
+             -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
+             -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \
+             -e 's|@''REPLACE_INET_PTON''@|$(REPLACE_INET_PTON)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/arpa_inet.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+
 # We need the following in order to create <ctype.h> when the system
 # doesn't have one that works with the given compiler.
 ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
@@ -5901,7 +9740,7 @@ ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
-             -e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \
+             -e 's/@''GNULIB_ISBLANK''@/$(GL_M4_GNULIB_ISBLANK)/g' \
              -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
@@ -5909,134 +9748,294 @@ ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
        } > $@-t && \
        mv $@-t $@
 
-# We need the following in order to create <dirent.h> when the system
+# We need the following in order to create <netinet/in.h> when the system
+# doesn't have one.
+@GL_GENERATE_NETINET_IN_H_TRUE@netinet/in.h: netinet_in.in.h $(top_builddir)/config.status
+@GL_GENERATE_NETINET_IN_H_TRUE@        $(AM_V_at)$(MKDIR_P) netinet
+@GL_GENERATE_NETINET_IN_H_TRUE@        $(AM_V_GEN)rm -f $@-t $@ && \
+@GL_GENERATE_NETINET_IN_H_TRUE@        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+@GL_GENERATE_NETINET_IN_H_TRUE@          sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@              -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@              -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
+@GL_GENERATE_NETINET_IN_H_TRUE@              < $(srcdir)/netinet_in.in.h; \
+@GL_GENERATE_NETINET_IN_H_TRUE@        } > $@-t && \
+@GL_GENERATE_NETINET_IN_H_TRUE@        mv $@-t $@
+@GL_GENERATE_NETINET_IN_H_FALSE@netinet/in.h: $(top_builddir)/config.status
+@GL_GENERATE_NETINET_IN_H_FALSE@       rm -f $@
+test-posix_spawn-dup2-stdout.sh: test-posix_spawn-dup2-stdout.in.sh
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       cp $(srcdir)/test-posix_spawn-dup2-stdout.in.sh $@-t && \
+       mv $@-t $@
+test-posix_spawn-dup2-stdin.sh: test-posix_spawn-dup2-stdin.in.sh
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       cp $(srcdir)/test-posix_spawn-dup2-stdin.in.sh $@-t && \
+       mv $@-t $@
+
+# We need the following in order to create <pthread.h> when the system
 # doesn't have one that works with the given compiler.
-dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+pthread.h: pthread.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
          sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
-             -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
+             -e 's|@''HAVE_PTHREAD_H''@|$(HAVE_PTHREAD_H)|g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-             -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
-             -e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
-             -e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
-             -e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
-             -e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
-             -e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
-             -e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
-             -e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
-             -e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
-             -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
-             -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
-             -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
-             -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
-             -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
-             -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
-             -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
-             -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
-             -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
-             -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
-             -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
-             -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
-             -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
+             -e 's|@''NEXT_PTHREAD_H''@|$(NEXT_PTHREAD_H)|g' \
+             -e 's/@''GNULIB_PTHREAD_THREAD''@/$(GL_M4_GNULIB_PTHREAD_THREAD)/g' \
+             -e 's/@''GNULIB_PTHREAD_ONCE''@/$(GL_M4_GNULIB_PTHREAD_ONCE)/g' \
+             -e 's/@''GNULIB_PTHREAD_MUTEX''@/$(GL_M4_GNULIB_PTHREAD_MUTEX)/g' \
+             -e 's/@''GNULIB_PTHREAD_RWLOCK''@/$(GL_M4_GNULIB_PTHREAD_RWLOCK)/g' \
+             -e 's/@''GNULIB_PTHREAD_COND''@/$(GL_M4_GNULIB_PTHREAD_COND)/g' \
+             -e 's/@''GNULIB_PTHREAD_TSS''@/$(GL_M4_GNULIB_PTHREAD_TSS)/g' \
+             -e 's/@''GNULIB_PTHREAD_SPIN''@/$(GL_M4_GNULIB_PTHREAD_SPIN)/g' \
+             -e 's/@''GNULIB_PTHREAD_MUTEX_TIMEDLOCK''@/$(GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK)/g' \
+             -e 's|@''HAVE_PTHREAD_T''@|$(HAVE_PTHREAD_T)|g' \
+             -e 's|@''HAVE_PTHREAD_SPINLOCK_T''@|$(HAVE_PTHREAD_SPINLOCK_T)|g' \
+             -e 's|@''HAVE_PTHREAD_CREATE_DETACHED''@|$(HAVE_PTHREAD_CREATE_DETACHED)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_RECURSIVE''@|$(HAVE_PTHREAD_MUTEX_RECURSIVE)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_ROBUST''@|$(HAVE_PTHREAD_MUTEX_ROBUST)|g' \
+             -e 's|@''HAVE_PTHREAD_PROCESS_SHARED''@|$(HAVE_PTHREAD_PROCESS_SHARED)|g' \
+             -e 's|@''HAVE_PTHREAD_CREATE''@|$(HAVE_PTHREAD_CREATE)|g' \
+             -e 's|@''HAVE_PTHREAD_ATTR_INIT''@|$(HAVE_PTHREAD_ATTR_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_ATTR_GETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_GETDETACHSTATE)|g' \
+             -e 's|@''HAVE_PTHREAD_ATTR_SETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_SETDETACHSTATE)|g' \
+             -e 's|@''HAVE_PTHREAD_ATTR_DESTROY''@|$(HAVE_PTHREAD_ATTR_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_SELF''@|$(HAVE_PTHREAD_SELF)|g' \
+             -e 's|@''HAVE_PTHREAD_EQUAL''@|$(HAVE_PTHREAD_EQUAL)|g' \
+             -e 's|@''HAVE_PTHREAD_DETACH''@|$(HAVE_PTHREAD_DETACH)|g' \
+             -e 's|@''HAVE_PTHREAD_JOIN''@|$(HAVE_PTHREAD_JOIN)|g' \
+             -e 's|@''HAVE_PTHREAD_EXIT''@|$(HAVE_PTHREAD_EXIT)|g' \
+             -e 's|@''HAVE_PTHREAD_ONCE''@|$(HAVE_PTHREAD_ONCE)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_INIT''@|$(HAVE_PTHREAD_MUTEX_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_INIT''@|$(HAVE_PTHREAD_MUTEXATTR_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_GETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_GETTYPE)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_SETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_SETTYPE)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_GETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_GETROBUST)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_SETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_SETROBUST)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_DESTROY''@|$(HAVE_PTHREAD_MUTEXATTR_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_LOCK''@|$(HAVE_PTHREAD_MUTEX_LOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_TRYLOCK''@|$(HAVE_PTHREAD_MUTEX_TRYLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_TIMEDLOCK''@|$(HAVE_PTHREAD_MUTEX_TIMEDLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_UNLOCK''@|$(HAVE_PTHREAD_MUTEX_UNLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_DESTROY''@|$(HAVE_PTHREAD_MUTEX_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_INIT''@|$(HAVE_PTHREAD_RWLOCK_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCKATTR_INIT''@|$(HAVE_PTHREAD_RWLOCKATTR_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCKATTR_DESTROY''@|$(HAVE_PTHREAD_RWLOCKATTR_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_RDLOCK''@|$(HAVE_PTHREAD_RWLOCK_RDLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_WRLOCK''@|$(HAVE_PTHREAD_RWLOCK_WRLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_UNLOCK''@|$(HAVE_PTHREAD_RWLOCK_UNLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_DESTROY''@|$(HAVE_PTHREAD_RWLOCK_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_INIT''@|$(HAVE_PTHREAD_COND_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_CONDATTR_INIT''@|$(HAVE_PTHREAD_CONDATTR_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_CONDATTR_DESTROY''@|$(HAVE_PTHREAD_CONDATTR_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_WAIT''@|$(HAVE_PTHREAD_COND_WAIT)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_TIMEDWAIT''@|$(HAVE_PTHREAD_COND_TIMEDWAIT)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_SIGNAL''@|$(HAVE_PTHREAD_COND_SIGNAL)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_BROADCAST''@|$(HAVE_PTHREAD_COND_BROADCAST)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_DESTROY''@|$(HAVE_PTHREAD_COND_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_KEY_CREATE''@|$(HAVE_PTHREAD_KEY_CREATE)|g' \
+             -e 's|@''HAVE_PTHREAD_SETSPECIFIC''@|$(HAVE_PTHREAD_SETSPECIFIC)|g' \
+             -e 's|@''HAVE_PTHREAD_GETSPECIFIC''@|$(HAVE_PTHREAD_GETSPECIFIC)|g' \
+             -e 's|@''HAVE_PTHREAD_KEY_DELETE''@|$(HAVE_PTHREAD_KEY_DELETE)|g' \
+             -e 's|@''HAVE_PTHREAD_SPIN_INIT''@|$(HAVE_PTHREAD_SPIN_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_SPIN_LOCK''@|$(HAVE_PTHREAD_SPIN_LOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_SPIN_TRYLOCK''@|$(HAVE_PTHREAD_SPIN_TRYLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_SPIN_UNLOCK''@|$(HAVE_PTHREAD_SPIN_UNLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_SPIN_DESTROY''@|$(HAVE_PTHREAD_SPIN_DESTROY)|g' \
+             < $(srcdir)/pthread.in.h | \
+         sed -e 's|@''REPLACE_PTHREAD_CREATE''@|$(REPLACE_PTHREAD_CREATE)|g' \
+             -e 's|@''REPLACE_PTHREAD_ATTR_INIT''@|$(REPLACE_PTHREAD_ATTR_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_ATTR_GETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_GETDETACHSTATE)|g' \
+             -e 's|@''REPLACE_PTHREAD_ATTR_SETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_SETDETACHSTATE)|g' \
+             -e 's|@''REPLACE_PTHREAD_ATTR_DESTROY''@|$(REPLACE_PTHREAD_ATTR_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_SELF''@|$(REPLACE_PTHREAD_SELF)|g' \
+             -e 's|@''REPLACE_PTHREAD_EQUAL''@|$(REPLACE_PTHREAD_EQUAL)|g' \
+             -e 's|@''REPLACE_PTHREAD_DETACH''@|$(REPLACE_PTHREAD_DETACH)|g' \
+             -e 's|@''REPLACE_PTHREAD_JOIN''@|$(REPLACE_PTHREAD_JOIN)|g' \
+             -e 's|@''REPLACE_PTHREAD_EXIT''@|$(REPLACE_PTHREAD_EXIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_ONCE''@|$(REPLACE_PTHREAD_ONCE)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_INIT''@|$(REPLACE_PTHREAD_MUTEX_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_INIT''@|$(REPLACE_PTHREAD_MUTEXATTR_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_GETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_GETTYPE)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_SETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_SETTYPE)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_GETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_GETROBUST)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_SETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_SETROBUST)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_DESTROY''@|$(REPLACE_PTHREAD_MUTEXATTR_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_LOCK''@|$(REPLACE_PTHREAD_MUTEX_LOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_TRYLOCK''@|$(REPLACE_PTHREAD_MUTEX_TRYLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_TIMEDLOCK''@|$(REPLACE_PTHREAD_MUTEX_TIMEDLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_UNLOCK''@|$(REPLACE_PTHREAD_MUTEX_UNLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_DESTROY''@|$(REPLACE_PTHREAD_MUTEX_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_INIT''@|$(REPLACE_PTHREAD_RWLOCK_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCKATTR_INIT''@|$(REPLACE_PTHREAD_RWLOCKATTR_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCKATTR_DESTROY''@|$(REPLACE_PTHREAD_RWLOCKATTR_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_RDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_RDLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_WRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_WRLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_UNLOCK''@|$(REPLACE_PTHREAD_RWLOCK_UNLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_DESTROY''@|$(REPLACE_PTHREAD_RWLOCK_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_INIT''@|$(REPLACE_PTHREAD_COND_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_CONDATTR_INIT''@|$(REPLACE_PTHREAD_CONDATTR_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_CONDATTR_DESTROY''@|$(REPLACE_PTHREAD_CONDATTR_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_WAIT''@|$(REPLACE_PTHREAD_COND_WAIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_TIMEDWAIT''@|$(REPLACE_PTHREAD_COND_TIMEDWAIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_SIGNAL''@|$(REPLACE_PTHREAD_COND_SIGNAL)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_BROADCAST''@|$(REPLACE_PTHREAD_COND_BROADCAST)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_DESTROY''@|$(REPLACE_PTHREAD_COND_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_KEY_CREATE''@|$(REPLACE_PTHREAD_KEY_CREATE)|g' \
+             -e 's|@''REPLACE_PTHREAD_SETSPECIFIC''@|$(REPLACE_PTHREAD_SETSPECIFIC)|g' \
+             -e 's|@''REPLACE_PTHREAD_GETSPECIFIC''@|$(REPLACE_PTHREAD_GETSPECIFIC)|g' \
+             -e 's|@''REPLACE_PTHREAD_KEY_DELETE''@|$(REPLACE_PTHREAD_KEY_DELETE)|g' \
+             -e 's|@''REPLACE_PTHREAD_SPIN_INIT''@|$(REPLACE_PTHREAD_SPIN_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_SPIN_LOCK''@|$(REPLACE_PTHREAD_SPIN_LOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_SPIN_TRYLOCK''@|$(REPLACE_PTHREAD_SPIN_TRYLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_SPIN_UNLOCK''@|$(REPLACE_PTHREAD_SPIN_UNLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_SPIN_DESTROY''@|$(REPLACE_PTHREAD_SPIN_DESTROY)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _Noreturn/r $(_NORETURN_H)' \
              -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/dirent.in.h; \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
        } > $@-t && \
        mv $@-t $@
 
-# We need the following in order to create <inttypes.h> when the system
-# doesn't have one that works with the given compiler.
-inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+# We need the following in order to create <sys/ioctl.h> when the system
+# does not have a complete one.
+sys/ioctl.h: sys_ioctl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
        $(AM_V_GEN)rm -f $@-t $@ && \
        { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \
              -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-             -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \
-             -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \
-             -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
-             -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
-             -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
-             -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
-             -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \
-             -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \
-             -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \
-             -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \
-             -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \
-             -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
-             -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
-             -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
-             -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
-             -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
-             -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
-             -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
-             -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
-             -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
+             -e 's|@''NEXT_SYS_IOCTL_H''@|$(NEXT_SYS_IOCTL_H)|g' \
+             -e 's/@''GNULIB_IOCTL''@/$(GL_M4_GNULIB_IOCTL)/g' \
+             -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \
+             -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+             -e 's|@''REPLACE_IOCTL''@|$(REPLACE_IOCTL)|g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/inttypes.in.h; \
+             < $(srcdir)/sys_ioctl.in.h; \
        } > $@-t && \
        mv $@-t $@
-@POSIX_SPAWN_PORTED_TRUE@test-posix_spawn1.sh: test-posix_spawn1.in.sh
-@POSIX_SPAWN_PORTED_TRUE@      $(AM_V_GEN)rm -f $@-t $@ && \
-@POSIX_SPAWN_PORTED_TRUE@      cp $(srcdir)/test-posix_spawn1.in.sh $@-t && \
-@POSIX_SPAWN_PORTED_TRUE@      mv $@-t $@
-@POSIX_SPAWN_PORTED_TRUE@test-posix_spawn2.sh: test-posix_spawn2.in.sh
-@POSIX_SPAWN_PORTED_TRUE@      $(AM_V_GEN)rm -f $@-t $@ && \
-@POSIX_SPAWN_PORTED_TRUE@      cp $(srcdir)/test-posix_spawn2.in.sh $@-t && \
-@POSIX_SPAWN_PORTED_TRUE@      mv $@-t $@
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
-# off.
-arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
-# The c++defs.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
+
+# We need the following in order to create <sys/select.h> when the system
+# doesn't have one that works with the given compiler.
+sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
        $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/c++defs.h \
-         > $@-t && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \
+             -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \
+             -e 's/@''GNULIB_PSELECT''@/$(GL_M4_GNULIB_PSELECT)/g' \
+             -e 's/@''GNULIB_SELECT''@/$(GL_M4_GNULIB_SELECT)/g' \
+             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+             -e 's|@''HAVE_PSELECT''@|$(HAVE_PSELECT)|g' \
+             -e 's|@''REPLACE_PSELECT''@|$(REPLACE_PSELECT)|g' \
+             -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sys_select.in.h; \
+       } > $@-t && \
        mv $@-t $@
-# The unused-parameter.h that gets inserted into generated .h files is the same
-# as build-aux/snippet/unused-parameter.h, except that it has the copyright
-# header cut off.
-unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
+
+# We need the following in order to create <sys/socket.h> when the system
+# doesn't have one that works with the given compiler.
+sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) sys
        $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/unused-parameter.h \
-         > $@-t && \
-       mv $@-t $@
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
-# off.
-warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
+             -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
+             -e 's/@''GNULIB_CLOSE''@/$(GL_M4_GNULIB_CLOSE)/g' \
+             -e 's/@''GNULIB_SOCKET''@/$(GL_M4_GNULIB_SOCKET)/g' \
+             -e 's/@''GNULIB_CONNECT''@/$(GL_M4_GNULIB_CONNECT)/g' \
+             -e 's/@''GNULIB_ACCEPT''@/$(GL_M4_GNULIB_ACCEPT)/g' \
+             -e 's/@''GNULIB_BIND''@/$(GL_M4_GNULIB_BIND)/g' \
+             -e 's/@''GNULIB_GETPEERNAME''@/$(GL_M4_GNULIB_GETPEERNAME)/g' \
+             -e 's/@''GNULIB_GETSOCKNAME''@/$(GL_M4_GNULIB_GETSOCKNAME)/g' \
+             -e 's/@''GNULIB_GETSOCKOPT''@/$(GL_M4_GNULIB_GETSOCKOPT)/g' \
+             -e 's/@''GNULIB_LISTEN''@/$(GL_M4_GNULIB_LISTEN)/g' \
+             -e 's/@''GNULIB_RECV''@/$(GL_M4_GNULIB_RECV)/g' \
+             -e 's/@''GNULIB_SEND''@/$(GL_M4_GNULIB_SEND)/g' \
+             -e 's/@''GNULIB_RECVFROM''@/$(GL_M4_GNULIB_RECVFROM)/g' \
+             -e 's/@''GNULIB_SENDTO''@/$(GL_M4_GNULIB_SENDTO)/g' \
+             -e 's/@''GNULIB_SETSOCKOPT''@/$(GL_M4_GNULIB_SETSOCKOPT)/g' \
+             -e 's/@''GNULIB_SHUTDOWN''@/$(GL_M4_GNULIB_SHUTDOWN)/g' \
+             -e 's/@''GNULIB_ACCEPT4''@/$(GL_M4_GNULIB_ACCEPT4)/g' \
+             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+             -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+             -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
+             -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g' \
+             -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
+             -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sys_socket.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+
+# We need the following in order to create <sys/time.h> when the system
+# doesn't have one that works with the given compiler.
+sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
        $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
-         > $@-t && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
+             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GL_M4_GNULIB_GETTIMEOFDAY)/g' \
+             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+             -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
+             -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sys_time.in.h; \
+       } > $@-t && \
        mv $@-t $@
 
-# We need the following in order to create <stdalign.h> when the system
-# doesn't have one that works.
-@GL_GENERATE_STDALIGN_H_TRUE@stdalign.h: stdalign.in.h $(top_builddir)/config.status
-@GL_GENERATE_STDALIGN_H_TRUE@  $(AM_V_GEN)rm -f $@-t $@ && \
-@GL_GENERATE_STDALIGN_H_TRUE@  { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-@GL_GENERATE_STDALIGN_H_TRUE@    cat $(srcdir)/stdalign.in.h; \
-@GL_GENERATE_STDALIGN_H_TRUE@  } > $@-t && \
-@GL_GENERATE_STDALIGN_H_TRUE@  mv $@-t $@
-@GL_GENERATE_STDALIGN_H_FALSE@stdalign.h: $(top_builddir)/config.status
-@GL_GENERATE_STDALIGN_H_FALSE@ rm -f $@
+# We need the following in order to create <sys/uio.h> when the system
+# doesn't have one that works with the given compiler.
+sys/uio.h: sys_uio.in.h $(top_builddir)/config.status
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \
+             -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \
+             < $(srcdir)/sys_uio.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
 
 # Clean up after Solaris cc.
 clean-local:
diff --git a/tests/_Noreturn.h b/tests/_Noreturn.h
new file mode 100644 (file)
index 0000000..fb718bc
--- /dev/null
@@ -0,0 +1,45 @@
+/* A C macro for declaring that a function does not return.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _Noreturn
+# if (defined __cplusplus \
+      && ((201103 <= __cplusplus && !(__GNUC__ == 4 && __GNUC_MINOR__ == 7)) \
+          || (defined _MSC_VER && 1900 <= _MSC_VER)) \
+      && 0)
+    /* [[noreturn]] is not practically usable, because with it the syntax
+         extern _Noreturn void func (...);
+       would not be valid; such a declaration would only be valid with 'extern'
+       and '_Noreturn' swapped, or without the 'extern' keyword.  However, some
+       AIX system header files and several gnulib header files use precisely
+       this syntax with 'extern'.  */
+#  define _Noreturn [[noreturn]]
+# elif ((!defined __cplusplus || defined __clang__) \
+        && (201112 <= (defined __STDC_VERSION__ ? __STDC_VERSION__ : 0) \
+            || (!defined __STRICT_ANSI__ \
+                && (__4 < __GNUC__ + (7 <= __GNUC_MINOR__) \
+                    || (defined __apple_build_version__ \
+                        ? 6000000 <= __apple_build_version__ \
+                        : 3 < __clang_major__ + (5 <= __clang_minor__))))))
+   /* _Noreturn works as-is.  */
+# elif (2 < __GNUC__ + (8 <= __GNUC_MINOR__) || defined __clang__ \
+        || 0x5110 <= __SUNPRO_C)
+#  define _Noreturn __attribute__ ((__noreturn__))
+# elif 1200 <= (defined _MSC_VER ? _MSC_VER : 0)
+#  define _Noreturn __declspec (noreturn)
+# else
+#  define _Noreturn
+# endif
+#endif
diff --git a/tests/accept.c b/tests/accept.c
new file mode 100644 (file)
index 0000000..a7d5743
--- /dev/null
@@ -0,0 +1,52 @@
+/* accept.c --- wrappers for Windows accept function
+
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef accept
+
+int
+rpl_accept (int fd, struct sockaddr *addr, socklen_t *addrlen)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+
+  if (sock == INVALID_SOCKET)
+    {
+      errno = EBADF;
+      return -1;
+    }
+  else
+    {
+      SOCKET fh = accept (sock, addr, addrlen);
+      if (fh == INVALID_SOCKET)
+        {
+          set_winsock_errno ();
+          return -1;
+        }
+      else
+        return SOCKET_TO_FD (fh);
+    }
+}
diff --git a/tests/alloca.c b/tests/alloca.c
new file mode 100644 (file)
index 0000000..91b9ec3
--- /dev/null
@@ -0,0 +1,200 @@
+/* alloca.c -- allocate automatically reclaimed memory
+   (Mostly) portable public-domain implementation -- D A Gwyn
+
+   This implementation of the PWB library alloca function,
+   which is used to allocate space off the run-time stack so
+   that it is automatically reclaimed upon procedure exit,
+   was inspired by discussions with J. Q. Johnson of Cornell.
+   J.Otto Tennant <jot@cray.com> contributed the Cray support.
+
+   There are some preprocessor constants that can
+   be defined when compiling for your specific system, for
+   improved efficiency; however, the defaults should be okay.
+
+   The general concept of this implementation is to keep
+   track of all alloca-allocated blocks, and reclaim any
+   that are found to be deeper in the stack than the current
+   invocation.  This heuristic does not reclaim storage as
+   soon as it becomes invalid, but it will do so eventually.
+
+   As a special case, alloca(0) reclaims storage without
+   allocating any.  It is a good idea to use alloca(0) in
+   your main control loop, etc. to force garbage collection.  */
+
+#include <config.h>
+
+#include <alloca.h>
+
+#include <string.h>
+#include <stdlib.h>
+
+#ifdef emacs
+# include "lisp.h"
+# include "blockinput.h"
+# ifdef EMACS_FREE
+#  undef free
+#  define free EMACS_FREE
+# endif
+#else
+# define memory_full() abort ()
+#endif
+
+/* If compiling with GCC or clang, this file is not needed.  */
+#if !(defined __GNUC__ || defined __clang__)
+
+/* If someone has defined alloca as a macro,
+   there must be some other way alloca is supposed to work.  */
+# ifndef alloca
+
+#  ifdef emacs
+#   ifdef static
+/* actually, only want this if static is defined as ""
+   -- this is for usg, in which emacs must undefine static
+   in order to make unexec workable
+   */
+#    ifndef STACK_DIRECTION
+you
+lose
+-- must know STACK_DIRECTION at compile-time
+/* Using #error here is not wise since this file should work for
+   old and obscure compilers.  */
+#    endif /* STACK_DIRECTION undefined */
+#   endif /* static */
+#  endif /* emacs */
+
+/* Define STACK_DIRECTION if you know the direction of stack
+   growth for your system; otherwise it will be automatically
+   deduced at run-time.
+
+   STACK_DIRECTION > 0 => grows toward higher addresses
+   STACK_DIRECTION < 0 => grows toward lower addresses
+   STACK_DIRECTION = 0 => direction of growth unknown  */
+
+#  ifndef STACK_DIRECTION
+#   define STACK_DIRECTION      0       /* Direction unknown.  */
+#  endif
+
+#  if STACK_DIRECTION != 0
+
+#   define STACK_DIR    STACK_DIRECTION /* Known at compile-time.  */
+
+#  else /* STACK_DIRECTION == 0; need run-time code.  */
+
+static int stack_dir;           /* 1 or -1 once known.  */
+#   define STACK_DIR    stack_dir
+
+static int
+find_stack_direction (int *addr, int depth)
+{
+  int dir, dummy = 0;
+  if (! addr)
+    addr = &dummy;
+  *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
+  dir = depth ? find_stack_direction (addr, depth - 1) : 0;
+  return dir + dummy;
+}
+
+#  endif /* STACK_DIRECTION == 0 */
+
+/* An "alloca header" is used to:
+   (a) chain together all alloca'ed blocks;
+   (b) keep track of stack depth.
+
+   It is very important that sizeof(header) agree with malloc
+   alignment chunk size.  The following default should work okay.  */
+
+#  ifndef       ALIGN_SIZE
+#   define ALIGN_SIZE   sizeof(double)
+#  endif
+
+typedef union hdr
+{
+  char align[ALIGN_SIZE];       /* To force sizeof(header).  */
+  struct
+    {
+      union hdr *next;          /* For chaining headers.  */
+      char *deep;               /* For stack depth measure.  */
+    } h;
+} header;
+
+static header *last_alloca_header = NULL;       /* -> last alloca header.  */
+
+/* Return a pointer to at least SIZE bytes of storage,
+   which will be automatically reclaimed upon exit from
+   the procedure that called alloca.  Originally, this space
+   was supposed to be taken from the current stack frame of the
+   caller, but that method cannot be made to work for some
+   implementations of C, for example under Gould's UTX/32.  */
+
+void *
+alloca (size_t size)
+{
+  auto char probe;              /* Probes stack depth: */
+  register char *depth = &probe;
+
+#  if STACK_DIRECTION == 0
+  if (STACK_DIR == 0)           /* Unknown growth direction.  */
+    STACK_DIR = find_stack_direction (NULL, (size & 1) + 20);
+#  endif
+
+  /* Reclaim garbage, defined as all alloca'd storage that
+     was allocated from deeper in the stack than currently.  */
+
+  {
+    register header *hp;        /* Traverses linked list.  */
+
+#  ifdef emacs
+    BLOCK_INPUT;
+#  endif
+
+    for (hp = last_alloca_header; hp != NULL;)
+      if ((STACK_DIR > 0 && hp->h.deep > depth)
+          || (STACK_DIR < 0 && hp->h.deep < depth))
+        {
+          register header *np = hp->h.next;
+
+          free (hp);            /* Collect garbage.  */
+
+          hp = np;              /* -> next header.  */
+        }
+      else
+        break;                  /* Rest are not deeper.  */
+
+    last_alloca_header = hp;    /* -> last valid storage.  */
+
+#  ifdef emacs
+    UNBLOCK_INPUT;
+#  endif
+  }
+
+  if (size == 0)
+    return NULL;                /* No allocation required.  */
+
+  /* Allocate combined header + user data storage.  */
+
+  {
+    /* Address of header.  */
+    register header *new;
+
+    size_t combined_size = sizeof (header) + size;
+    if (combined_size < sizeof (header))
+      memory_full ();
+
+    new = malloc (combined_size);
+
+    if (! new)
+      memory_full ();
+
+    new->h.next = last_alloca_header;
+    new->h.deep = depth;
+
+    last_alloca_header = new;
+
+    /* User storage begins just after header.  */
+
+    return (void *) (new + 1);
+  }
+}
+
+# endif /* no alloca */
+#endif /* not GCC || clang */
diff --git a/tests/altstack-util.h b/tests/altstack-util.h
new file mode 100644 (file)
index 0000000..f910726
--- /dev/null
@@ -0,0 +1,65 @@
+/* Some auxiliary stuff for defining an alternate stack.
+   Copyright (C) 2010  Eric Blake <eblake@redhat.com>
+   Copyright (C) 2010-2021  Bruno Haible <bruno@clisp.org>
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <stdint.h> /* uintptr_t */
+#include <string.h> /* for memset */
+
+#define MYSTACK_SIZE (1 << 24)
+
+/* glibc says: Users should use SIGSTKSZ as the size of user-supplied
+   buffers.  We want to detect stack overflow of the alternate stack
+   in a nicer manner than just crashing, so we overallocate in
+   comparison to what we hand libsigsegv.  Also, we intentionally hand
+   an unaligned pointer, to ensure the alternate stack still ends up
+   aligned.  */
+#define MYSTACK_CRUMPLE_ZONE 8192
+static char mystack_storage[MYSTACK_SIZE + 2 * MYSTACK_CRUMPLE_ZONE + 31];
+static char *mystack; /* MYSTACK_SIZE bytes in the middle of storage. */
+
+static void
+prepare_alternate_stack (void)
+{
+#ifdef SIGSTKSZ
+  if (MYSTACK_SIZE < SIGSTKSZ)
+    {
+      size_t size = SIGSTKSZ;
+      printf ("SIGSTKSZ=%zu exceeds MYSTACK_SIZE=%d\n", size, MYSTACK_SIZE);
+      exit (1);
+    }
+#endif
+  memset (mystack_storage, 's', sizeof mystack_storage);
+  mystack = (char *) ((uintptr_t) (mystack_storage + MYSTACK_CRUMPLE_ZONE) | 31);
+}
+
+static void
+check_alternate_stack_no_overflow (void)
+{
+  unsigned int i;
+
+  for (i = MYSTACK_CRUMPLE_ZONE; i > 0; i--)
+    if (*(mystack - i) != 's')
+      {
+        printf ("Alternate stack was exceeded by %u bytes!!\n", i);
+        exit (1);
+      }
+  for (i = MYSTACK_CRUMPLE_ZONE; i > 0; i--)
+    if (*(mystack + MYSTACK_SIZE - 1 + i) != 's')
+      {
+        printf ("Alternate stack was exceeded by %u bytes!!\n", i);
+        exit (1);
+      }
+}
diff --git a/tests/anytostr.c b/tests/anytostr.c
new file mode 100644 (file)
index 0000000..780b7be
--- /dev/null
@@ -0,0 +1,57 @@
+/* anytostr.c -- convert integers to printable strings
+
+   Copyright (C) 2001, 2006, 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert */
+
+/* Tell gcc not to warn about the (i < 0) test, below.  */
+#if (__GNUC__ == 4 && 3 <= __GNUC_MINOR__) || 4 < __GNUC__
+# pragma GCC diagnostic ignored "-Wtype-limits"
+#elif defined __clang__
+# pragma clang diagnostic ignored "-Wtautological-compare"
+#endif
+
+#include <config.h>
+
+#include "inttostr.h"
+
+/* Convert I to a printable string in BUF, which must be at least
+   INT_BUFSIZE_BOUND (INTTYPE) bytes long.  Return the address of the
+   printable string, which need not start at BUF.  */
+
+char * _GL_ATTRIBUTE_NODISCARD
+anytostr (inttype i, char *buf)
+{
+  char *p = buf + INT_STRLEN_BOUND (inttype);
+  *p = 0;
+
+  if (i < 0)
+    {
+      do
+        *--p = '0' - i % 10;
+      while ((i /= 10) != 0);
+
+      *--p = '-';
+    }
+  else
+    {
+      do
+        *--p = '0' + i % 10;
+      while ((i /= 10) != 0);
+    }
+
+  return p;
+}
diff --git a/tests/arg-nonnull.h b/tests/arg-nonnull.h
new file mode 100644 (file)
index 0000000..5b81b50
--- /dev/null
@@ -0,0 +1,26 @@
+/* A C macro for declaring that specific arguments must not be NULL.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* _GL_ARG_NONNULL((n,...,m)) tells the compiler and static analyzer tools
+   that the values passed as arguments n, ..., m must be non-NULL pointers.
+   n = 1 stands for the first argument, n = 2 for the second argument etc.  */
+#ifndef _GL_ARG_NONNULL
+# if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) || defined __clang__
+#  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))
+# else
+#  define _GL_ARG_NONNULL(params)
+# endif
+#endif
diff --git a/tests/arpa_inet.in.h b/tests/arpa_inet.in.h
new file mode 100644 (file)
index 0000000..5b103da
--- /dev/null
@@ -0,0 +1,150 @@
+/* A GNU-like <arpa/inet.h>.
+
+   Copyright (C) 2005-2006, 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _@GUARD_PREFIX@_ARPA_INET_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_FEATURES_H@
+# include <features.h> /* for __GLIBC__ */
+#endif
+
+/* Gnulib's sys/socket.h is responsible for defining socklen_t (used below) and
+   for pulling in winsock2.h etc. under MinGW.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <sys/socket.h>
+#endif
+
+/* On NonStop Kernel, inet_ntop and inet_pton are declared in <netdb.h>.
+   But avoid namespace pollution on glibc systems.  */
+#if defined __TANDEM && !defined __GLIBC__
+# include <netdb.h>
+#endif
+
+#if @HAVE_ARPA_INET_H@
+
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_ARPA_INET_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_ARPA_INET_H
+#define _@GUARD_PREFIX@_ARPA_INET_H
+
+/* Get all possible declarations of inet_ntop() and inet_pton().  */
+#if (@GNULIB_INET_NTOP@ || @GNULIB_INET_PTON@ || defined GNULIB_POSIXCHECK) \
+    && @HAVE_WS2TCPIP_H@
+# include <ws2tcpip.h>
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
+#if @GNULIB_INET_NTOP@
+/* Converts an internet address from internal format to a printable,
+   presentable format.
+   AF is an internet address family, such as AF_INET or AF_INET6.
+   SRC points to a 'struct in_addr' (for AF_INET) or 'struct in6_addr'
+   (for AF_INET6).
+   DST points to a buffer having room for CNT bytes.
+   The printable representation of the address (in numeric form, not
+   surrounded by [...], no reverse DNS is done) is placed in DST, and
+   DST is returned.  If an error occurs, the return value is NULL and
+   errno is set.  If CNT bytes are not sufficient to hold the result,
+   the return value is NULL and errno is set to ENOSPC.  A good value
+   for CNT is 46.
+
+   For more details, see the POSIX:2008 specification
+   <https://pubs.opengroup.org/onlinepubs/9699919799/functions/inet_ntop.html>.  */
+# if @REPLACE_INET_NTOP@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef inet_ntop
+#   define inet_ntop rpl_inet_ntop
+#  endif
+_GL_FUNCDECL_RPL (inet_ntop, const char *,
+                  (int af, const void *restrict src,
+                   char *restrict dst, socklen_t cnt)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (inet_ntop, const char *,
+                  (int af, const void *restrict src,
+                   char *restrict dst, socklen_t cnt));
+# else
+#  if !@HAVE_DECL_INET_NTOP@
+_GL_FUNCDECL_SYS (inet_ntop, const char *,
+                  (int af, const void *restrict src,
+                   char *restrict dst, socklen_t cnt)
+                  _GL_ARG_NONNULL ((2, 3)));
+#  endif
+/* Need to cast, because on NonStop Kernel, the fourth parameter is
+                                            size_t cnt.  */
+_GL_CXXALIAS_SYS_CAST (inet_ntop, const char *,
+                       (int af, const void *restrict src,
+                        char *restrict dst, socklen_t cnt));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (inet_ntop);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef inet_ntop
+# if HAVE_RAW_DECL_INET_NTOP
+_GL_WARN_ON_USE (inet_ntop, "inet_ntop is unportable - "
+                 "use gnulib module inet_ntop for portability");
+# endif
+#endif
+
+#if @GNULIB_INET_PTON@
+# if @REPLACE_INET_PTON@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef inet_pton
+#   define inet_pton rpl_inet_pton
+#  endif
+_GL_FUNCDECL_RPL (inet_pton, int,
+                  (int af, const char *restrict src, void *restrict dst)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (inet_pton, int,
+                  (int af, const char *restrict src, void *restrict dst));
+# else
+#  if !@HAVE_DECL_INET_PTON@
+_GL_FUNCDECL_SYS (inet_pton, int,
+                  (int af, const char *restrict src, void *restrict dst)
+                  _GL_ARG_NONNULL ((2, 3)));
+#  endif
+_GL_CXXALIAS_SYS (inet_pton, int,
+                  (int af, const char *restrict src, void *restrict dst));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (inet_pton);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef inet_pton
+# if HAVE_RAW_DECL_INET_PTON
+_GL_WARN_ON_USE (inet_pton, "inet_pton is unportable - "
+                 "use gnulib module inet_pton for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_ARPA_INET_H */
+#endif /* _@GUARD_PREFIX@_ARPA_INET_H */
diff --git a/tests/atomic-int-gnulib.h b/tests/atomic-int-gnulib.h
new file mode 100644 (file)
index 0000000..1836970
--- /dev/null
@@ -0,0 +1,173 @@
+/* Atomic integers.  Useful for testing multithreaded locking primitives.
+   Copyright (C) 2005, 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+
+/* Whether to use 'volatile' on some variables that communicate information
+   between threads.  If set to 0, a semaphore or a lock is used to protect
+   these variables.  If set to 1, 'volatile' is used; this is theoretically
+   equivalent but can lead to much slower execution (e.g. 30x slower total
+   run time on a 40-core machine), because 'volatile' does not imply any
+   synchronization/communication between different CPUs.  */
+#define USE_VOLATILE 0
+
+#if USE_POSIX_THREADS && HAVE_SEMAPHORE_H
+/* Whether to use a semaphore to communicate information between threads.
+   If set to 0, a lock is used. If set to 1, a semaphore is used.
+   Uncomment this to reduce the dependencies of this test.  */
+# define USE_SEMAPHORE 1
+/* Mac OS X provides only named semaphores (sem_open); its facility for
+   unnamed semaphores (sem_init) does not work.  */
+# if defined __APPLE__ && defined __MACH__
+#  define USE_NAMED_SEMAPHORE 1
+# else
+#  define USE_UNNAMED_SEMAPHORE 1
+# endif
+#endif
+
+
+#if USE_SEMAPHORE
+# include <errno.h>
+# include <fcntl.h>
+# include <semaphore.h>
+# include <unistd.h>
+#endif
+
+
+#if USE_VOLATILE
+struct atomic_int {
+  volatile int value;
+};
+static void
+init_atomic_int (struct atomic_int *ai)
+{
+}
+static int
+get_atomic_int_value (struct atomic_int *ai)
+{
+  return ai->value;
+}
+static void
+set_atomic_int_value (struct atomic_int *ai, int new_value)
+{
+  ai->value = new_value;
+}
+#elif USE_SEMAPHORE
+/* This atomic_int implementation can only support the values 0 and 1.
+   It is initially 0 and can be set to 1 only once.  */
+# if USE_UNNAMED_SEMAPHORE
+struct atomic_int {
+  sem_t semaphore;
+};
+#define atomic_int_semaphore(ai) (&(ai)->semaphore)
+static void
+init_atomic_int (struct atomic_int *ai)
+{
+  sem_init (&ai->semaphore, 0, 0);
+}
+# endif
+# if USE_NAMED_SEMAPHORE
+struct atomic_int {
+  sem_t *semaphore;
+};
+#define atomic_int_semaphore(ai) ((ai)->semaphore)
+static void
+init_atomic_int (struct atomic_int *ai)
+{
+  sem_t *s;
+  unsigned int count;
+  for (count = 0; ; count++)
+    {
+      char name[80];
+      /* Use getpid() in the name, so that different processes running at the
+         same time will not interfere.  Use ai in the name, so that different
+         atomic_int in the same process will not interfere.  Use a count in
+         the name, so that even in the (unlikely) case that a semaphore with
+         the specified name already exists, we can try a different name.  */
+      sprintf (name, "test-lock-%lu-%p-%u",
+               (unsigned long) getpid (), ai, count);
+      s = sem_open (name, O_CREAT | O_EXCL, 0600, 0);
+      if (s == SEM_FAILED)
+        {
+          if (errno == EEXIST)
+            /* Retry with a different name.  */
+            continue;
+          else
+            {
+              perror ("sem_open failed");
+              abort ();
+            }
+        }
+      else
+        {
+          /* Try not to leave a semaphore hanging around on the file system
+             eternally, if we can avoid it.  */
+          sem_unlink (name);
+          break;
+        }
+    }
+  ai->semaphore = s;
+}
+# endif
+static int
+get_atomic_int_value (struct atomic_int *ai)
+{
+  if (sem_trywait (atomic_int_semaphore (ai)) == 0)
+    {
+      if (sem_post (atomic_int_semaphore (ai)))
+        abort ();
+      return 1;
+    }
+  else if (errno == EAGAIN)
+    return 0;
+  else
+    abort ();
+}
+static void
+set_atomic_int_value (struct atomic_int *ai, int new_value)
+{
+  if (new_value == 0)
+    /* It's already initialized with 0.  */
+    return;
+  /* To set the value 1: */
+  if (sem_post (atomic_int_semaphore (ai)))
+    abort ();
+}
+#else
+struct atomic_int {
+  gl_lock_define (, lock)
+  int value;
+};
+static void
+init_atomic_int (struct atomic_int *ai)
+{
+  gl_lock_init (ai->lock);
+}
+static int
+get_atomic_int_value (struct atomic_int *ai)
+{
+  gl_lock_lock (ai->lock);
+  int ret = ai->value;
+  gl_lock_unlock (ai->lock);
+  return ret;
+}
+static void
+set_atomic_int_value (struct atomic_int *ai, int new_value)
+{
+  gl_lock_lock (ai->lock);
+  ai->value = new_value;
+  gl_lock_unlock (ai->lock);
+}
+#endif
diff --git a/tests/bind.c b/tests/bind.c
new file mode 100644 (file)
index 0000000..467da95
--- /dev/null
@@ -0,0 +1,49 @@
+/* bind.c --- wrappers for Windows bind function
+
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef bind
+
+int
+rpl_bind (int fd, const struct sockaddr *sockaddr, socklen_t len)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+
+  if (sock == INVALID_SOCKET)
+    {
+      errno = EBADF;
+      return -1;
+    }
+  else
+    {
+      int r = bind (sock, sockaddr, len);
+      if (r < 0)
+        set_winsock_errno ();
+
+      return r;
+    }
+}
diff --git a/tests/c++defs.h b/tests/c++defs.h
new file mode 100644 (file)
index 0000000..39df1bc
--- /dev/null
@@ -0,0 +1,331 @@
+/* C++ compatible function declaration macros.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _GL_CXXDEFS_H
+#define _GL_CXXDEFS_H
+
+/* Begin/end the GNULIB_NAMESPACE namespace.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_BEGIN_NAMESPACE namespace GNULIB_NAMESPACE {
+# define _GL_END_NAMESPACE }
+#else
+# define _GL_BEGIN_NAMESPACE
+# define _GL_END_NAMESPACE
+#endif
+
+/* The three most frequent use cases of these macros are:
+
+   * For providing a substitute for a function that is missing on some
+     platforms, but is declared and works fine on the platforms on which
+     it exists:
+
+       #if @GNULIB_FOO@
+       # if !@HAVE_FOO@
+       _GL_FUNCDECL_SYS (foo, ...);
+       # endif
+       _GL_CXXALIAS_SYS (foo, ...);
+       _GL_CXXALIASWARN (foo);
+       #elif defined GNULIB_POSIXCHECK
+       ...
+       #endif
+
+   * For providing a replacement for a function that exists on all platforms,
+     but is broken/insufficient and needs to be replaced on some platforms:
+
+       #if @GNULIB_FOO@
+       # if @REPLACE_FOO@
+       #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+       #   undef foo
+       #   define foo rpl_foo
+       #  endif
+       _GL_FUNCDECL_RPL (foo, ...);
+       _GL_CXXALIAS_RPL (foo, ...);
+       # else
+       _GL_CXXALIAS_SYS (foo, ...);
+       # endif
+       _GL_CXXALIASWARN (foo);
+       #elif defined GNULIB_POSIXCHECK
+       ...
+       #endif
+
+   * For providing a replacement for a function that exists on some platforms
+     but is broken/insufficient and needs to be replaced on some of them and
+     is additionally either missing or undeclared on some other platforms:
+
+       #if @GNULIB_FOO@
+       # if @REPLACE_FOO@
+       #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+       #   undef foo
+       #   define foo rpl_foo
+       #  endif
+       _GL_FUNCDECL_RPL (foo, ...);
+       _GL_CXXALIAS_RPL (foo, ...);
+       # else
+       #  if !@HAVE_FOO@   or   if !@HAVE_DECL_FOO@
+       _GL_FUNCDECL_SYS (foo, ...);
+       #  endif
+       _GL_CXXALIAS_SYS (foo, ...);
+       # endif
+       _GL_CXXALIASWARN (foo);
+       #elif defined GNULIB_POSIXCHECK
+       ...
+       #endif
+*/
+
+/* _GL_EXTERN_C declaration;
+   performs the declaration with C linkage.  */
+#if defined __cplusplus
+# define _GL_EXTERN_C extern "C"
+#else
+# define _GL_EXTERN_C extern
+#endif
+
+/* _GL_FUNCDECL_RPL (func, rettype, parameters_and_attributes);
+   declares a replacement function, named rpl_func, with the given prototype,
+   consisting of return type, parameters, and attributes.
+   Example:
+     _GL_FUNCDECL_RPL (open, int, (const char *filename, int flags, ...)
+                                  _GL_ARG_NONNULL ((1)));
+ */
+#define _GL_FUNCDECL_RPL(func,rettype,parameters_and_attributes) \
+  _GL_FUNCDECL_RPL_1 (rpl_##func, rettype, parameters_and_attributes)
+#define _GL_FUNCDECL_RPL_1(rpl_func,rettype,parameters_and_attributes) \
+  _GL_EXTERN_C rettype rpl_func parameters_and_attributes
+
+/* _GL_FUNCDECL_SYS (func, rettype, parameters_and_attributes);
+   declares the system function, named func, with the given prototype,
+   consisting of return type, parameters, and attributes.
+   Example:
+     _GL_FUNCDECL_SYS (open, int, (const char *filename, int flags, ...)
+                                  _GL_ARG_NONNULL ((1)));
+ */
+#define _GL_FUNCDECL_SYS(func,rettype,parameters_and_attributes) \
+  _GL_EXTERN_C rettype func parameters_and_attributes
+
+/* _GL_CXXALIAS_RPL (func, rettype, parameters);
+   declares a C++ alias called GNULIB_NAMESPACE::func
+   that redirects to rpl_func, if GNULIB_NAMESPACE is defined.
+   Example:
+     _GL_CXXALIAS_RPL (open, int, (const char *filename, int flags, ...));
+
+   Wrapping rpl_func in an object with an inline conversion operator
+   avoids a reference to rpl_func unless GNULIB_NAMESPACE::func is
+   actually used in the program.  */
+#define _GL_CXXALIAS_RPL(func,rettype,parameters) \
+  _GL_CXXALIAS_RPL_1 (func, rpl_##func, rettype, parameters)
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                                \
+    {                                                         \
+      static const struct _gl_ ## func ## _wrapper            \
+      {                                                       \
+        typedef rettype (*type) parameters;                   \
+                                                              \
+        inline operator type () const                         \
+        {                                                     \
+          return ::rpl_func;                                  \
+        }                                                     \
+      } func = {};                                            \
+    }                                                         \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_1(func,rpl_func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_MDA (func, rettype, parameters);
+   is to be used when func is a Microsoft deprecated alias, on native Windows.
+   It declares a C++ alias called GNULIB_NAMESPACE::func
+   that redirects to _func, if GNULIB_NAMESPACE is defined.
+   Example:
+     _GL_CXXALIAS_MDA (open, int, (const char *filename, int flags, ...));
+ */
+#define _GL_CXXALIAS_MDA(func,rettype,parameters) \
+  _GL_CXXALIAS_RPL_1 (func, _##func, rettype, parameters)
+
+/* _GL_CXXALIAS_RPL_CAST_1 (func, rpl_func, rettype, parameters);
+   is like  _GL_CXXALIAS_RPL_1 (func, rpl_func, rettype, parameters);
+   except that the C function rpl_func may have a slightly different
+   declaration.  A cast is used to silence the "invalid conversion" error
+   that would otherwise occur.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                                     \
+    {                                                              \
+      static const struct _gl_ ## func ## _wrapper                 \
+      {                                                            \
+        typedef rettype (*type) parameters;                        \
+                                                                   \
+        inline operator type () const                              \
+        {                                                          \
+          return reinterpret_cast<type>(::rpl_func);               \
+        }                                                          \
+      } func = {};                                                 \
+    }                                                              \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_RPL_CAST_1(func,rpl_func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_MDA_CAST (func, rettype, parameters);
+   is like  _GL_CXXALIAS_MDA (func, rettype, parameters);
+   except that the C function func may have a slightly different declaration.
+   A cast is used to silence the "invalid conversion" error that would
+   otherwise occur.  */
+#define _GL_CXXALIAS_MDA_CAST(func,rettype,parameters) \
+  _GL_CXXALIAS_RPL_CAST_1 (func, _##func, rettype, parameters)
+
+/* _GL_CXXALIAS_SYS (func, rettype, parameters);
+   declares a C++ alias called GNULIB_NAMESPACE::func
+   that redirects to the system provided function func, if GNULIB_NAMESPACE
+   is defined.
+   Example:
+     _GL_CXXALIAS_SYS (open, int, (const char *filename, int flags, ...));
+
+   Wrapping func in an object with an inline conversion operator
+   avoids a reference to func unless GNULIB_NAMESPACE::func is
+   actually used in the program.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_SYS(func,rettype,parameters)            \
+    namespace GNULIB_NAMESPACE                                \
+    {                                                         \
+      static const struct _gl_ ## func ## _wrapper            \
+      {                                                       \
+        typedef rettype (*type) parameters;                   \
+                                                              \
+        inline operator type () const                         \
+        {                                                     \
+          return ::func;                                      \
+        }                                                     \
+      } func = {};                                            \
+    }                                                         \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS(func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS_CAST (func, rettype, parameters);
+   is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
+   except that the C function func may have a slightly different declaration.
+   A cast is used to silence the "invalid conversion" error that would
+   otherwise occur.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+    namespace GNULIB_NAMESPACE                          \
+    {                                                   \
+      static const struct _gl_ ## func ## _wrapper      \
+      {                                                 \
+        typedef rettype (*type) parameters;             \
+                                                        \
+        inline operator type () const                   \
+        {                                               \
+          return reinterpret_cast<type>(::func);        \
+        }                                               \
+      } func = {};                                      \
+    }                                                   \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS_CAST(func,rettype,parameters) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIAS_SYS_CAST2 (func, rettype, parameters, rettype2, parameters2);
+   is like  _GL_CXXALIAS_SYS (func, rettype, parameters);
+   except that the C function is picked among a set of overloaded functions,
+   namely the one with rettype2 and parameters2.  Two consecutive casts
+   are used to silence the "cannot find a match" and "invalid conversion"
+   errors that would otherwise occur.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+  /* The outer cast must be a reinterpret_cast.
+     The inner cast: When the function is defined as a set of overloaded
+     functions, it works as a static_cast<>, choosing the designated variant.
+     When the function is defined as a single variant, it works as a
+     reinterpret_cast<>. The parenthesized cast syntax works both ways.  */
+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+    namespace GNULIB_NAMESPACE                                                \
+    {                                                                         \
+      static const struct _gl_ ## func ## _wrapper                            \
+      {                                                                       \
+        typedef rettype (*type) parameters;                                   \
+                                                                              \
+        inline operator type () const                                         \
+        {                                                                     \
+          return reinterpret_cast<type>((rettype2 (*) parameters2)(::func));  \
+        }                                                                     \
+      } func = {};                                                            \
+    }                                                                         \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#else
+# define _GL_CXXALIAS_SYS_CAST2(func,rettype,parameters,rettype2,parameters2) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIASWARN (func);
+   causes a warning to be emitted when ::func is used but not when
+   GNULIB_NAMESPACE::func is used.  func must be defined without overloaded
+   variants.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIASWARN(func) \
+   _GL_CXXALIASWARN_1 (func, GNULIB_NAMESPACE)
+# define _GL_CXXALIASWARN_1(func,namespace) \
+   _GL_CXXALIASWARN_2 (func, namespace)
+/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+   we enable the warning only when not optimizing.  */
+# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+    _GL_WARN_ON_USE (func, \
+                     "The symbol ::" #func " refers to the system function. " \
+                     "Use " #namespace "::" #func " instead.")
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+     extern __typeof__ (func) func
+# else
+#  define _GL_CXXALIASWARN_2(func,namespace) \
+     _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
+#else
+# define _GL_CXXALIASWARN(func) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+/* _GL_CXXALIASWARN1 (func, rettype, parameters_and_attributes);
+   causes a warning to be emitted when the given overloaded variant of ::func
+   is used but not when GNULIB_NAMESPACE::func is used.  */
+#if defined __cplusplus && defined GNULIB_NAMESPACE
+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+   _GL_CXXALIASWARN1_1 (func, rettype, parameters_and_attributes, \
+                        GNULIB_NAMESPACE)
+# define _GL_CXXALIASWARN1_1(func,rettype,parameters_and_attributes,namespace) \
+   _GL_CXXALIASWARN1_2 (func, rettype, parameters_and_attributes, namespace)
+/* To work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43881>,
+   we enable the warning only when not optimizing.  */
+# if !(defined __GNUC__ && !defined __clang__ && __OPTIMIZE__)
+#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+    _GL_WARN_ON_USE_CXX (func, rettype, rettype, parameters_and_attributes, \
+                         "The symbol ::" #func " refers to the system function. " \
+                         "Use " #namespace "::" #func " instead.")
+# else
+#  define _GL_CXXALIASWARN1_2(func,rettype,parameters_and_attributes,namespace) \
+     _GL_EXTERN_C int _gl_cxxalias_dummy
+# endif
+#else
+# define _GL_CXXALIASWARN1(func,rettype,parameters_and_attributes) \
+    _GL_EXTERN_C int _gl_cxxalias_dummy
+#endif
+
+#endif /* _GL_CXXDEFS_H */
diff --git a/tests/concat-filename.h b/tests/concat-filename.h
new file mode 100644 (file)
index 0000000..9b6e47e
--- /dev/null
@@ -0,0 +1,41 @@
+/* Construct a full filename from a directory and a relative filename.
+   Copyright (C) 2001-2004, 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _CONCAT_FILENAME_H
+#define _CONCAT_FILENAME_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Concatenate a directory filename, a relative filename and an optional
+   suffix.  Return a freshly allocated filename.  Return NULL and set errno
+   upon memory allocation failure.  */
+extern char *concatenated_filename (const char *directory,
+                                    const char *filename, const char *suffix);
+
+/* Concatenate a directory filename, a relative filename and an optional
+   suffix.  Return a freshly allocated filename.  */
+extern char *xconcatenated_filename (const char *directory,
+                                     const char *filename, const char *suffix);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _CONCAT_FILENAME_H */
diff --git a/tests/connect.c b/tests/connect.c
new file mode 100644 (file)
index 0000000..6dc1107
--- /dev/null
@@ -0,0 +1,56 @@
+/* connect.c --- wrappers for Windows connect function
+
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef connect
+
+int
+rpl_connect (int fd, const struct sockaddr *sockaddr, socklen_t len)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+
+  if (sock == INVALID_SOCKET)
+    {
+      errno = EBADF;
+      return -1;
+    }
+  else
+    {
+      int r = connect (sock, sockaddr, len);
+      if (r < 0)
+        {
+          /* EINPROGRESS is not returned by WinSock 2.0; for backwards
+             compatibility, connect(2) uses EWOULDBLOCK.  */
+          if (WSAGetLastError () == WSAEWOULDBLOCK)
+            WSASetLastError (WSAEINPROGRESS);
+
+          set_winsock_errno ();
+        }
+
+      return r;
+    }
+}
diff --git a/tests/creat.c b/tests/creat.c
new file mode 100644 (file)
index 0000000..1f66dbe
--- /dev/null
@@ -0,0 +1,80 @@
+/* Create a file.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* If the user's config.h happens to include <fcntl.h>, let it include only
+   the system's <fcntl.h> here, so that orig_creat doesn't recurse to
+   rpl_creat.  */
+#define __need_system_fcntl_h
+#include <config.h>
+
+/* Get the original definition of creat.  It might be defined as a macro.  */
+#include <fcntl.h>
+#include <sys/types.h>
+#undef __need_system_fcntl_h
+
+static int
+orig_creat (const char *filename, mode_t mode)
+{
+#if defined _WIN32 && !defined __CYGWIN__
+  return _creat (filename, mode);
+#else
+  return creat (filename, mode);
+#endif
+}
+
+/* Specification.  */
+/* Write "fcntl.h" here, not <fcntl.h>, otherwise OSF/1 5.1 DTK cc eliminates
+   this include because of the preliminary #include <fcntl.h> above.  */
+#include "fcntl.h"
+
+#include <errno.h>
+#include <string.h>
+#include <sys/types.h>
+
+int
+creat (const char *filename, mode_t mode)
+{
+#if OPEN_TRAILING_SLASH_BUG
+  /* Fail if the filename ends in a slash,
+     as POSIX says such a filename must name a directory
+     <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13>:
+       "A pathname that contains at least one non-<slash> character and that
+        ends with one or more trailing <slash> characters shall not be resolved
+        successfully unless the last pathname component before the trailing
+        <slash> characters names an existing directory"
+     creat() is defined as being equivalent to open() with flags
+     O_CREAT | O_TRUNC | O_WRONLY.  Therefore:
+     If the named file already exists as a directory, then creat() must fail
+     with errno = EISDIR.
+     If the named file does not exist or does not name a directory, then
+     creat() must fail since creat() cannot create directories.  */
+  {
+    size_t len = strlen (filename);
+    if (len > 0 && filename[len - 1] == '/')
+      {
+        errno = EISDIR;
+        return -1;
+      }
+  }
+#endif
+
+#if defined _WIN32 && !defined __CYGWIN__
+  /* Remap the 'x' bits to the 'r' bits.  */
+  mode = (mode & ~0111) | ((mode & 0111) << 2);
+#endif
+
+  return orig_creat (filename, mode);
+}
index 217812d..511a362 100644 (file)
@@ -1,6 +1,6 @@
 /* A substitute for ISO C99 <ctype.h>, for platforms on which it is incomplete.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible.  */
 
 /*
  * ISO C 99 <ctype.h> for platforms on which it is incomplete.
- * <http://www.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html>
+ * <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/ctype.h.html>
  */
 
 #ifndef _@GUARD_PREFIX@_CTYPE_H
diff --git a/tests/executable-script b/tests/executable-script
new file mode 100755 (executable)
index 0000000..7d8b9cc
--- /dev/null
@@ -0,0 +1,4 @@
+printf 'Halle '
+printf "Potta"
+# This script is intentionally not immediately recognizable as a shell script.
+# Don't add a .sh suffix. Don't add a #! header in the first line.
diff --git a/tests/executable-script.sh b/tests/executable-script.sh
new file mode 100755 (executable)
index 0000000..993f41c
--- /dev/null
@@ -0,0 +1,4 @@
+printf 'Halle '
+printf "Potta"
+# This script is intentionally not immediately recognizable as a shell script.
+# Don't add a #! header in the first line.
diff --git a/tests/executable-shell-script b/tests/executable-shell-script
new file mode 100755 (executable)
index 0000000..1e38117
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+# This script is a proper shell script.
+printf 'Halle '
+printf "Potta"
diff --git a/tests/explicit_bzero.c b/tests/explicit_bzero.c
new file mode 100644 (file)
index 0000000..f50ed08
--- /dev/null
@@ -0,0 +1,74 @@
+/* Erasure of sensitive data, generic implementation.
+   Copyright (C) 2016-2021 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU General Public
+   License as published by the Free Software Foundation; either
+   version 3 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+/* An assembler implementation of explicit_bzero can be created as an
+   assembler alias of an optimized bzero implementation.
+   Architecture-specific implementations also need to define
+   __explicit_bzero_chk.  */
+
+#if !_LIBC
+# include <config.h>
+#endif
+
+/* memset_s need this define */
+#if HAVE_MEMSET_S
+# define __STDC_WANT_LIB_EXT1__ 1
+#endif
+
+#include <string.h>
+
+#if defined _WIN32 && !defined __CYGWIN__
+# define  WIN32_LEAN_AND_MEAN
+# include <windows.h>
+#endif
+
+#if _LIBC
+/* glibc-internal users use __explicit_bzero_chk, and explicit_bzero
+   redirects to that.  */
+# undef explicit_bzero
+#endif
+
+/* Set LEN bytes of S to 0.  The compiler will not delete a call to
+   this function, even if S is dead after the call.  */
+void
+explicit_bzero (void *s, size_t len)
+{
+#if defined _WIN32 && !defined __CYGWIN__
+  (void) SecureZeroMemory (s, len);
+#elif HAVE_EXPLICIT_MEMSET
+  explicit_memset (s, '\0', len);
+#elif HAVE_MEMSET_S
+  (void) memset_s (s, len, '\0', len);
+#elif defined __GNUC__ && !defined __clang__
+  memset (s, '\0', len);
+  /* Compiler barrier.  */
+  asm volatile ("" ::: "memory");
+#elif defined __clang__
+  memset (s, '\0', len);
+  /* Compiler barrier.  */
+  /* With asm ("" ::: "memory") LLVM analyzes uses of 's' and finds that the
+     whole thing is dead and eliminates it.  Use 'g' to work around this
+     problem.  See <https://bugs.llvm.org/show_bug.cgi?id=15495#c11>.  */
+  __asm__ volatile ("" : : "g"(s) : "memory");
+#else
+  /* Invoke memset through a volatile function pointer.  This defeats compiler
+     optimizations.  */
+  void * (* const volatile volatile_memset) (void *, int, size_t) = memset;
+  (void) volatile_memset (s, '\0', len);
+#endif
+}
index 61fbfdf..3ef9a1d 100644 (file)
@@ -1,5 +1,5 @@
 /* Open a stream with a given file descriptor.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -27,7 +27,8 @@
 
 #undef fdopen
 
-#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+#if defined _WIN32 && !defined __CYGWIN__
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
 static FILE *
 fdopen_nothrow (int fd, const char *mode)
 {
@@ -35,7 +36,7 @@ fdopen_nothrow (int fd, const char *mode)
 
   TRY_MSVC_INVAL
     {
-      result = fdopen (fd, mode);
+      result = _fdopen (fd, mode);
     }
   CATCH_MSVC_INVAL
     {
@@ -45,6 +46,9 @@ fdopen_nothrow (int fd, const char *mode)
 
   return result;
 }
+# else
+#  define fdopen_nothrow _fdopen
+# endif
 #else
 # define fdopen_nothrow fdopen
 #endif
diff --git a/tests/filename.h b/tests/filename.h
deleted file mode 100644 (file)
index 7d2c31a..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/* Basic filename support macros.
-   Copyright (C) 2001-2004, 2007-2016 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-#ifndef _FILENAME_H
-#define _FILENAME_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-/* Pathname support.
-   ISSLASH(C)           tests whether C is a directory separator character.
-   IS_ABSOLUTE_PATH(P)  tests whether P is an absolute path.  If it is not,
-                        it may be concatenated to a directory pathname.
-   IS_PATH_WITH_DIR(P)  tests whether P contains a directory specification.
- */
-#if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
-  /* Native Windows, Cygwin, OS/2, DOS */
-# define ISSLASH(C) ((C) == '/' || (C) == '\\')
-# define HAS_DEVICE(P) \
-    ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) \
-     && (P)[1] == ':')
-# define IS_ABSOLUTE_PATH(P) (ISSLASH ((P)[0]) || HAS_DEVICE (P))
-# define IS_PATH_WITH_DIR(P) \
-    (strchr (P, '/') != NULL || strchr (P, '\\') != NULL || HAS_DEVICE (P))
-# define FILE_SYSTEM_PREFIX_LEN(P) (HAS_DEVICE (P) ? 2 : 0)
-#else
-  /* Unix */
-# define ISSLASH(C) ((C) == '/')
-# define IS_ABSOLUTE_PATH(P) ISSLASH ((P)[0])
-# define IS_PATH_WITH_DIR(P) (strchr (P, '/') != NULL)
-# define FILE_SYSTEM_PREFIX_LEN(P) 0
-#endif
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _FILENAME_H */
diff --git a/tests/findprog.c b/tests/findprog.c
new file mode 100644 (file)
index 0000000..3389a60
--- /dev/null
@@ -0,0 +1,158 @@
+/* Locating a program in PATH.
+   Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+
+#include <config.h>
+
+/* Specification.  */
+#include "findprog.h"
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#if !(defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__)
+# include <sys/stat.h>
+#endif
+
+/* Avoid collision between findprog.c and findprog-lgpl.c.  */
+#if IN_FINDPROG_LGPL || ! GNULIB_FINDPROG_LGPL
+
+#if !IN_FINDPROG_LGPL
+# include "xalloc.h"
+#endif
+#include "concat-filename.h"
+
+
+const char *
+find_in_path (const char *progname)
+{
+#if defined _WIN32 || defined __CYGWIN__ || defined __EMX__ || defined __DJGPP__
+  /* Native Windows, Cygwin, OS/2, DOS */
+  /* The searching rules with .COM, .EXE, .BAT, .CMD etc. suffixes are
+     too complicated.  Leave it to the OS.  */
+  return progname;
+#else
+  /* Unix */
+  char *path;
+  char *path_rest;
+  char *cp;
+
+  if (strchr (progname, '/') != NULL)
+    /* If progname contains a slash, it is either absolute or relative to
+       the current directory.  PATH is not used.  */
+    return progname;
+
+  path = getenv ("PATH");
+  if (path == NULL || *path == '\0')
+    /* If PATH is not set, the default search path is implementation
+       dependent.  */
+    return progname;
+
+  /* Make a copy, to prepare for destructive modifications.  */
+# if !IN_FINDPROG_LGPL
+  path = xstrdup (path);
+# else
+  path = strdup (path);
+  if (path == NULL)
+    /* Out of memory.  */
+    return progname;
+# endif
+  for (path_rest = path; ; path_rest = cp + 1)
+    {
+      const char *dir;
+      bool last;
+      char *progpathname;
+
+      /* Extract next directory in PATH.  */
+      dir = path_rest;
+      for (cp = path_rest; *cp != '\0' && *cp != ':'; cp++)
+        ;
+      last = (*cp == '\0');
+      *cp = '\0';
+
+      /* Empty PATH components designate the current directory.  */
+      if (dir == cp)
+        dir = ".";
+
+      /* Concatenate dir and progname.  */
+# if !IN_FINDPROG_LGPL
+      progpathname = xconcatenated_filename (dir, progname, NULL);
+# else
+      progpathname = concatenated_filename (dir, progname, NULL);
+      if (progpathname == NULL)
+        {
+          /* Out of memory.  */
+          free (path);
+          return progname;
+        }
+# endif
+
+      /* On systems which have the eaccess() system call, let's use it.
+         On other systems, let's hope that this program is not installed
+         setuid or setgid, so that it is ok to call access() despite its
+         design flaw.  */
+      if (eaccess (progpathname, X_OK) == 0)
+        {
+          /* Check that the progpathname does not point to a directory.  */
+          struct stat statbuf;
+
+          if (stat (progpathname, &statbuf) >= 0
+              && ! S_ISDIR (statbuf.st_mode))
+            {
+              /* Found!  */
+              if (strcmp (progpathname, progname) == 0)
+                {
+                  free (progpathname);
+
+                  /* Add the "./" prefix for real, that xconcatenated_filename()
+                     optimized away.  This avoids a second PATH search when the
+                     caller uses execlp/execvp.  */
+# if !IN_FINDPROG_LGPL
+                  progpathname = XNMALLOC (2 + strlen (progname) + 1, char);
+# else
+                  progpathname = (char *) malloc (2 + strlen (progname) + 1);
+                  if (progpathname == NULL)
+                    {
+                      /* Out of memory.  */
+                      free (path);
+                      return progname;
+                    }
+# endif
+                  progpathname[0] = '.';
+                  progpathname[1] = '/';
+                  memcpy (progpathname + 2, progname, strlen (progname) + 1);
+                }
+
+              free (path);
+              return progpathname;
+            }
+        }
+
+      free (progpathname);
+
+      if (last)
+        break;
+    }
+
+  /* Not found in PATH.  An error will be signalled at the first call.  */
+  free (path);
+  return progname;
+#endif
+}
+
+#endif
diff --git a/tests/findprog.h b/tests/findprog.h
new file mode 100644 (file)
index 0000000..04d2d35
--- /dev/null
@@ -0,0 +1,77 @@
+/* Locating a program in PATH.
+   Copyright (C) 2001-2003, 2009-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <haible@clisp.cons.org>, 2001.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _FINDPROG_H
+#define _FINDPROG_H
+
+#include <stdbool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Looks up a program in the PATH.
+   Attempts to determine the pathname that would be called by execlp/execvp
+   of PROGNAME.  If successful, it returns a pathname containing a slash
+   (either absolute or relative to the current directory).  Otherwise, it
+   returns PROGNAME unmodified.
+   Because of the latter case, callers should use execlp/execvp, not
+   execl/execv on the returned pathname.
+   The returned string is freshly malloc()ed if it is != PROGNAME.  */
+extern const char *find_in_path (const char *progname);
+
+/* Looks up a program in the given PATH-like string.
+
+   The PATH argument consists of a list of directories, separated by ':' or
+   (on native Windows) by ';'.  An empty PATH element designates the current
+   directory.  A null PATH is equivalent to an empty PATH, that is, to the
+   singleton list that contains only the current directory.
+
+   If DIRECTORY is not NULL, all relative filenames (i.e. PROGNAME when it
+   contains a slash, and the PATH elements) are considered relative to
+   DIRECTORY instead of relative to the current directory of this process.
+
+   Determines the pathname that would be called by execlp/execvp of PROGNAME.
+   - If successful, it returns a pathname containing a slash (either absolute
+     or relative to the current directory).  The returned string can be used
+     with either execl/execv or execlp/execvp.  It is freshly malloc()ed if it
+     is != PROGNAME.
+   - Otherwise, it sets errno and returns NULL.
+     Specific errno values include:
+       - ENOENT: means that the program's file was not found.
+       - EACCES: means that the program's file cannot be accessed (due to some
+         issue with one of the ancestor directories) or lacks the execute
+         permissions.
+       - ENOMEM: means out of memory.
+   If OPTIMIZE_FOR_EXEC is true, the function saves some work, under the
+   assumption that the resulting pathname will not be accessed directly,
+   only through execl/execv or execlp/execvp.
+
+   Here, a "slash" means:
+     - On POSIX systems excluding Cygwin: a '/',
+     - On Windows, OS/2, DOS platforms: a '/' or '\'. */
+extern const char *find_in_given_path (const char *progname, const char *path,
+                                       const char *directory,
+                                       bool optimize_for_exec);
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FINDPROG_H */
diff --git a/tests/flexmember.h b/tests/flexmember.h
deleted file mode 100644 (file)
index 62c556b..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Sizes of structs with flexible array members.
-
-   Copyright 2016 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-   Written by Paul Eggert.  */
-
-#include <stddef.h>
-
-/* Nonzero multiple of alignment of TYPE, suitable for FLEXSIZEOF below.
-   On older platforms without _Alignof, use a pessimistic bound that is
-   safe in practice even if FLEXIBLE_ARRAY_MEMBER is 1.
-   On newer platforms, use _Alignof to get a tighter bound.  */
-
-#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112
-# define FLEXALIGNOF(type) (sizeof (type) & ~ (sizeof (type) - 1))
-#else
-# define FLEXALIGNOF(type) _Alignof (type)
-#endif
-
-/* Upper bound on the size of a struct of type TYPE with a flexible
-   array member named MEMBER that is followed by N bytes of other data.
-   This is not simply sizeof (TYPE) + N, since it may require
-   alignment on unusually picky C11 platforms, and
-   FLEXIBLE_ARRAY_MEMBER may be 1 on pre-C11 platforms.
-   Yield a value less than N if and only if arithmetic overflow occurs.  */
-
-#define FLEXSIZEOF(type, member, n) \
-   ((offsetof (type, member) + FLEXALIGNOF (type) - 1 + (n)) \
-    & ~ (FLEXALIGNOF (type) - 1))
diff --git a/tests/freopen.c b/tests/freopen.c
new file mode 100644 (file)
index 0000000..80cca04
--- /dev/null
@@ -0,0 +1,92 @@
+/* Open a stream to a file.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+/* If the user's config.h happens to include <stdio.h>, let it include only
+   the system's <stdio.h> here, so that orig_freopen doesn't recurse to
+   rpl_freopen.  */
+#define _GL_ALREADY_INCLUDING_STDIO_H
+#include <config.h>
+
+/* Get the original definition of freopen.  It might be defined as a macro.  */
+#include <stdio.h>
+#undef _GL_ALREADY_INCLUDING_STDIO_H
+
+#include <errno.h>
+
+static FILE *
+orig_freopen (const char *filename, const char *mode, FILE *stream)
+{
+  return freopen (filename, mode, stream);
+}
+
+/* Specification.  */
+/* Write "stdio.h" here, not <stdio.h>, otherwise OSF/1 5.1 DTK cc eliminates
+   this include because of the preliminary #include <stdio.h> above.  */
+#include "stdio.h"
+
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+
+FILE *
+rpl_freopen (const char *filename, const char *mode, FILE *stream)
+{
+  FILE *result;
+#if defined _WIN32 && ! defined __CYGWIN__
+  char const *null_device = "NUL";
+  if (filename && strcmp (filename, "/dev/null") == 0)
+    filename = null_device;
+#else
+  char const *null_device = "/dev/null";
+#endif
+
+#ifdef __KLIBC__
+  errno = 0;
+#endif
+
+  result = orig_freopen (filename, mode, stream);
+
+  if (!result)
+    {
+#ifdef __KLIBC__
+      /* On OS/2 kLIBC, freopen returns NULL even if it is successful
+         if filename is NULL. */
+      if (!filename && !errno)
+        result = stream;
+#endif
+    }
+  else if (filename)
+    {
+      int fd = fileno (result);
+      if (dup2 (fd, fd) < 0 && errno == EBADF)
+        {
+          int nullfd = open (null_device, O_RDONLY | O_CLOEXEC);
+          int err = 0;
+          if (nullfd != fd)
+            {
+              if (dup2 (nullfd, fd) < 0)
+                err = 1;
+              close (nullfd);
+            }
+          if (!err)
+            result = orig_freopen (filename, mode, result);
+        }
+    }
+
+  return result;
+}
diff --git a/tests/ftruncate.c b/tests/ftruncate.c
new file mode 100644 (file)
index 0000000..873f302
--- /dev/null
@@ -0,0 +1,195 @@
+/* ftruncate emulations for native Windows.
+   Copyright (C) 1992-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <unistd.h>
+
+#if HAVE__CHSIZE
+/* A native Windows platform.  */
+
+# include <errno.h>
+
+# if _GL_WINDOWS_64_BIT_OFF_T
+
+/* Large File Support: off_t is 64-bit, but _chsize() takes only a 32-bit
+   argument.  So, define a 64-bit safe SetFileSize function ourselves.  */
+
+/* Ensure that <windows.h> declares GetFileSizeEx.  */
+#  if !defined _WIN32_WINNT || (_WIN32_WINNT < _WIN32_WINNT_WIN2K)
+#   undef _WIN32_WINNT
+#   define _WIN32_WINNT _WIN32_WINNT_WIN2K
+#  endif
+
+/* Get declarations of the native Windows API functions.  */
+#  define WIN32_LEAN_AND_MEAN
+#  include <windows.h>
+
+/* Get _get_osfhandle.  */
+#  if GNULIB_MSVC_NOTHROW
+#   include "msvc-nothrow.h"
+#  else
+#   include <io.h>
+#  endif
+
+static BOOL
+SetFileSize (HANDLE h, LONGLONG size)
+{
+  LARGE_INTEGER old_size;
+
+  if (!GetFileSizeEx (h, &old_size))
+    return FALSE;
+
+  if (size != old_size.QuadPart)
+    {
+      /* Duplicate the handle, so we are free to modify its file position.  */
+      HANDLE curr_process = GetCurrentProcess ();
+      HANDLE tmph;
+
+      if (!DuplicateHandle (curr_process,           /* SourceProcessHandle */
+                            h,                      /* SourceHandle */
+                            curr_process,           /* TargetProcessHandle */
+                            (PHANDLE) &tmph,        /* TargetHandle */
+                            (DWORD) 0,              /* DesiredAccess */
+                            FALSE,                  /* InheritHandle */
+                            DUPLICATE_SAME_ACCESS)) /* Options */
+        return FALSE;
+
+      if (size < old_size.QuadPart)
+        {
+          /* Reduce the size.  */
+          LONG size_hi = (LONG) (size >> 32);
+          if (SetFilePointer (tmph, (LONG) size, &size_hi, FILE_BEGIN)
+              == INVALID_SET_FILE_POINTER
+              && GetLastError() != NO_ERROR)
+            {
+              CloseHandle (tmph);
+              return FALSE;
+            }
+          if (!SetEndOfFile (tmph))
+            {
+              CloseHandle (tmph);
+              return FALSE;
+            }
+        }
+      else
+        {
+          /* Increase the size by adding zero bytes at the end.  */
+          static char zero_bytes[1024];
+          LONG pos_hi = 0;
+          LONG pos_lo = SetFilePointer (tmph, (LONG) 0, &pos_hi, FILE_END);
+          LONGLONG pos;
+          if (pos_lo == INVALID_SET_FILE_POINTER
+              && GetLastError() != NO_ERROR)
+            {
+              CloseHandle (tmph);
+              return FALSE;
+            }
+          pos = ((LONGLONG) pos_hi << 32) | (ULONGLONG) (ULONG) pos_lo;
+          while (pos < size)
+            {
+              DWORD written;
+              LONGLONG count = size - pos;
+              if (count > sizeof (zero_bytes))
+                count = sizeof (zero_bytes);
+              if (!WriteFile (tmph, zero_bytes, (DWORD) count, &written, NULL)
+                  || written == 0)
+                {
+                  CloseHandle (tmph);
+                  return FALSE;
+                }
+              pos += (ULONGLONG) (ULONG) written;
+            }
+        }
+      /* Close the handle.  */
+      CloseHandle (tmph);
+    }
+  return TRUE;
+}
+
+int
+ftruncate (int fd, off_t length)
+{
+  HANDLE handle = (HANDLE) _get_osfhandle (fd);
+
+  if (handle == INVALID_HANDLE_VALUE)
+    {
+      errno = EBADF;
+      return -1;
+    }
+  if (length < 0)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+  if (!SetFileSize (handle, length))
+    {
+      switch (GetLastError ())
+        {
+        case ERROR_ACCESS_DENIED:
+          errno = EACCES;
+          break;
+        case ERROR_HANDLE_DISK_FULL:
+        case ERROR_DISK_FULL:
+        case ERROR_DISK_TOO_FRAGMENTED:
+          errno = ENOSPC;
+          break;
+        default:
+          errno = EIO;
+          break;
+        }
+      return -1;
+    }
+  return 0;
+}
+
+# else
+
+#  include <io.h>
+
+#  if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+#   include "msvc-inval.h"
+static int
+chsize_nothrow (int fd, long length)
+{
+  int result;
+
+  TRY_MSVC_INVAL
+    {
+      result = _chsize (fd, length);
+    }
+  CATCH_MSVC_INVAL
+    {
+      result = -1;
+      errno = EBADF;
+    }
+  DONE_MSVC_INVAL;
+
+  return result;
+}
+#  else
+#   define chsize_nothrow _chsize
+#  endif
+
+int
+ftruncate (int fd, off_t length)
+{
+  return chsize_nothrow (fd, length);
+}
+
+# endif
+#endif
diff --git a/tests/gettimeofday.c b/tests/gettimeofday.c
new file mode 100644 (file)
index 0000000..b1c93e1
--- /dev/null
@@ -0,0 +1,153 @@
+/* Provide gettimeofday for systems that don't have it or for which it's broken.
+
+   Copyright (C) 2001-2003, 2005-2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering */
+
+#include <config.h>
+
+/* Specification.  */
+#include <sys/time.h>
+
+#include <time.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
+# include <windows.h>
+#endif
+
+#ifdef WINDOWS_NATIVE
+
+/* Don't assume that UNICODE is not defined.  */
+# undef LoadLibrary
+# define LoadLibrary LoadLibraryA
+
+# if !(_WIN32_WINNT >= _WIN32_WINNT_WIN8)
+
+/* Avoid warnings from gcc -Wcast-function-type.  */
+#  define GetProcAddress \
+    (void *) GetProcAddress
+
+/* GetSystemTimePreciseAsFileTime was introduced only in Windows 8.  */
+typedef void (WINAPI * GetSystemTimePreciseAsFileTimeFuncType) (FILETIME *lpTime);
+static GetSystemTimePreciseAsFileTimeFuncType GetSystemTimePreciseAsFileTimeFunc = NULL;
+static BOOL initialized = FALSE;
+
+static void
+initialize (void)
+{
+  HMODULE kernel32 = LoadLibrary ("kernel32.dll");
+  if (kernel32 != NULL)
+    {
+      GetSystemTimePreciseAsFileTimeFunc =
+        (GetSystemTimePreciseAsFileTimeFuncType) GetProcAddress (kernel32, "GetSystemTimePreciseAsFileTime");
+    }
+  initialized = TRUE;
+}
+
+# else
+
+#  define GetSystemTimePreciseAsFileTimeFunc GetSystemTimePreciseAsFileTime
+
+# endif
+
+#endif
+
+/* This is a wrapper for gettimeofday.  It is used only on systems
+   that lack this function, or whose implementation of this function
+   causes problems.
+   Work around the bug in some systems whereby gettimeofday clobbers
+   the static buffer that localtime uses for its return value.  The
+   gettimeofday function from Mac OS X 10.0.4 (i.e., Darwin 1.3.7) has
+   this problem.  */
+
+int
+gettimeofday (struct timeval *restrict tv, void *restrict tz)
+{
+#undef gettimeofday
+#ifdef WINDOWS_NATIVE
+
+  /* On native Windows, there are two ways to get the current time:
+     GetSystemTimeAsFileTime
+     <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimeasfiletime>
+     or
+     GetSystemTimePreciseAsFileTime
+     <https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getsystemtimepreciseasfiletime>.
+     GetSystemTimeAsFileTime produces values that jump by increments of
+     15.627 milliseconds (!) on average.
+     Whereas GetSystemTimePreciseAsFileTime values usually jump by 1 or 2
+     microseconds.
+     More discussion on this topic:
+     <http://www.windowstimestamp.com/description>.  */
+  FILETIME current_time;
+
+# if !(_WIN32_WINNT >= _WIN32_WINNT_WIN8)
+  if (!initialized)
+    initialize ();
+# endif
+  if (GetSystemTimePreciseAsFileTimeFunc != NULL)
+    GetSystemTimePreciseAsFileTimeFunc (&current_time);
+  else
+    GetSystemTimeAsFileTime (&current_time);
+
+  /* Convert from FILETIME to 'struct timeval'.  */
+  /* FILETIME: <https://docs.microsoft.com/en-us/windows/desktop/api/minwinbase/ns-minwinbase-filetime> */
+  ULONGLONG since_1601 =
+    ((ULONGLONG) current_time.dwHighDateTime << 32)
+    | (ULONGLONG) current_time.dwLowDateTime;
+  /* Between 1601-01-01 and 1970-01-01 there were 280 normal years and 89 leap
+     years, in total 134774 days.  */
+  ULONGLONG since_1970 =
+    since_1601 - (ULONGLONG) 134774 * (ULONGLONG) 86400 * (ULONGLONG) 10000000;
+  ULONGLONG microseconds_since_1970 = since_1970 / (ULONGLONG) 10;
+  tv->tv_sec = microseconds_since_1970 / (ULONGLONG) 1000000;
+  tv->tv_usec = microseconds_since_1970 % (ULONGLONG) 1000000;
+
+  return 0;
+
+#else
+
+# if HAVE_GETTIMEOFDAY
+
+#  if defined timeval /* 'struct timeval' overridden by gnulib?  */
+#   undef timeval
+  struct timeval otv;
+  int result = gettimeofday (&otv, (struct timezone *) tz);
+  if (result == 0)
+    {
+      tv->tv_sec = otv.tv_sec;
+      tv->tv_usec = otv.tv_usec;
+    }
+#  else
+  int result = gettimeofday (tv, (struct timezone *) tz);
+#  endif
+
+  return result;
+
+# else
+
+#  if !defined OK_TO_USE_1S_CLOCK
+#   error "Only 1-second nominal clock resolution found.  Is that intended?" \
+          "If so, compile with the -DOK_TO_USE_1S_CLOCK option."
+#  endif
+  tv->tv_sec = time (NULL);
+  tv->tv_usec = 0;
+
+  return 0;
+
+# endif
+#endif
+}
index 66cf34b..203e618 100644 (file)
@@ -1,5 +1,5 @@
 /* Sequential list data type implemented by an array.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 /* Specification.  */
 #include "gl_array_list.h"
 
+#include <stdint.h>
 #include <stdlib.h>
 /* Get memcpy.  */
 #include <string.h>
 /* Checked size_t computations.  */
 #include "xsize.h"
 
-#ifndef uintptr_t
-# define uintptr_t unsigned long
-#endif
-
 /* -------------------------- gl_list_t Data Type -------------------------- */
 
 /* Concrete gl_list_impl type, valid for this file only.  */
@@ -114,7 +111,7 @@ gl_array_nx_create (gl_list_implementation_t implementation,
   return NULL;
 }
 
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
 gl_array_size (gl_list_t list)
 {
   return list->count;
@@ -169,6 +166,24 @@ gl_array_previous_node (gl_list_t list, gl_list_node_t node)
     return NULL;
 }
 
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_array_first_node (gl_list_t list)
+{
+  if (list->count > 0)
+    return INDEX_TO_NODE (0);
+  else
+    return NULL;
+}
+
+static gl_list_node_t _GL_ATTRIBUTE_PURE
+gl_array_last_node (gl_list_t list)
+{
+  if (list->count > 0)
+    return INDEX_TO_NODE (list->count - 1);
+  else
+    return NULL;
+}
+
 static const void * _GL_ATTRIBUTE_PURE
 gl_array_get_at (gl_list_t list, size_t position)
 {
@@ -192,7 +207,7 @@ gl_array_nx_set_at (gl_list_t list, size_t position, const void *elt)
   return INDEX_TO_NODE (position);
 }
 
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
 gl_array_indexof_from_to (gl_list_t list, size_t start_index, size_t end_index,
                           const void *elt)
 {
@@ -235,7 +250,7 @@ gl_array_indexof_from_to (gl_list_t list, size_t start_index, size_t end_index,
   return (size_t)(-1);
 }
 
-static gl_list_node_t
+static gl_list_node_t _GL_ATTRIBUTE_PURE
 gl_array_search_from_to (gl_list_t list, size_t start_index, size_t end_index,
                          const void *elt)
 {
@@ -444,7 +459,7 @@ gl_array_list_free (gl_list_t list)
 
 /* --------------------- gl_list_iterator_t Data Type --------------------- */
 
-static gl_list_iterator_t
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
 gl_array_iterator (gl_list_t list)
 {
   gl_list_iterator_t result;
@@ -462,7 +477,7 @@ gl_array_iterator (gl_list_t list)
   return result;
 }
 
-static gl_list_iterator_t
+static gl_list_iterator_t _GL_ATTRIBUTE_PURE
 gl_array_iterator_from_to (gl_list_t list, size_t start_index, size_t end_index)
 {
   gl_list_iterator_t result;
@@ -512,13 +527,13 @@ gl_array_iterator_next (gl_list_iterator_t *iterator,
 }
 
 static void
-gl_array_iterator_free (gl_list_iterator_t *iterator)
+gl_array_iterator_free (gl_list_iterator_t *iterator _GL_ATTRIBUTE_MAYBE_UNUSED)
 {
 }
 
 /* ---------------------- Sorted gl_list_t Data Type ---------------------- */
 
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
 gl_array_sortedlist_indexof_from_to (gl_list_t list,
                                      gl_listelement_compar_fn compar,
                                      size_t low, size_t high,
@@ -577,7 +592,7 @@ gl_array_sortedlist_indexof_from_to (gl_list_t list,
   return (size_t)(-1);
 }
 
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
 gl_array_sortedlist_indexof (gl_list_t list, gl_listelement_compar_fn compar,
                              const void *elt)
 {
@@ -585,7 +600,7 @@ gl_array_sortedlist_indexof (gl_list_t list, gl_listelement_compar_fn compar,
                                               elt);
 }
 
-static gl_list_node_t
+static gl_list_node_t _GL_ATTRIBUTE_PURE
 gl_array_sortedlist_search_from_to (gl_list_t list,
                                     gl_listelement_compar_fn compar,
                                     size_t low, size_t high,
@@ -596,7 +611,7 @@ gl_array_sortedlist_search_from_to (gl_list_t list,
   return INDEX_TO_NODE (index);
 }
 
-static gl_list_node_t
+static gl_list_node_t _GL_ATTRIBUTE_PURE
 gl_array_sortedlist_search (gl_list_t list, gl_listelement_compar_fn compar,
                             const void *elt)
 {
@@ -654,6 +669,8 @@ const struct gl_list_implementation gl_array_list_implementation =
     gl_array_node_nx_set_value,
     gl_array_next_node,
     gl_array_previous_node,
+    gl_array_first_node,
+    gl_array_last_node,
     gl_array_get_at,
     gl_array_nx_set_at,
     gl_array_search_from_to,
index 1d1e6f9..99b6bf1 100644 (file)
@@ -1,5 +1,5 @@
 /* Sequential list data type implemented by an array.
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_ARRAY_LIST_H
 #define _GL_ARRAY_LIST_H
index 92e69cc..4ed2a3c 100644 (file)
@@ -1,5 +1,5 @@
 /* Ordered set data type implemented by an array.
-   Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -59,13 +59,13 @@ gl_array_nx_create_empty (gl_oset_implementation_t implementation,
   return set;
 }
 
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
 gl_array_size (gl_oset_t set)
 {
   return set->count;
 }
 
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
 gl_array_indexof (gl_oset_t set, const void *elt)
 {
   size_t count = set->count;
@@ -101,17 +101,21 @@ gl_array_indexof (gl_oset_t set, const void *elt)
   return (size_t)(-1);
 }
 
-static bool
+static bool _GL_ATTRIBUTE_PURE
 gl_array_search (gl_oset_t set, const void *elt)
 {
   return gl_array_indexof (set, elt) != (size_t)(-1);
 }
 
-static bool
-gl_array_search_atleast (gl_oset_t set,
-                         gl_setelement_threshold_fn threshold_fn,
-                         const void *threshold,
-                         const void **eltp)
+/* Searches the least element in the ordered set that compares greater or equal
+   to the given THRESHOLD.  The representation of the THRESHOLD is defined
+   by the THRESHOLD_FN.
+   Returns the position at which it was found, or gl_list_size (SET) if not
+   found.  */
+static size_t _GL_ATTRIBUTE_PURE
+gl_array_indexof_atleast (gl_oset_t set,
+                          gl_setelement_threshold_fn threshold_fn,
+                          const void *threshold)
 {
   size_t count = set->count;
 
@@ -136,7 +140,7 @@ gl_array_search_atleast (gl_oset_t set,
                  minimal such index.  */
               high = mid;
               /* At each loop iteration, low <= high and
-                   compar (list->elements[high], value) >= 0,
+                   compar (set->elements[high], threshold) >= 0,
                  and we know that the first occurrence of the element is at
                  low <= position <= high.  */
               while (low < high)
@@ -148,13 +152,29 @@ gl_array_search_atleast (gl_oset_t set,
                   else
                     high = mid2;
                 }
-              *eltp = set->elements[low];
-              return true;
+              return low;
             }
         }
       while (low < high);
     }
-  return false;
+  return count;
+}
+
+static bool _GL_ATTRIBUTE_PURE
+gl_array_search_atleast (gl_oset_t set,
+                         gl_setelement_threshold_fn threshold_fn,
+                         const void *threshold,
+                         const void **eltp)
+{
+  size_t index = gl_array_indexof_atleast (set, threshold_fn, threshold);
+
+  if (index == set->count)
+    return false;
+  else
+    {
+      *eltp = set->elements[index];
+      return true;
+    }
 }
 
 /* Ensure that set->allocated > set->count.
@@ -267,6 +287,116 @@ gl_array_remove (gl_oset_t set, const void *elt)
     return false;
 }
 
+static int
+gl_array_update (gl_oset_t set, const void *elt,
+                 void (*action) (const void * /*elt*/, void * /*action_data*/),
+                 void *action_data)
+{
+  /* Like gl_array_remove, action (...), gl_array_nx_add, except that we don't
+     actually remove ELT.  */
+  /* Remember the old position.  */
+  size_t old_index = gl_array_indexof (set, elt);
+  /* Invoke ACTION.  */
+  action (elt, action_data);
+  /* Determine the new position.  */
+  if (old_index != (size_t)(-1))
+    {
+      size_t count = set->count;
+
+      if (count > 1)
+        {
+          gl_setelement_compar_fn compar = set->base.compar_fn;
+          size_t low;
+          size_t high;
+
+          if (old_index > 0)
+            {
+              size_t mid = old_index - 1;
+              int cmp = (compar != NULL
+                         ? compar (set->elements[mid], elt)
+                         : (set->elements[mid] > elt ? 1 :
+                            set->elements[mid] < elt ? -1 : 0));
+              if (cmp < 0)
+                {
+                  low = old_index + 1;
+                  high = count;
+                }
+              else if (cmp > 0)
+                {
+                  low = 0;
+                  high = mid;
+                }
+              else /* cmp == 0 */
+                {
+                  /* Two adjacent elements are the same.  */
+                  gl_array_remove_at (set, old_index);
+                  return -1;
+                }
+            }
+          else
+            {
+              low = old_index + 1;
+              high = count;
+            }
+
+          /* At each loop iteration, low <= high; for indices < low the values
+             are smaller than ELT; for indices >= high the values are greater
+             than ELT.  So, if the element occurs in the list, it is at
+             low <= position < high.  */
+          while (low < high)
+            {
+              size_t mid = low + (high - low) / 2; /* low <= mid < high */
+              int cmp = (compar != NULL
+                         ? compar (set->elements[mid], elt)
+                         : (set->elements[mid] > elt ? 1 :
+                            set->elements[mid] < elt ? -1 : 0));
+
+              if (cmp < 0)
+                low = mid + 1;
+              else if (cmp > 0)
+                high = mid;
+              else /* cmp == 0 */
+                {
+                  /* Two elements are the same.  */
+                  gl_array_remove_at (set, old_index);
+                  return -1;
+                }
+            }
+
+          if (low < old_index)
+            {
+              /* Move the element from old_index to low.  */
+              size_t new_index = low;
+              const void **elements = set->elements;
+              size_t i;
+
+              for (i = old_index; i > new_index; i--)
+                elements[i] = elements[i - 1];
+              elements[new_index] = elt;
+              return true;
+            }
+          else
+            {
+              /* low > old_index.  */
+              /* Move the element from old_index to low - 1.  */
+              size_t new_index = low - 1;
+
+              if (new_index > old_index)
+                {
+                  const void **elements = set->elements;
+                  size_t i;
+
+                  for (i = old_index; i < new_index; i++)
+                    elements[i] = elements[i + 1];
+                  elements[new_index] = elt;
+                  return true;
+                }
+            }
+        }
+    }
+  return false;
+}
+
 static void
 gl_array_free (gl_oset_t set)
 {
@@ -293,7 +423,7 @@ gl_array_free (gl_oset_t set)
 
 /* --------------------- gl_oset_iterator_t Data Type --------------------- */
 
-static gl_oset_iterator_t
+static gl_oset_iterator_t _GL_ATTRIBUTE_PURE
 gl_array_iterator (gl_oset_t set)
 {
   gl_oset_iterator_t result;
@@ -311,6 +441,27 @@ gl_array_iterator (gl_oset_t set)
   return result;
 }
 
+static gl_oset_iterator_t _GL_ATTRIBUTE_PURE
+gl_array_iterator_atleast (gl_oset_t set,
+                           gl_setelement_threshold_fn threshold_fn,
+                           const void *threshold)
+{
+  size_t index = gl_array_indexof_atleast (set, threshold_fn, threshold);
+  gl_oset_iterator_t result;
+
+  result.vtable = set->base.vtable;
+  result.set = set;
+  result.count = set->count;
+  result.p = set->elements + index;
+  result.q = set->elements + set->count;
+#if defined GCC_LINT || defined lint
+  result.i = 0;
+  result.j = 0;
+#endif
+
+  return result;
+}
+
 static bool
 gl_array_iterator_next (gl_oset_iterator_t *iterator, const void **eltp)
 {
@@ -337,7 +488,7 @@ gl_array_iterator_next (gl_oset_iterator_t *iterator, const void **eltp)
 }
 
 static void
-gl_array_iterator_free (gl_oset_iterator_t *iterator)
+gl_array_iterator_free (gl_oset_iterator_t *iterator _GL_ATTRIBUTE_MAYBE_UNUSED)
 {
 }
 
@@ -350,8 +501,10 @@ const struct gl_oset_implementation gl_array_oset_implementation =
     gl_array_search_atleast,
     gl_array_nx_add,
     gl_array_remove,
+    gl_array_update,
     gl_array_free,
     gl_array_iterator,
+    gl_array_iterator_atleast,
     gl_array_iterator_next,
     gl_array_iterator_free
   };
index 66df3d2..4870562 100644 (file)
@@ -1,5 +1,5 @@
 /* Ordered set data type implemented by an array.
-   Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef _GL_ARRAY_OSET_H
 #define _GL_ARRAY_OSET_H
diff --git a/tests/glthread/thread.c b/tests/glthread/thread.c
new file mode 100644 (file)
index 0000000..12ff5bb
--- /dev/null
@@ -0,0 +1,205 @@
+/* Creating and controlling threads.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h.  */
+
+#include <config.h>
+
+/* Specification.  */
+# define _GLTHREAD_THREAD_INLINE _GL_EXTERN_INLINE
+#include "glthread/thread.h"
+
+#include <stdlib.h>
+#include "glthread/lock.h"
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS
+
+struct thrd_with_exitvalue
+{
+  thrd_t volatile tid;
+  void * volatile exitvalue;
+};
+
+/* The Thread-Specific Storage (TSS) key that allows to access each thread's
+   'struct thrd_with_exitvalue *' pointer.  */
+static tss_t thrd_with_exitvalue_key;
+
+/* Initializes thrd_with_exitvalue_key.
+   This function must only be called once.  */
+static void
+do_init_thrd_with_exitvalue_key (void)
+{
+  if (tss_create (&thrd_with_exitvalue_key, NULL) != thrd_success)
+    abort ();
+}
+
+/* Initializes thrd_with_exitvalue_key.  */
+static void
+init_thrd_with_exitvalue_key (void)
+{
+  static once_flag once = ONCE_FLAG_INIT;
+  call_once (&once, do_init_thrd_with_exitvalue_key);
+}
+
+typedef union
+        {
+          struct thrd_with_exitvalue t;
+          struct
+          {
+            thrd_t tid; /* reserve memory for t.tid */
+            void *(*mainfunc) (void *);
+            void *arg;
+          } a;
+        }
+        main_arg_t;
+
+static int
+thrd_main_func (void *pmarg)
+{
+  /* Unpack the object that combines mainfunc and arg.  */
+  main_arg_t *main_arg = (main_arg_t *) pmarg;
+  void *(*mainfunc) (void *) = main_arg->a.mainfunc;
+  void *arg = main_arg->a.arg;
+
+  if (tss_set (thrd_with_exitvalue_key, &main_arg->t) != thrd_success)
+    abort ();
+
+  /* Execute mainfunc, with arg as argument.  */
+  {
+    void *exitvalue = mainfunc (arg);
+    /* Store the exitvalue, for use by glthread_join().  */
+    main_arg->t.exitvalue = exitvalue;
+    return 0;
+  }
+}
+
+int
+glthread_create (gl_thread_t *threadp, void *(*mainfunc) (void *), void *arg)
+{
+  init_thrd_with_exitvalue_key ();
+  {
+    /* Combine mainfunc and arg in a single object.
+       A stack-allocated object does not work, because it would be out of
+       existence when thrd_create returns before thrd_main_func is
+       entered.  So, allocate it in the heap.  */
+    main_arg_t *main_arg = (main_arg_t *) malloc (sizeof (main_arg_t));
+    if (main_arg == NULL)
+      return ENOMEM;
+    main_arg->a.mainfunc = mainfunc;
+    main_arg->a.arg = arg;
+    switch (thrd_create ((thrd_t *) &main_arg->t.tid, thrd_main_func, main_arg))
+      {
+      case thrd_success:
+        break;
+      case thrd_nomem:
+        free (main_arg);
+        return ENOMEM;
+      default:
+        free (main_arg);
+        return EAGAIN;
+      }
+    *threadp = &main_arg->t;
+    return 0;
+  }
+}
+
+gl_thread_t
+gl_thread_self (void)
+{
+  init_thrd_with_exitvalue_key ();
+  {
+    gl_thread_t thread =
+      (struct thrd_with_exitvalue *) tss_get (thrd_with_exitvalue_key);
+    if (thread == NULL)
+      {
+        /* This happens only in threads that have not been created through
+           glthread_create(), such as the main thread.  */
+        for (;;)
+          {
+            thread =
+              (struct thrd_with_exitvalue *)
+              malloc (sizeof (struct thrd_with_exitvalue));
+            if (thread != NULL)
+              break;
+            /* Memory allocation failed.  There is not much we can do.  Have to
+               busy-loop, waiting for the availability of memory.  */
+            {
+              struct timespec ts;
+              ts.tv_sec = 1;
+              ts.tv_nsec = 0;
+              thrd_sleep (&ts, NULL);
+            }
+          }
+        thread->tid = thrd_current ();
+        thread->exitvalue = NULL; /* just to be deterministic */
+        if (tss_set (thrd_with_exitvalue_key, thread) != thrd_success)
+          abort ();
+      }
+    return thread;
+  }
+}
+
+int
+glthread_join (gl_thread_t thread, void **return_value_ptr)
+{
+  /* On Solaris 11.4, thrd_join crashes when the second argument we pass is
+     NULL.  */
+  int dummy;
+
+  if (thread == gl_thread_self ())
+    return EINVAL;
+  if (thrd_join (thread->tid, &dummy) != thrd_success)
+    return EINVAL;
+  if (return_value_ptr != NULL)
+    *return_value_ptr = thread->exitvalue;
+  free (thread);
+  return 0;
+}
+
+_Noreturn void
+gl_thread_exit (void *return_value)
+{
+  gl_thread_t thread = gl_thread_self ();
+  thread->exitvalue = return_value;
+  thrd_exit (0);
+}
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+#include <pthread.h>
+
+#if defined PTW32_VERSION || defined __MVS__
+
+const gl_thread_t gl_null_thread /* = { .p = NULL } */;
+
+#endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+#endif
+
+/* ========================================================================= */
diff --git a/tests/glthread/thread.h b/tests/glthread/thread.h
new file mode 100644 (file)
index 0000000..b2e858b
--- /dev/null
@@ -0,0 +1,356 @@
+/* Creating and controlling threads.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-win32.h.  */
+
+/* This file contains primitives for creating and controlling threads.
+
+   Thread data type: gl_thread_t.
+
+   Creating a thread:
+       thread = gl_thread_create (func, arg);
+   Or with control of error handling:
+       err = glthread_create (&thread, func, arg);
+       extern int glthread_create (gl_thread_t *result,
+                                   void *(*func) (void *), void *arg);
+
+   Querying and changing the signal mask of a thread (not supported on all
+   platforms):
+       gl_thread_sigmask (how, newmask, oldmask);
+   Or with control of error handling:
+       err = glthread_sigmask (how, newmask, oldmask);
+       extern int glthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask);
+
+   Waiting for termination of another thread:
+       gl_thread_join (thread, &return_value);
+   Or with control of error handling:
+       err = glthread_join (thread, &return_value);
+       extern int glthread_join (gl_thread_t thread, void **return_value_ptr);
+
+   Getting a reference to the current thread:
+       current = gl_thread_self ();
+       extern gl_thread_t gl_thread_self (void);
+
+   Getting a reference to the current thread as a pointer, for debugging:
+       ptr = gl_thread_self_pointer ();
+       extern void * gl_thread_self_pointer (void);
+
+   Terminating the current thread:
+       gl_thread_exit (return_value);
+       extern _Noreturn void gl_thread_exit (void *return_value);
+
+   Requesting custom code to be executed at fork() time (not supported on all
+   platforms):
+       gl_thread_atfork (prepare_func, parent_func, child_func);
+   Or with control of error handling:
+       err = glthread_atfork (prepare_func, parent_func, child_func);
+       extern int glthread_atfork (void (*prepare_func) (void),
+                                   void (*parent_func) (void),
+                                   void (*child_func) (void));
+   Note that even on platforms where this is supported, use of fork() and
+   threads together is problematic, see
+     <https://lists.gnu.org/r/bug-gnulib/2008-08/msg00062.html>
+ */
+
+
+#ifndef _GLTHREAD_THREAD_H
+#define _GLTHREAD_THREAD_H
+
+#include <errno.h>
+#include <stdlib.h>
+
+#if !defined c11_threads_in_use
+# if HAVE_THREADS_H && USE_POSIX_THREADS_WEAK
+#  include <threads.h>
+#  pragma weak thrd_exit
+#  define c11_threads_in_use() (thrd_exit != NULL)
+# else
+#  define c11_threads_in_use() 0
+# endif
+#endif
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GLTHREAD_THREAD_INLINE
+# define _GLTHREAD_THREAD_INLINE _GL_INLINE
+#endif
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS
+
+/* Use the ISO C threads library.  */
+
+# include <threads.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* -------------------------- gl_thread_t datatype -------------------------- */
+
+typedef struct thrd_with_exitvalue *gl_thread_t;
+extern int glthread_create (gl_thread_t *threadp,
+                            void *(*func) (void *), void *arg);
+# define glthread_sigmask(HOW, SET, OSET) \
+    pthread_sigmask (HOW, SET, OSET)
+extern int glthread_join (gl_thread_t thread, void **return_value_ptr);
+extern gl_thread_t gl_thread_self (void);
+# define gl_thread_self_pointer() \
+    (void *) gl_thread_self ()
+extern _Noreturn void gl_thread_exit (void *return_value);
+# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* Use the POSIX threads library.  */
+
+# include <pthread.h>
+
+/* On IRIX, pthread_atfork is declared in <unistd.h>, not in <pthread.h>.  */
+# if defined __sgi
+#  include <unistd.h>
+# endif
+
+# if USE_POSIX_THREADS_WEAK
+/* Compilers other than GCC need to see the declaration of pthread_sigmask
+   before the "#pragma weak pthread_sigmask" below.  */
+#  include <signal.h>
+# endif
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if PTHREAD_IN_USE_DETECTION_HARD
+
+/* The pthread_in_use() detection needs to be done at runtime.  */
+#  define pthread_in_use() \
+     glthread_in_use ()
+extern int glthread_in_use (void);
+
+# endif
+
+# if USE_POSIX_THREADS_WEAK
+
+/* Use weak references to the POSIX threads library.  */
+
+/* Weak references avoid dragging in external libraries if the other parts
+   of the program don't use them.  Here we use them, because we don't want
+   every program that uses libintl to depend on libpthread.  This assumes
+   that libpthread would not be loaded after libintl; i.e. if libintl is
+   loaded first, by an executable that does not depend on libpthread, and
+   then a module is dynamically loaded that depends on libpthread, libintl
+   will not be multithread-safe.  */
+
+/* The way to test at runtime whether libpthread is present is to test
+   whether a function pointer's value, such as &pthread_mutex_init, is
+   non-NULL.  However, some versions of GCC have a bug through which, in
+   PIC mode, &foo != NULL always evaluates to true if there is a direct
+   call to foo(...) in the same function.  To avoid this, we test the
+   address of a function in libpthread that we don't use.  */
+
+#  ifndef pthread_sigmask /* Do not declare rpl_pthread_sigmask weak.  */
+#   pragma weak pthread_sigmask
+#  endif
+
+#  pragma weak pthread_join
+#  ifndef pthread_self
+#   pragma weak pthread_self
+#  endif
+#  pragma weak pthread_exit
+#  if HAVE_PTHREAD_ATFORK
+#   pragma weak pthread_atfork
+#  endif
+
+#  if !PTHREAD_IN_USE_DETECTION_HARD
+#   pragma weak pthread_mutexattr_gettype
+#   define pthread_in_use() \
+      (pthread_mutexattr_gettype != NULL || c11_threads_in_use ())
+#  endif
+
+# else
+
+#  if !PTHREAD_IN_USE_DETECTION_HARD
+#   define pthread_in_use() 1
+#  endif
+
+# endif
+
+/* -------------------------- gl_thread_t datatype -------------------------- */
+
+/* This choice of gl_thread_t assumes that
+     pthread_equal (a, b)  is equivalent to  ((a) == (b)).
+   This is the case on all platforms in use in 2008.  */
+typedef pthread_t gl_thread_t;
+# define glthread_create(THREADP, FUNC, ARG) \
+    (pthread_in_use () ? pthread_create (THREADP, NULL, FUNC, ARG) : ENOSYS)
+# define glthread_sigmask(HOW, SET, OSET) \
+    (pthread_in_use () ? pthread_sigmask (HOW, SET, OSET) : 0)
+# define glthread_join(THREAD, RETVALP) \
+    (pthread_in_use () ? pthread_join (THREAD, RETVALP) : 0)
+# ifdef PTW32_VERSION
+   /* In pthreads-win32, pthread_t is a struct with a pointer field 'p' and
+      other fields.  */
+#  define gl_thread_self() \
+     (pthread_in_use () ? pthread_self () : gl_null_thread)
+#  define gl_thread_self_pointer() \
+     (pthread_in_use () ? pthread_self ().p : NULL)
+extern const gl_thread_t gl_null_thread;
+# elif defined __MVS__
+   /* On IBM z/OS, pthread_t is a struct with an 8-byte '__' field.
+      The first three bytes of this field appear to uniquely identify a
+      pthread_t, though not necessarily representing a pointer.  */
+#  define gl_thread_self() \
+     (pthread_in_use () ? pthread_self () : gl_null_thread)
+#  define gl_thread_self_pointer() \
+     (pthread_in_use () ? *((void **) pthread_self ().__) : NULL)
+extern const gl_thread_t gl_null_thread;
+# else
+#  define gl_thread_self() \
+     (pthread_in_use () ? pthread_self () : (pthread_t) 0)
+#  define gl_thread_self_pointer() \
+     (pthread_in_use () ? (void *) pthread_self () : NULL)
+# endif
+# define gl_thread_exit(RETVAL) \
+    (void) (pthread_in_use () ? (pthread_exit (RETVAL), 0) : 0)
+
+# if HAVE_PTHREAD_ATFORK
+#  define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) \
+     (pthread_in_use () ? pthread_atfork (PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) : 0)
+# else
+#  define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+# include <windows.h>
+
+# include "windows-thread.h"
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+/* -------------------------- gl_thread_t datatype -------------------------- */
+
+typedef glwthread_thread_t gl_thread_t;
+# define glthread_create(THREADP, FUNC, ARG) \
+    glwthread_thread_create (THREADP, 0, FUNC, ARG)
+# define glthread_sigmask(HOW, SET, OSET) \
+    /* unsupported */ 0
+# define glthread_join(THREAD, RETVALP) \
+    glwthread_thread_join (THREAD, RETVALP)
+# define gl_thread_self() \
+    glwthread_thread_self ()
+# define gl_thread_self_pointer() \
+    gl_thread_self ()
+# define gl_thread_exit(RETVAL) \
+    glwthread_thread_exit (RETVAL)
+# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)
+
+/* Provide dummy implementation if threads are not supported.  */
+
+typedef int gl_thread_t;
+# define glthread_create(THREADP, FUNC, ARG) ENOSYS
+# define glthread_sigmask(HOW, SET, OSET) 0
+# define glthread_join(THREAD, RETVALP) 0
+# define gl_thread_self() 0
+# define gl_thread_self_pointer() \
+    ((void *) gl_thread_self ())
+# define gl_thread_exit(RETVAL) (void)0
+# define glthread_atfork(PREPARE_FUNC, PARENT_FUNC, CHILD_FUNC) 0
+
+#endif
+
+/* ========================================================================= */
+
+/* Macros with built-in error handling.  */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_GLTHREAD_THREAD_INLINE gl_thread_t
+gl_thread_create (void *(*func) (void *arg), void *arg)
+{
+  gl_thread_t thread;
+  int ret;
+
+  ret = glthread_create (&thread, func, arg);
+  if (ret != 0)
+    abort ();
+  return thread;
+}
+#define gl_thread_sigmask(HOW, SET, OSET)     \
+   do                                         \
+     {                                        \
+       if (glthread_sigmask (HOW, SET, OSET)) \
+         abort ();                            \
+     }                                        \
+   while (0)
+#define gl_thread_join(THREAD, RETVAL)     \
+   do                                      \
+     {                                     \
+       if (glthread_join (THREAD, RETVAL)) \
+         abort ();                         \
+     }                                     \
+   while (0)
+#define gl_thread_atfork(PREPARE, PARENT, CHILD)     \
+   do                                                \
+     {                                               \
+       if (glthread_atfork (PREPARE, PARENT, CHILD)) \
+         abort ();                                   \
+     }                                               \
+   while (0)
+
+#ifdef __cplusplus
+}
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _GLTHREAD_THREAD_H */
diff --git a/tests/glthread/yield.h b/tests/glthread/yield.h
new file mode 100644 (file)
index 0000000..bde0782
--- /dev/null
@@ -0,0 +1,100 @@
+/* Yielding the processor to other threads and processes.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* This file contains a primitive for yielding the processor to other threads.
+     extern void gl_thread_yield (void);
+ */
+
+#ifndef _GLTHREAD_YIELD_H
+#define _GLTHREAD_YIELD_H
+
+#include <errno.h>
+
+/* ========================================================================= */
+
+#if USE_ISOC_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+/* Use the ISO C threads library.  */
+
+# include <threads.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# define gl_thread_yield() \
+    thrd_yield ()
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_POSIX_THREADS
+
+/* Use the POSIX threads library.  */
+
+# include <sched.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# define gl_thread_yield() \
+    sched_yield ()
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if USE_WINDOWS_THREADS
+
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+# include <windows.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# define gl_thread_yield() \
+    Sleep (0)
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+/* ========================================================================= */
+
+#if !(USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS)
+
+/* Provide dummy implementation if threads are not supported.  */
+
+# define gl_thread_yield() 0
+
+#endif
+
+/* ========================================================================= */
+
+#endif /* _GLTHREAD_YIELD_H */
index 08d7be9..2c99ba9 100644 (file)
@@ -1,6 +1,6 @@
 ## DO NOT EDIT! GENERATED AUTOMATICALLY!
 ## Process this file with automake to produce Makefile.in.
-# Copyright (C) 2002-2016 Free Software Foundation, Inc.
+# Copyright (C) 2002-2021 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this file.  If not, see <http://www.gnu.org/licenses/>.
+# along with this file.  If not, see <https://www.gnu.org/licenses/>.
 #
 # As a special exception to the GNU General Public License,
 # this file may be distributed as part of a program that
@@ -22,7 +22,7 @@
 #
 # Generated by gnulib-tool.
 
-AUTOMAKE_OPTIONS = 1.9.6 foreign
+AUTOMAKE_OPTIONS = 1.11 foreign subdir-objects
 
 SUBDIRS = .
 TESTS =
@@ -30,6 +30,7 @@ XFAIL_TESTS =
 TESTS_ENVIRONMENT =
 noinst_PROGRAMS =
 check_PROGRAMS =
+EXTRA_PROGRAMS =
 noinst_HEADERS =
 noinst_LIBRARIES =
 check_LIBRARIES = libtests.a
@@ -48,7 +49,7 @@ AM_CPPFLAGS = \
   -I.. -I$(srcdir)/.. \
   -I../lib -I$(srcdir)/../lib
 
-LDADD = libtests.a ../lib/libm4.a libtests.a $(LIBTESTS_LIBDEPS)
+LDADD = libtests.a ../lib/libm4.a libtests.a ../lib/libm4.a libtests.a $(LIBTESTS_LIBDEPS)
 
 libtests_a_SOURCES =
 libtests_a_LIBADD = $(M4tests_LIBOBJS)
@@ -58,6 +59,32 @@ AM_LIBTOOLFLAGS = --preserve-dup-deps
 
 TESTS_ENVIRONMENT += EXEEXT='@EXEEXT@' srcdir='$(srcdir)'
 
+## begin gnulib module accept
+
+
+EXTRA_DIST += accept.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += accept.c
+
+## end   gnulib module accept
+
+## begin gnulib module accept-tests
+
+TESTS += test-accept
+check_PROGRAMS += test-accept
+test_accept_LDADD = $(LDADD) @LIBSOCKET@
+EXTRA_DIST += test-accept.c signature.h macros.h
+
+## end   gnulib module accept-tests
+
+## begin gnulib module access-tests
+
+TESTS += test-access
+check_PROGRAMS += test-access
+EXTRA_DIST += test-access.c signature.h macros.h
+
+## end   gnulib module access-tests
+
 ## begin gnulib module alignof-tests
 
 TESTS += test-alignof
@@ -67,6 +94,17 @@ EXTRA_DIST += test-alignof.c
 
 ## end   gnulib module alignof-tests
 
+## begin gnulib module alloca
+
+
+libtests_a_LIBADD += @ALLOCA@
+libtests_a_DEPENDENCIES += @ALLOCA@
+EXTRA_DIST += alloca.c
+
+EXTRA_libtests_a_SOURCES += alloca.c
+
+## end   gnulib module alloca
+
 ## begin gnulib module alloca-opt-tests
 
 TESTS += test-alloca-opt
@@ -76,6 +114,63 @@ EXTRA_DIST += test-alloca-opt.c
 
 ## end   gnulib module alloca-opt-tests
 
+## begin gnulib module arpa_inet
+
+BUILT_SOURCES += arpa/inet.h
+
+# We need the following in order to create <arpa/inet.h> when the system
+# doesn't have one.
+arpa/inet.h: arpa_inet.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) arpa
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''HAVE_FEATURES_H''@|$(HAVE_FEATURES_H)|g' \
+             -e 's|@''NEXT_ARPA_INET_H''@|$(NEXT_ARPA_INET_H)|g' \
+             -e 's|@''HAVE_ARPA_INET_H''@|$(HAVE_ARPA_INET_H)|g' \
+             -e 's/@''GNULIB_INET_NTOP''@/$(GL_M4_GNULIB_INET_NTOP)/g' \
+             -e 's/@''GNULIB_INET_PTON''@/$(GL_M4_GNULIB_INET_PTON)/g' \
+             -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+             -e 's|@''HAVE_DECL_INET_NTOP''@|$(HAVE_DECL_INET_NTOP)|g' \
+             -e 's|@''HAVE_DECL_INET_PTON''@|$(HAVE_DECL_INET_PTON)|g' \
+             -e 's|@''REPLACE_INET_NTOP''@|$(REPLACE_INET_NTOP)|g' \
+             -e 's|@''REPLACE_INET_PTON''@|$(REPLACE_INET_PTON)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/arpa_inet.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += arpa/inet.h arpa/inet.h-t
+MOSTLYCLEANDIRS += arpa
+
+EXTRA_DIST += arpa_inet.in.h
+
+## end   gnulib module arpa_inet
+
+## begin gnulib module arpa_inet-c++-tests
+
+if ANSICXX
+TESTS += test-arpa_inet-c++
+check_PROGRAMS += test-arpa_inet-c++
+test_arpa_inet_c___SOURCES = test-arpa_inet-c++.cc
+test_arpa_inet_c___LDADD = $(LDADD) $(INET_NTOP_LIB) $(INET_PTON_LIB) $(LIBSOCKET)
+endif
+EXTRA_DIST += test-arpa_inet-c++.cc signature.h
+
+## end   gnulib module arpa_inet-c++-tests
+
+## begin gnulib module arpa_inet-tests
+
+TESTS += test-arpa_inet
+check_PROGRAMS += test-arpa_inet
+EXTRA_DIST += test-arpa_inet.c
+
+## end   gnulib module arpa_inet-tests
+
 ## begin gnulib module array-list
 
 libtests_a_SOURCES += gl_array_list.h gl_array_list.c
@@ -103,15 +198,24 @@ TESTS += test-array_oset
 check_PROGRAMS += test-array_oset
 test_array_oset_LDADD = $(LDADD) @LIBINTL@
 
-EXTRA_DIST += test-array_oset.c macros.h
+EXTRA_DIST += test-array_oset.c test-oset-update.h macros.h
 
 ## end   gnulib module array-oset-tests
 
+## begin gnulib module asyncsafe-spin-tests
+
+TESTS += test-asyncsafe-spin1 test-asyncsafe-spin2
+check_PROGRAMS += test-asyncsafe-spin1 test-asyncsafe-spin2
+test_asyncsafe_spin2_LDADD = $(LDADD) @LIBMULTITHREAD@ @YIELD_LIB@ @LIB_SEMAPHORE@
+EXTRA_DIST += test-asyncsafe-spin1.c test-asyncsafe-spin2.c atomic-int-gnulib.h
+
+## end   gnulib module asyncsafe-spin-tests
+
 ## begin gnulib module avltree-oset-tests
 
 TESTS += test-avltree_oset
 check_PROGRAMS += test-avltree_oset
-EXTRA_DIST += test-avltree_oset.c macros.h
+EXTRA_DIST += test-avltree_oset.c test-oset-update.h macros.h
 
 ## end   gnulib module avltree-oset-tests
 
@@ -124,12 +228,38 @@ EXTRA_DIST += test-binary-io.sh test-binary-io.c macros.h
 
 ## end   gnulib module binary-io-tests
 
+## begin gnulib module bind
+
+
+EXTRA_DIST += bind.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += bind.c
+
+## end   gnulib module bind
+
+## begin gnulib module bind-tests
+
+TESTS += test-bind
+check_PROGRAMS += test-bind
+test_bind_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB)
+EXTRA_DIST += test-bind.c signature.h macros.h
+
+## end   gnulib module bind-tests
+
+## begin gnulib module bitrotate-tests
+
+TESTS += test-bitrotate
+check_PROGRAMS += test-bitrotate
+EXTRA_DIST += test-bitrotate.c macros.h
+
+## end   gnulib module bitrotate-tests
+
 ## begin gnulib module btowc-tests
 
 TESTS += test-btowc1.sh test-btowc2.sh
 TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
 check_PROGRAMS += test-btowc
-
+test_btowc_LDADD = $(LDADD) $(LIB_SETLOCALE)
 EXTRA_DIST += test-btowc1.sh test-btowc2.sh test-btowc.c signature.h macros.h
 
 ## end   gnulib module btowc-tests
@@ -138,6 +268,7 @@ EXTRA_DIST += test-btowc1.sh test-btowc2.sh test-btowc.c signature.h macros.h
 
 TESTS += test-c-ctype
 check_PROGRAMS += test-c-ctype
+test_c_ctype_LDADD = $(LDADD) $(LIB_SETLOCALE)
 EXTRA_DIST += test-c-ctype.c macros.h
 
 ## end   gnulib module c-ctype-tests
@@ -158,18 +289,38 @@ EXTRA_DIST += test-c-stack.c test-c-stack.sh test-c-stack2.sh macros.h
 TESTS += test-c-strcase.sh
 TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_TR_UTF8='@LOCALE_TR_UTF8@'
 check_PROGRAMS += test-c-strcasecmp test-c-strncasecmp
+test_c_strcasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE)
+test_c_strncasecmp_LDADD = $(LDADD) $(LIB_SETLOCALE)
 EXTRA_DIST += test-c-strcase.sh test-c-strcasecmp.c test-c-strncasecmp.c macros.h
 
 ## end   gnulib module c-strcase-tests
 
+## begin gnulib module calloc-gnu-tests
+
+TESTS += test-calloc-gnu
+check_PROGRAMS += test-calloc-gnu
+EXTRA_DIST += test-calloc-gnu.c macros.h
+
+## end   gnulib module calloc-gnu-tests
+
 ## begin gnulib module canonicalize-lgpl-tests
 
 TESTS += test-canonicalize-lgpl
 check_PROGRAMS += test-canonicalize-lgpl
-EXTRA_DIST += test-canonicalize-lgpl.c signature.h macros.h
+test_canonicalize_lgpl_LDADD = $(LDADD) $(LIBINTL)
+EXTRA_DIST += test-canonicalize-lgpl.c signature.h null-ptr.h macros.h
 
 ## end   gnulib module canonicalize-lgpl-tests
 
+## begin gnulib module canonicalize-tests
+
+TESTS += test-canonicalize
+check_PROGRAMS += test-canonicalize
+test_canonicalize_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-canonicalize.c null-ptr.h macros.h
+
+## end   gnulib module canonicalize-tests
+
 ## begin gnulib module chdir-tests
 
 TESTS += test-chdir
@@ -194,24 +345,50 @@ EXTRA_DIST += test-close.c signature.h macros.h
 
 ## end   gnulib module close-tests
 
-## begin gnulib module closedir
-
-
-EXTRA_DIST += closedir.c dirent-private.h
-
-EXTRA_libtests_a_SOURCES += closedir.c
-
-## end   gnulib module closedir
-
 ## begin gnulib module closein-tests
 
 TESTS += test-closein.sh
 check_PROGRAMS += test-closein
-test_closein_LDADD = $(LDADD) @LIBINTL@
+test_closein_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
 EXTRA_DIST += test-closein.sh test-closein.c
 
 ## end   gnulib module closein-tests
 
+## begin gnulib module connect
+
+
+EXTRA_DIST += connect.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += connect.c
+
+## end   gnulib module connect
+
+## begin gnulib module connect-tests
+
+TESTS += test-connect
+check_PROGRAMS += test-connect
+test_connect_LDADD = $(LDADD) @LIBSOCKET@ $(INET_PTON_LIB)
+EXTRA_DIST += test-connect.c signature.h macros.h
+
+## end   gnulib module connect-tests
+
+## begin gnulib module creat
+
+
+EXTRA_DIST += creat.c
+
+EXTRA_libtests_a_SOURCES += creat.c
+
+## end   gnulib module creat
+
+## begin gnulib module creat-tests
+
+TESTS += test-creat
+check_PROGRAMS += test-creat
+EXTRA_DIST += test-creat.c signature.h macros.h
+
+## end   gnulib module creat-tests
+
 ## begin gnulib module ctype
 
 BUILT_SOURCES += ctype.h
@@ -226,7 +403,7 @@ ctype.h: ctype.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
              -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
              -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
              -e 's|@''NEXT_CTYPE_H''@|$(NEXT_CTYPE_H)|g' \
-             -e 's/@''GNULIB_ISBLANK''@/$(GNULIB_ISBLANK)/g' \
+             -e 's/@''GNULIB_ISBLANK''@/$(GL_M4_GNULIB_ISBLANK)/g' \
              -e 's/@''HAVE_ISBLANK''@/$(HAVE_ISBLANK)/g' \
              -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
              -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
@@ -239,6 +416,17 @@ EXTRA_DIST += ctype.in.h
 
 ## end   gnulib module ctype
 
+## begin gnulib module ctype-c++-tests
+
+if ANSICXX
+TESTS += test-ctype-c++
+check_PROGRAMS += test-ctype-c++
+test_ctype_c___SOURCES = test-ctype-c++.cc test-ctype-c++2.cc
+endif
+EXTRA_DIST += test-ctype-c++.cc test-ctype-c++2.cc signature.h
+
+## end   gnulib module ctype-c++-tests
+
 ## begin gnulib module ctype-tests
 
 TESTS += test-ctype
@@ -247,54 +435,6 @@ EXTRA_DIST += test-ctype.c
 
 ## end   gnulib module ctype-tests
 
-## begin gnulib module dirent
-
-BUILT_SOURCES += dirent.h
-
-# We need the following in order to create <dirent.h> when the system
-# doesn't have one that works with the given compiler.
-dirent.h: dirent.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
-             -e 's|@''HAVE_DIRENT_H''@|$(HAVE_DIRENT_H)|g' \
-             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-             -e 's|@''NEXT_DIRENT_H''@|$(NEXT_DIRENT_H)|g' \
-             -e 's/@''GNULIB_OPENDIR''@/$(GNULIB_OPENDIR)/g' \
-             -e 's/@''GNULIB_READDIR''@/$(GNULIB_READDIR)/g' \
-             -e 's/@''GNULIB_REWINDDIR''@/$(GNULIB_REWINDDIR)/g' \
-             -e 's/@''GNULIB_CLOSEDIR''@/$(GNULIB_CLOSEDIR)/g' \
-             -e 's/@''GNULIB_DIRFD''@/$(GNULIB_DIRFD)/g' \
-             -e 's/@''GNULIB_FDOPENDIR''@/$(GNULIB_FDOPENDIR)/g' \
-             -e 's/@''GNULIB_SCANDIR''@/$(GNULIB_SCANDIR)/g' \
-             -e 's/@''GNULIB_ALPHASORT''@/$(GNULIB_ALPHASORT)/g' \
-             -e 's/@''HAVE_OPENDIR''@/$(HAVE_OPENDIR)/g' \
-             -e 's/@''HAVE_READDIR''@/$(HAVE_READDIR)/g' \
-             -e 's/@''HAVE_REWINDDIR''@/$(HAVE_REWINDDIR)/g' \
-             -e 's/@''HAVE_CLOSEDIR''@/$(HAVE_CLOSEDIR)/g' \
-             -e 's|@''HAVE_DECL_DIRFD''@|$(HAVE_DECL_DIRFD)|g' \
-             -e 's|@''HAVE_DECL_FDOPENDIR''@|$(HAVE_DECL_FDOPENDIR)|g' \
-             -e 's|@''HAVE_FDOPENDIR''@|$(HAVE_FDOPENDIR)|g' \
-             -e 's|@''HAVE_SCANDIR''@|$(HAVE_SCANDIR)|g' \
-             -e 's|@''HAVE_ALPHASORT''@|$(HAVE_ALPHASORT)|g' \
-             -e 's|@''REPLACE_OPENDIR''@|$(REPLACE_OPENDIR)|g' \
-             -e 's|@''REPLACE_CLOSEDIR''@|$(REPLACE_CLOSEDIR)|g' \
-             -e 's|@''REPLACE_DIRFD''@|$(REPLACE_DIRFD)|g' \
-             -e 's|@''REPLACE_FDOPENDIR''@|$(REPLACE_FDOPENDIR)|g' \
-             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/dirent.in.h; \
-       } > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += dirent.h dirent.h-t
-
-EXTRA_DIST += dirent.in.h
-
-## end   gnulib module dirent
-
 ## begin gnulib module dirent-c++-tests
 
 if ANSICXX
@@ -315,15 +455,6 @@ EXTRA_DIST += test-dirent.c
 
 ## end   gnulib module dirent-tests
 
-## begin gnulib module dirfd
-
-
-EXTRA_DIST += dirfd.c
-
-EXTRA_libtests_a_SOURCES += dirfd.c
-
-## end   gnulib module dirfd
-
 ## begin gnulib module dirname-tests
 
 TESTS += test-dirname
@@ -333,15 +464,6 @@ EXTRA_DIST += test-dirname.c
 
 ## end   gnulib module dirname-tests
 
-## begin gnulib module dup
-
-
-EXTRA_DIST += dup.c
-
-EXTRA_libtests_a_SOURCES += dup.c
-
-## end   gnulib module dup
-
 ## begin gnulib module dup-tests
 
 TESTS += test-dup
@@ -358,6 +480,14 @@ EXTRA_DIST += test-dup2.c signature.h macros.h
 
 ## end   gnulib module dup2-tests
 
+## begin gnulib module dynarray-tests
+
+TESTS += test-dynarray
+check_PROGRAMS += test-dynarray
+EXTRA_DIST += test-dynarray.c macros.h
+
+## end   gnulib module dynarray-tests
+
 ## begin gnulib module environ-tests
 
 TESTS += test-environ
@@ -367,6 +497,17 @@ EXTRA_DIST += test-environ.c
 
 ## end   gnulib module environ-tests
 
+## begin gnulib module errno-c++-tests
+
+if ANSICXX
+TESTS += test-errno-c++
+check_PROGRAMS += test-errno-c++
+test_errno_c___SOURCES = test-errno-c++.cc test-errno-c++2.cc
+endif
+EXTRA_DIST += test-errno-c++.cc test-errno-c++2.cc
+
+## end   gnulib module errno-c++-tests
+
 ## begin gnulib module errno-tests
 
 TESTS += test-errno
@@ -376,6 +517,50 @@ EXTRA_DIST += test-errno.c
 
 ## end   gnulib module errno-tests
 
+## begin gnulib module execute-tests
+
+TESTS += test-execute.sh
+check_PROGRAMS += test-execute-main test-execute-child
+test_execute_main_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+# The test-execute-child program must be a real executable, not a libtool
+# wrapper script, and should link against as few libraries as possible.
+# Therefore don't link it against any libraries other than -lc.
+test_execute_child_LDADD =
+
+TESTS += test-execute-script
+check_PROGRAMS += test-execute-script
+test_execute_script_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_execute_script_CPPFLAGS = $(AM_CPPFLAGS) -DSRCDIR=\"$(srcdir)/\"
+EXTRA_DIST += test-execute.sh test-execute-main.c test-execute-child.c test-execute-script.c executable-script executable-script.sh executable-shell-script macros.h
+
+## end   gnulib module execute-tests
+
+## begin gnulib module explicit_bzero
+
+
+EXTRA_DIST += explicit_bzero.c
+
+EXTRA_libtests_a_SOURCES += explicit_bzero.c
+
+## end   gnulib module explicit_bzero
+
+## begin gnulib module explicit_bzero-tests
+
+TESTS += test-explicit_bzero
+check_PROGRAMS += test-explicit_bzero
+EXTRA_DIST += test-explicit_bzero.c signature.h macros.h
+
+## end   gnulib module explicit_bzero-tests
+
+## begin gnulib module fchdir-tests
+
+TESTS += test-fchdir
+check_PROGRAMS += test-fchdir
+test_fchdir_LDADD = $(LDADD) $(LIBINTL)
+EXTRA_DIST += test-fchdir.c signature.h macros.h
+
+## end   gnulib module fchdir-tests
+
 ## begin gnulib module fclose-tests
 
 TESTS += test-fclose
@@ -429,6 +614,15 @@ EXTRA_DIST += test-fdopen.c signature.h macros.h
 
 ## end   gnulib module fdopen-tests
 
+## begin gnulib module fdopendir-tests
+
+TESTS += test-fdopendir
+check_PROGRAMS += test-fdopendir
+test_fdopendir_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-fdopendir.c signature.h macros.h
+
+## end   gnulib module fdopendir-tests
+
 ## begin gnulib module fflush-tests
 
 TESTS += test-fflush test-fflush2.sh
@@ -446,13 +640,6 @@ EXTRA_DIST += test-fgetc.c signature.h macros.h
 
 ## end   gnulib module fgetc-tests
 
-## begin gnulib module filename
-
-
-EXTRA_DIST += filename.h
-
-## end   gnulib module filename
-
 ## begin gnulib module filenamecat-tests
 
 TESTS += test-filenamecat
@@ -462,12 +649,22 @@ EXTRA_DIST += test-filenamecat.c
 
 ## end   gnulib module filenamecat-tests
 
-## begin gnulib module flexmember
+## begin gnulib module findprog
 
+libtests_a_SOURCES += findprog.h findprog.c
 
-EXTRA_DIST += flexmember.h
+## end   gnulib module findprog
 
-## end   gnulib module flexmember
+## begin gnulib module float-c++-tests
+
+if ANSICXX
+TESTS += test-float-c++
+check_PROGRAMS += test-float-c++
+test_float_c___SOURCES = test-float-c++.cc test-float-c++2.cc
+endif
+EXTRA_DIST += test-float-c++.cc test-float-c++2.cc
+
+## end   gnulib module float-c++-tests
 
 ## begin gnulib module float-tests
 
@@ -477,6 +674,14 @@ EXTRA_DIST += test-float.c macros.h
 
 ## end   gnulib module float-tests
 
+## begin gnulib module fopen-gnu-tests
+
+TESTS += test-fopen-gnu
+check_PROGRAMS += test-fopen-gnu
+EXTRA_DIST += test-fopen-gnu.c macros.h
+
+## end   gnulib module fopen-gnu-tests
+
 ## begin gnulib module fopen-safer-tests
 
 TESTS += test-fopen-safer
@@ -545,6 +750,32 @@ EXTRA_DIST += test-freading.c macros.h
 
 ## end   gnulib module freading-tests
 
+## begin gnulib module free-posix-tests
+
+TESTS += test-free
+check_PROGRAMS += test-free
+EXTRA_DIST += test-free.c macros.h
+
+## end   gnulib module free-posix-tests
+
+## begin gnulib module freopen
+
+
+EXTRA_DIST += freopen.c
+
+EXTRA_libtests_a_SOURCES += freopen.c
+
+## end   gnulib module freopen
+
+## begin gnulib module freopen-tests
+
+TESTS += test-freopen
+check_PROGRAMS += test-freopen
+
+EXTRA_DIST += test-freopen.c signature.h macros.h
+
+## end   gnulib module freopen-tests
+
 ## begin gnulib module frexp-nolibm-tests
 
 TESTS += test-frexp-nolibm
@@ -587,6 +818,15 @@ EXTRA_DIST += test-fstat.c signature.h macros.h
 
 ## end   gnulib module fstat-tests
 
+## begin gnulib module fstatat-tests
+
+TESTS += test-fstatat
+check_PROGRAMS += test-fstatat
+test_fstatat_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-fstatat.c test-lstat.h test-stat.h signature.h macros.h
+
+## end   gnulib module fstatat-tests
+
 ## begin gnulib module ftell-tests
 
 TESTS += test-ftell.sh test-ftell2.sh test-ftell3
@@ -605,22 +845,30 @@ EXTRA_DIST += test-ftello.c test-ftello.sh test-ftello2.sh test-ftello3.c test-f
 
 ## end   gnulib module ftello-tests
 
-## begin gnulib module fwrite-tests
+## begin gnulib module ftruncate
 
-TESTS += test-fwrite
-check_PROGRAMS += test-fwrite
-EXTRA_DIST += test-fwrite.c signature.h macros.h
 
-## end   gnulib module fwrite-tests
+EXTRA_DIST += ftruncate.c
 
-## begin gnulib module getcwd-lgpl
+EXTRA_libtests_a_SOURCES += ftruncate.c
 
+## end   gnulib module ftruncate
 
-EXTRA_DIST += getcwd-lgpl.c
+## begin gnulib module ftruncate-tests
 
-EXTRA_libtests_a_SOURCES += getcwd-lgpl.c
+TESTS += test-ftruncate.sh
+check_PROGRAMS += test-ftruncate
+EXTRA_DIST += test-ftruncate.c test-ftruncate.sh signature.h macros.h
+
+## end   gnulib module ftruncate-tests
+
+## begin gnulib module fwrite-tests
+
+TESTS += test-fwrite
+check_PROGRAMS += test-fwrite
+EXTRA_DIST += test-fwrite.c signature.h macros.h
 
-## end   gnulib module getcwd-lgpl
+## end   gnulib module fwrite-tests
 
 ## begin gnulib module getcwd-lgpl-tests
 
@@ -631,6 +879,15 @@ EXTRA_DIST += test-getcwd-lgpl.c signature.h macros.h
 
 ## end   gnulib module getcwd-lgpl-tests
 
+## begin gnulib module getcwd-tests
+
+TESTS += test-getcwd.sh
+check_PROGRAMS += test-getcwd
+test_getcwd_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-getcwd.c test-getcwd.sh
+
+## end   gnulib module getcwd-tests
+
 ## begin gnulib module getdtablesize-tests
 
 TESTS += test-getdtablesize
@@ -648,33 +905,33 @@ EXTRA_DIST += macros.h signature.h test-getopt-gnu.c test-getopt-main.h test-get
 
 ## end   gnulib module getopt-gnu-tests
 
-## begin gnulib module getopt-posix-tests
+## begin gnulib module getprogname-tests
 
-TESTS += test-getopt-posix
-check_PROGRAMS += test-getopt-posix
-test_getopt_posix_LDADD = $(LDADD) $(LIBINTL)
-EXTRA_DIST += macros.h signature.h test-getopt-posix.c test-getopt-main.h test-getopt.h
+DEFS += -DEXEEXT=\"@EXEEXT@\"
+TESTS += test-getprogname
+check_PROGRAMS += test-getprogname
+test_getprogname_LDADD = $(LDADD)
+EXTRA_DIST += test-getprogname.c
 
-## end   gnulib module getopt-posix-tests
+## end   gnulib module getprogname-tests
 
-## begin gnulib module getpagesize
+## begin gnulib module getrandom-tests
 
+TESTS += test-getrandom
+check_PROGRAMS += test-getrandom
+test_getrandom_LDADD = $(LDADD) @LIB_GETRANDOM@
+EXTRA_DIST += test-getrandom.c signature.h macros.h
 
-EXTRA_DIST += getpagesize.c
+## end   gnulib module getrandom-tests
 
-EXTRA_libtests_a_SOURCES += getpagesize.c
+## begin gnulib module gettimeofday
 
-## end   gnulib module getpagesize
 
-## begin gnulib module getprogname-tests
+EXTRA_DIST += gettimeofday.c
 
-DEFS += -DEXEEXT=\"@EXEEXT@\"
-TESTS += test-getprogname
-check_PROGRAMS += test-getprogname
-test_getprogname_LDADD = $(LDADD)
-EXTRA_DIST += test-getprogname.c
+EXTRA_libtests_a_SOURCES += gettimeofday.c
 
-## end   gnulib module getprogname-tests
+## end   gnulib module gettimeofday
 
 ## begin gnulib module gettimeofday-tests
 
@@ -685,6 +942,66 @@ EXTRA_DIST += signature.h test-gettimeofday.c
 
 ## end   gnulib module gettimeofday-tests
 
+## begin gnulib module gperf
+
+GPERF = gperf
+V_GPERF = $(V_GPERF_@AM_V@)
+V_GPERF_ = $(V_GPERF_@AM_DEFAULT_V@)
+V_GPERF_0 = @echo "  GPERF   " $@;
+
+## end   gnulib module gperf
+
+## begin gnulib module hard-locale-tests
+
+TESTS += test-hard-locale
+check_PROGRAMS += test-hard-locale
+test_hard_locale_LDADD = $(LDADD) $(LIB_SETLOCALE) @LIB_HARD_LOCALE@
+# We cannot call this program 'locale', because the C++ compiler on Mac OS X
+# would then barf upon '#include <locale>'. So, call it 'current-locale'.
+noinst_PROGRAMS += current-locale
+current_locale_SOURCES = locale.c
+EXTRA_DIST += test-hard-locale.c locale.c
+
+## end   gnulib module hard-locale-tests
+
+## begin gnulib module hash-tests
+
+TESTS += test-hash
+check_PROGRAMS += test-hash
+EXTRA_DIST += test-hash.c macros.h
+
+## end   gnulib module hash-tests
+
+## begin gnulib module iconv-h-c++-tests
+
+if ANSICXX
+TESTS += test-iconv-h-c++
+check_PROGRAMS += test-iconv-h-c++
+test_iconv_h_c___SOURCES = test-iconv-h-c++.cc
+test_iconv_h_c___LDADD = $(LDADD) $(LIBINTL) $(LIBICONV) $(LIB_NANOSLEEP)
+endif
+EXTRA_DIST += test-iconv-h-c++.cc signature.h
+
+## end   gnulib module iconv-h-c++-tests
+
+## begin gnulib module iconv-h-tests
+
+TESTS += test-iconv-h
+check_PROGRAMS += test-iconv-h
+EXTRA_DIST += test-iconv-h.c
+
+## end   gnulib module iconv-h-tests
+
+## begin gnulib module iconv-tests
+
+TESTS += test-iconv
+check_PROGRAMS += test-iconv
+test_iconv_LDADD = $(LDADD) @LIBICONV@
+
+EXTRA_DIST += test-iconv.c signature.h macros.h
+
+## end   gnulib module iconv-tests
+
 ## begin gnulib module ignore-value-tests
 
 TESTS += test-ignore-value
@@ -693,6 +1010,24 @@ EXTRA_DIST += test-ignore-value.c
 
 ## end   gnulib module ignore-value-tests
 
+## begin gnulib module inet_pton
+
+
+EXTRA_DIST += inet_pton.c
+
+EXTRA_libtests_a_SOURCES += inet_pton.c
+
+## end   gnulib module inet_pton
+
+## begin gnulib module inet_pton-tests
+
+TESTS += test-inet_pton
+check_PROGRAMS += test-inet_pton
+test_inet_pton_LDADD = $(LDADD) @INET_PTON_LIB@
+EXTRA_DIST += test-inet_pton.c signature.h macros.h
+
+## end   gnulib module inet_pton-tests
+
 ## begin gnulib module intprops-tests
 
 TESTS += test-intprops
@@ -701,50 +1036,34 @@ EXTRA_DIST += test-intprops.c macros.h
 
 ## end   gnulib module intprops-tests
 
-## begin gnulib module inttypes-incomplete
+## begin gnulib module inttostr
 
-BUILT_SOURCES += inttypes.h
+libtests_a_SOURCES +=    imaxtostr.c    inttostr.c    offtostr.c    uinttostr.c    umaxtostr.c
 
-# We need the following in order to create <inttypes.h> when the system
-# doesn't have one that works with the given compiler.
-inttypes.h: inttypes.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         sed -e 's/@''HAVE_INTTYPES_H''@/$(HAVE_INTTYPES_H)/g' \
-             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
-             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
-             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
-             -e 's|@''NEXT_INTTYPES_H''@|$(NEXT_INTTYPES_H)|g' \
-             -e 's/@''PRI_MACROS_BROKEN''@/$(PRI_MACROS_BROKEN)/g' \
-             -e 's/@''APPLE_UNIVERSAL_BUILD''@/$(APPLE_UNIVERSAL_BUILD)/g' \
-             -e 's/@''HAVE_LONG_LONG_INT''@/$(HAVE_LONG_LONG_INT)/g' \
-             -e 's/@''HAVE_UNSIGNED_LONG_LONG_INT''@/$(HAVE_UNSIGNED_LONG_LONG_INT)/g' \
-             -e 's/@''PRIPTR_PREFIX''@/$(PRIPTR_PREFIX)/g' \
-             -e 's/@''GNULIB_IMAXABS''@/$(GNULIB_IMAXABS)/g' \
-             -e 's/@''GNULIB_IMAXDIV''@/$(GNULIB_IMAXDIV)/g' \
-             -e 's/@''GNULIB_STRTOIMAX''@/$(GNULIB_STRTOIMAX)/g' \
-             -e 's/@''GNULIB_STRTOUMAX''@/$(GNULIB_STRTOUMAX)/g' \
-             -e 's/@''HAVE_DECL_IMAXABS''@/$(HAVE_DECL_IMAXABS)/g' \
-             -e 's/@''HAVE_DECL_IMAXDIV''@/$(HAVE_DECL_IMAXDIV)/g' \
-             -e 's/@''HAVE_DECL_STRTOIMAX''@/$(HAVE_DECL_STRTOIMAX)/g' \
-             -e 's/@''HAVE_DECL_STRTOUMAX''@/$(HAVE_DECL_STRTOUMAX)/g' \
-             -e 's/@''REPLACE_STRTOIMAX''@/$(REPLACE_STRTOIMAX)/g' \
-             -e 's/@''REPLACE_STRTOUMAX''@/$(REPLACE_STRTOUMAX)/g' \
-             -e 's/@''INT32_MAX_LT_INTMAX_MAX''@/$(INT32_MAX_LT_INTMAX_MAX)/g' \
-             -e 's/@''INT64_MAX_EQ_LONG_MAX''@/$(INT64_MAX_EQ_LONG_MAX)/g' \
-             -e 's/@''UINT32_MAX_LT_UINTMAX_MAX''@/$(UINT32_MAX_LT_UINTMAX_MAX)/g' \
-             -e 's/@''UINT64_MAX_EQ_ULONG_MAX''@/$(UINT64_MAX_EQ_ULONG_MAX)/g' \
-             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
-             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
-             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
-             < $(srcdir)/inttypes.in.h; \
-       } > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += inttypes.h inttypes.h-t
+EXTRA_DIST += anytostr.c inttostr.h
+
+EXTRA_libtests_a_SOURCES += anytostr.c
+
+## end   gnulib module inttostr
+
+## begin gnulib module inttostr-tests
+
+TESTS += test-inttostr
+check_PROGRAMS += test-inttostr
+EXTRA_DIST += macros.h test-inttostr.c
 
-EXTRA_DIST += inttypes.in.h
+## end   gnulib module inttostr-tests
 
-## end   gnulib module inttypes-incomplete
+## begin gnulib module inttypes-c++-tests
+
+if ANSICXX
+TESTS += test-inttypes-c++
+check_PROGRAMS += test-inttypes-c++
+test_inttypes_c___SOURCES = test-inttypes-c++.cc test-inttypes-c++2.cc
+endif
+EXTRA_DIST += test-inttypes-c++.cc test-inttypes-c++2.cc signature.h
+
+## end   gnulib module inttypes-c++-tests
 
 ## begin gnulib module inttypes-tests
 
@@ -754,6 +1073,23 @@ EXTRA_DIST += test-inttypes.c
 
 ## end   gnulib module inttypes-tests
 
+## begin gnulib module ioctl
+
+
+EXTRA_DIST += ioctl.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += ioctl.c
+
+## end   gnulib module ioctl
+
+## begin gnulib module ioctl-tests
+
+TESTS += test-ioctl
+check_PROGRAMS += test-ioctl
+EXTRA_DIST += test-ioctl.c signature.h macros.h
+
+## end   gnulib module ioctl-tests
+
 ## begin gnulib module isblank
 
 
@@ -798,6 +1134,42 @@ EXTRA_DIST += test-isnanl-nolibm.c test-isnanl.h minus-zero.h infinity.h nan.h m
 
 ## end   gnulib module isnanl-nolibm-tests
 
+## begin gnulib module iswblank-tests
+
+TESTS += test-iswblank
+check_PROGRAMS += test-iswblank
+EXTRA_DIST += test-iswblank.c macros.h
+
+## end   gnulib module iswblank-tests
+
+## begin gnulib module iswdigit-tests
+
+TESTS += test-iswdigit.sh
+TESTS_ENVIRONMENT += \
+  LOCALE_FR='@LOCALE_FR@' \
+  LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+  LOCALE_JA='@LOCALE_JA@' \
+  LOCALE_ZH_CN='@LOCALE_ZH_CN@'
+check_PROGRAMS += test-iswdigit
+test_iswdigit_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+EXTRA_DIST += test-iswdigit.sh test-iswdigit.c signature.h macros.h
+
+## end   gnulib module iswdigit-tests
+
+## begin gnulib module iswxdigit-tests
+
+TESTS += test-iswxdigit.sh
+TESTS_ENVIRONMENT += \
+  LOCALE_FR='@LOCALE_FR@' \
+  LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+  LOCALE_JA='@LOCALE_JA@' \
+  LOCALE_ZH_CN='@LOCALE_ZH_CN@'
+check_PROGRAMS += test-iswxdigit
+test_iswxdigit_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+EXTRA_DIST += test-iswxdigit.sh test-iswxdigit.c signature.h macros.h
+
+## end   gnulib module iswxdigit-tests
+
 ## begin gnulib module langinfo-c++-tests
 
 if ANSICXX
@@ -817,6 +1189,17 @@ EXTRA_DIST += test-langinfo.c
 
 ## end   gnulib module langinfo-tests
 
+## begin gnulib module limits-h-c++-tests
+
+if ANSICXX
+TESTS += test-limits-h-c++
+check_PROGRAMS += test-limits-h-c++
+test_limits_h_c___SOURCES = test-limits-h-c++.cc test-limits-h-c++2.cc
+endif
+EXTRA_DIST += test-limits-h-c++.cc test-limits-h-c++2.cc
+
+## end   gnulib module limits-h-c++-tests
+
 ## begin gnulib module limits-h-tests
 
 TESTS += test-limits-h
@@ -842,6 +1225,14 @@ EXTRA_DIST += test-link.h test-link.c signature.h macros.h
 
 ## end   gnulib module link-tests
 
+## begin gnulib module linked-list-tests
+
+TESTS += test-linked_list
+check_PROGRAMS += test-linked_list
+EXTRA_DIST += test-linked_list.c macros.h
+
+## end   gnulib module linked-list-tests
+
 ## begin gnulib module linkedhash-list-tests
 
 TESTS += test-linkedhash_list
@@ -850,12 +1241,39 @@ EXTRA_DIST += test-linkedhash_list.c macros.h
 
 ## end   gnulib module linkedhash-list-tests
 
+## begin gnulib module listen
+
+
+EXTRA_DIST += listen.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += listen.c
+
+## end   gnulib module listen
+
+## begin gnulib module listen-tests
+
+TESTS += test-listen
+check_PROGRAMS += test-listen
+test_listen_LDADD = $(LDADD) @LIBSOCKET@
+EXTRA_DIST += test-listen.c signature.h macros.h
+
+## end   gnulib module listen-tests
+
+## begin gnulib module localcharset-tests
+
+noinst_PROGRAMS += test-localcharset
+test_localcharset_LDADD = $(LDADD) $(LIB_SETLOCALE)
+EXTRA_DIST += test-localcharset.c
+
+## end   gnulib module localcharset-tests
+
 ## begin gnulib module locale-c++-tests
 
 if ANSICXX
 TESTS += test-locale-c++
 check_PROGRAMS += test-locale-c++
 test_locale_c___SOURCES = test-locale-c++.cc test-locale-c++2.cc
+test_locale_c___LDADD = $(LDADD) $(LIB_SETLOCALE)
 endif
 EXTRA_DIST += test-locale-c++.cc test-locale-c++2.cc signature.h
 
@@ -877,19 +1295,11 @@ EXTRA_DIST += test-localeconv.c signature.h macros.h
 
 ## end   gnulib module localeconv-tests
 
-## begin gnulib module localename
-
-libtests_a_SOURCES += localename.c
-
-EXTRA_DIST += localename.h
-
-## end   gnulib module localename
-
 ## begin gnulib module localename-tests
 
 TESTS += test-localename
 check_PROGRAMS += test-localename
-test_localename_LDADD = $(LDADD) @INTL_MACOSX_LIBS@ $(LIBTHREAD)
+test_localename_LDADD = $(LDADD) $(LIB_SETLOCALE) @INTL_MACOSX_LIBS@ $(LIBTHREAD)
 
 EXTRA_DIST += test-localename.c macros.h
 
@@ -911,6 +1321,14 @@ EXTRA_DIST += test-lstat.h test-lstat.c signature.h macros.h
 
 ## end   gnulib module lstat-tests
 
+## begin gnulib module malloc-gnu-tests
+
+TESTS += test-malloc-gnu
+check_PROGRAMS += test-malloc-gnu
+EXTRA_DIST += test-malloc-gnu.c macros.h
+
+## end   gnulib module malloc-gnu-tests
+
 ## begin gnulib module malloca-tests
 
 TESTS += test-malloca
@@ -947,14 +1365,16 @@ TESTS += \
   test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh \
   test-mbrtowc5.sh \
   test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh \
-  test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh
+  test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh test-mbrtowc-w32-6.sh \
+  test-mbrtowc-w32-7.sh
 TESTS_ENVIRONMENT += \
   LOCALE_FR='@LOCALE_FR@' \
   LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
   LOCALE_JA='@LOCALE_JA@' \
   LOCALE_ZH_CN='@LOCALE_ZH_CN@'
 check_PROGRAMS += test-mbrtowc test-mbrtowc-w32
-EXTRA_DIST += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc5.sh test-mbrtowc.c test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh test-mbrtowc-w32.c signature.h macros.h
+test_mbrtowc_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+EXTRA_DIST += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.sh test-mbrtowc5.sh test-mbrtowc.c test-mbrtowc-w32-1.sh test-mbrtowc-w32-2.sh test-mbrtowc-w32-3.sh test-mbrtowc-w32-4.sh test-mbrtowc-w32-5.sh test-mbrtowc-w32-6.sh test-mbrtowc-w32-7.sh test-mbrtowc-w32.c signature.h macros.h
 
 ## end   gnulib module mbrtowc-tests
 
@@ -963,11 +1383,23 @@ EXTRA_DIST += test-mbrtowc1.sh test-mbrtowc2.sh test-mbrtowc3.sh test-mbrtowc4.s
 TESTS += test-mbsinit.sh
 TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
 check_PROGRAMS += test-mbsinit
-
+test_mbsinit_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
 EXTRA_DIST += test-mbsinit.sh test-mbsinit.c signature.h macros.h
 
 ## end   gnulib module mbsinit-tests
 
+## begin gnulib module mbsstr-tests
+
+TESTS += test-mbsstr1 test-mbsstr2.sh test-mbsstr3.sh
+TESTS_ENVIRONMENT += LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' LOCALE_ZH_CN='@LOCALE_ZH_CN@'
+check_PROGRAMS += test-mbsstr1 test-mbsstr2 test-mbsstr3
+test_mbsstr1_LDADD = $(LDADD) $(LIBUNISTRING) $(LIB_MBRTOWC)
+test_mbsstr2_LDADD = $(LDADD) $(LIBUNISTRING) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+test_mbsstr3_LDADD = $(LDADD) $(LIBUNISTRING) $(LIB_SETLOCALE) $(LIB_MBRTOWC)
+EXTRA_DIST += test-mbsstr1.c test-mbsstr2.sh test-mbsstr2.c test-mbsstr3.sh test-mbsstr3.c macros.h
+
+## end   gnulib module mbsstr-tests
+
 ## begin gnulib module memchr-tests
 
 TESTS += test-memchr
@@ -984,12 +1416,87 @@ EXTRA_DIST += test-memchr2.c zerosize-ptr.h macros.h
 
 ## end   gnulib module memchr2-tests
 
+## begin gnulib module memrchr-tests
+
+TESTS += test-memrchr
+check_PROGRAMS += test-memrchr
+EXTRA_DIST += test-memrchr.c zerosize-ptr.h signature.h macros.h
+
+## end   gnulib module memrchr-tests
+
+## begin gnulib module mkdir-tests
+
+TESTS += test-mkdir
+check_PROGRAMS += test-mkdir
+EXTRA_DIST += test-mkdir.h test-mkdir.c signature.h macros.h
+
+## end   gnulib module mkdir-tests
+
+## begin gnulib module nanosleep
+
+
+EXTRA_DIST += nanosleep.c
+
+EXTRA_libtests_a_SOURCES += nanosleep.c
+
+## end   gnulib module nanosleep
+
+## begin gnulib module nanosleep-tests
+
+TESTS += test-nanosleep
+check_PROGRAMS += test-nanosleep
+test_nanosleep_LDADD = $(LDADD) $(LIB_NANOSLEEP)
+EXTRA_DIST += test-nanosleep.c signature.h macros.h
+
+## end   gnulib module nanosleep-tests
+
+## begin gnulib module netinet_in
+
+BUILT_SOURCES += $(NETINET_IN_H)
+
+# We need the following in order to create <netinet/in.h> when the system
+# doesn't have one.
+if GL_GENERATE_NETINET_IN_H
+netinet/in.h: netinet_in.in.h $(top_builddir)/config.status
+       $(AM_V_at)$(MKDIR_P) netinet
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_NETINET_IN_H''@|$(NEXT_NETINET_IN_H)|g' \
+             -e 's|@''HAVE_NETINET_IN_H''@|$(HAVE_NETINET_IN_H)|g' \
+             < $(srcdir)/netinet_in.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+else
+netinet/in.h: $(top_builddir)/config.status
+       rm -f $@
+endif
+MOSTLYCLEANFILES += netinet/in.h netinet/in.h-t
+MOSTLYCLEANDIRS += netinet
+
+EXTRA_DIST += netinet_in.in.h
+
+## end   gnulib module netinet_in
+
+## begin gnulib module netinet_in-tests
+
+TESTS += test-netinet_in
+check_PROGRAMS += test-netinet_in
+EXTRA_DIST += test-netinet_in.c
+
+## end   gnulib module netinet_in-tests
+
 ## begin gnulib module nl_langinfo-tests
 
-TESTS += test-nl_langinfo.sh
+TESTS += test-nl_langinfo.sh test-nl_langinfo-mt
 TESTS_ENVIRONMENT += LOCALE_FR='@LOCALE_FR@' LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
-check_PROGRAMS += test-nl_langinfo
-EXTRA_DIST += test-nl_langinfo.sh test-nl_langinfo.c signature.h macros.h
+check_PROGRAMS += test-nl_langinfo test-nl_langinfo-mt
+test_nl_langinfo_LDADD = $(LDADD) $(LIB_SETLOCALE)
+test_nl_langinfo_mt_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBMULTITHREAD) $(LIB_NANOSLEEP)
+EXTRA_DIST += test-nl_langinfo.sh test-nl_langinfo.c test-nl_langinfo-mt.c signature.h macros.h
 
 ## end   gnulib module nl_langinfo-tests
 
@@ -1001,14 +1508,14 @@ EXTRA_DIST += test-open.h test-open.c signature.h macros.h
 
 ## end   gnulib module open-tests
 
-## begin gnulib module opendir
-
-
-EXTRA_DIST += dirent-private.h opendir.c
+## begin gnulib module openat-tests
 
-EXTRA_libtests_a_SOURCES += opendir.c
+TESTS += test-openat
+check_PROGRAMS += test-openat
+test_openat_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-openat.c test-open.h signature.h macros.h
 
-## end   gnulib module opendir
+## end   gnulib module openat-tests
 
 ## begin gnulib module pathmax-tests
 
@@ -1018,6 +1525,31 @@ EXTRA_DIST += test-pathmax.c
 
 ## end   gnulib module pathmax-tests
 
+## begin gnulib module perror
+
+
+EXTRA_DIST += perror.c
+
+EXTRA_libtests_a_SOURCES += perror.c
+
+## end   gnulib module perror
+
+## begin gnulib module perror-tests
+
+TESTS += test-perror.sh test-perror2
+check_PROGRAMS += test-perror test-perror2
+EXTRA_DIST += macros.h signature.h test-perror.c test-perror2.c test-perror.sh
+
+## end   gnulib module perror-tests
+
+## begin gnulib module pipe-posix-tests
+
+TESTS += test-pipe
+check_PROGRAMS += test-pipe
+EXTRA_DIST += test-pipe.c signature.h macros.h
+
+## end   gnulib module pipe-posix-tests
+
 ## begin gnulib module pipe2-tests
 
 TESTS += test-pipe2
@@ -1027,6 +1559,38 @@ EXTRA_DIST += test-pipe2.c signature.h macros.h
 
 ## end   gnulib module pipe2-tests
 
+## begin gnulib module posix_spawn-tests
+
+TESTS += \
+  test-posix_spawn-open1 \
+  test-posix_spawn-open2 \
+  test-posix_spawn-inherit0 \
+  test-posix_spawn-inherit1 \
+  test-posix_spawn-script
+check_PROGRAMS += \
+  test-posix_spawn-open1 \
+  test-posix_spawn-open2 \
+  test-posix_spawn-inherit0 \
+  test-posix_spawn-inherit1 \
+  test-posix_spawn-script
+test_posix_spawn_script_CPPFLAGS = $(AM_CPPFLAGS) -DSRCDIR=\"$(srcdir)/\"
+EXTRA_DIST += test-posix_spawn-open1.c test-posix_spawn-open2.c test-posix_spawn-inherit0.c test-posix_spawn-inherit1.c test-posix_spawn-script.c executable-script executable-script.sh executable-shell-script signature.h
+
+## end   gnulib module posix_spawn-tests
+
+## begin gnulib module posix_spawn_file_actions_addchdir-tests
+
+TESTS += \
+  test-posix_spawn_file_actions_addchdir \
+  test-posix_spawn-chdir
+check_PROGRAMS += \
+  test-posix_spawn_file_actions_addchdir \
+  test-posix_spawn-chdir
+test_posix_spawn_chdir_LDADD = $(LDADD) @LIBINTL@
+EXTRA_DIST += test-posix_spawn_file_actions_addchdir.c test-posix_spawn-chdir.c signature.h macros.h
+
+## end   gnulib module posix_spawn_file_actions_addchdir-tests
+
 ## begin gnulib module posix_spawn_file_actions_addclose-tests
 
 TESTS += test-posix_spawn_file_actions_addclose
@@ -1053,25 +1617,31 @@ EXTRA_DIST += test-posix_spawn_file_actions_addopen.c signature.h macros.h
 
 ## begin gnulib module posix_spawnp-tests
 
-if POSIX_SPAWN_PORTED
-TESTS += test-posix_spawn1 test-posix_spawn2
-check_PROGRAMS += test-posix_spawn1 test-posix_spawn2
-
-BUILT_SOURCES += test-posix_spawn1.sh
-test-posix_spawn1.sh: test-posix_spawn1.in.sh
+TESTS += \
+  test-posix_spawn-dup2-stdout \
+  test-posix_spawn-dup2-stdin \
+  test-posix_spawnp-script
+check_PROGRAMS += \
+  test-posix_spawn-dup2-stdout \
+  test-posix_spawn-dup2-stdin \
+  test-posix_spawnp-script
+
+BUILT_SOURCES += test-posix_spawn-dup2-stdout.sh
+test-posix_spawn-dup2-stdout.sh: test-posix_spawn-dup2-stdout.in.sh
        $(AM_V_GEN)rm -f $@-t $@ && \
-       cp $(srcdir)/test-posix_spawn1.in.sh $@-t && \
+       cp $(srcdir)/test-posix_spawn-dup2-stdout.in.sh $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += test-posix_spawn1.sh test-posix_spawn1.sh-t
+MOSTLYCLEANFILES += test-posix_spawn-dup2-stdout.sh test-posix_spawn-dup2-stdout.sh-t
 
-BUILT_SOURCES += test-posix_spawn2.sh
-test-posix_spawn2.sh: test-posix_spawn2.in.sh
+BUILT_SOURCES += test-posix_spawn-dup2-stdin.sh
+test-posix_spawn-dup2-stdin.sh: test-posix_spawn-dup2-stdin.in.sh
        $(AM_V_GEN)rm -f $@-t $@ && \
-       cp $(srcdir)/test-posix_spawn2.in.sh $@-t && \
+       cp $(srcdir)/test-posix_spawn-dup2-stdin.in.sh $@-t && \
        mv $@-t $@
-MOSTLYCLEANFILES += test-posix_spawn2.sh test-posix_spawn2.sh-t
-endif
-EXTRA_DIST += test-posix_spawn1.c test-posix_spawn1.in.sh test-posix_spawn2.c test-posix_spawn2.in.sh signature.h
+MOSTLYCLEANFILES += test-posix_spawn-dup2-stdin.sh test-posix_spawn-dup2-stdin.sh-t
+
+test_posix_spawnp_script_CPPFLAGS = $(AM_CPPFLAGS) -DSRCDIR=\"$(srcdir)/\"
+EXTRA_DIST += test-posix_spawn-dup2-stdout.c test-posix_spawn-dup2-stdout.in.sh test-posix_spawn-dup2-stdin.c test-posix_spawn-dup2-stdin.in.sh test-posix_spawnp-script.c executable-script executable-script.sh executable-shell-script signature.h
 
 ## end   gnulib module posix_spawnp-tests
 
@@ -1091,6 +1661,207 @@ EXTRA_DIST += test-printf-frexpl.c macros.h
 
 ## end   gnulib module printf-frexpl-tests
 
+## begin gnulib module pthread-h
+
+BUILT_SOURCES += pthread.h
+
+# We need the following in order to create <pthread.h> when the system
+# doesn't have one that works with the given compiler.
+pthread.h: pthread.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(_NORETURN_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''HAVE_PTHREAD_H''@|$(HAVE_PTHREAD_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_PTHREAD_H''@|$(NEXT_PTHREAD_H)|g' \
+             -e 's/@''GNULIB_PTHREAD_THREAD''@/$(GL_M4_GNULIB_PTHREAD_THREAD)/g' \
+             -e 's/@''GNULIB_PTHREAD_ONCE''@/$(GL_M4_GNULIB_PTHREAD_ONCE)/g' \
+             -e 's/@''GNULIB_PTHREAD_MUTEX''@/$(GL_M4_GNULIB_PTHREAD_MUTEX)/g' \
+             -e 's/@''GNULIB_PTHREAD_RWLOCK''@/$(GL_M4_GNULIB_PTHREAD_RWLOCK)/g' \
+             -e 's/@''GNULIB_PTHREAD_COND''@/$(GL_M4_GNULIB_PTHREAD_COND)/g' \
+             -e 's/@''GNULIB_PTHREAD_TSS''@/$(GL_M4_GNULIB_PTHREAD_TSS)/g' \
+             -e 's/@''GNULIB_PTHREAD_SPIN''@/$(GL_M4_GNULIB_PTHREAD_SPIN)/g' \
+             -e 's/@''GNULIB_PTHREAD_MUTEX_TIMEDLOCK''@/$(GL_M4_GNULIB_PTHREAD_MUTEX_TIMEDLOCK)/g' \
+             -e 's|@''HAVE_PTHREAD_T''@|$(HAVE_PTHREAD_T)|g' \
+             -e 's|@''HAVE_PTHREAD_SPINLOCK_T''@|$(HAVE_PTHREAD_SPINLOCK_T)|g' \
+             -e 's|@''HAVE_PTHREAD_CREATE_DETACHED''@|$(HAVE_PTHREAD_CREATE_DETACHED)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_RECURSIVE''@|$(HAVE_PTHREAD_MUTEX_RECURSIVE)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_ROBUST''@|$(HAVE_PTHREAD_MUTEX_ROBUST)|g' \
+             -e 's|@''HAVE_PTHREAD_PROCESS_SHARED''@|$(HAVE_PTHREAD_PROCESS_SHARED)|g' \
+             -e 's|@''HAVE_PTHREAD_CREATE''@|$(HAVE_PTHREAD_CREATE)|g' \
+             -e 's|@''HAVE_PTHREAD_ATTR_INIT''@|$(HAVE_PTHREAD_ATTR_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_ATTR_GETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_GETDETACHSTATE)|g' \
+             -e 's|@''HAVE_PTHREAD_ATTR_SETDETACHSTATE''@|$(HAVE_PTHREAD_ATTR_SETDETACHSTATE)|g' \
+             -e 's|@''HAVE_PTHREAD_ATTR_DESTROY''@|$(HAVE_PTHREAD_ATTR_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_SELF''@|$(HAVE_PTHREAD_SELF)|g' \
+             -e 's|@''HAVE_PTHREAD_EQUAL''@|$(HAVE_PTHREAD_EQUAL)|g' \
+             -e 's|@''HAVE_PTHREAD_DETACH''@|$(HAVE_PTHREAD_DETACH)|g' \
+             -e 's|@''HAVE_PTHREAD_JOIN''@|$(HAVE_PTHREAD_JOIN)|g' \
+             -e 's|@''HAVE_PTHREAD_EXIT''@|$(HAVE_PTHREAD_EXIT)|g' \
+             -e 's|@''HAVE_PTHREAD_ONCE''@|$(HAVE_PTHREAD_ONCE)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_INIT''@|$(HAVE_PTHREAD_MUTEX_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_INIT''@|$(HAVE_PTHREAD_MUTEXATTR_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_GETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_GETTYPE)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_SETTYPE''@|$(HAVE_PTHREAD_MUTEXATTR_SETTYPE)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_GETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_GETROBUST)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_SETROBUST''@|$(HAVE_PTHREAD_MUTEXATTR_SETROBUST)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEXATTR_DESTROY''@|$(HAVE_PTHREAD_MUTEXATTR_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_LOCK''@|$(HAVE_PTHREAD_MUTEX_LOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_TRYLOCK''@|$(HAVE_PTHREAD_MUTEX_TRYLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_TIMEDLOCK''@|$(HAVE_PTHREAD_MUTEX_TIMEDLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_UNLOCK''@|$(HAVE_PTHREAD_MUTEX_UNLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_MUTEX_DESTROY''@|$(HAVE_PTHREAD_MUTEX_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_INIT''@|$(HAVE_PTHREAD_RWLOCK_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCKATTR_INIT''@|$(HAVE_PTHREAD_RWLOCKATTR_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCKATTR_DESTROY''@|$(HAVE_PTHREAD_RWLOCKATTR_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_RDLOCK''@|$(HAVE_PTHREAD_RWLOCK_RDLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_WRLOCK''@|$(HAVE_PTHREAD_RWLOCK_WRLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_UNLOCK''@|$(HAVE_PTHREAD_RWLOCK_UNLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_RWLOCK_DESTROY''@|$(HAVE_PTHREAD_RWLOCK_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_INIT''@|$(HAVE_PTHREAD_COND_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_CONDATTR_INIT''@|$(HAVE_PTHREAD_CONDATTR_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_CONDATTR_DESTROY''@|$(HAVE_PTHREAD_CONDATTR_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_WAIT''@|$(HAVE_PTHREAD_COND_WAIT)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_TIMEDWAIT''@|$(HAVE_PTHREAD_COND_TIMEDWAIT)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_SIGNAL''@|$(HAVE_PTHREAD_COND_SIGNAL)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_BROADCAST''@|$(HAVE_PTHREAD_COND_BROADCAST)|g' \
+             -e 's|@''HAVE_PTHREAD_COND_DESTROY''@|$(HAVE_PTHREAD_COND_DESTROY)|g' \
+             -e 's|@''HAVE_PTHREAD_KEY_CREATE''@|$(HAVE_PTHREAD_KEY_CREATE)|g' \
+             -e 's|@''HAVE_PTHREAD_SETSPECIFIC''@|$(HAVE_PTHREAD_SETSPECIFIC)|g' \
+             -e 's|@''HAVE_PTHREAD_GETSPECIFIC''@|$(HAVE_PTHREAD_GETSPECIFIC)|g' \
+             -e 's|@''HAVE_PTHREAD_KEY_DELETE''@|$(HAVE_PTHREAD_KEY_DELETE)|g' \
+             -e 's|@''HAVE_PTHREAD_SPIN_INIT''@|$(HAVE_PTHREAD_SPIN_INIT)|g' \
+             -e 's|@''HAVE_PTHREAD_SPIN_LOCK''@|$(HAVE_PTHREAD_SPIN_LOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_SPIN_TRYLOCK''@|$(HAVE_PTHREAD_SPIN_TRYLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_SPIN_UNLOCK''@|$(HAVE_PTHREAD_SPIN_UNLOCK)|g' \
+             -e 's|@''HAVE_PTHREAD_SPIN_DESTROY''@|$(HAVE_PTHREAD_SPIN_DESTROY)|g' \
+             < $(srcdir)/pthread.in.h | \
+         sed -e 's|@''REPLACE_PTHREAD_CREATE''@|$(REPLACE_PTHREAD_CREATE)|g' \
+             -e 's|@''REPLACE_PTHREAD_ATTR_INIT''@|$(REPLACE_PTHREAD_ATTR_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_ATTR_GETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_GETDETACHSTATE)|g' \
+             -e 's|@''REPLACE_PTHREAD_ATTR_SETDETACHSTATE''@|$(REPLACE_PTHREAD_ATTR_SETDETACHSTATE)|g' \
+             -e 's|@''REPLACE_PTHREAD_ATTR_DESTROY''@|$(REPLACE_PTHREAD_ATTR_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_SELF''@|$(REPLACE_PTHREAD_SELF)|g' \
+             -e 's|@''REPLACE_PTHREAD_EQUAL''@|$(REPLACE_PTHREAD_EQUAL)|g' \
+             -e 's|@''REPLACE_PTHREAD_DETACH''@|$(REPLACE_PTHREAD_DETACH)|g' \
+             -e 's|@''REPLACE_PTHREAD_JOIN''@|$(REPLACE_PTHREAD_JOIN)|g' \
+             -e 's|@''REPLACE_PTHREAD_EXIT''@|$(REPLACE_PTHREAD_EXIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_ONCE''@|$(REPLACE_PTHREAD_ONCE)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_INIT''@|$(REPLACE_PTHREAD_MUTEX_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_INIT''@|$(REPLACE_PTHREAD_MUTEXATTR_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_GETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_GETTYPE)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_SETTYPE''@|$(REPLACE_PTHREAD_MUTEXATTR_SETTYPE)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_GETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_GETROBUST)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_SETROBUST''@|$(REPLACE_PTHREAD_MUTEXATTR_SETROBUST)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEXATTR_DESTROY''@|$(REPLACE_PTHREAD_MUTEXATTR_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_LOCK''@|$(REPLACE_PTHREAD_MUTEX_LOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_TRYLOCK''@|$(REPLACE_PTHREAD_MUTEX_TRYLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_TIMEDLOCK''@|$(REPLACE_PTHREAD_MUTEX_TIMEDLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_UNLOCK''@|$(REPLACE_PTHREAD_MUTEX_UNLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_MUTEX_DESTROY''@|$(REPLACE_PTHREAD_MUTEX_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_INIT''@|$(REPLACE_PTHREAD_RWLOCK_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCKATTR_INIT''@|$(REPLACE_PTHREAD_RWLOCKATTR_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCKATTR_DESTROY''@|$(REPLACE_PTHREAD_RWLOCKATTR_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_RDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_RDLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_WRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_WRLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_TRYRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYRDLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_TRYWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TRYWRLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK''@|$(REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_UNLOCK''@|$(REPLACE_PTHREAD_RWLOCK_UNLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_RWLOCK_DESTROY''@|$(REPLACE_PTHREAD_RWLOCK_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_INIT''@|$(REPLACE_PTHREAD_COND_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_CONDATTR_INIT''@|$(REPLACE_PTHREAD_CONDATTR_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_CONDATTR_DESTROY''@|$(REPLACE_PTHREAD_CONDATTR_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_WAIT''@|$(REPLACE_PTHREAD_COND_WAIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_TIMEDWAIT''@|$(REPLACE_PTHREAD_COND_TIMEDWAIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_SIGNAL''@|$(REPLACE_PTHREAD_COND_SIGNAL)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_BROADCAST''@|$(REPLACE_PTHREAD_COND_BROADCAST)|g' \
+             -e 's|@''REPLACE_PTHREAD_COND_DESTROY''@|$(REPLACE_PTHREAD_COND_DESTROY)|g' \
+             -e 's|@''REPLACE_PTHREAD_KEY_CREATE''@|$(REPLACE_PTHREAD_KEY_CREATE)|g' \
+             -e 's|@''REPLACE_PTHREAD_SETSPECIFIC''@|$(REPLACE_PTHREAD_SETSPECIFIC)|g' \
+             -e 's|@''REPLACE_PTHREAD_GETSPECIFIC''@|$(REPLACE_PTHREAD_GETSPECIFIC)|g' \
+             -e 's|@''REPLACE_PTHREAD_KEY_DELETE''@|$(REPLACE_PTHREAD_KEY_DELETE)|g' \
+             -e 's|@''REPLACE_PTHREAD_SPIN_INIT''@|$(REPLACE_PTHREAD_SPIN_INIT)|g' \
+             -e 's|@''REPLACE_PTHREAD_SPIN_LOCK''@|$(REPLACE_PTHREAD_SPIN_LOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_SPIN_TRYLOCK''@|$(REPLACE_PTHREAD_SPIN_TRYLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_SPIN_UNLOCK''@|$(REPLACE_PTHREAD_SPIN_UNLOCK)|g' \
+             -e 's|@''REPLACE_PTHREAD_SPIN_DESTROY''@|$(REPLACE_PTHREAD_SPIN_DESTROY)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _Noreturn/r $(_NORETURN_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)'; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += pthread.h pthread.h-t
+
+EXTRA_DIST += pthread.in.h
+
+## end   gnulib module pthread-h
+
+## begin gnulib module pthread-h-c++-tests
+
+if ANSICXX
+TESTS += test-pthread-c++
+check_PROGRAMS += test-pthread-c++
+test_pthread_c___SOURCES = test-pthread-c++.cc
+test_pthread_c___LDADD = $(LDADD) $(LIBPMULTITHREAD)
+endif
+EXTRA_DIST += test-pthread-c++.cc signature.h
+
+## end   gnulib module pthread-h-c++-tests
+
+## begin gnulib module pthread-h-tests
+
+TESTS += test-pthread
+check_PROGRAMS += test-pthread
+EXTRA_DIST += test-pthread.c
+
+## end   gnulib module pthread-h-tests
+
+## begin gnulib module pthread-thread
+
+
+EXTRA_DIST += pthread-thread.c
+
+EXTRA_libtests_a_SOURCES += pthread-thread.c
+
+## end   gnulib module pthread-thread
+
+## begin gnulib module pthread-thread-tests
+
+TESTS += test-pthread-thread
+check_PROGRAMS += test-pthread-thread
+test_pthread_thread_LDADD = $(LDADD) @LIBPMULTITHREAD@
+EXTRA_DIST += test-pthread-thread.c macros.h
+
+## end   gnulib module pthread-thread-tests
+
+## begin gnulib module pthread_sigmask
+
+
+EXTRA_DIST += pthread_sigmask.c
+
+EXTRA_libtests_a_SOURCES += pthread_sigmask.c
+
+## end   gnulib module pthread_sigmask
+
+## begin gnulib module pthread_sigmask-tests
+
+TESTS += test-pthread_sigmask1 test-pthread_sigmask2
+check_PROGRAMS += test-pthread_sigmask1 test-pthread_sigmask2
+test_pthread_sigmask1_LDADD = $(LDADD) @LIB_PTHREAD_SIGMASK@
+test_pthread_sigmask2_LDADD = $(LDADD) @LIB_PTHREAD_SIGMASK@ @LIBMULTITHREAD@
+EXTRA_DIST += test-pthread_sigmask1.c test-pthread_sigmask2.c signature.h macros.h
+
+## end   gnulib module pthread_sigmask-tests
+
 ## begin gnulib module putenv
 
 
@@ -1104,7 +1875,7 @@ EXTRA_libtests_a_SOURCES += putenv.c
 
 TESTS += test-quotearg-simple
 check_PROGRAMS += test-quotearg-simple
-test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@
+test_quotearg_simple_LDADD = $(LDADD) @LIBINTL@ $(LIB_MBRTOWC)
 EXTRA_DIST += test-quotearg-simple.c test-quotearg.h macros.h zerosize-ptr.h
 
 ## end   gnulib module quotearg-simple-tests
@@ -1125,14 +1896,21 @@ EXTRA_DIST += test-rawmemchr.c zerosize-ptr.h signature.h macros.h
 
 ## end   gnulib module rawmemchr-tests
 
-## begin gnulib module readdir
+## begin gnulib module read-file
+
+libtests_a_SOURCES += read-file.c
 
+EXTRA_DIST += read-file.h
 
-EXTRA_DIST += dirent-private.h readdir.c
+## end   gnulib module read-file
 
-EXTRA_libtests_a_SOURCES += readdir.c
+## begin gnulib module read-file-tests
 
-## end   gnulib module readdir
+TESTS += test-read-file
+check_PROGRAMS += test-read-file
+EXTRA_DIST += test-read-file.c macros.h
+
+## end   gnulib module read-file-tests
 
 ## begin gnulib module readlink-tests
 
@@ -1142,38 +1920,100 @@ EXTRA_DIST += test-readlink.h test-readlink.c signature.h macros.h
 
 ## end   gnulib module readlink-tests
 
+## begin gnulib module realloc-gnu-tests
+
+TESTS += test-realloc-gnu
+check_PROGRAMS += test-realloc-gnu
+EXTRA_DIST += test-realloc-gnu.c macros.h
+
+## end   gnulib module realloc-gnu-tests
+
+## begin gnulib module reallocarray-tests
+
+TESTS += test-reallocarray
+check_PROGRAMS += test-reallocarray
+EXTRA_DIST += test-reallocarray.c signature.h macros.h
+
+## end   gnulib module reallocarray-tests
+
 ## begin gnulib module regex-tests
 
 TESTS += test-regex
 check_PROGRAMS += test-regex
-test_regex_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD) $(LIB_PTHREAD)
+test_regex_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIB_MBRTOWC) @LIBINTL@ $(LIBTHREAD)
 EXTRA_DIST += test-regex.c macros.h
 
-## end   gnulib module regex-tests
+## end   gnulib module regex-tests
+
+## begin gnulib module rename-tests
+
+TESTS += test-rename
+check_PROGRAMS += test-rename
+EXTRA_DIST += test-rename.h test-rename.c signature.h macros.h
+
+## end   gnulib module rename-tests
+
+## begin gnulib module rmdir-tests
+
+TESTS += test-rmdir
+check_PROGRAMS += test-rmdir
+EXTRA_DIST += test-rmdir.h test-rmdir.c signature.h macros.h
+
+## end   gnulib module rmdir-tests
+
+## begin gnulib module root-uid
+
+
+EXTRA_DIST += root-uid.h
+
+## end   gnulib module root-uid
+
+## begin gnulib module sched-tests
+
+TESTS += test-sched
+check_PROGRAMS += test-sched
+EXTRA_DIST += test-sched.c
+
+## end   gnulib module sched-tests
+
+## begin gnulib module sched_yield
+
+
+EXTRA_DIST += sched_yield.c
+
+EXTRA_libtests_a_SOURCES += sched_yield.c
+
+## end   gnulib module sched_yield
 
-## begin gnulib module rename-tests
+## begin gnulib module scratch_buffer-tests
 
-TESTS += test-rename
-check_PROGRAMS += test-rename
-EXTRA_DIST += test-rename.h test-rename.c signature.h macros.h
+TESTS += test-scratch-buffer
+check_PROGRAMS += test-scratch-buffer
+test_scratch_buffer_SOURCES = test-scratch-buffer.c
+EXTRA_DIST += test-scratch-buffer.c macros.h
 
-## end   gnulib module rename-tests
+## end   gnulib module scratch_buffer-tests
 
-## begin gnulib module rmdir-tests
+## begin gnulib module select
 
-TESTS += test-rmdir
-check_PROGRAMS += test-rmdir
-EXTRA_DIST += test-rmdir.h test-rmdir.c signature.h macros.h
 
-## end   gnulib module rmdir-tests
+EXTRA_DIST += select.c
 
-## begin gnulib module sched-tests
+EXTRA_libtests_a_SOURCES += select.c
 
-TESTS += test-sched
-check_PROGRAMS += test-sched
-EXTRA_DIST += test-sched.c
+## end   gnulib module select
 
-## end   gnulib module sched-tests
+## begin gnulib module select-tests
+
+TESTS += test-select test-select-in.sh test-select-out.sh
+# test-select-stdin has to be run by hand.
+check_PROGRAMS += test-select test-select-fd test-select-stdin
+test_select_LDADD = $(LDADD) @LIB_SELECT@ @LIBSOCKET@ $(INET_PTON_LIB)
+test_select_fd_LDADD = $(LDADD) @LIB_SELECT@
+test_select_stdin_LDADD = $(LDADD) @LIB_SELECT@
+EXTRA_DIST += macros.h signature.h test-select.c test-select.h test-select-fd.c test-select-in.sh test-select-out.sh test-select-stdin.c
+
+## end   gnulib module select-tests
 
 ## begin gnulib module setenv
 
@@ -1192,14 +2032,22 @@ EXTRA_DIST += test-setenv.c signature.h macros.h
 
 ## end   gnulib module setenv-tests
 
-## begin gnulib module setlocale
-
-
-EXTRA_DIST += setlocale.c
+## begin gnulib module setlocale-null-tests
 
-EXTRA_libtests_a_SOURCES += setlocale.c
-
-## end   gnulib module setlocale
+TESTS += \
+  test-setlocale_null \
+  test-setlocale_null-mt-one \
+  test-setlocale_null-mt-all
+check_PROGRAMS += \
+  test-setlocale_null \
+  test-setlocale_null-mt-one \
+  test-setlocale_null-mt-all
+test_setlocale_null_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@
+test_setlocale_null_mt_one_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@ $(LIBMULTITHREAD) $(LIB_NANOSLEEP)
+test_setlocale_null_mt_all_LDADD = $(LDADD) @LIB_SETLOCALE_NULL@ $(LIBMULTITHREAD) $(LIB_NANOSLEEP)
+EXTRA_DIST += test-setlocale_null.c test-setlocale_null-mt-one.c test-setlocale_null-mt-all.c
+
+## end   gnulib module setlocale-null-tests
 
 ## begin gnulib module setlocale-tests
 
@@ -1210,10 +2058,30 @@ TESTS_ENVIRONMENT += \
   LOCALE_JA='@LOCALE_JA@' \
   LOCALE_ZH_CN='@LOCALE_ZH_CN@'
 check_PROGRAMS += test-setlocale1 test-setlocale2
+test_setlocale1_LDADD = $(LDADD) @LIB_SETLOCALE@
+test_setlocale2_LDADD = $(LDADD) @LIB_SETLOCALE@
 EXTRA_DIST += test-setlocale1.sh test-setlocale1.c test-setlocale2.sh test-setlocale2.c signature.h macros.h
 
 ## end   gnulib module setlocale-tests
 
+## begin gnulib module setsockopt
+
+
+EXTRA_DIST += setsockopt.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += setsockopt.c
+
+## end   gnulib module setsockopt
+
+## begin gnulib module setsockopt-tests
+
+TESTS += test-setsockopt
+check_PROGRAMS += test-setsockopt
+test_setsockopt_LDADD = $(LDADD) @LIBSOCKET@
+EXTRA_DIST += test-setsockopt.c signature.h macros.h
+
+## end   gnulib module setsockopt-tests
+
 ## begin gnulib module sigaction-tests
 
 TESTS += test-sigaction
@@ -1256,7 +2124,7 @@ EXTRA_DIST += test-signbit.c minus-zero.h infinity.h macros.h
 TESTS += test-sigpipe.sh
 check_PROGRAMS += test-sigpipe
 
-EXTRA_DIST += test-sigpipe.c test-sigpipe.sh
+EXTRA_DIST += test-sigpipe.c test-sigpipe.sh macros.h
 
 ## end   gnulib module sigpipe-tests
 
@@ -1268,6 +2136,26 @@ EXTRA_DIST += test-sigprocmask.c signature.h macros.h
 
 ## end   gnulib module sigprocmask-tests
 
+## begin gnulib module sigsegv-tests
+
+TESTS += \
+  test-sigsegv-catch-segv1 \
+  test-sigsegv-catch-segv2 \
+  test-sigsegv-catch-stackoverflow1 \
+  test-sigsegv-catch-stackoverflow2
+check_PROGRAMS += \
+  test-sigsegv-catch-segv1 \
+  test-sigsegv-catch-segv2 \
+  test-sigsegv-catch-stackoverflow1 \
+  test-sigsegv-catch-stackoverflow2
+test_sigsegv_catch_segv1_LDADD = $(LDADD) $(LIBSIGSEGV)
+test_sigsegv_catch_segv2_LDADD = $(LDADD) $(LIBSIGSEGV)
+test_sigsegv_catch_stackoverflow1_LDADD = $(LDADD) $(LIBSIGSEGV)
+test_sigsegv_catch_stackoverflow2_LDADD = $(LDADD) $(LIBSIGSEGV)
+EXTRA_DIST += test-sigsegv-catch-segv1.c test-sigsegv-catch-segv2.c test-sigsegv-catch-stackoverflow1.c test-sigsegv-catch-stackoverflow2.c altstack-util.h mmap-anon-util.h
+
+## end   gnulib module sigsegv-tests
+
 ## begin gnulib module sleep
 
 
@@ -1288,106 +2176,60 @@ EXTRA_DIST += test-sleep.c signature.h macros.h
 ## begin gnulib module snippet/_Noreturn
 
 # Because this Makefile snippet defines a variable used by other
-# gnulib Makefile snippets, it must be present in all Makefile.am that
+# gnulib Makefile snippets, it must be present in all makefiles that
 # need it. This is ensured by the applicability 'all' defined above.
 
-_NORETURN_H=$(top_srcdir)/build-aux/snippet/_Noreturn.h
+_NORETURN_H=$(srcdir)/_Noreturn.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/_Noreturn.h
+EXTRA_DIST += _Noreturn.h
 
 ## end   gnulib module snippet/_Noreturn
 
 ## begin gnulib module snippet/arg-nonnull
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += arg-nonnull.h
-# The arg-nonnull.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/arg-nonnull.h, except that it has the copyright header cut
-# off.
-arg-nonnull.h: $(top_srcdir)/build-aux/snippet/arg-nonnull.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_ARG_NONNULL/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/arg-nonnull.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += arg-nonnull.h arg-nonnull.h-t
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-ARG_NONNULL_H=arg-nonnull.h
+ARG_NONNULL_H=$(srcdir)/arg-nonnull.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/arg-nonnull.h
+EXTRA_DIST += arg-nonnull.h
 
 ## end   gnulib module snippet/arg-nonnull
 
 ## begin gnulib module snippet/c++defs
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += c++defs.h
-# The c++defs.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/c++defs.h, except that it has the copyright header cut off.
-c++defs.h: $(top_srcdir)/build-aux/snippet/c++defs.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/_GL_CXXDEFS/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/c++defs.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += c++defs.h c++defs.h-t
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-CXXDEFS_H=c++defs.h
+CXXDEFS_H=$(srcdir)/c++defs.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/c++defs.h
+EXTRA_DIST += c++defs.h
 
 ## end   gnulib module snippet/c++defs
 
 ## begin gnulib module snippet/unused-parameter
 
-# The BUILT_SOURCES created by this Makefile snippet are not used via #include
-# statements but through direct file reference. Therefore this snippet must be
-# present in all Makefile.am that need it. This is ensured by the applicability
-# 'all' defined above.
-
-BUILT_SOURCES += unused-parameter.h
-# The unused-parameter.h that gets inserted into generated .h files is the same
-# as build-aux/snippet/unused-parameter.h, except that it has the copyright
-# header cut off.
-unused-parameter.h: $(top_srcdir)/build-aux/snippet/unused-parameter.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/GL_UNUSED_PARAMETER/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/unused-parameter.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += unused-parameter.h unused-parameter.h-t
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-UNUSED_PARAMETER_H=unused-parameter.h
+UNUSED_PARAMETER_H=$(srcdir)/unused-parameter.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/unused-parameter.h
+EXTRA_DIST += unused-parameter.h
 
 ## end   gnulib module snippet/unused-parameter
 
 ## begin gnulib module snippet/warn-on-use
 
-BUILT_SOURCES += warn-on-use.h
-# The warn-on-use.h that gets inserted into generated .h files is the same as
-# build-aux/snippet/warn-on-use.h, except that it has the copyright header cut
-# off.
-warn-on-use.h: $(top_srcdir)/build-aux/snippet/warn-on-use.h
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       sed -n -e '/^.ifndef/,$$p' \
-         < $(top_srcdir)/build-aux/snippet/warn-on-use.h \
-         > $@-t && \
-       mv $@-t $@
-MOSTLYCLEANFILES += warn-on-use.h warn-on-use.h-t
+# Because this Makefile snippet defines a variable used by other
+# gnulib Makefile snippets, it must be present in all makefiles that
+# need it. This is ensured by the applicability 'all' defined above.
 
-WARN_ON_USE_H=warn-on-use.h
+WARN_ON_USE_H=$(srcdir)/warn-on-use.h
 
-EXTRA_DIST += $(top_srcdir)/build-aux/snippet/warn-on-use.h
+EXTRA_DIST += warn-on-use.h
 
 ## end   gnulib module snippet/warn-on-use
 
@@ -1400,6 +2242,32 @@ EXTRA_DIST += test-snprintf.c signature.h macros.h
 
 ## end   gnulib module snprintf-tests
 
+## begin gnulib module socket
+
+
+EXTRA_DIST += socket.c w32sock.h
+
+EXTRA_libtests_a_SOURCES += socket.c
+
+## end   gnulib module socket
+
+## begin gnulib module sockets
+
+libtests_a_SOURCES += sockets.h sockets.c
+
+EXTRA_DIST += w32sock.h
+
+## end   gnulib module sockets
+
+## begin gnulib module sockets-tests
+
+TESTS += test-sockets
+check_PROGRAMS += test-sockets
+test_sockets_LDADD = $(LDADD) @LIBSOCKET@
+EXTRA_DIST += test-sockets.c
+
+## end   gnulib module sockets-tests
+
 ## begin gnulib module spawn-c++-tests
 
 if ANSICXX
@@ -1416,12 +2284,17 @@ EXTRA_DIST += test-spawn-c++.cc signature.h
 
 TESTS += test-spawn-pipe.sh
 check_PROGRAMS += test-spawn-pipe-main test-spawn-pipe-child
-test_spawn_pipe_main_LDADD = $(LDADD) @LIBINTL@
+test_spawn_pipe_main_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
 # The test-spawn-pipe-child program must be a real executable, not a libtool
 # wrapper script, and should link against as few libraries as possible.
 # Therefore don't link it against any libraries other than -lc.
 test_spawn_pipe_child_LDADD =
-EXTRA_DIST += test-spawn-pipe.sh test-spawn-pipe-main.c test-spawn-pipe-child.c macros.h
+
+TESTS += test-spawn-pipe-script
+check_PROGRAMS += test-spawn-pipe-script
+test_spawn_pipe_script_LDADD = $(LDADD) @LIBINTL@ $(LIBTHREAD)
+test_spawn_pipe_script_CPPFLAGS = $(AM_CPPFLAGS) -DSRCDIR=\"$(srcdir)/\"
+EXTRA_DIST += test-spawn-pipe.sh test-spawn-pipe-main.c test-spawn-pipe-child.c test-spawn-pipe-script.c executable-script executable-script.sh executable-shell-script macros.h
 
 ## end   gnulib module spawn-pipe-tests
 
@@ -1442,28 +2315,14 @@ EXTRA_DIST += test-stat.h test-stat.c signature.h macros.h
 
 ## end   gnulib module stat-tests
 
-## begin gnulib module stdalign
-
-BUILT_SOURCES += $(STDALIGN_H)
-
-# We need the following in order to create <stdalign.h> when the system
-# doesn't have one that works.
-if GL_GENERATE_STDALIGN_H
-stdalign.h: stdalign.in.h $(top_builddir)/config.status
-       $(AM_V_GEN)rm -f $@-t $@ && \
-       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
-         cat $(srcdir)/stdalign.in.h; \
-       } > $@-t && \
-       mv $@-t $@
-else
-stdalign.h: $(top_builddir)/config.status
-       rm -f $@
-endif
-MOSTLYCLEANFILES += stdalign.h stdalign.h-t
+## begin gnulib module stat-time-tests
 
-EXTRA_DIST += stdalign.in.h
+TESTS += test-stat-time
+check_PROGRAMS += test-stat-time
+test_stat_time_LDADD = $(LDADD) $(LIB_NANOSLEEP)
+EXTRA_DIST += test-stat-time.c macros.h nap.h
 
-## end   gnulib module stdalign
+## end   gnulib module stat-time-tests
 
 ## begin gnulib module stdalign-tests
 
@@ -1473,6 +2332,17 @@ EXTRA_DIST += test-stdalign.c macros.h
 
 ## end   gnulib module stdalign-tests
 
+## begin gnulib module stdbool-c++-tests
+
+if ANSICXX
+TESTS += test-stdbool-c++
+check_PROGRAMS += test-stdbool-c++
+test_stdbool_c___SOURCES = test-stdbool-c++.cc test-stdbool-c++2.cc
+endif
+EXTRA_DIST += test-stdbool-c++.cc test-stdbool-c++2.cc
+
+## end   gnulib module stdbool-c++-tests
+
 ## begin gnulib module stdbool-tests
 
 TESTS += test-stdbool
@@ -1481,6 +2351,17 @@ EXTRA_DIST += test-stdbool.c
 
 ## end   gnulib module stdbool-tests
 
+## begin gnulib module stddef-c++-tests
+
+if ANSICXX
+TESTS += test-stddef-c++
+check_PROGRAMS += test-stddef-c++
+test_stddef_c___SOURCES = test-stddef-c++.cc test-stddef-c++2.cc
+endif
+EXTRA_DIST += test-stddef-c++.cc test-stddef-c++2.cc
+
+## end   gnulib module stddef-c++-tests
+
 ## begin gnulib module stddef-tests
 
 TESTS += test-stddef
@@ -1489,6 +2370,17 @@ EXTRA_DIST += test-stddef.c
 
 ## end   gnulib module stddef-tests
 
+## begin gnulib module stdint-c++-tests
+
+if ANSICXX
+TESTS += test-stdint-c++
+check_PROGRAMS += test-stdint-c++
+test_stdint_c___SOURCES = test-stdint-c++.cc test-stdint-c++2.cc
+endif
+EXTRA_DIST += test-stdint-c++.cc test-stdint-c++2.cc
+
+## end   gnulib module stdint-c++-tests
+
 ## begin gnulib module stdint-tests
 
 TESTS += test-stdint
@@ -1503,7 +2395,7 @@ if ANSICXX
 TESTS += test-stdio-c++
 check_PROGRAMS += test-stdio-c++
 test_stdio_c___SOURCES = test-stdio-c++.cc test-stdio-c++2.cc
-test_stdio_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS)
+test_stdio_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) $(LIB_GETRANDOM)
 endif
 EXTRA_DIST += test-stdio-c++.cc test-stdio-c++2.cc signature.h
 
@@ -1523,7 +2415,7 @@ if ANSICXX
 TESTS += test-stdlib-c++
 check_PROGRAMS += test-stdlib-c++
 test_stdlib_c___SOURCES = test-stdlib-c++.cc test-stdlib-c++2.cc
-test_stdlib_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)
+test_stdlib_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIB_GETRANDOM)
 endif
 EXTRA_DIST += test-stdlib-c++.cc test-stdlib-c++2.cc signature.h
 
@@ -1545,15 +2437,6 @@ EXTRA_DIST += test-strchrnul.c signature.h macros.h
 
 ## end   gnulib module strchrnul-tests
 
-## begin gnulib module strdup-posix
-
-
-EXTRA_DIST += strdup.c
-
-EXTRA_libtests_a_SOURCES += strdup.c
-
-## end   gnulib module strdup-posix
-
 ## begin gnulib module strerror-tests
 
 TESTS += test-strerror
@@ -1562,13 +2445,40 @@ EXTRA_DIST += test-strerror.c signature.h macros.h
 
 ## end   gnulib module strerror-tests
 
+## begin gnulib module strerror_r-posix
+
+
+EXTRA_DIST += strerror_r.c
+
+EXTRA_libtests_a_SOURCES += strerror_r.c
+
+## end   gnulib module strerror_r-posix
+
+## begin gnulib module strerror_r-posix-tests
+
+TESTS += test-strerror_r
+check_PROGRAMS += test-strerror_r
+EXTRA_DIST += test-strerror_r.c signature.h macros.h
+
+## end   gnulib module strerror_r-posix-tests
+
+## begin gnulib module striconv-tests
+
+TESTS += test-striconv
+check_PROGRAMS += test-striconv
+test_striconv_LDADD = $(LDADD) @LIBICONV@
+
+EXTRA_DIST += test-striconv.c macros.h
+
+## end   gnulib module striconv-tests
+
 ## begin gnulib module string-c++-tests
 
 if ANSICXX
 TESTS += test-string-c++
 check_PROGRAMS += test-string-c++
 test_string_c___SOURCES = test-string-c++.cc test-string-c++2.cc
-test_string_c___LDADD = $(LDADD) $(LIBINTL)
+test_string_c___LDADD = $(LDADD) $(LIBINTL) $(LIBTHREAD)
 endif
 EXTRA_DIST += test-string-c++.cc test-string-c++2.cc signature.h
 
@@ -1611,7 +2521,14 @@ EXTRA_DIST += test-strstr.c zerosize-ptr.h signature.h macros.h
 
 TESTS += test-strtod
 check_PROGRAMS += test-strtod
-EXTRA_DIST += test-strtod.c signature.h minus-zero.h macros.h
+
+TESTS += test-strtod1.sh
+TESTS_ENVIRONMENT += \
+  LOCALE_FR='@LOCALE_FR@' \
+  LOCALE_FR_UTF8='@LOCALE_FR_UTF8@'
+check_PROGRAMS += test-strtod1
+test_strtod1_LDADD = $(LDADD) $(LIB_SETLOCALE)
+EXTRA_DIST += test-strtod.c test-strtod1.sh test-strtod1.c signature.h minus-zero.h macros.h
 
 ## end   gnulib module strtod-tests
 
@@ -1632,6 +2549,204 @@ EXTRA_DIST += test-symlink.h test-symlink.c signature.h macros.h
 
 ## end   gnulib module symlink-tests
 
+## begin gnulib module sys_ioctl
+
+BUILT_SOURCES += sys/ioctl.h
+
+# We need the following in order to create <sys/ioctl.h> when the system
+# does not have a complete one.
+sys/ioctl.h: sys_ioctl.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''HAVE_SYS_IOCTL_H''@|$(HAVE_SYS_IOCTL_H)|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_IOCTL_H''@|$(NEXT_SYS_IOCTL_H)|g' \
+             -e 's/@''GNULIB_IOCTL''@/$(GL_M4_GNULIB_IOCTL)/g' \
+             -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H)|g' \
+             -e 's|@''SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS''@|$(SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS)|g' \
+             -e 's|@''REPLACE_IOCTL''@|$(REPLACE_IOCTL)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sys_ioctl.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += sys/ioctl.h sys/ioctl.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_ioctl.in.h
+
+## end   gnulib module sys_ioctl
+
+## begin gnulib module sys_ioctl-c++-tests
+
+if ANSICXX
+TESTS += test-sys_ioctl-c++
+check_PROGRAMS += test-sys_ioctl-c++
+test_sys_ioctl_c___SOURCES = test-sys_ioctl-c++.cc
+test_sys_ioctl_c___LDADD = $(LDADD) $(LIBINTL) $(LIBSOCKET) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS)
+endif
+EXTRA_DIST += test-sys_ioctl-c++.cc signature.h
+
+## end   gnulib module sys_ioctl-c++-tests
+
+## begin gnulib module sys_ioctl-tests
+
+TESTS += test-sys_ioctl
+check_PROGRAMS += test-sys_ioctl
+EXTRA_DIST += test-sys_ioctl.c
+
+## end   gnulib module sys_ioctl-tests
+
+## begin gnulib module sys_random-c++-tests
+
+if ANSICXX
+TESTS += test-sys_random-c++
+check_PROGRAMS += test-sys_random-c++
+test_sys_random_c___SOURCES = test-sys_random-c++.cc
+test_sys_random_c___LDADD = $(LDADD) $(LIB_GETRANDOM)
+endif
+EXTRA_DIST += test-sys_random-c++.cc signature.h
+
+## end   gnulib module sys_random-c++-tests
+
+## begin gnulib module sys_random-tests
+
+TESTS += test-sys_random
+check_PROGRAMS += test-sys_random
+EXTRA_DIST += test-sys_random.c
+
+## end   gnulib module sys_random-tests
+
+## begin gnulib module sys_select
+
+BUILT_SOURCES += sys/select.h
+
+# We need the following in order to create <sys/select.h> when the system
+# doesn't have one that works with the given compiler.
+sys/select.h: sys_select.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_SELECT_H''@|$(NEXT_SYS_SELECT_H)|g' \
+             -e 's|@''HAVE_SYS_SELECT_H''@|$(HAVE_SYS_SELECT_H)|g' \
+             -e 's/@''GNULIB_PSELECT''@/$(GL_M4_GNULIB_PSELECT)/g' \
+             -e 's/@''GNULIB_SELECT''@/$(GL_M4_GNULIB_SELECT)/g' \
+             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+             -e 's|@''HAVE_PSELECT''@|$(HAVE_PSELECT)|g' \
+             -e 's|@''REPLACE_PSELECT''@|$(REPLACE_PSELECT)|g' \
+             -e 's|@''REPLACE_SELECT''@|$(REPLACE_SELECT)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sys_select.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += sys/select.h sys/select.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_select.in.h
+
+## end   gnulib module sys_select
+
+## begin gnulib module sys_select-c++-tests
+
+if ANSICXX
+TESTS += test-sys_select-c++
+check_PROGRAMS += test-sys_select-c++
+test_sys_select_c___SOURCES = test-sys_select-c++.cc
+test_sys_select_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_SELECT) $(LIB_NANOSLEEP)
+endif
+EXTRA_DIST += test-sys_select-c++.cc signature.h
+
+## end   gnulib module sys_select-c++-tests
+
+## begin gnulib module sys_select-tests
+
+TESTS += test-sys_select
+check_PROGRAMS += test-sys_select
+EXTRA_DIST += test-sys_select.c signature.h
+
+## end   gnulib module sys_select-tests
+
+## begin gnulib module sys_socket
+
+BUILT_SOURCES += sys/socket.h
+libtests_a_SOURCES += sys_socket.c
+
+# We need the following in order to create <sys/socket.h> when the system
+# doesn't have one that works with the given compiler.
+sys/socket.h: sys_socket.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(WARN_ON_USE_H) $(ARG_NONNULL_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_SOCKET_H''@|$(NEXT_SYS_SOCKET_H)|g' \
+             -e 's|@''HAVE_SYS_SOCKET_H''@|$(HAVE_SYS_SOCKET_H)|g' \
+             -e 's/@''GNULIB_CLOSE''@/$(GL_M4_GNULIB_CLOSE)/g' \
+             -e 's/@''GNULIB_SOCKET''@/$(GL_M4_GNULIB_SOCKET)/g' \
+             -e 's/@''GNULIB_CONNECT''@/$(GL_M4_GNULIB_CONNECT)/g' \
+             -e 's/@''GNULIB_ACCEPT''@/$(GL_M4_GNULIB_ACCEPT)/g' \
+             -e 's/@''GNULIB_BIND''@/$(GL_M4_GNULIB_BIND)/g' \
+             -e 's/@''GNULIB_GETPEERNAME''@/$(GL_M4_GNULIB_GETPEERNAME)/g' \
+             -e 's/@''GNULIB_GETSOCKNAME''@/$(GL_M4_GNULIB_GETSOCKNAME)/g' \
+             -e 's/@''GNULIB_GETSOCKOPT''@/$(GL_M4_GNULIB_GETSOCKOPT)/g' \
+             -e 's/@''GNULIB_LISTEN''@/$(GL_M4_GNULIB_LISTEN)/g' \
+             -e 's/@''GNULIB_RECV''@/$(GL_M4_GNULIB_RECV)/g' \
+             -e 's/@''GNULIB_SEND''@/$(GL_M4_GNULIB_SEND)/g' \
+             -e 's/@''GNULIB_RECVFROM''@/$(GL_M4_GNULIB_RECVFROM)/g' \
+             -e 's/@''GNULIB_SENDTO''@/$(GL_M4_GNULIB_SENDTO)/g' \
+             -e 's/@''GNULIB_SETSOCKOPT''@/$(GL_M4_GNULIB_SETSOCKOPT)/g' \
+             -e 's/@''GNULIB_SHUTDOWN''@/$(GL_M4_GNULIB_SHUTDOWN)/g' \
+             -e 's/@''GNULIB_ACCEPT4''@/$(GL_M4_GNULIB_ACCEPT4)/g' \
+             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+             -e 's|@''HAVE_WS2TCPIP_H''@|$(HAVE_WS2TCPIP_H)|g' \
+             -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE''@|$(HAVE_STRUCT_SOCKADDR_STORAGE)|g' \
+             -e 's|@''HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY''@|$(HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY)|g' \
+             -e 's|@''HAVE_SA_FAMILY_T''@|$(HAVE_SA_FAMILY_T)|g' \
+             -e 's|@''HAVE_ACCEPT4''@|$(HAVE_ACCEPT4)|g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sys_socket.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+MOSTLYCLEANFILES += sys/socket.h sys/socket.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_socket.in.h
+
+## end   gnulib module sys_socket
+
+## begin gnulib module sys_socket-c++-tests
+
+if ANSICXX
+TESTS += test-sys_socket-c++
+check_PROGRAMS += test-sys_socket-c++
+test_sys_socket_c___SOURCES = test-sys_socket-c++.cc
+test_sys_socket_c___LDADD = $(LDADD) $(LIBINTL) $(LIBSOCKET) $(LIB_NANOSLEEP)
+endif
+EXTRA_DIST += test-sys_socket-c++.cc signature.h
+
+## end   gnulib module sys_socket-c++-tests
+
+## begin gnulib module sys_socket-tests
+
+TESTS += test-sys_socket
+check_PROGRAMS += test-sys_socket
+EXTRA_DIST += test-sys_socket.c
+
+## end   gnulib module sys_socket-tests
+
 ## begin gnulib module sys_stat-c++-tests
 
 if ANSICXX
@@ -1652,6 +2767,40 @@ EXTRA_DIST += test-sys_stat.c
 
 ## end   gnulib module sys_stat-tests
 
+## begin gnulib module sys_time
+
+BUILT_SOURCES += sys/time.h
+
+# We need the following in order to create <sys/time.h> when the system
+# doesn't have one that works with the given compiler.
+sys/time.h: sys_time.in.h $(top_builddir)/config.status $(CXXDEFS_H) $(ARG_NONNULL_H) $(WARN_ON_USE_H)
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's/@''HAVE_SYS_TIME_H''@/$(HAVE_SYS_TIME_H)/g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_TIME_H''@|$(NEXT_SYS_TIME_H)|g' \
+             -e 's/@''GNULIB_GETTIMEOFDAY''@/$(GL_M4_GNULIB_GETTIMEOFDAY)/g' \
+             -e 's|@''HAVE_WINSOCK2_H''@|$(HAVE_WINSOCK2_H)|g' \
+             -e 's/@''HAVE_GETTIMEOFDAY''@/$(HAVE_GETTIMEOFDAY)/g' \
+             -e 's/@''HAVE_STRUCT_TIMEVAL''@/$(HAVE_STRUCT_TIMEVAL)/g' \
+             -e 's/@''REPLACE_GETTIMEOFDAY''@/$(REPLACE_GETTIMEOFDAY)/g' \
+             -e 's/@''REPLACE_STRUCT_TIMEVAL''@/$(REPLACE_STRUCT_TIMEVAL)/g' \
+             -e '/definitions of _GL_FUNCDECL_RPL/r $(CXXDEFS_H)' \
+             -e '/definition of _GL_ARG_NONNULL/r $(ARG_NONNULL_H)' \
+             -e '/definition of _GL_WARN_ON_USE/r $(WARN_ON_USE_H)' \
+             < $(srcdir)/sys_time.in.h; \
+       } > $@-t && \
+       mv $@-t $@
+MOSTLYCLEANFILES += sys/time.h sys/time.h-t
+
+EXTRA_DIST += sys_time.in.h
+
+## end   gnulib module sys_time
+
 ## begin gnulib module sys_time-c++-tests
 
 if ANSICXX
@@ -1691,6 +2840,40 @@ EXTRA_DIST += test-sys_types.c
 
 ## end   gnulib module sys_types-tests
 
+## begin gnulib module sys_uio
+
+BUILT_SOURCES += sys/uio.h
+
+# We need the following in order to create <sys/uio.h> when the system
+# doesn't have one that works with the given compiler.
+sys/uio.h: sys_uio.in.h $(top_builddir)/config.status
+       $(AM_V_at)$(MKDIR_P) sys
+       $(AM_V_GEN)rm -f $@-t $@ && \
+       { echo '/* DO NOT EDIT! GENERATED AUTOMATICALLY! */'; \
+         sed -e 's|@''GUARD_PREFIX''@|GL_M4|g' \
+             -e 's|@''INCLUDE_NEXT''@|$(INCLUDE_NEXT)|g' \
+             -e 's|@''PRAGMA_SYSTEM_HEADER''@|@PRAGMA_SYSTEM_HEADER@|g' \
+             -e 's|@''PRAGMA_COLUMNS''@|@PRAGMA_COLUMNS@|g' \
+             -e 's|@''NEXT_SYS_UIO_H''@|$(NEXT_SYS_UIO_H)|g' \
+             -e 's|@''HAVE_SYS_UIO_H''@|$(HAVE_SYS_UIO_H)|g' \
+             < $(srcdir)/sys_uio.in.h; \
+       } > $@-t && \
+       mv -f $@-t $@
+MOSTLYCLEANFILES += sys/uio.h sys/uio.h-t
+MOSTLYCLEANDIRS += sys
+
+EXTRA_DIST += sys_uio.in.h
+
+## end   gnulib module sys_uio
+
+## begin gnulib module sys_uio-tests
+
+TESTS += test-sys_uio
+check_PROGRAMS += test-sys_uio
+EXTRA_DIST += test-sys_uio.c
+
+## end   gnulib module sys_uio-tests
+
 ## begin gnulib module sys_wait-c++-tests
 
 if ANSICXX
@@ -1718,6 +2901,22 @@ EXTRA_DIST += test-init.sh
 
 ## end   gnulib module test-framework-sh-tests
 
+## begin gnulib module thread
+
+libtests_a_SOURCES += glthread/thread.h glthread/thread.c
+
+## end   gnulib module thread
+
+## begin gnulib module thread-tests
+
+TESTS += test-thread_self test-thread_create
+check_PROGRAMS += test-thread_self test-thread_create
+test_thread_self_LDADD = $(LDADD) @LIBTHREAD@
+test_thread_create_LDADD = $(LDADD) @LIBMULTITHREAD@
+EXTRA_DIST += test-thread_self.c test-thread_create.c macros.h
+
+## end   gnulib module thread-tests
+
 ## begin gnulib module time-c++-tests
 
 if ANSICXX
@@ -1744,7 +2943,7 @@ if ANSICXX
 TESTS += test-unistd-c++
 check_PROGRAMS += test-unistd-c++
 test_unistd_c___SOURCES = test-unistd-c++.cc
-test_unistd_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIBSOCKET)
+test_unistd_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_CLOCK_GETTIME) $(LIB_EACCESS) $(LIBSOCKET) $(LIB_GETLOGIN)
 endif
 EXTRA_DIST += test-unistd-c++.cc signature.h
 
@@ -1766,6 +2965,38 @@ EXTRA_DIST += test-unistd.c
 
 ## end   gnulib module unistd-tests
 
+## begin gnulib module unistr/u8-mbtoucr-tests
+
+TESTS += test-u8-mbtoucr
+check_PROGRAMS += test-u8-mbtoucr
+test_u8_mbtoucr_SOURCES = unistr/test-u8-mbtoucr.c
+test_u8_mbtoucr_LDADD = $(LDADD) $(LIBUNISTRING)
+EXTRA_DIST += unistr/test-u8-mbtoucr.c macros.h
+
+## end   gnulib module unistr/u8-mbtoucr-tests
+
+## begin gnulib module unistr/u8-uctomb-tests
+
+TESTS += test-u8-uctomb
+check_PROGRAMS += test-u8-uctomb
+test_u8_uctomb_SOURCES = unistr/test-u8-uctomb.c
+test_u8_uctomb_LDADD = $(LDADD) $(LIBUNISTRING)
+EXTRA_DIST += unistr/test-u8-uctomb.c macros.h
+
+## end   gnulib module unistr/u8-uctomb-tests
+
+## begin gnulib module uniwidth/width-tests
+
+TESTS += test-uc_width uniwidth/test-uc_width2.sh
+check_PROGRAMS += test-uc_width test-uc_width2
+test_uc_width_SOURCES = uniwidth/test-uc_width.c
+test_uc_width_LDADD = $(LDADD) $(LIBUNISTRING)
+test_uc_width2_SOURCES = uniwidth/test-uc_width2.c
+test_uc_width2_LDADD = $(LDADD) $(LIBUNISTRING)
+EXTRA_DIST += uniwidth/test-uc_width.c uniwidth/test-uc_width2.c uniwidth/test-uc_width2.sh macros.h
+
+## end   gnulib module uniwidth/width-tests
+
 ## begin gnulib module unsetenv
 
 
@@ -1832,12 +3063,15 @@ EXTRA_DIST += test-vc-list-files-git.sh test-vc-list-files-cvs.sh
 TESTS_ENVIRONMENT += MAKE='$(MAKE)'
 TESTS += test-verify test-verify.sh
 check_PROGRAMS += test-verify
+# test-verify-try is never built, but test-verify.sh needs a rule to
+# build test-verify-try.o.
+EXTRA_PROGRAMS += test-verify-try
 
-# This test expects compilation of test-verify.c to fail, and
+# This test expects compilation of test-verify-try.c to fail, and
 # each time it fails, the makefile rule does not perform the usual
 #  "mv -f $name.Tpo $name.po, so tell make clean to remove that file.
-MOSTLYCLEANFILES += .deps/test-verify.Tpo
-EXTRA_DIST += test-verify.c test-verify.sh
+MOSTLYCLEANFILES += .deps/test-verify-try.Tpo
+EXTRA_DIST += test-verify.c test-verify-try.c test-verify.sh
 
 ## end   gnulib module verify-tests
 
@@ -1850,15 +3084,23 @@ EXTRA_DIST += test-version-etc.c test-version-etc.sh
 
 ## end   gnulib module version-etc-tests
 
+## begin gnulib module vma-iter
+
+libtests_a_SOURCES += vma-iter.c
+
+EXTRA_DIST += vma-iter.h
+
+## end   gnulib module vma-iter
+
 ## begin gnulib module wchar-c++-tests
 
 if ANSICXX
 TESTS += test-wchar-c++
 check_PROGRAMS += test-wchar-c++
-test_wchar_c___SOURCES = test-wchar-c++.cc
-test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS)
+test_wchar_c___SOURCES = test-wchar-c++.cc test-wchar-c++2.cc test-wchar-c++3.cc
+test_wchar_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS) $(LIBTHREAD)
 endif
-EXTRA_DIST += test-wchar-c++.cc signature.h
+EXTRA_DIST += test-wchar-c++.cc test-wchar-c++2.cc test-wchar-c++3.cc signature.h
 
 ## end   gnulib module wchar-c++-tests
 
@@ -1875,15 +3117,16 @@ EXTRA_DIST += test-wchar.c
 TESTS += \
   test-wcrtomb.sh \
   test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh \
-  test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh
+  test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32-6.sh \
+  test-wcrtomb-w32-7.sh
 TESTS_ENVIRONMENT += \
   LOCALE_FR='@LOCALE_FR@' \
   LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
   LOCALE_JA='@LOCALE_JA@' \
   LOCALE_ZH_CN='@LOCALE_ZH_CN@'
 check_PROGRAMS += test-wcrtomb test-wcrtomb-w32
-
-EXTRA_DIST += test-wcrtomb.sh test-wcrtomb.c test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32.c signature.h macros.h
+test_wcrtomb_LDADD = $(LDADD) $(LIB_SETLOCALE)
+EXTRA_DIST += test-wcrtomb.sh test-wcrtomb.c test-wcrtomb-w32-1.sh test-wcrtomb-w32-2.sh test-wcrtomb-w32-3.sh test-wcrtomb-w32-4.sh test-wcrtomb-w32-5.sh test-wcrtomb-w32-6.sh test-wcrtomb-w32-7.sh test-wcrtomb-w32.c signature.h macros.h
 
 ## end   gnulib module wcrtomb-tests
 
@@ -1910,10 +3153,10 @@ EXTRA_libtests_a_SOURCES += wctomb.c
 if ANSICXX
 TESTS += test-wctype-h-c++
 check_PROGRAMS += test-wctype-h-c++
-test_wctype_h_c___SOURCES = test-wctype-h-c++.cc
+test_wctype_h_c___SOURCES = test-wctype-h-c++.cc test-wctype-h-c++2.cc
 test_wctype_h_c___LDADD = $(LDADD) $(LIBINTL) $(LIB_NANOSLEEP) $(LIB_EACCESS)
 endif
-EXTRA_DIST += test-wctype-h-c++.cc signature.h
+EXTRA_DIST += test-wctype-h-c++.cc test-wctype-h-c++2.cc signature.h
 
 ## end   gnulib module wctype-h-c++-tests
 
@@ -1925,6 +3168,24 @@ EXTRA_DIST += test-wctype-h.c macros.h
 
 ## end   gnulib module wctype-h-tests
 
+## begin gnulib module wcwidth-tests
+
+TESTS += test-wcwidth
+check_PROGRAMS += test-wcwidth
+test_wcwidth_LDADD = $(LDADD) $(LIB_SETLOCALE) $(LIBUNISTRING)
+EXTRA_DIST += test-wcwidth.c signature.h macros.h
+
+## end   gnulib module wcwidth-tests
+
+## begin gnulib module windows-thread
+
+
+EXTRA_DIST += windows-thread.c windows-thread.h
+
+EXTRA_libtests_a_SOURCES += windows-thread.c
+
+## end   gnulib module windows-thread
+
 ## begin gnulib module write
 
 
@@ -1951,6 +3212,14 @@ EXTRA_DIST += test-xalloc-die.c test-xalloc-die.sh
 
 ## end   gnulib module xalloc-die-tests
 
+## begin gnulib module xconcat-filename
+
+libtests_a_SOURCES += xconcat-filename.c
+
+EXTRA_DIST += concat-filename.h
+
+## end   gnulib module xconcat-filename
+
 ## begin gnulib module xvasprintf-tests
 
 TESTS += test-xvasprintf
@@ -1961,6 +3230,12 @@ EXTRA_DIST += test-xvasprintf.c macros.h
 
 ## end   gnulib module xvasprintf-tests
 
+## begin gnulib module yield
+
+libtests_a_SOURCES += glthread/yield.h
+
+## end   gnulib module yield
+
 # Clean up after Solaris cc.
 clean-local:
        rm -rf SunWS_cache
diff --git a/tests/imaxtostr.c b/tests/imaxtostr.c
new file mode 100644 (file)
index 0000000..b91ac98
--- /dev/null
@@ -0,0 +1,3 @@
+#define anytostr imaxtostr
+#define inttype intmax_t
+#include "anytostr.c"
diff --git a/tests/inet_pton.c b/tests/inet_pton.c
new file mode 100644 (file)
index 0000000..4dd7117
--- /dev/null
@@ -0,0 +1,268 @@
+/* inet_pton.c -- convert IPv4 and IPv6 addresses from text to binary form
+
+   Copyright (C) 2006, 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/*
+ * Copyright (c) 1996,1999 by Internet Software Consortium.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS
+ * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE
+ * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
+ * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
+ * SOFTWARE.
+ */
+
+#include <config.h>
+
+/* Specification.  */
+#include <arpa/inet.h>
+
+#if HAVE_DECL_INET_PTON
+
+# undef inet_pton
+
+int
+rpl_inet_pton (int af, const char *restrict src, void *restrict dst)
+{
+  return inet_pton (af, src, dst);
+}
+
+#else
+
+# include <c-ctype.h>
+# include <string.h>
+# include <errno.h>
+
+# define NS_INADDRSZ 4
+# define NS_IN6ADDRSZ 16
+# define NS_INT16SZ 2
+
+/*
+ * WARNING: Don't even consider trying to compile this on a system where
+ * sizeof(int) < 4.  sizeof(int) > 4 is fine; all the world's not a VAX.
+ */
+
+static int inet_pton4 (const char *src, unsigned char *dst);
+# if HAVE_IPV6
+static int inet_pton6 (const char *src, unsigned char *dst);
+# endif
+
+/* int
+ * inet_pton(af, src, dst)
+ *      convert from presentation format (which usually means ASCII printable)
+ *      to network format (which is usually some kind of binary format).
+ * return:
+ *      1 if the address was valid for the specified address family
+ *      0 if the address wasn't valid ('dst' is untouched in this case)
+ *      -1 if some other error occurred ('dst' is untouched in this case, too)
+ * author:
+ *      Paul Vixie, 1996.
+ */
+int
+inet_pton (int af, const char *restrict src, void *restrict dst)
+{
+  switch (af)
+    {
+    case AF_INET:
+      return (inet_pton4 (src, dst));
+
+# if HAVE_IPV6
+    case AF_INET6:
+      return (inet_pton6 (src, dst));
+# endif
+
+    default:
+      errno = EAFNOSUPPORT;
+      return (-1);
+    }
+  /* NOTREACHED */
+}
+
+/* int
+ * inet_pton4(src, dst)
+ *      like inet_aton() but without all the hexadecimal, octal (with the
+ *      exception of 0) and shorthand.
+ * return:
+ *      1 if 'src' is a valid dotted quad, else 0.
+ * notice:
+ *      does not touch 'dst' unless it's returning 1.
+ * author:
+ *      Paul Vixie, 1996.
+ */
+static int
+inet_pton4 (const char *restrict src, unsigned char *restrict dst)
+{
+  int saw_digit, octets, ch;
+  unsigned char tmp[NS_INADDRSZ], *tp;
+
+  saw_digit = 0;
+  octets = 0;
+  *(tp = tmp) = 0;
+  while ((ch = *src++) != '\0')
+    {
+
+      if (ch >= '0' && ch <= '9')
+        {
+          unsigned new = *tp * 10 + (ch - '0');
+
+          if (saw_digit && *tp == 0)
+            return (0);
+          if (new > 255)
+            return (0);
+          *tp = new;
+          if (!saw_digit)
+            {
+              if (++octets > 4)
+                return (0);
+              saw_digit = 1;
+            }
+        }
+      else if (ch == '.' && saw_digit)
+        {
+          if (octets == 4)
+            return (0);
+          *++tp = 0;
+          saw_digit = 0;
+        }
+      else
+        return (0);
+    }
+  if (octets < 4)
+    return (0);
+  memcpy (dst, tmp, NS_INADDRSZ);
+  return (1);
+}
+
+# if HAVE_IPV6
+
+/* int
+ * inet_pton6(src, dst)
+ *      convert presentation level address to network order binary form.
+ * return:
+ *      1 if 'src' is a valid [RFC1884 2.2] address, else 0.
+ * notice:
+ *      (1) does not touch 'dst' unless it's returning 1.
+ *      (2) :: in a full address is silently ignored.
+ * credit:
+ *      inspired by Mark Andrews.
+ * author:
+ *      Paul Vixie, 1996.
+ */
+static int
+inet_pton6 (const char *restrict src, unsigned char *restrict dst)
+{
+  static const char xdigits[] = "0123456789abcdef";
+  unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp;
+  const char *curtok;
+  int ch, saw_xdigit;
+  unsigned val;
+
+  tp = memset (tmp, '\0', NS_IN6ADDRSZ);
+  endp = tp + NS_IN6ADDRSZ;
+  colonp = NULL;
+  /* Leading :: requires some special handling. */
+  if (*src == ':')
+    if (*++src != ':')
+      return (0);
+  curtok = src;
+  saw_xdigit = 0;
+  val = 0;
+  while ((ch = c_tolower (*src++)) != '\0')
+    {
+      const char *pch;
+
+      pch = strchr (xdigits, ch);
+      if (pch != NULL)
+        {
+          val <<= 4;
+          val |= (pch - xdigits);
+          if (val > 0xffff)
+            return (0);
+          saw_xdigit = 1;
+          continue;
+        }
+      if (ch == ':')
+        {
+          curtok = src;
+          if (!saw_xdigit)
+            {
+              if (colonp)
+                return (0);
+              colonp = tp;
+              continue;
+            }
+          else if (*src == '\0')
+            {
+              return (0);
+            }
+          if (tp + NS_INT16SZ > endp)
+            return (0);
+          *tp++ = (u_char) (val >> 8) & 0xff;
+          *tp++ = (u_char) val & 0xff;
+          saw_xdigit = 0;
+          val = 0;
+          continue;
+        }
+      if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) &&
+          inet_pton4 (curtok, tp) > 0)
+        {
+          tp += NS_INADDRSZ;
+          saw_xdigit = 0;
+          break;                /* '\0' was seen by inet_pton4(). */
+        }
+      return (0);
+    }
+  if (saw_xdigit)
+    {
+      if (tp + NS_INT16SZ > endp)
+        return (0);
+      *tp++ = (u_char) (val >> 8) & 0xff;
+      *tp++ = (u_char) val & 0xff;
+    }
+  if (colonp != NULL)
+    {
+      /*
+       * Since some memmove()'s erroneously fail to handle
+       * overlapping regions, we'll do the shift by hand.
+       */
+      const int n = tp - colonp;
+      int i;
+
+      if (tp == endp)
+        return (0);
+      for (i = 1; i <= n; i++)
+        {
+          endp[-i] = colonp[n - i];
+          colonp[n - i] = 0;
+        }
+      tp = endp;
+    }
+  if (tp != endp)
+    return (0);
+  memcpy (dst, tmp, NS_IN6ADDRSZ);
+  return (1);
+}
+
+# endif
+
+#endif
index 9cf8d00..18fffcc 100644 (file)
@@ -1,5 +1,5 @@
 /* Macros for infinity.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
 /* Infinityf () returns a 'float' +Infinity.  */
 
 /* The Microsoft MSVC 9 compiler chokes on the expression 1.0f / 0.0f.
-   The IBM XL C compiler on z/OS complains.  */
-#if defined _MSC_VER || (defined __MVS__ && defined __IBMC__)
+   The IBM XL C compiler on z/OS complains.
+   PGI 16.10 complains.  */
+#if defined _MSC_VER || (defined __MVS__ && defined __IBMC__) || defined __PGI
 static float
 Infinityf ()
 {
@@ -34,8 +35,9 @@ Infinityf ()
 /* Infinityd () returns a 'double' +Infinity.  */
 
 /* The Microsoft MSVC 9 compiler chokes on the expression 1.0 / 0.0.
-   The IBM XL C compiler on z/OS complains.  */
-#if defined _MSC_VER || (defined __MVS__ && defined __IBMC__)
+   The IBM XL C compiler on z/OS complains.
+   PGI 16.10 complains.  */
+#if defined _MSC_VER || (defined __MVS__ && defined __IBMC__) || defined __PGI
 static double
 Infinityd ()
 {
@@ -50,8 +52,9 @@ Infinityd ()
 /* Infinityl () returns a 'long double' +Infinity.  */
 
 /* The Microsoft MSVC 9 compiler chokes on the expression 1.0L / 0.0L.
-   The IBM XL C compiler on z/OS complains.  */
-#if defined _MSC_VER || (defined __MVS__ && defined __IBMC__)
+   The IBM XL C compiler on z/OS complains.
+   PGI 16.10 complains.  */
+#if defined _MSC_VER || (defined __MVS__ && defined __IBMC__) || defined __PGI
 static long double
 Infinityl ()
 {
index d780110..9ef8348 100644 (file)
@@ -1,6 +1,6 @@
 # source this file; set up for tests
 
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
 # GNU General Public License for more details.
 
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 # Using this file in a test
 # =========================
 #   4. Finally
 #   $ exit
 
+# =============================================================================
+# Elementary diagnostics
+
 ME_=`expr "./$0" : '.*/\(.*\)$'`
 
+# Prepare PATH_SEPARATOR.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  # Determine PATH_SEPARATOR by trying to find /bin/sh in a PATH which
+  # contains only /bin. Note that ksh looks also at the FPATH variable,
+  # so we have to set that as well for the test.
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+    && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 \
+           || PATH_SEPARATOR=';'
+       }
+fi
+
 # We use a trap below for cleanup.  This requires us to go through
 # hoops to get the right exit status transported through the handler.
 # So use 'Exit STATUS' instead of 'exit STATUS' inside of the tests.
@@ -96,26 +112,8 @@ skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
 fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; }
 framework_failure_ () { warn_ "$ME_: set-up failure: $@"; Exit 99; }
 
-# This is used to simplify checking of the return value
-# which is useful when ensuring a command fails as desired.
-# I.e., just doing `command ... &&fail=1` will not catch
-# a segfault in command for example.  With this helper you
-# instead check an explicit exit code like
-#   returns_ 1 command ... || fail
-returns_ () {
-  # Disable tracing so it doesn't interfere with stderr of the wrapped command
-  { set +x; } 2>/dev/null
-
-  local exp_exit="$1"
-  shift
-  "$@"
-  test $? -eq $exp_exit && ret_=0 || ret_=1
-
-  if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then
-    set -x
-  fi
-  { return $ret_; } 2>/dev/null
-}
+# =============================================================================
+# Ensure the shell supports modern syntax.
 
 # Sanitize this shell to POSIX mode, if possible.
 DUALCASE=1; export DUALCASE
@@ -131,6 +129,8 @@ else
 fi
 
 # We require $(...) support unconditionally.
+# We require that the printf built-in work correctly regarding octal escapes;
+# this eliminates /bin/sh on AIX 7.2.
 # We require non-surprising "local" semantics (this eliminates dash).
 # This takes the admittedly draconian step of eliminating dash, because the
 # assignment tab=$(printf '\t') works fine, yet preceding it with "local "
@@ -160,6 +160,12 @@ fi
 #  ? - not ok
 gl_shell_test_script_='
 test $(echo y) = y || exit 1
+LC_ALL=en_US.UTF-8 printf "\\351" 2>/dev/null \
+  | LC_ALL=C tr "\\351" x | LC_ALL=C grep "^x$" > /dev/null \
+  || exit 1
+printf "\\351" 2>/dev/null \
+  | LC_ALL=C tr "\\351" x | LC_ALL=C grep "^x$" > /dev/null \
+  || exit 1
 f_local_() { local v=1; }; f_local_ || exit 1
 f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_
 score_=10
@@ -242,6 +248,9 @@ else
   fi
 fi
 
+# =============================================================================
+# Ensure the shell behaves reasonably.
+
 # If this is bash, turn off all aliases.
 test -n "$BASH_VERSION" && unalias -a
 
@@ -250,101 +259,179 @@ test -n "$BASH_VERSION" && unalias -a
 # That is part of the shell-selection test above.  Why use aliases rather
 # than functions?  Because support for hyphen-containing aliases is more
 # widespread than that for hyphen-containing function names.
-test -n "$EXEEXT" && shopt -s expand_aliases
+test -n "$EXEEXT" && test -n "$BASH_VERSION" && shopt -s expand_aliases
 
-# Enable glibc's malloc-perturbing option.
-# This is useful for exposing code that depends on the fact that
-# malloc-related functions often return memory that is mostly zeroed.
-# If you have the time and cycles, use valgrind to do an even better job.
-: ${MALLOC_PERTURB_=87}
-export MALLOC_PERTURB_
+# =============================================================================
+# Creating a temporary directory (needed by the core test framework)
 
-# This is a stub function that is run upon trap (upon regular exit and
-# interrupt).  Override it with a per-test function, e.g., to unmount
-# a partition, or to undo any other global state changes.
-cleanup_ () { :; }
+# Create a temporary directory, much like mktemp -d does.
+# Written by Jim Meyering.
+#
+# Usage: mktempd_ /tmp phoey.XXXXXXXXXX
+#
+# First, try to use the mktemp program.
+# Failing that, we'll roll our own mktemp-like function:
+#  - try to get random bytes from /dev/urandom
+#  - failing that, generate output from a combination of quickly-varying
+#      sources and gzip.  Ignore non-varying gzip header, and extract
+#      "random" bits from there.
+#  - given those bits, map to file-name bytes using tr, and try to create
+#      the desired directory.
+#  - make only $MAX_TRIES_ attempts
 
-# Emit a header similar to that from diff -u;  Print the simulated "diff"
-# command so that the order of arguments is clear.  Don't bother with @@ lines.
-emit_diff_u_header_ ()
+# Helper function.  Print $N pseudo-random bytes from a-zA-Z0-9.
+rand_bytes_ ()
 {
-  printf '%s\n' "diff -u $*" \
-    "--- $1    1970-01-01" \
-    "+++ $2    1970-01-01"
+  n_=$1
+
+  # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first?
+  # But if they have openssl, they probably have mktemp, too.
+
+  chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
+  dev_rand_=/dev/urandom
+  if test -r "$dev_rand_"; then
+    # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194.
+    dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \
+      | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
+    return
+  fi
+
+  n_plus_50_=`expr $n_ + 50`
+  cmds_='date; date +%N; free; who -a; w; ps auxww; ps -ef'
+  data_=` (eval "$cmds_") 2>&1 | gzip `
+
+  # Ensure that $data_ has length at least 50+$n_
+  while :; do
+    len_=`echo "$data_"|wc -c`
+    test $n_plus_50_ -le $len_ && break;
+    data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip `
+  done
+
+  echo "$data_" \
+    | dd bs=1 skip=50 count=$n_ 2>/dev/null \
+    | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
 }
 
-# Arrange not to let diff or cmp operate on /dev/null,
-# since on some systems (at least OSF/1 5.1), that doesn't work.
-# When there are not two arguments, or no argument is /dev/null, return 2.
-# When one argument is /dev/null and the other is not empty,
-# cat the nonempty file to stderr and return 1.
-# Otherwise, return 0.
-compare_dev_null_ ()
+mktempd_ ()
 {
-  test $# = 2 || return 2
+  case $# in
+  2);;
+  *) fail_ "Usage: mktempd_ DIR TEMPLATE";;
+  esac
 
-  if test "x$1" = x/dev/null; then
-    test -s "$2" || return 0
-    emit_diff_u_header_ "$@"; sed 's/^/+/' "$2"
-    return 1
-  fi
+  destdir_=$1
+  template_=$2
 
-  if test "x$2" = x/dev/null; then
-    test -s "$1" || return 0
-    emit_diff_u_header_ "$@"; sed 's/^/-/' "$1"
-    return 1
-  fi
+  MAX_TRIES_=4
 
-  return 2
+  # Disallow any trailing slash on specified destdir:
+  # it would subvert the post-mktemp "case"-based destdir test.
+  case $destdir_ in
+  / | //) destdir_slash_=$destdir;;
+  */) fail_ "invalid destination dir: remove trailing slash(es)";;
+  *) destdir_slash_=$destdir_/;;
+  esac
+
+  case $template_ in
+  *XXXX) ;;
+  *) fail_ \
+       "invalid template: $template_ (must have a suffix of at least 4 X's)";;
+  esac
+
+  # First, try to use mktemp.
+  d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` &&
+
+  # The resulting name must be in the specified directory.
+  case $d in "$destdir_slash_"*) :;; *) false;; esac &&
+
+  # It must have created the directory.
+  test -d "$d" &&
+
+  # It must have 0700 permissions.  Handle sticky "S" bits.
+  perms=`ls -dgo "$d" 2>/dev/null` &&
+  case $perms in drwx--[-S]---*) :;; *) false;; esac && {
+    echo "$d"
+    return
+  }
+
+  # If we reach this point, we'll have to create a directory manually.
+
+  # Get a copy of the template without its suffix of X's.
+  base_template_=`echo "$template_"|sed 's/XX*$//'`
+
+  # Calculate how many X's we've just removed.
+  template_length_=`echo "$template_" | wc -c`
+  nx_=`echo "$base_template_" | wc -c`
+  nx_=`expr $template_length_ - $nx_`
+
+  err_=
+  i_=1
+  while :; do
+    X_=`rand_bytes_ $nx_`
+    candidate_dir_="$destdir_slash_$base_template_$X_"
+    err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \
+      && { echo "$candidate_dir_"; return; }
+    test $MAX_TRIES_ -le $i_ && break;
+    i_=`expr $i_ + 1`
+  done
+  fail_ "$err_"
 }
 
-for diff_opt_ in -u -U3 -c '' no; do
-  test "$diff_opt_" != no &&
-    diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` &&
-    break
-done
-if test "$diff_opt_" != no; then
-  if test -z "$diff_out_"; then
-    compare_ () { diff $diff_opt_ "$@"; }
-  else
-    compare_ ()
-    {
-      # If no differences were found, AIX and HP-UX 'diff' produce output
-      # like "No differences encountered".  Hide this output.
-      diff $diff_opt_ "$@" > diff.out
-      diff_status_=$?
-      test $diff_status_ -eq 0 || cat diff.out || diff_status_=2
-      rm -f diff.out || diff_status_=2
-      return $diff_status_
-    }
-  fi
-elif cmp -s /dev/null /dev/null 2>/dev/null; then
-  compare_ () { cmp -s "$@"; }
-else
-  compare_ () { cmp "$@"; }
-fi
+# =============================================================================
+# Core test framework
 
-# Usage: compare EXPECTED ACTUAL
-#
-# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more.
-# Otherwise, propagate $? to caller: any diffs have already been printed.
-compare ()
+# An arbitrary prefix to help distinguish test directories.
+testdir_prefix_ () { printf gt; }
+
+# Set up the environment for the test to run in.
+setup_ ()
 {
-  # This looks like it can be factored to use a simple "case $?"
-  # after unchecked compare_dev_null_ invocation, but that would
-  # fail in a "set -e" environment.
-  if compare_dev_null_ "$@"; then
-    return 0
-  else
-    case $? in
-      1) return 1;;
-      *) compare_ "$@";;
-    esac
+  if test "$VERBOSE" = yes; then
+    # Test whether set -x may cause the selected shell to corrupt an
+    # application's stderr.  Many do, including zsh-4.3.10 and the /bin/sh
+    # from SunOS 5.11, OpenBSD 4.7 and Irix 6.5.
+    # If enabling verbose output this way would cause trouble, simply
+    # issue a warning and refrain.
+    if $gl_set_x_corrupts_stderr_; then
+      warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr"
+    else
+      set -x
+    fi
   fi
+
+  initial_cwd_=$PWD
+
+  # Create and enter the temporary directory.
+  pfx_=`testdir_prefix_`
+  test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
+    || fail_ "failed to create temporary directory in $initial_cwd_"
+  cd "$test_dir_" || fail_ "failed to cd to temporary directory"
+  # Set variables srcdir, builddir, for the convenience of the test.
+  case $srcdir in
+    /* | ?:*) ;;
+    *) srcdir="../$srcdir" ;;
+  esac
+  builddir=".."
+  export srcdir builddir
+
+  # As autoconf-generated configure scripts do, ensure that IFS
+  # is defined initially, so that saving and restoring $IFS works.
+  gl_init_sh_nl_='
+'
+  IFS=" ""     $gl_init_sh_nl_"
+
+  # This trap statement, along with a trap on 0 below, ensure that the
+  # temporary directory, $test_dir_, is removed upon exit as well as
+  # upon receipt of any of the listed signals.
+  for sig_ in 1 2 3 13 15; do
+    eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
+  done
 }
 
-# An arbitrary prefix to help distinguish test directories.
-testdir_prefix_ () { printf gt; }
+# This is a stub function that is run upon trap (upon regular exit and
+# interrupt).  Override it with a per-test function, e.g., to unmount
+# a partition, or to undo any other global state changes.
+cleanup_ () { :; }
 
 # Run the user-overridable cleanup_ function, remove the temporary
 # directory and exit with the incoming value of $?.
@@ -364,6 +451,9 @@ remove_tmp_ ()
   exit $__st
 }
 
+# =============================================================================
+# Prepending directories to PATH
+
 # Given a directory name, DIR, if every entry in it that matches *.exe
 # contains only the specified bytes (see the case stmt below), then print
 # a space-separated list of those names and return 0.  Otherwise, don't
@@ -429,13 +519,13 @@ path_prepend_ ()
     path_dir_=$1
     case $path_dir_ in
       '') fail_ "invalid path dir: '$1'";;
-      /*) abs_path_dir_=$path_dir_;;
+      /* | ?:*) abs_path_dir_=$path_dir_;;
       *) abs_path_dir_=$initial_cwd_/$path_dir_;;
     esac
     case $abs_path_dir_ in
-      *:*) fail_ "invalid path dir: '$abs_path_dir_'";;
+      *$PATH_SEPARATOR*) fail_ "invalid path dir: '$abs_path_dir_'";;
     esac
-    PATH="$abs_path_dir_:$PATH"
+    PATH="$abs_path_dir_$PATH_SEPARATOR$PATH"
 
     # Create an alias, FOO, for each FOO.exe in this directory.
     create_exe_shims_ "$abs_path_dir_" \
@@ -445,160 +535,148 @@ path_prepend_ ()
   export PATH
 }
 
-setup_ ()
-{
-  if test "$VERBOSE" = yes; then
-    # Test whether set -x may cause the selected shell to corrupt an
-    # application's stderr.  Many do, including zsh-4.3.10 and the /bin/sh
-    # from SunOS 5.11, OpenBSD 4.7 and Irix 5.x and 6.5.
-    # If enabling verbose output this way would cause trouble, simply
-    # issue a warning and refrain.
-    if $gl_set_x_corrupts_stderr_; then
-      warn_ "using SHELL=$SHELL with 'set -x' corrupts stderr"
-    else
-      set -x
-    fi
-  fi
+# =============================================================================
+# Convenience environment variables for the tests
 
-  initial_cwd_=$PWD
+# -----------------------------------------------------------------------------
 
-  pfx_=`testdir_prefix_`
-  test_dir_=`mktempd_ "$initial_cwd_" "$pfx_-$ME_.XXXX"` \
-    || fail_ "failed to create temporary directory in $initial_cwd_"
-  cd "$test_dir_" || fail_ "failed to cd to temporary directory"
+# Enable glibc's malloc-perturbing option.
+# This is useful for exposing code that depends on the fact that
+# malloc-related functions often return memory that is mostly zeroed.
+# If you have the time and cycles, use valgrind to do an even better job.
+: ${MALLOC_PERTURB_=87}
+export MALLOC_PERTURB_
 
-  # As autoconf-generated configure scripts do, ensure that IFS
-  # is defined initially, so that saving and restoring $IFS works.
-  gl_init_sh_nl_='
-'
-  IFS=" ""     $gl_init_sh_nl_"
+# -----------------------------------------------------------------------------
 
-  # This trap statement, along with a trap on 0 below, ensure that the
-  # temporary directory, $test_dir_, is removed upon exit as well as
-  # upon receipt of any of the listed signals.
-  for sig_ in 1 2 3 13 15; do
-    eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
-  done
-}
+# The interpreter for Bourne-shell scripts.
+# No special standards compatibility requirements.
+# Some environments, such as Android, don't have /bin/sh.
+if test -f /bin/sh$EXEEXT; then
+  BOURNE_SHELL=/bin/sh
+else
+  BOURNE_SHELL=sh
+fi
 
-# Create a temporary directory, much like mktemp -d does.
-# Written by Jim Meyering.
-#
-# Usage: mktempd_ /tmp phoey.XXXXXXXXXX
-#
-# First, try to use the mktemp program.
-# Failing that, we'll roll our own mktemp-like function:
-#  - try to get random bytes from /dev/urandom
-#  - failing that, generate output from a combination of quickly-varying
-#      sources and gzip.  Ignore non-varying gzip header, and extract
-#      "random" bits from there.
-#  - given those bits, map to file-name bytes using tr, and try to create
-#      the desired directory.
-#  - make only $MAX_TRIES_ attempts
+# =============================================================================
+# Convenience functions for the tests
 
-# Helper function.  Print $N pseudo-random bytes from a-zA-Z0-9.
-rand_bytes_ ()
-{
-  n_=$1
+# -----------------------------------------------------------------------------
+# Return value checking
 
-  # Maybe try openssl rand -base64 $n_prime_|tr '+/=\012' abcd first?
-  # But if they have openssl, they probably have mktemp, too.
+# This is used to simplify checking of the return value
+# which is useful when ensuring a command fails as desired.
+# I.e., just doing `command ... &&fail=1` will not catch
+# a segfault in command for example.  With this helper you
+# instead check an explicit exit code like
+#   returns_ 1 command ... || fail
+returns_ () {
+  # Disable tracing so it doesn't interfere with stderr of the wrapped command
+  { set +x; } 2>/dev/null
 
-  chars_=abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
-  dev_rand_=/dev/urandom
-  if test -r "$dev_rand_"; then
-    # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194.
-    dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \
-      | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
-    return
-  fi
+  local exp_exit="$1"
+  shift
+  "$@"
+  test $? -eq $exp_exit && ret_=0 || ret_=1
 
-  n_plus_50_=`expr $n_ + 50`
-  cmds_='date; date +%N; free; who -a; w; ps auxww; ps ef; netstat -n'
-  data_=` (eval "$cmds_") 2>&1 | gzip `
+  if test "$VERBOSE" = yes && test "$gl_set_x_corrupts_stderr_" = false; then
+    set -x
+  fi
+  { return $ret_; } 2>/dev/null
+}
 
-  # Ensure that $data_ has length at least 50+$n_
-  while :; do
-    len_=`echo "$data_"|wc -c`
-    test $n_plus_50_ -le $len_ && break;
-    data_=` (echo "$data_"; eval "$cmds_") 2>&1 | gzip `
-  done
+# -----------------------------------------------------------------------------
+# Text file comparison
 
-  echo "$data_" \
-    | dd bs=1 skip=50 count=$n_ 2>/dev/null \
-    | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
+# Emit a header similar to that from diff -u;  Print the simulated "diff"
+# command so that the order of arguments is clear.  Don't bother with @@ lines.
+emit_diff_u_header_ ()
+{
+  printf '%s\n' "diff -u $*" \
+    "--- $1    1970-01-01" \
+    "+++ $2    1970-01-01"
 }
 
-mktempd_ ()
+# Arrange not to let diff or cmp operate on /dev/null,
+# since on some systems (at least OSF/1 5.1), that doesn't work.
+# When there are not two arguments, or no argument is /dev/null, return 2.
+# When one argument is /dev/null and the other is not empty,
+# cat the nonempty file to stderr and return 1.
+# Otherwise, return 0.
+compare_dev_null_ ()
 {
-  case $# in
-  2);;
-  *) fail_ "Usage: mktempd_ DIR TEMPLATE";;
-  esac
-
-  destdir_=$1
-  template_=$2
-
-  MAX_TRIES_=4
-
-  # Disallow any trailing slash on specified destdir:
-  # it would subvert the post-mktemp "case"-based destdir test.
-  case $destdir_ in
-  / | //) destdir_slash_=$destdir;;
-  */) fail_ "invalid destination dir: remove trailing slash(es)";;
-  *) destdir_slash_=$destdir_/;;
-  esac
-
-  case $template_ in
-  *XXXX) ;;
-  *) fail_ \
-       "invalid template: $template_ (must have a suffix of at least 4 X's)";;
-  esac
-
-  # First, try to use mktemp.
-  d=`unset TMPDIR; { mktemp -d -t -p "$destdir_" "$template_"; } 2>/dev/null` &&
-
-  # The resulting name must be in the specified directory.
-  case $d in "$destdir_slash_"*) :;; *) false;; esac &&
-
-  # It must have created the directory.
-  test -d "$d" &&
+  test $# = 2 || return 2
 
-  # It must have 0700 permissions.  Handle sticky "S" bits.
-  perms=`ls -dgo "$d" 2>/dev/null` &&
-  case $perms in drwx--[-S]---*) :;; *) false;; esac && {
-    echo "$d"
-    return
-  }
+  if test "x$1" = x/dev/null; then
+    test -s "$2" || return 0
+    emit_diff_u_header_ "$@"; sed 's/^/+/' "$2"
+    return 1
+  fi
 
-  # If we reach this point, we'll have to create a directory manually.
+  if test "x$2" = x/dev/null; then
+    test -s "$1" || return 0
+    emit_diff_u_header_ "$@"; sed 's/^/-/' "$1"
+    return 1
+  fi
 
-  # Get a copy of the template without its suffix of X's.
-  base_template_=`echo "$template_"|sed 's/XX*$//'`
+  return 2
+}
 
-  # Calculate how many X's we've just removed.
-  template_length_=`echo "$template_" | wc -c`
-  nx_=`echo "$base_template_" | wc -c`
-  nx_=`expr $template_length_ - $nx_`
+for diff_opt_ in -u -U3 -c '' no; do
+  test "$diff_opt_" != no &&
+    diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` &&
+    break
+done
+if test "$diff_opt_" != no; then
+  if test -z "$diff_out_"; then
+    compare_ () { diff $diff_opt_ "$@"; }
+  else
+    compare_ ()
+    {
+      # If no differences were found, AIX and HP-UX 'diff' produce output
+      # like "No differences encountered".  Hide this output.
+      diff $diff_opt_ "$@" > diff.out
+      diff_status_=$?
+      test $diff_status_ -eq 0 || cat diff.out || diff_status_=2
+      rm -f diff.out || diff_status_=2
+      return $diff_status_
+    }
+  fi
+elif cmp -s /dev/null /dev/null 2>/dev/null; then
+  compare_ () { cmp -s "$@"; }
+else
+  compare_ () { cmp "$@"; }
+fi
 
-  err_=
-  i_=1
-  while :; do
-    X_=`rand_bytes_ $nx_`
-    candidate_dir_="$destdir_slash_$base_template_$X_"
-    err_=`mkdir -m 0700 "$candidate_dir_" 2>&1` \
-      && { echo "$candidate_dir_"; return; }
-    test $MAX_TRIES_ -le $i_ && break;
-    i_=`expr $i_ + 1`
-  done
-  fail_ "$err_"
+# Usage: compare EXPECTED ACTUAL
+#
+# Given compare_dev_null_'s preprocessing, defer to compare_ if 2 or more.
+# Otherwise, propagate $? to caller: any diffs have already been printed.
+compare ()
+{
+  # This looks like it can be factored to use a simple "case $?"
+  # after unchecked compare_dev_null_ invocation, but that would
+  # fail in a "set -e" environment.
+  if compare_dev_null_ "$@"; then
+    return 0
+  else
+    case $? in
+      1) return 1;;
+      *) compare_ "$@";;
+    esac
+  fi
 }
 
+# -----------------------------------------------------------------------------
+
 # If you want to override the testdir_prefix_ function,
 # or to add more utility functions, use this file.
 test -f "$srcdir/init.cfg" \
   && . "$srcdir/init.cfg"
 
+# =============================================================================
+# Set up the environment for the test to run in.
+
 setup_ "$@"
 # This trap is here, rather than in the setup_ function, because some
 # shells run the exit trap at shell function exit, rather than script exit.
diff --git a/tests/inttostr.c b/tests/inttostr.c
new file mode 100644 (file)
index 0000000..c96b5ca
--- /dev/null
@@ -0,0 +1,3 @@
+#define anytostr inttostr
+#define inttype int
+#include "anytostr.c"
diff --git a/tests/inttostr.h b/tests/inttostr.h
new file mode 100644 (file)
index 0000000..8fc22aa
--- /dev/null
@@ -0,0 +1,29 @@
+/* inttostr.h -- convert integers to printable strings
+
+   Copyright (C) 2001-2006, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert */
+
+#include <stdint.h>
+#include <sys/types.h>
+
+#include "intprops.h"
+
+char *imaxtostr (intmax_t, char *) _GL_ATTRIBUTE_NODISCARD;
+char *inttostr (int, char *) _GL_ATTRIBUTE_NODISCARD;
+char *offtostr (off_t, char *) _GL_ATTRIBUTE_NODISCARD;
+char *uinttostr (unsigned int, char *) _GL_ATTRIBUTE_NODISCARD;
+char *umaxtostr (uintmax_t, char *) _GL_ATTRIBUTE_NODISCARD;
diff --git a/tests/ioctl.c b/tests/ioctl.c
new file mode 100644 (file)
index 0000000..5c5e7a4
--- /dev/null
@@ -0,0 +1,92 @@
+/* ioctl.c --- wrappers for Windows ioctl function
+
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#include <sys/ioctl.h>
+
+#include <stdarg.h>
+
+#if HAVE_IOCTL
+
+/* Provide a wrapper with the POSIX prototype.  */
+# undef ioctl
+int
+rpl_ioctl (int fd, int request, ... /* {void *,char *} arg */)
+{
+  void *buf;
+  va_list args;
+
+  va_start (args, request);
+  buf = va_arg (args, void *);
+  va_end (args);
+
+  /* Cast 'request' so that when the system's ioctl function takes a 64-bit
+     request argument, the value gets zero-extended, not sign-extended.  */
+  return ioctl (fd, (unsigned int) request, buf);
+}
+
+#else /* mingw */
+
+# include <errno.h>
+
+/* Get HANDLE.  */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+# include "fd-hook.h"
+/* Get _get_osfhandle.  */
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
+
+static int
+primary_ioctl (int fd, int request, void *arg)
+{
+  /* We don't support FIONBIO on pipes here.  If you want to make pipe
+     fds non-blocking, use the gnulib 'nonblocking' module, until
+     gnulib implements fcntl F_GETFL / F_SETFL with O_NONBLOCK.  */
+
+  if ((HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE)
+    errno = ENOSYS;
+  else
+    errno = EBADF;
+  return -1;
+}
+
+int
+ioctl (int fd, int request, ... /* {void *,char *} arg */)
+{
+  void *arg;
+  va_list args;
+
+  va_start (args, request);
+  arg = va_arg (args, void *);
+  va_end (args);
+
+# if WINDOWS_SOCKETS
+  return execute_all_ioctl_hooks (primary_ioctl, fd, request, arg);
+# else
+  return primary_ioctl (fd, request, arg);
+# endif
+}
+
+#endif
index 6cc7379..44a9a20 100644 (file)
@@ -1,6 +1,6 @@
 /* Test whether a character is a blank.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index b8d7caa..7756ccb 100644 (file)
@@ -1,6 +1,6 @@
 /* Emulate link on platforms that lack it, namely native Windows platforms.
 
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include <sys/stat.h>
 
 #if !HAVE_LINK
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
 
 #  define WIN32_LEAN_AND_MEAN
 #  include <windows.h>
 
+/* Don't assume that UNICODE is not defined.  */
+#  undef GetModuleHandle
+#  define GetModuleHandle GetModuleHandleA
+#  undef CreateHardLink
+#  define CreateHardLink CreateHardLinkA
+
+#  if !(_WIN32_WINNT >= _WIN32_WINNT_WINXP)
+
+/* Avoid warnings from gcc -Wcast-function-type.  */
+#   define GetProcAddress \
+     (void *) GetProcAddress
+
 /* CreateHardLink was introduced only in Windows 2000.  */
-typedef BOOL (WINAPI * CreateHardLinkFuncType) (LPCTSTR lpFileName,
-                                                LPCTSTR lpExistingFileName,
+typedef BOOL (WINAPI * CreateHardLinkFuncType) (LPCSTR lpFileName,
+                                                LPCSTR lpExistingFileName,
                                                 LPSECURITY_ATTRIBUTES lpSecurityAttributes);
 static CreateHardLinkFuncType CreateHardLinkFunc = NULL;
 static BOOL initialized = FALSE;
@@ -49,30 +61,48 @@ initialize (void)
   initialized = TRUE;
 }
 
+#  else
+
+#   define CreateHardLinkFunc CreateHardLink
+
+#  endif
+
 int
 link (const char *file1, const char *file2)
 {
   char *dir;
   size_t len1 = strlen (file1);
   size_t len2 = strlen (file2);
+
+#  if !(_WIN32_WINNT >= _WIN32_WINNT_WINXP)
   if (!initialized)
     initialize ();
+#  endif
+
   if (CreateHardLinkFunc == NULL)
     {
       /* System does not support hard links.  */
       errno = EPERM;
       return -1;
     }
-  /* Reject trailing slashes on non-directories; mingw does not
+  /* Reject trailing slashes on non-directories; native Windows does not
      support hard-linking directories.  */
   if ((len1 && (file1[len1 - 1] == '/' || file1[len1 - 1] == '\\'))
       || (len2 && (file2[len2 - 1] == '/' || file2[len2 - 1] == '\\')))
     {
+      /* If stat() fails, then link() should fail for the same reason.  */
       struct stat st;
-      if (stat (file1, &st) == 0 && S_ISDIR (st.st_mode))
-        errno = EPERM;
-      else
+      if (stat (file1, &st))
+        {
+          if (errno == EOVERFLOW)
+            /* It's surely a file, not a directory (see stat-w32.c).  */
+            errno = ENOTDIR;
+          return -1;
+        }
+      if (!S_ISDIR (st.st_mode))
         errno = ENOTDIR;
+      else
+        errno = EPERM;
       return -1;
     }
   /* CreateHardLink("b/.","a",NULL) creates file "b", so we must check
@@ -85,11 +115,9 @@ link (const char *file1, const char *file2)
     char *p = strchr (dir, '\0');
     while (dir < p && (*--p != '/' && *p != '\\'));
     *p = '\0';
-    if (p != dir && stat (dir, &st) == -1)
+    if (p != dir && stat (dir, &st) != 0 && errno != EOVERFLOW)
       {
-        int saved_errno = errno;
         free (dir);
-        errno = saved_errno;
         return -1;
       }
     free (dir);
@@ -159,7 +187,7 @@ rpl_link (char const *file1, char const *file2)
   struct stat st;
 
   /* Don't allow IRIX to dereference dangling file2 symlink.  */
-  if (!lstat (file2, &st))
+  if (lstat (file2, &st) == 0 || errno == EOVERFLOW)
     {
       errno = EEXIST;
       return -1;
@@ -196,11 +224,9 @@ rpl_link (char const *file1, char const *file2)
       if (p)
         {
           *p = '\0';
-          if (stat (dir, &st) == -1)
+          if (stat (dir, &st) != 0 && errno != EOVERFLOW)
             {
-              int saved_errno = errno;
               free (dir);
-              errno = saved_errno;
               return -1;
             }
         }
diff --git a/tests/listen.c b/tests/listen.c
new file mode 100644 (file)
index 0000000..0645e2e
--- /dev/null
@@ -0,0 +1,49 @@
+/* listen.c --- wrappers for Windows listen function
+
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef listen
+
+int
+rpl_listen (int fd, int backlog)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+
+  if (sock == INVALID_SOCKET)
+    {
+      errno = EBADF;
+      return -1;
+    }
+  else
+    {
+      int r = listen (sock, backlog);
+      if (r < 0)
+        set_winsock_errno ();
+
+      return r;
+    }
+}
diff --git a/tests/locale.c b/tests/locale.c
new file mode 100644 (file)
index 0000000..6185c4d
--- /dev/null
@@ -0,0 +1,85 @@
+/* Program that prints the names of the categories of the current locale.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/* We want to use the system's setlocale() function here, not the gnulib
+   override.  */
+#undef setlocale
+
+/* Specification:
+   <https://pubs.opengroup.org/onlinepubs/9699919799/utilities/locale.html>
+   Here we implement only the invocation without any command-line options.  */
+
+static const char *
+defaulted_getenv (const char *variable)
+{
+  const char *value = getenv (variable);
+  return (value != NULL ? value : "");
+}
+
+static void
+print_category (int category, const char *variable)
+{
+  const char *value = defaulted_getenv (variable);
+  if (value[0] != '\0' && defaulted_getenv ("LC_ALL")[0] == '\0')
+    /* The variable is set in the environment and not overridden by LC_ALL.  */
+    printf ("%s=%s\n", variable, value);
+  else
+    printf ("%s=\"%s\"\n", variable, setlocale (category, NULL));
+}
+
+int
+main (void)
+{
+  setlocale (LC_ALL, "");
+
+  printf ("LANG=%s\n", defaulted_getenv ("LANG"));
+  print_category (LC_CTYPE, "LC_CTYPE");
+  print_category (LC_NUMERIC, "LC_NUMERIC");
+  print_category (LC_TIME, "LC_TIME");
+  print_category (LC_COLLATE, "LC_COLLATE");
+  print_category (LC_MONETARY, "LC_MONETARY");
+  print_category (LC_MESSAGES, "LC_MESSAGES");
+#ifdef LC_PAPER
+  print_category (LC_PAPER, "LC_PAPER");
+#endif
+#ifdef LC_NAME
+  print_category (LC_NAME, "LC_NAME");
+#endif
+#ifdef LC_ADDRESS
+  print_category (LC_ADDRESS, "LC_ADDRESS");
+#endif
+#ifdef LC_TELEPHONE
+  print_category (LC_TELEPHONE, "LC_TELEPHONE");
+#endif
+#ifdef LC_MEASUREMENT
+  print_category (LC_MEASUREMENT, "LC_MEASUREMENT");
+#endif
+#ifdef LC_IDENTIFICATION
+  print_category (LC_IDENTIFICATION, "LC_IDENTIFICATION");
+#endif
+
+  printf ("LC_ALL=%s\n", defaulted_getenv ("LC_ALL"));
+
+  return 0;
+}
index 578bfe7..fccfc50 100644 (file)
@@ -1,5 +1,5 @@
 /* Common macros used by gnulib tests.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
 /* This file contains macros that are used by many gnulib tests.
 #include <stdio.h>
 #include <stdlib.h>
 
+#ifndef FALLTHROUGH
+# if (__GNUC__ >= 7) || (__clang_major__ >= 10)
+#  define FALLTHROUGH __attribute__ ((__fallthrough__))
+# else
+#  define FALLTHROUGH ((void) 0)
+# endif
+#endif
+
 /* Define ASSERT_STREAM before including this file if ASSERT must
    target a stream other than stderr.  */
 #ifndef ASSERT_STREAM
     {                                                                        \
       if (!(expr))                                                           \
         {                                                                    \
-          fprintf (ASSERT_STREAM, "%s:%d: assertion '%s' failed\n",     \
-                   __FILE__, __LINE__, #expr);                          \
+          fprintf (ASSERT_STREAM, "%s:%d: assertion '%s' failed\n",          \
+                   __FILE__, __LINE__, #expr);                               \
           fflush (ASSERT_STREAM);                                            \
           abort ();                                                          \
         }                                                                    \
     }                                                                        \
   while (0)
 
+/* Like ASSERT, except that it uses no stdio.
+   Requires #include <string.h> and #include <unistd.h>.  */
+#define ASSERT_NO_STDIO(expr) \
+  do                                                        \
+    {                                                       \
+      if (!(expr))                                          \
+        {                                                   \
+          WRITE_TO_STDERR (__FILE__);                       \
+          WRITE_TO_STDERR (":");                            \
+          WRITE_MACROEXPANDED_INTEGER_TO_STDERR (__LINE__); \
+          WRITE_TO_STDERR (": assertion '");                \
+          WRITE_TO_STDERR (#expr);                          \
+          WRITE_TO_STDERR ("' failed\n");                   \
+          abort ();                                         \
+        }                                                   \
+    }                                                       \
+  while (0)
+#define WRITE_MACROEXPANDED_INTEGER_TO_STDERR(integer) \
+  WRITE_INTEGER_TO_STDERR(integer)
+#define WRITE_INTEGER_TO_STDERR(integer) \
+  WRITE_TO_STDERR (#integer)
+#define WRITE_TO_STDERR(string_literal) \
+  {                                     \
+    const char *s = string_literal;     \
+    int ret = write (2, s, strlen (s)); \
+    (void) ret;                         \
+  }
+
 /* SIZEOF (array)
    returns the number of elements of an array.  It works for arrays that are
    declared outside functions and for local variables of array type.  It does
index d10d060..275da03 100644 (file)
@@ -1,5 +1,5 @@
 /* Macros for floating-point negative zero.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Keep in sync with m4/minus-zero.m4!  */
 
diff --git a/tests/mmap-anon-util.h b/tests/mmap-anon-util.h
new file mode 100644 (file)
index 0000000..6fb82ef
--- /dev/null
@@ -0,0 +1,97 @@
+/* Some auxiliary stuff for using mmap & friends.
+   Copyright (C) 2002-2021  Bruno Haible <bruno@clisp.org>
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#if defined _WIN32 && !defined __CYGWIN__
+
+/* ------------------------ Windows ------------------------ */
+
+# define WIN32_LEAN_AND_MEAN /* avoid including junk */
+# include <windows.h>
+# include <winerror.h>
+# define PROT_NONE PAGE_NOACCESS
+# define PROT_READ PAGE_READONLY
+# define PROT_READ_WRITE PAGE_READWRITE
+
+static void *
+mmap_zeromap (void *map_addr_hint, size_t map_len)
+{
+  if (VirtualAlloc ((void *)((uintptr_t) map_addr_hint & -0x10000),
+                    (((uintptr_t) map_addr_hint + map_len - 1) | 0xffff) + 1
+                    - ((uintptr_t) map_addr_hint & -0x10000),
+                    MEM_RESERVE, PAGE_NOACCESS)
+      && VirtualAlloc (map_addr_hint, map_len, MEM_COMMIT, PAGE_READWRITE))
+    return map_addr_hint;
+  else
+    return (void *)(-1);
+}
+
+int
+munmap (void *addr, size_t len)
+{
+  if (VirtualFree (addr, len, MEM_DECOMMIT))
+    return 0;
+  else
+    return -1;
+}
+
+int
+mprotect (void *addr, size_t len, int prot)
+{
+  DWORD oldprot;
+
+  if (VirtualProtect (addr, len, prot, &oldprot))
+    return 0;
+  else
+    return -1;
+}
+
+#else
+
+/* ------------------------ Unix ------------------------ */
+
+# include <sys/types.h>
+# include <sys/mman.h>
+# include <fcntl.h>
+
+# ifndef PROT_NONE
+#  define PROT_NONE 0
+# endif
+# define PROT_READ_WRITE  (PROT_READ|PROT_WRITE)
+
+# if HAVE_MAP_ANONYMOUS
+#  define zero_fd -1
+#  define map_flags MAP_ANONYMOUS | MAP_PRIVATE
+# else
+#  ifndef MAP_FILE
+#   define MAP_FILE 0
+#  endif
+static int zero_fd;
+#  define map_flags MAP_FILE | MAP_PRIVATE
+# endif
+
+static void *
+mmap_zeromap (void *map_addr_hint, size_t map_len)
+{
+# ifdef __hpux
+  /* HP-UX 10 mmap() often fails when given a hint.  So give the OS complete
+     freedom about the address range.  */
+  return (void *) mmap ((void *) 0,    map_len, PROT_READ_WRITE, map_flags, zero_fd, 0);
+# else
+  return (void *) mmap (map_addr_hint, map_len, PROT_READ_WRITE, map_flags, zero_fd, 0);
+# endif
+}
+
+#endif
index 40045f2..6926d22 100644 (file)
@@ -1,5 +1,5 @@
 /* Macros for not-a-number.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 
 /* IBM z/OS supports both hexadecimal and IEEE floating-point formats. The
 /* NaNf () returns a 'float' not-a-number.  */
 
 /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke
-   on the expression 0.0 / 0.0.  The IBM XL C compiler on z/OS complains.  */
-#if defined __DECC || defined _MSC_VER || (defined __MVS__ && defined __IBMC__)
+   on the expression 0.0 / 0.0.  The IBM XL C compiler on z/OS complains.
+   PGI 16.10 complains.  */
+#if (defined __DECC || defined _MSC_VER \
+     || (defined __MVS__ && defined __IBMC__)   \
+     || defined __PGI)
 static float
 NaNf ()
 {
@@ -41,8 +44,11 @@ NaNf ()
 /* NaNd () returns a 'double' not-a-number.  */
 
 /* The Compaq (ex-DEC) C 6.4 compiler and the Microsoft MSVC 9 compiler choke
-   on the expression 0.0 / 0.0.  The IBM XL C compiler on z/OS complains.  */
-#if defined __DECC || defined _MSC_VER || (defined __MVS__ && defined __IBMC__)
+   on the expression 0.0 / 0.0.  The IBM XL C compiler on z/OS complains.
+   PGI 16.10 complains.  */
+#if (defined __DECC || defined _MSC_VER \
+     || (defined __MVS__ && defined __IBMC__)   \
+     || defined __PGI)
 static double
 NaNd ()
 {
@@ -59,14 +65,15 @@ NaNd ()
 /* On Irix 6.5, gcc 3.4.3 can't compute compile-time NaN, and needs the
    runtime type conversion.
    The Microsoft MSVC 9 compiler chokes on the expression 0.0L / 0.0L.
-   The IBM XL C compiler on z/OS complains.  */
+   The IBM XL C compiler on z/OS complains.
+   PGI 16.10 complains.  */
 #ifdef __sgi
 static long double NaNl ()
 {
   double zero = 0.0;
   return zero / zero;
 }
-#elif defined _MSC_VER || (defined __MVS__ && defined __IBMC__)
+#elif defined _MSC_VER || (defined __MVS__ && defined __IBMC__) || defined __PGI
 static long double
 NaNl ()
 {
diff --git a/tests/nanosleep.c b/tests/nanosleep.c
new file mode 100644 (file)
index 0000000..b8146d8
--- /dev/null
@@ -0,0 +1,276 @@
+/* Provide a replacement for the POSIX nanosleep function.
+
+   Copyright (C) 1999-2000, 2002, 2004-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* written by Jim Meyering
+   and Bruno Haible for the native Windows part */
+
+#include <config.h>
+
+#include <time.h>
+
+#include "intprops.h"
+#include "sig-handler.h"
+#include "verify.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#include <signal.h>
+
+#include <sys/time.h>
+#include <errno.h>
+
+#include <unistd.h>
+
+
+enum { BILLION = 1000 * 1000 * 1000 };
+
+#if HAVE_BUG_BIG_NANOSLEEP
+
+int
+nanosleep (const struct timespec *requested_delay,
+           struct timespec *remaining_delay)
+# undef nanosleep
+{
+  /* nanosleep mishandles large sleeps due to internal overflow problems.
+     The worst known case of this is Linux 2.6.9 with glibc 2.3.4, which
+     can't sleep more than 24.85 days (2^31 milliseconds).  Similarly,
+     cygwin 1.5.x, which can't sleep more than 49.7 days (2^32 milliseconds).
+     Solve this by breaking the sleep up into smaller chunks.  */
+
+  if (requested_delay->tv_nsec < 0 || BILLION <= requested_delay->tv_nsec)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+
+  {
+    /* Verify that time_t is large enough.  */
+    verify (TYPE_MAXIMUM (time_t) / 24 / 24 / 60 / 60);
+    const time_t limit = 24 * 24 * 60 * 60;
+    time_t seconds = requested_delay->tv_sec;
+    struct timespec intermediate;
+    intermediate.tv_nsec = requested_delay->tv_nsec;
+
+    while (limit < seconds)
+      {
+        int result;
+        intermediate.tv_sec = limit;
+        result = nanosleep (&intermediate, remaining_delay);
+        seconds -= limit;
+        if (result)
+          {
+            if (remaining_delay)
+              remaining_delay->tv_sec += seconds;
+            return result;
+          }
+        intermediate.tv_nsec = 0;
+      }
+    intermediate.tv_sec = seconds;
+    return nanosleep (&intermediate, remaining_delay);
+  }
+}
+
+#elif defined _WIN32 && ! defined __CYGWIN__
+/* Native Windows platforms.  */
+
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+
+/* The Windows API function Sleep() has a resolution of about 15 ms and takes
+   at least 5 ms to execute.  We use this function for longer time periods.
+   Additionally, we use busy-looping over short time periods, to get a
+   resolution of about 0.01 ms.  In order to measure such short timespans,
+   we use the QueryPerformanceCounter() function.  */
+
+int
+nanosleep (const struct timespec *requested_delay,
+           struct timespec *remaining_delay)
+{
+  static bool initialized;
+  /* Number of performance counter increments per nanosecond,
+     or zero if it could not be determined.  */
+  static double ticks_per_nanosecond;
+
+  if (requested_delay->tv_nsec < 0 || BILLION <= requested_delay->tv_nsec)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+
+  /* For requested delays of one second or more, 15ms resolution is
+     sufficient.  */
+  if (requested_delay->tv_sec == 0)
+    {
+      if (!initialized)
+        {
+          /* Initialize ticks_per_nanosecond.  */
+          LARGE_INTEGER ticks_per_second;
+
+          if (QueryPerformanceFrequency (&ticks_per_second))
+            ticks_per_nanosecond =
+              (double) ticks_per_second.QuadPart / 1000000000.0;
+
+          initialized = true;
+        }
+      if (ticks_per_nanosecond)
+        {
+          /* QueryPerformanceFrequency worked.  We can use
+             QueryPerformanceCounter.  Use a combination of Sleep and
+             busy-looping.  */
+          /* Number of milliseconds to pass to the Sleep function.
+             Since Sleep can take up to 8 ms less or 8 ms more than requested
+             (or maybe more if the system is loaded), we subtract 10 ms.  */
+          int sleep_millis = (int) requested_delay->tv_nsec / 1000000 - 10;
+          /* Determine how many ticks to delay.  */
+          LONGLONG wait_ticks = requested_delay->tv_nsec * ticks_per_nanosecond;
+          /* Start.  */
+          LARGE_INTEGER counter_before;
+          if (QueryPerformanceCounter (&counter_before))
+            {
+              /* Wait until the performance counter has reached this value.
+                 We don't need to worry about overflow, because the performance
+                 counter is reset at reboot, and with a frequency of 3.6E6
+                 ticks per second 63 bits suffice for over 80000 years.  */
+              LONGLONG wait_until = counter_before.QuadPart + wait_ticks;
+              /* Use Sleep for the longest part.  */
+              if (sleep_millis > 0)
+                Sleep (sleep_millis);
+              /* Busy-loop for the rest.  */
+              for (;;)
+                {
+                  LARGE_INTEGER counter_after;
+                  if (!QueryPerformanceCounter (&counter_after))
+                    /* QueryPerformanceCounter failed, but succeeded earlier.
+                       Should not happen.  */
+                    break;
+                  if (counter_after.QuadPart >= wait_until)
+                    /* The requested time has elapsed.  */
+                    break;
+                }
+              goto done;
+            }
+        }
+    }
+  /* Implementation for long delays and as fallback.  */
+  Sleep (requested_delay->tv_sec * 1000 + requested_delay->tv_nsec / 1000000);
+
+ done:
+  /* Sleep is not interruptible.  So there is no remaining delay.  */
+  if (remaining_delay != NULL)
+    {
+      remaining_delay->tv_sec = 0;
+      remaining_delay->tv_nsec = 0;
+    }
+  return 0;
+}
+
+#else
+/* Unix platforms lacking nanosleep. */
+
+/* Some systems (MSDOS) don't have SIGCONT.
+   Using SIGTERM here turns the signal-handling code below
+   into a no-op on such systems. */
+# ifndef SIGCONT
+#  define SIGCONT SIGTERM
+# endif
+
+static sig_atomic_t volatile suspended;
+
+/* Handle SIGCONT. */
+
+static _GL_ASYNC_SAFE void
+sighandler (int sig)
+{
+  suspended = 1;
+}
+
+/* Suspend execution for at least *TS_DELAY seconds.  */
+
+static int
+my_usleep (const struct timespec *ts_delay)
+{
+  struct timeval tv_delay;
+  tv_delay.tv_sec = ts_delay->tv_sec;
+  tv_delay.tv_usec = (ts_delay->tv_nsec + 999) / 1000;
+  if (tv_delay.tv_usec == 1000000)
+    {
+      if (tv_delay.tv_sec == TYPE_MAXIMUM (time_t))
+        tv_delay.tv_usec = 1000000 - 1; /* close enough */
+      else
+        {
+          tv_delay.tv_sec++;
+          tv_delay.tv_usec = 0;
+        }
+    }
+  return select (0, NULL, NULL, NULL, &tv_delay);
+}
+
+/* Suspend execution for at least *REQUESTED_DELAY seconds.  The
+   *REMAINING_DELAY part isn't implemented yet.  */
+
+int
+nanosleep (const struct timespec *requested_delay,
+           struct timespec *remaining_delay)
+{
+  static bool initialized;
+
+  if (requested_delay->tv_nsec < 0 || BILLION <= requested_delay->tv_nsec)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+
+  /* set up sig handler */
+  if (! initialized)
+    {
+      struct sigaction oldact;
+
+      sigaction (SIGCONT, NULL, &oldact);
+      if (get_handler (&oldact) != SIG_IGN)
+        {
+          struct sigaction newact;
+
+          newact.sa_handler = sighandler;
+          sigemptyset (&newact.sa_mask);
+          newact.sa_flags = 0;
+          sigaction (SIGCONT, &newact, NULL);
+        }
+      initialized = true;
+    }
+
+  suspended = 0;
+
+  if (my_usleep (requested_delay) == -1)
+    {
+      if (suspended)
+        {
+          /* Calculate time remaining.  */
+          /* FIXME: the code in sleep doesn't use this, so there's no
+             rush to implement it.  */
+
+          errno = EINTR;
+        }
+      return -1;
+    }
+
+  /* FIXME: Restore sig handler?  */
+
+  return 0;
+}
+#endif
diff --git a/tests/nap.h b/tests/nap.h
new file mode 100644 (file)
index 0000000..3d0a51d
--- /dev/null
@@ -0,0 +1,162 @@
+/* Assist in file system timestamp tests.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009.  */
+
+#ifndef GLTEST_NAP_H
+# define GLTEST_NAP_H
+
+# include <limits.h>
+# include <stdbool.h>
+
+# include <intprops.h>
+
+/* Avoid a conflict with a function called nap() on UnixWare.  */
+# if defined _SCO_DS || (defined __SCO_VERSION__ || defined __sysv5__)  /* OpenServer, UnixWare */
+#  include <unistd.h>
+#  undef nap
+#  define nap gl_nap
+# endif
+
+/* Name of the witness file.  */
+#define TEMPFILE BASE "nap.tmp"
+
+/* File descriptor used for the witness file.  */
+static int nap_fd = -1;
+
+/* Return A - B, in ns.
+   Return 0 if the true result would be negative.
+   Return INT_MAX if the true result would be greater than INT_MAX.  */
+static int
+diff_timespec (struct timespec a, struct timespec b)
+{
+  time_t as = a.tv_sec;
+  time_t bs = b.tv_sec;
+  int ans = a.tv_nsec;
+  int bns = b.tv_nsec;
+  int sdiff;
+
+  ASSERT (0 <= ans && ans < 2000000000);
+  ASSERT (0 <= bns && bns < 2000000000);
+
+  if (! (bs < as || (bs == as && bns < ans)))
+    return 0;
+
+  if (INT_SUBTRACT_WRAPV (as, bs, &sdiff)
+      || INT_MULTIPLY_WRAPV (sdiff, 1000000000, &sdiff)
+      || INT_ADD_WRAPV (sdiff, ans - bns, &sdiff))
+    return INT_MAX;
+
+  return sdiff;
+}
+
+/* If DO_WRITE, bump the modification time of the file designated by NAP_FD.
+   Then fetch the new STAT information of NAP_FD.  */
+static void
+nap_get_stat (struct stat *st, int do_write)
+{
+  if (do_write)
+    {
+      ASSERT (write (nap_fd, "\n", 1) == 1);
+#if defined _WIN32 || defined __CYGWIN__
+      /* On Windows, the modification times are not changed until NAP_FD
+         is closed. See
+         <https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-writefile> */
+      close (nap_fd);
+      nap_fd = open (TEMPFILE, O_RDWR, 0600);
+      ASSERT (nap_fd != -1);
+      lseek (nap_fd, 0, SEEK_END);
+#endif
+    }
+  ASSERT (fstat (nap_fd, st) == 0);
+}
+
+/* Given a file whose descriptor is FD, see whether delaying by DELAY
+   nanoseconds causes a change in a file's mtime.
+   OLD_ST is the file's status, recently gotten.  */
+static bool
+nap_works (int delay, struct stat old_st)
+{
+  struct stat st;
+  struct timespec delay_spec;
+  delay_spec.tv_sec = delay / 1000000000;
+  delay_spec.tv_nsec = delay % 1000000000;
+  ASSERT (nanosleep (&delay_spec, 0) == 0);
+  nap_get_stat (&st, 1);
+
+  if (diff_timespec (get_stat_mtime (&st), get_stat_mtime (&old_st)))
+    return true;
+
+  return false;
+}
+
+static void
+clear_temp_file (void)
+{
+  if (0 <= nap_fd)
+    {
+      ASSERT (close (nap_fd) != -1);
+      ASSERT (unlink (TEMPFILE) != -1);
+    }
+}
+
+/* Sleep long enough to notice a timestamp difference on the file
+   system in the current directory.  Use an adaptive approach, trying
+   to find the smallest delay which works on the current file system
+   to make the timestamp difference appear.  Assert a maximum delay of
+   ~2 seconds, more precisely sum(2^n) from 0 to 30 = 2^31 - 1 = 2.1s.
+   Assumes that BASE is defined, and requires that the test module
+   depends on nanosleep.  */
+static void
+nap (void)
+{
+  struct stat old_st;
+  static int delay = 1;
+
+  if (-1 == nap_fd)
+    {
+      atexit (clear_temp_file);
+      ASSERT ((nap_fd = creat (TEMPFILE, 0600)) != -1);
+      nap_get_stat (&old_st, 0);
+    }
+  else
+    {
+      ASSERT (0 <= nap_fd);
+      nap_get_stat (&old_st, 1);
+    }
+
+  if (1 < delay)
+    delay = delay / 2;  /* Try half of the previous delay.  */
+  ASSERT (0 < delay);
+
+  for (;;)
+    {
+      if (nap_works (delay, old_st))
+        return;
+      if (delay <= (2147483647 - 1) / 2)
+        {
+          delay = delay * 2 + 1;
+          continue;
+        }
+      else
+        break;
+    }
+
+  /* Bummer: even the highest nap delay didn't work. */
+  ASSERT (0);
+}
+
+#endif /* GLTEST_NAP_H */
diff --git a/tests/netinet_in.in.h b/tests/netinet_in.in.h
new file mode 100644 (file)
index 0000000..f091d5c
--- /dev/null
@@ -0,0 +1,47 @@
+/* Substitute for <netinet/in.h>.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _@GUARD_PREFIX@_NETINET_IN_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if @HAVE_NETINET_IN_H@
+
+/* On many platforms, <netinet/in.h> assumes prior inclusion of
+   <sys/types.h>.  */
+# include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_NETINET_IN_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_NETINET_IN_H
+#define _@GUARD_PREFIX@_NETINET_IN_H
+
+#if !@HAVE_NETINET_IN_H@
+
+/* A platform that lacks <netinet/in.h>.  */
+
+# include <sys/socket.h>
+
+#endif
+
+#endif /* _@GUARD_PREFIX@_NETINET_IN_H */
+#endif /* _@GUARD_PREFIX@_NETINET_IN_H */
diff --git a/tests/null-ptr.h b/tests/null-ptr.h
new file mode 100644 (file)
index 0000000..a4081ba
--- /dev/null
@@ -0,0 +1,33 @@
+/* Return a NULL pointer, without letting the compiler know it.
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <stdlib.h>
+
+/* Return NULL.
+   Usual compilers are not able to infer something about the return value.  */
+static void *
+null_ptr (void)
+{
+  unsigned int x = rand ();
+  unsigned int y = x * x;
+  if (y & 2)
+    return (void *) -1;
+  else
+    return (void *) 0;
+}
+
+/* If you want to know why this always returns NULL, read
+   https://en.wikipedia.org/wiki/Quadratic_residue#Prime_power_modulus .  */
diff --git a/tests/offtostr.c b/tests/offtostr.c
new file mode 100644 (file)
index 0000000..96082aa
--- /dev/null
@@ -0,0 +1,3 @@
+#define anytostr offtostr
+#define inttype off_t
+#include "anytostr.c"
diff --git a/tests/perror.c b/tests/perror.c
new file mode 100644 (file)
index 0000000..d57331c
--- /dev/null
@@ -0,0 +1,49 @@
+/* Print a message describing error code.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible and Simon Josefsson.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "strerror-override.h"
+
+/* Use the system functions, not the gnulib overrides in this file.  */
+#undef fprintf
+
+void
+perror (const char *string)
+{
+  char stackbuf[STACKBUF_LEN];
+  int ret;
+
+  /* Our implementation guarantees that this will be a non-empty
+     string, even if it returns EINVAL; and stackbuf should be sized
+     large enough to avoid ERANGE.  */
+  ret = strerror_r (errno, stackbuf, sizeof stackbuf);
+  if (ret == ERANGE)
+    abort ();
+
+  if (string != NULL && *string != '\0')
+    fprintf (stderr, "%s: %s\n", string, stackbuf);
+  else
+    fprintf (stderr, "%s\n", stackbuf);
+}
diff --git a/tests/pthread-thread.c b/tests/pthread-thread.c
new file mode 100644 (file)
index 0000000..664ea77
--- /dev/null
@@ -0,0 +1,178 @@
+/* Creating and controlling POSIX threads.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert, 2010, and Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <pthread.h>
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# include "windows-thread.h"
+#else
+# include <stdlib.h>
+#endif
+
+typedef void * (* pthread_main_function_t) (void *);
+
+#if ((defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS) || !HAVE_PTHREAD_H
+
+int
+pthread_attr_init (pthread_attr_t *attr)
+{
+  *attr = PTHREAD_CREATE_JOINABLE;
+  return 0;
+}
+
+int
+pthread_attr_getdetachstate (const pthread_attr_t *attr, int *detachstatep)
+{
+  *detachstatep = *attr & (PTHREAD_CREATE_JOINABLE | PTHREAD_CREATE_DETACHED);
+  return 0;
+}
+
+int
+pthread_attr_setdetachstate (pthread_attr_t *attr, int detachstate)
+{
+  if (!(detachstate == PTHREAD_CREATE_JOINABLE
+        || detachstate == PTHREAD_CREATE_DETACHED))
+    return EINVAL;
+  *attr ^= (*attr ^ detachstate)
+           & (PTHREAD_CREATE_JOINABLE | PTHREAD_CREATE_DETACHED);
+  return 0;
+}
+
+int
+pthread_attr_destroy (pthread_attr_t *attr _GL_UNUSED)
+{
+  return 0;
+}
+
+#endif
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+/* Use Windows threads.  */
+
+int
+pthread_create (pthread_t *threadp, const pthread_attr_t *attr,
+                pthread_main_function_t mainfunc, void *arg)
+{
+  unsigned int glwthread_attr =
+    (attr != NULL
+     && (*attr & (PTHREAD_CREATE_JOINABLE | PTHREAD_CREATE_DETACHED))
+        != PTHREAD_CREATE_JOINABLE
+     ? GLWTHREAD_ATTR_DETACHED
+     : 0);
+  return glwthread_thread_create (threadp, glwthread_attr, mainfunc, arg);
+}
+
+pthread_t
+pthread_self (void)
+{
+  return glwthread_thread_self ();
+}
+
+int
+pthread_equal (pthread_t thread1, pthread_t thread2)
+{
+  return thread1 == thread2;
+}
+
+int
+pthread_detach (pthread_t thread)
+{
+  return glwthread_thread_detach (thread);
+}
+
+int
+pthread_join (pthread_t thread, void **valuep)
+{
+  return glwthread_thread_join (thread, valuep);
+}
+
+void
+pthread_exit (void *value)
+{
+  glwthread_thread_exit (value);
+}
+
+#elif HAVE_PTHREAD_H
+/* Provide workarounds for POSIX threads.  */
+
+# if PTHREAD_CREATE_IS_INLINE
+int
+pthread_create (pthread_t *threadp, const pthread_attr_t *attr,
+                pthread_main_function_t mainfunc, void *arg)
+#  undef pthread_create
+{
+  return pthread_create (threadp, attr, mainfunc, arg);
+}
+
+int
+pthread_attr_init (pthread_attr_t *attr)
+#  undef pthread_attr_init
+{
+  return pthread_attr_init (attr);
+}
+
+# endif
+
+#else
+/* Provide a dummy implementation for single-threaded applications.  */
+
+int
+pthread_create (pthread_t *threadp, const pthread_attr_t *attr,
+                pthread_main_function_t mainfunc, void *arg)
+{
+  /* The maximum number of threads is reached.  Do not create a thread.  */
+  return EAGAIN;
+}
+
+pthread_t
+pthread_self (void)
+{
+  return 42;
+}
+
+int
+pthread_equal (pthread_t thread1, pthread_t thread2)
+{
+  return thread1 == thread2;
+}
+
+int
+pthread_detach (pthread_t thread)
+{
+  /* There are no joinable threads.  */
+  return EINVAL;
+}
+
+int
+pthread_join (pthread_t thread, void **valuep)
+{
+  /* There are no joinable threads.  */
+  return EINVAL;
+}
+
+void
+pthread_exit (void *value)
+{
+  /* There is just one thread, so the process exits.  */
+  exit (0);
+}
+
+#endif
diff --git a/tests/pthread.in.h b/tests/pthread.in.h
new file mode 100644 (file)
index 0000000..dcfb1f3
--- /dev/null
@@ -0,0 +1,1963 @@
+/* Implement the most essential subset of POSIX 1003.1-2008 pthread.h.
+
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert, Glen Lenker, and Bruno Haible.  */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_ALREADY_INCLUDING_PTHREAD_H
+/* Special invocation convention:
+   On Android, we have a sequence of nested includes
+   <pthread.h> -> <time.h> -> <sys/time.h> -> <sys/select.h> ->
+   <signal.h> -> <pthread.h>.
+   In this situation, PTHREAD_COND_INITIALIZER is not yet defined,
+   therefore we should not attempt to define PTHREAD_MUTEX_NORMAL etc.  */
+
+#@INCLUDE_NEXT@ @NEXT_PTHREAD_H@
+
+#else
+/* Normal invocation convention.  */
+
+#ifndef _@GUARD_PREFIX@_PTHREAD_H_
+
+#if @HAVE_PTHREAD_H@
+
+# define _GL_ALREADY_INCLUDING_PTHREAD_H
+
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_PTHREAD_H@
+
+# undef _GL_ALREADY_INCLUDING_PTHREAD_H
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_PTHREAD_H_
+#define _@GUARD_PREFIX@_PTHREAD_H_
+
+#define __need_system_stdlib_h
+#include <stdlib.h>
+#undef __need_system_stdlib_h
+
+
+/* The pthreads-win32 <pthread.h> defines a couple of broken macros.  */
+#undef asctime_r
+#undef ctime_r
+#undef gmtime_r
+#undef localtime_r
+#undef rand_r
+#undef strtok_r
+
+#include <errno.h>
+#include <sched.h>
+#include <sys/types.h>
+#include <time.h>
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _Noreturn is copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+/* =========== Thread types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_THREAD@
+#  include "windows-thread.h"
+#  if @HAVE_PTHREAD_T@
+#   define pthread_t rpl_pthread_t
+#   define pthread_attr_t rpl_pthread_attr_t
+#  endif
+#  if !GNULIB_defined_pthread_thread_types
+typedef glwthread_thread_t pthread_t;
+typedef unsigned int pthread_attr_t;
+#   define GNULIB_defined_pthread_thread_types 1
+#  endif
+# else
+#  if @HAVE_PTHREAD_T@
+#   define pthread_t rpl_pthread_t
+#   define pthread_attr_t rpl_pthread_attr_t
+#  endif
+#  if !GNULIB_defined_pthread_thread_types
+typedef int pthread_t;
+typedef unsigned int pthread_attr_t;
+#   define GNULIB_defined_pthread_thread_types 1
+#  endif
+# endif
+# undef PTHREAD_CREATE_JOINABLE
+# undef PTHREAD_CREATE_DETACHED
+# define PTHREAD_CREATE_JOINABLE 0
+# define PTHREAD_CREATE_DETACHED 1
+#else
+# if !@HAVE_PTHREAD_T@
+#  if !GNULIB_defined_pthread_thread_types
+typedef int pthread_t;
+typedef unsigned int pthread_attr_t;
+#   define GNULIB_defined_pthread_thread_types 1
+#  endif
+# endif
+# if !@HAVE_PTHREAD_CREATE_DETACHED@
+#  define PTHREAD_CREATE_JOINABLE 0
+#  define PTHREAD_CREATE_DETACHED 1
+# endif
+#endif
+
+/* =========== Once-only control (initialization) types and macros ========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_ONCE@
+#  include "windows-once.h"
+#  if @HAVE_PTHREAD_T@
+#   define pthread_once_t rpl_pthread_once_t
+#  endif
+#  if !GNULIB_defined_pthread_once_types
+typedef glwthread_once_t pthread_once_t;
+#   define GNULIB_defined_pthread_once_types 1
+#  endif
+#  undef PTHREAD_ONCE_INIT
+#  define PTHREAD_ONCE_INIT GLWTHREAD_ONCE_INIT
+# else
+#  if @HAVE_PTHREAD_T@
+#   define pthread_once_t rpl_pthread_once_t
+#  endif
+#  if !GNULIB_defined_pthread_once_types
+typedef int pthread_once_t;
+#   define GNULIB_defined_pthread_once_types 1
+#  endif
+#  undef PTHREAD_ONCE_INIT
+#  define PTHREAD_ONCE_INIT { 0 }
+# endif
+#else
+# if !@HAVE_PTHREAD_T@
+#  if !GNULIB_defined_pthread_once_types
+typedef int pthread_once_t;
+#   define GNULIB_defined_pthread_once_types 1
+#  endif
+#  undef PTHREAD_ONCE_INIT
+#  define PTHREAD_ONCE_INIT { 0 }
+# endif
+#endif
+
+/* =========== Mutex types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_MUTEX@
+#  include "windows-timedmutex.h"
+#  include "windows-timedrecmutex.h"
+#  if @HAVE_PTHREAD_T@
+#   define pthread_mutex_t rpl_pthread_mutex_t
+#   define pthread_mutexattr_t rpl_pthread_mutexattr_t
+#  endif
+#  if !GNULIB_defined_pthread_mutex_types
+typedef struct
+        {
+          int type;
+          union
+            {
+              glwthread_timedmutex_t    u_timedmutex;
+              glwthread_timedrecmutex_t u_timedrecmutex;
+            }
+          u;
+        }
+        pthread_mutex_t;
+typedef unsigned int pthread_mutexattr_t;
+#   define GNULIB_defined_pthread_mutex_types 1
+#  endif
+#  undef PTHREAD_MUTEX_INITIALIZER
+#  define PTHREAD_MUTEX_INITIALIZER { 1, { GLWTHREAD_TIMEDMUTEX_INIT } }
+# else
+#  if @HAVE_PTHREAD_T@
+#   define pthread_mutex_t rpl_pthread_mutex_t
+#   define pthread_mutexattr_t rpl_pthread_mutexattr_t
+#  endif
+#  if !GNULIB_defined_pthread_mutex_types
+typedef int pthread_mutex_t;
+typedef unsigned int pthread_mutexattr_t;
+#   define GNULIB_defined_pthread_mutex_types 1
+#  endif
+#  undef PTHREAD_MUTEX_INITIALIZER
+#  define PTHREAD_MUTEX_INITIALIZER { 0 }
+# endif
+# undef PTHREAD_MUTEX_DEFAULT
+# undef PTHREAD_MUTEX_NORMAL
+# undef PTHREAD_MUTEX_ERRORCHECK
+# undef PTHREAD_MUTEX_RECURSIVE
+# define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
+# define PTHREAD_MUTEX_NORMAL 0
+# define PTHREAD_MUTEX_ERRORCHECK 1
+# define PTHREAD_MUTEX_RECURSIVE 2
+# undef PTHREAD_MUTEX_STALLED
+# undef PTHREAD_MUTEX_ROBUST
+# define PTHREAD_MUTEX_STALLED 0
+# define PTHREAD_MUTEX_ROBUST 1
+#else
+# if !@HAVE_PTHREAD_T@
+#  if !GNULIB_defined_pthread_mutex_types
+typedef int pthread_mutex_t;
+typedef unsigned int pthread_mutexattr_t;
+#   define GNULIB_defined_pthread_mutex_types 1
+#  endif
+#  undef PTHREAD_MUTEX_INITIALIZER
+#  define PTHREAD_MUTEX_INITIALIZER { 0 }
+# endif
+# if !@HAVE_PTHREAD_MUTEX_RECURSIVE@
+#  define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
+#  define PTHREAD_MUTEX_NORMAL 0
+#  define PTHREAD_MUTEX_ERRORCHECK 1
+#  define PTHREAD_MUTEX_RECURSIVE 2
+# endif
+# if !@HAVE_PTHREAD_MUTEX_ROBUST@
+#  define PTHREAD_MUTEX_STALLED 0
+#  define PTHREAD_MUTEX_ROBUST 1
+# endif
+#endif
+
+/* =========== Read-write lock types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_RWLOCK@
+#  include "windows-timedrwlock.h"
+#  if @HAVE_PTHREAD_T@
+#   define pthread_rwlock_t rpl_pthread_rwlock_t
+#   define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
+#  endif
+#  if !GNULIB_defined_pthread_rwlock_types
+typedef glwthread_timedrwlock_t pthread_rwlock_t;
+typedef unsigned int pthread_rwlockattr_t;
+#   define GNULIB_defined_pthread_rwlock_types 1
+#  endif
+#  undef PTHREAD_RWLOCK_INITIALIZER
+#  define PTHREAD_RWLOCK_INITIALIZER GLWTHREAD_TIMEDRWLOCK_INIT
+# else
+#  if @HAVE_PTHREAD_T@
+#   define pthread_rwlock_t rpl_pthread_rwlock_t
+#   define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
+#  endif
+#  if !GNULIB_defined_pthread_rwlock_types
+typedef int pthread_rwlock_t;
+typedef unsigned int pthread_rwlockattr_t;
+#   define GNULIB_defined_pthread_rwlock_types 1
+#  endif
+#  undef PTHREAD_RWLOCK_INITIALIZER
+#  define PTHREAD_RWLOCK_INITIALIZER { 0 }
+# endif
+#elif @GNULIB_PTHREAD_RWLOCK@ && @REPLACE_PTHREAD_RWLOCK_INIT@ /* i.e. PTHREAD_RWLOCK_UNIMPLEMENTED */
+# if @HAVE_PTHREAD_T@
+#  define pthread_rwlock_t rpl_pthread_rwlock_t
+#  define pthread_rwlockattr_t rpl_pthread_rwlockattr_t
+# endif
+# if !GNULIB_defined_pthread_rwlock_types
+typedef struct
+        {
+          pthread_mutex_t lock; /* protects the remaining fields */
+          pthread_cond_t waiting_readers; /* waiting readers */
+          pthread_cond_t waiting_writers; /* waiting writers */
+          unsigned int waiting_writers_count; /* number of waiting writers */
+          int runcount; /* number of readers running, or -1 when a writer runs */
+        }
+        pthread_rwlock_t;
+typedef unsigned int pthread_rwlockattr_t;
+#  define GNULIB_defined_pthread_rwlock_types 1
+# endif
+# undef PTHREAD_RWLOCK_INITIALIZER
+# define PTHREAD_RWLOCK_INITIALIZER \
+   { PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, PTHREAD_COND_INITIALIZER, 0, 0 }
+#else
+# if @HAVE_PTHREAD_T@
+#  if !defined PTHREAD_RWLOCK_INITIALIZER && defined PTHREAD_RWLOCK_INITIALIZER_NP /* z/OS */
+#   define PTHREAD_RWLOCK_INITIALIZER PTHREAD_RWLOCK_INITIALIZER_NP
+#  endif
+# else
+#  if !GNULIB_defined_pthread_rwlock_types
+typedef int pthread_rwlock_t;
+typedef unsigned int pthread_rwlockattr_t;
+#   define GNULIB_defined_pthread_rwlock_types 1
+#  endif
+#  undef PTHREAD_RWLOCK_INITIALIZER
+#  define PTHREAD_RWLOCK_INITIALIZER { 0 }
+# endif
+#endif
+
+/* =========== Condition variable types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_COND@
+#  include "windows-cond.h"
+#  if @HAVE_PTHREAD_T@
+#   define pthread_cond_t rpl_pthread_cond_t
+#   define pthread_condattr_t rpl_pthread_condattr_t
+#  endif
+#  if !GNULIB_defined_pthread_cond_types
+typedef glwthread_cond_t pthread_cond_t;
+typedef unsigned int pthread_condattr_t;
+#   define GNULIB_defined_pthread_cond_types 1
+#  endif
+#  undef PTHREAD_COND_INITIALIZER
+#  define PTHREAD_COND_INITIALIZER GLWTHREAD_COND_INIT
+# else
+#  if @HAVE_PTHREAD_T@
+#   define pthread_cond_t rpl_pthread_cond_t
+#   define pthread_condattr_t rpl_pthread_condattr_t
+#  endif
+#  if !GNULIB_defined_pthread_cond_types
+typedef int pthread_cond_t;
+typedef unsigned int pthread_condattr_t;
+#   define GNULIB_defined_pthread_cond_types 1
+#  endif
+#  undef PTHREAD_COND_INITIALIZER
+#  define PTHREAD_COND_INITIALIZER { 0 }
+# endif
+#else
+# if !@HAVE_PTHREAD_T@
+#  if !GNULIB_defined_pthread_cond_types
+typedef int pthread_cond_t;
+typedef unsigned int pthread_condattr_t;
+#   define GNULIB_defined_pthread_cond_types 1
+#  endif
+#  undef PTHREAD_COND_INITIALIZER
+#  define PTHREAD_COND_INITIALIZER { 0 }
+# endif
+#endif
+
+/* =========== Thread-specific storage types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_TSS@
+#  include "windows-tls.h"
+#  if @HAVE_PTHREAD_T@
+#   define pthread_key_t rpl_pthread_key_t
+#  endif
+#  if !GNULIB_defined_pthread_tss_types
+typedef glwthread_tls_key_t pthread_key_t;
+#   define GNULIB_defined_pthread_tss_types 1
+#  endif
+#  undef PTHREAD_DESTRUCTOR_ITERATIONS
+#  define PTHREAD_DESTRUCTOR_ITERATIONS GLWTHREAD_DESTRUCTOR_ITERATIONS
+# else
+#  if @HAVE_PTHREAD_T@
+#   define pthread_key_t rpl_pthread_key_t
+#  endif
+#  if !GNULIB_defined_pthread_tss_types
+typedef void ** pthread_key_t;
+#   define GNULIB_defined_pthread_tss_types 1
+#  endif
+#  undef PTHREAD_DESTRUCTOR_ITERATIONS
+#  define PTHREAD_DESTRUCTOR_ITERATIONS 0
+# endif
+#else
+# if !@HAVE_PTHREAD_T@
+#  if !GNULIB_defined_pthread_tss_types
+typedef void ** pthread_key_t;
+#   define GNULIB_defined_pthread_tss_types 1
+#  endif
+#  undef PTHREAD_DESTRUCTOR_ITERATIONS
+#  define PTHREAD_DESTRUCTOR_ITERATIONS 0
+# endif
+#endif
+
+/* =========== Spinlock types and macros =========== */
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+# if @GNULIB_PTHREAD_SPIN@
+#  include "windows-spin.h"
+#  if @HAVE_PTHREAD_T@
+#   define pthread_spinlock_t rpl_pthread_spinlock_t
+#  endif
+#  if !GNULIB_defined_pthread_spin_types
+typedef glwthread_spinlock_t pthread_spinlock_t;
+#   define GNULIB_defined_pthread_spin_types 1
+#  endif
+# else
+#  if @HAVE_PTHREAD_T@
+#   define pthread_spinlock_t rpl_pthread_spinlock_t
+#  endif
+#  if !GNULIB_defined_pthread_spin_types
+typedef pthread_mutex_t pthread_spinlock_t;
+#   define GNULIB_defined_pthread_spin_types 1
+#  endif
+# endif
+# undef PTHREAD_PROCESS_PRIVATE
+# undef PTHREAD_PROCESS_SHARED
+# define PTHREAD_PROCESS_PRIVATE 0
+# define PTHREAD_PROCESS_SHARED 1
+#else
+# if !@HAVE_PTHREAD_SPINLOCK_T@
+/* Approximate spinlocks with mutexes.  */
+#  if !GNULIB_defined_pthread_spin_types
+typedef pthread_mutex_t pthread_spinlock_t;
+#   define GNULIB_defined_pthread_spin_types 1
+#  endif
+# endif
+# if !@HAVE_PTHREAD_PROCESS_SHARED@
+#  define PTHREAD_PROCESS_PRIVATE 0
+#  define PTHREAD_PROCESS_SHARED 1
+# endif
+#endif
+
+/* =========== Other types and macros =========== */
+
+#if !@HAVE_PTHREAD_T@
+# if !GNULIB_defined_other_pthread_types
+typedef int pthread_barrier_t;
+typedef unsigned int pthread_barrierattr_t;
+#  define GNULIB_defined_other_pthread_types 1
+# endif
+#endif
+
+#if !defined PTHREAD_CANCELED
+
+# define PTHREAD_BARRIER_SERIAL_THREAD (-1)
+
+# define PTHREAD_CANCEL_DEFERRED 0
+# define PTHREAD_CANCEL_ASYNCHRONOUS 1
+
+# define PTHREAD_CANCEL_ENABLE 0
+# define PTHREAD_CANCEL_DISABLE 1
+
+# define PTHREAD_CANCELED ((void *) -1)
+
+# define PTHREAD_INHERIT_SCHED 0
+# define PTHREAD_EXPLICIT_SCHED 1
+
+# define PTHREAD_PRIO_NONE 0
+# define PTHREAD_PRIO_INHERIT 1
+# define PTHREAD_PRIO_PROTECT 2
+
+# define PTHREAD_SCOPE_SYSTEM 0
+# define PTHREAD_SCOPE_PROCESS 1
+
+#endif
+
+/* =========== Thread functions =========== */
+
+#if @GNULIB_PTHREAD_THREAD@
+/* The 'restrict' qualifier on ARG is nonsense, but POSIX specifies it this way.
+   Sigh.  */
+# if @REPLACE_PTHREAD_CREATE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_create
+#   define pthread_create rpl_pthread_create
+#  endif
+_GL_FUNCDECL_RPL (pthread_create, int,
+                  (pthread_t *restrict threadp,
+                   const pthread_attr_t *restrict attr,
+                   void * (*mainfunc) (void *), void *restrict arg)
+                  _GL_ARG_NONNULL ((1, 3)));
+_GL_CXXALIAS_RPL (pthread_create, int,
+                  (pthread_t *restrict threadp,
+                   const pthread_attr_t *restrict attr,
+                   void * (*mainfunc) (void *), void *restrict arg));
+# else
+#  if !@HAVE_PTHREAD_CREATE@
+_GL_FUNCDECL_SYS (pthread_create, int,
+                  (pthread_t *restrict threadp,
+                   const pthread_attr_t *restrict attr,
+                   void * (*mainfunc) (void *), void *restrict arg)
+                  _GL_ARG_NONNULL ((1, 3)));
+#  endif
+_GL_CXXALIAS_SYS_CAST (pthread_create, int,
+                       (pthread_t *restrict threadp,
+                        const pthread_attr_t *restrict attr,
+                        void * (*mainfunc) (void *), void *restrict arg));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_create);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_create
+# if HAVE_RAW_DECL_PTHREAD_CREATE
+_GL_WARN_ON_USE (pthread_create, "pthread_create is not portable - "
+                 "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_ATTR_INIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_attr_init
+#   define pthread_attr_init rpl_pthread_attr_init
+#  endif
+_GL_FUNCDECL_RPL (pthread_attr_init, int, (pthread_attr_t *attr)
+                                          _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_attr_init, int, (pthread_attr_t *attr));
+# else
+#  if !@HAVE_PTHREAD_ATTR_INIT@
+_GL_FUNCDECL_SYS (pthread_attr_init, int, (pthread_attr_t *attr)
+                                          _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_attr_init, int, (pthread_attr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_attr_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_attr_init
+# if HAVE_RAW_DECL_PTHREAD_ATTR_INIT
+_GL_WARN_ON_USE (pthread_attr_init, "pthread_attr_init is not portable - "
+                 "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_ATTR_GETDETACHSTATE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_attr_getdetachstate
+#   define pthread_attr_getdetachstate rpl_pthread_attr_getdetachstate
+#  endif
+_GL_FUNCDECL_RPL (pthread_attr_getdetachstate, int,
+                  (const pthread_attr_t *attr, int *detachstatep)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_attr_getdetachstate, int,
+                  (const pthread_attr_t *attr, int *detachstatep));
+# else
+#  if !@HAVE_PTHREAD_ATTR_GETDETACHSTATE@
+_GL_FUNCDECL_SYS (pthread_attr_getdetachstate, int,
+                  (const pthread_attr_t *attr, int *detachstatep)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_attr_getdetachstate, int,
+                  (const pthread_attr_t *attr, int *detachstatep));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_attr_getdetachstate);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_attr_getdetachstate
+# if HAVE_RAW_DECL_PTHREAD_ATTR_GETDETACHSTATE
+_GL_WARN_ON_USE (pthread_attr_getdetachstate, "pthread_attr_getdetachstate is not portable - "
+                 "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_ATTR_SETDETACHSTATE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_attr_setdetachstate
+#   define pthread_attr_setdetachstate rpl_pthread_attr_setdetachstate
+#  endif
+_GL_FUNCDECL_RPL (pthread_attr_setdetachstate, int,
+                  (pthread_attr_t *attr, int detachstate)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_attr_setdetachstate, int,
+                  (pthread_attr_t *attr, int detachstate));
+# else
+#  if !@HAVE_PTHREAD_ATTR_SETDETACHSTATE@
+_GL_FUNCDECL_SYS (pthread_attr_setdetachstate, int,
+                  (pthread_attr_t *attr, int detachstate)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_attr_setdetachstate, int,
+                  (pthread_attr_t *attr, int detachstate));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_attr_setdetachstate);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_attr_setdetachstate
+# if HAVE_RAW_DECL_PTHREAD_ATTR_SETDETACHSTATE
+_GL_WARN_ON_USE (pthread_attr_setdetachstate, "pthread_attr_setdetachstate is not portable - "
+                 "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_ATTR_DESTROY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_attr_destroy
+#   define pthread_attr_destroy rpl_pthread_attr_destroy
+#  endif
+_GL_FUNCDECL_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr)
+                                             _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_attr_destroy, int, (pthread_attr_t *attr));
+# else
+#  if !@HAVE_PTHREAD_ATTR_DESTROY@
+_GL_FUNCDECL_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr)
+                                             _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_attr_destroy, int, (pthread_attr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_attr_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_attr_destroy
+# if HAVE_RAW_DECL_PTHREAD_ATTR_DESTROY
+_GL_WARN_ON_USE (pthread_attr_destroy, "pthread_attr_destroy is not portable - "
+                 "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_SELF@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_self
+#   define pthread_self rpl_pthread_self
+#  endif
+_GL_FUNCDECL_RPL (pthread_self, pthread_t, (void) _GL_ATTRIBUTE_PURE);
+_GL_CXXALIAS_RPL (pthread_self, pthread_t, (void));
+# else
+#  if !@HAVE_PTHREAD_SELF@
+_GL_FUNCDECL_SYS (pthread_self, pthread_t, (void) _GL_ATTRIBUTE_PURE);
+#  endif
+_GL_CXXALIAS_SYS (pthread_self, pthread_t, (void));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_self);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_self
+# if HAVE_RAW_DECL_PTHREAD_SELF
+_GL_WARN_ON_USE (pthread_self, "pthread_self is not portable - "
+                 "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_EQUAL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_equal
+#   define pthread_equal rpl_pthread_equal
+#  endif
+_GL_FUNCDECL_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2));
+_GL_CXXALIAS_RPL (pthread_equal, int, (pthread_t thread1, pthread_t thread2));
+# else
+#  if !@HAVE_PTHREAD_EQUAL@
+_GL_FUNCDECL_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2));
+#  endif
+_GL_CXXALIAS_SYS (pthread_equal, int, (pthread_t thread1, pthread_t thread2));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_equal);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_equal
+# if HAVE_RAW_DECL_PTHREAD_EQUAL
+_GL_WARN_ON_USE (pthread_equal, "pthread_equal is not portable - "
+                 "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_DETACH@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_detach
+#   define pthread_detach rpl_pthread_detach
+#  endif
+_GL_FUNCDECL_RPL (pthread_detach, int, (pthread_t thread));
+_GL_CXXALIAS_RPL (pthread_detach, int, (pthread_t thread));
+# else
+#  if !@HAVE_PTHREAD_DETACH@
+_GL_FUNCDECL_SYS (pthread_detach, int, (pthread_t thread));
+#  endif
+_GL_CXXALIAS_SYS (pthread_detach, int, (pthread_t thread));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_detach);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_detach
+# if HAVE_RAW_DECL_PTHREAD_DETACH
+_GL_WARN_ON_USE (pthread_detach, "pthread_detach is not portable - "
+                 "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_JOIN@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_join
+#   define pthread_join rpl_pthread_join
+#  endif
+_GL_FUNCDECL_RPL (pthread_join, int, (pthread_t thread, void **valuep));
+_GL_CXXALIAS_RPL (pthread_join, int, (pthread_t thread, void **valuep));
+# else
+#  if !@HAVE_PTHREAD_JOIN@
+_GL_FUNCDECL_SYS (pthread_join, int, (pthread_t thread, void **valuep));
+#  endif
+_GL_CXXALIAS_SYS (pthread_join, int, (pthread_t thread, void **valuep));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_join);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_join
+# if HAVE_RAW_DECL_PTHREAD_JOIN
+_GL_WARN_ON_USE (pthread_join, "pthread_join is not portable - "
+                 "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_THREAD@
+# if @REPLACE_PTHREAD_EXIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_exit
+#   define pthread_exit rpl_pthread_exit
+#  endif
+_GL_FUNCDECL_RPL (pthread_exit, _Noreturn void, (void *value));
+_GL_CXXALIAS_RPL (pthread_exit, void, (void *value));
+# else
+#  if !@HAVE_PTHREAD_EXIT@
+_GL_FUNCDECL_SYS (pthread_exit, _Noreturn void, (void *value));
+#  endif
+/* Need to cast because of AIX with xlclang++.  */
+_GL_CXXALIAS_SYS_CAST (pthread_exit, void, (void *value));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_exit);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_exit
+# if HAVE_RAW_DECL_PTHREAD_EXIT
+_GL_WARN_ON_USE (pthread_exit, "pthread_exit is not portable - "
+                 "use gnulib module pthread-thread for portability");
+# endif
+#endif
+
+/* =========== Once-only control (initialization) functions =========== */
+
+#if @GNULIB_PTHREAD_ONCE@
+# if @REPLACE_PTHREAD_ONCE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_once
+#   define pthread_once rpl_pthread_once
+#  endif
+_GL_FUNCDECL_RPL (pthread_once, int,
+                  (pthread_once_t *once_control, void (*initfunction) (void))
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_once, int,
+                  (pthread_once_t *once_control, void (*initfunction) (void)));
+# else
+#  if !@HAVE_PTHREAD_ONCE@
+_GL_FUNCDECL_SYS (pthread_once, int,
+                  (pthread_once_t *once_control, void (*initfunction) (void))
+                   _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS_CAST (pthread_once, int,
+                       (pthread_once_t *once_control,
+                        void (*initfunction) (void)));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_once);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_once
+# if HAVE_RAW_DECL_PTHREAD_ONCE
+_GL_WARN_ON_USE (pthread_once, "pthread_once is not portable - "
+                 "use gnulib module pthread-once for portability");
+# endif
+#endif
+
+/* =========== Mutex functions =========== */
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEX_INIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutex_init
+#   define pthread_mutex_init rpl_pthread_mutex_init
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutex_init, int,
+                  (pthread_mutex_t *restrict mutex,
+                   const pthread_mutexattr_t *restrict attr)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutex_init, int,
+                  (pthread_mutex_t *restrict mutex,
+                   const pthread_mutexattr_t *restrict attr));
+# else
+#  if !@HAVE_PTHREAD_MUTEX_INIT@
+_GL_FUNCDECL_SYS (pthread_mutex_init, int,
+                  (pthread_mutex_t *restrict mutex,
+                   const pthread_mutexattr_t *restrict attr)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_mutex_init, int,
+                  (pthread_mutex_t *restrict mutex,
+                   const pthread_mutexattr_t *restrict attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_init
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_INIT
+_GL_WARN_ON_USE (pthread_mutex_init, "pthread_mutex_init is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_INIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutexattr_init
+#   define pthread_mutexattr_init rpl_pthread_mutexattr_init
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)
+                                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr));
+# else
+#  if !@HAVE_PTHREAD_MUTEXATTR_INIT@
+_GL_FUNCDECL_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr)
+                                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_mutexattr_init, int, (pthread_mutexattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_init
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_INIT
+_GL_WARN_ON_USE (pthread_mutexattr_init, "pthread_mutexattr_init is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_GETTYPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutexattr_gettype
+#   define pthread_mutexattr_gettype rpl_pthread_mutexattr_gettype
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_gettype, int,
+                  (const pthread_mutexattr_t *restrict attr,
+                   int *restrict typep)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_gettype, int,
+                  (const pthread_mutexattr_t *restrict attr,
+                   int *restrict typep));
+# else
+#  if !@HAVE_PTHREAD_MUTEXATTR_GETTYPE@
+_GL_FUNCDECL_SYS (pthread_mutexattr_gettype, int,
+                  (const pthread_mutexattr_t *restrict attr,
+                   int *restrict typep)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+/* Need to cast, because on FreeBSD the first parameter is
+                        pthread_mutexattr_t *attr.  */
+_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_gettype, int,
+                       (const pthread_mutexattr_t *restrict attr,
+                        int *restrict typep));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_gettype);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_gettype
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETTYPE
+_GL_WARN_ON_USE (pthread_mutexattr_gettype, "pthread_mutexattr_gettype is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_SETTYPE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutexattr_settype
+#   define pthread_mutexattr_settype rpl_pthread_mutexattr_settype
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_settype, int,
+                  (pthread_mutexattr_t *attr, int type) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_settype, int,
+                  (pthread_mutexattr_t *attr, int type));
+# else
+#  if !@HAVE_PTHREAD_MUTEXATTR_SETTYPE@
+_GL_FUNCDECL_SYS (pthread_mutexattr_settype, int,
+                  (pthread_mutexattr_t *attr, int type) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_mutexattr_settype, int,
+                  (pthread_mutexattr_t *attr, int type));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_settype);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_settype
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETTYPE
+_GL_WARN_ON_USE (pthread_mutexattr_settype, "pthread_mutexattr_settype is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_GETROBUST@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutexattr_getrobust
+#   define pthread_mutexattr_getrobust rpl_pthread_mutexattr_getrobust
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_getrobust, int,
+                  (const pthread_mutexattr_t *restrict attr,
+                   int *restrict robustp)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_getrobust, int,
+                  (const pthread_mutexattr_t *restrict attr,
+                   int *restrict robustp));
+# else
+#  if !@HAVE_PTHREAD_MUTEXATTR_GETROBUST@
+_GL_FUNCDECL_SYS (pthread_mutexattr_getrobust, int,
+                  (const pthread_mutexattr_t *restrict attr,
+                   int *restrict robustp)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+/* Need to cast, because on FreeBSD the first parameter is
+                        pthread_mutexattr_t *attr.  */
+_GL_CXXALIAS_SYS_CAST (pthread_mutexattr_getrobust, int,
+                       (const pthread_mutexattr_t *restrict attr,
+                        int *restrict robustp));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_getrobust);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_getrobust
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_GETROBUST
+_GL_WARN_ON_USE (pthread_mutexattr_getrobust, "pthread_mutexattr_getrobust is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_SETROBUST@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutexattr_setrobust
+#   define pthread_mutexattr_setrobust rpl_pthread_mutexattr_setrobust
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_setrobust, int,
+                  (pthread_mutexattr_t *attr, int robust)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_setrobust, int,
+                  (pthread_mutexattr_t *attr, int robust));
+# else
+#  if !@HAVE_PTHREAD_MUTEXATTR_SETROBUST@
+_GL_FUNCDECL_SYS (pthread_mutexattr_setrobust, int,
+                  (pthread_mutexattr_t *attr, int robust)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_mutexattr_setrobust, int,
+                  (pthread_mutexattr_t *attr, int robust));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_setrobust);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_setrobust
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_SETROBUST
+_GL_WARN_ON_USE (pthread_mutexattr_setrobust, "pthread_mutexattr_setrobust is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEXATTR_DESTROY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutexattr_destroy
+#   define pthread_mutexattr_destroy rpl_pthread_mutexattr_destroy
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)
+                                                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr));
+# else
+#  if !@HAVE_PTHREAD_MUTEXATTR_DESTROY@
+_GL_FUNCDECL_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr)
+                                                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_mutexattr_destroy, int, (pthread_mutexattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutexattr_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutexattr_destroy
+# if HAVE_RAW_DECL_PTHREAD_MUTEXATTR_DESTROY
+_GL_WARN_ON_USE (pthread_mutexattr_destroy, "pthread_mutexattr_destroy is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEX_LOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutex_lock
+#   define pthread_mutex_lock rpl_pthread_mutex_lock
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex)
+                                           _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutex_lock, int, (pthread_mutex_t *mutex));
+# else
+#  if !@HAVE_PTHREAD_MUTEX_LOCK@
+_GL_FUNCDECL_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex)
+                                           _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_mutex_lock, int, (pthread_mutex_t *mutex));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_lock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_lock
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_LOCK
+_GL_WARN_ON_USE (pthread_mutex_lock, "pthread_mutex_lock is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEX_TRYLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutex_trylock
+#   define pthread_mutex_trylock rpl_pthread_mutex_trylock
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)
+                                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutex_trylock, int, (pthread_mutex_t *mutex));
+# else
+#  if !@HAVE_PTHREAD_MUTEX_TRYLOCK@
+_GL_FUNCDECL_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex)
+                                              _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_mutex_trylock, int, (pthread_mutex_t *mutex));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_trylock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_trylock
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_TRYLOCK
+_GL_WARN_ON_USE (pthread_mutex_trylock, "pthread_mutex_trylock is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX_TIMEDLOCK@
+# if @REPLACE_PTHREAD_MUTEX_TIMEDLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutex_timedlock
+#   define pthread_mutex_timedlock rpl_pthread_mutex_timedlock
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutex_timedlock, int,
+                  (pthread_mutex_t *restrict mutex,
+                   const struct timespec *restrict abstime)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_mutex_timedlock, int,
+                  (pthread_mutex_t *restrict mutex,
+                   const struct timespec *restrict abstime));
+# else
+#  if !@HAVE_PTHREAD_MUTEX_TIMEDLOCK@
+_GL_FUNCDECL_SYS (pthread_mutex_timedlock, int,
+                  (pthread_mutex_t *restrict mutex,
+                   const struct timespec *restrict abstime)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_mutex_timedlock, int,
+                  (pthread_mutex_t *restrict mutex,
+                   const struct timespec *restrict abstime));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_timedlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_timedlock
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_TIMEDLOCK
+_GL_WARN_ON_USE (pthread_mutex_timedlock, "pthread_mutex_timedlock is not portable - "
+                 "use gnulib module pthread_mutex_timedlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEX_UNLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutex_unlock
+#   define pthread_mutex_unlock rpl_pthread_mutex_unlock
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)
+                                             _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutex_unlock, int, (pthread_mutex_t *mutex));
+# else
+#  if !@HAVE_PTHREAD_MUTEX_UNLOCK@
+_GL_FUNCDECL_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex)
+                                             _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_mutex_unlock, int, (pthread_mutex_t *mutex));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_unlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_unlock
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_UNLOCK
+_GL_WARN_ON_USE (pthread_mutex_unlock, "pthread_mutex_unlock is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_MUTEX@
+# if @REPLACE_PTHREAD_MUTEX_DESTROY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_mutex_destroy
+#   define pthread_mutex_destroy rpl_pthread_mutex_destroy
+#  endif
+_GL_FUNCDECL_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)
+                                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_mutex_destroy, int, (pthread_mutex_t *mutex));
+# else
+#  if !@HAVE_PTHREAD_MUTEX_DESTROY@
+_GL_FUNCDECL_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex)
+                                              _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_mutex_destroy, int, (pthread_mutex_t *mutex));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_mutex_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_mutex_destroy
+# if HAVE_RAW_DECL_PTHREAD_MUTEX_DESTROY
+_GL_WARN_ON_USE (pthread_mutex_destroy, "pthread_mutex_destroy is not portable - "
+                 "use gnulib module pthread-mutex for portability");
+# endif
+#endif
+
+/* =========== Read-write lock functions =========== */
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_INIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlock_init
+#   define pthread_rwlock_init rpl_pthread_rwlock_init
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlock_init, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const pthread_rwlockattr_t *restrict attr)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_init, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const pthread_rwlockattr_t *restrict attr));
+# else
+#  if !@HAVE_PTHREAD_RWLOCK_INIT@
+_GL_FUNCDECL_SYS (pthread_rwlock_init, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const pthread_rwlockattr_t *restrict attr)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlock_init, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const pthread_rwlockattr_t *restrict attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_init
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_INIT
+_GL_WARN_ON_USE (pthread_rwlock_init, "pthread_rwlock_init is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCKATTR_INIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlockattr_init
+#   define pthread_rwlockattr_init rpl_pthread_rwlockattr_init
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)
+                                                _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr));
+# else
+#  if !@HAVE_PTHREAD_RWLOCKATTR_INIT@
+_GL_FUNCDECL_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr)
+                                                _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlockattr_init, int, (pthread_rwlockattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlockattr_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlockattr_init
+# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_INIT
+_GL_WARN_ON_USE (pthread_rwlockattr_init, "pthread_rwlockattr_init is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCKATTR_DESTROY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlockattr_destroy
+#   define pthread_rwlockattr_destroy rpl_pthread_rwlockattr_destroy
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlockattr_destroy, int,
+                  (pthread_rwlockattr_t *attr) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlockattr_destroy, int,
+                  (pthread_rwlockattr_t *attr));
+# else
+#  if !@HAVE_PTHREAD_RWLOCKATTR_DESTROY@
+_GL_FUNCDECL_SYS (pthread_rwlockattr_destroy, int,
+                  (pthread_rwlockattr_t *attr) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlockattr_destroy, int,
+                  (pthread_rwlockattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlockattr_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlockattr_destroy
+# if HAVE_RAW_DECL_PTHREAD_RWLOCKATTR_DESTROY
+_GL_WARN_ON_USE (pthread_rwlockattr_destroy, "pthread_rwlockattr_destroy is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_RDLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlock_rdlock
+#   define pthread_rwlock_rdlock rpl_pthread_rwlock_rdlock
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)
+                                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock));
+# else
+#  if !@HAVE_PTHREAD_RWLOCK_RDLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock)
+                                              _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlock_rdlock, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_rdlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_rdlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_RDLOCK
+_GL_WARN_ON_USE (pthread_rwlock_rdlock, "pthread_rwlock_rdlock is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_WRLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlock_wrlock
+#   define pthread_rwlock_wrlock rpl_pthread_rwlock_wrlock
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)
+                                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock));
+# else
+#  if !@HAVE_PTHREAD_RWLOCK_WRLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock)
+                                              _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlock_wrlock, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_wrlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_wrlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_WRLOCK
+_GL_WARN_ON_USE (pthread_rwlock_wrlock, "pthread_rwlock_wrlock is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_TRYRDLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlock_tryrdlock
+#   define pthread_rwlock_tryrdlock rpl_pthread_rwlock_tryrdlock
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)
+                                                 _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock));
+# else
+#  if !@HAVE_PTHREAD_RWLOCK_TRYRDLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock)
+                                                 _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlock_tryrdlock, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_tryrdlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_tryrdlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYRDLOCK
+_GL_WARN_ON_USE (pthread_rwlock_tryrdlock, "pthread_rwlock_tryrdlock is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_TRYWRLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlock_trywrlock
+#   define pthread_rwlock_trywrlock rpl_pthread_rwlock_trywrlock
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)
+                                                 _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock));
+# else
+#  if !@HAVE_PTHREAD_RWLOCK_TRYWRLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock)
+                                                 _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlock_trywrlock, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_trywrlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_trywrlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TRYWRLOCK
+_GL_WARN_ON_USE (pthread_rwlock_trywrlock, "pthread_rwlock_trywrlock is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlock_timedrdlock
+#   define pthread_rwlock_timedrdlock rpl_pthread_rwlock_timedrdlock
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlock_timedrdlock, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const struct timespec *restrict abstime)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_rwlock_timedrdlock, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const struct timespec *restrict abstime));
+# else
+#  if !@HAVE_PTHREAD_RWLOCK_TIMEDRDLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_timedrdlock, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const struct timespec *restrict abstime)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlock_timedrdlock, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const struct timespec *restrict abstime));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_timedrdlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_timedrdlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDRDLOCK
+_GL_WARN_ON_USE (pthread_rwlock_timedrdlock, "pthread_rwlock_timedrdlock is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlock_timedwrlock
+#   define pthread_rwlock_timedwrlock rpl_pthread_rwlock_timedwrlock
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlock_timedwrlock, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const struct timespec *restrict abstime)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_rwlock_timedwrlock, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const struct timespec *restrict abstime));
+# else
+#  if !@HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_timedwrlock, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const struct timespec *restrict abstime)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlock_timedwrlock, int,
+                  (pthread_rwlock_t *restrict lock,
+                   const struct timespec *restrict abstime));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_timedwrlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_timedwrlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_TIMEDWRLOCK
+_GL_WARN_ON_USE (pthread_rwlock_timedwrlock, "pthread_rwlock_timedwrlock is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_UNLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlock_unlock
+#   define pthread_rwlock_unlock rpl_pthread_rwlock_unlock
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)
+                                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock));
+# else
+#  if !@HAVE_PTHREAD_RWLOCK_UNLOCK@
+_GL_FUNCDECL_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock)
+                                              _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlock_unlock, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_unlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_unlock
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_UNLOCK
+_GL_WARN_ON_USE (pthread_rwlock_unlock, "pthread_rwlock_unlock is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_RWLOCK@
+# if @REPLACE_PTHREAD_RWLOCK_DESTROY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_rwlock_destroy
+#   define pthread_rwlock_destroy rpl_pthread_rwlock_destroy
+#  endif
+_GL_FUNCDECL_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)
+                                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock));
+# else
+#  if !@HAVE_PTHREAD_RWLOCK_DESTROY@
+_GL_FUNCDECL_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock)
+                                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_rwlock_destroy, int, (pthread_rwlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_rwlock_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_rwlock_destroy
+# if HAVE_RAW_DECL_PTHREAD_RWLOCK_DESTROY
+_GL_WARN_ON_USE (pthread_rwlock_destroy, "pthread_rwlock_destroy is not portable - "
+                 "use gnulib module pthread-rwlock for portability");
+# endif
+#endif
+
+/* =========== Condition variable functions =========== */
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_INIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_cond_init
+#   define pthread_cond_init rpl_pthread_cond_init
+#  endif
+_GL_FUNCDECL_RPL (pthread_cond_init, int,
+                  (pthread_cond_t *restrict cond,
+                   const pthread_condattr_t *restrict attr)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_cond_init, int,
+                  (pthread_cond_t *restrict cond,
+                   const pthread_condattr_t *restrict attr));
+# else
+#  if !@HAVE_PTHREAD_COND_INIT@
+_GL_FUNCDECL_SYS (pthread_cond_init, int,
+                  (pthread_cond_t *restrict cond,
+                   const pthread_condattr_t *restrict attr)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_cond_init, int,
+                  (pthread_cond_t *restrict cond,
+                   const pthread_condattr_t *restrict attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_init
+# if HAVE_RAW_DECL_PTHREAD_COND_INIT
+_GL_WARN_ON_USE (pthread_cond_init, "pthread_cond_init is not portable - "
+                 "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_CONDATTR_INIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_condattr_init
+#   define pthread_condattr_init rpl_pthread_condattr_init
+#  endif
+_GL_FUNCDECL_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr)
+                                              _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_condattr_init, int, (pthread_condattr_t *attr));
+# else
+#  if !@HAVE_PTHREAD_CONDATTR_INIT@
+_GL_FUNCDECL_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr)
+                                              _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_condattr_init, int, (pthread_condattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_condattr_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_condattr_init
+# if HAVE_RAW_DECL_PTHREAD_CONDATTR_INIT
+_GL_WARN_ON_USE (pthread_condattr_init, "pthread_condattr_init is not portable - "
+                 "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_CONDATTR_DESTROY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_condattr_destroy
+#   define pthread_condattr_destroy rpl_pthread_condattr_destroy
+#  endif
+_GL_FUNCDECL_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr)
+                                                 _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_condattr_destroy, int, (pthread_condattr_t *attr));
+# else
+#  if !@HAVE_PTHREAD_CONDATTR_DESTROY@
+_GL_FUNCDECL_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr)
+                                                 _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_condattr_destroy, int, (pthread_condattr_t *attr));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_condattr_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_condattr_destroy
+# if HAVE_RAW_DECL_PTHREAD_CONDATTR_DESTROY
+_GL_WARN_ON_USE (pthread_condattr_destroy, "pthread_condattr_destroy is not portable - "
+                 "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_WAIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_cond_wait
+#   define pthread_cond_wait rpl_pthread_cond_wait
+#  endif
+_GL_FUNCDECL_RPL (pthread_cond_wait, int,
+                  (pthread_cond_t *restrict cond,
+                   pthread_mutex_t *restrict mutex)
+                  _GL_ARG_NONNULL ((1, 2)));
+_GL_CXXALIAS_RPL (pthread_cond_wait, int,
+                  (pthread_cond_t *restrict cond,
+                   pthread_mutex_t *restrict mutex));
+# else
+#  if !@HAVE_PTHREAD_COND_WAIT@
+_GL_FUNCDECL_SYS (pthread_cond_wait, int,
+                  (pthread_cond_t *restrict cond,
+                   pthread_mutex_t *restrict mutex)
+                  _GL_ARG_NONNULL ((1, 2)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_cond_wait, int,
+                  (pthread_cond_t *restrict cond,
+                   pthread_mutex_t *restrict mutex));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_wait);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_wait
+# if HAVE_RAW_DECL_PTHREAD_COND_WAIT
+_GL_WARN_ON_USE (pthread_cond_wait, "pthread_cond_wait is not portable - "
+                 "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_TIMEDWAIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_cond_timedwait
+#   define pthread_cond_timedwait rpl_pthread_cond_timedwait
+#  endif
+_GL_FUNCDECL_RPL (pthread_cond_timedwait, int,
+                  (pthread_cond_t *restrict cond,
+                   pthread_mutex_t *restrict mutex,
+                   const struct timespec *restrict abstime)
+                  _GL_ARG_NONNULL ((1, 2, 3)));
+_GL_CXXALIAS_RPL (pthread_cond_timedwait, int,
+                  (pthread_cond_t *restrict cond,
+                   pthread_mutex_t *restrict mutex,
+                   const struct timespec *restrict abstime));
+# else
+#  if !@HAVE_PTHREAD_COND_TIMEDWAIT@
+_GL_FUNCDECL_SYS (pthread_cond_timedwait, int,
+                  (pthread_cond_t *restrict cond,
+                   pthread_mutex_t *restrict mutex,
+                   const struct timespec *restrict abstime)
+                  _GL_ARG_NONNULL ((1, 2, 3)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_cond_timedwait, int,
+                  (pthread_cond_t *restrict cond,
+                   pthread_mutex_t *restrict mutex,
+                   const struct timespec *restrict abstime));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_timedwait);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_timedwait
+# if HAVE_RAW_DECL_PTHREAD_COND_TIMEDWAIT
+_GL_WARN_ON_USE (pthread_cond_timedwait, "pthread_cond_timedwait is not portable - "
+                 "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_SIGNAL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_cond_signal
+#   define pthread_cond_signal rpl_pthread_cond_signal
+#  endif
+_GL_FUNCDECL_RPL (pthread_cond_signal, int, (pthread_cond_t *cond)
+                                            _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_cond_signal, int, (pthread_cond_t *cond));
+# else
+#  if !@HAVE_PTHREAD_COND_SIGNAL@
+_GL_FUNCDECL_SYS (pthread_cond_signal, int, (pthread_cond_t *cond)
+                                            _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_cond_signal, int, (pthread_cond_t *cond));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_signal);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_signal
+# if HAVE_RAW_DECL_PTHREAD_COND_SIGNAL
+_GL_WARN_ON_USE (pthread_cond_signal, "pthread_cond_signal is not portable - "
+                 "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_BROADCAST@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_cond_broadcast
+#   define pthread_cond_broadcast rpl_pthread_cond_broadcast
+#  endif
+_GL_FUNCDECL_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond)
+                                               _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_cond_broadcast, int, (pthread_cond_t *cond));
+# else
+#  if !@HAVE_PTHREAD_COND_BROADCAST@
+_GL_FUNCDECL_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond)
+                                               _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_cond_broadcast, int, (pthread_cond_t *cond));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_broadcast);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_broadcast
+# if HAVE_RAW_DECL_PTHREAD_COND_BROADCAST
+_GL_WARN_ON_USE (pthread_cond_broadcast, "pthread_cond_broadcast is not portable - "
+                 "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_COND@
+# if @REPLACE_PTHREAD_COND_DESTROY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_cond_destroy
+#   define pthread_cond_destroy rpl_pthread_cond_destroy
+#  endif
+_GL_FUNCDECL_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond)
+                                             _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_cond_destroy, int, (pthread_cond_t *cond));
+# else
+#  if !@HAVE_PTHREAD_COND_DESTROY@
+_GL_FUNCDECL_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond)
+                                             _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_cond_destroy, int, (pthread_cond_t *cond));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_cond_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_cond_destroy
+# if HAVE_RAW_DECL_PTHREAD_COND_DESTROY
+_GL_WARN_ON_USE (pthread_cond_destroy, "pthread_cond_destroy is not portable - "
+                 "use gnulib module pthread-cond for portability");
+# endif
+#endif
+
+/* =========== Thread-specific storage functions =========== */
+
+#if @GNULIB_PTHREAD_TSS@
+# if @REPLACE_PTHREAD_KEY_CREATE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_key_create
+#   define pthread_key_create rpl_pthread_key_create
+#  endif
+_GL_FUNCDECL_RPL (pthread_key_create, int,
+                  (pthread_key_t *keyp, void (*destructor) (void *))
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_key_create, int,
+                  (pthread_key_t *keyp, void (*destructor) (void *)));
+# else
+#  if !@HAVE_PTHREAD_KEY_CREATE@
+_GL_FUNCDECL_SYS (pthread_key_create, int,
+                  (pthread_key_t *keyp, void (*destructor) (void *))
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS_CAST (pthread_key_create, int,
+                       (pthread_key_t *keyp, void (*destructor) (void *)));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_key_create);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_key_create
+# if HAVE_RAW_DECL_PTHREAD_KEY_CREATE
+_GL_WARN_ON_USE (pthread_key_create, "pthread_key_create is not portable - "
+                 "use gnulib module pthread-tss for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_TSS@
+# if @REPLACE_PTHREAD_SETSPECIFIC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_setspecific
+#   define pthread_setspecific rpl_pthread_setspecific
+#  endif
+_GL_FUNCDECL_RPL (pthread_setspecific, int,
+                  (pthread_key_t key, const void *value));
+_GL_CXXALIAS_RPL (pthread_setspecific, int,
+                  (pthread_key_t key, const void *value));
+# else
+#  if !@HAVE_PTHREAD_SETSPECIFIC@
+_GL_FUNCDECL_SYS (pthread_setspecific, int,
+                  (pthread_key_t key, const void *value));
+#  endif
+_GL_CXXALIAS_SYS (pthread_setspecific, int,
+                  (pthread_key_t key, const void *value));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_setspecific);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_setspecific
+# if HAVE_RAW_DECL_PTHREAD_SETSPECIFIC
+_GL_WARN_ON_USE (pthread_setspecific, "pthread_setspecific is not portable - "
+                 "use gnulib module pthread-tss for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_TSS@
+# if @REPLACE_PTHREAD_GETSPECIFIC@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_getspecific
+#   define pthread_getspecific rpl_pthread_getspecific
+#  endif
+_GL_FUNCDECL_RPL (pthread_getspecific, void *, (pthread_key_t key));
+_GL_CXXALIAS_RPL (pthread_getspecific, void *, (pthread_key_t key));
+# else
+#  if !@HAVE_PTHREAD_GETSPECIFIC@
+_GL_FUNCDECL_SYS (pthread_getspecific, void *, (pthread_key_t key));
+#  endif
+_GL_CXXALIAS_SYS (pthread_getspecific, void *, (pthread_key_t key));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_getspecific);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_getspecific
+# if HAVE_RAW_DECL_PTHREAD_GETSPECIFIC
+_GL_WARN_ON_USE (pthread_getspecific, "pthread_getspecific is not portable - "
+                 "use gnulib module pthread-tss for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_TSS@
+# if @REPLACE_PTHREAD_KEY_DELETE@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_key_delete
+#   define pthread_key_delete rpl_pthread_key_delete
+#  endif
+_GL_FUNCDECL_RPL (pthread_key_delete, int, (pthread_key_t key));
+_GL_CXXALIAS_RPL (pthread_key_delete, int, (pthread_key_t key));
+# else
+#  if !@HAVE_PTHREAD_KEY_DELETE@
+_GL_FUNCDECL_SYS (pthread_key_delete, int, (pthread_key_t key));
+#  endif
+_GL_CXXALIAS_SYS (pthread_key_delete, int, (pthread_key_t key));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_key_delete);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_key_delete
+# if HAVE_RAW_DECL_PTHREAD_KEY_DELETE
+_GL_WARN_ON_USE (pthread_key_delete, "pthread_key_delete is not portable - "
+                 "use gnulib module pthread-tss for portability");
+# endif
+#endif
+
+/* =========== Spinlock functions =========== */
+
+#if @GNULIB_PTHREAD_SPIN@
+# if @REPLACE_PTHREAD_SPIN_INIT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_spin_init
+#   define pthread_spin_init rpl_pthread_spin_init
+#  endif
+_GL_FUNCDECL_RPL (pthread_spin_init, int,
+                  (pthread_spinlock_t *lock, int shared_across_processes)
+                  _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_spin_init, int,
+                  (pthread_spinlock_t *lock, int shared_across_processes));
+# else
+#  if !@HAVE_PTHREAD_SPIN_INIT@
+_GL_FUNCDECL_SYS (pthread_spin_init, int,
+                  (pthread_spinlock_t *lock, int shared_across_processes)
+                  _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_spin_init, int,
+                  (pthread_spinlock_t *lock, int shared_across_processes));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_spin_init);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_spin_init
+# if HAVE_RAW_DECL_PTHREAD_SPIN_INIT
+_GL_WARN_ON_USE (pthread_spin_init, "pthread_spin_init is not portable - "
+                 "use gnulib module pthread-spin for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_SPIN@
+# if @REPLACE_PTHREAD_SPIN_LOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_spin_lock
+#   define pthread_spin_lock rpl_pthread_spin_lock
+#  endif
+_GL_FUNCDECL_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock)
+                                          _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_spin_lock, int, (pthread_spinlock_t *lock));
+# else
+#  if !@HAVE_PTHREAD_SPIN_LOCK@
+_GL_FUNCDECL_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock)
+                                          _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_spin_lock, int, (pthread_spinlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_spin_lock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_spin_lock
+# if HAVE_RAW_DECL_PTHREAD_SPIN_LOCK
+_GL_WARN_ON_USE (pthread_spin_lock, "pthread_spin_lock is not portable - "
+                 "use gnulib module pthread-spin for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_SPIN@
+# if @REPLACE_PTHREAD_SPIN_TRYLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_spin_trylock
+#   define pthread_spin_trylock rpl_pthread_spin_trylock
+#  endif
+_GL_FUNCDECL_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock)
+                                             _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_spin_trylock, int, (pthread_spinlock_t *lock));
+# else
+#  if !@HAVE_PTHREAD_SPIN_TRYLOCK@
+_GL_FUNCDECL_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock)
+                                             _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_spin_trylock, int, (pthread_spinlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_spin_trylock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_spin_trylock
+# if HAVE_RAW_DECL_PTHREAD_SPIN_TRYLOCK
+_GL_WARN_ON_USE (pthread_spin_trylock, "pthread_spin_trylock is not portable - "
+                 "use gnulib module pthread-spin for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_SPIN@
+# if @REPLACE_PTHREAD_SPIN_UNLOCK@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_spin_unlock
+#   define pthread_spin_unlock rpl_pthread_spin_unlock
+#  endif
+_GL_FUNCDECL_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock)
+                                            _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_spin_unlock, int, (pthread_spinlock_t *lock));
+# else
+#  if !@HAVE_PTHREAD_SPIN_UNLOCK@
+_GL_FUNCDECL_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock)
+                                            _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_spin_unlock, int, (pthread_spinlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_spin_unlock);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_spin_unlock
+# if HAVE_RAW_DECL_PTHREAD_SPIN_UNLOCK
+_GL_WARN_ON_USE (pthread_spin_unlock, "pthread_spin_unlock is not portable - "
+                 "use gnulib module pthread-spin for portability");
+# endif
+#endif
+
+#if @GNULIB_PTHREAD_SPIN@
+# if @REPLACE_PTHREAD_SPIN_DESTROY@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pthread_spin_destroy
+#   define pthread_spin_destroy rpl_pthread_spin_destroy
+#  endif
+_GL_FUNCDECL_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock)
+                                             _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (pthread_spin_destroy, int, (pthread_spinlock_t *lock));
+# else
+#  if !@HAVE_PTHREAD_SPIN_DESTROY@
+_GL_FUNCDECL_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock)
+                                             _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (pthread_spin_destroy, int, (pthread_spinlock_t *lock));
+# endif
+# if __GLIBC__ >= 2
+_GL_CXXALIASWARN (pthread_spin_destroy);
+# endif
+#elif defined GNULIB_POSIXCHECK
+# undef pthread_spin_destroy
+# if HAVE_RAW_DECL_PTHREAD_SPIN_DESTROY
+_GL_WARN_ON_USE (pthread_spin_destroy, "pthread_spin_destroy is not portable - "
+                 "use gnulib module pthread-spin for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */
+#endif /* _@GUARD_PREFIX@_PTHREAD_H_ */
+#endif
diff --git a/tests/pthread_sigmask.c b/tests/pthread_sigmask.c
new file mode 100644 (file)
index 0000000..8a69204
--- /dev/null
@@ -0,0 +1,92 @@
+/* POSIX compatible signal blocking for threads.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <signal.h>
+
+#include <errno.h>
+#include <stddef.h>
+
+#if PTHREAD_SIGMASK_INEFFECTIVE
+# include <string.h>
+#endif
+
+#if PTHREAD_SIGMASK_UNBLOCK_BUG
+# include <unistd.h>
+#endif
+
+int
+pthread_sigmask (int how, const sigset_t *new_mask, sigset_t *old_mask)
+#undef pthread_sigmask
+{
+#if HAVE_PTHREAD_SIGMASK
+  int ret;
+
+# if PTHREAD_SIGMASK_INEFFECTIVE
+  sigset_t omask, omask_copy;
+  sigset_t *old_mask_ptr = &omask;
+  sigemptyset (&omask);
+  /* Add a signal unlikely to be blocked, so that OMASK_COPY
+     is unlikely to match the actual mask.  */
+  sigaddset (&omask, SIGILL);
+  memcpy (&omask_copy, &omask, sizeof omask);
+# else
+  sigset_t *old_mask_ptr = old_mask;
+# endif
+
+  ret = pthread_sigmask (how, new_mask, old_mask_ptr);
+
+# if PTHREAD_SIGMASK_INEFFECTIVE
+  if (ret == 0)
+    {
+      /* Detect whether pthread_sigmask is currently ineffective.
+         Don't cache the information: libpthread.so could be dynamically
+         loaded after the program started and after pthread_sigmask was
+         called for the first time.  */
+      if (memcmp (&omask_copy, &omask, sizeof omask) == 0
+          && pthread_sigmask (1729, &omask_copy, NULL) == 0)
+        {
+          /* pthread_sigmask is currently ineffective.  The program is not
+             linked to -lpthread.  So use sigprocmask instead.  */
+          return (sigprocmask (how, new_mask, old_mask) < 0 ? errno : 0);
+        }
+
+      if (old_mask)
+        memcpy (old_mask, &omask, sizeof omask);
+    }
+# endif
+# if PTHREAD_SIGMASK_FAILS_WITH_ERRNO
+  if (ret == -1)
+    return errno;
+# endif
+# if PTHREAD_SIGMASK_UNBLOCK_BUG
+  if (ret == 0
+      && new_mask != NULL
+      && (how == SIG_UNBLOCK || how == SIG_SETMASK))
+    {
+      /* Give the OS the opportunity to raise signals that were pending before
+         the pthread_sigmask call and have now been unblocked.  */
+      usleep (1);
+    }
+# endif
+  return ret;
+#else
+  int ret = sigprocmask (how, new_mask, old_mask);
+  return (ret < 0 ? errno : 0);
+#endif
+}
index e67712d..555474f 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2016 Free Software
+/* Copyright (C) 1991, 1994, 1997-1998, 2000, 2003-2021 Free Software
    Foundation, Inc.
 
    NOTE: The canonical source of this file is maintained with the GNU C
@@ -15,7 +15,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -34,7 +34,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 #endif
@@ -58,6 +58,12 @@ __libc_lock_define_initialized (static, envlock)
 # define UNLOCK
 #endif
 
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Don't assume that UNICODE is not defined.  */
+# undef SetEnvironmentVariable
+# define SetEnvironmentVariable SetEnvironmentVariableA
+#endif
+
 static int
 _unsetenv (const char *name)
 {
@@ -76,15 +82,13 @@ _unsetenv (const char *name)
 
 #if HAVE_DECL__PUTENV
   {
-    int putenv_result, putenv_errno;
+    int putenv_result;
     char *name_ = malloc (len + 2);
     memcpy (name_, name, len);
     name_[len] = '=';
     name_[len + 1] = 0;
     putenv_result = _putenv (name_);
-    putenv_errno = errno;
     free (name_);
-    __set_errno (putenv_errno);
     return putenv_result;
   }
 #else
@@ -138,7 +142,7 @@ putenv (char *string)
       /* _putenv ("NAME=") unsets NAME, so invoke _putenv ("NAME= ")
          to allocate the environ vector and then replace the new
          entry with "NAME=".  */
-      int putenv_result, putenv_errno;
+      int putenv_result;
       char *name_x = malloc (name_end - string + sizeof "= ");
       if (!name_x)
         return -1;
@@ -146,25 +150,23 @@ putenv (char *string)
       name_x[name_end - string + 1] = ' ';
       name_x[name_end - string + 2] = 0;
       putenv_result = _putenv (name_x);
-      putenv_errno = errno;
       for (ep = environ; *ep; ep++)
         if (strcmp (*ep, name_x) == 0)
           {
             *ep = string;
             break;
           }
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
       if (putenv_result == 0)
         {
           /* _putenv propagated "NAME= " into the subprocess environment;
              fix that by calling SetEnvironmentVariable directly.  */
           name_x[name_end - string] = 0;
           putenv_result = SetEnvironmentVariable (name_x, "") ? 0 : -1;
-          putenv_errno = ENOMEM; /* ENOMEM is the only way to fail.  */
+          errno = ENOMEM; /* ENOMEM is the only way to fail.  */
         }
 # endif
       free (name_x);
-      __set_errno (putenv_errno);
       return putenv_result;
     }
 #else
index afdc7fb..b369fdb 100644 (file)
@@ -1,5 +1,5 @@
 /* Some random 'double' numbers used by gnulib tests.
-   Copyright (C) 2012-2016 Free Software Foundation, Inc.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 323362c..caab38a 100644 (file)
@@ -1,5 +1,5 @@
 /* Some random 'long double' numbers used by gnulib tests.
-   Copyright (C) 2012-2016 Free Software Foundation, Inc.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/tests/read-file.c b/tests/read-file.c
new file mode 100644 (file)
index 0000000..3c581dc
--- /dev/null
@@ -0,0 +1,216 @@
+/* read-file.c -- read file contents into a string
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
+   Written by Simon Josefsson and Bruno Haible.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "read-file.h"
+
+/* Get fstat.  */
+#include <sys/stat.h>
+
+/* Get ftello.  */
+#include <stdio.h>
+
+/* Get PTRDIFF_MAX.  */
+#include <stdint.h>
+
+/* Get malloc, realloc, free. */
+#include <stdlib.h>
+
+/* Get explicit_bzero, memcpy. */
+#include <string.h>
+
+/* Get errno. */
+#include <errno.h>
+
+/* Read a STREAM and return a newly allocated string with the content,
+   and set *LENGTH to the length of the string.  The string is
+   zero-terminated, but the terminating zero byte is not counted in
+   *LENGTH.  On errors, *LENGTH is undefined, errno preserves the
+   values set by system functions (if any), and NULL is returned.
+
+   If the RF_SENSITIVE flag is set in FLAGS:
+     - You should control the buffering of STREAM using 'setvbuf'.  Either
+       clear the buffer of STREAM after closing it, or disable buffering of
+       STREAM before calling this function.
+     - The memory buffer internally allocated will be cleared upon failure.  */
+char *
+fread_file (FILE *stream, int flags, size_t *length)
+{
+  char *buf = NULL;
+  size_t alloc = BUFSIZ;
+
+  /* For a regular file, allocate a buffer that has exactly the right
+     size.  This avoids the need to do dynamic reallocations later.  */
+  {
+    struct stat st;
+
+    if (fstat (fileno (stream), &st) >= 0 && S_ISREG (st.st_mode))
+      {
+        off_t pos = ftello (stream);
+
+        if (pos >= 0 && pos < st.st_size)
+          {
+            off_t alloc_off = st.st_size - pos;
+
+            /* '1' below, accounts for the trailing NUL.  */
+            if (PTRDIFF_MAX - 1 < alloc_off)
+              {
+                errno = ENOMEM;
+                return NULL;
+              }
+
+            alloc = alloc_off + 1;
+          }
+      }
+  }
+
+  if (!(buf = malloc (alloc)))
+    return NULL; /* errno is ENOMEM.  */
+
+  {
+    size_t size = 0; /* number of bytes read so far */
+    int save_errno;
+
+    for (;;)
+      {
+        /* This reads 1 more than the size of a regular file
+           so that we get eof immediately.  */
+        size_t requested = alloc - size;
+        size_t count = fread (buf + size, 1, requested, stream);
+        size += count;
+
+        if (count != requested)
+          {
+            save_errno = errno;
+            if (ferror (stream))
+              break;
+
+            /* Shrink the allocated memory if possible.  */
+            if (size < alloc - 1)
+              {
+                if (flags & RF_SENSITIVE)
+                  {
+                    char *smaller_buf = malloc (size + 1);
+                    if (smaller_buf == NULL)
+                      explicit_bzero (buf + size, alloc - size);
+                    else
+                      {
+                        memcpy (smaller_buf, buf, size);
+                        explicit_bzero (buf, alloc);
+                        free (buf);
+                        buf = smaller_buf;
+                      }
+                  }
+                else
+                  {
+                    char *smaller_buf = realloc (buf, size + 1);
+                    if (smaller_buf != NULL)
+                      buf = smaller_buf;
+                  }
+              }
+
+            buf[size] = '\0';
+            *length = size;
+            return buf;
+          }
+
+        {
+          char *new_buf;
+          size_t save_alloc = alloc;
+
+          if (alloc == PTRDIFF_MAX)
+            {
+              save_errno = ENOMEM;
+              break;
+            }
+
+          if (alloc < PTRDIFF_MAX - alloc / 2)
+            alloc = alloc + alloc / 2;
+          else
+            alloc = PTRDIFF_MAX;
+
+          if (flags & RF_SENSITIVE)
+            {
+              new_buf = malloc (alloc);
+              if (!new_buf)
+                {
+                  /* BUF should be cleared below after the loop.  */
+                  save_errno = errno;
+                  break;
+                }
+              memcpy (new_buf, buf, save_alloc);
+              explicit_bzero (buf, save_alloc);
+              free (buf);
+            }
+          else if (!(new_buf = realloc (buf, alloc)))
+            {
+              save_errno = errno;
+              break;
+            }
+
+          buf = new_buf;
+        }
+      }
+
+    if (flags & RF_SENSITIVE)
+      explicit_bzero (buf, alloc);
+
+    free (buf);
+    errno = save_errno;
+    return NULL;
+  }
+}
+
+/* Open and read the contents of FILENAME, and return a newly
+   allocated string with the content, and set *LENGTH to the length of
+   the string.  The string is zero-terminated, but the terminating
+   zero byte is not counted in *LENGTH.  On errors, *LENGTH is
+   undefined, errno preserves the values set by system functions (if
+   any), and NULL is returned.
+
+   If the RF_BINARY flag is set in FLAGS, the file is opened in binary
+   mode.  If the RF_SENSITIVE flag is set in FLAGS, the memory buffer
+   internally allocated will be cleared upon failure.  */
+char *
+read_file (const char *filename, int flags, size_t *length)
+{
+  const char *mode = (flags & RF_BINARY) ? "rbe" : "re";
+  FILE *stream = fopen (filename, mode);
+  char *out;
+
+  if (!stream)
+    return NULL;
+
+  if (flags & RF_SENSITIVE)
+    setvbuf (stream, NULL, _IONBF, 0);
+
+  out = fread_file (stream, flags, length);
+
+  if (fclose (stream) != 0)
+    {
+      if (out)
+        {
+          if (flags & RF_SENSITIVE)
+            explicit_bzero (out, *length);
+          free (out);
+        }
+      return NULL;
+    }
+
+  return out;
+}
diff --git a/tests/read-file.h b/tests/read-file.h
new file mode 100644 (file)
index 0000000..2bfe657
--- /dev/null
@@ -0,0 +1,37 @@
+/* read-file.h -- read file contents into a string
+   Copyright (C) 2006, 2009-2021 Free Software Foundation, Inc.
+   Written by Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef READ_FILE_H
+#define READ_FILE_H
+
+/* Get size_t.  */
+#include <stddef.h>
+
+/* Get FILE.  */
+#include <stdio.h>
+
+/* Indicate that the file is treated as binary.  */
+#define RF_BINARY 0x1
+
+/* Indicate that the file content contains sensitive information.  */
+#define RF_SENSITIVE 0x2
+
+extern char *fread_file (FILE * stream, int flags, size_t * length);
+
+extern char *read_file (const char *filename, int flags, size_t * length);
+
+#endif /* READ_FILE_H */
diff --git a/tests/root-uid.h b/tests/root-uid.h
new file mode 100644 (file)
index 0000000..cb74a49
--- /dev/null
@@ -0,0 +1,30 @@
+/* The user ID that always has appropriate privileges in the POSIX sense.
+
+   Copyright 2012-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+   Written by Paul Eggert.  */
+
+#ifndef ROOT_UID_H_
+#define ROOT_UID_H_
+
+/* The user ID that always has appropriate privileges in the POSIX sense.  */
+#ifdef __TANDEM
+# define ROOT_UID 65535
+#else
+# define ROOT_UID 0
+#endif
+
+#endif
diff --git a/tests/sched_yield.c b/tests/sched_yield.c
new file mode 100644 (file)
index 0000000..ae0e936
--- /dev/null
@@ -0,0 +1,59 @@
+/* Schedule other threads to run.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <sched.h>
+
+#if (defined _WIN32 && ! defined __CYGWIN__) && USE_WINDOWS_THREADS
+/* Use Windows threads.  */
+
+# define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+# include <windows.h>
+
+int
+sched_yield (void)
+{
+  Sleep (0);
+  return 0;
+}
+
+#elif defined __KLIBC__
+/* OS/2 kLIBC implementation */
+
+# define INCL_DOS
+# include <os2.h>
+
+int
+sched_yield (void)
+{
+  DosSleep (0);
+  return 0;
+}
+
+#else
+/* Provide a dummy implementation for single-threaded applications.  */
+
+int
+sched_yield (void)
+{
+  return 0;
+}
+
+#endif
diff --git a/tests/select.c b/tests/select.c
new file mode 100644 (file)
index 0000000..56ac8bb
--- /dev/null
@@ -0,0 +1,597 @@
+/* Emulation for select(2)
+   Contributed by Paolo Bonzini.
+
+   Copyright 2008-2021 Free Software Foundation, Inc.
+
+   This file is part of gnulib.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License along
+   with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <sys/select.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Native Windows.  */
+
+#include <alloca.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <errno.h>
+#include <limits.h>
+
+#include <winsock2.h>
+#include <windows.h>
+#include <io.h>
+#include <stdio.h>
+#include <conio.h>
+#include <time.h>
+
+/* Get the overridden 'struct timeval'.  */
+#include <sys/time.h>
+
+#if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+#else
+# include <io.h>
+#endif
+
+#undef select
+
+/* Don't assume that UNICODE is not defined.  */
+#undef GetModuleHandle
+#define GetModuleHandle GetModuleHandleA
+#undef PeekConsoleInput
+#define PeekConsoleInput PeekConsoleInputA
+#undef CreateEvent
+#define CreateEvent CreateEventA
+#undef PeekMessage
+#define PeekMessage PeekMessageA
+#undef DispatchMessage
+#define DispatchMessage DispatchMessageA
+
+/* Avoid warnings from gcc -Wcast-function-type.  */
+#define GetProcAddress \
+  (void *) GetProcAddress
+
+struct bitset {
+  unsigned char in[FD_SETSIZE / CHAR_BIT];
+  unsigned char out[FD_SETSIZE / CHAR_BIT];
+};
+
+/* Declare data structures for ntdll functions.  */
+typedef struct _FILE_PIPE_LOCAL_INFORMATION {
+  ULONG NamedPipeType;
+  ULONG NamedPipeConfiguration;
+  ULONG MaximumInstances;
+  ULONG CurrentInstances;
+  ULONG InboundQuota;
+  ULONG ReadDataAvailable;
+  ULONG OutboundQuota;
+  ULONG WriteQuotaAvailable;
+  ULONG NamedPipeState;
+  ULONG NamedPipeEnd;
+} FILE_PIPE_LOCAL_INFORMATION, *PFILE_PIPE_LOCAL_INFORMATION;
+
+typedef struct _IO_STATUS_BLOCK
+{
+  union {
+    DWORD Status;
+    PVOID Pointer;
+  } u;
+  ULONG_PTR Information;
+} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK;
+
+typedef enum _FILE_INFORMATION_CLASS {
+  FilePipeLocalInformation = 24
+} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS;
+
+typedef DWORD (WINAPI *PNtQueryInformationFile)
+         (HANDLE, IO_STATUS_BLOCK *, VOID *, ULONG, FILE_INFORMATION_CLASS);
+
+#ifndef PIPE_BUF
+#define PIPE_BUF        512
+#endif
+
+static BOOL IsConsoleHandle (HANDLE h)
+{
+  DWORD mode;
+  return GetConsoleMode (h, &mode) != 0;
+}
+
+static BOOL
+IsSocketHandle (HANDLE h)
+{
+  WSANETWORKEVENTS ev;
+
+  if (IsConsoleHandle (h))
+    return FALSE;
+
+  /* Under Wine, it seems that getsockopt returns 0 for pipes too.
+     WSAEnumNetworkEvents instead distinguishes the two correctly.  */
+  ev.lNetworkEvents = 0xDEADBEEF;
+  WSAEnumNetworkEvents ((SOCKET) h, NULL, &ev);
+  return ev.lNetworkEvents != 0xDEADBEEF;
+}
+
+/* Compute output fd_sets for libc descriptor FD (whose Windows handle is
+   H).  */
+
+static int
+windows_poll_handle (HANDLE h, int fd,
+                     struct bitset *rbits,
+                     struct bitset *wbits,
+                     struct bitset *xbits)
+{
+  BOOL read, write, except;
+  int i, ret;
+  INPUT_RECORD *irbuffer;
+  DWORD avail, nbuffer;
+  BOOL bRet;
+  IO_STATUS_BLOCK iosb;
+  FILE_PIPE_LOCAL_INFORMATION fpli;
+  static PNtQueryInformationFile NtQueryInformationFile;
+  static BOOL once_only;
+
+  read = write = except = FALSE;
+  switch (GetFileType (h))
+    {
+    case FILE_TYPE_DISK:
+      read = TRUE;
+      write = TRUE;
+      break;
+
+    case FILE_TYPE_PIPE:
+      if (!once_only)
+        {
+          NtQueryInformationFile = (PNtQueryInformationFile)
+            GetProcAddress (GetModuleHandle ("ntdll.dll"),
+                            "NtQueryInformationFile");
+          once_only = TRUE;
+        }
+
+      if (PeekNamedPipe (h, NULL, 0, NULL, &avail, NULL) != 0)
+        {
+          if (avail)
+            read = TRUE;
+        }
+      else if (GetLastError () == ERROR_BROKEN_PIPE)
+        ;
+
+      else
+        {
+          /* It was the write-end of the pipe.  Check if it is writable.
+             If NtQueryInformationFile fails, optimistically assume the pipe is
+             writable.  This could happen on Windows 9x, where
+             NtQueryInformationFile is not available, or if we inherit a pipe
+             that doesn't permit FILE_READ_ATTRIBUTES access on the write end
+             (I think this should not happen since Windows XP SP2; WINE seems
+             fine too).  Otherwise, ensure that enough space is available for
+             atomic writes.  */
+          memset (&iosb, 0, sizeof (iosb));
+          memset (&fpli, 0, sizeof (fpli));
+
+          if (!NtQueryInformationFile
+              || NtQueryInformationFile (h, &iosb, &fpli, sizeof (fpli),
+                                         FilePipeLocalInformation)
+              || fpli.WriteQuotaAvailable >= PIPE_BUF
+              || (fpli.OutboundQuota < PIPE_BUF &&
+                  fpli.WriteQuotaAvailable == fpli.OutboundQuota))
+            write = TRUE;
+        }
+      break;
+
+    case FILE_TYPE_CHAR:
+      write = TRUE;
+      if (!(rbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1)))))
+        break;
+
+      ret = WaitForSingleObject (h, 0);
+      if (ret == WAIT_OBJECT_0)
+        {
+          if (!IsConsoleHandle (h))
+            {
+              read = TRUE;
+              break;
+            }
+
+          nbuffer = avail = 0;
+          bRet = GetNumberOfConsoleInputEvents (h, &nbuffer);
+
+          /* Screen buffers handles are filtered earlier.  */
+          assert (bRet);
+          if (nbuffer == 0)
+            {
+              except = TRUE;
+              break;
+            }
+
+          irbuffer = (INPUT_RECORD *) alloca (nbuffer * sizeof (INPUT_RECORD));
+          bRet = PeekConsoleInput (h, irbuffer, nbuffer, &avail);
+          if (!bRet || avail == 0)
+            {
+              except = TRUE;
+              break;
+            }
+
+          for (i = 0; i < avail; i++)
+            if (irbuffer[i].EventType == KEY_EVENT)
+              read = TRUE;
+        }
+      break;
+
+    default:
+      ret = WaitForSingleObject (h, 0);
+      write = TRUE;
+      if (ret == WAIT_OBJECT_0)
+        read = TRUE;
+
+      break;
+    }
+
+  ret = 0;
+  if (read && (rbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1)))))
+    {
+      rbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1)));
+      ret++;
+    }
+
+  if (write && (wbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1)))))
+    {
+      wbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1)));
+      ret++;
+    }
+
+  if (except && (xbits->in[fd / CHAR_BIT] & (1 << (fd & (CHAR_BIT - 1)))))
+    {
+      xbits->out[fd / CHAR_BIT] |= (1 << (fd & (CHAR_BIT - 1)));
+      ret++;
+    }
+
+  return ret;
+}
+
+int
+rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
+            struct timeval *timeout)
+#undef timeval
+{
+  static struct timeval tv0;
+  static HANDLE hEvent;
+  HANDLE h, handle_array[FD_SETSIZE + 2];
+  fd_set handle_rfds, handle_wfds, handle_xfds;
+  struct bitset rbits, wbits, xbits;
+  unsigned char anyfds_in[FD_SETSIZE / CHAR_BIT];
+  DWORD ret, wait_timeout, nhandles, nsock, nbuffer;
+  MSG msg;
+  int i, fd, rc;
+  clock_t tend;
+
+  if (nfds > FD_SETSIZE)
+    nfds = FD_SETSIZE;
+
+  if (!timeout)
+    wait_timeout = INFINITE;
+  else
+    {
+      wait_timeout = timeout->tv_sec * 1000 + timeout->tv_usec / 1000;
+
+      /* select is also used as a portable usleep.  */
+      if (!rfds && !wfds && !xfds)
+        {
+          Sleep (wait_timeout);
+          return 0;
+        }
+    }
+
+  if (!hEvent)
+    hEvent = CreateEvent (NULL, FALSE, FALSE, NULL);
+
+  handle_array[0] = hEvent;
+  nhandles = 1;
+  nsock = 0;
+
+  /* Copy descriptors to bitsets.  At the same time, eliminate
+     bits in the "wrong" direction for console input buffers
+     and screen buffers, because screen buffers are waitable
+     and they will block until a character is available.  */
+  memset (&rbits, 0, sizeof (rbits));
+  memset (&wbits, 0, sizeof (wbits));
+  memset (&xbits, 0, sizeof (xbits));
+  memset (anyfds_in, 0, sizeof (anyfds_in));
+  if (rfds)
+    for (i = 0; i < rfds->fd_count; i++)
+      {
+        fd = rfds->fd_array[i];
+        h = (HANDLE) _get_osfhandle (fd);
+        if (IsConsoleHandle (h)
+            && !GetNumberOfConsoleInputEvents (h, &nbuffer))
+          continue;
+
+        rbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+        anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+      }
+  else
+    rfds = (fd_set *) alloca (sizeof (fd_set));
+
+  if (wfds)
+    for (i = 0; i < wfds->fd_count; i++)
+      {
+        fd = wfds->fd_array[i];
+        h = (HANDLE) _get_osfhandle (fd);
+        if (IsConsoleHandle (h)
+            && GetNumberOfConsoleInputEvents (h, &nbuffer))
+          continue;
+
+        wbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+        anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+      }
+  else
+    wfds = (fd_set *) alloca (sizeof (fd_set));
+
+  if (xfds)
+    for (i = 0; i < xfds->fd_count; i++)
+      {
+        fd = xfds->fd_array[i];
+        xbits.in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+        anyfds_in[fd / CHAR_BIT] |= 1 << (fd & (CHAR_BIT - 1));
+      }
+  else
+    xfds = (fd_set *) alloca (sizeof (fd_set));
+
+  /* Zero all the fd_sets, including the application's.  */
+  FD_ZERO (rfds);
+  FD_ZERO (wfds);
+  FD_ZERO (xfds);
+  FD_ZERO (&handle_rfds);
+  FD_ZERO (&handle_wfds);
+  FD_ZERO (&handle_xfds);
+
+  /* Classify handles.  Create fd sets for sockets, poll the others. */
+  for (i = 0; i < nfds; i++)
+    {
+      if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0)
+        continue;
+
+      h = (HANDLE) _get_osfhandle (i);
+      if (!h)
+        {
+          errno = EBADF;
+          return -1;
+        }
+
+      if (IsSocketHandle (h))
+        {
+          int requested = FD_CLOSE;
+
+          /* See above; socket handles are mapped onto select, but we
+             need to map descriptors to handles.  */
+          if (rbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+            {
+              requested |= FD_READ | FD_ACCEPT;
+              FD_SET ((SOCKET) h, rfds);
+              FD_SET ((SOCKET) h, &handle_rfds);
+            }
+          if (wbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+            {
+              requested |= FD_WRITE | FD_CONNECT;
+              FD_SET ((SOCKET) h, wfds);
+              FD_SET ((SOCKET) h, &handle_wfds);
+            }
+          if (xbits.in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+            {
+              requested |= FD_OOB;
+              FD_SET ((SOCKET) h, xfds);
+              FD_SET ((SOCKET) h, &handle_xfds);
+            }
+
+          WSAEventSelect ((SOCKET) h, hEvent, requested);
+          nsock++;
+        }
+      else
+        {
+          handle_array[nhandles++] = h;
+
+          /* Poll now.  If we get an event, do not wait below.  */
+          if (wait_timeout != 0
+              && windows_poll_handle (h, i, &rbits, &wbits, &xbits))
+            wait_timeout = 0;
+        }
+    }
+
+  /* Place a sentinel at the end of the array.  */
+  handle_array[nhandles] = NULL;
+
+  /* When will the waiting period expire?  */
+  if (wait_timeout != INFINITE)
+    tend = clock () + wait_timeout;
+
+restart:
+  if (wait_timeout == 0 || nsock == 0)
+    rc = 0;
+  else
+    {
+      /* See if we need to wait in the loop below.  If any select is ready,
+         do MsgWaitForMultipleObjects anyway to dispatch messages, but
+         no need to call select again.  */
+      rc = select (0, &handle_rfds, &handle_wfds, &handle_xfds, &tv0);
+      if (rc == 0)
+        {
+          /* Restore the fd_sets for the other select we do below.  */
+          memcpy (&handle_rfds, rfds, sizeof (fd_set));
+          memcpy (&handle_wfds, wfds, sizeof (fd_set));
+          memcpy (&handle_xfds, xfds, sizeof (fd_set));
+        }
+      else
+        wait_timeout = 0;
+    }
+
+  /* How much is left to wait?  */
+  if (wait_timeout != INFINITE)
+    {
+      clock_t tnow = clock ();
+      if (tend >= tnow)
+        wait_timeout = tend - tnow;
+      else
+        wait_timeout = 0;
+    }
+
+  for (;;)
+    {
+      ret = MsgWaitForMultipleObjects (nhandles, handle_array, FALSE,
+                                       wait_timeout, QS_ALLINPUT);
+
+      if (ret == WAIT_OBJECT_0 + nhandles)
+        {
+          /* new input of some other kind */
+          BOOL bRet;
+          while ((bRet = PeekMessage (&msg, NULL, 0, 0, PM_REMOVE)) != 0)
+            {
+              TranslateMessage (&msg);
+              DispatchMessage (&msg);
+            }
+        }
+      else
+        break;
+    }
+
+  /* If we haven't done it yet, check the status of the sockets.  */
+  if (rc == 0 && nsock > 0)
+    rc = select (0, &handle_rfds, &handle_wfds, &handle_xfds, &tv0);
+
+  if (nhandles > 1)
+    {
+      /* Count results that are not counted in the return value of select.  */
+      nhandles = 1;
+      for (i = 0; i < nfds; i++)
+        {
+          if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0)
+            continue;
+
+          h = (HANDLE) _get_osfhandle (i);
+          if (h == handle_array[nhandles])
+            {
+              /* Not a socket.  */
+              nhandles++;
+              windows_poll_handle (h, i, &rbits, &wbits, &xbits);
+              if (rbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))
+                  || wbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))
+                  || xbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+                rc++;
+            }
+        }
+
+      if (rc == 0
+          && (wait_timeout == INFINITE
+              /* If NHANDLES > 1, but no bits are set, it means we've
+                 been told incorrectly that some handle was signaled.
+                 This happens with anonymous pipes, which always cause
+                 MsgWaitForMultipleObjects to exit immediately, but no
+                 data is found ready to be read by windows_poll_handle.
+                 To avoid a total failure (whereby we return zero and
+                 don't wait at all), let's poll in a more busy loop.  */
+              || (wait_timeout != 0 && nhandles > 1)))
+        {
+          /* Sleep 1 millisecond to avoid busy wait and retry with the
+             original fd_sets.  */
+          memcpy (&handle_rfds, rfds, sizeof (fd_set));
+          memcpy (&handle_wfds, wfds, sizeof (fd_set));
+          memcpy (&handle_xfds, xfds, sizeof (fd_set));
+          SleepEx (1, TRUE);
+          goto restart;
+        }
+      if (timeout && wait_timeout == 0 && rc == 0)
+        timeout->tv_sec = timeout->tv_usec = 0;
+    }
+
+  /* Now fill in the results.  */
+  FD_ZERO (rfds);
+  FD_ZERO (wfds);
+  FD_ZERO (xfds);
+  nhandles = 1;
+  for (i = 0; i < nfds; i++)
+    {
+      if ((anyfds_in[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1)))) == 0)
+        continue;
+
+      h = (HANDLE) _get_osfhandle (i);
+      if (h != handle_array[nhandles])
+        {
+          /* Perform handle->descriptor mapping.  */
+          WSAEventSelect ((SOCKET) h, NULL, 0);
+          if (FD_ISSET (h, &handle_rfds))
+            FD_SET (i, rfds);
+          if (FD_ISSET (h, &handle_wfds))
+            FD_SET (i, wfds);
+          if (FD_ISSET (h, &handle_xfds))
+            FD_SET (i, xfds);
+        }
+      else
+        {
+          /* Not a socket.  */
+          nhandles++;
+          if (rbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+            FD_SET (i, rfds);
+          if (wbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+            FD_SET (i, wfds);
+          if (xbits.out[i / CHAR_BIT] & (1 << (i & (CHAR_BIT - 1))))
+            FD_SET (i, xfds);
+        }
+    }
+
+  return rc;
+}
+
+#else /* ! Native Windows.  */
+
+#include <stddef.h> /* NULL */
+#include <errno.h>
+#include <unistd.h>
+
+#undef select
+
+int
+rpl_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *xfds,
+            struct timeval *timeout)
+{
+  int i;
+
+  /* FreeBSD 8.2 has a bug: it does not always detect invalid fds.  */
+  if (nfds < 0 || nfds > FD_SETSIZE)
+    {
+      errno = EINVAL;
+      return -1;
+    }
+  for (i = 0; i < nfds; i++)
+    {
+      if (((rfds && FD_ISSET (i, rfds))
+           || (wfds && FD_ISSET (i, wfds))
+           || (xfds && FD_ISSET (i, xfds)))
+          && dup2 (i, i) != i)
+        return -1;
+    }
+
+  /* Interix 3.5 has a bug: it does not support nfds == 0.  */
+  if (nfds == 0)
+    {
+      nfds = 1;
+      rfds = NULL;
+      wfds = NULL;
+      xfds = NULL;
+    }
+  return select (nfds, rfds, wfds, xfds, timeout);
+}
+
+#endif
index 85c32cb..78c7aaa 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2003, 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2003, 2005-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #if !_LIBC
 /* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
@@ -72,7 +72,7 @@ __libc_lock_define_initialized (static, envlock)
    values are from a small set.  Outside glibc this will eat up all
    memory after a while.  */
 #if defined _LIBC || (defined HAVE_SEARCH_H && defined HAVE_TSEARCH \
-                      && defined __GNUC__)
+                      && (defined __GNUC__ || defined __clang__))
 # define USE_TSEARCH    1
 # include <search.h>
 typedef int (*compar_fn_t) (const void *, const void *);
diff --git a/tests/setlocale.c b/tests/setlocale.c
deleted file mode 100644 (file)
index 7d366ed..0000000
+++ /dev/null
@@ -1,939 +0,0 @@
-/* Set the current locale.  -*- coding: utf-8 -*-
-   Copyright (C) 2009, 2011-2016 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
-
-#include <config.h>
-
-/* Override setlocale() so that when the default locale is requested
-   (locale = ""), the environment variables LC_ALL, LC_*, and LANG are
-   considered.
-   Also include all the functionality from libintl's setlocale() override.  */
-
-/* Please keep this file in sync with
-   gettext/gettext-runtime/intl/setlocale.c !  */
-
-/* Specification.  */
-#include <locale.h>
-
-#include <stdlib.h>
-#include <string.h>
-
-#include "localename.h"
-
-#if 1
-
-# undef setlocale
-
-/* Return string representation of locale category CATEGORY.  */
-static const char *
-category_to_name (int category)
-{
-  const char *retval;
-
-  switch (category)
-  {
-  case LC_COLLATE:
-    retval = "LC_COLLATE";
-    break;
-  case LC_CTYPE:
-    retval = "LC_CTYPE";
-    break;
-  case LC_MONETARY:
-    retval = "LC_MONETARY";
-    break;
-  case LC_NUMERIC:
-    retval = "LC_NUMERIC";
-    break;
-  case LC_TIME:
-    retval = "LC_TIME";
-    break;
-  case LC_MESSAGES:
-    retval = "LC_MESSAGES";
-    break;
-  default:
-    /* If you have a better idea for a default value let me know.  */
-    retval = "LC_XXX";
-  }
-
-  return retval;
-}
-
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-
-/* The native Windows setlocale() function expects locale names of the form
-   "German" or "German_Germany" or "DEU", but not "de" or "de_DE".  We need
-   to convert the names from the form with ISO 639 language code and ISO 3166
-   country code to the form with English names or with three-letter identifier.
-   The three-letter identifiers known by a Windows XP SP2 or SP3 are:
-     AFK  Afrikaans_South Africa.1252
-     ARA  Arabic_Saudi Arabia.1256
-     ARB  Arabic_Lebanon.1256
-     ARE  Arabic_Egypt.1256
-     ARG  Arabic_Algeria.1256
-     ARH  Arabic_Bahrain.1256
-     ARI  Arabic_Iraq.1256
-     ARJ  Arabic_Jordan.1256
-     ARK  Arabic_Kuwait.1256
-     ARL  Arabic_Libya.1256
-     ARM  Arabic_Morocco.1256
-     ARO  Arabic_Oman.1256
-     ARQ  Arabic_Qatar.1256
-     ARS  Arabic_Syria.1256
-     ART  Arabic_Tunisia.1256
-     ARU  Arabic_U.A.E..1256
-     ARY  Arabic_Yemen.1256
-     AZE  Azeri (Latin)_Azerbaijan.1254
-     BEL  Belarusian_Belarus.1251
-     BGR  Bulgarian_Bulgaria.1251
-     BSB  Bosnian_Bosnia and Herzegovina.1250
-     BSC  Bosnian (Cyrillic)_Bosnia and Herzegovina.1250  (wrong encoding!)
-     CAT  Catalan_Spain.1252
-     CHH  Chinese_Hong Kong S.A.R..950
-     CHI  Chinese_Singapore.936
-     CHS  Chinese_People's Republic of China.936
-     CHT  Chinese_Taiwan.950
-     CSY  Czech_Czech Republic.1250
-     CYM  Welsh_United Kingdom.1252
-     DAN  Danish_Denmark.1252
-     DEA  German_Austria.1252
-     DEC  German_Liechtenstein.1252
-     DEL  German_Luxembourg.1252
-     DES  German_Switzerland.1252
-     DEU  German_Germany.1252
-     ELL  Greek_Greece.1253
-     ENA  English_Australia.1252
-     ENB  English_Caribbean.1252
-     ENC  English_Canada.1252
-     ENG  English_United Kingdom.1252
-     ENI  English_Ireland.1252
-     ENJ  English_Jamaica.1252
-     ENL  English_Belize.1252
-     ENP  English_Republic of the Philippines.1252
-     ENS  English_South Africa.1252
-     ENT  English_Trinidad and Tobago.1252
-     ENU  English_United States.1252
-     ENW  English_Zimbabwe.1252
-     ENZ  English_New Zealand.1252
-     ESA  Spanish_Panama.1252
-     ESB  Spanish_Bolivia.1252
-     ESC  Spanish_Costa Rica.1252
-     ESD  Spanish_Dominican Republic.1252
-     ESE  Spanish_El Salvador.1252
-     ESF  Spanish_Ecuador.1252
-     ESG  Spanish_Guatemala.1252
-     ESH  Spanish_Honduras.1252
-     ESI  Spanish_Nicaragua.1252
-     ESL  Spanish_Chile.1252
-     ESM  Spanish_Mexico.1252
-     ESN  Spanish_Spain.1252
-     ESO  Spanish_Colombia.1252
-     ESP  Spanish_Spain.1252
-     ESR  Spanish_Peru.1252
-     ESS  Spanish_Argentina.1252
-     ESU  Spanish_Puerto Rico.1252
-     ESV  Spanish_Venezuela.1252
-     ESY  Spanish_Uruguay.1252
-     ESZ  Spanish_Paraguay.1252
-     ETI  Estonian_Estonia.1257
-     EUQ  Basque_Spain.1252
-     FAR  Farsi_Iran.1256
-     FIN  Finnish_Finland.1252
-     FOS  Faroese_Faroe Islands.1252
-     FPO  Filipino_Philippines.1252
-     FRA  French_France.1252
-     FRB  French_Belgium.1252
-     FRC  French_Canada.1252
-     FRL  French_Luxembourg.1252
-     FRM  French_Principality of Monaco.1252
-     FRS  French_Switzerland.1252
-     FYN  Frisian_Netherlands.1252
-     GLC  Galician_Spain.1252
-     HEB  Hebrew_Israel.1255
-     HRB  Croatian_Bosnia and Herzegovina.1250
-     HRV  Croatian_Croatia.1250
-     HUN  Hungarian_Hungary.1250
-     IND  Indonesian_Indonesia.1252
-     IRE  Irish_Ireland.1252
-     ISL  Icelandic_Iceland.1252
-     ITA  Italian_Italy.1252
-     ITS  Italian_Switzerland.1252
-     IUK  Inuktitut (Latin)_Canada.1252
-     JPN  Japanese_Japan.932
-     KKZ  Kazakh_Kazakhstan.1251
-     KOR  Korean_Korea.949
-     KYR  Kyrgyz_Kyrgyzstan.1251
-     LBX  Luxembourgish_Luxembourg.1252
-     LTH  Lithuanian_Lithuania.1257
-     LVI  Latvian_Latvia.1257
-     MKI  FYRO Macedonian_Former Yugoslav Republic of Macedonia.1251
-     MON  Mongolian_Mongolia.1251
-     MPD  Mapudungun_Chile.1252
-     MSB  Malay_Brunei Darussalam.1252
-     MSL  Malay_Malaysia.1252
-     MWK  Mohawk_Canada.1252
-     NLB  Dutch_Belgium.1252
-     NLD  Dutch_Netherlands.1252
-     NON  Norwegian-Nynorsk_Norway.1252
-     NOR  Norwegian (Bokmål)_Norway.1252
-     NSO  Northern Sotho_South Africa.1252
-     PLK  Polish_Poland.1250
-     PTB  Portuguese_Brazil.1252
-     PTG  Portuguese_Portugal.1252
-     QUB  Quechua_Bolivia.1252
-     QUE  Quechua_Ecuador.1252
-     QUP  Quechua_Peru.1252
-     RMC  Romansh_Switzerland.1252
-     ROM  Romanian_Romania.1250
-     RUS  Russian_Russia.1251
-     SKY  Slovak_Slovakia.1250
-     SLV  Slovenian_Slovenia.1250
-     SMA  Sami (Southern)_Norway.1252
-     SMB  Sami (Southern)_Sweden.1252
-     SME  Sami (Northern)_Norway.1252
-     SMF  Sami (Northern)_Sweden.1252
-     SMG  Sami (Northern)_Finland.1252
-     SMJ  Sami (Lule)_Norway.1252
-     SMK  Sami (Lule)_Sweden.1252
-     SMN  Sami (Inari)_Finland.1252
-     SMS  Sami (Skolt)_Finland.1252
-     SQI  Albanian_Albania.1250
-     SRB  Serbian (Cyrillic)_Serbia and Montenegro.1251
-     SRL  Serbian (Latin)_Serbia and Montenegro.1250
-     SRN  Serbian (Cyrillic)_Bosnia and Herzegovina.1251
-     SRS  Serbian (Latin)_Bosnia and Herzegovina.1250
-     SVE  Swedish_Sweden.1252
-     SVF  Swedish_Finland.1252
-     SWK  Swahili_Kenya.1252
-     THA  Thai_Thailand.874
-     TRK  Turkish_Turkey.1254
-     TSN  Tswana_South Africa.1252
-     TTT  Tatar_Russia.1251
-     UKR  Ukrainian_Ukraine.1251
-     URD  Urdu_Islamic Republic of Pakistan.1256
-     USA  English_United States.1252
-     UZB  Uzbek (Latin)_Uzbekistan.1254
-     VIT  Vietnamese_Viet Nam.1258
-     XHO  Xhosa_South Africa.1252
-     ZHH  Chinese_Hong Kong S.A.R..950
-     ZHI  Chinese_Singapore.936
-     ZHM  Chinese_Macau S.A.R..950
-     ZUL  Zulu_South Africa.1252
- */
-
-/* Table from ISO 639 language code, optionally with country or script suffix,
-   to English name.
-   Keep in sync with the gl_locale_name_from_win32_LANGID function in
-   localename.c!  */
-struct table_entry
-{
-  const char *code;
-  const char *english;
-};
-static const struct table_entry language_table[] =
-  {
-    { "af", "Afrikaans" },
-    { "am", "Amharic" },
-    { "ar", "Arabic" },
-    { "arn", "Mapudungun" },
-    { "as", "Assamese" },
-    { "az@cyrillic", "Azeri (Cyrillic)" },
-    { "az@latin", "Azeri (Latin)" },
-    { "ba", "Bashkir" },
-    { "be", "Belarusian" },
-    { "ber", "Tamazight" },
-    { "ber@arabic", "Tamazight (Arabic)" },
-    { "ber@latin", "Tamazight (Latin)" },
-    { "bg", "Bulgarian" },
-    { "bin", "Edo" },
-    { "bn", "Bengali" },
-    { "bn_BD", "Bengali (Bangladesh)" },
-    { "bn_IN", "Bengali (India)" },
-    { "bnt", "Sutu" },
-    { "bo", "Tibetan" },
-    { "br", "Breton" },
-    { "bs", "BSB" }, /* "Bosnian (Latin)" */
-    { "bs@cyrillic", "BSC" }, /* Bosnian (Cyrillic) */
-    { "ca", "Catalan" },
-    { "chr", "Cherokee" },
-    { "co", "Corsican" },
-    { "cpe", "Hawaiian" },
-    { "cs", "Czech" },
-    { "cy", "Welsh" },
-    { "da", "Danish" },
-    { "de", "German" },
-    { "dsb", "Lower Sorbian" },
-    { "dv", "Divehi" },
-    { "el", "Greek" },
-    { "en", "English" },
-    { "es", "Spanish" },
-    { "et", "Estonian" },
-    { "eu", "Basque" },
-    { "fa", "Farsi" },
-    { "ff", "Fulfulde" },
-    { "fi", "Finnish" },
-    { "fo", "Faroese" }, /* "Faeroese" does not work */
-    { "fr", "French" },
-    { "fy", "Frisian" },
-    { "ga", "IRE" }, /* Gaelic (Ireland) */
-    { "gd", "Gaelic (Scotland)" },
-    { "gd", "Scottish Gaelic" },
-    { "gl", "Galician" },
-    { "gn", "Guarani" },
-    { "gsw", "Alsatian" },
-    { "gu", "Gujarati" },
-    { "ha", "Hausa" },
-    { "he", "Hebrew" },
-    { "hi", "Hindi" },
-    { "hr", "Croatian" },
-    { "hsb", "Upper Sorbian" },
-    { "hu", "Hungarian" },
-    { "hy", "Armenian" },
-    { "id", "Indonesian" },
-    { "ig", "Igbo" },
-    { "ii", "Yi" },
-    { "is", "Icelandic" },
-    { "it", "Italian" },
-    { "iu", "IUK" }, /* Inuktitut */
-    { "ja", "Japanese" },
-    { "ka", "Georgian" },
-    { "kk", "Kazakh" },
-    { "kl", "Greenlandic" },
-    { "km", "Cambodian" },
-    { "km", "Khmer" },
-    { "kn", "Kannada" },
-    { "ko", "Korean" },
-    { "kok", "Konkani" },
-    { "kr", "Kanuri" },
-    { "ks", "Kashmiri" },
-    { "ks_IN", "Kashmiri_India" },
-    { "ks_PK", "Kashmiri (Arabic)_Pakistan" },
-    { "ky", "Kyrgyz" },
-    { "la", "Latin" },
-    { "lb", "Luxembourgish" },
-    { "lo", "Lao" },
-    { "lt", "Lithuanian" },
-    { "lv", "Latvian" },
-    { "mi", "Maori" },
-    { "mk", "FYRO Macedonian" },
-    { "mk", "Macedonian" },
-    { "ml", "Malayalam" },
-    { "mn", "Mongolian" },
-    { "mni", "Manipuri" },
-    { "moh", "Mohawk" },
-    { "mr", "Marathi" },
-    { "ms", "Malay" },
-    { "mt", "Maltese" },
-    { "my", "Burmese" },
-    { "nb", "NOR" }, /* Norwegian Bokmål */
-    { "ne", "Nepali" },
-    { "nic", "Ibibio" },
-    { "nl", "Dutch" },
-    { "nn", "NON" }, /* Norwegian Nynorsk */
-    { "no", "Norwegian" },
-    { "nso", "Northern Sotho" },
-    { "nso", "Sepedi" },
-    { "oc", "Occitan" },
-    { "om", "Oromo" },
-    { "or", "Oriya" },
-    { "pa", "Punjabi" },
-    { "pap", "Papiamentu" },
-    { "pl", "Polish" },
-    { "prs", "Dari" },
-    { "ps", "Pashto" },
-    { "pt", "Portuguese" },
-    { "qu", "Quechua" },
-    { "qut", "K'iche'" },
-    { "rm", "Romansh" },
-    { "ro", "Romanian" },
-    { "ru", "Russian" },
-    { "rw", "Kinyarwanda" },
-    { "sa", "Sanskrit" },
-    { "sah", "Yakut" },
-    { "sd", "Sindhi" },
-    { "se", "Sami (Northern)" },
-    { "se", "Northern Sami" },
-    { "si", "Sinhalese" },
-    { "sk", "Slovak" },
-    { "sl", "Slovenian" },
-    { "sma", "Sami (Southern)" },
-    { "sma", "Southern Sami" },
-    { "smj", "Sami (Lule)" },
-    { "smj", "Lule Sami" },
-    { "smn", "Sami (Inari)" },
-    { "smn", "Inari Sami" },
-    { "sms", "Sami (Skolt)" },
-    { "sms", "Skolt Sami" },
-    { "so", "Somali" },
-    { "sq", "Albanian" },
-    { "sr", "Serbian (Latin)" },
-    { "sr@cyrillic", "SRB" }, /* Serbian (Cyrillic) */
-    { "sv", "Swedish" },
-    { "sw", "Swahili" },
-    { "syr", "Syriac" },
-    { "ta", "Tamil" },
-    { "te", "Telugu" },
-    { "tg", "Tajik" },
-    { "th", "Thai" },
-    { "ti", "Tigrinya" },
-    { "tk", "Turkmen" },
-    { "tl", "Filipino" },
-    { "tn", "Tswana" },
-    { "tr", "Turkish" },
-    { "ts", "Tsonga" },
-    { "tt", "Tatar" },
-    { "ug", "Uighur" },
-    { "uk", "Ukrainian" },
-    { "ur", "Urdu" },
-    { "uz", "Uzbek" },
-    { "uz", "Uzbek (Latin)" },
-    { "uz@cyrillic", "Uzbek (Cyrillic)" },
-    { "ve", "Venda" },
-    { "vi", "Vietnamese" },
-    { "wen", "Sorbian" },
-    { "wo", "Wolof" },
-    { "xh", "Xhosa" },
-    { "yi", "Yiddish" },
-    { "yo", "Yoruba" },
-    { "zh", "Chinese" },
-    { "zu", "Zulu" }
-  };
-
-/* Table from ISO 3166 country code to English name.
-   Keep in sync with the gl_locale_name_from_win32_LANGID function in
-   localename.c!  */
-static const struct table_entry country_table[] =
-  {
-    { "AE", "U.A.E." },
-    { "AF", "Afghanistan" },
-    { "AL", "Albania" },
-    { "AM", "Armenia" },
-    { "AN", "Netherlands Antilles" },
-    { "AR", "Argentina" },
-    { "AT", "Austria" },
-    { "AU", "Australia" },
-    { "AZ", "Azerbaijan" },
-    { "BA", "Bosnia and Herzegovina" },
-    { "BD", "Bangladesh" },
-    { "BE", "Belgium" },
-    { "BG", "Bulgaria" },
-    { "BH", "Bahrain" },
-    { "BN", "Brunei Darussalam" },
-    { "BO", "Bolivia" },
-    { "BR", "Brazil" },
-    { "BT", "Bhutan" },
-    { "BY", "Belarus" },
-    { "BZ", "Belize" },
-    { "CA", "Canada" },
-    { "CG", "Congo" },
-    { "CH", "Switzerland" },
-    { "CI", "Cote d'Ivoire" },
-    { "CL", "Chile" },
-    { "CM", "Cameroon" },
-    { "CN", "People's Republic of China" },
-    { "CO", "Colombia" },
-    { "CR", "Costa Rica" },
-    { "CS", "Serbia and Montenegro" },
-    { "CZ", "Czech Republic" },
-    { "DE", "Germany" },
-    { "DK", "Denmark" },
-    { "DO", "Dominican Republic" },
-    { "DZ", "Algeria" },
-    { "EC", "Ecuador" },
-    { "EE", "Estonia" },
-    { "EG", "Egypt" },
-    { "ER", "Eritrea" },
-    { "ES", "Spain" },
-    { "ET", "Ethiopia" },
-    { "FI", "Finland" },
-    { "FO", "Faroe Islands" },
-    { "FR", "France" },
-    { "GB", "United Kingdom" },
-    { "GD", "Caribbean" },
-    { "GE", "Georgia" },
-    { "GL", "Greenland" },
-    { "GR", "Greece" },
-    { "GT", "Guatemala" },
-    { "HK", "Hong Kong" },
-    { "HK", "Hong Kong S.A.R." },
-    { "HN", "Honduras" },
-    { "HR", "Croatia" },
-    { "HT", "Haiti" },
-    { "HU", "Hungary" },
-    { "ID", "Indonesia" },
-    { "IE", "Ireland" },
-    { "IL", "Israel" },
-    { "IN", "India" },
-    { "IQ", "Iraq" },
-    { "IR", "Iran" },
-    { "IS", "Iceland" },
-    { "IT", "Italy" },
-    { "JM", "Jamaica" },
-    { "JO", "Jordan" },
-    { "JP", "Japan" },
-    { "KE", "Kenya" },
-    { "KG", "Kyrgyzstan" },
-    { "KH", "Cambodia" },
-    { "KR", "South Korea" },
-    { "KW", "Kuwait" },
-    { "KZ", "Kazakhstan" },
-    { "LA", "Laos" },
-    { "LB", "Lebanon" },
-    { "LI", "Liechtenstein" },
-    { "LK", "Sri Lanka" },
-    { "LT", "Lithuania" },
-    { "LU", "Luxembourg" },
-    { "LV", "Latvia" },
-    { "LY", "Libya" },
-    { "MA", "Morocco" },
-    { "MC", "Principality of Monaco" },
-    { "MD", "Moldava" },
-    { "MD", "Moldova" },
-    { "ME", "Montenegro" },
-    { "MK", "Former Yugoslav Republic of Macedonia" },
-    { "ML", "Mali" },
-    { "MM", "Myanmar" },
-    { "MN", "Mongolia" },
-    { "MO", "Macau S.A.R." },
-    { "MT", "Malta" },
-    { "MV", "Maldives" },
-    { "MX", "Mexico" },
-    { "MY", "Malaysia" },
-    { "NG", "Nigeria" },
-    { "NI", "Nicaragua" },
-    { "NL", "Netherlands" },
-    { "NO", "Norway" },
-    { "NP", "Nepal" },
-    { "NZ", "New Zealand" },
-    { "OM", "Oman" },
-    { "PA", "Panama" },
-    { "PE", "Peru" },
-    { "PH", "Philippines" },
-    { "PK", "Islamic Republic of Pakistan" },
-    { "PL", "Poland" },
-    { "PR", "Puerto Rico" },
-    { "PT", "Portugal" },
-    { "PY", "Paraguay" },
-    { "QA", "Qatar" },
-    { "RE", "Reunion" },
-    { "RO", "Romania" },
-    { "RS", "Serbia" },
-    { "RU", "Russia" },
-    { "RW", "Rwanda" },
-    { "SA", "Saudi Arabia" },
-    { "SE", "Sweden" },
-    { "SG", "Singapore" },
-    { "SI", "Slovenia" },
-    { "SK", "Slovak" },
-    { "SN", "Senegal" },
-    { "SO", "Somalia" },
-    { "SR", "Suriname" },
-    { "SV", "El Salvador" },
-    { "SY", "Syria" },
-    { "TH", "Thailand" },
-    { "TJ", "Tajikistan" },
-    { "TM", "Turkmenistan" },
-    { "TN", "Tunisia" },
-    { "TR", "Turkey" },
-    { "TT", "Trinidad and Tobago" },
-    { "TW", "Taiwan" },
-    { "TZ", "Tanzania" },
-    { "UA", "Ukraine" },
-    { "US", "United States" },
-    { "UY", "Uruguay" },
-    { "VA", "Vatican" },
-    { "VE", "Venezuela" },
-    { "VN", "Viet Nam" },
-    { "YE", "Yemen" },
-    { "ZA", "South Africa" },
-    { "ZW", "Zimbabwe" }
-  };
-
-/* Given a string STRING, find the set of indices i such that TABLE[i].code is
-   the given STRING.  It is a range [lo,hi-1].  */
-typedef struct { size_t lo; size_t hi; } range_t;
-static void
-search (const struct table_entry *table, size_t table_size, const char *string,
-        range_t *result)
-{
-  /* The table is sorted.  Perform a binary search.  */
-  size_t hi = table_size;
-  size_t lo = 0;
-  while (lo < hi)
-    {
-      /* Invariant:
-         for i < lo, strcmp (table[i].code, string) < 0,
-         for i >= hi, strcmp (table[i].code, string) > 0.  */
-      size_t mid = (hi + lo) >> 1; /* >= lo, < hi */
-      int cmp = strcmp (table[mid].code, string);
-      if (cmp < 0)
-        lo = mid + 1;
-      else if (cmp > 0)
-        hi = mid;
-      else
-        {
-          /* Found an i with
-               strcmp (language_table[i].code, string) == 0.
-             Find the entire interval of such i.  */
-          {
-            size_t i;
-
-            for (i = mid; i > lo; )
-              {
-                i--;
-                if (strcmp (table[i].code, string) < 0)
-                  {
-                    lo = i + 1;
-                    break;
-                  }
-              }
-          }
-          {
-            size_t i;
-
-            for (i = mid; i < hi; i++)
-              {
-                if (strcmp (table[i].code, string) > 0)
-                  {
-                    hi = i;
-                    break;
-                  }
-              }
-          }
-          /* The set of i with
-               strcmp (language_table[i].code, string) == 0
-             is the interval [lo, hi-1].  */
-          break;
-        }
-    }
-  result->lo = lo;
-  result->hi = hi;
-}
-
-/* Like setlocale, but accept also locale names in the form ll or ll_CC,
-   where ll is an ISO 639 language code and CC is an ISO 3166 country code.  */
-static char *
-setlocale_unixlike (int category, const char *locale)
-{
-  char *result;
-  char llCC_buf[64];
-  char ll_buf[64];
-  char CC_buf[64];
-
-  /* First, try setlocale with the original argument unchanged.  */
-  result = setlocale (category, locale);
-  if (result != NULL)
-    return result;
-
-  /* Otherwise, assume the argument is in the form
-       language[_territory][.codeset][@modifier]
-     and try to map it using the tables.  */
-  if (strlen (locale) < sizeof (llCC_buf))
-    {
-      /* Second try: Remove the codeset part.  */
-      {
-        const char *p = locale;
-        char *q = llCC_buf;
-
-        /* Copy the part before the dot.  */
-        for (; *p != '\0' && *p != '.'; p++, q++)
-          *q = *p;
-        if (*p == '.')
-          /* Skip the part up to the '@', if any.  */
-          for (; *p != '\0' && *p != '@'; p++)
-            ;
-        /* Copy the part starting with '@', if any.  */
-        for (; *p != '\0'; p++, q++)
-          *q = *p;
-        *q = '\0';
-      }
-      /* llCC_buf now contains
-           language[_territory][@modifier]
-       */
-      if (strcmp (llCC_buf, locale) != 0)
-        {
-          result = setlocale (category, llCC_buf);
-          if (result != NULL)
-            return result;
-        }
-      /* Look it up in language_table.  */
-      {
-        range_t range;
-        size_t i;
-
-        search (language_table,
-                sizeof (language_table) / sizeof (language_table[0]),
-                llCC_buf,
-                &range);
-
-        for (i = range.lo; i < range.hi; i++)
-          {
-            /* Try the replacement in language_table[i].  */
-            result = setlocale (category, language_table[i].english);
-            if (result != NULL)
-              return result;
-          }
-      }
-      /* Split language[_territory][@modifier]
-         into  ll_buf = language[@modifier]
-         and   CC_buf = territory
-       */
-      {
-        const char *underscore = strchr (llCC_buf, '_');
-        if (underscore != NULL)
-          {
-            const char *territory_start = underscore + 1;
-            const char *territory_end = strchr (territory_start, '@');
-            if (territory_end == NULL)
-              territory_end = territory_start + strlen (territory_start);
-
-            memcpy (ll_buf, llCC_buf, underscore - llCC_buf);
-            strcpy (ll_buf + (underscore - llCC_buf), territory_end);
-
-            memcpy (CC_buf, territory_start, territory_end - territory_start);
-            CC_buf[territory_end - territory_start] = '\0';
-
-            {
-              /* Look up ll_buf in language_table
-                 and CC_buf in country_table.  */
-              range_t language_range;
-
-              search (language_table,
-                      sizeof (language_table) / sizeof (language_table[0]),
-                      ll_buf,
-                      &language_range);
-              if (language_range.lo < language_range.hi)
-                {
-                  range_t country_range;
-
-                  search (country_table,
-                          sizeof (country_table) / sizeof (country_table[0]),
-                          CC_buf,
-                          &country_range);
-                  if (country_range.lo < country_range.hi)
-                    {
-                      size_t i;
-                      size_t j;
-
-                      for (i = language_range.lo; i < language_range.hi; i++)
-                        for (j = country_range.lo; j < country_range.hi; j++)
-                          {
-                            /* Concatenate the replacements.  */
-                            const char *part1 = language_table[i].english;
-                            size_t part1_len = strlen (part1);
-                            const char *part2 = country_table[j].english;
-                            size_t part2_len = strlen (part2) + 1;
-                            char buf[64+64];
-
-                            if (!(part1_len + 1 + part2_len <= sizeof (buf)))
-                              abort ();
-                            memcpy (buf, part1, part1_len);
-                            buf[part1_len] = '_';
-                            memcpy (buf + part1_len + 1, part2, part2_len);
-
-                            /* Try the concatenated replacements.  */
-                            result = setlocale (category, buf);
-                            if (result != NULL)
-                              return result;
-                          }
-                    }
-
-                  /* Try omitting the country entirely.  This may set a locale
-                     corresponding to the wrong country, but is better than
-                     failing entirely.  */
-                  {
-                    size_t i;
-
-                    for (i = language_range.lo; i < language_range.hi; i++)
-                      {
-                        /* Try only the language replacement.  */
-                        result =
-                          setlocale (category, language_table[i].english);
-                        if (result != NULL)
-                          return result;
-                      }
-                  }
-                }
-            }
-          }
-      }
-    }
-
-  /* Failed.  */
-  return NULL;
-}
-
-# else
-#  define setlocale_unixlike setlocale
-# endif
-
-# if LC_MESSAGES == 1729
-
-/* The system does not store an LC_MESSAGES locale category.  Do it here.  */
-static char lc_messages_name[64] = "C";
-
-/* Like setlocale, but support also LC_MESSAGES.  */
-static char *
-setlocale_single (int category, const char *locale)
-{
-  if (category == LC_MESSAGES)
-    {
-      if (locale != NULL)
-        {
-          lc_messages_name[sizeof (lc_messages_name) - 1] = '\0';
-          strncpy (lc_messages_name, locale, sizeof (lc_messages_name) - 1);
-        }
-      return lc_messages_name;
-    }
-  else
-    return setlocale_unixlike (category, locale);
-}
-
-# else
-#  define setlocale_single setlocale_unixlike
-# endif
-
-char *
-rpl_setlocale (int category, const char *locale)
-{
-  if (locale != NULL && locale[0] == '\0')
-    {
-      /* A request to the set the current locale to the default locale.  */
-      if (category == LC_ALL)
-        {
-          /* Set LC_CTYPE first.  Then the other categories.  */
-          static int const categories[] =
-            {
-              LC_NUMERIC,
-              LC_TIME,
-              LC_COLLATE,
-              LC_MONETARY,
-              LC_MESSAGES
-            };
-          char *saved_locale;
-          const char *base_name;
-          unsigned int i;
-
-          /* Back up the old locale, in case one of the steps fails.  */
-          saved_locale = setlocale (LC_ALL, NULL);
-          if (saved_locale == NULL)
-            return NULL;
-          saved_locale = strdup (saved_locale);
-          if (saved_locale == NULL)
-            return NULL;
-
-          /* Set LC_CTYPE category.  Set all other categories (except possibly
-             LC_MESSAGES) to the same value in the same call; this is likely to
-             save calls.  */
-          base_name =
-            gl_locale_name_environ (LC_CTYPE, category_to_name (LC_CTYPE));
-          if (base_name == NULL)
-            base_name = gl_locale_name_default ();
-
-          if (setlocale_unixlike (LC_ALL, base_name) == NULL)
-            goto fail;
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-          /* On native Windows, setlocale(LC_ALL,...) may succeed but set the
-             LC_CTYPE category to an invalid value ("C") when it does not
-             support the specified encoding.  Report a failure instead.  */
-          if (strchr (base_name, '.') != NULL
-              && strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
-            goto fail;
-# endif
-
-          for (i = 0; i < sizeof (categories) / sizeof (categories[0]); i++)
-            {
-              int cat = categories[i];
-              const char *name;
-
-              name = gl_locale_name_environ (cat, category_to_name (cat));
-              if (name == NULL)
-                name = gl_locale_name_default ();
-
-              /* If name is the same as base_name, it has already been set
-                 through the setlocale call before the loop.  */
-              if (strcmp (name, base_name) != 0
-# if LC_MESSAGES == 1729
-                  || cat == LC_MESSAGES
-# endif
-                 )
-                if (setlocale_single (cat, name) == NULL)
-                  goto fail;
-            }
-
-          /* All steps were successful.  */
-          free (saved_locale);
-          return setlocale (LC_ALL, NULL);
-
-        fail:
-          if (saved_locale[0] != '\0') /* don't risk an endless recursion */
-            setlocale (LC_ALL, saved_locale);
-          free (saved_locale);
-          return NULL;
-        }
-      else
-        {
-          const char *name =
-            gl_locale_name_environ (category, category_to_name (category));
-          if (name == NULL)
-            name = gl_locale_name_default ();
-
-          return setlocale_single (category, name);
-        }
-    }
-  else
-    {
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-      if (category == LC_ALL && locale != NULL && strchr (locale, '.') != NULL)
-        {
-          char *saved_locale;
-
-          /* Back up the old locale.  */
-          saved_locale = setlocale (LC_ALL, NULL);
-          if (saved_locale == NULL)
-            return NULL;
-          saved_locale = strdup (saved_locale);
-          if (saved_locale == NULL)
-            return NULL;
-
-          if (setlocale_unixlike (LC_ALL, locale) == NULL)
-            {
-              free (saved_locale);
-              return NULL;
-            }
-
-          /* On native Windows, setlocale(LC_ALL,...) may succeed but set the
-             LC_CTYPE category to an invalid value ("C") when it does not
-             support the specified encoding.  Report a failure instead.  */
-          if (strcmp (setlocale (LC_CTYPE, NULL), "C") == 0)
-            {
-              if (saved_locale[0] != '\0') /* don't risk an endless recursion */
-                setlocale (LC_ALL, saved_locale);
-              free (saved_locale);
-              return NULL;
-            }
-
-          /* It was really successful.  */
-          free (saved_locale);
-          return setlocale (LC_ALL, NULL);
-        }
-      else
-# endif
-        return setlocale_single (category, locale);
-    }
-}
-
-#endif
diff --git a/tests/setsockopt.c b/tests/setsockopt.c
new file mode 100644 (file)
index 0000000..b6f5dfc
--- /dev/null
@@ -0,0 +1,65 @@
+/* setsockopt.c --- wrappers for Windows setsockopt function
+
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get struct timeval. */
+#include <sys/time.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#undef setsockopt
+
+int
+rpl_setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen)
+{
+  SOCKET sock = FD_TO_SOCKET (fd);
+  int r;
+
+  if (sock == INVALID_SOCKET)
+    {
+      errno = EBADF;
+      return -1;
+    }
+  else
+    {
+      if (level == SOL_SOCKET
+          && (optname == SO_RCVTIMEO || optname == SO_SNDTIMEO))
+        {
+          const struct timeval *tv = optval;
+          int milliseconds = tv->tv_sec * 1000 + tv->tv_usec / 1000;
+          optval = &milliseconds;
+          r = setsockopt (sock, level, optname, optval, sizeof (int));
+        }
+      else
+        {
+          r = setsockopt (sock, level, optname, optval, optlen);
+        }
+
+      if (r < 0)
+        set_winsock_errno ();
+
+      return r;
+    }
+}
index 2df8067..f791783 100644 (file)
@@ -1,5 +1,5 @@
 /* Macro for checking that a function declaration is compliant.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #ifndef SIGNATURE_CHECK
 
index 997285e..cbb6042 100644 (file)
@@ -1,5 +1,5 @@
 /* Pausing execution of the current thread.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -24,7 +24,7 @@
 
 #include "verify.h"
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 # define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
diff --git a/tests/socket.c b/tests/socket.c
new file mode 100644 (file)
index 0000000..f5086ad
--- /dev/null
@@ -0,0 +1,53 @@
+/* socket.c --- wrappers for Windows socket function
+
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <config.h>
+
+#define WIN32_LEAN_AND_MEAN
+/* Get winsock2.h. */
+#include <sys/socket.h>
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+#include "w32sock.h"
+
+#include "sockets.h"
+
+/* Don't assume that UNICODE is defined.  */
+#undef WSASocket
+#define WSASocket WSASocketW
+
+int
+rpl_socket (int domain, int type, int protocol)
+{
+  SOCKET fh;
+
+  gl_sockets_startup (SOCKETS_1_1);
+
+  /* We have to use WSASocket() to create non-overlapped IO sockets.
+     Overlapped IO sockets cannot be used with read/write.  */
+  fh = WSASocket (domain, type, protocol, NULL, 0, 0);
+
+  if (fh == INVALID_SOCKET)
+    {
+      set_winsock_errno ();
+      return -1;
+    }
+  else
+    return SOCKET_TO_FD (fh);
+}
diff --git a/tests/sockets.c b/tests/sockets.c
new file mode 100644 (file)
index 0000000..2de48d2
--- /dev/null
@@ -0,0 +1,161 @@
+/* sockets.c --- wrappers for Windows socket functions
+
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Simon Josefsson */
+
+#include <config.h>
+
+/* Specification.  */
+#include "sockets.h"
+
+#if WINDOWS_SOCKETS
+
+/* This includes winsock2.h on MinGW. */
+# include <sys/socket.h>
+
+# include "fd-hook.h"
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
+
+/* Get set_winsock_errno, FD_TO_SOCKET etc. */
+# include "w32sock.h"
+
+static int
+close_fd_maybe_socket (const struct fd_hook *remaining_list,
+                       gl_close_fn primary,
+                       int fd)
+{
+  /* Note about multithread-safety: There is a race condition where, between
+     our calls to closesocket() and the primary close(), some other thread
+     could make system calls that allocate precisely the same HANDLE value
+     as sock; then the primary close() would call CloseHandle() on it.  */
+  SOCKET sock;
+  WSANETWORKEVENTS ev;
+
+  /* Test whether fd refers to a socket.  */
+  sock = FD_TO_SOCKET (fd);
+  ev.lNetworkEvents = 0xDEADBEEF;
+  WSAEnumNetworkEvents (sock, NULL, &ev);
+  if (ev.lNetworkEvents != 0xDEADBEEF)
+    {
+      /* fd refers to a socket.  */
+      /* FIXME: other applications, like squid, use an undocumented
+         _free_osfhnd free function.  But this is not enough: The 'osfile'
+         flags for fd also needs to be cleared, but it is hard to access it.
+         Instead, here we just close twice the file descriptor.  */
+      if (closesocket (sock))
+        {
+          set_winsock_errno ();
+          return -1;
+        }
+      else
+        {
+          /* This call frees the file descriptor and does a
+             CloseHandle ((HANDLE) _get_osfhandle (fd)), which fails.  */
+          _close (fd);
+          return 0;
+        }
+    }
+  else
+    /* Some other type of file descriptor.  */
+    return execute_close_hooks (remaining_list, primary, fd);
+}
+
+static int
+ioctl_fd_maybe_socket (const struct fd_hook *remaining_list,
+                       gl_ioctl_fn primary,
+                       int fd, int request, void *arg)
+{
+  SOCKET sock;
+  WSANETWORKEVENTS ev;
+
+  /* Test whether fd refers to a socket.  */
+  sock = FD_TO_SOCKET (fd);
+  ev.lNetworkEvents = 0xDEADBEEF;
+  WSAEnumNetworkEvents (sock, NULL, &ev);
+  if (ev.lNetworkEvents != 0xDEADBEEF)
+    {
+      /* fd refers to a socket.  */
+      if (ioctlsocket (sock, request, arg) < 0)
+        {
+          set_winsock_errno ();
+          return -1;
+        }
+      else
+        return 0;
+    }
+  else
+    /* Some other type of file descriptor.  */
+    return execute_ioctl_hooks (remaining_list, primary, fd, request, arg);
+}
+
+static struct fd_hook fd_sockets_hook;
+
+static int initialized_sockets_version /* = 0 */;
+
+#endif /* WINDOWS_SOCKETS */
+
+int
+gl_sockets_startup (int version _GL_UNUSED)
+{
+#if WINDOWS_SOCKETS
+  if (version > initialized_sockets_version)
+    {
+      WSADATA data;
+      int err;
+
+      err = WSAStartup (version, &data);
+      if (err != 0)
+        return 1;
+
+      if (data.wVersion != version)
+        {
+          WSACleanup ();
+          return 2;
+        }
+
+      if (initialized_sockets_version == 0)
+        register_fd_hook (close_fd_maybe_socket, ioctl_fd_maybe_socket,
+                          &fd_sockets_hook);
+
+      initialized_sockets_version = version;
+    }
+#endif
+
+  return 0;
+}
+
+int
+gl_sockets_cleanup (void)
+{
+#if WINDOWS_SOCKETS
+  int err;
+
+  initialized_sockets_version = 0;
+
+  unregister_fd_hook (&fd_sockets_hook);
+
+  err = WSACleanup ();
+  if (err != 0)
+    return 1;
+#endif
+
+  return 0;
+}
diff --git a/tests/sockets.h b/tests/sockets.h
new file mode 100644 (file)
index 0000000..e0729c2
--- /dev/null
@@ -0,0 +1,66 @@
+/* sockets.h - wrappers for Windows socket functions
+
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Simon Josefsson */
+
+#ifndef SOCKETS_H
+#define SOCKETS_H 1
+
+#define SOCKETS_1_0 0x0001
+#define SOCKETS_1_1 0x0101
+#define SOCKETS_2_0 0x0002
+#define SOCKETS_2_1 0x0102
+#define SOCKETS_2_2 0x0202
+
+int gl_sockets_startup (int version)
+#ifndef WINDOWS_SOCKETS
+  _GL_ATTRIBUTE_CONST
+#endif
+  ;
+
+int gl_sockets_cleanup (void)
+#ifndef WINDOWS_SOCKETS
+  _GL_ATTRIBUTE_CONST
+#endif
+  ;
+
+/* This function is useful it you create a socket using gnulib's
+   Winsock wrappers but needs to pass on the socket handle to some
+   other library that only accepts sockets. */
+#ifdef WINDOWS_SOCKETS
+
+# include <sys/socket.h>
+
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
+
+static inline SOCKET
+gl_fd_to_handle (int fd)
+{
+  return _get_osfhandle (fd);
+}
+
+#else
+
+# define gl_fd_to_handle(x) (x)
+
+#endif /* WINDOWS_SOCKETS */
+
+#endif /* SOCKETS_H */
diff --git a/tests/strerror_r.c b/tests/strerror_r.c
new file mode 100644 (file)
index 0000000..71965fb
--- /dev/null
@@ -0,0 +1,452 @@
+/* strerror_r.c --- POSIX compatible system error routine
+
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+
+#include <config.h>
+
+/* Enable declaration of sys_nerr and sys_errlist in <errno.h> on NetBSD.  */
+#define _NETBSD_SOURCE 1
+
+/* Specification.  */
+#include <string.h>
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#if !HAVE_SNPRINTF
+# include <stdarg.h>
+#endif
+
+#include "strerror-override.h"
+
+#if (__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__) && HAVE___XPG_STRERROR_R /* glibc >= 2.3.4, cygwin >= 1.7.9 */
+
+# define USE_XPG_STRERROR_R 1
+extern
+#ifdef __cplusplus
+"C"
+#endif
+int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
+
+#elif HAVE_DECL_STRERROR_R && !(__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__)
+
+/* The system's strerror_r function is OK, except that its third argument
+   is 'int', not 'size_t', or its return type is wrong.  */
+
+# include <limits.h>
+
+# define USE_SYSTEM_STRERROR_R 1
+
+#else /* (__GLIBC__ >= 2 || defined __UCLIBC__ || defined __CYGWIN__ ? !HAVE___XPG_STRERROR_R : !HAVE_DECL_STRERROR_R) */
+
+/* Use the system's strerror().  Exclude glibc and cygwin because the
+   system strerror_r has the wrong return type, and cygwin 1.7.9
+   strerror_r clobbers strerror.  */
+# undef strerror
+
+# define USE_SYSTEM_STRERROR 1
+
+# if defined __NetBSD__ || defined __hpux || (defined _WIN32 && !defined __CYGWIN__) || defined __sgi || (defined __sun && !defined _LP64) || defined __CYGWIN__
+
+/* No locking needed.  */
+
+/* Get catgets internationalization functions.  */
+#  if HAVE_CATGETS
+#   include <nl_types.h>
+#  endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Get sys_nerr, sys_errlist on HP-UX (otherwise only declared in C++ mode).
+   Get sys_nerr, sys_errlist on IRIX (otherwise only declared with _SGIAPI).  */
+#  if defined __hpux || defined __sgi
+extern int sys_nerr;
+extern char *sys_errlist[];
+#  endif
+
+/* Get sys_nerr on Solaris.  */
+#  if defined __sun && !defined _LP64
+extern int sys_nerr;
+#  endif
+
+#ifdef __cplusplus
+}
+#endif
+
+# else
+
+#  include "glthread/lock.h"
+
+/* This lock protects the buffer returned by strerror().  We assume that
+   no other uses of strerror() exist in the program.  */
+gl_lock_define_initialized(static, strerror_lock)
+
+# endif
+
+#endif
+
+/* On MSVC, there is no snprintf() function, just a _snprintf().
+   It is of lower quality, but sufficient for the simple use here.
+   We only have to make sure to NUL terminate the result (_snprintf
+   does not NUL terminate, like strncpy).  */
+#if !HAVE_SNPRINTF
+static int
+local_snprintf (char *buf, size_t buflen, const char *format, ...)
+{
+  va_list args;
+  int result;
+
+  va_start (args, format);
+  result = _vsnprintf (buf, buflen, format, args);
+  va_end (args);
+  if (buflen > 0 && (result < 0 || result >= buflen))
+    buf[buflen - 1] = '\0';
+  return result;
+}
+# undef snprintf
+# define snprintf local_snprintf
+#endif
+
+/* Copy as much of MSG into BUF as possible, without corrupting errno.
+   Return 0 if MSG fit in BUFLEN, otherwise return ERANGE.  */
+static int
+safe_copy (char *buf, size_t buflen, const char *msg)
+{
+  size_t len = strlen (msg);
+  size_t moved = len < buflen ? len : buflen - 1;
+
+  /* Although POSIX lets memmove corrupt errno, we don't
+     know of any implementation where this is a real problem.  */
+  memmove (buf, msg, moved);
+  buf[moved] = '\0';
+  return len < buflen ? 0 : ERANGE;
+}
+
+
+int
+strerror_r (int errnum, char *buf, size_t buflen)
+#undef strerror_r
+{
+  /* Filter this out now, so that rest of this replacement knows that
+     there is room for a non-empty message and trailing NUL.  */
+  if (buflen <= 1)
+    {
+      if (buflen)
+        *buf = '\0';
+      return ERANGE;
+    }
+  *buf = '\0';
+
+  /* Check for gnulib overrides.  */
+  {
+    char const *msg = strerror_override (errnum);
+
+    if (msg)
+      return safe_copy (buf, buflen, msg);
+  }
+
+  {
+    int ret;
+    int saved_errno = errno;
+
+#if USE_XPG_STRERROR_R
+
+    {
+      ret = __xpg_strerror_r (errnum, buf, buflen);
+      if (ret < 0)
+        ret = errno;
+      if (!*buf)
+        {
+          /* glibc 2.13 would not touch buf on err, so we have to fall
+             back to GNU strerror_r which always returns a thread-safe
+             untruncated string to (partially) copy into our buf.  */
+          safe_copy (buf, buflen, strerror_r (errnum, buf, buflen));
+        }
+    }
+
+#elif USE_SYSTEM_STRERROR_R
+
+    if (buflen > INT_MAX)
+      buflen = INT_MAX;
+
+# ifdef __hpux
+    /* On HP-UX 11.31, strerror_r always fails when buflen < 80; it
+       also fails to change buf on EINVAL.  */
+    {
+      char stackbuf[80];
+
+      if (buflen < sizeof stackbuf)
+        {
+          ret = strerror_r (errnum, stackbuf, sizeof stackbuf);
+          if (ret == 0)
+            ret = safe_copy (buf, buflen, stackbuf);
+        }
+      else
+        ret = strerror_r (errnum, buf, buflen);
+    }
+# else
+    ret = strerror_r (errnum, buf, buflen);
+
+    /* Some old implementations may return (-1, EINVAL) instead of EINVAL.
+       But on Haiku, valid error numbers are negative.  */
+#  if !defined __HAIKU__
+    if (ret < 0)
+      ret = errno;
+#  endif
+# endif
+
+# if defined _AIX || defined __HAIKU__
+    /* AIX and Haiku return 0 rather than ERANGE when truncating strings; try
+       again until we are sure we got the entire string.  */
+    if (!ret && strlen (buf) == buflen - 1)
+      {
+        char stackbuf[STACKBUF_LEN];
+        size_t len;
+        strerror_r (errnum, stackbuf, sizeof stackbuf);
+        len = strlen (stackbuf);
+        /* STACKBUF_LEN should have been large enough.  */
+        if (len + 1 == sizeof stackbuf)
+          abort ();
+        if (buflen <= len)
+          ret = ERANGE;
+      }
+# else
+    /* Solaris 10 does not populate buf on ERANGE.  OpenBSD 4.7
+       truncates early on ERANGE rather than return a partial integer.
+       We prefer the maximal string.  We set buf[0] earlier, and we
+       know of no implementation that modifies buf to be an
+       unterminated string, so this strlen should be portable in
+       practice (rather than pulling in a safer strnlen).  */
+    if (ret == ERANGE && strlen (buf) < buflen - 1)
+      {
+        char stackbuf[STACKBUF_LEN];
+
+        /* STACKBUF_LEN should have been large enough.  */
+        if (strerror_r (errnum, stackbuf, sizeof stackbuf) == ERANGE)
+          abort ();
+        safe_copy (buf, buflen, stackbuf);
+      }
+# endif
+
+#else /* USE_SYSTEM_STRERROR */
+
+    /* Try to do what strerror (errnum) does, but without clobbering the
+       buffer used by strerror().  */
+
+# if defined __NetBSD__ || defined __hpux || (defined _WIN32 && !defined __CYGWIN__) || defined __CYGWIN__ /* NetBSD, HP-UX, native Windows, Cygwin */
+
+    /* NetBSD:         sys_nerr, sys_errlist are declared through _NETBSD_SOURCE
+                       and <errno.h> above.
+       HP-UX:          sys_nerr, sys_errlist are declared explicitly above.
+       native Windows: sys_nerr, sys_errlist are declared in <stdlib.h>.
+       Cygwin:         sys_nerr, sys_errlist are declared in <errno.h>.  */
+    if (errnum >= 0 && errnum < sys_nerr)
+      {
+#  if HAVE_CATGETS && (defined __NetBSD__ || defined __hpux)
+#   if defined __NetBSD__
+        nl_catd catd = catopen ("libc", NL_CAT_LOCALE);
+        const char *errmsg =
+          (catd != (nl_catd)-1
+           ? catgets (catd, 1, errnum, sys_errlist[errnum])
+           : sys_errlist[errnum]);
+#   endif
+#   if defined __hpux
+        nl_catd catd = catopen ("perror", NL_CAT_LOCALE);
+        const char *errmsg =
+          (catd != (nl_catd)-1
+           ? catgets (catd, 1, 1 + errnum, sys_errlist[errnum])
+           : sys_errlist[errnum]);
+#   endif
+#  else
+        const char *errmsg = sys_errlist[errnum];
+#  endif
+        if (errmsg == NULL || *errmsg == '\0')
+          ret = EINVAL;
+        else
+          ret = safe_copy (buf, buflen, errmsg);
+#  if HAVE_CATGETS && (defined __NetBSD__ || defined __hpux)
+        if (catd != (nl_catd)-1)
+          catclose (catd);
+#  endif
+      }
+    else
+      ret = EINVAL;
+
+# elif defined __sgi || (defined __sun && !defined _LP64) /* IRIX, Solaris <= 9 32-bit */
+
+    /* For a valid error number, the system's strerror() function returns
+       a pointer to a not copied string, not to a buffer.  */
+    if (errnum >= 0 && errnum < sys_nerr)
+      {
+        char *errmsg = strerror (errnum);
+
+        if (errmsg == NULL || *errmsg == '\0')
+          ret = EINVAL;
+        else
+          ret = safe_copy (buf, buflen, errmsg);
+      }
+    else
+      ret = EINVAL;
+
+# else
+
+    gl_lock_lock (strerror_lock);
+
+    {
+      char *errmsg = strerror (errnum);
+
+      /* For invalid error numbers, strerror() on
+           - IRIX 6.5 returns NULL,
+           - HP-UX 11 returns an empty string.  */
+      if (errmsg == NULL || *errmsg == '\0')
+        ret = EINVAL;
+      else
+        ret = safe_copy (buf, buflen, errmsg);
+    }
+
+    gl_lock_unlock (strerror_lock);
+
+# endif
+
+#endif
+
+#if defined _WIN32 && !defined __CYGWIN__
+    /* MSVC 14 defines names for many error codes in the range 100..140,
+       but _sys_errlist contains strings only for the error codes
+       < _sys_nerr = 43.  */
+    if (ret == EINVAL)
+      {
+        const char *errmsg;
+
+        switch (errnum)
+          {
+          case 100 /* EADDRINUSE */:
+            errmsg = "Address already in use";
+            break;
+          case 101 /* EADDRNOTAVAIL */:
+            errmsg = "Cannot assign requested address";
+            break;
+          case 102 /* EAFNOSUPPORT */:
+            errmsg = "Address family not supported by protocol";
+            break;
+          case 103 /* EALREADY */:
+            errmsg = "Operation already in progress";
+            break;
+          case 105 /* ECANCELED */:
+            errmsg = "Operation canceled";
+            break;
+          case 106 /* ECONNABORTED */:
+            errmsg = "Software caused connection abort";
+            break;
+          case 107 /* ECONNREFUSED */:
+            errmsg = "Connection refused";
+            break;
+          case 108 /* ECONNRESET */:
+            errmsg = "Connection reset by peer";
+            break;
+          case 109 /* EDESTADDRREQ */:
+            errmsg = "Destination address required";
+            break;
+          case 110 /* EHOSTUNREACH */:
+            errmsg = "No route to host";
+            break;
+          case 112 /* EINPROGRESS */:
+            errmsg = "Operation now in progress";
+            break;
+          case 113 /* EISCONN */:
+            errmsg = "Transport endpoint is already connected";
+            break;
+          case 114 /* ELOOP */:
+            errmsg = "Too many levels of symbolic links";
+            break;
+          case 115 /* EMSGSIZE */:
+            errmsg = "Message too long";
+            break;
+          case 116 /* ENETDOWN */:
+            errmsg = "Network is down";
+            break;
+          case 117 /* ENETRESET */:
+            errmsg = "Network dropped connection on reset";
+            break;
+          case 118 /* ENETUNREACH */:
+            errmsg = "Network is unreachable";
+            break;
+          case 119 /* ENOBUFS */:
+            errmsg = "No buffer space available";
+            break;
+          case 123 /* ENOPROTOOPT */:
+            errmsg = "Protocol not available";
+            break;
+          case 126 /* ENOTCONN */:
+            errmsg = "Transport endpoint is not connected";
+            break;
+          case 128 /* ENOTSOCK */:
+            errmsg = "Socket operation on non-socket";
+            break;
+          case 129 /* ENOTSUP */:
+            errmsg = "Not supported";
+            break;
+          case 130 /* EOPNOTSUPP */:
+            errmsg = "Operation not supported";
+            break;
+          case 132 /* EOVERFLOW */:
+            errmsg = "Value too large for defined data type";
+            break;
+          case 133 /* EOWNERDEAD */:
+            errmsg = "Owner died";
+            break;
+          case 134 /* EPROTO */:
+            errmsg = "Protocol error";
+            break;
+          case 135 /* EPROTONOSUPPORT */:
+            errmsg = "Protocol not supported";
+            break;
+          case 136 /* EPROTOTYPE */:
+            errmsg = "Protocol wrong type for socket";
+            break;
+          case 138 /* ETIMEDOUT */:
+            errmsg = "Connection timed out";
+            break;
+          case 140 /* EWOULDBLOCK */:
+            errmsg = "Operation would block";
+            break;
+          default:
+            errmsg = NULL;
+            break;
+          }
+        if (errmsg != NULL)
+          ret = safe_copy (buf, buflen, errmsg);
+      }
+#endif
+
+    if (ret == EINVAL && !*buf)
+      {
+#if defined __HAIKU__
+        /* For consistency with perror().  */
+        snprintf (buf, buflen, "Unknown Application Error (%d)", errnum);
+#else
+        snprintf (buf, buflen, "Unknown error %d", errnum);
+#endif
+      }
+
+    errno = saved_errno;
+    return ret;
+  }
+}
index d8684b6..2f6c0d4 100644 (file)
@@ -1,5 +1,5 @@
 /* Stub for symlink().
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -36,7 +36,7 @@ rpl_symlink (char const *contents, char const *name)
   if (len && name[len - 1] == '/')
     {
       struct stat st;
-      if (lstat (name, &st) == 0)
+      if (lstat (name, &st) == 0 || errno == EOVERFLOW)
         errno = EEXIST;
       return -1;
     }
diff --git a/tests/sys_ioctl.in.h b/tests/sys_ioctl.in.h
new file mode 100644 (file)
index 0000000..12c2cce
--- /dev/null
@@ -0,0 +1,79 @@
+/* Substitute for and wrapper around <sys/ioctl.h>.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+/* The include_next requires a split double-inclusion guard.  */
+#if @HAVE_SYS_IOCTL_H@
+# @INCLUDE_NEXT@ @NEXT_SYS_IOCTL_H@
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
+#define _@GUARD_PREFIX@_SYS_IOCTL_H
+
+/* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>,
+   but not in <sys/ioctl.h>.
+   Haiku declares ioctl() in <unistd.h>, but not in <sys/ioctl.h>.
+   But avoid namespace pollution on glibc systems.  */
+#ifndef __GLIBC__
+# include <unistd.h>
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
+/* Declare overridden functions.  */
+
+#if @GNULIB_IOCTL@
+# if @REPLACE_IOCTL@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef ioctl
+#   define ioctl rpl_ioctl
+#  endif
+_GL_FUNCDECL_RPL (ioctl, int,
+                  (int fd, int request, ... /* {void *,char *} arg */));
+_GL_CXXALIAS_RPL (ioctl, int,
+                  (int fd, int request, ... /* {void *,char *} arg */));
+# else
+#  if @SYS_IOCTL_H_HAVE_WINSOCK2_H@ || 1
+_GL_FUNCDECL_SYS (ioctl, int,
+                  (int fd, int request, ... /* {void *,char *} arg */));
+#  endif
+_GL_CXXALIAS_SYS (ioctl, int,
+                  (int fd, int request, ... /* {void *,char *} arg */));
+# endif
+_GL_CXXALIASWARN (ioctl);
+#elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
+# undef ioctl
+# define ioctl ioctl_used_without_requesting_gnulib_module_ioctl
+#elif defined GNULIB_POSIXCHECK
+# undef ioctl
+# if HAVE_RAW_DECL_IOCTL
+_GL_WARN_ON_USE (ioctl, "ioctl does not portably work on sockets - "
+                 "use gnulib module ioctl for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */
+#endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */
diff --git a/tests/sys_select.in.h b/tests/sys_select.in.h
new file mode 100644 (file)
index 0000000..1dacb21
--- /dev/null
@@ -0,0 +1,326 @@
+/* Substitute for <sys/select.h>.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+# if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+# endif
+@PRAGMA_COLUMNS@
+
+/* On OSF/1 and Solaris 2.6, <sys/types.h> and <sys/time.h>
+   both include <sys/select.h>.
+   On Cygwin, <sys/time.h> includes <sys/select.h>.
+   Simply delegate to the system's header in this case.  */
+#if (@HAVE_SYS_SELECT_H@                                                \
+     && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H             \
+     && ((defined __osf__ && defined _SYS_TYPES_H_                      \
+          && defined _OSF_SOURCE)                                       \
+         || (defined __sun && defined _SYS_TYPES_H                      \
+             && (! (defined _XOPEN_SOURCE || defined _POSIX_C_SOURCE)   \
+                 || defined __EXTENSIONS__))))
+
+# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TYPES_H
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+#elif (@HAVE_SYS_SELECT_H@                                              \
+       && (defined _CYGWIN_SYS_TIME_H                                   \
+           || (!defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H       \
+               && ((defined __osf__ && defined _SYS_TIME_H_             \
+                    && defined _OSF_SOURCE)                             \
+                   || (defined __sun && defined _SYS_TIME_H             \
+                       && (! (defined _XOPEN_SOURCE                     \
+                              || defined _POSIX_C_SOURCE)               \
+                           || defined __EXTENSIONS__))))))
+
+# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_TIME_H
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+/* On IRIX 6.5, <sys/timespec.h> includes <sys/types.h>, which includes
+   <sys/bsd_types.h>, which includes <sys/select.h>.  At this point we cannot
+   include <signal.h>, because that includes <internal/signal_core.h>, which
+   gives a syntax error because <sys/timespec.h> has not been completely
+   processed.  Simply delegate to the system's header in this case.  */
+#elif @HAVE_SYS_SELECT_H@ && defined __sgi && (defined _SYS_BSD_TYPES_H && !defined _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H)
+
+# define _GL_SYS_SELECT_H_REDIRECT_FROM_SYS_BSD_TYPES_H
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+/* On OpenBSD 5.0, <pthread.h> includes <sys/types.h>, which includes
+   <sys/select.h>.  At this point we cannot include <signal.h>, because that
+   includes gnulib's pthread.h override, which gives a syntax error because
+   /usr/include/pthread.h has not been completely processed.  Simply delegate
+   to the system's header in this case.  */
+#elif @HAVE_SYS_SELECT_H@ && defined __OpenBSD__ && (defined _PTHREAD_H_ && !defined PTHREAD_MUTEX_INITIALIZER)
+
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+#else
+
+#ifndef _@GUARD_PREFIX@_SYS_SELECT_H
+
+/* On many platforms, <sys/select.h> assumes prior inclusion of
+   <sys/types.h>.  Also, mingw defines sigset_t there, instead of
+   in <signal.h> where it belongs.  */
+#include <sys/types.h>
+
+#if @HAVE_SYS_SELECT_H@
+
+/* On OSF/1 4.0, <sys/select.h> provides only a forward declaration
+   of 'struct timeval', and no definition of this type.
+   Also, Mac OS X, AIX, HP-UX, IRIX, Solaris, Interix declare select()
+   in <sys/time.h>.
+   But avoid namespace pollution on glibc systems and "unknown type
+   name" problems on Cygwin.  */
+# if !(defined __GLIBC__ || defined __CYGWIN__)
+#  include <sys/time.h>
+# endif
+
+/* On AIX 7 and Solaris 10, <sys/select.h> provides an FD_ZERO implementation
+   that relies on memset(), but without including <string.h>.
+   But in any case avoid namespace pollution on glibc systems.  */
+# if (defined __OpenBSD__ || defined _AIX || defined __sun || defined __osf__ || defined __BEOS__) \
+     && ! defined __GLIBC__
+#  include <string.h>
+# endif
+
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_SYS_SELECT_H@
+
+#endif
+
+/* Get definition of 'sigset_t'.
+   But avoid namespace pollution on glibc systems and "unknown type
+   name" problems on Cygwin.
+   On OS/2 kLIBC, sigset_t is defined in <sys/select.h>, too. In addition,
+   if <sys/param.h> is included, <types.h> -> <sys/types.h> -> <sys/select.h>
+   are included. Then <signal.h> -> <pthread.h> are included by GNULIB. By the
+   way, <pthread.h> requires PAGE_SIZE defined in <sys/param.h>. However,
+   <sys/param.h> has not been processed, yet. As a result, 'PAGE_SIZE'
+   undeclared error occurs in <pthread.h>.
+   Do this after the include_next (for the sake of OpenBSD 5.0) but before
+   the split double-inclusion guard (for the sake of Solaris).  */
+#if !((defined __GLIBC__ || defined __CYGWIN__ || defined __KLIBC__) \
+      && !defined __UCLIBC__)
+# include <signal.h>
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_SELECT_H
+#define _@GUARD_PREFIX@_SYS_SELECT_H
+
+#if !@HAVE_SYS_SELECT_H@
+/* A platform that lacks <sys/select.h>.  */
+/* Get the 'struct timeval' and 'fd_set' types and the FD_* macros
+   on most platforms.  */
+# include <sys/time.h>
+/* On HP-UX 11, <sys/time.h> provides an FD_ZERO implementation
+   that relies on memset(), but without including <string.h>.  */
+# if defined __hpux
+#  include <string.h>
+# endif
+/* On native Windows platforms:
+   Get the 'fd_set' type.
+   Get the close() declaration before we override it.  */
+# if @HAVE_WINSOCK2_H@
+#  if !defined _GL_INCLUDING_WINSOCK2_H
+#   define _GL_INCLUDING_WINSOCK2_H
+#   include <winsock2.h>
+#   undef _GL_INCLUDING_WINSOCK2_H
+#  endif
+#  include <io.h>
+# endif
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+
+/* Fix some definitions from <winsock2.h>.  */
+
+#if @HAVE_WINSOCK2_H@
+
+# if !GNULIB_defined_rpl_fd_isset
+
+/* Re-define FD_ISSET to avoid a WSA call while we are not using
+   network sockets.  */
+static int
+rpl_fd_isset (SOCKET fd, fd_set * set)
+{
+  u_int i;
+  if (set == NULL)
+    return 0;
+
+  for (i = 0; i < set->fd_count; i++)
+    if (set->fd_array[i] == fd)
+      return 1;
+
+  return 0;
+}
+
+#  define GNULIB_defined_rpl_fd_isset 1
+# endif
+
+# undef FD_ISSET
+# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
+
+#endif
+
+/* Hide some function declarations from <winsock2.h>.  */
+
+#if @HAVE_WINSOCK2_H@
+# if !defined _@GUARD_PREFIX@_UNISTD_H
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef close
+#   define close close_used_without_including_unistd_h
+#  elif !defined __clang__
+    _GL_WARN_ON_USE (close,
+                     "close() used without including <unistd.h>");
+#  endif
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef gethostname
+#   define gethostname gethostname_used_without_including_unistd_h
+#  elif !defined __clang__
+    _GL_WARN_ON_USE (gethostname,
+                     "gethostname() used without including <unistd.h>");
+#  endif
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SOCKET_H
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef socket
+#   define socket              socket_used_without_including_sys_socket_h
+#   undef connect
+#   define connect             connect_used_without_including_sys_socket_h
+#   undef accept
+#   define accept              accept_used_without_including_sys_socket_h
+#   undef bind
+#   define bind                bind_used_without_including_sys_socket_h
+#   undef getpeername
+#   define getpeername         getpeername_used_without_including_sys_socket_h
+#   undef getsockname
+#   define getsockname         getsockname_used_without_including_sys_socket_h
+#   undef getsockopt
+#   define getsockopt          getsockopt_used_without_including_sys_socket_h
+#   undef listen
+#   define listen              listen_used_without_including_sys_socket_h
+#   undef recv
+#   define recv                recv_used_without_including_sys_socket_h
+#   undef send
+#   define send                send_used_without_including_sys_socket_h
+#   undef recvfrom
+#   define recvfrom            recvfrom_used_without_including_sys_socket_h
+#   undef sendto
+#   define sendto              sendto_used_without_including_sys_socket_h
+#   undef setsockopt
+#   define setsockopt          setsockopt_used_without_including_sys_socket_h
+#   undef shutdown
+#   define shutdown            shutdown_used_without_including_sys_socket_h
+#  elif !defined __clang__
+    _GL_WARN_ON_USE (socket,
+                     "socket() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (connect,
+                     "connect() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (accept,
+                     "accept() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (bind,
+                     "bind() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (getpeername,
+                     "getpeername() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (getsockname,
+                     "getsockname() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (getsockopt,
+                     "getsockopt() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (listen,
+                     "listen() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (recv,
+                     "recv() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (send,
+                     "send() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (recvfrom,
+                     "recvfrom() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (sendto,
+                     "sendto() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (setsockopt,
+                     "setsockopt() used without including <sys/socket.h>");
+    _GL_WARN_ON_USE (shutdown,
+                     "shutdown() used without including <sys/socket.h>");
+#  endif
+# endif
+#endif
+
+
+#if @GNULIB_PSELECT@
+# if @REPLACE_PSELECT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef pselect
+#   define pselect rpl_pselect
+#  endif
+_GL_FUNCDECL_RPL (pselect, int,
+                  (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+                   struct timespec const *restrict, const sigset_t *restrict));
+_GL_CXXALIAS_RPL (pselect, int,
+                  (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+                   struct timespec const *restrict, const sigset_t *restrict));
+# else
+#  if !@HAVE_PSELECT@
+_GL_FUNCDECL_SYS (pselect, int,
+                  (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+                   struct timespec const *restrict, const sigset_t *restrict));
+#  endif
+_GL_CXXALIAS_SYS (pselect, int,
+                  (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+                   struct timespec const *restrict, const sigset_t *restrict));
+# endif
+_GL_CXXALIASWARN (pselect);
+#elif defined GNULIB_POSIXCHECK
+# undef pselect
+# if HAVE_RAW_DECL_PSELECT
+_GL_WARN_ON_USE (pselect, "pselect is not portable - "
+                 "use gnulib module pselect for portability");
+# endif
+#endif
+
+#if @GNULIB_SELECT@
+# if @REPLACE_SELECT@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef select
+#   define select rpl_select
+#  endif
+_GL_FUNCDECL_RPL (select, int,
+                  (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+                   struct timeval *restrict));
+_GL_CXXALIAS_RPL (select, int,
+                  (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+                   timeval *restrict));
+# else
+_GL_CXXALIAS_SYS (select, int,
+                  (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+                   timeval *restrict));
+# endif
+_GL_CXXALIASWARN (select);
+#elif @HAVE_WINSOCK2_H@
+# undef select
+# define select select_used_without_requesting_gnulib_module_select
+#elif defined GNULIB_POSIXCHECK
+# undef select
+# if HAVE_RAW_DECL_SELECT
+_GL_WARN_ON_USE (select, "select is not always POSIX compliant - "
+                 "use gnulib module select for portability");
+# endif
+#endif
+
+
+#endif /* _@GUARD_PREFIX@_SYS_SELECT_H */
+#endif /* _@GUARD_PREFIX@_SYS_SELECT_H */
+#endif /* OSF/1 */
diff --git a/tests/sys_socket.c b/tests/sys_socket.c
new file mode 100644 (file)
index 0000000..3b261da
--- /dev/null
@@ -0,0 +1,4 @@
+#include <config.h>
+#define _GL_SYS_SOCKET_INLINE _GL_EXTERN_INLINE
+#include "sys/socket.h"
+typedef int dummy;
diff --git a/tests/sys_socket.in.h b/tests/sys_socket.in.h
new file mode 100644 (file)
index 0000000..2777007
--- /dev/null
@@ -0,0 +1,734 @@
+/* Provide a sys/socket header file for systems lacking it (read: MinGW)
+   and for systems where it is incomplete.
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+   Written by Simon Josefsson.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* This file is supposed to be used on platforms that lack <sys/socket.h>,
+   on platforms where <sys/socket.h> cannot be included standalone, and on
+   platforms where <sys/socket.h> does not provide all necessary definitions.
+   It is intended to provide definitions and prototypes needed by an
+   application.  */
+
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+#endif
+@PRAGMA_COLUMNS@
+
+#if defined _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+/* Special invocation convention:
+   - On Cygwin 1.5.x we have a sequence of nested includes
+     <sys/socket.h> -> <cygwin/socket.h> -> <asm/socket.h> -> <cygwin/if.h>,
+     and the latter includes <sys/socket.h>.  In this situation, the functions
+     are not yet declared, therefore we cannot provide the C++ aliases.  */
+
+#@INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
+
+#else
+/* Normal invocation convention.  */
+
+#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
+
+#if @HAVE_SYS_SOCKET_H@
+
+# define _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+
+/* On many platforms, <sys/socket.h> assumes prior inclusion of
+   <sys/types.h>.  */
+# include <sys/types.h>
+
+/* On FreeBSD 6.4, <sys/socket.h> defines some macros that assume that NULL
+   is defined.  */
+# include <stddef.h>
+
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_SYS_SOCKET_H@
+
+# undef _GL_ALREADY_INCLUDING_SYS_SOCKET_H
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_SOCKET_H
+#define _@GUARD_PREFIX@_SYS_SOCKET_H
+
+#ifndef _GL_INLINE_HEADER_BEGIN
+ #error "Please include config.h first."
+#endif
+_GL_INLINE_HEADER_BEGIN
+#ifndef _GL_SYS_SOCKET_INLINE
+# define _GL_SYS_SOCKET_INLINE _GL_INLINE
+#endif
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
+
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+#if !@HAVE_SA_FAMILY_T@
+# if !GNULIB_defined_sa_family_t
+/* On OS/2 kLIBC, sa_family_t is unsigned char unless TCPV40HDRS is defined. */
+#  if !defined __KLIBC__ || defined TCPV40HDRS
+typedef unsigned short  sa_family_t;
+#  else
+typedef unsigned char   sa_family_t;
+#  endif
+#  define GNULIB_defined_sa_family_t 1
+# endif
+#endif
+
+#if @HAVE_STRUCT_SOCKADDR_STORAGE@
+/* Make the 'struct sockaddr_storage' field 'ss_family' visible on AIX 7.1.  */
+# if !@HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY@
+#  ifndef ss_family
+#   define ss_family __ss_family
+#  endif
+# endif
+#else
+# include <stdalign.h>
+/* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
+   2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
+# define __ss_aligntype unsigned long int
+# define _SS_SIZE 256
+# define _SS_PADSIZE \
+    (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype)      \
+                  ? sizeof (sa_family_t)                                \
+                  : alignof (__ss_aligntype))                           \
+                 + sizeof (__ss_aligntype)))
+
+# if !GNULIB_defined_struct_sockaddr_storage
+struct sockaddr_storage
+{
+  sa_family_t ss_family;      /* Address family, etc.  */
+  __ss_aligntype __ss_align;  /* Force desired alignment.  */
+  char __ss_padding[_SS_PADSIZE];
+};
+#  define GNULIB_defined_struct_sockaddr_storage 1
+# endif
+
+#endif
+
+/* Get struct iovec.  */
+/* But avoid namespace pollution on glibc systems.  */
+#if ! defined __GLIBC__
+# include <sys/uio.h>
+#endif
+
+#if @HAVE_SYS_SOCKET_H@
+
+/* A platform that has <sys/socket.h>.  */
+
+/* For shutdown().  */
+# if !defined SHUT_RD
+#  define SHUT_RD 0
+# endif
+# if !defined SHUT_WR
+#  define SHUT_WR 1
+# endif
+# if !defined SHUT_RDWR
+#  define SHUT_RDWR 2
+# endif
+
+# ifdef __VMS                        /* OpenVMS */
+#  ifndef CMSG_SPACE
+#   define CMSG_SPACE(length) _CMSG_SPACE(length)
+#  endif
+#  ifndef CMSG_LEN
+#   define CMSG_LEN(length) _CMSG_LEN(length)
+#  endif
+# endif
+
+#else
+
+# ifdef __CYGWIN__
+#  error "Cygwin does have a sys/socket.h, doesn't it?!?"
+# endif
+
+/* A platform that lacks <sys/socket.h>.
+
+   Currently only MinGW is supported.  See the gnulib manual regarding
+   Windows sockets.  MinGW has the header files winsock2.h and
+   ws2tcpip.h that declare the sys/socket.h definitions we need.  Note
+   that you can influence which definitions you get by setting the
+   WINVER symbol before including these two files.  For example,
+   getaddrinfo is only available if _WIN32_WINNT >= 0x0501 (that
+   symbol is set indirectly through WINVER).  You can set this by
+   adding AC_DEFINE(WINVER, 0x0501) to configure.ac.  Note that your
+   code may not run on older Windows releases then.  My Windows 2000
+   box was not able to run the code, for example.  The situation is
+   slightly confusing because
+   <https://docs.microsoft.com/en-us/windows/desktop/api/ws2tcpip/nf-ws2tcpip-getaddrinfo>
+   suggests that getaddrinfo should be available on all Windows
+   releases. */
+
+# if @HAVE_WINSOCK2_H@
+#  include <winsock2.h>
+# endif
+# if @HAVE_WS2TCPIP_H@
+#  include <ws2tcpip.h>
+# endif
+
+/* For shutdown(). */
+# if !defined SHUT_RD && defined SD_RECEIVE
+#  define SHUT_RD SD_RECEIVE
+# endif
+# if !defined SHUT_WR && defined SD_SEND
+#  define SHUT_WR SD_SEND
+# endif
+# if !defined SHUT_RDWR && defined SD_BOTH
+#  define SHUT_RDWR SD_BOTH
+# endif
+
+# if @HAVE_WINSOCK2_H@
+/* Include headers needed by the emulation code.  */
+#  include <sys/types.h>
+#  include <io.h>
+/* If these headers don't define socklen_t, <config.h> does.  */
+# endif
+
+/* Rudimentary 'struct msghdr'; this works as long as you don't try to
+   access msg_control or msg_controllen.  */
+struct msghdr {
+  void *msg_name;
+  socklen_t msg_namelen;
+  struct iovec *msg_iov;
+  int msg_iovlen;
+  int msg_flags;
+};
+
+#endif
+
+/* Ensure SO_REUSEPORT is defined.  */
+/* For the subtle differences between SO_REUSEPORT and SO_REUSEADDR, see
+   https://stackoverflow.com/questions/14388706/socket-options-so-reuseaddr-and-so-reuseport-how-do-they-differ-do-they-mean-t
+   and https://lwn.net/Articles/542629/
+ */
+#ifndef SO_REUSEPORT
+# define SO_REUSEPORT SO_REUSEADDR
+#endif
+
+/* Fix some definitions from <winsock2.h>.  */
+
+#if @HAVE_WINSOCK2_H@
+
+# if !GNULIB_defined_rpl_fd_isset
+
+/* Re-define FD_ISSET to avoid a WSA call while we are not using
+   network sockets.  */
+_GL_SYS_SOCKET_INLINE int
+rpl_fd_isset (SOCKET fd, fd_set * set)
+{
+  u_int i;
+  if (set == NULL)
+    return 0;
+
+  for (i = 0; i < set->fd_count; i++)
+    if (set->fd_array[i] == fd)
+      return 1;
+
+  return 0;
+}
+
+#  define GNULIB_defined_rpl_fd_isset 1
+# endif
+
+# undef FD_ISSET
+# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
+
+#endif
+
+/* Hide some function declarations from <winsock2.h>.  */
+
+#if @HAVE_WINSOCK2_H@
+# if !defined _@GUARD_PREFIX@_UNISTD_H
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef close
+#   define close close_used_without_including_unistd_h
+#  elif !defined __clang__
+    _GL_WARN_ON_USE (close,
+                     "close() used without including <unistd.h>");
+#  endif
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef gethostname
+#   define gethostname gethostname_used_without_including_unistd_h
+#  else
+    _GL_WARN_ON_USE (gethostname,
+                     "gethostname() used without including <unistd.h>");
+#  endif
+# endif
+# if !defined _@GUARD_PREFIX@_SYS_SELECT_H
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef select
+#   define select select_used_without_including_sys_select_h
+#  else
+    _GL_WARN_ON_USE (select,
+                     "select() used without including <sys/select.h>");
+#  endif
+# endif
+#endif
+
+/* Wrap everything else to use libc file descriptors for sockets.  */
+
+#if @GNULIB_SOCKET@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef socket
+#   define socket rpl_socket
+#  endif
+_GL_FUNCDECL_RPL (socket, int, (int domain, int type, int protocol));
+_GL_CXXALIAS_RPL (socket, int, (int domain, int type, int protocol));
+# else
+_GL_CXXALIAS_SYS (socket, int, (int domain, int type, int protocol));
+# endif
+_GL_CXXALIASWARN (socket);
+#elif @HAVE_WINSOCK2_H@
+# undef socket
+# define socket socket_used_without_requesting_gnulib_module_socket
+#elif defined GNULIB_POSIXCHECK
+# undef socket
+# if HAVE_RAW_DECL_SOCKET
+_GL_WARN_ON_USE (socket, "socket is not always POSIX compliant - "
+                 "use gnulib module socket for portability");
+# endif
+#endif
+
+#if @GNULIB_CONNECT@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef connect
+#   define connect rpl_connect
+#  endif
+_GL_FUNCDECL_RPL (connect, int,
+                  (int fd, const struct sockaddr *addr, socklen_t addrlen)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (connect, int,
+                  (int fd, const struct sockaddr *addr, socklen_t addrlen));
+# else
+/* Need to cast, because on NonStop Kernel, the third parameter is
+                                                     size_t addrlen.  */
+_GL_CXXALIAS_SYS_CAST (connect, int,
+                       (int fd,
+                        const struct sockaddr *addr, socklen_t addrlen));
+# endif
+_GL_CXXALIASWARN (connect);
+#elif @HAVE_WINSOCK2_H@
+# undef connect
+# define connect socket_used_without_requesting_gnulib_module_connect
+#elif defined GNULIB_POSIXCHECK
+# undef connect
+# if HAVE_RAW_DECL_CONNECT
+_GL_WARN_ON_USE (connect, "connect is not always POSIX compliant - "
+                 "use gnulib module connect for portability");
+# endif
+#endif
+
+#if @GNULIB_ACCEPT@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef accept
+#   define accept rpl_accept
+#  endif
+_GL_FUNCDECL_RPL (accept, int,
+                  (int fd,
+                   struct sockaddr *restrict addr,
+                   socklen_t *restrict addrlen));
+_GL_CXXALIAS_RPL (accept, int,
+                  (int fd,
+                   struct sockaddr *restrict addr,
+                   socklen_t *restrict addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+                        void *addrlen.  */
+_GL_CXXALIAS_SYS_CAST (accept, int,
+                       (int fd,
+                        struct sockaddr *restrict addr,
+                        socklen_t *restrict addrlen));
+# endif
+_GL_CXXALIASWARN (accept);
+#elif @HAVE_WINSOCK2_H@
+# undef accept
+# define accept accept_used_without_requesting_gnulib_module_accept
+#elif defined GNULIB_POSIXCHECK
+# undef accept
+# if HAVE_RAW_DECL_ACCEPT
+_GL_WARN_ON_USE (accept, "accept is not always POSIX compliant - "
+                 "use gnulib module accept for portability");
+# endif
+#endif
+
+#if @GNULIB_BIND@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef bind
+#   define bind rpl_bind
+#  endif
+_GL_FUNCDECL_RPL (bind, int,
+                  (int fd, const struct sockaddr *addr, socklen_t addrlen)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (bind, int,
+                  (int fd, const struct sockaddr *addr, socklen_t addrlen));
+# else
+/* Need to cast, because on NonStop Kernel, the third parameter is
+                                                     size_t addrlen.  */
+_GL_CXXALIAS_SYS_CAST (bind, int,
+                       (int fd,
+                        const struct sockaddr *addr, socklen_t addrlen));
+# endif
+_GL_CXXALIASWARN (bind);
+#elif @HAVE_WINSOCK2_H@
+# undef bind
+# define bind bind_used_without_requesting_gnulib_module_bind
+#elif defined GNULIB_POSIXCHECK
+# undef bind
+# if HAVE_RAW_DECL_BIND
+_GL_WARN_ON_USE (bind, "bind is not always POSIX compliant - "
+                 "use gnulib module bind for portability");
+# endif
+#endif
+
+#if @GNULIB_GETPEERNAME@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getpeername
+#   define getpeername rpl_getpeername
+#  endif
+_GL_FUNCDECL_RPL (getpeername, int,
+                  (int fd, struct sockaddr *restrict addr,
+                   socklen_t *restrict addrlen)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (getpeername, int,
+                  (int fd, struct sockaddr *restrict addr,
+                   socklen_t *restrict addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+                        void *addrlen.  */
+_GL_CXXALIAS_SYS_CAST (getpeername, int,
+                       (int fd, struct sockaddr *restrict addr,
+                        socklen_t *restrict addrlen));
+# endif
+_GL_CXXALIASWARN (getpeername);
+#elif @HAVE_WINSOCK2_H@
+# undef getpeername
+# define getpeername getpeername_used_without_requesting_gnulib_module_getpeername
+#elif defined GNULIB_POSIXCHECK
+# undef getpeername
+# if HAVE_RAW_DECL_GETPEERNAME
+_GL_WARN_ON_USE (getpeername, "getpeername is not always POSIX compliant - "
+                 "use gnulib module getpeername for portability");
+# endif
+#endif
+
+#if @GNULIB_GETSOCKNAME@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getsockname
+#   define getsockname rpl_getsockname
+#  endif
+_GL_FUNCDECL_RPL (getsockname, int,
+                  (int fd, struct sockaddr *restrict addr,
+                   socklen_t *restrict addrlen)
+                  _GL_ARG_NONNULL ((2, 3)));
+_GL_CXXALIAS_RPL (getsockname, int,
+                  (int fd, struct sockaddr *restrict addr,
+                   socklen_t *restrict addrlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the third parameter is
+                        void *addrlen.  */
+_GL_CXXALIAS_SYS_CAST (getsockname, int,
+                       (int fd, struct sockaddr *restrict addr,
+                        socklen_t *restrict addrlen));
+# endif
+_GL_CXXALIASWARN (getsockname);
+#elif @HAVE_WINSOCK2_H@
+# undef getsockname
+# define getsockname getsockname_used_without_requesting_gnulib_module_getsockname
+#elif defined GNULIB_POSIXCHECK
+# undef getsockname
+# if HAVE_RAW_DECL_GETSOCKNAME
+_GL_WARN_ON_USE (getsockname, "getsockname is not always POSIX compliant - "
+                 "use gnulib module getsockname for portability");
+# endif
+#endif
+
+#if @GNULIB_GETSOCKOPT@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef getsockopt
+#   define getsockopt rpl_getsockopt
+#  endif
+_GL_FUNCDECL_RPL (getsockopt, int,
+                  (int fd, int level, int optname,
+                   void *restrict optval, socklen_t *restrict optlen)
+                  _GL_ARG_NONNULL ((4, 5)));
+_GL_CXXALIAS_RPL (getsockopt, int,
+                  (int fd, int level, int optname,
+                   void *restrict optval, socklen_t *restrict optlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the fifth parameter is
+                                                       void *optlen.  */
+_GL_CXXALIAS_SYS_CAST (getsockopt, int,
+                       (int fd, int level, int optname,
+                        void *restrict optval, socklen_t *restrict optlen));
+# endif
+_GL_CXXALIASWARN (getsockopt);
+#elif @HAVE_WINSOCK2_H@
+# undef getsockopt
+# define getsockopt getsockopt_used_without_requesting_gnulib_module_getsockopt
+#elif defined GNULIB_POSIXCHECK
+# undef getsockopt
+# if HAVE_RAW_DECL_GETSOCKOPT
+_GL_WARN_ON_USE (getsockopt, "getsockopt is not always POSIX compliant - "
+                 "use gnulib module getsockopt for portability");
+# endif
+#endif
+
+#if @GNULIB_LISTEN@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef listen
+#   define listen rpl_listen
+#  endif
+_GL_FUNCDECL_RPL (listen, int, (int fd, int backlog));
+_GL_CXXALIAS_RPL (listen, int, (int fd, int backlog));
+# else
+_GL_CXXALIAS_SYS (listen, int, (int fd, int backlog));
+# endif
+_GL_CXXALIASWARN (listen);
+#elif @HAVE_WINSOCK2_H@
+# undef listen
+# define listen listen_used_without_requesting_gnulib_module_listen
+#elif defined GNULIB_POSIXCHECK
+# undef listen
+# if HAVE_RAW_DECL_LISTEN
+_GL_WARN_ON_USE (listen, "listen is not always POSIX compliant - "
+                 "use gnulib module listen for portability");
+# endif
+#endif
+
+#if @GNULIB_RECV@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef recv
+#   define recv rpl_recv
+#  endif
+_GL_FUNCDECL_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags)
+                                 _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
+# else
+/* Need to cast, because on HP-UX 11.31 the return type may be
+                             int,
+   depending on compiler options.  */
+_GL_CXXALIAS_SYS_CAST (recv, ssize_t, (int fd, void *buf, size_t len, int flags));
+# endif
+_GL_CXXALIASWARN (recv);
+#elif @HAVE_WINSOCK2_H@
+# undef recv
+# define recv recv_used_without_requesting_gnulib_module_recv
+#elif defined GNULIB_POSIXCHECK
+# undef recv
+# if HAVE_RAW_DECL_RECV
+_GL_WARN_ON_USE (recv, "recv is not always POSIX compliant - "
+                 "use gnulib module recv for portability");
+# endif
+#endif
+
+#if @GNULIB_SEND@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef send
+#   define send rpl_send
+#  endif
+_GL_FUNCDECL_RPL (send, ssize_t,
+                  (int fd, const void *buf, size_t len, int flags)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (send, ssize_t,
+                  (int fd, const void *buf, size_t len, int flags));
+# else
+/* Need to cast, because on HP-UX 11.31 the return type may be
+                             int,
+   depending on compiler options.  */
+_GL_CXXALIAS_SYS_CAST (send, ssize_t,
+                       (int fd, const void *buf, size_t len, int flags));
+# endif
+_GL_CXXALIASWARN (send);
+#elif @HAVE_WINSOCK2_H@
+# undef send
+# define send send_used_without_requesting_gnulib_module_send
+#elif defined GNULIB_POSIXCHECK
+# undef send
+# if HAVE_RAW_DECL_SEND
+_GL_WARN_ON_USE (send, "send is not always POSIX compliant - "
+                 "use gnulib module send for portability");
+# endif
+#endif
+
+#if @GNULIB_RECVFROM@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef recvfrom
+#   define recvfrom rpl_recvfrom
+#  endif
+_GL_FUNCDECL_RPL (recvfrom, ssize_t,
+                  (int fd, void *restrict buf, size_t len, int flags,
+                   struct sockaddr *restrict from,
+                   socklen_t *restrict fromlen)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (recvfrom, ssize_t,
+                  (int fd, void *restrict buf, size_t len, int flags,
+                   struct sockaddr *restrict from,
+                   socklen_t *restrict fromlen));
+# else
+/* Need to cast, because on Solaris 10 systems, the sixth parameter is
+                                               void *fromlen.  */
+_GL_CXXALIAS_SYS_CAST (recvfrom, ssize_t,
+                       (int fd, void *restrict buf, size_t len, int flags,
+                        struct sockaddr *restrict from,
+                        socklen_t *restrict fromlen));
+# endif
+_GL_CXXALIASWARN (recvfrom);
+#elif @HAVE_WINSOCK2_H@
+# undef recvfrom
+# define recvfrom recvfrom_used_without_requesting_gnulib_module_recvfrom
+#elif defined GNULIB_POSIXCHECK
+# undef recvfrom
+# if HAVE_RAW_DECL_RECVFROM
+_GL_WARN_ON_USE (recvfrom, "recvfrom is not always POSIX compliant - "
+                 "use gnulib module recvfrom for portability");
+# endif
+#endif
+
+#if @GNULIB_SENDTO@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef sendto
+#   define sendto rpl_sendto
+#  endif
+_GL_FUNCDECL_RPL (sendto, ssize_t,
+                  (int fd, const void *buf, size_t len, int flags,
+                   const struct sockaddr *to, socklen_t tolen)
+                  _GL_ARG_NONNULL ((2)));
+_GL_CXXALIAS_RPL (sendto, ssize_t,
+                  (int fd, const void *buf, size_t len, int flags,
+                   const struct sockaddr *to, socklen_t tolen));
+# else
+/* Need to cast, because on NonStop Kernel, the sixth parameter is
+                                                   size_t tolen.  */
+_GL_CXXALIAS_SYS_CAST (sendto, ssize_t,
+                       (int fd, const void *buf, size_t len, int flags,
+                        const struct sockaddr *to, socklen_t tolen));
+# endif
+_GL_CXXALIASWARN (sendto);
+#elif @HAVE_WINSOCK2_H@
+# undef sendto
+# define sendto sendto_used_without_requesting_gnulib_module_sendto
+#elif defined GNULIB_POSIXCHECK
+# undef sendto
+# if HAVE_RAW_DECL_SENDTO
+_GL_WARN_ON_USE (sendto, "sendto is not always POSIX compliant - "
+                 "use gnulib module sendto for portability");
+# endif
+#endif
+
+#if @GNULIB_SETSOCKOPT@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef setsockopt
+#   define setsockopt rpl_setsockopt
+#  endif
+_GL_FUNCDECL_RPL (setsockopt, int, (int fd, int level, int optname,
+                                    const void * optval, socklen_t optlen)
+                                   _GL_ARG_NONNULL ((4)));
+_GL_CXXALIAS_RPL (setsockopt, int, (int fd, int level, int optname,
+                                    const void * optval, socklen_t optlen));
+# else
+/* Need to cast, because on NonStop Kernel, the fifth parameter is
+                                             size_t optlen.  */
+_GL_CXXALIAS_SYS_CAST (setsockopt, int,
+                       (int fd, int level, int optname,
+                        const void * optval, socklen_t optlen));
+# endif
+_GL_CXXALIASWARN (setsockopt);
+#elif @HAVE_WINSOCK2_H@
+# undef setsockopt
+# define setsockopt setsockopt_used_without_requesting_gnulib_module_setsockopt
+#elif defined GNULIB_POSIXCHECK
+# undef setsockopt
+# if HAVE_RAW_DECL_SETSOCKOPT
+_GL_WARN_ON_USE (setsockopt, "setsockopt is not always POSIX compliant - "
+                 "use gnulib module setsockopt for portability");
+# endif
+#endif
+
+#if @GNULIB_SHUTDOWN@
+# if @HAVE_WINSOCK2_H@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   undef shutdown
+#   define shutdown rpl_shutdown
+#  endif
+_GL_FUNCDECL_RPL (shutdown, int, (int fd, int how));
+_GL_CXXALIAS_RPL (shutdown, int, (int fd, int how));
+# else
+_GL_CXXALIAS_SYS (shutdown, int, (int fd, int how));
+# endif
+_GL_CXXALIASWARN (shutdown);
+#elif @HAVE_WINSOCK2_H@
+# undef shutdown
+# define shutdown shutdown_used_without_requesting_gnulib_module_shutdown
+#elif defined GNULIB_POSIXCHECK
+# undef shutdown
+# if HAVE_RAW_DECL_SHUTDOWN
+_GL_WARN_ON_USE (shutdown, "shutdown is not always POSIX compliant - "
+                 "use gnulib module shutdown for portability");
+# endif
+#endif
+
+#if @GNULIB_ACCEPT4@
+/* Accept a connection on a socket, with specific opening flags.
+   The flags are a bitmask, possibly including O_CLOEXEC (defined in <fcntl.h>)
+   and O_TEXT, O_BINARY (defined in "binary-io.h").
+   See also the Linux man page at
+   <https://www.kernel.org/doc/man-pages/online/pages/man2/accept4.2.html>.  */
+# if @HAVE_ACCEPT4@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define accept4 rpl_accept4
+#  endif
+_GL_FUNCDECL_RPL (accept4, int,
+                  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+                   int flags));
+_GL_CXXALIAS_RPL (accept4, int,
+                  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+                   int flags));
+# else
+_GL_FUNCDECL_SYS (accept4, int,
+                  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+                   int flags));
+_GL_CXXALIAS_SYS (accept4, int,
+                  (int sockfd, struct sockaddr *addr, socklen_t *addrlen,
+                   int flags));
+# endif
+_GL_CXXALIASWARN (accept4);
+#elif defined GNULIB_POSIXCHECK
+# undef accept4
+# if HAVE_RAW_DECL_ACCEPT4
+_GL_WARN_ON_USE (accept4, "accept4 is unportable - "
+                 "use gnulib module accept4 for portability");
+# endif
+#endif
+
+_GL_INLINE_HEADER_END
+
+#endif /* _@GUARD_PREFIX@_SYS_SOCKET_H */
+#endif /* _@GUARD_PREFIX@_SYS_SOCKET_H */
+#endif
similarity index 96%
rename from lib/sys_time.in.h
rename to tests/sys_time.in.h
index d535a6a..90a67d1 100644 (file)
@@ -1,6 +1,6 @@
 /* Provide a more complete sys/time.h.
 
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
@@ -112,8 +112,12 @@ _GL_CXXALIASWARN (gettimeofday);
 # if defined __cplusplus && defined GNULIB_NAMESPACE
 namespace GNULIB_NAMESPACE {
   typedef ::timeval
-#undef timeval
+#  undef timeval
     timeval;
+#  if @REPLACE_STRUCT_TIMEVAL@
+#   define timeval rpl_timeval
+  typedef ::timeval timeval;
+#  endif
 }
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -131,7 +135,7 @@ _GL_WARN_ON_USE (gettimeofday, "gettimeofday is unportable - "
 #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
 #   undef close
 #   define close close_used_without_including_unistd_h
-#  else
+#  elif !defined __clang__
      _GL_WARN_ON_USE (close,
                       "close() used without including <unistd.h>");
 #  endif
diff --git a/tests/sys_uio.in.h b/tests/sys_uio.in.h
new file mode 100644 (file)
index 0000000..db72437
--- /dev/null
@@ -0,0 +1,63 @@
+/* Substitute for <sys/uio.h>.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+# if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
+# endif
+@PRAGMA_COLUMNS@
+
+#ifndef _@GUARD_PREFIX@_SYS_UIO_H
+
+#if @HAVE_SYS_UIO_H@
+
+/* On OpenBSD 4.4, <sys/uio.h> assumes prior inclusion of <sys/types.h>.  */
+# include <sys/types.h>
+
+/* The include_next requires a split double-inclusion guard.  */
+# @INCLUDE_NEXT@ @NEXT_SYS_UIO_H@
+
+#endif
+
+#ifndef _@GUARD_PREFIX@_SYS_UIO_H
+#define _@GUARD_PREFIX@_SYS_UIO_H
+
+#if !@HAVE_SYS_UIO_H@
+/* A platform that lacks <sys/uio.h>.  */
+/* Get 'size_t' and 'ssize_t'.  */
+# include <sys/types.h>
+
+# ifdef __cplusplus
+extern "C" {
+# endif
+
+# if !GNULIB_defined_struct_iovec
+/* All known platforms that lack <sys/uio.h> also lack any declaration
+   of struct iovec in any other header.  */
+struct iovec {
+  void *iov_base;
+  size_t iov_len;
+};
+#  define GNULIB_defined_struct_iovec 1
+# endif
+
+# ifdef __cplusplus
+}
+# endif
+
+#endif
+
+#endif /* _@GUARD_PREFIX@_SYS_UIO_H */
+#endif /* _@GUARD_PREFIX@_SYS_UIO_H */
diff --git a/tests/test-accept.c b/tests/test-accept.c
new file mode 100644 (file)
index 0000000..49b87b1
--- /dev/null
@@ -0,0 +1,56 @@
+/* Test accepting a connection to a server socket.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (accept, int, (int, struct sockaddr *, socklen_t *));
+
+#include <errno.h>
+#include <netinet/in.h>
+#include <unistd.h>
+
+#include "sockets.h"
+#include "macros.h"
+
+int
+main (void)
+{
+  (void) gl_sockets_startup (SOCKETS_1_1);
+
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    struct sockaddr_in addr;
+    socklen_t addrlen = sizeof (addr);
+
+    errno = 0;
+    ASSERT (accept (-1, (struct sockaddr *) &addr, &addrlen) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    struct sockaddr_in addr;
+    socklen_t addrlen = sizeof (addr);
+
+    close (99);
+    errno = 0;
+    ASSERT (accept (99, (struct sockaddr *) &addr, &addrlen) == -1);
+    ASSERT (errno == EBADF);
+  }
+
+  return 0;
+}
diff --git a/tests/test-access.c b/tests/test-access.c
new file mode 100644 (file)
index 0000000..265cc75
--- /dev/null
@@ -0,0 +1,95 @@
+/* Tests of access.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (access, int, (const char *, int));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include "root-uid.h"
+#include "macros.h"
+
+/* mingw and MSVC 9 lack geteuid, so setup a dummy value.  */
+#if !HAVE_GETEUID
+# define geteuid() ROOT_UID
+#endif
+
+#define BASE "test-access.t"
+
+int
+main ()
+{
+  /* Remove anything from prior partial run.  */
+  unlink (BASE "f");
+  unlink (BASE "f1");
+  chmod (BASE "f2", 0600);
+  unlink (BASE "f2");
+
+  {
+    errno = 0;
+    ASSERT (access (BASE "f", R_OK) == -1);
+    ASSERT (errno == ENOENT);
+
+    errno = 0;
+    ASSERT (access (BASE "f", W_OK) == -1);
+    ASSERT (errno == ENOENT);
+
+    errno = 0;
+    ASSERT (access (BASE "f", X_OK) == -1);
+    ASSERT (errno == ENOENT);
+  }
+  {
+    ASSERT (close (creat (BASE "f1", 0700)) == 0);
+
+    ASSERT (access (BASE "f1", R_OK) == 0);
+    ASSERT (access (BASE "f1", W_OK) == 0);
+    ASSERT (access (BASE "f1", X_OK) == 0);
+  }
+  {
+    ASSERT (close (creat (BASE "f2", 0600)) == 0);
+    ASSERT (chmod (BASE "f2", 0400) == 0);
+
+    ASSERT (access (BASE "f2", R_OK) == 0);
+
+    if (geteuid () != ROOT_UID)
+      {
+        errno = 0;
+        ASSERT (access (BASE "f2", W_OK) == -1);
+        ASSERT (errno == EACCES);
+      }
+
+#if defined _WIN32 && !defined __CYGWIN__
+    /* X_OK works like R_OK.  */
+    ASSERT (access (BASE "f2", X_OK) == 0);
+#else
+    errno = 0;
+    ASSERT (access (BASE "f2", X_OK) == -1);
+    ASSERT (errno == EACCES);
+#endif
+  }
+
+  /* Cleanup.  */
+  ASSERT (unlink (BASE "f1") == 0);
+  ASSERT (chmod (BASE "f2", 0600) == 0);
+  ASSERT (unlink (BASE "f2") == 0);
+
+  return 0;
+}
index 2af76f5..593b608 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <alignof.h>.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
 
index b9aaa4a..fdbf6f5 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of optional automatic memory allocation.
-   Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -25,7 +25,7 @@
 static void
 do_allocation (int n)
 {
-  void *ptr = alloca (n);
+  void *volatile ptr = alloca (n);
   (void) ptr;
 }
 
diff --git a/tests/test-arpa_inet-c++.cc b/tests/test-arpa_inet-c++.cc
new file mode 100644 (file)
index 0000000..afdcc10
--- /dev/null
@@ -0,0 +1,41 @@
+/* Test of <arpa/inet.h> substitute in C++ mode.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <arpa/inet.h>
+
+#include "signature.h"
+
+
+#if GNULIB_TEST_INET_NTOP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::inet_ntop, const char *,
+                 (int, const void *, char *, socklen_t));
+#endif
+
+#if GNULIB_TEST_INET_PTON
+SIGNATURE_CHECK (GNULIB_NAMESPACE::inet_pton, int,
+                 (int, const char *, void *));
+#endif
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-arpa_inet.c b/tests/test-arpa_inet.c
new file mode 100644 (file)
index 0000000..10a27e1
--- /dev/null
@@ -0,0 +1,27 @@
+/* Test of <arpa/inet.h> substitute.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <arpa/inet.h>
+
+int
+main (void)
+{
+  return 0;
+}
index efdd579..fa60691 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of sequential list data type implementation.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -44,6 +44,42 @@ check_equals (gl_list_t list1, gl_list_t list2)
     }
 }
 
+static void
+check_equals_by_forward_iteration (gl_list_t list1, gl_list_t list2)
+{
+  size_t n = gl_list_size (list1);
+  size_t i;
+  gl_list_node_t node2;
+
+  i = 0;
+  node2 = gl_list_first_node (list2);
+  while (i < n && node2 != NULL)
+    {
+      ASSERT (gl_list_get_at (list1, i) == gl_list_node_value (list2, node2));
+      i++;
+      node2 = gl_list_next_node (list2, node2);
+    }
+  ASSERT ((i == n) == (node2 == NULL));
+}
+
+static void
+check_equals_by_backward_iteration (gl_list_t list1, gl_list_t list2)
+{
+  size_t n = gl_list_size (list1);
+  size_t i;
+  gl_list_node_t node2;
+
+  i = n - 1;
+  node2 = gl_list_last_node (list2);
+  while (i != (size_t)(-1) && node2 != NULL)
+    {
+      ASSERT (gl_list_get_at (list1, i) == gl_list_node_value (list2, node2));
+      i--;
+      node2 = gl_list_previous_node (list2, node2);
+    }
+  ASSERT ((i == (size_t)(-1)) == (node2 == NULL));
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -75,9 +111,12 @@ main (int argc, char *argv[])
 
     check_equals (list1, list2);
 
+    check_equals_by_forward_iteration (list1, list2);
+    check_equals_by_backward_iteration (list1, list2);
+
     for (repeat = 0; repeat < 10000; repeat++)
       {
-        unsigned int operation = RANDOM (16);
+        unsigned int operation = RANDOM (18);
         switch (operation)
           {
           case 0:
@@ -252,7 +291,23 @@ main (int argc, char *argv[])
                 ASSERT (gl_list_size (list1) == n - 1);
               }
             break;
-          case 11: case 12: /* remove 1 element */
+          case 11: /* remove first element */
+            {
+              size_t n = gl_list_size (list1);
+              bool removed1 = gl_list_remove_first (list1);
+              ASSERT (gl_list_remove_first (list2) == removed1);
+              ASSERT (gl_list_size (list1) == n - (int) removed1);
+            }
+            break;
+          case 12: /* remove last element */
+            {
+              size_t n = gl_list_size (list1);
+              bool removed1 = gl_list_remove_last (list1);
+              ASSERT (gl_list_remove_last (list2) == removed1);
+              ASSERT (gl_list_size (list1) == n - (int) removed1);
+            }
+            break;
+          case 13: case 14: /* remove 1 element */
             if (gl_list_size (list1) > 0)
               {
                 size_t n = gl_list_size (list1);
@@ -262,7 +317,7 @@ main (int argc, char *argv[])
                 ASSERT (gl_list_size (list1) == n - 1);
               }
             break;
-          case 13:
+          case 15:
             if (gl_list_size (list1) > 0)
               {
                 size_t n = gl_list_size (list1);
@@ -272,7 +327,7 @@ main (int argc, char *argv[])
                 ASSERT (gl_list_size (list1) == n);
               }
             break;
-          case 14:
+          case 16:
             {
               size_t n = gl_list_size (list1);
               gl_list_iterator_t iter1, iter2;
@@ -292,7 +347,7 @@ main (int argc, char *argv[])
               gl_list_iterator_free (&iter2);
             }
             break;
-          case 15:
+          case 17:
             {
               size_t end = RANDOM (gl_list_size (list1) + 1);
               size_t start = RANDOM (end + 1);
index 08a6102..310beae 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ordered set data type implementation.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2007.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -26,6 +26,8 @@
 #include "gl_array_list.h"
 #include "macros.h"
 
+#include "test-oset-update.h"
+
 static const char *objects[30] =
   {
     "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o",
@@ -66,6 +68,27 @@ check_all (gl_oset_t set1, gl_list_t set2)
   check_equals (set1, set2);
 }
 
+static bool
+is_at_least (const void *elt, const void *threshold)
+{
+  return strcmp ((const char *) elt, (const char *) threshold) >= 0;
+}
+
+static size_t
+gl_sortedlist_indexof_atleast (gl_list_t set,
+                               gl_setelement_threshold_fn threshold_fn,
+                               const void *threshold)
+{
+  /* This implementation is slow, but easy to verify.  */
+  size_t count = gl_list_size (set);
+  size_t index;
+
+  for (index = 0; index < count; index++)
+    if (threshold_fn (gl_list_get_at (set, index), threshold))
+      return index;
+  return (size_t)(-1);
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -103,7 +126,7 @@ main (int argc, char *argv[])
 
     for (repeat = 0; repeat < 100000; repeat++)
       {
-        unsigned int operation = RANDOM (3);
+        unsigned int operation = RANDOM (4);
         switch (operation)
           {
           case 0:
@@ -129,6 +152,32 @@ main (int argc, char *argv[])
                       == gl_sortedlist_remove (set2, (gl_listelement_compar_fn)strcmp, obj));
             }
             break;
+          case 3:
+            {
+              const char *obj = RANDOM_OBJECT ();
+              gl_oset_iterator_t iter = gl_oset_iterator_atleast (set1, is_at_least, obj);
+              size_t index = gl_sortedlist_indexof_atleast (set2, is_at_least, obj);
+              const void *elt;
+              /* Check the first two values that the iterator produces.
+                 Checking them all would make this part of the test dominate the
+                 run time of the test.  */
+              if (index == (size_t)(-1))
+                ASSERT (!gl_oset_iterator_next (&iter, &elt));
+              else
+                {
+                  ASSERT (gl_oset_iterator_next (&iter, &elt));
+                  ASSERT (elt == gl_list_get_at (set2, index));
+                  if (index + 1 == gl_list_size (set2))
+                    ASSERT (!gl_oset_iterator_next (&iter, &elt));
+                  else
+                    {
+                      ASSERT (gl_oset_iterator_next (&iter, &elt));
+                      ASSERT (elt == gl_list_get_at (set2, index + 1));
+                    }
+                }
+              gl_oset_iterator_free (&iter);
+            }
+            break;
           }
         check_all (set1, set2);
       }
@@ -137,5 +186,7 @@ main (int argc, char *argv[])
     gl_list_free (set2);
   }
 
+  test_update (GL_ARRAY_OSET);
+
   return 0;
 }
diff --git a/tests/test-asyncsafe-spin1.c b/tests/test-asyncsafe-spin1.c
new file mode 100644 (file)
index 0000000..6302952
--- /dev/null
@@ -0,0 +1,61 @@
+/* Test of spin locks for communication between threads and signal handlers.
+   Copyright (C) 2005, 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "asyncsafe-spin.h"
+
+#include <signal.h>
+
+asyncsafe_spinlock_t global_spin_lock = ASYNCSAFE_SPIN_INIT;
+
+int
+main (void)
+{
+  sigset_t set;
+
+  sigemptyset (&set);
+  sigaddset (&set, SIGINT);
+
+  /* Check a spin-lock initialized through the constant initializer.  */
+  {
+    sigset_t saved_set;
+    asyncsafe_spin_lock (&global_spin_lock, &set, &saved_set);
+    asyncsafe_spin_unlock (&global_spin_lock, &saved_set);
+  }
+
+  /* Check a spin-lock initialized through asyncsafe_spin_init.  */
+  {
+    asyncsafe_spinlock_t local_spin_lock;
+    int i;
+
+    asyncsafe_spin_init (&local_spin_lock);
+
+    for (i = 0; i < 10; i++)
+      {
+        sigset_t saved_set;
+        asyncsafe_spin_lock (&local_spin_lock, &set, &saved_set);
+        asyncsafe_spin_unlock (&local_spin_lock, &saved_set);
+      }
+
+    asyncsafe_spin_destroy (&local_spin_lock);
+  }
+
+  return 0;
+}
diff --git a/tests/test-asyncsafe-spin2.c b/tests/test-asyncsafe-spin2.c
new file mode 100644 (file)
index 0000000..cb3f8fd
--- /dev/null
@@ -0,0 +1,246 @@
+/* Test of spin locks for communication between threads and signal handlers.
+   Copyright (C) 2005, 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
+
+#include <config.h>
+
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+
+/* Whether to enable locking.
+   Uncomment this to get a test program without locking, to verify that
+   it crashes.  */
+#define ENABLE_LOCKING 1
+
+/* Whether to help the scheduler through explicit yield().
+   Uncomment this to see if the operating system has a fair scheduler.  */
+#define EXPLICIT_YIELD 1
+
+/* Whether to print debugging messages.  */
+#define ENABLE_DEBUGGING 0
+
+/* Number of simultaneous threads.  */
+#define THREAD_COUNT 10
+
+/* Number of operations performed in each thread.  */
+#if !(defined _WIN32 && ! defined __CYGWIN__) && HAVE_PTHREAD_H && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || __clang_major__ >= 3) && !defined __ibmxl__
+
+/* The GCC built-ins are known to work fine.  */
+# define REPEAT_COUNT 5000
+#else
+/* This is quite high, because with a smaller count, say 50000, we often get
+   an "OK" result even with the racy implementation that we pick on Fedora 13
+   Linux/x86_64 (gcc 4.4).  */
+# define REPEAT_COUNT 100000
+#endif
+
+#include <signal.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "asyncsafe-spin.h"
+#if !ENABLE_LOCKING
+# define asyncsafe_spin_init(lock) (void)(lock)
+# define asyncsafe_spin_lock(lock, mask, saved_mask) \
+    ((void)(lock), (void)(mask), (void)(saved_mask))
+# define asyncsafe_spin_unlock(lock, saved_mask) \
+    ((void)(lock), (void)(saved_mask))
+# define asyncsafe_spin_destroy(lock) (void)(lock)
+#endif
+
+#include "glthread/lock.h"
+#include "glthread/thread.h"
+#include "glthread/yield.h"
+
+#if HAVE_DECL_ALARM
+# include <signal.h>
+# include <unistd.h>
+#endif
+
+#include "atomic-int-gnulib.h"
+
+#if ENABLE_DEBUGGING
+# define dbgprintf printf
+#else
+# define dbgprintf if (0) printf
+#endif
+
+#if EXPLICIT_YIELD
+# define yield() gl_thread_yield ()
+#else
+# define yield()
+#endif
+
+static sigset_t signals_to_block;
+
+#define ACCOUNT_COUNT 4
+
+static int account[ACCOUNT_COUNT];
+
+static int
+random_account (void)
+{
+  return ((unsigned int) rand () >> 3) % ACCOUNT_COUNT;
+}
+
+static void
+check_accounts (void)
+{
+  int i, sum;
+
+  sum = 0;
+  for (i = 0; i < ACCOUNT_COUNT; i++)
+    sum += account[i];
+  if (sum != ACCOUNT_COUNT * 1000)
+    abort ();
+}
+
+
+/* ------------------- Test use like normal locks ------------------- */
+
+/* Test normal locks by having several bank accounts and several threads
+   which shuffle around money between the accounts and another thread
+   checking that all the money is still there.  */
+
+static asyncsafe_spinlock_t my_lock;
+
+static void *
+lock_mutator_thread (void *arg)
+{
+  int repeat;
+
+  for (repeat = REPEAT_COUNT; repeat > 0; repeat--)
+    {
+      sigset_t saved_signals;
+      int i1, i2, value;
+
+      dbgprintf ("Mutator %p before lock\n", gl_thread_self_pointer ());
+      asyncsafe_spin_lock (&my_lock, &signals_to_block, &saved_signals);
+      dbgprintf ("Mutator %p after  lock\n", gl_thread_self_pointer ());
+
+      i1 = random_account ();
+      i2 = random_account ();
+      value = ((unsigned int) rand () >> 3) % 10;
+      account[i1] += value;
+      account[i2] -= value;
+
+      dbgprintf ("Mutator %p before unlock\n", gl_thread_self_pointer ());
+      asyncsafe_spin_unlock (&my_lock, &saved_signals);
+      dbgprintf ("Mutator %p after  unlock\n", gl_thread_self_pointer ());
+
+      dbgprintf ("Mutator %p before check lock\n", gl_thread_self_pointer ());
+      asyncsafe_spin_lock (&my_lock, &signals_to_block, &saved_signals);
+      check_accounts ();
+      asyncsafe_spin_unlock (&my_lock, &saved_signals);
+      dbgprintf ("Mutator %p after  check unlock\n", gl_thread_self_pointer ());
+
+      yield ();
+    }
+
+  dbgprintf ("Mutator %p dying.\n", gl_thread_self_pointer ());
+  return NULL;
+}
+
+static struct atomic_int lock_checker_done;
+
+static void *
+lock_checker_thread (void *arg)
+{
+  while (get_atomic_int_value (&lock_checker_done) == 0)
+    {
+      sigset_t saved_signals;
+
+      dbgprintf ("Checker %p before check lock\n", gl_thread_self_pointer ());
+      asyncsafe_spin_lock (&my_lock, &signals_to_block, &saved_signals);
+      check_accounts ();
+      asyncsafe_spin_unlock (&my_lock, &saved_signals);
+      dbgprintf ("Checker %p after  check unlock\n", gl_thread_self_pointer ());
+
+      yield ();
+    }
+
+  dbgprintf ("Checker %p dying.\n", gl_thread_self_pointer ());
+  return NULL;
+}
+
+static void
+test_asyncsafe_spin (void)
+{
+  int i;
+  gl_thread_t checkerthread;
+  gl_thread_t threads[THREAD_COUNT];
+
+  /* Initialization.  */
+  for (i = 0; i < ACCOUNT_COUNT; i++)
+    account[i] = 1000;
+  init_atomic_int (&lock_checker_done);
+  set_atomic_int_value (&lock_checker_done, 0);
+
+  /* Spawn the threads.  */
+  checkerthread = gl_thread_create (lock_checker_thread, NULL);
+  for (i = 0; i < THREAD_COUNT; i++)
+    threads[i] = gl_thread_create (lock_mutator_thread, NULL);
+
+  /* Wait for the threads to terminate.  */
+  for (i = 0; i < THREAD_COUNT; i++)
+    gl_thread_join (threads[i], NULL);
+  set_atomic_int_value (&lock_checker_done, 1);
+  gl_thread_join (checkerthread, NULL);
+  check_accounts ();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+int
+main ()
+{
+#if HAVE_DECL_ALARM
+  /* Declare failure if test takes too long, by using default abort
+     caused by SIGALRM.  */
+  int alarm_value = 600;
+  signal (SIGALRM, SIG_DFL);
+  alarm (alarm_value);
+#endif
+
+  sigemptyset (&signals_to_block);
+  sigaddset (&signals_to_block, SIGINT);
+
+  asyncsafe_spin_init (&my_lock);
+
+  printf ("Starting test_asyncsafe_spin ..."); fflush (stdout);
+  test_asyncsafe_spin ();
+  printf (" OK\n"); fflush (stdout);
+
+  return 0;
+}
+
+#else
+
+/* No multithreading available.  */
+
+#include <stdio.h>
+
+int
+main ()
+{
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+}
+
+#endif
index c134a22..c864d71 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ordered set data type implementation.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -25,6 +25,8 @@
 #include "gl_array_oset.h"
 #include "macros.h"
 
+#include "test-oset-update.h"
+
 extern void gl_avltree_oset_check_invariants (gl_oset_t set);
 
 static const char *objects[30] =
@@ -66,6 +68,12 @@ check_all (gl_oset_t set1, gl_oset_t set2)
   check_equals (set1, set2);
 }
 
+static bool
+is_at_least (const void *elt, const void *threshold)
+{
+  return strcmp ((const char *) elt, (const char *) threshold) >= 0;
+}
+
 int
 main (int argc, char *argv[])
 {
@@ -100,7 +108,7 @@ main (int argc, char *argv[])
 
     for (repeat = 0; repeat < 100000; repeat++)
       {
-        unsigned int operation = RANDOM (3);
+        unsigned int operation = RANDOM (4);
         switch (operation)
           {
           case 0:
@@ -121,6 +129,32 @@ main (int argc, char *argv[])
               ASSERT (gl_oset_remove (set1, obj) == gl_oset_remove (set2, obj));
             }
             break;
+          case 3:
+            {
+              const char *obj = RANDOM_OBJECT ();
+              gl_oset_iterator_t iter1 = gl_oset_iterator_atleast (set1, is_at_least, obj);
+              gl_oset_iterator_t iter2 = gl_oset_iterator_atleast (set2, is_at_least, obj);
+              const void *elt1;
+              const void *elt2;
+              /* Check the first two values that the iterator produces.
+                 Checking them all would make this part of the test dominate the
+                 run time of the test.  */
+              bool havenext1 = gl_oset_iterator_next (&iter1, &elt1);
+              bool havenext2 = gl_oset_iterator_next (&iter2, &elt2);
+              ASSERT (havenext1 == havenext2);
+              if (havenext1)
+                {
+                  ASSERT (elt1 == elt2);
+                  havenext1 = gl_oset_iterator_next (&iter1, &elt1);
+                  havenext2 = gl_oset_iterator_next (&iter2, &elt2);
+                  ASSERT (havenext1 == havenext2);
+                  if (havenext1)
+                    ASSERT (elt1 == elt2);
+                }
+              gl_oset_iterator_free (&iter1);
+              gl_oset_iterator_free (&iter2);
+            }
+            break;
           }
         check_all (set1, set2);
       }
@@ -129,5 +163,7 @@ main (int argc, char *argv[])
     gl_oset_free (set2);
   }
 
+  test_update (GL_AVLTREE_OSET);
+
   return 0;
 }
index 6801e96..7da8f8b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of binary mode I/O.
-   Copyright (C) 2005, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
 
@@ -55,12 +55,6 @@ main (int argc, char *argv[])
       fputs ("Hello\n", stdout);
       break;
 
-    case '2':
-      /* Test the SET_BINARY macro.  */
-      SET_BINARY (1);
-      fputs ("Hello\n", stdout);
-      break;
-
     default:
       break;
     }
index c4dd6e9..a177d94 100755 (executable)
@@ -3,11 +3,9 @@
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
-tmpfiles="$tmpfiles t-bin-out0.tmp t-bin-out1.tmp t-bin-out2.tmp"
-./test-binary-io${EXEEXT} 1 > t-bin-out1.tmp || exit 1
+tmpfiles="$tmpfiles t-bin-out0.tmp t-bin-out1.tmp"
+${CHECKER} ./test-binary-io${EXEEXT} 1 > t-bin-out1.tmp || exit 1
 cmp t-bin-out0.tmp t-bin-out1.tmp > /dev/null || exit 1
-./test-binary-io${EXEEXT} 2 > t-bin-out2.tmp || exit 1
-cmp t-bin-out0.tmp t-bin-out2.tmp > /dev/null || exit 1
 
 rm -fr $tmpfiles
 
diff --git a/tests/test-bind.c b/tests/test-bind.c
new file mode 100644 (file)
index 0000000..8054e9d
--- /dev/null
@@ -0,0 +1,58 @@
+/* Test binding a server socket to a port.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (bind, int, (int, const struct sockaddr *, socklen_t));
+
+#include <errno.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+
+#include "sockets.h"
+#include "macros.h"
+
+int
+main (void)
+{
+  (void) gl_sockets_startup (SOCKETS_1_1);
+
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    struct sockaddr_in addr;
+
+    addr.sin_family = AF_INET;
+    inet_pton (AF_INET, "127.0.0.1", &addr.sin_addr);
+    addr.sin_port = htons (80);
+    {
+      errno = 0;
+      ASSERT (bind (-1, (const struct sockaddr *) &addr, sizeof (addr)) == -1);
+      ASSERT (errno == EBADF);
+    }
+    {
+      close (99);
+      errno = 0;
+      ASSERT (bind (99, (const struct sockaddr *) &addr, sizeof (addr)) == -1);
+      ASSERT (errno == EBADF);
+    }
+  }
+
+  return 0;
+}
diff --git a/tests/test-bitrotate.c b/tests/test-bitrotate.c
new file mode 100644 (file)
index 0000000..98d15e2
--- /dev/null
@@ -0,0 +1,279 @@
+/* Test of <bitrotate.h> substitute.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Simon Josefsson <simon@josefsson.org>, 2008.  */
+
+#include <config.h>
+
+#include "bitrotate.h"
+
+#include "macros.h"
+
+int
+main (void)
+{
+  ASSERT (rotl8 (42, 0) == 42);
+  ASSERT (rotl8 (42, 1) == 84);
+  ASSERT (rotl8 (42, 2) == 168);
+  ASSERT (rotl8 (42, 3) == 81);
+  ASSERT (rotl8 (42, 4) == 162);
+  ASSERT (rotl8 (42, 5) == 69);
+  ASSERT (rotl8 (42, 6) == 138);
+  ASSERT (rotl8 (42, 7) == 21);
+  ASSERT (rotl8 (42, 8) == 42);
+
+  ASSERT (rotr8 (42, 0) == 42);
+  ASSERT (rotr8 (42, 1) == 21);
+  ASSERT (rotr8 (42, 2) == 138);
+  ASSERT (rotr8 (42, 3) == 69);
+  ASSERT (rotr8 (42, 4) == 162);
+  ASSERT (rotr8 (42, 5) == 81);
+  ASSERT (rotr8 (42, 6) == 168);
+  ASSERT (rotr8 (42, 7) == 84);
+  ASSERT (rotr8 (42, 8) == 42);
+
+  ASSERT (rotl16 (43981, 0) == 43981);
+  ASSERT (rotl16 (43981, 1) == 22427);
+  ASSERT (rotl16 (43981, 2) == 44854);
+  ASSERT (rotl16 (43981, 3) == 24173);
+  ASSERT (rotl16 (43981, 4) == 48346);
+  ASSERT (rotl16 (43981, 5) == 31157);
+  ASSERT (rotl16 (43981, 6) == 62314);
+  ASSERT (rotl16 (43981, 7) == 59093);
+  ASSERT (rotl16 (43981, 8) == 52651);
+  ASSERT (rotl16 (43981, 9) == 39767);
+  ASSERT (rotl16 (43981, 10) == 13999);
+  ASSERT (rotl16 (43981, 11) == 27998);
+  ASSERT (rotl16 (43981, 12) == 55996);
+  ASSERT (rotl16 (43981, 13) == 46457);
+  ASSERT (rotl16 (43981, 14) == 27379);
+  ASSERT (rotl16 (43981, 15) == 54758);
+  ASSERT (rotl16 (43981, 16) == 43981);
+
+  ASSERT (rotr16 (43981, 0) == 43981);
+  ASSERT (rotr16 (43981, 1) == 54758);
+  ASSERT (rotr16 (43981, 2) == 27379);
+  ASSERT (rotr16 (43981, 3) == 46457);
+  ASSERT (rotr16 (43981, 4) == 55996);
+  ASSERT (rotr16 (43981, 5) == 27998);
+  ASSERT (rotr16 (43981, 6) == 13999);
+  ASSERT (rotr16 (43981, 7) == 39767);
+  ASSERT (rotr16 (43981, 8) == 52651);
+  ASSERT (rotr16 (43981, 9) == 59093);
+  ASSERT (rotr16 (43981, 10) == 62314);
+  ASSERT (rotr16 (43981, 11) == 31157);
+  ASSERT (rotr16 (43981, 12) == 48346);
+  ASSERT (rotr16 (43981, 13) == 24173);
+  ASSERT (rotr16 (43981, 14) == 44854);
+  ASSERT (rotr16 (43981, 15) == 22427);
+  ASSERT (rotr16 (43981, 16) == 43981);
+
+  ASSERT (rotl32 (2309737967U, 1) == 324508639U);
+  ASSERT (rotl32 (2309737967U, 2) == 649017278U);
+  ASSERT (rotl32 (2309737967U, 3) == 1298034556U);
+  ASSERT (rotl32 (2309737967U, 4) == 2596069112U);
+  ASSERT (rotl32 (2309737967U, 5) == 897170929U);
+  ASSERT (rotl32 (2309737967U, 6) == 1794341858U);
+  ASSERT (rotl32 (2309737967U, 7) == 3588683716U);
+  ASSERT (rotl32 (2309737967U, 8) == 2882400137U);
+  ASSERT (rotl32 (2309737967U, 9) == 1469832979U);
+  ASSERT (rotl32 (2309737967U, 10) == 2939665958U);
+  ASSERT (rotl32 (2309737967U, 11) == 1584364621U);
+  ASSERT (rotl32 (2309737967U, 12) == 3168729242U);
+  ASSERT (rotl32 (2309737967U, 13) == 2042491189U);
+  ASSERT (rotl32 (2309737967U, 14) == 4084982378U);
+  ASSERT (rotl32 (2309737967U, 15) == 3874997461U);
+  ASSERT (rotl32 (2309737967U, 16) == 3455027627U);
+  ASSERT (rotl32 (2309737967U, 17) == 2615087959U);
+  ASSERT (rotl32 (2309737967U, 18) == 935208623U);
+  ASSERT (rotl32 (2309737967U, 19) == 1870417246U);
+  ASSERT (rotl32 (2309737967U, 20) == 3740834492U);
+  ASSERT (rotl32 (2309737967U, 21) == 3186701689U);
+  ASSERT (rotl32 (2309737967U, 22) == 2078436083U);
+  ASSERT (rotl32 (2309737967U, 23) == 4156872166U);
+  ASSERT (rotl32 (2309737967U, 24) == 4018777037U);
+  ASSERT (rotl32 (2309737967U, 25) == 3742586779U);
+  ASSERT (rotl32 (2309737967U, 26) == 3190206263U);
+  ASSERT (rotl32 (2309737967U, 27) == 2085445231U);
+  ASSERT (rotl32 (2309737967U, 28) == 4170890462U);
+  ASSERT (rotl32 (2309737967U, 29) == 4046813629U);
+  ASSERT (rotl32 (2309737967U, 30) == 3798659963U);
+  ASSERT (rotl32 (2309737967U, 31) == 3302352631U);
+
+  ASSERT (rotr32 (2309737967U, 1) == 3302352631lU);
+  ASSERT (rotr32 (2309737967U, 2) == 3798659963lU);
+  ASSERT (rotr32 (2309737967U, 3) == 4046813629lU);
+  ASSERT (rotr32 (2309737967U, 4) == 4170890462lU);
+  ASSERT (rotr32 (2309737967U, 5) == 2085445231lU);
+  ASSERT (rotr32 (2309737967U, 6) == 3190206263lU);
+  ASSERT (rotr32 (2309737967U, 7) == 3742586779lU);
+  ASSERT (rotr32 (2309737967U, 8) == 4018777037lU);
+  ASSERT (rotr32 (2309737967U, 9) == 4156872166lU);
+  ASSERT (rotr32 (2309737967U, 10) == 2078436083lU);
+  ASSERT (rotr32 (2309737967U, 11) == 3186701689lU);
+  ASSERT (rotr32 (2309737967U, 12) == 3740834492lU);
+  ASSERT (rotr32 (2309737967U, 13) == 1870417246lU);
+  ASSERT (rotr32 (2309737967U, 14) == 935208623lU);
+  ASSERT (rotr32 (2309737967U, 15) == 2615087959lU);
+  ASSERT (rotr32 (2309737967U, 16) == 3455027627lU);
+  ASSERT (rotr32 (2309737967U, 17) == 3874997461lU);
+  ASSERT (rotr32 (2309737967U, 18) == 4084982378lU);
+  ASSERT (rotr32 (2309737967U, 19) == 2042491189lU);
+  ASSERT (rotr32 (2309737967U, 20) == 3168729242lU);
+  ASSERT (rotr32 (2309737967U, 21) == 1584364621lU);
+  ASSERT (rotr32 (2309737967U, 22) == 2939665958lU);
+  ASSERT (rotr32 (2309737967U, 23) == 1469832979lU);
+  ASSERT (rotr32 (2309737967U, 24) == 2882400137lU);
+  ASSERT (rotr32 (2309737967U, 25) == 3588683716lU);
+  ASSERT (rotr32 (2309737967U, 26) == 1794341858lU);
+  ASSERT (rotr32 (2309737967U, 27) == 897170929lU);
+  ASSERT (rotr32 (2309737967U, 28) == 2596069112lU);
+  ASSERT (rotr32 (2309737967U, 29) == 1298034556lU);
+  ASSERT (rotr32 (2309737967U, 30) == 649017278lU);
+  ASSERT (rotr32 (2309737967U, 31) == 324508639lU);
+
+#ifdef UINT64_MAX
+  ASSERT (rotl64 (16045690984503098046ULL, 1) == 13644637895296644477ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 2) == 8842531716883737339ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 3) == 17685063433767474678ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 4) == 16923382793825397741ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 5) == 15400021513941243867ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 6) == 12353298954172936119ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 7) == 6259853834636320623ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 8) == 12519707669272641246ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 9) == 6592671264835730877ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 10) == 13185342529671461754ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 11) == 7923940985633371893ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 12) == 15847881971266743786ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 13) == 13249019868823935957ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 14) == 8051295663938320299ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 15) == 16102591327876640598ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 16) == 13758438582043729581ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 17) == 9070133090377907547ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 18) == 18140266180755815094ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 19) == 17833788287802078573ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 20) == 17220832501894605531ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 21) == 15994920930079659447ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 22) == 13543097786449767279ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 23) == 8639451499189982943ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 24) == 17278902998379965886ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 25) == 16111061923050380157ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 26) == 13775379772391208699ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 27) == 9104015471072865783ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 28) == 18208030942145731566ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 29) == 17969317810581911517ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 30) == 17491891547454271419ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 31) == 16537039021198991223ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 32) == 14627333968688430831ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 33) == 10807923863667310047ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 34) == 3169103653625068479ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 35) == 6338207307250136958ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 36) == 12676414614500273916ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 37) == 6906085155290996217ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 38) == 13812170310581992434ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 39) == 9177596547454433253ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 40) == 18355193094908866506ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 41) == 18263642116108181397ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 42) == 18080540158506811179ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 43) == 17714336243304070743ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 44) == 16981928412898589871ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 45) == 15517112752087628127ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 46) == 12587481430465704639ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 47) == 6728218787221857663ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 48) == 13456437574443715326ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 49) == 8466131075177879037ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 50) == 16932262150355758074ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 51) == 15417780227001964533ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 52) == 12388816380294377451ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 53) == 6330888686879203287ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 54) == 12661777373758406574ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 55) == 6876810673807261533ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 56) == 13753621347614523066ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 57) == 9060498621519494517ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 58) == 18120997243038989034ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 59) == 17795250412368426453ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 60) == 17143756751027301291ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 61) == 15840769428345050967ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 62) == 13234794782980550319ULL);
+  ASSERT (rotl64 (16045690984503098046ULL, 63) == 8022845492251549023ULL);
+
+  ASSERT (rotr64 (16045690984503098046ULL, 1) == 8022845492251549023ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 2) == 13234794782980550319ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 3) == 15840769428345050967ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 4) == 17143756751027301291ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 5) == 17795250412368426453ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 6) == 18120997243038989034ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 7) == 9060498621519494517ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 8) == 13753621347614523066ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 9) == 6876810673807261533ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 10) == 12661777373758406574ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 11) == 6330888686879203287ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 12) == 12388816380294377451ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 13) == 15417780227001964533ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 14) == 16932262150355758074ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 15) == 8466131075177879037ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 16) == 13456437574443715326ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 17) == 6728218787221857663ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 18) == 12587481430465704639ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 19) == 15517112752087628127ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 20) == 16981928412898589871ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 21) == 17714336243304070743ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 22) == 18080540158506811179ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 23) == 18263642116108181397ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 24) == 18355193094908866506ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 25) == 9177596547454433253ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 26) == 13812170310581992434ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 27) == 6906085155290996217ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 28) == 12676414614500273916ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 29) == 6338207307250136958ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 30) == 3169103653625068479ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 31) == 10807923863667310047ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 32) == 14627333968688430831ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 33) == 16537039021198991223ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 34) == 17491891547454271419ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 35) == 17969317810581911517ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 36) == 18208030942145731566ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 37) == 9104015471072865783ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 38) == 13775379772391208699ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 39) == 16111061923050380157ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 40) == 17278902998379965886ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 41) == 8639451499189982943ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 42) == 13543097786449767279ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 43) == 15994920930079659447ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 44) == 17220832501894605531ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 45) == 17833788287802078573ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 46) == 18140266180755815094ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 47) == 9070133090377907547ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 48) == 13758438582043729581ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 49) == 16102591327876640598ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 50) == 8051295663938320299ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 51) == 13249019868823935957ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 52) == 15847881971266743786ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 53) == 7923940985633371893ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 54) == 13185342529671461754ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 55) == 6592671264835730877ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 56) == 12519707669272641246ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 57) == 6259853834636320623ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 58) == 12353298954172936119ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 59) == 15400021513941243867ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 60) == 16923382793825397741ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 61) == 17685063433767474678ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 62) == 8842531716883737339ULL);
+  ASSERT (rotr64 (16045690984503098046ULL, 63) == 13644637895296644477ULL);
+#endif /* UINT64_MAX */
+
+  return 0;
+}
index 9953ac4..040abff 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of unibyte character to wide character.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
index aaef48d..ab4b287 100755 (executable)
@@ -12,4 +12,4 @@ if test $LOCALE_FR = none; then
 fi
 
 LC_ALL=$LOCALE_FR \
-./test-btowc${EXEEXT} 1
+${CHECKER} ./test-btowc${EXEEXT} 1
index 2e06038..d7d4d9c 100755 (executable)
@@ -12,4 +12,4 @@ if test $LOCALE_FR_UTF8 = none; then
 fi
 
 LC_ALL=$LOCALE_FR_UTF8 \
-./test-btowc${EXEEXT} 2
+${CHECKER} ./test-btowc${EXEEXT} 2
index 184cdec..2077eb4 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of character handling in C locale.
-   Copyright (C) 2005, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
 
index 238fc11..2c5a49a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of c-stack module.
-   Copyright (C) 2002, 2004, 2006, 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2004, 2006, 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index f979065..54009d3 100755 (executable)
@@ -4,7 +4,7 @@ tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
 tmpfiles="t-c-stack.tmp"
-./test-c-stack${EXEEXT} 2> t-c-stack.tmp
+${CHECKER} ./test-c-stack${EXEEXT} 2> t-c-stack.tmp
 case $? in
   77) cat t-c-stack.tmp >&2; (exit 77); exit 77 ;;
   1) ;;
index 0cd49c9..7f03593 100755 (executable)
@@ -7,7 +7,7 @@ tmpfiles="t-c-stack2.tmp"
 
 # Sanitize exit status within a subshell, since some shells fail to
 # redirect stderr on their message about death due to signal.
-(./test-c-stack${EXEEXT} 1; exit $?) 2> t-c-stack2.tmp
+(${CHECKER} ./test-c-stack${EXEEXT} 1; exit $?) 2> t-c-stack2.tmp
 
 case $? in
   77) if grep 'stack overflow' t-c-stack2.tmp >/dev/null ; then
@@ -23,6 +23,13 @@ case $? in
         exit 77
       fi
       ;;
+  1)
+      # Dereferencing NULL exits the program with status 1,
+      # so this test doesn't check the c-stack testing harness like it should.
+      # https://lists.gnu.org/r/grep-devel/2020-09/msg00034.html
+      cat t-c-stack2.tmp >&2
+      echo 'skipping test (perhaps gcc -fsanitize=undefined is in use?)'
+      exit 77;;
   0) (exit 1); exit 1 ;;
 esac
 if grep 'program error' t-c-stack2.tmp >/dev/null ; then
index 5fcf906..14bdfb2 100755 (executable)
@@ -1,21 +1,21 @@
 #!/bin/sh
 
 # Test in the C locale.
-./test-c-strcasecmp${EXEEXT} || exit 1
-./test-c-strncasecmp${EXEEXT} || exit 1
+${CHECKER} ./test-c-strcasecmp${EXEEXT} || exit 1
+${CHECKER} ./test-c-strncasecmp${EXEEXT} || exit 1
 
 # Test in an ISO-8859-1 or ISO-8859-15 locale.
 : ${LOCALE_FR=fr_FR}
 if test $LOCALE_FR != none; then
-  LC_ALL=$LOCALE_FR ./test-c-strcasecmp${EXEEXT} locale || exit 1
-  LC_ALL=$LOCALE_FR ./test-c-strncasecmp${EXEEXT} locale || exit 1
+  LC_ALL=$LOCALE_FR ${CHECKER} ./test-c-strcasecmp${EXEEXT} locale || exit 1
+  LC_ALL=$LOCALE_FR ${CHECKER} ./test-c-strncasecmp${EXEEXT} locale || exit 1
 fi
 
 # Test in a Turkish UTF-8 locale.
 : ${LOCALE_TR_UTF8=tr_TR.UTF-8}
 if test $LOCALE_TR_UTF8 != none; then
-  LC_ALL=$LOCALE_TR_UTF8 ./test-c-strcasecmp${EXEEXT} locale || exit 1
-  LC_ALL=$LOCALE_TR_UTF8 ./test-c-strncasecmp${EXEEXT} locale || exit 1
+  LC_ALL=$LOCALE_TR_UTF8 ${CHECKER} ./test-c-strcasecmp${EXEEXT} locale || exit 1
+  LC_ALL=$LOCALE_TR_UTF8 ${CHECKER} ./test-c-strncasecmp${EXEEXT} locale || exit 1
 fi
 
 exit 0
index 42e538f..cc2efb0 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of case-insensitive string comparison function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 349f6b3..6cbdce0 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of case-insensitive string comparison function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
diff --git a/tests/test-calloc-gnu.c b/tests/test-calloc-gnu.c
new file mode 100644 (file)
index 0000000..a98a75f
--- /dev/null
@@ -0,0 +1,73 @@
+/* Test of calloc function.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdlib.h>
+
+#include <errno.h>
+#include <stdint.h>
+
+#include "macros.h"
+
+/* Return N.
+   Usual compilers are not able to infer something about the return value.  */
+static size_t
+identity (size_t n)
+{
+  unsigned int x = rand ();
+  unsigned int y = x * x * x * x;
+  x++; y |= x * x * x * x;
+  x++; y |= x * x * x * x;
+  x++; y |= x * x * x * x;
+  y = y >> 1;
+  y &= -y;
+  y -= 8;
+  /* At this point Y is zero but GCC doesn't infer this.  */
+  return n + y;
+}
+
+int
+main ()
+{
+  /* Check that calloc (0, 0) is not a NULL pointer.  */
+  {
+    void * volatile p = calloc (0, 0);
+    ASSERT (p != NULL);
+    free (p);
+  }
+
+  /* Check that calloc fails when requested to allocate a block of memory
+     larger than PTRDIFF_MAX or SIZE_MAX bytes.
+     Use 'identity' to avoid a compiler warning from GCC 7.
+     'volatile' is needed to defeat an incorrect optimization by clang 10,
+     see <https://bugs.llvm.org/show_bug.cgi?id=46055>.  */
+  {
+    for (size_t n = 2; n != 0; n <<= 1)
+      {
+        void *volatile p = calloc (PTRDIFF_MAX / n + 1, identity (n));
+        ASSERT (p == NULL);
+        ASSERT (errno == ENOMEM);
+
+       p = calloc (SIZE_MAX / n + 1, identity (n));
+        ASSERT (p == NULL);
+        ASSERT (errno == ENOMEM);
+      }
+  }
+
+  return 0;
+}
index d1c71e6..c0a5a55 100644 (file)
@@ -1,5 +1,5 @@
-/* Test of execution of program termination handlers.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+/* Test of execution of file name canonicalization.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
+   may "optimize" the null_ptr function, when its result gets passed to a
+   function that has an argument declared as _GL_ARG_NONNULL.  */
+#define _GL_ARG_NONNULL(params)
+
 #include <config.h>
 
 #include <stdlib.h>
@@ -33,16 +38,15 @@ SIGNATURE_CHECK (canonicalize_file_name, char *, (const char *));
 
 #include "same-inode.h"
 #include "ignore-value.h"
+
+#if GNULIB_defined_canonicalize_file_name
+# include "null-ptr.h"
+#endif
+
 #include "macros.h"
 
 #define BASE "t-can-lgpl.tmp"
 
-static void *
-null_ptr (void)
-{
-  return NULL;
-}
-
 int
 main (void)
 {
@@ -63,6 +67,48 @@ main (void)
     ASSERT (close (fd) == 0);
   }
 
+  /* Check // handling (the easy cases, without symlinks).
+     This // handling is not mandated by POSIX.  However, many applications
+     expect that canonicalize_file_name "canonicalizes" the file name,
+     that is, that different results of canonicalize_file_name correspond
+     to different files (except for hard links).  */
+  {
+    char *result0 = canonicalize_file_name ("/etc/passwd");
+    if (result0 != NULL) /* This file does not exist on native Windows.  */
+      {
+        char *result;
+
+        result = canonicalize_file_name ("/etc//passwd");
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_file_name ("/etc///passwd");
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        /* On Windows, the syntax //host/share/filename denotes a file
+           in a directory named 'share', exported from host 'host'.
+           See also m4/double-slash-root.m4.  */
+#if !(defined _WIN32 || defined __CYGWIN__)
+        result = canonicalize_file_name ("//etc/passwd");
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_file_name ("//etc//passwd");
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_file_name ("//etc///passwd");
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+#endif
+
+        result = canonicalize_file_name ("///etc/passwd");
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_file_name ("///etc//passwd");
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_file_name ("///etc///passwd");
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+      }
+  }
+
   /* Check for ., .., intermediate // handling, and for error cases.  */
   {
     char *result = canonicalize_file_name (BASE "//./..//" BASE "/tra");
@@ -70,14 +116,22 @@ main (void)
     ASSERT (strstr (result, "/" BASE "/tra")
             == result + strlen (result) - strlen ("/" BASE "/tra"));
     free (result);
+
     errno = 0;
     result = canonicalize_file_name ("");
     ASSERT (result == NULL);
     ASSERT (errno == ENOENT);
+
+    /* This test works only if the canonicalize_file_name implementation
+       comes from gnulib.  If it comes from libc, we have no way to prevent
+       gcc from "optimizing" the null_ptr function in invalid ways.  See
+       <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93156>.  */
+#if GNULIB_defined_canonicalize_file_name
     errno = 0;
     result = canonicalize_file_name (null_ptr ());
     ASSERT (result == NULL);
     ASSERT (errno == EINVAL);
+#endif
   }
 
   /* Check that a non-directory with trailing slash yields NULL.  */
@@ -154,13 +208,29 @@ main (void)
     ASSERT (errno == ENOENT);
   }
 
-  /* Check that a non-directory symlink with trailing slash yields NULL.  */
+  /* Check that a non-directory symlink with trailing slash yields NULL,
+     and likewise for other troublesome suffixes.  */
   {
-    char *result;
-    errno = 0;
-    result = canonicalize_file_name (BASE "/huk/");
-    ASSERT (result == NULL);
-    ASSERT (errno == ENOTDIR);
+    char const *const file_name[]
+      = {
+         BASE "/huk/",
+         BASE "/huk/.",
+         BASE "/huk/./",
+         BASE "/huk/./.",
+         BASE "/huk/x",
+         BASE "/huk/..",
+         BASE "/huk/../",
+         BASE "/huk/../.",
+         BASE "/huk/../x",
+         BASE "/huk/./..",
+         BASE "/huk/././../x",
+        };
+    for (int i = 0; i < sizeof file_name / sizeof *file_name; i++)
+      {
+        errno = 0;
+        ASSERT (!canonicalize_file_name (file_name[i]));
+        ASSERT (errno == ENOTDIR);
+      }
   }
 
   /* Check that a missing directory via symlink yields NULL.  */
@@ -181,7 +251,7 @@ main (void)
     ASSERT (errno == ELOOP);
   }
 
-  /* Check that leading // is honored correctly.  */
+  /* Check that leading // within symlinks is honored correctly.  */
   {
     struct stat st1;
     struct stat st2;
diff --git a/tests/test-canonicalize.c b/tests/test-canonicalize.c
new file mode 100644 (file)
index 0000000..dbde6f2
--- /dev/null
@@ -0,0 +1,434 @@
+/* Test of execution of file name canonicalization.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+/* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
+   may "optimize" the null_ptr function, when its result gets passed to a
+   function that has an argument declared as _GL_ARG_NONNULL.  */
+#define _GL_ARG_NONNULL(params)
+
+#include <config.h>
+
+#include "canonicalize.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "same-inode.h"
+#include "ignore-value.h"
+
+#if GNULIB_defined_canonicalize_file_name
+# include "null-ptr.h"
+#endif
+
+#include "macros.h"
+
+#define BASE "t-can.tmp"
+
+int
+main (void)
+{
+  /* Setup some hierarchy to be used by this test.  Start by removing
+     any leftovers from a previous partial run.  */
+  {
+    int fd;
+    ignore_value (system ("rm -rf " BASE " ise"));
+    ASSERT (mkdir (BASE, 0700) == 0);
+    fd = creat (BASE "/tra", 0600);
+    ASSERT (0 <= fd);
+    ASSERT (close (fd) == 0);
+  }
+
+  /* Check // handling (the easy cases, without symlinks).
+     This // handling is not mandated by POSIX.  However, many applications
+     expect that canonicalize_filename_mode "canonicalizes" the file name,
+     that is, that different results of canonicalize_filename_mode correspond
+     to different files (except for hard links).  */
+  {
+    char *result0 = canonicalize_file_name ("/etc/passwd");
+    if (result0 != NULL) /* This file does not exist on native Windows.  */
+      {
+        char *result;
+
+        result = canonicalize_filename_mode ("/etc/passwd", CAN_MISSING);
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_filename_mode ("/etc//passwd", CAN_MISSING);
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_filename_mode ("/etc///passwd", CAN_MISSING);
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        /* On Windows, the syntax //host/share/filename denotes a file
+           in a directory named 'share', exported from host 'host'.
+           See also m4/double-slash-root.m4.  */
+#if !(defined _WIN32 || defined __CYGWIN__)
+        result = canonicalize_filename_mode ("//etc/passwd", CAN_MISSING);
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_filename_mode ("//etc//passwd", CAN_MISSING);
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_filename_mode ("//etc///passwd", CAN_MISSING);
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+#endif
+
+        result = canonicalize_filename_mode ("///etc/passwd", CAN_MISSING);
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_filename_mode ("///etc//passwd", CAN_MISSING);
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+
+        result = canonicalize_filename_mode ("///etc///passwd", CAN_MISSING);
+        ASSERT (result != NULL && strcmp (result, result0) == 0);
+      }
+  }
+
+  /* Check for ., .., intermediate // handling, and for error cases.  */
+  {
+    char *result1 = canonicalize_file_name (BASE "//./..//" BASE "/tra");
+    char *result2 = canonicalize_filename_mode (BASE "//./..//" BASE "/tra",
+                                                CAN_EXISTING);
+    ASSERT (result1 != NULL);
+    ASSERT (result2 != NULL);
+    ASSERT (strcmp (result1, result2) == 0);
+    ASSERT (strstr (result1, "/" BASE "/tra")
+            == result1 + strlen (result1) - strlen ("/" BASE "/tra"));
+    free (result1);
+    free (result2);
+
+    errno = 0;
+    result1 = canonicalize_file_name ("");
+    ASSERT (result1 == NULL);
+    ASSERT (errno == ENOENT);
+
+    errno = 0;
+    result2 = canonicalize_filename_mode ("", CAN_EXISTING);
+    ASSERT (result2 == NULL);
+    ASSERT (errno == ENOENT);
+
+    /* This test works only if the canonicalize_file_name implementation
+       comes from gnulib.  If it comes from libc, we have no way to prevent
+       gcc from "optimizing" the null_ptr function in invalid ways.  See
+       <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93156>.  */
+#if GNULIB_defined_canonicalize_file_name
+    errno = 0;
+    result1 = canonicalize_file_name (null_ptr ());
+    ASSERT (result1 == NULL);
+    ASSERT (errno == EINVAL);
+#endif
+
+    errno = 0;
+    result2 = canonicalize_filename_mode (NULL, CAN_EXISTING);
+    ASSERT (result2 == NULL);
+    ASSERT (errno == EINVAL);
+
+    errno = 0;
+    result2 = canonicalize_filename_mode (".", CAN_MISSING | CAN_ALL_BUT_LAST);
+    ASSERT (result2 == NULL);
+    ASSERT (errno == EINVAL);
+  }
+
+  /* Check that a non-directory with trailing slash yields NULL.  */
+  {
+    char *result1;
+    char *result2;
+    errno = 0;
+    result1 = canonicalize_file_name (BASE "/tra/");
+    ASSERT (result1 == NULL);
+    ASSERT (errno == ENOTDIR);
+    errno = 0;
+    result2 = canonicalize_filename_mode (BASE "/tra/", CAN_EXISTING);
+    ASSERT (result2 == NULL);
+    ASSERT (errno == ENOTDIR);
+  }
+
+  /* Check that a missing directory yields NULL.  */
+  {
+    char *result1;
+    char *result2;
+    errno = 0;
+    result1 = canonicalize_file_name (BASE "/zzz/..");
+    ASSERT (result1 == NULL);
+    ASSERT (errno == ENOENT);
+    errno = 0;
+    result2 = canonicalize_filename_mode (BASE "/zzz/..", CAN_EXISTING);
+    ASSERT (result2 == NULL);
+    ASSERT (errno == ENOENT);
+  }
+
+  /* From here on out, tests involve symlinks.  */
+  if (symlink (BASE "/ket", "ise") != 0)
+    {
+      ASSERT (remove (BASE "/tra") == 0);
+      ASSERT (rmdir (BASE) == 0);
+      fputs ("skipping test: symlinks not supported on this file system\n",
+             stderr);
+      return 77;
+    }
+  ASSERT (symlink ("bef", BASE "/plo") == 0);
+  ASSERT (symlink ("tra", BASE "/huk") == 0);
+  ASSERT (symlink ("lum", BASE "/bef") == 0);
+  ASSERT (symlink ("wum", BASE "/ouk") == 0);
+  ASSERT (symlink ("../ise", BASE "/ket") == 0);
+  ASSERT (mkdir (BASE "/lum", 0700) == 0);
+  ASSERT (symlink ("s", BASE "/p") == 0);
+  ASSERT (symlink ("d", BASE "/s") == 0);
+  ASSERT (mkdir (BASE "/d", 0700) == 0);
+  ASSERT (close (creat (BASE "/d/2", 0600)) == 0);
+  ASSERT (symlink ("../s/2", BASE "/d/1") == 0);
+  ASSERT (symlink ("//.//../..", BASE "/droot") == 0);
+
+  /* Check that symbolic links are not resolved, with CAN_NOLINKS.  */
+  {
+    char *result1 = canonicalize_filename_mode (BASE "/huk", CAN_NOLINKS);
+    ASSERT (result1 != NULL);
+    ASSERT (strcmp (result1 + strlen (result1) - strlen ("/" BASE "/huk"),
+                    "/" BASE "/huk") == 0);
+    free (result1);
+  }
+
+  /* Check that the symbolic link to a file can be resolved.  */
+  {
+    char *result1 = canonicalize_file_name (BASE "/huk");
+    char *result2 = canonicalize_file_name (BASE "/tra");
+    char *result3 = canonicalize_filename_mode (BASE "/huk", CAN_EXISTING);
+    ASSERT (result1 != NULL);
+    ASSERT (result2 != NULL);
+    ASSERT (result3 != NULL);
+    ASSERT (strcmp (result1, result2) == 0);
+    ASSERT (strcmp (result2, result3) == 0);
+    ASSERT (strcmp (result1 + strlen (result1) - strlen ("/" BASE "/tra"),
+                    "/" BASE "/tra") == 0);
+    free (result1);
+    free (result2);
+    free (result3);
+  }
+
+  /* Check that the symbolic link to a directory can be resolved.  */
+  {
+    char *result1 = canonicalize_file_name (BASE "/plo");
+    char *result2 = canonicalize_file_name (BASE "/bef");
+    char *result3 = canonicalize_file_name (BASE "/lum");
+    char *result4 = canonicalize_filename_mode (BASE "/plo", CAN_EXISTING);
+    ASSERT (result1 != NULL);
+    ASSERT (result2 != NULL);
+    ASSERT (result3 != NULL);
+    ASSERT (result4 != NULL);
+    ASSERT (strcmp (result1, result2) == 0);
+    ASSERT (strcmp (result2, result3) == 0);
+    ASSERT (strcmp (result3, result4) == 0);
+    ASSERT (strcmp (result1 + strlen (result1) - strlen ("/" BASE "/lum"),
+                    "/" BASE "/lum") == 0);
+    free (result1);
+    free (result2);
+    free (result3);
+    free (result4);
+  }
+
+  /* Check that a symbolic link to a nonexistent file yields NULL.  */
+  {
+    char *result1;
+    char *result2;
+    errno = 0;
+    result1 = canonicalize_file_name (BASE "/ouk");
+    ASSERT (result1 == NULL);
+    ASSERT (errno == ENOENT);
+    errno = 0;
+    result2 = canonicalize_filename_mode (BASE "/ouk", CAN_EXISTING);
+    ASSERT (result2 == NULL);
+    ASSERT (errno == ENOENT);
+  }
+
+  /* Check that a non-directory symlink with trailing slash yields NULL,
+     and likewise for other troublesome suffixes.  */
+  {
+    char const *const file_name[]
+      = {
+         BASE "/huk/",
+         BASE "/huk/.",
+         BASE "/huk/./",
+         BASE "/huk/./.",
+         BASE "/huk/x",
+         BASE "/huk/..",
+         BASE "/huk/../",
+         BASE "/huk/../.",
+         BASE "/huk/../x",
+         BASE "/huk/./..",
+         BASE "/huk/././../x",
+        };
+    for (int i = 0; i < sizeof file_name / sizeof *file_name; i++)
+      {
+        errno = 0;
+        ASSERT (!canonicalize_file_name (file_name[i]));
+        ASSERT (errno == ENOTDIR);
+        errno = 0;
+        ASSERT (!canonicalize_filename_mode (file_name[i], CAN_EXISTING));
+        ASSERT (errno == ENOTDIR);
+      }
+  }
+
+  /* Check that a missing directory via symlink yields NULL.  */
+  {
+    char *result1;
+    char *result2;
+    errno = 0;
+    result1 = canonicalize_file_name (BASE "/ouk/..");
+    ASSERT (result1 == NULL);
+    ASSERT (errno == ENOENT);
+    errno = 0;
+    result2 = canonicalize_filename_mode (BASE "/ouk/..", CAN_EXISTING);
+    ASSERT (result2 == NULL);
+    ASSERT (errno == ENOENT);
+  }
+
+  /* Check that a loop of symbolic links is detected.  */
+  {
+    char *result1;
+    char *result2;
+    errno = 0;
+    result1 = canonicalize_file_name ("ise");
+    ASSERT (result1 == NULL);
+    ASSERT (errno == ELOOP);
+    errno = 0;
+    result2 = canonicalize_filename_mode ("ise", CAN_EXISTING);
+    ASSERT (result2 == NULL);
+    ASSERT (errno == ELOOP);
+  }
+
+  /* Check that alternate modes can resolve missing basenames.  */
+  {
+    char *result1 = canonicalize_filename_mode (BASE "/zzz", CAN_ALL_BUT_LAST);
+    char *result2 = canonicalize_filename_mode (BASE "/zzz", CAN_MISSING);
+    char *result3 = canonicalize_filename_mode (BASE "/zzz/", CAN_ALL_BUT_LAST);
+    char *result4 = canonicalize_filename_mode (BASE "/zzz/", CAN_MISSING);
+    ASSERT (result1 != NULL);
+    ASSERT (result2 != NULL);
+    ASSERT (result3 != NULL);
+    ASSERT (result4 != NULL);
+    ASSERT (strcmp (result1, result2) == 0);
+    ASSERT (strcmp (result2, result3) == 0);
+    ASSERT (strcmp (result3, result4) == 0);
+    ASSERT (strcmp (result1 + strlen (result1) - strlen ("/" BASE "/zzz"),
+                    "/" BASE "/zzz") == 0);
+    free (result1);
+    free (result2);
+    free (result3);
+    free (result4);
+  }
+
+  /* Check that alternate modes can resolve broken symlink basenames.  */
+  {
+    char *result1 = canonicalize_filename_mode (BASE "/ouk", CAN_ALL_BUT_LAST);
+    char *result2 = canonicalize_filename_mode (BASE "/ouk", CAN_MISSING);
+    char *result3 = canonicalize_filename_mode (BASE "/ouk/", CAN_ALL_BUT_LAST);
+    char *result4 = canonicalize_filename_mode (BASE "/ouk/", CAN_MISSING);
+    ASSERT (result1 != NULL);
+    ASSERT (result2 != NULL);
+    ASSERT (result3 != NULL);
+    ASSERT (result4 != NULL);
+    ASSERT (strcmp (result1, result2) == 0);
+    ASSERT (strcmp (result2, result3) == 0);
+    ASSERT (strcmp (result3, result4) == 0);
+    ASSERT (strcmp (result1 + strlen (result1) - strlen ("/" BASE "/wum"),
+                    "/" BASE "/wum") == 0);
+    free (result1);
+    free (result2);
+    free (result3);
+    free (result4);
+  }
+
+  /* Check that alternate modes can handle missing dirnames.  */
+  {
+    char *result1 = canonicalize_filename_mode ("t-can.zzz/zzz", CAN_ALL_BUT_LAST);
+    char *result2 = canonicalize_filename_mode ("t-can.zzz/zzz", CAN_MISSING);
+    ASSERT (result1 == NULL);
+    ASSERT (result2 != NULL);
+    ASSERT (strcmp (result2 + strlen (result2) - 14, "/t-can.zzz/zzz") == 0);
+    free (result2);
+  }
+
+  /* Ensure that the following is resolved properly.
+     Before 2007-09-27, it would mistakenly report a loop.  */
+  {
+    char *result1 = canonicalize_filename_mode (BASE, CAN_EXISTING);
+    char *result2 = canonicalize_filename_mode (BASE "/p/1", CAN_EXISTING);
+    ASSERT (result1 != NULL);
+    ASSERT (result2 != NULL);
+    ASSERT (strcmp (result2 + strlen (result1), "/d/2") == 0);
+    free (result1);
+    free (result2);
+  }
+
+  /* Check that leading // within symlinks is honored correctly.  */
+  {
+    struct stat st1;
+    struct stat st2;
+    char *result1 = canonicalize_file_name ("//.");
+    char *result2 = canonicalize_filename_mode ("//.", CAN_EXISTING);
+    char *result3 = canonicalize_file_name (BASE "/droot");
+    char *result4 = canonicalize_filename_mode (BASE "/droot", CAN_EXISTING);
+    ASSERT (result1);
+    ASSERT (result2);
+    ASSERT (result3);
+    ASSERT (result4);
+    ASSERT (stat ("/", &st1) == 0);
+    ASSERT (stat ("//", &st2) == 0);
+    if (SAME_INODE (st1, st2))
+      {
+        ASSERT (strcmp (result1, "/") == 0);
+        ASSERT (strcmp (result2, "/") == 0);
+        ASSERT (strcmp (result3, "/") == 0);
+        ASSERT (strcmp (result4, "/") == 0);
+      }
+    else
+      {
+        ASSERT (strcmp (result1, "//") == 0);
+        ASSERT (strcmp (result2, "//") == 0);
+        ASSERT (strcmp (result3, "//") == 0);
+        ASSERT (strcmp (result4, "//") == 0);
+      }
+    free (result1);
+    free (result2);
+    free (result3);
+    free (result4);
+  }
+
+  /* Cleanup.  */
+  ASSERT (remove (BASE "/droot") == 0);
+  ASSERT (remove (BASE "/d/1") == 0);
+  ASSERT (remove (BASE "/d/2") == 0);
+  ASSERT (remove (BASE "/d") == 0);
+  ASSERT (remove (BASE "/s") == 0);
+  ASSERT (remove (BASE "/p") == 0);
+  ASSERT (remove (BASE "/plo") == 0);
+  ASSERT (remove (BASE "/huk") == 0);
+  ASSERT (remove (BASE "/bef") == 0);
+  ASSERT (remove (BASE "/ouk") == 0);
+  ASSERT (remove (BASE "/ket") == 0);
+  ASSERT (remove (BASE "/lum") == 0);
+  ASSERT (remove (BASE "/tra") == 0);
+  ASSERT (remove (BASE) == 0);
+  ASSERT (remove ("ise") == 0);
+
+  return 0;
+}
index 6eac5f4..3b247d7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test changing to a directory.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 1c0be99..660e455 100644 (file)
@@ -1,5 +1,5 @@
 /* Test duplicating non-inheritable file descriptors.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
 #include <fcntl.h>
 #include <unistd.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Get declarations of the native Windows API functions.  */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 /* Get _get_osfhandle.  */
-# include "msvc-nothrow.h"
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
 #endif
 
 #include "binary-io.h"
@@ -39,7 +43,7 @@
 static int
 is_inheritable (int fd)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* On native Windows, the initial state of unassigned standard file
      descriptors is that they are open but point to an
      INVALID_HANDLE_VALUE, and there is no fcntl.  */
@@ -58,7 +62,7 @@ is_inheritable (int fd)
 }
 
 #if !O_BINARY
-# define setmode(f,m) zero ()
+# define set_binary_mode(f,m) zero ()
 static int zero (void) { return 0; }
 #endif
 
@@ -67,8 +71,8 @@ static int zero (void) { return 0; }
 static int
 is_mode (int fd, int mode)
 {
-  int value = setmode (fd, O_BINARY);
-  setmode (fd, value);
+  int value = set_binary_mode (fd, O_BINARY);
+  set_binary_mode (fd, value);
   return mode == value;
 }
 
@@ -86,7 +90,7 @@ main (void)
 
   /* Normal use of set_cloexec_flag.  */
   ASSERT (set_cloexec_flag (fd, true) == 0);
-#if !((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__)
+#if !(defined _WIN32 && ! defined __CYGWIN__)
   ASSERT (!is_inheritable (fd));
 #endif
   ASSERT (set_cloexec_flag (fd, false) == 0);
@@ -103,13 +107,13 @@ main (void)
 
   /* On systems that distinguish between text and binary mode,
      dup_cloexec reuses the mode of the source.  */
-  setmode (fd, O_BINARY);
+  set_binary_mode (fd, O_BINARY);
   ASSERT (is_mode (fd, O_BINARY));
   fd2 = dup_cloexec (fd);
   ASSERT (fd < fd2);
   ASSERT (is_mode (fd2, O_BINARY));
   ASSERT (close (fd2) == 0);
-  setmode (fd, O_TEXT);
+  set_binary_mode (fd, O_TEXT);
   ASSERT (is_mode (fd, O_TEXT));
   fd2 = dup_cloexec (fd);
   ASSERT (fd < fd2);
index a0428e0..992475f 100644 (file)
@@ -1,5 +1,5 @@
 /* Test closing a file or socket.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 8710a4d..98ea02e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of closein module.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
@@ -38,7 +38,7 @@ main (int argc, char **argv)
 
   /* close_stdin currently relies on ftell, but mingw ftell is
      unreliable on text mode input.  */
-  SET_BINARY (0);
+  set_binary_mode (0, O_BINARY);
 
   if (argc > 2)
     close (0);
index 9c5e851..d6359f9 100755 (executable)
@@ -7,26 +7,26 @@ echo world > xout.tmp
 
 fail=0
 # Test with seekable stdin; follow-on process must see remaining data
-(test-closein; cat) < in.tmp > out1.tmp || fail=1
+(${CHECKER} test-closein; cat) < in.tmp > out1.tmp || fail=1
 cmp out1.tmp in.tmp || fail=1
 
-(test-closein consume; cat) < in.tmp > out2.tmp || fail=1
+(${CHECKER} test-closein consume; cat) < in.tmp > out2.tmp || fail=1
 cmp out2.tmp xout.tmp || fail=1
 
 # Test for lack of error on pipe.  Ignore any EPIPE failures from cat.
-cat in.tmp 2>/dev/null | test-closein || fail=1
+cat in.tmp 2>/dev/null | ${CHECKER} test-closein || fail=1
 
-cat in.tmp 2>/dev/null | test-closein consume || fail=1
+cat in.tmp 2>/dev/null | ${CHECKER} test-closein consume || fail=1
 
 # Test for lack of error when nothing is read
-test-closein </dev/null || fail=1
+${CHECKER} test-closein </dev/null || fail=1
 
-test-closein <&- || fail=1
+${CHECKER} test-closein <&- || fail=1
 
 # Test for no error when EOF is read early
-test-closein consume </dev/null || fail=1
+${CHECKER} test-closein consume </dev/null || fail=1
 
 # Test for error when read fails because no file available
-test-closein consume close <&- 2>/dev/null && fail=1
+${CHECKER} test-closein consume close <&- 2>/dev/null && fail=1
 
 Exit $fail
diff --git a/tests/test-connect.c b/tests/test-connect.c
new file mode 100644 (file)
index 0000000..5e2905b
--- /dev/null
@@ -0,0 +1,60 @@
+/* Test connecting a client socket.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (connect, int, (int, const struct sockaddr *, socklen_t));
+
+#include <errno.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+
+#include "sockets.h"
+#include "macros.h"
+
+int
+main (void)
+{
+  (void) gl_sockets_startup (SOCKETS_1_1);
+
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    struct sockaddr_in addr;
+
+    addr.sin_family = AF_INET;
+    inet_pton (AF_INET, "127.0.0.1", &addr.sin_addr);
+    addr.sin_port = htons (80);
+    {
+      errno = 0;
+      ASSERT (connect (-1, (const struct sockaddr *) &addr, sizeof (addr))
+              == -1);
+      ASSERT (errno == EBADF);
+    }
+    {
+      close (99);
+      errno = 0;
+      ASSERT (connect (99, (const struct sockaddr *) &addr, sizeof (addr))
+              == -1);
+      ASSERT (errno == EBADF);
+    }
+  }
+
+  return 0;
+}
diff --git a/tests/test-creat.c b/tests/test-creat.c
new file mode 100644 (file)
index 0000000..658004b
--- /dev/null
@@ -0,0 +1,62 @@
+/* Test of creating a file.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <fcntl.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (creat, int, (const char *, mode_t));
+
+#include <errno.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#define BASE "test-creat.t"
+
+int
+main (void)
+{
+  int fd;
+
+  /* Remove anything from prior partial run.  */
+  unlink (BASE "file");
+  unlink (BASE "e.exe");
+
+  /* Cannot create directory.  */
+  errno = 0;
+  ASSERT (creat ("nonexist.ent/", 0600) == -1);
+  ASSERT (errno == ENOTDIR || errno == EISDIR || errno == ENOENT
+          || errno == EINVAL);
+
+  /* Create a regular file.  */
+  fd = creat (BASE "file", 0600);
+  ASSERT (0 <= fd);
+  ASSERT (close (fd) == 0);
+
+  /* Create an executable regular file.  */
+  fd = creat (BASE "e.exe", 0700);
+  ASSERT (0 <= fd);
+  ASSERT (close (fd) == 0);
+
+  /* Cleanup.  */
+  ASSERT (unlink (BASE "file") == 0);
+  ASSERT (unlink (BASE "e.exe") == 0);
+
+  return 0;
+}
diff --git a/tests/test-ctype-c++.cc b/tests/test-ctype-c++.cc
new file mode 100644 (file)
index 0000000..fbf9786
--- /dev/null
@@ -0,0 +1,35 @@
+/* Test of <ctype.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <ctype.h>
+
+#include "signature.h"
+
+
+#if 0
+SIGNATURE_CHECK (GNULIB_NAMESPACE::isblank, int, (int));
+#endif
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-ctype-c++2.cc b/tests/test-ctype-c++2.cc
new file mode 100644 (file)
index 0000000..8f93e81
--- /dev/null
@@ -0,0 +1,20 @@
+/* Test of <ctype.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cctype>
index 570fbdb..43256a4 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <ctype.h> substitute.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index 9a83b86..ec2109e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <dirent.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
 #include "signature.h"
 
 
+#if GNULIB_TEST_OPENDIR
+SIGNATURE_CHECK (GNULIB_NAMESPACE::opendir, DIR *, (const char *));
+#endif
+
+#if GNULIB_TEST_READDIR
+SIGNATURE_CHECK (GNULIB_NAMESPACE::readdir, struct dirent *, (DIR *));
+#endif
+
+#if GNULIB_TEST_REWINDDIR
+SIGNATURE_CHECK (GNULIB_NAMESPACE::rewinddir, void, (DIR *));
+#endif
+
+#if GNULIB_TEST_CLOSEDIR
 SIGNATURE_CHECK (GNULIB_NAMESPACE::closedir, int, (DIR *));
+#endif
+
+#if GNULIB_TEST_DIRFD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::dirfd, int, (DIR *));
+#endif
 
 #if GNULIB_TEST_FDOPENDIR
 SIGNATURE_CHECK (GNULIB_NAMESPACE::fdopendir, DIR *, (int));
 #endif
 
-SIGNATURE_CHECK (GNULIB_NAMESPACE::opendir, DIR *, (const char *));
-
 #if GNULIB_TEST_SCANDIR
 SIGNATURE_CHECK (GNULIB_NAMESPACE::scandir, int,
                  (const char *, struct dirent ***,
index 50a0c95..e964330 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <dirent.h> substitute.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index b9b876a..3f90e17 100644 (file)
@@ -1,5 +1,5 @@
 /* Test the gnulib dirname module.
-   Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index fdae635..7ad768f 100644 (file)
@@ -1,5 +1,5 @@
 /* Test that dup_safer leaves standard fds alone.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
 #include "binary-io.h"
 #include "cloexec.h"
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Get declarations of the native Windows API functions.  */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 /* Get _get_osfhandle.  */
-# include "msvc-nothrow.h"
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
 #endif
 
 #if !O_BINARY
-# define setmode(f,m) zero ()
+# define set_binary_mode(f,m) zero ()
 static int zero (void) { return 0; }
 #endif
 
@@ -56,7 +60,7 @@ static FILE *myerr;
 static bool
 is_open (int fd)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* On native Windows, the initial state of unassigned standard file
      descriptors is that they are open but point to an
      INVALID_HANDLE_VALUE, and there is no fcntl.  */
@@ -73,7 +77,7 @@ is_open (int fd)
 static bool
 is_inheritable (int fd)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* On native Windows, the initial state of unassigned standard file
      descriptors is that they are open but point to an
      INVALID_HANDLE_VALUE, and there is no fcntl.  */
@@ -96,8 +100,8 @@ is_inheritable (int fd)
 static bool
 is_mode (int fd, int mode)
 {
-  int value = setmode (fd, O_BINARY);
-  setmode (fd, value);
+  int value = set_binary_mode (fd, O_BINARY);
+  set_binary_mode (fd, value);
   return mode == value;
 }
 
@@ -139,14 +143,14 @@ main (void)
       ASSERT (errno == EBADF);
 
       /* Preserve text vs. binary.  */
-      setmode (fd, O_BINARY);
+      set_binary_mode (fd, O_BINARY);
       ASSERT (dup (fd) == fd + 1);
       ASSERT (is_open (fd + 1));
       ASSERT (is_inheritable (fd + 1));
       ASSERT (is_mode (fd + 1, O_BINARY));
 
       ASSERT (close (fd + 1) == 0);
-      setmode (fd, O_TEXT);
+      set_binary_mode (fd, O_TEXT);
       ASSERT (dup (fd) == fd + 1);
       ASSERT (is_open (fd + 1));
       ASSERT (is_inheritable (fd + 1));
index c62b06f..52dd891 100644 (file)
@@ -1,5 +1,5 @@
 /* Test duplicating a file descriptor.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 5da6812..6c2e65e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test duplicating file descriptors.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
@@ -36,12 +36,16 @@ SIGNATURE_CHECK (dup2, int, (int, int));
 # include "cloexec.h"
 #endif
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Get declarations of the native Windows API functions.  */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 /* Get _get_osfhandle.  */
-# include "msvc-nothrow.h"
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
 #endif
 
 #include "macros.h"
@@ -50,7 +54,7 @@ SIGNATURE_CHECK (dup2, int, (int, int));
 static int
 is_open (int fd)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* On native Windows, the initial state of unassigned standard file
      descriptors is that they are open but point to an
      INVALID_HANDLE_VALUE, and there is no fcntl.  */
@@ -68,7 +72,7 @@ is_open (int fd)
 static int
 is_inheritable (int fd)
 {
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
   /* On native Windows, the initial state of unassigned standard file
      descriptors is that they are open but point to an
      INVALID_HANDLE_VALUE, and there is no fcntl.  */
@@ -88,7 +92,7 @@ is_inheritable (int fd)
 #endif /* GNULIB_TEST_CLOEXEC */
 
 #if !O_BINARY
-# define setmode(f,m) zero ()
+# define set_binary_mode(f,m) zero ()
 static int zero (void) { return 0; }
 #endif
 
@@ -97,8 +101,8 @@ static int zero (void) { return 0; }
 static int
 is_mode (int fd, int mode)
 {
-  int value = setmode (fd, O_BINARY);
-  setmode (fd, value);
+  int value = set_binary_mode (fd, O_BINARY);
+  set_binary_mode (fd, value);
   return mode == value;
 }
 
@@ -199,11 +203,11 @@ main (void)
 
   /* On systems that distinguish between text and binary mode, dup2
      reuses the mode of the source.  */
-  setmode (fd, O_BINARY);
+  set_binary_mode (fd, O_BINARY);
   ASSERT (is_mode (fd, O_BINARY));
   ASSERT (dup2 (fd, fd + 1) == fd + 1);
   ASSERT (is_mode (fd + 1, O_BINARY));
-  setmode (fd, O_TEXT);
+  set_binary_mode (fd, O_TEXT);
   ASSERT (is_mode (fd, O_TEXT));
   ASSERT (dup2 (fd, fd + 1) == fd + 1);
   ASSERT (is_mode (fd + 1, O_TEXT));
diff --git a/tests/test-dynarray.c b/tests/test-dynarray.c
new file mode 100644 (file)
index 0000000..c3f9a29
--- /dev/null
@@ -0,0 +1,53 @@
+/* Test of type-safe arrays that grow dynamically.
+   Copyright (C) 2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2021.  */
+
+#include <config.h>
+
+#define DYNARRAY_STRUCT int_sequence
+#define DYNARRAY_ELEMENT int
+#define DYNARRAY_PREFIX intseq_
+#include "dynarray.h"
+
+#include "macros.h"
+
+#define N 100000
+
+static int
+value_at (long long int i)
+{
+  return (i % 13) + ((i * i) % 251);
+}
+
+int
+main ()
+{
+  struct int_sequence s;
+  int i;
+
+  intseq_init (&s);
+  for (i = 0; i < N; i++)
+    intseq_add (&s, value_at (i));
+  for (i = N - 1; i >= N / 2; i--)
+    {
+      ASSERT (* intseq_at (&s, i) == value_at (i));
+      intseq_remove_last (&s);
+    }
+  intseq_free (&s);
+
+  return 0;
+}
index 0047246..2935e43 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of environ variable.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
diff --git a/tests/test-errno-c++.cc b/tests/test-errno-c++.cc
new file mode 100644 (file)
index 0000000..e5dc172
--- /dev/null
@@ -0,0 +1,28 @@
+/* Test of <errno.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <errno.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-errno-c++2.cc b/tests/test-errno-c++2.cc
new file mode 100644 (file)
index 0000000..07936c5
--- /dev/null
@@ -0,0 +1,20 @@
+/* Test of <errno.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cerrno>
index 1e0bb6d..59c5344 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <errno.h> substitute.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
diff --git a/tests/test-execute-child.c b/tests/test-execute-child.c
new file mode 100644 (file)
index 0000000..dbaae1e
--- /dev/null
@@ -0,0 +1,236 @@
+/* Child program invoked by test-execute-main.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* If the user's config.h happens to include <sys/stat.h>, let it include only
+   the system's <sys/stat.h> here.  */
+#define __need_system_sys_stat_h
+#include <config.h>
+
+/* Get the original definition of fstat.  It might be defined as a macro.
+   Also, 'stat' might be defined as a macro.  */
+#include <sys/types.h>
+#include <sys/stat.h>
+#undef __need_system_sys_stat_h
+
+/* Return non-zero if FD is opened to a device.  */
+static int
+is_device (int fd)
+{
+#if defined _WIN32 && ! defined __CYGWIN__
+  struct _stat st;
+  return _fstat (fd, &st) >= 0 && !((st.st_mode & S_IFMT) == S_IFREG);
+#else
+  struct stat st;
+  return fstat (fd, &st) >= 0 && !S_ISREG (st.st_mode);
+#endif
+}
+
+/* Now include the other header files.  */
+#include <fcntl.h>
+#include <signal.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions.  */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* Get _get_osfhandle, _isatty, _chdir, _getcwd.  */
+# include <io.h>
+#endif
+
+/* In this file, we use only system functions, no overrides from gnulib.  */
+#undef atoi
+#undef fcntl
+#undef fflush
+#undef fgetc
+#undef fprintf
+#undef fputs
+#undef getcwd
+#undef isatty
+#undef raise
+#undef read
+#undef sprintf
+#undef strcmp
+#undef strlen
+#undef write
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static void __cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+                                   const wchar_t *function,
+                                   const wchar_t *file,
+                                   unsigned int line,
+                                   uintptr_t dummy)
+{
+}
+#endif
+
+/* Return non-zero if FD is open.  */
+static int
+is_open (int fd)
+{
+#if defined _WIN32 && ! defined __CYGWIN__
+  /* On native Windows, the initial state of unassigned standard file
+     descriptors is that they are open but point to an
+     INVALID_HANDLE_VALUE, and there is no fcntl.  */
+  return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
+#else
+# ifndef F_GETFL
+#  error Please port fcntl to your platform
+# endif
+  return 0 <= fcntl (fd, F_GETFL);
+#endif
+}
+
+int
+main (int argc, char *argv[])
+{
+  if (argc == 1)
+    /* Check an invocation without arguments.  Check the exit code.  */
+    return 40;
+
+  int test = atoi (argv[1]);
+  switch (test)
+    {
+    case 2:
+      /* Check argument passing.  */
+      return !(argc == 12
+               && strcmp (argv[2], "abc def") == 0
+               && strcmp (argv[3], "abc\"def\"ghi") == 0
+               && strcmp (argv[4], "xyz\"") == 0
+               && strcmp (argv[5], "abc\\def\\ghi") == 0
+               && strcmp (argv[6], "xyz\\") == 0
+               && strcmp (argv[7], "???") == 0
+               && strcmp (argv[8], "***") == 0
+               && strcmp (argv[9], "") == 0
+               && strcmp (argv[10], "foo") == 0
+               && strcmp (argv[11], "") == 0);
+    #if !(defined _WIN32 && !defined __CYGWIN__)
+    case 3:
+      /* Check SIGPIPE handling with ignore_sigpipe = false.  */
+    case 4:
+      /* Check SIGPIPE handling with ignore_sigpipe = true.  */
+      raise (SIGPIPE);
+      return 71;
+    #endif
+    case 5:
+      /* Check other signal.  */
+      raise (SIGINT);
+      return 71;
+    case 6:
+      /* Check stdin is inherited.  */
+      return !(fgetc (stdin) == 'F' && fgetc (stdin) == 'o');
+    case 7:
+      /* Check null_stdin = true.  */
+      return !(fgetc (stdin) == EOF);
+    case 8:
+      /* Check stdout is inherited, part 1 (regular file).  */
+      return !(fputs ("bar", stdout) != EOF && fflush (stdout) == 0);
+    case 9:
+      /* Check stdout is inherited, part 2 (device).  */
+    case 10:
+      /* Check null_stdout = true.  */
+      return !is_device (STDOUT_FILENO);
+    case 11:
+      /* Check stderr is inherited, part 1 (regular file).  */
+      return !(fputs ("bar", stderr) != EOF && fflush (stderr) == 0);
+    case 12:
+      /* Check stderr is inherited, part 2 (device).  */
+    case 13:
+      /* Check null_stderr = true.  */
+      return !is_device (STDERR_FILENO);
+    case 14:
+    case 15:
+      /* Check file descriptors >= 3 can be inherited.  */
+    case 16:
+      /* Check file descriptors >= 3 with O_CLOEXEC bit are not inherited.  */
+      #if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+      /* Avoid exceptions from within _get_osfhandle.  */
+      _set_invalid_parameter_handler (gl_msvc_invalid_parameter_handler);
+      #endif
+      {
+        char buf[300];
+        buf[0] = '\0';
+        char *p = buf;
+        int fd;
+        for (fd = 0; fd < 20; fd++)
+          if (is_open (fd))
+            {
+              sprintf (p, "%d ", fd);
+              p += strlen (p);
+            }
+        const char *expected = (test < 16 ? "0 1 2 10 " : "0 1 2 ");
+        if (strcmp (buf, expected) == 0)
+          return 0;
+        else
+          {
+            fprintf (stderr, "Test case %d: %s\n", test, buf); fflush (stderr);
+            return 1;
+          }
+      }
+    case 17:
+      /* Check that file descriptors >= 3, open for reading, can be inherited,
+         including the file position.  */
+      {
+        char buf[6];
+        int n = read (10, buf, sizeof (buf));
+        return !(n == 4 && memcmp (buf, "obar", 4) == 0);
+      }
+    case 18:
+      /* Check that file descriptors >= 3, open for writing, can be inherited,
+         including the file position.  */
+      {
+        int n = write (10, "bar", 3);
+        return !(n == 3);
+      }
+    case 19:
+      /* Check that file descriptors >= 3, when inherited, preserve their
+         isatty() property, part 1 (regular file).  */
+    case 20:
+      /* Check that file descriptors >= 3, when inherited, preserve their
+         isatty() property, part 2 (character devices).  */
+      {
+        #if defined _WIN32 && ! defined __CYGWIN__
+        return 4 + 2 * (_isatty (10) != 0) + (_isatty (11) != 0);
+        #else
+        return 4 + 2 * (isatty (10) != 0) + (isatty (11) != 0);
+        #endif
+      }
+    case 21:
+      /* Check execution in a different directory.  */
+      {
+        char cwd[1024];
+        #if defined _WIN32 && ! defined __CYGWIN__
+        if (_chdir ("..") != 0)
+          return 1;
+        if (_getcwd (cwd, sizeof (cwd)) == NULL)
+          return 2;
+        #else
+        if (chdir ("..") != 0)
+          return 1;
+        if (getcwd (cwd, sizeof (cwd)) == NULL)
+          return 2;
+        #endif
+        return (argc == 3 && strcmp (argv[2], cwd) == 0 ? 0 : 3);
+      }
+    default:
+      abort ();
+    }
+}
diff --git a/tests/test-execute-main.c b/tests/test-execute-main.c
new file mode 100644 (file)
index 0000000..372ff1d
--- /dev/null
@@ -0,0 +1,485 @@
+/* Test of execute.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "execute.h"
+
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Get _isatty, _getcwd.  */
+# include <io.h>
+#endif
+
+#include "read-file.h"
+#include "macros.h"
+
+/* The name of the "always silent" device.  */
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Native Windows API.  */
+# define DEV_NULL "NUL"
+#else
+/* Unix API.  */
+# define DEV_NULL "/dev/null"
+#endif
+
+#define BASE "test-execute"
+
+int
+main (int argc, char *argv[])
+{
+  if (argc != 3)
+    {
+      fprintf (stderr, "%s: need 2 arguments\n", argv[0]);
+      return 2;
+    }
+  char *prog_path = argv[1];
+  const char *progname = "test-execute-child";
+  int test = atoi (argv[2]);
+
+  switch (test)
+    {
+    case 14:
+    case 15:
+    case 16:
+      /* Close file descriptors that have been inherited from the parent
+         process and that would cause failures in test-execute-child.c.
+         Such file descriptors have been seen:
+           - with GNU make, when invoked as 'make -j N' with j > 1,
+           - in some versions of the KDE desktop environment,
+           - on NetBSD,
+           - in MacPorts with the "trace mode" enabled.
+       */
+      #if HAVE_CLOSE_RANGE
+      if (close_range (3, 20 - 1, 0) < 0)
+      #endif
+        {
+          int fd;
+          for (fd = 3; fd < 20; fd++)
+            close (fd);
+        }
+    default:
+      break;
+    }
+
+  switch (test)
+    {
+    case 0:
+      {
+        /* Check an invocation without arguments.  Check the exit code.  */
+        const char *prog_argv[2] = { prog_path, NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 40);
+      }
+      break;
+    case 1:
+      {
+        /* Check an invocation of a non-existent program.  */
+        const char *prog_argv[3] = { "./non-existent", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 127);
+      }
+      break;
+    case 2:
+      {
+        /* Check argument passing.  */
+        const char *prog_argv[13] =
+          {
+            prog_path,
+            "2",
+            "abc def",
+            "abc\"def\"ghi",
+            "xyz\"",
+            "abc\\def\\ghi",
+            "xyz\\",
+            "???",
+            "***",
+            "",
+            "foo",
+            "",
+            NULL
+          };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+      }
+      break;
+    case 3:
+      #if !(defined _WIN32 && !defined __CYGWIN__)
+      {
+        /* Check SIGPIPE handling with ignore_sigpipe = false.  */
+        const char *prog_argv[3] = { prog_path, "3", NULL };
+        int termsig = 0x7DEADBEE;
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, &termsig);
+        ASSERT (ret == 127);
+        ASSERT (termsig == SIGPIPE);
+      }
+      #endif
+      break;
+    case 4:
+      #if !(defined _WIN32 && !defined __CYGWIN__)
+      {
+        /* Check SIGPIPE handling with ignore_sigpipe = true.  */
+        const char *prog_argv[3] = { prog_path, "4", NULL };
+        int termsig = 0x7DEADBEE;
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           true, false, false, false, true, false, &termsig);
+        ASSERT (ret == 0);
+        ASSERT (termsig == SIGPIPE);
+      }
+      #endif
+      break;
+    case 5:
+      {
+        /* Check other signal.  */
+        const char *prog_argv[3] = { prog_path, "5", NULL };
+        int termsig = 0x7DEADBEE;
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, &termsig);
+        ASSERT (ret == 127);
+        #if defined _WIN32 && !defined __CYGWIN__
+        ASSERT (termsig == SIGTERM); /* dummy, from WTERMSIG in <sys/wait.h> */
+        #else
+        ASSERT (termsig == SIGINT);
+        #endif
+      }
+      break;
+    case 6:
+      {
+        /* Check stdin is inherited.  */
+        FILE *fp = fopen (BASE ".tmp", "w");
+        fputs ("Foo", fp);
+        ASSERT (fclose (fp) == 0);
+
+        fp = freopen (BASE ".tmp", "r", stdin);
+        ASSERT (fp != NULL);
+
+        const char *prog_argv[3] = { prog_path, "6", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+
+        ASSERT (fclose (stdin) == 0);
+        ASSERT (remove (BASE ".tmp") == 0);
+      }
+      break;
+    case 7:
+      {
+        /* Check null_stdin = true.  */
+        FILE *fp = fopen (BASE ".tmp", "w");
+        fputs ("Foo", fp);
+        ASSERT (fclose (fp) == 0);
+
+        fp = freopen (BASE ".tmp", "r", stdin);
+        ASSERT (fp != NULL);
+
+        const char *prog_argv[3] = { prog_path, "7", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, true, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+
+        ASSERT (fclose (stdin) == 0);
+        ASSERT (remove (BASE ".tmp") == 0);
+      }
+      break;
+    case 8:
+      {
+        /* Check stdout is inherited, part 1 (regular file).  */
+        FILE *fp = freopen (BASE ".tmp", "w", stdout);
+        ASSERT (fp != NULL);
+
+        const char *prog_argv[3] = { prog_path, "8", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+
+        ASSERT (fclose (stdout) == 0);
+
+        size_t length;
+        char *contents = read_file (BASE ".tmp", 0, &length);
+        ASSERT (length == 3 && memcmp (contents, "bar", 3) == 0);
+
+        ASSERT (remove (BASE ".tmp") == 0);
+      }
+      break;
+    case 9:
+      {
+        /* Check stdout is inherited, part 2 (device).  */
+        FILE *fp = freopen (DEV_NULL, "w", stdout);
+        ASSERT (fp != NULL);
+
+        const char *prog_argv[3] = { prog_path, "9", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+      }
+      break;
+    case 10:
+      {
+        /* Check null_stdout = true.  */
+        FILE *fp = freopen (BASE ".tmp", "w", stdout);
+        ASSERT (fp != NULL);
+
+        const char *prog_argv[3] = { prog_path, "10", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, true, false, true, false, NULL);
+        ASSERT (ret == 0);
+
+        ASSERT (fclose (stdout) == 0);
+
+        size_t length;
+        (void) read_file (BASE ".tmp", 0, &length);
+        ASSERT (length == 0);
+
+        ASSERT (remove (BASE ".tmp") == 0);
+      }
+      break;
+    case 11:
+      {
+        /* Check stderr is inherited, part 1 (regular file).  */
+        FILE *fp = freopen (BASE ".tmp", "w", stderr);
+        ASSERT (fp != NULL);
+
+        const char *prog_argv[3] = { prog_path, "11", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+
+        ASSERT (fclose (stderr) == 0);
+
+        size_t length;
+        char *contents = read_file (BASE ".tmp", 0, &length);
+        ASSERT (length == 3 && memcmp (contents, "bar", 3) == 0);
+
+        ASSERT (remove (BASE ".tmp") == 0);
+      }
+      break;
+    case 12:
+      {
+        /* Check stderr is inherited, part 2 (device).  */
+        FILE *fp = freopen (DEV_NULL, "w", stderr);
+        ASSERT (fp != NULL);
+
+        const char *prog_argv[3] = { prog_path, "12", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+      }
+      break;
+    case 13:
+      {
+        /* Check null_stderr = true.  */
+        FILE *fp = freopen (BASE ".tmp", "w", stderr);
+        ASSERT (fp != NULL);
+
+        const char *prog_argv[3] = { prog_path, "13", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, true, true, false, NULL);
+        ASSERT (ret == 0);
+
+        ASSERT (fclose (stderr) == 0);
+
+        size_t length;
+        (void) read_file (BASE ".tmp", 0, &length);
+        ASSERT (length == 0);
+
+        ASSERT (remove (BASE ".tmp") == 0);
+      }
+      break;
+    case 14:
+      {
+        /* Check file descriptors >= 3 can be inherited.  */
+        ASSERT (dup2 (STDOUT_FILENO, 10) >= 0);
+        const char *prog_argv[3] = { prog_path, "14", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           true, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+      }
+      break;
+    case 15:
+      {
+        /* Check file descriptors >= 3 can be inherited.  */
+        ASSERT (fcntl (STDOUT_FILENO, F_DUPFD, 10) >= 0);
+        const char *prog_argv[3] = { prog_path, "15", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           true, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+      }
+      break;
+    case 16:
+      {
+        /* Check file descriptors >= 3 with O_CLOEXEC bit are not inherited.  */
+        ASSERT (fcntl (STDOUT_FILENO, F_DUPFD_CLOEXEC, 10) >= 0);
+        const char *prog_argv[3] = { prog_path, "16", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           true, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+      }
+      break;
+    case 17:
+      {
+        /* Check that file descriptors >= 3, open for reading, can be inherited,
+           including the file position.  */
+        FILE *fp = fopen (BASE ".tmp", "w");
+        fputs ("Foobar", fp);
+        ASSERT (fclose (fp) == 0);
+
+        int fd = open (BASE ".tmp", O_RDONLY);
+        ASSERT (fd >= 0 && fd < 10);
+
+        ASSERT (dup2 (fd, 10) >= 0);
+        close (fd);
+        fd = 10;
+
+        char buf[2];
+        ASSERT (read (fd, buf, sizeof (buf)) == sizeof (buf));
+        /* The file position is now 2.  */
+
+        const char *prog_argv[3] = { prog_path, "17", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+
+        close (fd);
+        ASSERT (remove (BASE ".tmp") == 0);
+      }
+      break;
+    case 18:
+      {
+        /* Check that file descriptors >= 3, open for writing, can be inherited,
+           including the file position.  */
+        remove (BASE ".tmp");
+        int fd = open (BASE ".tmp", O_RDWR | O_CREAT | O_TRUNC, 0600);
+        ASSERT (fd >= 0 && fd < 10);
+
+        ASSERT (dup2 (fd, 10) >= 0);
+        close (fd);
+        fd = 10;
+
+        ASSERT (write (fd, "Foo", 3) == 3);
+        /* The file position is now 3.  */
+
+        const char *prog_argv[3] = { prog_path, "18", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+
+        close (fd);
+
+        size_t length;
+        char *contents = read_file (BASE ".tmp", 0, &length);
+        ASSERT (length == 6 && memcmp (contents, "Foobar", 6) == 0);
+
+        ASSERT (remove (BASE ".tmp") == 0);
+      }
+      break;
+    case 19:
+      {
+        /* Check that file descriptors >= 3, when inherited, preserve their
+           isatty() property, part 1 (regular file).  */
+        FILE *fp = fopen (BASE ".tmp", "w");
+        fputs ("Foo", fp);
+        ASSERT (fclose (fp) == 0);
+
+        int fd_in = open (BASE ".tmp", O_RDONLY);
+        ASSERT (fd_in >= 0 && fd_in < 10);
+
+        int fd_out = open (BASE ".tmp", O_WRONLY | O_APPEND);
+        ASSERT (fd_out >= 0 && fd_out < 10);
+
+        ASSERT (dup2 (fd_in, 10) >= 0);
+        close (fd_in);
+        fd_in = 10;
+
+        ASSERT (dup2 (fd_out, 11) >= 0);
+        close (fd_out);
+        fd_out = 11;
+
+        const char *prog_argv[3] = { prog_path, "19", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        #if defined _WIN32 && ! defined __CYGWIN__
+        ASSERT (ret == 4 + 2 * (_isatty (10) != 0) + (_isatty (11) != 0));
+        #else
+        ASSERT (ret == 4 + 2 * (isatty (10) != 0) + (isatty (11) != 0));
+        #endif
+
+        close (fd_in);
+        close (fd_out);
+        ASSERT (remove (BASE ".tmp") == 0);
+      }
+      break;
+    case 20:
+      {
+        /* Check that file descriptors >= 3, when inherited, preserve their
+           isatty() property, part 2 (character devices).  */
+        ASSERT (dup2 (STDIN_FILENO, 10) >= 0);
+        int fd_in = 10;
+
+        ASSERT (dup2 (STDOUT_FILENO, 11) >= 0);
+        int fd_out = 11;
+
+        const char *prog_argv[3] = { prog_path, "20", NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        #if defined _WIN32 && ! defined __CYGWIN__
+        ASSERT (ret == 4 + 2 * (_isatty (10) != 0) + (_isatty (11) != 0));
+        #else
+        ASSERT (ret == 4 + 2 * (isatty (10) != 0) + (isatty (11) != 0));
+        #endif
+
+        close (fd_in);
+        close (fd_out);
+      }
+      break;
+    case 21:
+      {
+        /* Check execution in a different directory.  */
+        rmdir (BASE ".sub");
+        ASSERT (mkdir (BASE ".sub", 0700) == 0);
+
+        char cwd[1024];
+        #if defined _WIN32 && ! defined __CYGWIN__
+        ASSERT (_getcwd (cwd, sizeof (cwd)) != NULL);
+        #else
+        ASSERT (getcwd (cwd, sizeof (cwd)) != NULL);
+        #endif
+
+        const char *prog_argv[4] = { prog_path, "21", cwd, NULL };
+        int ret = execute (progname, prog_argv[0], prog_argv, BASE ".sub",
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 0);
+
+        ASSERT (rmdir (BASE ".sub") == 0);
+      }
+      break;
+    default:
+      ASSERT (false);
+    }
+  return 0;
+}
diff --git a/tests/test-execute-script.c b/tests/test-execute-script.c
new file mode 100644 (file)
index 0000000..99794e5
--- /dev/null
@@ -0,0 +1,95 @@
+/* Test of execute.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "execute.h"
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "read-file.h"
+#include "macros.h"
+
+#define DATA_FILENAME "test-execute-script.tmp"
+
+int
+main ()
+{
+  unlink (DATA_FILENAME);
+
+  /* Check an invocation of an executable script.
+     This should only be supported if the script has a '#!' marker; otherwise
+     it is unsecure: <https://sourceware.org/bugzilla/show_bug.cgi?id=13134>.
+     POSIX says that the execlp() and execvp() functions support executing
+     shell scripts
+     <https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html>,
+     but this is considered an antiquated feature.  */
+
+  /* This test is an extension of
+     "Check stdout is inherited, part 1 (regular file)"
+     in test-execute-main.c.  */
+  FILE *fp = freopen (DATA_FILENAME, "w", stdout);
+  ASSERT (fp != NULL);
+
+  {
+    size_t i;
+
+    for (i = 0; i < 2; i++)
+      {
+        const char *progname =
+          (i == 0 ? "executable-script" : "executable-script.sh");
+        const char *prog_path =
+          (i == 0 ? SRCDIR "executable-script" : SRCDIR "executable-script.sh");
+        const char *prog_argv[2] = { prog_path, NULL };
+
+        int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                           false, false, false, false, true, false, NULL);
+        ASSERT (ret == 127);
+      }
+  }
+
+#if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, scripts - even with '#!' marker - are not executable.
+     Only .bat and .cmd files are.  */
+  ASSERT (fclose (fp) == 0);
+  ASSERT (unlink (DATA_FILENAME) == 0);
+  fprintf (stderr, "Skipping test: scripts are not executable on this platform.\n");
+  return 77;
+#else
+  {
+    const char *progname = "executable-shell-script";
+    const char *prog_path = SRCDIR "executable-shell-script";
+    const char *prog_argv[2] = { prog_path, NULL };
+
+    int ret = execute (progname, prog_argv[0], prog_argv, NULL,
+                       false, false, false, false, true, false, NULL);
+    ASSERT (ret == 0);
+
+    ASSERT (fclose (fp) == 0);
+
+    size_t length;
+    char *contents = read_file (DATA_FILENAME, 0, &length);
+    ASSERT (length == 11 && memcmp (contents, "Halle Potta", 11) == 0);
+  }
+
+  ASSERT (unlink (DATA_FILENAME) == 0);
+
+  return 0;
+#endif
+}
diff --git a/tests/test-execute.sh b/tests/test-execute.sh
new file mode 100755 (executable)
index 0000000..15c8b47
--- /dev/null
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+st=0
+for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ; do
+  ${CHECKER} ./test-execute-main${EXEEXT} ./test-execute-child${EXEEXT} $i \
+    || { echo test-execute.sh: test case $i failed >&2; st=1; }
+done
+exit $st
diff --git a/tests/test-explicit_bzero.c b/tests/test-explicit_bzero.c
new file mode 100644 (file)
index 0000000..cdb8392
--- /dev/null
@@ -0,0 +1,177 @@
+/* Test of explicit_bzero() function.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <string.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (explicit_bzero, void, (void *, size_t));
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include "vma-iter.h"
+#include "macros.h"
+
+#define SECRET "xyzzy1729"
+#define SECRET_SIZE 9
+
+static char zero[SECRET_SIZE] = { 0 };
+
+/* Enable this to verify that the test is effective.  */
+#if 0
+# define explicit_bzero(a, n)  memset (a, '\0', n)
+#endif
+
+/* =================== Verify operation on static memory =================== */
+
+static char stbuf[SECRET_SIZE];
+
+static void
+test_static (void)
+{
+  memcpy (stbuf, SECRET, SECRET_SIZE);
+  explicit_bzero (stbuf, SECRET_SIZE);
+  ASSERT (memcmp (zero, stbuf, SECRET_SIZE) == 0);
+}
+
+/* =============== Verify operation on heap-allocated memory =============== */
+
+/* Test whether an address range is mapped in memory.  */
+#if VMA_ITERATE_SUPPORTED
+
+struct locals
+{
+  uintptr_t range_start;
+  uintptr_t range_end;
+};
+
+static int
+vma_iterate_callback (void *data, uintptr_t start, uintptr_t end,
+                      unsigned int flags)
+{
+  struct locals *lp = (struct locals *) data;
+
+  /* Remove from [range_start, range_end) the part at the beginning or at the
+     end that is covered by [start, end).  */
+  if (start <= lp->range_start && end > lp->range_start)
+    lp->range_start = (end < lp->range_end ? end : lp->range_end);
+  if (start < lp->range_end && end >= lp->range_end)
+    lp->range_end = (start > lp->range_start ? start : lp->range_start);
+
+  return 0;
+}
+
+static bool
+is_range_mapped (uintptr_t range_start, uintptr_t range_end)
+{
+  struct locals l;
+
+  l.range_start = range_start;
+  l.range_end = range_end;
+  vma_iterate (vma_iterate_callback, &l);
+  return l.range_start == l.range_end;
+}
+
+#else
+
+static bool
+is_range_mapped (uintptr_t range_start, uintptr_t range_end)
+{
+  return true;
+}
+
+#endif
+
+static void
+test_heap (void)
+{
+  char *heapbuf = (char *) malloc (SECRET_SIZE);
+  uintptr_t addr = (uintptr_t) heapbuf;
+  memcpy (heapbuf, SECRET, SECRET_SIZE);
+  explicit_bzero (heapbuf, SECRET_SIZE);
+  free (heapbuf);
+  if (is_range_mapped (addr, addr + SECRET_SIZE))
+    {
+      /* some implementation could override freed memory by canaries so
+         compare against secret */
+      ASSERT (memcmp (heapbuf, SECRET, SECRET_SIZE) != 0);
+      printf ("test_heap: address range is still mapped after free().\n");
+    }
+  else
+    printf ("test_heap: address range is unmapped after free().\n");
+}
+
+/* =============== Verify operation on stack-allocated memory =============== */
+
+/* There are two passes:
+     1. Put a secret in memory and invoke explicit_bzero on it.
+     2. Verify that the memory has been erased.
+   Implement them in the same function, so that they access the same memory
+   range on the stack.  */
+static int _GL_ATTRIBUTE_NOINLINE
+do_secret_stuff (volatile int pass)
+{
+  char stackbuf[SECRET_SIZE];
+  if (pass == 1)
+    {
+      memcpy (stackbuf, SECRET, SECRET_SIZE);
+      explicit_bzero (stackbuf, SECRET_SIZE);
+      return 0;
+    }
+  else /* pass == 2 */
+    {
+      return memcmp (zero, stackbuf, SECRET_SIZE) != 0;
+    }
+}
+
+static void
+test_stack (void)
+{
+  int count = 0;
+  int repeat;
+
+  for (repeat = 1000; repeat > 0; repeat--)
+    {
+      do_secret_stuff (1);
+      count += do_secret_stuff (2);
+    }
+  /* If explicit_bzero works, count is near 0.  (It may be > 0 if there were
+     some asynchronous signal invocations between the two calls of
+     do_secret_stuff.)
+     If explicit_bzero is optimized away by the compiler, count comes out as
+     approximately 1000.  */
+  printf ("test_stack: count = %d\n", count);
+  ASSERT (count < 50);
+}
+
+/* ========================================================================== */
+
+int
+main ()
+{
+  test_static ();
+  test_heap ();
+  test_stack ();
+
+  return 0;
+}
diff --git a/tests/test-fchdir.c b/tests/test-fchdir.c
new file mode 100644 (file)
index 0000000..8ee4508
--- /dev/null
@@ -0,0 +1,110 @@
+/* Test changing to a directory named by a file descriptor.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009.  */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fchdir, int, (int));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "cloexec.h"
+#include "macros.h"
+
+int
+main (void)
+{
+  char *cwd;
+  int fd;
+  int i;
+
+  cwd = getcwd (NULL, 0);
+  ASSERT (cwd);
+
+  fd = open (".", O_RDONLY);
+  ASSERT (0 <= fd);
+
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    errno = 0;
+    ASSERT (fchdir (-1) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    close (99);
+    errno = 0;
+    ASSERT (fchdir (99) == -1);
+    ASSERT (errno == EBADF);
+  }
+
+  /* Check for other failure cases.  */
+  {
+    int bad_fd = open ("/dev/null", O_RDONLY);
+    ASSERT (0 <= bad_fd);
+    errno = 0;
+    ASSERT (fchdir (bad_fd) == -1);
+    ASSERT (errno == ENOTDIR);
+    ASSERT (close (bad_fd) == 0);
+  }
+
+  /* Repeat test twice, once in '.' and once in '..'.  */
+  for (i = 0; i < 2; i++)
+    {
+      ASSERT (chdir (&".."[1 - i]) == 0);
+      ASSERT (fchdir (fd) == 0);
+      {
+        size_t len = strlen (cwd) + 1;
+        char *new_dir = malloc (len);
+        ASSERT (new_dir);
+        ASSERT (getcwd (new_dir, len) == new_dir);
+        ASSERT (strcmp (cwd, new_dir) == 0);
+        free (new_dir);
+      }
+
+      /* For second iteration, use a cloned fd, to ensure that dup
+         remembers whether an fd was associated with a directory.  */
+      if (!i)
+        {
+          int new_fd = dup (fd);
+          ASSERT (0 <= new_fd);
+          ASSERT (close (fd) == 0);
+          ASSERT (dup2 (new_fd, fd) == fd);
+          ASSERT (close (new_fd) == 0);
+          ASSERT (dup_cloexec (fd) == new_fd);
+          ASSERT (dup2 (new_fd, fd) == fd);
+          ASSERT (close (new_fd) == 0);
+          ASSERT (fcntl (fd, F_DUPFD_CLOEXEC, new_fd) == new_fd);
+          ASSERT (close (fd) == 0);
+          ASSERT (fcntl (new_fd, F_DUPFD, fd) == fd);
+          ASSERT (close (new_fd) == 0);
+#if GNULIB_TEST_DUP3
+          ASSERT (dup3 (fd, new_fd, 0) == new_fd);
+          ASSERT (dup3 (new_fd, fd, 0) == fd);
+          ASSERT (close (new_fd) == 0);
+#endif
+        }
+    }
+
+  free (cwd);
+  return 0;
+}
index 508522d..53b6989 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fclose module.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
index 040f4bf..e8fe806 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <fcntl.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
 #include "signature.h"
 
 
+#if GNULIB_TEST_CREAT
+SIGNATURE_CHECK (GNULIB_NAMESPACE::creat, int, (const char *, mode_t));
+#endif
+
 #if GNULIB_TEST_FCNTL
 SIGNATURE_CHECK (GNULIB_NAMESPACE::fcntl, int, (int, int, ...));
 #endif
index aef1661..ab25cf7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <fcntl.h> substitute.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -22,8 +22,8 @@
 
 /* Check that the various O_* macros are defined.  */
 int o = (O_DIRECT | O_DIRECTORY | O_DSYNC | O_IGNORE_CTTY | O_NDELAY | O_NOATIME
-        | O_NONBLOCK | O_NOCTTY | O_NOFOLLOW | O_NOLINK | O_NOLINKS | O_NOTRANS
-        | O_RSYNC | O_SYNC | O_TTY_INIT | O_BINARY | O_TEXT);
+         | O_NONBLOCK | O_NOCTTY | O_NOFOLLOW | O_NOLINK | O_NOLINKS | O_NOTRANS
+         | O_RSYNC | O_SYNC | O_TTY_INIT | O_BINARY | O_TEXT);
 
 /* Check that the various SEEK_* macros are defined.  */
 int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
index 974ee33..cb834b4 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fcntl(2).
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
@@ -30,19 +30,23 @@ SIGNATURE_CHECK (fcntl, int, (int, int, ...));
 #include <stdbool.h>
 #include <unistd.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Get declarations of the native Windows API functions.  */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 /* Get _get_osfhandle.  */
-# include "msvc-nothrow.h"
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
 #endif
 
 #include "binary-io.h"
 #include "macros.h"
 
 #if !O_BINARY
-# define setmode(f,m) zero ()
+# define set_binary_mode(f,m) zero ()
 static int zero (void) { return 0; }
 #endif
 
@@ -50,7 +54,7 @@ static int zero (void) { return 0; }
 static bool
 is_open (int fd)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* On native Windows, the initial state of unassigned standard file
      descriptors is that they are open but point to an
      INVALID_HANDLE_VALUE, and there is no fcntl.  */
@@ -67,7 +71,7 @@ is_open (int fd)
 static bool
 is_inheritable (int fd)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* On native Windows, the initial state of unassigned standard file
      descriptors is that they are open but point to an
      INVALID_HANDLE_VALUE, and there is no fcntl.  */
@@ -90,8 +94,8 @@ is_inheritable (int fd)
 static bool
 is_mode (int fd, int mode)
 {
-  int value = setmode (fd, O_BINARY);
-  setmode (fd, value);
+  int value = set_binary_mode (fd, O_BINARY);
+  set_binary_mode (fd, value);
   return mode == value;
 }
 
@@ -202,13 +206,18 @@ check_flags (void)
 # endif
 #endif
 
+    default:
       ;
     }
 }
 
 int
-main (void)
+main (int argc, char *argv[])
 {
+  if (argc > 1)
+    /* child process */
+    return (is_open (10) ? 42 : 0);
+
   const char *file = "test-fcntl.tmp";
   int fd;
   int bad_fd = getdtablesize ();
@@ -262,11 +271,12 @@ main (void)
   ASSERT (errno == EINVAL);
   errno = 0;
   ASSERT (fcntl (fd, F_DUPFD_CLOEXEC, bad_fd) == -1);
-  ASSERT (errno == EINVAL);
+  ASSERT (errno == EINVAL
+          || errno == EMFILE /* WSL */);
 
   /* For F_DUPFD*, check for correct inheritance, as well as
      preservation of text vs. binary.  */
-  setmode (fd, O_BINARY);
+  set_binary_mode (fd, O_BINARY);
   ASSERT (is_open (fd));
   ASSERT (!is_open (fd + 1));
   ASSERT (!is_open (fd + 2));
@@ -292,7 +302,7 @@ main (void)
   ASSERT (is_mode (fd + 2, O_BINARY));
   ASSERT (close (fd) == 0);
 
-  setmode (fd + 2, O_TEXT);
+  set_binary_mode (fd + 2, O_TEXT);
   ASSERT (fcntl (fd + 2, F_DUPFD, fd + 1) == fd + 1);
   ASSERT (!is_open (fd));
   ASSERT (is_open (fd + 1));
@@ -405,5 +415,21 @@ main (void)
   ASSERT (close (fd) == 0);
   ASSERT (unlink (file) == 0);
 
-  return 0;
+  /* Close file descriptors that may have been inherited from the parent
+     process and that would cause failures below.
+     Such file descriptors have been seen:
+       - with GNU make, when invoked as 'make -j N' with j > 1,
+       - in some versions of the KDE desktop environment,
+       - on NetBSD,
+       - in MacPorts with the "trace mode" enabled.
+   */
+  (void) close (10);
+
+  /* Test whether F_DUPFD_CLOEXEC is effective.  */
+  ASSERT (fcntl (1, F_DUPFD_CLOEXEC, 10) >= 0);
+#if defined _WIN32 && !defined __CYGWIN__
+  return _execl ("./test-fcntl", "./test-fcntl", "child", NULL);
+#else
+  return execl ("./test-fcntl", "./test-fcntl", "child", NULL);
+#endif
 }
index 55b49a6..86793bc 100644 (file)
@@ -1,5 +1,5 @@
 /* Test opening a stream with a file descriptor.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/tests/test-fdopendir.c b/tests/test-fdopendir.c
new file mode 100644 (file)
index 0000000..7d53b8a
--- /dev/null
@@ -0,0 +1,80 @@
+/* Test opening a directory stream from a file descriptor.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009.  */
+
+#include <config.h>
+
+#include <dirent.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fdopendir, DIR *, (int));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (int argc _GL_UNUSED, char *argv[])
+{
+  DIR *d;
+  int fd;
+
+  /* A non-directory cannot be turned into a directory stream.  */
+  fd = open ("test-fdopendir.tmp", O_RDONLY | O_CREAT, 0600);
+  ASSERT (0 <= fd);
+  errno = 0;
+  ASSERT (fdopendir (fd) == NULL);
+  ASSERT (errno == ENOTDIR);
+  ASSERT (close (fd) == 0);
+  ASSERT (unlink ("test-fdopendir.tmp") == 0);
+
+  /* A bad fd cannot be turned into a stream.  */
+  {
+    errno = 0;
+    ASSERT (fdopendir (-1) == NULL);
+    ASSERT (errno == EBADF);
+  }
+  {
+    close (99);
+    errno = 0;
+    ASSERT (fdopendir (99) == NULL);
+    ASSERT (errno == EBADF);
+  }
+
+  /* This should work.  */
+  fd = open (".", O_RDONLY);
+  ASSERT (0 <= fd);
+  d = fdopendir (fd);
+  ASSERT (d);
+  /* fdopendir should not close fd.  */
+  ASSERT (dup2 (fd, fd) == fd);
+
+  /* Don't test dirfd here.  dirfd (d) must return fd on current POSIX
+     platforms, but on pre-2008 platforms or on non-POSIX platforms
+     dirfd (fd) might return some other descriptor, or -1, and gnulib
+     does not work around this porting problem.  */
+
+  ASSERT (closedir (d) == 0);
+  /* Now we can guarantee that fd must be closed.  */
+  errno = 0;
+  ASSERT (dup2 (fd, fd) == -1);
+  ASSERT (errno == EBADF);
+
+  return 0;
+}
index baf61bc..204b4e9 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible fflush() function.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake, 2007.  */
 
index f1248f8..6193d65 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible fflush() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -28,7 +28,7 @@ main (int argc, char **argv)
 
   /* Avoid the well-known bugs of fflush() on streams in O_TEXT mode
      on native Windows platforms.  */
-  SET_BINARY (0);
+  set_binary_mode (0, O_BINARY);
 
   if (argc > 1)
     switch (argv[1][0])
@@ -36,7 +36,7 @@ main (int argc, char **argv)
       case '1':
         /* Check fflush after a backup ungetc() call.  This is case 1a in
            terms of
-           <http://lists.gnu.org/archive/html/bug-gnulib/2008-03/msg00131.html>,
+           <https://lists.gnu.org/r/bug-gnulib/2008-03/msg00131.html>,
            according to the Austin Group's resolution on 2009-01-08.  */
 
         c = fgetc (stdin);
@@ -65,20 +65,14 @@ main (int argc, char **argv)
       case '2':
         /* Check fflush after a non-backup ungetc() call.  This is case 2a in
            terms of
-           <http://lists.gnu.org/archive/html/bug-gnulib/2008-03/msg00131.html>,
+           <https://lists.gnu.org/r/bug-gnulib/2008-03/msg00131.html>,
            according to the Austin Group's resolution on 2009-01-08.  */
         /* Check that fflush after a non-backup ungetc() call discards the
            ungetc buffer.  This is mandated by POSIX
-           <http://www.opengroup.org/susv3/functions/ungetc.html>:
-             "The value of the file-position indicator for the stream after
-              reading or discarding all pushed-back bytes shall be the same
-              as it was before the bytes were pushed back."
-           <http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt>
-             "[After fflush(),] the file offset of the underlying open file
-              description shall be set to the file position of the stream, and
-              any characters pushed back onto the stream by ungetc() or
-              ungetwc() that have not subsequently been read from the stream
-              shall be discarded."  */
+           <https://pubs.opengroup.org/onlinepubs/9699919799/functions/fflush.html>:
+             "...any characters pushed back onto the stream by ungetc()
+              or ungetwc() that have not subsequently been read from the
+              stream shall be discarded..."  */
 
         c = fgetc (stdin);
         ASSERT (c == '#');
index ef77fa4..0d8859d 100755 (executable)
@@ -2,8 +2,8 @@
 
 # Execute the test only with seekable input stream.
 # The behaviour of fflush() on a non-seekable input stream is undefined.
-./test-fflush2${EXEEXT} 1 < "$srcdir/test-fflush2.sh" || exit $?
-./test-fflush2${EXEEXT} 2 < "$srcdir/test-fflush2.sh" || exit $?
-#cat "$srcdir/test-fflush2.sh" | ./test-fflush2${EXEEXT} || exit $?
+${CHECKER} ./test-fflush2${EXEEXT} 1 < "$srcdir/test-fflush2.sh" || exit $?
+${CHECKER} ./test-fflush2${EXEEXT} 2 < "$srcdir/test-fflush2.sh" || exit $?
+#cat "$srcdir/test-fflush2.sh" | ${CHECKER} ./test-fflush2${EXEEXT} || exit $?
 
 exit 0
index c62e70c..6faae5c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fgetc() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -25,7 +25,9 @@ SIGNATURE_CHECK (fgetc, int, (FILE *));
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "msvc-inval.h"
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
 
 #include "macros.h"
 
index 06e551a..384342d 100644 (file)
@@ -1,6 +1,6 @@
 /* Test of concatenation of two arbitrary file names.
 
-   Copyright (C) 1996-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 1996-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Jim Meyering.  */
 
 
 #include "filenamecat.h"
 
+#include "idx.h"
+
 #include <stdbool.h>
+#include <stddef.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -38,11 +41,11 @@ main (int argc _GL_UNUSED, char *argv[])
       {"a", "/b",  "a/b"},
 
       {"/", "b",  "/b"},
-      {"/", "/b", "/b"},
-      {"/", "/",  "/"},
+      {"/", "/b", "/./b"}, /* This result could be shorter.  */
+      {"/", "/",  "/./"},  /* This result could be shorter.  */
       {"a", "/",  "a/"},   /* this might deserve a diagnostic */
       {"/a", "/", "/a/"},  /* this might deserve a diagnostic */
-      {"a", "//b",  "a/b"},
+      {"a", "//b",  "a//b"},
       {"", "a", "a"},  /* this might deserve a diagnostic */
     };
   unsigned int i;
@@ -53,11 +56,32 @@ main (int argc _GL_UNUSED, char *argv[])
       char *base_in_result;
       char const *const *t = tests[i];
       char *res = file_name_concat (t[0], t[1], &base_in_result);
+      idx_t prefixlen = base_in_result - res;
+      size_t t0len = strlen (t[0]);
+      size_t reslen = strlen (res);
       if (strcmp (res, t[2]) != 0)
         {
           fprintf (stderr, "test #%u: got %s, expected %s\n", i, res, t[2]);
           fail = true;
         }
+      if (strcmp (t[1], base_in_result) != 0)
+        {
+          fprintf (stderr, "test #%u: base %s != base_in_result %s\n",
+                   i, t[1], base_in_result);
+          fail = true;
+        }
+      if (! (0 <= prefixlen && prefixlen <= reslen))
+        {
+          fprintf (stderr, "test #%u: base_in_result is not in result\n", i);
+          fail = true;
+        }
+      if (reslen < t0len || memcmp (res, t[0], t0len) != 0)
+        {
+          fprintf (stderr, "test #%u: %s is not a prefix of %s\n",
+                   i, t[0], res);
+          fail = true;
+        }
+      free (res);
     }
   exit (fail ? EXIT_FAILURE : EXIT_SUCCESS);
 }
diff --git a/tests/test-float-c++.cc b/tests/test-float-c++.cc
new file mode 100644 (file)
index 0000000..30d690f
--- /dev/null
@@ -0,0 +1,28 @@
+/* Test of <float.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <float.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-float-c++2.cc b/tests/test-float-c++2.cc
new file mode 100644 (file)
index 0000000..7b01fd4
--- /dev/null
@@ -0,0 +1,20 @@
+/* Test of <float.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cfloat>
index a5f33b6..f79e819 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <float.h> substitute.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2011.  */
 
diff --git a/tests/test-fopen-gnu.c b/tests/test-fopen-gnu.c
new file mode 100644 (file)
index 0000000..26c5762
--- /dev/null
@@ -0,0 +1,88 @@
+/* Test of opening a file stream.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdio.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#define BASE "test-fopen-gnu.t"
+
+/* 0x1a is an EOF on Windows.  */
+#define DATA "abc\x1axyz"
+
+int
+main (void)
+{
+  FILE *f;
+  int fd;
+  int flags;
+  char buf[16];
+
+  /* Remove anything from prior partial run.  */
+  unlink (BASE "file");
+  unlink (BASE "binary");
+
+  /* Create the file.  */
+  f = fopen (BASE "file", "w");
+  ASSERT (f);
+  fd = fileno (f);
+  ASSERT (fd >= 0);
+  flags = fcntl (fd, F_GETFD);
+  ASSERT (flags >= 0);
+  ASSERT ((flags & FD_CLOEXEC) == 0);
+  ASSERT (fclose (f) == 0);
+
+  /* Create the file and check the 'e' mode.  */
+  f = fopen (BASE "file", "we");
+  ASSERT (f);
+  fd = fileno (f);
+  ASSERT (fd >= 0);
+  flags = fcntl (fd, F_GETFD);
+  ASSERT (flags >= 0);
+  ASSERT ((flags & FD_CLOEXEC) != 0);
+  ASSERT (fclose (f) == 0);
+
+  /* Open the file and check the 'x' mode.  */
+  f = fopen (BASE "file", "ax");
+  ASSERT (f == NULL);
+  ASSERT (errno == EEXIST);
+
+  /* Open a binary file and check that the 'e' mode doesn't interfere.  */
+  f = fopen (BASE "binary", "wbe");
+  ASSERT (f);
+  ASSERT (fwrite (DATA, 1, sizeof (DATA)-1, f) == sizeof (DATA)-1);
+  ASSERT (fclose (f) == 0);
+
+  f = fopen (BASE "binary", "rbe");
+  ASSERT (f);
+  ASSERT (fread (buf, 1, sizeof (buf), f) == sizeof (DATA)-1);
+  ASSERT (fclose (f) == 0);
+
+  /* Cleanup.  */
+  ASSERT (unlink (BASE "file") == 0);
+  ASSERT (unlink (BASE "binary") == 0);
+
+  return 0;
+}
index ec162ae..038abed 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of opening a file stream.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 22ef2ff..f69a13a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of opening a file stream.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 3d72466..b6a3dcb 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of opening a file stream.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -47,6 +47,10 @@ test_fopen (void)
   ASSERT (fopen (BASE "file/", "r") == NULL);
   ASSERT (errno == ENOTDIR || errno == EISDIR || errno == EINVAL);
 
+  errno = 0;
+  ASSERT (fopen (BASE "file/", "r+") == NULL);
+  ASSERT (errno == ENOTDIR || errno == EISDIR || errno == EINVAL);
+
   /* Cannot create a directory.  */
   errno = 0;
   ASSERT (fopen ("nonexist.ent/", "w") == NULL);
@@ -58,6 +62,18 @@ test_fopen (void)
   ASSERT (fopen (".", "w") == NULL);
   ASSERT (errno == EISDIR || errno == EINVAL || errno == EACCES);
 
+  errno = 0;
+  ASSERT (fopen ("./", "w") == NULL);
+  ASSERT (errno == EISDIR || errno == EINVAL || errno == EACCES);
+
+  errno = 0;
+  ASSERT (fopen (".", "r+") == NULL);
+  ASSERT (errno == EISDIR || errno == EINVAL || errno == EACCES);
+
+  errno = 0;
+  ASSERT (fopen ("./", "r+") == NULL);
+  ASSERT (errno == EISDIR || errno == EINVAL || errno == EACCES);
+
   /* /dev/null must exist, and be writable.  */
   f = fopen ("/dev/null", "r");
   ASSERT (f);
index 2d7749d..bf79f71 100644 (file)
@@ -1,6 +1,6 @@
 /* Ensure that __fpending works.
 
-   Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
    Written by Jim Meyering.  */
 
index 636af25..abe7d83 100755 (executable)
@@ -5,7 +5,7 @@ trap 'rm -fr $tmpfile' 1 2 3 15
 
 tmpfile=test-fpending.t
 
-./test-fpending${EXEEXT} > $tmpfile || exit 1
+${CHECKER} ./test-fpending${EXEEXT} > $tmpfile || exit 1
 
 rm -fr $tmpfile
 
index 32f3a98..1173b37 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fpurge() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 95a1cb6..47bb844 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fputc() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -25,7 +25,9 @@ SIGNATURE_CHECK (fputc, int, (int, FILE *));
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "msvc-inval.h"
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
 
 #include "macros.h"
 
index b9fc72a..f8214ca 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fread() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -25,7 +25,9 @@ SIGNATURE_CHECK (fread, size_t, (void *, size_t, size_t, FILE *));
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "msvc-inval.h"
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
 
 #include "macros.h"
 
index 71847b1..a16b767 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of freadahead() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -33,6 +33,7 @@ main (int argc, char **argv)
     {
       void *buf = malloc (nbytes);
       ASSERT (fread (buf, 1, nbytes, stdin) == nbytes);
+      free (buf);
     }
 
   if (nbytes == 0)
@@ -69,5 +70,8 @@ main (int argc, char **argv)
         }
     }
 
+  /* Free memory allocated during ungetc().  */
+  fclose (stdin);
+
   return 0;
 }
index 27cf550..f420000 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-./test-freadahead${EXEEXT} 0 < "$srcdir/test-freadahead.sh" || exit 1
-./test-freadahead${EXEEXT} 5 < "$srcdir/test-freadahead.sh" || exit 1
+${CHECKER} ./test-freadahead${EXEEXT} 0 < "$srcdir/test-freadahead.sh" || exit 1
+${CHECKER} ./test-freadahead${EXEEXT} 5 < "$srcdir/test-freadahead.sh" || exit 1
 exit 0
index 469cb78..9872d8f 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of freading() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
diff --git a/tests/test-free.c b/tests/test-free.c
new file mode 100644 (file)
index 0000000..53f1085
--- /dev/null
@@ -0,0 +1,175 @@
+/* Test of free() function.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdlib.h>
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+#if defined __linux__
+# include <fcntl.h>
+# include <stdint.h>
+# include <string.h>
+# include <sys/mman.h>
+#endif
+
+#include "macros.h"
+
+/* The indirection through a volatile function pointer is necessary to prevent
+   a GCC optimization.  Without it, when optimizing, GCC would "know" that errno
+   is unchanged by calling free(ptr), when ptr was the result of a malloc(...)
+   call in the same function.  */
+static int
+get_errno (void)
+{
+  volatile int err = errno;
+  return err;
+}
+
+static int (* volatile get_errno_func) (void) = get_errno;
+
+int
+main ()
+{
+  /* Check that free() preserves errno.  */
+  {
+    errno = 1789; /* Liberté, égalité, fraternité.  */
+    free (NULL);
+    ASSERT_NO_STDIO (get_errno_func () == 1789);
+  }
+  { /* Small memory allocations.  */
+    #define N 10000
+    void * volatile ptrs[N];
+    size_t i;
+    for (i = 0; i < N; i++)
+      ptrs[i] = malloc (15);
+    for (i = 0; i < N; i++)
+      {
+        errno = 1789;
+        free (ptrs[i]);
+        ASSERT_NO_STDIO (get_errno_func () == 1789);
+      }
+    #undef N
+  }
+  { /* Medium memory allocations.  */
+    #define N 1000
+    void * volatile ptrs[N];
+    size_t i;
+    for (i = 0; i < N; i++)
+      ptrs[i] = malloc (729);
+    for (i = 0; i < N; i++)
+      {
+        errno = 1789;
+        free (ptrs[i]);
+        ASSERT_NO_STDIO (get_errno_func () == 1789);
+      }
+    #undef N
+  }
+  { /* Large memory allocations.  */
+    #define N 10
+    void * volatile ptrs[N];
+    size_t i;
+    for (i = 0; i < N; i++)
+      ptrs[i] = malloc (5318153);
+    for (i = 0; i < N; i++)
+      {
+        errno = 1789;
+        free (ptrs[i]);
+        ASSERT_NO_STDIO (get_errno_func () == 1789);
+      }
+    #undef N
+  }
+
+  /* Test a less common code path.
+     When malloc() is based on mmap(), free() can sometimes call munmap().
+     munmap() usually succeeds, but fails in a particular situation: when
+       - it has to unmap the middle part of a VMA, and
+       - the number of VMAs of a process is limited and the limit is
+         already reached.
+     The latter condition is fulfilled on Linux, when the file
+     /proc/sys/vm/max_map_count exists.  This file contains the limit
+       - for Linux >= 2.4.19: 65536 (DEFAULT_MAX_MAP_COUNT in linux/include/linux/sched.h)
+       - for Linux >= 2.6.31: 65530 (DEFAULT_MAX_MAP_COUNT in linux/include/linux/mm.h).
+     But do not test it with glibc < 2.15, since that triggers a glibc internal
+     abort: "malloc.c:3551: munmap_chunk: Assertion `ret == 0' failed."
+   */
+  #if defined __linux__ && !(__GLIBC__ == 2 && __GLIBC_MINOR__ < 15)
+  if (open ("/proc/sys/vm/max_map_count", O_RDONLY) >= 0)
+    {
+      /* Preparations.  */
+      size_t pagesize = getpagesize ();
+      void *firstpage_backup = malloc (pagesize);
+      void *lastpage_backup = malloc (pagesize);
+      /* Allocate a large memory area, as a bumper, so that the MAP_FIXED
+         allocation later will not overwrite parts of the memory areas
+         allocated to ld.so or libc.so.  */
+      void *bumper_region =
+        mmap (NULL, 0x1000000, PROT_READ, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+      /* A file descriptor pointing to a regular file.  */
+      int fd = open ("test-free", O_RDONLY);
+
+      if (firstpage_backup != NULL && lastpage_backup != NULL
+          && bumper_region != (void *)(-1)
+          && fd >= 0)
+        {
+          /* Do a large memory allocation.  */
+          size_t big_size = 0x1000000;
+          void * volatile ptr = malloc (big_size - 0x100);
+          char *ptr_aligned = (char *) ((uintptr_t) ptr & ~(pagesize - 1));
+          /* This large memory allocation allocated a memory area
+             from ptr_aligned to ptr_aligned + big_size.
+             Enlarge this memory area by adding a page before and a page
+             after it.  */
+          memcpy (firstpage_backup, ptr_aligned, pagesize);
+          memcpy (lastpage_backup, ptr_aligned + big_size - pagesize, pagesize);
+          if (mmap (ptr_aligned - pagesize, pagesize + big_size + pagesize,
+                    PROT_READ | PROT_WRITE,
+                    MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, -1, 0)
+              != (void *)(-1))
+            {
+              memcpy (ptr_aligned, firstpage_backup, pagesize);
+              memcpy (ptr_aligned + big_size - pagesize, lastpage_backup, pagesize);
+
+              /* Now add as many mappings as we can.
+                 Stop at 65536, in order not to crash the machine (in case the
+                 limit has been increased by the system administrator).  */
+              size_t i;
+              for (i = 0; i < 65536; i++)
+                if (mmap (NULL, pagesize, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0)
+                    == (void *)(-1))
+                  break;
+              /* Now the number of VMAs of this process has hopefully attained
+                 its limit.  */
+
+              errno = 1789;
+              /* This call to free() is supposed to call
+                   munmap (ptr_aligned, big_size);
+                 which increases the number of VMAs by 1, which is supposed
+                 to fail.  */
+              free (ptr);
+              ASSERT_NO_STDIO (get_errno_func () == 1789);
+            }
+        }
+    }
+  #endif
+
+  return 0;
+}
diff --git a/tests/test-freopen.c b/tests/test-freopen.c
new file mode 100644 (file)
index 0000000..bbe551e
--- /dev/null
@@ -0,0 +1,86 @@
+/* Test of opening a file stream.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (freopen, FILE *, (char const *, char const *, FILE *));
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+  const char *filename = "test-freopen.txt";
+
+  close (STDIN_FILENO);
+  ASSERT (freopen ("/dev/null", "r", stdin) != NULL);
+  ASSERT (getchar () == EOF);
+  ASSERT (!ferror (stdin));
+  ASSERT (feof (stdin));
+
+#if 0 /* freopen (NULL, ...) is unsupported on most platforms.  */
+  /* Test that freopen() sets errno if someone else closes the stream
+     fd behind the back of stdio.  */
+  {
+    FILE *fp = fopen (filename, "w+");
+    ASSERT (fp != NULL);
+    ASSERT (close (fileno (fp)) == 0);
+    errno = 0;
+    ASSERT (freopen (NULL, "r", fp) == NULL);
+    perror("freopen");
+    ASSERT (errno == EBADF);
+    fclose (fp);
+  }
+
+  /* Test that freopen() sets errno if the stream was constructed with
+     an invalid file descriptor.  */
+  {
+    FILE *fp = fdopen (-1, "w+");
+    if (fp != NULL)
+      {
+        errno = 0;
+        ASSERT (freopen (NULL, "r", fp) == NULL);
+        ASSERT (errno == EBADF);
+        fclose (fp);
+      }
+  }
+  {
+    FILE *fp;
+    close (99);
+    fp = fdopen (99, "w+");
+    if (fp != NULL)
+      {
+        errno = 0;
+        ASSERT (freopen (NULL, "r", fp) == NULL);
+        ASSERT (errno == EBADF);
+        fclose (fp);
+      }
+  }
+#endif
+
+  /* Clean up.  */
+  unlink (filename);
+
+  return 0;
+}
index 376d7cd..cad6d0e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of splitting a double into fraction and mantissa.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 4749448..ad1b9e6 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of splitting a double into fraction and mantissa.
-   Copyright (C) 2012-2016 Free Software Foundation, Inc.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 static DOUBLE
 my_ldexp (DOUBLE x, int d)
index c0f2328..6e43f76 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of splitting a 'long double' into fraction and mantissa.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index b5118fa..d827fbb 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fseek() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index bad6c08..4ad3fda 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-./test-fseek${EXEEXT} 1 < "$srcdir/test-fseek.sh" || exit 1
-echo hi | ./test-fseek${EXEEXT} || exit 1
+${CHECKER} ./test-fseek${EXEEXT} 1 < "$srcdir/test-fseek.sh" || exit 1
+echo hi | ${CHECKER} ./test-fseek${EXEEXT} || exit 1
 exit 0
index a4c9cb7..beadc98 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-exec ./test-fseek${EXEEXT} 1 2 < "$srcdir/test-fseek2.sh"
+exec ${CHECKER} ./test-fseek${EXEEXT} 1 2 < "$srcdir/test-fseek2.sh"
index dee2072..ce6c212 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fseeko() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 5c55827..c7b675e 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-./test-fseeko${EXEEXT} 1 < "$srcdir/test-fseeko.sh" || exit 1
-echo hi | ./test-fseeko${EXEEXT} || exit 1
+${CHECKER} ./test-fseeko${EXEEXT} 1 < "$srcdir/test-fseeko.sh" || exit 1
+echo hi | ${CHECKER} ./test-fseeko${EXEEXT} || exit 1
 exit 0
index 6e1130c..7bf315e 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-exec ./test-fseeko${EXEEXT} 1 2 < "$srcdir/test-fseeko2.sh"
+exec ${CHECKER} ./test-fseeko${EXEEXT} 1 2 < "$srcdir/test-fseeko2.sh"
index c76d425..0d45d17 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fseeko() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <eblake@redhat.com>, 2011.  */
 
index c50b4a2..254d0cb 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
-./test-fseeko3${EXEEXT} 0 "$srcdir/test-fseeko3.sh" || exit 1
+${CHECKER} ./test-fseeko3${EXEEXT} 0 "$srcdir/test-fseeko3.sh" || exit 1
 
-./test-fseeko3${EXEEXT} 1 "$srcdir/test-fseeko3.sh" || exit 1
+${CHECKER} ./test-fseeko3${EXEEXT} 1 "$srcdir/test-fseeko3.sh" || exit 1
 
 exit 0
index d0b8b9f..219f1ea 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fseeko() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index e6464ae..7a4d352 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-./test-fseeko4${EXEEXT} "$srcdir/test-fseeko4.sh" || exit 1
+${CHECKER} ./test-fseeko4${EXEEXT} "$srcdir/test-fseeko4.sh" || exit 1
 
 exit 0
index c9ac749..0d78e17 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of fstat() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/tests/test-fstatat.c b/tests/test-fstatat.c
new file mode 100644 (file)
index 0000000..3c8ce74
--- /dev/null
@@ -0,0 +1,108 @@
+/* Tests of fstatat.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009.  */
+
+#include <config.h>
+
+#include <sys/stat.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (fstatat, int, (int, char const *, struct stat *, int));
+
+#include <fcntl.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "openat.h"
+#include "same-inode.h"
+#include "ignore-value.h"
+#include "macros.h"
+
+#ifndef BASE
+# define BASE "test-fstatat.t"
+#endif
+
+#include "test-lstat.h"
+#include "test-stat.h"
+
+static int dfd = AT_FDCWD;
+
+/* Wrapper around fstatat to test stat behavior.  */
+static int
+do_stat (char const *name, struct stat *st)
+{
+#ifdef TEST_STATAT
+  return statat (dfd, name, st);
+#else
+  return fstatat (dfd, name, st, 0);
+#endif
+}
+
+/* Wrapper around fstatat to test lstat behavior.  */
+static int
+do_lstat (char const *name, struct stat *st)
+{
+#ifdef TEST_STATAT
+  return lstatat (dfd, name, st);
+#else
+  return fstatat (dfd, name, st, AT_SYMLINK_NOFOLLOW);
+#endif
+}
+
+int
+main (int argc _GL_UNUSED, char *argv[])
+{
+  int result;
+
+  /* Remove any leftovers from a previous partial run.  */
+  ignore_value (system ("rm -rf " BASE "*"));
+
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    struct stat statbuf;
+
+    errno = 0;
+    ASSERT (fstatat (-1, "foo", &statbuf, 0) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    struct stat statbuf;
+
+    close (99);
+    errno = 0;
+    ASSERT (fstatat (99, "foo", &statbuf, 0) == -1);
+    ASSERT (errno == EBADF);
+  }
+
+  result = test_stat_func (do_stat, false);
+  ASSERT (test_lstat_func (do_lstat, false) == result);
+  dfd = open (".", O_RDONLY);
+  ASSERT (0 <= dfd);
+  ASSERT (test_stat_func (do_stat, false) == result);
+  ASSERT (test_lstat_func (do_lstat, false) == result);
+  ASSERT (close (dfd) == 0);
+
+  /* FIXME - add additional tests of dfd not at current directory.  */
+
+  if (result == 77)
+    fputs ("skipping test: symlinks not supported on this file system\n",
+           stderr);
+  return result;
+}
index 9b52344..a9de72b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ftell() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -45,7 +45,7 @@ main (int argc, char **argv)
     }
 
   /* mingw ftell is unreliable on text mode input.  */
-  SET_BINARY (0);
+  set_binary_mode (0, O_BINARY);
 
   /* Simple tests.  */
   ASSERT (ftell (stdin) == 0);
index bf55d2e..5c27808 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-./test-ftell${EXEEXT} 1 < "$srcdir/test-ftell.sh" || exit 1
-echo hi | ./test-ftell${EXEEXT} || exit 1
+${CHECKER} ./test-ftell${EXEEXT} 1 < "$srcdir/test-ftell.sh" || exit 1
+echo hi | ${CHECKER} ./test-ftell${EXEEXT} || exit 1
 exit 0
index 3b645b8..7d116d2 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-exec ./test-ftell${EXEEXT} 1 2 < "$srcdir/test-ftell2.sh"
+exec ${CHECKER} ./test-ftell${EXEEXT} 1 2 < "$srcdir/test-ftell2.sh"
index 695e5b2..98df004 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ftell() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 369d476..f74d5c6 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ftello() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -46,7 +46,7 @@ main (int argc, char **argv _GL_UNUSED)
     }
 
   /* mingw ftell is unreliable on text mode input.  */
-  SET_BINARY (0);
+  set_binary_mode (0, O_BINARY);
 
   /* Simple tests.  For each test, make sure ftell and ftello agree.  */
   ASSERT (ftell (stdin) == 0);
index 33d2e83..e8db061 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-./test-ftello${EXEEXT} 1 < "$srcdir/test-ftello.sh" || exit 1
-echo hi | ./test-ftello${EXEEXT} || exit 1
+${CHECKER} ./test-ftello${EXEEXT} 1 < "$srcdir/test-ftello.sh" || exit 1
+echo hi | ${CHECKER} ./test-ftello${EXEEXT} || exit 1
 exit 0
index ba750b0..63a222c 100755 (executable)
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-exec ./test-ftello${EXEEXT} 1 2 < "$srcdir/test-ftello2.sh"
+exec ${CHECKER} ./test-ftello${EXEEXT} 1 2 < "$srcdir/test-ftello2.sh"
index f75ce03..6b9b99d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ftello() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 1f94ef6..5f4c14b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of ftello() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index e3702bb..f7ff149 100755 (executable)
@@ -1,5 +1,5 @@
 #!/bin/sh
 
-./test-ftello4${EXEEXT} "$srcdir/test-ftello4.sh" || exit 1
+${CHECKER} ./test-ftello4${EXEEXT} "$srcdir/test-ftello4.sh" || exit 1
 
 exit 0
diff --git a/tests/test-ftruncate.c b/tests/test-ftruncate.c
new file mode 100644 (file)
index 0000000..d11b8eb
--- /dev/null
@@ -0,0 +1,60 @@
+/* Test truncating a file.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (ftruncate, int, (int, off_t));
+
+#include <errno.h>
+#include <fcntl.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+  const char *filename = argv[1];
+
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    errno = 0;
+    ASSERT (ftruncate (-1, 0) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    close (99);
+    errno = 0;
+    ASSERT (ftruncate (99, 0) == -1);
+    ASSERT (errno == EBADF);
+  }
+
+  /* Test behaviour for read-only file descriptors.  */
+  {
+    int fd = open (filename, O_RDONLY);
+    ASSERT (fd >= 0);
+    errno = 0;
+    ASSERT (ftruncate (fd, 0) == -1);
+    ASSERT (errno == EBADF || errno == EINVAL
+            || errno == EACCES /* seen on mingw */
+           );
+    close (fd);
+  }
+
+  return 0;
+}
diff --git a/tests/test-ftruncate.sh b/tests/test-ftruncate.sh
new file mode 100755 (executable)
index 0000000..203e07b
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+exec ${CHECKER} ./test-ftruncate${EXEEXT} "$srcdir/test-ftruncate.sh"
index bc285f3..17e80bd 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of fwrite() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -25,7 +25,9 @@ SIGNATURE_CHECK (fwrite, size_t, (const void *, size_t, size_t, FILE *));
 #include <fcntl.h>
 #include <unistd.h>
 
-#include "msvc-inval.h"
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+# include "msvc-inval.h"
+#endif
 
 #include "macros.h"
 
index 6bea7b7..17080d9 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of getcwd() function.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/tests/test-getcwd.c b/tests/test-getcwd.c
new file mode 100644 (file)
index 0000000..061c69e
--- /dev/null
@@ -0,0 +1,260 @@
+/* Test of getcwd() function.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+
+#include "pathmax.h"
+#include "macros.h"
+
+#if !(HAVE_GETPAGESIZE || defined getpagesize)
+# define getpagesize() 0
+#endif
+
+/* This size is chosen to be larger than PATH_MAX (4k), yet smaller than
+   the 16kB pagesize on ia64 linux.  Those conditions make the code below
+   trigger a bug in glibc's getcwd implementation before 2.4.90-10.  */
+#define TARGET_LEN (5 * 1024)
+
+#if defined HAVE_OPENAT || (defined GNULIB_OPENAT && defined HAVE_FDOPENDIR)
+# define HAVE_OPENAT_SUPPORT 1
+#else
+# define HAVE_OPENAT_SUPPORT 0
+#endif
+
+/* Keep this test in sync with m4/getcwd-abort-bug.m4.  */
+static int
+test_abort_bug (void)
+{
+  char *cwd;
+  size_t initial_cwd_len;
+  int fail = 0;
+
+  /* The bug is triggered when PATH_MAX < getpagesize (), so skip
+     this relatively expensive and invasive test if that's not true.  */
+#ifdef PATH_MAX
+  int bug_possible = PATH_MAX < getpagesize ();
+#else
+  int bug_possible = 0;
+#endif
+  if (! bug_possible)
+    return 0;
+
+  cwd = getcwd (NULL, 0);
+  if (cwd == NULL)
+    return 2;
+
+  initial_cwd_len = strlen (cwd);
+  free (cwd);
+
+  if (HAVE_OPENAT_SUPPORT)
+    {
+      static char const dir_name[] = "confdir-14B---";
+      size_t desired_depth = ((TARGET_LEN - 1 - initial_cwd_len)
+                              / sizeof dir_name);
+      size_t d;
+      for (d = 0; d < desired_depth; d++)
+        {
+          if (mkdir (dir_name, S_IRWXU) < 0 || chdir (dir_name) < 0)
+            {
+              if (! (errno == ERANGE || errno == ENAMETOOLONG
+                     || errno == ENOENT))
+                fail = 3; /* Unable to construct deep hierarchy.  */
+              break;
+            }
+        }
+
+      /* If libc has the bug in question, this invocation of getcwd
+         results in a failed assertion.  */
+      cwd = getcwd (NULL, 0);
+      if (cwd == NULL)
+        fail = 4; /* getcwd didn't assert, but it failed for a long name
+                     where the answer could have been learned.  */
+      free (cwd);
+
+      /* Call rmdir first, in case the above chdir failed.  */
+      rmdir (dir_name);
+      while (0 < d--)
+        {
+          if (chdir ("..") < 0)
+            {
+              fail = 5;
+              break;
+            }
+          rmdir (dir_name);
+        }
+    }
+
+  return fail;
+}
+
+/* The length of this name must be 8.  */
+#define DIR_NAME "confdir3"
+#define DIR_NAME_LEN 8
+#define DIR_NAME_SIZE (DIR_NAME_LEN + 1)
+
+/* The length of "../".  */
+#define DOTDOTSLASH_LEN 3
+
+/* Leftover bytes in the buffer, to work around library or OS bugs.  */
+#define BUF_SLOP 20
+
+/* Keep this test in sync with m4/getcwd-path-max.m4.  */
+static int
+test_long_name (void)
+{
+#ifndef PATH_MAX
+  /* The Hurd doesn't define this, so getcwd can't exhibit the bug --
+     at least not on a local file system.  And if we were to start worrying
+     about remote file systems, we'd have to enable the wrapper function
+     all of the time, just to be safe.  That's not worth the cost.  */
+  return 0;
+#elif ((INT_MAX / (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1) \
+        - DIR_NAME_SIZE - BUF_SLOP) \
+       <= PATH_MAX)
+  /* FIXME: Assuming there's a system for which this is true,
+     this should be done in a compile test.  */
+  return 0;
+#else
+  char buf[PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN + 1)
+           + DIR_NAME_SIZE + BUF_SLOP];
+  char *cwd = getcwd (buf, PATH_MAX);
+  size_t initial_cwd_len;
+  size_t cwd_len;
+  int fail = 0;
+  size_t n_chdirs = 0;
+
+  if (cwd == NULL)
+    return 1;
+
+  cwd_len = initial_cwd_len = strlen (cwd);
+
+  while (1)
+    {
+# ifdef HAVE_GETCWD_SHORTER
+      /* On OS/X <= 10.9 for example, we're restricted to shorter paths
+         as lstat() doesn't support more than PATH_MAX.  */
+      size_t dotdot_max = PATH_MAX * 2;
+# else
+      size_t dotdot_max = PATH_MAX * (DIR_NAME_SIZE / DOTDOTSLASH_LEN);
+# endif
+      char *c = NULL;
+
+      cwd_len += DIR_NAME_SIZE;
+      /* If mkdir or chdir fails, it could be that this system cannot create
+         any file with an absolute name longer than PATH_MAX, such as cygwin.
+         If so, leave fail as 0, because the current working directory can't
+         be too long for getcwd if it can't even be created.  On Linux with
+         the 9p file system, mkdir fails with error EINVAL when cwd_len gets
+         too long; ignore this failure because the getcwd() system call
+         produces good results whereas the gnulib substitute calls getdents64
+         which fails with error EPROTO.
+         For other errors, be pessimistic and consider that as a failure,
+         too.  */
+      if (mkdir (DIR_NAME, S_IRWXU) < 0 || chdir (DIR_NAME) < 0)
+        {
+          if (! (errno == ERANGE || errno == ENAMETOOLONG || errno == ENOENT))
+            #ifdef __linux__
+            if (! (errno == EINVAL))
+            #endif
+              fail = 2;
+          break;
+        }
+
+      if (PATH_MAX <= cwd_len && cwd_len < PATH_MAX + DIR_NAME_SIZE)
+        {
+          c = getcwd (buf, PATH_MAX);
+          if (!c && errno == ENOENT)
+            {
+              fail = 3;
+              break;
+            }
+          if (c)
+            {
+              fail = 4;
+              break;
+            }
+          if (! (errno == ERANGE || errno == ENAMETOOLONG))
+            {
+              fail = 5;
+              break;
+            }
+        }
+
+      if (dotdot_max <= cwd_len - initial_cwd_len)
+        {
+          if (dotdot_max + DIR_NAME_SIZE < cwd_len - initial_cwd_len)
+            break;
+          c = getcwd (buf, cwd_len + 1);
+          if (!c)
+            {
+              if (! (errno == ERANGE || errno == ENOENT
+                     || errno == ENAMETOOLONG))
+                {
+                  fail = 6;
+                  break;
+                }
+              if (HAVE_OPENAT_SUPPORT || errno == ERANGE || errno == ENOENT)
+                {
+                  fail = 7;
+                  break;
+                }
+            }
+        }
+
+      if (c && strlen (c) != cwd_len)
+        {
+          fail = 8;
+          break;
+        }
+      ++n_chdirs;
+    }
+
+  /* Leaving behind such a deep directory is not polite.
+     So clean up here, right away, even though the driving
+     shell script would also clean up.  */
+  {
+    size_t i;
+
+    /* Try rmdir first, in case the chdir failed.  */
+    rmdir (DIR_NAME);
+    for (i = 0; i <= n_chdirs; i++)
+      {
+        if (chdir ("..") < 0)
+          break;
+        if (rmdir (DIR_NAME) != 0)
+          break;
+      }
+  }
+
+  return fail;
+#endif
+}
+
+int
+main (int argc, char **argv)
+{
+  return test_abort_bug () * 10 + test_long_name ();
+}
diff --git a/tests/test-getcwd.sh b/tests/test-getcwd.sh
new file mode 100755 (executable)
index 0000000..64a3c7c
--- /dev/null
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
+
+${CHECKER} test-getcwd
+
+Exit $?
index 54efa04..d56c682 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of getdtablesize() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
index 2d9a4bd..fe1ab3c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of command line argument processing.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
 
@@ -23,7 +23,7 @@
 #define _GL_NO_LARGE_FILES
 
 /* POSIX and glibc provide the getopt() function in <unistd.h>, see
-   http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html
+   https://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html
    https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html
    But gnulib provides the getopt() function in <getopt.h>, not in <unistd.h>.
    This is what we are testing here.  */
index aef74f5..c86dc8d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of command line argument processing.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
 
diff --git a/tests/test-getopt-posix.c b/tests/test-getopt-posix.c
deleted file mode 100644 (file)
index 5532271..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Test of command line argument processing.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
-
-#include <config.h>
-
-/* None of the files accessed by this test are large, so disable the
-   ftell link warning if we are not using the gnulib ftell module.  */
-#define _GL_NO_LARGE_FILES
-
-/* POSIX and glibc provide the getopt() function in <unistd.h>, see
-   http://pubs.opengroup.org/onlinepubs/9699919799/functions/getopt.html
-   https://www.gnu.org/software/libc/manual/html_node/Using-Getopt.html
-   But gnulib provides the getopt() function in <getopt.h>, not in <unistd.h>.
-   Nevertheless the getopt() function should also be found in <unistd.h>.  */
-#include <unistd.h>
-
-#define TEST_GETOPT_GNU 0
-#define TEST_GETOPT_TMP_NAME "test-getopt-posix.tmp"
-#include "test-getopt-main.h"
index 8e61eb2..5cc9d8c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of command line argument processing.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
 
@@ -66,7 +66,7 @@ getopt_loop (int argc, const char **argv,
           ASSERT (options[0] == ':'
                   || ((options[0] == '-' || options[0] == '+')
                       && options[1] == ':'));
-          /* fall through */
+          FALLTHROUGH;
         case '?':
           *unrecognized = optopt;
           break;
@@ -1367,7 +1367,7 @@ test_getopt (void)
     }
 
   /* Check that 'W' does not dump core:
-     http://sourceware.org/bugzilla/show_bug.cgi?id=12922
+     https://sourceware.org/bugzilla/show_bug.cgi?id=12922
      Technically, POSIX says the presence of ';' in the opt-string
      gives unspecified behavior, so we only test this when GNU compliance
      is desired.  */
index 0f83f47..5e3c50a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of command line argument processing.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
 
@@ -87,7 +87,7 @@ getopt_long_loop (int argc, const char **argv,
           ASSERT (options[0] == ':'
                   || ((options[0] == '-' || options[0] == '+')
                       && options[1] == ':'));
-          /* fall through */
+          FALLTHROUGH;
         case '?':
           *unrecognized = optopt;
           break;
@@ -315,7 +315,7 @@ test_getopt_long (void)
   }
 
   /* Test that 'W' does not dump core:
-     http://sourceware.org/bugzilla/show_bug.cgi?id=12922  */
+     https://sourceware.org/bugzilla/show_bug.cgi?id=12922  */
   {
     int argc = 0;
     const char *argv[10];
@@ -1815,7 +1815,7 @@ test_getopt_long (void)
 /* Test behavior of getopt_long when POSIXLY_CORRECT is set in the
    environment.  Options with optional arguments should not change
    behavior just because of an environment variable.
-   http://lists.gnu.org/archive/html/bug-m4/2006-09/msg00028.html  */
+   https://lists.gnu.org/r/bug-m4/2006-09/msg00028.html  */
 static void
 test_getopt_long_posix (void)
 {
index 7c2b872..21eb338 100644 (file)
@@ -1,5 +1,5 @@
 /* Test the gnulib getprogname module.
-   Copyright (C) 2016 Free Software Foundation, Inc.
+   Copyright (C) 2016-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/tests/test-getrandom.c b/tests/test-getrandom.c
new file mode 100644 (file)
index 0000000..73abe6b
--- /dev/null
@@ -0,0 +1,92 @@
+/* Test of getting random bytes.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible.  */
+
+#include <config.h>
+
+#include <sys/random.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (getrandom, ssize_t, (void *, size_t, unsigned int));
+
+#include <errno.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+  char buf1[8];
+  char buf2[8];
+  char large_buf[100000];
+  ssize_t ret;
+
+  /* Check that different calls produce different results (with a high
+     probability).  */
+  ret = getrandom (buf1, sizeof (buf1), 0);
+  if (ret < 0)
+    ASSERT (errno == ENOSYS);
+  else
+    {
+      ret = getrandom (buf2, sizeof (buf2), 0);
+      if (ret < 0)
+        ASSERT (errno == ENOSYS);
+      else
+        {
+          /* It is very unlikely that two calls to getrandom produce the
+             same results.  */
+          ASSERT (memcmp (buf1, buf2, sizeof (buf1)) != 0);
+        }
+    }
+
+  /* Likewise with the "truly random" number generator.  */
+  ret = getrandom (buf1, sizeof (buf1), GRND_RANDOM);
+  if (ret < 0)
+    ASSERT (errno == ENOSYS);
+  else
+    {
+      ret = getrandom (buf2, sizeof (buf2), GRND_RANDOM);
+      if (ret < 0)
+        ASSERT (errno == ENOSYS);
+      else
+        {
+          /* It is very unlikely that two calls to getrandom produce the
+             same results.  */
+          ASSERT (memcmp (buf1, buf2, sizeof (buf1)) != 0);
+        }
+    }
+
+  /* Check that GRND_NONBLOCK works.  */
+  ret = getrandom (large_buf, sizeof (large_buf), GRND_RANDOM | GRND_NONBLOCK);
+  ASSERT (ret <= (ssize_t) sizeof (large_buf));
+  /* It is very unlikely that so many truly random bytes were ready.  */
+  if (ret < 0)
+    ASSERT (errno == ENOSYS || errno == EAGAIN
+            || errno == EINVAL /* Solaris */);
+  else
+    ASSERT (ret > 0);
+
+  if (getrandom (buf1, 1, 0) < 1)
+    if (getrandom (buf1, 1, GRND_RANDOM) < 1)
+      {
+        fputs ("Skipping test: getrandom is ineffective\n", stderr);
+        return 77;
+      }
+
+  return 0;
+}
index 7a44d71..f9139d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc.
  * Written by Jim Meyering.
  *
  * This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/tests/test-hard-locale.c b/tests/test-hard-locale.c
new file mode 100644 (file)
index 0000000..ff29b36
--- /dev/null
@@ -0,0 +1,109 @@
+/* Test of determination whether a locale is different from the "C" locale.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+#include "hard-locale.h"
+
+#include <locale.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+
+/* True if all locale names are accepted and all locales are trivial.
+   This is the case e.g. on OpenBSD 3.8.  */
+static bool all_trivial;
+
+static int
+test_one (const char *name, int failure_bitmask)
+{
+  if (setlocale (LC_ALL, name) != NULL)
+    {
+      bool expected;
+
+      /* musl libc has special code for the C.UTF-8 locale; other than that,
+         all locale names are accepted and all locales are trivial.
+         OpenBSD returns the locale name that was set, but we don't know how it
+         behaves under the hood.  Likewise for Haiku.  */
+#if defined MUSL_LIBC || defined __OpenBSD__ || defined __HAIKU__
+      expected = true;
+#else
+      expected = !all_trivial;
+#endif
+      if (hard_locale (LC_CTYPE) != expected)
+        {
+          if (expected)
+            fprintf (stderr, "Unexpected: The category LC_CTYPE of the locale '%s' is not equivalent to C or POSIX.\n",
+                     name);
+          else
+            fprintf (stderr, "Unexpected: The category LC_CTYPE of the locale '%s' is equivalent to C or POSIX.\n",
+                     name);
+          return failure_bitmask;
+        }
+
+      /* On NetBSD 7.0, some locales such as de_DE.ISO8859-1 and de_DE.UTF-8
+         have the LC_COLLATE category set to "C".
+         Similarly, on musl libc, with the C.UTF-8 locale.  */
+#if defined __NetBSD__
+      expected = false;
+#elif defined MUSL_LIBC
+      expected = strcmp (name, "C.UTF-8") != 0;
+#elif (defined __OpenBSD__ && HAVE_DUPLOCALE) || defined __HAIKU__ /* OpenBSD >= 6.2, Haiku */
+      expected = true;
+#else
+      expected = !all_trivial;
+#endif
+      if (hard_locale (LC_COLLATE) != expected)
+        {
+          if (expected)
+            fprintf (stderr, "Unexpected: The category LC_COLLATE of the locale '%s' is not equivalent to C or POSIX.\n",
+                     name);
+          else
+            fprintf (stderr, "Unexpected: The category LC_COLLATE of the locale '%s' is equivalent to C or POSIX.\n",
+                     name);
+          return failure_bitmask;
+        }
+    }
+  return 0;
+}
+
+int
+main ()
+{
+  int fail = 0;
+
+  /* The initial locale is the "C" or "POSIX" locale.  */
+  if (hard_locale (LC_CTYPE) || hard_locale (LC_COLLATE))
+    {
+      fprintf (stderr, "The initial locale should not be hard!\n");
+      fail |= 1;
+    }
+
+  all_trivial = (setlocale (LC_ALL, "foobar") != NULL);
+
+  fail |= test_one ("de", 2);
+  fail |= test_one ("de_DE", 4);
+  fail |= test_one ("de_DE.ISO8859-1", 8);
+  fail |= test_one ("de_DE.iso88591", 8);
+  fail |= test_one ("de_DE.UTF-8", 16);
+  fail |= test_one ("de_DE.utf8", 16);
+  fail |= test_one ("german", 32);
+  fail |= test_one ("C.UTF-8", 64);
+
+  return fail;
+}
diff --git a/tests/test-hash.c b/tests/test-hash.c
new file mode 100644 (file)
index 0000000..4e8c59f
--- /dev/null
@@ -0,0 +1,263 @@
+/*
+ * Copyright (C) 2009-2021 Free Software Foundation, Inc.
+ * Written by Jim Meyering
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "hash.h"
+#include "hash-pjw.h"
+#include "inttostr.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#define STREQ(a, b) (strcmp (a, b) == 0)
+#define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
+
+static bool
+hash_compare_strings (void const *x, void const *y)
+{
+  ASSERT (x != y);
+  return STREQ (x, y) ? true : false;
+}
+
+static void
+hash_freer (void *x)
+{
+  free (x);
+}
+
+static void
+insert_new (Hash_table *ht, const void *ent)
+{
+  void *e = hash_insert (ht, ent);
+  ASSERT (e == ent);
+}
+
+static bool
+walk (void *ent, void *data)
+{
+  char *str = ent;
+  unsigned int *map = data;
+  switch (*str)
+    {
+    case 'a': *map |= 1; return true;
+    case 'b': *map |= 2; return true;
+    case 'c': *map |= 4; return true;
+    }
+  *map |= 8;
+  return false;
+}
+
+static int
+get_seed (char const *str, unsigned int *seed)
+{
+  size_t len = strlen (str);
+  if (len == 0 || strspn (str, "0123456789") != len || 10 < len)
+    return 1;
+
+  *seed = atoi (str);
+  return 0;
+}
+
+int
+main (int argc, char **argv)
+{
+  unsigned int i;
+  unsigned int k;
+  unsigned int table_size[] = {1, 2, 3, 4, 5, 23, 53};
+  Hash_table *ht;
+  Hash_tuning tuning;
+
+  hash_reset_tuning (&tuning);
+  tuning.shrink_threshold = 0.3;
+  tuning.shrink_factor = 0.707;
+  tuning.growth_threshold = 1.5;
+  tuning.growth_factor = 2.0;
+  tuning.is_n_buckets = true;
+
+  if (1 < argc)
+    {
+      unsigned int seed;
+      if (get_seed (argv[1], &seed) != 0)
+        {
+          fprintf (stderr, "invalid seed: %s\n", argv[1]);
+          exit (EXIT_FAILURE);
+        }
+
+      srand (seed);
+    }
+
+  for (i = 0; i < ARRAY_CARDINALITY (table_size); i++)
+    {
+      size_t sz = table_size[i];
+      ht = hash_initialize (sz, NULL, hash_pjw, hash_compare_strings, NULL);
+      ASSERT (ht);
+      insert_new (ht, "a");
+      {
+        char *str1 = strdup ("a");
+        char *str2;
+        ASSERT (str1);
+        str2 = hash_insert (ht, str1);
+        ASSERT (str1 != str2);
+        ASSERT (STREQ (str1, str2));
+        free (str1);
+      }
+      insert_new (ht, "b");
+      insert_new (ht, "c");
+      i = 0;
+      ASSERT (hash_do_for_each (ht, walk, &i) == 3);
+      ASSERT (i == 7);
+      {
+        void *buf[5] = { NULL };
+        ASSERT (hash_get_entries (ht, NULL, 0) == 0);
+        ASSERT (hash_get_entries (ht, buf, 5) == 3);
+        ASSERT (STREQ (buf[0], "a") || STREQ (buf[0], "b") || STREQ (buf[0], "c"));
+      }
+      ASSERT (hash_remove (ht, "a"));
+      ASSERT (hash_remove (ht, "a") == NULL);
+      ASSERT (hash_remove (ht, "b"));
+      ASSERT (hash_remove (ht, "c"));
+
+      ASSERT (hash_rehash (ht, 47));
+      ASSERT (hash_rehash (ht, 467));
+
+      /* Free an empty table. */
+      hash_clear (ht);
+      hash_free (ht);
+
+      ht = hash_initialize (sz, NULL, hash_pjw, hash_compare_strings, NULL);
+      ASSERT (ht);
+
+      insert_new (ht, "z");
+      insert_new (ht, "y");
+      insert_new (ht, "x");
+      insert_new (ht, "w");
+      insert_new (ht, "v");
+      insert_new (ht, "u");
+
+      hash_clear (ht);
+      ASSERT (hash_get_n_entries (ht) == 0);
+      hash_free (ht);
+
+      /* Test pointer hashing.  */
+      ht = hash_initialize (sz, NULL, NULL, NULL, NULL);
+      ASSERT (ht);
+      {
+        char *str = strdup ("a");
+        ASSERT (str);
+        insert_new (ht, "a");
+        insert_new (ht, str);
+        ASSERT (hash_lookup (ht, str) == str);
+        free (str);
+      }
+      hash_free (ht);
+    }
+
+  hash_reset_tuning (&tuning);
+  tuning.shrink_threshold = 0.3;
+  tuning.shrink_factor = 0.707;
+  tuning.growth_threshold = 1.5;
+  tuning.growth_factor = 2.0;
+  tuning.is_n_buckets = true;
+  /* Invalid tuning.  */
+  ht = hash_initialize (4651, &tuning, hash_pjw, hash_compare_strings,
+                        hash_freer);
+  ASSERT (!ht);
+
+  /* Alternate tuning.  */
+  tuning.growth_threshold = 0.89;
+
+  /* Run with default tuning, then with custom tuning settings.  */
+  for (k = 0; k < 2; k++)
+    {
+      Hash_tuning const *tune = (k == 0 ? NULL : &tuning);
+      /* Now, each entry is malloc'd.  */
+      ht = hash_initialize (4651, tune, hash_pjw,
+                            hash_compare_strings, hash_freer);
+      ASSERT (ht);
+      for (i = 0; i < 10000; i++)
+        {
+          unsigned int op = rand () % 10;
+          switch (op)
+            {
+            case 0:
+            case 1:
+            case 2:
+            case 3:
+            case 4:
+            case 5:
+              {
+                char buf[50];
+                char const *p = uinttostr (i, buf);
+                char *p_dup = strdup (p);
+                ASSERT (p_dup);
+                insert_new (ht, p_dup);
+              }
+              break;
+
+            case 6:
+              {
+                size_t n = hash_get_n_entries (ht);
+                ASSERT (hash_rehash (ht, n + rand () % 20));
+              }
+              break;
+
+            case 7:
+              {
+                size_t n = hash_get_n_entries (ht);
+                size_t delta = rand () % 20;
+                if (delta < n)
+                  ASSERT (hash_rehash (ht, n - delta));
+              }
+              break;
+
+            case 8:
+            case 9:
+              {
+                /* Delete a random entry.  */
+                size_t n = hash_get_n_entries (ht);
+                if (n)
+                  {
+                    size_t kk = rand () % n;
+                    void const *p;
+                    void *v;
+                    for (p = hash_get_first (ht); kk;
+                         --kk, p = hash_get_next (ht, p))
+                      {
+                        /* empty */
+                      }
+                    ASSERT (p);
+                    v = hash_remove (ht, p);
+                    ASSERT (v);
+                    free (v);
+                  }
+                break;
+              }
+            }
+          ASSERT (hash_table_ok (ht));
+        }
+
+      hash_free (ht);
+    }
+
+  return 0;
+}
diff --git a/tests/test-iconv-h-c++.cc b/tests/test-iconv-h-c++.cc
new file mode 100644 (file)
index 0000000..27d95d9
--- /dev/null
@@ -0,0 +1,48 @@
+/* Test of <iconv.h> substitute in C++ mode.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#if HAVE_ICONV
+# include <iconv.h>
+
+# include "signature.h"
+
+
+#if GNULIB_TEST_ICONV
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iconv_open, iconv_t,
+                 (const char *, const char *));
+#endif
+
+#if GNULIB_TEST_ICONV
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iconv, size_t,
+                 (iconv_t, ICONV_CONST char **, size_t *, char **, size_t *));
+#endif
+
+#if GNULIB_TEST_ICONV
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iconv_close, int, (iconv_t));
+#endif
+
+#endif
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-iconv-h.c b/tests/test-iconv-h.c
new file mode 100644 (file)
index 0000000..bba7fe3
--- /dev/null
@@ -0,0 +1,27 @@
+/* Test of <iconv.h> substitute.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#if HAVE_ICONV
+# include <iconv.h>
+#endif
+
+int
+main ()
+{
+  return 0;
+}
diff --git a/tests/test-iconv.c b/tests/test-iconv.c
new file mode 100644 (file)
index 0000000..f35113f
--- /dev/null
@@ -0,0 +1,159 @@
+/* Test of character set conversion.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#if HAVE_ICONV
+# include <iconv.h>
+
+# ifndef ICONV_CONST
+#  define ICONV_CONST /* empty */
+# endif
+
+#include "signature.h"
+SIGNATURE_CHECK (iconv, size_t, (iconv_t, ICONV_CONST char **, size_t *,
+                                 char **, size_t *));
+SIGNATURE_CHECK (iconv_close, int, (iconv_t x));
+SIGNATURE_CHECK (iconv_open, iconv_t, (char const *, char const *));
+
+#endif
+
+#include <errno.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+#if HAVE_ICONV
+  /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
+     and UTF-8.  */
+  iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+  iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8");
+
+#if defined __MVS__ && defined __IBMC__
+  /* String literals below are in ASCII, not EBCDIC.  */
+# pragma convert("ISO8859-1")
+# define CONVERT_ENABLED
+#endif
+
+  ASSERT (cd_88591_to_utf8 != (iconv_t)(-1));
+  ASSERT (cd_utf8_to_88591 != (iconv_t)(-1));
+
+  /* Test conversion from ISO-8859-1 to UTF-8 with no errors.  */
+  {
+    static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+    static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+    char buf[50];
+    const char *inptr = input;
+    size_t inbytesleft = strlen (input);
+    char *outptr = buf;
+    size_t outbytesleft = sizeof (buf);
+    size_t res = iconv (cd_88591_to_utf8,
+                        (ICONV_CONST char **) &inptr, &inbytesleft,
+                        &outptr, &outbytesleft);
+    ASSERT (res == 0 && inbytesleft == 0);
+    ASSERT (outptr == buf + strlen (expected));
+    ASSERT (memcmp (buf, expected, strlen (expected)) == 0);
+  }
+
+  /* Test conversion from ISO-8859-1 to UTF-8 with E2BIG.  */
+  {
+    static const char input[] = "\304";
+    static char buf[2] = { (char)0xDE, (char)0xAD };
+    const char *inptr = input;
+    size_t inbytesleft = 1;
+    char *outptr = buf;
+    size_t outbytesleft = 1;
+    size_t res = iconv (cd_88591_to_utf8,
+                        (ICONV_CONST char **) &inptr, &inbytesleft,
+                        &outptr, &outbytesleft);
+    ASSERT (res == (size_t)(-1) && errno == E2BIG);
+    ASSERT (inbytesleft == 1);
+    ASSERT (outbytesleft == 1);
+    ASSERT ((unsigned char) buf[1] == 0xAD);
+    ASSERT ((unsigned char) buf[0] == 0xDE);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with no errors.  */
+  {
+    static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+    static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+    char buf[50];
+    const char *inptr = input;
+    size_t inbytesleft = strlen (input);
+    char *outptr = buf;
+    size_t outbytesleft = sizeof (buf);
+    size_t res = iconv (cd_utf8_to_88591,
+                        (ICONV_CONST char **) &inptr, &inbytesleft,
+                        &outptr, &outbytesleft);
+    ASSERT (res == 0 && inbytesleft == 0);
+    ASSERT (outptr == buf + strlen (expected));
+    ASSERT (memcmp (buf, expected, strlen (expected)) == 0);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ.  */
+  {
+    static const char input[] = "\342\202\254"; /* EURO SIGN */
+    char buf[10];
+    const char *inptr = input;
+    size_t inbytesleft = strlen (input);
+    char *outptr = buf;
+    size_t outbytesleft = sizeof (buf);
+    size_t res = iconv (cd_utf8_to_88591,
+                        (ICONV_CONST char **) &inptr, &inbytesleft,
+                        &outptr, &outbytesleft);
+    if (res == (size_t)(-1))
+      {
+        ASSERT (errno == EILSEQ);
+        ASSERT (inbytesleft == strlen (input) && outptr == buf);
+      }
+    else
+      {
+        ASSERT (res == 1);
+        ASSERT (inbytesleft == 0);
+      }
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL.  */
+  {
+    static const char input[] = "\342";
+    char buf[10];
+    const char *inptr = input;
+    size_t inbytesleft = 1;
+    char *outptr = buf;
+    size_t outbytesleft = sizeof (buf);
+    size_t res = iconv (cd_utf8_to_88591,
+                        (ICONV_CONST char **) &inptr, &inbytesleft,
+                        &outptr, &outbytesleft);
+    ASSERT (res == (size_t)(-1) && errno == EINVAL);
+    ASSERT (inbytesleft == 1 && outptr == buf);
+  }
+
+  iconv_close (cd_88591_to_utf8);
+  iconv_close (cd_utf8_to_88591);
+
+#ifdef CONVERT_ENABLED
+# pragma convert(pop)
+#endif
+
+#endif /* HAVE_ICONV */
+
+  return 0;
+}
index 7c4b2de..3b8d0a6 100644 (file)
@@ -1,6 +1,6 @@
 /* Test the "ignore-value" module.
 
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake.  */
 
 
 #include <stdio.h>
 
-#ifndef _GL_ATTRIBUTE_RETURN_CHECK
-# if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4)
-#  define _GL_ATTRIBUTE_RETURN_CHECK
-# else
-#  define _GL_ATTRIBUTE_RETURN_CHECK __attribute__((__warn_unused_result__))
-# endif
-#endif
+#include "attribute.h"
 
 struct s { int i; };
-static char doChar (void) _GL_ATTRIBUTE_RETURN_CHECK;
-static int doInt (void) _GL_ATTRIBUTE_RETURN_CHECK;
-static off_t doOff (void) _GL_ATTRIBUTE_RETURN_CHECK;
-static void *doPtr (void) _GL_ATTRIBUTE_RETURN_CHECK;
-static struct s doStruct (void) _GL_ATTRIBUTE_RETURN_CHECK;
+static char doChar (void) NODISCARD;
+static int doInt (void) NODISCARD;
+static off_t doOff (void) NODISCARD;
+static void *doPtr (void) NODISCARD;
+static struct s doStruct (void) NODISCARD;
 
 static char
 doChar (void)
diff --git a/tests/test-inet_pton.c b/tests/test-inet_pton.c
new file mode 100644 (file)
index 0000000..9d2e50f
--- /dev/null
@@ -0,0 +1,58 @@
+/* Test of inet_pton function.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
+
+#include <config.h>
+
+#include <arpa/inet.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (inet_pton, int, (int, const char *, void *));
+
+#include <netinet/in.h>
+#include <sys/socket.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+#if defined AF_INET /* HAVE_IPV4 */
+  {
+    /* This machine was for a long time known as
+       ma2s2.mathematik.uni-karlsruhe.de.  */
+    const char printable[] = "129.13.115.2";
+    struct in_addr internal;
+    int ret;
+
+    ret = inet_pton (AF_INET, printable, &internal);
+    ASSERT (ret == 1);
+    /* Verify that internal is filled in network byte order.  */
+    ASSERT (((unsigned char *) &internal)[0] == 0x81);
+    ASSERT (((unsigned char *) &internal)[1] == 0x0D);
+    ASSERT (((unsigned char *) &internal)[2] == 0x73);
+    ASSERT (((unsigned char *) &internal)[3] == 0x02);
+# ifdef WORDS_BIGENDIAN
+    ASSERT (internal.s_addr == 0x810D7302);
+# else
+    ASSERT (internal.s_addr == 0x02730D81);
+# endif
+  }
+#endif
+
+  return 0;
+}
index a627859..7b8c451 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for init.sh
-# Copyright (C) 2011-2016 Free Software Foundation, Inc.
+# Copyright (C) 2011-2021 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 : ${srcdir=.}
 . "$srcdir/init.sh"; path_prepend_ .
index 0a8ddcd..fff4218 100644 (file)
@@ -1,5 +1,5 @@
 /* Test intprops.h.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
 
 #include "macros.h"
 
+/* Compile-time verification of expression X.
+   In this file, we need it as a statement, rather than as a declaration.  */
+#define verify_stmt(x) do { verify (x); } while (0)
+
 /* VERIFY (X) uses a static assertion for compilers that are known to work,
    and falls back on a dynamic assertion for other compilers.
    These tests should be checkable via 'verify' rather than 'ASSERT', but
    using 'verify' would run into a bug with HP-UX 11.23 cc; see
-   <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00401.html>.  */
-#if __GNUC__ || __SUNPRO_C
-# define VERIFY(x) do { verify (x); } while (0)
+   <https://lists.gnu.org/r/bug-gnulib/2011-05/msg00401.html>.  */
+#if __GNUC__ || __clang__ || __SUNPRO_C
+# define VERIFY(x) verify_stmt (x)
 #else
 # define VERIFY(x) ASSERT (x)
 #endif
 
 #define DONTCARE __LINE__
 
+int int_minus_2 = -2;
+int int_1 = 1;
+
 int
 main (void)
 {
@@ -113,11 +120,34 @@ main (void)
   VERIFY (TYPE_MAXIMUM (long int) == LONG_MAX);
   VERIFY (TYPE_MINIMUM (unsigned long int) == 0);
   VERIFY (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX);
+  #ifdef LLONG_MAX
+   verify_stmt (TYPE_MINIMUM (long long int) == LLONG_MIN);
+   verify_stmt (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+   verify_stmt (TYPE_MINIMUM (unsigned long long int) == 0);
+   verify_stmt (TYPE_MAXIMUM (unsigned long long int) == ULLONG_MAX);
+  #endif
   VERIFY (TYPE_MINIMUM (intmax_t) == INTMAX_MIN);
   VERIFY (TYPE_MAXIMUM (intmax_t) == INTMAX_MAX);
   VERIFY (TYPE_MINIMUM (uintmax_t) == 0);
   VERIFY (TYPE_MAXIMUM (uintmax_t) == UINTMAX_MAX);
 
+  /* TYPE_WIDTH.  */
+  #ifdef CHAR_WIDTH
+   verify_stmt (TYPE_WIDTH (char) == CHAR_WIDTH);
+   verify_stmt (TYPE_WIDTH (signed char) == SCHAR_WIDTH);
+   verify_stmt (TYPE_WIDTH (unsigned char) == UCHAR_WIDTH);
+   verify_stmt (TYPE_WIDTH (short int) == SHRT_WIDTH);
+   verify_stmt (TYPE_WIDTH (unsigned short int) == USHRT_WIDTH);
+   verify_stmt (TYPE_WIDTH (int) == INT_WIDTH);
+   verify_stmt (TYPE_WIDTH (unsigned int) == UINT_WIDTH);
+   verify_stmt (TYPE_WIDTH (long int) == LONG_WIDTH);
+   verify_stmt (TYPE_WIDTH (unsigned long int) == ULONG_WIDTH);
+   #ifdef LLONG_WIDTH
+    verify_stmt (TYPE_WIDTH (long long int) == LLONG_WIDTH);
+    verify_stmt (TYPE_WIDTH (unsigned long long int) == ULLONG_WIDTH);
+   #endif
+  #endif
+
   /* INT_BITS_STRLEN_BOUND.  */
   VERIFY (INT_BITS_STRLEN_BOUND (1) == 1);
   VERIFY (INT_BITS_STRLEN_BOUND (2620) == 789);
@@ -188,8 +218,10 @@ main (void)
   CHECK_SBINOP (*, MULTIPLY, INT_MIN, INT_MIN, int, true, 0);
   CHECK_SBINOP (*, MULTIPLY, -1, INT_MIN, int,
                 INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
+#if !defined __HP_cc
   CHECK_SBINOP (*, MULTIPLY, LONG_MIN / INT_MAX, (long int) INT_MAX,
                 long int, false, LONG_MIN - LONG_MIN % INT_MAX);
+#endif
 
   CHECK_BINOP (/, DIVIDE, INT_MIN, -1, int,
                INT_NEGATE_OVERFLOW (INT_MIN), INT_MIN);
@@ -210,33 +242,48 @@ main (void)
 
   /* INT_<op>_OVERFLOW and INT_<op>_WRAPV with mixed types.  */
   #define CHECK_SUM(a, b, t, v, vres)                                     \
-    CHECK_SUM1(a, b, t, v, vres);                                         \
-    CHECK_SUM1(b, a, t, v, vres)
-  #define CHECK_SSUM(a, b, t, v, vres)                                    \
-    CHECK_SSUM1(a, b, t, v, vres);                                        \
-    CHECK_SSUM1(b, a, t, v, vres)
+    CHECK_SUM1 (a, b, t, v, vres);                                        \
+    CHECK_SUM1 (b, a, t, v, vres)
+  #define CHECK_SUM_WRAPV(a, b, t, v, vres, okres)                        \
+    CHECK_SUM_WRAPV1 (a, b, t, v, vres, okres);                           \
+    CHECK_SUM_WRAPV1 (b, a, t, v, vres, okres)
   #define CHECK_SUM1(a, b, t, v, vres)                                    \
-    VERIFY (INT_ADD_OVERFLOW (a, b) == (v))
-  #define CHECK_SSUM1(a, b, t, v, vres)                                   \
-    CHECK_SUM1(a, b, t, v, vres);                                         \
+    VERIFY (INT_ADD_OVERFLOW (a, b) == (v));                              \
+    CHECK_SUM_WRAPV1 (a, b, t, v, vres, (a) + (b))
+  #define CHECK_SUM_WRAPV1(a, b, t, v, vres, okres)                       \
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_ADD_WRAPV (a, b, &result) == (v));                      \
-      ASSERT (result == ((v) ? (vres) : ((a) + (b))));                    \
+      ASSERT (result == ((v) ? (vres) : (okres)));                        \
     }
-  CHECK_SSUM (-1, LONG_MIN, long int, true, LONG_MAX);
+  CHECK_SUM (-1, LONG_MIN, long int, true, LONG_MAX);
   CHECK_SUM (-1, UINT_MAX, unsigned int, false, DONTCARE);
-  CHECK_SSUM (-1L, INT_MIN, long int, INT_MIN == LONG_MIN,
+  CHECK_SUM (-1L, INT_MIN, long int, INT_MIN == LONG_MIN,
               INT_MIN == LONG_MIN ? INT_MAX : DONTCARE);
   CHECK_SUM (0u, -1, unsigned int, true, 0u + -1);
   CHECK_SUM (0u, 0, unsigned int, false, DONTCARE);
   CHECK_SUM (0u, 1, unsigned int, false, DONTCARE);
-  CHECK_SSUM (1, LONG_MAX, long int, true, LONG_MIN);
+  CHECK_SUM (1, LONG_MAX, long int, true, LONG_MIN);
   CHECK_SUM (1, UINT_MAX, unsigned int, true, 0u);
-  CHECK_SSUM (1L, INT_MAX, long int, INT_MAX == LONG_MAX,
+  CHECK_SUM (1L, INT_MAX, long int, INT_MAX == LONG_MAX,
               INT_MAX == LONG_MAX ? INT_MIN : DONTCARE);
   CHECK_SUM (1u, INT_MAX, unsigned int, INT_MAX == UINT_MAX, 1u + INT_MAX);
   CHECK_SUM (1u, INT_MIN, unsigned int, true, 1u + INT_MIN);
+  CHECK_SUM_WRAPV (-1, 1u, int, false, DONTCARE, 0);
+  CHECK_SUM_WRAPV (-1, 1ul, int, false, DONTCARE, 0);
+  CHECK_SUM_WRAPV (-1l, 1u, int, false, DONTCARE, 0);
+  CHECK_SUM_WRAPV (-100, 1000u, int, false, DONTCARE, 900);
+  CHECK_SUM_WRAPV (INT_MIN, UINT_MAX, int, false, DONTCARE, INT_MAX);
+  CHECK_SUM_WRAPV (1u, INT_MAX, int, true, INT_MIN, DONTCARE);
+  CHECK_SUM_WRAPV (INT_MAX, 1, long int, LONG_MAX <= INT_MAX, INT_MIN,
+                   INT_MAX + 1L);
+  CHECK_SUM_WRAPV (UINT_MAX, 1, long int, LONG_MAX <= UINT_MAX, 0,
+                   UINT_MAX + 1L);
+  CHECK_SUM_WRAPV (INT_MAX, 1, unsigned long int, ULONG_MAX <= INT_MAX, 0,
+                   INT_MAX + 1uL);
+  CHECK_SUM_WRAPV (UINT_MAX, 1, unsigned long int, ULONG_MAX <= UINT_MAX, 0,
+                   UINT_MAX + 1uL);
+
   {
     long int result;
     ASSERT (INT_ADD_WRAPV (1, INT_MAX, &result) == (INT_MAX == LONG_MAX));
@@ -246,7 +293,9 @@ main (void)
   #define CHECK_DIFFERENCE(a, b, t, v, vres)                              \
     VERIFY (INT_SUBTRACT_OVERFLOW (a, b) == (v))
   #define CHECK_SDIFFERENCE(a, b, t, v, vres)                             \
-    CHECK_DIFFERENCE(a, b, t, v, vres);                                   \
+    CHECK_DIFFERENCE (a, b, t, v, vres);                                  \
+    CHECK_SDIFFERENCE_WRAPV (a, b, t, v, vres)
+  #define CHECK_SDIFFERENCE_WRAPV(a, b, t, v, vres)                       \
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_SUBTRACT_WRAPV (a, b, &result) == (v));                 \
@@ -263,6 +312,11 @@ main (void)
   CHECK_SDIFFERENCE (-1, INT_MAX, int, false, -1 - INT_MAX);
   CHECK_SDIFFERENCE (0, INT_MIN, int, INT_MIN < -INT_MAX, INT_MIN);
   CHECK_SDIFFERENCE (0, INT_MAX, int, false, 0 - INT_MAX);
+  CHECK_SDIFFERENCE_WRAPV (-1, 1u, int, false, DONTCARE);
+  CHECK_SDIFFERENCE_WRAPV (-1, 1ul, int, false, DONTCARE);
+  CHECK_SDIFFERENCE_WRAPV (-1l, 1u, int, false, DONTCARE);
+  CHECK_SDIFFERENCE_WRAPV (0u, INT_MAX, int, false, DONTCARE);
+  CHECK_SDIFFERENCE_WRAPV (1u, INT_MIN, int, true, 1u - INT_MIN);
   {
     long int result;
     ASSERT (INT_SUBTRACT_WRAPV (INT_MAX, -1, &result) == (INT_MAX == LONG_MAX));
@@ -270,15 +324,20 @@ main (void)
   }
 
   #define CHECK_PRODUCT(a, b, t, v, vres)                                 \
-    CHECK_PRODUCT1(a, b, t, v, vres);                                     \
-    CHECK_PRODUCT1(b, a, t, v, vres)
+    CHECK_PRODUCT1 (a, b, t, v, vres);                                    \
+    CHECK_PRODUCT1 (b, a, t, v, vres)
   #define CHECK_SPRODUCT(a, b, t, v, vres)                                \
-    CHECK_SPRODUCT1(a, b, t, v, vres);                                    \
-    CHECK_SPRODUCT1(b, a, t, v, vres)
+    CHECK_SPRODUCT1 (a, b, t, v, vres);                                   \
+    CHECK_SPRODUCT1 (b, a, t, v, vres)
+  #define CHECK_SPRODUCT_WRAPV(a, b, t, v, vres)                          \
+    CHECK_SPRODUCT_WRAPV1 (a, b, t, v, vres);                             \
+    CHECK_SPRODUCT_WRAPV1 (b, a, t, v, vres)
   #define CHECK_PRODUCT1(a, b, t, v, vres)                                \
     VERIFY (INT_MULTIPLY_OVERFLOW (a, b) == (v))
   #define CHECK_SPRODUCT1(a, b, t, v, vres)                               \
-    CHECK_PRODUCT1(a, b, t, v, vres);                                     \
+    CHECK_PRODUCT1 (a, b, t, v, vres);                                    \
+    CHECK_SPRODUCT_WRAPV1 (a, b, t, v, vres)
+  #define CHECK_SPRODUCT_WRAPV1(a, b, t, v, vres)                         \
     {                                                                     \
       t result;                                                           \
       ASSERT (INT_MULTIPLY_WRAPV (a, b, &result) == (v));                 \
@@ -311,11 +370,17 @@ main (void)
   CHECK_PRODUCT (INT_MAX, UINT_MAX, unsigned int, true, INT_MAX * UINT_MAX);
   CHECK_PRODUCT (INT_MAX, ULONG_MAX, unsigned long int, true,
                  INT_MAX * ULONG_MAX);
+#if !defined __HP_cc
   CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN - 1, long int, true, LONG_MIN);
   CHECK_SPRODUCT (INT_MIN, LONG_MAX / INT_MIN, long int, false, DONTCARE);
+#endif
   CHECK_PRODUCT (INT_MIN, UINT_MAX, unsigned int, true, INT_MIN * UINT_MAX);
   CHECK_PRODUCT (INT_MIN, ULONG_MAX, unsigned long int, true,
                  INT_MIN * ULONG_MAX);
+  CHECK_SPRODUCT_WRAPV (-1, INT_MAX + 1u, int, false, DONTCARE);
+  CHECK_SPRODUCT_WRAPV (-1, 1u, int, false, DONTCARE);
+  CHECK_SPRODUCT (0, ULONG_MAX, int, false, DONTCARE);
+  CHECK_SPRODUCT (0u, LONG_MIN, int, false, DONTCARE);
   {
     long int result;
     ASSERT (INT_MULTIPLY_WRAPV (INT_MAX, INT_MAX, &result)
@@ -338,6 +403,12 @@ main (void)
   }
 # endif
 
+  /* Check for GCC bug 91450.  */
+  {
+    unsigned long long result;
+    ASSERT (INT_MULTIPLY_WRAPV (int_minus_2, int_1, &result) && result == -2);
+  }
+
   #define CHECK_QUOTIENT(a, b, v) VERIFY (INT_DIVIDE_OVERFLOW (a, b) == (v))
 
   CHECK_QUOTIENT (INT_MIN, -1L, INT_MIN == LONG_MIN);
diff --git a/tests/test-inttostr.c b/tests/test-inttostr.c
new file mode 100644 (file)
index 0000000..9422ad4
--- /dev/null
@@ -0,0 +1,94 @@
+/* Test inttostr functions, and incidentally, INT_BUFSIZE_BOUND
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Jim Meyering.  */
+
+#include <config.h>
+
+#include "inttostr.h"
+#include "intprops.h"
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+#define STREQ(a, b) (strcmp (a, b) == 0)
+#define IS_TIGHT(T) (_GL_SIGNED_TYPE_OR_EXPR (T) == TYPE_SIGNED (T))
+#define ISDIGIT(c) ((unsigned int) (c) - '0' <= 9)
+
+/* Verify that an inttostr function works as advertised.
+   Convert maximum and minimum (per-type, T) values using both snprintf --
+   with a cast to intmax_t or uintmax_t -- and FN, and compare the
+   resulting strings.  Use malloc for the inttostr buffer, so that if
+   we ever exceed the usually-tight INT_BUFSIZE_BOUND, tools like
+   valgrind will detect the failure. */
+#define CK(T, Fn)                                                       \
+  do                                                                    \
+    {                                                                   \
+      char ref[100];                                                    \
+      char *buf = malloc (INT_BUFSIZE_BOUND (T));                       \
+      char const *p;                                                    \
+      ASSERT (buf);                                                     \
+      *buf = '\0';                                                      \
+      ASSERT                                                            \
+        ((TYPE_SIGNED (T)                                               \
+          ? snprintf (ref, sizeof ref, "%jd", (intmax_t) TYPE_MINIMUM (T)) \
+          : snprintf (ref, sizeof ref, "%ju", (uintmax_t) TYPE_MINIMUM (T))) \
+         < sizeof ref);                                                 \
+      ASSERT (STREQ ((p = Fn (TYPE_MINIMUM (T), buf)), ref));           \
+      /* Ensure that INT_BUFSIZE_BOUND is tight for signed types.  */   \
+      ASSERT (! TYPE_SIGNED (T) || (p == buf && *p == '-'));            \
+      ASSERT                                                            \
+        ((TYPE_SIGNED (T)                                               \
+          ? snprintf (ref, sizeof ref, "%jd", (intmax_t) TYPE_MAXIMUM (T)) \
+          : snprintf (ref, sizeof ref, "%ju", (uintmax_t) TYPE_MAXIMUM (T))) \
+         < sizeof ref);                                                 \
+      ASSERT (STREQ ((p = Fn (TYPE_MAXIMUM (T), buf)), ref));           \
+      /* For unsigned types, the bound is not always tight.  */         \
+      ASSERT (! IS_TIGHT (T) || TYPE_SIGNED (T)                         \
+              || (p == buf && ISDIGIT (*p)));                           \
+      free (buf);                                                       \
+    }                                                                   \
+  while (0)
+
+int
+main (void)
+{
+  size_t b_size = 2;
+  char *b = malloc (b_size);
+  ASSERT (b);
+
+  /* Ideally we would rely on the snprintf-posix module, in which case
+     this guard would not be required, but due to limitations in gnulib's
+     implementation (see modules/snprintf-posix), we cannot.  */
+  if (snprintf (b, b_size, "%ju", (uintmax_t) 3) == 1
+      && b[0] == '3' && b[1] == '\0')
+    {
+      CK (int,          inttostr);
+      CK (unsigned int, uinttostr);
+      CK (off_t,        offtostr);
+      CK (uintmax_t,    umaxtostr);
+      CK (intmax_t,     imaxtostr);
+      free (b);
+      return 0;
+    }
+
+  /* snprintf doesn't accept %ju; skip this test.  */
+  free (b);
+  return 77;
+}
diff --git a/tests/test-inttypes-c++.cc b/tests/test-inttypes-c++.cc
new file mode 100644 (file)
index 0000000..df4e19e
--- /dev/null
@@ -0,0 +1,39 @@
+/* Test of <inttypes.h> substitute in C++ mode.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2017.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <inttypes.h>
+
+#include "signature.h"
+
+
+#if GNULIB_TEST_STRTOIMAX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::strtoimax, intmax_t, (const char *, char **, int));
+#endif
+
+#if GNULIB_TEST_STRTOUMAX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::strtoumax, uintmax_t, (const char *, char **, int));
+#endif
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-inttypes-c++2.cc b/tests/test-inttypes-c++2.cc
new file mode 100644 (file)
index 0000000..9b49050
--- /dev/null
@@ -0,0 +1,24 @@
+/* Test of <inttypes.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#if __cplusplus >= 201103
+
+# include <cinttypes>
+
+#endif
index 9a3193c..f7f2e3a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <inttypes.h> substitute.
-   Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
diff --git a/tests/test-ioctl.c b/tests/test-ioctl.c
new file mode 100644 (file)
index 0000000..6d7b629
--- /dev/null
@@ -0,0 +1,51 @@
+/* Test of ioctl() function.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <sys/ioctl.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (ioctl, int, (int, int, ...));
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+#ifdef FIONREAD
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    int value;
+    errno = 0;
+    ASSERT (ioctl (-1, FIONREAD, &value) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    int value;
+    close (99);
+    errno = 0;
+    ASSERT (ioctl (99, FIONREAD, &value) == -1);
+    ASSERT (errno == EBADF);
+  }
+#endif
+
+  return 0;
+}
index 2f6f676..eca2366 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of isblank() function.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
 
@@ -35,7 +35,7 @@ main (int argc, char *argv[])
 
   /* Verify the property in the "C" locale.
      POSIX specifies in
-       <http://www.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html>
+       <https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap07.html>
      that
        - in all locales, the blank characters include the <space> and <tab>
          characters,
index fd3bbaf..a985809 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of isnand() substitute.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 8bc4139..f34aa57 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of isnand() substitute.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 42f5b10..43250b2 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of isnanf() substitute.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index abb992d..a85ad0b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of isnanf() substitute.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index e7bad11..7f076c8 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of isnanl() substitute.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 25985e7..6c41b32 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of isnanl() substitute.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
diff --git a/tests/test-iswblank.c b/tests/test-iswblank.c
new file mode 100644 (file)
index 0000000..3f69114
--- /dev/null
@@ -0,0 +1,35 @@
+/* Test of iswblank() function.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <wctype.h>
+
+#include "macros.h"
+
+/* Check that WEOF is defined.  */
+wint_t e = WEOF;
+
+int
+main (void)
+{
+  /* Check that the function exist as a function or as a macro.  */
+  (void) iswblank (0);
+  /* Check that the isw* functions map WEOF to 0.  */
+  ASSERT (!iswblank (e));
+
+  return 0;
+}
diff --git a/tests/test-iswdigit.c b/tests/test-iswdigit.c
new file mode 100644 (file)
index 0000000..bcd66a0
--- /dev/null
@@ -0,0 +1,233 @@
+/* Test of iswdigit() function.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <wctype.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (iswdigit, int, (wint_t));
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+
+#include "macros.h"
+
+/* Returns the value of iswdigit for the multibyte character s[0..n-1].  */
+static int
+for_character (const char *s, size_t n)
+{
+  mbstate_t state;
+  wchar_t wc;
+  size_t ret;
+
+  memset (&state, '\0', sizeof (mbstate_t));
+  wc = (wchar_t) 0xBADFACE;
+  ret = mbrtowc (&wc, s, n, &state);
+  if (ret == n)
+    return iswdigit (wc);
+  else
+    return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+  int is;
+  char buf[4];
+
+  /* configure should already have checked that the locale is supported.  */
+  if (setlocale (LC_ALL, "") == NULL)
+    return 1;
+
+  /* Test WEOF.  */
+  is = iswdigit (WEOF);
+  ASSERT (is == 0);
+
+  /* Test single-byte characters.
+     ISO C 99 sections 7.25.2.1.5 and 5.2.1 specify that the decimal digits
+     include only the ASCII 0 ... 9 characters.  */
+  {
+    int c;
+
+    for (c = 0; c < 0x100; c++)
+      switch (c)
+        {
+        case '\t': case '\v': case '\f':
+        case ' ': case '!': case '"': case '#': case '%':
+        case '&': case '\'': case '(': case ')': case '*':
+        case '+': case ',': case '-': case '.': case '/':
+        case '0': case '1': case '2': case '3': case '4':
+        case '5': case '6': case '7': case '8': case '9':
+        case ':': case ';': case '<': case '=': case '>':
+        case '?':
+        case 'A': case 'B': case 'C': case 'D': case 'E':
+        case 'F': case 'G': case 'H': case 'I': case 'J':
+        case 'K': case 'L': case 'M': case 'N': case 'O':
+        case 'P': case 'Q': case 'R': case 'S': case 'T':
+        case 'U': case 'V': case 'W': case 'X': case 'Y':
+        case 'Z':
+        case '[': case '\\': case ']': case '^': case '_':
+        case 'a': case 'b': case 'c': case 'd': case 'e':
+        case 'f': case 'g': case 'h': case 'i': case 'j':
+        case 'k': case 'l': case 'm': case 'n': case 'o':
+        case 'p': case 'q': case 'r': case 's': case 't':
+        case 'u': case 'v': case 'w': case 'x': case 'y':
+        case 'z': case '{': case '|': case '}': case '~':
+          /* c is in the ISO C "basic character set".  */
+          buf[0] = (unsigned char) c;
+          is = for_character (buf, 1);
+          switch (c)
+            {
+            case '0': case '1': case '2': case '3': case '4':
+            case '5': case '6': case '7': case '8': case '9':
+              ASSERT (is != 0);
+              break;
+            default:
+              ASSERT (is == 0);
+              break;
+            }
+          break;
+        }
+  }
+
+  if (argc > 1)
+    switch (argv[1][0])
+      {
+      case '0':
+        /* C locale; tested above.  */
+        return 0;
+
+      case '1':
+        /* Locale encoding is ISO-8859-1 or ISO-8859-15.  */
+        {
+          /* U+00B2 SUPERSCRIPT TWO */
+          is = for_character ("\262", 1);
+          ASSERT (is == 0);
+          /* U+00B3 SUPERSCRIPT THREE */
+          is = for_character ("\263", 1);
+          ASSERT (is == 0);
+          /* U+00B9 SUPERSCRIPT ONE */
+          is = for_character ("\271", 1);
+          ASSERT (is == 0);
+        }
+        return 0;
+
+      case '2':
+        /* Locale encoding is EUC-JP.  */
+        {
+          /* U+FF11 FULLWIDTH DIGIT ONE */
+          is = for_character ("\243\261", 2);
+          ASSERT (is == 0);
+        }
+        return 0;
+
+      case '3':
+        /* Locale encoding is UTF-8.  */
+        {
+          /* U+00B2 SUPERSCRIPT TWO */
+          is = for_character ("\302\262", 2);
+          ASSERT (is == 0);
+          /* U+00B3 SUPERSCRIPT THREE */
+          is = for_character ("\302\263", 2);
+          ASSERT (is == 0);
+          /* U+00B9 SUPERSCRIPT ONE */
+          is = for_character ("\302\271", 2);
+          ASSERT (is == 0);
+          /* U+0663 ARABIC-INDIC DIGIT THREE */
+          is = for_character ("\331\243", 2);
+          ASSERT (is == 0);
+          /* U+2070 SUPERSCRIPT ZERO */
+          is = for_character ("\342\201\260", 3);
+          ASSERT (is == 0);
+          /* U+2079 SUPERSCRIPT NINE */
+          is = for_character ("\342\201\271", 3);
+          ASSERT (is == 0);
+          /* U+FF11 FULLWIDTH DIGIT ONE */
+          is = for_character ("\357\274\221", 3);
+          ASSERT (is == 0);
+          /* U+1D7D1 MATHEMATICAL BOLD DIGIT THREE */
+          is = for_character ("\360\235\237\221", 4);
+          ASSERT (is == 0);
+          /* U+1D7DB MATHEMATICAL DOUBLE-STRUCK DIGIT THREE */
+          is = for_character ("\360\235\237\233", 4);
+          ASSERT (is == 0);
+          /* U+1D7E5 MATHEMATICAL SANS-SERIF DIGIT THREE */
+          is = for_character ("\360\235\237\245", 4);
+          ASSERT (is == 0);
+          /* U+1D7EF MATHEMATICAL SANS-SERIF BOLD DIGIT THREE */
+          is = for_character ("\360\235\237\257", 4);
+          ASSERT (is == 0);
+          /* U+1D7F9 MATHEMATICAL MONOSPACE DIGIT THREE */
+          is = for_character ("\360\235\237\271", 4);
+          ASSERT (is == 0);
+          /* U+E0033 TAG DIGIT THREE */
+          is = for_character ("\363\240\200\263", 4);
+          ASSERT (is == 0);
+        }
+        return 0;
+
+      case '4':
+        /* Locale encoding is GB18030.  */
+        {
+          /* U+00B2 SUPERSCRIPT TWO */
+          is = for_character ("\201\060\205\065", 4);
+          ASSERT (is == 0);
+          /* U+00B3 SUPERSCRIPT THREE */
+          is = for_character ("\201\060\205\066", 4);
+          ASSERT (is == 0);
+          /* U+00B9 SUPERSCRIPT ONE */
+          is = for_character ("\201\060\206\061", 4);
+          ASSERT (is == 0);
+          /* U+0663 ARABIC-INDIC DIGIT THREE */
+          is = for_character ("\201\061\211\071", 4);
+          ASSERT (is == 0);
+          /* U+2070 SUPERSCRIPT ZERO */
+          is = for_character ("\201\066\255\062", 4);
+          ASSERT (is == 0);
+          /* U+2079 SUPERSCRIPT NINE */
+          is = for_character ("\201\066\256\061", 4);
+          ASSERT (is == 0);
+          /* U+FF11 FULLWIDTH DIGIT ONE */
+          is = for_character ("\243\261", 2);
+          ASSERT (is == 0);
+          /* U+1D7D1 MATHEMATICAL BOLD DIGIT THREE */
+          is = for_character ("\224\063\353\071", 4);
+          ASSERT (is == 0);
+          /* U+1D7DB MATHEMATICAL DOUBLE-STRUCK DIGIT THREE */
+          is = for_character ("\224\063\354\071", 4);
+          ASSERT (is == 0);
+          /* U+1D7E5 MATHEMATICAL SANS-SERIF DIGIT THREE */
+          is = for_character ("\224\063\355\071", 4);
+          ASSERT (is == 0);
+          /* U+1D7EF MATHEMATICAL SANS-SERIF BOLD DIGIT THREE */
+          is = for_character ("\224\063\356\071", 4);
+          ASSERT (is == 0);
+          /* U+1D7F9 MATHEMATICAL MONOSPACE DIGIT THREE */
+          is = for_character ("\224\063\357\071", 4);
+          ASSERT (is == 0);
+          /* U+E0033 TAG DIGIT THREE */
+          is = for_character ("\323\066\232\071", 4);
+          ASSERT (is == 0);
+        }
+        return 0;
+
+      }
+
+  return 1;
+}
diff --git a/tests/test-iswdigit.sh b/tests/test-iswdigit.sh
new file mode 100755 (executable)
index 0000000..1bde602
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Test in the POSIX locale.
+LC_ALL=C     ${CHECKER} ./test-iswdigit${EXEEXT} 0 || exit 1
+LC_ALL=POSIX ${CHECKER} ./test-iswdigit${EXEEXT} 0 || exit 1
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: ${LOCALE_FR=fr_FR}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR \
+  ${CHECKER} ./test-iswdigit${EXEEXT} 1 \
+  || exit 1
+fi
+
+# Test whether a specific EUC-JP locale is installed.
+: ${LOCALE_JA=ja_JP}
+if test $LOCALE_JA != none; then
+  LC_ALL=$LOCALE_JA \
+  ${CHECKER} ./test-iswdigit${EXEEXT} 2 \
+  || exit 1
+fi
+
+# Test whether a specific UTF-8 locale is installed.
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 \
+  ${CHECKER} ./test-iswdigit${EXEEXT} 3 \
+  || exit 1
+fi
+
+# Test whether a specific GB18030 locale is installed.
+: ${LOCALE_ZH_CN=zh_CN.GB18030}
+if test $LOCALE_ZH_CN != none; then
+  LC_ALL=$LOCALE_ZH_CN \
+  ${CHECKER} ./test-iswdigit${EXEEXT} 4 \
+  || exit 1
+fi
+
+exit 0
diff --git a/tests/test-iswxdigit.c b/tests/test-iswxdigit.c
new file mode 100644 (file)
index 0000000..15425ee
--- /dev/null
@@ -0,0 +1,259 @@
+/* Test of iswxdigit() function.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <wctype.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (iswxdigit, int, (wint_t));
+
+#include <locale.h>
+#include <stdlib.h>
+#include <string.h>
+#include <wchar.h>
+
+#include "macros.h"
+
+/* Returns the value of iswxdigit for the multibyte character s[0..n-1].  */
+static int
+for_character (const char *s, size_t n)
+{
+  mbstate_t state;
+  wchar_t wc;
+  size_t ret;
+
+  memset (&state, '\0', sizeof (mbstate_t));
+  wc = (wchar_t) 0xBADFACE;
+  ret = mbrtowc (&wc, s, n, &state);
+  if (ret == n)
+    return iswxdigit (wc);
+  else
+    return 0;
+}
+
+int
+main (int argc, char *argv[])
+{
+  int is;
+  char buf[4];
+
+  /* configure should already have checked that the locale is supported.  */
+  if (setlocale (LC_ALL, "") == NULL)
+    return 1;
+
+  /* Test WEOF.  */
+  is = iswxdigit (WEOF);
+  ASSERT (is == 0);
+
+  /* Test single-byte characters.
+     ISO C 99 sections 7.25.2.1.12 and 6.4.4.1 specify that the hexadecimal
+     digits include only the ASCII 0 ... 9 A ... F a ... f characters.  */
+  {
+    int c;
+
+    for (c = 0; c < 0x100; c++)
+      switch (c)
+        {
+        case '\t': case '\v': case '\f':
+        case ' ': case '!': case '"': case '#': case '%':
+        case '&': case '\'': case '(': case ')': case '*':
+        case '+': case ',': case '-': case '.': case '/':
+        case '0': case '1': case '2': case '3': case '4':
+        case '5': case '6': case '7': case '8': case '9':
+        case ':': case ';': case '<': case '=': case '>':
+        case '?':
+        case 'A': case 'B': case 'C': case 'D': case 'E':
+        case 'F': case 'G': case 'H': case 'I': case 'J':
+        case 'K': case 'L': case 'M': case 'N': case 'O':
+        case 'P': case 'Q': case 'R': case 'S': case 'T':
+        case 'U': case 'V': case 'W': case 'X': case 'Y':
+        case 'Z':
+        case '[': case '\\': case ']': case '^': case '_':
+        case 'a': case 'b': case 'c': case 'd': case 'e':
+        case 'f': case 'g': case 'h': case 'i': case 'j':
+        case 'k': case 'l': case 'm': case 'n': case 'o':
+        case 'p': case 'q': case 'r': case 's': case 't':
+        case 'u': case 'v': case 'w': case 'x': case 'y':
+        case 'z': case '{': case '|': case '}': case '~':
+          /* c is in the ISO C "basic character set".  */
+          buf[0] = (unsigned char) c;
+          is = for_character (buf, 1);
+          switch (c)
+            {
+            case '0': case '1': case '2': case '3': case '4':
+            case '5': case '6': case '7': case '8': case '9':
+            case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
+            case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
+              ASSERT (is != 0);
+              break;
+            default:
+              ASSERT (is == 0);
+              break;
+            }
+          break;
+        }
+  }
+
+  if (argc > 1)
+    switch (argv[1][0])
+      {
+      case '0':
+        /* C locale; tested above.  */
+        return 0;
+
+      case '1':
+        /* Locale encoding is ISO-8859-1 or ISO-8859-15.  */
+        {
+          /* U+00B2 SUPERSCRIPT TWO */
+          is = for_character ("\262", 1);
+          ASSERT (is == 0);
+          /* U+00B3 SUPERSCRIPT THREE */
+          is = for_character ("\263", 1);
+          ASSERT (is == 0);
+          /* U+00B9 SUPERSCRIPT ONE */
+          is = for_character ("\271", 1);
+          ASSERT (is == 0);
+        }
+        return 0;
+
+      case '2':
+        /* Locale encoding is EUC-JP.  */
+        {
+          /* U+FF11 FULLWIDTH DIGIT ONE */
+          is = for_character ("\243\261", 2);
+          ASSERT (is == 0);
+          /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
+          is = for_character ("\243\301", 2);
+          ASSERT (is == 0);
+          /* U+FF41 FULLWIDTH LATIN SMALL LETTER A */
+          is = for_character ("\243\341", 2);
+          ASSERT (is == 0);
+        }
+        return 0;
+
+      case '3':
+        /* Locale encoding is UTF-8.  */
+        {
+          /* U+00B2 SUPERSCRIPT TWO */
+          is = for_character ("\302\262", 2);
+          ASSERT (is == 0);
+          /* U+00B3 SUPERSCRIPT THREE */
+          is = for_character ("\302\263", 2);
+          ASSERT (is == 0);
+          /* U+00B9 SUPERSCRIPT ONE */
+          is = for_character ("\302\271", 2);
+          ASSERT (is == 0);
+          /* U+0663 ARABIC-INDIC DIGIT THREE */
+          is = for_character ("\331\243", 2);
+          ASSERT (is == 0);
+          /* U+2070 SUPERSCRIPT ZERO */
+          is = for_character ("\342\201\260", 3);
+          ASSERT (is == 0);
+          /* U+2079 SUPERSCRIPT NINE */
+          is = for_character ("\342\201\271", 3);
+          ASSERT (is == 0);
+          /* U+FF11 FULLWIDTH DIGIT ONE */
+          is = for_character ("\357\274\221", 3);
+          ASSERT (is == 0);
+          /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
+          is = for_character ("\357\274\241", 3);
+          ASSERT (is == 0);
+          /* U+FF41 FULLWIDTH LATIN SMALL LETTER A */
+          is = for_character ("\357\275\201", 3);
+          ASSERT (is == 0);
+          /* U+1D7D1 MATHEMATICAL BOLD DIGIT THREE */
+          is = for_character ("\360\235\237\221", 4);
+          ASSERT (is == 0);
+          /* U+1D7DB MATHEMATICAL DOUBLE-STRUCK DIGIT THREE */
+          is = for_character ("\360\235\237\233", 4);
+          ASSERT (is == 0);
+          /* U+1D7E5 MATHEMATICAL SANS-SERIF DIGIT THREE */
+          is = for_character ("\360\235\237\245", 4);
+          ASSERT (is == 0);
+          /* U+1D7EF MATHEMATICAL SANS-SERIF BOLD DIGIT THREE */
+          is = for_character ("\360\235\237\257", 4);
+          ASSERT (is == 0);
+          /* U+1D7F9 MATHEMATICAL MONOSPACE DIGIT THREE */
+          is = for_character ("\360\235\237\271", 4);
+          ASSERT (is == 0);
+          /* U+E0033 TAG DIGIT THREE */
+          is = for_character ("\363\240\200\263", 4);
+          ASSERT (is == 0);
+          /* U+E0041 TAG LATIN CAPITAL LETTER A */
+          is = for_character ("\363\240\201\201", 4);
+          ASSERT (is == 0);
+        }
+        return 0;
+
+      case '4':
+        /* Locale encoding is GB18030.  */
+        {
+          /* U+00B2 SUPERSCRIPT TWO */
+          is = for_character ("\201\060\205\065", 4);
+          ASSERT (is == 0);
+          /* U+00B3 SUPERSCRIPT THREE */
+          is = for_character ("\201\060\205\066", 4);
+          ASSERT (is == 0);
+          /* U+00B9 SUPERSCRIPT ONE */
+          is = for_character ("\201\060\206\061", 4);
+          ASSERT (is == 0);
+          /* U+0663 ARABIC-INDIC DIGIT THREE */
+          is = for_character ("\201\061\211\071", 4);
+          ASSERT (is == 0);
+          /* U+2070 SUPERSCRIPT ZERO */
+          is = for_character ("\201\066\255\062", 4);
+          ASSERT (is == 0);
+          /* U+2079 SUPERSCRIPT NINE */
+          is = for_character ("\201\066\256\061", 4);
+          ASSERT (is == 0);
+          /* U+FF11 FULLWIDTH DIGIT ONE */
+          is = for_character ("\243\261", 2);
+          ASSERT (is == 0);
+          /* U+FF21 FULLWIDTH LATIN CAPITAL LETTER A */
+          is = for_character ("\243\301", 2);
+          ASSERT (is == 0);
+          /* U+FF41 FULLWIDTH LATIN SMALL LETTER A */
+          is = for_character ("\243\341", 2);
+          ASSERT (is == 0);
+          /* U+1D7D1 MATHEMATICAL BOLD DIGIT THREE */
+          is = for_character ("\224\063\353\071", 4);
+          ASSERT (is == 0);
+          /* U+1D7DB MATHEMATICAL DOUBLE-STRUCK DIGIT THREE */
+          is = for_character ("\224\063\354\071", 4);
+          ASSERT (is == 0);
+          /* U+1D7E5 MATHEMATICAL SANS-SERIF DIGIT THREE */
+          is = for_character ("\224\063\355\071", 4);
+          ASSERT (is == 0);
+          /* U+1D7EF MATHEMATICAL SANS-SERIF BOLD DIGIT THREE */
+          is = for_character ("\224\063\356\071", 4);
+          ASSERT (is == 0);
+          /* U+1D7F9 MATHEMATICAL MONOSPACE DIGIT THREE */
+          is = for_character ("\224\063\357\071", 4);
+          ASSERT (is == 0);
+          /* U+E0033 TAG DIGIT THREE */
+          is = for_character ("\323\066\232\071", 4);
+          ASSERT (is == 0);
+          /* U+E0041 TAG LATIN CAPITAL LETTER A */
+          is = for_character ("\323\066\234\063", 4);
+          ASSERT (is == 0);
+        }
+        return 0;
+
+      }
+
+  return 1;
+}
diff --git a/tests/test-iswxdigit.sh b/tests/test-iswxdigit.sh
new file mode 100755 (executable)
index 0000000..f545438
--- /dev/null
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# Test in the POSIX locale.
+LC_ALL=C     ${CHECKER} ./test-iswxdigit${EXEEXT} 0 || exit 1
+LC_ALL=POSIX ${CHECKER} ./test-iswxdigit${EXEEXT} 0 || exit 1
+
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: ${LOCALE_FR=fr_FR}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR \
+  ${CHECKER} ./test-iswxdigit${EXEEXT} 1 \
+  || exit 1
+fi
+
+# Test whether a specific EUC-JP locale is installed.
+: ${LOCALE_JA=ja_JP}
+if test $LOCALE_JA != none; then
+  LC_ALL=$LOCALE_JA \
+  ${CHECKER} ./test-iswxdigit${EXEEXT} 2 \
+  || exit 1
+fi
+
+# Test whether a specific UTF-8 locale is installed.
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 \
+  ${CHECKER} ./test-iswxdigit${EXEEXT} 3 \
+  || exit 1
+fi
+
+# Test whether a specific GB18030 locale is installed.
+: ${LOCALE_ZH_CN=zh_CN.GB18030}
+if test $LOCALE_ZH_CN != none; then
+  LC_ALL=$LOCALE_ZH_CN \
+  ${CHECKER} ./test-iswxdigit${EXEEXT} 4 \
+  || exit 1
+fi
+
+exit 0
index a9353b8..8e03f3b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <langinfo.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
index 30b0007..4215ea7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <langinfo.h> substitute.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
 
diff --git a/tests/test-limits-h-c++.cc b/tests/test-limits-h-c++.cc
new file mode 100644 (file)
index 0000000..885fba0
--- /dev/null
@@ -0,0 +1,28 @@
+/* Test of <limits.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <limits.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-limits-h-c++2.cc b/tests/test-limits-h-c++2.cc
new file mode 100644 (file)
index 0000000..f780f90
--- /dev/null
@@ -0,0 +1,20 @@
+/* Test of <limits.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <climits>
index f5576bf..4144013 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <limits.h> substitute.
-   Copyright 2016 Free Software Foundation, Inc.
+   Copyright 2016-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert.  */
 
 # pragma GCC diagnostic ignored "-Woverlength-strings"
 #endif
 
-/* Macros specified by ISO/IEC TS 18661-1:2014.  */
-
 #define verify_width(width, min, max) \
   verify ((max) >> ((width) - 1 - ((min) < 0)) == 1)
 
+/* Macros borrowed from intprops.h.  */
+#define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT)
+#define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t))
+#define TYPE_MAXIMUM(t)                                                 \
+  ((t) (! TYPE_SIGNED (t)                                               \
+        ? (t) -1                                                        \
+        : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1)))
+
+/* Type width macros.  */
+
+int type_bits[] =
+  {
+    CHAR_BIT,
+    WORD_BIT,
+    LONG_BIT
+  };
+verify_width (CHAR_BIT, CHAR_MIN, CHAR_MAX);
+verify_width (WORD_BIT, INT_MIN, INT_MAX);
+verify_width (LONG_BIT, LONG_MIN, LONG_MAX);
+
+/* Numerical limit macros.  */
+
+char               limits1[]  = { CHAR_MIN, CHAR_MAX };
+verify (TYPE_MINIMUM (char) == CHAR_MIN);
+verify (TYPE_MAXIMUM (char) == CHAR_MAX);
+
+signed char        limits2[]  = { SCHAR_MIN, SCHAR_MAX };
+verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
+verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
+
+unsigned char      limits3[]  = { UCHAR_MAX };
+verify (TYPE_MINIMUM (unsigned char) == 0);
+verify (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX);
+
+short              limits4[]  = { SHRT_MIN, SHRT_MAX };
+verify (TYPE_MINIMUM (short int) == SHRT_MIN);
+verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
+
+unsigned short     limits5[]  = { USHRT_MAX };
+verify (TYPE_MINIMUM (unsigned short int) == 0);
+verify (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX);
+
+int                limits6[]  = { INT_MIN, INT_MAX };
+verify (TYPE_MINIMUM (int) == INT_MIN);
+verify (TYPE_MAXIMUM (int) == INT_MAX);
+
+unsigned int       limits7[]  = { UINT_MAX };
+verify (TYPE_MINIMUM (unsigned int) == 0);
+verify (TYPE_MAXIMUM (unsigned int) == UINT_MAX);
+
+long               limits8[]  = { LONG_MIN, LONG_MAX };
+verify (TYPE_MINIMUM (long int) == LONG_MIN);
+verify (TYPE_MAXIMUM (long int) == LONG_MAX);
+
+unsigned long      limits9[]  = { ULONG_MAX };
+verify (TYPE_MINIMUM (unsigned long int) == 0);
+verify (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX);
+
+long long          limits10[] = { LLONG_MIN, LLONG_MAX };
+verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
+verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+
+unsigned long long limits11[] = { ULLONG_MAX };
+verify (TYPE_MINIMUM (unsigned long long int) == 0);
+verify (TYPE_MAXIMUM (unsigned long long int) == ULLONG_MAX);
+
+/* Macros specified by ISO/IEC TS 18661-1:2014.  */
+
 verify_width (CHAR_WIDTH, CHAR_MIN, CHAR_MAX);
 verify_width (SCHAR_WIDTH, SCHAR_MIN, SCHAR_MAX);
 verify_width (UCHAR_WIDTH, 0, UCHAR_MAX);
index bdd20aa..5b6838c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of link() function.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 1ae8544..6806546 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of link() function.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* This file is designed to test both link(a,b) and
    linkat(AT_FDCWD,a,AT_FDCWD,b,0).  FUNC is the function to test.
diff --git a/tests/test-linked_list.c b/tests/test-linked_list.c
new file mode 100644 (file)
index 0000000..fff7e06
--- /dev/null
@@ -0,0 +1,459 @@
+/* Test of sequential list data type implementation.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2006.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "gl_linked_list.h"
+
+#include <stdlib.h>
+
+#include "gl_array_list.h"
+#include "macros.h"
+
+static const char *objects[15] =
+  {
+    "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o"
+  };
+
+#define RANDOM(n) (rand () % (n))
+#define RANDOM_OBJECT() objects[RANDOM (SIZEOF (objects))]
+
+static void
+check_equals (gl_list_t list1, gl_list_t list2)
+{
+  size_t n, i;
+
+  n = gl_list_size (list1);
+  ASSERT (n == gl_list_size (list2));
+  for (i = 0; i < n; i++)
+    {
+      ASSERT (gl_list_get_at (list1, i) == gl_list_get_at (list2, i));
+    }
+}
+
+static void
+check_equals_by_forward_iteration (gl_list_t list1, gl_list_t list2)
+{
+  gl_list_node_t node1 = gl_list_first_node (list1);
+  gl_list_node_t node2 = gl_list_first_node (list2);
+  while (node1 != NULL && node2 != NULL)
+    {
+      ASSERT (gl_list_node_value (list1, node1)
+              == gl_list_node_value (list2, node2));
+      node1 = gl_list_next_node (list1, node1);
+      node2 = gl_list_next_node (list2, node2);
+    }
+  ASSERT ((node1 == NULL) == (node2 == NULL));
+}
+
+static void
+check_equals_by_backward_iteration (gl_list_t list1, gl_list_t list2)
+{
+  gl_list_node_t node1 = gl_list_last_node (list1);
+  gl_list_node_t node2 = gl_list_last_node (list2);
+  while (node1 != NULL && node2 != NULL)
+    {
+      ASSERT (gl_list_node_value (list1, node1)
+              == gl_list_node_value (list2, node2));
+      node1 = gl_list_previous_node (list1, node1);
+      node2 = gl_list_previous_node (list2, node2);
+    }
+  ASSERT ((node1 == NULL) == (node2 == NULL));
+}
+
+static void
+check_all (gl_list_t list1, gl_list_t list2, gl_list_t list3)
+{
+  check_equals (list1, list2);
+  check_equals (list1, list3);
+}
+
+int
+main (int argc, char *argv[])
+{
+  gl_list_t list1, list2, list3;
+
+  /* Allow the user to provide a non-default random seed on the command line.  */
+  if (argc > 1)
+    srand (atoi (argv[1]));
+
+  {
+    size_t initial_size = RANDOM (50);
+    const void **contents =
+      (const void **) malloc (initial_size * sizeof (const void *));
+    size_t i;
+    unsigned int repeat;
+
+    for (i = 0; i < initial_size; i++)
+      contents[i] = RANDOM_OBJECT ();
+
+    /* Create list1.  */
+    list1 = gl_list_nx_create (GL_ARRAY_LIST, NULL, NULL, NULL, true,
+                               initial_size, contents);
+    ASSERT (list1 != NULL);
+    /* Create list2.  */
+    list2 = gl_list_nx_create_empty (GL_LINKED_LIST, NULL, NULL, NULL, true);
+    ASSERT (list2 != NULL);
+    for (i = 0; i < initial_size; i++)
+      ASSERT (gl_list_nx_add_last (list2, contents[i]) != NULL);
+
+    /* Create list3.  */
+    list3 = gl_list_nx_create (GL_LINKED_LIST, NULL, NULL, NULL, true,
+                               initial_size, contents);
+    ASSERT (list3 != NULL);
+
+    check_all (list1, list2, list3);
+
+    check_equals_by_forward_iteration (list1, list2);
+    check_equals_by_backward_iteration (list1, list2);
+
+    for (repeat = 0; repeat < 10000; repeat++)
+      {
+        unsigned int operation = RANDOM (18);
+        switch (operation)
+          {
+          case 0:
+            if (gl_list_size (list1) > 0)
+              {
+                size_t index = RANDOM (gl_list_size (list1));
+                const char *obj = RANDOM_OBJECT ();
+                gl_list_node_t node1, node2, node3;
+
+                node1 = gl_list_nx_set_at (list1, index, obj);
+                ASSERT (node1 != NULL);
+                ASSERT (gl_list_get_at (list1, index) == obj);
+                ASSERT (gl_list_node_value (list1, node1) == obj);
+
+                node2 = gl_list_nx_set_at (list2, index, obj);
+                ASSERT (node2 != NULL);
+                ASSERT (gl_list_get_at (list2, index) == obj);
+                ASSERT (gl_list_node_value (list2, node2) == obj);
+
+                node3 = gl_list_nx_set_at (list3, index, obj);
+                ASSERT (node3 != NULL);
+                ASSERT (gl_list_get_at (list3, index) == obj);
+                ASSERT (gl_list_node_value (list3, node3) == obj);
+
+                if (index > 0)
+                  {
+                    ASSERT (gl_list_node_value (list1, gl_list_previous_node (list1, node1))
+                            == gl_list_get_at (list1, index - 1));
+                    ASSERT (gl_list_node_value (list2, gl_list_previous_node (list3, node3))
+                            == gl_list_get_at (list2, index - 1));
+                    ASSERT (gl_list_node_value (list3, gl_list_previous_node (list3, node3))
+                            == gl_list_get_at (list2, index - 1));
+                  }
+                if (index + 1 < gl_list_size (list1))
+                  {
+                    ASSERT (gl_list_node_value (list1, gl_list_next_node (list1, node1))
+                            == gl_list_get_at (list1, index + 1));
+                    ASSERT (gl_list_node_value (list2, gl_list_next_node (list3, node3))
+                            == gl_list_get_at (list2, index + 1));
+                    ASSERT (gl_list_node_value (list3, gl_list_next_node (list3, node3))
+                            == gl_list_get_at (list2, index + 1));
+                  }
+              }
+            break;
+          case 1:
+            {
+              const char *obj = RANDOM_OBJECT ();
+              gl_list_node_t node1, node2, node3;
+              node1 = gl_list_search (list1, obj);
+              node2 = gl_list_search (list2, obj);
+              node3 = gl_list_search (list3, obj);
+              if (node1 == NULL)
+                {
+                  ASSERT (node2 == NULL);
+                  ASSERT (node3 == NULL);
+                }
+              else
+                {
+                  ASSERT (node2 != NULL);
+                  ASSERT (node3 != NULL);
+                  ASSERT (gl_list_node_value (list1, node1) == obj);
+                  ASSERT (gl_list_node_value (list2, node2) == obj);
+                  ASSERT (gl_list_node_value (list3, node3) == obj);
+                }
+            }
+            break;
+          case 2:
+            {
+              const char *obj = RANDOM_OBJECT ();
+              size_t index1, index2, index3;
+              index1 = gl_list_indexof (list1, obj);
+              index2 = gl_list_indexof (list2, obj);
+              index3 = gl_list_indexof (list3, obj);
+              if (index1 == (size_t)(-1))
+                {
+                  ASSERT (index2 == (size_t)(-1));
+                  ASSERT (index3 == (size_t)(-1));
+                }
+              else
+                {
+                  ASSERT (index2 != (size_t)(-1));
+                  ASSERT (index3 != (size_t)(-1));
+                  ASSERT (gl_list_get_at (list1, index1) == obj);
+                  ASSERT (gl_list_get_at (list2, index2) == obj);
+                  ASSERT (gl_list_get_at (list3, index3) == obj);
+                  ASSERT (index2 == index1);
+                  ASSERT (index3 == index1);
+                }
+            }
+            break;
+          case 3: /* add 1 element */
+            {
+              const char *obj = RANDOM_OBJECT ();
+              gl_list_node_t node1, node2, node3;
+              node1 = gl_list_nx_add_first (list1, obj);
+              ASSERT (node1 != NULL);
+              node2 = gl_list_nx_add_first (list2, obj);
+              ASSERT (node2 != NULL);
+              node3 = gl_list_nx_add_first (list3, obj);
+              ASSERT (node3 != NULL);
+              ASSERT (gl_list_node_value (list1, node1) == obj);
+              ASSERT (gl_list_node_value (list2, node2) == obj);
+              ASSERT (gl_list_node_value (list3, node3) == obj);
+              ASSERT (gl_list_get_at (list1, 0) == obj);
+              ASSERT (gl_list_get_at (list2, 0) == obj);
+              ASSERT (gl_list_get_at (list3, 0) == obj);
+            }
+            break;
+          case 4: /* add 1 element */
+            {
+              const char *obj = RANDOM_OBJECT ();
+              gl_list_node_t node1, node2, node3;
+              node1 = gl_list_nx_add_last (list1, obj);
+              ASSERT (node1 != NULL);
+              node2 = gl_list_nx_add_last (list2, obj);
+              ASSERT (node2 != NULL);
+              node3 = gl_list_nx_add_last (list3, obj);
+              ASSERT (node3 != NULL);
+              ASSERT (gl_list_node_value (list1, node1) == obj);
+              ASSERT (gl_list_node_value (list2, node2) == obj);
+              ASSERT (gl_list_node_value (list3, node3) == obj);
+              ASSERT (gl_list_get_at (list1, gl_list_size (list1) - 1) == obj);
+              ASSERT (gl_list_get_at (list2, gl_list_size (list2) - 1) == obj);
+              ASSERT (gl_list_get_at (list3, gl_list_size (list3) - 1) == obj);
+            }
+            break;
+          case 5: /* add 3 elements */
+            {
+              const char *obj0 = RANDOM_OBJECT ();
+              const char *obj1 = RANDOM_OBJECT ();
+              const char *obj2 = RANDOM_OBJECT ();
+              gl_list_node_t node1, node2, node3;
+              node1 = gl_list_nx_add_first (list1, obj2);
+              ASSERT (node1 != NULL);
+              node1 = gl_list_nx_add_before (list1, node1, obj0);
+              ASSERT (node1 != NULL);
+              node1 = gl_list_nx_add_after (list1, node1, obj1);
+              ASSERT (node1 != NULL);
+              node2 = gl_list_nx_add_first (list2, obj2);
+              ASSERT (node2 != NULL);
+              node2 = gl_list_nx_add_before (list2, node2, obj0);
+              ASSERT (node2 != NULL);
+              node2 = gl_list_nx_add_after (list2, node2, obj1);
+              ASSERT (node2 != NULL);
+              node3 = gl_list_nx_add_first (list3, obj2);
+              ASSERT (node3 != NULL);
+              node3 = gl_list_nx_add_before (list3, node3, obj0);
+              ASSERT (node3 != NULL);
+              node3 = gl_list_nx_add_after (list3, node3, obj1);
+              ASSERT (node3 != NULL);
+              ASSERT (gl_list_node_value (list1, node1) == obj1);
+              ASSERT (gl_list_node_value (list2, node2) == obj1);
+              ASSERT (gl_list_node_value (list3, node3) == obj1);
+              ASSERT (gl_list_get_at (list1, 0) == obj0);
+              ASSERT (gl_list_get_at (list1, 1) == obj1);
+              ASSERT (gl_list_get_at (list1, 2) == obj2);
+              ASSERT (gl_list_get_at (list2, 0) == obj0);
+              ASSERT (gl_list_get_at (list2, 1) == obj1);
+              ASSERT (gl_list_get_at (list2, 2) == obj2);
+              ASSERT (gl_list_get_at (list3, 0) == obj0);
+              ASSERT (gl_list_get_at (list3, 1) == obj1);
+              ASSERT (gl_list_get_at (list3, 2) == obj2);
+            }
+            break;
+          case 6: /* add 1 element */
+            {
+              size_t index = RANDOM (gl_list_size (list1) + 1);
+              const char *obj = RANDOM_OBJECT ();
+              gl_list_node_t node1, node2, node3;
+              node1 = gl_list_nx_add_at (list1, index, obj);
+              ASSERT (node1 != NULL);
+              node2 = gl_list_nx_add_at (list2, index, obj);
+              ASSERT (node2 != NULL);
+              node3 = gl_list_nx_add_at (list3, index, obj);
+              ASSERT (node3 != NULL);
+              ASSERT (gl_list_get_at (list1, index) == obj);
+              ASSERT (gl_list_node_value (list1, node1) == obj);
+              ASSERT (gl_list_get_at (list2, index) == obj);
+              ASSERT (gl_list_node_value (list2, node2) == obj);
+              ASSERT (gl_list_get_at (list3, index) == obj);
+              ASSERT (gl_list_node_value (list3, node3) == obj);
+              if (index > 0)
+                {
+                  ASSERT (gl_list_node_value (list1, gl_list_previous_node (list1, node1))
+                          == gl_list_get_at (list1, index - 1));
+                  ASSERT (gl_list_node_value (list2, gl_list_previous_node (list3, node3))
+                          == gl_list_get_at (list2, index - 1));
+                  ASSERT (gl_list_node_value (list3, gl_list_previous_node (list3, node3))
+                          == gl_list_get_at (list2, index - 1));
+                }
+              if (index + 1 < gl_list_size (list1))
+                {
+                  ASSERT (gl_list_node_value (list1, gl_list_next_node (list1, node1))
+                          == gl_list_get_at (list1, index + 1));
+                  ASSERT (gl_list_node_value (list2, gl_list_next_node (list3, node3))
+                          == gl_list_get_at (list2, index + 1));
+                  ASSERT (gl_list_node_value (list3, gl_list_next_node (list3, node3))
+                          == gl_list_get_at (list2, index + 1));
+                }
+            }
+            break;
+          case 7: case 8: /* remove 1 element */
+            if (gl_list_size (list1) > 0)
+              {
+                size_t n = gl_list_size (list1);
+                const char *obj = gl_list_get_at (list1, RANDOM (n));
+                gl_list_node_t node1, node2, node3;
+                node1 = gl_list_search (list1, obj);
+                node2 = gl_list_search (list2, obj);
+                node3 = gl_list_search (list3, obj);
+                ASSERT (node1 != NULL);
+                ASSERT (node2 != NULL);
+                ASSERT (node3 != NULL);
+                ASSERT (gl_list_remove_node (list1, node1));
+                ASSERT (gl_list_remove_node (list2, node2));
+                ASSERT (gl_list_remove_node (list3, node3));
+                ASSERT (gl_list_size (list1) == n - 1);
+              }
+            break;
+          case 9: case 10: /* remove 1 element */
+            if (gl_list_size (list1) > 0)
+              {
+                size_t n = gl_list_size (list1);
+                size_t index = RANDOM (n);
+                ASSERT (gl_list_remove_at (list1, index));
+                ASSERT (gl_list_remove_at (list2, index));
+                ASSERT (gl_list_remove_at (list3, index));
+                ASSERT (gl_list_size (list1) == n - 1);
+              }
+            break;
+          case 11: /* remove first element */
+            {
+              size_t n = gl_list_size (list1);
+              bool removed1 = gl_list_remove_first (list1);
+              ASSERT (gl_list_remove_first (list2) == removed1);
+              ASSERT (gl_list_remove_first (list3) == removed1);
+              ASSERT (gl_list_size (list1) == n - (int) removed1);
+            }
+            break;
+          case 12: /* remove last element */
+            {
+              size_t n = gl_list_size (list1);
+              bool removed1 = gl_list_remove_last (list1);
+              ASSERT (gl_list_remove_last (list2) == removed1);
+              ASSERT (gl_list_remove_last (list3) == removed1);
+              ASSERT (gl_list_size (list1) == n - (int) removed1);
+            }
+            break;
+          case 13: case 14: /* remove 1 element */
+            if (gl_list_size (list1) > 0)
+              {
+                size_t n = gl_list_size (list1);
+                const char *obj = gl_list_get_at (list1, RANDOM (n));
+                ASSERT (gl_list_remove (list1, obj));
+                ASSERT (gl_list_remove (list2, obj));
+                ASSERT (gl_list_remove (list3, obj));
+                ASSERT (gl_list_size (list1) == n - 1);
+              }
+            break;
+          case 15:
+            if (gl_list_size (list1) > 0)
+              {
+                size_t n = gl_list_size (list1);
+                const char *obj = "xyzzy";
+                ASSERT (!gl_list_remove (list1, obj));
+                ASSERT (!gl_list_remove (list2, obj));
+                ASSERT (!gl_list_remove (list3, obj));
+                ASSERT (gl_list_size (list1) == n);
+              }
+            break;
+          case 16:
+            {
+              size_t n = gl_list_size (list1);
+              gl_list_iterator_t iter1, iter2, iter3;
+              const void *elt;
+              iter1 = gl_list_iterator (list1);
+              iter2 = gl_list_iterator (list2);
+              iter3 = gl_list_iterator (list3);
+              for (i = 0; i < n; i++)
+                {
+                  ASSERT (gl_list_iterator_next (&iter1, &elt, NULL));
+                  ASSERT (gl_list_get_at (list1, i) == elt);
+                  ASSERT (gl_list_iterator_next (&iter2, &elt, NULL));
+                  ASSERT (gl_list_get_at (list2, i) == elt);
+                  ASSERT (gl_list_iterator_next (&iter3, &elt, NULL));
+                  ASSERT (gl_list_get_at (list3, i) == elt);
+                }
+              ASSERT (!gl_list_iterator_next (&iter1, &elt, NULL));
+              ASSERT (!gl_list_iterator_next (&iter2, &elt, NULL));
+              ASSERT (!gl_list_iterator_next (&iter3, &elt, NULL));
+              gl_list_iterator_free (&iter1);
+              gl_list_iterator_free (&iter2);
+              gl_list_iterator_free (&iter3);
+            }
+            break;
+          case 17:
+            {
+              size_t end = RANDOM (gl_list_size (list1) + 1);
+              size_t start = RANDOM (end + 1);
+              gl_list_iterator_t iter1, iter2, iter3;
+              const void *elt;
+              iter1 = gl_list_iterator_from_to (list1, start, end);
+              iter2 = gl_list_iterator_from_to (list2, start, end);
+              iter3 = gl_list_iterator_from_to (list3, start, end);
+              for (i = start; i < end; i++)
+                {
+                  ASSERT (gl_list_iterator_next (&iter1, &elt, NULL));
+                  ASSERT (gl_list_get_at (list1, i) == elt);
+                  ASSERT (gl_list_iterator_next (&iter2, &elt, NULL));
+                  ASSERT (gl_list_get_at (list2, i) == elt);
+                  ASSERT (gl_list_iterator_next (&iter3, &elt, NULL));
+                  ASSERT (gl_list_get_at (list3, i) == elt);
+                }
+              ASSERT (!gl_list_iterator_next (&iter1, &elt, NULL));
+              ASSERT (!gl_list_iterator_next (&iter2, &elt, NULL));
+              ASSERT (!gl_list_iterator_next (&iter3, &elt, NULL));
+              gl_list_iterator_free (&iter1);
+              gl_list_iterator_free (&iter2);
+              gl_list_iterator_free (&iter3);
+            }
+            break;
+          }
+        check_all (list1, list2, list3);
+      }
+
+    gl_list_free (list1);
+    gl_list_free (list2);
+    gl_list_free (list3);
+    free (contents);
+  }
+
+  return 0;
+}
index 5da90c2..fc2a8a0 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of sequential list data type implementation.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2006.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -43,7 +43,7 @@ string_equals (const void *x1, const void *x2)
 
 /* A hash function for NUL-terminated char* strings using
    the method described by Bruno Haible.
-   See http://www.haible.de/bruno/hashfunc.html.  */
+   See https://www.haible.de/bruno/hashfunc.html.  */
 static size_t
 string_hash (const void *x)
 {
@@ -73,6 +73,36 @@ check_equals (gl_list_t list1, gl_list_t list2)
 }
 
 static void
+check_equals_by_forward_iteration (gl_list_t list1, gl_list_t list2)
+{
+  gl_list_node_t node1 = gl_list_first_node (list1);
+  gl_list_node_t node2 = gl_list_first_node (list2);
+  while (node1 != NULL && node2 != NULL)
+    {
+      ASSERT (gl_list_node_value (list1, node1)
+              == gl_list_node_value (list2, node2));
+      node1 = gl_list_next_node (list1, node1);
+      node2 = gl_list_next_node (list2, node2);
+    }
+  ASSERT ((node1 == NULL) == (node2 == NULL));
+}
+
+static void
+check_equals_by_backward_iteration (gl_list_t list1, gl_list_t list2)
+{
+  gl_list_node_t node1 = gl_list_last_node (list1);
+  gl_list_node_t node2 = gl_list_last_node (list2);
+  while (node1 != NULL && node2 != NULL)
+    {
+      ASSERT (gl_list_node_value (list1, node1)
+              == gl_list_node_value (list2, node2));
+      node1 = gl_list_previous_node (list1, node1);
+      node2 = gl_list_previous_node (list2, node2);
+    }
+  ASSERT ((node1 == NULL) == (node2 == NULL));
+}
+
+static void
 check_all (gl_list_t list1, gl_list_t list2, gl_list_t list3)
 {
   check_equals (list1, list2);
@@ -118,9 +148,12 @@ main (int argc, char *argv[])
 
     check_all (list1, list2, list3);
 
+    check_equals_by_forward_iteration (list1, list2);
+    check_equals_by_backward_iteration (list1, list2);
+
     for (repeat = 0; repeat < 10000; repeat++)
       {
-        unsigned int operation = RANDOM (16);
+        unsigned int operation = RANDOM (18);
         switch (operation)
           {
           case 0:
@@ -351,7 +384,25 @@ main (int argc, char *argv[])
                 ASSERT (gl_list_size (list1) == n - 1);
               }
             break;
-          case 11: case 12: /* remove 1 element */
+          case 11: /* remove first element */
+            {
+              size_t n = gl_list_size (list1);
+              bool removed1 = gl_list_remove_first (list1);
+              ASSERT (gl_list_remove_first (list2) == removed1);
+              ASSERT (gl_list_remove_first (list3) == removed1);
+              ASSERT (gl_list_size (list1) == n - (int) removed1);
+            }
+            break;
+          case 12: /* remove last element */
+            {
+              size_t n = gl_list_size (list1);
+              bool removed1 = gl_list_remove_last (list1);
+              ASSERT (gl_list_remove_last (list2) == removed1);
+              ASSERT (gl_list_remove_last (list3) == removed1);
+              ASSERT (gl_list_size (list1) == n - (int) removed1);
+            }
+            break;
+          case 13: case 14: /* remove 1 element */
             if (gl_list_size (list1) > 0)
               {
                 size_t n = gl_list_size (list1);
@@ -362,7 +413,7 @@ main (int argc, char *argv[])
                 ASSERT (gl_list_size (list1) == n - 1);
               }
             break;
-          case 13:
+          case 15:
             if (gl_list_size (list1) > 0)
               {
                 size_t n = gl_list_size (list1);
@@ -373,7 +424,7 @@ main (int argc, char *argv[])
                 ASSERT (gl_list_size (list1) == n);
               }
             break;
-          case 14:
+          case 16:
             {
               size_t n = gl_list_size (list1);
               gl_list_iterator_t iter1, iter2, iter3;
@@ -398,7 +449,7 @@ main (int argc, char *argv[])
               gl_list_iterator_free (&iter3);
             }
             break;
-          case 15:
+          case 17:
             {
               size_t end = RANDOM (gl_list_size (list1) + 1);
               size_t start = RANDOM (end + 1);
diff --git a/tests/test-listen.c b/tests/test-listen.c
new file mode 100644 (file)
index 0000000..3692514
--- /dev/null
@@ -0,0 +1,49 @@
+/* Test listen() function.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (listen, int, (int, int));
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "sockets.h"
+#include "macros.h"
+
+int
+main (void)
+{
+  (void) gl_sockets_startup (SOCKETS_1_1);
+
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    errno = 0;
+    ASSERT (listen (-1, 1) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    close (99);
+    errno = 0;
+    ASSERT (listen (99 ,1) == -1);
+    ASSERT (errno == EBADF);
+  }
+
+  return 0;
+}
diff --git a/tests/test-localcharset.c b/tests/test-localcharset.c
new file mode 100644 (file)
index 0000000..07b756c
--- /dev/null
@@ -0,0 +1,39 @@
+/* Manual test of localcharset() function.
+   Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* This program prints the result of locale_charset in the current locale.
+   One way to use it is:
+     $ for l in `locale -a`; do
+         echo -n "$l               "; LANG=$l ./test-localcharset;
+       done \
+       | sort -k 2
+ */
+
+#include <config.h>
+
+#include "localcharset.h"
+
+#include <locale.h>
+#include <stdio.h>
+
+int
+main (void)
+{
+  setlocale (LC_ALL, "");
+  printf ("%s\n", locale_charset ());
+
+  return 0;
+}
index 892a9e8..7337ed3 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <locale.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
 #include "signature.h"
 
 
+#if GNULIB_TEST_LOCALECONV
+SIGNATURE_CHECK (GNULIB_NAMESPACE::localeconv, struct lconv *, (void));
+#endif
+
 #if GNULIB_TEST_SETLOCALE
 SIGNATURE_CHECK (GNULIB_NAMESPACE::setlocale, char *, (int, const char *));
 #endif
 
-#if GNULIB_TEST_DUPLOCALE && HAVE_DUPLOCALE
+#if 0
+SIGNATURE_CHECK (GNULIB_NAMESPACE::newlocale, locale_t, (int, const char *, locale_t));
+#endif
+
+#if GNULIB_TEST_DUPLOCALE && HAVE_WORKING_DUPLOCALE
 SIGNATURE_CHECK (GNULIB_NAMESPACE::duplocale, locale_t, (locale_t));
 #endif
 
+#if 0
+SIGNATURE_CHECK (GNULIB_NAMESPACE::freelocale, void, (locale_t));
+#endif
+
 
 int
 main ()
index 92014ae..37a0481 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <locale.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #define GNULIB_NAMESPACE gnulib
 #include <config.h>
index c1811af..59644fa 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <locale.h> substitute.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -44,7 +44,7 @@ verify (sizeof NULL == sizeof (void *));
 int
 main ()
 {
-#if HAVE_NEWLOCALE
+#if HAVE_WORKING_NEWLOCALE
   /* Check that the locale_t type and the LC_GLOBAL_LOCALE macro are defined.  */
   locale_t b = LC_GLOBAL_LOCALE;
   (void) b;
index 9e83f2d..b7998ef 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of localeconv() function.
-   Copyright (C) 2012-2016 Free Software Foundation, Inc.
+   Copyright (C) 2012-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2012.  */
 
@@ -37,13 +37,13 @@ main ()
 
     ASSERT (STREQ (l->decimal_point, "."));
     ASSERT (STREQ (l->thousands_sep, ""));
-#if !(defined __FreeBSD__ || defined __sun)
+#if !((defined __FreeBSD__ || defined __DragonFly__) || defined __sun || defined __CYGWIN__)
     ASSERT (STREQ (l->grouping, ""));
 #endif
 
     ASSERT (STREQ (l->mon_decimal_point, ""));
     ASSERT (STREQ (l->mon_thousands_sep, ""));
-#if !(defined __FreeBSD__ || defined __sun)
+#if !((defined __FreeBSD__ || defined __DragonFly__) || defined __sun || defined __CYGWIN__)
     ASSERT (STREQ (l->mon_grouping, ""));
 #endif
     ASSERT (STREQ (l->positive_sign, ""));
index be8fcaf..22790ab 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of gl_locale_name function and its variants.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
 
 #include "macros.h"
 
+#if HAVE_WORKING_NEWLOCALE && HAVE_WORKING_USELOCALE && !HAVE_FAKE_LOCALES
+# define HAVE_GOOD_USELOCALE 1
+#endif
+
 
-#if HAVE_NEWLOCALE
+#if HAVE_GOOD_USELOCALE
 
 static struct { int cat; int mask; const char *string; } const categories[] =
   {
@@ -63,6 +67,7 @@ static struct { int cat; int mask; const char *string; } const categories[] =
 static void
 test_locale_name (void)
 {
+  const char *ret;
   const char *name;
 
   /* Check that gl_locale_name returns non-NULL.  */
@@ -70,7 +75,7 @@ test_locale_name (void)
 
   /* Get into a defined state,  */
   setlocale (LC_ALL, "en_US.UTF-8");
-#if HAVE_NEWLOCALE
+#if HAVE_GOOD_USELOCALE
   uselocale (LC_GLOBAL_LOCALE);
 #endif
 
@@ -81,7 +86,21 @@ test_locale_name (void)
   unsetenv ("LC_MESSAGES");
   unsetenv ("LC_NUMERIC");
   unsetenv ("LANG");
-  setlocale (LC_ALL, "");
+  /* Need also to unset all environment variables that specify standard or
+     non-standard locale categories.  Otherwise, on glibc systems, when some
+     of these variables are set and reference a nonexistent locale, the
+     setlocale (LC_ALL, "") call below would fail.  */
+  unsetenv ("LC_COLLATE");
+  unsetenv ("LC_MONETARY");
+  unsetenv ("LC_TIME");
+  unsetenv ("LC_ADDRESS");
+  unsetenv ("LC_IDENTIFICATION");
+  unsetenv ("LC_MEASUREMENT");
+  unsetenv ("LC_NAME");
+  unsetenv ("LC_PAPER");
+  unsetenv ("LC_TELEPHONE");
+  ret = setlocale (LC_ALL, "");
+  ASSERT (ret != NULL);
   ASSERT (strcmp (gl_locale_name (LC_MESSAGES, "LC_MESSAGES"),
                   gl_locale_name_default ()) == 0);
   ASSERT (strcmp (gl_locale_name (LC_NUMERIC, "LC_NUMERIC"),
@@ -155,7 +174,16 @@ test_locale_name (void)
   if (setlocale (LC_ALL, "") != NULL)
     {
       name = gl_locale_name (LC_CTYPE, "LC_CTYPE");
+#if defined _WIN32 && !defined __CYGWIN__
+      /* On native Windows, here,
+           gl_locale_name_thread (LC_CTYPE, "LC_CTYPE")
+         returns NULL and
+           gl_locale_name_posix (LC_CTYPE, "LC_CTYPE")
+         returns either "de_DE" or "de_DE.UTF-8".  */
+      ASSERT (strcmp (name, "de_DE") == 0 || strcmp (name, "de_DE.UTF-8") == 0);
+#else
       ASSERT (strcmp (name, "de_DE.UTF-8") == 0);
+#endif
       name = gl_locale_name (LC_MESSAGES, "LC_MESSAGES");
       ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
     }
@@ -172,7 +200,7 @@ test_locale_name (void)
       ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
     }
 
-#if HAVE_NEWLOCALE
+#if HAVE_GOOD_USELOCALE
   /* Check that gl_locale_name considers the thread locale.  */
   {
     locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
@@ -232,7 +260,7 @@ test_locale_name_thread (void)
   /* Get into a defined state,  */
   setlocale (LC_ALL, "en_US.UTF-8");
 
-#if HAVE_NEWLOCALE
+#if HAVE_GOOD_USELOCALE
   /* Check that gl_locale_name_thread returns NULL when no thread locale is
      set.  */
   uselocale (LC_GLOBAL_LOCALE);
@@ -483,11 +511,12 @@ test_locale_name_thread (void)
 static void
 test_locale_name_posix (void)
 {
+  const char *ret;
   const char *name;
 
   /* Get into a defined state,  */
   setlocale (LC_ALL, "en_US.UTF-8");
-#if HAVE_NEWLOCALE
+#if HAVE_GOOD_USELOCALE
   uselocale (LC_GLOBAL_LOCALE);
 #endif
 
@@ -498,7 +527,21 @@ test_locale_name_posix (void)
   unsetenv ("LC_MESSAGES");
   unsetenv ("LC_NUMERIC");
   unsetenv ("LANG");
-  setlocale (LC_ALL, "");
+  /* Need also to unset all environment variables that specify standard or
+     non-standard locale categories.  Otherwise, on glibc systems, when some
+     of these variables are set and reference a nonexistent locale, the
+     setlocale (LC_ALL, "") call below would fail.  */
+  unsetenv ("LC_COLLATE");
+  unsetenv ("LC_MONETARY");
+  unsetenv ("LC_TIME");
+  unsetenv ("LC_ADDRESS");
+  unsetenv ("LC_IDENTIFICATION");
+  unsetenv ("LC_MEASUREMENT");
+  unsetenv ("LC_NAME");
+  unsetenv ("LC_PAPER");
+  unsetenv ("LC_TELEPHONE");
+  ret = setlocale (LC_ALL, "");
+  ASSERT (ret != NULL);
   name = gl_locale_name_posix (LC_MESSAGES, "LC_MESSAGES");
   ASSERT (name == NULL || strcmp (name, gl_locale_name_default ()) == 0);
   name = gl_locale_name_posix (LC_NUMERIC, "LC_NUMERIC");
@@ -575,7 +618,11 @@ test_locale_name_posix (void)
   if (setlocale (LC_ALL, "") != NULL)
     {
       name = gl_locale_name_posix (LC_CTYPE, "LC_CTYPE");
+#if defined _WIN32 && !defined __CYGWIN__
+      ASSERT (strcmp (name, "de_DE") == 0 || strcmp (name, "de_DE.UTF-8") == 0);
+#else
       ASSERT (strcmp (name, "de_DE.UTF-8") == 0);
+#endif
       name = gl_locale_name_posix (LC_MESSAGES, "LC_MESSAGES");
       ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
     }
@@ -592,7 +639,7 @@ test_locale_name_posix (void)
       ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
     }
 
-#if HAVE_NEWLOCALE
+#if HAVE_GOOD_USELOCALE
   /* Check that gl_locale_name_posix ignores the thread locale.  */
   {
     locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
@@ -621,7 +668,7 @@ test_locale_name_environ (void)
 
   /* Get into a defined state,  */
   setlocale (LC_ALL, "en_US.UTF-8");
-#if HAVE_NEWLOCALE
+#if HAVE_GOOD_USELOCALE
   uselocale (LC_GLOBAL_LOCALE);
 #endif
 
@@ -706,7 +753,7 @@ test_locale_name_environ (void)
   name = gl_locale_name_environ (LC_MESSAGES, "LC_MESSAGES");
   ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
 
-#if HAVE_NEWLOCALE
+#if HAVE_GOOD_USELOCALE
   /* Check that gl_locale_name_environ ignores the thread locale.  */
   {
     locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
@@ -737,11 +784,11 @@ test_locale_name_default (void)
 
   /* Only Mac OS X and Windows have a facility for the user to set the default
      locale.  */
-#if !((defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __WIN32__ || defined __CYGWIN__))
+#if !((defined __APPLE__ && defined __MACH__) || (defined _WIN32 || defined __CYGWIN__))
   ASSERT (strcmp (name, "C") == 0);
 #endif
 
-#if HAVE_NEWLOCALE
+#if HAVE_GOOD_USELOCALE
   /* Check that gl_locale_name_default ignores the thread locale.  */
   {
     locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
index f748435..9f531d8 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of lseek() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake, 2007.  */
 
index 47237b5..ff206c6 100755 (executable)
@@ -5,14 +5,14 @@ trap 'rm -fr $tmpfiles' 1 2 3 15
 
 tmpfiles=t-lseek.tmp
 # seekable files
-./test-lseek${EXEEXT} 0 < "$srcdir/test-lseek.sh" > t-lseek.tmp || exit 1
+${CHECKER} ./test-lseek${EXEEXT} 0 < "$srcdir/test-lseek.sh" > t-lseek.tmp || exit 1
 
 # pipes
-echo hi | { ./test-lseek${EXEEXT} 1; echo $? > t-lseek.tmp; cat > /dev/null; } | cat
+echo hi | { ${CHECKER} ./test-lseek${EXEEXT} 1; echo $? > t-lseek.tmp; cat > /dev/null; } | cat
 test "`cat t-lseek.tmp`" = "0" || exit 1
 
 # closed descriptors
-./test-lseek${EXEEXT} 2 <&- >&- || exit 1
+${CHECKER} ./test-lseek${EXEEXT} 2 <&- >&- || exit 1
 
 rm -rf $tmpfiles
 exit 0
index 86ff465..b8481fb 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of lstat() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Simon Josefsson, 2008; and Eric Blake, 2009.  */
 
index 4eb9036..08803da 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of lstat() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Simon Josefsson, 2008; and Eric Blake, 2009.  */
 
@@ -31,12 +31,16 @@ test_lstat_func (int (*func) (char const *, struct stat *), bool print)
   /* Test for common directories.  */
   ASSERT (func (".", &st1) == 0);
   ASSERT (func ("./", &st2) == 0);
+#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES)
   ASSERT (SAME_INODE (st1, st2));
+#endif
   ASSERT (S_ISDIR (st1.st_mode));
   ASSERT (S_ISDIR (st2.st_mode));
   ASSERT (func ("/", &st1) == 0);
   ASSERT (func ("///", &st2) == 0);
+#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES)
   ASSERT (SAME_INODE (st1, st2));
+#endif
   ASSERT (S_ISDIR (st1.st_mode));
   ASSERT (S_ISDIR (st2.st_mode));
   ASSERT (func ("..", &st1) == 0);
@@ -85,7 +89,9 @@ test_lstat_func (int (*func) (char const *, struct stat *), bool print)
   ASSERT (stat (BASE "link1", &st2) == 0);
   ASSERT (S_ISDIR (st1.st_mode));
   ASSERT (S_ISDIR (st2.st_mode));
+#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES)
   ASSERT (SAME_INODE (st1, st2));
+#endif
 
   ASSERT (func (BASE "link2", &st1) == 0);
   ASSERT (S_ISLNK (st1.st_mode));
diff --git a/tests/test-malloc-gnu.c b/tests/test-malloc-gnu.c
new file mode 100644 (file)
index 0000000..0160c6c
--- /dev/null
@@ -0,0 +1,45 @@
+/* Test of malloc function.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdlib.h>
+
+#include <errno.h>
+#include <stdint.h>
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+  /* Check that malloc (0) is not a NULL pointer.  */
+  void *volatile p = malloc (0);
+  ASSERT (p != NULL);
+  free (p);
+
+  /* Check that malloc (n) fails when n exceeds PTRDIFF_MAX.  */
+  if (PTRDIFF_MAX < SIZE_MAX)
+    {
+      size_t one = argc != 12345;
+      p = malloc (PTRDIFF_MAX + one);
+      ASSERT (p == NULL);
+      ASSERT (errno == ENOMEM);
+    }
+
+  return 0;
+}
index e9ab83d..52d95a5 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of safe automatic memory allocation.
-   Copyright (C) 2005, 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2005.  */
 
@@ -25,7 +25,7 @@
 static void
 do_allocation (int n)
 {
-  void *ptr = malloca (n);
+  void *volatile ptr = malloca (n);
   freea (ptr);
   safe_alloca (n);
 }
index cc7378c..758cda2 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <math.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
@@ -163,6 +163,17 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::floor, double, (double));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::floorl, long double, (long double));
 #endif
 
+#if GNULIB_TEST_FMAF
+SIGNATURE_CHECK (GNULIB_NAMESPACE::fmaf, float, (float, float, float));
+#endif
+#if GNULIB_TEST_FMA
+SIGNATURE_CHECK (GNULIB_NAMESPACE::fma, double, (double, double, double));
+#endif
+#if GNULIB_TEST_FMAL
+SIGNATURE_CHECK (GNULIB_NAMESPACE::fmal, long double,
+                 (long double, long double, long double));
+#endif
+
 #if GNULIB_TEST_FMODF
 SIGNATURE_CHECK (GNULIB_NAMESPACE::fmodf, float, (float, float));
 #endif
@@ -221,6 +232,19 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::ldexpl, long double, (long double, int));
 
 //SIGNATURE_CHECK (GNULIB_NAMESPACE::lgamma, double, (double));
 
+#if GNULIB_TEST_LOGF
+SIGNATURE_CHECK (GNULIB_NAMESPACE::logf, float, (float));
+#endif
+#if GNULIB_TEST_LOG
+SIGNATURE_CHECK (GNULIB_NAMESPACE::log, double, (double));
+#endif
+#if GNULIB_TEST_LOGL
+SIGNATURE_CHECK (GNULIB_NAMESPACE::logl, long double, (long double));
+#endif
+
+#if GNULIB_TEST_LOG10F
+SIGNATURE_CHECK (GNULIB_NAMESPACE::log10f, float, (float));
+#endif
 #if GNULIB_TEST_LOG10
 SIGNATURE_CHECK (GNULIB_NAMESPACE::log10, double, (double));
 #endif
@@ -238,20 +262,6 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::log1p, double, (double));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::log1pl, long double, (long double));
 #endif
 
-#if GNULIB_TEST_LOGF
-SIGNATURE_CHECK (GNULIB_NAMESPACE::logf, float, (float));
-#endif
-#if GNULIB_TEST_LOG
-SIGNATURE_CHECK (GNULIB_NAMESPACE::log, double, (double));
-#endif
-#if GNULIB_TEST_LOGL
-SIGNATURE_CHECK (GNULIB_NAMESPACE::logl, long double, (long double));
-#endif
-
-#if GNULIB_TEST_LOG10F
-SIGNATURE_CHECK (GNULIB_NAMESPACE::log10f, float, (float));
-#endif
-
 #if GNULIB_TEST_LOG2F
 SIGNATURE_CHECK (GNULIB_NAMESPACE::log2f, float, (float));
 #endif
@@ -373,30 +383,30 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::truncl, long double, (long double));
 
 #if GNULIB_TEST_ISFINITE
 # ifdef isfinite
-#  error "isfinite should not be a macro in C++"
+#  warning "isfinite should not be a macro in C++"
 # endif
-REAL_FLOATING_CHECK (isfinite, int, (float), int, (double), int, (long double));
+REAL_FLOATING_CHECK (isfinite, bool, (float), bool, (double), bool, (long double));
 #endif
 
 #if GNULIB_TEST_ISINF
 # ifdef isinf
-#  error "isinf should not be a macro in C++"
+#  warning "isinf should not be a macro in C++"
 # endif
-REAL_FLOATING_CHECK (isinf, int, (float), int, (double), int, (long double));
+REAL_FLOATING_CHECK (isinf, bool, (float), bool, (double), bool, (long double));
 #endif
 
 #if GNULIB_TEST_ISNAN
 # ifdef isnan
-#  error "isnan should not be a macro in C++"
+#  warning "isnan should not be a macro in C++"
 # endif
-REAL_FLOATING_CHECK (isnan, int, (float), int, (double), int, (long double));
+REAL_FLOATING_CHECK (isnan, bool, (float), bool, (double), bool, (long double));
 #endif
 
 #if GNULIB_TEST_SIGNBIT
 # ifdef signbit
-#  error "signbit should not be a macro in C++"
+#  warning "signbit should not be a macro in C++"
 # endif
-REAL_FLOATING_CHECK (signbit, int, (float), int, (double), int, (long double));
+REAL_FLOATING_CHECK (signbit, bool, (float), bool, (double), bool, (long double));
 #endif
 
 
index d1b308c..794c41a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <math.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #define GNULIB_NAMESPACE gnulib
 #include <config.h>
index de73b31..f83fe34 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <math.h> substitute.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 3f12e44..fec9ead 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Test a CP1252 locale.
-./test-mbrtowc-w32${EXEEXT} French_France 1252
+${CHECKER} ./test-mbrtowc-w32${EXEEXT} French_France 1252
index 9e1a765..c55a0ec 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Test a CP1256 locale.
-./test-mbrtowc-w32${EXEEXT} "Arabic_Saudi Arabia" 1256
+${CHECKER} ./test-mbrtowc-w32${EXEEXT} "Arabic_Saudi Arabia" 1256
index 782c2d0..c49f4bd 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Test a CP932 locale.
-./test-mbrtowc-w32${EXEEXT} Japanese_Japan 932
+${CHECKER} ./test-mbrtowc-w32${EXEEXT} Japanese_Japan 932
index 0630f30..3e78615 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Test a CP950 locale.
-./test-mbrtowc-w32${EXEEXT} Chinese_Taiwan 950
+${CHECKER} ./test-mbrtowc-w32${EXEEXT} Chinese_Taiwan 950
index 7d7faa9..c6ba222 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Test a CP936 locale.
-./test-mbrtowc-w32${EXEEXT} Chinese_China 936
+${CHECKER} ./test-mbrtowc-w32${EXEEXT} Chinese_China 936
diff --git a/tests/test-mbrtowc-w32-6.sh b/tests/test-mbrtowc-w32-6.sh
new file mode 100755 (executable)
index 0000000..c2e8dfe
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a GB18030 locale.
+${CHECKER} ./test-mbrtowc-w32${EXEEXT} Chinese_China 54936
diff --git a/tests/test-mbrtowc-w32-7.sh b/tests/test-mbrtowc-w32-7.sh
new file mode 100755 (executable)
index 0000000..2c5d555
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test some UTF-8 locales.
+${CHECKER} ./test-mbrtowc-w32${EXEEXT} French_France Japanese_Japan Chinese_Taiwan Chinese_China 65001
index f637330..7de6959 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of multibyte character to wide character.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include <stdlib.h>
 #include <string.h>
 
+#include "localcharset.h"
 #include "macros.h"
 
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
 
 static int
 test_one_locale (const char *name, int codepage)
@@ -325,14 +326,12 @@ test_one_locale (const char *name, int codepage)
         memset (&state, '\0', sizeof (mbstate_t));
         wc = (wchar_t) 0xBADFACE;
         ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */
-        ASSERT (ret == (size_t)-1);
-        ASSERT (errno == EILSEQ);
+        ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || ret == (size_t)-2);
 
         memset (&state, '\0', sizeof (mbstate_t));
         wc = (wchar_t) 0xBADFACE;
         ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */
-        ASSERT (ret == (size_t)-1);
-        ASSERT (errno == EILSEQ);
+        ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || (ret == 2 && wc == 0x30FB));
       }
       return 0;
 
@@ -397,14 +396,12 @@ test_one_locale (const char *name, int codepage)
         memset (&state, '\0', sizeof (mbstate_t));
         wc = (wchar_t) 0xBADFACE;
         ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */
-        ASSERT (ret == (size_t)-1);
-        ASSERT (errno == EILSEQ);
+        ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || ret == (size_t)-2);
 
         memset (&state, '\0', sizeof (mbstate_t));
         wc = (wchar_t) 0xBADFACE;
         ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */
-        ASSERT (ret == (size_t)-1);
-        ASSERT (errno == EILSEQ);
+        ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || (ret == 2 && wc == '?'));
       }
       return 0;
 
@@ -469,19 +466,19 @@ test_one_locale (const char *name, int codepage)
         memset (&state, '\0', sizeof (mbstate_t));
         wc = (wchar_t) 0xBADFACE;
         ret = mbrtowc (&wc, "\377", 1, &state); /* 0xFF */
-        ASSERT (ret == (size_t)-1);
-        ASSERT (errno == EILSEQ);
+        ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || ret == (size_t)-2);
 
         memset (&state, '\0', sizeof (mbstate_t));
         wc = (wchar_t) 0xBADFACE;
         ret = mbrtowc (&wc, "\225\377", 2, &state); /* 0x95 0xFF */
-        ASSERT (ret == (size_t)-1);
-        ASSERT (errno == EILSEQ);
+        ASSERT ((ret == (size_t)-1 && errno == EILSEQ) || (ret == 2 && wc == '?'));
       }
       return 0;
 
     case 54936:
       /* Locale encoding is CP54936 = GB18030.  */
+      if (strcmp (locale_charset (), "GB18030") != 0)
+        return 77;
       {
         char input[] = "B\250\271\201\060\211\070er"; /* "Büßer" */
         memset (&state, '\0', sizeof (mbstate_t));
@@ -529,7 +526,7 @@ test_one_locale (const char *name, int codepage)
         ASSERT (ret == 1);
         ASSERT (wc == 'e');
         ASSERT (mbsinit (&state));
-        input[5] = '\0';
+        input[7] = '\0';
 
         wc = (wchar_t) 0xBADFACE;
         ret = mbrtowc (&wc, input + 8, 1, &state);
@@ -578,6 +575,8 @@ test_one_locale (const char *name, int codepage)
 
     case 65001:
       /* Locale encoding is CP65001 = UTF-8.  */
+      if (strcmp (locale_charset (), "UTF-8") != 0)
+        return 77;
       {
         char input[] = "B\303\274\303\237er"; /* "Büßer" */
         memset (&state, '\0', sizeof (mbstate_t));
index f7fed6a..404128b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of multibyte character to wide character.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
@@ -75,7 +75,7 @@ main (int argc, char *argv[])
         default:
           if (! (c && 1 < argc && argv[1][0] == '5'))
             break;
-          /* Fall through.  */
+          FALLTHROUGH;
         case '\t': case '\v': case '\f':
         case ' ': case '!': case '"': case '#': case '%':
         case '&': case '\'': case '(': case ')': case '*':
@@ -103,7 +103,15 @@ main (int argc, char *argv[])
           wc = (wchar_t) 0xBADFACE;
           ret = mbrtowc (&wc, buf, 1, &state);
           ASSERT (ret == 1);
-          ASSERT (wc == c);
+          if (c < 0x80)
+            /* c is an ASCII character.  */
+            ASSERT (wc == c);
+          else
+            /* argv[1] starts with '5', that is, we are testing the C or POSIX
+               locale.
+               On most platforms, the bytes 0x80..0xFF map to U+0080..U+00FF.
+               But on musl libc, the bytes 0x80..0xFF map to U+DF80..U+DFFF.  */
+            ASSERT (wc == (btowc (c) == 0xDF00 + c ? btowc (c) : c));
           ASSERT (mbsinit (&state));
           ret = mbrtowc (NULL, buf, 1, &state);
           ASSERT (ret == 1);
@@ -330,7 +338,7 @@ main (int argc, char *argv[])
           ASSERT (ret == 1);
           ASSERT (wc == 'e');
           ASSERT (mbsinit (&state));
-          input[5] = '\0';
+          input[7] = '\0';
 
           wc = (wchar_t) 0xBADFACE;
           ret = mbrtowc (&wc, input + 8, 1, &state);
index 3becba3..00b108b 100755 (executable)
@@ -12,4 +12,4 @@ if test $LOCALE_FR = none; then
 fi
 
 LC_ALL=$LOCALE_FR \
-./test-mbrtowc${EXEEXT} 1
+${CHECKER} ./test-mbrtowc${EXEEXT} 1
index 0405aba..5036930 100755 (executable)
@@ -12,4 +12,4 @@ if test $LOCALE_FR_UTF8 = none; then
 fi
 
 LC_ALL=$LOCALE_FR_UTF8 \
-./test-mbrtowc${EXEEXT} 2
+${CHECKER} ./test-mbrtowc${EXEEXT} 2
index 63a89a2..2773fa7 100755 (executable)
@@ -12,4 +12,4 @@ if test $LOCALE_JA = none; then
 fi
 
 LC_ALL=$LOCALE_JA \
-./test-mbrtowc${EXEEXT} 3
+${CHECKER} ./test-mbrtowc${EXEEXT} 3
index b299a2c..92f641c 100755 (executable)
@@ -12,4 +12,4 @@ if test $LOCALE_ZH_CN = none; then
 fi
 
 LC_ALL=$LOCALE_ZH_CN \
-./test-mbrtowc${EXEEXT} 4
+${CHECKER} ./test-mbrtowc${EXEEXT} 4
index c10b228..490496d 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Test whether the POSIX locale has encoding errors.
 LC_ALL=C \
-./test-mbrtowc${EXEEXT} 5 || exit
+${CHECKER} ./test-mbrtowc${EXEEXT} 5 || exit
 LC_ALL=POSIX \
-./test-mbrtowc${EXEEXT} 5
+${CHECKER} ./test-mbrtowc${EXEEXT} 5
index 8cd1c4d..bda3a3b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of test for initial conversion state.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
index bbda48d..7308714 100755 (executable)
@@ -12,4 +12,4 @@ if test $LOCALE_FR_UTF8 = none; then
 fi
 
 LC_ALL=$LOCALE_FR_UTF8 \
-./test-mbsinit${EXEEXT}
+${CHECKER} ./test-mbsinit${EXEEXT}
diff --git a/tests/test-mbsstr1.c b/tests/test-mbsstr1.c
new file mode 100644 (file)
index 0000000..a34cfe6
--- /dev/null
@@ -0,0 +1,128 @@
+/* Test of searching in a string.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <stdlib.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+  /* This test is executed in the C locale.  */
+
+  {
+    const char input[] = "foo";
+    const char *result = mbsstr (input, "");
+    ASSERT (result == input);
+  }
+
+  {
+    const char input[] = "foo";
+    const char *result = mbsstr (input, "o");
+    ASSERT (result == input + 1);
+  }
+
+  {
+    const char input[] = "ABC ABCDAB ABCDABCDABDE";
+    const char *result = mbsstr (input, "ABCDABD");
+    ASSERT (result == input + 15);
+  }
+
+  {
+    const char input[] = "ABC ABCDAB ABCDABCDABDE";
+    const char *result = mbsstr (input, "ABCDABE");
+    ASSERT (result == NULL);
+  }
+
+  /* Check that a very long haystack is handled quickly if the needle is
+     short and occurs near the beginning.  */
+  {
+    size_t repeat = 10000;
+    size_t m = 1000000;
+    const char *needle =
+      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
+    char *haystack = (char *) malloc (m + 1);
+    if (haystack != NULL)
+      {
+        memset (haystack, 'A', m);
+        haystack[0] = 'B';
+        haystack[m] = '\0';
+
+        for (; repeat > 0; repeat--)
+          {
+            ASSERT (mbsstr (haystack, needle) == haystack + 1);
+          }
+
+        free (haystack);
+      }
+  }
+
+  /* Check that a very long needle is discarded quickly if the haystack is
+     short.  */
+  {
+    size_t repeat = 10000;
+    size_t m = 1000000;
+    const char *haystack =
+      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+      "ABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABABAB";
+    char *needle = (char *) malloc (m + 1);
+    if (needle != NULL)
+      {
+        memset (needle, 'A', m);
+        needle[m] = '\0';
+
+        for (; repeat > 0; repeat--)
+          {
+            ASSERT (mbsstr (haystack, needle) == NULL);
+          }
+
+        free (needle);
+      }
+  }
+
+  /* Check that the asymptotic worst-case complexity is not quadratic.  */
+  {
+    size_t m = 1000000;
+    char *haystack = (char *) malloc (2 * m + 2);
+    char *needle = (char *) malloc (m + 2);
+    if (haystack != NULL && needle != NULL)
+      {
+        const char *result;
+
+        memset (haystack, 'A', 2 * m);
+        haystack[2 * m] = 'B';
+        haystack[2 * m + 1] = '\0';
+
+        memset (needle, 'A', m);
+        needle[m] = 'B';
+        needle[m + 1] = '\0';
+
+        result = mbsstr (haystack, needle);
+        ASSERT (result == haystack + m);
+      }
+    free (needle);
+    free (haystack);
+  }
+
+  return 0;
+}
diff --git a/tests/test-mbsstr2.c b/tests/test-mbsstr2.c
new file mode 100644 (file)
index 0000000..6727358
--- /dev/null
@@ -0,0 +1,141 @@
+/* Test of searching in a string.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <locale.h>
+#include <stdlib.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+  /* configure should already have checked that the locale is supported.  */
+  if (setlocale (LC_ALL, "") == NULL)
+    return 1;
+
+  {
+    const char input[] = "f\303\266\303\266";
+    const char *result = mbsstr (input, "");
+    ASSERT (result == input);
+  }
+
+  {
+    const char input[] = "f\303\266\303\266";
+    const char *result = mbsstr (input, "\303\266");
+    ASSERT (result == input + 1);
+  }
+
+  {
+    const char input[] = "f\303\266\303\266";
+    const char *result = mbsstr (input, "\266\303");
+    ASSERT (result == NULL);
+  }
+
+  {
+    const char input[] = "\303\204BC \303\204BCD\303\204B \303\204BCD\303\204BCD\303\204BDE"; /* "ÄBC ÄBCDÄB ÄBCDÄBCDÄBDE" */
+    const char *result = mbsstr (input, "\303\204BCD\303\204BD"); /* "ÄBCDÄBD" */
+    ASSERT (result == input + 19);
+  }
+
+  {
+    const char input[] = "\303\204BC \303\204BCD\303\204B \303\204BCD\303\204BCD\303\204BDE"; /* "ÄBC ÄBCDÄB ÄBCDÄBCDÄBDE" */
+    const char *result = mbsstr (input, "\303\204BCD\303\204BE"); /* "ÄBCDÄBE" */
+    ASSERT (result == NULL);
+  }
+
+  /* Check that a very long haystack is handled quickly if the needle is
+     short and occurs near the beginning.  */
+  {
+    size_t repeat = 10000;
+    size_t m = 1000000;
+    const char *needle =
+      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
+    char *haystack = (char *) malloc (m + 1);
+    if (haystack != NULL)
+      {
+        memset (haystack, 'A', m);
+        haystack[0] = '\303'; haystack[1] = '\204';
+        haystack[m] = '\0';
+
+        for (; repeat > 0; repeat--)
+          {
+            ASSERT (mbsstr (haystack, needle) == haystack + 2);
+          }
+
+        free (haystack);
+      }
+  }
+
+  /* Check that a very long needle is discarded quickly if the haystack is
+     short.  */
+  {
+    size_t repeat = 10000;
+    size_t m = 1000000;
+    const char *haystack =
+      "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+      "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"
+      "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"
+      "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"
+      "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207"
+      "A\303\207A\303\207A\303\207A\303\207A\303\207A\303\207";
+    char *needle = (char *) malloc (m + 1);
+    if (needle != NULL)
+      {
+        memset (needle, 'A', m);
+        needle[m] = '\0';
+
+        for (; repeat > 0; repeat--)
+          {
+            ASSERT (mbsstr (haystack, needle) == NULL);
+          }
+
+        free (needle);
+      }
+  }
+
+  /* Check that the asymptotic worst-case complexity is not quadratic.  */
+  {
+    size_t m = 1000000;
+    char *haystack = (char *) malloc (2 * m + 3);
+    char *needle = (char *) malloc (m + 3);
+    if (haystack != NULL && needle != NULL)
+      {
+        const char *result;
+
+        memset (haystack, 'A', 2 * m);
+        haystack[2 * m] = '\303'; haystack[2 * m + 1] = '\207';
+        haystack[2 * m + 2] = '\0';
+
+        memset (needle, 'A', m);
+        needle[m] = '\303'; needle[m + 1] = '\207';
+        needle[m + 2] = '\0';
+
+        result = mbsstr (haystack, needle);
+        ASSERT (result == haystack + m);
+      }
+    free (needle);
+    free (haystack);
+  }
+
+  return 0;
+}
diff --git a/tests/test-mbsstr2.sh b/tests/test-mbsstr2.sh
new file mode 100755 (executable)
index 0000000..5ef7139
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific UTF-8 locale is installed.
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR_UTF8 = none; then
+  if test -f /usr/bin/localedef; then
+    echo "Skipping test: no french Unicode locale is installed"
+  else
+    echo "Skipping test: no french Unicode locale is supported"
+  fi
+  exit 77
+fi
+
+LC_ALL=$LOCALE_FR_UTF8 \
+${CHECKER} ./test-mbsstr2${EXEEXT}
diff --git a/tests/test-mbsstr3.c b/tests/test-mbsstr3.c
new file mode 100644 (file)
index 0000000..91834df
--- /dev/null
@@ -0,0 +1,81 @@
+/* Test of searching in a string.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <string.h>
+
+#include <locale.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+  /* configure should already have checked that the locale is supported.  */
+  if (setlocale (LC_ALL, "") == NULL)
+    return 1;
+
+  /* Tests with a character < 0x30.  */
+  {
+    const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */
+    const char *result = mbsstr (input, " ");
+    ASSERT (result == input + 4);
+  }
+
+  {
+    const char input[] = "\312\276\300\375"; /* "示例" */
+    const char *result = mbsstr (input, " ");
+    ASSERT (result == NULL);
+  }
+
+  /* Tests with a character >= 0x30.  */
+  {
+    const char input[] = "\272\305123\324\313\320\320\241\243"; /* "号123运行。" */
+    const char *result = mbsstr (input, "2");
+    ASSERT (result == input + 3);
+  }
+
+  /* The following tests show how mbsstr() is different from strstr().  */
+
+  {
+    const char input[] = "\313\320\320\320"; /* "诵行" */
+    const char *result = mbsstr (input, "\320\320"); /* "行" */
+    ASSERT (result == input + 2);
+  }
+
+  {
+    const char input[] = "\203\062\332\066123\324\313\320\320\241\243"; /* "씋123运行。" */
+    const char *result = mbsstr (input, "2");
+    ASSERT (result == input + 5);
+  }
+
+  {
+    const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */
+    const char *result = mbsstr (input, "\276\300"); /* "纠" */
+    ASSERT (result == NULL);
+  }
+
+  {
+    const char input[] = "\312\276\300\375 \312\276\300\375 \312\276\300\375"; /* "示例 示例 示例" */
+    const char *result = mbsstr (input, "\375 "); /* invalid multibyte sequence */
+    ASSERT (result == NULL);
+  }
+
+  return 0;
+}
diff --git a/tests/test-mbsstr3.sh b/tests/test-mbsstr3.sh
new file mode 100755 (executable)
index 0000000..539f9c0
--- /dev/null
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Test whether a specific GB18030 locale is installed.
+: ${LOCALE_ZH_CN=zh_CN.GB18030}
+if test $LOCALE_ZH_CN = none; then
+  if test -f /usr/bin/localedef; then
+    echo "Skipping test: no chinese GB18030 locale is installed"
+  else
+    echo "Skipping test: no chinese GB18030 locale is supported"
+  fi
+  exit 77
+fi
+
+LC_ALL=$LOCALE_ZH_CN \
+${CHECKER} ./test-mbsstr3${EXEEXT}
index 1526ed2..1357d08 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2021 Free Software Foundation, Inc.
  * Written by Eric Blake and Bruno Haible
  *
  * This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -49,7 +49,12 @@ main (void)
   ASSERT (MEMCHR (input, 'a', n) == input);
 
   ASSERT (MEMCHR (input, 'a', 0) == NULL);
-  ASSERT (MEMCHR (zerosize_ptr (), 'a', 0) == NULL);
+
+  {
+    void *page_boundary = zerosize_ptr ();
+    if (page_boundary)
+      ASSERT (MEMCHR (page_boundary, 'a', 0) == NULL);
+  }
 
   ASSERT (MEMCHR (input, 'b', n) == input + 1);
   ASSERT (MEMCHR (input, 'c', n) == input + 2);
@@ -88,7 +93,7 @@ main (void)
 
   /* Check that memchr() does not read past the first occurrence of the
      byte being searched.  See the Austin Group's clarification
-     <http://www.opengroup.org/austin/docs/austin_454.txt>.
+     <https://www.opengroup.org/austin/docs/austin_454.txt>.
      Test both '\0' and something else, since some implementations
      special-case searching for NUL.
   */
index 14bd570..abaa18e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2021 Free Software Foundation, Inc.
  * Written by Eric Blake
  *
  * This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -48,7 +48,9 @@ main (void)
   ASSERT (MEMCHR2 (input, 'b', 'a', n) == input);
 
   ASSERT (MEMCHR2 (input, 'a', 'b', 0) == NULL);
-  ASSERT (MEMCHR2 (zerosize_ptr (), 'a', 'b', 0) == NULL);
+  void *page_boundary = zerosize_ptr ();
+  if (page_boundary)
+    ASSERT (MEMCHR2 (page_boundary, 'a', 'b', 0) == NULL);
 
   ASSERT (MEMCHR2 (input, 'b', 'd', n) == input + 1);
   ASSERT (MEMCHR2 (input + 2, 'b', 'd', n - 2) == input + 1026);
diff --git a/tests/test-memrchr.c b/tests/test-memrchr.c
new file mode 100644 (file)
index 0000000..24719ff
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2008-2021 Free Software Foundation, Inc.
+ * Written by Eric Blake and Bruno Haible
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (memrchr, void *, (void const *, int, size_t));
+
+#include <stdlib.h>
+
+#include "zerosize-ptr.h"
+#include "macros.h"
+
+/* Calculating void * + int is not portable, so this wrapper converts
+   to char * to make the tests easier to write.  */
+#define MEMRCHR (char *) memrchr
+
+int
+main (void)
+{
+  size_t n = 0x100000;
+  char *input = malloc (n);
+  ASSERT (input);
+
+  input[n - 1] = 'a';
+  input[n - 2] = 'b';
+  memset (input + n - 1026, 'c', 1024);
+  memset (input + 2, 'd', n - 1028);
+  input[1] = 'e';
+  input[0] = 'a';
+
+  /* Basic behavior tests.  */
+  ASSERT (MEMRCHR (input, 'a', n) == input + n - 1);
+
+  ASSERT (MEMRCHR (input, 'a', 0) == NULL);
+  void *page_boundary = zerosize_ptr ();
+  if (page_boundary)
+    ASSERT (MEMRCHR (page_boundary, 'a', 0) == NULL);
+
+  ASSERT (MEMRCHR (input, 'b', n) == input + n - 2);
+  ASSERT (MEMRCHR (input, 'c', n) == input + n - 3);
+  ASSERT (MEMRCHR (input, 'd', n) == input + n - 1027);
+
+  ASSERT (MEMRCHR (input, 'a', n - 1) == input);
+  ASSERT (MEMRCHR (input, 'e', n - 1) == input + 1);
+
+  ASSERT (MEMRCHR (input, 'f', n) == NULL);
+  ASSERT (MEMRCHR (input, '\0', n) == NULL);
+
+  /* Check that a very long haystack is handled quickly if the byte is
+     found near the end.  */
+  {
+    size_t repeat = 10000;
+    for (; repeat > 0; repeat--)
+      {
+        ASSERT (MEMRCHR (input, 'c', n) == input + n - 3);
+      }
+  }
+
+  /* Alignment tests.  */
+  {
+    int i, j;
+    for (i = 0; i < 32; i++)
+      {
+        for (j = 0; j < 256; j++)
+          input[i + j] = j;
+        for (j = 0; j < 256; j++)
+          {
+            ASSERT (MEMRCHR (input + i, j, 256) == input + i + j);
+          }
+      }
+  }
+
+  free (input);
+
+  return 0;
+}
diff --git a/tests/test-mkdir.c b/tests/test-mkdir.c
new file mode 100644 (file)
index 0000000..ab65cb8
--- /dev/null
@@ -0,0 +1,47 @@
+/* Tests of mkdir.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009.  */
+
+#include <config.h>
+
+#include <sys/stat.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (mkdir, int, (char const *, mode_t));
+
+#include <fcntl.h>
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "ignore-value.h"
+#include "macros.h"
+
+#define BASE "test-mkdir.t"
+
+#include "test-mkdir.h"
+
+int
+main (void)
+{
+  /* Clean up any trash from prior testsuite runs.  */
+  ignore_value (system ("rm -rf " BASE "*"));
+
+  return test_mkdir (mkdir, true);
+}
diff --git a/tests/test-mkdir.h b/tests/test-mkdir.h
new file mode 100644 (file)
index 0000000..204f522
--- /dev/null
@@ -0,0 +1,98 @@
+/* Test of mkdir() function.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* This file is designed to test both mkdir(a,b) and
+   mkdirat(AT_FDCWD,a,b).  FUNC is the function to test.  Assumes that
+   BASE and ASSERT are already defined, and that appropriate headers
+   are already included.  If PRINT, warn before skipping tests with
+   status 77 when symlinks are unsupported.  */
+
+static int
+test_mkdir (int (*func) (char const *, mode_t), bool print)
+{
+  /* Test basic error handling.  */
+  ASSERT (close (creat (BASE "file", 0600)) == 0);
+  errno = 0;
+  ASSERT (func (BASE "file", 0700) == -1);
+  ASSERT (errno == EEXIST);
+  errno = 0;
+  ASSERT (func (BASE "file/", 0700) == -1);
+  ASSERT (errno == ENOTDIR || errno == EEXIST);
+  errno = 0;
+  ASSERT (func (BASE "file/dir", 0700) == -1);
+  ASSERT (errno == ENOTDIR || errno == ENOENT || errno == EOPNOTSUPP);
+  ASSERT (unlink (BASE "file") == 0);
+  errno = 0;
+  ASSERT (func ("", 0700) == -1);
+  ASSERT (errno == ENOENT);
+  errno = 0;
+  ASSERT (func (BASE "dir/sub", 0700) == -1);
+  ASSERT (errno == ENOENT);
+  errno = 0;
+  ASSERT (func (BASE "dir/.", 0700) == -1);
+  ASSERT (errno == ENOENT);
+  errno = 0;
+  ASSERT (func (BASE "dir/.//", 0700) == -1);
+  ASSERT (errno == ENOENT);
+
+  /* Test trailing slash handling.  */
+  ASSERT (func (BASE "dir", 0700) == 0);
+  errno = 0;
+  ASSERT (func (BASE "dir", 0700) == -1);
+  ASSERT (errno == EEXIST);
+  ASSERT (rmdir (BASE "dir") == 0);
+  ASSERT (func (BASE "dir/", 0700) == 0);
+  errno = 0;
+  ASSERT (func (BASE "dir/", 0700) == -1);
+  ASSERT (errno == EEXIST);
+  ASSERT (rmdir (BASE "dir") == 0);
+
+  /* Test symlink behavior.  POSIX requires the creation of
+     directories through a dangling symlink with trailing slash, but
+     GNU does not yet implement that, so we support either behavior
+     for now.  */
+  if (symlink (BASE "dir", BASE "link"))
+    {
+      if (print)
+        fputs ("skipping test: symlinks not supported on this file system\n",
+               stderr);
+      return 77;
+    }
+  errno = 0;
+  ASSERT (func (BASE "link", 0700) == -1);
+  ASSERT (errno == EEXIST);
+  {
+    int result;
+    errno = 0;
+    result = func (BASE "link/", 0700);
+    if (!result)
+      ASSERT (rmdir (BASE "dir") == 0);
+    else
+      {
+        ASSERT (result == -1);
+        ASSERT (errno == EEXIST);
+        errno = 0;
+        ASSERT (rmdir (BASE "dir") == -1);
+        ASSERT (errno == ENOENT);
+      }
+  }
+  errno = 0;
+  ASSERT (func (BASE "link/.", 0700) == -1);
+  ASSERT (errno == ENOENT);
+  ASSERT (unlink (BASE "link") == 0);
+
+  return 0;
+}
diff --git a/tests/test-nanosleep.c b/tests/test-nanosleep.c
new file mode 100644 (file)
index 0000000..4464006
--- /dev/null
@@ -0,0 +1,83 @@
+/* Test of nanosleep() function.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009.  */
+
+#include <config.h>
+
+#include <time.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (nanosleep, int, (struct timespec const *, struct timespec *));
+
+#include <errno.h>
+#include <signal.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#if HAVE_DECL_ALARM
+static void
+handle_alarm (int sig)
+{
+  if (sig != SIGALRM)
+    _exit (1);
+}
+#endif
+
+int
+main (void)
+{
+  struct timespec ts;
+
+  ts.tv_sec = 1000;
+  ts.tv_nsec = -1;
+  errno = 0;
+  ASSERT (nanosleep (&ts, NULL) == -1);
+  ASSERT (errno == EINVAL);
+  ts.tv_nsec = 1000000000;
+  errno = 0;
+  ASSERT (nanosleep (&ts, NULL) == -1);
+  ASSERT (errno == EINVAL);
+
+  ts.tv_sec = 0;
+  ts.tv_nsec = 1;
+  ASSERT (nanosleep (&ts, &ts) == 0);
+  /* Remaining time is only defined on EINTR failure; but on success,
+     it is typically either 0 or unchanged from input.  At any rate,
+     it shouldn't be randomly changed to unrelated values.  */
+  ASSERT (ts.tv_sec == 0);
+  ASSERT (ts.tv_nsec == 0 || ts.tv_nsec == 1);
+  ts.tv_nsec = 0;
+  ASSERT (nanosleep (&ts, NULL) == 0);
+
+#if HAVE_DECL_ALARM
+  {
+    const time_t pentecost = 50 * 24 * 60 * 60; /* 50 days.  */
+    signal (SIGALRM, handle_alarm);
+    alarm (1);
+    ts.tv_sec = pentecost;
+    ts.tv_nsec = 999999999;
+    errno = 0;
+    ASSERT (nanosleep (&ts, &ts) == -1);
+    ASSERT (errno == EINTR);
+    ASSERT (pentecost - 10 < ts.tv_sec && ts.tv_sec <= pentecost);
+    ASSERT (0 <= ts.tv_nsec && ts.tv_nsec <= 999999999);
+  }
+#endif
+
+  return 0;
+}
diff --git a/tests/test-netinet_in.c b/tests/test-netinet_in.c
new file mode 100644 (file)
index 0000000..c0de97f
--- /dev/null
@@ -0,0 +1,27 @@
+/* Test of <netinet/in.h> substitute.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <netinet/in.h>
+
+int
+main (void)
+{
+  return 0;
+}
diff --git a/tests/test-nl_langinfo-mt.c b/tests/test-nl_langinfo-mt.c
new file mode 100644 (file)
index 0000000..5ff6490
--- /dev/null
@@ -0,0 +1,253 @@
+/* Multithread-safety test for nl_langinfo().
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+/* Work around GCC bug 44511.  */
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+# pragma GCC diagnostic ignored "-Wreturn-type"
+#endif
+
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+
+/* Specification.  */
+#include <langinfo.h>
+
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "glthread/thread.h"
+
+
+/* Some common locale names.  */
+
+#if defined _WIN32 && !defined __CYGWIN__
+# define ENGLISH "English_United States"
+# define FRENCH  "French_France"
+# define GERMAN  "German_Germany"
+# define ENCODING ".1252"
+#else
+# define ENGLISH "en_US"
+# define FRENCH  "fr_FR"
+# define GERMAN  "de_DE"
+# if defined __sgi
+#  define ENCODING ".ISO8859-15"
+# elif defined __hpux
+#  define ENCODING ".utf8"
+# else
+#  define ENCODING ".UTF-8"
+# endif
+#endif
+
+static const char LOCALE1[] = ENGLISH ENCODING;
+static const char LOCALE2[] = FRENCH ENCODING;
+static const char LOCALE3[] = GERMAN ENCODING;
+
+static char *expected1;
+
+static void *
+thread1_func (void *arg)
+{
+  for (;;)
+    {
+      const char *value = nl_langinfo (CODESET);
+      if (strcmp (expected1, value) != 0)
+        {
+          fprintf (stderr, "thread1 disturbed by threadN!\n"); fflush (stderr);
+          abort ();
+        }
+    }
+
+  /*NOTREACHED*/
+}
+
+static char *expected2;
+
+static void *
+thread2_func (void *arg)
+{
+  for (;;)
+    {
+      const char *value = nl_langinfo (PM_STR);
+      if (strcmp (expected2, value) != 0)
+        {
+          fprintf (stderr, "thread2 disturbed by threadN!\n"); fflush (stderr);
+          abort ();
+        }
+    }
+
+  /*NOTREACHED*/
+}
+
+static char *expected3;
+
+static void *
+thread3_func (void *arg)
+{
+  for (;;)
+    {
+      const char *value = nl_langinfo (DAY_2);
+      if (strcmp (expected3, value) != 0)
+        {
+          fprintf (stderr, "thread3 disturbed by threadN!\n"); fflush (stderr);
+          abort ();
+        }
+    }
+
+  /*NOTREACHED*/
+}
+
+static char *expected4;
+
+static void *
+thread4_func (void *arg)
+{
+  for (;;)
+    {
+      const char *value = nl_langinfo (ALTMON_2);
+      if (strcmp (expected4, value) != 0)
+        {
+          fprintf (stderr, "thread4 disturbed by threadN!\n"); fflush (stderr);
+          abort ();
+        }
+    }
+
+  /*NOTREACHED*/
+}
+
+static char *expected5;
+
+static void *
+thread5_func (void *arg)
+{
+  for (;;)
+    {
+      const char *value = nl_langinfo (CRNCYSTR);
+      if (strcmp (expected5, value) != 0)
+        {
+          fprintf (stderr, "thread5 disturbed by threadN!\n"); fflush (stderr);
+          abort ();
+        }
+    }
+
+  /*NOTREACHED*/
+}
+
+static char *expected6;
+
+static void *
+thread6_func (void *arg)
+{
+  for (;;)
+    {
+      const char *value = nl_langinfo (RADIXCHAR);
+      if (strcmp (expected6, value) != 0)
+        {
+          fprintf (stderr, "thread6 disturbed by threadN!\n"); fflush (stderr);
+          abort ();
+        }
+    }
+
+  /*NOTREACHED*/
+}
+
+static void *
+threadN_func (void *arg)
+{
+  for (;;)
+    {
+      nl_langinfo (CODESET);   /* LC_CTYPE */    /* locale charmap */
+      nl_langinfo (AM_STR);    /* LC_TIME */     /* locale -k am_pm */
+      nl_langinfo (PM_STR);    /* LC_TIME */     /* locale -k am_pm */
+      nl_langinfo (DAY_2);     /* LC_TIME */     /* locale -k day */
+      nl_langinfo (DAY_5);     /* LC_TIME */     /* locale -k day */
+      nl_langinfo (ALTMON_2);  /* LC_TIME */     /* locale -k alt_mon */
+      nl_langinfo (ALTMON_9);  /* LC_TIME */     /* locale -k alt_mon */
+      nl_langinfo (CRNCYSTR);  /* LC_MONETARY */ /* locale -k currency_symbol */
+      nl_langinfo (RADIXCHAR); /* LC_NUMERIC */  /* locale -k decimal_point */
+      nl_langinfo (THOUSEP);   /* LC_NUMERIC */  /* locale -k thousands_sep */
+    }
+
+  /*NOTREACHED*/
+}
+
+int
+main (int argc, char *argv[])
+{
+  if (setlocale (LC_ALL, LOCALE1) == NULL)
+    {
+      fprintf (stderr, "Skipping test: LOCALE1 not recognized\n");
+      return 77;
+    }
+  if (setlocale (LC_MONETARY, LOCALE2) == NULL)
+    {
+      fprintf (stderr, "Skipping test: LOCALE2 not recognized\n");
+      return 77;
+    }
+  if (setlocale (LC_NUMERIC, LOCALE3) == NULL)
+    {
+      fprintf (stderr, "Skipping test: LOCALE3 not recognized\n");
+      return 77;
+    }
+
+  expected1 = strdup (nl_langinfo (CODESET));
+  expected2 = strdup (nl_langinfo (PM_STR));
+  expected3 = strdup (nl_langinfo (DAY_2));
+  expected4 = strdup (nl_langinfo (ALTMON_2));
+  expected5 = strdup (nl_langinfo (CRNCYSTR));
+  expected6 = strdup (nl_langinfo (RADIXCHAR));
+
+  /* Create the checker threads.  */
+  gl_thread_create (thread1_func, NULL);
+  gl_thread_create (thread2_func, NULL);
+  gl_thread_create (thread3_func, NULL);
+  gl_thread_create (thread4_func, NULL);
+  gl_thread_create (thread5_func, NULL);
+  gl_thread_create (thread6_func, NULL);
+  /* Create the disturber thread.  */
+  gl_thread_create (threadN_func, NULL);
+
+  /* Let them run for 2 seconds.  */
+  {
+    struct timespec duration;
+    duration.tv_sec = (argc > 1 ? atoi (argv[1]) : 2);
+    duration.tv_nsec = 0;
+
+    nanosleep (&duration, NULL);
+  }
+
+  return 0;
+}
+
+#else
+
+/* No multithreading available.  */
+
+#include <stdio.h>
+
+int
+main ()
+{
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+}
+
+#endif
index 3a8fa8f..def628b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of nl_langinfo replacement.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2009.  */
 
@@ -92,6 +92,32 @@ main (int argc, char *argv[])
   ASSERT (strlen (nl_langinfo (MON_10)) > 0);
   ASSERT (strlen (nl_langinfo (MON_11)) > 0);
   ASSERT (strlen (nl_langinfo (MON_12)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_1)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_2)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_3)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_4)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_5)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_6)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_7)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_8)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_9)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_10)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_11)) > 0);
+  ASSERT (strlen (nl_langinfo (ALTMON_12)) > 0);
+  /* In the tested locales, alternate month names and month names ought to be
+     the same.  */
+  ASSERT (strcmp (nl_langinfo (ALTMON_1), nl_langinfo (MON_1)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_2), nl_langinfo (MON_2)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_3), nl_langinfo (MON_3)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_4), nl_langinfo (MON_4)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_5), nl_langinfo (MON_5)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_6), nl_langinfo (MON_6)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_7), nl_langinfo (MON_7)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_8), nl_langinfo (MON_8)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_9), nl_langinfo (MON_9)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_10), nl_langinfo (MON_10)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_11), nl_langinfo (MON_11)) == 0);
+  ASSERT (strcmp (nl_langinfo (ALTMON_12), nl_langinfo (MON_12)) == 0);
   ASSERT (strlen (nl_langinfo (ABMON_1)) > 0);
   ASSERT (strlen (nl_langinfo (ABMON_2)) > 0);
   ASSERT (strlen (nl_langinfo (ABMON_3)) > 0);
index 3168f42..b1ce46c 100755 (executable)
@@ -1,17 +1,17 @@
 #!/bin/sh
 
-LC_ALL=C ./test-nl_langinfo${EXEEXT} 0 || exit 1
+LC_ALL=C ${CHECKER} ./test-nl_langinfo${EXEEXT} 0 || exit 1
 
 # Test whether a specific traditional locale is installed.
 : ${LOCALE_FR=fr_FR}
 if test $LOCALE_FR != none; then
-  LC_ALL=$LOCALE_FR ./test-nl_langinfo${EXEEXT} 1 || exit 1
+  LC_ALL=$LOCALE_FR ${CHECKER} ./test-nl_langinfo${EXEEXT} 1 || exit 1
 fi
 
 # Test whether a specific UTF-8 locale is installed.
 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
 if test $LOCALE_FR_UTF8 != none; then
-  LC_ALL=$LOCALE_FR_UTF8 ./test-nl_langinfo${EXEEXT} 2 || exit 1
+  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-nl_langinfo${EXEEXT} 2 || exit 1
 fi
 
 exit 0
index d9e2e27..1524af4 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of opening a file descriptor.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index faaff0f..9ceb798 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of opening a file descriptor.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -37,8 +37,11 @@ static ALWAYS_INLINE int
 test_open (int (*func) (char const *, int, ...), bool print)
 {
   int fd;
+
   /* Remove anything from prior partial run.  */
   unlink (BASE "file");
+  unlink (BASE "e.exe");
+  unlink (BASE "link");
 
   /* Cannot create directory.  */
   errno = 0;
@@ -51,6 +54,11 @@ test_open (int (*func) (char const *, int, ...), bool print)
   ASSERT (0 <= fd);
   ASSERT (close (fd) == 0);
 
+  /* Create an executable regular file.  */
+  fd = func (BASE "e.exe", O_CREAT | O_RDONLY, 0700);
+  ASSERT (0 <= fd);
+  ASSERT (close (fd) == 0);
+
   /* Trailing slash handling.  */
   errno = 0;
   ASSERT (func (BASE "file/", O_RDONLY) == -1);
@@ -80,6 +88,26 @@ test_open (int (*func) (char const *, int, ...), bool print)
   ASSERT (0 <= fd);
   ASSERT (close (fd) == 0);
 
+  /* O_CLOEXEC must be honoured.  */
+  if (O_CLOEXEC)
+    {
+      /* Since the O_CLOEXEC handling goes through a special code path at its
+         first invocation, test it twice.  */
+      int i;
+
+      for (i = 0; i < 2; i++)
+        {
+          int flags;
+
+          fd = func (BASE "file", O_CLOEXEC | O_RDONLY);
+          ASSERT (0 <= fd);
+          flags = fcntl (fd, F_GETFD);
+          ASSERT (flags >= 0);
+          ASSERT ((flags & FD_CLOEXEC) != 0);
+          ASSERT (close (fd) == 0);
+        }
+    }
+
   /* Symlink handling, where supported.  */
   if (symlink (BASE "file", BASE "link") != 0)
     {
@@ -98,6 +126,7 @@ test_open (int (*func) (char const *, int, ...), bool print)
 
   /* Cleanup.  */
   ASSERT (unlink (BASE "file") == 0);
+  ASSERT (unlink (BASE "e.exe") == 0);
   ASSERT (unlink (BASE "link") == 0);
 
   return 0;
diff --git a/tests/test-openat.c b/tests/test-openat.c
new file mode 100644 (file)
index 0000000..d876a77
--- /dev/null
@@ -0,0 +1,99 @@
+/* Test that openat works.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009.  */
+
+#include <config.h>
+
+#include <fcntl.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (openat, int, (int, char const *, int, ...));
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#define BASE "test-openat.t"
+
+#include "test-open.h"
+
+static int dfd = AT_FDCWD;
+
+/* Wrapper around openat to test open behavior.  */
+static int
+do_open (char const *name, int flags, ...)
+{
+  if (flags & O_CREAT)
+    {
+      mode_t mode = 0;
+      va_list arg;
+      va_start (arg, flags);
+
+      /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
+         creates crashing code when 'mode_t' is smaller than 'int'.  */
+      mode = va_arg (arg, PROMOTED_MODE_T);
+
+      va_end (arg);
+      return openat (dfd, name, flags, mode);
+    }
+  return openat (dfd, name, flags);
+}
+
+int
+main (int argc _GL_UNUSED, char *argv[])
+{
+  int result;
+
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    errno = 0;
+    ASSERT (openat (-1, "foo", O_RDONLY) == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    close (99);
+    errno = 0;
+    ASSERT (openat (99, "foo", O_RDONLY) == -1);
+    ASSERT (errno == EBADF);
+  }
+
+  /* Basic checks.  */
+  result = test_open (do_open, false);
+  dfd = open (".", O_RDONLY);
+  ASSERT (0 <= dfd);
+  ASSERT (test_open (do_open, false) == result);
+  ASSERT (close (dfd) == 0);
+
+  /* Check that even when *-safer modules are in use, plain openat can
+     land in fd 0.  Do this test last, since it is destructive to
+     stdin.  */
+  ASSERT (close (STDIN_FILENO) == 0);
+  ASSERT (openat (AT_FDCWD, ".", O_RDONLY) == STDIN_FILENO);
+  {
+    dfd = open (".", O_RDONLY);
+    ASSERT (STDIN_FILENO < dfd);
+    ASSERT (chdir ("..") == 0);
+    ASSERT (close (STDIN_FILENO) == 0);
+    ASSERT (openat (dfd, ".", O_RDONLY) == STDIN_FILENO);
+    ASSERT (close (dfd) == 0);
+  }
+  return result;
+}
diff --git a/tests/test-oset-update.h b/tests/test-oset-update.h
new file mode 100644 (file)
index 0000000..27a6084
--- /dev/null
@@ -0,0 +1,141 @@
+/* Test of ordered set data type implementation.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2020.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+static void
+action (const void *str, void *data)
+{
+  ((char *) str)[0] += *(int *)data;
+}
+
+static void
+test_update (gl_oset_implementation_t implementation)
+{
+  char A[2] = "A";
+  char B[2] = "B";
+  char C[2] = "C";
+  char D[2] = "D";
+
+  gl_oset_t set1 =
+    gl_oset_nx_create_empty (implementation, (gl_setelement_compar_fn) strcmp, NULL);
+  ASSERT (set1 != NULL);
+
+  /* Fill the set.  */
+  ASSERT (gl_oset_nx_add (set1, C) == 1);
+  ASSERT (gl_oset_nx_add (set1, A) == 1);
+  ASSERT (gl_oset_nx_add (set1, B) == 1);
+  ASSERT (gl_oset_nx_add (set1, D) == 1);
+
+  /* Verify that set1 = ["A", "B", "C", "D"].  */
+  {
+    gl_oset_iterator_t iter = gl_oset_iterator (set1);
+    const void *elt;
+
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == A);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == B);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == C);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == D);
+    ASSERT (!gl_oset_iterator_next (&iter, &elt));
+  }
+
+  /* Make a side effect on an element in the set, that moves the element.  */
+  {
+    int data = 'G' - 'B';
+    ASSERT (gl_oset_update (set1, B, action, &data) == 1);
+  }
+  /* Verify that set1 = ["A", "C", "D", "G"].  */
+  {
+    gl_oset_iterator_t iter = gl_oset_iterator (set1);
+    const void *elt;
+
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == A);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == C);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == D);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == B);
+    ASSERT (!gl_oset_iterator_next (&iter, &elt));
+  }
+
+  /* Make a side effect on an element in the set, that does not move the
+     element.  */
+  {
+    int data = 'E' - 'D';
+    ASSERT (gl_oset_update (set1, D, action, &data) == 0);
+  }
+  /* Verify that set1 = ["A", "C", "E", "G"].  */
+  {
+    gl_oset_iterator_t iter = gl_oset_iterator (set1);
+    const void *elt;
+
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == A);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == C);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == D);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == B);
+    ASSERT (!gl_oset_iterator_next (&iter, &elt));
+  }
+
+  /* Make a side effect on an element in the set, that provokes a
+     collision.  */
+  {
+    int data = 'G' - 'A';
+    ASSERT (gl_oset_update (set1, A, action, &data) == -1);
+  }
+  /* Verify that set1 = ["C", "E", "G"].  */
+  {
+    gl_oset_iterator_t iter = gl_oset_iterator (set1);
+    const void *elt;
+
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == C);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == D);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == B);
+    ASSERT (!gl_oset_iterator_next (&iter, &elt));
+  }
+
+  /* Make a side effect on an element that is not in the set.  */
+  {
+    int data = 'R' - 'G';
+    ASSERT (gl_oset_update (set1, A, action, &data) == 0);
+  }
+  /* Verify that set1 = ["C", "E", "G"].  */
+  {
+    gl_oset_iterator_t iter = gl_oset_iterator (set1);
+    const void *elt;
+
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == C);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == D);
+    ASSERT (gl_oset_iterator_next (&iter, &elt));
+    ASSERT (elt == B);
+    ASSERT (!gl_oset_iterator_next (&iter, &elt));
+  }
+
+  gl_oset_free (set1);
+}
index ac4a393..2ba1cc2 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of "pathmax.h".
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2011.  */
 
diff --git a/tests/test-perror.c b/tests/test-perror.c
new file mode 100644 (file)
index 0000000..1012396
--- /dev/null
@@ -0,0 +1,36 @@
+/* Test of perror() function.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (perror, void, (char const *));
+
+#include <errno.h>
+
+int
+main (int argc, char **argv)
+{
+  const char *prefix = (argc > 1 ? argv[1] : NULL);
+
+  errno = EACCES;    perror (prefix);
+  errno = ETIMEDOUT; perror (prefix);
+  errno = EOVERFLOW; perror (prefix);
+
+  return 0;
+}
diff --git a/tests/test-perror.sh b/tests/test-perror.sh
new file mode 100755 (executable)
index 0000000..e776609
--- /dev/null
@@ -0,0 +1,26 @@
+#!/bin/sh
+: ${srcdir=.}
+. "$srcdir/init.sh"; path_prepend_ .
+
+# Test NULL prefix. Result should not contain a number, except in lines that
+# start with 'EDC' (IBM z/OS libc produces an error identifier before the
+# error message).
+${CHECKER} test-perror 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror.tmp
+grep -v '^EDC' t-perror.tmp | grep '[0-9]' > /dev/null \
+  && fail_ "result should not contain a number"
+
+# Test empty prefix. Result should be the same.
+${CHECKER} test-perror '' 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror1.tmp
+diff t-perror.tmp t-perror1.tmp \
+  || fail_ "empty prefix should behave like NULL argument"
+
+# Test non-empty prefix.
+${CHECKER} test-perror foo 2>&1 >/dev/null | LC_ALL=C tr -d '\r' > t-perror3.tmp
+sed -e 's/^/foo: /' < t-perror.tmp > t-perror2.tmp
+diff t-perror2.tmp t-perror3.tmp || fail_ "prefix applied incorrectly"
+
+# Test exit status.
+${CHECKER} test-perror >out 2>/dev/null || fail_ "unexpected exit status"
+test -s out && fail_ "unexpected output"
+
+Exit 0
diff --git a/tests/test-perror2.c b/tests/test-perror2.c
new file mode 100644 (file)
index 0000000..adce4a6
--- /dev/null
@@ -0,0 +1,133 @@
+/* Test of perror() function.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+/* This test intentionally parses stderr.  So, we arrange to have fd 10
+   (outside the range of interesting fd's during the test) set up to
+   duplicate the original stderr.  */
+#define BACKUP_STDERR_FILENO 10
+#define ASSERT_STREAM myerr
+#include "macros.h"
+
+static FILE *myerr;
+
+#define BASE "test-perror2"
+
+int
+main (void)
+{
+  /* We change fd 2 later, so save it in fd 10.  */
+  if (dup2 (STDERR_FILENO, BACKUP_STDERR_FILENO) != BACKUP_STDERR_FILENO
+      || (myerr = fdopen (BACKUP_STDERR_FILENO, "w")) == NULL)
+    return 2;
+
+  ASSERT (freopen (BASE ".tmp", "w+", stderr) == stderr);
+
+  /* Test that perror does not clobber strerror buffer.  */
+  {
+    const char *msg1;
+    const char *msg2;
+    const char *msg3;
+    const char *msg4;
+    char *str1;
+    char *str2;
+    char *str3;
+    char *str4;
+
+    msg1 = strerror (ENOENT);
+    ASSERT (msg1);
+    str1 = strdup (msg1);
+    ASSERT (str1);
+
+    msg2 = strerror (ERANGE);
+    ASSERT (msg2);
+    str2 = strdup (msg2);
+    ASSERT (str2);
+
+    msg3 = strerror (-4);
+    ASSERT (msg3);
+    str3 = strdup (msg3);
+    ASSERT (str3);
+
+    msg4 = strerror (1729576);
+    ASSERT (msg4);
+    str4 = strdup (msg4);
+    ASSERT (str4);
+
+    errno = EACCES;
+    perror ("");
+    errno = -5;
+    perror ("");
+    ASSERT (!ferror (stderr));
+    ASSERT (STREQ (msg4, str4));
+
+    free (str1);
+    free (str2);
+    free (str3);
+    free (str4);
+  }
+
+  /* Test that perror uses the same message as strerror.  */
+  {
+    int errs[] = { EACCES, 0, -3, };
+    int i;
+    for (i = 0; i < SIZEOF (errs); i++)
+      {
+        char buf[256];
+        const char *err = strerror (errs[i]);
+
+        ASSERT (err);
+        ASSERT (strlen (err) < sizeof buf);
+        rewind (stderr);
+        ASSERT (ftruncate (fileno (stderr), 0) == 0);
+        errno = errs[i];
+        perror (NULL);
+        ASSERT (!ferror (stderr));
+        rewind (stderr);
+        ASSERT (fgets (buf, sizeof buf, stderr) == buf);
+        ASSERT (strstr (buf, err));
+      }
+  }
+
+  /* Test that perror reports write failure.  */
+  {
+    ASSERT (freopen (BASE ".tmp", "r", stderr) == stderr);
+    ASSERT (setvbuf (stderr, NULL, _IONBF, BUFSIZ) == 0);
+    errno = -1;
+    ASSERT (!ferror (stderr));
+    perror (NULL);
+#if 0
+    /* Commented out until cygwin behaves:
+       https://sourceware.org/ml/newlib/2011/msg00228.html */
+    ASSERT (errno > 0);
+    /* Commented out until glibc behaves:
+       https://sourceware.org/bugzilla/show_bug.cgi?id=12792 */
+    ASSERT (ferror (stderr));
+#endif
+  }
+
+  ASSERT (fclose (stderr) == 0);
+  ASSERT (remove (BASE ".tmp") == 0);
+
+  return 0;
+}
diff --git a/tests/test-pipe.c b/tests/test-pipe.c
new file mode 100644 (file)
index 0000000..5ae2a0a
--- /dev/null
@@ -0,0 +1,108 @@
+/* Test of pipe.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <unistd.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (pipe, int, (int[2]));
+
+#include <fcntl.h>
+#include <stdbool.h>
+
+#if defined _WIN32 && ! defined __CYGWIN__
+/* Get declarations of the native Windows API functions.  */
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
+/* Get _get_osfhandle.  */
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
+#endif
+
+#include "binary-io.h"
+#include "macros.h"
+
+/* Return true if FD is open.  */
+static bool
+is_open (int fd)
+{
+#if defined _WIN32 && ! defined __CYGWIN__
+  /* On native Windows, the initial state of unassigned standard file
+     descriptors is that they are open but point to an
+     INVALID_HANDLE_VALUE, and there is no fcntl.  */
+  return (HANDLE) _get_osfhandle (fd) != INVALID_HANDLE_VALUE;
+#else
+# ifndef F_GETFL
+#  error Please port fcntl to your platform
+# endif
+  return 0 <= fcntl (fd, F_GETFL);
+#endif
+}
+
+/* Return true if FD is not inherited to child processes.  */
+static bool
+is_cloexec (int fd)
+{
+#if defined _WIN32 && ! defined __CYGWIN__
+  HANDLE h = (HANDLE) _get_osfhandle (fd);
+  DWORD flags;
+  ASSERT (GetHandleInformation (h, &flags));
+  return (flags & HANDLE_FLAG_INHERIT) == 0;
+#else
+  int flags;
+  ASSERT ((flags = fcntl (fd, F_GETFD)) >= 0);
+  return (flags & FD_CLOEXEC) != 0;
+#endif
+}
+
+/* Return true if FD is in non-blocking mode.  */
+static bool
+is_nonblocking (int fd)
+{
+#if defined _WIN32 && ! defined __CYGWIN__
+  /* We don't use the non-blocking mode for sockets here.  */
+  return 0;
+#else
+  int flags;
+  ASSERT ((flags = fcntl (fd, F_GETFL)) >= 0);
+  return (flags & O_NONBLOCK) != 0;
+#endif
+}
+
+int
+main ()
+{
+  int fd[2];
+
+  fd[0] = -1;
+  fd[1] = -1;
+  ASSERT (pipe (fd) >= 0);
+  ASSERT (fd[0] >= 0);
+  ASSERT (fd[1] >= 0);
+  ASSERT (fd[0] != fd[1]);
+  ASSERT (is_open (fd[0]));
+  ASSERT (is_open (fd[1]));
+  ASSERT (!is_cloexec (fd[0]));
+  ASSERT (!is_cloexec (fd[1]));
+  ASSERT (!is_nonblocking (fd[0]));
+  ASSERT (!is_nonblocking (fd[1]));
+
+  return 0;
+}
index 9bbeb25..97d6d9c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of pipe2.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -24,12 +24,16 @@ SIGNATURE_CHECK (pipe2, int, (int[2], int));
 #include <fcntl.h>
 #include <stdbool.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Get declarations of the native Windows API functions.  */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
 /* Get _get_osfhandle.  */
-# include "msvc-nothrow.h"
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
 #endif
 
 #include "binary-io.h"
@@ -42,7 +46,7 @@ SIGNATURE_CHECK (pipe2, int, (int[2], int));
 static bool
 is_open (int fd)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* On native Windows, the initial state of unassigned standard file
      descriptors is that they are open but point to an
      INVALID_HANDLE_VALUE, and there is no fcntl.  */
@@ -59,7 +63,7 @@ is_open (int fd)
 static bool
 is_cloexec (int fd)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   HANDLE h = (HANDLE) _get_osfhandle (fd);
   DWORD flags;
   ASSERT (GetHandleInformation (h, &flags));
@@ -75,7 +79,7 @@ is_cloexec (int fd)
 static int
 get_nonblocking_flag (int fd)
 {
-# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if defined _WIN32 && ! defined __CYGWIN__
   return 0;
 # else
 #  ifndef F_GETFL
diff --git a/tests/test-posix_spawn-chdir.c b/tests/test-posix_spawn-chdir.c
new file mode 100644 (file)
index 0000000..e1fd27e
--- /dev/null
@@ -0,0 +1,182 @@
+/* Test of posix_spawn() function with 'chdir' action.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2018.  */
+
+#include <config.h>
+
+#include <spawn.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include "findprog.h"
+
+static int
+fd_safer (int fd)
+{
+  if (0 <= fd && fd <= 2)
+    {
+      int f = fd_safer (dup (fd));
+      int e = errno;
+      close (fd);
+      errno = e;
+      fd = f;
+    }
+
+  return fd;
+}
+
+static void
+test (const char *pwd_prog)
+{
+  char *argv[2] = { (char *) "pwd", NULL };
+  int ifd[2];
+  sigset_t blocked_signals;
+  sigset_t fatal_signal_set;
+  posix_spawn_file_actions_t actions;
+  bool actions_allocated;
+  posix_spawnattr_t attrs;
+  bool attrs_allocated;
+  int err;
+  pid_t child;
+  int fd;
+  FILE *fp;
+  char line[80];
+  int line_len;
+  int status;
+  int exitstatus;
+
+  if (pipe (ifd) < 0 || (ifd[0] = fd_safer (ifd[0])) < 0)
+    {
+      perror ("cannot create pipe");
+      exit (1);
+    }
+  sigprocmask (SIG_SETMASK, NULL, &blocked_signals);
+  sigemptyset (&fatal_signal_set);
+  sigaddset (&fatal_signal_set, SIGINT);
+  sigaddset (&fatal_signal_set, SIGTERM);
+  #ifdef SIGHUP
+  sigaddset (&fatal_signal_set, SIGHUP);
+  #endif
+  #ifdef SIGPIPE
+  sigaddset (&fatal_signal_set, SIGPIPE);
+  #endif
+  sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL);
+  actions_allocated = false;
+  attrs_allocated = false;
+  if ((err = posix_spawn_file_actions_init (&actions)) != 0
+      || (actions_allocated = true,
+          (err = posix_spawn_file_actions_adddup2 (&actions, ifd[1], STDOUT_FILENO)) != 0
+          || (err = posix_spawn_file_actions_addclose (&actions, ifd[1])) != 0
+          || (err = posix_spawn_file_actions_addclose (&actions, ifd[0])) != 0
+          || (err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, "/dev/null", O_RDONLY, 0)) != 0
+          || (err = posix_spawn_file_actions_addchdir (&actions, "/")) != 0
+          || (err = posix_spawnattr_init (&attrs)) != 0
+          || (attrs_allocated = true,
+              #if defined _WIN32 && !defined __CYGWIN__
+              0
+              #else
+              (err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0
+              || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0
+              #endif
+             )
+          || (err = posix_spawnp (&child, pwd_prog, &actions, &attrs, argv, environ)) != 0))
+    {
+      if (actions_allocated)
+        posix_spawn_file_actions_destroy (&actions);
+      if (attrs_allocated)
+        posix_spawnattr_destroy (&attrs);
+      sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
+      errno = err;
+      perror ("subprocess failed");
+      exit (1);
+    }
+  posix_spawn_file_actions_destroy (&actions);
+  posix_spawnattr_destroy (&attrs);
+  sigprocmask (SIG_UNBLOCK, &fatal_signal_set, NULL);
+  close (ifd[1]);
+  fd = ifd[0];
+  fp = fdopen (fd, "rb");
+  if (fp == NULL)
+    {
+      fprintf (stderr, "fdopen() failed\n");
+      exit (1);
+    }
+  line_len = fread (line, 1, 80, fp);
+  if (line_len < 2)
+    {
+      fprintf (stderr, "could not read expected output\n");
+      exit (1);
+    }
+  if (!(line_len == 2 && memcmp (line, "/\n", 2) == 0))
+#if defined _WIN32 && !defined __CYGWIN__
+    /* If the pwd program is Cygwin's pwd, its output in the root directory is
+       "/cygdrive/N", where N is a lowercase letter.  */
+    if (!(line_len > 11
+          && memcmp (line, "/cygdrive/", 10) == 0
+          && line[10] >= 'a' && line[10] <= 'z'
+          && ((line_len == 12 && line[11] == '\n')
+              || (line_len == 13 && line[11] == '\r' && line[12] == '\n'))))
+#endif
+      {
+        fprintf (stderr, "read output is not the expected output\n");
+        exit (1);
+      }
+  fclose (fp);
+  status = 0;
+  while (waitpid (child, &status, 0) != child)
+    ;
+  if (!WIFEXITED (status))
+    {
+      fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+      exit (1);
+    }
+  exitstatus = WEXITSTATUS (status);
+  if (exitstatus != 0)
+    {
+      fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+      exit (1);
+    }
+}
+
+int
+main ()
+{
+  test ("pwd");
+
+  /* Verify that if a program is given as a relative file name with at least one
+     slash, it is interpreted w.r.t. the current directory after chdir has been
+     executed.  */
+  {
+    const char *abs_pwd_prog = find_in_path ("pwd");
+
+    if (abs_pwd_prog != NULL
+        && abs_pwd_prog[0] == '/'
+        && abs_pwd_prog[1] != '0' && abs_pwd_prog[1] != '/')
+      test (&abs_pwd_prog[1]);
+  }
+
+  return 0;
+}
similarity index 84%
rename from tests/test-posix_spawn2.c
rename to tests/test-posix_spawn-dup2-stdin.c
index 041e0bb..8184f2c 100644 (file)
@@ -1,5 +1,5 @@
-/* Test of posix_spawn() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Test of posix_spawn() function: writing to a subprocess.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
@@ -31,9 +31,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 
-extern char **environ;
-
-#define CHILD_PROGRAM_FILENAME "test-posix_spawn2.sh"
+#define CHILD_PROGRAM_FILENAME "test-posix_spawn-dup2-stdin.sh"
 
 static int
 fd_safer (int fd)
@@ -53,7 +51,7 @@ fd_safer (int fd)
 int
 main ()
 {
-  char *argv[3] = { (char *) "/bin/sh", (char *) CHILD_PROGRAM_FILENAME, NULL };
+  char *argv[3] = { (char *) BOURNE_SHELL, (char *) CHILD_PROGRAM_FILENAME, NULL };
   int ofd[2];
   sigset_t blocked_signals;
   sigset_t fatal_signal_set;
@@ -78,8 +76,12 @@ main ()
   sigemptyset (&fatal_signal_set);
   sigaddset (&fatal_signal_set, SIGINT);
   sigaddset (&fatal_signal_set, SIGTERM);
+  #ifdef SIGHUP
   sigaddset (&fatal_signal_set, SIGHUP);
+  #endif
+  #ifdef SIGPIPE
   sigaddset (&fatal_signal_set, SIGPIPE);
+  #endif
   sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL);
   actions_allocated = false;
   attrs_allocated = false;
@@ -90,9 +92,14 @@ main ()
           || (err = posix_spawn_file_actions_addclose (&actions, ofd[1])) != 0
           || (err = posix_spawnattr_init (&attrs)) != 0
           || (attrs_allocated = true,
+              #if defined _WIN32 && !defined __CYGWIN__
+              0
+              #else
               (err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0
-              || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0)
-          || (err = posix_spawnp (&child, "/bin/sh", &actions, &attrs, argv, environ)) != 0))
+              || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0
+              #endif
+             )
+          || (err = posix_spawnp (&child, BOURNE_SHELL, &actions, &attrs, argv, environ)) != 0))
     {
       if (actions_allocated)
         posix_spawn_file_actions_destroy (&actions);
similarity index 87%
rename from tests/test-posix_spawn1.c
rename to tests/test-posix_spawn-dup2-stdout.c
index ddf5b99..ac0f0bf 100644 (file)
@@ -1,5 +1,5 @@
-/* Test of posix_spawn() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+/* Test of posix_spawn() function: reading from a subprocess.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
@@ -53,9 +53,7 @@ SIGNATURE_CHECK (posix_spawn_file_actions_adddup2, int,
 #include <sys/types.h>
 #include <sys/wait.h>
 
-extern char **environ;
-
-#define CHILD_PROGRAM_FILENAME "test-posix_spawn1.sh"
+#define CHILD_PROGRAM_FILENAME "test-posix_spawn-dup2-stdout.sh"
 
 static int
 fd_safer (int fd)
@@ -75,7 +73,7 @@ fd_safer (int fd)
 int
 main ()
 {
-  char *argv[3] = { (char *) "/bin/sh", (char *) CHILD_PROGRAM_FILENAME, NULL };
+  char *argv[3] = { (char *) BOURNE_SHELL, (char *) CHILD_PROGRAM_FILENAME, NULL };
   int ifd[2];
   sigset_t blocked_signals;
   sigset_t fatal_signal_set;
@@ -100,8 +98,12 @@ main ()
   sigemptyset (&fatal_signal_set);
   sigaddset (&fatal_signal_set, SIGINT);
   sigaddset (&fatal_signal_set, SIGTERM);
+  #ifdef SIGHUP
   sigaddset (&fatal_signal_set, SIGHUP);
+  #endif
+  #ifdef SIGPIPE
   sigaddset (&fatal_signal_set, SIGPIPE);
+  #endif
   sigprocmask (SIG_BLOCK, &fatal_signal_set, NULL);
   actions_allocated = false;
   attrs_allocated = false;
@@ -113,9 +115,14 @@ main ()
           || (err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, "/dev/null", O_RDONLY, 0)) != 0
           || (err = posix_spawnattr_init (&attrs)) != 0
           || (attrs_allocated = true,
+              #if defined _WIN32 && !defined __CYGWIN__
+              0
+              #else
               (err = posix_spawnattr_setsigmask (&attrs, &blocked_signals)) != 0
-              || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0)
-          || (err = posix_spawnp (&child, "/bin/sh", &actions, &attrs, argv, environ)) != 0))
+              || (err = posix_spawnattr_setflags (&attrs, POSIX_SPAWN_SETSIGMASK)) != 0
+              #endif
+             )
+          || (err = posix_spawnp (&child, BOURNE_SHELL, &actions, &attrs, argv, environ)) != 0))
     {
       if (actions_allocated)
         posix_spawn_file_actions_destroy (&actions);
@@ -144,7 +151,7 @@ main ()
     }
   if (memcmp (line, "Halle Potta", 11) != 0)
     {
-      fprintf (stderr, "read output is not the expected output");
+      fprintf (stderr, "read output is not the expected output\n");
       exit (1);
     }
   fclose (fp);
diff --git a/tests/test-posix_spawn-inherit0.c b/tests/test-posix_spawn-inherit0.c
new file mode 100644 (file)
index 0000000..4e5947f
--- /dev/null
@@ -0,0 +1,156 @@
+/* Test of posix_spawn() function with an inherited file descriptor 0.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+/* Test whether passing a file descriptor open for reading, including the
+   current file position, works.  */
+
+#include <config.h>
+
+#include <spawn.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#define CHILD_PROGRAM_FILENAME "test-posix_spawn-inherit0"
+#define DATA_FILENAME "test-posix_spawn-inh0-data.tmp"
+
+static int
+parent_main (void)
+{
+  FILE *fp;
+  char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
+  int err;
+  pid_t child;
+  int status;
+  int exitstatus;
+
+  /* Create a data file with specific contents.  */
+  fp = fopen (DATA_FILENAME, "wb");
+  if (fp == NULL)
+    {
+      perror ("cannot create data file");
+      return 1;
+    }
+  fwrite ("Halle Potta", 1, 11, fp);
+  if (fflush (fp) || fclose (fp))
+    {
+      perror ("cannot prepare data file");
+      return 1;
+    }
+
+  /* Open the data file for reading.  */
+  fp = freopen (DATA_FILENAME, "rb", stdin);
+  if (fp == NULL)
+    {
+      perror ("cannot open data file");
+      return 1;
+    }
+  if (fflush (fp) || fseek (fp, 6, SEEK_SET)) /* needs gnulib module 'fflush' */
+    {
+      perror ("cannot seek in data file");
+      return 1;
+    }
+
+  /* Test whether the child reads from fd 0 at the current file position.  */
+  if ((err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, NULL, NULL, argv, environ)) != 0)
+    {
+      errno = err;
+      perror ("subprocess failed");
+      return 1;
+    }
+  status = 0;
+  while (waitpid (child, &status, 0) != child)
+    ;
+  if (!WIFEXITED (status))
+    {
+      fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+      return 1;
+    }
+  exitstatus = WEXITSTATUS (status);
+  if (exitstatus != 0)
+    {
+      fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+      return 1;
+    }
+
+  if (fclose (fp))
+    {
+      perror ("cannot close data file");
+      return 1;
+    }
+
+  /* Clean up data file.  */
+  unlink (DATA_FILENAME);
+
+  return 0;
+}
+
+static int
+child_main (void)
+{
+  /* Read from STDIN_FILENO.  */
+  char buf[1024];
+  int nread = fread (buf, 1, sizeof (buf), stdin);
+  if (!(nread == 5 && memcmp (buf, "Potta", 5) == 0))
+    {
+      fprintf (stderr, "child: read %d bytes, expected %d bytes\n", nread, 5);
+      return 1;
+    }
+
+  return 0;
+}
+
+static void
+cleanup_then_die (int sig)
+{
+  /* Clean up data file.  */
+  unlink (DATA_FILENAME);
+
+  /* Re-raise the signal and die from it.  */
+  signal (sig, SIG_DFL);
+  raise (sig);
+}
+
+int
+main (int argc, char *argv[])
+{
+  int exitstatus;
+
+  if (!(argc > 1 && strcmp (argv[1], "-child") == 0))
+    {
+      /* This is the parent process.  */
+      signal (SIGINT, cleanup_then_die);
+      signal (SIGTERM, cleanup_then_die);
+      #ifdef SIGHUP
+      signal (SIGHUP, cleanup_then_die);
+      #endif
+
+      exitstatus = parent_main ();
+    }
+  else
+    {
+      /* This is the child process.  */
+      exitstatus = child_main ();
+    }
+  return exitstatus;
+}
diff --git a/tests/test-posix_spawn-inherit1.c b/tests/test-posix_spawn-inherit1.c
new file mode 100644 (file)
index 0000000..9892eb3
--- /dev/null
@@ -0,0 +1,159 @@
+/* Test of posix_spawn() function with an inherited file descriptor 1.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+/* Test whether passing a file descriptor open for writing, including the
+   current file position, works.  */
+
+#include <config.h>
+
+#include <spawn.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#define CHILD_PROGRAM_FILENAME "test-posix_spawn-inherit1"
+#define DATA_FILENAME "test-posix_spawn-inh1-data.tmp"
+
+static int
+parent_main (void)
+{
+  FILE *fp;
+  char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
+  int err;
+  pid_t child;
+  int status;
+  int exitstatus;
+
+  /* Create a data file with specific contents.  */
+  fp = freopen (DATA_FILENAME, "wb", stdout);
+  if (fp == NULL)
+    {
+      perror ("cannot create data file");
+      return 1;
+    }
+  fwrite ("Halle X", 1, 7, fp);
+  if (fflush (fp) || fseek (fp, 6, SEEK_SET))
+    {
+      perror ("cannot prepare data file");
+      return 1;
+    }
+
+  /* Test whether the child writes to fd 1 at the current file position.  */
+  if ((err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, NULL, NULL, argv, environ)) != 0)
+    {
+      errno = err;
+      perror ("subprocess failed");
+      return 1;
+    }
+  status = 0;
+  while (waitpid (child, &status, 0) != child)
+    ;
+  if (!WIFEXITED (status))
+    {
+      fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+      return 1;
+    }
+  exitstatus = WEXITSTATUS (status);
+  if (exitstatus != 0)
+    {
+      fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+      return 1;
+    }
+
+  if (fclose (fp))
+    {
+      perror ("cannot close data file");
+      return 1;
+    }
+
+  /* Check the contents of the data file.  */
+  fp = fopen (DATA_FILENAME, "rb");
+  if (fp == NULL)
+    {
+      perror ("cannot open data file");
+      return 1;
+    }
+  char buf[1024];
+  int nread = fread (buf, 1, sizeof (buf), fp);
+  if (!(nread == 11 && memcmp (buf, "Halle Potta", 11) == 0))
+    {
+      fprintf (stderr, "data file wrong: has %d bytes, expected %d bytes\n", nread, 11);
+      return 1;
+    }
+  if (fclose (fp))
+    {
+      perror ("cannot close data file");
+      return 1;
+    }
+
+  /* Clean up data file.  */
+  unlink (DATA_FILENAME);
+
+  return 0;
+}
+
+static int
+child_main (void)
+{
+  /* Write to STDOUT_FILENO.  */
+  fwrite ("Potta", 1, 5, stdout);
+  /* No 'fflush (stdout);' is needed.  It is implicit when the child process
+     exits.  */
+
+  return 0;
+}
+
+static void
+cleanup_then_die (int sig)
+{
+  /* Clean up data file.  */
+  unlink (DATA_FILENAME);
+
+  /* Re-raise the signal and die from it.  */
+  signal (sig, SIG_DFL);
+  raise (sig);
+}
+
+int
+main (int argc, char *argv[])
+{
+  int exitstatus;
+
+  if (!(argc > 1 && strcmp (argv[1], "-child") == 0))
+    {
+      /* This is the parent process.  */
+      signal (SIGINT, cleanup_then_die);
+      signal (SIGTERM, cleanup_then_die);
+      #ifdef SIGHUP
+      signal (SIGHUP, cleanup_then_die);
+      #endif
+
+      exitstatus = parent_main ();
+    }
+  else
+    {
+      /* This is the child process.  */
+      exitstatus = child_main ();
+    }
+  return exitstatus;
+}
diff --git a/tests/test-posix_spawn-open1.c b/tests/test-posix_spawn-open1.c
new file mode 100644 (file)
index 0000000..66d7510
--- /dev/null
@@ -0,0 +1,163 @@
+/* Test of posix_spawn() function with 'open' action.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
+
+/* Test whether posix_spawn_file_actions_addopen supports filename arguments
+   that contain special characters such as '*'.  */
+
+#include <config.h>
+
+#include <spawn.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (posix_spawn, int, (pid_t *, char const *,
+                                    posix_spawn_file_actions_t const *,
+                                    posix_spawnattr_t const *,
+                                    char *const[], char *const[]));
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#define CHILD_PROGRAM_FILENAME "test-posix_spawn-open1"
+#define DATA_FILENAME "t!#$%&'()*+,-;=?@[\\]^_`{|}~.tmp"
+/* On Windows (including Cygwin), '*' '?' '\\' '|' cannot be used in file
+   names.  */
+#if defined _WIN32 || defined __CYGWIN__
+# undef DATA_FILENAME
+# define DATA_FILENAME "t!#$%&'()+,-;=@[]^_`{}~.tmp"
+#endif
+
+static int
+parent_main (void)
+{
+  FILE *fp;
+  char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
+  posix_spawn_file_actions_t actions;
+  bool actions_allocated;
+  int err;
+  pid_t child;
+  int status;
+  int exitstatus;
+
+  /* Create a data file with specific contents.  */
+  fp = fopen (DATA_FILENAME, "wb");
+  if (fp == NULL)
+    {
+      perror ("cannot create data file");
+      return 1;
+    }
+  fwrite ("Halle Potta", 1, 11, fp);
+  if (fflush (fp) || fclose (fp))
+    {
+      perror ("cannot prepare data file");
+      return 1;
+    }
+
+  /* Avoid reading from our stdin, as it could block.  */
+  if (freopen ("/dev/null", "rb", stdin) == NULL)
+    {
+      perror ("cannot redirect stdin");
+      return 1;
+    }
+
+  /* Test whether posix_spawn_file_actions_addopen with this file name
+     actually works, by spawning a child that reads from this file.  */
+  actions_allocated = false;
+  if ((err = posix_spawn_file_actions_init (&actions)) != 0
+      || (actions_allocated = true,
+          (err = posix_spawn_file_actions_addopen (&actions, STDIN_FILENO, DATA_FILENAME, O_RDONLY, 0600)) != 0
+          || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0))
+    {
+      if (actions_allocated)
+        posix_spawn_file_actions_destroy (&actions);
+      errno = err;
+      perror ("subprocess failed");
+      return 1;
+    }
+  posix_spawn_file_actions_destroy (&actions);
+  status = 0;
+  while (waitpid (child, &status, 0) != child)
+    ;
+  if (!WIFEXITED (status))
+    {
+      fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+      return 1;
+    }
+  exitstatus = WEXITSTATUS (status);
+  if (exitstatus != 0)
+    {
+      fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+      return 1;
+    }
+  return 0;
+}
+
+static int
+child_main (void)
+{
+  char buf[1024];
+
+  /* See if reading from STDIN_FILENO yields the expected contents.  */
+  if (fread (buf, 1, sizeof (buf), stdin) == 11
+      && memcmp (buf, "Halle Potta", 11) == 0)
+    return 0;
+  else
+    return 2;
+}
+
+static void
+cleanup_then_die (int sig)
+{
+  /* Clean up data file.  */
+  unlink (DATA_FILENAME);
+
+  /* Re-raise the signal and die from it.  */
+  signal (sig, SIG_DFL);
+  raise (sig);
+}
+
+int
+main (int argc, char *argv[])
+{
+  int exitstatus;
+
+  if (!(argc > 1 && strcmp (argv[1], "-child") == 0))
+    {
+      /* This is the parent process.  */
+      signal (SIGINT, cleanup_then_die);
+      signal (SIGTERM, cleanup_then_die);
+      #ifdef SIGHUP
+      signal (SIGHUP, cleanup_then_die);
+      #endif
+
+      exitstatus = parent_main ();
+    }
+  else
+    {
+      /* This is the child process.  */
+
+      exitstatus = child_main ();
+    }
+  unlink (DATA_FILENAME);
+  return exitstatus;
+}
diff --git a/tests/test-posix_spawn-open2.c b/tests/test-posix_spawn-open2.c
new file mode 100644 (file)
index 0000000..c3ac2ea
--- /dev/null
@@ -0,0 +1,164 @@
+/* Test of posix_spawn() function with 'open' action and O_APPEND flag.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+/* Test whether posix_spawn_file_actions_addopen supports the O_APPEND flag.  */
+
+#include <config.h>
+
+#include <spawn.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#define CHILD_PROGRAM_FILENAME "test-posix_spawn-open2"
+#define DATA_FILENAME "test-posix_spawn-open2-data.tmp"
+
+static int
+parent_main (void)
+{
+  FILE *fp;
+  char *argv[3] = { CHILD_PROGRAM_FILENAME, "-child", NULL };
+  posix_spawn_file_actions_t actions;
+  bool actions_allocated;
+  int err;
+  pid_t child;
+  int status;
+  int exitstatus;
+
+  /* Create a data file with specific contents.  */
+  fp = fopen (DATA_FILENAME, "wb");
+  if (fp == NULL)
+    {
+      perror ("cannot create data file");
+      return 1;
+    }
+  fwrite ("Halle ", 1, 6, fp);
+  if (fflush (fp) || fclose (fp))
+    {
+      perror ("cannot prepare data file");
+      return 1;
+    }
+
+  /* Test whether posix_spawn_file_actions_addopen with O_APPEND flag causes
+     the child to append to this file.  */
+  actions_allocated = false;
+  if ((err = posix_spawn_file_actions_init (&actions)) != 0
+      || (actions_allocated = true,
+          (err = posix_spawn_file_actions_addopen (&actions, STDOUT_FILENO, DATA_FILENAME, O_RDWR | O_APPEND, 0600)) != 0
+          || (err = posix_spawn (&child, CHILD_PROGRAM_FILENAME, &actions, NULL, argv, environ)) != 0))
+    {
+      if (actions_allocated)
+        posix_spawn_file_actions_destroy (&actions);
+      errno = err;
+      perror ("subprocess failed");
+      return 1;
+    }
+  posix_spawn_file_actions_destroy (&actions);
+  status = 0;
+  while (waitpid (child, &status, 0) != child)
+    ;
+  if (!WIFEXITED (status))
+    {
+      fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+      return 1;
+    }
+  exitstatus = WEXITSTATUS (status);
+  if (exitstatus != 0)
+    {
+      fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+      return 1;
+    }
+
+  /* Check the contents of the data file.  */
+  fp = fopen (DATA_FILENAME, "rb");
+  if (fp == NULL)
+    {
+      perror ("cannot open data file");
+      return 1;
+    }
+  char buf[1024];
+  int nread = fread (buf, 1, sizeof (buf), fp);
+  if (!(nread == 11 && memcmp (buf, "Halle Potta", 11) == 0))
+    {
+      fprintf (stderr, "data file wrong: has %d bytes, expected %d bytes\n", nread, 11);
+      return 1;
+    }
+  if (fclose (fp))
+    {
+      perror ("cannot close data file");
+      return 1;
+    }
+
+  /* Clean up data file.  */
+  unlink (DATA_FILENAME);
+
+  return 0;
+}
+
+static int
+child_main (void)
+{
+  /* Write to STDOUT_FILENO.  */
+  fwrite ("Potta", 1, 5, stdout);
+  /* No 'fflush (stdout);' is needed.  It is implicit when the child process
+     exits.  */
+
+  return 0;
+}
+
+static void
+cleanup_then_die (int sig)
+{
+  /* Clean up data file.  */
+  unlink (DATA_FILENAME);
+
+  /* Re-raise the signal and die from it.  */
+  signal (sig, SIG_DFL);
+  raise (sig);
+}
+
+int
+main (int argc, char *argv[])
+{
+  int exitstatus;
+
+  if (!(argc > 1 && strcmp (argv[1], "-child") == 0))
+    {
+      /* This is the parent process.  */
+      signal (SIGINT, cleanup_then_die);
+      signal (SIGTERM, cleanup_then_die);
+      #ifdef SIGHUP
+      signal (SIGHUP, cleanup_then_die);
+      #endif
+
+      exitstatus = parent_main ();
+    }
+  else
+    {
+      /* This is the child process.  */
+      exitstatus = child_main ();
+    }
+  return exitstatus;
+}
diff --git a/tests/test-posix_spawn-script.c b/tests/test-posix_spawn-script.c
new file mode 100644 (file)
index 0000000..fbf1a98
--- /dev/null
@@ -0,0 +1,156 @@
+/* Test of posix_spawn() function.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <spawn.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include "macros.h"
+
+#define DATA_FILENAME "test-posix_spawn-script.tmp"
+
+int
+main ()
+{
+  unlink (DATA_FILENAME);
+
+  /* Check an invocation of an executable script.
+     This should only be supported if the script has a '#!' marker; otherwise
+     it is unsecure: <https://sourceware.org/bugzilla/show_bug.cgi?id=13134>.
+     POSIX says that the execlp() and execvp() functions support executing
+     shell scripts
+     <https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html>,
+     but this is considered an antiquated feature.  */
+  pid_t child;
+
+  posix_spawn_file_actions_t actions;
+  ASSERT (posix_spawn_file_actions_init (&actions) == 0);
+  ASSERT (posix_spawn_file_actions_addopen (&actions, STDOUT_FILENO,
+                                            DATA_FILENAME,
+                                            O_RDWR | O_CREAT | O_TRUNC, 0600)
+          == 0);
+
+  {
+    size_t i;
+
+    for (i = 0; i < 2; i++)
+      {
+        const char *prog_path =
+          (i == 0 ? SRCDIR "executable-script" : SRCDIR "executable-script.sh");
+        const char *prog_argv[2] = { prog_path, NULL };
+
+        int err = posix_spawn (&child, prog_path, &actions, NULL,
+                               (char **) prog_argv, environ);
+        if (err != ENOEXEC)
+          {
+            if (err != 0)
+              {
+                errno = err;
+                perror ("posix_spawn");
+                return 1;
+              }
+
+            /* Wait for child.  */
+            int status = 0;
+            while (waitpid (child, &status, 0) != child)
+              ;
+            if (!WIFEXITED (status))
+              {
+                fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+                return 1;
+              }
+            int exitstatus = WEXITSTATUS (status);
+            if (exitstatus != 127)
+              {
+                fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+                return 1;
+              }
+          }
+      }
+  }
+
+#if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, scripts - even with '#!' marker - are not executable.
+     Only .bat and .cmd files are.  */
+  fprintf (stderr, "Skipping test: scripts are not executable on this platform.\n");
+  return 77;
+#else
+  {
+    const char *prog_path = SRCDIR "executable-shell-script";
+    const char *prog_argv[2] = { prog_path, NULL };
+
+    int err = posix_spawn (&child, prog_path, &actions, NULL,
+                           (char **) prog_argv, environ);
+    if (err != 0)
+      {
+        errno = err;
+        perror ("posix_spawn");
+        return 1;
+      }
+
+    posix_spawn_file_actions_destroy (&actions);
+
+    /* Wait for child.  */
+    int status = 0;
+    while (waitpid (child, &status, 0) != child)
+      ;
+    if (!WIFEXITED (status))
+      {
+        fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+        return 1;
+      }
+    int exitstatus = WEXITSTATUS (status);
+    if (exitstatus != 0)
+      {
+        fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+        return 1;
+      }
+
+    /* Check the contents of the data file.  */
+    FILE *fp = fopen (DATA_FILENAME, "rb");
+    if (fp == NULL)
+      {
+        perror ("cannot open data file");
+        return 1;
+      }
+    char buf[1024];
+    int nread = fread (buf, 1, sizeof (buf), fp);
+    if (!(nread == 11 && memcmp (buf, "Halle Potta", 11) == 0))
+      {
+        fprintf (stderr, "data file wrong: has %d bytes, expected %d bytes\n", nread, 11);
+        return 1;
+      }
+    if (fclose (fp))
+      {
+        perror ("cannot close data file");
+        return 1;
+      }
+  }
+#endif
+
+  /* Clean up data file.  */
+  unlink (DATA_FILENAME);
+
+  return 0;
+}
diff --git a/tests/test-posix_spawn_file_actions_addchdir.c b/tests/test-posix_spawn_file_actions_addchdir.c
new file mode 100644 (file)
index 0000000..1f3fe3b
--- /dev/null
@@ -0,0 +1,44 @@
+/* Test posix_spawn_file_actions_addchdir() function.
+   Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <spawn.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (posix_spawn_file_actions_addchdir, int,
+                 (posix_spawn_file_actions_t *, const char *));
+
+#include <errno.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+  posix_spawn_file_actions_t actions;
+
+  ASSERT (posix_spawn_file_actions_init (&actions) == 0);
+
+  ASSERT (posix_spawn_file_actions_addchdir (&actions, "/") == 0);
+
+  posix_spawn_file_actions_destroy (&actions);
+
+  return 0;
+}
index 9c613f9..2c910ea 100644 (file)
@@ -1,5 +1,5 @@
 /* Test posix_spawn_file_actions_addclose() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -54,11 +54,15 @@ main (void)
     errno = 0;
     ASSERT (posix_spawn_file_actions_addclose (&actions, -1) == EBADF);
   }
+  /* This behaviour is not mandated by POSIX, but happens to pass on all
+     platforms.  */
   {
     int bad_fd = big_fd ();
     errno = 0;
     ASSERT (posix_spawn_file_actions_addclose (&actions, bad_fd) == EBADF);
   }
 
+  posix_spawn_file_actions_destroy (&actions);
+
   return 0;
 }
index 61ca4b3..7ec6181 100644 (file)
@@ -1,5 +1,5 @@
 /* Test posix_spawn_file_actions_adddup2() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -68,5 +68,7 @@ main (void)
     ASSERT (posix_spawn_file_actions_adddup2 (&actions, 2, bad_fd) == EBADF);
   }
 
+  posix_spawn_file_actions_destroy (&actions);
+
   return 0;
 }
index b387dbd..363c37e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test posix_spawn_file_actions_addopen() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -66,5 +66,7 @@ main (void)
             == EBADF);
   }
 
+  posix_spawn_file_actions_destroy (&actions);
+
   return 0;
 }
diff --git a/tests/test-posix_spawnp-script.c b/tests/test-posix_spawnp-script.c
new file mode 100644 (file)
index 0000000..3db0684
--- /dev/null
@@ -0,0 +1,156 @@
+/* Test of posix_spawnp() function.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <spawn.h>
+
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+#include "macros.h"
+
+#define DATA_FILENAME "test-posix_spawn-script.tmp"
+
+int
+main ()
+{
+  unlink (DATA_FILENAME);
+
+  /* Check an invocation of an executable script.
+     This should only be supported if the script has a '#!' marker; otherwise
+     it is unsecure: <https://sourceware.org/bugzilla/show_bug.cgi?id=13134>.
+     POSIX says that the execlp() and execvp() functions support executing
+     shell scripts
+     <https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html>,
+     but this is considered an antiquated feature.  */
+  pid_t child;
+
+  posix_spawn_file_actions_t actions;
+  ASSERT (posix_spawn_file_actions_init (&actions) == 0);
+  ASSERT (posix_spawn_file_actions_addopen (&actions, STDOUT_FILENO,
+                                            DATA_FILENAME,
+                                            O_RDWR | O_CREAT | O_TRUNC, 0600)
+          == 0);
+
+  {
+    size_t i;
+
+    for (i = 0; i < 2; i++)
+      {
+        const char *prog_path =
+          (i == 0 ? SRCDIR "executable-script" : SRCDIR "executable-script.sh");
+        const char *prog_argv[2] = { prog_path, NULL };
+
+        int err = posix_spawnp (&child, prog_path, &actions, NULL,
+                                (char **) prog_argv, environ);
+        if (err != ENOEXEC)
+          {
+            if (err != 0)
+              {
+                errno = err;
+                perror ("posix_spawn");
+                return 1;
+              }
+
+            /* Wait for child.  */
+            int status = 0;
+            while (waitpid (child, &status, 0) != child)
+              ;
+            if (!WIFEXITED (status))
+              {
+                fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+                return 1;
+              }
+            int exitstatus = WEXITSTATUS (status);
+            if (exitstatus != 127)
+              {
+                fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+                return 1;
+              }
+          }
+      }
+  }
+
+#if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, scripts - even with '#!' marker - are not executable.
+     Only .bat and .cmd files are.  */
+  fprintf (stderr, "Skipping test: scripts are not executable on this platform.\n");
+  return 77;
+#else
+  {
+    const char *prog_path = SRCDIR "executable-shell-script";
+    const char *prog_argv[2] = { prog_path, NULL };
+
+    int err = posix_spawnp (&child, prog_path, &actions, NULL,
+                            (char **) prog_argv, environ);
+    if (err != 0)
+      {
+        errno = err;
+        perror ("posix_spawn");
+        return 1;
+      }
+
+    posix_spawn_file_actions_destroy (&actions);
+
+    /* Wait for child.  */
+    int status = 0;
+    while (waitpid (child, &status, 0) != child)
+      ;
+    if (!WIFEXITED (status))
+      {
+        fprintf (stderr, "subprocess terminated with unexpected wait status %d\n", status);
+        return 1;
+      }
+    int exitstatus = WEXITSTATUS (status);
+    if (exitstatus != 0)
+      {
+        fprintf (stderr, "subprocess terminated with unexpected exit status %d\n", exitstatus);
+        return 1;
+      }
+
+    /* Check the contents of the data file.  */
+    FILE *fp = fopen (DATA_FILENAME, "rb");
+    if (fp == NULL)
+      {
+        perror ("cannot open data file");
+        return 1;
+      }
+    char buf[1024];
+    int nread = fread (buf, 1, sizeof (buf), fp);
+    if (!(nread == 11 && memcmp (buf, "Halle Potta", 11) == 0))
+      {
+        fprintf (stderr, "data file wrong: has %d bytes, expected %d bytes\n", nread, 11);
+        return 1;
+      }
+    if (fclose (fp))
+      {
+        perror ("cannot close data file");
+        return 1;
+      }
+  }
+#endif
+
+  /* Clean up data file.  */
+  unlink (DATA_FILENAME);
+
+  return 0;
+}
index 4876974..83777eb 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of splitting a double into fraction and mantissa.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 29bb9e5..7ee9d2d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of splitting a 'long double' into fraction and mantissa.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
diff --git a/tests/test-pthread-c++.cc b/tests/test-pthread-c++.cc
new file mode 100644 (file)
index 0000000..8f33fc5
--- /dev/null
@@ -0,0 +1,295 @@
+/* Test of <pthread.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <pthread.h>
+
+#include "signature.h"
+
+
+/* =========== Thread functions =========== */
+
+#if GNULIB_TEST_PTHREAD_THREAD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_create, int,
+                 (pthread_t *, const pthread_attr_t *,
+                  void * (*) (void*), void *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_THREAD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_attr_init, int, (pthread_attr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_THREAD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_attr_getdetachstate, int,
+                 (const pthread_attr_t *, int *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_THREAD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_attr_setdetachstate, int,
+                 (pthread_attr_t *, int));
+#endif
+
+#if GNULIB_TEST_PTHREAD_THREAD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_attr_destroy, int,
+                 (pthread_attr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_THREAD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_self, pthread_t, (void));
+#endif
+
+#if GNULIB_TEST_PTHREAD_THREAD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_equal, int, (pthread_t, pthread_t));
+#endif
+
+#if GNULIB_TEST_PTHREAD_THREAD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_detach, int, (pthread_t));
+#endif
+
+#if GNULIB_TEST_PTHREAD_THREAD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_join, int, (pthread_t, void **));
+#endif
+
+#if GNULIB_TEST_PTHREAD_THREAD
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_exit, void, (void *));
+#endif
+
+/* =========== Once-only control (initialization) functions =========== */
+
+#if GNULIB_TEST_PTHREAD_ONCE
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_once, int,
+                 (pthread_once_t *, void (*) (void)));
+#endif
+
+/* =========== Mutex functions =========== */
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_init, int,
+                 (pthread_mutex_t *, const pthread_mutexattr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_init, int,
+                 (pthread_mutexattr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_gettype, int,
+                 (const pthread_mutexattr_t *, int *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_settype, int,
+                 (pthread_mutexattr_t *, int));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_getrobust, int,
+                 (const pthread_mutexattr_t *, int *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_setrobust, int,
+                 (pthread_mutexattr_t *, int));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutexattr_destroy, int,
+                 (pthread_mutexattr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_lock, int,
+                 (pthread_mutex_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_trylock, int,
+                 (pthread_mutex_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX_TIMEDLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_timedlock, int,
+                 (pthread_mutex_t *, const struct timespec *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_unlock, int,
+                 (pthread_mutex_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_MUTEX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_mutex_destroy, int,
+                 (pthread_mutex_t *));
+#endif
+
+/* =========== Read-write lock functions =========== */
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_init, int,
+                 (pthread_rwlock_t *, const pthread_rwlockattr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlockattr_init, int,
+                 (pthread_rwlockattr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlockattr_destroy, int,
+                 (pthread_rwlockattr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_rdlock, int,
+                 (pthread_rwlock_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_wrlock, int,
+                 (pthread_rwlock_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_tryrdlock, int,
+                 (pthread_rwlock_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_trywrlock, int,
+                 (pthread_rwlock_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_timedrdlock, int,
+                 (pthread_rwlock_t *, const struct timespec *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_timedwrlock, int,
+                 (pthread_rwlock_t *, const struct timespec *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_unlock, int,
+                 (pthread_rwlock_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_RWLOCK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_rwlock_destroy, int,
+                 (pthread_rwlock_t *));
+#endif
+
+/* =========== Condition variable functions =========== */
+
+#if GNULIB_TEST_PTHREAD_COND
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_init, int,
+                 (pthread_cond_t *, const pthread_condattr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_COND
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_condattr_init, int,
+                 (pthread_condattr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_COND
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_condattr_destroy, int,
+                 (pthread_condattr_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_COND
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_wait, int,
+                 (pthread_cond_t *, pthread_mutex_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_COND
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_timedwait, int,
+                 (pthread_cond_t *, pthread_mutex_t *,
+                  const struct timespec *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_COND
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_signal, int,
+                 (pthread_cond_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_COND
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_broadcast, int,
+                 (pthread_cond_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_COND
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_cond_destroy, int,
+                 (pthread_cond_t *));
+#endif
+
+/* =========== Thread-specific storage functions =========== */
+
+#if GNULIB_TEST_PTHREAD_TSS
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_key_create, int,
+                 (pthread_key_t *, void (*) (void *)));
+#endif
+
+#if GNULIB_TEST_PTHREAD_TSS
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_setspecific, int,
+                 (pthread_key_t, const void *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_TSS
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_getspecific, void *,
+                 (pthread_key_t));
+#endif
+
+#if GNULIB_TEST_PTHREAD_TSS
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_key_delete, int, (pthread_key_t));
+#endif
+
+/* =========== Spinlock functions =========== */
+
+#if GNULIB_TEST_PTHREAD_SPIN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_spin_init, int,
+                 (pthread_spinlock_t *, int));
+#endif
+
+#if GNULIB_TEST_PTHREAD_SPIN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_spin_lock, int,
+                 (pthread_spinlock_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_SPIN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_spin_trylock, int,
+                 (pthread_spinlock_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_SPIN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_spin_unlock, int,
+                 (pthread_spinlock_t *));
+#endif
+
+#if GNULIB_TEST_PTHREAD_SPIN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pthread_spin_destroy, int,
+                 (pthread_spinlock_t *));
+#endif
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-pthread-thread.c b/tests/test-pthread-thread.c
new file mode 100644 (file)
index 0000000..094e8d1
--- /dev/null
@@ -0,0 +1,73 @@
+/* Test of pthread_create () function.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2011.  */
+
+#include <config.h>
+
+#include <pthread.h>
+
+#include <stdio.h>
+#include <string.h>
+
+#include "macros.h"
+
+static pthread_t main_thread_before;
+static pthread_t main_thread_after;
+static pthread_t worker_thread;
+
+#define MAGIC ((void *) 1266074729)
+static volatile int work_done;
+
+static void *
+worker_thread_func (void *arg)
+{
+  work_done = 1;
+  return MAGIC;
+}
+
+int
+main ()
+{
+  main_thread_before = pthread_self ();
+
+  if (pthread_create (&worker_thread, NULL, worker_thread_func, NULL) == 0)
+    {
+      void *ret;
+
+      /* Check that pthread_self () has the same value before than after the
+         first call to pthread_create ().  */
+      main_thread_after = pthread_self ();
+      ASSERT (memcmp (&main_thread_before, &main_thread_after,
+                      sizeof (pthread_t))
+              == 0);
+
+      ASSERT (pthread_join (worker_thread, &ret) == 0);
+
+      /* Check the return value of the thread.  */
+      ASSERT (ret == MAGIC);
+
+      /* Check that worker_thread_func () has finished executing.  */
+      ASSERT (work_done);
+
+      return 0;
+    }
+  else
+    {
+      fputs ("pthread_create failed\n", stderr);
+      return 1;
+    }
+}
diff --git a/tests/test-pthread.c b/tests/test-pthread.c
new file mode 100644 (file)
index 0000000..89c68dc
--- /dev/null
@@ -0,0 +1,90 @@
+/* Test of <pthread.h> substitute.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+#include <pthread.h>
+
+#include "verify.h"
+
+/* Check that the types are all defined.  */
+
+pthread_t t1;
+pthread_attr_t t2;
+
+pthread_once_t t3 = PTHREAD_ONCE_INIT;
+
+pthread_mutex_t t4 = PTHREAD_MUTEX_INITIALIZER;
+pthread_mutexattr_t t5;
+
+pthread_rwlock_t t6 = PTHREAD_RWLOCK_INITIALIZER;
+pthread_rwlockattr_t t7;
+
+pthread_cond_t t8 = PTHREAD_COND_INITIALIZER;
+pthread_condattr_t t9;
+
+pthread_key_t t10;
+
+pthread_spinlock_t t11;
+
+#ifdef TODO /* Not implemented in gnulib yet */
+pthread_barrier_t t12;
+pthread_barrierattr_t t13;
+#endif
+
+/* Check that the various macros are defined.  */
+
+/* Constants for pthread_attr_setdetachstate().  */
+int ds[] = { PTHREAD_CREATE_JOINABLE, PTHREAD_CREATE_DETACHED };
+
+/* Constants for pthread_exit().  */
+void *canceled = PTHREAD_CANCELED;
+
+/* Constants for pthread_mutexattr_settype().  */
+int mt[] = {
+  PTHREAD_MUTEX_DEFAULT,
+  PTHREAD_MUTEX_NORMAL,
+  PTHREAD_MUTEX_RECURSIVE,
+  PTHREAD_MUTEX_ERRORCHECK
+};
+
+#ifdef TODO /* Not implemented in gnulib yet */
+
+/* Constants for pthread_mutexattr_setrobust().  */
+int mr[] = { PTHREAD_MUTEX_ROBUST, PTHREAD_MUTEX_STALLED };
+
+/* Constants for pthread_barrierattr_setpshared().  */
+int bp[] = { PTHREAD_PROCESS_SHARED, PTHREAD_PROCESS_PRIVATE };
+
+/* Constants for pthread_barrier_wait().  */
+int bw[] = { PTHREAD_BARRIER_SERIAL_THREAD };
+
+/* Constants for pthread_setcancelstate().  */
+int cs[] = { PTHREAD_CANCEL_ENABLE, PTHREAD_CANCEL_DISABLE };
+
+/* Constants for pthread_setcanceltype().  */
+int ct[] = { PTHREAD_CANCEL_DEFERRED, PTHREAD_CANCEL_ASYNCHRONOUS };
+
+#endif
+
+
+int
+main (void)
+{
+  return 0;
+}
diff --git a/tests/test-pthread_sigmask1.c b/tests/test-pthread_sigmask1.c
new file mode 100644 (file)
index 0000000..f12b17c
--- /dev/null
@@ -0,0 +1,95 @@
+/* Test of pthread_sigmask in a single-threaded program.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2011.  */
+
+#include <config.h>
+
+#include <signal.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (pthread_sigmask, int, (int, const sigset_t *, sigset_t *));
+
+#include <errno.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#if !(defined _WIN32 && !defined __CYGWIN__)
+
+static volatile int sigint_occurred;
+
+static void
+sigint_handler (int sig)
+{
+  sigint_occurred++;
+}
+
+int
+main (int argc, char *argv[])
+{
+  sigset_t set;
+  int pid = getpid ();
+  char command[80];
+
+  signal (SIGINT, sigint_handler);
+
+  sigemptyset (&set);
+  sigaddset (&set, SIGINT);
+
+  /* Check error handling.  */
+  ASSERT (pthread_sigmask (1729, &set, NULL) == EINVAL);
+
+  /* Block SIGINT.  */
+  ASSERT (pthread_sigmask (SIG_BLOCK, &set, NULL) == 0);
+
+  /* Request a SIGINT signal from outside.  */
+  sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
+  ASSERT (system (command) == 0);
+
+  /* Wait.  */
+  sleep (2);
+
+  /* The signal should not have arrived yet, because it is blocked.  */
+  ASSERT (sigint_occurred == 0);
+
+  /* Unblock SIGINT.  */
+  ASSERT (pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0);
+
+  /* The signal should have arrived now, because POSIX says
+       "If there are any pending unblocked signals after the call to
+        pthread_sigmask(), at least one of those signals shall be delivered
+        before the call to pthread_sigmask() returns."  */
+  ASSERT (sigint_occurred == 1);
+
+  return 0;
+}
+
+#else
+
+/* On native Windows, getpid() values and the arguments that are passed to
+   the (Cygwin?) 'kill' program are not necessarily related.  */
+
+int
+main ()
+{
+  fputs ("Skipping test: native Windows platform\n", stderr);
+  return 77;
+}
+
+#endif
diff --git a/tests/test-pthread_sigmask2.c b/tests/test-pthread_sigmask2.c
new file mode 100644 (file)
index 0000000..f57fc93
--- /dev/null
@@ -0,0 +1,105 @@
+/* Test of pthread_sigmask in a multi-threaded program.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2011.  */
+
+#include <config.h>
+
+#include <signal.h>
+
+#include <errno.h>
+#include <pthread.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+#if USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS
+
+static pthread_t main_thread;
+static pthread_t killer_thread;
+
+static void *
+killer_thread_func (void *arg)
+{
+  sleep (1);
+  pthread_kill (main_thread, SIGINT);
+  return NULL;
+}
+
+static volatile int sigint_occurred;
+
+static void
+sigint_handler (int sig)
+{
+  sigint_occurred++;
+}
+
+int
+main (int argc, char *argv[])
+{
+  sigset_t set;
+
+  signal (SIGINT, sigint_handler);
+
+  sigemptyset (&set);
+  sigaddset (&set, SIGINT);
+
+  /* Check error handling.  */
+  /* This call returns 0 on NetBSD 8.0.  */
+#if !defined __NetBSD__
+  ASSERT (pthread_sigmask (1729, &set, NULL) == EINVAL);
+#endif
+
+  /* Block SIGINT.  */
+  ASSERT (pthread_sigmask (SIG_BLOCK, &set, NULL) == 0);
+
+  /* Request a SIGINT signal from another thread.  */
+  main_thread = pthread_self ();
+  ASSERT (pthread_create (&killer_thread, NULL, killer_thread_func, NULL) == 0);
+
+  /* Wait.  */
+  sleep (2);
+
+  /* The signal should not have arrived yet, because it is blocked.  */
+  ASSERT (sigint_occurred == 0);
+
+  /* Unblock SIGINT.  */
+  ASSERT (pthread_sigmask (SIG_UNBLOCK, &set, NULL) == 0);
+
+  /* The signal should have arrived now, because POSIX says
+       "If there are any pending unblocked signals after the call to
+        pthread_sigmask(), at least one of those signals shall be delivered
+        before the call to pthread_sigmask() returns."  */
+  ASSERT (sigint_occurred == 1);
+
+  /* Clean up the thread.  This avoid a "ThreadSanitizer: thread leak" warning
+     from "gcc -fsanitize=thread".  */
+  ASSERT (pthread_join (killer_thread, NULL) == 0);
+
+  return 0;
+}
+
+#else
+
+int
+main ()
+{
+  fputs ("Skipping test: POSIX threads not enabled\n", stderr);
+  return 77;
+}
+
+#endif
index 99b69f4..795e30f 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of quotearg family of functions.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2008.  */
 
index 6e8510e..065b54b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of quotearg family of functions.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2008.  */
 
index b793e97..d7fe02b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test raising a signal.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include <signal.h>
+#include <unistd.h>
 
 #include "signature.h"
 SIGNATURE_CHECK (raise, int, (int));
@@ -31,7 +32,7 @@ SIGNATURE_CHECK (raise, int, (int));
 static _Noreturn void
 handler (int sig)
 {
-  exit (0);
+  _exit (0);
 }
 
 int
index 4f4ec7b..f53f875 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2021 Free Software Foundation, Inc.
  * Written by Eric Blake and Bruno Haible
  *
  * This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/tests/test-read-file.c b/tests/test-read-file.c
new file mode 100644 (file)
index 0000000..b63c25b
--- /dev/null
@@ -0,0 +1,124 @@
+/*
+ * Copyright (C) 2006-2007, 2010-2021 Free Software Foundation, Inc.
+ * Written by Simon Josefsson
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "read-file.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+
+#include "macros.h"
+
+#define FILE1 "/etc/resolv.conf"
+#define FILE2 "/dev/null"
+
+static int
+test_read_file (int flags)
+{
+  struct stat statbuf;
+  int err = 0;
+
+  /* We can perform the test only if the file exists and is readable.
+     Test whether it exists, then assume it is world-readable.  */
+  if (stat (FILE1, &statbuf) >= 0)
+    {
+      size_t len;
+      char *out = read_file (FILE1, flags, &len);
+
+      if (!out)
+        {
+          perror ("Could not read file");
+          err = 1;
+        }
+      else
+        {
+          if (out[len] != '\0')
+            {
+              perror ("BAD: out[len] not zero");
+              err = 1;
+            }
+
+          if (S_ISREG (statbuf.st_mode))
+            {
+              /* FILE1 is a regular file or a symlink to a regular file.  */
+              if (len != statbuf.st_size)
+                {
+                  fprintf (stderr, "Read %lu from %s...\n",
+                           (unsigned long) len, FILE1);
+                  err = 1;
+                }
+            }
+          else
+            {
+              /* Assume FILE1 is not empty.  */
+              if (len == 0)
+                {
+                  fprintf (stderr, "Read nothing from %s\n", FILE1);
+                  err = 1;
+                }
+            }
+          free (out);
+        }
+    }
+
+  /* We can perform the test only if the file exists and is readable.
+     Test whether it exists, then assume it is world-readable.  */
+  if (stat (FILE2, &statbuf) >= 0)
+    {
+      size_t len;
+      char *out = read_file (FILE2, flags, &len);
+
+      if (!out)
+        {
+          perror ("Could not read file");
+          err = 1;
+        }
+      else
+        {
+          if (out[len] != '\0')
+            {
+              perror ("BAD: out[len] not zero");
+              err = 1;
+            }
+
+          /* /dev/null should always be empty.  Ignore statbuf.st_size, since it
+             is not a regular file.  */
+          if (len != 0)
+            {
+              fprintf (stderr, "Read %lu from %s...\n",
+                       (unsigned long) len, FILE2);
+              err = 1;
+            }
+          free (out);
+        }
+    }
+
+  return err;
+}
+
+int
+main (void)
+{
+  ASSERT (!test_read_file (0));
+  ASSERT (!test_read_file (RF_BINARY));
+  ASSERT (!test_read_file (RF_SENSITIVE));
+  ASSERT (!test_read_file (RF_BINARY | RF_SENSITIVE));
+
+  return 0;
+}
index fdff6e1..e2ab9df 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of readlink.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index cba98f6..c95d889 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of readlink.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
diff --git a/tests/test-realloc-gnu.c b/tests/test-realloc-gnu.c
new file mode 100644 (file)
index 0000000..6f98be0
--- /dev/null
@@ -0,0 +1,49 @@
+/* Test of realloc function.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdlib.h>
+
+#include <errno.h>
+#include <stdint.h>
+
+#include "macros.h"
+
+int
+main (int argc, char **argv)
+{
+  /* Check that realloc (NULL, 0) is not a NULL pointer.  */
+  void *volatile p = realloc (NULL, 0);
+  ASSERT (p != NULL);
+
+  /* Check that realloc (p, n) fails when p is non-null and n exceeds
+     PTRDIFF_MAX.  */
+  if (PTRDIFF_MAX < SIZE_MAX)
+    {
+      size_t one = argc != 12345;
+      p = realloc (p, PTRDIFF_MAX + one);
+      ASSERT (p == NULL);
+      /* Avoid a test failure due to glibc bug
+         <https://sourceware.org/bugzilla/show_bug.cgi?id=27870>.  */
+      if (!getenv ("MALLOC_CHECK_"))
+        ASSERT (errno == ENOMEM);
+    }
+
+  free (p);
+  return 0;
+}
diff --git a/tests/test-reallocarray.c b/tests/test-reallocarray.c
new file mode 100644 (file)
index 0000000..f0839ff
--- /dev/null
@@ -0,0 +1,55 @@
+/* Test of reallocarray function.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <stdlib.h>
+
+#include <errno.h>
+#include <stdint.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (reallocarray, void *, (void *, size_t, size_t));
+
+#include "macros.h"
+
+int
+main ()
+{
+  /* Check that reallocarray fails when requested to allocate a block
+     of memory larger than PTRDIFF_MAX or SIZE_MAX bytes.  */
+  for (size_t n = 2; n != 0; n <<= 1)
+    {
+      void *volatile p = NULL;
+
+      p = reallocarray (p, PTRDIFF_MAX / n + 1, n);
+      ASSERT (p == NULL);
+      ASSERT (errno == ENOMEM);
+
+      p = reallocarray (p, SIZE_MAX / n + 1, n);
+      ASSERT (p == NULL);
+      ASSERT (errno == ENOMEM
+              || errno == EOVERFLOW /* NetBSD */);
+
+      /* Reallocarray should not crash with zero sizes.  */
+      p = reallocarray (p, 0, n);
+      p = reallocarray (p, n, 0);
+      free (p);
+    }
+
+  return 0;
+}
index c0d9824..adccf21 100644 (file)
@@ -1,5 +1,5 @@
 /* Test regular expressions
-   Copyright 1996-2001, 2003-2016 Free Software Foundation, Inc.
+   Copyright 1996-2001, 2003-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 
 #include <locale.h>
 #include <limits.h>
+#include <stdarg.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <wctype.h>
 #if HAVE_DECL_ALARM
 # include <unistd.h>
 # include <signal.h>
 
 #include "localcharset.h"
 
+static int exit_status;
+
+static void
+report_error (char const *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  fprintf (stderr, "test-regex: ");
+  vfprintf (stderr, format, args);
+  fprintf (stderr, "\n");
+  va_end (args);
+  exit_status = 1;
+}
+
+/* Check whether it's really a UTF-8 locale.
+   On mingw, setlocale (LC_ALL, "en_US.UTF-8") succeeds but returns
+   "English_United States.1252", with locale_charset () returning "CP1252".  */
+static int
+really_utf8 (void)
+{
+  return strcmp (locale_charset (), "UTF-8") == 0;
+}
+
+/* Tests supposed to match; copied from glibc posix/bug-regex11.c.  */
+static struct
+{
+  const char *pattern;
+  const char *string;
+  int flags, nmatch;
+  regmatch_t rm[5];
+} const tests[] = {
+  /* Test for newline handling in regex.  */
+  { "[^~]*~", "\nx~y", 0, 2, { { 0, 3 }, { -1, -1 } } },
+  /* Other tests.  */
+  { "a(.*)b", "a b", REG_EXTENDED, 2, { { 0, 3 }, { 1, 2 } } },
+  { ".*|\\([KIO]\\)\\([^|]*\\).*|?[KIO]", "10~.~|P|K0|I10|O16|?KSb", 0, 3,
+    { { 0, 21 }, { 15, 16 }, { 16, 18 } } },
+  { ".*|\\([KIO]\\)\\([^|]*\\).*|?\\1", "10~.~|P|K0|I10|O16|?KSb", 0, 3,
+    { { 0, 21 }, { 8, 9 }, { 9, 10 } } },
+  { "^\\(a*\\)\\1\\{9\\}\\(a\\{0,9\\}\\)\\([0-9]*;.*[^a]\\2\\([0-9]\\)\\)",
+    "a1;;0a1aa2aaa3aaaa4aaaaa5aaaaaa6aaaaaaa7aaaaaaaa8aaaaaaaaa9aa2aa1a0", 0,
+    5, { { 0, 67 }, { 0, 0 }, { 0, 1 }, { 1, 67 }, { 66, 67 } } },
+  /* Test for BRE expression anchoring.  POSIX says just that this may match;
+     in glibc regex it always matched, so avoid changing it.  */
+  { "\\(^\\|foo\\)bar", "bar", 0, 2, { { 0, 3 }, { -1, -1 } } },
+  { "\\(foo\\|^\\)bar", "bar", 0, 2, { { 0, 3 }, { -1, -1 } } },
+  /* In ERE this must be treated as an anchor.  */
+  { "(^|foo)bar", "bar", REG_EXTENDED, 2, { { 0, 3 }, { -1, -1 } } },
+  { "(foo|^)bar", "bar", REG_EXTENDED, 2, { { 0, 3 }, { -1, -1 } } },
+  /* Here ^ cannot be treated as an anchor according to POSIX.  */
+  { "(^|foo)bar", "(^|foo)bar", 0, 2, { { 0, 10 }, { -1, -1 } } },
+  { "(foo|^)bar", "(foo|^)bar", 0, 2, { { 0, 10 }, { -1, -1 } } },
+  /* More tests on backreferences.  */
+  { "()\\1", "x", REG_EXTENDED, 2, { { 0, 0 }, { 0, 0 } } },
+  { "()x\\1", "x", REG_EXTENDED, 2, { { 0, 1 }, { 0, 0 } } },
+  { "()\\1*\\1*", "", REG_EXTENDED, 2, { { 0, 0 }, { 0, 0 } } },
+  { "([0-9]).*\\1(a*)", "7;7a6", REG_EXTENDED, 3, { { 0, 4 }, { 0, 1 }, { 3, 4 } } },
+  { "([0-9]).*\\1(a*)", "7;7a", REG_EXTENDED, 3, { { 0, 4 }, { 0, 1 }, { 3, 4 } } },
+  { "(b)()c\\1", "bcb", REG_EXTENDED, 3, { { 0, 3 }, { 0, 1 }, { 1, 1 } } },
+  { "()(b)c\\2", "bcb", REG_EXTENDED, 3, { { 0, 3 }, { 0, 0 }, { 0, 1 } } },
+  { "a(b)()c\\1", "abcb", REG_EXTENDED, 3, { { 0, 4 }, { 1, 2 }, { 2, 2 } } },
+  { "a()(b)c\\2", "abcb", REG_EXTENDED, 3, { { 0, 4 }, { 1, 1 }, { 1, 2 } } },
+  { "()(b)\\1c\\2", "bcb", REG_EXTENDED, 3, { { 0, 3 }, { 0, 0 }, { 0, 1 } } },
+  { "(b())\\2\\1", "bbbb", REG_EXTENDED, 3, { { 0, 2 }, { 0, 1 }, { 1, 1 } } },
+  { "a()(b)\\1c\\2", "abcb", REG_EXTENDED, 3, { { 0, 4 }, { 1, 1 }, { 1, 2 } } },
+  { "a()d(b)\\1c\\2", "adbcb", REG_EXTENDED, 3, { { 0, 5 }, { 1, 1 }, { 2, 3 } } },
+  { "a(b())\\2\\1", "abbbb", REG_EXTENDED, 3, { { 0, 3 }, { 1, 2 }, { 2, 2 } } },
+  { "(bb())\\2\\1", "bbbb", REG_EXTENDED, 3, { { 0, 4 }, { 0, 2 }, { 2, 2 } } },
+  { "^([^,]*),\\1,\\1$", "a,a,a", REG_EXTENDED, 2, { { 0, 5 }, { 0, 1 } } },
+  { "^([^,]*),\\1,\\1$", "ab,ab,ab", REG_EXTENDED, 2, { { 0, 8 }, { 0, 2 } } },
+  { "^([^,]*),\\1,\\1,\\1$", "abc,abc,abc,abc", REG_EXTENDED, 2,
+    { { 0, 15 }, { 0, 3 } } },
+  { "^(.?)(.?)(.?)(.?)(.?).?\\5\\4\\3\\2\\1$",
+    "level", REG_NOSUB | REG_EXTENDED, 0, { { -1, -1 } } },
+  { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$|^.?$",
+    "level", REG_NOSUB | REG_EXTENDED, 0, { { -1, -1 } } },
+  { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$|^.?$",
+    "abcdedcba", REG_EXTENDED, 1, { { 0, 9 } } },
+  /* XXX Not used since they fail so far.  */
+  { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$|^.?$",
+    "ababababa", REG_EXTENDED, 1, { { 0, 9 } } },
+  { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$",
+    "level", REG_NOSUB | REG_EXTENDED, 0, { { -1, -1 } } },
+  { "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$",
+    "ababababa", REG_EXTENDED, 1, { { 0, 9 } } },
+};
+
+static void
+bug_regex11 (void)
+{
+  regex_t re;
+  regmatch_t rm[5];
+  size_t i;
+  int n;
+
+  for (i = 0; i < sizeof (tests) / sizeof (tests[0]); ++i)
+    {
+      n = regcomp (&re, tests[i].pattern, tests[i].flags);
+      if (n != 0)
+       {
+         char buf[500];
+         regerror (n, &re, buf, sizeof (buf));
+         report_error ("%s: regcomp %zd failed: %s", tests[i].pattern, i, buf);
+         continue;
+       }
+
+      if (regexec (&re, tests[i].string, tests[i].nmatch, rm, 0))
+       {
+         report_error ("%s: regexec %zd failed", tests[i].pattern, i);
+         regfree (&re);
+         continue;
+       }
+
+      for (n = 0; n < tests[i].nmatch; ++n)
+       if (rm[n].rm_so != tests[i].rm[n].rm_so
+              || rm[n].rm_eo != tests[i].rm[n].rm_eo)
+         {
+           if (tests[i].rm[n].rm_so == -1 && tests[i].rm[n].rm_eo == -1)
+             break;
+           report_error ("%s: regexec %zd match failure rm[%d] %d..%d",
+                          tests[i].pattern, i, n, rm[n].rm_so, rm[n].rm_eo);
+           break;
+         }
+
+      regfree (&re);
+    }
+}
+
 int
 main (void)
 {
-  int result = 0;
   static struct re_pattern_buffer regex;
   unsigned char folded_chars[UCHAR_MAX + 1];
   int i;
@@ -40,15 +170,19 @@ main (void)
   struct re_registers regs;
 
 #if HAVE_DECL_ALARM
-  /* Some builds of glibc go into an infinite loop on this test.  */
-  int alarm_value = 2;
+  /* In case a bug causes glibc to go into an infinite loop.
+     The tests should take less than 10 s on a reasonably modern CPU.  */
+  int alarm_value = 1000;
   signal (SIGALRM, SIG_DFL);
   alarm (alarm_value);
 #endif
+
+  bug_regex11 ();
+
   if (setlocale (LC_ALL, "en_US.UTF-8"))
     {
       {
-        /* http://sourceware.org/ml/libc-hacker/2006-09/msg00008.html
+        /* https://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
@@ -61,29 +195,26 @@ main (void)
         memset (&regex, 0, sizeof regex);
         s = re_compile_pattern (pat, sizeof pat - 1, &regex);
         if (s)
-          result |= 1;
+          report_error ("%s: %s", pat, s);
         else
           {
             memset (&regs, 0, sizeof regs);
-            if (re_search (&regex, data, sizeof data - 1,
-                           0, sizeof data - 1, &regs)
-                != -1)
-              result |= 1;
+            i = re_search (&regex, data, sizeof data - 1,
+                           0, sizeof data - 1, &regs);
+            if (i != -1)
+              report_error ("re_search '%s' on '%s' returned %d",
+                            pat, data, i);
             regfree (&regex);
             free (regs.start);
             free (regs.end);
           }
       }
 
-      /* Check whether it's really a UTF-8 locale.
-         On mingw, the setlocale call succeeds but returns
-         "English_United States.1252", with locale_charset() returning
-         "CP1252".  */
-      if (strcmp (locale_charset (), "UTF-8") == 0)
+      if (really_utf8 ())
         {
           /* This test is from glibc bug 15078.
              The test case is from Andreas Schwab in
-             <http://www.sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
+             <https://sourceware.org/ml/libc-alpha/2013-01/msg00967.html>.
           */
           static char const pat[] = "[^x]x";
           static char const data[] =
@@ -101,14 +232,15 @@ main (void)
           memset (&regex, 0, sizeof regex);
           s = re_compile_pattern (pat, sizeof pat - 1, &regex);
           if (s)
-            result |= 1;
+            report_error ("%s: %s", pat, s);
           else
             {
               memset (&regs, 0, sizeof regs);
               i = re_search (&regex, data, sizeof data - 1,
                              0, sizeof data - 1, 0);
               if (i != 0 && i != 21)
-                result |= 1;
+                report_error ("re_search '%s' on '%s' returned %d",
+                              pat, data, i);
               regfree (&regex);
               free (regs.start);
               free (regs.end);
@@ -116,21 +248,65 @@ main (void)
         }
 
       if (! setlocale (LC_ALL, "C"))
-        return 1;
+        {
+          report_error ("setlocale \"C\" failed");
+          return exit_status;
+        }
+    }
+
+  if (setlocale (LC_ALL, "tr_TR.UTF-8"))
+    {
+      if (really_utf8 () && towupper (L'i') == 0x0130 /* U+0130; see below.  */)
+        {
+          re_set_syntax (RE_SYNTAX_GREP | RE_ICASE);
+          memset (&regex, 0, sizeof regex);
+          static char const pat[] = "i";
+          s = re_compile_pattern (pat, sizeof pat - 1, &regex);
+          if (s)
+            report_error ("%s: %s", pat, s);
+          else
+            {
+              /* UTF-8 encoding of U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE.
+                 In Turkish, this is the upper-case equivalent of ASCII "i".
+                 Older versions of Gnulib failed to match "i" to U+0130 when
+                 ignoring case in Turkish <https://bugs.gnu.org/43577>.  */
+              static char const data[] = "\xc4\xb0";
+
+              memset (&regs, 0, sizeof regs);
+              i = re_search (&regex, data, sizeof data - 1, 0, sizeof data - 1,
+                             &regs);
+              if (i != 0)
+                report_error ("re_search '%s' on '%s' returned %d",
+                              pat, data, i);
+              regfree (&regex);
+              free (regs.start);
+              free (regs.end);
+            }
+        }
+
+      if (! setlocale (LC_ALL, "C"))
+        {
+          report_error ("setlocale \"C\" failed");
+          return exit_status;
+        }
     }
 
   /* 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);
+  static char const pat_3957[] = "a[^x]b";
+  s = re_compile_pattern (pat_3957, sizeof pat_3957 - 1, &regex);
   if (s)
-    result |= 2;
-  /* This should fail, but succeeds for glibc-2.5.  */
+    report_error ("%s: %s", pat_3957, s);
   else
     {
+      /* This should fail, but succeeds for glibc-2.5.  */
       memset (&regs, 0, sizeof regs);
-      if (re_search (&regex, "a\nb", 3, 0, 3, &regs) != -1)
-        result |= 2;
+      static char const data[] = "a\nb";
+      i = re_search (&regex, data, sizeof data - 1, 0, sizeof data - 1, &regs);
+      if (i != -1)
+        report_error ("re_search '%s' on '%s' returned %d",
+                      pat_3957, data, i);
       regfree (&regex);
       free (regs.start);
       free (regs.end);
@@ -143,11 +319,12 @@ main (void)
   for (i = 0; i <= UCHAR_MAX; i++)
     folded_chars[i] = i;
   regex.translate = folded_chars;
-  s = re_compile_pattern ("a[[:@:>@:]]b\n", 11, &regex);
+  static char const pat75[] = "a[[:@:>@:]]b\n";
+  s = re_compile_pattern (pat75, sizeof pat75 - 1, &regex);
   /* This should fail with _Invalid character class name_ error.  */
   if (!s)
     {
-      result |= 4;
+      report_error ("re_compile_pattern: failed to reject '%s'", pat75);
       regfree (&regex);
     }
 
@@ -155,48 +332,57 @@ main (void)
      using RE_NO_EMPTY_RANGES. */
   re_set_syntax (RE_SYNTAX_POSIX_EGREP | RE_NO_EMPTY_RANGES);
   memset (&regex, 0, sizeof regex);
-  s = re_compile_pattern ("a[b-a]", 6, &regex);
+  static char const pat_b_a[] = "a[b-a]";
+  s = re_compile_pattern (pat_b_a, sizeof pat_b_a - 1, &regex);
   if (s == 0)
     {
-      result |= 8;
+      report_error ("re_compile_pattern: failed to reject '%s'", pat_b_a);
       regfree (&regex);
     }
 
   /* This should succeed, but does not for glibc-2.1.3.  */
   memset (&regex, 0, sizeof regex);
-  s = re_compile_pattern ("{1", 2, &regex);
+  static char const pat_213[] = "{1";
+  s = re_compile_pattern (pat_213, sizeof pat_213 - 1, &regex);
   if (s)
-    result |= 8;
+    report_error ("%s: %s", pat_213, s);
   else
     regfree (&regex);
 
   /* 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);
+  static char const pat_stolfi[] = "[an\371]*n";
+  s = re_compile_pattern (pat_stolfi, sizeof pat_stolfi - 1, &regex);
   if (s)
-    result |= 8;
+    report_error ("%s: %s", pat_stolfi, s);
   /* This should match, but does not for glibc-2.2.1.  */
   else
     {
       memset (&regs, 0, sizeof regs);
-      if (re_match (&regex, "an", 2, 0, &regs) != 2)
-        result |= 8;
+      static char const data[] = "an";
+      i = re_match (&regex, data, sizeof data - 1, 0, &regs);
+      if (i != 2)
+        report_error ("re_match '%s' on '%s' at 2 returned %d",
+                      pat_stolfi, data, i);
       regfree (&regex);
       free (regs.start);
       free (regs.end);
     }
 
   memset (&regex, 0, sizeof regex);
-  s = re_compile_pattern ("x", 1, &regex);
+  static char const pat_x[] = "x";
+  s = re_compile_pattern (pat_x, sizeof pat_x - 1, &regex);
   if (s)
-    result |= 8;
+    report_error ("%s: %s", pat_x, s);
   /* glibc-2.2.93 does not work with a negative RANGE argument.  */
   else
     {
       memset (&regs, 0, sizeof regs);
-      if (re_search (&regex, "wxy", 3, 2, -2, &regs) != 1)
-        result |= 8;
+      static char const data[] = "wxy";
+      i = re_search (&regex, data, sizeof data - 1, 2, -2, &regs);
+      if (i != 1)
+        report_error ("re_search '%s' on '%s' returned %d", pat_x, data, i);
       regfree (&regex);
       free (regs.start);
       free (regs.end);
@@ -206,36 +392,81 @@ main (void)
      ignored RE_ICASE.  Detect that problem too.  */
   re_set_syntax (RE_SYNTAX_EMACS | RE_ICASE);
   memset (&regex, 0, sizeof regex);
-  s = re_compile_pattern ("x", 1, &regex);
+  s = re_compile_pattern (pat_x, 1, &regex);
+  if (s)
+    report_error ("%s: %s", pat_x, s);
+  else
+    {
+      memset (&regs, 0, sizeof regs);
+      static char const data[] = "WXY";
+      i = re_search (&regex, data, sizeof data - 1, 0, 3, &regs);
+      if (i < 0)
+        report_error ("re_search '%s' on '%s' returned %d", pat_x, data, i);
+      regfree (&regex);
+      free (regs.start);
+      free (regs.end);
+    }
+
+  /* glibc bug 11053.  */
+  re_set_syntax (RE_SYNTAX_POSIX_BASIC);
+  memset (&regex, 0, sizeof regex);
+  static char const pat_sub2[] = "\\(a*\\)*a*\\1";
+  s = re_compile_pattern (pat_sub2, sizeof pat_sub2 - 1, &regex);
   if (s)
-    result |= 16;
+    report_error ("%s: %s", pat_sub2, s);
   else
     {
       memset (&regs, 0, sizeof regs);
-      if (re_search (&regex, "WXY", 3, 0, 3, &regs) < 0)
-        result |= 16;
+      static char const data[] = "a";
+      int datalen = sizeof data - 1;
+      i = re_search (&regex, data, datalen, 0, datalen, &regs);
+      if (i != 0)
+        report_error ("re_search '%s' on '%s' returned %d", pat_sub2, data, i);
+      else if (regs.num_regs < 2)
+        report_error ("re_search '%s' on '%s' returned only %d registers",
+                      pat_sub2, data, (int) regs.num_regs);
+      else if (! (regs.start[0] == 0 && regs.end[0] == 1))
+        report_error ("re_search '%s' on '%s' returned wrong match [%d,%d)",
+                      pat_sub2, data, (int) regs.start[0], (int) regs.end[0]);
+      else if (! (regs.start[1] == 0 && regs.end[1] == 0))
+        report_error ("re_search '%s' on '%s' returned wrong submatch [%d,%d)",
+                      pat_sub2, data, regs.start[1], regs.end[1]);
       regfree (&regex);
       free (regs.start);
       free (regs.end);
     }
 
   /* Catch a bug reported by Vin Shelton in
-     http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00089.html
+     https://lists.gnu.org/r/bug-coreutils/2007-06/msg00089.html
      */
   re_set_syntax (RE_SYNTAX_POSIX_BASIC
                  & ~RE_CONTEXT_INVALID_DUP
                  & ~RE_NO_EMPTY_RANGES);
-  memset (&regex, 0, sizeof regex);
-  s = re_compile_pattern ("[[:alnum:]_-]\\\\+$", 16, &regex);
+  static char const pat_shelton[] = "[[:alnum:]_-]\\\\+$";
+  s = re_compile_pattern (pat_shelton, sizeof pat_shelton - 1, &regex);
   if (s)
-    result |= 32;
+    report_error ("%s: %s", pat_shelton, s);
   else
     regfree (&regex);
 
   /* REG_STARTEND was added to glibc on 2004-01-15.
      Reject older versions.  */
-  if (! REG_STARTEND)
-    result |= 64;
+  if (REG_STARTEND == 0)
+    report_error ("REG_STARTEND is zero");
+
+  /* Matching with the compiled form of this regexp would provoke
+     an assertion failure prior to glibc-2.28:
+       regexec.c:1375: pop_fail_stack: Assertion 'num >= 0' failed
+     With glibc-2.28, compilation fails and reports the invalid
+     back reference.  */
+  re_set_syntax (RE_SYNTAX_POSIX_EGREP);
+  memset (&regex, 0, sizeof regex);
+  static char const pat_badback[] = "0|()0|\\1|0";
+  s = re_compile_pattern (pat_badback, sizeof pat_badback, &regex);
+  if (!s)
+    s = "failed to report invalid back reference";
+  if (strcmp (s, "Invalid back reference") != 0)
+    report_error ("%s: %s", pat_badback, s);
 
 #if 0
   /* It would be nice to reject hosts whose regoff_t values are too
@@ -246,8 +477,8 @@ main (void)
      when compiling --without-included-regex.   */
   if (sizeof (regoff_t) < sizeof (ptrdiff_t)
       || sizeof (regoff_t) < sizeof (ssize_t))
-    result |= 64;
+    report_error ("regoff_t values are too narrow");
 #endif
 
-  return result;
+  return exit_status;
 }
index 18f45e7..a9f3fbd 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of rename() function.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 71adeaf..50fcb9e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of rename() function.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* This file is designed to test both rename(a,b) and
    renameat(AT_FDCWD,a,AT_FDCWD,b).  FUNC is the function to test.
@@ -339,12 +339,14 @@ test_rename (int (*func) (char const *, char const *), bool print)
         errno = 0;
         ASSERT (func (BASE "dir2", BASE "dir/.") == -1);
         ASSERT (errno == EINVAL || errno == EBUSY || errno == EISDIR
-                || errno == ENOTEMPTY || errno == EEXIST);
+                || errno == ENOTEMPTY || errno == EEXIST
+                || errno == ENOENT /* WSL */);
       }
       {
         errno = 0;
         ASSERT (func (BASE "dir2/.", BASE "dir") == -1);
-        ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST);
+        ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST
+                || errno == ENOENT /* WSL */);
       }
       ASSERT (rmdir (BASE "dir") == 0);
       /* Files present here:
@@ -366,12 +368,14 @@ test_rename (int (*func) (char const *, char const *), bool print)
         errno = 0;
         ASSERT (func (BASE "dir2", BASE "dir/.//") == -1);
         ASSERT (errno == EINVAL || errno == EBUSY || errno == EISDIR
-                || errno == ENOTEMPTY || errno == EEXIST);
+                || errno == ENOTEMPTY || errno == EEXIST
+                || errno == ENOENT /* WSL */);
       }
       {
         errno = 0;
         ASSERT (func (BASE "dir2/.//", BASE "dir") == -1);
-        ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST);
+        ASSERT (errno == EINVAL || errno == EBUSY || errno == EEXIST
+                || errno == ENOENT /* WSL */);
       }
       ASSERT (rmdir (BASE "dir2") == 0);
       /* Files present here:
@@ -522,7 +526,13 @@ test_rename (int (*func) (char const *, char const *), bool print)
   { /* File onto hard link.  */
     ASSERT (func (BASE "file", BASE "file2") == 0);
     memset (&st, 0, sizeof st);
-    ASSERT (stat (BASE "file", &st) == 0);
+    if (stat (BASE "file", &st) != 0)
+      {
+        /* This can happen on NetBSD.  */
+        ASSERT (errno == ENOENT);
+        ASSERT (link (BASE "file2", BASE "file") == 0);
+        ASSERT (stat (BASE "file", &st) == 0);
+      }
     ASSERT (st.st_size == 2);
     memset (&st, 0, sizeof st);
     ASSERT (stat (BASE "file2", &st) == 0);
index 192525c..dd84ea4 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of rmdir.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index 5cccd05..3b8a4ef 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of rmdir.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index 52e0a8a..f3c4195 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sched.h> substitute.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
diff --git a/tests/test-scratch-buffer.c b/tests/test-scratch-buffer.c
new file mode 100644 (file)
index 0000000..517d73f
--- /dev/null
@@ -0,0 +1,130 @@
+/* Test of scratch_buffer functions.
+   Copyright (C) 2018-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2018.  */
+
+#include <config.h>
+
+#include <scratch_buffer.h>
+
+#include <string.h>
+#include "macros.h"
+
+static int
+byte_at (unsigned long long int i)
+{
+  return ((i % 13) + ((i * i) % 251)) & 0xff;
+}
+
+int
+main ()
+{
+  /* Check scratch_buffer_set_array_size.  */
+  {
+    size_t sizes[] = { 100, 1000, 10000, 100000 };
+    size_t s;
+    for (s = 0; s < SIZEOF (sizes); s++)
+      {
+        size_t size = sizes[s];
+        struct scratch_buffer buf;
+        bool ok;
+        size_t i;
+
+        scratch_buffer_init (&buf);
+
+        ok = scratch_buffer_set_array_size (&buf, size, 1);
+        ASSERT (ok);
+
+        for (i = 0; i < size; i++)
+          ((unsigned char *) buf.data)[i] = byte_at (i);
+
+        memset (buf.data, 'x', buf.length);
+        memset (buf.data, 'y', size);
+
+        scratch_buffer_free (&buf);
+      }
+  }
+
+  /* Check scratch_buffer_grow.  */
+  {
+    size_t sizes[] = { 100, 1000, 10000, 100000 };
+    size_t s;
+    for (s = 0; s < SIZEOF (sizes); s++)
+      {
+        size_t size = sizes[s];
+        struct scratch_buffer buf;
+        bool ok;
+        size_t i;
+
+        scratch_buffer_init (&buf);
+
+        while (buf.length < size)
+          {
+            ok = scratch_buffer_grow (&buf);
+            ASSERT (ok);
+          }
+
+        for (i = 0; i < size; i++)
+          ((unsigned char *) buf.data)[i] = byte_at (i);
+
+        memset (buf.data, 'x', buf.length);
+        memset (buf.data, 'y', size);
+
+        scratch_buffer_free (&buf);
+      }
+  }
+
+  /* Check scratch_buffer_grow_preserve.  */
+  {
+    size_t sizes[] = { 100, 1000, 10000, 100000 };
+    struct scratch_buffer buf;
+    size_t s;
+    size_t size;
+    bool ok;
+    size_t i;
+
+    scratch_buffer_init (&buf);
+
+    s = 0;
+    size = sizes[s];
+    ok = scratch_buffer_set_array_size (&buf, size, 1);
+    ASSERT (ok);
+
+    for (i = 0; i < size; i++)
+      ((unsigned char *) buf.data)[i] = byte_at (i);
+
+    for (; s < SIZEOF (sizes); s++)
+      {
+        size_t oldsize = size;
+        size = sizes[s];
+
+        while (buf.length < size)
+          {
+            ok = scratch_buffer_grow_preserve (&buf);
+            ASSERT (ok);
+          }
+
+        for (i = 0; i < oldsize; i++)
+          ASSERT(((unsigned char *) buf.data)[i] == byte_at (i));
+        for (i = oldsize; i < size; i++)
+          ((unsigned char *) buf.data)[i] = byte_at (i);
+      }
+
+    scratch_buffer_free (&buf);
+  }
+
+  return 0;
+}
diff --git a/tests/test-select-fd.c b/tests/test-select-fd.c
new file mode 100644 (file)
index 0000000..229e821
--- /dev/null
@@ -0,0 +1,72 @@
+/* Test of select() substitute, reading or writing from a given file descriptor.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/select.h>
+
+int
+main (int argc, char *argv[])
+{
+  if (argc == 4)
+    {
+      char mode = argv[1][0];
+
+      if (mode == 'r' || mode == 'w')
+        {
+          int fd = atoi (argv[2]);
+
+          if (fd >= 0)
+            {
+              const char *result_file_name = argv[3];
+              FILE *result_file = fopen (result_file_name, "wb");
+
+              if (result_file != NULL)
+                {
+                  fd_set fds;
+                  struct timeval timeout;
+                  int ret;
+
+                  FD_ZERO (&fds);
+                  FD_SET (fd, &fds);
+                  timeout.tv_sec = 0;
+                  timeout.tv_usec = 10000;
+                  ret = (mode == 'r'
+                         ? select (fd + 1, &fds, NULL, NULL, &timeout)
+                         : select (fd + 1, NULL, &fds, NULL, &timeout));
+                  if (ret < 0)
+                    {
+                      perror ("select failed");
+                      exit (1);
+                    }
+                  if ((ret == 0) != ! FD_ISSET (fd, &fds))
+                    {
+                      fprintf (stderr, "incorrect return value\n");
+                      exit (1);
+                    }
+                  fprintf (result_file, "%d\n", ret);
+                  exit (0);
+                }
+            }
+        }
+    }
+  fprintf (stderr, "Usage: test-select-fd mode fd result-file-name\n");
+  exit (1);
+}
diff --git a/tests/test-select-in.sh b/tests/test-select-in.sh
new file mode 100755 (executable)
index 0000000..68176d3
--- /dev/null
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Test select() on file descriptors opened for reading.
+
+# This test is known to fail on Solaris 2.6 and older, due to its handling
+# of /dev/null.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles t-select-in.tmp"
+
+# Regular files.
+
+rm -f t-select-in.tmp
+${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < ./test-select-fd${EXEEXT}
+test `cat t-select-in.tmp` = "1" || exit 1
+
+# Pipes.
+
+rm -f t-select-in.tmp
+{ sleep 1; echo abc; } | \
+  { ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; cat > /dev/null; }
+test `cat t-select-in.tmp` = "0" || exit 1
+
+rm -f t-select-in.tmp
+echo abc | { sleep 1; ${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp; }
+test `cat t-select-in.tmp` = "1" || exit 1
+
+# Special files.
+# This part of the test is known to fail on Solaris 2.6 and older.
+
+rm -f t-select-in.tmp
+${CHECKER} ./test-select-fd${EXEEXT} r 0 t-select-in.tmp < /dev/null
+test `cat t-select-in.tmp` = "1" || exit 1
+
+rm -fr $tmpfiles
+
+exit 0
diff --git a/tests/test-select-out.sh b/tests/test-select-out.sh
new file mode 100755 (executable)
index 0000000..dbeace5
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+# Test select() on file descriptors opened for writing.
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles t-select-out.out t-select-out.tmp"
+
+# Regular files.
+
+rm -f t-select-out.tmp
+${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp > t-select-out.out
+test `cat t-select-out.tmp` = "1" || exit 1
+
+# Pipes.
+
+if false; then # This test fails on some platforms.
+  rm -f t-select-out.tmp
+  ( { echo abc; ${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | { sleep 1; cat; } ) > /dev/null
+  test `cat t-select-out.tmp` = "0" || exit 1
+fi
+
+rm -f t-select-out.tmp
+( { sleep 1; echo abc; ${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp; } | cat) > /dev/null
+test `cat t-select-out.tmp` = "1" || exit 1
+
+# Special files.
+
+rm -f t-select-out.tmp
+${CHECKER} ./test-select-fd${EXEEXT} w 1 t-select-out.tmp > /dev/null
+test `cat t-select-out.tmp` = "1" || exit 1
+
+rm -fr $tmpfiles
+
+exit 0
diff --git a/tests/test-select-stdin.c b/tests/test-select-stdin.c
new file mode 100644 (file)
index 0000000..26ca8a8
--- /dev/null
@@ -0,0 +1,83 @@
+/* Test of select() substitute, reading from stdin.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/select.h>
+#include <sys/time.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+  printf ("Applying select() from standard input. Press Ctrl-C to abort.\n");
+  for (;;)
+    {
+      struct timeval before;
+      struct timeval after;
+      unsigned long spent_usec;
+      fd_set readfds;
+      struct timeval timeout;
+      int ret;
+
+      gettimeofday (&before, NULL);
+
+      FD_ZERO (&readfds);
+      FD_SET (0, &readfds);
+      timeout.tv_sec = 0;
+      timeout.tv_usec = 500000;
+      ret = select (1, &readfds, NULL, NULL, &timeout);
+
+      gettimeofday (&after, NULL);
+      spent_usec = (after.tv_sec - before.tv_sec) * 1000000
+                   + after.tv_usec - before.tv_usec;
+
+      if (ret < 0)
+        {
+          perror ("select failed");
+          exit (1);
+        }
+      if ((ret == 0) != ! FD_ISSET (0, &readfds))
+        {
+          fprintf (stderr, "incorrect return value\n");
+          exit (1);
+        }
+      if (ret == 0)
+        {
+          if (spent_usec < 250000)
+            {
+              fprintf (stderr, "returned too early\n");
+              exit (1);
+            }
+          /* Timeout */
+          printf (".");
+          ASSERT (fflush (stdout) == 0);
+        }
+      else
+        {
+          char c;
+
+          printf ("Input available! Trying to read 1 byte...\n");
+          ASSERT (read (0, &c, 1) == 1);
+        }
+    }
+}
diff --git a/tests/test-select.c b/tests/test-select.c
new file mode 100644 (file)
index 0000000..a4ff8d1
--- /dev/null
@@ -0,0 +1,34 @@
+/* Test of select() substitute.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini, 2008.  */
+
+#include <config.h>
+
+#include <sys/select.h>
+
+#include "signature.h"
+
+SIGNATURE_CHECK (select, int, (int, fd_set *, fd_set *, fd_set *,
+                               struct timeval *));
+
+#include "test-select.h"
+
+int
+main (void)
+{
+  return test_function (select);
+}
diff --git a/tests/test-select.h b/tests/test-select.h
new file mode 100644 (file)
index 0000000..6348a49
--- /dev/null
@@ -0,0 +1,466 @@
+/* Test of select() substitute.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini, 2008.  */
+
+#include <stdio.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+
+#include "macros.h"
+
+#if defined _WIN32 && ! defined __CYGWIN__
+# define WINDOWS_NATIVE
+#endif
+
+#ifdef HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+
+#define TEST_PORT       12345
+
+
+typedef int (*select_fn) (int, fd_set *, fd_set *, fd_set *, struct timeval *);
+
+
+/* Minimal testing infrastructure.  */
+
+static int failures;
+
+static void
+failed (const char *reason)
+{
+  if (++failures > 1)
+    printf ("  ");
+  printf ("failed (%s)\n", reason);
+}
+
+static int
+test (void (*fn) (select_fn), select_fn my_select, const char *msg)
+{
+  failures = 0;
+  printf ("%s... ", msg);
+  fflush (stdout);
+  fn (my_select);
+
+  if (!failures)
+    printf ("passed\n");
+
+  return failures;
+}
+
+
+/* Funny socket code.  */
+
+static int
+open_server_socket (void)
+{
+  int s, x;
+  struct sockaddr_in ia;
+
+  s = socket (AF_INET, SOCK_STREAM, 0);
+
+  x = 1;
+  setsockopt (s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof (x));
+
+  memset (&ia, 0, sizeof (ia));
+  ia.sin_family = AF_INET;
+  inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr);
+  ia.sin_port = htons (TEST_PORT);
+  if (bind (s, (struct sockaddr *) &ia, sizeof (ia)) < 0)
+    {
+      perror ("bind");
+      exit (77);
+    }
+
+  if (listen (s, 1) < 0)
+    {
+      perror ("listen");
+      exit (77);
+    }
+
+  return s;
+}
+
+static int
+connect_to_socket (bool blocking)
+{
+  int s;
+  struct sockaddr_in ia;
+
+  s = socket (AF_INET, SOCK_STREAM, 0);
+
+  memset (&ia, 0, sizeof (ia));
+  ia.sin_family = AF_INET;
+  inet_pton (AF_INET, "127.0.0.1", &ia.sin_addr);
+  ia.sin_port = htons (TEST_PORT);
+
+  if (!blocking)
+    {
+#ifdef WINDOWS_NATIVE
+      unsigned long iMode = 1;
+      ioctl (s, FIONBIO, (char *) &iMode);
+
+#elif defined F_GETFL
+      int oldflags = fcntl (s, F_GETFL, NULL);
+
+      if (!(oldflags & O_NONBLOCK))
+        fcntl (s, F_SETFL, oldflags | O_NONBLOCK);
+#endif
+    }
+
+  if (connect (s, (struct sockaddr *) &ia, sizeof (ia)) < 0
+      && (blocking || errno != EINPROGRESS))
+    {
+      perror ("connect");
+      exit (77);
+    }
+
+  return s;
+}
+
+
+/* A slightly more convenient interface to select(2).
+   Waits until a specific event occurs on a file descriptor FD.
+   EV is a bit mask of events to look for:
+     SEL_IN - input can be polled without blocking,
+     SEL_OUT - output can be provided without blocking,
+     SEL_EXC - an exception occurred,
+   A maximum wait time is specified by TIMEOUT.
+   *TIMEOUT = { 0, 0 } means to return immediately,
+   TIMEOUT = NULL means to wait indefinitely.  */
+
+enum { SEL_IN = 1, SEL_OUT = 2, SEL_EXC = 4 };
+
+static int
+do_select (int fd, int ev, struct timeval *timeout, select_fn my_select)
+{
+  fd_set rfds, wfds, xfds;
+  int r, rev;
+
+  FD_ZERO (&rfds);
+  FD_ZERO (&wfds);
+  FD_ZERO (&xfds);
+  if (ev & SEL_IN)
+    FD_SET (fd, &rfds);
+  if (ev & SEL_OUT)
+    FD_SET (fd, &wfds);
+  if (ev & SEL_EXC)
+    FD_SET (fd, &xfds);
+  r = my_select (fd + 1, &rfds, &wfds, &xfds, timeout);
+  if (r < 0)
+    return r;
+
+  rev = 0;
+  if (FD_ISSET (fd, &rfds))
+    rev |= SEL_IN;
+  if (FD_ISSET (fd, &wfds))
+    rev |= SEL_OUT;
+  if (FD_ISSET (fd, &xfds))
+    rev |= SEL_EXC;
+  if (rev && r == 0)
+    failed ("select returned 0");
+  if (rev & ~ev)
+    failed ("select returned unrequested events");
+
+  return rev;
+}
+
+static int
+do_select_nowait (int fd, int ev, select_fn my_select)
+{
+  struct timeval tv0;
+  tv0.tv_sec = 0;
+  tv0.tv_usec = 0;
+  return do_select (fd, ev, &tv0, my_select);
+}
+
+static int
+do_select_wait (int fd, int ev, select_fn my_select)
+{
+  return do_select (fd, ev, NULL, my_select);
+}
+
+
+/* Test select(2) for TTYs.  */
+
+#ifdef INTERACTIVE
+static void
+test_tty (select_fn my_select)
+{
+  if (do_select_nowait (0, SEL_IN, my_select) != 0)
+    failed ("can read");
+  if (do_select_nowait (0, SEL_OUT, my_select) == 0)
+    failed ("cannot write");
+
+  if (do_select_wait (0, SEL_IN, my_select) == 0)
+    failed ("return with infinite timeout");
+
+  getchar ();
+  if (do_select_nowait (0, SEL_IN, my_select) != 0)
+    failed ("can read after getc");
+}
+#endif
+
+
+static int
+do_select_bad_nfd_nowait (int nfd, select_fn my_select)
+{
+  struct timeval tv0;
+  tv0.tv_sec = 0;
+  tv0.tv_usec = 0;
+  errno = 0;
+  return my_select (nfd, NULL, NULL, NULL, &tv0);
+}
+
+static void
+test_bad_nfd (select_fn my_select)
+{
+  if (do_select_bad_nfd_nowait (-1, my_select) != -1 || errno != EINVAL)
+    failed ("invalid errno after negative nfds");
+  /* Can't test FD_SETSIZE + 1 for EINVAL, since some systems allow
+     dynamically larger set size by redefining FD_SETSIZE anywhere up
+     to the actual maximum fd.  */
+#if 0
+  if (do_select_bad_nfd_nowait (FD_SETSIZE + 1, my_select) != -1
+      || errno != EINVAL)
+    failed ("invalid errno after bogus nfds");
+#endif
+}
+
+/* Test select(2) on invalid file descriptors.  */
+
+static int
+do_select_bad_fd (int fd, int ev, struct timeval *timeout, select_fn my_select)
+{
+  fd_set rfds, wfds, xfds;
+
+  FD_ZERO (&rfds);
+  FD_ZERO (&wfds);
+  FD_ZERO (&xfds);
+  if (ev & SEL_IN)
+    FD_SET (fd, &rfds);
+  if (ev & SEL_OUT)
+    FD_SET (fd, &wfds);
+  if (ev & SEL_EXC)
+    FD_SET (fd, &xfds);
+  errno = 0;
+  return my_select (fd + 1, &rfds, &wfds, &xfds, timeout);
+  /* In this case, when fd is invalid, on some platforms, the bit for fd
+     is left alone in the fd_set, whereas on other platforms it is cleared.
+     So, don't check the bit for fd here.  */
+}
+
+static int
+do_select_bad_fd_nowait (int fd, int ev, select_fn my_select)
+{
+  struct timeval tv0;
+  tv0.tv_sec = 0;
+  tv0.tv_usec = 0;
+  return do_select_bad_fd (fd, ev, &tv0, my_select);
+}
+
+static void
+test_bad_fd (select_fn my_select)
+{
+  /* This tests fails on OSF/1 and native Windows, even with fd = 16.  */
+#if !(defined __osf__ || defined WINDOWS_NATIVE)
+  int fd;
+
+  /* On Linux, Mac OS X, *BSD, values of fd like 99 or 399 are discarded
+     by the kernel early and therefore do *not* lead to EBADF, as required
+     by POSIX.  */
+# if defined __linux__ || (defined __APPLE__ && defined __MACH__) || (defined __FreeBSD__ || defined __DragonFly__) || defined __OpenBSD__ || defined __NetBSD__
+  fd = 14;
+# else
+  fd = 99;
+# endif
+  /* Even on the best POSIX compliant platforms, values of fd >= FD_SETSIZE
+     require an nfds argument that is > FD_SETSIZE and thus may lead to EINVAL,
+     not EBADF.  */
+  if (fd >= FD_SETSIZE)
+    fd = FD_SETSIZE - 1;
+  close (fd);
+
+  if (do_select_bad_fd_nowait (fd, SEL_IN, my_select) == 0 || errno != EBADF)
+    failed ("invalid fd among rfds");
+  if (do_select_bad_fd_nowait (fd, SEL_OUT, my_select) == 0 || errno != EBADF)
+    failed ("invalid fd among wfds");
+  if (do_select_bad_fd_nowait (fd, SEL_EXC, my_select) == 0 || errno != EBADF)
+    failed ("invalid fd among xfds");
+#endif
+}
+
+
+/* Test select(2) for unconnected nonblocking sockets.  */
+
+static void
+test_connect_first (select_fn my_select)
+{
+  int s = open_server_socket ();
+  struct sockaddr_in ia;
+  socklen_t addrlen;
+
+  int c1, c2;
+
+  if (do_select_nowait (s, SEL_IN | SEL_EXC, my_select) != 0)
+    failed ("can read, socket not connected");
+
+  c1 = connect_to_socket (false);
+
+  if (do_select_wait (s, SEL_IN | SEL_EXC, my_select) != SEL_IN)
+    failed ("expecting readability on passive socket");
+  if (do_select_nowait (s, SEL_IN | SEL_EXC, my_select) != SEL_IN)
+    failed ("expecting readability on passive socket");
+
+  addrlen = sizeof (ia);
+  c2 = accept (s, (struct sockaddr *) &ia, &addrlen);
+  ASSERT (close (s) == 0);
+  ASSERT (close (c1) == 0);
+  ASSERT (close (c2) == 0);
+}
+
+
+/* Test select(2) for unconnected blocking sockets.  */
+
+static void
+test_accept_first (select_fn my_select)
+{
+#ifndef WINDOWS_NATIVE
+  int s = open_server_socket ();
+  struct sockaddr_in ia;
+  socklen_t addrlen;
+  char buf[3];
+  int c, pid;
+
+  pid = fork ();
+  if (pid < 0)
+    return;
+
+  if (pid == 0)
+    {
+      addrlen = sizeof (ia);
+      c = accept (s, (struct sockaddr *) &ia, &addrlen);
+      ASSERT (close (s) == 0);
+      ASSERT (write (c, "foo", 3) == 3);
+      ASSERT (read (c, buf, 3) == 3);
+      shutdown (c, SHUT_RD);
+      ASSERT (close (c) == 0);
+      exit (0);
+    }
+  else
+    {
+      ASSERT (close (s) == 0);
+      c = connect_to_socket (true);
+      if (do_select_nowait (c, SEL_OUT, my_select) != SEL_OUT)
+        failed ("cannot write after blocking connect");
+      ASSERT (write (c, "foo", 3) == 3);
+      wait (&pid);
+      if (do_select_wait (c, SEL_IN, my_select) != SEL_IN)
+        failed ("cannot read data left in the socket by closed process");
+      ASSERT (read (c, buf, 3) == 3);
+      ASSERT (write (c, "foo", 3) == 3);
+      (void) close (c); /* may fail with errno = ECONNRESET */
+    }
+#endif
+}
+
+
+/* Common code for pipes and connected sockets.  */
+
+static void
+test_pair (int rd, int wd, select_fn my_select)
+{
+  char buf[3];
+  if (do_select_wait (wd, SEL_IN | SEL_OUT | SEL_EXC, my_select) != SEL_OUT)
+    failed ("expecting writability before writing");
+  if (do_select_nowait (wd, SEL_IN | SEL_OUT | SEL_EXC, my_select) != SEL_OUT)
+    failed ("expecting writability before writing");
+
+  ASSERT (write (wd, "foo", 3) == 3);
+  if (do_select_wait (rd, SEL_IN, my_select) != SEL_IN)
+    failed ("expecting readability after writing");
+  if (do_select_nowait (rd, SEL_IN, my_select) != SEL_IN)
+    failed ("expecting readability after writing");
+
+  ASSERT (read (rd, buf, 3) == 3);
+}
+
+
+/* Test select(2) on connected sockets.  */
+
+static void
+test_socket_pair (select_fn my_select)
+{
+  struct sockaddr_in ia;
+
+  socklen_t addrlen = sizeof (ia);
+  int s = open_server_socket ();
+  int c1 = connect_to_socket (false);
+  int c2 = accept (s, (struct sockaddr *) &ia, &addrlen);
+
+  ASSERT (close (s) == 0);
+
+  test_pair (c1, c2, my_select);
+  ASSERT (close (c1) == 0);
+  ASSERT (write (c2, "foo", 3) == 3);
+  (void) close (c2); /* may fail with errno = ECONNRESET */
+}
+
+
+/* Test select(2) on pipes.  */
+
+static void
+test_pipe (select_fn my_select)
+{
+  int fd[2];
+
+  ASSERT (pipe (fd) == 0);
+  test_pair (fd[0], fd[1], my_select);
+  ASSERT (close (fd[0]) == 0);
+  ASSERT (close (fd[1]) == 0);
+}
+
+
+/* Do them all.  */
+
+static int
+test_function (select_fn my_select)
+{
+  int result = 0;
+
+#ifdef INTERACTIVE
+  printf ("Please press Enter\n");
+  test (test_tty, "TTY", my_select);
+#endif
+
+  result += test (test_bad_nfd, my_select, "Invalid nfd test");
+  result += test (test_bad_fd, my_select, "Invalid fd test");
+  result += test (test_connect_first, my_select, "Unconnected socket test");
+  result += test (test_socket_pair, my_select, "Connected sockets test");
+  result += test (test_accept_first, my_select, "General socket test with fork");
+  result += test (test_pipe, my_select, "Pipe test");
+
+  return result;
+}
index 519dc27..034a7d2 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of setenv.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index 143c0d8..f7897c1 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of setting the current locale.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -52,6 +52,9 @@ main (int argc, char *argv[])
 
   name2 = strdup (setlocale (LC_ALL, NULL));
 
+  ASSERT (name1);
+  ASSERT (name2);
+
   /* Test that the two results are the same.  */
   ASSERT (strcmp (name1, name2) == 0);
   free (name1);
index 59a0532..53ad09f 100755 (executable)
@@ -16,19 +16,19 @@ if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none \
 fi
 
 if test $LOCALE_FR != none; then
-  LC_ALL=$LOCALE_FR      ./test-setlocale1${EXEEXT} || exit 1
+  LC_ALL=$LOCALE_FR      ${CHECKER} ./test-setlocale1${EXEEXT} || exit 1
 fi
 
 if test $LOCALE_FR_UTF8 != none; then
-  LC_ALL=$LOCALE_FR_UTF8 ./test-setlocale1${EXEEXT} || exit 1
+  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-setlocale1${EXEEXT} || exit 1
 fi
 
 if test $LOCALE_JA != none; then
-  LC_ALL=$LOCALE_JA      ./test-setlocale1${EXEEXT} || exit 1
+  LC_ALL=$LOCALE_JA      ${CHECKER} ./test-setlocale1${EXEEXT} || exit 1
 fi
 
 if test $LOCALE_ZH_CN != none; then
-  LC_ALL=$LOCALE_ZH_CN   ./test-setlocale1${EXEEXT} || exit 1
+  LC_ALL=$LOCALE_ZH_CN   ${CHECKER} ./test-setlocale1${EXEEXT} || exit 1
 fi
 
 exit 0
index 52e65d8..ecb890b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of setting the current locale.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 904e147..79ea32f 100755 (executable)
@@ -2,7 +2,7 @@
 
 # Test locale names with likely unsupported encoding in Unix syntax.
 for name in ar_SA.ISO-8859-1 fr_FR.CP1251 zh_TW.GB18030 zh_CN.BIG5; do
-  env LC_ALL=$name ./test-setlocale2${EXEEXT} 1 || exit 1
+  env LC_ALL=$name ${CHECKER} ./test-setlocale2${EXEEXT} 1 || exit 1
 done
 
 # Test locale names with likely unsupported encoding in native Windows syntax.
@@ -10,8 +10,8 @@ for name in "Arabic_Saudi Arabia.1252" "Arabic_Saudi Arabia.65001" \
             French_France.65001 Japanese_Japan.65001 Turkish_Turkey.65001 \
             Chinese_Taiwan.65001 Chinese_China.54936 Chinese_China.65001; do
   # Here we use 'env' to set the LC_ALL environment variable, because on
-  # Solaris 11 2011-11, the /bin/sh refuses to do it for Turkish_Turkey.65001.
-  env LC_ALL="$name" ./test-setlocale2${EXEEXT} 1 || exit 1
+  # Solaris 11.0, the /bin/sh refuses to do it for Turkish_Turkey.65001.
+  env LC_ALL="$name" ${CHECKER} ./test-setlocale2${EXEEXT} 1 || exit 1
 done
 
 exit 0
diff --git a/tests/test-setlocale_null-mt-all.c b/tests/test-setlocale_null-mt-all.c
new file mode 100644 (file)
index 0000000..f733036
--- /dev/null
@@ -0,0 +1,172 @@
+/* Multithread-safety test for setlocale_null_r (LC_ALL, ...).
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+/* Work around GCC bug 44511.  */
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+# pragma GCC diagnostic ignored "-Wreturn-type"
+#endif
+
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+
+/* Specification.  */
+#include <locale.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "glthread/thread.h"
+
+/* We want to use the system's setlocale() function here, not the gnulib
+   override.  */
+#undef setlocale
+
+
+/* Some common locale names.  */
+
+#if defined _WIN32 && !defined __CYGWIN__
+# define ENGLISH "English_United States"
+# define GERMAN  "German_Germany"
+# define FRENCH  "French_France"
+# define ENCODING ".1252"
+#else
+# define ENGLISH "en_US"
+# define GERMAN  "de_DE"
+# define FRENCH  "fr_FR"
+# if defined __sgi
+#  define ENCODING ".ISO8859-15"
+# elif defined __hpux
+#  define ENCODING ".utf8"
+# else
+#  define ENCODING ".UTF-8"
+# endif
+#endif
+
+static const char LOCALE1[] = ENGLISH ENCODING;
+static const char LOCALE2[] = GERMAN ENCODING;
+static const char LOCALE3[] = FRENCH ENCODING;
+
+static char *expected;
+
+static void *
+thread1_func (void *arg)
+{
+  for (;;)
+    {
+      char buf[SETLOCALE_NULL_ALL_MAX];
+
+      if (setlocale_null_r (LC_ALL, buf, sizeof (buf)))
+        abort ();
+      if (strcmp (expected, buf) != 0)
+        {
+          fprintf (stderr, "thread1 disturbed by thread2!\n"); fflush (stderr);
+          abort ();
+        }
+    }
+
+  /*NOTREACHED*/
+}
+
+static void *
+thread2_func (void *arg)
+{
+  for (;;)
+    {
+      char buf[SETLOCALE_NULL_ALL_MAX];
+
+      setlocale_null_r (LC_NUMERIC, buf, sizeof (buf));
+      setlocale_null_r (LC_ALL, buf, sizeof (buf));
+    }
+
+  /*NOTREACHED*/
+}
+
+int
+main (int argc, char *argv[])
+{
+  if (setlocale (LC_ALL, LOCALE1) == NULL)
+    {
+      fprintf (stderr, "Skipping test: LOCALE1 not recognized\n");
+      return 77;
+    }
+  if (setlocale (LC_NUMERIC, LOCALE2) == NULL)
+    {
+      fprintf (stderr, "Skipping test: LOCALE2 not recognized\n");
+      return 77;
+    }
+  if (setlocale (LC_TIME, LOCALE3) == NULL)
+    {
+      fprintf (stderr, "Skipping test: LOCALE3 not recognized\n");
+      return 77;
+    }
+
+  expected = strdup (setlocale (LC_ALL, NULL));
+
+  /* Create the two threads.  */
+  gl_thread_create (thread1_func, NULL);
+  gl_thread_create (thread2_func, NULL);
+
+  /* Let them run for 5 seconds.  */
+  {
+    struct timespec duration;
+    duration.tv_sec = 5;
+    duration.tv_nsec = 0;
+
+    nanosleep (&duration, NULL);
+  }
+
+  return 0;
+}
+
+#else
+
+/* No multithreading available.  */
+
+#include <stdio.h>
+
+int
+main ()
+{
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+}
+
+#endif
+
+/* Without locking, the results of this test would be:
+glibc                OK
+musl libc            crash < 10 sec
+macOS                crash < 1 sec
+FreeBSD              crash < 1 sec
+NetBSD               crash < 2 sec
+OpenBSD              crash < 1 sec
+AIX                  crash < 2 sec
+HP-UX                OK
+IRIX                 OK
+Solaris 10           OK
+Solaris 11.0         OK
+Solaris 11.4         OK
+Solaris OpenIndiana  OK
+Haiku                crash < 1 sec
+Cygwin               crash < 1 sec
+mingw                OK
+MSVC                 OK (assuming compiler option /MD !)
+*/
diff --git a/tests/test-setlocale_null-mt-one.c b/tests/test-setlocale_null-mt-one.c
new file mode 100644 (file)
index 0000000..5f9b85b
--- /dev/null
@@ -0,0 +1,172 @@
+/* Multithread-safety test for setlocale_null_r (LC_xxx, ...).
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+/* Work around GCC bug 44511.  */
+#if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
+# pragma GCC diagnostic ignored "-Wreturn-type"
+#endif
+
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+
+/* Specification.  */
+#include <locale.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "glthread/thread.h"
+
+/* We want to use the system's setlocale() function here, not the gnulib
+   override.  */
+#undef setlocale
+
+
+/* Some common locale names.  */
+
+#if defined _WIN32 && !defined __CYGWIN__
+# define ENGLISH "English_United States"
+# define GERMAN  "German_Germany"
+# define FRENCH  "French_France"
+# define ENCODING ".1252"
+#else
+# define ENGLISH "en_US"
+# define GERMAN  "de_DE"
+# define FRENCH  "fr_FR"
+# if defined __sgi
+#  define ENCODING ".ISO8859-15"
+# elif defined __hpux
+#  define ENCODING ".utf8"
+# else
+#  define ENCODING ".UTF-8"
+# endif
+#endif
+
+static const char LOCALE1[] = ENGLISH ENCODING;
+static const char LOCALE2[] = GERMAN ENCODING;
+static const char LOCALE3[] = FRENCH ENCODING;
+
+static char *expected;
+
+static void *
+thread1_func (void *arg)
+{
+  for (;;)
+    {
+      char buf[SETLOCALE_NULL_MAX];
+
+      if (setlocale_null_r (LC_NUMERIC, buf, sizeof (buf)))
+        abort ();
+      if (strcmp (expected, buf) != 0)
+        {
+          fprintf (stderr, "thread1 disturbed by thread2!\n"); fflush (stderr);
+          abort ();
+        }
+    }
+
+  /*NOTREACHED*/
+}
+
+static void *
+thread2_func (void *arg)
+{
+  for (;;)
+    {
+      char buf[SETLOCALE_NULL_MAX];
+
+      setlocale_null_r (LC_NUMERIC, buf, sizeof (buf));
+      setlocale_null_r (LC_TIME, buf, sizeof (buf));
+    }
+
+  /*NOTREACHED*/
+}
+
+int
+main (int argc, char *argv[])
+{
+  if (setlocale (LC_ALL, LOCALE1) == NULL)
+    {
+      fprintf (stderr, "Skipping test: LOCALE1 not recognized\n");
+      return 77;
+    }
+  if (setlocale (LC_NUMERIC, LOCALE2) == NULL)
+    {
+      fprintf (stderr, "Skipping test: LOCALE2 not recognized\n");
+      return 77;
+    }
+  if (setlocale (LC_TIME, LOCALE3) == NULL)
+    {
+      fprintf (stderr, "Skipping test: LOCALE3 not recognized\n");
+      return 77;
+    }
+
+  expected = strdup (setlocale (LC_NUMERIC, NULL));
+
+  /* Create the two threads.  */
+  gl_thread_create (thread1_func, NULL);
+  gl_thread_create (thread2_func, NULL);
+
+  /* Let them run for 2 seconds.  */
+  {
+    struct timespec duration;
+    duration.tv_sec = 2;
+    duration.tv_nsec = 0;
+
+    nanosleep (&duration, NULL);
+  }
+
+  return 0;
+}
+
+#else
+
+/* No multithreading available.  */
+
+#include <stdio.h>
+
+int
+main ()
+{
+  fputs ("Skipping test: multithreading not enabled\n", stderr);
+  return 77;
+}
+
+#endif
+
+/* Without locking, the results of this test would be:
+glibc                OK
+musl libc            OK
+macOS                OK
+FreeBSD              OK
+NetBSD               OK
+OpenBSD              crash < 1 sec
+AIX                  crash < 2 sec
+HP-UX                OK
+IRIX                 OK
+Solaris 10           OK
+Solaris 11.0         OK
+Solaris 11.4         OK
+Solaris OpenIndiana  OK
+Haiku                OK
+Cygwin               OK
+mingw                OK
+MSVC                 OK (assuming compiler option /MD !)
+*/
diff --git a/tests/test-setlocale_null.c b/tests/test-setlocale_null.c
new file mode 100644 (file)
index 0000000..ebe0d36
--- /dev/null
@@ -0,0 +1,32 @@
+/* Test of setlocale_null_r function.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include <locale.h>
+
+/* Check that SETLOCALE_NULL_ALL_MAX is a constant expression.  */
+static char buf[SETLOCALE_NULL_ALL_MAX];
+
+int
+main ()
+{
+  /* Check that setlocale_null_r() can be used with $(LIB_SETLOCALE_NULL).  */
+  return setlocale_null_r (LC_ALL, buf, sizeof (buf)) != 0;
+}
diff --git a/tests/test-setsockopt.c b/tests/test-setsockopt.c
new file mode 100644 (file)
index 0000000..09ae1aa
--- /dev/null
@@ -0,0 +1,55 @@
+/* Test setsockopt() function.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (setsockopt, int, (int, int, int, const void *, socklen_t));
+
+#include <errno.h>
+#include <unistd.h>
+
+#include "sockets.h"
+#include "macros.h"
+
+int
+main (void)
+{
+  (void) gl_sockets_startup (SOCKETS_1_1);
+
+  /* Test behaviour for invalid file descriptors.  */
+  {
+    int value = 1;
+
+    errno = 0;
+    ASSERT (setsockopt (-1, SOL_SOCKET, SO_REUSEADDR, &value, sizeof (value))
+            == -1);
+    ASSERT (errno == EBADF);
+  }
+  {
+    int value = 1;
+
+    close (99);
+    errno = 0;
+    ASSERT (setsockopt (99, SOL_SOCKET, SO_REUSEADDR, &value, sizeof (value))
+            == -1);
+    ASSERT (errno == EBADF);
+  }
+
+  return 0;
+}
index 27c1ecc..fc4a45c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of sigaction() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2008.  */
 
index 382a363..8c155a7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <signal.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
@@ -45,7 +45,6 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::sigprocmask, int,
 SIGNATURE_CHECK (GNULIB_NAMESPACE::signal,
                  _gl_function_taking_int_returning_void_t,
                  (int, _gl_function_taking_int_returning_void_t));
-SIGNATURE_CHECK (GNULIB_NAMESPACE::raise, int, (int));
 #endif
 
 #if GNULIB_TEST_SIGACTION
index 41acc8d..b2660b8 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <signal.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #define GNULIB_NAMESPACE gnulib
 #include <config.h>
index b050839..b9d5176 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <signal.h> substitute.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index 878b7eb..11390d5 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of signbit() substitute.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 00707aa..a105ed9 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of SIGPIPE handling.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -26,6 +26,8 @@ int s = SIGPIPE;
 #include <stdlib.h>
 #include <unistd.h>
 
+#include "macros.h"
+
 static void
 handler (int sig)
 {
@@ -57,7 +59,7 @@ main (int argc, char **argv)
             case 'B': /* The write() call should have failed with EPIPE.  */
               if (ret < 0 && errno == EPIPE)
                 exit (0);
-              /*FALLTHROUGH*/
+              FALLTHROUGH;
             case 'A': /* The process should silently die.  */
             case 'C': /* The handler should have been called.  */
               fprintf (stderr, "write() returned %d with error %d.\n", ret, errno);
index 6cf3242..58a19ac 100755 (executable)
@@ -5,7 +5,7 @@ trap 'rm -fr $tmpfiles' 1 2 3 15
 
 # Test signal's default behaviour.
 tmpfiles="$tmpfiles t-sigpipeA.tmp"
-./test-sigpipe${EXEEXT} A 2> t-sigpipeA.tmp | head -1 > /dev/null
+${CHECKER} ./test-sigpipe${EXEEXT} A 2> t-sigpipeA.tmp | head -1 > /dev/null
 if test -s t-sigpipeA.tmp; then
   LC_ALL=C tr -d '\r' < t-sigpipeA.tmp
   rm -fr $tmpfiles; exit 1
@@ -13,7 +13,7 @@ fi
 
 # Test signal's ignored behaviour.
 tmpfiles="$tmpfiles t-sigpipeB.tmp"
-./test-sigpipe${EXEEXT} B 2> t-sigpipeB.tmp | head -1 > /dev/null
+${CHECKER} ./test-sigpipe${EXEEXT} B 2> t-sigpipeB.tmp | head -1 > /dev/null
 if test -s t-sigpipeB.tmp; then
   LC_ALL=C tr -d '\r' < t-sigpipeB.tmp
   rm -fr $tmpfiles; exit 1
@@ -21,7 +21,7 @@ fi
 
 # Test signal's behaviour when a handler is installed.
 tmpfiles="$tmpfiles t-sigpipeC.tmp"
-./test-sigpipe${EXEEXT} C 2> t-sigpipeC.tmp | head -1 > /dev/null
+${CHECKER} ./test-sigpipe${EXEEXT} C 2> t-sigpipeC.tmp | head -1 > /dev/null
 if test -s t-sigpipeC.tmp; then
   LC_ALL=C tr -d '\r' < t-sigpipeC.tmp
   rm -fr $tmpfiles; exit 1
index e759bf1..bf000d7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of sigprocmask.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2011.  */
 
@@ -30,7 +30,7 @@ SIGNATURE_CHECK (sigprocmask, int, (int, const sigset_t *, sigset_t *));
 
 #include "macros.h"
 
-#if !((defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__)
+#if !(defined _WIN32 && !defined __CYGWIN__)
 
 static volatile int sigint_occurred;
 
diff --git a/tests/test-sigsegv-catch-segv1.c b/tests/test-sigsegv-catch-segv1.c
new file mode 100644 (file)
index 0000000..62eef69
--- /dev/null
@@ -0,0 +1,128 @@
+/* Test that the handler is called, with the right fault address.
+   Copyright (C) 2002-2021  Bruno Haible <bruno@clisp.org>
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "sigsegv.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+#if HAVE_SIGSEGV_RECOVERY
+
+# include "mmap-anon-util.h"
+# include <stdlib.h>
+
+# if SIGSEGV_FAULT_ADDRESS_ALIGNMENT > 1UL
+#  include <unistd.h>
+#  define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS (getpagesize () - 1)
+# else
+#  define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0
+# endif
+
+uintptr_t page;
+
+volatile int handler_called = 0;
+
+int
+handler (void *fault_address, int serious)
+{
+  handler_called++;
+  if (handler_called > 10)
+    abort ();
+  if (fault_address
+      != (void *)((page + 0x678) & ~SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS))
+    abort ();
+  if (mprotect ((void *) page, 0x4000, PROT_READ_WRITE) == 0)
+    return 1;
+  return 0;
+}
+
+void
+crasher (uintptr_t p)
+{
+  *(volatile int *) (p + 0x678) = 42;
+}
+
+int
+main ()
+{
+  int prot_unwritable;
+  void *p;
+
+  /* Preparations.  */
+# if !HAVE_MAP_ANONYMOUS
+  zero_fd = open ("/dev/zero", O_RDONLY, 0644);
+# endif
+
+# if defined __linux__ && defined __sparc__
+  /* On Linux 2.6.26/SPARC64, PROT_READ has the same effect as
+     PROT_READ | PROT_WRITE.  */
+  prot_unwritable = PROT_NONE;
+# else
+  prot_unwritable = PROT_READ;
+# endif
+
+  /* Setup some mmaped memory.  */
+  p = mmap_zeromap ((void *) 0x12340000, 0x4000);
+  if (p == (void *)(-1))
+    {
+      fprintf (stderr, "mmap_zeromap failed.\n");
+      exit (2);
+    }
+  page = (uintptr_t) p;
+
+  /* Make it read-only.  */
+  if (mprotect ((void *) page, 0x4000, prot_unwritable) < 0)
+    {
+      fprintf (stderr, "mprotect failed.\n");
+      exit (2);
+    }
+  /* Test whether it's possible to make it read-write after it was read-only.
+     This is not possible on Cygwin.  */
+  if (mprotect ((void *) page, 0x4000, PROT_READ_WRITE) < 0
+      || mprotect ((void *) page, 0x4000, prot_unwritable) < 0)
+    {
+      fprintf (stderr, "mprotect failed.\n");
+      exit (2);
+    }
+
+  /* Install the SIGSEGV handler.  */
+  sigsegv_install_handler (&handler);
+
+  /* The first write access should invoke the handler and then complete.  */
+  crasher (page);
+  /* The second write access should not invoke the handler.  */
+  crasher (page);
+
+  /* Check that the handler was called only once.  */
+  if (handler_called != 1)
+    exit (1);
+  /* Test passed!  */
+  printf ("Test passed.\n");
+  return 0;
+}
+
+#else
+
+int
+main ()
+{
+  return 77;
+}
+
+#endif
diff --git a/tests/test-sigsegv-catch-segv2.c b/tests/test-sigsegv-catch-segv2.c
new file mode 100644 (file)
index 0000000..dd28517
--- /dev/null
@@ -0,0 +1,151 @@
+/* Test that the handler can be exited multiple times.
+   Copyright (C) 2002-2021  Bruno Haible <bruno@clisp.org>
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "sigsegv.h"
+
+#include <stdint.h>
+#include <stdio.h>
+
+#if HAVE_SIGSEGV_RECOVERY
+
+# if defined _WIN32 && !defined __CYGWIN__
+  /* Windows doesn't have sigset_t.  */
+  typedef int sigset_t;
+#  define sigemptyset(set)
+#  define sigprocmask(how,set,oldset)
+# endif
+
+# include "mmap-anon-util.h"
+# include <stdlib.h> /* for abort, exit */
+# include <signal.h>
+# include <setjmp.h>
+
+# if SIGSEGV_FAULT_ADDRESS_ALIGNMENT > 1UL
+#  include <unistd.h>
+#  define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS (getpagesize () - 1)
+# else
+#  define SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS 0
+# endif
+
+jmp_buf mainloop;
+sigset_t mainsigset;
+
+volatile int pass = 0;
+uintptr_t page;
+
+volatile int handler_called = 0;
+
+static void
+handler_continuation (void *arg1, void *arg2, void *arg3)
+{
+  longjmp (mainloop, pass);
+}
+
+int
+handler (void *fault_address, int serious)
+{
+  handler_called++;
+  if (handler_called > 10)
+    abort ();
+  if (fault_address
+      != (void *)((page + 0x678 + 8 * pass) & ~SIGSEGV_FAULT_ADDRESS_ROUNDOFF_BITS))
+    abort ();
+  pass++;
+  printf ("Fault %d caught.\n", pass);
+  sigprocmask (SIG_SETMASK, &mainsigset, NULL);
+  return sigsegv_leave_handler (handler_continuation, NULL, NULL, NULL);
+}
+
+void
+crasher (uintptr_t p)
+{
+  *(volatile int *) (p + 0x678 + 8 * pass) = 42;
+}
+
+int
+main ()
+{
+  int prot_unwritable;
+  void *p;
+  sigset_t emptyset;
+
+  /* Preparations.  */
+# if !HAVE_MAP_ANONYMOUS
+  zero_fd = open ("/dev/zero", O_RDONLY, 0644);
+# endif
+
+# if defined __linux__ && defined __sparc__
+  /* On Linux 2.6.26/SPARC64, PROT_READ has the same effect as
+     PROT_READ | PROT_WRITE.  */
+  prot_unwritable = PROT_NONE;
+# else
+  prot_unwritable = PROT_READ;
+# endif
+
+  /* Setup some mmaped memory.  */
+  p = mmap_zeromap ((void *) 0x12340000, 0x4000);
+  if (p == (void *)(-1))
+    {
+      fprintf (stderr, "mmap_zeromap failed.\n");
+      exit (2);
+    }
+  page = (uintptr_t) p;
+
+  /* Make it read-only.  */
+  if (mprotect ((void *) page, 0x4000, prot_unwritable) < 0)
+    {
+      fprintf (stderr, "mprotect failed.\n");
+      exit (2);
+    }
+
+  /* Install the SIGSEGV handler.  */
+  if (sigsegv_install_handler (&handler) < 0)
+    exit (2);
+
+  /* Save the current signal mask.  */
+  sigemptyset (&emptyset);
+  sigprocmask (SIG_BLOCK, &emptyset, &mainsigset);
+
+  /* Provoke two SIGSEGVs in a row.  */
+  switch (setjmp (mainloop))
+    {
+    case 0: case 1:
+      printf ("Doing SIGSEGV pass %d.\n", pass + 1);
+      crasher (page);
+      printf ("no SIGSEGV?!\n"); exit (1);
+    case 2:
+      break;
+    default:
+      abort ();
+    }
+
+  /* Test passed!  */
+  printf ("Test passed.\n");
+  return 0;
+}
+
+#else
+
+int
+main ()
+{
+  return 77;
+}
+
+#endif
diff --git a/tests/test-sigsegv-catch-stackoverflow1.c b/tests/test-sigsegv-catch-stackoverflow1.c
new file mode 100644 (file)
index 0000000..c828ed2
--- /dev/null
@@ -0,0 +1,148 @@
+/* Test the stack overflow handler.
+   Copyright (C) 2002-2021  Bruno Haible <bruno@clisp.org>
+   Copyright (C) 2010 Eric Blake <eblake@redhat.com>
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "sigsegv.h"
+
+#include <stdio.h>
+#include <limits.h>
+
+#if HAVE_STACK_OVERFLOW_RECOVERY
+
+# if defined _WIN32 && !defined __CYGWIN__
+  /* Windows doesn't have sigset_t.  */
+  typedef int sigset_t;
+#  define sigemptyset(set)
+#  define sigprocmask(how,set,oldset)
+# endif
+
+# include <stddef.h> /* needed for NULL on SunOS4 */
+# include <stdlib.h> /* for abort, exit */
+# include <signal.h>
+# include <setjmp.h>
+# if HAVE_SETRLIMIT
+#  include <sys/types.h>
+#  include <sys/time.h>
+#  include <sys/resource.h>
+# endif
+# include "altstack-util.h"
+
+jmp_buf mainloop;
+sigset_t mainsigset;
+
+volatile int pass = 0;
+
+volatile char *stack_lower_bound;
+volatile char *stack_upper_bound;
+
+static void
+stackoverflow_handler_continuation (void *arg1, void *arg2, void *arg3)
+{
+  int arg = (int) (long) arg1;
+  longjmp (mainloop, arg);
+}
+
+void
+stackoverflow_handler (int emergency, stackoverflow_context_t scp)
+{
+  char dummy;
+  volatile char *addr = &dummy;
+  if (!(addr >= stack_lower_bound && addr <= stack_upper_bound))
+    abort ();
+  pass++;
+  printf ("Stack overflow %d caught.\n", pass);
+  sigprocmask (SIG_SETMASK, &mainsigset, NULL);
+  sigsegv_leave_handler (stackoverflow_handler_continuation,
+                         (void *) (long) (emergency ? -1 : pass), NULL, NULL);
+}
+
+volatile int *
+recurse_1 (int n, volatile int *p)
+{
+  if (n < INT_MAX)
+    *recurse_1 (n + 1, p) += n;
+  return p;
+}
+
+int
+recurse (volatile int n)
+{
+  return *recurse_1 (n, &n);
+}
+
+int
+main ()
+{
+  sigset_t emptyset;
+
+# if HAVE_SETRLIMIT && defined RLIMIT_STACK
+  /* Before starting the endless recursion, try to be friendly to the user's
+     machine.  On some Linux 2.2.x systems, there is no stack limit for user
+     processes at all.  We don't want to kill such systems.  */
+  struct rlimit rl;
+  rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+  setrlimit (RLIMIT_STACK, &rl);
+# endif
+
+  /* Prepare the storage for the alternate stack.  */
+  prepare_alternate_stack ();
+
+  /* Install the stack overflow handler.  */
+  if (stackoverflow_install_handler (&stackoverflow_handler,
+                                     mystack, MYSTACK_SIZE)
+      < 0)
+    exit (2);
+  stack_lower_bound = mystack;
+  stack_upper_bound = mystack + MYSTACK_SIZE - 1;
+
+  /* Save the current signal mask.  */
+  sigemptyset (&emptyset);
+  sigprocmask (SIG_BLOCK, &emptyset, &mainsigset);
+
+  /* Provoke two stack overflows in a row.  */
+  switch (setjmp (mainloop))
+    {
+    case -1:
+      printf ("emergency exit\n"); exit (1);
+    case 0: case 1:
+      printf ("Starting recursion pass %d.\n", pass + 1);
+      recurse (0);
+      printf ("no endless recursion?!\n"); exit (1);
+    case 2:
+      break;
+    default:
+      abort ();
+    }
+
+  /* Validate that the alternate stack did not overflow.  */
+  check_alternate_stack_no_overflow ();
+
+  printf ("Test passed.\n");
+  exit (0);
+}
+
+#else
+
+int
+main ()
+{
+  return 77;
+}
+
+#endif
diff --git a/tests/test-sigsegv-catch-stackoverflow2.c b/tests/test-sigsegv-catch-stackoverflow2.c
new file mode 100644 (file)
index 0000000..b94d131
--- /dev/null
@@ -0,0 +1,209 @@
+/* Test that stack overflow and SIGSEGV are correctly distinguished.
+   Copyright (C) 2002-2021  Bruno Haible <bruno@clisp.org>
+   Copyright (C) 2010 Eric Blake <eblake@redhat.com>
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "sigsegv.h"
+
+#include <stdint.h>
+#include <stdio.h>
+#include <limits.h>
+
+#if HAVE_STACK_OVERFLOW_RECOVERY && HAVE_SIGSEGV_RECOVERY
+
+# if defined _WIN32 && !defined __CYGWIN__
+  /* Windows doesn't have sigset_t.  */
+  typedef int sigset_t;
+#  define sigemptyset(set)
+#  define sigprocmask(how,set,oldset)
+# endif
+
+# include "mmap-anon-util.h"
+# include <stddef.h> /* needed for NULL on SunOS4 */
+# include <stdlib.h> /* for abort, exit */
+# include <signal.h>
+# include <setjmp.h>
+# if HAVE_SETRLIMIT
+#  include <sys/types.h>
+#  include <sys/time.h>
+#  include <sys/resource.h>
+# endif
+# include "altstack-util.h"
+
+jmp_buf mainloop;
+sigset_t mainsigset;
+
+volatile int pass = 0;
+uintptr_t page;
+
+static void
+stackoverflow_handler_continuation (void *arg1, void *arg2, void *arg3)
+{
+  int arg = (int) (long) arg1;
+  longjmp (mainloop, arg);
+}
+
+void
+stackoverflow_handler (int emergency, stackoverflow_context_t scp)
+{
+  pass++;
+  if (pass <= 2)
+    printf ("Stack overflow %d caught.\n", pass);
+  else
+    {
+      printf ("Segmentation violation misdetected as stack overflow.\n");
+      exit (1);
+    }
+  sigprocmask (SIG_SETMASK, &mainsigset, NULL);
+  sigsegv_leave_handler (stackoverflow_handler_continuation,
+                         (void *) (long) (emergency ? -1 : pass), NULL, NULL);
+}
+
+int
+sigsegv_handler (void *address, int emergency)
+{
+  /* This test is necessary to distinguish stack overflow and SIGSEGV.  */
+  if (!emergency)
+    return 0;
+
+  pass++;
+  if (pass <= 2)
+    {
+      printf ("Stack overflow %d missed.\n", pass);
+      exit (1);
+    }
+  else
+    printf ("Segmentation violation correctly detected.\n");
+  sigprocmask (SIG_SETMASK, &mainsigset, NULL);
+  return sigsegv_leave_handler (stackoverflow_handler_continuation,
+                                (void *) (long) pass, NULL, NULL);
+}
+
+volatile int *
+recurse_1 (int n, volatile int *p)
+{
+  if (n < INT_MAX)
+    *recurse_1 (n + 1, p) += n;
+  return p;
+}
+
+int
+recurse (volatile int n)
+{
+  return *recurse_1 (n, &n);
+}
+
+int
+main ()
+{
+  int prot_unwritable;
+  void *p;
+  sigset_t emptyset;
+
+# if HAVE_SETRLIMIT && defined RLIMIT_STACK
+  /* Before starting the endless recursion, try to be friendly to the user's
+     machine.  On some Linux 2.2.x systems, there is no stack limit for user
+     processes at all.  We don't want to kill such systems.  */
+  struct rlimit rl;
+  rl.rlim_cur = rl.rlim_max = 0x100000; /* 1 MB */
+  setrlimit (RLIMIT_STACK, &rl);
+# endif
+
+  /* Prepare the storage for the alternate stack.  */
+  prepare_alternate_stack ();
+
+  /* Install the stack overflow handler.  */
+  if (stackoverflow_install_handler (&stackoverflow_handler,
+                                     mystack, MYSTACK_SIZE)
+      < 0)
+    exit (2);
+
+  /* Preparations.  */
+# if !HAVE_MAP_ANONYMOUS
+  zero_fd = open ("/dev/zero", O_RDONLY, 0644);
+# endif
+
+# if defined __linux__ && defined __sparc__
+  /* On Linux 2.6.26/SPARC64, PROT_READ has the same effect as
+     PROT_READ | PROT_WRITE.  */
+  prot_unwritable = PROT_NONE;
+# else
+  prot_unwritable = PROT_READ;
+# endif
+
+  /* Setup some mmaped memory.  */
+  p = mmap_zeromap ((void *) 0x12340000, 0x4000);
+  if (p == (void *)(-1))
+    {
+      fprintf (stderr, "mmap_zeromap failed.\n");
+      exit (2);
+    }
+  page = (uintptr_t) p;
+
+  /* Make it read-only.  */
+  if (mprotect ((void *) page, 0x4000, prot_unwritable) < 0)
+    {
+      fprintf (stderr, "mprotect failed.\n");
+      exit (2);
+    }
+
+  /* Install the SIGSEGV handler.  */
+  if (sigsegv_install_handler (&sigsegv_handler) < 0)
+    exit (2);
+
+  /* Save the current signal mask.  */
+  sigemptyset (&emptyset);
+  sigprocmask (SIG_BLOCK, &emptyset, &mainsigset);
+
+  /* Provoke two stack overflows in a row.  */
+  switch (setjmp (mainloop))
+    {
+    case -1:
+      printf ("emergency exit\n"); exit (1);
+    case 0: case 1:
+      printf ("Starting recursion pass %d.\n", pass + 1);
+      recurse (0);
+      printf ("no endless recursion?!\n"); exit (1);
+    case 2:
+      *(volatile int *) (page + 0x678) = 42;
+      break;
+    case 3:
+      *(volatile int *) 0 = 42;
+      break;
+    case 4:
+      break;
+    default:
+      abort ();
+    }
+
+  /* Validate that the alternate stack did not overflow.  */
+  check_alternate_stack_no_overflow ();
+
+  printf ("Test passed.\n");
+  exit (0);
+}
+
+#else
+
+int
+main ()
+{
+  return 77;
+}
+
+#endif
index 64f681e..be9ee83 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of sleep() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 9041e4a..ea6de1c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of snprintf() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
diff --git a/tests/test-sockets.c b/tests/test-sockets.c
new file mode 100644 (file)
index 0000000..8fd603c
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2008-2021 Free Software Foundation, Inc.
+ * Written by Simon Josefsson.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdio.h>
+
+#include "sockets.h"
+
+int
+main (void)
+{
+  int err;
+
+  err = gl_sockets_startup (SOCKETS_1_1);
+  if (err != 0)
+    {
+      printf ("wsastartup failed %d\n", err);
+      return 1;
+    }
+
+  err = gl_sockets_cleanup ();
+  if (err != 0)
+    {
+      printf ("wsacleanup failed %d\n", err);
+      return 1;
+    }
+
+  (void) gl_fd_to_handle (0);
+
+  return 0;
+}
index 78f8d7a..998ea3a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <spawn.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
@@ -132,6 +132,16 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_adddup2, int,
                  (posix_spawn_file_actions_t *, int, int));
 #endif
 
+#if GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDCHDIR
+SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_addchdir, int,
+                 (posix_spawn_file_actions_t *, const char *));
+#endif
+
+#if GNULIB_TEST_POSIX_SPAWN_FILE_ACTIONS_ADDFCHDIR
+SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_spawn_file_actions_addfchdir, int,
+                 (posix_spawn_file_actions_t *, int));
+#endif
+
 
 int
 main ()
index 5a8652b..9d4dd17 100644 (file)
@@ -1,5 +1,5 @@
 /* Child program invoked by test-spawn-pipe-main.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include <errno.h>
 #include <fcntl.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 /* Get declarations of the native Windows API functions.  */
 # define WIN32_LEAN_AND_MEAN
 # include <windows.h>
@@ -48,12 +49,26 @@ static FILE *myerr;
 #undef fprintf
 #undef read
 #undef write
+#if defined _WIN32 && !defined __CYGWIN__
+# define fdopen _fdopen
+#endif
+
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+static void __cdecl
+gl_msvc_invalid_parameter_handler (const wchar_t *expression,
+                                   const wchar_t *function,
+                                   const wchar_t *file,
+                                   unsigned int line,
+                                   uintptr_t dummy)
+{
+}
+#endif
 
 /* Return non-zero if FD is open.  */
 static int
 is_open (int fd)
 {
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
   /* On native Windows, the initial state of unassigned standard file
      descriptors is that they are open but point to an
      INVALID_HANDLE_VALUE, and there is no fcntl.  */
@@ -69,9 +84,6 @@ is_open (int fd)
 int
 main (int argc, char *argv[])
 {
-  char buffer[2] = { 's', 't' };
-  int fd;
-
   /* fd 2 might be closed, but fd BACKUP_STDERR_FILENO is the original
      stderr.  */
   myerr = fdopen (BACKUP_STDERR_FILENO, "w");
@@ -80,10 +92,17 @@ main (int argc, char *argv[])
 
   ASSERT (argc == 2);
 
+#if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+  /* Avoid exceptions from within _get_osfhandle.  */
+  _set_invalid_parameter_handler (gl_msvc_invalid_parameter_handler);
+#endif
+
   /* Read one byte from fd 0, and write its value plus one to fd 1.
      fd 2 should be closed iff the argument is 1.  Check that no other file
      descriptors leaked.  */
 
+  char buffer[2] = { 's', 't' };
+
   ASSERT (read (STDIN_FILENO, buffer, 2) == 1);
 
   buffer[0]++;
@@ -98,9 +117,9 @@ main (int argc, char *argv[])
     case 1:
       /* Expect fd 2 is closed.
          But on HP-UX 11, fd 2 gets automatically re-opened to /dev/null if it
-         was closed. Future POSIX will allow this, see
-         <http://austingroupbugs.net/view.php?id=173>.  */
-#if !defined __hpux
+         was closed.  Similarly on native Windows.  Future POSIX will allow
+         this, see <http://austingroupbugs.net/view.php?id=173>.  */
+#if !(defined __hpux || (defined _WIN32 && ! defined __CYGWIN__))
       ASSERT (! is_open (STDERR_FILENO));
 #endif
       break;
@@ -108,6 +127,7 @@ main (int argc, char *argv[])
       ASSERT (0);
     }
 
+  int fd;
   for (fd = 3; fd < 7; fd++)
     {
       errno = 0;
index 6986eef..6809ab3 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of create_pipe_bidi/wait_subprocess.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -44,15 +44,15 @@ static void
 test_pipe (const char *prog, bool stderr_closed)
 {
   int fd[2];
-  char *argv[3];
+  const char *argv[3];
   pid_t pid;
   char buffer[2] = { 'a', 't' };
 
   /* Set up child.  */
-  argv[0] = (char *) prog;
-  argv[1] = (char *) (stderr_closed ? "1" : "0");
+  argv[0] = prog;
+  argv[1] = (stderr_closed ? "1" : "0");
   argv[2] = NULL;
-  pid = create_pipe_bidi (prog, prog, argv, false, true, true, fd);
+  pid = create_pipe_bidi (prog, prog, argv, NULL, false, true, true, fd);
   ASSERT (0 <= pid);
   ASSERT (STDERR_FILENO < fd[0]);
   ASSERT (STDERR_FILENO < fd[1]);
diff --git a/tests/test-spawn-pipe-script.c b/tests/test-spawn-pipe-script.c
new file mode 100644 (file)
index 0000000..4f53d4e
--- /dev/null
@@ -0,0 +1,104 @@
+/* Test of create_pipe_in/wait_subprocess.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include "spawn-pipe.h"
+#include "wait-process.h"
+
+#include <errno.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+  /* Check an invocation of an executable script.
+     This should only be supported if the script has a '#!' marker; otherwise
+     it is unsecure: <https://sourceware.org/bugzilla/show_bug.cgi?id=13134>.
+     POSIX says that the execlp() and execvp() functions support executing
+     shell scripts
+     <https://pubs.opengroup.org/onlinepubs/9699919799/functions/exec.html>,
+     but this is considered an antiquated feature.  */
+  int fd[1];
+  pid_t pid;
+
+  {
+    size_t i;
+
+    for (i = 0; i < 2; i++)
+      {
+        const char *progname =
+          (i == 0 ? "executable-script" : "executable-script.sh");
+        const char *prog_path =
+          (i == 0 ? SRCDIR "executable-script" : SRCDIR "executable-script.sh");
+        const char *prog_argv[2] = { prog_path, NULL };
+
+        pid = create_pipe_in (progname, prog_argv[0], prog_argv, NULL,
+                              NULL, false, true, false, fd);
+        if (pid >= 0)
+          {
+            /* Wait for child.  */
+            ASSERT (wait_subprocess (pid, progname, true, true, true, false,
+                                     NULL)
+                    == 127);
+          }
+        else
+          {
+            ASSERT (pid == -1);
+            ASSERT (errno == ENOEXEC);
+          }
+      }
+  }
+
+#if defined _WIN32 && !defined __CYGWIN__
+  /* On native Windows, scripts - even with '#!' marker - are not executable.
+     Only .bat and .cmd files are.  */
+  fprintf (stderr, "Skipping test: scripts are not executable on this platform.\n");
+  return 77;
+#else
+  {
+    const char *progname = "executable-shell-script";
+    const char *prog_path = SRCDIR "executable-shell-script";
+    const char *prog_argv[2] = { prog_path, NULL };
+
+    pid = create_pipe_in (progname, prog_argv[0], prog_argv, NULL,
+                          NULL, false, true, false, fd);
+    ASSERT (pid >= 0);
+    ASSERT (fd[0] > STDERR_FILENO);
+
+    /* Get child's output.  */
+    char buffer[1024];
+    FILE *fp = fdopen (fd[0], "r");
+    ASSERT (fp != NULL);
+    ASSERT (fread (buffer, 1, sizeof (buffer), fp) == 11);
+
+    /* Check the result.  */
+    ASSERT (memcmp (buffer, "Halle Potta", 11) == 0);
+
+    /* Wait for child.  */
+    ASSERT (wait_subprocess (pid, progname, true, false, true, true, NULL) == 0);
+
+    ASSERT (fclose (fp) == 0);
+  }
+
+  return 0;
+#endif
+}
index 676026c..22c4cbd 100755 (executable)
@@ -2,7 +2,7 @@
 
 st=0
 for i in 0 1 2 3 4 5 6 7 ; do
-  ./test-spawn-pipe-main${EXEEXT} ./test-spawn-pipe-child${EXEEXT} $i \
+  ${CHECKER} ./test-spawn-pipe-main${EXEEXT} ./test-spawn-pipe-child${EXEEXT} $i \
     || { echo test-spawn-pipe.sh: iteration $i failed >&2; st=1; }
 done
 exit $st
index e33ac47..2e9bb17 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <spawn.h> substitute.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
diff --git a/tests/test-stat-time.c b/tests/test-stat-time.c
new file mode 100644 (file)
index 0000000..cd0f3c3
--- /dev/null
@@ -0,0 +1,248 @@
+/* Test of <stat-time.h>.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by James Youngman <jay@gnu.org>, 2007.  */
+
+#include <config.h>
+
+#include "stat-time.h"
+
+#include <fcntl.h>
+#include <signal.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <time.h>
+
+#include "macros.h"
+
+#define BASE "test-stat-time.t"
+#include "nap.h"
+
+enum { NFILES = 4 };
+
+static char filename_stamp1[50];
+static char filename_testfile[50];
+static char filename_stamp2[50];
+static char filename_stamp3[50];
+
+/* Use file names that are different at each run.
+   This is necessary for test_birthtime() to pass on native Windows:
+   On this platform, the file system apparently remembers the creation time
+   of a file even after it is removed and created anew.  See
+   "Windows NT Contains File System Tunneling Capabilities"
+   <https://support.microsoft.com/en-us/help/172190/>  */
+static void
+initialize_filenames (void)
+{
+  long t = (long) time (NULL);
+  sprintf (filename_stamp1,   "t-stt-%ld-stamp1", t);
+  sprintf (filename_testfile, "t-stt-%ld-testfile", t);
+  sprintf (filename_stamp2,   "t-stt-%ld-stamp2", t);
+  sprintf (filename_stamp3,   "t-stt-%ld-stamp3", t);
+}
+
+static int
+force_unlink (const char *filename)
+{
+  /* This chmod is necessary on mingw, where unlink() of a read-only file
+     fails with EPERM.  */
+  chmod (filename, 0600);
+  return unlink (filename);
+}
+
+static void
+cleanup (int sig)
+{
+  /* Remove temporary files.  */
+  force_unlink (filename_stamp1);
+  force_unlink (filename_testfile);
+  force_unlink (filename_stamp2);
+  force_unlink (filename_stamp3);
+
+  if (sig != 0)
+    _exit (1);
+}
+
+static int
+open_file (const char *filename, int flags)
+{
+  int fd = open (filename, flags | O_WRONLY, 0500);
+  if (fd >= 0)
+    {
+      close (fd);
+      return 1;
+    }
+  else
+    {
+      return 0;
+    }
+}
+
+static void
+create_file (const char *filename)
+{
+  ASSERT (open_file (filename, O_CREAT | O_EXCL));
+}
+
+static void
+do_stat (const char *filename, struct stat *p)
+{
+  ASSERT (stat (filename, p) == 0);
+}
+
+static void
+prepare_test (struct stat *statinfo, struct timespec *modtimes)
+{
+  int i;
+
+  create_file (filename_stamp1);
+  nap ();
+  create_file (filename_testfile);
+  nap ();
+  create_file (filename_stamp2);
+  nap ();
+  ASSERT (chmod (filename_testfile, 0400) == 0);
+  nap ();
+  create_file (filename_stamp3);
+
+  do_stat (filename_stamp1,   &statinfo[0]);
+  do_stat (filename_testfile, &statinfo[1]);
+  do_stat (filename_stamp2,   &statinfo[2]);
+  do_stat (filename_stamp3,   &statinfo[3]);
+
+  /* Now use our access functions. */
+  for (i = 0; i < NFILES; ++i)
+    {
+      modtimes[i] = get_stat_mtime (&statinfo[i]);
+    }
+}
+
+static void
+test_mtime (const struct stat *statinfo, struct timespec *modtimes)
+{
+  int i;
+
+  /* Use the struct stat fields directly. */
+  /* mtime(stamp1) < mtime(stamp2) */
+  ASSERT (statinfo[0].st_mtime < statinfo[2].st_mtime
+          || (statinfo[0].st_mtime == statinfo[2].st_mtime
+              && (get_stat_mtime_ns (&statinfo[0])
+                  < get_stat_mtime_ns (&statinfo[2]))));
+  /* mtime(stamp2) < mtime(stamp3) */
+  ASSERT (statinfo[2].st_mtime < statinfo[3].st_mtime
+          || (statinfo[2].st_mtime == statinfo[3].st_mtime
+              && (get_stat_mtime_ns (&statinfo[2])
+                  < get_stat_mtime_ns (&statinfo[3]))));
+
+  /* Now check the result of the access functions. */
+  /* mtime(stamp1) < mtime(stamp2) */
+  ASSERT (modtimes[0].tv_sec < modtimes[2].tv_sec
+          || (modtimes[0].tv_sec == modtimes[2].tv_sec
+              && modtimes[0].tv_nsec < modtimes[2].tv_nsec));
+  /* mtime(stamp2) < mtime(stamp3) */
+  ASSERT (modtimes[2].tv_sec < modtimes[3].tv_sec
+          || (modtimes[2].tv_sec == modtimes[3].tv_sec
+              && modtimes[2].tv_nsec < modtimes[3].tv_nsec));
+
+  /* verify equivalence */
+  for (i = 0; i < NFILES; ++i)
+    {
+      struct timespec ts;
+      ts = get_stat_mtime (&statinfo[i]);
+      ASSERT (ts.tv_sec == statinfo[i].st_mtime);
+    }
+}
+
+#if defined _WIN32 && !defined __CYGWIN__
+/* Skip the ctime tests on native Windows platforms, because their
+   st_ctime is either the same as st_mtime (plus or minus an offset)
+   or set to the file _creation_ time, and is not influenced by rename
+   or chmod.  */
+# define test_ctime(ignored) ((void) 0)
+#else
+static void
+test_ctime (const struct stat *statinfo)
+{
+  /* On some buggy NFS clients, mtime and ctime are disproportionately
+     skewed from one another.  Skip this test in that case.  */
+  if (statinfo[0].st_mtime != statinfo[0].st_ctime)
+    return;
+
+  /* mtime(stamp2) < ctime(testfile) */
+  ASSERT (statinfo[2].st_mtime < statinfo[1].st_ctime
+          || (statinfo[2].st_mtime == statinfo[1].st_ctime
+              && (get_stat_mtime_ns (&statinfo[2])
+                  < get_stat_ctime_ns (&statinfo[1]))));
+}
+#endif
+
+static void
+test_birthtime (const struct stat *statinfo,
+                const struct timespec *modtimes,
+                struct timespec *birthtimes)
+{
+  int i;
+
+  /* Collect the birth times.  */
+  for (i = 0; i < NFILES; ++i)
+    {
+      birthtimes[i] = get_stat_birthtime (&statinfo[i]);
+      if (birthtimes[i].tv_nsec < 0)
+        return;
+    }
+
+  /* mtime(stamp1) < birthtime(testfile) */
+  ASSERT (modtimes[0].tv_sec < birthtimes[1].tv_sec
+          || (modtimes[0].tv_sec == birthtimes[1].tv_sec
+              && modtimes[0].tv_nsec < birthtimes[1].tv_nsec));
+  /* birthtime(testfile) < mtime(stamp2) */
+  ASSERT (birthtimes[1].tv_sec < modtimes[2].tv_sec
+          || (birthtimes[1].tv_sec == modtimes[2].tv_sec
+              && birthtimes[1].tv_nsec < modtimes[2].tv_nsec));
+}
+
+int
+main (void)
+{
+  struct stat statinfo[NFILES];
+  struct timespec modtimes[NFILES];
+  struct timespec birthtimes[NFILES];
+
+  initialize_filenames ();
+
+#ifdef SIGHUP
+  signal (SIGHUP, cleanup);
+#endif
+#ifdef SIGINT
+  signal (SIGINT, cleanup);
+#endif
+#ifdef SIGQUIT
+  signal (SIGQUIT, cleanup);
+#endif
+#ifdef SIGTERM
+  signal (SIGTERM, cleanup);
+#endif
+
+  cleanup (0);
+  prepare_test (statinfo, modtimes);
+  test_mtime (statinfo, modtimes);
+  test_ctime (statinfo);
+  test_birthtime (statinfo, modtimes, birthtimes);
+
+  cleanup (0);
+  return 0;
+}
index 4510e59..6f0a995 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of stat.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index 4cf6c6d..e728ca2 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of stat.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
@@ -32,12 +32,18 @@ test_stat_func (int (*func) (char const *, struct stat *), bool print)
   ASSERT (cwd);
   ASSERT (func (".", &st1) == 0);
   ASSERT (func ("./", &st2) == 0);
+#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES)
   ASSERT (SAME_INODE (st1, st2));
+#endif
   ASSERT (func (cwd, &st2) == 0);
+#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES)
   ASSERT (SAME_INODE (st1, st2));
+#endif
   ASSERT (func ("/", &st1) == 0);
   ASSERT (func ("///", &st2) == 0);
+#if !(defined _WIN32 && !defined __CYGWIN__ && !_GL_WINDOWS_STAT_INODES)
   ASSERT (SAME_INODE (st1, st2));
+#endif
 
   errno = 0;
   ASSERT (func ("", &st1) == -1);
index 0f240c5..38812b6 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdalign.h>.
-   Copyright 2009-2016 Free Software Foundation, Inc.
+   Copyright 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Paul Eggert, inspired by Bruno Haible's test-alignof.c.  */
 
@@ -80,10 +80,20 @@ CHECK_STATIC (struct4);
 int
 main ()
 {
-#if defined __SUNPRO_C
+#if defined __SUNPRO_C && __SUNPRO_C < 0x5150
   /* Avoid a test failure due to Sun Studio Developer Bug Report #2125432.  */
   fputs ("Skipping test: known Sun C compiler bug\n", stderr);
   return 77;
+#elif defined __HP_cc && __ia64
+  /* Avoid a test failure due to HP-UX Itanium cc bug; see:
+     https://lists.gnu.org/r/bug-gnulib/2017-03/msg00078.html  */
+  fputs ("Skipping test: known HP-UX Itanium cc compiler bug\n", stderr);
+  return 77;
+#elif defined __clang__ && defined __ibmxl__
+  /* Avoid a test failure with IBM xlc 16.1.  It ignores alignas (8),
+     _Alignas (8), and __attribute__ ((__aligned__ (8))).  */
+  fputs ("Skipping test: known AIX XL C compiler deficiency\n", stderr);
+  return 77;
 #else
   CHECK_ALIGNED (static_char_alignas);
   CHECK_ALIGNED (static_char_Alignas);
diff --git a/tests/test-stdbool-c++.cc b/tests/test-stdbool-c++.cc
new file mode 100644 (file)
index 0000000..04387eb
--- /dev/null
@@ -0,0 +1,28 @@
+/* Test of <stdbool.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <stdbool.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-stdbool-c++2.cc b/tests/test-stdbool-c++2.cc
new file mode 100644 (file)
index 0000000..fe4b183
--- /dev/null
@@ -0,0 +1,24 @@
+/* Test of <stdbool.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#if __cplusplus >= 201103
+
+# include <cstdbool>
+
+#endif
index 45dc837..60e5242 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdbool.h> substitute.
-   Copyright (C) 2002-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2002-2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
-/* We want this test to succeed even when using gcc's -Werror; but to
-   do that requires a pragma that didn't exist before 4.3.0.  */
-#ifndef __GNUC__
+/* Define ADDRESS_CHECK_OKAY if it is OK to assign an address to a 'bool'
+   and this does not generate a warning (because we want this test to succeed
+   even when using gcc's -Werror).  */
+#if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) \
+    || (__clang_major__ >= 4)
+/* We can silence the warning.  */
+# pragma GCC diagnostic ignored "-Waddress"
 # define ADDRESS_CHECK_OKAY
-#elif __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
-/* No way to silence -Waddress.  */
+#elif defined __GNUC__ || defined __clang__
+/* There may be a warning.  */
 #else
-# pragma GCC diagnostic ignored "-Waddress"
+/* Ignore warnings from other compilers.  */
 # define ADDRESS_CHECK_OKAY
 #endif
 
 
 /* Several tests cannot be guaranteed with gnulib's <stdbool.h>, at
    least, not for all compilers and compiler options.  */
-#if HAVE_STDBOOL_H || 3 <= __GNUC__
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ || 4 <= __clang_major__
 struct s { _Bool s: 1; _Bool t; } s;
 #endif
 
 char a[true == 1 ? 1 : -1];
 char b[false == 0 ? 1 : -1];
 char c[__bool_true_false_are_defined == 1 ? 1 : -1];
-#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above.  */
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ || 4 <= __clang_major__ /* See above.  */
 char d[(bool) 0.5 == true ? 1 : -1];
 # ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning.  */
 /* C99 may plausibly be interpreted as not requiring support for a cast from
    a variable's address to bool in a static initializer.  So treat it like a
    GCC extension.  */
-#  ifdef __GNUC__
+#  if defined __GNUC__ || defined __clang__
 bool e = &s;
 #  endif
 # endif
@@ -73,7 +77,7 @@ char f[(_Bool) 0.0 == false ? 1 : -1];
 #endif
 char g[true];
 char h[sizeof (_Bool)];
-#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above.  */
+#if HAVE_STDBOOL_H || 3 <= __GNUC__ || 4 <= __clang_major__ /* See above.  */
 char i[sizeof s.t];
 #endif
 enum { j = false, k = true, l = false * true, m = true * 256 };
@@ -81,8 +85,8 @@ _Bool n[m];
 char o[sizeof n == m * sizeof n[0] ? 1 : -1];
 char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1];
 /* Catch a bug in an HP-UX C compiler.  See
-   http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
-   http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
+   https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
+   https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
  */
 _Bool q = true;
 _Bool *pq = &q;
@@ -92,7 +96,7 @@ main ()
 {
   int error = 0;
 
-#if HAVE_STDBOOL_H || 3 <= __GNUC__ /* See above.  */
+#if HAVE_STDBOOL_H || 3 <= __GNUC_ || 4 <= __clang_major___ /* See above.  */
 # ifdef ADDRESS_CHECK_OKAY /* Avoid gcc warning.  */
   /* A cast from a variable's address to bool is valid in expressions.  */
   {
@@ -105,7 +109,7 @@ main ()
 
   /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0
      reported by James Lemley on 2005-10-05; see
-     http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
+     https://lists.gnu.org/r/bug-coreutils/2005-10/msg00086.html
      This is a runtime test, since a corresponding compile-time
      test would rely on initializer extensions.  */
   {
diff --git a/tests/test-stddef-c++.cc b/tests/test-stddef-c++.cc
new file mode 100644 (file)
index 0000000..19b7264
--- /dev/null
@@ -0,0 +1,28 @@
+/* Test of <stddef.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <stddef.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-stddef-c++2.cc b/tests/test-stddef-c++2.cc
new file mode 100644 (file)
index 0000000..343238c
--- /dev/null
@@ -0,0 +1,20 @@
+/* Test of <stddef.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cstddef>
index bfb72a0..21b46b9 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stddef.h> substitute.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
 #include <config.h>
 
 #include <stddef.h>
+#include <limits.h>
 #include <stdalign.h>
 #include "verify.h"
 
@@ -43,9 +44,12 @@ struct d
    unlikely to bite real code, we ignore that short-coming.  */
 /* verify (sizeof offsetof (struct d, e) == sizeof (size_t)); */
 verify (sizeof (offsetof (struct d, e)) == sizeof (size_t));
-verify (offsetof (struct d, e) < -1); /* Must be unsigned.  */
 verify (offsetof (struct d, f) == 1);
 
+/* offsetof promotes to an unsigned integer if and only if sizes do
+   not fit in int.  */
+verify ((offsetof (struct d, e) < -1) == (INT_MAX < (size_t) -1));
+
 /* Check max_align_t's alignment.  */
 verify (alignof (double) <= alignof (max_align_t));
 verify (alignof (int) <= alignof (max_align_t));
@@ -55,7 +59,7 @@ verify (alignof (ptrdiff_t) <= alignof (max_align_t));
 verify (alignof (size_t) <= alignof (max_align_t));
 verify (alignof (wchar_t) <= alignof (max_align_t));
 verify (alignof (struct d) <= alignof (max_align_t));
-#if defined __GNUC__ || defined __IBM__ALIGNOF__
+#if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
 verify (__alignof__ (double) <= __alignof__ (max_align_t));
 verify (__alignof__ (int) <= __alignof__ (max_align_t));
 verify (__alignof__ (long double) <= __alignof__ (max_align_t));
diff --git a/tests/test-stdint-c++.cc b/tests/test-stdint-c++.cc
new file mode 100644 (file)
index 0000000..7e26e7b
--- /dev/null
@@ -0,0 +1,28 @@
+/* Test of <stdint.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2019.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <stdint.h>
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-stdint-c++2.cc b/tests/test-stdint-c++2.cc
new file mode 100644 (file)
index 0000000..8e4c706
--- /dev/null
@@ -0,0 +1,24 @@
+/* Test of <stdint.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#if __cplusplus >= 201103
+
+# include <cstdint>
+
+#endif
index 6eb1d2e..dc6fad7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdint.h> substitute.
-   Copyright (C) 2006-2016 Free Software Foundation, Inc.
+   Copyright (C) 2006-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2006.  */
 
@@ -26,7 +26,7 @@
 #include "verify.h"
 #include "intprops.h"
 
-#if __GNUC__ >= 2 && DO_PEDANTIC
+#if ((__GNUC__ >= 2) || (__clang_major__ >= 4)) && DO_PEDANTIC
 # define verify_same_types(expr1,expr2)  \
     extern void _verify_func(__LINE__) (__typeof__ (expr1) *); \
     extern void _verify_func(__LINE__) (__typeof__ (expr2) *);
@@ -217,12 +217,14 @@ err or;
 /* 7.18.2.4. Limits of integer types capable of holding object pointers */
 
 intptr_t g[3] = { 17, INTPTR_MIN, INTPTR_MAX };
+verify (sizeof (void *) <= sizeof (intptr_t));
 verify (TYPE_MINIMUM (intptr_t) == INTPTR_MIN);
 verify (TYPE_MAXIMUM (intptr_t) == INTPTR_MAX);
 verify_same_types (INTPTR_MIN, (intptr_t) 0 + 0);
 verify_same_types (INTPTR_MAX, (intptr_t) 0 + 0);
 
 uintptr_t h[2] = { 17, UINTPTR_MAX };
+verify (sizeof (void *) <= sizeof (uintptr_t));
 verify (TYPE_MAXIMUM (uintptr_t) == UINTPTR_MAX);
 verify_same_types (UINTPTR_MAX, (uintptr_t) 0 + 0);
 
@@ -361,7 +363,7 @@ verify_same_types (UINTMAX_C (17), (uintmax_t)0 + 0);
   */
 #define verify_width(width, min, max) \
   _GL_VERIFY ((max) >> ((width) - 1 - ((min) < 0)) == 1, \
-              "verify_width check")
+              "verify_width check", -)
 
 /* Macros specified by ISO/IEC TS 18661-1:2014.  */
 
index eeefdd6..a2fc5b1 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdio.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
@@ -131,6 +131,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::obstack_vprintf, int,
                  (struct obstack *, const char *, va_list));
 #endif
 
+#if GNULIB_TEST_PCLOSE
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pclose, int, (FILE *));
+#endif
+
 //SIGNATURE_CHECK (GNULIB_NAMESPACE::pclose, int, (FILE *));
 
 #if GNULIB_TEST_PERROR
index 6297e38..8c09139 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdio.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #define GNULIB_NAMESPACE gnulib
 #include <config.h>
index 6cde888..8fd000a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdio.h> substitute.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 56d88d1..2079445 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdlib.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
 SIGNATURE_CHECK (GNULIB_NAMESPACE::_Exit, void, (int));
 #endif
 
+#if GNULIB_TEST_ALIGNED_ALLOC && HAVE_ALIGNED_ALLOC
+SIGNATURE_CHECK (GNULIB_NAMESPACE::aligned_alloc, void *, (size_t, size_t));
+#endif
+
 //SIGNATURE_CHECK (GNULIB_NAMESPACE::atexit, int, (void (*) (void)));
 
 #if GNULIB_TEST_ATOLL
@@ -43,6 +47,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::canonicalize_file_name, char *,
                  (const char *));
 #endif
 
+#if GNULIB_TEST_FREE_POSIX
+SIGNATURE_CHECK (GNULIB_NAMESPACE::free, void, (void *));
+#endif
+
 #if GNULIB_TEST_GETLOADAVG
 SIGNATURE_CHECK (GNULIB_NAMESPACE::getloadavg, int, (double[], int));
 #endif
@@ -85,14 +93,50 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::mkstemp, int, (char *));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::mkstemps, int, (char *, int));
 #endif
 
+#if GNULIB_TEST_POSIX_MEMALIGN && HAVE_POSIX_MEMALIGN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_memalign, int,
+                 (void **, size_t, size_t));
+#endif
+
+#if GNULIB_TEST_POSIX_OPENPT
+SIGNATURE_CHECK (GNULIB_NAMESPACE::posix_openpt, int, (int));
+#endif
+
 #if GNULIB_TEST_PTSNAME
 SIGNATURE_CHECK (GNULIB_NAMESPACE::ptsname, char *, (int));
 #endif
 
+#if GNULIB_TEST_PTSNAME_R
+SIGNATURE_CHECK (GNULIB_NAMESPACE::ptsname_r, int, (int, char *, size_t));
+#endif
+
 #if GNULIB_TEST_PUTENV
 SIGNATURE_CHECK (GNULIB_NAMESPACE::putenv, int, (char *));
 #endif
 
+#if GNULIB_TEST_QSORT_R
+SIGNATURE_CHECK (GNULIB_NAMESPACE::qsort_r, void,
+                 (void *, size_t, size_t,
+                  int (*) (void const *, void const *, void *), void *));
+#endif
+
+#if GNULIB_TEST_RANDOM
+SIGNATURE_CHECK (GNULIB_NAMESPACE::random, long, (void));
+#endif
+
+#if GNULIB_TEST_RANDOM
+SIGNATURE_CHECK (GNULIB_NAMESPACE::srandom, void, (unsigned int));
+#endif
+
+#if GNULIB_TEST_RANDOM
+SIGNATURE_CHECK (GNULIB_NAMESPACE::initstate, char *,
+                 (unsigned int, char *, size_t));
+#endif
+
+#if GNULIB_TEST_RANDOM
+SIGNATURE_CHECK (GNULIB_NAMESPACE::setstate, char *, (char *));
+#endif
+
 #if GNULIB_TEST_RANDOM_R
 SIGNATURE_CHECK (GNULIB_NAMESPACE::random_r, int,
                  (struct random_data *, int32_t *));
@@ -125,6 +169,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::realpath, char *, (const char *, char *));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::rpmatch, int, (const char *));
 #endif
 
+#if GNULIB_TEST_SECURE_GETENV
+SIGNATURE_CHECK (GNULIB_NAMESPACE::secure_getenv, char *, (char const *));
+#endif
+
 #if GNULIB_TEST_SETENV
 SIGNATURE_CHECK (GNULIB_NAMESPACE::setenv, int,
                  (const char *, const char *, int));
index da6bcf7..cd053f7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdlib.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #define GNULIB_NAMESPACE gnulib
 #include <config.h>
index a1fc0d8..427263e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <stdlib.h> substitute.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 14e5ea6..53ac0db 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2021 Free Software Foundation, Inc.
  * Written by Eric Blake and Bruno Haible
  *
  * This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 80ffe1c..2e4125b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of strerror() function.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2007.  */
 
diff --git a/tests/test-strerror_r.c b/tests/test-strerror_r.c
new file mode 100644 (file)
index 0000000..6e72194
--- /dev/null
@@ -0,0 +1,178 @@
+/* Test of strerror_r() function.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <string.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (strerror_r, int, (int, char *, size_t));
+
+#include <errno.h>
+
+#include "macros.h"
+
+int
+main (void)
+{
+  char buf[100];
+  int ret;
+
+  /* Test results with valid errnum and enough room.  */
+
+  errno = 0;
+  buf[0] = '\0';
+  ASSERT (strerror_r (EACCES, buf, sizeof buf) == 0);
+  ASSERT (buf[0] != '\0');
+  ASSERT (errno == 0);
+  ASSERT (strlen (buf) < sizeof buf);
+
+  errno = 0;
+  buf[0] = '\0';
+  ASSERT (strerror_r (ETIMEDOUT, buf, sizeof buf) == 0);
+  ASSERT (buf[0] != '\0');
+  ASSERT (errno == 0);
+  ASSERT (strlen (buf) < sizeof buf);
+
+  errno = 0;
+  buf[0] = '\0';
+  ASSERT (strerror_r (EOVERFLOW, buf, sizeof buf) == 0);
+  ASSERT (buf[0] != '\0');
+  ASSERT (errno == 0);
+  ASSERT (strlen (buf) < sizeof buf);
+
+  /* POSIX requires strerror (0) to succeed.  Reject use of "Unknown
+     error", but allow "Success", "No error", or even Solaris' "Error
+     0" which are distinct patterns from true out-of-range strings.
+     http://austingroupbugs.net/view.php?id=382  */
+  errno = 0;
+  buf[0] = '\0';
+  ret = strerror_r (0, buf, sizeof buf);
+  ASSERT (ret == 0);
+  ASSERT (buf[0]);
+  ASSERT (errno == 0);
+  ASSERT (strstr (buf, "nknown") == NULL);
+  ASSERT (strstr (buf, "ndefined") == NULL);
+
+  /* Test results with out-of-range errnum and enough room.  POSIX
+     allows an empty string on success, and allows an unchanged buf on
+     error, but these are not useful, so we guarantee contents.  */
+  errno = 0;
+  buf[0] = '^';
+  ret = strerror_r (-3, buf, sizeof buf);
+  ASSERT (ret == 0 || ret == EINVAL);
+  ASSERT (buf[0] != '^');
+  ASSERT (*buf);
+  ASSERT (errno == 0);
+  ASSERT (strlen (buf) < sizeof buf);
+
+  /* Test results with a too small buffer.  POSIX requires an error;
+     only ERANGE for 0 and valid errors, and a choice of ERANGE or
+     EINVAL for out-of-range values.  On error, POSIX permits buf to
+     be empty, unchanged, or unterminated, but these are not useful,
+     so we guarantee NUL-terminated truncated contents for all but
+     size 0.  http://austingroupbugs.net/view.php?id=398.  Also ensure
+     that no out-of-bounds writes occur.  */
+  {
+    int errs[] = { EACCES, 0, -3, };
+    int j;
+
+    buf[sizeof buf - 1] = '\0';
+    for (j = 0; j < SIZEOF (errs); j++)
+      {
+        int err = errs[j];
+        char buf2[sizeof buf] = "";
+        size_t len;
+        size_t i;
+
+        strerror_r (err, buf2, sizeof buf2);
+        len = strlen (buf2);
+        ASSERT (len < sizeof buf);
+
+        for (i = 0; i <= len; i++)
+          {
+            memset (buf, '^', sizeof buf - 1);
+            errno = 0;
+            ret = strerror_r (err, buf, i);
+            ASSERT (errno == 0);
+            if (j == 2)
+              ASSERT (ret == ERANGE || ret == EINVAL);
+            else
+              ASSERT (ret == ERANGE);
+            if (i)
+              {
+                ASSERT (strncmp (buf, buf2, i - 1) == 0);
+                ASSERT (buf[i - 1] == '\0');
+              }
+            ASSERT (strspn (buf + i, "^") == sizeof buf - 1 - i);
+          }
+
+        strcpy (buf, "BADFACE");
+        errno = 0;
+        ret = strerror_r (err, buf, len + 1);
+        ASSERT (ret != ERANGE);
+        ASSERT (errno == 0);
+        ASSERT (strcmp (buf, buf2) == 0);
+      }
+  }
+
+#if GNULIB_STRERROR
+  /* Test that strerror_r does not clobber strerror buffer.  On some
+     platforms, this test can only succeed if gnulib also replaces
+     strerror.  */
+  {
+    const char *msg1;
+    const char *msg2;
+    const char *msg3;
+    const char *msg4;
+    char *str1;
+    char *str2;
+    char *str3;
+    char *str4;
+
+    msg1 = strerror (ENOENT);
+    ASSERT (msg1);
+    str1 = strdup (msg1);
+    ASSERT (str1);
+
+    msg2 = strerror (ERANGE);
+    ASSERT (msg2);
+    str2 = strdup (msg2);
+    ASSERT (str2);
+
+    msg3 = strerror (-4);
+    ASSERT (msg3);
+    str3 = strdup (msg3);
+    ASSERT (str3);
+
+    msg4 = strerror (1729576);
+    ASSERT (msg4);
+    str4 = strdup (msg4);
+    ASSERT (str4);
+
+    strerror_r (EACCES, buf, sizeof buf);
+    strerror_r (-5, buf, sizeof buf);
+    ASSERT (STREQ (msg4, str4));
+
+    free (str1);
+    free (str2);
+    free (str3);
+    free (str4);
+  }
+#endif
+
+  return 0;
+}
diff --git a/tests/test-striconv.c b/tests/test-striconv.c
new file mode 100644 (file)
index 0000000..55bd3df
--- /dev/null
@@ -0,0 +1,180 @@
+/* Test of character set conversion.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include "striconv.h"
+
+#if HAVE_ICONV
+# include <iconv.h>
+#endif
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "macros.h"
+
+int
+main ()
+{
+#if HAVE_ICONV
+  /* Assume that iconv() supports at least the encodings ASCII, ISO-8859-1,
+     and UTF-8.  */
+  iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
+  iconv_t cd_utf8_to_88591 = iconv_open ("ISO-8859-1", "UTF-8");
+
+  ASSERT (cd_88591_to_utf8 != (iconv_t)(-1));
+  ASSERT (cd_utf8_to_88591 != (iconv_t)(-1));
+
+  /* ------------------------- Test mem_cd_iconv() ------------------------- */
+
+  /* Test conversion from ISO-8859-1 to UTF-8 with no errors.  */
+  {
+    static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+    static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+    char *result = NULL;
+    size_t length = 0;
+    int retval = mem_cd_iconv (input, strlen (input), cd_88591_to_utf8,
+                               &result, &length);
+    ASSERT (retval == 0);
+    ASSERT (length == strlen (expected));
+    ASSERT (result != NULL && memcmp (result, expected, strlen (expected)) == 0);
+    free (result);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with no errors.  */
+  {
+    static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+    static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+    char *result = NULL;
+    size_t length = 0;
+    int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591,
+                               &result, &length);
+    ASSERT (retval == 0);
+    ASSERT (length == strlen (expected));
+    ASSERT (result != NULL && memcmp (result, expected, strlen (expected)) == 0);
+    free (result);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ.  */
+  {
+    static const char input[] = "\342\202\254"; /* EURO SIGN */
+    char *result = NULL;
+    size_t length = 0;
+    int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591,
+                               &result, &length);
+    ASSERT (retval == -1 && errno == EILSEQ);
+    ASSERT (result == NULL);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL.  */
+  {
+    static const char input[] = "\342";
+    char *result = NULL;
+    size_t length = 0;
+    int retval = mem_cd_iconv (input, strlen (input), cd_utf8_to_88591,
+                               &result, &length);
+    ASSERT (retval == 0);
+    ASSERT (length == 0);
+    free (result);
+  }
+
+  /* ------------------------- Test str_cd_iconv() ------------------------- */
+
+  /* Test conversion from ISO-8859-1 to UTF-8 with no errors.  */
+  {
+    static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+    static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+    char *result = str_cd_iconv (input, cd_88591_to_utf8);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, expected) == 0);
+    free (result);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with no errors.  */
+  {
+    static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+    static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+    char *result = str_cd_iconv (input, cd_utf8_to_88591);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, expected) == 0);
+    free (result);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ.  */
+  {
+    static const char input[] = "Costs: 27 \342\202\254"; /* EURO SIGN */
+    char *result = str_cd_iconv (input, cd_utf8_to_88591);
+    ASSERT (result == NULL && errno == EILSEQ);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL.  */
+  {
+    static const char input[] = "\342";
+    char *result = str_cd_iconv (input, cd_utf8_to_88591);
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "") == 0);
+    free (result);
+  }
+
+  iconv_close (cd_88591_to_utf8);
+  iconv_close (cd_utf8_to_88591);
+
+  /* -------------------------- Test str_iconv() -------------------------- */
+
+  /* Test conversion from ISO-8859-1 to UTF-8 with no errors.  */
+  {
+    static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+    static const char expected[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+    char *result = str_iconv (input, "ISO-8859-1", "UTF-8");
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, expected) == 0);
+    free (result);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with no errors.  */
+  {
+    static const char input[] = "\303\204rger mit b\303\266sen B\303\274bchen ohne Augenma\303\237";
+    static const char expected[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+    char *result = str_iconv (input, "UTF-8", "ISO-8859-1");
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, expected) == 0);
+    free (result);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with EILSEQ.  */
+  {
+    static const char input[] = "Costs: 27 \342\202\254"; /* EURO SIGN */
+    char *result = str_iconv (input, "UTF-8", "ISO-8859-1");
+    ASSERT (result == NULL && errno == EILSEQ);
+  }
+
+  /* Test conversion from UTF-8 to ISO-8859-1 with EINVAL.  */
+  {
+    static const char input[] = "\342";
+    char *result = str_iconv (input, "UTF-8", "ISO-8859-1");
+    ASSERT (result != NULL);
+    ASSERT (strcmp (result, "") == 0);
+    free (result);
+  }
+
+#endif
+
+  return 0;
+}
index 57b4739..e2c16da 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <string.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
 #include "signature.h"
 
 
+#if GNULIB_TEST_FFSL
+SIGNATURE_CHECK (GNULIB_NAMESPACE::ffsl, int, (long int));
+#endif
+
+#if GNULIB_TEST_FFSLL
+SIGNATURE_CHECK (GNULIB_NAMESPACE::ffsll, int, (long long int));
+#endif
+
 #if GNULIB_TEST_MEMCHR
 SIGNATURE_CHECK (GNULIB_NAMESPACE::memchr, void *,
                  (void const *, int, size_t));
@@ -130,6 +138,18 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::strerror, char *, (int));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::strerror_r, int, (int, char *, size_t));
 #endif
 
+#if GNULIB_TEST_STRERRORNAME_NP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::strerrorname_np, const char *, (int));
+#endif
+
+#if GNULIB_TEST_SIGABBREV_NP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::sigabbrev_np, const char *, (int));
+#endif
+
+#if GNULIB_TEST_SIGDESCR_NP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::sigdescr_np, const char *, (int));
+#endif
+
 #if GNULIB_TEST_STRSIGNAL
 SIGNATURE_CHECK (GNULIB_NAMESPACE::strsignal, char *, (int));
 #endif
index 6e9cd3e..3a372b7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <string.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #define GNULIB_NAMESPACE gnulib
 #include <config.h>
index f4c60f7..bad996f 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <string.h> substitute.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index ee5bd78..6470ebc 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2010-2021 Free Software Foundation, Inc.
  * Written by Eric Blake
  *
  * This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 80ae230..7b96de4 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of strsignal() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Colin Watson <cjwatson@debian.org>, 2008.  */
 
@@ -28,10 +28,12 @@ SIGNATURE_CHECK (strsignal, char *, (int));
 #include "macros.h"
 
 #if HAVE_DECL_SYS_SIGLIST
-# define ASSERT_DESCRIPTION(got, expect)
+# define ASSERT_DESCRIPTION(actual, expected)
 #else
-/* In this case, we can guarantee some signal descriptions.  */
-# define ASSERT_DESCRIPTION(got, expect) ASSERT (!strcmp (got, expect))
+/* In this case, we can guarantee some signal descriptions.
+   But allow the actual result to be longer than the expected result.  */
+# define ASSERT_DESCRIPTION(actual, expected) \
+   ASSERT (strncmp (actual, expected, strlen (expected)) == 0)
 #endif
 
 int
index eaefb06..434fc23 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2004, 2007-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2004, 2007-2021 Free Software Foundation, Inc.
  * Written by Bruno Haible and Eric Blake
  *
  * This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -58,9 +58,9 @@ main (int argc, char *argv[])
     /* On some platforms, the memchr() functions reads past the first
        occurrence of the byte to be searched, leading to an out-of-bounds
        read access for strstr().
-       See <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737>.
+       See <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=521737>.
        This is a bug in memchr(), see the Austin Group's clarification
-       <http://www.opengroup.org/austin/docs/austin_454.txt>.  */
+       <https://www.opengroup.org/austin/docs/austin_454.txt>.  */
     const char *fix = "aBaaaaaaaaaaax";
     char *page_boundary = (char *) zerosize_ptr ();
     size_t len = strlen (fix) + 1;
@@ -275,5 +275,27 @@ main (int argc, char *argv[])
     free (haystack);
   }
 
+  /* Test long needles.  */
+  {
+    size_t m = 1024;
+    char *haystack = (char *) malloc (2 * m + 1);
+    char *needle = (char *) malloc (m + 1);
+    if (haystack != NULL && needle != NULL)
+      {
+        const char *p;
+        haystack[0] = 'x';
+        memset (haystack + 1, ' ', m - 1);
+        memset (haystack + m, 'x', m);
+        haystack[2 * m] = '\0';
+        memset (needle, 'x', m);
+        needle[m] = '\0';
+        p = strstr (haystack, needle);
+        ASSERT (p);
+        ASSERT (p - haystack == m);
+      }
+    free (needle);
+    free (haystack);
+  }
+
   return 0;
 }
index 17aa69f..a80e602 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008-2016 Free Software Foundation, Inc.
+ * Copyright (C) 2008-2021 Free Software Foundation, Inc.
  * Written by Eric Blake
  *
  * This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -155,10 +155,7 @@ main (void)
     double result;
     errno = 0;
     result = strtod (input, &ptr);
-    /* FIXME - gnulib's version is rather inaccurate.  It would be
-       nice to guarantee an exact result, but for now, we settle for a
-       1-ulp error.  */
-    ASSERT (FABS (result - 0.5) < DBL_EPSILON);
+    ASSERT (result == 0.5);
     ASSERT (ptr == input + 2);
     ASSERT (errno == 0);
   }
@@ -238,10 +235,7 @@ main (void)
     double result;
     errno = 0;
     result = strtod (input, &ptr);
-    /* FIXME - gnulib's version is rather inaccurate.  It would be
-       nice to guarantee an exact result, but for now, we settle for a
-       1-ulp error.  */
-    ASSERT (FABS (result - 0.5) < DBL_EPSILON);
+    ASSERT (result == 0.5);
     ASSERT (ptr == input + 4);
     ASSERT (errno == 0);
   }
diff --git a/tests/test-strtod1.c b/tests/test-strtod1.c
new file mode 100644 (file)
index 0000000..350f660
--- /dev/null
@@ -0,0 +1,101 @@
+/* Test of strtod() in a French locale.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <stdlib.h>
+
+#include <errno.h>
+#include <locale.h>
+
+#include "macros.h"
+
+int
+main (int argc, char *argv[])
+{
+  /* Try to set the locale by implicitly looking at the LC_ALL environment
+     variable.
+     configure should already have checked that the locale is supported.  */
+  if (setlocale (LC_ALL, "") == NULL)
+    return 1;
+
+  {
+    const char input[] = "1,";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.0);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = ",5";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 0.5);
+    ASSERT (ptr == input + 2);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1,5";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result == 1.5);
+    ASSERT (ptr == input + 3);
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "1.5";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    /* On AIX 7.2, in the French locale, '.' is recognized as an alternate
+       radix character.  */
+    ASSERT ((ptr == input + 1 && result == 1.0)
+            || (ptr == input + 3 && result == 1.5));
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "123.456,789";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    /* On AIX 7.2, in the French locale, '.' is recognized as an alternate
+       radix character.  */
+    ASSERT ((ptr == input + 3 && result == 123.0)
+            || (ptr == input + 7 && result > 123.45 && result < 123.46));
+    ASSERT (errno == 0);
+  }
+  {
+    const char input[] = "123,456.789";
+    char *ptr;
+    double result;
+    errno = 0;
+    result = strtod (input, &ptr);
+    ASSERT (result > 123.45 && result < 123.46);
+    ASSERT (ptr == input + 7);
+    ASSERT (errno == 0);
+  }
+
+  return 0;
+}
diff --git a/tests/test-strtod1.sh b/tests/test-strtod1.sh
new file mode 100755 (executable)
index 0000000..2ec4ebf
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+: ${LOCALE_FR=fr_FR}
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  if test -f /usr/bin/localedef; then
+    echo "Skipping test: no locale for testing is installed"
+  else
+    echo "Skipping test: no locale for testing is supported"
+  fi
+  exit 77
+fi
+
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR      ${CHECKER} ./test-strtod1${EXEEXT} || exit 1
+fi
+
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ${CHECKER} ./test-strtod1${EXEEXT} || exit 1
+fi
+
+exit 0
index ad13b93..95a3fbf 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of symlink.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index fc064e8..3128d0a 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of symlink.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
@@ -67,7 +67,8 @@ test_symlink (int (*func) (char const *, char const *), bool print)
   ASSERT (errno == EEXIST);
   errno = 0;
   ASSERT (func ("nowhere", BASE "dir/") == -1);
-  ASSERT (errno == EEXIST || errno == EINVAL);
+  ASSERT (errno == EEXIST || errno == EINVAL
+          || errno == ENOENT /* Lustre FS on Linux */);
   ASSERT (close (creat (BASE "file", 0600)) == 0);
   errno = 0;
   ASSERT (func ("nowhere", BASE "file") == -1);
diff --git a/tests/test-sys_ioctl-c++.cc b/tests/test-sys_ioctl-c++.cc
new file mode 100644 (file)
index 0000000..f883ae7
--- /dev/null
@@ -0,0 +1,35 @@
+/* Test of <sys/ioctl.h> substitute in C++ mode.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <sys/ioctl.h>
+
+#include "signature.h"
+
+
+#if GNULIB_TEST_IOCTL
+SIGNATURE_CHECK (GNULIB_NAMESPACE::ioctl, int, (int, int, ...));
+#endif
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-sys_ioctl.c b/tests/test-sys_ioctl.c
new file mode 100644 (file)
index 0000000..151bf31
--- /dev/null
@@ -0,0 +1,27 @@
+/* Test of <sys/ioctl.h> substitute.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake <ebb9@byu.net>, 2009.  */
+
+#include <config.h>
+
+#include <sys/ioctl.h>
+
+int
+main (void)
+{
+  return 0;
+}
diff --git a/tests/test-sys_random-c++.cc b/tests/test-sys_random-c++.cc
new file mode 100644 (file)
index 0000000..07219c7
--- /dev/null
@@ -0,0 +1,35 @@
+/* Test of <sys/random.h> substitute in C++ mode.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2020.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <sys/random.h>
+
+#include "signature.h"
+
+
+#if GNULIB_TEST_GETRANDOM
+SIGNATURE_CHECK (GNULIB_NAMESPACE::getrandom, ssize_t, (void *, size_t, unsigned int));
+#endif
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-sys_random.c b/tests/test-sys_random.c
new file mode 100644 (file)
index 0000000..1bf5336
--- /dev/null
@@ -0,0 +1,32 @@
+/* Test of <sys/random.h> substitute.
+   Copyright (C) 2020-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+#include <sys/random.h>
+
+/* Check that the necessary constants are defined.  */
+int flags[] =
+  {
+    GRND_RANDOM,
+    GRND_NONBLOCK
+  };
+
+int
+main (void)
+{
+  return 0;
+}
diff --git a/tests/test-sys_select-c++.cc b/tests/test-sys_select-c++.cc
new file mode 100644 (file)
index 0000000..ce9ccb5
--- /dev/null
@@ -0,0 +1,42 @@
+/* Test of <sys/select.h> substitute in C++ mode.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <sys/select.h>
+
+#include "signature.h"
+
+
+#if GNULIB_TEST_PSELECT
+SIGNATURE_CHECK (GNULIB_NAMESPACE::pselect, int,
+                 (int, fd_set *restrict, fd_set *restrict, fd_set *restrict,
+                  struct timespec const *restrict, sigset_t const *restrict));
+#endif
+
+#if GNULIB_TEST_SELECT
+SIGNATURE_CHECK (GNULIB_NAMESPACE::select, int,
+                 (int, fd_set *, fd_set *, fd_set *, struct timeval *));
+#endif
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-sys_select.c b/tests/test-sys_select.c
new file mode 100644 (file)
index 0000000..48667ce
--- /dev/null
@@ -0,0 +1,59 @@
+/* Test of <sys/select.h> substitute.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <sys/select.h>
+
+#include "signature.h"
+
+/* The following may be macros without underlying functions, so only
+   check signature if they are not macros.  */
+#ifndef FD_CLR
+SIGNATURE_CHECK (FD_CLR, void, (int, fd_set *));
+#endif
+#ifndef FD_ISSET
+SIGNATURE_CHECK (FD_ISSET, void, (int, fd_set *));
+#endif
+#ifndef FD_SET
+SIGNATURE_CHECK (FD_SET, int, (int, fd_set *));
+#endif
+#ifndef FD_ZERO
+SIGNATURE_CHECK (FD_ZERO, void, (fd_set *));
+#endif
+
+/* Check that the 'struct timeval' type is defined.  */
+struct timeval a;
+
+/* Check that a.tv_sec is wide enough to hold a time_t, ignoring
+   signedness issues.  */
+typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof (a.tv_sec) ? 1 : -1];
+
+/* Check that sigset_t is defined.  */
+sigset_t t2;
+
+int
+main (void)
+{
+  /* Check that FD_ZERO can be used.  This should not yield a warning
+     such as "warning: implicit declaration of function 'memset'".  */
+  fd_set fds;
+  FD_ZERO (&fds);
+
+  return 0;
+}
diff --git a/tests/test-sys_socket-c++.cc b/tests/test-sys_socket-c++.cc
new file mode 100644 (file)
index 0000000..9cc4535
--- /dev/null
@@ -0,0 +1,103 @@
+/* Test of <sys/socket.h> substitute in C++ mode.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include "signature.h"
+
+
+#if GNULIB_TEST_SOCKET
+SIGNATURE_CHECK (GNULIB_NAMESPACE::socket, int, (int, int, int));
+#endif
+
+#if GNULIB_TEST_CONNECT
+SIGNATURE_CHECK (GNULIB_NAMESPACE::connect, int,
+                 (int, const struct sockaddr *, socklen_t));
+#endif
+
+#if GNULIB_TEST_ACCEPT
+SIGNATURE_CHECK (GNULIB_NAMESPACE::accept, int,
+                 (int, struct sockaddr *, socklen_t *));
+#endif
+
+#if GNULIB_TEST_BIND
+SIGNATURE_CHECK (GNULIB_NAMESPACE::bind, int,
+                 (int, const struct sockaddr *, socklen_t));
+#endif
+
+#if GNULIB_TEST_GETPEERNAME
+SIGNATURE_CHECK (GNULIB_NAMESPACE::getpeername, int,
+                 (int, struct sockaddr *, socklen_t *));
+#endif
+
+#if GNULIB_TEST_GETSOCKNAME
+SIGNATURE_CHECK (GNULIB_NAMESPACE::getsockname, int,
+                 (int, struct sockaddr *, socklen_t *));
+#endif
+
+#if GNULIB_TEST_GETSOCKOPT
+SIGNATURE_CHECK (GNULIB_NAMESPACE::getsockopt, int,
+                 (int, int, int, void *, socklen_t *));
+#endif
+
+#if GNULIB_TEST_LISTEN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::listen, int, (int, int));
+#endif
+
+#if GNULIB_TEST_RECV
+SIGNATURE_CHECK (GNULIB_NAMESPACE::recv, ssize_t, (int, void *, size_t, int));
+#endif
+
+#if GNULIB_TEST_SEND
+SIGNATURE_CHECK (GNULIB_NAMESPACE::send, ssize_t,
+                 (int, const void *, size_t, int));
+#endif
+
+#if GNULIB_TEST_RECVFROM
+SIGNATURE_CHECK (GNULIB_NAMESPACE::recvfrom, ssize_t,
+                 (int, void *, size_t, int, struct sockaddr *, socklen_t *));
+#endif
+
+#if GNULIB_TEST_SENDTO
+SIGNATURE_CHECK (GNULIB_NAMESPACE::sendto, ssize_t,
+                 (int, const void *, size_t, int,
+                  const struct sockaddr *, socklen_t));
+#endif
+
+#if GNULIB_TEST_SETSOCKOPT
+SIGNATURE_CHECK (GNULIB_NAMESPACE::setsockopt, int,
+                 (int, int, int, const void *, socklen_t));
+#endif
+
+#if GNULIB_TEST_SHUTDOWN
+SIGNATURE_CHECK (GNULIB_NAMESPACE::shutdown, int, (int, int));
+#endif
+
+#if GNULIB_TEST_ACCEPT4
+SIGNATURE_CHECK (GNULIB_NAMESPACE::accept4, int,
+                 (int, struct sockaddr *, socklen_t *, int));
+#endif
+
+
+int
+main ()
+{
+}
diff --git a/tests/test-sys_socket.c b/tests/test-sys_socket.c
new file mode 100644 (file)
index 0000000..49f4958
--- /dev/null
@@ -0,0 +1,68 @@
+/* Test of <sys/socket.h> substitute.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <sys/socket.h>
+
+#include <errno.h>
+
+#if HAVE_SHUTDOWN
+/* Check some integer constant expressions.  */
+int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
+#endif
+
+/* Check that the 'socklen_t' type is defined.  */
+socklen_t t1;
+
+/* Check that the 'size_t' and 'ssize_t' types are defined.  */
+size_t t2;
+ssize_t t3;
+
+/* Check that 'struct iovec' is defined.  */
+struct iovec io;
+
+/* Check that a minimal set of 'struct msghdr' is defined.  */
+struct msghdr msg;
+
+int
+main (void)
+{
+  struct sockaddr_storage x;
+  sa_family_t i;
+
+  /* Check some errno values.  */
+  switch (ENOTSOCK)
+    {
+    case ENOTSOCK:
+    case EADDRINUSE:
+    case ENETRESET:
+    case ECONNABORTED:
+    case ECONNRESET:
+    case ENOTCONN:
+    case ESHUTDOWN:
+      break;
+    }
+
+  x.ss_family = 42;
+  i = 42;
+  msg.msg_iov = &io;
+
+  return (x.ss_family - i + msg.msg_namelen + msg.msg_iov->iov_len
+          + msg.msg_iovlen);
+}
index e2ae4a2..91ef202 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/stat.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
@@ -43,6 +43,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::futimens, int,
                  (int, struct timespec const[2]));
 #endif
 
+#if GNULIB_TEST_GETUMASK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::getumask, mode_t, (void));
+#endif
+
 #if GNULIB_TEST_LCHMOD
 SIGNATURE_CHECK (GNULIB_NAMESPACE::lchmod, int, (const char *, mode_t));
 #endif
index 8a3af94..e5f88c0 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/stat.h> substitute.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 0127ea4..a853677 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/time.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
index 44535b9..764321b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/time.h> substitute.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 75cc24b..83be79f 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/types.h> substitute in C++ mode.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2011.  */
 
index 7f8fb6d..a0bcc04 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/types.h> substitute.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2011.  */
 
diff --git a/tests/test-sys_uio.c b/tests/test-sys_uio.c
new file mode 100644 (file)
index 0000000..723f36b
--- /dev/null
@@ -0,0 +1,32 @@
+/* Test of <sys/uio.h> substitute.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Eric Blake <eblake@redhat.com>, 2011.  */
+
+#include <config.h>
+
+#include <sys/uio.h>
+
+/* Check that necessary types are defined.  */
+size_t a;
+ssize_t b;
+struct iovec c;
+
+int
+main (void)
+{
+  return a + b + !!c.iov_base + c.iov_len;
+}
index 19df9d6..f65d2d6 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/wait.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
index f814ff3..595956a 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <sys/wait.h> substitute.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index 7389be4..4508f57 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of macros shared between <sys/wait.h> and <stdlib.h>.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2010.  */
 
diff --git a/tests/test-thread_create.c b/tests/test-thread_create.c
new file mode 100644 (file)
index 0000000..f4213d4
--- /dev/null
@@ -0,0 +1,78 @@
+/* Test of gl_thread_create () macro.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2011.  */
+
+#include <config.h>
+
+#include "glthread/thread.h"
+
+#include <stdio.h>
+#include <string.h>
+
+#include "macros.h"
+
+static gl_thread_t main_thread_before;
+static gl_thread_t main_thread_after;
+static gl_thread_t worker_thread;
+
+static int dummy;
+static volatile int work_done;
+
+static void *
+worker_thread_func (void *arg)
+{
+  work_done = 1;
+  return &dummy;
+}
+
+int
+main ()
+{
+  main_thread_before = gl_thread_self ();
+
+  if (glthread_create (&worker_thread, worker_thread_func, NULL) == 0)
+    {
+      void *ret;
+
+      /* Check that gl_thread_self () has the same value before than after the
+         first call to gl_thread_create ().  */
+      main_thread_after = gl_thread_self ();
+      ASSERT (memcmp (&main_thread_before, &main_thread_after,
+                      sizeof (gl_thread_t))
+              == 0);
+
+      gl_thread_join (worker_thread, &ret);
+
+      /* Check the return value of the thread.  */
+      ASSERT (ret == &dummy);
+
+      /* Check that worker_thread_func () has finished executing.  */
+      ASSERT (work_done);
+
+      return 0;
+    }
+  else
+    {
+#if USE_ISOC_THREADS || USE_POSIX_THREADS || USE_ISOC_AND_POSIX_THREADS || USE_WINDOWS_THREADS
+      fputs ("glthread_create failed\n", stderr);
+      return 1;
+#else
+      fputs ("Skipping test: multithreading not enabled\n", stderr);
+      return 77;
+#endif
+    }
+}
diff --git a/tests/test-thread_self.c b/tests/test-thread_self.c
new file mode 100644 (file)
index 0000000..69d876d
--- /dev/null
@@ -0,0 +1,39 @@
+/* Test of gl_thread_self () macro.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2011.  */
+
+#include <config.h>
+
+#include "glthread/thread.h"
+
+gl_thread_t main_thread;
+
+int
+main ()
+{
+  /* Check that gl_thread_self () can be used with just $(LIBTHREAD), not
+     $(LIBMULTITHREAD), i.e. in libraries that are multithread-safe but don't
+     create threads themselves.  */
+  /* This is not the case on AIX with --enable-threads=isoc+posix, because in
+     this case, $(LIBTHREAD) is empty whereas $(LIBMULTITHREAD) is '-lpthread'.
+   */
+#if !defined _AIX
+  main_thread = gl_thread_self ();
+#endif
+
+  return 0;
+}
index 161c7ac..cdcd61e 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <time.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
 #include "signature.h"
 
 
+#if GNULIB_TEST_TIMESPEC_GET
+SIGNATURE_CHECK (GNULIB_NAMESPACE::timespec_get, int, (struct timespec *, int));
+#endif
+
 #if GNULIB_TEST_NANOSLEEP
 SIGNATURE_CHECK (GNULIB_NAMESPACE::nanosleep, int,
                  (struct timespec const *, struct timespec *));
 #endif
 
+#if GNULIB_TEST_TZSET
+SIGNATURE_CHECK (GNULIB_NAMESPACE::tzset, void, (void));
+#endif
+
 #if GNULIB_TEST_MKTIME
 SIGNATURE_CHECK (GNULIB_NAMESPACE::mktime, time_t, (struct tm *));
 #endif
@@ -41,11 +49,36 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::gmtime_r, struct tm *,
                  (time_t const *, struct tm *));
 #endif
 
+#if GNULIB_TEST_LOCALTIME
+SIGNATURE_CHECK (GNULIB_NAMESPACE::localtime, struct tm *, (time_t const *));
+#endif
+
+#if 0
+SIGNATURE_CHECK (GNULIB_NAMESPACE::gmtime, struct tm *, (time_t const *));
+#endif
+
 #if GNULIB_TEST_STRPTIME
 SIGNATURE_CHECK (GNULIB_NAMESPACE::strptime, char *,
                  (char const *, char const *, struct tm *));
 #endif
 
+#if GNULIB_TEST_CTIME
+SIGNATURE_CHECK (GNULIB_NAMESPACE::ctime, char *, (time_t const *));
+#endif
+
+#if GNULIB_TEST_STRFTIME
+SIGNATURE_CHECK (GNULIB_NAMESPACE::strftime, size_t,
+                 (char *, size_t, const char *, const struct tm *));
+#endif
+
+#if GNULIB_TEST_TIMERZ
+SIGNATURE_CHECK (GNULIB_NAMESPACE::tzalloc, timezone_t, (char const *));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::tzfree, void, (timezone_t));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::localtime_rz, struct tm *,
+                 (timezone_t, time_t const *, struct tm *));
+SIGNATURE_CHECK (GNULIB_NAMESPACE::mktime_z, time_t, (timezone_t, struct tm *));
+#endif
+
 #if GNULIB_TEST_TIMEGM
 SIGNATURE_CHECK (GNULIB_NAMESPACE::timegm, time_t, (struct tm *));
 #endif
index 0636f42..34ff3be 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <time.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #define GNULIB_NAMESPACE gnulib
 #include <config.h>
index dec2b13..e5a4522 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <time.h> substitute.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -34,6 +34,10 @@ pid_t t2;
    per POSIX 2008.  */
 verify (sizeof NULL == sizeof (void *));
 
+/* Check that TIME_UTC is defined and a positive integer.  */
+int t3 = TIME_UTC;
+verify (TIME_UTC > 0);
+
 int
 main (void)
 {
index 9c7cf0e..25de350 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <unistd.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
 #include "signature.h"
 
 
+#if GNULIB_TEST_ACCESS
+SIGNATURE_CHECK (GNULIB_NAMESPACE::access, int, (const char *, int));
+#endif
+
 #if GNULIB_TEST_CHDIR
 SIGNATURE_CHECK (GNULIB_NAMESPACE::chdir, int, (const char *));
 #endif
@@ -48,6 +52,41 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::dup2, int, (int, int));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::dup3, int, (int, int, int));
 #endif
 
+#if GNULIB_TEST_EXECL
+SIGNATURE_CHECK (GNULIB_NAMESPACE::execl, int,
+                 (const char *, const char *, ...));
+#endif
+
+#if GNULIB_TEST_EXECLE
+SIGNATURE_CHECK (GNULIB_NAMESPACE::execle, int,
+                 (const char *, const char *, ...));
+#endif
+
+#if GNULIB_TEST_EXECLP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::execlp, int,
+                 (const char *, const char *, ...));
+#endif
+
+#if GNULIB_TEST_EXECV
+SIGNATURE_CHECK (GNULIB_NAMESPACE::execv, int,
+                 (const char *, char * const *));
+#endif
+
+#if GNULIB_TEST_EXECVE
+SIGNATURE_CHECK (GNULIB_NAMESPACE::execve, int,
+                 (const char *, char * const *, char * const *));
+#endif
+
+#if GNULIB_TEST_EXECVP
+SIGNATURE_CHECK (GNULIB_NAMESPACE::execvp, int,
+                 (const char *, char * const *));
+#endif
+
+#if GNULIB_TEST_EXECVPE
+SIGNATURE_CHECK (GNULIB_NAMESPACE::execvpe, int,
+                 (const char *, char * const *, char * const *));
+#endif
+
 #if GNULIB_TEST_EUIDACCESS
 SIGNATURE_CHECK (GNULIB_NAMESPACE::euidaccess, int, (const char *, int));
 #endif
@@ -90,6 +129,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::getdomainname, int, (char *, size_t));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::getdtablesize, int, (void));
 #endif
 
+#if GNULIB_TEST_GETENTROPY
+SIGNATURE_CHECK (GNULIB_NAMESPACE::getentropy, int, (void *, size_t));
+#endif
+
 #if GNULIB_TEST_GETGROUPS
 SIGNATURE_CHECK (GNULIB_NAMESPACE::getgroups, int, (int, gid_t *));
 #endif
@@ -110,6 +153,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::getlogin_r, int, (char *, size_t));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::getpagesize, int, (void));
 #endif
 
+#if GNULIB_TEST_GETPASS
+SIGNATURE_CHECK (GNULIB_NAMESPACE::getpass, char *, (const char *));
+#endif
+
 #if GNULIB_TEST_GETUSERSHELL
 SIGNATURE_CHECK (GNULIB_NAMESPACE::getusershell, char *, (void));
 #endif
@@ -126,6 +173,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::endusershell, void, (void));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::group_member, int, (gid_t));
 #endif
 
+#if GNULIB_TEST_ISATTY
+SIGNATURE_CHECK (GNULIB_NAMESPACE::isatty, int, (int));
+#endif
+
 #if GNULIB_TEST_LCHOWN
 SIGNATURE_CHECK (GNULIB_NAMESPACE::lchown, int, (char const *, uid_t, gid_t));
 #endif
@@ -161,6 +212,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::pwrite, ssize_t,
                  (int, const void *, size_t, off_t));
 #endif
 
+#if GNULIB_TEST_READ
+SIGNATURE_CHECK (GNULIB_NAMESPACE::read, ssize_t, (int, void *, size_t));
+#endif
+
 #if GNULIB_TEST_READLINK
 SIGNATURE_CHECK (GNULIB_NAMESPACE::readlink, ssize_t,
                  (const char *, char *, size_t));
@@ -175,6 +230,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::readlinkat, ssize_t,
 SIGNATURE_CHECK (GNULIB_NAMESPACE::rmdir, int, (char const *));
 #endif
 
+#if GNULIB_TEST_SETHOSTNAME
+SIGNATURE_CHECK (GNULIB_NAMESPACE::sethostname, int, (const char *, size_t));
+#endif
+
 #if GNULIB_TEST_SLEEP
 SIGNATURE_CHECK (GNULIB_NAMESPACE::sleep, unsigned int, (unsigned int));
 #endif
@@ -188,6 +247,10 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::symlinkat, int,
                  (char const *, int, char const *));
 #endif
 
+#if GNULIB_TEST_TRUNCATE
+SIGNATURE_CHECK (GNULIB_NAMESPACE::truncate, int, (const char *, off_t));
+#endif
+
 #if GNULIB_TEST_TTYNAME_R
 SIGNATURE_CHECK (GNULIB_NAMESPACE::ttyname_r, int,
                  (int fd, char *buf, size_t buflen));
index 463ef57..ca7422c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <unistd.h> substitute.
-   Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index fe4548d..e61fbbc 100644 (file)
@@ -1,5 +1,5 @@
 /* Tests of unsetenv.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Eric Blake <ebb9@byu.net>, 2009.  */
 
index cd4886a..7813f1e 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Test suite for update-copyright.
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,7 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 diffout=`diff -u /dev/null /dev/null 2>&1`
 if test x"$diffout" = x"" && test $? -eq 0; then
@@ -37,9 +37,23 @@ trap 'rm -f $TMP_BASE*' 0 1 2 3 15
 TMP=$TMP_BASE
 s=$TMP-script
 cat <<\EOF > $s
-eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"'
-  & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
-    if 0;
+#!/bin/sh
+#! -*-perl-*-
+# This is a prologue that allows to run a perl script as an executable
+# on systems that are compliant to a POSIX version before POSIX:2017.
+# On such systems, the usual invocation of an executable through execlp()
+# or execvp() fails with ENOEXEC if it is a script that does not start
+# with a #! line.  The script interpreter mentioned in the #! line has
+# to be /bin/sh, because on GuixSD systems that is the only program that
+# has a fixed file name.  The second line is essential for perl and is
+# also useful for editing this file in Emacs.  The next two lines below
+# are valid code in both sh and perl.  When executed by sh, they re-execute
+# the script through the perl program found in $PATH.  The '-x' option
+# is essential as well; without it, perl would re-execute the script
+# through /bin/sh.  When executed by perl, the next two lines are a no-op.
+eval 'exec perl -wSx -pi "$0" "$@"'
+     if 0;
+
 s/a/b/
 EOF
 chmod a+x $s
index a75c004..9d99743 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of vasnprintf() and asnprintf() functions.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -53,7 +53,34 @@ test_function (char * (*my_asnprintf) (char *, size_t *, const char *, ...))
       ASSERT (result != NULL);
       ASSERT (strcmp (result, "12345") == 0);
       ASSERT (length == 5);
-      if (size < 6)
+      if (size < 5 + 1)
+        ASSERT (result != buf);
+      ASSERT (memcmp (buf + size, &"DEADBEEF"[size], 8 - size) == 0);
+      if (result != buf)
+        free (result);
+    }
+
+  /* Note: This test assumes IEEE 754 representation of 'double' floats.  */
+  for (size = 0; size <= 8; size++)
+    {
+      size_t length;
+      char *result;
+
+      memcpy (buf, "DEADBEEF", 8);
+      length = size;
+      result = my_asnprintf (buf, &length, "%2.0f", 1.6314159265358979e+125);
+      ASSERT (result != NULL);
+      /* The exact result and the result on glibc systems is
+         163141592653589790215729350939528493057529598899734151772468186268423257777068536614838678161083520756952076273094236944990208
+         On Cygwin, the result is
+         163141592653589790215729350939528493057529600000000000000000000000000000000000000000000000000000000000000000000000000000000000
+         On HP-UX 11.31 / hppa and IRIX 6.5, the result is
+         163141592653589790000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+       */
+      ASSERT (strlen (result) == 126);
+      ASSERT (memcmp (result, "163141592653589790", 18) == 0);
+      ASSERT (length == 126);
+      if (size < 126 + 1)
         ASSERT (result != buf);
       ASSERT (memcmp (buf + size, &"DEADBEEF"[size], 8 - size) == 0);
       if (result != buf)
index 9a8d452..cc1db93 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of POSIX compatible vasprintf() and asprintf() functions.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
@@ -444,7 +444,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
       my_asprintf (&result, "%010a %d", Infinityd (), 33, 44, 55);
     ASSERT (result != NULL);
     /* "0000000inf 33" is not a valid result; see
-       <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
+       <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
     ASSERT (strcmp (result, "       inf 33") == 0);
     ASSERT (retval == strlen (result));
     free (result);
@@ -456,7 +456,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
       my_asprintf (&result, "%050a %d", NaNd (), 33, 44, 55);
     ASSERT (result != NULL);
     /* "0000000nan 33" is not a valid result; see
-       <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
+       <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
     ASSERT (strlen (result) == 50 + 3
             && strisnan (result, strspn (result, " "), strlen (result) - 3, 0)
             && strcmp (result + strlen (result) - 3, " 33") == 0);
@@ -708,7 +708,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
 
   { /* Rounding can turn a ...FFF into a ...000.
        This shows a Mac OS X 10.3.9 (Darwin 7.9) bug and a
-       glibc 2.4 bug <http://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
+       glibc 2.4 bug <https://sourceware.org/bugzilla/show_bug.cgi?id=2908>.  */
     char *result;
     int retval =
       my_asprintf (&result, "%.1La %d", 1.999L, 33, 44, 55);
@@ -844,7 +844,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
       my_asprintf (&result, "%010La %d", Infinityl (), 33, 44, 55);
     ASSERT (result != NULL);
     /* "0000000inf 33" is not a valid result; see
-       <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
+       <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
     ASSERT (strcmp (result, "       inf 33") == 0);
     ASSERT (retval == strlen (result));
     free (result);
@@ -856,7 +856,7 @@ test_function (int (*my_asprintf) (char **, const char *, ...))
       my_asprintf (&result, "%050La %d", NaNl (), 33, 44, 55);
     ASSERT (result != NULL);
     /* "0000000nan 33" is not a valid result; see
-       <http://lists.gnu.org/archive/html/bug-gnulib/2007-04/msg00107.html> */
+       <https://lists.gnu.org/r/bug-gnulib/2007-04/msg00107.html> */
     ASSERT (strlen (result) == 50 + 3
             && strisnan (result, strspn (result, " "), strlen (result) - 3, 0)
             && strcmp (result + strlen (result) - 3, " 33") == 0);
index ebcbfc4..cbebce7 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of vasprintf() and asprintf() functions.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 6262944..3a7e1c5 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for vc-list-files
-# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 : ${srcdir=.}
-. "$srcdir/init.sh"; path_prepend_ "$abs_aux_dir" .
+. "$srcdir/init.sh"; path_prepend_ .
 
 tmpdir=vc-cvs
 repo=`pwd`/$tmpdir/repo
@@ -44,7 +44,7 @@ for i in with-cvsu without; do
     cvs -Q -d "$repo" import -m imp m M M0 &&
     cvs -Q -d "$repo" co m && cd m &&
     printf '%s\n' b c d/a > expected &&
-    vc-list-files | sort > actual &&
+    $BOURNE_SHELL "$abs_aux_dir/vc-list-files" | sort > actual &&
     compare expected actual &&
     ok=1
   test $ok = 0 && fail=1
index 4358115..3359ffb 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Unit tests for vc-list-files
-# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+# Copyright (C) 2008-2021 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 : ${srcdir=.}
-. "$srcdir/init.sh"; path_prepend_ "$abs_aux_dir" .
+. "$srcdir/init.sh"; path_prepend_ .
 
 tmpdir=vc-git-$$
 GIT_DIR= GIT_WORK_TREE=; unset GIT_DIR GIT_WORK_TREE
@@ -35,7 +35,7 @@ mkdir $tmpdir && cd $tmpdir &&
   git add . > /dev/null &&
   git commit -q -a -m log &&
   printf '%s\n' b c d/a > expected &&
-  vc-list-files > actual &&
+  $BOURNE_SHELL "$abs_aux_dir/vc-list-files" > actual &&
   compare expected actual &&
   fail=0
 
diff --git a/tests/test-verify-try.c b/tests/test-verify-try.c
new file mode 100644 (file)
index 0000000..e97ea2a
--- /dev/null
@@ -0,0 +1,21 @@
+/* Test the "verify" module.
+
+   Copyright (C) 2017-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* This is a separate source file, so that the execution of test-verify.sh
+   does not interfere with the building of the 'test-verify' program.  */
+
+#include "test-verify.c"
index d7ca053..65b926a 100644 (file)
@@ -1,6 +1,6 @@
 /* Test the "verify" module.
 
-   Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible.  */
 
 # define EXP_FAIL 0
 #endif
 
-int x;
-enum { a, b, c };
+/* ======================= Test verify, verify_expr ======================= */
+
+int gx;
+enum { A, B, C };
 
 #if EXP_FAIL == 1
-verify (x >= 0);                  /* should give ERROR: non-constant expression */
+verify (gx >= 0);                 /* should give ERROR: non-constant expression */
 #endif
-verify (c == 2);                  /* should be ok */
+verify (C == 2);                  /* should be ok */
 #if EXP_FAIL == 2
 verify (1 + 1 == 3);              /* should give ERROR */
 #endif
@@ -39,7 +41,7 @@ verify (1 == 1); verify (1 == 1); /* should be ok */
 
 enum
 {
-  item = verify_true (1 == 1) * 0 + 17 /* should be ok */
+  item = verify_expr (1 == 1, 10 * 0 + 17) /* should be ok */
 };
 
 static int
@@ -48,7 +50,7 @@ function (int n)
 #if EXP_FAIL == 3
   verify (n >= 0);                  /* should give ERROR: non-constant expression */
 #endif
-  verify (c == 2);                  /* should be ok */
+  verify (C == 2);                  /* should be ok */
 #if EXP_FAIL == 4
   verify (1 + 1 == 3);              /* should give ERROR */
 #endif
@@ -62,8 +64,56 @@ function (int n)
   return 0;
 }
 
+/* ============================== Test assume ============================== */
+
+static int
+f (int a)
+{
+  return a;
+}
+
+typedef struct { unsigned int context : 4; unsigned int halt : 1; } state;
+
+void test_assume_expressions (state *s);
+int test_assume_optimization (int x);
+_Noreturn void test_assume_noreturn (void);
+
+void
+test_assume_expressions (state *s)
+{
+  /* Check that 'assume' accepts a function call, even of a non-const
+     function.  */
+  assume (f (1));
+  /* Check that 'assume' accepts a bit-field expression.  */
+  assume (s->halt);
+}
+
+int
+test_assume_optimization (int x)
+{
+  /* Check that the compiler uses 'assume' for optimization.
+     This function, when compiled with optimization, should have code
+     equivalent to
+       return x + 3;
+     Use 'objdump --disassemble test-verify.o' to verify this.  */
+  assume (x >= 4);
+  return (x > 1 ? x + 3 : 2 * x + 10);
+}
+
+_Noreturn void
+test_assume_noreturn (void)
+{
+  /* Check that the compiler's data-flow analysis recognizes 'assume (0)'.
+     This function should not elicit a warning.  */
+  assume (0);
+}
+
+/* ============================== Main ===================================== */
 int
 main (void)
 {
+  state s = { 0, 1 };
+  test_assume_expressions (&s);
+  test_assume_optimization (5);
   return !(function (0) == 0 && function (1) == 8);
 }
index 3e76761..1e75d55 100755 (executable)
@@ -7,8 +7,9 @@ unset MALLOC_PERTURB_
 
 # Rather than figure out how to invoke the compiler with the right
 # include path ourselves, we let make do it:
-(cd "$initial_cwd_" && rm -f test-verify.o \
-    && $MAKE test-verify.o >/dev/null 2>&1) \
+(cd "$initial_cwd_" \
+ && rm -f test-verify-try.o \
+ && $MAKE test-verify-try.o >/dev/null 2>&1) \
   || skip_ "cannot compile error-free"
 
 # Now, prove that we encounter all expected compilation failures:
@@ -16,8 +17,8 @@ unset MALLOC_PERTURB_
 : >err
 for i in 1 2 3 4 5; do
   (cd "$initial_cwd_"
-   rm -f test-verify.o
-   $MAKE CFLAGS=-DEXP_FAIL=$i test-verify.o) >>out 2>>err \
+   rm -f test-verify-try.o
+   $MAKE CFLAGS=-DEXP_FAIL=$i test-verify-try.o) >>out 2>>err \
   && { warn_ "compiler didn't detect verification failure $i"; fail=1; }
 done
 
index 66404a3..a098556 100644 (file)
@@ -1,5 +1,5 @@
 /* Test suite for version-etc.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
    This file is part of the GNUlib Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index 1706aef..20b9e9b 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Test suite for version-etc.
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
@@ -14,7 +14,9 @@
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/init.sh"; path_prepend_ .
 
 TMP=ve-expected.tmp
 LC_ALL=C
@@ -24,19 +26,19 @@ ERR=0
 cat > $TMP <<EOT
 test-version-etc (PROJECT) VERSION
 COPYRIGHT Free Software Foundation, Inc.
-License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
+License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 
 Written by Sergey Poznyakoff and Eric Blake.
 EOT
 
-./test-version-etc${EXEEXT} --version |
+${CHECKER} test-version-etc${EXEEXT} --version |
  sed '1s/test-version-etc (.*) .*/test-version-etc (PROJECT) VERSION/
       /^Packaged by/d
       2,3 s/Copyright (C) [0-9]\{4,4\}/COPYRIGHT/' |
  tr -d '\015' |
diff -c $TMP - || ERR=1
compare $TMP - || ERR=1
 
 rm $TMP
 
index 9c730f8..5c42a5c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <wchar.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
@@ -95,6 +95,11 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::wmemmove, wchar_t *,
                  (wchar_t *, const wchar_t *, size_t));
 #endif
 
+#if GNULIB_TEST_WMEMPCPY
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wmempcpy, wchar_t *,
+                 (wchar_t *, const wchar_t *, size_t));
+#endif
+
 #if GNULIB_TEST_WMEMSET
 SIGNATURE_CHECK (GNULIB_NAMESPACE::wmemset, wchar_t *,
                  (wchar_t *, wchar_t, size_t));
@@ -211,6 +216,11 @@ SIGNATURE_CHECK (GNULIB_NAMESPACE::wcstok, wchar_t *,
 SIGNATURE_CHECK (GNULIB_NAMESPACE::wcswidth, int, (const wchar_t *, size_t));
 #endif
 
+#if GNULIB_TEST_WCSFTIME
+SIGNATURE_CHECK (GNULIB_NAMESPACE::wcsftime, size_t,
+                 (wchar_t *, size_t, const wchar_t *, const struct tm *));
+#endif
+
 
 int
 main ()
diff --git a/tests/test-wchar-c++2.cc b/tests/test-wchar-c++2.cc
new file mode 100644 (file)
index 0000000..17b6e28
--- /dev/null
@@ -0,0 +1,20 @@
+/* Test of <wchar.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cwchar>
diff --git a/tests/test-wchar-c++3.cc b/tests/test-wchar-c++3.cc
new file mode 100644 (file)
index 0000000..877f14c
--- /dev/null
@@ -0,0 +1,22 @@
+/* Test of <wchar.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <wchar.h>
+#include <cstring>
+#include <sstream>
index e118048..65c685c 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <wchar.h> substitute.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
index 50c82f5..b01c543 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Test a CP1252 locale.
-./test-wcrtomb-w32${EXEEXT} French_France 1252
+${CHECKER} ./test-wcrtomb-w32${EXEEXT} French_France 1252
index 783c70c..5481634 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Test a CP1256 locale.
-./test-wcrtomb-w32${EXEEXT} "Arabic_Saudi Arabia" 1256
+${CHECKER} ./test-wcrtomb-w32${EXEEXT} "Arabic_Saudi Arabia" 1256
index 619ea64..f35879d 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Test a CP932 locale.
-./test-wcrtomb-w32${EXEEXT} Japanese_Japan 932
+${CHECKER} ./test-wcrtomb-w32${EXEEXT} Japanese_Japan 932
index 67b6803..8eec6cb 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Test a CP950 locale.
-./test-wcrtomb-w32${EXEEXT} Chinese_Taiwan 950
+${CHECKER} ./test-wcrtomb-w32${EXEEXT} Chinese_Taiwan 950
index 9841fa9..fd47d6f 100755 (executable)
@@ -1,4 +1,4 @@
 #!/bin/sh
 
 # Test a CP936 locale.
-./test-wcrtomb-w32${EXEEXT} Chinese_China 936
+${CHECKER} ./test-wcrtomb-w32${EXEEXT} Chinese_China 936
diff --git a/tests/test-wcrtomb-w32-6.sh b/tests/test-wcrtomb-w32-6.sh
new file mode 100755 (executable)
index 0000000..802237d
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test a GB18030 locale.
+${CHECKER} ./test-wcrtomb-w32${EXEEXT} Chinese_China 54936
diff --git a/tests/test-wcrtomb-w32-7.sh b/tests/test-wcrtomb-w32-7.sh
new file mode 100755 (executable)
index 0000000..fb04e58
--- /dev/null
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# Test some UTF-8 locales.
+${CHECKER} ./test-wcrtomb-w32${EXEEXT} French_France Japanese_Japan Chinese_Taiwan Chinese_China 65001
index 0570c73..b354260 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of wide character to multibyte character.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
 #include <stdlib.h>
 #include <string.h>
 
+#include "localcharset.h"
 #include "macros.h"
 
-#if (defined _WIN32 || defined __WIN32__) && !defined __CYGWIN__
+#if defined _WIN32 && !defined __CYGWIN__
 
 static int
 test_one_locale (const char *name, int codepage)
@@ -257,6 +258,8 @@ test_one_locale (const char *name, int codepage)
 
     case 54936:
       /* Locale encoding is CP54936 = GB18030.  */
+      if (strcmp (locale_charset (), "GB18030") != 0)
+        return 77;
       {
         /* Convert "B\250\271\201\060\211\070er": "Büßer" */
         memset (buf, 'x', 8);
@@ -275,6 +278,8 @@ test_one_locale (const char *name, int codepage)
 
     case 65001:
       /* Locale encoding is CP65001 = UTF-8.  */
+      if (strcmp (locale_charset (), "UTF-8") != 0)
+        return 77;
       {
         /* Convert "B\303\274\303\237er": "Büßer" */
         memset (buf, 'x', 8);
index e1d2bb4..74f2d1d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of conversion of wide character to multibyte character.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
 
@@ -156,6 +156,10 @@ main (int argc, char *argv[])
           check_character (input + 3, 4);
         }
         return 0;
+
+      case '5':
+        /* C locale; tested above.  */
+        return 0;
       }
 
   return 1;
index 3eda8f3..1a31b6e 100755 (executable)
@@ -4,7 +4,7 @@
 : ${LOCALE_FR=fr_FR}
 if test $LOCALE_FR != none; then
   LC_ALL=$LOCALE_FR \
-  ./test-wcrtomb${EXEEXT} 1 \
+  ${CHECKER} ./test-wcrtomb${EXEEXT} 1 \
   || exit 1
 fi
 
@@ -12,7 +12,7 @@ fi
 : ${LOCALE_FR_UTF8=fr_FR.UTF-8}
 if test $LOCALE_FR_UTF8 != none; then
   LC_ALL=$LOCALE_FR_UTF8 \
-  ./test-wcrtomb${EXEEXT} 2 \
+  ${CHECKER} ./test-wcrtomb${EXEEXT} 2 \
   || exit 1
 fi
 
@@ -20,7 +20,7 @@ fi
 : ${LOCALE_JA=ja_JP}
 if test $LOCALE_JA != none; then
   LC_ALL=$LOCALE_JA \
-  ./test-wcrtomb${EXEEXT} 3 \
+  ${CHECKER} ./test-wcrtomb${EXEEXT} 3 \
   || exit 1
 fi
 
@@ -28,8 +28,12 @@ fi
 : ${LOCALE_ZH_CN=zh_CN.GB18030}
 if test $LOCALE_ZH_CN != none; then
   LC_ALL=$LOCALE_ZH_CN \
-  ./test-wcrtomb${EXEEXT} 4 \
+  ${CHECKER} ./test-wcrtomb${EXEEXT} 4 \
   || exit 1
 fi
 
+# Test in the POSIX locale.
+LC_ALL=C     ${CHECKER} ./test-wcrtomb${EXEEXT} 5 || exit 1
+LC_ALL=POSIX ${CHECKER} ./test-wcrtomb${EXEEXT} 5 || exit 1
+
 exit 0
index 6c5ca8f..12f6e60 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <wctype.h> substitute in C++ mode.
-   Copyright (C) 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
 
 
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswalnum, int, (wint_t));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswalpha, int, (wint_t));
-#if GNULIB_TEST_ISWBLANK
-SIGNATURE_CHECK (GNULIB_NAMESPACE::iswblank, int, (wint_t));
-#endif
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswcntrl, int, (wint_t));
+#if GNULIB_TEST_ISWDIGIT
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswdigit, int, (wint_t));
+#endif
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswgraph, int, (wint_t));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswlower, int, (wint_t));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswprint, int, (wint_t));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswpunct, int, (wint_t));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswspace, int, (wint_t));
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswupper, int, (wint_t));
+#if GNULIB_TEST_ISWXDIGIT
 SIGNATURE_CHECK (GNULIB_NAMESPACE::iswxdigit, int, (wint_t));
+#endif
+#if GNULIB_TEST_ISWBLANK
+SIGNATURE_CHECK (GNULIB_NAMESPACE::iswblank, int, (wint_t));
+#endif
 
 #if GNULIB_TEST_WCTYPE
 SIGNATURE_CHECK (GNULIB_NAMESPACE::wctype, wctype_t, (const char *));
diff --git a/tests/test-wctype-h-c++2.cc b/tests/test-wctype-h-c++2.cc
new file mode 100644 (file)
index 0000000..e3d7243
--- /dev/null
@@ -0,0 +1,20 @@
+/* Test of <wctype.h> substitute in C++ mode.
+   Copyright (C) 2019-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#define GNULIB_NAMESPACE gnulib
+#include <config.h>
+
+#include <cwctype>
index b401091..f96c73d 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of <wctype.h> substitute.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
diff --git a/tests/test-wcwidth.c b/tests/test-wcwidth.c
new file mode 100644 (file)
index 0000000..e5e3a54
--- /dev/null
@@ -0,0 +1,106 @@
+/* Test of wcwidth() function.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include <wchar.h>
+
+#include "signature.h"
+SIGNATURE_CHECK (wcwidth, int, (wchar_t));
+
+#include <locale.h>
+#include <string.h>
+
+#include "c-ctype.h"
+#include "localcharset.h"
+#include "macros.h"
+
+int
+main ()
+{
+  wchar_t wc;
+
+#if !GNULIB_WCHAR_SINGLE_LOCALE
+# ifdef C_CTYPE_ASCII
+  /* Test width of ASCII characters.  */
+  for (wc = 0x20; wc < 0x7F; wc++)
+    ASSERT (wcwidth (wc) == 1);
+# endif
+#endif
+
+  /* Switch to an UTF-8 locale.  */
+  if (setlocale (LC_ALL, "fr_FR.UTF-8") != NULL
+      /* Check whether it's really an UTF-8 locale.
+         On OpenBSD 4.0, the setlocale call succeeds only for the LC_CTYPE
+         category and therefore returns "C/fr_FR.UTF-8/C/C/C/C", but the
+         LC_CTYPE category is effectively set to an ASCII LC_CTYPE category;
+         in particular, locale_charset() returns "ASCII".  */
+      && strcmp (locale_charset (), "UTF-8") == 0)
+    {
+      /* Test width of ASCII characters.  */
+      for (wc = 0x20; wc < 0x7F; wc++)
+        ASSERT (wcwidth (wc) == 1);
+
+      /* Test width of some non-spacing characters.  */
+      ASSERT (wcwidth (0x0301) == 0);
+      ASSERT (wcwidth (0x05B0) == 0);
+
+      /* Test width of some format control characters.  */
+      ASSERT (wcwidth (0x200E) <= 0);
+      ASSERT (wcwidth (0x2060) <= 0);
+#if 0  /* wchar_t may be only 16 bits.  */
+      ASSERT (wcwidth (0xE0001) <= 0);
+      ASSERT (wcwidth (0xE0044) <= 0);
+#endif
+
+      /* Test width of some zero width characters.  */
+      /* While it is desirable that U+200B, U+200C, U+200D have width 0,
+         because this makes wcswidth work better on strings that contain these
+         characters, it is acceptable if an implementation treats these
+         characters like control characters.  */
+      ASSERT (wcwidth (0x200B) <= 0);
+      ASSERT (wcwidth (0xFEFF) <= 0);
+
+      /* Test width of some math symbols.
+         U+2202 is marked as having ambiguous width (A) in EastAsianWidth.txt
+         (see <https://www.unicode.org/Public/12.0.0/ucd/EastAsianWidth.txt>).
+         The Unicode Standard Annex 11
+         <https://www.unicode.org/reports/tr11/tr11-36.html>
+         says
+           "Ambiguous characters behave like wide or narrow characters
+            depending on the context (language tag, script identification,
+            associated font, source of data, or explicit markup; all can
+            provide the context). If the context cannot be established
+            reliably, they should be treated as narrow characters by default."
+         For wcwidth(), the only available context information is the locale.
+         "fr_FR.UTF-8" is a Western locale, not an East Asian locale, therefore
+         U+2202 should be treated like a narrow character.  */
+      ASSERT (wcwidth (0x2202) == 1);
+
+      /* Test width of some CJK characters.  */
+      ASSERT (wcwidth (0x3000) == 2);
+      ASSERT (wcwidth (0xB250) == 2);
+      ASSERT (wcwidth (0xFF1A) == 2);
+#if 0  /* wchar_t may be only 16 bits.  */
+      ASSERT (wcwidth (0x20369) == 2);
+      ASSERT (wcwidth (0x2F876) == 2);
+#endif
+    }
+
+  return 0;
+}
index a9e6331..4911153 100644 (file)
@@ -1,5 +1,5 @@
 /* Test the write() function.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index f681ca5..3da598b 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of xalloc_die() function.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Simon Josefsson <simon@josefsson.org>, 2009.  */
 
index fba601f..b88d959 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Test suite for xalloc_die.
-# Copyright (C) 2009-2016 Free Software Foundation, Inc.
+# Copyright (C) 2009-2021 Free Software Foundation, Inc.
 # This file is part of the GNUlib Library.
 #
 # This program is free software: you can redistribute it and/or modify
 # GNU General Public License for more details.
 #
 # You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+# along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 . "${srcdir=.}/init.sh"; path_prepend_ .
 
-test-xalloc-die${EXEEXT} > out 2> err
+${CHECKER} test-xalloc-die${EXEEXT} > out 2> err
 case $? in
   1) ;;
   *) Exit 1;;
index 14d7efa..b637444 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of xvasprintf() and xasprintf() functions.
-   Copyright (C) 2007-2016 Free Software Foundation, Inc.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
 
diff --git a/tests/uinttostr.c b/tests/uinttostr.c
new file mode 100644 (file)
index 0000000..48fd98f
--- /dev/null
@@ -0,0 +1,3 @@
+#define anytostr uinttostr
+#define inttype unsigned int
+#include "anytostr.c"
diff --git a/tests/umaxtostr.c b/tests/umaxtostr.c
new file mode 100644 (file)
index 0000000..f95bfc3
--- /dev/null
@@ -0,0 +1,3 @@
+#define anytostr umaxtostr
+#define inttype uintmax_t
+#include "anytostr.c"
diff --git a/tests/unistr/test-u8-mbtoucr.c b/tests/unistr/test-u8-mbtoucr.c
new file mode 100644 (file)
index 0000000..680014b
--- /dev/null
@@ -0,0 +1,187 @@
+/* Test of u8_mbtoucr() function.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+
+#include <config.h>
+
+#include "unistr.h"
+
+#include "macros.h"
+
+int
+main ()
+{
+  ucs4_t uc;
+  int ret;
+
+  /* Test NUL unit input.  */
+  {
+    static const uint8_t input[] = "";
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 1);
+    ASSERT (ret == 1);
+    ASSERT (uc == 0);
+  }
+
+  /* Test ISO 646 unit input.  */
+  {
+    ucs4_t c;
+    uint8_t buf[1];
+
+    for (c = 0; c < 0x80; c++)
+      {
+        buf[0] = c;
+        uc = 0xBADFACE;
+        ret = u8_mbtoucr (&uc, buf, 1);
+        ASSERT (ret == 1);
+        ASSERT (uc == c);
+      }
+  }
+
+  /* Test 2-byte character input.  */
+  {
+    static const uint8_t input[] = { 0xC3, 0x97 };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 2);
+    ASSERT (ret == 2);
+    ASSERT (uc == 0x00D7);
+  }
+
+  /* Test 3-byte character input.  */
+  {
+    static const uint8_t input[] = { 0xE2, 0x82, 0xAC };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 3);
+    ASSERT (ret == 3);
+    ASSERT (uc == 0x20AC);
+  }
+
+  /* Test 4-byte character input.  */
+  {
+    static const uint8_t input[] = { 0xF4, 0x8F, 0xBF, 0xBD };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 4);
+    ASSERT (ret == 4);
+    ASSERT (uc == 0x10FFFD);
+  }
+
+  /* Test incomplete/invalid 1-byte input.  */
+  {
+    static const uint8_t input[] = { 0xC1 };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 1);
+    ASSERT (ret == -1);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xC3 };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 1);
+    ASSERT (ret == -2);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xE2 };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 1);
+    ASSERT (ret == -2);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xF4 };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 1);
+    ASSERT (ret == -2);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xFE };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 1);
+    ASSERT (ret == -1);
+    ASSERT (uc == 0xFFFD);
+  }
+
+  /* Test incomplete/invalid 2-byte input.  */
+  {
+    static const uint8_t input[] = { 0xE0, 0x9F };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 2);
+    ASSERT (ret == -1);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xE2, 0x82 };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 2);
+    ASSERT (ret == -2);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xE2, 0xD0 };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 2);
+    ASSERT (ret == -1);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xF0, 0x8F };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 2);
+    ASSERT (ret == -1);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xF3, 0x8F };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 2);
+    ASSERT (ret == -2);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xF3, 0xD0 };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 2);
+    ASSERT (ret == -1);
+    ASSERT (uc == 0xFFFD);
+  }
+
+  /* Test incomplete/invalid 3-byte input.  */
+  {
+    static const uint8_t input[] = { 0xF3, 0x8F, 0xBF };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 3);
+    ASSERT (ret == -2);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xF3, 0xD0, 0xBF };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 3);
+    ASSERT (ret == -1);
+    ASSERT (uc == 0xFFFD);
+  }
+  {
+    static const uint8_t input[] = { 0xF3, 0x8F, 0xD0 };
+    uc = 0xBADFACE;
+    ret = u8_mbtoucr (&uc, input, 3);
+    ASSERT (ret == -1);
+    ASSERT (uc == 0xFFFD);
+  }
+
+  return 0;
+}
diff --git a/tests/unistr/test-u8-uctomb.c b/tests/unistr/test-u8-uctomb.c
new file mode 100644 (file)
index 0000000..ed8b077
--- /dev/null
@@ -0,0 +1,157 @@
+/* Test of u8_uctomb() function.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2010.  */
+
+#include <config.h>
+
+#include "unistr.h"
+
+#include "macros.h"
+
+#define MAGIC 0xBA
+
+int
+main ()
+{
+  /* Test ISO 646 character, in particular the NUL character.  */
+  {
+    ucs4_t uc;
+
+    for (uc = 0; uc < 0x80; uc++)
+      {
+        uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC };
+        int ret;
+
+        ret = u8_uctomb (buf, uc, 0);
+        ASSERT (ret == -2);
+        ASSERT (buf[0] == MAGIC);
+
+        ret = u8_uctomb (buf, uc, 1);
+        ASSERT (ret == 1);
+        ASSERT (buf[0] == uc);
+        ASSERT (buf[1] == MAGIC);
+      }
+  }
+
+  /* Test 2-byte character.  */
+  {
+    ucs4_t uc = 0x00D7;
+    uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC };
+    int ret;
+
+    ret = u8_uctomb (buf, uc, 0);
+    ASSERT (ret == -2);
+    ASSERT (buf[0] == MAGIC);
+
+    ret = u8_uctomb (buf, uc, 1);
+    ASSERT (ret == -2);
+    ASSERT (buf[0] == MAGIC);
+
+    ret = u8_uctomb (buf, uc, 2);
+    ASSERT (ret == 2);
+    ASSERT (buf[0] == 0xC3);
+    ASSERT (buf[1] == 0x97);
+    ASSERT (buf[2] == MAGIC);
+  }
+
+  /* Test 3-byte character.  */
+  {
+    ucs4_t uc = 0x20AC;
+    uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC };
+    int ret;
+
+    ret = u8_uctomb (buf, uc, 0);
+    ASSERT (ret == -2);
+    ASSERT (buf[0] == MAGIC);
+
+    ret = u8_uctomb (buf, uc, 1);
+    ASSERT (ret == -2);
+    ASSERT (buf[0] == MAGIC);
+
+    ret = u8_uctomb (buf, uc, 2);
+    ASSERT (ret == -2);
+    ASSERT (buf[0] == MAGIC);
+    ASSERT (buf[1] == MAGIC);
+
+    ret = u8_uctomb (buf, uc, 3);
+    ASSERT (ret == 3);
+    ASSERT (buf[0] == 0xE2);
+    ASSERT (buf[1] == 0x82);
+    ASSERT (buf[2] == 0xAC);
+    ASSERT (buf[3] == MAGIC);
+  }
+
+  /* Test 4-byte character.  */
+  {
+    ucs4_t uc = 0x10FFFD;
+    uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC };
+    int ret;
+
+    ret = u8_uctomb (buf, uc, 0);
+    ASSERT (ret == -2);
+    ASSERT (buf[0] == MAGIC);
+
+    ret = u8_uctomb (buf, uc, 1);
+    ASSERT (ret == -2);
+    ASSERT (buf[0] == MAGIC);
+
+    ret = u8_uctomb (buf, uc, 2);
+    ASSERT (ret == -2);
+    ASSERT (buf[0] == MAGIC);
+    ASSERT (buf[1] == MAGIC);
+
+    ret = u8_uctomb (buf, uc, 3);
+    ASSERT (ret == -2);
+    ASSERT (buf[0] == MAGIC);
+    ASSERT (buf[1] == MAGIC);
+    ASSERT (buf[2] == MAGIC);
+
+    ret = u8_uctomb (buf, uc, 4);
+    ASSERT (ret == 4);
+    ASSERT (buf[0] == 0xF4);
+    ASSERT (buf[1] == 0x8F);
+    ASSERT (buf[2] == 0xBF);
+    ASSERT (buf[3] == 0xBD);
+    ASSERT (buf[4] == MAGIC);
+  }
+
+  /* Test invalid characters.  */
+  {
+    ucs4_t invalid[] = { 0x110000, 0xD800, 0xDBFF, 0xDC00, 0xDFFF };
+    uint8_t buf[5] = { MAGIC, MAGIC, MAGIC, MAGIC, MAGIC };
+    size_t i;
+
+    for (i = 0; i < SIZEOF (invalid); i++)
+      {
+        ucs4_t uc = invalid[i];
+        int n;
+
+        for (n = 0; n <= 4; n++)
+          {
+            int ret = u8_uctomb (buf, uc, n);
+            ASSERT (ret == -1);
+            ASSERT (buf[0] == MAGIC);
+            ASSERT (buf[1] == MAGIC);
+            ASSERT (buf[2] == MAGIC);
+            ASSERT (buf[3] == MAGIC);
+            ASSERT (buf[4] == MAGIC);
+          }
+      }
+  }
+
+  return 0;
+}
diff --git a/tests/uniwidth/test-uc_width.c b/tests/uniwidth/test-uc_width.c
new file mode 100644 (file)
index 0000000..c957d3c
--- /dev/null
@@ -0,0 +1,56 @@
+/* Test of uc_width() function.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
+
+#include <config.h>
+
+#include "uniwidth.h"
+
+#include "macros.h"
+
+int
+main ()
+{
+  ucs4_t uc;
+
+  /* Test width of ASCII characters.  */
+  for (uc = 0x0020; uc < 0x007F; uc++)
+    ASSERT (uc_width (uc, "ISO-8859-2") == 1);
+
+  /* Test width of some non-spacing characters.  */
+  ASSERT (uc_width (0x0301, "UTF-8") == 0);
+  ASSERT (uc_width (0x05B0, "UTF-8") == 0);
+
+  /* Test width of some format control characters.  */
+  ASSERT (uc_width (0x200E, "UTF-8") == 0);
+  ASSERT (uc_width (0x2060, "UTF-8") == 0);
+  ASSERT (uc_width (0xE0001, "UTF-8") == 0);
+  ASSERT (uc_width (0xE0044, "UTF-8") == 0);
+
+  /* Test width of some zero width characters.  */
+  ASSERT (uc_width (0x200B, "UTF-8") == 0);
+  ASSERT (uc_width (0xFEFF, "UTF-8") == 0);
+
+  /* Test width of some CJK characters.  */
+  ASSERT (uc_width (0x3000, "UTF-8") == 2);
+  ASSERT (uc_width (0xB250, "UTF-8") == 2);
+  ASSERT (uc_width (0xFF1A, "UTF-8") == 2);
+  ASSERT (uc_width (0x20369, "UTF-8") == 2);
+  ASSERT (uc_width (0x2F876, "UTF-8") == 2);
+
+  return 0;
+}
diff --git a/tests/uniwidth/test-uc_width2.c b/tests/uniwidth/test-uc_width2.c
new file mode 100644 (file)
index 0000000..2a68670
--- /dev/null
@@ -0,0 +1,86 @@
+/* Test of uc_width() function.
+   Copyright (C) 2007-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2008.  */
+
+#include <config.h>
+
+#include "uniwidth.h"
+
+#include <stdio.h>
+
+#include "macros.h"
+
+/* One of 0, '0', '1', 'A', '2'.  */
+static char current_width;
+/* The interval for which the current_width holds.  */
+static ucs4_t current_start;
+static ucs4_t current_end;
+
+static void
+finish_interval (void)
+{
+  if (current_width != 0)
+    {
+      if (current_start == current_end)
+        printf ("%04X\t\t%c\n", (unsigned) current_start, current_width);
+      else
+        printf ("%04X..%04X\t%c\n", (unsigned) current_start,
+                (unsigned) current_end, current_width);
+      current_width = 0;
+    }
+}
+
+static void
+add_to_interval (ucs4_t uc, char width)
+{
+  if (current_width == width && uc == current_end + 1)
+    current_end = uc;
+  else
+    {
+      finish_interval ();
+      current_width = width;
+      current_start = current_end = uc;
+    }
+}
+
+int
+main ()
+{
+  ucs4_t uc;
+
+  for (uc = 0; uc < 0x110000; uc++)
+    {
+      int w1 = uc_width (uc, "UTF-8");
+      int w2 = uc_width (uc, "GBK");
+      char width =
+        (w1 == 0 && w2 == 0 ? '0' :
+         w1 == 1 && w2 == 1 ? '1' :
+         w1 == 1 && w2 == 2 ? 'A' :
+         w1 == 2 && w2 == 2 ? '2' :
+         0);
+      if (width == 0)
+        {
+          /* uc must be a control character.  */
+          ASSERT (w1 < 0 && w2 < 0);
+        }
+      else
+        add_to_interval (uc, width);
+    }
+  finish_interval ();
+
+  return 0;
+}
diff --git a/tests/uniwidth/test-uc_width2.sh b/tests/uniwidth/test-uc_width2.sh
new file mode 100755 (executable)
index 0000000..23866c9
--- /dev/null
@@ -0,0 +1,631 @@
+#!/bin/sh
+
+tmpfiles=""
+trap 'rm -fr $tmpfiles' 1 2 3 15
+
+tmpfiles="$tmpfiles uc_width.out"
+${CHECKER} ./test-uc_width2${EXEEXT} | LC_ALL=C tr -d '\r' > uc_width.out
+
+tmpfiles="$tmpfiles uc_width.ok"
+cat > uc_width.ok <<\EOF
+0000           0
+0020..007E     1
+00A0           1
+00A1..00AC     A
+00AD           0
+00AE..02FF     A
+0300..036F     0
+0370..0482     A
+0483..0489     0
+048A..0590     A
+0591..05BD     0
+05BE           A
+05BF           0
+05C0           A
+05C1..05C2     0
+05C3           A
+05C4..05C5     0
+05C6           A
+05C7           0
+05C8..05FF     A
+0600..0605     0
+0606..060F     A
+0610..061A     0
+061B           A
+061C           0
+061D..064A     A
+064B..065F     0
+0660..066F     A
+0670           0
+0671..06D5     A
+06D6..06DD     0
+06DE           A
+06DF..06E4     0
+06E5..06E6     A
+06E7..06E8     0
+06E9           A
+06EA..06ED     0
+06EE..070E     A
+070F           0
+0710           A
+0711           0
+0712..072F     A
+0730..074A     0
+074B..07A5     A
+07A6..07B0     0
+07B1..07EA     A
+07EB..07F3     0
+07F4..0815     A
+0816..0819     0
+081A           A
+081B..0823     0
+0824           A
+0825..0827     0
+0828           A
+0829..082D     0
+082E..0858     A
+0859..085B     0
+085C..08D3     A
+08D4..0902     0
+0903..0939     A
+093A           0
+093B           A
+093C           0
+093D..0940     A
+0941..0948     0
+0949..094C     A
+094D           0
+094E..0950     A
+0951..0957     0
+0958..0961     A
+0962..0963     0
+0964..0980     A
+0981           0
+0982..09BB     A
+09BC           0
+09BD..09C0     A
+09C1..09C4     0
+09C5..09CC     A
+09CD           0
+09CE..09E1     A
+09E2..09E3     0
+09E4..0A00     A
+0A01..0A02     0
+0A03..0A3B     A
+0A3C           0
+0A3D..0A40     A
+0A41..0A42     0
+0A43..0A46     A
+0A47..0A48     0
+0A49..0A4A     A
+0A4B..0A4D     0
+0A4E..0A50     A
+0A51           0
+0A52..0A6F     A
+0A70..0A71     0
+0A72..0A74     A
+0A75           0
+0A76..0A80     A
+0A81..0A82     0
+0A83..0ABB     A
+0ABC           0
+0ABD..0AC0     A
+0AC1..0AC5     0
+0AC6           A
+0AC7..0AC8     0
+0AC9..0ACC     A
+0ACD           0
+0ACE..0AE1     A
+0AE2..0AE3     0
+0AE4..0B00     A
+0B01           0
+0B02..0B3B     A
+0B3C           0
+0B3D..0B3E     A
+0B3F           0
+0B40           A
+0B41..0B44     0
+0B45..0B4C     A
+0B4D           0
+0B4E..0B55     A
+0B56           0
+0B57..0B61     A
+0B62..0B63     0
+0B64..0B81     A
+0B82           0
+0B83..0BBF     A
+0BC0           0
+0BC1..0BCC     A
+0BCD           0
+0BCE..0BFF     A
+0C00           0
+0C01..0C3D     A
+0C3E..0C40     0
+0C41..0C45     A
+0C46..0C48     0
+0C49           A
+0C4A..0C4D     0
+0C4E..0C54     A
+0C55..0C56     0
+0C57..0C61     A
+0C62..0C63     0
+0C64..0C80     A
+0C81           0
+0C82..0CBB     A
+0CBC           0
+0CBD..0CCB     A
+0CCC..0CCD     0
+0CCE..0CE1     A
+0CE2..0CE3     0
+0CE4..0D00     A
+0D01           0
+0D02..0D40     A
+0D41..0D44     0
+0D45..0D4C     A
+0D4D           0
+0D4E..0D61     A
+0D62..0D63     0
+0D64..0DC9     A
+0DCA           0
+0DCB..0DD1     A
+0DD2..0DD4     0
+0DD5           A
+0DD6           0
+0DD7..0E30     A
+0E31           0
+0E32..0E33     A
+0E34..0E3A     0
+0E3B..0E46     A
+0E47..0E4E     0
+0E4F..0EB0     A
+0EB1           0
+0EB2..0EB3     A
+0EB4..0EB9     0
+0EBA           A
+0EBB..0EBC     0
+0EBD..0EC7     A
+0EC8..0ECD     0
+0ECE..0F17     A
+0F18..0F19     0
+0F1A..0F34     A
+0F35           0
+0F36           A
+0F37           0
+0F38           A
+0F39           0
+0F3A..0F70     A
+0F71..0F7E     0
+0F7F           A
+0F80..0F84     0
+0F85           A
+0F86..0F87     0
+0F88..0F8C     A
+0F8D..0F97     0
+0F98           A
+0F99..0FBC     0
+0FBD..0FC5     A
+0FC6           0
+0FC7..102C     A
+102D..1030     0
+1031           A
+1032..1037     0
+1038           A
+1039..103A     0
+103B..103C     A
+103D..103E     0
+103F..1057     A
+1058..1059     0
+105A..105D     A
+105E..1060     0
+1061..1070     A
+1071..1074     0
+1075..1081     A
+1082           0
+1083..1084     A
+1085..1086     0
+1087..108C     A
+108D           0
+108E..109C     A
+109D           0
+109E..10FF     A
+1100..115F     2
+1160..135C     A
+135D..135F     0
+1360..1711     A
+1712..1714     0
+1715..1731     A
+1732..1734     0
+1735..1751     A
+1752..1753     0
+1754..1771     A
+1772..1773     0
+1774..17B3     A
+17B4..17B5     0
+17B6           A
+17B7..17BD     0
+17BE..17C5     A
+17C6           0
+17C7..17C8     A
+17C9..17D3     0
+17D4..17DC     A
+17DD           0
+17DE..180A     A
+180B..180E     0
+180F..1884     A
+1885..1886     0
+1887..18A8     A
+18A9           0
+18AA..191F     A
+1920..1922     0
+1923..1926     A
+1927..1928     0
+1929..1931     A
+1932           0
+1933..1938     A
+1939..193B     0
+193C..1A16     A
+1A17..1A18     0
+1A19..1A1A     A
+1A1B           0
+1A1C..1A55     A
+1A56           0
+1A57           A
+1A58..1A5E     0
+1A5F           A
+1A60           0
+1A61           A
+1A62           0
+1A63..1A64     A
+1A65..1A6C     0
+1A6D..1A72     A
+1A73..1A7C     0
+1A7D..1A7E     A
+1A7F           0
+1A80..1AAF     A
+1AB0..1ABE     0
+1ABF..1AFF     A
+1B00..1B03     0
+1B04..1B33     A
+1B34           0
+1B35           A
+1B36..1B3A     0
+1B3B           A
+1B3C           0
+1B3D..1B41     A
+1B42           0
+1B43..1B6A     A
+1B6B..1B73     0
+1B74..1B7F     A
+1B80..1B81     0
+1B82..1BA1     A
+1BA2..1BA5     0
+1BA6..1BA7     A
+1BA8..1BA9     0
+1BAA           A
+1BAB..1BAD     0
+1BAE..1BE5     A
+1BE6           0
+1BE7           A
+1BE8..1BE9     0
+1BEA..1BEC     A
+1BED           0
+1BEE           A
+1BEF..1BF1     0
+1BF2..1C2B     A
+1C2C..1C33     0
+1C34..1C35     A
+1C36..1C37     0
+1C38..1CCF     A
+1CD0..1CD2     0
+1CD3           A
+1CD4..1CE0     0
+1CE1           A
+1CE2..1CE8     0
+1CE9..1CEC     A
+1CED           0
+1CEE..1CF3     A
+1CF4           0
+1CF5..1CF7     A
+1CF8..1CF9     0
+1CFA..1DBF     A
+1DC0..1DF5     0
+1DF6..1DFA     A
+1DFB..1DFF     0
+1E00..200A     A
+200B..200F     0
+2010..2029     A
+202A..202E     0
+202F..205F     A
+2060..2064     0
+2065           A
+2066..206F     0
+2070..20A8     A
+20A9           1
+20AA..20CF     A
+20D0..20F0     0
+20F1..2328     A
+2329..232A     2
+232B..2CEE     A
+2CEF..2CF1     0
+2CF2..2D7E     A
+2D7F           0
+2D80..2DDF     A
+2DE0..2DFF     0
+2E00..2E7F     A
+2E80..3029     2
+302A..302D     0
+302E..303E     2
+303F           A
+3040..3098     2
+3099..309A     0
+309B..4DBF     2
+4DC0..4DFF     A
+4E00..A4CF     2
+A4D0..A66E     A
+A66F..A672     0
+A673           A
+A674..A67D     0
+A67E..A69D     A
+A69E..A69F     0
+A6A0..A6EF     A
+A6F0..A6F1     0
+A6F2..A801     A
+A802           0
+A803..A805     A
+A806           0
+A807..A80A     A
+A80B           0
+A80C..A824     A
+A825..A826     0
+A827..A8C3     A
+A8C4..A8C5     0
+A8C6..A8DF     A
+A8E0..A8F1     0
+A8F2..A925     A
+A926..A92D     0
+A92E..A946     A
+A947..A951     0
+A952..A97F     A
+A980..A982     0
+A983..A9B2     A
+A9B3           0
+A9B4..A9B5     A
+A9B6..A9B9     0
+A9BA..A9BB     A
+A9BC           0
+A9BD..A9E4     A
+A9E5           0
+A9E6..AA28     A
+AA29..AA2E     0
+AA2F..AA30     A
+AA31..AA32     0
+AA33..AA34     A
+AA35..AA36     0
+AA37..AA42     A
+AA43           0
+AA44..AA4B     A
+AA4C           0
+AA4D..AA7B     A
+AA7C           0
+AA7D..AAAF     A
+AAB0           0
+AAB1           A
+AAB2..AAB4     0
+AAB5..AAB6     A
+AAB7..AAB8     0
+AAB9..AABD     A
+AABE..AABF     0
+AAC0           A
+AAC1           0
+AAC2..AAEB     A
+AAEC..AAED     0
+AAEE..AAF5     A
+AAF6           0
+AAF7..ABE4     A
+ABE5           0
+ABE6..ABE7     A
+ABE8           0
+ABE9..ABEC     A
+ABED           0
+ABEE..ABFF     A
+AC00..D7A3     2
+D7A4..F8FF     A
+F900..FAFF     2
+FB00..FB1D     A
+FB1E           0
+FB1F..FDFF     A
+FE00..FE0F     0
+FE10..FE1F     2
+FE20..FE2F     0
+FE30..FE6F     2
+FE70..FEFE     A
+FEFF           0
+FF00..FF60     2
+FF61..FFDF     1
+FFE0..FFE6     2
+FFE7..FFF8     1
+FFF9..FFFB     0
+FFFC..101FC    1
+101FD          0
+101FE..102DF   1
+102E0          0
+102E1..10375   1
+10376..1037A   0
+1037B..10A00   1
+10A01..10A03   0
+10A04          1
+10A05..10A06   0
+10A07..10A0B   1
+10A0C..10A0F   0
+10A10..10A37   1
+10A38..10A3A   0
+10A3B..10A3E   1
+10A3F          0
+10A40..10AE4   1
+10AE5..10AE6   0
+10AE7..11000   1
+11001          0
+11002..11037   1
+11038..11046   0
+11047..1107E   1
+1107F..11081   0
+11082..110B2   1
+110B3..110B6   0
+110B7..110B8   1
+110B9..110BA   0
+110BB..110BC   1
+110BD          0
+110BE..110FF   1
+11100..11102   0
+11103..11126   1
+11127..1112B   0
+1112C          1
+1112D..11134   0
+11135..11172   1
+11173          0
+11174..1117F   1
+11180..11181   0
+11182..111B5   1
+111B6..111BE   0
+111BF..111C9   1
+111CA..111CC   0
+111CD..1122E   1
+1122F..11231   0
+11232..11233   1
+11234          0
+11235          1
+11236..11237   0
+11238..1123D   1
+1123E          0
+1123F..112DE   1
+112DF          0
+112E0..112E2   1
+112E3..112EA   0
+112EB..112FF   1
+11300..11301   0
+11302..1133B   1
+1133C          0
+1133D..1133F   1
+11340          0
+11341..11365   1
+11366..1136C   0
+1136D..1136F   1
+11370..11374   0
+11375..11437   1
+11438..1143F   0
+11440..11441   1
+11442..11444   0
+11445          1
+11446          0
+11447..114B2   1
+114B3..114B8   0
+114B9          1
+114BA          0
+114BB..114BE   1
+114BF..114C0   0
+114C1          1
+114C2..114C3   0
+114C4..115B1   1
+115B2..115B5   0
+115B6..115BB   1
+115BC..115BD   0
+115BE          1
+115BF..115C0   0
+115C1..115DB   1
+115DC..115DD   0
+115DE..11632   1
+11633..1163A   0
+1163B..1163C   1
+1163D          0
+1163E          1
+1163F..11640   0
+11641..116AA   1
+116AB          0
+116AC          1
+116AD          0
+116AE..116AF   1
+116B0..116B5   0
+116B6          1
+116B7          0
+116B8..1171C   1
+1171D..1171F   0
+11720..11721   1
+11722..11725   0
+11726          1
+11727..1172B   0
+1172C..11C2F   1
+11C30..11C36   0
+11C37          1
+11C38..11C3D   0
+11C3E..11C91   1
+11C92..11CA7   0
+11CA8..11CA9   1
+11CAA..11CB0   0
+11CB1          1
+11CB2..11CB3   0
+11CB4          1
+11CB5..11CB6   0
+11CB7..16AEF   1
+16AF0..16AF4   0
+16AF5..16B2F   1
+16B30..16B36   0
+16B37..16F8E   1
+16F8F..16F92   0
+16F93..1BC9C   1
+1BC9D..1BC9E   0
+1BC9F          1
+1BCA0..1BCA3   0
+1BCA4..1D166   1
+1D167..1D169   0
+1D16A..1D172   1
+1D173..1D182   0
+1D183..1D184   1
+1D185..1D18B   0
+1D18C..1D1A9   1
+1D1AA..1D1AD   0
+1D1AE..1D241   1
+1D242..1D244   0
+1D245..1D9FF   1
+1DA00..1DA36   0
+1DA37..1DA3A   1
+1DA3B..1DA6C   0
+1DA6D..1DA74   1
+1DA75          0
+1DA76..1DA83   1
+1DA84          0
+1DA85..1DA9A   1
+1DA9B..1DA9F   0
+1DAA0          1
+1DAA1..1DAAF   0
+1DAB0..1DFFF   1
+1E000..1E006   0
+1E007          1
+1E008..1E018   0
+1E019..1E01A   1
+1E01B..1E021   0
+1E022          1
+1E023..1E024   0
+1E025          1
+1E026..1E02A   0
+1E02B..1E8CF   1
+1E8D0..1E8D6   0
+1E8D7..1E943   1
+1E944..1E94A   0
+1E94B..1FFFF   1
+20000..3FFFF   2
+40000..E0000   1
+E0001          0
+E0002..E001F   1
+E0020..E007F   0
+E0080..E00FF   1
+E0100..E01EF   0
+E01F0..10FFFF  1
+EOF
+
+: ${DIFF=diff}
+${DIFF} uc_width.ok uc_width.out
+result=$?
+
+rm -fr $tmpfiles
+
+exit $result
index 8368744..11089a0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992, 1995-2002, 2005-2016 Free Software Foundation, Inc.
+/* Copyright (C) 1992, 1995-2002, 2005-2021 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    This program is free software: you can redistribute it and/or modify
@@ -12,7 +12,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* Don't use __attribute__ __nonnull__ in this compilation unit.  Otherwise gcc
    optimizes away the name == NULL test below.  */
diff --git a/tests/unused-parameter.h b/tests/unused-parameter.h
new file mode 100644 (file)
index 0000000..5da19c5
--- /dev/null
@@ -0,0 +1,32 @@
+/* A C macro for declaring that specific function parameters are not used.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* _GL_UNUSED_PARAMETER is a marker that can be appended to function parameter
+   declarations for parameters that are not used.  This helps to reduce
+   warnings, such as from GCC -Wunused-parameter.  The syntax is as follows:
+       type param _GL_UNUSED_PARAMETER
+   or more generally
+       param_decl _GL_UNUSED_PARAMETER
+   For example:
+       int param _GL_UNUSED_PARAMETER
+       int *(*param)(void) _GL_UNUSED_PARAMETER
+   Other possible, but obscure and discouraged syntaxes:
+       int _GL_UNUSED_PARAMETER *(*param)(void)
+       _GL_UNUSED_PARAMETER int *(*param)(void)
+ */
+#ifndef _GL_UNUSED_PARAMETER
+# define _GL_UNUSED_PARAMETER _GL_ATTRIBUTE_MAYBE_UNUSED
+#endif
diff --git a/tests/vma-iter.c b/tests/vma-iter.c
new file mode 100644 (file)
index 0000000..809828b
--- /dev/null
@@ -0,0 +1,1635 @@
+/* Iteration over virtual memory areas.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2011-2017.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+
+/* On Solaris in 32-bit mode, when gnulib module 'largefile' is in use,
+   prevent a compilation error
+     "Cannot use procfs in the large file compilation environment"
+   On Android, when targeting Android 4.4 or older with a GCC toolchain,
+   prevent a compilation error
+     "error: call to 'mmap' declared with attribute error: mmap is not
+      available with _FILE_OFFSET_BITS=64 when using GCC until android-21.
+      Either raise your minSdkVersion, disable _FILE_OFFSET_BITS=64, or
+      switch to Clang."
+   The files that we access in this compilation unit are less than 2 GB
+   large.  */
+#if defined __sun || defined __ANDROID__
+# undef _FILE_OFFSET_BITS
+#endif
+
+/* Specification.  */
+#include "vma-iter.h"
+
+#include <errno.h> /* errno */
+#include <stdlib.h> /* size_t */
+#include <fcntl.h> /* open, O_RDONLY */
+#include <unistd.h> /* getpagesize, lseek, read, close, getpid */
+
+#if defined __linux__ || defined __ANDROID__
+# include <limits.h> /* PATH_MAX */
+#endif
+
+#if defined __linux__ || defined __ANDROID__ || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __minix /* || defined __CYGWIN__ */
+# include <sys/types.h>
+# include <sys/mman.h> /* mmap, munmap */
+#endif
+#if defined __minix
+# include <string.h> /* memcpy */
+#endif
+
+#if defined __FreeBSD__ || defined __FreeBSD_kernel__ /* FreeBSD, GNU/kFreeBSD */
+# include <sys/types.h>
+# include <sys/mman.h> /* mmap, munmap */
+# include <sys/user.h> /* struct kinfo_vmentry */
+# include <sys/sysctl.h> /* sysctl */
+#endif
+#if defined __NetBSD__ || defined __OpenBSD__ /* NetBSD, OpenBSD */
+# include <sys/types.h>
+# include <sys/mman.h> /* mmap, munmap */
+# include <sys/sysctl.h> /* sysctl, struct kinfo_vmentry */
+#endif
+
+#if defined __sgi || defined __osf__ /* IRIX, OSF/1 */
+# include <string.h> /* memcpy */
+# include <sys/types.h>
+# include <sys/mman.h> /* mmap, munmap */
+# include <sys/procfs.h> /* PIOC*, prmap_t */
+#endif
+
+#if defined __sun /* Solaris */
+# include <string.h> /* memcpy */
+# include <sys/types.h>
+# include <sys/mman.h> /* mmap, munmap */
+/* Try to use the newer ("structured") /proc filesystem API, if supported.  */
+# define _STRUCTURED_PROC 1
+# include <sys/procfs.h> /* prmap_t, optionally PIOC* */
+#endif
+
+#if HAVE_PSTAT_GETPROCVM /* HP-UX */
+# include <sys/pstat.h> /* pstat_getprocvm */
+#endif
+
+#if defined __APPLE__ && defined __MACH__ /* Mac OS X */
+# include <mach/mach.h>
+#endif
+
+#if defined __GNU__ /* GNU/Hurd */
+# include <mach/mach.h>
+#endif
+
+#if defined _WIN32 || defined __CYGWIN__ /* Windows */
+# include <windows.h>
+#endif
+
+#if defined __BEOS__ || defined __HAIKU__ /* BeOS, Haiku */
+# include <OS.h>
+#endif
+
+#if HAVE_MQUERY /* OpenBSD */
+# include <sys/types.h>
+# include <sys/mman.h> /* mquery */
+#endif
+
+/* Note: On AIX, there is a /proc/$pic/map file, that contains records of type
+   prmap_t, defined in <sys/procfs.h>.  But it lists only the virtual memory
+   areas that are connected to a file, not the anonymous ones.  */
+
+
+/* Support for reading text files in the /proc file system.  */
+
+#if defined __linux__ || defined __ANDROID__ || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __minix /* || defined __CYGWIN__ */
+
+/* Buffered read-only streams.
+   We cannot use <stdio.h> here, because fopen() calls malloc(), and a malloc()
+   call may call mmap() and thus pre-allocate available memory.
+   Also, we cannot use multiple read() calls, because if the buffer size is
+   smaller than the file's contents:
+     - On NetBSD, the second read() call would return 0, thus making the file
+       appear truncated.
+     - On DragonFly BSD, the first read() call would fail with errno = EFBIG.
+     - On all platforms, if some other thread is doing memory allocations or
+       deallocations between two read() calls, there is a high risk that the
+       result of these two read() calls don't fit together, and as a
+       consequence we will parse garbage and either omit some VMAs or return
+       VMAs with nonsensical addresses.
+   So use mmap(), and ignore the resulting VMA.  */
+
+# if defined __linux__ || defined __ANDROID__
+  /* On Linux, if the file does not entirely fit into the buffer, the read()
+     function stops before the line that would come out truncated.  The
+     maximum size of such a line is 73 + PATH_MAX bytes.  To be sure that we
+     have read everything, we must verify that at least that many bytes are
+     left when read() returned.  */
+#  define MIN_LEFTOVER (73 + PATH_MAX)
+# else
+#  define MIN_LEFTOVER 1
+# endif
+
+# ifdef TEST
+/* During testing, we want to run into the hairy cases.  */
+#  define STACK_ALLOCATED_BUFFER_SIZE 32
+# else
+#  if MIN_LEFTOVER < 1024
+#   define STACK_ALLOCATED_BUFFER_SIZE 1024
+#  else
+    /* There is no point in using a stack-allocated buffer if it is too small anyway.  */
+#   define STACK_ALLOCATED_BUFFER_SIZE 1
+#  endif
+# endif
+
+struct rofile
+  {
+    size_t position;
+    size_t filled;
+    int eof_seen;
+    /* These fields deal with allocation of the buffer.  */
+    char *buffer;
+    char *auxmap;
+    size_t auxmap_length;
+    unsigned long auxmap_start;
+    unsigned long auxmap_end;
+    char stack_allocated_buffer[STACK_ALLOCATED_BUFFER_SIZE];
+  };
+
+/* Open a read-only file stream.  */
+static int
+rof_open (struct rofile *rof, const char *filename)
+{
+  int fd;
+  unsigned long pagesize;
+  size_t size;
+
+  fd = open (filename, O_RDONLY | O_CLOEXEC);
+  if (fd < 0)
+    return -1;
+  rof->position = 0;
+  rof->eof_seen = 0;
+  /* Try the static buffer first.  */
+  pagesize = 0;
+  rof->buffer = rof->stack_allocated_buffer;
+  size = sizeof (rof->stack_allocated_buffer);
+  rof->auxmap = NULL;
+  rof->auxmap_start = 0;
+  rof->auxmap_end = 0;
+  for (;;)
+    {
+      /* Attempt to read the contents in a single system call.  */
+      if (size > MIN_LEFTOVER)
+        {
+          int n = read (fd, rof->buffer, size);
+          if (n < 0 && errno == EINTR)
+            goto retry;
+# if defined __DragonFly__
+          if (!(n < 0 && errno == EFBIG))
+# endif
+            {
+              if (n <= 0)
+                /* Empty file.  */
+                goto fail1;
+              if (n + MIN_LEFTOVER <= size)
+                {
+                  /* The buffer was sufficiently large.  */
+                  rof->filled = n;
+# if defined __linux__ || defined __ANDROID__
+                  /* On Linux, the read() call may stop even if the buffer was
+                     large enough.  We need the equivalent of full_read().  */
+                  for (;;)
+                    {
+                      n = read (fd, rof->buffer + rof->filled, size - rof->filled);
+                      if (n < 0 && errno == EINTR)
+                        goto retry;
+                      if (n < 0)
+                        /* Some error.  */
+                        goto fail1;
+                      if (n + MIN_LEFTOVER > size - rof->filled)
+                        /* Allocate a larger buffer.  */
+                        break;
+                      if (n == 0)
+                        {
+                          /* Reached the end of file.  */
+                          close (fd);
+                          return 0;
+                        }
+                      rof->filled += n;
+                    }
+# else
+                  close (fd);
+                  return 0;
+# endif
+                }
+            }
+        }
+      /* Allocate a larger buffer.  */
+      if (pagesize == 0)
+        {
+          pagesize = getpagesize ();
+          size = pagesize;
+          while (size <= MIN_LEFTOVER)
+            size = 2 * size;
+        }
+      else
+        {
+          size = 2 * size;
+          if (size == 0)
+            /* Wraparound.  */
+            goto fail1;
+          if (rof->auxmap != NULL)
+            munmap (rof->auxmap, rof->auxmap_length);
+        }
+      rof->auxmap = (void *) mmap ((void *) 0, size, PROT_READ | PROT_WRITE,
+                                   MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+      if (rof->auxmap == (void *) -1)
+        {
+          close (fd);
+          return -1;
+        }
+      rof->auxmap_length = size;
+      rof->auxmap_start = (unsigned long) rof->auxmap;
+      rof->auxmap_end = rof->auxmap_start + size;
+      rof->buffer = (char *) rof->auxmap;
+     retry:
+      /* Restart.  */
+      if (lseek (fd, 0, SEEK_SET) < 0)
+        {
+          close (fd);
+          fd = open (filename, O_RDONLY | O_CLOEXEC);
+          if (fd < 0)
+            goto fail2;
+        }
+    }
+ fail1:
+  close (fd);
+ fail2:
+  if (rof->auxmap != NULL)
+    munmap (rof->auxmap, rof->auxmap_length);
+  return -1;
+}
+
+/* Return the next byte from a read-only file stream without consuming it,
+   or -1 at EOF.  */
+static int
+rof_peekchar (struct rofile *rof)
+{
+  if (rof->position == rof->filled)
+    {
+      rof->eof_seen = 1;
+      return -1;
+    }
+  return (unsigned char) rof->buffer[rof->position];
+}
+
+/* Return the next byte from a read-only file stream, or -1 at EOF.  */
+static int
+rof_getchar (struct rofile *rof)
+{
+  int c = rof_peekchar (rof);
+  if (c >= 0)
+    rof->position++;
+  return c;
+}
+
+/* Parse an unsigned hexadecimal number from a read-only file stream.  */
+static int
+rof_scanf_lx (struct rofile *rof, unsigned long *valuep)
+{
+  unsigned long value = 0;
+  unsigned int numdigits = 0;
+  for (;;)
+    {
+      int c = rof_peekchar (rof);
+      if (c >= '0' && c <= '9')
+        value = (value << 4) + (c - '0');
+      else if (c >= 'A' && c <= 'F')
+        value = (value << 4) + (c - 'A' + 10);
+      else if (c >= 'a' && c <= 'f')
+        value = (value << 4) + (c - 'a' + 10);
+      else
+        break;
+      rof_getchar (rof);
+      numdigits++;
+    }
+  if (numdigits == 0)
+    return -1;
+  *valuep = value;
+  return 0;
+}
+
+/* Close a read-only file stream.  */
+static void
+rof_close (struct rofile *rof)
+{
+  if (rof->auxmap != NULL)
+    munmap (rof->auxmap, rof->auxmap_length);
+}
+
+#endif
+
+
+/* Support for reading the info from a text file in the /proc file system.  */
+
+#if defined __linux__ || defined __ANDROID__ || (defined __FreeBSD_kernel__ && !defined __FreeBSD__) /* || defined __CYGWIN__ */
+/* GNU/kFreeBSD mounts /proc as linprocfs, which looks like a Linux /proc
+   file system.  */
+
+static int
+vma_iterate_proc (vma_iterate_callback_fn callback, void *data)
+{
+  struct rofile rof;
+
+  /* Open the current process' maps file.  It describes one VMA per line.  */
+  if (rof_open (&rof, "/proc/self/maps") >= 0)
+    {
+      unsigned long auxmap_start = rof.auxmap_start;
+      unsigned long auxmap_end = rof.auxmap_end;
+
+      for (;;)
+        {
+          unsigned long start, end;
+          unsigned int flags;
+          int c;
+
+          /* Parse one line.  First start and end.  */
+          if (!(rof_scanf_lx (&rof, &start) >= 0
+                && rof_getchar (&rof) == '-'
+                && rof_scanf_lx (&rof, &end) >= 0))
+            break;
+          /* Then the flags.  */
+          do
+            c = rof_getchar (&rof);
+          while (c == ' ');
+          flags = 0;
+          if (c == 'r')
+            flags |= VMA_PROT_READ;
+          c = rof_getchar (&rof);
+          if (c == 'w')
+            flags |= VMA_PROT_WRITE;
+          c = rof_getchar (&rof);
+          if (c == 'x')
+            flags |= VMA_PROT_EXECUTE;
+          while (c = rof_getchar (&rof), c != -1 && c != '\n')
+            ;
+
+          if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+            {
+              /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+                 = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+              if (start < auxmap_start)
+                if (callback (data, start, auxmap_start, flags))
+                  break;
+              if (auxmap_end - 1 < end - 1)
+                if (callback (data, auxmap_end, end, flags))
+                  break;
+            }
+          else
+            {
+              if (callback (data, start, end, flags))
+                break;
+            }
+        }
+      rof_close (&rof);
+      return 0;
+    }
+
+  return -1;
+}
+
+#elif defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__
+
+static int
+vma_iterate_proc (vma_iterate_callback_fn callback, void *data)
+{
+  struct rofile rof;
+
+  /* Open the current process' maps file.  It describes one VMA per line.  */
+  if (rof_open (&rof, "/proc/curproc/map") >= 0)
+    {
+      unsigned long auxmap_start = rof.auxmap_start;
+      unsigned long auxmap_end = rof.auxmap_end;
+
+      for (;;)
+        {
+          unsigned long start, end;
+          unsigned int flags;
+          int c;
+
+          /* Parse one line.  First start.  */
+          if (!(rof_getchar (&rof) == '0'
+                && rof_getchar (&rof) == 'x'
+                && rof_scanf_lx (&rof, &start) >= 0))
+            break;
+          while (c = rof_peekchar (&rof), c == ' ' || c == '\t')
+            rof_getchar (&rof);
+          /* Then end.  */
+          if (!(rof_getchar (&rof) == '0'
+                && rof_getchar (&rof) == 'x'
+                && rof_scanf_lx (&rof, &end) >= 0))
+            break;
+# if defined __FreeBSD__ || defined __DragonFly__
+          /* Then the resident pages count.  */
+          do
+            c = rof_getchar (&rof);
+          while (c == ' ');
+          do
+            c = rof_getchar (&rof);
+          while (c != -1 && c != '\n' && c != ' ');
+          /* Then the private resident pages count.  */
+          do
+            c = rof_getchar (&rof);
+          while (c == ' ');
+          do
+            c = rof_getchar (&rof);
+          while (c != -1 && c != '\n' && c != ' ');
+          /* Then some kernel address.  */
+          do
+            c = rof_getchar (&rof);
+          while (c == ' ');
+          do
+            c = rof_getchar (&rof);
+          while (c != -1 && c != '\n' && c != ' ');
+# endif
+          /* Then the flags.  */
+          do
+            c = rof_getchar (&rof);
+          while (c == ' ');
+          flags = 0;
+          if (c == 'r')
+            flags |= VMA_PROT_READ;
+          c = rof_getchar (&rof);
+          if (c == 'w')
+            flags |= VMA_PROT_WRITE;
+          c = rof_getchar (&rof);
+          if (c == 'x')
+            flags |= VMA_PROT_EXECUTE;
+          while (c = rof_getchar (&rof), c != -1 && c != '\n')
+            ;
+
+          if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+            {
+              /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+                 = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+              if (start < auxmap_start)
+                if (callback (data, start, auxmap_start, flags))
+                  break;
+              if (auxmap_end - 1 < end - 1)
+                if (callback (data, auxmap_end, end, flags))
+                  break;
+            }
+          else
+            {
+              if (callback (data, start, end, flags))
+                break;
+            }
+        }
+      rof_close (&rof);
+      return 0;
+    }
+
+  return -1;
+}
+
+#elif defined __minix
+
+static int
+vma_iterate_proc (vma_iterate_callback_fn callback, void *data)
+{
+  char fnamebuf[6+10+4+1];
+  char *fname;
+  struct rofile rof;
+
+  /* Construct fname = sprintf (fnamebuf+i, "/proc/%u/map", getpid ()).  */
+  fname = fnamebuf + sizeof (fnamebuf) - (4 + 1);
+  memcpy (fname, "/map", 4 + 1);
+  {
+    unsigned int value = getpid ();
+    do
+      *--fname = (value % 10) + '0';
+    while ((value = value / 10) > 0);
+  }
+  fname -= 6;
+  memcpy (fname, "/proc/", 6);
+
+  /* Open the current process' maps file.  It describes one VMA per line.  */
+  if (rof_open (&rof, fname) >= 0)
+    {
+      unsigned long auxmap_start = rof.auxmap_start;
+      unsigned long auxmap_end = rof.auxmap_end;
+
+      for (;;)
+        {
+          unsigned long start, end;
+          unsigned int flags;
+          int c;
+
+          /* Parse one line.  First start and end.  */
+          if (!(rof_scanf_lx (&rof, &start) >= 0
+                && rof_getchar (&rof) == '-'
+                && rof_scanf_lx (&rof, &end) >= 0))
+            break;
+          /* Then the flags.  */
+          do
+            c = rof_getchar (&rof);
+          while (c == ' ');
+          flags = 0;
+          if (c == 'r')
+            flags |= VMA_PROT_READ;
+          c = rof_getchar (&rof);
+          if (c == 'w')
+            flags |= VMA_PROT_WRITE;
+          c = rof_getchar (&rof);
+          if (c == 'x')
+            flags |= VMA_PROT_EXECUTE;
+          while (c = rof_getchar (&rof), c != -1 && c != '\n')
+            ;
+
+          if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+            {
+              /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+                 = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+              if (start < auxmap_start)
+                if (callback (data, start, auxmap_start, flags))
+                  break;
+              if (auxmap_end - 1 < end - 1)
+                if (callback (data, auxmap_end, end, flags))
+                  break;
+            }
+          else
+            {
+              if (callback (data, start, end, flags))
+                break;
+            }
+        }
+      rof_close (&rof);
+      return 0;
+    }
+
+  return -1;
+}
+
+#else
+
+static inline int
+vma_iterate_proc (vma_iterate_callback_fn callback, void *data)
+{
+  return -1;
+}
+
+#endif
+
+
+/* Support for reading the info from the BSD sysctl() system call.  */
+
+#if (defined __FreeBSD__ || defined __FreeBSD_kernel__) && defined KERN_PROC_VMMAP /* FreeBSD >= 7.1 */
+
+static int
+vma_iterate_bsd (vma_iterate_callback_fn callback, void *data)
+{
+  /* Documentation: https://www.freebsd.org/cgi/man.cgi?sysctl(3)  */
+  int info_path[] = { CTL_KERN, KERN_PROC, KERN_PROC_VMMAP, getpid () };
+  size_t len;
+  size_t pagesize;
+  size_t memneed;
+  void *auxmap;
+  unsigned long auxmap_start;
+  unsigned long auxmap_end;
+  char *mem;
+  char *p;
+  char *p_end;
+
+  len = 0;
+  if (sysctl (info_path, 4, NULL, &len, NULL, 0) < 0)
+    return -1;
+  /* Allow for small variations over time.  In a multithreaded program
+     new VMAs can be allocated at any moment.  */
+  len = 2 * len + 200;
+  /* Allocate memneed bytes of memory.
+     We cannot use alloca here, because not much stack space is guaranteed.
+     We also cannot use malloc here, because a malloc() call may call mmap()
+     and thus pre-allocate available memory.
+     So use mmap(), and ignore the resulting VMA.  */
+  pagesize = getpagesize ();
+  memneed = len;
+  memneed = ((memneed - 1) / pagesize + 1) * pagesize;
+  auxmap = (void *) mmap ((void *) 0, memneed, PROT_READ | PROT_WRITE,
+                          MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+  if (auxmap == (void *) -1)
+    return -1;
+  auxmap_start = (unsigned long) auxmap;
+  auxmap_end = auxmap_start + memneed;
+  mem = (char *) auxmap;
+  if (sysctl (info_path, 4, mem, &len, NULL, 0) < 0)
+    {
+      munmap (auxmap, memneed);
+      return -1;
+    }
+  p = mem;
+  p_end = mem + len;
+  while (p < p_end)
+    {
+      struct kinfo_vmentry *kve = (struct kinfo_vmentry *) p;
+      unsigned long start = kve->kve_start;
+      unsigned long end = kve->kve_end;
+      unsigned int flags = 0;
+      if (kve->kve_protection & KVME_PROT_READ)
+        flags |= VMA_PROT_READ;
+      if (kve->kve_protection & KVME_PROT_WRITE)
+        flags |= VMA_PROT_WRITE;
+      if (kve->kve_protection & KVME_PROT_EXEC)
+        flags |= VMA_PROT_EXECUTE;
+      if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+        {
+          /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+             = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+          if (start < auxmap_start)
+            if (callback (data, start, auxmap_start, flags))
+              break;
+          if (auxmap_end - 1 < end - 1)
+            if (callback (data, auxmap_end, end, flags))
+              break;
+        }
+      else
+        {
+          if (callback (data, start, end, flags))
+            break;
+        }
+      p += kve->kve_structsize;
+    }
+  munmap (auxmap, memneed);
+  return 0;
+}
+
+#elif defined __NetBSD__ && defined VM_PROC_MAP /* NetBSD >= 8.0 */
+
+static int
+vma_iterate_bsd (vma_iterate_callback_fn callback, void *data)
+{
+  /* Documentation: https://man.netbsd.org/man/sysctl+7  */
+  unsigned int entry_size =
+    /* If we wanted to have the path of each entry, we would need
+       sizeof (struct kinfo_vmentry).  But we need only the non-string
+       parts of each entry.  */
+    offsetof (struct kinfo_vmentry, kve_path);
+  int info_path[] = { CTL_VM, VM_PROC, VM_PROC_MAP, getpid (), entry_size };
+  size_t len;
+  size_t pagesize;
+  size_t memneed;
+  void *auxmap;
+  unsigned long auxmap_start;
+  unsigned long auxmap_end;
+  char *mem;
+  char *p;
+  char *p_end;
+
+  len = 0;
+  if (sysctl (info_path, 5, NULL, &len, NULL, 0) < 0)
+    return -1;
+  /* Allow for small variations over time.  In a multithreaded program
+     new VMAs can be allocated at any moment.  */
+  len = 2 * len + 10 * entry_size;
+  /* But the system call rejects lengths > 1 MB.  */
+  if (len > 0x100000)
+    len = 0x100000;
+  /* And the system call causes a kernel panic if the length is not a multiple
+     of entry_size.  */
+  len = (len / entry_size) * entry_size;
+  /* Allocate memneed bytes of memory.
+     We cannot use alloca here, because not much stack space is guaranteed.
+     We also cannot use malloc here, because a malloc() call may call mmap()
+     and thus pre-allocate available memory.
+     So use mmap(), and ignore the resulting VMA.  */
+  pagesize = getpagesize ();
+  memneed = len;
+  memneed = ((memneed - 1) / pagesize + 1) * pagesize;
+  auxmap = (void *) mmap ((void *) 0, memneed, PROT_READ | PROT_WRITE,
+                          MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+  if (auxmap == (void *) -1)
+    return -1;
+  auxmap_start = (unsigned long) auxmap;
+  auxmap_end = auxmap_start + memneed;
+  mem = (char *) auxmap;
+  if (sysctl (info_path, 5, mem, &len, NULL, 0) < 0
+      || len > 0x100000 - entry_size)
+    {
+      /* sysctl failed, or the list of VMAs is possibly truncated.  */
+      munmap (auxmap, memneed);
+      return -1;
+    }
+  p = mem;
+  p_end = mem + len;
+  while (p < p_end)
+    {
+      struct kinfo_vmentry *kve = (struct kinfo_vmentry *) p;
+      unsigned long start = kve->kve_start;
+      unsigned long end = kve->kve_end;
+      unsigned int flags = 0;
+      if (kve->kve_protection & KVME_PROT_READ)
+        flags |= VMA_PROT_READ;
+      if (kve->kve_protection & KVME_PROT_WRITE)
+        flags |= VMA_PROT_WRITE;
+      if (kve->kve_protection & KVME_PROT_EXEC)
+        flags |= VMA_PROT_EXECUTE;
+      if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+        {
+          /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+             = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+          if (start < auxmap_start)
+            if (callback (data, start, auxmap_start, flags))
+              break;
+          if (auxmap_end - 1 < end - 1)
+            if (callback (data, auxmap_end, end, flags))
+              break;
+        }
+      else
+        {
+          if (callback (data, start, end, flags))
+            break;
+        }
+      p += entry_size;
+    }
+  munmap (auxmap, memneed);
+  return 0;
+}
+
+#elif defined __OpenBSD__ && defined KERN_PROC_VMMAP /* OpenBSD >= 5.7 */
+
+static int
+vma_iterate_bsd (vma_iterate_callback_fn callback, void *data)
+{
+  /* Documentation: https://man.openbsd.org/sysctl.2  */
+  int info_path[] = { CTL_KERN, KERN_PROC_VMMAP, getpid () };
+  size_t len;
+  size_t pagesize;
+  size_t memneed;
+  void *auxmap;
+  unsigned long auxmap_start;
+  unsigned long auxmap_end;
+  char *mem;
+  char *p;
+  char *p_end;
+
+  len = 0;
+  if (sysctl (info_path, 3, NULL, &len, NULL, 0) < 0)
+    return -1;
+  /* Allow for small variations over time.  In a multithreaded program
+     new VMAs can be allocated at any moment.  */
+  len = 2 * len + 10 * sizeof (struct kinfo_vmentry);
+  /* But the system call rejects lengths > 64 KB.  */
+  if (len > 0x10000)
+    len = 0x10000;
+  /* And the system call rejects lengths that are not a multiple of
+     sizeof (struct kinfo_vmentry).  */
+  len = (len / sizeof (struct kinfo_vmentry)) * sizeof (struct kinfo_vmentry);
+  /* Allocate memneed bytes of memory.
+     We cannot use alloca here, because not much stack space is guaranteed.
+     We also cannot use malloc here, because a malloc() call may call mmap()
+     and thus pre-allocate available memory.
+     So use mmap(), and ignore the resulting VMA.  */
+  pagesize = getpagesize ();
+  memneed = len;
+  memneed = ((memneed - 1) / pagesize + 1) * pagesize;
+  auxmap = (void *) mmap ((void *) 0, memneed, PROT_READ | PROT_WRITE,
+                          MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+  if (auxmap == (void *) -1)
+    return -1;
+  auxmap_start = (unsigned long) auxmap;
+  auxmap_end = auxmap_start + memneed;
+  mem = (char *) auxmap;
+  if (sysctl (info_path, 3, mem, &len, NULL, 0) < 0
+      || len > 0x10000 - sizeof (struct kinfo_vmentry))
+    {
+      /* sysctl failed, or the list of VMAs is possibly truncated.  */
+      munmap (auxmap, memneed);
+      return -1;
+    }
+  p = mem;
+  p_end = mem + len;
+  while (p < p_end)
+    {
+      struct kinfo_vmentry *kve = (struct kinfo_vmentry *) p;
+      unsigned long start = kve->kve_start;
+      unsigned long end = kve->kve_end;
+      unsigned int flags = 0;
+      if (kve->kve_protection & KVE_PROT_READ)
+        flags |= VMA_PROT_READ;
+      if (kve->kve_protection & KVE_PROT_WRITE)
+        flags |= VMA_PROT_WRITE;
+      if (kve->kve_protection & KVE_PROT_EXEC)
+        flags |= VMA_PROT_EXECUTE;
+      if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+        {
+          /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+             = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+          if (start < auxmap_start)
+            if (callback (data, start, auxmap_start, flags))
+              break;
+          if (auxmap_end - 1 < end - 1)
+            if (callback (data, auxmap_end, end, flags))
+              break;
+        }
+      else
+        {
+          if (start != end)
+            if (callback (data, start, end, flags))
+              break;
+        }
+      p += sizeof (struct kinfo_vmentry);
+    }
+  munmap (auxmap, memneed);
+  return 0;
+}
+
+#else
+
+static inline int
+vma_iterate_bsd (vma_iterate_callback_fn callback, void *data)
+{
+  return -1;
+}
+
+#endif
+
+
+int
+vma_iterate (vma_iterate_callback_fn callback, void *data)
+{
+#if defined __linux__ || defined __ANDROID__ || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __minix /* || defined __CYGWIN__ */
+
+# if defined __FreeBSD__
+  /* On FreeBSD with procfs (but not GNU/kFreeBSD, which uses linprocfs), the
+     function vma_iterate_proc does not return the virtual memory areas that
+     were created by anonymous mmap.  See
+     <https://svnweb.freebsd.org/base/head/sys/fs/procfs/procfs_map.c?view=markup>
+     So use vma_iterate_proc only as a fallback.  */
+  int retval = vma_iterate_bsd (callback, data);
+  if (retval == 0)
+      return 0;
+
+  return vma_iterate_proc (callback, data);
+# else
+  /* On the other platforms, try the /proc approach first, and the sysctl()
+     as a fallback.  */
+  int retval = vma_iterate_proc (callback, data);
+  if (retval == 0)
+      return 0;
+
+  return vma_iterate_bsd (callback, data);
+# endif
+
+#elif defined __sgi || defined __osf__ /* IRIX, OSF/1 */
+
+  size_t pagesize;
+  char fnamebuf[6+10+1];
+  char *fname;
+  int fd;
+  int nmaps;
+  size_t memneed;
+# if HAVE_MAP_ANONYMOUS
+#  define zero_fd -1
+#  define map_flags MAP_ANONYMOUS
+# else
+  int zero_fd;
+#  define map_flags 0
+# endif
+  void *auxmap;
+  unsigned long auxmap_start;
+  unsigned long auxmap_end;
+  prmap_t* maps;
+  prmap_t* mp;
+
+  pagesize = getpagesize ();
+
+  /* Construct fname = sprintf (fnamebuf+i, "/proc/%u", getpid ()).  */
+  fname = fnamebuf + sizeof (fnamebuf) - 1;
+  *fname = '\0';
+  {
+    unsigned int value = getpid ();
+    do
+      *--fname = (value % 10) + '0';
+    while ((value = value / 10) > 0);
+  }
+  fname -= 6;
+  memcpy (fname, "/proc/", 6);
+
+  fd = open (fname, O_RDONLY | O_CLOEXEC);
+  if (fd < 0)
+    return -1;
+
+  if (ioctl (fd, PIOCNMAP, &nmaps) < 0)
+    goto fail2;
+
+  memneed = (nmaps + 10) * sizeof (prmap_t);
+  /* Allocate memneed bytes of memory.
+     We cannot use alloca here, because not much stack space is guaranteed.
+     We also cannot use malloc here, because a malloc() call may call mmap()
+     and thus pre-allocate available memory.
+     So use mmap(), and ignore the resulting VMA.  */
+  memneed = ((memneed - 1) / pagesize + 1) * pagesize;
+# if !HAVE_MAP_ANONYMOUS
+  zero_fd = open ("/dev/zero", O_RDONLY | O_CLOEXEC, 0644);
+  if (zero_fd < 0)
+    goto fail2;
+# endif
+  auxmap = (void *) mmap ((void *) 0, memneed, PROT_READ | PROT_WRITE,
+                          map_flags | MAP_PRIVATE, zero_fd, 0);
+# if !HAVE_MAP_ANONYMOUS
+  close (zero_fd);
+# endif
+  if (auxmap == (void *) -1)
+    goto fail2;
+  auxmap_start = (unsigned long) auxmap;
+  auxmap_end = auxmap_start + memneed;
+  maps = (prmap_t *) auxmap;
+
+  if (ioctl (fd, PIOCMAP, maps) < 0)
+    goto fail1;
+
+  for (mp = maps;;)
+    {
+      unsigned long start, end;
+      unsigned int flags;
+
+      start = (unsigned long) mp->pr_vaddr;
+      end = start + mp->pr_size;
+      if (start == 0 && end == 0)
+        break;
+      flags = 0;
+      if (mp->pr_mflags & MA_READ)
+        flags |= VMA_PROT_READ;
+      if (mp->pr_mflags & MA_WRITE)
+        flags |= VMA_PROT_WRITE;
+      if (mp->pr_mflags & MA_EXEC)
+        flags |= VMA_PROT_EXECUTE;
+      mp++;
+      if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+        {
+          /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+             = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+          if (start < auxmap_start)
+            if (callback (data, start, auxmap_start, flags))
+              break;
+          if (auxmap_end - 1 < end - 1)
+            if (callback (data, auxmap_end, end, flags))
+              break;
+        }
+      else
+        {
+          if (callback (data, start, end, flags))
+            break;
+        }
+    }
+  munmap (auxmap, memneed);
+  close (fd);
+  return 0;
+
+ fail1:
+  munmap (auxmap, memneed);
+ fail2:
+  close (fd);
+  return -1;
+
+#elif defined __sun /* Solaris */
+
+  /* Note: Solaris <sys/procfs.h> defines a different type prmap_t with
+     _STRUCTURED_PROC than without! Here's a table of sizeof(prmap_t):
+                                  32-bit   64-bit
+         _STRUCTURED_PROC = 0       32       56
+         _STRUCTURED_PROC = 1       96      104
+     Therefore, if the include files provide the newer API, prmap_t has
+     the bigger size, and thus you MUST use the newer API.  And if the
+     include files provide the older API, prmap_t has the smaller size,
+     and thus you MUST use the older API.  */
+
+# if defined PIOCNMAP && defined PIOCMAP
+  /* We must use the older /proc interface.  */
+
+  size_t pagesize;
+  char fnamebuf[6+10+1];
+  char *fname;
+  int fd;
+  int nmaps;
+  size_t memneed;
+#  if HAVE_MAP_ANONYMOUS
+#   define zero_fd -1
+#   define map_flags MAP_ANONYMOUS
+#  else /* Solaris <= 7 */
+  int zero_fd;
+#   define map_flags 0
+#  endif
+  void *auxmap;
+  unsigned long auxmap_start;
+  unsigned long auxmap_end;
+  prmap_t* maps;
+  prmap_t* mp;
+
+  pagesize = getpagesize ();
+
+  /* Construct fname = sprintf (fnamebuf+i, "/proc/%u", getpid ()).  */
+  fname = fnamebuf + sizeof (fnamebuf) - 1;
+  *fname = '\0';
+  {
+    unsigned int value = getpid ();
+    do
+      *--fname = (value % 10) + '0';
+    while ((value = value / 10) > 0);
+  }
+  fname -= 6;
+  memcpy (fname, "/proc/", 6);
+
+  fd = open (fname, O_RDONLY | O_CLOEXEC);
+  if (fd < 0)
+    return -1;
+
+  if (ioctl (fd, PIOCNMAP, &nmaps) < 0)
+    goto fail2;
+
+  memneed = (nmaps + 10) * sizeof (prmap_t);
+  /* Allocate memneed bytes of memory.
+     We cannot use alloca here, because not much stack space is guaranteed.
+     We also cannot use malloc here, because a malloc() call may call mmap()
+     and thus pre-allocate available memory.
+     So use mmap(), and ignore the resulting VMA.  */
+  memneed = ((memneed - 1) / pagesize + 1) * pagesize;
+#  if !HAVE_MAP_ANONYMOUS
+  zero_fd = open ("/dev/zero", O_RDONLY | O_CLOEXEC, 0644);
+  if (zero_fd < 0)
+    goto fail2;
+#  endif
+  auxmap = (void *) mmap ((void *) 0, memneed, PROT_READ | PROT_WRITE,
+                          map_flags | MAP_PRIVATE, zero_fd, 0);
+#  if !HAVE_MAP_ANONYMOUS
+  close (zero_fd);
+#  endif
+  if (auxmap == (void *) -1)
+    goto fail2;
+  auxmap_start = (unsigned long) auxmap;
+  auxmap_end = auxmap_start + memneed;
+  maps = (prmap_t *) auxmap;
+
+  if (ioctl (fd, PIOCMAP, maps) < 0)
+    goto fail1;
+
+  for (mp = maps;;)
+    {
+      unsigned long start, end;
+      unsigned int flags;
+
+      start = (unsigned long) mp->pr_vaddr;
+      end = start + mp->pr_size;
+      if (start == 0 && end == 0)
+        break;
+      flags = 0;
+      if (mp->pr_mflags & MA_READ)
+        flags |= VMA_PROT_READ;
+      if (mp->pr_mflags & MA_WRITE)
+        flags |= VMA_PROT_WRITE;
+      if (mp->pr_mflags & MA_EXEC)
+        flags |= VMA_PROT_EXECUTE;
+      mp++;
+      if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+        {
+          /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+             = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+          if (start < auxmap_start)
+            if (callback (data, start, auxmap_start, flags))
+              break;
+          if (auxmap_end - 1 < end - 1)
+            if (callback (data, auxmap_end, end, flags))
+              break;
+        }
+      else
+        {
+          if (callback (data, start, end, flags))
+            break;
+        }
+    }
+  munmap (auxmap, memneed);
+  close (fd);
+  return 0;
+
+ fail1:
+  munmap (auxmap, memneed);
+ fail2:
+  close (fd);
+  return -1;
+
+# else
+  /* We must use the newer /proc interface.
+     Documentation:
+     https://docs.oracle.com/cd/E23824_01/html/821-1473/proc-4.html
+     The contents of /proc/<pid>/map consists of records of type
+     prmap_t.  These are different in 32-bit and 64-bit processes,
+     but here we are fortunately accessing only the current process.  */
+
+  size_t pagesize;
+  char fnamebuf[6+10+4+1];
+  char *fname;
+  int fd;
+  int nmaps;
+  size_t memneed;
+#  if HAVE_MAP_ANONYMOUS
+#   define zero_fd -1
+#   define map_flags MAP_ANONYMOUS
+#  else /* Solaris <= 7 */
+  int zero_fd;
+#   define map_flags 0
+#  endif
+  void *auxmap;
+  unsigned long auxmap_start;
+  unsigned long auxmap_end;
+  prmap_t* maps;
+  prmap_t* maps_end;
+  prmap_t* mp;
+
+  pagesize = getpagesize ();
+
+  /* Construct fname = sprintf (fnamebuf+i, "/proc/%u/map", getpid ()).  */
+  fname = fnamebuf + sizeof (fnamebuf) - 1 - 4;
+  memcpy (fname, "/map", 4 + 1);
+  {
+    unsigned int value = getpid ();
+    do
+      *--fname = (value % 10) + '0';
+    while ((value = value / 10) > 0);
+  }
+  fname -= 6;
+  memcpy (fname, "/proc/", 6);
+
+  fd = open (fname, O_RDONLY | O_CLOEXEC);
+  if (fd < 0)
+    return -1;
+
+  {
+    struct stat statbuf;
+    if (fstat (fd, &statbuf) < 0)
+      goto fail2;
+    nmaps = statbuf.st_size / sizeof (prmap_t);
+  }
+
+  memneed = (nmaps + 10) * sizeof (prmap_t);
+  /* Allocate memneed bytes of memory.
+     We cannot use alloca here, because not much stack space is guaranteed.
+     We also cannot use malloc here, because a malloc() call may call mmap()
+     and thus pre-allocate available memory.
+     So use mmap(), and ignore the resulting VMA.  */
+  memneed = ((memneed - 1) / pagesize + 1) * pagesize;
+#  if !HAVE_MAP_ANONYMOUS
+  zero_fd = open ("/dev/zero", O_RDONLY | O_CLOEXEC, 0644);
+  if (zero_fd < 0)
+    goto fail2;
+#  endif
+  auxmap = (void *) mmap ((void *) 0, memneed, PROT_READ | PROT_WRITE,
+                          map_flags | MAP_PRIVATE, zero_fd, 0);
+#  if !HAVE_MAP_ANONYMOUS
+  close (zero_fd);
+#  endif
+  if (auxmap == (void *) -1)
+    goto fail2;
+  auxmap_start = (unsigned long) auxmap;
+  auxmap_end = auxmap_start + memneed;
+  maps = (prmap_t *) auxmap;
+
+  /* Read up to memneed bytes from fd into maps.  */
+  {
+    size_t remaining = memneed;
+    size_t total_read = 0;
+    char *ptr = (char *) maps;
+
+    do
+      {
+        size_t nread = read (fd, ptr, remaining);
+        if (nread == (size_t)-1)
+          {
+            if (errno == EINTR)
+              continue;
+            goto fail1;
+          }
+        if (nread == 0)
+          /* EOF */
+          break;
+        total_read += nread;
+        ptr += nread;
+        remaining -= nread;
+      }
+    while (remaining > 0);
+
+    nmaps = (memneed - remaining) / sizeof (prmap_t);
+    maps_end = maps + nmaps;
+  }
+
+  for (mp = maps; mp < maps_end; mp++)
+    {
+      unsigned long start, end;
+      unsigned int flags;
+
+      start = (unsigned long) mp->pr_vaddr;
+      end = start + mp->pr_size;
+      flags = 0;
+      if (mp->pr_mflags & MA_READ)
+        flags |= VMA_PROT_READ;
+      if (mp->pr_mflags & MA_WRITE)
+        flags |= VMA_PROT_WRITE;
+      if (mp->pr_mflags & MA_EXEC)
+        flags |= VMA_PROT_EXECUTE;
+      if (start <= auxmap_start && auxmap_end - 1 <= end - 1)
+        {
+          /* Consider [start,end-1] \ [auxmap_start,auxmap_end-1]
+             = [start,auxmap_start-1] u [auxmap_end,end-1].  */
+          if (start < auxmap_start)
+            if (callback (data, start, auxmap_start, flags))
+              break;
+          if (auxmap_end - 1 < end - 1)
+            if (callback (data, auxmap_end, end, flags))
+              break;
+        }
+      else
+        {
+          if (callback (data, start, end, flags))
+            break;
+        }
+    }
+  munmap (auxmap, memneed);
+  close (fd);
+  return 0;
+
+ fail1:
+  munmap (auxmap, memneed);
+ fail2:
+  close (fd);
+  return -1;
+
+# endif
+
+#elif HAVE_PSTAT_GETPROCVM /* HP-UX */
+
+  unsigned long pagesize = getpagesize ();
+  int i;
+
+  for (i = 0; ; i++)
+    {
+      struct pst_vm_status info;
+      int ret = pstat_getprocvm (&info, sizeof (info), 0, i);
+      if (ret < 0)
+        return -1;
+      if (ret == 0)
+        break;
+      {
+        unsigned long start = info.pst_vaddr;
+        unsigned long end = start + info.pst_length * pagesize;
+        unsigned int flags = 0;
+        if (info.pst_permission & PS_PROT_READ)
+          flags |= VMA_PROT_READ;
+        if (info.pst_permission & PS_PROT_WRITE)
+          flags |= VMA_PROT_WRITE;
+        if (info.pst_permission & PS_PROT_EXECUTE)
+          flags |= VMA_PROT_EXECUTE;
+
+        if (callback (data, start, end, flags))
+          break;
+      }
+    }
+
+#elif defined __APPLE__ && defined __MACH__ /* Mac OS X */
+
+  task_t task = mach_task_self ();
+  vm_address_t address;
+  vm_size_t size;
+
+  for (address = VM_MIN_ADDRESS;; address += size)
+    {
+      int more;
+      mach_port_t object_name;
+      unsigned int flags;
+      /* In Mac OS X 10.5, the types vm_address_t, vm_offset_t, vm_size_t have
+         32 bits in 32-bit processes and 64 bits in 64-bit processes. Whereas
+         mach_vm_address_t and mach_vm_size_t are always 64 bits large.
+         Mac OS X 10.5 has three vm_region like methods:
+           - vm_region. It has arguments that depend on whether the current
+             process is 32-bit or 64-bit. When linking dynamically, this
+             function exists only in 32-bit processes. Therefore we use it only
+             in 32-bit processes.
+           - vm_region_64. It has arguments that depend on whether the current
+             process is 32-bit or 64-bit. It interprets a flavor
+             VM_REGION_BASIC_INFO as VM_REGION_BASIC_INFO_64, which is
+             dangerous since 'struct vm_region_basic_info_64' is larger than
+             'struct vm_region_basic_info'; therefore let's write
+             VM_REGION_BASIC_INFO_64 explicitly.
+           - mach_vm_region. It has arguments that are 64-bit always. This
+             function is useful when you want to access the VM of a process
+             other than the current process.
+         In 64-bit processes, we could use vm_region_64 or mach_vm_region.
+         I choose vm_region_64 because it uses the same types as vm_region,
+         resulting in less conditional code.  */
+# if defined __aarch64__ || defined __ppc64__ || defined __x86_64__
+      struct vm_region_basic_info_64 info;
+      mach_msg_type_number_t info_count = VM_REGION_BASIC_INFO_COUNT_64;
+
+      more = (vm_region_64 (task, &address, &size, VM_REGION_BASIC_INFO_64,
+                            (vm_region_info_t)&info, &info_count, &object_name)
+              == KERN_SUCCESS);
+# else
+      struct vm_region_basic_info info;
+      mach_msg_type_number_t info_count = VM_REGION_BASIC_INFO_COUNT;
+
+      more = (vm_region (task, &address, &size, VM_REGION_BASIC_INFO,
+                         (vm_region_info_t)&info, &info_count, &object_name)
+              == KERN_SUCCESS);
+# endif
+      if (object_name != MACH_PORT_NULL)
+        mach_port_deallocate (mach_task_self (), object_name);
+      if (!more)
+        break;
+      flags = 0;
+      if (info.protection & VM_PROT_READ)
+        flags |= VMA_PROT_READ;
+      if (info.protection & VM_PROT_WRITE)
+        flags |= VMA_PROT_WRITE;
+      if (info.protection & VM_PROT_EXECUTE)
+        flags |= VMA_PROT_EXECUTE;
+      if (callback (data, address, address + size, flags))
+        break;
+    }
+  return 0;
+
+#elif defined __GNU__ /* GNU/Hurd */
+
+  /* The Hurd has a /proc/self/maps that looks like the Linux one, but it
+     lacks the VMAs created through anonymous mmap.  Therefore use the Mach
+     API.
+     Documentation:
+     https://www.gnu.org/software/hurd/gnumach-doc/Memory-Attributes.html */
+
+  task_t task = mach_task_self ();
+  vm_address_t address;
+  vm_size_t size;
+
+  for (address = 0;; address += size)
+    {
+      vm_prot_t protection;
+      vm_prot_t max_protection;
+      vm_inherit_t inheritance;
+      boolean_t shared;
+      memory_object_name_t object_name;
+      vm_offset_t offset;
+      unsigned int flags;
+
+      if (!(vm_region (task, &address, &size, &protection, &max_protection,
+                         &inheritance, &shared, &object_name, &offset)
+            == KERN_SUCCESS))
+        break;
+      mach_port_deallocate (task, object_name);
+      flags = 0;
+      if (protection & VM_PROT_READ)
+        flags |= VMA_PROT_READ;
+      if (protection & VM_PROT_WRITE)
+        flags |= VMA_PROT_WRITE;
+      if (protection & VM_PROT_EXECUTE)
+        flags |= VMA_PROT_EXECUTE;
+      if (callback (data, address, address + size, flags))
+        break;
+    }
+  return 0;
+
+#elif defined _WIN32 || defined __CYGWIN__
+  /* Windows platform.  Use the native Windows API.  */
+
+  MEMORY_BASIC_INFORMATION info;
+  uintptr_t address = 0;
+
+  while (VirtualQuery ((void*)address, &info, sizeof(info)) == sizeof(info))
+    {
+      if (info.State != MEM_FREE)
+        /* Ignore areas where info.State has the value MEM_RESERVE or,
+           equivalently, info.Protect has the undocumented value 0.
+           This is needed, so that on Cygwin, areas used by malloc() are
+           distinguished from areas reserved for future malloc().  */
+        if (info.State != MEM_RESERVE)
+          {
+            uintptr_t start, end;
+            unsigned int flags;
+
+            start = (uintptr_t)info.BaseAddress;
+            end = start + info.RegionSize;
+            switch (info.Protect & ~(PAGE_GUARD|PAGE_NOCACHE))
+              {
+              case PAGE_READONLY:
+                flags = VMA_PROT_READ;
+                break;
+              case PAGE_READWRITE:
+              case PAGE_WRITECOPY:
+                flags = VMA_PROT_READ | VMA_PROT_WRITE;
+                break;
+              case PAGE_EXECUTE:
+                flags = VMA_PROT_EXECUTE;
+                break;
+              case PAGE_EXECUTE_READ:
+                flags = VMA_PROT_READ | VMA_PROT_EXECUTE;
+                break;
+              case PAGE_EXECUTE_READWRITE:
+              case PAGE_EXECUTE_WRITECOPY:
+                flags = VMA_PROT_READ | VMA_PROT_WRITE | VMA_PROT_EXECUTE;
+                break;
+              case PAGE_NOACCESS:
+              default:
+                flags = 0;
+                break;
+              }
+
+            if (callback (data, start, end, flags))
+              break;
+          }
+      address = (uintptr_t)info.BaseAddress + info.RegionSize;
+    }
+  return 0;
+
+#elif defined __BEOS__ || defined __HAIKU__
+  /* Use the BeOS specific API.  */
+
+  area_info info;
+  ssize_t cookie;
+
+  cookie = 0;
+  while (get_next_area_info (0, &cookie, &info) == B_OK)
+    {
+      unsigned long start, end;
+      unsigned int flags;
+
+      start = (unsigned long) info.address;
+      end = start + info.size;
+      flags = 0;
+      if (info.protection & B_READ_AREA)
+        flags |= VMA_PROT_READ | VMA_PROT_EXECUTE;
+      if (info.protection & B_WRITE_AREA)
+        flags |= VMA_PROT_WRITE;
+
+      if (callback (data, start, end, flags))
+        break;
+    }
+  return 0;
+
+#elif HAVE_MQUERY /* OpenBSD */
+
+# if defined __OpenBSD__
+  /* Try sysctl() first.  It is more efficient than the mquery() loop below
+     and also provides the flags.  */
+  {
+    int retval = vma_iterate_bsd (callback, data);
+    if (retval == 0)
+      return 0;
+  }
+# endif
+
+  {
+    uintptr_t pagesize;
+    uintptr_t address;
+    int /*bool*/ address_known_mapped;
+
+    pagesize = getpagesize ();
+    /* Avoid calling mquery with a NULL first argument, because this argument
+       value has a specific meaning.  We know the NULL page is unmapped.  */
+    address = pagesize;
+    address_known_mapped = 0;
+    for (;;)
+      {
+        /* Test whether the page at address is mapped.  */
+        if (address_known_mapped
+            || mquery ((void *) address, pagesize, 0, MAP_FIXED, -1, 0)
+               == (void *) -1)
+          {
+            /* The page at address is mapped.
+               This is the start of an interval.  */
+            uintptr_t start = address;
+            uintptr_t end;
+
+            /* Find the end of the interval.  */
+            end = (uintptr_t) mquery ((void *) address, pagesize, 0, 0, -1, 0);
+            if (end == (uintptr_t) (void *) -1)
+              end = 0; /* wrap around */
+            address = end;
+
+            /* It's too complicated to find out about the flags.
+               Just pass 0.  */
+            if (callback (data, start, end, 0))
+              break;
+
+            if (address < pagesize) /* wrap around? */
+              break;
+          }
+        /* Here we know that the page at address is unmapped.  */
+        {
+          uintptr_t query_size = pagesize;
+
+          address += pagesize;
+
+          /* Query larger and larger blocks, to get through the unmapped address
+             range with few mquery() calls.  */
+          for (;;)
+            {
+              if (2 * query_size > query_size)
+                query_size = 2 * query_size;
+              if (address + query_size - 1 < query_size) /* wrap around? */
+                {
+                  address_known_mapped = 0;
+                  break;
+                }
+              if (mquery ((void *) address, query_size, 0, MAP_FIXED, -1, 0)
+                  == (void *) -1)
+                {
+                  /* Not all the interval [address .. address + query_size - 1]
+                     is unmapped.  */
+                  address_known_mapped = (query_size == pagesize);
+                  break;
+                }
+              /* The interval [address .. address + query_size - 1] is
+                 unmapped.  */
+              address += query_size;
+            }
+          /* Reduce the query size again, to determine the precise size of the
+             unmapped interval that starts at address.  */
+          while (query_size > pagesize)
+            {
+              query_size = query_size / 2;
+              if (address + query_size - 1 >= query_size)
+                {
+                  if (mquery ((void *) address, query_size, 0, MAP_FIXED, -1, 0)
+                      != (void *) -1)
+                    {
+                      /* The interval [address .. address + query_size - 1] is
+                         unmapped.  */
+                      address += query_size;
+                      address_known_mapped = 0;
+                    }
+                  else
+                    address_known_mapped = (query_size == pagesize);
+                }
+            }
+          /* Here again query_size = pagesize, and
+             either address + pagesize - 1 < pagesize, or
+             mquery ((void *) address, pagesize, 0, MAP_FIXED, -1, 0) fails.
+             So, the unmapped area ends at address.  */
+        }
+        if (address + pagesize - 1 < pagesize) /* wrap around? */
+          break;
+      }
+    return 0;
+  }
+
+#else
+
+  /* Not implemented.  */
+  return -1;
+
+#endif
+}
+
+
+#ifdef TEST
+
+#include <stdio.h>
+
+/* Output the VMAs of the current process in a format similar to the Linux
+   /proc/$pid/maps file.  */
+
+static int
+vma_iterate_callback (void *data, uintptr_t start, uintptr_t end,
+                      unsigned int flags)
+{
+  printf ("%08lx-%08lx %c%c%c\n",
+          (unsigned long) start, (unsigned long) end,
+          flags & VMA_PROT_READ ? 'r' : '-',
+          flags & VMA_PROT_WRITE ? 'w' : '-',
+          flags & VMA_PROT_EXECUTE ? 'x' : '-');
+  return 0;
+}
+
+int
+main ()
+{
+  vma_iterate (vma_iterate_callback, NULL);
+
+  /* Let the user interactively look at the /proc file system.  */
+  sleep (10);
+
+  return 0;
+}
+
+/*
+ * Local Variables:
+ * compile-command: "gcc -ggdb -DTEST -Wall -I.. vma-iter.c"
+ * End:
+ */
+
+#endif /* TEST */
diff --git a/tests/vma-iter.h b/tests/vma-iter.h
new file mode 100644 (file)
index 0000000..58f854f
--- /dev/null
@@ -0,0 +1,64 @@
+/* Iteration over virtual memory areas.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
+   Written by Bruno Haible <bruno@clisp.org>, 2011.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+#ifndef _VMA_ITER_H
+#define _VMA_ITER_H
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/* Bit mask for the FLAGS parameter of a vma_iterate callback function.  */
+#define VMA_PROT_READ    (1<<0)
+#define VMA_PROT_WRITE   (1<<1)
+#define VMA_PROT_EXECUTE (1<<2)
+
+typedef int (*vma_iterate_callback_fn) (void *data,
+                                        uintptr_t start, uintptr_t end,
+                                        unsigned int flags);
+
+/* Iterate over the virtual memory areas of the current process.
+   If such iteration is supported, the callback is called once for every
+   virtual memory area, in ascending order, with the following arguments:
+     - DATA is the same argument as passed to vma_iterate.
+     - START is the address of the first byte in the area, page-aligned.
+     - END is the address of the last byte in the area plus 1, page-aligned.
+       Note that it may be 0 for the last area in the address space.
+     - FLAGS is a combination of the VMA_* bits.
+   If the callback returns 0, the iteration continues.  If it returns 1,
+   the iteration terminates prematurely.
+   This function may open file descriptors, but does not call malloc().
+   Return 0 if all went well, or -1 in case of error.  */
+extern int vma_iterate (vma_iterate_callback_fn callback, void *data);
+
+/* The macro VMA_ITERATE_SUPPORTED indicates that vma_iterate is supported on
+   this platform.
+   Note that even when this macro is defined, vma_iterate() may still fail to
+   find any virtual memory area, for example if /proc is not mounted.  */
+#if defined __linux__ || defined __ANDROID__ || defined __GNU__ || defined __FreeBSD_kernel__ || defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__ || defined __sgi || defined __osf__ || defined __sun || HAVE_PSTAT_GETPROCVM || (defined __APPLE__ && defined __MACH__) || defined _WIN32 || defined __CYGWIN__ || defined __BEOS__ || defined __HAIKU__ || defined __minix || HAVE_MQUERY
+# define VMA_ITERATE_SUPPORTED 1
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _VMA_ITER_H */
diff --git a/tests/w32sock.h b/tests/w32sock.h
new file mode 100644 (file)
index 0000000..f731188
--- /dev/null
@@ -0,0 +1,140 @@
+/* w32sock.h --- internal auxiliary functions for Windows socket functions
+
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paolo Bonzini */
+
+#include <errno.h>
+
+/* Get O_RDWR and O_BINARY.  */
+#include <fcntl.h>
+
+/* Get _open_osfhandle().  */
+#include <io.h>
+
+/* Get _get_osfhandle().  */
+#if GNULIB_MSVC_NOTHROW
+# include "msvc-nothrow.h"
+#else
+# include <io.h>
+#endif
+
+#define FD_TO_SOCKET(fd)   ((SOCKET) _get_osfhandle ((fd)))
+#define SOCKET_TO_FD(fh)   (_open_osfhandle ((intptr_t) (fh), O_RDWR | O_BINARY))
+
+static inline void
+set_winsock_errno (void)
+{
+  int err = WSAGetLastError ();
+
+  /* Map some WSAE* errors to the runtime library's error codes.  */
+  switch (err)
+    {
+    case WSA_INVALID_HANDLE:
+      errno = EBADF;
+      break;
+    case WSA_NOT_ENOUGH_MEMORY:
+      errno = ENOMEM;
+      break;
+    case WSA_INVALID_PARAMETER:
+      errno = EINVAL;
+      break;
+    case WSAENAMETOOLONG:
+      errno = ENAMETOOLONG;
+      break;
+    case WSAENOTEMPTY:
+      errno = ENOTEMPTY;
+      break;
+    case WSAEWOULDBLOCK:
+      errno = EWOULDBLOCK;
+      break;
+    case WSAEINPROGRESS:
+      errno = EINPROGRESS;
+      break;
+    case WSAEALREADY:
+      errno = EALREADY;
+      break;
+    case WSAENOTSOCK:
+      errno = ENOTSOCK;
+      break;
+    case WSAEDESTADDRREQ:
+      errno = EDESTADDRREQ;
+      break;
+    case WSAEMSGSIZE:
+      errno = EMSGSIZE;
+      break;
+    case WSAEPROTOTYPE:
+      errno = EPROTOTYPE;
+      break;
+    case WSAENOPROTOOPT:
+      errno = ENOPROTOOPT;
+      break;
+    case WSAEPROTONOSUPPORT:
+      errno = EPROTONOSUPPORT;
+      break;
+    case WSAEOPNOTSUPP:
+      errno = EOPNOTSUPP;
+      break;
+    case WSAEAFNOSUPPORT:
+      errno = EAFNOSUPPORT;
+      break;
+    case WSAEADDRINUSE:
+      errno = EADDRINUSE;
+      break;
+    case WSAEADDRNOTAVAIL:
+      errno = EADDRNOTAVAIL;
+      break;
+    case WSAENETDOWN:
+      errno = ENETDOWN;
+      break;
+    case WSAENETUNREACH:
+      errno = ENETUNREACH;
+      break;
+    case WSAENETRESET:
+      errno = ENETRESET;
+      break;
+    case WSAECONNABORTED:
+      errno = ECONNABORTED;
+      break;
+    case WSAECONNRESET:
+      errno = ECONNRESET;
+      break;
+    case WSAENOBUFS:
+      errno = ENOBUFS;
+      break;
+    case WSAEISCONN:
+      errno = EISCONN;
+      break;
+    case WSAENOTCONN:
+      errno = ENOTCONN;
+      break;
+    case WSAETIMEDOUT:
+      errno = ETIMEDOUT;
+      break;
+    case WSAECONNREFUSED:
+      errno = ECONNREFUSED;
+      break;
+    case WSAELOOP:
+      errno = ELOOP;
+      break;
+    case WSAEHOSTUNREACH:
+      errno = EHOSTUNREACH;
+      break;
+    default:
+      errno = (err > 10000 && err < 10025) ? err - 10000 : err;
+      break;
+    }
+}
diff --git a/tests/warn-on-use.h b/tests/warn-on-use.h
new file mode 100644 (file)
index 0000000..5d5b17f
--- /dev/null
@@ -0,0 +1,149 @@
+/* A C macro for emitting warnings if a function is used.
+   Copyright (C) 2010-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published
+   by the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* _GL_WARN_ON_USE (function, "literal string") issues a declaration
+   for FUNCTION which will then trigger a compiler warning containing
+   the text of "literal string" anywhere that function is called, if
+   supported by the compiler.  If the compiler does not support this
+   feature, the macro expands to an unused extern declaration.
+
+   _GL_WARN_ON_USE_ATTRIBUTE ("literal string") expands to the
+   attribute used in _GL_WARN_ON_USE.  If the compiler does not support
+   this feature, it expands to empty.
+
+   These macros are useful for marking a function as a potential
+   portability trap, with the intent that "literal string" include
+   instructions on the replacement function that should be used
+   instead.
+   _GL_WARN_ON_USE is for functions with 'extern' linkage.
+   _GL_WARN_ON_USE_ATTRIBUTE is for functions with 'static' or 'inline'
+   linkage.
+
+   However, one of the reasons that a function is a portability trap is
+   if it has the wrong signature.  Declaring FUNCTION with a different
+   signature in C is a compilation error, so this macro must use the
+   same type as any existing declaration so that programs that avoid
+   the problematic FUNCTION do not fail to compile merely because they
+   included a header that poisoned the function.  But this implies that
+   _GL_WARN_ON_USE is only safe to use if FUNCTION is known to already
+   have a declaration.  Use of this macro implies that there must not
+   be any other macro hiding the declaration of FUNCTION; but
+   undefining FUNCTION first is part of the poisoning process anyway
+   (although for symbols that are provided only via a macro, the result
+   is a compilation error rather than a warning containing
+   "literal string").  Also note that in C++, it is only safe to use if
+   FUNCTION has no overloads.
+
+   For an example, it is possible to poison 'getline' by:
+   - adding a call to gl_WARN_ON_USE_PREPARE([[#include <stdio.h>]],
+     [getline]) in configure.ac, which potentially defines
+     HAVE_RAW_DECL_GETLINE
+   - adding this code to a header that wraps the system <stdio.h>:
+     #undef getline
+     #if HAVE_RAW_DECL_GETLINE
+     _GL_WARN_ON_USE (getline, "getline is required by POSIX 2008, but"
+       "not universally present; use the gnulib module getline");
+     #endif
+
+   It is not possible to directly poison global variables.  But it is
+   possible to write a wrapper accessor function, and poison that
+   (less common usage, like &environ, will cause a compilation error
+   rather than issue the nice warning, but the end result of informing
+   the developer about their portability problem is still achieved):
+     #if HAVE_RAW_DECL_ENVIRON
+     static char ***
+     rpl_environ (void) { return &environ; }
+     _GL_WARN_ON_USE (rpl_environ, "environ is not always properly declared");
+     # undef environ
+     # define environ (*rpl_environ ())
+     #endif
+   or better (avoiding contradictory use of 'static' and 'extern'):
+     #if HAVE_RAW_DECL_ENVIRON
+     static char ***
+     _GL_WARN_ON_USE_ATTRIBUTE ("environ is not always properly declared")
+     rpl_environ (void) { return &environ; }
+     # undef environ
+     # define environ (*rpl_environ ())
+     #endif
+   */
+#ifndef _GL_WARN_ON_USE
+
+# if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function __attribute__ ((__warning__ (message)))
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
+  __attribute__ ((__warning__ (message)))
+# elif __clang_major__ >= 4
+/* Another compiler attribute is available in clang.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function \
+  __attribute__ ((__diagnose_if__ (1, message, "warning")))
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message) \
+  __attribute__ ((__diagnose_if__ (1, message, "warning")))
+# elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function.  */
+#  define _GL_WARN_ON_USE(function, message) \
+extern __typeof__ (function) function
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message)
+# else /* Unsupported.  */
+#  define _GL_WARN_ON_USE(function, message) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+#  define _GL_WARN_ON_USE_ATTRIBUTE(message)
+# endif
+#endif
+
+/* _GL_WARN_ON_USE_CXX (function, rettype_gcc, rettype_clang, parameters_and_attributes, "message")
+   is like _GL_WARN_ON_USE (function, "message"), except that in C++ mode the
+   function is declared with the given prototype, consisting of return type,
+   parameters, and attributes.
+   This variant is useful for overloaded functions in C++. _GL_WARN_ON_USE does
+   not work in this case.  */
+#ifndef _GL_WARN_ON_USE_CXX
+# if !defined __cplusplus
+#  define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+     _GL_WARN_ON_USE (function, msg)
+# else
+#  if 4 < __GNUC__ || (__GNUC__ == 4 && 3 <= __GNUC_MINOR__)
+/* A compiler attribute is available in gcc versions 4.3.0 and later.  */
+#   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_gcc function parameters_and_attributes \
+  __attribute__ ((__warning__ (msg)))
+#  elif __clang_major__ >= 4
+/* Another compiler attribute is available in clang.  */
+#   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_clang function parameters_and_attributes \
+  __attribute__ ((__diagnose_if__ (1, msg, "warning")))
+#  elif __GNUC__ >= 3 && GNULIB_STRICT_CHECKING
+/* Verify the existence of the function.  */
+#   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+extern rettype_gcc function parameters_and_attributes
+#  else /* Unsupported.  */
+#   define _GL_WARN_ON_USE_CXX(function,rettype_gcc,rettype_clang,parameters_and_attributes,msg) \
+_GL_WARN_EXTERN_C int _gl_warn_on_use
+#  endif
+# endif
+#endif
+
+/* _GL_WARN_EXTERN_C declaration;
+   performs the declaration with C linkage.  */
+#ifndef _GL_WARN_EXTERN_C
+# if defined __cplusplus
+#  define _GL_WARN_EXTERN_C extern "C"
+# else
+#  define _GL_WARN_EXTERN_C extern
+# endif
+#endif
index 15e3ff3..4b85aba 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert wide character to unibyte character.
-   Copyright (C) 2008, 2010-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008, 2010-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
index a6ed971..70308b4 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert wide character to multibyte character.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 int
 wctomb (char *s, wchar_t wc)
index f1d14f5..9c7819a 100644 (file)
@@ -1,5 +1,5 @@
 /* Convert wide character to multibyte character.
-   Copyright (C) 2011-2016 Free Software Foundation, Inc.
+   Copyright (C) 2011-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2011.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
diff --git a/tests/windows-thread.c b/tests/windows-thread.c
new file mode 100644 (file)
index 0000000..34671a2
--- /dev/null
@@ -0,0 +1,243 @@
+/* Creating and controlling threads (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "windows-thread.h"
+
+#include <errno.h>
+#include <process.h>
+#include <stdlib.h>
+
+#include "windows-once.h"
+#include "windows-tls.h"
+
+/* The Thread-Local Storage (TLS) key that allows to access each thread's
+   'struct glwthread_thread_struct *' pointer.  */
+static DWORD self_key = (DWORD)-1;
+
+/* Initializes self_key.  This function must only be called once.  */
+static void
+do_init_self_key (void)
+{
+  self_key = TlsAlloc ();
+  /* If this fails, we're hosed.  */
+  if (self_key == (DWORD)-1)
+    abort ();
+}
+
+/* Initializes self_key.  */
+static void
+init_self_key (void)
+{
+  static glwthread_once_t once = GLWTHREAD_ONCE_INIT;
+  glwthread_once (&once, do_init_self_key);
+}
+
+/* This structure contains information about a thread.
+   It is stored in TLS under key self_key.  */
+struct glwthread_thread_struct
+{
+  /* Fields for managing the handle.  */
+  HANDLE volatile handle;
+  CRITICAL_SECTION handle_lock;
+  /* Fields for managing the exit value.  */
+  BOOL volatile detached;
+  void * volatile result;
+  /* Fields for managing the thread start.  */
+  void * (*func) (void *);
+  void *arg;
+};
+
+/* Return a real HANDLE object for the current thread.  */
+static HANDLE
+get_current_thread_handle (void)
+{
+  HANDLE this_handle;
+
+  /* GetCurrentThread() returns a pseudo-handle, i.e. only a symbolic
+     identifier, not a real handle.  */
+  if (!DuplicateHandle (GetCurrentProcess (), GetCurrentThread (),
+                        GetCurrentProcess (), &this_handle,
+                        0, FALSE, DUPLICATE_SAME_ACCESS))
+    abort ();
+  return this_handle;
+}
+
+glwthread_thread_t
+glwthread_thread_self (void)
+{
+  glwthread_thread_t thread;
+
+  if (self_key == (DWORD)-1)
+    init_self_key ();
+  thread = TlsGetValue (self_key);
+  if (thread == NULL)
+    {
+      /* This happens only in threads that have not been created through
+         glthread_create(), such as the main thread.  */
+      for (;;)
+        {
+          thread =
+            (struct glwthread_thread_struct *)
+            malloc (sizeof (struct glwthread_thread_struct));
+          if (thread != NULL)
+            break;
+          /* Memory allocation failed.  There is not much we can do.  Have to
+             busy-loop, waiting for the availability of memory.  */
+          Sleep (1);
+        }
+
+      thread->handle = get_current_thread_handle ();
+      InitializeCriticalSection (&thread->handle_lock);
+      thread->detached = FALSE; /* This can lead to a memory leak.  */
+      thread->result = NULL; /* just to be deterministic */
+      TlsSetValue (self_key, thread);
+    }
+  return thread;
+}
+
+/* The main function of a freshly creating thread.  It's a wrapper around
+   the FUNC and ARG arguments passed to glthread_create_func.  */
+static unsigned int WINAPI
+wrapper_func (void *varg)
+{
+  struct glwthread_thread_struct *thread =
+    (struct glwthread_thread_struct *) varg;
+
+  EnterCriticalSection (&thread->handle_lock);
+  /* Create a new handle for the thread only if the parent thread did not yet
+     fill in the handle.  */
+  if (thread->handle == NULL)
+    thread->handle = get_current_thread_handle ();
+  LeaveCriticalSection (&thread->handle_lock);
+
+  if (self_key == (DWORD)-1)
+    init_self_key ();
+  TlsSetValue (self_key, thread);
+
+  /* Run the thread.  Store the exit value if the thread was not terminated
+     otherwise.  */
+  thread->result = thread->func (thread->arg);
+
+  /* Process the TLS destructors.  */
+  glwthread_tls_process_destructors ();
+
+  if (thread->detached)
+    {
+      /* Clean up the thread, like thrd_join would do.  */
+      DeleteCriticalSection (&thread->handle_lock);
+      CloseHandle (thread->handle);
+      free (thread);
+    }
+
+  return 0;
+}
+
+int
+glwthread_thread_create (glwthread_thread_t *threadp, unsigned int attr,
+                         void * (*func) (void *), void *arg)
+{
+  struct glwthread_thread_struct *thread =
+    (struct glwthread_thread_struct *)
+    malloc (sizeof (struct glwthread_thread_struct));
+  if (thread == NULL)
+    return ENOMEM;
+  thread->handle = NULL;
+  InitializeCriticalSection (&thread->handle_lock);
+  thread->detached = (attr & GLWTHREAD_ATTR_DETACHED ? TRUE : FALSE);
+  thread->result = NULL; /* just to be deterministic */
+  thread->func = func;
+  thread->arg = arg;
+
+  {
+    unsigned int thread_id;
+    HANDLE thread_handle;
+
+    thread_handle = (HANDLE)
+      _beginthreadex (NULL, 100000, wrapper_func, thread, 0, &thread_id);
+      /* calls CreateThread with the same arguments */
+    if (thread_handle == NULL)
+      {
+        DeleteCriticalSection (&thread->handle_lock);
+        free (thread);
+        return EAGAIN;
+      }
+
+    EnterCriticalSection (&thread->handle_lock);
+    if (thread->handle == NULL)
+      thread->handle = thread_handle;
+    else
+      /* thread->handle was already set by the thread itself.  */
+      CloseHandle (thread_handle);
+    LeaveCriticalSection (&thread->handle_lock);
+
+    *threadp = thread;
+    return 0;
+  }
+}
+
+int
+glwthread_thread_join (glwthread_thread_t thread, void **retvalp)
+{
+  if (thread == NULL)
+    return EINVAL;
+
+  if (thread == glwthread_thread_self ())
+    return EDEADLK;
+
+  if (thread->detached)
+    return EINVAL;
+
+  if (WaitForSingleObject (thread->handle, INFINITE) == WAIT_FAILED)
+    return EINVAL;
+
+  if (retvalp != NULL)
+    *retvalp = thread->result;
+
+  DeleteCriticalSection (&thread->handle_lock);
+  CloseHandle (thread->handle);
+  free (thread);
+
+  return 0;
+}
+
+int
+glwthread_thread_detach (glwthread_thread_t thread)
+{
+  if (thread == NULL)
+    return EINVAL;
+
+  if (thread->detached)
+    return EINVAL;
+
+  thread->detached = TRUE;
+  return 0;
+}
+
+void
+glwthread_thread_exit (void *retval)
+{
+  glwthread_thread_t thread = glwthread_thread_self ();
+  thread->result = retval;
+  glwthread_tls_process_destructors ();
+  _endthreadex (0); /* calls ExitThread (0) */
+  abort ();
+}
diff --git a/tests/windows-thread.h b/tests/windows-thread.h
new file mode 100644 (file)
index 0000000..c496594
--- /dev/null
@@ -0,0 +1,55 @@
+/* Creating and controlling threads (native Windows implementation).
+   Copyright (C) 2005-2021 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <bruno@clisp.org>, 2005.
+   Based on GCC's gthr-win32.h.  */
+
+#ifndef _WINDOWS_THREAD_H
+#define _WINDOWS_THREAD_H
+
+#define WIN32_LEAN_AND_MEAN  /* avoid including junk */
+#include <windows.h>
+
+/* The glwthread_thread_t is a pointer to a structure in memory.
+   Why not the thread handle?  If it were the thread handle, it would be hard
+   to implement glwthread_thread_self() (since GetCurrentThread () returns a
+   pseudo-handle, DuplicateHandle (GetCurrentThread ()) returns a handle that
+   must be closed afterwards, and there is no function for quickly retrieving
+   a thread handle from its id).
+   Why not the thread id?  I tried it.  It did not work: Sometimes ids appeared
+   that did not belong to running threads, and glthread_join failed with ESRCH.
+ */
+typedef struct glwthread_thread_struct *glwthread_thread_t;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* attr is a bit mask, consisting of the following bits: */
+#define GLWTHREAD_ATTR_DETACHED 1
+extern int glwthread_thread_create (glwthread_thread_t *threadp,
+                                    unsigned int attr,
+                                    void * (*func) (void *), void *arg);
+extern int glwthread_thread_join (glwthread_thread_t thread, void **retvalp);
+extern int glwthread_thread_detach (glwthread_thread_t thread);
+extern glwthread_thread_t glwthread_thread_self (void);
+extern _Noreturn void glwthread_thread_exit (void *retval);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _WINDOWS_THREAD_H */
index 8c048e7..9b2b6c5 100644 (file)
@@ -1,5 +1,5 @@
 /* POSIX compatible write() function.
-   Copyright (C) 2008-2016 Free Software Foundation, Inc.
+   Copyright (C) 2008-2021 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2008.
 
    This program is free software: you can redistribute it and/or modify
@@ -13,7 +13,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 #include <config.h>
 
@@ -25,7 +25,7 @@
    GetLastError() = ERROR_NO_DATA, and write() in consequence fails with
    error EINVAL.  */
 
-#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+#if defined _WIN32 && ! defined __CYGWIN__
 
 # include <errno.h>
 # include <signal.h>
 # define WIN32_LEAN_AND_MEAN  /* avoid including junk */
 # include <windows.h>
 
-# include "msvc-inval.h"
-# include "msvc-nothrow.h"
+# if HAVE_MSVC_INVALID_PARAMETER_HANDLER
+#  include "msvc-inval.h"
+# endif
+# if GNULIB_MSVC_NOTHROW
+#  include "msvc-nothrow.h"
+# else
+#  include <io.h>
+# endif
+
+/* Don't assume that UNICODE is not defined.  */
+# undef GetNamedPipeHandleState
+# define GetNamedPipeHandleState GetNamedPipeHandleStateA
 
 # undef write
 
@@ -47,7 +57,7 @@ write_nothrow (int fd, const void *buf, size_t count)
 
   TRY_MSVC_INVAL
     {
-      result = write (fd, buf, count);
+      result = _write (fd, buf, count);
     }
   CATCH_MSVC_INVAL
     {
@@ -59,7 +69,7 @@ write_nothrow (int fd, const void *buf, size_t count)
   return result;
 }
 # else
-#  define write_nothrow write
+#  define write_nothrow _write
 # endif
 
 ssize_t
diff --git a/tests/xconcat-filename.c b/tests/xconcat-filename.c
new file mode 100644 (file)
index 0000000..63769d4
--- /dev/null
@@ -0,0 +1,41 @@
+/* Construct a full filename from a directory and a relative filename.
+   Copyright (C) 2001-2004, 2006-2021 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by the
+   Free Software Foundation; either version 3 of the License, or any
+   later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Bruno Haible <haible@clisp.cons.org>.  */
+
+#include <config.h>
+
+/* Specification.  */
+#include "concat-filename.h"
+
+#include "xalloc.h"
+
+/* Concatenate a directory filename, a relative filename and an optional
+   suffix.  The directory may end with the directory separator.  The second
+   argument may not start with the directory separator (it is relative).
+   Return a freshly allocated filename.  */
+char *
+xconcatenated_filename (const char *directory, const char *filename,
+                        const char *suffix)
+{
+  char *result;
+
+  result = concatenated_filename (directory, filename, suffix);
+  if (result == NULL)
+    xalloc_die ();
+
+  return result;
+}
index e6ff672..bfeff50 100644 (file)
@@ -1,5 +1,5 @@
 /* Return a pointer to a zero-size object in memory.
-   Copyright (C) 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2009-2021 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
 /* ISO C 99 does not allow memcmp(), memchr() etc. to be invoked with a NULL
    argument.  Therefore this file produces a non-NULL pointer which cannot
    be dereferenced, if possible.  */
 
+/* On Android, when targeting Android 4.4 or older with a GCC toolchain,
+   prevent a compilation error
+     "error: call to 'mmap' declared with attribute error: mmap is not
+      available with _FILE_OFFSET_BITS=64 when using GCC until android-21.
+      Either raise your minSdkVersion, disable _FILE_OFFSET_BITS=64, or
+      switch to Clang."
+   The files that we access in this compilation unit are less than 2 GB
+   large.  */
+#if defined __ANDROID__
+# undef _FILE_OFFSET_BITS
+# undef __USE_FILE_OFFSET64
+#endif
+
 #include <stdlib.h>
 
 /* Test whether mmap() and mprotect() are available.
    We don't use HAVE_MMAP, because AC_FUNC_MMAP would not define it on HP-UX.
    HAVE_MPROTECT is not enough, because mingw does not have mmap() but has an
-   mprotect() function in libgcc.a.  */
-#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+   mprotect() function in libgcc.a.
+   And OS/2 kLIBC has <sys/mman.h> and mprotect(), but not mmap().  */
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT && !defined __KLIBC__
 # include <fcntl.h>
 # include <unistd.h>
 # include <sys/types.h>
@@ -45,7 +59,7 @@ zerosize_ptr (void)
 {
 /* Use mmap and mprotect when they exist.  Don't test HAVE_MMAP, because it is
    not defined on HP-UX 11 (since it does not support MAP_FIXED).  */
-#if HAVE_SYS_MMAN_H && HAVE_MPROTECT
+#if HAVE_SYS_MMAN_H && HAVE_MPROTECT && !defined __KLIBC__
 # if HAVE_MAP_ANONYMOUS
   const int flags = MAP_ANONYMOUS | MAP_PRIVATE;
   const int fd = -1;